@stlite/desktop 0.98.1 → 0.99.0

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 (168) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/bin/dump_artifacts.js +1 -1
  3. package/build/assets/ArrowVegaLiteChart-B-Kd_jPH-Biiko0Ef.js +1 -0
  4. package/build/assets/Audio-B5gtg70U-Bh9tGjUY.js +1 -0
  5. package/build/assets/AudioInput-CgFzLi-y-C8cmY_cr.js +1 -0
  6. package/build/assets/{index-CKw_lXVb-3dsfAMaj.js → Balloons-CqQICrNd-BGoQrXhe.js} +2 -2
  7. package/build/assets/BidiComponent-CkI6DfPr-CbrqDKKX.js +2 -0
  8. package/build/assets/Button-BOmzB5Yb-Bpnf-WZl.js +1 -0
  9. package/build/assets/ButtonGroup-C5sVTynN-DPa0Tx1x.js +2 -0
  10. package/build/assets/CameraInput-C1f0GN0n-Bo12mEPo.js +1 -0
  11. package/build/assets/ChatInput-ClqoaQw2-PqG4grVV.js +1 -0
  12. package/build/assets/Checkbox-ClzElazy-D-AYf8eH.js +1 -0
  13. package/build/assets/{index-BXKF9Na4-e8_T7zol.js → ColorPicker-mCkrAGPa-CtUHNwYp.js} +3 -3
  14. package/build/assets/ComponentInstance-B_1vn-IY-BM9ElpU6.js +11 -0
  15. package/build/assets/DataFrame-CXPcdw96-Crfv7wfu.js +198 -0
  16. package/build/assets/DateInput-DzaFFasw-CiMjvLKg.js +1 -0
  17. package/build/assets/DateTimeInput-WmD8vSCU-K1wv6LRy.js +1 -0
  18. package/build/assets/{index-Dxtfs80M-s0TmhiEk.js → DeckGlJsonChart-CDmFrnUQ-CKLXTmyf.js} +217 -215
  19. package/build/assets/{index-D52Jf8Ey-SgTlRv8T.js → DownloadButton-g54AS0W2-qOKvF9wp.js} +1 -1
  20. package/build/assets/{ErrorOutline.esm-DV80JhHP-XkDmlp3T.js → ErrorOutline.esm-B1NqpuZN-D4cKYVYX.js} +1 -1
  21. package/build/assets/Feedback-DTXGrEzp-Dd_SGEH7.js +1 -0
  22. package/build/assets/{FileDownload.esm-Bg0DSX1Z-tYB-VhDd.js → FileDownload.esm-B_usFfyI-DvbGAuNe.js} +1 -1
  23. package/build/assets/FileUploader-CzCdIxed-CWWB6xZB.js +1 -0
  24. package/build/assets/FormSubmitContent-CstMuKlS-CwJlipqn.js +1 -0
  25. package/build/assets/{index-DuuHtz-x-Caurorud.js → GraphVizChart-nJ8rg3sZ-B_FsOCth.js} +2 -2
  26. package/build/assets/{index-B0C1EJi--C9vASPz3.js → Html-CkFoh4ns-BXVZGZ2C.js} +1 -1
  27. package/build/assets/IFrame-BklekJPV-_sg-kw0j.js +49 -0
  28. package/build/assets/ImageList-l3ue-eW1-CIwYKSdj.js +1 -0
  29. package/build/assets/{InputInstructions-GG_DznKT-BTS6NlIa.js → InputInstructions-C3LBp4_M-BIHPK8ho.js} +1 -1
  30. package/build/assets/Json-DmaVI2eK-CplwjZhb.js +2 -0
  31. package/build/assets/LinkButton-D87rEwzB-C31w_f7c.js +1 -0
  32. package/build/assets/MenuButton-DCWYT9Sm-Cjs_mH64.js +1 -0
  33. package/build/assets/Metric-B85kD6qx-D6Bt_A2_.js +1 -0
  34. package/build/assets/Multiselect-Dj9HMUjc-C1tpZV37.js +1 -0
  35. package/build/assets/NumberInput-Bz1Z4Olo-HwfUQwvD.js +1 -0
  36. package/build/assets/PageLink-DxIPOlCu-CAX1QvMp.js +1 -0
  37. package/build/assets/{Particles-ByFZ9kUC-B_aeMYcp.js → Particles-CgV8FzZe-CZFoM1Ot.js} +1 -1
  38. package/build/assets/{index-DlNfwH7j-Ciae2OLh.js → PlotlyChart-DApJXgoh-msWOSLU2.js} +105 -105
  39. package/build/assets/{index-CzaX93h_-B-_1QLd4.js → Progress-DXRywIcj-D00Siwwp.js} +1 -1
  40. package/build/assets/{ProgressBar-uLtuFXoi-C547ZD3U.js → ProgressBar-By08lmvS-BN2oE7g_.js} +2 -2
  41. package/build/assets/{index-C2tfS9CH-BRrFBwHT.js → Radio-DZEQy4hT-Cx0uGU2K.js} +3 -3
  42. package/build/assets/Selectbox-BywNaXj9-EovVNC_I.js +1 -0
  43. package/build/assets/Slider-sLEYxDUG-Bby7yVsF.js +2 -0
  44. package/build/assets/{index-DnMeTGk7-X2HPuQXI.js → Snow-MxXLnUX_-CCUTgEUd.js} +2 -2
  45. package/build/assets/{index-CxYiRuXO-CRK1FQiS.js → Spinner-D-YJYPV5-qoM-yuRL.js} +1 -1
  46. package/build/assets/{StreamlitSyntaxHighlighter-0BOUSobY-CgsoE1gN.js → StreamlitSyntaxHighlighter-y_BJ441X-Do55UoZC.js} +1 -1
  47. package/build/assets/Table-ah-SFAz4-BuzfN8wv.js +1 -0
  48. package/build/assets/{TableChart.esm-CoMoidiP-DrT_rrb0.js → TableChart.esm-x67iDGlj-hZSJidLi.js} +1 -1
  49. package/build/assets/TextArea-COwbG28l-yfu63ssv.js +1 -0
  50. package/build/assets/TextInput-CPqz-18c-DPGxqoCs.js +1 -0
  51. package/build/assets/TimeInput-BQ-fP8Yi-FMCqKedu.js +3 -0
  52. package/build/assets/{index-CrKJRmJv-Bg5NDALn.js → Toast-CGUHIZQI-39x9j5Rs.js} +1 -1
  53. package/build/assets/Video-CWomx7KF-nGUBPGaY.js +1 -0
  54. package/build/assets/{WidgetLabel-CoLw86qs-CNbX-e3H.js → WidgetLabel-DUaobbKW-DD-xWyXR.js} +1 -1
  55. package/build/assets/WidgetLabelHelpIcon-Dk_Qm9_8-CtMOr4fX.js +1 -0
  56. package/build/assets/WidgetLabelHelpIconInline-CkTH9muE-i_BwkvTR.js +1 -0
  57. package/build/assets/{_baseAssignValue-DQhmkaDt-Bl1quFU6.js → _baseAssignValue-DbpQ8D1L-D2c_-zPN.js} +1 -1
  58. package/build/assets/b1c37dc02f43b345-BK8hQpFn.woff2 +0 -0
  59. package/build/assets/{base-input-BdLA32iO-A9B9vy_-.js → base-input-CUlWnT-V-BhBQbzWk.js} +2 -2
  60. package/build/assets/{checkbox-DFREjf9t-Bj1xZr4O.js → checkbox-CEu7IJmq-3LmskyhR.js} +2 -2
  61. package/build/assets/{constants-Dj7RTpUo-BGkidDJo.js → constants-BFZIinC9-BhIl5GAK.js} +2 -2
  62. package/build/assets/{createDownloadLinkElement-DdPyJxB4-BwUogbJk.js → createDownloadLinkElement-CO9Q-pa0-BNUtAwjF.js} +1 -1
  63. package/build/assets/{createSuper-BZpABwIl-CzqIX_hj.js → createSuper-CPupKoXU-C5x8b8jJ.js} +1 -1
  64. package/build/assets/data-grid-overlay-editor-D7_bQukB-DqAp5wnt.js +1 -0
  65. package/build/assets/{downloader-DcCTL3Wz-BV_PV8FK.js → downloader-CZ7qD7NY-DGAnDDXL.js} +1 -1
  66. package/build/assets/{embed-DsUNNyuf-iklb31Eb.js → embed-Dc8baQ26-DAsqJZrc.js} +4 -4
  67. package/build/assets/{es6--XPcqeHG-CHWR2W_o.js → es6-BxevHr5y-DDD2E1qH.js} +2 -2
  68. package/build/assets/{formatNumber-C0_e-CAH-GlcLbdL6.js → formatNumber-DxMjoq14-D-XVTuz9.js} +1 -1
  69. package/build/assets/iconPosition-9UgvX_TD-BzkVt95G.js +1 -0
  70. package/build/assets/iframeResizer.contentWindow-CCqu70r3-2dQhJjwY.js +1 -0
  71. package/build/assets/{index-D8-_3_8b-1KPkAAUR.js → index-BV2WTlzI-BDu7x5w-.js} +1 -1
  72. package/build/assets/{index-rCmWIVzf.css → index-Bdx5V1kE.css} +1 -1
  73. package/build/assets/index-BoaYS_fk-BOYhDwkq.js +1 -0
  74. package/build/assets/{index-D84Izf2I-C_zQnNB2.js → index-CDNzkMOW-Ci5P-rfD.js} +1 -1
  75. package/build/assets/{index-DuHJMwJD-Bsr8Y8w7.js → index-CJ4tMOMA-DwN410du.js} +1 -1
  76. package/build/assets/{index-DXEnufEK-CPeh905k.js → index-Co96_X1M-Dl06Rnsd.js} +1 -1
  77. package/build/assets/index-DJf52eor.js +192 -0
  78. package/build/assets/{input-vJKt6Tqs-D1h27UxA.js → input-HUYzfsf9-BxmLV7Ek.js} +1 -1
  79. package/build/assets/{memory-B3L1Fctl-Cn5y4VWL.js → memory-C-LDMFc2-DmYLyk9H.js} +1 -1
  80. package/build/assets/{moment-CU6QKNej-DcQX_LE0.js → moment-C29_LcvN-BY3oO1nk.js} +1 -1
  81. package/build/assets/number-overlay-editor-BQXyYsVn-Dh7S4LVs.js +9 -0
  82. package/build/assets/{numbro-CBbENDeu-C6X7Pww4.js → numbro-CDdPhOTG-s-4vlRUZ.js} +1 -1
  83. package/build/assets/{pandasStylerUtils-GHHHScPD-CTKMoUtV.js → pandasStylerUtils-BVB-ECxE-CDURxvwo.js} +1 -1
  84. package/build/assets/{possibleConstructorReturn-E3G46ZYb-Lz9Rlt8w.js → possibleConstructorReturn-YeRoNy63-B2FGD3ja.js} +1 -1
  85. package/build/assets/reactJsonViewCompat-CeSrJm8p-le930912.js +13 -0
  86. package/build/assets/resolveDefaultExport-Cy5TTESD-D1yDGtVx.js +1 -0
  87. package/build/assets/{sandbox-ChAzL-i--BIq4nttm.js → sandbox-DbnteG5V-yqy_7sO8.js} +1 -1
  88. package/build/assets/select-haj_e3M_-P2nevO2w.js +11 -0
  89. package/build/assets/{sprintfjs-BB1ejNgh-D_XlFCD8.js → sprintfjs-DwuHM96D-Dbm-A0ro.js} +1 -1
  90. package/build/assets/stateful-menu-DhWFcRsJ-hkmyKt6q.js +4 -0
  91. package/build/assets/{styled-components-UJ_u5XUO-B68esmwJ.js → styled-components-BwoIjXty-eQCTyKeV.js} +1 -1
  92. package/build/assets/{styled-components-BF-9yHWP-Fq0Myn8O.js → styled-components-CRl5ROSi-CaifWlLZ.js} +1 -1
  93. package/build/assets/{styled-components-BPyosp2h-CHa8nolL.js → styled-components-CggDa8xh-DRn7YfuV.js} +1 -1
  94. package/build/assets/{threshold-eWsxmMyL-jpRnj60B.js → threshold-C_rop_uq-CSTNJaOo.js} +1 -1
  95. package/build/assets/timepicker-t1TdfIJG-CM4-XB8w.js +4 -0
  96. package/build/assets/{timer-DAAwtI0i-CB52lra-.js → timer-CuhnLtz1-DD8qTMUW.js} +1 -1
  97. package/build/assets/{toConsumableArray-fI4JT57_-CqtYDc1p.js → toConsumableArray-DtFGUM3A-BLxO6YGd.js} +1 -1
  98. package/build/assets/useBasicWidgetState-Bd8NTj87-Cqs9ZQAV.js +1 -0
  99. package/build/assets/{useIntlLocale-CYWMTZ3s-Bfz8l4j_.js → useIntlLocale-CXWYgGQX-B2q3sAu2.js} +9 -9
  100. package/build/assets/useSelectCommon-O2yZsfjb-6cuQoolB.js +1 -0
  101. package/build/assets/{useTextInputAutoExpand-DKFPNBDa-Cb0YY3m0.js → useTextInputAutoExpand-BTuNAk3V-5wcrsLsu.js} +2 -2
  102. package/build/assets/useUpdateUiValue-B574r2my-B36XHNQq.js +1 -0
  103. package/build/assets/useWaveformController-EemjKAv5-CT3VAgB8.js +1 -0
  104. package/build/assets/utils-DNbZWtPr-BHo82ec1.js +5 -0
  105. package/build/assets/{value-DwxUZIyI-CNuykc50.js → value-FXychKGJ-DfnNAqu8.js} +1 -1
  106. package/build/assets/wavesurfer.esm-BdCEnQA2-Cb5Yveqj.js +74 -0
  107. package/build/assets/withCalculatedWidth-CswVJ4Re-BeXEmgBt.js +1 -0
  108. package/build/assets/withFullScreenWrapper-CKo__VbV-B1HqecCF.js +1 -0
  109. package/build/assets/worker-DSGzx9v2-CeEZF0Hz.js +773 -0
  110. package/build/index.html +2 -2
  111. package/package.json +6 -6
  112. package/wheels/streamlit-1.56.0-cp313-none-any.whl +0 -0
  113. package/build/assets/9897c61aa169e10d-BSbTZIlv.woff2 +0 -0
  114. package/build/assets/FileHelper-6E1AHofU-qrMXF9BJ.js +0 -5
  115. package/build/assets/FormClearHelper-CbmTijuR-BhfBTvx4.js +0 -1
  116. package/build/assets/WidgetLabelHelpIcon-DGQ_r-QQ-BpBcjxpA.js +0 -1
  117. package/build/assets/WidgetLabelHelpIconInline-CBvJmNo2-CLxNkiVd.js +0 -1
  118. package/build/assets/data-grid-overlay-editor-QHhShSfm-3TuDDPoi.js +0 -1
  119. package/build/assets/iconPosition-DC20xXN5-Dq1FtUtw.js +0 -1
  120. package/build/assets/iframeResizer.contentWindow-CK2JqAeV-DqbaJEzN.js +0 -1
  121. package/build/assets/index-9BL32MjC-d0WHvbzb.js +0 -1
  122. package/build/assets/index-B4B1qPeD-B4iZ3Hle.js +0 -1
  123. package/build/assets/index-B5UL-R7r-CWJT9KeA.js +0 -1
  124. package/build/assets/index-BGnBFvx7-CovA4PPU.js +0 -1
  125. package/build/assets/index-BLF4SOe9-BATezQGi.js +0 -1
  126. package/build/assets/index-BVqn7psP-DOIOIfGO.js +0 -1
  127. package/build/assets/index-BWq44yej-BLlqoxJR.js +0 -2
  128. package/build/assets/index-BYY96E5j-Bp1H9cgU.js +0 -1
  129. package/build/assets/index-BZJBZSAA-DFqiOZai.js +0 -2
  130. package/build/assets/index-BjrlCNX2-LTYqrHHV.js +0 -1
  131. package/build/assets/index-BmK3aM70-BtZtyb9b.js +0 -2
  132. package/build/assets/index-BuOHAFyU-CgkpNrjG.js +0 -1
  133. package/build/assets/index-BwVivyUp-BMVGZ9_Q.js +0 -1
  134. package/build/assets/index-CDQEgcT1-DtNnQE5Q.js +0 -3
  135. package/build/assets/index-CSHbNsrd-CaeMETbK.js +0 -1
  136. package/build/assets/index-CStypS2h-ZcgczjKg.js +0 -1
  137. package/build/assets/index-CTUrfAxj--v8quZkn.js +0 -2
  138. package/build/assets/index-CYGEb27Q-2USI782v.js +0 -1
  139. package/build/assets/index-CZIHO3Hi-CIp8gy8I.js +0 -1
  140. package/build/assets/index-Cqst7YJT-C9v2_kdG.js +0 -1
  141. package/build/assets/index-DCNthJH_-DBm0ode_.js +0 -1
  142. package/build/assets/index-DKp3_2FO-qvF0epur.js +0 -1
  143. package/build/assets/index-Dd99Pbav-BGjrs667.js +0 -1
  144. package/build/assets/index-DegoUuPm.js +0 -171
  145. package/build/assets/index-DpazIH3n-D6BMkmZF.js +0 -1
  146. package/build/assets/index-LfSwL_C3-BhFtSxQv.js +0 -1
  147. package/build/assets/index-SfqmeEwF-Dq9F6PRu.js +0 -1
  148. package/build/assets/index-Zh4mTo6Q-BW_atvXh.js +0 -1
  149. package/build/assets/index-dDzvj0X4-DcwcRJ2U.js +0 -1
  150. package/build/assets/index-ebIdPrk5-uPj-BdYi.js +0 -1
  151. package/build/assets/index-glyZT6vh-DgW3Iulb.js +0 -11
  152. package/build/assets/index-hpzROwMA-mo9c0M0y.js +0 -1
  153. package/build/assets/index-t2JVnYeR-CxNAko6c.js +0 -198
  154. package/build/assets/main-B1Ej7gwo-CcTKNe5S.js +0 -13
  155. package/build/assets/number-overlay-editor-DJYV-edd-B_O-Ktcq.js +0 -9
  156. package/build/assets/select-Pj-68ff--fhVXPkd8.js +0 -14
  157. package/build/assets/timepicker-BJ4MpQyD-d8465QWp.js +0 -4
  158. package/build/assets/uniqueId-DvP0IaTe-DffbsNAr.js +0 -1
  159. package/build/assets/useBasicWidgetState-JbPrIror-Bu87DmaN.js +0 -1
  160. package/build/assets/useSelectCommon-DTdQ2TWs-DMezB-1T.js +0 -1
  161. package/build/assets/useUpdateUiValue-DMih0kWV-BWZ6Saew.js +0 -1
  162. package/build/assets/useWaveformController-BeUcMXLl-DLfXFMqt.js +0 -1
  163. package/build/assets/wavesurfer.esm-idh1jvYE-D4Wwdy60.js +0 -74
  164. package/build/assets/withCalculatedWidth-Du6RrD8E-CIxv0z4S.js +0 -1
  165. package/build/assets/withFullScreenWrapper-uh7txjJc-CYEgnXN4.js +0 -1
  166. package/build/assets/worker-DAN7Os1o-BP8Vk1l7.js +0 -106
  167. package/wheels/streamlit-1.55.0-cp313-none-any.whl +0 -0
  168. /package/build/assets/{index-BWXbSx5b-3ZGL6YOx.js → index-BKiUojFK-3ZGL6YOx.js} +0 -0
@@ -0,0 +1,198 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-D7_bQukB-DqAp5wnt.js","assets/index-DJf52eor.js","assets/index-Bdx5V1kE.css","assets/withFullScreenWrapper-CKo__VbV-B1HqecCF.js","assets/moment-C29_LcvN-BY3oO1nk.js","assets/pandasStylerUtils-BVB-ECxE-CDURxvwo.js","assets/numbro-CDdPhOTG-s-4vlRUZ.js","assets/_baseIndexOf-OsCSwRmV--aVpkM1d.js","assets/_baseAssignValue-DbpQ8D1L-D2c_-zPN.js","assets/index-CVld_lKx-CBWAU0gM.js","assets/reactJsonViewCompat-CeSrJm8p-le930912.js","assets/resolveDefaultExport-Cy5TTESD-D1yDGtVx.js","assets/toConsumableArray-DtFGUM3A-BLxO6YGd.js","assets/possibleConstructorReturn-YeRoNy63-B2FGD3ja.js","assets/assertThisInitialized-C1dAyb4j-CzYfxWZp.js","assets/createSuper-CPupKoXU-C5x8b8jJ.js","assets/formatNumber-DxMjoq14-D-XVTuz9.js","assets/sprintfjs-DwuHM96D-Dbm-A0ro.js","assets/formatMoment-DEtsTHwA-BeQagUzn.js","assets/createDownloadLinkElement-CO9Q-pa0-BNUtAwjF.js","assets/checkbox-CEu7IJmq-3LmskyhR.js","assets/FileDownload.esm-B_usFfyI-DvbGAuNe.js","assets/number-overlay-editor-BQXyYsVn-Dh7S4LVs.js","assets/es6-BxevHr5y-DDD2E1qH.js"])))=>i.map(i=>d[i]);
2
+ import{r as d,Q as St,ad as Dr,a_ as rl,a$ as Rs,B as Is,E as Es,_ as Fe,ac as si,V as dt,i as Se,b0 as Zd,a0 as qd,Z as ng,b1 as rg,b2 as og,b3 as as,b4 as ig,b5 as ag,b6 as lg,b7 as Qd,w as tn,N as Qr,j as fe,aj as Ta,al as Oa,b8 as Jd,b9 as Da,am as Kn,ag as sg,ak as ef,ba as tf,a6 as nf,bb as ug,z as cg,F as Au,bc as dg,G as fg,a5 as hg,R as Xt,aG as di,O as pg,L as gg,J as yo,bd as mg,aP as rf,be as vg,bf as of,bg,aD as af,ay as Co,bh as wg,bi as yg,bj as xg,x as Cn,bk as Cg,bl as kg,a9 as Sg,W as ol,bm as Mg,bn as Rg,bo as Ig,D as Eg,bp as lf,bq as Tg,aN as Og,br as Dg,aC as Pg,bs as sf,bt as Ag,bu as Lg,bv as Hg,bw as Fg,bx as zg,by as Vg,bz as $g,bA as _g,bB as Ng,X as Bg,Y as Wg,bC as jg,bD as Gg,y as Ug,bE as Xg,bF as Kg,bG as Yg,bH as Zg,bI as ur,bJ as qg,bK as Qg,bL as Jg,bM as em,bN as tm,bO as nm,bP as ia,bQ as Xo,bR as Lt,bS as kt,bT as da,bU as bn,bV as rm,bW as om,bX as im,bY as am,bZ as lm,b_ as sm,b$ as um,c0 as Gr,c1 as Lu,c2 as Hu,c3 as uf,c4 as cf,c5 as cm,c6 as ls,c7 as dm,c8 as fm,c9 as df,ca as hm,cb as pm}from"./index-DJf52eor.js";import{N as gm,G as mm}from"./withFullScreenWrapper-CKo__VbV-B1HqecCF.js";import{l as Xr}from"./moment-C29_LcvN-BY3oO1nk.js";import{v as vm,c as ss,B as Fu,f as bm,$ as wm}from"./pandasStylerUtils-BVB-ECxE-CDURxvwo.js";import{i as ym}from"./numbro-CDdPhOTG-s-4vlRUZ.js";import{f as xm,n as Pa,q as Cm,w as km,o as Sm,D as Mm,g as Rm,M as ff,X as Im,H as Em,S as Tm,a as Om,b as Dm,P as Pm,c as Am,F as hf,K as Lm,x as Hm}from"./_baseAssignValue-DbpQ8D1L-D2c_-zPN.js";import{i as il}from"./index-CVld_lKx-CBWAU0gM.js";import{O as Fm}from"./reactJsonViewCompat-CeSrJm8p-le930912.js";import{p as zm,T as vr,x as To}from"./toConsumableArray-DtFGUM3A-BLxO6YGd.js";import{d as Vm,b as $m,_ as _m}from"./possibleConstructorReturn-YeRoNy63-B2FGD3ja.js";import{i as Nm}from"./createSuper-CPupKoXU-C5x8b8jJ.js";import{p as fa}from"./formatNumber-DxMjoq14-D-XVTuz9.js";import{s as zu}from"./formatMoment-DEtsTHwA-BeQagUzn.js";import{s as Bm}from"./createDownloadLinkElement-CO9Q-pa0-BNUtAwjF.js";import{v as Wm,y as jm,T as Gm}from"./checkbox-CEu7IJmq-3LmskyhR.js";import{o as Um,i as Xm}from"./FileDownload.esm-B_usFfyI-DvbGAuNe.js";import"./_baseIndexOf-OsCSwRmV--aVpkM1d.js";import"./resolveDefaultExport-Cy5TTESD-D1yDGtVx.js";import"./assertThisInitialized-C1dAyb4j-CzYfxWZp.js";import"./sprintfjs-DwuHM96D-Dbm-A0ro.js";var Km="[object Map]",Ym="[object Set]",Zm=Object.prototype,qm=Zm.hasOwnProperty;function Qm(e){if(e==null)return!0;if(Ag(e)&&(sf(e)||typeof e=="string"||typeof e.splice=="function"||Lg(e)||Hg(e)||Fg(e)))return!e.length;var t=zg(e);if(t==Km||t==Ym)return!e.size;if(Vg(e))return!$g(e).length;for(var n in e)if(qm.call(e,n))return!1;return!0}var pf=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Es,Fe({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});pf.displayName="Add";var gf=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Es,Fe({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});gf.displayName="Search";var mf=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Es,Fe({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});mf.displayName="Visibility";var al,Vu;function Jm(){if(Vu)return al;Vu=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return al=n,al}var ll,$u;function e0(){if($u)return ll;$u=1;var e=Jm(),t=xm();function n(r,o){return r!=null&&t(r,o,e)}return ll=n,ll}var t0=e0();const n0=Dr(t0);function vf(e="This should not happen"){throw new Error(e)}function zn(e,t="Assertion failed"){if(!e)return vf(t)}function vi(e,t){return vf(t??"Hell froze over")}function r0(e,t){try{return e()}catch{return t}}const _u=Object.prototype.hasOwnProperty;function Do(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--&&Do(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(_u.call(e,n)&&++r&&!_u.call(t,n)||!(n in t)||!Do(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ha=null,Ts=void 0;var Q;(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"})(Q||(Q={}));var Nu;(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"})(Nu||(Nu={}));var pa;(function(e){e.Triangle="triangle",e.Dots="dots"})(pa||(pa={}));function Ui(e){return"width"in e&&typeof e.width=="number"}async function Bu(e){return typeof e=="object"?e:await e()}function ko(e){return!(e.kind===Q.Loading||e.kind===Q.Bubble||e.kind===Q.RowID||e.kind===Q.Protected||e.kind===Q.Drilldown)}function Ro(e){return e.kind===Wn.Marker||e.kind===Wn.NewRow}function So(e){if(!ko(e)||e.kind===Q.Image)return!1;switch(e.kind){case Q.Text:case Q.Number:case Q.Markdown:case Q.Uri:case Q.Custom:case Q.Boolean:return e.readonly!==!0;default:vi(e,"A cell was passed with an invalid kind")}}function o0(e){return n0(e,"editor")}function Os(e){return!(e.readonly??!1)}var Wn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Wn||(Wn={}));const ga={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function sl(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,o){return r[0]-o[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const o=n[n.length-1];o[1]<r[0]?n.push([...r]):o[1]<r[1]&&(o[1]=r[1])}return n}let Wu;class Xe{items;constructor(t){this.items=t}static create=t=>new Xe(sl(t));static empty=()=>Wu??(Wu=new Xe([]));static fromSingleSelection=t=>Xe.empty().add(t);static fromArray=t=>{if(t.length===0)return Xe.empty();const n=t.map(o=>[o,o+1]),r=sl(n);return new Xe(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Xe(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=sl([...this.items,n]);return new Xe(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,a]of n.entries()){const[l,s]=a;if(l<=o&&r<=s){const u=[];l<r&&u.push([l,r]),o<s&&u.push([o,s]),n.splice(i,1,...u)}}return new Xe(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var i0=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,a]=i.split("_");t[a]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},ju=i0,a0=e=>e.toUpperCase()===e,l0=e=>t=>e.indexOf(t)===-1,bf=(e,t)=>{const n={};return Object.keys(e).filter(l0(t)).forEach(r=>{n[r]=e[r]}),n};function s0(e,t,n){const r=bf(t,n);if(!e){const o=typeof rl=="function"?{default:rl}:rl;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var u0=(e,t)=>{};function c0(e){let t="";return n=>{const r=(i,a)=>{const{as:l=e,class:s=t}=i,u=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!a0(l[0])):n.propsAsIs,c=s0(u,i,["as","class"]);c.ref=a,c.className=n.atomic?ju(n.class,c.className||s):ju(c.className||s,n.class);const{vars:f}=n;if(f){const g={};for(const m in f){const y=f[m],w=y[0],v=y[1]||"",x=typeof w=="function"?w(i):w;u0(x,n.name),g[`--${m}`]=`${x}${v}`}const p=c.style||{},h=Object.keys(p);h.length>0&&h.forEach(m=>{g[m]=p[m]}),c.style=g}return e.__wyw_meta&&e!==l?(c.as=l,d.createElement(e,c)):d.createElement(l,c)},o=d.forwardRef?d.forwardRef(r):(i=>{const a=bf(i,["innerRef"]);return r(a,i.innerRef)});return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}}var dn=c0;const d0=dn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Gu={},Ko={},ul={},cl={},Uu;function f0(){return Uu||(Uu=1,(function(e){(function(t,n){n(e,St,Og())})(cl,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=h;var o=a(n),i=a(r);function a(v){return v&&v.__esModule?v:{default:v}}var l=Object.assign||function(v){for(var x=1;x<arguments.length;x++){var T=arguments[x];for(var I in T)Object.prototype.hasOwnProperty.call(T,I)&&(v[I]=T[I])}return v};function s(v,x){var T={};for(var I in v)x.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(v,I)&&(T[I]=v[I]);return T}function u(v,x){if(!(v instanceof x))throw new TypeError("Cannot call a class as a function")}var c=(function(){function v(x,T){for(var I=0;I<T.length;I++){var C=T[I];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(x,C.key,C)}}return function(x,T,I){return T&&v(x.prototype,T),I&&v(x,I),x}})();function f(v,x){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:v}function g(v,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);v.prototype=Object.create(x&&x.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(v,x):v.__proto__=x)}var p=!1;function h(v){p=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){h(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return p?v:v.capture}function y(v){if("touches"in v){var x=v.touches[0],T=x.pageX,I=x.pageY;return{x:T,y:I}}var C=v.screenX,A=v.screenY;return{x:C,y:A}}var w=(function(v){g(x,v);function x(){var T;u(this,x);for(var I=arguments.length,C=Array(I),A=0;A<I;A++)C[A]=arguments[A];var E=f(this,(T=x.__proto__||Object.getPrototypeOf(x)).call.apply(T,[this].concat(C)));return E._handleSwipeStart=E._handleSwipeStart.bind(E),E._handleSwipeMove=E._handleSwipeMove.bind(E),E._handleSwipeEnd=E._handleSwipeEnd.bind(E),E._onMouseDown=E._onMouseDown.bind(E),E._onMouseMove=E._onMouseMove.bind(E),E._onMouseUp=E._onMouseUp.bind(E),E._setSwiperRef=E._setSwiperRef.bind(E),E}return c(x,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,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(T){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(T))}},{key:"_onMouseMove",value:function(T){this.mouseDown&&this._handleSwipeMove(T)}},{key:"_onMouseUp",value:function(T){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(T)}},{key:"_handleSwipeStart",value:function(T){var I=y(T),C=I.x,A=I.y;this.moveStart={x:C,y:A},this.props.onSwipeStart(T)}},{key:"_handleSwipeMove",value:function(T){if(this.moveStart){var I=y(T),C=I.x,A=I.y,E=C-this.moveStart.x,k=A-this.moveStart.y;this.moving=!0;var P=this.props.onSwipeMove({x:E,y:k},T);P&&T.cancelable&&T.preventDefault(),this.movePosition={deltaX:E,deltaY:k}}}},{key:"_handleSwipeEnd",value:function(T){this.props.onSwipeEnd(T);var I=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-I?this.props.onSwipeLeft(1,T):this.movePosition.deltaX>I&&this.props.onSwipeRight(1,T),this.movePosition.deltaY<-I?this.props.onSwipeUp(1,T):this.movePosition.deltaY>I&&this.props.onSwipeDown(1,T)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(T){this.swiper=T,this.props.innerRef(T)}},{key:"render",value:function(){var T=this.props;T.tagName;var I=T.className,C=T.style,A=T.children;T.allowMouseEvents,T.onSwipeUp,T.onSwipeDown,T.onSwipeLeft,T.onSwipeRight,T.onSwipeStart,T.onSwipeMove,T.onSwipeEnd,T.innerRef,T.tolerance;var E=s(T,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return o.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:I,style:C},E),A)}}]),x})(n.Component);w.displayName="ReactSwipe",w.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},w.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=w})})(cl)),cl}var Xu;function wf(){return Xu||(Xu=1,(function(e){(function(t,n){n(e,f0())})(ul,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n);function o(i){return i&&i.__esModule?i:{default:i}}t.default=r.default})})(ul)),ul}var Yo={},Ku;function yf(){if(Ku)return Yo;Ku=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.default=void 0;var e=t(Mg());function t(o){return o&&o.__esModule?o:{default:o}}function n(o,i,a){return i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,e.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,a){return(0,e.default)({thumb:!o,slide:o,selected:i,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Yo.default=r,Yo}var Zo={},qo={},Yu;function h0(){if(Yu)return qo;Yu=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,r=getComputedStyle(t);return n+=parseInt(r.marginLeft)+parseInt(r.marginRight),n};return qo.outerWidth=e,qo}var Qo={},Zu;function Ds(){if(Zu)return Qo;Zu=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var e=function(t,n,r){var o=t===0?t:t+n,i=r==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+i.join(",")+")";return a+l};return Qo.default=e,Qo}var Jo={},qu;function xf(){if(qu)return Jo;qu=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var e=function(){return window};return Jo.default=e,Jo}var Qu;function Cf(){if(Qu)return Zo;Qu=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.default=void 0;var e=s(St),t=a(yf()),n=h0(),r=a(Ds()),o=a(wf()),i=a(xf());function a(E){return E&&E.__esModule?E:{default:E}}function l(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return l=function(){return E},E}function s(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var k=l();if(k&&k.has(E))return k.get(E);var P={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in E)if(Object.prototype.hasOwnProperty.call(E,R)){var M=O?Object.getOwnPropertyDescriptor(E,R):null;M&&(M.get||M.set)?Object.defineProperty(P,R,M):P[R]=E[R]}return P.default=E,k&&k.set(E,P),P}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(k){return typeof k}:u=function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},u(E)}function c(){return c=Object.assign||function(E){for(var k=1;k<arguments.length;k++){var P=arguments[k];for(var O in P)Object.prototype.hasOwnProperty.call(P,O)&&(E[O]=P[O])}return E},c.apply(this,arguments)}function f(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")}function g(E,k){for(var P=0;P<k.length;P++){var O=k[P];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(E,O.key,O)}}function p(E,k,P){return k&&g(E.prototype,k),E}function h(E,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(k&&k.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),k&&m(E,k)}function m(E,k){return m=Object.setPrototypeOf||function(P,O){return P.__proto__=O,P},m(E,k)}function y(E){var k=x();return function(){var P=T(E),O;if(k){var R=T(this).constructor;O=Reflect.construct(P,arguments,R)}else O=P.apply(this,arguments);return w(this,O)}}function w(E,k){return k&&(u(k)==="object"||typeof k=="function")?k:v(E)}function v(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function x(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function T(E){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(k){return k.__proto__||Object.getPrototypeOf(k)},T(E)}function I(E,k,P){return k in E?Object.defineProperty(E,k,{value:P,enumerable:!0,configurable:!0,writable:!0}):E[k]=P,E}var C=function(E){return E.hasOwnProperty("key")},A=(function(E){h(P,E);var k=y(P);function P(O){var R;return f(this,P),R=k.call(this,O),I(v(R),"itemsWrapperRef",void 0),I(v(R),"itemsListRef",void 0),I(v(R),"thumbsRef",void 0),I(v(R),"setItemsWrapperRef",function(M){R.itemsWrapperRef=M}),I(v(R),"setItemsListRef",function(M){R.itemsListRef=M}),I(v(R),"setThumbsRef",function(M,D){R.thumbsRef||(R.thumbsRef=[]),R.thumbsRef[D]=M}),I(v(R),"updateSizes",function(){if(!(!R.props.children||!R.itemsWrapperRef||!R.thumbsRef)){var M=e.Children.count(R.props.children),D=R.itemsWrapperRef.clientWidth,S=R.props.thumbWidth?R.props.thumbWidth:(0,n.outerWidth)(R.thumbsRef[0]),K=Math.floor(D/S),B=K<M,X=B?M-K:0;R.setState(function(ie,te){return{itemSize:S,visibleItems:K,firstItem:B?R.getFirstItem(te.selectedItem):0,lastPosition:X,showArrows:B}})}}),I(v(R),"handleClickItem",function(M,D,S){if(!C(S)||S.key==="Enter"){var K=R.props.onSelectItem;typeof K=="function"&&K(M,D)}}),I(v(R),"onSwipeStart",function(){R.setState({swiping:!0})}),I(v(R),"onSwipeEnd",function(){R.setState({swiping:!1})}),I(v(R),"onSwipeMove",function(M){var D=M.x;if(!R.state.itemSize||!R.itemsWrapperRef||!R.state.visibleItems)return!1;var S=0,K=e.Children.count(R.props.children),B=-(R.state.firstItem*100)/R.state.visibleItems,X=Math.max(K-R.state.visibleItems,0),ie=-X*100/R.state.visibleItems;B===S&&D>0&&(D=0),B===ie&&D<0&&(D=0);var te=R.itemsWrapperRef.clientWidth,q=B+100/(te/D);return R.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ge){R.itemsListRef.style[ge]=(0,r.default)(q,"%",R.props.axis)}),!0}),I(v(R),"slideRight",function(M){R.moveTo(R.state.firstItem-(typeof M=="number"?M:1))}),I(v(R),"slideLeft",function(M){R.moveTo(R.state.firstItem+(typeof M=="number"?M:1))}),I(v(R),"moveTo",function(M){M=M<0?0:M,M=M>=R.state.lastPosition?R.state.lastPosition:M,R.setState({firstItem:M})}),R.state={selectedItem:O.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},R}return p(P,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(O){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==O.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(O){var R=O;return O>=this.state.lastPosition&&(R=this.state.lastPosition),O<this.state.firstItem+this.state.visibleItems&&(R=this.state.firstItem),O<this.state.firstItem&&(R=O),R}},{key:"renderItems",value:function(){var O=this;return this.props.children.map(function(R,M){var D=t.default.ITEM(!1,M===O.state.selectedItem),S={key:M,ref:function(K){return O.setThumbsRef(K,M)},className:D,onClick:O.handleClickItem.bind(O,M,O.props.children[M]),onKeyDown:O.handleClickItem.bind(O,M,O.props.children[M]),"aria-label":"".concat(O.props.labels.item," ").concat(M+1),style:{width:O.props.thumbWidth}};return e.default.createElement("li",c({},S,{role:"button",tabIndex:0}),R)})}},{key:"render",value:function(){var O=this;if(!this.props.children)return null;var R=e.Children.count(this.props.children)>1,M=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,S={},K=-this.state.firstItem*(this.state.itemSize||0),B=(0,r.default)(K,"px",this.props.axis),X=this.props.transitionTime+"ms";return S={WebkitTransform:B,MozTransform:B,MsTransform:B,OTransform:B,transform:B,msTransform:B,WebkitTransitionDuration:X,MozTransitionDuration:X,MsTransitionDuration:X,OTransitionDuration:X,transitionDuration:X,msTransitionDuration:X},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(!M),onClick:function(){return O.slideRight()},"aria-label":this.props.labels.leftArrow}),R?e.default.createElement(o.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:S,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ie){return O.setItemsListRef(ie)},style:S},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!D),onClick:function(){return O.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),P})(e.Component);return Zo.default=A,I(A,"displayName","Thumbs"),I(A,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Zo}var ei={},Ju;function p0(){if(Ju)return ei;Ju=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.default=void 0;var e=function(){return document};return ei.default=e,ei}var Hn={},ec;function kf(){if(ec)return Hn;ec=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.setPosition=Hn.getPosition=Hn.isKeyboardEvent=Hn.defaultStatusFormatter=Hn.noop=void 0;var e=St,t=n(Ds());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Hn.noop=r;var o=function(s,u){return"".concat(s," of ").concat(u)};Hn.defaultStatusFormatter=o;var i=function(s){return s?s.hasOwnProperty("key"):!1};Hn.isKeyboardEvent=i;var a=function(s,u){if(u.infiniteLoop&&++s,s===0)return 0;var c=e.Children.count(u.children);if(u.centerMode&&u.axis==="horizontal"){var f=-s*u.centerSlidePercentage,g=c-1;return s&&(s!==g||u.infiniteLoop)?f+=(100-u.centerSlidePercentage)/2:s===g&&(f+=100-u.centerSlidePercentage),f}return-s*100};Hn.getPosition=a;var l=function(s,u){var c={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(f){c[f]=(0,t.default)(s,"%",u)}),c};return Hn.setPosition=l,Hn}var Xn={},tc;function g0(){if(tc)return Xn;tc=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.fadeAnimationHandler=Xn.slideStopSwipingHandler=Xn.slideSwipeAnimationHandler=Xn.slideAnimationHandler=void 0;var e=St,t=r(Ds()),n=kf();function r(f){return f&&f.__esModule?f:{default:f}}function o(f,g){var p=Object.keys(f);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(f);g&&(h=h.filter(function(m){return Object.getOwnPropertyDescriptor(f,m).enumerable})),p.push.apply(p,h)}return p}function i(f){for(var g=1;g<arguments.length;g++){var p=arguments[g]!=null?arguments[g]:{};g%2?o(Object(p),!0).forEach(function(h){a(f,h,p[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(p)):o(Object(p)).forEach(function(h){Object.defineProperty(f,h,Object.getOwnPropertyDescriptor(p,h))})}return f}function a(f,g,p){return g in f?Object.defineProperty(f,g,{value:p,enumerable:!0,configurable:!0,writable:!0}):f[g]=p,f}var l=function(f,g){var p={},h=g.selectedItem,m=h,y=e.Children.count(f.children)-1,w=f.infiniteLoop&&(h<0||h>y);if(w)return m<0?f.centerMode&&f.centerSlidePercentage&&f.axis==="horizontal"?p.itemListStyle=(0,n.setPosition)(-(y+2)*f.centerSlidePercentage-(100-f.centerSlidePercentage)/2,f.axis):p.itemListStyle=(0,n.setPosition)(-(y+2)*100,f.axis):m>y&&(p.itemListStyle=(0,n.setPosition)(0,f.axis)),p;var v=(0,n.getPosition)(h,f),x=(0,t.default)(v,"%",f.axis),T=f.transitionTime+"ms";return p.itemListStyle={WebkitTransform:x,msTransform:x,OTransform:x,transform:x},g.swiping||(p.itemListStyle=i(i({},p.itemListStyle),{},{WebkitTransitionDuration:T,MozTransitionDuration:T,OTransitionDuration:T,transitionDuration:T,msTransitionDuration:T})),p};Xn.slideAnimationHandler=l;var s=function(f,g,p,h){var m={},y=g.axis==="horizontal",w=e.Children.count(g.children),v=0,x=(0,n.getPosition)(p.selectedItem,g),T=g.infiniteLoop?(0,n.getPosition)(w-1,g)-100:(0,n.getPosition)(w-1,g),I=y?f.x:f.y,C=I;x===v&&I>0&&(C=0),x===T&&I<0&&(C=0);var A=x+100/(p.itemSize/C),E=Math.abs(I)>g.swipeScrollTolerance;return g.infiniteLoop&&E&&(p.selectedItem===0&&A>-100?A-=w*100:p.selectedItem===w-1&&A<-w*100&&(A+=w*100)),(!g.preventMovementUntilSwipeScrollTolerance||E||p.swipeMovementStarted)&&(p.swipeMovementStarted||h({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(A,g.axis)),E&&!p.cancelClick&&h({cancelClick:!0}),m};Xn.slideSwipeAnimationHandler=s;var u=function(f,g){var p=(0,n.getPosition)(g.selectedItem,f),h=(0,n.setPosition)(p,f.axis);return{itemListStyle:h}};Xn.slideStopSwipingHandler=u;var c=function(f,g){var p=f.transitionTime+"ms",h="ease-in-out",m={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:h,msTransitionTimingFunction:h,MozTransitionTimingFunction:h,WebkitTransitionTimingFunction:h,OTransitionTimingFunction:h};return g.swiping||(m=i(i({},m),{},{WebkitTransitionDuration:p,MozTransitionDuration:p,OTransitionDuration:p,transitionDuration:p,msTransitionDuration:p})),{slideStyle:m,selectedStyle:i(i({},m),{},{opacity:1,position:"relative"}),prevStyle:i({},m)}};return Xn.fadeAnimationHandler=c,Xn}var nc;function m0(){if(nc)return Ko;nc=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.default=void 0;var e=c(St),t=s(wf()),n=s(yf()),r=s(Cf()),o=s(p0()),i=s(xf()),a=kf(),l=g0();function s(O){return O&&O.__esModule?O:{default:O}}function u(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return u=function(){return O},O}function c(O){if(O&&O.__esModule)return O;if(O===null||f(O)!=="object"&&typeof O!="function")return{default:O};var R=u();if(R&&R.has(O))return R.get(O);var M={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in O)if(Object.prototype.hasOwnProperty.call(O,S)){var K=D?Object.getOwnPropertyDescriptor(O,S):null;K&&(K.get||K.set)?Object.defineProperty(M,S,K):M[S]=O[S]}return M.default=O,R&&R.set(O,M),M}function f(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(R){return typeof R}:f=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},f(O)}function g(){return g=Object.assign||function(O){for(var R=1;R<arguments.length;R++){var M=arguments[R];for(var D in M)Object.prototype.hasOwnProperty.call(M,D)&&(O[D]=M[D])}return O},g.apply(this,arguments)}function p(O,R){var M=Object.keys(O);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(O);R&&(D=D.filter(function(S){return Object.getOwnPropertyDescriptor(O,S).enumerable})),M.push.apply(M,D)}return M}function h(O){for(var R=1;R<arguments.length;R++){var M=arguments[R]!=null?arguments[R]:{};R%2?p(Object(M),!0).forEach(function(D){k(O,D,M[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(M)):p(Object(M)).forEach(function(D){Object.defineProperty(O,D,Object.getOwnPropertyDescriptor(M,D))})}return O}function m(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}function y(O,R){for(var M=0;M<R.length;M++){var D=R[M];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(O,D.key,D)}}function w(O,R,M){return R&&y(O.prototype,R),O}function v(O,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(R&&R.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),R&&x(O,R)}function x(O,R){return x=Object.setPrototypeOf||function(M,D){return M.__proto__=D,M},x(O,R)}function T(O){var R=A();return function(){var M=E(O),D;if(R){var S=E(this).constructor;D=Reflect.construct(M,arguments,S)}else D=M.apply(this,arguments);return I(this,D)}}function I(O,R){return R&&(f(R)==="object"||typeof R=="function")?R:C(O)}function C(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function A(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(O){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)},E(O)}function k(O,R,M){return R in O?Object.defineProperty(O,R,{value:M,enumerable:!0,configurable:!0,writable:!0}):O[R]=M,O}var P=(function(O){v(M,O);var R=T(M);function M(D){var S;m(this,M),S=R.call(this,D),k(C(S),"thumbsRef",void 0),k(C(S),"carouselWrapperRef",void 0),k(C(S),"listRef",void 0),k(C(S),"itemsRef",void 0),k(C(S),"timer",void 0),k(C(S),"animationHandler",void 0),k(C(S),"setThumbsRef",function(B){S.thumbsRef=B}),k(C(S),"setCarouselWrapperRef",function(B){S.carouselWrapperRef=B}),k(C(S),"setListRef",function(B){S.listRef=B}),k(C(S),"setItemsRef",function(B,X){S.itemsRef||(S.itemsRef=[]),S.itemsRef[X]=B}),k(C(S),"autoPlay",function(){e.Children.count(S.props.children)<=1||(S.clearAutoPlay(),S.props.autoPlay&&(S.timer=setTimeout(function(){S.increment()},S.props.interval)))}),k(C(S),"clearAutoPlay",function(){S.timer&&clearTimeout(S.timer)}),k(C(S),"resetAutoPlay",function(){S.clearAutoPlay(),S.autoPlay()}),k(C(S),"stopOnHover",function(){S.setState({isMouseEntered:!0},S.clearAutoPlay)}),k(C(S),"startOnLeave",function(){S.setState({isMouseEntered:!1},S.autoPlay)}),k(C(S),"isFocusWithinTheCarousel",function(){return S.carouselWrapperRef?!!((0,o.default)().activeElement===S.carouselWrapperRef||S.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),k(C(S),"navigateWithKeyboard",function(B){if(S.isFocusWithinTheCarousel()){var X=S.props.axis,ie=X==="horizontal",te={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},q=ie?te.ArrowRight:te.ArrowDown,ge=ie?te.ArrowLeft:te.ArrowUp;q===B.keyCode?S.increment():ge===B.keyCode&&S.decrement()}}),k(C(S),"updateSizes",function(){if(!(!S.state.initialized||!S.itemsRef||S.itemsRef.length===0)){var B=S.props.axis==="horizontal",X=S.itemsRef[0];if(X){var ie=B?X.clientWidth:X.clientHeight;S.setState({itemSize:ie}),S.thumbsRef&&S.thumbsRef.updateSizes()}}}),k(C(S),"setMountState",function(){S.setState({hasMount:!0}),S.updateSizes()}),k(C(S),"handleClickItem",function(B,X){if(e.Children.count(S.props.children)!==0){if(S.state.cancelClick){S.setState({cancelClick:!1});return}S.props.onClickItem(B,X),B!==S.state.selectedItem&&S.setState({selectedItem:B})}}),k(C(S),"handleOnChange",function(B,X){e.Children.count(S.props.children)<=1||S.props.onChange(B,X)}),k(C(S),"handleClickThumb",function(B,X){S.props.onClickThumb(B,X),S.moveTo(B)}),k(C(S),"onSwipeStart",function(B){S.setState({swiping:!0}),S.props.onSwipeStart(B)}),k(C(S),"onSwipeEnd",function(B){S.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),S.props.onSwipeEnd(B),S.clearAutoPlay(),S.state.autoPlay&&S.autoPlay()}),k(C(S),"onSwipeMove",function(B,X){S.props.onSwipeMove(X);var ie=S.props.swipeAnimationHandler(B,S.props,S.state,S.setState.bind(C(S)));return S.setState(h({},ie)),!!Object.keys(ie).length}),k(C(S),"decrement",function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;S.moveTo(S.state.selectedItem-(typeof B=="number"?B:1))}),k(C(S),"increment",function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;S.moveTo(S.state.selectedItem+(typeof B=="number"?B:1))}),k(C(S),"moveTo",function(B){if(typeof B=="number"){var X=e.Children.count(S.props.children)-1;B<0&&(B=S.props.infiniteLoop?X:0),B>X&&(B=S.props.infiniteLoop?0:X),S.selectItem({selectedItem:B}),S.state.autoPlay&&S.state.isMouseEntered===!1&&S.resetAutoPlay()}}),k(C(S),"onClickNext",function(){S.increment(1)}),k(C(S),"onClickPrev",function(){S.decrement(1)}),k(C(S),"onSwipeForward",function(){S.increment(1),S.props.emulateTouch&&S.setState({cancelClick:!0})}),k(C(S),"onSwipeBackwards",function(){S.decrement(1),S.props.emulateTouch&&S.setState({cancelClick:!0})}),k(C(S),"changeItem",function(B){return function(X){(!(0,a.isKeyboardEvent)(X)||X.key==="Enter")&&S.moveTo(B)}}),k(C(S),"selectItem",function(B){S.setState(h({previousItem:S.state.selectedItem},B),function(){S.setState(S.animationHandler(S.props,S.state))}),S.handleOnChange(B.selectedItem,e.Children.toArray(S.props.children)[B.selectedItem])}),k(C(S),"getInitialImage",function(){var B=S.props.selectedItem,X=S.itemsRef&&S.itemsRef[B],ie=X&&X.getElementsByTagName("img")||[];return ie[0]}),k(C(S),"getVariableItemHeight",function(B){var X=S.itemsRef&&S.itemsRef[B];if(S.state.hasMount&&X&&X.children.length){var ie=X.children[0].getElementsByTagName("img")||[];if(ie.length>0){var te=ie[0];if(!te.complete){var q=function ce(){S.forceUpdate(),te.removeEventListener("load",ce)};te.addEventListener("load",q)}}var ge=ie[0]||X.children[0],se=ge.clientHeight;return se>0?se:null}return null});var K={initialized:!1,previousItem:D.selectedItem,selectedItem:D.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:D.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return S.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,S.state=h(h({},K),S.animationHandler(D,K)),S}return w(M,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,S){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),S.swiping&&!this.state.swiping&&this.setState(h({},this.props.stopSwipingHandler(this.props,this.state))),(D.selectedItem!==this.props.selectedItem||D.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),D.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var D=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var S=D.getInitialImage();S&&!S.complete?S.addEventListener("load",D.setMountState):D.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.addEventListener("mouseenter",this.stopOnHover),D.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var D=this.carouselWrapperRef;this.props.stopOnHover&&D&&(D.removeEventListener("mouseenter",this.stopOnHover),D.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var D=this.getInitialImage();D&&D.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var D;(D=this.carouselWrapperRef)===null||D===void 0||D.focus()}},{key:"renderItems",value:function(D){var S=this;return this.props.children?e.Children.map(this.props.children,function(K,B){var X=B===S.state.selectedItem,ie=B===S.state.previousItem,te=X&&S.state.selectedStyle||ie&&S.state.prevStyle||S.state.slideStyle||{};S.props.centerMode&&S.props.axis==="horizontal"&&(te=h(h({},te),{},{minWidth:S.props.centerSlidePercentage+"%"})),S.state.swiping&&S.state.swipeMovementStarted&&(te=h(h({},te),{},{pointerEvents:"none"}));var q={ref:function(ge){return S.setItemsRef(ge,B)},key:"itemKey"+B+(D?"clone":""),className:n.default.ITEM(!0,B===S.state.selectedItem,B===S.state.previousItem),onClick:S.handleClickItem.bind(S,B,K),style:te};return e.default.createElement("li",q,S.props.renderItem(K,{isSelected:B===S.state.selectedItem,isPrevious:B===S.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,S=this.props,K=S.showIndicators,B=S.labels,X=S.renderIndicator,ie=S.children;return K?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ie,function(te,q){return X&&X(D.changeItem(q),q===D.state.selectedItem,q,B.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var D=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var S=this.props.swipeable&&e.Children.count(this.props.children)>1,K=this.props.axis==="horizontal",B=this.props.showArrows&&e.Children.count(this.props.children)>1,X=B&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ie=B&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,te=this.renderItems(!0),q=te.shift(),ge=te.pop(),se={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},ce={};if(K){if(se.onSwipeLeft=this.onSwipeForward,se.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var pe=this.getVariableItemHeight(this.state.selectedItem);ce.height=pe||"auto"}}else se.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,se.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,se.style=h(h({},se.style),{},{height:this.state.itemSize}),ce.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,X,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:ce},S?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},se,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ge,this.renderItems(),this.props.infiniteLoop&&q):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(ue){return D.setListRef(ue)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ge,this.renderItems(),this.props.infiniteLoop&&q)),this.props.renderArrowNext(this.onClickNext,ie,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),M})(e.default.Component);return Ko.default=P,k(P,"displayName","Carousel"),k(P,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(O,R,M){return e.default.createElement("button",{type:"button","aria-label":M,className:n.default.ARROW_PREV(!R),onClick:O})},renderArrowNext:function(O,R,M){return e.default.createElement("button",{type:"button","aria-label":M,className:n.default.ARROW_NEXT(!R),onClick:O})},renderIndicator:function(O,R,M,D){return e.default.createElement("li",{className:n.default.DOT(R),onClick:O,onKeyDown:O,value:M,key:M,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(M+1)})},renderItem:function(O){return O},renderThumbs:function(O){var R=e.Children.map(O,function(M){var D=M;if(M.type!=="img"&&(D=e.Children.toArray(M.props.children).find(function(S){return S.type==="img"})),!!D)return D});return R.filter(function(M){return M}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):R},statusFormatter:a.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),Ko}var v0={};function b0(){return v0}var rc;function w0(){return rc||(rc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(m0()),n=b0(),r=o(Cf());function o(i){return i&&i.__esModule?i:{default:i}}})(Gu)),Gu}var y0=w0(),dl,oc;function x0(){if(oc)return dl;oc=1;var e=km(),t=function(){return e.Date.now()};return dl=t,dl}var fl,ic;function C0(){if(ic)return fl;ic=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return fl=t,fl}var hl,ac;function k0(){if(ac)return hl;ac=1;var e=C0(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return hl=n,hl}var pl,lc;function Ps(){if(lc)return pl;lc=1;var e=k0(),t=Pa(),n=Sm(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt;function s(u){if(typeof u=="number")return u;if(n(u))return r;if(t(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=t(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=e(u);var f=i.test(u);return f||a.test(u)?l(u.slice(2),f?2:8):o.test(u)?r:+u}return pl=s,pl}var gl,sc;function Sf(){if(sc)return gl;sc=1;var e=Pa(),t=x0(),n=Ps(),r="Expected a function",o=Math.max,i=Math.min;function a(l,s,u){var c,f,g,p,h,m,y=0,w=!1,v=!1,x=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(u)&&(w=!!u.leading,v="maxWait"in u,g=v?o(n(u.maxWait)||0,s):g,x="trailing"in u?!!u.trailing:x);function T(M){var D=c,S=f;return c=f=void 0,y=M,p=l.apply(S,D),p}function I(M){return y=M,h=setTimeout(E,s),w?T(M):p}function C(M){var D=M-m,S=M-y,K=s-D;return v?i(K,g-S):K}function A(M){var D=M-m,S=M-y;return m===void 0||D>=s||D<0||v&&S>=g}function E(){var M=t();if(A(M))return k(M);h=setTimeout(E,C(M))}function k(M){return h=void 0,x&&c?T(M):(c=f=void 0,p)}function P(){h!==void 0&&clearTimeout(h),y=0,c=m=f=h=void 0}function O(){return h===void 0?p:k(t())}function R(){var M=t(),D=A(M);if(c=arguments,f=this,m=M,D){if(h===void 0)return I(m);if(v)return clearTimeout(h),h=setTimeout(E,s),T(m)}return h===void 0&&(h=setTimeout(E,s)),p}return R.cancel=P,R.flush=O,R}return gl=a,gl}var S0=Sf();const Mf=Dr(S0);function xn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{i.current?.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:o}),()=>{a.removeEventListener(e,l,{capture:o})}},[e,n,r,o])}function Rr(e,t){return e===void 0?void 0:t}const M0=Math.PI;function uc(e){return e*M0/180}const Rf=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),If=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Ef=(e,t,n)=>Math.min(e,t-n*2),Tf=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,As=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},R0=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function I0(e,t,n){const[r,o]=d.useState(e),i=d.useRef(!0);d.useEffect(()=>()=>{i.current=!1},[]);const a=d.useRef(Mf(l=>{i.current&&o(l)},n));return d.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),r}const E0="֑-߿יִ-﷽ﹰ-ﻼ",T0="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",O0=new RegExp("^[^"+T0+"]*["+E0+"]");function Ls(e){return O0.test(e)?"rtl":"not-rtl"}let Xi;function us(){if(typeof document>"u")return 0;if(Xi!==void 0)return Xi;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Xi=n-r,Xi}const Ur=Symbol();function D0(e){const t=d.useRef([Ur,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(l=>{const s=t.current[0];s!==Ur&&(l=typeof l=="function"?l(s):l,l===s)||(s!==Ur&&o({}),r(u=>typeof l=="function"?l(s===Ur?u:s):l),t.current[0]=Ur)},[]),a=d.useCallback(()=>{t.current[0]=Ur,o({})},[]);return[t.current[0]===Ur?n:t.current[0],i,a]}function Of(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 P0(e){const t=d.useRef(e);return Do(e,t.current)||(t.current=e),t.current}const A0=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(l=>l!=="");if(i.length===0)return null;const a=i.length>1;return d.createElement(d0,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(y0.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},i.map(l=>{const s=o?.(l)??d.createElement("img",{draggable:!1,src:l});return d.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(As,null)))};function Hs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Jr=Hs();function Df(e){Jr=e}const Pf=/[&<>"']/,L0=new RegExp(Pf.source,"g"),Af=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,H0=new RegExp(Af.source,"g"),F0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},cc=e=>F0[e];function Fn(e,t){if(t){if(Pf.test(e))return e.replace(L0,cc)}else if(Af.test(e))return e.replace(H0,cc);return e}const z0=/(^|[^\[])\^/g;function Dt(e,t){let n=typeof e=="string"?e:e.source;t=t||"";const r={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(z0,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}function dc(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const fi={exec:()=>null};function fc(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let s=!1,u=a;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function ti(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function V0(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function hc(e,t,n,r){const o=t.href,i=t.title?Fn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:o,title:i,text:Fn(a)}}function $0(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
3
+ `).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[a]=i;return a.length>=r.length?o.slice(r.length):o}).join(`
4
+ `)}class ma{options;rules;lexer;constructor(t){this.options=t||Jr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ti(r,`
5
+ `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=$0(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=ti(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:ti(n[0],`
6
+ `)}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){let r=ti(n[0],`
7
+ `).split(`
8
+ `),o="",i="";const a=[];for(;r.length>0;){let l=!1;const s=[];let u;for(u=0;u<r.length;u++)if(/^ {0,3}>/.test(r[u]))s.push(r[u]),l=!0;else if(!l)s.push(r[u]);else break;r=r.slice(u);const c=s.join(`
9
+ `),f=c.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
10
+ $1`).replace(/^ {0,3}>[ \t]?/gm,"");o=o?`${o}
11
+ ${c}`:c,i=i?`${i}
12
+ ${f}`:f;const g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,a,!0),this.lexer.state.top=g,r.length===0)break;const p=a[a.length-1];if(p?.type==="code")break;if(p?.type==="blockquote"){const h=p,m=h.raw+`
13
+ `+r.join(`
14
+ `),y=this.blockquote(m);a[a.length-1]=y,o=o.substring(0,o.length-h.raw.length)+y.raw,i=i.substring(0,i.length-h.text.length)+y.text;break}else if(p?.type==="list"){const h=p,m=h.raw+`
15
+ `+r.join(`
16
+ `),y=this.list(m);a[a.length-1]=y,o=o.substring(0,o.length-p.raw.length)+y.raw,i=i.substring(0,i.length-h.raw.length)+y.raw,r=m.substring(a[a.length-1].raw.length).split(`
17
+ `);continue}}return{type:"blockquote",raw:o,tokens:a,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r=n[1].trim();const o=r.length>1,i={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const a=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let l=!1;for(;t;){let s=!1,u="",c="";if(!(n=a.exec(t))||this.rules.block.hr.test(t))break;u=n[0],t=t.substring(u.length);let f=n[2].split(`
18
+ `,1)[0].replace(/^\t+/,w=>" ".repeat(3*w.length)),g=t.split(`
19
+ `,1)[0],p=!f.trim(),h=0;if(this.options.pedantic?(h=2,c=f.trimStart()):p?h=n[1].length+1:(h=n[2].search(/[^ ]/),h=h>4?1:h,c=f.slice(h),h+=n[1].length),p&&/^ *$/.test(g)&&(u+=g+`
20
+ `,t=t.substring(g.length+1),s=!0),!s){const w=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),v=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),x=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),T=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;t;){const I=t.split(`
21
+ `,1)[0];if(g=I,this.options.pedantic&&(g=g.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),x.test(g)||T.test(g)||w.test(g)||v.test(t))break;if(g.search(/[^ ]/)>=h||!g.trim())c+=`
22
+ `+g.slice(h);else{if(p||f.search(/[^ ]/)>=4||x.test(f)||T.test(f)||v.test(f))break;c+=`
23
+ `+g}!p&&!g.trim()&&(p=!0),u+=I+`
24
+ `,t=t.substring(I.length+1),f=g.slice(h)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(u)&&(l=!0));let m=null,y;this.options.gfm&&(m=/^\[[ xX]\] /.exec(c),m&&(y=m[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:u,task:!!m,checked:y,loose:!1,text:c,tokens:[]}),i.raw+=u}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let s=0;s<i.items.length;s++)if(this.lexer.state.top=!1,i.items[s].tokens=this.lexer.blockTokens(i.items[s].text,[]),!i.loose){const u=i.items[s].tokens.filter(f=>f.type==="space"),c=u.length>0&&u.some(f=>/\n.*\n/.test(f.raw));i.loose=c}if(i.loose)for(let s=0;s<i.items.length;s++)i.items[s].loose=!0;return i}}html(t){const n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),o=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:i}}}table(t){const n=this.rules.block.table.exec(t);if(!n||!/[:|]/.test(n[2]))return;const r=fc(n[1]),o=n[2].replace(/^\||\| *$/g,"").split("|"),i=n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
25
+ `):[],a={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const l of o)/^ *-+: *$/.test(l)?a.align.push("right"):/^ *:-+: *$/.test(l)?a.align.push("center"):/^ *:-+ *$/.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<r.length;l++)a.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:a.align[l]});for(const l of i)a.rows.push(fc(l,a.header.length).map((s,u)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[u]})));return a}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===`
26
+ `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:Fn(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const a=ti(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{const a=V0(n[2],"()");if(a>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){const a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);a&&(o=a[1],i=a[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),hc(n,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const o=(r[2]||r[1]).replace(/\s+/g," "),i=n[o.toLowerCase()];if(!i){const a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return hc(r,i,r[0],this.lexer)}}emStrong(t,n,r=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))&&(!(o[1]||o[2])||!r||this.rules.inline.punctuation.exec(r))){const i=[...o[0]].length-1;let a,l,s=i,u=0;const c=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,n=n.slice(-1*t.length+i);(o=c.exec(n))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=[...a].length,o[3]||o[4]){s+=l;continue}else if((o[5]||o[6])&&i%3&&!((i+l)%3)){u+=l;continue}if(s-=l,s>0)continue;l=Math.min(l,l+s+u);const f=[...o[0]][0].length,g=t.slice(0,i+o.index+f+l);if(Math.min(i,l)%2){const h=g.slice(1,-1);return{type:"em",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}const p=g.slice(2,-2);return{type:"strong",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=Fn(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){const n=this.rules.inline.autolink.exec(t);if(n){let r,o;return n[2]==="@"?(r=Fn(n[1]),o="mailto:"+r):(r=Fn(n[1]),o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let r,o;if(n[2]==="@")r=Fn(n[0]),o="mailto:"+r;else{let i;do i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(i!==n[0]);r=Fn(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){const n=this.rules.inline.text.exec(t);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=Fn(n[0]),{type:"text",raw:n[0],text:r}}}}const _0=/^(?: *(?:\n|$))+/,N0=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,B0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Mi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,W0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Lf=/(?:[*+-]|\d{1,9}[.)])/,Hf=Dt(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Lf).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Fs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,j0=/^[^\n]+/,zs=/(?!\s*\])(?:\\.|[^\[\]\\])+/,G0=Dt(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",zs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),U0=Dt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Lf).getRegex(),Aa="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Vs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,X0=Dt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Vs).replace("tag",Aa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ff=Dt(Fs).replace("hr",Mi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Aa).getRegex(),K0=Dt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ff).getRegex(),$s={blockquote:K0,code:N0,def:G0,fences:B0,heading:W0,hr:Mi,html:X0,lheading:Hf,list:U0,newline:_0,paragraph:Ff,table:fi,text:j0},pc=Dt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Mi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Aa).getRegex(),Y0={...$s,table:pc,paragraph:Dt(Fs).replace("hr",Mi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Aa).getRegex()},Z0={...$s,html:Dt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Vs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Dt(Fs).replace("hr",Mi).replace("heading",` *#{1,6} *[^
27
+ ]`).replace("lheading",Hf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,q0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Vf=/^( {2,}|\\)\n(?!\s*$)/,Q0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ri="\\p{P}\\p{S}",J0=Dt(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Ri).getRegex(),ev=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,tv=Dt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Ri).getRegex(),nv=Dt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Ri).getRegex(),rv=Dt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Ri).getRegex(),ov=Dt(/\\([punct])/,"gu").replace(/punct/g,Ri).getRegex(),iv=Dt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),av=Dt(Vs).replace("(?:-->|$)","-->").getRegex(),lv=Dt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",av).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),va=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,sv=Dt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",va).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$f=Dt(/^!?\[(label)\]\[(ref)\]/).replace("label",va).replace("ref",zs).getRegex(),_f=Dt(/^!?\[(ref)\](?:\[\])?/).replace("ref",zs).getRegex(),uv=Dt("reflink|nolink(?!\\()","g").replace("reflink",$f).replace("nolink",_f).getRegex(),_s={_backpedal:fi,anyPunctuation:ov,autolink:iv,blockSkip:ev,br:Vf,code:q0,del:fi,emStrongLDelim:tv,emStrongRDelimAst:nv,emStrongRDelimUnd:rv,escape:zf,link:sv,nolink:_f,punctuation:J0,reflink:$f,reflinkSearch:uv,tag:lv,text:Q0,url:fi},cv={..._s,link:Dt(/^!?\[(label)\]\((.*?)\)/).replace("label",va).getRegex(),reflink:Dt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",va).getRegex()},cs={..._s,escape:Dt(zf).replace("])","~|])").getRegex(),url:Dt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},dv={...cs,br:Dt(Vf).replace("{2,}","*").getRegex(),text:Dt(cs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ki={normal:$s,gfm:Y0,pedantic:Z0},ni={normal:_s,gfm:cs,breaks:dv,pedantic:cv};class lr{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Jr,this.options.tokenizer=this.options.tokenizer||new ma,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:Ki.normal,inline:ni.normal};this.options.pedantic?(n.block=Ki.pedantic,n.inline=ni.pedantic):this.options.gfm&&(n.block=Ki.gfm,this.options.breaks?n.inline=ni.breaks:n.inline=ni.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ki,inline:ni}}static lex(t,n){return new lr(n).lex(t)}static lexInline(t,n){return new lr(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
28
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(l,s,u)=>s+" ".repeat(u.length));let o,i,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(o=l.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))){if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length),o.raw.length===1&&n.length>0?n[n.length-1].raw+=`
29
+ `:n.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
30
+ `+o.raw,i.text+=`
31
+ `+o.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
32
+ `+o.raw,i.text+=`
33
+ `+o.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),n.push(o);continue}if(a=t,this.options.extensions&&this.options.extensions.startBlock){let l=1/0;const s=t.slice(1);let u;this.options.extensions.startBlock.forEach(c=>{u=c.call({lexer:this},s),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(a=t.substring(0,l+1))}if(this.state.top&&(o=this.tokenizer.paragraph(a))){i=n[n.length-1],r&&i?.type==="paragraph"?(i.raw+=`
34
+ `+o.raw,i.text+=`
35
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(o),r=a.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
36
+ `+o.raw,i.text+=`
37
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(o);continue}if(t){const l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,o,i,a=t,l,s,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)c.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,l.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(s||(u=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(r=c.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,a,u)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const f=t.slice(1);let g;this.options.extensions.startInline.forEach(p=>{g=p.call({lexer:this},f),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(i=t.substring(0,c+1))}if(r=this.tokenizer.inlineText(i)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(u=r.raw.slice(-1)),s=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}class ba{options;parser;constructor(t){this.options=t||Jr}space(t){return""}code({text:t,lang:n,escaped:r}){const o=(n||"").match(/^\S*/)?.[0],i=t.replace(/\n$/,"")+`
38
+ `;return o?'<pre><code class="language-'+Fn(o)+'">'+(r?i:Fn(i,!0))+`</code></pre>
39
+ `:"<pre><code>"+(r?i:Fn(i,!0))+`</code></pre>
40
+ `}blockquote({tokens:t}){return`<blockquote>
41
+ ${this.parser.parse(t)}</blockquote>
42
+ `}html({text:t}){return t}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
43
+ `}hr(t){return`<hr>
44
+ `}list(t){const n=t.ordered,r=t.start;let o="";for(let l=0;l<t.items.length;l++){const s=t.items[l];o+=this.listitem(s)}const i=n?"ol":"ul",a=n&&r!==1?' start="'+r+'"':"";return"<"+i+a+`>
45
+ `+o+"</"+i+`>
46
+ `}listitem(t){let n="";if(t.task){const r=this.checkbox({checked:!!t.checked});t.loose?t.tokens.length>0&&t.tokens[0].type==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" "}):n+=r+" "}return n+=this.parser.parse(t.tokens,!!t.loose),`<li>${n}</li>
47
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
48
+ `}table(t){let n="",r="";for(let i=0;i<t.header.length;i++)r+=this.tablecell(t.header[i]);n+=this.tablerow({text:r});let o="";for(let i=0;i<t.rows.length;i++){const a=t.rows[i];r="";for(let l=0;l<a.length;l++)r+=this.tablecell(a[l]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
49
+ <thead>
50
+ `+n+`</thead>
51
+ `+o+`</table>
52
+ `}tablerow({text:t}){return`<tr>
53
+ ${t}</tr>
54
+ `}tablecell(t){const n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
55
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${t}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){const o=this.parser.parseInline(r),i=dc(t);if(i===null)return o;t=i;let a='<a href="'+t+'"';return n&&(a+=' title="'+n+'"'),a+=">"+o+"</a>",a}image({href:t,title:n,text:r}){const o=dc(t);if(o===null)return r;t=o;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):t.text}}class Ns{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}}class sr{options;renderer;textRenderer;constructor(t){this.options=t||Jr,this.options.renderer=this.options.renderer||new ba,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ns}static parse(t,n){return new sr(n).parse(t)}static parseInline(t,n){return new sr(n).parseInline(t)}parse(t,n=!0){let r="";for(let o=0;o<t.length;o++){const i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const l=i,s=this.options.extensions.renderers[l.type].call({parser:this},l);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){r+=s||"";continue}}const a=i;switch(a.type){case"space":{r+=this.renderer.space(a);continue}case"hr":{r+=this.renderer.hr(a);continue}case"heading":{r+=this.renderer.heading(a);continue}case"code":{r+=this.renderer.code(a);continue}case"table":{r+=this.renderer.table(a);continue}case"blockquote":{r+=this.renderer.blockquote(a);continue}case"list":{r+=this.renderer.list(a);continue}case"html":{r+=this.renderer.html(a);continue}case"paragraph":{r+=this.renderer.paragraph(a);continue}case"text":{let l=a,s=this.renderer.text(l);for(;o+1<t.length&&t[o+1].type==="text";)l=t[++o],s+=`
56
+ `+this.renderer.text(l);n?r+=this.renderer.paragraph({type:"paragraph",raw:s,text:s,tokens:[{type:"text",raw:s,text:s}]}):r+=s;continue}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(t,n){n=n||this.renderer;let r="";for(let o=0;o<t.length;o++){const i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=l||"";continue}}const a=i;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}}class aa{options;constructor(t){this.options=t||Jr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}}class fv{defaults=Hs();options=this.setOptions;parse=this.parseMarkdown(lr.lex,sr.parse);parseInline=this.parseMarkdown(lr.lexInline,sr.parseInline);Parser=sr;Renderer=ba;TextRenderer=Ns;Lexer=lr;Tokenizer=ma;Hooks=aa;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(const o of t)switch(r=r.concat(n.call(this,o)),o.type){case"table":{const i=o;for(const a of i.header)r=r.concat(this.walkTokens(a.tokens,n));for(const a of i.rows)for(const l of a)r=r.concat(this.walkTokens(l.tokens,n));break}case"list":{const i=o;r=r.concat(this.walkTokens(i.items,n));break}default:{const i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{const l=i[a].flat(1/0);r=r.concat(this.walkTokens(l,n))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,n)))}}return r}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const a=n.renderers[i.name];a?n.renderers[i.name]=function(...l){let s=i.renderer.apply(this,l);return s===!1&&(s=a.apply(this,l)),s}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const a=n[i.level];a?a.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),o.extensions=n),r.renderer){const i=this.defaults.renderer||new ba(this.defaults);for(const a in r.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;const l=a,s=r.renderer[l],u=i[l];i[l]=(...c)=>{let f=s.apply(i,c);return f===!1&&(f=u.apply(i,c)),f||""}}o.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new ma(this.defaults);for(const a in r.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const l=a,s=r.tokenizer[l],u=i[l];i[l]=(...c)=>{let f=s.apply(i,c);return f===!1&&(f=u.apply(i,c)),f}}o.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new aa;for(const a in r.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(a==="options")continue;const l=a,s=r.hooks[l],u=i[l];aa.passThroughHooks.has(a)?i[l]=c=>{if(this.defaults.async)return Promise.resolve(s.call(i,c)).then(g=>u.call(i,g));const f=s.call(i,c);return u.call(i,f)}:i[l]=(...c)=>{let f=s.apply(i,c);return f===!1&&(f=u.apply(i,c)),f}}o.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,a=r.walkTokens;o.walkTokens=function(l){let s=[];return s.push(a.call(this,l)),i&&(s=s.concat(i.call(this,l))),s}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return lr.lex(t,n??this.defaults)}parser(t,n){return sr.parse(t,n??this.defaults)}parseMarkdown(t,n){return(r,o)=>{const i={...o},a={...this.defaults,...i},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(r):r).then(s=>t(s,a)).then(s=>a.hooks?a.hooks.processAllTokens(s):s).then(s=>a.walkTokens?Promise.all(this.walkTokens(s,a.walkTokens)).then(()=>s):s).then(s=>n(s,a)).then(s=>a.hooks?a.hooks.postprocess(s):s).catch(l);try{a.hooks&&(r=a.hooks.preprocess(r));let s=t(r,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let u=n(s,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(s){return l(s)}}}onError(t,n){return r=>{if(r.message+=`
57
+ Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An error occurred:</p><pre>"+Fn(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}}}const Zr=new fv;function Ot(e,t){return Zr.parse(e,t)}Ot.options=Ot.setOptions=function(e){return Zr.setOptions(e),Ot.defaults=Zr.defaults,Df(Ot.defaults),Ot};Ot.getDefaults=Hs;Ot.defaults=Jr;Ot.use=function(...e){return Zr.use(...e),Ot.defaults=Zr.defaults,Df(Ot.defaults),Ot};Ot.walkTokens=function(e,t){return Zr.walkTokens(e,t)};Ot.parseInline=Zr.parseInline;Ot.Parser=sr;Ot.parser=sr.parse;Ot.Renderer=ba;Ot.TextRenderer=Ns;Ot.Lexer=lr;Ot.lexer=lr.lex;Ot.Tokenizer=ma;Ot.Hooks=aa;Ot.parse=Ot;Ot.options;Ot.setOptions;Ot.use;Ot.walkTokens;Ot.parseInline;sr.parse;lr.lex;const hv=dn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class pv extends St.PureComponent{targetElement=null;renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:r,createNode:o}=n,i=Ot(r),a=document.createRange();a.selectNodeContents(t),a.deleteContents();let l=o?.(i);if(l===void 0){const u=document.createElement("template");u.innerHTML=i,l=u.content}t.append(l);const s=t.getElementsByTagName("a");for(const u of s)u.target="_blank",u.rel="noreferrer noopener"}containerRefHook=t=>{this.targetElement=t,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),St.createElement(hv,{ref:this.containerRefHook})}}const gv=dn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),mv=dn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),vv=dn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let gc=0;const eo=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:o,altNewline:i,validatedSelection:a,...l}=e,{onChange:s,className:u}=l,c=d.useRef(null),f=n??"";zn(s!==void 0,"GrowingEntry must be a controlled input area");const[g]=d.useState(()=>"input-box-"+(gc=(gc+1)%1e7));d.useEffect(()=>{const h=c.current;if(h===null||h.disabled)return;const m=f.toString().length;h.focus(),h.setSelectionRange(o?0:m,m)},[]),d.useLayoutEffect(()=>{if(a!==void 0){const h=typeof a=="number"?[a,null]:a;c.current?.setSelectionRange(h[0],h[1])}},[a]);const p=d.useCallback(h=>{h.key==="Enter"&&h.shiftKey&&i===!0||r?.(h)},[i,r]);return d.createElement(vv,{className:"gdg-growing-entry"},d.createElement(mv,{className:u},f+`
58
+ `),d.createElement(gv,{...l,className:(u??"")+" gdg-input",id:g,ref:c,onKeyDown:p,value:f,placeholder:t,dir:"auto"}))},ml={};let Sr=null;function bv(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function bi(e){const t=e.toLowerCase().trim();if(ml[t]!==void 0)return ml[t];Sr=Sr||bv(),Sr.style.color="#000",Sr.style.color=t;const n=getComputedStyle(Sr).color;Sr.style.color="#fff",Sr.style.color=t;const r=getComputedStyle(Sr).color;if(r!==n)return[0,0,0,1];let o=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return o.length<4&&o.push(1),o=o.map(i=>Number.isNaN(i)?0:i),ml[t]=o,o}function qr(e,t){const[n,r,o]=bi(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const mc=new Map;function vc(e,t){const n=`${e}-${t}`,r=mc.get(n);if(r!==void 0)return r;const o=Vn(e,t);return mc.set(n,o),o}function Vn(e,t){if(t===void 0)return e;const[n,r,o,i]=bi(e);if(i===1)return e;const[a,l,s,u]=bi(t),c=i+u*(1-i),f=(i*n+u*a*(1-i))/c,g=(i*r+u*l*(1-i))/c,p=(i*o+u*s*(1-i))/c;return`rgba(${f}, ${g}, ${p}, ${c})`}function ds(e){if(e==="transparent")return 0;function t(i){const a=i/255;return a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}const[n,r,o]=bi(e);return .2126*t(n)+.7152*t(r)+.0722*t(o)}var Mo=new Map,Io=new Map,fs=new Map;function wv(){Mo.clear(),fs.clear(),Io.clear()}function yv(e,t,n,r,o){var i,a,l;let s=0,u={};for(let f of e)s+=(i=n.get(f))!=null?i:o,u[f]=((a=u[f])!=null?a:0)+1;let c=t-s;for(let f of Object.keys(u)){let g=u[f],p=(l=n.get(f))!=null?l:o,h=p*g/s,m=c*h*r/g,y=p+m;n.set(f,y)}}function xv(e,t){var n;let r=new Map,o=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;r.set(u,c),o+=c}let i=o/r.size,a=3,l=(t/i+a)/(a+1),s=r.keys();for(let u of s)r.set(u,((n=r.get(u))!=null?n:i)*l);return r}function hi(e,t,n,r){var o,i;let a=Io.get(n);if(r&&a!==void 0&&a.count>2e4){let u=fs.get(n);if(u===void 0&&(u=xv(e,a.size),fs.set(n,u)),a.count>5e5){let f=0;for(let g of t)f+=(o=u.get(g))!=null?o:a.size;return f*1.01}let c=e.measureText(t);return yv(t,c.width,u,Math.max(.05,1-a.count/2e5),a.size),Io.set(n,{count:a.count+t.length,size:a.size}),c.width}let l=e.measureText(t),s=l.width/t.length;if(((i=a?.count)!=null?i:0)>2e4)return l.width;if(a===void 0)Io.set(n,{count:t.length,size:s});else{let u=s-a.size,c=t.length/(a.count+t.length),f=a.size+u*c;Io.set(n,{count:a.count+t.length,size:f})}return l.width}function Cv(e,t,n,r,o,i,a,l){if(t.length<=1)return t.length;if(o<n)return-1;let s=Math.floor(n/o*i),u=hi(e,t.slice(0,Math.max(0,s)),r,a);if(u!==n)if(u<n){for(;u<n;)s++,u=hi(e,t.slice(0,Math.max(0,s)),r,a);s--}else for(;u>n;){let c=t.lastIndexOf(" ",s-1);c>0?s=c:s--,u=hi(e,t.slice(0,Math.max(0,s)),r,a)}if(t[s]!==" "){let c=0;c=t.lastIndexOf(" ",s),c>0&&(s=c)}return s}function kv(e,t,n,r,o,i){let a=`${t}_${n}_${r}px`,l=Mo.get(a);if(l!==void 0)return l;if(r<=0)return[];let s=[],u=t.split(`
59
+ `),c=Io.get(n),f=c===void 0?t.length:r/c.size*1.5,g=o&&c!==void 0&&c.count>2e4;for(let p of u){let h=hi(e,p.slice(0,Math.max(0,f)),n,g),m=Math.min(p.length,f);if(h<=r)s.push(p);else{for(;h>r;){let y=Cv(e,p,r,n,h,m,g),w=p.slice(0,Math.max(0,y));p=p.slice(w.length),s.push(w),h=hi(e,p.slice(0,Math.max(0,f)),n,g),m=Math.min(p.length,f)}h>0&&s.push(p)}}return s=s.map((p,h)=>h===0?p.trimEnd():p.trim()),Mo.set(a,s),Mo.size>500&&Mo.delete(Mo.keys().next().value),s}function Sv(e,t){return St.useMemo(()=>e.map((n,r)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:r,sticky:r<t,indicatorIcon:n.indicatorIcon,style:n.style,themeOverride:n.themeOverride,title:n.title,trailingRowOptions:n.trailingRowOptions,width:n.width,growOffset:n.growOffset,rowMarker:n.rowMarker,rowMarkerChecked:n.rowMarkerChecked,headerRowMarkerTheme:n.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:n.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:n.headerRowMarkerDisabled})),[e,t])}function Mv(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(pi(e.current.cell,t))return!0;const o=[e.current.range,...e.current.rangeStack];for(const i of o)if(n>=i.x&&n<i.x+i.width&&r>=i.y&&r<i.y+i.height)return!0}return!1}function wi(e,t){return(e??"")===(t??"")}function Rv(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 Nf(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function pi(e,t){return e?.[0]===t?.[0]&&e?.[1]===t?.[1]}function Bf(e){return[e.x+e.width-1,e.y+e.height-1]}function bc(e,t,n){const r=n.x,o=n.x+n.width-1,i=n.y,a=n.y+n.height-1,[l,s]=e;if(s<i||s>a)return!1;if(t.span===void 0)return l>=r&&l<=o;const[u,c]=t.span;return u>=r&&u<=o||c>=r&&u<=o||u<r&&c>o}function Iv(e,t,n,r){let o=0;if(n.current===void 0)return o;const i=n.current.range;(r||i.height*i.width>1)&&bc(e,t,i)&&o++;for(const a of n.current.rangeStack)bc(e,t,a)&&o++;return o}function Wf(e,t){let n=e;if(t!==void 0){let r=[...e];const o=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,o)):(r.splice(t.dest+1,0,o),r.splice(t.src,1)),r=r.map((i,a)=>({...i,sticky:e[a].sticky})),n=r}return n}function Po(e,t){let n=0;const r=Wf(e,t);for(let o=0;o<r.length;o++){const i=r[o];if(i.sticky)n+=i.width;else break}return n}function to(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let o=e-t;o<e;o++)r+=n(o);return r}}function hs(e,t,n,r,o){const i=Wf(e,r),a=[];for(const u of i)if(u.sticky)a.push(u);else break;if(a.length>0)for(const u of a)n-=u.width;let l=t,s=o??0;for(;s<=n&&l<i.length;)s+=i[l].width,l++;for(let u=t;u<l;u++){const c=i[u];c.sticky||a.push(c)}return a}function Ev(e,t,n){let r=0;for(const o of t){const i=o.sticky?r:r+(n??0);if(e<=i+o.width)return o.sourceIndex;r+=o.width}return-1}function Tv(e,t,n,r,o,i,a,l,s,u){const c=r+o;if(n&&e<=o)return-2;if(e<=c)return-1;let f=t;for(let h=0;h<u;h++){const m=i-1-h,y=typeof a=="number"?a:a(m);if(f-=y,e>=f)return m}const g=i-u,p=e-(s??0);if(typeof a=="number"){const h=Math.floor((p-c)/a)+l;return h>=g?void 0:h}else{let h=c;for(let m=l;m<g;m++){const y=a(m);if(p<=h+y)return m;h+=y}return}}let la=0,gi={};const Ov=typeof window>"u";async function Dv(){Ov||document?.fonts?.ready===void 0||(await document.fonts.ready,la=0,gi={},wv())}Dv();function jf(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Pr(e,t,n,r="middle"){const o=jf(e,t,r,n);let i=gi[o];return i===void 0&&(i=t.measureText(e),gi[o]=i,la++),la>1e4&&(gi={},la=0),i}function Gf(e,t){const n=jf(e,void 0,"middle",t);return gi[n]}function Qn(e,t){return typeof t!="string"&&(t=t.baseFontFull),Pv(e,t)}function wc(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const yc=[];function Pv(e,t){for(const o of yc)if(o.key===t)return o.val;const n=wc(e,"alphabetic"),r=-(wc(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return yc.push({key:t,val:r}),r}function Av(e,t,n,r,o,i){const{ctx:a,rect:l,theme:s}=e;let u=Number.MAX_SAFE_INTEGER;const c=500;if(t!==void 0&&(u=n-t,u<c)){const f=1-u/c;a.globalAlpha=f,a.fillStyle=s.bgSearchResult,a.fillRect(l.x+1,l.y+1,l.width-(o?2:1),l.height-(i?2:1)),a.globalAlpha=1,r!==void 0&&(r.fillStyle=s.bgSearchResult)}return u<c}function Ii(e,t,n){const{ctx:r,theme:o}=e,i=t??{},a=n??o.textDark;return a!==i.fillStyle&&(r.fillStyle=a,i.fillStyle=a),i}function Bs(e,t,n,r,o){const{rect:i,ctx:a,theme:l}=e;a.fillStyle=l.textDark,ar({ctx:a,rect:i,theme:l},t,n,r,o)}function Uf(e,t,n,r,o,i,a,l,s){s==="right"?e.fillText(t,n+o-(l.cellHorizontalPadding+.5),r+i/2+a):s==="center"?e.fillText(t,n+o/2,r+i/2+a):e.fillText(t,n+l.cellHorizontalPadding+.5,r+i/2+a)}function Ws(e,t){const n=Pr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function Lv(e,t){e.includes(`
60
+ `)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function Hv(e,t,n,r,o,i,a,l,s,u){const c=l.baseFontFull,f=kv(e,t,c,o-l.cellHorizontalPadding*2,u??!1),g=Ws(e,c),p=l.lineHeight*g,h=g+p*(f.length-1),m=h+l.cellVerticalPadding>i;m&&(e.save(),e.rect(n,r,o,i),e.clip());const y=r+i/2-h/2;let w=Math.max(r+l.cellVerticalPadding,y);for(const v of f)if(Uf(e,v,n,w,o,g,a,l,s),w+=p,w>r+i)break;m&&e.restore()}function ar(e,t,n,r,o){const{ctx:i,rect:a,theme:l}=e,{x:s,y:u,width:c,height:f}=a;r=r??!1,r||(t=Lv(t,c));const g=Qn(i,l),p=Ls(t)==="rtl";if(n===void 0&&p&&(n="right"),p&&(i.direction="rtl"),t.length>0){let h=!1;n==="right"?(i.textAlign="right",h=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,h=!0),r?Hv(i,t,s,u,c,f,g,l,n,o):Uf(i,t,s,u,c,f,g,l,n),h&&(i.textAlign="start"),p&&(i.direction="inherit")}}function qn(e,t,n,r,o,i){typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.max(0,Math.min(i.tl,o/2,r/2)),tr:Math.max(0,Math.min(i.tr,o/2,r/2)),bl:Math.max(0,Math.min(i.bl,o/2,r/2)),br:Math.max(0,Math.min(i.br,o/2,r/2))},e.moveTo(t+i.tl,n),e.arcTo(t+r,n,t+r,n+i.tr,i.tr),e.arcTo(t+r,n+o,t+r-i.br,n+o,i.br),e.arcTo(t,n+o,t,n+o-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}function Fv(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 zv(e,t,n){const r=function(l,s){const u=s.x-l.x,c=s.y-l.y,f=Math.sqrt(u*u+c*c),g=u/f,p=c/f;return{x:u,y:s.y-l.y,len:f,nx:g,ny:p,ang:Math.atan2(p,g)}};let o;const i=t.length;let a=t[i-1];for(let l=0;l<i;l++){let s=t[l%i];const u=t[(l+1)%i],c=r(s,a),f=r(s,u),g=c.nx*f.ny-c.ny*f.nx,p=c.nx*f.nx-c.ny*-f.ny;let h=Math.asin(g<-1?-1:g>1?1:g),m=1,y=!1;p<0?h<0?h=Math.PI+h:(h=Math.PI-h,m=-1,y=!0):h>0&&(m=-1,y=!0),o=s.radius!==void 0?s.radius:n;const w=h/2;let v=Math.abs(Math.cos(w)*o/Math.sin(w)),x;v>Math.min(c.len/2,f.len/2)?(v=Math.min(c.len/2,f.len/2),x=Math.abs(v*Math.sin(w)/Math.cos(w))):x=o;let T=s.x+f.nx*v,I=s.y+f.ny*v;T+=-f.ny*x*m,I+=f.nx*x*m,e.arc(T,I,x,c.ang+Math.PI/2*m,f.ang-Math.PI/2*m,y),a=s,s=u}e.closePath()}function ps(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h){const m={x:0,y:i+u,width:0,height:0};if(e>=p.length||t>=c||t<-2||e<0)return m;const y=i-o;if(e>=f){const w=a>e?-1:1,v=Po(p);m.x+=v+s;for(let x=a;x!==e;x+=w)m.x+=p[w===1?x:x-1].width*w}else for(let w=0;w<e;w++)m.x+=p[w].width;if(m.width=p[e].width+1,t===-1)m.y=o,m.height=y;else if(t===-2){m.y=0,m.height=o;let w=e;const v=p[e].group,x=p[e].sticky;for(;w>0&&wi(p[w-1].group,v)&&p[w-1].sticky===x;){const I=p[w-1];m.x-=I.width,m.width+=I.width,w--}let T=e;for(;T+1<p.length&&wi(p[T+1].group,v)&&p[T+1].sticky===x;){const I=p[T+1];m.width+=I.width,T++}if(!x){const I=Po(p),C=m.x-I;C<0&&(m.x-=C,m.width+=C),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=c-g){let w=c-t;for(m.y=r;w>0;){const v=t+w-1;m.height=typeof h=="number"?h:h(v),m.y-=m.height,w--}m.height+=1}else{const w=l>t?-1:1;if(typeof h=="number"){const v=t-l;m.y+=v*h}else for(let v=l;v!==t;v+=w)m.y+=h(v)*w;m.height=(typeof h=="number"?h:h(t))+1}return m}const js=1<<21;function Zn(e,t){return(t+2)*js+e}function Xf(e){return e%js}function Gs(e){return Math.floor(e/js)-2}function Us(e){const t=Xf(e),n=Gs(e);return[t,n]}class Kf{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=Xf(t),r=Gs(t),o=this.visibleWindow,i=n>=o.x&&n<=o.x+o.width||n<this.freezeCols,a=r>=o.y&&r<=o.y+o.height||this.freezeRows.includes(r);return i&&a};setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&Do(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class Vv extends Kf{cache=new Map;setValue=(t,n)=>{this.cache.set(Zn(t[0],t[1]),n)};getValue=t=>this.cache.get(Zn(t[0],t[1]));clearOutOfWindow=()=>{for(const[t]of this.cache.entries())this.isInWindow(t)||this.cache.delete(t)}}class mi{cells;constructor(t=[]){this.cells=new Set(t.map(n=>Zn(n[0],n[1])))}add(t){this.cells.add(Zn(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(Zn(t[0],t[1]))}remove(t){this.cells.delete(Zn(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(Gs(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Zn(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 Us(t)}}function $v(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 Yf={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 Zf(){return Yf}const qf=St.createContext(Yf);function Qf(){return St.useContext(qf)}function br(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const o in r)r.hasOwnProperty(o)&&(o==="bgCell"?n[o]=Vn(r[o],n[o]):n[o]=r[o]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const gs=150;function _v(e,t,n,r){return r(t)?.measure?.(e,t,n)??gs}function Jf(e,t,n,r,o,i,a,l,s){let u=0;const c=o===void 0?[]:o.map(p=>{const h=_v(e,p[r],t,s);return u=Math.max(u,h),h});if(c.length>5&&l){u=0;let p=0;for(const m of c)p+=m;const h=p/c.length;for(let m=0;m<c.length;m++)c[m]>=h*2?c[m]=0:u=Math.max(u,c[m])}const f=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=f;const g=Math.max(Math.ceil(i),Math.min(Math.floor(a),Math.ceil(u)));return{...n,width:g}}function Nv(e,t,n,r,o,i,a,l,s){const u=d.useRef(t),c=d.useRef(n),f=d.useRef(a);u.current=t,c.current=n,f.current=a;const[g,p]=d.useMemo(()=>{if(typeof window>"u")return[null,null];const v=document.createElement("canvas");return v.style.display="none",v.style.opacity="0",v.style.position="fixed",[v,v.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g?.remove()}),[g]);const h=d.useRef({}),m=d.useRef(),[y,w]=d.useState();return d.useLayoutEffect(()=>{const v=c.current;if(v===void 0||e.every(Ui))return;let x=Math.max(1,10-Math.floor(e.length/1e4)),T=0;x<u.current&&x>1&&(x--,T=1);const I={x:0,y:0,width:e.length,height:Math.min(u.current,x)},C={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const A=v(I,s.signal),E=T>0?v(C,s.signal):void 0;let k;typeof A=="object"?k=A:k=await Bu(A),E!==void 0&&(typeof E=="object"?k=[...k,...E]:k=[...k,...await Bu(E)]),m.current=e,w(k)})()},[s.signal,e]),d.useMemo(()=>{let v=e.every(Ui)?e:p===null?e.map(C=>Ui(C)?C:{...C,width:gs}):(p.font=f.current.baseFontFull,e.map((C,A)=>{if(Ui(C))return C;if(h.current[C.id]!==void 0)return{...C,width:h.current[C.id]};if(y===void 0||m.current!==e||C.id===void 0)return{...C,width:gs};const E=Jf(p,a,C,A,y,o,i,!0,l);return h.current[C.id]=E.width,E})),x=0,T=0;const I=[];for(const[C,A]of v.entries())x+=A.width,A.grow!==void 0&&A.grow>0&&(T+=A.grow,I.push(C));if(x<r&&I.length>0){const C=[...v],A=r-x;let E=A;for(let k=0;k<I.length;k++){const P=I[k],O=(v[P].grow??0)/T,R=k===I.length-1?E:Math.min(E,Math.floor(A*O));C[P]={...v[P],growOffset:R,width:v[P].width+R},E-=R}v=C}return{sizedColumns:v,nonGrowWidth:x}},[r,e,p,y,a,o,i,l])}var vl,xc;function Bv(){if(xc)return vl;xc=1;function e(t,n,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),n!==void 0&&(t=t>=n?t:n)),t}return vl=e,vl}var bl,Cc;function Wv(){if(Cc)return bl;Cc=1;var e=Bv(),t=Ps();function n(r,o,i){return i===void 0&&(i=o,o=void 0),i!==void 0&&(i=t(i),i=i===i?i:0),o!==void 0&&(o=t(o),o=o===o?o:0),e(t(r),o,i)}return bl=n,bl}var jv=Wv();const Bn=Dr(jv);var wl,kc;function Gv(){if(kc)return wl;kc=1;function e(t,n,r,o){for(var i=t.length,a=r+(o?1:-1);o?a--:++a<i;)if(n(t[a],a,t))return a;return-1}return wl=e,wl}var yl,Sc;function Uv(){if(Sc)return yl;Sc=1;function e(t){return t!==t}return yl=e,yl}var xl,Mc;function Xv(){if(Mc)return xl;Mc=1;function e(t,n,r){for(var o=r-1,i=t.length;++o<i;)if(t[o]===n)return o;return-1}return xl=e,xl}var Cl,Rc;function Kv(){if(Rc)return Cl;Rc=1;var e=Gv(),t=Uv(),n=Xv();function r(o,i,a){return i===i?n(o,i,a):e(o,t,a)}return Cl=r,Cl}var kl,Ic;function Yv(){if(Ic)return kl;Ic=1;var e=Kv();function t(n,r){var o=n==null?0:n.length;return!!o&&e(n,r,0)>-1}return kl=t,kl}var Sl,Ec;function Zv(){if(Ec)return Sl;Ec=1;function e(t,n,r){for(var o=-1,i=t==null?0:t.length;++o<i;)if(r(n,t[o]))return!0;return!1}return Sl=e,Sl}var Ml,Tc;function qv(){if(Tc)return Ml;Tc=1;function e(){}return Ml=e,Ml}var Rl,Oc;function Qv(){if(Oc)return Rl;Oc=1;var e=Im(),t=qv(),n=hf(),r=1/0,o=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return Rl=o,Rl}var Il,Dc;function Jv(){if(Dc)return Il;Dc=1;var e=Mm(),t=Yv(),n=Zv(),r=Hm(),o=Qv(),i=hf(),a=200;function l(s,u,c){var f=-1,g=t,p=s.length,h=!0,m=[],y=m;if(c)h=!1,g=n;else if(p>=a){var w=u?null:o(s);if(w)return i(w);h=!1,g=r,y=new e}else y=u?[]:m;e:for(;++f<p;){var v=s[f],x=u?u(v):v;if(v=c||v!==0?v:0,h&&x===x){for(var T=y.length;T--;)if(y[T]===x)continue e;u&&y.push(x),m.push(v)}else g(y,x,c)||(y!==m&&y.push(x),m.push(v))}return m}return Il=l,Il}var El,Pc;function eb(){if(Pc)return El;Pc=1;var e=Jv();function t(n){return n&&n.length?e(n):[]}return El=t,El}var tb=eb();const nb=Dr(tb);var Tl,Ac;function rb(){if(Ac)return Tl;Ac=1;var e=Em(),t=Tm(),n=ff(),r=e?e.isConcatSpreadable:void 0;function o(i){return n(i)||t(i)||!!(r&&i&&i[r])}return Tl=o,Tl}var Ol,Lc;function ob(){if(Lc)return Ol;Lc=1;var e=Lm(),t=rb();function n(r,o,i,a,l){var s=-1,u=r.length;for(i||(i=t),l||(l=[]);++s<u;){var c=r[s];o>0&&i(c)?o>1?n(c,o-1,i,a,l):e(l,c):a||(l[l.length]=c)}return l}return Ol=n,Ol}var Dl,Hc;function ib(){if(Hc)return Dl;Hc=1;var e=ob();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return Dl=t,Dl}var ab=ib();const Fc=Dr(ab);var Pl,zc;function lb(){if(zc)return Pl;zc=1;var e=Math.ceil,t=Math.max;function n(r,o,i,a){for(var l=-1,s=t(e((o-r)/(i||1)),0),u=Array(s);s--;)u[a?s:++l]=r,r+=i;return u}return Pl=n,Pl}var Al,Vc;function sb(){if(Vc)return Al;Vc=1;var e=Om(),t=Dm(),n=Pm(),r=Pa();function o(i,a,l){if(!r(l))return!1;var s=typeof a;return(s=="number"?t(l)&&n(a,l.length):s=="string"&&a in l)?e(l[a],i):!1}return Al=o,Al}var Ll,$c;function ub(){if($c)return Ll;$c=1;var e=Ps(),t=1/0,n=17976931348623157e292;function r(o){if(!o)return o===0?o:0;if(o=e(o),o===t||o===-t){var i=o<0?-1:1;return i*n}return o===o?o:0}return Ll=r,Ll}var Hl,_c;function cb(){if(_c)return Hl;_c=1;var e=lb(),t=sb(),n=ub();function r(o){return function(i,a,l){return l&&typeof l!="number"&&t(i,a,l)&&(a=l=void 0),i=n(i),a===void 0?(a=i,i=0):a=n(a),l=l===void 0?i<a?1:-1:n(l),e(i,a,l,o)}}return Hl=r,Hl}var Fl,Nc;function db(){if(Nc)return Fl;Nc=1;var e=cb(),t=e();return Fl=t,Fl}var fb=db();const Tr=Dr(fb),Vt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',hb=e=>{const t=e.fgColor,n=e.bgColor;return`
61
+ ${Vt}<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/><path d="M15.75 4h-1.5a.25.25 0 0 0-.177.074L9.308 8.838a3.75 3.75 0 1 0 1.854 1.854l1.155-1.157.967.322a.5.5 0 0 0 .65-.55l-.18-1.208.363-.363.727.331a.5.5 0 0 0 .69-.59l-.254-.904.647-.647A.25.25 0 0 0 16 5.75v-1.5a.25.25 0 0 0-.25-.25zM7.5 13.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" fill="${t}"/></svg>`},pb=e=>{const t=e.fgColor,n=e.bgColor;return`
62
+ ${Vt}<rect x="2" y="2" width="16" height="16" rx="4" fill="${n}"/><path d="m12.223 13.314 3.052-2.826a.65.65 0 0 0 0-.984l-3.052-2.822c-.27-.25-.634-.242-.865.022-.232.263-.206.636.056.882l2.601 2.41-2.601 2.41c-.262.245-.288.619-.056.882.231.263.595.277.865.026Zm-4.444.005c.266.25.634.241.866-.027.231-.263.206-.636-.06-.882L5.983 10l2.602-2.405c.266-.25.291-.62.06-.887-.232-.263-.596-.272-.866-.022L4.723 9.51a.653.653 0 0 0 0 .983l3.056 2.827Z" fill="${t}"/></svg>`},gb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
63
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
64
+ <path d="M6.52 12.78H5.51V8.74l-1.33.47v-.87l2.29-.83h.05v5.27zm5.2 0H8.15v-.69l1.7-1.83a6.38 6.38 0 0 0 .34-.4c.09-.11.16-.22.22-.32s.1-.19.12-.27a.9.9 0 0 0 0-.56.63.63 0 0 0-.15-.23.58.58 0 0 0-.22-.15.75.75 0 0 0-.29-.05c-.27 0-.48.08-.62.23a.95.95 0 0 0-.2.65H8.03c0-.24.04-.46.13-.67a1.67 1.67 0 0 1 .97-.91c.23-.1.49-.14.77-.14.26 0 .5.04.7.11.21.08.38.18.52.32.14.13.25.3.32.48a1.74 1.74 0 0 1 .03 1.13 2.05 2.05 0 0 1-.24.47 4.16 4.16 0 0 1-.35.47l-.47.5-1 1.05h2.32v.8zm1.8-3.08h.55c.28 0 .48-.06.61-.2a.76.76 0 0 0 .2-.55.8.8 0 0 0-.05-.28.56.56 0 0 0-.13-.22.6.6 0 0 0-.23-.15.93.93 0 0 0-.32-.05.92.92 0 0 0-.29.05.72.72 0 0 0-.23.12.57.57 0 0 0-.21.46H12.4a1.3 1.3 0 0 1 .5-1.04c.15-.13.33-.23.54-.3a2.48 2.48 0 0 1 1.4 0c.2.06.4.15.55.28.15.13.27.28.36.47.08.19.13.4.13.65a1.15 1.15 0 0 1-.2.65 1.36 1.36 0 0 1-.58.49c.15.05.28.12.38.2a1.14 1.14 0 0 1 .43.62c.03.13.05.26.05.4 0 .25-.05.47-.14.66a1.42 1.42 0 0 1-.4.49c-.16.13-.35.23-.58.3a2.51 2.51 0 0 1-.73.1c-.22 0-.44-.03-.65-.09a1.8 1.8 0 0 1-.57-.28 1.43 1.43 0 0 1-.4-.47 1.41 1.41 0 0 1-.15-.66h1a.66.66 0 0 0 .22.5.87.87 0 0 0 .58.2c.25 0 .45-.07.6-.2a.71.71 0 0 0 .21-.56.97.97 0 0 0-.06-.36.61.61 0 0 0-.18-.25.74.74 0 0 0-.28-.15 1.33 1.33 0 0 0-.37-.04h-.55V9.7z" fill="${t}"/>
65
+ </svg>`},mb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
66
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
67
+ <path d="M8.182 12.4h3.636l.655 1.6H14l-3.454-8H9.455L6 14h1.527l.655-1.6zM10 7.44l1.36 3.651H8.64L10 7.441z" fill="${t}"/>
68
+ </svg>`},vb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
69
+ <path
70
+ d="M16.2222 2H3.77778C2.8 2 2 2.8 2 3.77778V16.2222C2 17.2 2.8 18 3.77778 18H16.2222C17.2 18 17.9911 17.2 17.9911 16.2222L18 3.77778C18 2.8 17.2 2 16.2222 2Z"
71
+ fill="${n}"
72
+ />
73
+ <path
74
+ fill-rule="evenodd"
75
+ clip-rule="evenodd"
76
+ d="M7.66667 6.66669C5.73368 6.66669 4.16667 8.15907 4.16667 10C4.16667 11.841 5.73368 13.3334 7.66667 13.3334H12.3333C14.2663 13.3334 15.8333 11.841 15.8333 10C15.8333 8.15907 14.2663 6.66669 12.3333 6.66669H7.66667ZM12.5 12.5C13.8807 12.5 15 11.3807 15 10C15 8.61931 13.8807 7.50002 12.5 7.50002C11.1193 7.50002 10 8.61931 10 10C10 11.3807 11.1193 12.5 12.5 12.5Z"
77
+ fill="${t}"
78
+ />
79
+ </svg>`},eh=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
80
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
81
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.29 4.947a3.368 3.368 0 014.723.04 3.375 3.375 0 01.041 4.729l-.009.009-1.596 1.597a3.367 3.367 0 01-5.081-.364.71.71 0 011.136-.85 1.95 1.95 0 002.942.21l1.591-1.593a1.954 1.954 0 00-.027-2.733 1.95 1.95 0 00-2.732-.027l-.91.907a.709.709 0 11-1.001-1.007l.915-.911.007-.007z" fill="${t}"/>
82
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.55 8.678a3.368 3.368 0 015.082.364.71.71 0 01-1.136.85 1.95 1.95 0 00-2.942-.21l-1.591 1.593a1.954 1.954 0 00.027 2.733 1.95 1.95 0 002.73.028l.906-.906a.709.709 0 111.003 1.004l-.91.91-.008.01a3.368 3.368 0 01-4.724-.042 3.375 3.375 0 01-.041-4.728l.009-.009L6.55 8.678z" fill="${t}"/>
83
+ </svg>
84
+ `},bb=e=>{const t=e.bgColor;return`${Vt}
85
+ <path stroke="${t}" stroke-width="2" d="M12 3v14"/>
86
+ <path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
87
+ <path d="M11 14h4a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-4v2h4a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-4v2ZM9.5 8H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4.5v2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h4.5v2Z" fill="${t}"/>
88
+ </svg>
89
+ `},wb=eh,yb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
90
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
91
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 13.138a.5.5 0 00.748.434l5.492-3.138a.5.5 0 000-.868L7.748 6.427A.5.5 0 007 6.862v6.276z" fill="${t}"/>
92
+ </svg>`},xb=e=>{const t=e.fgColor,n=e.bgColor;return`
93
+ ${Vt}
94
+ <path d="M10 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 9.17A4.17 4.17 0 0 1 5.83 10 4.17 4.17 0 0 1 10 5.83 4.17 4.17 0 0 1 14.17 10 4.17 4.17 0 0 1 10 14.17z" fill="${t}"/>
95
+ <path d="M8.33 8.21a.83.83 0 1 0-.03 1.67.83.83 0 0 0 .03-1.67zm3.34 0a.83.83 0 1 0-.04 1.67.83.83 0 0 0 .04-1.67z" fill="${t}"/>
96
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.53 13.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
97
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
98
+ <path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 11a5 5 0 1 1 .01-10.01A5 5 0 0 1 10 15z" fill="${t}"/>
99
+ <path d="M8 7.86a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2zm4 0a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2z" fill="${t}"/>
100
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12.53 11.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
101
+ </svg>`},Cb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
102
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
103
+ <path opacity=".5" fill-rule="evenodd" clip-rule="evenodd" d="M12.499 10.801a.5.5 0 01.835 0l2.698 4.098a.5.5 0 01-.418.775H10.22a.5.5 0 01-.417-.775l2.697-4.098z" fill="${t}"/>
104
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.07 8.934a.5.5 0 01.824 0l4.08 5.958a.5.5 0 01-.412.782h-8.16a.5.5 0 01-.413-.782l4.08-5.958zM13.75 8.333a2.083 2.083 0 100-4.166 2.083 2.083 0 000 4.166z" fill="${t}"/>
105
+ </svg>`},kb=e=>{const t=e.fgColor,n=e.bgColor;return`
106
+ ${Vt}
107
+ <path fill="${t}" d="M3 3h14v14H3z"/>
108
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2zm-7.24 9.78h1.23c.15 0 .27.06.36.18l.98 1.28a.43.43 0 0 1-.05.58l-1.2 1.21a.45.45 0 0 1-.6.04A6.72 6.72 0 0 1 7.33 10c0-.61.1-1.2.25-1.78a6.68 6.68 0 0 1 2.12-3.3.44.44 0 0 1 .6.04l1.2 1.2c.16.17.18.42.05.59l-.98 1.29a.43.43 0 0 1-.36.17H8.98A5.38 5.38 0 0 0 8.67 10c0 .62.11 1.23.3 1.79z" fill="${n}"/>
109
+ </svg>`},Sb=e=>{const t=e.fgColor,n=e.bgColor;return`
110
+ ${Vt}
111
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
112
+ <path d="m13.49 13.15-2.32-3.27h1.4V7h1.86v2.88h1.4l-2.34 3.27zM11 13H9v-3l-1.5 1.92L6 10v3H4V7h2l1.5 2L9 7h2v6z" fill="${t}"/>
113
+ </svg>`},Mb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
114
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
115
+ <path d="M14.8 4.182h-.6V3H13v1.182H7V3H5.8v1.182h-.6c-.66 0-1.2.532-1.2 1.182v9.454C4 15.468 4.54 16 5.2 16h9.6c.66 0 1.2-.532 1.2-1.182V5.364c0-.65-.54-1.182-1.2-1.182zm0 10.636H5.2V7.136h9.6v7.682z" fill="${t}"/>
116
+ </svg>`},Rb=e=>{const t=e.fgColor,n=e.bgColor;return`
117
+ ${Vt}
118
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
119
+ <path d="M10 4a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6zm0 10.8A4.8 4.8 0 0 1 5.2 10a4.8 4.8 0 1 1 4.8 4.8z" fill="${t}"/>
120
+ <path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
121
+ </svg>`},Ib=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
122
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
123
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10 8.643a1.357 1.357 0 100 2.714 1.357 1.357 0 000-2.714zM7.357 10a2.643 2.643 0 115.286 0 2.643 2.643 0 01-5.286 0z" fill="${t}"/>
124
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.589 4.898A5.643 5.643 0 0115.643 10v.5a2.143 2.143 0 01-4.286 0V8a.643.643 0 011.286 0v2.5a.857.857 0 001.714 0V10a4.357 4.357 0 10-1.708 3.46.643.643 0 01.782 1.02 5.643 5.643 0 11-5.842-9.582z" fill="${t}"/>
125
+ </svg>`},Eb=e=>{const t=e.fgColor,n=e.bgColor;return`
126
+ ${Vt}
127
+ <rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
128
+ <rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
129
+ <path d="M10.68 7.73V6l2.97 3.02-2.97 3.02v-1.77c-2.13 0-3.62.7-4.68 2.2.43-2.15 1.7-4.31 4.68-4.74z" fill="${t}"/>
130
+ </svg>`},Tb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
131
+ <path fill="${t}" d="M4 3h12v14H4z"/>
132
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.6 2A1.6 1.6 0 002 3.6v12.8A1.6 1.6 0 003.6 18h12.8a1.6 1.6 0 001.6-1.6V3.6A1.6 1.6 0 0016.4 2H3.6zm11.3 10.8a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7h-1.4a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.6-.693.117.117 0 00.1-.115V10.35a.117.117 0 00-.117-.116h-2.8a.117.117 0 00-.117.116v2.333c0 .064.053.117.117.117h.117a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7H9.3a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.117a.117.117 0 00.117-.117V10.35a.117.117 0 00-.117-.117h-2.8a.117.117 0 00-.117.117v2.342c0 .058.042.106.1.115a.7.7 0 01.6.693v1.4a.7.7 0 01-.7.7H5.1a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.35a.116.116 0 00.116-.117v-2.45c0-.515.418-.933.934-.933h2.917a.117.117 0 00.117-.117V6.85a.117.117 0 00-.117-.116h-2.45a.7.7 0 01-.7-.7V5.1a.7.7 0 01.7-.7h6.067a.7.7 0 01.7.7v.934a.7.7 0 01-.7.7h-2.45a.117.117 0 00-.118.116v2.333c0 .064.053.117.117.117H13.5c.516 0 .934.418.934.934v2.45c0 .063.052.116.116.116h.35z" fill="${n}"/>
133
+ </svg>`},Ob=e=>{const t=e.fgColor,n=e.bgColor;return`
134
+ ${Vt}
135
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
136
+ <path d="M9.98 13.33c.45 0 .74-.3.73-.75l-.01-.1-.16-1.67 1.45 1.05a.81.81 0 0 0 .5.18c.37 0 .72-.32.72-.76 0-.3-.17-.54-.49-.68l-1.63-.77 1.63-.77c.32-.14.49-.37.49-.67 0-.45-.34-.76-.71-.76a.81.81 0 0 0-.5.18l-1.47 1.03.16-1.74.01-.08c.01-.46-.27-.76-.72-.76-.46 0-.76.32-.75.76l.01.08.16 1.74-1.47-1.03a.77.77 0 0 0-.5-.18.74.74 0 0 0-.72.76c0 .3.17.53.49.67l1.63.77-1.62.77c-.32.14-.5.37-.5.68 0 .44.35.75.72.75a.78.78 0 0 0 .5-.17L9.4 10.8l-.16 1.68v.09c-.02.44.28.75.74.75z" fill="${t}"/>
137
+ </svg>`},Db=e=>{const t=e.fgColor,n=e.bgColor;return`
138
+ ${Vt}
139
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
140
+ <path d="M8 5.83H5.83a.83.83 0 0 0 0 1.67h1.69A4.55 4.55 0 0 1 8 5.83zm-.33 3.34H5.83a.83.83 0 0 0 0 1.66h2.72a4.57 4.57 0 0 1-.88-1.66zM5.83 12.5a.83.83 0 0 0 0 1.67h7.5a.83.83 0 1 0 0-1.67h-7.5zm8.8-2.9a3.02 3.02 0 0 0 .46-1.6c0-1.66-1.32-3-2.94-3C10.52 5 9.2 6.34 9.2 8s1.31 3 2.93 3c.58 0 1.11-.17 1.56-.47l2.04 2.08.93-.94-2.04-2.08zm-2.48.07c-.9 0-1.63-.75-1.63-1.67s.73-1.67 1.63-1.67c.9 0 1.63.75 1.63 1.67s-.73 1.67-1.63 1.67z" fill="${t}"/>
141
+ </svg>`},Pb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
142
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
143
+ <path d="M7.676 4.726V3l2.976 3.021-2.976 3.022v-1.77c-2.125 0-3.613.69-4.676 2.201.425-2.158 1.7-4.316 4.676-4.748zM10.182 14.4h3.636l.655 1.6H16l-3.454-8h-1.091L8 16h1.527l.655-1.6zM12 9.44l1.36 3.65h-2.72L12 9.44z" fill="${t}"/>
144
+ </svg>`},Ab=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
145
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
146
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.167 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666H4.167z" fill="${t}"/>
147
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.083 4.167a.833.833 0 10-1.666 0v4.166a.833.833 0 101.666 0V4.167zM11.667 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666h-4.166zM5.367 11.688a.833.833 0 00-1.179 1.179l2.947 2.946a.833.833 0 001.178-1.178l-2.946-2.947z" fill="${t}"/>
148
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.313 12.867a.833.833 0 10-1.178-1.179l-2.947 2.947a.833.833 0 101.179 1.178l2.946-2.946z" fill="${t}"/>
149
+ <path d="M10.833 12.5c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833zM10.833 15c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833z" fill="${t}"/>
150
+ </svg>`},Lb=e=>{const t=e.fgColor,n=e.bgColor;return`
151
+ ${Vt}
152
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
153
+ <path d="M10 8.84a1.16 1.16 0 1 0 0 2.32 1.16 1.16 0 0 0 0-2.32zm3.02 3.61a3.92 3.92 0 0 0 .78-3.28.49.49 0 1 0-.95.2c.19.87-.02 1.78-.58 2.47a2.92 2.92 0 1 1-4.13-4.08 2.94 2.94 0 0 1 2.43-.62.49.49 0 1 0 .17-.96 3.89 3.89 0 1 0 2.28 6.27zM10 4.17a5.84 5.84 0 0 0-5.44 7.93.49.49 0 1 0 .9-.35 4.86 4.86 0 1 1 2.5 2.67.49.49 0 1 0-.4.88c.76.35 1.6.54 2.44.53a5.83 5.83 0 0 0 0-11.66zm3.02 3.5a.7.7 0 1 0-1.4 0 .7.7 0 0 0 1.4 0zm-6.97 5.35a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4z" fill="${t}"/>
154
+ </svg>`},Hb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
155
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
156
+ <path d="M12.4 13.565c1.865-.545 3.645-2.083 3.645-4.396 0-1.514-.787-2.604-2.071-2.604C12.69 6.565 12 7.63 12 8.939c1.114.072 1.865.726 1.865 1.683 0 .933-.8 1.647-1.84 2.023l.375.92zM4 5h6v2H4zM4 9h5v2H4zM4 13h4v2H4z" fill="${t}"/>
157
+ </svg>`},Fb=e=>{const t=e.fgColor,n=e.bgColor;return`
158
+ ${Vt}
159
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
160
+ <path d="M12.4 13.56c1.86-.54 3.65-2.08 3.65-4.4 0-1.5-.8-2.6-2.08-2.6S12 7.64 12 8.95c1.11.07 1.86.73 1.86 1.68 0 .94-.8 1.65-1.83 2.03l.37.91zM4 5h6v2H4zm0 4h5v2H4zm0 4h4v2H4z" fill="${t}"/>
161
+ </svg>`},zb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
162
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
163
+ <path d="M10 7a1 1 0 100-2v2zm0 6a1 1 0 100 2v-2zm0-8H7v2h3V5zm-3 6h5V9H7v2zm5 2h-2v2h2v-2zm1-1a1 1 0 01-1 1v2a3 3 0 003-3h-2zm-1-1a1 1 0 011 1h2a3 3 0 00-3-3v2zM4 8a3 3 0 003 3V9a1 1 0 01-1-1H4zm3-3a3 3 0 00-3 3h2a1 1 0 011-1V5z" fill="${t}"/>
164
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.856 12.014a.5.5 0 00-.712.702L5.409 14l-1.265 1.284a.5.5 0 00.712.702l1.255-1.274 1.255 1.274a.5.5 0 00.712-.702L6.813 14l1.265-1.284a.5.5 0 00-.712-.702L6.11 13.288l-1.255-1.274zM12.856 4.014a.5.5 0 00-.712.702L13.409 6l-1.265 1.284a.5.5 0 10.712.702l1.255-1.274 1.255 1.274a.5.5 0 10.712-.702L14.813 6l1.265-1.284a.5.5 0 00-.712-.702L14.11 5.288l-1.255-1.274z" fill="${t}"/>
165
+ </svg>`},Vb=e=>{const t=e.fgColor,n=e.bgColor;return`${Vt}
166
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
167
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 7.25a.75.75 0 000-1.5h-6.5a.75.75 0 100 1.5h6.5zM15 10a.75.75 0 01-.75.75h-6.5a.75.75 0 010-1.5h6.5A.75.75 0 0115 10zm-.75 4.25a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5zm-8.987-7a.75.75 0 100-1.5.75.75 0 000 1.5zm.75 2.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm-.75 4.25a.75.75 0 100-1.5.75.75 0 000 1.5z" fill="${t}"/>
168
+ </svg>`},$b=e=>{const t=e.fgColor;return`
169
+ <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
170
+ <path d="M2 15v1h14v-2.5c0-.87-.44-1.55-.98-2.04a6.19 6.19 0 0 0-1.9-1.14 12.1 12.1 0 0 0-2.48-.67A4 4 0 1 0 5 6a4 4 0 0 0 2.36 3.65c-.82.13-1.7.36-2.48.67-.69.28-1.37.65-1.9 1.13A2.8 2.8 0 0 0 2 13.5V15z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
171
+ </svg>`},_b=e=>{const t=e.fgColor;return`
172
+ <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
173
+ <path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
174
+ </svg>
175
+ `},Nb={headerRowID:hb,headerNumber:gb,headerCode:pb,headerString:mb,headerBoolean:vb,headerAudioUri:wb,headerVideoUri:yb,headerEmoji:xb,headerImage:Cb,headerUri:eh,headerPhone:kb,headerMarkdown:Sb,headerDate:Mb,headerTime:Rb,headerEmail:Ib,headerReference:Eb,headerIfThenElse:Tb,headerSingleValue:Ob,headerLookup:Db,headerTextTemplate:Pb,headerMath:Ab,headerRollup:Lb,headerJoinStrings:Hb,headerSplitString:Fb,headerGeoDistance:zb,headerArray:Vb,rowOwnerOverlay:$b,protectedColumnOverlay:_b,renameIcon:bb};function Bb(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Wb{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(t,n){this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,o,i,a,l,s=1){const[u,c]=Bb(n,l),f=a*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${f}_${t}`;let p=this.spriteMap.get(g);if(p===void 0){const h=this.headerIcons[t];if(h===void 0)return;p=document.createElement("canvas");const m=p.getContext("2d");if(m===null)return;const y=new Image;y.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,p);const w=y.decode();if(w===void 0)return;this.inFlight++,w.then(()=>{m.drawImage(y,0,0,f,f)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(r.globalAlpha=s),r.drawImage(p,0,0,f,f,o,i,a,a),s<1&&(r.globalAlpha=1)}}function th(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y);return t}function La(e,t,n,r,o,i,a,l,s){l=l??t;let u=t,c=e;const f=r-i;let g=!1;for(;u<n&&c<f;){const p=o(c);if(u+p>l&&s(u,c,p,!1,a&&c===r-1)===!0){g=!0;break}u+=p,c++}if(!g){u=n;for(let p=0;p<i;p++){c=r-1-p;const h=o(c);u-=h,s(u,c,h,!0,a&&c===r-1)}}}function Ar(e,t,n,r,o,i){let a=0,l=0;const s=o+r;for(const u of e){const c=u.sticky?l:a+n;if(i(u,c,s,u.sticky?0:l,t)===!0)break;a+=u.width,l+=u.sticky?u.width:0}}function nh(e,t,n,r,o){let i=0,a=0;for(let l=0;l<e.length;l++){const s=e[l];let u=l+1,c=s.width;for(s.sticky&&(a+=c);u<e.length&&wi(e[u].group,s.group)&&e[u].sticky===e[l].sticky;){const m=e[u];c+=m.width,u++,l++,m.sticky&&(a+=m.width)}const f=s.sticky?0:n,g=i+f,p=s.sticky?0:Math.max(0,a-g),h=Math.min(c-p,t-(g+p));o([s.sourceIndex,e[u-1].sourceIndex],s.group??"",g+p,0,h,r),i+=c}}function rh(e,t,n,r,o,i,a){const[l,s]=e;let u,c;const f=a.find(g=>!g.sticky)?.sourceIndex??0;if(s>f){const g=Math.max(l,f);let p=t,h=r;for(let m=i.sourceIndex-1;m>=g;m--)p-=a[m].width,h+=a[m].width;for(let m=i.sourceIndex+1;m<=s;m++)h+=a[m].width;c={x:p,y:n,width:h,height:o}}if(f>l){const g=Math.min(s,f-1);let p=t,h=r;for(let m=i.sourceIndex-1;m>=l;m--)p-=a[m].width,h+=a[m].width;for(let m=i.sourceIndex+1;m<=g;m++)h+=a[m].width;u={x:p,y:n,width:h,height:o}}return[u,c]}function jb(e,t,n,r){if(r==="any")return oh(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),Nf([t,n],e))return;const o=t-e.x,i=e.x+e.width-t,a=n-e.y+1,l=e.y+e.height-n,s=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="horizontal"?Number.MAX_SAFE_INTEGER:a,r==="horizontal"?Number.MAX_SAFE_INTEGER:l);return s===l?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:s===a?{x:e.x,y:n,width:e.width,height:e.y-n}:s===i?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function yi(e,t,n,r,o,i,a,l){return e<=o+a&&o<=e+n&&t<=i+l&&i<=t+r}function Kr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function oh(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width)-n,i=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:o,height:i}}function Gb(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 Ub(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const o=-4,i=-4,a=t+4,l=n+4,s=o-e.x,u=e.x+e.width-a,c=i-e.y,f=e.y+e.height-l,g=s>0?e.x+Math.floor(s/r)*r:e.x,p=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,h=c>0?e.y+Math.floor(c/r)*r:e.y,m=f>0?e.y+e.height-Math.floor(f/r)*r:e.y+e.height;return{x:g,y:h,width:p-g,height:m-h}}function Xb(e,t,n,r,o){const[i,a,l,s]=t,[u,c,f,g]=o,{x:p,y:h,width:m,height:y}=e,w=[];if(m<=0||y<=0)return w;const v=p+m,x=h+y,T=p<i,I=h<a,C=p+m>l,A=h+y>s,E=p>=i&&p<l||v>i&&v<=l||p<i&&v>l,k=h>=a&&h<s||x>a&&x<=s||h<a&&x>s;if(E&&k){const P=Math.max(p,i),O=Math.max(h,a),R=Math.min(v,l),M=Math.min(x,s);w.push({rect:{x:P,y:O,width:R-P,height:M-O},clip:{x:u,y:c,width:f-u+1,height:g-c+1}})}if(T&&I){const P=p,O=h,R=Math.min(v,i),M=Math.min(x,a);w.push({rect:{x:P,y:O,width:R-P,height:M-O},clip:{x:0,y:0,width:u+1,height:c+1}})}if(I&&E){const P=Math.max(p,i),O=h,R=Math.min(v,l),M=Math.min(x,a);w.push({rect:{x:P,y:O,width:R-P,height:M-O},clip:{x:u,y:0,width:f-u+1,height:c+1}})}if(I&&C){const P=Math.max(p,l),O=h,R=v,M=Math.min(x,a);w.push({rect:{x:P,y:O,width:R-P,height:M-O},clip:{x:f,y:0,width:n-f+1,height:c+1}})}if(T&&k){const P=p,O=Math.max(h,a),R=Math.min(v,i),M=Math.min(x,s);w.push({rect:{x:P,y:O,width:R-P,height:M-O},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(C&&k){const P=Math.max(p,l),O=Math.max(h,a),R=v,M=Math.min(x,s);w.push({rect:{x:P,y:O,width:R-P,height:M-O},clip:{x:f,y:c,width:n-f+1,height:g-c+1}})}if(T&&A){const P=p,O=Math.max(h,s),R=Math.min(v,i),M=x;w.push({rect:{x:P,y:O,width:R-P,height:M-O},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(A&&E){const P=Math.max(p,i),O=Math.max(h,s),R=Math.min(v,l),M=x;w.push({rect:{x:P,y:O,width:R-P,height:M-O},clip:{x:u,y:g,width:f-u+1,height:r-g+1}})}if(C&&A){const P=Math.max(p,l),O=Math.max(h,s),R=v,M=x;w.push({rect:{x:P,y:O,width:R-P,height:M-O},clip:{x:f,y:g,width:n-f+1,height:r-g+1}})}return w}const Kb={kind:Q.Loading,allowOverlay:!1};function Bc(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h,m,y,w,v,x,T,I,C,A,E,k,P,O,R,M,D,S,K,B,X){let ie=x?.size??Number.MAX_SAFE_INTEGER;const te=performance.now();let q=M.baseFontFull;e.font=q;const ge={ctx:e},se=[0,0],ce=y>0?to(s,y,u):0;let pe,ue;const V=th(v);return Ar(t,l,i,a,o,(L,G,oe,re,Te)=>{const xe=Math.max(0,re-G),Je=G+xe,Re=o+1,Pt=L.width-xe,bt=r-o-1;if(v.length>0){let ze=!1;for(let Le=0;Le<v.length;Le++){const nt=v[Le];if(yi(Je,Re,Pt,bt,nt.x,nt.y,nt.width,nt.height)){ze=!0;break}}if(!ze)return}const Ee=()=>{e.save(),e.beginPath(),e.rect(Je,Re,Pt,bt),e.clip()},ne=T.columns.hasIndex(L.sourceIndex),me=f(L.group??"").overrideTheme,we=L.themeOverride===void 0&&me===void 0?M:br(M,me,L.themeOverride),ae=we.baseFontFull;ae!==q&&(q=ae,e.font=ae),Ee();let ye;return La(Te,oe,r,s,u,y,w,V,(ze,Le,nt,Pe,qe)=>{if(Le<0||(se[0]=L.sourceIndex,se[1]=Le,x!==void 0&&!x.has(se)))return;if(v.length>0){let be=!1;for(let tt=0;tt<v.length;tt++){const Ft=v[tt];if(yi(G,ze,L.width,nt,Ft.x,Ft.y,Ft.width,Ft.height)){be=!0;break}}if(!be)return}const Ve=T.rows.hasIndex(Le),ve=p.hasIndex(Le),Ne=Le<s?c(se):Kb;let Qe=G,ut=L.width,Be=!1,Mt=!1;if(Ne.span!==void 0){const[be,tt]=Ne.span,Ft=`${Le},${be},${tt},${L.sticky}`;if(ue===void 0&&(ue=new Set),ue.has(Ft)){ie--;return}else{const Tn=rh(Ne.span,G,ze,L.width,nt,L,n),qt=L.sticky?Tn[0]:Tn[1];if(!L.sticky&&Tn[0]!==void 0&&(Mt=!0),qt!==void 0){Qe=qt.x,ut=qt.width,ue.add(Ft),e.restore(),ye=void 0,e.save(),e.beginPath();const rn=Math.max(0,re-qt.x);e.rect(qt.x+rn,ze,qt.width-rn,nt),pe===void 0&&(pe=[]),pe.push({x:qt.x+rn,y:ze,width:qt.width-rn,height:nt}),e.clip(),Be=!0}}}const Nt=g?.(Le),mt=qe&&L.trailingRowOptions?.themeOverride!==void 0?L.trailingRowOptions?.themeOverride:void 0,pt=Ne.themeOverride===void 0&&Nt===void 0&&mt===void 0?we:br(we,Nt,mt,Ne.themeOverride);e.beginPath();const Yt=Rv(se,Ne,T);let Ht=Iv(se,Ne,T,m);const kn=Ne.span!==void 0&&T.columns.some(be=>Ne.span!==void 0&&be>=Ne.span[0]&&be<=Ne.span[1]);Yt&&!h&&m?Ht=0:Yt&&m&&(Ht=Math.max(Ht,1)),kn&&Ht++,Yt||(Ve&&Ht++,ne&&!qe&&Ht++);const ht=Ne.kind===Q.Protected?pt.bgCellMedium:pt.bgCell;let ft;if((Pe||ht!==M.bgCell)&&(ft=Vn(ht,ft)),Ht>0||ve){ve&&(ft=Vn(pt.bgHeader,ft));for(let be=0;be<Ht;be++)ft=Vn(pt.accentLight,ft)}else if(I!==void 0){for(const be of I)if(be[0]===L.sourceIndex&&be[1]===Le){ft=Vn(pt.bgSearchResult,ft);break}}if(C!==void 0)for(let be=0;be<C.length;be++){const tt=C[be],Ft=tt.range;tt.style!=="solid-outline"&&Ft.x<=L.sourceIndex&&L.sourceIndex<Ft.x+Ft.width&&Ft.y<=Le&&Le<Ft.y+Ft.height&&(ft=Vn(tt.color,ft))}let Gt=!1;if(x!==void 0){const be=ze+1,tt=(Pe?be+nt-1:Math.min(be+nt-1,r-ce))-be;(tt!==nt-1||Qe+1<=re)&&(Gt=!0,e.save(),e.beginPath(),e.rect(Qe+1,be,ut-1,tt),e.clip()),ft=ft===void 0?pt.bgCell:Vn(ft,pt.bgCell)}const wt=L.sourceIndex===n.length-1,nn=Le===s-1;ft!==void 0&&(e.fillStyle=ft,ye!==void 0&&(ye.fillStyle=ft),x!==void 0?e.fillRect(Qe+1,ze+1,ut-(wt?2:1),nt-(nn?2:1)):e.fillRect(Qe,ze,ut,nt)),Ne.style==="faded"&&(e.globalAlpha=.6);let Zt;for(let be=0;be<k.length;be++){const tt=k[be];if(tt.item[0]===L.sourceIndex&&tt.item[1]===Le){Zt=tt;break}}if(ut>X&&!Mt){const be=pt.baseFontFull;be!==q&&(e.font=be,q=be),ye=ih(e,Ne,L.sourceIndex,Le,wt,nn,Qe,ze,ut,nt,Ht>0,pt,ft??pt.bgCell,A,E,Zt?.hoverAmount??0,P,R,te,O,ye,D,S,K,B)}return Gt&&e.restore(),Ne.style==="faded"&&(e.globalAlpha=1),ie--,Be&&(e.restore(),ye?.deprep?.(ge),ye=void 0,Ee(),q=ae,e.font=ae),ie<=0}),e.restore(),ie<=0}),pe}const ri=[0,0],oi={x:0,y:0,width:0,height:0},zl=[void 0,()=>{}];let ms=!1;function Yb(){ms=!0}function ih(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h,m,y,w,v,x,T,I,C,A,E){let k,P;y!==void 0&&y[0][0]===n&&y[0][1]===r&&(k=y[1][0],P=y[1][1]);let O;ri[0]=n,ri[1]=r,oi.x=a,oi.y=l,oi.width=s,oi.height=u,zl[0]=C.getValue(ri),zl[1]=S=>C.setValue(ri,S),ms=!1;const R={ctx:e,theme:f,col:n,row:r,cell:t,rect:oi,highlighted:c,cellFillColor:g,hoverAmount:m,frameTime:v,hoverX:k,drawState:zl,hoverY:P,imageLoader:p,spriteManager:h,hyperWrapping:w,overrideCursor:k!==void 0?E:void 0,requestAnimationFrame:Yb},M=Av(R,t.lastUpdated,v,T,o,i),D=A(t);if(D!==void 0){T?.renderer!==D&&(T?.deprep?.(R),T=void 0);const S=D.drawPrep?.(R,T);x!==void 0&&!Ro(R.cell)?x(R,()=>D.draw(R,t)):D.draw(R,t),O=S===void 0?void 0:{deprep:S?.deprep,fillStyle:S?.fillStyle,font:S?.font,renderer:D}}return(M||ms)&&I?.(ri),O}function Xs(e,t,n,r,o,i,a,l,s=-20,u=-20,c=void 0,f="center",g="square"){const p=Math.floor(o+a/2),h=g==="circle"?1e4:t.roundingRadius??4;let m=Ef(c??t.checkboxMaxSize,a,t.cellVerticalPadding),y=m/2;const w=If(f,r,i,t.cellHorizontalPadding,m),v=Rf(w,p,m),x=Tf(r+s,o+u,v);switch(n){case!0:{e.beginPath(),qn(e,w-m/2,p-m/2,m,m,h),g==="circle"&&(y*=.8,m*=.8),e.fillStyle=l?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(w-y+m/4.23,p-y+m/1.97),e.lineTo(w-y+m/2.42,p-y+m/1.44),e.lineTo(w-y+m/1.29,p-y+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ha:case!1:{e.beginPath(),qn(e,w-m/2+.5,p-m/2+.5,m-1,m-1,h),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break}case Ts:{e.beginPath(),qn(e,w-m/2,p-m/2,m,m,h),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),g==="circle"&&(y*=.8,m*=.8),e.beginPath(),e.moveTo(w-m/3,p),e.lineTo(w+m/3,p),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:vi()}}function Zb(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h,m,y,w,v){const x=a+l;if(x<=0)return;e.fillStyle=f.bgHeader,e.fillRect(0,0,o,x);const T=r?.[0]?.[0],I=r?.[0]?.[1],C=r?.[1]?.[0],A=r?.[1]?.[1],E=f.headerFontFull;e.font=E,Ar(t,0,i,0,x,(k,P,O,R)=>{if(y!==void 0&&!y.has([k.sourceIndex,-1]))return;const M=Math.max(0,R-P);e.save(),e.beginPath(),e.rect(P+M,l,k.width-M,a),e.clip();const D=m(k.group??"").overrideTheme,S=k.themeOverride===void 0&&D===void 0?f:br(f,D,k.themeOverride);S.bgHeader!==f.bgHeader&&(e.fillStyle=S.bgHeader,e.fill()),S!==f&&(e.font=S.headerFontFull);const K=c.columns.hasIndex(k.sourceIndex),B=s!==void 0||u||k.headerRowMarkerDisabled===!0,X=!B&&I===-1&&T===k.sourceIndex,ie=B?0:p.find(ce=>ce.item[0]===k.sourceIndex&&ce.item[1]===-1)?.hoverAmount??0,te=c?.current!==void 0&&c.current.cell[0]===k.sourceIndex,q=K?S.accentColor:te?S.bgHeaderHasFocus:S.bgHeader,ge=n?l:0,se=k.sourceIndex===0?0:1;K?(e.fillStyle=q,e.fillRect(P+se,ge,k.width-se,a)):(te||ie>0)&&(e.beginPath(),e.rect(P+se,ge,k.width-se,a),te&&(e.fillStyle=S.bgHeaderHasFocus,e.fill()),ie>0&&(e.globalAlpha=ie,e.fillStyle=S.bgHeaderHovered,e.fill(),e.globalAlpha=1)),sh(e,P,ge,k.width,a,k,K,S,X,X?C:void 0,X?A:void 0,te,ie,g,w,v),e.restore()}),n&&qb(e,t,o,i,l,r,f,g,p,h,m,y)}function qb(e,t,n,r,o,i,a,l,s,u,c,f){const[g,p]=i?.[0]??[];let h=0;nh(t,n,r,o,(m,y,w,v,x,T)=>{if(f!==void 0&&!f.hasItemInRectangle({x:m[0],y:-2,width:m[1]-m[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(w,v,x,T),e.clip();const I=c(y),C=I?.overrideTheme===void 0?a:br(a,I.overrideTheme),A=p===-2&&g!==void 0&&g>=m[0]&&g<=m[1],E=A?C.bgGroupHeaderHovered??C.bgHeaderHovered:C.bgGroupHeader??C.bgHeader;if(E!==a.bgHeader&&(e.fillStyle=E,e.fill()),e.fillStyle=C.textGroupHeader??C.textHeader,I!==void 0){let k=w;if(I.icon!==void 0&&(l.drawSprite(I.icon,"normal",e,k+8,(o-20)/2,20,C),k+=26),e.fillText(I.name,k+8,o/2+Qn(e,a.headerFontFull)),I.actions!==void 0&&A){const P=ah({x:w,y:v,width:x,height:T},I.actions);e.beginPath();const O=P[0].x-10,R=w+x-O;e.rect(O,0,R,o);const M=e.createLinearGradient(O,0,O+R,0),D=qr(E,0);M.addColorStop(0,D),M.addColorStop(10/R,E),M.addColorStop(1,E),e.fillStyle=M,e.fill(),e.globalAlpha=.6;const[S,K]=i?.[1]??[-1,-1];for(let B=0;B<I.actions.length;B++){const X=I.actions[B],ie=P[B],te=Kr(ie,S+w,K);te&&(e.globalAlpha=1),l.drawSprite(X.icon,"normal",e,ie.x+ie.width/2-10,ie.y+ie.height/2-10,20,C),te&&(e.globalAlpha=.6)}e.globalAlpha=1}}w!==0&&u(m[0])&&(e.beginPath(),e.moveTo(w+.5,0),e.lineTo(w+.5,o),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()),e.restore(),h=w+x}),e.beginPath(),e.moveTo(h+.5,0),e.lineTo(h+.5,o),e.moveTo(0,o+.5),e.lineTo(n,o+.5),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()}const Yi=30;function Qb(e,t,n,r,o){return{x:e+n-Yi,y:Math.max(t,t+r/2-Yi/2),width:Yi,height:Math.min(Yi,r)}}function ah(e,t){const n=[];let r=e.x+e.width-26*t.length;const o=e.y+e.height/2-13,i=26,a=26;for(let l=0;l<t.length;l++)n.push({x:r,y:o,width:a,height:i}),r+=26;return n}function ii(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function lh(e,t,n,r,o,i,a,l){const s=a.cellHorizontalPadding,u=a.headerIconSize,c=Qb(n,r,o,i);let f=n+s;const g=t.icon===void 0?void 0:{x:f,y:r+(i-u)/2,width:u,height:u},p=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(f+=Math.ceil(u*1.3));const h={x:f,y:r,width:o-f,height:i};let m;if(t.indicatorIcon!==void 0){const w=e===void 0?Gf(t.title,a.headerFontFull)?.width??0:Pr(t.title,e,a.headerFontFull).width;h.width=w,f+=w+s,m={x:f,y:r+(i-u)/2,width:u,height:u}}const y=n+o/2;return{menuBounds:ii(c,y,l),iconBounds:ii(g,y,l),iconOverlayBounds:ii(p,y,l),textBounds:ii(h,y,l),indicatorIconBounds:ii(m,y,l)}}function Wc(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h,m){if(i.rowMarker!==void 0&&i.headerRowMarkerDisabled!==!0){const v=i.rowMarkerChecked;v!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=f);const x=i.headerRowMarkerTheme!==void 0?br(l,i.headerRowMarkerTheme):l;Xs(e,x,v,t,n,r,o,!1,void 0,void 0,l.checkboxMaxSize,"center",i.rowMarker),v!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const y=a?l.textHeaderSelected:l.textHeader,w=i.hasMenu===!0&&(s||p&&a)&&m.menuBounds!==void 0;if(i.icon!==void 0&&m.iconBounds!==void 0){let v=a?"selected":"normal";i.style==="highlight"&&(v=a?"selected":"special"),g.drawSprite(i.icon,v,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,l),i.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&g.drawSprite(i.overlayIcon,a?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,l)}if(w&&r>35){const v=h?35:r-35,x=h?35*.7:r-35*.7,T=v/r,I=x/r,C=e.createLinearGradient(t,0,t+r,0),A=qr(y,0);C.addColorStop(h?1:0,y),C.addColorStop(T,y),C.addColorStop(I,A),C.addColorStop(h?0:1,A),e.fillStyle=C}else e.fillStyle=y;if(h&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(i.title,h?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+o/2+Qn(e,l.headerFontFull)),h&&(e.textAlign="left"),i.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!w||!yi(m.menuBounds.x,m.menuBounds.y,m.menuBounds.width,m.menuBounds.height,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,m.indicatorIconBounds.height))){let v=a?"selected":"normal";i.style==="highlight"&&(v=a?"selected":"special"),g.drawSprite(i.indicatorIcon,v,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,l)}if(w&&m.menuBounds!==void 0){const v=m.menuBounds,x=u!==void 0&&c!==void 0&&Kr(v,u+t,c+n);if(x||(e.globalAlpha=.7),i.menuIcon===void 0||i.menuIcon===pa.Triangle){e.beginPath();const T=v.x+v.width/2-5.5,I=v.y+v.height/2-3;zv(e,[{x:T,y:I},{x:T+11,y:I},{x:T+5.5,y:I+6}],1),e.fillStyle=y,e.fill()}else if(i.menuIcon===pa.Dots){e.beginPath();const T=v.x+v.width/2,I=v.y+v.height/2;Fv(e,T,I),e.fillStyle=y,e.fill()}else{const T=v.x+(v.width-l.headerIconSize)/2,I=v.y+(v.height-l.headerIconSize)/2;g.drawSprite(i.menuIcon,"normal",e,T,I,l.headerIconSize,l)}x||(e.globalAlpha=1)}}function sh(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h,m){const y=Ls(i.title)==="rtl",w=lh(e,i,t,n,r,o,l,y);h!==void 0?h({ctx:e,theme:l,rect:{x:t,y:n,width:r,height:o},column:i,columnIndex:i.sourceIndex,isSelected:a,hoverAmount:g,isHovered:s,hasSelectedCell:f,spriteManager:p,menuBounds:w?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>Wc(e,t,n,r,o,i,a,l,s,u,c,g,p,m,y,w)):Wc(e,t,n,r,o,i,a,l,s,u,c,g,p,m,y,w)}var Vl,jc;function Jb(){if(jc)return Vl;jc=1;function e(t,n,r,o){for(var i=-1,a=t==null?0:t.length;++i<a;){var l=t[i];n(o,l,r(l),t)}return o}return Vl=e,Vl}var $l,Gc;function e1(){if(Gc)return $l;Gc=1;var e=Am();function t(n,r,o,i){return e(n,function(a,l,s){r(i,a,o(a),s)}),i}return $l=t,$l}var _l,Uc;function t1(){if(Uc)return _l;Uc=1;var e=Jb(),t=e1(),n=Rm(),r=ff();function o(i,a){return function(l,s){var u=r(l)?e:t,c=a?a():{};return u(l,i,n(s,2),c)}}return _l=o,_l}var Nl,Xc;function n1(){if(Xc)return Nl;Xc=1;var e=Cm(),t=t1(),n=Object.prototype,r=n.hasOwnProperty,o=t(function(i,a,l){r.call(i,l)?i[l].push(a):e(i,l,[a])});return Nl=o,Nl}var r1=n1();const o1=Dr(r1);function i1(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h,m,y,w,v){if(w!==void 0||t[t.length-1]!==n[t.length-1])return;const x=th(y);Ar(t,s,a,l,i,(T,I,C,A,E)=>{if(T!==t[t.length-1])return;I+=T.width;const k=Math.max(I,A);k>r||(e.save(),e.beginPath(),e.rect(k,i+1,1e4,o-i-1),e.clip(),La(E,C,o,u,c,h,m,x,(P,O,R,M)=>{if(!M&&y.length>0&&!y.some(X=>yi(I,P,1e4,R,X.x,X.y,X.width,X.height)))return;const D=g.hasIndex(O),S=p.hasIndex(O);e.beginPath();const K=f?.(O),B=K===void 0?v:br(v,K);B.bgCell!==v.bgCell&&(e.fillStyle=B.bgCell,e.fillRect(I,P,1e4,R)),S&&(e.fillStyle=B.bgHeader,e.fillRect(I,P,1e4,R)),D&&(e.fillStyle=B.accentLight,e.fillRect(I,P,1e4,R))}),e.restore())})}function a1(e,t,n,r,o,i,a,l,s){let u=!1;for(const h of t)if(!h.sticky){u=a(h.sourceIndex);break}const c=s.horizontalBorderColor??s.borderColor,f=s.borderColor,g=u?Po(t):0;let p;if(g!==0&&(p=vc(f,s.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=p,e.stroke()),o>0){const h=f===c&&p!==void 0?p:vc(c,s.bgCell),m=to(i,o,l);e.beginPath(),e.moveTo(0,r-m+.5),e.lineTo(n,r-m+.5),e.strokeStyle=h,e.stroke()}}const uh=(e,t,n)=>{let r=0,o=t,i=0,a=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(const l of e)r=Math.min(r,l.x-1),o=Math.max(o,l.x+l.width+1),i=Math.min(i,l.y-1),a=Math.max(a,l.y+l.height+1)}return{minX:r,maxX:o,minY:i,maxY:a}};function l1(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h){const m=h.bgCell,{minX:y,maxX:w,minY:v,maxY:x}=uh(l,i,a),T=[],I=a-to(p,g,u);let C=s,A=n,E=0;for(;C+o<I;){const R=C+o,M=u(A);if(R>=v&&R<=x-1){const D=c?.(A)?.bgCell;D!==void 0&&D!==m&&A>=p-g&&T.push({x:y,y:R,w:w-y,h:M,color:D})}C+=M,A<p-g&&(E=C),A++}let k=0;const P=Math.min(I,x)-E;if(P>0)for(let R=0;R<t.length;R++){const M=t[R];if(M.width===0)continue;const D=M.sticky?k:k+r,S=M.themeOverride?.bgCell;S!==void 0&&S!==m&&D>=y&&D<=w&&f(R+1)&&T.push({x:D,y:E,w:M.width,h:P,color:S}),k+=M.width}if(T.length===0)return;let O;e.beginPath();for(let R=T.length-1;R>=0;R--){const M=T[R];O===void 0?O=M.color:M.color!==O&&(e.fillStyle=O,e.fill(),e.beginPath(),O=M.color),e.rect(M.x,M.y,M.w,M.h)}O!==void 0&&(e.fillStyle=O,e.fill()),e.beginPath()}function Kc(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h,m,y,w=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,a);for(const R of s)e.rect(R.x+1,R.y+1,R.width-1,R.height-1);e.clip("evenodd")}const v=y.horizontalBorderColor??y.borderColor,x=y.borderColor,{minX:T,maxX:I,minY:C,maxY:A}=uh(l,i,a),E=[];e.beginPath();let k=.5;for(let R=0;R<t.length;R++){const M=t[R];if(M.width===0)continue;k+=M.width;const D=M.sticky?k:k+r;D>=T&&D<=I&&p(R+1)&&E.push({x1:D,y1:Math.max(u,C),x2:D,y2:Math.min(a,A),color:x})}let P=a+.5;for(let R=m-h;R<m;R++){const M=f(R);P-=M,E.push({x1:T,y1:P,x2:I,y2:P,color:v})}if(w!==!0){let R=c+.5,M=n;const D=P;for(;R+o<D;){const S=R+o;if(S>=C&&S<=A-1){const K=g?.(M);E.push({x1:T,y1:S,x2:I,y2:S,color:K?.horizontalBorderColor??K?.borderColor??v})}R+=f(M),M++}}const O=o1(E,R=>R.color);for(const R of Object.keys(O)){e.strokeStyle=R;for(const M of O[R])e.moveTo(M.x1,M.y1),e.lineTo(M.x2,M.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function s1(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h,m,y,w,v){const x=[];e.imageSmoothingEnabled=!1;const T=Math.min(o.cellYOffset,a),I=Math.max(o.cellYOffset,a);let C=0;if(typeof w=="number")C+=(I-T)*w;else for(let D=T;D<I;D++)C+=w(D);a>o.cellYOffset&&(C=-C),C+=s-o.translateY;const A=Math.min(o.cellXOffset,i),E=Math.max(o.cellXOffset,i);let k=0;for(let D=A;D<E;D++)k+=m[D].width;i>o.cellXOffset&&(k=-k),k+=l-o.translateX;const P=Po(y);if(k!==0&&C!==0)return{regions:[]};const O=u>0?to(g,u,w):0,R=c-P-Math.abs(k),M=f-p-O-Math.abs(C)-1;if(R>150&&M>150){const D={sx:0,sy:0,sw:c*h,sh:f*h,dx:0,dy:0,dw:c*h,dh:f*h};if(C>0?(D.sy=(p+1)*h,D.sh=M*h,D.dy=(C+p+1)*h,D.dh=M*h,x.push({x:0,y:p,width:c,height:C+1})):C<0&&(D.sy=(-C+p+1)*h,D.sh=M*h,D.dy=(p+1)*h,D.dh=M*h,x.push({x:0,y:f+C-O,width:c,height:-C+O})),k>0?(D.sx=P*h,D.sw=R*h,D.dx=(k+P)*h,D.dw=R*h,x.push({x:P-1,y:0,width:k+2,height:f})):k<0&&(D.sx=(P-k)*h,D.sw=R*h,D.dx=P*h,D.dw=R*h,x.push({x:c+k,y:0,width:-k,height:f})),e.setTransform(1,0,0,1,0,0),v){if(P>0&&k!==0&&C===0&&(r===void 0||n?.[1]!==!1)){const S=P*h,K=f*h;e.drawImage(t,0,0,S,K,0,0,S,K)}if(O>0&&k===0&&C!==0&&(r===void 0||n?.[0]!==!1)){const S=(f-O)*h,K=c*h,B=O*h;e.drawImage(t,0,S,K,B,0,S,K,B)}}e.drawImage(t,D.sx,D.sy,D.sw,D.sh,D.dx,D.dy,D.dw,D.dh),e.scale(h,h)}return e.imageSmoothingEnabled=!0,{regions:x}}function u1(e,t,n,r,o,i,a,l,s,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||o!==e.translateY||Ar(s,n,r,o,l,(f,g,p,h)=>{if(f.sourceIndex===u){const m=Math.max(g,h)+1;return c.push({x:m,y:0,width:i-m,height:a}),!0}}),c}function c1(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;r<e.mappedColumns.length;r++){const o=e.mappedColumns[r],i=t.mappedColumns[r];if(Do(o,i))continue;if(n!==void 0||o.width===i.width)return!1;const{width:a,...l}=o,{width:s,...u}=i;if(!Do(l,u))return!1;n=r}return n===void 0?!0:n}return!0}function Yc(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h,m){const y=h?.filter(A=>A.style!=="no-outline");if(y===void 0||y.length===0)return;const w=Po(l),v=to(p,g,f),x=[s,0,l.length,p-g],T=[w,0,t,n-v],I=y.map(A=>{const E=A.range,k=A.style??"dashed";return Xb(E,x,t,n,T).map(P=>{const O=P.rect,R=ps(O.x,O.y,t,n,c,u+c,r,o,i,a,p,s,g,l,f),M=O.width===1&&O.height===1?R:ps(O.x+O.width-1,O.y+O.height-1,t,n,c,u+c,r,o,i,a,p,s,g,l,f);return O.x+O.width>=l.length&&(M.width-=1),O.y+O.height>=p&&(M.height-=1),{color:A.color,style:k,clip:P.clip,rect:Ub({x:R.x,y:R.y,width:M.x+M.width-R.x,height:M.y+M.height-R.y},t,n,8)}})}),C=()=>{e.lineWidth=1;let A=!1;for(const E of I)for(const k of E)if(k?.rect!==void 0&&yi(0,0,t,n,k.rect.x,k.rect.y,k.rect.width,k.rect.height)){const P=A,O=!Gb(k.clip,k.rect);e.beginPath(),O&&(e.save(),e.rect(k.clip.x,k.clip.y,k.clip.width,k.clip.height),e.clip()),k.style==="dashed"&&!A?(e.setLineDash([5,3]),A=!0):(k.style==="solid"||k.style==="solid-outline")&&A&&(e.setLineDash([]),A=!1),e.strokeStyle=k.style==="solid-outline"?Vn(Vn(k.color,m.borderColor),m.bgCell):qr(k.color,1),e.closePath(),e.strokeRect(k.rect.x+.5,k.rect.y+.5,k.rect.width-1,k.rect.height-1),O&&(e.restore(),A=P)}A&&e.setLineDash([])};return C(),C}function Zc(e,t,n,r,o){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=o,e.stroke(),e.globalAlpha=1}function Bl(e,t,n,r,o,i,a,l,s,u,c,f,g,p,h,m,y){if(c.current===void 0)return;const w=m!==!1&&m!==void 0;if(!w)return;const v=typeof m=="object"?{...ga,...m}:ga,x=c.current.range,T=c.current.cell,I=[x.x+x.width-1,x.y+x.height-1];if(T[1]>=y&&I[1]>=y||!a.some(S=>S.sourceIndex===T[0]||S.sourceIndex===I[0]))return;const[C,A]=c.current.cell,E=g(c.current.cell),k=E.span??[C,C],P=A>=y-p,O=p>0&&!P?to(y,p,f)-1:0,R=I[1];let M;if(Ar(a,r,o,i,u,(S,K,B,X,ie)=>{if(S.sticky&&C>S.sourceIndex)return;const te=S.sourceIndex<k[0],q=S.sourceIndex>k[1],ge=S.sourceIndex===I[0];if(!(!ge&&(te||q)))return La(ie,B,n,y,f,p,h,void 0,(se,ce,pe)=>{if(ce!==A&&ce!==R)return;let ue=K,V=S.width;if(E.span!==void 0){const L=rh(E.span,K,se,S.width,pe,S,l),G=S.sticky?L[0]:L[1];G!==void 0&&(ue=G.x,V=G.width)}return ce===R&&ge&&w&&(M=()=>{X>ue&&!S.sticky&&(e.beginPath(),e.rect(X,0,t-X,n),e.clip());const L=v.size,G=L/2,oe=ue+V+v.offsetX-G+.5,re=se+pe+v.offsetY-G+.5;e.beginPath(),v.shape==="circle"?e.arc(oe+G,re+G,G,0,Math.PI*2):e.rect(oe,re,L,L),e.fillStyle=S.themeOverride?.accentColor??s.accentColor,e.fill(),v.outline>0&&(e.lineWidth=v.outline,e.strokeStyle=s.bgCell,v.shape==="circle"?(e.beginPath(),e.arc(oe+G,re+G,G+v.outline/2,0,Math.PI*2),e.stroke()):e.strokeRect(oe-v.outline/2,re-v.outline/2,L+v.outline,L+v.outline))}),M!==void 0}),M!==void 0}),M===void 0)return;const D=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-O),e.clip(),M?.(),e.restore()};return D(),D}function d1(e,t,n,r,o,i,a,l,s){s===void 0||s.size===0||(e.beginPath(),nh(t,n,i,r,(u,c,f,g,p,h)=>{s.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(f,g,p,h)}),Ar(t,l,i,a,o,(u,c,f,g)=>{const p=Math.max(0,g-c),h=c+p+1,m=u.width-p-1;s.has([u.sourceIndex,-1])&&e.rect(h,r,m,o-r)}),e.clip())}function f1(e,t,n,r,o,i,a,l,s,u){let c=0;return Ar(e,i,r,o,n,(f,g,p,h,m)=>(La(m,p,t,a,l,s,u,void 0,(y,w,v,x)=>{x||(c=Math.max(w,c))}),!0)),c}function qc(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:o,height:i,cellXOffset:a,cellYOffset:l,translateX:s,translateY:u,mappedColumns:c,enableGroups:f,freezeColumns:g,dragAndDropState:p,theme:h,drawFocus:m,headerHeight:y,groupHeaderHeight:w,disabledRows:v,rowHeight:x,verticalBorder:T,overrideCursor:I,isResizing:C,selection:A,fillHandle:E,freezeTrailingRows:k,rows:P,getCellContent:O,getGroupDetails:R,getRowThemeOverride:M,isFocused:D,drawHeaderCallback:S,prelightCells:K,drawCellCallback:B,highlightRegions:X,resizeCol:ie,imageLoader:te,lastBlitData:q,hoverValues:ge,hyperWrapping:se,hoverInfo:ce,spriteManager:pe,maxScaleFactor:ue,hasAppendRow:V,touchMode:L,enqueue:G,renderStateProvider:oe,getCellRenderer:re,renderStrategy:Te,bufferACtx:xe,bufferBCtx:Je,damage:Re,minimumCellWidth:Pt,resizeIndicator:bt}=e;if(o===0||i===0)return;const Ee=Te==="double-buffer",ne=Math.min(ue,Math.ceil(window.devicePixelRatio??1)),me=Te!=="direct"&&c1(e,t),we=n.canvas;(we.width!==o*ne||we.height!==i*ne)&&(we.width=o*ne,we.height=i*ne,we.style.width=o+"px",we.style.height=i+"px");const ae=r.canvas,ye=f?w+y:y,ze=ye+1;(ae.width!==o*ne||ae.height!==ze*ne)&&(ae.width=o*ne,ae.height=ze*ne,ae.style.width=o+"px",ae.style.height=ze+"px");const Le=xe.canvas,nt=Je.canvas;Ee&&(Le.width!==o*ne||Le.height!==i*ne)&&(Le.width=o*ne,Le.height=i*ne,q.current!==void 0&&(q.current.aBufferScroll=void 0)),Ee&&(nt.width!==o*ne||nt.height!==i*ne)&&(nt.width=o*ne,nt.height=i*ne,q.current!==void 0&&(q.current.bBufferScroll=void 0));const Pe=q.current;if(me===!0&&a===Pe?.cellXOffset&&l===Pe?.cellYOffset&&s===Pe?.translateX&&u===Pe?.translateY)return;let qe=null;Ee&&(qe=n);const Ve=r;let ve;Ee?Re!==void 0?ve=Pe?.lastBuffer==="b"?Je:xe:ve=Pe?.lastBuffer==="b"?xe:Je:ve=n;const Ne=ve.canvas,Qe=Ee?Ne===Le?nt:Le:we,ut=typeof x=="number"?()=>x:x;Ve.save(),ve.save(),Ve.beginPath(),ve.beginPath(),Ve.textBaseline="middle",ve.textBaseline="middle",ne!==1&&(Ve.scale(ne,ne),ve.scale(ne,ne));const Be=hs(c,a,o,p,s);let Mt=[];const Nt=m&&A.current?.cell[1]===l&&u===0;let mt=!1;if(X!==void 0){for(const wt of X)if(wt.style!=="no-outline"&&wt.range.y===l&&u===0){mt=!0;break}}const pt=()=>{Zb(Ve,Be,f,ce,o,s,y,w,p,C,A,h,pe,ge,T,R,Re,S,L),Kc(Ve,Be,l,s,u,o,i,void 0,void 0,w,ye,ut,M,T,k,P,h,!0),Ve.beginPath(),Ve.moveTo(0,ze-.5),Ve.lineTo(o,ze-.5),Ve.strokeStyle=Vn(h.headerBottomBorderColor??h.horizontalBorderColor??h.borderColor,h.bgHeader),Ve.stroke(),mt&&Yc(Ve,o,i,a,l,s,u,c,g,y,w,x,k,P,X,h),Nt&&Bl(Ve,o,i,l,s,u,Be,c,h,ye,A,ut,O,k,V,E,P)};if(Re!==void 0){const wt=Be[Be.length-1].sourceIndex+1,nn=Re.hasItemInRegion([{x:a,y:-2,width:wt,height:2},{x:a,y:l,width:wt,height:300},{x:0,y:l,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:a,y:P-k,width:wt,height:k,when:k>0}]),Zt=be=>{Bc(be,Be,c,i,ye,s,u,l,P,ut,O,R,M,v,D,m,k,V,Mt,Re,A,K,X,te,pe,ge,ce,B,se,h,G,oe,re,I,Pt);const tt=A.current;E!==!1&&E!==void 0&&m&&tt!==void 0&&Re.has(Bf(tt.range))&&Bl(be,o,i,l,s,u,Be,c,h,ye,A,ut,O,k,V,E,P)};nn&&(Zt(ve),qe!==null&&(qe.save(),qe.scale(ne,ne),qe.textBaseline="middle",Zt(qe),qe.restore()),Re.hasHeader()&&(d1(Ve,Be,o,w,ye,s,u,l,Re),pt())),ve.restore(),Ve.restore();return}if((me!==!0||a!==Pe?.cellXOffset||s!==Pe?.translateX||Nt!==Pe?.mustDrawFocusOnHeader||mt!==Pe?.mustDrawHighlightRingsOnHeader)&&pt(),me===!0){zn(Qe!==void 0&&Pe!==void 0);const{regions:wt}=s1(ve,Qe,Qe===Le?Pe.aBufferScroll:Pe.bBufferScroll,Qe===Le?Pe.bBufferScroll:Pe.aBufferScroll,Pe,a,l,s,u,k,o,i,P,ye,ne,c,Be,x,Ee);Mt=wt}else me!==!1&&(zn(Pe!==void 0),Mt=u1(Pe,a,l,s,u,o,i,ye,Be,me));a1(ve,Be,o,i,k,P,T,ut,h);const Yt=Yc(ve,o,i,a,l,s,u,c,g,y,w,x,k,P,X,h),Ht=m?Bl(ve,o,i,l,s,u,Be,c,h,ye,A,ut,O,k,V,E,P):void 0;if(ve.fillStyle=h.bgCell,Mt.length>0){ve.beginPath();for(const wt of Mt)ve.rect(wt.x,wt.y,wt.width,wt.height);ve.clip(),ve.fill(),ve.beginPath()}else ve.fillRect(0,0,o,i);const kn=Bc(ve,Be,c,i,ye,s,u,l,P,ut,O,R,M,v,D,m,k,V,Mt,Re,A,K,X,te,pe,ge,ce,B,se,h,G,oe,re,I,Pt);i1(ve,Be,c,o,i,ye,s,u,l,P,ut,M,A.rows,v,k,V,Mt,Re,h),l1(ve,Be,l,s,u,o,i,Mt,ye,ut,M,T,k,P,h),Kc(ve,Be,l,s,u,o,i,Mt,kn,w,ye,ut,M,T,k,P,h),Yt?.(),Ht?.(),C&&bt!=="none"&&Ar(Be,0,s,0,ye,(wt,nn)=>wt.sourceIndex===ie?(Zc(Ve,nn+wt.width,0,ye+1,Vn(h.resizeIndicatorColor??h.accentLight,h.bgHeader)),bt==="full"&&Zc(ve,nn+wt.width,ye,i,Vn(h.resizeIndicatorColor??h.accentLight,h.bgCell)),!0):!1),qe!==null&&(qe.fillStyle=h.bgCell,qe.fillRect(0,0,o,i),qe.drawImage(ve.canvas,0,0));const ht=f1(Be,i,ye,s,u,l,P,ut,k,V);te?.setWindow({x:a,y:l,width:Be.length,height:ht-l},g,Array.from({length:k},(wt,nn)=>P-1-nn));const ft=Pe!==void 0&&(a!==Pe.cellXOffset||s!==Pe.translateX),Gt=Pe!==void 0&&(l!==Pe.cellYOffset||u!==Pe.translateY);q.current={cellXOffset:a,cellYOffset:l,translateX:s,translateY:u,mustDrawFocusOnHeader:Nt,mustDrawHighlightRingsOnHeader:mt,lastBuffer:Ee?Ne===Le?"a":"b":void 0,aBufferScroll:Ne===Le?[ft,Gt]:Pe?.aBufferScroll,bBufferScroll:Ne===nt?[ft,Gt]:Pe?.bBufferScroll},ve.restore(),Ve.restore()}const h1=80;function p1(e){const t=e-1;return t*t*t+1}class g1{callback;constructor(t){this.callback=t}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=t=>{this.leavingItems.some(n=>pi(n.item,t.item))||this.leavingItems.push(t)};removeFromLeavingItems=t=>{const n=this.leavingItems.find(r=>pi(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:p1(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const n=(t-this.lastAnimationTime)/h1;for(const o of this.leavingItems)o.hoverAmount=Bn(o.hoverAmount-n,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Bn(this.currentHoveredItem.hoverAmount+n,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=t=>{if(!pi(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 m1{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function Ks(e){return new m1(e)}const v1=Ks(()=>window.navigator.userAgent.includes("Firefox")),wa=Ks(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ya=Ks(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function b1(e){const t=d.useRef([]),n=d.useRef(0),r=d.useRef(e);r.current=e;const o=d.useCallback(()=>{const i=()=>window.requestAnimationFrame(a),a=()=>{const l=t.current.map(Us);t.current=[],r.current(new mi(l)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?i:a)},[]);return d.useCallback(i=>{t.current.length===0&&o();const a=Zn(i[0],i[1]);t.current.includes(a)||t.current.push(a)},[o])}const Ir="header",Yn="group-header",xa="out-of-bounds";var Eo;(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"})(Eo||(Eo={}));function ch(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 w1=(e,t)=>e.kind===Q.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",y1=(e,t)=>{const{width:n,height:r,accessibilityHeight:o,columns:i,cellXOffset:a,cellYOffset:l,headerHeight:s,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:f,rows:g,getCellContent:p,getRowThemeOverride:h,onHeaderMenuClick:m,onHeaderIndicatorClick:y,enableGroups:w,isFilling:v,onCanvasFocused:x,onCanvasBlur:T,isFocused:I,selection:C,freezeColumns:A,onContextMenu:E,freezeTrailingRows:k,fixedShadowX:P=!0,fixedShadowY:O=!0,drawFocusRing:R,onMouseDown:M,onMouseUp:D,onMouseMoveRaw:S,onMouseMove:K,onItemHovered:B,dragAndDropState:X,firstColAccessible:ie,onKeyDown:te,onKeyUp:q,highlightRegions:ge,canvasRef:se,onDragStart:ce,onDragEnd:pe,eventTargetRef:ue,isResizing:V,resizeColumn:L,isDragging:G,isDraggable:oe=!1,allowResize:re,disabledRows:Te,hasAppendRow:xe,getGroupDetails:Je,theme:Re,prelightCells:Pt,headerIcons:bt,verticalBorder:Ee,drawCell:ne,drawHeader:me,onCellFocused:we,onDragOverCell:ae,onDrop:ye,onDragLeave:ze,imageWindowLoader:Le,smoothScrollX:nt=!1,smoothScrollY:Pe=!1,experimental:qe,getCellRenderer:Ve,resizeIndicator:ve="full"}=e,Ne=e.translateX??0,Qe=e.translateY??0,ut=Math.max(A,Math.min(i.length-1,a)),Be=d.useRef(null),Mt=d.useRef(qe?.eventTarget??window),Nt=Mt.current,mt=Le,pt=d.useRef(),[Yt,Ht]=d.useState(!1),kn=d.useRef([]),ht=d.useRef(),[ft,Gt]=d.useState(),[wt,nn]=d.useState(),Zt=d.useRef(null),[be,tt]=d.useState(),[Ft,Tn]=d.useState(!1),qt=d.useRef(Ft);qt.current=Ft;const rn=d.useMemo(()=>new Wb(bt,()=>{cn.current=void 0,Rn.current()}),[bt]),On=w?c+s:s,on=d.useRef(-1),Ut=(qe?.enableFirefoxRescaling??!1)&&v1.value,$e=(qe?.enableSafariRescaling??!1)&&wa.value;d.useLayoutEffect(()=>{window.devicePixelRatio===1||!Ut&&!$e||(on.current!==-1&&Ht(!0),window.clearTimeout(on.current),on.current=window.setTimeout(()=>{Ht(!1),on.current=-1},200))},[l,ut,Ne,Qe,Ut,$e]);const yt=Sv(i,A),Dn=d.useMemo(()=>P?Po(yt,X):0,[yt,X,P]),xt=d.useCallback(($,ee,ke)=>{const Ie=$.getBoundingClientRect();if(ee>=yt.length||ke>=g)return;const de=Ie.width/n,he=ps(ee,ke,n,r,c,On,ut,l,Ne,Qe,g,A,k,yt,f);return de!==1&&(he.x*=de,he.y*=de,he.width*=de,he.height*=de),he.x+=Ie.x,he.y+=Ie.y,he},[n,r,c,On,ut,l,Ne,Qe,g,A,k,yt,f]),at=d.useCallback(($,ee,ke,Ie)=>{const de=$.getBoundingClientRect(),he=de.width/n,je=(ee-de.left)/he,Me=(ke-de.top)/he,Ye=5,gt=hs(yt,ut,n,void 0,Ne);let un=0,Wt=0;const Ct=typeof PointerEvent<"u"&&Ie instanceof PointerEvent&&Ie.pointerType==="mouse"||typeof MouseEvent<"u"&&Ie instanceof MouseEvent,lt=typeof PointerEvent<"u"&&Ie instanceof PointerEvent&&Ie.pointerType==="touch"||typeof TouchEvent<"u"&&Ie instanceof TouchEvent;Ct&&(un=Ie.button,Wt=Ie.buttons);const Ge=Ev(je,gt,Ne),ct=Tv(Me,r,w,s,c,g,f,l,Qe,k),$t=Ie?.shiftKey===!0,uo=Ie?.ctrlKey===!0,$r=Ie?.metaKey===!0,Qt=[je<0?-1:n<je?1:0,Me<On?-1:r<Me?1:0];let ln;if(Ge===-1||Me<0||je<0||ct===void 0||je>n||Me>r){const At=je>n?1:je<0?-1:0,_n=Me>r?1:Me<0?-1:0;let gn=At*2,pr=_n*2;At===0&&(gn=Ge===-1?Eo.EndPadding:Eo.Center),_n===0&&(pr=ct===void 0?Eo.EndPadding:Eo.Center);let gr=!1;if(Ge===-1&&ct===-1){const Jt=xt($,yt.length-1,-1);zn(Jt!==void 0),gr=ee<Jt.x+Jt.width+Ye}const st=je>n&&je<n+us()||Me>r&&Me<r+us();ln={kind:xa,location:[Ge!==-1?Ge:je<0?0:yt.length-1,ct??g-1],region:[gn,pr],shiftKey:$t,ctrlKey:uo,metaKey:$r,isEdge:gr,isTouch:lt,button:un,buttons:Wt,scrollEdge:Qt,isMaybeScrollbar:st}}else if(ct<=-1){let At=xt($,Ge,ct);zn(At!==void 0);let _n=At!==void 0&&At.x+At.width-ee<=Ye;const gn=Ge-1;ee-At.x<=Ye&&gn>=0?(_n=!0,At=xt($,gn,ct),zn(At!==void 0),ln={kind:w&&ct===-2?Yn:Ir,location:[gn,ct],bounds:At,group:yt[gn].group??"",isEdge:_n,shiftKey:$t,ctrlKey:uo,metaKey:$r,isTouch:lt,localEventX:ee-At.x,localEventY:ke-At.y,button:un,buttons:Wt,scrollEdge:Qt}):ln={kind:w&&ct===-2?Yn:Ir,group:yt[Ge].group??"",location:[Ge,ct],bounds:At,isEdge:_n,shiftKey:$t,ctrlKey:uo,metaKey:$r,isTouch:lt,localEventX:ee-At.x,localEventY:ke-At.y,button:un,buttons:Wt,scrollEdge:Qt}}else{const At=xt($,Ge,ct);zn(At!==void 0);const _n=At!==void 0&&At.x+At.width-ee<Ye;let gn=!1;if(u!==!1&&u!==void 0&&C.current!==void 0){const pr=typeof u=="object"?{...ga,...u}:ga,gr=pr.size,st=gr/2,Jt=Bf(C.current.range),rr=xt($,Jt[0],Jt[1]);if(rr!==void 0){const Di=rr.x+rr.width+pr.offsetX-st+.5,mr=rr.y+rr.height+pr.offsetY-st+.5;gn=Math.abs(Di-ee)<gr&&Math.abs(mr-ke)<gr}}ln={kind:"cell",location:[Ge,ct],bounds:At,isEdge:_n,shiftKey:$t,ctrlKey:uo,isFillHandle:gn,metaKey:$r,isTouch:lt,localEventX:ee-At.x,localEventY:ke-At.y,button:un,buttons:Wt,scrollEdge:Qt}}return ln},[n,yt,ut,Ne,r,w,s,c,g,f,l,Qe,k,xt,u,C,On]),[Sn]=ft??[],cr=d.useRef(()=>{}),Jn=d.useRef(ft);Jn.current=ft;const[N,_e]=d.useMemo(()=>{const $=document.createElement("canvas"),ee=document.createElement("canvas");return $.style.display="none",$.style.opacity="0",$.style.position="fixed",ee.style.display="none",ee.style.opacity="0",ee.style.position="fixed",[$.getContext("2d",{alpha:!1}),ee.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>{if(!(N===null||_e===null))return document.documentElement.append(N.canvas),document.documentElement.append(_e.canvas),()=>{N.canvas.remove(),_e.canvas.remove()}},[N,_e]);const We=d.useMemo(()=>new Vv,[]),It=Ut&&Yt?1:$e&&Yt?2:5,an=qe?.disableMinimumCellWidth===!0?1:10,cn=d.useRef(),Mn=d.useRef(null),fn=d.useRef(null),Bt=d.useCallback(()=>{const $=Be.current,ee=Zt.current;if($===null||ee===null||(Mn.current===null&&(Mn.current=$.getContext("2d",{alpha:!1}),$.width=0,$.height=0),fn.current===null&&(fn.current=ee.getContext("2d",{alpha:!1}),ee.width=0,ee.height=0),Mn.current===null||fn.current===null||N===null||_e===null))return;let ke=!1;const Ie=je=>{ke=!0,tt(je)},de=cn.current,he={headerCanvasCtx:fn.current,canvasCtx:Mn.current,bufferACtx:N,bufferBCtx:_e,width:n,height:r,cellXOffset:ut,cellYOffset:l,translateX:Math.round(Ne),translateY:Math.round(Qe),mappedColumns:yt,enableGroups:w,freezeColumns:A,dragAndDropState:X,theme:Re,headerHeight:s,groupHeaderHeight:c,disabledRows:Te??Xe.empty(),rowHeight:f,verticalBorder:Ee,isResizing:V,resizeCol:L,isFocused:I,selection:C,fillHandle:u,drawCellCallback:ne,hasAppendRow:xe,overrideCursor:Ie,maxScaleFactor:It,freezeTrailingRows:k,rows:g,drawFocus:R,getCellContent:p,getGroupDetails:Je??(je=>({name:je})),getRowThemeOverride:h,drawHeaderCallback:me,prelightCells:Pt,highlightRegions:ge,imageLoader:mt,lastBlitData:ht,damage:pt.current,hoverValues:kn.current,hoverInfo:Jn.current,spriteManager:rn,scrolling:Yt,hyperWrapping:qe?.hyperWrapping??!1,touchMode:Ft,enqueue:cr.current,renderStateProvider:We,renderStrategy:qe?.renderStrategy??(wa.value?"double-buffer":"single-buffer"),getCellRenderer:Ve,minimumCellWidth:an,resizeIndicator:ve};he.damage===void 0?(cn.current=he,qc(he,de)):qc(he,void 0),!ke&&(he.damage===void 0||he.damage.has(Jn?.current?.[0]))&&tt(void 0)},[N,_e,n,r,ut,l,Ne,Qe,yt,w,A,X,Re,s,c,Te,f,Ee,V,xe,L,I,C,u,k,g,R,It,p,Je,h,ne,me,Pt,ge,mt,rn,Yt,qe?.hyperWrapping,qe?.renderStrategy,Ft,We,Ve,an,ve]),Rn=d.useRef(Bt);d.useLayoutEffect(()=>{Bt(),Rn.current=Bt},[Bt]),d.useLayoutEffect(()=>{(async()=>document?.fonts?.ready!==void 0&&(await document.fonts.ready,cn.current=void 0,Rn.current()))()},[]);const hn=d.useCallback($=>{pt.current=$,Rn.current(),pt.current=void 0},[]),Lr=b1(hn);cr.current=Lr;const no=d.useCallback($=>{hn(new mi($.map(ee=>ee.cell)))},[hn]);mt.setCallback(hn);const[Lo,Ho]=d.useState(!1),[Pn,jn]=Sn??[],ro=Pn!==void 0&&jn===-1&&Pn>=0&&Pn<yt.length&&yt[Pn].headerRowMarkerDisabled!==!0,Fo=Pn!==void 0&&jn===-2;let dr=!1,oo=!1,fr=be;if(fr===void 0&&Pn!==void 0&&jn!==void 0&&jn>-1&&jn<g){const $=p([Pn,jn],!0);dr=$.kind===Wn.NewRow||$.kind===Wn.Marker&&$.markerKind!=="number",oo=$.kind===Q.Boolean&&Os($),fr=$.cursor}const Hr=G?"grabbing":(wt??!1)||V?"col-resize":Lo||v?"crosshair":fr!==void 0?fr:ro||dr||oo||Fo?"pointer":"default",wr=d.useMemo(()=>({contain:"strict",display:"block",cursor:Hr}),[Hr]),yr=d.useRef("default"),pn=ue?.current;pn!=null&&yr.current!==wr.cursor&&(pn.style.cursor=yr.current=wr.cursor);const sn=d.useCallback(($,ee,ke,Ie)=>{if(Je===void 0)return;const de=Je($);if(de.actions!==void 0){const he=ah(ee,de.actions);for(const[je,Me]of he.entries())if(Kr(Me,ke+ee.x,Ie+Me.y))return de.actions[je]}},[Je]),$n=d.useCallback(($,ee,ke,Ie)=>{const de=yt[ee];if(!G&&!V&&!(wt??!1)){const he=xt($,ee,-1);zn(he!==void 0);const je=lh(void 0,de,he.x,he.y,he.width,he.height,Re,Ls(de.title)==="rtl");if(de.hasMenu===!0&&je.menuBounds!==void 0&&Kr(je.menuBounds,ke,Ie))return{area:"menu",bounds:je.menuBounds};if(de.indicatorIcon!==void 0&&je.indicatorIconBounds!==void 0&&Kr(je.indicatorIconBounds,ke,Ie))return{area:"indicator",bounds:je.indicatorIconBounds}}},[yt,xt,wt,G,V,Re]),Ce=d.useRef(0),Et=d.useRef(),In=d.useRef(!1),Fr=d.useCallback($=>{const ee=Be.current,ke=ue?.current;if(ee===null||$.target!==ee&&$.target!==ke)return;In.current=!0;const Ie=$.clientX,de=$.clientY;if($.target===ke&&ke!==null){const je=ke.getBoundingClientRect();if(Ie>je.right||de>je.bottom)return}const he=at(ee,Ie,de,$);Et.current=he.location,he.isTouch&&(Ce.current=Date.now()),qt.current!==he.isTouch&&Tn(he.isTouch),!(he.kind===Ir&&$n(ee,he.location[0],Ie,de)!==void 0)&&(he.kind===Yn&&sn(he.group,he.bounds,he.localEventX,he.localEventY)!==void 0||(M?.(he),!he.isTouch&&oe!==!0&&oe!==he.kind&&he.button<3&&he.button!==1&&$.preventDefault()))},[ue,oe,at,sn,$n,M]);xn("pointerdown",Fr,Nt,!1);const En=d.useRef(0),er=d.useCallback($=>{const ee=En.current;En.current=Date.now();const ke=Be.current;if(In.current=!1,D===void 0||ke===null)return;const Ie=ue?.current,de=$.target!==ke&&$.target!==Ie,he=$.clientX,je=$.clientY,Me=$.pointerType==="mouse"?$.button<3:!0;let Ye=at(ke,he,je,$);Ye.isTouch&&Ce.current!==0&&Date.now()-Ce.current>500&&(Ye={...Ye,isLongTouch:!0}),ee!==0&&Date.now()-ee<(Ye.isTouch?1e3:500)&&(Ye={...Ye,isDoubleClick:!0}),qt.current!==Ye.isTouch&&Tn(Ye.isTouch),!de&&$.cancelable&&Me&&$.preventDefault();const[gt]=Ye.location,un=$n(ke,gt,he,je);if(Ye.kind===Ir&&un!==void 0){(Ye.button!==0||Et.current?.[0]!==gt||Et.current?.[1]!==-1)&&D(Ye,!0);return}else if(Ye.kind===Yn){const Wt=sn(Ye.group,Ye.bounds,Ye.localEventX,Ye.localEventY);if(Wt!==void 0){Ye.button===0&&Wt.onClick(Ye);return}}D(Ye,de)},[D,ue,at,$n,sn]);xn("pointerup",er,Nt,!1);const An=d.useCallback($=>{const ee=Be.current;if(ee===null)return;const ke=ue?.current,Ie=$.target!==ee&&$.target!==ke;let de,he,je=!0;$ instanceof MouseEvent?(de=$.clientX,he=$.clientY,je=$.button<3):(de=$.changedTouches[0].clientX,he=$.changedTouches[0].clientY);const Me=at(ee,de,he,$);qt.current!==Me.isTouch&&Tn(Me.isTouch),!Ie&&$.cancelable&&je&&$.preventDefault();const[Ye]=Me.location;if(Me.kind===Ir){const gt=$n(ee,Ye,de,he);gt!==void 0&&Me.button===0&&Et.current?.[0]===Ye&&Et.current?.[1]===-1&&(gt.area==="menu"?m?.(Ye,gt.bounds):gt.area==="indicator"&&y?.(Ye,gt.bounds))}},[ue,at,$n,m,y]);xn("click",An,Nt,!1);const io=d.useCallback($=>{const ee=Be.current,ke=ue?.current;if(ee===null||$.target!==ee&&$.target!==ke||E===void 0)return;const Ie=at(ee,$.clientX,$.clientY,$);E(Ie,()=>{$.cancelable&&$.preventDefault()})},[ue,at,E]);xn("contextmenu",io,ue?.current??null,!1);const Ei=d.useCallback($=>{pt.current=new mi($.map(ee=>ee.item)),kn.current=$,Rn.current(),pt.current=void 0},[]),zo=d.useMemo(()=>new g1(Ei),[Ei]),He=d.useRef(zo);He.current=zo,d.useLayoutEffect(()=>{const $=He.current;if(Sn===void 0||Sn[1]<0){$.setHovered(Sn);return}const ee=p(Sn,!0),ke=Ve(ee),Ie=ke===void 0&&ee.kind===Q.Custom||ke?.needsHover!==void 0&&(typeof ke.needsHover=="boolean"?ke.needsHover:ke.needsHover(ee));$.setHovered(Ie?Sn:void 0)},[p,Ve,Sn]);const Vo=d.useRef(),Va=d.useCallback($=>{const ee=Be.current;if(ee===null)return;const ke=ue?.current,Ie=$.target!==ee&&$.target!==ke,de=at(ee,$.clientX,$.clientY,$);if(de.kind!=="out-of-bounds"&&Ie&&!In.current&&!de.isTouch)return;const he=(Me,Ye)=>{Gt(gt=>gt===Me||gt?.[0][0]===Me?.[0][0]&&gt?.[0][1]===Me?.[0][1]&&(gt?.[1][0]===Me?.[1][0]&&gt?.[1][1]===Me?.[1][1]||!Ye)?gt:Me)};if(!ch(de,Vo.current))tt(void 0),B?.(de),he(de.kind===xa?void 0:[de.location,[de.localEventX,de.localEventY]],!0),Vo.current=de;else if(de.kind==="cell"||de.kind===Ir||de.kind===Yn){let Me=!1,Ye=!0;if(de.kind==="cell"){const un=p(de.location);Ye=Ve(un)?.needsHoverPosition??un.kind===Q.Custom,Me=Ye}else Me=!0;const gt=[de.location,[de.localEventX,de.localEventY]];he(gt,Ye),Jn.current=gt,Me&&hn(new mi([de.location]))}const je=de.location[0]>=(ie?0:1);nn(de.kind===Ir&&de.isEdge&&je&&re===!0),Ho(de.kind==="cell"&&de.isFillHandle),S?.($),K(de)},[ue,at,ie,re,S,K,B,p,Ve,hn]);xn("pointermove",Va,Nt,!0);const zr=d.useCallback($=>{const ee=Be.current;if(ee===null)return;let ke,Ie;C.current!==void 0&&(ke=xt(ee,C.current.cell[0],C.current.cell[1]),Ie=C.current.cell),te?.({bounds:ke,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:Ie})},[te,C,xt]),$a=d.useCallback($=>{const ee=Be.current;if(ee===null)return;let ke,Ie;C.current!==void 0&&(ke=xt(ee,C.current.cell[0],C.current.cell[1]),Ie=C.current.cell),q?.({bounds:ke,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:Ie})},[q,C,xt]),tr=d.useCallback($=>{if(Be.current=$,se!==void 0&&(se.current=$),qe?.eventTarget)Mt.current=qe.eventTarget;else if($===null)Mt.current=window;else{const ee=$.getRootNode();ee===document&&(Mt.current=window),Mt.current=ee}},[se,qe?.eventTarget]),$o=d.useCallback($=>{const ee=Be.current;if(ee===null||oe===!1||V){$.preventDefault();return}let ke,Ie;const de=at(ee,$.clientX,$.clientY);if(oe!==!0&&de.kind!==oe){$.preventDefault();return}const he=(Wt,Ct)=>{ke=Wt,Ie=Ct};let je,Me,Ye;const gt=(Wt,Ct,lt)=>{je=Wt,Me=Ct,Ye=lt};let un=!1;if(ce?.({...de,setData:he,setDragImage:gt,preventDefault:()=>un=!0,defaultPrevented:()=>un}),!un&&ke!==void 0&&Ie!==void 0&&$.dataTransfer!==null)if($.dataTransfer.setData(ke,Ie),$.dataTransfer.effectAllowed="copyLink",je!==void 0&&Me!==void 0&&Ye!==void 0)$.dataTransfer.setDragImage(je,Me,Ye);else{const[Wt,Ct]=de.location;if(Ct!==void 0){const lt=document.createElement("canvas"),Ge=xt(ee,Wt,Ct);zn(Ge!==void 0);const ct=Math.ceil(window.devicePixelRatio??1);lt.width=Ge.width*ct,lt.height=Ge.height*ct;const $t=lt.getContext("2d");$t!==null&&($t.scale(ct,ct),$t.textBaseline="middle",Ct===-1?($t.font=Re.headerFontFull,$t.fillStyle=Re.bgHeader,$t.fillRect(0,0,lt.width,lt.height),sh($t,0,0,Ge.width,Ge.height,yt[Wt],!1,Re,!1,void 0,void 0,!1,0,rn,me,!1)):($t.font=Re.baseFontFull,$t.fillStyle=Re.bgCell,$t.fillRect(0,0,lt.width,lt.height),ih($t,p([Wt,Ct]),0,Ct,!1,!1,0,0,Ge.width,Ge.height,!1,Re,Re.bgCell,mt,rn,1,void 0,!1,0,void 0,void 0,void 0,We,Ve,()=>{}))),lt.style.left="-100%",lt.style.position="absolute",lt.style.width=`${Ge.width}px`,lt.style.height=`${Ge.height}px`,document.body.append(lt),$.dataTransfer.setDragImage(lt,Ge.width/2,Ge.height/2),window.setTimeout(()=>{lt.remove()},0)}}else $.preventDefault()},[oe,V,at,ce,xt,Re,yt,rn,me,p,mt,We,Ve]);xn("dragstart",$o,ue?.current??null,!1,!1);const ao=d.useRef(),Ti=d.useCallback($=>{const ee=Be.current;if(ye!==void 0&&$.preventDefault(),ee===null||ae===void 0)return;const ke=at(ee,$.clientX,$.clientY),[Ie,de]=ke.location,he=Ie-(ie?0:1),[je,Me]=ao.current??[];(je!==he||Me!==de)&&(ao.current=[he,de],ae([he,de],$.dataTransfer))},[ie,at,ae,ye]);xn("dragover",Ti,ue?.current??null,!1,!1);const _a=d.useCallback(()=>{ao.current=void 0,pe?.()},[pe]);xn("dragend",_a,ue?.current??null,!1,!1);const Na=d.useCallback($=>{const ee=Be.current;if(ee===null||ye===void 0)return;$.preventDefault();const ke=at(ee,$.clientX,$.clientY),[Ie,de]=ke.location,he=Ie-(ie?0:1);ye([he,de],$.dataTransfer)},[ie,at,ye]);xn("drop",Na,ue?.current??null,!1,!1);const nr=d.useCallback(()=>{ze?.()},[ze]);xn("dragleave",nr,ue?.current??null,!1,!1);const hr=d.useRef(C);hr.current=C;const wn=d.useRef(null),j=d.useCallback($=>{Be.current===null||!Be.current.contains(document.activeElement)||($===null&&hr.current.current!==void 0?se?.current?.focus({preventScroll:!0}):$!==null&&$.focus({preventScroll:!0}),wn.current=$)},[se]);d.useImperativeHandle(t,()=>({focus:()=>{const $=wn.current;$===null||!document.contains($)?se?.current?.focus({preventScroll:!0}):$.focus({preventScroll:!0})},getBounds:($,ee)=>{if(!(se===void 0||se.current===null))return xt(se.current,$??0,ee??-1)},damage:no,getMouseArgsForPosition:($,ee,ke)=>{if(!(se===void 0||se.current===null))return at(se.current,$,ee,ke)}}),[se,no,xt,at]);const zt=d.useRef(),Vr=I0(()=>{if(n<50||qe?.disableAccessibilityTree===!0)return null;let $=hs(yt,ut,n,X,Ne);const ee=ie?0:-1;!ie&&$[0]?.sourceIndex===0&&($=$.slice(1));const[ke,Ie]=C.current?.cell??[],de=C.current?.range,he=$.map(Me=>Me.sourceIndex),je=Tr(l,Math.min(g,l+o));return ke!==void 0&&Ie!==void 0&&!(he.includes(ke)&&je.includes(Ie))&&j(null),d.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":yt.length+ee},d.createElement("thead",{role:"rowgroup"},d.createElement("tr",{role:"row","aria-rowindex":1},$.map(Me=>d.createElement("th",{role:"columnheader","aria-selected":C.columns.hasIndex(Me.sourceIndex),"aria-colindex":Me.sourceIndex+1+ee,tabIndex:-1,onFocus:Ye=>{if(Ye.target!==wn.current)return we?.([Me.sourceIndex,-1])},key:Me.sourceIndex},Me.title)))),d.createElement("tbody",{role:"rowgroup"},je.map(Me=>d.createElement("tr",{role:"row","aria-selected":C.rows.hasIndex(Me),key:Me,"aria-rowindex":Me+2},$.map(Ye=>{const gt=Ye.sourceIndex,un=Zn(gt,Me),Wt=ke===gt&&Ie===Me,Ct=de!==void 0&&gt>=de.x&&gt<de.x+de.width&&Me>=de.y&&Me<de.y+de.height,lt=`glide-cell-${gt}-${Me}`,Ge=[gt,Me],ct=p(Ge,!0);return d.createElement("td",{key:un,role:"gridcell","aria-colindex":gt+1+ee,"aria-selected":Ct,"aria-readonly":Ro(ct)||!So(ct),id:lt,"data-testid":lt,onClick:()=>{const $t=se?.current;if($t!=null)return te?.({bounds:xt($t,gt,Me),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Ge})},onFocusCapture:$t=>{if(!($t.target===wn.current||zt.current?.[0]===gt&&zt.current?.[1]===Me))return zt.current=Ge,we?.(Ge)},ref:Wt?j:void 0,tabIndex:-1},w1(ct,Ve))})))))},[n,yt,ut,X,Ne,g,l,o,C,j,p,se,te,xt,we],200),lo=A===0||!P?0:ut>A?1:Bn(-Ne/100,0,1),Oi=-l*32+Qe,so=O?Bn(-Oi/100,0,1):0,Ba=d.useMemo(()=>{if(!lo&&!so)return null;const $={position:"absolute",top:0,left:Dn,width:n-Dn,height:r,opacity:lo,pointerEvents:"none",transition:nt?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ee={position:"absolute",top:On,left:0,width:n,height:r,opacity:so,pointerEvents:"none",transition:Pe?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return d.createElement(d.Fragment,null,lo>0&&d.createElement("div",{id:"shadow-x",style:$}),so>0&&d.createElement("div",{id:"shadow-y",style:ee}))},[lo,so,Dn,n,nt,On,r,Pe]),Y=d.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return d.createElement(d.Fragment,null,d.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:zr,onKeyUp:$a,onFocus:x,onBlur:T,ref:tr,style:wr},Vr),d.createElement("canvas",{ref:Zt,style:Y}),Ba)},x1=d.memo(d.forwardRef(y1));function ai(e,t,n,r){return Bn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const C1=e=>{const[t,n]=d.useState(),[r,o]=d.useState(),[i,a]=d.useState(),[l,s]=d.useState(),[u,c]=d.useState(!1),[f,g]=d.useState(),[p,h]=d.useState(),[m,y]=d.useState(),[w,v]=d.useState(!1),[x,T]=d.useState(),{onHeaderMenuClick:I,onHeaderIndicatorClick:C,getCellContent:A,onColumnMoved:E,onColumnResize:k,onColumnResizeStart:P,onColumnResizeEnd:O,gridRef:R,maxColumnWidth:M,minColumnWidth:D,onRowMoved:S,lockColumns:K,onColumnProposeMove:B,onMouseDown:X,onMouseUp:ie,onItemHovered:te,onDragStart:q,canvasRef:ge}=e,se=(k??O??P)!==void 0,{columns:ce,selection:pe}=e,ue=pe.columns,V=d.useCallback(ne=>{const[me,we]=ne.location;i!==void 0&&l!==me&&me>=K?(c(!0),s(me)):p!==void 0&&we!==void 0?(v(!0),y(Math.max(0,we))):r===void 0&&!u&&!w&&te?.(ne)},[i,p,l,te,K,r,u,w]),L=E!==void 0,G=d.useCallback(ne=>{if(ne.button===0){const[me,we]=ne.location;if(ne.kind==="out-of-bounds"&&ne.isEdge&&se){const ae=R?.current?.getBounds(ce.length-1,-1);ae!==void 0&&(n(ae.x),o(ce.length-1))}else if(ne.kind==="header"&&me>=K){const ae=ge?.current;if(ne.isEdge&&se&&ae){n(ne.bounds.x),o(me);const ye=ae.getBoundingClientRect().width/ae.offsetWidth,ze=ne.bounds.width/ye;P?.(ce[me],ze,me,ze+(ce[me].growOffset??0))}else ne.kind==="header"&&L&&(g(ne.bounds.x),a(me))}else ne.kind==="cell"&&K>0&&me===0&&we!==void 0&&S!==void 0&&(T(ne.bounds.y),h(we))}X?.(ne)},[X,se,K,S,R,ce,L,P,ge]),oe=d.useCallback((ne,me)=>{u||w||I?.(ne,me)},[u,w,I]),re=d.useCallback((ne,me)=>{u||w||C?.(ne,me)},[u,w,C]),Te=d.useRef(-1),xe=d.useCallback(()=>{Te.current=-1,h(void 0),y(void 0),T(void 0),v(!1),a(void 0),s(void 0),g(void 0),c(!1),o(void 0),n(void 0)},[]),Je=d.useCallback((ne,me)=>{if(ne.button===0){if(r!==void 0){if(ue?.hasIndex(r)===!0)for(const ae of ue){if(ae===r)continue;const ye=ce[ae],ze=ai(ye,Te.current,D,M);k?.(ye,ze,ae,ze+(ye.growOffset??0))}const we=ai(ce[r],Te.current,D,M);if(O?.(ce[r],we,r,we+(ce[r].growOffset??0)),ue.hasIndex(r))for(const ae of ue){if(ae===r)continue;const ye=ce[ae],ze=ai(ye,Te.current,D,M);O?.(ye,ze,ae,ze+(ye.growOffset??0))}}xe(),i!==void 0&&l!==void 0&&B?.(i,l)!==!1&&E?.(i,l),p!==void 0&&m!==void 0&&S?.(p,m)}ie?.(ne,me)},[ie,r,i,l,p,m,ue,O,ce,D,M,k,E,S,xe,B]),Re=d.useMemo(()=>{if(!(i===void 0||l===void 0)&&i!==l&&B?.(i,l)!==!1)return{src:i,dest:l}},[i,l,B]),Pt=d.useCallback(ne=>{const me=ge?.current;if(i!==void 0&&f!==void 0)Math.abs(ne.clientX-f)>20&&c(!0);else if(p!==void 0&&x!==void 0)Math.abs(ne.clientY-x)>20&&v(!0);else if(r!==void 0&&t!==void 0&&me){const we=me.getBoundingClientRect().width/me.offsetWidth,ae=(ne.clientX-t)/we,ye=ce[r],ze=ai(ye,ae,D,M);if(k?.(ye,ze,r,ze+(ye.growOffset??0)),Te.current=ae,ue?.first()===r)for(const Le of ue){if(Le===r)continue;const nt=ce[Le],Pe=ai(nt,Te.current,D,M);k?.(nt,Pe,Le,Pe+(nt.growOffset??0))}}},[i,f,p,x,r,t,ce,D,M,k,ue,ge]),bt=d.useCallback((ne,me)=>{if(p===void 0||m===void 0)return A(ne,me);let[we,ae]=ne;return ae===m?ae=p:(ae>m&&(ae-=1),ae>=p&&(ae+=1)),A([we,ae],me)},[p,m,A]),Ee=d.useCallback(ne=>{q?.(ne),ne.defaultPrevented()||xe()},[xe,q]);return d.createElement(x1,{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:bt,isResizing:r!==void 0,onHeaderMenuClick:oe,onHeaderIndicatorClick:re,isDragging:u,onItemHovered:V,onDragStart:Ee,onMouseDown:G,allowResize:se,onMouseUp:Je,dragAndDropState:Re,onMouseMoveRaw:Pt,ref:R})};function k1(e){const t=d.useRef(null),[n,r]=d.useState({width:e?.[0],height:e?.[1]});return d.useLayoutEffect(()=>{const o=a=>{for(const l of a){const{width:s,height:u}=l&&l.contentRect||{};r(c=>c.width===s&&c.height===u?c:{width:s,height:u})}},i=new window.ResizeObserver(o);return t.current&&i.observe(t.current,void 0),()=>{i.disconnect()}},[t.current]),{ref:t,...n}}const S1=(e,t,n)=>{const r=d.useRef(null),o=d.useRef(null),i=d.useRef(null),a=d.useRef(0),l=d.useRef(t);l.current=t;const s=n.current;d.useEffect(()=>{const u=()=>{if(o.current===!1&&s!==null){const g=[s.scrollLeft,s.scrollTop];if(i.current?.[0]===g[0]&&i.current?.[1]===g[1])if(a.current>10){i.current=null,o.current=null;return}else a.current++;else a.current=0,l.current(g[0],g[1]),i.current=g;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{o.current=!0,i.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},f=g=>{g.touches.length===0&&(o.current=!1,a.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&s!==null){const g=s;return g.addEventListener("touchstart",c),g.addEventListener("touchend",f),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",f),r.current!==null&&window.clearTimeout(r.current)}}},[e,s])},M1=()=>e=>e.isSafari?"scroll":"auto",R1=dn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[M1()]}}),I1=33554400,E1=5e6;function T1(e){const[t,n]=d.useState(!1),r=typeof window>"u"?null:window,o=d.useRef(0);return xn("touchstart",d.useCallback(()=>{window.clearTimeout(o.current),n(!0)},[]),r,!0,!1),xn("touchend",d.useCallback(i=>{i.touches.length===0&&(o.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const O1=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:o,update:i,draggable:a,className:l,preventDiagonalScrolling:s=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:f,rightElementProps:g,kineticScrollPerfHack:p=!1,scrollRef:h,initialSize:m}=e,y=[],w=g?.sticky??!1,v=g?.fill??!1,x=d.useRef(0),T=d.useRef(0),I=d.useRef(null),C=typeof window>"u"?1:window.devicePixelRatio,A=d.useRef(C);d.useEffect(()=>{if(A.current!==C){x.current=0,T.current=0,A.current=C;const pe=I.current;pe!==null&&S.current(pe.scrollLeft,pe.scrollTop)}},[C]);const E=d.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),k=d.useRef(null),P=T1(200),[O,R]=d.useState(!0),M=d.useRef(0);d.useLayoutEffect(()=>{if(!O||P||E.current.lockDirection===void 0)return;const pe=I.current;if(pe===null)return;const[ue,V]=E.current.lockDirection;ue!==void 0?pe.scrollLeft=ue:V!==void 0&&(pe.scrollTop=V),E.current.lockDirection=void 0},[P,O]);const D=d.useCallback((pe,ue)=>{const V=I.current;if(V===null)return;ue=ue??V.scrollTop,pe=pe??V.scrollLeft;const L=E.current.scrollTop,G=E.current.scrollLeft,oe=pe-G,re=ue-L;P&&oe!==0&&re!==0&&(Math.abs(oe)>3||Math.abs(re)>3)&&s&&E.current.lockDirection===void 0&&(E.current.lockDirection=Math.abs(oe)<Math.abs(re)?[G,void 0]:[void 0,L]);const Te=E.current.lockDirection;pe=Te?.[0]??pe,ue=Te?.[1]??ue,E.current.scrollLeft=pe,E.current.scrollTop=ue;const xe=V.clientWidth,Je=V.clientHeight,Re=ue,Pt=T.current-Re,bt=V.scrollHeight-Je;T.current=Re;let Ee;if(bt>0&&r>V.scrollHeight+5)if(Math.abs(Pt)>2e3||Re===0||Re===bt){const ne=Math.max(0,Math.min(1,Re/bt)),me=r-Je;Ee=ne*me,x.current=Ee}else x.current-=Pt,Ee=x.current;else Ee=Re,x.current=Ee;Ee=Math.max(0,Math.min(Ee,r-Je)),x.current=Ee,Te!==void 0&&(window.clearTimeout(M.current),R(!1),M.current=window.setTimeout(()=>R(!0),200)),i({x:pe,y:Ee,width:xe-c,height:Je-u,paddingRight:k.current?.clientWidth??0})},[u,c,r,i,s,P]);S1(p&&wa.value,D,I);const S=d.useRef(D);S.current=D;const K=d.useRef(),B=d.useRef(!1);d.useLayoutEffect(()=>{B.current?D():B.current=!0},[D,u,c]);const X=d.useCallback(pe=>{I.current=pe,h!==void 0&&(h.current=pe)},[h]);let ie=0,te=0;const q=Math.min(r,I1);for(y.push(d.createElement("div",{key:ie++,style:{width:o,height:0}}));te<q;){const pe=Math.min(E1,q-te);y.push(d.createElement("div",{key:ie++,style:{width:0,height:pe}})),te+=pe}const{ref:ge,width:se,height:ce}=k1(m);return typeof window<"u"&&(K.current?.height!==ce||K.current?.width!==se)&&(window.setTimeout(()=>S.current(),0),K.current={width:se,height:ce}),(se??0)===0||(ce??0)===0?d.createElement("div",{ref:ge}):d.createElement("div",{ref:ge},d.createElement(R1,{isSafari:wa.value},d.createElement("div",{className:"dvn-underlay"},t),d.createElement("div",{ref:X,style:K.current,draggable:a,onDragStart:pe=>{a||(pe.stopPropagation(),pe.preventDefault())},className:"dvn-scroller "+(l??""),onScroll:()=>D()},d.createElement("div",{className:"dvn-scroll-inner"+(f===void 0?" dvn-hidden":"")},d.createElement("div",{className:"dvn-stack"},y),f!==void 0&&d.createElement(d.Fragment,null,!v&&d.createElement("div",{className:"dvn-spacer"}),d.createElement("div",{ref:k,style:{height:ce,maxHeight:n-Math.ceil(C%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:v?1:void 0,right:w?c??0:void 0,pointerEvents:"auto"}},f))))))},D1=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:o,groupHeaderHeight:i,enableGroups:a,freezeColumns:l,experimental:s,nonGrowWidth:u,clientSize:c,className:f,onVisibleRegionChanged:g,scrollRef:p,preventDiagonalScrolling:h,rightElement:m,rightElementProps:y,overscrollX:w,overscrollY:v,initialSize:x,smoothScrollX:T=!1,smoothScrollY:I=!1,isDraggable:C}=e,{paddingRight:A,paddingBottom:E}=s??{},[k,P]=c,O=d.useRef(),R=d.useRef(),M=d.useRef(),D=d.useRef(),S=u+Math.max(0,w??0);let K=a?o+i:o;if(typeof r=="number")K+=n*r;else for(let te=0;te<n;te++)K+=r(te);v!==void 0&&(K+=v);const B=d.useRef(),X=d.useCallback(()=>{if(B.current===void 0)return;const te={...B.current};let q=0,ge=te.x<0?-te.x:0,se=0,ce=0;te.x=te.x<0?0:te.x;let pe=0;for(let re=0;re<l;re++)pe+=t[re].width;for(const re of t){const Te=q-pe;if(te.x>=Te+re.width)q+=re.width,ce++,se++;else if(te.x>Te)q+=re.width,T?ge+=Te-te.x:ce++,se++;else if(te.x+te.width>Te)q+=re.width,se++;else break}let ue=0,V=0,L=0;if(typeof r=="number")I?(V=Math.floor(te.y/r),ue=V*r-te.y):V=Math.ceil(te.y/r),L=Math.ceil(te.height/r)+V,ue<0&&L++;else{let re=0;for(let Te=0;Te<n;Te++){const xe=r(Te),Je=re+(I?0:xe/2);if(te.y>=re+xe)re+=xe,V++,L++;else if(te.y>Je)re+=xe,I?ue+=Je-te.y:V++,L++;else if(te.y+te.height>xe/2+re)re+=xe,L++;else break}}V=Math.max(0,Math.min(V,n-1)),L=Math.max(V,Math.min(L,n));const G={x:ce,y:V,width:se-ce,height:L-V},oe=O.current;(oe===void 0||oe.y!==G.y||oe.x!==G.x||oe.height!==G.height||oe.width!==G.width||R.current!==ge||M.current!==ue||te.width!==D.current?.[0]||te.height!==D.current?.[1])&&(g?.({x:ce,y:V,width:se-ce,height:L-V},te.width,te.height,te.paddingRight??0,ge,ue),O.current=G,R.current=ge,M.current=ue,D.current=[te.width,te.height])},[t,r,n,g,l,T,I]),ie=d.useCallback(te=>{B.current=te,X()},[X]);return d.useEffect(()=>{X()},[X]),d.createElement(O1,{scrollRef:p,className:f,kineticScrollPerfHack:s?.kineticScrollPerfHack,preventDiagonalScrolling:h,draggable:C===!0||typeof C=="string",scrollWidth:S+(A??0),scrollHeight:K+(E??0),clientHeight:P,rightElement:m,paddingBottom:E,paddingRight:A,rightElementProps:y,update:ie,initialSize:x},d.createElement(C1,{eventTargetRef:p,width:k,height:P,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}))},P1=dn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),A1=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),L1=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),H1=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),F1=10,z1=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:o,searchInputRef:i,searchValue:a,searchResults:l,onSearchValueChange:s,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:f=!1,onSearchClose:g}=e,[p]=d.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[h,m]=d.useState(""),y=a??h,w=d.useCallback(q=>{m(q),s?.(q)},[s]),[v,x]=d.useState(),T=d.useRef(v);T.current=v,d.useEffect(()=>{l!==void 0&&(l.length>0?x(q=>({rowsSearched:r,results:l.length,selectedIndex:q?.selectedIndex??-1})):x(void 0))},[r,l]);const I=d.useRef();I.current===void 0&&(I.current=new AbortController);const C=d.useRef(),[A,E]=d.useState([]),k=l??A,P=d.useCallback(()=>{C.current!==void 0&&(window.cancelAnimationFrame(C.current),C.current=void 0),I.current!==void 0&&I.current.abort(),I.current=new AbortController},[]),O=d.useRef(n);O.current=n;const R=d.useCallback(q=>{const ge=new RegExp(q.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let se=O.current,ce=Math.min(10,r),pe=0;x(void 0),E([]);const ue=[],V=async()=>{if(u===void 0)return;const L=performance.now(),G=r-pe;let oe=u({x:0,y:se,width:o.length,height:Math.min(ce,G,r-se)},I.current.signal);typeof oe=="function"&&(oe=await oe());let re=!1;for(const[bt,Ee]of oe.entries())for(const[ne,me]of Ee.entries()){let we;switch(me.kind){case Q.Text:case Q.Number:we=me.displayData;break;case Q.Uri:case Q.Markdown:we=me.data;break;case Q.Boolean:we=typeof me.data=="boolean"?me.data.toString():void 0;break;case Q.Image:case Q.Bubble:we=me.data.join("🐳");break;case Q.Custom:we=me.copyData;break}we!==void 0&&ge.test(we)&&(ue.push([ne,bt+se]),re=!0)}const Te=performance.now();re&&E([...ue]),pe+=oe.length,zn(pe<=r);const xe=T.current?.selectedIndex??-1;x({results:ue.length,rowsSearched:pe,selectedIndex:xe}),c?.(ue,xe),se+ce>=r?se=0:se+=ce;const Je=Te-L,Re=Math.max(Je,1),Pt=F1/Re;ce=Math.ceil(ce*Pt),pe<r&&ue.length<1e3&&(C.current=window.requestAnimationFrame(V))};P(),C.current=window.requestAnimationFrame(V)},[P,o.length,u,c,r]),M=d.useCallback(()=>{g?.(),x(void 0),E([]),c?.([],-1),P(),t?.current?.focus()},[P,t,g,c]),D=d.useCallback(q=>{w(q.target.value),l===void 0&&(q.target.value===""?(x(void 0),E([]),P()):R(q.target.value))},[R,P,w,l]);d.useEffect(()=>{i.current!==null&&(w(""),x(void 0),A.length>0&&(E([]),c?.([],-1)),f?i.current.focus({preventScroll:!0}):P())},[f,i]);const S=d.useCallback(q=>{if(q?.stopPropagation?.(),v===void 0||v.results===0)return;const ge=(v.selectedIndex+1)%v.results;x({...v,selectedIndex:ge}),c?.(k,ge)},[v,c,k]),K=d.useCallback(q=>{if(q?.stopPropagation?.(),v===void 0||v.results===0)return;let ge=(v.selectedIndex-1)%v.results;ge<0&&(ge+=v.results),x({...v,selectedIndex:ge}),c?.(k,ge)},[c,k,v]),B=d.useCallback(q=>{(q.ctrlKey||q.metaKey)&&q.nativeEvent.code==="KeyF"||q.key==="Escape"?(M(),q.stopPropagation(),q.preventDefault()):q.key==="Enter"&&(q.shiftKey?K():S())},[M,S,K]);d.useEffect(()=>()=>{P()},[P]);const[X,ie]=d.useState(!1);d.useEffect(()=>{if(f)ie(!0);else{const q=setTimeout(()=>ie(!1),150);return()=>clearTimeout(q)}},[f]);const te=d.useMemo(()=>{if(!f&&!X)return null;let q;v!==void 0&&(q=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(q=`${v.selectedIndex+1} of ${q}`));const ge=ce=>{ce.stopPropagation()},se={width:`${r>0?Math.floor((v?.rowsSearched??0)/r*100):0}%`};return d.createElement(P1,{className:"gdg-search-bar"+(f?"":" out"),onMouseDown:ge,onMouseMove:ge,onMouseUp:ge,onClick:ge},d.createElement("div",{className:"gdg-search-bar-inner"},d.createElement("input",{id:p,"aria-hidden":!f,"data-testid":"search-input",ref:i,onChange:D,value:y,tabIndex:f?void 0:-1,onKeyDownCapture:B}),d.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!f,tabIndex:f?void 0:-1,onClick:K,disabled:(v?.results??0)===0},A1),d.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!f,tabIndex:f?void 0:-1,onClick:S,disabled:(v?.results??0)===0},L1),g!==void 0&&d.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!f,"data-testid":"search-close-button",tabIndex:f?void 0:-1,onClick:M},H1)),v!==void 0?d.createElement(d.Fragment,null,d.createElement("div",{className:"gdg-search-status"},d.createElement("div",{"data-testid":"search-result-area"},q)),d.createElement("div",{className:"gdg-search-progress",style:se})):d.createElement("div",{className:"gdg-search-status"},d.createElement("label",{htmlFor:p},"Type to search")))},[f,X,v,r,p,i,D,y,B,K,S,g,M]);return d.createElement(d.Fragment,null,d.createElement(D1,{prelightCells:k,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),te)};class V1 extends d.PureComponent{wrapperRef=d.createRef();componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("pointerdown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("pointerdown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}clickOutside=t=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}};render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...o}=this.props;return d.createElement("div",{...o,ref:this.wrapperRef},this.props.children)}}const $1=()=>e=>Math.max(16,e.targetHeight-10),_1=dn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[$1(),"px"]}}),N1=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:o,onFinish:i}=e,[a,l]=St.useState(n);return St.createElement(V1,{style:{position:"absolute",left:t.x-o.left+1,top:t.y-o.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},St.createElement(_1,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:r,onFocus:s=>s.target.setSelectionRange(0,a.length),onChange:s=>l(s.target.value),onKeyDown:s=>{s.key==="Enter"?i(a):s.key==="Escape"&&r()},autoFocus:!0}))};function B1(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 ot(e,t,n){const r=dh(e,t);return r&&(n.didMatch=!0),r}function dh(e,t){if(e.length===0)return!1;if(e.includes("|")){const s=e.split("|");for(const u of s)if(dh(u,t))return!0;return!1}let n=!1,r=!1,o=!1,i=!1;const a=e.split("+"),l=a.pop();if(!B1(l,t))return!1;if(a[0]==="any")return!0;for(const s of a)switch(s){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":o=!0;break;case"meta":i=!0;break;case"primary":ya.value?i=!0:n=!0;break}return t.altKey===o&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===i}function W1(e,t,n,r,o,i,a){const l=St.useCallback((c,f,g,p)=>{(i==="cell"||i==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!a&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const h=n==="mixed"&&(g||p==="drag")||n==="additive",m=(r==="mixed"||r==="additive")&&h,y=(o==="mixed"||o==="additive")&&h;let w={current:c===void 0?void 0:{...c,rangeStack:p==="drag"?e.current?.rangeStack??[]:[]},columns:m?e.columns:Xe.empty(),rows:y?e.rows:Xe.empty()};g&&(i==="multi-rect"||i==="multi-cell")&&w.current!==void 0&&e.current!==void 0&&(w={...w,current:{...w.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(w,f)},[r,e,n,i,a,o,t]),s=St.useCallback((c,f,g)=>{c=c??e.rows,f!==void 0&&(c=c.add(f));let p;if(o==="exclusive"&&c.length>0)p={current:void 0,columns:Xe.empty(),rows:c};else{const h=g&&n==="mixed"||n==="additive",m=g&&r==="mixed"||r==="additive";p={current:h?e.current:void 0,columns:m?e.columns:Xe.empty(),rows:c}}t(p,!1)},[r,e,n,o,t]),u=St.useCallback((c,f,g)=>{c=c??e.columns,f!==void 0&&(c=c.add(f));let p;if(r==="exclusive"&&c.length>0)p={current:void 0,rows:Xe.empty(),columns:c};else{const h=g&&n==="mixed"||n==="additive",m=g&&o==="mixed"||o==="additive";p={current:h?e.current:void 0,rows:m?e.rows:Xe.empty(),columns:c}}t(p,!1)},[r,e,n,o,t]);return[l,s,u]}function j1(e,t,n,r,o){const i=d.useCallback(s=>{if(e===!0){const u=[];for(let c=s.y;c<s.y+s.height;c++){const f=[];for(let g=s.x;g<s.x+s.width;g++)g<0||c>=o?f.push({kind:Q.Loading,allowOverlay:!1}):f.push(t([g,c]));u.push(f)}return u}return e?.(s,r.signal)??[]},[r.signal,t,e,o]),a=e!==void 0?i:void 0,l=d.useCallback(s=>{if(a===void 0)return[];const u={...s,x:s.x-n};if(u.x<0){u.x=0,u.width--;const c=a(u,r.signal);return typeof c=="function"?async()=>(await c()).map(f=>[{kind:Q.Loading,allowOverlay:!1},...f]):c.map(f=>[{kind:Q.Loading,allowOverlay:!1},...f])}return a(u,r.signal)},[r.signal,a,n]);return[e!==void 0?l:void 0,a]}function G1(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case Q.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===Ts?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Q.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Q.Image:case Q.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Q.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Q.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Q.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Q.Markdown:case Q.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Q.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Q.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Q.Protected:return{formatted:"************",rawValue:"",format:"string"};default:vi()}}function U1(e,t){return e.map((n,r)=>{const o=t[r];return n.map(i=>i.span!==void 0&&i.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:G1(i))})}function Qc(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function X1(e){const t=[];for(const n of e){const r=[];for(const o of n)o.format==="url"?r.push(o.rawValue?.toString()??""):o.format==="string-array"?r.push(o.formatted.map(i=>Qc(i,!0)).join(",")):r.push(o.doNotEscape===!0?o.formatted:Qc(o.formatted,!1));t.push(r.join(" "))}return t.join(`
176
+ `)}function Wl(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Jc(e){return'"'+e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'}function K1(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function Y1(e){const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const n of e){t.push("<tr>");for(const r of n){const o=`gdg-format="${r.format}"`;r.format==="url"?t.push(`<td ${o}><a href="${r.rawValue}">${Wl(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${o}><ol>${r.formatted.map((i,a)=>`<li gdg-raw-value=${Jc(r.rawValue[a])}>`+Wl(i)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${Jc(r.rawValue?.toString()??"")} ${o}>${Wl(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function Z1(e,t){const n=U1(e,t),r=X1(n),o=Y1(n);return{textPlain:r,textHtml:o}}function ed(e){const t=document.createElement("html");t.innerHTML=e.replace(/&nbsp;/g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],o=[];let i;for(;r.length>0;){const a=r.pop();if(a===void 0)break;if(a instanceof HTMLTableElement||a.nodeName==="TBODY")r.push(...[...a.children].reverse());else if(a instanceof HTMLTableRowElement)i!==void 0&&o.push(i),i=[],r.push(...[...a.children].reverse());else if(a instanceof HTMLTableCellElement){const l=a.cloneNode(!0),s=l.children.length===1&&l.children[0].nodeName==="P"?l.children[0]:null,u=s?.children.length===1&&s.children[0].nodeName==="FONT",c=l.querySelectorAll("br");for(const p of c)p.replaceWith(`
177
+ `);const f=l.getAttribute("gdg-raw-value"),g=l.getAttribute("gdg-format")??"string";if(l.querySelector("a")!==null)i?.push({rawValue:l.querySelector("a")?.getAttribute("href")??"",formatted:l.textContent??"",format:g});else if(l.querySelector("ol")!==null){const p=l.querySelectorAll("li");i?.push({rawValue:[...p].map(h=>h.getAttribute("gdg-raw-value")??""),formatted:[...p].map(h=>h.textContent??""),format:"string-array"})}else if(f!==null)i?.push({rawValue:K1(f),formatted:l.textContent??"",format:g});else{let p=l.textContent??"";u&&(p=p.replace(/\n(?!\n)/g,"")),i?.push({rawValue:p??"",formatted:p??"",format:g})}}}return i!==void 0&&o.push(i),o}function q1(e,t,n,r,o){const i=e;if(r==="allowPartial"||e.current===void 0||t===void 0)return e;let a=!1;do{if(e?.current===void 0)break;const l=e.current?.range,s=[];if(l.width>2){const f=t({x:l.x,y:l.y,width:1,height:l.height},o.signal);if(typeof f=="function")return i;s.push(...f);const g=t({x:l.x+l.width-1,y:l.y,width:1,height:l.height},o.signal);if(typeof g=="function")return i;s.push(...g)}else{const f=t({x:l.x,y:l.y,width:l.width,height:l.height},o.signal);if(typeof f=="function")return i;s.push(...f)}let u=l.x-n,c=l.x+l.width-1-n;for(const f of s)for(const g of f)g.span!==void 0&&(u=Math.min(g.span[0],u),c=Math.max(g.span[1],c));u===l.x-n&&c===l.x+l.width-1-n?a=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:l.y,width:c-u+1,height:l.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function td(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function Q1(e){let t;(function(l){l[l.None=0]="None",l[l.inString=1]="inString",l[l.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],o=0,i=t.None;e=e.replace(/\r\n/g,`
178
+ `);let a=0;for(const l of e){switch(i){case t.None:l===" "||l===`
179
+ `?(r.push(e.slice(o,a)),o=a+1,l===`
180
+ `&&(n.push(r),r=[])):l==='"'&&(i=t.inString);break;case t.inString:l==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:l==='"'?i=t.inString:((l===" "||l===`
181
+ `)&&(r.push(td(e.slice(o,a))),o=a+1,l===`
182
+ `&&(n.push(r),r=[])),i=t.None);break}a++}return o<e.length&&r.push(td(e.slice(o,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function nd(e,t,n){const r=Z1(e,t),o=l=>{window.navigator.clipboard?.writeText(l)},i=(l,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([l],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),a=(l,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",l),n?.clipboardData?.setData("text/html",s)}catch{i(l,s)||o(l)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?a(r.textPlain,r.textHtml):o(r.textPlain),n?.preventDefault()}function fh(e){return e!==!0}function rd(e){return typeof e=="string"?e:`${e}px`}const J1=()=>e=>e.innerWidth,ew=()=>e=>e.innerHeight,tw=dn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[J1()],"wmyidgi-1":[ew()]}}),nw=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(tw,{innerHeight:rd(n),innerWidth:rd(t),...o},r)},rw=2,ow=1300;function iw(e,t,n){const r=St.useRef(0),[o,i]=e??[0,0];St.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let a=!1,l=0;const s=u=>{if(!a){if(l===0)l=u;else{const c=u-l;r.current=Math.min(1,r.current+c/ow);const f=r.current**1.618*c*rw;t.current?.scrollBy(o*f,i*f),l=u,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,o,i,n])}function aw({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:a,remSize:l}){const[s,u,c,f,g,p]=St.useMemo(()=>{if(!a||l===16)return[e,t,n,r,o,i];const h=l/16,m=e,y=Zf();return[typeof m=="number"?m*h:w=>Math.ceil(m(w)*h),Math.ceil(t*h),Math.ceil(n*h),{...r,headerIconSize:(r?.headerIconSize??y.headerIconSize)*h,cellHorizontalPadding:(r?.cellHorizontalPadding??y.cellHorizontalPadding)*h,cellVerticalPadding:(r?.cellVerticalPadding??y.cellVerticalPadding)*h},Math.ceil((o??0)*h),Math.ceil((i??0)*h)]},[n,t,o,i,l,e,a,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:f,overscrollX:g,overscrollY:p}}const Mr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function it(e,t){return e===!0?t:e===!1?"":e}function od(e){const t=ya.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 lw(e){const t=P0(e);return St.useMemo(()=>{if(t===void 0)return od(Mr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??Mr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??Mr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??Mr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??Mr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??Mr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??Mr.selectToLastCell};return od({...Mr,...n})},[t])}function sw(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((a,l)=>t(a,r+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function Ys(e,t){const n=[];function r(l,s,u=!1){let c=s!==null?s-l.headerIndex:t-l.headerIndex;if(l.subGroups!==void 0&&(c=l.subGroups[0].headerIndex-l.headerIndex),c--,n.push({rowIndex:-1,headerIndex:l.headerIndex,contentIndex:-1,skip:u,isCollapsed:l.isCollapsed,depth:l.depth,path:l.path,rows:c}),l.subGroups)for(let f=0;f<l.subGroups.length;f++){const g=f<l.subGroups.length-1?l.subGroups[f+1].headerIndex:s;r(l.subGroups[f],g,u||l.isCollapsed)}}const o=sw(e.groups);for(let l=0;l<o.length;l++){const s=l<o.length-1?o[l+1].headerIndex:null;r(o[l],s)}let i=0,a=0;for(const l of n)l.contentIndex=a,a+=l.rows,l.rowIndex=i,i+=l.isCollapsed?1:l.rows+1;return n.filter(l=>l.skip===!1).map(l=>{const{skip:s,...u}=l;return u})}function vs(e,t){if(t===void 0||Ys.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 uw(e,t,n,r){const o=St.useMemo(()=>e===void 0?void 0:Ys(e,t),[e,t]),i=St.useMemo(()=>o?.reduce((c,f)=>(c[f.rowIndex]=f,c),{}),[o]),a=St.useMemo(()=>o===void 0?t:o.reduce((c,f)=>c+(f.isCollapsed?1:f.rows+1),0),[o,t]),l=St.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>i?.[c]?e.height:typeof n=="number"?n:n(c),[i,e,n]),s=St.useCallback(c=>{if(o===void 0)return c;let f=c;for(const g of o){if(f===0)return;if(f--,!g.isCollapsed){if(f<g.rows)return g.contentIndex+f;f-=g.rows}}return c},[o]),u=Rr(r??e?.themeOverride,St.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:f,contentIndex:g,groupIndex:p}=vs(c,o);return f?e.themeOverride:r?.(c,p,g)},[o,r,e]));return e===void 0?{rowHeight:l,rows:t,rowNumberMapper:s,getRowThemeOverride:u}:{rowHeight:l,rows:a,rowNumberMapper:s,getRowThemeOverride:u}}function cw(e,t){const n=St.useMemo(()=>e===void 0?void 0:Ys(e,t),[e,t]);return{getRowGroupingForPath:ph,updateRowGroupingByPath:hh,mapper:St.useCallback(r=>{if(typeof r=="number")return vs(r,n);const o=vs(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function hh(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,a)=>a===r?{...i,...n}:i):e.map((i,a)=>a===r?{...i,subGroups:hh(i.subGroups??[],o,n)}:i)}function ph(e,t){const[n,...r]=t;return r[0]===-1?e[n]:ph(e[n].subGroups??[],r)}function dw(e,t){const[n]=d.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}));return n.callback=t,n.facade}function fw(e,t,n,r,o){const[i,a]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,i]),[s,u,c]=D0(l),f=d.useRef(o);f.current=o;const g=dw(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),p=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&p){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),f.current()}},[t,p,c,g]);const h=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&h){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),f.current()}},[e,h,c,g]),{visibleRegion:s,setVisibleRegion:u,scrollRef:g}}const hw=d.lazy(async()=>await Rs(()=>import("./data-grid-overlay-editor-D7_bQukB-DqAp5wnt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])));let pw=0;function gw(e){return nb(Fc(Fc(e).filter(t=>t.span!==void 0).map(t=>Tr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Zi(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 qi={kind:Q.Loading,allowOverlay:!1},Qi={columns:Xe.empty(),rows:Xe.empty(),current:void 0},mw=(e,t)=>{const[n,r]=d.useState(Qi),[o,i]=d.useState(),a=d.useRef(null),l=d.useRef(null),[s,u]=d.useState(),c=d.useRef(),f=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:p,markdownDivCreateNode:h,width:m,height:y,columns:w,rows:v,getCellContent:x,onCellClicked:T,onCellActivated:I,onFillPattern:C,onFinishedEditing:A,coercePasteValue:E,drawHeader:k,drawCell:P,editorBloom:O,onHeaderClicked:R,onColumnProposeMove:M,rangeSelectionColumnSpanning:D=!0,spanRangeBehavior:S="default",onGroupHeaderClicked:K,onCellContextMenu:B,className:X,onHeaderContextMenu:ie,getCellsForSelection:te,onGroupHeaderContextMenu:q,onGroupHeaderRenamed:ge,onCellEdited:se,onCellsEdited:ce,onSearchResultsChanged:pe,searchResults:ue,onSearchValueChange:V,searchValue:L,onKeyDown:G,onKeyUp:oe,keybindings:re,editOnType:Te=!0,onRowAppended:xe,onColumnAppended:Je,onColumnMoved:Re,validateCell:Pt,highlightRegions:bt,rangeSelect:Ee="rect",columnSelect:ne="multi",rowSelect:me="multi",rangeSelectionBlending:we="exclusive",columnSelectionBlending:ae="exclusive",rowSelectionBlending:ye="exclusive",onDelete:ze,onDragStart:Le,onMouseMove:nt,onPaste:Pe,copyHeaders:qe=!1,freezeColumns:Ve=0,cellActivationBehavior:ve="second-click",rowSelectionMode:Ne="auto",columnSelectionMode:Qe="auto",onHeaderMenuClick:ut,onHeaderIndicatorClick:Be,getGroupDetails:Mt,rowGrouping:Nt,onSearchClose:mt,onItemHovered:pt,onSelectionCleared:Yt,showSearch:Ht,onVisibleRegionChanged:kn,gridSelection:ht,onGridSelectionChange:ft,minColumnWidth:Gt=50,maxColumnWidth:wt=500,maxColumnAutoWidth:nn,provideEditor:Zt,trailingRowOptions:be,freezeTrailingRows:tt=0,allowedFillDirections:Ft="orthogonal",scrollOffsetX:Tn,scrollOffsetY:qt,verticalBorder:rn,onDragOverCell:On,onDrop:on,onColumnResize:Ut,onColumnResizeEnd:$e,onColumnResizeStart:yt,customRenderers:Dn,fillHandle:xt,experimental:at,fixedShadowX:Sn,fixedShadowY:cr,headerIcons:Jn,imageWindowLoader:N,initialSize:_e,isDraggable:We,onDragLeave:It,onRowMoved:an,overscrollX:cn,overscrollY:Mn,preventDiagonalScrolling:fn,rightElement:Bt,rightElementProps:Rn,trapFocus:hn=!1,smoothScrollX:Lr,smoothScrollY:no,scaleToRem:Lo=!1,rowHeight:Ho=34,headerHeight:Pn=36,groupHeaderHeight:jn=Pn,theme:ro,isOutsideClick:Fo,renderers:dr,resizeIndicator:oo,scrollToActiveCell:fr=!0,drawFocusRing:Hr=!0,portalElementRef:wr}=e,yr=Hr==="no-editor"?o===void 0:Hr,pn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,sn=pn?.kind??e.rowMarkers??"none",$n=pn?.width??e.rowMarkerWidth,Ce=pn?.startIndex??e.rowMarkerStartIndex??1,Et=pn?.theme??e.rowMarkerTheme,In=pn?.headerTheme,Fr=pn?.headerAlwaysVisible,En=me!=="multi"||pn?.headerDisabled===!0,er=pn?.checkboxStyle??"square",An=Math.max(Gt,20),io=Math.max(wt,An),Ei=Math.max(nn??io,An),zo=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:He,rowNumberMapper:Vo,rowHeight:Va,getRowThemeOverride:zr}=uw(Nt,v,Ho,p),$a=d.useMemo(()=>Number.parseFloat(zo.fontSize),[zo]),{rowHeight:tr,headerHeight:$o,groupHeaderHeight:ao,theme:Ti,overscrollX:_a,overscrollY:Na}=aw({groupHeaderHeight:jn,headerHeight:Pn,overscrollX:cn,overscrollY:Mn,remSize:$a,rowHeight:Va,scaleToRem:Lo,theme:ro}),nr=lw(re),hr=$n??(v>1e4?48:v>1e3?44:v>100?36:32),wn=sn!=="none",j=wn?1:0,zt=be!==void 0,Vr=be?.sticky===!0,[lo,Oi]=d.useState(!1),so=Ht??lo,Ba=d.useCallback(()=>{mt!==void 0?mt():Oi(!1)},[mt]),Y=d.useMemo(()=>ht===void 0?void 0:Zi(ht,j),[ht,j])??n,$=d.useRef();$.current===void 0&&($.current=new AbortController),d.useEffect(()=>()=>$?.current.abort(),[]);const[ee,ke]=j1(te,x,j,$.current,He),Ie=d.useCallback((b,H,F)=>{if(Pt===void 0)return!0;const _=[b[0]-j,b[1]];return Pt?.(_,H,F)},[j,Pt]),de=d.useRef(ht),he=d.useCallback((b,H)=>{H&&(b=q1(b,ee,j,S,$.current)),ft!==void 0?(de.current=Zi(b,-j),ft(de.current)):r(b)},[ft,ee,j,S]),je=Rr(Ut,d.useCallback((b,H,F,_)=>{Ut?.(w[F-j],H,F-j,_)},[Ut,j,w])),Me=Rr($e,d.useCallback((b,H,F,_)=>{$e?.(w[F-j],H,F-j,_)},[$e,j,w])),Ye=Rr(yt,d.useCallback((b,H,F,_)=>{yt?.(w[F-j],H,F-j,_)},[yt,j,w])),gt=Rr(k,d.useCallback((b,H)=>k?.({...b,columnIndex:b.columnIndex-j},H)??!1,[k,j])),un=Rr(P,d.useCallback((b,H)=>P?.({...b,col:b.col-j},H)??!1,[P,j])),Wt=d.useCallback(b=>{if(ze!==void 0){const H=ze(Zi(b,-j));return typeof H=="boolean"?H:Zi(H,j)}return!0},[ze,j]),[Ct,lt,Ge]=W1(Y,he,we,ae,ye,Ee,D),ct=d.useMemo(()=>br(Zf(),Ti),[Ti]),[$t,uo]=d.useState([0,0,0]),$r=d.useMemo(()=>{if(dr===void 0)return{};const b={};for(const H of dr)b[H.kind]=H;return b},[dr]),Qt=d.useCallback(b=>b.kind!==Q.Custom?$r[b.kind]:Dn?.find(H=>H.isMatch(b)),[Dn,$r]);let{sizedColumns:ln,nonGrowWidth:At}=Nv(w,He,ke,$t[0]-(j===0?0:hr)-$t[2],An,Ei,ct,Qt,$.current);sn!=="none"&&(At+=hr);const _n=d.useMemo(()=>ln.some(b=>b.group!==void 0),[ln]),gn=_n?$o+ao:$o,pr=Y.rows.length,gr=sn==="none"?void 0:pr===0?!1:pr===He?!0:void 0,st=d.useMemo(()=>sn==="none"?ln:[{title:"",width:hr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Et,rowMarker:er,rowMarkerChecked:gr,headerRowMarkerTheme:In,headerRowMarkerAlwaysVisible:Fr,headerRowMarkerDisabled:En},...ln],[sn,ln,hr,Et,er,gr,In,Fr,En]),Jt=d.useRef({height:1,width:1,x:0,y:0}),rr=d.useRef(!1),{setVisibleRegion:Di,visibleRegion:mr,scrollRef:_t}=fw(Tn,qt,tr,Jt,()=>rr.current=!0);Jt.current=mr;const Mp=mr.x+j,Pi=mr.y,mn=d.useRef(null),yn=d.useCallback(b=>{b===!0?mn.current?.focus():window.requestAnimationFrame(()=>{mn.current?.focus()})},[]),vn=zt?He+1:He,Nn=d.useCallback(b=>{const H=j===0?b:b.map(_=>({..._,location:[_.location[0]-j,_.location[1]]})),F=ce?.(H);if(F!==!0)for(const _ of H)se?.(_.location,_.value);return F},[se,ce,j]),[_r,Wa]=d.useState(),Ai=Y.current!==void 0&&Y.current.range.width*Y.current.range.height>1?Y.current.range:void 0,wu=yr?Y.current?.cell:void 0,Li=wu?.[0],Hi=wu?.[1],Rp=d.useMemo(()=>{if((bt===void 0||bt.length===0)&&(Ai??Li??Hi??_r)===void 0)return;const b=[];if(bt!==void 0)for(const H of bt){const F=st.length-H.range.x-j;F>0&&b.push({color:H.color,range:{...H.range,x:H.range.x+j,width:Math.min(F,H.range.width)},style:H.style})}return _r!==void 0&&b.push({color:qr(ct.accentColor,0),range:_r,style:"dashed"}),Ai!==void 0&&b.push({color:qr(ct.accentColor,.5),range:Ai,style:"solid-outline"}),Li!==void 0&&Hi!==void 0&&b.push({color:ct.accentColor,range:{x:Li,y:Hi,width:1,height:1},style:"solid-outline"}),b.length>0?b:void 0},[_r,Ai,Li,Hi,bt,st.length,ct.accentColor,j]),yu=d.useRef(st);yu.current=st;const Ln=d.useCallback(([b,H],F=!1)=>{const _=zt&&H===vn-1;if(b===0&&wn){if(_)return qi;const W=Vo(H);return W===void 0?qi:{kind:Wn.Marker,allowOverlay:!1,checkboxStyle:er,checked:Y?.rows.hasIndex(H)===!0,markerKind:sn==="clickable-number"?"number":sn,row:Ce+W,drawHandle:an!==void 0,cursor:sn==="clickable-number"?"pointer":void 0}}else if(_){const W=b===j?be?.hint??"":"",Z=yu.current[b];if(Z?.trailingRowOptions?.disabled===!0)return qi;{const z=Z?.trailingRowOptions?.hint??W,U=Z?.trailingRowOptions?.addIcon??be?.addIcon;return{kind:Wn.NewRow,hint:z,allowOverlay:!1,icon:U}}}else{const W=b-j;if(F||at?.strict===!0){const z=Jt.current,U=z.x>W||W>z.x+z.width||z.y>H||H>z.y+z.height||H>=Xa.current,J=W===z.extras?.selected?.[0]&&H===z.extras?.selected[1];let le=!1;if(z.extras?.freezeRegions!==void 0){for(const Oe of z.extras.freezeRegions)if(Kr(Oe,W,H)){le=!0;break}}if(U&&!J&&!le)return qi}let Z=x([W,H]);return j!==0&&Z.span!==void 0&&(Z={...Z,span:[Z.span[0]+j,Z.span[1]+j]}),Z}},[zt,vn,wn,Vo,er,Y?.rows,sn,Ce,an,j,be?.hint,be?.addIcon,at?.strict,x]),ja=d.useCallback(b=>{let H=Mt?.(b)??{name:b};return ge!==void 0&&b!==""&&(H={icon:H.icon,name:H.name,overrideTheme:H.overrideTheme,actions:[...H.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>Ya({group:H.name,bounds:F.bounds})}]}),H},[Mt,ge]),Fi=d.useCallback(b=>{const[H,F]=b.cell,_=st[H],W=_?.group!==void 0?ja(_.group)?.overrideTheme:void 0,Z=_?.themeOverride,z=zr?.(F);i({...b,theme:br(ct,W,Z,z,b.content.themeOverride)})},[zr,st,ja,ct]),co=d.useCallback((b,H,F)=>{if(Y.current===void 0)return;const[_,W]=Y.current.cell,Z=Ln([_,W]);if(Z.kind!==Q.Boolean&&Z.allowOverlay){let z=Z;if(F!==void 0)switch(z.kind){case Q.Number:{const U=r0(()=>F==="-"?-0:Number.parseFloat(F),0);z={...z,data:Number.isNaN(U)?0:U};break}case Q.Text:case Q.Markdown:case Q.Uri:z={...z,data:F};break}Fi({target:b,content:z,initialValue:F,cell:[_,W],highlight:F===void 0,forceEditMode:F!==void 0,activation:H})}else Z.kind===Q.Boolean&&H.inputType==="keyboard"&&Z.readonly!==!0&&(Nn([{location:Y.current.cell,value:{...Z,data:fh(Z.data)}}]),mn.current?.damage([{cell:Y.current.cell}]))},[Ln,Y,Nn,Fi]),xu=d.useCallback((b,H)=>{const F=mn.current?.getBounds(b,H);if(F===void 0||_t.current===null)return;const _=Ln([b,H]);_.allowOverlay&&Fi({target:F,content:_,initialValue:void 0,highlight:!0,cell:[b,H],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Ln,_t,Fi]),jt=d.useCallback((b,H,F="both",_=0,W=0,Z=void 0)=>{if(_t.current!==null){const z=mn.current,U=l.current,J=typeof b!="number"?b.unit==="cell"?b.amount:void 0:b,le=typeof H!="number"?H.unit==="cell"?H.amount:void 0:H,Oe=typeof b!="number"&&b.unit==="px"?b.amount:void 0,Tt=typeof H!="number"&&H.unit==="px"?H.amount:void 0;if(z!==null&&U!==null){let Ze={x:0,y:0,width:0,height:0},Ue=0,Ke=0;if((J!==void 0||le!==void 0)&&(Ze=z.getBounds((J??0)+j,le??0)??Ze,Ze.width===0||Ze.height===0))return;const rt=U.getBoundingClientRect(),vt=rt.width/U.offsetWidth;if(Oe!==void 0&&(Ze={...Ze,x:Oe-rt.left-_t.current.scrollLeft,width:1}),Tt!==void 0&&(Ze={...Ze,y:Tt+rt.top-_t.current.scrollTop,height:1}),Ze!==void 0){const en={x:Ze.x-_,y:Ze.y-W,width:Ze.width+2*_,height:Ze.height+2*W};let vo=0;for(let nl=0;nl<Ve;nl++)vo+=ln[nl].width;let Wi=0;const Uo=tt+(Vr?1:0);Uo>0&&(Wi=to(vn,Uo,tr));let ir=vo*vt+rt.left+j*hr*vt,bo=rt.right,jr=rt.top+gn*vt,wo=rt.bottom-Wi*vt;const ji=Ze.width+_*2;switch(Z?.hAlign){case"start":bo=ir+ji;break;case"end":ir=bo-ji;break;case"center":ir=Math.floor((ir+bo)/2)-ji/2,bo=ir+ji;break}const Gi=Ze.height+W*2;switch(Z?.vAlign){case"start":wo=jr+Gi;break;case"end":jr=wo-Gi;break;case"center":jr=Math.floor((jr+wo)/2)-Gi/2,wo=jr+Gi;break}ir>en.x?Ue=en.x-ir:bo<en.x+en.width&&(Ue=en.x+en.width-bo),jr>en.y?Ke=en.y-jr:wo<en.y+en.height&&(Ke=en.y+en.height-wo),F==="vertical"||typeof b=="number"&&b<Ve?Ue=0:(F==="horizontal"||typeof H=="number"&&H>=vn-Uo)&&(Ke=0),(Ue!==0||Ke!==0)&&(vt!==1&&(Ue/=vt,Ke/=vt),_t.current.scrollTo({left:Ue+_t.current.scrollLeft,top:Ke+_t.current.scrollTop,behavior:Z?.behavior??"auto"}))}}}},[j,tt,hr,_t,gn,Ve,ln,vn,Vr,tr]),Ga=d.useRef(xu),Ua=d.useRef(x);Ga.current=xu,Ua.current=x;const Xa=d.useRef(He);Xa.current=He;const Cu=d.useRef(st.length);Cu.current=st.length;const xr=d.useCallback(async(b,H=!0,F)=>{if(st[b]?.trailingRowOptions?.disabled===!0)return;const _=xe?.();let W,Z=!0;_!==void 0&&(W=await _,W==="top"&&(Z=!1),typeof W=="number"&&(Z=!1));let z=0;const U=()=>{if(Xa.current<=He){z<500&&window.setTimeout(U,z),z=50+z*2;return}const J=typeof W=="number"?W:Z?He:0;Bi.current(b-j,J,"both",0,0,F?{behavior:F}:void 0),Ct({cell:[b,J],range:{x:b,y:J,width:1,height:1}},!1,!1,"edit");const le=Ua.current([b-j,J]);le.allowOverlay&&So(le)&&le.readonly!==!0&&H&&window.setTimeout(()=>{Ga.current(b,J)},0)};U()},[st,xe,j,He,Ct]),zi=d.useCallback(async(b,H=!0)=>{const F=Je?.();let _,W=!0;F!==void 0&&(_=await F,_==="left"&&(W=!1),typeof _=="number"&&(W=!1));let Z=0;const z=()=>{if(Cu.current<=st.length){Z<500&&window.setTimeout(z,Z),Z=50+Z*2;return}const U=typeof _=="number"?_:W?st.length:0;jt(U-j,b),Ct({cell:[U,b],range:{x:U,y:b,width:1,height:1}},!1,!1,"edit");const J=Ua.current([U-j,b]);J.allowOverlay&&So(J)&&J.readonly!==!0&&H&&window.setTimeout(()=>{Ga.current(U,b)},0)};z()},[st,Je,j,jt,Ct]),fo=d.useCallback(b=>{const H=ln[b]?.trailingRowOptions?.targetColumn??be?.targetColumn;if(typeof H=="number")return H+(wn?1:0);if(typeof H=="object"){const F=w.indexOf(H);if(F>=0)return F+(wn?1:0)}},[ln,w,wn,be?.targetColumn]),Cr=d.useRef(),ho=d.useRef(),_o=d.useCallback((b,H)=>{const[F,_]=H;return br(ct,st[F]?.themeOverride,zr?.(_),b.themeOverride)},[zr,st,ct]),{mapper:Nr}=cw(Nt,v),Gn=Nt?.navigationBehavior,No=d.useCallback(b=>{const H=ya.value?b.metaKey:b.ctrlKey,F=H&&me==="multi",[_,W]=b.location,Z=Y.columns,z=Y.rows,[U,J]=Y.current?.cell??[];if(b.kind==="cell"){if(ho.current=void 0,Br.current=[_,W],_===0&&wn){if(zt===!0&&W===He||sn==="number"||me==="none")return;const le=Ln(b.location);if(le.kind!==Wn.Marker)return;if(an!==void 0){const Ze=Qt(le);zn(Ze?.kind===Wn.Marker);const Ue=Ze?.onClick?.({...b,cell:le,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,theme:_o(le,b.location),preventDefault:()=>{}});if(Ue===void 0||Ue.checked===le.checked)return}i(void 0),yn();const Oe=z.hasIndex(W),Tt=Cr.current;if(me==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&Tt!==void 0&&z.hasIndex(Tt)){const Ze=[Math.min(Tt,W),Math.max(Tt,W)+1];F||Ne==="multi"?lt(void 0,Ze,!0):lt(Xe.fromSingleSelection(Ze),void 0,F)}else me==="multi"&&(F||b.isTouch||Ne==="multi")?Oe?lt(z.remove(W),void 0,!0):(lt(void 0,W,!0),Cr.current=W):Oe&&z.length===1?lt(Xe.empty(),void 0,H):(lt(Xe.fromSingleSelection(W),void 0,H),Cr.current=W)}else if(_>=j&&zt&&W===He){const le=fo(_);xr(le??_)}else if(U!==_||J!==W){const le=Ln(b.location),Oe=Qt(le);if(Oe?.onSelect!==void 0){let Ue=!1;if(Oe.onSelect({...b,cell:le,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,preventDefault:()=>Ue=!0,theme:_o(le,b.location)}),Ue)return}if(Gn==="block"&&Nr(W).isGroupHeader)return;const Tt=Vr&&W===He,Ze=Vr&&Y!==void 0&&Y.current?.cell[1]===He;if((b.shiftKey||b.isLongTouch===!0)&&U!==void 0&&J!==void 0&&Y.current!==void 0&&!Ze){if(Tt)return;const Ue=Math.min(_,U),Ke=Math.max(_,U),rt=Math.min(W,J),vt=Math.max(W,J);Ct({...Y.current,range:{x:Ue,y:rt,width:Ke-Ue+1,height:vt-rt+1}},!0,H,"click"),Cr.current=void 0,yn()}else Ct({cell:[_,W],range:{x:_,y:W,width:1,height:1}},!0,H,"click"),Cr.current=void 0,i(void 0),yn()}}else if(b.kind==="header")if(Br.current=[_,W],i(void 0),wn&&_===0)Cr.current=void 0,ho.current=void 0,!En&&me==="multi"&&(z.length!==He?lt(Xe.fromSingleSelection([0,He]),void 0,H):lt(Xe.empty(),void 0,H),yn());else{const le=ho.current;if(ne==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&le!==void 0&&Z.hasIndex(le)){const Oe=[Math.min(le,_),Math.max(le,_)+1];H||b.isTouch||Qe==="multi"?Ge(void 0,Oe,H):Ge(Xe.fromSingleSelection(Oe),void 0,H)}else ne==="multi"&&(H||b.isTouch||Qe==="multi")?(Z.hasIndex(_)?Ge(Z.remove(_),void 0,H):Ge(void 0,_,H),ho.current=_):ne!=="none"&&(Z.hasIndex(_)?Ge(Z.remove(_),void 0,H):Ge(Xe.fromSingleSelection(_),void 0,H),ho.current=_);Cr.current=void 0,yn()}else b.kind===Yn?Br.current=[_,W]:b.kind===xa&&!b.isMaybeScrollbar&&(he(Qi,!1),i(void 0),yn(),Yt?.(),Cr.current=void 0,ho.current=void 0)},[me,ne,Y,wn,j,zt,He,sn,Ln,an,yn,Ne,Qe,Qt,_o,lt,fo,xr,Gn,Nr,Vr,Ct,En,Ge,he,Yt]),Bo=d.useRef(!1),Br=d.useRef(),ku=d.useRef(mr),or=d.useRef(),Ip=d.useCallback(b=>{if(po.current=!1,ku.current=Jt.current,b.button!==0&&b.button!==1){or.current=void 0;return}const H=performance.now();or.current={button:b.button,time:H,location:b.location},b?.kind==="header"&&(Bo.current=!0);const F=b.kind==="cell"&&b.isFillHandle;!F&&b.kind!=="cell"&&b.isEdge||(u({previousSelection:Y,fillHandle:F}),Br.current=void 0,!b.isTouch&&b.button===0&&!F?No(b):!b.isTouch&&b.button===1&&(Br.current=b.location))},[Y,No]),[Ka,Ya]=d.useState(),Su=d.useCallback(b=>{if(b.kind!==Yn||ne!=="multi")return;const H=ya.value?b.metaKey:b.ctrlKey,[F]=b.location,_=Y.columns;if(F<j)return;const W=st[F];let Z=F,z=F;for(let U=F-1;U>=j&&wi(W.group,st[U].group);U--)Z--;for(let U=F+1;U<st.length&&wi(W.group,st[U].group);U++)z++;if(yn(),H||b.isTouch||Qe==="multi")if(_.hasAll([Z,z+1])){let U=_;for(let J=Z;J<=z;J++)U=U.remove(J);Ge(U,void 0,H)}else Ge(void 0,[Z,z+1],H);else Ge(Xe.fromSingleSelection([Z,z+1]),void 0,H)},[ne,yn,Y.columns,st,j,Ge,Qe]),po=d.useRef(!1),Vi=d.useCallback(async b=>{if(ee!==void 0&&je!==void 0){const H=Jt.current.y,F=Jt.current.height;let _=ee({x:b,y:H,width:1,height:Math.min(F,He-H)},$.current.signal);typeof _!="object"&&(_=await _());const W=ln[b-j],Z=document.createElement("canvas").getContext("2d",{alpha:!1});if(Z!==null){Z.font=ct.baseFontFull;const z=Jf(Z,ct,W,0,_,An,io,!1,Qt);je?.(W,z.width,b,z.width)}}},[ln,ee,io,ct,An,je,j,He,Qt]),[Ep,Za]=d.useState(),go=d.useCallback(async(b,H)=>{const F=b.current?.range;if(F===void 0||ee===void 0||H.current===void 0)return;const _=H.current.range;if(C!==void 0){let U=!1;if(C({fillDestination:{..._,x:_.x-j},patternSource:{...F,x:F.x-j},preventDefault:()=>U=!0}),U)return}let W=ee(F,$.current.signal);typeof W!="object"&&(W=await W());const Z=W,z=[];for(let U=0;U<_.width;U++)for(let J=0;J<_.height;J++){const le=[_.x+U,_.y+J];if(Nf(le,F))continue;const Oe=Z[J%F.height][U%F.width];Ro(Oe)||!So(Oe)||z.push({location:le,value:{...Oe}})}Nn(z),mn.current?.damage(z.map(U=>({cell:U.location})))},[ee,Nn,C,j]),Mu=d.useCallback(()=>{if(Y.current===void 0||Y.current.range.width<=1)return;const b={...Y,current:{...Y.current,range:{...Y.current.range,width:1}}};go(b,Y)},[go,Y]),Ru=d.useCallback(()=>{if(Y.current===void 0||Y.current.range.height<=1)return;const b={...Y,current:{...Y.current,range:{...Y.current.range,height:1}}};go(b,Y)},[go,Y]),Tp=d.useCallback((b,H)=>{const F=s;if(u(void 0),Wa(void 0),Za(void 0),Bo.current=!1,H)return;if(F?.fillHandle===!0&&Y.current!==void 0&&F.previousSelection?.current!==void 0){if(_r===void 0)return;const Oe={...Y,current:{...Y.current,range:oh(F.previousSelection.current.range,_r)}};go(F.previousSelection,Oe),he(Oe,!0);return}const[_,W]=b.location,[Z,z]=Br.current??[],U=()=>{po.current=!0},J=Oe=>{const Tt=Oe.isTouch||Z===_&&z===W;if(Tt&&T?.([_-j,W],{...Oe,preventDefault:U}),Oe.button===1)return!po.current;if(!po.current){const Ze=Ln(b.location),Ue=Qt(Ze);if(Ue!==void 0&&Ue.onClick!==void 0&&Tt){const rt=Ue.onClick({...Oe,cell:Ze,posX:Oe.localEventX,posY:Oe.localEventY,bounds:Oe.bounds,theme:_o(Ze,b.location),preventDefault:U});rt!==void 0&&!Ro(rt)&&ko(rt)&&(Nn([{location:Oe.location,value:rt}]),mn.current?.damage([{cell:Oe.location}]))}if(po.current||Y.current===void 0)return!1;let Ke=!1;switch(Ze.activationBehaviorOverride??ve){case"double-click":case"second-click":{if(F?.previousSelection?.current?.cell===void 0)break;const[rt,vt]=Y.current.cell,[en,vo]=F.previousSelection.current.cell;Ke=_===rt&&_===en&&W===vt&&W===vo&&(Oe.isDoubleClick===!0||ve==="second-click");break}case"single-click":{Ke=!0;break}}if(Ke){const rt={inputType:"pointer",pointerActivation:Oe.isDoubleClick===!0?"double-click":Ze.activationBehaviorOverride??ve,pointerType:Oe.isTouch?"touch":"mouse"};return I?.([_-j,W],rt),co(Oe.bounds,rt),!0}}return!1},le=b.location[0]-j;if(b.isTouch){const Oe=Jt.current,Tt=ku.current;if(Oe.x!==Tt.x||Oe.y!==Tt.y)return;if(b.isLongTouch===!0){if(b.kind==="cell"&&pi(Y.current?.cell,b.location)){B?.([le,b.location[1]],{...b,preventDefault:U});return}else if(b.kind==="header"&&Y.columns.hasIndex(_)){ie?.(le,{...b,preventDefault:U});return}else if(b.kind===Yn){if(le<0)return;q?.(le,{...b,preventDefault:U});return}}b.kind==="cell"?J(b)||No(b):b.kind===Yn?K?.(le,{...b,preventDefault:U}):(b.kind===Ir&&R?.(le,{...b,preventDefault:U}),No(b));return}if(b.kind==="header"){if(le<0)return;b.isEdge?b.isDoubleClick===!0&&Vi(_):b.button===0&&_===Z&&W===z&&R?.(le,{...b,preventDefault:U})}if(b.kind===Yn){if(le<0)return;b.button===0&&_===Z&&W===z&&(K?.(le,{...b,preventDefault:U}),po.current||Su(b))}b.kind==="cell"&&(b.button===0||b.button===1)&&J(b),Br.current=void 0},[s,Y,j,_r,go,he,T,Ln,Qt,ve,_o,Nn,I,co,B,ie,q,No,K,R,Vi,Su]),Op=d.useCallback(b=>{const H={...b,location:[b.location[0]-j,b.location[1]]};nt?.(H),s!==void 0&&b.buttons===0&&(u(void 0),Wa(void 0),Za(void 0),Bo.current=!1),Za(F=>Bo.current?[b.scrollEdge[0],0]:b.scrollEdge[0]===F?.[0]&&b.scrollEdge[1]===F[1]?F:s===void 0||(or.current?.location[0]??0)<j?void 0:b.scrollEdge)},[s,nt,j]),Dp=d.useCallback((b,H)=>{ut?.(b-j,H)},[ut,j]),Pp=d.useCallback((b,H)=>{Be?.(b-j,H)},[Be,j]),mo=Y?.current?.cell,Ap=d.useCallback((b,H,F,_,W,Z)=>{rr.current=!1;let z=mo;z!==void 0&&(z=[z[0]-j,z[1]]);const U=Ve===0?void 0:{x:0,y:b.y,width:Ve,height:b.height},J=[];U!==void 0&&J.push(U),tt>0&&(J.push({x:b.x-j,y:He-tt,width:b.width,height:tt}),Ve>0&&J.push({x:0,y:He-tt,width:Ve,height:tt}));const le={x:b.x-j,y:b.y,width:b.width,height:zt&&b.y+b.height>=He?b.height-1:b.height,tx:W,ty:Z,extras:{selected:z,freezeRegion:U,freezeRegions:J}};Jt.current=le,Di(le),uo([H,F,_]),kn?.(le,le.tx,le.ty,le.extras)},[mo,j,zt,He,Ve,tt,Di,kn]),Lp=Rr(M,d.useCallback((b,H)=>M?.(b-j,H-j)!==!1,[M,j])),Hp=Rr(Re,d.useCallback((b,H)=>{Re?.(b-j,H-j),ne!=="none"&&Ge(Xe.fromSingleSelection(H),void 0,!0)},[ne,Re,j,Ge])),qa=d.useRef(!1),Fp=d.useCallback(b=>{if(b.location[0]===0&&j>0){b.preventDefault();return}Le?.({...b,location:[b.location[0]-j,b.location[1]]}),b.defaultPrevented()||(qa.current=!0),u(void 0)},[Le,j]),zp=d.useCallback(()=>{qa.current=!1},[]),Iu=Nt?.selectionBehavior,$i=d.useCallback(b=>{if(Iu!=="block-spanning")return;const{isGroupHeader:H,path:F,groupRows:_}=Nr(b);if(H)return[b,b];const W=F[F.length-1],Z=b-W,z=b+_-W-1;return[Z,z]},[Nr,Iu]),Qa=d.useRef(),Ja=d.useCallback(b=>{if(!ch(b,Qa.current)&&(Qa.current=b,!(or?.current?.button!==void 0&&or.current.button>=1))){if(b.buttons!==0&&s!==void 0&&or.current?.location[0]===0&&j===1&&me==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(or.current.location[1])&&Y.rows.hasIndex(or.current.location[1])){const H=Math.min(or.current.location[1],b.location[1]),F=Math.max(or.current.location[1],b.location[1])+1;lt(Xe.fromSingleSelection([H,F]),void 0,!1)}else if(b.buttons!==0&&s!==void 0&&Y.current!==void 0&&!qa.current&&!Bo.current&&(Ee==="rect"||Ee==="multi-rect")){const[H,F]=Y.current.cell;let[_,W]=b.location;if(W<0&&(W=Jt.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const Z=s.previousSelection.current.range;W=Math.min(W,zt?He-1:He);const z=jb(Z,_,W,Ft);Wa(z)}else{if(zt&&F===He)return;if(zt&&W===He)if(b.kind===xa)W--;else return;_=Math.max(_,j);const Z=$i(F);W=Z===void 0?W:Bn(W,Z[0],Z[1]);const z=_-H,U=W-F,J={x:z>=0?H:_,y:U>=0?F:W,width:Math.abs(z)+1,height:Math.abs(U)+1};Ct({...Y.current,range:J},!0,!1,"drag")}}pt?.({...b,location:[b.location[0]-j,b.location[1]]})}},[s,j,me,Y,Ee,pt,lt,zt,He,Ft,$i,Ct]),Vp=d.useCallback(()=>{const b=Qa.current;if(b===void 0)return;const[H,F]=b.scrollEdge;let[_,W]=b.location;const Z=Jt.current;H===-1?_=Z.extras?.freezeRegion?.x??Z.x:H===1&&(_=Z.x+Z.width),F===-1?W=Math.max(0,Z.y):F===1&&(W=Math.min(He-1,Z.y+Z.height)),_=Bn(_,0,st.length-1),W=Bn(W,0,He-1),Ja({...b,location:[_,W]})},[st.length,Ja,He]);iw(Ep,_t,Vp);const Un=d.useCallback(b=>{if(Y.current===void 0)return;const[H,F]=b,[_,W]=Y.current.cell,Z=Y.current.range;let z=Z.x,U=Z.x+Z.width,J=Z.y,le=Z.y+Z.height;const[Oe,Tt]=$i(W)??[0,He-1],Ze=Tt+1;if(F!==0)switch(F){case 2:{le=Ze,J=W,jt(0,le,"vertical");break}case-2:{J=Oe,le=W+1,jt(0,J,"vertical");break}case 1:{J<W?(J++,jt(0,J,"vertical")):(le=Math.min(Ze,le+1),jt(0,le,"vertical"));break}case-1:{le>W+1?(le--,jt(0,le,"vertical")):(J=Math.max(Oe,J-1),jt(0,J,"vertical"));break}default:vi()}if(H!==0)if(H===2)U=st.length,z=_,jt(U-1-j,0,"horizontal");else if(H===-2)z=j,U=_+1,jt(z-j,0,"horizontal");else{let Ue=[];if(ee!==void 0){const Ke=ee({x:z,y:J,width:U-z-j,height:le-J},$.current.signal);typeof Ke=="object"&&(Ue=gw(Ke))}if(H===1){let Ke=!1;if(z<_){if(Ue.length>0){const rt=Tr(z+1,_+1).find(vt=>!Ue.includes(vt-j));rt!==void 0&&(z=rt,Ke=!0)}else z++,Ke=!0;Ke&&jt(z,0,"horizontal")}Ke||(U=Math.min(st.length,U+1),jt(U-1-j,0,"horizontal"))}else if(H===-1){let Ke=!1;if(U>_+1){if(Ue.length>0){const rt=Tr(U-1,_,-1).find(vt=>!Ue.includes(vt-j));rt!==void 0&&(U=rt,Ke=!0)}else U--,Ke=!0;Ke&&jt(U-j,0,"horizontal")}Ke||(z=Math.max(j,z-1),jt(z-j,0,"horizontal"))}else vi()}Ct({cell:Y.current.cell,range:{x:z,y:J,width:U-z,height:le-J}},!0,!1,"keyboard-select")},[ee,$i,Y,st.length,j,He,jt,Ct]),el=d.useRef(fr);el.current=fr;const kr=d.useCallback((b,H,F,_)=>{const W=vn-(F?0:1);b=Bn(b,j,ln.length-1+j),H=Bn(H,0,W);const Z=mo?.[0],z=mo?.[1];if(b===Z&&H===z)return!1;if(_&&Y.current!==void 0){const U=[...Y.current.rangeStack];(Y.current.range.width>1||Y.current.range.height>1)&&U.push(Y.current.range),he({...Y,current:{cell:[b,H],range:{x:b,y:H,width:1,height:1},rangeStack:U}},!0)}else Ct({cell:[b,H],range:{x:b,y:H,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===b&&c.current[1]===H&&(c.current=void 0),el.current&&jt(b-j,H),!0},[vn,j,ln.length,mo,Y,jt,he,Ct]),$p=d.useCallback((b,H)=>{o?.cell!==void 0&&b!==void 0&&ko(b)&&(Nn([{location:o.cell,value:b}]),window.requestAnimationFrame(()=>{mn.current?.damage([{cell:o.cell}])})),yn(!0),i(void 0);const[F,_]=H;if(Y.current!==void 0&&(F!==0||_!==0)){const W=Y.current.cell[1]===vn-1&&b!==void 0,Z=Y.current.cell[0]===st.length-1&&b!==void 0;let z=!0;if(W&&_===1&&xe!==void 0){z=!1;const U=Y.current.cell[0]+F,J=fo(U);xr(J??U,!1)}if(Z&&F===1&&Je!==void 0){z=!1;const U=Y.current.cell[1]+_;zi(U,!1)}z&&kr(Bn(Y.current.cell[0]+F,0,st.length-1),Bn(Y.current.cell[1]+_,0,vn-1),W,!1)}A?.(b,H)},[o?.cell,yn,Y,A,Nn,vn,kr,st.length,xr,zi,xe,Je,fo]),_p=d.useMemo(()=>`gdg-overlay-${pw++}`,[]),Wr=d.useCallback(b=>{yn();const H=[];for(let F=b.x;F<b.x+b.width;F++)for(let _=b.y;_<b.y+b.height;_++){const W=x([F-j,_]);if(!W.allowOverlay&&W.kind!==Q.Boolean)continue;let Z;if(W.kind===Q.Custom){const z=Qt(W),U=z?.provideEditor?.({...W,location:[F-j,_]});z?.onDelete!==void 0?Z=z.onDelete(W):o0(U)&&(Z=U?.deletedValue?.(W))}else(ko(W)&&W.allowOverlay||W.kind===Q.Boolean)&&(Z=Qt(W)?.onDelete?.(W));Z!==void 0&&!Ro(Z)&&ko(Z)&&H.push({location:[F,_],value:Z})}Nn(H),mn.current?.damage(H.map(F=>({cell:F.location})))},[yn,x,Qt,Nn,j]),Wo=o!==void 0,Eu=d.useCallback(b=>{const H=()=>{b.stopPropagation(),b.preventDefault()},F={didMatch:!1},{bounds:_}=b,W=Y.columns,Z=Y.rows,z=nr;if(!Wo&&ot(z.clear,b,F))he(Qi,!1),Yt?.();else if(!Wo&&ot(z.selectAll,b,F))he({columns:Xe.empty(),rows:Xe.empty(),current:{cell:Y.current?.cell??[j,0],range:{x:j,y:0,width:w.length,height:He},rangeStack:[]}},!1);else if(ot(z.search,b,F))a?.current?.focus({preventScroll:!0}),Oi(!0);else if(ot(z.delete,b,F)){const Ke=Wt?.(Y)??!0;if(Ke!==!1){const rt=Ke===!0?Y:Ke;if(rt.current!==void 0){Wr(rt.current.range);for(const vt of rt.current.rangeStack)Wr(vt)}for(const vt of rt.rows)Wr({x:j,y:vt,width:w.length,height:1});for(const vt of rt.columns)Wr({x:vt,y:0,width:1,height:He})}}if(F.didMatch)return H(),!0;if(Y.current===void 0)return!1;let[U,J]=Y.current.cell;const[,le]=Y.current.cell;let Oe=!1,Tt=!1;if(ot(z.scrollToSelectedCell,b,F))Bi.current(U-j,J);else if(ne!=="none"&&ot(z.selectColumn,b,F))W.hasIndex(U)?Ge(W.remove(U),void 0,!0):ne==="single"?Ge(Xe.fromSingleSelection(U),void 0,!0):Ge(void 0,U,!0);else if(me!=="none"&&ot(z.selectRow,b,F))Z.hasIndex(J)?lt(Z.remove(J),void 0,!0):me==="single"?lt(Xe.fromSingleSelection(J),void 0,!0):lt(void 0,J,!0);else if(!Wo&&_!==void 0&&ot(z.activateCell,b,F))if(J===He&&zt)window.setTimeout(()=>{const Ke=fo(U);xr(Ke??U)},0);else{const Ke={inputType:"keyboard",key:b.key};I?.([U-j,J],Ke),co(_,Ke)}else Y.current.range.height>1&&ot(z.downFill,b,F)?Ru():Y.current.range.width>1&&ot(z.rightFill,b,F)?Mu():ot(z.goToNextPage,b,F)?J+=Math.max(1,Jt.current.height-4):ot(z.goToPreviousPage,b,F)?J-=Math.max(1,Jt.current.height-4):ot(z.goToFirstCell,b,F)?(i(void 0),J=0,U=0):ot(z.goToLastCell,b,F)?(i(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):ot(z.selectToFirstCell,b,F)?(i(void 0),Un([-2,-2])):ot(z.selectToLastCell,b,F)?(i(void 0),Un([2,2])):Wo?(ot(z.closeOverlay,b,F)&&i(void 0),ot(z.acceptOverlayDown,b,F)&&(i(void 0),J++),ot(z.acceptOverlayUp,b,F)&&(i(void 0),J--),ot(z.acceptOverlayLeft,b,F)&&(i(void 0),U--),ot(z.acceptOverlayRight,b,F)&&(i(void 0),U++)):(ot(z.goDownCell,b,F)?J+=1:ot(z.goUpCell,b,F)?J-=1:ot(z.goRightCell,b,F)?U+=1:ot(z.goLeftCell,b,F)?U-=1:ot(z.goDownCellRetainSelection,b,F)?(J+=1,Oe=!0):ot(z.goUpCellRetainSelection,b,F)?(J-=1,Oe=!0):ot(z.goRightCellRetainSelection,b,F)?(U+=1,Oe=!0):ot(z.goLeftCellRetainSelection,b,F)?(U-=1,Oe=!0):ot(z.goToLastRow,b,F)?J=He-1:ot(z.goToFirstRow,b,F)?J=Number.MIN_SAFE_INTEGER:ot(z.goToLastColumn,b,F)?U=Number.MAX_SAFE_INTEGER:ot(z.goToFirstColumn,b,F)?U=Number.MIN_SAFE_INTEGER:(Ee==="rect"||Ee==="multi-rect")&&(ot(z.selectGrowDown,b,F)?Un([0,1]):ot(z.selectGrowUp,b,F)?Un([0,-1]):ot(z.selectGrowRight,b,F)?Un([1,0]):ot(z.selectGrowLeft,b,F)?Un([-1,0]):ot(z.selectToLastRow,b,F)?Un([0,2]):ot(z.selectToFirstRow,b,F)?Un([0,-2]):ot(z.selectToLastColumn,b,F)?Un([2,0]):ot(z.selectToFirstColumn,b,F)&&Un([-2,0])),Tt=F.didMatch);if(Gn!==void 0&&Gn!=="normal"&&J!==le){const Ke=Gn==="skip-up"||Gn==="skip"||Gn==="block",rt=Gn==="skip-down"||Gn==="skip"||Gn==="block",vt=J<le;if(vt&&Ke){for(;J>=0&&Nr(J).isGroupHeader;)J--;J<0&&(J=le)}else if(!vt&&rt){for(;J<He&&Nr(J).isGroupHeader;)J++;J>=He&&(J=le)}}const Ze=kr(U,J,!1,Oe),Ue=F.didMatch;return Ue&&(Ze||!Tt||hn)&&H(),Ue},[Gn,Wo,Y,nr,ne,me,Ee,j,Nr,He,kr,he,Yt,w.length,Wt,hn,Wr,Ge,lt,zt,fo,xr,I,co,Ru,Mu,Un]),jo=d.useCallback(b=>{let H=!1;if(G!==void 0&&G({...b,...b.location&&{location:[b.location[0]-j,b.location[1]]},cancel:()=>{H=!0}}),H||Eu(b)||Y.current===void 0)return;const[F,_]=Y.current.cell,W=Jt.current;if(Te&&!b.metaKey&&!b.ctrlKey&&Y.current!==void 0&&b.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(b.key)&&b.bounds!==void 0&&So(x([F-j,Math.max(0,Math.min(_,He-1))]))){if((!zt||_!==He)&&(W.y>_||_>W.y+W.height||W.x>F||F>W.x+W.width))return;const Z={inputType:"keyboard",key:b.key};I?.([F-j,_],Z),co(b.bounds,Z,b.key),b.stopPropagation(),b.preventDefault()}},[Te,G,Eu,Y,x,j,He,zt,I,co]),Np=d.useCallback((b,H)=>{const F=b.location[0]-j;if(b.kind==="header"&&ie?.(F,{...b,preventDefault:H}),b.kind===Yn){if(F<0)return;q?.(F,{...b,preventDefault:H})}if(b.kind==="cell"){const[_,W]=b.location;B?.([F,W],{...b,preventDefault:H}),Mv(Y,b.location)||kr(_,W,!1,!1)}},[Y,B,q,ie,j,kr]),tl=d.useCallback(async b=>{if(!nr.paste)return;function H(z,U,J,le){const Oe=typeof J=="object"?J?.join(`
183
+ `)??"":J?.toString()??"";if(!Ro(z)&&So(z)&&z.readonly!==!0){const Tt=E?.(Oe,z);if(Tt!==void 0&&ko(Tt))return{location:U,value:Tt};const Ze=Qt(z);if(Ze===void 0)return;if(Ze.kind===Q.Custom){zn(z.kind===Q.Custom);const Ue=Ze.onPaste?.(Oe,z.data);return Ue===void 0?void 0:{location:U,value:{...z,data:Ue}}}else{const Ue=Ze.onPaste?.(Oe,z,{formatted:le,formattedString:typeof le=="string"?le:le?.join(`
184
+ `),rawValue:J});return Ue===void 0?void 0:(zn(Ue.kind===z.kind),{location:U,value:Ue})}}}const F=Y.columns,_=Y.rows,W=_t.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0;let Z;if(Y.current!==void 0?Z=[Y.current.range.x,Y.current.range.y]:F.length===1?Z=[F.first()??0,0]:_.length===1&&(Z=[j,_.first()??0]),W&&Z!==void 0){let z,U;const J="text/plain",le="text/html";if(navigator.clipboard.read!==void 0){const Ue=await navigator.clipboard.read();for(const Ke of Ue){if(Ke.types.includes(le)){const rt=await(await Ke.getType(le)).text(),vt=ed(rt);if(vt!==void 0){z=vt;break}}Ke.types.includes(J)&&(U=await(await Ke.getType(J)).text())}}else if(navigator.clipboard.readText!==void 0)U=await navigator.clipboard.readText();else if(b!==void 0&&b?.clipboardData!==null){if(b.clipboardData.types.includes(le)){const Ue=b.clipboardData.getData(le);z=ed(Ue)}z===void 0&&b.clipboardData.types.includes(J)&&(U=b.clipboardData.getData(J))}else return;const[Oe,Tt]=Z,Ze=[];do{if(Pe===void 0){const Ue=Ln(Z),Ke=U??z?.map(vt=>vt.map(en=>en.rawValue).join(" ")).join(" ")??"",rt=H(Ue,Z,Ke,void 0);rt!==void 0&&Ze.push(rt);break}if(z===void 0){if(U===void 0)return;z=Q1(U)}if(Pe===!1||typeof Pe=="function"&&Pe?.([Z[0]-j,Z[1]],z.map(Ue=>Ue.map(Ke=>Ke.rawValue?.toString()??"")))!==!0)return;for(const[Ue,Ke]of z.entries()){if(Ue+Tt>=He)break;for(const[rt,vt]of Ke.entries()){const en=[rt+Oe,Ue+Tt],[vo,Wi]=en;if(vo>=st.length||Wi>=vn)continue;const Uo=Ln(en),ir=H(Uo,en,vt.rawValue,vt.formatted);ir!==void 0&&Ze.push(ir)}}}while(!1);Nn(Ze),mn.current?.damage(Ze.map(Ue=>({cell:Ue.location})))}},[E,Qt,Ln,Y,nr.paste,_t,st.length,Nn,vn,Pe,j,He]);xn("paste",tl,f,!1,!0);const Go=d.useCallback(async(b,H)=>{if(!nr.copy)return;const F=H===!0||_t.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0,_=Y.columns,W=Y.rows,Z=(z,U)=>{if(!qe)nd(z,U,b);else{const J=U.map(le=>({kind:Q.Text,data:w[le].title,displayData:w[le].title,allowOverlay:!1}));nd([J,...z],U,b)}};if(F&&ee!==void 0){if(Y.current!==void 0){let z=ee(Y.current.range,$.current.signal);typeof z!="object"&&(z=await z()),Z(z,Tr(Y.current.range.x-j,Y.current.range.x+Y.current.range.width-j))}else if(W!==void 0&&W.length>0){const z=[...W].map(U=>{const J=ee({x:j,y:U,width:w.length,height:1},$.current.signal);return typeof J=="object"?J[0]:J().then(le=>le[0])});if(z.some(U=>U instanceof Promise)){const U=await Promise.all(z);Z(U,Tr(w.length))}else Z(z,Tr(w.length))}else if(_.length>0){const z=[],U=[];for(const J of _){let le=ee({x:J,y:0,width:1,height:He},$.current.signal);typeof le!="object"&&(le=await le()),z.push(le),U.push(J-j)}if(z.length===1)Z(z[0],U);else{const J=z.reduce((le,Oe)=>le.map((Tt,Ze)=>[...Tt,...Oe[Ze]]));Z(J,U)}}}},[w,ee,Y,nr.copy,j,_t,He,qe]);xn("copy",Go,f,!1,!1);const Bp=d.useCallback(async b=>{if(!(!nr.cut||!(_t.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0))&&(await Go(b),Y.current!==void 0)){let H={current:{cell:Y.current.cell,range:Y.current.range,rangeStack:[]},rows:Xe.empty(),columns:Xe.empty()};const F=Wt?.(H);if(F===!1||(H=F===!0?H:F,H.current===void 0))return;Wr(H.current.range)}},[Wr,Y,nr.cut,Go,_t,Wt]);xn("cut",Bp,f,!1,!1);const Wp=d.useCallback((b,H)=>{if(pe!==void 0){j!==0&&(b=b.map(W=>[W[0]-j,W[1]])),pe(b,H);return}if(b.length===0||H===-1)return;const[F,_]=b[H];c.current!==void 0&&c.current[0]===F&&c.current[1]===_||(c.current=[F,_],kr(F,_,!1,!1))},[pe,j,kr]),[_i,Ni]=ht?.current?.cell??[],Bi=d.useRef(jt);Bi.current=jt,d.useLayoutEffect(()=>{el.current&&!rr.current&&_i!==void 0&&Ni!==void 0&&(_i!==de.current?.current?.cell[0]||Ni!==de.current?.current?.cell[1])&&Bi.current(_i,Ni),rr.current=!1},[_i,Ni]);const Tu=Y.current!==void 0&&(Y.current.cell[0]>=st.length||Y.current.cell[1]>=vn);d.useLayoutEffect(()=>{Tu&&he(Qi,!1)},[Tu,he]);const jp=d.useMemo(()=>zt===!0&&be?.tint===!0?Xe.fromSingleSelection(vn-1):Xe.empty(),[vn,zt,be?.tint]),Gp=d.useCallback(b=>typeof rn=="boolean"?rn:rn?.(b-j)??!0,[j,rn]),Up=d.useMemo(()=>{if(Ka===void 0||l.current===null)return null;const{bounds:b,group:H}=Ka,F=l.current.getBoundingClientRect();return d.createElement(N1,{bounds:b,group:H,canvasBounds:F,onClose:()=>Ya(void 0),onFinish:_=>{Ya(void 0),ge?.(H,_)}})},[ge,Ka]),Xp=Math.min(st.length,Ve+(wn?1:0));d.useImperativeHandle(t,()=>({appendRow:(b,H)=>xr(b+j,H),appendColumn:(b,H)=>zi(b,H),updateCells:b=>(j!==0&&(b=b.map(H=>({cell:[H.cell[0]+j,H.cell[1]]}))),mn.current?.damage(b)),getBounds:(b,H)=>{if(!(l?.current===null||_t?.current===null)){if(b===void 0&&H===void 0){const F=l.current.getBoundingClientRect(),_=F.width/_t.current.clientWidth;return{x:F.x-_t.current.scrollLeft*_,y:F.y-_t.current.scrollTop*_,width:_t.current.scrollWidth*_,height:_t.current.scrollHeight*_}}return mn.current?.getBounds((b??0)+j,H)}},focus:()=>mn.current?.focus(),emit:async b=>{switch(b){case"delete":jo({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":jo({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":jo({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 Go(void 0,!0);break;case"paste":await tl();break}},scrollTo:jt,remeasureColumns:b=>{for(const H of b)Vi(H+j)},getMouseArgsForPosition:(b,H,F)=>{if(mn?.current===null)return;const _=mn.current.getMouseArgsForPosition(b,H,F);if(_!==void 0)return{..._,location:[_.location[0]-j,_.location[1]]}}}),[xr,zi,Vi,_t,Go,jo,tl,j,jt]);const[Ou,Du]=mo??[],Kp=d.useCallback(b=>{const[H,F]=b;if(F===-1){ne!=="none"&&(Ge(Xe.fromSingleSelection(H),void 0,!1),yn());return}Ou===H&&Du===F||(Ct({cell:b,range:{x:H,y:F,width:1,height:1}},!0,!1,"keyboard-nav"),jt(H,F))},[ne,yn,jt,Ou,Du,Ct,Ge]),[Yp,Zp]=d.useState(!1),Pu=d.useRef(Mf(b=>{Zp(b)},5)),qp=d.useCallback(()=>{Pu.current(!0),Y.current===void 0&&Y.columns.length===0&&Y.rows.length===0&&s===void 0&&Ct({cell:[j,Pi],range:{x:j,y:Pi,width:1,height:1}},!0,!1,"keyboard-select")},[Pi,Y,s,j,Ct]),Qp=d.useCallback(()=>{Pu.current(!1)},[]),[Jp,eg]=d.useMemo(()=>{let b;const H=at?.scrollbarWidthOverride??us(),F=He+(zt?1:0);if(typeof tr=="number")b=gn+F*tr;else{let W=0;const Z=Math.min(F,10);for(let z=0;z<Z;z++)W+=tr(z);W=Math.floor(W/Z),b=gn+F*W}b+=H;const _=st.reduce((W,Z)=>Z.width+W,0)+H;return[`${Math.min(1e5,_)}px`,`${Math.min(1e5,b)}px`]},[st,at?.scrollbarWidthOverride,tr,He,zt,gn]),tg=d.useMemo(()=>$v(ct),[ct]);return d.createElement(qf.Provider,{value:ct},d.createElement(nw,{style:tg,className:X,inWidth:m??Jp,inHeight:y??eg},d.createElement(z1,{fillHandle:xt,drawFocusRing:yr,experimental:at,fixedShadowX:Sn,fixedShadowY:cr,getRowThemeOverride:zr,headerIcons:Jn,imageWindowLoader:N,initialSize:_e,isDraggable:We,onDragLeave:It,onRowMoved:an,overscrollX:_a,overscrollY:Na,preventDiagonalScrolling:fn,rightElement:Bt,rightElementProps:Rn,smoothScrollX:Lr,smoothScrollY:no,className:X,enableGroups:_n,onCanvasFocused:qp,onCanvasBlur:Qp,canvasRef:l,onContextMenu:Np,theme:ct,cellXOffset:Mp,cellYOffset:Pi,accessibilityHeight:mr.height,onDragEnd:zp,columns:st,nonGrowWidth:At,drawHeader:gt,onColumnProposeMove:Lp,drawCell:un,disabledRows:jp,freezeColumns:Xp,lockColumns:j,firstColAccessible:j===0,getCellContent:Ln,minColumnWidth:An,maxColumnWidth:io,searchInputRef:a,showSearch:so,onSearchClose:Ba,highlightRegions:Rp,getCellsForSelection:ee,getGroupDetails:ja,headerHeight:$o,isFocused:Yp,groupHeaderHeight:_n?ao:0,freezeTrailingRows:tt+(zt&&be?.sticky===!0?1:0),hasAppendRow:zt,onColumnResize:je,onColumnResizeEnd:Me,onColumnResizeStart:Ye,onCellFocused:Kp,onColumnMoved:Hp,onDragStart:Fp,onHeaderMenuClick:Dp,onHeaderIndicatorClick:Pp,onItemHovered:Ja,isFilling:s?.fillHandle===!0,onMouseMove:Op,onKeyDown:jo,onKeyUp:oe,onMouseDown:Ip,onMouseUp:Tp,onDragOverCell:On,onDrop:on,onSearchResultsChanged:Wp,onVisibleRegionChanged:Ap,clientSize:$t,rowHeight:tr,searchResults:ue,searchValue:L,onSearchValueChange:V,rows:vn,scrollRef:_t,selection:Y,translateX:mr.tx,translateY:mr.ty,verticalBorder:Gp,gridRef:mn,getCellRenderer:Qt,resizeIndicator:oo}),Up,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(hw,{...o,validateCell:Ie,bloom:O,id:_p,getCellRenderer:Qt,className:at?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:Zt,imageEditorOverride:g,portalElementRef:wr,onFinishEditing:$p,markdownDivCreateNode:h,isOutsideClick:Fo,customEventTarget:at?.eventTarget}))))},vw=d.forwardRef(mw);function id(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:a,height:l,x:s,y:u}=o,c=t.maxSize??i.checkboxMaxSize,f=Math.floor(o.y+l/2),g=Ef(c,l,i.cellVerticalPadding),p=If(t.contentAlign??"center",s,a,i.cellHorizontalPadding,g),h=Rf(p,f,g),m=Tf(s+n,u+r,h);return Os(t)&&m}const bw={getAccessibilityString:e=>e.data?.toString()??"false",kind:Q.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>ww(e,e.cell.data,Os(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{id(e)&&e.preventDefault()},onClick:e=>{if(id(e))return{...e.cell,data:fh(e.cell.data)}},onPaste:(e,t)=>{let n=ha;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Ts),n===t.data?void 0:{...t,data:n}}};function ww(e,t,n,r,o){if(!n&&t===ha)return;const{ctx:i,hoverAmount:a,theme:l,rect:s,highlighted:u,hoverX:c,hoverY:f,cell:{contentAlign:g}}=e,{x:p,y:h,width:m,height:y}=s;let w=!1;if(o>0){let v=n?1-o+o*a:.4;if(t===ha&&(v*=a),v===0)return;v<1&&(w=!0,i.globalAlpha=v)}Xs(i,l,t,p,h,m,y,u,c,f,r,g),w&&(i.globalAlpha=1)}const yw=dn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),xw=e=>{const{bubbles:t}=e;return d.createElement(yw,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Cw={getAccessibilityString:e=>Of(e.data),kind:Q.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((o,i)=>e.measureText(i).width+o+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>kw(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(xw,{bubbles:t.data})},onPaste:()=>{}};function kw(e,t){const{rect:n,theme:r,ctx:o,highlighted:i}=e,{x:a,y:l,width:s,height:u}=n;let c=a+r.cellHorizontalPadding;const f=[];for(const g of t){if(c>a+s)break;const p=Pr(g,o,r.baseFontFull).width;f.push({x:c,width:p}),c+=p+r.bubblePadding*2+r.bubbleMargin}o.beginPath();for(const g of f)qn(o,g.x,l+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);o.fillStyle=i?r.bgBubbleSelected:r.bgBubble,o.fill();for(const[g,p]of f.entries())o.beginPath(),o.fillStyle=r.textBubble,o.fillText(t[g],p.x+r.bubblePadding,l+u/2+Qn(o,r))}const Sw=dn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Mw=e=>{const{drilldowns:t}=e;return d.createElement(Sw,null,t.map((n,r)=>d.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&d.createElement("img",{src:n.img}),d.createElement("div",null,n.text))))},Rw={getAccessibilityString:e=>Of(e.data.map(t=>t.text)),kind:Q.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o.text).width+r+n.bubblePadding*2+n.bubbleMargin+(o.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Ew(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Mw,{drilldowns:t.data})},onPaste:()=>{}},jl={};function Iw(e,t,n,r){const o=Math.ceil(window.devicePixelRatio),i=5,a=n-i*2,l=4,s=n*o,u=r+i,c=r*3,f=(c+i*2)*o,g=`${e},${t},${o},${n}`;if(jl[g]!==void 0)return{el:jl[g],height:s,width:f,middleWidth:l*o,sideWidth:u*o,padding:i*o,dpr:o};const p=document.createElement("canvas"),h=p.getContext("2d");return h===null?null:(p.width=f,p.height=s,h.scale(o,o),jl[g]=p,h.beginPath(),qn(h,i,i,c,a,r),h.shadowColor="rgba(24, 25, 34, 0.4)",h.shadowBlur=1,h.fillStyle=e,h.fill(),h.shadowColor="rgba(24, 25, 34, 0.3)",h.shadowOffsetY=1,h.shadowBlur=5,h.fillStyle=e,h.fill(),h.shadowOffsetY=0,h.shadowBlur=0,h.shadowBlur=0,h.beginPath(),qn(h,i+.5,i+.5,c,a,r),h.strokeStyle=t,h.lineWidth=1,h.stroke(),{el:p,height:s,width:f,sideWidth:u*o,middleWidth:r*o,padding:i*o,dpr:o})}function Ew(e,t){const{rect:n,theme:r,ctx:o,imageLoader:i,col:a,row:l}=e,{x:s,width:u}=n,c=r.baseFontFull,f=Ws(o,c),g=Math.min(n.height,Math.max(16,Math.ceil(f*r.lineHeight)*2)),p=Math.floor(n.y+(n.height-g)/2),h=g-10,m=r.bubblePadding,y=r.bubbleMargin;let w=s+r.cellHorizontalPadding;const v=r.roundingRadius??6,x=Iw(r.bgCell,r.drilldownBorder,g,v),T=[];for(const I of t){if(w>s+u)break;const C=Pr(I.text,o,c).width;let A=0;I.img!==void 0&&i.loadOrGetImage(I.img,a,l)!==void 0&&(A=h-8+4);const E=C+A+m*2;T.push({x:w,width:E}),w+=E+y}if(x!==null){const{el:I,height:C,middleWidth:A,sideWidth:E,width:k,dpr:P,padding:O}=x,R=E/P,M=O/P;for(const D of T){const S=Math.floor(D.x),K=Math.floor(D.width),B=K-(R-M)*2;o.imageSmoothingEnabled=!1,o.drawImage(I,0,0,E,C,S-M,p,R,g),B>0&&o.drawImage(I,E,0,A,C,S+(R-M),p,B,g),o.drawImage(I,k-E,0,E,C,S+K-(R-M),p,R,g),o.imageSmoothingEnabled=!0}}o.beginPath();for(const[I,C]of T.entries()){const A=t[I];let E=C.x+m;if(A.img!==void 0){const k=i.loadOrGetImage(A.img,a,l);if(k!==void 0){const P=h-8;let O=0,R=0,M=k.width,D=k.height;M>D?(O+=(M-D)/2,M=D):D>M&&(R+=(D-M)/2,D=M),o.beginPath(),qn(o,E,p+g/2-P/2,P,P,r.roundingRadius??3),o.save(),o.clip(),o.drawImage(k,O,R,M,D,E,p+g/2-P/2,P,P),o.restore(),E+=P+4}}o.beginPath(),o.fillStyle=r.textBubble,o.fillText(A.text,E,p+g/2+Qn(o,r))}}const Tw={getAccessibilityString:e=>e.data.join(", "),kind:Q.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Ow(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,o=r??A0;return d.createElement(o,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{e=e.trim();const n=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(n.length===t.data.length&&n.every((r,o)=>r===t.data[o])))return{...t,data:n}}},Gl=4;function Ow(e,t,n,r){const{rect:o,col:i,row:a,theme:l,ctx:s,imageLoader:u}=e,{x:c,y:f,height:g,width:p}=o,h=g-l.cellVerticalPadding*2,m=[];let y=0;for(let v=0;v<t.length;v++){const x=t[v];if(x.length===0)continue;const T=u.loadOrGetImage(x,i,a);if(T!==void 0){m[v]=T;const I=T.width*(h/T.height);y+=I+Gl}}if(y===0)return;y-=Gl;let w=c+l.cellHorizontalPadding;r==="right"?w=Math.floor(c+p-l.cellHorizontalPadding-y):r==="center"&&(w=Math.floor(c+p/2-y/2));for(const v of m){if(v===void 0)continue;const x=v.width*(h/v.height);n>0&&(s.beginPath(),qn(s,w,f+l.cellVerticalPadding,x,h,n),s.save(),s.clip()),s.drawImage(v,w,f+l.cellVerticalPadding,x,h),n>0&&s.restore(),w+=x+Gl}}function Dw(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Pw={getAccessibilityString:()=>"",kind:Q.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let l=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(l+=Math.round(Dw(n,r)*t.skeletonWidthVariability));const s=a.cellHorizontalPadding;l+s*2>=i.width&&(l=i.width-s*2-1);const u=t.skeletonHeight??Math.min(18,i.height-2*a.cellVerticalPadding);qn(o,i.x+s,i.y+(i.height-u)/2,l,u,a.roundingRadius??3),o.fillStyle=qr(a.textDark,.1),o.fill()},onPaste:()=>{}},Aw=()=>e=>e.targetWidth,ad=dn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Aw(),"px"]}}),Lw=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:a,validatedSelection:l}=e,s=t.data,u=t.readonly===!0,[c,f]=d.useState(s===""||r),g=d.useCallback(()=>{f(h=>!h)},[]),p=s?"gdg-ml-6":"";return c?d.createElement(ad,{targetWidth:i.width-20},d.createElement(eo,{autoFocus:!0,highlight:!1,validatedSelection:l,value:s,onKeyDown:h=>{h.key==="Enter"&&h.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${p}`,onClick:()=>a(t)},d.createElement(R0,null))):d.createElement(ad,{targetWidth:i.width},d.createElement(pv,{contents:s,createNode:o}),!u&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${p}`,onClick:g},d.createElement(As,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Hw={getAccessibilityString:e=>e.data?.toString()??"",kind:Q.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Ii,measure:(e,t,n)=>{const r=t.data.split(`
185
+ `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>ar(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:a,validatedSelection:l}=e;return d.createElement(Lw,{onFinish:o,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Fw={getAccessibilityString:e=>e.row.toString(),kind:Wn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:zw,measure:()=>44,draw:e=>$w(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:a}=t,l=n.drawHandle?7+(i-7)/2:i/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function zw(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return i?.font!==o&&(n.font=o,i.font=o),i.deprep=Vw,n.textAlign="center",i}function Vw(e){const{ctx:t}=e;t.textAlign="start"}function $w(e,t,n,r,o,i){const{ctx:a,rect:l,hoverAmount:s,theme:u}=e,{x:c,y:f,width:g,height:p}=l,h=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&h>0){a.globalAlpha=h;const m=7*(n?s:1);if(Xs(a,u,n,o?c+m:c,f,o?g-m:g,p,!0,void 0,void 0,u.checkboxMaxSize,"center",i),o){a.globalAlpha=s,a.beginPath();for(const y of[3,6])for(const w of[-5,-1,3])a.rect(c+y,f+p/2+w,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),y=u.markerFontFull,w=c+g/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=u.textLight,a.font=y,a.fillText(m,w,f+p/2+Qn(a,y)),s!==0&&(a.globalAlpha=1)}}const _w={getAccessibilityString:()=>"",kind:Wn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Nw(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Nw(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:a,spriteManager:l}=e,{x:s,y:u,width:c,height:f}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,u+1,c,f-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let p=0;if(n!==void 0){const h=f-8,m=s+8/2,y=u+8/2;l.drawSprite(n,"normal",r,m,y,h,a,g?1:i),p=h}else{p=24;const h=12,m=g?h:i*h,y=g?0:(1-i)*h*.5,w=a.cellHorizontalPadding+4;m>0&&(r.moveTo(s+w+y,u+f/2),r.lineTo(s+w+y+m,u+f/2),r.moveTo(s+w+y+m*.5,u+f/2-m*.5),r.lineTo(s+w+y+m*.5,u+f/2+m*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,p+s+a.cellHorizontalPadding+.5,u+f/2+Qn(r,a)),r.beginPath()}function gh(e,t,n,r,o,i,a){e.textBaseline="alphabetic";const l=Bw(e,o,r,t,n?.fullSize??!1);e.beginPath(),qn(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=n?.bgColor??qr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a?.("text")}function Bw(e,t,n,r,o){const i=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+a/2+1,width:t.width-i,height:t.height-a-1};const l=Pr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,u=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-u)/2+1,width:l.width+i*3,height:u-1}}const Ww=d.lazy(async()=>await Rs(()=>import("./number-overlay-editor-BQXyYsVn-Dh7S4LVs.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),jw={getAccessibilityString:e=>e.data?.toString()??"",kind:Q.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:Ii,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:u}=n;l===!0&&t>0&&gh(r,o,u,s,i,t,a),ar(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(Ww,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:o,onChange:i=>n({...r,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},Gw={getAccessibilityString:()=>"",measure:()=>108,kind:Q.Protected,needsHover:!1,needsHoverPosition:!1,draw:Uw,onPaste:()=>{}};function Uw(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:a}=r;t.beginPath();const l=2.5;let s=o+n.cellHorizontalPadding+l;const u=i+a/2,c=Math.cos(uc(30))*l,f=Math.sin(uc(30))*l;for(let g=0;g<12;g++)t.moveTo(s,u-l),t.lineTo(s,u+l),t.moveTo(s+c,u-f),t.lineTo(s-c,u+f),t.moveTo(s-c,u-f),t.lineTo(s+c,u+f),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Xw={getAccessibilityString:e=>e.data?.toString()??"",kind:Q.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Ii(e,t,e.theme.textLight),draw:e=>ar(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return St.createElement(eo,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},Kw={getAccessibilityString:e=>e.data?.toString()??"",kind:Q.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Ii,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:f,hoverEffectTheme:g}=t;c===!0&&n>0&&gh(o,a,g,s,i,n,l),ar(e,s,u,f,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
186
+ `,t.allowWrapping===!0?void 0:1);let o=0;for(const i of r)o=Math.max(o,e.measureText(i).width);return o+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:o,validatedSelection:i}=t;return d.createElement(eo,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:o.readonly!==!0,disabled:o.readonly===!0,altNewline:!0,value:o.data,validatedSelection:i,onChange:a=>r({...o,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Yw=dn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Zw=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:a}=e,[l,s]=d.useState(!o&&(t===""||r)),u=d.useCallback(()=>{s(!0)},[]);return l?d.createElement(eo,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(Yw,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!o&&d.createElement("div",{className:"gdg-edit-icon",onClick:u},d.createElement(As,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function mh(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,l=e.actualBoundingBoxAscent;return r==="right"?o=t.width-a-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-a/2),{x:o,y:i,width:a,height:l}}function ld(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const l=Gf(a,i.baseFontFull);if(l===void 0)return!1;const s=mh(l,n,i,t.contentAlign);return Kr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,o)}const qw={getAccessibilityString:e=>e.data?.toString()??"",kind:Q.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Ii,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:a,ctx:l}=e,s=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&o!==void 0&&i!==void 0){const c=Pr(s,l,n.baseFontFull),f=mh(c,a,n,t.contentAlign),{x:g,y:p,width:h,height:m}=f;if(o>=g-4&&o<=g-4+h+8&&i>=p-4&&i<=p-4+m+8){const y=Qn(l,n.baseFontFull);r("pointer");const w=5,v=p-y;l.beginPath(),l.moveTo(a.x+g,Math.floor(a.y+v+m+w)+.5),l.lineTo(a.x+g+h,Math.floor(a.y+v+m+w)+.5),l.strokeStyle=n.linkColor,l.stroke(),l.save(),l.fillStyle=e.cellFillColor,ar({...e,rect:{...a,x:a.x-1}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x-2}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x+1}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x+2}},s,t.contentAlign),l.restore()}}l.fillStyle=u?n.linkColor:n.textDark,ar(e,s,t.contentAlign)},onSelect:e=>{ld(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;ld(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:o,validatedSelection:i}=t;return d.createElement(Zw,{forceEditMode:r.readonly!==!0&&(o||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:i,readonly:r.readonly===!0,onChange:a=>n({...r,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Qw=[Fw,_w,bw,Cw,Rw,Tw,Pw,Hw,jw,Gw,Xw,Kw,qw];var Ul,sd;function Jw(){if(sd)return Ul;sd=1;var e=Sf(),t=Pa(),n="Expected a function";function r(o,i,a){var l=!0,s=!0;if(typeof o!="function")throw new TypeError(n);return t(a)&&(l="leading"in a?!!a.leading:l,s="trailing"in a?!!a.trailing:s),e(o,i,{leading:l,maxWait:i,trailing:s})}return Ul=r,Ul}var ey=Jw();const ty=Dr(ey),Xl=[];class ny extends Kf{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=ty(()=>{this.imageLoaded(new mi(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let o=!1;for(let i=0;i<r.cells.length;i++){const a=r.cells[i];if(this.isInWindow(a)){o=!0;break}}o?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,o){let i=!1;const a=Xl.pop()??new Image;let l=!1;const s={img:void 0,cells:[Zn(n,r)],url:t,cancel:()=>{l||(l=!0,Xl.length<12?Xl.unshift(a):i||(a.src=""))}},u=new Promise(c=>a.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{a.src=t,await u,await a.decode();const c=this.cache[o];if(c!==void 0&&!l){c.img=a;for(const f of c.cells)this.loadedLocations.push(Us(f));i=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[o]=s}loadOrGetImage(t,n,r){const o=t,i=this.cache[o];if(i!==void 0){const a=Zn(n,r);return i.cells.includes(a)||i.cells.push(a),i.img}else this.loadImage(t,n,r,o)}}const ry=(e,t)=>{const n=d.useMemo(()=>({...Nb,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??Qw,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new ny,[e.imageWindowLoader]);return d.createElement(vw,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})},oy=d.forwardRef(ry);function vh(e,t){const n=d.useRef(),r=d.useRef(e);d.useEffect(()=>{r.current=e},[e]);const{clear:o,restart:i}=di(()=>{n.current&&(r.current(...n.current),n.current=void 0)},t,{autoStart:!1}),a=d.useCallback(()=>{o(),n.current=void 0},[o]);return{debouncedCallback:d.useCallback((...l)=>{n.current=l,i()},[i]),cancel:a}}var bs={exports:{}},iy=bs.exports,ud;function ay(){return ud||(ud=1,(function(e,t){(function(n,r){try{e.exports=r(vm)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(iy,function(n){var r=!1,o=!1,i=!1,a=!1,l="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(V,L){return L.length>V.length?!1:V.indexOf(L)!==-1}function c(V){for(var L="";V;)L+="0",V-=1;return L}function f(V){for(var L=V.split("").reverse(),G=0,oe=!0;oe&&G<L.length;)G?L[G]==="9"?L[G]="0":(L[G]=(parseInt(L[G],10)+1).toString(),oe=!1):(parseInt(L[G],10)<5&&(oe=!1),L[G]="0"),G+=1;return oe&&L.push("1"),L.reverse().join("")}function g(V,L){var G=A(S(L).sort(),function(re){return re+":"+L[re]}).join(","),oe=V+"+"+G;return g.cache[oe]||(g.cache[oe]=Intl.NumberFormat(V,L)),g.cache[oe]}g.cache={};function p(V,L,G){var oe=L.useToLocaleString,re=L.useGrouping,Te=re&&L.grouping.slice(),xe=L.maximumSignificantDigits,Je=L.minimumIntegerDigits||1,Re=L.fractionDigits||0,Pt=L.groupingSeparator,bt=L.decimalSeparator;if(oe&&G){var Ee={minimumIntegerDigits:Je,useGrouping:re};if(Re&&(Ee.maximumFractionDigits=Re,Ee.minimumFractionDigits=Re),xe&&V>0&&(Ee.maximumSignificantDigits=xe),i){if(!a){var ne=D({},L);ne.useGrouping=!1,ne.decimalSeparator=".",V=parseFloat(p(V,ne),10)}return g(G,Ee).format(V)}else{if(!o){var ne=D({},L);ne.useGrouping=!1,ne.decimalSeparator=".",V=parseFloat(p(V,ne),10)}return V.toLocaleString(G,Ee)}}var me;xe?me=V.toPrecision(xe+1):me=V.toFixed(Re+1);var we,ae,ye,ze=me.split("e");ye=ze[1]||"",ze=ze[0].split("."),ae=ze[1]||"",we=ze[0]||"";var Le=we.length,nt=ae.length,Pe=Le+nt,qe=we+ae;(xe&&Pe===xe+1||!xe&&nt===Re+1)&&(qe=f(qe),qe.length===Pe+1&&(Le=Le+1),nt&&(qe=qe.slice(0,-1)),we=qe.slice(0,Le),ae=qe.slice(Le)),xe&&(ae=ae.replace(/0*$/,""));var Ve=parseInt(ye,10);Ve>0?ae.length<=Ve?(ae=ae+c(Ve-ae.length),we=we+ae,ae=""):(we=we+ae.slice(0,Ve),ae=ae.slice(Ve)):Ve<0&&(ae=c(Math.abs(Ve)-we.length)+we+ae,we="0"),xe||(ae=ae.slice(0,Re),ae.length<Re&&(ae=ae+c(Re-ae.length)),we.length<Je&&(we=c(Je-we.length)+we));var ve="";if(re){ze=we;for(var Ne;ze.length;)Te.length&&(Ne=Te.shift()),ve&&(ve=Pt+ve),ve=ze.slice(-Ne)+ve,ze=ze.slice(0,-Ne)}else ve=we;return ae&&(ve=ve+bt+ae),ve}function h(V,L){return V.label.length>L.label.length?-1:V.label.length<L.label.length?1:0}function m(V,L){var G=[];return C(S(L),function(oe){if(oe.slice(0,15)==="_durationLabels"){var re=oe.slice(15).toLowerCase();C(S(L[oe]),function(Te){Te.slice(0,1)===V&&G.push({type:re,key:Te,label:L[oe][Te]})})}}),G}function y(V,L,G){return L===1&&G===null?V:V+V}var w={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:y};function v(V){return Object.prototype.toString.call(V)==="[object Array]"}function x(V){return Object.prototype.toString.call(V)==="[object Object]"}function T(V,L){for(var G=V.length;G-=1;)if(L(V[G]))return V[G]}function I(V,L){var G=0,oe=V&&V.length||0,re;for(typeof L!="function"&&(re=L,L=function(Te){return Te===re});G<oe;){if(L(V[G]))return V[G];G+=1}}function C(V,L){var G=0,oe=V.length;if(!(!V||!oe))for(;G<oe;){if(L(V[G],G)===!1)return;G+=1}}function A(V,L){var G=0,oe=V.length,re=[];if(!V||!oe)return re;for(;G<oe;)re[G]=L(V[G],G),G+=1;return re}function E(V,L){return A(V,function(G){return G[L]})}function k(V){var L=[];return C(V,function(G){G&&L.push(G)}),L}function P(V){var L=[];return C(V,function(G){I(L,G)||L.push(G)}),L}function O(V,L){var G=[];return C(V,function(oe){C(L,function(re){oe===re&&G.push(oe)})}),P(G)}function R(V,L){var G=[];return C(V,function(oe,re){if(!L(oe))return G=V.slice(re),!1}),G}function M(V,L){var G=V.slice().reverse();return R(G,L).reverse()}function D(V,L){for(var G in L)L.hasOwnProperty(G)&&(V[G]=L[G]);return V}function S(V){var L=[];for(var G in V)V.hasOwnProperty(G)&&L.push(G);return L}function K(V,L){var G=0,oe=V.length;if(!V||!oe)return!1;for(;G<oe;){if(L(V[G],G)===!0)return!0;G+=1}return!1}function B(V){var L=[];return C(V,function(G){L=L.concat(G)}),L}function X(){var V=0;try{V.toLocaleString("i")}catch(L){return L.name==="RangeError"}return!1}function ie(V){return V(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function te(V){var L=!0;return L=L&&V(1,"en",{minimumIntegerDigits:1})==="1",L=L&&V(1,"en",{minimumIntegerDigits:2})==="01",L=L&&V(1,"en",{minimumIntegerDigits:3})==="001",!(!L||(L=L&&V(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",L=L&&V(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",L=L&&V(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",L=L&&V(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!L)||(L=L&&V(99.99,"en",{maximumSignificantDigits:1})==="100",L=L&&V(99.99,"en",{maximumSignificantDigits:2})==="100",L=L&&V(99.99,"en",{maximumSignificantDigits:3})==="100",L=L&&V(99.99,"en",{maximumSignificantDigits:4})==="99.99",L=L&&V(99.99,"en",{maximumSignificantDigits:5})==="99.99",!L)||(L=L&&V(1e3,"en",{useGrouping:!0})==="1,000",L=L&&V(1e3,"en",{useGrouping:!1})==="1000",!L))}function q(){var V=[].slice.call(arguments),L={},G;if(C(V,function(xe,Je){if(!Je){if(!v(xe))throw"Expected array as the first argument to durationsFormat.";G=xe}if(typeof xe=="string"||typeof xe=="function"){L.template=xe;return}if(typeof xe=="number"){L.precision=xe;return}x(xe)&&D(L,xe)}),!G||!G.length)return[];L.returnMomentTypes=!0;var oe=A(G,function(xe){return xe.format(L)}),re=O(l,P(E(B(oe),"type"))),Te=L.largest;return Te&&(re=re.slice(0,Te)),L.returnMomentTypes=!1,L.outputTypes=re,A(G,function(xe){return xe.format(L)})}function ge(){var V=[].slice.call(arguments),L=D({},this.format.defaults),G=this.asMilliseconds(),oe=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(G=0,oe=0);var re=G<0,Te=n.duration(Math.abs(G),"milliseconds"),xe=n.duration(Math.abs(oe),"months");C(V,function(N){if(typeof N=="string"||typeof N=="function"){L.template=N;return}if(typeof N=="number"){L.precision=N;return}x(N)&&D(L,N)});var Je={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Re={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};L.types=l;var Pt=function(N){return I(l,function(_e){return Re[_e].test(N)})},bt=new RegExp(A(l,function(N){return Re[N].source}).join("|"),"g");L.duration=this;var Ee=typeof L.template=="function"?L.template.apply(L):L.template,ne=L.outputTypes,me=L.returnMomentTypes,we=L.largest,ae=[];ne||(v(L.stopTrim)&&(L.stopTrim=L.stopTrim.join("")),L.stopTrim&&C(L.stopTrim.match(bt),function(N){var _e=Pt(N);_e==="escape"||_e==="general"||ae.push(_e)}));var ye=n.localeData();ye||(ye={}),C(S(w),function(N){if(typeof w[N]=="function"){ye[N]||(ye[N]=w[N]);return}ye["_"+N]||(ye["_"+N]=w[N])}),C(S(ye._durationTimeTemplates),function(N){Ee=Ee.replace("_"+N+"_",ye._durationTimeTemplates[N])});var ze=L.userLocale||n.locale(),Le=L.useLeftUnits,nt=L.usePlural,Pe=L.precision,qe=L.forceLength,Ve=L.useGrouping,ve=L.trunc,Ne=L.useSignificantDigits&&Pe>0,Qe=Ne?L.precision:0,ut=Qe,Be=L.minValue,Mt=!1,Nt=L.maxValue,mt=!1,pt=L.useToLocaleString,Yt=L.groupingSeparator,Ht=L.decimalSeparator,kn=L.grouping;pt=pt&&(r||i);var ht=L.trim;v(ht)&&(ht=ht.join(" ")),ht===null&&(we||Nt||Ne)&&(ht="all"),(ht===null||ht===!0||ht==="left"||ht==="right")&&(ht="large"),ht===!1&&(ht="");var ft=function(N){return N.test(ht)},Gt=/large/,wt=/small/,nn=/both/,Zt=/mid/,be=/^all|[^sm]all/,tt=/final/,Ft=we>0||K([Gt,nn,be],ft),Tn=K([wt,nn,be],ft),qt=K([Zt,be],ft),rn=K([tt,be],ft),On=A(Ee.match(bt),function(N,_e){var We=Pt(N);return N.slice(0,1)==="*"&&(N=N.slice(1),We!=="escape"&&We!=="general"&&ae.push(We)),{index:_e,length:N.length,text:"",token:We==="escape"?N.replace(Re.escape,"$1"):N,type:We==="escape"||We==="general"?null:We}}),on={index:0,length:0,token:"",text:"",type:null},Ut=[];Le&&On.reverse(),C(On,function(N){if(N.type){(on.type||on.text)&&Ut.push(on),on=N;return}Le?on.text=N.token+on.text:on.text+=N.token}),(on.type||on.text)&&Ut.push(on),Le&&Ut.reverse();var $e=O(l,P(k(E(Ut,"type"))));if(!$e.length)return E(Ut,"text").join("");$e=A($e,function(N,_e){var We=_e+1===$e.length,It=!_e,an;N==="years"||N==="months"?an=xe.as(N):an=Te.as(N);var cn=Math.floor(an),Mn=an-cn,fn=I(Ut,function(Bt){return N===Bt.type});return It&&Nt&&an>Nt&&(mt=!0),We&&Be&&Math.abs(L.duration.as(N))<Be&&(Mt=!0),It&&qe===null&&fn.length>1&&(qe=!0),Te.subtract(cn,N),xe.subtract(cn,N),{rawValue:an,wholeValue:cn,decimalValue:We?Mn:0,isSmallest:We,isLargest:It,type:N,tokenLength:fn.length}});var yt=ve?Math.floor:Math.round,Dn=function(N,_e){var We=Math.pow(10,_e);return yt(N*We)/We},xt=!1,at=!1,Sn=function(N,_e){var We={useGrouping:Ve,groupingSeparator:Yt,decimalSeparator:Ht,grouping:kn,useToLocaleString:pt};return Ne&&(Qe<=0?(N.rawValue=0,N.wholeValue=0,N.decimalValue=0):(We.maximumSignificantDigits=Qe,N.significantDigits=Qe)),mt&&!at&&(N.isLargest?(N.wholeValue=Nt,N.decimalValue=0):(N.wholeValue=0,N.decimalValue=0)),Mt&&!at&&(N.isSmallest?(N.wholeValue=Be,N.decimalValue=0):(N.wholeValue=0,N.decimalValue=0)),N.isSmallest||N.significantDigits&&N.significantDigits-N.wholeValue.toString().length<=0?Pe<0?N.value=Dn(N.wholeValue,Pe):Pe===0?N.value=yt(N.wholeValue+N.decimalValue):Ne?(ve?N.value=Dn(N.rawValue,Qe-N.wholeValue.toString().length):N.value=N.rawValue,N.wholeValue&&(Qe-=N.wholeValue.toString().length)):(We.fractionDigits=Pe,ve?N.value=N.wholeValue+Dn(N.decimalValue,Pe):N.value=N.wholeValue+N.decimalValue):Ne&&N.wholeValue?(N.value=Math.round(Dn(N.wholeValue,N.significantDigits-N.wholeValue.toString().length)),Qe-=N.wholeValue.toString().length):N.value=N.wholeValue,N.tokenLength>1&&(qe||xt)&&(We.minimumIntegerDigits=N.tokenLength,at&&We.maximumSignificantDigits<N.tokenLength&&delete We.maximumSignificantDigits),!xt&&(N.value>0||ht===""||I(ae,N.type)||I(ne,N.type))&&(xt=!0),N.formattedValue=p(N.value,We,ze),We.useGrouping=!1,We.decimalSeparator=".",N.formattedValueEn=p(N.value,We,"en"),N.tokenLength===2&&N.type==="milliseconds"&&(N.formattedValueMS=p(N.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),N};if($e=A($e,Sn),$e=k($e),$e.length>1){var cr=function(N){return I($e,function(_e){return _e.type===N})},Jn=function(N){var _e=cr(N.type);_e&&C(N.targets,function(We){var It=cr(We.type);It&&parseInt(_e.formattedValueEn,10)===We.value&&(_e.rawValue=0,_e.wholeValue=0,_e.decimalValue=0,It.rawValue+=1,It.wholeValue+=1,It.decimalValue=0,It.formattedValueEn=It.wholeValue.toString(),at=!0)})};C(s,Jn)}return at&&(xt=!1,Qe=ut,$e=A($e,Sn),$e=k($e)),ne&&!(mt&&!L.trim)?($e=A($e,function(N){return I(ne,function(_e){return N.type===_e})?N:null}),$e=k($e)):(Ft&&($e=R($e,function(N){return!N.isSmallest&&!N.wholeValue&&!I(ae,N.type)})),we&&$e.length&&($e=$e.slice(0,we)),Tn&&$e.length>1&&($e=M($e,function(N){return!N.wholeValue&&!I(ae,N.type)&&!N.isLargest})),qt&&($e=A($e,function(N,_e){return _e>0&&_e<$e.length-1&&!N.wholeValue?null:N}),$e=k($e)),rn&&$e.length===1&&!$e[0].wholeValue&&!(!ve&&$e[0].isSmallest&&$e[0].rawValue<Be)&&($e=[])),me?$e:(C(Ut,function(N){var _e=Je[N.type],We=I($e,function(Bt){return Bt.type===N.type});if(!(!_e||!We)){var It=We.formattedValueEn.split(".");It[0]=parseInt(It[0],10),It[1]?It[1]=parseFloat("0."+It[1],10):It[1]=null;var an=ye.durationPluralKey(_e,It[0],It[1]),cn=m(_e,ye),Mn=!1,fn={};C(ye._durationLabelTypes,function(Bt){var Rn=I(cn,function(hn){return hn.type===Bt.type&&hn.key===an});Rn&&(fn[Rn.type]=Rn.label,u(N.text,Bt.string)&&(N.text=N.text.replace(Bt.string,Rn.label),Mn=!0))}),nt&&!Mn&&(cn.sort(h),C(cn,function(Bt){if(fn[Bt.type]===Bt.label)return u(N.text,Bt.label)?!1:void 0;if(u(N.text,Bt.label))return N.text=N.text.replace(Bt.label,fn[Bt.type]),!1}))}}),Ut=A(Ut,function(N){if(!N.type)return N.text;var _e=I($e,function(It){return It.type===N.type});if(!_e)return"";var We="";return Le&&(We+=N.text),(re&&mt||!re&&Mt)&&(We+="< ",mt=!1,Mt=!1),(re&&Mt||!re&&mt)&&(We+="> ",mt=!1,Mt=!1),re&&(_e.value>0||ht===""||I(ae,_e.type)||I(ne,_e.type))&&(We+="-",re=!1),N.type==="milliseconds"&&_e.formattedValueMS?We+=_e.formattedValueMS:We+=_e.formattedValue,Le||(We+=N.text),We}),Ut.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function se(){var V=this.duration,L=function(re){return V._data[re]},G=I(this.types,L),oe=T(this.types,L);switch(G){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(G===oe)return"d __";case"weeks":return G===oe?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(G===oe)return"M __";case"years":return G===oe?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function ce(V){if(!V)throw"Moment Duration Format init cannot find moment instance.";V.duration.format=q,V.duration.fn.format=ge,V.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:se,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},V.updateLocale("en",w)}var pe=function(V,L,G){return V.toLocaleString(L,G)};r=X()&&te(pe),o=r&&ie(pe);var ue=function(V,L,G){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(L,G).format(V)};return i=te(ue),a=i&&ie(ue),ce(n),ce})})(bs)),bs.exports}ay();const ly=["true","t","yes","y","on","1"],sy=["false","f","no","n","off","0"];function Rt(e,t=""){return{kind:Q.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function Oo(e){return Object.hasOwn(e,"isError")&&e.isError}function uy(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Zs(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function ws(e=!1){return e?{kind:Q.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Q.Loading,allowOverlay:!1,copyData:""}}function cy(e,t){const n=t?"faded":"normal";return{kind:Q.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function ys(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 Ao(e,t){return Se(e)?t||{}:Se(t)?e||{}:af(e,t)}function qs(e){if(Se(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(e instanceof Uint8Array&&(e=new TextDecoder("utf-8").decode(e)),typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:et(n)):[et(t)]}catch{return[et(e)]}}function bh(e){return typeof e=="string"||e instanceof String?!0:(e instanceof xg&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function dy(e){return typeof e=="string"&&e.startsWith("{")&&e.endsWith("}")}function et(e){try{try{return bg(e)}catch{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}}catch{return`[${typeof e}]`}}function wh(e){if(Se(e))return null;if(typeof e=="boolean")return e;const t=et(e).toLowerCase().trim();if(t==="")return null;if(ly.includes(t))return!0;if(sy.includes(t))return!1}function xi(e){if(Se(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=ym.unformat(e.trim());if(dt(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function yh(e){return Se(e)?"":et(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function Ca(e){if(Se(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return et(e)}}function Ji(e){if(Se(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=Xr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Xr.utc(e);if(n.isValid())return n.toDate();const r=Xr.utc(e,[Xr.HTML5_FMT.TIME_MS,Xr.HTML5_FMT.TIME_SECONDS,Xr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function xh(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 fy(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,o=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*o)/n}const hy=new RegExp(/(\r\n|\n|\r)/gm);function Ci(e){return e.indexOf(`
187
+ `)!==-1?e.replace(hy," "):e}function py(e,t){if(Se(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const gy=Cn("div",{target:"en99xsi0"})(({theme:e})=>({overflowY:"auto",padding:e.spacing.sm,".react-json-view .copy-icon svg":{fontSize:"0.9em !important",marginRight:`${e.spacing.threeXS} !important`,verticalAlign:"middle !important"}}),""),Ch=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?il.parse(e):il.parse(il.stringify(e))}catch{n=void 0}return Se(n)?fe.jsx(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:Ca(e)??"",onChange:()=>{}}):fe.jsx(gy,{"data-testid":"stJsonColumnViewer",children:fe.jsx(Fm,{src:n,collapsed:2,theme:Zg(t.bgCell)>.5?"rjv-default":"monokai",displayDataTypes:!1,displayObjectSize:!1,name:!1,enableClipboard:!0,showComma:!1,style:{fontFamily:t.fontFamily,fontSize:t.baseFontStyle,backgroundColor:t.bgCell,whiteSpace:"pre-wrap"}})})},my=e=>{const t=e.theme,n=e.value.data;return fe.jsx(Ch,{jsonValue:n.value||n.displayValue,theme:t})},vy=e=>{const t=e.theme,n=e.value;return fe.jsx(Ch,{jsonValue:n.data,theme:t})},by={kind:Q.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return Bs(e,r??Ca(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:o}=t.data,i=o??Ca(r)??"";return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:my})},cd={audio:"audio_file",video:"video_file"},wy=Cn("audio",{target:"e1nwofre1"})({name:"2jeuwc",styles:"width:100%;min-width:18.75rem"}),yy=Cn("video",{target:"e1nwofre0"})({name:"1clw4ve",styles:"max-width:25rem;max-height:18.75rem;width:100%"}),xy=e=>{const{src:t,mediaType:n}=e.value.data;return t?n==="audio"?fe.jsx(wy,{src:t,controls:!0,autoPlay:!1,"aria-label":"Audio player"}):fe.jsx(yy,{src:t,controls:!0,autoPlay:!1,"aria-label":"Video player"}):null},Cy={kind:Q.Custom,isMatch:e=>e.data.kind==="media-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{src:i,mediaType:a}=t.data;if(!i)return!0;const l=cd[a];n.save(),n.font=`${r.bubbleHeight}px ${as.iconFont}`,n.fillStyle=r.textLight,n.textAlign=t.contentAlign||"center",n.textBaseline="middle";let s;switch(t.contentAlign){case"left":s=o.x+r.cellHorizontalPadding;break;case"right":s=o.x+o.width-r.cellHorizontalPadding;break;default:s=o.x+o.width/2}const u=o.y+o.height/2;return n.fillText(l,s,u),n.restore(),!0},measure:(e,t,n)=>{const r=cd[t.data.mediaType];return e.font=`${n.bubbleHeight}px ${as.iconFont}`,e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:xy})};function dd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function De(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dd(Object(n),!0).forEach(function(r){si(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dd(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ky=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function kh(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,o=r===void 0?!1:r,i=e.defaultValue,a=i===void 0?null:i,l=e.inputValue,s=e.menuIsOpen,u=e.onChange,c=e.onInputChange,f=e.onMenuClose,g=e.onMenuOpen,p=e.value,h=ur(e,ky),m=d.useState(l!==void 0?l:n),y=vr(m,2),w=y[0],v=y[1],x=d.useState(s!==void 0?s:o),T=vr(x,2),I=T[0],C=T[1],A=d.useState(p!==void 0?p:a),E=vr(A,2),k=E[0],P=E[1],O=d.useCallback(function(X,ie){typeof u=="function"&&u(X,ie),P(X)},[u]),R=d.useCallback(function(X,ie){var te;typeof c=="function"&&(te=c(X,ie)),v(te!==void 0?te:X)},[c]),M=d.useCallback(function(){typeof g=="function"&&g(),C(!0)},[g]),D=d.useCallback(function(){typeof f=="function"&&f(),C(!1)},[f]),S=l!==void 0?l:w,K=s!==void 0?s:I,B=p!==void 0?p:k;return De(De({},h),{},{inputValue:S,menuIsOpen:K,onChange:O,onInputChange:R,onMenuClose:D,onMenuOpen:M,value:B})}function Sy(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function My(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Ry=(function(){function e(n){var r=this;this._insertTag=function(o){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(o,i),r.tags.push(o)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(My(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=Sy(r);try{o.insertRule(n,o.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e})(),Iy=function(e,t,n){for(var r=0,o=0;r=o,o=ls(),r===38&&o===12&&(t[n]=1),!cf(o);)uf();return fm(e,df)},Ey=function(e,t){var n=-1,r=44;do switch(cf(r)){case 0:r===38&&ls()===12&&(t[n]=1),e[n]+=Iy(df-1,t,n);break;case 2:e[n]+=dm(r);break;case 4:if(r===44){e[++n]=ls()===58?"&\f":"",t[n]=e[n].length;break}default:e[n]+=cm(r)}while(r=uf());return e},Ty=function(e,t){return lm(Ey(sm(e),t))},fd=new WeakMap,Oy=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!fd.get(n))&&!r){fd.set(e,!0);for(var o=[],i=Ty(t,o),a=n.props,l=0,s=0;l<i.length;l++)for(var u=0;u<a.length;u++,s++)e.props[s]=o[l]?i[l].replace(/&\f/g,a[u]):a[u]+" "+i[l]}}},Dy=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function Sh(e,t){switch(um(e,t)){case 5103:return kt+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return kt+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return kt+e+da+e+bn+e+e;case 6828:case 4268:return kt+e+bn+e+e;case 6165:return kt+e+bn+"flex-"+e+e;case 5187:return kt+e+Lt(e,/(\w+).+(:[^]+)/,kt+"box-$1$2"+bn+"flex-$1$2")+e;case 5443:return kt+e+bn+"flex-item-"+Lt(e,/flex-|-self/,"")+e;case 4675:return kt+e+bn+"flex-line-pack"+Lt(e,/align-content|flex-|-self/,"")+e;case 5548:return kt+e+bn+Lt(e,"shrink","negative")+e;case 5292:return kt+e+bn+Lt(e,"basis","preferred-size")+e;case 6060:return kt+"box-"+Lt(e,"-grow","")+kt+e+bn+Lt(e,"grow","positive")+e;case 4554:return kt+Lt(e,/([^-])(transform)/g,"$1"+kt+"$2")+e;case 6187:return Lt(Lt(Lt(e,/(zoom-|grab)/,kt+"$1"),/(image-set)/,kt+"$1"),e,"")+e;case 5495:case 3959:return Lt(e,/(image-set\([^]*)/,kt+"$1$`$1");case 4968:return Lt(Lt(e,/(.+:)(flex-)?(.*)/,kt+"box-pack:$3"+bn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+kt+e+e;case 4095:case 3583:case 4068:case 2532:return Lt(e,/(.+)-inline(.+)/,kt+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Lu(e)-1-t>6)switch(Gr(e,t+1)){case 109:if(Gr(e,t+4)!==45)break;case 102:return Lt(e,/(.+:)(.+)-([^]+)/,"$1"+kt+"$2-$3$1"+da+(Gr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Hu(e,"stretch")?Sh(Lt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Gr(e,t+1)!==115)break;case 6444:switch(Gr(e,Lu(e)-3-(~Hu(e,"!important")&&10))){case 107:return Lt(e,":",":"+kt)+e;case 101:return Lt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+kt+(Gr(e,14)===45?"inline-":"")+"box$3$1"+kt+"$2$3$1"+bn+"$2box$3")+e}break;case 5936:switch(Gr(e,t+11)){case 114:return kt+e+bn+Lt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return kt+e+bn+Lt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return kt+e+bn+Lt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return kt+e+bn+e+e}return e}var Py=function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case om:e.return=Sh(e.value,e.length);break;case rm:return ia([Xo(e,{value:Lt(e.value,"@","@"+kt)})],r);case em:if(e.length)return tm(e.props,function(o){switch(nm(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ia([Xo(e,{props:[Lt(o,/:(read-\w+)/,":"+da+"$1")]})],r);case"::placeholder":return ia([Xo(e,{props:[Lt(o,/:(plac\w+)/,":"+kt+"input-$1")]}),Xo(e,{props:[Lt(o,/:(plac\w+)/,":"+da+"$1")]}),Xo(e,{props:[Lt(o,/:(plac\w+)/,bn+"input-$1")]})],r)}return""})}},Ay=[Py],Ly=function(e){var t=e.key;if(t==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(h){var m=h.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(h),h.setAttribute("data-s",""))})}var r=e.stylisPlugins||Ay,o={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(h){for(var m=h.getAttribute("data-emotion").split(" "),y=1;y<m.length;y++)o[m[y]]=!0;a.push(h)});var l,s=[Oy,Dy];{var u,c=[Qg,hm(function(h){u.insert(h)})],f=vg(s.concat(r,c)),g=function(h){return ia(pm(h),f)};l=function(h,m,y,w){u=y,g(h?h+"{"+m.styles+"}":m.styles),w&&(p.inserted[m.name]=!0)}}var p={key:t,sheet:new Ry({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return p.sheet.hydrate(a),p},Hy=function(e){return e()},Fy=d.useInsertionEffect?d.useInsertionEffect:!1,zy=Fy||Hy,Qs={}.hasOwnProperty,Mh=d.createContext(typeof HTMLElement<"u"?Ly({key:"css"}):null);Mh.Provider;var Vy=function(e){return d.forwardRef(function(t,n){var r=d.useContext(Mh);return e(t,r,n)})},$y=d.createContext({}),xs="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",_y=function(e,t){var n={};for(var r in t)Qs.call(t,r)&&(n[r]=t[r]);return n[xs]=e,n},Ny=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return im(t,n,r),zy(function(){return am(t,n,r)}),null},By=Vy(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var o=e[xs],i=[r],a="";typeof e.className=="string"?a=Jg(t.registered,i,e.className):e.className!=null&&(a=e.className+" ");var l=of(i,void 0,d.useContext($y));a+=t.key+"-"+l.name;var s={};for(var u in e)Qs.call(e,u)&&u!=="css"&&u!==xs&&(s[u]=e[u]);return s.ref=n,s.className=a,d.createElement(d.Fragment,null,d.createElement(Ny,{cache:t,serialized:l,isStringTag:typeof o=="string"}),d.createElement(o,s))}),Wy=By,Ae=function(e,t){var n=arguments;if(t==null||!Qs.call(t,"css"))return d.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=Wy,o[1]=_y(e,t);for(var i=2;i<r;i++)o[i]=n[i];return d.createElement.apply(null,o)};function Js(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return of(t)}var jy=function(){var e=Js.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function Gy(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Uy=Math.min,Xy=Math.max,ka=Math.round,ea=Math.floor,Cs=e=>({x:e,y:e});function Ky(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ha(){return typeof window<"u"}function Rh(e){return Eh(e)?(e.nodeName||"").toLowerCase():"#document"}function Or(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ih(e){var t;return(t=(Eh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Eh(e){return Ha()?e instanceof Node||e instanceof Or(e).Node:!1}function Yy(e){return Ha()?e instanceof Element||e instanceof Or(e).Element:!1}function eu(e){return Ha()?e instanceof HTMLElement||e instanceof Or(e).HTMLElement:!1}function hd(e){return!Ha()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Or(e).ShadowRoot}const Zy=new Set(["inline","contents"]);function Th(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=tu(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Zy.has(o)}const qy=new Set(["html","body","#document"]);function Qy(e){return qy.has(Rh(e))}function tu(e){return Or(e).getComputedStyle(e)}function Jy(e){if(Rh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hd(e)&&e.host||Ih(e);return hd(t)?t.host:t}function Oh(e){const t=Jy(e);return Qy(t)?e.ownerDocument?e.ownerDocument.body:e.body:eu(t)&&Th(t)?t:Oh(t)}function Sa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Oh(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Or(o);if(i){const l=ks(a);return t.concat(a,a.visualViewport||[],Th(o)?o:[],l&&n?Sa(l):[])}return t.concat(o,Sa(o,[],n))}function ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ex(e){const t=tu(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=eu(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=ka(n)!==i||ka(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function nu(e){return Yy(e)?e:e.contextElement}function pd(e){const t=nu(e);if(!eu(t))return Cs(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ex(t);let a=(i?ka(n.width):n.width)/r,l=(i?ka(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}function gd(e,t,n,r){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),i=nu(e);let a=Cs(1);t&&(a=pd(e));const l=Cs(0);let s=(o.left+l.x)/a.x,u=(o.top+l.y)/a.y,c=o.width/a.x,f=o.height/a.y;if(i){const g=Or(i),p=r;let h=g,m=ks(h);for(;m&&r&&p!==h;){const y=pd(m),w=m.getBoundingClientRect(),v=tu(m),x=w.left+(m.clientLeft+parseFloat(v.paddingLeft))*y.x,T=w.top+(m.clientTop+parseFloat(v.paddingTop))*y.y;s*=y.x,u*=y.y,c*=y.x,f*=y.y,s+=x,u+=T,h=Or(m),m=ks(h)}}return Ky({width:c,height:f,x:s,y:u})}function Dh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tx(e,t){let n=null,r;const o=Ih(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,s){l===void 0&&(l=!1),s===void 0&&(s=1),i();const u=e.getBoundingClientRect(),{left:c,top:f,width:g,height:p}=u;if(l||t(),!g||!p)return;const h=ea(f),m=ea(o.clientWidth-(c+g)),y=ea(o.clientHeight-(f+p)),w=ea(c),v={rootMargin:-h+"px "+-m+"px "+-y+"px "+-w+"px",threshold:Xy(0,Uy(1,s))||1};let x=!0;function T(I){const C=I[0].intersectionRatio;if(C!==s){if(!x)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},1e3)}C===1&&!Dh(u,e.getBoundingClientRect())&&a(),x=!1}try{n=new IntersectionObserver(T,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,v)}n.observe(e)}return a(!0),i}function nx(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,u=nu(e),c=o||i?[...u?Sa(u):[],...Sa(t)]:[];c.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const f=u&&l?tx(u,n):null;let g=-1,p=null;a&&(p=new ResizeObserver(w=>{let[v]=w;v&&v.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),u&&!s&&p.observe(u),p.observe(t));let h,m=s?gd(e):null;s&&y();function y(){const w=gd(e);m&&!Dh(m,w)&&n(),m=w,h=requestAnimationFrame(y)}return n(),()=>{var w;c.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),f?.(),(w=p)==null||w.disconnect(),p=null,s&&cancelAnimationFrame(h)}}var Ss=d.useLayoutEffect,rx=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ma=function(){};function ox(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function ix(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&i.push("".concat(ox(e,a)));return i.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var Ra=function(e){return px(e)?e.filter(Boolean):qg(e)==="object"&&e!==null?[e]:[]},Ph=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var t=ur(e,rx);return De({},t)},Kt=function(e,t,n){var r=e.cx,o=e.getStyles,i=e.getClassNames,a=e.className;return{css:o(t,e),className:r(n??{},i(t,e),a)}};function Fa(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function ax(e){return Fa(e)?window.innerHeight:e.clientHeight}function Ah(e){return Fa(e)?window.pageYOffset:e.scrollTop}function Ia(e,t){if(Fa(e)){window.scrollTo(0,t);return}e.scrollTop=t}function lx(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}function sx(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function ta(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ma,o=Ah(e),i=t-o,a=10,l=0;function s(){l+=a;var u=sx(l,o,i,n);Ia(e,u),l<n?window.requestAnimationFrame(s):r(e)}s()}function md(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?Ia(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&Ia(e,Math.max(t.offsetTop-o,0))}function ux(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 vd(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function cx(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Lh=!1,dx={get passive(){return Lh=!0}},na=typeof window<"u"?window:{};na.addEventListener&&na.removeEventListener&&(na.addEventListener("p",Ma,dx),na.removeEventListener("p",Ma,!1));var fx=Lh;function hx(e){return e!=null}function px(e){return Array.isArray(e)}function ui(e,t,n){return e?t:n}var gx=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Object.entries(e).filter(function(i){var a=vr(i,1),l=a[0];return!n.includes(l)});return o.reduce(function(i,a){var l=vr(a,2),s=l[0],u=l[1];return i[s]=u,i},{})},mx=["children","innerProps"],vx=["children","innerProps"];function bx(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,a=e.isFixedPosition,l=e.controlHeight,s=lx(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=s.getBoundingClientRect(),f=c.height,g=n.getBoundingClientRect(),p=g.bottom,h=g.height,m=g.top,y=n.offsetParent.getBoundingClientRect(),w=y.top,v=a?window.innerHeight:ax(s),x=Ah(s),T=parseInt(getComputedStyle(n).marginBottom,10),I=parseInt(getComputedStyle(n).marginTop,10),C=w-I,A=v-m,E=C+x,k=f-x-m,P=p-v+x+T,O=x+m-I,R=160;switch(o){case"auto":case"bottom":if(A>=h)return{placement:"bottom",maxHeight:t};if(k>=h&&!a)return i&&ta(s,P,R),{placement:"bottom",maxHeight:t};if(!a&&k>=r||a&&A>=r){i&&ta(s,P,R);var M=a?A-T:k-T;return{placement:"bottom",maxHeight:M}}if(o==="auto"||a){var D=t,S=a?C:E;return S>=r&&(D=Math.min(S-T-l,t)),{placement:"top",maxHeight:D}}if(o==="bottom")return i&&Ia(s,P),{placement:"bottom",maxHeight:t};break;case"top":if(C>=h)return{placement:"top",maxHeight:t};if(E>=h&&!a)return i&&ta(s,O,R),{placement:"top",maxHeight:t};if(!a&&E>=r||a&&C>=r){var K=t;return(!a&&E>=r||a&&C>=r)&&(K=a?C-I:E-I),i&&ta(s,O,R),{placement:"top",maxHeight:K}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return u}function wx(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Hh=function(e){return e==="auto"?"bottom":e},yx=function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,l=o.colors;return De((n={label:"menu"},si(n,wx(r),"100%"),si(n,"position","absolute"),si(n,"width","100%"),si(n,"zIndex",1),n),t?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},Fh=d.createContext(null),xx=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,o=e.menuPlacement,i=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,s=d.useContext(Fh)||{},u=s.setPortalPlacement,c=d.useRef(null),f=d.useState(r),g=vr(f,2),p=g[0],h=g[1],m=d.useState(null),y=vr(m,2),w=y[0],v=y[1],x=l.spacing.controlHeight;return Ss(function(){var T=c.current;if(T){var I=i==="fixed",C=a&&!I,A=bx({maxHeight:r,menuEl:T,minHeight:n,placement:o,shouldScroll:C,isFixedPosition:I,controlHeight:x});h(A.maxHeight),v(A.placement),u?.(A.placement)}},[r,o,i,a,n,u,x]),t({ref:c,placerProps:De(De({},e),{},{placement:w||Hh(o),maxHeight:p})})},Cx=function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return Ae("div",Fe({},Kt(e,"menu",{menu:!0}),{ref:n},r),t)},kx=Cx,Sx=function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return De({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},Mx=function(e){var t=e.children,n=e.innerProps,r=e.innerRef,o=e.isMulti;return Ae("div",Fe({},Kt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},n),t)},zh=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return De({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Rx=zh,Ix=zh,Ex=function(e){var t=e.children,n=t===void 0?"No options":t,r=e.innerProps,o=ur(e,mx);return Ae("div",Fe({},Kt(De(De({},o),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},Tx=function(e){var t=e.children,n=t===void 0?"Loading...":t,r=e.innerProps,o=ur(e,vx);return Ae("div",Fe({},Kt(De(De({},o),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},Ox=function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},Dx=function(e){var t=e.appendTo,n=e.children,r=e.controlElement,o=e.innerProps,i=e.menuPlacement,a=e.menuPosition,l=d.useRef(null),s=d.useRef(null),u=d.useState(Hh(i)),c=vr(u,2),f=c[0],g=c[1],p=d.useMemo(function(){return{setPortalPlacement:g}},[]),h=d.useState(null),m=vr(h,2),y=m[0],w=m[1],v=d.useCallback(function(){if(r){var C=ux(r),A=a==="fixed"?0:window.pageYOffset,E=C[f]+A;(E!==y?.offset||C.left!==y?.rect.left||C.width!==y?.rect.width)&&w({offset:E,rect:C})}},[r,a,f,y?.offset,y?.rect.left,y?.rect.width]);Ss(function(){v()},[v]);var x=d.useCallback(function(){typeof s.current=="function"&&(s.current(),s.current=null),r&&l.current&&(s.current=nx(r,l.current,v,{elementResize:"ResizeObserver"in window}))},[r,v]);Ss(function(){x()},[x]);var T=d.useCallback(function(C){l.current=C,x()},[x]);if(!t&&a!=="fixed"||!y)return null;var I=Ae("div",Fe({ref:T},Kt(De(De({},e),{},{offset:y.offset,position:a,rect:y.rect}),"menuPortal",{"menu-portal":!0}),o),n);return Ae(Fh.Provider,{value:p},t?rf.createPortal(I,t):I)},Px=function(e){var t=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},Ax=function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return Ae("div",Fe({},Kt(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},Lx=function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return De({alignItems:"center",display:r&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(n.baseUnit*2,"px")})},Hx=function(e){var t=e.children,n=e.innerProps,r=e.isMulti,o=e.hasValue;return Ae("div",Fe({},Kt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)},Fx=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},zx=function(e){var t=e.children,n=e.innerProps;return Ae("div",Fe({},Kt(e,"indicatorsContainer",{indicators:!0}),n),t)},bd,Vx=["size"],$x=["innerProps","isRtl","size"],_x={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Vh=function(e){var t=e.size,n=ur(e,Vx);return Ae("svg",Fe({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:_x},n))},ru=function(e){return Ae(Vh,Fe({size:20},e),Ae("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"}))},$h=function(e){return Ae(Vh,Fe({size:20},e),Ae("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"}))},_h=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return De({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:o*2,":hover":{color:n?i.neutral80:i.neutral40}})},Nx=_h,Bx=function(e){var t=e.children,n=e.innerProps;return Ae("div",Fe({},Kt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Ae($h,null))},Wx=_h,jx=function(e){var t=e.children,n=e.innerProps;return Ae("div",Fe({},Kt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Ae(ru,null))},Gx=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return De({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:o*2,marginTop:o*2})},Ux=function(e){var t=e.innerProps;return Ae("span",Fe({},t,Kt(e,"indicatorSeparator",{"indicator-separator":!0})))},Xx=jy(bd||(bd=Gy([`
188
+ 0%, 80%, 100% { opacity: 0; }
189
+ 40% { opacity: 1; }
190
+ `]))),Kx=function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return De({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:a*2})},Kl=function(e){var t=e.delay,n=e.offset;return Ae("span",{css:Js({animation:"".concat(Xx," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Yx=function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=r===void 0?4:r,i=ur(e,$x);return Ae("div",Fe({},Kt(De(De({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Ae(Kl,{delay:0,offset:n}),Ae(Kl,{delay:160,offset:!0}),Ae(Kl,{delay:320,offset:!n}))},Zx=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius,l=o.spacing;return De({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},qx=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return Ae("div",Fe({ref:o},Kt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},Qx=qx,Jx=["data"],eC=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},tC=function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,s=e.label,u=e.theme,c=e.selectProps;return Ae("div",Fe({},Kt(e,"group",{group:!0}),l),Ae(i,Fe({},a,{selectProps:c,theme:u,getStyles:r,getClassNames:o,cx:n}),s),Ae("div",null,t))},nC=function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return De({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},rC=function(e){var t=Ph(e);t.data;var n=ur(t,Jx);return Ae("div",Fe({},Kt(e,"groupHeading",{"group-heading":!0}),n))},oC=tC,iC=["innerRef","isDisabled","isHidden","inputClassName"],aC=function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return De(De({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},lC),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},Nh={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},lC={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":De({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Nh)},sC=function(e){return De({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Nh)},uC=function(e){var t=e.cx,n=e.value,r=Ph(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,s=ur(r,iC);return Ae("div",Fe({},Kt(e,"input",{"input-container":!0}),{"data-value":n||""}),Ae("input",Fe({className:t({input:!0},l),ref:o,style:sC(a),disabled:i},s)))},cC=uC,dC=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return De({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},fC=function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return De({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},hC=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return De({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},Bh=function(e){var t=e.children,n=e.innerProps;return Ae("div",n,t)},pC=Bh,gC=Bh;function mC(e){var t=e.children,n=e.innerProps;return Ae("div",Fe({role:"button"},n),t||Ae(ru,{size:14}))}var vC=function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,s=n.Container,u=n.Label,c=n.Remove;return Ae(s,{data:r,innerProps:De(De({},Kt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},Ae(u,{data:r,innerProps:De({},Kt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),Ae(c,{data:r,innerProps:De(De({},Kt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},bC=vC,wC=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return De({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:o?l.primary:l.primary50}})},yC=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return Ae("div",Fe({},Kt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},xC=yC,CC=function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return De({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},kC=function(e){var t=e.children,n=e.innerProps;return Ae("div",Fe({},Kt(e,"placeholder",{placeholder:!0}),n),t)},SC=kC,MC=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return De({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},RC=function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return Ae("div",Fe({},Kt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},IC=RC,za={ClearIndicator:jx,Control:Qx,DropdownIndicator:Bx,DownChevron:$h,CrossIcon:ru,Group:oC,GroupHeading:rC,IndicatorsContainer:zx,IndicatorSeparator:Ux,Input:cC,LoadingIndicator:Yx,Menu:kx,MenuList:Mx,MenuPortal:Dx,LoadingMessage:Tx,NoOptionsMessage:Ex,MultiValue:bC,MultiValueContainer:pC,MultiValueLabel:gC,MultiValueRemove:mC,Option:xC,Placeholder:SC,SelectContainer:Ax,SingleValue:IC,ValueContainer:Hx},EC=function(e){return De(De({},za),e.components)},wd=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function TC(e,t){return!!(e===t||wd(e)&&wd(t))}function OC(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!TC(e[n],t[n]))return!1;return!0}function DC(e,t){t===void 0&&(t=OC);var n=null;function r(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var a=e.apply(this,o);return n={lastResult:a,lastArgs:o,lastThis:this},a}return r.clear=function(){n=null},r}var PC={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"},AC=function(e){return Ae("span",Fe({css:PC},e))},yd=AC,LC={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,r=n===void 0?"":n,o=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return i?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=o===void 0?"":o,a=e.selectValue,l=e.isDisabled,s=e.isSelected,u=e.isAppleDevice,c=function(p,h){return p&&p.length?"".concat(p.indexOf(h)+1," of ").concat(p.length):""};if(t==="value"&&a)return"value ".concat(i," focused, ").concat(c(a,n),".");if(t==="menu"&&u){var f=l?" disabled":"",g="".concat(s?" selected":"").concat(f);return"".concat(i).concat(g,", ").concat(c(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},HC=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,s=e.id,u=e.isAppleDevice,c=l.ariaLiveMessages,f=l.getOptionLabel,g=l.inputValue,p=l.isMulti,h=l.isOptionDisabled,m=l.isSearchable,y=l.menuIsOpen,w=l.options,v=l.screenReaderStatus,x=l.tabSelectsValue,T=l.isLoading,I=l["aria-label"],C=l["aria-live"],A=d.useMemo(function(){return De(De({},LC),c||{})},[c]),E=d.useMemo(function(){var D="";if(t&&A.onChange){var S=t.option,K=t.options,B=t.removedValue,X=t.removedValues,ie=t.value,te=function(ue){return Array.isArray(ue)?null:ue},q=B||S||te(ie),ge=q?f(q):"",se=K||X||void 0,ce=se?se.map(f):[],pe=De({isDisabled:q&&h(q,a),label:ge,labels:ce},t);D=A.onChange(pe)}return D},[t,A,h,a,f]),k=d.useMemo(function(){var D="",S=n||r,K=!!(n&&a&&a.includes(n));if(S&&A.onFocus){var B={focused:S,label:f(S),isDisabled:h(S,a),isSelected:K,options:o,context:S===n?"menu":"value",selectValue:a,isAppleDevice:u};D=A.onFocus(B)}return D},[n,r,f,h,A,o,a,u]),P=d.useMemo(function(){var D="";if(y&&w.length&&!T&&A.onFilter){var S=v({count:o.length});D=A.onFilter({inputValue:g,resultsMessage:S})}return D},[o,g,y,A,w,v,T]),O=t?.action==="initial-input-focus",R=d.useMemo(function(){var D="";if(A.guidance){var S=r?"value":y?"menu":"input";D=A.guidance({"aria-label":I,context:S,isDisabled:n&&h(n,a),isMulti:p,isSearchable:m,tabSelectsValue:x,isInitialFocus:O})}return D},[I,n,r,p,h,m,y,A,a,x,O]),M=Ae(d.Fragment,null,Ae("span",{id:"aria-selection"},E),Ae("span",{id:"aria-focused"},k),Ae("span",{id:"aria-results"},P),Ae("span",{id:"aria-guidance"},R));return Ae(d.Fragment,null,Ae(yd,{id:s},O&&M),Ae(yd,{"aria-live":C,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!O&&M))},FC=HC,Ms=[{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źẑżžẓẕƶȥɀⱬꝣ"}],zC=new RegExp("["+Ms.map(function(e){return e.letters}).join("")+"]","g"),Wh={};for(var Yl=0;Yl<Ms.length;Yl++)for(var Zl=Ms[Yl],ql=0;ql<Zl.letters.length;ql++)Wh[Zl.letters[ql]]=Zl.base;var jh=function(e){return e.replace(zC,function(t){return Wh[t]})},VC=DC(jh),xd=function(e){return e.replace(/^\s+|\s+$/g,"")},$C=function(e){return"".concat(e.label," ").concat(e.value)},_C=function(e){return function(t,n){if(t.data.__isNew__)return!0;var r=De({ignoreCase:!0,ignoreAccents:!0,stringify:$C,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,i=r.ignoreAccents,a=r.stringify,l=r.trim,s=r.matchFrom,u=l?xd(n):n,c=l?xd(a(t)):a(t);return o&&(u=u.toLowerCase(),c=c.toLowerCase()),i&&(u=VC(u),c=jh(c)),s==="start"?c.substr(0,u.length)===u:c.indexOf(u)>-1}},NC=["innerRef"];function BC(e){var t=e.innerRef,n=ur(e,NC),r=gx(n,"onExited","in","enter","exit","appear");return Ae("input",Fe({ref:t},r,{css:Js({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 WC=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function jC(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,a=d.useRef(!1),l=d.useRef(!1),s=d.useRef(0),u=d.useRef(null),c=d.useCallback(function(y,w){if(u.current!==null){var v=u.current,x=v.scrollTop,T=v.scrollHeight,I=v.clientHeight,C=u.current,A=w>0,E=T-I-x,k=!1;E>w&&a.current&&(r&&r(y),a.current=!1),A&&l.current&&(i&&i(y),l.current=!1),A&&w>E?(n&&!a.current&&n(y),C.scrollTop=T,k=!0,a.current=!0):!A&&-w>x&&(o&&!l.current&&o(y),C.scrollTop=0,k=!0,l.current=!0),k&&WC(y)}},[n,r,o,i]),f=d.useCallback(function(y){c(y,y.deltaY)},[c]),g=d.useCallback(function(y){s.current=y.changedTouches[0].clientY},[]),p=d.useCallback(function(y){var w=s.current-y.changedTouches[0].clientY;c(y,w)},[c]),h=d.useCallback(function(y){if(y){var w=fx?{passive:!1}:!1;y.addEventListener("wheel",f,w),y.addEventListener("touchstart",g,w),y.addEventListener("touchmove",p,w)}},[p,g,f]),m=d.useCallback(function(y){y&&(y.removeEventListener("wheel",f,!1),y.removeEventListener("touchstart",g,!1),y.removeEventListener("touchmove",p,!1))},[p,g,f]);return d.useEffect(function(){if(t){var y=u.current;return h(y),function(){m(y)}}},[t,h,m]),function(y){u.current=y}}var Cd=["boxSizing","height","overflow","paddingRight","position"],kd={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Sd(e){e.cancelable&&e.preventDefault()}function Md(e){e.stopPropagation()}function Rd(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Id(){return"ontouchstart"in window||navigator.maxTouchPoints}var Ed=!!(typeof window<"u"&&window.document&&window.document.createElement),li=0,xo={capture:!1,passive:!1};function GC(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=d.useRef({}),i=d.useRef(null),a=d.useCallback(function(s){if(Ed){var u=document.body,c=u&&u.style;if(r&&Cd.forEach(function(h){var m=c&&c[h];o.current[h]=m}),r&&li<1){var f=parseInt(o.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,p=window.innerWidth-g+f||0;Object.keys(kd).forEach(function(h){var m=kd[h];c&&(c[h]=m)}),c&&(c.paddingRight="".concat(p,"px"))}u&&Id()&&(u.addEventListener("touchmove",Sd,xo),s&&(s.addEventListener("touchstart",Rd,xo),s.addEventListener("touchmove",Md,xo))),li+=1}},[r]),l=d.useCallback(function(s){if(Ed){var u=document.body,c=u&&u.style;li=Math.max(li-1,0),r&&li<1&&Cd.forEach(function(f){var g=o.current[f];c&&(c[f]=g)}),u&&Id()&&(u.removeEventListener("touchmove",Sd,xo),s&&(s.removeEventListener("touchstart",Rd,xo),s.removeEventListener("touchmove",Md,xo)))}},[r]);return d.useEffect(function(){if(t){var s=i.current;return a(s),function(){l(s)}}},[t,a,l]),function(s){i.current=s}}var UC=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},XC={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function KC(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,i=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,s=e.onTopLeave,u=jC({isEnabled:o,onBottomArrive:i,onBottomLeave:a,onTopArrive:l,onTopLeave:s}),c=GC({isEnabled:n}),f=function(g){u(g),c(g)};return Ae(d.Fragment,null,n&&Ae("div",{onClick:UC,css:XC}),t(f))}var YC={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},ZC=function(e){var t=e.name,n=e.onFocus;return Ae("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:YC,value:"",onChange:function(){}})},qC=ZC;function ou(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 QC(){return ou(/^iPhone/i)}function Gh(){return ou(/^Mac/i)}function JC(){return ou(/^iPad/i)||Gh()&&navigator.maxTouchPoints>1}function ek(){return QC()||JC()}function tk(){return Gh()||ek()}var nk=function(e){return e.label},Uh=function(e){return e.label},Xh=function(e){return e.value},rk=function(e){return!!e.isDisabled},ok={clearIndicator:Wx,container:Px,control:Zx,dropdownIndicator:Nx,group:eC,groupHeading:nC,indicatorsContainer:Fx,indicatorSeparator:Gx,input:aC,loadingIndicator:Kx,loadingMessage:Ix,menu:yx,menuList:Sx,menuPortal:Ox,multiValue:dC,multiValueLabel:fC,multiValueRemove:hC,noOptionsMessage:Rx,option:wC,placeholder:CC,singleValue:MC,valueContainer:Lx},ik={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%)"},ak=4,Kh=4,lk=38,sk=Kh*2,uk={baseUnit:Kh,controlHeight:lk,menuGutter:sk},Ql={borderRadius:ak,colors:ik,spacing:uk},ck={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:vd(),captureMenuScroll:!vd(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:_C(),formatGroupLabel:nk,getOptionLabel:Uh,getOptionValue:Xh,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:rk,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!cx(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Td(e,t,n,r){var o=qh(e,t,n),i=Qh(e,t,n),a=Zh(e,t),l=Ea(e,t);return{type:"option",data:t,isDisabled:o,isSelected:i,label:a,value:l,index:r}}function sa(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(a,l){return Td(e,a,t,l)}).filter(function(a){return Dd(e,a)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Td(e,n,t,r);return Dd(e,i)?i:void 0}).filter(hx)}function Yh(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,To(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Od(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,To(r.options.map(function(o){return{data:o.data,id:"".concat(t,"-").concat(r.index,"-").concat(o.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function dk(e,t){return Yh(sa(e,t))}function Dd(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,i=t.isSelected,a=t.label,l=t.value;return(!ep(e)||!i)&&Jh(e,{label:a,value:l,data:o},r)}function fk(e,t){var n=e.focusedValue,r=e.selectValue,o=r.indexOf(n);if(o>-1){var i=t.indexOf(n);if(i>-1)return n;if(o<t.length)return t[o]}return null}function hk(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Jl=function(e,t){var n,r=(n=e.find(function(o){return o.data===t}))===null||n===void 0?void 0:n.id;return r||null},Zh=function(e,t){return e.getOptionLabel(t)},Ea=function(e,t){return e.getOptionValue(t)};function qh(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Qh(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Ea(e,t);return n.some(function(o){return Ea(e,o)===r})}function Jh(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var ep=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},pk=1,iu=(function(e){Vm(n,e);var t=Nm(n);function n(r){var o;if($m(this,n),o=t.call(this,r),o.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.controlRef=null,o.getControlRef=function(s){o.controlRef=s},o.focusedOptionRef=null,o.getFocusedOptionRef=function(s){o.focusedOptionRef=s},o.menuListRef=null,o.getMenuListRef=function(s){o.menuListRef=s},o.inputRef=null,o.getInputRef=function(s){o.inputRef=s},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(s,u){var c=o.props,f=c.onChange,g=c.name;u.name=g,o.ariaOnChange(s,u),f(s,u)},o.setValue=function(s,u,c){var f=o.props,g=f.closeMenuOnSelect,p=f.isMulti,h=f.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:h}),g&&(o.setState({inputIsHiddenAfterUpdate:!p}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(s,{action:u,option:c})},o.selectOption=function(s){var u=o.props,c=u.blurInputOnSelect,f=u.isMulti,g=u.name,p=o.state.selectValue,h=f&&o.isOptionSelected(s,p),m=o.isOptionDisabled(s,p);if(h){var y=o.getOptionValue(s);o.setValue(p.filter(function(w){return o.getOptionValue(w)!==y}),"deselect-option",s)}else if(!m)f?o.setValue([].concat(To(p),[s]),"select-option",s):o.setValue(s,"select-option");else{o.ariaOnChange(s,{action:"select-option",option:s,name:g});return}c&&o.blurInput()},o.removeValue=function(s){var u=o.props.isMulti,c=o.state.selectValue,f=o.getOptionValue(s),g=c.filter(function(h){return o.getOptionValue(h)!==f}),p=ui(u,g,g[0]||null);o.onChange(p,{action:"remove-value",removedValue:s}),o.focusInput()},o.clearValue=function(){var s=o.state.selectValue;o.onChange(ui(o.props.isMulti,[],null),{action:"clear",removedValues:s})},o.popValue=function(){var s=o.props.isMulti,u=o.state.selectValue,c=u[u.length-1],f=u.slice(0,u.length-1),g=ui(s,f,f[0]||null);c&&o.onChange(g,{action:"pop-value",removedValue:c})},o.getFocusedOptionId=function(s){return Jl(o.state.focusableOptionsWithIds,s)},o.getFocusableOptionsWithIds=function(){return Od(sa(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return ix.apply(void 0,[o.props.classNamePrefix].concat(u))},o.getOptionLabel=function(s){return Zh(o.props,s)},o.getOptionValue=function(s){return Ea(o.props,s)},o.getStyles=function(s,u){var c=o.props.unstyled,f=ok[s](u,c);f.boxSizing="border-box";var g=o.props.styles[s];return g?g(f,u):f},o.getClassNames=function(s,u){var c,f;return(c=(f=o.props.classNames)[s])===null||c===void 0?void 0:c.call(f,u)},o.getElementId=function(s){return"".concat(o.state.instancePrefix,"-").concat(s)},o.getComponents=function(){return EC(o.props)},o.buildCategorizedOptions=function(){return sa(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return Yh(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(s,u){o.setState({ariaSelection:De({value:s},u)})},o.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),o.focusInput())},o.onMenuMouseMove=function(s){o.blockOptionHover=!1},o.onControlMouseDown=function(s){if(!s.defaultPrevented){var u=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&o.onMenuClose():u&&o.openMenu("first"):(u&&(o.openAfterFocus=!0),o.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},o.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!o.props.isDisabled){var u=o.props,c=u.isMulti,f=u.menuIsOpen;o.focusInput(),f?(o.setState({inputIsHiddenAfterUpdate:!c}),o.onMenuClose()):o.openMenu("first"),s.preventDefault()}},o.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(o.clearValue(),s.preventDefault(),o.openAfterFocus=!1,s.type==="touchend"?o.focusInput():setTimeout(function(){return o.focusInput()}))},o.onScroll=function(s){typeof o.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&Fa(s.target)&&o.props.onMenuClose():typeof o.props.closeMenuOnScroll=="function"&&o.props.closeMenuOnScroll(s)&&o.props.onMenuClose()},o.onCompositionStart=function(){o.isComposing=!0},o.onCompositionEnd=function(){o.isComposing=!1},o.onTouchStart=function(s){var u=s.touches,c=u&&u.item(0);c&&(o.initialTouchX=c.clientX,o.initialTouchY=c.clientY,o.userIsDragging=!1)},o.onTouchMove=function(s){var u=s.touches,c=u&&u.item(0);if(c){var f=Math.abs(c.clientX-o.initialTouchX),g=Math.abs(c.clientY-o.initialTouchY),p=5;o.userIsDragging=f>p||g>p}},o.onTouchEnd=function(s){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(s.target)&&o.menuListRef&&!o.menuListRef.contains(s.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(s){o.userIsDragging||o.onControlMouseDown(s)},o.onClearIndicatorTouchEnd=function(s){o.userIsDragging||o.onClearIndicatorMouseDown(s)},o.onDropdownIndicatorTouchEnd=function(s){o.userIsDragging||o.onDropdownIndicatorMouseDown(s)},o.handleInputChange=function(s){var u=o.props.inputValue,c=s.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(c,{action:"input-change",prevInputValue:u}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(s){o.props.onFocus&&o.props.onFocus(s),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(s){var u=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(s),o.onInputChange("",{action:"input-blur",prevInputValue:u}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(s){if(!(o.blockOptionHover||o.state.focusedOption===s)){var u=o.getFocusableOptions(),c=u.indexOf(s);o.setState({focusedOption:s,focusedOptionId:c>-1?o.getFocusedOptionId(s):null})}},o.shouldHideSelectedOptions=function(){return ep(o.props)},o.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),o.focus()},o.onKeyDown=function(s){var u=o.props,c=u.isMulti,f=u.backspaceRemovesValue,g=u.escapeClearsValue,p=u.inputValue,h=u.isClearable,m=u.isDisabled,y=u.menuIsOpen,w=u.onKeyDown,v=u.tabSelectsValue,x=u.openMenuOnFocus,T=o.state,I=T.focusedOption,C=T.focusedValue,A=T.selectValue;if(!m&&!(typeof w=="function"&&(w(s),s.defaultPrevented))){switch(o.blockOptionHover=!0,s.key){case"ArrowLeft":if(!c||p)return;o.focusValue("previous");break;case"ArrowRight":if(!c||p)return;o.focusValue("next");break;case"Delete":case"Backspace":if(p)return;if(C)o.removeValue(C);else{if(!f)return;c?o.popValue():h&&o.clearValue()}break;case"Tab":if(o.isComposing||s.shiftKey||!y||!v||!I||x&&o.isOptionSelected(I,A))return;o.selectOption(I);break;case"Enter":if(s.keyCode===229)break;if(y){if(!I||o.isComposing)return;o.selectOption(I);break}return;case"Escape":y?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:p}),o.onMenuClose()):h&&g&&o.clearValue();break;case" ":if(p)return;if(!y){o.openMenu("first");break}if(!I)return;o.selectOption(I);break;case"ArrowUp":y?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":y?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!y)return;o.focusOption("pageup");break;case"PageDown":if(!y)return;o.focusOption("pagedown");break;case"Home":if(!y)return;o.focusOption("first");break;case"End":if(!y)return;o.focusOption("last");break;default:return}s.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++pk),o.state.selectValue=Ra(r.value),r.menuIsOpen&&o.state.selectValue.length){var i=o.getFocusableOptionsWithIds(),a=o.buildFocusableOptions(),l=a.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=i,o.state.focusedOption=a[l],o.state.focusedOptionId=Jl(i,a[l])}return o}return _m(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&&md(this.menuListRef,this.focusedOptionRef),tk()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var o=this.props,i=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!i&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(md(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,i=this.state,a=i.selectValue,l=i.isFocused,s=this.buildFocusableOptions(),u=r==="first"?0:s.length-1;if(!this.props.isMulti){var c=s.indexOf(a[0]);c>-1&&(u=c)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:s[u],focusedOptionId:this.getFocusedOptionId(s[u])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,i=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var s=i.length-1,u=-1;if(i.length){switch(r){case"previous":l===0?u=0:l===-1?u=s:u=l-1;break;case"next":l>-1&&l<s&&(u=l+1);break}this.setState({inputIsHidden:u!==-1,focusedValue:i[u]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,s=a.indexOf(i);i||(s=-1),r==="up"?l=s>0?s-1:a.length-1:r==="down"?l=(s+1)%a.length:r==="pageup"?(l=s-o,l<0&&(l=0)):r==="pagedown"?(l=s+o,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Ql):De(De({},Ql),this.props.theme):Ql})},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,s=this.selectOption,u=this.setValue,c=this.props,f=c.isMulti,g=c.isRtl,p=c.options,h=this.hasValue();return{clearValue:r,cx:o,getStyles:i,getClassNames:a,getValue:l,hasValue:h,isMulti:f,isRtl:g,options:p,selectOption:s,selectProps:c,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,i=r.isMulti;return o===void 0?i:o}},{key:"isOptionDisabled",value:function(r,o){return qh(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return Qh(this.props,r,o)}},{key:"filterOption",value:function(r,o){return Jh(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:i,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var r=this.props,o=r.isDisabled,i=r.isSearchable,a=r.inputId,l=r.inputValue,s=r.tabIndex,u=r.form,c=r.menuIsOpen,f=r.required,g=this.getComponents(),p=g.Input,h=this.state,m=h.inputIsHidden,y=h.ariaSelection,w=this.commonProps,v=a||this.getElementId("input"),x=De(De(De({"aria-autocomplete":"list","aria-expanded":c,"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":f,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},c&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?y?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?d.createElement(p,Fe({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:o,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:s,form:u,type:"text",value:l},x)):d.createElement(BC,Fe({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ma,onFocus:this.onInputFocus,disabled:o,tabIndex:s,inputMode:"none",form:u,value:""},x))})},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),i=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,s=o.MultiValueRemove,u=o.SingleValue,c=o.Placeholder,f=this.commonProps,g=this.props,p=g.controlShouldRenderValue,h=g.isDisabled,m=g.isMulti,y=g.inputValue,w=g.placeholder,v=this.state,x=v.selectValue,T=v.focusedValue,I=v.isFocused;if(!this.hasValue()||!p)return y?null:d.createElement(c,Fe({},f,{key:"placeholder",isDisabled:h,isFocused:I,innerProps:{id:this.getElementId("placeholder")}}),w);if(m)return x.map(function(A,E){var k=A===T,P="".concat(r.getOptionLabel(A),"-").concat(r.getOptionValue(A));return d.createElement(i,Fe({},f,{components:{Container:a,Label:l,Remove:s},isFocused:k,isDisabled:h,key:P,index:E,removeProps:{onClick:function(){return r.removeValue(A)},onTouchEnd:function(){return r.removeValue(A)},onMouseDown:function(O){O.preventDefault()}},data:A}),r.formatOptionLabel(A,"value"))});if(y)return null;var C=x[0];return d.createElement(u,Fe({},f,{data:C,isDisabled:h}),this.formatOptionLabel(C,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,u=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||s)return null;var c={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Fe({},i,{innerProps:c,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,u=this.state.isFocused;if(!o||!s)return null;var c={"aria-hidden":"true"};return d.createElement(o,Fe({},i,{innerProps:c,isDisabled:l,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,i=r.IndicatorSeparator;if(!o||!i)return null;var a=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused;return d.createElement(i,Fe({},a,{isDisabled:l,isFocused:s}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,s={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Fe({},i,{innerProps:s,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),i=o.Group,a=o.GroupHeading,l=o.Menu,s=o.MenuList,u=o.MenuPortal,c=o.LoadingMessage,f=o.NoOptionsMessage,g=o.Option,p=this.commonProps,h=this.state.focusedOption,m=this.props,y=m.captureMenuScroll,w=m.inputValue,v=m.isLoading,x=m.loadingMessage,T=m.minMenuHeight,I=m.maxMenuHeight,C=m.menuIsOpen,A=m.menuPlacement,E=m.menuPosition,k=m.menuPortalTarget,P=m.menuShouldBlockScroll,O=m.menuShouldScrollIntoView,R=m.noOptionsMessage,M=m.onMenuScrollToTop,D=m.onMenuScrollToBottom;if(!C)return null;var S=function(q,ge){var se=q.type,ce=q.data,pe=q.isDisabled,ue=q.isSelected,V=q.label,L=q.value,G=h===ce,oe=pe?void 0:function(){return r.onOptionHover(ce)},re=pe?void 0:function(){return r.selectOption(ce)},Te="".concat(r.getElementId("option"),"-").concat(ge),xe={id:Te,onClick:re,onMouseMove:oe,onMouseOver:oe,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:ue};return d.createElement(g,Fe({},p,{innerProps:xe,data:ce,isDisabled:pe,isSelected:ue,key:Te,label:V,type:se,value:L,isFocused:G,innerRef:G?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(q.data,"menu"))},K;if(this.hasOptions())K=this.getCategorizedOptions().map(function(q){if(q.type==="group"){var ge=q.data,se=q.options,ce=q.index,pe="".concat(r.getElementId("group"),"-").concat(ce),ue="".concat(pe,"-heading");return d.createElement(i,Fe({},p,{key:pe,data:ge,options:se,Heading:a,headingProps:{id:ue,data:q.data},label:r.formatGroupLabel(q.data)}),q.options.map(function(V){return S(V,"".concat(ce,"-").concat(V.index))}))}else if(q.type==="option")return S(q,"".concat(q.index))});else if(v){var B=x({inputValue:w});if(B===null)return null;K=d.createElement(c,p,B)}else{var X=R({inputValue:w});if(X===null)return null;K=d.createElement(f,p,X)}var ie={minMenuHeight:T,maxMenuHeight:I,menuPlacement:A,menuPosition:E,menuShouldScrollIntoView:O},te=d.createElement(xx,Fe({},p,ie),function(q){var ge=q.ref,se=q.placerProps,ce=se.placement,pe=se.maxHeight;return d.createElement(l,Fe({},p,ie,{innerRef:ge,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:v,placement:ce}),d.createElement(KC,{captureEnabled:y,onTopArrive:M,onBottomArrive:D,lockEnabled:P},function(ue){return d.createElement(s,Fe({},p,{innerRef:function(V){r.getMenuListRef(V),ue(V)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:r.getElementId("listbox")},isLoading:v,maxHeight:pe,focusedOption:h}),K)}))});return k||E==="fixed"?d.createElement(u,Fe({},p,{appendTo:k,controlElement:this.controlRef,menuPlacement:A,menuPosition:E}),te):te}},{key:"renderFormField",value:function(){var r=this,o=this.props,i=o.delimiter,a=o.isDisabled,l=o.isMulti,s=o.name,u=o.required,c=this.state.selectValue;if(u&&!this.hasValue()&&!a)return d.createElement(qC,{name:s,onFocus:this.onValueInputFocus});if(!(!s||a))if(l)if(i){var f=c.map(function(h){return r.getOptionValue(h)}).join(i);return d.createElement("input",{name:s,type:"hidden",value:f})}else{var g=c.length>0?c.map(function(h,m){return d.createElement("input",{key:"i-".concat(m),name:s,type:"hidden",value:r.getOptionValue(h)})}):d.createElement("input",{name:s,type:"hidden",value:""});return d.createElement("div",null,g)}else{var p=c[0]?this.getOptionValue(c[0]):"";return d.createElement("input",{name:s,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,i=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,s=o.isFocused,u=o.selectValue,c=this.getFocusableOptions();return d.createElement(FC,Fe({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:s,selectValue:u,focusableOptions:c,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,i=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,s=this.props,u=s.className,c=s.id,f=s.isDisabled,g=s.menuIsOpen,p=this.state.isFocused,h=this.commonProps=this.getCommonProps();return d.createElement(a,Fe({},h,{className:u,innerProps:{id:c,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:p}),this.renderLiveRegion(),d.createElement(o,Fe({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:p,menuIsOpen:g}),d.createElement(l,Fe({},h,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(i,Fe({},h,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var i=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,s=o.ariaSelection,u=o.isFocused,c=o.prevWasFocused,f=o.instancePrefix,g=r.options,p=r.value,h=r.menuIsOpen,m=r.inputValue,y=r.isMulti,w=Ra(p),v={};if(i&&(p!==i.value||g!==i.options||h!==i.menuIsOpen||m!==i.inputValue)){var x=h?dk(r,w):[],T=h?Od(sa(r,w),"".concat(f,"-option")):[],I=a?fk(o,w):null,C=hk(o,x),A=Jl(T,C);v={selectValue:w,focusedOption:C,focusedOptionId:A,focusableOptionsWithIds:T,focusedValue:I,clearFocusValueOnUpdate:!1}}var E=l!=null&&r!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},k=s,P=u&&c;return u&&!P&&(k={value:ui(y,w,w[0]||null),options:w,action:"initial-input-focus"},P=!c),s?.action==="initial-input-focus"&&(k=null),De(De(De({},v),E),{},{prevProps:r,ariaSelection:k,prevWasFocused:P})}}]),n})(d.Component);iu.defaultProps=ck;var gk=d.forwardRef(function(e,t){var n=kh(e);return d.createElement(iu,Fe({ref:t},n))}),tp=gk,mk=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Pd=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),o=String(n.getOptionValue(t)).toLowerCase(),i=String(n.getOptionLabel(t)).toLowerCase();return o===r||i===r},es={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(o){return Pd(e,o,r)})||n.some(function(o){return Pd(e,o,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function vk(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,o=r===void 0?"last":r,i=e.formatCreateLabel,a=i===void 0?es.formatCreateLabel:i,l=e.isValidNewOption,s=l===void 0?es.isValidNewOption:l,u=e.getNewOptionData,c=u===void 0?es.getNewOptionData:u,f=e.onCreateOption,g=e.options,p=g===void 0?[]:g,h=e.onChange,m=ur(e,mk),y=m.getOptionValue,w=y===void 0?Xh:y,v=m.getOptionLabel,x=v===void 0?Uh:v,T=m.inputValue,I=m.isLoading,C=m.isMulti,A=m.value,E=m.name,k=d.useMemo(function(){return s(T,Ra(A),p,{getOptionValue:w,getOptionLabel:x})?c(T,a(T)):void 0},[a,c,x,w,T,s,p,A]),P=d.useMemo(function(){return(n||!I)&&k?o==="first"?[k].concat(To(p)):[].concat(To(p),[k]):p},[n,o,I,k,p]),O=d.useCallback(function(R,M){if(M.action!=="select-option")return h(R,M);var D=Array.isArray(R)?R:[R];if(D[D.length-1]===k){if(f)f(T);else{var S=c(T,T),K={action:"create-option",name:E,option:S};h(ui(C,[].concat(To(Ra(A)),[S]),S),K)}return}h(R,M)},[c,T,C,E,k,f,h,A]);return De(De({},m),{},{options:P,onChange:O})}var bk=d.forwardRef(function(e,t){var n=kh(e),r=vk(n);return d.createElement(iu,Fe({ref:t},r))}),wk=bk;const au="__value",yk=new RegExp(`^${au}\\d+__`),xk=Cn("div",{target:"e1jrhwo91"})({name:"1rauklo",styles:"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);}"}),Ck=Cn("div",{target:"e1jrhwo90"})({name:"hgyqdb",styles:"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);}"}),ua=e=>e.map(t=>typeof t=="string"?{value:t,label:t,color:void 0}:Se(t)?{value:"",label:"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color}),np=(e,t,n)=>Se(e)?[]:e.map((r,o)=>{const i=n?`${au}${o}__`:"",a=t.find(l=>l.value===r);return a?{...a,value:`${i}${a.value}`}:{value:`${i}${r}`,label:r}}),kk=e=>{const{Menu:t}=za,{children:n,...r}=e;return fe.jsx(t,{...r,children:n})},Sk=e=>{const t=e.innerProps,n={...t,onMouseDown:r=>{r.stopPropagation(),t?.onMouseDown?.(r)},onTouchEnd:r=>{r.stopPropagation(),t?.onTouchEnd?.(r)}};return fe.jsx(za.MultiValueLabel,{...e,innerProps:n})},Mk=()=>null,Rk=()=>null,Ik=e=>e.selectProps?.menuDisabled?null:fe.jsx(Ck,{children:fe.jsx(kk,{...e,className:[e.className,"click-outside-ignore"].filter(Boolean).join(" ")})}),Ek=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:o}=e,{options:i,values:a,allowCreation:l,allowDuplicates:s}=t.data,u=Qf(),[c,f]=d.useState(a),[g,p]=d.useState(!0),[h,m]=d.useState(n??""),[y]=d.useState(()=>document.getElementById("portal")),w=d.useMemo(()=>ua(i??[]),[i]),v=l&&s&&w.length===0,x=d.useCallback(M=>{g&&M.stopPropagation()},[g]),T=d.useCallback(()=>p(!0),[]),I=d.useCallback(()=>p(!1),[]),C=d.useCallback(M=>l&&s&&M.inputValue?`Create "${M.inputValue}"`:void 0,[l,s]),A=d.useMemo(()=>({control:(M,D)=>({...M,border:0,boxShadow:"none",backgroundColor:u.bgCell,pointerEvents:D.isDisabled?"auto":M.pointerEvents,cursor:D.isDisabled?"default":M.cursor}),valueContainer:M=>({...M,flexWrap:M.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:M=>({...M,backgroundColor:u.bgCell}),option:(M,D)=>({...M,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark,...D.isFocused?{backgroundColor:u.accentLight,cursor:"pointer"}:{},":active":{...M[":active"],color:u.accentFg,backgroundColor:u.accentColor}}),input:(M,{isDisabled:D})=>D?{display:"none"}:{...M,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark},placeholder:M=>({...M,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),noOptionsMessage:M=>({...M,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),clearIndicator:M=>({...M,color:u.textLight,":hover":{color:u.textDark,cursor:"pointer"}}),multiValue:(M,{data:D})=>({...M,backgroundColor:D.color??u.bgBubble,borderRadius:`${u.roundingRadius??u.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(M,{data:D,isDisabled:S})=>({...M,paddingRight:S?u.bubblePadding:0,paddingLeft:u.bubblePadding,paddingTop:0,paddingBottom:0,color:D.color?ds(D.color)>.5?"black":"white":u.textBubble,fontSize:u.editorFontSize,fontFamily:u.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:u.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(M,{data:D,isDisabled:S,isFocused:K})=>S?{display:"none"}:{...M,color:D.color?ds(D.color)>.5?"black":"white":u.textBubble,backgroundColor:void 0,borderRadius:K?`${u.roundingRadius??u.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}}),[u]),E=d.useCallback(M=>{const D=M.map(S=>s&&S.startsWith(au)?S.replace(new RegExp(yk),""):S);f(D),r({...t,data:{...t.data,values:D}})},[t,r,s]),k=M=>{switch(M.key){case"Enter":case"Tab":if(!h){o(t,[0,1]);return}s&&l&&(m(""),E([...c??[],h]),p(!1),M.preventDefault())}},P=d.useMemo(()=>({DropdownIndicator:Mk,IndicatorSeparator:Rk,MultiValueLabel:Sk,Menu:Ik}),[]),O=d.useCallback(M=>{M===null||!Array.isArray(M)||E(M.map(D=>D.value))},[E]),R=l?wk:tp;return fe.jsx(xk,{onKeyDown:x,"data-testid":"multi-select-cell",children:fe.jsx(R,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:h,onInputChange:m,options:w,placeholder:t.readonly?"":l?"Add...":void 0,noOptionsMessage:C,menuIsOpen:t.readonly?!1:g,onMenuOpen:T,onMenuClose:I,value:np(c,w,s),onKeyDown:t.readonly?void 0:k,menuPlacement:"auto",menuPortalTarget:y,autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:A,components:P,onChange:O,menuDisabled:v})})},Tk={kind:Q.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o,highlighted:i}=e,{values:a,options:l}=t.data;if(Se(a))return!0;const s=ua(l??[]),u={x:o.x+r.cellHorizontalPadding,y:o.y+r.cellVerticalPadding,width:o.width-2*r.cellHorizontalPadding,height:o.height-2*r.cellVerticalPadding},c=Math.max(1,Math.floor(u.height/(r.bubbleHeight+r.bubblePadding)));let{x:f}=u,g=1,p=c===1?u.y+(u.height-r.bubbleHeight)/2:u.y+(u.height-c*r.bubbleHeight-(c-1)*r.bubblePadding)/2;for(const h of a){const m=s.find(T=>T.value===h),y=m?.color??(i?r.bgBubbleSelected:r.bgBubble),w=m?.label??h,v=Pr(w,n).width+r.bubblePadding*2,x=r.bubbleHeight/2;if(f!==u.x&&f+v>u.x+u.width&&g<c&&(g++,p+=r.bubbleHeight+r.bubblePadding,f=u.x),n.fillStyle=y,n.beginPath(),qn(n,f,p,v,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?ds(y)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(w,f+r.bubblePadding,p+x+Qn(n,r)),f+=v+r.bubbleMargin,f>u.x+u.width+r.cellHorizontalPadding&&g>=c)break}return!0},measure:(e,t,n)=>{const{values:r,options:o}=t.data;if(!r)return n.cellHorizontalPadding*2;const i=np(r,ua(o??[]),t.data.allowDuplicates).map(l=>l.label??l.value),a=i.reduce((l,s)=>e.measureText(s).width+l+n.bubblePadding*2+n.bubbleMargin,0);return i.length===0?n.cellHorizontalPadding*2:a+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:Ek,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,o)=>n.indexOf(r)===o)),!t.allowCreation){const r=ua(t.options??[]);n=n.filter(o=>r.find(i=>i.value===o))}if(n.length!==0)return{...t,values:n}}},rp="line_chart",Ok="area_chart",op="bar_chart";function lu(e,t,n,r){const o=Ao({y_min:null,y_max:null,color:void 0},t.columnTypeOptions);let i;o.color==="auto"||o.color==="auto-inverse"?i=r.colors.greenColor:i=o.color?qd(o.color,r):void 0;const a={kind:Q.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:i,yAxis:[o.y_min??0,o.y_max??1]}};return{...t,kind:e,typeIcon:e===rp?":material/show_chart:":e===op?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(l){if(Se(l))return ws();const s=qs(l),u=[];let c=[];if(s.length===0)return ws();let f=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER;for(let y=0;y<s.length;y++){const w=xi(s[y]);if(Number.isNaN(w)||Se(w))return Rt(et(s),`The value cannot be interpreted as a numeric array. ${et(w)} is not a number.`);w>f&&(f=w),w<g&&(g=w),u.push(w)}let p,h;if(g===f){let y;f<=0?y=f===0?1:0:y=f,p=o.y_max??y,h=o.y_min??(f>=0?0:f)}else p=o.y_max??f,h=o.y_min??g;if(Se(h)||Se(p)||Number.isNaN(h)||Number.isNaN(p)||h>=p)return Rt("Invalid min/max y-axis configuration",`The y_min (${h}) and y_max (${p}) configuration options must be valid numbers.`);u.length>0&&(f>p||g<h)?c=u.map(y=>f-g===0?f>(p||1)?p:h:(p-h)*((y-g)/(f-g))+h):c=u;let m=i;return(o.color==="auto"&&c[0]>c[c.length-1]||o.color==="auto-inverse"&&c[0]<c[c.length-1])&&(m=r.colors.redColor),{...a,copyData:u.join(","),data:{...a.data,values:c,displayValues:u.map(y=>fa(y)),yAxis:[h,p],color:m},isMissingValue:Se(l)}},getCellValue(l){return l.kind===Q.Loading||l.data?.values===void 0?null:l.data?.values}}}function ip(e,t){return lu(rp,e,"line",t)}ip.isEditableType=!1;function ap(e,t){return lu(op,e,"bar",t)}ap.isEditableType=!1;function lp(e,t){return lu(Ok,e,"area",t)}lp.isEditableType=!1;function su(e,t){const n={kind:Q.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",themeOverride:{roundingRadius:Math.round(Math.min(tn(t.radii.sm),tn(t.radii.maxCheckbox)))},getCell(r){let o=null;return o=wh(r),o===void 0?Rt(et(r),"The value cannot be interpreted as boolean."):{...n,data:o,isMissingValue:Se(o)}},getCellValue(r){return r.data===void 0?null:r.data}}}su.isEditableType=!0;function Ad(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function uu(e,t,n,r,o,i,a){const l=Ao({format:n,step:r,timezone:a},t.columnTypeOptions);let s;if(dt(l.timezone))try{s=Ad(Fu(),l.timezone)?.utcOffset()||void 0}catch{}let u;dt(l.min_value)&&(u=Ji(l.min_value)||void 0);let c;dt(l.max_value)&&(c=Ji(l.max_value)||void 0);const f={kind:Q.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:l.step?.toString()||"1",format:o,min:u,max:c}},g=p=>{const h=Ji(p);return h===null?!t.isRequired:!(h===void 0||dt(u)&&i(h)<i(u)||dt(c)&&i(h)>i(c))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(p,h){if(h===!0){const x=g(p);if(x===!1)return Rt(et(p),"Invalid input.");x instanceof Date&&(p=x)}const m=Ji(p);let y="",w="",v=s;if(m===void 0)return Rt(et(p),"The value cannot be interpreted as a datetime object.");if(m!==null){let x=Fu.utc(m);if(!x.isValid())return Rt(et(m),`Invalid moment date. This should never happen. Please report this bug.
191
+ Error: ${x.toString()}`);if(l.timezone){try{x=Ad(x,l.timezone)}catch(T){return Rt(x.toISOString(),`Failed to adjust to the provided timezone: ${l.timezone}.
192
+ Error: ${T}`)}v=x.utcOffset()}try{w=zu(x,l.format||n,e)}catch(T){return Rt(x.toISOString(),`Failed to format the date for rendering with: ${l.format}.
193
+ Error: ${T}`)}y=zu(x,n,e)}return{...f,copyData:y,isMissingValue:Se(m),data:{...f.data,date:m,displayDate:w,timezoneOffset:v}}},getCellValue(p){return Se(p?.data?.date)?null:i(p.data.date)}}}function cu(e){let t="YYYY-MM-DD HH:mm:ss";const n=e.columnTypeOptions?.step;n!==void 0&&n>=60?t="YYYY-MM-DD HH:mm":n!==void 0&&n<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const r=ng(e.arrowType),o=dt(r)||dt(e?.columnTypeOptions?.timezone);return uu("datetime",e,o?t+"Z":t,1,"datetime-local",i=>o?i.toISOString():i.toISOString().replace("Z",""),r)}cu.isEditableType=!0;function du(e){let t="HH:mm:ss";const n=e.columnTypeOptions?.step;return n!==void 0&&n>=60?t="HH:mm":n!==void 0&&n<1&&(t="HH:mm:ss.SSS"),uu("time",e,t,1,"time",r=>r.toISOString().split("T")[1].replace("Z",""))}du.isEditableType=!0;function fu(e){return uu("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}fu.isEditableType=!0;function sp(e){const t={kind:Q.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=dt(n)?[et(n)]:[];return{...t,data:r,isMissingValue:!dt(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}sp.isEditableType=!1;function up(e){const t={kind:Q.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=dt(n)?Ci(Ca(n)):"";return{...t,copyData:r,isMissingValue:Se(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Rt(et(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){return n.data?.value??null}}}up.isEditableType=!1;function cp(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(s){n=`Invalid validate regex: ${t.validate}.
194
+ Error: ${s}`}let r=!1,o=t.display_text,i;if(!Se(o)){if(o.startsWith(":material/")&&rg(o))o=og(o).icon,r=!0;else if(o.includes("(")&&o.includes(")"))try{i=new RegExp(o,"us")}catch{i=void 0}}const a={kind:Q.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?"center":void 0),style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:"",...r&&{themeOverride:{fontFamily:as.iconFont,linkColor:void 0}}},l=s=>{if(Se(s))return!e.isRequired;const u=et(s);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:l,getCell(s,u){if(Se(s))return{...a,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const c=et(s);if(typeof n=="string")return Rt(et(c),n);if(u&&l(c)===!1)return Rt(et(c),"Invalid input.");let f="";return c&&(i!==void 0?f=py(i,c):f=o||c),{...a,data:c,displayData:f,isMissingValue:Se(c),onClickUri:g=>{window.open(c.startsWith("www.")?`https://${c}`:c,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:c}},getCellValue(s){return Se(s.data)?null:s.data}}}cp.isEditableType=!0;function hu(e){const t={kind:Q.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(Se(n))return{...t,data:{...t.data,values:null},isMissingValue:!0,copyData:""};const r=qs(n);return{...t,data:{...t.data,values:r},copyData:yh(r),...e.isEditable&&!bh(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 Se(n.data?.values)?null:n.data.values}}}hu.isEditableType=!0;const Dk={audio:":material/audio_file:",video:":material/video_file:"};function dp(e,t){const n={kind:Q.Custom,allowOverlay:!0,contentAlign:t.contentAlignment||"center",readonly:!0,copyData:"",data:{kind:"media-cell",mediaType:e,src:null}};return{...t,kind:e,typeIcon:Dk[e],sortMode:"default",isEditable:!1,getCell(r){const o=dt(r)?et(r):null;return{...n,copyData:o??"",isMissingValue:Se(r),data:{kind:"media-cell",mediaType:e,src:o}}},getCellValue(r){return r.data?.src??null}}}function fp(e){return dp("audio",e)}fp.isEditableType=!1;function hp(e){return dp("video",e)}hp.isEditableType=!1;const Pk=(e,t)=>{if(Se(e))return[];const n=t.colors.chartCategoricalColors,r=nf(t);let o=0;return e.filter(i=>i!==null&&i!=="").map(i=>{if(typeof i=="string")return{value:et(i).trim(),label:void 0,color:void 0};let a;i.color==="auto"?(a=Co(n[o%n.length],r?.7:.6),o+=1):i.color&&(a=wg(i.color,t));const l=a?yg(a,t.colors.bgColor):void 0;return{value:et(i.value).trim(),label:i.label??void 0,color:l}})};function pp(e,t){const n=Ao({options:[],accept_new_options:!1},e.columnTypeOptions),r=Pk(n.options,t),o=new Set(r.map(a=>a.value)),i={kind:Q.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"multi-select-cell",values:[],options:r,allowCreation:n.accept_new_options??!1,allowDuplicates:!1},copyData:""};return{...e,kind:"multiselect",sortMode:"default",typeIcon:":material/checklist:",getCell(a,l){if(Se(a))return{...i,data:{...i.data,values:null},isMissingValue:!0,copyData:""};let s=qs(a).map(u=>et(u).trim());return l&&s.length>0&&n.accept_new_options===!1&&(s=s.filter(u=>o.has(u)),s.length===0)?Rt(et(a),"The values could not be matched with the configured options."):{...i,data:{...i.data,values:s},copyData:yh(s),...e.isEditable&&!bh(a)&&{readonly:!0,isError:!0,errorDetails:"Editing of arrays with non-string values is not supported. Please disable editing or convert all values to strings."}}},getCellValue(a){return Se(a.data?.values)?null:a.data.values}}}pp.isEditableType=!0;function pu(e){const t=Ao({step:Zd(e.arrowType)?1:void 0,min_value:ig(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(ag(e.arrowType)||lg(e.arrowType)),r=Se(t.min_value)||t.min_value<0,o=dt(t.step)&&!Number.isNaN(t.step)?xh(t.step):void 0,i={kind:Q.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment??(n?"left":"right"),style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:o,thousandSeparator:""},a=l=>{let s=xi(l);if(Se(s))return!e.isRequired;if(Number.isNaN(s))return!1;let u=!1;return dt(t.max_value)&&s>t.max_value&&(s=t.max_value,u=!0),dt(t.min_value)&&s<t.min_value?!1:u?s:!0};return{...e,kind:"number",sortMode:"smart",typeIcon:":material/tag:",validateInput:a,getCell(l,s){if(s===!0){const f=a(l);if(f===!1)return Rt(et(l),"Invalid input.");typeof f=="number"&&(l=f)}let u=xi(l),c="";if(dt(u)){if(Number.isNaN(u))return Rt(et(l),"The value cannot be interpreted as a number.");if(dt(o)&&(u=fy(u,o)),Number.isInteger(u)&&!Number.isSafeInteger(u))return Rt(et(l),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=ss(u,e.arrowType):c=fa(u,t.format,o)}catch(f){return Rt(et(u),dt(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${f}`:`Failed to format the number. Error: ${f}`)}}return{...i,data:u,displayData:c,isMissingValue:Se(u),copyData:Se(u)?"":et(u)}},getCellValue(l){return l.data===void 0?null:l.data}}}pu.isEditableType=!0;function ki(e){const t={kind:Q.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=dt(n)?et(n):null,o=dt(r)?Ci(r):"";return{...t,data:r,displayData:o,isMissingValue:Se(n)}}catch(r){return Rt(et(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}ki.isEditableType=!1;function gp(e,t){const n=Zd(e.arrowType),r=Ao({min_value:0,max_value:n?100:1,format:n?"%3d%%":"percent",step:n?1:void 0,color:void 0},e.columnTypeOptions),o=Se(r.step)||Number.isNaN(r.step)?void 0:xh(r.step);let i;try{i=fa(r.max_value,r.format,o)}catch{i=et(r.max_value)}const a={kind:Q.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:i}};return{...e,kind:"progress",sortMode:"smart",typeIcon:":material/commit:",isEditable:!1,getCell(l){if(Se(l))return ws();if(Se(r.min_value)||Se(r.max_value)||Number.isNaN(r.min_value)||Number.isNaN(r.max_value)||r.min_value>=r.max_value)return Rt("Invalid min/max parameters",`The min_value (${r.min_value}) and max_value (${r.max_value}) parameters must be valid numbers.`);if(dt(r.step)&&Number.isNaN(r.step))return Rt("Invalid step parameter",`The step parameter (${r.step}) must be a valid number.`);const s=xi(l);if(Number.isNaN(s)||Se(s))return Rt(et(l),"The value cannot be interpreted as a number.");if(Number.isInteger(s)&&!Number.isSafeInteger(s))return Rt(et(l),"The value is larger than the maximum supported integer values in number columns (2^53).");let u="";try{u=fa(s,r.format,o)}catch(g){return Rt(et(s),dt(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,s));let f;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"?f=p?t?.colors.greenColor:t?.colors.redColor:f=p?t?.colors.redColor:t?.colors.greenColor}else r.color&&(f=qd(r.color,t));return{...a,isMissingValue:Se(l),copyData:String(s),data:{...a.data,value:c,label:u,measureLabel:u.length>i.length?u:i,color:f}}},getCellValue(l){return l.kind===Q.Loading||l.data?.value===void 0?null:l.data?.value}}}gp.isEditableType=!1;const Ak=e=>Se(e)?[]:e.filter(t=>dt(t)&&t!=="").map(t=>{if(typeof t=="object"&&"value"in t){const r=et(t.value).trim();return{value:r,label:t.label??r}}const n=et(t).trim();return{value:n,label:n}});function gu(e){let t="string";const n=Ao({options:Qd(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=s=>typeof s=="object"&&s!==null&&"value"in s,o=s=>r(s)?typeof s.value:typeof s,i=new Set(n.options.map(o));i.size===1&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const a=Ak(n.options),l={kind:Q.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...a],value:""}};return{...e,kind:"selectbox",sortMode:"default",typeIcon:":material/arrow_drop_down_circle:",getCell(s,u){let c=null;return dt(s)&&s!==""&&(c=et(s)),u&&!l.data.allowedValues.some(f=>f===null?c===null:typeof f=="string"?f===c:typeof f=="object"&&"value"in f?f.value===c:!1)?Rt(et(c),"The value is not part of the allowed options."):{...l,isMissingValue:c===null,copyData:c||"",data:{...l.data,value:c}}},getCellValue(s){return Se(s.data?.value)||s.data?.value===""?null:t==="number"?xi(s.data?.value)??null:t==="boolean"?wh(s.data?.value)??null:s.data?.value}}}gu.isEditableType=!0;function mu(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(i){n=`Invalid validate regex: ${t.validate}.
195
+ Error: ${i}`}const r={kind:Q.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},o=i=>{if(Se(i))return!e.isRequired;let a=et(i),l=!1;return t.max_chars&&a.length>t.max_chars&&(a=a.slice(0,t.max_chars),l=!0),n instanceof RegExp&&n.test(a)===!1?!1:l?a:!0};return{...e,kind:"text",sortMode:"default",typeIcon:":material/notes:",validateInput:o,getCell(i,a){if(typeof n=="string")return Rt(et(i),n);if(a){const l=o(i);if(l===!1)return Rt(et(i),"Invalid input.");typeof l=="string"&&(i=l)}try{const l=dt(i)?et(i):null,s=dt(l)?Ci(l):"";return{...r,isMissingValue:Se(l),data:l,displayData:s}}catch(l){return Rt("Incompatible value",`The value cannot be interpreted as string. Error: ${l}`)}},getCellValue(i){return i.data===void 0?null:i.data}}}mu.isEditableType=!0;const Ld=Cn("img",{target:"e24uaba0"})({name:"6eya2z",styles:"max-width:100%;max-height:37.5rem;object-fit:scale-down"}),Lk=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?fe.jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:fe.jsx(Ld,{src:t})}):fe.jsx(Ld,{src:t})},Hd=new Map(Object.entries({object:ki,text:mu,checkbox:su,selectbox:gu,list:hu,multiselect:pp,number:pu,link:cp,datetime:cu,date:fu,time:du,line_chart:ip,bar_chart:ap,area_chart:lp,image:sp,audio:fp,video:hp,progress:gp,json:up})),Hk=[by,Cy,Tk],Si=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),o=r.get(e),i={...o,...n};return(o?.type_config||n?.type_config)&&(i.type_config={...o?.type_config,...n?.type_config}),r.set(e,i),r};function Fk(e){return{changeColumnFormat:d.useCallback((t,n)=>{e(r=>Si({columnId:t,columnConfigMapping:r,updatedProps:{type_config:{format:n}}}))},[e])}}function ts(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const o=r.exec(n);if(o)return o[1].trim()}function zk(e,t,n){const r={};if(!n.includes(t))return e;const o=ts(t,"color",n);o&&(r.textDark=o,(e.kind===Q.Bubble||e.kind===Q.Custom&&e.data?.kind==="multi-select-cell")&&(r.textBubble=o),e.kind===Q.Uri&&(r.linkColor=o));const i=ts(t,"background-color",n);i&&(r.bgCell=i),i==="yellow"&&o===void 0&&(r.textDark="#31333F");const a=ts(t,"font-weight",n);return a&&(r.baseFontStyle=`${a} ${Yg.sm}`),r?{...e,themeOverride:r}:e}function Vk(e){return _g(e)||Ng(e)?mu:Bg(e)?cu:lf(e)?du:Wg(e)?fu:jg(e)||Gg(e)?ki:Qd(e)?su:Ug(e)?pu:Xg(e)?gu:Kg(e)?hu:ki}function mp(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 vu(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function $k(e,t){const n=e.columnNames.map(l=>l[t]),{title:r,group:o}=mp(n),i=e.columnTypes[t];let a=!0;return Dg(i)&&(a=!1),vu({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:o,isEditable:a,arrowType:i,isIndex:!0,isPinned:!0})}function _k(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:o}=mp(n),i=e.columnTypes[t];return vu({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:i,group:o})}function vp(){return vu({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:Eg.INDEX,arrowField:new Rg("",new Ig,!0),pandasType:void 0}})}function Fd(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,o=n.numDataColumns;if(r===0&&o===0)return t.push(vp()),t;for(let i=0;i<r;i++)t.push($k(e,i));for(let i=0;i<o;i++)t.push(_k(e,i+r));return t}function Nk(e,t,n,r=void 0){let o;if(e.kind==="object"||e.kind==="json")o=e.getCell(dt(t.content)?Ci(ss(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&dt(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let i;lf(t.contentType)&&dt(t.field?.type?.unit)?i=wm(t.content,t.field):i=Xr.utc(Number(t.content)).toDate(),o=e.getCell(i)}else if(Tg(t.contentType)){const i=Se(t.content)?null:ss(t.content,t.contentType);o=e.getCell(i)}else o=e.getCell(t.content);if(Oo(o))return o;if(!e.isEditable){if(n&&dt(n?.displayContent)){const i=Ci(n.displayContent);o.kind===Q.Text?o={...o,displayData:i}:o.kind===Q.Number&&Se(e.columnTypeOptions?.format)?o={...o,displayData:i}:o.kind===Q.Uri&&Se(e.columnTypeOptions?.display_text)?o={...o,displayData:i}:o.kind===Q.Custom&&o.data?.kind==="date-picker-cell"&&Se(e.columnTypeOptions?.format)&&(o={...o,data:{...o.data,displayDate:i}})}r&&n?.cssId&&(o=zk(o,n.cssId,r))}return o}function bp(e){return e?.useStretch??!1}function wp(e){if(e?.pixelWidth)return e.pixelWidth}function Bk(e){return e?.useContent??!1}function Wk(e,t){return t?!1:e?.useStretch??!1}function jk(e){return e?.useContent??!1}function Gk(e){if(e?.pixelHeight)return e.pixelHeight}function ns({numRows:e,rowHeight:t,theme:n,numHeaderRows:r=1}){return e*t+r*n.defaultHeaderHeight+2*n.tableBorderWidth}const ca="_index",zd="_pos:",Vd={small:75,medium:200,large:400},bu=Is.getLogger("useColumnLoader");function Uk(e){if(!Se(e)){if(typeof e=="number")return e;if(e in Vd)return Vd[e]}}function Xk(e){if(!Se(e)){if(new Set(["left","center","right"]).has(e))return e;bu.warn(`Invalid alignment value in column configuration: "${e}". Expected "left", "center", or "right".`)}}const ra=(e,t)=>Pg(e,t,(n,r)=>{if(sf(r))return r});function $d(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(ca)&&(n=ra(n,t.get(ca)??{})),t.has(`${zd}${e.indexNumber}`)&&(n=ra(n,t.get(`${zd}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==ca&&(n=ra(n,t.get(e.name)??{})),t.has(e.id)&&(n=ra(n,t.get(e.id)??{})),Qm(n)?e:af({...e},{title:n.label,width:Uk(n.width),isEditable:dt(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:Xk(n.alignment),defaultValue:n.default,help:n.help})}function Kk(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return bu.error(t),new Map}}function _d(e){const t=e.columnTypeOptions?.type;let n;return dt(t)&&(Hd.has(t)?n=Hd.get(t):bu.warn(`Unknown column type configured in column configuration: ${t}`)),Se(n)&&(n=Vk(e.arrowType)),n}function Yk(e,t,n,r,o){const i=Qr(),a=d.useMemo(()=>Kk(e.columns),[e.columns]),[l,s]=d.useState(a);d.useEffect(()=>{s(a)},[a]);const u=d.useMemo(()=>bp(o),[o]),c=d.useMemo(()=>wp(o),[o]),f=u||dt(c)&&c>0,g=dt(e.rowHeight)&&e.rowHeight>tn("4rem"),p=d.useMemo(()=>Fd(t).map(h=>{let m={...h,...$d(h,l),isStretched:f};const y=_d(m);return(e.editingMode===Xt.EditingMode.READ_ONLY||n||y.isEditableType===!1)&&(m={...m,isEditable:!1}),e.editingMode!==Xt.EditingMode.READ_ONLY&&m.isEditable==!0&&(m={...m,icon:"editable"},m.isRequired&&e.editingMode===Xt.EditingMode.DYNAMIC&&(m={...m,isHidden:!1})),y(m,i)}),[t,l,f,e.editingMode,n,i]);return{columns:d.useMemo(()=>{const h=Fd(t).map(v=>{let x={...v,...$d(v,l),isStretched:f,isWrappingAllowed:g};const T=_d(x);return(e.editingMode===Xt.EditingMode.READ_ONLY||n||T.isEditableType===!1)&&(x={...x,isEditable:!1}),e.editingMode!==Xt.EditingMode.READ_ONLY&&x.isEditable==!0&&(x={...x,icon:"editable"},x.isRequired&&e.editingMode===Xt.EditingMode.DYNAMIC&&(x={...x,isHidden:!1})),T(x,i)}).filter(v=>!v.isHidden),m=[],y=[];r?.length?(h.forEach(v=>{v.isIndex&&!r.includes(v.name)&&!r.includes(v.id)&&v.isPinned!==!1&&m.push(v)}),r.forEach(v=>{const x=h.find(T=>T.name===v||T.id===v);x&&(x.isPinned?m.push(x):y.push(x))})):h.forEach(v=>{v.isPinned?m.push(v):y.push(v)});const w=[...m,...y];return w.length>0?w:[ki(vp())]},[t,l,g,f,n,e.editingMode,r,i]),allColumns:p,setColumnConfigMapping:s}}function Zk(e,t,n,r,o,i){const a=d.useMemo(()=>e.filter(u=>u.isPinned).reduce((u,c)=>u+(c.width??r*2),0)>n*.6,[e,n,r]),l=t||a?0:e.filter(u=>u.isPinned).length,s=d.useCallback(u=>{i(c=>Si({columnId:u,columnConfigMapping:c,updatedProps:{pinned:!1}})),o(!0,!1)},[o,i]);return{pinColumn:d.useCallback(u=>{i(c=>Si({columnId:u,columnConfigMapping:c,updatedProps:{pinned:!0}})),o(!0,!1)},[o,i]),unpinColumn:s,freezeColumns:l}}function qk(e,t,n,r,o){return{onColumnMoved:d.useCallback((i,a)=>{const l=[...e],[s]=l.splice(i,1);l.splice(a,0,s),a<t&&!s.isPinned?n(s.id):a>=t&&s.isPinned&&r(s.id),o(l.map(u=>u.id))},[e,t,n,r,o])}}function Qk(e){const[t,n]=d.useState(()=>new Map),r=d.useCallback((o,i,a,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:d.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:r}}function Jk(e){switch(e.kind){case Q.Number:return e.data?.toString()??"";case Q.Boolean:return e.data?.toString()??"";case Q.Markdown:case Q.RowID:case Q.Text:case Q.Uri:return e.data??"";case Q.Bubble:case Q.Image:return e.data.join("");case Q.Drilldown:return e.data.map(t=>t.text).join("");case Q.Protected:case Q.Loading:return"";case Q.Custom:return e.copyData}}function Nd(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function eS(e,t){return e=Nd(e),t=Nd(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 tS(e,t){return e>t?1:e===t?0:-1}function nS(e){const{sort:t,rows:n,getCellContent:r}=e,o=d.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),i=d.useMemo(()=>o.map(u=>{const c=e.columns.findIndex(f=>u.column===f||f.id!==void 0&&u.column.id===f.id);return c===-1?void 0:c}),[o,e.columns]),a=d.useMemo(()=>{const u=o.map((f,g)=>({sort:f,col:i[g]})).filter(f=>f.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let f=0;f<u.length;f++){const{col:g}=u[f],p=[g,0];for(let h=0;h<n;h++)p[1]=h,c[f][h]=Jk(r(p))}return Tr(n).sort((f,g)=>{for(let p=0;p<u.length;p++){const{sort:h}=u[p],m=c[p][f],y=c[p][g];let w;if(h.mode==="raw"?w=tS(m,y):h.mode==="smart"?w=eS(m,y):w=m.localeCompare(y),w!==0)return(h.direction??"asc")==="desc"&&(w=-w),w}return 0})},[r,n,o,i]),l=d.useCallback(u=>a===void 0?u:a[u],[a]),s=d.useCallback(([u,c])=>a===void 0?r([u,c]):(c=a[c],r([u,c])),[r,a]);return a===void 0?{getCellContent:e.getCellContent,getOriginalIndex:l}:{getOriginalIndex:l,getCellContent:s}}function rS(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 oS(e,t,n){const[r,o]=d.useState(),{getCellContent:i,getOriginalIndex:a}=nS({columns:t.map(u=>ys(u)),getCellContent:n,rows:e,sort:r}),l=d.useMemo(()=>rS(t,r),[t,r]),s=d.useCallback((u,c,f)=>{const g=l[u];let p;c==="auto"?(p="asc",r?.column.id===g.id&&(r.direction==="asc"?p="desc":p=void 0)):p=c,p===void 0||f&&p===r?.direction?o(void 0):o({column:ys(g),direction:p,mode:g.sortMode})},[r,l]);return{columns:l,sortColumn:s,getOriginalIndex:a,getCellContent:i}}function iS(e,t){const n=d.useCallback(o=>{t(i=>Si({columnId:o,columnConfigMapping:i,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=d.useCallback(o=>{t(i=>Si({columnId:o,columnConfigMapping:i,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function aS(){return{provideEditor:d.useCallback(e=>{if(e.kind===Q.Text&&e.readonly&&dy(e.data))return{editor:vy}},[])}}const lS={kind:Q.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:o,hoverAmount:i,hoverX:a}=e;let{values:l,yAxis:s,color:u,graphKind:c="area",displayValues:f,hideAxis:g}=t.data;const[p,h]=s;if(l.length===0)return!0;l=l.map(C=>Math.min(1,Math.max(0,(C-p)/(h-p))));const m=r.cellHorizontalPadding,y=m+o.x,w=o.y+3,v=o.height-6,x=o.width-m*2,T=h-p,I=h<=0?w:p>=0?w+v:w+v*(h/T);if(!g&&p<=0&&h>=0&&(n.beginPath(),n.moveTo(y,I),n.lineTo(y+x,I),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const C=2,A=(l.length-1)*C,E=(x-A)/l.length;let k=y;for(const P of l){const O=w+v-P*v;n.moveTo(k,I),n.lineTo(k+E,I),n.lineTo(k+E,O),n.lineTo(k,O),k+=E+C}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{l.length===1&&(l=[l[0],l[0]],f&&(f=[f[0],f[0]])),n.beginPath();const C=(o.width-16)/(l.length-1),A=l.map((k,P)=>({x:y+C*P,y:w+v-k*v}));n.moveTo(A[0].x,A[0].y);let E=0;if(A.length>2)for(E=1;E<A.length-2;E++){const k=(A[E].x+A[E+1].x)/2,P=(A[E].y+A[E+1].y)/2;n.quadraticCurveTo(A[E].x,A[E].y,k,P)}if(n.quadraticCurveTo(A[E].x,A[E].y,A[E+1].x,A[E+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+i*.5,n.stroke(),n.lineTo(o.x+o.width-m,I),n.lineTo(o.x+m,I),n.closePath(),c==="area"){n.globalAlpha=.2+.2*i;const k=n.createLinearGradient(0,w,0,w+v*1.4);k.addColorStop(0,u??r.accentColor);const[P,O,R]=bi(u??r.accentColor);k.addColorStop(1,`rgba(${P}, ${O}, ${R}, 0)`),n.fillStyle=k,n.fill(),n.globalAlpha=1}if(a!==void 0&&(c==="line"||c==="area")&&f!==void 0){n.beginPath();const k=Math.min(l.length-1,Math.max(0,Math.round((a-m)/C)));n.moveTo(y+k*C,o.y+1),n.lineTo(y+k*C,o.y+o.height),n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.save(),n.font=`8px ${r.fontFamily}`,n.fillStyle=r.textMedium,n.textBaseline="top",n.fillText(f[k],y,o.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function Bd(e,t,n,r,o,i){if(!(r<=0||o<=0)){if(typeof i=="number"&&i<=0){e.rect(t,n,r,o);return}typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.min(i.tl,o/2,r/2),tr:Math.min(i.tr,o/2,r/2),bl:Math.min(i.bl,o/2,r/2),br:Math.min(i.br,o/2,r/2)},i.tl=Math.max(0,i.tl),i.tr=Math.max(0,i.tr),i.br=Math.max(0,i.br),i.bl=Math.max(0,i.bl),e.moveTo(t+i.tl,n),e.arcTo(t+r,n,t+r,n+i.tr,i.tr),e.arcTo(t+r,n+o,t+r-i.br,n+o,i.br),e.arcTo(t,n+o,t,n+o-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}}const sS=e=>{const{Menu:t}=za,{children:n,...r}=e;return d.createElement(t,{...r},n)},uS=dn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),cS=dn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),dS=dn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),fS=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:o}=e,{allowedValues:i,value:a}=t.data,[l,s]=d.useState(a),[u,c]=d.useState(r??""),f=Qf(),g=d.useMemo(()=>i.map(p=>typeof p=="string"||p===null||p===void 0?{value:p,label:p?.toString()??""}:p),[i]);return t.readonly?d.createElement(dS,null,d.createElement(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:l??"",onChange:()=>{}})):d.createElement(uS,null,d.createElement(tp,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(p=>p.value===l),styles:{control:p=>({...p,border:0,boxShadow:"none"}),option:(p,{isFocused:h})=>({...p,fontSize:f.editorFontSize,fontFamily:f.fontFamily,cursor:h?"pointer":void 0,paddingLeft:f.cellHorizontalPadding,paddingRight:f.cellHorizontalPadding,":active":{...p[":active"],color:f.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:p=>({...p,colors:{...p.colors,neutral0:f.bgCell,neutral5:f.bgCell,neutral10:f.bgCell,neutral20:f.bgCellMedium,neutral30:f.bgCellMedium,neutral40:f.bgCellMedium,neutral50:f.textLight,neutral60:f.textMedium,neutral70:f.textMedium,neutral80:f.textDark,neutral90:f.textDark,neutral100:f.textDark,primary:f.accentColor,primary75:f.accentColor,primary50:f.accentColor,primary25:f.accentLight}}),menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:p=>d.createElement(cS,null,d.createElement(sS,{className:"click-outside-ignore",...p}))},options:g,onChange:async p=>{p!==null&&(s(p.value),await new Promise(h=>window.requestAnimationFrame(h)),n({...t,data:{...t.data,value:p.value}}))}}))},hS={kind:Q.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{value:i}=t.data,a=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===i:s.value===i),l=typeof a=="string"?a:a?.label??"";return l&&(n.fillStyle=r.textDark,n.fillText(l,o.x+r.cellHorizontalPadding,o.y+o.height/2+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:fS,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 pS(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const o=parseFloat(r[1]),i=r[2],a=o*t;return e.replace(n,`${Number(a.toPrecision(3))}${i}`)}return e}const gS={marginRight:8},mS={display:"flex",alignItems:"center",flexGrow:1},vS={kind:Q.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{min:i,max:a,value:l,label:s,measureLabel:u,color:c}=t.data,f=o.x+r.cellHorizontalPadding,g=o.y+o.height/2,p=a-i,h=(l-i)/p,m=`${pS(r.baseFontStyle,.9)} ${r.fontFamily}`,y=Ws(n,m)/2;n.save();let w=0;s!==void 0&&(n.font=m,w=Pr(u??s,n,m).width+r.cellHorizontalPadding);const v=o.width-r.cellHorizontalPadding*2-w;if(v>=y){const x=n.createLinearGradient(f,g,f+v,g),T=c??r.accentColor;x.addColorStop(0,T),x.addColorStop(h,T),x.addColorStop(h,r.bgBubble),x.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=x,Bd(n,f,g-y/2,v,y,y/2),n.fill(),n.beginPath(),Bd(n,f+.5,g-y/2+.5,v-1,y-1,(y-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,o.x+o.width-r.cellHorizontalPadding,g+Qn(n,m))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),o=t.min.toString(),i=t.max.toString(),a=t.step.toString(),l=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return d.createElement("label",{style:mS},d.createElement("input",{style:gS,type:"range",value:r,min:o,max:i,step:a,onChange:l,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},bS=dn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),rs=(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}`)}},wS=e=>{const t=e.value.data,{format:n,displayDate:r}=t,o=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,i=t.timezoneOffset?t.timezoneOffset*60*1e3:0,a=t.min instanceof Date?rs(n,t.min,i):t.min,l=t.max instanceof Date?rs(n,t.max,i):t.max,s=rs(n,t.date,i);return e.value.readonly?St.createElement(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):St.createElement(bS,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:a,max:l,step:o,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-i)}})}})},yS={kind:Q.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Bs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:wS}),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)}}},xS="None";function Wd(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 CS=(e,t)=>{const{cell:n,theme:r,ctx:o}=e;Bs({...e,theme:{...r,textDark:r.textLight,headerFontFull:`${r.headerFontStyle} ${r.fontFamily}`,baseFontFull:`${r.baseFontStyle} ${r.fontFamily}`,markerFontFull:`${r.markerFontStyle} ${r.fontFamily}`}},t,n.contentAlign),o.fillStyle=r.textDark};function kS(e,t){const n=d.useCallback((o,i)=>{const{cell:a,theme:l,ctx:s,rect:u}=o,c=o.col;if(Oo(a))Wd(s,u,l);else if(Zs(a)&&c<e.length){const f=e[c],g=t??xS;["checkbox","line_chart","bar_chart","progress"].includes(f.kind)?i():CS(o,g),f.isRequired&&f.isEditable&&Wd(s,u,l);return}i()},[e,t]),r=d.useMemo(()=>[lS,hS,vS,yS,...Hk],[]);return{drawCell:n,customRenderers:r}}function SS(){const e=Qr();return d.useMemo(()=>{const t={editable:n=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${n.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:Co(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Co(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:Co(e.colors.darkenedBgMix100,.9),bgHeaderHovered:Co(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(tn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${tn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${tn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Co(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(tn(e.spacing.sm)),cellVerticalPadding:Math.round(tn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:kg(e.colors.secondaryBg,.1),bubbleHeight:Math.round(tn("1.25rem")),bubblePadding:Math.round(tn(e.spacing.sm)),bubbleMargin:Math.round(tn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(tn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:parseInt(e.sizes.borderWidth),defaultTableHeight:Math.round(tn("25rem")),minColumnWidth:Math.round(tn("3.125rem")),maxColumnWidth:Math.round(tn("62.5rem")),maxColumnAutoWidth:Math.round(tn("31.25rem")),defaultRowHeight:Math.round(tn("2.1875rem")),defaultHeaderHeight:Math.round(tn("2.1875rem")),bgRowHovered:Cg(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:t}},[e])}const MS=Is.getLogger("useDataEditor");function RS({columns:e,allColumns:t,canAddRows:n,canDeleteRows:r,editingState:o,getCellContent:i,getOriginalIndex:a,refreshCells:l,updateNumRows:s,syncEditState:u,clearSelection:c}){const f=d.useCallback(([w,v],x)=>{const T=e[w];if(!T.isEditable)return;const I=T.indexNumber,C=o.current.getOriginalRowIndex(a(v)),A=i([w,v]),E=T.getCellValue(A),k=T.getCellValue(x);if(!Oo(A)&&k===E)return;const P=T.getCell(k,!0);Oo(P)?MS.warn(`Not applying the cell edit since it causes this error:
196
+ ${P.data}`):(o.current.setCell(I,C,{...P,lastUpdated:performance.now()}),u())},[e,o,a,i,u]),g=d.useCallback(()=>{if(!n)return;const w=new Map;t.forEach(v=>{w.set(v.indexNumber,v.getCell(v.defaultValue))}),o.current.addRow(w),s()},[t,o,n,s]),p=d.useCallback(()=>{n&&(g(),u())},[g,u,n]),h=d.useCallback(w=>{if(w.rows.length>0){if(!r)return!0;const v=w.rows.toArray().map(x=>o.current.getOriginalRowIndex(a(x)));return o.current.deleteRows(v),s(),c(),u(),!1}if(w.current?.range){const v=[],x=w.current.range;for(let T=x.y;T<x.y+x.height;T++)for(let I=x.x;I<x.x+x.width;I++){const C=e[I];C.isEditable&&!C.isRequired&&(v.push({cell:[I,T]}),f([I,T],C.getCell(null)))}return v.length>0&&(u(),l(v)),!1}return!0},[e,o,r,l,a,u,f,c,s]),m=d.useCallback((w,v)=>{const[x,T]=w,I=[];for(let C=0;C<v.length;C++){const A=v[C];if(C+T>=o.current.getNumRows()){if(!n)break;g()}for(let E=0;E<A.length;E++){const k=A[E],P=C+T,O=E+x;if(O>=e.length)break;const R=e[O];if(R.isEditable){const M=R.getCell(k,!0);if(dt(M)&&!Oo(M)){const D=R.indexNumber,S=o.current.getOriginalRowIndex(a(P)),K=R.getCellValue(i([O,P]));R.getCellValue(M)!==K&&(o.current.setCell(D,S,{...M,lastUpdated:performance.now()}),I.push({cell:[O,P]}))}}}I.length>0&&(u(),l(I))}return!1},[e,o,n,a,i,g,u,l]),y=d.useCallback((w,v)=>{const x=w[0];if(x>=e.length)return!0;const T=e[x];if(T.validateInput){const I=T.validateInput(T.getCellValue(v));return I===!0||I===!1?I:T.getCell(I)}return!0},[e]);return{onCellEdited:f,onPaste:m,onRowAppended:p,onDelete:h,validateCell:y}}const yp=",",ci='"',IS='"',xp=`
197
+ `,ES="\uFEFF",TS=new RegExp(`[${[yp,ci,xp].join("")}]`),jd=Is.getLogger("useDataExporter");function Gd(e){return e.map(t=>OS(t)).join(yp)+xp}function OS(e){if(Se(e))return"";const t=et(e);return TS.test(t)?`${ci}${t.replace(new RegExp(ci,"g"),IS+ci)}${ci}`:t}async function Ud(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(ES));const i=n.map(a=>a.name);await e.write(o.encode(Gd(i)));for(let a=0;a<r;a++){const l=[];n.forEach((s,u,c)=>{l.push(s.getCellValue(t([u,a])))}),await e.write(o.encode(Gd(l)))}await e.close()}function DS(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const o=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const i=await(await(await Rs(()=>import("./es6-BxevHr5y-DDD2E1qH.js"),__vite__mapDeps([23,1,2])).then(a=>a.a)).showSaveFilePicker({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Ud(i,e,t,n)}catch(i){if(i instanceof Error&&i.name==="AbortError")return;try{jd.warn("Failed to export data as CSV with FileSystem API, trying fallback method",i);let a="";const l=new WritableStream({write:f=>{a+=new TextDecoder("utf-8").decode(f)},close:async()=>{}});await Ud(l.getWriter(),e,t,n);const s=new Blob([a],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(s),c=Bm({enforceDownloadInNewTab:r,url:u,filename:o});c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(u)}catch(a){jd.error("Failed to export data as CSV",a)}}},[t,n,e,r])}}function PS(e,t,n,r){return{getCellContent:d.useCallback(([o,i])=>{if(o>t.length-1)return Rt("Column index out of bounds","This error should never happen. Please report this bug.");if(i>n-1)return Rt("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,s=r.current.getOriginalRowIndex(i),u=r.current.isAddedRow(s);if(a.isEditable||u){const g=r.current.getCell(l,s);if(dt(g))return{...a.getCell(a.getCellValue(g),!1),lastUpdated:g.lastUpdated};if(u)return Rt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${s}`)}const c=e.getCell(s,l),f=bm(e,s,l);return Nk(a,c,f,e.styler?.cssStyles)}catch(a){return Rt("Error during cell creation",`This error should never happen. Please report this bug.
198
+ Error: ${a}`)}},[t,n,e,r])}}function AS(e){const[t,n]=d.useState(void 0),r=d.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,i]=o.location;n(i)}},[n]);return{getRowThemeOverride:d.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function LS(e,t,n,r,o){const[i,a]=d.useState({columns:Xe.empty(),rows:Xe.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(Xt.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Xt.SelectionMode.SINGLE_ROW)||e.selectionMode.includes(Xt.SelectionMode.SINGLE_ROW_REQUIRED)),s=l&&e.selectionMode.includes(Xt.SelectionMode.MULTI_ROW),u=l&&e.selectionMode.includes(Xt.SelectionMode.SINGLE_ROW_REQUIRED),c=!t&&!n&&(e.selectionMode.includes(Xt.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Xt.SelectionMode.MULTI_COLUMN)),f=c&&e.selectionMode.includes(Xt.SelectionMode.MULTI_COLUMN),g=!t&&!n&&(e.selectionMode.includes(Xt.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(Xt.SelectionMode.MULTI_CELL)),p=g&&e.selectionMode.includes(Xt.SelectionMode.MULTI_CELL),h=i.rows.length>0,m=i.columns.length>0,y=i.current!==void 0,w=d.useCallback((x,T={})=>{const{shouldSync:I=!0}=T,C=!ol(x.rows.toArray(),i.rows.toArray()),A=!ol(x.columns.toArray(),i.columns.toArray()),E=!ol(x.current,i.current),k=I&&(l&&C||c&&A||g&&E);let P=x,O=!1;if(u&&C&&x.rows.length===0&&i.rows.length>0&&(P={...P,rows:i.rows},O=!0),A&&P.columns.length>=0){let R=P.columns;r.forEach((M,D)=>{M.isIndex&&(R=R.remove(D))}),R.length<P.columns.length&&(P={...P,columns:R})}a(P),k&&(!O||A||E)&&o(P,g)},[i,l,u,c,g,o,r]),v=d.useCallback((x=!1,T=!1)=>{const I=x||u,C={columns:T?i.columns:Xe.empty(),rows:I?i.rows:Xe.empty(),current:void 0};a(C),(!I&&l||!T&&c||g)&&o(C,g)},[i,l,u,c,g,o]);return{gridSelection:i,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isRequiredRowSelectionActivated:u,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:f,isCellSelectionActivated:g,isMultiCellSelectionActivated:p,isRowSelected:h,isColumnSelected:m,isCellSelected:y,clearSelection:v,processSelectionChange:w}}function HS(e,t,n,r,o,i,a,l,s,u,c){const f=e.rowHeight??t.defaultRowHeight,g=r?2:1,p=e.editingMode===Xt.EditingMode.DYNAMIC||e.editingMode===Xt.EditingMode.ADD_ONLY?1:0,h=n+p,m=ns({numRows:h,rowHeight:f,theme:t,numHeaderRows:g}),y=Gk(s),w=Wk(s,c),v=jk(s),x=w?Math.max(1,Math.min(n,3)):1,T=ns({numRows:x,rowHeight:f,theme:t}),I=1e4;let C=Math.max(m,T),A=Math.min(C,t.defaultTableHeight);if(w&&u&&u>0)C=Math.max(u,C);else if(v){const B=Math.ceil(I/f),X=Math.min(h,B),ie=ns({numRows:X,rowHeight:f,theme:t,numHeaderRows:g})+1;A=Math.max(ie,T),C=Math.max(A,C)}else y&&(A=Math.max(y,T),C=Math.max(A,C));i&&(A=Math.min(A,i),C=Math.min(C,i),y||(A=C));const E=t.minColumnWidth+2*t.tableBorderWidth,k=Math.max(o,E);let P,O=k;const R=bp(l),M=wp(l),D=Bk(l);R?P=k:M?(P=Math.min(Math.max(M,E),k),O=Math.min(Math.max(M,O),k)):D&&(P=void 0);const[S,K]=d.useState({width:P||"100%",height:w?"100%":A});return d.useLayoutEffect(()=>{R&&S.width==="100%"&&K(B=>({...B,width:k}))},[k]),d.useLayoutEffect(()=>{K(B=>({...B,width:P||"100%"}))},[P]),d.useLayoutEffect(()=>{K(B=>({...B,height:w?"100%":A}))},[A,n,u,w,c]),d.useLayoutEffect(()=>{if(a){const B=R||dt(M)&&M>0;K({width:B?O:"100%",height:C})}else K({width:P||"100%",height:A})},[a]),{minHeight:T,maxHeight:C,minWidth:E,maxWidth:O,rowHeight:f,resizableSize:S,setResizableSize:K}}const FS=600,zS="⚠️ Please fill out this cell.";function VS(e,t,n=[]){const[r,o]=d.useState(),i=d.useRef(),{clear:a,restart:l}=di(()=>{i.current&&(o(i.current),i.current=void 0)},FS,{autoStart:!1}),s=d.useCallback(c=>{if(a(),i.current=void 0,o(void 0),(c.kind==="header"||c.kind==="cell")&&c.location){const f=c.location[0],g=c.location[1];let p;if(f<0||f>=e.length||n.includes(g))return;const h=e[f];if(c.kind==="header"&&dt(h))p=h.help;else if(c.kind==="cell"){const m=t([f,g]);Oo(m)?p=m.errorDetails:h.isRequired&&h.isEditable&&Zs(m)?p=zS:uy(m)&&(p=m.tooltip)}p&&(i.current={content:p,left:c.bounds.x+c.bounds.width/2,top:c.bounds.y},l())}},[a,e,t,n,l]),u=d.useCallback(()=>{a(),i.current=void 0,o(void 0)},[a,o]);return{tooltip:r,clearTooltip:u,onItemHovered:s}}function Yr(e){return e.isIndex?ca:Se(e.name)?"":e.name}class oa{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const r={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,i,a)=>{const l={};o.forEach((s,u)=>{const c=n.get(u);c&&(l[Yr(c)]=c.getCellValue(s))}),r.edited_rows[i]=l}),this.addedRows.forEach(o=>{const i={};let a=!1;o.forEach((l,s,u)=>{const c=n.get(s);if(c){const f=c.getCellValue(l);c.isRequired&&c.isEditable&&Zs(l)&&(a=!0),dt(f)&&(i[Yr(c)]=f)}}),a||r.added_rows.push(i)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,i)=>i===void 0?null:i)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),o=new Map;n.forEach(a=>{o.set(a.indexNumber,a)});const i=new Map;n.forEach(a=>{i.set(Yr(a),a)}),Object.keys(r.edited_rows).forEach(a=>{const l=Number(a),s=r.edited_rows[a];Object.keys(s).forEach(u=>{const c=s[u],f=i.get(u);if(f){const g=f.getCell(c);g&&(this.editedCells.has(l)||this.editedCells.set(l,new Map),this.editedCells.get(l)?.set(f.indexNumber,g))}})}),r.added_rows.forEach(a=>{const l=new Map;n.forEach(s=>{l.set(s.indexNumber,s.getCell(null))}),Object.keys(a).forEach(s=>{const u=a[s],c=i.get(s);if(c){const f=c.getCell(u);f&&l.set(c.indexNumber,f)}}),this.addedRows.push(l)}),this.deletedRows=r.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const r=this.editedCells.get(n);if(r!==void 0)return r.get(t)}setCell(t,n,r){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,r)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,r)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,r)=>r-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Se(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 Cp=150;function $S(e){if(typeof e!="object"||e===null)return!1;const t=e.selection;return typeof t=="object"&&t!==null}function os(e,t,n,r,o,i){let a;try{a=JSON.parse(e)}catch{return}if(!$S(a))return;const l=t.map(f=>Yr(f));let s=Xe.empty(),u=Xe.empty(),c;if(a.selection?.rows?.forEach(f=>{const g=i?i(f):f;g!==void 0&&(s=s.add(g))}),a.selection?.columns?.forEach(f=>{const g=l.indexOf(f);g>=0&&(u=u.add(g))}),n&&!r){const[f,g]=a.selection?.cells?.[0]??[];if(f!==void 0&&g!==void 0){const p=i?i(f):f,h=l.indexOf(g);p!==void 0&&h>=0&&(c=[h,p])}}if(o||s.length>0||u.length>0||c!==void 0)return{rows:s,columns:u,current:c?{cell:c,range:{x:c[0],y:c[1],width:1,height:1},rangeStack:[]}:void 0}}function _S({element:e,widgetMgr:t,fragmentId:n,originalNumRows:r,originalColumns:o}){const{READ_ONLY:i}=Xt.EditingMode,a=d.useRef(new oa(r)),[l,s]=d.useState(a.current.getNumRows());Sg(()=>{a.current=new oa(r),s(a.current.getNumRows())},[r]);const u=d.useCallback(()=>{a.current=new oa(r),s(a.current.getNumRows())},[r]),c=d.useCallback(()=>{s(w=>{const v=a.current.getNumRows();return w!==v?v:w})},[]);d.useEffect(()=>{if(e.editingMode===i||!t)return;const w=t.getStringValue({id:e.id,formId:e.formId??void 0});w&&(a.current.fromJson(w,o),s(a.current.getNumRows()))},[]);const f=d.useCallback(()=>{if(!t)return;const w=a.current.toJson(o);let v=t.getStringValue({id:e.id,formId:e.formId??void 0});v===void 0&&(v=new oa(0).toJson([])),w!==v&&t.setStringValue({id:e.id,formId:e.formId??void 0},w,{fromUi:!0},n)},[o,e.id,e.formId,t,n]),{debouncedCallback:g}=vh(f,Cp),p=d.useCallback((w,v)=>(x,T)=>{if(!t)return;const I={selection:{rows:[],columns:[],cells:[]}};if(I.selection.rows=x.rows.toArray().map(E=>v(E)),I.selection.columns=x.columns.toArray().map(E=>Yr(w[E])),T&&x.current){const{cell:E,range:k}=x.current;if(k)for(let P=k.y;P<k.y+k.height;P++)for(let O=k.x;O<k.x+k.width;O++)w[O].isIndex||I.selection.cells.push([v(P),Yr(w[O])]);else if(E){const[P,O]=E;w[P].isIndex||I.selection.cells.push([v(O),Yr(w[P])])}}const C=JSON.stringify(I),A=t.getStringValue({id:e.id,formId:e.formId??void 0});(A===void 0||A!==C)&&t.setStringValue({id:e.id,formId:e.formId??void 0},C,{fromUi:!0},n)},[e.id,e.formId,t,n]),h=d.useCallback(({columns:w,isRowSelectionActivated:v,isRequiredRowSelectionActivated:x,isColumnSelectionActivated:T,isCellSelectionActivated:I,isMultiCellSelectionActivated:C})=>{if(e.selectionState||!v&&!T&&!I||!t)return;const A=t.getStringValue({id:e.id,formId:e.formId??void 0});if(A)return os(A,w,I,C,!1);if(e.selectionDefault){const E=os(e.selectionDefault,w,I,C,!0);return E!==void 0&&t.setStringValue({id:e.id,formId:e.formId??void 0},e.selectionDefault,{fromUi:!1},n),E}if(x&&r>0){const E={rows:Xe.empty().add(0),columns:Xe.empty(),current:void 0},k=JSON.stringify({selection:{rows:[0],columns:[],cells:[]}});return t.setStringValue({id:e.id,formId:e.formId??void 0},k,{fromUi:!1},n),E}},[t,e.id,e.formId,e.selectionState,e.selectionDefault,n,r]),m=d.useCallback(()=>{u()},[u]),y=d.useCallback(({selectionState:w,columns:v,isRowSelectionActivated:x,isColumnSelectionActivated:T,isCellSelectionActivated:I,isMultiCellSelectionActivated:C,getOriginalIndex:A})=>{if(!t||!x&&!T&&!I)return;const E=new Map;for(let P=0;P<r;P++)E.set(A(P),P);const k=os(w,v,I,C,!0,P=>E.get(P));return k!==void 0&&t.setStringValue({id:e.id,formId:e.formId??void 0},w,{fromUi:!1},n),k},[e.id,e.formId,t,n,r]);return{editingState:a,numRows:l,resetEditingState:u,updateNumRows:c,syncEditState:g,createSyncSelectionState:p,onFormCleared:m,loadInitialSelectionState:h,getProgrammaticSelectionState:y}}const kp=Cn("div",{target:"e1hnsd047"})(({theme:e})=>({paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS,paddingLeft:e.spacing.xs,paddingRight:e.spacing.xs}),""),Er=Cn("div",{target:"e1hnsd046"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,marginTop:e.spacing.twoXS,marginBottom:e.spacing.twoXS,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS,cursor:"pointer",borderRadius:e.radii.md2,backgroundColor:t?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}}),""),Sp=Cn("div",{target:"e1hnsd045"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs,marginLeft:e.spacing.xs,marginRight:`max(0px, calc(${e.spacing.xs} - var(--scrollbar-gutter-size, 0px)))`}),""),NS=Cn("div",{target:"e1hnsd044"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.twoXS} ${e.spacing.none}`,cursor:"default",gap:e.spacing.twoXS}),""),BS=Cn("div",{target:"e1hnsd043"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md2,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"}),""),WS=Cn("div",{target:"e1hnsd042"})(({theme:e})=>({display:"flex",alignItems:"center",flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md2,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"}),""),jS=Cn("span",{target:"e1hnsd041"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"}),""),GS=Cn("button",{target:"e1hnsd040"})(({theme:e})=>({background:"none",border:"none",padding:e.spacing.twoXS,cursor:"pointer",color:e.colors.bodyText,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.sm,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}}),""),Xd=[{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:"}],US={number:Xd,progress:Xd,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 XS({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:o,onCloseMenu:i,children:a}){const l=Qr(),{colors:s,fontSizes:u,fontWeights:c}=l,f=US[e]||[];return f.length===0?fe.jsx(fe.Fragment,{}):fe.jsx(Ta,{triggerType:Jd.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:fe.jsx(kp,{role:"menu",children:f.map(g=>fe.jsxs(Er,{onClick:()=>{o(g.format),i()},role:"menuitem",children:[fe.jsx(Kn,{size:"base",iconValue:g.icon}),g.label]},g.format))}),placement:Oa.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:()=>({...Da(l),paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"})},Inner:{style:()=>({backgroundColor:s.bgColor,color:s.bodyText,fontSize:u.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"})}},children:a})}const KS=d.memo(XS);function YS({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:o,onCloseMenu:i,onSortColumn:a,onHideColumn:l,column:s,onChangeFormat:u,onAutosize:c}){const f=Qr(),[g,p]=d.useState(!1),{colors:h,fontSizes:m,fontWeights:y}=f,{isCopied:w,copyToClipboard:v}=sg();d.useEffect(()=>{function I(C){C.preventDefault()}return document.addEventListener("wheel",I,{passive:!1}),document.addEventListener("touchmove",I,{passive:!1}),()=>{document.removeEventListener("wheel",I),document.removeEventListener("touchmove",I)}},[]);const x=d.useCallback(()=>{i()},[i]),T=d.useCallback(()=>{v(s.title)},[s.title,v]);return fe.jsx(Ta,{autoFocus:!0,"aria-label":"Dataframe column menu",content:fe.jsxs(kp,{children:[fe.jsxs(NS,{children:[fe.jsx(BS,{title:s.kind,children:fe.jsx(Kn,{size:"base",iconValue:s.typeIcon||":material/notes:"})}),fe.jsxs(WS,{title:s.title,children:[fe.jsx(jS,{children:s.title}),fe.jsx(GS,{onClick:T,title:"Copy column name","aria-label":"Copy column name",children:fe.jsx(Kn,{size:"sm",iconValue:w?":material/check:":":material/content_copy:"})})]})]}),a&&fe.jsxs(fe.Fragment,{children:[fe.jsxs(Er,{onClick:()=>{a("asc"),x()},role:"menuitem",children:[fe.jsx(Kn,{size:"base",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),fe.jsxs(Er,{onClick:()=>{a("desc"),x()},role:"menuitem",children:[fe.jsx(Kn,{size:"base",iconValue:":material/arrow_downward:"}),"Sort descending"]}),fe.jsx(Sp,{})]}),u&&fe.jsx(KS,{columnKind:s.kind,isOpen:g,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onChangeFormat:u,onCloseMenu:x,children:fe.jsxs(Er,{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),isActive:g,hasSubmenu:!0,children:[fe.jsxs("div",{children:[fe.jsx(Kn,{size:"base",iconValue:":material/format_list_numbered:"}),"Format"]}),fe.jsx(Kn,{size:"base",iconValue:":material/chevron_right:"})]})}),c&&fe.jsxs(Er,{onClick:()=>{c(),x()},children:[fe.jsx(Kn,{size:"base",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&fe.jsxs(Er,{onClick:()=>{o(),x()},children:[fe.jsx(Kn,{size:"base",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&fe.jsxs(Er,{onClick:()=>{r(),x()},children:[fe.jsx(Kn,{size:"base",iconValue:":material/keep:"}),"Pin column"]}),l&&fe.jsxs(Er,{onClick:()=>{l(),x()},children:[fe.jsx(Kn,{size:"base",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Oa.bottomRight,accessibilityType:ef.menu,showArrow:!1,popoverMargin:tn("0.375rem"),onClickOutside:g?void 0:x,onEsc:x,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",boxShadow:"none"}},Inner:{style:()=>({...Da(f),backgroundColor:h.bgColor,color:h.bodyText,fontSize:m.sm,fontWeight:y.normal,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"})}},isOpen:!0,children:fe.jsx("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const ZS=d.memo(YS),qS="(index)";function is(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const Kd=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const o=Qr();return fe.jsx(Wm,{isIndeterminate:n,checked:t,onChange:i=>{r(i.target.checked)},"aria-label":e,checkmarkType:Gm.default,labelPlacement:jm.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:o.spacing.none,marginTop:o.spacing.none,paddingLeft:o.spacing.md,paddingRight:o.spacing.md,paddingTop:o.spacing.twoXS,paddingBottom:o.spacing.twoXS,backgroundColor:i?o.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:a,$isIndeterminate:l})=>{const s=a||l?o.colors.primary:o.colors.borderColor;return{outline:0,width:o.sizes.checkbox,height:o.sizes.checkbox,marginTop:o.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&(a||l)?o.shadows.focusRing:"",borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:o.lineHeights.small,paddingLeft:o.spacing.sm,position:"relative",color:o.colors.bodyText,fontSize:o.fontSizes.sm,fontWeight:o.fontWeights.normal}}},children:e})},QS=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:o,children:i,isOpen:a,onClose:l})=>{const s=Qr(),u=tf(),c=h=>!(h.isHidden===!0||is(h,t)),f=e.every(c),g=e.some(c)&&!f,p=h=>{e.forEach(m=>{const y=is(m,t);h?(o(m.id),y&&n(w=>[...w,m.id])):r(m.id)})};return fe.jsx(Ta,{triggerType:Jd.click,placement:Oa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>fe.jsxs("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm,maxHeight:`min(${s.sizes.maxDropdownHeight}, 70vh)`,overflow:"auto","--scrollbar-gutter-size":`${u}px`},children:[fe.jsx(Kd,{label:"Select all",isIndeterminate:g,initialValue:f,onChange:h=>{p(h)}}),fe.jsx(Sp,{}),fe.jsx("div",{children:e.map(h=>{const m=is(h,t);return fe.jsx(Kd,{label:!h.title&&h.isIndex?qS:h.title,initialValue:!(h.isHidden===!0||m),onChange:y=>{y?(o(h.id),m&&n(w=>[...w,h.id])):r(h.id)}},h.id)})})]}),isOpen:a,onClickOutside:l,onClick:()=>a?l():void 0,onEsc:l,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:()=>({...Da(s),paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",overflow:"hidden"})},Inner:{style:()=>({backgroundColor:s.colors.bgColor,color:s.colors.bodyText,fontSize:s.fontSizes.sm,fontWeight:s.fontWeights.normal,minWidth:s.sizes.minMenuWidth,maxWidth:`calc(${s.sizes.minMenuWidth} * 2)`,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"})}},children:fe.jsx("div",{children:i})})},JS=d.memo(QS),Yd=Cn("div",{target:"e1w7nams0"})(({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":{...Da(e),maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,"& .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 eM({top:e,left:t,content:n,clearTooltip:r}){const[o,i]=d.useState(!0),a=Qr(),{colors:l,fontSizes:s,radii:u,fontWeights:c}=a,f=d.useCallback(()=>{i(!1),r()},[r,i]);return fe.jsx(Ta,{content:fe.jsx(ug,{"data-testid":"stDataFrameTooltipContent",children:fe.jsx(cg,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Oa.top,accessibilityType:ef.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:f,onEsc:f,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:nf(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:o,children:fe.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const tM=d.memo(eM),nM=15e4,rM="0.5rem";function oM({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:o,fragmentId:i,customToolbarActions:a,widthConfig:l,heightConfig:s}){const{expanded:u,expand:c,collapse:f,width:g,height:p}=Au(mm),{isInHorizontalLayout:h,isInRoot:m}=Au(dg),y=d.useRef(null),w=d.useRef(null),v=d.useRef(null),x=tf(),{height:T,elementRef:I}=fg(),C=SS(),{getRowThemeOverride:A,onItemHovered:E}=AS(C),{enforceDownloadInNewTab:k=!1}=d.useContext(hg),[P,O]=d.useState(!0),[R,M]=d.useState(!1),[D,S]=d.useState(!1),[K,B]=d.useState(!1),[X,ie]=d.useState(),[te,q]=d.useState(!1),ge=d.useCallback(()=>q(Ce=>!Ce),[]),se=d.useCallback(()=>q(!1),[]),ce=d.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Se(e.editingMode)&&(e.editingMode=Xt.EditingMode.READ_ONLY);const{READ_ONLY:pe,DYNAMIC:ue,ADD_ONLY:V,DELETE_ONLY:L}=Xt.EditingMode,G=t.dimensions,oe=Math.max(0,G.numDataRows),re=oe===0&&!((e.editingMode===ue||e.editingMode===V)&&G.numDataColumns>0),Te=oe>nM,xe=!Te&&!re&&e.editingMode!==ue&&e.editingMode!==V,Je=!re&&(e.editingMode===ue||e.editingMode===V)&&!n,Re=!re&&(e.editingMode===ue||e.editingMode===L)&&!n,[Pt,bt]=d.useState(e.columnOrder);d.useEffect(()=>{bt(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:Ee,allColumns:ne,setColumnConfigMapping:me}=Yk(e,t,n,Pt,l),{editingState:we,numRows:ae,updateNumRows:ye,syncEditState:ze,createSyncSelectionState:Le,onFormCleared:nt,loadInitialSelectionState:Pe,getProgrammaticSelectionState:qe}=_S({element:e,widgetMgr:r,fragmentId:i,originalNumRows:oe,originalColumns:Ee}),{getCellContent:Ve}=PS(t,Ee,ae,we),{columns:ve,sortColumn:Ne,getOriginalIndex:Qe,getCellContent:ut}=oS(oe,Ee,Ve),Be=d.useRef(Qe);Be.current=Qe;const Mt=d.useMemo(()=>Le(ve,Qe),[Le,ve,Qe]),{debouncedCallback:Nt}=vh(Mt,Cp),{gridSelection:mt,isRowSelectionActivated:pt,isMultiRowSelectionActivated:Yt,isColumnSelectionActivated:Ht,isMultiColumnSelectionActivated:kn,isCellSelectionActivated:ht,isMultiCellSelectionActivated:ft,isRowSelected:Gt,isColumnSelected:wt,isCellSelected:nn,isRequiredRowSelectionActivated:Zt,clearSelection:be,processSelectionChange:tt}=LS(e,re,n,ve,Nt);d.useEffect(()=>{ht||be(!0,!0)},[u]);const Ft=d.useCallback(Ce=>{w.current?.updateCells(Ce)},[]);d.useEffect(()=>{const Ce=Pe({columns:ve,isRowSelectionActivated:pt,isRequiredRowSelectionActivated:Zt,isColumnSelectionActivated:Ht,isCellSelectionActivated:ht,isMultiCellSelectionActivated:ft});Ce&&tt(Ce,{shouldSync:!1})},[]);const Tn=d.useCallback(()=>{if(v.current===null)return;const{originalRowIndices:Ce,columns:Et,current:In}=v.current;v.current=null;const Fr=Be.current,En=[];for(const er of Ce)for(let An=0;An<oe;An++)if(Fr(An)===er){En.push(An);break}if(En.length>0){const er={columns:Et,rows:Xe.fromSingleSelection(En[0]),current:In};tt(er)}},[oe,tt]),{restart:qt}=di(Tn,0,{autoStart:!1});d.useEffect(()=>{if(!e.selectionState)return;const Ce=e.selectionState;e.selectionState=null;const Et=qe({selectionState:Ce,columns:ve,isRowSelectionActivated:pt,isColumnSelectionActivated:Ht,isCellSelectionActivated:ht,isMultiCellSelectionActivated:ft,getOriginalIndex:Qe});Et&&tt(Et,{shouldSync:!1})},[e.selectionState,ve,pt,Ht,ht,ft,qe,tt,Qe]);const{exportToCsv:rn}=DS(ut,ve,ae,k),{onCellEdited:On,onPaste:on,onRowAppended:Ut,onDelete:$e,validateCell:yt}=RS({columns:ve,allColumns:ne,canAddRows:Je,canDeleteRows:Re,editingState:we,getCellContent:ut,getOriginalIndex:Qe,refreshCells:Ft,updateNumRows:ye,syncEditState:ze,clearSelection:be}),Dn=d.useMemo(()=>re?[0]:Je?[ae]:[],[re,Je,ae]),{tooltip:xt,clearTooltip:at,onItemHovered:Sn}=VS(ve,ut,Dn),{drawCell:cr,customRenderers:Jn}=kS(ve,e.placeholder??void 0),{provideEditor:N}=aS(),_e=d.useCallback(Ce=>({...Ce,hasMenu:!re}),[re]),We=d.useMemo(()=>ve.map(Ce=>_e(ys(Ce))),[ve,_e]),{columns:It,onColumnResize:an}=Qk(We),cn=t.dimensions.numHeaderRows>1,{minHeight:Mn,maxHeight:fn,minWidth:Bt,maxWidth:Rn,rowHeight:hn,resizableSize:Lr,setResizableSize:no}=HS(e,C,ae,cn,g||0,p,u,l,s,T,m),Lo=d.useCallback(([Ce,Et])=>({...cy(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:C.glideTheme.textLight},span:[0,Math.max(ve.length-1,0)]}),[ve,C.glideTheme.textLight]),Ho=d.useCallback(()=>{nt(),be()},[nt,be]);pg({element:e,widgetMgr:r,onFormCleared:Ho});const{pinColumn:Pn,unpinColumn:jn,freezeColumns:ro}=Zk(ve,re,g||0,C.minColumnWidth,be,me),{changeColumnFormat:Fo}=Fk(me),{hideColumn:dr,showColumn:oo}=iS(be,me),{onColumnMoved:fr}=qk(ve,ro,Pn,jn,bt),Hr=d.useCallback(()=>{if(I.current&&w.current){const Ce=I.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Ce&&(S(Ce.height>I.current.clientHeight),B(Ce.width>I.current.clientWidth))}},[w,I]),{clear:wr,restart:yr}=di(Hr,0,{autoStart:!1}),pn=d.useRef(null),{restart:sn}=di(()=>{Se(pn.current)||(w.current?.remeasureColumns(Xe.fromSingleSelection(pn.current)),pn.current=null)},100,{autoStart:!1});d.useEffect(()=>{const Ce=requestAnimationFrame(()=>{yr()});return()=>{cancelAnimationFrame(Ce),wr()}},[wr,It,ae,I,Lr,yr]);const $n=!!(h||l?.useContent&&!m);return fe.jsxs(Yd,{className:"stDataFrame","data-testid":"stDataFrame",ref:I,isInHorizontalLayout:h,minHeight:Mn,disableResize:$n,onPointerDown:Ce=>{if(I.current){const Et=I.current.getBoundingClientRect(),In=(x||Math.round(tn(rM)))+1;K&&Et.height-In<Ce.clientY-Et.top&&Ce.stopPropagation(),D&&Et.width-In<Ce.clientX-Et.left&&Ce.stopPropagation()}},onBlur:Ce=>{!P&&!ce&&!Ce.currentTarget.contains(Ce.relatedTarget)&&!ht&&be(!0,!0)},children:[fe.jsxs(gg,{isFullScreen:u,disableFullscreenMode:o,locked:Gt&&!pt||nn||ce&&P||te,onExpand:c,onCollapse:f,target:Yd,children:[a?.map(Ce=>Ce),(pt&&Gt&&!Zt||Ht&&wt||ht&&nn)&&fe.jsx(yo,{label:"Clear selection",icon:zm,onClick:()=>{be(),at()}}),Re&&Gt&&fe.jsx(yo,{label:"Delete row(s)",icon:Um,onClick:()=>{$e&&($e(mt),at())}}),Je&&!Gt&&fe.jsx(yo,{label:"Add row",icon:pf,onClick:()=>{Ut&&(O(!0),Ut(),at(),w.current?.scrollTo(0,ae,"vertical"))}}),!re&&ne.length>0&&fe.jsx(JS,{columns:ne,columnOrder:Pt,setColumnOrder:bt,hideColumn:dr,showColumn:oo,isOpen:te,onClose:se,children:fe.jsx(yo,{label:"Show/hide columns",icon:mf,onClick:ge})}),!Te&&!re&&fe.jsx(yo,{label:"Download as CSV",icon:Xm,onClick:rn}),!re&&fe.jsx(yo,{label:"Search",icon:gf,onClick:()=>{R?M(!1):(O(!0),M(!0)),at()}})]}),fe.jsx(mg,{"data-testid":"stDataFrameResizable",ref:y,defaultSize:Lr,style:{border:`${C.tableBorderWidth}px solid ${C.glideTheme.borderColor}`,borderRadius:`${C.tableBorderRadius}`},minHeight:Mn,maxHeight:fn,minWidth:Bt,maxWidth:$n?void 0:Rn,size:Lr,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!$n,bottomLeft:!1,topLeft:!1},grid:[1,hn],snapGap:hn/3,onResizeStop:(Ce,Et,In,Fr)=>{if(y.current){const En=2*C.tableBorderWidth;no({width:y.current.size.width,height:fn-y.current.size.height===En?y.current.size.height+En:y.current.size.height})}},children:fe.jsx(oy,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:w,columns:It,rows:re?1:ae,minColumnWidth:C.minColumnWidth,maxColumnWidth:C.maxColumnWidth,maxColumnAutoWidth:C.maxColumnAutoWidth,rowHeight:hn,headerHeight:C.defaultHeaderHeight,getCellContent:re?Lo:ut,onColumnResize:ce?void 0:an,resizeIndicator:"header",freezeColumns:ro,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:ce?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Ht?void 0:fr,onItemHovered:Ce=>{E?.(Ce),Sn?.(Ce)},keybindings:{downFill:!0,...ht||Te?{selectAll:!1}:{}},onKeyDown:Ce=>{(Ce.ctrlKey||Ce.metaKey)&&Ce.key==="f"&&(M(Et=>!Et),Ce.stopPropagation(),Ce.preventDefault())},showSearch:R,searchResults:R?void 0:[],onSearchClose:()=>{M(!1),at()},onHeaderClicked:(Ce,Et)=>{if(!(!xe||Ht)){if(R&&M(!1),Zt&&Gt){const In=mt.rows.toArray().map(Qe);v.current={originalRowIndices:In,columns:mt.columns,current:void 0},be(!0,!0)}else pt&&Gt?be():be(!0,!0);Ne(Ce,"auto"),Zt&&Gt&&qt()}},gridSelection:mt,onGridSelectionChange:Ce=>{const Et=Ce.rows.length>0||Ce.columns.length>0;(P||ce||Et)&&(tt(Ce),xt!==void 0&&at(),ie(void 0),q(!1))},theme:C.glideTheme,getRowThemeOverride:A,onMouseMove:Ce=>{Ce.kind==="out-of-bounds"&&P?O(!1):Ce.kind!=="out-of-bounds"&&!P&&O(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:K?-x:void 0,paddingRight:D?-x:void 0},provideEditor:N,drawCell:cr,customRenderers:Jn,imageEditorOverride:Lk,headerIcons:C.headerIcons,validateCell:yt,onHeaderMenuClick:(Ce,Et)=>{te||ie({columnIdx:Ce,headerBounds:Et})},onPaste:!1,...pt&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:Zt?"circle":"square",theme:{bgCell:C.glideTheme.bgHeader,bgCellMedium:C.glideTheme.bgHeader,textMedium:C.glideTheme.textLight}},rowSelectionMode:Yt?"multi":"auto",rowSelect:n?"none":Yt?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...Ht&&{columnSelect:n?"none":kn?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:kn?"multi":"auto",rangeSelectionBlending:"additive"},...ht&&{rangeSelect:ft?"rect":"cell",rangeSelectionBlending:"additive"},...!re&&e.editingMode!==pe&&!n&&{fillHandle:!ce,onCellEdited:On,onPaste:on,onDelete:$e},...Je&&{trailingRowOptions:{sticky:!1,tint:!0},onRowAppended:Ut,onHeaderClicked:void 0},...Re&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:C.glideTheme.bgHeader,bgCellMedium:C.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi"}})}),xt?.content&&fe.jsx(tM,{top:xt.top,left:xt.left,content:xt.content,clearTooltip:at}),X&&rf.createPortal(fe.jsx(ZS,{top:X.headerBounds.y+X.headerBounds.height,left:X.headerBounds.x+X.headerBounds.width,column:Ee[X.columnIdx],onCloseMenu:()=>ie(void 0),onSortColumn:xe?Ce=>{if(R&&M(!1),Zt&&Gt){const Et=mt.rows.toArray().map(Qe);v.current={originalRowIndices:Et,columns:mt.columns,current:void 0},be(!0,!0)}else be(!(pt&&Gt),!0);Ne(X.columnIdx,Ce,!0),Zt&&Gt&&qt()}:void 0,isColumnPinned:Ee[X.columnIdx].isPinned,onUnpinColumn:()=>{jn(Ee[X.columnIdx].id)},onPinColumn:()=>{Pn(Ee[X.columnIdx].id)},onHideColumn:()=>{dr(Ee[X.columnIdx].id)},onChangeFormat:Ce=>{Fo(Ee[X.columnIdx].id,Ce),pn.current=X.columnIdx,sn()},onAutosize:()=>{w.current?.remeasureColumns(Xe.fromSingleSelection(X.columnIdx))}}),document.querySelector("#portal"))]})}const iM=gm(oM),aM=d.memo(iM),IM=Object.freeze(Object.defineProperty({__proto__:null,default:aM},Symbol.toStringTag,{value:"Module"}));export{V1 as C,aM as D,qf as T,Ro as a,o0 as b,IM as c,ko as i,$v as m,dn as s};