streamlit-nightly 1.44.2.dev20250407__py3-none-any.whl → 1.44.2.dev20250408__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.
Files changed (79) hide show
  1. streamlit/elements/html.py +49 -6
  2. streamlit/elements/toast.py +1 -1
  3. streamlit/static/index.html +1 -1
  4. streamlit/static/static/js/ErrorOutline.esm.DSjDU6hg.js +1 -0
  5. streamlit/static/static/js/{FileDownload.esm.76_siAan.js → FileDownload.esm.MP0Y7oIj.js} +1 -1
  6. streamlit/static/static/js/{FileHelper.C-t60d9I.js → FileHelper.bnXSo7OV.js} +1 -1
  7. streamlit/static/static/js/{FormClearHelper.BxIPIP5L.js → FormClearHelper.CLDwj9kh.js} +1 -1
  8. streamlit/static/static/js/{Hooks.CsneG6D-.js → Hooks.VjWlz_Rn.js} +1 -1
  9. streamlit/static/static/js/{InputInstructions.CzJqQPUo.js → InputInstructions.DFiLTmz1.js} +1 -1
  10. streamlit/static/static/js/{ProgressBar.rnqmSFc7.js → ProgressBar.off0TGtX.js} +1 -1
  11. streamlit/static/static/js/{RenderInPortalIfExists.BT1iglcq.js → RenderInPortalIfExists.DTskLJHI.js} +1 -1
  12. streamlit/static/static/js/{Toolbar.C-G8EZDL.js → Toolbar.CTu3d8D7.js} +1 -1
  13. streamlit/static/static/js/{base-input.BE23gnVe.js → base-input.C7tRlAIM.js} +1 -1
  14. streamlit/static/static/js/{checkbox.5KG91rAf.js → checkbox.CwTEhBdp.js} +1 -1
  15. streamlit/static/static/js/{createSuper.Djpx0JHn.js → createSuper.Bcw8lad5.js} +1 -1
  16. streamlit/static/static/js/{data-grid-overlay-editor.D5ZEJ6-g.js → data-grid-overlay-editor.DSy1Tixt.js} +1 -1
  17. streamlit/static/static/js/{downloader.2PLh9ewR.js → downloader.DhJkgdqA.js} +1 -1
  18. streamlit/static/static/js/{es6.Co_R4Vrv.js → es6.CwZ1-vgm.js} +2 -2
  19. streamlit/static/static/js/{iframeResizer.contentWindow.xC-s1Xv_.js → iframeResizer.contentWindow.yFVrq6r9.js} +1 -1
  20. streamlit/static/static/js/{index.DhlyA8r5.js → index.BFro_XJQ.js} +1 -1
  21. streamlit/static/static/js/{index.CdIt7R38.js → index.BGIau_un.js} +1 -1
  22. streamlit/static/static/js/{index.DNsBOU6p.js → index.BHyoCuxX.js} +5 -5
  23. streamlit/static/static/js/index.BOdyQmNs.js +1 -0
  24. streamlit/static/static/js/{index.CwBkmOEf.js → index.BPSb4o9f.js} +1 -1
  25. streamlit/static/static/js/index.BQ9nPmTp.js +2 -0
  26. streamlit/static/static/js/{index.DpkiOR-s.js → index.BXAlNua2.js} +1 -1
  27. streamlit/static/static/js/{index.CNErThK-.js → index.Bd_yRoTX.js} +1 -1
  28. streamlit/static/static/js/{index.BLuvs8YB.js → index.BlACkzMt.js} +1 -1
  29. streamlit/static/static/js/{index.3lMrZLLw.js → index.BqlCVjpn.js} +1 -1
  30. streamlit/static/static/js/{index.G5BB57Lk.js → index.BxMQ4DX_.js} +1 -1
  31. streamlit/static/static/js/{index.Cm77Rq1x.js → index.C4T99Mxj.js} +1 -1
  32. streamlit/static/static/js/{index.KrzfTD2f.js → index.CEExGR4M.js} +1 -1
  33. streamlit/static/static/js/{index.CVpc4758.js → index.CG3uYyT0.js} +1 -1
  34. streamlit/static/static/js/{index.CMDu4q8N.js → index.CJdpdElI.js} +1 -1
  35. streamlit/static/static/js/{index.BhwLaup4.js → index.CUNW1kxX.js} +1 -1
  36. streamlit/static/static/js/index.CXcuTOuz.js +12 -0
  37. streamlit/static/static/js/{index.BDb06VAk.js → index.Cdb2iwhg.js} +1 -1
  38. streamlit/static/static/js/{index.DZ1bfx6i.js → index.Ce8fkqNo.js} +1 -1
  39. streamlit/static/static/js/{index.DUB8mvGX.js → index.CenywzOJ.js} +1 -1
  40. streamlit/static/static/js/index.Cs1SIlNX.js +1 -0
  41. streamlit/static/static/js/{index.BhQfRF6s.js → index.D2KtK9h6.js} +1 -1
  42. streamlit/static/static/js/{index.CL9k-WRa.js → index.D5uMU4wi.js} +1 -1
  43. streamlit/static/static/js/{index.5KFYXBbC.js → index.DE24g2po.js} +4 -4
  44. streamlit/static/static/js/{index.CbPbNHEK.js → index.DF2FDvyE.js} +1 -1
  45. streamlit/static/static/js/{index.DIQp9MZY.js → index.DLoUIYPv.js} +1 -1
  46. streamlit/static/static/js/{index.DEqbXo0i.js → index.DV4EUNDN.js} +1 -1
  47. streamlit/static/static/js/{index.C4Lfn2XI.js → index.DWOu8SpX.js} +1 -1
  48. streamlit/static/static/js/{index.BDCmLPQN.js → index.DePtEXKq.js} +1 -1
  49. streamlit/static/static/js/{index.CD3nk9Fu.js → index.Dh-EFSfE.js} +1 -1
  50. streamlit/static/static/js/{index.LEPdg6O5.js → index.DhWU9FLm.js} +1 -1
  51. streamlit/static/static/js/{index.7G_phRf1.js → index.Dkjkylia.js} +1 -1
  52. streamlit/static/static/js/{index.DyhGBqck.js → index.Dolm78OU.js} +1 -1
  53. streamlit/static/static/js/{index.uyVXCnCm.js → index.DumkY_ai.js} +1 -1
  54. streamlit/static/static/js/{index.7c-G8UGV.js → index.S7ytOYeg.js} +1 -1
  55. streamlit/static/static/js/{index.CHq7UPqh.js → index.Vb3YozJZ.js} +1 -1
  56. streamlit/static/static/js/{index.DSs7V2Hz.js → index.ZB5DUbFj.js} +1 -1
  57. streamlit/static/static/js/{input.Dj1y6w2g.js → input.D5p4zjR-.js} +1 -1
  58. streamlit/static/static/js/{memory.ClgbFfRV.js → memory.B-tBAWq8.js} +1 -1
  59. streamlit/static/static/js/{mergeWith.p3MKF-Jv.js → mergeWith.VarEojvY.js} +1 -1
  60. streamlit/static/static/js/{number-overlay-editor.DSy8B0d4.js → number-overlay-editor.DF3YMcvz.js} +1 -1
  61. streamlit/static/static/js/{possibleConstructorReturn.PqdlS9VN.js → possibleConstructorReturn.x0y5Hwao.js} +1 -1
  62. streamlit/static/static/js/{sandbox.JYNAoHIv.js → sandbox.PAmgiyTm.js} +1 -1
  63. streamlit/static/static/js/{textarea.BRz2PqBl.js → textarea.Chzq21af.js} +1 -1
  64. streamlit/static/static/js/{timepicker.CLWT7Rjp.js → timepicker.KqUgVL_2.js} +1 -1
  65. streamlit/static/static/js/{toConsumableArray.BesBwzeG.js → toConsumableArray.CCgVnmHa.js} +1 -1
  66. streamlit/static/static/js/{uniqueId.HRwxnbrd.js → uniqueId.BwdyZDBa.js} +1 -1
  67. streamlit/static/static/js/{useBasicWidgetState.QU3v4y2-.js → useBasicWidgetState.DbFhbmmI.js} +1 -1
  68. streamlit/static/static/js/{useOnInputChange.BbhxtdXj.js → useOnInputChange.CuEy9nYs.js} +1 -1
  69. streamlit/static/static/js/{withFullScreenWrapper.BhOSdZrO.js → withFullScreenWrapper.DJLJxm4u.js} +1 -1
  70. {streamlit_nightly-1.44.2.dev20250407.dist-info → streamlit_nightly-1.44.2.dev20250408.dist-info}/METADATA +1 -1
  71. {streamlit_nightly-1.44.2.dev20250407.dist-info → streamlit_nightly-1.44.2.dev20250408.dist-info}/RECORD +75 -74
  72. streamlit/static/static/js/index.CLlijDQ8.js +0 -12
  73. streamlit/static/static/js/index.CbEMdCQd.js +0 -1
  74. streamlit/static/static/js/index.D8OA-3wz.js +0 -1
  75. streamlit/static/static/js/index.fNuc0k1L.js +0 -2
  76. {streamlit_nightly-1.44.2.dev20250407.data → streamlit_nightly-1.44.2.dev20250408.data}/scripts/streamlit.cmd +0 -0
  77. {streamlit_nightly-1.44.2.dev20250407.dist-info → streamlit_nightly-1.44.2.dev20250408.dist-info}/WHEEL +0 -0
  78. {streamlit_nightly-1.44.2.dev20250407.dist-info → streamlit_nightly-1.44.2.dev20250408.dist-info}/entry_points.txt +0 -0
  79. {streamlit_nightly-1.44.2.dev20250407.dist-info → streamlit_nightly-1.44.2.dev20250408.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.D5ZEJ6-g.js","./index.5KFYXBbC.js","../css/index.DKr_zoDj.css","./FormClearHelper.BxIPIP5L.js","./withFullScreenWrapper.BhOSdZrO.js","./Toolbar.C-G8EZDL.js","./checkbox.5KG91rAf.js","./mergeWith.p3MKF-Jv.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.BesBwzeG.js","./possibleConstructorReturn.PqdlS9VN.js","./createSuper.Djpx0JHn.js","./FileDownload.esm.76_siAan.js","./number-overlay-editor.DSy8B0d4.js","./es6.Co_R4Vrv.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 dt=(e,t,n)=>dh(e,typeof t!="symbol"?t+"":t,n);import{r as g,E as _s,_ as Ke,c as fh,g as wr,R as oe,i as qa,d as co,e as hh,f as gh,h as mh,m as Ic,o as Tc,p as ph,q as Dc,s as vh,t as bh,u as wh,v as yh,w as Ch,x as Sh,a as sr,y as Ls,n as yi,z as Gr,j as lt,F as Oc,A as ya,T as Pc,B as Ca,C as Fn,D as gr,G as Sa,H as Wn,I as _c,J as Zo,K as xh,L as kh,M as We,N as Lc,O as pt,Q as Gi,S as Ur,U as Ya,V as Mh,W as Rh,X as Eh,Y as Dl,Z as Ih,$ as Fc,a0 as Th,a1 as Dh,a2 as Cs,a3 as Ac,a4 as Hc,a5 as Oh,a6 as Ph,a7 as _h,a8 as Lh,a9 as Fh,aa as Ah,ab as Hh,ac as zh,ad as Vh,ae as $h,af as zc,ag as Nh,ah as Bh,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 Mn,l as Fs,at as ji,au as yr,av as Be,aw as Qh,b as Vc,ax as $c,k as eg,ay as tg,az as ng,aA as Xa,aB as rg,aC as ig,aD as og,aE as ag}from"./index.5KFYXBbC.js";import{u as sg}from"./FormClearHelper.BxIPIP5L.js";import{w as lg,u as ug,E as cg}from"./withFullScreenWrapper.BhOSdZrO.js";import{T as dg,a as ci}from"./Toolbar.C-G8EZDL.js";import{L as fg,S as hg,a as gg}from"./checkbox.5KG91rAf.js";import{m as mg}from"./mergeWith.p3MKF-Jv.js";import{s as pg}from"./sprintf.D7DtBTRn.js";import{c as vg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as pr,a as As,C as bg}from"./toConsumableArray.BesBwzeG.js";import{_ as wg,a as yg,b as Cg}from"./possibleConstructorReturn.PqdlS9VN.js";import{_ as Sg}from"./createSuper.Djpx0JHn.js";import{D as xg,F as kg}from"./FileDownload.esm.76_siAan.js";var Nc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(_s,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Nc.displayName="Add";var Bc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(_s,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.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"}))});Bc.displayName="Search";var Wc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(_s,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.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"}))});Wc.displayName="Visibility";function Uc(e="This should not happen"){throw new Error(e)}function An(e,t="Assertion failed"){if(!e)return Uc(t)}function ro(e,t){return Uc(t??"Hell froze over")}function Mg(e,t){try{return e()}catch{return t}}const Ol=Object.prototype.hasOwnProperty;function bi(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--&&bi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ol.call(e,n)&&++r&&!Ol.call(t,n)||!(n in t)||!bi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var Ga,Pl;function Rg(){if(Pl)return Ga;Pl=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ga=n,Ga}var ja,_l;function Eg(){if(_l)return ja;_l=1;var e=Rg(),t=fh();function n(r,i){return r!=null&&t(r,i,e)}return ja=n,ja}var Ig=Eg();const Tg=wr(Ig),ra=null,Hs=void 0;var ne;(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"})(ne||(ne={}));var Ll;(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"})(Ll||(Ll={}));var ia;(function(e){e.Triangle="triangle",e.Dots="dots"})(ia||(ia={}));function Fo(e){return"width"in e&&typeof e.width=="number"}async function Fl(e){return typeof e=="object"?e:await e()}function fi(e){return!(e.kind===ne.Loading||e.kind===ne.Bubble||e.kind===ne.RowID||e.kind===ne.Protected||e.kind===ne.Drilldown)}function gi(e){return e.kind===Yn.Marker||e.kind===Yn.NewRow}function Ki(e){if(!fi(e)||e.kind===ne.Image)return!1;if(e.kind===ne.Text||e.kind===ne.Number||e.kind===ne.Markdown||e.kind===ne.Uri||e.kind===ne.Custom||e.kind===ne.Boolean)return e.readonly!==!0;ro(e,"A cell was passed with an invalid kind")}function Dg(e){return Tg(e,"editor")}function zs(e){return!(e.readonly??!1)}var Yn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Yn||(Yn={}));function Og(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 Al;const mr=class mr{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new mr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Og([...this.items,n]);return new mr(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,a]of n.entries()){const[l,s]=a;if(l<=i&&r<=s){const u=[];l<r&&u.push([l,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new mr(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}};dt(mr,"empty",()=>Al??(Al=new mr([]))),dt(mr,"fromSingleSelection",t=>mr.empty().add(t));let mt=mr;var Pg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(l=>{if(l.startsWith("atm_")){const[,s]=l.split("_");n[s]=l}else r.push(l)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Hl=Pg,_g=e=>e.toUpperCase()===e,Lg=e=>t=>e.indexOf(t)===-1,qc=(e,t)=>{const n={};return Object.keys(e).filter(Lg(t)).forEach(r=>{n[r]=e[r]}),n};function Fg(e,t,n){const r=qc(t,n);if(!e){const i=typeof qa=="function"?{default:qa}:qa;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Ag=(e,t)=>{};function Hg(e){let t="";return n=>{const r=(o,a)=>{const{as:l=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!_g(l[0])):n.propsAsIs,c=Fg(u,o,["as","class"]);c.ref=a,c.className=n.atomic?Hl(n.class,c.className||s):Hl(c.className||s,n.class);const{vars:d}=n;if(d){const h={};for(const p in d){const v=d[p],w=v[0],b=v[1]||"",M=typeof w=="function"?w(o):w;Ag(M,n.name),h[`--${p}`]=`${M}${b}`}const f=c.style||{},m=Object.keys(f);m.length>0&&m.forEach(p=>{h[p]=f[p]}),c.style=h}return e.__linaria&&e!==l?(c.as=l,oe.createElement(e,c)):oe.createElement(l,c)},i=oe.forwardRef?oe.forwardRef(r):o=>{const a=qc(o,["innerRef"]);return r(a,o.innerRef)};return i.displayName=n.name,i.__linaria={className:n.class||t,extends:e},i}}var gn=Hg;const zg=gn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ka={},Ai={},Ao={},Ho={},zl;function Vg(){return zl||(zl=1,function(e){(function(t,n){n(e,co(),hh())})(Ho,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=a(n),o=a(r);function a(b){return b&&b.__esModule?b:{default:b}}var l=Object.assign||function(b){for(var M=1;M<arguments.length;M++){var O=arguments[M];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(b[S]=O[S])}return b};function s(b,M){var O={};for(var S in b)M.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(b,S)&&(O[S]=b[S]);return O}function u(b,M){if(!(b instanceof M))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(M,O){for(var S=0;S<O.length;S++){var R=O[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(M,R.key,R)}}return function(M,O,S){return O&&b(M.prototype,O),S&&b(M,S),M}}();function d(b,M){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:b}function h(b,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);b.prototype=Object.create(M&&M.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(b,M):b.__proto__=M)}var f=!1;function m(b){f=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?b:b.capture}function v(b){if("touches"in b){var M=b.touches[0],O=M.pageX,S=M.pageY;return{x:O,y:S}}var R=b.screenX,_=b.screenY;return{x:R,y:_}}var w=function(b){h(M,b);function M(){var O;u(this,M);for(var S=arguments.length,R=Array(S),_=0;_<S;_++)R[_]=arguments[_];var E=d(this,(O=M.__proto__||Object.getPrototypeOf(M)).call.apply(O,[this].concat(R)));return E._handleSwipeStart=E._handleSwipeStart.bind(E),E._handleSwipeMove=E._handleSwipeMove.bind(E),E._handleSwipeEnd=E._handleSwipeEnd.bind(E),E._onMouseDown=E._onMouseDown.bind(E),E._onMouseMove=E._onMouseMove.bind(E),E._onMouseUp=E._onMouseUp.bind(E),E._setSwiperRef=E._setSwiperRef.bind(E),E}return c(M,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(S){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(S))}},{key:"_onMouseMove",value:function(S){this.mouseDown&&this._handleSwipeMove(S)}},{key:"_onMouseUp",value:function(S){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(S)}},{key:"_handleSwipeStart",value:function(S){var R=v(S),_=R.x,E=R.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(S)}},{key:"_handleSwipeMove",value:function(S){if(this.moveStart){var R=v(S),_=R.x,E=R.y,x=_-this.moveStart.x,L=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x,y:L},S);D&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:x,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(S){this.props.onSwipeEnd(S);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,S):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,S),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,S):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,S)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(S){this.swiper=S,this.props.innerRef(S)}},{key:"render",value:function(){var S=this.props;S.tagName;var R=S.className,_=S.style,E=S.children;S.allowMouseEvents,S.onSwipeUp,S.onSwipeDown,S.onSwipeLeft,S.onSwipeRight,S.onSwipeStart,S.onSwipeMove,S.onSwipeEnd,S.innerRef,S.tolerance;var x=s(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:_},x),E)}}]),M}(n.Component);w.displayName="ReactSwipe",w.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},w.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=w})}(Ho)),Ho}var Vl;function Yc(){return Vl||(Vl=1,function(e){(function(t,n){n(e,Vg())})(Ao,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})}(Ao)),Ao}var Hi={},$l;function Xc(){if($l)return Hi;$l=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=t(gh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,a){return o in i?Object.defineProperty(i,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[o]=a,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,a){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":a==="horizontal","axis-vertical":a!=="horizontal"})},SLIDER:function(o,a){return(0,e.default)({thumbs:!o,slider:o,animated:!a})},ITEM:function(o,a,l){return(0,e.default)({thumb:!o,slide:o,selected:a,previous:l})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Hi.default=r,Hi}var zi={},Vi={},Nl;function $g(){if(Nl)return Vi;Nl=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Vi.outerWidth=e,Vi}var $i={},Bl;function Vs(){if(Bl)return $i;Bl=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,a=i==="horizontal"?[o,0,0]:[0,o,0],l="translate3d",s="("+a.join(",")+")";return l+s};return $i.default=e,$i}var Ni={},Wl;function Gc(){if(Wl)return Ni;Wl=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(){return window};return Ni.default=e,Ni}var Ul;function jc(){if(Ul)return zi;Ul=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var e=s(co()),t=a(Xc()),n=$g(),r=a(Vs()),i=a(Yc()),o=a(Gc());function a(E){return E&&E.__esModule?E:{default:E}}function l(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return l=function(){return E},E}function s(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var x=l();if(x&&x.has(E))return x.get(E);var L={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(L,C,I):L[C]=E[C]}return L.default=E,x&&x.set(E,L),L}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(L){return typeof L}:u=function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},u(E)}function c(){return c=Object.assign||function(E){for(var x=1;x<arguments.length;x++){var L=arguments[x];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(E[D]=L[D])}return E},c.apply(this,arguments)}function d(E,x){if(!(E instanceof x))throw new TypeError("Cannot call a class as a function")}function h(E,x){for(var L=0;L<x.length;L++){var D=x[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function f(E,x,L){return x&&h(E.prototype,x),E}function m(E,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(x&&x.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),x&&p(E,x)}function p(E,x){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,x)}function v(E){var x=M();return function(){var D=O(E),C;if(x){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return w(this,C)}}function w(E,x){return x&&(u(x)==="object"||typeof x=="function")?x:b(E)}function b(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function M(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(E){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)},O(E)}function S(E,x,L){return x in E?Object.defineProperty(E,x,{value:L,enumerable:!0,configurable:!0,writable:!0}):E[x]=L,E}var R=function(x){return x.hasOwnProperty("key")},_=function(E){m(L,E);var x=v(L);function L(D){var C;return d(this,L),C=x.call(this,D),S(b(C),"itemsWrapperRef",void 0),S(b(C),"itemsListRef",void 0),S(b(C),"thumbsRef",void 0),S(b(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),S(b(C),"setItemsListRef",function(I){C.itemsListRef=I}),S(b(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),S(b(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,k=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),z=Math.floor(T/k),N=z<I,X=N?I-z:0;C.setState(function(ie,K){return{itemSize:k,visibleItems:z,firstItem:N?C.getFirstItem(K.selectedItem):0,lastPosition:X,showArrows:N}})}}),S(b(C),"handleClickItem",function(I,T,k){if(!R(k)||k.key==="Enter"){var z=C.props.onSelectItem;typeof z=="function"&&z(I,T)}}),S(b(C),"onSwipeStart",function(){C.setState({swiping:!0})}),S(b(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),S(b(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var k=0,z=e.Children.count(C.props.children),N=-(C.state.firstItem*100)/C.state.visibleItems,X=Math.max(z-C.state.visibleItems,0),ie=-X*100/C.state.visibleItems;N===k&&T>0&&(T=0),N===ie&&T<0&&(T=0);var K=C.itemsWrapperRef.clientWidth,G=N+100/(K/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(le){C.itemsListRef.style[le]=(0,r.default)(G,"%",C.props.axis)}),!0}),S(b(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),S(b(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),S(b(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return f(L,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(C){var I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var k=t.default.ITEM(!1,T===C.state.selectedItem),z={key:T,ref:function(X){return C.setThumbsRef(X,T)},className:k,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},z,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,z={},N=-this.state.firstItem*(this.state.itemSize||0),X=(0,r.default)(N,"px",this.props.axis),ie=this.props.transitionTime+"ms";return z={WebkitTransform:X,MozTransform:X,MsTransform:X,OTransform:X,transform:X,msTransform:X,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(G){return C.setItemsListRef(G)},style:z},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L}(e.Component);return zi.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}),zi}var Bi={},ql;function Ng(){if(ql)return Bi;ql=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=void 0;var e=function(){return document};return Bi.default=e,Bi}var Ln={},Yl;function Kc(){if(Yl)return Ln;Yl=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.setPosition=Ln.getPosition=Ln.isKeyboardEvent=Ln.defaultStatusFormatter=Ln.noop=void 0;var e=co(),t=n(Vs());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Ln.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Ln.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Ln.isKeyboardEvent=o;var a=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 h=-u*c.centerSlidePercentage,f=d-1;return u&&(u!==f||c.infiniteLoop)?h+=(100-c.centerSlidePercentage)/2:u===f&&(h+=100-c.centerSlidePercentage),h}return-u*100};Ln.getPosition=a;var l=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){d[h]=(0,t.default)(u,"%",c)}),d};return Ln.setPosition=l,Ln}var Qn={},Xl;function Bg(){if(Xl)return Qn;Xl=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.fadeAnimationHandler=Qn.slideStopSwipingHandler=Qn.slideSwipeAnimationHandler=Qn.slideAnimationHandler=void 0;var e=co(),t=r(Vs()),n=Kc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,h){var f=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);h&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),f.push.apply(f,m)}return f}function o(d){for(var h=1;h<arguments.length;h++){var f=arguments[h]!=null?arguments[h]:{};h%2?i(Object(f),!0).forEach(function(m){a(d,m,f[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(f)):i(Object(f)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(f,m))})}return d}function a(d,h,f){return h in d?Object.defineProperty(d,h,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[h]=f,d}var l=function(h,f){var m={},p=f.selectedItem,v=p,w=e.Children.count(h.children)-1,b=h.infiniteLoop&&(p<0||p>w);if(b)return v<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(w+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):m.itemListStyle=(0,n.setPosition)(-(w+2)*100,h.axis):v>w&&(m.itemListStyle=(0,n.setPosition)(0,h.axis)),m;var M=(0,n.getPosition)(p,h),O=(0,t.default)(M,"%",h.axis),S=h.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},f.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:S,MozTransitionDuration:S,OTransitionDuration:S,transitionDuration:S,msTransitionDuration:S})),m};Qn.slideAnimationHandler=l;var s=function(h,f,m,p){var v={},w=f.axis==="horizontal",b=e.Children.count(f.children),M=0,O=(0,n.getPosition)(m.selectedItem,f),S=f.infiniteLoop?(0,n.getPosition)(b-1,f)-100:(0,n.getPosition)(b-1,f),R=w?h.x:h.y,_=R;O===M&&R>0&&(_=0),O===S&&R<0&&(_=0);var E=O+100/(m.itemSize/_),x=Math.abs(R)>f.swipeScrollTolerance;return f.infiniteLoop&&x&&(m.selectedItem===0&&E>-100?E-=b*100:m.selectedItem===b-1&&E<-b*100&&(E+=b*100)),(!f.preventMovementUntilSwipeScrollTolerance||x||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),v.itemListStyle=(0,n.setPosition)(E,f.axis)),x&&!m.cancelClick&&p({cancelClick:!0}),v};Qn.slideSwipeAnimationHandler=s;var u=function(h,f){var m=(0,n.getPosition)(f.selectedItem,h),p=(0,n.setPosition)(m,h.axis);return{itemListStyle:p}};Qn.slideStopSwipingHandler=u;var c=function(h,f){var m=h.transitionTime+"ms",p="ease-in-out",v={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return f.swiping||(v=o(o({},v),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:v,selectedStyle:o(o({},v),{},{opacity:1,position:"relative"}),prevStyle:o({},v)}};return Qn.fadeAnimationHandler=c,Qn}var Gl;function Wg(){if(Gl)return Ai;Gl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=c(co()),t=s(Yc()),n=s(Xc()),r=s(jc()),i=s(Ng()),o=s(Gc()),a=Kc(),l=Bg();function s(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||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 k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var z=T?Object.getOwnPropertyDescriptor(D,k):null;z&&(z.get||z.set)?Object.defineProperty(I,k,z):I[k]=D[k]}return I.default=D,C&&C.set(D,I),I}function 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 h(){return h=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},h.apply(this,arguments)}function f(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?f(Object(I),!0).forEach(function(T){x(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):f(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function v(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function w(D,C,I){return C&&v(D.prototype,C),D}function b(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),C&&M(D,C)}function M(D,C){return M=Object.setPrototypeOf||function(T,k){return T.__proto__=k,T},M(D,C)}function O(D){var C=_();return function(){var T=E(D),k;if(C){var z=E(this).constructor;k=Reflect.construct(T,arguments,z)}else k=T.apply(this,arguments);return S(this,k)}}function S(D,C){return C&&(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 x(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var L=function(D){b(I,D);var C=O(I);function I(T){var k;p(this,I),k=C.call(this,T),x(R(k),"thumbsRef",void 0),x(R(k),"carouselWrapperRef",void 0),x(R(k),"listRef",void 0),x(R(k),"itemsRef",void 0),x(R(k),"timer",void 0),x(R(k),"animationHandler",void 0),x(R(k),"setThumbsRef",function(N){k.thumbsRef=N}),x(R(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),x(R(k),"setListRef",function(N){k.listRef=N}),x(R(k),"setItemsRef",function(N,X){k.itemsRef||(k.itemsRef=[]),k.itemsRef[X]=N}),x(R(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),x(R(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),x(R(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),x(R(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),x(R(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),x(R(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),x(R(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var X=k.props.axis,ie=X==="horizontal",K={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},G=ie?K.ArrowRight:K.ArrowDown,le=ie?K.ArrowLeft:K.ArrowUp;G===N.keyCode?k.increment():le===N.keyCode&&k.decrement()}}),x(R(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",X=k.itemsRef[0];if(X){var ie=N?X.clientWidth:X.clientHeight;k.setState({itemSize:ie}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),x(R(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),x(R(k),"handleClickItem",function(N,X){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,X),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),x(R(k),"handleOnChange",function(N,X){e.Children.count(k.props.children)<=1||k.props.onChange(N,X)}),x(R(k),"handleClickThumb",function(N,X){k.props.onClickThumb(N,X),k.moveTo(N)}),x(R(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),x(R(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),x(R(k),"onSwipeMove",function(N,X){k.props.onSwipeMove(X);var ie=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(R(k)));return k.setState(m({},ie)),!!Object.keys(ie).length}),x(R(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),x(R(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),x(R(k),"moveTo",function(N){if(typeof N=="number"){var X=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?X:0),N>X&&(N=k.props.infiniteLoop?0:X),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),x(R(k),"onClickNext",function(){k.increment(1)}),x(R(k),"onClickPrev",function(){k.decrement(1)}),x(R(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(R(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(R(k),"changeItem",function(N){return function(X){(!(0,a.isKeyboardEvent)(X)||X.key==="Enter")&&k.moveTo(N)}}),x(R(k),"selectItem",function(N){k.setState(m({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),x(R(k),"getInitialImage",function(){var N=k.props.selectedItem,X=k.itemsRef&&k.itemsRef[N],ie=X&&X.getElementsByTagName("img")||[];return ie[0]}),x(R(k),"getVariableItemHeight",function(N){var X=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&X&&X.children.length){var ie=X.children[0].getElementsByTagName("img")||[];if(ie.length>0){var K=ie[0];if(!K.complete){var G=function ce(){k.forceUpdate(),K.removeEventListener("load",ce)};K.addEventListener("load",G)}}var le=ie[0]||X.children[0],se=le.clientHeight;return se>0?se:null}return null});var z={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return k.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,k.state=m(m({},z),k.animationHandler(T,z)),k}return w(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,z){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),z.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var k=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var z=k.getInitialImage();z&&!z.complete?z.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var z=this;return this.props.children?e.Children.map(this.props.children,function(N,X){var ie=X===z.state.selectedItem,K=X===z.state.previousItem,G=ie&&z.state.selectedStyle||K&&z.state.prevStyle||z.state.slideStyle||{};z.props.centerMode&&z.props.axis==="horizontal"&&(G=m(m({},G),{},{minWidth:z.props.centerSlidePercentage+"%"})),z.state.swiping&&z.state.swipeMovementStarted&&(G=m(m({},G),{},{pointerEvents:"none"}));var le={ref:function(ce){return z.setItemsRef(ce,X)},key:"itemKey"+X+(k?"clone":""),className:n.default.ITEM(!0,X===z.state.selectedItem,X===z.state.previousItem),onClick:z.handleClickItem.bind(z,X,N),style:G};return e.default.createElement("li",le,z.props.renderItem(N,{isSelected:X===z.state.selectedItem,isPrevious:X===z.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,z=this.props,N=z.showIndicators,X=z.labels,ie=z.renderIndicator,K=z.children;return N?e.default.createElement("ul",{className:"control-dots"},e.Children.map(K,function(G,le){return ie&&ie(k.changeItem(le),le===k.state.selectedItem,le,X.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var z=this.props.swipeable&&e.Children.count(this.props.children)>1,N=this.props.axis==="horizontal",X=this.props.showArrows&&e.Children.count(this.props.children)>1,ie=X&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,K=X&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,G=this.renderItems(!0),le=G.shift(),se=G.pop(),ce={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},he={};if(N){if(ce.onSwipeLeft=this.onSwipeForward,ce.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var Q=this.getVariableItemHeight(this.state.selectedItem);he.height=Q||"auto"}}else ce.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ce.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ce.style=m(m({},ce.style),{},{height:this.state.itemSize}),he.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:he},z?e.default.createElement(t.default,h({tagName:"ul",innerRef:this.setListRef},ce,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&le):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return k.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&le)),this.props.renderArrowNext(this.onClickNext,K,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return Ai.default=L,x(L,"displayName","Carousel"),x(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,k){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(k," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var k=T;if(T.type!=="img"&&(k=e.Children.toArray(T.props.children).find(function(z){return z.type==="img"})),!!k)return k});return I.filter(function(T){return T}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):I},statusFormatter:a.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),Ai}var jl={},Kl;function Ug(){return Kl||(Kl=1),jl}var Zl;function qg(){return Zl||(Zl=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(Wg()),n=Ug(),r=i(jc());function i(o){return o&&o.__esModule?o:{default:o}}}(Ka)),Ka}var Yg=qg(),Za,Jl;function Xg(){if(Jl)return Za;Jl=1;var e=mh(),t=function(){return e.Date.now()};return Za=t,Za}var Ja,Ql;function Zc(){if(Ql)return Ja;Ql=1;var e=Ic(),t=Xg(),n=Tc(),r="Expected a function",i=Math.max,o=Math.min;function a(l,s,u){var c,d,h,f,m,p,v=0,w=!1,b=!1,M=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(u)&&(w=!!u.leading,b="maxWait"in u,h=b?i(n(u.maxWait)||0,s):h,M="trailing"in u?!!u.trailing:M);function O(I){var T=c,k=d;return c=d=void 0,v=I,f=l.apply(k,T),f}function S(I){return v=I,m=setTimeout(E,s),w?O(I):f}function R(I){var T=I-p,k=I-v,z=s-T;return b?o(z,h-k):z}function _(I){var T=I-p,k=I-v;return p===void 0||T>=s||T<0||b&&k>=h}function E(){var I=t();if(_(I))return x(I);m=setTimeout(E,R(I))}function x(I){return m=void 0,M&&c?O(I):(c=d=void 0,f)}function L(){m!==void 0&&clearTimeout(m),v=0,c=p=d=m=void 0}function D(){return m===void 0?f:x(t())}function C(){var I=t(),T=_(I);if(c=arguments,d=this,p=I,T){if(m===void 0)return S(p);if(b)return clearTimeout(m),m=setTimeout(E,s),O(p)}return m===void 0&&(m=setTimeout(E,s)),f}return C.cancel=L,C.flush=D,C}return Ja=a,Ja}var Gg=Zc();const Jc=wr(Gg);function hn(e,t,n,r,i=!1){const o=g.useRef();o.current=t,g.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{var u;(u=o.current)==null||u.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:i}),()=>{a.removeEventListener(e,l,{capture:i})}},[e,n,r,i])}function qr(e,t){return e===void 0?void 0:t}const jg=Math.PI;function eu(e){return e*jg/180}const Qc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),ed=(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}},td=(e,t,n)=>Math.min(e,t-n*2),nd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,$s=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.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"}),g.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"}))},Kg=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Zg(e,t,n){const[r,i]=g.useState(e),o=g.useRef(!0);g.useEffect(()=>()=>{o.current=!1},[]);const a=g.useRef(Jc(l=>{o.current&&i(l)},n));return g.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),r}const Jg="֑-߿יִ-﷽ﹰ-ﻼ",Qg="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",em=new RegExp("^[^"+Qg+"]*["+Jg+"]");function Ns(e){return em.test(e)?"rtl":"not-rtl"}let zo;function Ss(){if(typeof document>"u")return 0;if(zo!==void 0)return zo;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(),zo=n-r,zo}const Br=Symbol();function tm(e){const t=g.useRef([Br,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=g.useState(e),[,i]=g.useState(),o=g.useCallback(l=>{const s=t.current[0];s!==Br&&(l=typeof l=="function"?l(s):l,l===s)||(s!==Br&&i({}),r(u=>typeof l=="function"?l(s===Br?u:s):l),t.current[0]=Br)},[]),a=g.useCallback(()=>{t.current[0]=Br,i({})},[]);return[t.current[0]===Br?n:t.current[0],o,a]}function rd(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 nm(e){const t=g.useRef(e);return bi(e,t.current)||(t.current=e),t.current}const rm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(l=>l!=="");if(o.length===0)return null;const a=o.length>1;return g.createElement(zg,{"data-testid":"GDG-default-image-overlay-editor"},g.createElement(Yg.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(l=>{const s=(i==null?void 0:i(l))??g.createElement("img",{draggable:!1,src:l});return g.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&g.createElement("button",{className:"gdg-edit-icon",onClick:r},g.createElement($s,null)))};function id(){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 jr=id();function im(e){jr=e}const od=/[&<>"']/,om=new RegExp(od.source,"g"),ad=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,am=new RegExp(ad.source,"g"),sm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tu=e=>sm[e];function wn(e,t){if(t){if(od.test(e))return e.replace(om,tu)}else if(ad.test(e))return e.replace(am,tu);return e}const lm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function sd(e){return e.replace(lm,(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 um=/(^|[^\[])\^/g;function $t(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(um,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const cm=/[^\w:]/g,dm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function nu(e,t,n){if(e){let r;try{r=decodeURIComponent(sd(n)).replace(cm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!dm.test(n)&&(n=mm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Vo={},fm=/^[^:]+:\/*[^/]*$/,hm=/^([^:]+:)[\s\S]*$/,gm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function mm(e,t){Vo[" "+e]||(fm.test(e)?Vo[" "+e]=e+"/":Vo[" "+e]=Jo(e,"/",!0)),e=Vo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(hm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(gm,"$1")+t:e+t}const oa={exec:function(){}};function ru(e,t){const n=e.replace(/\|/g,(o,a,l)=>{let s=!1,u=a;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Jo(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 pm(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 vm(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 iu(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function ou(e,t,n,r){const i=t.href,o=t.title?wn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:i,title:o,text:wn(a)}}function bm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.DSy1Tixt.js","./index.DE24g2po.js","../css/index.DKr_zoDj.css","./FormClearHelper.CLDwj9kh.js","./withFullScreenWrapper.DJLJxm4u.js","./Toolbar.CTu3d8D7.js","./checkbox.CwTEhBdp.js","./mergeWith.VarEojvY.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.CCgVnmHa.js","./possibleConstructorReturn.x0y5Hwao.js","./createSuper.Bcw8lad5.js","./FileDownload.esm.MP0Y7oIj.js","./number-overlay-editor.DF3YMcvz.js","./es6.CwZ1-vgm.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 dt=(e,t,n)=>dh(e,typeof t!="symbol"?t+"":t,n);import{r as g,E as _s,_ as Ke,c as fh,g as wr,R as oe,i as qa,d as co,e as hh,f as gh,h as mh,m as Ic,o as Tc,p as ph,q as Dc,s as vh,t as bh,u as wh,v as yh,w as Ch,x as Sh,a as sr,y as Ls,n as yi,z as Gr,j as lt,F as Oc,A as ya,T as Pc,B as Ca,C as Fn,D as gr,G as Sa,H as Wn,I as _c,J as Zo,K as xh,L as kh,M as We,N as Lc,O as pt,Q as Gi,S as Ur,U as Ya,V as Mh,W as Rh,X as Eh,Y as Dl,Z as Ih,$ as Fc,a0 as Th,a1 as Dh,a2 as Cs,a3 as Ac,a4 as Hc,a5 as Oh,a6 as Ph,a7 as _h,a8 as Lh,a9 as Fh,aa as Ah,ab as Hh,ac as zh,ad as Vh,ae as $h,af as zc,ag as Nh,ah as Bh,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 Mn,l as Fs,at as ji,au as yr,av as Be,aw as Qh,b as Vc,ax as $c,k as eg,ay as tg,az as ng,aA as Xa,aB as rg,aC as ig,aD as og,aE as ag}from"./index.DE24g2po.js";import{u as sg}from"./FormClearHelper.CLDwj9kh.js";import{w as lg,u as ug,E as cg}from"./withFullScreenWrapper.DJLJxm4u.js";import{T as dg,a as ci}from"./Toolbar.CTu3d8D7.js";import{L as fg,S as hg,a as gg}from"./checkbox.CwTEhBdp.js";import{m as mg}from"./mergeWith.VarEojvY.js";import{s as pg}from"./sprintf.D7DtBTRn.js";import{c as vg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as pr,a as As,C as bg}from"./toConsumableArray.CCgVnmHa.js";import{_ as wg,a as yg,b as Cg}from"./possibleConstructorReturn.x0y5Hwao.js";import{_ as Sg}from"./createSuper.Bcw8lad5.js";import{D as xg,F as kg}from"./FileDownload.esm.MP0Y7oIj.js";var Nc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(_s,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Nc.displayName="Add";var Bc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(_s,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.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"}))});Bc.displayName="Search";var Wc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(_s,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.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"}))});Wc.displayName="Visibility";function Uc(e="This should not happen"){throw new Error(e)}function An(e,t="Assertion failed"){if(!e)return Uc(t)}function ro(e,t){return Uc(t??"Hell froze over")}function Mg(e,t){try{return e()}catch{return t}}const Ol=Object.prototype.hasOwnProperty;function bi(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--&&bi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ol.call(e,n)&&++r&&!Ol.call(t,n)||!(n in t)||!bi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var Ga,Pl;function Rg(){if(Pl)return Ga;Pl=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ga=n,Ga}var ja,_l;function Eg(){if(_l)return ja;_l=1;var e=Rg(),t=fh();function n(r,i){return r!=null&&t(r,i,e)}return ja=n,ja}var Ig=Eg();const Tg=wr(Ig),ra=null,Hs=void 0;var ne;(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"})(ne||(ne={}));var Ll;(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"})(Ll||(Ll={}));var ia;(function(e){e.Triangle="triangle",e.Dots="dots"})(ia||(ia={}));function Fo(e){return"width"in e&&typeof e.width=="number"}async function Fl(e){return typeof e=="object"?e:await e()}function fi(e){return!(e.kind===ne.Loading||e.kind===ne.Bubble||e.kind===ne.RowID||e.kind===ne.Protected||e.kind===ne.Drilldown)}function gi(e){return e.kind===Yn.Marker||e.kind===Yn.NewRow}function Ki(e){if(!fi(e)||e.kind===ne.Image)return!1;if(e.kind===ne.Text||e.kind===ne.Number||e.kind===ne.Markdown||e.kind===ne.Uri||e.kind===ne.Custom||e.kind===ne.Boolean)return e.readonly!==!0;ro(e,"A cell was passed with an invalid kind")}function Dg(e){return Tg(e,"editor")}function zs(e){return!(e.readonly??!1)}var Yn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Yn||(Yn={}));function Og(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 Al;const mr=class mr{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new mr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Og([...this.items,n]);return new mr(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,a]of n.entries()){const[l,s]=a;if(l<=i&&r<=s){const u=[];l<r&&u.push([l,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new mr(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}};dt(mr,"empty",()=>Al??(Al=new mr([]))),dt(mr,"fromSingleSelection",t=>mr.empty().add(t));let mt=mr;var Pg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(l=>{if(l.startsWith("atm_")){const[,s]=l.split("_");n[s]=l}else r.push(l)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Hl=Pg,_g=e=>e.toUpperCase()===e,Lg=e=>t=>e.indexOf(t)===-1,qc=(e,t)=>{const n={};return Object.keys(e).filter(Lg(t)).forEach(r=>{n[r]=e[r]}),n};function Fg(e,t,n){const r=qc(t,n);if(!e){const i=typeof qa=="function"?{default:qa}:qa;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Ag=(e,t)=>{};function Hg(e){let t="";return n=>{const r=(o,a)=>{const{as:l=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!_g(l[0])):n.propsAsIs,c=Fg(u,o,["as","class"]);c.ref=a,c.className=n.atomic?Hl(n.class,c.className||s):Hl(c.className||s,n.class);const{vars:d}=n;if(d){const h={};for(const p in d){const v=d[p],w=v[0],b=v[1]||"",M=typeof w=="function"?w(o):w;Ag(M,n.name),h[`--${p}`]=`${M}${b}`}const f=c.style||{},m=Object.keys(f);m.length>0&&m.forEach(p=>{h[p]=f[p]}),c.style=h}return e.__linaria&&e!==l?(c.as=l,oe.createElement(e,c)):oe.createElement(l,c)},i=oe.forwardRef?oe.forwardRef(r):o=>{const a=qc(o,["innerRef"]);return r(a,o.innerRef)};return i.displayName=n.name,i.__linaria={className:n.class||t,extends:e},i}}var gn=Hg;const zg=gn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ka={},Ai={},Ao={},Ho={},zl;function Vg(){return zl||(zl=1,function(e){(function(t,n){n(e,co(),hh())})(Ho,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=a(n),o=a(r);function a(b){return b&&b.__esModule?b:{default:b}}var l=Object.assign||function(b){for(var M=1;M<arguments.length;M++){var O=arguments[M];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(b[S]=O[S])}return b};function s(b,M){var O={};for(var S in b)M.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(b,S)&&(O[S]=b[S]);return O}function u(b,M){if(!(b instanceof M))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(M,O){for(var S=0;S<O.length;S++){var R=O[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(M,R.key,R)}}return function(M,O,S){return O&&b(M.prototype,O),S&&b(M,S),M}}();function d(b,M){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:b}function h(b,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);b.prototype=Object.create(M&&M.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(b,M):b.__proto__=M)}var f=!1;function m(b){f=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?b:b.capture}function v(b){if("touches"in b){var M=b.touches[0],O=M.pageX,S=M.pageY;return{x:O,y:S}}var R=b.screenX,_=b.screenY;return{x:R,y:_}}var w=function(b){h(M,b);function M(){var O;u(this,M);for(var S=arguments.length,R=Array(S),_=0;_<S;_++)R[_]=arguments[_];var E=d(this,(O=M.__proto__||Object.getPrototypeOf(M)).call.apply(O,[this].concat(R)));return E._handleSwipeStart=E._handleSwipeStart.bind(E),E._handleSwipeMove=E._handleSwipeMove.bind(E),E._handleSwipeEnd=E._handleSwipeEnd.bind(E),E._onMouseDown=E._onMouseDown.bind(E),E._onMouseMove=E._onMouseMove.bind(E),E._onMouseUp=E._onMouseUp.bind(E),E._setSwiperRef=E._setSwiperRef.bind(E),E}return c(M,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(S){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(S))}},{key:"_onMouseMove",value:function(S){this.mouseDown&&this._handleSwipeMove(S)}},{key:"_onMouseUp",value:function(S){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(S)}},{key:"_handleSwipeStart",value:function(S){var R=v(S),_=R.x,E=R.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(S)}},{key:"_handleSwipeMove",value:function(S){if(this.moveStart){var R=v(S),_=R.x,E=R.y,x=_-this.moveStart.x,L=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x,y:L},S);D&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:x,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(S){this.props.onSwipeEnd(S);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,S):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,S),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,S):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,S)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(S){this.swiper=S,this.props.innerRef(S)}},{key:"render",value:function(){var S=this.props;S.tagName;var R=S.className,_=S.style,E=S.children;S.allowMouseEvents,S.onSwipeUp,S.onSwipeDown,S.onSwipeLeft,S.onSwipeRight,S.onSwipeStart,S.onSwipeMove,S.onSwipeEnd,S.innerRef,S.tolerance;var x=s(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:_},x),E)}}]),M}(n.Component);w.displayName="ReactSwipe",w.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},w.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=w})}(Ho)),Ho}var Vl;function Yc(){return Vl||(Vl=1,function(e){(function(t,n){n(e,Vg())})(Ao,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})}(Ao)),Ao}var Hi={},$l;function Xc(){if($l)return Hi;$l=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=t(gh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,a){return o in i?Object.defineProperty(i,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[o]=a,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,a){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":a==="horizontal","axis-vertical":a!=="horizontal"})},SLIDER:function(o,a){return(0,e.default)({thumbs:!o,slider:o,animated:!a})},ITEM:function(o,a,l){return(0,e.default)({thumb:!o,slide:o,selected:a,previous:l})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Hi.default=r,Hi}var zi={},Vi={},Nl;function $g(){if(Nl)return Vi;Nl=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Vi.outerWidth=e,Vi}var $i={},Bl;function Vs(){if(Bl)return $i;Bl=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,a=i==="horizontal"?[o,0,0]:[0,o,0],l="translate3d",s="("+a.join(",")+")";return l+s};return $i.default=e,$i}var Ni={},Wl;function Gc(){if(Wl)return Ni;Wl=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var e=function(){return window};return Ni.default=e,Ni}var Ul;function jc(){if(Ul)return zi;Ul=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var e=s(co()),t=a(Xc()),n=$g(),r=a(Vs()),i=a(Yc()),o=a(Gc());function a(E){return E&&E.__esModule?E:{default:E}}function l(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return l=function(){return E},E}function s(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var x=l();if(x&&x.has(E))return x.get(E);var L={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(L,C,I):L[C]=E[C]}return L.default=E,x&&x.set(E,L),L}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(L){return typeof L}:u=function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},u(E)}function c(){return c=Object.assign||function(E){for(var x=1;x<arguments.length;x++){var L=arguments[x];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(E[D]=L[D])}return E},c.apply(this,arguments)}function d(E,x){if(!(E instanceof x))throw new TypeError("Cannot call a class as a function")}function h(E,x){for(var L=0;L<x.length;L++){var D=x[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function f(E,x,L){return x&&h(E.prototype,x),E}function m(E,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(x&&x.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),x&&p(E,x)}function p(E,x){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,x)}function v(E){var x=M();return function(){var D=O(E),C;if(x){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return w(this,C)}}function w(E,x){return x&&(u(x)==="object"||typeof x=="function")?x:b(E)}function b(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function M(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(E){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)},O(E)}function S(E,x,L){return x in E?Object.defineProperty(E,x,{value:L,enumerable:!0,configurable:!0,writable:!0}):E[x]=L,E}var R=function(x){return x.hasOwnProperty("key")},_=function(E){m(L,E);var x=v(L);function L(D){var C;return d(this,L),C=x.call(this,D),S(b(C),"itemsWrapperRef",void 0),S(b(C),"itemsListRef",void 0),S(b(C),"thumbsRef",void 0),S(b(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),S(b(C),"setItemsListRef",function(I){C.itemsListRef=I}),S(b(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),S(b(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,k=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),z=Math.floor(T/k),N=z<I,X=N?I-z:0;C.setState(function(ie,K){return{itemSize:k,visibleItems:z,firstItem:N?C.getFirstItem(K.selectedItem):0,lastPosition:X,showArrows:N}})}}),S(b(C),"handleClickItem",function(I,T,k){if(!R(k)||k.key==="Enter"){var z=C.props.onSelectItem;typeof z=="function"&&z(I,T)}}),S(b(C),"onSwipeStart",function(){C.setState({swiping:!0})}),S(b(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),S(b(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var k=0,z=e.Children.count(C.props.children),N=-(C.state.firstItem*100)/C.state.visibleItems,X=Math.max(z-C.state.visibleItems,0),ie=-X*100/C.state.visibleItems;N===k&&T>0&&(T=0),N===ie&&T<0&&(T=0);var K=C.itemsWrapperRef.clientWidth,G=N+100/(K/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(le){C.itemsListRef.style[le]=(0,r.default)(G,"%",C.props.axis)}),!0}),S(b(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),S(b(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),S(b(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return f(L,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(C){var I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var k=t.default.ITEM(!1,T===C.state.selectedItem),z={key:T,ref:function(X){return C.setThumbsRef(X,T)},className:k,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},z,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,z={},N=-this.state.firstItem*(this.state.itemSize||0),X=(0,r.default)(N,"px",this.props.axis),ie=this.props.transitionTime+"ms";return z={WebkitTransform:X,MozTransform:X,MsTransform:X,OTransform:X,transform:X,msTransform:X,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(G){return C.setItemsListRef(G)},style:z},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L}(e.Component);return zi.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}),zi}var Bi={},ql;function Ng(){if(ql)return Bi;ql=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=void 0;var e=function(){return document};return Bi.default=e,Bi}var Ln={},Yl;function Kc(){if(Yl)return Ln;Yl=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.setPosition=Ln.getPosition=Ln.isKeyboardEvent=Ln.defaultStatusFormatter=Ln.noop=void 0;var e=co(),t=n(Vs());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Ln.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Ln.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Ln.isKeyboardEvent=o;var a=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 h=-u*c.centerSlidePercentage,f=d-1;return u&&(u!==f||c.infiniteLoop)?h+=(100-c.centerSlidePercentage)/2:u===f&&(h+=100-c.centerSlidePercentage),h}return-u*100};Ln.getPosition=a;var l=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){d[h]=(0,t.default)(u,"%",c)}),d};return Ln.setPosition=l,Ln}var Qn={},Xl;function Bg(){if(Xl)return Qn;Xl=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.fadeAnimationHandler=Qn.slideStopSwipingHandler=Qn.slideSwipeAnimationHandler=Qn.slideAnimationHandler=void 0;var e=co(),t=r(Vs()),n=Kc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,h){var f=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);h&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),f.push.apply(f,m)}return f}function o(d){for(var h=1;h<arguments.length;h++){var f=arguments[h]!=null?arguments[h]:{};h%2?i(Object(f),!0).forEach(function(m){a(d,m,f[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(f)):i(Object(f)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(f,m))})}return d}function a(d,h,f){return h in d?Object.defineProperty(d,h,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[h]=f,d}var l=function(h,f){var m={},p=f.selectedItem,v=p,w=e.Children.count(h.children)-1,b=h.infiniteLoop&&(p<0||p>w);if(b)return v<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(w+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):m.itemListStyle=(0,n.setPosition)(-(w+2)*100,h.axis):v>w&&(m.itemListStyle=(0,n.setPosition)(0,h.axis)),m;var M=(0,n.getPosition)(p,h),O=(0,t.default)(M,"%",h.axis),S=h.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},f.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:S,MozTransitionDuration:S,OTransitionDuration:S,transitionDuration:S,msTransitionDuration:S})),m};Qn.slideAnimationHandler=l;var s=function(h,f,m,p){var v={},w=f.axis==="horizontal",b=e.Children.count(f.children),M=0,O=(0,n.getPosition)(m.selectedItem,f),S=f.infiniteLoop?(0,n.getPosition)(b-1,f)-100:(0,n.getPosition)(b-1,f),R=w?h.x:h.y,_=R;O===M&&R>0&&(_=0),O===S&&R<0&&(_=0);var E=O+100/(m.itemSize/_),x=Math.abs(R)>f.swipeScrollTolerance;return f.infiniteLoop&&x&&(m.selectedItem===0&&E>-100?E-=b*100:m.selectedItem===b-1&&E<-b*100&&(E+=b*100)),(!f.preventMovementUntilSwipeScrollTolerance||x||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),v.itemListStyle=(0,n.setPosition)(E,f.axis)),x&&!m.cancelClick&&p({cancelClick:!0}),v};Qn.slideSwipeAnimationHandler=s;var u=function(h,f){var m=(0,n.getPosition)(f.selectedItem,h),p=(0,n.setPosition)(m,h.axis);return{itemListStyle:p}};Qn.slideStopSwipingHandler=u;var c=function(h,f){var m=h.transitionTime+"ms",p="ease-in-out",v={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return f.swiping||(v=o(o({},v),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:v,selectedStyle:o(o({},v),{},{opacity:1,position:"relative"}),prevStyle:o({},v)}};return Qn.fadeAnimationHandler=c,Qn}var Gl;function Wg(){if(Gl)return Ai;Gl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=c(co()),t=s(Yc()),n=s(Xc()),r=s(jc()),i=s(Ng()),o=s(Gc()),a=Kc(),l=Bg();function s(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||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 k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var z=T?Object.getOwnPropertyDescriptor(D,k):null;z&&(z.get||z.set)?Object.defineProperty(I,k,z):I[k]=D[k]}return I.default=D,C&&C.set(D,I),I}function 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 h(){return h=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},h.apply(this,arguments)}function f(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?f(Object(I),!0).forEach(function(T){x(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):f(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function v(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function w(D,C,I){return C&&v(D.prototype,C),D}function b(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),C&&M(D,C)}function M(D,C){return M=Object.setPrototypeOf||function(T,k){return T.__proto__=k,T},M(D,C)}function O(D){var C=_();return function(){var T=E(D),k;if(C){var z=E(this).constructor;k=Reflect.construct(T,arguments,z)}else k=T.apply(this,arguments);return S(this,k)}}function S(D,C){return C&&(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 x(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var L=function(D){b(I,D);var C=O(I);function I(T){var k;p(this,I),k=C.call(this,T),x(R(k),"thumbsRef",void 0),x(R(k),"carouselWrapperRef",void 0),x(R(k),"listRef",void 0),x(R(k),"itemsRef",void 0),x(R(k),"timer",void 0),x(R(k),"animationHandler",void 0),x(R(k),"setThumbsRef",function(N){k.thumbsRef=N}),x(R(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),x(R(k),"setListRef",function(N){k.listRef=N}),x(R(k),"setItemsRef",function(N,X){k.itemsRef||(k.itemsRef=[]),k.itemsRef[X]=N}),x(R(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),x(R(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),x(R(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),x(R(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),x(R(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),x(R(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),x(R(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var X=k.props.axis,ie=X==="horizontal",K={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},G=ie?K.ArrowRight:K.ArrowDown,le=ie?K.ArrowLeft:K.ArrowUp;G===N.keyCode?k.increment():le===N.keyCode&&k.decrement()}}),x(R(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",X=k.itemsRef[0];if(X){var ie=N?X.clientWidth:X.clientHeight;k.setState({itemSize:ie}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),x(R(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),x(R(k),"handleClickItem",function(N,X){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,X),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),x(R(k),"handleOnChange",function(N,X){e.Children.count(k.props.children)<=1||k.props.onChange(N,X)}),x(R(k),"handleClickThumb",function(N,X){k.props.onClickThumb(N,X),k.moveTo(N)}),x(R(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),x(R(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),x(R(k),"onSwipeMove",function(N,X){k.props.onSwipeMove(X);var ie=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(R(k)));return k.setState(m({},ie)),!!Object.keys(ie).length}),x(R(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),x(R(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),x(R(k),"moveTo",function(N){if(typeof N=="number"){var X=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?X:0),N>X&&(N=k.props.infiniteLoop?0:X),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),x(R(k),"onClickNext",function(){k.increment(1)}),x(R(k),"onClickPrev",function(){k.decrement(1)}),x(R(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(R(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(R(k),"changeItem",function(N){return function(X){(!(0,a.isKeyboardEvent)(X)||X.key==="Enter")&&k.moveTo(N)}}),x(R(k),"selectItem",function(N){k.setState(m({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),x(R(k),"getInitialImage",function(){var N=k.props.selectedItem,X=k.itemsRef&&k.itemsRef[N],ie=X&&X.getElementsByTagName("img")||[];return ie[0]}),x(R(k),"getVariableItemHeight",function(N){var X=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&X&&X.children.length){var ie=X.children[0].getElementsByTagName("img")||[];if(ie.length>0){var K=ie[0];if(!K.complete){var G=function ce(){k.forceUpdate(),K.removeEventListener("load",ce)};K.addEventListener("load",G)}}var le=ie[0]||X.children[0],se=le.clientHeight;return se>0?se:null}return null});var z={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return k.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,k.state=m(m({},z),k.animationHandler(T,z)),k}return w(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,z){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),z.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var k=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var z=k.getInitialImage();z&&!z.complete?z.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var z=this;return this.props.children?e.Children.map(this.props.children,function(N,X){var ie=X===z.state.selectedItem,K=X===z.state.previousItem,G=ie&&z.state.selectedStyle||K&&z.state.prevStyle||z.state.slideStyle||{};z.props.centerMode&&z.props.axis==="horizontal"&&(G=m(m({},G),{},{minWidth:z.props.centerSlidePercentage+"%"})),z.state.swiping&&z.state.swipeMovementStarted&&(G=m(m({},G),{},{pointerEvents:"none"}));var le={ref:function(ce){return z.setItemsRef(ce,X)},key:"itemKey"+X+(k?"clone":""),className:n.default.ITEM(!0,X===z.state.selectedItem,X===z.state.previousItem),onClick:z.handleClickItem.bind(z,X,N),style:G};return e.default.createElement("li",le,z.props.renderItem(N,{isSelected:X===z.state.selectedItem,isPrevious:X===z.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,z=this.props,N=z.showIndicators,X=z.labels,ie=z.renderIndicator,K=z.children;return N?e.default.createElement("ul",{className:"control-dots"},e.Children.map(K,function(G,le){return ie&&ie(k.changeItem(le),le===k.state.selectedItem,le,X.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var z=this.props.swipeable&&e.Children.count(this.props.children)>1,N=this.props.axis==="horizontal",X=this.props.showArrows&&e.Children.count(this.props.children)>1,ie=X&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,K=X&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,G=this.renderItems(!0),le=G.shift(),se=G.pop(),ce={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},he={};if(N){if(ce.onSwipeLeft=this.onSwipeForward,ce.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var Q=this.getVariableItemHeight(this.state.selectedItem);he.height=Q||"auto"}}else ce.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ce.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ce.style=m(m({},ce.style),{},{height:this.state.itemSize}),he.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:he},z?e.default.createElement(t.default,h({tagName:"ul",innerRef:this.setListRef},ce,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&le):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return k.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&le)),this.props.renderArrowNext(this.onClickNext,K,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return Ai.default=L,x(L,"displayName","Carousel"),x(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,k){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(k," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var k=T;if(T.type!=="img"&&(k=e.Children.toArray(T.props.children).find(function(z){return z.type==="img"})),!!k)return k});return I.filter(function(T){return T}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):I},statusFormatter:a.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),Ai}var jl={},Kl;function Ug(){return Kl||(Kl=1),jl}var Zl;function qg(){return Zl||(Zl=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(Wg()),n=Ug(),r=i(jc());function i(o){return o&&o.__esModule?o:{default:o}}}(Ka)),Ka}var Yg=qg(),Za,Jl;function Xg(){if(Jl)return Za;Jl=1;var e=mh(),t=function(){return e.Date.now()};return Za=t,Za}var Ja,Ql;function Zc(){if(Ql)return Ja;Ql=1;var e=Ic(),t=Xg(),n=Tc(),r="Expected a function",i=Math.max,o=Math.min;function a(l,s,u){var c,d,h,f,m,p,v=0,w=!1,b=!1,M=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(u)&&(w=!!u.leading,b="maxWait"in u,h=b?i(n(u.maxWait)||0,s):h,M="trailing"in u?!!u.trailing:M);function O(I){var T=c,k=d;return c=d=void 0,v=I,f=l.apply(k,T),f}function S(I){return v=I,m=setTimeout(E,s),w?O(I):f}function R(I){var T=I-p,k=I-v,z=s-T;return b?o(z,h-k):z}function _(I){var T=I-p,k=I-v;return p===void 0||T>=s||T<0||b&&k>=h}function E(){var I=t();if(_(I))return x(I);m=setTimeout(E,R(I))}function x(I){return m=void 0,M&&c?O(I):(c=d=void 0,f)}function L(){m!==void 0&&clearTimeout(m),v=0,c=p=d=m=void 0}function D(){return m===void 0?f:x(t())}function C(){var I=t(),T=_(I);if(c=arguments,d=this,p=I,T){if(m===void 0)return S(p);if(b)return clearTimeout(m),m=setTimeout(E,s),O(p)}return m===void 0&&(m=setTimeout(E,s)),f}return C.cancel=L,C.flush=D,C}return Ja=a,Ja}var Gg=Zc();const Jc=wr(Gg);function hn(e,t,n,r,i=!1){const o=g.useRef();o.current=t,g.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{var u;(u=o.current)==null||u.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:i}),()=>{a.removeEventListener(e,l,{capture:i})}},[e,n,r,i])}function qr(e,t){return e===void 0?void 0:t}const jg=Math.PI;function eu(e){return e*jg/180}const Qc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),ed=(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}},td=(e,t,n)=>Math.min(e,t-n*2),nd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,$s=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.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"}),g.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"}))},Kg=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Zg(e,t,n){const[r,i]=g.useState(e),o=g.useRef(!0);g.useEffect(()=>()=>{o.current=!1},[]);const a=g.useRef(Jc(l=>{o.current&&i(l)},n));return g.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),r}const Jg="֑-߿יִ-﷽ﹰ-ﻼ",Qg="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",em=new RegExp("^[^"+Qg+"]*["+Jg+"]");function Ns(e){return em.test(e)?"rtl":"not-rtl"}let zo;function Ss(){if(typeof document>"u")return 0;if(zo!==void 0)return zo;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(),zo=n-r,zo}const Br=Symbol();function tm(e){const t=g.useRef([Br,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=g.useState(e),[,i]=g.useState(),o=g.useCallback(l=>{const s=t.current[0];s!==Br&&(l=typeof l=="function"?l(s):l,l===s)||(s!==Br&&i({}),r(u=>typeof l=="function"?l(s===Br?u:s):l),t.current[0]=Br)},[]),a=g.useCallback(()=>{t.current[0]=Br,i({})},[]);return[t.current[0]===Br?n:t.current[0],o,a]}function rd(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 nm(e){const t=g.useRef(e);return bi(e,t.current)||(t.current=e),t.current}const rm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(l=>l!=="");if(o.length===0)return null;const a=o.length>1;return g.createElement(zg,{"data-testid":"GDG-default-image-overlay-editor"},g.createElement(Yg.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(l=>{const s=(i==null?void 0:i(l))??g.createElement("img",{draggable:!1,src:l});return g.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&g.createElement("button",{className:"gdg-edit-icon",onClick:r},g.createElement($s,null)))};function id(){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 jr=id();function im(e){jr=e}const od=/[&<>"']/,om=new RegExp(od.source,"g"),ad=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,am=new RegExp(ad.source,"g"),sm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tu=e=>sm[e];function wn(e,t){if(t){if(od.test(e))return e.replace(om,tu)}else if(ad.test(e))return e.replace(am,tu);return e}const lm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function sd(e){return e.replace(lm,(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 um=/(^|[^\[])\^/g;function $t(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(um,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const cm=/[^\w:]/g,dm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function nu(e,t,n){if(e){let r;try{r=decodeURIComponent(sd(n)).replace(cm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!dm.test(n)&&(n=mm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Vo={},fm=/^[^:]+:\/*[^/]*$/,hm=/^([^:]+:)[\s\S]*$/,gm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function mm(e,t){Vo[" "+e]||(fm.test(e)?Vo[" "+e]=e+"/":Vo[" "+e]=Jo(e,"/",!0)),e=Vo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(hm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(gm,"$1")+t:e+t}const oa={exec:function(){}};function ru(e,t){const n=e.replace(/\|/g,(o,a,l)=>{let s=!1,u=a;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Jo(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 pm(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 vm(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 iu(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function ou(e,t,n,r){const i=t.href,o=t.title?wn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:i,title:o,text:wn(a)}}function bm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[a]=o;return a.length>=r.length?i.slice(r.length):i}).join(`
4
4
  `)}class Bs{constructor(t){this.options=t||jr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Jo(r,`
5
5
  `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=bm(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=Jo(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,a,l,s,u,c,d,h,f,m,p=n[1].trim();const v=p.length>1,w={type:"list",raw:"",ordered:v,start:v?+p.slice(0,-1):"",loose:!1,items:[]};p=v?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=v?p:"[*+-]");const b=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(`
@@ -169,10 +169,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
169
169
  `?(r.push(e.slice(i,a)),i=a+1,l===`
170
170
  `&&(n.push(r),r=[])):l==='"'&&(o=t.inString);break;case t.inString:l==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:l==='"'?o=t.inString:((l===" "||l===`
171
171
  `)&&(r.push(Du(e.slice(i,a))),i=a+1,l===`
172
- `&&(n.push(r),r=[])),o=t.None);break}a++}return i<e.length&&r.push(Du(e.slice(i,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Ou(e,t,n){var l;const r=A0(e,t),i=s=>{var u;(u=window.navigator.clipboard)==null||u.writeText(s)},o=(s,u)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([s],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(s,u)=>{var c,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",s),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(s,u)||i(s)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(r.textPlain,r.textHtml):i(r.textPlain),n==null||n.preventDefault()}function Ad(e){return e!==!0}function Pu(e){return typeof e=="string"?e:`${e}px`}const V0=()=>e=>e.innerWidth,$0=()=>e=>e.innerHeight,N0=gn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[V0()],"wmyidgi-1":[$0()]}}),B0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return g.createElement(N0,{innerHeight:Pu(n),innerWidth:Pu(t),...i},r)},W0=2,U0=1300;function q0(e,t,n){const r=oe.useRef(0),[i,o]=e??[0,0];oe.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let a=!1,l=0;const s=u=>{var c;if(!a){if(l===0)l=u;else{const d=u-l;r.current=Math.min(1,r.current+d/U0);const h=r.current**1.618*d*W0;(c=t.current)==null||c.scrollBy(i*h,o*h),l=u,n==null||n()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,i,o,n])}function Y0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:a,remSize:l}){const[s,u,c,d,h,f]=oe.useMemo(()=>{if(!a||l===16)return[e,t,n,r,i,o];const m=l/16,p=e,v=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)??v.headerIconSize)*m,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??v.cellHorizontalPadding)*m,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??v.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,l,e,a,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:h,overscrollY:f}}const Tr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function _u(e){const t=ua.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function X0(e){const t=nm(e);return oe.useMemo(()=>{if(t===void 0)return _u(Tr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Tr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Tr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Tr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Tr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Tr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Tr.selectToLastCell};return _u({...Tr,...n})},[t])}function G0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const a={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(a.subGroups=r.subGroups.map((l,s)=>t(l,i+1,[...o,s])).sort((l,s)=>l.headerIndex-s.headerIndex)),a}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Ks(e,t){const n=[];function r(a,l,s=!1){let u=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:s,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const d=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:l;r(a.subGroups[c],d,s||a.isCollapsed)}}const i=G0(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...s}=a;return s})}function da(e,t){if(t===void 0||Ks.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(n--,!r.isCollapsed){if(n<r.rows)return{path:[...r.path,n],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:r.contentIndex+n,groupRows:r.rows};n-=r.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function j0(e,t,n,r){const i=oe.useMemo(()=>e===void 0?void 0:Ks(e,t),[e,t]),o=oe.useMemo(()=>i===void 0?t:i.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[i,t]),a=oe.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=da(u,i);return c?e.height:typeof n=="number"?n:n(u)},[i,e,n]),l=oe.useCallback(u=>{if(i===void 0)return u;let c=u;for(const d of i){if(c===0)return;if(c--,!d.isCollapsed){if(c<d.rows)return d.contentIndex+c;c-=d.rows}}return u},[i]),s=qr(r??(e==null?void 0:e.themeOverride),oe.useCallback(u=>{if(e===void 0)return r==null?void 0:r(u,u,u);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:d,groupIndex:h}=da(u,i);return c?e.themeOverride:r==null?void 0:r(u,h,d)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:s}:{rowHeight:a,rows:o,rowNumberMapper:l,getRowThemeOverride:s}}function K0(e,t){const n=oe.useMemo(()=>e===void 0?void 0:Ks(e,t),[e,t]);return{getRowGroupingForPath:zd,updateRowGroupingByPath:Hd,mapper:oe.useCallback(r=>{if(typeof r=="number")return da(r,n);const i=da(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,a)=>a===r?{...o,...n}:o):e.map((o,a)=>a===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 Z0(e,t){const[n]=g.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 J0(e,t,n,r,i){const[o,a]=g.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=g.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,o]),[s,u,c]=tm(l),d=g.useRef(i);d.current=i;const h=Z0(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),f=(s.height??1)>1;g.useLayoutEffect(()=>{if(t!==void 0&&h.current!==null&&f){if(h.current.scrollTop===t)return;h.current.scrollTop=t,h.current.scrollTop!==t&&c(),d.current()}},[t,f,c,h]);const m=(s.width??1)>1;return g.useLayoutEffect(()=>{if(e!==void 0&&h.current!==null&&m){if(h.current.scrollLeft===e)return;h.current.scrollLeft=e,h.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,h]),{visibleRegion:s,setVisibleRegion:u,scrollRef:h}}const Q0=g.lazy(async()=>await Ls(()=>import("./data-grid-overlay-editor.D5ZEJ6-g.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let ev=0;function tv(e){return op(wu(wu(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return sr((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function No(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 Bo={kind:ne.Loading,allowOverlay:!1},Wo={columns:mt.empty(),rows:mt.empty(),current:void 0},nv=(e,t)=>{var El,Il,Tl;const[n,r]=g.useState(Wo),[i,o]=g.useState(),a=g.useRef(null),l=g.useRef(null),[s,u]=g.useState(),c=g.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:h,getRowThemeOverride:f,markdownDivCreateNode:m,width:p,height:v,columns:w,rows:b,getCellContent:M,onCellClicked:O,onCellActivated:S,onFillPattern:R,onFinishedEditing:_,coercePasteValue:E,drawHeader:x,drawCell:L,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:z,onCellContextMenu:N,className:X,onHeaderContextMenu:ie,getCellsForSelection:K,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:le,onCellEdited:se,onCellsEdited:ce,onSearchResultsChanged:he,searchResults:Q,onSearchValueChange:H,searchValue:P,onKeyDown:W,onKeyUp:de,keybindings:Oe,editOnType:Ve=!0,onRowAppended:Ce,onColumnMoved:Ee,validateCell:xe,highlightRegions:Tt,rangeSelect:wt="rect",columnSelect:it="multi",rowSelect:ue="multi",rangeSelectionBlending:tt="exclusive",columnSelectionBlending:ve="exclusive",rowSelectionBlending:ge="exclusive",onDelete:pe,onDragStart:$e,onMouseMove:_e,onPaste:nt,copyHeaders:be=!1,freezeColumns:fe=0,cellActivationBehavior:ot="second-click",rowSelectionMode:ze="auto",onHeaderMenuClick:et,onHeaderIndicatorClick:vt,getGroupDetails:ht,rowGrouping:Ne,onSearchClose:Dt,onItemHovered:qt,onSelectionCleared:St,showSearch:Pt,onVisibleRegionChanged:tn,gridSelection:Rt,onGridSelectionChange:sn,minColumnWidth:At=50,maxColumnWidth:Et=500,maxColumnAutoWidth:Dn,provideEditor:yn,trailingRowOptions:Pe,freezeTrailingRows:Ht=0,allowedFillDirections:dn="orthogonal",scrollOffsetX:mn,scrollOffsetY:pn,verticalBorder:st,onDragOverCell:Nt,onDrop:_t,onColumnResize:nn,onColumnResizeEnd:xt,onColumnResizeStart:Lt,customRenderers:Je,fillHandle:Bt,experimental:Ot,fixedShadowX:zt,fixedShadowY:Vt,headerIcons:Cn,imageWindowLoader:dr,initialSize:On,isDraggable:V,onDragLeave:Qe,onRowMoved:te,overscrollX:Le,overscrollY:Gt,preventDiagonalScrolling:Zt,rightElement:rn,rightElementProps:Sn,trapFocus:Yt=!1,smoothScrollX:fn,smoothScrollY:vn,scaleToRem:tr=!1,rowHeight:go=34,headerHeight:mo=36,groupHeaderHeight:Ea=mo,theme:Qr,isOutsideClick:Cr,renderers:Ci,resizeIndicator:Ia,scrollToActiveCell:Si=!0,drawFocusRing:xi=!0}=e,Fr=xi==="no-editor"?i===void 0:xi,Jt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Rn=(Jt==null?void 0:Jt.kind)??e.rowMarkers??"none",ki=(Jt==null?void 0:Jt.width)??e.rowMarkerWidth,Mi=(Jt==null?void 0:Jt.startIndex)??e.rowMarkerStartIndex??1,ei=(Jt==null?void 0:Jt.theme)??e.rowMarkerTheme,fr=Jt==null?void 0:Jt.headerTheme,hr=Jt==null?void 0:Jt.headerAlwaysVisible,ti=ue!=="multi",nr=(Jt==null?void 0:Jt.checkboxStyle)??"square",rr=Math.max(At,20),Ar=Math.max(Et,rr),po=Math.max(Dn??Ar,rr),Ri=g.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ge,rowNumberMapper:vo,rowHeight:bo,getRowThemeOverride:zn}=j0(Ne,b,go,f),wo=g.useMemo(()=>Number.parseFloat(Ri.fontSize),[Ri]),{rowHeight:Xn,headerHeight:Ei,groupHeaderHeight:yo,theme:Co,overscrollX:Ta,overscrollY:Da}=Y0({groupHeaderHeight:Ea,headerHeight:mo,overscrollX:Le,overscrollY:Gt,remSize:wo,rowHeight:bo,scaleToRem:tr,theme:Qr}),Vn=X0(Oe),Sr=ki??(b>1e4?48:b>1e3?44:b>100?36:32),$n=Rn!=="none",q=$n?1:0,jt=Ce!==void 0,xr=(Pe==null?void 0:Pe.sticky)===!0,[ni,ri]=g.useState(!1),Ii=Pt??ni,Oa=g.useCallback(()=>{Dt!==void 0?Dt():ri(!1)},[Dt]),j=g.useMemo(()=>Rt===void 0?void 0:No(Rt,q),[Rt,q])??n,un=g.useRef();un.current===void 0&&(un.current=new AbortController),g.useEffect(()=>()=>un==null?void 0:un.current.abort(),[]);const[cn,Pa]=D0(K,M,q,un.current,Ge),$=g.useCallback((y,A,F)=>{if(xe===void 0)return!0;const U=[y[0]-q,y[1]];return xe==null?void 0:xe(U,A,F)},[q,xe]),ae=g.useRef(Rt),Se=g.useCallback((y,A)=>{A&&(y=H0(y,cn,q,k,un.current)),sn!==void 0?(ae.current=No(y,-q),sn(ae.current)):r(y)},[sn,cn,q,k]),ke=qr(nn,g.useCallback((y,A,F,U)=>{nn==null||nn(w[F-q],A,F-q,U)},[nn,q,w])),me=qr(xt,g.useCallback((y,A,F,U)=>{xt==null||xt(w[F-q],A,F-q,U)},[xt,q,w])),Re=qr(Lt,g.useCallback((y,A,F,U)=>{Lt==null||Lt(w[F-q],A,F-q,U)},[Lt,q,w])),rt=qr(x,g.useCallback((y,A)=>(x==null?void 0:x({...y,columnIndex:y.columnIndex-q},A))??!1,[x,q])),at=qr(L,g.useCallback((y,A)=>(L==null?void 0:L({...y,col:y.col-q},A))??!1,[L,q])),Te=g.useCallback(y=>{if(pe!==void 0){const A=pe(No(y,-q));return typeof A=="boolean"?A:No(A,q)}return!0},[pe,q]),[kt,Me,je]=T0(j,Se,tt,ve,ge,wt,T),Ue=g.useMemo(()=>vr(Cd(),Co),[Co]),[ft,ln]=g.useState([0,0,0]),En=g.useMemo(()=>{if(Ci===void 0)return{};const y={};for(const A of Ci)y[A.kind]=A;return y},[Ci]),yt=g.useCallback(y=>y.kind!==ne.Custom?En[y.kind]:Je==null?void 0:Je.find(A=>A.isMatch(y)),[Je,En]);let{sizedColumns:Kt,nonGrowWidth:Gn}=Km(w,Ge,Pa,ft[0]-(q===0?0:Sr)-ft[2],rr,po,Ue,yt,un.current);Rn!=="none"&&(Gn+=Sr);const xn=g.useMemo(()=>Kt.some(y=>y.group!==void 0),[Kt]),It=xn?Ei+yo:Ei,In=j.rows.length,Pn=Rn==="none"?void 0:In===0?!1:In===Ge?!0:void 0,Ct=g.useMemo(()=>Rn==="none"?Kt:[{title:"",width:Sr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ei,rowMarker:nr,rowMarkerChecked:Pn,headerRowMarkerTheme:fr,headerRowMarkerAlwaysVisible:hr,headerRowMarkerDisabled:ti},...Kt],[Rn,Kt,Sr,ei,nr,Pn,fr,hr,ti]),Qt=g.useRef({height:1,width:1,x:0,y:0}),kr=g.useRef(!1),{setVisibleRegion:Mr,visibleRegion:Hr,scrollRef:Wt}=J0(mn,pn,Xn,Qt,()=>kr.current=!0);Qt.current=Hr;const Lf=Hr.x+q,So=Hr.y,Tn=g.useRef(null),kn=g.useCallback(y=>{var A;y===!0?(A=Tn.current)==null||A.focus():window.requestAnimationFrame(()=>{var F;(F=Tn.current)==null||F.focus()})},[]),bn=jt?Ge+1:Ge,Nn=g.useCallback(y=>{const A=q===0?y:y.map(U=>({...U,location:[U.location[0]-q,U.location[1]]})),F=ce==null?void 0:ce(A);if(F!==!0)for(const U of A)se==null||se(U.location,U.value);return F},[se,ce,q]),[zr,_a]=g.useState(),xo=j.current!==void 0&&j.current.range.width*j.current.range.height>1?j.current.range:void 0,ii=Fr?(El=j.current)==null?void 0:El.cell:void 0,ko=ii==null?void 0:ii[0],Mo=ii==null?void 0:ii[1],Ff=g.useMemo(()=>{if((Tt===void 0||Tt.length===0)&&(xo??ko??Mo??zr)===void 0)return;const y=[];if(Tt!==void 0)for(const A of Tt){const F=Ct.length-A.range.x-q;F>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+q,width:Math.min(F,A.range.width)},style:A.style})}return zr!==void 0&&y.push({color:Xr(Ue.accentColor,0),range:zr,style:"dashed"}),xo!==void 0&&y.push({color:Xr(Ue.accentColor,.5),range:xo,style:"solid-outline"}),ko!==void 0&&Mo!==void 0&&y.push({color:Ue.accentColor,range:{x:ko,y:Mo,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[zr,xo,ko,Mo,Tt,Ct.length,Ue.accentColor,q]),hl=g.useRef(Ct);hl.current=Ct;const _n=g.useCallback(([y,A],F=!1)=>{var J,Y,Z,ee,re,we,Fe;const U=jt&&A===bn-1;if(y===0&&$n){if(U)return Bo;const ye=vo(A);return ye===void 0?Bo:{kind:Yn.Marker,allowOverlay:!1,checkboxStyle:nr,checked:(j==null?void 0:j.rows.hasIndex(A))===!0,markerKind:Rn==="clickable-number"?"number":Rn,row:Mi+ye,drawHandle:te!==void 0,cursor:Rn==="clickable-number"?"pointer":void 0}}else if(U){const He=y===q?(Pe==null?void 0:Pe.hint)??"":"",De=hl.current[y];if(((J=De==null?void 0:De.trailingRowOptions)==null?void 0:J.disabled)===!0)return Bo;{const gt=((Y=De==null?void 0:De.trailingRowOptions)==null?void 0:Y.hint)??He,qe=((Z=De==null?void 0:De.trailingRowOptions)==null?void 0:Z.addIcon)??(Pe==null?void 0:Pe.addIcon);return{kind:Yn.NewRow,hint:gt,allowOverlay:!1,icon:qe}}}else{const ye=y-q;if(F||(Ot==null?void 0:Ot.strict)===!0){const De=Qt.current,gt=De.x>ye||ye>De.x+De.width||De.y>A||A>De.y+De.height||A>=Fa.current,qe=ye===((re=(ee=De.extras)==null?void 0:ee.selected)==null?void 0:re[0])&&A===((we=De.extras)==null?void 0:we.selected[1]);let Ae=!1;if(((Fe=De.extras)==null?void 0:Fe.freezeRegions)!==void 0){for(const Mt of De.extras.freezeRegions)if(Yr(Mt,ye,A)){Ae=!0;break}}if(gt&&!qe&&!Ae)return Bo}let He=M([ye,A]);return q!==0&&He.span!==void 0&&(He={...He,span:[He.span[0]+q,He.span[1]+q]}),He}},[jt,bn,$n,vo,nr,j==null?void 0:j.rows,Rn,Mi,te,q,Pe==null?void 0:Pe.hint,Pe==null?void 0:Pe.addIcon,Ot==null?void 0:Ot.strict,M]),La=g.useCallback(y=>{let A=(ht==null?void 0:ht(y))??{name:y};return le!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>Ha({group:A.name,bounds:F.bounds})}]}),A},[ht,le]),Ro=g.useCallback(y=>{var Z;const[A,F]=y.cell,U=Ct[A],B=(U==null?void 0:U.group)!==void 0?(Z=La(U.group))==null?void 0:Z.overrideTheme:void 0,J=U==null?void 0:U.themeOverride,Y=zn==null?void 0:zn(F);o({...y,theme:vr(Ue,B,J,Y,y.content.themeOverride)})},[zn,Ct,La,Ue]),oi=g.useCallback((y,A,F)=>{var Y;if(j.current===void 0)return;const[U,B]=j.current.cell,J=_n([U,B]);if(J.kind!==ne.Boolean&&J.allowOverlay){let Z=J;if(F!==void 0)switch(Z.kind){case ne.Number:{const ee=Mg(()=>F==="-"?-0:Number.parseFloat(F),0);Z={...Z,data:Number.isNaN(ee)?0:ee};break}case ne.Text:case ne.Markdown:case ne.Uri:Z={...Z,data:F};break}Ro({target:y,content:Z,initialValue:F,cell:[U,B],highlight:F===void 0,forceEditMode:F!==void 0})}else J.kind===ne.Boolean&&A&&J.readonly!==!0&&(Nn([{location:j.current.cell,value:{...J,data:Ad(J.data)}}]),(Y=Tn.current)==null||Y.damage([{cell:j.current.cell}]))},[_n,j,Nn,Ro]),gl=g.useCallback((y,A)=>{var B;const F=(B=Tn.current)==null?void 0:B.getBounds(y,A);if(F===void 0||Wt.current===null)return;const U=_n([y,A]);U.allowOverlay&&Ro({target:F,content:U,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0})},[_n,Wt,Ro]),on=g.useCallback((y,A,F="both",U=0,B=0,J=void 0)=>{if(Wt.current!==null){const Y=Tn.current,Z=l.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,we=typeof y!="number"&&y.unit==="px"?y.amount:void 0,Fe=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(Y!==null&&Z!==null){let ye={x:0,y:0,width:0,height:0},He=0,De=0;if((ee!==void 0||re!==void 0)&&(ye=Y.getBounds((ee??0)+q,re??0)??ye,ye.width===0||ye.height===0))return;const gt=Z.getBoundingClientRect(),qe=gt.width/Z.offsetWidth;if(we!==void 0&&(ye={...ye,x:we-gt.left-Wt.current.scrollLeft,width:1}),Fe!==void 0&&(ye={...ye,y:Fe+gt.top-Wt.current.scrollTop,height:1}),ye!==void 0){const Ae={x:ye.x-U,y:ye.y-B,width:ye.width+2*U,height:ye.height+2*B};let Mt=0;for(let Ua=0;Ua<fe;Ua++)Mt+=Kt[Ua].width;let Xt=0;const an=Ht+(xr?1:0);an>0&&(Xt=Zr(bn,an,Xn));let Zn=Mt*qe+gt.left+q*Sr*qe,or=gt.right,Jn=gt.top+It*qe,ar=gt.bottom-Xt*qe;const _o=ye.width+U*2;switch(J==null?void 0:J.hAlign){case"start":or=Zn+_o;break;case"end":Zn=or-_o;break;case"center":Zn=Math.floor((Zn+or)/2)-_o/2,or=Zn+_o;break}const Lo=ye.height+B*2;switch(J==null?void 0:J.vAlign){case"start":ar=Jn+Lo;break;case"end":Jn=ar-Lo;break;case"center":Jn=Math.floor((Jn+ar)/2)-Lo/2,ar=Jn+Lo;break}Zn>Ae.x?He=Ae.x-Zn:or<Ae.x+Ae.width&&(He=Ae.x+Ae.width-or),Jn>Ae.y?De=Ae.y-Jn:ar<Ae.y+Ae.height&&(De=Ae.y+Ae.height-ar),F==="vertical"||typeof y=="number"&&y<fe?He=0:(F==="horizontal"||typeof A=="number"&&A>=bn-an)&&(De=0),(He!==0||De!==0)&&(qe!==1&&(He/=qe,De/=qe),Wt.current.scrollTo(He+Wt.current.scrollLeft,De+Wt.current.scrollTop))}}}},[q,Ht,Sr,Wt,It,fe,Kt,bn,xr,Xn]),ml=g.useRef(gl),pl=g.useRef(M),Fa=g.useRef(Ge);ml.current=gl,pl.current=M,Fa.current=Ge;const ai=g.useCallback(async(y,A=!0)=>{var ee;const F=Ct[y];if(((ee=F==null?void 0:F.trailingRowOptions)==null?void 0:ee.disabled)===!0)return;const U=Ce==null?void 0:Ce();let B,J=!0;U!==void 0&&(B=await U,B==="top"&&(J=!1),typeof B=="number"&&(J=!1));let Y=0;const Z=()=>{if(Fa.current<=Ge){Y<500&&window.setTimeout(Z,Y),Y=50+Y*2;return}const re=typeof B=="number"?B:J?Ge:0;Po.current(y-q,re),kt({cell:[y,re],range:{x:y,y:re,width:1,height:1}},!1,!1,"edit");const we=pl.current([y-q,re]);we.allowOverlay&&Ki(we)&&we.readonly!==!0&&A&&window.setTimeout(()=>{ml.current(y,re)},0)};Z()},[Ct,Ce,q,Ge,kt]),Eo=g.useCallback(y=>{var F,U;const A=((U=(F=Kt[y])==null?void 0:F.trailingRowOptions)==null?void 0:U.targetColumn)??(Pe==null?void 0:Pe.targetColumn);if(typeof A=="number")return A+($n?1:0);if(typeof A=="object"){const B=w.indexOf(A);if(B>=0)return B+($n?1:0)}},[Kt,w,$n,Pe==null?void 0:Pe.targetColumn]),Rr=g.useRef(),si=g.useRef(),Di=g.useCallback((y,A)=>{var B;const[F,U]=A;return vr(Ue,(B=Ct[F])==null?void 0:B.themeOverride,zn==null?void 0:zn(U),y.themeOverride)},[zn,Ct,Ue]),{mapper:Vr}=K0(Ne,b),jn=Ne==null?void 0:Ne.navigationBehavior,Oi=g.useCallback(y=>{var we,Fe,ye;const A=ua.value?y.metaKey:y.ctrlKey,F=A&&ue==="multi",U=A&&it==="multi",[B,J]=y.location,Y=j.columns,Z=j.rows,[ee,re]=((we=j.current)==null?void 0:we.cell)??[];if(y.kind==="cell"){if(si.current=void 0,$r.current=[B,J],B===0&&$n){if(jt===!0&&J===Ge||Rn==="number"||ue==="none")return;const He=_n(y.location);if(He.kind!==Yn.Marker)return;if(te!==void 0){const qe=yt(He);An((qe==null?void 0:qe.kind)===Yn.Marker);const Ae=(Fe=qe==null?void 0:qe.onClick)==null?void 0:Fe.call(qe,{...y,cell:He,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Di(He,y.location),preventDefault:()=>{}});if(Ae===void 0||Ae.checked===He.checked)return}o(void 0),kn();const De=Z.hasIndex(J),gt=Rr.current;if(ue==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&gt!==void 0&&Z.hasIndex(gt)){const qe=[Math.min(gt,J),Math.max(gt,J)+1];F||ze==="multi"?Me(void 0,qe,!0):Me(mt.fromSingleSelection(qe),void 0,F)}else ue==="multi"&&(F||y.isTouch||ze==="multi")?De?Me(Z.remove(J),void 0,!0):(Me(void 0,J,!0),Rr.current=J):De&&Z.length===1?Me(mt.empty(),void 0,A):(Me(mt.fromSingleSelection(J),void 0,A),Rr.current=J)}else if(B>=q&&jt&&J===Ge){const He=Eo(B);ai(He??B)}else if(ee!==B||re!==J){const He=_n(y.location),De=yt(He);if((De==null?void 0:De.onSelect)!==void 0){let Ae=!1;if(De.onSelect({...y,cell:He,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Ae=!0,theme:Di(He,y.location)}),Ae)return}if(jn==="block"&&Vr(J).isGroupHeader)return;const gt=xr&&J===Ge,qe=xr&&j!==void 0&&((ye=j.current)==null?void 0:ye.cell[1])===Ge;if((y.shiftKey||y.isLongTouch===!0)&&ee!==void 0&&re!==void 0&&j.current!==void 0&&!qe){if(gt)return;const Ae=Math.min(B,ee),Mt=Math.max(B,ee),Xt=Math.min(J,re),an=Math.max(J,re);kt({...j.current,range:{x:Ae,y:Xt,width:Mt-Ae+1,height:an-Xt+1}},!0,A,"click"),Rr.current=void 0,kn()}else kt({cell:[B,J],range:{x:B,y:J,width:1,height:1}},!0,A,"click"),Rr.current=void 0,o(void 0),kn()}}else if(y.kind==="header")if($r.current=[B,J],o(void 0),$n&&B===0)Rr.current=void 0,si.current=void 0,ue==="multi"&&(Z.length!==Ge?Me(mt.fromSingleSelection([0,Ge]),void 0,A):Me(mt.empty(),void 0,A),kn());else{const He=si.current;if(it==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&He!==void 0&&Y.hasIndex(He)){const De=[Math.min(He,B),Math.max(He,B)+1];U?je(void 0,De,A):je(mt.fromSingleSelection(De),void 0,A)}else U?(Y.hasIndex(B)?je(Y.remove(B),void 0,A):je(void 0,B,A),si.current=B):it!=="none"&&(je(mt.fromSingleSelection(B),void 0,A),si.current=B);Rr.current=void 0,kn()}else y.kind===qn?$r.current=[B,J]:y.kind===ca&&!y.isMaybeScrollbar&&(Se(Wo,!1),o(void 0),kn(),St==null||St(),Rr.current=void 0,si.current=void 0)},[ue,it,j,$n,q,jt,Ge,Rn,_n,te,kn,ze,yt,Di,Me,Eo,ai,jn,Vr,xr,kt,je,Se,St]),Pi=g.useRef(!1),$r=g.useRef(),vl=g.useRef(Hr),Bn=g.useRef(),Af=g.useCallback(y=>{if(li.current=!1,vl.current=Qt.current,y.button!==0&&y.button!==1){Bn.current=void 0;return}const A=performance.now();Bn.current={button:y.button,time:A,location:y.location},(y==null?void 0:y.kind)==="header"&&(Pi.current=!0);const F=y.kind==="cell"&&y.isFillHandle;!F&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:j,fillHandle:F}),$r.current=void 0,!y.isTouch&&y.button===0&&!F?Oi(y):!y.isTouch&&y.button===1&&($r.current=y.location))},[j,Oi]),[Aa,Ha]=g.useState(),bl=g.useCallback(y=>{if(y.kind!==qn||it!=="multi")return;const A=ua.value?y.metaKey:y.ctrlKey,[F]=y.location,U=j.columns;if(F<q)return;const B=Ct[F];let J=F,Y=F;for(let Z=F-1;Z>=q&&io(B.group,Ct[Z].group);Z--)J--;for(let Z=F+1;Z<Ct.length&&io(B.group,Ct[Z].group);Z++)Y++;if(kn(),A)if(U.hasAll([J,Y+1])){let Z=U;for(let ee=J;ee<=Y;ee++)Z=Z.remove(ee);je(Z,void 0,A)}else je(void 0,[J,Y+1],A);else je(mt.fromSingleSelection([J,Y+1]),void 0,A)},[it,kn,j.columns,Ct,q,je]),li=g.useRef(!1),Io=g.useCallback(async y=>{if(cn!==void 0&&ke!==void 0){const A=Qt.current.y,F=Qt.current.height;let U=cn({x:y,y:A,width:1,height:Math.min(F,Ge-A)},un.current.signal);typeof U!="object"&&(U=await U());const B=Kt[y-q],Y=document.createElement("canvas").getContext("2d",{alpha:!1});if(Y!==null){Y.font=Ue.baseFontFull;const Z=xd(Y,Ue,B,0,U,rr,Ar,!1,yt);ke==null||ke(B,Z.width,y,Z.width)}}},[Kt,cn,Ar,Ue,rr,ke,q,Ge,yt]),[Hf,za]=g.useState(),ui=g.useCallback(async(y,A)=>{var Z,ee;const F=(Z=y.current)==null?void 0:Z.range;if(F===void 0||cn===void 0||A.current===void 0)return;const U=A.current.range;if(R!==void 0){let re=!1;if(R({fillDestination:{...U,x:U.x-q},patternSource:{...F,x:F.x-q},preventDefault:()=>re=!0}),re)return}let B=cn(F,un.current.signal);typeof B!="object"&&(B=await B());const J=B,Y=[];for(let re=0;re<U.width;re++)for(let we=0;we<U.height;we++){const Fe=[U.x+re,U.y+we];if(dd(Fe,F))continue;const ye=J[we%F.height][re%F.width];gi(ye)||!Ki(ye)||Y.push({location:Fe,value:{...ye}})}Nn(Y),(ee=Tn.current)==null||ee.damage(Y.map(re=>({cell:re.location})))},[cn,Nn,R,q]),wl=g.useCallback(()=>{if(j.current===void 0||j.current.range.width<=1)return;const y={...j,current:{...j.current,range:{...j.current.range,width:1}}};ui(y,j)},[ui,j]),yl=g.useCallback(()=>{if(j.current===void 0||j.current.range.height<=1)return;const y={...j,current:{...j.current,range:{...j.current.range,height:1}}};ui(y,j)},[ui,j]),zf=g.useCallback((y,A)=>{var we,Fe;const F=s;if(u(void 0),_a(void 0),za(void 0),Pi.current=!1,A)return;if((F==null?void 0:F.fillHandle)===!0&&j.current!==void 0&&((we=F.previousSelection)==null?void 0:we.current)!==void 0){if(zr===void 0)return;const ye={...j,current:{...j.current,range:Id(F.previousSelection.current.range,zr)}};ui(F.previousSelection,ye),Se(ye,!0);return}const[U,B]=y.location,[J,Y]=$r.current??[],Z=()=>{li.current=!0},ee=ye=>{var De,gt,qe;const He=ye.isTouch||J===U&&Y===B;if(He&&(O==null||O([U-q,B],{...ye,preventDefault:Z})),ye.button===1)return!li.current;if(!li.current){const Ae=_n(y.location),Mt=yt(Ae);if(Mt!==void 0&&Mt.onClick!==void 0&&He){const an=Mt.onClick({...ye,cell:Ae,posX:ye.localEventX,posY:ye.localEventY,bounds:ye.bounds,theme:Di(Ae,y.location),preventDefault:Z});an!==void 0&&!gi(an)&&fi(an)&&(Nn([{location:ye.location,value:an}]),(De=Tn.current)==null||De.damage([{cell:ye.location}]))}if(li.current||j.current===void 0)return!1;let Xt=!1;switch(Ae.activationBehaviorOverride??ot){case"double-click":case"second-click":{if(((qe=(gt=F==null?void 0:F.previousSelection)==null?void 0:gt.current)==null?void 0:qe.cell)===void 0)break;const[an,Zn]=j.current.cell,[or,Jn]=F.previousSelection.current.cell;Xt=U===an&&U===or&&B===Zn&&B===Jn&&(ye.isDoubleClick===!0||ot==="second-click");break}case"single-click":{Xt=!0;break}}if(Xt)return S==null||S([U-q,B]),oi(ye.bounds,!1),!0}return!1},re=y.location[0]-q;if(y.isTouch){const ye=Qt.current,He=vl.current;if(ye.x!==He.x||ye.y!==He.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&Qi((Fe=j.current)==null?void 0:Fe.cell,y.location)){N==null||N([re,y.location[1]],{...y,preventDefault:Z});return}else if(y.kind==="header"&&j.columns.hasIndex(U)){ie==null||ie(re,{...y,preventDefault:Z});return}else if(y.kind===qn){if(re<0)return;G==null||G(re,{...y,preventDefault:Z});return}}y.kind==="cell"?ee(y)||Oi(y):y.kind===qn?z==null||z(re,{...y,preventDefault:Z}):(y.kind===Dr&&(C==null||C(re,{...y,preventDefault:Z})),Oi(y));return}if(y.kind==="header"){if(re<0)return;y.isEdge?y.isDoubleClick===!0&&Io(U):y.button===0&&U===J&&B===Y&&(C==null||C(re,{...y,preventDefault:Z}))}if(y.kind===qn){if(re<0)return;y.button===0&&U===J&&B===Y&&(z==null||z(re,{...y,preventDefault:Z}),li.current||bl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&ee(y),$r.current=void 0},[s,j,q,zr,ui,Se,O,_n,yt,ot,Di,Nn,S,oi,N,ie,G,Oi,z,C,Io,bl]),Vf=g.useCallback(y=>{const A={...y,location:[y.location[0]-q,y.location[1]]};_e==null||_e(A),s!==void 0&&y.buttons===0&&(u(void 0),_a(void 0),za(void 0),Pi.current=!1),za(F=>{var U;return Pi.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===(F==null?void 0:F[0])&&y.scrollEdge[1]===F[1]?F:s===void 0||(((U=Bn.current)==null?void 0:U.location[0])??0)<q?void 0:y.scrollEdge})},[s,_e,q]),$f=g.useCallback((y,A)=>{et==null||et(y-q,A)},[et,q]),Nf=g.useCallback((y,A)=>{vt==null||vt(y-q,A)},[vt,q]),ir=(Il=j==null?void 0:j.current)==null?void 0:Il.cell,Bf=g.useCallback((y,A,F,U,B,J)=>{kr.current=!1;let Y=ir;Y!==void 0&&(Y=[Y[0]-q,Y[1]]);const Z=fe===0?void 0:{x:0,y:y.y,width:fe,height:y.height},ee=[];Z!==void 0&&ee.push(Z),Ht>0&&(ee.push({x:y.x-q,y:Ge-Ht,width:y.width,height:Ht}),fe>0&&ee.push({x:0,y:Ge-Ht,width:fe,height:Ht}));const re={x:y.x-q,y:y.y,width:y.width,height:jt&&y.y+y.height>=Ge?y.height-1:y.height,tx:B,ty:J,extras:{selected:Y,freezeRegion:Z,freezeRegions:ee}};Qt.current=re,Mr(re),ln([A,F,U]),tn==null||tn(re,re.tx,re.ty,re.extras)},[ir,q,jt,Ge,fe,Ht,Mr,tn]),Wf=qr(Ee,g.useCallback((y,A)=>{Ee==null||Ee(y-q,A-q),it!=="none"&&je(mt.fromSingleSelection(A),void 0,!0)},[it,Ee,q,je])),Va=g.useRef(!1),Uf=g.useCallback(y=>{if(y.location[0]===0&&q>0){y.preventDefault();return}$e==null||$e({...y,location:[y.location[0]-q,y.location[1]]}),y.defaultPrevented()||(Va.current=!0),u(void 0)},[$e,q]),qf=g.useCallback(()=>{Va.current=!1},[]),Cl=Ne==null?void 0:Ne.selectionBehavior,To=g.useCallback(y=>{if(Cl!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:U}=Vr(y);if(A)return[y,y];const B=F[F.length-1],J=y-B,Y=y+U-B-1;return[J,Y]},[Vr,Cl]),$a=g.useRef(),Na=g.useCallback(y=>{var A,F,U;if(!Ld(y,$a.current)&&($a.current=y,!(((A=Bn==null?void 0:Bn.current)==null?void 0:A.button)!==void 0&&Bn.current.button>=1))){if(y.buttons!==0&&s!==void 0&&((F=Bn.current)==null?void 0:F.location[0])===0&&y.location[0]===0&&q===1&&ue==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(Bn.current.location[1])&&j.rows.hasIndex(Bn.current.location[1])){const B=Math.min(Bn.current.location[1],y.location[1]),J=Math.max(Bn.current.location[1],y.location[1])+1;Me(mt.fromSingleSelection([B,J]),void 0,!1)}if(y.buttons!==0&&s!==void 0&&j.current!==void 0&&!Va.current&&!Pi.current&&(wt==="rect"||wt==="multi-rect")){const[B,J]=j.current.cell;let[Y,Z]=y.location;if(Z<0&&(Z=Qt.current.y),s.fillHandle===!0&&((U=s.previousSelection)==null?void 0:U.current)!==void 0){const ee=s.previousSelection.current.range;Z=Math.min(Z,jt?Ge-1:Ge);const re=zp(ee,Y,Z,dn);_a(re)}else{if(jt&&J===Ge)return;if(jt&&Z===Ge)if(y.kind===ca)Z--;else return;Y=Math.max(Y,q);const we=To(J);Z=we===void 0?Z:Un(Z,we[0],we[1]);const Fe=Y-B,ye=Z-J,He={x:Fe>=0?B:Y,y:ye>=0?J:Z,width:Math.abs(Fe)+1,height:Math.abs(ye)+1};kt({...j.current,range:He},!0,!1,"drag")}}qt==null||qt({...y,location:[y.location[0]-q,y.location[1]]})}},[s,q,ue,j,wt,qt,Me,jt,Ge,dn,To,kt]),Yf=g.useCallback(()=>{var Y,Z;const y=$a.current;if(y===void 0)return;const[A,F]=y.scrollEdge;let[U,B]=y.location;const J=Qt.current;A===-1?U=((Z=(Y=J.extras)==null?void 0:Y.freezeRegion)==null?void 0:Z.x)??J.x:A===1&&(U=J.x+J.width),F===-1?B=Math.max(0,J.y):F===1&&(B=Math.min(Ge-1,J.y+J.height)),U=Un(U,0,Ct.length-1),B=Un(B,0,Ge-1),Na({...y,location:[U,B]})},[Ct.length,Na,Ge]);q0(Hf,Wt,Yf);const Kn=g.useCallback(y=>{if(j.current===void 0)return;const[A,F]=y,[U,B]=j.current.cell,J=j.current.range;let Y=J.x,Z=J.x+J.width,ee=J.y,re=J.y+J.height;const[we,Fe]=To(B)??[0,Ge-1],ye=Fe+1;if(F!==0)switch(F){case 2:{re=ye,ee=B,on(0,re,"vertical");break}case-2:{ee=we,re=B+1,on(0,ee,"vertical");break}case 1:{ee<B?(ee++,on(0,ee,"vertical")):(re=Math.min(ye,re+1),on(0,re,"vertical"));break}case-1:{re>B+1?(re--,on(0,re,"vertical")):(ee=Math.max(we,ee-1),on(0,ee,"vertical"));break}default:ro()}if(A!==0)if(A===2)Z=Ct.length,Y=U,on(Z-1-q,0,"horizontal");else if(A===-2)Y=q,Z=U+1,on(Y-q,0,"horizontal");else{let He=[];if(cn!==void 0){const De=cn({x:Y,y:ee,width:Z-Y-q,height:re-ee},un.current.signal);typeof De=="object"&&(He=tv(De))}if(A===1){let De=!1;if(Y<U){if(He.length>0){const gt=sr(Y+1,U+1).find(qe=>!He.includes(qe-q));gt!==void 0&&(Y=gt,De=!0)}else Y++,De=!0;De&&on(Y,0,"horizontal")}De||(Z=Math.min(Ct.length,Z+1),on(Z-1-q,0,"horizontal"))}else if(A===-1){let De=!1;if(Z>U+1){if(He.length>0){const gt=sr(Z-1,U,-1).find(qe=>!He.includes(qe-q));gt!==void 0&&(Z=gt,De=!0)}else Z--,De=!0;De&&on(Z-q,0,"horizontal")}De||(Y=Math.max(q,Y-1),on(Y-q,0,"horizontal"))}else ro()}kt({cell:j.current.cell,range:{x:Y,y:ee,width:Z-Y,height:re-ee}},!0,!1,"keyboard-select")},[cn,To,j,Ct.length,q,Ge,on,kt]),Ba=g.useRef(Si);Ba.current=Si;const Er=g.useCallback((y,A,F,U)=>{const B=bn-(F?0:1);y=Un(y,q,Kt.length-1+q),A=Un(A,0,B);const J=ir==null?void 0:ir[0],Y=ir==null?void 0:ir[1];if(y===J&&A===Y)return!1;if(U&&j.current!==void 0){const Z=[...j.current.rangeStack];(j.current.range.width>1||j.current.range.height>1)&&Z.push(j.current.range),Se({...j,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:Z}},!0)}else kt({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),Ba.current&&on(y-q,A),!0},[bn,q,Kt.length,ir,j,on,Se,kt]),Xf=g.useCallback((y,A)=>{(i==null?void 0:i.cell)!==void 0&&y!==void 0&&fi(y)&&(Nn([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{var B;(B=Tn.current)==null||B.damage([{cell:i.cell}])})),kn(!0),o(void 0);const[F,U]=A;if(j.current!==void 0&&(F!==0||U!==0)){const B=j.current.cell[1]===bn-1&&y!==void 0;Er(Un(j.current.cell[0]+F,0,Ct.length-1),Un(j.current.cell[1]+U,0,bn-1),B,!1)}_==null||_(y,A)},[i==null?void 0:i.cell,kn,j,_,Nn,bn,Er,Ct.length]),Gf=g.useMemo(()=>`gdg-overlay-${ev++}`,[]),Nr=g.useCallback(y=>{var F,U,B,J;kn();const A=[];for(let Y=y.x;Y<y.x+y.width;Y++)for(let Z=y.y;Z<y.y+y.height;Z++){const ee=M([Y-q,Z]);if(!ee.allowOverlay&&ee.kind!==ne.Boolean)continue;let re;if(ee.kind===ne.Custom){const we=yt(ee),Fe=(F=we==null?void 0:we.provideEditor)==null?void 0:F.call(we,ee);(we==null?void 0:we.onDelete)!==void 0?re=we.onDelete(ee):Dg(Fe)&&(re=(U=Fe==null?void 0:Fe.deletedValue)==null?void 0:U.call(Fe,ee))}else if(fi(ee)&&ee.allowOverlay||ee.kind===ne.Boolean){const we=yt(ee);re=(B=we==null?void 0:we.onDelete)==null?void 0:B.call(we,ee)}re!==void 0&&!gi(re)&&fi(re)&&A.push({location:[Y,Z],value:re})}Nn(A),(J=Tn.current)==null||J.damage(A.map(Y=>({cell:Y.location})))},[kn,M,yt,Nn,q]),_i=i!==void 0,Sl=g.useCallback(y=>{var gt,qe;const A=()=>{y.stopPropagation(),y.preventDefault()},F={didMatch:!1},{bounds:U}=y,B=j.columns,J=j.rows,Y=Vn;if(!_i&&ut(Y.clear,y,F))Se(Wo,!1),St==null||St();else if(!_i&&ut(Y.selectAll,y,F))Se({columns:mt.empty(),rows:mt.empty(),current:{cell:((gt=j.current)==null?void 0:gt.cell)??[q,0],range:{x:q,y:0,width:w.length,height:Ge},rangeStack:[]}},!1);else if(ut(Y.search,y,F))(qe=a==null?void 0:a.current)==null||qe.focus({preventScroll:!0}),ri(!0);else if(ut(Y.delete,y,F)){const Ae=(Te==null?void 0:Te(j))??!0;if(Ae!==!1){const Mt=Ae===!0?j:Ae;if(Mt.current!==void 0){Nr(Mt.current.range);for(const Xt of Mt.current.rangeStack)Nr(Xt)}for(const Xt of Mt.rows)Nr({x:q,y:Xt,width:w.length,height:1});for(const Xt of Mt.columns)Nr({x:Xt,y:0,width:1,height:Ge})}}if(F.didMatch)return A(),!0;if(j.current===void 0)return!1;let[Z,ee]=j.current.cell;const[,re]=j.current.cell;let we=!1,Fe=!1;if(ut(Y.scrollToSelectedCell,y,F)?Po.current(Z-q,ee):it!=="none"&&ut(Y.selectColumn,y,F)?B.hasIndex(Z)?je(B.remove(Z),void 0,!0):it==="single"?je(mt.fromSingleSelection(Z),void 0,!0):je(void 0,Z,!0):ue!=="none"&&ut(Y.selectRow,y,F)?J.hasIndex(ee)?Me(J.remove(ee),void 0,!0):ue==="single"?Me(mt.fromSingleSelection(ee),void 0,!0):Me(void 0,ee,!0):!_i&&U!==void 0&&ut(Y.activateCell,y,F)?ee===Ge&&jt?window.setTimeout(()=>{const Ae=Eo(Z);ai(Ae??Z)},0):(S==null||S([Z-q,ee]),oi(U,!0)):j.current.range.height>1&&ut(Y.downFill,y,F)?yl():j.current.range.width>1&&ut(Y.rightFill,y,F)?wl():ut(Y.goToNextPage,y,F)?ee+=Math.max(1,Qt.current.height-4):ut(Y.goToPreviousPage,y,F)?ee-=Math.max(1,Qt.current.height-4):ut(Y.goToFirstCell,y,F)?(o(void 0),ee=0,Z=0):ut(Y.goToLastCell,y,F)?(o(void 0),ee=Number.MAX_SAFE_INTEGER,Z=Number.MAX_SAFE_INTEGER):ut(Y.selectToFirstCell,y,F)?(o(void 0),Kn([-2,-2])):ut(Y.selectToLastCell,y,F)?(o(void 0),Kn([2,2])):_i?(ut(Y.closeOverlay,y,F)&&o(void 0),ut(Y.acceptOverlayDown,y,F)&&(o(void 0),ee++),ut(Y.acceptOverlayUp,y,F)&&(o(void 0),ee--),ut(Y.acceptOverlayLeft,y,F)&&(o(void 0),Z--),ut(Y.acceptOverlayRight,y,F)&&(o(void 0),Z++)):(ut(Y.goDownCell,y,F)?ee+=1:ut(Y.goUpCell,y,F)?ee-=1:ut(Y.goRightCell,y,F)?Z+=1:ut(Y.goLeftCell,y,F)?Z-=1:ut(Y.goDownCellRetainSelection,y,F)?(ee+=1,we=!0):ut(Y.goUpCellRetainSelection,y,F)?(ee-=1,we=!0):ut(Y.goRightCellRetainSelection,y,F)?(Z+=1,we=!0):ut(Y.goLeftCellRetainSelection,y,F)?(Z-=1,we=!0):ut(Y.goToLastRow,y,F)?ee=Ge-1:ut(Y.goToFirstRow,y,F)?ee=Number.MIN_SAFE_INTEGER:ut(Y.goToLastColumn,y,F)?Z=Number.MAX_SAFE_INTEGER:ut(Y.goToFirstColumn,y,F)?Z=Number.MIN_SAFE_INTEGER:(wt==="rect"||wt==="multi-rect")&&(ut(Y.selectGrowDown,y,F)?Kn([0,1]):ut(Y.selectGrowUp,y,F)?Kn([0,-1]):ut(Y.selectGrowRight,y,F)?Kn([1,0]):ut(Y.selectGrowLeft,y,F)?Kn([-1,0]):ut(Y.selectToLastRow,y,F)?Kn([0,2]):ut(Y.selectToFirstRow,y,F)?Kn([0,-2]):ut(Y.selectToLastColumn,y,F)?Kn([2,0]):ut(Y.selectToFirstColumn,y,F)&&Kn([-2,0])),Fe=F.didMatch),jn!==void 0&&jn!=="normal"&&ee!==re){const Ae=jn==="skip-up"||jn==="skip"||jn==="block",Mt=jn==="skip-down"||jn==="skip"||jn==="block",Xt=ee<re;if(Xt&&Ae){for(;ee>=0&&Vr(ee).isGroupHeader;)ee--;ee<0&&(ee=re)}else if(!Xt&&Mt){for(;ee<Ge&&Vr(ee).isGroupHeader;)ee++;ee>=Ge&&(ee=re)}}const He=Er(Z,ee,!1,we),De=F.didMatch;return De&&(He||!Fe||Yt)&&A(),De},[jn,_i,j,Vn,it,ue,wt,q,Vr,Ge,Er,Se,St,w.length,Te,Yt,Nr,je,Me,jt,Eo,ai,S,oi,yl,wl,Kn]),Li=g.useCallback(y=>{let A=!1;if(W!==void 0&&W({...y,cancel:()=>{A=!0}}),A||Sl(y)||j.current===void 0)return;const[F,U]=j.current.cell,B=Qt.current;if(Ve&&!y.metaKey&&!y.ctrlKey&&j.current!==void 0&&y.key.length===1&&/[ -~]/g.test(y.key)&&y.bounds!==void 0&&Ki(M([F-q,Math.max(0,Math.min(U,Ge-1))]))){if((!jt||U!==Ge)&&(B.y>U||U>B.y+B.height||B.x>F||F>B.x+B.width))return;oi(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[Ve,W,Sl,j,M,q,Ge,jt,oi]),jf=g.useCallback((y,A)=>{const F=y.location[0]-q;if(y.kind==="header"&&(ie==null||ie(F,{...y,preventDefault:A})),y.kind===qn){if(F<0)return;G==null||G(F,{...y,preventDefault:A})}if(y.kind==="cell"){const[U,B]=y.location;N==null||N([F,B],{...y,preventDefault:A}),_m(j,y.location)||Er(U,B,!1,!1)}},[j,N,G,ie,q,Er]),Wa=g.useCallback(async y=>{var Y,Z,ee;if(!Vn.paste)return;function A(re,we,Fe,ye){var De,gt;const He=typeof Fe=="object"?(Fe==null?void 0:Fe.join(`
172
+ `&&(n.push(r),r=[])),o=t.None);break}a++}return i<e.length&&r.push(Du(e.slice(i,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Ou(e,t,n){var l;const r=A0(e,t),i=s=>{var u;(u=window.navigator.clipboard)==null||u.writeText(s)},o=(s,u)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([s],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(s,u)=>{var c,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",s),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(s,u)||i(s)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(r.textPlain,r.textHtml):i(r.textPlain),n==null||n.preventDefault()}function Ad(e){return e!==!0}function Pu(e){return typeof e=="string"?e:`${e}px`}const V0=()=>e=>e.innerWidth,$0=()=>e=>e.innerHeight,N0=gn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[V0()],"wmyidgi-1":[$0()]}}),B0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return g.createElement(N0,{innerHeight:Pu(n),innerWidth:Pu(t),...i},r)},W0=2,U0=1300;function q0(e,t,n){const r=oe.useRef(0),[i,o]=e??[0,0];oe.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let a=!1,l=0;const s=u=>{var c;if(!a){if(l===0)l=u;else{const d=u-l;r.current=Math.min(1,r.current+d/U0);const h=r.current**1.618*d*W0;(c=t.current)==null||c.scrollBy(i*h,o*h),l=u,n==null||n()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,i,o,n])}function Y0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:a,remSize:l}){const[s,u,c,d,h,f]=oe.useMemo(()=>{if(!a||l===16)return[e,t,n,r,i,o];const m=l/16,p=e,v=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)??v.headerIconSize)*m,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??v.cellHorizontalPadding)*m,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??v.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,l,e,a,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:h,overscrollY:f}}const Tr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function _u(e){const t=ua.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function X0(e){const t=nm(e);return oe.useMemo(()=>{if(t===void 0)return _u(Tr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Tr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Tr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Tr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Tr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Tr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Tr.selectToLastCell};return _u({...Tr,...n})},[t])}function G0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const a={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(a.subGroups=r.subGroups.map((l,s)=>t(l,i+1,[...o,s])).sort((l,s)=>l.headerIndex-s.headerIndex)),a}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Ks(e,t){const n=[];function r(a,l,s=!1){let u=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:s,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const d=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:l;r(a.subGroups[c],d,s||a.isCollapsed)}}const i=G0(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...s}=a;return s})}function da(e,t){if(t===void 0||Ks.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(n--,!r.isCollapsed){if(n<r.rows)return{path:[...r.path,n],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:r.contentIndex+n,groupRows:r.rows};n-=r.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function j0(e,t,n,r){const i=oe.useMemo(()=>e===void 0?void 0:Ks(e,t),[e,t]),o=oe.useMemo(()=>i===void 0?t:i.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[i,t]),a=oe.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=da(u,i);return c?e.height:typeof n=="number"?n:n(u)},[i,e,n]),l=oe.useCallback(u=>{if(i===void 0)return u;let c=u;for(const d of i){if(c===0)return;if(c--,!d.isCollapsed){if(c<d.rows)return d.contentIndex+c;c-=d.rows}}return u},[i]),s=qr(r??(e==null?void 0:e.themeOverride),oe.useCallback(u=>{if(e===void 0)return r==null?void 0:r(u,u,u);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:d,groupIndex:h}=da(u,i);return c?e.themeOverride:r==null?void 0:r(u,h,d)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:s}:{rowHeight:a,rows:o,rowNumberMapper:l,getRowThemeOverride:s}}function K0(e,t){const n=oe.useMemo(()=>e===void 0?void 0:Ks(e,t),[e,t]);return{getRowGroupingForPath:zd,updateRowGroupingByPath:Hd,mapper:oe.useCallback(r=>{if(typeof r=="number")return da(r,n);const i=da(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,a)=>a===r?{...o,...n}:o):e.map((o,a)=>a===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 Z0(e,t){const[n]=g.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 J0(e,t,n,r,i){const[o,a]=g.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=g.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,o]),[s,u,c]=tm(l),d=g.useRef(i);d.current=i;const h=Z0(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),f=(s.height??1)>1;g.useLayoutEffect(()=>{if(t!==void 0&&h.current!==null&&f){if(h.current.scrollTop===t)return;h.current.scrollTop=t,h.current.scrollTop!==t&&c(),d.current()}},[t,f,c,h]);const m=(s.width??1)>1;return g.useLayoutEffect(()=>{if(e!==void 0&&h.current!==null&&m){if(h.current.scrollLeft===e)return;h.current.scrollLeft=e,h.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,h]),{visibleRegion:s,setVisibleRegion:u,scrollRef:h}}const Q0=g.lazy(async()=>await Ls(()=>import("./data-grid-overlay-editor.DSy1Tixt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let ev=0;function tv(e){return op(wu(wu(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return sr((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function No(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 Bo={kind:ne.Loading,allowOverlay:!1},Wo={columns:mt.empty(),rows:mt.empty(),current:void 0},nv=(e,t)=>{var El,Il,Tl;const[n,r]=g.useState(Wo),[i,o]=g.useState(),a=g.useRef(null),l=g.useRef(null),[s,u]=g.useState(),c=g.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:h,getRowThemeOverride:f,markdownDivCreateNode:m,width:p,height:v,columns:w,rows:b,getCellContent:M,onCellClicked:O,onCellActivated:S,onFillPattern:R,onFinishedEditing:_,coercePasteValue:E,drawHeader:x,drawCell:L,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:z,onCellContextMenu:N,className:X,onHeaderContextMenu:ie,getCellsForSelection:K,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:le,onCellEdited:se,onCellsEdited:ce,onSearchResultsChanged:he,searchResults:Q,onSearchValueChange:H,searchValue:P,onKeyDown:W,onKeyUp:de,keybindings:Oe,editOnType:Ve=!0,onRowAppended:Ce,onColumnMoved:Ee,validateCell:xe,highlightRegions:Tt,rangeSelect:wt="rect",columnSelect:it="multi",rowSelect:ue="multi",rangeSelectionBlending:tt="exclusive",columnSelectionBlending:ve="exclusive",rowSelectionBlending:ge="exclusive",onDelete:pe,onDragStart:$e,onMouseMove:_e,onPaste:nt,copyHeaders:be=!1,freezeColumns:fe=0,cellActivationBehavior:ot="second-click",rowSelectionMode:ze="auto",onHeaderMenuClick:et,onHeaderIndicatorClick:vt,getGroupDetails:ht,rowGrouping:Ne,onSearchClose:Dt,onItemHovered:qt,onSelectionCleared:St,showSearch:Pt,onVisibleRegionChanged:tn,gridSelection:Rt,onGridSelectionChange:sn,minColumnWidth:At=50,maxColumnWidth:Et=500,maxColumnAutoWidth:Dn,provideEditor:yn,trailingRowOptions:Pe,freezeTrailingRows:Ht=0,allowedFillDirections:dn="orthogonal",scrollOffsetX:mn,scrollOffsetY:pn,verticalBorder:st,onDragOverCell:Nt,onDrop:_t,onColumnResize:nn,onColumnResizeEnd:xt,onColumnResizeStart:Lt,customRenderers:Je,fillHandle:Bt,experimental:Ot,fixedShadowX:zt,fixedShadowY:Vt,headerIcons:Cn,imageWindowLoader:dr,initialSize:On,isDraggable:V,onDragLeave:Qe,onRowMoved:te,overscrollX:Le,overscrollY:Gt,preventDiagonalScrolling:Zt,rightElement:rn,rightElementProps:Sn,trapFocus:Yt=!1,smoothScrollX:fn,smoothScrollY:vn,scaleToRem:tr=!1,rowHeight:go=34,headerHeight:mo=36,groupHeaderHeight:Ea=mo,theme:Qr,isOutsideClick:Cr,renderers:Ci,resizeIndicator:Ia,scrollToActiveCell:Si=!0,drawFocusRing:xi=!0}=e,Fr=xi==="no-editor"?i===void 0:xi,Jt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Rn=(Jt==null?void 0:Jt.kind)??e.rowMarkers??"none",ki=(Jt==null?void 0:Jt.width)??e.rowMarkerWidth,Mi=(Jt==null?void 0:Jt.startIndex)??e.rowMarkerStartIndex??1,ei=(Jt==null?void 0:Jt.theme)??e.rowMarkerTheme,fr=Jt==null?void 0:Jt.headerTheme,hr=Jt==null?void 0:Jt.headerAlwaysVisible,ti=ue!=="multi",nr=(Jt==null?void 0:Jt.checkboxStyle)??"square",rr=Math.max(At,20),Ar=Math.max(Et,rr),po=Math.max(Dn??Ar,rr),Ri=g.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ge,rowNumberMapper:vo,rowHeight:bo,getRowThemeOverride:zn}=j0(Ne,b,go,f),wo=g.useMemo(()=>Number.parseFloat(Ri.fontSize),[Ri]),{rowHeight:Xn,headerHeight:Ei,groupHeaderHeight:yo,theme:Co,overscrollX:Ta,overscrollY:Da}=Y0({groupHeaderHeight:Ea,headerHeight:mo,overscrollX:Le,overscrollY:Gt,remSize:wo,rowHeight:bo,scaleToRem:tr,theme:Qr}),Vn=X0(Oe),Sr=ki??(b>1e4?48:b>1e3?44:b>100?36:32),$n=Rn!=="none",q=$n?1:0,jt=Ce!==void 0,xr=(Pe==null?void 0:Pe.sticky)===!0,[ni,ri]=g.useState(!1),Ii=Pt??ni,Oa=g.useCallback(()=>{Dt!==void 0?Dt():ri(!1)},[Dt]),j=g.useMemo(()=>Rt===void 0?void 0:No(Rt,q),[Rt,q])??n,un=g.useRef();un.current===void 0&&(un.current=new AbortController),g.useEffect(()=>()=>un==null?void 0:un.current.abort(),[]);const[cn,Pa]=D0(K,M,q,un.current,Ge),$=g.useCallback((y,A,F)=>{if(xe===void 0)return!0;const U=[y[0]-q,y[1]];return xe==null?void 0:xe(U,A,F)},[q,xe]),ae=g.useRef(Rt),Se=g.useCallback((y,A)=>{A&&(y=H0(y,cn,q,k,un.current)),sn!==void 0?(ae.current=No(y,-q),sn(ae.current)):r(y)},[sn,cn,q,k]),ke=qr(nn,g.useCallback((y,A,F,U)=>{nn==null||nn(w[F-q],A,F-q,U)},[nn,q,w])),me=qr(xt,g.useCallback((y,A,F,U)=>{xt==null||xt(w[F-q],A,F-q,U)},[xt,q,w])),Re=qr(Lt,g.useCallback((y,A,F,U)=>{Lt==null||Lt(w[F-q],A,F-q,U)},[Lt,q,w])),rt=qr(x,g.useCallback((y,A)=>(x==null?void 0:x({...y,columnIndex:y.columnIndex-q},A))??!1,[x,q])),at=qr(L,g.useCallback((y,A)=>(L==null?void 0:L({...y,col:y.col-q},A))??!1,[L,q])),Te=g.useCallback(y=>{if(pe!==void 0){const A=pe(No(y,-q));return typeof A=="boolean"?A:No(A,q)}return!0},[pe,q]),[kt,Me,je]=T0(j,Se,tt,ve,ge,wt,T),Ue=g.useMemo(()=>vr(Cd(),Co),[Co]),[ft,ln]=g.useState([0,0,0]),En=g.useMemo(()=>{if(Ci===void 0)return{};const y={};for(const A of Ci)y[A.kind]=A;return y},[Ci]),yt=g.useCallback(y=>y.kind!==ne.Custom?En[y.kind]:Je==null?void 0:Je.find(A=>A.isMatch(y)),[Je,En]);let{sizedColumns:Kt,nonGrowWidth:Gn}=Km(w,Ge,Pa,ft[0]-(q===0?0:Sr)-ft[2],rr,po,Ue,yt,un.current);Rn!=="none"&&(Gn+=Sr);const xn=g.useMemo(()=>Kt.some(y=>y.group!==void 0),[Kt]),It=xn?Ei+yo:Ei,In=j.rows.length,Pn=Rn==="none"?void 0:In===0?!1:In===Ge?!0:void 0,Ct=g.useMemo(()=>Rn==="none"?Kt:[{title:"",width:Sr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ei,rowMarker:nr,rowMarkerChecked:Pn,headerRowMarkerTheme:fr,headerRowMarkerAlwaysVisible:hr,headerRowMarkerDisabled:ti},...Kt],[Rn,Kt,Sr,ei,nr,Pn,fr,hr,ti]),Qt=g.useRef({height:1,width:1,x:0,y:0}),kr=g.useRef(!1),{setVisibleRegion:Mr,visibleRegion:Hr,scrollRef:Wt}=J0(mn,pn,Xn,Qt,()=>kr.current=!0);Qt.current=Hr;const Lf=Hr.x+q,So=Hr.y,Tn=g.useRef(null),kn=g.useCallback(y=>{var A;y===!0?(A=Tn.current)==null||A.focus():window.requestAnimationFrame(()=>{var F;(F=Tn.current)==null||F.focus()})},[]),bn=jt?Ge+1:Ge,Nn=g.useCallback(y=>{const A=q===0?y:y.map(U=>({...U,location:[U.location[0]-q,U.location[1]]})),F=ce==null?void 0:ce(A);if(F!==!0)for(const U of A)se==null||se(U.location,U.value);return F},[se,ce,q]),[zr,_a]=g.useState(),xo=j.current!==void 0&&j.current.range.width*j.current.range.height>1?j.current.range:void 0,ii=Fr?(El=j.current)==null?void 0:El.cell:void 0,ko=ii==null?void 0:ii[0],Mo=ii==null?void 0:ii[1],Ff=g.useMemo(()=>{if((Tt===void 0||Tt.length===0)&&(xo??ko??Mo??zr)===void 0)return;const y=[];if(Tt!==void 0)for(const A of Tt){const F=Ct.length-A.range.x-q;F>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+q,width:Math.min(F,A.range.width)},style:A.style})}return zr!==void 0&&y.push({color:Xr(Ue.accentColor,0),range:zr,style:"dashed"}),xo!==void 0&&y.push({color:Xr(Ue.accentColor,.5),range:xo,style:"solid-outline"}),ko!==void 0&&Mo!==void 0&&y.push({color:Ue.accentColor,range:{x:ko,y:Mo,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[zr,xo,ko,Mo,Tt,Ct.length,Ue.accentColor,q]),hl=g.useRef(Ct);hl.current=Ct;const _n=g.useCallback(([y,A],F=!1)=>{var J,Y,Z,ee,re,we,Fe;const U=jt&&A===bn-1;if(y===0&&$n){if(U)return Bo;const ye=vo(A);return ye===void 0?Bo:{kind:Yn.Marker,allowOverlay:!1,checkboxStyle:nr,checked:(j==null?void 0:j.rows.hasIndex(A))===!0,markerKind:Rn==="clickable-number"?"number":Rn,row:Mi+ye,drawHandle:te!==void 0,cursor:Rn==="clickable-number"?"pointer":void 0}}else if(U){const He=y===q?(Pe==null?void 0:Pe.hint)??"":"",De=hl.current[y];if(((J=De==null?void 0:De.trailingRowOptions)==null?void 0:J.disabled)===!0)return Bo;{const gt=((Y=De==null?void 0:De.trailingRowOptions)==null?void 0:Y.hint)??He,qe=((Z=De==null?void 0:De.trailingRowOptions)==null?void 0:Z.addIcon)??(Pe==null?void 0:Pe.addIcon);return{kind:Yn.NewRow,hint:gt,allowOverlay:!1,icon:qe}}}else{const ye=y-q;if(F||(Ot==null?void 0:Ot.strict)===!0){const De=Qt.current,gt=De.x>ye||ye>De.x+De.width||De.y>A||A>De.y+De.height||A>=Fa.current,qe=ye===((re=(ee=De.extras)==null?void 0:ee.selected)==null?void 0:re[0])&&A===((we=De.extras)==null?void 0:we.selected[1]);let Ae=!1;if(((Fe=De.extras)==null?void 0:Fe.freezeRegions)!==void 0){for(const Mt of De.extras.freezeRegions)if(Yr(Mt,ye,A)){Ae=!0;break}}if(gt&&!qe&&!Ae)return Bo}let He=M([ye,A]);return q!==0&&He.span!==void 0&&(He={...He,span:[He.span[0]+q,He.span[1]+q]}),He}},[jt,bn,$n,vo,nr,j==null?void 0:j.rows,Rn,Mi,te,q,Pe==null?void 0:Pe.hint,Pe==null?void 0:Pe.addIcon,Ot==null?void 0:Ot.strict,M]),La=g.useCallback(y=>{let A=(ht==null?void 0:ht(y))??{name:y};return le!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>Ha({group:A.name,bounds:F.bounds})}]}),A},[ht,le]),Ro=g.useCallback(y=>{var Z;const[A,F]=y.cell,U=Ct[A],B=(U==null?void 0:U.group)!==void 0?(Z=La(U.group))==null?void 0:Z.overrideTheme:void 0,J=U==null?void 0:U.themeOverride,Y=zn==null?void 0:zn(F);o({...y,theme:vr(Ue,B,J,Y,y.content.themeOverride)})},[zn,Ct,La,Ue]),oi=g.useCallback((y,A,F)=>{var Y;if(j.current===void 0)return;const[U,B]=j.current.cell,J=_n([U,B]);if(J.kind!==ne.Boolean&&J.allowOverlay){let Z=J;if(F!==void 0)switch(Z.kind){case ne.Number:{const ee=Mg(()=>F==="-"?-0:Number.parseFloat(F),0);Z={...Z,data:Number.isNaN(ee)?0:ee};break}case ne.Text:case ne.Markdown:case ne.Uri:Z={...Z,data:F};break}Ro({target:y,content:Z,initialValue:F,cell:[U,B],highlight:F===void 0,forceEditMode:F!==void 0})}else J.kind===ne.Boolean&&A&&J.readonly!==!0&&(Nn([{location:j.current.cell,value:{...J,data:Ad(J.data)}}]),(Y=Tn.current)==null||Y.damage([{cell:j.current.cell}]))},[_n,j,Nn,Ro]),gl=g.useCallback((y,A)=>{var B;const F=(B=Tn.current)==null?void 0:B.getBounds(y,A);if(F===void 0||Wt.current===null)return;const U=_n([y,A]);U.allowOverlay&&Ro({target:F,content:U,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0})},[_n,Wt,Ro]),on=g.useCallback((y,A,F="both",U=0,B=0,J=void 0)=>{if(Wt.current!==null){const Y=Tn.current,Z=l.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,we=typeof y!="number"&&y.unit==="px"?y.amount:void 0,Fe=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(Y!==null&&Z!==null){let ye={x:0,y:0,width:0,height:0},He=0,De=0;if((ee!==void 0||re!==void 0)&&(ye=Y.getBounds((ee??0)+q,re??0)??ye,ye.width===0||ye.height===0))return;const gt=Z.getBoundingClientRect(),qe=gt.width/Z.offsetWidth;if(we!==void 0&&(ye={...ye,x:we-gt.left-Wt.current.scrollLeft,width:1}),Fe!==void 0&&(ye={...ye,y:Fe+gt.top-Wt.current.scrollTop,height:1}),ye!==void 0){const Ae={x:ye.x-U,y:ye.y-B,width:ye.width+2*U,height:ye.height+2*B};let Mt=0;for(let Ua=0;Ua<fe;Ua++)Mt+=Kt[Ua].width;let Xt=0;const an=Ht+(xr?1:0);an>0&&(Xt=Zr(bn,an,Xn));let Zn=Mt*qe+gt.left+q*Sr*qe,or=gt.right,Jn=gt.top+It*qe,ar=gt.bottom-Xt*qe;const _o=ye.width+U*2;switch(J==null?void 0:J.hAlign){case"start":or=Zn+_o;break;case"end":Zn=or-_o;break;case"center":Zn=Math.floor((Zn+or)/2)-_o/2,or=Zn+_o;break}const Lo=ye.height+B*2;switch(J==null?void 0:J.vAlign){case"start":ar=Jn+Lo;break;case"end":Jn=ar-Lo;break;case"center":Jn=Math.floor((Jn+ar)/2)-Lo/2,ar=Jn+Lo;break}Zn>Ae.x?He=Ae.x-Zn:or<Ae.x+Ae.width&&(He=Ae.x+Ae.width-or),Jn>Ae.y?De=Ae.y-Jn:ar<Ae.y+Ae.height&&(De=Ae.y+Ae.height-ar),F==="vertical"||typeof y=="number"&&y<fe?He=0:(F==="horizontal"||typeof A=="number"&&A>=bn-an)&&(De=0),(He!==0||De!==0)&&(qe!==1&&(He/=qe,De/=qe),Wt.current.scrollTo(He+Wt.current.scrollLeft,De+Wt.current.scrollTop))}}}},[q,Ht,Sr,Wt,It,fe,Kt,bn,xr,Xn]),ml=g.useRef(gl),pl=g.useRef(M),Fa=g.useRef(Ge);ml.current=gl,pl.current=M,Fa.current=Ge;const ai=g.useCallback(async(y,A=!0)=>{var ee;const F=Ct[y];if(((ee=F==null?void 0:F.trailingRowOptions)==null?void 0:ee.disabled)===!0)return;const U=Ce==null?void 0:Ce();let B,J=!0;U!==void 0&&(B=await U,B==="top"&&(J=!1),typeof B=="number"&&(J=!1));let Y=0;const Z=()=>{if(Fa.current<=Ge){Y<500&&window.setTimeout(Z,Y),Y=50+Y*2;return}const re=typeof B=="number"?B:J?Ge:0;Po.current(y-q,re),kt({cell:[y,re],range:{x:y,y:re,width:1,height:1}},!1,!1,"edit");const we=pl.current([y-q,re]);we.allowOverlay&&Ki(we)&&we.readonly!==!0&&A&&window.setTimeout(()=>{ml.current(y,re)},0)};Z()},[Ct,Ce,q,Ge,kt]),Eo=g.useCallback(y=>{var F,U;const A=((U=(F=Kt[y])==null?void 0:F.trailingRowOptions)==null?void 0:U.targetColumn)??(Pe==null?void 0:Pe.targetColumn);if(typeof A=="number")return A+($n?1:0);if(typeof A=="object"){const B=w.indexOf(A);if(B>=0)return B+($n?1:0)}},[Kt,w,$n,Pe==null?void 0:Pe.targetColumn]),Rr=g.useRef(),si=g.useRef(),Di=g.useCallback((y,A)=>{var B;const[F,U]=A;return vr(Ue,(B=Ct[F])==null?void 0:B.themeOverride,zn==null?void 0:zn(U),y.themeOverride)},[zn,Ct,Ue]),{mapper:Vr}=K0(Ne,b),jn=Ne==null?void 0:Ne.navigationBehavior,Oi=g.useCallback(y=>{var we,Fe,ye;const A=ua.value?y.metaKey:y.ctrlKey,F=A&&ue==="multi",U=A&&it==="multi",[B,J]=y.location,Y=j.columns,Z=j.rows,[ee,re]=((we=j.current)==null?void 0:we.cell)??[];if(y.kind==="cell"){if(si.current=void 0,$r.current=[B,J],B===0&&$n){if(jt===!0&&J===Ge||Rn==="number"||ue==="none")return;const He=_n(y.location);if(He.kind!==Yn.Marker)return;if(te!==void 0){const qe=yt(He);An((qe==null?void 0:qe.kind)===Yn.Marker);const Ae=(Fe=qe==null?void 0:qe.onClick)==null?void 0:Fe.call(qe,{...y,cell:He,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Di(He,y.location),preventDefault:()=>{}});if(Ae===void 0||Ae.checked===He.checked)return}o(void 0),kn();const De=Z.hasIndex(J),gt=Rr.current;if(ue==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&gt!==void 0&&Z.hasIndex(gt)){const qe=[Math.min(gt,J),Math.max(gt,J)+1];F||ze==="multi"?Me(void 0,qe,!0):Me(mt.fromSingleSelection(qe),void 0,F)}else ue==="multi"&&(F||y.isTouch||ze==="multi")?De?Me(Z.remove(J),void 0,!0):(Me(void 0,J,!0),Rr.current=J):De&&Z.length===1?Me(mt.empty(),void 0,A):(Me(mt.fromSingleSelection(J),void 0,A),Rr.current=J)}else if(B>=q&&jt&&J===Ge){const He=Eo(B);ai(He??B)}else if(ee!==B||re!==J){const He=_n(y.location),De=yt(He);if((De==null?void 0:De.onSelect)!==void 0){let Ae=!1;if(De.onSelect({...y,cell:He,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Ae=!0,theme:Di(He,y.location)}),Ae)return}if(jn==="block"&&Vr(J).isGroupHeader)return;const gt=xr&&J===Ge,qe=xr&&j!==void 0&&((ye=j.current)==null?void 0:ye.cell[1])===Ge;if((y.shiftKey||y.isLongTouch===!0)&&ee!==void 0&&re!==void 0&&j.current!==void 0&&!qe){if(gt)return;const Ae=Math.min(B,ee),Mt=Math.max(B,ee),Xt=Math.min(J,re),an=Math.max(J,re);kt({...j.current,range:{x:Ae,y:Xt,width:Mt-Ae+1,height:an-Xt+1}},!0,A,"click"),Rr.current=void 0,kn()}else kt({cell:[B,J],range:{x:B,y:J,width:1,height:1}},!0,A,"click"),Rr.current=void 0,o(void 0),kn()}}else if(y.kind==="header")if($r.current=[B,J],o(void 0),$n&&B===0)Rr.current=void 0,si.current=void 0,ue==="multi"&&(Z.length!==Ge?Me(mt.fromSingleSelection([0,Ge]),void 0,A):Me(mt.empty(),void 0,A),kn());else{const He=si.current;if(it==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&He!==void 0&&Y.hasIndex(He)){const De=[Math.min(He,B),Math.max(He,B)+1];U?je(void 0,De,A):je(mt.fromSingleSelection(De),void 0,A)}else U?(Y.hasIndex(B)?je(Y.remove(B),void 0,A):je(void 0,B,A),si.current=B):it!=="none"&&(je(mt.fromSingleSelection(B),void 0,A),si.current=B);Rr.current=void 0,kn()}else y.kind===qn?$r.current=[B,J]:y.kind===ca&&!y.isMaybeScrollbar&&(Se(Wo,!1),o(void 0),kn(),St==null||St(),Rr.current=void 0,si.current=void 0)},[ue,it,j,$n,q,jt,Ge,Rn,_n,te,kn,ze,yt,Di,Me,Eo,ai,jn,Vr,xr,kt,je,Se,St]),Pi=g.useRef(!1),$r=g.useRef(),vl=g.useRef(Hr),Bn=g.useRef(),Af=g.useCallback(y=>{if(li.current=!1,vl.current=Qt.current,y.button!==0&&y.button!==1){Bn.current=void 0;return}const A=performance.now();Bn.current={button:y.button,time:A,location:y.location},(y==null?void 0:y.kind)==="header"&&(Pi.current=!0);const F=y.kind==="cell"&&y.isFillHandle;!F&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:j,fillHandle:F}),$r.current=void 0,!y.isTouch&&y.button===0&&!F?Oi(y):!y.isTouch&&y.button===1&&($r.current=y.location))},[j,Oi]),[Aa,Ha]=g.useState(),bl=g.useCallback(y=>{if(y.kind!==qn||it!=="multi")return;const A=ua.value?y.metaKey:y.ctrlKey,[F]=y.location,U=j.columns;if(F<q)return;const B=Ct[F];let J=F,Y=F;for(let Z=F-1;Z>=q&&io(B.group,Ct[Z].group);Z--)J--;for(let Z=F+1;Z<Ct.length&&io(B.group,Ct[Z].group);Z++)Y++;if(kn(),A)if(U.hasAll([J,Y+1])){let Z=U;for(let ee=J;ee<=Y;ee++)Z=Z.remove(ee);je(Z,void 0,A)}else je(void 0,[J,Y+1],A);else je(mt.fromSingleSelection([J,Y+1]),void 0,A)},[it,kn,j.columns,Ct,q,je]),li=g.useRef(!1),Io=g.useCallback(async y=>{if(cn!==void 0&&ke!==void 0){const A=Qt.current.y,F=Qt.current.height;let U=cn({x:y,y:A,width:1,height:Math.min(F,Ge-A)},un.current.signal);typeof U!="object"&&(U=await U());const B=Kt[y-q],Y=document.createElement("canvas").getContext("2d",{alpha:!1});if(Y!==null){Y.font=Ue.baseFontFull;const Z=xd(Y,Ue,B,0,U,rr,Ar,!1,yt);ke==null||ke(B,Z.width,y,Z.width)}}},[Kt,cn,Ar,Ue,rr,ke,q,Ge,yt]),[Hf,za]=g.useState(),ui=g.useCallback(async(y,A)=>{var Z,ee;const F=(Z=y.current)==null?void 0:Z.range;if(F===void 0||cn===void 0||A.current===void 0)return;const U=A.current.range;if(R!==void 0){let re=!1;if(R({fillDestination:{...U,x:U.x-q},patternSource:{...F,x:F.x-q},preventDefault:()=>re=!0}),re)return}let B=cn(F,un.current.signal);typeof B!="object"&&(B=await B());const J=B,Y=[];for(let re=0;re<U.width;re++)for(let we=0;we<U.height;we++){const Fe=[U.x+re,U.y+we];if(dd(Fe,F))continue;const ye=J[we%F.height][re%F.width];gi(ye)||!Ki(ye)||Y.push({location:Fe,value:{...ye}})}Nn(Y),(ee=Tn.current)==null||ee.damage(Y.map(re=>({cell:re.location})))},[cn,Nn,R,q]),wl=g.useCallback(()=>{if(j.current===void 0||j.current.range.width<=1)return;const y={...j,current:{...j.current,range:{...j.current.range,width:1}}};ui(y,j)},[ui,j]),yl=g.useCallback(()=>{if(j.current===void 0||j.current.range.height<=1)return;const y={...j,current:{...j.current,range:{...j.current.range,height:1}}};ui(y,j)},[ui,j]),zf=g.useCallback((y,A)=>{var we,Fe;const F=s;if(u(void 0),_a(void 0),za(void 0),Pi.current=!1,A)return;if((F==null?void 0:F.fillHandle)===!0&&j.current!==void 0&&((we=F.previousSelection)==null?void 0:we.current)!==void 0){if(zr===void 0)return;const ye={...j,current:{...j.current,range:Id(F.previousSelection.current.range,zr)}};ui(F.previousSelection,ye),Se(ye,!0);return}const[U,B]=y.location,[J,Y]=$r.current??[],Z=()=>{li.current=!0},ee=ye=>{var De,gt,qe;const He=ye.isTouch||J===U&&Y===B;if(He&&(O==null||O([U-q,B],{...ye,preventDefault:Z})),ye.button===1)return!li.current;if(!li.current){const Ae=_n(y.location),Mt=yt(Ae);if(Mt!==void 0&&Mt.onClick!==void 0&&He){const an=Mt.onClick({...ye,cell:Ae,posX:ye.localEventX,posY:ye.localEventY,bounds:ye.bounds,theme:Di(Ae,y.location),preventDefault:Z});an!==void 0&&!gi(an)&&fi(an)&&(Nn([{location:ye.location,value:an}]),(De=Tn.current)==null||De.damage([{cell:ye.location}]))}if(li.current||j.current===void 0)return!1;let Xt=!1;switch(Ae.activationBehaviorOverride??ot){case"double-click":case"second-click":{if(((qe=(gt=F==null?void 0:F.previousSelection)==null?void 0:gt.current)==null?void 0:qe.cell)===void 0)break;const[an,Zn]=j.current.cell,[or,Jn]=F.previousSelection.current.cell;Xt=U===an&&U===or&&B===Zn&&B===Jn&&(ye.isDoubleClick===!0||ot==="second-click");break}case"single-click":{Xt=!0;break}}if(Xt)return S==null||S([U-q,B]),oi(ye.bounds,!1),!0}return!1},re=y.location[0]-q;if(y.isTouch){const ye=Qt.current,He=vl.current;if(ye.x!==He.x||ye.y!==He.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&Qi((Fe=j.current)==null?void 0:Fe.cell,y.location)){N==null||N([re,y.location[1]],{...y,preventDefault:Z});return}else if(y.kind==="header"&&j.columns.hasIndex(U)){ie==null||ie(re,{...y,preventDefault:Z});return}else if(y.kind===qn){if(re<0)return;G==null||G(re,{...y,preventDefault:Z});return}}y.kind==="cell"?ee(y)||Oi(y):y.kind===qn?z==null||z(re,{...y,preventDefault:Z}):(y.kind===Dr&&(C==null||C(re,{...y,preventDefault:Z})),Oi(y));return}if(y.kind==="header"){if(re<0)return;y.isEdge?y.isDoubleClick===!0&&Io(U):y.button===0&&U===J&&B===Y&&(C==null||C(re,{...y,preventDefault:Z}))}if(y.kind===qn){if(re<0)return;y.button===0&&U===J&&B===Y&&(z==null||z(re,{...y,preventDefault:Z}),li.current||bl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&ee(y),$r.current=void 0},[s,j,q,zr,ui,Se,O,_n,yt,ot,Di,Nn,S,oi,N,ie,G,Oi,z,C,Io,bl]),Vf=g.useCallback(y=>{const A={...y,location:[y.location[0]-q,y.location[1]]};_e==null||_e(A),s!==void 0&&y.buttons===0&&(u(void 0),_a(void 0),za(void 0),Pi.current=!1),za(F=>{var U;return Pi.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===(F==null?void 0:F[0])&&y.scrollEdge[1]===F[1]?F:s===void 0||(((U=Bn.current)==null?void 0:U.location[0])??0)<q?void 0:y.scrollEdge})},[s,_e,q]),$f=g.useCallback((y,A)=>{et==null||et(y-q,A)},[et,q]),Nf=g.useCallback((y,A)=>{vt==null||vt(y-q,A)},[vt,q]),ir=(Il=j==null?void 0:j.current)==null?void 0:Il.cell,Bf=g.useCallback((y,A,F,U,B,J)=>{kr.current=!1;let Y=ir;Y!==void 0&&(Y=[Y[0]-q,Y[1]]);const Z=fe===0?void 0:{x:0,y:y.y,width:fe,height:y.height},ee=[];Z!==void 0&&ee.push(Z),Ht>0&&(ee.push({x:y.x-q,y:Ge-Ht,width:y.width,height:Ht}),fe>0&&ee.push({x:0,y:Ge-Ht,width:fe,height:Ht}));const re={x:y.x-q,y:y.y,width:y.width,height:jt&&y.y+y.height>=Ge?y.height-1:y.height,tx:B,ty:J,extras:{selected:Y,freezeRegion:Z,freezeRegions:ee}};Qt.current=re,Mr(re),ln([A,F,U]),tn==null||tn(re,re.tx,re.ty,re.extras)},[ir,q,jt,Ge,fe,Ht,Mr,tn]),Wf=qr(Ee,g.useCallback((y,A)=>{Ee==null||Ee(y-q,A-q),it!=="none"&&je(mt.fromSingleSelection(A),void 0,!0)},[it,Ee,q,je])),Va=g.useRef(!1),Uf=g.useCallback(y=>{if(y.location[0]===0&&q>0){y.preventDefault();return}$e==null||$e({...y,location:[y.location[0]-q,y.location[1]]}),y.defaultPrevented()||(Va.current=!0),u(void 0)},[$e,q]),qf=g.useCallback(()=>{Va.current=!1},[]),Cl=Ne==null?void 0:Ne.selectionBehavior,To=g.useCallback(y=>{if(Cl!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:U}=Vr(y);if(A)return[y,y];const B=F[F.length-1],J=y-B,Y=y+U-B-1;return[J,Y]},[Vr,Cl]),$a=g.useRef(),Na=g.useCallback(y=>{var A,F,U;if(!Ld(y,$a.current)&&($a.current=y,!(((A=Bn==null?void 0:Bn.current)==null?void 0:A.button)!==void 0&&Bn.current.button>=1))){if(y.buttons!==0&&s!==void 0&&((F=Bn.current)==null?void 0:F.location[0])===0&&y.location[0]===0&&q===1&&ue==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(Bn.current.location[1])&&j.rows.hasIndex(Bn.current.location[1])){const B=Math.min(Bn.current.location[1],y.location[1]),J=Math.max(Bn.current.location[1],y.location[1])+1;Me(mt.fromSingleSelection([B,J]),void 0,!1)}if(y.buttons!==0&&s!==void 0&&j.current!==void 0&&!Va.current&&!Pi.current&&(wt==="rect"||wt==="multi-rect")){const[B,J]=j.current.cell;let[Y,Z]=y.location;if(Z<0&&(Z=Qt.current.y),s.fillHandle===!0&&((U=s.previousSelection)==null?void 0:U.current)!==void 0){const ee=s.previousSelection.current.range;Z=Math.min(Z,jt?Ge-1:Ge);const re=zp(ee,Y,Z,dn);_a(re)}else{if(jt&&J===Ge)return;if(jt&&Z===Ge)if(y.kind===ca)Z--;else return;Y=Math.max(Y,q);const we=To(J);Z=we===void 0?Z:Un(Z,we[0],we[1]);const Fe=Y-B,ye=Z-J,He={x:Fe>=0?B:Y,y:ye>=0?J:Z,width:Math.abs(Fe)+1,height:Math.abs(ye)+1};kt({...j.current,range:He},!0,!1,"drag")}}qt==null||qt({...y,location:[y.location[0]-q,y.location[1]]})}},[s,q,ue,j,wt,qt,Me,jt,Ge,dn,To,kt]),Yf=g.useCallback(()=>{var Y,Z;const y=$a.current;if(y===void 0)return;const[A,F]=y.scrollEdge;let[U,B]=y.location;const J=Qt.current;A===-1?U=((Z=(Y=J.extras)==null?void 0:Y.freezeRegion)==null?void 0:Z.x)??J.x:A===1&&(U=J.x+J.width),F===-1?B=Math.max(0,J.y):F===1&&(B=Math.min(Ge-1,J.y+J.height)),U=Un(U,0,Ct.length-1),B=Un(B,0,Ge-1),Na({...y,location:[U,B]})},[Ct.length,Na,Ge]);q0(Hf,Wt,Yf);const Kn=g.useCallback(y=>{if(j.current===void 0)return;const[A,F]=y,[U,B]=j.current.cell,J=j.current.range;let Y=J.x,Z=J.x+J.width,ee=J.y,re=J.y+J.height;const[we,Fe]=To(B)??[0,Ge-1],ye=Fe+1;if(F!==0)switch(F){case 2:{re=ye,ee=B,on(0,re,"vertical");break}case-2:{ee=we,re=B+1,on(0,ee,"vertical");break}case 1:{ee<B?(ee++,on(0,ee,"vertical")):(re=Math.min(ye,re+1),on(0,re,"vertical"));break}case-1:{re>B+1?(re--,on(0,re,"vertical")):(ee=Math.max(we,ee-1),on(0,ee,"vertical"));break}default:ro()}if(A!==0)if(A===2)Z=Ct.length,Y=U,on(Z-1-q,0,"horizontal");else if(A===-2)Y=q,Z=U+1,on(Y-q,0,"horizontal");else{let He=[];if(cn!==void 0){const De=cn({x:Y,y:ee,width:Z-Y-q,height:re-ee},un.current.signal);typeof De=="object"&&(He=tv(De))}if(A===1){let De=!1;if(Y<U){if(He.length>0){const gt=sr(Y+1,U+1).find(qe=>!He.includes(qe-q));gt!==void 0&&(Y=gt,De=!0)}else Y++,De=!0;De&&on(Y,0,"horizontal")}De||(Z=Math.min(Ct.length,Z+1),on(Z-1-q,0,"horizontal"))}else if(A===-1){let De=!1;if(Z>U+1){if(He.length>0){const gt=sr(Z-1,U,-1).find(qe=>!He.includes(qe-q));gt!==void 0&&(Z=gt,De=!0)}else Z--,De=!0;De&&on(Z-q,0,"horizontal")}De||(Y=Math.max(q,Y-1),on(Y-q,0,"horizontal"))}else ro()}kt({cell:j.current.cell,range:{x:Y,y:ee,width:Z-Y,height:re-ee}},!0,!1,"keyboard-select")},[cn,To,j,Ct.length,q,Ge,on,kt]),Ba=g.useRef(Si);Ba.current=Si;const Er=g.useCallback((y,A,F,U)=>{const B=bn-(F?0:1);y=Un(y,q,Kt.length-1+q),A=Un(A,0,B);const J=ir==null?void 0:ir[0],Y=ir==null?void 0:ir[1];if(y===J&&A===Y)return!1;if(U&&j.current!==void 0){const Z=[...j.current.rangeStack];(j.current.range.width>1||j.current.range.height>1)&&Z.push(j.current.range),Se({...j,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:Z}},!0)}else kt({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),Ba.current&&on(y-q,A),!0},[bn,q,Kt.length,ir,j,on,Se,kt]),Xf=g.useCallback((y,A)=>{(i==null?void 0:i.cell)!==void 0&&y!==void 0&&fi(y)&&(Nn([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{var B;(B=Tn.current)==null||B.damage([{cell:i.cell}])})),kn(!0),o(void 0);const[F,U]=A;if(j.current!==void 0&&(F!==0||U!==0)){const B=j.current.cell[1]===bn-1&&y!==void 0;Er(Un(j.current.cell[0]+F,0,Ct.length-1),Un(j.current.cell[1]+U,0,bn-1),B,!1)}_==null||_(y,A)},[i==null?void 0:i.cell,kn,j,_,Nn,bn,Er,Ct.length]),Gf=g.useMemo(()=>`gdg-overlay-${ev++}`,[]),Nr=g.useCallback(y=>{var F,U,B,J;kn();const A=[];for(let Y=y.x;Y<y.x+y.width;Y++)for(let Z=y.y;Z<y.y+y.height;Z++){const ee=M([Y-q,Z]);if(!ee.allowOverlay&&ee.kind!==ne.Boolean)continue;let re;if(ee.kind===ne.Custom){const we=yt(ee),Fe=(F=we==null?void 0:we.provideEditor)==null?void 0:F.call(we,ee);(we==null?void 0:we.onDelete)!==void 0?re=we.onDelete(ee):Dg(Fe)&&(re=(U=Fe==null?void 0:Fe.deletedValue)==null?void 0:U.call(Fe,ee))}else if(fi(ee)&&ee.allowOverlay||ee.kind===ne.Boolean){const we=yt(ee);re=(B=we==null?void 0:we.onDelete)==null?void 0:B.call(we,ee)}re!==void 0&&!gi(re)&&fi(re)&&A.push({location:[Y,Z],value:re})}Nn(A),(J=Tn.current)==null||J.damage(A.map(Y=>({cell:Y.location})))},[kn,M,yt,Nn,q]),_i=i!==void 0,Sl=g.useCallback(y=>{var gt,qe;const A=()=>{y.stopPropagation(),y.preventDefault()},F={didMatch:!1},{bounds:U}=y,B=j.columns,J=j.rows,Y=Vn;if(!_i&&ut(Y.clear,y,F))Se(Wo,!1),St==null||St();else if(!_i&&ut(Y.selectAll,y,F))Se({columns:mt.empty(),rows:mt.empty(),current:{cell:((gt=j.current)==null?void 0:gt.cell)??[q,0],range:{x:q,y:0,width:w.length,height:Ge},rangeStack:[]}},!1);else if(ut(Y.search,y,F))(qe=a==null?void 0:a.current)==null||qe.focus({preventScroll:!0}),ri(!0);else if(ut(Y.delete,y,F)){const Ae=(Te==null?void 0:Te(j))??!0;if(Ae!==!1){const Mt=Ae===!0?j:Ae;if(Mt.current!==void 0){Nr(Mt.current.range);for(const Xt of Mt.current.rangeStack)Nr(Xt)}for(const Xt of Mt.rows)Nr({x:q,y:Xt,width:w.length,height:1});for(const Xt of Mt.columns)Nr({x:Xt,y:0,width:1,height:Ge})}}if(F.didMatch)return A(),!0;if(j.current===void 0)return!1;let[Z,ee]=j.current.cell;const[,re]=j.current.cell;let we=!1,Fe=!1;if(ut(Y.scrollToSelectedCell,y,F)?Po.current(Z-q,ee):it!=="none"&&ut(Y.selectColumn,y,F)?B.hasIndex(Z)?je(B.remove(Z),void 0,!0):it==="single"?je(mt.fromSingleSelection(Z),void 0,!0):je(void 0,Z,!0):ue!=="none"&&ut(Y.selectRow,y,F)?J.hasIndex(ee)?Me(J.remove(ee),void 0,!0):ue==="single"?Me(mt.fromSingleSelection(ee),void 0,!0):Me(void 0,ee,!0):!_i&&U!==void 0&&ut(Y.activateCell,y,F)?ee===Ge&&jt?window.setTimeout(()=>{const Ae=Eo(Z);ai(Ae??Z)},0):(S==null||S([Z-q,ee]),oi(U,!0)):j.current.range.height>1&&ut(Y.downFill,y,F)?yl():j.current.range.width>1&&ut(Y.rightFill,y,F)?wl():ut(Y.goToNextPage,y,F)?ee+=Math.max(1,Qt.current.height-4):ut(Y.goToPreviousPage,y,F)?ee-=Math.max(1,Qt.current.height-4):ut(Y.goToFirstCell,y,F)?(o(void 0),ee=0,Z=0):ut(Y.goToLastCell,y,F)?(o(void 0),ee=Number.MAX_SAFE_INTEGER,Z=Number.MAX_SAFE_INTEGER):ut(Y.selectToFirstCell,y,F)?(o(void 0),Kn([-2,-2])):ut(Y.selectToLastCell,y,F)?(o(void 0),Kn([2,2])):_i?(ut(Y.closeOverlay,y,F)&&o(void 0),ut(Y.acceptOverlayDown,y,F)&&(o(void 0),ee++),ut(Y.acceptOverlayUp,y,F)&&(o(void 0),ee--),ut(Y.acceptOverlayLeft,y,F)&&(o(void 0),Z--),ut(Y.acceptOverlayRight,y,F)&&(o(void 0),Z++)):(ut(Y.goDownCell,y,F)?ee+=1:ut(Y.goUpCell,y,F)?ee-=1:ut(Y.goRightCell,y,F)?Z+=1:ut(Y.goLeftCell,y,F)?Z-=1:ut(Y.goDownCellRetainSelection,y,F)?(ee+=1,we=!0):ut(Y.goUpCellRetainSelection,y,F)?(ee-=1,we=!0):ut(Y.goRightCellRetainSelection,y,F)?(Z+=1,we=!0):ut(Y.goLeftCellRetainSelection,y,F)?(Z-=1,we=!0):ut(Y.goToLastRow,y,F)?ee=Ge-1:ut(Y.goToFirstRow,y,F)?ee=Number.MIN_SAFE_INTEGER:ut(Y.goToLastColumn,y,F)?Z=Number.MAX_SAFE_INTEGER:ut(Y.goToFirstColumn,y,F)?Z=Number.MIN_SAFE_INTEGER:(wt==="rect"||wt==="multi-rect")&&(ut(Y.selectGrowDown,y,F)?Kn([0,1]):ut(Y.selectGrowUp,y,F)?Kn([0,-1]):ut(Y.selectGrowRight,y,F)?Kn([1,0]):ut(Y.selectGrowLeft,y,F)?Kn([-1,0]):ut(Y.selectToLastRow,y,F)?Kn([0,2]):ut(Y.selectToFirstRow,y,F)?Kn([0,-2]):ut(Y.selectToLastColumn,y,F)?Kn([2,0]):ut(Y.selectToFirstColumn,y,F)&&Kn([-2,0])),Fe=F.didMatch),jn!==void 0&&jn!=="normal"&&ee!==re){const Ae=jn==="skip-up"||jn==="skip"||jn==="block",Mt=jn==="skip-down"||jn==="skip"||jn==="block",Xt=ee<re;if(Xt&&Ae){for(;ee>=0&&Vr(ee).isGroupHeader;)ee--;ee<0&&(ee=re)}else if(!Xt&&Mt){for(;ee<Ge&&Vr(ee).isGroupHeader;)ee++;ee>=Ge&&(ee=re)}}const He=Er(Z,ee,!1,we),De=F.didMatch;return De&&(He||!Fe||Yt)&&A(),De},[jn,_i,j,Vn,it,ue,wt,q,Vr,Ge,Er,Se,St,w.length,Te,Yt,Nr,je,Me,jt,Eo,ai,S,oi,yl,wl,Kn]),Li=g.useCallback(y=>{let A=!1;if(W!==void 0&&W({...y,cancel:()=>{A=!0}}),A||Sl(y)||j.current===void 0)return;const[F,U]=j.current.cell,B=Qt.current;if(Ve&&!y.metaKey&&!y.ctrlKey&&j.current!==void 0&&y.key.length===1&&/[ -~]/g.test(y.key)&&y.bounds!==void 0&&Ki(M([F-q,Math.max(0,Math.min(U,Ge-1))]))){if((!jt||U!==Ge)&&(B.y>U||U>B.y+B.height||B.x>F||F>B.x+B.width))return;oi(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[Ve,W,Sl,j,M,q,Ge,jt,oi]),jf=g.useCallback((y,A)=>{const F=y.location[0]-q;if(y.kind==="header"&&(ie==null||ie(F,{...y,preventDefault:A})),y.kind===qn){if(F<0)return;G==null||G(F,{...y,preventDefault:A})}if(y.kind==="cell"){const[U,B]=y.location;N==null||N([F,B],{...y,preventDefault:A}),_m(j,y.location)||Er(U,B,!1,!1)}},[j,N,G,ie,q,Er]),Wa=g.useCallback(async y=>{var Y,Z,ee;if(!Vn.paste)return;function A(re,we,Fe,ye){var De,gt;const He=typeof Fe=="object"?(Fe==null?void 0:Fe.join(`
173
173
  `))??"":(Fe==null?void 0:Fe.toString())??"";if(!gi(re)&&Ki(re)&&re.readonly!==!0){const qe=E==null?void 0:E(He,re);if(qe!==void 0&&fi(qe))return{location:we,value:qe};const Ae=yt(re);if(Ae===void 0)return;if(Ae.kind===ne.Custom){An(re.kind===ne.Custom);const Mt=(De=Ae.onPaste)==null?void 0:De.call(Ae,He,re.data);return Mt===void 0?void 0:{location:we,value:{...re,data:Mt}}}else{const Mt=(gt=Ae.onPaste)==null?void 0:gt.call(Ae,He,re,{formatted:ye,formattedString:typeof ye=="string"?ye:ye==null?void 0:ye.join(`
174
174
  `),rawValue:Fe});return Mt===void 0?void 0:(An(Mt.kind===re.kind),{location:we,value:Mt})}}}const F=j.columns,U=j.rows,B=((Y=Wt.current)==null?void 0:Y.contains(document.activeElement))===!0||((Z=l.current)==null?void 0:Z.contains(document.activeElement))===!0;let J;if(j.current!==void 0?J=[j.current.range.x,j.current.range.y]:F.length===1?J=[F.first()??0,0]:U.length===1&&(J=[q,U.first()??0]),B&&J!==void 0){let re,we;const Fe="text/plain",ye="text/html";if(navigator.clipboard.read!==void 0){const qe=await navigator.clipboard.read();for(const Ae of qe){if(Ae.types.includes(ye)){const Xt=await(await Ae.getType(ye)).text(),an=Tu(Xt);if(an!==void 0){re=an;break}}Ae.types.includes(Fe)&&(we=await(await Ae.getType(Fe)).text())}}else if(navigator.clipboard.readText!==void 0)we=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=Tu(qe)}re===void 0&&y.clipboardData.types.includes(Fe)&&(we=y.clipboardData.getData(Fe))}else return;const[He,De]=J,gt=[];do{if(nt===void 0){const qe=_n(J),Ae=we??(re==null?void 0:re.map(Xt=>Xt.map(an=>an.rawValue).join(" ")).join(" "))??"",Mt=A(qe,J,Ae,void 0);Mt!==void 0&&gt.push(Mt);break}if(re===void 0){if(we===void 0)return;re=z0(we)}if(nt===!1||typeof nt=="function"&&(nt==null?void 0:nt([J[0]-q,J[1]],re.map(qe=>qe.map(Ae=>{var Mt;return((Mt=Ae.rawValue)==null?void 0:Mt.toString())??""}))))!==!0)return;for(const[qe,Ae]of re.entries()){if(qe+De>=Ge)break;for(const[Mt,Xt]of Ae.entries()){const an=[Mt+He,qe+De],[Zn,or]=an;if(Zn>=Ct.length||or>=bn)continue;const Jn=_n(an),ar=A(Jn,an,Xt.rawValue,Xt.formatted);ar!==void 0&&gt.push(ar)}}}while(!1);Nn(gt),(ee=Tn.current)==null||ee.damage(gt.map(qe=>({cell:qe.location})))}},[E,yt,_n,j,Vn.paste,Wt,Ct.length,Nn,bn,nt,q,Ge]);hn("paste",Wa,d,!1,!0);const Fi=g.useCallback(async(y,A)=>{var Y,Z;if(!Vn.copy)return;const F=A===!0||((Y=Wt.current)==null?void 0:Y.contains(document.activeElement))===!0||((Z=l.current)==null?void 0:Z.contains(document.activeElement))===!0,U=j.columns,B=j.rows,J=(ee,re)=>{if(!be)Ou(ee,re,y);else{const we=re.map(Fe=>({kind:ne.Text,data:w[Fe].title,displayData:w[Fe].title,allowOverlay:!1}));Ou([we,...ee],re,y)}};if(F&&cn!==void 0){if(j.current!==void 0){let ee=cn(j.current.range,un.current.signal);typeof ee!="object"&&(ee=await ee()),J(ee,sr(j.current.range.x-q,j.current.range.x+j.current.range.width-q))}else if(B!==void 0&&B.length>0){const re=[...B].map(we=>{const Fe=cn({x:q,y:we,width:w.length,height:1},un.current.signal);return typeof Fe=="object"?Fe[0]:Fe().then(ye=>ye[0])});if(re.some(we=>we instanceof Promise)){const we=await Promise.all(re);J(we,sr(w.length))}else J(re,sr(w.length))}else if(U.length>0){const ee=[],re=[];for(const we of U){let Fe=cn({x:we,y:0,width:1,height:Ge},un.current.signal);typeof Fe!="object"&&(Fe=await Fe()),ee.push(Fe),re.push(we-q)}if(ee.length===1)J(ee[0],re);else{const we=ee.reduce((Fe,ye)=>Fe.map((He,De)=>[...He,...ye[De]]));J(we,re)}}}},[w,cn,j,Vn.copy,q,Wt,Ge,be]);hn("copy",Fi,d,!1,!1);const Kf=g.useCallback(async y=>{var F,U;if(!(!Vn.cut||!(((F=Wt.current)==null?void 0:F.contains(document.activeElement))===!0||((U=l.current)==null?void 0:U.contains(document.activeElement))===!0))&&(await Fi(y),j.current!==void 0)){let B={current:{cell:j.current.cell,range:j.current.range,rangeStack:[]},rows:mt.empty(),columns:mt.empty()};const J=Te==null?void 0:Te(B);if(J===!1||(B=J===!0?B:J,B.current===void 0))return;Nr(B.current.range)}},[Nr,j,Vn.cut,Fi,Wt,Te]);hn("cut",Kf,d,!1,!1);const Zf=g.useCallback((y,A)=>{if(he!==void 0){q!==0&&(y=y.map(B=>[B[0]-q,B[1]])),he(y,A);return}if(y.length===0||A===-1)return;const[F,U]=y[A];c.current!==void 0&&c.current[0]===F&&c.current[1]===U||(c.current=[F,U],Er(F,U,!1,!1))},[he,q,Er]),[Do,Oo]=((Tl=Rt==null?void 0:Rt.current)==null?void 0:Tl.cell)??[],Po=g.useRef(on);Po.current=on,g.useLayoutEffect(()=>{var y,A,F,U;Ba.current&&!kr.current&&Do!==void 0&&Oo!==void 0&&(Do!==((A=(y=ae.current)==null?void 0:y.current)==null?void 0:A.cell[0])||Oo!==((U=(F=ae.current)==null?void 0:F.current)==null?void 0:U.cell[1]))&&Po.current(Do,Oo),kr.current=!1},[Do,Oo]);const xl=j.current!==void 0&&(j.current.cell[0]>=Ct.length||j.current.cell[1]>=bn);g.useLayoutEffect(()=>{xl&&Se(Wo,!1)},[xl,Se]);const Jf=g.useMemo(()=>jt===!0&&(Pe==null?void 0:Pe.tint)===!0?mt.fromSingleSelection(bn-1):mt.empty(),[bn,jt,Pe==null?void 0:Pe.tint]),Qf=g.useCallback(y=>typeof st=="boolean"?st:(st==null?void 0:st(y-q))??!0,[q,st]),eh=g.useMemo(()=>{if(Aa===void 0||l.current===null)return null;const{bounds:y,group:A}=Aa,F=l.current.getBoundingClientRect();return g.createElement(E0,{bounds:y,group:A,canvasBounds:F,onClose:()=>Ha(void 0),onFinish:U=>{Ha(void 0),le==null||le(A,U)}})},[le,Aa]),th=Math.min(Ct.length,fe+($n?1:0));g.useImperativeHandle(t,()=>({appendRow:(y,A)=>ai(y+q,A),updateCells:y=>{var A;return q!==0&&(y=y.map(F=>({cell:[F.cell[0]+q,F.cell[1]]}))),(A=Tn.current)==null?void 0:A.damage(y)},getBounds:(y,A)=>{var F;if(!((l==null?void 0:l.current)===null||(Wt==null?void 0:Wt.current)===null)){if(y===void 0&&A===void 0){const U=l.current.getBoundingClientRect(),B=U.width/Wt.current.clientWidth;return{x:U.x-Wt.current.scrollLeft*B,y:U.y-Wt.current.scrollTop*B,width:Wt.current.scrollWidth*B,height:Wt.current.scrollHeight*B}}return(F=Tn.current)==null?void 0:F.getBounds((y??0)+q,A)}},focus:()=>{var y;return(y=Tn.current)==null?void 0:y.focus()},emit:async y=>{switch(y){case"delete":Li({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":Li({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":Li({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 Fi(void 0,!0);break;case"paste":await Wa();break}},scrollTo:on,remeasureColumns:y=>{for(const A of y)Io(A+q)}}),[ai,Io,Wt,Fi,Li,Wa,q,on]);const[kl,Ml]=ir??[],nh=g.useCallback(y=>{const[A,F]=y;if(F===-1){it!=="none"&&(je(mt.fromSingleSelection(A),void 0,!1),kn());return}kl===A&&Ml===F||(kt({cell:y,range:{x:A,y:F,width:1,height:1}},!0,!1,"keyboard-nav"),on(A,F))},[it,kn,on,kl,Ml,kt,je]),[rh,ih]=g.useState(!1),Rl=g.useRef(Jc(y=>{ih(y)},5)),oh=g.useCallback(()=>{Rl.current(!0),j.current===void 0&&j.columns.length===0&&j.rows.length===0&&s===void 0&&kt({cell:[q,So],range:{x:q,y:So,width:1,height:1}},!0,!1,"keyboard-select")},[So,j,s,q,kt]),ah=g.useCallback(()=>{Rl.current(!1)},[]),[sh,lh]=g.useMemo(()=>{let y;const A=(Ot==null?void 0:Ot.scrollbarWidthOverride)??Ss(),F=Ge+(jt?1:0);if(typeof Xn=="number")y=It+F*Xn;else{let B=0;const J=Math.min(F,10);for(let Y=0;Y<J;Y++)B+=Xn(Y);B=Math.floor(B/J),y=It+F*B}y+=A;const U=Ct.reduce((B,J)=>J.width+B,0)+A;return[`${Math.min(1e5,U)}px`,`${Math.min(1e5,y)}px`]},[Ct,Ot==null?void 0:Ot.scrollbarWidthOverride,Xn,Ge,jt,It]),uh=g.useMemo(()=>Xm(Ue),[Ue]);return g.createElement(Sd.Provider,{value:Ue},g.createElement(B0,{style:uh,className:X,inWidth:p??sh,inHeight:v??lh},g.createElement(x0,{fillHandle:Bt,drawFocusRing:Fr,experimental:Ot,fixedShadowX:zt,fixedShadowY:Vt,getRowThemeOverride:zn,headerIcons:Cn,imageWindowLoader:dr,initialSize:On,isDraggable:V,onDragLeave:Qe,onRowMoved:te,overscrollX:Ta,overscrollY:Da,preventDiagonalScrolling:Zt,rightElement:rn,rightElementProps:Sn,smoothScrollX:fn,smoothScrollY:vn,className:X,enableGroups:xn,onCanvasFocused:oh,onCanvasBlur:ah,canvasRef:l,onContextMenu:jf,theme:Ue,cellXOffset:Lf,cellYOffset:So,accessibilityHeight:Hr.height,onDragEnd:qf,columns:Ct,nonGrowWidth:Gn,drawHeader:rt,onColumnProposeMove:I,drawCell:at,disabledRows:Jf,freezeColumns:th,lockColumns:q,firstColAccessible:q===0,getCellContent:_n,minColumnWidth:rr,maxColumnWidth:Ar,searchInputRef:a,showSearch:Ii,onSearchClose:Oa,highlightRegions:Ff,getCellsForSelection:cn,getGroupDetails:La,headerHeight:Ei,isFocused:rh,groupHeaderHeight:xn?yo:0,freezeTrailingRows:Ht+(jt&&(Pe==null?void 0:Pe.sticky)===!0?1:0),hasAppendRow:jt,onColumnResize:ke,onColumnResizeEnd:me,onColumnResizeStart:Re,onCellFocused:nh,onColumnMoved:Wf,onDragStart:Uf,onHeaderMenuClick:$f,onHeaderIndicatorClick:Nf,onItemHovered:Na,isFilling:(s==null?void 0:s.fillHandle)===!0,onMouseMove:Vf,onKeyDown:Li,onKeyUp:de,onMouseDown:Af,onMouseUp:zf,onDragOverCell:Nt,onDrop:_t,onSearchResultsChanged:Zf,onVisibleRegionChanged:Bf,clientSize:ft,rowHeight:Xn,searchResults:Q,searchValue:P,onSearchValueChange:H,rows:bn,scrollRef:Wt,selection:j,translateX:Hr.tx,translateY:Hr.ty,verticalBorder:Qf,gridRef:Tn,getCellRenderer:yt,resizeIndicator:Ia}),eh,i!==void 0&&g.createElement(g.Suspense,{fallback:null},g.createElement(Q0,{...i,validateCell:$,bloom:D,id:Gf,getCellRenderer:yt,className:(Ot==null?void 0:Ot.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:yn,imageEditorOverride:h,onFinishEditing:Xf,markdownDivCreateNode:m,isOutsideClick:Cr,customEventTarget:Ot==null?void 0:Ot.eventTarget}))))},rv=g.forwardRef(nv),Vd=20;function Lu(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:a,height:l,x:s,y:u}=i,c=t.maxSize??Vd,d=Math.floor(i.y+l/2),h=td(c,l,o.cellVerticalPadding),f=ed(t.contentAlign??"center",s,a,o.cellHorizontalPadding,h),m=Qc(f,d,h),p=nd(s+n,u+r,m);return zs(t)&&p}const iv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:ne.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>ov(e,e.cell.data,zs(e.cell),e.cell.maxSize??Vd,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Lu(e)&&e.preventDefault()},onClick:e=>{if(Lu(e))return{...e.cell,data:Ad(e.cell.data)}},onPaste:(e,t)=>{let n=ra;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Hs),n===t.data?void 0:{...t,data:n}}};function ov(e,t,n,r,i){if(!n&&t===ra)return;const{ctx:o,hoverAmount:a,theme:l,rect:s,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:h}}=e,{x:f,y:m,width:p,height:v}=s;let w=!1;if(i>0){let b=n?1-i+i*a:.4;if(t===ra&&(b*=a),b===0)return;b<1&&(w=!0,o.globalAlpha=b)}Gs(o,l,t,f,m,p,v,u,c,d,r,h),w&&(o.globalAlpha=1)}const av=gn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),sv=e=>{const{bubbles:t}=e;return g.createElement(av,null,t.map((n,r)=>g.createElement("div",{key:r,className:"boe-bubble"},n)),g.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},lv={getAccessibilityString:e=>rd(e.data),kind:ne.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i).width+r+20,0)+2*n.cellHorizontalPadding-4,draw:e=>cv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return g.createElement(sv,{bubbles:t.data})},onPaste:()=>{}},uv=4;function cv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:a,y:l,width:s,height:u}=n,c=20,d=8,h=uv;let f=a+r.cellHorizontalPadding;const m=[];for(const p of t){if(f>a+s)break;const v=Jr(p,i,r.baseFontFull).width;m.push({x:f,width:v}),f+=v+d*2+h}i.beginPath();for(const p of m)ur(i,p.x,l+(u-c)/2,p.width+d*2,c,r.roundingRadius??c/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[p,v]of m.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[p],v.x+d,l+u/2+cr(i,r))}const dv=gn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),fv=e=>{const{drilldowns:t}=e;return g.createElement(dv,null,t.map((n,r)=>g.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&g.createElement("img",{src:n.img}),g.createElement("div",null,n.text))))},hv={getAccessibilityString:e=>rd(e.data.map(t=>t.text)),kind:ne.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+20+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>pv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return g.createElement(fv,{drilldowns:t.data})},onPaste:()=>{}},gv=4,us={};function mv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,a=n-o*2,l=4,s=n*i,u=r+o,c=r*3,d=(c+o*2)*i,h=`${e},${t},${i},${n}`;if(us[h]!==void 0)return{el:us[h],height:s,width:d,middleWidth:l*i,sideWidth:u*i,padding:o*i,dpr:i};const f=document.createElement("canvas"),m=f.getContext("2d");return m===null?null:(f.width=d,f.height=s,m.scale(i,i),us[h]=f,m.beginPath(),ur(m,o,o,c,a,r),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),ur(m,o+.5,o+.5,c,a,r),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:f,height:s,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function pv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:a,row:l}=e,{x:s,width:u}=n,c=r.baseFontFull,d=vd(i,c),h=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),f=Math.floor(n.y+(n.height-h)/2),m=h-10,p=8,v=gv;let w=s+r.cellHorizontalPadding;const b=r.roundingRadius??6,M=mv(r.bgCell,r.drilldownBorder,h,b),O=[];for(const S of t){if(w>s+u)break;const _=Jr(S.text,i,c).width;let E=0;S.img!==void 0&&o.loadOrGetImage(S.img,a,l)!==void 0&&(E=m-8+4);const x=_+E+p*2;O.push({x:w,width:x}),w+=x+v}if(M!==null){const{el:S,height:R,middleWidth:_,sideWidth:E,width:x,dpr:L,padding:D}=M,C=E/L,I=D/L;for(const T of O){const k=Math.floor(T.x),z=Math.floor(T.width),N=z-(C-I)*2;i.imageSmoothingEnabled=!1,i.drawImage(S,0,0,E,R,k-I,f,C,h),N>0&&i.drawImage(S,E,0,_,R,k+(C-I),f,N,h),i.drawImage(S,x-E,0,E,R,k+z-(C-I),f,C,h),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[S,R]of O.entries()){const _=t[S];let E=R.x+p;if(_.img!==void 0){const x=o.loadOrGetImage(_.img,a,l);if(x!==void 0){const L=m-8;let D=0,C=0,I=x.width,T=x.height;I>T?(D+=(I-T)/2,I=T):T>I&&(C+=(T-I)/2,T=I),i.beginPath(),ur(i,E,f+h/2-L/2,L,L,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(x,D,C,I,T,E,f+h/2-L/2,L,L),i.restore(),E+=L+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,E,f+h/2+cr(i,r))}}const vv={getAccessibilityString:e=>e.data.join(", "),kind:ne.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>bv(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??rm;return g.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}}},cs=4;function bv(e,t,n,r){const{rect:i,col:o,row:a,theme:l,ctx:s,imageLoader:u}=e,{x:c,y:d,height:h,width:f}=i,m=h-l.cellVerticalPadding*2,p=[];let v=0;for(let b=0;b<t.length;b++){const M=t[b];if(M.length===0)continue;const O=u.loadOrGetImage(M,o,a);if(O!==void 0){p[b]=O;const S=O.width*(m/O.height);v+=S+cs}}if(v===0)return;v-=cs;let w=c+l.cellHorizontalPadding;r==="right"?w=Math.floor(c+f-l.cellHorizontalPadding-v):r==="center"&&(w=Math.floor(c+f/2-v/2));for(const b of p){if(b===void 0)continue;const M=b.width*(m/b.height);n>0&&(s.beginPath(),ur(s,w,d+l.cellVerticalPadding,M,m,n),s.save(),s.clip()),s.drawImage(b,w,d+l.cellVerticalPadding,M,m),n>0&&s.restore(),w+=M+cs}}function wv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const yv={getAccessibilityString:()=>"",kind:ne.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let l=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(l+=Math.round(wv(n,r)*t.skeletonWidthVariability));const s=a.cellHorizontalPadding;l+s*2>=o.width&&(l=o.width-s*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*a.cellVerticalPadding);ur(i,o.x+s,o.y+(o.height-u)/2,l,u,a.roundingRadius??3),i.fillStyle=Xr(a.textDark,.1),i.fill()},onPaste:()=>{}},Cv=()=>e=>e.targetWidth,Fu=gn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Cv(),"px"]}}),Sv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:a,validatedSelection:l}=e,s=t.data,u=t.readonly===!0,[c,d]=g.useState(s===""||r),h=g.useCallback(()=>{d(m=>!m)},[]),f=s?"gdg-ml-6":"";return c?g.createElement(Fu,{targetWidth:o.width-20},g.createElement(Kr,{autoFocus:!0,highlight:!1,validatedSelection:l,value:s,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),g.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${f}`,onClick:()=>a(t)},g.createElement(Kg,null))):g.createElement(Fu,{targetWidth:o.width},g.createElement(Sm,{contents:s,createNode:i}),!u&&g.createElement(g.Fragment,null,g.createElement("div",{className:"spacer"}),g.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${f}`,onClick:h},g.createElement($s,null))),g.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},xv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ne.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:fo,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:a,validatedSelection:l}=e;return g.createElement(Sv,{onFinish:i,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},kv={getAccessibilityString:e=>e.row.toString(),kind:Yn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Mv,measure:()=>44,draw:e=>Ev(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:a}=t,l=n.drawHandle?7+(o-7)/2:o/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Mv(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=Rv,n.textAlign="center",o}function Rv(e){const{ctx:t}=e;t.textAlign="start"}function Ev(e,t,n,r,i,o){const{ctx:a,rect:l,hoverAmount:s,theme:u}=e,{x:c,y:d,width:h,height:f}=l,m=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?s:1);if(Gs(a,u,n,i?c+p:c,d,i?h-p:h,f,!0,void 0,void 0,18,"center",o),i){a.globalAlpha=s,a.beginPath();for(const v of[3,6])for(const w of[-5,-1,3])a.rect(c+v,d+f/2+w,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),v=u.markerFontFull,w=c+h/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=u.textLight,a.font=v,a.fillText(p,w,d+f/2+cr(a,v)),s!==0&&(a.globalAlpha=1)}}const Iv={getAccessibilityString:()=>"",kind:Yn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Tv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Tv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:a,spriteManager:l}=e,{x:s,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(s+1,u+1,c,d-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const h=t!=="";let f=0;if(n!==void 0){const p=d-8,v=s+8/2,w=u+8/2;l.drawSprite(n,"normal",r,v,w,p,a,h?1:o),f=p}else{f=24;const m=12,p=h?m:o*m,v=h?0:(1-o)*m*.5,w=a.cellHorizontalPadding+4;p>0&&(r.moveTo(s+w+v,u+d/2),r.lineTo(s+w+v+p,u+d/2),r.moveTo(s+w+v+p*.5,u+d/2-p*.5),r.lineTo(s+w+v+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,f+s+a.cellHorizontalPadding+.5,u+d/2+cr(r,a)),r.beginPath()}function $d(e,t,n,r,i,o,a){e.textBaseline="alphabetic";const l=Dv(e,i,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),ur(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??Xr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function Dv(e,t,n,r,i){const o=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const l=Jr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,u=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:l.width+o*3,height:u-1}}const Ov=g.lazy(async()=>await Ls(()=>import("./number-overlay-editor.DSy8B0d4.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),Pv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ne.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:fo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:u}=n;l===!0&&t>0&&$d(r,i,u,s,o,t,a),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 g.createElement(g.Suspense,{fallback:null},g.createElement(Ov,{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}}},_v={getAccessibilityString:()=>"",measure:()=>108,kind:ne.Protected,needsHover:!1,needsHoverPosition:!1,draw:Lv,onPaste:()=>{}};function Lv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:a}=r;t.beginPath();const l=2.5;let s=i+n.cellHorizontalPadding+l;const u=o+a/2,c=Math.cos(eu(30))*l,d=Math.sin(eu(30))*l;for(let h=0;h<12;h++)t.moveTo(s,u-l),t.lineTo(s,u+l),t.moveTo(s+c,u-d),t.lineTo(s-c,u+d),t.moveTo(s-c,u-d),t.lineTo(s+c,u+d),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Fv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ne.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>fo(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 oe.createElement(Kr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Av={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ne.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:fo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:h}=t;c===!0&&n>0&&$d(i,a,h,s,o,n,l),lr(e,s,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.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:a,validatedSelection:l}=e;return g.createElement(Sv,{onFinish:i,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},kv={getAccessibilityString:e=>e.row.toString(),kind:Yn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Mv,measure:()=>44,draw:e=>Ev(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:a}=t,l=n.drawHandle?7+(o-7)/2:o/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Mv(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=Rv,n.textAlign="center",o}function Rv(e){const{ctx:t}=e;t.textAlign="start"}function Ev(e,t,n,r,i,o){const{ctx:a,rect:l,hoverAmount:s,theme:u}=e,{x:c,y:d,width:h,height:f}=l,m=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?s:1);if(Gs(a,u,n,i?c+p:c,d,i?h-p:h,f,!0,void 0,void 0,18,"center",o),i){a.globalAlpha=s,a.beginPath();for(const v of[3,6])for(const w of[-5,-1,3])a.rect(c+v,d+f/2+w,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),v=u.markerFontFull,w=c+h/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=u.textLight,a.font=v,a.fillText(p,w,d+f/2+cr(a,v)),s!==0&&(a.globalAlpha=1)}}const Iv={getAccessibilityString:()=>"",kind:Yn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Tv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Tv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:a,spriteManager:l}=e,{x:s,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(s+1,u+1,c,d-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const h=t!=="";let f=0;if(n!==void 0){const p=d-8,v=s+8/2,w=u+8/2;l.drawSprite(n,"normal",r,v,w,p,a,h?1:o),f=p}else{f=24;const m=12,p=h?m:o*m,v=h?0:(1-o)*m*.5,w=a.cellHorizontalPadding+4;p>0&&(r.moveTo(s+w+v,u+d/2),r.lineTo(s+w+v+p,u+d/2),r.moveTo(s+w+v+p*.5,u+d/2-p*.5),r.lineTo(s+w+v+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,f+s+a.cellHorizontalPadding+.5,u+d/2+cr(r,a)),r.beginPath()}function $d(e,t,n,r,i,o,a){e.textBaseline="alphabetic";const l=Dv(e,i,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),ur(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??Xr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function Dv(e,t,n,r,i){const o=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const l=Jr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,u=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:l.width+o*3,height:u-1}}const Ov=g.lazy(async()=>await Ls(()=>import("./number-overlay-editor.DF3YMcvz.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),Pv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ne.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:fo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:u}=n;l===!0&&t>0&&$d(r,i,u,s,o,t,a),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 g.createElement(g.Suspense,{fallback:null},g.createElement(Ov,{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}}},_v={getAccessibilityString:()=>"",measure:()=>108,kind:ne.Protected,needsHover:!1,needsHoverPosition:!1,draw:Lv,onPaste:()=>{}};function Lv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:a}=r;t.beginPath();const l=2.5;let s=i+n.cellHorizontalPadding+l;const u=o+a/2,c=Math.cos(eu(30))*l,d=Math.sin(eu(30))*l;for(let h=0;h<12;h++)t.moveTo(s,u-l),t.lineTo(s,u+l),t.moveTo(s+c,u-d),t.lineTo(s-c,u+d),t.moveTo(s-c,u-d),t.lineTo(s+c,u+d),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Fv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ne.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>fo(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 oe.createElement(Kr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Av={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ne.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:fo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:h}=t;c===!0&&n>0&&$d(i,a,h,s,o,n,l),lr(e,s,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
176
176
  `,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return g.createElement(Kr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:a=>r({...i,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Hv=gn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),zv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:a}=e,[l,s]=g.useState(!i&&(t===""||r)),u=g.useCallback(()=>{s(!0)},[]);return l?g.createElement(Kr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):g.createElement(Hv,null,g.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!i&&g.createElement("div",{className:"gdg-edit-icon",onClick:u},g.createElement($s,null)),g.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Nd(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,l=e.actualBoundingBoxAscent;return r==="right"?i=t.width-a-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-a/2),{x:i,y:o,width:a,height:l}}function Au(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const l=md(a,o.baseFontFull);if(l===void 0)return!1;const s=Nd(l,n,o,t.contentAlign);return Yr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,i)}const Vv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ne.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:fo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:a,ctx:l}=e,s=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Jr(s,l,n.baseFontFull),d=Nd(c,a,n,t.contentAlign),{x:h,y:f,width:m,height:p}=d;if(i>=h-4&&i<=h-4+m+8&&o>=f-4&&o<=f-4+p+8){const v=cr(l,n.baseFontFull);r("pointer");const w=5,b=f-v;l.beginPath(),l.moveTo(a.x+h,Math.floor(a.y+b+p+w)+.5),l.lineTo(a.x+h+m,Math.floor(a.y+b+p+w)+.5),l.strokeStyle=n.linkColor,l.stroke(),l.save(),l.fillStyle=e.cellFillColor,lr({...e,rect:{...a,x:a.x-1}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x-2}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x+1}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x+2}},s,t.contentAlign),l.restore()}}l.fillStyle=u?n.linkColor:n.textDark,lr(e,s,t.contentAlign)},onSelect:e=>{Au(e)&&e.preventDefault()},onClick:e=>{var r;const{cell:t}=e;Au(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 g.createElement(zv,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:a=>n({...r,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},$v=[kv,Iv,iv,lv,hv,vv,yv,xv,Pv,_v,Fv,Av,Vv];var ds,Hu;function Nv(){if(Hu)return ds;Hu=1;var e=Zc(),t=Ic(),n="Expected a function";function r(i,o,a){var l=!0,s=!0;if(typeof i!="function")throw new TypeError(n);return t(a)&&(l="leading"in a?!!a.leading:l,s="trailing"in a?!!a.trailing:s),e(i,o,{leading:l,maxWait:o,trailing:s})}return ds=r,ds}var Bv=Nv();const Wv=wr(Bv),fs=[];class Uv extends wd{constructor(){super(...arguments);dt(this,"imageLoaded",()=>{});dt(this,"loadedLocations",[]);dt(this,"cache",{});dt(this,"sendLoaded",Wv(()=>{this.imageLoaded(new to(this.loadedLocations)),this.loadedLocations=[]},20));dt(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const i=this.cache[r];let o=!1;for(let a=0;a<i.cells.length;a++){const l=i.cells[a];if(this.isInWindow(l)){o=!0;break}}o?i.cells=i.cells.filter(this.isInWindow):(i.cancel(),delete this.cache[r])}})}setCallback(n){this.imageLoaded=n}loadImage(n,r,i,o){let a=!1;const l=fs.pop()??new Image;let s=!1;const u={img:void 0,cells:[er(r,i)],url:n,cancel:()=>{s||(s=!0,fs.length<12?fs.unshift(l):a||(l.src=""))}},c=new Promise(d=>l.addEventListener("load",()=>d(null)));requestAnimationFrame(async()=>{try{l.src=n,await c,await l.decode();const d=this.cache[o];if(d!==void 0&&!s){d.img=l;for(const h of d.cells)this.loadedLocations.push(Xs(h));a=!0,this.sendLoaded()}}catch{u.cancel()}}),this.cache[o]=u}loadOrGetImage(n,r,i){const o=n,a=this.cache[o];if(a!==void 0){const l=er(r,i);return a.cells.includes(l)||a.cells.push(l),a.img}else this.loadImage(n,r,i,o)}}const qv=(e,t)=>{const n=g.useMemo(()=>({...Fp,...e.headerIcons}),[e.headerIcons]),r=g.useMemo(()=>e.imageWindowLoader??new Uv,[e.imageWindowLoader]);return g.createElement(rv,{...e,renderers:$v,headerIcons:n,ref:t,imageWindowLoader:r})},Yv=g.forwardRef(qv);function zu(e,t){const n=g.useRef(null),r=g.useRef(),i=g.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return g.useEffect(()=>i,[i]),{debouncedCallback:g.useCallback((...a)=>{r.current=a,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}const Bd=yi("div",{target:"ee4nolw0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Or=yi("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}}})),Xv=yi("div",{target:"ee4nolw2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),Vu=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],Gv={number:Vu,progress:Vu,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 jv({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:a}){const l=Gr(),{colors:s,fontSizes:u,radii:c,fontWeights:d}=l,h=Gv[e]||[];return h.length===0?lt(Oc,{}):lt(Sa,{triggerType:Pc.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:lt(Bd,{role:"menu",children:h.map(f=>Fn(Or,{onClick:()=>{i(f.format),o()},role:"menuitem",children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:f.icon}),f.label]},f.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:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:Ca(l)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:a})}const Kv=g.memo(jv);function Zv({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:a,onHideColumn:l,columnKind:s,onChangeFormat:u,onAutosize:c}){const d=Gr(),[h,f]=g.useState(!1),{colors:m,fontSizes:p,radii:v,fontWeights:w}=d;g.useEffect(()=>{function M(O){O.preventDefault()}return document.addEventListener("wheel",M,{passive:!1}),document.addEventListener("touchmove",M,{passive:!1}),()=>{document.removeEventListener("wheel",M),document.removeEventListener("touchmove",M)}},[]);const b=oe.useCallback(()=>{o()},[o]);return lt(Sa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:Fn(Bd,{children:[a&&Fn(Oc,{children:[Fn(Or,{onClick:()=>{a("asc"),b()},role:"menuitem",children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),Fn(Or,{onClick:()=>{a("desc"),b()},role:"menuitem",children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),lt(Xv,{})]}),u&&lt(Kv,{columnKind:s,isOpen:h,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onChangeFormat:u,onCloseMenu:b,children:Fn(Or,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),isActive:h,hasSubmenu:!0,children:[Fn("div",{children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&Fn(Or,{onClick:()=>{c(),b()},children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&Fn(Or,{onClick:()=>{i(),b()},children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&Fn(Or,{onClick:()=>{r(),b()},children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),l&&Fn(Or,{onClick:()=>{l(),b()},children:[lt(gr,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:ya.bottomRight,accessibilityType:_c.menu,showArrow:!1,popoverMargin:Wn("0.375rem"),onClickOutside:h?void 0:b,onEsc:b,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:Ca(d)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:p.sm,fontWeight:w.normal,borderTopLeftRadius:v.default,borderTopRightRadius:v.default,borderBottomLeftRadius:v.default,borderBottomRightRadius:v.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:lt("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const Jv=g.memo(Zv),Qv="(index)",e1=({label:e,initialValue:t,onChange:n})=>{const r=Gr();return lt(gg,{checked:t,onChange:i=>{n(i.target.checked)},"aria-label":e,checkmarkType:hg.default,labelPlacement:fg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:r.spacing.none,marginTop:r.spacing.none,paddingLeft:r.spacing.md,paddingRight:r.spacing.md,paddingTop:r.spacing.twoXS,paddingBottom:r.spacing.twoXS,backgroundColor:i?r.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:o})=>{const a=o?r.colors.primary:r.colors.fadedText40;return{outline:0,width:r.sizes.checkbox,height:r.sizes.checkbox,marginTop:r.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&o?`0 0 0 0.2rem ${Zo(r.colors.primary,.5)}`:"",borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth,borderLeftColor:a,borderRightColor:a,borderTopColor:a,borderBottomColor:a}}},Label:{style:{lineHeight:r.lineHeights.small,paddingLeft:r.spacing.sm,position:"relative",color:r.colors.bodyText,fontSize:r.fontSizes.sm,fontWeight:r.fontWeights.normal}}},children:e})},t1=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:a,onClose:l})=>{const s=Gr();return lt(Sa,{triggerType:Pc.click,placement:ya.bottomRight,autoFocus:!0,focusLock:!0,content:()=>lt("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm},children:e.map(u=>{const c=t.length&&!u.isIndex?!t.includes(u.id)&&!t.includes(u.name):!1;return lt(e1,{label:!u.title&&u.isIndex?Qv:u.title,initialValue:!(u.isHidden===!0||c),onChange:d=>{d?(i(u.id),c&&n(h=>[...h,u.id])):r(u.id)}},u.id)})}),isOpen:a,onClickOutside:l,onClick:()=>a?l():void 0,onEsc:l,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:s.radii.default,borderTopRightRadius:s.radii.default,borderBottomLeftRadius:s.radii.default,borderBottomRightRadius:s.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:Ca(s)?s.colors.bgColor:s.colors.secondaryBg,color:s.colors.bodyText,fontSize:s.fontSizes.sm,fontWeight:s.fontWeights.normal,minWidth:s.sizes.minMenuWidth,maxWidth:`calc(${s.sizes.minMenuWidth} * 2)`,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:lt("div",{children:o})})},n1=g.memo(t1);var r1=xh();const i1=wr(r1);var ea={exports:{}};/*! Moment Duration Format v2.2.2
177
177
  * https://github.com/jsmreese/moment-duration-format
178
178
  * Date: 2018-02-16
@@ -193,5 +193,5 @@ Error: ${o}`}const r={kind:ne.Text,data:"",displayData:"",allowOverlay:!0,conten
193
193
  40% { opacity: 1; }
194
194
  `]))),iw=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,a=o.colors,l=o.spacing.baseUnit;return Ye({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?a.neutral60:a.neutral20,padding:l*2})},gs=function(t){var n=t.delay,r=t.offset;return Be("span",{css:$c({animation:"".concat(rw," 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"},"","")})},ow=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,a=yr(t,jb);return Be("div",Ke({},en(Ye(Ye({},a),{},{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}))},aw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,a=o.colors,l=o.borderRadius,s=o.spacing;return Ye({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},sw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,a=t.innerProps,l=t.menuIsOpen;return Be("div",Ke({ref:o},en(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":l}),a,{"aria-disabled":r||void 0}),n)},lw=sw,uw=["data"],cw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},dw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,a=t.Heading,l=t.headingProps,s=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Be("div",Ke({},en(t,"group",{group:!0}),s),Be(a,Ke({},l,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Be("div",null,n))},fw=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"})},hw=function(t){var n=uf(t);n.data;var r=yr(n,uw);return Be("div",Ke({},en(t,"groupHeading",{"group-heading":!0}),r))},gw=dw,mw=["innerRef","isDisabled","isHidden","inputClassName"],pw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,a=o.spacing,l=o.colors;return Ye(Ye({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},vw),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:l.neutral80})},bf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},vw={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"},bf)},bw=function(t){return Ye({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},bf)},ww=function(t){var n=t.cx,r=t.value,i=uf(t),o=i.innerRef,a=i.isDisabled,l=i.isHidden,s=i.inputClassName,u=yr(i,mw);return Be("div",Ke({},en(t,"input",{"input-container":!0}),{"data-value":r||""}),Be("input",Ke({className:n({input:!0},s),ref:o,style:bw(l),disabled:a},u)))},yw=ww,Cw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return Ye({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},Sw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,a=t.cropWithEllipsis;return Ye({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},xw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors,l=t.isFocused;return Ye({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:l?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},wf=function(t){var n=t.children,r=t.innerProps;return Be("div",r,n)},kw=wf,Mw=wf;function Rw(e){var t=e.children,n=e.innerProps;return Be("div",Ke({role:"button"},n),t||Be(dl,{size:14}))}var Ew=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,a=t.isDisabled,l=t.removeProps,s=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Be(u,{data:i,innerProps:Ye(Ye({},en(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:s},Be(c,{data:i,innerProps:Ye({},en(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),Be(d,{data:i,innerProps:Ye(Ye({},en(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:s}))},Iw=Ew,Tw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.theme,l=a.spacing,s=a.colors;return Ye({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?s.primary:i?s.primary25:"transparent",color:r?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?s.primary:s.primary50}})},Dw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.innerRef,l=t.innerProps;return Be("div",Ke({},en(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},l),n)},Ow=Dw,Pw=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})},_w=function(t){var n=t.children,r=t.innerProps;return Be("div",Ke({},en(t,"placeholder",{placeholder:!0}),r),n)},Lw=_w,Fw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,a=i.colors;return Ye({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Aw=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Be("div",Ke({},en(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Hw=Aw,yf={ClearIndicator:ew,Control:lw,DropdownIndicator:Jb,DownChevron:pf,CrossIcon:dl,Group:gw,GroupHeading:hw,IndicatorsContainer:Xb,IndicatorSeparator:nw,Input:yw,LoadingIndicator:ow,Menu:_b,MenuList:Fb,MenuPortal:Nb,LoadingMessage:Vb,NoOptionsMessage:zb,MultiValue:Iw,MultiValueContainer:kw,MultiValueLabel:Mw,MultiValueRemove:Rw,Option:Ow,Placeholder:Lw,SelectContainer:Wb,SingleValue:Hw,ValueContainer:qb},zw=function(t){return Ye(Ye({},yf),t.components)},lc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Vw(e,t){return!!(e===t||lc(e)&&lc(t))}function $w(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Vw(e[n],t[n]))return!1;return!0}function Nw(e,t){t===void 0&&(t=$w);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var a=e.apply(this,i);return n={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){n=null},r}var Bw={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"},Ww=function(t){return Be("span",Ke({css:Bw},t))},uc=Ww,Uw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,a=o===void 0?"":o,l=t.selectValue,s=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,v){return p&&p.length?"".concat(p.indexOf(v)+1," of ").concat(p.length):""};if(n==="value"&&l)return"value ".concat(a," focused, ").concat(d(l,r),".");if(n==="menu"&&c){var h=s?" disabled":"",f="".concat(u?" selected":"").concat(h);return"".concat(a).concat(f,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},qw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,a=t.isFocused,l=t.selectValue,s=t.selectProps,u=t.id,c=t.isAppleDevice,d=s.ariaLiveMessages,h=s.getOptionLabel,f=s.inputValue,m=s.isMulti,p=s.isOptionDisabled,v=s.isSearchable,w=s.menuIsOpen,b=s.options,M=s.screenReaderStatus,O=s.tabSelectsValue,S=s.isLoading,R=s["aria-label"],_=s["aria-live"],E=g.useMemo(function(){return Ye(Ye({},Uw),d||{})},[d]),x=g.useMemo(function(){var k="";if(n&&E.onChange){var z=n.option,N=n.options,X=n.removedValue,ie=n.removedValues,K=n.value,G=function(P){return Array.isArray(P)?null:P},le=X||z||G(K),se=le?h(le):"",ce=N||ie||void 0,he=ce?ce.map(h):[],Q=Ye({isDisabled:le&&p(le,l),label:se,labels:he},n);k=E.onChange(Q)}return k},[n,E,p,l,h]),L=g.useMemo(function(){var k="",z=r||i,N=!!(r&&l&&l.includes(r));if(z&&E.onFocus){var X={focused:z,label:h(z),isDisabled:p(z,l),isSelected:N,options:o,context:z===r?"menu":"value",selectValue:l,isAppleDevice:c};k=E.onFocus(X)}return k},[r,i,h,p,E,o,l,c]),D=g.useMemo(function(){var k="";if(w&&b.length&&!S&&E.onFilter){var z=M({count:o.length});k=E.onFilter({inputValue:f,resultsMessage:z})}return k},[o,f,w,E,b,M,S]),C=(n==null?void 0:n.action)==="initial-input-focus",I=g.useMemo(function(){var k="";if(E.guidance){var z=i?"value":w?"menu":"input";k=E.guidance({"aria-label":R,context:z,isDisabled:r&&p(r,l),isMulti:m,isSearchable:v,tabSelectsValue:O,isInitialFocus:C})}return k},[R,r,i,m,p,v,w,E,l,O,C]),T=Be(g.Fragment,null,Be("span",{id:"aria-selection"},x),Be("span",{id:"aria-focused"},L),Be("span",{id:"aria-results"},D),Be("span",{id:"aria-guidance"},I));return Be(g.Fragment,null,Be(uc,{id:u},C&&T),Be(uc,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!C&&T))},Yw=qw,Ps=[{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źẑżžẓẕƶȥɀⱬꝣ"}],Xw=new RegExp("["+Ps.map(function(e){return e.letters}).join("")+"]","g"),Cf={};for(var ms=0;ms<Ps.length;ms++)for(var ps=Ps[ms],vs=0;vs<ps.letters.length;vs++)Cf[ps.letters[vs]]=ps.base;var Sf=function(t){return t.replace(Xw,function(n){return Cf[n]})},Gw=Nw(Sf),cc=function(t){return t.replace(/^\s+|\s+$/g,"")},jw=function(t){return"".concat(t.label," ").concat(t.value)},Kw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Ye({ignoreCase:!0,ignoreAccents:!0,stringify:jw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,a=i.ignoreAccents,l=i.stringify,s=i.trim,u=i.matchFrom,c=s?cc(r):r,d=s?cc(l(n)):l(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),a&&(c=Gw(c),d=Sf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},Zw=["innerRef"];function Jw(e){var t=e.innerRef,n=yr(e,Zw),r=Mb(n,"onExited","in","enter","exit","appear");return Be("input",Ke({ref:t},r,{css:$c({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 Qw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function ey(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,a=g.useRef(!1),l=g.useRef(!1),s=g.useRef(0),u=g.useRef(null),c=g.useCallback(function(v,w){if(u.current!==null){var b=u.current,M=b.scrollTop,O=b.scrollHeight,S=b.clientHeight,R=u.current,_=w>0,E=O-S-M,x=!1;E>w&&a.current&&(r&&r(v),a.current=!1),_&&l.current&&(o&&o(v),l.current=!1),_&&w>E?(n&&!a.current&&n(v),R.scrollTop=O,x=!0,a.current=!0):!_&&-w>M&&(i&&!l.current&&i(v),R.scrollTop=0,x=!0,l.current=!0),x&&Qw(v)}},[n,r,i,o]),d=g.useCallback(function(v){c(v,v.deltaY)},[c]),h=g.useCallback(function(v){s.current=v.changedTouches[0].clientY},[]),f=g.useCallback(function(v){var w=s.current-v.changedTouches[0].clientY;c(v,w)},[c]),m=g.useCallback(function(v){if(v){var w=Sb?{passive:!1}:!1;v.addEventListener("wheel",d,w),v.addEventListener("touchstart",h,w),v.addEventListener("touchmove",f,w)}},[f,h,d]),p=g.useCallback(function(v){v&&(v.removeEventListener("wheel",d,!1),v.removeEventListener("touchstart",h,!1),v.removeEventListener("touchmove",f,!1))},[f,h,d]);return g.useEffect(function(){if(t){var v=u.current;return m(v),function(){p(v)}}},[t,m,p]),function(v){u.current=v}}var dc=["boxSizing","height","overflow","paddingRight","position"],fc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function hc(e){e.preventDefault()}function gc(e){e.stopPropagation()}function mc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function pc(){return"ontouchstart"in window||navigator.maxTouchPoints}var vc=!!(typeof window<"u"&&window.document&&window.document.createElement),Xi=0,di={capture:!1,passive:!1};function ty(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=g.useRef({}),o=g.useRef(null),a=g.useCallback(function(s){if(vc){var u=document.body,c=u&&u.style;if(r&&dc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&Xi<1){var d=parseInt(i.current.paddingRight,10)||0,h=document.body?document.body.clientWidth:0,f=window.innerWidth-h+d||0;Object.keys(fc).forEach(function(m){var p=fc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(f,"px"))}u&&pc()&&(u.addEventListener("touchmove",hc,di),s&&(s.addEventListener("touchstart",mc,di),s.addEventListener("touchmove",gc,di))),Xi+=1}},[r]),l=g.useCallback(function(s){if(vc){var u=document.body,c=u&&u.style;Xi=Math.max(Xi-1,0),r&&Xi<1&&dc.forEach(function(d){var h=i.current[d];c&&(c[d]=h)}),u&&pc()&&(u.removeEventListener("touchmove",hc,di),s&&(s.removeEventListener("touchstart",mc,di),s.removeEventListener("touchmove",gc,di)))}},[r]);return g.useEffect(function(){if(t){var s=o.current;return a(s),function(){l(s)}}},[t,a,l]),function(s){o.current=s}}var ny=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},ry={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function iy(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,s=e.onTopLeave,u=ey({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:l,onTopLeave:s}),c=ty({isEnabled:n}),d=function(f){u(f),c(f)};return Be(g.Fragment,null,n&&Be("div",{onClick:ny,css:ry}),t(d))}var oy={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},ay=function(t){var n=t.name,r=t.onFocus;return Be("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:oy,value:"",onChange:function(){}})},sy=ay;function fl(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 ly(){return fl(/^iPhone/i)}function xf(){return fl(/^Mac/i)}function uy(){return fl(/^iPad/i)||xf()&&navigator.maxTouchPoints>1}function cy(){return ly()||uy()}function dy(){return xf()||cy()}var fy=function(t){return t.label},hy=function(t){return t.label},gy=function(t){return t.value},my=function(t){return!!t.isDisabled},py={clearIndicator:Qb,container:Bb,control:aw,dropdownIndicator:Zb,group:cw,groupHeading:fw,indicatorsContainer:Yb,indicatorSeparator:tw,input:pw,loadingIndicator:iw,loadingMessage:Hb,menu:Db,menuList:Lb,menuPortal:$b,multiValue:Cw,multiValueLabel:Sw,multiValueRemove:xw,noOptionsMessage:Ab,option:Tw,placeholder:Pw,singleValue:Fw,valueContainer:Ub},vy={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%)"},by=4,kf=4,wy=38,yy=kf*2,Cy={baseUnit:kf,controlHeight:wy,menuGutter:yy},bs={borderRadius:by,colors:vy,spacing:Cy},Sy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ac(),captureMenuScroll:!ac(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Kw(),formatGroupLabel:fy,getOptionLabel:hy,getOptionValue:gy,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:my,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!yb(),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 bc(e,t,n,r){var i=Ef(e,t,n),o=If(e,t,n),a=Rf(e,t),l=wa(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:a,value:l,index:r}}function na(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(a,l){return bc(e,a,t,l)}).filter(function(a){return yc(e,a)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=bc(e,n,t,r);return yc(e,o)?o:void 0}).filter(xb)}function Mf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,As(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function wc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,As(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 xy(e,t){return Mf(na(e,t))}function yc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,a=t.label,l=t.value;return(!Df(e)||!o)&&Tf(e,{label:a,value:l,data:i},r)}function ky(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 My(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},Rf=function(t,n){return t.getOptionLabel(n)},wa=function(t,n){return t.getOptionValue(n)};function Ef(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function If(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 Tf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Df=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Ry=1,Of=function(e){wg(n,e);var t=Sg(n);function n(r){var i;if(Cg(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=dy(),i.controlRef=null,i.getControlRef=function(s){i.controlRef=s},i.focusedOptionRef=null,i.getFocusedOptionRef=function(s){i.focusedOptionRef=s},i.menuListRef=null,i.getMenuListRef=function(s){i.menuListRef=s},i.inputRef=null,i.getInputRef=function(s){i.inputRef=s},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(s,u){var c=i.props,d=c.onChange,h=c.name;u.name=h,i.ariaOnChange(s,u),d(s,u)},i.setValue=function(s,u,c){var d=i.props,h=d.closeMenuOnSelect,f=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),h&&(i.setState({inputIsHiddenAfterUpdate:!f}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(s,{action:u,option:c})},i.selectOption=function(s){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,h=u.name,f=i.state.selectValue,m=d&&i.isOptionSelected(s,f),p=i.isOptionDisabled(s,f);if(m){var v=i.getOptionValue(s);i.setValue(f.filter(function(w){return i.getOptionValue(w)!==v}),"deselect-option",s)}else if(!p)d?i.setValue([].concat(As(f),[s]),"select-option",s):i.setValue(s,"select-option");else{i.ariaOnChange(s,{action:"select-option",option:s,name:h});return}c&&i.blurInput()},i.removeValue=function(s){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(s),h=c.filter(function(m){return i.getOptionValue(m)!==d}),f=Ko(u,h,h[0]||null);i.onChange(f,{action:"remove-value",removedValue:s}),i.focusInput()},i.clearValue=function(){var s=i.state.selectValue;i.onChange(Ko(i.props.isMulti,[],null),{action:"clear",removedValues:s})},i.popValue=function(){var s=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),h=Ko(s,d,d[0]||null);c&&i.onChange(h,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(s){return ws(i.state.focusableOptionsWithIds,s)},i.getFocusableOptionsWithIds=function(){return wc(na(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return mb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(s){return Rf(i.props,s)},i.getOptionValue=function(s){return wa(i.props,s)},i.getStyles=function(s,u){var c=i.props.unstyled,d=py[s](u,c);d.boxSizing="border-box";var h=i.props.styles[s];return h?h(d,u):d},i.getClassNames=function(s,u){var c,d;return(c=(d=i.props.classNames)[s])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(s){return"".concat(i.state.instancePrefix,"-").concat(s)},i.getComponents=function(){return zw(i.props)},i.buildCategorizedOptions=function(){return na(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return Mf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(s,u){i.setState({ariaSelection:Ye({value:s},u)})},i.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(s){i.blockOptionHover=!1},i.onControlMouseDown=function(s){if(!s.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},i.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),s.preventDefault()}},i.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(i.clearValue(),s.preventDefault(),i.openAfterFocus=!1,s.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(s){typeof i.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&Ra(s.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(s)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(s){var u=s.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(s){var u=s.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),h=Math.abs(c.clientY-i.initialTouchY),f=5;i.userIsDragging=d>f||h>f}},i.onTouchEnd=function(s){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(s.target)&&i.menuListRef&&!i.menuListRef.contains(s.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(s){i.userIsDragging||i.onControlMouseDown(s)},i.onClearIndicatorTouchEnd=function(s){i.userIsDragging||i.onClearIndicatorMouseDown(s)},i.onDropdownIndicatorTouchEnd=function(s){i.userIsDragging||i.onDropdownIndicatorMouseDown(s)},i.handleInputChange=function(s){var u=i.props.inputValue,c=s.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(s){i.props.onFocus&&i.props.onFocus(s),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(s){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(s),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(s){if(!(i.blockOptionHover||i.state.focusedOption===s)){var u=i.getFocusableOptions(),c=u.indexOf(s);i.setState({focusedOption:s,focusedOptionId:c>-1?i.getFocusedOptionId(s):null})}},i.shouldHideSelectedOptions=function(){return Df(i.props)},i.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),i.focus()},i.onKeyDown=function(s){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,h=u.escapeClearsValue,f=u.inputValue,m=u.isClearable,p=u.isDisabled,v=u.menuIsOpen,w=u.onKeyDown,b=u.tabSelectsValue,M=u.openMenuOnFocus,O=i.state,S=O.focusedOption,R=O.focusedValue,_=O.selectValue;if(!p&&!(typeof w=="function"&&(w(s),s.defaultPrevented))){switch(i.blockOptionHover=!0,s.key){case"ArrowLeft":if(!c||f)return;i.focusValue("previous");break;case"ArrowRight":if(!c||f)return;i.focusValue("next");break;case"Delete":case"Backspace":if(f)return;if(R)i.removeValue(R);else{if(!d)return;c?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||s.shiftKey||!v||!b||!S||M&&i.isOptionSelected(S,_))return;i.selectOption(S);break;case"Enter":if(s.keyCode===229)break;if(v){if(!S||i.isComposing)return;i.selectOption(S);break}return;case"Escape":v?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:f}),i.onMenuClose()):m&&h&&i.clearValue();break;case" ":if(f)return;if(!v){i.openMenu("first");break}if(!S)return;i.selectOption(S);break;case"ArrowUp":v?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":v?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!v)return;i.focusOption("pageup");break;case"PageDown":if(!v)return;i.focusOption("pagedown");break;case"Home":if(!v)return;i.focusOption("first");break;case"End":if(!v)return;i.focusOption("last");break;default:return}s.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++Ry),i.state.selectValue=ic(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),l=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[l],i.state.focusedOptionId=ws(o,a[l])}return i}return yg(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&oc(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,l=o.menuIsOpen,s=this.state.isFocused;(s&&!a&&i.isDisabled||s&&l&&!i.menuIsOpen)&&this.focusInput(),s&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(oc(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,a=this.state,l=a.selectValue,s=a.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(l[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(s&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,a=o.selectValue,l=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=a.indexOf(l);l||(s=-1);var u=a.length-1,c=-1;if(a.length){switch(i){case"previous":s===0?c=0:s===-1?c=u:c=s-1;break;case"next":s>-1&&s<u&&(c=s+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:a[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var s=0,u=l.indexOf(a);a||(u=-1),i==="up"?s=u>0?u-1:l.length-1:i==="down"?s=(u+1)%l.length:i==="pageup"?(s=u-o,s<0&&(s=0)):i==="pagedown"?(s=u+o,s>l.length-1&&(s=l.length-1)):i==="last"&&(s=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[s],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[s])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(bs):Ye(Ye({},bs),this.props.theme):bs}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,l=this.getClassNames,s=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,h=d.isMulti,f=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:l,getValue:s,hasValue:p,isMulti:h,isRtl:f,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,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return Ef(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return If(this.props,i,o)}},{key:"filterOption",value:function(i,o){return Tf(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:l})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,a=i.isSearchable,l=i.inputId,s=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,h=i.required,f=this.getComponents(),m=f.Input,p=this.state,v=p.inputIsHidden,w=p.ariaSelection,b=this.commonProps,M=l||this.getElementId("input"),O=Ye(Ye(Ye({"aria-autocomplete":"list","aria-expanded":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":h,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(w==null?void 0:w.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?g.createElement(m,Ke({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:M,innerRef:this.getInputRef,isDisabled:o,isHidden:v,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:s},O)):g.createElement(Jw,Ke({id:M,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(),a=o.MultiValue,l=o.MultiValueContainer,s=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,h=this.commonProps,f=this.props,m=f.controlShouldRenderValue,p=f.isDisabled,v=f.isMulti,w=f.inputValue,b=f.placeholder,M=this.state,O=M.selectValue,S=M.focusedValue,R=M.isFocused;if(!this.hasValue()||!m)return w?null:g.createElement(d,Ke({},h,{key:"placeholder",isDisabled:p,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),b);if(v)return O.map(function(E,x){var L=E===S,D="".concat(i.getOptionLabel(E),"-").concat(i.getOptionValue(E));return g.createElement(a,Ke({},h,{components:{Container:l,Label:s,Remove:u},isFocused:L,isDisabled:p,key:D,index:x,removeProps:{onClick:function(){return i.removeValue(E)},onTouchEnd:function(){return i.removeValue(E)},onMouseDown:function(I){I.preventDefault()}},data:E}),i.formatOptionLabel(E,"value"))});if(w)return null;var _=O[0];return g.createElement(c,Ke({},h,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,l=this.props,s=l.isDisabled,u=l.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||s||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(o,Ke({},a,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,l=this.props,s=l.isDisabled,u=l.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return g.createElement(o,Ke({},a,{innerProps:d,isDisabled:s,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var l=this.commonProps,s=this.props.isDisabled,u=this.state.isFocused;return g.createElement(a,Ke({},l,{isDisabled:s,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(o,Ke({},a,{innerProps:u,isDisabled:l,isFocused:s}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,l=o.GroupHeading,s=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,h=o.NoOptionsMessage,f=o.Option,m=this.commonProps,p=this.state.focusedOption,v=this.props,w=v.captureMenuScroll,b=v.inputValue,M=v.isLoading,O=v.loadingMessage,S=v.minMenuHeight,R=v.maxMenuHeight,_=v.menuIsOpen,E=v.menuPlacement,x=v.menuPosition,L=v.menuPortalTarget,D=v.menuShouldBlockScroll,C=v.menuShouldScrollIntoView,I=v.noOptionsMessage,T=v.onMenuScrollToTop,k=v.onMenuScrollToBottom;if(!_)return null;var z=function(se,ce){var he=se.type,Q=se.data,H=se.isDisabled,P=se.isSelected,W=se.label,de=se.value,Oe=p===Q,Ve=H?void 0:function(){return i.onOptionHover(Q)},Ce=H?void 0:function(){return i.selectOption(Q)},Ee="".concat(i.getElementId("option"),"-").concat(ce),xe={id:Ee,onClick:Ce,onMouseMove:Ve,onMouseOver:Ve,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return g.createElement(f,Ke({},m,{innerProps:xe,data:Q,isDisabled:H,isSelected:P,key:Ee,label:W,type:he,value:de,isFocused:Oe,innerRef:Oe?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(se.data,"menu"))},N;if(this.hasOptions())N=this.getCategorizedOptions().map(function(le){if(le.type==="group"){var se=le.data,ce=le.options,he=le.index,Q="".concat(i.getElementId("group"),"-").concat(he),H="".concat(Q,"-heading");return g.createElement(a,Ke({},m,{key:Q,data:se,options:ce,Heading:l,headingProps:{id:H,data:le.data},label:i.formatGroupLabel(le.data)}),le.options.map(function(P){return z(P,"".concat(he,"-").concat(P.index))}))}else if(le.type==="option")return z(le,"".concat(le.index))});else if(M){var X=O({inputValue:b});if(X===null)return null;N=g.createElement(d,m,X)}else{var ie=I({inputValue:b});if(ie===null)return null;N=g.createElement(h,m,ie)}var K={minMenuHeight:S,maxMenuHeight:R,menuPlacement:E,menuPosition:x,menuShouldScrollIntoView:C},G=g.createElement(Ob,Ke({},m,K),function(le){var se=le.ref,ce=le.placerProps,he=ce.placement,Q=ce.maxHeight;return g.createElement(s,Ke({},m,K,{innerRef:se,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:M,placement:he}),g.createElement(iy,{captureEnabled:w,onTopArrive:T,onBottomArrive:k,lockEnabled:D},function(H){return g.createElement(u,Ke({},m,{innerRef:function(W){i.getMenuListRef(W),H(W)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:M,maxHeight:Q,focusedOption:p}),N)}))});return L||x==="fixed"?g.createElement(c,Ke({},m,{appendTo:L,controlElement:this.controlRef,menuPlacement:E,menuPosition:x}),G):G}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,l=o.isDisabled,s=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!l)return g.createElement(sy,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(s)if(a){var h=d.map(function(p){return i.getOptionValue(p)}).join(a);return g.createElement("input",{name:u,type:"hidden",value:h})}else{var f=d.length>0?d.map(function(p,v){return g.createElement("input",{key:"i-".concat(v),name:u,type:"hidden",value:i.getOptionValue(p)})}):g.createElement("input",{name:u,type:"hidden",value:""});return g.createElement("div",null,f)}else{var m=d[0]?this.getOptionValue(d[0]):"";return g.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,l=o.focusedOption,s=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return g.createElement(Yw,Ke({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:l,focusedValue:s,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,l=i.SelectContainer,s=i.ValueContainer,u=this.props,c=u.className,d=u.id,h=u.isDisabled,f=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return g.createElement(l,Ke({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:m}),this.renderLiveRegion(),g.createElement(o,Ke({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:m,menuIsOpen:f}),g.createElement(s,Ke({},p,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),g.createElement(a,Ke({},p,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,l=o.clearFocusValueOnUpdate,s=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,h=o.instancePrefix,f=i.options,m=i.value,p=i.menuIsOpen,v=i.inputValue,w=i.isMulti,b=ic(m),M={};if(a&&(m!==a.value||f!==a.options||p!==a.menuIsOpen||v!==a.inputValue)){var O=p?xy(i,b):[],S=p?wc(na(i,b),"".concat(h,"-option")):[],R=l?ky(o,b):null,_=My(o,O),E=ws(S,_);M={selectValue:b,focusedOption:_,focusedOptionId:E,focusableOptionsWithIds:S,focusedValue:R,clearFocusValueOnUpdate:!1}}var x=s!=null&&i!==a?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},L=u,D=c&&d;return c&&!D&&(L={value:Ko(w,b,b[0]||null),options:b,action:"initial-input-focus"},D=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(L=null),Ye(Ye(Ye({},M),x),{},{prevProps:i,ariaSelection:L,prevWasFocused:D})}}]),n}(g.Component);Of.defaultProps=Sy;var Ey=g.forwardRef(function(e,t){var n=J1(e);return g.createElement(Of,Ke({ref:t},n))}),Iy=Ey;const Ty=e=>{const{Menu:t}=yf,{children:n,...r}=e;return g.createElement(t,{...r},n)},Dy=gn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Oy=gn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Py=gn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),_y=e=>{const{value:t,onFinishedEditing:n,initialValue:r}=e,{allowedValues:i,value:o}=t.data,[a,l]=g.useState(o),[s,u]=g.useState(r??""),c=Gm(),d=g.useMemo(()=>i.map(h=>typeof h=="string"||h===null||h===void 0?{value:h,label:(h==null?void 0:h.toString())??""}:h),[i]);return t.readonly?g.createElement(Py,null,g.createElement(Kr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):g.createElement(Dy,null,g.createElement(Iy,{className:"glide-select",inputValue:s,onInputChange:u,menuPlacement:"auto",value:d.find(h=>h.value===a),styles:{control:h=>({...h,border:0,boxShadow:"none"}),option:(h,{isFocused:f})=>({...h,fontSize:c.editorFontSize,fontFamily:c.fontFamily,cursor:f?"pointer":void 0,paddingLeft:c.cellHorizontalPadding,paddingRight:c.cellHorizontalPadding,":active":{...h[":active"],color:c.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:h=>({...h,colors:{...h.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:h=>g.createElement(Oy,null,g.createElement(Ty,{className:"click-outside-ignore",...h}))},options:d,onChange:async h=>{h!==null&&(l(h.value),await new Promise(f=>window.requestAnimationFrame(f)),n({...t,data:{...t.data,value:h.value}}))}}))},Ly={kind:ne.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,a=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===o:s.value===o),l=typeof a=="string"?a:(a==null?void 0:a.label)??"";return l&&(n.fillStyle=r.textDark,n.fillText(l,i.x+r.cellHorizontalPadding,i.y+i.height/2+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:_y,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},Wr=6,Fy={marginRight:8},Ay={display:"flex",alignItems:"center",flexGrow:1},Hy={kind:ne.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:a,value:l,label:s,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,d=i.y+i.height/2,h=a-o,f=(l-o)/h;n.save();let m=0;s!==void 0&&(n.font=`12px ${r.fontFamily}`,m=Jr(u??s,n,`12px ${r.fontFamily}`).width+r.cellHorizontalPadding);const p=i.width-r.cellHorizontalPadding*2-m;if(p>=Wr){const v=n.createLinearGradient(c,d,c+p,d);v.addColorStop(0,r.accentColor),v.addColorStop(f,r.accentColor),v.addColorStop(f,r.bgBubble),v.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=v,Qu(n,c,d-Wr/2,p,Wr,Wr/2),n.fill(),n.beginPath(),Qu(n,c+.5,d-Wr/2+.5,p-1,Wr-1,(Wr-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,i.x+i.width-r.cellHorizontalPadding,d+cr(n,`12px ${r.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),a=t.step.toString(),l=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return g.createElement("label",{style:Ay},g.createElement("input",{style:Fy,type:"range",value:r,min:i,max:o,step:a,onChange:l,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},zy=gn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ys=(e,t)=>{if(t==null)return"";const n=t.toISOString();switch(e){case"date":return n.split("T")[0];case"datetime-local":return n.replace("Z","");case"time":return n.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Vy=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.min instanceof Date?ys(n,t.min):t.min,a=t.max instanceof Date?ys(n,t.max):t.max;let l=t.date;const s=t.timezoneOffset?t.timezoneOffset*60*1e3:0;s&&l&&(l=new Date(l.getTime()+s));const u=ys(n,l);return e.value.readonly?oe.createElement(Kr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):oe.createElement(zy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:u,min:o,max:a,step:i,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-s)}})}})},$y={kind:ne.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Us(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Vy}),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)}}},Ny="None";function Cc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}const By=e=>{const{cell:t,theme:n,ctx:r}=e;Us({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Ny,t.contentAlign),r.fillStyle=n.textDark};function Wy(e){const t=oe.useCallback((r,i)=>{const{cell:o,theme:a,ctx:l,rect:s}=r,u=r.col;if(vi(o))Cc(l,s,a);else if(ka(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():By(r),c.isRequired&&c.isEditable&&Cc(l,s,a);return}i()},[e]),n=oe.useMemo(()=>[K1,Ly,Hy,$y,...k1],[]);return{drawCell:t,customRenderers:n}}function Uy(){const e=Gr();return oe.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:Zo(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Zo(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.darkenedBgMix15,bgHeaderHovered:e.colors.darkenedBgMix15,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:`${Wn(e.fontSizes.sm)}px`,baseFontStyle:`${Wn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Zo(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(Wn(e.spacing.sm)),cellVerticalPadding:Math.round(Wn("0.1875rem")),bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(Wn("25rem")),minColumnWidth:Math.round(Wn("3.125rem")),maxColumnWidth:Math.round(Wn("62.5rem")),maxColumnAutoWidth:Math.round(Wn("31.25rem")),defaultRowHeight:Math.round(Wn("2.1875rem")),defaultHeaderHeight:Math.round(Wn("2.1875rem")),bgRowHovered:tg(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const qy=Fs.getLogger("useDataEditor");function Yy(e,t,n,r,i,o,a,l,s){const u=oe.useCallback(([p,v],w)=>{const b=e[p];if(!b.isEditable)return;const M=b.indexNumber,O=n.current.getOriginalRowIndex(i(v)),S=r([p,v]),R=b.getCellValue(S),_=b.getCellValue(w);if(!vi(S)&&_===R)return;const E=b.getCell(_,!0);vi(E)?qy.warn(`Not applying the cell edit since it causes this error:
195
195
  ${E.data}`):(n.current.setCell(M,O,{...E,lastUpdated:performance.now()}),l())},[e,n,i,r,l]),c=oe.useCallback(()=>{if(t)return;const p=new Map;e.forEach(v=>{p.set(v.indexNumber,v.getCell(v.defaultValue))}),n.current.addRow(p),a()},[e,n,t,a]),d=oe.useCallback(()=>{t||(c(),l())},[c,l,t]),h=oe.useCallback(p=>{var v;if(p.rows.length>0){if(t)return!0;const w=p.rows.toArray().map(b=>n.current.getOriginalRowIndex(i(b)));return n.current.deleteRows(w),a(),s(),l(),!1}if((v=p.current)!=null&&v.range){const w=[],b=p.current.range;for(let M=b.y;M<b.y+b.height;M++)for(let O=b.x;O<b.x+b.width;O++){const S=e[O];S.isEditable&&!S.isRequired&&(w.push({cell:[O,M]}),u([O,M],S.getCell(null)))}return w.length>0&&(l(),o(w)),!1}return!0},[e,n,t,o,i,l,u,s,a]),f=oe.useCallback((p,v)=>{const[w,b]=p,M=[];for(let O=0;O<v.length;O++){const S=v[O];if(O+b>=n.current.getNumRows()){if(t)break;c()}for(let R=0;R<S.length;R++){const _=S[R],E=O+b,x=R+w;if(x>=e.length)break;const L=e[x];if(L.isEditable){const D=L.getCell(_,!0);if(pt(D)&&!vi(D)){const C=L.indexNumber,I=n.current.getOriginalRowIndex(i(E)),T=L.getCellValue(r([x,E]));L.getCellValue(D)!==T&&(n.current.setCell(C,I,{...D,lastUpdated:performance.now()}),M.push({cell:[x,E]}))}}}M.length>0&&(l(),o(M))}return!1},[e,n,t,i,r,c,l,o]),m=oe.useCallback((p,v)=>{const w=p[0];if(w>=e.length)return!0;const b=e[w];if(b.validateInput){const M=b.validateInput(b.getCellValue(v));return M===!0||M===!1?M:b.getCell(M)}return!0},[e]);return{onCellEdited:u,onPaste:f,onRowAppended:d,onDelete:h,validateCell:m}}const Pf=",",Zi='"',Xy='"',_f=`
196
- `,Gy="\uFEFF",jy=new RegExp(`[${[Pf,Zi,_f].join("")}]`),Sc=Fs.getLogger("useDataExporter");function xc(e){return e.map(t=>Ky(t)).join(Pf)+_f}function Ky(e){if(We(e))return"";const t=bt(e);return jy.test(t)?`${Zi}${t.replace(new RegExp(Zi,"g"),Xy+Zi)}${Zi}`:t}async function kc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Gy));const o=n.map(a=>a.name);await e.write(i.encode(xc(o)));for(let a=0;a<r;a++){const l=[];n.forEach((s,u,c)=>{l.push(s.getCellValue(t([u,a])))}),await e.write(i.encode(xc(l)))}await e.close()}function Zy(e,t,n,r){return{exportToCsv:oe.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Ls(()=>import("./es6.Co_R4Vrv.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:a,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await kc(u,e,t,n)}catch(l){if(l instanceof Error&&l.name==="AbortError")return;try{Sc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",l);let s="";const u=new WritableStream({write:async f=>{s+=new TextDecoder("utf-8").decode(f)},close:async()=>{}});await kc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),h=vg({enforceDownloadInNewTab:r,url:d,filename:a});h.style.display="none",document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(d)}catch(s){Sc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function Jy(e,t,n,r){return{getCellContent:oe.useCallback(([o,a])=>{var l;if(o>t.length-1)return Ft("Column index out of bounds","This error should never happen. Please report this bug.");if(a>n-1)return Ft("Row index out of bounds","This error should never happen. Please report this bug.");try{const s=t[o],u=s.indexNumber,c=r.current.getOriginalRowIndex(a),d=r.current.isAddedRow(c);if(s.isEditable||d){const m=r.current.getCell(u,c);if(pt(m))return{...s.getCell(s.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 h=e.getCell(c,u),f=ng(e,c,u);return L1(s,h,f,(l=e.styler)==null?void 0:l.cssStyles)}catch(s){return Ft("Error during cell creation",`This error should never happen. Please report this bug.
196
+ `,Gy="\uFEFF",jy=new RegExp(`[${[Pf,Zi,_f].join("")}]`),Sc=Fs.getLogger("useDataExporter");function xc(e){return e.map(t=>Ky(t)).join(Pf)+_f}function Ky(e){if(We(e))return"";const t=bt(e);return jy.test(t)?`${Zi}${t.replace(new RegExp(Zi,"g"),Xy+Zi)}${Zi}`:t}async function kc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Gy));const o=n.map(a=>a.name);await e.write(i.encode(xc(o)));for(let a=0;a<r;a++){const l=[];n.forEach((s,u,c)=>{l.push(s.getCellValue(t([u,a])))}),await e.write(i.encode(xc(l)))}await e.close()}function Zy(e,t,n,r){return{exportToCsv:oe.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Ls(()=>import("./es6.CwZ1-vgm.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:a,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await kc(u,e,t,n)}catch(l){if(l instanceof Error&&l.name==="AbortError")return;try{Sc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",l);let s="";const u=new WritableStream({write:async f=>{s+=new TextDecoder("utf-8").decode(f)},close:async()=>{}});await kc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),h=vg({enforceDownloadInNewTab:r,url:d,filename:a});h.style.display="none",document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(d)}catch(s){Sc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function Jy(e,t,n,r){return{getCellContent:oe.useCallback(([o,a])=>{var l;if(o>t.length-1)return Ft("Column index out of bounds","This error should never happen. Please report this bug.");if(a>n-1)return Ft("Row index out of bounds","This error should never happen. Please report this bug.");try{const s=t[o],u=s.indexNumber,c=r.current.getOriginalRowIndex(a),d=r.current.isAddedRow(c);if(s.isEditable||d){const m=r.current.getCell(u,c);if(pt(m))return{...s.getCell(s.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 h=e.getCell(c,u),f=ng(e,c,u);return L1(s,h,f,(l=e.styler)==null?void 0:l.cssStyles)}catch(s){return Ft("Error during cell creation",`This error should never happen. Please report this bug.
197
197
  Error: ${s}`)}},[t,n,e,r])}}function Qy(e){const[t,n]=oe.useState(void 0),r=oe.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,a]=o.location;n(a)}},[n]);return{getRowThemeOverride:oe.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function eC(e,t,n,r,i){const[o,a]=oe.useState({columns:mt.empty(),rows:mt.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(Mn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Mn.SelectionMode.SINGLE_ROW)),s=l&&e.selectionMode.includes(Mn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Mn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Mn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Mn.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,h=o.columns.length>0,f=o.current!==void 0,m=oe.useCallback(v=>{const w=!Xa(v.rows.toArray(),o.rows.toArray()),b=!Xa(v.columns.toArray(),o.columns.toArray()),M=!Xa(v.current,o.current);let O=l&&w||u&&b,S=v;if((l||u)&&v.current!==void 0&&M&&(S={...v,rows:o.rows,columns:o.columns},O=!1),w&&v.rows.length>0&&b&&v.columns.length===0&&(S={...S,columns:o.columns},O=!0),b&&v.columns.length>0&&w&&v.rows.length===0&&(S={...S,rows:o.rows},O=!0),b&&S.columns.length>=0){let R=S.columns;r.forEach((_,E)=>{_.isIndex&&(R=R.remove(E))}),R.length<S.columns.length&&(S={...S,columns:R})}a(S),O&&i(S)},[o,l,u,i,r]),p=oe.useCallback((v=!1,w=!1)=>{const b={columns:w?o.columns:mt.empty(),rows:v?o.rows:mt.empty(),current:void 0};a(b),(!v&&l||!w&&u)&&i(b)},[o,l,u,i]);return{gridSelection:o,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:h,isCellSelected:f,clearSelection:p,processSelectionChange:m}}function tC(e,t,n,r,i,o,a){const l=e.rowHeight??t.defaultRowHeight,s=t.defaultHeaderHeight+l+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===Mn.EditingMode.DYNAMIC?1:0,d=n+c;let h=Math.max(d*l+u*t.defaultHeaderHeight+2*t.tableBorderWidth,s),f=Math.min(h,t.defaultTableHeight);e.height&&(f=Math.max(e.height,s),h=Math.max(e.height,h)),o&&(f=Math.min(f,o),h=Math.min(h,o),e.height||(f=h));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(i,m);let v,w=p;e.useContainerWidth?v=p:e.width&&(v=Math.min(Math.max(e.width,m),p),w=Math.min(Math.max(e.width,w),p));const[b,M]=oe.useState({width:v||"100%",height:f});return oe.useLayoutEffect(()=>{e.useContainerWidth&&b.width==="100%"&&M(O=>({...O,width:p}))},[p]),oe.useLayoutEffect(()=>{M(O=>({...O,width:v||"100%"}))},[v]),oe.useLayoutEffect(()=>{M(O=>({...O,height:f}))},[f,n]),oe.useLayoutEffect(()=>{if(a){const O=e.useContainerWidth||pt(e.width)&&e.width>0;M({width:O?w:"100%",height:h})}else M({width:v||"100%",height:f})},[a]),{minHeight:s,maxHeight:h,minWidth:m,maxWidth:w,rowHeight:l,resizableSize:b,setResizableSize:M}}const nC=600,rC="⚠️ Please fill out this cell.";function iC(e,t,n=[]){const[r,i]=oe.useState(),o=oe.useRef(null),a=oe.useCallback(s=>{if(clearTimeout(o.current),o.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const u=s.location[0],c=s.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const h=e[u];if(s.kind==="header"&&pt(h))d=h.help;else if(s.kind==="cell"){const f=t([u,c]);vi(f)?d=f.errorDetails:h.isRequired&&h.isEditable&&ka(f)?d=rC:u1(f)&&(d=f.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},nC))}},[e,t,i,o,n]),l=oe.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:l,onItemHovered:a}}function oC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=oe.useState(!0),a=Gr(),{colors:l,fontSizes:s,radii:u,fontWeights:c}=a,d=oe.useCallback(()=>{o(!1),r()},[r,o]);return lt(Sa,{content:lt(rg,{"data-testid":"stDataFrameTooltipContent",children:lt(ig,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:ya.top,accessibilityType:_c.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(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:lt("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const aC=g.memo(oC),Mc=yi("div",{target:"eu64wbe0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-seveqep":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:t.spacing.sm,right:t.spacing.sm,padding:t.spacing.sm,borderRadius:t.radii.default,"& .gdg-search-status":{paddingTop:t.spacing.twoXS,fontSize:t.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:t.iconSizes.xl,height:t.iconSizes.xl,"& .button-icon":{width:t.iconSizes.base,height:t.iconSizes.base}}}})),Rc=150,sC=15e4,Ec=6;function lC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:a,expand:l,collapse:s,width:u,height:c}=ug(cg),d=oe.useRef(null),h=oe.useRef(null),f=oe.useRef(null),m=Uy(),{getRowThemeOverride:p,onItemHovered:v}=Qy(m),{libConfig:{enforceDownloadInNewTab:w=!1}}=oe.useContext(og),[b,M]=oe.useState(!0),[O,S]=oe.useState(!1),[R,_]=oe.useState(!1),[E,x]=oe.useState(!1),[L,D]=oe.useState(),[C,I]=oe.useState(!1),T=oe.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),k=oe.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);We(e.editingMode)&&(e.editingMode=Mn.EditingMode.READ_ONLY);const{READ_ONLY:z,DYNAMIC:N}=Mn.EditingMode,X=t.dimensions,ie=Math.max(0,X.numDataRows),K=ie===0&&!(e.editingMode===N&&X.numDataColumns>0),G=ie>sC,le=!G&&!K&&e.editingMode!==N,se=!K&&e.editingMode===N&&!n,ce=oe.useRef(new Yo(ie)),[he,Q]=oe.useState(ce.current.getNumRows());oe.useEffect(()=>{ce.current=new Yo(ie),Q(ce.current.getNumRows())},[ie]);const H=oe.useCallback(()=>{ce.current=new Yo(ie),Q(ce.current.getNumRows())},[ie]),[P,W]=oe.useState(e.columnOrder);oe.useEffect(()=>{W(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:de,allColumns:Oe,setColumnConfigMapping:Ve}=H1(e,t,n,P);oe.useEffect(()=>{if(e.editingMode===z)return;const te=r.getStringValue({id:e.id,formId:e.formId});te&&(ce.current.fromJson(te,de),Q(ce.current.getNumRows()))},[]);const{getCellContent:Ce}=Jy(t,de,he,ce),{columns:Ee,sortColumn:xe,getOriginalIndex:Tt,getCellContent:wt}=X1(ie,de,Ce),it=oe.useCallback(te=>{const Le={selection:{rows:[],columns:[]}};Le.selection.rows=te.rows.toArray().map(rn=>Tt(rn)),Le.selection.columns=te.columns.toArray().map(rn=>no(Ee[rn]));const Gt=JSON.stringify(Le),Zt=r.getStringValue({id:e.id,formId:e.formId});(Zt===void 0||Zt!==Gt)&&r.setStringValue({id:e.id,formId:e.formId},Gt,{fromUi:!0},o)},[Ee,e.id,e.formId,r,o,Tt]),{debouncedCallback:ue}=zu(it,Rc),{gridSelection:tt,isRowSelectionActivated:ve,isMultiRowSelectionActivated:ge,isColumnSelectionActivated:pe,isMultiColumnSelectionActivated:$e,isRowSelected:_e,isColumnSelected:nt,isCellSelected:be,clearSelection:fe,processSelectionChange:ot}=eC(e,K,n,Ee,ue);oe.useEffect(()=>{fe(!0,!0)},[a]);const ze=oe.useCallback(te=>{var Le;(Le=h.current)==null||Le.updateCells(te)},[]);oe.useEffect(()=>{var Le,Gt,Zt,rn;if(!ve&&!pe)return;const te=r.getStringValue({id:e.id,formId:e.formId});if(te){const Sn=Ee.map(tr=>no(tr)),Yt=JSON.parse(te);let fn=mt.empty(),vn=mt.empty();(Gt=(Le=Yt.selection)==null?void 0:Le.rows)==null||Gt.forEach(tr=>{fn=fn.add(tr)}),(rn=(Zt=Yt.selection)==null?void 0:Zt.columns)==null||rn.forEach(tr=>{vn=vn.add(Sn.indexOf(tr))}),(fn.length>0||vn.length>0)&&ot({rows:fn,columns:vn,current:void 0})}},[]);const et=oe.useCallback(()=>{he!==ce.current.getNumRows()&&Q(ce.current.getNumRows())},[he]),vt=oe.useCallback(()=>{const te=ce.current.toJson(Ee);let Le=r.getStringValue({id:e.id,formId:e.formId});Le===void 0&&(Le=new Yo(0).toJson([])),te!==Le&&r.setStringValue({id:e.id,formId:e.formId},te,{fromUi:!0},o)},[Ee,e.id,e.formId,r,o]),{debouncedCallback:ht}=zu(vt,Rc),{exportToCsv:Ne}=Zy(wt,Ee,he,w),{onCellEdited:Dt,onPaste:qt,onRowAppended:St,onDelete:Pt,validateCell:tn}=Yy(Ee,e.editingMode!==N,ce,wt,Tt,ze,et,ht,fe),{tooltip:Rt,clearTooltip:sn,onItemHovered:At}=iC(Ee,wt,se?[he]:[]),{drawCell:Et,customRenderers:Dn}=Wy(Ee),{provideEditor:yn}=j1(),Pe=g.useCallback(te=>({...te,hasMenu:!K}),[K]),Ht=oe.useMemo(()=>Ee.map(te=>Pe(Ts(te))),[Ee,Pe]),{columns:dn,onColumnResize:mn}=N1(Ht),pn=t.dimensions.numHeaderRows>1,{minHeight:st,maxHeight:Nt,minWidth:_t,maxWidth:nn,rowHeight:xt,resizableSize:Lt,setResizableSize:Je}=tC(e,m,he,pn,u||0,c,a),Bt=oe.useCallback(([te,Le])=>({...c1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(Ee.length-1,0)]}),[Ee,m.glideTheme.textLight]),Ot=oe.useCallback(()=>{H(),fe()},[H,fe]);sg({element:e,widgetMgr:r,onFormCleared:Ot});const{pinColumn:zt,unpinColumn:Vt,freezeColumns:Cn}=V1(Ee,K,u||0,m.minColumnWidth,fe,Ve),{changeColumnFormat:dr}=z1(Ve),{hideColumn:On,showColumn:V}=G1(fe,Ve),{onColumnMoved:Qe}=$1(Ee,Cn,zt,Vt,W);return oe.useEffect(()=>{setTimeout(()=>{var te,Le;if(f.current&&h.current){const Gt=(Le=(te=f.current)==null?void 0:te.querySelector(".dvn-stack"))==null?void 0:Le.getBoundingClientRect();Gt&&(_(Gt.height>f.current.clientHeight),x(Gt.width>f.current.clientWidth))}},1)},[Lt,he,dn]),g.useEffect(()=>{Oe.length==Ee.length&&I(!1)},[Oe.length,Ee.length]),Fn(Mc,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:k,ref:f,onMouseDown:te=>{if(f.current&&k){const Le=f.current.getBoundingClientRect();E&&Le.height-(Ec+1)<te.clientY-Le.top&&te.stopPropagation(),R&&Le.width-(Ec+1)<te.clientX-Le.left&&te.stopPropagation()}},onBlur:te=>{!b&&!T&&!te.currentTarget.contains(te.relatedTarget)&&fe(!0,!0)},children:[Fn(dg,{isFullScreen:a,disableFullscreenMode:i,locked:_e&&!ve||be||T&&b||C,onExpand:l,onCollapse:s,target:Mc,children:[(ve&&_e||pe&&nt)&&lt(ci,{label:"Clear selection",icon:bg,onClick:()=>{fe(),sn()}}),se&&_e&&lt(ci,{label:"Delete row(s)",icon:xg,onClick:()=>{Pt&&(Pt(tt),sn())}}),se&&!_e&&lt(ci,{label:"Add row",icon:Nc,onClick:()=>{var te;St&&(M(!0),St(),sn(),(te=h.current)==null||te.scrollTo(0,he,"vertical"))}}),!K&&Oe.length>Ee.length&&lt(n1,{columns:Oe,columnOrder:P,setColumnOrder:W,hideColumn:On,showColumn:V,isOpen:C,onClose:()=>I(!1),children:lt(ci,{label:"Show/hide columns",icon:Wc,onClick:()=>I(!0)})}),!G&&!K&&lt(ci,{label:"Download as CSV",icon:kg,onClick:()=>Ne()}),!K&&lt(ci,{label:"Search",icon:Bc,onClick:()=>{O?S(!1):(M(!0),S(!0)),sn()}})]}),lt(ag,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Lt,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:st,maxHeight:Nt,minWidth:_t,maxWidth:nn,size:Lt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,xt],snapGap:xt/3,onResizeStop:(te,Le,Gt,Zt)=>{if(d.current){const rn=2*m.tableBorderWidth;Je({width:d.current.size.width,height:Nt-d.current.size.height===rn?d.current.size.height+rn:d.current.size.height})}},children:lt(Yv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:h,columns:dn,rows:K?1:he,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:xt,headerHeight:m.defaultHeaderHeight,getCellContent:K?Bt:wt,onColumnResize:T?void 0:mn,resizeIndicator:"header",freezeColumns:Cn,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:T?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:pe?void 0:Qe,onItemHovered:te=>{v==null||v(te),At==null||At(te)},keybindings:{downFill:!0},onKeyDown:te=>{(te.ctrlKey||te.metaKey)&&te.key==="f"&&(S(Le=>!Le),te.stopPropagation(),te.preventDefault())},showSearch:O,onSearchClose:()=>{S(!1),sn()},onHeaderClicked:(te,Le)=>{!le||pe||(ve&&_e?fe():fe(!0,!0),xe(te,"auto"))},gridSelection:tt,onGridSelectionChange:te=>{(b||T)&&(ot(te),Rt!==void 0&&sn())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:te=>{te.kind==="out-of-bounds"&&b?M(!1):te.kind!=="out-of-bounds"&&!b&&M(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...k&&{paddingBottom:E?-6:void 0,paddingRight:R?-6:void 0}},provideEditor:yn,drawCell:Et,customRenderers:Dn,imageEditorOverride:x1,headerIcons:m.headerIcons,validateCell:tn,onHeaderMenuClick:(te,Le)=>{D({columnIdx:te,headerBounds:Le})},onPaste:!1,...ve&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:ge?"multi":"auto",rowSelect:n?"none":ge?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...pe&&{columnSelect:n?"none":$e?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!K&&e.editingMode!==z&&!n&&{fillHandle:!T,onCellEdited:Dt,onPaste:qt,onDelete:Pt},...!K&&e.editingMode===N&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:St,onHeaderClicked:void 0}})}),Rt&&Rt.content&&lt(aC,{top:Rt.top,left:Rt.left,content:Rt.content,clearTooltip:sn}),L&&Vc.createPortal(lt(Jv,{top:L.headerBounds.y+L.headerBounds.height,left:L.headerBounds.x+L.headerBounds.width,columnKind:de[L.columnIdx].kind,onCloseMenu:()=>D(void 0),onSortColumn:le?te=>{fe(!0,!0),xe(L.columnIdx,te,!0)}:void 0,isColumnPinned:de[L.columnIdx].isPinned,onUnpinColumn:()=>{Vt(de[L.columnIdx].id)},onPinColumn:()=>{zt(de[L.columnIdx].id)},onHideColumn:()=>{On(de[L.columnIdx].id)},onChangeFormat:te=>{dr(de[L.columnIdx].id,te),setTimeout(()=>{var Le;(Le=h.current)==null||Le.remeasureColumns(mt.fromSingleSelection(L.columnIdx))},100)},onAutosize:()=>{var te;(te=h.current)==null||te.remeasureColumns(mt.fromSingleSelection(L.columnIdx))}}),document.querySelector("#portal"))]})}const uC=lg(lC),cC=g.memo(uC),kC=Object.freeze(Object.defineProperty({__proto__:null,default:cC},Symbol.toStringTag,{value:"Module"}));export{k0 as C,Sd as T,gi as a,Dg as b,kC as c,fi as i,Xm as m,gn as s};