streamlit-nightly 1.53.2.dev20260202__py3-none-any.whl → 1.54.1.dev20260204__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 (141) hide show
  1. streamlit/commands/logo.py +6 -10
  2. streamlit/components/v2/component_path_utils.py +17 -29
  3. streamlit/config.py +4 -2
  4. streamlit/elements/arrow.py +66 -26
  5. streamlit/elements/lib/built_in_chart_utils.py +1 -1
  6. streamlit/elements/lib/column_config_utils.py +4 -4
  7. streamlit/elements/lib/options_selector_utils.py +4 -0
  8. streamlit/elements/lib/pandas_styler_utils.py +22 -22
  9. streamlit/elements/widgets/button_group.py +221 -86
  10. streamlit/elements/widgets/data_editor.py +9 -9
  11. streamlit/elements/widgets/radio.py +8 -4
  12. streamlit/hello/dataframe_demo.py +1 -1
  13. streamlit/path_security.py +98 -0
  14. streamlit/proto/ArrowData_pb2.py +5 -3
  15. streamlit/proto/ArrowData_pb2.pyi +44 -4
  16. streamlit/proto/ArrowNamedDataSet_pb2.py +4 -4
  17. streamlit/proto/ArrowNamedDataSet_pb2.pyi +3 -3
  18. streamlit/proto/ArrowVegaLiteChart_pb2.py +4 -4
  19. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +3 -3
  20. streamlit/proto/ButtonGroup_pb2.py +8 -8
  21. streamlit/proto/ButtonGroup_pb2.pyi +9 -7
  22. streamlit/proto/Dataframe_pb2.py +31 -0
  23. streamlit/proto/{Arrow_pb2.pyi → Dataframe_pb2.pyi} +39 -102
  24. streamlit/proto/Element_pb2.py +5 -4
  25. streamlit/proto/Element_pb2.pyi +11 -10
  26. streamlit/proto/Table_pb2.py +29 -0
  27. streamlit/proto/Table_pb2.pyi +83 -0
  28. streamlit/runtime/app_session.py +9 -1
  29. streamlit/static/index.html +1 -1
  30. streamlit/static/manifest.json +307 -307
  31. streamlit/static/static/js/{ErrorOutline.esm.CLuz0rSD.js → ErrorOutline.esm.DWBqsdHn.js} +1 -1
  32. streamlit/static/static/js/{FileDownload.esm.CO68LcnZ.js → FileDownload.esm.D5koxJhf.js} +1 -1
  33. streamlit/static/static/js/{FileHelper.DAXgY6Ug.js → FileHelper.kJKftfu4.js} +5 -5
  34. streamlit/static/static/js/{FormClearHelper.zxJ53Nym.js → FormClearHelper.CyGGPn10.js} +1 -1
  35. streamlit/static/static/js/{InputInstructions.CCbg8esE.js → InputInstructions.oezYb8Lm.js} +1 -1
  36. streamlit/static/static/js/{Particles.BJw0A-zv.js → Particles.BIpBmEwi.js} +1 -1
  37. streamlit/static/static/js/{ProgressBar.BrrHeAEh.js → ProgressBar.BRAS_FJc.js} +1 -1
  38. streamlit/static/static/js/{StreamlitSyntaxHighlighter.DvPLy3zk.js → StreamlitSyntaxHighlighter.c2qcx-xG.js} +2 -2
  39. streamlit/static/static/js/{TableChart.esm.BawvAi5p.js → TableChart.esm.BuemQLVW.js} +1 -1
  40. streamlit/static/static/js/{Toolbar.CbpscbNb.js → Toolbar.mUe2Nmta.js} +1 -1
  41. streamlit/static/static/js/{WidgetLabelHelpIconInline.DA4S2HFP.js → WidgetLabelHelpIconInline.if89y2mu.js} +1 -1
  42. streamlit/static/static/js/{base-input.BKKl2eBF.js → base-input.AJ4KxBTh.js} +4 -4
  43. streamlit/static/static/js/{checkbox.CB43AKV4.js → checkbox.GY4JoJkM.js} +1 -1
  44. streamlit/static/static/js/{createDownloadLinkElement.jVwF96ey.js → createDownloadLinkElement.BWJh90jh.js} +1 -1
  45. streamlit/static/static/js/{data-grid-overlay-editor.CxQizSv7.js → data-grid-overlay-editor.C9AINtRf.js} +1 -1
  46. streamlit/static/static/js/{downloader.CKlIgsy5.js → downloader.BZY8OE4f.js} +1 -1
  47. streamlit/static/static/js/{embed.BhRb_2n8.js → embed.BjO7Ez0y.js} +1 -1
  48. streamlit/static/static/js/{es6.DPyfPmWm.js → es6.eb5oR8iN.js} +2 -2
  49. streamlit/static/static/js/{formatNumber.DtfMnnPx.js → formatNumber.CCeQsvJQ.js} +1 -1
  50. streamlit/static/static/js/{iconPosition.DkZAlu_k.js → iconPosition.D6eEnKvO.js} +1 -1
  51. streamlit/static/static/js/{iframeResizer.contentWindow.l5sQWLra.js → iframeResizer.contentWindow.DTsWJRTo.js} +1 -1
  52. streamlit/static/static/js/{index.rvbQETlC.js → index.B6l4FdUv.js} +1 -1
  53. streamlit/static/static/js/{index.BUlT_mOL.js → index.B7H2q9vo.js} +2 -2
  54. streamlit/static/static/js/{index.CsIENsKH.js → index.BDdmrM58.js} +1 -1
  55. streamlit/static/static/js/{index.e6Ry6-Ft.js → index.BMbQnwRD.js} +1 -1
  56. streamlit/static/static/js/{index.CL_icBXS.js → index.BQ5MOzHu.js} +1 -1
  57. streamlit/static/static/js/{index.Ccye_uLl.js → index.BSgo_bkv.js} +1 -1
  58. streamlit/static/static/js/{index.LjqoQCm5.js → index.BU5M9DsN.js} +1 -1
  59. streamlit/static/static/js/{index.Bc_FQ4Wb.js → index.BYIxnU34.js} +1 -1
  60. streamlit/static/static/js/{index.y0h42OXL.js → index.BZL2hIBz.js} +1 -1
  61. streamlit/static/static/js/{index.Dac9Jib-.js → index.BZVrJlnq.js} +1 -1
  62. streamlit/static/static/js/{index.BLD3tJ2C.js → index.Bd7QK46M.js} +1 -1
  63. streamlit/static/static/js/{index.Ck64OQhV.js → index.BfHA_i34.js} +1 -1
  64. streamlit/static/static/js/{index.BpCj2-sQ.js → index.Bgry-Ek_.js} +1 -1
  65. streamlit/static/static/js/{index.D83azq2w.js → index.Bi25zaXA.js} +1 -1
  66. streamlit/static/static/js/{index.Cwg8nWw5.js → index.Bj3M1xBC.js} +1 -1
  67. streamlit/static/static/js/{index.DmWUXdjc.js → index.Bjrvlqx5.js} +16 -16
  68. streamlit/static/static/js/index.BnOSeM5K.js +11 -0
  69. streamlit/static/static/js/index.BoL6J1jK.js +2 -0
  70. streamlit/static/static/js/{index.yHLCvUGh.js → index.BoORyxOa.js} +1 -1
  71. streamlit/static/static/js/{index.DiBeetOH.js → index.Bpd7GPeH.js} +1 -1
  72. streamlit/static/static/js/{index.BzO83wKm.js → index.BpeJX018.js} +1 -1
  73. streamlit/static/static/js/{index.C_19KWNs.js → index.BriH7JVk.js} +1 -1
  74. streamlit/static/static/js/{index.DjuMEZ6m.js → index.BwkeObMo.js} +1 -1
  75. streamlit/static/static/js/{index.CiS4giQ2.js → index.C0o85qmd.js} +1 -1
  76. streamlit/static/static/js/{index.L9pOjBEn.js → index.C7_wNJTH.js} +2 -2
  77. streamlit/static/static/js/{index.DzdPUxsx.js → index.CGZP_w9b.js} +1 -1
  78. streamlit/static/static/js/{index.DKoJr0Se.js → index.CGw52-0-.js} +1 -1
  79. streamlit/static/static/js/{index.6J1N4is3.js → index.CUvtJj0a.js} +1 -1
  80. streamlit/static/static/js/{index.CBbYMKZp.js → index.Cfx1ZHWt.js} +1 -1
  81. streamlit/static/static/js/{index.BAK0CG1Q.js → index.Chl2kALe.js} +1 -1
  82. streamlit/static/static/js/index.Crlx_wdE.js +1 -0
  83. streamlit/static/static/js/{index.WIMtx3m0.js → index.D9A-8ebQ.js} +1 -1
  84. streamlit/static/static/js/{index.y5HxPwg9.js → index.DBIoNOen.js} +21 -21
  85. streamlit/static/static/js/{index.AZ9T4EqJ.js → index.DMKTAe4F.js} +1 -1
  86. streamlit/static/static/js/{index.YutgmD9x.js → index.DNrpqKVt.js} +2 -2
  87. streamlit/static/static/js/{index.Y9wPTZIf.js → index.DSRvF_8e.js} +1 -1
  88. streamlit/static/static/js/{index.DZOGT9vX.js → index.DhB1m_xG.js} +1 -1
  89. streamlit/static/static/js/{index.DR6V0uBJ.js → index.DiES30vM.js} +1 -1
  90. streamlit/static/static/js/{index.CmbqbRMZ.js → index.DlJ4Y1xc.js} +1 -1
  91. streamlit/static/static/js/{index.FioS1Y9m.js → index.J61yByUR.js} +1 -1
  92. streamlit/static/static/js/{index.hnu9U-5g.js → index.JxDTXE8N.js} +1 -1
  93. streamlit/static/static/js/{index.CaU3Uv_L.js → index.KGr28TP8.js} +1 -1
  94. streamlit/static/static/js/{index.465nmxtO.js → index.Pgm3rRpH.js} +1 -1
  95. streamlit/static/static/js/{index.DpSc4e1j.js → index.XzcYOc9I.js} +1 -1
  96. streamlit/static/static/js/{index.OizPL4jg.js → index.Z_u7ZS4h.js} +1 -1
  97. streamlit/static/static/js/{index.CL7it7tU.js → index.hDg7x0Tp.js} +1 -1
  98. streamlit/static/static/js/{index.b_f-McZ5.js → index.k7p0hmaU.js} +1 -1
  99. streamlit/static/static/js/{index.CsEZTo6L.js → index.syoxWolF.js} +1 -1
  100. streamlit/static/static/js/{index.Q2t_iBn0.js → index.xZ651bTg.js} +1 -1
  101. streamlit/static/static/js/{input.CAtwSQ27.js → input.C-PwAMG6.js} +1 -1
  102. streamlit/static/static/js/{main.VeMVx6VI.js → main.fMmyxXOf.js} +1 -1
  103. streamlit/static/static/js/{memory.CxS_lIUn.js → memory.BG__eDEj.js} +1 -1
  104. streamlit/static/static/js/{number-overlay-editor.CoqRgZW_.js → number-overlay-editor.C0n-91sR.js} +1 -1
  105. streamlit/static/static/js/{pandasStylerUtils.DGWgd5sM.js → pandasStylerUtils.BqWaUzvh.js} +1 -1
  106. streamlit/static/static/js/{sandbox.2mSqEau0.js → sandbox.CHhc-txg.js} +1 -1
  107. streamlit/static/static/js/{sprintfjs.CsoVVZ9k.js → sprintfjs.BlFBKfMf.js} +1 -1
  108. streamlit/static/static/js/{styled-components.BShfh7J8.js → styled-components.D5uOQqN2.js} +1 -1
  109. streamlit/static/static/js/{throttle.Fq1DQK4p.js → throttle.DlZC3xNA.js} +1 -1
  110. streamlit/static/static/js/{timepicker.DmyY-qtn.js → timepicker._TfRUaDL.js} +4 -4
  111. streamlit/static/static/js/{toConsumableArray.Dvd9AIqV.js → toConsumableArray.CZW4AmuW.js} +2 -2
  112. streamlit/static/static/js/uniqueId.CTTDAAaF.js +1 -0
  113. streamlit/static/static/js/useBasicWidgetState.Bx27912z.js +1 -0
  114. streamlit/static/static/js/{useIntlLocale.kdIj0ego.js → useIntlLocale.DsOvysl7.js} +1 -1
  115. streamlit/static/static/js/{useTextInputAutoExpand.DkuG1C1S.js → useTextInputAutoExpand.C9g8px1W.js} +1 -1
  116. streamlit/static/static/js/{useUpdateUiValue.-UI_JsjT.js → useUpdateUiValue.fF-Cntkp.js} +1 -1
  117. streamlit/static/static/js/{useWaveformController.C5PTwL6I.js → useWaveformController.C5EtFoJE.js} +1 -1
  118. streamlit/static/static/js/{withCalculatedWidth.BREyS0pJ.js → withCalculatedWidth.CcvaXQb0.js} +1 -1
  119. streamlit/static/static/js/{withFullScreenWrapper.DYDiEOrW.js → withFullScreenWrapper.DP61hzLF.js} +1 -1
  120. streamlit/testing/v1/element_tree.py +20 -15
  121. streamlit/web/server/app_static_file_handler.py +9 -0
  122. streamlit/web/server/bidi_component_request_handler.py +4 -4
  123. streamlit/web/server/component_file_utils.py +14 -6
  124. streamlit/web/server/component_request_handler.py +2 -2
  125. streamlit/web/server/routes.py +14 -0
  126. streamlit/web/server/server.py +4 -0
  127. streamlit/web/server/starlette/starlette_app.py +7 -1
  128. streamlit/web/server/starlette/starlette_path_security_middleware.py +97 -0
  129. streamlit/web/server/starlette/starlette_routes.py +6 -3
  130. streamlit/web/server/starlette/starlette_static_routes.py +14 -4
  131. {streamlit_nightly-1.53.2.dev20260202.dist-info → streamlit_nightly-1.54.1.dev20260204.dist-info}/METADATA +1 -1
  132. {streamlit_nightly-1.53.2.dev20260202.dist-info → streamlit_nightly-1.54.1.dev20260204.dist-info}/RECORD +135 -131
  133. streamlit/proto/Arrow_pb2.py +0 -34
  134. streamlit/static/static/js/index.CAoX2tlo.js +0 -2
  135. streamlit/static/static/js/index.DDr-BLbJ.js +0 -1
  136. streamlit/static/static/js/index.DL_ywOgf.js +0 -11
  137. streamlit/static/static/js/uniqueId.CCajdEK8.js +0 -1
  138. streamlit/static/static/js/useBasicWidgetState.COLQ5AFB.js +0 -1
  139. {streamlit_nightly-1.53.2.dev20260202.dist-info → streamlit_nightly-1.54.1.dev20260204.dist-info}/WHEEL +0 -0
  140. {streamlit_nightly-1.53.2.dev20260202.dist-info → streamlit_nightly-1.54.1.dev20260204.dist-info}/entry_points.txt +0 -0
  141. {streamlit_nightly-1.53.2.dev20260202.dist-info → streamlit_nightly-1.54.1.dev20260204.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.CxQizSv7.js","./index.y5HxPwg9.js","../css/index.C8MrxwGF.css","./withFullScreenWrapper.DYDiEOrW.js","./Toolbar.CbpscbNb.js","./FormClearHelper.zxJ53Nym.js","./moment.C7qA8nIE.js","./pandasStylerUtils.DGWgd5sM.js","./numbro.B9_PXfzp.js","./_baseIndexOf.BTknn6Gb.js","./index.8HslT92O.js","./main.VeMVx6VI.js","./throttle.Fq1DQK4p.js","./toConsumableArray.Dvd9AIqV.js","./formatNumber.DtfMnnPx.js","./sprintfjs.CsoVVZ9k.js","./formatMoment.C6Hwn6X5.js","./checkbox.CB43AKV4.js","./createDownloadLinkElement.jVwF96ey.js","./FileDownload.esm.CO68LcnZ.js","./_arrayIncludes.B19Iyn2B.js","./number-overlay-editor.CoqRgZW_.js","./es6.DPyfPmWm.js"])))=>i.map(i=>d[i]);
2
- import{at as Xa,dg as lh,dh as sh,cN as gc,di as uh,dj as ch,dk as dh,dl as fh,dm as hh,dn as gh,dp as Ya,dq as pc,aT as ph,aU as mh,r as f,E as Pl,_ as Ve,G as ja,an as mo,bG as vh,dr as bh,aD as zt,ds as wh,N as kr,dt as Os,aR as Ll,J as yh,e as Ee,bH as mc,n as ct,du as Ch,j as Ie,dv as Sh,z as Fn,dw as rr,da as ur,dx as Le,dy as Fe,c$ as _o,cX as xh,al as vc,dz as bc,a3 as kh,cY as Mh,cZ as Rh,c_ as Ih,d1 as Eh,bq as wc,ac as en,bt as Th,af as Dh,dA as Oh,dB as Ph,m as vo,b1 as bi,dC as Lh,aS as Fh,dD as _h,dE as yc,ch as Ah,cf as Hh,dF as Cc,dG as zh,dH as Vh,ce as Sc,ci as $h,dI as Nh,cd as Bh,dJ as Wh,br as Uh,bs as Gh,ck as Xh,dK as Yh,O as jh,dL as qh,cl as Kh,dM as Zh,Q as Jh,l as Ur,M as Yt,V as Fl,d3 as Qh,dN as eg,dO as tg,bv as qa,bV as ng,$ as xc,ay as wa,dP as kc,o as pn,Y as Gn,aM as ya,aK as rg,aL as Mc,dQ as ig,q as og,W as Ps,dR as ag,dS as lg,k as sg,L as ug,dT as cg,s as Ls}from"./index.y5HxPwg9.js";import{w as dg,E as fg}from"./withFullScreenWrapper.DYDiEOrW.js";import{T as hg,a as mi}from"./Toolbar.CbpscbNb.js";import{u as gg}from"./FormClearHelper.zxJ53Nym.js";import{h as $r}from"./moment.C7qA8nIE.js";import{r as pg,m as Fs,f as vl,c as mg,a as vg}from"./pandasStylerUtils.DGWgd5sM.js";import{n as bg}from"./numbro.B9_PXfzp.js";import{l as Ka}from"./index.8HslT92O.js";import{R as wg}from"./main.VeMVx6VI.js";import{d as Rc,t as yg}from"./throttle.Fq1DQK4p.js";import{_ as Mi,C as Cg}from"./toConsumableArray.Dvd9AIqV.js";import{f as ra}from"./formatNumber.DtfMnnPx.js";import{f as _s}from"./formatMoment.C6Hwn6X5.js";import{L as Sg,a as xg,S as kg}from"./checkbox.CB43AKV4.js";import{c as Mg}from"./createDownloadLinkElement.jVwF96ey.js";import{D as Rg,F as Ig}from"./FileDownload.esm.CO68LcnZ.js";import{a as Eg}from"./_arrayIncludes.B19Iyn2B.js";function Tg(){}function Dg(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Vn(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Xa(n),n=n===n?n:0),t!==void 0&&(t=Xa(t),t=t===t?t:0),Dg(Xa(e),t,n)}var Og=Object.prototype,Pg=Og.hasOwnProperty;function Lg(e,t){return e!=null&&Pg.call(e,t)}function Fg(e,t){return e!=null&&lh(e,t,Lg)}var _g="[object Map]",Ag="[object Set]",Hg=Object.prototype,zg=Hg.hasOwnProperty;function Vg(e){if(e==null)return!0;if(sh(e)&&(gc(e)||typeof e=="string"||typeof e.splice=="function"||uh(e)||ch(e)||dh(e)))return!e.length;var t=fh(e);if(t==_g||t==Ag)return!e.size;if(hh(e))return!gh(e).length;for(var n in e)if(zg.call(e,n))return!1;return!0}var $g=1/0,Ng=Ya&&1/pc(new Ya([,-0]))[1]==$g?function(e){return new Ya(e)}:Tg,Bg=200;function Wg(e,t,n){var r=-1,i=Eg,o=e.length,s=!0,a=[],l=a;if(o>=Bg){var u=Ng(e);if(u)return pc(u);s=!1,i=mh,l=new ph}else l=a;e:for(;++r<o;){var c=e[r],d=c;if(c=c!==0?c:0,s&&d===d){for(var g=l.length;g--;)if(l[g]===d)continue e;a.push(c)}else i(l,d,n)||(l!==a&&l.push(d),a.push(c))}return a}function Ug(e){return e&&e.length?Wg(e):[]}var Ic=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Pl,Ve({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"}))});Ic.displayName="Add";var Ec=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Pl,Ve({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"}))});Ec.displayName="Search";var Tc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Pl,Ve({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"}))});Tc.displayName="Visibility";function Dc(e="This should not happen"){throw new Error(e)}function Pn(e,t="Assertion failed"){if(!e)return Dc(t)}function lo(e,t){return Dc(t??"Hell froze over")}function Gg(e,t){try{return e()}catch{return t}}const As=Object.prototype.hasOwnProperty;function Ii(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--&&Ii(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(As.call(e,n)&&++r&&!As.call(t,n)||!(n in t)||!Ii(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ia=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 Hs;(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"})(Hs||(Hs={}));var oa;(function(e){e.Triangle="triangle",e.Dots="dots"})(oa||(oa={}));function Ao(e){return"width"in e&&typeof e.width=="number"}async function zs(e){return typeof e=="object"?e:await e()}function wi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Si(e){return e.kind===$n.Marker||e.kind===$n.NewRow}function yi(e){if(!wi(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:lo(e,"A cell was passed with an invalid kind")}}function Xg(e){return Fg(e,"editor")}function Al(e){return!(e.readonly??!1)}var $n;(function(e){e.NewRow="new-row",e.Marker="marker"})($n||($n={}));const aa={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 Vs;class Qe{items;constructor(t){this.items=t}static create=t=>new Qe(Za(t));static empty=()=>Vs??(Vs=new Qe([]));static fromSingleSelection=t=>Qe.empty().add(t);static fromArray=t=>{if(t.length===0)return Qe.empty();const n=t.map(i=>[i,i+1]),r=Za(n);return new Qe(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Qe(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Za([...this.items,n]);return new Qe(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new Qe(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var Yg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},$s=Yg,jg=e=>e.toUpperCase()===e,qg=e=>t=>e.indexOf(t)===-1,Oc=(e,t)=>{const n={};return Object.keys(e).filter(qg(t)).forEach(r=>{n[r]=e[r]}),n};function Kg(e,t,n){const r=Oc(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 Zg=(e,t)=>{};function Jg(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!jg(a[0])):n.propsAsIs,c=Kg(u,o,["as","class"]);c.ref=s,c.className=n.atomic?$s(n.class,c.className||l):$s(c.className||l,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]||"",x=typeof v=="function"?v(o):v;Zg(x,n.name),g[`--${m}`]=`${x}${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 s=Oc(o,["innerRef"]);return r(s,o.innerRef)});return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var dn=Jg;const Qg=dn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ja={},Wi={},Ho={},zo={},Ns;function ep(){return Ns||(Ns=1,(function(e){(function(t,n){n(e,mo(),vh())})(zo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=s(n),o=s(r);function s(b){return b&&b.__esModule?b:{default:b}}var a=Object.assign||function(b){for(var x=1;x<arguments.length;x++){var T=arguments[x];for(var k in T)Object.prototype.hasOwnProperty.call(T,k)&&(b[k]=T[k])}return b};function l(b,x){var T={};for(var k in b)x.indexOf(k)>=0||Object.prototype.hasOwnProperty.call(b,k)&&(T[k]=b[k]);return T}function u(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")}var c=(function(){function b(x,T){for(var k=0;k<T.length;k++){var R=T[k];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(x,R.key,R)}}return function(x,T,k){return T&&b(x.prototype,T),k&&b(x,k),x}})();function d(b,x){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:b}function g(b,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);b.prototype=Object.create(x&&x.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(b,x):b.__proto__=x)}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 x=b.touches[0],T=x.pageX,k=x.pageY;return{x:T,y:k}}var R=b.screenX,P=b.screenY;return{x:R,y:P}}var v=(function(b){g(x,b);function x(){var T;u(this,x);for(var k=arguments.length,R=Array(k),P=0;P<k;P++)R[P]=arguments[P];var I=d(this,(T=x.__proto__||Object.getPrototypeOf(x)).call.apply(T,[this].concat(R)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(k){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(k))}},{key:"_onMouseMove",value:function(k){this.mouseDown&&this._handleSwipeMove(k)}},{key:"_onMouseUp",value:function(k){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(k)}},{key:"_handleSwipeStart",value:function(k){var R=y(k),P=R.x,I=R.y;this.moveStart={x:P,y:I},this.props.onSwipeStart(k)}},{key:"_handleSwipeMove",value:function(k){if(this.moveStart){var R=y(k),P=R.x,I=R.y,C=P-this.moveStart.x,F=I-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:C,y:F},k);D&&k.cancelable&&k.preventDefault(),this.movePosition={deltaX:C,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(k){this.props.onSwipeEnd(k);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,k):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,k),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,k):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,k)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(k){this.swiper=k,this.props.innerRef(k)}},{key:"render",value:function(){var k=this.props;k.tagName;var R=k.className,P=k.style,I=k.children;k.allowMouseEvents,k.onSwipeUp,k.onSwipeDown,k.onSwipeLeft,k.onSwipeRight,k.onSwipeStart,k.onSwipeMove,k.onSwipeEnd,k.innerRef,k.tolerance;var C=l(k,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:P},C),I)}}]),x})(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})})(zo)),zo}var Bs;function Pc(){return Bs||(Bs=1,(function(e){(function(t,n){n(e,ep())})(Ho,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})})(Ho)),Ho}var Ui={},Ws;function Lc(){if(Ws)return Ui;Ws=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.default=void 0;var e=t(bh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Ui.default=r,Ui}var Gi={},Xi={},Us;function tp(){if(Us)return Xi;Us=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Xi.outerWidth=e,Xi}var Yi={},Gs;function Hl(){if(Gs)return Yi;Gs=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Yi.default=e,Yi}var ji={},Xs;function Fc(){if(Xs)return ji;Xs=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.default=void 0;var e=function(){return window};return ji.default=e,ji}var Ys;function _c(){if(Ys)return Gi;Ys=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var e=l(mo()),t=s(Lc()),n=tp(),r=s(Hl()),i=s(Pc()),o=s(Fc());function s(I){return I&&I.__esModule?I:{default:I}}function a(){if(typeof WeakMap!="function")return null;var I=new WeakMap;return a=function(){return I},I}function l(I){if(I&&I.__esModule)return I;if(I===null||u(I)!=="object"&&typeof I!="function")return{default:I};var C=a();if(C&&C.has(I))return C.get(I);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in I)if(Object.prototype.hasOwnProperty.call(I,S)){var E=D?Object.getOwnPropertyDescriptor(I,S):null;E&&(E.get||E.set)?Object.defineProperty(F,S,E):F[S]=I[S]}return F.default=I,C&&C.set(I,F),F}function u(I){"@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(I)}function c(){return c=Object.assign||function(I){for(var C=1;C<arguments.length;C++){var F=arguments[C];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(I[D]=F[D])}return I},c.apply(this,arguments)}function d(I,C){if(!(I instanceof C))throw new TypeError("Cannot call a class as a function")}function g(I,C){for(var F=0;F<C.length;F++){var D=C[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function h(I,C,F){return C&&g(I.prototype,C),I}function p(I,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(C&&C.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),C&&m(I,C)}function m(I,C){return m=Object.setPrototypeOf||function(D,S){return D.__proto__=S,D},m(I,C)}function y(I){var C=x();return function(){var D=T(I),S;if(C){var E=T(this).constructor;S=Reflect.construct(D,arguments,E)}else S=D.apply(this,arguments);return v(this,S)}}function v(I,C){return C&&(u(C)==="object"||typeof C=="function")?C:b(I)}function b(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function x(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function T(I){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},T(I)}function k(I,C,F){return C in I?Object.defineProperty(I,C,{value:F,enumerable:!0,configurable:!0,writable:!0}):I[C]=F,I}var R=function(C){return C.hasOwnProperty("key")},P=(function(I){p(F,I);var C=y(F);function F(D){var S;return d(this,F),S=C.call(this,D),k(b(S),"itemsWrapperRef",void 0),k(b(S),"itemsListRef",void 0),k(b(S),"thumbsRef",void 0),k(b(S),"setItemsWrapperRef",function(E){S.itemsWrapperRef=E}),k(b(S),"setItemsListRef",function(E){S.itemsListRef=E}),k(b(S),"setThumbsRef",function(E,O){S.thumbsRef||(S.thumbsRef=[]),S.thumbsRef[O]=E}),k(b(S),"updateSizes",function(){if(!(!S.props.children||!S.itemsWrapperRef||!S.thumbsRef)){var E=e.Children.count(S.props.children),O=S.itemsWrapperRef.clientWidth,M=S.props.thumbWidth?S.props.thumbWidth:(0,n.outerWidth)(S.thumbsRef[0]),V=Math.floor(O/M),W=V<E,j=W?E-V:0;S.setState(function(oe,Q){return{itemSize:M,visibleItems:V,firstItem:W?S.getFirstItem(Q.selectedItem):0,lastPosition:j,showArrows:W}})}}),k(b(S),"handleClickItem",function(E,O,M){if(!R(M)||M.key==="Enter"){var V=S.props.onSelectItem;typeof V=="function"&&V(E,O)}}),k(b(S),"onSwipeStart",function(){S.setState({swiping:!0})}),k(b(S),"onSwipeEnd",function(){S.setState({swiping:!1})}),k(b(S),"onSwipeMove",function(E){var O=E.x;if(!S.state.itemSize||!S.itemsWrapperRef||!S.state.visibleItems)return!1;var M=0,V=e.Children.count(S.props.children),W=-(S.state.firstItem*100)/S.state.visibleItems,j=Math.max(V-S.state.visibleItems,0),oe=-j*100/S.state.visibleItems;W===M&&O>0&&(O=0),W===oe&&O<0&&(O=0);var Q=S.itemsWrapperRef.clientWidth,re=W+100/(Q/O);return S.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(se){S.itemsListRef.style[se]=(0,r.default)(re,"%",S.props.axis)}),!0}),k(b(S),"slideRight",function(E){S.moveTo(S.state.firstItem-(typeof E=="number"?E:1))}),k(b(S),"slideLeft",function(E){S.moveTo(S.state.firstItem+(typeof E=="number"?E:1))}),k(b(S),"moveTo",function(E){E=E<0?0:E,E=E>=S.state.lastPosition?S.state.lastPosition:E,S.setState({firstItem:E})}),S.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},S}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(S){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==S.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(S){var E=S;return S>=this.state.lastPosition&&(E=this.state.lastPosition),S<this.state.firstItem+this.state.visibleItems&&(E=this.state.firstItem),S<this.state.firstItem&&(E=S),E}},{key:"renderItems",value:function(){var S=this;return this.props.children.map(function(E,O){var M=t.default.ITEM(!1,O===S.state.selectedItem),V={key:O,ref:function(j){return S.setThumbsRef(j,O)},className:M,onClick:S.handleClickItem.bind(S,O,S.props.children[O]),onKeyDown:S.handleClickItem.bind(S,O,S.props.children[O]),"aria-label":"".concat(S.props.labels.item," ").concat(O+1),style:{width:S.props.thumbWidth}};return e.default.createElement("li",c({},V,{role:"button",tabIndex:0}),E)})}},{key:"render",value:function(){var S=this;if(!this.props.children)return null;var E=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,M=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,V={},W=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(W,"px",this.props.axis),oe=this.props.transitionTime+"ms";return V={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 S.slideRight()},"aria-label":this.props.labels.leftArrow}),E?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:V,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 S.setItemsListRef(re)},style:V},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!M),onClick:function(){return S.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F})(e.Component);return Gi.default=P,k(P,"displayName","Thumbs"),k(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Gi}var qi={},js;function np(){if(js)return qi;js=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=void 0;var e=function(){return document};return qi.default=e,qi}var On={},qs;function Ac(){if(qs)return On;qs=1,Object.defineProperty(On,"__esModule",{value:!0}),On.setPosition=On.getPosition=On.isKeyboardEvent=On.defaultStatusFormatter=On.noop=void 0;var e=mo(),t=n(Hl());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};On.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};On.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};On.isKeyboardEvent=o;var s=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};On.getPosition=s;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 On.setPosition=a,On}var Un={},Ks;function rp(){if(Ks)return Un;Ks=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.fadeAnimationHandler=Un.slideStopSwipingHandler=Un.slideSwipeAnimationHandler=Un.slideAnimationHandler=void 0;var e=mo(),t=r(Hl()),n=Ac();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){s(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 s(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 x=(0,n.getPosition)(m,g),T=(0,t.default)(x,"%",g.axis),k=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:T,msTransform:T,OTransform:T,transform:T},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:k,MozTransitionDuration:k,OTransitionDuration:k,transitionDuration:k,msTransitionDuration:k})),p};Un.slideAnimationHandler=a;var l=function(g,h,p,m){var y={},v=h.axis==="horizontal",b=e.Children.count(h.children),x=0,T=(0,n.getPosition)(p.selectedItem,h),k=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),R=v?g.x:g.y,P=R;T===x&&R>0&&(P=0),T===k&&R<0&&(P=0);var I=T+100/(p.itemSize/P),C=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&C&&(p.selectedItem===0&&I>-100?I-=b*100:p.selectedItem===b-1&&I<-b*100&&(I+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||C||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(I,h.axis)),C&&!p.cancelClick&&m({cancelClick:!0}),y};Un.slideSwipeAnimationHandler=l;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Un.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 Un.fadeAnimationHandler=c,Un}var Zs;function ip(){if(Zs)return Wi;Zs=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.default=void 0;var e=c(mo()),t=l(Pc()),n=l(Lc()),r=l(_c()),i=l(np()),o=l(Fc()),s=Ac(),a=rp();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var S=u();if(S&&S.has(D))return S.get(D);var E={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in D)if(Object.prototype.hasOwnProperty.call(D,M)){var V=O?Object.getOwnPropertyDescriptor(D,M):null;V&&(V.get||V.set)?Object.defineProperty(E,M,V):E[M]=D[M]}return E.default=D,S&&S.set(D,E),E}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(E){return typeof E}:d=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},d(D)}function g(){return g=Object.assign||function(D){for(var S=1;S<arguments.length;S++){var E=arguments[S];for(var O in E)Object.prototype.hasOwnProperty.call(E,O)&&(D[O]=E[O])}return D},g.apply(this,arguments)}function h(D,S){var E=Object.keys(D);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(D);S&&(O=O.filter(function(M){return Object.getOwnPropertyDescriptor(D,M).enumerable})),E.push.apply(E,O)}return E}function p(D){for(var S=1;S<arguments.length;S++){var E=arguments[S]!=null?arguments[S]:{};S%2?h(Object(E),!0).forEach(function(O){C(D,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(O){Object.defineProperty(D,O,Object.getOwnPropertyDescriptor(E,O))})}return D}function m(D,S){if(!(D instanceof S))throw new TypeError("Cannot call a class as a function")}function y(D,S){for(var E=0;E<S.length;E++){var O=S[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(D,O.key,O)}}function v(D,S,E){return S&&y(D.prototype,S),D}function b(D,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(S&&S.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),S&&x(D,S)}function x(D,S){return x=Object.setPrototypeOf||function(O,M){return O.__proto__=M,O},x(D,S)}function T(D){var S=P();return function(){var O=I(D),M;if(S){var V=I(this).constructor;M=Reflect.construct(O,arguments,V)}else M=O.apply(this,arguments);return k(this,M)}}function k(D,S){return S&&(d(S)==="object"||typeof S=="function")?S:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(D){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},I(D)}function C(D,S,E){return S in D?Object.defineProperty(D,S,{value:E,enumerable:!0,configurable:!0,writable:!0}):D[S]=E,D}var F=(function(D){b(E,D);var S=T(E);function E(O){var M;m(this,E),M=S.call(this,O),C(R(M),"thumbsRef",void 0),C(R(M),"carouselWrapperRef",void 0),C(R(M),"listRef",void 0),C(R(M),"itemsRef",void 0),C(R(M),"timer",void 0),C(R(M),"animationHandler",void 0),C(R(M),"setThumbsRef",function(W){M.thumbsRef=W}),C(R(M),"setCarouselWrapperRef",function(W){M.carouselWrapperRef=W}),C(R(M),"setListRef",function(W){M.listRef=W}),C(R(M),"setItemsRef",function(W,j){M.itemsRef||(M.itemsRef=[]),M.itemsRef[j]=W}),C(R(M),"autoPlay",function(){e.Children.count(M.props.children)<=1||(M.clearAutoPlay(),M.props.autoPlay&&(M.timer=setTimeout(function(){M.increment()},M.props.interval)))}),C(R(M),"clearAutoPlay",function(){M.timer&&clearTimeout(M.timer)}),C(R(M),"resetAutoPlay",function(){M.clearAutoPlay(),M.autoPlay()}),C(R(M),"stopOnHover",function(){M.setState({isMouseEntered:!0},M.clearAutoPlay)}),C(R(M),"startOnLeave",function(){M.setState({isMouseEntered:!1},M.autoPlay)}),C(R(M),"isFocusWithinTheCarousel",function(){return M.carouselWrapperRef?!!((0,i.default)().activeElement===M.carouselWrapperRef||M.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),C(R(M),"navigateWithKeyboard",function(W){if(M.isFocusWithinTheCarousel()){var j=M.props.axis,oe=j==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},re=oe?Q.ArrowRight:Q.ArrowDown,se=oe?Q.ArrowLeft:Q.ArrowUp;re===W.keyCode?M.increment():se===W.keyCode&&M.decrement()}}),C(R(M),"updateSizes",function(){if(!(!M.state.initialized||!M.itemsRef||M.itemsRef.length===0)){var W=M.props.axis==="horizontal",j=M.itemsRef[0];if(j){var oe=W?j.clientWidth:j.clientHeight;M.setState({itemSize:oe}),M.thumbsRef&&M.thumbsRef.updateSizes()}}}),C(R(M),"setMountState",function(){M.setState({hasMount:!0}),M.updateSizes()}),C(R(M),"handleClickItem",function(W,j){if(e.Children.count(M.props.children)!==0){if(M.state.cancelClick){M.setState({cancelClick:!1});return}M.props.onClickItem(W,j),W!==M.state.selectedItem&&M.setState({selectedItem:W})}}),C(R(M),"handleOnChange",function(W,j){e.Children.count(M.props.children)<=1||M.props.onChange(W,j)}),C(R(M),"handleClickThumb",function(W,j){M.props.onClickThumb(W,j),M.moveTo(W)}),C(R(M),"onSwipeStart",function(W){M.setState({swiping:!0}),M.props.onSwipeStart(W)}),C(R(M),"onSwipeEnd",function(W){M.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),M.props.onSwipeEnd(W),M.clearAutoPlay(),M.state.autoPlay&&M.autoPlay()}),C(R(M),"onSwipeMove",function(W,j){M.props.onSwipeMove(j);var oe=M.props.swipeAnimationHandler(W,M.props,M.state,M.setState.bind(R(M)));return M.setState(p({},oe)),!!Object.keys(oe).length}),C(R(M),"decrement",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;M.moveTo(M.state.selectedItem-(typeof W=="number"?W:1))}),C(R(M),"increment",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;M.moveTo(M.state.selectedItem+(typeof W=="number"?W:1))}),C(R(M),"moveTo",function(W){if(typeof W=="number"){var j=e.Children.count(M.props.children)-1;W<0&&(W=M.props.infiniteLoop?j:0),W>j&&(W=M.props.infiniteLoop?0:j),M.selectItem({selectedItem:W}),M.state.autoPlay&&M.state.isMouseEntered===!1&&M.resetAutoPlay()}}),C(R(M),"onClickNext",function(){M.increment(1)}),C(R(M),"onClickPrev",function(){M.decrement(1)}),C(R(M),"onSwipeForward",function(){M.increment(1),M.props.emulateTouch&&M.setState({cancelClick:!0})}),C(R(M),"onSwipeBackwards",function(){M.decrement(1),M.props.emulateTouch&&M.setState({cancelClick:!0})}),C(R(M),"changeItem",function(W){return function(j){(!(0,s.isKeyboardEvent)(j)||j.key==="Enter")&&M.moveTo(W)}}),C(R(M),"selectItem",function(W){M.setState(p({previousItem:M.state.selectedItem},W),function(){M.setState(M.animationHandler(M.props,M.state))}),M.handleOnChange(W.selectedItem,e.Children.toArray(M.props.children)[W.selectedItem])}),C(R(M),"getInitialImage",function(){var W=M.props.selectedItem,j=M.itemsRef&&M.itemsRef[W],oe=j&&j.getElementsByTagName("img")||[];return oe[0]}),C(R(M),"getVariableItemHeight",function(W){var j=M.itemsRef&&M.itemsRef[W];if(M.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(){M.forceUpdate(),Q.removeEventListener("load",de)};Q.addEventListener("load",re)}}var se=oe[0]||j.children[0],ae=se.clientHeight;return ae>0?ae:null}return null});var V={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 M.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,M.state=p(p({},V),M.animationHandler(O,V)),M}return v(E,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(M,V){!M.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!M.autoFocus&&this.props.autoFocus&&this.forceFocus(),V.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(M.selectedItem!==this.props.selectedItem||M.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),M.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var M=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var V=M.getInitialImage();V&&!V.complete?V.addEventListener("load",M.setMountState):M.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var M=this.carouselWrapperRef;this.props.stopOnHover&&M&&(M.addEventListener("mouseenter",this.stopOnHover),M.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var M=this.carouselWrapperRef;this.props.stopOnHover&&M&&(M.removeEventListener("mouseenter",this.stopOnHover),M.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var M=this.getInitialImage();M&&M.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var M;(M=this.carouselWrapperRef)===null||M===void 0||M.focus()}},{key:"renderItems",value:function(M){var V=this;return this.props.children?e.Children.map(this.props.children,function(W,j){var oe=j===V.state.selectedItem,Q=j===V.state.previousItem,re=oe&&V.state.selectedStyle||Q&&V.state.prevStyle||V.state.slideStyle||{};V.props.centerMode&&V.props.axis==="horizontal"&&(re=p(p({},re),{},{minWidth:V.props.centerSlidePercentage+"%"})),V.state.swiping&&V.state.swipeMovementStarted&&(re=p(p({},re),{},{pointerEvents:"none"}));var se={ref:function(de){return V.setItemsRef(de,j)},key:"itemKey"+j+(M?"clone":""),className:n.default.ITEM(!0,j===V.state.selectedItem,j===V.state.previousItem),onClick:V.handleClickItem.bind(V,j,W),style:re};return e.default.createElement("li",se,V.props.renderItem(W,{isSelected:j===V.state.selectedItem,isPrevious:j===V.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var M=this,V=this.props,W=V.showIndicators,j=V.labels,oe=V.renderIndicator,Q=V.children;return W?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(re,se){return oe&&oe(M.changeItem(se),se===M.state.selectedItem,se,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 M=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var V=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),se=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},fe={};if(W){if(de.onSwipeLeft=this.onSwipeForward,de.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var ue=this.getVariableItemHeight(this.state.selectedItem);fe.height=ue||"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}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},V?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&&se):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(L){return M.setListRef(L)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&se)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),E})(e.default.Component);return Wi.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:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(S,E,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!E),onClick:S})},renderArrowNext:function(S,E,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!E),onClick:S})},renderIndicator:function(S,E,O,M){return e.default.createElement("li",{className:n.default.DOT(E),onClick:S,onKeyDown:S,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(M," ").concat(O+1)})},renderItem:function(S){return S},renderThumbs:function(S){var E=e.Children.map(S,function(O){var M=O;if(O.type!=="img"&&(M=e.Children.toArray(O.props.children).find(function(V){return V.type==="img"})),!!M)return M});return E.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"),[]):E},statusFormatter:s.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Wi}var Js={},Qs;function op(){return Qs||(Qs=1),Js}var eu;function ap(){return eu||(eu=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(ip()),n=op(),r=i(_c());function i(o){return o&&o.__esModule?o:{default:o}}})(Ja)),Ja}var lp=ap();function kn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Cr(e,t){return e===void 0?void 0:t}const sp=Math.PI;function tu(e){return e*sp/180}const Hc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),zc=(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}},Vc=(e,t,n)=>Math.min(e,t-n*2),$c=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,zl=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"}))},up=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 cp(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(Rc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const dp="֑-߿יִ-﷽ﹰ-ﻼ",fp="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",hp=new RegExp("^[^"+fp+"]*["+dp+"]");function Vl(e){return hp.test(e)?"rtl":"not-rtl"}let Vo;function bl(){if(typeof document>"u")return 0;if(Vo!==void 0)return Vo;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(),Vo=n-r,Vo}const Vr=Symbol();function gp(e){const t=f.useRef([Vr,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 l=t.current[0];l!==Vr&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Vr&&i({}),r(u=>typeof a=="function"?a(l===Vr?u:l):a),t.current[0]=Vr)},[]),s=f.useCallback(()=>{t.current[0]=Vr,i({})},[]);return[t.current[0]===Vr?n:t.current[0],o,s]}function Nc(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 pp(e){const t=f.useRef(e);return Ii(e,t.current)||(t.current=e),t.current}const mp=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return f.createElement(Qg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(lp.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(zl,null)))};function Bc(){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 Gr=Bc();function vp(e){Gr=e}const Wc=/[&<>"']/,bp=new RegExp(Wc.source,"g"),Uc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,wp=new RegExp(Uc.source,"g"),yp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},nu=e=>yp[e];function mn(e,t){if(t){if(Wc.test(e))return e.replace(bp,nu)}else if(Uc.test(e))return e.replace(wp,nu);return e}const Cp=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Gc(e){return e.replace(Cp,(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 Sp=/(^|[^\[])\^/g;function Ft(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Sp,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const xp=/[^\w:]/g,kp=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ru(e,t,n){if(e){let r;try{r=decodeURIComponent(Gc(n)).replace(xp,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!kp.test(n)&&(n=Ep(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const $o={},Mp=/^[^:]+:\/*[^/]*$/,Rp=/^([^:]+:)[\s\S]*$/,Ip=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ep(e,t){$o[" "+e]||(Mp.test(e)?$o[" "+e]=e+"/":$o[" "+e]=Zo(e,"/",!0)),e=$o[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Rp,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Ip,"$1")+t:e+t}const la={exec:function(){}};function iu(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Zo(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 Tp(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 Dp(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 ou(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function au(e,t,n,r){const i=t.href,o=t.title?mn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:mn(s)}}function Op(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.C9AINtRf.js","./index.DBIoNOen.js","../css/index.C8MrxwGF.css","./withFullScreenWrapper.DP61hzLF.js","./Toolbar.mUe2Nmta.js","./FormClearHelper.CyGGPn10.js","./moment.C7qA8nIE.js","./pandasStylerUtils.BqWaUzvh.js","./numbro.B9_PXfzp.js","./_baseIndexOf.BTknn6Gb.js","./index.8HslT92O.js","./main.fMmyxXOf.js","./throttle.DlZC3xNA.js","./toConsumableArray.CZW4AmuW.js","./formatNumber.CCeQsvJQ.js","./sprintfjs.BlFBKfMf.js","./formatMoment.C6Hwn6X5.js","./checkbox.GY4JoJkM.js","./createDownloadLinkElement.BWJh90jh.js","./FileDownload.esm.D5koxJhf.js","./_arrayIncludes.B19Iyn2B.js","./number-overlay-editor.C0n-91sR.js","./es6.eb5oR8iN.js"])))=>i.map(i=>d[i]);
2
+ import{at as Ya,dh as lh,di as sh,cO as gc,dj as uh,dk as ch,dl as dh,dm as fh,dn as hh,dp as gh,dq as Xa,dr as pc,a_ as ph,a$ as mh,r as f,E as Pl,_ as Ve,G as ja,an as mo,bH as vh,ds as bh,aD as zt,dt as wh,N as kr,du as Os,aR as Ll,J as yh,e as Ee,bI as mc,n as ct,dv as Ch,j as Ie,dw as Sh,z as Fn,dx as rr,db as ur,dy as Le,dz as Fe,d0 as _o,cY as xh,al as vc,dA as bc,a3 as kh,cZ as Mh,c_ as Rh,c$ as Ih,d2 as Eh,bx as wc,ac as en,bA as Th,af as Dh,dB as Oh,dC as Ph,m as vo,b8 as bi,dD as Lh,aS as Fh,dE as _h,dF as yc,ci as Ah,cg as Hh,dG as Cc,dH as zh,dI as Vh,cf as Sc,cj as $h,dJ as Nh,ce as Bh,dK as Wh,by as Uh,bz as Gh,cl as Yh,dL as Xh,O as jh,dM as qh,cm as Kh,dN as Zh,Q as Jh,l as Ur,dO as Xt,V as Fl,d4 as Qh,dP as eg,dQ as tg,bC as qa,bW as ng,$ as xc,ay as wa,dR as kc,o as pn,Y as Gn,aM as ya,aK as rg,aL as Mc,dS as ig,q as og,W as Ps,dT as ag,dU as lg,k as sg,L as ug,dV as cg,s as Ls}from"./index.DBIoNOen.js";import{w as dg,E as fg}from"./withFullScreenWrapper.DP61hzLF.js";import{T as hg,a as mi}from"./Toolbar.mUe2Nmta.js";import{u as gg}from"./FormClearHelper.CyGGPn10.js";import{h as $r}from"./moment.C7qA8nIE.js";import{r as pg,m as Fs,f as vl,c as mg,a as vg}from"./pandasStylerUtils.BqWaUzvh.js";import{n as bg}from"./numbro.B9_PXfzp.js";import{l as Ka}from"./index.8HslT92O.js";import{R as wg}from"./main.fMmyxXOf.js";import{d as Rc,t as yg}from"./throttle.DlZC3xNA.js";import{_ as Mi,C as Cg}from"./toConsumableArray.CZW4AmuW.js";import{f as ra}from"./formatNumber.CCeQsvJQ.js";import{f as _s}from"./formatMoment.C6Hwn6X5.js";import{L as Sg,a as xg,S as kg}from"./checkbox.GY4JoJkM.js";import{c as Mg}from"./createDownloadLinkElement.BWJh90jh.js";import{D as Rg,F as Ig}from"./FileDownload.esm.D5koxJhf.js";import{a as Eg}from"./_arrayIncludes.B19Iyn2B.js";function Tg(){}function Dg(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Vn(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),Dg(Ya(e),t,n)}var Og=Object.prototype,Pg=Og.hasOwnProperty;function Lg(e,t){return e!=null&&Pg.call(e,t)}function Fg(e,t){return e!=null&&lh(e,t,Lg)}var _g="[object Map]",Ag="[object Set]",Hg=Object.prototype,zg=Hg.hasOwnProperty;function Vg(e){if(e==null)return!0;if(sh(e)&&(gc(e)||typeof e=="string"||typeof e.splice=="function"||uh(e)||ch(e)||dh(e)))return!e.length;var t=fh(e);if(t==_g||t==Ag)return!e.size;if(hh(e))return!gh(e).length;for(var n in e)if(zg.call(e,n))return!1;return!0}var $g=1/0,Ng=Xa&&1/pc(new Xa([,-0]))[1]==$g?function(e){return new Xa(e)}:Tg,Bg=200;function Wg(e,t,n){var r=-1,i=Eg,o=e.length,s=!0,a=[],l=a;if(o>=Bg){var u=Ng(e);if(u)return pc(u);s=!1,i=mh,l=new ph}else l=a;e:for(;++r<o;){var c=e[r],d=c;if(c=c!==0?c:0,s&&d===d){for(var g=l.length;g--;)if(l[g]===d)continue e;a.push(c)}else i(l,d,n)||(l!==a&&l.push(d),a.push(c))}return a}function Ug(e){return e&&e.length?Wg(e):[]}var Ic=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Pl,Ve({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"}))});Ic.displayName="Add";var Ec=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Pl,Ve({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"}))});Ec.displayName="Search";var Tc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Pl,Ve({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"}))});Tc.displayName="Visibility";function Dc(e="This should not happen"){throw new Error(e)}function Pn(e,t="Assertion failed"){if(!e)return Dc(t)}function lo(e,t){return Dc(t??"Hell froze over")}function Gg(e,t){try{return e()}catch{return t}}const As=Object.prototype.hasOwnProperty;function Ii(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--&&Ii(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(As.call(e,n)&&++r&&!As.call(t,n)||!(n in t)||!Ii(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ia=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 Hs;(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"})(Hs||(Hs={}));var oa;(function(e){e.Triangle="triangle",e.Dots="dots"})(oa||(oa={}));function Ao(e){return"width"in e&&typeof e.width=="number"}async function zs(e){return typeof e=="object"?e:await e()}function wi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Si(e){return e.kind===$n.Marker||e.kind===$n.NewRow}function yi(e){if(!wi(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:lo(e,"A cell was passed with an invalid kind")}}function Yg(e){return Fg(e,"editor")}function Al(e){return!(e.readonly??!1)}var $n;(function(e){e.NewRow="new-row",e.Marker="marker"})($n||($n={}));const aa={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 Vs;class Qe{items;constructor(t){this.items=t}static create=t=>new Qe(Za(t));static empty=()=>Vs??(Vs=new Qe([]));static fromSingleSelection=t=>Qe.empty().add(t);static fromArray=t=>{if(t.length===0)return Qe.empty();const n=t.map(i=>[i,i+1]),r=Za(n);return new Qe(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Qe(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Za([...this.items,n]);return new Qe(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new Qe(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var Xg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},$s=Xg,jg=e=>e.toUpperCase()===e,qg=e=>t=>e.indexOf(t)===-1,Oc=(e,t)=>{const n={};return Object.keys(e).filter(qg(t)).forEach(r=>{n[r]=e[r]}),n};function Kg(e,t,n){const r=Oc(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 Zg=(e,t)=>{};function Jg(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!jg(a[0])):n.propsAsIs,c=Kg(u,o,["as","class"]);c.ref=s,c.className=n.atomic?$s(n.class,c.className||l):$s(c.className||l,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]||"",x=typeof v=="function"?v(o):v;Zg(x,n.name),g[`--${m}`]=`${x}${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 s=Oc(o,["innerRef"]);return r(s,o.innerRef)});return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var dn=Jg;const Qg=dn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ja={},Wi={},Ho={},zo={},Ns;function ep(){return Ns||(Ns=1,(function(e){(function(t,n){n(e,mo(),vh())})(zo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=s(n),o=s(r);function s(b){return b&&b.__esModule?b:{default:b}}var a=Object.assign||function(b){for(var x=1;x<arguments.length;x++){var T=arguments[x];for(var k in T)Object.prototype.hasOwnProperty.call(T,k)&&(b[k]=T[k])}return b};function l(b,x){var T={};for(var k in b)x.indexOf(k)>=0||Object.prototype.hasOwnProperty.call(b,k)&&(T[k]=b[k]);return T}function u(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")}var c=(function(){function b(x,T){for(var k=0;k<T.length;k++){var R=T[k];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(x,R.key,R)}}return function(x,T,k){return T&&b(x.prototype,T),k&&b(x,k),x}})();function d(b,x){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:b}function g(b,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);b.prototype=Object.create(x&&x.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(b,x):b.__proto__=x)}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 x=b.touches[0],T=x.pageX,k=x.pageY;return{x:T,y:k}}var R=b.screenX,P=b.screenY;return{x:R,y:P}}var v=(function(b){g(x,b);function x(){var T;u(this,x);for(var k=arguments.length,R=Array(k),P=0;P<k;P++)R[P]=arguments[P];var I=d(this,(T=x.__proto__||Object.getPrototypeOf(x)).call.apply(T,[this].concat(R)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(k){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(k))}},{key:"_onMouseMove",value:function(k){this.mouseDown&&this._handleSwipeMove(k)}},{key:"_onMouseUp",value:function(k){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(k)}},{key:"_handleSwipeStart",value:function(k){var R=y(k),P=R.x,I=R.y;this.moveStart={x:P,y:I},this.props.onSwipeStart(k)}},{key:"_handleSwipeMove",value:function(k){if(this.moveStart){var R=y(k),P=R.x,I=R.y,C=P-this.moveStart.x,F=I-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:C,y:F},k);D&&k.cancelable&&k.preventDefault(),this.movePosition={deltaX:C,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(k){this.props.onSwipeEnd(k);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,k):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,k),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,k):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,k)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(k){this.swiper=k,this.props.innerRef(k)}},{key:"render",value:function(){var k=this.props;k.tagName;var R=k.className,P=k.style,I=k.children;k.allowMouseEvents,k.onSwipeUp,k.onSwipeDown,k.onSwipeLeft,k.onSwipeRight,k.onSwipeStart,k.onSwipeMove,k.onSwipeEnd,k.innerRef,k.tolerance;var C=l(k,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:P},C),I)}}]),x})(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})})(zo)),zo}var Bs;function Pc(){return Bs||(Bs=1,(function(e){(function(t,n){n(e,ep())})(Ho,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})})(Ho)),Ho}var Ui={},Ws;function Lc(){if(Ws)return Ui;Ws=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.default=void 0;var e=t(bh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Ui.default=r,Ui}var Gi={},Yi={},Us;function tp(){if(Us)return Yi;Us=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Yi.outerWidth=e,Yi}var Xi={},Gs;function Hl(){if(Gs)return Xi;Gs=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Xi.default=e,Xi}var ji={},Ys;function Fc(){if(Ys)return ji;Ys=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.default=void 0;var e=function(){return window};return ji.default=e,ji}var Xs;function _c(){if(Xs)return Gi;Xs=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var e=l(mo()),t=s(Lc()),n=tp(),r=s(Hl()),i=s(Pc()),o=s(Fc());function s(I){return I&&I.__esModule?I:{default:I}}function a(){if(typeof WeakMap!="function")return null;var I=new WeakMap;return a=function(){return I},I}function l(I){if(I&&I.__esModule)return I;if(I===null||u(I)!=="object"&&typeof I!="function")return{default:I};var C=a();if(C&&C.has(I))return C.get(I);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in I)if(Object.prototype.hasOwnProperty.call(I,S)){var E=D?Object.getOwnPropertyDescriptor(I,S):null;E&&(E.get||E.set)?Object.defineProperty(F,S,E):F[S]=I[S]}return F.default=I,C&&C.set(I,F),F}function u(I){"@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(I)}function c(){return c=Object.assign||function(I){for(var C=1;C<arguments.length;C++){var F=arguments[C];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(I[D]=F[D])}return I},c.apply(this,arguments)}function d(I,C){if(!(I instanceof C))throw new TypeError("Cannot call a class as a function")}function g(I,C){for(var F=0;F<C.length;F++){var D=C[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(I,D.key,D)}}function h(I,C,F){return C&&g(I.prototype,C),I}function p(I,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(C&&C.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),C&&m(I,C)}function m(I,C){return m=Object.setPrototypeOf||function(D,S){return D.__proto__=S,D},m(I,C)}function y(I){var C=x();return function(){var D=T(I),S;if(C){var E=T(this).constructor;S=Reflect.construct(D,arguments,E)}else S=D.apply(this,arguments);return v(this,S)}}function v(I,C){return C&&(u(C)==="object"||typeof C=="function")?C:b(I)}function b(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function x(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function T(I){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},T(I)}function k(I,C,F){return C in I?Object.defineProperty(I,C,{value:F,enumerable:!0,configurable:!0,writable:!0}):I[C]=F,I}var R=function(C){return C.hasOwnProperty("key")},P=(function(I){p(F,I);var C=y(F);function F(D){var S;return d(this,F),S=C.call(this,D),k(b(S),"itemsWrapperRef",void 0),k(b(S),"itemsListRef",void 0),k(b(S),"thumbsRef",void 0),k(b(S),"setItemsWrapperRef",function(E){S.itemsWrapperRef=E}),k(b(S),"setItemsListRef",function(E){S.itemsListRef=E}),k(b(S),"setThumbsRef",function(E,O){S.thumbsRef||(S.thumbsRef=[]),S.thumbsRef[O]=E}),k(b(S),"updateSizes",function(){if(!(!S.props.children||!S.itemsWrapperRef||!S.thumbsRef)){var E=e.Children.count(S.props.children),O=S.itemsWrapperRef.clientWidth,M=S.props.thumbWidth?S.props.thumbWidth:(0,n.outerWidth)(S.thumbsRef[0]),V=Math.floor(O/M),W=V<E,j=W?E-V:0;S.setState(function(oe,Q){return{itemSize:M,visibleItems:V,firstItem:W?S.getFirstItem(Q.selectedItem):0,lastPosition:j,showArrows:W}})}}),k(b(S),"handleClickItem",function(E,O,M){if(!R(M)||M.key==="Enter"){var V=S.props.onSelectItem;typeof V=="function"&&V(E,O)}}),k(b(S),"onSwipeStart",function(){S.setState({swiping:!0})}),k(b(S),"onSwipeEnd",function(){S.setState({swiping:!1})}),k(b(S),"onSwipeMove",function(E){var O=E.x;if(!S.state.itemSize||!S.itemsWrapperRef||!S.state.visibleItems)return!1;var M=0,V=e.Children.count(S.props.children),W=-(S.state.firstItem*100)/S.state.visibleItems,j=Math.max(V-S.state.visibleItems,0),oe=-j*100/S.state.visibleItems;W===M&&O>0&&(O=0),W===oe&&O<0&&(O=0);var Q=S.itemsWrapperRef.clientWidth,re=W+100/(Q/O);return S.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(se){S.itemsListRef.style[se]=(0,r.default)(re,"%",S.props.axis)}),!0}),k(b(S),"slideRight",function(E){S.moveTo(S.state.firstItem-(typeof E=="number"?E:1))}),k(b(S),"slideLeft",function(E){S.moveTo(S.state.firstItem+(typeof E=="number"?E:1))}),k(b(S),"moveTo",function(E){E=E<0?0:E,E=E>=S.state.lastPosition?S.state.lastPosition:E,S.setState({firstItem:E})}),S.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},S}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(S){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==S.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(S){var E=S;return S>=this.state.lastPosition&&(E=this.state.lastPosition),S<this.state.firstItem+this.state.visibleItems&&(E=this.state.firstItem),S<this.state.firstItem&&(E=S),E}},{key:"renderItems",value:function(){var S=this;return this.props.children.map(function(E,O){var M=t.default.ITEM(!1,O===S.state.selectedItem),V={key:O,ref:function(j){return S.setThumbsRef(j,O)},className:M,onClick:S.handleClickItem.bind(S,O,S.props.children[O]),onKeyDown:S.handleClickItem.bind(S,O,S.props.children[O]),"aria-label":"".concat(S.props.labels.item," ").concat(O+1),style:{width:S.props.thumbWidth}};return e.default.createElement("li",c({},V,{role:"button",tabIndex:0}),E)})}},{key:"render",value:function(){var S=this;if(!this.props.children)return null;var E=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,M=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,V={},W=-this.state.firstItem*(this.state.itemSize||0),j=(0,r.default)(W,"px",this.props.axis),oe=this.props.transitionTime+"ms";return V={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 S.slideRight()},"aria-label":this.props.labels.leftArrow}),E?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:V,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 S.setItemsListRef(re)},style:V},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!M),onClick:function(){return S.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F})(e.Component);return Gi.default=P,k(P,"displayName","Thumbs"),k(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Gi}var qi={},js;function np(){if(js)return qi;js=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=void 0;var e=function(){return document};return qi.default=e,qi}var On={},qs;function Ac(){if(qs)return On;qs=1,Object.defineProperty(On,"__esModule",{value:!0}),On.setPosition=On.getPosition=On.isKeyboardEvent=On.defaultStatusFormatter=On.noop=void 0;var e=mo(),t=n(Hl());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};On.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};On.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};On.isKeyboardEvent=o;var s=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};On.getPosition=s;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 On.setPosition=a,On}var Un={},Ks;function rp(){if(Ks)return Un;Ks=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.fadeAnimationHandler=Un.slideStopSwipingHandler=Un.slideSwipeAnimationHandler=Un.slideAnimationHandler=void 0;var e=mo(),t=r(Hl()),n=Ac();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){s(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 s(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 x=(0,n.getPosition)(m,g),T=(0,t.default)(x,"%",g.axis),k=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:T,msTransform:T,OTransform:T,transform:T},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:k,MozTransitionDuration:k,OTransitionDuration:k,transitionDuration:k,msTransitionDuration:k})),p};Un.slideAnimationHandler=a;var l=function(g,h,p,m){var y={},v=h.axis==="horizontal",b=e.Children.count(h.children),x=0,T=(0,n.getPosition)(p.selectedItem,h),k=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),R=v?g.x:g.y,P=R;T===x&&R>0&&(P=0),T===k&&R<0&&(P=0);var I=T+100/(p.itemSize/P),C=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&C&&(p.selectedItem===0&&I>-100?I-=b*100:p.selectedItem===b-1&&I<-b*100&&(I+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||C||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),y.itemListStyle=(0,n.setPosition)(I,h.axis)),C&&!p.cancelClick&&m({cancelClick:!0}),y};Un.slideSwipeAnimationHandler=l;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Un.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 Un.fadeAnimationHandler=c,Un}var Zs;function ip(){if(Zs)return Wi;Zs=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.default=void 0;var e=c(mo()),t=l(Pc()),n=l(Lc()),r=l(_c()),i=l(np()),o=l(Fc()),s=Ac(),a=rp();function l(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var S=u();if(S&&S.has(D))return S.get(D);var E={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in D)if(Object.prototype.hasOwnProperty.call(D,M)){var V=O?Object.getOwnPropertyDescriptor(D,M):null;V&&(V.get||V.set)?Object.defineProperty(E,M,V):E[M]=D[M]}return E.default=D,S&&S.set(D,E),E}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(E){return typeof E}:d=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},d(D)}function g(){return g=Object.assign||function(D){for(var S=1;S<arguments.length;S++){var E=arguments[S];for(var O in E)Object.prototype.hasOwnProperty.call(E,O)&&(D[O]=E[O])}return D},g.apply(this,arguments)}function h(D,S){var E=Object.keys(D);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(D);S&&(O=O.filter(function(M){return Object.getOwnPropertyDescriptor(D,M).enumerable})),E.push.apply(E,O)}return E}function p(D){for(var S=1;S<arguments.length;S++){var E=arguments[S]!=null?arguments[S]:{};S%2?h(Object(E),!0).forEach(function(O){C(D,O,E[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(E)):h(Object(E)).forEach(function(O){Object.defineProperty(D,O,Object.getOwnPropertyDescriptor(E,O))})}return D}function m(D,S){if(!(D instanceof S))throw new TypeError("Cannot call a class as a function")}function y(D,S){for(var E=0;E<S.length;E++){var O=S[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(D,O.key,O)}}function v(D,S,E){return S&&y(D.prototype,S),D}function b(D,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(S&&S.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),S&&x(D,S)}function x(D,S){return x=Object.setPrototypeOf||function(O,M){return O.__proto__=M,O},x(D,S)}function T(D){var S=P();return function(){var O=I(D),M;if(S){var V=I(this).constructor;M=Reflect.construct(O,arguments,V)}else M=O.apply(this,arguments);return k(this,M)}}function k(D,S){return S&&(d(S)==="object"||typeof S=="function")?S:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function I(D){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},I(D)}function C(D,S,E){return S in D?Object.defineProperty(D,S,{value:E,enumerable:!0,configurable:!0,writable:!0}):D[S]=E,D}var F=(function(D){b(E,D);var S=T(E);function E(O){var M;m(this,E),M=S.call(this,O),C(R(M),"thumbsRef",void 0),C(R(M),"carouselWrapperRef",void 0),C(R(M),"listRef",void 0),C(R(M),"itemsRef",void 0),C(R(M),"timer",void 0),C(R(M),"animationHandler",void 0),C(R(M),"setThumbsRef",function(W){M.thumbsRef=W}),C(R(M),"setCarouselWrapperRef",function(W){M.carouselWrapperRef=W}),C(R(M),"setListRef",function(W){M.listRef=W}),C(R(M),"setItemsRef",function(W,j){M.itemsRef||(M.itemsRef=[]),M.itemsRef[j]=W}),C(R(M),"autoPlay",function(){e.Children.count(M.props.children)<=1||(M.clearAutoPlay(),M.props.autoPlay&&(M.timer=setTimeout(function(){M.increment()},M.props.interval)))}),C(R(M),"clearAutoPlay",function(){M.timer&&clearTimeout(M.timer)}),C(R(M),"resetAutoPlay",function(){M.clearAutoPlay(),M.autoPlay()}),C(R(M),"stopOnHover",function(){M.setState({isMouseEntered:!0},M.clearAutoPlay)}),C(R(M),"startOnLeave",function(){M.setState({isMouseEntered:!1},M.autoPlay)}),C(R(M),"isFocusWithinTheCarousel",function(){return M.carouselWrapperRef?!!((0,i.default)().activeElement===M.carouselWrapperRef||M.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),C(R(M),"navigateWithKeyboard",function(W){if(M.isFocusWithinTheCarousel()){var j=M.props.axis,oe=j==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},re=oe?Q.ArrowRight:Q.ArrowDown,se=oe?Q.ArrowLeft:Q.ArrowUp;re===W.keyCode?M.increment():se===W.keyCode&&M.decrement()}}),C(R(M),"updateSizes",function(){if(!(!M.state.initialized||!M.itemsRef||M.itemsRef.length===0)){var W=M.props.axis==="horizontal",j=M.itemsRef[0];if(j){var oe=W?j.clientWidth:j.clientHeight;M.setState({itemSize:oe}),M.thumbsRef&&M.thumbsRef.updateSizes()}}}),C(R(M),"setMountState",function(){M.setState({hasMount:!0}),M.updateSizes()}),C(R(M),"handleClickItem",function(W,j){if(e.Children.count(M.props.children)!==0){if(M.state.cancelClick){M.setState({cancelClick:!1});return}M.props.onClickItem(W,j),W!==M.state.selectedItem&&M.setState({selectedItem:W})}}),C(R(M),"handleOnChange",function(W,j){e.Children.count(M.props.children)<=1||M.props.onChange(W,j)}),C(R(M),"handleClickThumb",function(W,j){M.props.onClickThumb(W,j),M.moveTo(W)}),C(R(M),"onSwipeStart",function(W){M.setState({swiping:!0}),M.props.onSwipeStart(W)}),C(R(M),"onSwipeEnd",function(W){M.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),M.props.onSwipeEnd(W),M.clearAutoPlay(),M.state.autoPlay&&M.autoPlay()}),C(R(M),"onSwipeMove",function(W,j){M.props.onSwipeMove(j);var oe=M.props.swipeAnimationHandler(W,M.props,M.state,M.setState.bind(R(M)));return M.setState(p({},oe)),!!Object.keys(oe).length}),C(R(M),"decrement",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;M.moveTo(M.state.selectedItem-(typeof W=="number"?W:1))}),C(R(M),"increment",function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;M.moveTo(M.state.selectedItem+(typeof W=="number"?W:1))}),C(R(M),"moveTo",function(W){if(typeof W=="number"){var j=e.Children.count(M.props.children)-1;W<0&&(W=M.props.infiniteLoop?j:0),W>j&&(W=M.props.infiniteLoop?0:j),M.selectItem({selectedItem:W}),M.state.autoPlay&&M.state.isMouseEntered===!1&&M.resetAutoPlay()}}),C(R(M),"onClickNext",function(){M.increment(1)}),C(R(M),"onClickPrev",function(){M.decrement(1)}),C(R(M),"onSwipeForward",function(){M.increment(1),M.props.emulateTouch&&M.setState({cancelClick:!0})}),C(R(M),"onSwipeBackwards",function(){M.decrement(1),M.props.emulateTouch&&M.setState({cancelClick:!0})}),C(R(M),"changeItem",function(W){return function(j){(!(0,s.isKeyboardEvent)(j)||j.key==="Enter")&&M.moveTo(W)}}),C(R(M),"selectItem",function(W){M.setState(p({previousItem:M.state.selectedItem},W),function(){M.setState(M.animationHandler(M.props,M.state))}),M.handleOnChange(W.selectedItem,e.Children.toArray(M.props.children)[W.selectedItem])}),C(R(M),"getInitialImage",function(){var W=M.props.selectedItem,j=M.itemsRef&&M.itemsRef[W],oe=j&&j.getElementsByTagName("img")||[];return oe[0]}),C(R(M),"getVariableItemHeight",function(W){var j=M.itemsRef&&M.itemsRef[W];if(M.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(){M.forceUpdate(),Q.removeEventListener("load",de)};Q.addEventListener("load",re)}}var se=oe[0]||j.children[0],ae=se.clientHeight;return ae>0?ae:null}return null});var V={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 M.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,M.state=p(p({},V),M.animationHandler(O,V)),M}return v(E,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(M,V){!M.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!M.autoFocus&&this.props.autoFocus&&this.forceFocus(),V.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(M.selectedItem!==this.props.selectedItem||M.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),M.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var M=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var V=M.getInitialImage();V&&!V.complete?V.addEventListener("load",M.setMountState):M.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var M=this.carouselWrapperRef;this.props.stopOnHover&&M&&(M.addEventListener("mouseenter",this.stopOnHover),M.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var M=this.carouselWrapperRef;this.props.stopOnHover&&M&&(M.removeEventListener("mouseenter",this.stopOnHover),M.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var M=this.getInitialImage();M&&M.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var M;(M=this.carouselWrapperRef)===null||M===void 0||M.focus()}},{key:"renderItems",value:function(M){var V=this;return this.props.children?e.Children.map(this.props.children,function(W,j){var oe=j===V.state.selectedItem,Q=j===V.state.previousItem,re=oe&&V.state.selectedStyle||Q&&V.state.prevStyle||V.state.slideStyle||{};V.props.centerMode&&V.props.axis==="horizontal"&&(re=p(p({},re),{},{minWidth:V.props.centerSlidePercentage+"%"})),V.state.swiping&&V.state.swipeMovementStarted&&(re=p(p({},re),{},{pointerEvents:"none"}));var se={ref:function(de){return V.setItemsRef(de,j)},key:"itemKey"+j+(M?"clone":""),className:n.default.ITEM(!0,j===V.state.selectedItem,j===V.state.previousItem),onClick:V.handleClickItem.bind(V,j,W),style:re};return e.default.createElement("li",se,V.props.renderItem(W,{isSelected:j===V.state.selectedItem,isPrevious:j===V.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var M=this,V=this.props,W=V.showIndicators,j=V.labels,oe=V.renderIndicator,Q=V.children;return W?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(re,se){return oe&&oe(M.changeItem(se),se===M.state.selectedItem,se,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 M=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var V=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),se=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},fe={};if(W){if(de.onSwipeLeft=this.onSwipeForward,de.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var ue=this.getVariableItemHeight(this.state.selectedItem);fe.height=ue||"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}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},V?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&&se):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(L){return M.setListRef(L)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&se)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),E})(e.default.Component);return Wi.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:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(S,E,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!E),onClick:S})},renderArrowNext:function(S,E,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!E),onClick:S})},renderIndicator:function(S,E,O,M){return e.default.createElement("li",{className:n.default.DOT(E),onClick:S,onKeyDown:S,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(M," ").concat(O+1)})},renderItem:function(S){return S},renderThumbs:function(S){var E=e.Children.map(S,function(O){var M=O;if(O.type!=="img"&&(M=e.Children.toArray(O.props.children).find(function(V){return V.type==="img"})),!!M)return M});return E.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"),[]):E},statusFormatter:s.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Wi}var Js={},Qs;function op(){return Qs||(Qs=1),Js}var eu;function ap(){return eu||(eu=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(ip()),n=op(),r=i(_c());function i(o){return o&&o.__esModule?o:{default:o}}})(Ja)),Ja}var lp=ap();function kn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Cr(e,t){return e===void 0?void 0:t}const sp=Math.PI;function tu(e){return e*sp/180}const Hc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),zc=(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}},Vc=(e,t,n)=>Math.min(e,t-n*2),$c=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,zl=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"}))},up=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 cp(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const s=f.useRef(Rc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const dp="֑-߿יִ-﷽ﹰ-ﻼ",fp="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",hp=new RegExp("^[^"+fp+"]*["+dp+"]");function Vl(e){return hp.test(e)?"rtl":"not-rtl"}let Vo;function bl(){if(typeof document>"u")return 0;if(Vo!==void 0)return Vo;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(),Vo=n-r,Vo}const Vr=Symbol();function gp(e){const t=f.useRef([Vr,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 l=t.current[0];l!==Vr&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Vr&&i({}),r(u=>typeof a=="function"?a(l===Vr?u:l):a),t.current[0]=Vr)},[]),s=f.useCallback(()=>{t.current[0]=Vr,i({})},[]);return[t.current[0]===Vr?n:t.current[0],o,s]}function Nc(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 pp(e){const t=f.useRef(e);return Ii(e,t.current)||(t.current=e),t.current}const mp=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return f.createElement(Qg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(lp.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(zl,null)))};function Bc(){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 Gr=Bc();function vp(e){Gr=e}const Wc=/[&<>"']/,bp=new RegExp(Wc.source,"g"),Uc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,wp=new RegExp(Uc.source,"g"),yp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},nu=e=>yp[e];function mn(e,t){if(t){if(Wc.test(e))return e.replace(bp,nu)}else if(Uc.test(e))return e.replace(wp,nu);return e}const Cp=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Gc(e){return e.replace(Cp,(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 Sp=/(^|[^\[])\^/g;function Ft(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Sp,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const xp=/[^\w:]/g,kp=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ru(e,t,n){if(e){let r;try{r=decodeURIComponent(Gc(n)).replace(xp,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!kp.test(n)&&(n=Ep(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const $o={},Mp=/^[^:]+:\/*[^/]*$/,Rp=/^([^:]+:)[\s\S]*$/,Ip=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ep(e,t){$o[" "+e]||(Mp.test(e)?$o[" "+e]=e+"/":$o[" "+e]=Zo(e,"/",!0)),e=$o[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Rp,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Ip,"$1")+t:e+t}const la={exec:function(){}};function iu(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Zo(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 Tp(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 Dp(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 ou(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function au(e,t,n,r){const i=t.href,o=t.title?mn(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:mn(s)}}function Op(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[s]=o;return s.length>=r.length?i.slice(r.length):i}).join(`
4
4
  `)}class $l{constructor(t){this.options=t||Gr}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:Zo(r,`
5
5
  `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Op(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=Zo(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,s,a,l,u,c,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(`
@@ -42,12 +42,12 @@ ${t}</blockquote>
42
42
  `}tablerow(t){return`<tr>
43
43
  ${t}</tr>
44
44
  `}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
45
- `}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){if(t=ru(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){if(t=ru(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(t){return t}}class Xc{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class Yc{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let r=t,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[t];do i++,r=t+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=i,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}class Rr{constructor(t){this.options=t||Gr,this.options.renderer=this.options.renderer||new Nl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xc,this.slugger=new Yc}static parse(t,n){return new Rr(n).parse(t)}static parseInline(t,n){return new Rr(n).parseInline(t)}parse(t,n=!0){let r="",i,o,s,a,l,u,c,d,g,h,p,m,y,v,b,x,T,k,R;const P=t.length;for(i=0;i<P;i++){if(h=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(R=this.options.extensions.renderers[h.type].call({parser:this},h),R!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){r+=R||"";continue}switch(h.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(h.tokens),h.depth,Gc(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(d="",c="",a=h.header.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(h.header[o].tokens),{header:!0,align:h.align[o]});for(d+=this.renderer.tablerow(c),g="",a=h.rows.length,o=0;o<a;o++){for(u=h.rows[o],c="",l=u.length,s=0;s<l;s++)c+=this.renderer.tablecell(this.parseInline(u[s].tokens),{header:!1,align:h.align[s]});g+=this.renderer.tablerow(c)}r+=this.renderer.table(d,g);continue}case"blockquote":{g=this.parse(h.tokens),r+=this.renderer.blockquote(g);continue}case"list":{for(p=h.ordered,m=h.start,y=h.loose,a=h.items.length,g="",o=0;o<a;o++)b=h.items[o],x=b.checked,T=b.task,v="",b.task&&(k=this.renderer.checkbox(x),y?b.tokens.length>0&&b.tokens[0].type==="paragraph"?(b.tokens[0].text=k+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"&&(b.tokens[0].tokens[0].text=k+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:k}):v+=k),v+=this.parse(b.tokens,y),g+=this.renderer.listitem(v,T,x);r+=this.renderer.list(g,p,m);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(g=h.tokens?this.parseInline(h.tokens):h.text;i+1<P&&t[i+1].type==="text";)h=t[++i],g+=`
45
+ `}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){if(t=ru(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){if(t=ru(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(t){return t}}class Yc{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class Xc{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let r=t,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[t];do i++,r=t+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=i,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}class Rr{constructor(t){this.options=t||Gr,this.options.renderer=this.options.renderer||new Nl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Yc,this.slugger=new Xc}static parse(t,n){return new Rr(n).parse(t)}static parseInline(t,n){return new Rr(n).parseInline(t)}parse(t,n=!0){let r="",i,o,s,a,l,u,c,d,g,h,p,m,y,v,b,x,T,k,R;const P=t.length;for(i=0;i<P;i++){if(h=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(R=this.options.extensions.renderers[h.type].call({parser:this},h),R!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){r+=R||"";continue}switch(h.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(h.tokens),h.depth,Gc(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(d="",c="",a=h.header.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(h.header[o].tokens),{header:!0,align:h.align[o]});for(d+=this.renderer.tablerow(c),g="",a=h.rows.length,o=0;o<a;o++){for(u=h.rows[o],c="",l=u.length,s=0;s<l;s++)c+=this.renderer.tablecell(this.parseInline(u[s].tokens),{header:!1,align:h.align[s]});g+=this.renderer.tablerow(c)}r+=this.renderer.table(d,g);continue}case"blockquote":{g=this.parse(h.tokens),r+=this.renderer.blockquote(g);continue}case"list":{for(p=h.ordered,m=h.start,y=h.loose,a=h.items.length,g="",o=0;o<a;o++)b=h.items[o],x=b.checked,T=b.task,v="",b.task&&(k=this.renderer.checkbox(x),y?b.tokens.length>0&&b.tokens[0].type==="paragraph"?(b.tokens[0].text=k+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"&&(b.tokens[0].tokens[0].text=k+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:k}):v+=k),v+=this.parse(b.tokens,y),g+=this.renderer.listitem(v,T,x);r+=this.renderer.list(g,p,m);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(g=h.tokens?this.parseInline(h.tokens):h.text;i+1<P&&t[i+1].type==="text";)h=t[++i],g+=`
46
46
  `+(h.tokens?this.parseInline(h.tokens):h.text);r+=n?this.renderer.paragraph(g):g;continue}default:{const I='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(I);return}else throw new Error(I)}}}return r}parseInline(t,n){n=n||this.renderer;let r="",i,o,s;const a=t.length;for(i=0;i<a;i++){if(o=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(s=this.options.extensions.renderers[o.type].call({parser:this},o),s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){r+=s||"";continue}switch(o.type){case"escape":{r+=n.text(o.text);break}case"html":{r+=n.html(o.text);break}case"link":{r+=n.link(o.href,o.title,this.parseInline(o.tokens,n));break}case"image":{r+=n.image(o.href,o.title,o.text);break}case"strong":{r+=n.strong(this.parseInline(o.tokens,n));break}case"em":{r+=n.em(this.parseInline(o.tokens,n));break}case"codespan":{r+=n.codespan(o.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(o.tokens,n));break}case"text":{r+=n.text(o.text);break}default:{const l='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(l);return}else throw new Error(l)}}}return r}}class wl{constructor(t){this.options=t||Gr}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}}function Lp(e,t,n){return r=>{if(r.message+=`
47
- Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+mn(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function jc(e,t){return(n,r,i)=>{typeof r=="function"&&(i=r,r=null);const o={...r};r={...We.defaults,...o};const s=Lp(r.silent,r.async,i);if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(Dp(r),r.hooks&&(r.hooks.options=r),i){const a=r.highlight;let l;try{r.hooks&&(n=r.hooks.preprocess(n)),l=e(n,r)}catch(d){return s(d)}const u=function(d){let g;if(!d)try{r.walkTokens&&We.walkTokens(l,r.walkTokens),g=t(l,r),r.hooks&&(g=r.hooks.postprocess(g))}catch(h){d=h}return r.highlight=a,d?s(d):i(null,g)};if(!a||a.length<3||(delete r.highlight,!l.length))return u();let c=0;We.walkTokens(l,function(d){d.type==="code"&&(c++,setTimeout(()=>{a(d.text,d.lang,function(g,h){if(g)return u(g);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(a=>e(a,r)).then(a=>r.walkTokens?Promise.all(We.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>t(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));const a=e(n,r);r.walkTokens&&We.walkTokens(a,r.walkTokens);let l=t(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return s(a)}}}function We(e,t,n){return jc(Mr.lex,Rr.parse)(e,t,n)}We.options=We.setOptions=function(e){return We.defaults={...We.defaults,...e},vp(We.defaults),We};We.getDefaults=Bc;We.defaults=Gr;We.use=function(...e){const t=We.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=We.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...s){let a=i.renderer.apply(this,s);return a===!1&&(a=o.apply(this,s)),a}:t.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[i.level]?t[i.level].unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=We.defaults.renderer||new Nl;for(const o in n.renderer){const s=i[o];i[o]=(...a)=>{let l=n.renderer[o].apply(i,a);return l===!1&&(l=s.apply(i,a)),l}}r.renderer=i}if(n.tokenizer){const i=We.defaults.tokenizer||new $l;for(const o in n.tokenizer){const s=i[o];i[o]=(...a)=>{let l=n.tokenizer[o].apply(i,a);return l===!1&&(l=s.apply(i,a)),l}}r.tokenizer=i}if(n.hooks){const i=We.defaults.hooks||new wl;for(const o in n.hooks){const s=i[o];wl.passThroughHooks.has(o)?i[o]=a=>{if(We.defaults.async)return Promise.resolve(n.hooks[o].call(i,a)).then(u=>s.call(i,u));const l=n.hooks[o].call(i,a);return s.call(i,l)}:i[o]=(...a)=>{let l=n.hooks[o].apply(i,a);return l===!1&&(l=s.apply(i,a)),l}}r.hooks=i}if(n.walkTokens){const i=We.defaults.walkTokens;r.walkTokens=function(o){let s=[];return s.push(n.walkTokens.call(this,o)),i&&(s=s.concat(i.call(this,o))),s}}We.setOptions(r)})};We.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(We,r)),r.type){case"table":{for(const i of r.header)n=n.concat(We.walkTokens(i.tokens,t));for(const i of r.rows)for(const o of i)n=n.concat(We.walkTokens(o.tokens,t));break}case"list":{n=n.concat(We.walkTokens(r.items,t));break}default:We.defaults.extensions&&We.defaults.extensions.childTokens&&We.defaults.extensions.childTokens[r.type]?We.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(We.walkTokens(r[i],t))}):r.tokens&&(n=n.concat(We.walkTokens(r.tokens,t)))}return n};We.parseInline=jc(Mr.lexInline,Rr.parseInline);We.Parser=Rr;We.parser=Rr.parse;We.Renderer=Nl;We.TextRenderer=Xc;We.Lexer=Mr;We.lexer=Mr.lex;We.Tokenizer=$l;We.Slugger=Yc;We.Hooks=wl;We.parse=We;We.options;We.setOptions;We.use;We.walkTokens;We.parseInline;Rr.parse;Mr.lex;const Fp=dn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class _p extends zt.PureComponent{targetElement=null;renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:r,createNode:i}=n,o=We(r),s=document.createRange();s.selectNodeContents(t),s.deleteContents();let a=i?.(o);if(a===void 0){const u=document.createElement("template");u.innerHTML=o,a=u.content}t.append(a);const l=t.getElementsByTagName("a");for(const u of l)u.target="_blank",u.rel="noreferrer noopener"}containerRefHook=t=>{this.targetElement=t,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),zt.createElement(Fp,{ref:this.containerRefHook})}}const Ap=dn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),Hp=dn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),zp=dn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let su=0;const Xr=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:o,validatedSelection:s,...a}=e,{onChange:l,className:u}=a,c=f.useRef(null),d=n??"";Pn(l!==void 0,"GrowingEntry must be a controlled input area");const[g]=f.useState(()=>"input-box-"+(su=(su+1)%1e7));f.useEffect(()=>{const p=c.current;if(p===null||p.disabled)return;const m=d.toString().length;p.focus(),p.setSelectionRange(i?0:m,m)},[]),f.useLayoutEffect(()=>{if(s!==void 0){const p=typeof s=="number"?[s,null]:s;c.current?.setSelectionRange(p[0],p[1])}},[s]);const h=f.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&o===!0||r?.(p)},[o,r]);return f.createElement(zp,{className:"gdg-growing-entry"},f.createElement(Hp,{className:u},d+`
47
+ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+mn(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function jc(e,t){return(n,r,i)=>{typeof r=="function"&&(i=r,r=null);const o={...r};r={...We.defaults,...o};const s=Lp(r.silent,r.async,i);if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(Dp(r),r.hooks&&(r.hooks.options=r),i){const a=r.highlight;let l;try{r.hooks&&(n=r.hooks.preprocess(n)),l=e(n,r)}catch(d){return s(d)}const u=function(d){let g;if(!d)try{r.walkTokens&&We.walkTokens(l,r.walkTokens),g=t(l,r),r.hooks&&(g=r.hooks.postprocess(g))}catch(h){d=h}return r.highlight=a,d?s(d):i(null,g)};if(!a||a.length<3||(delete r.highlight,!l.length))return u();let c=0;We.walkTokens(l,function(d){d.type==="code"&&(c++,setTimeout(()=>{a(d.text,d.lang,function(g,h){if(g)return u(g);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(a=>e(a,r)).then(a=>r.walkTokens?Promise.all(We.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>t(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));const a=e(n,r);r.walkTokens&&We.walkTokens(a,r.walkTokens);let l=t(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return s(a)}}}function We(e,t,n){return jc(Mr.lex,Rr.parse)(e,t,n)}We.options=We.setOptions=function(e){return We.defaults={...We.defaults,...e},vp(We.defaults),We};We.getDefaults=Bc;We.defaults=Gr;We.use=function(...e){const t=We.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=We.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...s){let a=i.renderer.apply(this,s);return a===!1&&(a=o.apply(this,s)),a}:t.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[i.level]?t[i.level].unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=We.defaults.renderer||new Nl;for(const o in n.renderer){const s=i[o];i[o]=(...a)=>{let l=n.renderer[o].apply(i,a);return l===!1&&(l=s.apply(i,a)),l}}r.renderer=i}if(n.tokenizer){const i=We.defaults.tokenizer||new $l;for(const o in n.tokenizer){const s=i[o];i[o]=(...a)=>{let l=n.tokenizer[o].apply(i,a);return l===!1&&(l=s.apply(i,a)),l}}r.tokenizer=i}if(n.hooks){const i=We.defaults.hooks||new wl;for(const o in n.hooks){const s=i[o];wl.passThroughHooks.has(o)?i[o]=a=>{if(We.defaults.async)return Promise.resolve(n.hooks[o].call(i,a)).then(u=>s.call(i,u));const l=n.hooks[o].call(i,a);return s.call(i,l)}:i[o]=(...a)=>{let l=n.hooks[o].apply(i,a);return l===!1&&(l=s.apply(i,a)),l}}r.hooks=i}if(n.walkTokens){const i=We.defaults.walkTokens;r.walkTokens=function(o){let s=[];return s.push(n.walkTokens.call(this,o)),i&&(s=s.concat(i.call(this,o))),s}}We.setOptions(r)})};We.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(We,r)),r.type){case"table":{for(const i of r.header)n=n.concat(We.walkTokens(i.tokens,t));for(const i of r.rows)for(const o of i)n=n.concat(We.walkTokens(o.tokens,t));break}case"list":{n=n.concat(We.walkTokens(r.items,t));break}default:We.defaults.extensions&&We.defaults.extensions.childTokens&&We.defaults.extensions.childTokens[r.type]?We.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(We.walkTokens(r[i],t))}):r.tokens&&(n=n.concat(We.walkTokens(r.tokens,t)))}return n};We.parseInline=jc(Mr.lexInline,Rr.parseInline);We.Parser=Rr;We.parser=Rr.parse;We.Renderer=Nl;We.TextRenderer=Yc;We.Lexer=Mr;We.lexer=Mr.lex;We.Tokenizer=$l;We.Slugger=Xc;We.Hooks=wl;We.parse=We;We.options;We.setOptions;We.use;We.walkTokens;We.parseInline;Rr.parse;Mr.lex;const Fp=dn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class _p extends zt.PureComponent{targetElement=null;renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:r,createNode:i}=n,o=We(r),s=document.createRange();s.selectNodeContents(t),s.deleteContents();let a=i?.(o);if(a===void 0){const u=document.createElement("template");u.innerHTML=o,a=u.content}t.append(a);const l=t.getElementsByTagName("a");for(const u of l)u.target="_blank",u.rel="noreferrer noopener"}containerRefHook=t=>{this.targetElement=t,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),zt.createElement(Fp,{ref:this.containerRefHook})}}const Ap=dn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),Hp=dn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),zp=dn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let su=0;const Yr=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:o,validatedSelection:s,...a}=e,{onChange:l,className:u}=a,c=f.useRef(null),d=n??"";Pn(l!==void 0,"GrowingEntry must be a controlled input area");const[g]=f.useState(()=>"input-box-"+(su=(su+1)%1e7));f.useEffect(()=>{const p=c.current;if(p===null||p.disabled)return;const m=d.toString().length;p.focus(),p.setSelectionRange(i?0:m,m)},[]),f.useLayoutEffect(()=>{if(s!==void 0){const p=typeof s=="number"?[s,null]:s;c.current?.setSelectionRange(p[0],p[1])}},[s]);const h=f.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&o===!0||r?.(p)},[o,r]);return f.createElement(zp,{className:"gdg-growing-entry"},f.createElement(Hp,{className:u},d+`
48
48
  `),f.createElement(Ap,{...a,className:(u??"")+" gdg-input",id:g,ref:c,onKeyDown:h,value:d,placeholder:t,dir:"auto"}))},Qa={};let wr=null;function Vp(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function so(e){const t=e.toLowerCase().trim();if(Qa[t]!==void 0)return Qa[t];wr=wr||Vp(),wr.style.color="#000",wr.style.color=t;const n=getComputedStyle(wr).color;wr.style.color="#fff",wr.style.color=t;const r=getComputedStyle(wr).color;if(r!==n)return[0,0,0,1];let i=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return i.length<4&&i.push(1),i=i.map(o=>Number.isNaN(o)?0:o),Qa[t]=i,i}function Wr(e,t){const[n,r,i]=so(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const uu=new Map;function cu(e,t){const n=`${e}-${t}`,r=uu.get(n);if(r!==void 0)return r;const i=Ln(e,t);return uu.set(n,i),i}function Ln(e,t){if(t===void 0)return e;const[n,r,i,o]=so(e);if(o===1)return e;const[s,a,l,u]=so(t),c=o+u*(1-o),d=(o*n+u*s*(1-o))/c,g=(o*r+u*a*(1-o))/c,h=(o*i+u*l*(1-o))/c;return`rgba(${d}, ${g}, ${h}, ${c})`}function yl(e){if(e==="transparent")return 0;function t(o){const s=o/255;return s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}const[n,r,i]=so(e);return .2126*t(n)+.7152*t(r)+.0722*t(i)}var Ci=new Map,xi=new Map,Cl=new Map;function $p(){Ci.clear(),Cl.clear(),xi.clear()}function Np(e,t,n,r,i){var o,s,a;let l=0,u={};for(let d of e)l+=(o=n.get(d))!=null?o:i,u[d]=((s=u[d])!=null?s:0)+1;let c=t-l;for(let d of Object.keys(u)){let g=u[d],h=(a=n.get(d))!=null?a:i,p=h*g/l,m=c*p*r/g,y=h+m;n.set(d,y)}}function Bp(e,t){var n;let r=new Map,i=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;r.set(u,c),i+=c}let o=i/r.size,s=3,a=(t/o+s)/(s+1),l=r.keys();for(let u of l)r.set(u,((n=r.get(u))!=null?n:o)*a);return r}function ro(e,t,n,r){var i,o;let s=xi.get(n);if(r&&s!==void 0&&s.count>2e4){let u=Cl.get(n);if(u===void 0&&(u=Bp(e,s.size),Cl.set(n,u)),s.count>5e5){let d=0;for(let g of t)d+=(i=u.get(g))!=null?i:s.size;return d*1.01}let c=e.measureText(t);return Np(t,c.width,u,Math.max(.05,1-s.count/2e5),s.size),xi.set(n,{count:s.count+t.length,size:s.size}),c.width}let a=e.measureText(t),l=a.width/t.length;if(((o=s?.count)!=null?o:0)>2e4)return a.width;if(s===void 0)xi.set(n,{count:t.length,size:l});else{let u=l-s.size,c=t.length/(s.count+t.length),d=s.size+u*c;xi.set(n,{count:s.count+t.length,size:d})}return a.width}function Wp(e,t,n,r,i,o,s,a){if(t.length<=1)return t.length;if(i<n)return-1;let l=Math.floor(n/i*o),u=ro(e,t.slice(0,Math.max(0,l)),r,s);if(u!==n)if(u<n){for(;u<n;)l++,u=ro(e,t.slice(0,Math.max(0,l)),r,s);l--}else for(;u>n;){let c=t.lastIndexOf(" ",l-1);c>0?l=c:l--,u=ro(e,t.slice(0,Math.max(0,l)),r,s)}if(t[l]!==" "){let c=0;c=t.lastIndexOf(" ",l),c>0&&(l=c)}return l}function Up(e,t,n,r,i,o){let s=`${t}_${n}_${r}px`,a=Ci.get(s);if(a!==void 0)return a;if(r<=0)return[];let l=[],u=t.split(`
49
- `),c=xi.get(n),d=c===void 0?t.length:r/c.size*1.5,g=i&&c!==void 0&&c.count>2e4;for(let h of u){let p=ro(e,h.slice(0,Math.max(0,d)),n,g),m=Math.min(h.length,d);if(p<=r)l.push(h);else{for(;p>r;){let y=Wp(e,h,r,n,p,m,g),v=h.slice(0,Math.max(0,y));h=h.slice(v.length),l.push(v),p=ro(e,h.slice(0,Math.max(0,d)),n,g),m=Math.min(h.length,d)}p>0&&l.push(h)}}return l=l.map((h,p)=>p===0?h.trimEnd():h.trim()),Ci.set(s,l),Ci.size>500&&Ci.delete(Ci.keys().next().value),l}function Gp(e,t){return zt.useMemo(()=>e.map((n,r)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:r,sticky:r<t,indicatorIcon:n.indicatorIcon,style:n.style,themeOverride:n.themeOverride,title:n.title,trailingRowOptions:n.trailingRowOptions,width:n.width,growOffset:n.growOffset,rowMarker:n.rowMarker,rowMarkerChecked:n.rowMarkerChecked,headerRowMarkerTheme:n.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:n.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:n.headerRowMarkerDisabled})),[e,t])}function Xp(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(io(e.current.cell,t))return!0;const i=[e.current.range,...e.current.rangeStack];for(const o of i)if(n>=o.x&&n<o.x+o.width&&r>=o.y&&r<o.y+o.height)return!0}return!1}function uo(e,t){return(e??"")===(t??"")}function Yp(e,t,n){return n.current===void 0||e[1]!==n.current.cell[1]?!1:t.span===void 0?n.current.cell[0]===e[0]:n.current.cell[0]>=t.span[0]&&n.current.cell[0]<=t.span[1]}function qc(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function io(e,t){return e?.[0]===t?.[0]&&e?.[1]===t?.[1]}function Kc(e){return[e.x+e.width-1,e.y+e.height-1]}function du(e,t,n){const r=n.x,i=n.x+n.width-1,o=n.y,s=n.y+n.height-1,[a,l]=e;if(l<o||l>s)return!1;if(t.span===void 0)return a>=r&&a<=i;const[u,c]=t.span;return u>=r&&u<=i||c>=r&&u<=i||u<r&&c>i}function jp(e,t,n,r){let i=0;if(n.current===void 0)return i;const o=n.current.range;(r||o.height*o.width>1)&&du(e,t,o)&&i++;for(const s of n.current.rangeStack)du(e,t,s)&&i++;return i}function Zc(e,t){let n=e;if(t!==void 0){let r=[...e];const i=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,i)):(r.splice(t.dest+1,0,i),r.splice(t.src,1)),r=r.map((o,s)=>({...o,sticky:e[s].sticky})),n=r}return n}function Ei(e,t){let n=0;const r=Zc(e,t);for(let i=0;i<r.length;i++){const o=r[i];if(o.sticky)n+=o.width;else break}return n}function Yr(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let i=e-t;i<e;i++)r+=n(i);return r}}function Sl(e,t,n,r,i){const o=Zc(e,r),s=[];for(const u of o)if(u.sticky)s.push(u);else break;if(s.length>0)for(const u of s)n-=u.width;let a=t,l=i??0;for(;l<=n&&a<o.length;)l+=o[a].width,a++;for(let u=t;u<a;u++){const c=o[u];c.sticky||s.push(c)}return s}function qp(e,t,n){let r=0;for(const i of t){const o=i.sticky?r:r+(n??0);if(e<=o+i.width)return i.sourceIndex;r+=i.width}return-1}function Kp(e,t,n,r,i,o,s,a,l,u){const c=r+i;if(n&&e<=i)return-2;if(e<=c)return-1;let d=t;for(let p=0;p<u;p++){const m=o-1-p,y=typeof s=="number"?s:s(m);if(d-=y,e>=d)return m}const g=o-u,h=e-(l??0);if(typeof s=="number"){const p=Math.floor((h-c)/s)+a;return p>=g?void 0:p}else{let p=c;for(let m=a;m<g;m++){const y=s(m);if(h<=p+y)return m;p+=y}return}}let Jo=0,oo={};const Zp=typeof window>"u";async function Jp(){Zp||document?.fonts?.ready===void 0||(await document.fonts.ready,Jo=0,oo={},$p())}Jp();function Jc(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Ir(e,t,n,r="middle"){const i=Jc(e,t,r,n);let o=oo[i];return o===void 0&&(o=t.measureText(e),oo[i]=o,Jo++),Jo>1e4&&(oo={},Jo=0),o}function Qc(e,t){const n=Jc(e,void 0,"middle",t);return oo[n]}function qn(e,t){return typeof t!="string"&&(t=t.baseFontFull),Qp(e,t)}function fu(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const hu=[];function Qp(e,t){for(const o of hu)if(o.key===t)return o.val;const n=fu(e,"alphabetic"),i=-(fu(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return hu.push({key:t,val:i}),i}function em(e,t,n,r,i,o){const{ctx:s,rect:a,theme:l}=e;let u=Number.MAX_SAFE_INTEGER;const c=500;if(t!==void 0&&(u=n-t,u<c)){const d=1-u/c;s.globalAlpha=d,s.fillStyle=l.bgSearchResult,s.fillRect(a.x+1,a.y+1,a.width-(i?2:1),a.height-(o?2:1)),s.globalAlpha=1,r!==void 0&&(r.fillStyle=l.bgSearchResult)}return u<c}function bo(e,t,n){const{ctx:r,theme:i}=e,o=t??{},s=n??i.textDark;return s!==o.fillStyle&&(r.fillStyle=s,o.fillStyle=s),o}function Bl(e,t,n,r,i){const{rect:o,ctx:s,theme:a}=e;s.fillStyle=a.textDark,nr({ctx:s,rect:o,theme:a},t,n,r,i)}function ed(e,t,n,r,i,o,s,a,l){l==="right"?e.fillText(t,n+i-(a.cellHorizontalPadding+.5),r+o/2+s):l==="center"?e.fillText(t,n+i/2,r+o/2+s):e.fillText(t,n+a.cellHorizontalPadding+.5,r+o/2+s)}function Wl(e,t){const n=Ir("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function tm(e,t){e.includes(`
50
- `)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function nm(e,t,n,r,i,o,s,a,l,u){const c=a.baseFontFull,d=Up(e,t,c,i-a.cellHorizontalPadding*2,u??!1),g=Wl(e,c),h=a.lineHeight*g,p=g+h*(d.length-1),m=p+a.cellVerticalPadding>o;m&&(e.save(),e.rect(n,r,i,o),e.clip());const y=r+o/2-p/2;let v=Math.max(r+a.cellVerticalPadding,y);for(const b of d)if(ed(e,b,n,v,i,g,s,a,l),v+=h,v>r+o)break;m&&e.restore()}function nr(e,t,n,r,i){const{ctx:o,rect:s,theme:a}=e,{x:l,y:u,width:c,height:d}=s;r=r??!1,r||(t=tm(t,c));const g=qn(o,a),h=Vl(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(o.direction="rtl"),t.length>0){let p=!1;n==="right"?(o.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,p=!0),r?nm(o,t,l,u,c,d,g,a,n,i):ed(o,t,l,u,c,d,g,a,n),p&&(o.textAlign="start"),h&&(o.direction="inherit")}}function jn(e,t,n,r,i,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,i/2,r/2)),tr:Math.max(0,Math.min(o.tr,i/2,r/2)),bl:Math.max(0,Math.min(o.bl,i/2,r/2)),br:Math.max(0,Math.min(o.br,i/2,r/2))},e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function rm(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function im(e,t,n){const r=function(a,l){const u=l.x-a.x,c=l.y-a.y,d=Math.sqrt(u*u+c*c),g=u/d,h=c/d;return{x:u,y:l.y-a.y,len:d,nx:g,ny:h,ang:Math.atan2(h,g)}};let i;const o=t.length;let s=t[o-1];for(let a=0;a<o;a++){let l=t[a%o];const u=t[(a+1)%o],c=r(l,s),d=r(l,u),g=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let p=Math.asin(g<-1?-1:g>1?1:g),m=1,y=!1;h<0?p<0?p=Math.PI+p:(p=Math.PI-p,m=-1,y=!0):p>0&&(m=-1,y=!0),i=l.radius!==void 0?l.radius:n;const v=p/2;let b=Math.abs(Math.cos(v)*i/Math.sin(v)),x;b>Math.min(c.len/2,d.len/2)?(b=Math.min(c.len/2,d.len/2),x=Math.abs(b*Math.sin(v)/Math.cos(v))):x=i;let T=l.x+d.nx*b,k=l.y+d.ny*b;T+=-d.ny*x*m,k+=d.nx*x*m,e.arc(T,k,x,c.ang+Math.PI/2*m,d.ang-Math.PI/2*m,y),s=l,l=u}e.closePath()}function xl(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p){const m={x:0,y:o+u,width:0,height:0};if(e>=h.length||t>=c||t<-2||e<0)return m;const y=o-i;if(e>=d){const v=s>e?-1:1,b=Ei(h);m.x+=b+l;for(let x=s;x!==e;x+=v)m.x+=h[v===1?x:x-1].width*v}else for(let v=0;v<e;v++)m.x+=h[v].width;if(m.width=h[e].width+1,t===-1)m.y=i,m.height=y;else if(t===-2){m.y=0,m.height=i;let v=e;const b=h[e].group,x=h[e].sticky;for(;v>0&&uo(h[v-1].group,b)&&h[v-1].sticky===x;){const k=h[v-1];m.x-=k.width,m.width+=k.width,v--}let T=e;for(;T+1<h.length&&uo(h[T+1].group,b)&&h[T+1].sticky===x;){const k=h[T+1];m.width+=k.width,T++}if(!x){const k=Ei(h),R=m.x-k;R<0&&(m.x-=R,m.width+=R),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=c-g){let v=c-t;for(m.y=r;v>0;){const b=t+v-1;m.height=typeof p=="number"?p:p(b),m.y-=m.height,v--}m.height+=1}else{const v=a>t?-1:1;if(typeof p=="number"){const b=t-a;m.y+=b*p}else for(let b=a;b!==t;b+=v)m.y+=p(b)*v;m.height=(typeof p=="number"?p:p(t))+1}return m}const Ul=1<<21;function Yn(e,t){return(t+2)*Ul+e}function td(e){return e%Ul}function Gl(e){return Math.floor(e/Ul)-2}function Xl(e){const t=td(e),n=Gl(e);return[t,n]}class nd{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=td(t),r=Gl(t),i=this.visibleWindow,o=n>=i.x&&n<=i.x+i.width||n<this.freezeCols,s=r>=i.y&&r<=i.y+i.height||this.freezeRows.includes(r);return o&&s};setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&Ii(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class om extends nd{cache=new Map;setValue=(t,n)=>{this.cache.set(Yn(t[0],t[1]),n)};getValue=t=>this.cache.get(Yn(t[0],t[1]));clearOutOfWindow=()=>{for(const[t]of this.cache.entries())this.isInWindow(t)||this.cache.delete(t)}}class ao{cells;constructor(t=[]){this.cells=new Set(t.map(n=>Yn(n[0],n[1])))}add(t){this.cells.add(Yn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(Yn(t[0],t[1]))}remove(t){this.cells.delete(Yn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Gl(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Yn(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield Xl(t)}}function am(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const rd={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function id(){return rd}const od=zt.createContext(rd);function ad(){return zt.useContext(od)}function cr(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const i in r)r.hasOwnProperty(i)&&(i==="bgCell"?n[i]=Ln(r[i],n[i]):n[i]=r[i]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const kl=150;function lm(e,t,n,r){return r(t)?.measure?.(e,t,n)??kl}function ld(e,t,n,r,i,o,s,a,l){let u=0;const c=i===void 0?[]:i.map(h=>{const p=lm(e,h[r],t,l);return u=Math.max(u,p),p});if(c.length>5&&a){u=0;let h=0;for(const m of c)h+=m;const p=h/c.length;for(let m=0;m<c.length;m++)c[m]>=p*2?c[m]=0:u=Math.max(u,c[m])}const d=e.font;e.font=t.headerFontFull,u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=d;const g=Math.max(Math.ceil(o),Math.min(Math.floor(s),Math.ceil(u)));return{...n,width:g}}function sm(e,t,n,r,i,o,s,a,l){const u=f.useRef(t),c=f.useRef(n),d=f.useRef(s);u.current=t,c.current=n,d.current=s;const[g,h]=f.useMemo(()=>{if(typeof window>"u")return[null,null];const b=document.createElement("canvas");return b.style.display="none",b.style.opacity="0",b.style.position="fixed",[b,b.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g?.remove()}),[g]);const p=f.useRef({}),m=f.useRef(),[y,v]=f.useState();return f.useLayoutEffect(()=>{const b=c.current;if(b===void 0||e.every(Ao))return;let x=Math.max(1,10-Math.floor(e.length/1e4)),T=0;x<u.current&&x>1&&(x--,T=1);const k={x:0,y:0,width:e.length,height:Math.min(u.current,x)},R={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const I=b(k,l.signal),C=T>0?b(R,l.signal):void 0;let F;typeof I=="object"?F=I:F=await zs(I),C!==void 0&&(typeof C=="object"?F=[...F,...C]:F=[...F,...await zs(C)]),m.current=e,v(F)})()},[l.signal,e]),f.useMemo(()=>{let x=e.every(Ao)?e:h===null?e.map(P=>Ao(P)?P:{...P,width:kl}):(h.font=d.current.baseFontFull,e.map((P,I)=>{if(Ao(P))return P;if(p.current[P.id]!==void 0)return{...P,width:p.current[P.id]};if(y===void 0||m.current!==e||P.id===void 0)return{...P,width:kl};const C=ld(h,s,P,I,y,i,o,!0,a);return p.current[P.id]=C.width,C})),T=0,k=0;const R=[];for(const[P,I]of x.entries())T+=I.width,I.grow!==void 0&&I.grow>0&&(k+=I.grow,R.push(P));if(T<r&&R.length>0){const P=[...x],I=r-T;let C=I;for(let F=0;F<R.length;F++){const D=R[F],S=(x[D].grow??0)/k,E=F===R.length-1?C:Math.min(C,Math.floor(I*S));P[D]={...x[D],growOffset:E,width:x[D].width+E},C-=E}x=P}return{sizedColumns:x,nonGrowWidth:T}},[r,e,h,y,s,i,o,a])}const Vt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',um=e=>{const t=e.fgColor,n=e.bgColor;return`
49
+ `),c=xi.get(n),d=c===void 0?t.length:r/c.size*1.5,g=i&&c!==void 0&&c.count>2e4;for(let h of u){let p=ro(e,h.slice(0,Math.max(0,d)),n,g),m=Math.min(h.length,d);if(p<=r)l.push(h);else{for(;p>r;){let y=Wp(e,h,r,n,p,m,g),v=h.slice(0,Math.max(0,y));h=h.slice(v.length),l.push(v),p=ro(e,h.slice(0,Math.max(0,d)),n,g),m=Math.min(h.length,d)}p>0&&l.push(h)}}return l=l.map((h,p)=>p===0?h.trimEnd():h.trim()),Ci.set(s,l),Ci.size>500&&Ci.delete(Ci.keys().next().value),l}function Gp(e,t){return zt.useMemo(()=>e.map((n,r)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:r,sticky:r<t,indicatorIcon:n.indicatorIcon,style:n.style,themeOverride:n.themeOverride,title:n.title,trailingRowOptions:n.trailingRowOptions,width:n.width,growOffset:n.growOffset,rowMarker:n.rowMarker,rowMarkerChecked:n.rowMarkerChecked,headerRowMarkerTheme:n.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:n.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:n.headerRowMarkerDisabled})),[e,t])}function Yp(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(io(e.current.cell,t))return!0;const i=[e.current.range,...e.current.rangeStack];for(const o of i)if(n>=o.x&&n<o.x+o.width&&r>=o.y&&r<o.y+o.height)return!0}return!1}function uo(e,t){return(e??"")===(t??"")}function Xp(e,t,n){return n.current===void 0||e[1]!==n.current.cell[1]?!1:t.span===void 0?n.current.cell[0]===e[0]:n.current.cell[0]>=t.span[0]&&n.current.cell[0]<=t.span[1]}function qc(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function io(e,t){return e?.[0]===t?.[0]&&e?.[1]===t?.[1]}function Kc(e){return[e.x+e.width-1,e.y+e.height-1]}function du(e,t,n){const r=n.x,i=n.x+n.width-1,o=n.y,s=n.y+n.height-1,[a,l]=e;if(l<o||l>s)return!1;if(t.span===void 0)return a>=r&&a<=i;const[u,c]=t.span;return u>=r&&u<=i||c>=r&&u<=i||u<r&&c>i}function jp(e,t,n,r){let i=0;if(n.current===void 0)return i;const o=n.current.range;(r||o.height*o.width>1)&&du(e,t,o)&&i++;for(const s of n.current.rangeStack)du(e,t,s)&&i++;return i}function Zc(e,t){let n=e;if(t!==void 0){let r=[...e];const i=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,i)):(r.splice(t.dest+1,0,i),r.splice(t.src,1)),r=r.map((o,s)=>({...o,sticky:e[s].sticky})),n=r}return n}function Ei(e,t){let n=0;const r=Zc(e,t);for(let i=0;i<r.length;i++){const o=r[i];if(o.sticky)n+=o.width;else break}return n}function Xr(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let i=e-t;i<e;i++)r+=n(i);return r}}function Sl(e,t,n,r,i){const o=Zc(e,r),s=[];for(const u of o)if(u.sticky)s.push(u);else break;if(s.length>0)for(const u of s)n-=u.width;let a=t,l=i??0;for(;l<=n&&a<o.length;)l+=o[a].width,a++;for(let u=t;u<a;u++){const c=o[u];c.sticky||s.push(c)}return s}function qp(e,t,n){let r=0;for(const i of t){const o=i.sticky?r:r+(n??0);if(e<=o+i.width)return i.sourceIndex;r+=i.width}return-1}function Kp(e,t,n,r,i,o,s,a,l,u){const c=r+i;if(n&&e<=i)return-2;if(e<=c)return-1;let d=t;for(let p=0;p<u;p++){const m=o-1-p,y=typeof s=="number"?s:s(m);if(d-=y,e>=d)return m}const g=o-u,h=e-(l??0);if(typeof s=="number"){const p=Math.floor((h-c)/s)+a;return p>=g?void 0:p}else{let p=c;for(let m=a;m<g;m++){const y=s(m);if(h<=p+y)return m;p+=y}return}}let Jo=0,oo={};const Zp=typeof window>"u";async function Jp(){Zp||document?.fonts?.ready===void 0||(await document.fonts.ready,Jo=0,oo={},$p())}Jp();function Jc(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Ir(e,t,n,r="middle"){const i=Jc(e,t,r,n);let o=oo[i];return o===void 0&&(o=t.measureText(e),oo[i]=o,Jo++),Jo>1e4&&(oo={},Jo=0),o}function Qc(e,t){const n=Jc(e,void 0,"middle",t);return oo[n]}function qn(e,t){return typeof t!="string"&&(t=t.baseFontFull),Qp(e,t)}function fu(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const hu=[];function Qp(e,t){for(const o of hu)if(o.key===t)return o.val;const n=fu(e,"alphabetic"),i=-(fu(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return hu.push({key:t,val:i}),i}function em(e,t,n,r,i,o){const{ctx:s,rect:a,theme:l}=e;let u=Number.MAX_SAFE_INTEGER;const c=500;if(t!==void 0&&(u=n-t,u<c)){const d=1-u/c;s.globalAlpha=d,s.fillStyle=l.bgSearchResult,s.fillRect(a.x+1,a.y+1,a.width-(i?2:1),a.height-(o?2:1)),s.globalAlpha=1,r!==void 0&&(r.fillStyle=l.bgSearchResult)}return u<c}function bo(e,t,n){const{ctx:r,theme:i}=e,o=t??{},s=n??i.textDark;return s!==o.fillStyle&&(r.fillStyle=s,o.fillStyle=s),o}function Bl(e,t,n,r,i){const{rect:o,ctx:s,theme:a}=e;s.fillStyle=a.textDark,nr({ctx:s,rect:o,theme:a},t,n,r,i)}function ed(e,t,n,r,i,o,s,a,l){l==="right"?e.fillText(t,n+i-(a.cellHorizontalPadding+.5),r+o/2+s):l==="center"?e.fillText(t,n+i/2,r+o/2+s):e.fillText(t,n+a.cellHorizontalPadding+.5,r+o/2+s)}function Wl(e,t){const n=Ir("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function tm(e,t){e.includes(`
50
+ `)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function nm(e,t,n,r,i,o,s,a,l,u){const c=a.baseFontFull,d=Up(e,t,c,i-a.cellHorizontalPadding*2,u??!1),g=Wl(e,c),h=a.lineHeight*g,p=g+h*(d.length-1),m=p+a.cellVerticalPadding>o;m&&(e.save(),e.rect(n,r,i,o),e.clip());const y=r+o/2-p/2;let v=Math.max(r+a.cellVerticalPadding,y);for(const b of d)if(ed(e,b,n,v,i,g,s,a,l),v+=h,v>r+o)break;m&&e.restore()}function nr(e,t,n,r,i){const{ctx:o,rect:s,theme:a}=e,{x:l,y:u,width:c,height:d}=s;r=r??!1,r||(t=tm(t,c));const g=qn(o,a),h=Vl(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(o.direction="rtl"),t.length>0){let p=!1;n==="right"?(o.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,p=!0),r?nm(o,t,l,u,c,d,g,a,n,i):ed(o,t,l,u,c,d,g,a,n),p&&(o.textAlign="start"),h&&(o.direction="inherit")}}function jn(e,t,n,r,i,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,i/2,r/2)),tr:Math.max(0,Math.min(o.tr,i/2,r/2)),bl:Math.max(0,Math.min(o.bl,i/2,r/2)),br:Math.max(0,Math.min(o.br,i/2,r/2))},e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function rm(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function im(e,t,n){const r=function(a,l){const u=l.x-a.x,c=l.y-a.y,d=Math.sqrt(u*u+c*c),g=u/d,h=c/d;return{x:u,y:l.y-a.y,len:d,nx:g,ny:h,ang:Math.atan2(h,g)}};let i;const o=t.length;let s=t[o-1];for(let a=0;a<o;a++){let l=t[a%o];const u=t[(a+1)%o],c=r(l,s),d=r(l,u),g=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let p=Math.asin(g<-1?-1:g>1?1:g),m=1,y=!1;h<0?p<0?p=Math.PI+p:(p=Math.PI-p,m=-1,y=!0):p>0&&(m=-1,y=!0),i=l.radius!==void 0?l.radius:n;const v=p/2;let b=Math.abs(Math.cos(v)*i/Math.sin(v)),x;b>Math.min(c.len/2,d.len/2)?(b=Math.min(c.len/2,d.len/2),x=Math.abs(b*Math.sin(v)/Math.cos(v))):x=i;let T=l.x+d.nx*b,k=l.y+d.ny*b;T+=-d.ny*x*m,k+=d.nx*x*m,e.arc(T,k,x,c.ang+Math.PI/2*m,d.ang-Math.PI/2*m,y),s=l,l=u}e.closePath()}function xl(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p){const m={x:0,y:o+u,width:0,height:0};if(e>=h.length||t>=c||t<-2||e<0)return m;const y=o-i;if(e>=d){const v=s>e?-1:1,b=Ei(h);m.x+=b+l;for(let x=s;x!==e;x+=v)m.x+=h[v===1?x:x-1].width*v}else for(let v=0;v<e;v++)m.x+=h[v].width;if(m.width=h[e].width+1,t===-1)m.y=i,m.height=y;else if(t===-2){m.y=0,m.height=i;let v=e;const b=h[e].group,x=h[e].sticky;for(;v>0&&uo(h[v-1].group,b)&&h[v-1].sticky===x;){const k=h[v-1];m.x-=k.width,m.width+=k.width,v--}let T=e;for(;T+1<h.length&&uo(h[T+1].group,b)&&h[T+1].sticky===x;){const k=h[T+1];m.width+=k.width,T++}if(!x){const k=Ei(h),R=m.x-k;R<0&&(m.x-=R,m.width+=R),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=c-g){let v=c-t;for(m.y=r;v>0;){const b=t+v-1;m.height=typeof p=="number"?p:p(b),m.y-=m.height,v--}m.height+=1}else{const v=a>t?-1:1;if(typeof p=="number"){const b=t-a;m.y+=b*p}else for(let b=a;b!==t;b+=v)m.y+=p(b)*v;m.height=(typeof p=="number"?p:p(t))+1}return m}const Ul=1<<21;function Xn(e,t){return(t+2)*Ul+e}function td(e){return e%Ul}function Gl(e){return Math.floor(e/Ul)-2}function Yl(e){const t=td(e),n=Gl(e);return[t,n]}class nd{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=td(t),r=Gl(t),i=this.visibleWindow,o=n>=i.x&&n<=i.x+i.width||n<this.freezeCols,s=r>=i.y&&r<=i.y+i.height||this.freezeRows.includes(r);return o&&s};setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&Ii(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class om extends nd{cache=new Map;setValue=(t,n)=>{this.cache.set(Xn(t[0],t[1]),n)};getValue=t=>this.cache.get(Xn(t[0],t[1]));clearOutOfWindow=()=>{for(const[t]of this.cache.entries())this.isInWindow(t)||this.cache.delete(t)}}class ao{cells;constructor(t=[]){this.cells=new Set(t.map(n=>Xn(n[0],n[1])))}add(t){this.cells.add(Xn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(Xn(t[0],t[1]))}remove(t){this.cells.delete(Xn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Gl(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Xn(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield Yl(t)}}function am(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const rd={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function id(){return rd}const od=zt.createContext(rd);function ad(){return zt.useContext(od)}function cr(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const i in r)r.hasOwnProperty(i)&&(i==="bgCell"?n[i]=Ln(r[i],n[i]):n[i]=r[i]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const kl=150;function lm(e,t,n,r){return r(t)?.measure?.(e,t,n)??kl}function ld(e,t,n,r,i,o,s,a,l){let u=0;const c=i===void 0?[]:i.map(h=>{const p=lm(e,h[r],t,l);return u=Math.max(u,p),p});if(c.length>5&&a){u=0;let h=0;for(const m of c)h+=m;const p=h/c.length;for(let m=0;m<c.length;m++)c[m]>=p*2?c[m]=0:u=Math.max(u,c[m])}const d=e.font;e.font=t.headerFontFull,u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=d;const g=Math.max(Math.ceil(o),Math.min(Math.floor(s),Math.ceil(u)));return{...n,width:g}}function sm(e,t,n,r,i,o,s,a,l){const u=f.useRef(t),c=f.useRef(n),d=f.useRef(s);u.current=t,c.current=n,d.current=s;const[g,h]=f.useMemo(()=>{if(typeof window>"u")return[null,null];const b=document.createElement("canvas");return b.style.display="none",b.style.opacity="0",b.style.position="fixed",[b,b.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g?.remove()}),[g]);const p=f.useRef({}),m=f.useRef(),[y,v]=f.useState();return f.useLayoutEffect(()=>{const b=c.current;if(b===void 0||e.every(Ao))return;let x=Math.max(1,10-Math.floor(e.length/1e4)),T=0;x<u.current&&x>1&&(x--,T=1);const k={x:0,y:0,width:e.length,height:Math.min(u.current,x)},R={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const I=b(k,l.signal),C=T>0?b(R,l.signal):void 0;let F;typeof I=="object"?F=I:F=await zs(I),C!==void 0&&(typeof C=="object"?F=[...F,...C]:F=[...F,...await zs(C)]),m.current=e,v(F)})()},[l.signal,e]),f.useMemo(()=>{let x=e.every(Ao)?e:h===null?e.map(P=>Ao(P)?P:{...P,width:kl}):(h.font=d.current.baseFontFull,e.map((P,I)=>{if(Ao(P))return P;if(p.current[P.id]!==void 0)return{...P,width:p.current[P.id]};if(y===void 0||m.current!==e||P.id===void 0)return{...P,width:kl};const C=ld(h,s,P,I,y,i,o,!0,a);return p.current[P.id]=C.width,C})),T=0,k=0;const R=[];for(const[P,I]of x.entries())T+=I.width,I.grow!==void 0&&I.grow>0&&(k+=I.grow,R.push(P));if(T<r&&R.length>0){const P=[...x],I=r-T;let C=I;for(let F=0;F<R.length;F++){const D=R[F],S=(x[D].grow??0)/k,E=F===R.length-1?C:Math.min(C,Math.floor(I*S));P[D]={...x[D],growOffset:E,width:x[D].width+E},C-=E}x=P}return{sizedColumns:x,nonGrowWidth:T}},[r,e,h,y,s,i,o,a])}const Vt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',um=e=>{const t=e.fgColor,n=e.bgColor;return`
51
51
  ${Vt}<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/><path d="M15.75 4h-1.5a.25.25 0 0 0-.177.074L9.308 8.838a3.75 3.75 0 1 0 1.854 1.854l1.155-1.157.967.322a.5.5 0 0 0 .65-.55l-.18-1.208.363-.363.727.331a.5.5 0 0 0 .69-.59l-.254-.904.647-.647A.25.25 0 0 0 16 5.75v-1.5a.25.25 0 0 0-.25-.25zM7.5 13.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" fill="${t}"/></svg>`},cm=e=>{const t=e.fgColor,n=e.bgColor;return`
52
52
  ${Vt}<rect x="2" y="2" width="16" height="16" rx="4" fill="${n}"/><path d="m12.223 13.314 3.052-2.826a.65.65 0 0 0 0-.984l-3.052-2.822c-.27-.25-.634-.242-.865.022-.232.263-.206.636.056.882l2.601 2.41-2.601 2.41c-.262.245-.288.619-.056.882.231.263.595.277.865.026Zm-4.444.005c.266.25.634.241.866-.027.231-.263.206-.636-.06-.882L5.983 10l2.602-2.405c.266-.25.291-.62.06-.887-.232-.263-.596-.272-.866-.022L4.723 9.51a.653.653 0 0 0 0 .983l3.056 2.827Z" fill="${t}"/></svg>`},dm=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
53
53
  <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
@@ -162,27 +162,27 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
162
162
  <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
163
163
  <path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
164
164
  </svg>
165
- `},Hm={headerRowID:um,headerNumber:dm,headerCode:cm,headerString:fm,headerBoolean:hm,headerAudioUri:pm,headerVideoUri:mm,headerEmoji:vm,headerImage:bm,headerUri:sd,headerPhone:wm,headerMarkdown:ym,headerDate:Cm,headerTime:Sm,headerEmail:xm,headerReference:km,headerIfThenElse:Mm,headerSingleValue:Rm,headerLookup:Im,headerTextTemplate:Em,headerMath:Tm,headerRollup:Dm,headerJoinStrings:Om,headerSplitString:Pm,headerGeoDistance:Lm,headerArray:Fm,rowOwnerOverlay:_m,protectedColumnOverlay:Am,renameIcon:gm};function zm(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Vm{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(t,n){this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,i,o,s,a,l=1){const[u,c]=zm(n,a),d=s*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(g);if(h===void 0){const p=this.headerIcons[t];if(p===void 0)return;h=document.createElement("canvas");const m=h.getContext("2d");if(m===null)return;const y=new Image;y.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,h);const v=y.decode();if(v===void 0)return;this.inFlight++,v.then(()=>{m.drawImage(y,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else l<1&&(r.globalAlpha=l),r.drawImage(h,0,0,d,d,i,o,s,s),l<1&&(r.globalAlpha=1)}}function ud(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y);return t}function Ca(e,t,n,r,i,o,s,a,l){a=a??t;let u=t,c=e;const d=r-o;let g=!1;for(;u<n&&c<d;){const h=i(c);if(u+h>a&&l(u,c,h,!1,s&&c===r-1)===!0){g=!0;break}u+=h,c++}if(!g){u=n;for(let h=0;h<o;h++){c=r-1-h;const p=i(c);u-=p,l(u,c,p,!0,s&&c===r-1)}}}function Er(e,t,n,r,i,o){let s=0,a=0;const l=i+r;for(const u of e){const c=u.sticky?a:s+n;if(o(u,c,l,u.sticky?0:a,t)===!0)break;s+=u.width,a+=u.sticky?u.width:0}}function cd(e,t,n,r,i){let o=0,s=0;for(let a=0;a<e.length;a++){const l=e[a];let u=a+1,c=l.width;for(l.sticky&&(s+=c);u<e.length&&uo(e[u].group,l.group)&&e[u].sticky===e[a].sticky;){const m=e[u];c+=m.width,u++,a++,m.sticky&&(s+=m.width)}const d=l.sticky?0:n,g=o+d,h=l.sticky?0:Math.max(0,s-g),p=Math.min(c-h,t-(g+h));i([l.sourceIndex,e[u-1].sourceIndex],l.group??"",g+h,0,p,r),o+=c}}function dd(e,t,n,r,i,o,s){const[a,l]=e;let u,c;const d=s.find(g=>!g.sticky)?.sourceIndex??0;if(l>d){const g=Math.max(a,d);let h=t,p=r;for(let m=o.sourceIndex-1;m>=g;m--)h-=s[m].width,p+=s[m].width;for(let m=o.sourceIndex+1;m<=l;m++)p+=s[m].width;c={x:h,y:n,width:p,height:i}}if(d>a){const g=Math.min(l,d-1);let h=t,p=r;for(let m=o.sourceIndex-1;m>=a;m--)h-=s[m].width,p+=s[m].width;for(let m=o.sourceIndex+1;m<=g;m++)p+=s[m].width;u={x:h,y:n,width:p,height:i}}return[u,c]}function $m(e,t,n,r){if(r==="any")return fd(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),qc([t,n],e))return;const i=t-e.x,o=e.x+e.width-t,s=n-e.y+1,a=e.y+e.height-n,l=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="horizontal"?Number.MAX_SAFE_INTEGER:s,r==="horizontal"?Number.MAX_SAFE_INTEGER:a);return l===a?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:l===s?{x:e.x,y:n,width:e.width,height:e.y-n}:l===o?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function co(e,t,n,r,i,o,s,a){return e<=i+s&&i<=e+n&&t<=o+a&&o<=t+r}function Br(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function fd(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:i,height:o}}function Nm(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Bm(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const i=-4,o=-4,s=t+4,a=n+4,l=i-e.x,u=e.x+e.width-s,c=o-e.y,d=e.y+e.height-a,g=l>0?e.x+Math.floor(l/r)*r:e.x,h=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,p=c>0?e.y+Math.floor(c/r)*r:e.y,m=d>0?e.y+e.height-Math.floor(d/r)*r:e.y+e.height;return{x:g,y:p,width:h-g,height:m-p}}function Wm(e,t,n,r,i){const[o,s,a,l]=t,[u,c,d,g]=i,{x:h,y:p,width:m,height:y}=e,v=[];if(m<=0||y<=0)return v;const b=h+m,x=p+y,T=h<o,k=p<s,R=h+m>a,P=p+y>l,I=h>=o&&h<a||b>o&&b<=a||h<o&&b>a,C=p>=s&&p<l||x>s&&x<=l||p<s&&x>l;if(I&&C){const D=Math.max(h,o),S=Math.max(p,s),E=Math.min(b,a),O=Math.min(x,l);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:u,y:c,width:d-u+1,height:g-c+1}})}if(T&&k){const D=h,S=p,E=Math.min(b,o),O=Math.min(x,s);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:0,y:0,width:u+1,height:c+1}})}if(k&&I){const D=Math.max(h,o),S=p,E=Math.min(b,a),O=Math.min(x,s);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(k&&R){const D=Math.max(h,a),S=p,E=b,O=Math.min(x,s);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(T&&C){const D=h,S=Math.max(p,s),E=Math.min(b,o),O=Math.min(x,l);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(R&&C){const D=Math.max(h,a),S=Math.max(p,s),E=b,O=Math.min(x,l);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:d,y:c,width:n-d+1,height:g-c+1}})}if(T&&P){const D=h,S=Math.max(p,l),E=Math.min(b,o),O=x;v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(P&&I){const D=Math.max(h,o),S=Math.max(p,l),E=Math.min(b,a),O=x;v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:u,y:g,width:d-u+1,height:r-g+1}})}if(R&&P){const D=Math.max(h,a),S=Math.max(p,l),E=b,O=x;v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:d,y:g,width:n-d+1,height:r-g+1}})}return v}const Um={kind:Z.Loading,allowOverlay:!1};function gu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v,b,x,T,k,R,P,I,C,F,D,S,E,O,M,V,W,j){let oe=x?.size??Number.MAX_SAFE_INTEGER;const Q=performance.now();let re=E.baseFontFull;e.font=re;const se={ctx:e},ae=[0,0],de=y>0?Yr(l,y,u):0;let fe,ue;const H=ud(b);return Er(t,a,o,s,i,(L,Y,te,le,Se)=>{const pe=Math.max(0,le-Y),et=Y+pe,ke=i+1,Dt=L.width-pe,dt=r-i-1;if(b.length>0){let _e=!1;for(let Oe=0;Oe<b.length;Oe++){const at=b[Oe];if(co(et,ke,Dt,dt,at.x,at.y,at.width,at.height)){_e=!0;break}}if(!_e)return}const Ue=()=>{e.save(),e.beginPath(),e.rect(et,ke,Dt,dt),e.clip()},ne=T.columns.hasIndex(L.sourceIndex),ve=d(L.group??"").overrideTheme,me=L.themeOverride===void 0&&ve===void 0?E:cr(E,ve,L.themeOverride),he=me.baseFontFull;he!==re&&(re=he,e.font=he),Ue();let Ce;return Ca(Se,te,r,l,u,y,v,H,(_e,Oe,at,Pe,we)=>{if(Oe<0||(ae[0]=L.sourceIndex,ae[1]=Oe,x!==void 0&&!x.has(ae)))return;if(b.length>0){let De=!1;for(let mt=0;mt<b.length;mt++){const xt=b[mt];if(co(Y,_e,L.width,at,xt.x,xt.y,xt.width,xt.height)){De=!0;break}}if(!De)return}const Ae=T.rows.hasIndex(Oe),Re=h.hasIndex(Oe),Ne=Oe<l?c(ae):Um;let ft=Y,ht=L.width,Ye=!1,pt=!1;if(Ne.span!==void 0){const[De,mt]=Ne.span,xt=`${Oe},${De},${mt},${L.sticky}`;if(ue===void 0&&(ue=new Set),ue.has(xt)){oe--;return}else{const vn=dd(Ne.span,Y,_e,L.width,at,L,n),tn=L.sticky?vn[0]:vn[1];if(!L.sticky&&vn[0]!==void 0&&(pt=!0),tn!==void 0){ft=tn.x,ht=tn.width,ue.add(xt),e.restore(),Ce=void 0,e.save(),e.beginPath();const nn=Math.max(0,le-tn.x);e.rect(tn.x+nn,_e,tn.width-nn,at),fe===void 0&&(fe=[]),fe.push({x:tn.x+nn,y:_e,width:tn.width-nn,height:at}),e.clip(),Ye=!0}}}const Nt=g?.(Oe),St=we&&L.trailingRowOptions?.themeOverride!==void 0?L.trailingRowOptions?.themeOverride:void 0,Tt=Ne.themeOverride===void 0&&Nt===void 0&&St===void 0?me:cr(me,Nt,St,Ne.themeOverride);e.beginPath();const Bt=Yp(ae,Ne,T);let qt=jp(ae,Ne,T,m);const an=Ne.span!==void 0&&T.columns.some(De=>Ne.span!==void 0&&De>=Ne.span[0]&&De<=Ne.span[1]);Bt&&!p&&m?qt=0:Bt&&m&&(qt=Math.max(qt,1)),an&&qt++,Bt||(Ae&&qt++,ne&&!we&&qt++);const It=Ne.kind===Z.Protected?Tt.bgCellMedium:Tt.bgCell;let gt;if((Pe||It!==E.bgCell)&&(gt=Ln(It,gt)),qt>0||Re){Re&&(gt=Ln(Tt.bgHeader,gt));for(let De=0;De<qt;De++)gt=Ln(Tt.accentLight,gt)}else if(k!==void 0){for(const De of k)if(De[0]===L.sourceIndex&&De[1]===Oe){gt=Ln(Tt.bgSearchResult,gt);break}}if(R!==void 0)for(let De=0;De<R.length;De++){const mt=R[De],xt=mt.range;mt.style!=="solid-outline"&&xt.x<=L.sourceIndex&&L.sourceIndex<xt.x+xt.width&&xt.y<=Oe&&Oe<xt.y+xt.height&&(gt=Ln(mt.color,gt))}let Wt=!1;if(x!==void 0){const De=_e+1,xt=(Pe?De+at-1:Math.min(De+at-1,r-de))-De;(xt!==at-1||ft+1<=le)&&(Wt=!0,e.save(),e.beginPath(),e.rect(ft+1,De,ht-1,xt),e.clip()),gt=gt===void 0?Tt.bgCell:Ln(gt,Tt.bgCell)}const wt=L.sourceIndex===n.length-1,ln=Oe===l-1;gt!==void 0&&(e.fillStyle=gt,Ce!==void 0&&(Ce.fillStyle=gt),x!==void 0?e.fillRect(ft+1,_e+1,ht-(wt?2:1),at-(ln?2:1)):e.fillRect(ft,_e,ht,at)),Ne.style==="faded"&&(e.globalAlpha=.6);let Mn;for(let De=0;De<C.length;De++){const mt=C[De];if(mt.item[0]===L.sourceIndex&&mt.item[1]===Oe){Mn=mt;break}}if(ht>j&&!pt){const De=Tt.baseFontFull;De!==re&&(e.font=De,re=De),Ce=hd(e,Ne,L.sourceIndex,Oe,wt,ln,ft,_e,ht,at,qt>0,Tt,gt??Tt.bgCell,P,I,Mn?.hoverAmount??0,F,S,Q,D,Ce,O,M,V,W)}return Wt&&e.restore(),Ne.style==="faded"&&(e.globalAlpha=1),oe--,Ye&&(e.restore(),Ce?.deprep?.(se),Ce=void 0,Ue(),re=he,e.font=he),oe<=0}),e.restore(),oe<=0}),fe}const Ki=[0,0],Zi={x:0,y:0,width:0,height:0},el=[void 0,()=>{}];let Ml=!1;function Gm(){Ml=!0}function hd(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v,b,x,T,k,R,P,I){let C,F;y!==void 0&&y[0][0]===n&&y[0][1]===r&&(C=y[1][0],F=y[1][1]);let D;Ki[0]=n,Ki[1]=r,Zi.x=s,Zi.y=a,Zi.width=l,Zi.height=u,el[0]=R.getValue(Ki),el[1]=M=>R.setValue(Ki,M),Ml=!1;const S={ctx:e,theme:d,col:n,row:r,cell:t,rect:Zi,highlighted:c,cellFillColor:g,hoverAmount:m,frameTime:b,hoverX:C,drawState:el,hoverY:F,imageLoader:h,spriteManager:p,hyperWrapping:v,overrideCursor:C!==void 0?I:void 0,requestAnimationFrame:Gm},E=em(S,t.lastUpdated,b,T,i,o),O=P(t);if(O!==void 0){T?.renderer!==O&&(T?.deprep?.(S),T=void 0);const M=O.drawPrep?.(S,T);x!==void 0&&!Si(S.cell)?x(S,()=>O.draw(S,t)):O.draw(S,t),D=M===void 0?void 0:{deprep:M?.deprep,fillStyle:M?.fillStyle,font:M?.font,renderer:O}}return(E||Ml)&&k?.(Ki),D}function Yl(e,t,n,r,i,o,s,a,l=-20,u=-20,c=void 0,d="center",g="square"){const h=Math.floor(i+s/2),p=g==="circle"?1e4:t.roundingRadius??4;let m=Vc(c??t.checkboxMaxSize,s,t.cellVerticalPadding),y=m/2;const v=zc(d,r,o,t.cellHorizontalPadding,m),b=Hc(v,h,m),x=$c(r+l,i+u,b);switch(n){case!0:{e.beginPath(),jn(e,v-m/2,h-m/2,m,m,p),g==="circle"&&(y*=.8,m*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(v-y+m/4.23,h-y+m/1.97),e.lineTo(v-y+m/2.42,h-y+m/1.44),e.lineTo(v-y+m/1.29,h-y+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ia:case!1:{e.beginPath(),jn(e,v-m/2+.5,h-m/2+.5,m-1,m-1,p),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break}case _l:{e.beginPath(),jn(e,v-m/2,h-m/2,m,m,p),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),g==="circle"&&(y*=.8,m*=.8),e.beginPath(),e.moveTo(v-m/3,h),e.lineTo(v+m/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:lo()}}function Xm(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v,b){const x=s+a;if(x<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,x);const T=r?.[0]?.[0],k=r?.[0]?.[1],R=r?.[1]?.[0],P=r?.[1]?.[1],I=d.headerFontFull;e.font=I,Er(t,0,o,0,x,(C,F,D,S)=>{if(y!==void 0&&!y.has([C.sourceIndex,-1]))return;const E=Math.max(0,S-F);e.save(),e.beginPath(),e.rect(F+E,a,C.width-E,s),e.clip();const O=m(C.group??"").overrideTheme,M=C.themeOverride===void 0&&O===void 0?d:cr(d,O,C.themeOverride);M.bgHeader!==d.bgHeader&&(e.fillStyle=M.bgHeader,e.fill()),M!==d&&(e.font=M.headerFontFull);const V=c.columns.hasIndex(C.sourceIndex),W=l!==void 0||u||C.headerRowMarkerDisabled===!0,j=!W&&k===-1&&T===C.sourceIndex,oe=W?0:h.find(de=>de.item[0]===C.sourceIndex&&de.item[1]===-1)?.hoverAmount??0,Q=c?.current!==void 0&&c.current.cell[0]===C.sourceIndex,re=V?M.accentColor:Q?M.bgHeaderHasFocus:M.bgHeader,se=n?a:0,ae=C.sourceIndex===0?0:1;V?(e.fillStyle=re,e.fillRect(F+ae,se,C.width-ae,s)):(Q||oe>0)&&(e.beginPath(),e.rect(F+ae,se,C.width-ae,s),Q&&(e.fillStyle=M.bgHeaderHasFocus,e.fill()),oe>0&&(e.globalAlpha=oe,e.fillStyle=M.bgHeaderHovered,e.fill(),e.globalAlpha=1)),md(e,F,se,C.width,s,C,V,M,j,j?R:void 0,j?P:void 0,Q,oe,g,v,b),e.restore()}),n&&Ym(e,t,i,o,a,r,d,g,h,p,m,y)}function Ym(e,t,n,r,i,o,s,a,l,u,c,d){const[h,p]=o?.[0]??[];let m=0;cd(t,n,r,i,(y,v,b,x,T,k)=>{if(d!==void 0&&!d.hasItemInRectangle({x:y[0],y:-2,width:y[1]-y[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(b,x,T,k),e.clip();const R=c(v),P=R?.overrideTheme===void 0?s:cr(s,R.overrideTheme),I=p===-2&&h!==void 0&&h>=y[0]&&h<=y[1],C=I?P.bgGroupHeaderHovered??P.bgHeaderHovered:P.bgGroupHeader??P.bgHeader;if(C!==s.bgHeader&&(e.fillStyle=C,e.fill()),e.fillStyle=P.textGroupHeader??P.textHeader,R!==void 0){let F=b;if(R.icon!==void 0&&(a.drawSprite(R.icon,"normal",e,F+8,(i-20)/2,20,P),F+=26),e.fillText(R.name,F+8,i/2+qn(e,s.headerFontFull)),R.actions!==void 0&&I){const D=gd({x:b,y:x,width:T,height:k},R.actions);e.beginPath();const S=D[0].x-10,E=b+T-S;e.rect(S,0,E,i);const O=e.createLinearGradient(S,0,S+E,0),M=Wr(C,0);O.addColorStop(0,M),O.addColorStop(10/E,C),O.addColorStop(1,C),e.fillStyle=O,e.fill(),e.globalAlpha=.6;const[V,W]=o?.[1]??[-1,-1];for(let j=0;j<R.actions.length;j++){const oe=R.actions[j],Q=D[j],re=Br(Q,V+b,W);re&&(e.globalAlpha=1),a.drawSprite(oe.icon,"normal",e,Q.x+Q.width/2-10,Q.y+Q.height/2-10,20,P),re&&(e.globalAlpha=.6)}e.globalAlpha=1}}b!==0&&u(y[0])&&(e.beginPath(),e.moveTo(b+.5,0),e.lineTo(b+.5,i),e.strokeStyle=s.borderColor,e.lineWidth=1,e.stroke()),e.restore(),m=b+T}),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=s.borderColor,e.lineWidth=1,e.stroke()}const No=30;function jm(e,t,n,r,i){return{x:e+n-No,y:Math.max(t,t+r/2-No/2),width:No,height:Math.min(No,r)}}function gd(e,t){const n=[];let r=e.x+e.width-26*t.length;const i=e.y+e.height/2-13,o=26,s=26;for(let a=0;a<t.length;a++)n.push({x:r,y:i,width:s,height:o}),r+=26;return n}function Ji(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function pd(e,t,n,r,i,o,s,a){const l=s.cellHorizontalPadding,u=s.headerIconSize,c=jm(n,r,i,o);let d=n+l;const g=t.icon===void 0?void 0:{x:d,y:r+(o-u)/2,width:u,height:u},h=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(d+=Math.ceil(u*1.3));const p={x:d,y:r,width:i-d,height:o};let m;if(t.indicatorIcon!==void 0){const v=e===void 0?Qc(t.title,s.headerFontFull)?.width??0:Ir(t.title,e,s.headerFontFull).width;p.width=v,d+=v+l,m={x:d,y:r+(o-u)/2,width:u,height:u}}const y=n+i/2;return{menuBounds:Ji(c,y,a),iconBounds:Ji(g,y,a),iconOverlayBounds:Ji(h,y,a),textBounds:Ji(p,y,a),indicatorIconBounds:Ji(m,y,a)}}function pu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const b=o.rowMarkerChecked;b!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const x=o.headerRowMarkerTheme!==void 0?cr(a,o.headerRowMarkerTheme):a;Yl(e,x,b,t,n,r,i,!1,void 0,void 0,a.checkboxMaxSize,"center",o.rowMarker),b!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const y=s?a.textHeaderSelected:a.textHeader,v=o.hasMenu===!0&&(l||h&&s)&&m.menuBounds!==void 0;if(o.icon!==void 0&&m.iconBounds!==void 0){let b=s?"selected":"normal";o.style==="highlight"&&(b=s?"selected":"special"),g.drawSprite(o.icon,b,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,a),o.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&g.drawSprite(o.overlayIcon,s?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,a)}if(v&&r>35){const x=p?35:r-35,T=p?35*.7:r-35*.7,k=x/r,R=T/r,P=e.createLinearGradient(t,0,t+r,0),I=Wr(y,0);P.addColorStop(p?1:0,y),P.addColorStop(k,y),P.addColorStop(R,I),P.addColorStop(p?0:1,I),e.fillStyle=P}else e.fillStyle=y;if(p&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(o.title,p?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+i/2+qn(e,a.headerFontFull)),p&&(e.textAlign="left"),o.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!v||!co(m.menuBounds.x,m.menuBounds.y,m.menuBounds.width,m.menuBounds.height,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,m.indicatorIconBounds.height))){let b=s?"selected":"normal";o.style==="highlight"&&(b=s?"selected":"special"),g.drawSprite(o.indicatorIcon,b,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,a)}if(v&&m.menuBounds!==void 0){const b=m.menuBounds,x=u!==void 0&&c!==void 0&&Br(b,u+t,c+n);if(x||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===oa.Triangle){e.beginPath();const T=b.x+b.width/2-5.5,k=b.y+b.height/2-3;im(e,[{x:T,y:k},{x:T+11,y:k},{x:T+5.5,y:k+6}],1),e.fillStyle=y,e.fill()}else if(o.menuIcon===oa.Dots){e.beginPath();const T=b.x+b.width/2,k=b.y+b.height/2;rm(e,T,k),e.fillStyle=y,e.fill()}else{const T=b.x+(b.width-a.headerIconSize)/2,k=b.y+(b.height-a.headerIconSize)/2;g.drawSprite(o.menuIcon,"normal",e,T,k,a.headerIconSize,a)}x||(e.globalAlpha=1)}}function md(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m){const y=Vl(o.title)==="rtl",v=pd(e,o,t,n,r,i,a,y);p!==void 0?p({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:i},column:o,columnIndex:o.sourceIndex,isSelected:s,hoverAmount:g,isHovered:l,hasSelectedCell:d,spriteManager:h,menuBounds:v?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>pu(e,t,n,r,i,o,s,a,l,u,c,g,h,m,y,v)):pu(e,t,n,r,i,o,s,a,l,u,c,g,h,m,y,v)}function qm(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v,b){if(v!==void 0||t[t.length-1]!==n[t.length-1])return;const x=ud(y);Er(t,l,s,a,o,(T,k,R,P,I)=>{if(T!==t[t.length-1])return;k+=T.width;const C=Math.max(k,P);C>r||(e.save(),e.beginPath(),e.rect(C,o+1,1e4,i-o-1),e.clip(),Ca(I,R,i,u,c,p,m,x,(F,D,S,E)=>{if(!E&&y.length>0&&!y.some(j=>co(k,F,1e4,S,j.x,j.y,j.width,j.height)))return;const O=g.hasIndex(D),M=h.hasIndex(D);e.beginPath();const V=d?.(D),W=V===void 0?b:cr(b,V);W.bgCell!==b.bgCell&&(e.fillStyle=W.bgCell,e.fillRect(k,F,1e4,S)),M&&(e.fillStyle=W.bgHeader,e.fillRect(k,F,1e4,S)),O&&(e.fillStyle=W.accentLight,e.fillRect(k,F,1e4,S))}),e.restore())})}function Km(e,t,n,r,i,o,s,a,l){let u=!1;for(const p of t)if(!p.sticky){u=s(p.sourceIndex);break}const c=l.horizontalBorderColor??l.borderColor,d=l.borderColor,g=u?Ei(t):0;let h;if(g!==0&&(h=cu(d,l.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=h,e.stroke()),i>0){const p=d===c&&h!==void 0?h:cu(c,l.bgCell),m=Yr(o,i,a);e.beginPath(),e.moveTo(0,r-m+.5),e.lineTo(n,r-m+.5),e.strokeStyle=p,e.stroke()}}const vd=(e,t,n)=>{let r=0,i=t,o=0,s=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),i=Math.max(i,a.x+a.width+1),o=Math.min(o,a.y-1),s=Math.max(s,a.y+a.height+1)}return{minX:r,maxX:i,minY:o,maxY:s}};function Zm(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p){const m=p.bgCell,{minX:y,maxX:v,minY:b,maxY:x}=vd(a,o,s),T=[],k=s-Yr(h,g,u);let R=l,P=n,I=0;for(;R+i<k;){const S=R+i,E=u(P);if(S>=b&&S<=x-1){const M=c?.(P)?.bgCell;M!==void 0&&M!==m&&P>=h-g&&T.push({x:y,y:S,w:v-y,h:E,color:M})}R+=E,P<h-g&&(I=R),P++}let C=0;const F=Math.min(k,x)-I;if(F>0)for(let S=0;S<t.length;S++){const E=t[S];if(E.width===0)continue;const O=E.sticky?C:C+r,M=E.themeOverride?.bgCell;M!==void 0&&M!==m&&O>=y&&O<=v&&d(S+1)&&T.push({x:O,y:I,w:E.width,h:F,color:M}),C+=E.width}if(T.length===0)return;let D;e.beginPath();for(let S=T.length-1;S>=0;S--){const E=T[S];D===void 0?D=E.color:E.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=E.color),e.rect(E.x,E.y,E.w,E.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function mu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v=!1){if(l!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,s);for(const S of l)e.rect(S.x+1,S.y+1,S.width-1,S.height-1);e.clip("evenodd")}const b=y.horizontalBorderColor??y.borderColor,x=y.borderColor,{minX:T,maxX:k,minY:R,maxY:P}=vd(a,o,s),I=[];e.beginPath();let C=.5;for(let S=0;S<t.length;S++){const E=t[S];if(E.width===0)continue;C+=E.width;const O=E.sticky?C:C+r;O>=T&&O<=k&&h(S+1)&&I.push({x1:O,y1:Math.max(u,R),x2:O,y2:Math.min(s,P),color:x})}let F=s+.5;for(let S=m-p;S<m;S++){const E=d(S);F-=E,I.push({x1:T,y1:F,x2:k,y2:F,color:b})}if(v!==!0){let S=c+.5,E=n;const O=F;for(;S+i<O;){const M=S+i;if(M>=R&&M<=P-1){const V=g?.(E);I.push({x1:T,y1:M,x2:k,y2:M,color:V?.horizontalBorderColor??V?.borderColor??b})}S+=d(E),E++}}const D=wh(I,S=>S.color);for(const S of Object.keys(D)){e.strokeStyle=S;for(const E of D[S])e.moveTo(E.x1,E.y1),e.lineTo(E.x2,E.y2);e.stroke(),e.beginPath()}l!==void 0&&e.restore()}function Jm(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v,b){const x=[];e.imageSmoothingEnabled=!1;const T=Math.min(i.cellYOffset,s),k=Math.max(i.cellYOffset,s);let R=0;if(typeof v=="number")R+=(k-T)*v;else for(let O=T;O<k;O++)R+=v(O);s>i.cellYOffset&&(R=-R),R+=l-i.translateY;const P=Math.min(i.cellXOffset,o),I=Math.max(i.cellXOffset,o);let C=0;for(let O=P;O<I;O++)C+=m[O].width;o>i.cellXOffset&&(C=-C),C+=a-i.translateX;const F=Ei(y);if(C!==0&&R!==0)return{regions:[]};const D=u>0?Yr(g,u,v):0,S=c-F-Math.abs(C),E=d-h-D-Math.abs(R)-1;if(S>150&&E>150){const O={sx:0,sy:0,sw:c*p,sh:d*p,dx:0,dy:0,dw:c*p,dh:d*p};if(R>0?(O.sy=(h+1)*p,O.sh=E*p,O.dy=(R+h+1)*p,O.dh=E*p,x.push({x:0,y:h,width:c,height:R+1})):R<0&&(O.sy=(-R+h+1)*p,O.sh=E*p,O.dy=(h+1)*p,O.dh=E*p,x.push({x:0,y:d+R-D,width:c,height:-R+D})),C>0?(O.sx=F*p,O.sw=S*p,O.dx=(C+F)*p,O.dw=S*p,x.push({x:F-1,y:0,width:C+2,height:d})):C<0&&(O.sx=(F-C)*p,O.sw=S*p,O.dx=F*p,O.dw=S*p,x.push({x:c+C,y:0,width:-C,height:d})),e.setTransform(1,0,0,1,0,0),b){if(F>0&&C!==0&&R===0&&(r===void 0||n?.[1]!==!1)){const M=F*p,V=d*p;e.drawImage(t,0,0,M,V,0,0,M,V)}if(D>0&&C===0&&R!==0&&(r===void 0||n?.[0]!==!1)){const M=(d-D)*p,V=c*p,W=D*p;e.drawImage(t,0,M,V,W,0,M,V,W)}}e.drawImage(t,O.sx,O.sy,O.sw,O.sh,O.dx,O.dy,O.dw,O.dh),e.scale(p,p)}return e.imageSmoothingEnabled=!0,{regions:x}}function Qm(e,t,n,r,i,o,s,a,l,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Er(l,n,r,i,a,(d,g,h,p)=>{if(d.sourceIndex===u){const m=Math.max(g,p)+1;return c.push({x:m,y:0,width:o-m,height:s}),!0}}),c}function e0(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;r<e.mappedColumns.length;r++){const i=e.mappedColumns[r],o=t.mappedColumns[r];if(Ii(i,o))continue;if(n!==void 0||i.width===o.width)return!1;const{width:s,...a}=i,{width:l,...u}=o;if(!Ii(a,u))return!1;n=r}return n===void 0?!0:n}return!0}function vu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m){const y=p?.filter(P=>P.style!=="no-outline");if(y===void 0||y.length===0)return;const v=Ei(a),b=Yr(h,g,d),x=[l,0,a.length,h-g],T=[v,0,t,n-b],k=y.map(P=>{const I=P.range,C=P.style??"dashed";return Wm(I,x,t,n,T).map(F=>{const D=F.rect,S=xl(D.x,D.y,t,n,c,u+c,r,i,o,s,h,l,g,a,d),E=D.width===1&&D.height===1?S:xl(D.x+D.width-1,D.y+D.height-1,t,n,c,u+c,r,i,o,s,h,l,g,a,d);return D.x+D.width>=a.length&&(E.width-=1),D.y+D.height>=h&&(E.height-=1),{color:P.color,style:C,clip:F.clip,rect:Bm({x:S.x,y:S.y,width:E.x+E.width-S.x,height:E.y+E.height-S.y},t,n,8)}})}),R=()=>{e.lineWidth=1;let P=!1;for(const I of k)for(const C of I)if(C?.rect!==void 0&&co(0,0,t,n,C.rect.x,C.rect.y,C.rect.width,C.rect.height)){const F=P,D=!Nm(C.clip,C.rect);e.beginPath(),D&&(e.save(),e.rect(C.clip.x,C.clip.y,C.clip.width,C.clip.height),e.clip()),C.style==="dashed"&&!P?(e.setLineDash([5,3]),P=!0):(C.style==="solid"||C.style==="solid-outline")&&P&&(e.setLineDash([]),P=!1),e.strokeStyle=C.style==="solid-outline"?Ln(Ln(C.color,m.borderColor),m.bgCell):Wr(C.color,1),e.closePath(),e.strokeRect(C.rect.x+.5,C.rect.y+.5,C.rect.width-1,C.rect.height-1),D&&(e.restore(),P=F)}P&&e.setLineDash([])};return R(),R}function bu(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function tl(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y){if(c.current===void 0)return;const v=m!==!1&&m!==void 0;if(!v)return;const b=typeof m=="object"?{...aa,...m}:aa,x=c.current.range,T=c.current.cell,k=[x.x+x.width-1,x.y+x.height-1];if(T[1]>=y&&k[1]>=y||!s.some(V=>V.sourceIndex===T[0]||V.sourceIndex===k[0]))return;const[P,I]=c.current.cell,C=g(c.current.cell),F=C.span??[P,P],D=I>=y-h,S=h>0&&!D?Yr(y,h,d)-1:0,E=k[1];let O;if(Er(s,r,i,o,u,(V,W,j,oe,Q)=>{if(V.sticky&&P>V.sourceIndex)return;const re=V.sourceIndex<F[0],se=V.sourceIndex>F[1],ae=V.sourceIndex===k[0];if(!(!ae&&(re||se)))return Ca(Q,j,n,y,d,h,p,void 0,(de,fe,ue)=>{if(fe!==I&&fe!==E)return;let H=W,L=V.width;if(C.span!==void 0){const te=dd(C.span,W,de,V.width,ue,V,a),le=V.sticky?te[0]:te[1];le!==void 0&&(H=le.x,L=le.width)}return fe===E&&ae&&v&&(O=()=>{oe>H&&!V.sticky&&(e.beginPath(),e.rect(oe,0,t-oe,n),e.clip());const te=b.size,le=te/2,Se=H+L+b.offsetX-le+.5,pe=de+ue+b.offsetY-le+.5;e.beginPath(),b.shape==="circle"?e.arc(Se+le,pe+le,le,0,Math.PI*2):e.rect(Se,pe,te,te),e.fillStyle=V.themeOverride?.accentColor??l.accentColor,e.fill(),b.outline>0&&(e.lineWidth=b.outline,e.strokeStyle=l.bgCell,b.shape==="circle"?(e.beginPath(),e.arc(Se+le,pe+le,le+b.outline/2,0,Math.PI*2),e.stroke()):e.strokeRect(Se-b.outline/2,pe-b.outline/2,te+b.outline,te+b.outline))}),O!==void 0}),O!==void 0}),O===void 0)return;const M=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-S),e.clip(),O?.(),e.restore()};return M(),M}function t0(e,t,n,r,i,o,s,a,l){l===void 0||l.size===0||(e.beginPath(),cd(t,n,o,r,(u,c,d,g,h,p)=>{l.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,g,h,p)}),Er(t,a,o,s,i,(u,c,d,g)=>{const h=Math.max(0,g-c),p=c+h+1,m=u.width-h-1;l.has([u.sourceIndex,-1])&&e.rect(p,r,m,i-r)}),e.clip())}function n0(e,t,n,r,i,o,s,a,l,u){let c=0;return Er(e,o,r,i,n,(d,g,h,p,m)=>(Ca(m,h,t,s,a,l,u,void 0,(y,v,b,x)=>{x||(c=Math.max(v,c))}),!0)),c}function wu(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:i,height:o,cellXOffset:s,cellYOffset:a,translateX:l,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:g,dragAndDropState:h,theme:p,drawFocus:m,headerHeight:y,groupHeaderHeight:v,disabledRows:b,rowHeight:x,verticalBorder:T,overrideCursor:k,isResizing:R,selection:P,fillHandle:I,freezeTrailingRows:C,rows:F,getCellContent:D,getGroupDetails:S,getRowThemeOverride:E,isFocused:O,drawHeaderCallback:M,prelightCells:V,drawCellCallback:W,highlightRegions:j,resizeCol:oe,imageLoader:Q,lastBlitData:re,hoverValues:se,hyperWrapping:ae,hoverInfo:de,spriteManager:fe,maxScaleFactor:ue,hasAppendRow:H,touchMode:L,enqueue:Y,renderStateProvider:te,getCellRenderer:le,renderStrategy:Se,bufferACtx:pe,bufferBCtx:et,damage:ke,minimumCellWidth:Dt,resizeIndicator:dt}=e;if(i===0||o===0)return;const Ue=Se==="double-buffer",ne=Math.min(ue,Math.ceil(window.devicePixelRatio??1)),ve=Se!=="direct"&&e0(e,t),me=n.canvas;(me.width!==i*ne||me.height!==o*ne)&&(me.width=i*ne,me.height=o*ne,me.style.width=i+"px",me.style.height=o+"px");const he=r.canvas,Ce=d?v+y:y,_e=Ce+1;(he.width!==i*ne||he.height!==_e*ne)&&(he.width=i*ne,he.height=_e*ne,he.style.width=i+"px",he.style.height=_e+"px");const Oe=pe.canvas,at=et.canvas;Ue&&(Oe.width!==i*ne||Oe.height!==o*ne)&&(Oe.width=i*ne,Oe.height=o*ne,re.current!==void 0&&(re.current.aBufferScroll=void 0)),Ue&&(at.width!==i*ne||at.height!==o*ne)&&(at.width=i*ne,at.height=o*ne,re.current!==void 0&&(re.current.bBufferScroll=void 0));const Pe=re.current;if(ve===!0&&s===Pe?.cellXOffset&&a===Pe?.cellYOffset&&l===Pe?.translateX&&u===Pe?.translateY)return;let we=null;Ue&&(we=n);const Ae=r;let Re;Ue?ke!==void 0?Re=Pe?.lastBuffer==="b"?et:pe:Re=Pe?.lastBuffer==="b"?pe:et:Re=n;const Ne=Re.canvas,ft=Ue?Ne===Oe?at:Oe:me,ht=typeof x=="number"?()=>x:x;Ae.save(),Re.save(),Ae.beginPath(),Re.beginPath(),Ae.textBaseline="middle",Re.textBaseline="middle",ne!==1&&(Ae.scale(ne,ne),Re.scale(ne,ne));const Ye=Sl(c,s,i,h,l);let pt=[];const Nt=m&&P.current?.cell[1]===a&&u===0;let St=!1;if(j!==void 0){for(const wt of j)if(wt.style!=="no-outline"&&wt.range.y===a&&u===0){St=!0;break}}const Tt=()=>{Xm(Ae,Ye,d,de,i,l,y,v,h,R,P,p,fe,se,T,S,ke,M,L),mu(Ae,Ye,a,l,u,i,o,void 0,void 0,v,Ce,ht,E,T,C,F,p,!0),Ae.beginPath(),Ae.moveTo(0,_e-.5),Ae.lineTo(i,_e-.5),Ae.strokeStyle=Ln(p.headerBottomBorderColor??p.horizontalBorderColor??p.borderColor,p.bgHeader),Ae.stroke(),St&&vu(Ae,i,o,s,a,l,u,c,g,y,v,x,C,F,j,p),Nt&&tl(Ae,i,o,a,l,u,Ye,c,p,Ce,P,ht,D,C,H,I,F)};if(ke!==void 0){const wt=Ye[Ye.length-1].sourceIndex+1,ln=ke.hasItemInRegion([{x:s,y:-2,width:wt,height:2},{x:s,y:a,width:wt,height:300},{x:0,y:a,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:s,y:F-C,width:wt,height:C,when:C>0}]),Mn=De=>{gu(De,Ye,c,o,Ce,l,u,a,F,ht,D,S,E,b,O,m,C,H,pt,ke,P,V,j,Q,fe,se,de,W,ae,p,Y,te,le,k,Dt);const mt=P.current;I!==!1&&I!==void 0&&m&&mt!==void 0&&ke.has(Kc(mt.range))&&tl(De,i,o,a,l,u,Ye,c,p,Ce,P,ht,D,C,H,I,F)};ln&&(Mn(Re),we!==null&&(we.save(),we.scale(ne,ne),we.textBaseline="middle",Mn(we),we.restore()),ke.hasHeader()&&(t0(Ae,Ye,i,v,Ce,l,u,a,ke),Tt())),Re.restore(),Ae.restore();return}if((ve!==!0||s!==Pe?.cellXOffset||l!==Pe?.translateX||Nt!==Pe?.mustDrawFocusOnHeader||St!==Pe?.mustDrawHighlightRingsOnHeader)&&Tt(),ve===!0){Pn(ft!==void 0&&Pe!==void 0);const{regions:wt}=Jm(Re,ft,ft===Oe?Pe.aBufferScroll:Pe.bBufferScroll,ft===Oe?Pe.bBufferScroll:Pe.aBufferScroll,Pe,s,a,l,u,C,i,o,F,Ce,ne,c,Ye,x,Ue);pt=wt}else ve!==!1&&(Pn(Pe!==void 0),pt=Qm(Pe,s,a,l,u,i,o,Ce,Ye,ve));Km(Re,Ye,i,o,C,F,T,ht,p);const Bt=vu(Re,i,o,s,a,l,u,c,g,y,v,x,C,F,j,p),qt=m?tl(Re,i,o,a,l,u,Ye,c,p,Ce,P,ht,D,C,H,I,F):void 0;if(Re.fillStyle=p.bgCell,pt.length>0){Re.beginPath();for(const wt of pt)Re.rect(wt.x,wt.y,wt.width,wt.height);Re.clip(),Re.fill(),Re.beginPath()}else Re.fillRect(0,0,i,o);const an=gu(Re,Ye,c,o,Ce,l,u,a,F,ht,D,S,E,b,O,m,C,H,pt,ke,P,V,j,Q,fe,se,de,W,ae,p,Y,te,le,k,Dt);qm(Re,Ye,c,i,o,Ce,l,u,a,F,ht,E,P.rows,b,C,H,pt,ke,p),Zm(Re,Ye,a,l,u,i,o,pt,Ce,ht,E,T,C,F,p),mu(Re,Ye,a,l,u,i,o,pt,an,v,Ce,ht,E,T,C,F,p),Bt?.(),qt?.(),R&&dt!=="none"&&Er(Ye,0,l,0,Ce,(wt,ln)=>wt.sourceIndex===oe?(bu(Ae,ln+wt.width,0,Ce+1,Ln(p.resizeIndicatorColor??p.accentLight,p.bgHeader)),dt==="full"&&bu(Re,ln+wt.width,Ce,o,Ln(p.resizeIndicatorColor??p.accentLight,p.bgCell)),!0):!1),we!==null&&(we.fillStyle=p.bgCell,we.fillRect(0,0,i,o),we.drawImage(Re.canvas,0,0));const It=n0(Ye,o,Ce,l,u,a,F,ht,C,H);Q?.setWindow({x:s,y:a,width:Ye.length,height:It-a},g,Array.from({length:C},(wt,ln)=>F-1-ln));const gt=Pe!==void 0&&(s!==Pe.cellXOffset||l!==Pe.translateX),Wt=Pe!==void 0&&(a!==Pe.cellYOffset||u!==Pe.translateY);re.current={cellXOffset:s,cellYOffset:a,translateX:l,translateY:u,mustDrawFocusOnHeader:Nt,mustDrawHighlightRingsOnHeader:St,lastBuffer:Ue?Ne===Oe?"a":"b":void 0,aBufferScroll:Ne===Oe?[gt,Wt]:Pe?.aBufferScroll,bBufferScroll:Ne===at?[gt,Wt]:Pe?.bBufferScroll},Re.restore(),Ae.restore()}const r0=80;function i0(e){const t=e-1;return t*t*t+1}class o0{callback;constructor(t){this.callback=t}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=t=>{this.leavingItems.some(r=>io(r.item,t.item))||this.leavingItems.push(t)};removeFromLeavingItems=t=>{const n=this.leavingItems.find(r=>io(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),n?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)};shouldStep=()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n};getAnimatingItems=()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:i0(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const r=(t-this.lastAnimationTime)/r0;for(const o of this.leavingItems)o.hoverAmount=Vn(o.hoverAmount-r,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Vn(this.currentHoveredItem.hoverAmount+r,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=t=>{if(!io(this.currentHoveredItem?.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const n=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:n}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}}class a0{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function jl(e){return new a0(e)}const l0=jl(()=>window.navigator.userAgent.includes("Firefox")),sa=jl(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ua=jl(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function s0(e){const t=f.useRef([]),n=f.useRef(0),r=f.useRef(e);r.current=e;const i=f.useCallback(()=>{const o=()=>window.requestAnimationFrame(s),s=()=>{const a=t.current.map(Xl);t.current=[],r.current(new ao(a)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:s)},[]);return f.useCallback(o=>{t.current.length===0&&i();const s=Yn(o[0],o[1]);t.current.includes(s)||t.current.push(s)},[i])}const Sr="header",Xn="group-header",ca="out-of-bounds";var ki;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(ki||(ki={}));function bd(e,t){return e===t?!0:e?.kind==="out-of-bounds"?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}const u0=(e,t)=>e.kind===Z.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",c0=(e,t)=>{const{width:n,height:r,accessibilityHeight:i,columns:o,cellXOffset:s,cellYOffset:a,headerHeight:l,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:g,getCellContent:h,getRowThemeOverride:p,onHeaderMenuClick:m,onHeaderIndicatorClick:y,enableGroups:v,isFilling:b,onCanvasFocused:x,onCanvasBlur:T,isFocused:k,selection:R,freezeColumns:P,onContextMenu:I,freezeTrailingRows:C,fixedShadowX:F=!0,fixedShadowY:D=!0,drawFocusRing:S,onMouseDown:E,onMouseUp:O,onMouseMoveRaw:M,onMouseMove:V,onItemHovered:W,dragAndDropState:j,firstColAccessible:oe,onKeyDown:Q,onKeyUp:re,highlightRegions:se,canvasRef:ae,onDragStart:de,onDragEnd:fe,eventTargetRef:ue,isResizing:H,resizeColumn:L,isDragging:Y,isDraggable:te=!1,allowResize:le,disabledRows:Se,hasAppendRow:pe,getGroupDetails:et,theme:ke,prelightCells:Dt,headerIcons:dt,verticalBorder:Ue,drawCell:ne,drawHeader:ve,onCellFocused:me,onDragOverCell:he,onDrop:Ce,onDragLeave:_e,imageWindowLoader:Oe,smoothScrollX:at=!1,smoothScrollY:Pe=!1,experimental:we,getCellRenderer:Ae,resizeIndicator:Re="full"}=e,Ne=e.translateX??0,ft=e.translateY??0,ht=Math.max(P,Math.min(o.length-1,s)),Ye=f.useRef(null),pt=f.useRef(we?.eventTarget??window),Nt=pt.current,St=Oe,Tt=f.useRef(),[Bt,qt]=f.useState(!1),an=f.useRef([]),It=f.useRef(),[gt,Wt]=f.useState(),[wt,ln]=f.useState(),Mn=f.useRef(null),[De,mt]=f.useState(),[xt,vn]=f.useState(!1),tn=f.useRef(xt);tn.current=xt;const nn=f.useMemo(()=>new Vm(dt,()=>{rn.current=void 0,yn.current()}),[dt]),un=v?c+l:l,$t=f.useRef(-1),Zt=(we?.enableFirefoxRescaling??!1)&&l0.value,Ge=(we?.enableSafariRescaling??!1)&&sa.value;f.useLayoutEffect(()=>{window.devicePixelRatio===1||!Zt&&!Ge||($t.current!==-1&&qt(!0),window.clearTimeout($t.current),$t.current=window.setTimeout(()=>{qt(!1),$t.current=-1},200))},[a,ht,Ne,ft,Zt,Ge]);const kt=Gp(o,P),In=f.useMemo(()=>F?Ei(kt,j):0,[kt,j,F]),Ot=f.useCallback(($,ee,xe)=>{const Te=$.getBoundingClientRect();if(ee>=kt.length||xe>=g)return;const ce=Te.width/n,ge=xl(ee,xe,n,r,c,un,ht,a,Ne,ft,g,P,C,kt,d);return ce!==1&&(ge.x*=ce,ge.y*=ce,ge.width*=ce,ge.height*=ce),ge.x+=Te.x,ge.y+=Te.y,ge},[n,r,c,un,ht,a,Ne,ft,g,P,C,kt,d]),bt=f.useCallback(($,ee,xe,Te)=>{const ce=$.getBoundingClientRect(),ge=ce.width/n,Xe=(ee-ce.left)/ge,Me=(xe-ce.top)/ge,Ze=5,vt=Sl(kt,ht,n,void 0,Ne);let sn=0,Ut=0;const Mt=typeof PointerEvent<"u"&&Te instanceof PointerEvent&&Te.pointerType==="mouse"||typeof MouseEvent<"u"&&Te instanceof MouseEvent,lt=typeof PointerEvent<"u"&&Te instanceof PointerEvent&&Te.pointerType==="touch"||typeof TouchEvent<"u"&&Te instanceof TouchEvent;Mt&&(sn=Te.button,Ut=Te.buttons);const qe=qp(Xe,vt,Ne),st=Kp(Me,r,v,l,c,g,d,a,ft,C),At=Te?.shiftKey===!0,oi=Te?.ctrlKey===!0,Pr=Te?.metaKey===!0,Jt=[Xe<0?-1:n<Xe?1:0,Me<un?-1:r<Me?1:0];let on;if(qe===-1||Me<0||Xe<0||st===void 0||Xe>n||Me>r){const Lt=Xe>n?1:Xe<0?-1:0,Hn=Me>r?1:Me<0?-1:0;let fn=Lt*2,ai=Hn*2;Lt===0&&(fn=qe===-1?ki.EndPadding:ki.Center),Hn===0&&(ai=st===void 0?ki.EndPadding:ki.Center);let lr=!1;if(qe===-1&&st===-1){const Qt=Ot($,kt.length-1,-1);Pn(Qt!==void 0),lr=ee<Qt.x+Qt.width+Ze}const tt=Xe>n&&Xe<n+bl()||Me>r&&Me<r+bl();on={kind:ca,location:[qe!==-1?qe:Xe<0?0:kt.length-1,st??g-1],region:[fn,ai],shiftKey:At,ctrlKey:oi,metaKey:Pr,isEdge:lr,isTouch:lt,button:sn,buttons:Ut,scrollEdge:Jt,isMaybeScrollbar:tt}}else if(st<=-1){let Lt=Ot($,qe,st);Pn(Lt!==void 0);let Hn=Lt!==void 0&&Lt.x+Lt.width-ee<=Ze;const fn=qe-1;ee-Lt.x<=Ze&&fn>=0?(Hn=!0,Lt=Ot($,fn,st),Pn(Lt!==void 0),on={kind:v&&st===-2?Xn:Sr,location:[fn,st],bounds:Lt,group:kt[fn].group??"",isEdge:Hn,shiftKey:At,ctrlKey:oi,metaKey:Pr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:sn,buttons:Ut,scrollEdge:Jt}):on={kind:v&&st===-2?Xn:Sr,group:kt[qe].group??"",location:[qe,st],bounds:Lt,isEdge:Hn,shiftKey:At,ctrlKey:oi,metaKey:Pr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:sn,buttons:Ut,scrollEdge:Jt}}else{const Lt=Ot($,qe,st);Pn(Lt!==void 0);const Hn=Lt!==void 0&&Lt.x+Lt.width-ee<Ze;let fn=!1;if(u!==!1&&u!==void 0&&R.current!==void 0){const lr=typeof u=="object"?{...aa,...u}:aa,tt=lr.size,Qt=tt/2,Lr=Kc(R.current.range),pr=Ot($,Lr[0],Lr[1]);if(pr!==void 0){const sr=pr.x+pr.width+lr.offsetX-Qt+.5,Ht=pr.y+pr.height+lr.offsetY-Qt+.5;fn=Math.abs(sr-ee)<tt&&Math.abs(Ht-xe)<tt}}on={kind:"cell",location:[qe,st],bounds:Lt,isEdge:Hn,shiftKey:At,ctrlKey:oi,isFillHandle:fn,metaKey:Pr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:sn,buttons:Ut,scrollEdge:Jt}}return on},[n,kt,ht,Ne,r,v,l,c,g,d,a,ft,C,Ot,u,R,un]),[bn]=gt??[],ir=f.useRef(()=>{}),Kn=f.useRef(gt);Kn.current=gt;const[B,Be]=f.useMemo(()=>{const $=document.createElement("canvas"),ee=document.createElement("canvas");return $.style.display="none",$.style.opacity="0",$.style.position="fixed",ee.style.display="none",ee.style.opacity="0",ee.style.position="fixed",[$.getContext("2d",{alpha:!1}),ee.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>{if(!(B===null||Be===null))return document.documentElement.append(B.canvas),document.documentElement.append(Be.canvas),()=>{B.canvas.remove(),Be.canvas.remove()}},[B,Be]);const je=f.useMemo(()=>new om,[]),Pt=Zt&&Bt?1:Ge&&Bt?2:5,Kt=we?.disableMinimumCellWidth===!0?1:10,rn=f.useRef(),En=f.useRef(null),wn=f.useRef(null),Gt=f.useCallback(()=>{const $=Ye.current,ee=Mn.current;if($===null||ee===null||(En.current===null&&(En.current=$.getContext("2d",{alpha:!1}),$.width=0,$.height=0),wn.current===null&&(wn.current=ee.getContext("2d",{alpha:!1}),ee.width=0,ee.height=0),En.current===null||wn.current===null||B===null||Be===null))return;let xe=!1;const Te=Xe=>{xe=!0,mt(Xe)},ce=rn.current,ge={headerCanvasCtx:wn.current,canvasCtx:En.current,bufferACtx:B,bufferBCtx:Be,width:n,height:r,cellXOffset:ht,cellYOffset:a,translateX:Math.round(Ne),translateY:Math.round(ft),mappedColumns:kt,enableGroups:v,freezeColumns:P,dragAndDropState:j,theme:ke,headerHeight:l,groupHeaderHeight:c,disabledRows:Se??Qe.empty(),rowHeight:d,verticalBorder:Ue,isResizing:H,resizeCol:L,isFocused:k,selection:R,fillHandle:u,drawCellCallback:ne,hasAppendRow:pe,overrideCursor:Te,maxScaleFactor:Pt,freezeTrailingRows:C,rows:g,drawFocus:S,getCellContent:h,getGroupDetails:et??(Xe=>({name:Xe})),getRowThemeOverride:p,drawHeaderCallback:ve,prelightCells:Dt,highlightRegions:se,imageLoader:St,lastBlitData:It,damage:Tt.current,hoverValues:an.current,hoverInfo:Kn.current,spriteManager:nn,scrolling:Bt,hyperWrapping:we?.hyperWrapping??!1,touchMode:xt,enqueue:ir.current,renderStateProvider:je,renderStrategy:we?.renderStrategy??(sa.value?"double-buffer":"single-buffer"),getCellRenderer:Ae,minimumCellWidth:Kt,resizeIndicator:Re};ge.damage===void 0?(rn.current=ge,wu(ge,ce)):wu(ge,void 0),!xe&&(ge.damage===void 0||ge.damage.has(Kn?.current?.[0]))&&mt(void 0)},[B,Be,n,r,ht,a,Ne,ft,kt,v,P,j,ke,l,c,Se,d,Ue,H,pe,L,k,R,u,C,g,S,Pt,h,et,p,ne,ve,Dt,se,St,nn,Bt,we?.hyperWrapping,we?.renderStrategy,xt,je,Ae,Kt,Re]),yn=f.useRef(Gt);f.useLayoutEffect(()=>{Gt(),yn.current=Gt},[Gt]),f.useLayoutEffect(()=>{(async()=>document?.fonts?.ready!==void 0&&(await document.fonts.ready,rn.current=void 0,yn.current()))()},[]);const Cn=f.useCallback($=>{Tt.current=$,yn.current(),Tt.current=void 0},[]),jr=s0(Cn);ir.current=jr;const qr=f.useCallback($=>{Cn(new ao($.map(ee=>ee.cell)))},[Cn]);St.setCallback(Cn);const[Kr,Di]=f.useState(!1),[_n,An]=bn??[],He=_n!==void 0&&An===-1&&_n>=0&&_n<kt.length&&kt[_n].headerRowMarkerDisabled!==!0,cn=_n!==void 0&&An===-2;let Rn=!1,Oi=!1,Zn=De;if(Zn===void 0&&_n!==void 0&&An!==void 0&&An>-1&&An<g){const $=h([_n,An],!0);Rn=$.kind===$n.NewRow||$.kind===$n.Marker&&$.markerKind!=="number",Oi=$.kind===Z.Boolean&&Al($),Zn=$.cursor}const wo=Y?"grabbing":(wt??!1)||H?"col-resize":Kr||b?"crosshair":Zn!==void 0?Zn:He||Rn||Oi||cn?"pointer":"default",Zr=f.useMemo(()=>({contain:"strict",display:"block",cursor:wo}),[wo]),Nn=f.useRef("default"),Sn=ue?.current;Sn!=null&&Nn.current!==Zr.cursor&&(Sn.style.cursor=Nn.current=Zr.cursor);const Jr=f.useCallback(($,ee,xe,Te)=>{if(et===void 0)return;const ce=et($);if(ce.actions!==void 0){const ge=gd(ee,ce.actions);for(const[Xe,Me]of ge.entries())if(Br(Me,xe+ee.x,Te+Me.y))return ce.actions[Xe]}},[et]),or=f.useCallback(($,ee,xe,Te)=>{const ce=kt[ee];if(!Y&&!H&&!(wt??!1)){const ge=Ot($,ee,-1);Pn(ge!==void 0);const Xe=pd(void 0,ce,ge.x,ge.y,ge.width,ge.height,ke,Vl(ce.title)==="rtl");if(ce.hasMenu===!0&&Xe.menuBounds!==void 0&&Br(Xe.menuBounds,xe,Te))return{area:"menu",bounds:Xe.menuBounds};if(ce.indicatorIcon!==void 0&&Xe.indicatorIconBounds!==void 0&&Br(Xe.indicatorIconBounds,xe,Te))return{area:"indicator",bounds:Xe.indicatorIconBounds}}},[kt,Ot,wt,Y,H,ke]),Qr=f.useRef(0),fr=f.useRef(),ei=f.useRef(!1),ti=f.useCallback($=>{const ee=Ye.current,xe=ue?.current;if(ee===null||$.target!==ee&&$.target!==xe)return;ei.current=!0;const Te=$.clientX,ce=$.clientY;if($.target===xe&&xe!==null){const Xe=xe.getBoundingClientRect();if(Te>Xe.right||ce>Xe.bottom)return}const ge=bt(ee,Te,ce,$);fr.current=ge.location,ge.isTouch&&(Qr.current=Date.now()),tn.current!==ge.isTouch&&vn(ge.isTouch),!(ge.kind===Sr&&or(ee,ge.location[0],Te,ce)!==void 0)&&(ge.kind===Xn&&Jr(ge.group,ge.bounds,ge.localEventX,ge.localEventY)!==void 0||(E?.(ge),!ge.isTouch&&te!==!0&&te!==ge.kind&&ge.button<3&&ge.button!==1&&$.preventDefault()))},[ue,te,bt,Jr,or,E]);kn("pointerdown",ti,Nt,!1);const Tr=f.useRef(0),hr=f.useCallback($=>{const ee=Tr.current;Tr.current=Date.now();const xe=Ye.current;if(ei.current=!1,O===void 0||xe===null)return;const Te=ue?.current,ce=$.target!==xe&&$.target!==Te,ge=$.clientX,Xe=$.clientY,Me=$.pointerType==="mouse"?$.button<3:!0;let Ze=bt(xe,ge,Xe,$);Ze.isTouch&&Qr.current!==0&&Date.now()-Qr.current>500&&(Ze={...Ze,isLongTouch:!0}),ee!==0&&Date.now()-ee<(Ze.isTouch?1e3:500)&&(Ze={...Ze,isDoubleClick:!0}),tn.current!==Ze.isTouch&&vn(Ze.isTouch),!ce&&$.cancelable&&Me&&$.preventDefault();const[vt]=Ze.location,sn=or(xe,vt,ge,Xe);if(Ze.kind===Sr&&sn!==void 0){(Ze.button!==0||fr.current?.[0]!==vt||fr.current?.[1]!==-1)&&O(Ze,!0);return}else if(Ze.kind===Xn){const Ut=Jr(Ze.group,Ze.bounds,Ze.localEventX,Ze.localEventY);if(Ut!==void 0){Ze.button===0&&Ut.onClick(Ze);return}}O(Ze,ce)},[O,ue,bt,or,Jr]);kn("pointerup",hr,Nt,!1);const ni=f.useCallback($=>{const ee=Ye.current;if(ee===null)return;const xe=ue?.current,Te=$.target!==ee&&$.target!==xe;let ce,ge,Xe=!0;$ instanceof MouseEvent?(ce=$.clientX,ge=$.clientY,Xe=$.button<3):(ce=$.changedTouches[0].clientX,ge=$.changedTouches[0].clientY);const Me=bt(ee,ce,ge,$);tn.current!==Me.isTouch&&vn(Me.isTouch),!Te&&$.cancelable&&Xe&&$.preventDefault();const[Ze]=Me.location;if(Me.kind===Sr){const vt=or(ee,Ze,ce,ge);vt!==void 0&&Me.button===0&&fr.current?.[0]===Ze&&fr.current?.[1]===-1&&(vt.area==="menu"?m?.(Ze,vt.bounds):vt.area==="indicator"&&y?.(Ze,vt.bounds))}},[ue,bt,or,m,y]);kn("click",ni,Nt,!1);const Ra=f.useCallback($=>{const ee=Ye.current,xe=ue?.current;if(ee===null||$.target!==ee&&$.target!==xe||I===void 0)return;const Te=bt(ee,$.clientX,$.clientY,$);I(Te,()=>{$.cancelable&&$.preventDefault()})},[ue,bt,I]);kn("contextmenu",Ra,ue?.current??null,!1);const Pi=f.useCallback($=>{Tt.current=new ao($.map(ee=>ee.item)),an.current=$,yn.current(),Tt.current=void 0},[]),ze=f.useMemo(()=>new o0(Pi),[Pi]),Li=f.useRef(ze);Li.current=ze,f.useLayoutEffect(()=>{const $=Li.current;if(bn===void 0||bn[1]<0){$.setHovered(bn);return}const ee=h(bn,!0),xe=Ae(ee),Te=xe===void 0&&ee.kind===Z.Custom||xe?.needsHover!==void 0&&(typeof xe.needsHover=="boolean"?xe.needsHover:xe.needsHover(ee));$.setHovered(Te?bn:void 0)},[h,Ae,bn]);const yo=f.useRef(),Dr=f.useCallback($=>{const ee=Ye.current;if(ee===null)return;const xe=ue?.current,Te=$.target!==ee&&$.target!==xe,ce=bt(ee,$.clientX,$.clientY,$);if(ce.kind!=="out-of-bounds"&&Te&&!ei.current&&!ce.isTouch)return;const ge=(Me,Ze)=>{Wt(vt=>vt===Me||vt?.[0][0]===Me?.[0][0]&&vt?.[0][1]===Me?.[0][1]&&(vt?.[1][0]===Me?.[1][0]&&vt?.[1][1]===Me?.[1][1]||!Ze)?vt:Me)};if(!bd(ce,yo.current))mt(void 0),W?.(ce),ge(ce.kind===ca?void 0:[ce.location,[ce.localEventX,ce.localEventY]],!0),yo.current=ce;else if(ce.kind==="cell"||ce.kind===Sr||ce.kind===Xn){let Me=!1,Ze=!0;if(ce.kind==="cell"){const sn=h(ce.location);Ze=Ae(sn)?.needsHoverPosition??sn.kind===Z.Custom,Me=Ze}else Me=!0;const vt=[ce.location,[ce.localEventX,ce.localEventY]];ge(vt,Ze),Kn.current=vt,Me&&Cn(new ao([ce.location]))}const Xe=ce.location[0]>=(oe?0:1);ln(ce.kind===Sr&&ce.isEdge&&Xe&&le===!0),Di(ce.kind==="cell"&&ce.isFillHandle),M?.($),V(ce)},[ue,bt,oe,le,M,V,W,h,Ae,Cn]);kn("pointermove",Dr,Nt,!0);const Ia=f.useCallback($=>{const ee=Ye.current;if(ee===null)return;let xe,Te;R.current!==void 0&&(xe=Ot(ee,R.current.cell[0],R.current.cell[1]),Te=R.current.cell),Q?.({bounds:xe,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:Te})},[Q,R,Ot]),Jn=f.useCallback($=>{const ee=Ye.current;if(ee===null)return;let xe,Te;R.current!==void 0&&(xe=Ot(ee,R.current.cell[0],R.current.cell[1]),Te=R.current.cell),re?.({bounds:xe,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:Te})},[re,R,Ot]),Fi=f.useCallback($=>{if(Ye.current=$,ae!==void 0&&(ae.current=$),we?.eventTarget)pt.current=we.eventTarget;else if($===null)pt.current=window;else{const ee=$.getRootNode();ee===document&&(pt.current=window),pt.current=ee}},[ae,we?.eventTarget]),Co=f.useCallback($=>{const ee=Ye.current;if(ee===null||te===!1||H){$.preventDefault();return}let xe,Te;const ce=bt(ee,$.clientX,$.clientY);if(te!==!0&&ce.kind!==te){$.preventDefault();return}const ge=(Ut,Mt)=>{xe=Ut,Te=Mt};let Xe,Me,Ze;const vt=(Ut,Mt,lt)=>{Xe=Ut,Me=Mt,Ze=lt};let sn=!1;if(de?.({...ce,setData:ge,setDragImage:vt,preventDefault:()=>sn=!0,defaultPrevented:()=>sn}),!sn&&xe!==void 0&&Te!==void 0&&$.dataTransfer!==null)if($.dataTransfer.setData(xe,Te),$.dataTransfer.effectAllowed="copyLink",Xe!==void 0&&Me!==void 0&&Ze!==void 0)$.dataTransfer.setDragImage(Xe,Me,Ze);else{const[Ut,Mt]=ce.location;if(Mt!==void 0){const lt=document.createElement("canvas"),qe=Ot(ee,Ut,Mt);Pn(qe!==void 0);const st=Math.ceil(window.devicePixelRatio??1);lt.width=qe.width*st,lt.height=qe.height*st;const At=lt.getContext("2d");At!==null&&(At.scale(st,st),At.textBaseline="middle",Mt===-1?(At.font=ke.headerFontFull,At.fillStyle=ke.bgHeader,At.fillRect(0,0,lt.width,lt.height),md(At,0,0,qe.width,qe.height,kt[Ut],!1,ke,!1,void 0,void 0,!1,0,nn,ve,!1)):(At.font=ke.baseFontFull,At.fillStyle=ke.bgCell,At.fillRect(0,0,lt.width,lt.height),hd(At,h([Ut,Mt]),0,Mt,!1,!1,0,0,qe.width,qe.height,!1,ke,ke.bgCell,St,nn,1,void 0,!1,0,void 0,void 0,void 0,je,Ae,()=>{}))),lt.style.left="-100%",lt.style.position="absolute",lt.style.width=`${qe.width}px`,lt.style.height=`${qe.height}px`,document.body.append(lt),$.dataTransfer.setDragImage(lt,qe.width/2,qe.height/2),window.setTimeout(()=>{lt.remove()},0)}}else $.preventDefault()},[te,H,bt,de,Ot,ke,kt,nn,ve,h,St,je,Ae]);kn("dragstart",Co,ue?.current??null,!1,!1);const ri=f.useRef(),Ea=f.useCallback($=>{const ee=Ye.current;if(Ce!==void 0&&$.preventDefault(),ee===null||he===void 0)return;const xe=bt(ee,$.clientX,$.clientY),[Te,ce]=xe.location,ge=Te-(oe?0:1),[Xe,Me]=ri.current??[];(Xe!==ge||Me!==ce)&&(ri.current=[ge,ce],he([ge,ce],$.dataTransfer))},[oe,bt,he,Ce]);kn("dragover",Ea,ue?.current??null,!1,!1);const Ta=f.useCallback(()=>{ri.current=void 0,fe?.()},[fe]);kn("dragend",Ta,ue?.current??null,!1,!1);const Qn=f.useCallback($=>{const ee=Ye.current;if(ee===null||Ce===void 0)return;$.preventDefault();const xe=bt(ee,$.clientX,$.clientY),[Te,ce]=xe.location,ge=Te-(oe?0:1);Ce([ge,ce],$.dataTransfer)},[oe,bt,Ce]);kn("drop",Qn,ue?.current??null,!1,!1);const gr=f.useCallback(()=>{_e?.()},[_e]);kn("dragleave",gr,ue?.current??null,!1,!1);const Tn=f.useRef(R);Tn.current=R;const G=f.useRef(null),_t=f.useCallback($=>{Ye.current===null||!Ye.current.contains(document.activeElement)||($===null&&Tn.current.current!==void 0?ae?.current?.focus({preventScroll:!0}):$!==null&&$.focus({preventScroll:!0}),G.current=$)},[ae]);f.useImperativeHandle(t,()=>({focus:()=>{const $=G.current;$===null||!document.contains($)?ae?.current?.focus({preventScroll:!0}):$.focus({preventScroll:!0})},getBounds:($,ee)=>{if(!(ae===void 0||ae.current===null))return Ot(ae.current,$??0,ee??-1)},damage:qr,getMouseArgsForPosition:($,ee,xe)=>{if(!(ae===void 0||ae.current===null))return bt(ae.current,$,ee,xe)}}),[ae,qr,Ot,bt]);const ar=f.useRef(),Da=cp(()=>{if(n<50||we?.disableAccessibilityTree===!0)return null;let $=Sl(kt,ht,n,j,Ne);const ee=oe?0:-1;!oe&&$[0]?.sourceIndex===0&&($=$.slice(1));const[xe,Te]=R.current?.cell??[],ce=R.current?.range,ge=$.map(Me=>Me.sourceIndex),Xe=kr(a,Math.min(g,a+i));return xe!==void 0&&Te!==void 0&&!(ge.includes(xe)&&Xe.includes(Te))&&_t(null),f.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":kt.length+ee},f.createElement("thead",{role:"rowgroup"},f.createElement("tr",{role:"row","aria-rowindex":1},$.map(Me=>f.createElement("th",{role:"columnheader","aria-selected":R.columns.hasIndex(Me.sourceIndex),"aria-colindex":Me.sourceIndex+1+ee,tabIndex:-1,onFocus:Ze=>{if(Ze.target!==G.current)return me?.([Me.sourceIndex,-1])},key:Me.sourceIndex},Me.title)))),f.createElement("tbody",{role:"rowgroup"},Xe.map(Me=>f.createElement("tr",{role:"row","aria-selected":R.rows.hasIndex(Me),key:Me,"aria-rowindex":Me+2},$.map(Ze=>{const vt=Ze.sourceIndex,sn=Yn(vt,Me),Ut=xe===vt&&Te===Me,Mt=ce!==void 0&&vt>=ce.x&&vt<ce.x+ce.width&&Me>=ce.y&&Me<ce.y+ce.height,lt=`glide-cell-${vt}-${Me}`,qe=[vt,Me],st=h(qe,!0);return f.createElement("td",{key:sn,role:"gridcell","aria-colindex":vt+1+ee,"aria-selected":Mt,"aria-readonly":Si(st)||!yi(st),id:lt,"data-testid":lt,onClick:()=>{const At=ae?.current;if(At!=null)return Q?.({bounds:Ot(At,vt,Me),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:qe})},onFocusCapture:At=>{if(!(At.target===G.current||ar.current?.[0]===vt&&ar.current?.[1]===Me))return ar.current=qe,me?.(qe)},ref:Ut?_t:void 0,tabIndex:-1},u0(st,Ae))})))))},[n,kt,ht,j,Ne,g,a,i,R,_t,h,ae,Q,Ot,me],200),Or=P===0||!F?0:ht>P?1:Vn(-Ne/100,0,1),Oa=-a*32+ft,ii=D?Vn(-Oa/100,0,1):0,ms=f.useMemo(()=>{if(!Or&&!ii)return null;const $={position:"absolute",top:0,left:In,width:n-In,height:r,opacity:Or,pointerEvents:"none",transition:at?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ee={position:"absolute",top:un,left:0,width:n,height:r,opacity:ii,pointerEvents:"none",transition:Pe?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return f.createElement(f.Fragment,null,Or>0&&f.createElement("div",{id:"shadow-x",style:$}),ii>0&&f.createElement("div",{id:"shadow-y",style:ee}))},[Or,ii,In,n,at,un,r,Pe]),q=f.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return f.createElement(f.Fragment,null,f.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Ia,onKeyUp:Jn,onFocus:x,onBlur:T,ref:Fi,style:Zr},Da),f.createElement("canvas",{ref:Mn,style:q}),ms)},d0=f.memo(f.forwardRef(c0));function Qi(e,t,n,r){return Vn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const f0=e=>{const[t,n]=f.useState(),[r,i]=f.useState(),[o,s]=f.useState(),[a,l]=f.useState(),[u,c]=f.useState(!1),[d,g]=f.useState(),[h,p]=f.useState(),[m,y]=f.useState(),[v,b]=f.useState(!1),[x,T]=f.useState(),{onHeaderMenuClick:k,onHeaderIndicatorClick:R,getCellContent:P,onColumnMoved:I,onColumnResize:C,onColumnResizeStart:F,onColumnResizeEnd:D,gridRef:S,maxColumnWidth:E,minColumnWidth:O,onRowMoved:M,lockColumns:V,onColumnProposeMove:W,onMouseDown:j,onMouseUp:oe,onItemHovered:Q,onDragStart:re,canvasRef:se}=e,ae=(C??D??F)!==void 0,{columns:de,selection:fe}=e,ue=fe.columns,H=f.useCallback(ne=>{const[ve,me]=ne.location;o!==void 0&&a!==ve&&ve>=V?(c(!0),l(ve)):h!==void 0&&me!==void 0?(b(!0),y(Math.max(0,me))):r===void 0&&!u&&!v&&Q?.(ne)},[o,h,a,Q,V,r,u,v]),L=I!==void 0,Y=f.useCallback(ne=>{if(ne.button===0){const[ve,me]=ne.location;if(ne.kind==="out-of-bounds"&&ne.isEdge&&ae){const he=S?.current?.getBounds(de.length-1,-1);he!==void 0&&(n(he.x),i(de.length-1))}else if(ne.kind==="header"&&ve>=V){const he=se?.current;if(ne.isEdge&&ae&&he){n(ne.bounds.x),i(ve);const _e=he.getBoundingClientRect().width/he.offsetWidth,Oe=ne.bounds.width/_e;F?.(de[ve],Oe,ve,Oe+(de[ve].growOffset??0))}else ne.kind==="header"&&L&&(g(ne.bounds.x),s(ve))}else ne.kind==="cell"&&V>0&&ve===0&&me!==void 0&&M!==void 0&&(T(ne.bounds.y),p(me))}j?.(ne)},[j,ae,V,M,S,de,L,F,se]),te=f.useCallback((ne,ve)=>{u||v||k?.(ne,ve)},[u,v,k]),le=f.useCallback((ne,ve)=>{u||v||R?.(ne,ve)},[u,v,R]),Se=f.useRef(-1),pe=f.useCallback(()=>{Se.current=-1,p(void 0),y(void 0),T(void 0),b(!1),s(void 0),l(void 0),g(void 0),c(!1),i(void 0),n(void 0)},[]),et=f.useCallback((ne,ve)=>{if(ne.button===0){if(r!==void 0){if(ue?.hasIndex(r)===!0)for(const he of ue){if(he===r)continue;const Ce=de[he],_e=Qi(Ce,Se.current,O,E);C?.(Ce,_e,he,_e+(Ce.growOffset??0))}const me=Qi(de[r],Se.current,O,E);if(D?.(de[r],me,r,me+(de[r].growOffset??0)),ue.hasIndex(r))for(const he of ue){if(he===r)continue;const Ce=de[he],_e=Qi(Ce,Se.current,O,E);D?.(Ce,_e,he,_e+(Ce.growOffset??0))}}pe(),o!==void 0&&a!==void 0&&W?.(o,a)!==!1&&I?.(o,a),h!==void 0&&m!==void 0&&M?.(h,m)}oe?.(ne,ve)},[oe,r,o,a,h,m,ue,D,de,O,E,C,I,M,pe,W]),ke=f.useMemo(()=>{if(!(o===void 0||a===void 0)&&o!==a&&W?.(o,a)!==!1)return{src:o,dest:a}},[o,a,W]),Dt=f.useCallback(ne=>{const ve=se?.current;if(o!==void 0&&d!==void 0)Math.abs(ne.clientX-d)>20&&c(!0);else if(h!==void 0&&x!==void 0)Math.abs(ne.clientY-x)>20&&b(!0);else if(r!==void 0&&t!==void 0&&ve){const he=ve.getBoundingClientRect().width/ve.offsetWidth,Ce=(ne.clientX-t)/he,_e=de[r],Oe=Qi(_e,Ce,O,E);if(C?.(_e,Oe,r,Oe+(_e.growOffset??0)),Se.current=Ce,ue?.first()===r)for(const at of ue){if(at===r)continue;const Pe=de[at],we=Qi(Pe,Se.current,O,E);C?.(Pe,we,at,we+(Pe.growOffset??0))}}},[o,d,h,x,r,t,de,O,E,C,ue,se]),dt=f.useCallback((ne,ve)=>{if(h===void 0||m===void 0)return P(ne,ve);let[me,he]=ne;return he===m?he=h:(he>m&&(he-=1),he>=h&&(he+=1)),P([me,he],ve)},[h,m,P]),Ue=f.useCallback(ne=>{re?.(ne),ne.defaultPrevented()||pe()},[pe,re]);return f.createElement(d0,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:dt,isResizing:r!==void 0,onHeaderMenuClick:te,onHeaderIndicatorClick:le,isDragging:u,onItemHovered:H,onDragStart:Ue,onMouseDown:Y,allowResize:ae,onMouseUp:et,dragAndDropState:ke,onMouseMoveRaw:Dt,ref:S})};function h0(e){const t=f.useRef(null),[n,r]=f.useState({width:e?.[0],height:e?.[1]});return f.useLayoutEffect(()=>{const i=s=>{for(const a of s){const{width:l,height:u}=a&&a.contentRect||{};r(c=>c.width===l&&c.height===u?c:{width:l,height:u})}},o=new window.ResizeObserver(i);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const g0=(e,t,n)=>{const r=f.useRef(null),i=f.useRef(null),o=f.useRef(null),s=f.useRef(0),a=f.useRef(t);a.current=t;const l=n.current;f.useEffect(()=>{const u=()=>{if(i.current===!1&&l!==null){const g=[l.scrollLeft,l.scrollTop];if(o.current?.[0]===g[0]&&o.current?.[1]===g[1])if(s.current>10){o.current=null,i.current=null;return}else s.current++;else s.current=0,a.current(g[0],g[1]),o.current=g;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{i.current=!0,o.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},d=g=>{g.touches.length===0&&(i.current=!1,s.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&l!==null){const g=l;return g.addEventListener("touchstart",c),g.addEventListener("touchend",d),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",d),r.current!==null&&window.clearTimeout(r.current)}}},[e,l])},p0=()=>e=>e.isSafari?"scroll":"auto",m0=dn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[p0()]}}),v0=33554400,b0=5e6;function w0(e){const[t,n]=f.useState(!1),r=typeof window>"u"?null:window,i=f.useRef(0);return kn("touchstart",f.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),kn("touchend",f.useCallback(o=>{o.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const y0=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:o,draggable:s,className:a,preventDiagonalScrolling:l=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:g,kineticScrollPerfHack:h=!1,scrollRef:p,initialSize:m}=e,y=[],v=g?.sticky??!1,b=g?.fill??!1,x=f.useRef(0),T=f.useRef(0),k=f.useRef(null),R=typeof window>"u"?1:window.devicePixelRatio,P=f.useRef(R);f.useEffect(()=>{if(P.current!==R){x.current=0,T.current=0,P.current=R;const fe=k.current;fe!==null&&M.current(fe.scrollLeft,fe.scrollTop)}},[R]);const I=f.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),C=f.useRef(null),F=w0(200),[D,S]=f.useState(!0),E=f.useRef(0);f.useLayoutEffect(()=>{if(!D||F||I.current.lockDirection===void 0)return;const fe=k.current;if(fe===null)return;const[ue,H]=I.current.lockDirection;ue!==void 0?fe.scrollLeft=ue:H!==void 0&&(fe.scrollTop=H),I.current.lockDirection=void 0},[F,D]);const O=f.useCallback((fe,ue)=>{const H=k.current;if(H===null)return;ue=ue??H.scrollTop,fe=fe??H.scrollLeft;const L=I.current.scrollTop,Y=I.current.scrollLeft,te=fe-Y,le=ue-L;F&&te!==0&&le!==0&&(Math.abs(te)>3||Math.abs(le)>3)&&l&&I.current.lockDirection===void 0&&(I.current.lockDirection=Math.abs(te)<Math.abs(le)?[Y,void 0]:[void 0,L]);const Se=I.current.lockDirection;fe=Se?.[0]??fe,ue=Se?.[1]??ue,I.current.scrollLeft=fe,I.current.scrollTop=ue;const pe=H.clientWidth,et=H.clientHeight,ke=ue,Dt=T.current-ke,dt=H.scrollHeight-et;T.current=ke;let Ue;if(dt>0&&r>H.scrollHeight+5)if(Math.abs(Dt)>2e3||ke===0||ke===dt){const ne=Math.max(0,Math.min(1,ke/dt)),ve=r-et;Ue=ne*ve,x.current=Ue}else x.current-=Dt,Ue=x.current;else Ue=ke,x.current=Ue;Ue=Math.max(0,Math.min(Ue,r-et)),x.current=Ue,Se!==void 0&&(window.clearTimeout(E.current),S(!1),E.current=window.setTimeout(()=>S(!0),200)),o({x:fe,y:Ue,width:pe-c,height:et-u,paddingRight:C.current?.clientWidth??0})},[u,c,r,o,l,F]);g0(h&&sa.value,O,k);const M=f.useRef(O);M.current=O;const V=f.useRef(),W=f.useRef(!1);f.useLayoutEffect(()=>{W.current?O():W.current=!0},[O,u,c]);const j=f.useCallback(fe=>{k.current=fe,p!==void 0&&(p.current=fe)},[p]);let oe=0,Q=0;const re=Math.min(r,v0);for(y.push(f.createElement("div",{key:oe++,style:{width:i,height:0}}));Q<re;){const fe=Math.min(b0,re-Q);y.push(f.createElement("div",{key:oe++,style:{width:0,height:fe}})),Q+=fe}const{ref:se,width:ae,height:de}=h0(m);return typeof window<"u"&&(V.current?.height!==de||V.current?.width!==ae)&&(window.setTimeout(()=>M.current(),0),V.current={width:ae,height:de}),(ae??0)===0||(de??0)===0?f.createElement("div",{ref:se}):f.createElement("div",{ref:se},f.createElement(m0,{isSafari:sa.value},f.createElement("div",{className:"dvn-underlay"},t),f.createElement("div",{ref:j,style:V.current,draggable:s,onDragStart:fe=>{s||(fe.stopPropagation(),fe.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>O()},f.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},f.createElement("div",{className:"dvn-stack"},y),d!==void 0&&f.createElement(f.Fragment,null,!b&&f.createElement("div",{className:"dvn-spacer"}),f.createElement("div",{ref:C,style:{height:de,maxHeight:n-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:b?1:void 0,right:v?c??0:void 0,pointerEvents:"auto"}},d))))))},C0=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:o,enableGroups:s,freezeColumns:a,experimental:l,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:g,scrollRef:h,preventDiagonalScrolling:p,rightElement:m,rightElementProps:y,overscrollX:v,overscrollY:b,initialSize:x,smoothScrollX:T=!1,smoothScrollY:k=!1,isDraggable:R}=e,{paddingRight:P,paddingBottom:I}=l??{},[C,F]=c,D=f.useRef(),S=f.useRef(),E=f.useRef(),O=f.useRef(),M=u+Math.max(0,v??0);let V=s?i+o:i;if(typeof r=="number")V+=n*r;else for(let Q=0;Q<n;Q++)V+=r(Q);b!==void 0&&(V+=b);const W=f.useRef(),j=f.useCallback(()=>{if(W.current===void 0)return;const Q={...W.current};let re=0,se=Q.x<0?-Q.x:0,ae=0,de=0;Q.x=Q.x<0?0:Q.x;let fe=0;for(let le=0;le<a;le++)fe+=t[le].width;for(const le of t){const Se=re-fe;if(Q.x>=Se+le.width)re+=le.width,de++,ae++;else if(Q.x>Se)re+=le.width,T?se+=Se-Q.x:de++,ae++;else if(Q.x+Q.width>Se)re+=le.width,ae++;else break}let ue=0,H=0,L=0;if(typeof r=="number")k?(H=Math.floor(Q.y/r),ue=H*r-Q.y):H=Math.ceil(Q.y/r),L=Math.ceil(Q.height/r)+H,ue<0&&L++;else{let le=0;for(let Se=0;Se<n;Se++){const pe=r(Se),et=le+(k?0:pe/2);if(Q.y>=le+pe)le+=pe,H++,L++;else if(Q.y>et)le+=pe,k?ue+=et-Q.y:H++,L++;else if(Q.y+Q.height>pe/2+le)le+=pe,L++;else break}}H=Math.max(0,Math.min(H,n-1)),L=Math.max(H,Math.min(L,n));const Y={x:de,y:H,width:ae-de,height:L-H},te=D.current;(te===void 0||te.y!==Y.y||te.x!==Y.x||te.height!==Y.height||te.width!==Y.width||S.current!==se||E.current!==ue||Q.width!==O.current?.[0]||Q.height!==O.current?.[1])&&(g?.({x:de,y:H,width:ae-de,height:L-H},Q.width,Q.height,Q.paddingRight??0,se,ue),D.current=Y,S.current=se,E.current=ue,O.current=[Q.width,Q.height])},[t,r,n,g,a,T,k]),oe=f.useCallback(Q=>{W.current=Q,j()},[j]);return f.useEffect(()=>{j()},[j]),f.createElement(y0,{scrollRef:h,className:d,kineticScrollPerfHack:l?.kineticScrollPerfHack,preventDiagonalScrolling:p,draggable:R===!0||typeof R=="string",scrollWidth:M+(P??0),scrollHeight:V+(I??0),clientHeight:F,rightElement:m,paddingBottom:I,paddingRight:P,rightElementProps:y,update:oe,initialSize:x},f.createElement(f0,{eventTargetRef:h,width:C,height:F,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},S0=dn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),x0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),k0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),M0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),R0=10,I0=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:o,searchValue:s,searchResults:a,onSearchValueChange:l,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:g}=e,[h]=f.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[p,m]=f.useState(""),y=s??p,v=f.useCallback(re=>{m(re),l?.(re)},[l]),[b,x]=f.useState(),T=f.useRef(b);T.current=b,f.useEffect(()=>{a!==void 0&&(a.length>0?x(re=>({rowsSearched:r,results:a.length,selectedIndex:re?.selectedIndex??-1})):x(void 0))},[r,a]);const k=f.useRef();k.current===void 0&&(k.current=new AbortController);const R=f.useRef(),[P,I]=f.useState([]),C=a??P,F=f.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0),k.current!==void 0&&k.current.abort(),k.current=new AbortController},[]),D=f.useRef(n);D.current=n;const S=f.useCallback(re=>{const se=new RegExp(re.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ae=D.current,de=Math.min(10,r),fe=0;x(void 0),I([]);const ue=[],H=async()=>{if(u===void 0)return;const L=performance.now(),Y=r-fe;let te=u({x:0,y:ae,width:i.length,height:Math.min(de,Y,r-ae)},k.current.signal);typeof te=="function"&&(te=await te());let le=!1;for(const[dt,Ue]of te.entries())for(const[ne,ve]of Ue.entries()){let me;switch(ve.kind){case Z.Text:case Z.Number:me=ve.displayData;break;case Z.Uri:case Z.Markdown:me=ve.data;break;case Z.Boolean:me=typeof ve.data=="boolean"?ve.data.toString():void 0;break;case Z.Image:case Z.Bubble:me=ve.data.join("🐳");break;case Z.Custom:me=ve.copyData;break}me!==void 0&&se.test(me)&&(ue.push([ne,dt+ae]),le=!0)}const Se=performance.now();le&&I([...ue]),fe+=te.length,Pn(fe<=r);const pe=T.current?.selectedIndex??-1;x({results:ue.length,rowsSearched:fe,selectedIndex:pe}),c?.(ue,pe),ae+de>=r?ae=0:ae+=de;const et=Se-L,ke=Math.max(et,1),Dt=R0/ke;de=Math.ceil(de*Dt),fe<r&&ue.length<1e3&&(R.current=window.requestAnimationFrame(H))};F(),R.current=window.requestAnimationFrame(H)},[F,i.length,u,c,r]),E=f.useCallback(()=>{g?.(),x(void 0),I([]),c?.([],-1),F(),t?.current?.focus()},[F,t,g,c]),O=f.useCallback(re=>{v(re.target.value),a===void 0&&(re.target.value===""?(x(void 0),I([]),F()):S(re.target.value))},[S,F,v,a]);f.useEffect(()=>{o.current!==null&&(v(""),x(void 0),P.length>0&&(I([]),c?.([],-1)),d?o.current.focus({preventScroll:!0}):F())},[d,o]);const M=f.useCallback(re=>{if(re?.stopPropagation?.(),b===void 0||b.results===0)return;const se=(b.selectedIndex+1)%b.results;x({...b,selectedIndex:se}),c?.(C,se)},[b,c,C]),V=f.useCallback(re=>{if(re?.stopPropagation?.(),b===void 0||b.results===0)return;let se=(b.selectedIndex-1)%b.results;se<0&&(se+=b.results),x({...b,selectedIndex:se}),c?.(C,se)},[c,C,b]),W=f.useCallback(re=>{(re.ctrlKey||re.metaKey)&&re.nativeEvent.code==="KeyF"||re.key==="Escape"?(E(),re.stopPropagation(),re.preventDefault()):re.key==="Enter"&&(re.shiftKey?V():M())},[E,M,V]);f.useEffect(()=>()=>{F()},[F]);const[j,oe]=f.useState(!1);f.useEffect(()=>{if(d)oe(!0);else{const re=setTimeout(()=>oe(!1),150);return()=>clearTimeout(re)}},[d]);const Q=f.useMemo(()=>{if(!d&&!j)return null;let re;b!==void 0&&(re=b.results>=1e3?"over 1000":`${b.results} result${b.results!==1?"s":""}`,b.selectedIndex>=0&&(re=`${b.selectedIndex+1} of ${re}`));const se=fe=>{fe.stopPropagation()},de={width:`${r>0?Math.floor((b?.rowsSearched??0)/r*100):0}%`};return f.createElement(S0,{className:"gdg-search-bar"+(d?"":" out"),onMouseDown:se,onMouseMove:se,onMouseUp:se,onClick:se},f.createElement("div",{className:"gdg-search-bar-inner"},f.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:O,value:y,tabIndex:d?void 0:-1,onKeyDownCapture:W}),f.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:V,disabled:(b?.results??0)===0},x0),f.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:M,disabled:(b?.results??0)===0},k0),g!==void 0&&f.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:E},M0)),b!==void 0?f.createElement(f.Fragment,null,f.createElement("div",{className:"gdg-search-status"},f.createElement("div",{"data-testid":"search-result-area"},re)),f.createElement("div",{className:"gdg-search-progress",style:de})):f.createElement("div",{className:"gdg-search-status"},f.createElement("label",{htmlFor:h},"Type to search")))},[d,j,b,r,h,o,O,y,W,V,M,g,E]);return f.createElement(f.Fragment,null,f.createElement(C0,{prelightCells:C,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),Q)};class E0 extends f.PureComponent{wrapperRef=f.createRef();componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("pointerdown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("pointerdown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}clickOutside=t=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}};render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...i}=this.props;return f.createElement("div",{...i,ref:this.wrapperRef},this.props.children)}}const T0=()=>e=>Math.max(16,e.targetHeight-10),D0=dn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[T0(),"px"]}}),O0=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:o}=e,[s,a]=zt.useState(n);return zt.createElement(E0,{style:{position:"absolute",left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},zt.createElement(D0,{targetHeight:t.height,"data-testid":"group-rename-input",value:s,onBlur:r,onFocus:l=>l.target.setSelectionRange(0,s.length),onChange:l=>a(l.target.value),onKeyDown:l=>{l.key==="Enter"?o(s):l.key==="Escape"&&r()},autoFocus:!0}))};function P0(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function rt(e,t,n){const r=wd(e,t);return r&&(n.didMatch=!0),r}function wd(e,t){if(e.length===0)return!1;if(e.includes("|")){const l=e.split("|");for(const u of l)if(wd(u,t))return!0;return!1}let n=!1,r=!1,i=!1,o=!1;const s=e.split("+"),a=s.pop();if(!P0(a,t))return!1;if(s[0]==="any")return!0;for(const l of s)switch(l){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":i=!0;break;case"meta":o=!0;break;case"primary":ua.value?o=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===o}function L0(e,t,n,r,i,o,s){const a=zt.useCallback((c,d,g,h)=>{(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!s&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const p=n==="mixed"&&(g||h==="drag")||n==="additive",m=(r==="mixed"||r==="additive")&&p,y=(i==="mixed"||i==="additive")&&p;let v={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?e.current?.rangeStack??[]:[]},columns:m?e.columns:Qe.empty(),rows:y?e.rows:Qe.empty()};g&&(o==="multi-rect"||o==="multi-cell")&&v.current!==void 0&&e.current!==void 0&&(v={...v,current:{...v.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(v,d)},[r,e,n,o,s,i,t]),l=zt.useCallback((c,d,g)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,columns:Qe.empty(),rows:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&r==="mixed"||r==="additive";h={current:p?e.current:void 0,columns:m?e.columns:Qe.empty(),rows:c}}t(h,!1)},[r,e,n,i,t]),u=zt.useCallback((c,d,g)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,rows:Qe.empty(),columns:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&i==="mixed"||i==="additive";h={current:p?e.current:void 0,rows:m?e.rows:Qe.empty(),columns:c}}t(h,!1)},[r,e,n,i,t]);return[a,l,u]}function F0(e,t,n,r,i){const o=f.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const g=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=i?g.push({kind:Z.Loading,allowOverlay:!1}):g.push(t([h,d]));c.push(g)}return c}return e?.(u,r.signal)??[]},[r.signal,t,e,i]),s=e!==void 0?o:void 0,a=f.useCallback(u=>{if(s===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=s(c,r.signal);return typeof d=="function"?async()=>(await d()).map(g=>[{kind:Z.Loading,allowOverlay:!1},...g]):d.map(g=>[{kind:Z.Loading,allowOverlay:!1},...g])}return s(c,r.signal)},[r.signal,s,n]);return[e!==void 0?a:void 0,s]}function _0(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case Z.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===_l?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Z.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Z.Image:case Z.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Z.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Z.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Z.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Z.Markdown:case Z.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Z.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Z.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Z.Protected:return{formatted:"************",rawValue:"",format:"string"};default:lo()}}function A0(e,t){return e.map((r,i)=>{const o=t[i];return r.map(s=>s.span!==void 0&&s.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:_0(s))})}function yu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function H0(e){const t=[];for(const n of e){const r=[];for(const i of n)i.format==="url"?r.push(i.rawValue?.toString()??""):i.format==="string-array"?r.push(i.formatted.map(o=>yu(o,!0)).join(",")):r.push(i.doNotEscape===!0?i.formatted:yu(i.formatted,!1));t.push(r.join(" "))}return t.join(`
165
+ `},Hm={headerRowID:um,headerNumber:dm,headerCode:cm,headerString:fm,headerBoolean:hm,headerAudioUri:pm,headerVideoUri:mm,headerEmoji:vm,headerImage:bm,headerUri:sd,headerPhone:wm,headerMarkdown:ym,headerDate:Cm,headerTime:Sm,headerEmail:xm,headerReference:km,headerIfThenElse:Mm,headerSingleValue:Rm,headerLookup:Im,headerTextTemplate:Em,headerMath:Tm,headerRollup:Dm,headerJoinStrings:Om,headerSplitString:Pm,headerGeoDistance:Lm,headerArray:Fm,rowOwnerOverlay:_m,protectedColumnOverlay:Am,renameIcon:gm};function zm(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Vm{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(t,n){this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,i,o,s,a,l=1){const[u,c]=zm(n,a),d=s*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(g);if(h===void 0){const p=this.headerIcons[t];if(p===void 0)return;h=document.createElement("canvas");const m=h.getContext("2d");if(m===null)return;const y=new Image;y.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,h);const v=y.decode();if(v===void 0)return;this.inFlight++,v.then(()=>{m.drawImage(y,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else l<1&&(r.globalAlpha=l),r.drawImage(h,0,0,d,d,i,o,s,s),l<1&&(r.globalAlpha=1)}}function ud(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y);return t}function Ca(e,t,n,r,i,o,s,a,l){a=a??t;let u=t,c=e;const d=r-o;let g=!1;for(;u<n&&c<d;){const h=i(c);if(u+h>a&&l(u,c,h,!1,s&&c===r-1)===!0){g=!0;break}u+=h,c++}if(!g){u=n;for(let h=0;h<o;h++){c=r-1-h;const p=i(c);u-=p,l(u,c,p,!0,s&&c===r-1)}}}function Er(e,t,n,r,i,o){let s=0,a=0;const l=i+r;for(const u of e){const c=u.sticky?a:s+n;if(o(u,c,l,u.sticky?0:a,t)===!0)break;s+=u.width,a+=u.sticky?u.width:0}}function cd(e,t,n,r,i){let o=0,s=0;for(let a=0;a<e.length;a++){const l=e[a];let u=a+1,c=l.width;for(l.sticky&&(s+=c);u<e.length&&uo(e[u].group,l.group)&&e[u].sticky===e[a].sticky;){const m=e[u];c+=m.width,u++,a++,m.sticky&&(s+=m.width)}const d=l.sticky?0:n,g=o+d,h=l.sticky?0:Math.max(0,s-g),p=Math.min(c-h,t-(g+h));i([l.sourceIndex,e[u-1].sourceIndex],l.group??"",g+h,0,p,r),o+=c}}function dd(e,t,n,r,i,o,s){const[a,l]=e;let u,c;const d=s.find(g=>!g.sticky)?.sourceIndex??0;if(l>d){const g=Math.max(a,d);let h=t,p=r;for(let m=o.sourceIndex-1;m>=g;m--)h-=s[m].width,p+=s[m].width;for(let m=o.sourceIndex+1;m<=l;m++)p+=s[m].width;c={x:h,y:n,width:p,height:i}}if(d>a){const g=Math.min(l,d-1);let h=t,p=r;for(let m=o.sourceIndex-1;m>=a;m--)h-=s[m].width,p+=s[m].width;for(let m=o.sourceIndex+1;m<=g;m++)p+=s[m].width;u={x:h,y:n,width:p,height:i}}return[u,c]}function $m(e,t,n,r){if(r==="any")return fd(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),qc([t,n],e))return;const i=t-e.x,o=e.x+e.width-t,s=n-e.y+1,a=e.y+e.height-n,l=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="horizontal"?Number.MAX_SAFE_INTEGER:s,r==="horizontal"?Number.MAX_SAFE_INTEGER:a);return l===a?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:l===s?{x:e.x,y:n,width:e.width,height:e.y-n}:l===o?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function co(e,t,n,r,i,o,s,a){return e<=i+s&&i<=e+n&&t<=o+a&&o<=t+r}function Br(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function fd(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:i,height:o}}function Nm(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Bm(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const i=-4,o=-4,s=t+4,a=n+4,l=i-e.x,u=e.x+e.width-s,c=o-e.y,d=e.y+e.height-a,g=l>0?e.x+Math.floor(l/r)*r:e.x,h=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,p=c>0?e.y+Math.floor(c/r)*r:e.y,m=d>0?e.y+e.height-Math.floor(d/r)*r:e.y+e.height;return{x:g,y:p,width:h-g,height:m-p}}function Wm(e,t,n,r,i){const[o,s,a,l]=t,[u,c,d,g]=i,{x:h,y:p,width:m,height:y}=e,v=[];if(m<=0||y<=0)return v;const b=h+m,x=p+y,T=h<o,k=p<s,R=h+m>a,P=p+y>l,I=h>=o&&h<a||b>o&&b<=a||h<o&&b>a,C=p>=s&&p<l||x>s&&x<=l||p<s&&x>l;if(I&&C){const D=Math.max(h,o),S=Math.max(p,s),E=Math.min(b,a),O=Math.min(x,l);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:u,y:c,width:d-u+1,height:g-c+1}})}if(T&&k){const D=h,S=p,E=Math.min(b,o),O=Math.min(x,s);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:0,y:0,width:u+1,height:c+1}})}if(k&&I){const D=Math.max(h,o),S=p,E=Math.min(b,a),O=Math.min(x,s);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(k&&R){const D=Math.max(h,a),S=p,E=b,O=Math.min(x,s);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(T&&C){const D=h,S=Math.max(p,s),E=Math.min(b,o),O=Math.min(x,l);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(R&&C){const D=Math.max(h,a),S=Math.max(p,s),E=b,O=Math.min(x,l);v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:d,y:c,width:n-d+1,height:g-c+1}})}if(T&&P){const D=h,S=Math.max(p,l),E=Math.min(b,o),O=x;v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(P&&I){const D=Math.max(h,o),S=Math.max(p,l),E=Math.min(b,a),O=x;v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:u,y:g,width:d-u+1,height:r-g+1}})}if(R&&P){const D=Math.max(h,a),S=Math.max(p,l),E=b,O=x;v.push({rect:{x:D,y:S,width:E-D,height:O-S},clip:{x:d,y:g,width:n-d+1,height:r-g+1}})}return v}const Um={kind:Z.Loading,allowOverlay:!1};function gu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v,b,x,T,k,R,P,I,C,F,D,S,E,O,M,V,W,j){let oe=x?.size??Number.MAX_SAFE_INTEGER;const Q=performance.now();let re=E.baseFontFull;e.font=re;const se={ctx:e},ae=[0,0],de=y>0?Xr(l,y,u):0;let fe,ue;const H=ud(b);return Er(t,a,o,s,i,(L,X,te,le,Se)=>{const pe=Math.max(0,le-X),et=X+pe,ke=i+1,Dt=L.width-pe,dt=r-i-1;if(b.length>0){let _e=!1;for(let Oe=0;Oe<b.length;Oe++){const at=b[Oe];if(co(et,ke,Dt,dt,at.x,at.y,at.width,at.height)){_e=!0;break}}if(!_e)return}const Ue=()=>{e.save(),e.beginPath(),e.rect(et,ke,Dt,dt),e.clip()},ne=T.columns.hasIndex(L.sourceIndex),ve=d(L.group??"").overrideTheme,me=L.themeOverride===void 0&&ve===void 0?E:cr(E,ve,L.themeOverride),he=me.baseFontFull;he!==re&&(re=he,e.font=he),Ue();let Ce;return Ca(Se,te,r,l,u,y,v,H,(_e,Oe,at,Pe,we)=>{if(Oe<0||(ae[0]=L.sourceIndex,ae[1]=Oe,x!==void 0&&!x.has(ae)))return;if(b.length>0){let De=!1;for(let mt=0;mt<b.length;mt++){const xt=b[mt];if(co(X,_e,L.width,at,xt.x,xt.y,xt.width,xt.height)){De=!0;break}}if(!De)return}const Ae=T.rows.hasIndex(Oe),Re=h.hasIndex(Oe),Ne=Oe<l?c(ae):Um;let ft=X,ht=L.width,Xe=!1,pt=!1;if(Ne.span!==void 0){const[De,mt]=Ne.span,xt=`${Oe},${De},${mt},${L.sticky}`;if(ue===void 0&&(ue=new Set),ue.has(xt)){oe--;return}else{const vn=dd(Ne.span,X,_e,L.width,at,L,n),tn=L.sticky?vn[0]:vn[1];if(!L.sticky&&vn[0]!==void 0&&(pt=!0),tn!==void 0){ft=tn.x,ht=tn.width,ue.add(xt),e.restore(),Ce=void 0,e.save(),e.beginPath();const nn=Math.max(0,le-tn.x);e.rect(tn.x+nn,_e,tn.width-nn,at),fe===void 0&&(fe=[]),fe.push({x:tn.x+nn,y:_e,width:tn.width-nn,height:at}),e.clip(),Xe=!0}}}const Nt=g?.(Oe),St=we&&L.trailingRowOptions?.themeOverride!==void 0?L.trailingRowOptions?.themeOverride:void 0,Tt=Ne.themeOverride===void 0&&Nt===void 0&&St===void 0?me:cr(me,Nt,St,Ne.themeOverride);e.beginPath();const Bt=Xp(ae,Ne,T);let qt=jp(ae,Ne,T,m);const an=Ne.span!==void 0&&T.columns.some(De=>Ne.span!==void 0&&De>=Ne.span[0]&&De<=Ne.span[1]);Bt&&!p&&m?qt=0:Bt&&m&&(qt=Math.max(qt,1)),an&&qt++,Bt||(Ae&&qt++,ne&&!we&&qt++);const It=Ne.kind===Z.Protected?Tt.bgCellMedium:Tt.bgCell;let gt;if((Pe||It!==E.bgCell)&&(gt=Ln(It,gt)),qt>0||Re){Re&&(gt=Ln(Tt.bgHeader,gt));for(let De=0;De<qt;De++)gt=Ln(Tt.accentLight,gt)}else if(k!==void 0){for(const De of k)if(De[0]===L.sourceIndex&&De[1]===Oe){gt=Ln(Tt.bgSearchResult,gt);break}}if(R!==void 0)for(let De=0;De<R.length;De++){const mt=R[De],xt=mt.range;mt.style!=="solid-outline"&&xt.x<=L.sourceIndex&&L.sourceIndex<xt.x+xt.width&&xt.y<=Oe&&Oe<xt.y+xt.height&&(gt=Ln(mt.color,gt))}let Wt=!1;if(x!==void 0){const De=_e+1,xt=(Pe?De+at-1:Math.min(De+at-1,r-de))-De;(xt!==at-1||ft+1<=le)&&(Wt=!0,e.save(),e.beginPath(),e.rect(ft+1,De,ht-1,xt),e.clip()),gt=gt===void 0?Tt.bgCell:Ln(gt,Tt.bgCell)}const wt=L.sourceIndex===n.length-1,ln=Oe===l-1;gt!==void 0&&(e.fillStyle=gt,Ce!==void 0&&(Ce.fillStyle=gt),x!==void 0?e.fillRect(ft+1,_e+1,ht-(wt?2:1),at-(ln?2:1)):e.fillRect(ft,_e,ht,at)),Ne.style==="faded"&&(e.globalAlpha=.6);let Mn;for(let De=0;De<C.length;De++){const mt=C[De];if(mt.item[0]===L.sourceIndex&&mt.item[1]===Oe){Mn=mt;break}}if(ht>j&&!pt){const De=Tt.baseFontFull;De!==re&&(e.font=De,re=De),Ce=hd(e,Ne,L.sourceIndex,Oe,wt,ln,ft,_e,ht,at,qt>0,Tt,gt??Tt.bgCell,P,I,Mn?.hoverAmount??0,F,S,Q,D,Ce,O,M,V,W)}return Wt&&e.restore(),Ne.style==="faded"&&(e.globalAlpha=1),oe--,Xe&&(e.restore(),Ce?.deprep?.(se),Ce=void 0,Ue(),re=he,e.font=he),oe<=0}),e.restore(),oe<=0}),fe}const Ki=[0,0],Zi={x:0,y:0,width:0,height:0},el=[void 0,()=>{}];let Ml=!1;function Gm(){Ml=!0}function hd(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v,b,x,T,k,R,P,I){let C,F;y!==void 0&&y[0][0]===n&&y[0][1]===r&&(C=y[1][0],F=y[1][1]);let D;Ki[0]=n,Ki[1]=r,Zi.x=s,Zi.y=a,Zi.width=l,Zi.height=u,el[0]=R.getValue(Ki),el[1]=M=>R.setValue(Ki,M),Ml=!1;const S={ctx:e,theme:d,col:n,row:r,cell:t,rect:Zi,highlighted:c,cellFillColor:g,hoverAmount:m,frameTime:b,hoverX:C,drawState:el,hoverY:F,imageLoader:h,spriteManager:p,hyperWrapping:v,overrideCursor:C!==void 0?I:void 0,requestAnimationFrame:Gm},E=em(S,t.lastUpdated,b,T,i,o),O=P(t);if(O!==void 0){T?.renderer!==O&&(T?.deprep?.(S),T=void 0);const M=O.drawPrep?.(S,T);x!==void 0&&!Si(S.cell)?x(S,()=>O.draw(S,t)):O.draw(S,t),D=M===void 0?void 0:{deprep:M?.deprep,fillStyle:M?.fillStyle,font:M?.font,renderer:O}}return(E||Ml)&&k?.(Ki),D}function Xl(e,t,n,r,i,o,s,a,l=-20,u=-20,c=void 0,d="center",g="square"){const h=Math.floor(i+s/2),p=g==="circle"?1e4:t.roundingRadius??4;let m=Vc(c??t.checkboxMaxSize,s,t.cellVerticalPadding),y=m/2;const v=zc(d,r,o,t.cellHorizontalPadding,m),b=Hc(v,h,m),x=$c(r+l,i+u,b);switch(n){case!0:{e.beginPath(),jn(e,v-m/2,h-m/2,m,m,p),g==="circle"&&(y*=.8,m*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(v-y+m/4.23,h-y+m/1.97),e.lineTo(v-y+m/2.42,h-y+m/1.44),e.lineTo(v-y+m/1.29,h-y+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ia:case!1:{e.beginPath(),jn(e,v-m/2+.5,h-m/2+.5,m-1,m-1,p),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break}case _l:{e.beginPath(),jn(e,v-m/2,h-m/2,m,m,p),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),g==="circle"&&(y*=.8,m*=.8),e.beginPath(),e.moveTo(v-m/3,h),e.lineTo(v+m/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:lo()}}function Ym(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v,b){const x=s+a;if(x<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,x);const T=r?.[0]?.[0],k=r?.[0]?.[1],R=r?.[1]?.[0],P=r?.[1]?.[1],I=d.headerFontFull;e.font=I,Er(t,0,o,0,x,(C,F,D,S)=>{if(y!==void 0&&!y.has([C.sourceIndex,-1]))return;const E=Math.max(0,S-F);e.save(),e.beginPath(),e.rect(F+E,a,C.width-E,s),e.clip();const O=m(C.group??"").overrideTheme,M=C.themeOverride===void 0&&O===void 0?d:cr(d,O,C.themeOverride);M.bgHeader!==d.bgHeader&&(e.fillStyle=M.bgHeader,e.fill()),M!==d&&(e.font=M.headerFontFull);const V=c.columns.hasIndex(C.sourceIndex),W=l!==void 0||u||C.headerRowMarkerDisabled===!0,j=!W&&k===-1&&T===C.sourceIndex,oe=W?0:h.find(de=>de.item[0]===C.sourceIndex&&de.item[1]===-1)?.hoverAmount??0,Q=c?.current!==void 0&&c.current.cell[0]===C.sourceIndex,re=V?M.accentColor:Q?M.bgHeaderHasFocus:M.bgHeader,se=n?a:0,ae=C.sourceIndex===0?0:1;V?(e.fillStyle=re,e.fillRect(F+ae,se,C.width-ae,s)):(Q||oe>0)&&(e.beginPath(),e.rect(F+ae,se,C.width-ae,s),Q&&(e.fillStyle=M.bgHeaderHasFocus,e.fill()),oe>0&&(e.globalAlpha=oe,e.fillStyle=M.bgHeaderHovered,e.fill(),e.globalAlpha=1)),md(e,F,se,C.width,s,C,V,M,j,j?R:void 0,j?P:void 0,Q,oe,g,v,b),e.restore()}),n&&Xm(e,t,i,o,a,r,d,g,h,p,m,y)}function Xm(e,t,n,r,i,o,s,a,l,u,c,d){const[h,p]=o?.[0]??[];let m=0;cd(t,n,r,i,(y,v,b,x,T,k)=>{if(d!==void 0&&!d.hasItemInRectangle({x:y[0],y:-2,width:y[1]-y[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(b,x,T,k),e.clip();const R=c(v),P=R?.overrideTheme===void 0?s:cr(s,R.overrideTheme),I=p===-2&&h!==void 0&&h>=y[0]&&h<=y[1],C=I?P.bgGroupHeaderHovered??P.bgHeaderHovered:P.bgGroupHeader??P.bgHeader;if(C!==s.bgHeader&&(e.fillStyle=C,e.fill()),e.fillStyle=P.textGroupHeader??P.textHeader,R!==void 0){let F=b;if(R.icon!==void 0&&(a.drawSprite(R.icon,"normal",e,F+8,(i-20)/2,20,P),F+=26),e.fillText(R.name,F+8,i/2+qn(e,s.headerFontFull)),R.actions!==void 0&&I){const D=gd({x:b,y:x,width:T,height:k},R.actions);e.beginPath();const S=D[0].x-10,E=b+T-S;e.rect(S,0,E,i);const O=e.createLinearGradient(S,0,S+E,0),M=Wr(C,0);O.addColorStop(0,M),O.addColorStop(10/E,C),O.addColorStop(1,C),e.fillStyle=O,e.fill(),e.globalAlpha=.6;const[V,W]=o?.[1]??[-1,-1];for(let j=0;j<R.actions.length;j++){const oe=R.actions[j],Q=D[j],re=Br(Q,V+b,W);re&&(e.globalAlpha=1),a.drawSprite(oe.icon,"normal",e,Q.x+Q.width/2-10,Q.y+Q.height/2-10,20,P),re&&(e.globalAlpha=.6)}e.globalAlpha=1}}b!==0&&u(y[0])&&(e.beginPath(),e.moveTo(b+.5,0),e.lineTo(b+.5,i),e.strokeStyle=s.borderColor,e.lineWidth=1,e.stroke()),e.restore(),m=b+T}),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=s.borderColor,e.lineWidth=1,e.stroke()}const No=30;function jm(e,t,n,r,i){return{x:e+n-No,y:Math.max(t,t+r/2-No/2),width:No,height:Math.min(No,r)}}function gd(e,t){const n=[];let r=e.x+e.width-26*t.length;const i=e.y+e.height/2-13,o=26,s=26;for(let a=0;a<t.length;a++)n.push({x:r,y:i,width:s,height:o}),r+=26;return n}function Ji(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function pd(e,t,n,r,i,o,s,a){const l=s.cellHorizontalPadding,u=s.headerIconSize,c=jm(n,r,i,o);let d=n+l;const g=t.icon===void 0?void 0:{x:d,y:r+(o-u)/2,width:u,height:u},h=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(d+=Math.ceil(u*1.3));const p={x:d,y:r,width:i-d,height:o};let m;if(t.indicatorIcon!==void 0){const v=e===void 0?Qc(t.title,s.headerFontFull)?.width??0:Ir(t.title,e,s.headerFontFull).width;p.width=v,d+=v+l,m={x:d,y:r+(o-u)/2,width:u,height:u}}const y=n+i/2;return{menuBounds:Ji(c,y,a),iconBounds:Ji(g,y,a),iconOverlayBounds:Ji(h,y,a),textBounds:Ji(p,y,a),indicatorIconBounds:Ji(m,y,a)}}function pu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const b=o.rowMarkerChecked;b!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const x=o.headerRowMarkerTheme!==void 0?cr(a,o.headerRowMarkerTheme):a;Xl(e,x,b,t,n,r,i,!1,void 0,void 0,a.checkboxMaxSize,"center",o.rowMarker),b!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const y=s?a.textHeaderSelected:a.textHeader,v=o.hasMenu===!0&&(l||h&&s)&&m.menuBounds!==void 0;if(o.icon!==void 0&&m.iconBounds!==void 0){let b=s?"selected":"normal";o.style==="highlight"&&(b=s?"selected":"special"),g.drawSprite(o.icon,b,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,a),o.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&g.drawSprite(o.overlayIcon,s?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,a)}if(v&&r>35){const x=p?35:r-35,T=p?35*.7:r-35*.7,k=x/r,R=T/r,P=e.createLinearGradient(t,0,t+r,0),I=Wr(y,0);P.addColorStop(p?1:0,y),P.addColorStop(k,y),P.addColorStop(R,I),P.addColorStop(p?0:1,I),e.fillStyle=P}else e.fillStyle=y;if(p&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(o.title,p?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+i/2+qn(e,a.headerFontFull)),p&&(e.textAlign="left"),o.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!v||!co(m.menuBounds.x,m.menuBounds.y,m.menuBounds.width,m.menuBounds.height,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,m.indicatorIconBounds.height))){let b=s?"selected":"normal";o.style==="highlight"&&(b=s?"selected":"special"),g.drawSprite(o.indicatorIcon,b,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,a)}if(v&&m.menuBounds!==void 0){const b=m.menuBounds,x=u!==void 0&&c!==void 0&&Br(b,u+t,c+n);if(x||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===oa.Triangle){e.beginPath();const T=b.x+b.width/2-5.5,k=b.y+b.height/2-3;im(e,[{x:T,y:k},{x:T+11,y:k},{x:T+5.5,y:k+6}],1),e.fillStyle=y,e.fill()}else if(o.menuIcon===oa.Dots){e.beginPath();const T=b.x+b.width/2,k=b.y+b.height/2;rm(e,T,k),e.fillStyle=y,e.fill()}else{const T=b.x+(b.width-a.headerIconSize)/2,k=b.y+(b.height-a.headerIconSize)/2;g.drawSprite(o.menuIcon,"normal",e,T,k,a.headerIconSize,a)}x||(e.globalAlpha=1)}}function md(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m){const y=Vl(o.title)==="rtl",v=pd(e,o,t,n,r,i,a,y);p!==void 0?p({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:i},column:o,columnIndex:o.sourceIndex,isSelected:s,hoverAmount:g,isHovered:l,hasSelectedCell:d,spriteManager:h,menuBounds:v?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>pu(e,t,n,r,i,o,s,a,l,u,c,g,h,m,y,v)):pu(e,t,n,r,i,o,s,a,l,u,c,g,h,m,y,v)}function qm(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v,b){if(v!==void 0||t[t.length-1]!==n[t.length-1])return;const x=ud(y);Er(t,l,s,a,o,(T,k,R,P,I)=>{if(T!==t[t.length-1])return;k+=T.width;const C=Math.max(k,P);C>r||(e.save(),e.beginPath(),e.rect(C,o+1,1e4,i-o-1),e.clip(),Ca(I,R,i,u,c,p,m,x,(F,D,S,E)=>{if(!E&&y.length>0&&!y.some(j=>co(k,F,1e4,S,j.x,j.y,j.width,j.height)))return;const O=g.hasIndex(D),M=h.hasIndex(D);e.beginPath();const V=d?.(D),W=V===void 0?b:cr(b,V);W.bgCell!==b.bgCell&&(e.fillStyle=W.bgCell,e.fillRect(k,F,1e4,S)),M&&(e.fillStyle=W.bgHeader,e.fillRect(k,F,1e4,S)),O&&(e.fillStyle=W.accentLight,e.fillRect(k,F,1e4,S))}),e.restore())})}function Km(e,t,n,r,i,o,s,a,l){let u=!1;for(const p of t)if(!p.sticky){u=s(p.sourceIndex);break}const c=l.horizontalBorderColor??l.borderColor,d=l.borderColor,g=u?Ei(t):0;let h;if(g!==0&&(h=cu(d,l.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=h,e.stroke()),i>0){const p=d===c&&h!==void 0?h:cu(c,l.bgCell),m=Xr(o,i,a);e.beginPath(),e.moveTo(0,r-m+.5),e.lineTo(n,r-m+.5),e.strokeStyle=p,e.stroke()}}const vd=(e,t,n)=>{let r=0,i=t,o=0,s=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),i=Math.max(i,a.x+a.width+1),o=Math.min(o,a.y-1),s=Math.max(s,a.y+a.height+1)}return{minX:r,maxX:i,minY:o,maxY:s}};function Zm(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p){const m=p.bgCell,{minX:y,maxX:v,minY:b,maxY:x}=vd(a,o,s),T=[],k=s-Xr(h,g,u);let R=l,P=n,I=0;for(;R+i<k;){const S=R+i,E=u(P);if(S>=b&&S<=x-1){const M=c?.(P)?.bgCell;M!==void 0&&M!==m&&P>=h-g&&T.push({x:y,y:S,w:v-y,h:E,color:M})}R+=E,P<h-g&&(I=R),P++}let C=0;const F=Math.min(k,x)-I;if(F>0)for(let S=0;S<t.length;S++){const E=t[S];if(E.width===0)continue;const O=E.sticky?C:C+r,M=E.themeOverride?.bgCell;M!==void 0&&M!==m&&O>=y&&O<=v&&d(S+1)&&T.push({x:O,y:I,w:E.width,h:F,color:M}),C+=E.width}if(T.length===0)return;let D;e.beginPath();for(let S=T.length-1;S>=0;S--){const E=T[S];D===void 0?D=E.color:E.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=E.color),e.rect(E.x,E.y,E.w,E.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function mu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v=!1){if(l!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,s);for(const S of l)e.rect(S.x+1,S.y+1,S.width-1,S.height-1);e.clip("evenodd")}const b=y.horizontalBorderColor??y.borderColor,x=y.borderColor,{minX:T,maxX:k,minY:R,maxY:P}=vd(a,o,s),I=[];e.beginPath();let C=.5;for(let S=0;S<t.length;S++){const E=t[S];if(E.width===0)continue;C+=E.width;const O=E.sticky?C:C+r;O>=T&&O<=k&&h(S+1)&&I.push({x1:O,y1:Math.max(u,R),x2:O,y2:Math.min(s,P),color:x})}let F=s+.5;for(let S=m-p;S<m;S++){const E=d(S);F-=E,I.push({x1:T,y1:F,x2:k,y2:F,color:b})}if(v!==!0){let S=c+.5,E=n;const O=F;for(;S+i<O;){const M=S+i;if(M>=R&&M<=P-1){const V=g?.(E);I.push({x1:T,y1:M,x2:k,y2:M,color:V?.horizontalBorderColor??V?.borderColor??b})}S+=d(E),E++}}const D=wh(I,S=>S.color);for(const S of Object.keys(D)){e.strokeStyle=S;for(const E of D[S])e.moveTo(E.x1,E.y1),e.lineTo(E.x2,E.y2);e.stroke(),e.beginPath()}l!==void 0&&e.restore()}function Jm(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y,v,b){const x=[];e.imageSmoothingEnabled=!1;const T=Math.min(i.cellYOffset,s),k=Math.max(i.cellYOffset,s);let R=0;if(typeof v=="number")R+=(k-T)*v;else for(let O=T;O<k;O++)R+=v(O);s>i.cellYOffset&&(R=-R),R+=l-i.translateY;const P=Math.min(i.cellXOffset,o),I=Math.max(i.cellXOffset,o);let C=0;for(let O=P;O<I;O++)C+=m[O].width;o>i.cellXOffset&&(C=-C),C+=a-i.translateX;const F=Ei(y);if(C!==0&&R!==0)return{regions:[]};const D=u>0?Xr(g,u,v):0,S=c-F-Math.abs(C),E=d-h-D-Math.abs(R)-1;if(S>150&&E>150){const O={sx:0,sy:0,sw:c*p,sh:d*p,dx:0,dy:0,dw:c*p,dh:d*p};if(R>0?(O.sy=(h+1)*p,O.sh=E*p,O.dy=(R+h+1)*p,O.dh=E*p,x.push({x:0,y:h,width:c,height:R+1})):R<0&&(O.sy=(-R+h+1)*p,O.sh=E*p,O.dy=(h+1)*p,O.dh=E*p,x.push({x:0,y:d+R-D,width:c,height:-R+D})),C>0?(O.sx=F*p,O.sw=S*p,O.dx=(C+F)*p,O.dw=S*p,x.push({x:F-1,y:0,width:C+2,height:d})):C<0&&(O.sx=(F-C)*p,O.sw=S*p,O.dx=F*p,O.dw=S*p,x.push({x:c+C,y:0,width:-C,height:d})),e.setTransform(1,0,0,1,0,0),b){if(F>0&&C!==0&&R===0&&(r===void 0||n?.[1]!==!1)){const M=F*p,V=d*p;e.drawImage(t,0,0,M,V,0,0,M,V)}if(D>0&&C===0&&R!==0&&(r===void 0||n?.[0]!==!1)){const M=(d-D)*p,V=c*p,W=D*p;e.drawImage(t,0,M,V,W,0,M,V,W)}}e.drawImage(t,O.sx,O.sy,O.sw,O.sh,O.dx,O.dy,O.dw,O.dh),e.scale(p,p)}return e.imageSmoothingEnabled=!0,{regions:x}}function Qm(e,t,n,r,i,o,s,a,l,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Er(l,n,r,i,a,(d,g,h,p)=>{if(d.sourceIndex===u){const m=Math.max(g,p)+1;return c.push({x:m,y:0,width:o-m,height:s}),!0}}),c}function e0(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;r<e.mappedColumns.length;r++){const i=e.mappedColumns[r],o=t.mappedColumns[r];if(Ii(i,o))continue;if(n!==void 0||i.width===o.width)return!1;const{width:s,...a}=i,{width:l,...u}=o;if(!Ii(a,u))return!1;n=r}return n===void 0?!0:n}return!0}function vu(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m){const y=p?.filter(P=>P.style!=="no-outline");if(y===void 0||y.length===0)return;const v=Ei(a),b=Xr(h,g,d),x=[l,0,a.length,h-g],T=[v,0,t,n-b],k=y.map(P=>{const I=P.range,C=P.style??"dashed";return Wm(I,x,t,n,T).map(F=>{const D=F.rect,S=xl(D.x,D.y,t,n,c,u+c,r,i,o,s,h,l,g,a,d),E=D.width===1&&D.height===1?S:xl(D.x+D.width-1,D.y+D.height-1,t,n,c,u+c,r,i,o,s,h,l,g,a,d);return D.x+D.width>=a.length&&(E.width-=1),D.y+D.height>=h&&(E.height-=1),{color:P.color,style:C,clip:F.clip,rect:Bm({x:S.x,y:S.y,width:E.x+E.width-S.x,height:E.y+E.height-S.y},t,n,8)}})}),R=()=>{e.lineWidth=1;let P=!1;for(const I of k)for(const C of I)if(C?.rect!==void 0&&co(0,0,t,n,C.rect.x,C.rect.y,C.rect.width,C.rect.height)){const F=P,D=!Nm(C.clip,C.rect);e.beginPath(),D&&(e.save(),e.rect(C.clip.x,C.clip.y,C.clip.width,C.clip.height),e.clip()),C.style==="dashed"&&!P?(e.setLineDash([5,3]),P=!0):(C.style==="solid"||C.style==="solid-outline")&&P&&(e.setLineDash([]),P=!1),e.strokeStyle=C.style==="solid-outline"?Ln(Ln(C.color,m.borderColor),m.bgCell):Wr(C.color,1),e.closePath(),e.strokeRect(C.rect.x+.5,C.rect.y+.5,C.rect.width-1,C.rect.height-1),D&&(e.restore(),P=F)}P&&e.setLineDash([])};return R(),R}function bu(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function tl(e,t,n,r,i,o,s,a,l,u,c,d,g,h,p,m,y){if(c.current===void 0)return;const v=m!==!1&&m!==void 0;if(!v)return;const b=typeof m=="object"?{...aa,...m}:aa,x=c.current.range,T=c.current.cell,k=[x.x+x.width-1,x.y+x.height-1];if(T[1]>=y&&k[1]>=y||!s.some(V=>V.sourceIndex===T[0]||V.sourceIndex===k[0]))return;const[P,I]=c.current.cell,C=g(c.current.cell),F=C.span??[P,P],D=I>=y-h,S=h>0&&!D?Xr(y,h,d)-1:0,E=k[1];let O;if(Er(s,r,i,o,u,(V,W,j,oe,Q)=>{if(V.sticky&&P>V.sourceIndex)return;const re=V.sourceIndex<F[0],se=V.sourceIndex>F[1],ae=V.sourceIndex===k[0];if(!(!ae&&(re||se)))return Ca(Q,j,n,y,d,h,p,void 0,(de,fe,ue)=>{if(fe!==I&&fe!==E)return;let H=W,L=V.width;if(C.span!==void 0){const te=dd(C.span,W,de,V.width,ue,V,a),le=V.sticky?te[0]:te[1];le!==void 0&&(H=le.x,L=le.width)}return fe===E&&ae&&v&&(O=()=>{oe>H&&!V.sticky&&(e.beginPath(),e.rect(oe,0,t-oe,n),e.clip());const te=b.size,le=te/2,Se=H+L+b.offsetX-le+.5,pe=de+ue+b.offsetY-le+.5;e.beginPath(),b.shape==="circle"?e.arc(Se+le,pe+le,le,0,Math.PI*2):e.rect(Se,pe,te,te),e.fillStyle=V.themeOverride?.accentColor??l.accentColor,e.fill(),b.outline>0&&(e.lineWidth=b.outline,e.strokeStyle=l.bgCell,b.shape==="circle"?(e.beginPath(),e.arc(Se+le,pe+le,le+b.outline/2,0,Math.PI*2),e.stroke()):e.strokeRect(Se-b.outline/2,pe-b.outline/2,te+b.outline,te+b.outline))}),O!==void 0}),O!==void 0}),O===void 0)return;const M=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-S),e.clip(),O?.(),e.restore()};return M(),M}function t0(e,t,n,r,i,o,s,a,l){l===void 0||l.size===0||(e.beginPath(),cd(t,n,o,r,(u,c,d,g,h,p)=>{l.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,g,h,p)}),Er(t,a,o,s,i,(u,c,d,g)=>{const h=Math.max(0,g-c),p=c+h+1,m=u.width-h-1;l.has([u.sourceIndex,-1])&&e.rect(p,r,m,i-r)}),e.clip())}function n0(e,t,n,r,i,o,s,a,l,u){let c=0;return Er(e,o,r,i,n,(d,g,h,p,m)=>(Ca(m,h,t,s,a,l,u,void 0,(y,v,b,x)=>{x||(c=Math.max(v,c))}),!0)),c}function wu(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:i,height:o,cellXOffset:s,cellYOffset:a,translateX:l,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:g,dragAndDropState:h,theme:p,drawFocus:m,headerHeight:y,groupHeaderHeight:v,disabledRows:b,rowHeight:x,verticalBorder:T,overrideCursor:k,isResizing:R,selection:P,fillHandle:I,freezeTrailingRows:C,rows:F,getCellContent:D,getGroupDetails:S,getRowThemeOverride:E,isFocused:O,drawHeaderCallback:M,prelightCells:V,drawCellCallback:W,highlightRegions:j,resizeCol:oe,imageLoader:Q,lastBlitData:re,hoverValues:se,hyperWrapping:ae,hoverInfo:de,spriteManager:fe,maxScaleFactor:ue,hasAppendRow:H,touchMode:L,enqueue:X,renderStateProvider:te,getCellRenderer:le,renderStrategy:Se,bufferACtx:pe,bufferBCtx:et,damage:ke,minimumCellWidth:Dt,resizeIndicator:dt}=e;if(i===0||o===0)return;const Ue=Se==="double-buffer",ne=Math.min(ue,Math.ceil(window.devicePixelRatio??1)),ve=Se!=="direct"&&e0(e,t),me=n.canvas;(me.width!==i*ne||me.height!==o*ne)&&(me.width=i*ne,me.height=o*ne,me.style.width=i+"px",me.style.height=o+"px");const he=r.canvas,Ce=d?v+y:y,_e=Ce+1;(he.width!==i*ne||he.height!==_e*ne)&&(he.width=i*ne,he.height=_e*ne,he.style.width=i+"px",he.style.height=_e+"px");const Oe=pe.canvas,at=et.canvas;Ue&&(Oe.width!==i*ne||Oe.height!==o*ne)&&(Oe.width=i*ne,Oe.height=o*ne,re.current!==void 0&&(re.current.aBufferScroll=void 0)),Ue&&(at.width!==i*ne||at.height!==o*ne)&&(at.width=i*ne,at.height=o*ne,re.current!==void 0&&(re.current.bBufferScroll=void 0));const Pe=re.current;if(ve===!0&&s===Pe?.cellXOffset&&a===Pe?.cellYOffset&&l===Pe?.translateX&&u===Pe?.translateY)return;let we=null;Ue&&(we=n);const Ae=r;let Re;Ue?ke!==void 0?Re=Pe?.lastBuffer==="b"?et:pe:Re=Pe?.lastBuffer==="b"?pe:et:Re=n;const Ne=Re.canvas,ft=Ue?Ne===Oe?at:Oe:me,ht=typeof x=="number"?()=>x:x;Ae.save(),Re.save(),Ae.beginPath(),Re.beginPath(),Ae.textBaseline="middle",Re.textBaseline="middle",ne!==1&&(Ae.scale(ne,ne),Re.scale(ne,ne));const Xe=Sl(c,s,i,h,l);let pt=[];const Nt=m&&P.current?.cell[1]===a&&u===0;let St=!1;if(j!==void 0){for(const wt of j)if(wt.style!=="no-outline"&&wt.range.y===a&&u===0){St=!0;break}}const Tt=()=>{Ym(Ae,Xe,d,de,i,l,y,v,h,R,P,p,fe,se,T,S,ke,M,L),mu(Ae,Xe,a,l,u,i,o,void 0,void 0,v,Ce,ht,E,T,C,F,p,!0),Ae.beginPath(),Ae.moveTo(0,_e-.5),Ae.lineTo(i,_e-.5),Ae.strokeStyle=Ln(p.headerBottomBorderColor??p.horizontalBorderColor??p.borderColor,p.bgHeader),Ae.stroke(),St&&vu(Ae,i,o,s,a,l,u,c,g,y,v,x,C,F,j,p),Nt&&tl(Ae,i,o,a,l,u,Xe,c,p,Ce,P,ht,D,C,H,I,F)};if(ke!==void 0){const wt=Xe[Xe.length-1].sourceIndex+1,ln=ke.hasItemInRegion([{x:s,y:-2,width:wt,height:2},{x:s,y:a,width:wt,height:300},{x:0,y:a,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:s,y:F-C,width:wt,height:C,when:C>0}]),Mn=De=>{gu(De,Xe,c,o,Ce,l,u,a,F,ht,D,S,E,b,O,m,C,H,pt,ke,P,V,j,Q,fe,se,de,W,ae,p,X,te,le,k,Dt);const mt=P.current;I!==!1&&I!==void 0&&m&&mt!==void 0&&ke.has(Kc(mt.range))&&tl(De,i,o,a,l,u,Xe,c,p,Ce,P,ht,D,C,H,I,F)};ln&&(Mn(Re),we!==null&&(we.save(),we.scale(ne,ne),we.textBaseline="middle",Mn(we),we.restore()),ke.hasHeader()&&(t0(Ae,Xe,i,v,Ce,l,u,a,ke),Tt())),Re.restore(),Ae.restore();return}if((ve!==!0||s!==Pe?.cellXOffset||l!==Pe?.translateX||Nt!==Pe?.mustDrawFocusOnHeader||St!==Pe?.mustDrawHighlightRingsOnHeader)&&Tt(),ve===!0){Pn(ft!==void 0&&Pe!==void 0);const{regions:wt}=Jm(Re,ft,ft===Oe?Pe.aBufferScroll:Pe.bBufferScroll,ft===Oe?Pe.bBufferScroll:Pe.aBufferScroll,Pe,s,a,l,u,C,i,o,F,Ce,ne,c,Xe,x,Ue);pt=wt}else ve!==!1&&(Pn(Pe!==void 0),pt=Qm(Pe,s,a,l,u,i,o,Ce,Xe,ve));Km(Re,Xe,i,o,C,F,T,ht,p);const Bt=vu(Re,i,o,s,a,l,u,c,g,y,v,x,C,F,j,p),qt=m?tl(Re,i,o,a,l,u,Xe,c,p,Ce,P,ht,D,C,H,I,F):void 0;if(Re.fillStyle=p.bgCell,pt.length>0){Re.beginPath();for(const wt of pt)Re.rect(wt.x,wt.y,wt.width,wt.height);Re.clip(),Re.fill(),Re.beginPath()}else Re.fillRect(0,0,i,o);const an=gu(Re,Xe,c,o,Ce,l,u,a,F,ht,D,S,E,b,O,m,C,H,pt,ke,P,V,j,Q,fe,se,de,W,ae,p,X,te,le,k,Dt);qm(Re,Xe,c,i,o,Ce,l,u,a,F,ht,E,P.rows,b,C,H,pt,ke,p),Zm(Re,Xe,a,l,u,i,o,pt,Ce,ht,E,T,C,F,p),mu(Re,Xe,a,l,u,i,o,pt,an,v,Ce,ht,E,T,C,F,p),Bt?.(),qt?.(),R&&dt!=="none"&&Er(Xe,0,l,0,Ce,(wt,ln)=>wt.sourceIndex===oe?(bu(Ae,ln+wt.width,0,Ce+1,Ln(p.resizeIndicatorColor??p.accentLight,p.bgHeader)),dt==="full"&&bu(Re,ln+wt.width,Ce,o,Ln(p.resizeIndicatorColor??p.accentLight,p.bgCell)),!0):!1),we!==null&&(we.fillStyle=p.bgCell,we.fillRect(0,0,i,o),we.drawImage(Re.canvas,0,0));const It=n0(Xe,o,Ce,l,u,a,F,ht,C,H);Q?.setWindow({x:s,y:a,width:Xe.length,height:It-a},g,Array.from({length:C},(wt,ln)=>F-1-ln));const gt=Pe!==void 0&&(s!==Pe.cellXOffset||l!==Pe.translateX),Wt=Pe!==void 0&&(a!==Pe.cellYOffset||u!==Pe.translateY);re.current={cellXOffset:s,cellYOffset:a,translateX:l,translateY:u,mustDrawFocusOnHeader:Nt,mustDrawHighlightRingsOnHeader:St,lastBuffer:Ue?Ne===Oe?"a":"b":void 0,aBufferScroll:Ne===Oe?[gt,Wt]:Pe?.aBufferScroll,bBufferScroll:Ne===at?[gt,Wt]:Pe?.bBufferScroll},Re.restore(),Ae.restore()}const r0=80;function i0(e){const t=e-1;return t*t*t+1}class o0{callback;constructor(t){this.callback=t}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=t=>{this.leavingItems.some(r=>io(r.item,t.item))||this.leavingItems.push(t)};removeFromLeavingItems=t=>{const n=this.leavingItems.find(r=>io(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),n?.hoverAmount??0};cleanUpLeavingElements=()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)};shouldStep=()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n};getAnimatingItems=()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:i0(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const r=(t-this.lastAnimationTime)/r0;for(const o of this.leavingItems)o.hoverAmount=Vn(o.hoverAmount-r,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Vn(this.currentHoveredItem.hoverAmount+r,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=t=>{if(!io(this.currentHoveredItem?.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const n=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:n}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}}class a0{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function jl(e){return new a0(e)}const l0=jl(()=>window.navigator.userAgent.includes("Firefox")),sa=jl(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ua=jl(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function s0(e){const t=f.useRef([]),n=f.useRef(0),r=f.useRef(e);r.current=e;const i=f.useCallback(()=>{const o=()=>window.requestAnimationFrame(s),s=()=>{const a=t.current.map(Yl);t.current=[],r.current(new ao(a)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:s)},[]);return f.useCallback(o=>{t.current.length===0&&i();const s=Xn(o[0],o[1]);t.current.includes(s)||t.current.push(s)},[i])}const Sr="header",Yn="group-header",ca="out-of-bounds";var ki;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(ki||(ki={}));function bd(e,t){return e===t?!0:e?.kind==="out-of-bounds"?e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]&&e?.region[0]===t?.region[0]&&e?.region[1]===t?.region[1]:e?.kind===t?.kind&&e?.location[0]===t?.location[0]&&e?.location[1]===t?.location[1]}const u0=(e,t)=>e.kind===Z.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",c0=(e,t)=>{const{width:n,height:r,accessibilityHeight:i,columns:o,cellXOffset:s,cellYOffset:a,headerHeight:l,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:g,getCellContent:h,getRowThemeOverride:p,onHeaderMenuClick:m,onHeaderIndicatorClick:y,enableGroups:v,isFilling:b,onCanvasFocused:x,onCanvasBlur:T,isFocused:k,selection:R,freezeColumns:P,onContextMenu:I,freezeTrailingRows:C,fixedShadowX:F=!0,fixedShadowY:D=!0,drawFocusRing:S,onMouseDown:E,onMouseUp:O,onMouseMoveRaw:M,onMouseMove:V,onItemHovered:W,dragAndDropState:j,firstColAccessible:oe,onKeyDown:Q,onKeyUp:re,highlightRegions:se,canvasRef:ae,onDragStart:de,onDragEnd:fe,eventTargetRef:ue,isResizing:H,resizeColumn:L,isDragging:X,isDraggable:te=!1,allowResize:le,disabledRows:Se,hasAppendRow:pe,getGroupDetails:et,theme:ke,prelightCells:Dt,headerIcons:dt,verticalBorder:Ue,drawCell:ne,drawHeader:ve,onCellFocused:me,onDragOverCell:he,onDrop:Ce,onDragLeave:_e,imageWindowLoader:Oe,smoothScrollX:at=!1,smoothScrollY:Pe=!1,experimental:we,getCellRenderer:Ae,resizeIndicator:Re="full"}=e,Ne=e.translateX??0,ft=e.translateY??0,ht=Math.max(P,Math.min(o.length-1,s)),Xe=f.useRef(null),pt=f.useRef(we?.eventTarget??window),Nt=pt.current,St=Oe,Tt=f.useRef(),[Bt,qt]=f.useState(!1),an=f.useRef([]),It=f.useRef(),[gt,Wt]=f.useState(),[wt,ln]=f.useState(),Mn=f.useRef(null),[De,mt]=f.useState(),[xt,vn]=f.useState(!1),tn=f.useRef(xt);tn.current=xt;const nn=f.useMemo(()=>new Vm(dt,()=>{rn.current=void 0,yn.current()}),[dt]),un=v?c+l:l,$t=f.useRef(-1),Zt=(we?.enableFirefoxRescaling??!1)&&l0.value,Ge=(we?.enableSafariRescaling??!1)&&sa.value;f.useLayoutEffect(()=>{window.devicePixelRatio===1||!Zt&&!Ge||($t.current!==-1&&qt(!0),window.clearTimeout($t.current),$t.current=window.setTimeout(()=>{qt(!1),$t.current=-1},200))},[a,ht,Ne,ft,Zt,Ge]);const kt=Gp(o,P),In=f.useMemo(()=>F?Ei(kt,j):0,[kt,j,F]),Ot=f.useCallback(($,ee,xe)=>{const Te=$.getBoundingClientRect();if(ee>=kt.length||xe>=g)return;const ce=Te.width/n,ge=xl(ee,xe,n,r,c,un,ht,a,Ne,ft,g,P,C,kt,d);return ce!==1&&(ge.x*=ce,ge.y*=ce,ge.width*=ce,ge.height*=ce),ge.x+=Te.x,ge.y+=Te.y,ge},[n,r,c,un,ht,a,Ne,ft,g,P,C,kt,d]),bt=f.useCallback(($,ee,xe,Te)=>{const ce=$.getBoundingClientRect(),ge=ce.width/n,Ye=(ee-ce.left)/ge,Me=(xe-ce.top)/ge,Ze=5,vt=Sl(kt,ht,n,void 0,Ne);let sn=0,Ut=0;const Mt=typeof PointerEvent<"u"&&Te instanceof PointerEvent&&Te.pointerType==="mouse"||typeof MouseEvent<"u"&&Te instanceof MouseEvent,lt=typeof PointerEvent<"u"&&Te instanceof PointerEvent&&Te.pointerType==="touch"||typeof TouchEvent<"u"&&Te instanceof TouchEvent;Mt&&(sn=Te.button,Ut=Te.buttons);const qe=qp(Ye,vt,Ne),st=Kp(Me,r,v,l,c,g,d,a,ft,C),At=Te?.shiftKey===!0,oi=Te?.ctrlKey===!0,Pr=Te?.metaKey===!0,Jt=[Ye<0?-1:n<Ye?1:0,Me<un?-1:r<Me?1:0];let on;if(qe===-1||Me<0||Ye<0||st===void 0||Ye>n||Me>r){const Lt=Ye>n?1:Ye<0?-1:0,Hn=Me>r?1:Me<0?-1:0;let fn=Lt*2,ai=Hn*2;Lt===0&&(fn=qe===-1?ki.EndPadding:ki.Center),Hn===0&&(ai=st===void 0?ki.EndPadding:ki.Center);let lr=!1;if(qe===-1&&st===-1){const Qt=Ot($,kt.length-1,-1);Pn(Qt!==void 0),lr=ee<Qt.x+Qt.width+Ze}const tt=Ye>n&&Ye<n+bl()||Me>r&&Me<r+bl();on={kind:ca,location:[qe!==-1?qe:Ye<0?0:kt.length-1,st??g-1],region:[fn,ai],shiftKey:At,ctrlKey:oi,metaKey:Pr,isEdge:lr,isTouch:lt,button:sn,buttons:Ut,scrollEdge:Jt,isMaybeScrollbar:tt}}else if(st<=-1){let Lt=Ot($,qe,st);Pn(Lt!==void 0);let Hn=Lt!==void 0&&Lt.x+Lt.width-ee<=Ze;const fn=qe-1;ee-Lt.x<=Ze&&fn>=0?(Hn=!0,Lt=Ot($,fn,st),Pn(Lt!==void 0),on={kind:v&&st===-2?Yn:Sr,location:[fn,st],bounds:Lt,group:kt[fn].group??"",isEdge:Hn,shiftKey:At,ctrlKey:oi,metaKey:Pr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:sn,buttons:Ut,scrollEdge:Jt}):on={kind:v&&st===-2?Yn:Sr,group:kt[qe].group??"",location:[qe,st],bounds:Lt,isEdge:Hn,shiftKey:At,ctrlKey:oi,metaKey:Pr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:sn,buttons:Ut,scrollEdge:Jt}}else{const Lt=Ot($,qe,st);Pn(Lt!==void 0);const Hn=Lt!==void 0&&Lt.x+Lt.width-ee<Ze;let fn=!1;if(u!==!1&&u!==void 0&&R.current!==void 0){const lr=typeof u=="object"?{...aa,...u}:aa,tt=lr.size,Qt=tt/2,Lr=Kc(R.current.range),pr=Ot($,Lr[0],Lr[1]);if(pr!==void 0){const sr=pr.x+pr.width+lr.offsetX-Qt+.5,Ht=pr.y+pr.height+lr.offsetY-Qt+.5;fn=Math.abs(sr-ee)<tt&&Math.abs(Ht-xe)<tt}}on={kind:"cell",location:[qe,st],bounds:Lt,isEdge:Hn,shiftKey:At,ctrlKey:oi,isFillHandle:fn,metaKey:Pr,isTouch:lt,localEventX:ee-Lt.x,localEventY:xe-Lt.y,button:sn,buttons:Ut,scrollEdge:Jt}}return on},[n,kt,ht,Ne,r,v,l,c,g,d,a,ft,C,Ot,u,R,un]),[bn]=gt??[],ir=f.useRef(()=>{}),Kn=f.useRef(gt);Kn.current=gt;const[B,Be]=f.useMemo(()=>{const $=document.createElement("canvas"),ee=document.createElement("canvas");return $.style.display="none",$.style.opacity="0",$.style.position="fixed",ee.style.display="none",ee.style.opacity="0",ee.style.position="fixed",[$.getContext("2d",{alpha:!1}),ee.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>{if(!(B===null||Be===null))return document.documentElement.append(B.canvas),document.documentElement.append(Be.canvas),()=>{B.canvas.remove(),Be.canvas.remove()}},[B,Be]);const je=f.useMemo(()=>new om,[]),Pt=Zt&&Bt?1:Ge&&Bt?2:5,Kt=we?.disableMinimumCellWidth===!0?1:10,rn=f.useRef(),En=f.useRef(null),wn=f.useRef(null),Gt=f.useCallback(()=>{const $=Xe.current,ee=Mn.current;if($===null||ee===null||(En.current===null&&(En.current=$.getContext("2d",{alpha:!1}),$.width=0,$.height=0),wn.current===null&&(wn.current=ee.getContext("2d",{alpha:!1}),ee.width=0,ee.height=0),En.current===null||wn.current===null||B===null||Be===null))return;let xe=!1;const Te=Ye=>{xe=!0,mt(Ye)},ce=rn.current,ge={headerCanvasCtx:wn.current,canvasCtx:En.current,bufferACtx:B,bufferBCtx:Be,width:n,height:r,cellXOffset:ht,cellYOffset:a,translateX:Math.round(Ne),translateY:Math.round(ft),mappedColumns:kt,enableGroups:v,freezeColumns:P,dragAndDropState:j,theme:ke,headerHeight:l,groupHeaderHeight:c,disabledRows:Se??Qe.empty(),rowHeight:d,verticalBorder:Ue,isResizing:H,resizeCol:L,isFocused:k,selection:R,fillHandle:u,drawCellCallback:ne,hasAppendRow:pe,overrideCursor:Te,maxScaleFactor:Pt,freezeTrailingRows:C,rows:g,drawFocus:S,getCellContent:h,getGroupDetails:et??(Ye=>({name:Ye})),getRowThemeOverride:p,drawHeaderCallback:ve,prelightCells:Dt,highlightRegions:se,imageLoader:St,lastBlitData:It,damage:Tt.current,hoverValues:an.current,hoverInfo:Kn.current,spriteManager:nn,scrolling:Bt,hyperWrapping:we?.hyperWrapping??!1,touchMode:xt,enqueue:ir.current,renderStateProvider:je,renderStrategy:we?.renderStrategy??(sa.value?"double-buffer":"single-buffer"),getCellRenderer:Ae,minimumCellWidth:Kt,resizeIndicator:Re};ge.damage===void 0?(rn.current=ge,wu(ge,ce)):wu(ge,void 0),!xe&&(ge.damage===void 0||ge.damage.has(Kn?.current?.[0]))&&mt(void 0)},[B,Be,n,r,ht,a,Ne,ft,kt,v,P,j,ke,l,c,Se,d,Ue,H,pe,L,k,R,u,C,g,S,Pt,h,et,p,ne,ve,Dt,se,St,nn,Bt,we?.hyperWrapping,we?.renderStrategy,xt,je,Ae,Kt,Re]),yn=f.useRef(Gt);f.useLayoutEffect(()=>{Gt(),yn.current=Gt},[Gt]),f.useLayoutEffect(()=>{(async()=>document?.fonts?.ready!==void 0&&(await document.fonts.ready,rn.current=void 0,yn.current()))()},[]);const Cn=f.useCallback($=>{Tt.current=$,yn.current(),Tt.current=void 0},[]),jr=s0(Cn);ir.current=jr;const qr=f.useCallback($=>{Cn(new ao($.map(ee=>ee.cell)))},[Cn]);St.setCallback(Cn);const[Kr,Di]=f.useState(!1),[_n,An]=bn??[],He=_n!==void 0&&An===-1&&_n>=0&&_n<kt.length&&kt[_n].headerRowMarkerDisabled!==!0,cn=_n!==void 0&&An===-2;let Rn=!1,Oi=!1,Zn=De;if(Zn===void 0&&_n!==void 0&&An!==void 0&&An>-1&&An<g){const $=h([_n,An],!0);Rn=$.kind===$n.NewRow||$.kind===$n.Marker&&$.markerKind!=="number",Oi=$.kind===Z.Boolean&&Al($),Zn=$.cursor}const wo=X?"grabbing":(wt??!1)||H?"col-resize":Kr||b?"crosshair":Zn!==void 0?Zn:He||Rn||Oi||cn?"pointer":"default",Zr=f.useMemo(()=>({contain:"strict",display:"block",cursor:wo}),[wo]),Nn=f.useRef("default"),Sn=ue?.current;Sn!=null&&Nn.current!==Zr.cursor&&(Sn.style.cursor=Nn.current=Zr.cursor);const Jr=f.useCallback(($,ee,xe,Te)=>{if(et===void 0)return;const ce=et($);if(ce.actions!==void 0){const ge=gd(ee,ce.actions);for(const[Ye,Me]of ge.entries())if(Br(Me,xe+ee.x,Te+Me.y))return ce.actions[Ye]}},[et]),or=f.useCallback(($,ee,xe,Te)=>{const ce=kt[ee];if(!X&&!H&&!(wt??!1)){const ge=Ot($,ee,-1);Pn(ge!==void 0);const Ye=pd(void 0,ce,ge.x,ge.y,ge.width,ge.height,ke,Vl(ce.title)==="rtl");if(ce.hasMenu===!0&&Ye.menuBounds!==void 0&&Br(Ye.menuBounds,xe,Te))return{area:"menu",bounds:Ye.menuBounds};if(ce.indicatorIcon!==void 0&&Ye.indicatorIconBounds!==void 0&&Br(Ye.indicatorIconBounds,xe,Te))return{area:"indicator",bounds:Ye.indicatorIconBounds}}},[kt,Ot,wt,X,H,ke]),Qr=f.useRef(0),fr=f.useRef(),ei=f.useRef(!1),ti=f.useCallback($=>{const ee=Xe.current,xe=ue?.current;if(ee===null||$.target!==ee&&$.target!==xe)return;ei.current=!0;const Te=$.clientX,ce=$.clientY;if($.target===xe&&xe!==null){const Ye=xe.getBoundingClientRect();if(Te>Ye.right||ce>Ye.bottom)return}const ge=bt(ee,Te,ce,$);fr.current=ge.location,ge.isTouch&&(Qr.current=Date.now()),tn.current!==ge.isTouch&&vn(ge.isTouch),!(ge.kind===Sr&&or(ee,ge.location[0],Te,ce)!==void 0)&&(ge.kind===Yn&&Jr(ge.group,ge.bounds,ge.localEventX,ge.localEventY)!==void 0||(E?.(ge),!ge.isTouch&&te!==!0&&te!==ge.kind&&ge.button<3&&ge.button!==1&&$.preventDefault()))},[ue,te,bt,Jr,or,E]);kn("pointerdown",ti,Nt,!1);const Tr=f.useRef(0),hr=f.useCallback($=>{const ee=Tr.current;Tr.current=Date.now();const xe=Xe.current;if(ei.current=!1,O===void 0||xe===null)return;const Te=ue?.current,ce=$.target!==xe&&$.target!==Te,ge=$.clientX,Ye=$.clientY,Me=$.pointerType==="mouse"?$.button<3:!0;let Ze=bt(xe,ge,Ye,$);Ze.isTouch&&Qr.current!==0&&Date.now()-Qr.current>500&&(Ze={...Ze,isLongTouch:!0}),ee!==0&&Date.now()-ee<(Ze.isTouch?1e3:500)&&(Ze={...Ze,isDoubleClick:!0}),tn.current!==Ze.isTouch&&vn(Ze.isTouch),!ce&&$.cancelable&&Me&&$.preventDefault();const[vt]=Ze.location,sn=or(xe,vt,ge,Ye);if(Ze.kind===Sr&&sn!==void 0){(Ze.button!==0||fr.current?.[0]!==vt||fr.current?.[1]!==-1)&&O(Ze,!0);return}else if(Ze.kind===Yn){const Ut=Jr(Ze.group,Ze.bounds,Ze.localEventX,Ze.localEventY);if(Ut!==void 0){Ze.button===0&&Ut.onClick(Ze);return}}O(Ze,ce)},[O,ue,bt,or,Jr]);kn("pointerup",hr,Nt,!1);const ni=f.useCallback($=>{const ee=Xe.current;if(ee===null)return;const xe=ue?.current,Te=$.target!==ee&&$.target!==xe;let ce,ge,Ye=!0;$ instanceof MouseEvent?(ce=$.clientX,ge=$.clientY,Ye=$.button<3):(ce=$.changedTouches[0].clientX,ge=$.changedTouches[0].clientY);const Me=bt(ee,ce,ge,$);tn.current!==Me.isTouch&&vn(Me.isTouch),!Te&&$.cancelable&&Ye&&$.preventDefault();const[Ze]=Me.location;if(Me.kind===Sr){const vt=or(ee,Ze,ce,ge);vt!==void 0&&Me.button===0&&fr.current?.[0]===Ze&&fr.current?.[1]===-1&&(vt.area==="menu"?m?.(Ze,vt.bounds):vt.area==="indicator"&&y?.(Ze,vt.bounds))}},[ue,bt,or,m,y]);kn("click",ni,Nt,!1);const Ra=f.useCallback($=>{const ee=Xe.current,xe=ue?.current;if(ee===null||$.target!==ee&&$.target!==xe||I===void 0)return;const Te=bt(ee,$.clientX,$.clientY,$);I(Te,()=>{$.cancelable&&$.preventDefault()})},[ue,bt,I]);kn("contextmenu",Ra,ue?.current??null,!1);const Pi=f.useCallback($=>{Tt.current=new ao($.map(ee=>ee.item)),an.current=$,yn.current(),Tt.current=void 0},[]),ze=f.useMemo(()=>new o0(Pi),[Pi]),Li=f.useRef(ze);Li.current=ze,f.useLayoutEffect(()=>{const $=Li.current;if(bn===void 0||bn[1]<0){$.setHovered(bn);return}const ee=h(bn,!0),xe=Ae(ee),Te=xe===void 0&&ee.kind===Z.Custom||xe?.needsHover!==void 0&&(typeof xe.needsHover=="boolean"?xe.needsHover:xe.needsHover(ee));$.setHovered(Te?bn:void 0)},[h,Ae,bn]);const yo=f.useRef(),Dr=f.useCallback($=>{const ee=Xe.current;if(ee===null)return;const xe=ue?.current,Te=$.target!==ee&&$.target!==xe,ce=bt(ee,$.clientX,$.clientY,$);if(ce.kind!=="out-of-bounds"&&Te&&!ei.current&&!ce.isTouch)return;const ge=(Me,Ze)=>{Wt(vt=>vt===Me||vt?.[0][0]===Me?.[0][0]&&vt?.[0][1]===Me?.[0][1]&&(vt?.[1][0]===Me?.[1][0]&&vt?.[1][1]===Me?.[1][1]||!Ze)?vt:Me)};if(!bd(ce,yo.current))mt(void 0),W?.(ce),ge(ce.kind===ca?void 0:[ce.location,[ce.localEventX,ce.localEventY]],!0),yo.current=ce;else if(ce.kind==="cell"||ce.kind===Sr||ce.kind===Yn){let Me=!1,Ze=!0;if(ce.kind==="cell"){const sn=h(ce.location);Ze=Ae(sn)?.needsHoverPosition??sn.kind===Z.Custom,Me=Ze}else Me=!0;const vt=[ce.location,[ce.localEventX,ce.localEventY]];ge(vt,Ze),Kn.current=vt,Me&&Cn(new ao([ce.location]))}const Ye=ce.location[0]>=(oe?0:1);ln(ce.kind===Sr&&ce.isEdge&&Ye&&le===!0),Di(ce.kind==="cell"&&ce.isFillHandle),M?.($),V(ce)},[ue,bt,oe,le,M,V,W,h,Ae,Cn]);kn("pointermove",Dr,Nt,!0);const Ia=f.useCallback($=>{const ee=Xe.current;if(ee===null)return;let xe,Te;R.current!==void 0&&(xe=Ot(ee,R.current.cell[0],R.current.cell[1]),Te=R.current.cell),Q?.({bounds:xe,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:Te})},[Q,R,Ot]),Jn=f.useCallback($=>{const ee=Xe.current;if(ee===null)return;let xe,Te;R.current!==void 0&&(xe=Ot(ee,R.current.cell[0],R.current.cell[1]),Te=R.current.cell),re?.({bounds:xe,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:Te})},[re,R,Ot]),Fi=f.useCallback($=>{if(Xe.current=$,ae!==void 0&&(ae.current=$),we?.eventTarget)pt.current=we.eventTarget;else if($===null)pt.current=window;else{const ee=$.getRootNode();ee===document&&(pt.current=window),pt.current=ee}},[ae,we?.eventTarget]),Co=f.useCallback($=>{const ee=Xe.current;if(ee===null||te===!1||H){$.preventDefault();return}let xe,Te;const ce=bt(ee,$.clientX,$.clientY);if(te!==!0&&ce.kind!==te){$.preventDefault();return}const ge=(Ut,Mt)=>{xe=Ut,Te=Mt};let Ye,Me,Ze;const vt=(Ut,Mt,lt)=>{Ye=Ut,Me=Mt,Ze=lt};let sn=!1;if(de?.({...ce,setData:ge,setDragImage:vt,preventDefault:()=>sn=!0,defaultPrevented:()=>sn}),!sn&&xe!==void 0&&Te!==void 0&&$.dataTransfer!==null)if($.dataTransfer.setData(xe,Te),$.dataTransfer.effectAllowed="copyLink",Ye!==void 0&&Me!==void 0&&Ze!==void 0)$.dataTransfer.setDragImage(Ye,Me,Ze);else{const[Ut,Mt]=ce.location;if(Mt!==void 0){const lt=document.createElement("canvas"),qe=Ot(ee,Ut,Mt);Pn(qe!==void 0);const st=Math.ceil(window.devicePixelRatio??1);lt.width=qe.width*st,lt.height=qe.height*st;const At=lt.getContext("2d");At!==null&&(At.scale(st,st),At.textBaseline="middle",Mt===-1?(At.font=ke.headerFontFull,At.fillStyle=ke.bgHeader,At.fillRect(0,0,lt.width,lt.height),md(At,0,0,qe.width,qe.height,kt[Ut],!1,ke,!1,void 0,void 0,!1,0,nn,ve,!1)):(At.font=ke.baseFontFull,At.fillStyle=ke.bgCell,At.fillRect(0,0,lt.width,lt.height),hd(At,h([Ut,Mt]),0,Mt,!1,!1,0,0,qe.width,qe.height,!1,ke,ke.bgCell,St,nn,1,void 0,!1,0,void 0,void 0,void 0,je,Ae,()=>{}))),lt.style.left="-100%",lt.style.position="absolute",lt.style.width=`${qe.width}px`,lt.style.height=`${qe.height}px`,document.body.append(lt),$.dataTransfer.setDragImage(lt,qe.width/2,qe.height/2),window.setTimeout(()=>{lt.remove()},0)}}else $.preventDefault()},[te,H,bt,de,Ot,ke,kt,nn,ve,h,St,je,Ae]);kn("dragstart",Co,ue?.current??null,!1,!1);const ri=f.useRef(),Ea=f.useCallback($=>{const ee=Xe.current;if(Ce!==void 0&&$.preventDefault(),ee===null||he===void 0)return;const xe=bt(ee,$.clientX,$.clientY),[Te,ce]=xe.location,ge=Te-(oe?0:1),[Ye,Me]=ri.current??[];(Ye!==ge||Me!==ce)&&(ri.current=[ge,ce],he([ge,ce],$.dataTransfer))},[oe,bt,he,Ce]);kn("dragover",Ea,ue?.current??null,!1,!1);const Ta=f.useCallback(()=>{ri.current=void 0,fe?.()},[fe]);kn("dragend",Ta,ue?.current??null,!1,!1);const Qn=f.useCallback($=>{const ee=Xe.current;if(ee===null||Ce===void 0)return;$.preventDefault();const xe=bt(ee,$.clientX,$.clientY),[Te,ce]=xe.location,ge=Te-(oe?0:1);Ce([ge,ce],$.dataTransfer)},[oe,bt,Ce]);kn("drop",Qn,ue?.current??null,!1,!1);const gr=f.useCallback(()=>{_e?.()},[_e]);kn("dragleave",gr,ue?.current??null,!1,!1);const Tn=f.useRef(R);Tn.current=R;const G=f.useRef(null),_t=f.useCallback($=>{Xe.current===null||!Xe.current.contains(document.activeElement)||($===null&&Tn.current.current!==void 0?ae?.current?.focus({preventScroll:!0}):$!==null&&$.focus({preventScroll:!0}),G.current=$)},[ae]);f.useImperativeHandle(t,()=>({focus:()=>{const $=G.current;$===null||!document.contains($)?ae?.current?.focus({preventScroll:!0}):$.focus({preventScroll:!0})},getBounds:($,ee)=>{if(!(ae===void 0||ae.current===null))return Ot(ae.current,$??0,ee??-1)},damage:qr,getMouseArgsForPosition:($,ee,xe)=>{if(!(ae===void 0||ae.current===null))return bt(ae.current,$,ee,xe)}}),[ae,qr,Ot,bt]);const ar=f.useRef(),Da=cp(()=>{if(n<50||we?.disableAccessibilityTree===!0)return null;let $=Sl(kt,ht,n,j,Ne);const ee=oe?0:-1;!oe&&$[0]?.sourceIndex===0&&($=$.slice(1));const[xe,Te]=R.current?.cell??[],ce=R.current?.range,ge=$.map(Me=>Me.sourceIndex),Ye=kr(a,Math.min(g,a+i));return xe!==void 0&&Te!==void 0&&!(ge.includes(xe)&&Ye.includes(Te))&&_t(null),f.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":kt.length+ee},f.createElement("thead",{role:"rowgroup"},f.createElement("tr",{role:"row","aria-rowindex":1},$.map(Me=>f.createElement("th",{role:"columnheader","aria-selected":R.columns.hasIndex(Me.sourceIndex),"aria-colindex":Me.sourceIndex+1+ee,tabIndex:-1,onFocus:Ze=>{if(Ze.target!==G.current)return me?.([Me.sourceIndex,-1])},key:Me.sourceIndex},Me.title)))),f.createElement("tbody",{role:"rowgroup"},Ye.map(Me=>f.createElement("tr",{role:"row","aria-selected":R.rows.hasIndex(Me),key:Me,"aria-rowindex":Me+2},$.map(Ze=>{const vt=Ze.sourceIndex,sn=Xn(vt,Me),Ut=xe===vt&&Te===Me,Mt=ce!==void 0&&vt>=ce.x&&vt<ce.x+ce.width&&Me>=ce.y&&Me<ce.y+ce.height,lt=`glide-cell-${vt}-${Me}`,qe=[vt,Me],st=h(qe,!0);return f.createElement("td",{key:sn,role:"gridcell","aria-colindex":vt+1+ee,"aria-selected":Mt,"aria-readonly":Si(st)||!yi(st),id:lt,"data-testid":lt,onClick:()=>{const At=ae?.current;if(At!=null)return Q?.({bounds:Ot(At,vt,Me),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:qe})},onFocusCapture:At=>{if(!(At.target===G.current||ar.current?.[0]===vt&&ar.current?.[1]===Me))return ar.current=qe,me?.(qe)},ref:Ut?_t:void 0,tabIndex:-1},u0(st,Ae))})))))},[n,kt,ht,j,Ne,g,a,i,R,_t,h,ae,Q,Ot,me],200),Or=P===0||!F?0:ht>P?1:Vn(-Ne/100,0,1),Oa=-a*32+ft,ii=D?Vn(-Oa/100,0,1):0,ms=f.useMemo(()=>{if(!Or&&!ii)return null;const $={position:"absolute",top:0,left:In,width:n-In,height:r,opacity:Or,pointerEvents:"none",transition:at?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ee={position:"absolute",top:un,left:0,width:n,height:r,opacity:ii,pointerEvents:"none",transition:Pe?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return f.createElement(f.Fragment,null,Or>0&&f.createElement("div",{id:"shadow-x",style:$}),ii>0&&f.createElement("div",{id:"shadow-y",style:ee}))},[Or,ii,In,n,at,un,r,Pe]),q=f.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return f.createElement(f.Fragment,null,f.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Ia,onKeyUp:Jn,onFocus:x,onBlur:T,ref:Fi,style:Zr},Da),f.createElement("canvas",{ref:Mn,style:q}),ms)},d0=f.memo(f.forwardRef(c0));function Qi(e,t,n,r){return Vn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const f0=e=>{const[t,n]=f.useState(),[r,i]=f.useState(),[o,s]=f.useState(),[a,l]=f.useState(),[u,c]=f.useState(!1),[d,g]=f.useState(),[h,p]=f.useState(),[m,y]=f.useState(),[v,b]=f.useState(!1),[x,T]=f.useState(),{onHeaderMenuClick:k,onHeaderIndicatorClick:R,getCellContent:P,onColumnMoved:I,onColumnResize:C,onColumnResizeStart:F,onColumnResizeEnd:D,gridRef:S,maxColumnWidth:E,minColumnWidth:O,onRowMoved:M,lockColumns:V,onColumnProposeMove:W,onMouseDown:j,onMouseUp:oe,onItemHovered:Q,onDragStart:re,canvasRef:se}=e,ae=(C??D??F)!==void 0,{columns:de,selection:fe}=e,ue=fe.columns,H=f.useCallback(ne=>{const[ve,me]=ne.location;o!==void 0&&a!==ve&&ve>=V?(c(!0),l(ve)):h!==void 0&&me!==void 0?(b(!0),y(Math.max(0,me))):r===void 0&&!u&&!v&&Q?.(ne)},[o,h,a,Q,V,r,u,v]),L=I!==void 0,X=f.useCallback(ne=>{if(ne.button===0){const[ve,me]=ne.location;if(ne.kind==="out-of-bounds"&&ne.isEdge&&ae){const he=S?.current?.getBounds(de.length-1,-1);he!==void 0&&(n(he.x),i(de.length-1))}else if(ne.kind==="header"&&ve>=V){const he=se?.current;if(ne.isEdge&&ae&&he){n(ne.bounds.x),i(ve);const _e=he.getBoundingClientRect().width/he.offsetWidth,Oe=ne.bounds.width/_e;F?.(de[ve],Oe,ve,Oe+(de[ve].growOffset??0))}else ne.kind==="header"&&L&&(g(ne.bounds.x),s(ve))}else ne.kind==="cell"&&V>0&&ve===0&&me!==void 0&&M!==void 0&&(T(ne.bounds.y),p(me))}j?.(ne)},[j,ae,V,M,S,de,L,F,se]),te=f.useCallback((ne,ve)=>{u||v||k?.(ne,ve)},[u,v,k]),le=f.useCallback((ne,ve)=>{u||v||R?.(ne,ve)},[u,v,R]),Se=f.useRef(-1),pe=f.useCallback(()=>{Se.current=-1,p(void 0),y(void 0),T(void 0),b(!1),s(void 0),l(void 0),g(void 0),c(!1),i(void 0),n(void 0)},[]),et=f.useCallback((ne,ve)=>{if(ne.button===0){if(r!==void 0){if(ue?.hasIndex(r)===!0)for(const he of ue){if(he===r)continue;const Ce=de[he],_e=Qi(Ce,Se.current,O,E);C?.(Ce,_e,he,_e+(Ce.growOffset??0))}const me=Qi(de[r],Se.current,O,E);if(D?.(de[r],me,r,me+(de[r].growOffset??0)),ue.hasIndex(r))for(const he of ue){if(he===r)continue;const Ce=de[he],_e=Qi(Ce,Se.current,O,E);D?.(Ce,_e,he,_e+(Ce.growOffset??0))}}pe(),o!==void 0&&a!==void 0&&W?.(o,a)!==!1&&I?.(o,a),h!==void 0&&m!==void 0&&M?.(h,m)}oe?.(ne,ve)},[oe,r,o,a,h,m,ue,D,de,O,E,C,I,M,pe,W]),ke=f.useMemo(()=>{if(!(o===void 0||a===void 0)&&o!==a&&W?.(o,a)!==!1)return{src:o,dest:a}},[o,a,W]),Dt=f.useCallback(ne=>{const ve=se?.current;if(o!==void 0&&d!==void 0)Math.abs(ne.clientX-d)>20&&c(!0);else if(h!==void 0&&x!==void 0)Math.abs(ne.clientY-x)>20&&b(!0);else if(r!==void 0&&t!==void 0&&ve){const he=ve.getBoundingClientRect().width/ve.offsetWidth,Ce=(ne.clientX-t)/he,_e=de[r],Oe=Qi(_e,Ce,O,E);if(C?.(_e,Oe,r,Oe+(_e.growOffset??0)),Se.current=Ce,ue?.first()===r)for(const at of ue){if(at===r)continue;const Pe=de[at],we=Qi(Pe,Se.current,O,E);C?.(Pe,we,at,we+(Pe.growOffset??0))}}},[o,d,h,x,r,t,de,O,E,C,ue,se]),dt=f.useCallback((ne,ve)=>{if(h===void 0||m===void 0)return P(ne,ve);let[me,he]=ne;return he===m?he=h:(he>m&&(he-=1),he>=h&&(he+=1)),P([me,he],ve)},[h,m,P]),Ue=f.useCallback(ne=>{re?.(ne),ne.defaultPrevented()||pe()},[pe,re]);return f.createElement(d0,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:dt,isResizing:r!==void 0,onHeaderMenuClick:te,onHeaderIndicatorClick:le,isDragging:u,onItemHovered:H,onDragStart:Ue,onMouseDown:X,allowResize:ae,onMouseUp:et,dragAndDropState:ke,onMouseMoveRaw:Dt,ref:S})};function h0(e){const t=f.useRef(null),[n,r]=f.useState({width:e?.[0],height:e?.[1]});return f.useLayoutEffect(()=>{const i=s=>{for(const a of s){const{width:l,height:u}=a&&a.contentRect||{};r(c=>c.width===l&&c.height===u?c:{width:l,height:u})}},o=new window.ResizeObserver(i);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const g0=(e,t,n)=>{const r=f.useRef(null),i=f.useRef(null),o=f.useRef(null),s=f.useRef(0),a=f.useRef(t);a.current=t;const l=n.current;f.useEffect(()=>{const u=()=>{if(i.current===!1&&l!==null){const g=[l.scrollLeft,l.scrollTop];if(o.current?.[0]===g[0]&&o.current?.[1]===g[1])if(s.current>10){o.current=null,i.current=null;return}else s.current++;else s.current=0,a.current(g[0],g[1]),o.current=g;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{i.current=!0,o.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},d=g=>{g.touches.length===0&&(i.current=!1,s.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&l!==null){const g=l;return g.addEventListener("touchstart",c),g.addEventListener("touchend",d),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",d),r.current!==null&&window.clearTimeout(r.current)}}},[e,l])},p0=()=>e=>e.isSafari?"scroll":"auto",m0=dn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[p0()]}}),v0=33554400,b0=5e6;function w0(e){const[t,n]=f.useState(!1),r=typeof window>"u"?null:window,i=f.useRef(0);return kn("touchstart",f.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),kn("touchend",f.useCallback(o=>{o.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const y0=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:o,draggable:s,className:a,preventDiagonalScrolling:l=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:g,kineticScrollPerfHack:h=!1,scrollRef:p,initialSize:m}=e,y=[],v=g?.sticky??!1,b=g?.fill??!1,x=f.useRef(0),T=f.useRef(0),k=f.useRef(null),R=typeof window>"u"?1:window.devicePixelRatio,P=f.useRef(R);f.useEffect(()=>{if(P.current!==R){x.current=0,T.current=0,P.current=R;const fe=k.current;fe!==null&&M.current(fe.scrollLeft,fe.scrollTop)}},[R]);const I=f.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),C=f.useRef(null),F=w0(200),[D,S]=f.useState(!0),E=f.useRef(0);f.useLayoutEffect(()=>{if(!D||F||I.current.lockDirection===void 0)return;const fe=k.current;if(fe===null)return;const[ue,H]=I.current.lockDirection;ue!==void 0?fe.scrollLeft=ue:H!==void 0&&(fe.scrollTop=H),I.current.lockDirection=void 0},[F,D]);const O=f.useCallback((fe,ue)=>{const H=k.current;if(H===null)return;ue=ue??H.scrollTop,fe=fe??H.scrollLeft;const L=I.current.scrollTop,X=I.current.scrollLeft,te=fe-X,le=ue-L;F&&te!==0&&le!==0&&(Math.abs(te)>3||Math.abs(le)>3)&&l&&I.current.lockDirection===void 0&&(I.current.lockDirection=Math.abs(te)<Math.abs(le)?[X,void 0]:[void 0,L]);const Se=I.current.lockDirection;fe=Se?.[0]??fe,ue=Se?.[1]??ue,I.current.scrollLeft=fe,I.current.scrollTop=ue;const pe=H.clientWidth,et=H.clientHeight,ke=ue,Dt=T.current-ke,dt=H.scrollHeight-et;T.current=ke;let Ue;if(dt>0&&r>H.scrollHeight+5)if(Math.abs(Dt)>2e3||ke===0||ke===dt){const ne=Math.max(0,Math.min(1,ke/dt)),ve=r-et;Ue=ne*ve,x.current=Ue}else x.current-=Dt,Ue=x.current;else Ue=ke,x.current=Ue;Ue=Math.max(0,Math.min(Ue,r-et)),x.current=Ue,Se!==void 0&&(window.clearTimeout(E.current),S(!1),E.current=window.setTimeout(()=>S(!0),200)),o({x:fe,y:Ue,width:pe-c,height:et-u,paddingRight:C.current?.clientWidth??0})},[u,c,r,o,l,F]);g0(h&&sa.value,O,k);const M=f.useRef(O);M.current=O;const V=f.useRef(),W=f.useRef(!1);f.useLayoutEffect(()=>{W.current?O():W.current=!0},[O,u,c]);const j=f.useCallback(fe=>{k.current=fe,p!==void 0&&(p.current=fe)},[p]);let oe=0,Q=0;const re=Math.min(r,v0);for(y.push(f.createElement("div",{key:oe++,style:{width:i,height:0}}));Q<re;){const fe=Math.min(b0,re-Q);y.push(f.createElement("div",{key:oe++,style:{width:0,height:fe}})),Q+=fe}const{ref:se,width:ae,height:de}=h0(m);return typeof window<"u"&&(V.current?.height!==de||V.current?.width!==ae)&&(window.setTimeout(()=>M.current(),0),V.current={width:ae,height:de}),(ae??0)===0||(de??0)===0?f.createElement("div",{ref:se}):f.createElement("div",{ref:se},f.createElement(m0,{isSafari:sa.value},f.createElement("div",{className:"dvn-underlay"},t),f.createElement("div",{ref:j,style:V.current,draggable:s,onDragStart:fe=>{s||(fe.stopPropagation(),fe.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>O()},f.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},f.createElement("div",{className:"dvn-stack"},y),d!==void 0&&f.createElement(f.Fragment,null,!b&&f.createElement("div",{className:"dvn-spacer"}),f.createElement("div",{ref:C,style:{height:de,maxHeight:n-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:b?1:void 0,right:v?c??0:void 0,pointerEvents:"auto"}},d))))))},C0=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:o,enableGroups:s,freezeColumns:a,experimental:l,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:g,scrollRef:h,preventDiagonalScrolling:p,rightElement:m,rightElementProps:y,overscrollX:v,overscrollY:b,initialSize:x,smoothScrollX:T=!1,smoothScrollY:k=!1,isDraggable:R}=e,{paddingRight:P,paddingBottom:I}=l??{},[C,F]=c,D=f.useRef(),S=f.useRef(),E=f.useRef(),O=f.useRef(),M=u+Math.max(0,v??0);let V=s?i+o:i;if(typeof r=="number")V+=n*r;else for(let Q=0;Q<n;Q++)V+=r(Q);b!==void 0&&(V+=b);const W=f.useRef(),j=f.useCallback(()=>{if(W.current===void 0)return;const Q={...W.current};let re=0,se=Q.x<0?-Q.x:0,ae=0,de=0;Q.x=Q.x<0?0:Q.x;let fe=0;for(let le=0;le<a;le++)fe+=t[le].width;for(const le of t){const Se=re-fe;if(Q.x>=Se+le.width)re+=le.width,de++,ae++;else if(Q.x>Se)re+=le.width,T?se+=Se-Q.x:de++,ae++;else if(Q.x+Q.width>Se)re+=le.width,ae++;else break}let ue=0,H=0,L=0;if(typeof r=="number")k?(H=Math.floor(Q.y/r),ue=H*r-Q.y):H=Math.ceil(Q.y/r),L=Math.ceil(Q.height/r)+H,ue<0&&L++;else{let le=0;for(let Se=0;Se<n;Se++){const pe=r(Se),et=le+(k?0:pe/2);if(Q.y>=le+pe)le+=pe,H++,L++;else if(Q.y>et)le+=pe,k?ue+=et-Q.y:H++,L++;else if(Q.y+Q.height>pe/2+le)le+=pe,L++;else break}}H=Math.max(0,Math.min(H,n-1)),L=Math.max(H,Math.min(L,n));const X={x:de,y:H,width:ae-de,height:L-H},te=D.current;(te===void 0||te.y!==X.y||te.x!==X.x||te.height!==X.height||te.width!==X.width||S.current!==se||E.current!==ue||Q.width!==O.current?.[0]||Q.height!==O.current?.[1])&&(g?.({x:de,y:H,width:ae-de,height:L-H},Q.width,Q.height,Q.paddingRight??0,se,ue),D.current=X,S.current=se,E.current=ue,O.current=[Q.width,Q.height])},[t,r,n,g,a,T,k]),oe=f.useCallback(Q=>{W.current=Q,j()},[j]);return f.useEffect(()=>{j()},[j]),f.createElement(y0,{scrollRef:h,className:d,kineticScrollPerfHack:l?.kineticScrollPerfHack,preventDiagonalScrolling:p,draggable:R===!0||typeof R=="string",scrollWidth:M+(P??0),scrollHeight:V+(I??0),clientHeight:F,rightElement:m,paddingBottom:I,paddingRight:P,rightElementProps:y,update:oe,initialSize:x},f.createElement(f0,{eventTargetRef:h,width:C,height:F,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},S0=dn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),x0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),k0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),M0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),R0=10,I0=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:o,searchValue:s,searchResults:a,onSearchValueChange:l,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:g}=e,[h]=f.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[p,m]=f.useState(""),y=s??p,v=f.useCallback(re=>{m(re),l?.(re)},[l]),[b,x]=f.useState(),T=f.useRef(b);T.current=b,f.useEffect(()=>{a!==void 0&&(a.length>0?x(re=>({rowsSearched:r,results:a.length,selectedIndex:re?.selectedIndex??-1})):x(void 0))},[r,a]);const k=f.useRef();k.current===void 0&&(k.current=new AbortController);const R=f.useRef(),[P,I]=f.useState([]),C=a??P,F=f.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0),k.current!==void 0&&k.current.abort(),k.current=new AbortController},[]),D=f.useRef(n);D.current=n;const S=f.useCallback(re=>{const se=new RegExp(re.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ae=D.current,de=Math.min(10,r),fe=0;x(void 0),I([]);const ue=[],H=async()=>{if(u===void 0)return;const L=performance.now(),X=r-fe;let te=u({x:0,y:ae,width:i.length,height:Math.min(de,X,r-ae)},k.current.signal);typeof te=="function"&&(te=await te());let le=!1;for(const[dt,Ue]of te.entries())for(const[ne,ve]of Ue.entries()){let me;switch(ve.kind){case Z.Text:case Z.Number:me=ve.displayData;break;case Z.Uri:case Z.Markdown:me=ve.data;break;case Z.Boolean:me=typeof ve.data=="boolean"?ve.data.toString():void 0;break;case Z.Image:case Z.Bubble:me=ve.data.join("🐳");break;case Z.Custom:me=ve.copyData;break}me!==void 0&&se.test(me)&&(ue.push([ne,dt+ae]),le=!0)}const Se=performance.now();le&&I([...ue]),fe+=te.length,Pn(fe<=r);const pe=T.current?.selectedIndex??-1;x({results:ue.length,rowsSearched:fe,selectedIndex:pe}),c?.(ue,pe),ae+de>=r?ae=0:ae+=de;const et=Se-L,ke=Math.max(et,1),Dt=R0/ke;de=Math.ceil(de*Dt),fe<r&&ue.length<1e3&&(R.current=window.requestAnimationFrame(H))};F(),R.current=window.requestAnimationFrame(H)},[F,i.length,u,c,r]),E=f.useCallback(()=>{g?.(),x(void 0),I([]),c?.([],-1),F(),t?.current?.focus()},[F,t,g,c]),O=f.useCallback(re=>{v(re.target.value),a===void 0&&(re.target.value===""?(x(void 0),I([]),F()):S(re.target.value))},[S,F,v,a]);f.useEffect(()=>{o.current!==null&&(v(""),x(void 0),P.length>0&&(I([]),c?.([],-1)),d?o.current.focus({preventScroll:!0}):F())},[d,o]);const M=f.useCallback(re=>{if(re?.stopPropagation?.(),b===void 0||b.results===0)return;const se=(b.selectedIndex+1)%b.results;x({...b,selectedIndex:se}),c?.(C,se)},[b,c,C]),V=f.useCallback(re=>{if(re?.stopPropagation?.(),b===void 0||b.results===0)return;let se=(b.selectedIndex-1)%b.results;se<0&&(se+=b.results),x({...b,selectedIndex:se}),c?.(C,se)},[c,C,b]),W=f.useCallback(re=>{(re.ctrlKey||re.metaKey)&&re.nativeEvent.code==="KeyF"||re.key==="Escape"?(E(),re.stopPropagation(),re.preventDefault()):re.key==="Enter"&&(re.shiftKey?V():M())},[E,M,V]);f.useEffect(()=>()=>{F()},[F]);const[j,oe]=f.useState(!1);f.useEffect(()=>{if(d)oe(!0);else{const re=setTimeout(()=>oe(!1),150);return()=>clearTimeout(re)}},[d]);const Q=f.useMemo(()=>{if(!d&&!j)return null;let re;b!==void 0&&(re=b.results>=1e3?"over 1000":`${b.results} result${b.results!==1?"s":""}`,b.selectedIndex>=0&&(re=`${b.selectedIndex+1} of ${re}`));const se=fe=>{fe.stopPropagation()},de={width:`${r>0?Math.floor((b?.rowsSearched??0)/r*100):0}%`};return f.createElement(S0,{className:"gdg-search-bar"+(d?"":" out"),onMouseDown:se,onMouseMove:se,onMouseUp:se,onClick:se},f.createElement("div",{className:"gdg-search-bar-inner"},f.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:O,value:y,tabIndex:d?void 0:-1,onKeyDownCapture:W}),f.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:V,disabled:(b?.results??0)===0},x0),f.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:M,disabled:(b?.results??0)===0},k0),g!==void 0&&f.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:E},M0)),b!==void 0?f.createElement(f.Fragment,null,f.createElement("div",{className:"gdg-search-status"},f.createElement("div",{"data-testid":"search-result-area"},re)),f.createElement("div",{className:"gdg-search-progress",style:de})):f.createElement("div",{className:"gdg-search-status"},f.createElement("label",{htmlFor:h},"Type to search")))},[d,j,b,r,h,o,O,y,W,V,M,g,E]);return f.createElement(f.Fragment,null,f.createElement(C0,{prelightCells:C,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),Q)};class E0 extends f.PureComponent{wrapperRef=f.createRef();componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("pointerdown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("pointerdown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}clickOutside=t=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}};render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...i}=this.props;return f.createElement("div",{...i,ref:this.wrapperRef},this.props.children)}}const T0=()=>e=>Math.max(16,e.targetHeight-10),D0=dn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[T0(),"px"]}}),O0=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:o}=e,[s,a]=zt.useState(n);return zt.createElement(E0,{style:{position:"absolute",left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},zt.createElement(D0,{targetHeight:t.height,"data-testid":"group-rename-input",value:s,onBlur:r,onFocus:l=>l.target.setSelectionRange(0,s.length),onChange:l=>a(l.target.value),onKeyDown:l=>{l.key==="Enter"?o(s):l.key==="Escape"&&r()},autoFocus:!0}))};function P0(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function rt(e,t,n){const r=wd(e,t);return r&&(n.didMatch=!0),r}function wd(e,t){if(e.length===0)return!1;if(e.includes("|")){const l=e.split("|");for(const u of l)if(wd(u,t))return!0;return!1}let n=!1,r=!1,i=!1,o=!1;const s=e.split("+"),a=s.pop();if(!P0(a,t))return!1;if(s[0]==="any")return!0;for(const l of s)switch(l){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":i=!0;break;case"meta":o=!0;break;case"primary":ua.value?o=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===o}function L0(e,t,n,r,i,o,s){const a=zt.useCallback((c,d,g,h)=>{(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!s&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const p=n==="mixed"&&(g||h==="drag")||n==="additive",m=(r==="mixed"||r==="additive")&&p,y=(i==="mixed"||i==="additive")&&p;let v={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?e.current?.rangeStack??[]:[]},columns:m?e.columns:Qe.empty(),rows:y?e.rows:Qe.empty()};g&&(o==="multi-rect"||o==="multi-cell")&&v.current!==void 0&&e.current!==void 0&&(v={...v,current:{...v.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(v,d)},[r,e,n,o,s,i,t]),l=zt.useCallback((c,d,g)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,columns:Qe.empty(),rows:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&r==="mixed"||r==="additive";h={current:p?e.current:void 0,columns:m?e.columns:Qe.empty(),rows:c}}t(h,!1)},[r,e,n,i,t]),u=zt.useCallback((c,d,g)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,rows:Qe.empty(),columns:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&i==="mixed"||i==="additive";h={current:p?e.current:void 0,rows:m?e.rows:Qe.empty(),columns:c}}t(h,!1)},[r,e,n,i,t]);return[a,l,u]}function F0(e,t,n,r,i){const o=f.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const g=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=i?g.push({kind:Z.Loading,allowOverlay:!1}):g.push(t([h,d]));c.push(g)}return c}return e?.(u,r.signal)??[]},[r.signal,t,e,i]),s=e!==void 0?o:void 0,a=f.useCallback(u=>{if(s===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=s(c,r.signal);return typeof d=="function"?async()=>(await d()).map(g=>[{kind:Z.Loading,allowOverlay:!1},...g]):d.map(g=>[{kind:Z.Loading,allowOverlay:!1},...g])}return s(c,r.signal)},[r.signal,s,n]);return[e!==void 0?a:void 0,s]}function _0(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case Z.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===_l?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Z.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Z.Image:case Z.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Z.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Z.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Z.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Z.Markdown:case Z.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Z.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Z.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Z.Protected:return{formatted:"************",rawValue:"",format:"string"};default:lo()}}function A0(e,t){return e.map((r,i)=>{const o=t[i];return r.map(s=>s.span!==void 0&&s.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:_0(s))})}function yu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function H0(e){const t=[];for(const n of e){const r=[];for(const i of n)i.format==="url"?r.push(i.rawValue?.toString()??""):i.format==="string-array"?r.push(i.formatted.map(o=>yu(o,!0)).join(",")):r.push(i.doNotEscape===!0?i.formatted:yu(i.formatted,!1));t.push(r.join(" "))}return t.join(`
166
166
  `)}function nl(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Cu(e){return'"'+e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'}function z0(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function V0(e){const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const n of e){t.push("<tr>");for(const r of n){const i=`gdg-format="${r.format}"`;r.format==="url"?t.push(`<td ${i}><a href="${r.rawValue}">${nl(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${i}><ol>${r.formatted.map((o,s)=>`<li gdg-raw-value=${Cu(r.rawValue[s])}>`+nl(o)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${Cu(r.rawValue?.toString()??"")} ${i}>${nl(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function $0(e,t){const n=A0(e,t),r=H0(n),i=V0(n);return{textPlain:r,textHtml:i}}function Su(e){const t=document.createElement("html");t.innerHTML=e.replace(/&nbsp;/g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],i=[];let o;for(;r.length>0;){const s=r.pop();if(s===void 0)break;if(s instanceof HTMLTableElement||s.nodeName==="TBODY")r.push(...[...s.children].reverse());else if(s instanceof HTMLTableRowElement)o!==void 0&&i.push(o),o=[],r.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const a=s.cloneNode(!0),u=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,c=u?.children.length===1&&u.children[0].nodeName==="FONT",d=a.querySelectorAll("br");for(const p of d)p.replaceWith(`
167
167
  `);const g=a.getAttribute("gdg-raw-value"),h=a.getAttribute("gdg-format")??"string";if(a.querySelector("a")!==null)o?.push({rawValue:a.querySelector("a")?.getAttribute("href")??"",formatted:a.textContent??"",format:h});else if(a.querySelector("ol")!==null){const p=a.querySelectorAll("li");o?.push({rawValue:[...p].map(m=>m.getAttribute("gdg-raw-value")??""),formatted:[...p].map(m=>m.textContent??""),format:"string-array"})}else if(g!==null)o?.push({rawValue:z0(g),formatted:a.textContent??"",format:h});else{let p=a.textContent??"";c&&(p=p.replace(/\n(?!\n)/g,"")),o?.push({rawValue:p??"",formatted:p??"",format:h})}}}return o!==void 0&&i.push(o),i}function N0(e,t,n,r,i){const o=e;if(r==="allowPartial"||e.current===void 0||t===void 0)return e;let s=!1;do{if(e?.current===void 0)break;const a=e.current?.range,l=[];if(a.width>2){const d=t({x:a.x,y:a.y,width:1,height:a.height},i.signal);if(typeof d=="function")return o;l.push(...d);const g=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},i.signal);if(typeof g=="function")return o;l.push(...g)}else{const d=t({x:a.x,y:a.y,width:a.width,height:a.height},i.signal);if(typeof d=="function")return o;l.push(...d)}let u=a.x-n,c=a.x+a.width-1-n;for(const d of l)for(const g of d)g.span!==void 0&&(u=Math.min(g.span[0],u),c=Math.max(g.span[1],c));u===a.x-n&&c===a.x+a.width-1-n?s=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:a.y,width:c-u+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!s);return e}function xu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function B0(e){let t;(function(a){a[a.None=0]="None",a[a.inString=1]="inString",a[a.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],i=0,o=t.None;e=e.replace(/\r\n/g,`
168
168
  `);let s=0;for(const a of e){switch(o){case t.None:a===" "||a===`
169
169
  `?(r.push(e.slice(i,s)),i=s+1,a===`
170
170
  `&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===`
171
171
  `)&&(r.push(xu(e.slice(i,s))),i=s+1,a===`
172
- `&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(xu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function ku(e,t,n){const r=$0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function yd(e){return e!==!0}function Mu(e){return typeof e=="string"?e:`${e}px`}const W0=()=>e=>e.innerWidth,U0=()=>e=>e.innerHeight,G0=dn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[W0()],"wmyidgi-1":[U0()]}}),X0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(G0,{innerHeight:Mu(n),innerWidth:Mu(t),...i},r)},Y0=2,j0=1300;function q0(e,t,n){const r=zt.useRef(0),[i,o]=e??[0,0];zt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/j0);const d=r.current**1.618*c*Y0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function K0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=zt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,y=id();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,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const yr={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 it(e,t){return e===!0?t:e===!1?"":e}function Ru(e){const t=ua.value;return{activateCell:it(e.activateCell," |Enter|shift+Enter"),clear:it(e.clear,"any+Escape"),closeOverlay:it(e.closeOverlay,"any+Escape"),acceptOverlayDown:it(e.acceptOverlayDown,"Enter"),acceptOverlayUp:it(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:it(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:it(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:it(e.delete,t?"Backspace|Delete":"Delete"),downFill:it(e.downFill,"primary+_68"),scrollToSelectedCell:it(e.scrollToSelectedCell,"primary+Enter"),goDownCell:it(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:it(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:it(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:it(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:it(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:it(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:it(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:it(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:it(e.goToFirstCell,"primary+Home"),goToFirstColumn:it(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:it(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:it(e.goToLastCell,"primary+End"),goToLastColumn:it(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:it(e.goToLastRow,"primary+ArrowDown"),goToNextPage:it(e.goToNextPage,"PageDown"),goToPreviousPage:it(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:it(e.rightFill,"primary+_82"),search:it(e.search,"primary+f"),selectAll:it(e.selectAll,"primary+a"),selectColumn:it(e.selectColumn,"ctrl+ "),selectGrowDown:it(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:it(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:it(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:it(e.selectGrowUp,"shift+ArrowUp"),selectRow:it(e.selectRow,"shift+ "),selectToFirstCell:it(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:it(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:it(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:it(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:it(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:it(e.selectToLastRow,"primary+shift+ArrowDown")}}function Z0(e){const t=pp(e);return zt.useMemo(()=>{if(t===void 0)return Ru(yr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??yr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??yr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??yr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??yr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??yr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??yr.selectToLastCell};return Ru({...yr,...n})},[t])}function J0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function ql(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:l;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=J0(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Rl(e,t){if(t===void 0||ql.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 Q0(e,t,n,r){const i=zt.useMemo(()=>e===void 0?void 0:ql(e,t),[e,t]),o=zt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=zt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=zt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=zt.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=Cr(r??e?.themeOverride,zt.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}=Rl(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function ev(e,t){const n=zt.useMemo(()=>e===void 0?void 0:ql(e,t),[e,t]);return{getRowGroupingForPath:Sd,updateRowGroupingByPath:Cd,mapper:zt.useCallback(r=>{if(typeof r=="number")return Rl(r,n);const i=Rl(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Cd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:Cd(o.subGroups??[],i,n)}:o)}function Sd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Sd(e[n].subGroups??[],r)}function tv(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 nv(e,t,n,r,i){const[o,s]=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:s}),[r,s,o]),[l,u,c]=gp(a),d=f.useRef(i);d.current=i;const g=tv(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(l.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=(l.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:l,setVisibleRegion:u,scrollRef:g}}const rv=f.lazy(async()=>await Ll(()=>import("./data-grid-overlay-editor.CxQizSv7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url));let iv=0;function ov(e){return Ug(Os(Os(e).filter(t=>t.span!==void 0).map(t=>kr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Bo(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 Wo={kind:Z.Loading,allowOverlay:!1},Uo={columns:Qe.empty(),rows:Qe.empty(),current:void 0},av=(e,t)=>{const[n,r]=f.useState(Uo),[i,o]=f.useState(),s=f.useRef(null),a=f.useRef(null),[l,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:x,onCellClicked:T,onCellActivated:k,onFillPattern:R,onFinishedEditing:P,coercePasteValue:I,drawHeader:C,drawCell:F,editorBloom:D,onHeaderClicked:S,onColumnProposeMove:E,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:M="default",onGroupHeaderClicked:V,onCellContextMenu:W,className:j,onHeaderContextMenu:oe,getCellsForSelection:Q,onGroupHeaderContextMenu:re,onGroupHeaderRenamed:se,onCellEdited:ae,onCellsEdited:de,onSearchResultsChanged:fe,searchResults:ue,onSearchValueChange:H,searchValue:L,onKeyDown:Y,onKeyUp:te,keybindings:le,editOnType:Se=!0,onRowAppended:pe,onColumnAppended:et,onColumnMoved:ke,validateCell:Dt,highlightRegions:dt,rangeSelect:Ue="rect",columnSelect:ne="multi",rowSelect:ve="multi",rangeSelectionBlending:me="exclusive",columnSelectionBlending:he="exclusive",rowSelectionBlending:Ce="exclusive",onDelete:_e,onDragStart:Oe,onMouseMove:at,onPaste:Pe,copyHeaders:we=!1,freezeColumns:Ae=0,cellActivationBehavior:Re="second-click",rowSelectionMode:Ne="auto",columnSelectionMode:ft="auto",onHeaderMenuClick:ht,onHeaderIndicatorClick:Ye,getGroupDetails:pt,rowGrouping:Nt,onSearchClose:St,onItemHovered:Tt,onSelectionCleared:Bt,showSearch:qt,onVisibleRegionChanged:an,gridSelection:It,onGridSelectionChange:gt,minColumnWidth:Wt=50,maxColumnWidth:wt=500,maxColumnAutoWidth:ln,provideEditor:Mn,trailingRowOptions:De,freezeTrailingRows:mt=0,allowedFillDirections:xt="orthogonal",scrollOffsetX:vn,scrollOffsetY:tn,verticalBorder:nn,onDragOverCell:un,onDrop:$t,onColumnResize:Zt,onColumnResizeEnd:Ge,onColumnResizeStart:kt,customRenderers:In,fillHandle:Ot,experimental:bt,fixedShadowX:bn,fixedShadowY:ir,headerIcons:Kn,imageWindowLoader:B,initialSize:Be,isDraggable:je,onDragLeave:Pt,onRowMoved:Kt,overscrollX:rn,overscrollY:En,preventDiagonalScrolling:wn,rightElement:Gt,rightElementProps:yn,trapFocus:Cn=!1,smoothScrollX:jr,smoothScrollY:qr,scaleToRem:Kr=!1,rowHeight:Di=34,headerHeight:_n=36,groupHeaderHeight:An=_n,theme:He,isOutsideClick:cn,renderers:Rn,resizeIndicator:Oi,scrollToActiveCell:Zn=!0,drawFocusRing:Ma=!0,portalElementRef:wo}=e,Zr=Ma==="no-editor"?i===void 0:Ma,Nn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Sn=Nn?.kind??e.rowMarkers??"none",Jr=Nn?.width??e.rowMarkerWidth,or=Nn?.startIndex??e.rowMarkerStartIndex??1,Qr=Nn?.theme??e.rowMarkerTheme,fr=Nn?.headerTheme,ei=Nn?.headerAlwaysVisible,ti=ve!=="multi"||Nn?.headerDisabled===!0,Tr=Nn?.checkboxStyle??"square",hr=Math.max(Wt,20),ni=Math.max(wt,hr),Ra=Math.max(ln??ni,hr),Pi=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:ze,rowNumberMapper:Li,rowHeight:yo,getRowThemeOverride:Dr}=Q0(Nt,b,Di,h),Ia=f.useMemo(()=>Number.parseFloat(Pi.fontSize),[Pi]),{rowHeight:Jn,headerHeight:Fi,groupHeaderHeight:Co,theme:ri,overscrollX:Ea,overscrollY:Ta}=K0({groupHeaderHeight:An,headerHeight:_n,overscrollX:rn,overscrollY:En,remSize:Ia,rowHeight:yo,scaleToRem:Kr,theme:He}),Qn=Z0(le),gr=Jr??(b>1e4?48:b>1e3?44:b>100?36:32),Tn=Sn!=="none",G=Tn?1:0,_t=De!==void 0,ar=De?.sticky===!0,[Da,Or]=f.useState(!1),Oa=qt??Da,ii=f.useCallback(()=>{St!==void 0?St():Or(!1)},[St]),q=f.useMemo(()=>It===void 0?void 0:Bo(It,G),[It,G])??n,$=f.useRef();$.current===void 0&&($.current=new AbortController),f.useEffect(()=>()=>$?.current.abort(),[]);const[ee,xe]=F0(Q,x,G,$.current,ze),Te=f.useCallback((w,A,_)=>{if(Dt===void 0)return!0;const N=[w[0]-G,w[1]];return Dt?.(N,A,_)},[G,Dt]),ce=f.useRef(It),ge=f.useCallback((w,A)=>{A&&(w=N0(w,ee,G,M,$.current)),gt!==void 0?(ce.current=Bo(w,-G),gt(ce.current)):r(w)},[gt,ee,G,M]),Xe=Cr(Zt,f.useCallback((w,A,_,N)=>{Zt?.(v[_-G],A,_-G,N)},[Zt,G,v])),Me=Cr(Ge,f.useCallback((w,A,_,N)=>{Ge?.(v[_-G],A,_-G,N)},[Ge,G,v])),Ze=Cr(kt,f.useCallback((w,A,_,N)=>{kt?.(v[_-G],A,_-G,N)},[kt,G,v])),vt=Cr(C,f.useCallback((w,A)=>C?.({...w,columnIndex:w.columnIndex-G},A)??!1,[C,G])),sn=Cr(F,f.useCallback((w,A)=>F?.({...w,col:w.col-G},A)??!1,[F,G])),Ut=f.useCallback(w=>{if(_e!==void 0){const A=_e(Bo(w,-G));return typeof A=="boolean"?A:Bo(A,G)}return!0},[_e,G]),[Mt,lt,qe]=L0(q,ge,me,he,Ce,Ue,O),st=f.useMemo(()=>cr(id(),ri),[ri]),[At,oi]=f.useState([0,0,0]),Pr=f.useMemo(()=>{if(Rn===void 0)return{};const w={};for(const A of Rn)w[A.kind]=A;return w},[Rn]),Jt=f.useCallback(w=>w.kind!==Z.Custom?Pr[w.kind]:In?.find(A=>A.isMatch(w)),[In,Pr]);let{sizedColumns:on,nonGrowWidth:Lt}=sm(v,ze,xe,At[0]-(G===0?0:gr)-At[2],hr,Ra,st,Jt,$.current);Sn!=="none"&&(Lt+=gr);const Hn=f.useMemo(()=>on.some(w=>w.group!==void 0),[on]),fn=Hn?Fi+Co:Fi,ai=q.rows.length,lr=Sn==="none"?void 0:ai===0?!1:ai===ze?!0:void 0,tt=f.useMemo(()=>Sn==="none"?on:[{title:"",width:gr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Qr,rowMarker:Tr,rowMarkerChecked:lr,headerRowMarkerTheme:fr,headerRowMarkerAlwaysVisible:ei,headerRowMarkerDisabled:ti},...on],[Sn,on,gr,Qr,Tr,lr,fr,ei,ti]),Qt=f.useRef({height:1,width:1,x:0,y:0}),Lr=f.useRef(!1),{setVisibleRegion:pr,visibleRegion:sr,scrollRef:Ht}=nv(vn,tn,Jn,Qt,()=>Lr.current=!0);Qt.current=sr;const Df=sr.x+G,So=sr.y,hn=f.useRef(null),xn=f.useCallback(w=>{w===!0?hn.current?.focus():window.requestAnimationFrame(()=>{hn.current?.focus()})},[]),gn=_t?ze+1:ze,zn=f.useCallback(w=>{const A=G===0?w:w.map(N=>({...N,location:[N.location[0]-G,N.location[1]]})),_=de?.(A);if(_!==!0)for(const N of A)ae?.(N.location,N.value);return _},[ae,de,G]),[Fr,Pa]=f.useState(),xo=q.current!==void 0&&q.current.range.width*q.current.range.height>1?q.current.range:void 0,vs=Zr?q.current?.cell:void 0,ko=vs?.[0],Mo=vs?.[1],Of=f.useMemo(()=>{if((dt===void 0||dt.length===0)&&(xo??ko??Mo??Fr)===void 0)return;const w=[];if(dt!==void 0)for(const A of dt){const _=tt.length-A.range.x-G;_>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+G,width:Math.min(_,A.range.width)},style:A.style})}return Fr!==void 0&&w.push({color:Wr(st.accentColor,0),range:Fr,style:"dashed"}),xo!==void 0&&w.push({color:Wr(st.accentColor,.5),range:xo,style:"solid-outline"}),ko!==void 0&&Mo!==void 0&&w.push({color:st.accentColor,range:{x:ko,y:Mo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Fr,xo,ko,Mo,dt,tt.length,st.accentColor,G]),bs=f.useRef(tt);bs.current=tt;const Dn=f.useCallback(([w,A],_=!1)=>{const N=_t&&A===gn-1;if(w===0&&Tn){if(N)return Wo;const K=Li(A);return K===void 0?Wo:{kind:$n.Marker,allowOverlay:!1,checkboxStyle:Tr,checked:q?.rows.hasIndex(A)===!0,markerKind:Sn==="clickable-number"?"number":Sn,row:or+K,drawHandle:Kt!==void 0,cursor:Sn==="clickable-number"?"pointer":void 0}}else if(N){const z=w===G?De?.hint??"":"",U=bs.current[w];if(U?.trailingRowOptions?.disabled===!0)return Wo;{const J=U?.trailingRowOptions?.hint??z,ie=U?.trailingRowOptions?.addIcon??De?.addIcon;return{kind:$n.NewRow,hint:J,allowOverlay:!1,icon:ie}}}else{const K=w-G;if(_||bt?.strict===!0){const U=Qt.current,J=U.x>K||K>U.x+U.width||U.y>A||A>U.y+U.height||A>=Aa.current,ie=K===U.extras?.selected?.[0]&&A===U.extras?.selected[1];let ye=!1;if(U.extras?.freezeRegions!==void 0){for(const Rt of U.extras.freezeRegions)if(Br(Rt,K,A)){ye=!0;break}}if(J&&!ie&&!ye)return Wo}let z=x([K,A]);return G!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+G,z.span[1]+G]}),z}},[_t,gn,Tn,Li,Tr,q?.rows,Sn,or,Kt,G,De?.hint,De?.addIcon,bt?.strict,x]),La=f.useCallback(w=>{let A=pt?.(w)??{name:w};return se!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:_=>za({group:A.name,bounds:_.bounds})}]}),A},[pt,se]),Ro=f.useCallback(w=>{const[A,_]=w.cell,N=tt[A],X=N?.group!==void 0?La(N.group)?.overrideTheme:void 0,K=N?.themeOverride,z=Dr?.(_);o({...w,theme:cr(st,X,K,z,w.content.themeOverride)})},[Dr,tt,La,st]),li=f.useCallback((w,A,_)=>{if(q.current===void 0)return;const[N,X]=q.current.cell,K=Dn([N,X]);if(K.kind!==Z.Boolean&&K.allowOverlay){let z=K;if(_!==void 0)switch(z.kind){case Z.Number:{const U=Gg(()=>_==="-"?-0:Number.parseFloat(_),0);z={...z,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:_};break}Ro({target:w,content:z,initialValue:_,cell:[N,X],highlight:_===void 0,forceEditMode:_!==void 0,activation:A})}else K.kind===Z.Boolean&&A.inputType==="keyboard"&&K.readonly!==!0&&(zn([{location:q.current.cell,value:{...K,data:yd(K.data)}}]),hn.current?.damage([{cell:q.current.cell}]))},[Dn,q,zn,Ro]),ws=f.useCallback((w,A)=>{const _=hn.current?.getBounds(w,A);if(_===void 0||Ht.current===null)return;const N=Dn([w,A]);N.allowOverlay&&Ro({target:_,content:N,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Dn,Ht,Ro]),Xt=f.useCallback((w,A,_="both",N=0,X=0,K=void 0)=>{if(Ht.current!==null){const z=hn.current,U=a.current,J=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,ie=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,ye=typeof w!="number"&&w.unit==="px"?w.amount:void 0,Rt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(z!==null&&U!==null){let Je={x:0,y:0,width:0,height:0},Ke=0,ut=0;if((J!==void 0||ie!==void 0)&&(Je=z.getBounds((J??0)+G,ie??0)??Je,Je.width===0||Je.height===0))return;const nt=U.getBoundingClientRect(),yt=nt.width/U.offsetWidth;if(ye!==void 0&&(Je={...Je,x:ye-nt.left-Ht.current.scrollLeft,width:1}),Rt!==void 0&&(Je={...Je,y:Rt+nt.top-Ht.current.scrollTop,height:1}),Je!==void 0){const Ct={x:Je.x-N,y:Je.y-X,width:Je.width+2*N,height:Je.height+2*X};let hi=0;for(let Ga=0;Ga<Ae;Ga++)hi+=on[Ga].width;let Ni=0;const Bi=mt+(ar?1:0);Bi>0&&(Ni=Yr(gn,Bi,Jn));let tr=hi*yt+nt.left+G*gr*yt,gi=nt.right,zr=nt.top+fn*yt,pi=nt.bottom-Ni*yt;const Lo=Je.width+N*2;switch(K?.hAlign){case"start":gi=tr+Lo;break;case"end":tr=gi-Lo;break;case"center":tr=Math.floor((tr+gi)/2)-Lo/2,gi=tr+Lo;break}const Fo=Je.height+X*2;switch(K?.vAlign){case"start":pi=zr+Fo;break;case"end":zr=pi-Fo;break;case"center":zr=Math.floor((zr+pi)/2)-Fo/2,pi=zr+Fo;break}tr>Ct.x?Ke=Ct.x-tr:gi<Ct.x+Ct.width&&(Ke=Ct.x+Ct.width-gi),zr>Ct.y?ut=Ct.y-zr:pi<Ct.y+Ct.height&&(ut=Ct.y+Ct.height-pi),_==="vertical"||typeof w=="number"&&w<Ae?Ke=0:(_==="horizontal"||typeof A=="number"&&A>=gn-Bi)&&(ut=0),(Ke!==0||ut!==0)&&(yt!==1&&(Ke/=yt,ut/=yt),Ht.current.scrollTo({left:Ke+Ht.current.scrollLeft,top:ut+Ht.current.scrollTop,behavior:K?.behavior??"auto"}))}}}},[G,mt,gr,Ht,fn,Ae,on,gn,ar,Jn]),Fa=f.useRef(ws),_a=f.useRef(x);Fa.current=ws,_a.current=x;const Aa=f.useRef(ze);Aa.current=ze;const ys=f.useRef(tt.length);ys.current=tt.length;const mr=f.useCallback(async(w,A=!0,_)=>{if(tt[w]?.trailingRowOptions?.disabled===!0)return;const X=pe?.();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(Aa.current<=ze){U<500&&window.setTimeout(J,U),U=50+U*2;return}const ie=typeof K=="number"?K:z?ze:0;Po.current(w-G,ie,"both",0,0,_?{behavior:_}:void 0),Mt({cell:[w,ie],range:{x:w,y:ie,width:1,height:1}},!1,!1,"edit");const ye=_a.current([w-G,ie]);ye.allowOverlay&&yi(ye)&&ye.readonly!==!0&&A&&window.setTimeout(()=>{Fa.current(w,ie)},0)};J()},[tt,pe,G,ze,Mt]),Io=f.useCallback(async(w,A=!0)=>{const _=et?.();let N,X=!0;_!==void 0&&(N=await _,N==="left"&&(X=!1),typeof N=="number"&&(X=!1));let K=0;const z=()=>{if(ys.current<=tt.length){K<500&&window.setTimeout(z,K),K=50+K*2;return}const U=typeof N=="number"?N:X?tt.length:0;Xt(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&&yi(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{Fa.current(U,w)},0)};z()},[tt,et,G,Xt,Mt]),si=f.useCallback(w=>{const A=on[w]?.trailingRowOptions?.targetColumn??De?.targetColumn;if(typeof A=="number")return A+(Tn?1:0);if(typeof A=="object"){const _=v.indexOf(A);if(_>=0)return _+(Tn?1:0)}},[on,v,Tn,De?.targetColumn]),vr=f.useRef(),ui=f.useRef(),_i=f.useCallback((w,A)=>{const[_,N]=A;return cr(st,tt[_]?.themeOverride,Dr?.(N),w.themeOverride)},[Dr,tt,st]),{mapper:_r}=ev(Nt,b),Bn=Nt?.navigationBehavior,Ai=f.useCallback(w=>{const A=ua.value?w.metaKey:w.ctrlKey,_=A&&ve==="multi",[N,X]=w.location,K=q.columns,z=q.rows,[U,J]=q.current?.cell??[];if(w.kind==="cell"){if(ui.current=void 0,Ar.current=[N,X],N===0&&Tn){if(_t===!0&&X===ze||Sn==="number"||ve==="none")return;const ie=Dn(w.location);if(ie.kind!==$n.Marker)return;if(Kt!==void 0){const Je=Jt(ie);Pn(Je?.kind===$n.Marker);const Ke=Je?.onClick?.({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:_i(ie,w.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===ie.checked)return}o(void 0),xn();const ye=z.hasIndex(X),Rt=vr.current;if(ve==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&Rt!==void 0&&z.hasIndex(Rt)){const Je=[Math.min(Rt,X),Math.max(Rt,X)+1];_||Ne==="multi"?lt(void 0,Je,!0):lt(Qe.fromSingleSelection(Je),void 0,_)}else ve==="multi"&&(_||w.isTouch||Ne==="multi")?ye?lt(z.remove(X),void 0,!0):(lt(void 0,X,!0),vr.current=X):ye&&z.length===1?lt(Qe.empty(),void 0,A):(lt(Qe.fromSingleSelection(X),void 0,A),vr.current=X)}else if(N>=G&&_t&&X===ze){const ie=si(N);mr(ie??N)}else if(U!==N||J!==X){const ie=Dn(w.location),ye=Jt(ie);if(ye?.onSelect!==void 0){let Ke=!1;if(ye.onSelect({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ke=!0,theme:_i(ie,w.location)}),Ke)return}if(Bn==="block"&&_r(X).isGroupHeader)return;const Rt=ar&&X===ze,Je=ar&&q!==void 0&&q.current?.cell[1]===ze;if((w.shiftKey||w.isLongTouch===!0)&&U!==void 0&&J!==void 0&&q.current!==void 0&&!Je){if(Rt)return;const Ke=Math.min(N,U),ut=Math.max(N,U),nt=Math.min(X,J),yt=Math.max(X,J);Mt({...q.current,range:{x:Ke,y:nt,width:ut-Ke+1,height:yt-nt+1}},!0,A,"click"),vr.current=void 0,xn()}else Mt({cell:[N,X],range:{x:N,y:X,width:1,height:1}},!0,A,"click"),vr.current=void 0,o(void 0),xn()}}else if(w.kind==="header")if(Ar.current=[N,X],o(void 0),Tn&&N===0)vr.current=void 0,ui.current=void 0,!ti&&ve==="multi"&&(z.length!==ze?lt(Qe.fromSingleSelection([0,ze]),void 0,A):lt(Qe.empty(),void 0,A),xn());else{const ie=ui.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&ie!==void 0&&K.hasIndex(ie)){const ye=[Math.min(ie,N),Math.max(ie,N)+1];A||w.isTouch||ft==="multi"?qe(void 0,ye,A):qe(Qe.fromSingleSelection(ye),void 0,A)}else ne==="multi"&&(A||w.isTouch||ft==="multi")?(K.hasIndex(N)?qe(K.remove(N),void 0,A):qe(void 0,N,A),ui.current=N):ne!=="none"&&(K.hasIndex(N)?qe(K.remove(N),void 0,A):qe(Qe.fromSingleSelection(N),void 0,A),ui.current=N);vr.current=void 0,xn()}else w.kind===Xn?Ar.current=[N,X]:w.kind===ca&&!w.isMaybeScrollbar&&(ge(Uo,!1),o(void 0),xn(),Bt?.(),vr.current=void 0,ui.current=void 0)},[ve,ne,q,Tn,G,_t,ze,Sn,Dn,Kt,xn,Ne,ft,Jt,_i,lt,si,mr,Bn,_r,ar,Mt,ti,qe,ge,Bt]),Hi=f.useRef(!1),Ar=f.useRef(),Cs=f.useRef(sr),er=f.useRef(),Pf=f.useCallback(w=>{if(ci.current=!1,Cs.current=Qt.current,w.button!==0&&w.button!==1){er.current=void 0;return}const A=performance.now();er.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(Hi.current=!0);const _=w.kind==="cell"&&w.isFillHandle;!_&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:q,fillHandle:_}),Ar.current=void 0,!w.isTouch&&w.button===0&&!_?Ai(w):!w.isTouch&&w.button===1&&(Ar.current=w.location))},[q,Ai]),[Ha,za]=f.useState(),Ss=f.useCallback(w=>{if(w.kind!==Xn||ne!=="multi")return;const A=ua.value?w.metaKey:w.ctrlKey,[_]=w.location,N=q.columns;if(_<G)return;const X=tt[_];let K=_,z=_;for(let U=_-1;U>=G&&uo(X.group,tt[U].group);U--)K--;for(let U=_+1;U<tt.length&&uo(X.group,tt[U].group);U++)z++;if(xn(),A||w.isTouch||ft==="multi")if(N.hasAll([K,z+1])){let U=N;for(let J=K;J<=z;J++)U=U.remove(J);qe(U,void 0,A)}else qe(void 0,[K,z+1],A);else qe(Qe.fromSingleSelection([K,z+1]),void 0,A)},[ne,xn,q.columns,tt,G,qe,ft]),ci=f.useRef(!1),Eo=f.useCallback(async w=>{if(ee!==void 0&&Xe!==void 0){const A=Qt.current.y,_=Qt.current.height;let N=ee({x:w,y:A,width:1,height:Math.min(_,ze-A)},$.current.signal);typeof N!="object"&&(N=await N());const X=on[w-G],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=st.baseFontFull;const U=ld(z,st,X,0,N,hr,ni,!1,Jt);Xe?.(X,U.width,w,U.width)}}},[on,ee,ni,st,hr,Xe,G,ze,Jt]),[Lf,Va]=f.useState(),di=f.useCallback(async(w,A)=>{const _=w.current?.range;if(_===void 0||ee===void 0||A.current===void 0)return;const N=A.current.range;if(R!==void 0){let U=!1;if(R({fillDestination:{...N,x:N.x-G},patternSource:{..._,x:_.x-G},preventDefault:()=>U=!0}),U)return}let X=ee(_,$.current.signal);typeof X!="object"&&(X=await X());const K=X,z=[];for(let U=0;U<N.width;U++)for(let J=0;J<N.height;J++){const ie=[N.x+U,N.y+J];if(qc(ie,_))continue;const ye=K[J%_.height][U%_.width];Si(ye)||!yi(ye)||z.push({location:ie,value:{...ye}})}zn(z),hn.current?.damage(z.map(U=>({cell:U.location})))},[ee,zn,R,G]),xs=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}}};di(w,q)},[di,q]),ks=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}}};di(w,q)},[di,q]),Ff=f.useCallback((w,A)=>{const _=l;if(u(void 0),Pa(void 0),Va(void 0),Hi.current=!1,A)return;if(_?.fillHandle===!0&&q.current!==void 0&&_.previousSelection?.current!==void 0){if(Fr===void 0)return;const ye={...q,current:{...q.current,range:fd(_.previousSelection.current.range,Fr)}};di(_.previousSelection,ye),ge(ye,!0);return}const[N,X]=w.location,[K,z]=Ar.current??[],U=()=>{ci.current=!0},J=ye=>{const Rt=ye.isTouch||K===N&&z===X;if(Rt&&T?.([N-G,X],{...ye,preventDefault:U}),ye.button===1)return!ci.current;if(!ci.current){const Je=Dn(w.location),Ke=Jt(Je);if(Ke!==void 0&&Ke.onClick!==void 0&&Rt){const nt=Ke.onClick({...ye,cell:Je,posX:ye.localEventX,posY:ye.localEventY,bounds:ye.bounds,theme:_i(Je,w.location),preventDefault:U});nt!==void 0&&!Si(nt)&&wi(nt)&&(zn([{location:ye.location,value:nt}]),hn.current?.damage([{cell:ye.location}]))}if(ci.current||q.current===void 0)return!1;let ut=!1;switch(Je.activationBehaviorOverride??Re){case"double-click":case"second-click":{if(_?.previousSelection?.current?.cell===void 0)break;const[nt,yt]=q.current.cell,[Ct,hi]=_.previousSelection.current.cell;ut=N===nt&&N===Ct&&X===yt&&X===hi&&(ye.isDoubleClick===!0||Re==="second-click");break}case"single-click":{ut=!0;break}}if(ut){const yt={inputType:"pointer",pointerActivation:ye.isDoubleClick===!0?"double-click":Je.activationBehaviorOverride??Re,pointerType:ye.isTouch?"touch":"mouse"};return k?.([N-G,X],yt),li(ye.bounds,yt),!0}}return!1},ie=w.location[0]-G;if(w.isTouch){const ye=Qt.current,Rt=Cs.current;if(ye.x!==Rt.x||ye.y!==Rt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&io(q.current?.cell,w.location)){W?.([ie,w.location[1]],{...w,preventDefault:U});return}else if(w.kind==="header"&&q.columns.hasIndex(N)){oe?.(ie,{...w,preventDefault:U});return}else if(w.kind===Xn){if(ie<0)return;re?.(ie,{...w,preventDefault:U});return}}w.kind==="cell"?J(w)||Ai(w):w.kind===Xn?V?.(ie,{...w,preventDefault:U}):(w.kind===Sr&&S?.(ie,{...w,preventDefault:U}),Ai(w));return}if(w.kind==="header"){if(ie<0)return;w.isEdge?w.isDoubleClick===!0&&Eo(N):w.button===0&&N===K&&X===z&&S?.(ie,{...w,preventDefault:U})}if(w.kind===Xn){if(ie<0)return;w.button===0&&N===K&&X===z&&(V?.(ie,{...w,preventDefault:U}),ci.current||Ss(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&J(w),Ar.current=void 0},[l,q,G,Fr,di,ge,T,Dn,Jt,Re,_i,zn,k,li,W,oe,re,Ai,V,S,Eo,Ss]),_f=f.useCallback(w=>{const A={...w,location:[w.location[0]-G,w.location[1]]};at?.(A),l!==void 0&&w.buttons===0&&(u(void 0),Pa(void 0),Va(void 0),Hi.current=!1),Va(_=>Hi.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===_?.[0]&&w.scrollEdge[1]===_[1]?_:l===void 0||(er.current?.location[0]??0)<G?void 0:w.scrollEdge)},[l,at,G]),Af=f.useCallback((w,A)=>{ht?.(w-G,A)},[ht,G]),Hf=f.useCallback((w,A)=>{Ye?.(w-G,A)},[Ye,G]),fi=q?.current?.cell,zf=f.useCallback((w,A,_,N,X,K)=>{Lr.current=!1;let z=fi;z!==void 0&&(z=[z[0]-G,z[1]]);const U=Ae===0?void 0:{x:0,y:w.y,width:Ae,height:w.height},J=[];U!==void 0&&J.push(U),mt>0&&(J.push({x:w.x-G,y:ze-mt,width:w.width,height:mt}),Ae>0&&J.push({x:0,y:ze-mt,width:Ae,height:mt}));const ie={x:w.x-G,y:w.y,width:w.width,height:_t&&w.y+w.height>=ze?w.height-1:w.height,tx:X,ty:K,extras:{selected:z,freezeRegion:U,freezeRegions:J}};Qt.current=ie,pr(ie),oi([A,_,N]),an?.(ie,ie.tx,ie.ty,ie.extras)},[fi,G,_t,ze,Ae,mt,pr,an]),Vf=Cr(E,f.useCallback((w,A)=>E?.(w-G,A-G)!==!1,[E,G])),$f=Cr(ke,f.useCallback((w,A)=>{ke?.(w-G,A-G),ne!=="none"&&qe(Qe.fromSingleSelection(A),void 0,!0)},[ne,ke,G,qe])),$a=f.useRef(!1),Nf=f.useCallback(w=>{if(w.location[0]===0&&G>0){w.preventDefault();return}Oe?.({...w,location:[w.location[0]-G,w.location[1]]}),w.defaultPrevented()||($a.current=!0),u(void 0)},[Oe,G]),Bf=f.useCallback(()=>{$a.current=!1},[]),Ms=Nt?.selectionBehavior,To=f.useCallback(w=>{if(Ms!=="block-spanning")return;const{isGroupHeader:A,path:_,groupRows:N}=_r(w);if(A)return[w,w];const X=_[_.length-1],K=w-X,z=w+N-X-1;return[K,z]},[_r,Ms]),Na=f.useRef(),Ba=f.useCallback(w=>{if(!bd(w,Na.current)&&(Na.current=w,!(er?.current?.button!==void 0&&er.current.button>=1))){if(w.buttons!==0&&l!==void 0&&er.current?.location[0]===0&&G===1&&ve==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(er.current.location[1])&&q.rows.hasIndex(er.current.location[1])){const A=Math.min(er.current.location[1],w.location[1]),_=Math.max(er.current.location[1],w.location[1])+1;lt(Qe.fromSingleSelection([A,_]),void 0,!1)}else if(w.buttons!==0&&l!==void 0&&q.current!==void 0&&!$a.current&&!Hi.current&&(Ue==="rect"||Ue==="multi-rect")){const[A,_]=q.current.cell;let[N,X]=w.location;if(X<0&&(X=Qt.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const K=l.previousSelection.current.range;X=Math.min(X,_t?ze-1:ze);const z=$m(K,N,X,xt);Pa(z)}else{if(_t&&_===ze)return;if(_t&&X===ze)if(w.kind===ca)X--;else return;N=Math.max(N,G);const U=To(_);X=U===void 0?X:Vn(X,U[0],U[1]);const J=N-A,ie=X-_,ye={x:J>=0?A:N,y:ie>=0?_:X,width:Math.abs(J)+1,height:Math.abs(ie)+1};Mt({...q.current,range:ye},!0,!1,"drag")}}Tt?.({...w,location:[w.location[0]-G,w.location[1]]})}},[l,G,ve,q,Ue,Tt,lt,_t,ze,xt,To,Mt]),Wf=f.useCallback(()=>{const w=Na.current;if(w===void 0)return;const[A,_]=w.scrollEdge;let[N,X]=w.location;const K=Qt.current;A===-1?N=K.extras?.freezeRegion?.x??K.x:A===1&&(N=K.x+K.width),_===-1?X=Math.max(0,K.y):_===1&&(X=Math.min(ze-1,K.y+K.height)),N=Vn(N,0,tt.length-1),X=Vn(X,0,ze-1),Ba({...w,location:[N,X]})},[tt.length,Ba,ze]);q0(Lf,Ht,Wf);const Wn=f.useCallback(w=>{if(q.current===void 0)return;const[A,_]=w,[N,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[ye,Rt]=To(X)??[0,ze-1],Je=Rt+1;if(_!==0)switch(_){case 2:{ie=Je,J=X,Xt(0,ie,"vertical");break}case-2:{J=ye,ie=X+1,Xt(0,J,"vertical");break}case 1:{J<X?(J++,Xt(0,J,"vertical")):(ie=Math.min(Je,ie+1),Xt(0,ie,"vertical"));break}case-1:{ie>X+1?(ie--,Xt(0,ie,"vertical")):(J=Math.max(ye,J-1),Xt(0,J,"vertical"));break}default:lo()}if(A!==0)if(A===2)U=tt.length,z=N,Xt(U-1-G,0,"horizontal");else if(A===-2)z=G,U=N+1,Xt(z-G,0,"horizontal");else{let Ke=[];if(ee!==void 0){const ut=ee({x:z,y:J,width:U-z-G,height:ie-J},$.current.signal);typeof ut=="object"&&(Ke=ov(ut))}if(A===1){let ut=!1;if(z<N){if(Ke.length>0){const nt=kr(z+1,N+1).find(yt=>!Ke.includes(yt-G));nt!==void 0&&(z=nt,ut=!0)}else z++,ut=!0;ut&&Xt(z,0,"horizontal")}ut||(U=Math.min(tt.length,U+1),Xt(U-1-G,0,"horizontal"))}else if(A===-1){let ut=!1;if(U>N+1){if(Ke.length>0){const nt=kr(U-1,N,-1).find(yt=>!Ke.includes(yt-G));nt!==void 0&&(U=nt,ut=!0)}else U--,ut=!0;ut&&Xt(U-G,0,"horizontal")}ut||(z=Math.max(G,z-1),Xt(z-G,0,"horizontal"))}else lo()}Mt({cell:q.current.cell,range:{x:z,y:J,width:U-z,height:ie-J}},!0,!1,"keyboard-select")},[ee,To,q,tt.length,G,ze,Xt,Mt]),Wa=f.useRef(Zn);Wa.current=Zn;const br=f.useCallback((w,A,_,N)=>{const X=gn-(_?0:1);w=Vn(w,G,on.length-1+G),A=Vn(A,0,X);const K=fi?.[0],z=fi?.[1];if(w===K&&A===z)return!1;if(N&&q.current!==void 0){const U=[...q.current.rangeStack];(q.current.range.width>1||q.current.range.height>1)&&U.push(q.current.range),ge({...q,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:U}},!0)}else Mt({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),Wa.current&&Xt(w-G,A),!0},[gn,G,on.length,fi,q,Xt,ge,Mt]),Uf=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&wi(w)&&(zn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{hn.current?.damage([{cell:i.cell}])})),xn(!0),o(void 0);const[_,N]=A;if(q.current!==void 0&&(_!==0||N!==0)){const X=q.current.cell[1]===gn-1&&w!==void 0,K=q.current.cell[0]===tt.length-1&&w!==void 0;let z=!0;if(X&&N===1&&pe!==void 0){z=!1;const U=q.current.cell[0]+_,J=si(U);mr(J??U,!1)}if(K&&_===1&&et!==void 0){z=!1;const U=q.current.cell[1]+N;Io(U,!1)}z&&br(Vn(q.current.cell[0]+_,0,tt.length-1),Vn(q.current.cell[1]+N,0,gn-1),X,!1)}P?.(w,A)},[i?.cell,xn,q,P,zn,gn,br,tt.length,mr,Io,pe,et,si]),Gf=f.useMemo(()=>`gdg-overlay-${iv++}`,[]),Hr=f.useCallback(w=>{xn();const A=[];for(let _=w.x;_<w.x+w.width;_++)for(let N=w.y;N<w.y+w.height;N++){const X=x([_-G,N]);if(!X.allowOverlay&&X.kind!==Z.Boolean)continue;let K;if(X.kind===Z.Custom){const z=Jt(X),U=z?.provideEditor?.({...X,location:[_-G,N]});z?.onDelete!==void 0?K=z.onDelete(X):Xg(U)&&(K=U?.deletedValue?.(X))}else(wi(X)&&X.allowOverlay||X.kind===Z.Boolean)&&(K=Jt(X)?.onDelete?.(X));K!==void 0&&!Si(K)&&wi(K)&&A.push({location:[_,N],value:K})}zn(A),hn.current?.damage(A.map(_=>({cell:_.location})))},[xn,x,Jt,zn,G]),zi=i!==void 0,Rs=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},_={didMatch:!1},{bounds:N}=w,X=q.columns,K=q.rows,z=Qn;if(!zi&&rt(z.clear,w,_))ge(Uo,!1),Bt?.();else if(!zi&&rt(z.selectAll,w,_))ge({columns:Qe.empty(),rows:Qe.empty(),current:{cell:q.current?.cell??[G,0],range:{x:G,y:0,width:v.length,height:ze},rangeStack:[]}},!1);else if(rt(z.search,w,_))s?.current?.focus({preventScroll:!0}),Or(!0);else if(rt(z.delete,w,_)){const nt=Ut?.(q)??!0;if(nt!==!1){const yt=nt===!0?q:nt;if(yt.current!==void 0){Hr(yt.current.range);for(const Ct of yt.current.rangeStack)Hr(Ct)}for(const Ct of yt.rows)Hr({x:G,y:Ct,width:v.length,height:1});for(const Ct of yt.columns)Hr({x:Ct,y:0,width:1,height:ze})}}if(_.didMatch)return A(),!0;if(q.current===void 0)return!1;let[U,J]=q.current.cell;const[,ie]=q.current.cell;let ye=!1,Rt=!1;if(rt(z.scrollToSelectedCell,w,_))Po.current(U-G,J);else if(ne!=="none"&&rt(z.selectColumn,w,_))X.hasIndex(U)?qe(X.remove(U),void 0,!0):ne==="single"?qe(Qe.fromSingleSelection(U),void 0,!0):qe(void 0,U,!0);else if(ve!=="none"&&rt(z.selectRow,w,_))K.hasIndex(J)?lt(K.remove(J),void 0,!0):ve==="single"?lt(Qe.fromSingleSelection(J),void 0,!0):lt(void 0,J,!0);else if(!zi&&N!==void 0&&rt(z.activateCell,w,_))if(J===ze&&_t)window.setTimeout(()=>{const nt=si(U);mr(nt??U)},0);else{const nt={inputType:"keyboard",key:w.key};k?.([U-G,J],nt),li(N,nt)}else q.current.range.height>1&&rt(z.downFill,w,_)?ks():q.current.range.width>1&&rt(z.rightFill,w,_)?xs():rt(z.goToNextPage,w,_)?J+=Math.max(1,Qt.current.height-4):rt(z.goToPreviousPage,w,_)?J-=Math.max(1,Qt.current.height-4):rt(z.goToFirstCell,w,_)?(o(void 0),J=0,U=0):rt(z.goToLastCell,w,_)?(o(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):rt(z.selectToFirstCell,w,_)?(o(void 0),Wn([-2,-2])):rt(z.selectToLastCell,w,_)?(o(void 0),Wn([2,2])):zi?(rt(z.closeOverlay,w,_)&&o(void 0),rt(z.acceptOverlayDown,w,_)&&(o(void 0),J++),rt(z.acceptOverlayUp,w,_)&&(o(void 0),J--),rt(z.acceptOverlayLeft,w,_)&&(o(void 0),U--),rt(z.acceptOverlayRight,w,_)&&(o(void 0),U++)):(rt(z.goDownCell,w,_)?J+=1:rt(z.goUpCell,w,_)?J-=1:rt(z.goRightCell,w,_)?U+=1:rt(z.goLeftCell,w,_)?U-=1:rt(z.goDownCellRetainSelection,w,_)?(J+=1,ye=!0):rt(z.goUpCellRetainSelection,w,_)?(J-=1,ye=!0):rt(z.goRightCellRetainSelection,w,_)?(U+=1,ye=!0):rt(z.goLeftCellRetainSelection,w,_)?(U-=1,ye=!0):rt(z.goToLastRow,w,_)?J=ze-1:rt(z.goToFirstRow,w,_)?J=Number.MIN_SAFE_INTEGER:rt(z.goToLastColumn,w,_)?U=Number.MAX_SAFE_INTEGER:rt(z.goToFirstColumn,w,_)?U=Number.MIN_SAFE_INTEGER:(Ue==="rect"||Ue==="multi-rect")&&(rt(z.selectGrowDown,w,_)?Wn([0,1]):rt(z.selectGrowUp,w,_)?Wn([0,-1]):rt(z.selectGrowRight,w,_)?Wn([1,0]):rt(z.selectGrowLeft,w,_)?Wn([-1,0]):rt(z.selectToLastRow,w,_)?Wn([0,2]):rt(z.selectToFirstRow,w,_)?Wn([0,-2]):rt(z.selectToLastColumn,w,_)?Wn([2,0]):rt(z.selectToFirstColumn,w,_)&&Wn([-2,0])),Rt=_.didMatch);if(Bn!==void 0&&Bn!=="normal"&&J!==ie){const nt=Bn==="skip-up"||Bn==="skip"||Bn==="block",yt=Bn==="skip-down"||Bn==="skip"||Bn==="block",Ct=J<ie;if(Ct&&nt){for(;J>=0&&_r(J).isGroupHeader;)J--;J<0&&(J=ie)}else if(!Ct&&yt){for(;J<ze&&_r(J).isGroupHeader;)J++;J>=ze&&(J=ie)}}const Ke=br(U,J,!1,ye),ut=_.didMatch;return ut&&(Ke||!Rt||Cn)&&A(),ut},[Bn,zi,q,Qn,ne,ve,Ue,G,_r,ze,br,ge,Bt,v.length,Ut,Cn,Hr,qe,lt,_t,si,mr,k,li,ks,xs,Wn]),Vi=f.useCallback(w=>{let A=!1;if(Y!==void 0&&Y({...w,...w.location&&{location:[w.location[0]-G,w.location[1]]},cancel:()=>{A=!0}}),A||Rs(w)||q.current===void 0)return;const[_,N]=q.current.cell,X=Qt.current;if(Se&&!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&&yi(x([_-G,Math.max(0,Math.min(N,ze-1))]))){if((!_t||N!==ze)&&(X.y>N||N>X.y+X.height||X.x>_||_>X.x+X.width))return;const K={inputType:"keyboard",key:w.key};k?.([_-G,N],K),li(w.bounds,K,w.key),w.stopPropagation(),w.preventDefault()}},[Se,Y,Rs,q,x,G,ze,_t,k,li]),Xf=f.useCallback((w,A)=>{const _=w.location[0]-G;if(w.kind==="header"&&oe?.(_,{...w,preventDefault:A}),w.kind===Xn){if(_<0)return;re?.(_,{...w,preventDefault:A})}if(w.kind==="cell"){const[N,X]=w.location;W?.([_,X],{...w,preventDefault:A}),Xp(q,w.location)||br(N,X,!1,!1)}},[q,W,re,oe,G,br]),Ua=f.useCallback(async w=>{if(!Qn.paste)return;function A(z,U,J,ie){const ye=typeof J=="object"?J?.join(`
172
+ `&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(xu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function ku(e,t,n){const r=$0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function yd(e){return e!==!0}function Mu(e){return typeof e=="string"?e:`${e}px`}const W0=()=>e=>e.innerWidth,U0=()=>e=>e.innerHeight,G0=dn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[W0()],"wmyidgi-1":[U0()]}}),Y0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(G0,{innerHeight:Mu(n),innerWidth:Mu(t),...i},r)},X0=2,j0=1300;function q0(e,t,n){const r=zt.useRef(0),[i,o]=e??[0,0];zt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/j0);const d=r.current**1.618*c*X0;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function K0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,d,g,h]=zt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,y=id();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,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const yr={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 it(e,t){return e===!0?t:e===!1?"":e}function Ru(e){const t=ua.value;return{activateCell:it(e.activateCell," |Enter|shift+Enter"),clear:it(e.clear,"any+Escape"),closeOverlay:it(e.closeOverlay,"any+Escape"),acceptOverlayDown:it(e.acceptOverlayDown,"Enter"),acceptOverlayUp:it(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:it(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:it(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:it(e.delete,t?"Backspace|Delete":"Delete"),downFill:it(e.downFill,"primary+_68"),scrollToSelectedCell:it(e.scrollToSelectedCell,"primary+Enter"),goDownCell:it(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:it(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:it(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:it(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:it(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:it(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:it(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:it(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:it(e.goToFirstCell,"primary+Home"),goToFirstColumn:it(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:it(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:it(e.goToLastCell,"primary+End"),goToLastColumn:it(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:it(e.goToLastRow,"primary+ArrowDown"),goToNextPage:it(e.goToNextPage,"PageDown"),goToPreviousPage:it(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:it(e.rightFill,"primary+_82"),search:it(e.search,"primary+f"),selectAll:it(e.selectAll,"primary+a"),selectColumn:it(e.selectColumn,"ctrl+ "),selectGrowDown:it(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:it(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:it(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:it(e.selectGrowUp,"shift+ArrowUp"),selectRow:it(e.selectRow,"shift+ "),selectToFirstCell:it(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:it(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:it(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:it(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:it(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:it(e.selectToLastRow,"primary+shift+ArrowDown")}}function Z0(e){const t=pp(e);return zt.useMemo(()=>{if(t===void 0)return Ru(yr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??yr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??yr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??yr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??yr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??yr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??yr.selectToLastCell};return Ru({...yr,...n})},[t])}function J0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function ql(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:l;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=J0(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Rl(e,t){if(t===void 0||ql.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 Q0(e,t,n,r){const i=zt.useMemo(()=>e===void 0?void 0:ql(e,t),[e,t]),o=zt.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),s=zt.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=zt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=zt.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=Cr(r??e?.themeOverride,zt.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}=Rl(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function ev(e,t){const n=zt.useMemo(()=>e===void 0?void 0:ql(e,t),[e,t]);return{getRowGroupingForPath:Sd,updateRowGroupingByPath:Cd,mapper:zt.useCallback(r=>{if(typeof r=="number")return Rl(r,n);const i=Rl(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Cd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:Cd(o.subGroups??[],i,n)}:o)}function Sd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Sd(e[n].subGroups??[],r)}function tv(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 nv(e,t,n,r,i){const[o,s]=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:s}),[r,s,o]),[l,u,c]=gp(a),d=f.useRef(i);d.current=i;const g=tv(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(l.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=(l.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:l,setVisibleRegion:u,scrollRef:g}}const rv=f.lazy(async()=>await Ll(()=>import("./data-grid-overlay-editor.C9AINtRf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url));let iv=0;function ov(e){return Ug(Os(Os(e).filter(t=>t.span!==void 0).map(t=>kr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Bo(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 Wo={kind:Z.Loading,allowOverlay:!1},Uo={columns:Qe.empty(),rows:Qe.empty(),current:void 0},av=(e,t)=>{const[n,r]=f.useState(Uo),[i,o]=f.useState(),s=f.useRef(null),a=f.useRef(null),[l,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:x,onCellClicked:T,onCellActivated:k,onFillPattern:R,onFinishedEditing:P,coercePasteValue:I,drawHeader:C,drawCell:F,editorBloom:D,onHeaderClicked:S,onColumnProposeMove:E,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:M="default",onGroupHeaderClicked:V,onCellContextMenu:W,className:j,onHeaderContextMenu:oe,getCellsForSelection:Q,onGroupHeaderContextMenu:re,onGroupHeaderRenamed:se,onCellEdited:ae,onCellsEdited:de,onSearchResultsChanged:fe,searchResults:ue,onSearchValueChange:H,searchValue:L,onKeyDown:X,onKeyUp:te,keybindings:le,editOnType:Se=!0,onRowAppended:pe,onColumnAppended:et,onColumnMoved:ke,validateCell:Dt,highlightRegions:dt,rangeSelect:Ue="rect",columnSelect:ne="multi",rowSelect:ve="multi",rangeSelectionBlending:me="exclusive",columnSelectionBlending:he="exclusive",rowSelectionBlending:Ce="exclusive",onDelete:_e,onDragStart:Oe,onMouseMove:at,onPaste:Pe,copyHeaders:we=!1,freezeColumns:Ae=0,cellActivationBehavior:Re="second-click",rowSelectionMode:Ne="auto",columnSelectionMode:ft="auto",onHeaderMenuClick:ht,onHeaderIndicatorClick:Xe,getGroupDetails:pt,rowGrouping:Nt,onSearchClose:St,onItemHovered:Tt,onSelectionCleared:Bt,showSearch:qt,onVisibleRegionChanged:an,gridSelection:It,onGridSelectionChange:gt,minColumnWidth:Wt=50,maxColumnWidth:wt=500,maxColumnAutoWidth:ln,provideEditor:Mn,trailingRowOptions:De,freezeTrailingRows:mt=0,allowedFillDirections:xt="orthogonal",scrollOffsetX:vn,scrollOffsetY:tn,verticalBorder:nn,onDragOverCell:un,onDrop:$t,onColumnResize:Zt,onColumnResizeEnd:Ge,onColumnResizeStart:kt,customRenderers:In,fillHandle:Ot,experimental:bt,fixedShadowX:bn,fixedShadowY:ir,headerIcons:Kn,imageWindowLoader:B,initialSize:Be,isDraggable:je,onDragLeave:Pt,onRowMoved:Kt,overscrollX:rn,overscrollY:En,preventDiagonalScrolling:wn,rightElement:Gt,rightElementProps:yn,trapFocus:Cn=!1,smoothScrollX:jr,smoothScrollY:qr,scaleToRem:Kr=!1,rowHeight:Di=34,headerHeight:_n=36,groupHeaderHeight:An=_n,theme:He,isOutsideClick:cn,renderers:Rn,resizeIndicator:Oi,scrollToActiveCell:Zn=!0,drawFocusRing:Ma=!0,portalElementRef:wo}=e,Zr=Ma==="no-editor"?i===void 0:Ma,Nn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Sn=Nn?.kind??e.rowMarkers??"none",Jr=Nn?.width??e.rowMarkerWidth,or=Nn?.startIndex??e.rowMarkerStartIndex??1,Qr=Nn?.theme??e.rowMarkerTheme,fr=Nn?.headerTheme,ei=Nn?.headerAlwaysVisible,ti=ve!=="multi"||Nn?.headerDisabled===!0,Tr=Nn?.checkboxStyle??"square",hr=Math.max(Wt,20),ni=Math.max(wt,hr),Ra=Math.max(ln??ni,hr),Pi=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:ze,rowNumberMapper:Li,rowHeight:yo,getRowThemeOverride:Dr}=Q0(Nt,b,Di,h),Ia=f.useMemo(()=>Number.parseFloat(Pi.fontSize),[Pi]),{rowHeight:Jn,headerHeight:Fi,groupHeaderHeight:Co,theme:ri,overscrollX:Ea,overscrollY:Ta}=K0({groupHeaderHeight:An,headerHeight:_n,overscrollX:rn,overscrollY:En,remSize:Ia,rowHeight:yo,scaleToRem:Kr,theme:He}),Qn=Z0(le),gr=Jr??(b>1e4?48:b>1e3?44:b>100?36:32),Tn=Sn!=="none",G=Tn?1:0,_t=De!==void 0,ar=De?.sticky===!0,[Da,Or]=f.useState(!1),Oa=qt??Da,ii=f.useCallback(()=>{St!==void 0?St():Or(!1)},[St]),q=f.useMemo(()=>It===void 0?void 0:Bo(It,G),[It,G])??n,$=f.useRef();$.current===void 0&&($.current=new AbortController),f.useEffect(()=>()=>$?.current.abort(),[]);const[ee,xe]=F0(Q,x,G,$.current,ze),Te=f.useCallback((w,A,_)=>{if(Dt===void 0)return!0;const N=[w[0]-G,w[1]];return Dt?.(N,A,_)},[G,Dt]),ce=f.useRef(It),ge=f.useCallback((w,A)=>{A&&(w=N0(w,ee,G,M,$.current)),gt!==void 0?(ce.current=Bo(w,-G),gt(ce.current)):r(w)},[gt,ee,G,M]),Ye=Cr(Zt,f.useCallback((w,A,_,N)=>{Zt?.(v[_-G],A,_-G,N)},[Zt,G,v])),Me=Cr(Ge,f.useCallback((w,A,_,N)=>{Ge?.(v[_-G],A,_-G,N)},[Ge,G,v])),Ze=Cr(kt,f.useCallback((w,A,_,N)=>{kt?.(v[_-G],A,_-G,N)},[kt,G,v])),vt=Cr(C,f.useCallback((w,A)=>C?.({...w,columnIndex:w.columnIndex-G},A)??!1,[C,G])),sn=Cr(F,f.useCallback((w,A)=>F?.({...w,col:w.col-G},A)??!1,[F,G])),Ut=f.useCallback(w=>{if(_e!==void 0){const A=_e(Bo(w,-G));return typeof A=="boolean"?A:Bo(A,G)}return!0},[_e,G]),[Mt,lt,qe]=L0(q,ge,me,he,Ce,Ue,O),st=f.useMemo(()=>cr(id(),ri),[ri]),[At,oi]=f.useState([0,0,0]),Pr=f.useMemo(()=>{if(Rn===void 0)return{};const w={};for(const A of Rn)w[A.kind]=A;return w},[Rn]),Jt=f.useCallback(w=>w.kind!==Z.Custom?Pr[w.kind]:In?.find(A=>A.isMatch(w)),[In,Pr]);let{sizedColumns:on,nonGrowWidth:Lt}=sm(v,ze,xe,At[0]-(G===0?0:gr)-At[2],hr,Ra,st,Jt,$.current);Sn!=="none"&&(Lt+=gr);const Hn=f.useMemo(()=>on.some(w=>w.group!==void 0),[on]),fn=Hn?Fi+Co:Fi,ai=q.rows.length,lr=Sn==="none"?void 0:ai===0?!1:ai===ze?!0:void 0,tt=f.useMemo(()=>Sn==="none"?on:[{title:"",width:gr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Qr,rowMarker:Tr,rowMarkerChecked:lr,headerRowMarkerTheme:fr,headerRowMarkerAlwaysVisible:ei,headerRowMarkerDisabled:ti},...on],[Sn,on,gr,Qr,Tr,lr,fr,ei,ti]),Qt=f.useRef({height:1,width:1,x:0,y:0}),Lr=f.useRef(!1),{setVisibleRegion:pr,visibleRegion:sr,scrollRef:Ht}=nv(vn,tn,Jn,Qt,()=>Lr.current=!0);Qt.current=sr;const Df=sr.x+G,So=sr.y,hn=f.useRef(null),xn=f.useCallback(w=>{w===!0?hn.current?.focus():window.requestAnimationFrame(()=>{hn.current?.focus()})},[]),gn=_t?ze+1:ze,zn=f.useCallback(w=>{const A=G===0?w:w.map(N=>({...N,location:[N.location[0]-G,N.location[1]]})),_=de?.(A);if(_!==!0)for(const N of A)ae?.(N.location,N.value);return _},[ae,de,G]),[Fr,Pa]=f.useState(),xo=q.current!==void 0&&q.current.range.width*q.current.range.height>1?q.current.range:void 0,vs=Zr?q.current?.cell:void 0,ko=vs?.[0],Mo=vs?.[1],Of=f.useMemo(()=>{if((dt===void 0||dt.length===0)&&(xo??ko??Mo??Fr)===void 0)return;const w=[];if(dt!==void 0)for(const A of dt){const _=tt.length-A.range.x-G;_>0&&w.push({color:A.color,range:{...A.range,x:A.range.x+G,width:Math.min(_,A.range.width)},style:A.style})}return Fr!==void 0&&w.push({color:Wr(st.accentColor,0),range:Fr,style:"dashed"}),xo!==void 0&&w.push({color:Wr(st.accentColor,.5),range:xo,style:"solid-outline"}),ko!==void 0&&Mo!==void 0&&w.push({color:st.accentColor,range:{x:ko,y:Mo,width:1,height:1},style:"solid-outline"}),w.length>0?w:void 0},[Fr,xo,ko,Mo,dt,tt.length,st.accentColor,G]),bs=f.useRef(tt);bs.current=tt;const Dn=f.useCallback(([w,A],_=!1)=>{const N=_t&&A===gn-1;if(w===0&&Tn){if(N)return Wo;const K=Li(A);return K===void 0?Wo:{kind:$n.Marker,allowOverlay:!1,checkboxStyle:Tr,checked:q?.rows.hasIndex(A)===!0,markerKind:Sn==="clickable-number"?"number":Sn,row:or+K,drawHandle:Kt!==void 0,cursor:Sn==="clickable-number"?"pointer":void 0}}else if(N){const z=w===G?De?.hint??"":"",U=bs.current[w];if(U?.trailingRowOptions?.disabled===!0)return Wo;{const J=U?.trailingRowOptions?.hint??z,ie=U?.trailingRowOptions?.addIcon??De?.addIcon;return{kind:$n.NewRow,hint:J,allowOverlay:!1,icon:ie}}}else{const K=w-G;if(_||bt?.strict===!0){const U=Qt.current,J=U.x>K||K>U.x+U.width||U.y>A||A>U.y+U.height||A>=Aa.current,ie=K===U.extras?.selected?.[0]&&A===U.extras?.selected[1];let ye=!1;if(U.extras?.freezeRegions!==void 0){for(const Rt of U.extras.freezeRegions)if(Br(Rt,K,A)){ye=!0;break}}if(J&&!ie&&!ye)return Wo}let z=x([K,A]);return G!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+G,z.span[1]+G]}),z}},[_t,gn,Tn,Li,Tr,q?.rows,Sn,or,Kt,G,De?.hint,De?.addIcon,bt?.strict,x]),La=f.useCallback(w=>{let A=pt?.(w)??{name:w};return se!==void 0&&w!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:_=>za({group:A.name,bounds:_.bounds})}]}),A},[pt,se]),Ro=f.useCallback(w=>{const[A,_]=w.cell,N=tt[A],Y=N?.group!==void 0?La(N.group)?.overrideTheme:void 0,K=N?.themeOverride,z=Dr?.(_);o({...w,theme:cr(st,Y,K,z,w.content.themeOverride)})},[Dr,tt,La,st]),li=f.useCallback((w,A,_)=>{if(q.current===void 0)return;const[N,Y]=q.current.cell,K=Dn([N,Y]);if(K.kind!==Z.Boolean&&K.allowOverlay){let z=K;if(_!==void 0)switch(z.kind){case Z.Number:{const U=Gg(()=>_==="-"?-0:Number.parseFloat(_),0);z={...z,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:_};break}Ro({target:w,content:z,initialValue:_,cell:[N,Y],highlight:_===void 0,forceEditMode:_!==void 0,activation:A})}else K.kind===Z.Boolean&&A.inputType==="keyboard"&&K.readonly!==!0&&(zn([{location:q.current.cell,value:{...K,data:yd(K.data)}}]),hn.current?.damage([{cell:q.current.cell}]))},[Dn,q,zn,Ro]),ws=f.useCallback((w,A)=>{const _=hn.current?.getBounds(w,A);if(_===void 0||Ht.current===null)return;const N=Dn([w,A]);N.allowOverlay&&Ro({target:_,content:N,initialValue:void 0,highlight:!0,cell:[w,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Dn,Ht,Ro]),Yt=f.useCallback((w,A,_="both",N=0,Y=0,K=void 0)=>{if(Ht.current!==null){const z=hn.current,U=a.current,J=typeof w!="number"?w.unit==="cell"?w.amount:void 0:w,ie=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,ye=typeof w!="number"&&w.unit==="px"?w.amount:void 0,Rt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(z!==null&&U!==null){let Je={x:0,y:0,width:0,height:0},Ke=0,ut=0;if((J!==void 0||ie!==void 0)&&(Je=z.getBounds((J??0)+G,ie??0)??Je,Je.width===0||Je.height===0))return;const nt=U.getBoundingClientRect(),yt=nt.width/U.offsetWidth;if(ye!==void 0&&(Je={...Je,x:ye-nt.left-Ht.current.scrollLeft,width:1}),Rt!==void 0&&(Je={...Je,y:Rt+nt.top-Ht.current.scrollTop,height:1}),Je!==void 0){const Ct={x:Je.x-N,y:Je.y-Y,width:Je.width+2*N,height:Je.height+2*Y};let hi=0;for(let Ga=0;Ga<Ae;Ga++)hi+=on[Ga].width;let Ni=0;const Bi=mt+(ar?1:0);Bi>0&&(Ni=Xr(gn,Bi,Jn));let tr=hi*yt+nt.left+G*gr*yt,gi=nt.right,zr=nt.top+fn*yt,pi=nt.bottom-Ni*yt;const Lo=Je.width+N*2;switch(K?.hAlign){case"start":gi=tr+Lo;break;case"end":tr=gi-Lo;break;case"center":tr=Math.floor((tr+gi)/2)-Lo/2,gi=tr+Lo;break}const Fo=Je.height+Y*2;switch(K?.vAlign){case"start":pi=zr+Fo;break;case"end":zr=pi-Fo;break;case"center":zr=Math.floor((zr+pi)/2)-Fo/2,pi=zr+Fo;break}tr>Ct.x?Ke=Ct.x-tr:gi<Ct.x+Ct.width&&(Ke=Ct.x+Ct.width-gi),zr>Ct.y?ut=Ct.y-zr:pi<Ct.y+Ct.height&&(ut=Ct.y+Ct.height-pi),_==="vertical"||typeof w=="number"&&w<Ae?Ke=0:(_==="horizontal"||typeof A=="number"&&A>=gn-Bi)&&(ut=0),(Ke!==0||ut!==0)&&(yt!==1&&(Ke/=yt,ut/=yt),Ht.current.scrollTo({left:Ke+Ht.current.scrollLeft,top:ut+Ht.current.scrollTop,behavior:K?.behavior??"auto"}))}}}},[G,mt,gr,Ht,fn,Ae,on,gn,ar,Jn]),Fa=f.useRef(ws),_a=f.useRef(x);Fa.current=ws,_a.current=x;const Aa=f.useRef(ze);Aa.current=ze;const ys=f.useRef(tt.length);ys.current=tt.length;const mr=f.useCallback(async(w,A=!0,_)=>{if(tt[w]?.trailingRowOptions?.disabled===!0)return;const Y=pe?.();let K,z=!0;Y!==void 0&&(K=await Y,K==="top"&&(z=!1),typeof K=="number"&&(z=!1));let U=0;const J=()=>{if(Aa.current<=ze){U<500&&window.setTimeout(J,U),U=50+U*2;return}const ie=typeof K=="number"?K:z?ze:0;Po.current(w-G,ie,"both",0,0,_?{behavior:_}:void 0),Mt({cell:[w,ie],range:{x:w,y:ie,width:1,height:1}},!1,!1,"edit");const ye=_a.current([w-G,ie]);ye.allowOverlay&&yi(ye)&&ye.readonly!==!0&&A&&window.setTimeout(()=>{Fa.current(w,ie)},0)};J()},[tt,pe,G,ze,Mt]),Io=f.useCallback(async(w,A=!0)=>{const _=et?.();let N,Y=!0;_!==void 0&&(N=await _,N==="left"&&(Y=!1),typeof N=="number"&&(Y=!1));let K=0;const z=()=>{if(ys.current<=tt.length){K<500&&window.setTimeout(z,K),K=50+K*2;return}const U=typeof N=="number"?N:Y?tt.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&&yi(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{Fa.current(U,w)},0)};z()},[tt,et,G,Yt,Mt]),si=f.useCallback(w=>{const A=on[w]?.trailingRowOptions?.targetColumn??De?.targetColumn;if(typeof A=="number")return A+(Tn?1:0);if(typeof A=="object"){const _=v.indexOf(A);if(_>=0)return _+(Tn?1:0)}},[on,v,Tn,De?.targetColumn]),vr=f.useRef(),ui=f.useRef(),_i=f.useCallback((w,A)=>{const[_,N]=A;return cr(st,tt[_]?.themeOverride,Dr?.(N),w.themeOverride)},[Dr,tt,st]),{mapper:_r}=ev(Nt,b),Bn=Nt?.navigationBehavior,Ai=f.useCallback(w=>{const A=ua.value?w.metaKey:w.ctrlKey,_=A&&ve==="multi",[N,Y]=w.location,K=q.columns,z=q.rows,[U,J]=q.current?.cell??[];if(w.kind==="cell"){if(ui.current=void 0,Ar.current=[N,Y],N===0&&Tn){if(_t===!0&&Y===ze||Sn==="number"||ve==="none")return;const ie=Dn(w.location);if(ie.kind!==$n.Marker)return;if(Kt!==void 0){const Je=Jt(ie);Pn(Je?.kind===$n.Marker);const Ke=Je?.onClick?.({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,theme:_i(ie,w.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===ie.checked)return}o(void 0),xn();const ye=z.hasIndex(Y),Rt=vr.current;if(ve==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&Rt!==void 0&&z.hasIndex(Rt)){const Je=[Math.min(Rt,Y),Math.max(Rt,Y)+1];_||Ne==="multi"?lt(void 0,Je,!0):lt(Qe.fromSingleSelection(Je),void 0,_)}else ve==="multi"&&(_||w.isTouch||Ne==="multi")?ye?lt(z.remove(Y),void 0,!0):(lt(void 0,Y,!0),vr.current=Y):ye&&z.length===1?lt(Qe.empty(),void 0,A):(lt(Qe.fromSingleSelection(Y),void 0,A),vr.current=Y)}else if(N>=G&&_t&&Y===ze){const ie=si(N);mr(ie??N)}else if(U!==N||J!==Y){const ie=Dn(w.location),ye=Jt(ie);if(ye?.onSelect!==void 0){let Ke=!1;if(ye.onSelect({...w,cell:ie,posX:w.localEventX,posY:w.localEventY,bounds:w.bounds,preventDefault:()=>Ke=!0,theme:_i(ie,w.location)}),Ke)return}if(Bn==="block"&&_r(Y).isGroupHeader)return;const Rt=ar&&Y===ze,Je=ar&&q!==void 0&&q.current?.cell[1]===ze;if((w.shiftKey||w.isLongTouch===!0)&&U!==void 0&&J!==void 0&&q.current!==void 0&&!Je){if(Rt)return;const Ke=Math.min(N,U),ut=Math.max(N,U),nt=Math.min(Y,J),yt=Math.max(Y,J);Mt({...q.current,range:{x:Ke,y:nt,width:ut-Ke+1,height:yt-nt+1}},!0,A,"click"),vr.current=void 0,xn()}else Mt({cell:[N,Y],range:{x:N,y:Y,width:1,height:1}},!0,A,"click"),vr.current=void 0,o(void 0),xn()}}else if(w.kind==="header")if(Ar.current=[N,Y],o(void 0),Tn&&N===0)vr.current=void 0,ui.current=void 0,!ti&&ve==="multi"&&(z.length!==ze?lt(Qe.fromSingleSelection([0,ze]),void 0,A):lt(Qe.empty(),void 0,A),xn());else{const ie=ui.current;if(ne==="multi"&&(w.shiftKey||w.isLongTouch===!0)&&ie!==void 0&&K.hasIndex(ie)){const ye=[Math.min(ie,N),Math.max(ie,N)+1];A||w.isTouch||ft==="multi"?qe(void 0,ye,A):qe(Qe.fromSingleSelection(ye),void 0,A)}else ne==="multi"&&(A||w.isTouch||ft==="multi")?(K.hasIndex(N)?qe(K.remove(N),void 0,A):qe(void 0,N,A),ui.current=N):ne!=="none"&&(K.hasIndex(N)?qe(K.remove(N),void 0,A):qe(Qe.fromSingleSelection(N),void 0,A),ui.current=N);vr.current=void 0,xn()}else w.kind===Yn?Ar.current=[N,Y]:w.kind===ca&&!w.isMaybeScrollbar&&(ge(Uo,!1),o(void 0),xn(),Bt?.(),vr.current=void 0,ui.current=void 0)},[ve,ne,q,Tn,G,_t,ze,Sn,Dn,Kt,xn,Ne,ft,Jt,_i,lt,si,mr,Bn,_r,ar,Mt,ti,qe,ge,Bt]),Hi=f.useRef(!1),Ar=f.useRef(),Cs=f.useRef(sr),er=f.useRef(),Pf=f.useCallback(w=>{if(ci.current=!1,Cs.current=Qt.current,w.button!==0&&w.button!==1){er.current=void 0;return}const A=performance.now();er.current={button:w.button,time:A,location:w.location},w?.kind==="header"&&(Hi.current=!0);const _=w.kind==="cell"&&w.isFillHandle;!_&&w.kind!=="cell"&&w.isEdge||(u({previousSelection:q,fillHandle:_}),Ar.current=void 0,!w.isTouch&&w.button===0&&!_?Ai(w):!w.isTouch&&w.button===1&&(Ar.current=w.location))},[q,Ai]),[Ha,za]=f.useState(),Ss=f.useCallback(w=>{if(w.kind!==Yn||ne!=="multi")return;const A=ua.value?w.metaKey:w.ctrlKey,[_]=w.location,N=q.columns;if(_<G)return;const Y=tt[_];let K=_,z=_;for(let U=_-1;U>=G&&uo(Y.group,tt[U].group);U--)K--;for(let U=_+1;U<tt.length&&uo(Y.group,tt[U].group);U++)z++;if(xn(),A||w.isTouch||ft==="multi")if(N.hasAll([K,z+1])){let U=N;for(let J=K;J<=z;J++)U=U.remove(J);qe(U,void 0,A)}else qe(void 0,[K,z+1],A);else qe(Qe.fromSingleSelection([K,z+1]),void 0,A)},[ne,xn,q.columns,tt,G,qe,ft]),ci=f.useRef(!1),Eo=f.useCallback(async w=>{if(ee!==void 0&&Ye!==void 0){const A=Qt.current.y,_=Qt.current.height;let N=ee({x:w,y:A,width:1,height:Math.min(_,ze-A)},$.current.signal);typeof N!="object"&&(N=await N());const Y=on[w-G],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=st.baseFontFull;const U=ld(z,st,Y,0,N,hr,ni,!1,Jt);Ye?.(Y,U.width,w,U.width)}}},[on,ee,ni,st,hr,Ye,G,ze,Jt]),[Lf,Va]=f.useState(),di=f.useCallback(async(w,A)=>{const _=w.current?.range;if(_===void 0||ee===void 0||A.current===void 0)return;const N=A.current.range;if(R!==void 0){let U=!1;if(R({fillDestination:{...N,x:N.x-G},patternSource:{..._,x:_.x-G},preventDefault:()=>U=!0}),U)return}let Y=ee(_,$.current.signal);typeof Y!="object"&&(Y=await Y());const K=Y,z=[];for(let U=0;U<N.width;U++)for(let J=0;J<N.height;J++){const ie=[N.x+U,N.y+J];if(qc(ie,_))continue;const ye=K[J%_.height][U%_.width];Si(ye)||!yi(ye)||z.push({location:ie,value:{...ye}})}zn(z),hn.current?.damage(z.map(U=>({cell:U.location})))},[ee,zn,R,G]),xs=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}}};di(w,q)},[di,q]),ks=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}}};di(w,q)},[di,q]),Ff=f.useCallback((w,A)=>{const _=l;if(u(void 0),Pa(void 0),Va(void 0),Hi.current=!1,A)return;if(_?.fillHandle===!0&&q.current!==void 0&&_.previousSelection?.current!==void 0){if(Fr===void 0)return;const ye={...q,current:{...q.current,range:fd(_.previousSelection.current.range,Fr)}};di(_.previousSelection,ye),ge(ye,!0);return}const[N,Y]=w.location,[K,z]=Ar.current??[],U=()=>{ci.current=!0},J=ye=>{const Rt=ye.isTouch||K===N&&z===Y;if(Rt&&T?.([N-G,Y],{...ye,preventDefault:U}),ye.button===1)return!ci.current;if(!ci.current){const Je=Dn(w.location),Ke=Jt(Je);if(Ke!==void 0&&Ke.onClick!==void 0&&Rt){const nt=Ke.onClick({...ye,cell:Je,posX:ye.localEventX,posY:ye.localEventY,bounds:ye.bounds,theme:_i(Je,w.location),preventDefault:U});nt!==void 0&&!Si(nt)&&wi(nt)&&(zn([{location:ye.location,value:nt}]),hn.current?.damage([{cell:ye.location}]))}if(ci.current||q.current===void 0)return!1;let ut=!1;switch(Je.activationBehaviorOverride??Re){case"double-click":case"second-click":{if(_?.previousSelection?.current?.cell===void 0)break;const[nt,yt]=q.current.cell,[Ct,hi]=_.previousSelection.current.cell;ut=N===nt&&N===Ct&&Y===yt&&Y===hi&&(ye.isDoubleClick===!0||Re==="second-click");break}case"single-click":{ut=!0;break}}if(ut){const yt={inputType:"pointer",pointerActivation:ye.isDoubleClick===!0?"double-click":Je.activationBehaviorOverride??Re,pointerType:ye.isTouch?"touch":"mouse"};return k?.([N-G,Y],yt),li(ye.bounds,yt),!0}}return!1},ie=w.location[0]-G;if(w.isTouch){const ye=Qt.current,Rt=Cs.current;if(ye.x!==Rt.x||ye.y!==Rt.y)return;if(w.isLongTouch===!0){if(w.kind==="cell"&&io(q.current?.cell,w.location)){W?.([ie,w.location[1]],{...w,preventDefault:U});return}else if(w.kind==="header"&&q.columns.hasIndex(N)){oe?.(ie,{...w,preventDefault:U});return}else if(w.kind===Yn){if(ie<0)return;re?.(ie,{...w,preventDefault:U});return}}w.kind==="cell"?J(w)||Ai(w):w.kind===Yn?V?.(ie,{...w,preventDefault:U}):(w.kind===Sr&&S?.(ie,{...w,preventDefault:U}),Ai(w));return}if(w.kind==="header"){if(ie<0)return;w.isEdge?w.isDoubleClick===!0&&Eo(N):w.button===0&&N===K&&Y===z&&S?.(ie,{...w,preventDefault:U})}if(w.kind===Yn){if(ie<0)return;w.button===0&&N===K&&Y===z&&(V?.(ie,{...w,preventDefault:U}),ci.current||Ss(w))}w.kind==="cell"&&(w.button===0||w.button===1)&&J(w),Ar.current=void 0},[l,q,G,Fr,di,ge,T,Dn,Jt,Re,_i,zn,k,li,W,oe,re,Ai,V,S,Eo,Ss]),_f=f.useCallback(w=>{const A={...w,location:[w.location[0]-G,w.location[1]]};at?.(A),l!==void 0&&w.buttons===0&&(u(void 0),Pa(void 0),Va(void 0),Hi.current=!1),Va(_=>Hi.current?[w.scrollEdge[0],0]:w.scrollEdge[0]===_?.[0]&&w.scrollEdge[1]===_[1]?_:l===void 0||(er.current?.location[0]??0)<G?void 0:w.scrollEdge)},[l,at,G]),Af=f.useCallback((w,A)=>{ht?.(w-G,A)},[ht,G]),Hf=f.useCallback((w,A)=>{Xe?.(w-G,A)},[Xe,G]),fi=q?.current?.cell,zf=f.useCallback((w,A,_,N,Y,K)=>{Lr.current=!1;let z=fi;z!==void 0&&(z=[z[0]-G,z[1]]);const U=Ae===0?void 0:{x:0,y:w.y,width:Ae,height:w.height},J=[];U!==void 0&&J.push(U),mt>0&&(J.push({x:w.x-G,y:ze-mt,width:w.width,height:mt}),Ae>0&&J.push({x:0,y:ze-mt,width:Ae,height:mt}));const ie={x:w.x-G,y:w.y,width:w.width,height:_t&&w.y+w.height>=ze?w.height-1:w.height,tx:Y,ty:K,extras:{selected:z,freezeRegion:U,freezeRegions:J}};Qt.current=ie,pr(ie),oi([A,_,N]),an?.(ie,ie.tx,ie.ty,ie.extras)},[fi,G,_t,ze,Ae,mt,pr,an]),Vf=Cr(E,f.useCallback((w,A)=>E?.(w-G,A-G)!==!1,[E,G])),$f=Cr(ke,f.useCallback((w,A)=>{ke?.(w-G,A-G),ne!=="none"&&qe(Qe.fromSingleSelection(A),void 0,!0)},[ne,ke,G,qe])),$a=f.useRef(!1),Nf=f.useCallback(w=>{if(w.location[0]===0&&G>0){w.preventDefault();return}Oe?.({...w,location:[w.location[0]-G,w.location[1]]}),w.defaultPrevented()||($a.current=!0),u(void 0)},[Oe,G]),Bf=f.useCallback(()=>{$a.current=!1},[]),Ms=Nt?.selectionBehavior,To=f.useCallback(w=>{if(Ms!=="block-spanning")return;const{isGroupHeader:A,path:_,groupRows:N}=_r(w);if(A)return[w,w];const Y=_[_.length-1],K=w-Y,z=w+N-Y-1;return[K,z]},[_r,Ms]),Na=f.useRef(),Ba=f.useCallback(w=>{if(!bd(w,Na.current)&&(Na.current=w,!(er?.current?.button!==void 0&&er.current.button>=1))){if(w.buttons!==0&&l!==void 0&&er.current?.location[0]===0&&G===1&&ve==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(er.current.location[1])&&q.rows.hasIndex(er.current.location[1])){const A=Math.min(er.current.location[1],w.location[1]),_=Math.max(er.current.location[1],w.location[1])+1;lt(Qe.fromSingleSelection([A,_]),void 0,!1)}else if(w.buttons!==0&&l!==void 0&&q.current!==void 0&&!$a.current&&!Hi.current&&(Ue==="rect"||Ue==="multi-rect")){const[A,_]=q.current.cell;let[N,Y]=w.location;if(Y<0&&(Y=Qt.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const K=l.previousSelection.current.range;Y=Math.min(Y,_t?ze-1:ze);const z=$m(K,N,Y,xt);Pa(z)}else{if(_t&&_===ze)return;if(_t&&Y===ze)if(w.kind===ca)Y--;else return;N=Math.max(N,G);const U=To(_);Y=U===void 0?Y:Vn(Y,U[0],U[1]);const J=N-A,ie=Y-_,ye={x:J>=0?A:N,y:ie>=0?_:Y,width:Math.abs(J)+1,height:Math.abs(ie)+1};Mt({...q.current,range:ye},!0,!1,"drag")}}Tt?.({...w,location:[w.location[0]-G,w.location[1]]})}},[l,G,ve,q,Ue,Tt,lt,_t,ze,xt,To,Mt]),Wf=f.useCallback(()=>{const w=Na.current;if(w===void 0)return;const[A,_]=w.scrollEdge;let[N,Y]=w.location;const K=Qt.current;A===-1?N=K.extras?.freezeRegion?.x??K.x:A===1&&(N=K.x+K.width),_===-1?Y=Math.max(0,K.y):_===1&&(Y=Math.min(ze-1,K.y+K.height)),N=Vn(N,0,tt.length-1),Y=Vn(Y,0,ze-1),Ba({...w,location:[N,Y]})},[tt.length,Ba,ze]);q0(Lf,Ht,Wf);const Wn=f.useCallback(w=>{if(q.current===void 0)return;const[A,_]=w,[N,Y]=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[ye,Rt]=To(Y)??[0,ze-1],Je=Rt+1;if(_!==0)switch(_){case 2:{ie=Je,J=Y,Yt(0,ie,"vertical");break}case-2:{J=ye,ie=Y+1,Yt(0,J,"vertical");break}case 1:{J<Y?(J++,Yt(0,J,"vertical")):(ie=Math.min(Je,ie+1),Yt(0,ie,"vertical"));break}case-1:{ie>Y+1?(ie--,Yt(0,ie,"vertical")):(J=Math.max(ye,J-1),Yt(0,J,"vertical"));break}default:lo()}if(A!==0)if(A===2)U=tt.length,z=N,Yt(U-1-G,0,"horizontal");else if(A===-2)z=G,U=N+1,Yt(z-G,0,"horizontal");else{let Ke=[];if(ee!==void 0){const ut=ee({x:z,y:J,width:U-z-G,height:ie-J},$.current.signal);typeof ut=="object"&&(Ke=ov(ut))}if(A===1){let ut=!1;if(z<N){if(Ke.length>0){const nt=kr(z+1,N+1).find(yt=>!Ke.includes(yt-G));nt!==void 0&&(z=nt,ut=!0)}else z++,ut=!0;ut&&Yt(z,0,"horizontal")}ut||(U=Math.min(tt.length,U+1),Yt(U-1-G,0,"horizontal"))}else if(A===-1){let ut=!1;if(U>N+1){if(Ke.length>0){const nt=kr(U-1,N,-1).find(yt=>!Ke.includes(yt-G));nt!==void 0&&(U=nt,ut=!0)}else U--,ut=!0;ut&&Yt(U-G,0,"horizontal")}ut||(z=Math.max(G,z-1),Yt(z-G,0,"horizontal"))}else lo()}Mt({cell:q.current.cell,range:{x:z,y:J,width:U-z,height:ie-J}},!0,!1,"keyboard-select")},[ee,To,q,tt.length,G,ze,Yt,Mt]),Wa=f.useRef(Zn);Wa.current=Zn;const br=f.useCallback((w,A,_,N)=>{const Y=gn-(_?0:1);w=Vn(w,G,on.length-1+G),A=Vn(A,0,Y);const K=fi?.[0],z=fi?.[1];if(w===K&&A===z)return!1;if(N&&q.current!==void 0){const U=[...q.current.rangeStack];(q.current.range.width>1||q.current.range.height>1)&&U.push(q.current.range),ge({...q,current:{cell:[w,A],range:{x:w,y:A,width:1,height:1},rangeStack:U}},!0)}else Mt({cell:[w,A],range:{x:w,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===w&&c.current[1]===A&&(c.current=void 0),Wa.current&&Yt(w-G,A),!0},[gn,G,on.length,fi,q,Yt,ge,Mt]),Uf=f.useCallback((w,A)=>{i?.cell!==void 0&&w!==void 0&&wi(w)&&(zn([{location:i.cell,value:w}]),window.requestAnimationFrame(()=>{hn.current?.damage([{cell:i.cell}])})),xn(!0),o(void 0);const[_,N]=A;if(q.current!==void 0&&(_!==0||N!==0)){const Y=q.current.cell[1]===gn-1&&w!==void 0,K=q.current.cell[0]===tt.length-1&&w!==void 0;let z=!0;if(Y&&N===1&&pe!==void 0){z=!1;const U=q.current.cell[0]+_,J=si(U);mr(J??U,!1)}if(K&&_===1&&et!==void 0){z=!1;const U=q.current.cell[1]+N;Io(U,!1)}z&&br(Vn(q.current.cell[0]+_,0,tt.length-1),Vn(q.current.cell[1]+N,0,gn-1),Y,!1)}P?.(w,A)},[i?.cell,xn,q,P,zn,gn,br,tt.length,mr,Io,pe,et,si]),Gf=f.useMemo(()=>`gdg-overlay-${iv++}`,[]),Hr=f.useCallback(w=>{xn();const A=[];for(let _=w.x;_<w.x+w.width;_++)for(let N=w.y;N<w.y+w.height;N++){const Y=x([_-G,N]);if(!Y.allowOverlay&&Y.kind!==Z.Boolean)continue;let K;if(Y.kind===Z.Custom){const z=Jt(Y),U=z?.provideEditor?.({...Y,location:[_-G,N]});z?.onDelete!==void 0?K=z.onDelete(Y):Yg(U)&&(K=U?.deletedValue?.(Y))}else(wi(Y)&&Y.allowOverlay||Y.kind===Z.Boolean)&&(K=Jt(Y)?.onDelete?.(Y));K!==void 0&&!Si(K)&&wi(K)&&A.push({location:[_,N],value:K})}zn(A),hn.current?.damage(A.map(_=>({cell:_.location})))},[xn,x,Jt,zn,G]),zi=i!==void 0,Rs=f.useCallback(w=>{const A=()=>{w.stopPropagation(),w.preventDefault()},_={didMatch:!1},{bounds:N}=w,Y=q.columns,K=q.rows,z=Qn;if(!zi&&rt(z.clear,w,_))ge(Uo,!1),Bt?.();else if(!zi&&rt(z.selectAll,w,_))ge({columns:Qe.empty(),rows:Qe.empty(),current:{cell:q.current?.cell??[G,0],range:{x:G,y:0,width:v.length,height:ze},rangeStack:[]}},!1);else if(rt(z.search,w,_))s?.current?.focus({preventScroll:!0}),Or(!0);else if(rt(z.delete,w,_)){const nt=Ut?.(q)??!0;if(nt!==!1){const yt=nt===!0?q:nt;if(yt.current!==void 0){Hr(yt.current.range);for(const Ct of yt.current.rangeStack)Hr(Ct)}for(const Ct of yt.rows)Hr({x:G,y:Ct,width:v.length,height:1});for(const Ct of yt.columns)Hr({x:Ct,y:0,width:1,height:ze})}}if(_.didMatch)return A(),!0;if(q.current===void 0)return!1;let[U,J]=q.current.cell;const[,ie]=q.current.cell;let ye=!1,Rt=!1;if(rt(z.scrollToSelectedCell,w,_))Po.current(U-G,J);else if(ne!=="none"&&rt(z.selectColumn,w,_))Y.hasIndex(U)?qe(Y.remove(U),void 0,!0):ne==="single"?qe(Qe.fromSingleSelection(U),void 0,!0):qe(void 0,U,!0);else if(ve!=="none"&&rt(z.selectRow,w,_))K.hasIndex(J)?lt(K.remove(J),void 0,!0):ve==="single"?lt(Qe.fromSingleSelection(J),void 0,!0):lt(void 0,J,!0);else if(!zi&&N!==void 0&&rt(z.activateCell,w,_))if(J===ze&&_t)window.setTimeout(()=>{const nt=si(U);mr(nt??U)},0);else{const nt={inputType:"keyboard",key:w.key};k?.([U-G,J],nt),li(N,nt)}else q.current.range.height>1&&rt(z.downFill,w,_)?ks():q.current.range.width>1&&rt(z.rightFill,w,_)?xs():rt(z.goToNextPage,w,_)?J+=Math.max(1,Qt.current.height-4):rt(z.goToPreviousPage,w,_)?J-=Math.max(1,Qt.current.height-4):rt(z.goToFirstCell,w,_)?(o(void 0),J=0,U=0):rt(z.goToLastCell,w,_)?(o(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):rt(z.selectToFirstCell,w,_)?(o(void 0),Wn([-2,-2])):rt(z.selectToLastCell,w,_)?(o(void 0),Wn([2,2])):zi?(rt(z.closeOverlay,w,_)&&o(void 0),rt(z.acceptOverlayDown,w,_)&&(o(void 0),J++),rt(z.acceptOverlayUp,w,_)&&(o(void 0),J--),rt(z.acceptOverlayLeft,w,_)&&(o(void 0),U--),rt(z.acceptOverlayRight,w,_)&&(o(void 0),U++)):(rt(z.goDownCell,w,_)?J+=1:rt(z.goUpCell,w,_)?J-=1:rt(z.goRightCell,w,_)?U+=1:rt(z.goLeftCell,w,_)?U-=1:rt(z.goDownCellRetainSelection,w,_)?(J+=1,ye=!0):rt(z.goUpCellRetainSelection,w,_)?(J-=1,ye=!0):rt(z.goRightCellRetainSelection,w,_)?(U+=1,ye=!0):rt(z.goLeftCellRetainSelection,w,_)?(U-=1,ye=!0):rt(z.goToLastRow,w,_)?J=ze-1:rt(z.goToFirstRow,w,_)?J=Number.MIN_SAFE_INTEGER:rt(z.goToLastColumn,w,_)?U=Number.MAX_SAFE_INTEGER:rt(z.goToFirstColumn,w,_)?U=Number.MIN_SAFE_INTEGER:(Ue==="rect"||Ue==="multi-rect")&&(rt(z.selectGrowDown,w,_)?Wn([0,1]):rt(z.selectGrowUp,w,_)?Wn([0,-1]):rt(z.selectGrowRight,w,_)?Wn([1,0]):rt(z.selectGrowLeft,w,_)?Wn([-1,0]):rt(z.selectToLastRow,w,_)?Wn([0,2]):rt(z.selectToFirstRow,w,_)?Wn([0,-2]):rt(z.selectToLastColumn,w,_)?Wn([2,0]):rt(z.selectToFirstColumn,w,_)&&Wn([-2,0])),Rt=_.didMatch);if(Bn!==void 0&&Bn!=="normal"&&J!==ie){const nt=Bn==="skip-up"||Bn==="skip"||Bn==="block",yt=Bn==="skip-down"||Bn==="skip"||Bn==="block",Ct=J<ie;if(Ct&&nt){for(;J>=0&&_r(J).isGroupHeader;)J--;J<0&&(J=ie)}else if(!Ct&&yt){for(;J<ze&&_r(J).isGroupHeader;)J++;J>=ze&&(J=ie)}}const Ke=br(U,J,!1,ye),ut=_.didMatch;return ut&&(Ke||!Rt||Cn)&&A(),ut},[Bn,zi,q,Qn,ne,ve,Ue,G,_r,ze,br,ge,Bt,v.length,Ut,Cn,Hr,qe,lt,_t,si,mr,k,li,ks,xs,Wn]),Vi=f.useCallback(w=>{let A=!1;if(X!==void 0&&X({...w,...w.location&&{location:[w.location[0]-G,w.location[1]]},cancel:()=>{A=!0}}),A||Rs(w)||q.current===void 0)return;const[_,N]=q.current.cell,Y=Qt.current;if(Se&&!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&&yi(x([_-G,Math.max(0,Math.min(N,ze-1))]))){if((!_t||N!==ze)&&(Y.y>N||N>Y.y+Y.height||Y.x>_||_>Y.x+Y.width))return;const K={inputType:"keyboard",key:w.key};k?.([_-G,N],K),li(w.bounds,K,w.key),w.stopPropagation(),w.preventDefault()}},[Se,X,Rs,q,x,G,ze,_t,k,li]),Yf=f.useCallback((w,A)=>{const _=w.location[0]-G;if(w.kind==="header"&&oe?.(_,{...w,preventDefault:A}),w.kind===Yn){if(_<0)return;re?.(_,{...w,preventDefault:A})}if(w.kind==="cell"){const[N,Y]=w.location;W?.([_,Y],{...w,preventDefault:A}),Yp(q,w.location)||br(N,Y,!1,!1)}},[q,W,re,oe,G,br]),Ua=f.useCallback(async w=>{if(!Qn.paste)return;function A(z,U,J,ie){const ye=typeof J=="object"?J?.join(`
173
173
  `)??"":J?.toString()??"";if(!Si(z)&&yi(z)&&z.readonly!==!0){const Rt=I?.(ye,z);if(Rt!==void 0&&wi(Rt))return{location:U,value:Rt};const Je=Jt(z);if(Je===void 0)return;if(Je.kind===Z.Custom){Pn(z.kind===Z.Custom);const Ke=Je.onPaste?.(ye,z.data);return Ke===void 0?void 0:{location:U,value:{...z,data:Ke}}}else{const Ke=Je.onPaste?.(ye,z,{formatted:ie,formattedString:typeof ie=="string"?ie:ie?.join(`
174
- `),rawValue:J});return Ke===void 0?void 0:(Pn(Ke.kind===z.kind),{location:U,value:Ke})}}}const _=q.columns,N=q.rows,X=Ht.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]:_.length===1?K=[_.first()??0,0]:N.length===1&&(K=[G,N.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 ut of Ke){if(ut.types.includes(ie)){const yt=await(await ut.getType(ie)).text(),Ct=Su(yt);if(Ct!==void 0){z=Ct;break}}ut.types.includes(J)&&(U=await(await ut.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=Su(Ke)}z===void 0&&w.clipboardData.types.includes(J)&&(U=w.clipboardData.getData(J))}else return;const[ye,Rt]=K,Je=[];do{if(Pe===void 0){const Ke=Dn(K),ut=U??z?.map(yt=>yt.map(Ct=>Ct.rawValue).join(" ")).join(" ")??"",nt=A(Ke,K,ut,void 0);nt!==void 0&&Je.push(nt);break}if(z===void 0){if(U===void 0)return;z=B0(U)}if(Pe===!1||typeof Pe=="function"&&Pe?.([K[0]-G,K[1]],z.map(Ke=>Ke.map(ut=>ut.rawValue?.toString()??"")))!==!0)return;for(const[Ke,ut]of z.entries()){if(Ke+Rt>=ze)break;for(const[nt,yt]of ut.entries()){const Ct=[nt+ye,Ke+Rt],[hi,Ni]=Ct;if(hi>=tt.length||Ni>=gn)continue;const Bi=Dn(Ct),tr=A(Bi,Ct,yt.rawValue,yt.formatted);tr!==void 0&&Je.push(tr)}}}while(!1);zn(Je),hn.current?.damage(Je.map(Ke=>({cell:Ke.location})))}},[I,Jt,Dn,q,Qn.paste,Ht,tt.length,zn,gn,Pe,G,ze]);kn("paste",Ua,d,!1,!0);const $i=f.useCallback(async(w,A)=>{if(!Qn.copy)return;const _=A===!0||Ht.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,N=q.columns,X=q.rows,K=(z,U)=>{if(!we)ku(z,U,w);else{const J=U.map(ie=>({kind:Z.Text,data:v[ie].title,displayData:v[ie].title,allowOverlay:!1}));ku([J,...z],U,w)}};if(_&&ee!==void 0){if(q.current!==void 0){let z=ee(q.current.range,$.current.signal);typeof z!="object"&&(z=await z()),K(z,kr(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},$.current.signal);return typeof ie=="object"?ie[0]:ie().then(ye=>ye[0])});if(U.some(J=>J instanceof Promise)){const J=await Promise.all(U);K(J,kr(v.length))}else K(U,kr(v.length))}else if(N.length>0){const z=[],U=[];for(const J of N){let ie=ee({x:J,y:0,width:1,height:ze},$.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,ye)=>ie.map((Rt,Je)=>[...Rt,...ye[Je]]));K(J,U)}}}},[v,ee,q,Qn.copy,G,Ht,ze,we]);kn("copy",$i,d,!1,!1);const Yf=f.useCallback(async w=>{if(!(!Qn.cut||!(Ht.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await $i(w),q.current!==void 0)){let _={current:{cell:q.current.cell,range:q.current.range,rangeStack:[]},rows:Qe.empty(),columns:Qe.empty()};const N=Ut?.(_);if(N===!1||(_=N===!0?_:N,_.current===void 0))return;Hr(_.current.range)}},[Hr,q,Qn.cut,$i,Ht,Ut]);kn("cut",Yf,d,!1,!1);const jf=f.useCallback((w,A)=>{if(fe!==void 0){G!==0&&(w=w.map(X=>[X[0]-G,X[1]])),fe(w,A);return}if(w.length===0||A===-1)return;const[_,N]=w[A];c.current!==void 0&&c.current[0]===_&&c.current[1]===N||(c.current=[_,N],br(_,N,!1,!1))},[fe,G,br]),[Do,Oo]=It?.current?.cell??[],Po=f.useRef(Xt);Po.current=Xt,f.useLayoutEffect(()=>{Wa.current&&!Lr.current&&Do!==void 0&&Oo!==void 0&&(Do!==ce.current?.current?.cell[0]||Oo!==ce.current?.current?.cell[1])&&Po.current(Do,Oo),Lr.current=!1},[Do,Oo]);const Is=q.current!==void 0&&(q.current.cell[0]>=tt.length||q.current.cell[1]>=gn);f.useLayoutEffect(()=>{Is&&ge(Uo,!1)},[Is,ge]);const qf=f.useMemo(()=>_t===!0&&De?.tint===!0?Qe.fromSingleSelection(gn-1):Qe.empty(),[gn,_t,De?.tint]),Kf=f.useCallback(w=>typeof nn=="boolean"?nn:nn?.(w-G)??!0,[G,nn]),Zf=f.useMemo(()=>{if(Ha===void 0||a.current===null)return null;const{bounds:w,group:A}=Ha,_=a.current.getBoundingClientRect();return f.createElement(O0,{bounds:w,group:A,canvasBounds:_,onClose:()=>za(void 0),onFinish:N=>{za(void 0),se?.(A,N)}})},[se,Ha]),Jf=Math.min(tt.length,Ae+(Tn?1:0));f.useImperativeHandle(t,()=>({appendRow:(w,A)=>mr(w+G,A),appendColumn:(w,A)=>Io(w,A),updateCells:w=>(G!==0&&(w=w.map(A=>({cell:[A.cell[0]+G,A.cell[1]]}))),hn.current?.damage(w)),getBounds:(w,A)=>{if(!(a?.current===null||Ht?.current===null)){if(w===void 0&&A===void 0){const _=a.current.getBoundingClientRect(),N=_.width/Ht.current.clientWidth;return{x:_.x-Ht.current.scrollLeft*N,y:_.y-Ht.current.scrollTop*N,width:Ht.current.scrollWidth*N,height:Ht.current.scrollHeight*N}}return hn.current?.getBounds((w??0)+G,A)}},focus:()=>hn.current?.focus(),emit:async w=>{switch(w){case"delete":Vi({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":Vi({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":Vi({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 $i(void 0,!0);break;case"paste":await Ua();break}},scrollTo:Xt,remeasureColumns:w=>{for(const A of w)Eo(A+G)},getMouseArgsForPosition:(w,A,_)=>{if(hn?.current===null)return;const N=hn.current.getMouseArgsForPosition(w,A,_);if(N!==void 0)return{...N,location:[N.location[0]-G,N.location[1]]}}}),[mr,Io,Eo,Ht,$i,Vi,Ua,G,Xt]);const[Es,Ts]=fi??[],Qf=f.useCallback(w=>{const[A,_]=w;if(_===-1){ne!=="none"&&(qe(Qe.fromSingleSelection(A),void 0,!1),xn());return}Es===A&&Ts===_||(Mt({cell:w,range:{x:A,y:_,width:1,height:1}},!0,!1,"keyboard-nav"),Xt(A,_))},[ne,xn,Xt,Es,Ts,Mt,qe]),[eh,th]=f.useState(!1),Ds=f.useRef(Rc(w=>{th(w)},5)),nh=f.useCallback(()=>{Ds.current(!0),q.current===void 0&&q.columns.length===0&&q.rows.length===0&&l===void 0&&Mt({cell:[G,So],range:{x:G,y:So,width:1,height:1}},!0,!1,"keyboard-select")},[So,q,l,G,Mt]),rh=f.useCallback(()=>{Ds.current(!1)},[]),[ih,oh]=f.useMemo(()=>{let w;const A=bt?.scrollbarWidthOverride??bl(),_=ze+(_t?1:0);if(typeof Jn=="number")w=fn+_*Jn;else{let X=0;const K=Math.min(_,10);for(let z=0;z<K;z++)X+=Jn(z);X=Math.floor(X/K),w=fn+_*X}w+=A;const N=tt.reduce((X,K)=>K.width+X,0)+A;return[`${Math.min(1e5,N)}px`,`${Math.min(1e5,w)}px`]},[tt,bt?.scrollbarWidthOverride,Jn,ze,_t,fn]),ah=f.useMemo(()=>am(st),[st]);return f.createElement(od.Provider,{value:st},f.createElement(X0,{style:ah,className:j,inWidth:m??ih,inHeight:y??oh},f.createElement(I0,{fillHandle:Ot,drawFocusRing:Zr,experimental:bt,fixedShadowX:bn,fixedShadowY:ir,getRowThemeOverride:Dr,headerIcons:Kn,imageWindowLoader:B,initialSize:Be,isDraggable:je,onDragLeave:Pt,onRowMoved:Kt,overscrollX:Ea,overscrollY:Ta,preventDiagonalScrolling:wn,rightElement:Gt,rightElementProps:yn,smoothScrollX:jr,smoothScrollY:qr,className:j,enableGroups:Hn,onCanvasFocused:nh,onCanvasBlur:rh,canvasRef:a,onContextMenu:Xf,theme:st,cellXOffset:Df,cellYOffset:So,accessibilityHeight:sr.height,onDragEnd:Bf,columns:tt,nonGrowWidth:Lt,drawHeader:vt,onColumnProposeMove:Vf,drawCell:sn,disabledRows:qf,freezeColumns:Jf,lockColumns:G,firstColAccessible:G===0,getCellContent:Dn,minColumnWidth:hr,maxColumnWidth:ni,searchInputRef:s,showSearch:Oa,onSearchClose:ii,highlightRegions:Of,getCellsForSelection:ee,getGroupDetails:La,headerHeight:Fi,isFocused:eh,groupHeaderHeight:Hn?Co:0,freezeTrailingRows:mt+(_t&&De?.sticky===!0?1:0),hasAppendRow:_t,onColumnResize:Xe,onColumnResizeEnd:Me,onColumnResizeStart:Ze,onCellFocused:Qf,onColumnMoved:$f,onDragStart:Nf,onHeaderMenuClick:Af,onHeaderIndicatorClick:Hf,onItemHovered:Ba,isFilling:l?.fillHandle===!0,onMouseMove:_f,onKeyDown:Vi,onKeyUp:te,onMouseDown:Pf,onMouseUp:Ff,onDragOverCell:un,onDrop:$t,onSearchResultsChanged:jf,onVisibleRegionChanged:zf,clientSize:At,rowHeight:Jn,searchResults:ue,searchValue:L,onSearchValueChange:H,rows:gn,scrollRef:Ht,selection:q,translateX:sr.tx,translateY:sr.ty,verticalBorder:Kf,gridRef:hn,getCellRenderer:Jt,resizeIndicator:Oi}),Zf,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(rv,{...i,validateCell:Te,bloom:D,id:Gf,getCellRenderer:Jt,className:bt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:Mn,imageEditorOverride:g,portalElementRef:wo,onFinishEditing:Uf,markdownDivCreateNode:p,isOutsideClick:cn,customEventTarget:bt?.eventTarget}))))},lv=f.forwardRef(av);function Iu(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:s,height:a,x:l,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=Vc(c,a,o.cellVerticalPadding),h=zc(t.contentAlign??"center",l,s,o.cellHorizontalPadding,g),p=Hc(h,d,g),m=$c(l+n,u+r,p);return Al(t)&&m}const sv={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>uv(e,e.cell.data,Al(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Iu(e)&&e.preventDefault()},onClick:e=>{if(Iu(e))return{...e.cell,data:yd(e.cell.data)}},onPaste:(e,t)=>{let n=ia;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 uv(e,t,n,r,i){if(!n&&t===ia)return;const{ctx:o,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:p,width:m,height:y}=l;let v=!1;if(i>0){let b=n?1-i+i*s:.4;if(t===ia&&(b*=s),b===0)return;b<1&&(v=!0,o.globalAlpha=b)}Yl(o,a,t,h,p,m,y,u,c,d,r,g),v&&(o.globalAlpha=1)}const cv=dn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),dv=e=>{const{bubbles:t}=e;return f.createElement(cv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},fv={getAccessibilityString:e=>Nc(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=>hv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(dv,{bubbles:t.data})},onPaste:()=>{}};function hv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:s,y:a,width:l,height:u}=n;let c=s+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>s+l)break;const h=Ir(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)jn(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 gv=dn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),pv=e=>{const{drilldowns:t}=e;return f.createElement(gv,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))))},mv={getAccessibilityString:e=>Nc(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=>bv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(pv,{drilldowns:t.data})},onPaste:()=>{}},rl={};function vv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,s=n-o*2,a=4,l=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(rl[g]!==void 0)return{el:rl[g],height:l,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=l,p.scale(i,i),rl[g]=h,p.beginPath(),jn(p,o,o,c,s,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),jn(p,o+.5,o+.5,c,s,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:h,height:l,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function bv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:s,row:a}=e,{x:l,width:u}=n,c=r.baseFontFull,d=Wl(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=l+r.cellHorizontalPadding;const b=r.roundingRadius??6,x=vv(r.bgCell,r.drilldownBorder,g,b),T=[];for(const k of t){if(v>l+u)break;const P=Ir(k.text,i,c).width;let I=0;k.img!==void 0&&o.loadOrGetImage(k.img,s,a)!==void 0&&(I=p-8+4);const C=P+I+m*2;T.push({x:v,width:C}),v+=C+y}if(x!==null){const{el:k,height:R,middleWidth:P,sideWidth:I,width:C,dpr:F,padding:D}=x,S=I/F,E=D/F;for(const O of T){const M=Math.floor(O.x),V=Math.floor(O.width),W=V-(S-E)*2;i.imageSmoothingEnabled=!1,i.drawImage(k,0,0,I,R,M-E,h,S,g),W>0&&i.drawImage(k,I,0,P,R,M+(S-E),h,W,g),i.drawImage(k,C-I,0,I,R,M+V-(S-E),h,S,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[k,R]of T.entries()){const P=t[k];let I=R.x+m;if(P.img!==void 0){const C=o.loadOrGetImage(P.img,s,a);if(C!==void 0){const F=p-8;let D=0,S=0,E=C.width,O=C.height;E>O?(D+=(E-O)/2,E=O):O>E&&(S+=(O-E)/2,O=E),i.beginPath(),jn(i,I,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(C,D,S,E,O,I,h+g/2-F/2,F,F),i.restore(),I+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(P.text,I,h+g/2+qn(i,r))}}const wv={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>yv(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??mp;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}}},il=4;function yv(e,t,n,r){const{rect:i,col:o,row:s,theme:a,ctx:l,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 x=t[b];if(x.length===0)continue;const T=u.loadOrGetImage(x,o,s);if(T!==void 0){m[b]=T;const k=T.width*(p/T.height);y+=k+il}}if(y===0)return;y-=il;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 x=b.width*(p/b.height);n>0&&(l.beginPath(),jn(l,v,d+a.cellVerticalPadding,x,p,n),l.save(),l.clip()),l.drawImage(b,v,d+a.cellVerticalPadding,x,p),n>0&&l.restore(),v+=x+il}}function Cv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Sv={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:s}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(Cv(n,r)*t.skeletonWidthVariability));const l=s.cellHorizontalPadding;a+l*2>=o.width&&(a=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*s.cellVerticalPadding);jn(i,o.x+l,o.y+(o.height-u)/2,a,u,s.roundingRadius??3),i.fillStyle=Wr(s.textDark,.1),i.fill()},onPaste:()=>{}},xv=()=>e=>e.targetWidth,Eu=dn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[xv(),"px"]}}),kv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:s,validatedSelection:a}=e,l=t.data,u=t.readonly===!0,[c,d]=f.useState(l===""||r),g=f.useCallback(()=>{d(p=>!p)},[]),h=l?"gdg-ml-6":"";return c?f.createElement(Eu,{targetWidth:o.width-20},f.createElement(Xr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:l,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>s(t)},f.createElement(up,null))):f.createElement(Eu,{targetWidth:o.width},f.createElement(_p,{contents:l,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(zl,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Mv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:bo,measure:(e,t,n)=>{const r=t.data.split(`
175
- `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>nr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:s,validatedSelection:a}=e;return f.createElement(kv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Rv={getAccessibilityString:e=>e.row.toString(),kind:$n.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Iv,measure:()=>44,draw:e=>Tv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Iv(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=Ev,n.textAlign="center",o}function Ev(e){const{ctx:t}=e;t.textAlign="start"}function Tv(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:d,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&p>0){s.globalAlpha=p;const m=7*(n?l:1);if(Yl(s,u,n,i?c+m:c,d,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const y of[3,6])for(const v of[-5,-1,3])s.rect(c+y,d+h/2+v,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),y=u.markerFontFull,v=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=y,s.fillText(m,v,d+h/2+qn(s,y)),l!==0&&(s.globalAlpha=1)}}const Dv={getAccessibilityString:()=>"",kind:$n.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Ov(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Ov(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,d-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=d-8,y=l+8/2,v=u+8/2;a.drawSprite(n,"normal",r,y,v,m,s,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,y=g?0:(1-o)*p*.5,v=s.cellHorizontalPadding+4;m>0&&(r.moveTo(l+v+y,u+d/2),r.lineTo(l+v+y+m,u+d/2),r.moveTo(l+v+y+m*.5,u+d/2-m*.5),r.lineTo(l+v+y+m*.5,u+d/2+m*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+d/2+qn(r,s)),r.beginPath()}function xd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Pv(e,i,r,t,n?.fullSize??!1);e.beginPath(),jn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Wr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Pv(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=Ir(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const Lv=f.lazy(async()=>await Ll(()=>import("./number-overlay-editor.CoqRgZW_.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url)),Fv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:bo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&xd(r,i,u,l,o,t,s),nr(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(Lv,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},_v={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Av,onPaste:()=>{}};function Av(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:s}=r;t.beginPath();const a=2.5;let l=i+n.cellHorizontalPadding+a;const u=o+s/2,c=Math.cos(tu(30))*a,d=Math.sin(tu(30))*a;for(let g=0;g<12;g++)t.moveTo(l,u-a),t.lineTo(l,u+a),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Hv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>bo(e,t,e.theme.textLight),draw:e=>nr(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 zt.createElement(Xr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},zv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:bo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&xd(i,s,g,l,o,n,a),nr(e,l,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
176
- `,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return f.createElement(Xr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:s=>r({...i,data:s.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Vv=dn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),$v=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:s}=e,[a,l]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{l(!0)},[]);return a?f.createElement(Xr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(Vv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},s),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(zl,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function kd(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,s=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-s-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-s/2),{x:i,y:o,width:s,height:a}}function Tu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,s=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=Qc(s,o.baseFontFull);if(a===void 0)return!1;const l=kd(a,n,o,t.contentAlign);return Br({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,i)}const Nv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:bo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:s,ctx:a}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Ir(l,a,n.baseFontFull),d=kd(c,s,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(s.x+g,Math.floor(s.y+b+m+v)+.5),a.lineTo(s.x+g+p,Math.floor(s.y+b+m+v)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,nr({...e,rect:{...s,x:s.x-1}},l,t.contentAlign),nr({...e,rect:{...s,x:s.x-2}},l,t.contentAlign),nr({...e,rect:{...s,x:s.x+1}},l,t.contentAlign),nr({...e,rect:{...s,x:s.x+2}},l,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,nr(e,l,t.contentAlign)},onSelect:e=>{Tu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;Tu(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($v,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:s=>n({...r,data:s.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Bv=[Rv,Dv,sv,fv,mv,wv,Sv,Mv,Fv,_v,Hv,zv,Nv],ol=[];class Wv extends nd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=yg(()=>{this.imageLoaded(new ao(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const s=r.cells[o];if(this.isInWindow(s)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const s=ol.pop()??new Image;let a=!1;const l={img:void 0,cells:[Yn(n,r)],url:t,cancel:()=>{a||(a=!0,ol.length<12?ol.unshift(s):o||(s.src=""))}},u=new Promise(c=>s.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{s.src=t,await u,await s.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=s;for(const d of c.cells)this.loadedLocations.push(Xl(d));o=!0,this.sendLoaded()}}catch{l.cancel()}}),this.cache[i]=l}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const s=Yn(n,r);return o.cells.includes(s)||o.cells.push(s),o.img}else this.loadImage(t,n,r,i)}}const Uv=(e,t)=>{const n=f.useMemo(()=>({...Hm,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??Bv,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new Wv,[e.imageWindowLoader]);return f.createElement(lv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Gv=f.forwardRef(Uv);function Md(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((...s)=>{r.current=s,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}var Qo={exports:{}};var Xv=Qo.exports,Du;function Yv(){return Du||(Du=1,(function(e,t){(function(n,r){try{e.exports=r(pg)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(Xv,function(n){var r=!1,i=!1,o=!1,s=!1,a="escape years months weeks days hours minutes seconds milliseconds general".split(" "),l=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(H,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,te=!0;te&&Y<L.length;)Y?L[Y]==="9"?L[Y]="0":(L[Y]=(parseInt(L[Y],10)+1).toString(),te=!1):(parseInt(L[Y],10)<5&&(te=!1),L[Y]="0"),Y+=1;return te&&L.push("1"),L.reverse().join("")}function g(H,L){var Y=P(M(L).sort(),function(le){return le+":"+L[le]}).join(","),te=H+"+"+Y;return g.cache[te]||(g.cache[te]=Intl.NumberFormat(H,L)),g.cache[te]}g.cache={};function h(H,L,Y){var te=L.useToLocaleString,le=L.useGrouping,Se=le&&L.grouping.slice(),pe=L.maximumSignificantDigits,et=L.minimumIntegerDigits||1,ke=L.fractionDigits||0,Dt=L.groupingSeparator,dt=L.decimalSeparator;if(te&&Y){var Ue={minimumIntegerDigits:et,useGrouping:le};if(ke&&(Ue.maximumFractionDigits=ke,Ue.minimumFractionDigits=ke),pe&&H>0&&(Ue.maximumSignificantDigits=pe),o){if(!s){var ne=O({},L);ne.useGrouping=!1,ne.decimalSeparator=".",H=parseFloat(h(H,ne),10)}return g(Y,Ue).format(H)}else{if(!i){var ne=O({},L);ne.useGrouping=!1,ne.decimalSeparator=".",H=parseFloat(h(H,ne),10)}return H.toLocaleString(Y,Ue)}}var ve;pe?ve=H.toPrecision(pe+1):ve=H.toFixed(ke+1);var me,he,Ce,_e=ve.split("e");Ce=_e[1]||"",_e=_e[0].split("."),he=_e[1]||"",me=_e[0]||"";var Oe=me.length,at=he.length,Pe=Oe+at,we=me+he;(pe&&Pe===pe+1||!pe&&at===ke+1)&&(we=d(we),we.length===Pe+1&&(Oe=Oe+1),at&&(we=we.slice(0,-1)),me=we.slice(0,Oe),he=we.slice(Oe)),pe&&(he=he.replace(/0*$/,""));var Ae=parseInt(Ce,10);Ae>0?he.length<=Ae?(he=he+c(Ae-he.length),me=me+he,he=""):(me=me+he.slice(0,Ae),he=he.slice(Ae)):Ae<0&&(he=c(Math.abs(Ae)-me.length)+me+he,me="0"),pe||(he=he.slice(0,ke),he.length<ke&&(he=he+c(ke-he.length)),me.length<et&&(me=c(et-me.length)+me));var Re="";if(le){_e=me;for(var Ne;_e.length;)Se.length&&(Ne=Se.shift()),Re&&(Re=Dt+Re),Re=_e.slice(-Ne)+Re,_e=_e.slice(0,-Ne)}else Re=me;return he&&(Re=Re+dt+he),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 R(M(L),function(te){if(te.slice(0,15)==="_durationLabels"){var le=te.slice(15).toLowerCase();R(M(L[te]),function(Se){Se.slice(0,1)===H&&Y.push({type:le,key:Se,label:L[te][Se]})})}}),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 x(H){return Object.prototype.toString.call(H)==="[object Object]"}function T(H,L){for(var Y=H.length;Y-=1;)if(L(H[Y]))return H[Y]}function k(H,L){var Y=0,te=H&&H.length||0,le;for(typeof L!="function"&&(le=L,L=function(Se){return Se===le});Y<te;){if(L(H[Y]))return H[Y];Y+=1}}function R(H,L){var Y=0,te=H.length;if(!(!H||!te))for(;Y<te;){if(L(H[Y],Y)===!1)return;Y+=1}}function P(H,L){var Y=0,te=H.length,le=[];if(!H||!te)return le;for(;Y<te;)le[Y]=L(H[Y],Y),Y+=1;return le}function I(H,L){return P(H,function(Y){return Y[L]})}function C(H){var L=[];return R(H,function(Y){Y&&L.push(Y)}),L}function F(H){var L=[];return R(H,function(Y){k(L,Y)||L.push(Y)}),L}function D(H,L){var Y=[];return R(H,function(te){R(L,function(le){te===le&&Y.push(te)})}),F(Y)}function S(H,L){var Y=[];return R(H,function(te,le){if(!L(te))return Y=H.slice(le),!1}),Y}function E(H,L){var Y=H.slice().reverse();return S(Y,L).reverse()}function O(H,L){for(var Y in L)L.hasOwnProperty(Y)&&(H[Y]=L[Y]);return H}function M(H){var L=[];for(var Y in H)H.hasOwnProperty(Y)&&L.push(Y);return L}function V(H,L){var Y=0,te=H.length;if(!H||!te)return!1;for(;Y<te;){if(L(H[Y],Y)===!0)return!0;Y+=1}return!1}function W(H){var L=[];return R(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(R(H,function(pe,et){if(!et){if(!b(pe))throw"Expected array as the first argument to durationsFormat.";Y=pe}if(typeof pe=="string"||typeof pe=="function"){L.template=pe;return}if(typeof pe=="number"){L.precision=pe;return}x(pe)&&O(L,pe)}),!Y||!Y.length)return[];L.returnMomentTypes=!0;var te=P(Y,function(pe){return pe.format(L)}),le=D(a,F(I(W(te),"type"))),Se=L.largest;return Se&&(le=le.slice(0,Se)),L.returnMomentTypes=!1,L.outputTypes=le,P(Y,function(pe){return pe.format(L)})}function se(){var H=[].slice.call(arguments),L=O({},this.format.defaults),Y=this.asMilliseconds(),te=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(Y=0,te=0);var le=Y<0,Se=n.duration(Math.abs(Y),"milliseconds"),pe=n.duration(Math.abs(te),"months");R(H,function(B){if(typeof B=="string"||typeof B=="function"){L.template=B;return}if(typeof B=="number"){L.precision=B;return}x(B)&&O(L,B)});var et={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},ke={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};L.types=a;var Dt=function(B){return k(a,function(Be){return ke[Be].test(B)})},dt=new RegExp(P(a,function(B){return ke[B].source}).join("|"),"g");L.duration=this;var Ue=typeof L.template=="function"?L.template.apply(L):L.template,ne=L.outputTypes,ve=L.returnMomentTypes,me=L.largest,he=[];ne||(b(L.stopTrim)&&(L.stopTrim=L.stopTrim.join("")),L.stopTrim&&R(L.stopTrim.match(dt),function(B){var Be=Dt(B);Be==="escape"||Be==="general"||he.push(Be)}));var Ce=n.localeData();Ce||(Ce={}),R(M(v),function(B){if(typeof v[B]=="function"){Ce[B]||(Ce[B]=v[B]);return}Ce["_"+B]||(Ce["_"+B]=v[B])}),R(M(Ce._durationTimeTemplates),function(B){Ue=Ue.replace("_"+B+"_",Ce._durationTimeTemplates[B])});var _e=L.userLocale||n.locale(),Oe=L.useLeftUnits,at=L.usePlural,Pe=L.precision,we=L.forceLength,Ae=L.useGrouping,Re=L.trunc,Ne=L.useSignificantDigits&&Pe>0,ft=Ne?L.precision:0,ht=ft,Ye=L.minValue,pt=!1,Nt=L.maxValue,St=!1,Tt=L.useToLocaleString,Bt=L.groupingSeparator,qt=L.decimalSeparator,an=L.grouping;Tt=Tt&&(r||o);var It=L.trim;b(It)&&(It=It.join(" ")),It===null&&(me||Nt||Ne)&&(It="all"),(It===null||It===!0||It==="left"||It==="right")&&(It="large"),It===!1&&(It="");var gt=function(B){return B.test(It)},Wt=/large/,wt=/small/,ln=/both/,Mn=/mid/,De=/^all|[^sm]all/,mt=/final/,xt=me>0||V([Wt,ln,De],gt),vn=V([wt,ln,De],gt),tn=V([Mn,De],gt),nn=V([mt,De],gt),un=P(Ue.match(dt),function(B,Be){var je=Dt(B);return B.slice(0,1)==="*"&&(B=B.slice(1),je!=="escape"&&je!=="general"&&he.push(je)),{index:Be,length:B.length,text:"",token:je==="escape"?B.replace(ke.escape,"$1"):B,type:je==="escape"||je==="general"?null:je}}),$t={index:0,length:0,token:"",text:"",type:null},Zt=[];Oe&&un.reverse(),R(un,function(B){if(B.type){($t.type||$t.text)&&Zt.push($t),$t=B;return}Oe?$t.text=B.token+$t.text:$t.text+=B.token}),($t.type||$t.text)&&Zt.push($t),Oe&&Zt.reverse();var Ge=D(a,F(C(I(Zt,"type"))));if(!Ge.length)return I(Zt,"text").join("");Ge=P(Ge,function(B,Be){var je=Be+1===Ge.length,Pt=!Be,Kt;B==="years"||B==="months"?Kt=pe.as(B):Kt=Se.as(B);var rn=Math.floor(Kt),En=Kt-rn,wn=k(Zt,function(Gt){return B===Gt.type});return Pt&&Nt&&Kt>Nt&&(St=!0),je&&Ye&&Math.abs(L.duration.as(B))<Ye&&(pt=!0),Pt&&we===null&&wn.length>1&&(we=!0),Se.subtract(rn,B),pe.subtract(rn,B),{rawValue:Kt,wholeValue:rn,decimalValue:je?En:0,isSmallest:je,isLargest:Pt,type:B,tokenLength:wn.length}});var kt=Re?Math.floor:Math.round,In=function(B,Be){var je=Math.pow(10,Be);return kt(B*je)/je},Ot=!1,bt=!1,bn=function(B,Be){var je={useGrouping:Ae,groupingSeparator:Bt,decimalSeparator:qt,grouping:an,useToLocaleString:Tt};return Ne&&(ft<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(je.maximumSignificantDigits=ft,B.significantDigits=ft)),St&&!bt&&(B.isLargest?(B.wholeValue=Nt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),pt&&!bt&&(B.isSmallest?(B.wholeValue=Ye,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Pe<0?B.value=In(B.wholeValue,Pe):Pe===0?B.value=kt(B.wholeValue+B.decimalValue):Ne?(Re?B.value=In(B.rawValue,ft-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ft-=B.wholeValue.toString().length)):(je.fractionDigits=Pe,Re?B.value=B.wholeValue+In(B.decimalValue,Pe):B.value=B.wholeValue+B.decimalValue):Ne&&B.wholeValue?(B.value=Math.round(In(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ft-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(we||Ot)&&(je.minimumIntegerDigits=B.tokenLength,bt&&je.maximumSignificantDigits<B.tokenLength&&delete je.maximumSignificantDigits),!Ot&&(B.value>0||It===""||k(he,B.type)||k(ne,B.type))&&(Ot=!0),B.formattedValue=h(B.value,je,_e),je.useGrouping=!1,je.decimalSeparator=".",B.formattedValueEn=h(B.value,je,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=h(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(Ge=P(Ge,bn),Ge=C(Ge),Ge.length>1){var ir=function(B){return k(Ge,function(Be){return Be.type===B})},Kn=function(B){var Be=ir(B.type);Be&&R(B.targets,function(je){var Pt=ir(je.type);Pt&&parseInt(Be.formattedValueEn,10)===je.value&&(Be.rawValue=0,Be.wholeValue=0,Be.decimalValue=0,Pt.rawValue+=1,Pt.wholeValue+=1,Pt.decimalValue=0,Pt.formattedValueEn=Pt.wholeValue.toString(),bt=!0)})};R(l,Kn)}return bt&&(Ot=!1,ft=ht,Ge=P(Ge,bn),Ge=C(Ge)),ne&&!(St&&!L.trim)?(Ge=P(Ge,function(B){return k(ne,function(Be){return B.type===Be})?B:null}),Ge=C(Ge)):(xt&&(Ge=S(Ge,function(B){return!B.isSmallest&&!B.wholeValue&&!k(he,B.type)})),me&&Ge.length&&(Ge=Ge.slice(0,me)),vn&&Ge.length>1&&(Ge=E(Ge,function(B){return!B.wholeValue&&!k(he,B.type)&&!B.isLargest})),tn&&(Ge=P(Ge,function(B,Be){return Be>0&&Be<Ge.length-1&&!B.wholeValue?null:B}),Ge=C(Ge)),nn&&Ge.length===1&&!Ge[0].wholeValue&&!(!Re&&Ge[0].isSmallest&&Ge[0].rawValue<Ye)&&(Ge=[])),ve?Ge:(R(Zt,function(B){var Be=et[B.type],je=k(Ge,function(Gt){return Gt.type===B.type});if(!(!Be||!je)){var Pt=je.formattedValueEn.split(".");Pt[0]=parseInt(Pt[0],10),Pt[1]?Pt[1]=parseFloat("0."+Pt[1],10):Pt[1]=null;var Kt=Ce.durationPluralKey(Be,Pt[0],Pt[1]),rn=m(Be,Ce),En=!1,wn={};R(Ce._durationLabelTypes,function(Gt){var yn=k(rn,function(Cn){return Cn.type===Gt.type&&Cn.key===Kt});yn&&(wn[yn.type]=yn.label,u(B.text,Gt.string)&&(B.text=B.text.replace(Gt.string,yn.label),En=!0))}),at&&!En&&(rn.sort(p),R(rn,function(Gt){if(wn[Gt.type]===Gt.label)return u(B.text,Gt.label)?!1:void 0;if(u(B.text,Gt.label))return B.text=B.text.replace(Gt.label,wn[Gt.type]),!1}))}}),Zt=P(Zt,function(B){if(!B.type)return B.text;var Be=k(Ge,function(Pt){return Pt.type===B.type});if(!Be)return"";var je="";return Oe&&(je+=B.text),(le&&St||!le&&pt)&&(je+="< ",St=!1,pt=!1),(le&&pt||!le&&St)&&(je+="> ",St=!1,pt=!1),le&&(Be.value>0||It===""||k(he,Be.type)||k(ne,Be.type))&&(je+="-",le=!1),B.type==="milliseconds"&&Be.formattedValueMS?je+=Be.formattedValueMS:je+=Be.formattedValue,Oe||(je+=B.text),je}),Zt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ae(){var H=this.duration,L=function(Se){return H._data[Se]},Y=k(this.types,L),te=T(this.types,L);switch(Y){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(Y===te)return"d __";case"weeks":return Y===te?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(Y===te)return"M __";case"years":return Y===te?"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=se,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 fe=function(H,L,Y){return H.toLocaleString(L,Y)};r=j()&&Q(fe),i=r&&oe(fe);var ue=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(ue),s=o&&oe(ue),de(n),de})})(Qo)),Qo.exports}Yv();const jv=["true","t","yes","y","on","1"],qv=["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 Ri(e){return Object.hasOwn(e,"isError")&&e.isError}function Kv(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Kl(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function Il(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Z.Loading,allowOverlay:!1,copyData:""}}function Zv(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function El(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 Ti(e,t){return Ee(e)?t||{}:Ee(t)?e||{}:mc(e,t)}function Zl(e){if(Ee(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:ot(n)):[ot(t)]}catch{return[ot(e)]}}function Rd(e){return typeof e=="string"||e instanceof String?!0:(e instanceof Ch&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function Jv(e){return e?.startsWith("{")&&e.endsWith("}")}function ot(e){try{try{return yh(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function Id(e){if(Ee(e))return null;if(typeof e=="boolean")return e;const t=ot(e).toLowerCase().trim();if(t==="")return null;if(jv.includes(t))return!0;if(qv.includes(t))return!1}function fo(e){if(Ee(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=bg.unformat(e.trim());if(ct(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Ed(e){return Ee(e)?"":ot(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function da(e){if(Ee(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return ot(e)}}function Go(e){if(Ee(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=$r.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=$r.utc(e);if(n.isValid())return n.toDate();const r=$r.utc(e,[$r.HTML5_FMT.TIME_MS,$r.HTML5_FMT.TIME_SECONDS,$r.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Td(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 Qv(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 eb=new RegExp(/(\r\n|\n|\r)/gm);function ho(e){return e.indexOf(`
177
- `)!==-1?e.replace(eb," "):e}function tb(e,t){if(Ee(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const nb=Fn("div",{target:"ee5ryew0"})(({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"}})),Dd=({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 Ee(n)?Ie(Xr,{highlight:!0,autoFocus:!1,disabled:!0,value:da(e)??"",onChange:()=>{}}):Ie(nb,{"data-testid":"stJsonColumnViewer",children:Ie(wg,{src:n,collapsed:2,theme:Sh(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"}})})},rb=e=>{const t=e.theme,n=e.value.data;return Ie(Dd,{jsonValue:n.value||n.displayValue,theme:t})},ib=e=>{const t=e.theme,n=e.value;return Ie(Dd,{jsonValue:n.data,theme:t})},ob={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return Bl(e,r??da(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??da(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:rb})};var ab=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Od(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,s=o===void 0?null:o,a=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,g=e.onMenuOpen,h=e.value,p=rr(e,ab),m=f.useState(a!==void 0?a:n),y=ur(m,2),v=y[0],b=y[1],x=f.useState(l!==void 0?l:i),T=ur(x,2),k=T[0],R=T[1],P=f.useState(h!==void 0?h:s),I=ur(P,2),C=I[0],F=I[1],D=f.useCallback(function(j,oe){typeof u=="function"&&u(j,oe),F(j)},[u]),S=f.useCallback(function(j,oe){var Q;typeof c=="function"&&(Q=c(j,oe)),b(Q!==void 0?Q:j)},[c]),E=f.useCallback(function(){typeof g=="function"&&g(),R(!0)},[g]),O=f.useCallback(function(){typeof d=="function"&&d(),R(!1)},[d]),M=a!==void 0?a:v,V=l!==void 0?l:k,W=h!==void 0?h:C;return Le(Le({},p),{},{inputValue:M,menuIsOpen:V,onChange:D,onInputChange:S,onMenuClose:O,onMenuOpen:E,value:W})}function lb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const sb=Math.min,ub=Math.max,fa=Math.round,Xo=Math.floor,ha=e=>({x:e,y:e});function cb(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Sa(){return typeof window<"u"}function Pd(e){return Fd(e)?(e.nodeName||"").toLowerCase():"#document"}function dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ld(e){var t;return(t=(Fd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fd(e){return Sa()?e instanceof Node||e instanceof dr(e).Node:!1}function db(e){return Sa()?e instanceof Element||e instanceof dr(e).Element:!1}function Jl(e){return Sa()?e instanceof HTMLElement||e instanceof dr(e).HTMLElement:!1}function Ou(e){return!Sa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dr(e).ShadowRoot}function _d(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ql(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function fb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hb(e){return["html","body","#document"].includes(Pd(e))}function Ql(e){return dr(e).getComputedStyle(e)}function gb(e){if(Pd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ou(e)&&e.host||Ld(e);return Ou(t)?t.host:t}function Ad(e){const t=gb(e);return hb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jl(t)&&_d(t)?t:Ad(t)}function ga(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ad(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=dr(i);if(o){const a=Tl(s);return t.concat(s,s.visualViewport||[],_d(i)?i:[],a&&n?ga(a):[])}return t.concat(i,ga(i,[],n))}function Tl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pb(e){const t=Ql(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Jl(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=fa(n)!==o||fa(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function es(e){return db(e)?e:e.contextElement}function Pu(e){const t=es(e);if(!Jl(t))return ha(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=pb(t);let s=(o?fa(n.width):n.width)/r,a=(o?fa(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const mb=ha(0);function vb(e){const t=dr(e);return!fb()||!t.visualViewport?mb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bb(e,t,n){return!1}function Lu(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=es(e);let s=ha(1);t&&(s=Pu(e));const a=bb()?vb(o):ha(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const g=dr(o),h=r;let p=g,m=Tl(p);for(;m&&r&&h!==p;){const y=Pu(m),v=m.getBoundingClientRect(),b=Ql(m),x=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,T=v.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=x,u+=T,p=dr(m),m=Tl(p)}}return cb({width:c,height:d,x:l,y:u})}function wb(e,t){let n=null,r;const i=Ld(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:u,top:c,width:d,height:g}=e.getBoundingClientRect();if(a||t(),!d||!g)return;const h=Xo(c),p=Xo(i.clientWidth-(u+d)),m=Xo(i.clientHeight-(c+g)),y=Xo(u),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-y+"px",threshold:ub(0,sb(1,l))||1};let x=!0;function T(k){const R=k[0].intersectionRatio;if(R!==l){if(!x)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(T,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return s(!0),o}function yb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=es(e),c=i||o?[...u?ga(u):[],...ga(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=u&&a?wb(u,n):null;let g=-1,h=null;s&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let p,m=l?Lu(e):null;l&&y();function y(){const v=Lu(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(y)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),d?.(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(p)}}var Dl=f.useLayoutEffect,Cb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],pa=function(){};function Sb(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function xb(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var s in t)t.hasOwnProperty(s)&&t[s]&&o.push("".concat(Sb(e,s)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var ma=function(t){return Pb(t)?t.filter(Boolean):xh(t)==="object"&&t!==null?[t]:[]},Hd=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=rr(t,Cb);return Le({},n)},jt=function(t,n,r){var i=t.cx,o=t.getStyles,s=t.getClassNames,a=t.className;return{css:o(n,t),className:i(r??{},s(n,t),a)}};function xa(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function kb(e){return xa(e)?window.innerHeight:e.clientHeight}function zd(e){return xa(e)?window.pageYOffset:e.scrollTop}function va(e,t){if(xa(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Mb(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function Rb(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Yo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:pa,i=zd(e),o=t-i,s=10,a=0;function l(){a+=s;var u=Rb(a,i,o,n);va(e,u),a<n?window.requestAnimationFrame(l):r(e)}l()}function Fu(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?va(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&va(e,Math.max(t.offsetTop-i,0))}function Ib(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function _u(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Eb(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Vd=!1,Tb={get passive(){return Vd=!0}},jo=typeof window<"u"?window:{};jo.addEventListener&&jo.removeEventListener&&(jo.addEventListener("p",pa,Tb),jo.removeEventListener("p",pa,!1));var Db=Vd;function Ob(e){return e!=null}function Pb(e){return Array.isArray(e)}function to(e,t,n){return e?t:n}var Lb=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(s){var a=ur(s,1),l=a[0];return!r.includes(l)});return o.reduce(function(s,a){var l=ur(a,2),u=l[0],c=l[1];return s[u]=c,s},{})},Fb=["children","innerProps"],_b=["children","innerProps"];function Ab(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,s=e.isFixedPosition,a=e.controlHeight,l=Mb(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),d=c.height,g=n.getBoundingClientRect(),h=g.bottom,p=g.height,m=g.top,y=n.offsetParent.getBoundingClientRect(),v=y.top,b=s?window.innerHeight:kb(l),x=zd(l),T=parseInt(getComputedStyle(n).marginBottom,10),k=parseInt(getComputedStyle(n).marginTop,10),R=v-k,P=b-m,I=R+x,C=d-x-m,F=h-b+x+T,D=x+m-k,S=160;switch(i){case"auto":case"bottom":if(P>=p)return{placement:"bottom",maxHeight:t};if(C>=p&&!s)return o&&Yo(l,F,S),{placement:"bottom",maxHeight:t};if(!s&&C>=r||s&&P>=r){o&&Yo(l,F,S);var E=s?P-T:C-T;return{placement:"bottom",maxHeight:E}}if(i==="auto"||s){var O=t,M=s?R:I;return M>=r&&(O=Math.min(M-T-a,t)),{placement:"top",maxHeight:O}}if(i==="bottom")return o&&va(l,F),{placement:"bottom",maxHeight:t};break;case"top":if(R>=p)return{placement:"top",maxHeight:t};if(I>=p&&!s)return o&&Yo(l,D,S),{placement:"top",maxHeight:t};if(!s&&I>=r||s&&R>=r){var V=t;return(!s&&I>=r||s&&R>=r)&&(V=s?R-k:I-k),o&&Yo(l,D,S),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function Hb(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var $d=function(t){return t==="auto"?"bottom":t},zb=function(t,n){var r,i=t.placement,o=t.theme,s=o.borderRadius,a=o.spacing,l=o.colors;return Le((r={label:"menu"},_o(r,Hb(i),"100%"),_o(r,"position","absolute"),_o(r,"width","100%"),_o(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},Nd=f.createContext(null),Vb=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,s=t.menuPosition,a=t.menuShouldScrollIntoView,l=t.theme,u=f.useContext(Nd)||{},c=u.setPortalPlacement,d=f.useRef(null),g=f.useState(i),h=ur(g,2),p=h[0],m=h[1],y=f.useState(null),v=ur(y,2),b=v[0],x=v[1],T=l.spacing.controlHeight;return Dl(function(){var k=d.current;if(k){var R=s==="fixed",P=a&&!R,I=Ab({maxHeight:i,menuEl:k,minHeight:r,placement:o,shouldScroll:P,isFixedPosition:R,controlHeight:T});m(I.maxHeight),x(I.placement),c?.(I.placement)}},[i,o,s,a,r,c,T]),n({ref:d,placerProps:Le(Le({},t),{},{placement:b||$d(o),maxHeight:p})})},$b=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return Fe("div",Ve({},jt(t,"menu",{menu:!0}),{ref:r},i),n)},Nb=$b,Bb=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Le({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},Wb=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return Fe("div",Ve({},jt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},Bd=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return Le({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},Ub=Bd,Gb=Bd,Xb=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=rr(t,Fb);return Fe("div",Ve({},jt(Le(Le({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},Yb=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=rr(t,_b);return Fe("div",Ve({},jt(Le(Le({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},jb=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},qb=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,s=t.menuPlacement,a=t.menuPosition,l=f.useRef(null),u=f.useRef(null),c=f.useState($d(s)),d=ur(c,2),g=d[0],h=d[1],p=f.useMemo(function(){return{setPortalPlacement:h}},[]),m=f.useState(null),y=ur(m,2),v=y[0],b=y[1],x=f.useCallback(function(){if(i){var P=Ib(i),I=a==="fixed"?0:window.pageYOffset,C=P[g]+I;(C!==v?.offset||P.left!==v?.rect.left||P.width!==v?.rect.width)&&b({offset:C,rect:P})}},[i,a,g,v?.offset,v?.rect.left,v?.rect.width]);Dl(function(){x()},[x]);var T=f.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&l.current&&(u.current=yb(i,l.current,x,{elementResize:"ResizeObserver"in window}))},[i,x]);Dl(function(){T()},[T]);var k=f.useCallback(function(P){l.current=P,T()},[T]);if(!n&&a!=="fixed"||!v)return null;var R=Fe("div",Ve({ref:k},jt(Le(Le({},t),{},{offset:v.offset,position:a,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),r);return Fe(Nd.Provider,{value:p},n?vc.createPortal(R,n):R)},Kb=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Zb=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return Fe("div",Ve({},jt(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},Jb=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,s=t.selectProps.controlShouldRenderValue;return Le({alignItems:"center",display:i&&o&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},Qb=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return Fe("div",Ve({},jt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},e1=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},t1=function(t){var n=t.children,r=t.innerProps;return Fe("div",Ve({},jt(t,"indicatorsContainer",{indicators:!0}),r),n)},Au,n1=["size"],r1=["innerProps","isRtl","size"],i1={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Wd=function(t){var n=t.size,r=rr(t,n1);return Fe("svg",Ve({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:i1},r))},ts=function(t){return Fe(Wd,Ve({size:20},t),Fe("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Ud=function(t){return Fe(Wd,Ve({size:20},t),Fe("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Gd=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,s=i.colors;return Le({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?s.neutral60:s.neutral20,padding:o*2,":hover":{color:r?s.neutral80:s.neutral40}})},o1=Gd,a1=function(t){var n=t.children,r=t.innerProps;return Fe("div",Ve({},jt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Fe(Ud,null))},l1=Gd,s1=function(t){var n=t.children,r=t.innerProps;return Fe("div",Ve({},jt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Fe(ts,null))},u1=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,s=i.colors;return Le({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?s.neutral10:s.neutral20,marginBottom:o*2,marginTop:o*2})},c1=function(t){var n=t.innerProps;return Fe("span",Ve({},n,jt(t,"indicatorSeparator",{"indicator-separator":!0})))},d1=kh(Au||(Au=lb([`
174
+ `),rawValue:J});return Ke===void 0?void 0:(Pn(Ke.kind===z.kind),{location:U,value:Ke})}}}const _=q.columns,N=q.rows,Y=Ht.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]:_.length===1?K=[_.first()??0,0]:N.length===1&&(K=[G,N.first()??0]),Y&&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 ut of Ke){if(ut.types.includes(ie)){const yt=await(await ut.getType(ie)).text(),Ct=Su(yt);if(Ct!==void 0){z=Ct;break}}ut.types.includes(J)&&(U=await(await ut.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=Su(Ke)}z===void 0&&w.clipboardData.types.includes(J)&&(U=w.clipboardData.getData(J))}else return;const[ye,Rt]=K,Je=[];do{if(Pe===void 0){const Ke=Dn(K),ut=U??z?.map(yt=>yt.map(Ct=>Ct.rawValue).join(" ")).join(" ")??"",nt=A(Ke,K,ut,void 0);nt!==void 0&&Je.push(nt);break}if(z===void 0){if(U===void 0)return;z=B0(U)}if(Pe===!1||typeof Pe=="function"&&Pe?.([K[0]-G,K[1]],z.map(Ke=>Ke.map(ut=>ut.rawValue?.toString()??"")))!==!0)return;for(const[Ke,ut]of z.entries()){if(Ke+Rt>=ze)break;for(const[nt,yt]of ut.entries()){const Ct=[nt+ye,Ke+Rt],[hi,Ni]=Ct;if(hi>=tt.length||Ni>=gn)continue;const Bi=Dn(Ct),tr=A(Bi,Ct,yt.rawValue,yt.formatted);tr!==void 0&&Je.push(tr)}}}while(!1);zn(Je),hn.current?.damage(Je.map(Ke=>({cell:Ke.location})))}},[I,Jt,Dn,q,Qn.paste,Ht,tt.length,zn,gn,Pe,G,ze]);kn("paste",Ua,d,!1,!0);const $i=f.useCallback(async(w,A)=>{if(!Qn.copy)return;const _=A===!0||Ht.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,N=q.columns,Y=q.rows,K=(z,U)=>{if(!we)ku(z,U,w);else{const J=U.map(ie=>({kind:Z.Text,data:v[ie].title,displayData:v[ie].title,allowOverlay:!1}));ku([J,...z],U,w)}};if(_&&ee!==void 0){if(q.current!==void 0){let z=ee(q.current.range,$.current.signal);typeof z!="object"&&(z=await z()),K(z,kr(q.current.range.x-G,q.current.range.x+q.current.range.width-G))}else if(Y!==void 0&&Y.length>0){const U=[...Y].map(J=>{const ie=ee({x:G,y:J,width:v.length,height:1},$.current.signal);return typeof ie=="object"?ie[0]:ie().then(ye=>ye[0])});if(U.some(J=>J instanceof Promise)){const J=await Promise.all(U);K(J,kr(v.length))}else K(U,kr(v.length))}else if(N.length>0){const z=[],U=[];for(const J of N){let ie=ee({x:J,y:0,width:1,height:ze},$.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,ye)=>ie.map((Rt,Je)=>[...Rt,...ye[Je]]));K(J,U)}}}},[v,ee,q,Qn.copy,G,Ht,ze,we]);kn("copy",$i,d,!1,!1);const Xf=f.useCallback(async w=>{if(!(!Qn.cut||!(Ht.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await $i(w),q.current!==void 0)){let _={current:{cell:q.current.cell,range:q.current.range,rangeStack:[]},rows:Qe.empty(),columns:Qe.empty()};const N=Ut?.(_);if(N===!1||(_=N===!0?_:N,_.current===void 0))return;Hr(_.current.range)}},[Hr,q,Qn.cut,$i,Ht,Ut]);kn("cut",Xf,d,!1,!1);const jf=f.useCallback((w,A)=>{if(fe!==void 0){G!==0&&(w=w.map(Y=>[Y[0]-G,Y[1]])),fe(w,A);return}if(w.length===0||A===-1)return;const[_,N]=w[A];c.current!==void 0&&c.current[0]===_&&c.current[1]===N||(c.current=[_,N],br(_,N,!1,!1))},[fe,G,br]),[Do,Oo]=It?.current?.cell??[],Po=f.useRef(Yt);Po.current=Yt,f.useLayoutEffect(()=>{Wa.current&&!Lr.current&&Do!==void 0&&Oo!==void 0&&(Do!==ce.current?.current?.cell[0]||Oo!==ce.current?.current?.cell[1])&&Po.current(Do,Oo),Lr.current=!1},[Do,Oo]);const Is=q.current!==void 0&&(q.current.cell[0]>=tt.length||q.current.cell[1]>=gn);f.useLayoutEffect(()=>{Is&&ge(Uo,!1)},[Is,ge]);const qf=f.useMemo(()=>_t===!0&&De?.tint===!0?Qe.fromSingleSelection(gn-1):Qe.empty(),[gn,_t,De?.tint]),Kf=f.useCallback(w=>typeof nn=="boolean"?nn:nn?.(w-G)??!0,[G,nn]),Zf=f.useMemo(()=>{if(Ha===void 0||a.current===null)return null;const{bounds:w,group:A}=Ha,_=a.current.getBoundingClientRect();return f.createElement(O0,{bounds:w,group:A,canvasBounds:_,onClose:()=>za(void 0),onFinish:N=>{za(void 0),se?.(A,N)}})},[se,Ha]),Jf=Math.min(tt.length,Ae+(Tn?1:0));f.useImperativeHandle(t,()=>({appendRow:(w,A)=>mr(w+G,A),appendColumn:(w,A)=>Io(w,A),updateCells:w=>(G!==0&&(w=w.map(A=>({cell:[A.cell[0]+G,A.cell[1]]}))),hn.current?.damage(w)),getBounds:(w,A)=>{if(!(a?.current===null||Ht?.current===null)){if(w===void 0&&A===void 0){const _=a.current.getBoundingClientRect(),N=_.width/Ht.current.clientWidth;return{x:_.x-Ht.current.scrollLeft*N,y:_.y-Ht.current.scrollTop*N,width:Ht.current.scrollWidth*N,height:Ht.current.scrollHeight*N}}return hn.current?.getBounds((w??0)+G,A)}},focus:()=>hn.current?.focus(),emit:async w=>{switch(w){case"delete":Vi({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":Vi({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":Vi({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 $i(void 0,!0);break;case"paste":await Ua();break}},scrollTo:Yt,remeasureColumns:w=>{for(const A of w)Eo(A+G)},getMouseArgsForPosition:(w,A,_)=>{if(hn?.current===null)return;const N=hn.current.getMouseArgsForPosition(w,A,_);if(N!==void 0)return{...N,location:[N.location[0]-G,N.location[1]]}}}),[mr,Io,Eo,Ht,$i,Vi,Ua,G,Yt]);const[Es,Ts]=fi??[],Qf=f.useCallback(w=>{const[A,_]=w;if(_===-1){ne!=="none"&&(qe(Qe.fromSingleSelection(A),void 0,!1),xn());return}Es===A&&Ts===_||(Mt({cell:w,range:{x:A,y:_,width:1,height:1}},!0,!1,"keyboard-nav"),Yt(A,_))},[ne,xn,Yt,Es,Ts,Mt,qe]),[eh,th]=f.useState(!1),Ds=f.useRef(Rc(w=>{th(w)},5)),nh=f.useCallback(()=>{Ds.current(!0),q.current===void 0&&q.columns.length===0&&q.rows.length===0&&l===void 0&&Mt({cell:[G,So],range:{x:G,y:So,width:1,height:1}},!0,!1,"keyboard-select")},[So,q,l,G,Mt]),rh=f.useCallback(()=>{Ds.current(!1)},[]),[ih,oh]=f.useMemo(()=>{let w;const A=bt?.scrollbarWidthOverride??bl(),_=ze+(_t?1:0);if(typeof Jn=="number")w=fn+_*Jn;else{let Y=0;const K=Math.min(_,10);for(let z=0;z<K;z++)Y+=Jn(z);Y=Math.floor(Y/K),w=fn+_*Y}w+=A;const N=tt.reduce((Y,K)=>K.width+Y,0)+A;return[`${Math.min(1e5,N)}px`,`${Math.min(1e5,w)}px`]},[tt,bt?.scrollbarWidthOverride,Jn,ze,_t,fn]),ah=f.useMemo(()=>am(st),[st]);return f.createElement(od.Provider,{value:st},f.createElement(Y0,{style:ah,className:j,inWidth:m??ih,inHeight:y??oh},f.createElement(I0,{fillHandle:Ot,drawFocusRing:Zr,experimental:bt,fixedShadowX:bn,fixedShadowY:ir,getRowThemeOverride:Dr,headerIcons:Kn,imageWindowLoader:B,initialSize:Be,isDraggable:je,onDragLeave:Pt,onRowMoved:Kt,overscrollX:Ea,overscrollY:Ta,preventDiagonalScrolling:wn,rightElement:Gt,rightElementProps:yn,smoothScrollX:jr,smoothScrollY:qr,className:j,enableGroups:Hn,onCanvasFocused:nh,onCanvasBlur:rh,canvasRef:a,onContextMenu:Yf,theme:st,cellXOffset:Df,cellYOffset:So,accessibilityHeight:sr.height,onDragEnd:Bf,columns:tt,nonGrowWidth:Lt,drawHeader:vt,onColumnProposeMove:Vf,drawCell:sn,disabledRows:qf,freezeColumns:Jf,lockColumns:G,firstColAccessible:G===0,getCellContent:Dn,minColumnWidth:hr,maxColumnWidth:ni,searchInputRef:s,showSearch:Oa,onSearchClose:ii,highlightRegions:Of,getCellsForSelection:ee,getGroupDetails:La,headerHeight:Fi,isFocused:eh,groupHeaderHeight:Hn?Co:0,freezeTrailingRows:mt+(_t&&De?.sticky===!0?1:0),hasAppendRow:_t,onColumnResize:Ye,onColumnResizeEnd:Me,onColumnResizeStart:Ze,onCellFocused:Qf,onColumnMoved:$f,onDragStart:Nf,onHeaderMenuClick:Af,onHeaderIndicatorClick:Hf,onItemHovered:Ba,isFilling:l?.fillHandle===!0,onMouseMove:_f,onKeyDown:Vi,onKeyUp:te,onMouseDown:Pf,onMouseUp:Ff,onDragOverCell:un,onDrop:$t,onSearchResultsChanged:jf,onVisibleRegionChanged:zf,clientSize:At,rowHeight:Jn,searchResults:ue,searchValue:L,onSearchValueChange:H,rows:gn,scrollRef:Ht,selection:q,translateX:sr.tx,translateY:sr.ty,verticalBorder:Kf,gridRef:hn,getCellRenderer:Jt,resizeIndicator:Oi}),Zf,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(rv,{...i,validateCell:Te,bloom:D,id:Gf,getCellRenderer:Jt,className:bt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:Mn,imageEditorOverride:g,portalElementRef:wo,onFinishEditing:Uf,markdownDivCreateNode:p,isOutsideClick:cn,customEventTarget:bt?.eventTarget}))))},lv=f.forwardRef(av);function Iu(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:s,height:a,x:l,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=Vc(c,a,o.cellVerticalPadding),h=zc(t.contentAlign??"center",l,s,o.cellHorizontalPadding,g),p=Hc(h,d,g),m=$c(l+n,u+r,p);return Al(t)&&m}const sv={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>uv(e,e.cell.data,Al(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Iu(e)&&e.preventDefault()},onClick:e=>{if(Iu(e))return{...e.cell,data:yd(e.cell.data)}},onPaste:(e,t)=>{let n=ia;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 uv(e,t,n,r,i){if(!n&&t===ia)return;const{ctx:o,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:p,width:m,height:y}=l;let v=!1;if(i>0){let b=n?1-i+i*s:.4;if(t===ia&&(b*=s),b===0)return;b<1&&(v=!0,o.globalAlpha=b)}Xl(o,a,t,h,p,m,y,u,c,d,r,g),v&&(o.globalAlpha=1)}const cv=dn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),dv=e=>{const{bubbles:t}=e;return f.createElement(cv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},fv={getAccessibilityString:e=>Nc(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=>hv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(dv,{bubbles:t.data})},onPaste:()=>{}};function hv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:s,y:a,width:l,height:u}=n;let c=s+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>s+l)break;const h=Ir(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)jn(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 gv=dn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),pv=e=>{const{drilldowns:t}=e;return f.createElement(gv,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))))},mv={getAccessibilityString:e=>Nc(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=>bv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(pv,{drilldowns:t.data})},onPaste:()=>{}},rl={};function vv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,s=n-o*2,a=4,l=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(rl[g]!==void 0)return{el:rl[g],height:l,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=l,p.scale(i,i),rl[g]=h,p.beginPath(),jn(p,o,o,c,s,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),jn(p,o+.5,o+.5,c,s,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:h,height:l,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function bv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:s,row:a}=e,{x:l,width:u}=n,c=r.baseFontFull,d=Wl(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=l+r.cellHorizontalPadding;const b=r.roundingRadius??6,x=vv(r.bgCell,r.drilldownBorder,g,b),T=[];for(const k of t){if(v>l+u)break;const P=Ir(k.text,i,c).width;let I=0;k.img!==void 0&&o.loadOrGetImage(k.img,s,a)!==void 0&&(I=p-8+4);const C=P+I+m*2;T.push({x:v,width:C}),v+=C+y}if(x!==null){const{el:k,height:R,middleWidth:P,sideWidth:I,width:C,dpr:F,padding:D}=x,S=I/F,E=D/F;for(const O of T){const M=Math.floor(O.x),V=Math.floor(O.width),W=V-(S-E)*2;i.imageSmoothingEnabled=!1,i.drawImage(k,0,0,I,R,M-E,h,S,g),W>0&&i.drawImage(k,I,0,P,R,M+(S-E),h,W,g),i.drawImage(k,C-I,0,I,R,M+V-(S-E),h,S,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[k,R]of T.entries()){const P=t[k];let I=R.x+m;if(P.img!==void 0){const C=o.loadOrGetImage(P.img,s,a);if(C!==void 0){const F=p-8;let D=0,S=0,E=C.width,O=C.height;E>O?(D+=(E-O)/2,E=O):O>E&&(S+=(O-E)/2,O=E),i.beginPath(),jn(i,I,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(C,D,S,E,O,I,h+g/2-F/2,F,F),i.restore(),I+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(P.text,I,h+g/2+qn(i,r))}}const wv={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>yv(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??mp;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}}},il=4;function yv(e,t,n,r){const{rect:i,col:o,row:s,theme:a,ctx:l,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 x=t[b];if(x.length===0)continue;const T=u.loadOrGetImage(x,o,s);if(T!==void 0){m[b]=T;const k=T.width*(p/T.height);y+=k+il}}if(y===0)return;y-=il;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 x=b.width*(p/b.height);n>0&&(l.beginPath(),jn(l,v,d+a.cellVerticalPadding,x,p,n),l.save(),l.clip()),l.drawImage(b,v,d+a.cellVerticalPadding,x,p),n>0&&l.restore(),v+=x+il}}function Cv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Sv={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:s}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(Cv(n,r)*t.skeletonWidthVariability));const l=s.cellHorizontalPadding;a+l*2>=o.width&&(a=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*s.cellVerticalPadding);jn(i,o.x+l,o.y+(o.height-u)/2,a,u,s.roundingRadius??3),i.fillStyle=Wr(s.textDark,.1),i.fill()},onPaste:()=>{}},xv=()=>e=>e.targetWidth,Eu=dn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[xv(),"px"]}}),kv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:s,validatedSelection:a}=e,l=t.data,u=t.readonly===!0,[c,d]=f.useState(l===""||r),g=f.useCallback(()=>{d(p=>!p)},[]),h=l?"gdg-ml-6":"";return c?f.createElement(Eu,{targetWidth:o.width-20},f.createElement(Yr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:l,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>s(t)},f.createElement(up,null))):f.createElement(Eu,{targetWidth:o.width},f.createElement(_p,{contents:l,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(zl,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Mv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:bo,measure:(e,t,n)=>{const r=t.data.split(`
175
+ `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>nr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:s,validatedSelection:a}=e;return f.createElement(kv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Rv={getAccessibilityString:e=>e.row.toString(),kind:$n.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Iv,measure:()=>44,draw:e=>Tv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Iv(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=Ev,n.textAlign="center",o}function Ev(e){const{ctx:t}=e;t.textAlign="start"}function Tv(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:d,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&p>0){s.globalAlpha=p;const m=7*(n?l:1);if(Xl(s,u,n,i?c+m:c,d,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const y of[3,6])for(const v of[-5,-1,3])s.rect(c+y,d+h/2+v,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),y=u.markerFontFull,v=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=y,s.fillText(m,v,d+h/2+qn(s,y)),l!==0&&(s.globalAlpha=1)}}const Dv={getAccessibilityString:()=>"",kind:$n.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Ov(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Ov(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,d-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=d-8,y=l+8/2,v=u+8/2;a.drawSprite(n,"normal",r,y,v,m,s,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,y=g?0:(1-o)*p*.5,v=s.cellHorizontalPadding+4;m>0&&(r.moveTo(l+v+y,u+d/2),r.lineTo(l+v+y+m,u+d/2),r.moveTo(l+v+y+m*.5,u+d/2-m*.5),r.lineTo(l+v+y+m*.5,u+d/2+m*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+d/2+qn(r,s)),r.beginPath()}function xd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Pv(e,i,r,t,n?.fullSize??!1);e.beginPath(),jn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Wr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Pv(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=Ir(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const Lv=f.lazy(async()=>await Ll(()=>import("./number-overlay-editor.C0n-91sR.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url)),Fv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:bo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&xd(r,i,u,l,o,t,s),nr(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(Lv,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},_v={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Av,onPaste:()=>{}};function Av(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:s}=r;t.beginPath();const a=2.5;let l=i+n.cellHorizontalPadding+a;const u=o+s/2,c=Math.cos(tu(30))*a,d=Math.sin(tu(30))*a;for(let g=0;g<12;g++)t.moveTo(l,u-a),t.lineTo(l,u+a),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Hv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>bo(e,t,e.theme.textLight),draw:e=>nr(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 zt.createElement(Yr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},zv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:bo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&xd(i,s,g,l,o,n,a),nr(e,l,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
176
+ `,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return f.createElement(Yr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:s=>r({...i,data:s.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Vv=dn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),$v=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:s}=e,[a,l]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{l(!0)},[]);return a?f.createElement(Yr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(Vv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},s),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(zl,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function kd(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,s=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-s-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-s/2),{x:i,y:o,width:s,height:a}}function Tu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,s=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=Qc(s,o.baseFontFull);if(a===void 0)return!1;const l=kd(a,n,o,t.contentAlign);return Br({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,i)}const Nv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:bo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:s,ctx:a}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Ir(l,a,n.baseFontFull),d=kd(c,s,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(s.x+g,Math.floor(s.y+b+m+v)+.5),a.lineTo(s.x+g+p,Math.floor(s.y+b+m+v)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,nr({...e,rect:{...s,x:s.x-1}},l,t.contentAlign),nr({...e,rect:{...s,x:s.x-2}},l,t.contentAlign),nr({...e,rect:{...s,x:s.x+1}},l,t.contentAlign),nr({...e,rect:{...s,x:s.x+2}},l,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,nr(e,l,t.contentAlign)},onSelect:e=>{Tu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;Tu(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($v,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:s=>n({...r,data:s.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Bv=[Rv,Dv,sv,fv,mv,wv,Sv,Mv,Fv,_v,Hv,zv,Nv],ol=[];class Wv extends nd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=yg(()=>{this.imageLoaded(new ao(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const s=r.cells[o];if(this.isInWindow(s)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const s=ol.pop()??new Image;let a=!1;const l={img:void 0,cells:[Xn(n,r)],url:t,cancel:()=>{a||(a=!0,ol.length<12?ol.unshift(s):o||(s.src=""))}},u=new Promise(c=>s.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{s.src=t,await u,await s.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=s;for(const d of c.cells)this.loadedLocations.push(Yl(d));o=!0,this.sendLoaded()}}catch{l.cancel()}}),this.cache[i]=l}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const s=Xn(n,r);return o.cells.includes(s)||o.cells.push(s),o.img}else this.loadImage(t,n,r,i)}}const Uv=(e,t)=>{const n=f.useMemo(()=>({...Hm,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??Bv,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new Wv,[e.imageWindowLoader]);return f.createElement(lv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Gv=f.forwardRef(Uv);function Md(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((...s)=>{r.current=s,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}var Qo={exports:{}};var Yv=Qo.exports,Du;function Xv(){return Du||(Du=1,(function(e,t){(function(n,r){try{e.exports=r(pg)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(Yv,function(n){var r=!1,i=!1,o=!1,s=!1,a="escape years months weeks days hours minutes seconds milliseconds general".split(" "),l=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(H,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(),X=0,te=!0;te&&X<L.length;)X?L[X]==="9"?L[X]="0":(L[X]=(parseInt(L[X],10)+1).toString(),te=!1):(parseInt(L[X],10)<5&&(te=!1),L[X]="0"),X+=1;return te&&L.push("1"),L.reverse().join("")}function g(H,L){var X=P(M(L).sort(),function(le){return le+":"+L[le]}).join(","),te=H+"+"+X;return g.cache[te]||(g.cache[te]=Intl.NumberFormat(H,L)),g.cache[te]}g.cache={};function h(H,L,X){var te=L.useToLocaleString,le=L.useGrouping,Se=le&&L.grouping.slice(),pe=L.maximumSignificantDigits,et=L.minimumIntegerDigits||1,ke=L.fractionDigits||0,Dt=L.groupingSeparator,dt=L.decimalSeparator;if(te&&X){var Ue={minimumIntegerDigits:et,useGrouping:le};if(ke&&(Ue.maximumFractionDigits=ke,Ue.minimumFractionDigits=ke),pe&&H>0&&(Ue.maximumSignificantDigits=pe),o){if(!s){var ne=O({},L);ne.useGrouping=!1,ne.decimalSeparator=".",H=parseFloat(h(H,ne),10)}return g(X,Ue).format(H)}else{if(!i){var ne=O({},L);ne.useGrouping=!1,ne.decimalSeparator=".",H=parseFloat(h(H,ne),10)}return H.toLocaleString(X,Ue)}}var ve;pe?ve=H.toPrecision(pe+1):ve=H.toFixed(ke+1);var me,he,Ce,_e=ve.split("e");Ce=_e[1]||"",_e=_e[0].split("."),he=_e[1]||"",me=_e[0]||"";var Oe=me.length,at=he.length,Pe=Oe+at,we=me+he;(pe&&Pe===pe+1||!pe&&at===ke+1)&&(we=d(we),we.length===Pe+1&&(Oe=Oe+1),at&&(we=we.slice(0,-1)),me=we.slice(0,Oe),he=we.slice(Oe)),pe&&(he=he.replace(/0*$/,""));var Ae=parseInt(Ce,10);Ae>0?he.length<=Ae?(he=he+c(Ae-he.length),me=me+he,he=""):(me=me+he.slice(0,Ae),he=he.slice(Ae)):Ae<0&&(he=c(Math.abs(Ae)-me.length)+me+he,me="0"),pe||(he=he.slice(0,ke),he.length<ke&&(he=he+c(ke-he.length)),me.length<et&&(me=c(et-me.length)+me));var Re="";if(le){_e=me;for(var Ne;_e.length;)Se.length&&(Ne=Se.shift()),Re&&(Re=Dt+Re),Re=_e.slice(-Ne)+Re,_e=_e.slice(0,-Ne)}else Re=me;return he&&(Re=Re+dt+he),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 X=[];return R(M(L),function(te){if(te.slice(0,15)==="_durationLabels"){var le=te.slice(15).toLowerCase();R(M(L[te]),function(Se){Se.slice(0,1)===H&&X.push({type:le,key:Se,label:L[te][Se]})})}}),X}function y(H,L,X){return L===1&&X===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 x(H){return Object.prototype.toString.call(H)==="[object Object]"}function T(H,L){for(var X=H.length;X-=1;)if(L(H[X]))return H[X]}function k(H,L){var X=0,te=H&&H.length||0,le;for(typeof L!="function"&&(le=L,L=function(Se){return Se===le});X<te;){if(L(H[X]))return H[X];X+=1}}function R(H,L){var X=0,te=H.length;if(!(!H||!te))for(;X<te;){if(L(H[X],X)===!1)return;X+=1}}function P(H,L){var X=0,te=H.length,le=[];if(!H||!te)return le;for(;X<te;)le[X]=L(H[X],X),X+=1;return le}function I(H,L){return P(H,function(X){return X[L]})}function C(H){var L=[];return R(H,function(X){X&&L.push(X)}),L}function F(H){var L=[];return R(H,function(X){k(L,X)||L.push(X)}),L}function D(H,L){var X=[];return R(H,function(te){R(L,function(le){te===le&&X.push(te)})}),F(X)}function S(H,L){var X=[];return R(H,function(te,le){if(!L(te))return X=H.slice(le),!1}),X}function E(H,L){var X=H.slice().reverse();return S(X,L).reverse()}function O(H,L){for(var X in L)L.hasOwnProperty(X)&&(H[X]=L[X]);return H}function M(H){var L=[];for(var X in H)H.hasOwnProperty(X)&&L.push(X);return L}function V(H,L){var X=0,te=H.length;if(!H||!te)return!1;for(;X<te;){if(L(H[X],X)===!0)return!0;X+=1}return!1}function W(H){var L=[];return R(H,function(X){L=L.concat(X)}),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={},X;if(R(H,function(pe,et){if(!et){if(!b(pe))throw"Expected array as the first argument to durationsFormat.";X=pe}if(typeof pe=="string"||typeof pe=="function"){L.template=pe;return}if(typeof pe=="number"){L.precision=pe;return}x(pe)&&O(L,pe)}),!X||!X.length)return[];L.returnMomentTypes=!0;var te=P(X,function(pe){return pe.format(L)}),le=D(a,F(I(W(te),"type"))),Se=L.largest;return Se&&(le=le.slice(0,Se)),L.returnMomentTypes=!1,L.outputTypes=le,P(X,function(pe){return pe.format(L)})}function se(){var H=[].slice.call(arguments),L=O({},this.format.defaults),X=this.asMilliseconds(),te=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(X=0,te=0);var le=X<0,Se=n.duration(Math.abs(X),"milliseconds"),pe=n.duration(Math.abs(te),"months");R(H,function(B){if(typeof B=="string"||typeof B=="function"){L.template=B;return}if(typeof B=="number"){L.precision=B;return}x(B)&&O(L,B)});var et={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},ke={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};L.types=a;var Dt=function(B){return k(a,function(Be){return ke[Be].test(B)})},dt=new RegExp(P(a,function(B){return ke[B].source}).join("|"),"g");L.duration=this;var Ue=typeof L.template=="function"?L.template.apply(L):L.template,ne=L.outputTypes,ve=L.returnMomentTypes,me=L.largest,he=[];ne||(b(L.stopTrim)&&(L.stopTrim=L.stopTrim.join("")),L.stopTrim&&R(L.stopTrim.match(dt),function(B){var Be=Dt(B);Be==="escape"||Be==="general"||he.push(Be)}));var Ce=n.localeData();Ce||(Ce={}),R(M(v),function(B){if(typeof v[B]=="function"){Ce[B]||(Ce[B]=v[B]);return}Ce["_"+B]||(Ce["_"+B]=v[B])}),R(M(Ce._durationTimeTemplates),function(B){Ue=Ue.replace("_"+B+"_",Ce._durationTimeTemplates[B])});var _e=L.userLocale||n.locale(),Oe=L.useLeftUnits,at=L.usePlural,Pe=L.precision,we=L.forceLength,Ae=L.useGrouping,Re=L.trunc,Ne=L.useSignificantDigits&&Pe>0,ft=Ne?L.precision:0,ht=ft,Xe=L.minValue,pt=!1,Nt=L.maxValue,St=!1,Tt=L.useToLocaleString,Bt=L.groupingSeparator,qt=L.decimalSeparator,an=L.grouping;Tt=Tt&&(r||o);var It=L.trim;b(It)&&(It=It.join(" ")),It===null&&(me||Nt||Ne)&&(It="all"),(It===null||It===!0||It==="left"||It==="right")&&(It="large"),It===!1&&(It="");var gt=function(B){return B.test(It)},Wt=/large/,wt=/small/,ln=/both/,Mn=/mid/,De=/^all|[^sm]all/,mt=/final/,xt=me>0||V([Wt,ln,De],gt),vn=V([wt,ln,De],gt),tn=V([Mn,De],gt),nn=V([mt,De],gt),un=P(Ue.match(dt),function(B,Be){var je=Dt(B);return B.slice(0,1)==="*"&&(B=B.slice(1),je!=="escape"&&je!=="general"&&he.push(je)),{index:Be,length:B.length,text:"",token:je==="escape"?B.replace(ke.escape,"$1"):B,type:je==="escape"||je==="general"?null:je}}),$t={index:0,length:0,token:"",text:"",type:null},Zt=[];Oe&&un.reverse(),R(un,function(B){if(B.type){($t.type||$t.text)&&Zt.push($t),$t=B;return}Oe?$t.text=B.token+$t.text:$t.text+=B.token}),($t.type||$t.text)&&Zt.push($t),Oe&&Zt.reverse();var Ge=D(a,F(C(I(Zt,"type"))));if(!Ge.length)return I(Zt,"text").join("");Ge=P(Ge,function(B,Be){var je=Be+1===Ge.length,Pt=!Be,Kt;B==="years"||B==="months"?Kt=pe.as(B):Kt=Se.as(B);var rn=Math.floor(Kt),En=Kt-rn,wn=k(Zt,function(Gt){return B===Gt.type});return Pt&&Nt&&Kt>Nt&&(St=!0),je&&Xe&&Math.abs(L.duration.as(B))<Xe&&(pt=!0),Pt&&we===null&&wn.length>1&&(we=!0),Se.subtract(rn,B),pe.subtract(rn,B),{rawValue:Kt,wholeValue:rn,decimalValue:je?En:0,isSmallest:je,isLargest:Pt,type:B,tokenLength:wn.length}});var kt=Re?Math.floor:Math.round,In=function(B,Be){var je=Math.pow(10,Be);return kt(B*je)/je},Ot=!1,bt=!1,bn=function(B,Be){var je={useGrouping:Ae,groupingSeparator:Bt,decimalSeparator:qt,grouping:an,useToLocaleString:Tt};return Ne&&(ft<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(je.maximumSignificantDigits=ft,B.significantDigits=ft)),St&&!bt&&(B.isLargest?(B.wholeValue=Nt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),pt&&!bt&&(B.isSmallest?(B.wholeValue=Xe,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Pe<0?B.value=In(B.wholeValue,Pe):Pe===0?B.value=kt(B.wholeValue+B.decimalValue):Ne?(Re?B.value=In(B.rawValue,ft-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ft-=B.wholeValue.toString().length)):(je.fractionDigits=Pe,Re?B.value=B.wholeValue+In(B.decimalValue,Pe):B.value=B.wholeValue+B.decimalValue):Ne&&B.wholeValue?(B.value=Math.round(In(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ft-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(we||Ot)&&(je.minimumIntegerDigits=B.tokenLength,bt&&je.maximumSignificantDigits<B.tokenLength&&delete je.maximumSignificantDigits),!Ot&&(B.value>0||It===""||k(he,B.type)||k(ne,B.type))&&(Ot=!0),B.formattedValue=h(B.value,je,_e),je.useGrouping=!1,je.decimalSeparator=".",B.formattedValueEn=h(B.value,je,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=h(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(Ge=P(Ge,bn),Ge=C(Ge),Ge.length>1){var ir=function(B){return k(Ge,function(Be){return Be.type===B})},Kn=function(B){var Be=ir(B.type);Be&&R(B.targets,function(je){var Pt=ir(je.type);Pt&&parseInt(Be.formattedValueEn,10)===je.value&&(Be.rawValue=0,Be.wholeValue=0,Be.decimalValue=0,Pt.rawValue+=1,Pt.wholeValue+=1,Pt.decimalValue=0,Pt.formattedValueEn=Pt.wholeValue.toString(),bt=!0)})};R(l,Kn)}return bt&&(Ot=!1,ft=ht,Ge=P(Ge,bn),Ge=C(Ge)),ne&&!(St&&!L.trim)?(Ge=P(Ge,function(B){return k(ne,function(Be){return B.type===Be})?B:null}),Ge=C(Ge)):(xt&&(Ge=S(Ge,function(B){return!B.isSmallest&&!B.wholeValue&&!k(he,B.type)})),me&&Ge.length&&(Ge=Ge.slice(0,me)),vn&&Ge.length>1&&(Ge=E(Ge,function(B){return!B.wholeValue&&!k(he,B.type)&&!B.isLargest})),tn&&(Ge=P(Ge,function(B,Be){return Be>0&&Be<Ge.length-1&&!B.wholeValue?null:B}),Ge=C(Ge)),nn&&Ge.length===1&&!Ge[0].wholeValue&&!(!Re&&Ge[0].isSmallest&&Ge[0].rawValue<Xe)&&(Ge=[])),ve?Ge:(R(Zt,function(B){var Be=et[B.type],je=k(Ge,function(Gt){return Gt.type===B.type});if(!(!Be||!je)){var Pt=je.formattedValueEn.split(".");Pt[0]=parseInt(Pt[0],10),Pt[1]?Pt[1]=parseFloat("0."+Pt[1],10):Pt[1]=null;var Kt=Ce.durationPluralKey(Be,Pt[0],Pt[1]),rn=m(Be,Ce),En=!1,wn={};R(Ce._durationLabelTypes,function(Gt){var yn=k(rn,function(Cn){return Cn.type===Gt.type&&Cn.key===Kt});yn&&(wn[yn.type]=yn.label,u(B.text,Gt.string)&&(B.text=B.text.replace(Gt.string,yn.label),En=!0))}),at&&!En&&(rn.sort(p),R(rn,function(Gt){if(wn[Gt.type]===Gt.label)return u(B.text,Gt.label)?!1:void 0;if(u(B.text,Gt.label))return B.text=B.text.replace(Gt.label,wn[Gt.type]),!1}))}}),Zt=P(Zt,function(B){if(!B.type)return B.text;var Be=k(Ge,function(Pt){return Pt.type===B.type});if(!Be)return"";var je="";return Oe&&(je+=B.text),(le&&St||!le&&pt)&&(je+="< ",St=!1,pt=!1),(le&&pt||!le&&St)&&(je+="> ",St=!1,pt=!1),le&&(Be.value>0||It===""||k(he,Be.type)||k(ne,Be.type))&&(je+="-",le=!1),B.type==="milliseconds"&&Be.formattedValueMS?je+=Be.formattedValueMS:je+=Be.formattedValue,Oe||(je+=B.text),je}),Zt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ae(){var H=this.duration,L=function(Se){return H._data[Se]},X=k(this.types,L),te=T(this.types,L);switch(X){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(X===te)return"d __";case"weeks":return X===te?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(X===te)return"M __";case"years":return X===te?"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=se,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 fe=function(H,L,X){return H.toLocaleString(L,X)};r=j()&&Q(fe),i=r&&oe(fe);var ue=function(H,L,X){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(L,X).format(H)};return o=Q(ue),s=o&&oe(ue),de(n),de})})(Qo)),Qo.exports}Xv();const jv=["true","t","yes","y","on","1"],qv=["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 Ri(e){return Object.hasOwn(e,"isError")&&e.isError}function Kv(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Kl(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function Il(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Z.Loading,allowOverlay:!1,copyData:""}}function Zv(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function El(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 Ti(e,t){return Ee(e)?t||{}:Ee(t)?e||{}:mc(e,t)}function Zl(e){if(Ee(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:ot(n)):[ot(t)]}catch{return[ot(e)]}}function Rd(e){return typeof e=="string"||e instanceof String?!0:(e instanceof Ch&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function Jv(e){return e?.startsWith("{")&&e.endsWith("}")}function ot(e){try{try{return yh(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function Id(e){if(Ee(e))return null;if(typeof e=="boolean")return e;const t=ot(e).toLowerCase().trim();if(t==="")return null;if(jv.includes(t))return!0;if(qv.includes(t))return!1}function fo(e){if(Ee(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=bg.unformat(e.trim());if(ct(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Ed(e){return Ee(e)?"":ot(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function da(e){if(Ee(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return ot(e)}}function Go(e){if(Ee(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=$r.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=$r.utc(e);if(n.isValid())return n.toDate();const r=$r.utc(e,[$r.HTML5_FMT.TIME_MS,$r.HTML5_FMT.TIME_SECONDS,$r.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Td(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 Qv(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 eb=new RegExp(/(\r\n|\n|\r)/gm);function ho(e){return e.indexOf(`
177
+ `)!==-1?e.replace(eb," "):e}function tb(e,t){if(Ee(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const nb=Fn("div",{target:"ee5ryew0"})(({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"}})),Dd=({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 Ee(n)?Ie(Yr,{highlight:!0,autoFocus:!1,disabled:!0,value:da(e)??"",onChange:()=>{}}):Ie(nb,{"data-testid":"stJsonColumnViewer",children:Ie(wg,{src:n,collapsed:2,theme:Sh(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"}})})},rb=e=>{const t=e.theme,n=e.value.data;return Ie(Dd,{jsonValue:n.value||n.displayValue,theme:t})},ib=e=>{const t=e.theme,n=e.value;return Ie(Dd,{jsonValue:n.data,theme:t})},ob={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return Bl(e,r??da(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??da(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:rb})};var ab=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Od(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,s=o===void 0?null:o,a=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,g=e.onMenuOpen,h=e.value,p=rr(e,ab),m=f.useState(a!==void 0?a:n),y=ur(m,2),v=y[0],b=y[1],x=f.useState(l!==void 0?l:i),T=ur(x,2),k=T[0],R=T[1],P=f.useState(h!==void 0?h:s),I=ur(P,2),C=I[0],F=I[1],D=f.useCallback(function(j,oe){typeof u=="function"&&u(j,oe),F(j)},[u]),S=f.useCallback(function(j,oe){var Q;typeof c=="function"&&(Q=c(j,oe)),b(Q!==void 0?Q:j)},[c]),E=f.useCallback(function(){typeof g=="function"&&g(),R(!0)},[g]),O=f.useCallback(function(){typeof d=="function"&&d(),R(!1)},[d]),M=a!==void 0?a:v,V=l!==void 0?l:k,W=h!==void 0?h:C;return Le(Le({},p),{},{inputValue:M,menuIsOpen:V,onChange:D,onInputChange:S,onMenuClose:O,onMenuOpen:E,value:W})}function lb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const sb=Math.min,ub=Math.max,fa=Math.round,Yo=Math.floor,ha=e=>({x:e,y:e});function cb(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Sa(){return typeof window<"u"}function Pd(e){return Fd(e)?(e.nodeName||"").toLowerCase():"#document"}function dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ld(e){var t;return(t=(Fd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fd(e){return Sa()?e instanceof Node||e instanceof dr(e).Node:!1}function db(e){return Sa()?e instanceof Element||e instanceof dr(e).Element:!1}function Jl(e){return Sa()?e instanceof HTMLElement||e instanceof dr(e).HTMLElement:!1}function Ou(e){return!Sa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dr(e).ShadowRoot}function _d(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ql(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function fb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hb(e){return["html","body","#document"].includes(Pd(e))}function Ql(e){return dr(e).getComputedStyle(e)}function gb(e){if(Pd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ou(e)&&e.host||Ld(e);return Ou(t)?t.host:t}function Ad(e){const t=gb(e);return hb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jl(t)&&_d(t)?t:Ad(t)}function ga(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ad(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=dr(i);if(o){const a=Tl(s);return t.concat(s,s.visualViewport||[],_d(i)?i:[],a&&n?ga(a):[])}return t.concat(i,ga(i,[],n))}function Tl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pb(e){const t=Ql(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Jl(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=fa(n)!==o||fa(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function es(e){return db(e)?e:e.contextElement}function Pu(e){const t=es(e);if(!Jl(t))return ha(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=pb(t);let s=(o?fa(n.width):n.width)/r,a=(o?fa(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const mb=ha(0);function vb(e){const t=dr(e);return!fb()||!t.visualViewport?mb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bb(e,t,n){return!1}function Lu(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=es(e);let s=ha(1);t&&(s=Pu(e));const a=bb()?vb(o):ha(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const g=dr(o),h=r;let p=g,m=Tl(p);for(;m&&r&&h!==p;){const y=Pu(m),v=m.getBoundingClientRect(),b=Ql(m),x=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,T=v.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=x,u+=T,p=dr(m),m=Tl(p)}}return cb({width:c,height:d,x:l,y:u})}function wb(e,t){let n=null,r;const i=Ld(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:u,top:c,width:d,height:g}=e.getBoundingClientRect();if(a||t(),!d||!g)return;const h=Yo(c),p=Yo(i.clientWidth-(u+d)),m=Yo(i.clientHeight-(c+g)),y=Yo(u),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-y+"px",threshold:ub(0,sb(1,l))||1};let x=!0;function T(k){const R=k[0].intersectionRatio;if(R!==l){if(!x)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(T,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return s(!0),o}function yb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=es(e),c=i||o?[...u?ga(u):[],...ga(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=u&&a?wb(u,n):null;let g=-1,h=null;s&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let p,m=l?Lu(e):null;l&&y();function y(){const v=Lu(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(y)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),d?.(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(p)}}var Dl=f.useLayoutEffect,Cb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],pa=function(){};function Sb(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function xb(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var s in t)t.hasOwnProperty(s)&&t[s]&&o.push("".concat(Sb(e,s)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var ma=function(t){return Pb(t)?t.filter(Boolean):xh(t)==="object"&&t!==null?[t]:[]},Hd=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=rr(t,Cb);return Le({},n)},jt=function(t,n,r){var i=t.cx,o=t.getStyles,s=t.getClassNames,a=t.className;return{css:o(n,t),className:i(r??{},s(n,t),a)}};function xa(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function kb(e){return xa(e)?window.innerHeight:e.clientHeight}function zd(e){return xa(e)?window.pageYOffset:e.scrollTop}function va(e,t){if(xa(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Mb(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function Rb(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Xo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:pa,i=zd(e),o=t-i,s=10,a=0;function l(){a+=s;var u=Rb(a,i,o,n);va(e,u),a<n?window.requestAnimationFrame(l):r(e)}l()}function Fu(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?va(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&va(e,Math.max(t.offsetTop-i,0))}function Ib(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function _u(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Eb(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Vd=!1,Tb={get passive(){return Vd=!0}},jo=typeof window<"u"?window:{};jo.addEventListener&&jo.removeEventListener&&(jo.addEventListener("p",pa,Tb),jo.removeEventListener("p",pa,!1));var Db=Vd;function Ob(e){return e!=null}function Pb(e){return Array.isArray(e)}function to(e,t,n){return e?t:n}var Lb=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(s){var a=ur(s,1),l=a[0];return!r.includes(l)});return o.reduce(function(s,a){var l=ur(a,2),u=l[0],c=l[1];return s[u]=c,s},{})},Fb=["children","innerProps"],_b=["children","innerProps"];function Ab(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,s=e.isFixedPosition,a=e.controlHeight,l=Mb(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),d=c.height,g=n.getBoundingClientRect(),h=g.bottom,p=g.height,m=g.top,y=n.offsetParent.getBoundingClientRect(),v=y.top,b=s?window.innerHeight:kb(l),x=zd(l),T=parseInt(getComputedStyle(n).marginBottom,10),k=parseInt(getComputedStyle(n).marginTop,10),R=v-k,P=b-m,I=R+x,C=d-x-m,F=h-b+x+T,D=x+m-k,S=160;switch(i){case"auto":case"bottom":if(P>=p)return{placement:"bottom",maxHeight:t};if(C>=p&&!s)return o&&Xo(l,F,S),{placement:"bottom",maxHeight:t};if(!s&&C>=r||s&&P>=r){o&&Xo(l,F,S);var E=s?P-T:C-T;return{placement:"bottom",maxHeight:E}}if(i==="auto"||s){var O=t,M=s?R:I;return M>=r&&(O=Math.min(M-T-a,t)),{placement:"top",maxHeight:O}}if(i==="bottom")return o&&va(l,F),{placement:"bottom",maxHeight:t};break;case"top":if(R>=p)return{placement:"top",maxHeight:t};if(I>=p&&!s)return o&&Xo(l,D,S),{placement:"top",maxHeight:t};if(!s&&I>=r||s&&R>=r){var V=t;return(!s&&I>=r||s&&R>=r)&&(V=s?R-k:I-k),o&&Xo(l,D,S),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function Hb(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var $d=function(t){return t==="auto"?"bottom":t},zb=function(t,n){var r,i=t.placement,o=t.theme,s=o.borderRadius,a=o.spacing,l=o.colors;return Le((r={label:"menu"},_o(r,Hb(i),"100%"),_o(r,"position","absolute"),_o(r,"width","100%"),_o(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},Nd=f.createContext(null),Vb=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,s=t.menuPosition,a=t.menuShouldScrollIntoView,l=t.theme,u=f.useContext(Nd)||{},c=u.setPortalPlacement,d=f.useRef(null),g=f.useState(i),h=ur(g,2),p=h[0],m=h[1],y=f.useState(null),v=ur(y,2),b=v[0],x=v[1],T=l.spacing.controlHeight;return Dl(function(){var k=d.current;if(k){var R=s==="fixed",P=a&&!R,I=Ab({maxHeight:i,menuEl:k,minHeight:r,placement:o,shouldScroll:P,isFixedPosition:R,controlHeight:T});m(I.maxHeight),x(I.placement),c?.(I.placement)}},[i,o,s,a,r,c,T]),n({ref:d,placerProps:Le(Le({},t),{},{placement:b||$d(o),maxHeight:p})})},$b=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return Fe("div",Ve({},jt(t,"menu",{menu:!0}),{ref:r},i),n)},Nb=$b,Bb=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Le({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},Wb=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return Fe("div",Ve({},jt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},Bd=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return Le({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},Ub=Bd,Gb=Bd,Yb=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=rr(t,Fb);return Fe("div",Ve({},jt(Le(Le({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},Xb=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=rr(t,_b);return Fe("div",Ve({},jt(Le(Le({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},jb=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},qb=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,s=t.menuPlacement,a=t.menuPosition,l=f.useRef(null),u=f.useRef(null),c=f.useState($d(s)),d=ur(c,2),g=d[0],h=d[1],p=f.useMemo(function(){return{setPortalPlacement:h}},[]),m=f.useState(null),y=ur(m,2),v=y[0],b=y[1],x=f.useCallback(function(){if(i){var P=Ib(i),I=a==="fixed"?0:window.pageYOffset,C=P[g]+I;(C!==v?.offset||P.left!==v?.rect.left||P.width!==v?.rect.width)&&b({offset:C,rect:P})}},[i,a,g,v?.offset,v?.rect.left,v?.rect.width]);Dl(function(){x()},[x]);var T=f.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&l.current&&(u.current=yb(i,l.current,x,{elementResize:"ResizeObserver"in window}))},[i,x]);Dl(function(){T()},[T]);var k=f.useCallback(function(P){l.current=P,T()},[T]);if(!n&&a!=="fixed"||!v)return null;var R=Fe("div",Ve({ref:k},jt(Le(Le({},t),{},{offset:v.offset,position:a,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),r);return Fe(Nd.Provider,{value:p},n?vc.createPortal(R,n):R)},Kb=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Zb=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return Fe("div",Ve({},jt(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},Jb=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,s=t.selectProps.controlShouldRenderValue;return Le({alignItems:"center",display:i&&o&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},Qb=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return Fe("div",Ve({},jt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},e1=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},t1=function(t){var n=t.children,r=t.innerProps;return Fe("div",Ve({},jt(t,"indicatorsContainer",{indicators:!0}),r),n)},Au,n1=["size"],r1=["innerProps","isRtl","size"],i1={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Wd=function(t){var n=t.size,r=rr(t,n1);return Fe("svg",Ve({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:i1},r))},ts=function(t){return Fe(Wd,Ve({size:20},t),Fe("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Ud=function(t){return Fe(Wd,Ve({size:20},t),Fe("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Gd=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,s=i.colors;return Le({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?s.neutral60:s.neutral20,padding:o*2,":hover":{color:r?s.neutral80:s.neutral40}})},o1=Gd,a1=function(t){var n=t.children,r=t.innerProps;return Fe("div",Ve({},jt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Fe(Ud,null))},l1=Gd,s1=function(t){var n=t.children,r=t.innerProps;return Fe("div",Ve({},jt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Fe(ts,null))},u1=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,s=i.colors;return Le({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?s.neutral10:s.neutral20,marginBottom:o*2,marginTop:o*2})},c1=function(t){var n=t.innerProps;return Fe("span",Ve({},n,jt(t,"indicatorSeparator",{"indicator-separator":!0})))},d1=kh(Au||(Au=lb([`
178
178
  0%, 80%, 100% { opacity: 0; }
179
179
  40% { opacity: 1; }
180
- `]))),f1=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,s=o.colors,a=o.spacing.baseUnit;return Le({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},al=function(t){var n=t.delay,r=t.offset;return Fe("span",{css:bc({animation:"".concat(d1," 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"},"","")})},h1=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,s=rr(t,r1);return Fe("div",Ve({},jt(Le(Le({},s),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Fe(al,{delay:0,offset:r}),Fe(al,{delay:160,offset:!0}),Fe(al,{delay:320,offset:!r}))},g1=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return Le({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},p1=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return Fe("div",Ve({ref:o},jt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},m1=p1,v1=["data"],b1=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},w1=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Fe("div",Ve({},jt(t,"group",{group:!0}),l),Fe(s,Ve({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Fe("div",null,n))},y1=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Le({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},C1=function(t){var n=Hd(t);n.data;var r=rr(n,v1);return Fe("div",Ve({},jt(t,"groupHeading",{"group-heading":!0}),r))},S1=w1,x1=["innerRef","isDisabled","isHidden","inputClassName"],k1=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,s=o.spacing,a=o.colors;return Le(Le({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},M1),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},Xd={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},M1={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Le({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Xd)},R1=function(t){return Le({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Xd)},I1=function(t){var n=t.cx,r=t.value,i=Hd(t),o=i.innerRef,s=i.isDisabled,a=i.isHidden,l=i.inputClassName,u=rr(i,x1);return Fe("div",Ve({},jt(t,"input",{"input-container":!0}),{"data-value":r||""}),Fe("input",Ve({className:n({input:!0},l),ref:o,style:R1(a),disabled:s},u)))},E1=I1,T1=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors;return Le({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},D1=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,s=t.cropWithEllipsis;return Le({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},O1=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors,a=t.isFocused;return Le({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},Yd=function(t){var n=t.children,r=t.innerProps;return Fe("div",r,n)},P1=Yd,L1=Yd;function F1(e){var t=e.children,n=e.innerProps;return Fe("div",Ve({role:"button"},n),t||Fe(ts,{size:14}))}var _1=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Fe(u,{data:i,innerProps:Le(Le({},jt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},Fe(c,{data:i,innerProps:Le({},jt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Fe(d,{data:i,innerProps:Le(Le({},jt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},A1=_1,H1=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return Le({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},z1=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.innerRef,a=t.innerProps;return Fe("div",Ve({},jt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:s,"aria-disabled":r},a),n)},V1=z1,$1=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Le({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},N1=function(t){var n=t.children,r=t.innerProps;return Fe("div",Ve({},jt(t,"placeholder",{placeholder:!0}),r),n)},B1=N1,W1=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,s=i.colors;return Le({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},U1=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Fe("div",Ve({},jt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},G1=U1,ka={ClearIndicator:s1,Control:m1,DropdownIndicator:a1,DownChevron:Ud,CrossIcon:ts,Group:S1,GroupHeading:C1,IndicatorsContainer:t1,IndicatorSeparator:c1,Input:E1,LoadingIndicator:h1,Menu:Nb,MenuList:Wb,MenuPortal:qb,LoadingMessage:Yb,NoOptionsMessage:Xb,MultiValue:A1,MultiValueContainer:P1,MultiValueLabel:L1,MultiValueRemove:F1,Option:V1,Placeholder:B1,SelectContainer:Zb,SingleValue:G1,ValueContainer:Qb},X1=function(t){return Le(Le({},ka),t.components)},Hu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Y1(e,t){return!!(e===t||Hu(e)&&Hu(t))}function j1(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Y1(e[n],t[n]))return!1;return!0}function q1(e,t){t===void 0&&(t=j1);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var s=e.apply(this,i);return n={lastResult:s,lastArgs:i,lastThis:this},s}return r.clear=function(){n=null},r}var K1={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"},Z1=function(t){return Fe("span",Ve({css:K1},t))},zu=Z1,J1={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,s=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,s=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,s=o===void 0?"":o,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(m,y){return m&&m.length?"".concat(m.indexOf(y)+1," of ").concat(m.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=l?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(s).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:"",".")}},Q1=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,g=l.getOptionLabel,h=l.inputValue,p=l.isMulti,m=l.isOptionDisabled,y=l.isSearchable,v=l.menuIsOpen,b=l.options,x=l.screenReaderStatus,T=l.tabSelectsValue,k=l.isLoading,R=l["aria-label"],P=l["aria-live"],I=f.useMemo(function(){return Le(Le({},J1),d||{})},[d]),C=f.useMemo(function(){var M="";if(n&&I.onChange){var V=n.option,W=n.options,j=n.removedValue,oe=n.removedValues,Q=n.value,re=function(L){return Array.isArray(L)?null:L},se=j||V||re(Q),ae=se?g(se):"",de=W||oe||void 0,fe=de?de.map(g):[],ue=Le({isDisabled:se&&m(se,a),label:ae,labels:fe},n);M=I.onChange(ue)}return M},[n,I,m,a,g]),F=f.useMemo(function(){var M="",V=r||i,W=!!(r&&a&&a.includes(r));if(V&&I.onFocus){var j={focused:V,label:g(V),isDisabled:m(V,a),isSelected:W,options:o,context:V===r?"menu":"value",selectValue:a,isAppleDevice:c};M=I.onFocus(j)}return M},[r,i,g,m,I,o,a,c]),D=f.useMemo(function(){var M="";if(v&&b.length&&!k&&I.onFilter){var V=x({count:o.length});M=I.onFilter({inputValue:h,resultsMessage:V})}return M},[o,h,v,I,b,x,k]),S=n?.action==="initial-input-focus",E=f.useMemo(function(){var M="";if(I.guidance){var V=i?"value":v?"menu":"input";M=I.guidance({"aria-label":R,context:V,isDisabled:r&&m(r,a),isMulti:p,isSearchable:y,tabSelectsValue:T,isInitialFocus:S})}return M},[R,r,i,p,m,y,v,I,a,T,S]),O=Fe(f.Fragment,null,Fe("span",{id:"aria-selection"},C),Fe("span",{id:"aria-focused"},F),Fe("span",{id:"aria-results"},D),Fe("span",{id:"aria-guidance"},E));return Fe(f.Fragment,null,Fe(zu,{id:u},S&&O),Fe(zu,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!S&&O))},ew=Q1,Ol=[{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źẑżžẓẕƶȥɀⱬꝣ"}],tw=new RegExp("["+Ol.map(function(e){return e.letters}).join("")+"]","g"),jd={};for(var ll=0;ll<Ol.length;ll++)for(var sl=Ol[ll],ul=0;ul<sl.letters.length;ul++)jd[sl.letters[ul]]=sl.base;var qd=function(t){return t.replace(tw,function(n){return jd[n]})},nw=q1(qd),Vu=function(t){return t.replace(/^\s+|\s+$/g,"")},rw=function(t){return"".concat(t.label," ").concat(t.value)},iw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Le({ignoreCase:!0,ignoreAccents:!0,stringify:rw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,s=i.ignoreAccents,a=i.stringify,l=i.trim,u=i.matchFrom,c=l?Vu(r):r,d=l?Vu(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),s&&(c=nw(c),d=qd(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},ow=["innerRef"];function aw(e){var t=e.innerRef,n=rr(e,ow),r=Lb(n,"onExited","in","enter","exit","appear");return Fe("input",Ve({ref:t},r,{css:bc({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 lw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function sw(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,s=f.useRef(!1),a=f.useRef(!1),l=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(y,v){if(u.current!==null){var b=u.current,x=b.scrollTop,T=b.scrollHeight,k=b.clientHeight,R=u.current,P=v>0,I=T-k-x,C=!1;I>v&&s.current&&(r&&r(y),s.current=!1),P&&a.current&&(o&&o(y),a.current=!1),P&&v>I?(n&&!s.current&&n(y),R.scrollTop=T,C=!0,s.current=!0):!P&&-v>x&&(i&&!a.current&&i(y),R.scrollTop=0,C=!0,a.current=!0),C&&lw(y)}},[n,r,i,o]),d=f.useCallback(function(y){c(y,y.deltaY)},[c]),g=f.useCallback(function(y){l.current=y.changedTouches[0].clientY},[]),h=f.useCallback(function(y){var v=l.current-y.changedTouches[0].clientY;c(y,v)},[c]),p=f.useCallback(function(y){if(y){var v=Db?{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 $u=["boxSizing","height","overflow","paddingRight","position"],Nu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Bu(e){e.cancelable&&e.preventDefault()}function Wu(e){e.stopPropagation()}function Uu(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Gu(){return"ontouchstart"in window||navigator.maxTouchPoints}var Xu=!!(typeof window<"u"&&window.document&&window.document.createElement),eo=0,vi={capture:!1,passive:!1};function uw(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),s=f.useCallback(function(l){if(Xu){var u=document.body,c=u&&u.style;if(r&&$u.forEach(function(p){var m=c&&c[p];i.current[p]=m}),r&&eo<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(Nu).forEach(function(p){var m=Nu[p];c&&(c[p]=m)}),c&&(c.paddingRight="".concat(h,"px"))}u&&Gu()&&(u.addEventListener("touchmove",Bu,vi),l&&(l.addEventListener("touchstart",Uu,vi),l.addEventListener("touchmove",Wu,vi))),eo+=1}},[r]),a=f.useCallback(function(l){if(Xu){var u=document.body,c=u&&u.style;eo=Math.max(eo-1,0),r&&eo<1&&$u.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&Gu()&&(u.removeEventListener("touchmove",Bu,vi),l&&(l.removeEventListener("touchstart",Uu,vi),l.removeEventListener("touchmove",Wu,vi)))}},[r]);return f.useEffect(function(){if(t){var l=o.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){o.current=l}}var cw=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},dw={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function fw(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=sw({isEnabled:i,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=uw({isEnabled:n}),d=function(h){u(h),c(h)};return Fe(f.Fragment,null,n&&Fe("div",{onClick:cw,css:dw}),t(d))}var hw={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},gw=function(t){var n=t.name,r=t.onFocus;return Fe("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:hw,value:"",onChange:function(){}})},pw=gw;function ns(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 mw(){return ns(/^iPhone/i)}function Kd(){return ns(/^Mac/i)}function vw(){return ns(/^iPad/i)||Kd()&&navigator.maxTouchPoints>1}function bw(){return mw()||vw()}function ww(){return Kd()||bw()}var yw=function(t){return t.label},Zd=function(t){return t.label},Jd=function(t){return t.value},Cw=function(t){return!!t.isDisabled},Sw={clearIndicator:l1,container:Kb,control:g1,dropdownIndicator:o1,group:b1,groupHeading:y1,indicatorsContainer:e1,indicatorSeparator:u1,input:k1,loadingIndicator:f1,loadingMessage:Gb,menu:zb,menuList:Bb,menuPortal:jb,multiValue:T1,multiValueLabel:D1,multiValueRemove:O1,noOptionsMessage:Ub,option:H1,placeholder:$1,singleValue:W1,valueContainer:Jb},xw={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%)"},kw=4,Qd=4,Mw=38,Rw=Qd*2,Iw={baseUnit:Qd,controlHeight:Mw,menuGutter:Rw},cl={borderRadius:kw,colors:xw,spacing:Iw},Ew={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:_u(),captureMenuScroll:!_u(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:iw(),formatGroupLabel:yw,getOptionLabel:Zd,getOptionValue:Jd,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Cw,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Eb(),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 Yu(e,t,n,r){var i=nf(e,t,n),o=rf(e,t,n),s=tf(e,t),a=ba(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:s,value:a,index:r}}function ea(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(s,a){return Yu(e,s,t,a)}).filter(function(s){return qu(e,s)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=Yu(e,n,t,r);return qu(e,o)?o:void 0}).filter(Ob)}function ef(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Mi(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function ju(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Mi(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 Tw(e,t){return ef(ea(e,t))}function qu(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,s=t.label,a=t.value;return(!af(e)||!o)&&of(e,{label:s,value:a,data:i},r)}function Dw(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 Ow(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var dl=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},tf=function(t,n){return t.getOptionLabel(n)},ba=function(t,n){return t.getOptionValue(n)};function nf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function rf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ba(e,t);return n.some(function(i){return ba(e,i)===r})}function of(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var af=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Pw=1,rs=(function(e){Mh(n,e);var t=Rh(n);function n(r){var i;if(Ih(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(l,u),d(l,u)},i.setValue=function(l,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(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,p=d&&i.isOptionSelected(l,h),m=i.isOptionDisabled(l,h);if(p){var y=i.getOptionValue(l);i.setValue(h.filter(function(v){return i.getOptionValue(v)!==y}),"deselect-option",l)}else if(!m)d?i.setValue([].concat(Mi(h),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:g});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(l),g=c.filter(function(p){return i.getOptionValue(p)!==d}),h=to(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(to(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),g=to(l,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return dl(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return ju(ea(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return xb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return tf(i.props,l)},i.getOptionValue=function(l){return ba(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,d=Sw[l](u,c);d.boxSizing="border-box";var g=i.props.styles[l];return g?g(d,u):d},i.getClassNames=function(l,u){var c,d;return(c=(d=i.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return X1(i.props)},i.buildCategorizedOptions=function(){return ea(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return ef(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Le({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&xa(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var 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(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return af(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){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,x=u.openMenuOnFocus,T=i.state,k=T.focusedOption,R=T.focusedValue,P=T.selectValue;if(!m&&!(typeof v=="function"&&(v(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!d)return;c?i.popValue():p&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!y||!b||!k||x&&i.isOptionSelected(k,P))return;i.selectOption(k);break;case"Enter":if(l.keyCode===229)break;if(y){if(!k||i.isComposing)return;i.selectOption(k);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(!k)return;i.selectOption(k);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}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++Pw),i.state.selectValue=ma(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),s=i.buildFocusableOptions(),a=s.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=s[a],i.state.focusedOptionId=dl(o,s[a])}return i}return Eh(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Fu(this.menuListRef,this.focusedOptionRef),ww()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&i.isDisabled||l&&a&&!i.menuIsOpen)&&this.focusInput(),l&&s&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Fu(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,s=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:s[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(s);s||(u=-1),i==="up"?l=u>0?u-1:a.length-1:i==="down"?l=(u+1)%a.length:i==="pageup"?(l=u-o,l<0&&(l=0)):i==="pagedown"?(l=u+o,l>a.length-1&&(l=a.length-1)):i==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(cl):Le(Le({},cl),this.props.theme):cl})},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,p=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:m,isMulti:g,isRtl:h,options:p,selectOption:u,selectProps: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,s=i.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(i,o){return nf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return rf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return of(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var i=this.props,o=i.isDisabled,s=i.isSearchable,a=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),p=h.Input,m=this.state,y=m.inputIsHidden,v=m.ariaSelection,b=this.commonProps,x=a||this.getElementId("input"),T=Le(Le(Le({"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.state.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?v?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?f.createElement(p,Ve({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,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:l},T)):f.createElement(aw,Ve({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:pa,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},T))})},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,p=h.controlShouldRenderValue,m=h.isDisabled,y=h.isMulti,v=h.inputValue,b=h.placeholder,x=this.state,T=x.selectValue,k=x.focusedValue,R=x.isFocused;if(!this.hasValue()||!p)return v?null:f.createElement(d,Ve({},g,{key:"placeholder",isDisabled:m,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),b);if(y)return T.map(function(I,C){var F=I===k,D="".concat(i.getOptionLabel(I),"-").concat(i.getOptionValue(I));return f.createElement(s,Ve({},g,{components:{Container:a,Label:l,Remove:u},isFocused:F,isDisabled:m,key:D,index:C,removeProps:{onClick:function(){return i.removeValue(I)},onTouchEnd:function(){return i.removeValue(I)},onMouseDown:function(E){E.preventDefault()}},data:I}),i.formatOptionLabel(I,"value"))});if(v)return null;var P=T[0];return f.createElement(c,Ve({},g,{data:P,isDisabled:m}),this.formatOptionLabel(P,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ve({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,Ve({},s,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,s=i.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return f.createElement(s,Ve({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ve({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,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,x=y.isLoading,T=y.loadingMessage,k=y.minMenuHeight,R=y.maxMenuHeight,P=y.menuIsOpen,I=y.menuPlacement,C=y.menuPosition,F=y.menuPortalTarget,D=y.menuShouldBlockScroll,S=y.menuShouldScrollIntoView,E=y.noOptionsMessage,O=y.onMenuScrollToTop,M=y.onMenuScrollToBottom;if(!P)return null;var V=function(ae,de){var fe=ae.type,ue=ae.data,H=ae.isDisabled,L=ae.isSelected,Y=ae.label,te=ae.value,le=m===ue,Se=H?void 0:function(){return i.onOptionHover(ue)},pe=H?void 0:function(){return i.selectOption(ue)},et="".concat(i.getElementId("option"),"-").concat(de),ke={id:et,onClick:pe,onMouseMove:Se,onMouseOver:Se,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:L};return f.createElement(h,Ve({},p,{innerProps:ke,data:ue,isDisabled:H,isSelected:L,key:et,label:Y,type:fe,value:te,isFocused:le,innerRef:le?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ae.data,"menu"))},W;if(this.hasOptions())W=this.getCategorizedOptions().map(function(se){if(se.type==="group"){var ae=se.data,de=se.options,fe=se.index,ue="".concat(i.getElementId("group"),"-").concat(fe),H="".concat(ue,"-heading");return f.createElement(s,Ve({},p,{key:ue,data:ae,options:de,Heading:a,headingProps:{id:H,data:se.data},label:i.formatGroupLabel(se.data)}),se.options.map(function(L){return V(L,"".concat(fe,"-").concat(L.index))}))}else if(se.type==="option")return V(se,"".concat(se.index))});else if(x){var j=T({inputValue:b});if(j===null)return null;W=f.createElement(d,p,j)}else{var oe=E({inputValue:b});if(oe===null)return null;W=f.createElement(g,p,oe)}var Q={minMenuHeight:k,maxMenuHeight:R,menuPlacement:I,menuPosition:C,menuShouldScrollIntoView:S},re=f.createElement(Vb,Ve({},p,Q),function(se){var ae=se.ref,de=se.placerProps,fe=de.placement,ue=de.maxHeight;return f.createElement(l,Ve({},p,Q,{innerRef:ae,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:fe}),f.createElement(fw,{captureEnabled:v,onTopArrive:O,onBottomArrive:M,lockEnabled:D},function(H){return f.createElement(u,Ve({},p,{innerRef:function(Y){i.getMenuListRef(Y),H(Y)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:ue,focusedOption:m}),W)}))});return F||C==="fixed"?f.createElement(c,Ve({},p,{appendTo:F,controlElement:this.controlRef,menuPlacement:I,menuPosition:C}),re):re}},{key:"renderFormField",value:function(){var i=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(pw,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var g=d.map(function(m){return i.getOptionValue(m)}).join(s);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,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(ew,Ve({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,s=i.IndicatorsContainer,a=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,p=this.state.isFocused,m=this.commonProps=this.getCommonProps();return f.createElement(a,Ve({},m,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:p}),this.renderLiveRegion(),f.createElement(o,Ve({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:p,menuIsOpen:h}),f.createElement(l,Ve({},m,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(s,Ve({},m,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,p=i.value,m=i.menuIsOpen,y=i.inputValue,v=i.isMulti,b=ma(p),x={};if(s&&(p!==s.value||h!==s.options||m!==s.menuIsOpen||y!==s.inputValue)){var T=m?Tw(i,b):[],k=m?ju(ea(i,b),"".concat(g,"-option")):[],R=a?Dw(o,b):null,P=Ow(o,T),I=dl(k,P);x={selectValue:b,focusedOption:P,focusedOptionId:I,focusableOptionsWithIds:k,focusedValue:R,clearFocusValueOnUpdate:!1}}var C=l!=null&&i!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},F=u,D=c&&d;return c&&!D&&(F={value:to(v,b,b[0]||null),options:b,action:"initial-input-focus"},D=!d),u?.action==="initial-input-focus"&&(F=null),Le(Le(Le({},x),C),{},{prevProps:i,ariaSelection:F,prevWasFocused:D})}}]),n})(f.Component);rs.defaultProps=Ew;var Lw=f.forwardRef(function(e,t){var n=Od(e);return f.createElement(rs,Ve({ref:t},n))}),lf=Lw,Fw=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Ku=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),s=String(r.getOptionLabel(n)).toLowerCase();return o===i||s===i},fl={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return Ku(t,o,i)})||r.some(function(o){return Ku(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function _w(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,s=o===void 0?fl.formatCreateLabel:o,a=e.isValidNewOption,l=a===void 0?fl.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?fl.getNewOptionData:u,d=e.onCreateOption,g=e.options,h=g===void 0?[]:g,p=e.onChange,m=rr(e,Fw),y=m.getOptionValue,v=y===void 0?Jd:y,b=m.getOptionLabel,x=b===void 0?Zd:b,T=m.inputValue,k=m.isLoading,R=m.isMulti,P=m.value,I=m.name,C=f.useMemo(function(){return l(T,ma(P),h,{getOptionValue:v,getOptionLabel:x})?c(T,s(T)):void 0},[s,c,x,v,T,l,h,P]),F=f.useMemo(function(){return(n||!k)&&C?i==="first"?[C].concat(Mi(h)):[].concat(Mi(h),[C]):h},[n,i,k,C,h]),D=f.useCallback(function(S,E){if(E.action!=="select-option")return p(S,E);var O=Array.isArray(S)?S:[S];if(O[O.length-1]===C){if(d)d(T);else{var M=c(T,T),V={action:"create-option",name:I,option:M};p(to(R,[].concat(Mi(ma(P)),[M]),M),V)}return}p(S,E)},[c,T,R,I,C,d,p,P]);return Le(Le({},m),{},{options:F,onChange:D})}var Aw=f.forwardRef(function(e,t){var n=Od(e),r=_w(n);return f.createElement(rs,Ve({ref:t},r))}),Hw=Aw;const is="__value",zw=new RegExp(`^${is}\\d+__`),Vw=Fn("div",{target:"ek2dub20"})("display:flex;flex-direction:column;align-items:stretch;margin-top:auto;margin-bottom:auto;.gdg-multi-select{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);}"),$w=Fn("div",{target:"ek2dub21"})("font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);color:var(--gdg-text-dark);> div{border-radius:0.25rem;border:1px solid var(--gdg-border-color);}"),ta=e=>e.map(t=>typeof t=="string"?{value:t,label:t,color:void 0}:Ee(t)?{value:"",label:"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color}),sf=(e,t,n)=>Ee(e)?[]:e.map((r,i)=>{const o=n?`${is}${i}__`:"",s=t.find(a=>a.value===r);return s?{...s,value:`${o}${s.value}`}:{value:`${o}${r}`,label:r}}),Nw=e=>{const{Menu:t}=ka,{children:n,...r}=e;return Ie(t,{...r,children:n})},Bw=e=>{const t=e.innerProps,n={...t,onMouseDown:r=>{r.stopPropagation(),t?.onMouseDown?.(r)},onTouchEnd:r=>{r.stopPropagation(),t?.onTouchEnd?.(r)}};return Ie(ka.MultiValueLabel,{...e,innerProps:n})},Ww=()=>null,Uw=()=>null,Gw=e=>e.selectProps?.menuDisabled?null:Ie($w,{children:Ie(Nw,{...e,className:[e.className,"click-outside-ignore"].filter(Boolean).join(" ")})}),Xw=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:i}=e,{options:o,values:s,allowCreation:a,allowDuplicates:l}=t.data,u=ad(),[c,d]=f.useState(s),[g,h]=f.useState(!0),[p,m]=f.useState(n??""),[y]=f.useState(()=>document.getElementById("portal")),v=f.useMemo(()=>ta(o??[]),[o]),b=a&&l&&v.length===0,x=f.useCallback(E=>{g&&E.stopPropagation()},[g]),T=f.useCallback(()=>h(!0),[]),k=f.useCallback(()=>h(!1),[]),R=f.useCallback(E=>a&&l&&E.inputValue?`Create "${E.inputValue}"`:void 0,[a,l]),P=f.useMemo(()=>({control:(E,O)=>({...E,border:0,boxShadow:"none",backgroundColor:u.bgCell,pointerEvents:O.isDisabled?"auto":E.pointerEvents,cursor:O.isDisabled?"default":E.cursor}),valueContainer:E=>({...E,flexWrap:E.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:E=>({...E,backgroundColor:u.bgCell}),option:(E,O)=>({...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark,...O.isFocused?{backgroundColor:u.accentLight,cursor:"pointer"}:{},":active":{...E[":active"],color:u.accentFg,backgroundColor:u.accentColor}}),input:(E,{isDisabled:O})=>O?{display:"none"}:{...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark},placeholder:E=>({...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),noOptionsMessage:E=>({...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),clearIndicator:E=>({...E,color:u.textLight,":hover":{color:u.textDark,cursor:"pointer"}}),multiValue:(E,{data:O})=>({...E,backgroundColor:O.color??u.bgBubble,borderRadius:`${u.roundingRadius??u.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(E,{data:O,isDisabled:M})=>({...E,paddingRight:M?u.bubblePadding:0,paddingLeft:u.bubblePadding,paddingTop:0,paddingBottom:0,color:O.color?yl(O.color)>.5?"black":"white":u.textBubble,fontSize:u.editorFontSize,fontFamily:u.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:u.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(E,{data:O,isDisabled:M,isFocused:V})=>M?{display:"none"}:{...E,color:O.color?yl(O.color)>.5?"black":"white":u.textBubble,backgroundColor:void 0,borderRadius:V?`${u.roundingRadius??u.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}}),[u]),I=f.useCallback(E=>{const O=E.map(M=>l&&M.startsWith(is)?M.replace(new RegExp(zw),""):M);d(O),r({...t,data:{...t.data,values:O}})},[t,r,l]),C=E=>{switch(E.key){case"Enter":case"Tab":if(!p){i(t,[0,1]);return}l&&a&&(m(""),I([...c??[],p]),h(!1),E.preventDefault())}},F=f.useMemo(()=>({DropdownIndicator:Ww,IndicatorSeparator:Uw,MultiValueLabel:Bw,Menu:Gw}),[]),D=f.useCallback(E=>{E===null||!Array.isArray(E)||I(E.map(O=>O.value))},[I]);return Ie(Vw,{onKeyDown:x,"data-testid":"multi-select-cell",children:Ie(a?Hw:lf,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:p,onInputChange:m,options:v,placeholder:t.readonly?"":a?"Add...":void 0,noOptionsMessage:R,menuIsOpen:t.readonly?!1:g,onMenuOpen:T,onMenuClose:k,value:sf(c,v,l),onKeyDown:t.readonly?void 0:C,menuPlacement:"auto",menuPortalTarget:y,autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:P,components:F,onChange:D,menuDisabled:b})})},Yw={kind:Z.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i,highlighted:o}=e,{values:s,options:a}=t.data;if(Ee(s))return!0;const l=ta(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 s){const m=l.find(k=>k.value===p),y=m?.color??(o?r.bgBubbleSelected:r.bgBubble),v=m?.label??p,x=Ir(v,n).width+r.bubblePadding*2,T=r.bubbleHeight/2;if(d!==u.x&&d+x>u.x+u.width&&g<c&&(g++,h+=r.bubbleHeight+r.bubblePadding,d=u.x),n.fillStyle=y,n.beginPath(),jn(n,d,h,x,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?yl(y)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(v,d+r.bubblePadding,h+T+qn(n,r)),d+=x+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=sf(r,ta(i??[]),t.data.allowDuplicates).map(a=>a.label??a.value),s=o.reduce((a,l)=>e.measureText(l).width+a+n.bubblePadding*2+n.bubbleMargin,0);return o.length===0?n.cellHorizontalPadding*2:s+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:Xw,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!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=ta(t.options??[]);n=n.filter(i=>r.find(o=>o.value===i))}if(n.length!==0)return{...t,values:n}}},uf="line_chart",jw="area_chart",cf="bar_chart";function os(e,t,n,r){const i=Ti({y_min:null,y_max:null,color:void 0},t.columnTypeOptions);let o;i.color==="auto"||i.color==="auto-inverse"?o=r.colors.greenColor:o=i.color?wc(i.color,r):void 0;const s={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:o,yAxis:[i.y_min??0,i.y_max??1]}};return{...t,kind:e,typeIcon:e===uf?":material/show_chart:":e===cf?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(a){if(Ee(a))return Il();const l=Zl(a),u=[];let c=[];if(l.length===0)return Il();let d=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER;for(let y=0;y<l.length;y++){const v=fo(l[y]);if(Number.isNaN(v)||Ee(v))return Et(ot(l),`The value cannot be interpreted as a numeric array. ${ot(v)} is not a number.`);v>d&&(d=v),v<g&&(g=v),u.push(v)}let h,p;if(g===d){let y;d<=0?y=d===0?1:0:y=d,h=i.y_max??y,p=i.y_min??(d>=0?0:d)}else h=i.y_max??d,p=i.y_min??g;if(Ee(p)||Ee(h)||Number.isNaN(p)||Number.isNaN(h)||p>=h)return Et("Invalid min/max y-axis configuration",`The y_min (${p}) and y_max (${h}) configuration options must be valid numbers.`);u.length>0&&(d>h||g<p)?c=u.map(y=>d-g===0?d>(h||1)?h:p:(h-p)*((y-g)/(d-g))+p):c=u;let m=o;return(i.color==="auto"&&c[0]>c[c.length-1]||i.color==="auto-inverse"&&c[0]<c[c.length-1])&&(m=r.colors.redColor),{...s,copyData:u.join(","),data:{...s.data,values:c,displayValues:u.map(y=>ra(y)),yAxis:[p,h],color:m},isMissingValue:Ee(a)}},getCellValue(a){return a.kind===Z.Loading||a.data?.values===void 0?null:a.data?.values}}}function df(e,t){return os(uf,e,"line",t)}df.isEditableType=!1;function ff(e,t){return os(cf,e,"bar",t)}ff.isEditableType=!1;function hf(e,t){return os(jw,e,"area",t)}hf.isEditableType=!1;function as(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(en(t.radii.md),en(t.radii.maxCheckbox)))},getCell(r){let i=null;return i=Id(r),i===void 0?Et(ot(r),"The value cannot be interpreted as boolean."):{...n,data:i,isMissingValue:Ee(i)}},getCellValue(r){return r.data===void 0?null:r.data}}}as.isEditableType=!0;function Zu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function ls(e,t,n,r,i,o,s){const a=Ti({format:n,step:r,timezone:s},t.columnTypeOptions);let l;if(ct(a.timezone))try{l=Zu(Fs(),a.timezone)?.utcOffset()||void 0}catch{}let u;ct(a.min_value)&&(u=Go(a.min_value)||void 0);let c;ct(a.max_value)&&(c=Go(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=Go(h);return p===null?!t.isRequired:!(p===void 0||ct(u)&&o(p)<o(u)||ct(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 x=g(h);if(x===!1)return Et(ot(h),"Invalid input.");x instanceof Date&&(h=x)}const m=Go(h);let y="",v="",b=l;if(m===void 0)return Et(ot(h),"The value cannot be interpreted as a datetime object.");if(m!==null){let x=Fs.utc(m);if(!x.isValid())return Et(ot(m),`Invalid moment date. This should never happen. Please report this bug.
180
+ `]))),f1=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,s=o.colors,a=o.spacing.baseUnit;return Le({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},al=function(t){var n=t.delay,r=t.offset;return Fe("span",{css:bc({animation:"".concat(d1," 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"},"","")})},h1=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,s=rr(t,r1);return Fe("div",Ve({},jt(Le(Le({},s),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Fe(al,{delay:0,offset:r}),Fe(al,{delay:160,offset:!0}),Fe(al,{delay:320,offset:!r}))},g1=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return Le({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},p1=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return Fe("div",Ve({ref:o},jt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},m1=p1,v1=["data"],b1=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},w1=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Fe("div",Ve({},jt(t,"group",{group:!0}),l),Fe(s,Ve({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Fe("div",null,n))},y1=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Le({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},C1=function(t){var n=Hd(t);n.data;var r=rr(n,v1);return Fe("div",Ve({},jt(t,"groupHeading",{"group-heading":!0}),r))},S1=w1,x1=["innerRef","isDisabled","isHidden","inputClassName"],k1=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,s=o.spacing,a=o.colors;return Le(Le({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},M1),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},Yd={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},M1={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Le({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Yd)},R1=function(t){return Le({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Yd)},I1=function(t){var n=t.cx,r=t.value,i=Hd(t),o=i.innerRef,s=i.isDisabled,a=i.isHidden,l=i.inputClassName,u=rr(i,x1);return Fe("div",Ve({},jt(t,"input",{"input-container":!0}),{"data-value":r||""}),Fe("input",Ve({className:n({input:!0},l),ref:o,style:R1(a),disabled:s},u)))},E1=I1,T1=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors;return Le({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},D1=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,s=t.cropWithEllipsis;return Le({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},O1=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors,a=t.isFocused;return Le({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},Xd=function(t){var n=t.children,r=t.innerProps;return Fe("div",r,n)},P1=Xd,L1=Xd;function F1(e){var t=e.children,n=e.innerProps;return Fe("div",Ve({role:"button"},n),t||Fe(ts,{size:14}))}var _1=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Fe(u,{data:i,innerProps:Le(Le({},jt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},Fe(c,{data:i,innerProps:Le({},jt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Fe(d,{data:i,innerProps:Le(Le({},jt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},A1=_1,H1=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return Le({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},z1=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.innerRef,a=t.innerProps;return Fe("div",Ve({},jt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:s,"aria-disabled":r},a),n)},V1=z1,$1=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Le({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},N1=function(t){var n=t.children,r=t.innerProps;return Fe("div",Ve({},jt(t,"placeholder",{placeholder:!0}),r),n)},B1=N1,W1=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,s=i.colors;return Le({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},U1=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Fe("div",Ve({},jt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},G1=U1,ka={ClearIndicator:s1,Control:m1,DropdownIndicator:a1,DownChevron:Ud,CrossIcon:ts,Group:S1,GroupHeading:C1,IndicatorsContainer:t1,IndicatorSeparator:c1,Input:E1,LoadingIndicator:h1,Menu:Nb,MenuList:Wb,MenuPortal:qb,LoadingMessage:Xb,NoOptionsMessage:Yb,MultiValue:A1,MultiValueContainer:P1,MultiValueLabel:L1,MultiValueRemove:F1,Option:V1,Placeholder:B1,SelectContainer:Zb,SingleValue:G1,ValueContainer:Qb},Y1=function(t){return Le(Le({},ka),t.components)},Hu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function X1(e,t){return!!(e===t||Hu(e)&&Hu(t))}function j1(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!X1(e[n],t[n]))return!1;return!0}function q1(e,t){t===void 0&&(t=j1);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var s=e.apply(this,i);return n={lastResult:s,lastArgs:i,lastThis:this},s}return r.clear=function(){n=null},r}var K1={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"},Z1=function(t){return Fe("span",Ve({css:K1},t))},zu=Z1,J1={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,s=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,s=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,s=o===void 0?"":o,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(m,y){return m&&m.length?"".concat(m.indexOf(y)+1," of ").concat(m.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=l?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(s).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:"",".")}},Q1=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,g=l.getOptionLabel,h=l.inputValue,p=l.isMulti,m=l.isOptionDisabled,y=l.isSearchable,v=l.menuIsOpen,b=l.options,x=l.screenReaderStatus,T=l.tabSelectsValue,k=l.isLoading,R=l["aria-label"],P=l["aria-live"],I=f.useMemo(function(){return Le(Le({},J1),d||{})},[d]),C=f.useMemo(function(){var M="";if(n&&I.onChange){var V=n.option,W=n.options,j=n.removedValue,oe=n.removedValues,Q=n.value,re=function(L){return Array.isArray(L)?null:L},se=j||V||re(Q),ae=se?g(se):"",de=W||oe||void 0,fe=de?de.map(g):[],ue=Le({isDisabled:se&&m(se,a),label:ae,labels:fe},n);M=I.onChange(ue)}return M},[n,I,m,a,g]),F=f.useMemo(function(){var M="",V=r||i,W=!!(r&&a&&a.includes(r));if(V&&I.onFocus){var j={focused:V,label:g(V),isDisabled:m(V,a),isSelected:W,options:o,context:V===r?"menu":"value",selectValue:a,isAppleDevice:c};M=I.onFocus(j)}return M},[r,i,g,m,I,o,a,c]),D=f.useMemo(function(){var M="";if(v&&b.length&&!k&&I.onFilter){var V=x({count:o.length});M=I.onFilter({inputValue:h,resultsMessage:V})}return M},[o,h,v,I,b,x,k]),S=n?.action==="initial-input-focus",E=f.useMemo(function(){var M="";if(I.guidance){var V=i?"value":v?"menu":"input";M=I.guidance({"aria-label":R,context:V,isDisabled:r&&m(r,a),isMulti:p,isSearchable:y,tabSelectsValue:T,isInitialFocus:S})}return M},[R,r,i,p,m,y,v,I,a,T,S]),O=Fe(f.Fragment,null,Fe("span",{id:"aria-selection"},C),Fe("span",{id:"aria-focused"},F),Fe("span",{id:"aria-results"},D),Fe("span",{id:"aria-guidance"},E));return Fe(f.Fragment,null,Fe(zu,{id:u},S&&O),Fe(zu,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!S&&O))},ew=Q1,Ol=[{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źẑżžẓẕƶȥɀⱬꝣ"}],tw=new RegExp("["+Ol.map(function(e){return e.letters}).join("")+"]","g"),jd={};for(var ll=0;ll<Ol.length;ll++)for(var sl=Ol[ll],ul=0;ul<sl.letters.length;ul++)jd[sl.letters[ul]]=sl.base;var qd=function(t){return t.replace(tw,function(n){return jd[n]})},nw=q1(qd),Vu=function(t){return t.replace(/^\s+|\s+$/g,"")},rw=function(t){return"".concat(t.label," ").concat(t.value)},iw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Le({ignoreCase:!0,ignoreAccents:!0,stringify:rw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,s=i.ignoreAccents,a=i.stringify,l=i.trim,u=i.matchFrom,c=l?Vu(r):r,d=l?Vu(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),s&&(c=nw(c),d=qd(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},ow=["innerRef"];function aw(e){var t=e.innerRef,n=rr(e,ow),r=Lb(n,"onExited","in","enter","exit","appear");return Fe("input",Ve({ref:t},r,{css:bc({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 lw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function sw(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,s=f.useRef(!1),a=f.useRef(!1),l=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(y,v){if(u.current!==null){var b=u.current,x=b.scrollTop,T=b.scrollHeight,k=b.clientHeight,R=u.current,P=v>0,I=T-k-x,C=!1;I>v&&s.current&&(r&&r(y),s.current=!1),P&&a.current&&(o&&o(y),a.current=!1),P&&v>I?(n&&!s.current&&n(y),R.scrollTop=T,C=!0,s.current=!0):!P&&-v>x&&(i&&!a.current&&i(y),R.scrollTop=0,C=!0,a.current=!0),C&&lw(y)}},[n,r,i,o]),d=f.useCallback(function(y){c(y,y.deltaY)},[c]),g=f.useCallback(function(y){l.current=y.changedTouches[0].clientY},[]),h=f.useCallback(function(y){var v=l.current-y.changedTouches[0].clientY;c(y,v)},[c]),p=f.useCallback(function(y){if(y){var v=Db?{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 $u=["boxSizing","height","overflow","paddingRight","position"],Nu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Bu(e){e.cancelable&&e.preventDefault()}function Wu(e){e.stopPropagation()}function Uu(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Gu(){return"ontouchstart"in window||navigator.maxTouchPoints}var Yu=!!(typeof window<"u"&&window.document&&window.document.createElement),eo=0,vi={capture:!1,passive:!1};function uw(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),s=f.useCallback(function(l){if(Yu){var u=document.body,c=u&&u.style;if(r&&$u.forEach(function(p){var m=c&&c[p];i.current[p]=m}),r&&eo<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(Nu).forEach(function(p){var m=Nu[p];c&&(c[p]=m)}),c&&(c.paddingRight="".concat(h,"px"))}u&&Gu()&&(u.addEventListener("touchmove",Bu,vi),l&&(l.addEventListener("touchstart",Uu,vi),l.addEventListener("touchmove",Wu,vi))),eo+=1}},[r]),a=f.useCallback(function(l){if(Yu){var u=document.body,c=u&&u.style;eo=Math.max(eo-1,0),r&&eo<1&&$u.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&Gu()&&(u.removeEventListener("touchmove",Bu,vi),l&&(l.removeEventListener("touchstart",Uu,vi),l.removeEventListener("touchmove",Wu,vi)))}},[r]);return f.useEffect(function(){if(t){var l=o.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){o.current=l}}var cw=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},dw={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function fw(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=sw({isEnabled:i,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=uw({isEnabled:n}),d=function(h){u(h),c(h)};return Fe(f.Fragment,null,n&&Fe("div",{onClick:cw,css:dw}),t(d))}var hw={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},gw=function(t){var n=t.name,r=t.onFocus;return Fe("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:hw,value:"",onChange:function(){}})},pw=gw;function ns(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 mw(){return ns(/^iPhone/i)}function Kd(){return ns(/^Mac/i)}function vw(){return ns(/^iPad/i)||Kd()&&navigator.maxTouchPoints>1}function bw(){return mw()||vw()}function ww(){return Kd()||bw()}var yw=function(t){return t.label},Zd=function(t){return t.label},Jd=function(t){return t.value},Cw=function(t){return!!t.isDisabled},Sw={clearIndicator:l1,container:Kb,control:g1,dropdownIndicator:o1,group:b1,groupHeading:y1,indicatorsContainer:e1,indicatorSeparator:u1,input:k1,loadingIndicator:f1,loadingMessage:Gb,menu:zb,menuList:Bb,menuPortal:jb,multiValue:T1,multiValueLabel:D1,multiValueRemove:O1,noOptionsMessage:Ub,option:H1,placeholder:$1,singleValue:W1,valueContainer:Jb},xw={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%)"},kw=4,Qd=4,Mw=38,Rw=Qd*2,Iw={baseUnit:Qd,controlHeight:Mw,menuGutter:Rw},cl={borderRadius:kw,colors:xw,spacing:Iw},Ew={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:_u(),captureMenuScroll:!_u(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:iw(),formatGroupLabel:yw,getOptionLabel:Zd,getOptionValue:Jd,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Cw,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Eb(),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 Xu(e,t,n,r){var i=nf(e,t,n),o=rf(e,t,n),s=tf(e,t),a=ba(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:s,value:a,index:r}}function ea(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(s,a){return Xu(e,s,t,a)}).filter(function(s){return qu(e,s)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=Xu(e,n,t,r);return qu(e,o)?o:void 0}).filter(Ob)}function ef(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Mi(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function ju(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Mi(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 Tw(e,t){return ef(ea(e,t))}function qu(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,s=t.label,a=t.value;return(!af(e)||!o)&&of(e,{label:s,value:a,data:i},r)}function Dw(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 Ow(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var dl=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},tf=function(t,n){return t.getOptionLabel(n)},ba=function(t,n){return t.getOptionValue(n)};function nf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function rf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ba(e,t);return n.some(function(i){return ba(e,i)===r})}function of(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var af=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Pw=1,rs=(function(e){Mh(n,e);var t=Rh(n);function n(r){var i;if(Ih(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(l,u),d(l,u)},i.setValue=function(l,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(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,p=d&&i.isOptionSelected(l,h),m=i.isOptionDisabled(l,h);if(p){var y=i.getOptionValue(l);i.setValue(h.filter(function(v){return i.getOptionValue(v)!==y}),"deselect-option",l)}else if(!m)d?i.setValue([].concat(Mi(h),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:g});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(l),g=c.filter(function(p){return i.getOptionValue(p)!==d}),h=to(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(to(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),g=to(l,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return dl(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return ju(ea(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return xb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return tf(i.props,l)},i.getOptionValue=function(l){return ba(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,d=Sw[l](u,c);d.boxSizing="border-box";var g=i.props.styles[l];return g?g(d,u):d},i.getClassNames=function(l,u){var c,d;return(c=(d=i.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return Y1(i.props)},i.buildCategorizedOptions=function(){return ea(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return ef(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Le({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&xa(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var 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(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return af(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){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,x=u.openMenuOnFocus,T=i.state,k=T.focusedOption,R=T.focusedValue,P=T.selectValue;if(!m&&!(typeof v=="function"&&(v(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!d)return;c?i.popValue():p&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!y||!b||!k||x&&i.isOptionSelected(k,P))return;i.selectOption(k);break;case"Enter":if(l.keyCode===229)break;if(y){if(!k||i.isComposing)return;i.selectOption(k);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(!k)return;i.selectOption(k);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}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++Pw),i.state.selectValue=ma(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),s=i.buildFocusableOptions(),a=s.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=s[a],i.state.focusedOptionId=dl(o,s[a])}return i}return Eh(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Fu(this.menuListRef,this.focusedOptionRef),ww()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&i.isDisabled||l&&a&&!i.menuIsOpen)&&this.focusInput(),l&&s&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Fu(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,s=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:s[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(s);s||(u=-1),i==="up"?l=u>0?u-1:a.length-1:i==="down"?l=(u+1)%a.length:i==="pageup"?(l=u-o,l<0&&(l=0)):i==="pagedown"?(l=u+o,l>a.length-1&&(l=a.length-1)):i==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(cl):Le(Le({},cl),this.props.theme):cl})},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,p=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:m,isMulti:g,isRtl:h,options:p,selectOption:u,selectProps: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,s=i.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(i,o){return nf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return rf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return of(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var i=this.props,o=i.isDisabled,s=i.isSearchable,a=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),p=h.Input,m=this.state,y=m.inputIsHidden,v=m.ariaSelection,b=this.commonProps,x=a||this.getElementId("input"),T=Le(Le(Le({"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.state.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?v?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?f.createElement(p,Ve({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,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:l},T)):f.createElement(aw,Ve({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:pa,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},T))})},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,p=h.controlShouldRenderValue,m=h.isDisabled,y=h.isMulti,v=h.inputValue,b=h.placeholder,x=this.state,T=x.selectValue,k=x.focusedValue,R=x.isFocused;if(!this.hasValue()||!p)return v?null:f.createElement(d,Ve({},g,{key:"placeholder",isDisabled:m,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),b);if(y)return T.map(function(I,C){var F=I===k,D="".concat(i.getOptionLabel(I),"-").concat(i.getOptionValue(I));return f.createElement(s,Ve({},g,{components:{Container:a,Label:l,Remove:u},isFocused:F,isDisabled:m,key:D,index:C,removeProps:{onClick:function(){return i.removeValue(I)},onTouchEnd:function(){return i.removeValue(I)},onMouseDown:function(E){E.preventDefault()}},data:I}),i.formatOptionLabel(I,"value"))});if(v)return null;var P=T[0];return f.createElement(c,Ve({},g,{data:P,isDisabled:m}),this.formatOptionLabel(P,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ve({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,Ve({},s,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,s=i.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return f.createElement(s,Ve({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ve({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,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,x=y.isLoading,T=y.loadingMessage,k=y.minMenuHeight,R=y.maxMenuHeight,P=y.menuIsOpen,I=y.menuPlacement,C=y.menuPosition,F=y.menuPortalTarget,D=y.menuShouldBlockScroll,S=y.menuShouldScrollIntoView,E=y.noOptionsMessage,O=y.onMenuScrollToTop,M=y.onMenuScrollToBottom;if(!P)return null;var V=function(ae,de){var fe=ae.type,ue=ae.data,H=ae.isDisabled,L=ae.isSelected,X=ae.label,te=ae.value,le=m===ue,Se=H?void 0:function(){return i.onOptionHover(ue)},pe=H?void 0:function(){return i.selectOption(ue)},et="".concat(i.getElementId("option"),"-").concat(de),ke={id:et,onClick:pe,onMouseMove:Se,onMouseOver:Se,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:L};return f.createElement(h,Ve({},p,{innerProps:ke,data:ue,isDisabled:H,isSelected:L,key:et,label:X,type:fe,value:te,isFocused:le,innerRef:le?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ae.data,"menu"))},W;if(this.hasOptions())W=this.getCategorizedOptions().map(function(se){if(se.type==="group"){var ae=se.data,de=se.options,fe=se.index,ue="".concat(i.getElementId("group"),"-").concat(fe),H="".concat(ue,"-heading");return f.createElement(s,Ve({},p,{key:ue,data:ae,options:de,Heading:a,headingProps:{id:H,data:se.data},label:i.formatGroupLabel(se.data)}),se.options.map(function(L){return V(L,"".concat(fe,"-").concat(L.index))}))}else if(se.type==="option")return V(se,"".concat(se.index))});else if(x){var j=T({inputValue:b});if(j===null)return null;W=f.createElement(d,p,j)}else{var oe=E({inputValue:b});if(oe===null)return null;W=f.createElement(g,p,oe)}var Q={minMenuHeight:k,maxMenuHeight:R,menuPlacement:I,menuPosition:C,menuShouldScrollIntoView:S},re=f.createElement(Vb,Ve({},p,Q),function(se){var ae=se.ref,de=se.placerProps,fe=de.placement,ue=de.maxHeight;return f.createElement(l,Ve({},p,Q,{innerRef:ae,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:fe}),f.createElement(fw,{captureEnabled:v,onTopArrive:O,onBottomArrive:M,lockEnabled:D},function(H){return f.createElement(u,Ve({},p,{innerRef:function(X){i.getMenuListRef(X),H(X)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:ue,focusedOption:m}),W)}))});return F||C==="fixed"?f.createElement(c,Ve({},p,{appendTo:F,controlElement:this.controlRef,menuPlacement:I,menuPosition:C}),re):re}},{key:"renderFormField",value:function(){var i=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(pw,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var g=d.map(function(m){return i.getOptionValue(m)}).join(s);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,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(ew,Ve({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,s=i.IndicatorsContainer,a=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,p=this.state.isFocused,m=this.commonProps=this.getCommonProps();return f.createElement(a,Ve({},m,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:p}),this.renderLiveRegion(),f.createElement(o,Ve({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:p,menuIsOpen:h}),f.createElement(l,Ve({},m,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(s,Ve({},m,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,p=i.value,m=i.menuIsOpen,y=i.inputValue,v=i.isMulti,b=ma(p),x={};if(s&&(p!==s.value||h!==s.options||m!==s.menuIsOpen||y!==s.inputValue)){var T=m?Tw(i,b):[],k=m?ju(ea(i,b),"".concat(g,"-option")):[],R=a?Dw(o,b):null,P=Ow(o,T),I=dl(k,P);x={selectValue:b,focusedOption:P,focusedOptionId:I,focusableOptionsWithIds:k,focusedValue:R,clearFocusValueOnUpdate:!1}}var C=l!=null&&i!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},F=u,D=c&&d;return c&&!D&&(F={value:to(v,b,b[0]||null),options:b,action:"initial-input-focus"},D=!d),u?.action==="initial-input-focus"&&(F=null),Le(Le(Le({},x),C),{},{prevProps:i,ariaSelection:F,prevWasFocused:D})}}]),n})(f.Component);rs.defaultProps=Ew;var Lw=f.forwardRef(function(e,t){var n=Od(e);return f.createElement(rs,Ve({ref:t},n))}),lf=Lw,Fw=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Ku=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),s=String(r.getOptionLabel(n)).toLowerCase();return o===i||s===i},fl={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return Ku(t,o,i)})||r.some(function(o){return Ku(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function _w(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,s=o===void 0?fl.formatCreateLabel:o,a=e.isValidNewOption,l=a===void 0?fl.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?fl.getNewOptionData:u,d=e.onCreateOption,g=e.options,h=g===void 0?[]:g,p=e.onChange,m=rr(e,Fw),y=m.getOptionValue,v=y===void 0?Jd:y,b=m.getOptionLabel,x=b===void 0?Zd:b,T=m.inputValue,k=m.isLoading,R=m.isMulti,P=m.value,I=m.name,C=f.useMemo(function(){return l(T,ma(P),h,{getOptionValue:v,getOptionLabel:x})?c(T,s(T)):void 0},[s,c,x,v,T,l,h,P]),F=f.useMemo(function(){return(n||!k)&&C?i==="first"?[C].concat(Mi(h)):[].concat(Mi(h),[C]):h},[n,i,k,C,h]),D=f.useCallback(function(S,E){if(E.action!=="select-option")return p(S,E);var O=Array.isArray(S)?S:[S];if(O[O.length-1]===C){if(d)d(T);else{var M=c(T,T),V={action:"create-option",name:I,option:M};p(to(R,[].concat(Mi(ma(P)),[M]),M),V)}return}p(S,E)},[c,T,R,I,C,d,p,P]);return Le(Le({},m),{},{options:F,onChange:D})}var Aw=f.forwardRef(function(e,t){var n=Od(e),r=_w(n);return f.createElement(rs,Ve({ref:t},r))}),Hw=Aw;const is="__value",zw=new RegExp(`^${is}\\d+__`),Vw=Fn("div",{target:"ek2dub20"})("display:flex;flex-direction:column;align-items:stretch;margin-top:auto;margin-bottom:auto;.gdg-multi-select{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);}"),$w=Fn("div",{target:"ek2dub21"})("font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);color:var(--gdg-text-dark);> div{border-radius:0.25rem;border:1px solid var(--gdg-border-color);}"),ta=e=>e.map(t=>typeof t=="string"?{value:t,label:t,color:void 0}:Ee(t)?{value:"",label:"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color}),sf=(e,t,n)=>Ee(e)?[]:e.map((r,i)=>{const o=n?`${is}${i}__`:"",s=t.find(a=>a.value===r);return s?{...s,value:`${o}${s.value}`}:{value:`${o}${r}`,label:r}}),Nw=e=>{const{Menu:t}=ka,{children:n,...r}=e;return Ie(t,{...r,children:n})},Bw=e=>{const t=e.innerProps,n={...t,onMouseDown:r=>{r.stopPropagation(),t?.onMouseDown?.(r)},onTouchEnd:r=>{r.stopPropagation(),t?.onTouchEnd?.(r)}};return Ie(ka.MultiValueLabel,{...e,innerProps:n})},Ww=()=>null,Uw=()=>null,Gw=e=>e.selectProps?.menuDisabled?null:Ie($w,{children:Ie(Nw,{...e,className:[e.className,"click-outside-ignore"].filter(Boolean).join(" ")})}),Yw=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:i}=e,{options:o,values:s,allowCreation:a,allowDuplicates:l}=t.data,u=ad(),[c,d]=f.useState(s),[g,h]=f.useState(!0),[p,m]=f.useState(n??""),[y]=f.useState(()=>document.getElementById("portal")),v=f.useMemo(()=>ta(o??[]),[o]),b=a&&l&&v.length===0,x=f.useCallback(E=>{g&&E.stopPropagation()},[g]),T=f.useCallback(()=>h(!0),[]),k=f.useCallback(()=>h(!1),[]),R=f.useCallback(E=>a&&l&&E.inputValue?`Create "${E.inputValue}"`:void 0,[a,l]),P=f.useMemo(()=>({control:(E,O)=>({...E,border:0,boxShadow:"none",backgroundColor:u.bgCell,pointerEvents:O.isDisabled?"auto":E.pointerEvents,cursor:O.isDisabled?"default":E.cursor}),valueContainer:E=>({...E,flexWrap:E.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:E=>({...E,backgroundColor:u.bgCell}),option:(E,O)=>({...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark,...O.isFocused?{backgroundColor:u.accentLight,cursor:"pointer"}:{},":active":{...E[":active"],color:u.accentFg,backgroundColor:u.accentColor}}),input:(E,{isDisabled:O})=>O?{display:"none"}:{...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark},placeholder:E=>({...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),noOptionsMessage:E=>({...E,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),clearIndicator:E=>({...E,color:u.textLight,":hover":{color:u.textDark,cursor:"pointer"}}),multiValue:(E,{data:O})=>({...E,backgroundColor:O.color??u.bgBubble,borderRadius:`${u.roundingRadius??u.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(E,{data:O,isDisabled:M})=>({...E,paddingRight:M?u.bubblePadding:0,paddingLeft:u.bubblePadding,paddingTop:0,paddingBottom:0,color:O.color?yl(O.color)>.5?"black":"white":u.textBubble,fontSize:u.editorFontSize,fontFamily:u.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:u.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(E,{data:O,isDisabled:M,isFocused:V})=>M?{display:"none"}:{...E,color:O.color?yl(O.color)>.5?"black":"white":u.textBubble,backgroundColor:void 0,borderRadius:V?`${u.roundingRadius??u.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}}),[u]),I=f.useCallback(E=>{const O=E.map(M=>l&&M.startsWith(is)?M.replace(new RegExp(zw),""):M);d(O),r({...t,data:{...t.data,values:O}})},[t,r,l]),C=E=>{switch(E.key){case"Enter":case"Tab":if(!p){i(t,[0,1]);return}l&&a&&(m(""),I([...c??[],p]),h(!1),E.preventDefault())}},F=f.useMemo(()=>({DropdownIndicator:Ww,IndicatorSeparator:Uw,MultiValueLabel:Bw,Menu:Gw}),[]),D=f.useCallback(E=>{E===null||!Array.isArray(E)||I(E.map(O=>O.value))},[I]);return Ie(Vw,{onKeyDown:x,"data-testid":"multi-select-cell",children:Ie(a?Hw:lf,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:p,onInputChange:m,options:v,placeholder:t.readonly?"":a?"Add...":void 0,noOptionsMessage:R,menuIsOpen:t.readonly?!1:g,onMenuOpen:T,onMenuClose:k,value:sf(c,v,l),onKeyDown:t.readonly?void 0:C,menuPlacement:"auto",menuPortalTarget:y,autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:P,components:F,onChange:D,menuDisabled:b})})},Xw={kind:Z.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i,highlighted:o}=e,{values:s,options:a}=t.data;if(Ee(s))return!0;const l=ta(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 s){const m=l.find(k=>k.value===p),y=m?.color??(o?r.bgBubbleSelected:r.bgBubble),v=m?.label??p,x=Ir(v,n).width+r.bubblePadding*2,T=r.bubbleHeight/2;if(d!==u.x&&d+x>u.x+u.width&&g<c&&(g++,h+=r.bubbleHeight+r.bubblePadding,d=u.x),n.fillStyle=y,n.beginPath(),jn(n,d,h,x,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?yl(y)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(v,d+r.bubblePadding,h+T+qn(n,r)),d+=x+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=sf(r,ta(i??[]),t.data.allowDuplicates).map(a=>a.label??a.value),s=o.reduce((a,l)=>e.measureText(l).width+a+n.bubblePadding*2+n.bubbleMargin,0);return o.length===0?n.cellHorizontalPadding*2:s+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:Yw,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!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=ta(t.options??[]);n=n.filter(i=>r.find(o=>o.value===i))}if(n.length!==0)return{...t,values:n}}},uf="line_chart",jw="area_chart",cf="bar_chart";function os(e,t,n,r){const i=Ti({y_min:null,y_max:null,color:void 0},t.columnTypeOptions);let o;i.color==="auto"||i.color==="auto-inverse"?o=r.colors.greenColor:o=i.color?wc(i.color,r):void 0;const s={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:o,yAxis:[i.y_min??0,i.y_max??1]}};return{...t,kind:e,typeIcon:e===uf?":material/show_chart:":e===cf?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(a){if(Ee(a))return Il();const l=Zl(a),u=[];let c=[];if(l.length===0)return Il();let d=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER;for(let y=0;y<l.length;y++){const v=fo(l[y]);if(Number.isNaN(v)||Ee(v))return Et(ot(l),`The value cannot be interpreted as a numeric array. ${ot(v)} is not a number.`);v>d&&(d=v),v<g&&(g=v),u.push(v)}let h,p;if(g===d){let y;d<=0?y=d===0?1:0:y=d,h=i.y_max??y,p=i.y_min??(d>=0?0:d)}else h=i.y_max??d,p=i.y_min??g;if(Ee(p)||Ee(h)||Number.isNaN(p)||Number.isNaN(h)||p>=h)return Et("Invalid min/max y-axis configuration",`The y_min (${p}) and y_max (${h}) configuration options must be valid numbers.`);u.length>0&&(d>h||g<p)?c=u.map(y=>d-g===0?d>(h||1)?h:p:(h-p)*((y-g)/(d-g))+p):c=u;let m=o;return(i.color==="auto"&&c[0]>c[c.length-1]||i.color==="auto-inverse"&&c[0]<c[c.length-1])&&(m=r.colors.redColor),{...s,copyData:u.join(","),data:{...s.data,values:c,displayValues:u.map(y=>ra(y)),yAxis:[p,h],color:m},isMissingValue:Ee(a)}},getCellValue(a){return a.kind===Z.Loading||a.data?.values===void 0?null:a.data?.values}}}function df(e,t){return os(uf,e,"line",t)}df.isEditableType=!1;function ff(e,t){return os(cf,e,"bar",t)}ff.isEditableType=!1;function hf(e,t){return os(jw,e,"area",t)}hf.isEditableType=!1;function as(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(en(t.radii.md),en(t.radii.maxCheckbox)))},getCell(r){let i=null;return i=Id(r),i===void 0?Et(ot(r),"The value cannot be interpreted as boolean."):{...n,data:i,isMissingValue:Ee(i)}},getCellValue(r){return r.data===void 0?null:r.data}}}as.isEditableType=!0;function Zu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function ls(e,t,n,r,i,o,s){const a=Ti({format:n,step:r,timezone:s},t.columnTypeOptions);let l;if(ct(a.timezone))try{l=Zu(Fs(),a.timezone)?.utcOffset()||void 0}catch{}let u;ct(a.min_value)&&(u=Go(a.min_value)||void 0);let c;ct(a.max_value)&&(c=Go(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=Go(h);return p===null?!t.isRequired:!(p===void 0||ct(u)&&o(p)<o(u)||ct(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 x=g(h);if(x===!1)return Et(ot(h),"Invalid input.");x instanceof Date&&(h=x)}const m=Go(h);let y="",v="",b=l;if(m===void 0)return Et(ot(h),"The value cannot be interpreted as a datetime object.");if(m!==null){let x=Fs.utc(m);if(!x.isValid())return Et(ot(m),`Invalid moment date. This should never happen. Please report this bug.
181
181
  Error: ${x.toString()}`);if(a.timezone){try{x=Zu(x,a.timezone)}catch(T){return Et(x.toISOString(),`Failed to adjust to the provided timezone: ${a.timezone}.
182
182
  Error: ${T}`)}b=x.utcOffset()}try{v=_s(x,a.format||n,e)}catch(T){return Et(x.toISOString(),`Failed to format the date for rendering with: ${a.format}.
183
183
  Error: ${T}`)}y=_s(x,n,e)}return{...d,copyData:y,isMissingValue:Ee(m),data:{...d.data,date:m,displayDate:v,timezoneOffset:b}}},getCellValue(h){return Ee(h?.data?.date)?null:o(h.data.date)}}}function ss(e){let t="YYYY-MM-DD HH:mm:ss";e.columnTypeOptions?.step>=60?t="YYYY-MM-DD HH:mm":e.columnTypeOptions?.step<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const n=Th(e.arrowType),r=ct(n)||ct(e?.columnTypeOptions?.timezone);return ls("datetime",e,r?t+"Z":t,1,"datetime-local",i=>r?i.toISOString():i.toISOString().replace("Z",""),n)}ss.isEditableType=!0;function us(e){let t="HH:mm:ss";return e.columnTypeOptions?.step>=60?t="HH:mm":e.columnTypeOptions?.step<1&&(t="HH:mm:ss.SSS"),ls("time",e,t,1,"time",n=>n.toISOString().split("T")[1].replace("Z",""))}us.isEditableType=!0;function cs(e){return ls("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}cs.isEditableType=!0;function gf(e){const t={kind:Z.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",typeIcon:":material/image:",sortMode:"default",isEditable:!1,getCell(n){const r=ct(n)?[ot(n)]:[];return{...t,data:r,isMissingValue:!ct(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}gf.isEditableType=!1;function pf(e){const t={kind:Z.Custom,allowOverlay:!0,contentAlign:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal",copyData:"",data:{kind:"json-cell",value:""}};return{...e,kind:"json",typeIcon:":material/code_blocks:",sortMode:"default",isEditable:!1,getCell(n){try{const r=ct(n)?ho(da(n)):"";return{...t,copyData:r,isMissingValue:Ee(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Et(ot(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){return n.data?.value??null}}}pf.isEditableType=!1;function mf(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(l){n=`Invalid validate regex: ${t.validate}.
184
184
  Error: ${l}`}let r=!1,i=t.display_text,o;if(!Ee(i)){if(i.startsWith(":material/")&&Dh(i))i=Oh(i).icon,r=!0;else if(i.includes("(")&&i.includes(")"))try{o=new RegExp(i,"us")}catch{o=void 0}}const s={kind:Z.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?"center":void 0),style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:"",...r&&{themeOverride:{fontFamily:Ph.iconFont,linkColor:void 0}}},a=l=>{if(Ee(l))return!e.isRequired;const u=ot(l);return!(t.max_chars&&u.length>t.max_chars||n instanceof RegExp&&n.test(u)===!1)};return{...e,kind:"link",typeIcon:":material/link:",sortMode:"default",validateInput:a,getCell(l,u){if(Ee(l))return{...s,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const c=l;if(typeof n=="string")return Et(ot(c),n);if(u&&a(c)===!1)return Et(ot(c),"Invalid input.");let d="";return c&&(o!==void 0?d=tb(o,c):d=i||c),{...s,data:c,displayData:d,isMissingValue:Ee(c),onClickUri:g=>{window.open(c.startsWith("www.")?`https://${c}`:c,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:c}},getCellValue(l){return Ee(l.data)?null:l.data}}}mf.isEditableType=!0;function ds(e){const t={kind:Z.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",copyData:"",data:{kind:"multi-select-cell",values:[],options:void 0,allowCreation:!0,allowDuplicates:!0}};return{...e,kind:"list",sortMode:"default",typeIcon:":material/list:",getCell(n){if(Ee(n))return{...t,data:{...t.data,values:null},isMissingValue:!0,copyData:""};const r=Zl(n);return{...t,data:{...t.data,values:r},copyData:Ed(r),...e.isEditable&&!Rd(n)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(n){return Ee(n.data?.values)?null:n.data.values}}}ds.isEditableType=!0;const qw=(e,t)=>{if(Ee(e))return[];const n=t.colors.chartCategoricalColors,r=vo(t);let i=0;return e.filter(o=>o!==null&&o!=="").map(o=>{if(typeof o=="string")return{value:ot(o).trim(),label:void 0,color:void 0};let s;o.color==="auto"?(s=bi(n[i%n.length],r?.7:.6),i+=1):o.color&&(s=Lh(o.color,t));const a=s?Fh(s,t.colors.bgColor):void 0;return{value:ot(o.value).trim(),label:o.label??void 0,color:a}})};function vf(e,t){const n=Ti({options:[],accept_new_options:!1},e.columnTypeOptions),r=qw(n.options,t),i=new Set(r.map(s=>s.value)),o={kind:Z.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"multi-select-cell",values:[],options:r,allowCreation:n.accept_new_options??!1,allowDuplicates:!1},copyData:""};return{...e,kind:"multiselect",sortMode:"default",typeIcon:":material/checklist:",getCell(s,a){if(Ee(s))return{...o,data:{...o.data,values:null},isMissingValue:!0,copyData:""};let l=Zl(s);return l=l.map(u=>ot(u).trim()),a&&l.length>0&&n.accept_new_options===!1&&(l=l.filter(u=>i.has(u)),l.length===0)?Et(ot(s),"The values could not be matched with the configured options."):{...o,data:{...o.data,values:l},copyData:Ed(l),...e.isEditable&&!Rd(s)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(s){return Ee(s.data?.values)?null:s.data.values}}}vf.isEditableType=!0;function fs(e){const t=Ti({step:yc(e.arrowType)?1:void 0,min_value:_h(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(Ah(e.arrowType)||Hh(e.arrowType)),r=Ee(t.min_value)||t.min_value<0,i=ct(t.step)&&!Number.isNaN(t.step)?Td(t.step):void 0,o={kind:Z.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:i,thousandSeparator:""},s=a=>{let l=fo(a);if(Ee(l))return!e.isRequired;if(Number.isNaN(l))return!1;let u=!1;return ct(t.max_value)&&l>t.max_value&&(l=t.max_value,u=!0),ct(t.min_value)&&l<t.min_value?!1:u?l:!0};return{...e,kind:"number",sortMode:"smart",typeIcon:":material/tag:",validateInput:s,getCell(a,l){if(l===!0){const d=s(a);if(d===!1)return Et(ot(a),"Invalid input.");typeof d=="number"&&(a=d)}let u=fo(a),c="";if(ct(u)){if(Number.isNaN(u))return Et(ot(a),"The value cannot be interpreted as a number.");if(ct(i)&&(u=Qv(u,i)),Number.isInteger(u)&&!Number.isSafeInteger(u))return Et(ot(a),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=vl(u,e.arrowType):c=ra(u,t.format,i)}catch(d){return Et(ot(u),ct(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${d}`:`Failed to format the number. Error: ${d}`)}}return{...o,data:u,displayData:c,isMissingValue:Ee(u),copyData:Ee(u)?"":ot(u)}},getCellValue(a){return a.data===void 0?null:a.data}}}fs.isEditableType=!0;function go(e){const t={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",typeIcon:":material/data_object:",isEditable:!1,getCell(n){try{const r=ct(n)?ot(n):null,i=ct(r)?ho(r):"";return{...t,data:r,displayData:i,isMissingValue:Ee(n)}}catch(r){return Et(ot(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}go.isEditableType=!1;function bf(e,t){const n=yc(e.arrowType),r=Ti({min_value:0,max_value:n?100:1,format:n?"%3d%%":"percent",step:n?1:void 0,color:void 0},e.columnTypeOptions),i=Ee(r.step)||Number.isNaN(r.step)?void 0:Td(r.step);let o;try{o=ra(r.max_value,r.format,i)}catch{o=ot(r.max_value)}const s={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,readonly:!0,data:{kind:"range-cell",min:r.min_value,max:r.max_value,step:r.step??.01,value:r.min_value,label:String(r.min_value),measureLabel:o}};return{...e,kind:"progress",sortMode:"smart",typeIcon:":material/commit:",isEditable:!1,getCell(a){if(Ee(a))return Il();if(Ee(r.min_value)||Ee(r.max_value)||Number.isNaN(r.min_value)||Number.isNaN(r.max_value)||r.min_value>=r.max_value)return Et("Invalid min/max parameters",`The min_value (${r.min_value}) and max_value (${r.max_value}) parameters must be valid numbers.`);if(ct(r.step)&&Number.isNaN(r.step))return Et("Invalid step parameter",`The step parameter (${r.step}) must be a valid number.`);const l=fo(a);if(Number.isNaN(l)||Ee(l))return Et(ot(a),"The value cannot be interpreted as a number.");if(Number.isInteger(l)&&!Number.isSafeInteger(l))return Et(ot(a),"The value is larger than the maximum supported integer values in number columns (2^53).");let u="";try{u=ra(l,r.format,i)}catch(g){return Et(ot(l),ct(r.format)?`Failed to format the number based on the provided format configuration: (${r.format}). Error: ${g}`:`Failed to format the number. Error: ${g}`)}const c=Math.min(r.max_value,Math.max(r.min_value,l));let d;if(r.color==="auto"||r.color==="auto-inverse"){const g=r.max_value-r.min_value,p=(g===0?0:(c-r.min_value)/g)>.5;r.color==="auto"?d=p?t?.colors.greenColor:t?.colors.redColor:d=p?t?.colors.redColor:t?.colors.greenColor}else r.color&&(d=wc(r.color,t));return{...s,isMissingValue:Ee(a),copyData:String(l),data:{...s.data,value:c,label:u,measureLabel:u.length>o.length?u:o,color:d}}},getCellValue(a){return a.kind===Z.Loading||a.data?.value===void 0?null:a.data?.value}}}bf.isEditableType=!1;const Kw=e=>Ee(e)?[]:e.filter(t=>ct(t)&&t!=="").map(t=>{if(typeof t=="object"&&"value"in t){const r=ot(t.value).trim();return{value:r,label:t.label??r}}const n=ot(t).trim();return{value:n,label:n}});function hs(e){let t="string";const n=Ti({options:Cc(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=l=>typeof l=="object"&&l!==null&&"value"in l,i=l=>r(l)?typeof l.value:typeof l,o=new Set(n.options.map(i));o.size===1&&(o.has("number")||o.has("bigint")?t="number":o.has("boolean")&&(t="boolean"));const s=Kw(n.options),a={kind:Z.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...s],value:""}};return{...e,kind:"selectbox",sortMode:"default",typeIcon:":material/arrow_drop_down_circle:",getCell(l,u){let c=null;return ct(l)&&l!==""&&(c=ot(l)),u&&!a.data.allowedValues.some(g=>g===null?c===null:typeof g=="string"?g===c:typeof g=="object"&&"value"in g?g.value===c:!1)?Et(ot(c),"The value is not part of the allowed options."):{...a,isMissingValue:c===null,copyData:c||"",data:{...a.data,value:c}}},getCellValue(l){return Ee(l.data?.value)||l.data?.value===""?null:t==="number"?fo(l.data?.value)??null:t==="boolean"?Id(l.data?.value)??null:l.data?.value}}}hs.isEditableType=!0;function gs(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n=`Invalid validate regex: ${t.validate}.
185
- Error: ${o}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},i=o=>{if(Ee(o))return!e.isRequired;let s=ot(o),a=!1;return t.max_chars&&s.length>t.max_chars&&(s=s.slice(0,t.max_chars),a=!0),n instanceof RegExp&&n.test(s)===!1?!1:a?s:!0};return{...e,kind:"text",sortMode:"default",typeIcon:":material/notes:",validateInput:i,getCell(o,s){if(typeof n=="string")return Et(ot(o),n);if(s){const a=i(o);if(a===!1)return Et(ot(o),"Invalid input.");typeof a=="string"&&(o=a)}try{const a=ct(o)?ot(o):null,l=ct(a)?ho(a):"";return{...r,isMissingValue:Ee(a),data:a,displayData:l}}catch(a){return Et("Incompatible value",`The value cannot be interpreted as string. Error: ${a}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}gs.isEditableType=!0;const Ju=Fn("img",{target:"e16b5pc80"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),Zw=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?Ie("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:Ie(Ju,{src:t})}):Ie(Ju,{src:t})},Qu=new Map(Object.entries({object:go,text:gs,checkbox:as,selectbox:hs,list:ds,multiselect:vf,number:fs,link:mf,datetime:ss,date:cs,time:us,line_chart:df,bar_chart:ff,area_chart:hf,image:gf,progress:bf,json:pf})),Jw=[ob,Yw],po=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),i=r.get(e),o={...i||{},...n||{}};return(i?.type_config||n?.type_config)&&(o.type_config={...i?.type_config||{},...n?.type_config||{}}),r.set(e,o),r};function Qw(e){return{changeColumnFormat:f.useCallback((n,r)=>{e(i=>po({columnId:n,columnConfigMapping:i,updatedProps:{type_config:{format:r}}}))},[e])}}function hl(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const i=r.exec(n);if(i)return i[1].trim()}function ey(e,t,n){const r={};if(!n.includes(t))return e;const i=hl(t,"color",n);i&&(r.textDark=i,(e.kind===Z.Bubble||e.kind===Z.Custom&&e.data?.kind==="multi-select-cell")&&(r.textBubble=i),e.kind===Z.Uri&&(r.linkColor=i));const o=hl(t,"background-color",n);o&&(r.bgCell=o),o==="yellow"&&i===void 0&&(r.textDark="#31333F");const s=hl(t,"font-weight",n);return s&&(r.baseFontStyle=`${s} ${Zh.sm}`),r?{...e,themeOverride:r}:e}function ty(e){return Bh(e)||Wh(e)?gs:Uh(e)?ss:Sc(e)?us:Gh(e)?cs:Xh(e)||Yh(e)?go:Cc(e)?as:jh(e)?fs:qh(e)?hs:Kh(e)?ds:go}function wf(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(r=>r!=="").join(" / "):void 0;return{title:t,group:n}}function ps(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function ny(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:i}=wf(n),o=e.columnTypes[t];let s=!0;return Nh(o)&&(s=!1),ps({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:i,isEditable:s,arrowType:o,isIndex:!0,isPinned:!0})}function ry(e,t){const n=e.columnNames.map(s=>s[t]),{title:r,group:i}=wf(n),o=e.columnTypes[t];return ps({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:o,group:i})}function yf(){return ps({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:Jh.INDEX,arrowField:new zh("",new Vh,!0),pandasType:void 0}})}function ec(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(yf()),t;for(let o=0;o<r;o++)t.push(ny(e,o));for(let o=0;o<i;o++)t.push(ry(e,o+r));return t}function iy(e,t,n,r=void 0){let i;if(e.kind==="object"||e.kind==="json")i=e.getCell(ct(t.content)?ho(vl(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&ct(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let o;Sc(t.contentType)&&ct(t.field?.type?.unit)?o=mg(t.content,t.field):o=$r.utc(Number(t.content)).toDate(),i=e.getCell(o)}else if($h(t.contentType)){const o=Ee(t.content)?null:vl(t.content,t.contentType);i=e.getCell(o)}else i=e.getCell(t.content);if(Ri(i))return i;if(!e.isEditable){if(n&&ct(n?.displayContent)){const o=ho(n.displayContent);i.kind===Z.Text?i={...i,displayData:o}:i.kind===Z.Number&&Ee(e.columnTypeOptions?.format)?i={...i,displayData:o}:i.kind===Z.Uri&&Ee(e.columnTypeOptions?.display_text)?i={...i,displayData:o}:i.kind===Z.Custom&&i.data?.kind==="date-picker-cell"&&Ee(e.columnTypeOptions?.format)&&(i={...i,data:{...i.data,displayDate:o}})}r&&n?.cssId&&(i=ey(i,n.cssId,r))}return i}function Cf(e){return e?.useStretch??!1}function Sf(e){if(e?.pixelWidth)return e.pixelWidth}function oy(e){return e?.useContent??!1}function ay(e,t){return t?!1:e?.useStretch??!1}function ly(e){return e?.useContent??!1}function sy(e){if(e?.pixelHeight)return e.pixelHeight}function gl({numRows:e,rowHeight:t,theme:n,numHeaderRows:r=1}){return e*t+r*n.defaultHeaderHeight+2*n.tableBorderWidth}const na="_index",tc="_pos:",nc={small:75,medium:200,large:400},xf=Fl.getLogger("useColumnLoader");function uy(e){if(!Ee(e)){if(typeof e=="number")return e;if(e in nc)return nc[e]}}const qo=(e,t)=>Qh(e,t,(r,i)=>{if(gc(i))return i});function rc(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(na)&&(n=qo(n,t.get(na)??{})),t.has(`${tc}${e.indexNumber}`)&&(n=qo(n,t.get(`${tc}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==na&&(n=qo(n,t.get(e.name)??{})),t.has(e.id)&&(n=qo(n,t.get(e.id)??{})),Vg(n)?e:mc({...e},{title:n.label,width:uy(n.width),isEditable:ct(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function cy(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return xf.error(t),new Map}}function ic(e){const t=e.columnTypeOptions?.type;let n;return ct(t)&&(Qu.has(t)?n=Qu.get(t):xf.warn(`Unknown column type configured in column configuration: ${t}`)),Ee(n)&&(n=ty(e.arrowType)),n}function dy(e,t,n,r,i){const o=Ur(),s=f.useMemo(()=>cy(e.columns),[e.columns]),[a,l]=f.useState(s);f.useEffect(()=>{l(s)},[s]);const u=f.useMemo(()=>Cf(i),[i]),c=f.useMemo(()=>Sf(i),[i]),d=u||ct(c)&&c>0,g=ct(e.rowHeight)&&e.rowHeight>en("4rem"),h=f.useMemo(()=>ec(t).map(m=>{let y={...m,...rc(m,a),isStretched:d};const v=ic(y);return(e.editingMode===Yt.EditingMode.READ_ONLY||n||v.isEditableType===!1)&&(y={...y,isEditable:!1}),e.editingMode!==Yt.EditingMode.READ_ONLY&&y.isEditable==!0&&(y={...y,icon:"editable"},y.isRequired&&e.editingMode===Yt.EditingMode.DYNAMIC&&(y={...y,isHidden:!1})),v(y,o)}),[t,a,d,e.editingMode,n,o]);return{columns:f.useMemo(()=>{const m=ec(t).map(x=>{let T={...x,...rc(x,a),isStretched:d,isWrappingAllowed:g};const k=ic(T);return(e.editingMode===Yt.EditingMode.READ_ONLY||n||k.isEditableType===!1)&&(T={...T,isEditable:!1}),e.editingMode!==Yt.EditingMode.READ_ONLY&&T.isEditable==!0&&(T={...T,icon:"editable"},T.isRequired&&e.editingMode===Yt.EditingMode.DYNAMIC&&(T={...T,isHidden:!1})),k(T,o)}).filter(x=>!x.isHidden),y=[],v=[];r?.length?(m.forEach(x=>{x.isIndex&&!r.includes(x.name)&&!r.includes(x.id)&&x.isPinned!==!1&&y.push(x)}),r.forEach(x=>{const T=m.find(k=>k.name===x||k.id===x);T&&(T.isPinned?y.push(T):v.push(T))})):m.forEach(x=>{x.isPinned?y.push(x):v.push(x)});const b=[...y,...v];return b.length>0?b:[go(yf())]},[t,a,g,d,n,e.editingMode,r,o]),allColumns:h,setColumnConfigMapping:l}}function fy(e,t,n,r,i,o){const s=f.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??r*2),0)>n*.6,[e,n,r]),a=t||s?0:e.filter(c=>c.isPinned).length,l=f.useCallback(c=>{o(d=>po({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!1}})),i(!0,!1)},[i,o]);return{pinColumn:f.useCallback(c=>{o(d=>po({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!0}})),i(!0,!1)},[i,o]),unpinColumn:l,freezeColumns:a}}function hy(e,t,n,r,i){return{onColumnMoved:f.useCallback((s,a)=>{const l=[...e],[u]=l.splice(s,1);l.splice(a,0,u),a<t&&!u.isPinned?n(u.id):a>=t&&u.isPinned&&r(u.id),i(l.map(c=>c.id))},[e,t,n,r,i])}}function gy(e){const[t,n]=f.useState(()=>new Map),r=f.useCallback((o,s,a,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:f.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:r}}function py(e){switch(e.kind){case Z.Number:return e.data?.toString()??"";case Z.Boolean:return e.data?.toString()??"";case Z.Markdown:case Z.RowID:case Z.Text:case Z.Uri:return e.data??"";case Z.Bubble:case Z.Image:return e.data.join("");case Z.Drilldown:return e.data.map(t=>t.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function oc(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function my(e,t){return e=oc(e),t=oc(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function vy(e,t){return e>t?1:e===t?0:-1}function by(e){const{sort:t,rows:n,getCellContent:r}=e,i=f.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),o=f.useMemo(()=>i.map(u=>{const c=e.columns.findIndex(d=>u.column===d||d.id!==void 0&&u.column.id===d.id);return c===-1?void 0:c}),[i,e.columns]),s=f.useMemo(()=>{const u=i.map((d,g)=>({sort:d,col:o[g]})).filter(d=>d.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let d=0;d<u.length;d++){const{col:g}=u[d],h=[g,0];for(let p=0;p<n;p++)h[1]=p,c[d][p]=py(r(h))}return kr(n).sort((d,g)=>{for(let h=0;h<u.length;h++){const{sort:p}=u[h],m=c[h][d],y=c[h][g];let v;if(p.mode==="raw"?v=vy(m,y):p.mode==="smart"?v=my(m,y):v=m.localeCompare(y),v!==0)return(p.direction??"asc")==="desc"&&(v=-v),v}return 0})},[r,n,i,o]),a=f.useCallback(u=>s===void 0?u:s[u],[s]),l=f.useCallback(([u,c])=>s===void 0?r([u,c]):(c=s[c],r([u,c])),[r,s]);return s===void 0?{getCellContent:e.getCellContent,getOriginalIndex:a}:{getOriginalIndex:a,getCellContent:l}}function wy(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function yy(e,t,n){const[r,i]=f.useState(),{getCellContent:o,getOriginalIndex:s}=by({columns:t.map(u=>El(u)),getCellContent:n,rows:e,sort:r}),a=f.useMemo(()=>wy(t,r),[t,r]),l=f.useCallback((u,c,d)=>{const g=a[u];let h;c==="auto"?(h="asc",r?.column.id===g.id&&(r.direction==="asc"?h="desc":h=void 0)):h=c,h===void 0||d&&h===r?.direction?i(void 0):i({column:El(g),direction:h,mode:g.sortMode})},[r,a]);return{columns:a,sortColumn:l,getOriginalIndex:s,getCellContent:o}}function Cy(e,t){const n=f.useCallback(i=>{t(o=>po({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=f.useCallback(i=>{t(o=>po({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function Sy(){return{provideEditor:f.useCallback(t=>{if(t.kind===Z.Text&&t.readonly&&Jv(t.data))return{editor:ib}},[])}}const xy={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:i,hoverAmount:o,hoverX:s}=e;let{values:a,yAxis:l,color:u,graphKind:c="area",displayValues:d,hideAxis:g}=t.data;const[h,p]=l;if(a.length===0)return!0;a=a.map(R=>Math.min(1,Math.max(0,(R-h)/(p-h))));const m=r.cellHorizontalPadding,y=m+i.x,v=i.y+3,b=i.height-6,x=i.width-m*2,T=p-h,k=p<=0?v:h>=0?v+b:v+b*(p/T);if(!g&&h<=0&&p>=0&&(n.beginPath(),n.moveTo(y,k),n.lineTo(y+x,k),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const R=2,P=(a.length-1)*R,I=(x-P)/a.length;let C=y;for(const F of a){const D=v+b-F*b;n.moveTo(C,k),n.lineTo(C+I,k),n.lineTo(C+I,D),n.lineTo(C,D),C+=I+R}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{a.length===1&&(a=[a[0],a[0]],d&&(d=[d[0],d[0]])),n.beginPath();const R=(i.width-16)/(a.length-1),P=a.map((C,F)=>({x:y+R*F,y:v+b-C*b}));n.moveTo(P[0].x,P[0].y);let I=0;if(P.length>2)for(I=1;I<P.length-2;I++){const C=(P[I].x+P[I+1].x)/2,F=(P[I].y+P[I+1].y)/2;n.quadraticCurveTo(P[I].x,P[I].y,C,F)}if(n.quadraticCurveTo(P[I].x,P[I].y,P[I+1].x,P[I+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(i.x+i.width-m,k),n.lineTo(i.x+m,k),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const C=n.createLinearGradient(0,v,0,v+b*1.4);C.addColorStop(0,u??r.accentColor);const[F,D,S]=so(u??r.accentColor);C.addColorStop(1,`rgba(${F}, ${D}, ${S}, 0)`),n.fillStyle=C,n.fill(),n.globalAlpha=1}if(s!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const C=Math.min(a.length-1,Math.max(0,Math.round((s-m)/R)));n.moveTo(y+C*R,i.y+1),n.lineTo(y+C*R,i.y+i.height),n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.save(),n.font=`8px ${r.fontFamily}`,n.fillStyle=r.textMedium,n.textBaseline="top",n.fillText(d[C],y,i.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function ac(e,t,n,r,i,o){if(!(r<=0||i<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,r,i);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,i/2,r/2),tr:Math.min(o.tr,i/2,r/2),bl:Math.min(o.bl,i/2,r/2),br:Math.min(o.br,i/2,r/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}const ky=e=>{const{Menu:t}=ka,{children:n,...r}=e;return f.createElement(t,{...r},n)},My=dn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Ry=dn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Iy=dn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Ey=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:s}=t.data,[a,l]=f.useState(s),[u,c]=f.useState(r??""),d=ad(),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(Iy,null,f.createElement(Xr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(My,null,f.createElement(lf,{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(Ry,null,f.createElement(ky,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(l(h.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:h.value}}))}}))},Ty={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,s=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),a=typeof s=="string"?s:s?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+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:Ey,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 Dy(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],s=i*t;return e.replace(n,`${Number(s.toPrecision(3))}${o}`)}return e}const Oy={marginRight:8},Py={display:"flex",alignItems:"center",flexGrow:1},Ly={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:s,value:a,label:l,measureLabel:u,color:c}=t.data,d=i.x+r.cellHorizontalPadding,g=i.y+i.height/2,h=s-o,p=(a-o)/h,m=`${Dy(r.baseFontStyle,.9)} ${r.fontFamily}`,v=Wl(n,m)/2;n.save();let b=0;l!==void 0&&(n.font=m,b=Ir(u??l,n,m).width+r.cellHorizontalPadding);const x=i.width-r.cellHorizontalPadding*2-b;if(x>=v){const T=n.createLinearGradient(d,g,d+x,g),k=c??r.accentColor;T.addColorStop(0,k),T.addColorStop(p,k),T.addColorStop(p,r.bgBubble),T.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=T,ac(n,d,g-v/2,x,v,v/2),n.fill(),n.beginPath(),ac(n,d+.5,g-v/2+.5,x-1,v-1,(v-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(l,i.x+i.width-r.cellHorizontalPadding,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(),s=t.step.toString(),a=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return f.createElement("label",{style:Py},f.createElement("input",{style:Oy,type:"range",value:r,min:i,max:o,step:s,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Fy=dn("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}`)}},_y=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,s=t.min instanceof Date?pl(n,t.min,o):t.min,a=t.max instanceof Date?pl(n,t.max,o):t.max,l=pl(n,t.date,o);return e.value.readonly?zt.createElement(Xr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):zt.createElement(Fy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:l,min:s,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},Ay={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Bl(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:_y}),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)}}},Hy="None";function lc(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 zy=(e,t)=>{const{cell:n,theme:r,ctx:i}=e;Bl({...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 Vy(e,t){const n=f.useCallback((i,o)=>{const{cell:s,theme:a,ctx:l,rect:u}=i,c=i.col;if(Ri(s))lc(l,u,a);else if(Kl(s)&&c<e.length){const d=e[c],g=t??Hy;["checkbox","line_chart","bar_chart","progress"].includes(d.kind)?o():zy(i,g),d.isRequired&&d.isEditable&&lc(l,u,a);return}o()},[e,t]),r=f.useMemo(()=>[xy,Ty,Ly,Ay,...Jw],[]);return{drawCell:n,customRenderers:r}}function $y(){const e=Ur();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:bi(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:bi(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:bi(e.colors.darkenedBgMix100,.9),bgHeaderHovered:bi(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(en("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${en(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${en(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:bi(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(en(e.spacing.sm)),cellVerticalPadding:Math.round(en("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:eg(e.colors.secondaryBg,.1),bubbleHeight:Math.round(en("1.25rem")),bubblePadding:Math.round(en(e.spacing.sm)),bubbleMargin:Math.round(en(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(en(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:parseInt(e.sizes.borderWidth),defaultTableHeight:Math.round(en("25rem")),minColumnWidth:Math.round(en("3.125rem")),maxColumnWidth:Math.round(en("62.5rem")),maxColumnAutoWidth:Math.round(en("31.25rem")),defaultRowHeight:Math.round(en("2.1875rem")),defaultHeaderHeight:Math.round(en("2.1875rem")),bgRowHovered:tg(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Ny=Fl.getLogger("useDataEditor");function By({columns:e,canAddRows:t,canDeleteRows:n,editingState:r,getCellContent:i,getOriginalIndex:o,refreshCells:s,updateNumRows:a,syncEditState:l,clearSelection:u}){const c=f.useCallback(([y,v],b)=>{const x=e[y];if(!x.isEditable)return;const T=x.indexNumber,k=r.current.getOriginalRowIndex(o(v)),R=i([y,v]),P=x.getCellValue(R),I=x.getCellValue(b);if(!Ri(R)&&I===P)return;const C=x.getCell(I,!0);Ri(C)?Ny.warn(`Not applying the cell edit since it causes this error:
185
+ Error: ${o}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},i=o=>{if(Ee(o))return!e.isRequired;let s=ot(o),a=!1;return t.max_chars&&s.length>t.max_chars&&(s=s.slice(0,t.max_chars),a=!0),n instanceof RegExp&&n.test(s)===!1?!1:a?s:!0};return{...e,kind:"text",sortMode:"default",typeIcon:":material/notes:",validateInput:i,getCell(o,s){if(typeof n=="string")return Et(ot(o),n);if(s){const a=i(o);if(a===!1)return Et(ot(o),"Invalid input.");typeof a=="string"&&(o=a)}try{const a=ct(o)?ot(o):null,l=ct(a)?ho(a):"";return{...r,isMissingValue:Ee(a),data:a,displayData:l}}catch(a){return Et("Incompatible value",`The value cannot be interpreted as string. Error: ${a}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}gs.isEditableType=!0;const Ju=Fn("img",{target:"e16b5pc80"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),Zw=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?Ie("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:Ie(Ju,{src:t})}):Ie(Ju,{src:t})},Qu=new Map(Object.entries({object:go,text:gs,checkbox:as,selectbox:hs,list:ds,multiselect:vf,number:fs,link:mf,datetime:ss,date:cs,time:us,line_chart:df,bar_chart:ff,area_chart:hf,image:gf,progress:bf,json:pf})),Jw=[ob,Xw],po=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),i=r.get(e),o={...i||{},...n||{}};return(i?.type_config||n?.type_config)&&(o.type_config={...i?.type_config||{},...n?.type_config||{}}),r.set(e,o),r};function Qw(e){return{changeColumnFormat:f.useCallback((n,r)=>{e(i=>po({columnId:n,columnConfigMapping:i,updatedProps:{type_config:{format:r}}}))},[e])}}function hl(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const i=r.exec(n);if(i)return i[1].trim()}function ey(e,t,n){const r={};if(!n.includes(t))return e;const i=hl(t,"color",n);i&&(r.textDark=i,(e.kind===Z.Bubble||e.kind===Z.Custom&&e.data?.kind==="multi-select-cell")&&(r.textBubble=i),e.kind===Z.Uri&&(r.linkColor=i));const o=hl(t,"background-color",n);o&&(r.bgCell=o),o==="yellow"&&i===void 0&&(r.textDark="#31333F");const s=hl(t,"font-weight",n);return s&&(r.baseFontStyle=`${s} ${Zh.sm}`),r?{...e,themeOverride:r}:e}function ty(e){return Bh(e)||Wh(e)?gs:Uh(e)?ss:Sc(e)?us:Gh(e)?cs:Yh(e)||Xh(e)?go:Cc(e)?as:jh(e)?fs:qh(e)?hs:Kh(e)?ds:go}function wf(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(r=>r!=="").join(" / "):void 0;return{title:t,group:n}}function ps(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function ny(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:i}=wf(n),o=e.columnTypes[t];let s=!0;return Nh(o)&&(s=!1),ps({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:i,isEditable:s,arrowType:o,isIndex:!0,isPinned:!0})}function ry(e,t){const n=e.columnNames.map(s=>s[t]),{title:r,group:i}=wf(n),o=e.columnTypes[t];return ps({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:o,group:i})}function yf(){return ps({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:Jh.INDEX,arrowField:new zh("",new Vh,!0),pandasType:void 0}})}function ec(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(yf()),t;for(let o=0;o<r;o++)t.push(ny(e,o));for(let o=0;o<i;o++)t.push(ry(e,o+r));return t}function iy(e,t,n,r=void 0){let i;if(e.kind==="object"||e.kind==="json")i=e.getCell(ct(t.content)?ho(vl(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&ct(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let o;Sc(t.contentType)&&ct(t.field?.type?.unit)?o=mg(t.content,t.field):o=$r.utc(Number(t.content)).toDate(),i=e.getCell(o)}else if($h(t.contentType)){const o=Ee(t.content)?null:vl(t.content,t.contentType);i=e.getCell(o)}else i=e.getCell(t.content);if(Ri(i))return i;if(!e.isEditable){if(n&&ct(n?.displayContent)){const o=ho(n.displayContent);i.kind===Z.Text?i={...i,displayData:o}:i.kind===Z.Number&&Ee(e.columnTypeOptions?.format)?i={...i,displayData:o}:i.kind===Z.Uri&&Ee(e.columnTypeOptions?.display_text)?i={...i,displayData:o}:i.kind===Z.Custom&&i.data?.kind==="date-picker-cell"&&Ee(e.columnTypeOptions?.format)&&(i={...i,data:{...i.data,displayDate:o}})}r&&n?.cssId&&(i=ey(i,n.cssId,r))}return i}function Cf(e){return e?.useStretch??!1}function Sf(e){if(e?.pixelWidth)return e.pixelWidth}function oy(e){return e?.useContent??!1}function ay(e,t){return t?!1:e?.useStretch??!1}function ly(e){return e?.useContent??!1}function sy(e){if(e?.pixelHeight)return e.pixelHeight}function gl({numRows:e,rowHeight:t,theme:n,numHeaderRows:r=1}){return e*t+r*n.defaultHeaderHeight+2*n.tableBorderWidth}const na="_index",tc="_pos:",nc={small:75,medium:200,large:400},xf=Fl.getLogger("useColumnLoader");function uy(e){if(!Ee(e)){if(typeof e=="number")return e;if(e in nc)return nc[e]}}const qo=(e,t)=>Qh(e,t,(r,i)=>{if(gc(i))return i});function rc(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(na)&&(n=qo(n,t.get(na)??{})),t.has(`${tc}${e.indexNumber}`)&&(n=qo(n,t.get(`${tc}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==na&&(n=qo(n,t.get(e.name)??{})),t.has(e.id)&&(n=qo(n,t.get(e.id)??{})),Vg(n)?e:mc({...e},{title:n.label,width:uy(n.width),isEditable:ct(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function cy(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return xf.error(t),new Map}}function ic(e){const t=e.columnTypeOptions?.type;let n;return ct(t)&&(Qu.has(t)?n=Qu.get(t):xf.warn(`Unknown column type configured in column configuration: ${t}`)),Ee(n)&&(n=ty(e.arrowType)),n}function dy(e,t,n,r,i){const o=Ur(),s=f.useMemo(()=>cy(e.columns),[e.columns]),[a,l]=f.useState(s);f.useEffect(()=>{l(s)},[s]);const u=f.useMemo(()=>Cf(i),[i]),c=f.useMemo(()=>Sf(i),[i]),d=u||ct(c)&&c>0,g=ct(e.rowHeight)&&e.rowHeight>en("4rem"),h=f.useMemo(()=>ec(t).map(m=>{let y={...m,...rc(m,a),isStretched:d};const v=ic(y);return(e.editingMode===Xt.EditingMode.READ_ONLY||n||v.isEditableType===!1)&&(y={...y,isEditable:!1}),e.editingMode!==Xt.EditingMode.READ_ONLY&&y.isEditable==!0&&(y={...y,icon:"editable"},y.isRequired&&e.editingMode===Xt.EditingMode.DYNAMIC&&(y={...y,isHidden:!1})),v(y,o)}),[t,a,d,e.editingMode,n,o]);return{columns:f.useMemo(()=>{const m=ec(t).map(x=>{let T={...x,...rc(x,a),isStretched:d,isWrappingAllowed:g};const k=ic(T);return(e.editingMode===Xt.EditingMode.READ_ONLY||n||k.isEditableType===!1)&&(T={...T,isEditable:!1}),e.editingMode!==Xt.EditingMode.READ_ONLY&&T.isEditable==!0&&(T={...T,icon:"editable"},T.isRequired&&e.editingMode===Xt.EditingMode.DYNAMIC&&(T={...T,isHidden:!1})),k(T,o)}).filter(x=>!x.isHidden),y=[],v=[];r?.length?(m.forEach(x=>{x.isIndex&&!r.includes(x.name)&&!r.includes(x.id)&&x.isPinned!==!1&&y.push(x)}),r.forEach(x=>{const T=m.find(k=>k.name===x||k.id===x);T&&(T.isPinned?y.push(T):v.push(T))})):m.forEach(x=>{x.isPinned?y.push(x):v.push(x)});const b=[...y,...v];return b.length>0?b:[go(yf())]},[t,a,g,d,n,e.editingMode,r,o]),allColumns:h,setColumnConfigMapping:l}}function fy(e,t,n,r,i,o){const s=f.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??r*2),0)>n*.6,[e,n,r]),a=t||s?0:e.filter(c=>c.isPinned).length,l=f.useCallback(c=>{o(d=>po({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!1}})),i(!0,!1)},[i,o]);return{pinColumn:f.useCallback(c=>{o(d=>po({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!0}})),i(!0,!1)},[i,o]),unpinColumn:l,freezeColumns:a}}function hy(e,t,n,r,i){return{onColumnMoved:f.useCallback((s,a)=>{const l=[...e],[u]=l.splice(s,1);l.splice(a,0,u),a<t&&!u.isPinned?n(u.id):a>=t&&u.isPinned&&r(u.id),i(l.map(c=>c.id))},[e,t,n,r,i])}}function gy(e){const[t,n]=f.useState(()=>new Map),r=f.useCallback((o,s,a,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:f.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:r}}function py(e){switch(e.kind){case Z.Number:return e.data?.toString()??"";case Z.Boolean:return e.data?.toString()??"";case Z.Markdown:case Z.RowID:case Z.Text:case Z.Uri:return e.data??"";case Z.Bubble:case Z.Image:return e.data.join("");case Z.Drilldown:return e.data.map(t=>t.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function oc(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function my(e,t){return e=oc(e),t=oc(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function vy(e,t){return e>t?1:e===t?0:-1}function by(e){const{sort:t,rows:n,getCellContent:r}=e,i=f.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),o=f.useMemo(()=>i.map(u=>{const c=e.columns.findIndex(d=>u.column===d||d.id!==void 0&&u.column.id===d.id);return c===-1?void 0:c}),[i,e.columns]),s=f.useMemo(()=>{const u=i.map((d,g)=>({sort:d,col:o[g]})).filter(d=>d.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let d=0;d<u.length;d++){const{col:g}=u[d],h=[g,0];for(let p=0;p<n;p++)h[1]=p,c[d][p]=py(r(h))}return kr(n).sort((d,g)=>{for(let h=0;h<u.length;h++){const{sort:p}=u[h],m=c[h][d],y=c[h][g];let v;if(p.mode==="raw"?v=vy(m,y):p.mode==="smart"?v=my(m,y):v=m.localeCompare(y),v!==0)return(p.direction??"asc")==="desc"&&(v=-v),v}return 0})},[r,n,i,o]),a=f.useCallback(u=>s===void 0?u:s[u],[s]),l=f.useCallback(([u,c])=>s===void 0?r([u,c]):(c=s[c],r([u,c])),[r,s]);return s===void 0?{getCellContent:e.getCellContent,getOriginalIndex:a}:{getOriginalIndex:a,getCellContent:l}}function wy(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function yy(e,t,n){const[r,i]=f.useState(),{getCellContent:o,getOriginalIndex:s}=by({columns:t.map(u=>El(u)),getCellContent:n,rows:e,sort:r}),a=f.useMemo(()=>wy(t,r),[t,r]),l=f.useCallback((u,c,d)=>{const g=a[u];let h;c==="auto"?(h="asc",r?.column.id===g.id&&(r.direction==="asc"?h="desc":h=void 0)):h=c,h===void 0||d&&h===r?.direction?i(void 0):i({column:El(g),direction:h,mode:g.sortMode})},[r,a]);return{columns:a,sortColumn:l,getOriginalIndex:s,getCellContent:o}}function Cy(e,t){const n=f.useCallback(i=>{t(o=>po({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=f.useCallback(i=>{t(o=>po({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function Sy(){return{provideEditor:f.useCallback(t=>{if(t.kind===Z.Text&&t.readonly&&Jv(t.data))return{editor:ib}},[])}}const xy={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:i,hoverAmount:o,hoverX:s}=e;let{values:a,yAxis:l,color:u,graphKind:c="area",displayValues:d,hideAxis:g}=t.data;const[h,p]=l;if(a.length===0)return!0;a=a.map(R=>Math.min(1,Math.max(0,(R-h)/(p-h))));const m=r.cellHorizontalPadding,y=m+i.x,v=i.y+3,b=i.height-6,x=i.width-m*2,T=p-h,k=p<=0?v:h>=0?v+b:v+b*(p/T);if(!g&&h<=0&&p>=0&&(n.beginPath(),n.moveTo(y,k),n.lineTo(y+x,k),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const R=2,P=(a.length-1)*R,I=(x-P)/a.length;let C=y;for(const F of a){const D=v+b-F*b;n.moveTo(C,k),n.lineTo(C+I,k),n.lineTo(C+I,D),n.lineTo(C,D),C+=I+R}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{a.length===1&&(a=[a[0],a[0]],d&&(d=[d[0],d[0]])),n.beginPath();const R=(i.width-16)/(a.length-1),P=a.map((C,F)=>({x:y+R*F,y:v+b-C*b}));n.moveTo(P[0].x,P[0].y);let I=0;if(P.length>2)for(I=1;I<P.length-2;I++){const C=(P[I].x+P[I+1].x)/2,F=(P[I].y+P[I+1].y)/2;n.quadraticCurveTo(P[I].x,P[I].y,C,F)}if(n.quadraticCurveTo(P[I].x,P[I].y,P[I+1].x,P[I+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(i.x+i.width-m,k),n.lineTo(i.x+m,k),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const C=n.createLinearGradient(0,v,0,v+b*1.4);C.addColorStop(0,u??r.accentColor);const[F,D,S]=so(u??r.accentColor);C.addColorStop(1,`rgba(${F}, ${D}, ${S}, 0)`),n.fillStyle=C,n.fill(),n.globalAlpha=1}if(s!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const C=Math.min(a.length-1,Math.max(0,Math.round((s-m)/R)));n.moveTo(y+C*R,i.y+1),n.lineTo(y+C*R,i.y+i.height),n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.save(),n.font=`8px ${r.fontFamily}`,n.fillStyle=r.textMedium,n.textBaseline="top",n.fillText(d[C],y,i.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function ac(e,t,n,r,i,o){if(!(r<=0||i<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,r,i);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,i/2,r/2),tr:Math.min(o.tr,i/2,r/2),bl:Math.min(o.bl,i/2,r/2),br:Math.min(o.br,i/2,r/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}const ky=e=>{const{Menu:t}=ka,{children:n,...r}=e;return f.createElement(t,{...r},n)},My=dn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Ry=dn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Iy=dn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Ey=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:s}=t.data,[a,l]=f.useState(s),[u,c]=f.useState(r??""),d=ad(),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(Iy,null,f.createElement(Yr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(My,null,f.createElement(lf,{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(Ry,null,f.createElement(ky,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(l(h.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:h.value}}))}}))},Ty={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,s=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),a=typeof s=="string"?s:s?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+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:Ey,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 Dy(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],s=i*t;return e.replace(n,`${Number(s.toPrecision(3))}${o}`)}return e}const Oy={marginRight:8},Py={display:"flex",alignItems:"center",flexGrow:1},Ly={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:s,value:a,label:l,measureLabel:u,color:c}=t.data,d=i.x+r.cellHorizontalPadding,g=i.y+i.height/2,h=s-o,p=(a-o)/h,m=`${Dy(r.baseFontStyle,.9)} ${r.fontFamily}`,v=Wl(n,m)/2;n.save();let b=0;l!==void 0&&(n.font=m,b=Ir(u??l,n,m).width+r.cellHorizontalPadding);const x=i.width-r.cellHorizontalPadding*2-b;if(x>=v){const T=n.createLinearGradient(d,g,d+x,g),k=c??r.accentColor;T.addColorStop(0,k),T.addColorStop(p,k),T.addColorStop(p,r.bgBubble),T.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=T,ac(n,d,g-v/2,x,v,v/2),n.fill(),n.beginPath(),ac(n,d+.5,g-v/2+.5,x-1,v-1,(v-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(l,i.x+i.width-r.cellHorizontalPadding,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(),s=t.step.toString(),a=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return f.createElement("label",{style:Py},f.createElement("input",{style:Oy,type:"range",value:r,min:i,max:o,step:s,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Fy=dn("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}`)}},_y=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,s=t.min instanceof Date?pl(n,t.min,o):t.min,a=t.max instanceof Date?pl(n,t.max,o):t.max,l=pl(n,t.date,o);return e.value.readonly?zt.createElement(Yr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):zt.createElement(Fy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:l,min:s,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},Ay={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Bl(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:_y}),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)}}},Hy="None";function lc(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 zy=(e,t)=>{const{cell:n,theme:r,ctx:i}=e;Bl({...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 Vy(e,t){const n=f.useCallback((i,o)=>{const{cell:s,theme:a,ctx:l,rect:u}=i,c=i.col;if(Ri(s))lc(l,u,a);else if(Kl(s)&&c<e.length){const d=e[c],g=t??Hy;["checkbox","line_chart","bar_chart","progress"].includes(d.kind)?o():zy(i,g),d.isRequired&&d.isEditable&&lc(l,u,a);return}o()},[e,t]),r=f.useMemo(()=>[xy,Ty,Ly,Ay,...Jw],[]);return{drawCell:n,customRenderers:r}}function $y(){const e=Ur();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:bi(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:bi(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:bi(e.colors.darkenedBgMix100,.9),bgHeaderHovered:bi(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(en("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${en(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${en(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:bi(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(en(e.spacing.sm)),cellVerticalPadding:Math.round(en("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:eg(e.colors.secondaryBg,.1),bubbleHeight:Math.round(en("1.25rem")),bubblePadding:Math.round(en(e.spacing.sm)),bubbleMargin:Math.round(en(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(en(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:parseInt(e.sizes.borderWidth),defaultTableHeight:Math.round(en("25rem")),minColumnWidth:Math.round(en("3.125rem")),maxColumnWidth:Math.round(en("62.5rem")),maxColumnAutoWidth:Math.round(en("31.25rem")),defaultRowHeight:Math.round(en("2.1875rem")),defaultHeaderHeight:Math.round(en("2.1875rem")),bgRowHovered:tg(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Ny=Fl.getLogger("useDataEditor");function By({columns:e,canAddRows:t,canDeleteRows:n,editingState:r,getCellContent:i,getOriginalIndex:o,refreshCells:s,updateNumRows:a,syncEditState:l,clearSelection:u}){const c=f.useCallback(([y,v],b)=>{const x=e[y];if(!x.isEditable)return;const T=x.indexNumber,k=r.current.getOriginalRowIndex(o(v)),R=i([y,v]),P=x.getCellValue(R),I=x.getCellValue(b);if(!Ri(R)&&I===P)return;const C=x.getCell(I,!0);Ri(C)?Ny.warn(`Not applying the cell edit since it causes this error:
186
186
  ${C.data}`):(r.current.setCell(T,k,{...C,lastUpdated:performance.now()}),l())},[e,r,o,i,l]),d=f.useCallback(()=>{if(!t)return;const y=new Map;e.forEach(v=>{y.set(v.indexNumber,v.getCell(v.defaultValue))}),r.current.addRow(y),a()},[e,r,t,a]),g=f.useCallback(()=>{t&&(d(),l())},[d,l,t]),h=f.useCallback(y=>{if(y.rows.length>0){if(!n)return!0;const v=y.rows.toArray().map(b=>r.current.getOriginalRowIndex(o(b)));return r.current.deleteRows(v),a(),u(),l(),!1}if(y.current?.range){const v=[],b=y.current.range;for(let x=b.y;x<b.y+b.height;x++)for(let T=b.x;T<b.x+b.width;T++){const k=e[T];k.isEditable&&!k.isRequired&&(v.push({cell:[T,x]}),c([T,x],k.getCell(null)))}return v.length>0&&(l(),s(v)),!1}return!0},[e,r,n,s,o,l,c,u,a]),p=f.useCallback((y,v)=>{const[b,x]=y,T=[];for(let k=0;k<v.length;k++){const R=v[k];if(k+x>=r.current.getNumRows()){if(!t)break;d()}for(let P=0;P<R.length;P++){const I=R[P],C=k+x,F=P+b;if(F>=e.length)break;const D=e[F];if(D.isEditable){const S=D.getCell(I,!0);if(ct(S)&&!Ri(S)){const E=D.indexNumber,O=r.current.getOriginalRowIndex(o(C)),M=D.getCellValue(i([F,C]));D.getCellValue(S)!==M&&(r.current.setCell(E,O,{...S,lastUpdated:performance.now()}),T.push({cell:[F,C]}))}}}T.length>0&&(l(),s(T))}return!1},[e,r,t,o,i,d,l,s]),m=f.useCallback((y,v)=>{const b=y[0];if(b>=e.length)return!0;const x=e[b];if(x.validateInput){const T=x.validateInput(x.getCellValue(v));return T===!0||T===!1?T:x.getCell(T)}return!0},[e]);return{onCellEdited:c,onPaste:p,onRowAppended:g,onDelete:h,validateCell:m}}const kf=",",no='"',Wy='"',Mf=`
187
- `,Uy="\uFEFF",Gy=new RegExp(`[${[kf,no,Mf].join("")}]`),sc=Fl.getLogger("useDataExporter");function uc(e){return e.map(t=>Xy(t)).join(kf)+Mf}function Xy(e){if(Ee(e))return"";const t=ot(e);return Gy.test(t)?`${no}${t.replace(new RegExp(no,"g"),Wy+no)}${no}`:t}async function cc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Uy));const o=n.map(s=>s.name);await e.write(i.encode(uc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(uc(a)))}await e.close()}function Yy(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Ll(()=>import("./es6.DPyfPmWm.js").then(c=>c.a),__vite__mapDeps([22,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await cc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{sc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let l="";const u=new WritableStream({write:h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await cc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Mg({enforceDownloadInNewTab:r,url:d,filename:s});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(l){sc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function jy(e,t,n,r){return{getCellContent:f.useCallback(([o,s])=>{if(o>t.length-1)return Et("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return Et("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,u=r.current.getOriginalRowIndex(s),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(l,u);if(ct(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=${l}; row=${u}`)}const d=e.getCell(u,l),g=vg(e,u,l);return iy(a,d,g,e.styler?.cssStyles)}catch(a){return Et("Error during cell creation",`This error should never happen. Please report this bug.
188
- Error: ${a}`)}},[t,n,e,r])}}function qy(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,s]=o.location;n(s)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function Ky(e,t,n,r,i){const[o,s]=f.useState({columns:Qe.empty(),rows:Qe.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(Yt.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Yt.SelectionMode.SINGLE_ROW)),l=a&&e.selectionMode.includes(Yt.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Yt.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Yt.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Yt.SelectionMode.MULTI_COLUMN),d=!t&&!n&&(e.selectionMode.includes(Yt.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(Yt.SelectionMode.MULTI_CELL)),g=d&&e.selectionMode.includes(Yt.SelectionMode.MULTI_CELL),h=o.rows.length>0,p=o.columns.length>0,m=o.current!==void 0,y=f.useCallback(b=>{const x=!qa(b.rows.toArray(),o.rows.toArray()),T=!qa(b.columns.toArray(),o.columns.toArray()),k=!qa(b.current,o.current),R=a&&x||u&&T||d&&k;let P=b;if(T&&P.columns.length>=0){let I=P.columns;r.forEach((C,F)=>{C.isIndex&&(I=I.remove(F))}),I.length<P.columns.length&&(P={...P,columns:I})}s(P),R&&i(P,d)},[o,a,u,d,i,r]),v=f.useCallback((b=!1,x=!1)=>{const T={columns:x?o.columns:Qe.empty(),rows:b?o.rows:Qe.empty(),current:void 0};s(T),(!b&&a||!x&&u||d)&&i(T,d)},[o,a,u,d,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isCellSelectionActivated:d,isMultiCellSelectionActivated:g,isRowSelected:h,isColumnSelected:p,isCellSelected:m,clearSelection:v,processSelectionChange:y}}function Zy(e,t,n,r,i,o,s,a,l,u,c){const d=e.rowHeight??t.defaultRowHeight,g=r?2:1,h=e.editingMode===Yt.EditingMode.DYNAMIC||e.editingMode===Yt.EditingMode.ADD_ONLY?1:0,p=n+h,m=gl({numRows:p,rowHeight:d,theme:t,numHeaderRows:g}),y=sy(l),v=ay(l,c),b=ly(l),x=v?Math.max(1,Math.min(n,3)):1,T=gl({numRows:x,rowHeight:d,theme:t}),k=1e4;let R=Math.max(m,T),P=Math.min(R,t.defaultTableHeight);if(v&&u&&u>0)R=Math.max(u,R);else if(b){const W=Math.ceil(k/d),j=Math.min(p,W),oe=gl({numRows:j,rowHeight:d,theme:t,numHeaderRows:g})+1;P=Math.max(oe,T),R=Math.max(P,R)}else y&&(P=Math.max(y,T),R=Math.max(P,R));o&&(P=Math.min(P,o),R=Math.min(R,o),y||(P=R));const I=t.minColumnWidth+2*t.tableBorderWidth,C=Math.max(i,I);let F,D=C;const S=Cf(a),E=Sf(a),O=oy(a);S?F=C:E?(F=Math.min(Math.max(E,I),C),D=Math.min(Math.max(E,D),C)):O&&(F=void 0);const[M,V]=f.useState({width:F||"100%",height:v?"100%":P});return f.useLayoutEffect(()=>{S&&M.width==="100%"&&V(W=>({...W,width:C}))},[C]),f.useLayoutEffect(()=>{V(W=>({...W,width:F||"100%"}))},[F]),f.useLayoutEffect(()=>{V(W=>({...W,height:v?"100%":P}))},[P,n,u,v,c]),f.useLayoutEffect(()=>{if(s){const W=S||ct(E)&&E>0;V({width:W?D:"100%",height:R})}else V({width:F||"100%",height:P})},[s]),{minHeight:T,maxHeight:R,minWidth:I,maxWidth:D,rowHeight:d,resizableSize:M,setResizableSize:V}}const Jy=600,Qy="⚠️ Please fill out this cell.";function eC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),s=f.useCallback(l=>{if(clearTimeout(o.current),o.current=0,i(void 0),(l.kind==="header"||l.kind==="cell")&&l.location){const u=l.location[0],c=l.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(l.kind==="header"&&ct(g))d=g.help;else if(l.kind==="cell"){const h=t([u,c]);Ri(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&Kl(h)?d=Qy:Kv(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},Jy))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}function Nr(e){return e.isIndex?na:Ee(e.name)?"":e.name}class Ko{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const r={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,s,a)=>{const l={};o.forEach((u,c)=>{const d=n.get(c);d&&(l[Nr(d)]=d.getCellValue(u))}),r.edited_rows[s]=l}),this.addedRows.forEach(o=>{const s={};let a=!1;o.forEach((l,u,c)=>{const d=n.get(u);if(d){const g=d.getCellValue(l);d.isRequired&&d.isEditable&&Kl(l)&&(a=!0),ct(g)&&(s[Nr(d)]=g)}}),a||r.added_rows.push(s)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,s)=>s===void 0?null:s)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),i=new Map;n.forEach(s=>{i.set(s.indexNumber,s)});const o=new Map;n.forEach(s=>{o.set(Nr(s),s)}),Object.keys(r.edited_rows).forEach(s=>{const a=Number(s),l=r.edited_rows[s];Object.keys(l).forEach(u=>{const c=l[u],d=o.get(u);if(d){const g=d.getCell(c);g&&(this.editedCells.has(a)||this.editedCells.set(a,new Map),this.editedCells.get(a)?.set(d.indexNumber,g))}})}),r.added_rows.forEach(s=>{const a=new Map;n.forEach(l=>{a.set(l.indexNumber,l.getCell(null))}),Object.keys(s).forEach(l=>{const u=s[l],c=o.get(l);if(c){const d=c.getCell(u);d&&a.set(c.indexNumber,d)}}),this.addedRows.push(a)}),this.deletedRows=r.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const r=this.editedCells.get(n);if(r!==void 0)return r.get(t)}setCell(t,n,r){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,r)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,r)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,r)=>r-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Ee(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,r)=>n-r)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let r=0;r<this.deletedRows.length&&!(this.deletedRows[r]>n);r++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}const Rf=150;function tC({element:e,widgetMgr:t,fragmentId:n,originalNumRows:r,originalColumns:i}){const{READ_ONLY:o}=Yt.EditingMode,s=f.useRef(new Ko(r)),[a,l]=f.useState(s.current.getNumRows());ng(()=>{s.current=new Ko(r),l(s.current.getNumRows())},[r]);const u=f.useCallback(()=>{s.current=new Ko(r),l(s.current.getNumRows())},[r]),c=f.useCallback(()=>{l(y=>{const v=s.current.getNumRows();return y!==v?v:y})},[]);f.useEffect(()=>{if(e.editingMode===o||!t)return;const y=t.getStringValue({id:e.id,formId:e.formId});y&&(s.current.fromJson(y,i),l(s.current.getNumRows()))},[]);const d=f.useCallback(()=>{if(!t)return;const y=s.current.toJson(i);let v=t.getStringValue({id:e.id,formId:e.formId});v===void 0&&(v=new Ko(0).toJson([])),y!==v&&t.setStringValue({id:e.id,formId:e.formId},y,{fromUi:!0},n)},[i,e.id,e.formId,t,n]),{debouncedCallback:g}=Md(d,Rf),h=f.useCallback((y,v)=>(b,x)=>{if(!t)return;const T={selection:{rows:[],columns:[],cells:[]}};if(T.selection.rows=b.rows.toArray().map(P=>v(P)),T.selection.columns=b.columns.toArray().map(P=>Nr(y[P])),x&&b.current){const{cell:P,range:I}=b.current;if(I)for(let C=I.y;C<I.y+I.height;C++)for(let F=I.x;F<I.x+I.width;F++)y[F].isIndex||T.selection.cells.push([v(C),Nr(y[F])]);else if(P){const[C,F]=P;y[C].isIndex||T.selection.cells.push([v(F),Nr(y[C])])}}const k=JSON.stringify(T),R=t.getStringValue({id:e.id,formId:e.formId});(R===void 0||R!==k)&&t.setStringValue({id:e.id,formId:e.formId},k,{fromUi:!0},n)},[e.id,e.formId,t,n]),p=f.useCallback(({columns:y,isRowSelectionActivated:v,isColumnSelectionActivated:b,isCellSelectionActivated:x,isMultiCellSelectionActivated:T})=>{if(!v&&!b&&!x||!t)return;const k=t.getStringValue({id:e.id,formId:e.formId});if(!k)return;const R=y.map(D=>Nr(D)),P=JSON.parse(k);let I=Qe.empty(),C=Qe.empty(),F;if(P.selection?.rows?.forEach(D=>{I=I.add(D)}),P.selection?.columns?.forEach(D=>{C=C.add(R.indexOf(D))}),x&&!T){const[D,S]=P.selection?.cells?.[0]??[];D!==void 0&&S!==void 0&&(F=[R.indexOf(S),D])}if(I.length>0||C.length>0||F!==void 0)return{rows:I,columns:C,current:F?{cell:F,range:{x:F[0],y:F[1],width:1,height:1},rangeStack:[]}:void 0}},[t,e.id,e.formId]),m=f.useCallback(()=>{u()},[u]);return{editingState:s,numRows:a,resetEditingState:u,updateNumRows:c,syncEditState:g,createSyncSelectionState:h,onFormCleared:m,loadInitialSelectionState:p}}const If=Fn("div",{target:"e1gsdy3y0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),xr=Fn("div",{target:"e1gsdy3y1"})(({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}}})),Ef=Fn("div",{target:"e1gsdy3y2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),nC=Fn("div",{target:"e1gsdy3y3"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS})),rC=Fn("div",{target:"e1gsdy3y4"})(({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"})),iC=Fn("div",{target:"e1gsdy3y5"})(({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"})),oC=Fn("span",{target:"e1gsdy3y6"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"})),aC=Fn("button",{target:"e1gsdy3y7"})(({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}})),dc=[{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:"}],lC={number:dc,progress:dc,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 sC({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:s}){const a=Ur(),{colors:l,fontSizes:u,radii:c,fontWeights:d}=a,g=lC[e]||[];return g.length===0?Ie(xc,{}):Ie(ya,{triggerType:kc.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:Ie(If,{role:"menu",children:g.map(h=>pn(xr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[Ie(Gn,{size:"base",iconValue:h.icon}),h.label]},h.format))}),placement:wa.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:vo(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:s})}const uC=f.memo(sC);function cC({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:s,onHideColumn:a,column:l,onChangeFormat:u,onAutosize:c}){const d=Ur(),[g,h]=f.useState(!1),{colors:p,fontSizes:m,radii:y,fontWeights:v}=d,{isCopied:b,copyToClipboard:x}=rg();f.useEffect(()=>{function R(P){P.preventDefault()}return document.addEventListener("wheel",R,{passive:!1}),document.addEventListener("touchmove",R,{passive:!1}),()=>{document.removeEventListener("wheel",R),document.removeEventListener("touchmove",R)}},[]);const T=f.useCallback(()=>{o()},[o]),k=f.useCallback(()=>{x(l.title)},[l.title,x]);return Ie(ya,{autoFocus:!0,"aria-label":"Dataframe column menu",content:pn(If,{children:[pn(nC,{children:[Ie(rC,{title:l.kind,children:Ie(Gn,{size:"base",iconValue:l.typeIcon||":material/notes:"})}),pn(iC,{title:l.title,children:[Ie(oC,{children:l.title}),Ie(aC,{onClick:k,title:"Copy column name","aria-label":"Copy column name",children:Ie(Gn,{size:"sm",iconValue:b?":material/check:":":material/content_copy:"})})]})]}),s&&pn(xc,{children:[pn(xr,{onClick:()=>{s("asc"),T()},role:"menuitem",children:[Ie(Gn,{size:"base",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),pn(xr,{onClick:()=>{s("desc"),T()},role:"menuitem",children:[Ie(Gn,{size:"base",iconValue:":material/arrow_downward:"}),"Sort descending"]}),Ie(Ef,{})]}),u&&Ie(uC,{columnKind:l.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:T,children:pn(xr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[pn("div",{children:[Ie(Gn,{size:"base",iconValue:":material/format_list_numbered:"}),"Format"]}),Ie(Gn,{size:"base",iconValue:":material/chevron_right:"})]})}),c&&pn(xr,{onClick:()=>{c(),T()},children:[Ie(Gn,{size:"base",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&pn(xr,{onClick:()=>{i(),T()},children:[Ie(Gn,{size:"base",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&pn(xr,{onClick:()=>{r(),T()},children:[Ie(Gn,{size:"base",iconValue:":material/keep:"}),"Pin column"]}),a&&pn(xr,{onClick:()=>{a(),T()},children:[Ie(Gn,{size:"base",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:wa.bottomRight,accessibilityType:Mc.menu,showArrow:!1,popoverMargin:en("0.375rem"),onClickOutside:g?void 0:T,onEsc:T,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:vo(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:Ie("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const dC=f.memo(cC),fC="(index)";function ml(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const fc=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const i=Ur();return Ie(kg,{isIndeterminate:n,checked:t,onChange:o=>{r(o.target.checked)},"aria-label":e,checkmarkType:xg.default,labelPlacement:Sg.right,overrides:{Root:{style:({$isFocusVisible:o})=>({marginBottom:i.spacing.none,marginTop:i.spacing.none,paddingLeft:i.spacing.md,paddingRight:i.spacing.md,paddingTop:i.spacing.twoXS,paddingBottom:i.spacing.twoXS,backgroundColor:o?i.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:o,$checked:s,$isIndeterminate:a})=>{const l=s||a?i.colors.primary:i.colors.borderColor;return{outline:0,width:i.sizes.checkbox,height:i.sizes.checkbox,marginTop:i.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:o&&(s||a)?i.shadows.focusRing:"",borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:i.lineHeights.small,paddingLeft:i.spacing.sm,position:"relative",color:i.colors.bodyText,fontSize:i.fontSizes.sm,fontWeight:i.fontWeights.normal}}},children:e})},hC=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:s,onClose:a})=>{const l=Ur(),u=h=>!(h.isHidden===!0||ml(h,t)),c=e.every(u),d=e.some(u)&&!c,g=h=>{e.forEach(p=>{const m=ml(p,t);h?(i(p.id),m&&n(y=>[...y,p.id])):r(p.id)})};return Ie(ya,{triggerType:kc.click,placement:wa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>pn("div",{style:{paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto"},children:[Ie(fc,{label:"Select all",isIndeterminate:d,initialValue:c,onChange:h=>{g(h)}}),Ie(Ef,{}),Ie("div",{children:e.map(h=>{const p=ml(h,t);return Ie(fc,{label:!h.title&&h.isIndex?fC: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:s,onClickOutside:a,onClick:()=>s?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:l.radii.default,borderTopRightRadius:l.radii.default,borderBottomLeftRadius:l.radii.default,borderBottomRightRadius:l.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:vo(l)?l.colors.bgColor:l.colors.secondaryBg,color:l.colors.bodyText,fontSize:l.fontSizes.sm,fontWeight:l.fontWeights.normal,minWidth:l.sizes.minMenuWidth,maxWidth:`calc(${l.sizes.minMenuWidth} * 2)`,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:Ie("div",{children:o})})},gC=f.memo(hC),hc=Fn("div",{target:"elmgoi00"})(({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 pC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),s=Ur(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,d=f.useCallback(()=>{o(!1),r()},[r,o]);return Ie(ya,{content:Ie(ig,{"data-testid":"stDataFrameTooltipContent",children:Ie(og,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:wa.top,accessibilityType:Mc.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:vo(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:Ie("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const mC=f.memo(pC),vC=15e4,bC="0.5rem";function wC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o,customToolbarActions:s,widthConfig:a,heightConfig:l}){const{expanded:u,expand:c,collapse:d,width:g,height:h}=Ps(fg),{isInHorizontalLayout:p,isInRoot:m}=Ps(ag),y=f.useRef(null),v=f.useRef(null),b=lg(),{height:x,elementRef:T}=sg(),k=$y(),{getRowThemeOverride:R,onItemHovered:P}=qy(k),{enforceDownloadInNewTab:I=!1}=f.useContext(ug),[C,F]=f.useState(!0),[D,S]=f.useState(!1),[E,O]=f.useState(!1),[M,V]=f.useState(!1),[W,j]=f.useState(),[oe,Q]=f.useState(!1),re=f.useCallback(()=>Q(He=>!He),[]),se=f.useCallback(()=>Q(!1),[]),ae=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Ee(e.editingMode)&&(e.editingMode=Yt.EditingMode.READ_ONLY);const{READ_ONLY:de,DYNAMIC:fe,ADD_ONLY:ue,DELETE_ONLY:H}=Yt.EditingMode,L=t.dimensions,Y=Math.max(0,L.numDataRows),te=Y===0&&!((e.editingMode===fe||e.editingMode===ue)&&L.numDataColumns>0),le=Y>vC,Se=!le&&!te&&e.editingMode!==fe&&e.editingMode!==ue,pe=!te&&(e.editingMode===fe||e.editingMode===ue)&&!n,et=!te&&(e.editingMode===fe||e.editingMode===H)&&!n,[ke,Dt]=f.useState(e.columnOrder);f.useEffect(()=>{Dt(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:dt,allColumns:Ue,setColumnConfigMapping:ne}=dy(e,t,n,ke,a),{editingState:ve,numRows:me,updateNumRows:he,syncEditState:Ce,createSyncSelectionState:_e,onFormCleared:Oe,loadInitialSelectionState:at}=tC({element:e,widgetMgr:r,fragmentId:o,originalNumRows:Y,originalColumns:dt}),{getCellContent:Pe}=jy(t,dt,me,ve),{columns:we,sortColumn:Ae,getOriginalIndex:Re,getCellContent:Ne}=yy(Y,dt,Pe),ft=f.useMemo(()=>_e(we,Re),[_e,we,Re]),{debouncedCallback:ht}=Md(ft,Rf),{gridSelection:Ye,isRowSelectionActivated:pt,isMultiRowSelectionActivated:Nt,isColumnSelectionActivated:St,isMultiColumnSelectionActivated:Tt,isCellSelectionActivated:Bt,isMultiCellSelectionActivated:qt,isRowSelected:an,isColumnSelected:It,isCellSelected:gt,clearSelection:Wt,processSelectionChange:wt}=Ky(e,te,n,we,ht);f.useEffect(()=>{Bt||Wt(!0,!0)},[u]);const ln=f.useCallback(He=>{v.current?.updateCells(He)},[]);f.useEffect(()=>{const He=at({columns:we,isRowSelectionActivated:pt,isColumnSelectionActivated:St,isCellSelectionActivated:Bt,isMultiCellSelectionActivated:qt});He&&wt(He)},[]);const{exportToCsv:Mn}=Yy(Ne,we,me,I),{onCellEdited:De,onPaste:mt,onRowAppended:xt,onDelete:vn,validateCell:tn}=By({columns:we,canAddRows:pe,canDeleteRows:et,editingState:ve,getCellContent:Ne,getOriginalIndex:Re,refreshCells:ln,updateNumRows:he,syncEditState:Ce,clearSelection:Wt}),nn=f.useMemo(()=>te?[0]:pe?[me]:[],[te,pe,me]),{tooltip:un,clearTooltip:$t,onItemHovered:Zt}=eC(we,Ne,nn),{drawCell:Ge,customRenderers:kt}=Vy(we,e.placeholder??void 0),{provideEditor:In}=Sy(),Ot=f.useCallback(He=>({...He,hasMenu:!te}),[te]),bt=f.useMemo(()=>we.map(He=>Ot(El(He))),[we,Ot]),{columns:bn,onColumnResize:ir}=gy(bt),Kn=t.dimensions.numHeaderRows>1,{minHeight:B,maxHeight:Be,minWidth:je,maxWidth:Pt,rowHeight:Kt,resizableSize:rn,setResizableSize:En}=Zy(e,k,me,Kn,g||0,h,u,a,l,x,m),wn=f.useCallback(([He,cn])=>({...Zv(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:k.glideTheme.textLight},span:[0,Math.max(we.length-1,0)]}),[we,k.glideTheme.textLight]),Gt=f.useCallback(()=>{Oe(),Wt()},[Oe,Wt]);gg({element:e,widgetMgr:r,onFormCleared:Gt});const{pinColumn:yn,unpinColumn:Cn,freezeColumns:jr}=fy(we,te,g||0,k.minColumnWidth,Wt,ne),{changeColumnFormat:qr}=Qw(ne),{hideColumn:Kr,showColumn:Di}=Cy(Wt,ne),{onColumnMoved:_n}=hy(we,jr,yn,Cn,Dt);f.useEffect(()=>{let He;const cn=requestAnimationFrame(()=>{He=setTimeout(()=>{if(T.current&&v.current){const Rn=T.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Rn&&(O(Rn.height>T.current.clientHeight),V(Rn.width>T.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(cn),He&&clearTimeout(He)}},[rn,me,bn,T]),f.useEffect(()=>{Ue.length==we.length&&Q(!1)},[Ue.length,we.length]);const An=!!(p||a?.useContent&&!m);return pn(hc,{className:"stDataFrame","data-testid":"stDataFrame",ref:T,isInHorizontalLayout:p,minHeight:B,disableResize:An,onPointerDown:He=>{if(T.current){const cn=T.current.getBoundingClientRect(),Rn=(b||Math.round(en(bC)))+1;M&&cn.height-Rn<He.clientY-cn.top&&He.stopPropagation(),E&&cn.width-Rn<He.clientX-cn.left&&He.stopPropagation()}},onBlur:He=>{!C&&!ae&&!He.currentTarget.contains(He.relatedTarget)&&!Bt&&Wt(!0,!0)},children:[pn(hg,{isFullScreen:u,disableFullscreenMode:i,locked:an&&!pt||gt||ae&&C||oe,onExpand:c,onCollapse:d,target:hc,children:[s?.map(He=>He),(pt&&an||St&&It||Bt&&gt)&&Ie(mi,{label:"Clear selection",icon:Cg,onClick:()=>{Wt(),$t()}}),et&&an&&Ie(mi,{label:"Delete row(s)",icon:Rg,onClick:()=>{vn&&(vn(Ye),$t())}}),pe&&!an&&Ie(mi,{label:"Add row",icon:Ic,onClick:()=>{xt&&(F(!0),xt(),$t(),v.current?.scrollTo(0,me,"vertical"))}}),!te&&Ue.length>we.length&&Ie(gC,{columns:Ue,columnOrder:ke,setColumnOrder:Dt,hideColumn:Kr,showColumn:Di,isOpen:oe,onClose:se,children:Ie(mi,{label:"Show/hide columns",icon:Tc,onClick:re})}),!le&&!te&&Ie(mi,{label:"Download as CSV",icon:Ig,onClick:Mn}),!te&&Ie(mi,{label:"Search",icon:Ec,onClick:()=>{D?S(!1):(F(!0),S(!0)),$t()}})]}),Ie(cg,{"data-testid":"stDataFrameResizable",ref:y,defaultSize:rn,style:{border:`${k.tableBorderWidth}px solid ${k.glideTheme.borderColor}`,borderRadius:`${k.tableBorderRadius}`},minHeight:B,maxHeight:Be,minWidth:je,maxWidth:An?void 0:Pt,size:rn,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!An,bottomLeft:!1,topLeft:!1},grid:[1,Kt],snapGap:Kt/3,onResizeStop:(He,cn,Rn,Oi)=>{if(y.current){const Zn=2*k.tableBorderWidth;En({width:y.current.size.width,height:Be-y.current.size.height===Zn?y.current.size.height+Zn:y.current.size.height})}},children:Ie(Gv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:v,columns:bn,rows:te?1:me,minColumnWidth:k.minColumnWidth,maxColumnWidth:k.maxColumnWidth,maxColumnAutoWidth:k.maxColumnAutoWidth,rowHeight:Kt,headerHeight:k.defaultHeaderHeight,getCellContent:te?wn:Ne,onColumnResize:ae?void 0:ir,resizeIndicator:"header",freezeColumns:jr,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:ae?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:St?void 0:_n,onItemHovered:He=>{P?.(He),Zt?.(He)},keybindings:{downFill:!0,...Bt||le?{selectAll:!1}:{}},onKeyDown:He=>{(He.ctrlKey||He.metaKey)&&He.key==="f"&&(S(cn=>!cn),He.stopPropagation(),He.preventDefault())},showSearch:D,searchResults:D?void 0:[],onSearchClose:()=>{S(!1),$t()},onHeaderClicked:(He,cn)=>{!Se||St||(D&&S(!1),pt&&an?Wt():Wt(!0,!0),Ae(He,"auto"))},gridSelection:Ye,onGridSelectionChange:He=>{(C||ae)&&(wt(He),un!==void 0&&$t(),j(void 0),Q(!1))},theme:k.glideTheme,getRowThemeOverride:R,onMouseMove:He=>{He.kind==="out-of-bounds"&&C?F(!1):He.kind!=="out-of-bounds"&&!C&&F(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:M?-b:void 0,paddingRight:E?-b:void 0},provideEditor:In,drawCell:Ge,customRenderers:kt,imageEditorOverride:Zw,headerIcons:k.headerIcons,validateCell:tn,onHeaderMenuClick:(He,cn)=>{oe||j({columnIdx:He,headerBounds:cn})},onPaste:!1,...pt&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:k.glideTheme.bgHeader,bgCellMedium:k.glideTheme.bgHeader,textMedium:k.glideTheme.textLight}},rowSelectionMode:Nt?"multi":"auto",rowSelect:n?"none":Nt?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...St&&{columnSelect:n?"none":Tt?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:Tt?"multi":"auto",rangeSelectionBlending:"additive"},...Bt&&{rangeSelect:qt?"rect":"cell",rangeSelectionBlending:"additive"},...!te&&e.editingMode!==de&&!n&&{fillHandle:!ae,onCellEdited:De,onPaste:mt,onDelete:vn},...pe&&{trailingRowOptions:{sticky:!1,tint:!0},onRowAppended:xt,onHeaderClicked:void 0},...et&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:k.glideTheme.bgHeader,bgCellMedium:k.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi"}})}),un?.content&&Ie(mC,{top:un.top,left:un.left,content:un.content,clearTooltip:$t}),W&&vc.createPortal(Ie(dC,{top:W.headerBounds.y+W.headerBounds.height,left:W.headerBounds.x+W.headerBounds.width,column:dt[W.columnIdx],onCloseMenu:()=>j(void 0),onSortColumn:Se?He=>{D&&S(!1),Wt(!(pt&&an),!0),Ae(W.columnIdx,He,!0)}:void 0,isColumnPinned:dt[W.columnIdx].isPinned,onUnpinColumn:()=>{Cn(dt[W.columnIdx].id)},onPinColumn:()=>{yn(dt[W.columnIdx].id)},onHideColumn:()=>{Kr(dt[W.columnIdx].id)},onChangeFormat:He=>{qr(dt[W.columnIdx].id,He),setTimeout(()=>{v.current?.remeasureColumns(Qe.fromSingleSelection(W.columnIdx))},100)},onAutosize:()=>{v.current?.remeasureColumns(Qe.fromSingleSelection(W.columnIdx))}}),document.querySelector("#portal"))]})}const yC=dg(wC),Tf=f.memo(yC),CC=({data:e,height:t,width:n,customToolbarActions:r})=>Ie(Tf,{element:new Yt({editingMode:Yt.EditingMode.READ_ONLY,disabled:!0,data:void 0,styler:null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:r,widthConfig:n??new Ls.WidthConfig({useStretch:!0}),heightConfig:t?new Ls.HeightConfig({pixelHeight:t}):void 0}),VC=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:CC,default:Tf},Symbol.toStringTag,{value:"Module"}));export{E0 as C,CC as R,od as T,Si as a,Xg as b,VC as c,wi as i,am as m,dn as s};
187
+ `,Uy="\uFEFF",Gy=new RegExp(`[${[kf,no,Mf].join("")}]`),sc=Fl.getLogger("useDataExporter");function uc(e){return e.map(t=>Yy(t)).join(kf)+Mf}function Yy(e){if(Ee(e))return"";const t=ot(e);return Gy.test(t)?`${no}${t.replace(new RegExp(no,"g"),Wy+no)}${no}`:t}async function cc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Uy));const o=n.map(s=>s.name);await e.write(i.encode(uc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(uc(a)))}await e.close()}function Xy(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Ll(()=>import("./es6.eb5oR8iN.js").then(c=>c.a),__vite__mapDeps([22,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await cc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{sc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let l="";const u=new WritableStream({write:h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await cc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Mg({enforceDownloadInNewTab:r,url:d,filename:s});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(l){sc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function jy(e,t,n,r){return{getCellContent:f.useCallback(([o,s])=>{if(o>t.length-1)return Et("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return Et("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,u=r.current.getOriginalRowIndex(s),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(l,u);if(ct(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=${l}; row=${u}`)}const d=e.getCell(u,l),g=vg(e,u,l);return iy(a,d,g,e.styler?.cssStyles)}catch(a){return Et("Error during cell creation",`This error should never happen. Please report this bug.
188
+ Error: ${a}`)}},[t,n,e,r])}}function qy(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,s]=o.location;n(s)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function Ky(e,t,n,r,i){const[o,s]=f.useState({columns:Qe.empty(),rows:Qe.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(Xt.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Xt.SelectionMode.SINGLE_ROW)),l=a&&e.selectionMode.includes(Xt.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Xt.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Xt.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Xt.SelectionMode.MULTI_COLUMN),d=!t&&!n&&(e.selectionMode.includes(Xt.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(Xt.SelectionMode.MULTI_CELL)),g=d&&e.selectionMode.includes(Xt.SelectionMode.MULTI_CELL),h=o.rows.length>0,p=o.columns.length>0,m=o.current!==void 0,y=f.useCallback(b=>{const x=!qa(b.rows.toArray(),o.rows.toArray()),T=!qa(b.columns.toArray(),o.columns.toArray()),k=!qa(b.current,o.current),R=a&&x||u&&T||d&&k;let P=b;if(T&&P.columns.length>=0){let I=P.columns;r.forEach((C,F)=>{C.isIndex&&(I=I.remove(F))}),I.length<P.columns.length&&(P={...P,columns:I})}s(P),R&&i(P,d)},[o,a,u,d,i,r]),v=f.useCallback((b=!1,x=!1)=>{const T={columns:x?o.columns:Qe.empty(),rows:b?o.rows:Qe.empty(),current:void 0};s(T),(!b&&a||!x&&u||d)&&i(T,d)},[o,a,u,d,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isCellSelectionActivated:d,isMultiCellSelectionActivated:g,isRowSelected:h,isColumnSelected:p,isCellSelected:m,clearSelection:v,processSelectionChange:y}}function Zy(e,t,n,r,i,o,s,a,l,u,c){const d=e.rowHeight??t.defaultRowHeight,g=r?2:1,h=e.editingMode===Xt.EditingMode.DYNAMIC||e.editingMode===Xt.EditingMode.ADD_ONLY?1:0,p=n+h,m=gl({numRows:p,rowHeight:d,theme:t,numHeaderRows:g}),y=sy(l),v=ay(l,c),b=ly(l),x=v?Math.max(1,Math.min(n,3)):1,T=gl({numRows:x,rowHeight:d,theme:t}),k=1e4;let R=Math.max(m,T),P=Math.min(R,t.defaultTableHeight);if(v&&u&&u>0)R=Math.max(u,R);else if(b){const W=Math.ceil(k/d),j=Math.min(p,W),oe=gl({numRows:j,rowHeight:d,theme:t,numHeaderRows:g})+1;P=Math.max(oe,T),R=Math.max(P,R)}else y&&(P=Math.max(y,T),R=Math.max(P,R));o&&(P=Math.min(P,o),R=Math.min(R,o),y||(P=R));const I=t.minColumnWidth+2*t.tableBorderWidth,C=Math.max(i,I);let F,D=C;const S=Cf(a),E=Sf(a),O=oy(a);S?F=C:E?(F=Math.min(Math.max(E,I),C),D=Math.min(Math.max(E,D),C)):O&&(F=void 0);const[M,V]=f.useState({width:F||"100%",height:v?"100%":P});return f.useLayoutEffect(()=>{S&&M.width==="100%"&&V(W=>({...W,width:C}))},[C]),f.useLayoutEffect(()=>{V(W=>({...W,width:F||"100%"}))},[F]),f.useLayoutEffect(()=>{V(W=>({...W,height:v?"100%":P}))},[P,n,u,v,c]),f.useLayoutEffect(()=>{if(s){const W=S||ct(E)&&E>0;V({width:W?D:"100%",height:R})}else V({width:F||"100%",height:P})},[s]),{minHeight:T,maxHeight:R,minWidth:I,maxWidth:D,rowHeight:d,resizableSize:M,setResizableSize:V}}const Jy=600,Qy="⚠️ Please fill out this cell.";function eC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),s=f.useCallback(l=>{if(clearTimeout(o.current),o.current=0,i(void 0),(l.kind==="header"||l.kind==="cell")&&l.location){const u=l.location[0],c=l.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(l.kind==="header"&&ct(g))d=g.help;else if(l.kind==="cell"){const h=t([u,c]);Ri(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&Kl(h)?d=Qy:Kv(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},Jy))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}function Nr(e){return e.isIndex?na:Ee(e.name)?"":e.name}class Ko{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const r={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,s,a)=>{const l={};o.forEach((u,c)=>{const d=n.get(c);d&&(l[Nr(d)]=d.getCellValue(u))}),r.edited_rows[s]=l}),this.addedRows.forEach(o=>{const s={};let a=!1;o.forEach((l,u,c)=>{const d=n.get(u);if(d){const g=d.getCellValue(l);d.isRequired&&d.isEditable&&Kl(l)&&(a=!0),ct(g)&&(s[Nr(d)]=g)}}),a||r.added_rows.push(s)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,s)=>s===void 0?null:s)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),i=new Map;n.forEach(s=>{i.set(s.indexNumber,s)});const o=new Map;n.forEach(s=>{o.set(Nr(s),s)}),Object.keys(r.edited_rows).forEach(s=>{const a=Number(s),l=r.edited_rows[s];Object.keys(l).forEach(u=>{const c=l[u],d=o.get(u);if(d){const g=d.getCell(c);g&&(this.editedCells.has(a)||this.editedCells.set(a,new Map),this.editedCells.get(a)?.set(d.indexNumber,g))}})}),r.added_rows.forEach(s=>{const a=new Map;n.forEach(l=>{a.set(l.indexNumber,l.getCell(null))}),Object.keys(s).forEach(l=>{const u=s[l],c=o.get(l);if(c){const d=c.getCell(u);d&&a.set(c.indexNumber,d)}}),this.addedRows.push(a)}),this.deletedRows=r.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const r=this.editedCells.get(n);if(r!==void 0)return r.get(t)}setCell(t,n,r){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,r)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,r)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,r)=>r-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Ee(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,r)=>n-r)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let r=0;r<this.deletedRows.length&&!(this.deletedRows[r]>n);r++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}const Rf=150;function tC({element:e,widgetMgr:t,fragmentId:n,originalNumRows:r,originalColumns:i}){const{READ_ONLY:o}=Xt.EditingMode,s=f.useRef(new Ko(r)),[a,l]=f.useState(s.current.getNumRows());ng(()=>{s.current=new Ko(r),l(s.current.getNumRows())},[r]);const u=f.useCallback(()=>{s.current=new Ko(r),l(s.current.getNumRows())},[r]),c=f.useCallback(()=>{l(y=>{const v=s.current.getNumRows();return y!==v?v:y})},[]);f.useEffect(()=>{if(e.editingMode===o||!t)return;const y=t.getStringValue({id:e.id,formId:e.formId});y&&(s.current.fromJson(y,i),l(s.current.getNumRows()))},[]);const d=f.useCallback(()=>{if(!t)return;const y=s.current.toJson(i);let v=t.getStringValue({id:e.id,formId:e.formId});v===void 0&&(v=new Ko(0).toJson([])),y!==v&&t.setStringValue({id:e.id,formId:e.formId},y,{fromUi:!0},n)},[i,e.id,e.formId,t,n]),{debouncedCallback:g}=Md(d,Rf),h=f.useCallback((y,v)=>(b,x)=>{if(!t)return;const T={selection:{rows:[],columns:[],cells:[]}};if(T.selection.rows=b.rows.toArray().map(P=>v(P)),T.selection.columns=b.columns.toArray().map(P=>Nr(y[P])),x&&b.current){const{cell:P,range:I}=b.current;if(I)for(let C=I.y;C<I.y+I.height;C++)for(let F=I.x;F<I.x+I.width;F++)y[F].isIndex||T.selection.cells.push([v(C),Nr(y[F])]);else if(P){const[C,F]=P;y[C].isIndex||T.selection.cells.push([v(F),Nr(y[C])])}}const k=JSON.stringify(T),R=t.getStringValue({id:e.id,formId:e.formId});(R===void 0||R!==k)&&t.setStringValue({id:e.id,formId:e.formId},k,{fromUi:!0},n)},[e.id,e.formId,t,n]),p=f.useCallback(({columns:y,isRowSelectionActivated:v,isColumnSelectionActivated:b,isCellSelectionActivated:x,isMultiCellSelectionActivated:T})=>{if(!v&&!b&&!x||!t)return;const k=t.getStringValue({id:e.id,formId:e.formId});if(!k)return;const R=y.map(D=>Nr(D)),P=JSON.parse(k);let I=Qe.empty(),C=Qe.empty(),F;if(P.selection?.rows?.forEach(D=>{I=I.add(D)}),P.selection?.columns?.forEach(D=>{C=C.add(R.indexOf(D))}),x&&!T){const[D,S]=P.selection?.cells?.[0]??[];D!==void 0&&S!==void 0&&(F=[R.indexOf(S),D])}if(I.length>0||C.length>0||F!==void 0)return{rows:I,columns:C,current:F?{cell:F,range:{x:F[0],y:F[1],width:1,height:1},rangeStack:[]}:void 0}},[t,e.id,e.formId]),m=f.useCallback(()=>{u()},[u]);return{editingState:s,numRows:a,resetEditingState:u,updateNumRows:c,syncEditState:g,createSyncSelectionState:h,onFormCleared:m,loadInitialSelectionState:p}}const If=Fn("div",{target:"e1gsdy3y0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),xr=Fn("div",{target:"e1gsdy3y1"})(({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}}})),Ef=Fn("div",{target:"e1gsdy3y2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),nC=Fn("div",{target:"e1gsdy3y3"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS})),rC=Fn("div",{target:"e1gsdy3y4"})(({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"})),iC=Fn("div",{target:"e1gsdy3y5"})(({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"})),oC=Fn("span",{target:"e1gsdy3y6"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"})),aC=Fn("button",{target:"e1gsdy3y7"})(({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}})),dc=[{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:"}],lC={number:dc,progress:dc,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 sC({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:s}){const a=Ur(),{colors:l,fontSizes:u,radii:c,fontWeights:d}=a,g=lC[e]||[];return g.length===0?Ie(xc,{}):Ie(ya,{triggerType:kc.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:Ie(If,{role:"menu",children:g.map(h=>pn(xr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[Ie(Gn,{size:"base",iconValue:h.icon}),h.label]},h.format))}),placement:wa.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:vo(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:s})}const uC=f.memo(sC);function cC({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:s,onHideColumn:a,column:l,onChangeFormat:u,onAutosize:c}){const d=Ur(),[g,h]=f.useState(!1),{colors:p,fontSizes:m,radii:y,fontWeights:v}=d,{isCopied:b,copyToClipboard:x}=rg();f.useEffect(()=>{function R(P){P.preventDefault()}return document.addEventListener("wheel",R,{passive:!1}),document.addEventListener("touchmove",R,{passive:!1}),()=>{document.removeEventListener("wheel",R),document.removeEventListener("touchmove",R)}},[]);const T=f.useCallback(()=>{o()},[o]),k=f.useCallback(()=>{x(l.title)},[l.title,x]);return Ie(ya,{autoFocus:!0,"aria-label":"Dataframe column menu",content:pn(If,{children:[pn(nC,{children:[Ie(rC,{title:l.kind,children:Ie(Gn,{size:"base",iconValue:l.typeIcon||":material/notes:"})}),pn(iC,{title:l.title,children:[Ie(oC,{children:l.title}),Ie(aC,{onClick:k,title:"Copy column name","aria-label":"Copy column name",children:Ie(Gn,{size:"sm",iconValue:b?":material/check:":":material/content_copy:"})})]})]}),s&&pn(xc,{children:[pn(xr,{onClick:()=>{s("asc"),T()},role:"menuitem",children:[Ie(Gn,{size:"base",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),pn(xr,{onClick:()=>{s("desc"),T()},role:"menuitem",children:[Ie(Gn,{size:"base",iconValue:":material/arrow_downward:"}),"Sort descending"]}),Ie(Ef,{})]}),u&&Ie(uC,{columnKind:l.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:T,children:pn(xr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[pn("div",{children:[Ie(Gn,{size:"base",iconValue:":material/format_list_numbered:"}),"Format"]}),Ie(Gn,{size:"base",iconValue:":material/chevron_right:"})]})}),c&&pn(xr,{onClick:()=>{c(),T()},children:[Ie(Gn,{size:"base",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&pn(xr,{onClick:()=>{i(),T()},children:[Ie(Gn,{size:"base",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&pn(xr,{onClick:()=>{r(),T()},children:[Ie(Gn,{size:"base",iconValue:":material/keep:"}),"Pin column"]}),a&&pn(xr,{onClick:()=>{a(),T()},children:[Ie(Gn,{size:"base",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:wa.bottomRight,accessibilityType:Mc.menu,showArrow:!1,popoverMargin:en("0.375rem"),onClickOutside:g?void 0:T,onEsc:T,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:vo(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:Ie("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const dC=f.memo(cC),fC="(index)";function ml(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const fc=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const i=Ur();return Ie(kg,{isIndeterminate:n,checked:t,onChange:o=>{r(o.target.checked)},"aria-label":e,checkmarkType:xg.default,labelPlacement:Sg.right,overrides:{Root:{style:({$isFocusVisible:o})=>({marginBottom:i.spacing.none,marginTop:i.spacing.none,paddingLeft:i.spacing.md,paddingRight:i.spacing.md,paddingTop:i.spacing.twoXS,paddingBottom:i.spacing.twoXS,backgroundColor:o?i.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:o,$checked:s,$isIndeterminate:a})=>{const l=s||a?i.colors.primary:i.colors.borderColor;return{outline:0,width:i.sizes.checkbox,height:i.sizes.checkbox,marginTop:i.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:o&&(s||a)?i.shadows.focusRing:"",borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:i.lineHeights.small,paddingLeft:i.spacing.sm,position:"relative",color:i.colors.bodyText,fontSize:i.fontSizes.sm,fontWeight:i.fontWeights.normal}}},children:e})},hC=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:s,onClose:a})=>{const l=Ur(),u=h=>!(h.isHidden===!0||ml(h,t)),c=e.every(u),d=e.some(u)&&!c,g=h=>{e.forEach(p=>{const m=ml(p,t);h?(i(p.id),m&&n(y=>[...y,p.id])):r(p.id)})};return Ie(ya,{triggerType:kc.click,placement:wa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>pn("div",{style:{paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto"},children:[Ie(fc,{label:"Select all",isIndeterminate:d,initialValue:c,onChange:h=>{g(h)}}),Ie(Ef,{}),Ie("div",{children:e.map(h=>{const p=ml(h,t);return Ie(fc,{label:!h.title&&h.isIndex?fC: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:s,onClickOutside:a,onClick:()=>s?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:l.radii.default,borderTopRightRadius:l.radii.default,borderBottomLeftRadius:l.radii.default,borderBottomRightRadius:l.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:vo(l)?l.colors.bgColor:l.colors.secondaryBg,color:l.colors.bodyText,fontSize:l.fontSizes.sm,fontWeight:l.fontWeights.normal,minWidth:l.sizes.minMenuWidth,maxWidth:`calc(${l.sizes.minMenuWidth} * 2)`,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:Ie("div",{children:o})})},gC=f.memo(hC),hc=Fn("div",{target:"elmgoi00"})(({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 pC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),s=Ur(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,d=f.useCallback(()=>{o(!1),r()},[r,o]);return Ie(ya,{content:Ie(ig,{"data-testid":"stDataFrameTooltipContent",children:Ie(og,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:wa.top,accessibilityType:Mc.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:vo(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:Ie("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const mC=f.memo(pC),vC=15e4,bC="0.5rem";function wC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o,customToolbarActions:s,widthConfig:a,heightConfig:l}){const{expanded:u,expand:c,collapse:d,width:g,height:h}=Ps(fg),{isInHorizontalLayout:p,isInRoot:m}=Ps(ag),y=f.useRef(null),v=f.useRef(null),b=lg(),{height:x,elementRef:T}=sg(),k=$y(),{getRowThemeOverride:R,onItemHovered:P}=qy(k),{enforceDownloadInNewTab:I=!1}=f.useContext(ug),[C,F]=f.useState(!0),[D,S]=f.useState(!1),[E,O]=f.useState(!1),[M,V]=f.useState(!1),[W,j]=f.useState(),[oe,Q]=f.useState(!1),re=f.useCallback(()=>Q(He=>!He),[]),se=f.useCallback(()=>Q(!1),[]),ae=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Ee(e.editingMode)&&(e.editingMode=Xt.EditingMode.READ_ONLY);const{READ_ONLY:de,DYNAMIC:fe,ADD_ONLY:ue,DELETE_ONLY:H}=Xt.EditingMode,L=t.dimensions,X=Math.max(0,L.numDataRows),te=X===0&&!((e.editingMode===fe||e.editingMode===ue)&&L.numDataColumns>0),le=X>vC,Se=!le&&!te&&e.editingMode!==fe&&e.editingMode!==ue,pe=!te&&(e.editingMode===fe||e.editingMode===ue)&&!n,et=!te&&(e.editingMode===fe||e.editingMode===H)&&!n,[ke,Dt]=f.useState(e.columnOrder);f.useEffect(()=>{Dt(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:dt,allColumns:Ue,setColumnConfigMapping:ne}=dy(e,t,n,ke,a),{editingState:ve,numRows:me,updateNumRows:he,syncEditState:Ce,createSyncSelectionState:_e,onFormCleared:Oe,loadInitialSelectionState:at}=tC({element:e,widgetMgr:r,fragmentId:o,originalNumRows:X,originalColumns:dt}),{getCellContent:Pe}=jy(t,dt,me,ve),{columns:we,sortColumn:Ae,getOriginalIndex:Re,getCellContent:Ne}=yy(X,dt,Pe),ft=f.useMemo(()=>_e(we,Re),[_e,we,Re]),{debouncedCallback:ht}=Md(ft,Rf),{gridSelection:Xe,isRowSelectionActivated:pt,isMultiRowSelectionActivated:Nt,isColumnSelectionActivated:St,isMultiColumnSelectionActivated:Tt,isCellSelectionActivated:Bt,isMultiCellSelectionActivated:qt,isRowSelected:an,isColumnSelected:It,isCellSelected:gt,clearSelection:Wt,processSelectionChange:wt}=Ky(e,te,n,we,ht);f.useEffect(()=>{Bt||Wt(!0,!0)},[u]);const ln=f.useCallback(He=>{v.current?.updateCells(He)},[]);f.useEffect(()=>{const He=at({columns:we,isRowSelectionActivated:pt,isColumnSelectionActivated:St,isCellSelectionActivated:Bt,isMultiCellSelectionActivated:qt});He&&wt(He)},[]);const{exportToCsv:Mn}=Xy(Ne,we,me,I),{onCellEdited:De,onPaste:mt,onRowAppended:xt,onDelete:vn,validateCell:tn}=By({columns:we,canAddRows:pe,canDeleteRows:et,editingState:ve,getCellContent:Ne,getOriginalIndex:Re,refreshCells:ln,updateNumRows:he,syncEditState:Ce,clearSelection:Wt}),nn=f.useMemo(()=>te?[0]:pe?[me]:[],[te,pe,me]),{tooltip:un,clearTooltip:$t,onItemHovered:Zt}=eC(we,Ne,nn),{drawCell:Ge,customRenderers:kt}=Vy(we,e.placeholder??void 0),{provideEditor:In}=Sy(),Ot=f.useCallback(He=>({...He,hasMenu:!te}),[te]),bt=f.useMemo(()=>we.map(He=>Ot(El(He))),[we,Ot]),{columns:bn,onColumnResize:ir}=gy(bt),Kn=t.dimensions.numHeaderRows>1,{minHeight:B,maxHeight:Be,minWidth:je,maxWidth:Pt,rowHeight:Kt,resizableSize:rn,setResizableSize:En}=Zy(e,k,me,Kn,g||0,h,u,a,l,x,m),wn=f.useCallback(([He,cn])=>({...Zv(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:k.glideTheme.textLight},span:[0,Math.max(we.length-1,0)]}),[we,k.glideTheme.textLight]),Gt=f.useCallback(()=>{Oe(),Wt()},[Oe,Wt]);gg({element:e,widgetMgr:r,onFormCleared:Gt});const{pinColumn:yn,unpinColumn:Cn,freezeColumns:jr}=fy(we,te,g||0,k.minColumnWidth,Wt,ne),{changeColumnFormat:qr}=Qw(ne),{hideColumn:Kr,showColumn:Di}=Cy(Wt,ne),{onColumnMoved:_n}=hy(we,jr,yn,Cn,Dt);f.useEffect(()=>{let He;const cn=requestAnimationFrame(()=>{He=setTimeout(()=>{if(T.current&&v.current){const Rn=T.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Rn&&(O(Rn.height>T.current.clientHeight),V(Rn.width>T.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(cn),He&&clearTimeout(He)}},[rn,me,bn,T]),f.useEffect(()=>{Ue.length==we.length&&Q(!1)},[Ue.length,we.length]);const An=!!(p||a?.useContent&&!m);return pn(hc,{className:"stDataFrame","data-testid":"stDataFrame",ref:T,isInHorizontalLayout:p,minHeight:B,disableResize:An,onPointerDown:He=>{if(T.current){const cn=T.current.getBoundingClientRect(),Rn=(b||Math.round(en(bC)))+1;M&&cn.height-Rn<He.clientY-cn.top&&He.stopPropagation(),E&&cn.width-Rn<He.clientX-cn.left&&He.stopPropagation()}},onBlur:He=>{!C&&!ae&&!He.currentTarget.contains(He.relatedTarget)&&!Bt&&Wt(!0,!0)},children:[pn(hg,{isFullScreen:u,disableFullscreenMode:i,locked:an&&!pt||gt||ae&&C||oe,onExpand:c,onCollapse:d,target:hc,children:[s?.map(He=>He),(pt&&an||St&&It||Bt&&gt)&&Ie(mi,{label:"Clear selection",icon:Cg,onClick:()=>{Wt(),$t()}}),et&&an&&Ie(mi,{label:"Delete row(s)",icon:Rg,onClick:()=>{vn&&(vn(Xe),$t())}}),pe&&!an&&Ie(mi,{label:"Add row",icon:Ic,onClick:()=>{xt&&(F(!0),xt(),$t(),v.current?.scrollTo(0,me,"vertical"))}}),!te&&Ue.length>we.length&&Ie(gC,{columns:Ue,columnOrder:ke,setColumnOrder:Dt,hideColumn:Kr,showColumn:Di,isOpen:oe,onClose:se,children:Ie(mi,{label:"Show/hide columns",icon:Tc,onClick:re})}),!le&&!te&&Ie(mi,{label:"Download as CSV",icon:Ig,onClick:Mn}),!te&&Ie(mi,{label:"Search",icon:Ec,onClick:()=>{D?S(!1):(F(!0),S(!0)),$t()}})]}),Ie(cg,{"data-testid":"stDataFrameResizable",ref:y,defaultSize:rn,style:{border:`${k.tableBorderWidth}px solid ${k.glideTheme.borderColor}`,borderRadius:`${k.tableBorderRadius}`},minHeight:B,maxHeight:Be,minWidth:je,maxWidth:An?void 0:Pt,size:rn,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!An,bottomLeft:!1,topLeft:!1},grid:[1,Kt],snapGap:Kt/3,onResizeStop:(He,cn,Rn,Oi)=>{if(y.current){const Zn=2*k.tableBorderWidth;En({width:y.current.size.width,height:Be-y.current.size.height===Zn?y.current.size.height+Zn:y.current.size.height})}},children:Ie(Gv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:v,columns:bn,rows:te?1:me,minColumnWidth:k.minColumnWidth,maxColumnWidth:k.maxColumnWidth,maxColumnAutoWidth:k.maxColumnAutoWidth,rowHeight:Kt,headerHeight:k.defaultHeaderHeight,getCellContent:te?wn:Ne,onColumnResize:ae?void 0:ir,resizeIndicator:"header",freezeColumns:jr,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:ae?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:St?void 0:_n,onItemHovered:He=>{P?.(He),Zt?.(He)},keybindings:{downFill:!0,...Bt||le?{selectAll:!1}:{}},onKeyDown:He=>{(He.ctrlKey||He.metaKey)&&He.key==="f"&&(S(cn=>!cn),He.stopPropagation(),He.preventDefault())},showSearch:D,searchResults:D?void 0:[],onSearchClose:()=>{S(!1),$t()},onHeaderClicked:(He,cn)=>{!Se||St||(D&&S(!1),pt&&an?Wt():Wt(!0,!0),Ae(He,"auto"))},gridSelection:Xe,onGridSelectionChange:He=>{(C||ae)&&(wt(He),un!==void 0&&$t(),j(void 0),Q(!1))},theme:k.glideTheme,getRowThemeOverride:R,onMouseMove:He=>{He.kind==="out-of-bounds"&&C?F(!1):He.kind!=="out-of-bounds"&&!C&&F(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:M?-b:void 0,paddingRight:E?-b:void 0},provideEditor:In,drawCell:Ge,customRenderers:kt,imageEditorOverride:Zw,headerIcons:k.headerIcons,validateCell:tn,onHeaderMenuClick:(He,cn)=>{oe||j({columnIdx:He,headerBounds:cn})},onPaste:!1,...pt&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:k.glideTheme.bgHeader,bgCellMedium:k.glideTheme.bgHeader,textMedium:k.glideTheme.textLight}},rowSelectionMode:Nt?"multi":"auto",rowSelect:n?"none":Nt?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...St&&{columnSelect:n?"none":Tt?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:Tt?"multi":"auto",rangeSelectionBlending:"additive"},...Bt&&{rangeSelect:qt?"rect":"cell",rangeSelectionBlending:"additive"},...!te&&e.editingMode!==de&&!n&&{fillHandle:!ae,onCellEdited:De,onPaste:mt,onDelete:vn},...pe&&{trailingRowOptions:{sticky:!1,tint:!0},onRowAppended:xt,onHeaderClicked:void 0},...et&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:k.glideTheme.bgHeader,bgCellMedium:k.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi"}})}),un?.content&&Ie(mC,{top:un.top,left:un.left,content:un.content,clearTooltip:$t}),W&&vc.createPortal(Ie(dC,{top:W.headerBounds.y+W.headerBounds.height,left:W.headerBounds.x+W.headerBounds.width,column:dt[W.columnIdx],onCloseMenu:()=>j(void 0),onSortColumn:Se?He=>{D&&S(!1),Wt(!(pt&&an),!0),Ae(W.columnIdx,He,!0)}:void 0,isColumnPinned:dt[W.columnIdx].isPinned,onUnpinColumn:()=>{Cn(dt[W.columnIdx].id)},onPinColumn:()=>{yn(dt[W.columnIdx].id)},onHideColumn:()=>{Kr(dt[W.columnIdx].id)},onChangeFormat:He=>{qr(dt[W.columnIdx].id,He),setTimeout(()=>{v.current?.remeasureColumns(Qe.fromSingleSelection(W.columnIdx))},100)},onAutosize:()=>{v.current?.remeasureColumns(Qe.fromSingleSelection(W.columnIdx))}}),document.querySelector("#portal"))]})}const yC=dg(wC),Tf=f.memo(yC),CC=({data:e,height:t,width:n,customToolbarActions:r})=>Ie(Tf,{element:new Xt({editingMode:Xt.EditingMode.READ_ONLY,disabled:!0,arrowData:null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:r,widthConfig:n??new Ls.WidthConfig({useStretch:!0}),heightConfig:t?new Ls.HeightConfig({pixelHeight:t}):void 0}),VC=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:CC,default:Tf},Symbol.toStringTag,{value:"Module"}));export{E0 as C,CC as R,od as T,Si as a,Yg as b,VC as c,wi as i,am as m,dn as s};