streamlit 1.52.0__py3-none-any.whl → 1.52.2__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 (98) hide show
  1. streamlit/elements/widgets/data_editor.py +7 -1
  2. streamlit/static/index.html +1 -1
  3. streamlit/static/manifest.json +279 -279
  4. streamlit/static/static/js/{ErrorOutline.esm.ZJDbmVTx.js → ErrorOutline.esm.LtBTGAgi.js} +1 -1
  5. streamlit/static/static/js/{FileDownload.esm.Dx0vI3vH.js → FileDownload.esm.DllwCvQc.js} +1 -1
  6. streamlit/static/static/js/{FileHelper.B7Ero7qQ.js → FileHelper.DgwA_xYF.js} +1 -1
  7. streamlit/static/static/js/{FormClearHelper.CG2XN1_g.js → FormClearHelper.DyYuMYyM.js} +1 -1
  8. streamlit/static/static/js/{InputInstructions.Cj5-1zf6.js → InputInstructions.ikAdmYQR.js} +1 -1
  9. streamlit/static/static/js/{Particles.BfWfv0Aw.js → Particles.Cg5ey-rW.js} +1 -1
  10. streamlit/static/static/js/{ProgressBar.CGQ8OgfO.js → ProgressBar.D1rDn4Rn.js} +1 -1
  11. streamlit/static/static/js/{StreamlitSyntaxHighlighter.DTKLpwhl.js → StreamlitSyntaxHighlighter.DU42g8NY.js} +1 -1
  12. streamlit/static/static/js/{Toolbar.B2qFUmd9.js → Toolbar.0YdWjZhn.js} +1 -1
  13. streamlit/static/static/js/{base-input.o9tL8MDP.js → base-input.DYzkAUR7.js} +1 -1
  14. streamlit/static/static/js/{checkbox.0BeV1IBL.js → checkbox.YeQ8t-PZ.js} +1 -1
  15. streamlit/static/static/js/{createSuper.RBO59fEm.js → createSuper.CXzRWZIx.js} +1 -1
  16. streamlit/static/static/js/{data-grid-overlay-editor.CiTkUy0t.js → data-grid-overlay-editor.vnwILR0p.js} +1 -1
  17. streamlit/static/static/js/{downloader.DwNZg3Mw.js → downloader.BdNzicWj.js} +1 -1
  18. streamlit/static/static/js/{embed.XT9xNd3F.js → embed.C_8wI7Q8.js} +1 -1
  19. streamlit/static/static/js/{es6.x9KsYQg-.js → es6.D6UMoOIM.js} +2 -2
  20. streamlit/static/static/js/{iframeResizer.contentWindow.ZVXpMPi0.js → iframeResizer.contentWindow.DM7vAi8H.js} +1 -1
  21. streamlit/static/static/js/{index.x_QRaLMd.js → index.0CGAg_-3.js} +1 -1
  22. streamlit/static/static/js/{index.BWB_91TA.js → index.19XigCCW.js} +1 -1
  23. streamlit/static/static/js/{index.DMxc2XFp.js → index.3bHSf9gi.js} +9 -9
  24. streamlit/static/static/js/{index.DXxnU5ej.js → index.B1br6-J8.js} +1 -1
  25. streamlit/static/static/js/{index.DsgAU5lc.js → index.BDyX78eQ.js} +1 -1
  26. streamlit/static/static/js/{index.CLmq_z9K.js → index.BEiPXRiB.js} +1 -1
  27. streamlit/static/static/js/{index.CjozwSzS.js → index.BGGsxMsK.js} +1 -1
  28. streamlit/static/static/js/{index.DB_w_CZQ.js → index.BK8LGuo5.js} +1 -1
  29. streamlit/static/static/js/{index.Dr9HIhQw.js → index.BNH1O6vW.js} +1 -1
  30. streamlit/static/static/js/{index.DpNTZz82.js → index.BNJ18Gvk.js} +1 -1
  31. streamlit/static/static/js/{index.B527JZdO.js → index.BSC_e7mC.js} +1 -1
  32. streamlit/static/static/js/{index.DK0RFJUG.js → index.BSsyTGMU.js} +1 -1
  33. streamlit/static/static/js/{index.BuCx76ZV.js → index.BTeFWqxT.js} +1 -1
  34. streamlit/static/static/js/index.BVQ-x0jB.js +2 -0
  35. streamlit/static/static/js/{index.BHgV-yW4.js → index.BtT26h8D.js} +1 -1
  36. streamlit/static/static/js/{index.CkGVt6-G.js → index.BuO127Fv.js} +1 -1
  37. streamlit/static/static/js/{index.rORSX6IW.js → index.C4SaLgc9.js} +1 -1
  38. streamlit/static/static/js/{index.CyUHWoCC.js → index.C6PG_WI2.js} +1 -1
  39. streamlit/static/static/js/{index.q5hIQwAY.js → index.C9ZwaDT3.js} +1 -1
  40. streamlit/static/static/js/{index.Bu5JWpT_.js → index.CCH6P_Oz.js} +1 -1
  41. streamlit/static/static/js/{index.BfEKaEmw.js → index.CJdAAsMS.js} +1 -1
  42. streamlit/static/static/js/{index.BxjzhVUb.js → index.CLw67zQa.js} +1 -1
  43. streamlit/static/static/js/{index.BQr-XwGV.js → index.COYdue8P.js} +1 -1
  44. streamlit/static/static/js/index.CPVPS6MS.js +1 -0
  45. streamlit/static/static/js/{index.DWexTVLY.js → index.CQRv0Buu.js} +1 -1
  46. streamlit/static/static/js/{index.RJZuWCGA.js → index.CTssS8CY.js} +1 -1
  47. streamlit/static/static/js/{index.CF5MxTbK.js → index.CV56Xzvw.js} +1 -1
  48. streamlit/static/static/js/{index.PaidgjCs.js → index.CVgZcb-2.js} +1 -1
  49. streamlit/static/static/js/{index.CyroQtI4.js → index.CaMDX02c.js} +1 -1
  50. streamlit/static/static/js/{index.KfXqjDYy.js → index.Cc0FyOvj.js} +1 -1
  51. streamlit/static/static/js/{index.BTtmaLDB.js → index.CccNGpyY.js} +1 -1
  52. streamlit/static/static/js/{index.By55VdPY.js → index.CinPJsaI.js} +1 -1
  53. streamlit/static/static/js/{index.DBalctjj.js → index.Cys-qREe.js} +1 -1
  54. streamlit/static/static/js/{index.CTgm_-jO.js → index.DATGLwZn.js} +1 -1
  55. streamlit/static/static/js/{index.C_rK-Swb.js → index.DDuPBAVu.js} +5 -5
  56. streamlit/static/static/js/{index.B1fRb5wF.js → index.DN77pJCq.js} +1 -1
  57. streamlit/static/static/js/{index.DO5utP74.js → index.DRgFBrOW.js} +1 -1
  58. streamlit/static/static/js/{index.DlltaH7J.js → index.Dc27IuI8.js} +1 -1
  59. streamlit/static/static/js/{index.BfXjTO8b.js → index.DdjNqo0t.js} +1 -1
  60. streamlit/static/static/js/{index.CuvXOyER.js → index.DmQGepo0.js} +1 -1
  61. streamlit/static/static/js/{index.hbeqcRTn.js → index.DmaExHyk.js} +1 -1
  62. streamlit/static/static/js/{index.D6HmkoDm.js → index.Dou8UoAD.js} +1 -1
  63. streamlit/static/static/js/{index.DAqCNvsO.js → index.Dt4MKWrN.js} +1 -1
  64. streamlit/static/static/js/{index.5VPOamri.js → index.M-iumICI.js} +1 -1
  65. streamlit/static/static/js/{index.CNH4rdSz.js → index.NjN0yaAC.js} +1 -1
  66. streamlit/static/static/js/{index.DS7lf09n.js → index.OW6D7CJ5.js} +1 -1
  67. streamlit/static/static/js/{index.Bjy4NRu9.js → index.SnIe8o_F.js} +1 -1
  68. streamlit/static/static/js/{index.AnXMIBz3.js → index.xg87JKI8.js} +1 -1
  69. streamlit/static/static/js/{input.D5oh9-aB.js → input.-I2c-pPm.js} +1 -1
  70. streamlit/static/static/js/{main.q9oGOg0H.js → main.zgyqwsPV.js} +1 -1
  71. streamlit/static/static/js/{memory.5kCSFUJS.js → memory.BTaCc67b.js} +1 -1
  72. streamlit/static/static/js/{number-overlay-editor.Cn_LsK8N.js → number-overlay-editor.Bp2-OIVN.js} +1 -1
  73. streamlit/static/static/js/{pandasStylerUtils.BqhXt51_.js → pandasStylerUtils.PlmC_Sod.js} +1 -1
  74. streamlit/static/static/js/{possibleConstructorReturn.DD9NK1Z8.js → possibleConstructorReturn.D2vivPxX.js} +1 -1
  75. streamlit/static/static/js/{sandbox.DACSyz29.js → sandbox.C-NkJg85.js} +1 -1
  76. streamlit/static/static/js/{styled-components.C3R090At.js → styled-components.-ywQNIcz.js} +1 -1
  77. streamlit/static/static/js/{throttle.B0GR3Iyz.js → throttle.SbSFuU2P.js} +1 -1
  78. streamlit/static/static/js/{timepicker.BdhzPxrv.js → timepicker.BRg2LlYz.js} +1 -1
  79. streamlit/static/static/js/{toConsumableArray.Db2pdqM2.js → toConsumableArray.DmYuqCFN.js} +1 -1
  80. streamlit/static/static/js/uniqueId.DDLECwS_.js +1 -0
  81. streamlit/static/static/js/{useBasicWidgetState.Bfp6TnSw.js → useBasicWidgetState.CSKMY_WY.js} +1 -1
  82. streamlit/static/static/js/{useIntlLocale.hRV75Xgj.js → useIntlLocale.DrzrdT6m.js} +1 -1
  83. streamlit/static/static/js/{useTextInputAutoExpand.QepX7n8Y.js → useTextInputAutoExpand.BZ_dM91Q.js} +1 -1
  84. streamlit/static/static/js/{useUpdateUiValue.DHx8TzX6.js → useUpdateUiValue.y-s71G-M.js} +1 -1
  85. streamlit/static/static/js/{useWaveformController.WxVzpzEX.js → useWaveformController.Bumwfqnl.js} +1 -1
  86. streamlit/static/static/js/{withCalculatedWidth.DcKeRSWJ.js → withCalculatedWidth.Dl_TDMaA.js} +1 -1
  87. streamlit/static/static/js/{withFullScreenWrapper.CrHddARq.js → withFullScreenWrapper.CWEBbO_P.js} +1 -1
  88. streamlit/web/server/authlib_tornado_integration.py +60 -0
  89. streamlit/web/server/oidc_mixin.py +14 -3
  90. {streamlit-1.52.0.dist-info → streamlit-1.52.2.dist-info}/METADATA +1 -1
  91. {streamlit-1.52.0.dist-info → streamlit-1.52.2.dist-info}/RECORD +95 -95
  92. streamlit/static/static/js/index.DcU3uDvB.js +0 -2
  93. streamlit/static/static/js/index.uSX757_v.js +0 -1
  94. streamlit/static/static/js/uniqueId.CtqIr-Yh.js +0 -1
  95. {streamlit-1.52.0.data → streamlit-1.52.2.data}/scripts/streamlit.cmd +0 -0
  96. {streamlit-1.52.0.dist-info → streamlit-1.52.2.dist-info}/WHEEL +0 -0
  97. {streamlit-1.52.0.dist-info → streamlit-1.52.2.dist-info}/entry_points.txt +0 -0
  98. {streamlit-1.52.0.dist-info → streamlit-1.52.2.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.CiTkUy0t.js","./index.DMxc2XFp.js","../css/index.BpABIXK9.css","./withFullScreenWrapper.CrHddARq.js","./Toolbar.B2qFUmd9.js","./FormClearHelper.CG2XN1_g.js","./moment.C3j7ZXd7.js","./pandasStylerUtils.BqhXt51_.js","./_baseIndexOf.BTknn6Gb.js","./sprintf.D7DtBTRn.js","./index.8HslT92O.js","./main.q9oGOg0H.js","./throttle.B0GR3Iyz.js","./checkbox.0BeV1IBL.js","./createDownloadLinkElement.ZaXNnPK4.js","./toConsumableArray.Db2pdqM2.js","./possibleConstructorReturn.DD9NK1Z8.js","./createSuper.RBO59fEm.js","./FileDownload.esm.Dx0vI3vH.js","./_arrayIncludes.B19Iyn2B.js","./number-overlay-editor.Cn_LsK8N.js","./es6.x9KsYQg-.js"])))=>i.map(i=>d[i]);
2
- import{ar as Ya,d4 as uh,d5 as ch,cK as wc,d6 as dh,d7 as fh,d8 as hh,d9 as gh,da as ph,db as mh,dc as ja,dd as yc,aN as vh,aO as bh,r as f,E as Ll,_ as $e,de as wh,al as yo,bz as yh,df as Ch,aB as $t,dg as Sh,K as Ir,dh as Ls,aL as Fl,H as xh,e as Le,bA as Cc,n as at,di as kh,j as Ne,dj as Mh,x as Jn,aI as tn,bl as Rh,ad as Ih,dk as Eh,dl as Th,k as Co,t as Xr,aM as Dh,dm as Oh,dn as Ph,dp as Sc,cc as Lh,ca as Fh,dq as xc,dr as Ah,ds as _h,c9 as kc,cd as Hh,dt as zh,c8 as Vh,du as $h,bj as Nh,bk as Bh,cf as Wh,dv as Uh,M as Gh,dw as Xh,cg as Yh,dx as jh,N as qh,g as Kr,J as nn,Q as Al,cW as Kh,cU as ro,dy as lr,dz as _e,br as Zh,aj as Mc,dA as Rc,a4 as Jh,dB as Qh,dC as eg,bn as qa,a0 as Ic,aw as Sa,dD as Ec,l as wn,Z as jn,cx as xa,V as tg,cz as Tc,dE as ng,S as rg,R as Fs,dF as ig,dG as og,f as ag,L as lg,dH as sg,dI as As}from"./index.DMxc2XFp.js";import{w as ug,E as cg}from"./withFullScreenWrapper.CrHddARq.js";import{T as dg,a as yi}from"./Toolbar.B2qFUmd9.js";import{u as fg}from"./FormClearHelper.CG2XN1_g.js";import{h as Gr}from"./moment.C3j7ZXd7.js";import{r as hg,n as io,m as _s,f as bl,c as gg,a as pg}from"./pandasStylerUtils.BqhXt51_.js";import{s as mg}from"./sprintf.D7DtBTRn.js";import{l as Ka}from"./index.8HslT92O.js";import{R as vg}from"./main.q9oGOg0H.js";import{d as Dc,t as bg}from"./throttle.B0GR3Iyz.js";import{L as wg,a as yg,S as Cg}from"./checkbox.0BeV1IBL.js";import{c as Sg}from"./createDownloadLinkElement.ZaXNnPK4.js";import{_ as fr,a as Ei,C as xg}from"./toConsumableArray.Db2pdqM2.js";import{d as kg,f as Mg,e as Rg}from"./possibleConstructorReturn.DD9NK1Z8.js";import{_ as Ig}from"./createSuper.RBO59fEm.js";import{D as Eg,F as Tg}from"./FileDownload.esm.Dx0vI3vH.js";import{a as Dg}from"./_arrayIncludes.B19Iyn2B.js";function Og(){}function Pg(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Nn(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Ya(n),n=n===n?n:0),t!==void 0&&(t=Ya(t),t=t===t?t:0),Pg(Ya(e),t,n)}var Lg=Object.prototype,Fg=Lg.hasOwnProperty;function Ag(e,t){return e!=null&&Fg.call(e,t)}function _g(e,t){return e!=null&&uh(e,t,Ag)}var Hg="[object Map]",zg="[object Set]",Vg=Object.prototype,$g=Vg.hasOwnProperty;function Ng(e){if(e==null)return!0;if(ch(e)&&(wc(e)||typeof e=="string"||typeof e.splice=="function"||dh(e)||fh(e)||hh(e)))return!e.length;var t=gh(e);if(t==Hg||t==zg)return!e.size;if(ph(e))return!mh(e).length;for(var n in e)if($g.call(e,n))return!1;return!0}var Bg=1/0,Wg=ja&&1/yc(new ja([,-0]))[1]==Bg?function(e){return new ja(e)}:Og,Ug=200;function Gg(e,t,n){var r=-1,i=Dg,o=e.length,l=!0,a=[],s=a;if(o>=Ug){var u=Wg(e);if(u)return yc(u);l=!1,i=bh,s=new vh}else s=a;e:for(;++r<o;){var c=e[r],d=c;if(c=c!==0?c:0,l&&d===d){for(var g=s.length;g--;)if(s[g]===d)continue e;a.push(c)}else i(s,d,n)||(s!==a&&s.push(d),a.push(c))}return a}function Xg(e){return e&&e.length?Gg(e):[]}var Oc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,$e({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Oc.displayName="Add";var Pc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,$e({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Pc.displayName="Search";var Lc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,$e({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Lc.displayName="Visibility";function Fc(e="This should not happen"){throw new Error(e)}function _n(e,t="Assertion failed"){if(!e)return Fc(t)}function fo(e,t){return Fc(t??"Hell froze over")}function Yg(e,t){try{return e()}catch{return t}}const Hs=Object.prototype.hasOwnProperty;function Di(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--&&Di(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Hs.call(e,n)&&++r&&!Hs.call(t,n)||!(n in t)||!Di(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const aa=null,_l=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var zs;(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"})(zs||(zs={}));var la;(function(e){e.Triangle="triangle",e.Dots="dots"})(la||(la={}));function Vo(e){return"width"in e&&typeof e.width=="number"}async function Vs(e){return typeof e=="object"?e:await e()}function Si(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Mi(e){return e.kind===Bn.Marker||e.kind===Bn.NewRow}function xi(e){if(!Si(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:fo(e,"A cell was passed with an invalid kind")}}function jg(e){return _g(e,"editor")}function Hl(e){return!(e.readonly??!1)}var Bn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Bn||(Bn={}));const sa={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function Za(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 $s;class et{items;constructor(t){this.items=t}static create=t=>new et(Za(t));static empty=()=>$s??($s=new et([]));static fromSingleSelection=t=>et.empty().add(t);static fromArray=t=>{if(t.length===0)return et.empty();const n=t.map(i=>[i,i+1]),r=Za(n);return new et(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new et(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Za([...this.items,n]);return new et(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,l]of n.entries()){const[a,s]=l;if(a<=i&&r<=s){const u=[];a<r&&u.push([a,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new et(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var qg=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Ja=wh(function(e){return qg.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Kg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,s]=a.split("_");n[s]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Ns=Kg,Zg=e=>e.toUpperCase()===e,Jg=e=>t=>e.indexOf(t)===-1,Ac=(e,t)=>{const n={};return Object.keys(e).filter(Jg(t)).forEach(r=>{n[r]=e[r]}),n};function Qg(e,t,n){const r=Ac(t,n);if(!e){const i=typeof Ja=="function"?{default:Ja}:Ja;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var ep=(e,t)=>{};function tp(e){let t="";return n=>{const r=(o,l)=>{const{as:a=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Zg(a[0])):n.propsAsIs,c=Qg(u,o,["as","class"]);c.ref=l,c.className=n.atomic?Ns(n.class,c.className||s):Ns(c.className||s,n.class);const{vars:d}=n;if(d){const g={};for(const m in d){const y=d[m],v=y[0],b=y[1]||"",k=typeof v=="function"?v(o):v;ep(k,n.name),g[`--${m}`]=`${k}${b}`}const h=c.style||{},p=Object.keys(h);p.length>0&&p.forEach(m=>{g[m]=h[m]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const l=Ac(o,["innerRef"]);return r(l,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var sn=tp;const np=sn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Qa={},Gi={},$o={},No={},Bs;function rp(){return Bs||(Bs=1,function(e){(function(t,n){n(e,yo(),yh())})(No,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=l(n),o=l(r);function l(b){return b&&b.__esModule?b:{default:b}}var a=Object.assign||function(b){for(var k=1;k<arguments.length;k++){var E=arguments[k];for(var M in E)Object.prototype.hasOwnProperty.call(E,M)&&(b[M]=E[M])}return b};function s(b,k){var E={};for(var M in b)k.indexOf(M)>=0||Object.prototype.hasOwnProperty.call(b,M)&&(E[M]=b[M]);return E}function u(b,k){if(!(b instanceof k))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(k,E){for(var M=0;M<E.length;M++){var I=E[M];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(k,I.key,I)}}return function(k,E,M){return E&&b(k.prototype,E),M&&b(k,M),k}}();function d(b,k){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:b}function g(b,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);b.prototype=Object.create(k&&k.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(b,k):b.__proto__=k)}var h=!1;function p(b){h=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?b:b.capture}function y(b){if("touches"in b){var k=b.touches[0],E=k.pageX,M=k.pageY;return{x:E,y:M}}var I=b.screenX,P=b.screenY;return{x:I,y:P}}var v=function(b){g(k,b);function k(){var E;u(this,k);for(var M=arguments.length,I=Array(M),P=0;P<M;P++)I[P]=arguments[P];var S=d(this,(E=k.__proto__||Object.getPrototypeOf(k)).call.apply(E,[this].concat(I)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return c(k,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(M){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(M))}},{key:"_onMouseMove",value:function(M){this.mouseDown&&this._handleSwipeMove(M)}},{key:"_onMouseUp",value:function(M){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(M)}},{key:"_handleSwipeStart",value:function(M){var I=y(M),P=I.x,S=I.y;this.moveStart={x:P,y:S},this.props.onSwipeStart(M)}},{key:"_handleSwipeMove",value:function(M){if(this.moveStart){var I=y(M),P=I.x,S=I.y,C=P-this.moveStart.x,F=S-this.moveStart.y;this.moving=!0;var T=this.props.onSwipeMove({x:C,y:F},M);T&&M.cancelable&&M.preventDefault(),this.movePosition={deltaX:C,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(M){this.props.onSwipeEnd(M);var I=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-I?this.props.onSwipeLeft(1,M):this.movePosition.deltaX>I&&this.props.onSwipeRight(1,M),this.movePosition.deltaY<-I?this.props.onSwipeUp(1,M):this.movePosition.deltaY>I&&this.props.onSwipeDown(1,M)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(M){this.swiper=M,this.props.innerRef(M)}},{key:"render",value:function(){var M=this.props;M.tagName;var I=M.className,P=M.style,S=M.children;M.allowMouseEvents,M.onSwipeUp,M.onSwipeDown,M.onSwipeLeft,M.onSwipeRight,M.onSwipeStart,M.onSwipeMove,M.onSwipeEnd,M.innerRef,M.tolerance;var C=s(M,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:I,style:P},C),S)}}]),k}(n.Component);v.displayName="ReactSwipe",v.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},v.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=v})}(No)),No}var Ws;function _c(){return Ws||(Ws=1,function(e){(function(t,n){n(e,rp())})($o,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})}($o)),$o}var Xi={},Us;function Hc(){if(Us)return Xi;Us=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.default=void 0;var e=t(Ch());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,l){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":l==="horizontal","axis-vertical":l!=="horizontal"})},SLIDER:function(o,l){return(0,e.default)({thumbs:!o,slider:o,animated:!l})},ITEM:function(o,l,a){return(0,e.default)({thumb:!o,slide:o,selected:l,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Xi.default=r,Xi}var Yi={},ji={},Gs;function ip(){if(Gs)return ji;Gs=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return ji.outerWidth=e,ji}var qi={},Xs;function zl(){if(Xs)return qi;Xs=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,l=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",s="("+l.join(",")+")";return a+s};return qi.default=e,qi}var Ki={},Ys;function zc(){if(Ys)return Ki;Ys=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var e=function(){return window};return Ki.default=e,Ki}var js;function Vc(){if(js)return Yi;js=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=s(yo()),t=l(Hc()),n=ip(),r=l(zl()),i=l(_c()),o=l(zc());function l(S){return S&&S.__esModule?S:{default:S}}function a(){if(typeof WeakMap!="function")return null;var S=new WeakMap;return a=function(){return S},S}function s(S){if(S&&S.__esModule)return S;if(S===null||u(S)!=="object"&&typeof S!="function")return{default:S};var C=a();if(C&&C.has(S))return C.get(S);var F={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in S)if(Object.prototype.hasOwnProperty.call(S,x)){var D=T?Object.getOwnPropertyDescriptor(S,x):null;D&&(D.get||D.set)?Object.defineProperty(F,x,D):F[x]=S[x]}return F.default=S,C&&C.set(S,F),F}function u(S){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(S)}function c(){return c=Object.assign||function(S){for(var C=1;C<arguments.length;C++){var F=arguments[C];for(var T in F)Object.prototype.hasOwnProperty.call(F,T)&&(S[T]=F[T])}return S},c.apply(this,arguments)}function d(S,C){if(!(S instanceof C))throw new TypeError("Cannot call a class as a function")}function g(S,C){for(var F=0;F<C.length;F++){var T=C[F];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}function h(S,C,F){return C&&g(S.prototype,C),S}function p(S,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(C&&C.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),C&&m(S,C)}function m(S,C){return m=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},m(S,C)}function y(S){var C=k();return function(){var T=E(S),x;if(C){var D=E(this).constructor;x=Reflect.construct(T,arguments,D)}else x=T.apply(this,arguments);return v(this,x)}}function v(S,C){return C&&(u(C)==="object"||typeof C=="function")?C:b(S)}function b(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function k(){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(S){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},E(S)}function M(S,C,F){return C in S?Object.defineProperty(S,C,{value:F,enumerable:!0,configurable:!0,writable:!0}):S[C]=F,S}var I=function(C){return C.hasOwnProperty("key")},P=function(S){p(F,S);var C=y(F);function F(T){var x;return d(this,F),x=C.call(this,T),M(b(x),"itemsWrapperRef",void 0),M(b(x),"itemsListRef",void 0),M(b(x),"thumbsRef",void 0),M(b(x),"setItemsWrapperRef",function(D){x.itemsWrapperRef=D}),M(b(x),"setItemsListRef",function(D){x.itemsListRef=D}),M(b(x),"setThumbsRef",function(D,O){x.thumbsRef||(x.thumbsRef=[]),x.thumbsRef[O]=D}),M(b(x),"updateSizes",function(){if(!(!x.props.children||!x.itemsWrapperRef||!x.thumbsRef)){var D=e.Children.count(x.props.children),O=x.itemsWrapperRef.clientWidth,R=x.props.thumbWidth?x.props.thumbWidth:(0,n.outerWidth)(x.thumbsRef[0]),N=Math.floor(O/R),W=N<D,j=W?D-N:0;x.setState(function(oe,Q){return{itemSize:R,visibleItems:N,firstItem:W?x.getFirstItem(Q.selectedItem):0,lastPosition:j,showArrows:W}})}}),M(b(x),"handleClickItem",function(D,O,R){if(!I(R)||R.key==="Enter"){var N=x.props.onSelectItem;typeof N=="function"&&N(D,O)}}),M(b(x),"onSwipeStart",function(){x.setState({swiping:!0})}),M(b(x),"onSwipeEnd",function(){x.setState({swiping:!1})}),M(b(x),"onSwipeMove",function(D){var O=D.x;if(!x.state.itemSize||!x.itemsWrapperRef||!x.state.visibleItems)return!1;var R=0,N=e.Children.count(x.props.children),W=-(x.state.firstItem*100)/x.state.visibleItems,j=Math.max(N-x.state.visibleItems,0),oe=-j*100/x.state.visibleItems;W===R&&O>0&&(O=0),W===oe&&O<0&&(O=0);var Q=x.itemsWrapperRef.clientWidth,re=W+100/(Q/O);return x.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ue){x.itemsListRef.style[ue]=(0,r.default)(re,"%",x.props.axis)}),!0}),M(b(x),"slideRight",function(D){x.moveTo(x.state.firstItem-(typeof D=="number"?D:1))}),M(b(x),"slideLeft",function(D){x.moveTo(x.state.firstItem+(typeof D=="number"?D:1))}),M(b(x),"moveTo",function(D){D=D<0?0:D,D=D>=x.state.lastPosition?x.state.lastPosition:D,x.setState({firstItem:D})}),x.state={selectedItem:T.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},x}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(x){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==x.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(x){var D=x;return x>=this.state.lastPosition&&(D=this.state.lastPosition),x<this.state.firstItem+this.state.visibleItems&&(D=this.state.firstItem),x<this.state.firstItem&&(D=x),D}},{key:"renderItems",value:function(){var x=this;return this.props.children.map(function(D,O){var R=t.default.ITEM(!1,O===x.state.selectedItem),N={key:O,ref:function(j){return x.setThumbsRef(j,O)},className:R,onClick:x.handleClickItem.bind(x,O,x.props.children[O]),onKeyDown:x.handleClickItem.bind(x,O,x.props.children[O]),"aria-label":"".concat(x.props.labels.item," ").concat(O+1),style:{width:x.props.thumbWidth}};return e.default.createElement("li",c({},N,{role:"button",tabIndex:0}),D)})}},{key:"render",value:function(){var x=this;if(!this.props.children)return null;var D=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,R=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,N={},W=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(W,"px",this.props.axis),oe=this.props.transitionTime+"ms";return N={WebkitTransform:j,MozTransform:j,MsTransform:j,OTransform:j,transform:j,msTransform:j,WebkitTransitionDuration:oe,MozTransitionDuration:oe,MsTransitionDuration:oe,OTransitionDuration:oe,transitionDuration:oe,msTransitionDuration:oe},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!O),onClick:function(){return x.slideRight()},"aria-label":this.props.labels.leftArrow}),D?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:N,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(re){return x.setItemsListRef(re)},style:N},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!R),onClick:function(){return x.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Yi.default=P,M(P,"displayName","Thumbs"),M(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Yi}var Zi={},qs;function op(){if(qs)return Zi;qs=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.default=void 0;var e=function(){return document};return Zi.default=e,Zi}var An={},Ks;function $c(){if(Ks)return An;Ks=1,Object.defineProperty(An,"__esModule",{value:!0}),An.setPosition=An.getPosition=An.isKeyboardEvent=An.defaultStatusFormatter=An.noop=void 0;var e=yo(),t=n(zl());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};An.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};An.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};An.isKeyboardEvent=o;var l=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};An.getPosition=l;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return An.setPosition=a,An}var Yn={},Zs;function ap(){if(Zs)return Yn;Zs=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.fadeAnimationHandler=Yn.slideStopSwipingHandler=Yn.slideSwipeAnimationHandler=Yn.slideAnimationHandler=void 0;var e=yo(),t=r(zl()),n=$c();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(d,m).enumerable})),h.push.apply(h,p)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(p){l(d,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(p){Object.defineProperty(d,p,Object.getOwnPropertyDescriptor(h,p))})}return d}function l(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var p={},m=h.selectedItem,y=m,v=e.Children.count(g.children)-1,b=g.infiniteLoop&&(m<0||m>v);if(b)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?p.itemListStyle=(0,n.setPosition)(-(v+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):p.itemListStyle=(0,n.setPosition)(-(v+2)*100,g.axis):y>v&&(p.itemListStyle=(0,n.setPosition)(0,g.axis)),p;var k=(0,n.getPosition)(m,g),E=(0,t.default)(k,"%",g.axis),M=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:E,msTransform:E,OTransform:E,transform:E},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:M,MozTransitionDuration:M,OTransitionDuration:M,transitionDuration:M,msTransitionDuration:M})),p};Yn.slideAnimationHandler=a;var s=function(g,h,p,m){var y={},v=h.axis==="horizontal",b=e.Children.count(h.children),k=0,E=(0,n.getPosition)(p.selectedItem,h),M=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),I=v?g.x:g.y,P=I;E===k&&I>0&&(P=0),E===M&&I<0&&(P=0);var S=E+100/(p.itemSize/P),C=Math.abs(I)>h.swipeScrollTolerance;return h.infiniteLoop&&C&&(p.selectedItem===0&&S>-100?S-=b*100:p.selectedItem===b-1&&S<-b*100&&(S+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||C||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(S,h.axis)),C&&!p.cancelClick&&m({cancelClick:!0}),y};Yn.slideSwipeAnimationHandler=s;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Yn.slideStopSwipingHandler=u;var c=function(g,h){var p=g.transitionTime+"ms",m="ease-in-out",y={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:m,msTransitionTimingFunction:m,MozTransitionTimingFunction:m,WebkitTransitionTimingFunction:m,OTransitionTimingFunction:m};return h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:p,MozTransitionDuration:p,OTransitionDuration:p,transitionDuration:p,msTransitionDuration:p})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return Yn.fadeAnimationHandler=c,Yn}var Js;function lp(){if(Js)return Gi;Js=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var e=c(yo()),t=s(_c()),n=s(Hc()),r=s(Vc()),i=s(op()),o=s(zc()),l=$c(),a=ap();function s(T){return T&&T.__esModule?T:{default:T}}function u(){if(typeof WeakMap!="function")return null;var T=new WeakMap;return u=function(){return T},T}function c(T){if(T&&T.__esModule)return T;if(T===null||d(T)!=="object"&&typeof T!="function")return{default:T};var x=u();if(x&&x.has(T))return x.get(T);var D={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in T)if(Object.prototype.hasOwnProperty.call(T,R)){var N=O?Object.getOwnPropertyDescriptor(T,R):null;N&&(N.get||N.set)?Object.defineProperty(D,R,N):D[R]=T[R]}return D.default=T,x&&x.set(T,D),D}function d(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(D){return typeof D}:d=function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},d(T)}function g(){return g=Object.assign||function(T){for(var x=1;x<arguments.length;x++){var D=arguments[x];for(var O in D)Object.prototype.hasOwnProperty.call(D,O)&&(T[O]=D[O])}return T},g.apply(this,arguments)}function h(T,x){var D=Object.keys(T);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(T);x&&(O=O.filter(function(R){return Object.getOwnPropertyDescriptor(T,R).enumerable})),D.push.apply(D,O)}return D}function p(T){for(var x=1;x<arguments.length;x++){var D=arguments[x]!=null?arguments[x]:{};x%2?h(Object(D),!0).forEach(function(O){C(T,O,D[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(D)):h(Object(D)).forEach(function(O){Object.defineProperty(T,O,Object.getOwnPropertyDescriptor(D,O))})}return T}function m(T,x){if(!(T instanceof x))throw new TypeError("Cannot call a class as a function")}function y(T,x){for(var D=0;D<x.length;D++){var O=x[D];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(T,O.key,O)}}function v(T,x,D){return x&&y(T.prototype,x),T}function b(T,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(x&&x.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),x&&k(T,x)}function k(T,x){return k=Object.setPrototypeOf||function(O,R){return O.__proto__=R,O},k(T,x)}function E(T){var x=P();return function(){var O=S(T),R;if(x){var N=S(this).constructor;R=Reflect.construct(O,arguments,N)}else R=O.apply(this,arguments);return M(this,R)}}function M(T,x){return x&&(d(x)==="object"||typeof x=="function")?x:I(T)}function I(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(T){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(D){return D.__proto__||Object.getPrototypeOf(D)},S(T)}function C(T,x,D){return x in T?Object.defineProperty(T,x,{value:D,enumerable:!0,configurable:!0,writable:!0}):T[x]=D,T}var F=function(T){b(D,T);var x=E(D);function D(O){var R;m(this,D),R=x.call(this,O),C(I(R),"thumbsRef",void 0),C(I(R),"carouselWrapperRef",void 0),C(I(R),"listRef",void 0),C(I(R),"itemsRef",void 0),C(I(R),"timer",void 0),C(I(R),"animationHandler",void 0),C(I(R),"setThumbsRef",function(W){R.thumbsRef=W}),C(I(R),"setCarouselWrapperRef",function(W){R.carouselWrapperRef=W}),C(I(R),"setListRef",function(W){R.listRef=W}),C(I(R),"setItemsRef",function(W,j){R.itemsRef||(R.itemsRef=[]),R.itemsRef[j]=W}),C(I(R),"autoPlay",function(){e.Children.count(R.props.children)<=1||(R.clearAutoPlay(),R.props.autoPlay&&(R.timer=setTimeout(function(){R.increment()},R.props.interval)))}),C(I(R),"clearAutoPlay",function(){R.timer&&clearTimeout(R.timer)}),C(I(R),"resetAutoPlay",function(){R.clearAutoPlay(),R.autoPlay()}),C(I(R),"stopOnHover",function(){R.setState({isMouseEntered:!0},R.clearAutoPlay)}),C(I(R),"startOnLeave",function(){R.setState({isMouseEntered:!1},R.autoPlay)}),C(I(R),"isFocusWithinTheCarousel",function(){return R.carouselWrapperRef?!!((0,i.default)().activeElement===R.carouselWrapperRef||R.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),C(I(R),"navigateWithKeyboard",function(W){if(R.isFocusWithinTheCarousel()){var j=R.props.axis,oe=j==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},re=oe?Q.ArrowRight:Q.ArrowDown,ue=oe?Q.ArrowLeft:Q.ArrowUp;re===W.keyCode?R.increment():ue===W.keyCode&&R.decrement()}}),C(I(R),"updateSizes",function(){if(!(!R.state.initialized||!R.itemsRef||R.itemsRef.length===0)){var W=R.props.axis==="horizontal",j=R.itemsRef[0];if(j){var oe=W?j.clientWidth:j.clientHeight;R.setState({itemSize:oe}),R.thumbsRef&&R.thumbsRef.updateSizes()}}}),C(I(R),"setMountState",function(){R.setState({hasMount:!0}),R.updateSizes()}),C(I(R),"handleClickItem",function(W,j){if(e.Children.count(R.props.children)!==0){if(R.state.cancelClick){R.setState({cancelClick:!1});return}R.props.onClickItem(W,j),W!==R.state.selectedItem&&R.setState({selectedItem:W})}}),C(I(R),"handleOnChange",function(W,j){e.Children.count(R.props.children)<=1||R.props.onChange(W,j)}),C(I(R),"handleClickThumb",function(W,j){R.props.onClickThumb(W,j),R.moveTo(W)}),C(I(R),"onSwipeStart",function(W){R.setState({swiping:!0}),R.props.onSwipeStart(W)}),C(I(R),"onSwipeEnd",function(W){R.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),R.props.onSwipeEnd(W),R.clearAutoPlay(),R.state.autoPlay&&R.autoPlay()}),C(I(R),"onSwipeMove",function(W,j){R.props.onSwipeMove(j);var oe=R.props.swipeAnimationHandler(W,R.props,R.state,R.setState.bind(I(R)));return R.setState(p({},oe)),!!Object.keys(oe).length}),C(I(R),"decrement",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;R.moveTo(R.state.selectedItem-(typeof W=="number"?W:1))}),C(I(R),"increment",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;R.moveTo(R.state.selectedItem+(typeof W=="number"?W:1))}),C(I(R),"moveTo",function(W){if(typeof W=="number"){var j=e.Children.count(R.props.children)-1;W<0&&(W=R.props.infiniteLoop?j:0),W>j&&(W=R.props.infiniteLoop?0:j),R.selectItem({selectedItem:W}),R.state.autoPlay&&R.state.isMouseEntered===!1&&R.resetAutoPlay()}}),C(I(R),"onClickNext",function(){R.increment(1)}),C(I(R),"onClickPrev",function(){R.decrement(1)}),C(I(R),"onSwipeForward",function(){R.increment(1),R.props.emulateTouch&&R.setState({cancelClick:!0})}),C(I(R),"onSwipeBackwards",function(){R.decrement(1),R.props.emulateTouch&&R.setState({cancelClick:!0})}),C(I(R),"changeItem",function(W){return function(j){(!(0,l.isKeyboardEvent)(j)||j.key==="Enter")&&R.moveTo(W)}}),C(I(R),"selectItem",function(W){R.setState(p({previousItem:R.state.selectedItem},W),function(){R.setState(R.animationHandler(R.props,R.state))}),R.handleOnChange(W.selectedItem,e.Children.toArray(R.props.children)[W.selectedItem])}),C(I(R),"getInitialImage",function(){var W=R.props.selectedItem,j=R.itemsRef&&R.itemsRef[W],oe=j&&j.getElementsByTagName("img")||[];return oe[0]}),C(I(R),"getVariableItemHeight",function(W){var j=R.itemsRef&&R.itemsRef[W];if(R.state.hasMount&&j&&j.children.length){var oe=j.children[0].getElementsByTagName("img")||[];if(oe.length>0){var Q=oe[0];if(!Q.complete){var re=function de(){R.forceUpdate(),Q.removeEventListener("load",de)};Q.addEventListener("load",re)}}var ue=oe[0]||j.children[0],ae=ue.clientHeight;return ae>0?ae:null}return null});var N={initialized:!1,previousItem:O.selectedItem,selectedItem:O.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:O.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return R.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,R.state=p(p({},N),R.animationHandler(O,N)),R}return v(D,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(R,N){!R.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!R.autoFocus&&this.props.autoFocus&&this.forceFocus(),N.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(R.selectedItem!==this.props.selectedItem||R.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),R.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 R=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var N=R.getInitialImage();N&&!N.complete?N.addEventListener("load",R.setMountState):R.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var R=this.carouselWrapperRef;this.props.stopOnHover&&R&&(R.addEventListener("mouseenter",this.stopOnHover),R.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var R=this.carouselWrapperRef;this.props.stopOnHover&&R&&(R.removeEventListener("mouseenter",this.stopOnHover),R.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 R=this.getInitialImage();R&&R.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var R;(R=this.carouselWrapperRef)===null||R===void 0||R.focus()}},{key:"renderItems",value:function(R){var N=this;return this.props.children?e.Children.map(this.props.children,function(W,j){var oe=j===N.state.selectedItem,Q=j===N.state.previousItem,re=oe&&N.state.selectedStyle||Q&&N.state.prevStyle||N.state.slideStyle||{};N.props.centerMode&&N.props.axis==="horizontal"&&(re=p(p({},re),{},{minWidth:N.props.centerSlidePercentage+"%"})),N.state.swiping&&N.state.swipeMovementStarted&&(re=p(p({},re),{},{pointerEvents:"none"}));var ue={ref:function(de){return N.setItemsRef(de,j)},key:"itemKey"+j+(R?"clone":""),className:n.default.ITEM(!0,j===N.state.selectedItem,j===N.state.previousItem),onClick:N.handleClickItem.bind(N,j,W),style:re};return e.default.createElement("li",ue,N.props.renderItem(W,{isSelected:j===N.state.selectedItem,isPrevious:j===N.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var R=this,N=this.props,W=N.showIndicators,j=N.labels,oe=N.renderIndicator,Q=N.children;return W?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(re,ue){return oe&&oe(R.changeItem(ue),ue===R.state.selectedItem,ue,j.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 R=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var N=this.props.swipeable&&e.Children.count(this.props.children)>1,W=this.props.axis==="horizontal",j=this.props.showArrows&&e.Children.count(this.props.children)>1,oe=j&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=j&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,re=this.renderItems(!0),ue=re.shift(),ae=re.pop(),de={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(W){if(de.onSwipeLeft=this.onSwipeForward,de.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var ce=this.getVariableItemHeight(this.state.selectedItem);he.height=ce||"auto"}}else de.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,de.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,de.style=p(p({},de.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,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:he},N?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},de,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ue):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(L){return R.setListRef(L)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ue)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),D}(e.default.Component);return Gi.default=F,C(F,"displayName","Carousel"),C(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(x,D,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!D),onClick:x})},renderArrowNext:function(x,D,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!D),onClick:x})},renderIndicator:function(x,D,O,R){return e.default.createElement("li",{className:n.default.DOT(D),onClick:x,onKeyDown:x,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(R," ").concat(O+1)})},renderItem:function(x){return x},renderThumbs:function(x){var D=e.Children.map(x,function(O){var R=O;if(O.type!=="img"&&(R=e.Children.toArray(O.props.children).find(function(N){return N.type==="img"})),!!R)return R});return D.filter(function(O){return O}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):D},statusFormatter:l.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Gi}var Qs={},eu;function sp(){return eu||(eu=1),Qs}var tu;function up(){return tu||(tu=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(lp()),n=sp(),r=i(Vc());function i(o){return o&&o.__esModule?o:{default:o}}}(Qa)),Qa}var cp=up();function Mn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{o.current?.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:i}),()=>{l.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function kr(e,t){return e===void 0?void 0:t}const dp=Math.PI;function nu(e){return e*dp/180}const Nc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Bc=(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}},Wc=(e,t,n)=>Math.min(e,t-n*2),Uc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Vl=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},fp=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function hp(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const l=f.useRef(Dc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&l.current(()=>e())},t),r}const gp="֑-߿יִ-﷽ﹰ-ﻼ",pp="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",mp=new RegExp("^[^"+pp+"]*["+gp+"]");function $l(e){return mp.test(e)?"rtl":"not-rtl"}let Bo;function wl(){if(typeof document>"u")return 0;if(Bo!==void 0)return Bo;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(),Bo=n-r,Bo}const Wr=Symbol();function vp(e){const t=f.useRef([Wr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const s=t.current[0];s!==Wr&&(a=typeof a=="function"?a(s):a,a===s)||(s!==Wr&&i({}),r(u=>typeof a=="function"?a(s===Wr?u:s):a),t.current[0]=Wr)},[]),l=f.useCallback(()=>{t.current[0]=Wr,i({})},[]);return[t.current[0]===Wr?n:t.current[0],o,l]}function Gc(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 bp(e){const t=f.useRef(e);return Di(e,t.current)||(t.current=e),t.current}const wp=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const l=o.length>1;return f.createElement(np,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(cp.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},o.map(a=>{const s=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Vl,null)))};function Xc(){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 Zr=Xc();function yp(e){Zr=e}const Yc=/[&<>"']/,Cp=new RegExp(Yc.source,"g"),jc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Sp=new RegExp(jc.source,"g"),xp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ru=e=>xp[e];function yn(e,t){if(t){if(Yc.test(e))return e.replace(Cp,ru)}else if(jc.test(e))return e.replace(Sp,ru);return e}const kp=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function qc(e){return e.replace(kp,(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 Mp=/(^|[^\[])\^/g;function At(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Mp,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const Rp=/[^\w:]/g,Ip=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(qc(n)).replace(Rp,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Ip.test(n)&&(n=Op(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Wo={},Ep=/^[^:]+:\/*[^/]*$/,Tp=/^([^:]+:)[\s\S]*$/,Dp=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Op(e,t){Wo[" "+e]||(Ep.test(e)?Wo[" "+e]=e+"/":Wo[" "+e]=ea(e,"/",!0)),e=Wo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Tp,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Dp,"$1")+t:e+t}const ua={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,l,a)=>{let s=!1,u=l;for(;--u>=0&&a[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 ea(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 Pp(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 Lp(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function lu(e,t,n,r){const i=t.href,o=t.title?yn(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:yn(l)}}function Fp(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.vnwILR0p.js","./index.3bHSf9gi.js","../css/index.BpABIXK9.css","./withFullScreenWrapper.CWEBbO_P.js","./Toolbar.0YdWjZhn.js","./FormClearHelper.DyYuMYyM.js","./moment.C3j7ZXd7.js","./pandasStylerUtils.PlmC_Sod.js","./_baseIndexOf.BTknn6Gb.js","./sprintf.D7DtBTRn.js","./index.8HslT92O.js","./main.zgyqwsPV.js","./throttle.SbSFuU2P.js","./checkbox.YeQ8t-PZ.js","./createDownloadLinkElement.ZaXNnPK4.js","./toConsumableArray.DmYuqCFN.js","./possibleConstructorReturn.D2vivPxX.js","./createSuper.CXzRWZIx.js","./FileDownload.esm.DllwCvQc.js","./_arrayIncludes.B19Iyn2B.js","./number-overlay-editor.Bp2-OIVN.js","./es6.D6UMoOIM.js"])))=>i.map(i=>d[i]);
2
+ import{ar as Ya,d4 as uh,d5 as ch,cK as wc,d6 as dh,d7 as fh,d8 as hh,d9 as gh,da as ph,db as mh,dc as ja,dd as yc,aN as vh,aO as bh,r as f,E as Ll,_ as $e,de as wh,al as yo,bz as yh,df as Ch,aB as $t,dg as Sh,K as Ir,dh as Ls,aL as Fl,H as xh,e as Le,bA as Cc,n as at,di as kh,j as Ne,dj as Mh,x as Jn,aI as tn,bl as Rh,ad as Ih,dk as Eh,dl as Th,k as Co,t as Xr,aM as Dh,dm as Oh,dn as Ph,dp as Sc,cc as Lh,ca as Fh,dq as xc,dr as Ah,ds as _h,c9 as kc,cd as Hh,dt as zh,c8 as Vh,du as $h,bj as Nh,bk as Bh,cf as Wh,dv as Uh,M as Gh,dw as Xh,cg as Yh,dx as jh,N as qh,g as Kr,J as nn,Q as Al,cW as Kh,cU as ro,dy as lr,dz as _e,br as Zh,aj as Mc,dA as Rc,a4 as Jh,dB as Qh,dC as eg,bn as qa,a0 as Ic,aw as Sa,dD as Ec,l as wn,Z as jn,cx as xa,V as tg,cz as Tc,dE as ng,S as rg,R as Fs,dF as ig,dG as og,f as ag,L as lg,dH as sg,dI as As}from"./index.3bHSf9gi.js";import{w as ug,E as cg}from"./withFullScreenWrapper.CWEBbO_P.js";import{T as dg,a as yi}from"./Toolbar.0YdWjZhn.js";import{u as fg}from"./FormClearHelper.DyYuMYyM.js";import{h as Gr}from"./moment.C3j7ZXd7.js";import{r as hg,n as io,m as _s,f as bl,c as gg,a as pg}from"./pandasStylerUtils.PlmC_Sod.js";import{s as mg}from"./sprintf.D7DtBTRn.js";import{l as Ka}from"./index.8HslT92O.js";import{R as vg}from"./main.zgyqwsPV.js";import{d as Dc,t as bg}from"./throttle.SbSFuU2P.js";import{L as wg,a as yg,S as Cg}from"./checkbox.YeQ8t-PZ.js";import{c as Sg}from"./createDownloadLinkElement.ZaXNnPK4.js";import{_ as fr,a as Ei,C as xg}from"./toConsumableArray.DmYuqCFN.js";import{d as kg,f as Mg,e as Rg}from"./possibleConstructorReturn.D2vivPxX.js";import{_ as Ig}from"./createSuper.CXzRWZIx.js";import{D as Eg,F as Tg}from"./FileDownload.esm.DllwCvQc.js";import{a as Dg}from"./_arrayIncludes.B19Iyn2B.js";function Og(){}function Pg(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Nn(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Ya(n),n=n===n?n:0),t!==void 0&&(t=Ya(t),t=t===t?t:0),Pg(Ya(e),t,n)}var Lg=Object.prototype,Fg=Lg.hasOwnProperty;function Ag(e,t){return e!=null&&Fg.call(e,t)}function _g(e,t){return e!=null&&uh(e,t,Ag)}var Hg="[object Map]",zg="[object Set]",Vg=Object.prototype,$g=Vg.hasOwnProperty;function Ng(e){if(e==null)return!0;if(ch(e)&&(wc(e)||typeof e=="string"||typeof e.splice=="function"||dh(e)||fh(e)||hh(e)))return!e.length;var t=gh(e);if(t==Hg||t==zg)return!e.size;if(ph(e))return!mh(e).length;for(var n in e)if($g.call(e,n))return!1;return!0}var Bg=1/0,Wg=ja&&1/yc(new ja([,-0]))[1]==Bg?function(e){return new ja(e)}:Og,Ug=200;function Gg(e,t,n){var r=-1,i=Dg,o=e.length,l=!0,a=[],s=a;if(o>=Ug){var u=Wg(e);if(u)return yc(u);l=!1,i=bh,s=new vh}else s=a;e:for(;++r<o;){var c=e[r],d=c;if(c=c!==0?c:0,l&&d===d){for(var g=s.length;g--;)if(s[g]===d)continue e;a.push(c)}else i(s,d,n)||(s!==a&&s.push(d),a.push(c))}return a}function Xg(e){return e&&e.length?Gg(e):[]}var Oc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,$e({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Oc.displayName="Add";var Pc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,$e({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Pc.displayName="Search";var Lc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ll,$e({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Lc.displayName="Visibility";function Fc(e="This should not happen"){throw new Error(e)}function _n(e,t="Assertion failed"){if(!e)return Fc(t)}function fo(e,t){return Fc(t??"Hell froze over")}function Yg(e,t){try{return e()}catch{return t}}const Hs=Object.prototype.hasOwnProperty;function Di(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--&&Di(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Hs.call(e,n)&&++r&&!Hs.call(t,n)||!(n in t)||!Di(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const aa=null,_l=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var zs;(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"})(zs||(zs={}));var la;(function(e){e.Triangle="triangle",e.Dots="dots"})(la||(la={}));function Vo(e){return"width"in e&&typeof e.width=="number"}async function Vs(e){return typeof e=="object"?e:await e()}function Si(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Mi(e){return e.kind===Bn.Marker||e.kind===Bn.NewRow}function xi(e){if(!Si(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:fo(e,"A cell was passed with an invalid kind")}}function jg(e){return _g(e,"editor")}function Hl(e){return!(e.readonly??!1)}var Bn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Bn||(Bn={}));const sa={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function Za(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 $s;class et{items;constructor(t){this.items=t}static create=t=>new et(Za(t));static empty=()=>$s??($s=new et([]));static fromSingleSelection=t=>et.empty().add(t);static fromArray=t=>{if(t.length===0)return et.empty();const n=t.map(i=>[i,i+1]),r=Za(n);return new et(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new et(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Za([...this.items,n]);return new et(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,l]of n.entries()){const[a,s]=l;if(a<=i&&r<=s){const u=[];a<r&&u.push([a,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new et(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var qg=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Ja=wh(function(e){return qg.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Kg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,s]=a.split("_");n[s]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Ns=Kg,Zg=e=>e.toUpperCase()===e,Jg=e=>t=>e.indexOf(t)===-1,Ac=(e,t)=>{const n={};return Object.keys(e).filter(Jg(t)).forEach(r=>{n[r]=e[r]}),n};function Qg(e,t,n){const r=Ac(t,n);if(!e){const i=typeof Ja=="function"?{default:Ja}:Ja;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var ep=(e,t)=>{};function tp(e){let t="";return n=>{const r=(o,l)=>{const{as:a=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Zg(a[0])):n.propsAsIs,c=Qg(u,o,["as","class"]);c.ref=l,c.className=n.atomic?Ns(n.class,c.className||s):Ns(c.className||s,n.class);const{vars:d}=n;if(d){const g={};for(const m in d){const y=d[m],v=y[0],b=y[1]||"",k=typeof v=="function"?v(o):v;ep(k,n.name),g[`--${m}`]=`${k}${b}`}const h=c.style||{},p=Object.keys(h);p.length>0&&p.forEach(m=>{g[m]=h[m]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const l=Ac(o,["innerRef"]);return r(l,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var sn=tp;const np=sn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Qa={},Gi={},$o={},No={},Bs;function rp(){return Bs||(Bs=1,function(e){(function(t,n){n(e,yo(),yh())})(No,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=l(n),o=l(r);function l(b){return b&&b.__esModule?b:{default:b}}var a=Object.assign||function(b){for(var k=1;k<arguments.length;k++){var E=arguments[k];for(var M in E)Object.prototype.hasOwnProperty.call(E,M)&&(b[M]=E[M])}return b};function s(b,k){var E={};for(var M in b)k.indexOf(M)>=0||Object.prototype.hasOwnProperty.call(b,M)&&(E[M]=b[M]);return E}function u(b,k){if(!(b instanceof k))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(k,E){for(var M=0;M<E.length;M++){var I=E[M];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(k,I.key,I)}}return function(k,E,M){return E&&b(k.prototype,E),M&&b(k,M),k}}();function d(b,k){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:b}function g(b,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);b.prototype=Object.create(k&&k.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(b,k):b.__proto__=k)}var h=!1;function p(b){h=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?b:b.capture}function y(b){if("touches"in b){var k=b.touches[0],E=k.pageX,M=k.pageY;return{x:E,y:M}}var I=b.screenX,P=b.screenY;return{x:I,y:P}}var v=function(b){g(k,b);function k(){var E;u(this,k);for(var M=arguments.length,I=Array(M),P=0;P<M;P++)I[P]=arguments[P];var S=d(this,(E=k.__proto__||Object.getPrototypeOf(k)).call.apply(E,[this].concat(I)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return c(k,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(M){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(M))}},{key:"_onMouseMove",value:function(M){this.mouseDown&&this._handleSwipeMove(M)}},{key:"_onMouseUp",value:function(M){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(M)}},{key:"_handleSwipeStart",value:function(M){var I=y(M),P=I.x,S=I.y;this.moveStart={x:P,y:S},this.props.onSwipeStart(M)}},{key:"_handleSwipeMove",value:function(M){if(this.moveStart){var I=y(M),P=I.x,S=I.y,C=P-this.moveStart.x,F=S-this.moveStart.y;this.moving=!0;var T=this.props.onSwipeMove({x:C,y:F},M);T&&M.cancelable&&M.preventDefault(),this.movePosition={deltaX:C,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(M){this.props.onSwipeEnd(M);var I=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-I?this.props.onSwipeLeft(1,M):this.movePosition.deltaX>I&&this.props.onSwipeRight(1,M),this.movePosition.deltaY<-I?this.props.onSwipeUp(1,M):this.movePosition.deltaY>I&&this.props.onSwipeDown(1,M)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(M){this.swiper=M,this.props.innerRef(M)}},{key:"render",value:function(){var M=this.props;M.tagName;var I=M.className,P=M.style,S=M.children;M.allowMouseEvents,M.onSwipeUp,M.onSwipeDown,M.onSwipeLeft,M.onSwipeRight,M.onSwipeStart,M.onSwipeMove,M.onSwipeEnd,M.innerRef,M.tolerance;var C=s(M,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:I,style:P},C),S)}}]),k}(n.Component);v.displayName="ReactSwipe",v.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},v.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=v})}(No)),No}var Ws;function _c(){return Ws||(Ws=1,function(e){(function(t,n){n(e,rp())})($o,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})}($o)),$o}var Xi={},Us;function Hc(){if(Us)return Xi;Us=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.default=void 0;var e=t(Ch());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,l){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":l==="horizontal","axis-vertical":l!=="horizontal"})},SLIDER:function(o,l){return(0,e.default)({thumbs:!o,slider:o,animated:!l})},ITEM:function(o,l,a){return(0,e.default)({thumb:!o,slide:o,selected:l,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Xi.default=r,Xi}var Yi={},ji={},Gs;function ip(){if(Gs)return ji;Gs=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return ji.outerWidth=e,ji}var qi={},Xs;function zl(){if(Xs)return qi;Xs=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,l=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",s="("+l.join(",")+")";return a+s};return qi.default=e,qi}var Ki={},Ys;function zc(){if(Ys)return Ki;Ys=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var e=function(){return window};return Ki.default=e,Ki}var js;function Vc(){if(js)return Yi;js=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=s(yo()),t=l(Hc()),n=ip(),r=l(zl()),i=l(_c()),o=l(zc());function l(S){return S&&S.__esModule?S:{default:S}}function a(){if(typeof WeakMap!="function")return null;var S=new WeakMap;return a=function(){return S},S}function s(S){if(S&&S.__esModule)return S;if(S===null||u(S)!=="object"&&typeof S!="function")return{default:S};var C=a();if(C&&C.has(S))return C.get(S);var F={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in S)if(Object.prototype.hasOwnProperty.call(S,x)){var D=T?Object.getOwnPropertyDescriptor(S,x):null;D&&(D.get||D.set)?Object.defineProperty(F,x,D):F[x]=S[x]}return F.default=S,C&&C.set(S,F),F}function u(S){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(S)}function c(){return c=Object.assign||function(S){for(var C=1;C<arguments.length;C++){var F=arguments[C];for(var T in F)Object.prototype.hasOwnProperty.call(F,T)&&(S[T]=F[T])}return S},c.apply(this,arguments)}function d(S,C){if(!(S instanceof C))throw new TypeError("Cannot call a class as a function")}function g(S,C){for(var F=0;F<C.length;F++){var T=C[F];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}function h(S,C,F){return C&&g(S.prototype,C),S}function p(S,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(C&&C.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),C&&m(S,C)}function m(S,C){return m=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},m(S,C)}function y(S){var C=k();return function(){var T=E(S),x;if(C){var D=E(this).constructor;x=Reflect.construct(T,arguments,D)}else x=T.apply(this,arguments);return v(this,x)}}function v(S,C){return C&&(u(C)==="object"||typeof C=="function")?C:b(S)}function b(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function k(){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(S){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},E(S)}function M(S,C,F){return C in S?Object.defineProperty(S,C,{value:F,enumerable:!0,configurable:!0,writable:!0}):S[C]=F,S}var I=function(C){return C.hasOwnProperty("key")},P=function(S){p(F,S);var C=y(F);function F(T){var x;return d(this,F),x=C.call(this,T),M(b(x),"itemsWrapperRef",void 0),M(b(x),"itemsListRef",void 0),M(b(x),"thumbsRef",void 0),M(b(x),"setItemsWrapperRef",function(D){x.itemsWrapperRef=D}),M(b(x),"setItemsListRef",function(D){x.itemsListRef=D}),M(b(x),"setThumbsRef",function(D,O){x.thumbsRef||(x.thumbsRef=[]),x.thumbsRef[O]=D}),M(b(x),"updateSizes",function(){if(!(!x.props.children||!x.itemsWrapperRef||!x.thumbsRef)){var D=e.Children.count(x.props.children),O=x.itemsWrapperRef.clientWidth,R=x.props.thumbWidth?x.props.thumbWidth:(0,n.outerWidth)(x.thumbsRef[0]),N=Math.floor(O/R),W=N<D,j=W?D-N:0;x.setState(function(oe,Q){return{itemSize:R,visibleItems:N,firstItem:W?x.getFirstItem(Q.selectedItem):0,lastPosition:j,showArrows:W}})}}),M(b(x),"handleClickItem",function(D,O,R){if(!I(R)||R.key==="Enter"){var N=x.props.onSelectItem;typeof N=="function"&&N(D,O)}}),M(b(x),"onSwipeStart",function(){x.setState({swiping:!0})}),M(b(x),"onSwipeEnd",function(){x.setState({swiping:!1})}),M(b(x),"onSwipeMove",function(D){var O=D.x;if(!x.state.itemSize||!x.itemsWrapperRef||!x.state.visibleItems)return!1;var R=0,N=e.Children.count(x.props.children),W=-(x.state.firstItem*100)/x.state.visibleItems,j=Math.max(N-x.state.visibleItems,0),oe=-j*100/x.state.visibleItems;W===R&&O>0&&(O=0),W===oe&&O<0&&(O=0);var Q=x.itemsWrapperRef.clientWidth,re=W+100/(Q/O);return x.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ue){x.itemsListRef.style[ue]=(0,r.default)(re,"%",x.props.axis)}),!0}),M(b(x),"slideRight",function(D){x.moveTo(x.state.firstItem-(typeof D=="number"?D:1))}),M(b(x),"slideLeft",function(D){x.moveTo(x.state.firstItem+(typeof D=="number"?D:1))}),M(b(x),"moveTo",function(D){D=D<0?0:D,D=D>=x.state.lastPosition?x.state.lastPosition:D,x.setState({firstItem:D})}),x.state={selectedItem:T.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},x}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(x){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==x.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(x){var D=x;return x>=this.state.lastPosition&&(D=this.state.lastPosition),x<this.state.firstItem+this.state.visibleItems&&(D=this.state.firstItem),x<this.state.firstItem&&(D=x),D}},{key:"renderItems",value:function(){var x=this;return this.props.children.map(function(D,O){var R=t.default.ITEM(!1,O===x.state.selectedItem),N={key:O,ref:function(j){return x.setThumbsRef(j,O)},className:R,onClick:x.handleClickItem.bind(x,O,x.props.children[O]),onKeyDown:x.handleClickItem.bind(x,O,x.props.children[O]),"aria-label":"".concat(x.props.labels.item," ").concat(O+1),style:{width:x.props.thumbWidth}};return e.default.createElement("li",c({},N,{role:"button",tabIndex:0}),D)})}},{key:"render",value:function(){var x=this;if(!this.props.children)return null;var D=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,R=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,N={},W=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(W,"px",this.props.axis),oe=this.props.transitionTime+"ms";return N={WebkitTransform:j,MozTransform:j,MsTransform:j,OTransform:j,transform:j,msTransform:j,WebkitTransitionDuration:oe,MozTransitionDuration:oe,MsTransitionDuration:oe,OTransitionDuration:oe,transitionDuration:oe,msTransitionDuration:oe},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!O),onClick:function(){return x.slideRight()},"aria-label":this.props.labels.leftArrow}),D?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:N,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(re){return x.setItemsListRef(re)},style:N},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!R),onClick:function(){return x.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Yi.default=P,M(P,"displayName","Thumbs"),M(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Yi}var Zi={},qs;function op(){if(qs)return Zi;qs=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.default=void 0;var e=function(){return document};return Zi.default=e,Zi}var An={},Ks;function $c(){if(Ks)return An;Ks=1,Object.defineProperty(An,"__esModule",{value:!0}),An.setPosition=An.getPosition=An.isKeyboardEvent=An.defaultStatusFormatter=An.noop=void 0;var e=yo(),t=n(zl());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};An.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};An.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};An.isKeyboardEvent=o;var l=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};An.getPosition=l;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return An.setPosition=a,An}var Yn={},Zs;function ap(){if(Zs)return Yn;Zs=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.fadeAnimationHandler=Yn.slideStopSwipingHandler=Yn.slideSwipeAnimationHandler=Yn.slideAnimationHandler=void 0;var e=yo(),t=r(zl()),n=$c();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(d,m).enumerable})),h.push.apply(h,p)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(p){l(d,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(p){Object.defineProperty(d,p,Object.getOwnPropertyDescriptor(h,p))})}return d}function l(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var p={},m=h.selectedItem,y=m,v=e.Children.count(g.children)-1,b=g.infiniteLoop&&(m<0||m>v);if(b)return y<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?p.itemListStyle=(0,n.setPosition)(-(v+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):p.itemListStyle=(0,n.setPosition)(-(v+2)*100,g.axis):y>v&&(p.itemListStyle=(0,n.setPosition)(0,g.axis)),p;var k=(0,n.getPosition)(m,g),E=(0,t.default)(k,"%",g.axis),M=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:E,msTransform:E,OTransform:E,transform:E},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:M,MozTransitionDuration:M,OTransitionDuration:M,transitionDuration:M,msTransitionDuration:M})),p};Yn.slideAnimationHandler=a;var s=function(g,h,p,m){var y={},v=h.axis==="horizontal",b=e.Children.count(h.children),k=0,E=(0,n.getPosition)(p.selectedItem,h),M=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),I=v?g.x:g.y,P=I;E===k&&I>0&&(P=0),E===M&&I<0&&(P=0);var S=E+100/(p.itemSize/P),C=Math.abs(I)>h.swipeScrollTolerance;return h.infiniteLoop&&C&&(p.selectedItem===0&&S>-100?S-=b*100:p.selectedItem===b-1&&S<-b*100&&(S+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||C||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(S,h.axis)),C&&!p.cancelClick&&m({cancelClick:!0}),y};Yn.slideSwipeAnimationHandler=s;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Yn.slideStopSwipingHandler=u;var c=function(g,h){var p=g.transitionTime+"ms",m="ease-in-out",y={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:m,msTransitionTimingFunction:m,MozTransitionTimingFunction:m,WebkitTransitionTimingFunction:m,OTransitionTimingFunction:m};return h.swiping||(y=o(o({},y),{},{WebkitTransitionDuration:p,MozTransitionDuration:p,OTransitionDuration:p,transitionDuration:p,msTransitionDuration:p})),{slideStyle:y,selectedStyle:o(o({},y),{},{opacity:1,position:"relative"}),prevStyle:o({},y)}};return Yn.fadeAnimationHandler=c,Yn}var Js;function lp(){if(Js)return Gi;Js=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var e=c(yo()),t=s(_c()),n=s(Hc()),r=s(Vc()),i=s(op()),o=s(zc()),l=$c(),a=ap();function s(T){return T&&T.__esModule?T:{default:T}}function u(){if(typeof WeakMap!="function")return null;var T=new WeakMap;return u=function(){return T},T}function c(T){if(T&&T.__esModule)return T;if(T===null||d(T)!=="object"&&typeof T!="function")return{default:T};var x=u();if(x&&x.has(T))return x.get(T);var D={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in T)if(Object.prototype.hasOwnProperty.call(T,R)){var N=O?Object.getOwnPropertyDescriptor(T,R):null;N&&(N.get||N.set)?Object.defineProperty(D,R,N):D[R]=T[R]}return D.default=T,x&&x.set(T,D),D}function d(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(D){return typeof D}:d=function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},d(T)}function g(){return g=Object.assign||function(T){for(var x=1;x<arguments.length;x++){var D=arguments[x];for(var O in D)Object.prototype.hasOwnProperty.call(D,O)&&(T[O]=D[O])}return T},g.apply(this,arguments)}function h(T,x){var D=Object.keys(T);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(T);x&&(O=O.filter(function(R){return Object.getOwnPropertyDescriptor(T,R).enumerable})),D.push.apply(D,O)}return D}function p(T){for(var x=1;x<arguments.length;x++){var D=arguments[x]!=null?arguments[x]:{};x%2?h(Object(D),!0).forEach(function(O){C(T,O,D[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(D)):h(Object(D)).forEach(function(O){Object.defineProperty(T,O,Object.getOwnPropertyDescriptor(D,O))})}return T}function m(T,x){if(!(T instanceof x))throw new TypeError("Cannot call a class as a function")}function y(T,x){for(var D=0;D<x.length;D++){var O=x[D];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(T,O.key,O)}}function v(T,x,D){return x&&y(T.prototype,x),T}function b(T,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(x&&x.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),x&&k(T,x)}function k(T,x){return k=Object.setPrototypeOf||function(O,R){return O.__proto__=R,O},k(T,x)}function E(T){var x=P();return function(){var O=S(T),R;if(x){var N=S(this).constructor;R=Reflect.construct(O,arguments,N)}else R=O.apply(this,arguments);return M(this,R)}}function M(T,x){return x&&(d(x)==="object"||typeof x=="function")?x:I(T)}function I(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(T){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(D){return D.__proto__||Object.getPrototypeOf(D)},S(T)}function C(T,x,D){return x in T?Object.defineProperty(T,x,{value:D,enumerable:!0,configurable:!0,writable:!0}):T[x]=D,T}var F=function(T){b(D,T);var x=E(D);function D(O){var R;m(this,D),R=x.call(this,O),C(I(R),"thumbsRef",void 0),C(I(R),"carouselWrapperRef",void 0),C(I(R),"listRef",void 0),C(I(R),"itemsRef",void 0),C(I(R),"timer",void 0),C(I(R),"animationHandler",void 0),C(I(R),"setThumbsRef",function(W){R.thumbsRef=W}),C(I(R),"setCarouselWrapperRef",function(W){R.carouselWrapperRef=W}),C(I(R),"setListRef",function(W){R.listRef=W}),C(I(R),"setItemsRef",function(W,j){R.itemsRef||(R.itemsRef=[]),R.itemsRef[j]=W}),C(I(R),"autoPlay",function(){e.Children.count(R.props.children)<=1||(R.clearAutoPlay(),R.props.autoPlay&&(R.timer=setTimeout(function(){R.increment()},R.props.interval)))}),C(I(R),"clearAutoPlay",function(){R.timer&&clearTimeout(R.timer)}),C(I(R),"resetAutoPlay",function(){R.clearAutoPlay(),R.autoPlay()}),C(I(R),"stopOnHover",function(){R.setState({isMouseEntered:!0},R.clearAutoPlay)}),C(I(R),"startOnLeave",function(){R.setState({isMouseEntered:!1},R.autoPlay)}),C(I(R),"isFocusWithinTheCarousel",function(){return R.carouselWrapperRef?!!((0,i.default)().activeElement===R.carouselWrapperRef||R.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),C(I(R),"navigateWithKeyboard",function(W){if(R.isFocusWithinTheCarousel()){var j=R.props.axis,oe=j==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},re=oe?Q.ArrowRight:Q.ArrowDown,ue=oe?Q.ArrowLeft:Q.ArrowUp;re===W.keyCode?R.increment():ue===W.keyCode&&R.decrement()}}),C(I(R),"updateSizes",function(){if(!(!R.state.initialized||!R.itemsRef||R.itemsRef.length===0)){var W=R.props.axis==="horizontal",j=R.itemsRef[0];if(j){var oe=W?j.clientWidth:j.clientHeight;R.setState({itemSize:oe}),R.thumbsRef&&R.thumbsRef.updateSizes()}}}),C(I(R),"setMountState",function(){R.setState({hasMount:!0}),R.updateSizes()}),C(I(R),"handleClickItem",function(W,j){if(e.Children.count(R.props.children)!==0){if(R.state.cancelClick){R.setState({cancelClick:!1});return}R.props.onClickItem(W,j),W!==R.state.selectedItem&&R.setState({selectedItem:W})}}),C(I(R),"handleOnChange",function(W,j){e.Children.count(R.props.children)<=1||R.props.onChange(W,j)}),C(I(R),"handleClickThumb",function(W,j){R.props.onClickThumb(W,j),R.moveTo(W)}),C(I(R),"onSwipeStart",function(W){R.setState({swiping:!0}),R.props.onSwipeStart(W)}),C(I(R),"onSwipeEnd",function(W){R.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),R.props.onSwipeEnd(W),R.clearAutoPlay(),R.state.autoPlay&&R.autoPlay()}),C(I(R),"onSwipeMove",function(W,j){R.props.onSwipeMove(j);var oe=R.props.swipeAnimationHandler(W,R.props,R.state,R.setState.bind(I(R)));return R.setState(p({},oe)),!!Object.keys(oe).length}),C(I(R),"decrement",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;R.moveTo(R.state.selectedItem-(typeof W=="number"?W:1))}),C(I(R),"increment",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;R.moveTo(R.state.selectedItem+(typeof W=="number"?W:1))}),C(I(R),"moveTo",function(W){if(typeof W=="number"){var j=e.Children.count(R.props.children)-1;W<0&&(W=R.props.infiniteLoop?j:0),W>j&&(W=R.props.infiniteLoop?0:j),R.selectItem({selectedItem:W}),R.state.autoPlay&&R.state.isMouseEntered===!1&&R.resetAutoPlay()}}),C(I(R),"onClickNext",function(){R.increment(1)}),C(I(R),"onClickPrev",function(){R.decrement(1)}),C(I(R),"onSwipeForward",function(){R.increment(1),R.props.emulateTouch&&R.setState({cancelClick:!0})}),C(I(R),"onSwipeBackwards",function(){R.decrement(1),R.props.emulateTouch&&R.setState({cancelClick:!0})}),C(I(R),"changeItem",function(W){return function(j){(!(0,l.isKeyboardEvent)(j)||j.key==="Enter")&&R.moveTo(W)}}),C(I(R),"selectItem",function(W){R.setState(p({previousItem:R.state.selectedItem},W),function(){R.setState(R.animationHandler(R.props,R.state))}),R.handleOnChange(W.selectedItem,e.Children.toArray(R.props.children)[W.selectedItem])}),C(I(R),"getInitialImage",function(){var W=R.props.selectedItem,j=R.itemsRef&&R.itemsRef[W],oe=j&&j.getElementsByTagName("img")||[];return oe[0]}),C(I(R),"getVariableItemHeight",function(W){var j=R.itemsRef&&R.itemsRef[W];if(R.state.hasMount&&j&&j.children.length){var oe=j.children[0].getElementsByTagName("img")||[];if(oe.length>0){var Q=oe[0];if(!Q.complete){var re=function de(){R.forceUpdate(),Q.removeEventListener("load",de)};Q.addEventListener("load",re)}}var ue=oe[0]||j.children[0],ae=ue.clientHeight;return ae>0?ae:null}return null});var N={initialized:!1,previousItem:O.selectedItem,selectedItem:O.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:O.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return R.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,R.state=p(p({},N),R.animationHandler(O,N)),R}return v(D,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(R,N){!R.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!R.autoFocus&&this.props.autoFocus&&this.forceFocus(),N.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(R.selectedItem!==this.props.selectedItem||R.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),R.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 R=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var N=R.getInitialImage();N&&!N.complete?N.addEventListener("load",R.setMountState):R.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var R=this.carouselWrapperRef;this.props.stopOnHover&&R&&(R.addEventListener("mouseenter",this.stopOnHover),R.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var R=this.carouselWrapperRef;this.props.stopOnHover&&R&&(R.removeEventListener("mouseenter",this.stopOnHover),R.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 R=this.getInitialImage();R&&R.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var R;(R=this.carouselWrapperRef)===null||R===void 0||R.focus()}},{key:"renderItems",value:function(R){var N=this;return this.props.children?e.Children.map(this.props.children,function(W,j){var oe=j===N.state.selectedItem,Q=j===N.state.previousItem,re=oe&&N.state.selectedStyle||Q&&N.state.prevStyle||N.state.slideStyle||{};N.props.centerMode&&N.props.axis==="horizontal"&&(re=p(p({},re),{},{minWidth:N.props.centerSlidePercentage+"%"})),N.state.swiping&&N.state.swipeMovementStarted&&(re=p(p({},re),{},{pointerEvents:"none"}));var ue={ref:function(de){return N.setItemsRef(de,j)},key:"itemKey"+j+(R?"clone":""),className:n.default.ITEM(!0,j===N.state.selectedItem,j===N.state.previousItem),onClick:N.handleClickItem.bind(N,j,W),style:re};return e.default.createElement("li",ue,N.props.renderItem(W,{isSelected:j===N.state.selectedItem,isPrevious:j===N.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var R=this,N=this.props,W=N.showIndicators,j=N.labels,oe=N.renderIndicator,Q=N.children;return W?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(re,ue){return oe&&oe(R.changeItem(ue),ue===R.state.selectedItem,ue,j.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 R=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var N=this.props.swipeable&&e.Children.count(this.props.children)>1,W=this.props.axis==="horizontal",j=this.props.showArrows&&e.Children.count(this.props.children)>1,oe=j&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=j&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,re=this.renderItems(!0),ue=re.shift(),ae=re.pop(),de={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(W){if(de.onSwipeLeft=this.onSwipeForward,de.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var ce=this.getVariableItemHeight(this.state.selectedItem);he.height=ce||"auto"}}else de.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,de.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,de.style=p(p({},de.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,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:he},N?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},de,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ue):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(L){return R.setListRef(L)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&ue)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),D}(e.default.Component);return Gi.default=F,C(F,"displayName","Carousel"),C(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(x,D,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!D),onClick:x})},renderArrowNext:function(x,D,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!D),onClick:x})},renderIndicator:function(x,D,O,R){return e.default.createElement("li",{className:n.default.DOT(D),onClick:x,onKeyDown:x,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(R," ").concat(O+1)})},renderItem:function(x){return x},renderThumbs:function(x){var D=e.Children.map(x,function(O){var R=O;if(O.type!=="img"&&(R=e.Children.toArray(O.props.children).find(function(N){return N.type==="img"})),!!R)return R});return D.filter(function(O){return O}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):D},statusFormatter:l.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Gi}var Qs={},eu;function sp(){return eu||(eu=1),Qs}var tu;function up(){return tu||(tu=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(lp()),n=sp(),r=i(Vc());function i(o){return o&&o.__esModule?o:{default:o}}}(Qa)),Qa}var cp=up();function Mn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{o.current?.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:i}),()=>{l.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function kr(e,t){return e===void 0?void 0:t}const dp=Math.PI;function nu(e){return e*dp/180}const Nc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Bc=(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}},Wc=(e,t,n)=>Math.min(e,t-n*2),Uc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Vl=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},fp=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function hp(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const l=f.useRef(Dc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&l.current(()=>e())},t),r}const gp="֑-߿יִ-﷽ﹰ-ﻼ",pp="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",mp=new RegExp("^[^"+pp+"]*["+gp+"]");function $l(e){return mp.test(e)?"rtl":"not-rtl"}let Bo;function wl(){if(typeof document>"u")return 0;if(Bo!==void 0)return Bo;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(),Bo=n-r,Bo}const Wr=Symbol();function vp(e){const t=f.useRef([Wr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const s=t.current[0];s!==Wr&&(a=typeof a=="function"?a(s):a,a===s)||(s!==Wr&&i({}),r(u=>typeof a=="function"?a(s===Wr?u:s):a),t.current[0]=Wr)},[]),l=f.useCallback(()=>{t.current[0]=Wr,i({})},[]);return[t.current[0]===Wr?n:t.current[0],o,l]}function Gc(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 bp(e){const t=f.useRef(e);return Di(e,t.current)||(t.current=e),t.current}const wp=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const l=o.length>1;return f.createElement(np,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(cp.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},o.map(a=>{const s=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Vl,null)))};function Xc(){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 Zr=Xc();function yp(e){Zr=e}const Yc=/[&<>"']/,Cp=new RegExp(Yc.source,"g"),jc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Sp=new RegExp(jc.source,"g"),xp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ru=e=>xp[e];function yn(e,t){if(t){if(Yc.test(e))return e.replace(Cp,ru)}else if(jc.test(e))return e.replace(Sp,ru);return e}const kp=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function qc(e){return e.replace(kp,(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 Mp=/(^|[^\[])\^/g;function At(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Mp,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const Rp=/[^\w:]/g,Ip=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(qc(n)).replace(Rp,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Ip.test(n)&&(n=Op(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Wo={},Ep=/^[^:]+:\/*[^/]*$/,Tp=/^([^:]+:)[\s\S]*$/,Dp=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Op(e,t){Wo[" "+e]||(Ep.test(e)?Wo[" "+e]=e+"/":Wo[" "+e]=ea(e,"/",!0)),e=Wo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Tp,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Dp,"$1")+t:e+t}const ua={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,l,a)=>{let s=!1,u=l;for(;--u>=0&&a[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 ea(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 Pp(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 Lp(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function lu(e,t,n,r){const i=t.href,o=t.title?yn(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:yn(l)}}function Fp(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[l]=o;return l.length>=r.length?i.slice(r.length):i}).join(`
4
4
  `)}class Nl{constructor(t){this.options=t||Zr}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:ea(r,`
5
5
  `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Fp(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=ea(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,l,a,s,u,c,d,g,h,p,m=n[1].trim();const y=m.length>1,v={type:"list",raw:"",ordered:y,start:y?+m.slice(0,-1):"",loose:!1,items:[]};m=y?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=y?m:"[*+-]");const b=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!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,l)),i=l+1,a===`
170
170
  `&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===`
171
171
  `)&&(r.push(ku(e.slice(i,l))),i=l+1,a===`
172
- `&&(n.push(r),r=[])),o=t.None);break}l++}return i<e.length&&r.push(ku(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Mu(e,t,n){const r=W0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),l=(a,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",s)}catch{o(a,s)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?l(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function kd(e){return e!==!0}function Ru(e){return typeof e=="string"?e:`${e}px`}const X0=()=>e=>e.innerWidth,Y0=()=>e=>e.innerHeight,j0=sn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[X0()],"wmyidgi-1":[Y0()]}}),q0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(j0,{innerHeight:Ru(n),innerWidth:Ru(t),...i},r)},K0=2,Z0=1300;function J0(e,t,n){const r=$t.useRef(0),[i,o]=e??[0,0];$t.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let l=!1,a=0;const s=u=>{if(!l){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/Z0);const d=r.current**1.618*c*K0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{l=!0}},[t,i,o,n])}function Q0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:l,remSize:a}){const[s,u,c,d,g,h]=$t.useMemo(()=>{if(!l||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,y=sd();return[typeof m=="number"?m*p:v=>Math.ceil(m(v)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*p},Math.ceil((i??0)*p),Math.ceil((o??0)*p)]},[n,t,i,o,a,e,l,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const xr={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 ot(e,t){return e===!0?t:e===!1?"":e}function Iu(e){const t=da.value;return{activateCell:ot(e.activateCell," |Enter|shift+Enter"),clear:ot(e.clear,"any+Escape"),closeOverlay:ot(e.closeOverlay,"any+Escape"),acceptOverlayDown:ot(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ot(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ot(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ot(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ot(e.delete,t?"Backspace|Delete":"Delete"),downFill:ot(e.downFill,"primary+_68"),scrollToSelectedCell:ot(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ot(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ot(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ot(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ot(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ot(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ot(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ot(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ot(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ot(e.goToFirstCell,"primary+Home"),goToFirstColumn:ot(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ot(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ot(e.goToLastCell,"primary+End"),goToLastColumn:ot(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ot(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ot(e.goToNextPage,"PageDown"),goToPreviousPage:ot(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ot(e.rightFill,"primary+_82"),search:ot(e.search,"primary+f"),selectAll:ot(e.selectAll,"primary+a"),selectColumn:ot(e.selectColumn,"ctrl+ "),selectGrowDown:ot(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ot(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ot(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ot(e.selectGrowUp,"shift+ArrowUp"),selectRow:ot(e.selectRow,"shift+ "),selectToFirstCell:ot(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ot(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ot(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ot(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ot(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ot(e.selectToLastRow,"primary+shift+ArrowDown")}}function ev(e){const t=bp(e);return $t.useMemo(()=>{if(t===void 0)return Iu(xr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??xr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??xr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??xr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??xr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??xr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??xr.selectToLastCell};return Iu({...xr,...n})},[t])}function tv(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const l={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(l.subGroups=r.subGroups.map((a,s)=>t(a,i+1,[...o,s])).sort((a,s)=>a.headerIndex-s.headerIndex)),l}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Kl(e,t){const n=[];function r(a,s,u=!1){let c=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:s;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=tv(e.groups);for(let a=0;a<i.length;a++){const s=a<i.length-1?i[a+1].headerIndex:null;r(i[a],s)}let o=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...u}=a;return u})}function Il(e,t){if(t===void 0||Kl.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function nv(e,t,n,r){const i=$t.useMemo(()=>e===void 0?void 0:Kl(e,t),[e,t]),o=$t.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),l=$t.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=$t.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),s=$t.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=kr(r??e?.themeOverride,$t.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Il(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:u}:{rowHeight:a,rows:l,rowNumberMapper:s,getRowThemeOverride:u}}function rv(e,t){const n=$t.useMemo(()=>e===void 0?void 0:Kl(e,t),[e,t]);return{getRowGroupingForPath:Rd,updateRowGroupingByPath:Md,mapper:$t.useCallback(r=>{if(typeof r=="number")return Il(r,n);const i=Il(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Md(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,l)=>l===r?{...o,...n}:o):e.map((o,l)=>l===r?{...o,subGroups:Md(o.subGroups??[],i,n)}:o)}function Rd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Rd(e[n].subGroups??[],r)}function iv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function ov(e,t,n,r,i){const[o,l]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,o]),[s,u,c]=vp(a),d=f.useRef(i);d.current=i;const g=iv(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(s.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const p=(s.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,p,c,g]),{visibleRegion:s,setVisibleRegion:u,scrollRef:g}}const av=f.lazy(async()=>await Fl(()=>import("./data-grid-overlay-editor.CiTkUy0t.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url));let lv=0;function sv(e){return Xg(Ls(Ls(e).filter(t=>t.span!==void 0).map(t=>Ir((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Go(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Xo={kind:Z.Loading,allowOverlay:!1},Yo={columns:et.empty(),rows:et.empty(),current:void 0},uv=(e,t)=>{const[n,r]=f.useState(Yo),[i,o]=f.useState(),l=f.useRef(null),a=f.useRef(null),[s,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:p,width:m,height:y,columns:v,rows:b,getCellContent:k,onCellClicked:E,onCellActivated:M,onFillPattern:I,onFinishedEditing:P,coercePasteValue:S,drawHeader:C,drawCell:F,editorBloom:T,onHeaderClicked:x,onColumnProposeMove:D,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:R="default",onGroupHeaderClicked:N,onCellContextMenu:W,className:j,onHeaderContextMenu:oe,getCellsForSelection:Q,onGroupHeaderContextMenu:re,onGroupHeaderRenamed:ue,onCellEdited:ae,onCellsEdited:de,onSearchResultsChanged:he,searchResults:ce,onSearchValueChange:H,searchValue:L,onKeyDown:Y,onKeyUp:se,keybindings:le,editOnType:ve=!0,onRowAppended:ge,onColumnAppended:Je,onColumnMoved:ke,validateCell:Pt,highlightRegions:xt,rangeSelect:Oe="rect",columnSelect:te="multi",rowSelect:me="multi",rangeSelectionBlending:we="exclusive",columnSelectionBlending:ne="exclusive",rowSelectionBlending:ye="exclusive",onDelete:Pe,onDragStart:Ee,onMouseMove:st,onPaste:Fe,copyHeaders:Ye=!1,freezeColumns:Te=0,cellActivationBehavior:Re="second-click",rowSelectionMode:He="auto",columnSelectionMode:ht="auto",onHeaderMenuClick:tt,onHeaderIndicatorClick:je,getGroupDetails:gt,rowGrouping:Gt,onSearchClose:Dt,onItemHovered:ct,onSelectionCleared:qt,showSearch:Kt,onVisibleRegionChanged:Dn,gridSelection:It,onGridSelectionChange:pt,minColumnWidth:On=50,maxColumnWidth:Ct=500,maxColumnAutoWidth:un,provideEditor:gn,trailingRowOptions:Ie,freezeTrailingRows:mt=0,allowedFillDirections:Tt="orthogonal",scrollOffsetX:dn,scrollOffsetY:Bt,verticalBorder:rn,onDragOverCell:Pn,onDrop:on,onColumnResize:Zt,onColumnResizeEnd:Ue,onColumnResizeStart:kt,customRenderers:Rn,fillHandle:Lt,experimental:bt,fixedShadowX:Cn,fixedShadowY:er,headerIcons:tr,imageWindowLoader:B,initialSize:ze,isDraggable:Ge,onDragLeave:Ot,onRowMoved:an,overscrollX:fn,overscrollY:In,preventDiagonalScrolling:pn,rightElement:Wt,rightElementProps:En,trapFocus:Sn=!1,smoothScrollX:Li,smoothScrollY:ei,scaleToRem:Pr=!1,rowHeight:Ce=34,headerHeight:wt=36,groupHeaderHeight:_t=wt,theme:zn,isOutsideClick:Tn,renderers:Jt,resizeIndicator:Xt,scrollToActiveCell:hn=!0,drawFocusRing:Wn=!0,portalElementRef:xo}=e,ti=Wn==="no-editor"?i===void 0:Wn,Un=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,xn=Un?.kind??e.rowMarkers??"none",ni=Un?.width??e.rowMarkerWidth,sr=Un?.startIndex??e.rowMarkerStartIndex??1,ri=Un?.theme??e.rowMarkerTheme,pr=Un?.headerTheme,ii=Un?.headerAlwaysVisible,oi=me!=="multi"||Un?.headerDisabled===!0,Lr=Un?.checkboxStyle??"square",mr=Math.max(On,20),ai=Math.max(Ct,mr),Ia=Math.max(un??ai,mr),Fi=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ve,rowNumberMapper:Ai,rowHeight:ko,getRowThemeOverride:Fr}=nv(Gt,b,Ce,h),Ea=f.useMemo(()=>Number.parseFloat(Fi.fontSize),[Fi]),{rowHeight:nr,headerHeight:_i,groupHeaderHeight:Mo,theme:li,overscrollX:Ta,overscrollY:Da}=Q0({groupHeaderHeight:_t,headerHeight:wt,overscrollX:fn,overscrollY:In,remSize:Ea,rowHeight:ko,scaleToRem:Pr,theme:zn}),rr=ev(le),vr=ni??(b>1e4?48:b>1e3?44:b>100?36:32),Ln=xn!=="none",G=Ln?1:0,Ht=Ie!==void 0,ur=Ie?.sticky===!0,[Oa,Ar]=f.useState(!1),Pa=Kt??Oa,si=f.useCallback(()=>{Dt!==void 0?Dt():Ar(!1)},[Dt]),q=f.useMemo(()=>It===void 0?void 0:Go(It,G),[It,G])??n,V=f.useRef();V.current===void 0&&(V.current=new AbortController),f.useEffect(()=>()=>V?.current.abort(),[]);const[ee,xe]=H0(Q,k,G,V.current,Ve),De=f.useCallback((w,_,A)=>{if(Pt===void 0)return!0;const $=[w[0]-G,w[1]];return Pt?.($,_,A)},[G,Pt]),fe=f.useRef(It),pe=f.useCallback((w,_)=>{_&&(w=U0(w,ee,G,R,V.current)),pt!==void 0?(fe.current=Go(w,-G),pt(fe.current)):r(w)},[pt,ee,G,R]),Xe=kr(Zt,f.useCallback((w,_,A,$)=>{Zt?.(v[A-G],_,A-G,$)},[Zt,G,v])),Me=kr(Ue,f.useCallback((w,_,A,$)=>{Ue?.(v[A-G],_,A-G,$)},[Ue,G,v])),Ze=kr(kt,f.useCallback((w,_,A,$)=>{kt?.(v[A-G],_,A-G,$)},[kt,G,v])),vt=kr(C,f.useCallback((w,_)=>C?.({...w,columnIndex:w.columnIndex-G},_)??!1,[C,G])),cn=kr(F,f.useCallback((w,_)=>F?.({...w,col:w.col-G},_)??!1,[F,G])),Ut=f.useCallback(w=>{if(Pe!==void 0){const _=Pe(Go(w,-G));return typeof _=="boolean"?_:Go(_,G)}return!0},[Pe,G]),[Mt,ut,qe]=_0(q,pe,we,ne,ye,Oe,O),dt=f.useMemo(()=>hr(sd(),li),[li]),[zt,ui]=f.useState([0,0,0]),_r=f.useMemo(()=>{if(Jt===void 0)return{};const w={};for(const _ of Jt)w[_.kind]=_;return w},[Jt]),Qt=f.useCallback(w=>w.kind!==Z.Custom?_r[w.kind]:Rn?.find(_=>_.isMatch(w)),[Rn,_r]);let{sizedColumns:ln,nonGrowWidth:Ft}=dm(v,Ve,xe,zt[0]-(G===0?0:vr)-zt[2],mr,Ia,dt,Qt,V.current);xn!=="none"&&(Ft+=vr);const Vn=f.useMemo(()=>ln.some(w=>w.group!==void 0),[ln]),mn=Vn?_i+Mo:_i,ci=q.rows.length,cr=xn==="none"?void 0:ci===0?!1:ci===Ve?!0:void 0,nt=f.useMemo(()=>xn==="none"?ln:[{title:"",width:vr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ri,rowMarker:Lr,rowMarkerChecked:cr,headerRowMarkerTheme:pr,headerRowMarkerAlwaysVisible:ii,headerRowMarkerDisabled:oi},...ln],[xn,ln,vr,ri,Lr,cr,pr,ii,oi]),en=f.useRef({height:1,width:1,x:0,y:0}),Hr=f.useRef(!1),{setVisibleRegion:br,visibleRegion:dr,scrollRef:Vt}=ov(dn,Bt,nr,en,()=>Hr.current=!0);en.current=dr;const Pf=dr.x+G,Ro=dr.y,vn=f.useRef(null),kn=f.useCallback(w=>{w===!0?vn.current?.focus():window.requestAnimationFrame(()=>{vn.current?.focus()})},[]),bn=Ht?Ve+1:Ve,$n=f.useCallback(w=>{const _=G===0?w:w.map($=>({...$,location:[$.location[0]-G,$.location[1]]})),A=de?.(_);if(A!==!0)for(const $ of _)ae?.($.location,$.value);return A},[ae,de,G]),[zr,La]=f.useState(),Io=q.current!==void 0&&q.current.range.width*q.current.range.height>1?q.current.range:void 0,ws=ti?q.current?.cell:void 0,Eo=ws?.[0],To=ws?.[1],Lf=f.useMemo(()=>{if((xt===void 0||xt.length===0)&&(Io??Eo??To??zr)===void 0)return;const w=[];if(xt!==void 0)for(const _ of xt){const A=nt.length-_.range.x-G;A>0&&w.push({color:_.color,range:{..._.range,x:_.range.x+G,width:Math.min(A,_.range.width)},style:_.style})}return zr!==void 0&&w.push({color:qr(dt.accentColor,0),range:zr,style:"dashed"}),Io!==void 0&&w.push({color:qr(dt.accentColor,.5),range:Io,style:"solid-outline"}),Eo!==void 0&&To!==void 0&&w.push({color:dt.accentColor,range:{x:Eo,y:To,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[zr,Io,Eo,To,xt,nt.length,dt.accentColor,G]),ys=f.useRef(nt);ys.current=nt;const Fn=f.useCallback(([w,_],A=!1)=>{const $=Ht&&_===bn-1;if(w===0&&Ln){if($)return Xo;const K=Ai(_);return K===void 0?Xo:{kind:Bn.Marker,allowOverlay:!1,checkboxStyle:Lr,checked:q?.rows.hasIndex(_)===!0,markerKind:xn==="clickable-number"?"number":xn,row:sr+K,drawHandle:an!==void 0,cursor:xn==="clickable-number"?"pointer":void 0}}else if($){const z=w===G?Ie?.hint??"":"",U=ys.current[w];if(U?.trailingRowOptions?.disabled===!0)return Xo;{const J=U?.trailingRowOptions?.hint??z,ie=U?.trailingRowOptions?.addIcon??Ie?.addIcon;return{kind:Bn.NewRow,hint:J,allowOverlay:!1,icon:ie}}}else{const K=w-G;if(A||bt?.strict===!0){const U=en.current,J=U.x>K||K>U.x+U.width||U.y>_||_>U.y+U.height||_>=Ha.current,ie=K===U.extras?.selected?.[0]&&_===U.extras?.selected[1];let Se=!1;if(U.extras?.freezeRegions!==void 0){for(const Rt of U.extras.freezeRegions)if(jr(Rt,K,_)){Se=!0;break}}if(J&&!ie&&!Se)return Xo}let z=k([K,_]);return G!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+G,z.span[1]+G]}),z}},[Ht,bn,Ln,Ai,Lr,q?.rows,xn,sr,an,G,Ie?.hint,Ie?.addIcon,bt?.strict,k]),Fa=f.useCallback(w=>{let _=gt?.(w)??{name:w};return ue!==void 0&&w!==""&&(_={icon:_.icon,name:_.name,overrideTheme:_.overrideTheme,actions:[..._.actions??[],{title:"Rename",icon:"renameIcon",onClick:A=>Va({group:_.name,bounds:A.bounds})}]}),_},[gt,ue]),Do=f.useCallback(w=>{const[_,A]=w.cell,$=nt[_],X=$?.group!==void 0?Fa($.group)?.overrideTheme:void 0,K=$?.themeOverride,z=Fr?.(A);o({...w,theme:hr(dt,X,K,z,w.content.themeOverride)})},[Fr,nt,Fa,dt]),di=f.useCallback((w,_,A)=>{if(q.current===void 0)return;const[$,X]=q.current.cell,K=Fn([$,X]);if(K.kind!==Z.Boolean&&K.allowOverlay){let z=K;if(A!==void 0)switch(z.kind){case Z.Number:{const U=Yg(()=>A==="-"?-0:Number.parseFloat(A),0);z={...z,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:A};break}Do({target:w,content:z,initialValue:A,cell:[$,X],highlight:A===void 0,forceEditMode:A!==void 0,activation:_})}else K.kind===Z.Boolean&&_.inputType==="keyboard"&&K.readonly!==!0&&($n([{location:q.current.cell,value:{...K,data:kd(K.data)}}]),vn.current?.damage([{cell:q.current.cell}]))},[Fn,q,$n,Do]),Cs=f.useCallback((w,_)=>{const A=vn.current?.getBounds(w,_);if(A===void 0||Vt.current===null)return;const $=Fn([w,_]);$.allowOverlay&&Do({target:A,content:$,initialValue:void 0,highlight:!0,cell:[w,_],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Fn,Vt,Do]),Yt=f.useCallback((w,_,A="both",$=0,X=0,K=void 0)=>{if(Vt.current!==null){const z=vn.current,U=a.current,J=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,ie=typeof _!="number"?_.unit==="cell"?_.amount:void 0:_,Se=typeof w!="number"&&w.unit==="px"?w.amount:void 0,Rt=typeof _!="number"&&_.unit==="px"?_.amount:void 0;if(z!==null&&U!==null){let Qe={x:0,y:0,width:0,height:0},Ke=0,ft=0;if((J!==void 0||ie!==void 0)&&(Qe=z.getBounds((J??0)+G,ie??0)??Qe,Qe.width===0||Qe.height===0))return;const rt=U.getBoundingClientRect(),yt=rt.width/U.offsetWidth;if(Se!==void 0&&(Qe={...Qe,x:Se-rt.left-Vt.current.scrollLeft,width:1}),Rt!==void 0&&(Qe={...Qe,y:Rt+rt.top-Vt.current.scrollTop,height:1}),Qe!==void 0){const St={x:Qe.x-$,y:Qe.y-X,width:Qe.width+2*$,height:Qe.height+2*X};let vi=0;for(let Xa=0;Xa<Te;Xa++)vi+=ln[Xa].width;let Wi=0;const Ui=mt+(ur?1:0);Ui>0&&(Wi=Qr(bn,Ui,nr));let or=vi*yt+rt.left+G*vr*yt,bi=rt.right,Br=rt.top+mn*yt,wi=rt.bottom-Wi*yt;const Ho=Qe.width+$*2;switch(K?.hAlign){case"start":bi=or+Ho;break;case"end":or=bi-Ho;break;case"center":or=Math.floor((or+bi)/2)-Ho/2,bi=or+Ho;break}const zo=Qe.height+X*2;switch(K?.vAlign){case"start":wi=Br+zo;break;case"end":Br=wi-zo;break;case"center":Br=Math.floor((Br+wi)/2)-zo/2,wi=Br+zo;break}or>St.x?Ke=St.x-or:bi<St.x+St.width&&(Ke=St.x+St.width-bi),Br>St.y?ft=St.y-Br:wi<St.y+St.height&&(ft=St.y+St.height-wi),A==="vertical"||typeof w=="number"&&w<Te?Ke=0:(A==="horizontal"||typeof _=="number"&&_>=bn-Ui)&&(ft=0),(Ke!==0||ft!==0)&&(yt!==1&&(Ke/=yt,ft/=yt),Vt.current.scrollTo({left:Ke+Vt.current.scrollLeft,top:ft+Vt.current.scrollTop,behavior:K?.behavior??"auto"}))}}}},[G,mt,vr,Vt,mn,Te,ln,bn,ur,nr]),Aa=f.useRef(Cs),_a=f.useRef(k);Aa.current=Cs,_a.current=k;const Ha=f.useRef(Ve);Ha.current=Ve;const Ss=f.useRef(nt.length);Ss.current=nt.length;const wr=f.useCallback(async(w,_=!0,A)=>{if(nt[w]?.trailingRowOptions?.disabled===!0)return;const X=ge?.();let K,z=!0;X!==void 0&&(K=await X,K==="top"&&(z=!1),typeof K=="number"&&(z=!1));let U=0;const J=()=>{if(Ha.current<=Ve){U<500&&window.setTimeout(J,U),U=50+U*2;return}const ie=typeof K=="number"?K:z?Ve:0;_o.current(w-G,ie,"both",0,0,A?{behavior:A}:void 0),Mt({cell:[w,ie],range:{x:w,y:ie,width:1,height:1}},!1,!1,"edit");const Se=_a.current([w-G,ie]);Se.allowOverlay&&xi(Se)&&Se.readonly!==!0&&_&&window.setTimeout(()=>{Aa.current(w,ie)},0)};J()},[nt,ge,G,Ve,Mt]),Oo=f.useCallback(async(w,_=!0)=>{const A=Je?.();let $,X=!0;A!==void 0&&($=await A,$==="left"&&(X=!1),typeof $=="number"&&(X=!1));let K=0;const z=()=>{if(Ss.current<=nt.length){K<500&&window.setTimeout(z,K),K=50+K*2;return}const U=typeof $=="number"?$:X?nt.length:0;Yt(U-G,w),Mt({cell:[U,w],range:{x:U,y:w,width:1,height:1}},!1,!1,"edit");const J=_a.current([U-G,w]);J.allowOverlay&&xi(J)&&J.readonly!==!0&&_&&window.setTimeout(()=>{Aa.current(U,w)},0)};z()},[nt,Je,G,Yt,Mt]),fi=f.useCallback(w=>{const _=ln[w]?.trailingRowOptions?.targetColumn??Ie?.targetColumn;if(typeof _=="number")return _+(Ln?1:0);if(typeof _=="object"){const A=v.indexOf(_);if(A>=0)return A+(Ln?1:0)}},[ln,v,Ln,Ie?.targetColumn]),yr=f.useRef(),hi=f.useRef(),Hi=f.useCallback((w,_)=>{const[A,$]=_;return hr(dt,nt[A]?.themeOverride,Fr?.($),w.themeOverride)},[Fr,nt,dt]),{mapper:Vr}=rv(Gt,b),Gn=Gt?.navigationBehavior,zi=f.useCallback(w=>{const _=da.value?w.metaKey:w.ctrlKey,A=_&&me==="multi",[$,X]=w.location,K=q.columns,z=q.rows,[U,J]=q.current?.cell??[];if(w.kind==="cell"){if(hi.current=void 0,$r.current=[$,X],$===0&&Ln){if(Ht===!0&&X===Ve||xn==="number"||me==="none")return;const ie=Fn(w.location);if(ie.kind!==Bn.Marker)return;if(an!==void 0){const Qe=Qt(ie);_n(Qe?.kind===Bn.Marker);const Ke=Qe?.onClick?.({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Hi(ie,w.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===ie.checked)return}o(void 0),kn();const Se=z.hasIndex(X),Rt=yr.current;if(me==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&Rt!==void 0&&z.hasIndex(Rt)){const Qe=[Math.min(Rt,X),Math.max(Rt,X)+1];A||He==="multi"?ut(void 0,Qe,!0):ut(et.fromSingleSelection(Qe),void 0,A)}else me==="multi"&&(A||w.isTouch||He==="multi")?Se?ut(z.remove(X),void 0,!0):(ut(void 0,X,!0),yr.current=X):Se&&z.length===1?ut(et.empty(),void 0,_):(ut(et.fromSingleSelection(X),void 0,_),yr.current=X)}else if($>=G&&Ht&&X===Ve){const ie=fi($);wr(ie??$)}else if(U!==$||J!==X){const ie=Fn(w.location),Se=Qt(ie);if(Se?.onSelect!==void 0){let Ke=!1;if(Se.onSelect({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ke=!0,theme:Hi(ie,w.location)}),Ke)return}if(Gn==="block"&&Vr(X).isGroupHeader)return;const Rt=ur&&X===Ve,Qe=ur&&q!==void 0&&q.current?.cell[1]===Ve;if((w.shiftKey||w.isLongTouch===!0)&&U!==void 0&&J!==void 0&&q.current!==void 0&&!Qe){if(Rt)return;const Ke=Math.min($,U),ft=Math.max($,U),rt=Math.min(X,J),yt=Math.max(X,J);Mt({...q.current,range:{x:Ke,y:rt,width:ft-Ke+1,height:yt-rt+1}},!0,_,"click"),yr.current=void 0,kn()}else Mt({cell:[$,X],range:{x:$,y:X,width:1,height:1}},!0,_,"click"),yr.current=void 0,o(void 0),kn()}}else if(w.kind==="header")if($r.current=[$,X],o(void 0),Ln&&$===0)yr.current=void 0,hi.current=void 0,!oi&&me==="multi"&&(z.length!==Ve?ut(et.fromSingleSelection([0,Ve]),void 0,_):ut(et.empty(),void 0,_),kn());else{const ie=hi.current;if(te==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&ie!==void 0&&K.hasIndex(ie)){const Se=[Math.min(ie,$),Math.max(ie,$)+1];_||w.isTouch||ht==="multi"?qe(void 0,Se,_):qe(et.fromSingleSelection(Se),void 0,_)}else te==="multi"&&(_||w.isTouch||ht==="multi")?(K.hasIndex($)?qe(K.remove($),void 0,_):qe(void 0,$,_),hi.current=$):te!=="none"&&(K.hasIndex($)?qe(K.remove($),void 0,_):qe(et.fromSingleSelection($),void 0,_),hi.current=$);yr.current=void 0,kn()}else w.kind===qn?$r.current=[$,X]:w.kind===fa&&!w.isMaybeScrollbar&&(pe(Yo,!1),o(void 0),kn(),qt?.(),yr.current=void 0,hi.current=void 0)},[me,te,q,Ln,G,Ht,Ve,xn,Fn,an,kn,He,ht,Qt,Hi,ut,fi,wr,Gn,Vr,ur,Mt,oi,qe,pe,qt]),Vi=f.useRef(!1),$r=f.useRef(),xs=f.useRef(dr),ir=f.useRef(),Ff=f.useCallback(w=>{if(gi.current=!1,xs.current=en.current,w.button!==0&&w.button!==1){ir.current=void 0;return}const _=performance.now();ir.current={button:w.button,time:_,location:w.location},w?.kind==="header"&&(Vi.current=!0);const A=w.kind==="cell"&&w.isFillHandle;!A&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:q,fillHandle:A}),$r.current=void 0,!w.isTouch&&w.button===0&&!A?zi(w):!w.isTouch&&w.button===1&&($r.current=w.location))},[q,zi]),[za,Va]=f.useState(),ks=f.useCallback(w=>{if(w.kind!==qn||te!=="multi")return;const _=da.value?w.metaKey:w.ctrlKey,[A]=w.location,$=q.columns;if(A<G)return;const X=nt[A];let K=A,z=A;for(let U=A-1;U>=G&&go(X.group,nt[U].group);U--)K--;for(let U=A+1;U<nt.length&&go(X.group,nt[U].group);U++)z++;if(kn(),_||w.isTouch||ht==="multi")if($.hasAll([K,z+1])){let U=$;for(let J=K;J<=z;J++)U=U.remove(J);qe(U,void 0,_)}else qe(void 0,[K,z+1],_);else qe(et.fromSingleSelection([K,z+1]),void 0,_)},[te,kn,q.columns,nt,G,qe,ht]),gi=f.useRef(!1),Po=f.useCallback(async w=>{if(ee!==void 0&&Xe!==void 0){const _=en.current.y,A=en.current.height;let $=ee({x:w,y:_,width:1,height:Math.min(A,Ve-_)},V.current.signal);typeof $!="object"&&($=await $());const X=ln[w-G],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=dt.baseFontFull;const U=dd(z,dt,X,0,$,mr,ai,!1,Qt);Xe?.(X,U.width,w,U.width)}}},[ln,ee,ai,dt,mr,Xe,G,Ve,Qt]),[Af,$a]=f.useState(),pi=f.useCallback(async(w,_)=>{const A=w.current?.range;if(A===void 0||ee===void 0||_.current===void 0)return;const $=_.current.range;if(I!==void 0){let U=!1;if(I({fillDestination:{...$,x:$.x-G},patternSource:{...A,x:A.x-G},preventDefault:()=>U=!0}),U)return}let X=ee(A,V.current.signal);typeof X!="object"&&(X=await X());const K=X,z=[];for(let U=0;U<$.width;U++)for(let J=0;J<$.height;J++){const ie=[$.x+U,$.y+J];if(Qc(ie,A))continue;const Se=K[J%A.height][U%A.width];Mi(Se)||!xi(Se)||z.push({location:ie,value:{...Se}})}$n(z),vn.current?.damage(z.map(U=>({cell:U.location})))},[ee,$n,I,G]),Ms=f.useCallback(()=>{if(q.current===void 0||q.current.range.width<=1)return;const w={...q,current:{...q.current,range:{...q.current.range,width:1}}};pi(w,q)},[pi,q]),Rs=f.useCallback(()=>{if(q.current===void 0||q.current.range.height<=1)return;const w={...q,current:{...q.current,range:{...q.current.range,height:1}}};pi(w,q)},[pi,q]),_f=f.useCallback((w,_)=>{const A=s;if(u(void 0),La(void 0),$a(void 0),Vi.current=!1,_)return;if(A?.fillHandle===!0&&q.current!==void 0&&A.previousSelection?.current!==void 0){if(zr===void 0)return;const Se={...q,current:{...q.current,range:md(A.previousSelection.current.range,zr)}};pi(A.previousSelection,Se),pe(Se,!0);return}const[$,X]=w.location,[K,z]=$r.current??[],U=()=>{gi.current=!0},J=Se=>{const Rt=Se.isTouch||K===$&&z===X;if(Rt&&E?.([$-G,X],{...Se,preventDefault:U}),Se.button===1)return!gi.current;if(!gi.current){const Qe=Fn(w.location),Ke=Qt(Qe);if(Ke!==void 0&&Ke.onClick!==void 0&&Rt){const rt=Ke.onClick({...Se,cell:Qe,posX:Se.localEventX,posY:Se.localEventY,bounds:Se.bounds,theme:Hi(Qe,w.location),preventDefault:U});rt!==void 0&&!Mi(rt)&&Si(rt)&&($n([{location:Se.location,value:rt}]),vn.current?.damage([{cell:Se.location}]))}if(gi.current||q.current===void 0)return!1;let ft=!1;switch(Qe.activationBehaviorOverride??Re){case"double-click":case"second-click":{if(A?.previousSelection?.current?.cell===void 0)break;const[rt,yt]=q.current.cell,[St,vi]=A.previousSelection.current.cell;ft=$===rt&&$===St&&X===yt&&X===vi&&(Se.isDoubleClick===!0||Re==="second-click");break}case"single-click":{ft=!0;break}}if(ft){const yt={inputType:"pointer",pointerActivation:Se.isDoubleClick===!0?"double-click":Qe.activationBehaviorOverride??Re,pointerType:Se.isTouch?"touch":"mouse"};return M?.([$-G,X],yt),di(Se.bounds,yt),!0}}return!1},ie=w.location[0]-G;if(w.isTouch){const Se=en.current,Rt=xs.current;if(Se.x!==Rt.x||Se.y!==Rt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&so(q.current?.cell,w.location)){W?.([ie,w.location[1]],{...w,preventDefault:U});return}else if(w.kind==="header"&&q.columns.hasIndex($)){oe?.(ie,{...w,preventDefault:U});return}else if(w.kind===qn){if(ie<0)return;re?.(ie,{...w,preventDefault:U});return}}w.kind==="cell"?J(w)||zi(w):w.kind===qn?N?.(ie,{...w,preventDefault:U}):(w.kind===Mr&&x?.(ie,{...w,preventDefault:U}),zi(w));return}if(w.kind==="header"){if(ie<0)return;w.isEdge?w.isDoubleClick===!0&&Po($):w.button===0&&$===K&&X===z&&x?.(ie,{...w,preventDefault:U})}if(w.kind===qn){if(ie<0)return;w.button===0&&$===K&&X===z&&(N?.(ie,{...w,preventDefault:U}),gi.current||ks(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&J(w),$r.current=void 0},[s,q,G,zr,pi,pe,E,Fn,Qt,Re,Hi,$n,M,di,W,oe,re,zi,N,x,Po,ks]),Hf=f.useCallback(w=>{const _={...w,location:[w.location[0]-G,w.location[1]]};st?.(_),s!==void 0&&w.buttons===0&&(u(void 0),La(void 0),$a(void 0),Vi.current=!1),$a(A=>Vi.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===A?.[0]&&w.scrollEdge[1]===A[1]?A:s===void 0||(ir.current?.location[0]??0)<G?void 0:w.scrollEdge)},[s,st,G]),zf=f.useCallback((w,_)=>{tt?.(w-G,_)},[tt,G]),Vf=f.useCallback((w,_)=>{je?.(w-G,_)},[je,G]),mi=q?.current?.cell,$f=f.useCallback((w,_,A,$,X,K)=>{Hr.current=!1;let z=mi;z!==void 0&&(z=[z[0]-G,z[1]]);const U=Te===0?void 0:{x:0,y:w.y,width:Te,height:w.height},J=[];U!==void 0&&J.push(U),mt>0&&(J.push({x:w.x-G,y:Ve-mt,width:w.width,height:mt}),Te>0&&J.push({x:0,y:Ve-mt,width:Te,height:mt}));const ie={x:w.x-G,y:w.y,width:w.width,height:Ht&&w.y+w.height>=Ve?w.height-1:w.height,tx:X,ty:K,extras:{selected:z,freezeRegion:U,freezeRegions:J}};en.current=ie,br(ie),ui([_,A,$]),Dn?.(ie,ie.tx,ie.ty,ie.extras)},[mi,G,Ht,Ve,Te,mt,br,Dn]),Nf=kr(D,f.useCallback((w,_)=>D?.(w-G,_-G)!==!1,[D,G])),Bf=kr(ke,f.useCallback((w,_)=>{ke?.(w-G,_-G),te!=="none"&&qe(et.fromSingleSelection(_),void 0,!0)},[te,ke,G,qe])),Na=f.useRef(!1),Wf=f.useCallback(w=>{if(w.location[0]===0&&G>0){w.preventDefault();return}Ee?.({...w,location:[w.location[0]-G,w.location[1]]}),w.defaultPrevented()||(Na.current=!0),u(void 0)},[Ee,G]),Uf=f.useCallback(()=>{Na.current=!1},[]),Is=Gt?.selectionBehavior,Lo=f.useCallback(w=>{if(Is!=="block-spanning")return;const{isGroupHeader:_,path:A,groupRows:$}=Vr(w);if(_)return[w,w];const X=A[A.length-1],K=w-X,z=w+$-X-1;return[K,z]},[Vr,Is]),Ba=f.useRef(),Wa=f.useCallback(w=>{if(!Sd(w,Ba.current)&&(Ba.current=w,!(ir?.current?.button!==void 0&&ir.current.button>=1))){if(w.buttons!==0&&s!==void 0&&ir.current?.location[0]===0&&G===1&&me==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(ir.current.location[1])&&q.rows.hasIndex(ir.current.location[1])){const _=Math.min(ir.current.location[1],w.location[1]),A=Math.max(ir.current.location[1],w.location[1])+1;ut(et.fromSingleSelection([_,A]),void 0,!1)}else if(w.buttons!==0&&s!==void 0&&q.current!==void 0&&!Na.current&&!Vi.current&&(Oe==="rect"||Oe==="multi-rect")){const[_,A]=q.current.cell;let[$,X]=w.location;if(X<0&&(X=en.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const K=s.previousSelection.current.range;X=Math.min(X,Ht?Ve-1:Ve);const z=Wm(K,$,X,Tt);La(z)}else{if(Ht&&A===Ve)return;if(Ht&&X===Ve)if(w.kind===fa)X--;else return;$=Math.max($,G);const U=Lo(A);X=U===void 0?X:Nn(X,U[0],U[1]);const J=$-_,ie=X-A,Se={x:J>=0?_:$,y:ie>=0?A:X,width:Math.abs(J)+1,height:Math.abs(ie)+1};Mt({...q.current,range:Se},!0,!1,"drag")}}ct?.({...w,location:[w.location[0]-G,w.location[1]]})}},[s,G,me,q,Oe,ct,ut,Ht,Ve,Tt,Lo,Mt]),Gf=f.useCallback(()=>{const w=Ba.current;if(w===void 0)return;const[_,A]=w.scrollEdge;let[$,X]=w.location;const K=en.current;_===-1?$=K.extras?.freezeRegion?.x??K.x:_===1&&($=K.x+K.width),A===-1?X=Math.max(0,K.y):A===1&&(X=Math.min(Ve-1,K.y+K.height)),$=Nn($,0,nt.length-1),X=Nn(X,0,Ve-1),Wa({...w,location:[$,X]})},[nt.length,Wa,Ve]);J0(Af,Vt,Gf);const Xn=f.useCallback(w=>{if(q.current===void 0)return;const[_,A]=w,[$,X]=q.current.cell,K=q.current.range;let z=K.x,U=K.x+K.width,J=K.y,ie=K.y+K.height;const[Se,Rt]=Lo(X)??[0,Ve-1],Qe=Rt+1;if(A!==0)switch(A){case 2:{ie=Qe,J=X,Yt(0,ie,"vertical");break}case-2:{J=Se,ie=X+1,Yt(0,J,"vertical");break}case 1:{J<X?(J++,Yt(0,J,"vertical")):(ie=Math.min(Qe,ie+1),Yt(0,ie,"vertical"));break}case-1:{ie>X+1?(ie--,Yt(0,ie,"vertical")):(J=Math.max(Se,J-1),Yt(0,J,"vertical"));break}default:fo()}if(_!==0)if(_===2)U=nt.length,z=$,Yt(U-1-G,0,"horizontal");else if(_===-2)z=G,U=$+1,Yt(z-G,0,"horizontal");else{let Ke=[];if(ee!==void 0){const ft=ee({x:z,y:J,width:U-z-G,height:ie-J},V.current.signal);typeof ft=="object"&&(Ke=sv(ft))}if(_===1){let ft=!1;if(z<$){if(Ke.length>0){const rt=Ir(z+1,$+1).find(yt=>!Ke.includes(yt-G));rt!==void 0&&(z=rt,ft=!0)}else z++,ft=!0;ft&&Yt(z,0,"horizontal")}ft||(U=Math.min(nt.length,U+1),Yt(U-1-G,0,"horizontal"))}else if(_===-1){let ft=!1;if(U>$+1){if(Ke.length>0){const rt=Ir(U-1,$,-1).find(yt=>!Ke.includes(yt-G));rt!==void 0&&(U=rt,ft=!0)}else U--,ft=!0;ft&&Yt(U-G,0,"horizontal")}ft||(z=Math.max(G,z-1),Yt(z-G,0,"horizontal"))}else fo()}Mt({cell:q.current.cell,range:{x:z,y:J,width:U-z,height:ie-J}},!0,!1,"keyboard-select")},[ee,Lo,q,nt.length,G,Ve,Yt,Mt]),Ua=f.useRef(hn);Ua.current=hn;const Cr=f.useCallback((w,_,A,$)=>{const X=bn-(A?0:1);w=Nn(w,G,ln.length-1+G),_=Nn(_,0,X);const K=mi?.[0],z=mi?.[1];if(w===K&&_===z)return!1;if($&&q.current!==void 0){const U=[...q.current.rangeStack];(q.current.range.width>1||q.current.range.height>1)&&U.push(q.current.range),pe({...q,current:{cell:[w,_],range:{x:w,y:_,width:1,height:1},rangeStack:U}},!0)}else Mt({cell:[w,_],range:{x:w,y:_,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===_&&(c.current=void 0),Ua.current&&Yt(w-G,_),!0},[bn,G,ln.length,mi,q,Yt,pe,Mt]),Xf=f.useCallback((w,_)=>{i?.cell!==void 0&&w!==void 0&&Si(w)&&($n([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{vn.current?.damage([{cell:i.cell}])})),kn(!0),o(void 0);const[A,$]=_;if(q.current!==void 0&&(A!==0||$!==0)){const X=q.current.cell[1]===bn-1&&w!==void 0,K=q.current.cell[0]===nt.length-1&&w!==void 0;let z=!0;if(X&&$===1&&ge!==void 0){z=!1;const U=q.current.cell[0]+A,J=fi(U);wr(J??U,!1)}if(K&&A===1&&Je!==void 0){z=!1;const U=q.current.cell[1]+$;Oo(U,!1)}z&&Cr(Nn(q.current.cell[0]+A,0,nt.length-1),Nn(q.current.cell[1]+$,0,bn-1),X,!1)}P?.(w,_)},[i?.cell,kn,q,P,$n,bn,Cr,nt.length,wr,Oo,ge,Je,fi]),Yf=f.useMemo(()=>`gdg-overlay-${lv++}`,[]),Nr=f.useCallback(w=>{kn();const _=[];for(let A=w.x;A<w.x+w.width;A++)for(let $=w.y;$<w.y+w.height;$++){const X=k([A-G,$]);if(!X.allowOverlay&&X.kind!==Z.Boolean)continue;let K;if(X.kind===Z.Custom){const z=Qt(X),U=z?.provideEditor?.({...X,location:[A-G,$]});z?.onDelete!==void 0?K=z.onDelete(X):jg(U)&&(K=U?.deletedValue?.(X))}else(Si(X)&&X.allowOverlay||X.kind===Z.Boolean)&&(K=Qt(X)?.onDelete?.(X));K!==void 0&&!Mi(K)&&Si(K)&&_.push({location:[A,$],value:K})}$n(_),vn.current?.damage(_.map(A=>({cell:A.location})))},[kn,k,Qt,$n,G]),$i=i!==void 0,Es=f.useCallback(w=>{const _=()=>{w.stopPropagation(),w.preventDefault()},A={didMatch:!1},{bounds:$}=w,X=q.columns,K=q.rows,z=rr;if(!$i&&it(z.clear,w,A))pe(Yo,!1),qt?.();else if(!$i&&it(z.selectAll,w,A))pe({columns:et.empty(),rows:et.empty(),current:{cell:q.current?.cell??[G,0],range:{x:G,y:0,width:v.length,height:Ve},rangeStack:[]}},!1);else if(it(z.search,w,A))l?.current?.focus({preventScroll:!0}),Ar(!0);else if(it(z.delete,w,A)){const rt=Ut?.(q)??!0;if(rt!==!1){const yt=rt===!0?q:rt;if(yt.current!==void 0){Nr(yt.current.range);for(const St of yt.current.rangeStack)Nr(St)}for(const St of yt.rows)Nr({x:G,y:St,width:v.length,height:1});for(const St of yt.columns)Nr({x:St,y:0,width:1,height:Ve})}}if(A.didMatch)return _(),!0;if(q.current===void 0)return!1;let[U,J]=q.current.cell;const[,ie]=q.current.cell;let Se=!1,Rt=!1;if(it(z.scrollToSelectedCell,w,A))_o.current(U-G,J);else if(te!=="none"&&it(z.selectColumn,w,A))X.hasIndex(U)?qe(X.remove(U),void 0,!0):te==="single"?qe(et.fromSingleSelection(U),void 0,!0):qe(void 0,U,!0);else if(me!=="none"&&it(z.selectRow,w,A))K.hasIndex(J)?ut(K.remove(J),void 0,!0):me==="single"?ut(et.fromSingleSelection(J),void 0,!0):ut(void 0,J,!0);else if(!$i&&$!==void 0&&it(z.activateCell,w,A))if(J===Ve&&Ht)window.setTimeout(()=>{const rt=fi(U);wr(rt??U)},0);else{const rt={inputType:"keyboard",key:w.key};M?.([U-G,J],rt),di($,rt)}else q.current.range.height>1&&it(z.downFill,w,A)?Rs():q.current.range.width>1&&it(z.rightFill,w,A)?Ms():it(z.goToNextPage,w,A)?J+=Math.max(1,en.current.height-4):it(z.goToPreviousPage,w,A)?J-=Math.max(1,en.current.height-4):it(z.goToFirstCell,w,A)?(o(void 0),J=0,U=0):it(z.goToLastCell,w,A)?(o(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):it(z.selectToFirstCell,w,A)?(o(void 0),Xn([-2,-2])):it(z.selectToLastCell,w,A)?(o(void 0),Xn([2,2])):$i?(it(z.closeOverlay,w,A)&&o(void 0),it(z.acceptOverlayDown,w,A)&&(o(void 0),J++),it(z.acceptOverlayUp,w,A)&&(o(void 0),J--),it(z.acceptOverlayLeft,w,A)&&(o(void 0),U--),it(z.acceptOverlayRight,w,A)&&(o(void 0),U++)):(it(z.goDownCell,w,A)?J+=1:it(z.goUpCell,w,A)?J-=1:it(z.goRightCell,w,A)?U+=1:it(z.goLeftCell,w,A)?U-=1:it(z.goDownCellRetainSelection,w,A)?(J+=1,Se=!0):it(z.goUpCellRetainSelection,w,A)?(J-=1,Se=!0):it(z.goRightCellRetainSelection,w,A)?(U+=1,Se=!0):it(z.goLeftCellRetainSelection,w,A)?(U-=1,Se=!0):it(z.goToLastRow,w,A)?J=Ve-1:it(z.goToFirstRow,w,A)?J=Number.MIN_SAFE_INTEGER:it(z.goToLastColumn,w,A)?U=Number.MAX_SAFE_INTEGER:it(z.goToFirstColumn,w,A)?U=Number.MIN_SAFE_INTEGER:(Oe==="rect"||Oe==="multi-rect")&&(it(z.selectGrowDown,w,A)?Xn([0,1]):it(z.selectGrowUp,w,A)?Xn([0,-1]):it(z.selectGrowRight,w,A)?Xn([1,0]):it(z.selectGrowLeft,w,A)?Xn([-1,0]):it(z.selectToLastRow,w,A)?Xn([0,2]):it(z.selectToFirstRow,w,A)?Xn([0,-2]):it(z.selectToLastColumn,w,A)?Xn([2,0]):it(z.selectToFirstColumn,w,A)&&Xn([-2,0])),Rt=A.didMatch);if(Gn!==void 0&&Gn!=="normal"&&J!==ie){const rt=Gn==="skip-up"||Gn==="skip"||Gn==="block",yt=Gn==="skip-down"||Gn==="skip"||Gn==="block",St=J<ie;if(St&&rt){for(;J>=0&&Vr(J).isGroupHeader;)J--;J<0&&(J=ie)}else if(!St&&yt){for(;J<Ve&&Vr(J).isGroupHeader;)J++;J>=Ve&&(J=ie)}}const Ke=Cr(U,J,!1,Se),ft=A.didMatch;return ft&&(Ke||!Rt||Sn)&&_(),ft},[Gn,$i,q,rr,te,me,Oe,G,Vr,Ve,Cr,pe,qt,v.length,Ut,Sn,Nr,qe,ut,Ht,fi,wr,M,di,Rs,Ms,Xn]),Ni=f.useCallback(w=>{let _=!1;if(Y!==void 0&&Y({...w,...w.location&&{location:[w.location[0]-G,w.location[1]]},cancel:()=>{_=!0}}),_||Es(w)||q.current===void 0)return;const[A,$]=q.current.cell,X=en.current;if(ve&&!w.metaKey&&!w.ctrlKey&&q.current!==void 0&&w.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(w.key)&&w.bounds!==void 0&&xi(k([A-G,Math.max(0,Math.min($,Ve-1))]))){if((!Ht||$!==Ve)&&(X.y>$||$>X.y+X.height||X.x>A||A>X.x+X.width))return;const K={inputType:"keyboard",key:w.key};M?.([A-G,$],K),di(w.bounds,K,w.key),w.stopPropagation(),w.preventDefault()}},[ve,Y,Es,q,k,G,Ve,Ht,M,di]),jf=f.useCallback((w,_)=>{const A=w.location[0]-G;if(w.kind==="header"&&oe?.(A,{...w,preventDefault:_}),w.kind===qn){if(A<0)return;re?.(A,{...w,preventDefault:_})}if(w.kind==="cell"){const[$,X]=w.location;W?.([A,X],{...w,preventDefault:_}),qp(q,w.location)||Cr($,X,!1,!1)}},[q,W,re,oe,G,Cr]),Ga=f.useCallback(async w=>{if(!rr.paste)return;function _(z,U,J,ie){const Se=typeof J=="object"?J?.join(`
172
+ `&&(n.push(r),r=[])),o=t.None);break}l++}return i<e.length&&r.push(ku(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Mu(e,t,n){const r=W0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),l=(a,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",s)}catch{o(a,s)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?l(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function kd(e){return e!==!0}function Ru(e){return typeof e=="string"?e:`${e}px`}const X0=()=>e=>e.innerWidth,Y0=()=>e=>e.innerHeight,j0=sn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[X0()],"wmyidgi-1":[Y0()]}}),q0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(j0,{innerHeight:Ru(n),innerWidth:Ru(t),...i},r)},K0=2,Z0=1300;function J0(e,t,n){const r=$t.useRef(0),[i,o]=e??[0,0];$t.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let l=!1,a=0;const s=u=>{if(!l){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/Z0);const d=r.current**1.618*c*K0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{l=!0}},[t,i,o,n])}function Q0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:l,remSize:a}){const[s,u,c,d,g,h]=$t.useMemo(()=>{if(!l||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,y=sd();return[typeof m=="number"?m*p:v=>Math.ceil(m(v)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*p},Math.ceil((i??0)*p),Math.ceil((o??0)*p)]},[n,t,i,o,a,e,l,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const xr={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 ot(e,t){return e===!0?t:e===!1?"":e}function Iu(e){const t=da.value;return{activateCell:ot(e.activateCell," |Enter|shift+Enter"),clear:ot(e.clear,"any+Escape"),closeOverlay:ot(e.closeOverlay,"any+Escape"),acceptOverlayDown:ot(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ot(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ot(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ot(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ot(e.delete,t?"Backspace|Delete":"Delete"),downFill:ot(e.downFill,"primary+_68"),scrollToSelectedCell:ot(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ot(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ot(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ot(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ot(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ot(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ot(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ot(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ot(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ot(e.goToFirstCell,"primary+Home"),goToFirstColumn:ot(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ot(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ot(e.goToLastCell,"primary+End"),goToLastColumn:ot(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ot(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ot(e.goToNextPage,"PageDown"),goToPreviousPage:ot(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ot(e.rightFill,"primary+_82"),search:ot(e.search,"primary+f"),selectAll:ot(e.selectAll,"primary+a"),selectColumn:ot(e.selectColumn,"ctrl+ "),selectGrowDown:ot(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ot(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ot(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ot(e.selectGrowUp,"shift+ArrowUp"),selectRow:ot(e.selectRow,"shift+ "),selectToFirstCell:ot(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ot(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ot(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ot(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ot(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ot(e.selectToLastRow,"primary+shift+ArrowDown")}}function ev(e){const t=bp(e);return $t.useMemo(()=>{if(t===void 0)return Iu(xr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??xr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??xr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??xr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??xr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??xr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??xr.selectToLastCell};return Iu({...xr,...n})},[t])}function tv(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const l={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(l.subGroups=r.subGroups.map((a,s)=>t(a,i+1,[...o,s])).sort((a,s)=>a.headerIndex-s.headerIndex)),l}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Kl(e,t){const n=[];function r(a,s,u=!1){let c=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:s;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=tv(e.groups);for(let a=0;a<i.length;a++){const s=a<i.length-1?i[a+1].headerIndex:null;r(i[a],s)}let o=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...u}=a;return u})}function Il(e,t){if(t===void 0||Kl.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function nv(e,t,n,r){const i=$t.useMemo(()=>e===void 0?void 0:Kl(e,t),[e,t]),o=$t.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),l=$t.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=$t.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),s=$t.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=kr(r??e?.themeOverride,$t.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Il(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:u}:{rowHeight:a,rows:l,rowNumberMapper:s,getRowThemeOverride:u}}function rv(e,t){const n=$t.useMemo(()=>e===void 0?void 0:Kl(e,t),[e,t]);return{getRowGroupingForPath:Rd,updateRowGroupingByPath:Md,mapper:$t.useCallback(r=>{if(typeof r=="number")return Il(r,n);const i=Il(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Md(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,l)=>l===r?{...o,...n}:o):e.map((o,l)=>l===r?{...o,subGroups:Md(o.subGroups??[],i,n)}:o)}function Rd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Rd(e[n].subGroups??[],r)}function iv(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function ov(e,t,n,r,i){const[o,l]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,o]),[s,u,c]=vp(a),d=f.useRef(i);d.current=i;const g=iv(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(s.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const p=(s.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,p,c,g]),{visibleRegion:s,setVisibleRegion:u,scrollRef:g}}const av=f.lazy(async()=>await Fl(()=>import("./data-grid-overlay-editor.vnwILR0p.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url));let lv=0;function sv(e){return Xg(Ls(Ls(e).filter(t=>t.span!==void 0).map(t=>Ir((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Go(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Xo={kind:Z.Loading,allowOverlay:!1},Yo={columns:et.empty(),rows:et.empty(),current:void 0},uv=(e,t)=>{const[n,r]=f.useState(Yo),[i,o]=f.useState(),l=f.useRef(null),a=f.useRef(null),[s,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:p,width:m,height:y,columns:v,rows:b,getCellContent:k,onCellClicked:E,onCellActivated:M,onFillPattern:I,onFinishedEditing:P,coercePasteValue:S,drawHeader:C,drawCell:F,editorBloom:T,onHeaderClicked:x,onColumnProposeMove:D,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:R="default",onGroupHeaderClicked:N,onCellContextMenu:W,className:j,onHeaderContextMenu:oe,getCellsForSelection:Q,onGroupHeaderContextMenu:re,onGroupHeaderRenamed:ue,onCellEdited:ae,onCellsEdited:de,onSearchResultsChanged:he,searchResults:ce,onSearchValueChange:H,searchValue:L,onKeyDown:Y,onKeyUp:se,keybindings:le,editOnType:ve=!0,onRowAppended:ge,onColumnAppended:Je,onColumnMoved:ke,validateCell:Pt,highlightRegions:xt,rangeSelect:Oe="rect",columnSelect:te="multi",rowSelect:me="multi",rangeSelectionBlending:we="exclusive",columnSelectionBlending:ne="exclusive",rowSelectionBlending:ye="exclusive",onDelete:Pe,onDragStart:Ee,onMouseMove:st,onPaste:Fe,copyHeaders:Ye=!1,freezeColumns:Te=0,cellActivationBehavior:Re="second-click",rowSelectionMode:He="auto",columnSelectionMode:ht="auto",onHeaderMenuClick:tt,onHeaderIndicatorClick:je,getGroupDetails:gt,rowGrouping:Gt,onSearchClose:Dt,onItemHovered:ct,onSelectionCleared:qt,showSearch:Kt,onVisibleRegionChanged:Dn,gridSelection:It,onGridSelectionChange:pt,minColumnWidth:On=50,maxColumnWidth:Ct=500,maxColumnAutoWidth:un,provideEditor:gn,trailingRowOptions:Ie,freezeTrailingRows:mt=0,allowedFillDirections:Tt="orthogonal",scrollOffsetX:dn,scrollOffsetY:Bt,verticalBorder:rn,onDragOverCell:Pn,onDrop:on,onColumnResize:Zt,onColumnResizeEnd:Ue,onColumnResizeStart:kt,customRenderers:Rn,fillHandle:Lt,experimental:bt,fixedShadowX:Cn,fixedShadowY:er,headerIcons:tr,imageWindowLoader:B,initialSize:ze,isDraggable:Ge,onDragLeave:Ot,onRowMoved:an,overscrollX:fn,overscrollY:In,preventDiagonalScrolling:pn,rightElement:Wt,rightElementProps:En,trapFocus:Sn=!1,smoothScrollX:Li,smoothScrollY:ei,scaleToRem:Pr=!1,rowHeight:Ce=34,headerHeight:wt=36,groupHeaderHeight:_t=wt,theme:zn,isOutsideClick:Tn,renderers:Jt,resizeIndicator:Xt,scrollToActiveCell:hn=!0,drawFocusRing:Wn=!0,portalElementRef:xo}=e,ti=Wn==="no-editor"?i===void 0:Wn,Un=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,xn=Un?.kind??e.rowMarkers??"none",ni=Un?.width??e.rowMarkerWidth,sr=Un?.startIndex??e.rowMarkerStartIndex??1,ri=Un?.theme??e.rowMarkerTheme,pr=Un?.headerTheme,ii=Un?.headerAlwaysVisible,oi=me!=="multi"||Un?.headerDisabled===!0,Lr=Un?.checkboxStyle??"square",mr=Math.max(On,20),ai=Math.max(Ct,mr),Ia=Math.max(un??ai,mr),Fi=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ve,rowNumberMapper:Ai,rowHeight:ko,getRowThemeOverride:Fr}=nv(Gt,b,Ce,h),Ea=f.useMemo(()=>Number.parseFloat(Fi.fontSize),[Fi]),{rowHeight:nr,headerHeight:_i,groupHeaderHeight:Mo,theme:li,overscrollX:Ta,overscrollY:Da}=Q0({groupHeaderHeight:_t,headerHeight:wt,overscrollX:fn,overscrollY:In,remSize:Ea,rowHeight:ko,scaleToRem:Pr,theme:zn}),rr=ev(le),vr=ni??(b>1e4?48:b>1e3?44:b>100?36:32),Ln=xn!=="none",G=Ln?1:0,Ht=Ie!==void 0,ur=Ie?.sticky===!0,[Oa,Ar]=f.useState(!1),Pa=Kt??Oa,si=f.useCallback(()=>{Dt!==void 0?Dt():Ar(!1)},[Dt]),q=f.useMemo(()=>It===void 0?void 0:Go(It,G),[It,G])??n,V=f.useRef();V.current===void 0&&(V.current=new AbortController),f.useEffect(()=>()=>V?.current.abort(),[]);const[ee,xe]=H0(Q,k,G,V.current,Ve),De=f.useCallback((w,_,A)=>{if(Pt===void 0)return!0;const $=[w[0]-G,w[1]];return Pt?.($,_,A)},[G,Pt]),fe=f.useRef(It),pe=f.useCallback((w,_)=>{_&&(w=U0(w,ee,G,R,V.current)),pt!==void 0?(fe.current=Go(w,-G),pt(fe.current)):r(w)},[pt,ee,G,R]),Xe=kr(Zt,f.useCallback((w,_,A,$)=>{Zt?.(v[A-G],_,A-G,$)},[Zt,G,v])),Me=kr(Ue,f.useCallback((w,_,A,$)=>{Ue?.(v[A-G],_,A-G,$)},[Ue,G,v])),Ze=kr(kt,f.useCallback((w,_,A,$)=>{kt?.(v[A-G],_,A-G,$)},[kt,G,v])),vt=kr(C,f.useCallback((w,_)=>C?.({...w,columnIndex:w.columnIndex-G},_)??!1,[C,G])),cn=kr(F,f.useCallback((w,_)=>F?.({...w,col:w.col-G},_)??!1,[F,G])),Ut=f.useCallback(w=>{if(Pe!==void 0){const _=Pe(Go(w,-G));return typeof _=="boolean"?_:Go(_,G)}return!0},[Pe,G]),[Mt,ut,qe]=_0(q,pe,we,ne,ye,Oe,O),dt=f.useMemo(()=>hr(sd(),li),[li]),[zt,ui]=f.useState([0,0,0]),_r=f.useMemo(()=>{if(Jt===void 0)return{};const w={};for(const _ of Jt)w[_.kind]=_;return w},[Jt]),Qt=f.useCallback(w=>w.kind!==Z.Custom?_r[w.kind]:Rn?.find(_=>_.isMatch(w)),[Rn,_r]);let{sizedColumns:ln,nonGrowWidth:Ft}=dm(v,Ve,xe,zt[0]-(G===0?0:vr)-zt[2],mr,Ia,dt,Qt,V.current);xn!=="none"&&(Ft+=vr);const Vn=f.useMemo(()=>ln.some(w=>w.group!==void 0),[ln]),mn=Vn?_i+Mo:_i,ci=q.rows.length,cr=xn==="none"?void 0:ci===0?!1:ci===Ve?!0:void 0,nt=f.useMemo(()=>xn==="none"?ln:[{title:"",width:vr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ri,rowMarker:Lr,rowMarkerChecked:cr,headerRowMarkerTheme:pr,headerRowMarkerAlwaysVisible:ii,headerRowMarkerDisabled:oi},...ln],[xn,ln,vr,ri,Lr,cr,pr,ii,oi]),en=f.useRef({height:1,width:1,x:0,y:0}),Hr=f.useRef(!1),{setVisibleRegion:br,visibleRegion:dr,scrollRef:Vt}=ov(dn,Bt,nr,en,()=>Hr.current=!0);en.current=dr;const Pf=dr.x+G,Ro=dr.y,vn=f.useRef(null),kn=f.useCallback(w=>{w===!0?vn.current?.focus():window.requestAnimationFrame(()=>{vn.current?.focus()})},[]),bn=Ht?Ve+1:Ve,$n=f.useCallback(w=>{const _=G===0?w:w.map($=>({...$,location:[$.location[0]-G,$.location[1]]})),A=de?.(_);if(A!==!0)for(const $ of _)ae?.($.location,$.value);return A},[ae,de,G]),[zr,La]=f.useState(),Io=q.current!==void 0&&q.current.range.width*q.current.range.height>1?q.current.range:void 0,ws=ti?q.current?.cell:void 0,Eo=ws?.[0],To=ws?.[1],Lf=f.useMemo(()=>{if((xt===void 0||xt.length===0)&&(Io??Eo??To??zr)===void 0)return;const w=[];if(xt!==void 0)for(const _ of xt){const A=nt.length-_.range.x-G;A>0&&w.push({color:_.color,range:{..._.range,x:_.range.x+G,width:Math.min(A,_.range.width)},style:_.style})}return zr!==void 0&&w.push({color:qr(dt.accentColor,0),range:zr,style:"dashed"}),Io!==void 0&&w.push({color:qr(dt.accentColor,.5),range:Io,style:"solid-outline"}),Eo!==void 0&&To!==void 0&&w.push({color:dt.accentColor,range:{x:Eo,y:To,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[zr,Io,Eo,To,xt,nt.length,dt.accentColor,G]),ys=f.useRef(nt);ys.current=nt;const Fn=f.useCallback(([w,_],A=!1)=>{const $=Ht&&_===bn-1;if(w===0&&Ln){if($)return Xo;const K=Ai(_);return K===void 0?Xo:{kind:Bn.Marker,allowOverlay:!1,checkboxStyle:Lr,checked:q?.rows.hasIndex(_)===!0,markerKind:xn==="clickable-number"?"number":xn,row:sr+K,drawHandle:an!==void 0,cursor:xn==="clickable-number"?"pointer":void 0}}else if($){const z=w===G?Ie?.hint??"":"",U=ys.current[w];if(U?.trailingRowOptions?.disabled===!0)return Xo;{const J=U?.trailingRowOptions?.hint??z,ie=U?.trailingRowOptions?.addIcon??Ie?.addIcon;return{kind:Bn.NewRow,hint:J,allowOverlay:!1,icon:ie}}}else{const K=w-G;if(A||bt?.strict===!0){const U=en.current,J=U.x>K||K>U.x+U.width||U.y>_||_>U.y+U.height||_>=Ha.current,ie=K===U.extras?.selected?.[0]&&_===U.extras?.selected[1];let Se=!1;if(U.extras?.freezeRegions!==void 0){for(const Rt of U.extras.freezeRegions)if(jr(Rt,K,_)){Se=!0;break}}if(J&&!ie&&!Se)return Xo}let z=k([K,_]);return G!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+G,z.span[1]+G]}),z}},[Ht,bn,Ln,Ai,Lr,q?.rows,xn,sr,an,G,Ie?.hint,Ie?.addIcon,bt?.strict,k]),Fa=f.useCallback(w=>{let _=gt?.(w)??{name:w};return ue!==void 0&&w!==""&&(_={icon:_.icon,name:_.name,overrideTheme:_.overrideTheme,actions:[..._.actions??[],{title:"Rename",icon:"renameIcon",onClick:A=>Va({group:_.name,bounds:A.bounds})}]}),_},[gt,ue]),Do=f.useCallback(w=>{const[_,A]=w.cell,$=nt[_],X=$?.group!==void 0?Fa($.group)?.overrideTheme:void 0,K=$?.themeOverride,z=Fr?.(A);o({...w,theme:hr(dt,X,K,z,w.content.themeOverride)})},[Fr,nt,Fa,dt]),di=f.useCallback((w,_,A)=>{if(q.current===void 0)return;const[$,X]=q.current.cell,K=Fn([$,X]);if(K.kind!==Z.Boolean&&K.allowOverlay){let z=K;if(A!==void 0)switch(z.kind){case Z.Number:{const U=Yg(()=>A==="-"?-0:Number.parseFloat(A),0);z={...z,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:A};break}Do({target:w,content:z,initialValue:A,cell:[$,X],highlight:A===void 0,forceEditMode:A!==void 0,activation:_})}else K.kind===Z.Boolean&&_.inputType==="keyboard"&&K.readonly!==!0&&($n([{location:q.current.cell,value:{...K,data:kd(K.data)}}]),vn.current?.damage([{cell:q.current.cell}]))},[Fn,q,$n,Do]),Cs=f.useCallback((w,_)=>{const A=vn.current?.getBounds(w,_);if(A===void 0||Vt.current===null)return;const $=Fn([w,_]);$.allowOverlay&&Do({target:A,content:$,initialValue:void 0,highlight:!0,cell:[w,_],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Fn,Vt,Do]),Yt=f.useCallback((w,_,A="both",$=0,X=0,K=void 0)=>{if(Vt.current!==null){const z=vn.current,U=a.current,J=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,ie=typeof _!="number"?_.unit==="cell"?_.amount:void 0:_,Se=typeof w!="number"&&w.unit==="px"?w.amount:void 0,Rt=typeof _!="number"&&_.unit==="px"?_.amount:void 0;if(z!==null&&U!==null){let Qe={x:0,y:0,width:0,height:0},Ke=0,ft=0;if((J!==void 0||ie!==void 0)&&(Qe=z.getBounds((J??0)+G,ie??0)??Qe,Qe.width===0||Qe.height===0))return;const rt=U.getBoundingClientRect(),yt=rt.width/U.offsetWidth;if(Se!==void 0&&(Qe={...Qe,x:Se-rt.left-Vt.current.scrollLeft,width:1}),Rt!==void 0&&(Qe={...Qe,y:Rt+rt.top-Vt.current.scrollTop,height:1}),Qe!==void 0){const St={x:Qe.x-$,y:Qe.y-X,width:Qe.width+2*$,height:Qe.height+2*X};let vi=0;for(let Xa=0;Xa<Te;Xa++)vi+=ln[Xa].width;let Wi=0;const Ui=mt+(ur?1:0);Ui>0&&(Wi=Qr(bn,Ui,nr));let or=vi*yt+rt.left+G*vr*yt,bi=rt.right,Br=rt.top+mn*yt,wi=rt.bottom-Wi*yt;const Ho=Qe.width+$*2;switch(K?.hAlign){case"start":bi=or+Ho;break;case"end":or=bi-Ho;break;case"center":or=Math.floor((or+bi)/2)-Ho/2,bi=or+Ho;break}const zo=Qe.height+X*2;switch(K?.vAlign){case"start":wi=Br+zo;break;case"end":Br=wi-zo;break;case"center":Br=Math.floor((Br+wi)/2)-zo/2,wi=Br+zo;break}or>St.x?Ke=St.x-or:bi<St.x+St.width&&(Ke=St.x+St.width-bi),Br>St.y?ft=St.y-Br:wi<St.y+St.height&&(ft=St.y+St.height-wi),A==="vertical"||typeof w=="number"&&w<Te?Ke=0:(A==="horizontal"||typeof _=="number"&&_>=bn-Ui)&&(ft=0),(Ke!==0||ft!==0)&&(yt!==1&&(Ke/=yt,ft/=yt),Vt.current.scrollTo({left:Ke+Vt.current.scrollLeft,top:ft+Vt.current.scrollTop,behavior:K?.behavior??"auto"}))}}}},[G,mt,vr,Vt,mn,Te,ln,bn,ur,nr]),Aa=f.useRef(Cs),_a=f.useRef(k);Aa.current=Cs,_a.current=k;const Ha=f.useRef(Ve);Ha.current=Ve;const Ss=f.useRef(nt.length);Ss.current=nt.length;const wr=f.useCallback(async(w,_=!0,A)=>{if(nt[w]?.trailingRowOptions?.disabled===!0)return;const X=ge?.();let K,z=!0;X!==void 0&&(K=await X,K==="top"&&(z=!1),typeof K=="number"&&(z=!1));let U=0;const J=()=>{if(Ha.current<=Ve){U<500&&window.setTimeout(J,U),U=50+U*2;return}const ie=typeof K=="number"?K:z?Ve:0;_o.current(w-G,ie,"both",0,0,A?{behavior:A}:void 0),Mt({cell:[w,ie],range:{x:w,y:ie,width:1,height:1}},!1,!1,"edit");const Se=_a.current([w-G,ie]);Se.allowOverlay&&xi(Se)&&Se.readonly!==!0&&_&&window.setTimeout(()=>{Aa.current(w,ie)},0)};J()},[nt,ge,G,Ve,Mt]),Oo=f.useCallback(async(w,_=!0)=>{const A=Je?.();let $,X=!0;A!==void 0&&($=await A,$==="left"&&(X=!1),typeof $=="number"&&(X=!1));let K=0;const z=()=>{if(Ss.current<=nt.length){K<500&&window.setTimeout(z,K),K=50+K*2;return}const U=typeof $=="number"?$:X?nt.length:0;Yt(U-G,w),Mt({cell:[U,w],range:{x:U,y:w,width:1,height:1}},!1,!1,"edit");const J=_a.current([U-G,w]);J.allowOverlay&&xi(J)&&J.readonly!==!0&&_&&window.setTimeout(()=>{Aa.current(U,w)},0)};z()},[nt,Je,G,Yt,Mt]),fi=f.useCallback(w=>{const _=ln[w]?.trailingRowOptions?.targetColumn??Ie?.targetColumn;if(typeof _=="number")return _+(Ln?1:0);if(typeof _=="object"){const A=v.indexOf(_);if(A>=0)return A+(Ln?1:0)}},[ln,v,Ln,Ie?.targetColumn]),yr=f.useRef(),hi=f.useRef(),Hi=f.useCallback((w,_)=>{const[A,$]=_;return hr(dt,nt[A]?.themeOverride,Fr?.($),w.themeOverride)},[Fr,nt,dt]),{mapper:Vr}=rv(Gt,b),Gn=Gt?.navigationBehavior,zi=f.useCallback(w=>{const _=da.value?w.metaKey:w.ctrlKey,A=_&&me==="multi",[$,X]=w.location,K=q.columns,z=q.rows,[U,J]=q.current?.cell??[];if(w.kind==="cell"){if(hi.current=void 0,$r.current=[$,X],$===0&&Ln){if(Ht===!0&&X===Ve||xn==="number"||me==="none")return;const ie=Fn(w.location);if(ie.kind!==Bn.Marker)return;if(an!==void 0){const Qe=Qt(ie);_n(Qe?.kind===Bn.Marker);const Ke=Qe?.onClick?.({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:Hi(ie,w.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===ie.checked)return}o(void 0),kn();const Se=z.hasIndex(X),Rt=yr.current;if(me==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&Rt!==void 0&&z.hasIndex(Rt)){const Qe=[Math.min(Rt,X),Math.max(Rt,X)+1];A||He==="multi"?ut(void 0,Qe,!0):ut(et.fromSingleSelection(Qe),void 0,A)}else me==="multi"&&(A||w.isTouch||He==="multi")?Se?ut(z.remove(X),void 0,!0):(ut(void 0,X,!0),yr.current=X):Se&&z.length===1?ut(et.empty(),void 0,_):(ut(et.fromSingleSelection(X),void 0,_),yr.current=X)}else if($>=G&&Ht&&X===Ve){const ie=fi($);wr(ie??$)}else if(U!==$||J!==X){const ie=Fn(w.location),Se=Qt(ie);if(Se?.onSelect!==void 0){let Ke=!1;if(Se.onSelect({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ke=!0,theme:Hi(ie,w.location)}),Ke)return}if(Gn==="block"&&Vr(X).isGroupHeader)return;const Rt=ur&&X===Ve,Qe=ur&&q!==void 0&&q.current?.cell[1]===Ve;if((w.shiftKey||w.isLongTouch===!0)&&U!==void 0&&J!==void 0&&q.current!==void 0&&!Qe){if(Rt)return;const Ke=Math.min($,U),ft=Math.max($,U),rt=Math.min(X,J),yt=Math.max(X,J);Mt({...q.current,range:{x:Ke,y:rt,width:ft-Ke+1,height:yt-rt+1}},!0,_,"click"),yr.current=void 0,kn()}else Mt({cell:[$,X],range:{x:$,y:X,width:1,height:1}},!0,_,"click"),yr.current=void 0,o(void 0),kn()}}else if(w.kind==="header")if($r.current=[$,X],o(void 0),Ln&&$===0)yr.current=void 0,hi.current=void 0,!oi&&me==="multi"&&(z.length!==Ve?ut(et.fromSingleSelection([0,Ve]),void 0,_):ut(et.empty(),void 0,_),kn());else{const ie=hi.current;if(te==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&ie!==void 0&&K.hasIndex(ie)){const Se=[Math.min(ie,$),Math.max(ie,$)+1];_||w.isTouch||ht==="multi"?qe(void 0,Se,_):qe(et.fromSingleSelection(Se),void 0,_)}else te==="multi"&&(_||w.isTouch||ht==="multi")?(K.hasIndex($)?qe(K.remove($),void 0,_):qe(void 0,$,_),hi.current=$):te!=="none"&&(K.hasIndex($)?qe(K.remove($),void 0,_):qe(et.fromSingleSelection($),void 0,_),hi.current=$);yr.current=void 0,kn()}else w.kind===qn?$r.current=[$,X]:w.kind===fa&&!w.isMaybeScrollbar&&(pe(Yo,!1),o(void 0),kn(),qt?.(),yr.current=void 0,hi.current=void 0)},[me,te,q,Ln,G,Ht,Ve,xn,Fn,an,kn,He,ht,Qt,Hi,ut,fi,wr,Gn,Vr,ur,Mt,oi,qe,pe,qt]),Vi=f.useRef(!1),$r=f.useRef(),xs=f.useRef(dr),ir=f.useRef(),Ff=f.useCallback(w=>{if(gi.current=!1,xs.current=en.current,w.button!==0&&w.button!==1){ir.current=void 0;return}const _=performance.now();ir.current={button:w.button,time:_,location:w.location},w?.kind==="header"&&(Vi.current=!0);const A=w.kind==="cell"&&w.isFillHandle;!A&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:q,fillHandle:A}),$r.current=void 0,!w.isTouch&&w.button===0&&!A?zi(w):!w.isTouch&&w.button===1&&($r.current=w.location))},[q,zi]),[za,Va]=f.useState(),ks=f.useCallback(w=>{if(w.kind!==qn||te!=="multi")return;const _=da.value?w.metaKey:w.ctrlKey,[A]=w.location,$=q.columns;if(A<G)return;const X=nt[A];let K=A,z=A;for(let U=A-1;U>=G&&go(X.group,nt[U].group);U--)K--;for(let U=A+1;U<nt.length&&go(X.group,nt[U].group);U++)z++;if(kn(),_||w.isTouch||ht==="multi")if($.hasAll([K,z+1])){let U=$;for(let J=K;J<=z;J++)U=U.remove(J);qe(U,void 0,_)}else qe(void 0,[K,z+1],_);else qe(et.fromSingleSelection([K,z+1]),void 0,_)},[te,kn,q.columns,nt,G,qe,ht]),gi=f.useRef(!1),Po=f.useCallback(async w=>{if(ee!==void 0&&Xe!==void 0){const _=en.current.y,A=en.current.height;let $=ee({x:w,y:_,width:1,height:Math.min(A,Ve-_)},V.current.signal);typeof $!="object"&&($=await $());const X=ln[w-G],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=dt.baseFontFull;const U=dd(z,dt,X,0,$,mr,ai,!1,Qt);Xe?.(X,U.width,w,U.width)}}},[ln,ee,ai,dt,mr,Xe,G,Ve,Qt]),[Af,$a]=f.useState(),pi=f.useCallback(async(w,_)=>{const A=w.current?.range;if(A===void 0||ee===void 0||_.current===void 0)return;const $=_.current.range;if(I!==void 0){let U=!1;if(I({fillDestination:{...$,x:$.x-G},patternSource:{...A,x:A.x-G},preventDefault:()=>U=!0}),U)return}let X=ee(A,V.current.signal);typeof X!="object"&&(X=await X());const K=X,z=[];for(let U=0;U<$.width;U++)for(let J=0;J<$.height;J++){const ie=[$.x+U,$.y+J];if(Qc(ie,A))continue;const Se=K[J%A.height][U%A.width];Mi(Se)||!xi(Se)||z.push({location:ie,value:{...Se}})}$n(z),vn.current?.damage(z.map(U=>({cell:U.location})))},[ee,$n,I,G]),Ms=f.useCallback(()=>{if(q.current===void 0||q.current.range.width<=1)return;const w={...q,current:{...q.current,range:{...q.current.range,width:1}}};pi(w,q)},[pi,q]),Rs=f.useCallback(()=>{if(q.current===void 0||q.current.range.height<=1)return;const w={...q,current:{...q.current,range:{...q.current.range,height:1}}};pi(w,q)},[pi,q]),_f=f.useCallback((w,_)=>{const A=s;if(u(void 0),La(void 0),$a(void 0),Vi.current=!1,_)return;if(A?.fillHandle===!0&&q.current!==void 0&&A.previousSelection?.current!==void 0){if(zr===void 0)return;const Se={...q,current:{...q.current,range:md(A.previousSelection.current.range,zr)}};pi(A.previousSelection,Se),pe(Se,!0);return}const[$,X]=w.location,[K,z]=$r.current??[],U=()=>{gi.current=!0},J=Se=>{const Rt=Se.isTouch||K===$&&z===X;if(Rt&&E?.([$-G,X],{...Se,preventDefault:U}),Se.button===1)return!gi.current;if(!gi.current){const Qe=Fn(w.location),Ke=Qt(Qe);if(Ke!==void 0&&Ke.onClick!==void 0&&Rt){const rt=Ke.onClick({...Se,cell:Qe,posX:Se.localEventX,posY:Se.localEventY,bounds:Se.bounds,theme:Hi(Qe,w.location),preventDefault:U});rt!==void 0&&!Mi(rt)&&Si(rt)&&($n([{location:Se.location,value:rt}]),vn.current?.damage([{cell:Se.location}]))}if(gi.current||q.current===void 0)return!1;let ft=!1;switch(Qe.activationBehaviorOverride??Re){case"double-click":case"second-click":{if(A?.previousSelection?.current?.cell===void 0)break;const[rt,yt]=q.current.cell,[St,vi]=A.previousSelection.current.cell;ft=$===rt&&$===St&&X===yt&&X===vi&&(Se.isDoubleClick===!0||Re==="second-click");break}case"single-click":{ft=!0;break}}if(ft){const yt={inputType:"pointer",pointerActivation:Se.isDoubleClick===!0?"double-click":Qe.activationBehaviorOverride??Re,pointerType:Se.isTouch?"touch":"mouse"};return M?.([$-G,X],yt),di(Se.bounds,yt),!0}}return!1},ie=w.location[0]-G;if(w.isTouch){const Se=en.current,Rt=xs.current;if(Se.x!==Rt.x||Se.y!==Rt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&so(q.current?.cell,w.location)){W?.([ie,w.location[1]],{...w,preventDefault:U});return}else if(w.kind==="header"&&q.columns.hasIndex($)){oe?.(ie,{...w,preventDefault:U});return}else if(w.kind===qn){if(ie<0)return;re?.(ie,{...w,preventDefault:U});return}}w.kind==="cell"?J(w)||zi(w):w.kind===qn?N?.(ie,{...w,preventDefault:U}):(w.kind===Mr&&x?.(ie,{...w,preventDefault:U}),zi(w));return}if(w.kind==="header"){if(ie<0)return;w.isEdge?w.isDoubleClick===!0&&Po($):w.button===0&&$===K&&X===z&&x?.(ie,{...w,preventDefault:U})}if(w.kind===qn){if(ie<0)return;w.button===0&&$===K&&X===z&&(N?.(ie,{...w,preventDefault:U}),gi.current||ks(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&J(w),$r.current=void 0},[s,q,G,zr,pi,pe,E,Fn,Qt,Re,Hi,$n,M,di,W,oe,re,zi,N,x,Po,ks]),Hf=f.useCallback(w=>{const _={...w,location:[w.location[0]-G,w.location[1]]};st?.(_),s!==void 0&&w.buttons===0&&(u(void 0),La(void 0),$a(void 0),Vi.current=!1),$a(A=>Vi.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===A?.[0]&&w.scrollEdge[1]===A[1]?A:s===void 0||(ir.current?.location[0]??0)<G?void 0:w.scrollEdge)},[s,st,G]),zf=f.useCallback((w,_)=>{tt?.(w-G,_)},[tt,G]),Vf=f.useCallback((w,_)=>{je?.(w-G,_)},[je,G]),mi=q?.current?.cell,$f=f.useCallback((w,_,A,$,X,K)=>{Hr.current=!1;let z=mi;z!==void 0&&(z=[z[0]-G,z[1]]);const U=Te===0?void 0:{x:0,y:w.y,width:Te,height:w.height},J=[];U!==void 0&&J.push(U),mt>0&&(J.push({x:w.x-G,y:Ve-mt,width:w.width,height:mt}),Te>0&&J.push({x:0,y:Ve-mt,width:Te,height:mt}));const ie={x:w.x-G,y:w.y,width:w.width,height:Ht&&w.y+w.height>=Ve?w.height-1:w.height,tx:X,ty:K,extras:{selected:z,freezeRegion:U,freezeRegions:J}};en.current=ie,br(ie),ui([_,A,$]),Dn?.(ie,ie.tx,ie.ty,ie.extras)},[mi,G,Ht,Ve,Te,mt,br,Dn]),Nf=kr(D,f.useCallback((w,_)=>D?.(w-G,_-G)!==!1,[D,G])),Bf=kr(ke,f.useCallback((w,_)=>{ke?.(w-G,_-G),te!=="none"&&qe(et.fromSingleSelection(_),void 0,!0)},[te,ke,G,qe])),Na=f.useRef(!1),Wf=f.useCallback(w=>{if(w.location[0]===0&&G>0){w.preventDefault();return}Ee?.({...w,location:[w.location[0]-G,w.location[1]]}),w.defaultPrevented()||(Na.current=!0),u(void 0)},[Ee,G]),Uf=f.useCallback(()=>{Na.current=!1},[]),Is=Gt?.selectionBehavior,Lo=f.useCallback(w=>{if(Is!=="block-spanning")return;const{isGroupHeader:_,path:A,groupRows:$}=Vr(w);if(_)return[w,w];const X=A[A.length-1],K=w-X,z=w+$-X-1;return[K,z]},[Vr,Is]),Ba=f.useRef(),Wa=f.useCallback(w=>{if(!Sd(w,Ba.current)&&(Ba.current=w,!(ir?.current?.button!==void 0&&ir.current.button>=1))){if(w.buttons!==0&&s!==void 0&&ir.current?.location[0]===0&&G===1&&me==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(ir.current.location[1])&&q.rows.hasIndex(ir.current.location[1])){const _=Math.min(ir.current.location[1],w.location[1]),A=Math.max(ir.current.location[1],w.location[1])+1;ut(et.fromSingleSelection([_,A]),void 0,!1)}else if(w.buttons!==0&&s!==void 0&&q.current!==void 0&&!Na.current&&!Vi.current&&(Oe==="rect"||Oe==="multi-rect")){const[_,A]=q.current.cell;let[$,X]=w.location;if(X<0&&(X=en.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const K=s.previousSelection.current.range;X=Math.min(X,Ht?Ve-1:Ve);const z=Wm(K,$,X,Tt);La(z)}else{if(Ht&&A===Ve)return;if(Ht&&X===Ve)if(w.kind===fa)X--;else return;$=Math.max($,G);const U=Lo(A);X=U===void 0?X:Nn(X,U[0],U[1]);const J=$-_,ie=X-A,Se={x:J>=0?_:$,y:ie>=0?A:X,width:Math.abs(J)+1,height:Math.abs(ie)+1};Mt({...q.current,range:Se},!0,!1,"drag")}}ct?.({...w,location:[w.location[0]-G,w.location[1]]})}},[s,G,me,q,Oe,ct,ut,Ht,Ve,Tt,Lo,Mt]),Gf=f.useCallback(()=>{const w=Ba.current;if(w===void 0)return;const[_,A]=w.scrollEdge;let[$,X]=w.location;const K=en.current;_===-1?$=K.extras?.freezeRegion?.x??K.x:_===1&&($=K.x+K.width),A===-1?X=Math.max(0,K.y):A===1&&(X=Math.min(Ve-1,K.y+K.height)),$=Nn($,0,nt.length-1),X=Nn(X,0,Ve-1),Wa({...w,location:[$,X]})},[nt.length,Wa,Ve]);J0(Af,Vt,Gf);const Xn=f.useCallback(w=>{if(q.current===void 0)return;const[_,A]=w,[$,X]=q.current.cell,K=q.current.range;let z=K.x,U=K.x+K.width,J=K.y,ie=K.y+K.height;const[Se,Rt]=Lo(X)??[0,Ve-1],Qe=Rt+1;if(A!==0)switch(A){case 2:{ie=Qe,J=X,Yt(0,ie,"vertical");break}case-2:{J=Se,ie=X+1,Yt(0,J,"vertical");break}case 1:{J<X?(J++,Yt(0,J,"vertical")):(ie=Math.min(Qe,ie+1),Yt(0,ie,"vertical"));break}case-1:{ie>X+1?(ie--,Yt(0,ie,"vertical")):(J=Math.max(Se,J-1),Yt(0,J,"vertical"));break}default:fo()}if(_!==0)if(_===2)U=nt.length,z=$,Yt(U-1-G,0,"horizontal");else if(_===-2)z=G,U=$+1,Yt(z-G,0,"horizontal");else{let Ke=[];if(ee!==void 0){const ft=ee({x:z,y:J,width:U-z-G,height:ie-J},V.current.signal);typeof ft=="object"&&(Ke=sv(ft))}if(_===1){let ft=!1;if(z<$){if(Ke.length>0){const rt=Ir(z+1,$+1).find(yt=>!Ke.includes(yt-G));rt!==void 0&&(z=rt,ft=!0)}else z++,ft=!0;ft&&Yt(z,0,"horizontal")}ft||(U=Math.min(nt.length,U+1),Yt(U-1-G,0,"horizontal"))}else if(_===-1){let ft=!1;if(U>$+1){if(Ke.length>0){const rt=Ir(U-1,$,-1).find(yt=>!Ke.includes(yt-G));rt!==void 0&&(U=rt,ft=!0)}else U--,ft=!0;ft&&Yt(U-G,0,"horizontal")}ft||(z=Math.max(G,z-1),Yt(z-G,0,"horizontal"))}else fo()}Mt({cell:q.current.cell,range:{x:z,y:J,width:U-z,height:ie-J}},!0,!1,"keyboard-select")},[ee,Lo,q,nt.length,G,Ve,Yt,Mt]),Ua=f.useRef(hn);Ua.current=hn;const Cr=f.useCallback((w,_,A,$)=>{const X=bn-(A?0:1);w=Nn(w,G,ln.length-1+G),_=Nn(_,0,X);const K=mi?.[0],z=mi?.[1];if(w===K&&_===z)return!1;if($&&q.current!==void 0){const U=[...q.current.rangeStack];(q.current.range.width>1||q.current.range.height>1)&&U.push(q.current.range),pe({...q,current:{cell:[w,_],range:{x:w,y:_,width:1,height:1},rangeStack:U}},!0)}else Mt({cell:[w,_],range:{x:w,y:_,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===_&&(c.current=void 0),Ua.current&&Yt(w-G,_),!0},[bn,G,ln.length,mi,q,Yt,pe,Mt]),Xf=f.useCallback((w,_)=>{i?.cell!==void 0&&w!==void 0&&Si(w)&&($n([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{vn.current?.damage([{cell:i.cell}])})),kn(!0),o(void 0);const[A,$]=_;if(q.current!==void 0&&(A!==0||$!==0)){const X=q.current.cell[1]===bn-1&&w!==void 0,K=q.current.cell[0]===nt.length-1&&w!==void 0;let z=!0;if(X&&$===1&&ge!==void 0){z=!1;const U=q.current.cell[0]+A,J=fi(U);wr(J??U,!1)}if(K&&A===1&&Je!==void 0){z=!1;const U=q.current.cell[1]+$;Oo(U,!1)}z&&Cr(Nn(q.current.cell[0]+A,0,nt.length-1),Nn(q.current.cell[1]+$,0,bn-1),X,!1)}P?.(w,_)},[i?.cell,kn,q,P,$n,bn,Cr,nt.length,wr,Oo,ge,Je,fi]),Yf=f.useMemo(()=>`gdg-overlay-${lv++}`,[]),Nr=f.useCallback(w=>{kn();const _=[];for(let A=w.x;A<w.x+w.width;A++)for(let $=w.y;$<w.y+w.height;$++){const X=k([A-G,$]);if(!X.allowOverlay&&X.kind!==Z.Boolean)continue;let K;if(X.kind===Z.Custom){const z=Qt(X),U=z?.provideEditor?.({...X,location:[A-G,$]});z?.onDelete!==void 0?K=z.onDelete(X):jg(U)&&(K=U?.deletedValue?.(X))}else(Si(X)&&X.allowOverlay||X.kind===Z.Boolean)&&(K=Qt(X)?.onDelete?.(X));K!==void 0&&!Mi(K)&&Si(K)&&_.push({location:[A,$],value:K})}$n(_),vn.current?.damage(_.map(A=>({cell:A.location})))},[kn,k,Qt,$n,G]),$i=i!==void 0,Es=f.useCallback(w=>{const _=()=>{w.stopPropagation(),w.preventDefault()},A={didMatch:!1},{bounds:$}=w,X=q.columns,K=q.rows,z=rr;if(!$i&&it(z.clear,w,A))pe(Yo,!1),qt?.();else if(!$i&&it(z.selectAll,w,A))pe({columns:et.empty(),rows:et.empty(),current:{cell:q.current?.cell??[G,0],range:{x:G,y:0,width:v.length,height:Ve},rangeStack:[]}},!1);else if(it(z.search,w,A))l?.current?.focus({preventScroll:!0}),Ar(!0);else if(it(z.delete,w,A)){const rt=Ut?.(q)??!0;if(rt!==!1){const yt=rt===!0?q:rt;if(yt.current!==void 0){Nr(yt.current.range);for(const St of yt.current.rangeStack)Nr(St)}for(const St of yt.rows)Nr({x:G,y:St,width:v.length,height:1});for(const St of yt.columns)Nr({x:St,y:0,width:1,height:Ve})}}if(A.didMatch)return _(),!0;if(q.current===void 0)return!1;let[U,J]=q.current.cell;const[,ie]=q.current.cell;let Se=!1,Rt=!1;if(it(z.scrollToSelectedCell,w,A))_o.current(U-G,J);else if(te!=="none"&&it(z.selectColumn,w,A))X.hasIndex(U)?qe(X.remove(U),void 0,!0):te==="single"?qe(et.fromSingleSelection(U),void 0,!0):qe(void 0,U,!0);else if(me!=="none"&&it(z.selectRow,w,A))K.hasIndex(J)?ut(K.remove(J),void 0,!0):me==="single"?ut(et.fromSingleSelection(J),void 0,!0):ut(void 0,J,!0);else if(!$i&&$!==void 0&&it(z.activateCell,w,A))if(J===Ve&&Ht)window.setTimeout(()=>{const rt=fi(U);wr(rt??U)},0);else{const rt={inputType:"keyboard",key:w.key};M?.([U-G,J],rt),di($,rt)}else q.current.range.height>1&&it(z.downFill,w,A)?Rs():q.current.range.width>1&&it(z.rightFill,w,A)?Ms():it(z.goToNextPage,w,A)?J+=Math.max(1,en.current.height-4):it(z.goToPreviousPage,w,A)?J-=Math.max(1,en.current.height-4):it(z.goToFirstCell,w,A)?(o(void 0),J=0,U=0):it(z.goToLastCell,w,A)?(o(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):it(z.selectToFirstCell,w,A)?(o(void 0),Xn([-2,-2])):it(z.selectToLastCell,w,A)?(o(void 0),Xn([2,2])):$i?(it(z.closeOverlay,w,A)&&o(void 0),it(z.acceptOverlayDown,w,A)&&(o(void 0),J++),it(z.acceptOverlayUp,w,A)&&(o(void 0),J--),it(z.acceptOverlayLeft,w,A)&&(o(void 0),U--),it(z.acceptOverlayRight,w,A)&&(o(void 0),U++)):(it(z.goDownCell,w,A)?J+=1:it(z.goUpCell,w,A)?J-=1:it(z.goRightCell,w,A)?U+=1:it(z.goLeftCell,w,A)?U-=1:it(z.goDownCellRetainSelection,w,A)?(J+=1,Se=!0):it(z.goUpCellRetainSelection,w,A)?(J-=1,Se=!0):it(z.goRightCellRetainSelection,w,A)?(U+=1,Se=!0):it(z.goLeftCellRetainSelection,w,A)?(U-=1,Se=!0):it(z.goToLastRow,w,A)?J=Ve-1:it(z.goToFirstRow,w,A)?J=Number.MIN_SAFE_INTEGER:it(z.goToLastColumn,w,A)?U=Number.MAX_SAFE_INTEGER:it(z.goToFirstColumn,w,A)?U=Number.MIN_SAFE_INTEGER:(Oe==="rect"||Oe==="multi-rect")&&(it(z.selectGrowDown,w,A)?Xn([0,1]):it(z.selectGrowUp,w,A)?Xn([0,-1]):it(z.selectGrowRight,w,A)?Xn([1,0]):it(z.selectGrowLeft,w,A)?Xn([-1,0]):it(z.selectToLastRow,w,A)?Xn([0,2]):it(z.selectToFirstRow,w,A)?Xn([0,-2]):it(z.selectToLastColumn,w,A)?Xn([2,0]):it(z.selectToFirstColumn,w,A)&&Xn([-2,0])),Rt=A.didMatch);if(Gn!==void 0&&Gn!=="normal"&&J!==ie){const rt=Gn==="skip-up"||Gn==="skip"||Gn==="block",yt=Gn==="skip-down"||Gn==="skip"||Gn==="block",St=J<ie;if(St&&rt){for(;J>=0&&Vr(J).isGroupHeader;)J--;J<0&&(J=ie)}else if(!St&&yt){for(;J<Ve&&Vr(J).isGroupHeader;)J++;J>=Ve&&(J=ie)}}const Ke=Cr(U,J,!1,Se),ft=A.didMatch;return ft&&(Ke||!Rt||Sn)&&_(),ft},[Gn,$i,q,rr,te,me,Oe,G,Vr,Ve,Cr,pe,qt,v.length,Ut,Sn,Nr,qe,ut,Ht,fi,wr,M,di,Rs,Ms,Xn]),Ni=f.useCallback(w=>{let _=!1;if(Y!==void 0&&Y({...w,...w.location&&{location:[w.location[0]-G,w.location[1]]},cancel:()=>{_=!0}}),_||Es(w)||q.current===void 0)return;const[A,$]=q.current.cell,X=en.current;if(ve&&!w.metaKey&&!w.ctrlKey&&q.current!==void 0&&w.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(w.key)&&w.bounds!==void 0&&xi(k([A-G,Math.max(0,Math.min($,Ve-1))]))){if((!Ht||$!==Ve)&&(X.y>$||$>X.y+X.height||X.x>A||A>X.x+X.width))return;const K={inputType:"keyboard",key:w.key};M?.([A-G,$],K),di(w.bounds,K,w.key),w.stopPropagation(),w.preventDefault()}},[ve,Y,Es,q,k,G,Ve,Ht,M,di]),jf=f.useCallback((w,_)=>{const A=w.location[0]-G;if(w.kind==="header"&&oe?.(A,{...w,preventDefault:_}),w.kind===qn){if(A<0)return;re?.(A,{...w,preventDefault:_})}if(w.kind==="cell"){const[$,X]=w.location;W?.([A,X],{...w,preventDefault:_}),qp(q,w.location)||Cr($,X,!1,!1)}},[q,W,re,oe,G,Cr]),Ga=f.useCallback(async w=>{if(!rr.paste)return;function _(z,U,J,ie){const Se=typeof J=="object"?J?.join(`
173
173
  `)??"":J?.toString()??"";if(!Mi(z)&&xi(z)&&z.readonly!==!0){const Rt=S?.(Se,z);if(Rt!==void 0&&Si(Rt))return{location:U,value:Rt};const Qe=Qt(z);if(Qe===void 0)return;if(Qe.kind===Z.Custom){_n(z.kind===Z.Custom);const Ke=Qe.onPaste?.(Se,z.data);return Ke===void 0?void 0:{location:U,value:{...z,data:Ke}}}else{const Ke=Qe.onPaste?.(Se,z,{formatted:ie,formattedString:typeof ie=="string"?ie:ie?.join(`
174
174
  `),rawValue:J});return Ke===void 0?void 0:(_n(Ke.kind===z.kind),{location:U,value:Ke})}}}const A=q.columns,$=q.rows,X=Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let K;if(q.current!==void 0?K=[q.current.range.x,q.current.range.y]:A.length===1?K=[A.first()??0,0]:$.length===1&&(K=[G,$.first()??0]),X&&K!==void 0){let z,U;const J="text/plain",ie="text/html";if(navigator.clipboard.read!==void 0){const Ke=await navigator.clipboard.read();for(const ft of Ke){if(ft.types.includes(ie)){const yt=await(await ft.getType(ie)).text(),St=xu(yt);if(St!==void 0){z=St;break}}ft.types.includes(J)&&(U=await(await ft.getType(J)).text())}}else if(navigator.clipboard.readText!==void 0)U=await navigator.clipboard.readText();else if(w!==void 0&&w?.clipboardData!==null){if(w.clipboardData.types.includes(ie)){const Ke=w.clipboardData.getData(ie);z=xu(Ke)}z===void 0&&w.clipboardData.types.includes(J)&&(U=w.clipboardData.getData(J))}else return;const[Se,Rt]=K,Qe=[];do{if(Fe===void 0){const Ke=Fn(K),ft=U??z?.map(yt=>yt.map(St=>St.rawValue).join(" ")).join(" ")??"",rt=_(Ke,K,ft,void 0);rt!==void 0&&Qe.push(rt);break}if(z===void 0){if(U===void 0)return;z=G0(U)}if(Fe===!1||typeof Fe=="function"&&Fe?.([K[0]-G,K[1]],z.map(Ke=>Ke.map(ft=>ft.rawValue?.toString()??"")))!==!0)return;for(const[Ke,ft]of z.entries()){if(Ke+Rt>=Ve)break;for(const[rt,yt]of ft.entries()){const St=[rt+Se,Ke+Rt],[vi,Wi]=St;if(vi>=nt.length||Wi>=bn)continue;const Ui=Fn(St),or=_(Ui,St,yt.rawValue,yt.formatted);or!==void 0&&Qe.push(or)}}}while(!1);$n(Qe),vn.current?.damage(Qe.map(Ke=>({cell:Ke.location})))}},[S,Qt,Fn,q,rr.paste,Vt,nt.length,$n,bn,Fe,G,Ve]);Mn("paste",Ga,d,!1,!0);const Bi=f.useCallback(async(w,_)=>{if(!rr.copy)return;const A=_===!0||Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,$=q.columns,X=q.rows,K=(z,U)=>{if(!Ye)Mu(z,U,w);else{const J=U.map(ie=>({kind:Z.Text,data:v[ie].title,displayData:v[ie].title,allowOverlay:!1}));Mu([J,...z],U,w)}};if(A&&ee!==void 0){if(q.current!==void 0){let z=ee(q.current.range,V.current.signal);typeof z!="object"&&(z=await z()),K(z,Ir(q.current.range.x-G,q.current.range.x+q.current.range.width-G))}else if(X!==void 0&&X.length>0){const U=[...X].map(J=>{const ie=ee({x:G,y:J,width:v.length,height:1},V.current.signal);return typeof ie=="object"?ie[0]:ie().then(Se=>Se[0])});if(U.some(J=>J instanceof Promise)){const J=await Promise.all(U);K(J,Ir(v.length))}else K(U,Ir(v.length))}else if($.length>0){const z=[],U=[];for(const J of $){let ie=ee({x:J,y:0,width:1,height:Ve},V.current.signal);typeof ie!="object"&&(ie=await ie()),z.push(ie),U.push(J-G)}if(z.length===1)K(z[0],U);else{const J=z.reduce((ie,Se)=>ie.map((Rt,Qe)=>[...Rt,...Se[Qe]]));K(J,U)}}}},[v,ee,q,rr.copy,G,Vt,Ve,Ye]);Mn("copy",Bi,d,!1,!1);const qf=f.useCallback(async w=>{if(!(!rr.cut||!(Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Bi(w),q.current!==void 0)){let A={current:{cell:q.current.cell,range:q.current.range,rangeStack:[]},rows:et.empty(),columns:et.empty()};const $=Ut?.(A);if($===!1||(A=$===!0?A:$,A.current===void 0))return;Nr(A.current.range)}},[Nr,q,rr.cut,Bi,Vt,Ut]);Mn("cut",qf,d,!1,!1);const Kf=f.useCallback((w,_)=>{if(he!==void 0){G!==0&&(w=w.map(X=>[X[0]-G,X[1]])),he(w,_);return}if(w.length===0||_===-1)return;const[A,$]=w[_];c.current!==void 0&&c.current[0]===A&&c.current[1]===$||(c.current=[A,$],Cr(A,$,!1,!1))},[he,G,Cr]),[Fo,Ao]=It?.current?.cell??[],_o=f.useRef(Yt);_o.current=Yt,f.useLayoutEffect(()=>{Ua.current&&!Hr.current&&Fo!==void 0&&Ao!==void 0&&(Fo!==fe.current?.current?.cell[0]||Ao!==fe.current?.current?.cell[1])&&_o.current(Fo,Ao),Hr.current=!1},[Fo,Ao]);const Ts=q.current!==void 0&&(q.current.cell[0]>=nt.length||q.current.cell[1]>=bn);f.useLayoutEffect(()=>{Ts&&pe(Yo,!1)},[Ts,pe]);const Zf=f.useMemo(()=>Ht===!0&&Ie?.tint===!0?et.fromSingleSelection(bn-1):et.empty(),[bn,Ht,Ie?.tint]),Jf=f.useCallback(w=>typeof rn=="boolean"?rn:rn?.(w-G)??!0,[G,rn]),Qf=f.useMemo(()=>{if(za===void 0||a.current===null)return null;const{bounds:w,group:_}=za,A=a.current.getBoundingClientRect();return f.createElement(F0,{bounds:w,group:_,canvasBounds:A,onClose:()=>Va(void 0),onFinish:$=>{Va(void 0),ue?.(_,$)}})},[ue,za]),eh=Math.min(nt.length,Te+(Ln?1:0));f.useImperativeHandle(t,()=>({appendRow:(w,_)=>wr(w+G,_),appendColumn:(w,_)=>Oo(w,_),updateCells:w=>(G!==0&&(w=w.map(_=>({cell:[_.cell[0]+G,_.cell[1]]}))),vn.current?.damage(w)),getBounds:(w,_)=>{if(!(a?.current===null||Vt?.current===null)){if(w===void 0&&_===void 0){const A=a.current.getBoundingClientRect(),$=A.width/Vt.current.clientWidth;return{x:A.x-Vt.current.scrollLeft*$,y:A.y-Vt.current.scrollTop*$,width:Vt.current.scrollWidth*$,height:Vt.current.scrollHeight*$}}return vn.current?.getBounds((w??0)+G,_)}},focus:()=>vn.current?.focus(),emit:async w=>{switch(w){case"delete":Ni({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":Ni({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":Ni({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 Bi(void 0,!0);break;case"paste":await Ga();break}},scrollTo:Yt,remeasureColumns:w=>{for(const _ of w)Po(_+G)},getMouseArgsForPosition:(w,_,A)=>{if(vn?.current===null)return;const $=vn.current.getMouseArgsForPosition(w,_,A);if($!==void 0)return{...$,location:[$.location[0]-G,$.location[1]]}}}),[wr,Oo,Po,Vt,Bi,Ni,Ga,G,Yt]);const[Ds,Os]=mi??[],th=f.useCallback(w=>{const[_,A]=w;if(A===-1){te!=="none"&&(qe(et.fromSingleSelection(_),void 0,!1),kn());return}Ds===_&&Os===A||(Mt({cell:w,range:{x:_,y:A,width:1,height:1}},!0,!1,"keyboard-nav"),Yt(_,A))},[te,kn,Yt,Ds,Os,Mt,qe]),[nh,rh]=f.useState(!1),Ps=f.useRef(Dc(w=>{rh(w)},5)),ih=f.useCallback(()=>{Ps.current(!0),q.current===void 0&&q.columns.length===0&&q.rows.length===0&&s===void 0&&Mt({cell:[G,Ro],range:{x:G,y:Ro,width:1,height:1}},!0,!1,"keyboard-select")},[Ro,q,s,G,Mt]),oh=f.useCallback(()=>{Ps.current(!1)},[]),[ah,lh]=f.useMemo(()=>{let w;const _=bt?.scrollbarWidthOverride??wl(),A=Ve+(Ht?1:0);if(typeof nr=="number")w=mn+A*nr;else{let X=0;const K=Math.min(A,10);for(let z=0;z<K;z++)X+=nr(z);X=Math.floor(X/K),w=mn+A*X}w+=_;const $=nt.reduce((X,K)=>K.width+X,0)+_;return[`${Math.min(1e5,$)}px`,`${Math.min(1e5,w)}px`]},[nt,bt?.scrollbarWidthOverride,nr,Ve,Ht,mn]),sh=f.useMemo(()=>um(dt),[dt]);return f.createElement(ud.Provider,{value:dt},f.createElement(q0,{style:sh,className:j,inWidth:m??ah,inHeight:y??lh},f.createElement(D0,{fillHandle:Lt,drawFocusRing:ti,experimental:bt,fixedShadowX:Cn,fixedShadowY:er,getRowThemeOverride:Fr,headerIcons:tr,imageWindowLoader:B,initialSize:ze,isDraggable:Ge,onDragLeave:Ot,onRowMoved:an,overscrollX:Ta,overscrollY:Da,preventDiagonalScrolling:pn,rightElement:Wt,rightElementProps:En,smoothScrollX:Li,smoothScrollY:ei,className:j,enableGroups:Vn,onCanvasFocused:ih,onCanvasBlur:oh,canvasRef:a,onContextMenu:jf,theme:dt,cellXOffset:Pf,cellYOffset:Ro,accessibilityHeight:dr.height,onDragEnd:Uf,columns:nt,nonGrowWidth:Ft,drawHeader:vt,onColumnProposeMove:Nf,drawCell:cn,disabledRows:Zf,freezeColumns:eh,lockColumns:G,firstColAccessible:G===0,getCellContent:Fn,minColumnWidth:mr,maxColumnWidth:ai,searchInputRef:l,showSearch:Pa,onSearchClose:si,highlightRegions:Lf,getCellsForSelection:ee,getGroupDetails:Fa,headerHeight:_i,isFocused:nh,groupHeaderHeight:Vn?Mo:0,freezeTrailingRows:mt+(Ht&&Ie?.sticky===!0?1:0),hasAppendRow:Ht,onColumnResize:Xe,onColumnResizeEnd:Me,onColumnResizeStart:Ze,onCellFocused:th,onColumnMoved:Bf,onDragStart:Wf,onHeaderMenuClick:zf,onHeaderIndicatorClick:Vf,onItemHovered:Wa,isFilling:s?.fillHandle===!0,onMouseMove:Hf,onKeyDown:Ni,onKeyUp:se,onMouseDown:Ff,onMouseUp:_f,onDragOverCell:Pn,onDrop:on,onSearchResultsChanged:Kf,onVisibleRegionChanged:$f,clientSize:zt,rowHeight:nr,searchResults:ce,searchValue:L,onSearchValueChange:H,rows:bn,scrollRef:Vt,selection:q,translateX:dr.tx,translateY:dr.ty,verticalBorder:Jf,gridRef:vn,getCellRenderer:Qt,resizeIndicator:Xt}),Qf,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(av,{...i,validateCell:De,bloom:T,id:Yf,getCellRenderer:Qt,className:bt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:gn,imageEditorOverride:g,portalElementRef:xo,onFinishEditing:Xf,markdownDivCreateNode:p,isOutsideClick:Tn,customEventTarget:bt?.eventTarget}))))},cv=f.forwardRef(uv);function Eu(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:l,height:a,x:s,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=Wc(c,a,o.cellVerticalPadding),h=Bc(t.contentAlign??"center",s,l,o.cellHorizontalPadding,g),p=Nc(h,d,g),m=Uc(s+n,u+r,p);return Hl(t)&&m}const dv={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>fv(e,e.cell.data,Hl(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Eu(e)&&e.preventDefault()},onClick:e=>{if(Eu(e))return{...e.cell,data:kd(e.cell.data)}},onPaste:(e,t)=>{let n=aa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=_l),n===t.data?void 0:{...t,data:n}}};function fv(e,t,n,r,i){if(!n&&t===aa)return;const{ctx:o,hoverAmount:l,theme:a,rect:s,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:p,width:m,height:y}=s;let v=!1;if(i>0){let b=n?1-i+i*l:.4;if(t===aa&&(b*=l),b===0)return;b<1&&(v=!0,o.globalAlpha=b)}jl(o,a,t,h,p,m,y,u,c,d,r,g),v&&(o.globalAlpha=1)}const hv=sn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),gv=e=>{const{bubbles:t}=e;return f.createElement(hv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},pv={getAccessibilityString:e=>Gc(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>mv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(gv,{bubbles:t.data})},onPaste:()=>{}};function mv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:l,y:a,width:s,height:u}=n;let c=l+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>l+s)break;const h=Dr(g,i,r.baseFontFull).width;d.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of d)Zn(i,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+Qn(i,r))}const vv=sn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),bv=e=>{const{drilldowns:t}=e;return f.createElement(vv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&f.createElement("img",{src:n.img}),f.createElement("div",null,n.text))))},wv={getAccessibilityString:e=>Gc(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Cv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(bv,{drilldowns:t.data})},onPaste:()=>{}},il={};function yv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,l=n-o*2,a=4,s=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(il[g]!==void 0)return{el:il[g],height:s,width:d,middleWidth:a*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),p=h.getContext("2d");return p===null?null:(h.width=d,h.height=s,p.scale(i,i),il[g]=h,p.beginPath(),Zn(p,o,o,c,l,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),Zn(p,o+.5,o+.5,c,l,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:h,height:s,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function Cv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:l,row:a}=e,{x:s,width:u}=n,c=r.baseFontFull,d=Ul(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,y=r.bubbleMargin;let v=s+r.cellHorizontalPadding;const b=r.roundingRadius??6,k=yv(r.bgCell,r.drilldownBorder,g,b),E=[];for(const M of t){if(v>s+u)break;const P=Dr(M.text,i,c).width;let S=0;M.img!==void 0&&o.loadOrGetImage(M.img,l,a)!==void 0&&(S=p-8+4);const C=P+S+m*2;E.push({x:v,width:C}),v+=C+y}if(k!==null){const{el:M,height:I,middleWidth:P,sideWidth:S,width:C,dpr:F,padding:T}=k,x=S/F,D=T/F;for(const O of E){const R=Math.floor(O.x),N=Math.floor(O.width),W=N-(x-D)*2;i.imageSmoothingEnabled=!1,i.drawImage(M,0,0,S,I,R-D,h,x,g),W>0&&i.drawImage(M,S,0,P,I,R+(x-D),h,W,g),i.drawImage(M,C-S,0,S,I,R+N-(x-D),h,x,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[M,I]of E.entries()){const P=t[M];let S=I.x+m;if(P.img!==void 0){const C=o.loadOrGetImage(P.img,l,a);if(C!==void 0){const F=p-8;let T=0,x=0,D=C.width,O=C.height;D>O?(T+=(D-O)/2,D=O):O>D&&(x+=(O-D)/2,O=D),i.beginPath(),Zn(i,S,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(C,T,x,D,O,S,h+g/2-F/2,F,F),i.restore(),S+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(P.text,S,h+g/2+Qn(i,r))}}const Sv={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>xv(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??wp;return f.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},ol=4;function xv(e,t,n,r){const{rect:i,col:o,row:l,theme:a,ctx:s,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,p=g-a.cellVerticalPadding*2,m=[];let y=0;for(let b=0;b<t.length;b++){const k=t[b];if(k.length===0)continue;const E=u.loadOrGetImage(k,o,l);if(E!==void 0){m[b]=E;const M=E.width*(p/E.height);y+=M+ol}}if(y===0)return;y-=ol;let v=c+a.cellHorizontalPadding;r==="right"?v=Math.floor(c+h-a.cellHorizontalPadding-y):r==="center"&&(v=Math.floor(c+h/2-y/2));for(const b of m){if(b===void 0)continue;const k=b.width*(p/b.height);n>0&&(s.beginPath(),Zn(s,v,d+a.cellVerticalPadding,k,p,n),s.save(),s.clip()),s.drawImage(b,v,d+a.cellVerticalPadding,k,p),n>0&&s.restore(),v+=k+ol}}function kv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Mv={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(kv(n,r)*t.skeletonWidthVariability));const s=l.cellHorizontalPadding;a+s*2>=o.width&&(a=o.width-s*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*l.cellVerticalPadding);Zn(i,o.x+s,o.y+(o.height-u)/2,a,u,l.roundingRadius??3),i.fillStyle=qr(l.textDark,.1),i.fill()},onPaste:()=>{}},Rv=()=>e=>e.targetWidth,Tu=sn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Rv(),"px"]}}),Iv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:l,validatedSelection:a}=e,s=t.data,u=t.readonly===!0,[c,d]=f.useState(s===""||r),g=f.useCallback(()=>{d(p=>!p)},[]),h=s?"gdg-ml-6":"";return c?f.createElement(Tu,{targetWidth:o.width-20},f.createElement(Jr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>l(t)},f.createElement(fp,null))):f.createElement(Tu,{targetWidth:o.width},f.createElement(zp,{contents:s,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(Vl,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Ev={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:So,measure:(e,t,n)=>{const r=t.data.split(`
175
- `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>ar(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:l,validatedSelection:a}=e;return f.createElement(Iv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Tv={getAccessibilityString:e=>e.row.toString(),kind:Bn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Dv,measure:()=>44,draw:e=>Pv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:l}=t,a=n.drawHandle?7+(o-7)/2:o/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Dv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=Ov,n.textAlign="center",o}function Ov(e){const{ctx:t}=e;t.textAlign="start"}function Pv(e,t,n,r,i,o){const{ctx:l,rect:a,hoverAmount:s,theme:u}=e,{x:c,y:d,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){l.globalAlpha=p;const m=7*(n?s:1);if(jl(l,u,n,i?c+m:c,d,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){l.globalAlpha=s,l.beginPath();for(const y of[3,6])for(const v of[-5,-1,3])l.rect(c+y,d+h/2+v,2,2);l.fillStyle=u.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),y=u.markerFontFull,v=c+g/2;r==="both"&&s!==0&&(l.globalAlpha=1-s),l.fillStyle=u.textLight,l.font=y,l.fillText(m,v,d+h/2+Qn(l,y)),s!==0&&(l.globalAlpha=1)}}const Lv={getAccessibilityString:()=>"",kind:Bn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Fv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Fv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:l,spriteManager:a}=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=l.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=d-8,y=s+8/2,v=u+8/2;a.drawSprite(n,"normal",r,y,v,m,l,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,y=g?0:(1-o)*p*.5,v=l.cellHorizontalPadding+4;m>0&&(r.moveTo(s+v+y,u+d/2),r.lineTo(s+v+y+m,u+d/2),r.moveTo(s+v+y+m*.5,u+d/2-m*.5),r.lineTo(s+v+y+m*.5,u+d/2+m*.5),r.lineWidth=2,r.strokeStyle=l.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=l.textMedium,r.fillText(t,h+s+l.cellHorizontalPadding+.5,u+d/2+Qn(r,l)),r.beginPath()}function Id(e,t,n,r,i,o,l){e.textBaseline="alphabetic";const a=Av(e,i,r,t,n?.fullSize??!1);e.beginPath(),Zn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??qr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l?.("text")}function Av(e,t,n,r,i){const o=r.cellHorizontalPadding,l=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+l/2+1,width:t.width-o,height:t.height-l-1};const a=Dr(n,e,r.baseFontFull,"alphabetic"),s=t.height-l,u=Math.min(s,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const _v=f.lazy(async()=>await Fl(()=>import("./number-overlay-editor.Cn_LsK8N.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),Hv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:So,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:u}=n;a===!0&&t>0&&Id(r,i,u,s,o,t,l),ar(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(_v,{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}}},zv={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Vv,onPaste:()=>{}};function Vv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:l}=r;t.beginPath();const a=2.5;let s=i+n.cellHorizontalPadding+a;const u=o+l/2,c=Math.cos(nu(30))*a,d=Math.sin(nu(30))*a;for(let g=0;g<12;g++)t.moveTo(s,u-a),t.lineTo(s,u+a),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 $v={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>So(e,t,e.theme.textLight),draw:e=>ar(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return $t.createElement(Jr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Nv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:So,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Id(i,l,g,s,o,n,a),ar(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=>ar(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:l,validatedSelection:a}=e;return f.createElement(Iv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Tv={getAccessibilityString:e=>e.row.toString(),kind:Bn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Dv,measure:()=>44,draw:e=>Pv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:l}=t,a=n.drawHandle?7+(o-7)/2:o/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Dv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=Ov,n.textAlign="center",o}function Ov(e){const{ctx:t}=e;t.textAlign="start"}function Pv(e,t,n,r,i,o){const{ctx:l,rect:a,hoverAmount:s,theme:u}=e,{x:c,y:d,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){l.globalAlpha=p;const m=7*(n?s:1);if(jl(l,u,n,i?c+m:c,d,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){l.globalAlpha=s,l.beginPath();for(const y of[3,6])for(const v of[-5,-1,3])l.rect(c+y,d+h/2+v,2,2);l.fillStyle=u.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),y=u.markerFontFull,v=c+g/2;r==="both"&&s!==0&&(l.globalAlpha=1-s),l.fillStyle=u.textLight,l.font=y,l.fillText(m,v,d+h/2+Qn(l,y)),s!==0&&(l.globalAlpha=1)}}const Lv={getAccessibilityString:()=>"",kind:Bn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Fv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Fv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:l,spriteManager:a}=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=l.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=d-8,y=s+8/2,v=u+8/2;a.drawSprite(n,"normal",r,y,v,m,l,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,y=g?0:(1-o)*p*.5,v=l.cellHorizontalPadding+4;m>0&&(r.moveTo(s+v+y,u+d/2),r.lineTo(s+v+y+m,u+d/2),r.moveTo(s+v+y+m*.5,u+d/2-m*.5),r.lineTo(s+v+y+m*.5,u+d/2+m*.5),r.lineWidth=2,r.strokeStyle=l.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=l.textMedium,r.fillText(t,h+s+l.cellHorizontalPadding+.5,u+d/2+Qn(r,l)),r.beginPath()}function Id(e,t,n,r,i,o,l){e.textBaseline="alphabetic";const a=Av(e,i,r,t,n?.fullSize??!1);e.beginPath(),Zn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??qr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l?.("text")}function Av(e,t,n,r,i){const o=r.cellHorizontalPadding,l=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+l/2+1,width:t.width-o,height:t.height-l-1};const a=Dr(n,e,r.baseFontFull,"alphabetic"),s=t.height-l,u=Math.min(s,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const _v=f.lazy(async()=>await Fl(()=>import("./number-overlay-editor.Bp2-OIVN.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),Hv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:So,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:u}=n;a===!0&&t>0&&Id(r,i,u,s,o,t,l),ar(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(_v,{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}}},zv={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Vv,onPaste:()=>{}};function Vv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:l}=r;t.beginPath();const a=2.5;let s=i+n.cellHorizontalPadding+a;const u=o+l/2,c=Math.cos(nu(30))*a,d=Math.sin(nu(30))*a;for(let g=0;g<12;g++)t.moveTo(s,u-a),t.lineTo(s,u+a),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 $v={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>So(e,t,e.theme.textLight),draw:e=>ar(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return $t.createElement(Jr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Nv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:So,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Id(i,l,g,s,o,n,a),ar(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 f.createElement(Jr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:l=>r({...i,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Bv=sn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Wv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:l}=e,[a,s]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{s(!0)},[]);return a?f.createElement(Jr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(Bv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(Vl,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Ed(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-l-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-l/2),{x:i,y:o,width:l,height:a}}function Du(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=rd(l,o.baseFontFull);if(a===void 0)return!1;const s=Ed(a,n,o,t.contentAlign);return jr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,i)}const Uv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:So,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:l,ctx:a}=e,s=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Dr(s,a,n.baseFontFull),d=Ed(c,l,n,t.contentAlign),{x:g,y:h,width:p,height:m}=d;if(i>=g-4&&i<=g-4+p+8&&o>=h-4&&o<=h-4+m+8){const y=Qn(a,n.baseFontFull);r("pointer");const v=5,b=h-y;a.beginPath(),a.moveTo(l.x+g,Math.floor(l.y+b+m+v)+.5),a.lineTo(l.x+g+p,Math.floor(l.y+b+m+v)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,ar({...e,rect:{...l,x:l.x-1}},s,t.contentAlign),ar({...e,rect:{...l,x:l.x-2}},s,t.contentAlign),ar({...e,rect:{...l,x:l.x+1}},s,t.contentAlign),ar({...e,rect:{...l,x:l.x+2}},s,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,ar(e,s,t.contentAlign)},onSelect:e=>{Du(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;Du(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:i,validatedSelection:o}=t;return f.createElement(Wv,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Gv=[Tv,Lv,dv,pv,wv,Sv,Mv,Ev,Hv,zv,$v,Nv,Uv],al=[];class Xv extends ad{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=bg(()=>{this.imageLoaded(new co(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const l=r.cells[o];if(this.isInWindow(l)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const l=al.pop()??new Image;let a=!1;const s={img:void 0,cells:[Kn(n,r)],url:t,cancel:()=>{a||(a=!0,al.length<12?al.unshift(l):o||(l.src=""))}},u=new Promise(c=>l.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{l.src=t,await u,await l.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=l;for(const d of c.cells)this.loadedLocations.push(Yl(d));o=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[i]=s}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const l=Kn(n,r);return o.cells.includes(l)||o.cells.push(l),o.img}else this.loadImage(t,n,r,i)}}const Yv=(e,t)=>{const n=f.useMemo(()=>({...$m,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??Gv,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new Xv,[e.imageWindowLoader]);return f.createElement(cv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},jv=f.forwardRef(Yv);function Ou(e,t){const n=f.useRef(null),r=f.useRef(),i=f.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return f.useEffect(()=>i,[i]),{debouncedCallback:f.useCallback((...l)=>{r.current=l,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}var na={exports:{}};var qv=na.exports,Pu;function Kv(){return Pu||(Pu=1,function(e,t){(function(n,r){try{e.exports=r(hg)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(qv,function(n){var r=!1,i=!1,o=!1,l=!1,a="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(H,L){return L.length>H.length?!1:H.indexOf(L)!==-1}function c(H){for(var L="";H;)L+="0",H-=1;return L}function d(H){for(var L=H.split("").reverse(),Y=0,se=!0;se&&Y<L.length;)Y?L[Y]==="9"?L[Y]="0":(L[Y]=(parseInt(L[Y],10)+1).toString(),se=!1):(parseInt(L[Y],10)<5&&(se=!1),L[Y]="0"),Y+=1;return se&&L.push("1"),L.reverse().join("")}function g(H,L){var Y=P(R(L).sort(),function(le){return le+":"+L[le]}).join(","),se=H+"+"+Y;return g.cache[se]||(g.cache[se]=Intl.NumberFormat(H,L)),g.cache[se]}g.cache={};function h(H,L,Y){var se=L.useToLocaleString,le=L.useGrouping,ve=le&&L.grouping.slice(),ge=L.maximumSignificantDigits,Je=L.minimumIntegerDigits||1,ke=L.fractionDigits||0,Pt=L.groupingSeparator,xt=L.decimalSeparator;if(se&&Y){var Oe={minimumIntegerDigits:Je,useGrouping:le};if(ke&&(Oe.maximumFractionDigits=ke,Oe.minimumFractionDigits=ke),ge&&H>0&&(Oe.maximumSignificantDigits=ge),o){if(!l){var te=O({},L);te.useGrouping=!1,te.decimalSeparator=".",H=parseFloat(h(H,te),10)}return g(Y,Oe).format(H)}else{if(!i){var te=O({},L);te.useGrouping=!1,te.decimalSeparator=".",H=parseFloat(h(H,te),10)}return H.toLocaleString(Y,Oe)}}var me;ge?me=H.toPrecision(ge+1):me=H.toFixed(ke+1);var we,ne,ye,Pe=me.split("e");ye=Pe[1]||"",Pe=Pe[0].split("."),ne=Pe[1]||"",we=Pe[0]||"";var Ee=we.length,st=ne.length,Fe=Ee+st,Ye=we+ne;(ge&&Fe===ge+1||!ge&&st===ke+1)&&(Ye=d(Ye),Ye.length===Fe+1&&(Ee=Ee+1),st&&(Ye=Ye.slice(0,-1)),we=Ye.slice(0,Ee),ne=Ye.slice(Ee)),ge&&(ne=ne.replace(/0*$/,""));var Te=parseInt(ye,10);Te>0?ne.length<=Te?(ne=ne+c(Te-ne.length),we=we+ne,ne=""):(we=we+ne.slice(0,Te),ne=ne.slice(Te)):Te<0&&(ne=c(Math.abs(Te)-we.length)+we+ne,we="0"),ge||(ne=ne.slice(0,ke),ne.length<ke&&(ne=ne+c(ke-ne.length)),we.length<Je&&(we=c(Je-we.length)+we));var Re="";if(le){Pe=we;for(var He;Pe.length;)ve.length&&(He=ve.shift()),Re&&(Re=Pt+Re),Re=Pe.slice(-He)+Re,Pe=Pe.slice(0,-He)}else Re=we;return ne&&(Re=Re+xt+ne),Re}function p(H,L){return H.label.length>L.label.length?-1:H.label.length<L.label.length?1:0}function m(H,L){var Y=[];return I(R(L),function(se){if(se.slice(0,15)==="_durationLabels"){var le=se.slice(15).toLowerCase();I(R(L[se]),function(ve){ve.slice(0,1)===H&&Y.push({type:le,key:ve,label:L[se][ve]})})}}),Y}function y(H,L,Y){return L===1&&Y===null?H:H+H}var v={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:y};function b(H){return Object.prototype.toString.call(H)==="[object Array]"}function k(H){return Object.prototype.toString.call(H)==="[object Object]"}function E(H,L){for(var Y=H.length;Y-=1;)if(L(H[Y]))return H[Y]}function M(H,L){var Y=0,se=H&&H.length||0,le;for(typeof L!="function"&&(le=L,L=function(ve){return ve===le});Y<se;){if(L(H[Y]))return H[Y];Y+=1}}function I(H,L){var Y=0,se=H.length;if(!(!H||!se))for(;Y<se;){if(L(H[Y],Y)===!1)return;Y+=1}}function P(H,L){var Y=0,se=H.length,le=[];if(!H||!se)return le;for(;Y<se;)le[Y]=L(H[Y],Y),Y+=1;return le}function S(H,L){return P(H,function(Y){return Y[L]})}function C(H){var L=[];return I(H,function(Y){Y&&L.push(Y)}),L}function F(H){var L=[];return I(H,function(Y){M(L,Y)||L.push(Y)}),L}function T(H,L){var Y=[];return I(H,function(se){I(L,function(le){se===le&&Y.push(se)})}),F(Y)}function x(H,L){var Y=[];return I(H,function(se,le){if(!L(se))return Y=H.slice(le),!1}),Y}function D(H,L){var Y=H.slice().reverse();return x(Y,L).reverse()}function O(H,L){for(var Y in L)L.hasOwnProperty(Y)&&(H[Y]=L[Y]);return H}function R(H){var L=[];for(var Y in H)H.hasOwnProperty(Y)&&L.push(Y);return L}function N(H,L){var Y=0,se=H.length;if(!H||!se)return!1;for(;Y<se;){if(L(H[Y],Y)===!0)return!0;Y+=1}return!1}function W(H){var L=[];return I(H,function(Y){L=L.concat(Y)}),L}function j(){var H=0;try{H.toLocaleString("i")}catch(L){return L.name==="RangeError"}return!1}function oe(H){return H(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function Q(H){var L=!0;return L=L&&H(1,"en",{minimumIntegerDigits:1})==="1",L=L&&H(1,"en",{minimumIntegerDigits:2})==="01",L=L&&H(1,"en",{minimumIntegerDigits:3})==="001",!(!L||(L=L&&H(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",L=L&&H(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",L=L&&H(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",L=L&&H(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!L)||(L=L&&H(99.99,"en",{maximumSignificantDigits:1})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:2})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:3})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:4})==="99.99",L=L&&H(99.99,"en",{maximumSignificantDigits:5})==="99.99",!L)||(L=L&&H(1e3,"en",{useGrouping:!0})==="1,000",L=L&&H(1e3,"en",{useGrouping:!1})==="1000",!L))}function re(){var H=[].slice.call(arguments),L={},Y;if(I(H,function(ge,Je){if(!Je){if(!b(ge))throw"Expected array as the first argument to durationsFormat.";Y=ge}if(typeof ge=="string"||typeof ge=="function"){L.template=ge;return}if(typeof ge=="number"){L.precision=ge;return}k(ge)&&O(L,ge)}),!Y||!Y.length)return[];L.returnMomentTypes=!0;var se=P(Y,function(ge){return ge.format(L)}),le=T(a,F(S(W(se),"type"))),ve=L.largest;return ve&&(le=le.slice(0,ve)),L.returnMomentTypes=!1,L.outputTypes=le,P(Y,function(ge){return ge.format(L)})}function ue(){var H=[].slice.call(arguments),L=O({},this.format.defaults),Y=this.asMilliseconds(),se=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(Y=0,se=0);var le=Y<0,ve=n.duration(Math.abs(Y),"milliseconds"),ge=n.duration(Math.abs(se),"months");I(H,function(B){if(typeof B=="string"||typeof B=="function"){L.template=B;return}if(typeof B=="number"){L.precision=B;return}k(B)&&O(L,B)});var Je={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},ke={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};L.types=a;var Pt=function(B){return M(a,function(ze){return ke[ze].test(B)})},xt=new RegExp(P(a,function(B){return ke[B].source}).join("|"),"g");L.duration=this;var Oe=typeof L.template=="function"?L.template.apply(L):L.template,te=L.outputTypes,me=L.returnMomentTypes,we=L.largest,ne=[];te||(b(L.stopTrim)&&(L.stopTrim=L.stopTrim.join("")),L.stopTrim&&I(L.stopTrim.match(xt),function(B){var ze=Pt(B);ze==="escape"||ze==="general"||ne.push(ze)}));var ye=n.localeData();ye||(ye={}),I(R(v),function(B){if(typeof v[B]=="function"){ye[B]||(ye[B]=v[B]);return}ye["_"+B]||(ye["_"+B]=v[B])}),I(R(ye._durationTimeTemplates),function(B){Oe=Oe.replace("_"+B+"_",ye._durationTimeTemplates[B])});var Pe=L.userLocale||n.locale(),Ee=L.useLeftUnits,st=L.usePlural,Fe=L.precision,Ye=L.forceLength,Te=L.useGrouping,Re=L.trunc,He=L.useSignificantDigits&&Fe>0,ht=He?L.precision:0,tt=ht,je=L.minValue,gt=!1,Gt=L.maxValue,Dt=!1,ct=L.useToLocaleString,qt=L.groupingSeparator,Kt=L.decimalSeparator,Dn=L.grouping;ct=ct&&(r||o);var It=L.trim;b(It)&&(It=It.join(" ")),It===null&&(we||Gt||He)&&(It="all"),(It===null||It===!0||It==="left"||It==="right")&&(It="large"),It===!1&&(It="");var pt=function(B){return B.test(It)},On=/large/,Ct=/small/,un=/both/,gn=/mid/,Ie=/^all|[^sm]all/,mt=/final/,Tt=we>0||N([On,un,Ie],pt),dn=N([Ct,un,Ie],pt),Bt=N([gn,Ie],pt),rn=N([mt,Ie],pt),Pn=P(Oe.match(xt),function(B,ze){var Ge=Pt(B);return B.slice(0,1)==="*"&&(B=B.slice(1),Ge!=="escape"&&Ge!=="general"&&ne.push(Ge)),{index:ze,length:B.length,text:"",token:Ge==="escape"?B.replace(ke.escape,"$1"):B,type:Ge==="escape"||Ge==="general"?null:Ge}}),on={index:0,length:0,token:"",text:"",type:null},Zt=[];Ee&&Pn.reverse(),I(Pn,function(B){if(B.type){(on.type||on.text)&&Zt.push(on),on=B;return}Ee?on.text=B.token+on.text:on.text+=B.token}),(on.type||on.text)&&Zt.push(on),Ee&&Zt.reverse();var Ue=T(a,F(C(S(Zt,"type"))));if(!Ue.length)return S(Zt,"text").join("");Ue=P(Ue,function(B,ze){var Ge=ze+1===Ue.length,Ot=!ze,an;B==="years"||B==="months"?an=ge.as(B):an=ve.as(B);var fn=Math.floor(an),In=an-fn,pn=M(Zt,function(Wt){return B===Wt.type});return Ot&&Gt&&an>Gt&&(Dt=!0),Ge&&je&&Math.abs(L.duration.as(B))<je&&(gt=!0),Ot&&Ye===null&&pn.length>1&&(Ye=!0),ve.subtract(fn,B),ge.subtract(fn,B),{rawValue:an,wholeValue:fn,decimalValue:Ge?In:0,isSmallest:Ge,isLargest:Ot,type:B,tokenLength:pn.length}});var kt=Re?Math.floor:Math.round,Rn=function(B,ze){var Ge=Math.pow(10,ze);return kt(B*Ge)/Ge},Lt=!1,bt=!1,Cn=function(B,ze){var Ge={useGrouping:Te,groupingSeparator:qt,decimalSeparator:Kt,grouping:Dn,useToLocaleString:ct};return He&&(ht<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(Ge.maximumSignificantDigits=ht,B.significantDigits=ht)),Dt&&!bt&&(B.isLargest?(B.wholeValue=Gt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),gt&&!bt&&(B.isSmallest?(B.wholeValue=je,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Fe<0?B.value=Rn(B.wholeValue,Fe):Fe===0?B.value=kt(B.wholeValue+B.decimalValue):He?(Re?B.value=Rn(B.rawValue,ht-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ht-=B.wholeValue.toString().length)):(Ge.fractionDigits=Fe,Re?B.value=B.wholeValue+Rn(B.decimalValue,Fe):B.value=B.wholeValue+B.decimalValue):He&&B.wholeValue?(B.value=Math.round(Rn(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ht-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(Ye||Lt)&&(Ge.minimumIntegerDigits=B.tokenLength,bt&&Ge.maximumSignificantDigits<B.tokenLength&&delete Ge.maximumSignificantDigits),!Lt&&(B.value>0||It===""||M(ne,B.type)||M(te,B.type))&&(Lt=!0),B.formattedValue=h(B.value,Ge,Pe),Ge.useGrouping=!1,Ge.decimalSeparator=".",B.formattedValueEn=h(B.value,Ge,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=h(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(Ue=P(Ue,Cn),Ue=C(Ue),Ue.length>1){var er=function(B){return M(Ue,function(ze){return ze.type===B})},tr=function(B){var ze=er(B.type);ze&&I(B.targets,function(Ge){var Ot=er(Ge.type);Ot&&parseInt(ze.formattedValueEn,10)===Ge.value&&(ze.rawValue=0,ze.wholeValue=0,ze.decimalValue=0,Ot.rawValue+=1,Ot.wholeValue+=1,Ot.decimalValue=0,Ot.formattedValueEn=Ot.wholeValue.toString(),bt=!0)})};I(s,tr)}return bt&&(Lt=!1,ht=tt,Ue=P(Ue,Cn),Ue=C(Ue)),te&&!(Dt&&!L.trim)?(Ue=P(Ue,function(B){return M(te,function(ze){return B.type===ze})?B:null}),Ue=C(Ue)):(Tt&&(Ue=x(Ue,function(B){return!B.isSmallest&&!B.wholeValue&&!M(ne,B.type)})),we&&Ue.length&&(Ue=Ue.slice(0,we)),dn&&Ue.length>1&&(Ue=D(Ue,function(B){return!B.wholeValue&&!M(ne,B.type)&&!B.isLargest})),Bt&&(Ue=P(Ue,function(B,ze){return ze>0&&ze<Ue.length-1&&!B.wholeValue?null:B}),Ue=C(Ue)),rn&&Ue.length===1&&!Ue[0].wholeValue&&!(!Re&&Ue[0].isSmallest&&Ue[0].rawValue<je)&&(Ue=[])),me?Ue:(I(Zt,function(B){var ze=Je[B.type],Ge=M(Ue,function(Wt){return Wt.type===B.type});if(!(!ze||!Ge)){var Ot=Ge.formattedValueEn.split(".");Ot[0]=parseInt(Ot[0],10),Ot[1]?Ot[1]=parseFloat("0."+Ot[1],10):Ot[1]=null;var an=ye.durationPluralKey(ze,Ot[0],Ot[1]),fn=m(ze,ye),In=!1,pn={};I(ye._durationLabelTypes,function(Wt){var En=M(fn,function(Sn){return Sn.type===Wt.type&&Sn.key===an});En&&(pn[En.type]=En.label,u(B.text,Wt.string)&&(B.text=B.text.replace(Wt.string,En.label),In=!0))}),st&&!In&&(fn.sort(p),I(fn,function(Wt){if(pn[Wt.type]===Wt.label)return u(B.text,Wt.label)?!1:void 0;if(u(B.text,Wt.label))return B.text=B.text.replace(Wt.label,pn[Wt.type]),!1}))}}),Zt=P(Zt,function(B){if(!B.type)return B.text;var ze=M(Ue,function(Ot){return Ot.type===B.type});if(!ze)return"";var Ge="";return Ee&&(Ge+=B.text),(le&&Dt||!le&&gt)&&(Ge+="< ",Dt=!1,gt=!1),(le&&gt||!le&&Dt)&&(Ge+="> ",Dt=!1,gt=!1),le&&(ze.value>0||It===""||M(ne,ze.type)||M(te,ze.type))&&(Ge+="-",le=!1),B.type==="milliseconds"&&ze.formattedValueMS?Ge+=ze.formattedValueMS:Ge+=ze.formattedValue,Ee||(Ge+=B.text),Ge}),Zt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ae(){var H=this.duration,L=function(ve){return H._data[ve]},Y=M(this.types,L),se=E(this.types,L);switch(Y){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(Y===se)return"d __";case"weeks":return Y===se?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(Y===se)return"M __";case"years":return Y===se?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function de(H){if(!H)throw"Moment Duration Format init cannot find moment instance.";H.duration.format=re,H.duration.fn.format=ue,H.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:ae,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},H.updateLocale("en",v)}var he=function(H,L,Y){return H.toLocaleString(L,Y)};r=j()&&Q(he),i=r&&oe(he);var ce=function(H,L,Y){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(L,Y).format(H)};return o=Q(ce),l=o&&oe(ce),de(n),de})}(na)),na.exports}Kv();const Zv=["true","t","yes","y","on","1"],Jv=["false","f","no","n","off","0"];function Et(e,t=""){return{kind:Z.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function Ti(e){return Object.hasOwn(e,"isError")&&e.isError}function Qv(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Zl(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function El(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Z.Loading,allowOverlay:!1,copyData:""}}function eb(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Tl(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:"dots",themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&!e.isPinned&&{grow:1},...e.width&&{width:e.width}}}function Pi(e,t){return Le(e)?t||{}:Le(t)?e||{}:Cc(e,t)}function Jl(e){if(Le(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:lt(n)):[lt(t)]}catch{return[lt(e)]}}function Td(e){return typeof e=="string"||e instanceof String?!0:(e instanceof kh&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function tb(e){return e?.startsWith("{")&&e.endsWith("}")}function lt(e){try{try{return xh(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function Dd(e){if(Le(e))return null;if(typeof e=="boolean")return e;const t=lt(e).toLowerCase().trim();if(t==="")return null;if(Zv.includes(t))return!0;if(Jv.includes(t))return!1}function mo(e){if(Le(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=io.unformat(e.trim());if(at(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Od(e){return Le(e)?"":lt(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function ha(e){if(Le(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return lt(e)}}function nb(e){if(e===0||Math.abs(e)>=1e-4)return 4;const n=e.toExponential().split("e");return Math.abs(parseInt(n[1],10))}function Ur(e,t={}){const n=navigator.languages;try{return new Intl.NumberFormat(n,t).format(e)}catch(r){if(r instanceof RangeError)return new Intl.NumberFormat(void 0,t).format(e);throw r}}function ga(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Le(t)||t===""?at(n)?(n===0&&(e=Math.round(e)),io(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):io(e).format({thousandSeparated:!1,mantissa:nb(e),trimMantissa:!0}):t==="plain"?io(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?Ur(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?Ur(e,{style:"percent",minimumFractionDigits:at(n)?Math.max(n-2,0):0,maximumFractionDigits:at(n)?Math.max(n-2,0):2}):t==="dollar"?Ur(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?Ur(e,{style:"currency",currency:"EUR",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Ur(e,{style:"currency",currency:"JPY",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Ur(e,{notation:t}):t==="accounting"?io(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?Ur(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):mg.sprintf(t,e)}function Lu(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,i=n==="time"?void 0:"medium",o=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:i,timeStyle:o}).format(e.toDate())}catch(l){if(l instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:i,timeStyle:o}).format(e.toDate());throw l}}else{if(t==="distance")return e.fromNow();if(t==="calendar")return e.calendar();if(t==="iso8601")return n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString()}return e.format(t)}function jo(e){if(Le(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=Gr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Gr.utc(e);if(n.isValid())return n.toDate();const r=Gr.utc(e,[Gr.HTML5_FMT.TIME_MS,Gr.HTML5_FMT.TIME_SECONDS,Gr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Pd(e){if(e%1===0)return 0;let t=e.toString();return t.indexOf("e")!==-1&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),t.indexOf(".")===-1?0:t.split(".")[1].length}function rb(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,i=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*i)/n}const ib=new RegExp(/(\r\n|\n|\r)/gm);function vo(e){return e.indexOf(`
177
177
  `)!==-1?e.replace(ib," "):e}function ob(e,t){if(Le(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const ab=Jn("div",{target:"e1ugbj0f0"})(({theme:e})=>({overflowY:"auto",padding:e.spacing.sm,".react-json-view .copy-icon svg":{fontSize:"0.9em !important",marginRight:`${e.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),Ld=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?Ka.parse(e):Ka.parse(Ka.stringify(e))}catch{n=void 0}return Le(n)?Ne(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:ha(e)??"",onChange:()=>{}}):Ne(ab,{"data-testid":"stJsonColumnViewer",children:Ne(vg,{src:n,collapsed:2,theme:Mh(t.bgCell)>.5?"rjv-default":"monokai",displayDataTypes:!1,displayObjectSize:!1,name:!1,enableClipboard:!0,style:{fontFamily:t.fontFamily,fontSize:t.baseFontStyle,backgroundColor:t.bgCell,whiteSpace:"pre-wrap"}})})},lb=e=>{const t=e.theme,n=e.value.data;return Ne(Ld,{jsonValue:n.value||n.displayValue,theme:t})},sb=e=>{const t=e.theme,n=e.value;return Ne(Ld,{jsonValue:n.data,theme:t})},ub={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return Wl(e,r??ha(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??ha(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:lb})},Fd="line_chart",cb="area_chart",Ad="bar_chart",db=e=>new Map(Object.entries({red:e.colors.redColor,blue:e.colors.blueColor,green:e.colors.greenColor,yellow:e.colors.yellowColor,violet:e.colors.violetColor,orange:e.colors.orangeColor,gray:e.colors.grayColor,grey:e.colors.grayColor,primary:e.colors.primary}));function Ql(e,t,n,r){const i=Pi({y_min:null,y_max:null,color:void 0},t.columnTypeOptions),o=db(r);let l;i.color==="auto"||i.color==="auto-inverse"?l=r.colors.greenColor:l=i.color?o.get(i.color)??i.color:void 0;const a={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:l,yAxis:[i.y_min??0,i.y_max??1]}};return{...t,kind:e,typeIcon:e===Fd?":material/show_chart:":e===Ad?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(s){if(Le(s))return El();const u=Jl(s),c=[];let d=[];if(u.length===0)return El();let g=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER;for(let v=0;v<u.length;v++){const b=mo(u[v]);if(Number.isNaN(b)||Le(b))return Et(lt(u),`The value cannot be interpreted as a numeric array. ${lt(b)} is not a number.`);b>g&&(g=b),b<h&&(h=b),c.push(b)}let p,m;if(u.length===1){let v;g<=0?v=g===0?1:0:v=g,p=i.y_max??v,m=i.y_min??(g>=0?0:g)}else p=i.y_max??g,m=i.y_min??h;if(Le(m)||Le(p)||Number.isNaN(m)||Number.isNaN(p)||m>=p)return Et("Invalid min/max y-axis configuration",`The y_min (${m}) and y_max (${p}) configuration options must be valid numbers.`);c.length>0&&(g>p||h<m)?d=c.map(v=>g-h===0?g>(p||1)?p:m:(p-m)*((v-h)/(g-h))+m):d=c;let y=l;return(i.color==="auto"&&d[0]>d[d.length-1]||i.color==="auto-inverse"&&d[0]<d[d.length-1])&&(y=r.colors.redColor),{...a,copyData:c.join(","),data:{...a.data,values:d,displayValues:c.map(v=>ga(v)),yAxis:[m,p],color:y},isMissingValue:Le(s)}},getCellValue(s){return s.kind===Z.Loading||s.data?.values===void 0?null:s.data?.values}}}function _d(e,t){return Ql(Fd,e,"line",t)}_d.isEditableType=!1;function Hd(e,t){return Ql(Ad,e,"bar",t)}Hd.isEditableType=!1;function zd(e,t){return Ql(cb,e,"area",t)}zd.isEditableType=!1;function es(e,t){const n={kind:Z.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",themeOverride:{roundingRadius:Math.round(Math.min(tn(t.radii.md),tn(t.radii.maxCheckbox)))},getCell(r){let i=null;return i=Dd(r),i===void 0?Et(lt(r),"The value cannot be interpreted as boolean."):{...n,data:i,isMissingValue:Le(i)}},getCellValue(r){return r.data===void 0?null:r.data}}}es.isEditableType=!0;function Fu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function ts(e,t,n,r,i,o,l){const a=Pi({format:n,step:r,timezone:l},t.columnTypeOptions);let s;if(at(a.timezone))try{s=Fu(_s(),a.timezone)?.utcOffset()||void 0}catch{}let u;at(a.min_value)&&(u=jo(a.min_value)||void 0);let c;at(a.max_value)&&(c=jo(a.max_value)||void 0);const d={kind:Z.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:a.step?.toString()||"1",format:i,min:u,max:c}},g=h=>{const p=jo(h);return p===null?!t.isRequired:!(p===void 0||at(u)&&o(p)<o(u)||at(c)&&o(p)>o(c))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(h,p){if(p===!0){const k=g(h);if(k===!1)return Et(lt(h),"Invalid input.");k instanceof Date&&(h=k)}const m=jo(h);let y="",v="",b=s;if(m===void 0)return Et(lt(h),"The value cannot be interpreted as a datetime object.");if(m!==null){let k=_s.utc(m);if(!k.isValid())return Et(lt(m),`Invalid moment date. This should never happen. Please report this bug.
178
178
  Error: ${k.toString()}`);if(a.timezone){try{k=Fu(k,a.timezone)}catch(E){return Et(k.toISOString(),`Failed to adjust to the provided timezone: ${a.timezone}.
@@ -184,5 +184,5 @@ Error: ${o}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,content
184
184
  40% { opacity: 1; }
185
185
  `]))),q1=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,l=o.colors,a=o.spacing.baseUnit;return Ae({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?l.neutral60:l.neutral20,padding:a*2})},ul=function(t){var n=t.delay,r=t.offset;return _e("span",{css:Rc({animation:"".concat(j1," 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"},"","")})},K1=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,l=lr(t,$1);return _e("div",$e({},jt(Ae(Ae({},l),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),_e(ul,{delay:0,offset:r}),_e(ul,{delay:160,offset:!0}),_e(ul,{delay:320,offset:!r}))},Z1=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,l=o.colors,a=o.borderRadius,s=o.spacing;return Ae({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?l.neutral5:l.neutral0,borderColor:r?l.neutral10:i?l.primary:l.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:i?l.primary:l.neutral30}})},J1=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,l=t.innerProps,a=t.menuIsOpen;return _e("div",$e({ref:o},jt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),l,{"aria-disabled":r||void 0}),n)},Q1=J1,ew=["data"],tw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},nw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,l=t.Heading,a=t.headingProps,s=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return _e("div",$e({},jt(t,"group",{group:!0}),s),_e(l,$e({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),_e("div",null,n))},rw=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Ae({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"})},iw=function(t){var n=tf(t);n.data;var r=lr(n,ew);return _e("div",$e({},jt(t,"groupHeading",{"group-heading":!0}),r))},ow=nw,aw=["innerRef","isDisabled","isHidden","inputClassName"],lw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,l=o.spacing,a=o.colors;return Ae(Ae({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},sw),n?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:a.neutral80})},df={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},sw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ae({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},df)},uw=function(t){return Ae({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},df)},cw=function(t){var n=t.cx,r=t.value,i=tf(t),o=i.innerRef,l=i.isDisabled,a=i.isHidden,s=i.inputClassName,u=lr(i,aw);return _e("div",$e({},jt(t,"input",{"input-container":!0}),{"data-value":r||""}),_e("input",$e({className:n({input:!0},s),ref:o,style:uw(a),disabled:l},u)))},dw=cw,fw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors;return Ae({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:l.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},hw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,l=t.cropWithEllipsis;return Ae({overflow:"hidden",textOverflow:l||l===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},gw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors,a=t.isFocused;return Ae({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?l.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},ff=function(t){var n=t.children,r=t.innerProps;return _e("div",r,n)},pw=ff,mw=ff;function vw(e){var t=e.children,n=e.innerProps;return _e("div",$e({role:"button"},n),t||_e(hs,{size:14}))}var bw=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,l=t.isDisabled,a=t.removeProps,s=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return _e(u,{data:i,innerProps:Ae(Ae({},jt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),o),selectProps:s},_e(c,{data:i,innerProps:Ae({},jt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),_e(d,{data:i,innerProps:Ae(Ae({},jt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:s}))},ww=bw,yw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.theme,a=l.spacing,s=l.colors;return Ae({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(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?s.primary:s.primary50}})},Cw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.innerRef,a=t.innerProps;return _e("div",$e({},jt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:l,"aria-disabled":r},a),n)},Sw=Cw,xw=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Ae({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},kw=function(t){var n=t.children,r=t.innerProps;return _e("div",$e({},jt(t,"placeholder",{placeholder:!0}),r),n)},Mw=kw,Rw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,l=i.colors;return Ae({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?l.neutral40:l.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Iw=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return _e("div",$e({},jt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Ew=Iw,gs={ClearIndicator:G1,Control:Q1,DropdownIndicator:W1,DownChevron:uf,CrossIcon:hs,Group:ow,GroupHeading:iw,IndicatorsContainer:z1,IndicatorSeparator:Y1,Input:dw,LoadingIndicator:K1,Menu:k1,MenuList:R1,MenuPortal:P1,LoadingMessage:D1,NoOptionsMessage:T1,MultiValue:ww,MultiValueContainer:pw,MultiValueLabel:mw,MultiValueRemove:vw,Option:Sw,Placeholder:Mw,SelectContainer:F1,SingleValue:Ew,ValueContainer:_1},Tw=function(t){return Ae(Ae({},gs),t.components)},Zu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Dw(e,t){return!!(e===t||Zu(e)&&Zu(t))}function Ow(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Dw(e[n],t[n]))return!1;return!0}function Pw(e,t){t===void 0&&(t=Ow);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var l=e.apply(this,i);return n={lastResult:l,lastArgs:i,lastThis:this},l}return r.clear=function(){n=null},r}var Lw={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"},Fw=function(t){return _e("span",$e({css:Lw},t))},Ju=Fw,Aw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,l=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return l?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,l=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return l?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,l=o===void 0?"":o,a=t.selectValue,s=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(m,y){return m&&m.length?"".concat(m.indexOf(y)+1," of ").concat(m.length):""};if(n==="value"&&a)return"value ".concat(l," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=s?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(l).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},_w=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,l=t.isFocused,a=t.selectValue,s=t.selectProps,u=t.id,c=t.isAppleDevice,d=s.ariaLiveMessages,g=s.getOptionLabel,h=s.inputValue,p=s.isMulti,m=s.isOptionDisabled,y=s.isSearchable,v=s.menuIsOpen,b=s.options,k=s.screenReaderStatus,E=s.tabSelectsValue,M=s.isLoading,I=s["aria-label"],P=s["aria-live"],S=f.useMemo(function(){return Ae(Ae({},Aw),d||{})},[d]),C=f.useMemo(function(){var R="";if(n&&S.onChange){var N=n.option,W=n.options,j=n.removedValue,oe=n.removedValues,Q=n.value,re=function(L){return Array.isArray(L)?null:L},ue=j||N||re(Q),ae=ue?g(ue):"",de=W||oe||void 0,he=de?de.map(g):[],ce=Ae({isDisabled:ue&&m(ue,a),label:ae,labels:he},n);R=S.onChange(ce)}return R},[n,S,m,a,g]),F=f.useMemo(function(){var R="",N=r||i,W=!!(r&&a&&a.includes(r));if(N&&S.onFocus){var j={focused:N,label:g(N),isDisabled:m(N,a),isSelected:W,options:o,context:N===r?"menu":"value",selectValue:a,isAppleDevice:c};R=S.onFocus(j)}return R},[r,i,g,m,S,o,a,c]),T=f.useMemo(function(){var R="";if(v&&b.length&&!M&&S.onFilter){var N=k({count:o.length});R=S.onFilter({inputValue:h,resultsMessage:N})}return R},[o,h,v,S,b,k,M]),x=n?.action==="initial-input-focus",D=f.useMemo(function(){var R="";if(S.guidance){var N=i?"value":v?"menu":"input";R=S.guidance({"aria-label":I,context:N,isDisabled:r&&m(r,a),isMulti:p,isSearchable:y,tabSelectsValue:E,isInitialFocus:x})}return R},[I,r,i,p,m,y,v,S,a,E,x]),O=_e(f.Fragment,null,_e("span",{id:"aria-selection"},C),_e("span",{id:"aria-focused"},F),_e("span",{id:"aria-results"},T),_e("span",{id:"aria-guidance"},D));return _e(f.Fragment,null,_e(Ju,{id:u},x&&O),_e(Ju,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},l&&!x&&O))},Hw=_w,Pl=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],zw=new RegExp("["+Pl.map(function(e){return e.letters}).join("")+"]","g"),hf={};for(var cl=0;cl<Pl.length;cl++)for(var dl=Pl[cl],fl=0;fl<dl.letters.length;fl++)hf[dl.letters[fl]]=dl.base;var gf=function(t){return t.replace(zw,function(n){return hf[n]})},Vw=Pw(gf),Qu=function(t){return t.replace(/^\s+|\s+$/g,"")},$w=function(t){return"".concat(t.label," ").concat(t.value)},Nw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Ae({ignoreCase:!0,ignoreAccents:!0,stringify:$w,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,l=i.ignoreAccents,a=i.stringify,s=i.trim,u=i.matchFrom,c=s?Qu(r):r,d=s?Qu(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),l&&(c=Vw(c),d=gf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},Bw=["innerRef"];function Ww(e){var t=e.innerRef,n=lr(e,Bw),r=m1(n,"onExited","in","enter","exit","appear");return _e("input",$e({ref:t},r,{css:Rc({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 Uw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Gw(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,l=f.useRef(!1),a=f.useRef(!1),s=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(y,v){if(u.current!==null){var b=u.current,k=b.scrollTop,E=b.scrollHeight,M=b.clientHeight,I=u.current,P=v>0,S=E-M-k,C=!1;S>v&&l.current&&(r&&r(y),l.current=!1),P&&a.current&&(o&&o(y),a.current=!1),P&&v>S?(n&&!l.current&&n(y),I.scrollTop=E,C=!0,l.current=!0):!P&&-v>k&&(i&&!a.current&&i(y),I.scrollTop=0,C=!0,a.current=!0),C&&Uw(y)}},[n,r,i,o]),d=f.useCallback(function(y){c(y,y.deltaY)},[c]),g=f.useCallback(function(y){s.current=y.changedTouches[0].clientY},[]),h=f.useCallback(function(y){var v=s.current-y.changedTouches[0].clientY;c(y,v)},[c]),p=f.useCallback(function(y){if(y){var v=h1?{passive:!1}:!1;y.addEventListener("wheel",d,v),y.addEventListener("touchstart",g,v),y.addEventListener("touchmove",h,v)}},[h,g,d]),m=f.useCallback(function(y){y&&(y.removeEventListener("wheel",d,!1),y.removeEventListener("touchstart",g,!1),y.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var y=u.current;return p(y),function(){m(y)}}},[t,p,m]),function(y){u.current=y}}var ec=["boxSizing","height","overflow","paddingRight","position"],tc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function nc(e){e.cancelable&&e.preventDefault()}function rc(e){e.stopPropagation()}function ic(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function oc(){return"ontouchstart"in window||navigator.maxTouchPoints}var ac=!!(typeof window<"u"&&window.document&&window.document.createElement),no=0,Ci={capture:!1,passive:!1};function Xw(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),l=f.useCallback(function(s){if(ac){var u=document.body,c=u&&u.style;if(r&&ec.forEach(function(p){var m=c&&c[p];i.current[p]=m}),r&&no<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(tc).forEach(function(p){var m=tc[p];c&&(c[p]=m)}),c&&(c.paddingRight="".concat(h,"px"))}u&&oc()&&(u.addEventListener("touchmove",nc,Ci),s&&(s.addEventListener("touchstart",ic,Ci),s.addEventListener("touchmove",rc,Ci))),no+=1}},[r]),a=f.useCallback(function(s){if(ac){var u=document.body,c=u&&u.style;no=Math.max(no-1,0),r&&no<1&&ec.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&oc()&&(u.removeEventListener("touchmove",nc,Ci),s&&(s.removeEventListener("touchstart",ic,Ci),s.removeEventListener("touchmove",rc,Ci)))}},[r]);return f.useEffect(function(){if(t){var s=o.current;return l(s),function(){a(s)}}},[t,l,a]),function(s){o.current=s}}var Yw=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},jw={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function qw(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,l=e.onBottomLeave,a=e.onTopArrive,s=e.onTopLeave,u=Gw({isEnabled:i,onBottomArrive:o,onBottomLeave:l,onTopArrive:a,onTopLeave:s}),c=Xw({isEnabled:n}),d=function(h){u(h),c(h)};return _e(f.Fragment,null,n&&_e("div",{onClick:Yw,css:jw}),t(d))}var Kw={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Zw=function(t){var n=t.name,r=t.onFocus;return _e("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Kw,value:"",onChange:function(){}})},Jw=Zw;function ps(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 Qw(){return ps(/^iPhone/i)}function pf(){return ps(/^Mac/i)}function ey(){return ps(/^iPad/i)||pf()&&navigator.maxTouchPoints>1}function ty(){return Qw()||ey()}function ny(){return pf()||ty()}var ry=function(t){return t.label},mf=function(t){return t.label},vf=function(t){return t.value},iy=function(t){return!!t.isDisabled},oy={clearIndicator:U1,container:L1,control:Z1,dropdownIndicator:B1,group:tw,groupHeading:rw,indicatorsContainer:H1,indicatorSeparator:X1,input:lw,loadingIndicator:q1,loadingMessage:E1,menu:C1,menuList:M1,menuPortal:O1,multiValue:fw,multiValueLabel:hw,multiValueRemove:gw,noOptionsMessage:I1,option:yw,placeholder:xw,singleValue:Rw,valueContainer:A1},ay={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%)"},ly=4,bf=4,sy=38,uy=bf*2,cy={baseUnit:bf,controlHeight:sy,menuGutter:uy},hl={borderRadius:ly,colors:ay,spacing:cy},dy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:qu(),captureMenuScroll:!qu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Nw(),formatGroupLabel:ry,getOptionLabel:mf,getOptionValue:vf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:iy,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!d1(),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 lc(e,t,n,r){var i=Cf(e,t,n),o=Sf(e,t,n),l=yf(e,t),a=Ca(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:l,value:a,index:r}}function ia(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(l,a){return lc(e,l,t,a)}).filter(function(l){return uc(e,l)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=lc(e,n,t,r);return uc(e,o)?o:void 0}).filter(g1)}function wf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Ei(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function sc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Ei(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 fy(e,t){return wf(ia(e,t))}function uc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,l=t.label,a=t.value;return(!kf(e)||!o)&&xf(e,{label:l,value:a,data:i},r)}function hy(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 gy(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var gl=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},yf=function(t,n){return t.getOptionLabel(n)},Ca=function(t,n){return t.getOptionValue(n)};function Cf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Sf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Ca(e,t);return n.some(function(i){return Ca(e,i)===r})}function xf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var kf=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},py=1,ms=function(e){kg(n,e);var t=Ig(n);function n(r){var i;if(Rg(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=ny(),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,g=c.name;u.name=g,i.ariaOnChange(s,u),d(s,u)},i.setValue=function(s,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,p=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),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,g=u.name,h=i.state.selectValue,p=d&&i.isOptionSelected(s,h),m=i.isOptionDisabled(s,h);if(p){var y=i.getOptionValue(s);i.setValue(h.filter(function(v){return i.getOptionValue(v)!==y}),"deselect-option",s)}else if(!m)d?i.setValue([].concat(Ei(h),[s]),"select-option",s):i.setValue(s,"select-option");else{i.ariaOnChange(s,{action:"select-option",option:s,name:g});return}c&&i.blurInput()},i.removeValue=function(s){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(s),g=c.filter(function(p){return i.getOptionValue(p)!==d}),h=oo(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:s}),i.focusInput()},i.clearValue=function(){var s=i.state.selectValue;i.onChange(oo(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),g=oo(s,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(s){return gl(i.state.focusableOptionsWithIds,s)},i.getFocusableOptionsWithIds=function(){return sc(ia(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 a1.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(s){return yf(i.props,s)},i.getOptionValue=function(s){return Ca(i.props,s)},i.getStyles=function(s,u){var c=i.props.unstyled,d=oy[s](u,c);d.boxSizing="border-box";var g=i.props.styles[s];return g?g(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 Tw(i.props)},i.buildCategorizedOptions=function(){return ia(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return wf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(s,u){i.setState({ariaSelection:Ae({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),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||g>h}},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 kf(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,g=u.escapeClearsValue,h=u.inputValue,p=u.isClearable,m=u.isDisabled,y=u.menuIsOpen,v=u.onKeyDown,b=u.tabSelectsValue,k=u.openMenuOnFocus,E=i.state,M=E.focusedOption,I=E.focusedValue,P=E.selectValue;if(!m&&!(typeof v=="function"&&(v(s),s.defaultPrevented))){switch(i.blockOptionHover=!0,s.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(I)i.removeValue(I);else{if(!d)return;c?i.popValue():p&&i.clearValue()}break;case"Tab":if(i.isComposing||s.shiftKey||!y||!b||!M||k&&i.isOptionSelected(M,P))return;i.selectOption(M);break;case"Enter":if(s.keyCode===229)break;if(y){if(!M||i.isComposing)return;i.selectOption(M);break}return;case"Escape":y?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):p&&g&&i.clearValue();break;case" ":if(h)return;if(!y){i.openMenu("first");break}if(!M)return;i.selectOption(M);break;case"ArrowUp":y?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":y?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!y)return;i.focusOption("pageup");break;case"PageDown":if(!y)return;i.focusOption("pagedown");break;case"Home":if(!y)return;i.focusOption("first");break;case"End":if(!y)return;i.focusOption("last");break;default:return}s.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++py),i.state.selectValue=wa(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),l=i.buildFocusableOptions(),a=l.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=l[a],i.state.focusedOptionId=gl(o,l[a])}return i}return Mg(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&&ju(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,l=o.isDisabled,a=o.menuIsOpen,s=this.state.isFocused;(s&&!l&&i.isDisabled||s&&a&&!i.menuIsOpen)&&this.focusInput(),s&&l&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!l&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ju(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,l=this.state,a=l.selectValue,s=l.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[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,l=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=l.indexOf(a);a||(s=-1);var u=l.length-1,c=-1;if(l.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:l[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,l=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var s=0,u=a.indexOf(l);l||(u=-1),i==="up"?s=u>0?u-1:a.length-1:i==="down"?s=(u+1)%a.length:i==="pageup"?(s=u-o,s<0&&(s=0)):i==="pagedown"?(s=u+o,s>a.length-1&&(s=a.length-1)):i==="last"&&(s=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[s],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[s])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(hl):Ae(Ae({},hl),this.props.theme):hl}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,l=this.getStyles,a=this.getClassNames,s=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,p=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:l,getClassNames:a,getValue:s,hasValue:m,isMulti:g,isRtl:h,options:p,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,l=i.isMulti;return o===void 0?l:o}},{key:"isOptionDisabled",value:function(i,o){return Cf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Sf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return xf(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var l=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:l,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,l=i.isSearchable,a=i.inputId,s=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),p=h.Input,m=this.state,y=m.inputIsHidden,v=m.ariaSelection,b=this.commonProps,k=a||this.getElementId("input"),E=Ae(Ae(Ae({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!l&&{"aria-readonly":!0}),this.hasValue()?v?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return l?f.createElement(p,$e({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:k,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:s},E)):f.createElement(Ww,$e({id:k,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ba,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},E))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),l=o.MultiValue,a=o.MultiValueContainer,s=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,p=h.controlShouldRenderValue,m=h.isDisabled,y=h.isMulti,v=h.inputValue,b=h.placeholder,k=this.state,E=k.selectValue,M=k.focusedValue,I=k.isFocused;if(!this.hasValue()||!p)return v?null:f.createElement(d,$e({},g,{key:"placeholder",isDisabled:m,isFocused:I,innerProps:{id:this.getElementId("placeholder")}}),b);if(y)return E.map(function(S,C){var F=S===M,T="".concat(i.getOptionLabel(S),"-").concat(i.getOptionValue(S));return f.createElement(l,$e({},g,{components:{Container:a,Label:s,Remove:u},isFocused:F,isDisabled:m,key:T,index:C,removeProps:{onClick:function(){return i.removeValue(S)},onTouchEnd:function(){return i.removeValue(S)},onMouseDown:function(D){D.preventDefault()}},data:S}),i.formatOptionLabel(S,"value"))});if(v)return null;var P=E[0];return f.createElement(c,$e({},g,{data:P,isDisabled:m}),this.formatOptionLabel(P,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,l=this.commonProps,a=this.props,s=a.isDisabled,u=a.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 f.createElement(o,$e({},l,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,l=this.commonProps,a=this.props,s=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,$e({},l,{innerProps:d,isDisabled:s,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,l=i.IndicatorSeparator;if(!o||!l)return null;var a=this.commonProps,s=this.props.isDisabled,u=this.state.isFocused;return f.createElement(l,$e({},a,{isDisabled:s,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var l=this.commonProps,a=this.props.isDisabled,s=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,$e({},l,{innerProps:u,isDisabled:a,isFocused:s}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),l=o.Group,a=o.GroupHeading,s=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,p=this.commonProps,m=this.state.focusedOption,y=this.props,v=y.captureMenuScroll,b=y.inputValue,k=y.isLoading,E=y.loadingMessage,M=y.minMenuHeight,I=y.maxMenuHeight,P=y.menuIsOpen,S=y.menuPlacement,C=y.menuPosition,F=y.menuPortalTarget,T=y.menuShouldBlockScroll,x=y.menuShouldScrollIntoView,D=y.noOptionsMessage,O=y.onMenuScrollToTop,R=y.onMenuScrollToBottom;if(!P)return null;var N=function(ae,de){var he=ae.type,ce=ae.data,H=ae.isDisabled,L=ae.isSelected,Y=ae.label,se=ae.value,le=m===ce,ve=H?void 0:function(){return i.onOptionHover(ce)},ge=H?void 0:function(){return i.selectOption(ce)},Je="".concat(i.getElementId("option"),"-").concat(de),ke={id:Je,onClick:ge,onMouseMove:ve,onMouseOver:ve,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:L};return f.createElement(h,$e({},p,{innerProps:ke,data:ce,isDisabled:H,isSelected:L,key:Je,label:Y,type:he,value:se,isFocused:le,innerRef:le?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ae.data,"menu"))},W;if(this.hasOptions())W=this.getCategorizedOptions().map(function(ue){if(ue.type==="group"){var ae=ue.data,de=ue.options,he=ue.index,ce="".concat(i.getElementId("group"),"-").concat(he),H="".concat(ce,"-heading");return f.createElement(l,$e({},p,{key:ce,data:ae,options:de,Heading:a,headingProps:{id:H,data:ue.data},label:i.formatGroupLabel(ue.data)}),ue.options.map(function(L){return N(L,"".concat(he,"-").concat(L.index))}))}else if(ue.type==="option")return N(ue,"".concat(ue.index))});else if(k){var j=E({inputValue:b});if(j===null)return null;W=f.createElement(d,p,j)}else{var oe=D({inputValue:b});if(oe===null)return null;W=f.createElement(g,p,oe)}var Q={minMenuHeight:M,maxMenuHeight:I,menuPlacement:S,menuPosition:C,menuShouldScrollIntoView:x},re=f.createElement(S1,$e({},p,Q),function(ue){var ae=ue.ref,de=ue.placerProps,he=de.placement,ce=de.maxHeight;return f.createElement(s,$e({},p,Q,{innerRef:ae,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:k,placement:he}),f.createElement(qw,{captureEnabled:v,onTopArrive:O,onBottomArrive:R,lockEnabled:T},function(H){return f.createElement(u,$e({},p,{innerRef:function(Y){i.getMenuListRef(Y),H(Y)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:i.getElementId("listbox")},isLoading:k,maxHeight:ce,focusedOption:m}),W)}))});return F||C==="fixed"?f.createElement(c,$e({},p,{appendTo:F,controlElement:this.controlRef,menuPlacement:S,menuPosition:C}),re):re}},{key:"renderFormField",value:function(){var i=this,o=this.props,l=o.delimiter,a=o.isDisabled,s=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(Jw,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(s)if(l){var g=d.map(function(m){return i.getOptionValue(m)}).join(l);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(m,y){return f.createElement("input",{key:"i-".concat(y),name:u,type:"hidden",value:i.getOptionValue(m)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var p=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,l=o.ariaSelection,a=o.focusedOption,s=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(Hw,$e({},i,{id:this.getElementId("live-region"),ariaSelection:l,focusedOption:a,focusedValue:s,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,l=i.IndicatorsContainer,a=i.SelectContainer,s=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,p=this.state.isFocused,m=this.commonProps=this.getCommonProps();return f.createElement(a,$e({},m,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:p}),this.renderLiveRegion(),f.createElement(o,$e({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:p,menuIsOpen:h}),f.createElement(s,$e({},m,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(l,$e({},m,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var l=o.prevProps,a=o.clearFocusValueOnUpdate,s=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,p=i.value,m=i.menuIsOpen,y=i.inputValue,v=i.isMulti,b=wa(p),k={};if(l&&(p!==l.value||h!==l.options||m!==l.menuIsOpen||y!==l.inputValue)){var E=m?fy(i,b):[],M=m?sc(ia(i,b),"".concat(g,"-option")):[],I=a?hy(o,b):null,P=gy(o,E),S=gl(M,P);k={selectValue:b,focusedOption:P,focusedOptionId:S,focusableOptionsWithIds:M,focusedValue:I,clearFocusValueOnUpdate:!1}}var C=s!=null&&i!==l?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},F=u,T=c&&d;return c&&!T&&(F={value:oo(v,b,b[0]||null),options:b,action:"initial-input-focus"},T=!d),u?.action==="initial-input-focus"&&(F=null),Ae(Ae(Ae({},k),C),{},{prevProps:i,ariaSelection:F,prevWasFocused:T})}}]),n}(f.Component);ms.defaultProps=dy;var my=f.forwardRef(function(e,t){var n=qd(e);return f.createElement(ms,$e({ref:t},n))}),Mf=my;const vy=e=>{const{Menu:t}=gs,{children:n,...r}=e;return f.createElement(t,{...r},n)},by=sn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),wy=sn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),yy=sn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Cy=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:l}=t.data,[a,s]=f.useState(l),[u,c]=f.useState(r??""),d=cd(),g=f.useMemo(()=>o.map(h=>typeof h=="string"||h===null||h===void 0?{value:h,label:h?.toString()??""}:h),[o]);return t.readonly?f.createElement(yy,null,f.createElement(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(by,null,f.createElement(Mf,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(h=>h.value===a),styles:{control:h=>({...h,border:0,boxShadow:"none"}),option:(h,{isFocused:p})=>({...h,fontSize:d.editorFontSize,fontFamily:d.fontFamily,cursor:p?"pointer":void 0,paddingLeft:d.cellHorizontalPadding,paddingRight:d.cellHorizontalPadding,":active":{...h[":active"],color:d.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:h=>({...h,colors:{...h.colors,neutral0:d.bgCell,neutral5:d.bgCell,neutral10:d.bgCell,neutral20:d.bgCellMedium,neutral30:d.bgCellMedium,neutral40:d.bgCellMedium,neutral50:d.textLight,neutral60:d.textMedium,neutral70:d.textMedium,neutral80:d.textDark,neutral90:d.textDark,neutral100:d.textDark,primary:d.accentColor,primary75:d.accentColor,primary50:d.accentColor,primary25:d.accentLight}}),menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:h=>f.createElement(wy,null,f.createElement(vy,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(s(h.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:h.value}}))}}))},Sy={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,l=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===o:s.value===o),a=typeof l=="string"?l:l?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+Qn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Cy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.some(n=>n==null?!1:typeof n=="string"?n===e:n.value===e)?e:t.value})};function xy(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],l=i*t;return e.replace(n,`${Number(l.toPrecision(3))}${o}`)}return e}const ky={marginRight:8},My={display:"flex",alignItems:"center",flexGrow:1},Ry={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:l,value:a,label:s,measureLabel:u,color:c}=t.data,d=i.x+r.cellHorizontalPadding,g=i.y+i.height/2,h=l-o,p=(a-o)/h,m=`${xy(r.baseFontStyle,.9)} ${r.fontFamily}`,v=Ul(n,m)/2;n.save();let b=0;s!==void 0&&(n.font=m,b=Dr(u??s,n,m).width+r.cellHorizontalPadding);const k=i.width-r.cellHorizontalPadding*2-b;if(k>=v){const E=n.createLinearGradient(d,g,d+k,g),M=c??r.accentColor;E.addColorStop(0,M),E.addColorStop(p,M),E.addColorStop(p,r.bgBubble),E.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=E,Wu(n,d,g-v/2,k,v,v/2),n.fill(),n.beginPath(),Wu(n,d+.5,g-v/2+.5,k-1,v-1,(v-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,g+Qn(n,m))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),l=t.step.toString(),a=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return f.createElement("label",{style:My},f.createElement("input",{style:ky,type:"range",value:r,min:i,max:o,step:l,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Iy=sn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),pl=(e,t,n)=>{if(t==null)return"";n&&(t=new Date(t.getTime()+n));const r=t.toISOString();switch(e){case"date":return r.split("T")[0];case"datetime-local":return r.replace("Z","");case"time":return r.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Ey=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,l=t.min instanceof Date?pl(n,t.min,o):t.min,a=t.max instanceof Date?pl(n,t.max,o):t.max,s=pl(n,t.date,o);return e.value.readonly?$t.createElement(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):$t.createElement(Iy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:l,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},Ty={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Wl(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Ey}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}};var Dy=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],cc=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),l=String(r.getOptionLabel(n)).toLowerCase();return o===i||l===i},ml={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return cc(t,o,i)})||r.some(function(o){return cc(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function Oy(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,l=o===void 0?ml.formatCreateLabel:o,a=e.isValidNewOption,s=a===void 0?ml.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?ml.getNewOptionData:u,d=e.onCreateOption,g=e.options,h=g===void 0?[]:g,p=e.onChange,m=lr(e,Dy),y=m.getOptionValue,v=y===void 0?vf:y,b=m.getOptionLabel,k=b===void 0?mf:b,E=m.inputValue,M=m.isLoading,I=m.isMulti,P=m.value,S=m.name,C=f.useMemo(function(){return s(E,wa(P),h,{getOptionValue:v,getOptionLabel:k})?c(E,l(E)):void 0},[l,c,k,v,E,s,h,P]),F=f.useMemo(function(){return(n||!M)&&C?i==="first"?[C].concat(Ei(h)):[].concat(Ei(h),[C]):h},[n,i,M,C,h]),T=f.useCallback(function(x,D){if(D.action!=="select-option")return p(x,D);var O=Array.isArray(x)?x:[x];if(O[O.length-1]===C){if(d)d(E);else{var R=c(E,E),N={action:"create-option",name:S,option:R};p(oo(I,[].concat(Ei(wa(P)),[R]),R),N)}return}p(x,D)},[c,E,I,S,C,d,p,P]);return Ae(Ae({},m),{},{options:F,onChange:T})}var Py=f.forwardRef(function(e,t){var n=qd(e),r=Oy(n);return f.createElement(ms,$e({ref:t},r))}),Ly=Py;const vs="__value",Fy=new RegExp(`^${vs}\\d+__`),Ay=sn("div")({name:"Wrap",class:"gdg-w1i61rz",propsAsIs:!1}),_y=sn("div")({name:"PortalWrap",class:"gdg-phbadu4",propsAsIs:!1}),oa=e=>e.map(t=>typeof t=="string"||t===null||t===void 0?{value:t,label:t??"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color??void 0}),Rf=(e,t,n)=>e==null?[]:e.map((r,i)=>{const o=n?`${vs}${i}__`:"",l=t.find(a=>a.value===r);return l?{...l,value:`${o}${l.value}`}:{value:`${o}${r}`,label:r}}),Hy=e=>{const{Menu:t}=gs,{children:n,...r}=e;return f.createElement(t,{...r},n)},zy=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:i,portalElementRef:o}=e,{options:l,values:a,allowCreation:s,allowDuplicates:u}=t.data,c=cd(),[d,g]=f.useState(a),[h,p]=f.useState(!0),[m,y]=f.useState(n??""),v=f.useMemo(()=>oa(l??[]),[l]),b=s&&u&&v.length===0,k=f.useCallback(S=>{h&&S.stopPropagation()},[h]),E={control:(S,C)=>({...S,border:0,boxShadow:"none",backgroundColor:c.bgCell,pointerEvents:C.isDisabled?"auto":S.pointerEvents,cursor:C.isDisabled?"default":S.cursor}),valueContainer:S=>({...S,flexWrap:S.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:S=>({...S,backgroundColor:c.bgCell}),option:(S,C)=>({...S,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark,...C.isFocused?{backgroundColor:c.accentLight,cursor:"pointer"}:{},":active":{...S[":active"],color:c.accentFg,backgroundColor:c.accentColor}}),input:(S,{isDisabled:C})=>C?{display:"none"}:{...S,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark},placeholder:S=>({...S,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),noOptionsMessage:S=>({...S,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),clearIndicator:S=>({...S,color:c.textLight,":hover":{color:c.textDark,cursor:"pointer"}}),multiValue:(S,{data:C})=>({...S,backgroundColor:C.color??c.bgBubble,borderRadius:`${c.roundingRadius??c.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(S,{data:C,isDisabled:F})=>({...S,paddingRight:F?c.bubblePadding:0,paddingLeft:c.bubblePadding,paddingTop:0,paddingBottom:0,color:C.color?Cl(C.color)>.5?"black":"white":c.textBubble,fontSize:c.editorFontSize,fontFamily:c.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:c.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(S,{data:C,isDisabled:F,isFocused:T})=>F?{display:"none"}:{...S,color:C.color?Cl(C.color)>.5?"black":"white":c.textBubble,backgroundColor:void 0,borderRadius:T?`${c.roundingRadius??c.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}},M=f.useCallback(S=>{const C=S.map(F=>u&&F.startsWith(vs)?F.replace(new RegExp(Fy),""):F);g(C),r({...t,data:{...t.data,values:C}})},[t,r,u]),I=S=>{switch(S.key){case"Enter":case"Tab":if(!m){i(t,[0,1]);return}u&&s&&(y(""),M([...d??[],m]),p(!1),S.preventDefault())}},P=s?Ly:Mf;return f.createElement(Ay,{onKeyDown:k,"data-testid":"multi-select-cell"},f.createElement(P,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:m,onInputChange:y,options:v,placeholder:t.readonly?"":s?"Add...":void 0,noOptionsMessage:S=>s&&u&&S.inputValue?`Create "${S.inputValue}"`:void 0,menuIsOpen:t.readonly?!1:h,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1),value:Rf(d,v,u),onKeyDown:t.readonly?void 0:I,menuPlacement:"auto",menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:E,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:S=>b?null:f.createElement(_y,null,f.createElement(Hy,{className:"click-outside-ignore",...S}))},onChange:async S=>{S!==null&&M(S.map(C=>C.value))}}))},Vy={kind:Z.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i,highlighted:o}=e,{values:l,options:a}=t.data;if(l==null)return!0;const s=oa(a??[]),u={x:i.x+r.cellHorizontalPadding,y:i.y+r.cellVerticalPadding,width:i.width-2*r.cellHorizontalPadding,height:i.height-2*r.cellVerticalPadding},c=Math.max(1,Math.floor(u.height/(r.bubbleHeight+r.bubblePadding)));let{x:d}=u,g=1,h=c===1?u.y+(u.height-r.bubbleHeight)/2:u.y+(u.height-c*r.bubbleHeight-(c-1)*r.bubblePadding)/2;for(const p of l){const m=s.find(M=>M.value===p),y=m?.color??(o?r.bgBubbleSelected:r.bgBubble),v=m?.label??p,k=Dr(v,n).width+r.bubblePadding*2,E=r.bubbleHeight/2;if(d!==u.x&&d+k>u.x+u.width&&g<c&&(g++,h+=r.bubbleHeight+r.bubblePadding,d=u.x),n.fillStyle=y,n.beginPath(),Zn(n,d,h,k,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?Cl(y)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(v,d+r.bubblePadding,h+E+Qn(n,r)),d+=k+r.bubbleMargin,d>u.x+u.width+r.cellHorizontalPadding&&g>=c)break}return!0},measure:(e,t,n)=>{const{values:r,options:i}=t.data;if(!r)return n.cellHorizontalPadding*2;const o=Rf(r,oa(i??[]),t.data.allowDuplicates).map(a=>a.label??a.value),l=o.reduce((a,s)=>e.measureText(s).width+a+n.bubblePadding*2+n.bubbleMargin,0);return o.length===0?n.cellHorizontalPadding*2:l+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:zy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e||!e.trim())return{...t,values:[]};let n=e.split(",").map(r=>r.trim());if(t.allowDuplicates||(n=n.filter((r,i)=>n.indexOf(r)===i)),!t.allowCreation){const r=oa(t.options??[]);n=n.filter(i=>r.find(o=>o.value===i))}if(n.length!==0)return{...t,values:n}}},$y="None";function dc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Ny=(e,t)=>{const{cell:n,theme:r,ctx:i}=e;Wl({...e,theme:{...r,textDark:r.textLight,headerFontFull:`${r.headerFontStyle} ${r.fontFamily}`,baseFontFull:`${r.baseFontStyle} ${r.fontFamily}`,markerFontFull:`${r.markerFontStyle} ${r.fontFamily}`}},t,n.contentAlign),i.fillStyle=r.textDark};function By(e,t){const n=f.useCallback((i,o)=>{const{cell:l,theme:a,ctx:s,rect:u}=i,c=i.col;if(Ti(l))dc(s,u,a);else if(Zl(l)&&c<e.length){const d=e[c],g=t??$y;["checkbox","line_chart","bar_chart","progress"].includes(d.kind)?o():Ny(i,g),d.isRequired&&d.isEditable&&dc(s,u,a);return}o()},[e,t]),r=f.useMemo(()=>[Bb,Sy,Ry,Ty,Vy,...vb],[]);return{drawCell:n,customRenderers:r}}function Wy(){const e=Kr();return f.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:Xr(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Xr(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:Xr(e.colors.darkenedBgMix100,.9),bgHeaderHovered:Xr(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(tn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${tn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${tn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Xr(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(tn(e.spacing.sm)),cellVerticalPadding:Math.round(tn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:Qh(e.colors.secondaryBg,.1),bubbleHeight:Math.round(tn("1.25rem")),bubblePadding:Math.round(tn(e.spacing.sm)),bubbleMargin:Math.round(tn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(tn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(tn("25rem")),minColumnWidth:Math.round(tn("3.125rem")),maxColumnWidth:Math.round(tn("62.5rem")),maxColumnAutoWidth:Math.round(tn("31.25rem")),defaultRowHeight:Math.round(tn("2.1875rem")),defaultHeaderHeight:Math.round(tn("2.1875rem")),bgRowHovered:eg(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Uy=Al.getLogger("useDataEditor");function Gy(e,t,n,r,i,o,l,a,s){const u=f.useCallback(([m,y],v)=>{const b=e[m];if(!b.isEditable)return;const k=b.indexNumber,E=n.current.getOriginalRowIndex(i(y)),M=r([m,y]),I=b.getCellValue(M),P=b.getCellValue(v);if(!Ti(M)&&P===I)return;const S=b.getCell(P,!0);Ti(S)?Uy.warn(`Not applying the cell edit since it causes this error:
186
186
  ${S.data}`):(n.current.setCell(k,E,{...S,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=f.useCallback(()=>{if(t)return;const m=new Map;e.forEach(y=>{m.set(y.indexNumber,y.getCell(y.defaultValue))}),n.current.addRow(m),l()},[e,n,t,l]),d=f.useCallback(()=>{t||(c(),a())},[c,a,t]),g=f.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const y=m.rows.toArray().map(v=>n.current.getOriginalRowIndex(i(v)));return n.current.deleteRows(y),l(),s(),a(),!1}if(m.current?.range){const y=[],v=m.current.range;for(let b=v.y;b<v.y+v.height;b++)for(let k=v.x;k<v.x+v.width;k++){const E=e[k];E.isEditable&&!E.isRequired&&(y.push({cell:[k,b]}),u([k,b],E.getCell(null)))}return y.length>0&&(a(),o(y)),!1}return!0},[e,n,t,o,i,a,u,s,l]),h=f.useCallback((m,y)=>{const[v,b]=m,k=[];for(let E=0;E<y.length;E++){const M=y[E];if(E+b>=n.current.getNumRows()){if(t)break;c()}for(let I=0;I<M.length;I++){const P=M[I],S=E+b,C=I+v;if(C>=e.length)break;const F=e[C];if(F.isEditable){const T=F.getCell(P,!0);if(at(T)&&!Ti(T)){const x=F.indexNumber,D=n.current.getOriginalRowIndex(i(S)),O=F.getCellValue(r([C,S]));F.getCellValue(T)!==O&&(n.current.setCell(x,D,{...T,lastUpdated:performance.now()}),k.push({cell:[C,S]}))}}}k.length>0&&(a(),o(k))}return!1},[e,n,t,i,r,c,a,o]),p=f.useCallback((m,y)=>{const v=m[0];if(v>=e.length)return!0;const b=e[v];if(b.validateInput){const k=b.validateInput(b.getCellValue(y));return k===!0||k===!1?k:b.getCell(k)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:g,validateCell:p}}const If=",",ao='"',Xy='"',Ef=`
187
- `,Yy="\uFEFF",jy=new RegExp(`[${[If,ao,Ef].join("")}]`),fc=Al.getLogger("useDataExporter");function hc(e){return e.map(t=>qy(t)).join(If)+Ef}function qy(e){if(Le(e))return"";const t=lt(e);return jy.test(t)?`${ao}${t.replace(new RegExp(ao,"g"),Xy+ao)}${ao}`:t}async function gc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Yy));const o=n.map(l=>l.name);await e.write(i.encode(hc(o)));for(let l=0;l<r;l++){const a=[];n.forEach((s,u,c)=>{a.push(s.getCellValue(t([u,l])))}),await e.write(i.encode(hc(a)))}await e.close()}function Ky(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const l=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Fl(()=>import("./es6.x9KsYQg-.js").then(c=>c.a),__vite__mapDeps([21,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:l,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await gc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{fc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let s="";const u=new WritableStream({write:h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await gc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Sg({enforceDownloadInNewTab:r,url:d,filename:l});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(s){fc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function Zy(e,t,n,r){return{getCellContent:f.useCallback(([o,l])=>{if(o>t.length-1)return Et("Column index out of bounds","This error should never happen. Please report this bug.");if(l>n-1)return Et("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],s=a.indexNumber,u=r.current.getOriginalRowIndex(l),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(s,u);if(at(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Et("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${s}; row=${u}`)}const d=e.getCell(u,s),g=pg(e,u,s);return Sb(a,d,g,e.styler?.cssStyles)}catch(a){return Et("Error during cell creation",`This error should never happen. Please report this bug.
187
+ `,Yy="\uFEFF",jy=new RegExp(`[${[If,ao,Ef].join("")}]`),fc=Al.getLogger("useDataExporter");function hc(e){return e.map(t=>qy(t)).join(If)+Ef}function qy(e){if(Le(e))return"";const t=lt(e);return jy.test(t)?`${ao}${t.replace(new RegExp(ao,"g"),Xy+ao)}${ao}`:t}async function gc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Yy));const o=n.map(l=>l.name);await e.write(i.encode(hc(o)));for(let l=0;l<r;l++){const a=[];n.forEach((s,u,c)=>{a.push(s.getCellValue(t([u,l])))}),await e.write(i.encode(hc(a)))}await e.close()}function Ky(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const l=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Fl(()=>import("./es6.D6UMoOIM.js").then(c=>c.a),__vite__mapDeps([21,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:l,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await gc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{fc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let s="";const u=new WritableStream({write:h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await gc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Sg({enforceDownloadInNewTab:r,url:d,filename:l});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(s){fc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function Zy(e,t,n,r){return{getCellContent:f.useCallback(([o,l])=>{if(o>t.length-1)return Et("Column index out of bounds","This error should never happen. Please report this bug.");if(l>n-1)return Et("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],s=a.indexNumber,u=r.current.getOriginalRowIndex(l),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(s,u);if(at(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Et("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${s}; row=${u}`)}const d=e.getCell(u,s),g=pg(e,u,s);return Sb(a,d,g,e.styler?.cssStyles)}catch(a){return Et("Error during cell creation",`This error should never happen. Please report this bug.
188
188
  Error: ${a}`)}},[t,n,e,r])}}function Jy(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,l]=o.location;n(l)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function Qy(e,t,n,r,i){const[o,l]=f.useState({columns:et.empty(),rows:et.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(nn.SelectionMode.SINGLE_ROW)),s=a&&e.selectionMode.includes(nn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(nn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(nn.SelectionMode.MULTI_COLUMN),d=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(nn.SelectionMode.MULTI_CELL)),g=d&&e.selectionMode.includes(nn.SelectionMode.MULTI_CELL),h=o.rows.length>0,p=o.columns.length>0,m=o.current!==void 0,y=f.useCallback(b=>{const k=!qa(b.rows.toArray(),o.rows.toArray()),E=!qa(b.columns.toArray(),o.columns.toArray()),M=!qa(b.current,o.current),I=a&&k||u&&E||d&&M;let P=b;if(E&&P.columns.length>=0){let S=P.columns;r.forEach((C,F)=>{C.isIndex&&(S=S.remove(F))}),S.length<P.columns.length&&(P={...P,columns:S})}l(P),I&&i(P,d)},[o,a,u,d,i,r]),v=f.useCallback((b=!1,k=!1)=>{const E={columns:k?o.columns:et.empty(),rows:b?o.rows:et.empty(),current:void 0};l(E),(!b&&a||!k&&u||d)&&i(E,d)},[o,a,u,d,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:s,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isCellSelectionActivated:d,isMultiCellSelectionActivated:g,isRowSelected:h,isColumnSelected:p,isCellSelected:m,clearSelection:v,processSelectionChange:y}}function eC(e,t,n,r,i,o,l,a,s,u,c){const d=e.rowHeight??t.defaultRowHeight,g=r?2:1,h=e.editingMode===nn.EditingMode.DYNAMIC?1:0,p=n+h,m=sl({numRows:p,rowHeight:d,theme:t,numHeaderRows:g}),y=Rb(e,s),v=kb(s,c),b=Mb(s),k=v?Math.max(1,Math.min(n,3)):1,E=sl({numRows:k,rowHeight:d,theme:t}),M=1e4;let I=Math.max(m,E),P=Math.min(I,t.defaultTableHeight);if(v&&u&&u>0)I=Math.max(u,I);else if(b){const W=Math.ceil(M/d),j=Math.min(p,W),oe=sl({numRows:j,rowHeight:d,theme:t,numHeaderRows:g})+1;P=Math.max(oe,E),I=Math.max(P,I)}else y&&(P=Math.max(y,E),I=Math.max(P,I));o&&(P=Math.min(P,o),I=Math.min(I,o),y||(P=I));const S=t.minColumnWidth+2*t.tableBorderWidth,C=Math.max(i,S);let F,T=C;const x=Xd(e,a),D=Yd(e,a),O=xb(a);x?F=C:D?(F=Math.min(Math.max(D,S),C),T=Math.min(Math.max(D,T),C)):O&&(F=void 0);const[R,N]=f.useState({width:F||"100%",height:v?"100%":P});return f.useLayoutEffect(()=>{x&&R.width==="100%"&&N(W=>({...W,width:C}))},[C]),f.useLayoutEffect(()=>{N(W=>({...W,width:F||"100%"}))},[F]),f.useLayoutEffect(()=>{N(W=>({...W,height:v?"100%":P}))},[P,n,u,v,c]),f.useLayoutEffect(()=>{if(l){const W=x||at(D)&&D>0;N({width:W?T:"100%",height:I})}else N({width:F||"100%",height:P})},[l]),{minHeight:E,maxHeight:I,minWidth:S,maxWidth:T,rowHeight:d,resizableSize:R,setResizableSize:N}}const tC=600,nC="⚠️ Please fill out this cell.";function rC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),l=f.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 g=e[u];if(s.kind==="header"&&at(g))d=g.help;else if(s.kind==="cell"){const h=t([u,c]);Ti(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&Zl(h)?d=nC:Qv(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},tC))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:l}}const Tf=Jn("div",{target:"e32gfpu0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Rr=Jn("div",{target:"e32gfpu1"})(({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}}})),Df=Jn("div",{target:"e32gfpu2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),iC=Jn("div",{target:"e32gfpu3"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS})),oC=Jn("div",{target:"e32gfpu4"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"})),aC=Jn("div",{target:"e32gfpu5"})(({theme:e})=>({display:"flex",alignItems:"center",flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"})),lC=Jn("span",{target:"e32gfpu6"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"})),sC=Jn("button",{target:"e32gfpu7"})(({theme:e})=>({background:"none",border:"none",padding:e.spacing.twoXS,cursor:"pointer",color:e.colors.bodyText,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.md,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}})),pc=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],uC={number:pc,progress:pc,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 cC({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:l}){const a=Kr(),{colors:s,fontSizes:u,radii:c,fontWeights:d}=a,g=uC[e]||[];return g.length===0?Ne(Ic,{}):Ne(xa,{triggerType:Ec.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:Ne(Tf,{role:"menu",children:g.map(h=>wn(Rr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[Ne(jn,{size:"base",iconValue:h.icon}),h.label]},h.format))}),placement:Sa.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:Co(a)?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:l})}const dC=f.memo(cC);function fC({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:l,onHideColumn:a,column:s,onChangeFormat:u,onAutosize:c}){const d=Kr(),[g,h]=f.useState(!1),{colors:p,fontSizes:m,radii:y,fontWeights:v}=d,{isCopied:b,copyToClipboard:k}=tg();f.useEffect(()=>{function I(P){P.preventDefault()}return document.addEventListener("wheel",I,{passive:!1}),document.addEventListener("touchmove",I,{passive:!1}),()=>{document.removeEventListener("wheel",I),document.removeEventListener("touchmove",I)}},[]);const E=f.useCallback(()=>{o()},[o]),M=f.useCallback(()=>{k(s.title)},[s.title,k]);return Ne(xa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:wn(Tf,{children:[wn(iC,{children:[Ne(oC,{title:s.kind,children:Ne(jn,{size:"base",iconValue:s.typeIcon||":material/notes:"})}),wn(aC,{title:s.title,children:[Ne(lC,{children:s.title}),Ne(sC,{onClick:M,title:"Copy column name","aria-label":"Copy column name",children:Ne(jn,{size:"sm",iconValue:b?":material/check:":":material/content_copy:"})})]})]}),l&&wn(Ic,{children:[wn(Rr,{onClick:()=>{l("asc"),E()},role:"menuitem",children:[Ne(jn,{size:"base",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),wn(Rr,{onClick:()=>{l("desc"),E()},role:"menuitem",children:[Ne(jn,{size:"base",iconValue:":material/arrow_downward:"}),"Sort descending"]}),Ne(Df,{})]}),u&&Ne(dC,{columnKind:s.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:E,children:wn(Rr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[wn("div",{children:[Ne(jn,{size:"base",iconValue:":material/format_list_numbered:"}),"Format"]}),Ne(jn,{size:"base",iconValue:":material/chevron_right:"})]})}),c&&wn(Rr,{onClick:()=>{c(),E()},children:[Ne(jn,{size:"base",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&wn(Rr,{onClick:()=>{i(),E()},children:[Ne(jn,{size:"base",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&wn(Rr,{onClick:()=>{r(),E()},children:[Ne(jn,{size:"base",iconValue:":material/keep:"}),"Pin column"]}),a&&wn(Rr,{onClick:()=>{a(),E()},children:[Ne(jn,{size:"base",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Sa.bottomRight,accessibilityType:Tc.menu,showArrow:!1,popoverMargin:tn("0.375rem"),onClickOutside:g?void 0:E,onEsc:E,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:Co(d)?p.bgColor:p.secondaryBg,color:p.bodyText,fontSize:m.sm,fontWeight:v.normal,borderTopLeftRadius:y.default,borderTopRightRadius:y.default,borderBottomLeftRadius:y.default,borderBottomRightRadius:y.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:Ne("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const hC=f.memo(fC),gC="(index)";function vl(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const mc=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const i=Kr();return Ne(Cg,{isIndeterminate:n,checked:t,onChange:o=>{r(o.target.checked)},"aria-label":e,checkmarkType:yg.default,labelPlacement:wg.right,overrides:{Root:{style:({$isFocusVisible:o})=>({marginBottom:i.spacing.none,marginTop:i.spacing.none,paddingLeft:i.spacing.md,paddingRight:i.spacing.md,paddingTop:i.spacing.twoXS,paddingBottom:i.spacing.twoXS,backgroundColor:o?i.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:o,$checked:l,$isIndeterminate:a})=>{const s=l||a?i.colors.primary:i.colors.fadedText40;return{outline:0,width:i.sizes.checkbox,height:i.sizes.checkbox,marginTop:i.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:o&&(l||a)?`0 0 0 0.2rem ${Xr(i.colors.primary,.5)}`:"",borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:i.lineHeights.small,paddingLeft:i.spacing.sm,position:"relative",color:i.colors.bodyText,fontSize:i.fontSizes.sm,fontWeight:i.fontWeights.normal}}},children:e})},pC=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:l,onClose:a})=>{const s=Kr(),u=h=>!(h.isHidden===!0||vl(h,t)),c=e.every(u),d=e.some(u)&&!c,g=h=>{e.forEach(p=>{const m=vl(p,t);h?(i(p.id),m&&n(y=>[...y,p.id])):r(p.id)})};return Ne(xa,{triggerType:Ec.click,placement:Sa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>wn("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto"},children:[Ne(mc,{label:"Select all",isIndeterminate:d,initialValue:c,onChange:h=>{g(h)}}),Ne(Df,{}),Ne("div",{children:e.map(h=>{const p=vl(h,t);return Ne(mc,{label:!h.title&&h.isIndex?gC:h.title,initialValue:!(h.isHidden===!0||p),onChange:m=>{m?(i(h.id),p&&n(y=>[...y,h.id])):r(h.id)}},h.id)})})]}),isOpen:l,onClickOutside:a,onClick:()=>l?a():void 0,onEsc:a,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:Co(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:Ne("div",{children:o})})},mC=f.memo(pC),vc=Jn("div",{target:"eofyeyo0"})(({theme:e,disableResize:t,minHeight:n})=>({position:"relative",display:t?"flex":"inline-block",height:"100%","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",minHeight:n,borderRadius:e.radii.default},"& .dvn-scroller":{overflowX:"auto !important",overflowY:"auto !important"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,borderRadius:e.radii.default,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}}));function vC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),l=Kr(),{colors:a,fontSizes:s,radii:u,fontWeights:c}=l,d=f.useCallback(()=>{o(!1),r()},[r,o]);return Ne(xa,{content:Ne(ng,{"data-testid":"stDataFrameTooltipContent",children:Ne(rg,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Sa.top,accessibilityType:Tc.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:Co(l)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:s.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:Ne("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const bC=f.memo(vC),bc=150,wC=15e4,yC="0.5rem";function CC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o,customToolbarActions:l,widthConfig:a,heightConfig:s}){const{expanded:u,expand:c,collapse:d,width:g,height:h}=Fs(cg),{isInHorizontalLayout:p,isInRoot:m}=Fs(ig),y=f.useRef(null),v=f.useRef(null),b=og(),{height:k,elementRef:E}=ag(),M=Wy(),{getRowThemeOverride:I,onItemHovered:P}=Jy(M),{enforceDownloadInNewTab:S=!1}=f.useContext(lg),[C,F]=f.useState(!0),[T,x]=f.useState(!1),[D,O]=f.useState(!1),[R,N]=f.useState(!1),[W,j]=f.useState(),[oe,Q]=f.useState(!1),re=f.useCallback(()=>Q(Ce=>!Ce),[]),ue=f.useCallback(()=>Q(!1),[]),ae=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Le(e.editingMode)&&(e.editingMode=nn.EditingMode.READ_ONLY);const{READ_ONLY:de,DYNAMIC:he}=nn.EditingMode,ce=t.dimensions,H=Math.max(0,ce.numDataRows),L=H===0&&!(e.editingMode===he&&ce.numDataColumns>0),Y=H>wC,se=!Y&&!L&&e.editingMode!==he,le=!L&&e.editingMode===he&&!n,ve=f.useRef(new Ko(H)),[ge,Je]=f.useState(ve.current.getNumRows());f.useEffect(()=>{ve.current=new Ko(H),Je(ve.current.getNumRows())},[H]);const ke=f.useCallback(()=>{ve.current=new Ko(H),Je(ve.current.getNumRows())},[H]),[Pt,xt]=f.useState(e.columnOrder);f.useEffect(()=>{xt(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:Oe,allColumns:te,setColumnConfigMapping:me}=Tb(e,t,n,Pt,a);f.useEffect(()=>{if(e.editingMode===de||!r)return;const Ce=r.getStringValue({id:e.id,formId:e.formId});Ce&&(ve.current.fromJson(Ce,Oe),Je(ve.current.getNumRows()))},[]);const{getCellContent:we}=Zy(t,Oe,ge,ve),{columns:ne,sortColumn:ye,getOriginalIndex:Pe,getCellContent:Ee}=Vb(H,Oe,we),st=f.useCallback((Ce,wt)=>{if(!r)return;const _t={selection:{rows:[],columns:[],cells:[]}};if(_t.selection.rows=Ce.rows.toArray().map(Jt=>Pe(Jt)),_t.selection.columns=Ce.columns.toArray().map(Jt=>Yr(ne[Jt])),wt&&Ce.current){const{cell:Jt,range:Xt}=Ce.current;if(Xt)for(let hn=Xt.y;hn<Xt.y+Xt.height;hn++)for(let Wn=Xt.x;Wn<Xt.x+Xt.width;Wn++)ne[Wn].isIndex||_t.selection.cells.push([Pe(hn),Yr(ne[Wn])]);else if(Jt){const[hn,Wn]=Jt;ne[hn].isIndex||_t.selection.cells.push([Pe(Wn),Yr(ne[hn])])}}const zn=JSON.stringify(_t),Tn=r.getStringValue({id:e.id,formId:e.formId});(Tn===void 0||Tn!==zn)&&r.setStringValue({id:e.id,formId:e.formId},zn,{fromUi:!0},o)},[ne,e.id,e.formId,r,o,Pe]),{debouncedCallback:Fe}=Ou(st,bc),{gridSelection:Ye,isRowSelectionActivated:Te,isMultiRowSelectionActivated:Re,isColumnSelectionActivated:He,isMultiColumnSelectionActivated:ht,isCellSelectionActivated:tt,isMultiCellSelectionActivated:je,isRowSelected:gt,isColumnSelected:Gt,isCellSelected:Dt,clearSelection:ct,processSelectionChange:qt}=Qy(e,L,n,ne,Fe);f.useEffect(()=>{tt||ct(!0,!0)},[u]);const Kt=f.useCallback(Ce=>{v.current?.updateCells(Ce)},[]);f.useEffect(()=>{if(!Te&&!He&&!tt||!r)return;const Ce=r.getStringValue({id:e.id,formId:e.formId});if(Ce){const wt=ne.map(Xt=>Yr(Xt)),_t=JSON.parse(Ce);let zn=et.empty(),Tn=et.empty(),Jt;if(_t.selection?.rows?.forEach(Xt=>{zn=zn.add(Xt)}),_t.selection?.columns?.forEach(Xt=>{Tn=Tn.add(wt.indexOf(Xt))}),tt&&!je){const[Xt,hn]=_t.selection?.cells?.[0]??[];Xt!==void 0&&hn!==void 0&&(Jt=[wt.indexOf(hn),Xt])}if(zn.length>0||Tn.length>0||Jt!==void 0){const Xt={rows:zn,columns:Tn,current:Jt?{cell:Jt,range:{x:Jt[0],y:Jt[1],width:1,height:1},rangeStack:[]}:void 0};qt(Xt)}}},[]);const Dn=f.useCallback(()=>{ge!==ve.current.getNumRows()&&Je(ve.current.getNumRows())},[ge]),It=f.useCallback(()=>{if(!r)return;const Ce=ve.current.toJson(ne);let wt=r.getStringValue({id:e.id,formId:e.formId});wt===void 0&&(wt=new Ko(0).toJson([])),Ce!==wt&&r.setStringValue({id:e.id,formId:e.formId},Ce,{fromUi:!0},o)},[ne,e.id,e.formId,r,o]),{debouncedCallback:pt}=Ou(It,bc),{exportToCsv:On}=Ky(Ee,ne,ge,S),{onCellEdited:Ct,onPaste:un,onRowAppended:gn,onDelete:Ie,validateCell:mt}=Gy(ne,e.editingMode!==he,ve,Ee,Pe,Kt,Dn,pt,ct),Tt=f.useMemo(()=>L?[0]:le?[ge]:[],[L,le,ge]),{tooltip:dn,clearTooltip:Bt,onItemHovered:rn}=rC(ne,Ee,Tt),{drawCell:Pn,customRenderers:on}=By(ne,e.placeholder??void 0),{provideEditor:Zt}=Nb(),Ue=f.useCallback(Ce=>({...Ce,hasMenu:!L}),[L]),kt=f.useMemo(()=>ne.map(Ce=>Ue(Tl(Ce))),[ne,Ue]),{columns:Rn,onColumnResize:Lt}=Lb(kt),bt=t.dimensions.numHeaderRows>1,{minHeight:Cn,maxHeight:er,minWidth:tr,maxWidth:B,rowHeight:ze,resizableSize:Ge,setResizableSize:Ot}=eC(e,M,ge,bt,g||0,h,u,a,s,k,m),an=f.useCallback(([Ce,wt])=>({...eb(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:M.glideTheme.textLight},span:[0,Math.max(ne.length-1,0)]}),[ne,M.glideTheme.textLight]),fn=f.useCallback(()=>{ke(),ct()},[ke,ct]);fg({element:e,widgetMgr:r,onFormCleared:fn});const{pinColumn:In,unpinColumn:pn,freezeColumns:Wt}=Ob(ne,L,g||0,M.minColumnWidth,ct,me),{changeColumnFormat:En}=Db(me),{hideColumn:Sn,showColumn:Li}=$b(ct,me),{onColumnMoved:ei}=Pb(ne,Wt,In,pn,xt);f.useEffect(()=>{let Ce;const wt=requestAnimationFrame(()=>{Ce=setTimeout(()=>{if(E.current&&v.current){const _t=E.current?.querySelector(".dvn-stack")?.getBoundingClientRect();_t&&(O(_t.height>E.current.clientHeight),N(_t.width>E.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(wt),Ce&&clearTimeout(Ce)}},[Ge,ge,Rn,E]),f.useEffect(()=>{te.length==ne.length&&Q(!1)},[te.length,ne.length]);const Pr=!!(p||a?.useContent&&!m);return wn(vc,{className:"stDataFrame","data-testid":"stDataFrame",ref:E,isInHorizontalLayout:p,minHeight:Cn,disableResize:Pr,onPointerDown:Ce=>{if(E.current){const wt=E.current.getBoundingClientRect(),_t=(b||Math.round(tn(yC)))+1;R&&wt.height-_t<Ce.clientY-wt.top&&Ce.stopPropagation(),D&&wt.width-_t<Ce.clientX-wt.left&&Ce.stopPropagation()}},onBlur:Ce=>{!C&&!ae&&!Ce.currentTarget.contains(Ce.relatedTarget)&&!tt&&ct(!0,!0)},children:[wn(dg,{isFullScreen:u,disableFullscreenMode:i,locked:gt&&!Te||Dt||ae&&C||oe,onExpand:c,onCollapse:d,target:vc,children:[l?.map(Ce=>Ce),(Te&&gt||He&&Gt||tt&&Dt)&&Ne(yi,{label:"Clear selection",icon:xg,onClick:()=>{ct(),Bt()}}),le&&gt&&Ne(yi,{label:"Delete row(s)",icon:Eg,onClick:()=>{Ie&&(Ie(Ye),Bt())}}),le&&!gt&&Ne(yi,{label:"Add row",icon:Oc,onClick:()=>{gn&&(F(!0),gn(),Bt(),v.current?.scrollTo(0,ge,"vertical"))}}),!L&&te.length>ne.length&&Ne(mC,{columns:te,columnOrder:Pt,setColumnOrder:xt,hideColumn:Sn,showColumn:Li,isOpen:oe,onClose:ue,children:Ne(yi,{label:"Show/hide columns",icon:Lc,onClick:re})}),!Y&&!L&&Ne(yi,{label:"Download as CSV",icon:Tg,onClick:On}),!L&&Ne(yi,{label:"Search",icon:Pc,onClick:()=>{T?x(!1):(F(!0),x(!0)),Bt()}})]}),Ne(sg,{"data-testid":"stDataFrameResizable",ref:y,defaultSize:Ge,style:{border:`${M.tableBorderWidth}px solid ${M.glideTheme.borderColor}`,borderRadius:`${M.tableBorderRadius}`},minHeight:Cn,maxHeight:er,minWidth:tr,maxWidth:Pr?void 0:B,size:Ge,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!Pr,bottomLeft:!1,topLeft:!1},grid:[1,ze],snapGap:ze/3,onResizeStop:(Ce,wt,_t,zn)=>{if(y.current){const Tn=2*M.tableBorderWidth;Ot({width:y.current.size.width,height:er-y.current.size.height===Tn?y.current.size.height+Tn:y.current.size.height})}},children:Ne(jv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:v,columns:Rn,rows:L?1:ge,minColumnWidth:M.minColumnWidth,maxColumnWidth:M.maxColumnWidth,maxColumnAutoWidth:M.maxColumnAutoWidth,rowHeight:ze,headerHeight:M.defaultHeaderHeight,getCellContent:L?an:Ee,onColumnResize:ae?void 0:Lt,resizeIndicator:"header",freezeColumns:Wt,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:ae?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:He?void 0:ei,onItemHovered:Ce=>{P?.(Ce),rn?.(Ce)},keybindings:{downFill:!0,...tt||Y?{selectAll:!1}:{}},onKeyDown:Ce=>{(Ce.ctrlKey||Ce.metaKey)&&Ce.key==="f"&&(x(wt=>!wt),Ce.stopPropagation(),Ce.preventDefault())},showSearch:T,searchResults:T?void 0:[],onSearchClose:()=>{x(!1),Bt()},onHeaderClicked:(Ce,wt)=>{!se||He||(T&&x(!1),Te&&gt?ct():ct(!0,!0),ye(Ce,"auto"))},gridSelection:Ye,onGridSelectionChange:Ce=>{(C||ae)&&(qt(Ce),dn!==void 0&&Bt(),j(void 0),Q(!1))},theme:M.glideTheme,getRowThemeOverride:I,onMouseMove:Ce=>{Ce.kind==="out-of-bounds"&&C?F(!1):Ce.kind!=="out-of-bounds"&&!C&&F(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:R?-b:void 0,paddingRight:D?-b:void 0},provideEditor:Zt,drawCell:Pn,customRenderers:on,imageEditorOverride:mb,headerIcons:M.headerIcons,validateCell:mt,onHeaderMenuClick:(Ce,wt)=>{oe||j({columnIdx:Ce,headerBounds:wt})},onPaste:!1,...Te&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:M.glideTheme.bgHeader,bgCellMedium:M.glideTheme.bgHeader,textMedium:M.glideTheme.textLight}},rowSelectionMode:Re?"multi":"auto",rowSelect:n?"none":Re?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...He&&{columnSelect:n?"none":ht?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:ht?"multi":"auto",rangeSelectionBlending:"additive"},...tt&&{rangeSelect:je?"rect":"cell",rangeSelectionBlending:"additive"},...!L&&e.editingMode!==de&&!n&&{fillHandle:!ae,onCellEdited:Ct,onPaste:un,onDelete:Ie},...!L&&e.editingMode===he&&{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:gn,onHeaderClicked:void 0}})}),dn?.content&&Ne(bC,{top:dn.top,left:dn.left,content:dn.content,clearTooltip:Bt}),W&&Mc.createPortal(Ne(hC,{top:W.headerBounds.y+W.headerBounds.height,left:W.headerBounds.x+W.headerBounds.width,column:Oe[W.columnIdx],onCloseMenu:()=>j(void 0),onSortColumn:se?Ce=>{T&&x(!1),ct(!(Te&&gt),!0),ye(W.columnIdx,Ce,!0)}:void 0,isColumnPinned:Oe[W.columnIdx].isPinned,onUnpinColumn:()=>{pn(Oe[W.columnIdx].id)},onPinColumn:()=>{In(Oe[W.columnIdx].id)},onHideColumn:()=>{Sn(Oe[W.columnIdx].id)},onChangeFormat:Ce=>{En(Oe[W.columnIdx].id,Ce),setTimeout(()=>{v.current?.remeasureColumns(et.fromSingleSelection(W.columnIdx))},100)},onAutosize:()=>{v.current?.remeasureColumns(et.fromSingleSelection(W.columnIdx))}}),document.querySelector("#portal"))]})}const SC=ug(CC),Of=f.memo(SC),xC=({data:e,height:t,width:n,customToolbarActions:r})=>Ne(Of,{element:new nn({useContainerWidth:!0,editingMode:nn.EditingMode.READ_ONLY,disabled:!0,data:void 0,styler:null,width:void 0,height:t??null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:r,widthConfig:n??new As.WidthConfig({useStretch:!0}),heightConfig:t?new As.HeightConfig({pixelHeight:t}):void 0}),NC=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:xC,default:Of},Symbol.toStringTag,{value:"Module"}));export{O0 as C,xC as R,ud as T,Mi as a,jg as b,NC as c,Si as i,um as m,sn as s};