@stlite/desktop 0.95.0 → 0.96.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 (141) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/bin/dump_artifacts.js +1 -1
  3. package/build/assets/{ErrorOutline.esm-C-dv9Xq1-skkXNqDc.js → ErrorOutline.esm-_LuTQzkr-BFWi9Uuj.js} +1 -1
  4. package/build/assets/{FileDownload.esm-ORp-UC-S-BrsUfuH5.js → FileDownload.esm-CUqXYNk4-DieQ2Qle.js} +1 -1
  5. package/build/assets/FileHelper-DbeeBEs5-Co0d-OBP.js +5 -0
  6. package/build/assets/{FormClearHelper-DtwjWakY-CxfcniD6.js → FormClearHelper-C58X4iX0-CI3cpm91.js} +1 -1
  7. package/build/assets/IFrameUtil-8kJzIdKx-BKMrKnrz.js +1 -0
  8. package/build/assets/{InputInstructions-CshBE9XZ-BbegIdTI.js → InputInstructions-BSpH125g-CSupbuK3.js} +1 -1
  9. package/build/assets/Particles-6ak5Hlgw-4VTgCETZ.js +1 -0
  10. package/build/assets/ProgressBar-CQHaVJeY-Bo6RDYz5.js +2 -0
  11. package/build/assets/StreamlitSyntaxHighlighter-DSYWFRjz-B77VB7yz.js +8 -0
  12. package/build/assets/Toolbar-Cr9ArNQU-D5-awBnv.js +1 -0
  13. package/build/assets/_baseAssignValue-3fAevQ7t-BOcc6F75.js +1 -0
  14. package/build/assets/_baseIndexOf-OsCSwRmV--aVpkM1d.js +1 -0
  15. package/build/assets/{base-input-DbV2D5sF-DJkpBRM1.js → base-input-CAXjxi6E-LJzeEbPm.js} +4 -4
  16. package/build/assets/{checkbox-CG80fxUD-CavQvTtP.js → checkbox-OEhCo8NJ-C1rXZb97.js} +2 -2
  17. package/build/assets/{createSuper-BlgWzn8_-h1vcwEzv.js → createSuper-bIcQlS98-B8MWK81T.js} +1 -1
  18. package/build/assets/data-grid-overlay-editor-DbHL3o_S-CiO7EIHu.js +1 -0
  19. package/build/assets/{downloader-DcCTL3Wz-CqotLrf1.js → downloader-DcCTL3Wz-Dj-02g6N.js} +1 -1
  20. package/build/assets/embed-DJe7ZhON-C4OnDOK-.js +195 -0
  21. package/build/assets/{es6--XPcqeHG-DdkxL8eW.js → es6--XPcqeHG-2BbC2xK9.js} +2 -2
  22. package/build/assets/{iframeResizer.contentWindow-DEXh82Lp-CG3rnwWO.js → iframeResizer.contentWindow-9ByjY9IM-BBpPzlnE.js} +1 -1
  23. package/build/assets/{index-vRM8HrbM-CZbE9IiJ.js → index-10RiWKwV-Cn-PcXb4.js} +3 -3
  24. package/build/assets/index-47jAZmzN-8ZV_muwb.js +1 -0
  25. package/build/assets/index-99W3Zegr-DhiLonYo.js +1 -0
  26. package/build/assets/index-BGCCnxH2-jQwb1QhH.js +1 -0
  27. package/build/assets/{index-CNKtyIol-BPke8suV.js → index-BHN72E4J-BztQAHMJ.js} +1 -1
  28. package/build/assets/index-BSOGSXpv-Bd9gyoUy.js +27 -0
  29. package/build/assets/index-BVhYQGzc-Do7aV0dQ.js +1 -0
  30. package/build/assets/index-BVuioNdm-CVDd_GaD.js +1 -0
  31. package/build/assets/index-BYGDMULw-4dwQq_lE.js +1 -0
  32. package/build/assets/index-B_94eI3S-ADuW4ppz.js +6 -0
  33. package/build/assets/index-Bck9VlwE-zB2PlFuX.js +3 -0
  34. package/build/assets/index-Bdi0ug4X.js +181 -0
  35. package/build/assets/{index-y3ITDERN-Ccy-wRE2.js → index-BrYfiXJ9-D7No2wma.js} +1 -1
  36. package/build/assets/index-BwqdV017-BaIzlXlX.js +2 -0
  37. package/build/assets/index-C6MBr137-B6bz_i6a.js +1 -0
  38. package/build/assets/index-CAtZcI5--D0BcKLsl.js +2 -0
  39. package/build/assets/index-CF9SDiIL-0Yw8O39Y.js +1 -0
  40. package/build/assets/index-CFA5JkEa-DUK-7VD7.js +1 -0
  41. package/build/assets/index-CJA4Tdig-Rs7zFCTh.js +1 -0
  42. package/build/assets/index-CVld_lKx-CBWAU0gM.js +14 -0
  43. package/build/assets/{index-BqCY3Zlk-mm_Bt8ZF.js → index-CY18be0x-Bq4JW-41.js} +1 -1
  44. package/build/assets/index-CaWaI2PT-DvorZu2G.js +2 -0
  45. package/build/assets/{index-CiBn_-AR-CMINgD7R.js → index-Cbq5ClnA-Ct1ftt5G.js} +1 -1
  46. package/build/assets/index-CceTm1nk-D-m7sDsR.js +1 -0
  47. package/build/assets/{index-SbKh1OIB-BjfuWdcF.js → index-Cp-N8m1m-CSwdpflI.js} +4 -4
  48. package/build/assets/index-CucLKMvI-CdFsTlcF.js +1 -0
  49. package/build/assets/index-CxZCITs0-CLi85oo1.js +1 -0
  50. package/build/assets/{index-C7cG_aL6-BWm5S1-m.js → index-D3vT_IC--BZlisRXs.js} +64 -64
  51. package/build/assets/index-D5L-gN8f-Bny7-WhK.js +11 -0
  52. package/build/assets/index-D7zRUNKG-2cwkh8qP.js +1 -0
  53. package/build/assets/index-D8RPh1xj-BLIXkU4c.js +1 -0
  54. package/build/assets/index-DNE2UpRK-CMtd92Tg.js +1 -0
  55. package/build/assets/index-D_5mY4iN-C3O2lE89.js +1 -0
  56. package/build/assets/index-DfPnrVLL-B6NKOBTt.js +1 -0
  57. package/build/assets/index-Do4wh7Iw-cPdQGRDQ.js +1 -0
  58. package/build/assets/{index-D2j0kQLw-67iH-2yA.js → index-DttfDE80-GomZzukD.js} +1 -1
  59. package/build/assets/index-DwedDN1c-C-Y3cCQP.js +1 -0
  60. package/build/assets/index-Fvxtopfe-CxLnCat0.js +1 -0
  61. package/build/assets/index-G4vqu33f-DO7BfNY6.js +1 -0
  62. package/build/assets/index-KWOwopwF-CN_5PcLU.js +2 -0
  63. package/build/assets/index-NPM6VaN3-C-0cbqN2.js +3 -0
  64. package/build/assets/index-Q4xI4OhR-D81jje-l.js +1 -0
  65. package/build/assets/index-R0bDPfYF-CRQIdCoC.js +263 -0
  66. package/build/assets/index-R1QyBsfg-tcyjJ4fb.js +1 -0
  67. package/build/assets/index-YOustUZZ-CX09XTf8.js +2 -0
  68. package/build/assets/index-b6W2ubHd-BapgUWLx.js +1 -0
  69. package/build/assets/index-h-ZgFEXT-DdL6EMUv.js +2 -0
  70. package/build/assets/index-lGTf3abu-B6CGTEed.js +1 -0
  71. package/build/assets/index-nXfHwIms-cOwCevci.js +198 -0
  72. package/build/assets/index-tU7dWFCN-DURbp79P.js +1 -0
  73. package/build/assets/inherits-Byw8NQvD-DdaLbWVP.js +1 -0
  74. package/build/assets/{input-DNUwcYWK-C9eVW6-S.js → input-5gXdrXd2-J6HaBKjM.js} +2 -2
  75. package/build/assets/main-DvFfgny--BkQIK2a9.js +13 -0
  76. package/build/assets/{memory-B3L1Fctl-CQ-Y_gc6.js → memory-B3L1Fctl-mli5o0A1.js} +1 -1
  77. package/build/assets/moment-CU6QKNej-DcQX_LE0.js +4 -0
  78. package/build/assets/number-overlay-editor-BQ0qCmxT-5g_cUv4i.js +9 -0
  79. package/build/assets/pandasStylerUtils-BvB3vP-L-D9viw-G9.js +1 -0
  80. package/build/assets/{sandbox-ChAzL-i--DqMwo4R7.js → sandbox-ChAzL-i--CSnZJIg8.js} +1 -1
  81. package/build/assets/slicedToArray-CrkrjOeW-7_omneg6.js +2 -0
  82. package/build/assets/styled-components-DkuYntx5-DrGZZlKf.js +1 -0
  83. package/build/assets/threshold-eWsxmMyL-jpRnj60B.js +1 -0
  84. package/build/assets/{timepicker-CkLW19xP-CTuglWU6.js → timepicker-BMxsIjZb-Uq5-wJ6H.js} +1 -1
  85. package/build/assets/timer-DAAwtI0i-CB52lra-.js +1 -0
  86. package/build/assets/toConsumableArray-BpgQ3N5A-AHKfFeLf.js +2 -0
  87. package/build/assets/uniqueId-BrCTHDA7-CGglDaT_.js +1 -0
  88. package/build/assets/unsupportedIterableToArray-CFN3yOc2-C4SckrTc.js +1 -0
  89. package/build/assets/urls-CuMqgoDl-BWqF1s4U.js +1 -0
  90. package/build/assets/{useBasicWidgetState-BTyLgyXa-DI96f9E0.js → useBasicWidgetState-CzHHKP20-CGMCneWD.js} +1 -1
  91. package/build/assets/useIntlLocale-5C0LAQxq-ow_F-T5t.js +12 -0
  92. package/build/assets/{useTextInputAutoExpand-YLx_K1sh-DhWKaGOV.js → useTextInputAutoExpand-BMCOrWKx-DmoV3o2_.js} +2 -2
  93. package/build/assets/{useUpdateUiValue-B9j1K8e5-CIeTAxHC.js → useUpdateUiValue-BtVkPggP-4VTS40xs.js} +1 -1
  94. package/build/assets/useWaveformController-DuJh2iwj-BQGl9KsR.js +1 -0
  95. package/build/assets/value-DwxUZIyI-CNuykc50.js +1 -0
  96. package/build/assets/withCalculatedWidth-C0lBnc3E-BAFtxM9t.js +1 -0
  97. package/build/assets/withFullScreenWrapper-wajYPLRg-e8FnO2xN.js +1 -0
  98. package/build/index.html +1 -1
  99. package/package.json +3 -3
  100. package/wheels/streamlit-1.52.2-cp313-none-any.whl +0 -0
  101. package/build/assets/FileHelper-DQKV3o5U-qFf0CL_R.js +0 -5
  102. package/build/assets/Particles-DbEEaBdi-Cslh0fnd.js +0 -1
  103. package/build/assets/ProgressBar-ohpf-YR2-PWD0xacp.js +0 -2
  104. package/build/assets/Toolbar-Cc8tCeKL-JHIp2NvW.js +0 -1
  105. package/build/assets/data-grid-overlay-editor-DsmOmCoE-DU0EvyVM.js +0 -1
  106. package/build/assets/index-3Q8l-56I-Bp9UZWPZ.js +0 -27
  107. package/build/assets/index-8FM--PX3-C2rsm2es.js +0 -1
  108. package/build/assets/index-B1y_Hrx0-DDwLQ3XW.js +0 -1
  109. package/build/assets/index-BECG__WC-DerPiN--.js +0 -1
  110. package/build/assets/index-BQn4Faen-CVQ5ESXY.js +0 -3
  111. package/build/assets/index-BReUOw2L-emeACiGh.js +0 -1371
  112. package/build/assets/index-BiS_E3zu-CwIGZcqG.js +0 -1
  113. package/build/assets/index-BmlZuG1z-BtaDcb9o.js +0 -1
  114. package/build/assets/index-BvblFOYP.js +0 -691
  115. package/build/assets/index-Bzy7yu67-C3L4ShMk.js +0 -2
  116. package/build/assets/index-CO05R5cS-DHfFy15g.js +0 -1
  117. package/build/assets/index-CQfw52g6-BJ-a84bb.js +0 -1
  118. package/build/assets/index-CTvmRzFN-By1zFrdQ.js +0 -2
  119. package/build/assets/index-Cb_C2vCk-DrzTyNQF.js +0 -198
  120. package/build/assets/index-CnMc0ayy-CKIU12h5.js +0 -1
  121. package/build/assets/index-D0Ry9mHz-DBJluHQV.js +0 -3
  122. package/build/assets/index-D42P77wj-jZCT0fQL.js +0 -1
  123. package/build/assets/index-D7LfqMh3-DvKIa3UK.js +0 -1
  124. package/build/assets/index-DD64_I3e-Cxdt0Oji.js +0 -1
  125. package/build/assets/index-DEYeMrzr-DP5rSRot.js +0 -1
  126. package/build/assets/index-DTog-cZN-vTBq72Ci.js +0 -1
  127. package/build/assets/index-DU0kTHM_-CInhbPr8.js +0 -12
  128. package/build/assets/index-DeKEPgyN-DF3OyxuW.js +0 -1
  129. package/build/assets/index-DrS8S2M--C4mGh6T8.js +0 -1
  130. package/build/assets/index-DxTzjSNF-B-v_CQEN.js +0 -2
  131. package/build/assets/index-IXLMpVV4-D8dPiMEz.js +0 -2
  132. package/build/assets/index-Ray843Xd-CpBr9wfH.js +0 -1
  133. package/build/assets/index-S-A7KecP-DJ0BKtLt.js +0 -1
  134. package/build/assets/index-Uvv6so0Q-Lbl8GAad.js +0 -1
  135. package/build/assets/index-YbT2v6Cb-CoC81Jcm.js +0 -1
  136. package/build/assets/inherits-CYghrBFU-Cf4k8aUQ.js +0 -1
  137. package/build/assets/number-overlay-editor-C2e7pY6x-BnC-vP7l.js +0 -9
  138. package/build/assets/slicedToArray-D4uL3Bzl-95JmZlNK.js +0 -2
  139. package/build/assets/uniqueId-C6wp_e1D-D_RnWRJW.js +0 -1
  140. package/build/assets/withFullScreenWrapper-DqrJMIkm-BwrYir6f.js +0 -1
  141. package/wheels/streamlit-1.51.0-cp313-none-any.whl +0 -0
@@ -1,198 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-DsmOmCoE-DU0EvyVM.js","assets/index-BvblFOYP.js","assets/index-DnTjZ9IR.css","assets/withFullScreenWrapper-DqrJMIkm-BwrYir6f.js","assets/Toolbar-Cc8tCeKL-JHIp2NvW.js","assets/FormClearHelper-DtwjWakY-CxfcniD6.js","assets/sprintf-D5E86llw-6tzWM3a-.js","assets/checkbox-CG80fxUD-CavQvTtP.js","assets/createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js","assets/slicedToArray-D4uL3Bzl-95JmZlNK.js","assets/inherits-CYghrBFU-Cf4k8aUQ.js","assets/createSuper-BlgWzn8_-h1vcwEzv.js","assets/FileDownload.esm-ORp-UC-S-BrsUfuH5.js","assets/number-overlay-editor-C2e7pY6x-BnC-vP7l.js","assets/es6--XPcqeHG-DdkxL8eW.js"])))=>i.map(i=>d[i]);
2
- import{j as ve,r as d,cm as cc,cn as nn,aC as kt,co as cp,aK as ns,c6 as up,bi as cd,l as rs,E as os,_ as Ve,cp as dp,cq as ud,cr as dd,X as vr,d as Tr,cs as hp,Q as nl,v as De,c as Qn,ct as fp,cu as pp,x as rt,cv as hd,C as gp,cw as mp,cx as vp,cy as bp,cz as wp,cA as yp,cB as xp,cC as zl,cD as fd,aB as tn,cE as Cp,cF as kp,cG as Sp,cH as Mp,cI as Ip,cJ as Rp,cK as Ep,U as si,m as Qr,bs as Da,br as Pa,cL as pd,M as Mi,F as qn,cM as Tp,bG as gd,cN as Op,H as Dp,e as uc,cO as Pp,cP as Hp,f as Lp,L as Ap,b as md,cQ as Fp,cR as zp,cS as _p,cT as $p,cU as Vp,at as vd,cV as ci,cW as dc,ao as Xr,aL as Bp,cX as Np,cY as Wp,cZ as bd,c_ as jp,c$ as Gp,d0 as Up,y as rl,d1 as Xp,c8 as ol,d2 as qp,d3 as wd,d4 as Kp,bq as Ur,d5 as Zp,d6 as Yp,d7 as Qp,d8 as Jp,D as eg,d9 as yd,da as tg,db as ng,aD as rg,dc as og,dd as ig,de as ag,A as lg,B as sg,df as cg,dg as ug,z as dg,dh as hg,di as fg,dj as pg,dk as ur,$ as To,bT as gg,dl as mg,dm as vg,dn as bg,dp as wg,dq as yg,dr as xg,ds as Cg,dt as la,du as Xo,dv as Lt,dw as Ct,dx as fa,dy as yn,dz as kg,dA as Sg,dB as Mg,dC as Ig,dD as Rg,dE as Eg,dF as Tg,dG as Wr,dH as hc,dI as fc,dJ as xd,dK as Cd,dL as Og,dM as _l,dN as Dg,dO as Pg,dP as kd,dQ as Hg}from"./index-BvblFOYP.js";import{v as Lg,d as Ag}from"./withFullScreenWrapper-DqrJMIkm-BwrYir6f.js";import{y as Fg,X as xo}from"./Toolbar-Cc8tCeKL-JHIp2NvW.js";import{m as zg}from"./FormClearHelper-DtwjWakY-CxfcniD6.js";import{_ as _g}from"./sprintf-D5E86llw-6tzWM3a-.js";import{v as $g,y as Vg,T as Bg}from"./checkbox-CG80fxUD-CavQvTtP.js";import{a as Ng}from"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import{p as Wg,_ as gr}from"./slicedToArray-D4uL3Bzl-95JmZlNK.js";import{b as jg,p as Gg,l as Ug}from"./inherits-CYghrBFU-Cf4k8aUQ.js";import{i as Xg}from"./createSuper-BlgWzn8_-h1vcwEzv.js";import{o as qg,i as Kg}from"./FileDownload.esm-ORp-UC-S-BrsUfuH5.js";var Sd=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ve({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"}))});Sd.displayName="Add";var Md=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ve({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"}))});Md.displayName="Search";var Id=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(os,Ve({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"}))});Id.displayName="Visibility";var il,pc;function Zg(){if(pc)return il;pc=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,o){return r!=null&&t.call(r,o)}return il=n,il}var al,gc;function Yg(){if(gc)return al;gc=1;var e=Zg(),t=dp();function n(r,o){return r!=null&&t(r,o,e)}return al=n,al}var Qg=Yg();const Jg=vr(Qg);function Rd(e="This should not happen"){throw new Error(e)}function Fn(e,t="Assertion failed"){if(!e)return Rd(t)}function vi(e,t){return Rd(t??"Hell froze over")}function em(e,t){try{return e()}catch{return t}}const mc=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(mc.call(e,n)&&++r&&!mc.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 pa=null,is=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var vc;(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"})(vc||(vc={}));var ga;(function(e){e.Triangle="triangle",e.Dots="dots"})(ga||(ga={}));function qi(e){return"width"in e&&typeof e.width=="number"}async function bc(e){return typeof e=="object"?e:await e()}function ko(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Io(e){return e.kind===Wn.Marker||e.kind===Wn.NewRow}function So(e){if(!ko(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:vi(e,"A cell was passed with an invalid kind")}}function tm(e){return Jg(e,"editor")}function as(e){return!(e.readonly??!1)}var Wn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Wn||(Wn={}));const ma={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function ll(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 wc;class Ye{items;constructor(t){this.items=t}static create=t=>new Ye(ll(t));static empty=()=>wc??(wc=new Ye([]));static fromSingleSelection=t=>Ye.empty().add(t);static fromArray=t=>{if(t.length===0)return Ye.empty();const n=t.map(o=>[o,o+1]),r=ll(n);return new Ye(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Ye(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=ll([...this.items,n]);return new Ye(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 c=[];l<r&&c.push([l,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new Ye(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 nm=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(" ")},yc=nm,rm=e=>e.toUpperCase()===e,om=e=>t=>e.indexOf(t)===-1,Ed=(e,t)=>{const n={};return Object.keys(e).filter(om(t)).forEach(r=>{n[r]=e[r]}),n};function im(e,t,n){const r=Ed(t,n);if(!e){const o=typeof ol=="function"?{default:ol}:ol;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var am=(e,t)=>{};function lm(e){let t="";return n=>{const r=(i,a)=>{const{as:l=e,class:s=t}=i,c=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!rm(l[0])):n.propsAsIs,u=im(c,i,["as","class"]);u.ref=a,u.className=n.atomic?yc(n.class,u.className||s):yc(u.className||s,n.class);const{vars:h}=n;if(h){const g={};for(const m in h){const w=h[m],y=w[0],v=w[1]||"",C=typeof y=="function"?y(i):y;am(C,n.name),g[`--${m}`]=`${C}${v}`}const f=u.style||{},p=Object.keys(f);p.length>0&&p.forEach(m=>{g[m]=f[m]}),u.style=g}return e.__wyw_meta&&e!==l?(u.as=l,d.createElement(e,u)):d.createElement(l,u)},o=d.forwardRef?d.forwardRef(r):(i=>{const a=Ed(i,["innerRef"]);return r(a,i.innerRef)});return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}}var sn=lm;const sm=sn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var xc={},qo={},sl={},cl={},Cc;function cm(){return Cc||(Cc=1,(function(e){(function(t,n){n(e,kt,rg())})(cl,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;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 C=1;C<arguments.length;C++){var R=arguments[C];for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(v[E]=R[E])}return v};function s(v,C){var R={};for(var E in v)C.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(v,E)&&(R[E]=v[E]);return R}function c(v,C){if(!(v instanceof C))throw new TypeError("Cannot call a class as a function")}var u=(function(){function v(C,R){for(var E=0;E<R.length;E++){var M=R[E];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(C,M.key,M)}}return function(C,R,E){return R&&v(C.prototype,R),E&&v(C,E),C}})();function h(v,C){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:v}function g(v,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);v.prototype=Object.create(C&&C.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(v,C):v.__proto__=C)}var f=!1;function p(v){f=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function m(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return f?v:v.capture}function w(v){if("touches"in v){var C=v.touches[0],R=C.pageX,E=C.pageY;return{x:R,y:E}}var M=v.screenX,H=v.screenY;return{x:M,y:H}}var y=(function(v){g(C,v);function C(){var R;c(this,C);for(var E=arguments.length,M=Array(E),H=0;H<E;H++)M[H]=arguments[H];var S=h(this,(R=C.__proto__||Object.getPrototypeOf(C)).call.apply(R,[this].concat(M)));return S._handleSwipeStart=S._handleSwipeStart.bind(S),S._handleSwipeMove=S._handleSwipeMove.bind(S),S._handleSwipeEnd=S._handleSwipeEnd.bind(S),S._onMouseDown=S._onMouseDown.bind(S),S._onMouseMove=S._onMouseMove.bind(S),S._onMouseUp=S._onMouseUp.bind(S),S._setSwiperRef=S._setSwiperRef.bind(S),S}return u(C,[{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(R){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(R))}},{key:"_onMouseMove",value:function(R){this.mouseDown&&this._handleSwipeMove(R)}},{key:"_onMouseUp",value:function(R){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(R)}},{key:"_handleSwipeStart",value:function(R){var E=w(R),M=E.x,H=E.y;this.moveStart={x:M,y:H},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var E=w(R),M=E.x,H=E.y,S=M-this.moveStart.x,x=H-this.moveStart.y;this.moving=!0;var L=this.props.onSwipeMove({x:S,y:x},R);L&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:S,deltaY:x}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var E=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-E?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>E&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-E?this.props.onSwipeUp(1,R):this.movePosition.deltaY>E&&this.props.onSwipeDown(1,R)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(R){this.swiper=R,this.props.innerRef(R)}},{key:"render",value:function(){var R=this.props;R.tagName;var E=R.className,M=R.style,H=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var S=s(R,["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:E,style:M},S),H)}}]),C})(n.Component);y.displayName="ReactSwipe",y.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},y.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=y})})(cl)),cl}var kc;function Td(){return kc||(kc=1,(function(e){(function(t,n){n(e,cm())})(sl,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})})(sl)),sl}var Ko={},Sc;function Od(){if(Sc)return Ko;Sc=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.default=void 0;var e=t(Xp());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 Ko.default=r,Ko}var Zo={},Yo={},Mc;function um(){if(Mc)return Yo;Mc=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.outerWidth=void 0;var e=function(t){var n=t.offsetWidth,r=getComputedStyle(t);return n+=parseInt(r.marginLeft)+parseInt(r.marginRight),n};return Yo.outerWidth=e,Yo}var Qo={},Ic;function ls(){if(Ic)return Qo;Ic=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={},Rc;function Dd(){if(Rc)return Jo;Rc=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var e=function(){return window};return Jo.default=e,Jo}var Ec;function Pd(){if(Ec)return Zo;Ec=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.default=void 0;var e=s(kt),t=a(Od()),n=um(),r=a(ls()),o=a(Td()),i=a(Dd());function a(S){return S&&S.__esModule?S:{default:S}}function l(){if(typeof WeakMap!="function")return null;var S=new WeakMap;return l=function(){return S},S}function s(S){if(S&&S.__esModule)return S;if(S===null||c(S)!=="object"&&typeof S!="function")return{default:S};var x=l();if(x&&x.has(S))return x.get(S);var L={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in S)if(Object.prototype.hasOwnProperty.call(S,I)){var O=T?Object.getOwnPropertyDescriptor(S,I):null;O&&(O.get||O.set)?Object.defineProperty(L,I,O):L[I]=S[I]}return L.default=S,x&&x.set(S,L),L}function c(S){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(x){return typeof x}:c=function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},c(S)}function u(){return u=Object.assign||function(S){for(var x=1;x<arguments.length;x++){var L=arguments[x];for(var T in L)Object.prototype.hasOwnProperty.call(L,T)&&(S[T]=L[T])}return S},u.apply(this,arguments)}function h(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function g(S,x){for(var L=0;L<x.length;L++){var T=x[L];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}function f(S,x,L){return x&&g(S.prototype,x),S}function p(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),x&&m(S,x)}function m(S,x){return m=Object.setPrototypeOf||function(L,T){return L.__proto__=T,L},m(S,x)}function w(S){var x=C();return function(){var L=R(S),T;if(x){var I=R(this).constructor;T=Reflect.construct(L,arguments,I)}else T=L.apply(this,arguments);return y(this,T)}}function y(S,x){return x&&(c(x)==="object"||typeof x=="function")?x:v(S)}function v(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function C(){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 R(S){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},R(S)}function E(S,x,L){return x in S?Object.defineProperty(S,x,{value:L,enumerable:!0,configurable:!0,writable:!0}):S[x]=L,S}var M=function(S){return S.hasOwnProperty("key")},H=(function(S){p(L,S);var x=w(L);function L(T){var I;return h(this,L),I=x.call(this,T),E(v(I),"itemsWrapperRef",void 0),E(v(I),"itemsListRef",void 0),E(v(I),"thumbsRef",void 0),E(v(I),"setItemsWrapperRef",function(O){I.itemsWrapperRef=O}),E(v(I),"setItemsListRef",function(O){I.itemsListRef=O}),E(v(I),"setThumbsRef",function(O,D){I.thumbsRef||(I.thumbsRef=[]),I.thumbsRef[D]=O}),E(v(I),"updateSizes",function(){if(!(!I.props.children||!I.itemsWrapperRef||!I.thumbsRef)){var O=e.Children.count(I.props.children),D=I.itemsWrapperRef.clientWidth,k=I.props.thumbWidth?I.props.thumbWidth:(0,n.outerWidth)(I.thumbsRef[0]),Q=Math.floor(D/k),N=Q<O,Y=N?O-Q:0;I.setState(function(ae,ee){return{itemSize:k,visibleItems:Q,firstItem:N?I.getFirstItem(ee.selectedItem):0,lastPosition:Y,showArrows:N}})}}),E(v(I),"handleClickItem",function(O,D,k){if(!M(k)||k.key==="Enter"){var Q=I.props.onSelectItem;typeof Q=="function"&&Q(O,D)}}),E(v(I),"onSwipeStart",function(){I.setState({swiping:!0})}),E(v(I),"onSwipeEnd",function(){I.setState({swiping:!1})}),E(v(I),"onSwipeMove",function(O){var D=O.x;if(!I.state.itemSize||!I.itemsWrapperRef||!I.state.visibleItems)return!1;var k=0,Q=e.Children.count(I.props.children),N=-(I.state.firstItem*100)/I.state.visibleItems,Y=Math.max(Q-I.state.visibleItems,0),ae=-Y*100/I.state.visibleItems;N===k&&D>0&&(D=0),N===ae&&D<0&&(D=0);var ee=I.itemsWrapperRef.clientWidth,K=N+100/(ee/D);return I.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(pe){I.itemsListRef.style[pe]=(0,r.default)(K,"%",I.props.axis)}),!0}),E(v(I),"slideRight",function(O){I.moveTo(I.state.firstItem-(typeof O=="number"?O:1))}),E(v(I),"slideLeft",function(O){I.moveTo(I.state.firstItem+(typeof O=="number"?O:1))}),E(v(I),"moveTo",function(O){O=O<0?0:O,O=O>=I.state.lastPosition?I.state.lastPosition:O,I.setState({firstItem:O})}),I.state={selectedItem:T.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},I}return f(L,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(T){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==T.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(T){var I=T;return T>=this.state.lastPosition&&(I=this.state.lastPosition),T<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),T<this.state.firstItem&&(I=T),I}},{key:"renderItems",value:function(){var T=this;return this.props.children.map(function(I,O){var D=t.default.ITEM(!1,O===T.state.selectedItem),k={key:O,ref:function(Q){return T.setThumbsRef(Q,O)},className:D,onClick:T.handleClickItem.bind(T,O,T.props.children[O]),onKeyDown:T.handleClickItem.bind(T,O,T.props.children[O]),"aria-label":"".concat(T.props.labels.item," ").concat(O+1),style:{width:T.props.thumbWidth}};return e.default.createElement("li",u({},k,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var T=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,D=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,k={},Q=-this.state.firstItem*(this.state.itemSize||0),N=(0,r.default)(Q,"px",this.props.axis),Y=this.props.transitionTime+"ms";return k={WebkitTransform:N,MozTransform:N,MsTransform:N,OTransform:N,transform:N,msTransform:N,WebkitTransitionDuration:Y,MozTransitionDuration:Y,MsTransitionDuration:Y,OTransitionDuration:Y,transitionDuration:Y,msTransitionDuration:Y},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!O),onClick:function(){return T.slideRight()},"aria-label":this.props.labels.leftArrow}),I?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:k,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(ae){return T.setItemsListRef(ae)},style:k},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!D),onClick:function(){return T.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L})(e.Component);return Zo.default=H,E(H,"displayName","Thumbs"),E(H,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Zo}var ei={},Tc;function dm(){if(Tc)return ei;Tc=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.default=void 0;var e=function(){return document};return ei.default=e,ei}var Ln={},Oc;function Hd(){if(Oc)return Ln;Oc=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.setPosition=Ln.getPosition=Ln.isKeyboardEvent=Ln.defaultStatusFormatter=Ln.noop=void 0;var e=kt,t=n(ls());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Ln.noop=r;var o=function(s,c){return"".concat(s," of ").concat(c)};Ln.defaultStatusFormatter=o;var i=function(s){return s?s.hasOwnProperty("key"):!1};Ln.isKeyboardEvent=i;var a=function(s,c){if(c.infiniteLoop&&++s,s===0)return 0;var u=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var h=-s*c.centerSlidePercentage,g=u-1;return s&&(s!==g||c.infiniteLoop)?h+=(100-c.centerSlidePercentage)/2:s===g&&(h+=100-c.centerSlidePercentage),h}return-s*100};Ln.getPosition=a;var l=function(s,c){var u={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(h){u[h]=(0,t.default)(s,"%",c)}),u};return Ln.setPosition=l,Ln}var Xn={},Dc;function hm(){if(Dc)return Xn;Dc=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.fadeAnimationHandler=Xn.slideStopSwipingHandler=Xn.slideSwipeAnimationHandler=Xn.slideAnimationHandler=void 0;var e=kt,t=r(ls()),n=Hd();function r(h){return h&&h.__esModule?h:{default:h}}function o(h,g){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(h,m).enumerable})),f.push.apply(f,p)}return f}function i(h){for(var g=1;g<arguments.length;g++){var f=arguments[g]!=null?arguments[g]:{};g%2?o(Object(f),!0).forEach(function(p){a(h,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):o(Object(f)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(f,p))})}return h}function a(h,g,f){return g in h?Object.defineProperty(h,g,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[g]=f,h}var l=function(h,g){var f={},p=g.selectedItem,m=p,w=e.Children.count(h.children)-1,y=h.infiniteLoop&&(p<0||p>w);if(y)return m<0?h.centerMode&&h.centerSlidePercentage&&h.axis==="horizontal"?f.itemListStyle=(0,n.setPosition)(-(w+2)*h.centerSlidePercentage-(100-h.centerSlidePercentage)/2,h.axis):f.itemListStyle=(0,n.setPosition)(-(w+2)*100,h.axis):m>w&&(f.itemListStyle=(0,n.setPosition)(0,h.axis)),f;var v=(0,n.getPosition)(p,h),C=(0,t.default)(v,"%",h.axis),R=h.transitionTime+"ms";return f.itemListStyle={WebkitTransform:C,msTransform:C,OTransform:C,transform:C},g.swiping||(f.itemListStyle=i(i({},f.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),f};Xn.slideAnimationHandler=l;var s=function(h,g,f,p){var m={},w=g.axis==="horizontal",y=e.Children.count(g.children),v=0,C=(0,n.getPosition)(f.selectedItem,g),R=g.infiniteLoop?(0,n.getPosition)(y-1,g)-100:(0,n.getPosition)(y-1,g),E=w?h.x:h.y,M=E;C===v&&E>0&&(M=0),C===R&&E<0&&(M=0);var H=C+100/(f.itemSize/M),S=Math.abs(E)>g.swipeScrollTolerance;return g.infiniteLoop&&S&&(f.selectedItem===0&&H>-100?H-=y*100:f.selectedItem===y-1&&H<-y*100&&(H+=y*100)),(!g.preventMovementUntilSwipeScrollTolerance||S||f.swipeMovementStarted)&&(f.swipeMovementStarted||p({swipeMovementStarted:!0}),m.itemListStyle=(0,n.setPosition)(H,g.axis)),S&&!f.cancelClick&&p({cancelClick:!0}),m};Xn.slideSwipeAnimationHandler=s;var c=function(h,g){var f=(0,n.getPosition)(g.selectedItem,h),p=(0,n.setPosition)(f,h.axis);return{itemListStyle:p}};Xn.slideStopSwipingHandler=c;var u=function(h,g){var f=h.transitionTime+"ms",p="ease-in-out",m={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return g.swiping||(m=i(i({},m),{},{WebkitTransitionDuration:f,MozTransitionDuration:f,OTransitionDuration:f,transitionDuration:f,msTransitionDuration:f})),{slideStyle:m,selectedStyle:i(i({},m),{},{opacity:1,position:"relative"}),prevStyle:i({},m)}};return Xn.fadeAnimationHandler=u,Xn}var Pc;function fm(){if(Pc)return qo;Pc=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.default=void 0;var e=u(kt),t=s(Td()),n=s(Od()),r=s(Pd()),o=s(dm()),i=s(Dd()),a=Hd(),l=hm();function s(T){return T&&T.__esModule?T:{default:T}}function c(){if(typeof WeakMap!="function")return null;var T=new WeakMap;return c=function(){return T},T}function u(T){if(T&&T.__esModule)return T;if(T===null||h(T)!=="object"&&typeof T!="function")return{default:T};var I=c();if(I&&I.has(T))return I.get(T);var O={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in T)if(Object.prototype.hasOwnProperty.call(T,k)){var Q=D?Object.getOwnPropertyDescriptor(T,k):null;Q&&(Q.get||Q.set)?Object.defineProperty(O,k,Q):O[k]=T[k]}return O.default=T,I&&I.set(T,O),O}function h(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(I){return typeof I}:h=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},h(T)}function g(){return g=Object.assign||function(T){for(var I=1;I<arguments.length;I++){var O=arguments[I];for(var D in O)Object.prototype.hasOwnProperty.call(O,D)&&(T[D]=O[D])}return T},g.apply(this,arguments)}function f(T,I){var O=Object.keys(T);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(T);I&&(D=D.filter(function(k){return Object.getOwnPropertyDescriptor(T,k).enumerable})),O.push.apply(O,D)}return O}function p(T){for(var I=1;I<arguments.length;I++){var O=arguments[I]!=null?arguments[I]:{};I%2?f(Object(O),!0).forEach(function(D){x(T,D,O[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(O)):f(Object(O)).forEach(function(D){Object.defineProperty(T,D,Object.getOwnPropertyDescriptor(O,D))})}return T}function m(T,I){if(!(T instanceof I))throw new TypeError("Cannot call a class as a function")}function w(T,I){for(var O=0;O<I.length;O++){var D=I[O];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}function y(T,I,O){return I&&w(T.prototype,I),T}function v(T,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(I&&I.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),I&&C(T,I)}function C(T,I){return C=Object.setPrototypeOf||function(O,D){return O.__proto__=D,O},C(T,I)}function R(T){var I=H();return function(){var O=S(T),D;if(I){var k=S(this).constructor;D=Reflect.construct(O,arguments,k)}else D=O.apply(this,arguments);return E(this,D)}}function E(T,I){return I&&(h(I)==="object"||typeof I=="function")?I:M(T)}function M(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function H(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(T){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},S(T)}function x(T,I,O){return I in T?Object.defineProperty(T,I,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[I]=O,T}var L=(function(T){v(O,T);var I=R(O);function O(D){var k;m(this,O),k=I.call(this,D),x(M(k),"thumbsRef",void 0),x(M(k),"carouselWrapperRef",void 0),x(M(k),"listRef",void 0),x(M(k),"itemsRef",void 0),x(M(k),"timer",void 0),x(M(k),"animationHandler",void 0),x(M(k),"setThumbsRef",function(N){k.thumbsRef=N}),x(M(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),x(M(k),"setListRef",function(N){k.listRef=N}),x(M(k),"setItemsRef",function(N,Y){k.itemsRef||(k.itemsRef=[]),k.itemsRef[Y]=N}),x(M(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),x(M(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),x(M(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),x(M(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),x(M(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),x(M(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,o.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,o.default)().activeElement)):!1}),x(M(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var Y=k.props.axis,ae=Y==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},K=ae?ee.ArrowRight:ee.ArrowDown,pe=ae?ee.ArrowLeft:ee.ArrowUp;K===N.keyCode?k.increment():pe===N.keyCode&&k.decrement()}}),x(M(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",Y=k.itemsRef[0];if(Y){var ae=N?Y.clientWidth:Y.clientHeight;k.setState({itemSize:ae}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),x(M(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),x(M(k),"handleClickItem",function(N,Y){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,Y),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),x(M(k),"handleOnChange",function(N,Y){e.Children.count(k.props.children)<=1||k.props.onChange(N,Y)}),x(M(k),"handleClickThumb",function(N,Y){k.props.onClickThumb(N,Y),k.moveTo(N)}),x(M(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),x(M(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),x(M(k),"onSwipeMove",function(N,Y){k.props.onSwipeMove(Y);var ae=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(M(k)));return k.setState(p({},ae)),!!Object.keys(ae).length}),x(M(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),x(M(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),x(M(k),"moveTo",function(N){if(typeof N=="number"){var Y=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?Y:0),N>Y&&(N=k.props.infiniteLoop?0:Y),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),x(M(k),"onClickNext",function(){k.increment(1)}),x(M(k),"onClickPrev",function(){k.decrement(1)}),x(M(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(M(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(M(k),"changeItem",function(N){return function(Y){(!(0,a.isKeyboardEvent)(Y)||Y.key==="Enter")&&k.moveTo(N)}}),x(M(k),"selectItem",function(N){k.setState(p({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),x(M(k),"getInitialImage",function(){var N=k.props.selectedItem,Y=k.itemsRef&&k.itemsRef[N],ae=Y&&Y.getElementsByTagName("img")||[];return ae[0]}),x(M(k),"getVariableItemHeight",function(N){var Y=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&Y&&Y.children.length){var ae=Y.children[0].getElementsByTagName("img")||[];if(ae.length>0){var ee=ae[0];if(!ee.complete){var K=function de(){k.forceUpdate(),ee.removeEventListener("load",de)};ee.addEventListener("load",K)}}var pe=ae[0]||Y.children[0],oe=pe.clientHeight;return oe>0?oe:null}return null});var Q={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 k.animationHandler=typeof D.animationHandler=="function"&&D.animationHandler||D.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,k.state=p(p({},Q),k.animationHandler(D,Q)),k}return y(O,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(D,k){!D.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!D.autoFocus&&this.props.autoFocus&&this.forceFocus(),k.swiping&&!this.state.swiping&&this.setState(p({},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 k=D.getInitialImage();k&&!k.complete?k.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 k=this;return this.props.children?e.Children.map(this.props.children,function(Q,N){var Y=N===k.state.selectedItem,ae=N===k.state.previousItem,ee=Y&&k.state.selectedStyle||ae&&k.state.prevStyle||k.state.slideStyle||{};k.props.centerMode&&k.props.axis==="horizontal"&&(ee=p(p({},ee),{},{minWidth:k.props.centerSlidePercentage+"%"})),k.state.swiping&&k.state.swipeMovementStarted&&(ee=p(p({},ee),{},{pointerEvents:"none"}));var K={ref:function(pe){return k.setItemsRef(pe,N)},key:"itemKey"+N+(D?"clone":""),className:n.default.ITEM(!0,N===k.state.selectedItem,N===k.state.previousItem),onClick:k.handleClickItem.bind(k,N,Q),style:ee};return e.default.createElement("li",K,k.props.renderItem(Q,{isSelected:N===k.state.selectedItem,isPrevious:N===k.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var D=this,k=this.props,Q=k.showIndicators,N=k.labels,Y=k.renderIndicator,ae=k.children;return Q?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ae,function(ee,K){return Y&&Y(D.changeItem(K),K===D.state.selectedItem,K,N.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 k=this.props.swipeable&&e.Children.count(this.props.children)>1,Q=this.props.axis==="horizontal",N=this.props.showArrows&&e.Children.count(this.props.children)>1,Y=N&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ae=N&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,ee=this.renderItems(!0),K=ee.shift(),pe=ee.pop(),oe={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},de={};if(Q){if(oe.onSwipeLeft=this.onSwipeForward,oe.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var he=this.getVariableItemHeight(this.state.selectedItem);de.height=he||"auto"}}else oe.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,oe.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,oe.style=p(p({},oe.style),{},{height:this.state.itemSize}),de.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,Y,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:de},k?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},oe,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&pe,this.renderItems(),this.props.infiniteLoop&&K):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(se){return D.setListRef(se)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&pe,this.renderItems(),this.props.infiniteLoop&&K)),this.props.renderArrowNext(this.onClickNext,ae,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),O})(e.default.Component);return qo.default=L,x(L,"displayName","Carousel"),x(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(T,I,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!I),onClick:T})},renderArrowNext:function(T,I,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!I),onClick:T})},renderIndicator:function(T,I,O,D){return e.default.createElement("li",{className:n.default.DOT(I),onClick:T,onKeyDown:T,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(D," ").concat(O+1)})},renderItem:function(T){return T},renderThumbs:function(T){var I=e.Children.map(T,function(O){var D=O;if(O.type!=="img"&&(D=e.Children.toArray(O.props.children).find(function(k){return k.type==="img"})),!!D)return D});return I.filter(function(O){return O}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):I},statusFormatter:a.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),qo}var pm={};function gm(){return pm}var Hc;function mm(){return Hc||(Hc=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(fm()),n=gm(),r=o(Pd());function o(i){return i&&i.__esModule?i:{default:i}}})(xc)),xc}var vm=mm(),ul,Lc;function bm(){if(Lc)return ul;Lc=1;var e=zp(),t=function(){return e.Date.now()};return ul=t,ul}var dl,Ac;function Ld(){if(Ac)return dl;Ac=1;var e=ud(),t=bm(),n=dd(),r="Expected a function",o=Math.max,i=Math.min;function a(l,s,c){var u,h,g,f,p,m,w=0,y=!1,v=!1,C=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(c)&&(y=!!c.leading,v="maxWait"in c,g=v?o(n(c.maxWait)||0,s):g,C="trailing"in c?!!c.trailing:C);function R(O){var D=u,k=h;return u=h=void 0,w=O,f=l.apply(k,D),f}function E(O){return w=O,p=setTimeout(S,s),y?R(O):f}function M(O){var D=O-m,k=O-w,Q=s-D;return v?i(Q,g-k):Q}function H(O){var D=O-m,k=O-w;return m===void 0||D>=s||D<0||v&&k>=g}function S(){var O=t();if(H(O))return x(O);p=setTimeout(S,M(O))}function x(O){return p=void 0,C&&u?R(O):(u=h=void 0,f)}function L(){p!==void 0&&clearTimeout(p),w=0,u=m=h=p=void 0}function T(){return p===void 0?f:x(t())}function I(){var O=t(),D=H(O);if(u=arguments,h=this,m=O,D){if(p===void 0)return E(m);if(v)return clearTimeout(p),p=setTimeout(S,s),R(m)}return p===void 0&&(p=setTimeout(S,s)),f}return I.cancel=L,I.flush=T,I}return dl=a,dl}var wm=Ld();const Ad=vr(wm);function Mn(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 Ir(e,t){return e===void 0?void 0:t}const ym=Math.PI;function Fc(e){return e*ym/180}const Fd=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),zd=(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}},_d=(e,t,n)=>Math.min(e,t-n*2),$d=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,ss=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"}))},xm=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 Cm(e,t,n){const[r,o]=d.useState(e),i=d.useRef(!0);d.useEffect(()=>()=>{i.current=!1},[]);const a=d.useRef(Ad(l=>{i.current&&o(l)},n));return d.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),r}const km="֑-߿יִ-﷽ﹰ-ﻼ",Sm="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Mm=new RegExp("^[^"+Sm+"]*["+km+"]");function cs(e){return Mm.test(e)?"rtl":"not-rtl"}let Ki;function $l(){if(typeof document>"u")return 0;if(Ki!==void 0)return Ki;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(),Ki=n-r,Ki}const jr=Symbol();function Im(e){const t=d.useRef([jr,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!==jr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==jr&&o({}),r(c=>typeof l=="function"?l(s===jr?c:s):l),t.current[0]=jr)},[]),a=d.useCallback(()=>{t.current[0]=jr,o({})},[]);return[t.current[0]===jr?n:t.current[0],i,a]}function Vd(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 Rm(e){const t=d.useRef(e);return Do(e,t.current)||(t.current=e),t.current}const Em=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(sm,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(vm.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(ss,null)))};function us(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Jr=us();function Bd(e){Jr=e}const Nd=/[&<>"']/,Tm=new RegExp(Nd.source,"g"),Wd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Om=new RegExp(Wd.source,"g"),Dm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},zc=e=>Dm[e];function An(e,t){if(t){if(Nd.test(e))return e.replace(Tm,zc)}else if(Wd.test(e))return e.replace(Om,zc);return e}const Pm=/(^|[^\[])\^/g;function Ot(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(Pm,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}function _c(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const hi={exec:()=>null};function $c(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let s=!1,c=a;for(;--c>=0&&l[c]==="\\";)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 Hm(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 Vc(e,t,n,r){const o=t.href,i=t.title?An(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:An(a)}}function Lm(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 va{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=Lm(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 c;for(c=0;c<r.length;c++)if(/^ {0,3}>/.test(r[c]))s.push(r[c]),l=!0;else if(!l)s.push(r[c]);else break;r=r.slice(c);const u=s.join(`
9
- `),h=u.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
10
- $1`).replace(/^ {0,3}>[ \t]?/gm,"");o=o?`${o}
11
- ${u}`:u,i=i?`${i}
12
- ${h}`:h;const g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,a,!0),this.lexer.state.top=g,r.length===0)break;const f=a[a.length-1];if(f?.type==="code")break;if(f?.type==="blockquote"){const p=f,m=p.raw+`
13
- `+r.join(`
14
- `),w=this.blockquote(m);a[a.length-1]=w,o=o.substring(0,o.length-p.raw.length)+w.raw,i=i.substring(0,i.length-p.text.length)+w.text;break}else if(f?.type==="list"){const p=f,m=p.raw+`
15
- `+r.join(`
16
- `),w=this.list(m);a[a.length-1]=w,o=o.substring(0,o.length-f.raw.length)+w.raw,i=i.substring(0,i.length-p.raw.length)+w.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,c="",u="";if(!(n=a.exec(t))||this.rules.block.hr.test(t))break;c=n[0],t=t.substring(c.length);let h=n[2].split(`
18
- `,1)[0].replace(/^\t+/,y=>" ".repeat(3*y.length)),g=t.split(`
19
- `,1)[0],f=!h.trim(),p=0;if(this.options.pedantic?(p=2,u=h.trimStart()):f?p=n[1].length+1:(p=n[2].search(/[^ ]/),p=p>4?1:p,u=h.slice(p),p+=n[1].length),f&&/^ *$/.test(g)&&(c+=g+`
20
- `,t=t.substring(g.length+1),s=!0),!s){const y=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),v=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),C=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),R=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;t;){const E=t.split(`
21
- `,1)[0];if(g=E,this.options.pedantic&&(g=g.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),C.test(g)||R.test(g)||y.test(g)||v.test(t))break;if(g.search(/[^ ]/)>=p||!g.trim())u+=`
22
- `+g.slice(p);else{if(f||h.search(/[^ ]/)>=4||C.test(h)||R.test(h)||v.test(h))break;u+=`
23
- `+g}!f&&!g.trim()&&(f=!0),c+=E+`
24
- `,t=t.substring(E.length+1),h=g.slice(p)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(c)&&(l=!0));let m=null,w;this.options.gfm&&(m=/^\[[ xX]\] /.exec(u),m&&(w=m[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:c,task:!!m,checked:w,loose:!1,text:u,tokens:[]}),i.raw+=c}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 c=i.items[s].tokens.filter(h=>h.type==="space"),u=c.length>0&&c.some(h=>/\n.*\n/.test(h.raw));i.loose=u}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=$c(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($c(l,a.header.length).map((s,c)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[c]})));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:An(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=Hm(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)),Vc(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 Vc(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,c=0;const u=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,n=n.slice(-1*t.length+i);(o=u.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)){c+=l;continue}if(s-=l,s>0)continue;l=Math.min(l,l+s+c);const h=[...o[0]][0].length,g=t.slice(0,i+o.index+h+l);if(Math.min(i,l)%2){const p=g.slice(1,-1);return{type:"em",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}const f=g.slice(2,-2);return{type:"strong",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}}}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=An(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=An(n[1]),o="mailto:"+r):(r=An(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=An(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=An(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=An(n[0]),{type:"text",raw:n[0],text:r}}}}const Am=/^(?: *(?:\n|$))+/,Fm=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,zm=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ii=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_m=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jd=/(?:[*+-]|\d{1,9}[.)])/,Gd=Ot(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,jd).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(),ds=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$m=/^[^\n]+/,hs=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Vm=Ot(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",hs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Bm=Ot(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jd).getRegex(),Ha="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",fs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Nm=Ot("^ {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",fs).replace("tag",Ha).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ud=Ot(ds).replace("hr",Ii).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",Ha).getRegex(),Wm=Ot(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ud).getRegex(),ps={blockquote:Wm,code:Fm,def:Vm,fences:zm,heading:_m,hr:Ii,html:Nm,lheading:Gd,list:Bm,newline:Am,paragraph:Ud,table:hi,text:$m},Bc=Ot("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ii).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",Ha).getRegex(),jm={...ps,table:Bc,paragraph:Ot(ds).replace("hr",Ii).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Bc).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",Ha).getRegex()},Gm={...ps,html:Ot(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fs).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:hi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ot(ds).replace("hr",Ii).replace("heading",` *#{1,6} *[^
27
- ]`).replace("lheading",Gd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Um=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qd=/^( {2,}|\\)\n(?!\s*$)/,Xm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ri="\\p{P}\\p{S}",qm=Ot(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Ri).getRegex(),Km=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Zm=Ot(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Ri).getRegex(),Ym=Ot("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Ri).getRegex(),Qm=Ot("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Ri).getRegex(),Jm=Ot(/\\([punct])/,"gu").replace(/punct/g,Ri).getRegex(),e0=Ot(/^<(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(),t0=Ot(fs).replace("(?:-->|$)","-->").getRegex(),n0=Ot("^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",t0).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ba=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,r0=Ot(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ba).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Kd=Ot(/^!?\[(label)\]\[(ref)\]/).replace("label",ba).replace("ref",hs).getRegex(),Zd=Ot(/^!?\[(ref)\](?:\[\])?/).replace("ref",hs).getRegex(),o0=Ot("reflink|nolink(?!\\()","g").replace("reflink",Kd).replace("nolink",Zd).getRegex(),gs={_backpedal:hi,anyPunctuation:Jm,autolink:e0,blockSkip:Km,br:qd,code:Um,del:hi,emStrongLDelim:Zm,emStrongRDelimAst:Ym,emStrongRDelimUnd:Qm,escape:Xd,link:r0,nolink:Zd,punctuation:qm,reflink:Kd,reflinkSearch:o0,tag:n0,text:Xm,url:hi},i0={...gs,link:Ot(/^!?\[(label)\]\((.*?)\)/).replace("label",ba).getRegex(),reflink:Ot(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ba).getRegex()},Vl={...gs,escape:Ot(Xd).replace("])","~|])").getRegex(),url:Ot(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},a0={...Vl,br:Ot(qd).replace("{2,}","*").getRegex(),text:Ot(Vl.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Zi={normal:ps,gfm:jm,pedantic:Gm},ni={normal:gs,gfm:Vl,breaks:a0,pedantic:i0};class sr{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 va,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:Zi.normal,inline:ni.normal};this.options.pedantic?(n.block=Zi.pedantic,n.inline=ni.pedantic):this.options.gfm&&(n.block=Zi.gfm,this.options.breaks?n.inline=ni.breaks:n.inline=ni.gfm),this.tokenizer.rules=n}static get rules(){return{block:Zi,inline:ni}}static lex(t,n){return new sr(n).lex(t)}static lexInline(t,n){return new sr(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,c)=>s+" ".repeat(c.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 c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},s),typeof c=="number"&&c>=0&&(l=Math.min(l,c))}),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,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.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||(c=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(r=u.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,c)){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 u=1/0;const h=t.slice(1);let g;this.options.extensions.startInline.forEach(f=>{g=f.call({lexer:this},h),typeof g=="number"&&g>=0&&(u=Math.min(u,g))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(r=this.tokenizer.inlineText(i)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=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 u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}}class wa{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-'+An(o)+'">'+(r?i:An(i,!0))+`</code></pre>
39
- `:"<pre><code>"+(r?i:An(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=_c(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=_c(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 ms{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 cr{options;renderer;textRenderer;constructor(t){this.options=t||Jr,this.options.renderer=this.options.renderer||new wa,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ms}static parse(t,n){return new cr(n).parse(t)}static parseInline(t,n){return new cr(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 sa{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 l0{defaults=us();options=this.setOptions;parse=this.parseMarkdown(sr.lex,cr.parse);parseInline=this.parseMarkdown(sr.lexInline,cr.parseInline);Parser=cr;Renderer=wa;TextRenderer=ms;Lexer=sr;Tokenizer=va;Hooks=sa;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 wa(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],c=i[l];i[l]=(...u)=>{let h=s.apply(i,u);return h===!1&&(h=c.apply(i,u)),h||""}}o.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new va(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],c=i[l];i[l]=(...u)=>{let h=s.apply(i,u);return h===!1&&(h=c.apply(i,u)),h}}o.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new sa;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],c=i[l];sa.passThroughHooks.has(a)?i[l]=u=>{if(this.defaults.async)return Promise.resolve(s.call(i,u)).then(g=>c.call(i,g));const h=s.call(i,u);return c.call(i,h)}:i[l]=(...u)=>{let h=s.apply(i,u);return h===!1&&(h=c.apply(i,u)),h}}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 sr.lex(t,n??this.defaults)}parser(t,n){return cr.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 c=n(s,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}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>"+An(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}}}const Zr=new l0;function Rt(e,t){return Zr.parse(e,t)}Rt.options=Rt.setOptions=function(e){return Zr.setOptions(e),Rt.defaults=Zr.defaults,Bd(Rt.defaults),Rt};Rt.getDefaults=us;Rt.defaults=Jr;Rt.use=function(...e){return Zr.use(...e),Rt.defaults=Zr.defaults,Bd(Rt.defaults),Rt};Rt.walkTokens=function(e,t){return Zr.walkTokens(e,t)};Rt.parseInline=Zr.parseInline;Rt.Parser=cr;Rt.parser=cr.parse;Rt.Renderer=wa;Rt.TextRenderer=ms;Rt.Lexer=sr;Rt.lexer=sr.lex;Rt.Tokenizer=va;Rt.Hooks=sa;Rt.parse=Rt;Rt.options;Rt.setOptions;Rt.use;Rt.walkTokens;Rt.parseInline;cr.parse;sr.lex;const s0=sn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class c0 extends kt.PureComponent{targetElement=null;renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:r,createNode:o}=n,i=Rt(r),a=document.createRange();a.selectNodeContents(t),a.deleteContents();let l=o?.(i);if(l===void 0){const c=document.createElement("template");c.innerHTML=i,l=c.content}t.append(l);const s=t.getElementsByTagName("a");for(const c of s)c.target="_blank",c.rel="noreferrer noopener"}containerRefHook=t=>{this.targetElement=t,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),kt.createElement(s0,{ref:this.containerRefHook})}}const u0=sn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),d0=sn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),h0=sn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let Nc=0;const eo=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:o,altNewline:i,validatedSelection:a,...l}=e,{onChange:s,className:c}=l,u=d.useRef(null),h=n??"";Fn(s!==void 0,"GrowingEntry must be a controlled input area");const[g]=d.useState(()=>"input-box-"+(Nc=(Nc+1)%1e7));d.useEffect(()=>{const p=u.current;if(p===null||p.disabled)return;const m=h.toString().length;p.focus(),p.setSelectionRange(o?0:m,m)},[]),d.useLayoutEffect(()=>{if(a!==void 0){const p=typeof a=="number"?[a,null]:a;u.current?.setSelectionRange(p[0],p[1])}},[a]);const f=d.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&i===!0||r?.(p)},[i,r]);return d.createElement(h0,{className:"gdg-growing-entry"},d.createElement(d0,{className:c},h+`
58
- `),d.createElement(u0,{...l,className:(c??"")+" gdg-input",id:g,ref:u,onKeyDown:f,value:h,placeholder:t,dir:"auto"}))},hl={};let Sr=null;function f0(){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(hl[t]!==void 0)return hl[t];Sr=Sr||f0(),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),hl[t]=o,o}function Yr(e,t){const[n,r,o]=bi(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Wc=new Map;function jc(e,t){const n=`${e}-${t}`,r=Wc.get(n);if(r!==void 0)return r;const o=zn(e,t);return Wc.set(n,o),o}function zn(e,t){if(t===void 0)return e;const[n,r,o,i]=bi(e);if(i===1)return e;const[a,l,s,c]=bi(t),u=i+c*(1-i),h=(i*n+c*a*(1-i))/u,g=(i*r+c*l*(1-i))/u,f=(i*o+c*s*(1-i))/u;return`rgba(${h}, ${g}, ${f}, ${u})`}function Bl(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,Ro=new Map,Nl=new Map;function p0(){Mo.clear(),Nl.clear(),Ro.clear()}function g0(e,t,n,r,o){var i,a,l;let s=0,c={};for(let h of e)s+=(i=n.get(h))!=null?i:o,c[h]=((a=c[h])!=null?a:0)+1;let u=t-s;for(let h of Object.keys(c)){let g=c[h],f=(l=n.get(h))!=null?l:o,p=f*g/s,m=u*p*r/g,w=f+m;n.set(h,w)}}function m0(e,t){var n;let r=new Map,o=0;for(let c of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let u=e.measureText(c).width;r.set(c,u),o+=u}let i=o/r.size,a=3,l=(t/i+a)/(a+1),s=r.keys();for(let c of s)r.set(c,((n=r.get(c))!=null?n:i)*l);return r}function fi(e,t,n,r){var o,i;let a=Ro.get(n);if(r&&a!==void 0&&a.count>2e4){let c=Nl.get(n);if(c===void 0&&(c=m0(e,a.size),Nl.set(n,c)),a.count>5e5){let h=0;for(let g of t)h+=(o=c.get(g))!=null?o:a.size;return h*1.01}let u=e.measureText(t);return g0(t,u.width,c,Math.max(.05,1-a.count/2e5),a.size),Ro.set(n,{count:a.count+t.length,size:a.size}),u.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)Ro.set(n,{count:t.length,size:s});else{let c=s-a.size,u=t.length/(a.count+t.length),h=a.size+c*u;Ro.set(n,{count:a.count+t.length,size:h})}return l.width}function v0(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),c=fi(e,t.slice(0,Math.max(0,s)),r,a);if(c!==n)if(c<n){for(;c<n;)s++,c=fi(e,t.slice(0,Math.max(0,s)),r,a);s--}else for(;c>n;){let u=t.lastIndexOf(" ",s-1);u>0?s=u:s--,c=fi(e,t.slice(0,Math.max(0,s)),r,a)}if(t[s]!==" "){let u=0;u=t.lastIndexOf(" ",s),u>0&&(s=u)}return s}function b0(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=[],c=t.split(`
59
- `),u=Ro.get(n),h=u===void 0?t.length:r/u.size*1.5,g=o&&u!==void 0&&u.count>2e4;for(let f of c){let p=fi(e,f.slice(0,Math.max(0,h)),n,g),m=Math.min(f.length,h);if(p<=r)s.push(f);else{for(;p>r;){let w=v0(e,f,r,n,p,m,g),y=f.slice(0,Math.max(0,w));f=f.slice(y.length),s.push(y),p=fi(e,f.slice(0,Math.max(0,h)),n,g),m=Math.min(f.length,h)}p>0&&s.push(f)}}return s=s.map((f,p)=>p===0?f.trimEnd():f.trim()),Mo.set(a,s),Mo.size>500&&Mo.delete(Mo.keys().next().value),s}function w0(e,t){return kt.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 y0(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 x0(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 Yd(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 Qd(e){return[e.x+e.width-1,e.y+e.height-1]}function Gc(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[c,u]=t.span;return c>=r&&c<=o||u>=r&&c<=o||c<r&&u>o}function C0(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)&&Gc(e,t,i)&&o++;for(const a of n.current.rangeStack)Gc(e,t,a)&&o++;return o}function Jd(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=Jd(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 Wl(e,t,n,r,o){const i=Jd(e,r),a=[];for(const c of i)if(c.sticky)a.push(c);else break;if(a.length>0)for(const c of a)n-=c.width;let l=t,s=o??0;for(;s<=n&&l<i.length;)s+=i[l].width,l++;for(let c=t;c<l;c++){const u=i[c];u.sticky||a.push(u)}return a}function k0(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 S0(e,t,n,r,o,i,a,l,s,c){const u=r+o;if(n&&e<=o)return-2;if(e<=u)return-1;let h=t;for(let p=0;p<c;p++){const m=i-1-p,w=typeof a=="number"?a:a(m);if(h-=w,e>=h)return m}const g=i-c,f=e-(s??0);if(typeof a=="number"){const p=Math.floor((f-u)/a)+l;return p>=g?void 0:p}else{let p=u;for(let m=l;m<g;m++){const w=a(m);if(f<=p+w)return m;p+=w}return}}let ca=0,gi={};const M0=typeof window>"u";async function I0(){M0||document?.fonts?.ready===void 0||(await document.fonts.ready,ca=0,gi={},p0())}I0();function eh(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Dr(e,t,n,r="middle"){const o=eh(e,t,r,n);let i=gi[o];return i===void 0&&(i=t.measureText(e),gi[o]=i,ca++),ca>1e4&&(gi={},ca=0),i}function th(e,t){const n=eh(e,void 0,"middle",t);return gi[n]}function Jn(e,t){return typeof t!="string"&&(t=t.baseFontFull),R0(e,t)}function Uc(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const Xc=[];function R0(e,t){for(const o of Xc)if(o.key===t)return o.val;const n=Uc(e,"alphabetic"),r=-(Uc(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return Xc.push({key:t,val:r}),r}function E0(e,t,n,r,o,i){const{ctx:a,rect:l,theme:s}=e;let c=Number.MAX_SAFE_INTEGER;const u=500;if(t!==void 0&&(c=n-t,c<u)){const h=1-c/u;a.globalAlpha=h,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 c<u}function Ei(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 vs(e,t,n,r,o){const{rect:i,ctx:a,theme:l}=e;a.fillStyle=l.textDark,lr({ctx:a,rect:i,theme:l},t,n,r,o)}function nh(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 bs(e,t){const n=Dr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function T0(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 O0(e,t,n,r,o,i,a,l,s,c){const u=l.baseFontFull,h=b0(e,t,u,o-l.cellHorizontalPadding*2,c??!1),g=bs(e,u),f=l.lineHeight*g,p=g+f*(h.length-1),m=p+l.cellVerticalPadding>i;m&&(e.save(),e.rect(n,r,o,i),e.clip());const w=r+i/2-p/2;let y=Math.max(r+l.cellVerticalPadding,w);for(const v of h)if(nh(e,v,n,y,o,g,a,l,s),y+=f,y>r+i)break;m&&e.restore()}function lr(e,t,n,r,o){const{ctx:i,rect:a,theme:l}=e,{x:s,y:c,width:u,height:h}=a;r=r??!1,r||(t=T0(t,u));const g=Jn(i,l),f=cs(t)==="rtl";if(n===void 0&&f&&(n="right"),f&&(i.direction="rtl"),t.length>0){let p=!1;n==="right"?(i.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,p=!0),r?O0(i,t,s,c,u,h,g,l,n,o):nh(i,t,s,c,u,h,g,l,n),p&&(i.textAlign="start"),f&&(i.direction="inherit")}}function Yn(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 D0(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 P0(e,t,n){const r=function(l,s){const c=s.x-l.x,u=s.y-l.y,h=Math.sqrt(c*c+u*u),g=c/h,f=u/h;return{x:c,y:s.y-l.y,len:h,nx:g,ny:f,ang:Math.atan2(f,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 c=t[(l+1)%i],u=r(s,a),h=r(s,c),g=u.nx*h.ny-u.ny*h.nx,f=u.nx*h.nx-u.ny*-h.ny;let p=Math.asin(g<-1?-1:g>1?1:g),m=1,w=!1;f<0?p<0?p=Math.PI+p:(p=Math.PI-p,m=-1,w=!0):p>0&&(m=-1,w=!0),o=s.radius!==void 0?s.radius:n;const y=p/2;let v=Math.abs(Math.cos(y)*o/Math.sin(y)),C;v>Math.min(u.len/2,h.len/2)?(v=Math.min(u.len/2,h.len/2),C=Math.abs(v*Math.sin(y)/Math.cos(y))):C=o;let R=s.x+h.nx*v,E=s.y+h.ny*v;R+=-h.ny*C*m,E+=h.nx*C*m,e.arc(R,E,C,u.ang+Math.PI/2*m,h.ang-Math.PI/2*m,w),a=s,s=c}e.closePath()}function jl(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p){const m={x:0,y:i+c,width:0,height:0};if(e>=f.length||t>=u||t<-2||e<0)return m;const w=i-o;if(e>=h){const y=a>e?-1:1,v=Po(f);m.x+=v+s;for(let C=a;C!==e;C+=y)m.x+=f[y===1?C:C-1].width*y}else for(let y=0;y<e;y++)m.x+=f[y].width;if(m.width=f[e].width+1,t===-1)m.y=o,m.height=w;else if(t===-2){m.y=0,m.height=o;let y=e;const v=f[e].group,C=f[e].sticky;for(;y>0&&wi(f[y-1].group,v)&&f[y-1].sticky===C;){const E=f[y-1];m.x-=E.width,m.width+=E.width,y--}let R=e;for(;R+1<f.length&&wi(f[R+1].group,v)&&f[R+1].sticky===C;){const E=f[R+1];m.width+=E.width,R++}if(!C){const E=Po(f),M=m.x-E;M<0&&(m.x-=M,m.width+=M),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=u-g){let y=u-t;for(m.y=r;y>0;){const v=t+y-1;m.height=typeof p=="number"?p:p(v),m.y-=m.height,y--}m.height+=1}else{const y=l>t?-1:1;if(typeof p=="number"){const v=t-l;m.y+=v*p}else for(let v=l;v!==t;v+=y)m.y+=p(v)*y;m.height=(typeof p=="number"?p:p(t))+1}return m}const ws=1<<21;function Zn(e,t){return(t+2)*ws+e}function rh(e){return e%ws}function ys(e){return Math.floor(e/ws)-2}function xs(e){const t=rh(e),n=ys(e);return[t,n]}class oh{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=rh(t),r=ys(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 H0 extends oh{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(ys(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 xs(t)}}function L0(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 ih={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 ah(){return ih}const lh=kt.createContext(ih);function sh(){return kt.useContext(lh)}function mr(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]=zn(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 Gl=150;function A0(e,t,n,r){return r(t)?.measure?.(e,t,n)??Gl}function ch(e,t,n,r,o,i,a,l,s){let c=0;const u=o===void 0?[]:o.map(f=>{const p=A0(e,f[r],t,s);return c=Math.max(c,p),p});if(u.length>5&&l){c=0;let f=0;for(const m of u)f+=m;const p=f/u.length;for(let m=0;m<u.length;m++)u[m]>=p*2?u[m]=0:c=Math.max(c,u[m])}const h=e.font;e.font=t.headerFontFull,c=Math.max(c,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=h;const g=Math.max(Math.ceil(i),Math.min(Math.floor(a),Math.ceil(c)));return{...n,width:g}}function F0(e,t,n,r,o,i,a,l,s){const c=d.useRef(t),u=d.useRef(n),h=d.useRef(a);c.current=t,u.current=n,h.current=a;const[g,f]=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 p=d.useRef({}),m=d.useRef(),[w,y]=d.useState();return d.useLayoutEffect(()=>{const v=u.current;if(v===void 0||e.every(qi))return;let C=Math.max(1,10-Math.floor(e.length/1e4)),R=0;C<c.current&&C>1&&(C--,R=1);const E={x:0,y:0,width:e.length,height:Math.min(c.current,C)},M={x:0,y:c.current-1,width:e.length,height:1};(async()=>{const H=v(E,s.signal),S=R>0?v(M,s.signal):void 0;let x;typeof H=="object"?x=H:x=await bc(H),S!==void 0&&(typeof S=="object"?x=[...x,...S]:x=[...x,...await bc(S)]),m.current=e,y(x)})()},[s.signal,e]),d.useMemo(()=>{let v=e.every(qi)?e:f===null?e.map(M=>qi(M)?M:{...M,width:Gl}):(f.font=h.current.baseFontFull,e.map((M,H)=>{if(qi(M))return M;if(p.current[M.id]!==void 0)return{...M,width:p.current[M.id]};if(w===void 0||m.current!==e||M.id===void 0)return{...M,width:Gl};const S=ch(f,a,M,H,w,o,i,!0,l);return p.current[M.id]=S.width,S})),C=0,R=0;const E=[];for(const[M,H]of v.entries())C+=H.width,H.grow!==void 0&&H.grow>0&&(R+=H.grow,E.push(M));if(C<r&&E.length>0){const M=[...v],H=r-C;let S=H;for(let x=0;x<E.length;x++){const L=E[x],T=(v[L].grow??0)/R,I=x===E.length-1?S:Math.min(S,Math.floor(H*T));M[L]={...v[L],growOffset:I,width:v[L].width+I},S-=I}v=M}return{sizedColumns:v,nonGrowWidth:C}},[r,e,f,w,a,o,i,l])}var fl,qc;function z0(){if(qc)return fl;qc=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 fl=e,fl}var pl,Kc;function _0(){if(Kc)return pl;Kc=1;var e=z0(),t=dd();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 pl=n,pl}var $0=_0();const Nn=vr($0);var gl,Zc;function V0(){if(Zc)return gl;Zc=1;function e(){}return gl=e,gl}var ml,Yc;function B0(){if(Yc)return ml;Yc=1;var e=qp(),t=V0(),n=wd(),r=1/0,o=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return ml=o,ml}var vl,Qc;function N0(){if(Qc)return vl;Qc=1;var e=_p(),t=$p(),n=mg(),r=Vp(),o=B0(),i=wd(),a=200;function l(s,c,u){var h=-1,g=t,f=s.length,p=!0,m=[],w=m;if(u)p=!1,g=n;else if(f>=a){var y=c?null:o(s);if(y)return i(y);p=!1,g=r,w=new e}else w=c?[]:m;e:for(;++h<f;){var v=s[h],C=c?c(v):v;if(v=u||v!==0?v:0,p&&C===C){for(var R=w.length;R--;)if(w[R]===C)continue e;c&&w.push(C),m.push(v)}else g(w,C,u)||(w!==m&&w.push(C),m.push(v))}return m}return vl=l,vl}var bl,Jc;function W0(){if(Jc)return bl;Jc=1;var e=N0();function t(n){return n&&n.length?e(n):[]}return bl=t,bl}var j0=W0();const G0=vr(j0);var U0=cp();const eu=vr(U0),_t='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',X0=e=>{const t=e.fgColor,n=e.bgColor;return`
61
- ${_t}<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>`},q0=e=>{const t=e.fgColor,n=e.bgColor;return`
62
- ${_t}<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>`},K0=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},Z0=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},Y0=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},uh=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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
- `},Q0=e=>{const t=e.bgColor;return`${_t}
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
- `},J0=uh,ev=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},tv=e=>{const t=e.fgColor,n=e.bgColor;return`
93
- ${_t}
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>`},nv=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},rv=e=>{const t=e.fgColor,n=e.bgColor;return`
106
- ${_t}
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>`},ov=e=>{const t=e.fgColor,n=e.bgColor;return`
110
- ${_t}
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>`},iv=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},av=e=>{const t=e.fgColor,n=e.bgColor;return`
117
- ${_t}
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>`},lv=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},sv=e=>{const t=e.fgColor,n=e.bgColor;return`
126
- ${_t}
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>`},cv=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},uv=e=>{const t=e.fgColor,n=e.bgColor;return`
134
- ${_t}
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>`},dv=e=>{const t=e.fgColor,n=e.bgColor;return`
138
- ${_t}
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>`},hv=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},fv=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},pv=e=>{const t=e.fgColor,n=e.bgColor;return`
151
- ${_t}
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>`},gv=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},mv=e=>{const t=e.fgColor,n=e.bgColor;return`
158
- ${_t}
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>`},vv=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},bv=e=>{const t=e.fgColor,n=e.bgColor;return`${_t}
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>`},wv=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>`},yv=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
- `},xv={headerRowID:X0,headerNumber:K0,headerCode:q0,headerString:Z0,headerBoolean:Y0,headerAudioUri:J0,headerVideoUri:ev,headerEmoji:tv,headerImage:nv,headerUri:uh,headerPhone:rv,headerMarkdown:ov,headerDate:iv,headerTime:av,headerEmail:lv,headerReference:sv,headerIfThenElse:cv,headerSingleValue:uv,headerLookup:dv,headerTextTemplate:hv,headerMath:fv,headerRollup:pv,headerJoinStrings:gv,headerSplitString:mv,headerGeoDistance:vv,headerArray:bv,rowOwnerOverlay:wv,protectedColumnOverlay:yv,renameIcon:Q0};function Cv(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class kv{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[c,u]=Cv(n,l),h=a*Math.ceil(window.devicePixelRatio),g=`${c}_${u}_${h}_${t}`;let f=this.spriteMap.get(g);if(f===void 0){const p=this.headerIcons[t];if(p===void 0)return;f=document.createElement("canvas");const m=f.getContext("2d");if(m===null)return;const w=new Image;w.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p({fgColor:u,bgColor:c}))}`,this.spriteMap.set(g,f);const y=w.decode();if(y===void 0)return;this.inFlight++,y.then(()=>{m.drawImage(w,0,0,h,h)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(r.globalAlpha=s),r.drawImage(f,0,0,h,h,o,i,a,a),s<1&&(r.globalAlpha=1)}}function dh(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 c=t,u=e;const h=r-i;let g=!1;for(;c<n&&u<h;){const f=o(u);if(c+f>l&&s(c,u,f,!1,a&&u===r-1)===!0){g=!0;break}c+=f,u++}if(!g){c=n;for(let f=0;f<i;f++){u=r-1-f;const p=o(u);c-=p,s(c,u,p,!0,a&&u===r-1)}}}function Pr(e,t,n,r,o,i){let a=0,l=0;const s=o+r;for(const c of e){const u=c.sticky?l:a+n;if(i(c,u,s,c.sticky?0:l,t)===!0)break;a+=c.width,l+=c.sticky?c.width:0}}function hh(e,t,n,r,o){let i=0,a=0;for(let l=0;l<e.length;l++){const s=e[l];let c=l+1,u=s.width;for(s.sticky&&(a+=u);c<e.length&&wi(e[c].group,s.group)&&e[c].sticky===e[l].sticky;){const m=e[c];u+=m.width,c++,l++,m.sticky&&(a+=m.width)}const h=s.sticky?0:n,g=i+h,f=s.sticky?0:Math.max(0,a-g),p=Math.min(u-f,t-(g+f));o([s.sourceIndex,e[c-1].sourceIndex],s.group??"",g+f,0,p,r),i+=u}}function fh(e,t,n,r,o,i,a){const[l,s]=e;let c,u;const h=a.find(g=>!g.sticky)?.sourceIndex??0;if(s>h){const g=Math.max(l,h);let f=t,p=r;for(let m=i.sourceIndex-1;m>=g;m--)f-=a[m].width,p+=a[m].width;for(let m=i.sourceIndex+1;m<=s;m++)p+=a[m].width;u={x:f,y:n,width:p,height:o}}if(h>l){const g=Math.min(s,h-1);let f=t,p=r;for(let m=i.sourceIndex-1;m>=l;m--)f-=a[m].width,p+=a[m].width;for(let m=i.sourceIndex+1;m<=g;m++)p+=a[m].width;c={x:f,y:n,width:p,height:o}}return[c,u]}function Sv(e,t,n,r){if(r==="any")return ph(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),Yd([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 ph(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 Mv(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 Iv(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,c=e.x+e.width-a,u=i-e.y,h=e.y+e.height-l,g=s>0?e.x+Math.floor(s/r)*r:e.x,f=c>0?e.x+e.width-Math.floor(c/r)*r:e.x+e.width,p=u>0?e.y+Math.floor(u/r)*r:e.y,m=h>0?e.y+e.height-Math.floor(h/r)*r:e.y+e.height;return{x:g,y:p,width:f-g,height:m-p}}function Rv(e,t,n,r,o){const[i,a,l,s]=t,[c,u,h,g]=o,{x:f,y:p,width:m,height:w}=e,y=[];if(m<=0||w<=0)return y;const v=f+m,C=p+w,R=f<i,E=p<a,M=f+m>l,H=p+w>s,S=f>=i&&f<l||v>i&&v<=l||f<i&&v>l,x=p>=a&&p<s||C>a&&C<=s||p<a&&C>s;if(S&&x){const L=Math.max(f,i),T=Math.max(p,a),I=Math.min(v,l),O=Math.min(C,s);y.push({rect:{x:L,y:T,width:I-L,height:O-T},clip:{x:c,y:u,width:h-c+1,height:g-u+1}})}if(R&&E){const L=f,T=p,I=Math.min(v,i),O=Math.min(C,a);y.push({rect:{x:L,y:T,width:I-L,height:O-T},clip:{x:0,y:0,width:c+1,height:u+1}})}if(E&&S){const L=Math.max(f,i),T=p,I=Math.min(v,l),O=Math.min(C,a);y.push({rect:{x:L,y:T,width:I-L,height:O-T},clip:{x:c,y:0,width:h-c+1,height:u+1}})}if(E&&M){const L=Math.max(f,l),T=p,I=v,O=Math.min(C,a);y.push({rect:{x:L,y:T,width:I-L,height:O-T},clip:{x:h,y:0,width:n-h+1,height:u+1}})}if(R&&x){const L=f,T=Math.max(p,a),I=Math.min(v,i),O=Math.min(C,s);y.push({rect:{x:L,y:T,width:I-L,height:O-T},clip:{x:0,y:u,width:c+1,height:g-u+1}})}if(M&&x){const L=Math.max(f,l),T=Math.max(p,a),I=v,O=Math.min(C,s);y.push({rect:{x:L,y:T,width:I-L,height:O-T},clip:{x:h,y:u,width:n-h+1,height:g-u+1}})}if(R&&H){const L=f,T=Math.max(p,s),I=Math.min(v,i),O=C;y.push({rect:{x:L,y:T,width:I-L,height:O-T},clip:{x:0,y:g,width:c+1,height:r-g+1}})}if(H&&S){const L=Math.max(f,i),T=Math.max(p,s),I=Math.min(v,l),O=C;y.push({rect:{x:L,y:T,width:I-L,height:O-T},clip:{x:c,y:g,width:h-c+1,height:r-g+1}})}if(M&&H){const L=Math.max(f,l),T=Math.max(p,s),I=v,O=C;y.push({rect:{x:L,y:T,width:I-L,height:O-T},clip:{x:h,y:g,width:n-h+1,height:r-g+1}})}return y}const Ev={kind:Z.Loading,allowOverlay:!1};function tu(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y,v,C,R,E,M,H,S,x,L,T,I,O,D,k,Q,N,Y){let ae=C?.size??Number.MAX_SAFE_INTEGER;const ee=performance.now();let K=O.baseFontFull;e.font=K;const pe={ctx:e},oe=[0,0],de=w>0?to(s,w,c):0;let he,se;const z=dh(v);return Pr(t,l,i,a,o,(P,G,le,ce,we)=>{const ge=Math.max(0,ce-G),Qe=G+ge,Se=o+1,Dt=P.width-ge,bt=r-o-1;if(v.length>0){let Oe=!1;for(let Pe=0;Pe<v.length;Pe++){const it=v[Pe];if(yi(Qe,Se,Dt,bt,it.x,it.y,it.width,it.height)){Oe=!0;break}}if(!Oe)return}const Te=()=>{e.save(),e.beginPath(),e.rect(Qe,Se,Dt,bt),e.clip()},re=R.columns.hasIndex(P.sourceIndex),me=h(P.group??"").overrideTheme,ye=P.themeOverride===void 0&&me===void 0?O:mr(O,me,P.themeOverride),ne=ye.baseFontFull;ne!==K&&(K=ne,e.font=ne),Te();let be;return La(we,le,r,s,c,w,y,z,(Oe,Pe,it,Ae,Ze)=>{if(Pe<0||(oe[0]=P.sourceIndex,oe[1]=Pe,C!==void 0&&!C.has(oe)))return;if(v.length>0){let Re=!1;for(let dt=0;dt<v.length;dt++){const At=v[dt];if(yi(G,Oe,P.width,it,At.x,At.y,At.width,At.height)){Re=!0;break}}if(!Re)return}const Ie=R.rows.hasIndex(Pe),Me=f.hasIndex(Pe),ze=Pe<s?u(oe):Ev;let ct=G,Je=P.width,We=!1,ht=!1;if(ze.span!==void 0){const[Re,dt]=ze.span,At=`${Pe},${Re},${dt},${P.sticky}`;if(se===void 0&&(se=new Set),se.has(At)){ae--;return}else{const dn=fh(ze.span,G,Oe,P.width,it,P,n),$t=P.sticky?dn[0]:dn[1];if(!P.sticky&&dn[0]!==void 0&&(ht=!0),$t!==void 0){ct=$t.x,Je=$t.width,se.add(At),e.restore(),be=void 0,e.save(),e.beginPath();const rn=Math.max(0,ce-$t.x);e.rect($t.x+rn,Oe,$t.width-rn,it),he===void 0&&(he=[]),he.push({x:$t.x+rn,y:Oe,width:$t.width-rn,height:it}),e.clip(),We=!0}}}const Wt=g?.(Pe),Et=Ze&&P.trailingRowOptions?.themeOverride!==void 0?P.trailingRowOptions?.themeOverride:void 0,ut=ze.themeOverride===void 0&&Wt===void 0&&Et===void 0?ye:mr(ye,Wt,Et,ze.themeOverride);e.beginPath();const qt=x0(oe,ze,R);let Kt=C0(oe,ze,R,m);const On=ze.span!==void 0&&R.columns.some(Re=>ze.span!==void 0&&Re>=ze.span[0]&&Re<=ze.span[1]);qt&&!p&&m?Kt=0:qt&&m&&(Kt=Math.max(Kt,1)),On&&Kt++,qt||(Ie&&Kt++,re&&!Ze&&Kt++);const St=ze.kind===Z.Protected?ut.bgCellMedium:ut.bgCell;let ft;if((Ae||St!==O.bgCell)&&(ft=zn(St,ft)),Kt>0||Me){Me&&(ft=zn(ut.bgHeader,ft));for(let Re=0;Re<Kt;Re++)ft=zn(ut.accentLight,ft)}else if(E!==void 0){for(const Re of E)if(Re[0]===P.sourceIndex&&Re[1]===Pe){ft=zn(ut.bgSearchResult,ft);break}}if(M!==void 0)for(let Re=0;Re<M.length;Re++){const dt=M[Re],At=dt.range;dt.style!=="solid-outline"&&At.x<=P.sourceIndex&&P.sourceIndex<At.x+At.width&&At.y<=Pe&&Pe<At.y+At.height&&(ft=zn(dt.color,ft))}let Dn=!1;if(C!==void 0){const Re=Oe+1,dt=(Ae?Re+it-1:Math.min(Re+it-1,r-de))-Re;(dt!==it-1||ct+1<=ce)&&(Dn=!0,e.save(),e.beginPath(),e.rect(ct+1,Re,Je-1,dt),e.clip()),ft=ft===void 0?ut.bgCell:zn(ft,ut.bgCell)}const wt=P.sourceIndex===n.length-1,cn=Pe===s-1;ft!==void 0&&(e.fillStyle=ft,be!==void 0&&(be.fillStyle=ft),C!==void 0?e.fillRect(ct+1,Oe+1,Je-(wt?2:1),it-(cn?2:1)):e.fillRect(ct,Oe,Je,it)),ze.style==="faded"&&(e.globalAlpha=.6);let pn;for(let Re=0;Re<x.length;Re++){const dt=x[Re];if(dt.item[0]===P.sourceIndex&&dt.item[1]===Pe){pn=dt;break}}if(Je>Y&&!ht){const Re=ut.baseFontFull;Re!==K&&(e.font=Re,K=Re),be=gh(e,ze,P.sourceIndex,Pe,wt,cn,ct,Oe,Je,it,Kt>0,ut,ft??ut.bgCell,H,S,pn?.hoverAmount??0,L,I,ee,T,be,D,k,Q,N)}return Dn&&e.restore(),ze.style==="faded"&&(e.globalAlpha=1),ae--,We&&(e.restore(),be?.deprep?.(pe),be=void 0,Te(),K=ne,e.font=ne),ae<=0}),e.restore(),ae<=0}),he}const ri=[0,0],oi={x:0,y:0,width:0,height:0},wl=[void 0,()=>{}];let Ul=!1;function Tv(){Ul=!0}function gh(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y,v,C,R,E,M,H,S){let x,L;w!==void 0&&w[0][0]===n&&w[0][1]===r&&(x=w[1][0],L=w[1][1]);let T;ri[0]=n,ri[1]=r,oi.x=a,oi.y=l,oi.width=s,oi.height=c,wl[0]=M.getValue(ri),wl[1]=k=>M.setValue(ri,k),Ul=!1;const I={ctx:e,theme:h,col:n,row:r,cell:t,rect:oi,highlighted:u,cellFillColor:g,hoverAmount:m,frameTime:v,hoverX:x,drawState:wl,hoverY:L,imageLoader:f,spriteManager:p,hyperWrapping:y,overrideCursor:x!==void 0?S:void 0,requestAnimationFrame:Tv},O=E0(I,t.lastUpdated,v,R,o,i),D=H(t);if(D!==void 0){R?.renderer!==D&&(R?.deprep?.(I),R=void 0);const k=D.drawPrep?.(I,R);C!==void 0&&!Io(I.cell)?C(I,()=>D.draw(I,t)):D.draw(I,t),T=k===void 0?void 0:{deprep:k?.deprep,fillStyle:k?.fillStyle,font:k?.font,renderer:D}}return(O||Ul)&&E?.(ri),T}function Cs(e,t,n,r,o,i,a,l,s=-20,c=-20,u=void 0,h="center",g="square"){const f=Math.floor(o+a/2),p=g==="circle"?1e4:t.roundingRadius??4;let m=_d(u??t.checkboxMaxSize,a,t.cellVerticalPadding),w=m/2;const y=zd(h,r,i,t.cellHorizontalPadding,m),v=Fd(y,f,m),C=$d(r+s,o+c,v);switch(n){case!0:{e.beginPath(),Yn(e,y-m/2,f-m/2,m,m,p),g==="circle"&&(w*=.8,m*=.8),e.fillStyle=l?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(y-w+m/4.23,f-w+m/1.97),e.lineTo(y-w+m/2.42,f-w+m/1.44),e.lineTo(y-w+m/1.29,f-w+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case pa:case!1:{e.beginPath(),Yn(e,y-m/2+.5,f-m/2+.5,m-1,m-1,p),e.lineWidth=1,e.strokeStyle=C?t.textDark:t.textMedium,e.stroke();break}case is:{e.beginPath(),Yn(e,y-m/2,f-m/2,m,m,p),e.fillStyle=C?t.textMedium:t.textLight,e.fill(),g==="circle"&&(w*=.8,m*=.8),e.beginPath(),e.moveTo(y-m/3,f),e.lineTo(y+m/3,f),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:vi()}}function Ov(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y,v){const C=a+l;if(C<=0)return;e.fillStyle=h.bgHeader,e.fillRect(0,0,o,C);const R=r?.[0]?.[0],E=r?.[0]?.[1],M=r?.[1]?.[0],H=r?.[1]?.[1],S=h.headerFontFull;e.font=S,Pr(t,0,i,0,C,(x,L,T,I)=>{if(w!==void 0&&!w.has([x.sourceIndex,-1]))return;const O=Math.max(0,I-L);e.save(),e.beginPath(),e.rect(L+O,l,x.width-O,a),e.clip();const D=m(x.group??"").overrideTheme,k=x.themeOverride===void 0&&D===void 0?h:mr(h,D,x.themeOverride);k.bgHeader!==h.bgHeader&&(e.fillStyle=k.bgHeader,e.fill()),k!==h&&(e.font=k.headerFontFull);const Q=u.columns.hasIndex(x.sourceIndex),N=s!==void 0||c||x.headerRowMarkerDisabled===!0,Y=!N&&E===-1&&R===x.sourceIndex,ae=N?0:f.find(de=>de.item[0]===x.sourceIndex&&de.item[1]===-1)?.hoverAmount??0,ee=u?.current!==void 0&&u.current.cell[0]===x.sourceIndex,K=Q?k.accentColor:ee?k.bgHeaderHasFocus:k.bgHeader,pe=n?l:0,oe=x.sourceIndex===0?0:1;Q?(e.fillStyle=K,e.fillRect(L+oe,pe,x.width-oe,a)):(ee||ae>0)&&(e.beginPath(),e.rect(L+oe,pe,x.width-oe,a),ee&&(e.fillStyle=k.bgHeaderHasFocus,e.fill()),ae>0&&(e.globalAlpha=ae,e.fillStyle=k.bgHeaderHovered,e.fill(),e.globalAlpha=1)),bh(e,L,pe,x.width,a,x,Q,k,Y,Y?M:void 0,Y?H:void 0,ee,ae,g,y,v),e.restore()}),n&&Dv(e,t,o,i,l,r,h,g,f,p,m,w)}function Dv(e,t,n,r,o,i,a,l,s,c,u,h){const[g,f]=i?.[0]??[];let p=0;hh(t,n,r,o,(m,w,y,v,C,R)=>{if(h!==void 0&&!h.hasItemInRectangle({x:m[0],y:-2,width:m[1]-m[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(y,v,C,R),e.clip();const E=u(w),M=E?.overrideTheme===void 0?a:mr(a,E.overrideTheme),H=f===-2&&g!==void 0&&g>=m[0]&&g<=m[1],S=H?M.bgGroupHeaderHovered??M.bgHeaderHovered:M.bgGroupHeader??M.bgHeader;if(S!==a.bgHeader&&(e.fillStyle=S,e.fill()),e.fillStyle=M.textGroupHeader??M.textHeader,E!==void 0){let x=y;if(E.icon!==void 0&&(l.drawSprite(E.icon,"normal",e,x+8,(o-20)/2,20,M),x+=26),e.fillText(E.name,x+8,o/2+Jn(e,a.headerFontFull)),E.actions!==void 0&&H){const L=mh({x:y,y:v,width:C,height:R},E.actions);e.beginPath();const T=L[0].x-10,I=y+C-T;e.rect(T,0,I,o);const O=e.createLinearGradient(T,0,T+I,0),D=Yr(S,0);O.addColorStop(0,D),O.addColorStop(10/I,S),O.addColorStop(1,S),e.fillStyle=O,e.fill(),e.globalAlpha=.6;const[k,Q]=i?.[1]??[-1,-1];for(let N=0;N<E.actions.length;N++){const Y=E.actions[N],ae=L[N],ee=Kr(ae,k+y,Q);ee&&(e.globalAlpha=1),l.drawSprite(Y.icon,"normal",e,ae.x+ae.width/2-10,ae.y+ae.height/2-10,20,M),ee&&(e.globalAlpha=.6)}e.globalAlpha=1}}y!==0&&c(m[0])&&(e.beginPath(),e.moveTo(y+.5,0),e.lineTo(y+.5,o),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=y+C}),e.beginPath(),e.moveTo(p+.5,0),e.lineTo(p+.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 Pv(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 mh(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 vh(e,t,n,r,o,i,a,l){const s=a.cellHorizontalPadding,c=a.headerIconSize,u=Pv(n,r,o,i);let h=n+s;const g=t.icon===void 0?void 0:{x:h,y:r+(i-c)/2,width:c,height:c},f=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(h+=Math.ceil(c*1.3));const p={x:h,y:r,width:o-h,height:i};let m;if(t.indicatorIcon!==void 0){const y=e===void 0?th(t.title,a.headerFontFull)?.width??0:Dr(t.title,e,a.headerFontFull).width;p.width=y,h+=y+s,m={x:h,y:r+(i-c)/2,width:c,height:c}}const w=n+o/2;return{menuBounds:ii(u,w,l),iconBounds:ii(g,w,l),iconOverlayBounds:ii(f,w,l),textBounds:ii(p,w,l),indicatorIconBounds:ii(m,w,l)}}function nu(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m){if(i.rowMarker!==void 0&&i.headerRowMarkerDisabled!==!0){const v=i.rowMarkerChecked;v!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=h);const C=i.headerRowMarkerTheme!==void 0?mr(l,i.headerRowMarkerTheme):l;Cs(e,C,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 w=a?l.textHeaderSelected:l.textHeader,y=i.hasMenu===!0&&(s||f&&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(y&&r>35){const v=p?35:r-35,C=p?35*.7:r-35*.7,R=v/r,E=C/r,M=e.createLinearGradient(t,0,t+r,0),H=Yr(w,0);M.addColorStop(p?1:0,w),M.addColorStop(R,w),M.addColorStop(E,H),M.addColorStop(p?0:1,H),e.fillStyle=M}else e.fillStyle=w;if(p&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(i.title,p?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+o/2+Jn(e,l.headerFontFull)),p&&(e.textAlign="left"),i.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!y||!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(y&&m.menuBounds!==void 0){const v=m.menuBounds,C=c!==void 0&&u!==void 0&&Kr(v,c+t,u+n);if(C||(e.globalAlpha=.7),i.menuIcon===void 0||i.menuIcon===ga.Triangle){e.beginPath();const R=v.x+v.width/2-5.5,E=v.y+v.height/2-3;P0(e,[{x:R,y:E},{x:R+11,y:E},{x:R+5.5,y:E+6}],1),e.fillStyle=w,e.fill()}else if(i.menuIcon===ga.Dots){e.beginPath();const R=v.x+v.width/2,E=v.y+v.height/2;D0(e,R,E),e.fillStyle=w,e.fill()}else{const R=v.x+(v.width-l.headerIconSize)/2,E=v.y+(v.height-l.headerIconSize)/2;g.drawSprite(i.menuIcon,"normal",e,R,E,l.headerIconSize,l)}C||(e.globalAlpha=1)}}function bh(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m){const w=cs(i.title)==="rtl",y=vh(e,i,t,n,r,o,l,w);p!==void 0?p({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:h,spriteManager:f,menuBounds:y?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:c,hoverY:u},()=>nu(e,t,n,r,o,i,a,l,s,c,u,g,f,m,w,y)):nu(e,t,n,r,o,i,a,l,s,c,u,g,f,m,w,y)}function Hv(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y,v){if(y!==void 0||t[t.length-1]!==n[t.length-1])return;const C=dh(w);Pr(t,s,a,l,i,(R,E,M,H,S)=>{if(R!==t[t.length-1])return;E+=R.width;const x=Math.max(E,H);x>r||(e.save(),e.beginPath(),e.rect(x,i+1,1e4,o-i-1),e.clip(),La(S,M,o,c,u,p,m,C,(L,T,I,O)=>{if(!O&&w.length>0&&!w.some(Y=>yi(E,L,1e4,I,Y.x,Y.y,Y.width,Y.height)))return;const D=g.hasIndex(T),k=f.hasIndex(T);e.beginPath();const Q=h?.(T),N=Q===void 0?v:mr(v,Q);N.bgCell!==v.bgCell&&(e.fillStyle=N.bgCell,e.fillRect(E,L,1e4,I)),k&&(e.fillStyle=N.bgHeader,e.fillRect(E,L,1e4,I)),D&&(e.fillStyle=N.accentLight,e.fillRect(E,L,1e4,I))}),e.restore())})}function Lv(e,t,n,r,o,i,a,l,s){let c=!1;for(const p of t)if(!p.sticky){c=a(p.sourceIndex);break}const u=s.horizontalBorderColor??s.borderColor,h=s.borderColor,g=c?Po(t):0;let f;if(g!==0&&(f=jc(h,s.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=f,e.stroke()),o>0){const p=h===u&&f!==void 0?f:jc(u,s.bgCell),m=to(i,o,l);e.beginPath(),e.moveTo(0,r-m+.5),e.lineTo(n,r-m+.5),e.strokeStyle=p,e.stroke()}}const wh=(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 Av(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p){const m=p.bgCell,{minX:w,maxX:y,minY:v,maxY:C}=wh(l,i,a),R=[],E=a-to(f,g,c);let M=s,H=n,S=0;for(;M+o<E;){const I=M+o,O=c(H);if(I>=v&&I<=C-1){const D=u?.(H)?.bgCell;D!==void 0&&D!==m&&H>=f-g&&R.push({x:w,y:I,w:y-w,h:O,color:D})}M+=O,H<f-g&&(S=M),H++}let x=0;const L=Math.min(E,C)-S;if(L>0)for(let I=0;I<t.length;I++){const O=t[I];if(O.width===0)continue;const D=O.sticky?x:x+r,k=O.themeOverride?.bgCell;k!==void 0&&k!==m&&D>=w&&D<=y&&h(I+1)&&R.push({x:D,y:S,w:O.width,h:L,color:k}),x+=O.width}if(R.length===0)return;let T;e.beginPath();for(let I=R.length-1;I>=0;I--){const O=R[I];T===void 0?T=O.color:O.color!==T&&(e.fillStyle=T,e.fill(),e.beginPath(),T=O.color),e.rect(O.x,O.y,O.w,O.h)}T!==void 0&&(e.fillStyle=T,e.fill()),e.beginPath()}function ru(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,a);for(const I of s)e.rect(I.x+1,I.y+1,I.width-1,I.height-1);e.clip("evenodd")}const v=w.horizontalBorderColor??w.borderColor,C=w.borderColor,{minX:R,maxX:E,minY:M,maxY:H}=wh(l,i,a),S=[];e.beginPath();let x=.5;for(let I=0;I<t.length;I++){const O=t[I];if(O.width===0)continue;x+=O.width;const D=O.sticky?x:x+r;D>=R&&D<=E&&f(I+1)&&S.push({x1:D,y1:Math.max(c,M),x2:D,y2:Math.min(a,H),color:C})}let L=a+.5;for(let I=m-p;I<m;I++){const O=h(I);L-=O,S.push({x1:R,y1:L,x2:E,y2:L,color:v})}if(y!==!0){let I=u+.5,O=n;const D=L;for(;I+o<D;){const k=I+o;if(k>=M&&k<=H-1){const Q=g?.(O);S.push({x1:R,y1:k,x2:E,y2:k,color:Q?.horizontalBorderColor??Q?.borderColor??v})}I+=h(O),O++}}const T=Kp(S,I=>I.color);for(const I of Object.keys(T)){e.strokeStyle=I;for(const O of T[I])e.moveTo(O.x1,O.y1),e.lineTo(O.x2,O.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function Fv(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w,y,v){const C=[];e.imageSmoothingEnabled=!1;const R=Math.min(o.cellYOffset,a),E=Math.max(o.cellYOffset,a);let M=0;if(typeof y=="number")M+=(E-R)*y;else for(let D=R;D<E;D++)M+=y(D);a>o.cellYOffset&&(M=-M),M+=s-o.translateY;const H=Math.min(o.cellXOffset,i),S=Math.max(o.cellXOffset,i);let x=0;for(let D=H;D<S;D++)x+=m[D].width;i>o.cellXOffset&&(x=-x),x+=l-o.translateX;const L=Po(w);if(x!==0&&M!==0)return{regions:[]};const T=c>0?to(g,c,y):0,I=u-L-Math.abs(x),O=h-f-T-Math.abs(M)-1;if(I>150&&O>150){const D={sx:0,sy:0,sw:u*p,sh:h*p,dx:0,dy:0,dw:u*p,dh:h*p};if(M>0?(D.sy=(f+1)*p,D.sh=O*p,D.dy=(M+f+1)*p,D.dh=O*p,C.push({x:0,y:f,width:u,height:M+1})):M<0&&(D.sy=(-M+f+1)*p,D.sh=O*p,D.dy=(f+1)*p,D.dh=O*p,C.push({x:0,y:h+M-T,width:u,height:-M+T})),x>0?(D.sx=L*p,D.sw=I*p,D.dx=(x+L)*p,D.dw=I*p,C.push({x:L-1,y:0,width:x+2,height:h})):x<0&&(D.sx=(L-x)*p,D.sw=I*p,D.dx=L*p,D.dw=I*p,C.push({x:u+x,y:0,width:-x,height:h})),e.setTransform(1,0,0,1,0,0),v){if(L>0&&x!==0&&M===0&&(r===void 0||n?.[1]!==!1)){const k=L*p,Q=h*p;e.drawImage(t,0,0,k,Q,0,0,k,Q)}if(T>0&&x===0&&M!==0&&(r===void 0||n?.[0]!==!1)){const k=(h-T)*p,Q=u*p,N=T*p;e.drawImage(t,0,k,Q,N,0,k,Q,N)}}e.drawImage(t,D.sx,D.sy,D.sw,D.sh,D.dx,D.dy,D.dw,D.dh),e.scale(p,p)}return e.imageSmoothingEnabled=!0,{regions:C}}function zv(e,t,n,r,o,i,a,l,s,c){const u=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||o!==e.translateY||Pr(s,n,r,o,l,(h,g,f,p)=>{if(h.sourceIndex===c){const m=Math.max(g,p)+1;return u.push({x:m,y:0,width:i-m,height:a}),!0}}),u}function _v(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,...c}=i;if(!Do(l,c))return!1;n=r}return n===void 0?!0:n}return!0}function ou(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m){const w=p?.filter(H=>H.style!=="no-outline");if(w===void 0||w.length===0)return;const y=Po(l),v=to(f,g,h),C=[s,0,l.length,f-g],R=[y,0,t,n-v],E=w.map(H=>{const S=H.range,x=H.style??"dashed";return Rv(S,C,t,n,R).map(L=>{const T=L.rect,I=jl(T.x,T.y,t,n,u,c+u,r,o,i,a,f,s,g,l,h),O=T.width===1&&T.height===1?I:jl(T.x+T.width-1,T.y+T.height-1,t,n,u,c+u,r,o,i,a,f,s,g,l,h);return T.x+T.width>=l.length&&(O.width-=1),T.y+T.height>=f&&(O.height-=1),{color:H.color,style:x,clip:L.clip,rect:Iv({x:I.x,y:I.y,width:O.x+O.width-I.x,height:O.y+O.height-I.y},t,n,8)}})}),M=()=>{e.lineWidth=1;let H=!1;for(const S of E)for(const x of S)if(x?.rect!==void 0&&yi(0,0,t,n,x.rect.x,x.rect.y,x.rect.width,x.rect.height)){const L=H,T=!Mv(x.clip,x.rect);e.beginPath(),T&&(e.save(),e.rect(x.clip.x,x.clip.y,x.clip.width,x.clip.height),e.clip()),x.style==="dashed"&&!H?(e.setLineDash([5,3]),H=!0):(x.style==="solid"||x.style==="solid-outline")&&H&&(e.setLineDash([]),H=!1),e.strokeStyle=x.style==="solid-outline"?zn(zn(x.color,m.borderColor),m.bgCell):Yr(x.color,1),e.closePath(),e.strokeRect(x.rect.x+.5,x.rect.y+.5,x.rect.width-1,x.rect.height-1),T&&(e.restore(),H=L)}H&&e.setLineDash([])};return M(),M}function iu(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 yl(e,t,n,r,o,i,a,l,s,c,u,h,g,f,p,m,w){if(u.current===void 0)return;const y=m!==!1&&m!==void 0;if(!y)return;const v=typeof m=="object"?{...ma,...m}:ma,C=u.current.range,R=u.current.cell,E=[C.x+C.width-1,C.y+C.height-1];if(R[1]>=w&&E[1]>=w||!a.some(k=>k.sourceIndex===R[0]||k.sourceIndex===E[0]))return;const[M,H]=u.current.cell,S=g(u.current.cell),x=S.span??[M,M],L=H>=w-f,T=f>0&&!L?to(w,f,h)-1:0,I=E[1];let O;if(Pr(a,r,o,i,c,(k,Q,N,Y,ae)=>{if(k.sticky&&M>k.sourceIndex)return;const ee=k.sourceIndex<x[0],K=k.sourceIndex>x[1],pe=k.sourceIndex===E[0];if(!(!pe&&(ee||K)))return La(ae,N,n,w,h,f,p,void 0,(oe,de,he)=>{if(de!==H&&de!==I)return;let se=Q,z=k.width;if(S.span!==void 0){const P=fh(S.span,Q,oe,k.width,he,k,l),G=k.sticky?P[0]:P[1];G!==void 0&&(se=G.x,z=G.width)}return de===I&&pe&&y&&(O=()=>{Y>se&&!k.sticky&&(e.beginPath(),e.rect(Y,0,t-Y,n),e.clip());const P=v.size,G=P/2,le=se+z+v.offsetX-G+.5,ce=oe+he+v.offsetY-G+.5;e.beginPath(),v.shape==="circle"?e.arc(le+G,ce+G,G,0,Math.PI*2):e.rect(le,ce,P,P),e.fillStyle=k.themeOverride?.accentColor??s.accentColor,e.fill(),v.outline>0&&(e.lineWidth=v.outline,e.strokeStyle=s.bgCell,v.shape==="circle"?(e.beginPath(),e.arc(le+G,ce+G,G+v.outline/2,0,Math.PI*2),e.stroke()):e.strokeRect(le-v.outline/2,ce-v.outline/2,P+v.outline,P+v.outline))}),O!==void 0}),O!==void 0}),O===void 0)return;const D=()=>{e.save(),e.beginPath(),e.rect(0,c,t,n-c-T),e.clip(),O?.(),e.restore()};return D(),D}function $v(e,t,n,r,o,i,a,l,s){s===void 0||s.size===0||(e.beginPath(),hh(t,n,i,r,(c,u,h,g,f,p)=>{s.hasItemInRectangle({x:c[0],y:-2,width:c[1]-c[0]+1,height:1})&&e.rect(h,g,f,p)}),Pr(t,l,i,a,o,(c,u,h,g)=>{const f=Math.max(0,g-u),p=u+f+1,m=c.width-f-1;s.has([c.sourceIndex,-1])&&e.rect(p,r,m,o-r)}),e.clip())}function Vv(e,t,n,r,o,i,a,l,s,c){let u=0;return Pr(e,i,r,o,n,(h,g,f,p,m)=>(La(m,f,t,a,l,s,c,void 0,(w,y,v,C)=>{C||(u=Math.max(y,u))}),!0)),u}function au(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:o,height:i,cellXOffset:a,cellYOffset:l,translateX:s,translateY:c,mappedColumns:u,enableGroups:h,freezeColumns:g,dragAndDropState:f,theme:p,drawFocus:m,headerHeight:w,groupHeaderHeight:y,disabledRows:v,rowHeight:C,verticalBorder:R,overrideCursor:E,isResizing:M,selection:H,fillHandle:S,freezeTrailingRows:x,rows:L,getCellContent:T,getGroupDetails:I,getRowThemeOverride:O,isFocused:D,drawHeaderCallback:k,prelightCells:Q,drawCellCallback:N,highlightRegions:Y,resizeCol:ae,imageLoader:ee,lastBlitData:K,hoverValues:pe,hyperWrapping:oe,hoverInfo:de,spriteManager:he,maxScaleFactor:se,hasAppendRow:z,touchMode:P,enqueue:G,renderStateProvider:le,getCellRenderer:ce,renderStrategy:we,bufferACtx:ge,bufferBCtx:Qe,damage:Se,minimumCellWidth:Dt,resizeIndicator:bt}=e;if(o===0||i===0)return;const Te=we==="double-buffer",re=Math.min(se,Math.ceil(window.devicePixelRatio??1)),me=we!=="direct"&&_v(e,t),ye=n.canvas;(ye.width!==o*re||ye.height!==i*re)&&(ye.width=o*re,ye.height=i*re,ye.style.width=o+"px",ye.style.height=i+"px");const ne=r.canvas,be=h?y+w:w,Oe=be+1;(ne.width!==o*re||ne.height!==Oe*re)&&(ne.width=o*re,ne.height=Oe*re,ne.style.width=o+"px",ne.style.height=Oe+"px");const Pe=ge.canvas,it=Qe.canvas;Te&&(Pe.width!==o*re||Pe.height!==i*re)&&(Pe.width=o*re,Pe.height=i*re,K.current!==void 0&&(K.current.aBufferScroll=void 0)),Te&&(it.width!==o*re||it.height!==i*re)&&(it.width=o*re,it.height=i*re,K.current!==void 0&&(K.current.bBufferScroll=void 0));const Ae=K.current;if(me===!0&&a===Ae?.cellXOffset&&l===Ae?.cellYOffset&&s===Ae?.translateX&&c===Ae?.translateY)return;let Ze=null;Te&&(Ze=n);const Ie=r;let Me;Te?Se!==void 0?Me=Ae?.lastBuffer==="b"?Qe:ge:Me=Ae?.lastBuffer==="b"?ge:Qe:Me=n;const ze=Me.canvas,ct=Te?ze===Pe?it:Pe:ye,Je=typeof C=="number"?()=>C:C;Ie.save(),Me.save(),Ie.beginPath(),Me.beginPath(),Ie.textBaseline="middle",Me.textBaseline="middle",re!==1&&(Ie.scale(re,re),Me.scale(re,re));const We=Wl(u,a,o,f,s);let ht=[];const Wt=m&&H.current?.cell[1]===l&&c===0;let Et=!1;if(Y!==void 0){for(const wt of Y)if(wt.style!=="no-outline"&&wt.range.y===l&&c===0){Et=!0;break}}const ut=()=>{Ov(Ie,We,h,de,o,s,w,y,f,M,H,p,he,pe,R,I,Se,k,P),ru(Ie,We,l,s,c,o,i,void 0,void 0,y,be,Je,O,R,x,L,p,!0),Ie.beginPath(),Ie.moveTo(0,Oe-.5),Ie.lineTo(o,Oe-.5),Ie.strokeStyle=zn(p.headerBottomBorderColor??p.horizontalBorderColor??p.borderColor,p.bgHeader),Ie.stroke(),Et&&ou(Ie,o,i,a,l,s,c,u,g,w,y,C,x,L,Y,p),Wt&&yl(Ie,o,i,l,s,c,We,u,p,be,H,Je,T,x,z,S,L)};if(Se!==void 0){const wt=We[We.length-1].sourceIndex+1,cn=Se.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:L-x,width:wt,height:x,when:x>0}]),pn=Re=>{tu(Re,We,u,i,be,s,c,l,L,Je,T,I,O,v,D,m,x,z,ht,Se,H,Q,Y,ee,he,pe,de,N,oe,p,G,le,ce,E,Dt);const dt=H.current;S!==!1&&S!==void 0&&m&&dt!==void 0&&Se.has(Qd(dt.range))&&yl(Re,o,i,l,s,c,We,u,p,be,H,Je,T,x,z,S,L)};cn&&(pn(Me),Ze!==null&&(Ze.save(),Ze.scale(re,re),Ze.textBaseline="middle",pn(Ze),Ze.restore()),Se.hasHeader()&&($v(Ie,We,o,y,be,s,c,l,Se),ut())),Me.restore(),Ie.restore();return}if((me!==!0||a!==Ae?.cellXOffset||s!==Ae?.translateX||Wt!==Ae?.mustDrawFocusOnHeader||Et!==Ae?.mustDrawHighlightRingsOnHeader)&&ut(),me===!0){Fn(ct!==void 0&&Ae!==void 0);const{regions:wt}=Fv(Me,ct,ct===Pe?Ae.aBufferScroll:Ae.bBufferScroll,ct===Pe?Ae.bBufferScroll:Ae.aBufferScroll,Ae,a,l,s,c,x,o,i,L,be,re,u,We,C,Te);ht=wt}else me!==!1&&(Fn(Ae!==void 0),ht=zv(Ae,a,l,s,c,o,i,be,We,me));Lv(Me,We,o,i,x,L,R,Je,p);const qt=ou(Me,o,i,a,l,s,c,u,g,w,y,C,x,L,Y,p),Kt=m?yl(Me,o,i,l,s,c,We,u,p,be,H,Je,T,x,z,S,L):void 0;if(Me.fillStyle=p.bgCell,ht.length>0){Me.beginPath();for(const wt of ht)Me.rect(wt.x,wt.y,wt.width,wt.height);Me.clip(),Me.fill(),Me.beginPath()}else Me.fillRect(0,0,o,i);const On=tu(Me,We,u,i,be,s,c,l,L,Je,T,I,O,v,D,m,x,z,ht,Se,H,Q,Y,ee,he,pe,de,N,oe,p,G,le,ce,E,Dt);Hv(Me,We,u,o,i,be,s,c,l,L,Je,O,H.rows,v,x,z,ht,Se,p),Av(Me,We,l,s,c,o,i,ht,be,Je,O,R,x,L,p),ru(Me,We,l,s,c,o,i,ht,On,y,be,Je,O,R,x,L,p),qt?.(),Kt?.(),M&&bt!=="none"&&Pr(We,0,s,0,be,(wt,cn)=>wt.sourceIndex===ae?(iu(Ie,cn+wt.width,0,be+1,zn(p.resizeIndicatorColor??p.accentLight,p.bgHeader)),bt==="full"&&iu(Me,cn+wt.width,be,i,zn(p.resizeIndicatorColor??p.accentLight,p.bgCell)),!0):!1),Ze!==null&&(Ze.fillStyle=p.bgCell,Ze.fillRect(0,0,o,i),Ze.drawImage(Me.canvas,0,0));const St=Vv(We,i,be,s,c,l,L,Je,x,z);ee?.setWindow({x:a,y:l,width:We.length,height:St-l},g,Array.from({length:x},(wt,cn)=>L-1-cn));const ft=Ae!==void 0&&(a!==Ae.cellXOffset||s!==Ae.translateX),Dn=Ae!==void 0&&(l!==Ae.cellYOffset||c!==Ae.translateY);K.current={cellXOffset:a,cellYOffset:l,translateX:s,translateY:c,mustDrawFocusOnHeader:Wt,mustDrawHighlightRingsOnHeader:Et,lastBuffer:Te?ze===Pe?"a":"b":void 0,aBufferScroll:ze===Pe?[ft,Dn]:Ae?.aBufferScroll,bBufferScroll:ze===it?[ft,Dn]:Ae?.bBufferScroll},Me.restore(),Ie.restore()}const Bv=80;function Nv(e){const t=e-1;return t*t*t+1}class Wv{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:Nv(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const n=(t-this.lastAnimationTime)/Bv;for(const o of this.leavingItems)o.hoverAmount=Nn(o.hoverAmount-n,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Nn(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 jv{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ks(e){return new jv(e)}const Gv=ks(()=>window.navigator.userAgent.includes("Firefox")),ya=ks(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),xa=ks(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function Uv(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(xs);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 Rr="header",Kn="group-header",Ca="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 yh(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 Xv=(e,t)=>e.kind===Z.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",qv=(e,t)=>{const{width:n,height:r,accessibilityHeight:o,columns:i,cellXOffset:a,cellYOffset:l,headerHeight:s,fillHandle:c=!1,groupHeaderHeight:u,rowHeight:h,rows:g,getCellContent:f,getRowThemeOverride:p,onHeaderMenuClick:m,onHeaderIndicatorClick:w,enableGroups:y,isFilling:v,onCanvasFocused:C,onCanvasBlur:R,isFocused:E,selection:M,freezeColumns:H,onContextMenu:S,freezeTrailingRows:x,fixedShadowX:L=!0,fixedShadowY:T=!0,drawFocusRing:I,onMouseDown:O,onMouseUp:D,onMouseMoveRaw:k,onMouseMove:Q,onItemHovered:N,dragAndDropState:Y,firstColAccessible:ae,onKeyDown:ee,onKeyUp:K,highlightRegions:pe,canvasRef:oe,onDragStart:de,onDragEnd:he,eventTargetRef:se,isResizing:z,resizeColumn:P,isDragging:G,isDraggable:le=!1,allowResize:ce,disabledRows:we,hasAppendRow:ge,getGroupDetails:Qe,theme:Se,prelightCells:Dt,headerIcons:bt,verticalBorder:Te,drawCell:re,drawHeader:me,onCellFocused:ye,onDragOverCell:ne,onDrop:be,onDragLeave:Oe,imageWindowLoader:Pe,smoothScrollX:it=!1,smoothScrollY:Ae=!1,experimental:Ze,getCellRenderer:Ie,resizeIndicator:Me="full"}=e,ze=e.translateX??0,ct=e.translateY??0,Je=Math.max(H,Math.min(i.length-1,a)),We=d.useRef(null),ht=d.useRef(Ze?.eventTarget??window),Wt=ht.current,Et=Pe,ut=d.useRef(),[qt,Kt]=d.useState(!1),On=d.useRef([]),St=d.useRef(),[ft,Dn]=d.useState(),[wt,cn]=d.useState(),pn=d.useRef(null),[Re,dt]=d.useState(),[At,dn]=d.useState(!1),$t=d.useRef(At);$t.current=At;const rn=d.useMemo(()=>new kv(bt,()=>{hn.current=void 0,En.current()}),[bt]),Pn=y?u+s:s,on=d.useRef(-1),Zt=(Ze?.enableFirefoxRescaling??!1)&&Gv.value,Be=(Ze?.enableSafariRescaling??!1)&&ya.value;d.useLayoutEffect(()=>{window.devicePixelRatio===1||!Zt&&!Be||(on.current!==-1&&Kt(!0),window.clearTimeout(on.current),on.current=window.setTimeout(()=>{Kt(!1),on.current=-1},200))},[l,Je,ze,ct,Zt,Be]);const yt=w0(i,H),In=d.useMemo(()=>L?Po(yt,Y):0,[yt,Y,L]),Pt=d.useCallback(($,te,Ce)=>{const Ee=$.getBoundingClientRect();if(te>=yt.length||Ce>=g)return;const ue=Ee.width/n,fe=jl(te,Ce,n,r,u,Pn,Je,l,ze,ct,g,H,x,yt,h);return ue!==1&&(fe.x*=ue,fe.y*=ue,fe.width*=ue,fe.height*=ue),fe.x+=Ee.x,fe.y+=Ee.y,fe},[n,r,u,Pn,Je,l,ze,ct,g,H,x,yt,h]),pt=d.useCallback(($,te,Ce,Ee)=>{const ue=$.getBoundingClientRect(),fe=ue.width/n,je=(te-ue.left)/fe,ke=(Ce-ue.top)/fe,qe=5,gt=Wl(yt,Je,n,void 0,ze);let un=0,Gt=0;const xt=typeof PointerEvent<"u"&&Ee instanceof PointerEvent&&Ee.pointerType==="mouse"||typeof MouseEvent<"u"&&Ee instanceof MouseEvent,at=typeof PointerEvent<"u"&&Ee instanceof PointerEvent&&Ee.pointerType==="touch"||typeof TouchEvent<"u"&&Ee instanceof TouchEvent;xt&&(un=Ee.button,Gt=Ee.buttons);const Ge=k0(je,gt,ze),st=S0(ke,r,y,s,u,g,h,l,ct,x),Vt=Ee?.shiftKey===!0,uo=Ee?.ctrlKey===!0,zr=Ee?.metaKey===!0,Qt=[je<0?-1:n<je?1:0,ke<Pn?-1:r<ke?1:0];let ln;if(Ge===-1||ke<0||je<0||st===void 0||je>n||ke>r){const Ht=je>n?1:je<0?-1:0,Vn=ke>r?1:ke<0?-1:0;let vn=Ht*2,hr=Vn*2;Ht===0&&(vn=Ge===-1?Eo.EndPadding:Eo.Center),Vn===0&&(hr=st===void 0?Eo.EndPadding:Eo.Center);let fr=!1;if(Ge===-1&&st===-1){const Jt=Pt($,yt.length-1,-1);Fn(Jt!==void 0),fr=te<Jt.x+Jt.width+qe}const lt=je>n&&je<n+$l()||ke>r&&ke<r+$l();ln={kind:Ca,location:[Ge!==-1?Ge:je<0?0:yt.length-1,st??g-1],region:[vn,hr],shiftKey:Vt,ctrlKey:uo,metaKey:zr,isEdge:fr,isTouch:at,button:un,buttons:Gt,scrollEdge:Qt,isMaybeScrollbar:lt}}else if(st<=-1){let Ht=Pt($,Ge,st);Fn(Ht!==void 0);let Vn=Ht!==void 0&&Ht.x+Ht.width-te<=qe;const vn=Ge-1;te-Ht.x<=qe&&vn>=0?(Vn=!0,Ht=Pt($,vn,st),Fn(Ht!==void 0),ln={kind:y&&st===-2?Kn:Rr,location:[vn,st],bounds:Ht,group:yt[vn].group??"",isEdge:Vn,shiftKey:Vt,ctrlKey:uo,metaKey:zr,isTouch:at,localEventX:te-Ht.x,localEventY:Ce-Ht.y,button:un,buttons:Gt,scrollEdge:Qt}):ln={kind:y&&st===-2?Kn:Rr,group:yt[Ge].group??"",location:[Ge,st],bounds:Ht,isEdge:Vn,shiftKey:Vt,ctrlKey:uo,metaKey:zr,isTouch:at,localEventX:te-Ht.x,localEventY:Ce-Ht.y,button:un,buttons:Gt,scrollEdge:Qt}}else{const Ht=Pt($,Ge,st);Fn(Ht!==void 0);const Vn=Ht!==void 0&&Ht.x+Ht.width-te<qe;let vn=!1;if(c!==!1&&c!==void 0&&M.current!==void 0){const hr=typeof c=="object"?{...ma,...c}:ma,fr=hr.size,lt=fr/2,Jt=Qd(M.current.range),or=Pt($,Jt[0],Jt[1]);if(or!==void 0){const Hi=or.x+or.width+hr.offsetX-lt+.5,pr=or.y+or.height+hr.offsetY-lt+.5;vn=Math.abs(Hi-te)<fr&&Math.abs(pr-Ce)<fr}}ln={kind:"cell",location:[Ge,st],bounds:Ht,isEdge:Vn,shiftKey:Vt,ctrlKey:uo,isFillHandle:vn,metaKey:zr,isTouch:at,localEventX:te-Ht.x,localEventY:Ce-Ht.y,button:un,buttons:Gt,scrollEdge:Qt}}return ln},[n,yt,Je,ze,r,y,s,u,g,h,l,ct,x,Pt,c,M,Pn]),[xn]=ft??[],er=d.useRef(()=>{}),tr=d.useRef(ft);tr.current=ft;const[B,_e]=d.useMemo(()=>{const $=document.createElement("canvas"),te=document.createElement("canvas");return $.style.display="none",$.style.opacity="0",$.style.position="fixed",te.style.display="none",te.style.opacity="0",te.style.position="fixed",[$.getContext("2d",{alpha:!1}),te.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>{if(!(B===null||_e===null))return document.documentElement.append(B.canvas),document.documentElement.append(_e.canvas),()=>{B.canvas.remove(),_e.canvas.remove()}},[B,_e]);const Ne=d.useMemo(()=>new H0,[]),Tt=Zt&&qt?1:Be&&qt?2:5,an=Ze?.disableMinimumCellWidth===!0?1:10,hn=d.useRef(),Rn=d.useRef(null),gn=d.useRef(null),Bt=d.useCallback(()=>{const $=We.current,te=pn.current;if($===null||te===null||(Rn.current===null&&(Rn.current=$.getContext("2d",{alpha:!1}),$.width=0,$.height=0),gn.current===null&&(gn.current=te.getContext("2d",{alpha:!1}),te.width=0,te.height=0),Rn.current===null||gn.current===null||B===null||_e===null))return;let Ce=!1;const Ee=je=>{Ce=!0,dt(je)},ue=hn.current,fe={headerCanvasCtx:gn.current,canvasCtx:Rn.current,bufferACtx:B,bufferBCtx:_e,width:n,height:r,cellXOffset:Je,cellYOffset:l,translateX:Math.round(ze),translateY:Math.round(ct),mappedColumns:yt,enableGroups:y,freezeColumns:H,dragAndDropState:Y,theme:Se,headerHeight:s,groupHeaderHeight:u,disabledRows:we??Ye.empty(),rowHeight:h,verticalBorder:Te,isResizing:z,resizeCol:P,isFocused:E,selection:M,fillHandle:c,drawCellCallback:re,hasAppendRow:ge,overrideCursor:Ee,maxScaleFactor:Tt,freezeTrailingRows:x,rows:g,drawFocus:I,getCellContent:f,getGroupDetails:Qe??(je=>({name:je})),getRowThemeOverride:p,drawHeaderCallback:me,prelightCells:Dt,highlightRegions:pe,imageLoader:Et,lastBlitData:St,damage:ut.current,hoverValues:On.current,hoverInfo:tr.current,spriteManager:rn,scrolling:qt,hyperWrapping:Ze?.hyperWrapping??!1,touchMode:At,enqueue:er.current,renderStateProvider:Ne,renderStrategy:Ze?.renderStrategy??(ya.value?"double-buffer":"single-buffer"),getCellRenderer:Ie,minimumCellWidth:an,resizeIndicator:Me};fe.damage===void 0?(hn.current=fe,au(fe,ue)):au(fe,void 0),!Ce&&(fe.damage===void 0||fe.damage.has(tr?.current?.[0]))&&dt(void 0)},[B,_e,n,r,Je,l,ze,ct,yt,y,H,Y,Se,s,u,we,h,Te,z,ge,P,E,M,c,x,g,I,Tt,f,Qe,p,re,me,Dt,pe,Et,rn,qt,Ze?.hyperWrapping,Ze?.renderStrategy,At,Ne,Ie,an,Me]),En=d.useRef(Bt);d.useLayoutEffect(()=>{Bt(),En.current=Bt},[Bt]),d.useLayoutEffect(()=>{(async()=>document?.fonts?.ready!==void 0&&(await document.fonts.ready,hn.current=void 0,En.current()))()},[]);const Cn=d.useCallback($=>{ut.current=$,En.current(),ut.current=void 0},[]),Lo=Uv(Cn);er.current=Lo;const no=d.useCallback($=>{Cn(new mi($.map(te=>te.cell)))},[Cn]);Et.setCallback(Cn);const[Hr,xe]=d.useState(!1),[mt,Ft]=xn??[],_n=mt!==void 0&&Ft===-1&&mt>=0&&mt<yt.length&&yt[mt].headerRowMarkerDisabled!==!0,Tn=mt!==void 0&&Ft===-2;let Yt=!1,jt=!1,fn=Re;if(fn===void 0&&mt!==void 0&&Ft!==void 0&&Ft>-1&&Ft<g){const $=f([mt,Ft],!0);Yt=$.kind===Wn.NewRow||$.kind===Wn.Marker&&$.markerKind!=="number",jt=$.kind===Z.Boolean&&as($),fn=$.cursor}const $n=G?"grabbing":(wt??!1)||z?"col-resize":Hr||v?"crosshair":fn!==void 0?fn:_n||Yt||jt||Tn?"pointer":"default",Ao=d.useMemo(()=>({contain:"strict",display:"block",cursor:$n}),[$n]),Fo=d.useRef("default"),jn=se?.current;jn!=null&&Fo.current!==Ao.cursor&&(jn.style.cursor=Fo.current=Ao.cursor);const mn=d.useCallback(($,te,Ce,Ee)=>{if(Qe===void 0)return;const ue=Qe($);if(ue.actions!==void 0){const fe=mh(te,ue.actions);for(const[je,ke]of fe.entries())if(Kr(ke,Ce+te.x,Ee+ke.y))return ue.actions[je]}},[Qe]),br=d.useCallback(($,te,Ce,Ee)=>{const ue=yt[te];if(!G&&!z&&!(wt??!1)){const fe=Pt($,te,-1);Fn(fe!==void 0);const je=vh(void 0,ue,fe.x,fe.y,fe.width,fe.height,Se,cs(ue.title)==="rtl");if(ue.hasMenu===!0&&je.menuBounds!==void 0&&Kr(je.menuBounds,Ce,Ee))return{area:"menu",bounds:je.menuBounds};if(ue.indicatorIcon!==void 0&&je.indicatorIconBounds!==void 0&&Kr(je.indicatorIconBounds,Ce,Ee))return{area:"indicator",bounds:je.indicatorIconBounds}}},[yt,Pt,wt,G,z,Se]),ro=d.useRef(0),wr=d.useRef(),oo=d.useRef(!1),Ti=d.useCallback($=>{const te=We.current,Ce=se?.current;if(te===null||$.target!==te&&$.target!==Ce)return;oo.current=!0;const Ee=$.clientX,ue=$.clientY;if($.target===Ce&&Ce!==null){const je=Ce.getBoundingClientRect();if(Ee>je.right||ue>je.bottom)return}const fe=pt(te,Ee,ue,$);wr.current=fe.location,fe.isTouch&&(ro.current=Date.now()),$t.current!==fe.isTouch&&dn(fe.isTouch),!(fe.kind===Rr&&br(te,fe.location[0],Ee,ue)!==void 0)&&(fe.kind===Kn&&mn(fe.group,fe.bounds,fe.localEventX,fe.localEventY)!==void 0||(O?.(fe),!fe.isTouch&&le!==!0&&le!==fe.kind&&fe.button<3&&fe.button!==1&&$.preventDefault()))},[se,le,pt,mn,br,O]);Mn("pointerdown",Ti,Wt,!1);const Lr=d.useRef(0),io=d.useCallback($=>{const te=Lr.current;Lr.current=Date.now();const Ce=We.current;if(oo.current=!1,D===void 0||Ce===null)return;const Ee=se?.current,ue=$.target!==Ce&&$.target!==Ee,fe=$.clientX,je=$.clientY,ke=$.pointerType==="mouse"?$.button<3:!0;let qe=pt(Ce,fe,je,$);qe.isTouch&&ro.current!==0&&Date.now()-ro.current>500&&(qe={...qe,isLongTouch:!0}),te!==0&&Date.now()-te<(qe.isTouch?1e3:500)&&(qe={...qe,isDoubleClick:!0}),$t.current!==qe.isTouch&&dn(qe.isTouch),!ue&&$.cancelable&&ke&&$.preventDefault();const[gt]=qe.location,un=br(Ce,gt,fe,je);if(qe.kind===Rr&&un!==void 0){(qe.button!==0||wr.current?.[0]!==gt||wr.current?.[1]!==-1)&&D(qe,!0);return}else if(qe.kind===Kn){const Gt=mn(qe.group,qe.bounds,qe.localEventX,qe.localEventY);if(Gt!==void 0){qe.button===0&&Gt.onClick(qe);return}}D(qe,ue)},[D,se,pt,br,mn]);Mn("pointerup",io,Wt,!1);const yr=d.useCallback($=>{const te=We.current;if(te===null)return;const Ce=se?.current,Ee=$.target!==te&&$.target!==Ce;let ue,fe,je=!0;$ instanceof MouseEvent?(ue=$.clientX,fe=$.clientY,je=$.button<3):(ue=$.changedTouches[0].clientX,fe=$.changedTouches[0].clientY);const ke=pt(te,ue,fe,$);$t.current!==ke.isTouch&&dn(ke.isTouch),!Ee&&$.cancelable&&je&&$.preventDefault();const[qe]=ke.location;if(ke.kind===Rr){const gt=br(te,qe,ue,fe);gt!==void 0&&ke.button===0&&wr.current?.[0]===qe&&wr.current?.[1]===-1&&(gt.area==="menu"?m?.(qe,gt.bounds):gt.area==="indicator"&&w?.(qe,gt.bounds))}},[se,pt,br,m,w]);Mn("click",yr,Wt,!1);const ao=d.useCallback($=>{const te=We.current,Ce=se?.current;if(te===null||$.target!==te&&$.target!==Ce||S===void 0)return;const Ee=pt(te,$.clientX,$.clientY,$);S(Ee,()=>{$.cancelable&&$.preventDefault()})},[se,pt,S]);Mn("contextmenu",ao,se?.current??null,!1);const Oi=d.useCallback($=>{ut.current=new mi($.map(te=>te.item)),On.current=$,En.current(),ut.current=void 0},[]),zo=d.useMemo(()=>new Wv(Oi),[Oi]),$e=d.useRef(zo);$e.current=zo,d.useLayoutEffect(()=>{const $=$e.current;if(xn===void 0||xn[1]<0){$.setHovered(xn);return}const te=f(xn,!0),Ce=Ie(te),Ee=Ce===void 0&&te.kind===Z.Custom||Ce?.needsHover!==void 0&&(typeof Ce.needsHover=="boolean"?Ce.needsHover:Ce.needsHover(te));$.setHovered(Ee?xn:void 0)},[f,Ie,xn]);const _o=d.useRef(),za=d.useCallback($=>{const te=We.current;if(te===null)return;const Ce=se?.current,Ee=$.target!==te&&$.target!==Ce,ue=pt(te,$.clientX,$.clientY,$);if(ue.kind!=="out-of-bounds"&&Ee&&!oo.current&&!ue.isTouch)return;const fe=(ke,qe)=>{Dn(gt=>gt===ke||gt?.[0][0]===ke?.[0][0]&&gt?.[0][1]===ke?.[0][1]&&(gt?.[1][0]===ke?.[1][0]&&gt?.[1][1]===ke?.[1][1]||!qe)?gt:ke)};if(!yh(ue,_o.current))dt(void 0),N?.(ue),fe(ue.kind===Ca?void 0:[ue.location,[ue.localEventX,ue.localEventY]],!0),_o.current=ue;else if(ue.kind==="cell"||ue.kind===Rr||ue.kind===Kn){let ke=!1,qe=!0;if(ue.kind==="cell"){const un=f(ue.location);qe=Ie(un)?.needsHoverPosition??un.kind===Z.Custom,ke=qe}else ke=!0;const gt=[ue.location,[ue.localEventX,ue.localEventY]];fe(gt,qe),tr.current=gt,ke&&Cn(new mi([ue.location]))}const je=ue.location[0]>=(ae?0:1);cn(ue.kind===Rr&&ue.isEdge&&je&&ce===!0),xe(ue.kind==="cell"&&ue.isFillHandle),k?.($),Q(ue)},[se,pt,ae,ce,k,Q,N,f,Ie,Cn]);Mn("pointermove",za,Wt,!0);const Ar=d.useCallback($=>{const te=We.current;if(te===null)return;let Ce,Ee;M.current!==void 0&&(Ce=Pt(te,M.current.cell[0],M.current.cell[1]),Ee=M.current.cell),ee?.({bounds:Ce,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:Ee})},[ee,M,Pt]),_a=d.useCallback($=>{const te=We.current;if(te===null)return;let Ce,Ee;M.current!==void 0&&(Ce=Pt(te,M.current.cell[0],M.current.cell[1]),Ee=M.current.cell),K?.({bounds:Ce,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:Ee})},[K,M,Pt]),nr=d.useCallback($=>{if(We.current=$,oe!==void 0&&(oe.current=$),Ze?.eventTarget)ht.current=Ze.eventTarget;else if($===null)ht.current=window;else{const te=$.getRootNode();te===document&&(ht.current=window),ht.current=te}},[oe,Ze?.eventTarget]),$o=d.useCallback($=>{const te=We.current;if(te===null||le===!1||z){$.preventDefault();return}let Ce,Ee;const ue=pt(te,$.clientX,$.clientY);if(le!==!0&&ue.kind!==le){$.preventDefault();return}const fe=(Gt,xt)=>{Ce=Gt,Ee=xt};let je,ke,qe;const gt=(Gt,xt,at)=>{je=Gt,ke=xt,qe=at};let un=!1;if(de?.({...ue,setData:fe,setDragImage:gt,preventDefault:()=>un=!0,defaultPrevented:()=>un}),!un&&Ce!==void 0&&Ee!==void 0&&$.dataTransfer!==null)if($.dataTransfer.setData(Ce,Ee),$.dataTransfer.effectAllowed="copyLink",je!==void 0&&ke!==void 0&&qe!==void 0)$.dataTransfer.setDragImage(je,ke,qe);else{const[Gt,xt]=ue.location;if(xt!==void 0){const at=document.createElement("canvas"),Ge=Pt(te,Gt,xt);Fn(Ge!==void 0);const st=Math.ceil(window.devicePixelRatio??1);at.width=Ge.width*st,at.height=Ge.height*st;const Vt=at.getContext("2d");Vt!==null&&(Vt.scale(st,st),Vt.textBaseline="middle",xt===-1?(Vt.font=Se.headerFontFull,Vt.fillStyle=Se.bgHeader,Vt.fillRect(0,0,at.width,at.height),bh(Vt,0,0,Ge.width,Ge.height,yt[Gt],!1,Se,!1,void 0,void 0,!1,0,rn,me,!1)):(Vt.font=Se.baseFontFull,Vt.fillStyle=Se.bgCell,Vt.fillRect(0,0,at.width,at.height),gh(Vt,f([Gt,xt]),0,xt,!1,!1,0,0,Ge.width,Ge.height,!1,Se,Se.bgCell,Et,rn,1,void 0,!1,0,void 0,void 0,void 0,Ne,Ie,()=>{}))),at.style.left="-100%",at.style.position="absolute",at.style.width=`${Ge.width}px`,at.style.height=`${Ge.height}px`,document.body.append(at),$.dataTransfer.setDragImage(at,Ge.width/2,Ge.height/2),window.setTimeout(()=>{at.remove()},0)}}else $.preventDefault()},[le,z,pt,de,Pt,Se,yt,rn,me,f,Et,Ne,Ie]);Mn("dragstart",$o,se?.current??null,!1,!1);const lo=d.useRef(),Di=d.useCallback($=>{const te=We.current;if(be!==void 0&&$.preventDefault(),te===null||ne===void 0)return;const Ce=pt(te,$.clientX,$.clientY),[Ee,ue]=Ce.location,fe=Ee-(ae?0:1),[je,ke]=lo.current??[];(je!==fe||ke!==ue)&&(lo.current=[fe,ue],ne([fe,ue],$.dataTransfer))},[ae,pt,ne,be]);Mn("dragover",Di,se?.current??null,!1,!1);const $a=d.useCallback(()=>{lo.current=void 0,he?.()},[he]);Mn("dragend",$a,se?.current??null,!1,!1);const Va=d.useCallback($=>{const te=We.current;if(te===null||be===void 0)return;$.preventDefault();const Ce=pt(te,$.clientX,$.clientY),[Ee,ue]=Ce.location,fe=Ee-(ae?0:1);be([fe,ue],$.dataTransfer)},[ae,pt,be]);Mn("drop",Va,se?.current??null,!1,!1);const rr=d.useCallback(()=>{Oe?.()},[Oe]);Mn("dragleave",rr,se?.current??null,!1,!1);const dr=d.useRef(M);dr.current=M;const kn=d.useRef(null),j=d.useCallback($=>{We.current===null||!We.current.contains(document.activeElement)||($===null&&dr.current.current!==void 0?oe?.current?.focus({preventScroll:!0}):$!==null&&$.focus({preventScroll:!0}),kn.current=$)},[oe]);d.useImperativeHandle(t,()=>({focus:()=>{const $=kn.current;$===null||!document.contains($)?oe?.current?.focus({preventScroll:!0}):$.focus({preventScroll:!0})},getBounds:($,te)=>{if(!(oe===void 0||oe.current===null))return Pt(oe.current,$??0,te??-1)},damage:no,getMouseArgsForPosition:($,te,Ce)=>{if(!(oe===void 0||oe.current===null))return pt(oe.current,$,te,Ce)}}),[oe,no,Pt,pt]);const zt=d.useRef(),Fr=Cm(()=>{if(n<50||Ze?.disableAccessibilityTree===!0)return null;let $=Wl(yt,Je,n,Y,ze);const te=ae?0:-1;!ae&&$[0]?.sourceIndex===0&&($=$.slice(1));const[Ce,Ee]=M.current?.cell??[],ue=M.current?.range,fe=$.map(ke=>ke.sourceIndex),je=Tr(l,Math.min(g,l+o));return Ce!==void 0&&Ee!==void 0&&!(fe.includes(Ce)&&je.includes(Ee))&&j(null),d.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":yt.length+te},d.createElement("thead",{role:"rowgroup"},d.createElement("tr",{role:"row","aria-rowindex":1},$.map(ke=>d.createElement("th",{role:"columnheader","aria-selected":M.columns.hasIndex(ke.sourceIndex),"aria-colindex":ke.sourceIndex+1+te,tabIndex:-1,onFocus:qe=>{if(qe.target!==kn.current)return ye?.([ke.sourceIndex,-1])},key:ke.sourceIndex},ke.title)))),d.createElement("tbody",{role:"rowgroup"},je.map(ke=>d.createElement("tr",{role:"row","aria-selected":M.rows.hasIndex(ke),key:ke,"aria-rowindex":ke+2},$.map(qe=>{const gt=qe.sourceIndex,un=Zn(gt,ke),Gt=Ce===gt&&Ee===ke,xt=ue!==void 0&&gt>=ue.x&&gt<ue.x+ue.width&&ke>=ue.y&&ke<ue.y+ue.height,at=`glide-cell-${gt}-${ke}`,Ge=[gt,ke],st=f(Ge,!0);return d.createElement("td",{key:un,role:"gridcell","aria-colindex":gt+1+te,"aria-selected":xt,"aria-readonly":Io(st)||!So(st),id:at,"data-testid":at,onClick:()=>{const Vt=oe?.current;if(Vt!=null)return ee?.({bounds:Pt(Vt,gt,ke),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Ge})},onFocusCapture:Vt=>{if(!(Vt.target===kn.current||zt.current?.[0]===gt&&zt.current?.[1]===ke))return zt.current=Ge,ye?.(Ge)},ref:Gt?j:void 0,tabIndex:-1},Xv(st,Ie))})))))},[n,yt,Je,Y,ze,g,l,o,M,j,f,oe,ee,Pt,ye],200),so=H===0||!L?0:Je>H?1:Nn(-ze/100,0,1),Pi=-l*32+ct,co=T?Nn(-Pi/100,0,1):0,Ba=d.useMemo(()=>{if(!so&&!co)return null;const $={position:"absolute",top:0,left:In,width:n-In,height:r,opacity:so,pointerEvents:"none",transition:it?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},te={position:"absolute",top:Pn,left:0,width:n,height:r,opacity:co,pointerEvents:"none",transition:Ae?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return d.createElement(d.Fragment,null,so>0&&d.createElement("div",{id:"shadow-x",style:$}),co>0&&d.createElement("div",{id:"shadow-y",style:te}))},[so,co,In,n,it,Pn,r,Ae]),X=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:Ar,onKeyUp:_a,onFocus:C,onBlur:R,ref:nr,style:Ao},Fr),d.createElement("canvas",{ref:pn,style:X}),Ba)},Kv=d.memo(d.forwardRef(qv));function ai(e,t,n,r){return Nn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const Zv=e=>{const[t,n]=d.useState(),[r,o]=d.useState(),[i,a]=d.useState(),[l,s]=d.useState(),[c,u]=d.useState(!1),[h,g]=d.useState(),[f,p]=d.useState(),[m,w]=d.useState(),[y,v]=d.useState(!1),[C,R]=d.useState(),{onHeaderMenuClick:E,onHeaderIndicatorClick:M,getCellContent:H,onColumnMoved:S,onColumnResize:x,onColumnResizeStart:L,onColumnResizeEnd:T,gridRef:I,maxColumnWidth:O,minColumnWidth:D,onRowMoved:k,lockColumns:Q,onColumnProposeMove:N,onMouseDown:Y,onMouseUp:ae,onItemHovered:ee,onDragStart:K,canvasRef:pe}=e,oe=(x??T??L)!==void 0,{columns:de,selection:he}=e,se=he.columns,z=d.useCallback(re=>{const[me,ye]=re.location;i!==void 0&&l!==me&&me>=Q?(u(!0),s(me)):f!==void 0&&ye!==void 0?(v(!0),w(Math.max(0,ye))):r===void 0&&!c&&!y&&ee?.(re)},[i,f,l,ee,Q,r,c,y]),P=S!==void 0,G=d.useCallback(re=>{if(re.button===0){const[me,ye]=re.location;if(re.kind==="out-of-bounds"&&re.isEdge&&oe){const ne=I?.current?.getBounds(de.length-1,-1);ne!==void 0&&(n(ne.x),o(de.length-1))}else if(re.kind==="header"&&me>=Q){const ne=pe?.current;if(re.isEdge&&oe&&ne){n(re.bounds.x),o(me);const be=ne.getBoundingClientRect().width/ne.offsetWidth,Oe=re.bounds.width/be;L?.(de[me],Oe,me,Oe+(de[me].growOffset??0))}else re.kind==="header"&&P&&(g(re.bounds.x),a(me))}else re.kind==="cell"&&Q>0&&me===0&&ye!==void 0&&k!==void 0&&(R(re.bounds.y),p(ye))}Y?.(re)},[Y,oe,Q,k,I,de,P,L,pe]),le=d.useCallback((re,me)=>{c||y||E?.(re,me)},[c,y,E]),ce=d.useCallback((re,me)=>{c||y||M?.(re,me)},[c,y,M]),we=d.useRef(-1),ge=d.useCallback(()=>{we.current=-1,p(void 0),w(void 0),R(void 0),v(!1),a(void 0),s(void 0),g(void 0),u(!1),o(void 0),n(void 0)},[]),Qe=d.useCallback((re,me)=>{if(re.button===0){if(r!==void 0){if(se?.hasIndex(r)===!0)for(const ne of se){if(ne===r)continue;const be=de[ne],Oe=ai(be,we.current,D,O);x?.(be,Oe,ne,Oe+(be.growOffset??0))}const ye=ai(de[r],we.current,D,O);if(T?.(de[r],ye,r,ye+(de[r].growOffset??0)),se.hasIndex(r))for(const ne of se){if(ne===r)continue;const be=de[ne],Oe=ai(be,we.current,D,O);T?.(be,Oe,ne,Oe+(be.growOffset??0))}}ge(),i!==void 0&&l!==void 0&&N?.(i,l)!==!1&&S?.(i,l),f!==void 0&&m!==void 0&&k?.(f,m)}ae?.(re,me)},[ae,r,i,l,f,m,se,T,de,D,O,x,S,k,ge,N]),Se=d.useMemo(()=>{if(!(i===void 0||l===void 0)&&i!==l&&N?.(i,l)!==!1)return{src:i,dest:l}},[i,l,N]),Dt=d.useCallback(re=>{const me=pe?.current;if(i!==void 0&&h!==void 0)Math.abs(re.clientX-h)>20&&u(!0);else if(f!==void 0&&C!==void 0)Math.abs(re.clientY-C)>20&&v(!0);else if(r!==void 0&&t!==void 0&&me){const ye=me.getBoundingClientRect().width/me.offsetWidth,ne=(re.clientX-t)/ye,be=de[r],Oe=ai(be,ne,D,O);if(x?.(be,Oe,r,Oe+(be.growOffset??0)),we.current=ne,se?.first()===r)for(const Pe of se){if(Pe===r)continue;const it=de[Pe],Ae=ai(it,we.current,D,O);x?.(it,Ae,Pe,Ae+(it.growOffset??0))}}},[i,h,f,C,r,t,de,D,O,x,se,pe]),bt=d.useCallback((re,me)=>{if(f===void 0||m===void 0)return H(re,me);let[ye,ne]=re;return ne===m?ne=f:(ne>m&&(ne-=1),ne>=f&&(ne+=1)),H([ye,ne],me)},[f,m,H]),Te=d.useCallback(re=>{K?.(re),re.defaultPrevented()||ge()},[ge,K]);return d.createElement(Kv,{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:le,onHeaderIndicatorClick:ce,isDragging:c,onItemHovered:z,onDragStart:Te,onMouseDown:G,allowResize:oe,onMouseUp:Qe,dragAndDropState:Se,onMouseMoveRaw:Dt,ref:I})};function Yv(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:c}=l&&l.contentRect||{};r(u=>u.width===s&&u.height===c?u:{width:s,height:c})}},i=new window.ResizeObserver(o);return t.current&&i.observe(t.current,void 0),()=>{i.disconnect()}},[t.current]),{ref:t,...n}}const Qv=(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 c=()=>{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(c,8.333333333333334)}},u=()=>{o.current=!0,i.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},h=g=>{g.touches.length===0&&(o.current=!1,a.current=0,r.current=window.setTimeout(c,8.333333333333334))};if(e&&s!==null){const g=s;return g.addEventListener("touchstart",u),g.addEventListener("touchend",h),()=>{g.removeEventListener("touchstart",u),g.removeEventListener("touchend",h),r.current!==null&&window.clearTimeout(r.current)}}},[e,s])},Jv=()=>e=>e.isSafari?"scroll":"auto",eb=sn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[Jv()]}}),tb=33554400,nb=5e6;function rb(e){const[t,n]=d.useState(!1),r=typeof window>"u"?null:window,o=d.useRef(0);return Mn("touchstart",d.useCallback(()=>{window.clearTimeout(o.current),n(!0)},[]),r,!0,!1),Mn("touchend",d.useCallback(i=>{i.touches.length===0&&(o.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const ob=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:o,update:i,draggable:a,className:l,preventDiagonalScrolling:s=!1,paddingBottom:c=0,paddingRight:u=0,rightElement:h,rightElementProps:g,kineticScrollPerfHack:f=!1,scrollRef:p,initialSize:m}=e,w=[],y=g?.sticky??!1,v=g?.fill??!1,C=d.useRef(0),R=d.useRef(0),E=d.useRef(null),M=typeof window>"u"?1:window.devicePixelRatio,H=d.useRef(M);d.useEffect(()=>{if(H.current!==M){C.current=0,R.current=0,H.current=M;const he=E.current;he!==null&&k.current(he.scrollLeft,he.scrollTop)}},[M]);const S=d.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),x=d.useRef(null),L=rb(200),[T,I]=d.useState(!0),O=d.useRef(0);d.useLayoutEffect(()=>{if(!T||L||S.current.lockDirection===void 0)return;const he=E.current;if(he===null)return;const[se,z]=S.current.lockDirection;se!==void 0?he.scrollLeft=se:z!==void 0&&(he.scrollTop=z),S.current.lockDirection=void 0},[L,T]);const D=d.useCallback((he,se)=>{const z=E.current;if(z===null)return;se=se??z.scrollTop,he=he??z.scrollLeft;const P=S.current.scrollTop,G=S.current.scrollLeft,le=he-G,ce=se-P;L&&le!==0&&ce!==0&&(Math.abs(le)>3||Math.abs(ce)>3)&&s&&S.current.lockDirection===void 0&&(S.current.lockDirection=Math.abs(le)<Math.abs(ce)?[G,void 0]:[void 0,P]);const we=S.current.lockDirection;he=we?.[0]??he,se=we?.[1]??se,S.current.scrollLeft=he,S.current.scrollTop=se;const ge=z.clientWidth,Qe=z.clientHeight,Se=se,Dt=R.current-Se,bt=z.scrollHeight-Qe;R.current=Se;let Te;if(bt>0&&r>z.scrollHeight+5)if(Math.abs(Dt)>2e3||Se===0||Se===bt){const re=Math.max(0,Math.min(1,Se/bt)),me=r-Qe;Te=re*me,C.current=Te}else C.current-=Dt,Te=C.current;else Te=Se,C.current=Te;Te=Math.max(0,Math.min(Te,r-Qe)),C.current=Te,we!==void 0&&(window.clearTimeout(O.current),I(!1),O.current=window.setTimeout(()=>I(!0),200)),i({x:he,y:Te,width:ge-u,height:Qe-c,paddingRight:x.current?.clientWidth??0})},[c,u,r,i,s,L]);Qv(f&&ya.value,D,E);const k=d.useRef(D);k.current=D;const Q=d.useRef(),N=d.useRef(!1);d.useLayoutEffect(()=>{N.current?D():N.current=!0},[D,c,u]);const Y=d.useCallback(he=>{E.current=he,p!==void 0&&(p.current=he)},[p]);let ae=0,ee=0;const K=Math.min(r,tb);for(w.push(d.createElement("div",{key:ae++,style:{width:o,height:0}}));ee<K;){const he=Math.min(nb,K-ee);w.push(d.createElement("div",{key:ae++,style:{width:0,height:he}})),ee+=he}const{ref:pe,width:oe,height:de}=Yv(m);return typeof window<"u"&&(Q.current?.height!==de||Q.current?.width!==oe)&&(window.setTimeout(()=>k.current(),0),Q.current={width:oe,height:de}),(oe??0)===0||(de??0)===0?d.createElement("div",{ref:pe}):d.createElement("div",{ref:pe},d.createElement(eb,{isSafari:ya.value},d.createElement("div",{className:"dvn-underlay"},t),d.createElement("div",{ref:Y,style:Q.current,draggable:a,onDragStart:he=>{a||(he.stopPropagation(),he.preventDefault())},className:"dvn-scroller "+(l??""),onScroll:()=>D()},d.createElement("div",{className:"dvn-scroll-inner"+(h===void 0?" dvn-hidden":"")},d.createElement("div",{className:"dvn-stack"},w),h!==void 0&&d.createElement(d.Fragment,null,!v&&d.createElement("div",{className:"dvn-spacer"}),d.createElement("div",{ref:x,style:{height:de,maxHeight:n-Math.ceil(M%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:u,flexGrow:v?1:void 0,right:y?u??0:void 0,pointerEvents:"auto"}},h))))))},ib=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:o,groupHeaderHeight:i,enableGroups:a,freezeColumns:l,experimental:s,nonGrowWidth:c,clientSize:u,className:h,onVisibleRegionChanged:g,scrollRef:f,preventDiagonalScrolling:p,rightElement:m,rightElementProps:w,overscrollX:y,overscrollY:v,initialSize:C,smoothScrollX:R=!1,smoothScrollY:E=!1,isDraggable:M}=e,{paddingRight:H,paddingBottom:S}=s??{},[x,L]=u,T=d.useRef(),I=d.useRef(),O=d.useRef(),D=d.useRef(),k=c+Math.max(0,y??0);let Q=a?o+i:o;if(typeof r=="number")Q+=n*r;else for(let ee=0;ee<n;ee++)Q+=r(ee);v!==void 0&&(Q+=v);const N=d.useRef(),Y=d.useCallback(()=>{if(N.current===void 0)return;const ee={...N.current};let K=0,pe=ee.x<0?-ee.x:0,oe=0,de=0;ee.x=ee.x<0?0:ee.x;let he=0;for(let ce=0;ce<l;ce++)he+=t[ce].width;for(const ce of t){const we=K-he;if(ee.x>=we+ce.width)K+=ce.width,de++,oe++;else if(ee.x>we)K+=ce.width,R?pe+=we-ee.x:de++,oe++;else if(ee.x+ee.width>we)K+=ce.width,oe++;else break}let se=0,z=0,P=0;if(typeof r=="number")E?(z=Math.floor(ee.y/r),se=z*r-ee.y):z=Math.ceil(ee.y/r),P=Math.ceil(ee.height/r)+z,se<0&&P++;else{let ce=0;for(let we=0;we<n;we++){const ge=r(we),Qe=ce+(E?0:ge/2);if(ee.y>=ce+ge)ce+=ge,z++,P++;else if(ee.y>Qe)ce+=ge,E?se+=Qe-ee.y:z++,P++;else if(ee.y+ee.height>ge/2+ce)ce+=ge,P++;else break}}z=Math.max(0,Math.min(z,n-1)),P=Math.max(z,Math.min(P,n));const G={x:de,y:z,width:oe-de,height:P-z},le=T.current;(le===void 0||le.y!==G.y||le.x!==G.x||le.height!==G.height||le.width!==G.width||I.current!==pe||O.current!==se||ee.width!==D.current?.[0]||ee.height!==D.current?.[1])&&(g?.({x:de,y:z,width:oe-de,height:P-z},ee.width,ee.height,ee.paddingRight??0,pe,se),T.current=G,I.current=pe,O.current=se,D.current=[ee.width,ee.height])},[t,r,n,g,l,R,E]),ae=d.useCallback(ee=>{N.current=ee,Y()},[Y]);return d.useEffect(()=>{Y()},[Y]),d.createElement(ob,{scrollRef:f,className:h,kineticScrollPerfHack:s?.kineticScrollPerfHack,preventDiagonalScrolling:p,draggable:M===!0||typeof M=="string",scrollWidth:k+(H??0),scrollHeight:Q+(S??0),clientHeight:L,rightElement:m,paddingBottom:S,paddingRight:H,rightElementProps:w,update:ae,initialSize:C},d.createElement(Zv,{eventTargetRef:f,width:x,height:L,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},ab=sn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),lb=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"})),sb=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"})),cb=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"})),ub=10,db=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:o,searchInputRef:i,searchValue:a,searchResults:l,onSearchValueChange:s,getCellsForSelection:c,onSearchResultsChanged:u,showSearch:h=!1,onSearchClose:g}=e,[f]=d.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[p,m]=d.useState(""),w=a??p,y=d.useCallback(K=>{m(K),s?.(K)},[s]),[v,C]=d.useState(),R=d.useRef(v);R.current=v,d.useEffect(()=>{l!==void 0&&(l.length>0?C(K=>({rowsSearched:r,results:l.length,selectedIndex:K?.selectedIndex??-1})):C(void 0))},[r,l]);const E=d.useRef();E.current===void 0&&(E.current=new AbortController);const M=d.useRef(),[H,S]=d.useState([]),x=l??H,L=d.useCallback(()=>{M.current!==void 0&&(window.cancelAnimationFrame(M.current),M.current=void 0),E.current!==void 0&&E.current.abort(),E.current=new AbortController},[]),T=d.useRef(n);T.current=n;const I=d.useCallback(K=>{const pe=new RegExp(K.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let oe=T.current,de=Math.min(10,r),he=0;C(void 0),S([]);const se=[],z=async()=>{if(c===void 0)return;const P=performance.now(),G=r-he;let le=c({x:0,y:oe,width:o.length,height:Math.min(de,G,r-oe)},E.current.signal);typeof le=="function"&&(le=await le());let ce=!1;for(const[bt,Te]of le.entries())for(const[re,me]of Te.entries()){let ye;switch(me.kind){case Z.Text:case Z.Number:ye=me.displayData;break;case Z.Uri:case Z.Markdown:ye=me.data;break;case Z.Boolean:ye=typeof me.data=="boolean"?me.data.toString():void 0;break;case Z.Image:case Z.Bubble:ye=me.data.join("🐳");break;case Z.Custom:ye=me.copyData;break}ye!==void 0&&pe.test(ye)&&(se.push([re,bt+oe]),ce=!0)}const we=performance.now();ce&&S([...se]),he+=le.length,Fn(he<=r);const ge=R.current?.selectedIndex??-1;C({results:se.length,rowsSearched:he,selectedIndex:ge}),u?.(se,ge),oe+de>=r?oe=0:oe+=de;const Qe=we-P,Se=Math.max(Qe,1),Dt=ub/Se;de=Math.ceil(de*Dt),he<r&&se.length<1e3&&(M.current=window.requestAnimationFrame(z))};L(),M.current=window.requestAnimationFrame(z)},[L,o.length,c,u,r]),O=d.useCallback(()=>{g?.(),C(void 0),S([]),u?.([],-1),L(),t?.current?.focus()},[L,t,g,u]),D=d.useCallback(K=>{y(K.target.value),l===void 0&&(K.target.value===""?(C(void 0),S([]),L()):I(K.target.value))},[I,L,y,l]);d.useEffect(()=>{i.current!==null&&(y(""),C(void 0),H.length>0&&(S([]),u?.([],-1)),h?i.current.focus({preventScroll:!0}):L())},[h,i]);const k=d.useCallback(K=>{if(K?.stopPropagation?.(),v===void 0||v.results===0)return;const pe=(v.selectedIndex+1)%v.results;C({...v,selectedIndex:pe}),u?.(x,pe)},[v,u,x]),Q=d.useCallback(K=>{if(K?.stopPropagation?.(),v===void 0||v.results===0)return;let pe=(v.selectedIndex-1)%v.results;pe<0&&(pe+=v.results),C({...v,selectedIndex:pe}),u?.(x,pe)},[u,x,v]),N=d.useCallback(K=>{(K.ctrlKey||K.metaKey)&&K.nativeEvent.code==="KeyF"||K.key==="Escape"?(O(),K.stopPropagation(),K.preventDefault()):K.key==="Enter"&&(K.shiftKey?Q():k())},[O,k,Q]);d.useEffect(()=>()=>{L()},[L]);const[Y,ae]=d.useState(!1);d.useEffect(()=>{if(h)ae(!0);else{const K=setTimeout(()=>ae(!1),150);return()=>clearTimeout(K)}},[h]);const ee=d.useMemo(()=>{if(!h&&!Y)return null;let K;v!==void 0&&(K=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(K=`${v.selectedIndex+1} of ${K}`));const pe=de=>{de.stopPropagation()},oe={width:`${r>0?Math.floor((v?.rowsSearched??0)/r*100):0}%`};return d.createElement(ab,{className:"gdg-search-bar"+(h?"":" out"),onMouseDown:pe,onMouseMove:pe,onMouseUp:pe,onClick:pe},d.createElement("div",{className:"gdg-search-bar-inner"},d.createElement("input",{id:f,"aria-hidden":!h,"data-testid":"search-input",ref:i,onChange:D,value:w,tabIndex:h?void 0:-1,onKeyDownCapture:N}),d.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:Q,disabled:(v?.results??0)===0},lb),d.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:k,disabled:(v?.results??0)===0},sb),g!==void 0&&d.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!h,"data-testid":"search-close-button",tabIndex:h?void 0:-1,onClick:O},cb)),v!==void 0?d.createElement(d.Fragment,null,d.createElement("div",{className:"gdg-search-status"},d.createElement("div",{"data-testid":"search-result-area"},K)),d.createElement("div",{className:"gdg-search-progress",style:oe})):d.createElement("div",{className:"gdg-search-status"},d.createElement("label",{htmlFor:f},"Type to search")))},[h,Y,v,r,f,i,D,w,N,Q,k,g,O]);return d.createElement(d.Fragment,null,d.createElement(ib,{prelightCells:x,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}),ee)};class hb 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 fb=()=>e=>Math.max(16,e.targetHeight-10),pb=sn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[fb(),"px"]}}),gb=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:o,onFinish:i}=e,[a,l]=kt.useState(n);return kt.createElement(hb,{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},kt.createElement(pb,{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 mb(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 tt(e,t,n){const r=xh(e,t);return r&&(n.didMatch=!0),r}function xh(e,t){if(e.length===0)return!1;if(e.includes("|")){const s=e.split("|");for(const c of s)if(xh(c,t))return!0;return!1}let n=!1,r=!1,o=!1,i=!1;const a=e.split("+"),l=a.pop();if(!mb(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":xa.value?i=!0:n=!0;break}return t.altKey===o&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===i}function vb(e,t,n,r,o,i,a){const l=kt.useCallback((u,h,g,f)=>{(i==="cell"||i==="multi-cell")&&u!==void 0&&(u={...u,range:{x:u.cell[0],y:u.cell[1],width:1,height:1}}),!a&&u!==void 0&&u.range.width>1&&(u={...u,range:{...u.range,width:1,x:u.cell[0]}});const p=n==="mixed"&&(g||f==="drag")||n==="additive",m=(r==="mixed"||r==="additive")&&p,w=(o==="mixed"||o==="additive")&&p;let y={current:u===void 0?void 0:{...u,rangeStack:f==="drag"?e.current?.rangeStack??[]:[]},columns:m?e.columns:Ye.empty(),rows:w?e.rows:Ye.empty()};g&&(i==="multi-rect"||i==="multi-cell")&&y.current!==void 0&&e.current!==void 0&&(y={...y,current:{...y.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(y,h)},[r,e,n,i,a,o,t]),s=kt.useCallback((u,h,g)=>{u=u??e.rows,h!==void 0&&(u=u.add(h));let f;if(o==="exclusive"&&u.length>0)f={current:void 0,columns:Ye.empty(),rows:u};else{const p=g&&n==="mixed"||n==="additive",m=g&&r==="mixed"||r==="additive";f={current:p?e.current:void 0,columns:m?e.columns:Ye.empty(),rows:u}}t(f,!1)},[r,e,n,o,t]),c=kt.useCallback((u,h,g)=>{u=u??e.columns,h!==void 0&&(u=u.add(h));let f;if(r==="exclusive"&&u.length>0)f={current:void 0,rows:Ye.empty(),columns:u};else{const p=g&&n==="mixed"||n==="additive",m=g&&o==="mixed"||o==="additive";f={current:p?e.current:void 0,rows:m?e.rows:Ye.empty(),columns:u}}t(f,!1)},[r,e,n,o,t]);return[l,s,c]}function bb(e,t,n,r,o){const i=d.useCallback(s=>{if(e===!0){const c=[];for(let u=s.y;u<s.y+s.height;u++){const h=[];for(let g=s.x;g<s.x+s.width;g++)g<0||u>=o?h.push({kind:Z.Loading,allowOverlay:!1}):h.push(t([g,u]));c.push(h)}return c}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 c={...s,x:s.x-n};if(c.x<0){c.x=0,c.width--;const u=a(c,r.signal);return typeof u=="function"?async()=>(await u()).map(h=>[{kind:Z.Loading,allowOverlay:!1},...h]):u.map(h=>[{kind:Z.Loading,allowOverlay:!1},...h])}return a(c,r.signal)},[r.signal,a,n]);return[e!==void 0?l:void 0,a]}function wb(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case Z.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===is?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Z.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Z.Image:case Z.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Z.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Z.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Z.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Z.Markdown:case Z.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Z.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Z.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Z.Protected:return{formatted:"************",rawValue:"",format:"string"};default:vi()}}function yb(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"}:wb(i))})}function lu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function xb(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=>lu(i,!0)).join(",")):r.push(o.doNotEscape===!0?o.formatted:lu(o.formatted,!1));t.push(r.join(" "))}return t.join(`
176
- `)}function xl(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function su(e){return'"'+e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'}function Cb(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function kb(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}">${xl(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${o}><ol>${r.formatted.map((i,a)=>`<li gdg-raw-value=${su(r.rawValue[a])}>`+xl(i)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${su(r.rawValue?.toString()??"")} ${o}>${xl(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function Sb(e,t){const n=yb(e,t),r=xb(n),o=kb(n);return{textPlain:r,textHtml:o}}function cu(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,c=s?.children.length===1&&s.children[0].nodeName==="FONT",u=l.querySelectorAll("br");for(const f of u)f.replaceWith(`
177
- `);const h=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 f=l.querySelectorAll("li");i?.push({rawValue:[...f].map(p=>p.getAttribute("gdg-raw-value")??""),formatted:[...f].map(p=>p.textContent??""),format:"string-array"})}else if(h!==null)i?.push({rawValue:Cb(h),formatted:l.textContent??"",format:g});else{let f=l.textContent??"";c&&(f=f.replace(/\n(?!\n)/g,"")),i?.push({rawValue:f??"",formatted:f??"",format:g})}}}return i!==void 0&&o.push(i),o}function Mb(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 h=t({x:l.x,y:l.y,width:1,height:l.height},o.signal);if(typeof h=="function")return i;s.push(...h);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 h=t({x:l.x,y:l.y,width:l.width,height:l.height},o.signal);if(typeof h=="function")return i;s.push(...h)}let c=l.x-n,u=l.x+l.width-1-n;for(const h of s)for(const g of h)g.span!==void 0&&(c=Math.min(g.span[0],c),u=Math.max(g.span[1],u));c===l.x-n&&u===l.x+l.width-1-n?a=!0:e={current:{cell:e.current.cell??[0,0],range:{x:c+n,y:l.y,width:u-c+1,height:l.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function uu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function Ib(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(uu(e.slice(o,a))),o=a+1,l===`
182
- `&&(n.push(r),r=[])),i=t.None);break}a++}return o<e.length&&r.push(uu(e.slice(o,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function du(e,t,n){const r=Sb(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 Ch(e){return e!==!0}function hu(e){return typeof e=="string"?e:`${e}px`}const Rb=()=>e=>e.innerWidth,Eb=()=>e=>e.innerHeight,Tb=sn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Rb()],"wmyidgi-1":[Eb()]}}),Ob=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(Tb,{innerHeight:hu(n),innerWidth:hu(t),...o},r)},Db=2,Pb=1300;function Hb(e,t,n){const r=kt.useRef(0),[o,i]=e??[0,0];kt.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let a=!1,l=0;const s=c=>{if(!a){if(l===0)l=c;else{const u=c-l;r.current=Math.min(1,r.current+u/Pb);const h=r.current**1.618*u*Db;t.current?.scrollBy(o*h,i*h),l=c,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,o,i,n])}function Lb({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:a,remSize:l}){const[s,c,u,h,g,f]=kt.useMemo(()=>{if(!a||l===16)return[e,t,n,r,o,i];const p=l/16,m=e,w=ah();return[typeof m=="number"?m*p:y=>Math.ceil(m(y)*p),Math.ceil(t*p),Math.ceil(n*p),{...r,headerIconSize:(r?.headerIconSize??w.headerIconSize)*p,cellHorizontalPadding:(r?.cellHorizontalPadding??w.cellHorizontalPadding)*p,cellVerticalPadding:(r?.cellVerticalPadding??w.cellVerticalPadding)*p},Math.ceil((o??0)*p),Math.ceil((i??0)*p)]},[n,t,o,i,l,e,a,r]);return{rowHeight:s,headerHeight:c,groupHeaderHeight:u,theme:h,overscrollX:g,overscrollY:f}}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 nt(e,t){return e===!0?t:e===!1?"":e}function fu(e){const t=xa.value;return{activateCell:nt(e.activateCell," |Enter|shift+Enter"),clear:nt(e.clear,"any+Escape"),closeOverlay:nt(e.closeOverlay,"any+Escape"),acceptOverlayDown:nt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:nt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:nt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:nt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:nt(e.delete,t?"Backspace|Delete":"Delete"),downFill:nt(e.downFill,"primary+_68"),scrollToSelectedCell:nt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:nt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:nt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:nt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:nt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:nt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:nt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:nt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:nt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:nt(e.goToFirstCell,"primary+Home"),goToFirstColumn:nt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:nt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:nt(e.goToLastCell,"primary+End"),goToLastColumn:nt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:nt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:nt(e.goToNextPage,"PageDown"),goToPreviousPage:nt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:nt(e.rightFill,"primary+_82"),search:nt(e.search,"primary+f"),selectAll:nt(e.selectAll,"primary+a"),selectColumn:nt(e.selectColumn,"ctrl+ "),selectGrowDown:nt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:nt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:nt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:nt(e.selectGrowUp,"shift+ArrowUp"),selectRow:nt(e.selectRow,"shift+ "),selectToFirstCell:nt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:nt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:nt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:nt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:nt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:nt(e.selectToLastRow,"primary+shift+ArrowDown")}}function Ab(e){const t=Rm(e);return kt.useMemo(()=>{if(t===void 0)return fu(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 fu({...Mr,...n})},[t])}function Fb(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 Ss(e,t){const n=[];function r(l,s,c=!1){let u=s!==null?s-l.headerIndex:t-l.headerIndex;if(l.subGroups!==void 0&&(u=l.subGroups[0].headerIndex-l.headerIndex),u--,n.push({rowIndex:-1,headerIndex:l.headerIndex,contentIndex:-1,skip:c,isCollapsed:l.isCollapsed,depth:l.depth,path:l.path,rows:u}),l.subGroups)for(let h=0;h<l.subGroups.length;h++){const g=h<l.subGroups.length-1?l.subGroups[h+1].headerIndex:s;r(l.subGroups[h],g,c||l.isCollapsed)}}const o=Fb(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,...c}=l;return c})}function Xl(e,t){if(t===void 0||Ss.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 zb(e,t,n,r){const o=kt.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]),i=kt.useMemo(()=>o?.reduce((u,h)=>(u[h.rowIndex]=h,u),{}),[o]),a=kt.useMemo(()=>o===void 0?t:o.reduce((u,h)=>u+(h.isCollapsed?1:h.rows+1),0),[o,t]),l=kt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>i?.[u]?e.height:typeof n=="number"?n:n(u),[i,e,n]),s=kt.useCallback(u=>{if(o===void 0)return u;let h=u;for(const g of o){if(h===0)return;if(h--,!g.isCollapsed){if(h<g.rows)return g.contentIndex+h;h-=g.rows}}return u},[o]),c=Ir(r??e?.themeOverride,kt.useCallback(u=>{if(e===void 0)return r?.(u,u,u);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:h,contentIndex:g,groupIndex:f}=Xl(u,o);return h?e.themeOverride:r?.(u,f,g)},[o,r,e]));return e===void 0?{rowHeight:l,rows:t,rowNumberMapper:s,getRowThemeOverride:c}:{rowHeight:l,rows:a,rowNumberMapper:s,getRowThemeOverride:c}}function _b(e,t){const n=kt.useMemo(()=>e===void 0?void 0:Ss(e,t),[e,t]);return{getRowGroupingForPath:Sh,updateRowGroupingByPath:kh,mapper:kt.useCallback(r=>{if(typeof r=="number")return Xl(r,n);const o=Xl(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function kh(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:kh(i.subGroups??[],o,n)}:i)}function Sh(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Sh(e[n].subGroups??[],r)}function $b(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 Vb(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,c,u]=Im(l),h=d.useRef(o);h.current=o;const g=$b(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),f=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&f){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&u(),h.current()}},[t,f,u,g]);const p=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&u(),h.current()}},[e,p,u,g]),{visibleRegion:s,setVisibleRegion:c,scrollRef:g}}const Bb=d.lazy(async()=>await ns(()=>import("./data-grid-overlay-editor-DsmOmCoE-DU0EvyVM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));let Nb=0;function Wb(e){return G0(eu(eu(e).filter(t=>t.span!==void 0).map(t=>Tr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Qi(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 Ji={kind:Z.Loading,allowOverlay:!1},ea={columns:Ye.empty(),rows:Ye.empty(),current:void 0},jb=(e,t)=>{const[n,r]=d.useState(ea),[o,i]=d.useState(),a=d.useRef(null),l=d.useRef(null),[s,c]=d.useState(),u=d.useRef(),h=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:f,markdownDivCreateNode:p,width:m,height:w,columns:y,rows:v,getCellContent:C,onCellClicked:R,onCellActivated:E,onFillPattern:M,onFinishedEditing:H,coercePasteValue:S,drawHeader:x,drawCell:L,editorBloom:T,onHeaderClicked:I,onColumnProposeMove:O,rangeSelectionColumnSpanning:D=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:Q,onCellContextMenu:N,className:Y,onHeaderContextMenu:ae,getCellsForSelection:ee,onGroupHeaderContextMenu:K,onGroupHeaderRenamed:pe,onCellEdited:oe,onCellsEdited:de,onSearchResultsChanged:he,searchResults:se,onSearchValueChange:z,searchValue:P,onKeyDown:G,onKeyUp:le,keybindings:ce,editOnType:we=!0,onRowAppended:ge,onColumnAppended:Qe,onColumnMoved:Se,validateCell:Dt,highlightRegions:bt,rangeSelect:Te="rect",columnSelect:re="multi",rowSelect:me="multi",rangeSelectionBlending:ye="exclusive",columnSelectionBlending:ne="exclusive",rowSelectionBlending:be="exclusive",onDelete:Oe,onDragStart:Pe,onMouseMove:it,onPaste:Ae,copyHeaders:Ze=!1,freezeColumns:Ie=0,cellActivationBehavior:Me="second-click",rowSelectionMode:ze="auto",columnSelectionMode:ct="auto",onHeaderMenuClick:Je,onHeaderIndicatorClick:We,getGroupDetails:ht,rowGrouping:Wt,onSearchClose:Et,onItemHovered:ut,onSelectionCleared:qt,showSearch:Kt,onVisibleRegionChanged:On,gridSelection:St,onGridSelectionChange:ft,minColumnWidth:Dn=50,maxColumnWidth:wt=500,maxColumnAutoWidth:cn,provideEditor:pn,trailingRowOptions:Re,freezeTrailingRows:dt=0,allowedFillDirections:At="orthogonal",scrollOffsetX:dn,scrollOffsetY:$t,verticalBorder:rn,onDragOverCell:Pn,onDrop:on,onColumnResize:Zt,onColumnResizeEnd:Be,onColumnResizeStart:yt,customRenderers:In,fillHandle:Pt,experimental:pt,fixedShadowX:xn,fixedShadowY:er,headerIcons:tr,imageWindowLoader:B,initialSize:_e,isDraggable:Ne,onDragLeave:Tt,onRowMoved:an,overscrollX:hn,overscrollY:Rn,preventDiagonalScrolling:gn,rightElement:Bt,rightElementProps:En,trapFocus:Cn=!1,smoothScrollX:Lo,smoothScrollY:no,scaleToRem:Hr=!1,rowHeight:xe=34,headerHeight:mt=36,groupHeaderHeight:Ft=mt,theme:_n,isOutsideClick:Tn,renderers:Yt,resizeIndicator:jt,scrollToActiveCell:fn=!0,drawFocusRing:$n=!0,portalElementRef:Ao}=e,Fo=$n==="no-editor"?o===void 0:$n,jn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,mn=jn?.kind??e.rowMarkers??"none",br=jn?.width??e.rowMarkerWidth,ro=jn?.startIndex??e.rowMarkerStartIndex??1,wr=jn?.theme??e.rowMarkerTheme,oo=jn?.headerTheme,Ti=jn?.headerAlwaysVisible,Lr=me!=="multi"||jn?.headerDisabled===!0,io=jn?.checkboxStyle??"square",yr=Math.max(Dn,20),ao=Math.max(wt,yr),Oi=Math.max(cn??ao,yr),zo=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:$e,rowNumberMapper:_o,rowHeight:za,getRowThemeOverride:Ar}=zb(Wt,v,xe,f),_a=d.useMemo(()=>Number.parseFloat(zo.fontSize),[zo]),{rowHeight:nr,headerHeight:$o,groupHeaderHeight:lo,theme:Di,overscrollX:$a,overscrollY:Va}=Lb({groupHeaderHeight:Ft,headerHeight:mt,overscrollX:hn,overscrollY:Rn,remSize:_a,rowHeight:za,scaleToRem:Hr,theme:_n}),rr=Ab(ce),dr=br??(v>1e4?48:v>1e3?44:v>100?36:32),kn=mn!=="none",j=kn?1:0,zt=Re!==void 0,Fr=Re?.sticky===!0,[so,Pi]=d.useState(!1),co=Kt??so,Ba=d.useCallback(()=>{Et!==void 0?Et():Pi(!1)},[Et]),X=d.useMemo(()=>St===void 0?void 0:Qi(St,j),[St,j])??n,$=d.useRef();$.current===void 0&&($.current=new AbortController),d.useEffect(()=>()=>$?.current.abort(),[]);const[te,Ce]=bb(ee,C,j,$.current,$e),Ee=d.useCallback((b,A,F)=>{if(Dt===void 0)return!0;const V=[b[0]-j,b[1]];return Dt?.(V,A,F)},[j,Dt]),ue=d.useRef(St),fe=d.useCallback((b,A)=>{A&&(b=Mb(b,te,j,k,$.current)),ft!==void 0?(ue.current=Qi(b,-j),ft(ue.current)):r(b)},[ft,te,j,k]),je=Ir(Zt,d.useCallback((b,A,F,V)=>{Zt?.(y[F-j],A,F-j,V)},[Zt,j,y])),ke=Ir(Be,d.useCallback((b,A,F,V)=>{Be?.(y[F-j],A,F-j,V)},[Be,j,y])),qe=Ir(yt,d.useCallback((b,A,F,V)=>{yt?.(y[F-j],A,F-j,V)},[yt,j,y])),gt=Ir(x,d.useCallback((b,A)=>x?.({...b,columnIndex:b.columnIndex-j},A)??!1,[x,j])),un=Ir(L,d.useCallback((b,A)=>L?.({...b,col:b.col-j},A)??!1,[L,j])),Gt=d.useCallback(b=>{if(Oe!==void 0){const A=Oe(Qi(b,-j));return typeof A=="boolean"?A:Qi(A,j)}return!0},[Oe,j]),[xt,at,Ge]=vb(X,fe,ye,ne,be,Te,D),st=d.useMemo(()=>mr(ah(),Di),[Di]),[Vt,uo]=d.useState([0,0,0]),zr=d.useMemo(()=>{if(Yt===void 0)return{};const b={};for(const A of Yt)b[A.kind]=A;return b},[Yt]),Qt=d.useCallback(b=>b.kind!==Z.Custom?zr[b.kind]:In?.find(A=>A.isMatch(b)),[In,zr]);let{sizedColumns:ln,nonGrowWidth:Ht}=F0(y,$e,Ce,Vt[0]-(j===0?0:dr)-Vt[2],yr,Oi,st,Qt,$.current);mn!=="none"&&(Ht+=dr);const Vn=d.useMemo(()=>ln.some(b=>b.group!==void 0),[ln]),vn=Vn?$o+lo:$o,hr=X.rows.length,fr=mn==="none"?void 0:hr===0?!1:hr===$e?!0:void 0,lt=d.useMemo(()=>mn==="none"?ln:[{title:"",width:dr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:wr,rowMarker:io,rowMarkerChecked:fr,headerRowMarkerTheme:oo,headerRowMarkerAlwaysVisible:Ti,headerRowMarkerDisabled:Lr},...ln],[mn,ln,dr,wr,io,fr,oo,Ti,Lr]),Jt=d.useRef({height:1,width:1,x:0,y:0}),or=d.useRef(!1),{setVisibleRegion:Hi,visibleRegion:pr,scrollRef:Nt}=Vb(dn,$t,nr,Jt,()=>or.current=!0);Jt.current=pr;const Pf=pr.x+j,Li=pr.y,bn=d.useRef(null),Sn=d.useCallback(b=>{b===!0?bn.current?.focus():window.requestAnimationFrame(()=>{bn.current?.focus()})},[]),wn=zt?$e+1:$e,Bn=d.useCallback(b=>{const A=j===0?b:b.map(V=>({...V,location:[V.location[0]-j,V.location[1]]})),F=de?.(A);if(F!==!0)for(const V of A)oe?.(V.location,V.value);return F},[oe,de,j]),[_r,Na]=d.useState(),Ai=X.current!==void 0&&X.current.range.width*X.current.range.height>1?X.current.range:void 0,Ks=Fo?X.current?.cell:void 0,Fi=Ks?.[0],zi=Ks?.[1],Hf=d.useMemo(()=>{if((bt===void 0||bt.length===0)&&(Ai??Fi??zi??_r)===void 0)return;const b=[];if(bt!==void 0)for(const A of bt){const F=lt.length-A.range.x-j;F>0&&b.push({color:A.color,range:{...A.range,x:A.range.x+j,width:Math.min(F,A.range.width)},style:A.style})}return _r!==void 0&&b.push({color:Yr(st.accentColor,0),range:_r,style:"dashed"}),Ai!==void 0&&b.push({color:Yr(st.accentColor,.5),range:Ai,style:"solid-outline"}),Fi!==void 0&&zi!==void 0&&b.push({color:st.accentColor,range:{x:Fi,y:zi,width:1,height:1},style:"solid-outline"}),b.length>0?b:void 0},[_r,Ai,Fi,zi,bt,lt.length,st.accentColor,j]),Zs=d.useRef(lt);Zs.current=lt;const Hn=d.useCallback(([b,A],F=!1)=>{const V=zt&&A===wn-1;if(b===0&&kn){if(V)return Ji;const W=_o(A);return W===void 0?Ji:{kind:Wn.Marker,allowOverlay:!1,checkboxStyle:io,checked:X?.rows.hasIndex(A)===!0,markerKind:mn==="clickable-number"?"number":mn,row:ro+W,drawHandle:an!==void 0,cursor:mn==="clickable-number"?"pointer":void 0}}else if(V){const W=b===j?Re?.hint??"":"",q=Zs.current[b];if(q?.trailingRowOptions?.disabled===!0)return Ji;{const _=q?.trailingRowOptions?.hint??W,U=q?.trailingRowOptions?.addIcon??Re?.addIcon;return{kind:Wn.NewRow,hint:_,allowOverlay:!1,icon:U}}}else{const W=b-j;if(F||pt?.strict===!0){const _=Jt.current,U=_.x>W||W>_.x+_.width||_.y>A||A>_.y+_.height||A>=Ua.current,J=W===_.extras?.selected?.[0]&&A===_.extras?.selected[1];let ie=!1;if(_.extras?.freezeRegions!==void 0){for(const He of _.extras.freezeRegions)if(Kr(He,W,A)){ie=!0;break}}if(U&&!J&&!ie)return Ji}let q=C([W,A]);return j!==0&&q.span!==void 0&&(q={...q,span:[q.span[0]+j,q.span[1]+j]}),q}},[zt,wn,kn,_o,io,X?.rows,mn,ro,an,j,Re?.hint,Re?.addIcon,pt?.strict,C]),Wa=d.useCallback(b=>{let A=ht?.(b)??{name:b};return pe!==void 0&&b!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>qa({group:A.name,bounds:F.bounds})}]}),A},[ht,pe]),_i=d.useCallback(b=>{const[A,F]=b.cell,V=lt[A],W=V?.group!==void 0?Wa(V.group)?.overrideTheme:void 0,q=V?.themeOverride,_=Ar?.(F);i({...b,theme:mr(st,W,q,_,b.content.themeOverride)})},[Ar,lt,Wa,st]),ho=d.useCallback((b,A,F)=>{if(X.current===void 0)return;const[V,W]=X.current.cell,q=Hn([V,W]);if(q.kind!==Z.Boolean&&q.allowOverlay){let _=q;if(F!==void 0)switch(_.kind){case Z.Number:{const U=em(()=>F==="-"?-0:Number.parseFloat(F),0);_={..._,data:Number.isNaN(U)?0:U};break}case Z.Text:case Z.Markdown:case Z.Uri:_={..._,data:F};break}_i({target:b,content:_,initialValue:F,cell:[V,W],highlight:F===void 0,forceEditMode:F!==void 0,activation:A})}else q.kind===Z.Boolean&&A.inputType==="keyboard"&&q.readonly!==!0&&(Bn([{location:X.current.cell,value:{...q,data:Ch(q.data)}}]),bn.current?.damage([{cell:X.current.cell}]))},[Hn,X,Bn,_i]),Ys=d.useCallback((b,A)=>{const F=bn.current?.getBounds(b,A);if(F===void 0||Nt.current===null)return;const V=Hn([b,A]);V.allowOverlay&&_i({target:F,content:V,initialValue:void 0,highlight:!0,cell:[b,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[Hn,Nt,_i]),Ut=d.useCallback((b,A,F="both",V=0,W=0,q=void 0)=>{if(Nt.current!==null){const _=bn.current,U=l.current,J=typeof b!="number"?b.unit==="cell"?b.amount:void 0:b,ie=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,He=typeof b!="number"&&b.unit==="px"?b.amount:void 0,It=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(_!==null&&U!==null){let Ke={x:0,y:0,width:0,height:0},Ue=0,Xe=0;if((J!==void 0||ie!==void 0)&&(Ke=_.getBounds((J??0)+j,ie??0)??Ke,Ke.width===0||Ke.height===0))return;const et=U.getBoundingClientRect(),vt=et.width/U.offsetWidth;if(He!==void 0&&(Ke={...Ke,x:He-et.left-Nt.current.scrollLeft,width:1}),It!==void 0&&(Ke={...Ke,y:It+et.top-Nt.current.scrollTop,height:1}),Ke!==void 0){const en={x:Ke.x-V,y:Ke.y-W,width:Ke.width+2*V,height:Ke.height+2*W};let bo=0;for(let tl=0;tl<Ie;tl++)bo+=ln[tl].width;let Gi=0;const Uo=dt+(Fr?1:0);Uo>0&&(Gi=to(wn,Uo,nr));let ar=bo*vt+et.left+j*dr*vt,wo=et.right,Nr=et.top+vn*vt,yo=et.bottom-Gi*vt;const Ui=Ke.width+V*2;switch(q?.hAlign){case"start":wo=ar+Ui;break;case"end":ar=wo-Ui;break;case"center":ar=Math.floor((ar+wo)/2)-Ui/2,wo=ar+Ui;break}const Xi=Ke.height+W*2;switch(q?.vAlign){case"start":yo=Nr+Xi;break;case"end":Nr=yo-Xi;break;case"center":Nr=Math.floor((Nr+yo)/2)-Xi/2,yo=Nr+Xi;break}ar>en.x?Ue=en.x-ar:wo<en.x+en.width&&(Ue=en.x+en.width-wo),Nr>en.y?Xe=en.y-Nr:yo<en.y+en.height&&(Xe=en.y+en.height-yo),F==="vertical"||typeof b=="number"&&b<Ie?Ue=0:(F==="horizontal"||typeof A=="number"&&A>=wn-Uo)&&(Xe=0),(Ue!==0||Xe!==0)&&(vt!==1&&(Ue/=vt,Xe/=vt),Nt.current.scrollTo({left:Ue+Nt.current.scrollLeft,top:Xe+Nt.current.scrollTop,behavior:q?.behavior??"auto"}))}}}},[j,dt,dr,Nt,vn,Ie,ln,wn,Fr,nr]),ja=d.useRef(Ys),Ga=d.useRef(C);ja.current=Ys,Ga.current=C;const Ua=d.useRef($e);Ua.current=$e;const Qs=d.useRef(lt.length);Qs.current=lt.length;const xr=d.useCallback(async(b,A=!0,F)=>{if(lt[b]?.trailingRowOptions?.disabled===!0)return;const V=ge?.();let W,q=!0;V!==void 0&&(W=await V,W==="top"&&(q=!1),typeof W=="number"&&(q=!1));let _=0;const U=()=>{if(Ua.current<=$e){_<500&&window.setTimeout(U,_),_=50+_*2;return}const J=typeof W=="number"?W:q?$e:0;ji.current(b-j,J,"both",0,0,F?{behavior:F}:void 0),xt({cell:[b,J],range:{x:b,y:J,width:1,height:1}},!1,!1,"edit");const ie=Ga.current([b-j,J]);ie.allowOverlay&&So(ie)&&ie.readonly!==!0&&A&&window.setTimeout(()=>{ja.current(b,J)},0)};U()},[lt,ge,j,$e,xt]),$i=d.useCallback(async(b,A=!0)=>{const F=Qe?.();let V,W=!0;F!==void 0&&(V=await F,V==="left"&&(W=!1),typeof V=="number"&&(W=!1));let q=0;const _=()=>{if(Qs.current<=lt.length){q<500&&window.setTimeout(_,q),q=50+q*2;return}const U=typeof V=="number"?V:W?lt.length:0;Ut(U-j,b),xt({cell:[U,b],range:{x:U,y:b,width:1,height:1}},!1,!1,"edit");const J=Ga.current([U-j,b]);J.allowOverlay&&So(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{ja.current(U,b)},0)};_()},[lt,Qe,j,Ut,xt]),fo=d.useCallback(b=>{const A=ln[b]?.trailingRowOptions?.targetColumn??Re?.targetColumn;if(typeof A=="number")return A+(kn?1:0);if(typeof A=="object"){const F=y.indexOf(A);if(F>=0)return F+(kn?1:0)}},[ln,y,kn,Re?.targetColumn]),Cr=d.useRef(),po=d.useRef(),Vo=d.useCallback((b,A)=>{const[F,V]=A;return mr(st,lt[F]?.themeOverride,Ar?.(V),b.themeOverride)},[Ar,lt,st]),{mapper:$r}=_b(Wt,v),Gn=Wt?.navigationBehavior,Bo=d.useCallback(b=>{const A=xa.value?b.metaKey:b.ctrlKey,F=A&&me==="multi",[V,W]=b.location,q=X.columns,_=X.rows,[U,J]=X.current?.cell??[];if(b.kind==="cell"){if(po.current=void 0,Vr.current=[V,W],V===0&&kn){if(zt===!0&&W===$e||mn==="number"||me==="none")return;const ie=Hn(b.location);if(ie.kind!==Wn.Marker)return;if(an!==void 0){const Ke=Qt(ie);Fn(Ke?.kind===Wn.Marker);const Ue=Ke?.onClick?.({...b,cell:ie,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,theme:Vo(ie,b.location),preventDefault:()=>{}});if(Ue===void 0||Ue.checked===ie.checked)return}i(void 0),Sn();const He=_.hasIndex(W),It=Cr.current;if(me==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&It!==void 0&&_.hasIndex(It)){const Ke=[Math.min(It,W),Math.max(It,W)+1];F||ze==="multi"?at(void 0,Ke,!0):at(Ye.fromSingleSelection(Ke),void 0,F)}else me==="multi"&&(F||b.isTouch||ze==="multi")?He?at(_.remove(W),void 0,!0):(at(void 0,W,!0),Cr.current=W):He&&_.length===1?at(Ye.empty(),void 0,A):(at(Ye.fromSingleSelection(W),void 0,A),Cr.current=W)}else if(V>=j&&zt&&W===$e){const ie=fo(V);xr(ie??V)}else if(U!==V||J!==W){const ie=Hn(b.location),He=Qt(ie);if(He?.onSelect!==void 0){let Ue=!1;if(He.onSelect({...b,cell:ie,posX:b.localEventX,posY:b.localEventY,bounds:b.bounds,preventDefault:()=>Ue=!0,theme:Vo(ie,b.location)}),Ue)return}if(Gn==="block"&&$r(W).isGroupHeader)return;const It=Fr&&W===$e,Ke=Fr&&X!==void 0&&X.current?.cell[1]===$e;if((b.shiftKey||b.isLongTouch===!0)&&U!==void 0&&J!==void 0&&X.current!==void 0&&!Ke){if(It)return;const Ue=Math.min(V,U),Xe=Math.max(V,U),et=Math.min(W,J),vt=Math.max(W,J);xt({...X.current,range:{x:Ue,y:et,width:Xe-Ue+1,height:vt-et+1}},!0,A,"click"),Cr.current=void 0,Sn()}else xt({cell:[V,W],range:{x:V,y:W,width:1,height:1}},!0,A,"click"),Cr.current=void 0,i(void 0),Sn()}}else if(b.kind==="header")if(Vr.current=[V,W],i(void 0),kn&&V===0)Cr.current=void 0,po.current=void 0,!Lr&&me==="multi"&&(_.length!==$e?at(Ye.fromSingleSelection([0,$e]),void 0,A):at(Ye.empty(),void 0,A),Sn());else{const ie=po.current;if(re==="multi"&&(b.shiftKey||b.isLongTouch===!0)&&ie!==void 0&&q.hasIndex(ie)){const He=[Math.min(ie,V),Math.max(ie,V)+1];A||b.isTouch||ct==="multi"?Ge(void 0,He,A):Ge(Ye.fromSingleSelection(He),void 0,A)}else re==="multi"&&(A||b.isTouch||ct==="multi")?(q.hasIndex(V)?Ge(q.remove(V),void 0,A):Ge(void 0,V,A),po.current=V):re!=="none"&&(q.hasIndex(V)?Ge(q.remove(V),void 0,A):Ge(Ye.fromSingleSelection(V),void 0,A),po.current=V);Cr.current=void 0,Sn()}else b.kind===Kn?Vr.current=[V,W]:b.kind===Ca&&!b.isMaybeScrollbar&&(fe(ea,!1),i(void 0),Sn(),qt?.(),Cr.current=void 0,po.current=void 0)},[me,re,X,kn,j,zt,$e,mn,Hn,an,Sn,ze,ct,Qt,Vo,at,fo,xr,Gn,$r,Fr,xt,Lr,Ge,fe,qt]),No=d.useRef(!1),Vr=d.useRef(),Js=d.useRef(pr),ir=d.useRef(),Lf=d.useCallback(b=>{if(go.current=!1,Js.current=Jt.current,b.button!==0&&b.button!==1){ir.current=void 0;return}const A=performance.now();ir.current={button:b.button,time:A,location:b.location},b?.kind==="header"&&(No.current=!0);const F=b.kind==="cell"&&b.isFillHandle;!F&&b.kind!=="cell"&&b.isEdge||(c({previousSelection:X,fillHandle:F}),Vr.current=void 0,!b.isTouch&&b.button===0&&!F?Bo(b):!b.isTouch&&b.button===1&&(Vr.current=b.location))},[X,Bo]),[Xa,qa]=d.useState(),ec=d.useCallback(b=>{if(b.kind!==Kn||re!=="multi")return;const A=xa.value?b.metaKey:b.ctrlKey,[F]=b.location,V=X.columns;if(F<j)return;const W=lt[F];let q=F,_=F;for(let U=F-1;U>=j&&wi(W.group,lt[U].group);U--)q--;for(let U=F+1;U<lt.length&&wi(W.group,lt[U].group);U++)_++;if(Sn(),A||b.isTouch||ct==="multi")if(V.hasAll([q,_+1])){let U=V;for(let J=q;J<=_;J++)U=U.remove(J);Ge(U,void 0,A)}else Ge(void 0,[q,_+1],A);else Ge(Ye.fromSingleSelection([q,_+1]),void 0,A)},[re,Sn,X.columns,lt,j,Ge,ct]),go=d.useRef(!1),Vi=d.useCallback(async b=>{if(te!==void 0&&je!==void 0){const A=Jt.current.y,F=Jt.current.height;let V=te({x:b,y:A,width:1,height:Math.min(F,$e-A)},$.current.signal);typeof V!="object"&&(V=await V());const W=ln[b-j],q=document.createElement("canvas").getContext("2d",{alpha:!1});if(q!==null){q.font=st.baseFontFull;const _=ch(q,st,W,0,V,yr,ao,!1,Qt);je?.(W,_.width,b,_.width)}}},[ln,te,ao,st,yr,je,j,$e,Qt]),[Af,Ka]=d.useState(),mo=d.useCallback(async(b,A)=>{const F=b.current?.range;if(F===void 0||te===void 0||A.current===void 0)return;const V=A.current.range;if(M!==void 0){let U=!1;if(M({fillDestination:{...V,x:V.x-j},patternSource:{...F,x:F.x-j},preventDefault:()=>U=!0}),U)return}let W=te(F,$.current.signal);typeof W!="object"&&(W=await W());const q=W,_=[];for(let U=0;U<V.width;U++)for(let J=0;J<V.height;J++){const ie=[V.x+U,V.y+J];if(Yd(ie,F))continue;const He=q[J%F.height][U%F.width];Io(He)||!So(He)||_.push({location:ie,value:{...He}})}Bn(_),bn.current?.damage(_.map(U=>({cell:U.location})))},[te,Bn,M,j]),tc=d.useCallback(()=>{if(X.current===void 0||X.current.range.width<=1)return;const b={...X,current:{...X.current,range:{...X.current.range,width:1}}};mo(b,X)},[mo,X]),nc=d.useCallback(()=>{if(X.current===void 0||X.current.range.height<=1)return;const b={...X,current:{...X.current,range:{...X.current.range,height:1}}};mo(b,X)},[mo,X]),Ff=d.useCallback((b,A)=>{const F=s;if(c(void 0),Na(void 0),Ka(void 0),No.current=!1,A)return;if(F?.fillHandle===!0&&X.current!==void 0&&F.previousSelection?.current!==void 0){if(_r===void 0)return;const He={...X,current:{...X.current,range:ph(F.previousSelection.current.range,_r)}};mo(F.previousSelection,He),fe(He,!0);return}const[V,W]=b.location,[q,_]=Vr.current??[],U=()=>{go.current=!0},J=He=>{const It=He.isTouch||q===V&&_===W;if(It&&R?.([V-j,W],{...He,preventDefault:U}),He.button===1)return!go.current;if(!go.current){const Ke=Hn(b.location),Ue=Qt(Ke);if(Ue!==void 0&&Ue.onClick!==void 0&&It){const et=Ue.onClick({...He,cell:Ke,posX:He.localEventX,posY:He.localEventY,bounds:He.bounds,theme:Vo(Ke,b.location),preventDefault:U});et!==void 0&&!Io(et)&&ko(et)&&(Bn([{location:He.location,value:et}]),bn.current?.damage([{cell:He.location}]))}if(go.current||X.current===void 0)return!1;let Xe=!1;switch(Ke.activationBehaviorOverride??Me){case"double-click":case"second-click":{if(F?.previousSelection?.current?.cell===void 0)break;const[et,vt]=X.current.cell,[en,bo]=F.previousSelection.current.cell;Xe=V===et&&V===en&&W===vt&&W===bo&&(He.isDoubleClick===!0||Me==="second-click");break}case"single-click":{Xe=!0;break}}if(Xe){const et={inputType:"pointer",pointerActivation:He.isDoubleClick===!0?"double-click":Ke.activationBehaviorOverride??Me,pointerType:He.isTouch?"touch":"mouse"};return E?.([V-j,W],et),ho(He.bounds,et),!0}}return!1},ie=b.location[0]-j;if(b.isTouch){const He=Jt.current,It=Js.current;if(He.x!==It.x||He.y!==It.y)return;if(b.isLongTouch===!0){if(b.kind==="cell"&&pi(X.current?.cell,b.location)){N?.([ie,b.location[1]],{...b,preventDefault:U});return}else if(b.kind==="header"&&X.columns.hasIndex(V)){ae?.(ie,{...b,preventDefault:U});return}else if(b.kind===Kn){if(ie<0)return;K?.(ie,{...b,preventDefault:U});return}}b.kind==="cell"?J(b)||Bo(b):b.kind===Kn?Q?.(ie,{...b,preventDefault:U}):(b.kind===Rr&&I?.(ie,{...b,preventDefault:U}),Bo(b));return}if(b.kind==="header"){if(ie<0)return;b.isEdge?b.isDoubleClick===!0&&Vi(V):b.button===0&&V===q&&W===_&&I?.(ie,{...b,preventDefault:U})}if(b.kind===Kn){if(ie<0)return;b.button===0&&V===q&&W===_&&(Q?.(ie,{...b,preventDefault:U}),go.current||ec(b))}b.kind==="cell"&&(b.button===0||b.button===1)&&J(b),Vr.current=void 0},[s,X,j,_r,mo,fe,R,Hn,Qt,Me,Vo,Bn,E,ho,N,ae,K,Bo,Q,I,Vi,ec]),zf=d.useCallback(b=>{const A={...b,location:[b.location[0]-j,b.location[1]]};it?.(A),s!==void 0&&b.buttons===0&&(c(void 0),Na(void 0),Ka(void 0),No.current=!1),Ka(F=>No.current?[b.scrollEdge[0],0]:b.scrollEdge[0]===F?.[0]&&b.scrollEdge[1]===F[1]?F:s===void 0||(ir.current?.location[0]??0)<j?void 0:b.scrollEdge)},[s,it,j]),_f=d.useCallback((b,A)=>{Je?.(b-j,A)},[Je,j]),$f=d.useCallback((b,A)=>{We?.(b-j,A)},[We,j]),vo=X?.current?.cell,Vf=d.useCallback((b,A,F,V,W,q)=>{or.current=!1;let _=vo;_!==void 0&&(_=[_[0]-j,_[1]]);const U=Ie===0?void 0:{x:0,y:b.y,width:Ie,height:b.height},J=[];U!==void 0&&J.push(U),dt>0&&(J.push({x:b.x-j,y:$e-dt,width:b.width,height:dt}),Ie>0&&J.push({x:0,y:$e-dt,width:Ie,height:dt}));const ie={x:b.x-j,y:b.y,width:b.width,height:zt&&b.y+b.height>=$e?b.height-1:b.height,tx:W,ty:q,extras:{selected:_,freezeRegion:U,freezeRegions:J}};Jt.current=ie,Hi(ie),uo([A,F,V]),On?.(ie,ie.tx,ie.ty,ie.extras)},[vo,j,zt,$e,Ie,dt,Hi,On]),Bf=Ir(O,d.useCallback((b,A)=>O?.(b-j,A-j)!==!1,[O,j])),Nf=Ir(Se,d.useCallback((b,A)=>{Se?.(b-j,A-j),re!=="none"&&Ge(Ye.fromSingleSelection(A),void 0,!0)},[re,Se,j,Ge])),Za=d.useRef(!1),Wf=d.useCallback(b=>{if(b.location[0]===0&&j>0){b.preventDefault();return}Pe?.({...b,location:[b.location[0]-j,b.location[1]]}),b.defaultPrevented()||(Za.current=!0),c(void 0)},[Pe,j]),jf=d.useCallback(()=>{Za.current=!1},[]),rc=Wt?.selectionBehavior,Bi=d.useCallback(b=>{if(rc!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:V}=$r(b);if(A)return[b,b];const W=F[F.length-1],q=b-W,_=b+V-W-1;return[q,_]},[$r,rc]),Ya=d.useRef(),Qa=d.useCallback(b=>{if(!yh(b,Ya.current)&&(Ya.current=b,!(ir?.current?.button!==void 0&&ir.current.button>=1))){if(b.buttons!==0&&s!==void 0&&ir.current?.location[0]===0&&j===1&&me==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(ir.current.location[1])&&X.rows.hasIndex(ir.current.location[1])){const A=Math.min(ir.current.location[1],b.location[1]),F=Math.max(ir.current.location[1],b.location[1])+1;at(Ye.fromSingleSelection([A,F]),void 0,!1)}else if(b.buttons!==0&&s!==void 0&&X.current!==void 0&&!Za.current&&!No.current&&(Te==="rect"||Te==="multi-rect")){const[A,F]=X.current.cell;let[V,W]=b.location;if(W<0&&(W=Jt.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const q=s.previousSelection.current.range;W=Math.min(W,zt?$e-1:$e);const _=Sv(q,V,W,At);Na(_)}else{if(zt&&F===$e)return;if(zt&&W===$e)if(b.kind===Ca)W--;else return;V=Math.max(V,j);const q=Bi(F);W=q===void 0?W:Nn(W,q[0],q[1]);const _=V-A,U=W-F,J={x:_>=0?A:V,y:U>=0?F:W,width:Math.abs(_)+1,height:Math.abs(U)+1};xt({...X.current,range:J},!0,!1,"drag")}}ut?.({...b,location:[b.location[0]-j,b.location[1]]})}},[s,j,me,X,Te,ut,at,zt,$e,At,Bi,xt]),Gf=d.useCallback(()=>{const b=Ya.current;if(b===void 0)return;const[A,F]=b.scrollEdge;let[V,W]=b.location;const q=Jt.current;A===-1?V=q.extras?.freezeRegion?.x??q.x:A===1&&(V=q.x+q.width),F===-1?W=Math.max(0,q.y):F===1&&(W=Math.min($e-1,q.y+q.height)),V=Nn(V,0,lt.length-1),W=Nn(W,0,$e-1),Qa({...b,location:[V,W]})},[lt.length,Qa,$e]);Hb(Af,Nt,Gf);const Un=d.useCallback(b=>{if(X.current===void 0)return;const[A,F]=b,[V,W]=X.current.cell,q=X.current.range;let _=q.x,U=q.x+q.width,J=q.y,ie=q.y+q.height;const[He,It]=Bi(W)??[0,$e-1],Ke=It+1;if(F!==0)switch(F){case 2:{ie=Ke,J=W,Ut(0,ie,"vertical");break}case-2:{J=He,ie=W+1,Ut(0,J,"vertical");break}case 1:{J<W?(J++,Ut(0,J,"vertical")):(ie=Math.min(Ke,ie+1),Ut(0,ie,"vertical"));break}case-1:{ie>W+1?(ie--,Ut(0,ie,"vertical")):(J=Math.max(He,J-1),Ut(0,J,"vertical"));break}default:vi()}if(A!==0)if(A===2)U=lt.length,_=V,Ut(U-1-j,0,"horizontal");else if(A===-2)_=j,U=V+1,Ut(_-j,0,"horizontal");else{let Ue=[];if(te!==void 0){const Xe=te({x:_,y:J,width:U-_-j,height:ie-J},$.current.signal);typeof Xe=="object"&&(Ue=Wb(Xe))}if(A===1){let Xe=!1;if(_<V){if(Ue.length>0){const et=Tr(_+1,V+1).find(vt=>!Ue.includes(vt-j));et!==void 0&&(_=et,Xe=!0)}else _++,Xe=!0;Xe&&Ut(_,0,"horizontal")}Xe||(U=Math.min(lt.length,U+1),Ut(U-1-j,0,"horizontal"))}else if(A===-1){let Xe=!1;if(U>V+1){if(Ue.length>0){const et=Tr(U-1,V,-1).find(vt=>!Ue.includes(vt-j));et!==void 0&&(U=et,Xe=!0)}else U--,Xe=!0;Xe&&Ut(U-j,0,"horizontal")}Xe||(_=Math.max(j,_-1),Ut(_-j,0,"horizontal"))}else vi()}xt({cell:X.current.cell,range:{x:_,y:J,width:U-_,height:ie-J}},!0,!1,"keyboard-select")},[te,Bi,X,lt.length,j,$e,Ut,xt]),Ja=d.useRef(fn);Ja.current=fn;const kr=d.useCallback((b,A,F,V)=>{const W=wn-(F?0:1);b=Nn(b,j,ln.length-1+j),A=Nn(A,0,W);const q=vo?.[0],_=vo?.[1];if(b===q&&A===_)return!1;if(V&&X.current!==void 0){const U=[...X.current.rangeStack];(X.current.range.width>1||X.current.range.height>1)&&U.push(X.current.range),fe({...X,current:{cell:[b,A],range:{x:b,y:A,width:1,height:1},rangeStack:U}},!0)}else xt({cell:[b,A],range:{x:b,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===b&&u.current[1]===A&&(u.current=void 0),Ja.current&&Ut(b-j,A),!0},[wn,j,ln.length,vo,X,Ut,fe,xt]),Uf=d.useCallback((b,A)=>{o?.cell!==void 0&&b!==void 0&&ko(b)&&(Bn([{location:o.cell,value:b}]),window.requestAnimationFrame(()=>{bn.current?.damage([{cell:o.cell}])})),Sn(!0),i(void 0);const[F,V]=A;if(X.current!==void 0&&(F!==0||V!==0)){const W=X.current.cell[1]===wn-1&&b!==void 0,q=X.current.cell[0]===lt.length-1&&b!==void 0;let _=!0;if(W&&V===1&&ge!==void 0){_=!1;const U=X.current.cell[0]+F,J=fo(U);xr(J??U,!1)}if(q&&F===1&&Qe!==void 0){_=!1;const U=X.current.cell[1]+V;$i(U,!1)}_&&kr(Nn(X.current.cell[0]+F,0,lt.length-1),Nn(X.current.cell[1]+V,0,wn-1),W,!1)}H?.(b,A)},[o?.cell,Sn,X,H,Bn,wn,kr,lt.length,xr,$i,ge,Qe,fo]),Xf=d.useMemo(()=>`gdg-overlay-${Nb++}`,[]),Br=d.useCallback(b=>{Sn();const A=[];for(let F=b.x;F<b.x+b.width;F++)for(let V=b.y;V<b.y+b.height;V++){const W=C([F-j,V]);if(!W.allowOverlay&&W.kind!==Z.Boolean)continue;let q;if(W.kind===Z.Custom){const _=Qt(W),U=_?.provideEditor?.({...W,location:[F-j,V]});_?.onDelete!==void 0?q=_.onDelete(W):tm(U)&&(q=U?.deletedValue?.(W))}else(ko(W)&&W.allowOverlay||W.kind===Z.Boolean)&&(q=Qt(W)?.onDelete?.(W));q!==void 0&&!Io(q)&&ko(q)&&A.push({location:[F,V],value:q})}Bn(A),bn.current?.damage(A.map(F=>({cell:F.location})))},[Sn,C,Qt,Bn,j]),Wo=o!==void 0,oc=d.useCallback(b=>{const A=()=>{b.stopPropagation(),b.preventDefault()},F={didMatch:!1},{bounds:V}=b,W=X.columns,q=X.rows,_=rr;if(!Wo&&tt(_.clear,b,F))fe(ea,!1),qt?.();else if(!Wo&&tt(_.selectAll,b,F))fe({columns:Ye.empty(),rows:Ye.empty(),current:{cell:X.current?.cell??[j,0],range:{x:j,y:0,width:y.length,height:$e},rangeStack:[]}},!1);else if(tt(_.search,b,F))a?.current?.focus({preventScroll:!0}),Pi(!0);else if(tt(_.delete,b,F)){const Xe=Gt?.(X)??!0;if(Xe!==!1){const et=Xe===!0?X:Xe;if(et.current!==void 0){Br(et.current.range);for(const vt of et.current.rangeStack)Br(vt)}for(const vt of et.rows)Br({x:j,y:vt,width:y.length,height:1});for(const vt of et.columns)Br({x:vt,y:0,width:1,height:$e})}}if(F.didMatch)return A(),!0;if(X.current===void 0)return!1;let[U,J]=X.current.cell;const[,ie]=X.current.cell;let He=!1,It=!1;if(tt(_.scrollToSelectedCell,b,F))ji.current(U-j,J);else if(re!=="none"&&tt(_.selectColumn,b,F))W.hasIndex(U)?Ge(W.remove(U),void 0,!0):re==="single"?Ge(Ye.fromSingleSelection(U),void 0,!0):Ge(void 0,U,!0);else if(me!=="none"&&tt(_.selectRow,b,F))q.hasIndex(J)?at(q.remove(J),void 0,!0):me==="single"?at(Ye.fromSingleSelection(J),void 0,!0):at(void 0,J,!0);else if(!Wo&&V!==void 0&&tt(_.activateCell,b,F))if(J===$e&&zt)window.setTimeout(()=>{const Xe=fo(U);xr(Xe??U)},0);else{const Xe={inputType:"keyboard",key:b.key};E?.([U-j,J],Xe),ho(V,Xe)}else X.current.range.height>1&&tt(_.downFill,b,F)?nc():X.current.range.width>1&&tt(_.rightFill,b,F)?tc():tt(_.goToNextPage,b,F)?J+=Math.max(1,Jt.current.height-4):tt(_.goToPreviousPage,b,F)?J-=Math.max(1,Jt.current.height-4):tt(_.goToFirstCell,b,F)?(i(void 0),J=0,U=0):tt(_.goToLastCell,b,F)?(i(void 0),J=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER):tt(_.selectToFirstCell,b,F)?(i(void 0),Un([-2,-2])):tt(_.selectToLastCell,b,F)?(i(void 0),Un([2,2])):Wo?(tt(_.closeOverlay,b,F)&&i(void 0),tt(_.acceptOverlayDown,b,F)&&(i(void 0),J++),tt(_.acceptOverlayUp,b,F)&&(i(void 0),J--),tt(_.acceptOverlayLeft,b,F)&&(i(void 0),U--),tt(_.acceptOverlayRight,b,F)&&(i(void 0),U++)):(tt(_.goDownCell,b,F)?J+=1:tt(_.goUpCell,b,F)?J-=1:tt(_.goRightCell,b,F)?U+=1:tt(_.goLeftCell,b,F)?U-=1:tt(_.goDownCellRetainSelection,b,F)?(J+=1,He=!0):tt(_.goUpCellRetainSelection,b,F)?(J-=1,He=!0):tt(_.goRightCellRetainSelection,b,F)?(U+=1,He=!0):tt(_.goLeftCellRetainSelection,b,F)?(U-=1,He=!0):tt(_.goToLastRow,b,F)?J=$e-1:tt(_.goToFirstRow,b,F)?J=Number.MIN_SAFE_INTEGER:tt(_.goToLastColumn,b,F)?U=Number.MAX_SAFE_INTEGER:tt(_.goToFirstColumn,b,F)?U=Number.MIN_SAFE_INTEGER:(Te==="rect"||Te==="multi-rect")&&(tt(_.selectGrowDown,b,F)?Un([0,1]):tt(_.selectGrowUp,b,F)?Un([0,-1]):tt(_.selectGrowRight,b,F)?Un([1,0]):tt(_.selectGrowLeft,b,F)?Un([-1,0]):tt(_.selectToLastRow,b,F)?Un([0,2]):tt(_.selectToFirstRow,b,F)?Un([0,-2]):tt(_.selectToLastColumn,b,F)?Un([2,0]):tt(_.selectToFirstColumn,b,F)&&Un([-2,0])),It=F.didMatch);if(Gn!==void 0&&Gn!=="normal"&&J!==ie){const Xe=Gn==="skip-up"||Gn==="skip"||Gn==="block",et=Gn==="skip-down"||Gn==="skip"||Gn==="block",vt=J<ie;if(vt&&Xe){for(;J>=0&&$r(J).isGroupHeader;)J--;J<0&&(J=ie)}else if(!vt&&et){for(;J<$e&&$r(J).isGroupHeader;)J++;J>=$e&&(J=ie)}}const Ke=kr(U,J,!1,He),Ue=F.didMatch;return Ue&&(Ke||!It||Cn)&&A(),Ue},[Gn,Wo,X,rr,re,me,Te,j,$r,$e,kr,fe,qt,y.length,Gt,Cn,Br,Ge,at,zt,fo,xr,E,ho,nc,tc,Un]),jo=d.useCallback(b=>{let A=!1;if(G!==void 0&&G({...b,...b.location&&{location:[b.location[0]-j,b.location[1]]},cancel:()=>{A=!0}}),A||oc(b)||X.current===void 0)return;const[F,V]=X.current.cell,W=Jt.current;if(we&&!b.metaKey&&!b.ctrlKey&&X.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(C([F-j,Math.max(0,Math.min(V,$e-1))]))){if((!zt||V!==$e)&&(W.y>V||V>W.y+W.height||W.x>F||F>W.x+W.width))return;const q={inputType:"keyboard",key:b.key};E?.([F-j,V],q),ho(b.bounds,q,b.key),b.stopPropagation(),b.preventDefault()}},[we,G,oc,X,C,j,$e,zt,E,ho]),qf=d.useCallback((b,A)=>{const F=b.location[0]-j;if(b.kind==="header"&&ae?.(F,{...b,preventDefault:A}),b.kind===Kn){if(F<0)return;K?.(F,{...b,preventDefault:A})}if(b.kind==="cell"){const[V,W]=b.location;N?.([F,W],{...b,preventDefault:A}),y0(X,b.location)||kr(V,W,!1,!1)}},[X,N,K,ae,j,kr]),el=d.useCallback(async b=>{if(!rr.paste)return;function A(_,U,J,ie){const He=typeof J=="object"?J?.join(`
183
- `)??"":J?.toString()??"";if(!Io(_)&&So(_)&&_.readonly!==!0){const It=S?.(He,_);if(It!==void 0&&ko(It))return{location:U,value:It};const Ke=Qt(_);if(Ke===void 0)return;if(Ke.kind===Z.Custom){Fn(_.kind===Z.Custom);const Ue=Ke.onPaste?.(He,_.data);return Ue===void 0?void 0:{location:U,value:{..._,data:Ue}}}else{const Ue=Ke.onPaste?.(He,_,{formatted:ie,formattedString:typeof ie=="string"?ie:ie?.join(`
184
- `),rawValue:J});return Ue===void 0?void 0:(Fn(Ue.kind===_.kind),{location:U,value:Ue})}}}const F=X.columns,V=X.rows,W=Nt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0;let q;if(X.current!==void 0?q=[X.current.range.x,X.current.range.y]:F.length===1?q=[F.first()??0,0]:V.length===1&&(q=[j,V.first()??0]),W&&q!==void 0){let _,U;const J="text/plain",ie="text/html";if(navigator.clipboard.read!==void 0){const Ue=await navigator.clipboard.read();for(const Xe of Ue){if(Xe.types.includes(ie)){const et=await(await Xe.getType(ie)).text(),vt=cu(et);if(vt!==void 0){_=vt;break}}Xe.types.includes(J)&&(U=await(await Xe.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(ie)){const Ue=b.clipboardData.getData(ie);_=cu(Ue)}_===void 0&&b.clipboardData.types.includes(J)&&(U=b.clipboardData.getData(J))}else return;const[He,It]=q,Ke=[];do{if(Ae===void 0){const Ue=Hn(q),Xe=U??_?.map(vt=>vt.map(en=>en.rawValue).join(" ")).join(" ")??"",et=A(Ue,q,Xe,void 0);et!==void 0&&Ke.push(et);break}if(_===void 0){if(U===void 0)return;_=Ib(U)}if(Ae===!1||typeof Ae=="function"&&Ae?.([q[0]-j,q[1]],_.map(Ue=>Ue.map(Xe=>Xe.rawValue?.toString()??"")))!==!0)return;for(const[Ue,Xe]of _.entries()){if(Ue+It>=$e)break;for(const[et,vt]of Xe.entries()){const en=[et+He,Ue+It],[bo,Gi]=en;if(bo>=lt.length||Gi>=wn)continue;const Uo=Hn(en),ar=A(Uo,en,vt.rawValue,vt.formatted);ar!==void 0&&Ke.push(ar)}}}while(!1);Bn(Ke),bn.current?.damage(Ke.map(Ue=>({cell:Ue.location})))}},[S,Qt,Hn,X,rr.paste,Nt,lt.length,Bn,wn,Ae,j,$e]);Mn("paste",el,h,!1,!0);const Go=d.useCallback(async(b,A)=>{if(!rr.copy)return;const F=A===!0||Nt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0,V=X.columns,W=X.rows,q=(_,U)=>{if(!Ze)du(_,U,b);else{const J=U.map(ie=>({kind:Z.Text,data:y[ie].title,displayData:y[ie].title,allowOverlay:!1}));du([J,..._],U,b)}};if(F&&te!==void 0){if(X.current!==void 0){let _=te(X.current.range,$.current.signal);typeof _!="object"&&(_=await _()),q(_,Tr(X.current.range.x-j,X.current.range.x+X.current.range.width-j))}else if(W!==void 0&&W.length>0){const _=[...W].map(U=>{const J=te({x:j,y:U,width:y.length,height:1},$.current.signal);return typeof J=="object"?J[0]:J().then(ie=>ie[0])});if(_.some(U=>U instanceof Promise)){const U=await Promise.all(_);q(U,Tr(y.length))}else q(_,Tr(y.length))}else if(V.length>0){const _=[],U=[];for(const J of V){let ie=te({x:J,y:0,width:1,height:$e},$.current.signal);typeof ie!="object"&&(ie=await ie()),_.push(ie),U.push(J-j)}if(_.length===1)q(_[0],U);else{const J=_.reduce((ie,He)=>ie.map((It,Ke)=>[...It,...He[Ke]]));q(J,U)}}}},[y,te,X,rr.copy,j,Nt,$e,Ze]);Mn("copy",Go,h,!1,!1);const Kf=d.useCallback(async b=>{if(!(!rr.cut||!(Nt.current?.contains(document.activeElement)===!0||l.current?.contains(document.activeElement)===!0))&&(await Go(b),X.current!==void 0)){let A={current:{cell:X.current.cell,range:X.current.range,rangeStack:[]},rows:Ye.empty(),columns:Ye.empty()};const F=Gt?.(A);if(F===!1||(A=F===!0?A:F,A.current===void 0))return;Br(A.current.range)}},[Br,X,rr.cut,Go,Nt,Gt]);Mn("cut",Kf,h,!1,!1);const Zf=d.useCallback((b,A)=>{if(he!==void 0){j!==0&&(b=b.map(W=>[W[0]-j,W[1]])),he(b,A);return}if(b.length===0||A===-1)return;const[F,V]=b[A];u.current!==void 0&&u.current[0]===F&&u.current[1]===V||(u.current=[F,V],kr(F,V,!1,!1))},[he,j,kr]),[Ni,Wi]=St?.current?.cell??[],ji=d.useRef(Ut);ji.current=Ut,d.useLayoutEffect(()=>{Ja.current&&!or.current&&Ni!==void 0&&Wi!==void 0&&(Ni!==ue.current?.current?.cell[0]||Wi!==ue.current?.current?.cell[1])&&ji.current(Ni,Wi),or.current=!1},[Ni,Wi]);const ic=X.current!==void 0&&(X.current.cell[0]>=lt.length||X.current.cell[1]>=wn);d.useLayoutEffect(()=>{ic&&fe(ea,!1)},[ic,fe]);const Yf=d.useMemo(()=>zt===!0&&Re?.tint===!0?Ye.fromSingleSelection(wn-1):Ye.empty(),[wn,zt,Re?.tint]),Qf=d.useCallback(b=>typeof rn=="boolean"?rn:rn?.(b-j)??!0,[j,rn]),Jf=d.useMemo(()=>{if(Xa===void 0||l.current===null)return null;const{bounds:b,group:A}=Xa,F=l.current.getBoundingClientRect();return d.createElement(gb,{bounds:b,group:A,canvasBounds:F,onClose:()=>qa(void 0),onFinish:V=>{qa(void 0),pe?.(A,V)}})},[pe,Xa]),ep=Math.min(lt.length,Ie+(kn?1:0));d.useImperativeHandle(t,()=>({appendRow:(b,A)=>xr(b+j,A),appendColumn:(b,A)=>$i(b,A),updateCells:b=>(j!==0&&(b=b.map(A=>({cell:[A.cell[0]+j,A.cell[1]]}))),bn.current?.damage(b)),getBounds:(b,A)=>{if(!(l?.current===null||Nt?.current===null)){if(b===void 0&&A===void 0){const F=l.current.getBoundingClientRect(),V=F.width/Nt.current.clientWidth;return{x:F.x-Nt.current.scrollLeft*V,y:F.y-Nt.current.scrollTop*V,width:Nt.current.scrollWidth*V,height:Nt.current.scrollHeight*V}}return bn.current?.getBounds((b??0)+j,A)}},focus:()=>bn.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 el();break}},scrollTo:Ut,remeasureColumns:b=>{for(const A of b)Vi(A+j)},getMouseArgsForPosition:(b,A,F)=>{if(bn?.current===null)return;const V=bn.current.getMouseArgsForPosition(b,A,F);if(V!==void 0)return{...V,location:[V.location[0]-j,V.location[1]]}}}),[xr,$i,Vi,Nt,Go,jo,el,j,Ut]);const[ac,lc]=vo??[],tp=d.useCallback(b=>{const[A,F]=b;if(F===-1){re!=="none"&&(Ge(Ye.fromSingleSelection(A),void 0,!1),Sn());return}ac===A&&lc===F||(xt({cell:b,range:{x:A,y:F,width:1,height:1}},!0,!1,"keyboard-nav"),Ut(A,F))},[re,Sn,Ut,ac,lc,xt,Ge]),[np,rp]=d.useState(!1),sc=d.useRef(Ad(b=>{rp(b)},5)),op=d.useCallback(()=>{sc.current(!0),X.current===void 0&&X.columns.length===0&&X.rows.length===0&&s===void 0&&xt({cell:[j,Li],range:{x:j,y:Li,width:1,height:1}},!0,!1,"keyboard-select")},[Li,X,s,j,xt]),ip=d.useCallback(()=>{sc.current(!1)},[]),[ap,lp]=d.useMemo(()=>{let b;const A=pt?.scrollbarWidthOverride??$l(),F=$e+(zt?1:0);if(typeof nr=="number")b=vn+F*nr;else{let W=0;const q=Math.min(F,10);for(let _=0;_<q;_++)W+=nr(_);W=Math.floor(W/q),b=vn+F*W}b+=A;const V=lt.reduce((W,q)=>q.width+W,0)+A;return[`${Math.min(1e5,V)}px`,`${Math.min(1e5,b)}px`]},[lt,pt?.scrollbarWidthOverride,nr,$e,zt,vn]),sp=d.useMemo(()=>L0(st),[st]);return d.createElement(lh.Provider,{value:st},d.createElement(Ob,{style:sp,className:Y,inWidth:m??ap,inHeight:w??lp},d.createElement(db,{fillHandle:Pt,drawFocusRing:Fo,experimental:pt,fixedShadowX:xn,fixedShadowY:er,getRowThemeOverride:Ar,headerIcons:tr,imageWindowLoader:B,initialSize:_e,isDraggable:Ne,onDragLeave:Tt,onRowMoved:an,overscrollX:$a,overscrollY:Va,preventDiagonalScrolling:gn,rightElement:Bt,rightElementProps:En,smoothScrollX:Lo,smoothScrollY:no,className:Y,enableGroups:Vn,onCanvasFocused:op,onCanvasBlur:ip,canvasRef:l,onContextMenu:qf,theme:st,cellXOffset:Pf,cellYOffset:Li,accessibilityHeight:pr.height,onDragEnd:jf,columns:lt,nonGrowWidth:Ht,drawHeader:gt,onColumnProposeMove:Bf,drawCell:un,disabledRows:Yf,freezeColumns:ep,lockColumns:j,firstColAccessible:j===0,getCellContent:Hn,minColumnWidth:yr,maxColumnWidth:ao,searchInputRef:a,showSearch:co,onSearchClose:Ba,highlightRegions:Hf,getCellsForSelection:te,getGroupDetails:Wa,headerHeight:$o,isFocused:np,groupHeaderHeight:Vn?lo:0,freezeTrailingRows:dt+(zt&&Re?.sticky===!0?1:0),hasAppendRow:zt,onColumnResize:je,onColumnResizeEnd:ke,onColumnResizeStart:qe,onCellFocused:tp,onColumnMoved:Nf,onDragStart:Wf,onHeaderMenuClick:_f,onHeaderIndicatorClick:$f,onItemHovered:Qa,isFilling:s?.fillHandle===!0,onMouseMove:zf,onKeyDown:jo,onKeyUp:le,onMouseDown:Lf,onMouseUp:Ff,onDragOverCell:Pn,onDrop:on,onSearchResultsChanged:Zf,onVisibleRegionChanged:Vf,clientSize:Vt,rowHeight:nr,searchResults:se,searchValue:P,onSearchValueChange:z,rows:wn,scrollRef:Nt,selection:X,translateX:pr.tx,translateY:pr.ty,verticalBorder:Qf,gridRef:bn,getCellRenderer:Qt,resizeIndicator:jt}),Jf,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(Bb,{...o,validateCell:Ee,bloom:T,id:Xf,getCellRenderer:Qt,className:pt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:pn,imageEditorOverride:g,portalElementRef:Ao,onFinishEditing:Uf,markdownDivCreateNode:p,isOutsideClick:Tn,customEventTarget:pt?.eventTarget}))))},Gb=d.forwardRef(jb);function pu(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:a,height:l,x:s,y:c}=o,u=t.maxSize??i.checkboxMaxSize,h=Math.floor(o.y+l/2),g=_d(u,l,i.cellVerticalPadding),f=zd(t.contentAlign??"center",s,a,i.cellHorizontalPadding,g),p=Fd(f,h,g),m=$d(s+n,c+r,p);return as(t)&&m}const Ub={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Xb(e,e.cell.data,as(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{pu(e)&&e.preventDefault()},onClick:e=>{if(pu(e))return{...e.cell,data:Ch(e.cell.data)}},onPaste:(e,t)=>{let n=pa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=is),n===t.data?void 0:{...t,data:n}}};function Xb(e,t,n,r,o){if(!n&&t===pa)return;const{ctx:i,hoverAmount:a,theme:l,rect:s,highlighted:c,hoverX:u,hoverY:h,cell:{contentAlign:g}}=e,{x:f,y:p,width:m,height:w}=s;let y=!1;if(o>0){let v=n?1-o+o*a:.4;if(t===pa&&(v*=a),v===0)return;v<1&&(y=!0,i.globalAlpha=v)}Cs(i,l,t,f,p,m,w,c,u,h,r,g),y&&(i.globalAlpha=1)}const qb=sn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Kb=e=>{const{bubbles:t}=e;return d.createElement(qb,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Zb={getAccessibilityString:e=>Vd(e.data),kind:Z.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=>Yb(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Kb,{bubbles:t.data})},onPaste:()=>{}};function Yb(e,t){const{rect:n,theme:r,ctx:o,highlighted:i}=e,{x:a,y:l,width:s,height:c}=n;let u=a+r.cellHorizontalPadding;const h=[];for(const g of t){if(u>a+s)break;const f=Dr(g,o,r.baseFontFull).width;h.push({x:u,width:f}),u+=f+r.bubblePadding*2+r.bubbleMargin}o.beginPath();for(const g of h)Yn(o,g.x,l+(c-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,f]of h.entries())o.beginPath(),o.fillStyle=r.textBubble,o.fillText(t[g],f.x+r.bubblePadding,l+c/2+Jn(o,r))}const Qb=sn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Jb=e=>{const{drilldowns:t}=e;return d.createElement(Qb,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))))},e1={getAccessibilityString:e=>Vd(e.data.map(t=>t.text)),kind:Z.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=>n1(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Jb,{drilldowns:t.data})},onPaste:()=>{}},Cl={};function t1(e,t,n,r){const o=Math.ceil(window.devicePixelRatio),i=5,a=n-i*2,l=4,s=n*o,c=r+i,u=r*3,h=(u+i*2)*o,g=`${e},${t},${o},${n}`;if(Cl[g]!==void 0)return{el:Cl[g],height:s,width:h,middleWidth:l*o,sideWidth:c*o,padding:i*o,dpr:o};const f=document.createElement("canvas"),p=f.getContext("2d");return p===null?null:(f.width=h,f.height=s,p.scale(o,o),Cl[g]=f,p.beginPath(),Yn(p,i,i,u,a,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),Yn(p,i+.5,i+.5,u,a,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:f,height:s,width:h,sideWidth:c*o,middleWidth:r*o,padding:i*o,dpr:o})}function n1(e,t){const{rect:n,theme:r,ctx:o,imageLoader:i,col:a,row:l}=e,{x:s,width:c}=n,u=r.baseFontFull,h=bs(o,u),g=Math.min(n.height,Math.max(16,Math.ceil(h*r.lineHeight)*2)),f=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,w=r.bubbleMargin;let y=s+r.cellHorizontalPadding;const v=r.roundingRadius??6,C=t1(r.bgCell,r.drilldownBorder,g,v),R=[];for(const E of t){if(y>s+c)break;const M=Dr(E.text,o,u).width;let H=0;E.img!==void 0&&i.loadOrGetImage(E.img,a,l)!==void 0&&(H=p-8+4);const S=M+H+m*2;R.push({x:y,width:S}),y+=S+w}if(C!==null){const{el:E,height:M,middleWidth:H,sideWidth:S,width:x,dpr:L,padding:T}=C,I=S/L,O=T/L;for(const D of R){const k=Math.floor(D.x),Q=Math.floor(D.width),N=Q-(I-O)*2;o.imageSmoothingEnabled=!1,o.drawImage(E,0,0,S,M,k-O,f,I,g),N>0&&o.drawImage(E,S,0,H,M,k+(I-O),f,N,g),o.drawImage(E,x-S,0,S,M,k+Q-(I-O),f,I,g),o.imageSmoothingEnabled=!0}}o.beginPath();for(const[E,M]of R.entries()){const H=t[E];let S=M.x+m;if(H.img!==void 0){const x=i.loadOrGetImage(H.img,a,l);if(x!==void 0){const L=p-8;let T=0,I=0,O=x.width,D=x.height;O>D?(T+=(O-D)/2,O=D):D>O&&(I+=(D-O)/2,D=O),o.beginPath(),Yn(o,S,f+g/2-L/2,L,L,r.roundingRadius??3),o.save(),o.clip(),o.drawImage(x,T,I,O,D,S,f+g/2-L/2,L,L),o.restore(),S+=L+4}}o.beginPath(),o.fillStyle=r.textBubble,o.fillText(H.text,S,f+g/2+Jn(o,r))}}const r1={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>o1(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??Em;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}}},kl=4;function o1(e,t,n,r){const{rect:o,col:i,row:a,theme:l,ctx:s,imageLoader:c}=e,{x:u,y:h,height:g,width:f}=o,p=g-l.cellVerticalPadding*2,m=[];let w=0;for(let v=0;v<t.length;v++){const C=t[v];if(C.length===0)continue;const R=c.loadOrGetImage(C,i,a);if(R!==void 0){m[v]=R;const E=R.width*(p/R.height);w+=E+kl}}if(w===0)return;w-=kl;let y=u+l.cellHorizontalPadding;r==="right"?y=Math.floor(u+f-l.cellHorizontalPadding-w):r==="center"&&(y=Math.floor(u+f/2-w/2));for(const v of m){if(v===void 0)continue;const C=v.width*(p/v.height);n>0&&(s.beginPath(),Yn(s,y,h+l.cellVerticalPadding,C,p,n),s.save(),s.clip()),s.drawImage(v,y,h+l.cellVerticalPadding,C,p),n>0&&s.restore(),y+=C+kl}}function i1(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const a1={getAccessibilityString:()=>"",kind:Z.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(i1(n,r)*t.skeletonWidthVariability));const s=a.cellHorizontalPadding;l+s*2>=i.width&&(l=i.width-s*2-1);const c=t.skeletonHeight??Math.min(18,i.height-2*a.cellVerticalPadding);Yn(o,i.x+s,i.y+(i.height-c)/2,l,c,a.roundingRadius??3),o.fillStyle=Yr(a.textDark,.1),o.fill()},onPaste:()=>{}},l1=()=>e=>e.targetWidth,gu=sn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[l1(),"px"]}}),s1=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:a,validatedSelection:l}=e,s=t.data,c=t.readonly===!0,[u,h]=d.useState(s===""||r),g=d.useCallback(()=>{h(p=>!p)},[]),f=s?"gdg-ml-6":"";return u?d.createElement(gu,{targetWidth:i.width-20},d.createElement(eo,{autoFocus:!0,highlight:!1,validatedSelection:l,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${f}`,onClick:()=>a(t)},d.createElement(xm,null))):d.createElement(gu,{targetWidth:i.width},d.createElement(c0,{contents:s,createNode:o}),!c&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${f}`,onClick:g},d.createElement(ss,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},c1={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Ei,measure:(e,t,n)=>{const r=t.data.split(`
185
- `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>lr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:a,validatedSelection:l}=e;return d.createElement(s1,{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}},u1={getAccessibilityString:e=>e.row.toString(),kind:Wn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:d1,measure:()=>44,draw:e=>f1(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 d1(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=h1,n.textAlign="center",i}function h1(e){const{ctx:t}=e;t.textAlign="start"}function f1(e,t,n,r,o,i){const{ctx:a,rect:l,hoverAmount:s,theme:c}=e,{x:u,y:h,width:g,height:f}=l,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){a.globalAlpha=p;const m=7*(n?s:1);if(Cs(a,c,n,o?u+m:u,h,o?g-m:g,f,!0,void 0,void 0,c.checkboxMaxSize,"center",i),o){a.globalAlpha=s,a.beginPath();for(const w of[3,6])for(const y of[-5,-1,3])a.rect(u+w,h+f/2+y,2,2);a.fillStyle=c.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),w=c.markerFontFull,y=u+g/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=c.textLight,a.font=w,a.fillText(m,y,h+f/2+Jn(a,w)),s!==0&&(a.globalAlpha=1)}}const p1={getAccessibilityString:()=>"",kind:Wn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>g1(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function g1(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:a,spriteManager:l}=e,{x:s,y:c,width:u,height:h}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,c+1,u,h-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let f=0;if(n!==void 0){const p=h-8,m=s+8/2,w=c+8/2;l.drawSprite(n,"normal",r,m,w,p,a,g?1:i),f=p}else{f=24;const p=12,m=g?p:i*p,w=g?0:(1-i)*p*.5,y=a.cellHorizontalPadding+4;m>0&&(r.moveTo(s+y+w,c+h/2),r.lineTo(s+y+w+m,c+h/2),r.moveTo(s+y+w+m*.5,c+h/2-m*.5),r.lineTo(s+y+w+m*.5,c+h/2+m*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,f+s+a.cellHorizontalPadding+.5,c+h/2+Jn(r,a)),r.beginPath()}function Mh(e,t,n,r,o,i,a){e.textBaseline="alphabetic";const l=m1(e,o,r,t,n?.fullSize??!1);e.beginPath(),Yn(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=n?.bgColor??Yr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a?.("text")}function m1(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=Dr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,c=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:l.width+i*3,height:c-1}}const v1=d.lazy(async()=>await ns(()=>import("./number-overlay-editor-C2e7pY6x-BnC-vP7l.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]))),b1={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:Ei,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:c}=n;l===!0&&t>0&&Mh(r,o,c,s,i,t,a),lr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(v1,{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}}},w1={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:y1,onPaste:()=>{}};function y1(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 c=i+a/2,u=Math.cos(Fc(30))*l,h=Math.sin(Fc(30))*l;for(let g=0;g<12;g++)t.moveTo(s,c-l),t.lineTo(s,c+l),t.moveTo(s+u,c-h),t.lineTo(s-u,c+h),t.moveTo(s-u,c-h),t.lineTo(s+u,c+h),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const x1={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Ei(e,t,e.theme.textLight),draw:e=>lr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return kt.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:()=>{}},C1={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Ei,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:c,hoverEffect:u,allowWrapping:h,hoverEffectTheme:g}=t;u===!0&&n>0&&Mh(o,a,g,s,i,n,l),lr(e,s,c,h,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}},k1=sn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),S1=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:a}=e,[l,s]=d.useState(!o&&(t===""||r)),c=d.useCallback(()=>{s(!0)},[]);return l?d.createElement(eo,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(k1,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:c},d.createElement(ss,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Ih(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 mu(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=th(a,i.baseFontFull);if(l===void 0)return!1;const s=Ih(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 M1={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Ei,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:a,ctx:l}=e,s=t.displayData??t.data,c=t.hoverEffect===!0;if(r!==void 0&&c&&o!==void 0&&i!==void 0){const u=Dr(s,l,n.baseFontFull),h=Ih(u,a,n,t.contentAlign),{x:g,y:f,width:p,height:m}=h;if(o>=g-4&&o<=g-4+p+8&&i>=f-4&&i<=f-4+m+8){const w=Jn(l,n.baseFontFull);r("pointer");const y=5,v=f-w;l.beginPath(),l.moveTo(a.x+g,Math.floor(a.y+v+m+y)+.5),l.lineTo(a.x+g+p,Math.floor(a.y+v+m+y)+.5),l.strokeStyle=n.linkColor,l.stroke(),l.save(),l.fillStyle=e.cellFillColor,lr({...e,rect:{...a,x:a.x-1}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x-2}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x+1}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x+2}},s,t.contentAlign),l.restore()}}l.fillStyle=c?n.linkColor:n.textDark,lr(e,s,t.contentAlign)},onSelect:e=>{mu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;mu(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(S1,{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}},I1=[u1,p1,Ub,Zb,e1,r1,a1,c1,b1,w1,x1,C1,M1];var Sl,vu;function R1(){if(vu)return Sl;vu=1;var e=Ld(),t=ud(),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 Sl=r,Sl}var E1=R1();const T1=vr(E1),Ml=[];class O1 extends oh{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=T1(()=>{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=Ml.pop()??new Image;let l=!1;const s={img:void 0,cells:[Zn(n,r)],url:t,cancel:()=>{l||(l=!0,Ml.length<12?Ml.unshift(a):i||(a.src=""))}},c=new Promise(u=>a.addEventListener("load",()=>u(null)));requestAnimationFrame(async()=>{try{a.src=t,await c,await a.decode();const u=this.cache[o];if(u!==void 0&&!l){u.img=a;for(const h of u.cells)this.loadedLocations.push(xs(h));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 D1=(e,t)=>{const n=d.useMemo(()=>({...xv,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??I1,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new O1,[e.imageWindowLoader]);return d.createElement(Gb,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})},P1=d.forwardRef(D1);function bu(e,t){const n=d.useRef(null),r=d.useRef(),o=d.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return d.useEffect(()=>o,[o]),{debouncedCallback:d.useCallback((...i)=>{r.current=i,o(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,o]),cancel:o}}var H1=up();const L1=vr(H1);var ql={exports:{}},A1=ql.exports,wu;function F1(){return wu||(wu=1,(function(e,t){(function(n,r){try{e.exports=r(hp)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(A1,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 c(z,P){return P.length>z.length?!1:z.indexOf(P)!==-1}function u(z){for(var P="";z;)P+="0",z-=1;return P}function h(z){for(var P=z.split("").reverse(),G=0,le=!0;le&&G<P.length;)G?P[G]==="9"?P[G]="0":(P[G]=(parseInt(P[G],10)+1).toString(),le=!1):(parseInt(P[G],10)<5&&(le=!1),P[G]="0"),G+=1;return le&&P.push("1"),P.reverse().join("")}function g(z,P){var G=H(k(P).sort(),function(ce){return ce+":"+P[ce]}).join(","),le=z+"+"+G;return g.cache[le]||(g.cache[le]=Intl.NumberFormat(z,P)),g.cache[le]}g.cache={};function f(z,P,G){var le=P.useToLocaleString,ce=P.useGrouping,we=ce&&P.grouping.slice(),ge=P.maximumSignificantDigits,Qe=P.minimumIntegerDigits||1,Se=P.fractionDigits||0,Dt=P.groupingSeparator,bt=P.decimalSeparator;if(le&&G){var Te={minimumIntegerDigits:Qe,useGrouping:ce};if(Se&&(Te.maximumFractionDigits=Se,Te.minimumFractionDigits=Se),ge&&z>0&&(Te.maximumSignificantDigits=ge),i){if(!a){var re=D({},P);re.useGrouping=!1,re.decimalSeparator=".",z=parseFloat(f(z,re),10)}return g(G,Te).format(z)}else{if(!o){var re=D({},P);re.useGrouping=!1,re.decimalSeparator=".",z=parseFloat(f(z,re),10)}return z.toLocaleString(G,Te)}}var me;ge?me=z.toPrecision(ge+1):me=z.toFixed(Se+1);var ye,ne,be,Oe=me.split("e");be=Oe[1]||"",Oe=Oe[0].split("."),ne=Oe[1]||"",ye=Oe[0]||"";var Pe=ye.length,it=ne.length,Ae=Pe+it,Ze=ye+ne;(ge&&Ae===ge+1||!ge&&it===Se+1)&&(Ze=h(Ze),Ze.length===Ae+1&&(Pe=Pe+1),it&&(Ze=Ze.slice(0,-1)),ye=Ze.slice(0,Pe),ne=Ze.slice(Pe)),ge&&(ne=ne.replace(/0*$/,""));var Ie=parseInt(be,10);Ie>0?ne.length<=Ie?(ne=ne+u(Ie-ne.length),ye=ye+ne,ne=""):(ye=ye+ne.slice(0,Ie),ne=ne.slice(Ie)):Ie<0&&(ne=u(Math.abs(Ie)-ye.length)+ye+ne,ye="0"),ge||(ne=ne.slice(0,Se),ne.length<Se&&(ne=ne+u(Se-ne.length)),ye.length<Qe&&(ye=u(Qe-ye.length)+ye));var Me="";if(ce){Oe=ye;for(var ze;Oe.length;)we.length&&(ze=we.shift()),Me&&(Me=Dt+Me),Me=Oe.slice(-ze)+Me,Oe=Oe.slice(0,-ze)}else Me=ye;return ne&&(Me=Me+bt+ne),Me}function p(z,P){return z.label.length>P.label.length?-1:z.label.length<P.label.length?1:0}function m(z,P){var G=[];return M(k(P),function(le){if(le.slice(0,15)==="_durationLabels"){var ce=le.slice(15).toLowerCase();M(k(P[le]),function(we){we.slice(0,1)===z&&G.push({type:ce,key:we,label:P[le][we]})})}}),G}function w(z,P,G){return P===1&&G===null?z:z+z}var y={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:w};function v(z){return Object.prototype.toString.call(z)==="[object Array]"}function C(z){return Object.prototype.toString.call(z)==="[object Object]"}function R(z,P){for(var G=z.length;G-=1;)if(P(z[G]))return z[G]}function E(z,P){var G=0,le=z&&z.length||0,ce;for(typeof P!="function"&&(ce=P,P=function(we){return we===ce});G<le;){if(P(z[G]))return z[G];G+=1}}function M(z,P){var G=0,le=z.length;if(!(!z||!le))for(;G<le;){if(P(z[G],G)===!1)return;G+=1}}function H(z,P){var G=0,le=z.length,ce=[];if(!z||!le)return ce;for(;G<le;)ce[G]=P(z[G],G),G+=1;return ce}function S(z,P){return H(z,function(G){return G[P]})}function x(z){var P=[];return M(z,function(G){G&&P.push(G)}),P}function L(z){var P=[];return M(z,function(G){E(P,G)||P.push(G)}),P}function T(z,P){var G=[];return M(z,function(le){M(P,function(ce){le===ce&&G.push(le)})}),L(G)}function I(z,P){var G=[];return M(z,function(le,ce){if(!P(le))return G=z.slice(ce),!1}),G}function O(z,P){var G=z.slice().reverse();return I(G,P).reverse()}function D(z,P){for(var G in P)P.hasOwnProperty(G)&&(z[G]=P[G]);return z}function k(z){var P=[];for(var G in z)z.hasOwnProperty(G)&&P.push(G);return P}function Q(z,P){var G=0,le=z.length;if(!z||!le)return!1;for(;G<le;){if(P(z[G],G)===!0)return!0;G+=1}return!1}function N(z){var P=[];return M(z,function(G){P=P.concat(G)}),P}function Y(){var z=0;try{z.toLocaleString("i")}catch(P){return P.name==="RangeError"}return!1}function ae(z){return z(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function ee(z){var P=!0;return P=P&&z(1,"en",{minimumIntegerDigits:1})==="1",P=P&&z(1,"en",{minimumIntegerDigits:2})==="01",P=P&&z(1,"en",{minimumIntegerDigits:3})==="001",!(!P||(P=P&&z(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",P=P&&z(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",P=P&&z(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",P=P&&z(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!P)||(P=P&&z(99.99,"en",{maximumSignificantDigits:1})==="100",P=P&&z(99.99,"en",{maximumSignificantDigits:2})==="100",P=P&&z(99.99,"en",{maximumSignificantDigits:3})==="100",P=P&&z(99.99,"en",{maximumSignificantDigits:4})==="99.99",P=P&&z(99.99,"en",{maximumSignificantDigits:5})==="99.99",!P)||(P=P&&z(1e3,"en",{useGrouping:!0})==="1,000",P=P&&z(1e3,"en",{useGrouping:!1})==="1000",!P))}function K(){var z=[].slice.call(arguments),P={},G;if(M(z,function(ge,Qe){if(!Qe){if(!v(ge))throw"Expected array as the first argument to durationsFormat.";G=ge}if(typeof ge=="string"||typeof ge=="function"){P.template=ge;return}if(typeof ge=="number"){P.precision=ge;return}C(ge)&&D(P,ge)}),!G||!G.length)return[];P.returnMomentTypes=!0;var le=H(G,function(ge){return ge.format(P)}),ce=T(l,L(S(N(le),"type"))),we=P.largest;return we&&(ce=ce.slice(0,we)),P.returnMomentTypes=!1,P.outputTypes=ce,H(G,function(ge){return ge.format(P)})}function pe(){var z=[].slice.call(arguments),P=D({},this.format.defaults),G=this.asMilliseconds(),le=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(G=0,le=0);var ce=G<0,we=n.duration(Math.abs(G),"milliseconds"),ge=n.duration(Math.abs(le),"months");M(z,function(B){if(typeof B=="string"||typeof B=="function"){P.template=B;return}if(typeof B=="number"){P.precision=B;return}C(B)&&D(P,B)});var Qe={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Se={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};P.types=l;var Dt=function(B){return E(l,function(_e){return Se[_e].test(B)})},bt=new RegExp(H(l,function(B){return Se[B].source}).join("|"),"g");P.duration=this;var Te=typeof P.template=="function"?P.template.apply(P):P.template,re=P.outputTypes,me=P.returnMomentTypes,ye=P.largest,ne=[];re||(v(P.stopTrim)&&(P.stopTrim=P.stopTrim.join("")),P.stopTrim&&M(P.stopTrim.match(bt),function(B){var _e=Dt(B);_e==="escape"||_e==="general"||ne.push(_e)}));var be=n.localeData();be||(be={}),M(k(y),function(B){if(typeof y[B]=="function"){be[B]||(be[B]=y[B]);return}be["_"+B]||(be["_"+B]=y[B])}),M(k(be._durationTimeTemplates),function(B){Te=Te.replace("_"+B+"_",be._durationTimeTemplates[B])});var Oe=P.userLocale||n.locale(),Pe=P.useLeftUnits,it=P.usePlural,Ae=P.precision,Ze=P.forceLength,Ie=P.useGrouping,Me=P.trunc,ze=P.useSignificantDigits&&Ae>0,ct=ze?P.precision:0,Je=ct,We=P.minValue,ht=!1,Wt=P.maxValue,Et=!1,ut=P.useToLocaleString,qt=P.groupingSeparator,Kt=P.decimalSeparator,On=P.grouping;ut=ut&&(r||i);var St=P.trim;v(St)&&(St=St.join(" ")),St===null&&(ye||Wt||ze)&&(St="all"),(St===null||St===!0||St==="left"||St==="right")&&(St="large"),St===!1&&(St="");var ft=function(B){return B.test(St)},Dn=/large/,wt=/small/,cn=/both/,pn=/mid/,Re=/^all|[^sm]all/,dt=/final/,At=ye>0||Q([Dn,cn,Re],ft),dn=Q([wt,cn,Re],ft),$t=Q([pn,Re],ft),rn=Q([dt,Re],ft),Pn=H(Te.match(bt),function(B,_e){var Ne=Dt(B);return B.slice(0,1)==="*"&&(B=B.slice(1),Ne!=="escape"&&Ne!=="general"&&ne.push(Ne)),{index:_e,length:B.length,text:"",token:Ne==="escape"?B.replace(Se.escape,"$1"):B,type:Ne==="escape"||Ne==="general"?null:Ne}}),on={index:0,length:0,token:"",text:"",type:null},Zt=[];Pe&&Pn.reverse(),M(Pn,function(B){if(B.type){(on.type||on.text)&&Zt.push(on),on=B;return}Pe?on.text=B.token+on.text:on.text+=B.token}),(on.type||on.text)&&Zt.push(on),Pe&&Zt.reverse();var Be=T(l,L(x(S(Zt,"type"))));if(!Be.length)return S(Zt,"text").join("");Be=H(Be,function(B,_e){var Ne=_e+1===Be.length,Tt=!_e,an;B==="years"||B==="months"?an=ge.as(B):an=we.as(B);var hn=Math.floor(an),Rn=an-hn,gn=E(Zt,function(Bt){return B===Bt.type});return Tt&&Wt&&an>Wt&&(Et=!0),Ne&&We&&Math.abs(P.duration.as(B))<We&&(ht=!0),Tt&&Ze===null&&gn.length>1&&(Ze=!0),we.subtract(hn,B),ge.subtract(hn,B),{rawValue:an,wholeValue:hn,decimalValue:Ne?Rn:0,isSmallest:Ne,isLargest:Tt,type:B,tokenLength:gn.length}});var yt=Me?Math.floor:Math.round,In=function(B,_e){var Ne=Math.pow(10,_e);return yt(B*Ne)/Ne},Pt=!1,pt=!1,xn=function(B,_e){var Ne={useGrouping:Ie,groupingSeparator:qt,decimalSeparator:Kt,grouping:On,useToLocaleString:ut};return ze&&(ct<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(Ne.maximumSignificantDigits=ct,B.significantDigits=ct)),Et&&!pt&&(B.isLargest?(B.wholeValue=Wt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),ht&&!pt&&(B.isSmallest?(B.wholeValue=We,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Ae<0?B.value=In(B.wholeValue,Ae):Ae===0?B.value=yt(B.wholeValue+B.decimalValue):ze?(Me?B.value=In(B.rawValue,ct-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ct-=B.wholeValue.toString().length)):(Ne.fractionDigits=Ae,Me?B.value=B.wholeValue+In(B.decimalValue,Ae):B.value=B.wholeValue+B.decimalValue):ze&&B.wholeValue?(B.value=Math.round(In(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ct-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(Ze||Pt)&&(Ne.minimumIntegerDigits=B.tokenLength,pt&&Ne.maximumSignificantDigits<B.tokenLength&&delete Ne.maximumSignificantDigits),!Pt&&(B.value>0||St===""||E(ne,B.type)||E(re,B.type))&&(Pt=!0),B.formattedValue=f(B.value,Ne,Oe),Ne.useGrouping=!1,Ne.decimalSeparator=".",B.formattedValueEn=f(B.value,Ne,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=f(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(Be=H(Be,xn),Be=x(Be),Be.length>1){var er=function(B){return E(Be,function(_e){return _e.type===B})},tr=function(B){var _e=er(B.type);_e&&M(B.targets,function(Ne){var Tt=er(Ne.type);Tt&&parseInt(_e.formattedValueEn,10)===Ne.value&&(_e.rawValue=0,_e.wholeValue=0,_e.decimalValue=0,Tt.rawValue+=1,Tt.wholeValue+=1,Tt.decimalValue=0,Tt.formattedValueEn=Tt.wholeValue.toString(),pt=!0)})};M(s,tr)}return pt&&(Pt=!1,ct=Je,Be=H(Be,xn),Be=x(Be)),re&&!(Et&&!P.trim)?(Be=H(Be,function(B){return E(re,function(_e){return B.type===_e})?B:null}),Be=x(Be)):(At&&(Be=I(Be,function(B){return!B.isSmallest&&!B.wholeValue&&!E(ne,B.type)})),ye&&Be.length&&(Be=Be.slice(0,ye)),dn&&Be.length>1&&(Be=O(Be,function(B){return!B.wholeValue&&!E(ne,B.type)&&!B.isLargest})),$t&&(Be=H(Be,function(B,_e){return _e>0&&_e<Be.length-1&&!B.wholeValue?null:B}),Be=x(Be)),rn&&Be.length===1&&!Be[0].wholeValue&&!(!Me&&Be[0].isSmallest&&Be[0].rawValue<We)&&(Be=[])),me?Be:(M(Zt,function(B){var _e=Qe[B.type],Ne=E(Be,function(Bt){return Bt.type===B.type});if(!(!_e||!Ne)){var Tt=Ne.formattedValueEn.split(".");Tt[0]=parseInt(Tt[0],10),Tt[1]?Tt[1]=parseFloat("0."+Tt[1],10):Tt[1]=null;var an=be.durationPluralKey(_e,Tt[0],Tt[1]),hn=m(_e,be),Rn=!1,gn={};M(be._durationLabelTypes,function(Bt){var En=E(hn,function(Cn){return Cn.type===Bt.type&&Cn.key===an});En&&(gn[En.type]=En.label,c(B.text,Bt.string)&&(B.text=B.text.replace(Bt.string,En.label),Rn=!0))}),it&&!Rn&&(hn.sort(p),M(hn,function(Bt){if(gn[Bt.type]===Bt.label)return c(B.text,Bt.label)?!1:void 0;if(c(B.text,Bt.label))return B.text=B.text.replace(Bt.label,gn[Bt.type]),!1}))}}),Zt=H(Zt,function(B){if(!B.type)return B.text;var _e=E(Be,function(Tt){return Tt.type===B.type});if(!_e)return"";var Ne="";return Pe&&(Ne+=B.text),(ce&&Et||!ce&&ht)&&(Ne+="< ",Et=!1,ht=!1),(ce&&ht||!ce&&Et)&&(Ne+="> ",Et=!1,ht=!1),ce&&(_e.value>0||St===""||E(ne,_e.type)||E(re,_e.type))&&(Ne+="-",ce=!1),B.type==="milliseconds"&&_e.formattedValueMS?Ne+=_e.formattedValueMS:Ne+=_e.formattedValue,Pe||(Ne+=B.text),Ne}),Zt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function oe(){var z=this.duration,P=function(ce){return z._data[ce]},G=E(this.types,P),le=R(this.types,P);switch(G){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(G===le)return"d __";case"weeks":return G===le?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(G===le)return"M __";case"years":return G===le?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function de(z){if(!z)throw"Moment Duration Format init cannot find moment instance.";z.duration.format=K,z.duration.fn.format=pe,z.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:oe,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},z.updateLocale("en",y)}var he=function(z,P,G){return z.toLocaleString(P,G)};r=Y()&&ee(he),o=r&&ae(he);var se=function(z,P,G){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(P,G).format(z)};return i=ee(se),a=i&&ae(se),de(n),de})})(ql)),ql.exports}F1();const z1=["true","t","yes","y","on","1"],_1=["false","f","no","n","off","0"];function Mt(e,t=""){return{kind:Z.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 $1(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function Ms(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function Kl(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Z.Loading,allowOverlay:!1,copyData:""}}function V1(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Zl(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 Ho(e,t){return De(e)?t||{}:De(t)?e||{}:vd(e,t)}function Is(e){if(De(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:ot(n)):[ot(t)]}catch{return[ot(e)]}}function Rh(e){return typeof e=="string"||e instanceof String?!0:(e instanceof Np&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function B1(e){return e?.startsWith("{")&&e.endsWith("}")}function ot(e){try{try{return L1(e)}catch{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}}catch{return`[${typeof e}]`}}function Eh(e){if(De(e))return null;if(typeof e=="boolean")return e;const t=ot(e).toLowerCase().trim();if(t==="")return null;if(z1.includes(t))return!0;if(_1.includes(t))return!1}function xi(e){if(De(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=ci.unformat(e.trim());if(rt(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Th(e){return De(e)?"":ot(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function ka(e){if(De(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return ot(e)}}function N1(e){if(e===0||Math.abs(e)>=1e-4)return 4;const t=e.toExponential().split("e");return Math.abs(parseInt(t[1],10))}function Gr(e,t={}){const n=navigator.languages;try{return new Intl.NumberFormat(n,t).format(e)}catch(r){if(r instanceof RangeError)return new Intl.NumberFormat(void 0,t).format(e);throw r}}function Sa(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":De(t)||t===""?rt(n)?(n===0&&(e=Math.round(e)),ci(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):ci(e).format({thousandSeparated:!1,mantissa:N1(e),trimMantissa:!0}):t==="plain"?ci(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?Gr(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?Gr(e,{style:"percent",minimumFractionDigits:rt(n)?Math.max(n-2,0):0,maximumFractionDigits:rt(n)?Math.max(n-2,0):2}):t==="dollar"?Gr(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?Gr(e,{style:"currency",currency:"EUR",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Gr(e,{style:"currency",currency:"JPY",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Gr(e,{notation:t}):t==="accounting"?ci(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?Gr(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):_g.sprintf(t,e)}function yu(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,o=n==="time"?void 0:"medium",i=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:o,timeStyle:i}).format(e.toDate())}catch(a){if(a instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:o,timeStyle:i}).format(e.toDate());throw a}}else{if(t==="distance")return e.fromNow();if(t==="calendar")return e.calendar();if(t==="iso8601")return n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString()}return e.format(t)}function ta(e){if(De(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=Ur.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Ur.utc(e);if(n.isValid())return n.toDate();const r=Ur.utc(e,[Ur.HTML5_FMT.TIME_MS,Ur.HTML5_FMT.TIME_SECONDS,Ur.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Oh(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 W1(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 j1=new RegExp(/(\r\n|\n|\r)/gm);function Ci(e){return e.indexOf(`
187
- `)!==-1?e.replace(j1," "):e}function G1(e,t){if(De(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const U1=Qn("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"}}),""),Rs=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?nl.parse(e):nl.parse(nl.stringify(e))}catch{n=void 0}return De(n)?ve.jsx(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:ka(e)??"",onChange:()=>{}}):ve.jsx(U1,{"data-testid":"stJsonColumnViewer",children:ve.jsx(fp,{src:n,collapsed:2,theme:pp(t.bgCell)>.5?"rjv-default":"monokai",displayDataTypes:!1,displayObjectSize:!1,name:!1,enableClipboard:!0,style:{fontFamily:t.fontFamily,fontSize:t.baseFontStyle,backgroundColor:t.bgCell,whiteSpace:"pre-wrap"}})})};d.memo(Rs);const X1=e=>{const t=e.theme,n=e.value.data;return ve.jsx(Rs,{jsonValue:n.value||n.displayValue,theme:t})},q1=e=>{const t=e.theme,n=e.value;return ve.jsx(Rs,{jsonValue:n.data,theme:t})},K1={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return vs(e,r??ka(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:o}=t.data,i=o??ka(r)??"";return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:X1})},Dh="line_chart",Z1="area_chart",Ph="bar_chart",Y1=e=>new Map(Object.entries({red:e.colors.redColor,blue:e.colors.blueColor,green:e.colors.greenColor,yellow:e.colors.yellowColor,violet:e.colors.violetColor,orange:e.colors.orangeColor,gray:e.colors.grayColor,grey:e.colors.grayColor,primary:e.colors.primary}));function Es(e,t,n,r){const o=Ho({y_min:null,y_max:null,color:void 0},t.columnTypeOptions),i=Y1(r);let a;o.color==="auto"||o.color==="auto-inverse"?a=r.colors.greenColor:a=o.color?i.get(o.color)??o.color:void 0;const l={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:a,yAxis:[o.y_min??0,o.y_max??1]}};return{...t,kind:e,typeIcon:e===Dh?":material/show_chart:":e===Ph?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(s){if(De(s))return Kl();const c=Is(s),u=[];let h=[];if(c.length===0)return Kl();let g=Number.MIN_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER;for(let y=0;y<c.length;y++){const v=xi(c[y]);if(Number.isNaN(v)||De(v))return Mt(ot(c),`The value cannot be interpreted as a numeric array. ${ot(v)} is not a number.`);v>g&&(g=v),v<f&&(f=v),u.push(v)}let p,m;if(c.length===1){let y;g<=0?y=g===0?1:0:y=g,p=o.y_max??y,m=o.y_min??(g>=0?0:g)}else p=o.y_max??g,m=o.y_min??f;if(De(m)||De(p)||Number.isNaN(m)||Number.isNaN(p)||m>=p)return Mt("Invalid min/max y-axis configuration",`The y_min (${m}) and y_max (${p}) configuration options must be valid numbers.`);u.length>0&&(g>p||f<m)?h=u.map(y=>g-f===0?g>(p||1)?p:m:(p-m)*((y-f)/(g-f))+m):h=u;let w=a;return(o.color==="auto"&&h[0]>h[h.length-1]||o.color==="auto-inverse"&&h[0]<h[h.length-1])&&(w=r.colors.redColor),{...l,copyData:u.join(","),data:{...l.data,values:h,displayValues:u.map(y=>Sa(y)),yAxis:[m,p],color:w},isMissingValue:De(s)}},getCellValue(s){return s.kind===Z.Loading||s.data?.values===void 0?null:s.data?.values}}}function Hh(e,t){return Es(Dh,e,"line",t)}Hh.isEditableType=!1;function Lh(e,t){return Es(Ph,e,"bar",t)}Lh.isEditableType=!1;function Ah(e,t){return Es(Z1,e,"area",t)}Ah.isEditableType=!1;function Ts(e,t){const n={kind:Z.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",typeIcon:":material/check_box:",sortMode:"default",themeOverride:{roundingRadius:Math.round(Math.min(tn(t.radii.md),tn(t.radii.maxCheckbox)))},getCell(r){let o=null;return o=Eh(r),o===void 0?Mt(ot(r),"The value cannot be interpreted as boolean."):{...n,data:o,isMissingValue:De(o)}},getCellValue(r){return r.data===void 0?null:r.data}}}Ts.isEditableType=!0;function xu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function Os(e,t,n,r,o,i,a){const l=Ho({format:n,step:r,timezone:a},t.columnTypeOptions);let s;if(rt(l.timezone))try{s=xu(dc(),l.timezone)?.utcOffset()||void 0}catch{}let c;rt(l.min_value)&&(c=ta(l.min_value)||void 0);let u;rt(l.max_value)&&(u=ta(l.max_value)||void 0);const h={kind:Z.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:l.step?.toString()||"1",format:o,min:c,max:u}},g=f=>{const p=ta(f);return p===null?!t.isRequired:!(p===void 0||rt(c)&&i(p)<i(c)||rt(u)&&i(p)>i(u))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(f,p){if(p===!0){const C=g(f);if(C===!1)return Mt(ot(f),"Invalid input.");C instanceof Date&&(f=C)}const m=ta(f);let w="",y="",v=s;if(m===void 0)return Mt(ot(f),"The value cannot be interpreted as a datetime object.");if(m!==null){let C=dc.utc(m);if(!C.isValid())return Mt(ot(m),`Invalid moment date. This should never happen. Please report this bug.
188
- Error: ${C.toString()}`);if(l.timezone){try{C=xu(C,l.timezone)}catch(R){return Mt(C.toISOString(),`Failed to adjust to the provided timezone: ${l.timezone}.
189
- Error: ${R}`)}v=C.utcOffset()}try{y=yu(C,l.format||n,e)}catch(R){return Mt(C.toISOString(),`Failed to format the date for rendering with: ${l.format}.
190
- Error: ${R}`)}w=yu(C,n,e)}return{...h,copyData:w,isMissingValue:De(m),data:{...h.data,date:m,displayDate:y,timezoneOffset:v}}},getCellValue(f){return De(f?.data?.date)?null:i(f.data.date)}}}function Ds(e){let t="YYYY-MM-DD HH:mm:ss";e.columnTypeOptions?.step>=60?t="YYYY-MM-DD HH:mm":e.columnTypeOptions?.step<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const n=gp(e.arrowType),r=rt(n)||rt(e?.columnTypeOptions?.timezone);return Os("datetime",e,r?t+"Z":t,1,"datetime-local",o=>r?o.toISOString():o.toISOString().replace("Z",""),n)}Ds.isEditableType=!0;function Ps(e){let t="HH:mm:ss";return e.columnTypeOptions?.step>=60?t="HH:mm":e.columnTypeOptions?.step<1&&(t="HH:mm:ss.SSS"),Os("time",e,t,1,"time",n=>n.toISOString().split("T")[1].replace("Z",""))}Ps.isEditableType=!0;function Hs(e){return Os("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}Hs.isEditableType=!0;function Fh(e){const t={kind:Z.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",typeIcon:":material/image:",sortMode:"default",isEditable:!1,getCell(n){const r=rt(n)?[ot(n)]:[];return{...t,data:r,isMissingValue:!rt(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}Fh.isEditableType=!1;function zh(e){const t={kind:Z.Custom,allowOverlay:!0,contentAlign:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal",copyData:"",data:{kind:"json-cell",value:""}};return{...e,kind:"json",typeIcon:":material/code_blocks:",sortMode:"default",isEditable:!1,getCell(n){try{const r=rt(n)?Ci(ka(n)):"";return{...t,copyData:r,isMissingValue:De(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Mt(ot(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){return n.data?.value??null}}}zh.isEditableType=!1;function _h(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}.
191
- Error: ${s}`}let r=!1,o=t.display_text,i;if(!De(o)){if(o.startsWith(":material/")&&mp(o))o=vp(o).icon,r=!0;else if(o.includes("(")&&o.includes(")"))try{i=new RegExp(o,"us")}catch{i=void 0}}const a={kind:Z.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?"center":void 0),style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:"",...r&&{themeOverride:{fontFamily:bp.iconFont,linkColor:void 0}}},l=s=>{if(De(s))return!e.isRequired;const c=ot(s);return!(t.max_chars&&c.length>t.max_chars||n instanceof RegExp&&n.test(c)===!1)};return{...e,kind:"link",typeIcon:":material/link:",sortMode:"default",validateInput:l,getCell(s,c){if(De(s))return{...a,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const u=s;if(typeof n=="string")return Mt(ot(u),n);if(c&&l(u)===!1)return Mt(ot(u),"Invalid input.");let h="";return u&&(i!==void 0?h=G1(i,u):h=o||u),{...a,data:u,displayData:h,isMissingValue:De(u),onClickUri:g=>{window.open(u.startsWith("www.")?`https://${u}`:u,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:u}},getCellValue(s){return De(s.data)?null:s.data}}}_h.isEditableType=!0;function Ls(e){const t={kind:Z.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",copyData:"",data:{kind:"multi-select-cell",values:[],options:void 0,allowCreation:!0,allowDuplicates:!0}};return{...e,kind:"list",sortMode:"default",typeIcon:":material/list:",getCell(n){if(De(n))return{...t,data:{...t.data,values:null},isMissingValue:!0,copyData:""};const r=Is(n);return{...t,data:{...t.data,values:r},copyData:Th(r),...e.isEditable&&!Rh(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 De(n.data?.values)?null:n.data.values}}}Ls.isEditableType=!0;const Q1=e=>{const t=Zp(e);return new Map(Object.entries({red:t.redbg,blue:t.bluebg,green:t.greenbg,yellow:t.yellowbg,violet:t.violetbg,purple:t.purplebg,orange:t.orangebg,gray:t.graybg,grey:t.graybg,primary:t.primarybg}))},J1=(e,t)=>{if(De(e))return[];const n=Q1(t),r=t.colors.chartCategoricalColors,o=Mi(t);let i=0;return e.filter(a=>a!==null&&a!=="").map(a=>{if(typeof a=="string")return{value:ot(a).trim(),label:void 0,color:void 0};let l;a.color==="auto"?(l=Xr(r[i%r.length],o?.7:.6),i+=1):a.color&&(l=n.get(a.color)??a.color);const s=l?Bp(l,t.colors.bgColor):void 0;return{value:ot(a.value).trim(),label:a.label??void 0,color:s}})};function $h(e,t){const n=Ho({options:[],accept_new_options:!1},e.columnTypeOptions),r=J1(n.options,t),o=new Set(r.map(a=>a.value)),i={kind:Z.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"multi-select-cell",values:[],options:r,allowCreation:n.accept_new_options??!1,allowDuplicates:!1},copyData:""};return{...e,kind:"multiselect",sortMode:"default",typeIcon:":material/checklist:",getCell(a,l){if(De(a))return{...i,data:{...i.data,values:null},isMissingValue:!0,copyData:""};let s=Is(a);return s=s.map(c=>ot(c).trim()),l&&s.length>0&&n.accept_new_options===!1&&(s=s.filter(c=>o.has(c)),s.length===0)?Mt(ot(a),"The values could not be matched with the configured options."):{...i,data:{...i.data,values:s},copyData:Th(s),...e.isEditable&&!Rh(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 De(a.data?.values)?null:a.data.values}}}$h.isEditableType=!0;function As(e){const t=Ho({step:hd(e.arrowType)?1:void 0,min_value:wp(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(yp(e.arrowType)||xp(e.arrowType)),r=De(t.min_value)||t.min_value<0,o=rt(t.step)&&!Number.isNaN(t.step)?Oh(t.step):void 0,i={kind:Z.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:o,thousandSeparator:""},a=l=>{let s=xi(l);if(De(s))return!e.isRequired;if(Number.isNaN(s))return!1;let c=!1;return rt(t.max_value)&&s>t.max_value&&(s=t.max_value,c=!0),rt(t.min_value)&&s<t.min_value?!1:c?s:!0};return{...e,kind:"number",sortMode:"smart",typeIcon:":material/tag:",validateInput:a,getCell(l,s){if(s===!0){const h=a(l);if(h===!1)return Mt(ot(l),"Invalid input.");typeof h=="number"&&(l=h)}let c=xi(l),u="";if(rt(c)){if(Number.isNaN(c))return Mt(ot(l),"The value cannot be interpreted as a number.");if(rt(o)&&(c=W1(c,o)),Number.isInteger(c)&&!Number.isSafeInteger(c))return Mt(ot(l),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?u=zl(c,e.arrowType):u=Sa(c,t.format,o)}catch(h){return Mt(ot(c),rt(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${h}`:`Failed to format the number. Error: ${h}`)}}return{...i,data:c,displayData:u,isMissingValue:De(c),copyData:De(c)?"":ot(c)}},getCellValue(l){return l.data===void 0?null:l.data}}}As.isEditableType=!0;function ki(e){const t={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",typeIcon:":material/data_object:",isEditable:!1,getCell(n){try{const r=rt(n)?ot(n):null,o=rt(r)?Ci(r):"";return{...t,data:r,displayData:o,isMissingValue:De(n)}}catch(r){return Mt(ot(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}ki.isEditableType=!1;const ew=e=>new Map(Object.entries({red:e.colors.redColor,blue:e.colors.blueColor,green:e.colors.greenColor,yellow:e.colors.yellowColor,violet:e.colors.violetColor,orange:e.colors.orangeColor,gray:e.colors.grayColor,grey:e.colors.grayColor,primary:e.colors.primary}));function Vh(e,t){const n=hd(e.arrowType),r=Ho({min_value:0,max_value:n?100:1,format:n?"%3d%%":"percent",step:n?1:void 0,color:void 0},e.columnTypeOptions),o=ew(t),i=De(r.step)||Number.isNaN(r.step)?void 0:Oh(r.step);let a;try{a=Sa(r.max_value,r.format,i)}catch{a=ot(r.max_value)}const l={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,readonly:!0,data:{kind:"range-cell",min:r.min_value,max:r.max_value,step:r.step??.01,value:r.min_value,label:String(r.min_value),measureLabel:a}};return{...e,kind:"progress",sortMode:"smart",typeIcon:":material/commit:",isEditable:!1,getCell(s){if(De(s))return Kl();if(De(r.min_value)||De(r.max_value)||Number.isNaN(r.min_value)||Number.isNaN(r.max_value)||r.min_value>=r.max_value)return Mt("Invalid min/max parameters",`The min_value (${r.min_value}) and max_value (${r.max_value}) parameters must be valid numbers.`);if(rt(r.step)&&Number.isNaN(r.step))return Mt("Invalid step parameter",`The step parameter (${r.step}) must be a valid number.`);const c=xi(s);if(Number.isNaN(c)||De(c))return Mt(ot(s),"The value cannot be interpreted as a number.");if(Number.isInteger(c)&&!Number.isSafeInteger(c))return Mt(ot(s),"The value is larger than the maximum supported integer values in number columns (2^53).");let u="";try{u=Sa(c,r.format,i)}catch(f){return Mt(ot(c),rt(r.format)?`Failed to format the number based on the provided format configuration: (${r.format}). Error: ${f}`:`Failed to format the number. Error: ${f}`)}const h=Math.min(r.max_value,Math.max(r.min_value,c));let g;if(r.color==="auto"||r.color==="auto-inverse"){const f=r.max_value-r.min_value,p=(f===0?0:(h-r.min_value)/f)>.5;r.color==="auto"?g=p?t?.colors.greenColor:t?.colors.redColor:g=p?t?.colors.redColor:t?.colors.greenColor}else r.color&&(g=o.get(r.color)??r.color);return{...l,isMissingValue:De(s),copyData:String(c),data:{...l.data,value:h,label:u,measureLabel:u.length>a.length?u:a,color:g}}},getCellValue(s){return s.kind===Z.Loading||s.data?.value===void 0?null:s.data?.value}}}Vh.isEditableType=!1;const tw=e=>De(e)?[]:e.filter(t=>rt(t)&&t!=="").map(t=>{if(typeof t=="object"&&"value"in t){const r=ot(t.value).trim();return{value:r,label:t.label??r}}const n=ot(t).trim();return{value:n,label:n}});function Fs(e){let t="string";const n=Ho({options:fd(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=tw(n.options),l={kind:Z.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...a],value:""}};return{...e,kind:"selectbox",sortMode:"default",typeIcon:":material/arrow_drop_down_circle:",getCell(s,c){let u=null;return rt(s)&&s!==""&&(u=ot(s)),c&&!l.data.allowedValues.some(h=>h===null?u===null:typeof h=="string"?h===u:typeof h=="object"&&"value"in h?h.value===u:!1)?Mt(ot(u),"The value is not part of the allowed options."):{...l,isMissingValue:u===null,copyData:u||"",data:{...l.data,value:u}}},getCellValue(s){return De(s.data?.value)||s.data?.value===""?null:t==="number"?xi(s.data?.value)??null:t==="boolean"?Eh(s.data?.value)??null:s.data?.value}}}Fs.isEditableType=!0;function zs(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}.
192
- Error: ${i}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},o=i=>{if(De(i))return!e.isRequired;let a=ot(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 Mt(ot(i),n);if(a){const l=o(i);if(l===!1)return Mt(ot(i),"Invalid input.");typeof l=="string"&&(i=l)}try{const l=rt(i)?ot(i):null,s=rt(l)?Ci(l):"";return{...r,isMissingValue:De(l),data:l,displayData:s}}catch(l){return Mt("Incompatible value",`The value cannot be interpreted as string. Error: ${l}`)}},getCellValue(i){return i.data===void 0?null:i.data}}}zs.isEditableType=!0;const Cu=Qn("img",{target:"e24uaba0"})({name:"6eya2z",styles:"max-width:100%;max-height:37.5rem;object-fit:scale-down"}),nw=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?ve.jsx("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:ve.jsx(Cu,{src:t})}):ve.jsx(Cu,{src:t})},ku=new Map(Object.entries({object:ki,text:zs,checkbox:Ts,selectbox:Fs,list:Ls,multiselect:$h,number:As,link:_h,datetime:Ds,date:Hs,time:Ps,line_chart:Hh,bar_chart:Lh,area_chart:Ah,image:Fh,progress:Vh,json:zh})),rw=[K1];var ow=cd();const iw=vr(ow);var Il,Su;function aw(){if(Su)return Il;Su=1;var e=Cp(),t=kp(),n=Sp(),r=cd(),o=Mp(),i=Ip(),a=Rp(),l=Ep(),s="[object Map]",c="[object Set]",u=Object.prototype,h=u.hasOwnProperty;function g(f){if(f==null)return!0;if(o(f)&&(r(f)||typeof f=="string"||typeof f.splice=="function"||i(f)||l(f)||n(f)))return!f.length;var p=t(f);if(p==s||p==c)return!f.size;if(a(f))return!e(f).length;for(var m in f)if(h.call(f,m))return!1;return!0}return Il=g,Il}var lw=aw();const sw=vr(lw);function Rl(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 cw(e,t,n){const r={};if(!n.includes(t))return e;const o=Rl(t,"color",n);o&&(r.textDark=o,(e.kind===Z.Bubble||e.kind===Z.Custom&&e.data?.kind==="multi-select-cell")&&(r.textBubble=o),e.kind===Z.Uri&&(r.linkColor=o));const i=Rl(t,"background-color",n);i&&(r.bgCell=i),i==="yellow"&&o===void 0&&(r.textDark="#31333F");const a=Rl(t,"font-weight",n);return a&&(r.baseFontStyle=`${a} ${pg.sm}`),r?{...e,themeOverride:r}:e}function uw(e){return ig(e)||ag(e)?zs:lg(e)?Ds:yd(e)?Ps:sg(e)?Hs:cg(e)||ug(e)?ki:fd(e)?Ts:dg(e)?As:hg(e)?Fs:fg(e)?Ls:ki}function Bh(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 _s(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function dw(e,t){const n=e.columnNames.map(l=>l[t]),{title:r,group:o}=Bh(n),i=e.columnTypes[t];let a=!0;return og(i)&&(a=!1),_s({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:o,isEditable:a,arrowType:i,isIndex:!0,isPinned:!0})}function hw(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:o}=Bh(n),i=e.columnTypes[t];return _s({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:i,group:o})}function Nh(){return _s({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:eg.INDEX,arrowField:new Qp("",new Jp,!0),pandasType:void 0}})}function Mu(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,o=n.numDataColumns;if(r===0&&o===0)return t.push(Nh()),t;for(let i=0;i<r;i++)t.push(dw(e,i));for(let i=0;i<o;i++)t.push(hw(e,i+r));return t}function fw(e,t,n,r=void 0){let o;if(e.kind==="object"||e.kind==="json")o=e.getCell(rt(t.content)?Ci(zl(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&rt(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let i;yd(t.contentType)&&rt(t.field?.type?.unit)?i=tg(t.content,t.field):i=Ur.utc(Number(t.content)).toDate(),o=e.getCell(i)}else if(ng(t.contentType)){const i=De(t.content)?null:zl(t.content,t.contentType);o=e.getCell(i)}else o=e.getCell(t.content);if(Oo(o))return o;if(!e.isEditable){if(n&&rt(n?.displayContent)){const i=Ci(n.displayContent);o.kind===Z.Text?o={...o,displayData:i}:o.kind===Z.Number&&De(e.columnTypeOptions?.format)?o={...o,displayData:i}:o.kind===Z.Uri&&De(e.columnTypeOptions?.display_text)?o={...o,displayData:i}:o.kind===Z.Custom&&o.data?.kind==="date-picker-cell"&&De(e.columnTypeOptions?.format)&&(o={...o,data:{...o.data,displayDate:i}})}r&&n?.cssId&&(o=cw(o,n.cssId,r))}return o}function Wh(e,t){return t?t?.useStretch??!1:e.useContainerWidth??!1}function jh(e,t){return t?t.pixelWidth?t.pixelWidth:void 0:e.width||void 0}function pw(e){return e?.useContent??!1}function gw(e,t){return t?!1:e?.useStretch??!1}function mw(e,t){return t?t.pixelHeight?t.pixelHeight:void 0:e.height||void 0}function Iu({numRows:e,rowHeight:t,theme:n,numHeaderRows:r=1}){return e*t+r*n.defaultHeaderHeight+2*n.tableBorderWidth}const ua="_index",Ru="_pos:",Eu={small:75,medium:200,large:400},Gh=rs.getLogger("useColumnLoader");function vw(e){if(!De(e)){if(typeof e=="number")return e;if(e in Eu)return Eu[e]}}const na=(e,t)=>Yp(e,t,(n,r)=>{if(iw(r))return r});function Tu(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(ua)&&(n=na(n,t.get(ua)??{})),t.has(`${Ru}${e.indexNumber}`)&&(n=na(n,t.get(`${Ru}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==ua&&(n=na(n,t.get(e.name)??{})),t.has(e.id)&&(n=na(n,t.get(e.id)??{})),sw(n)?e:vd({...e},{title:n.label,width:vw(n.width),isEditable:rt(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function bw(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return Gh.error(t),new Map}}function Ou(e){const t=e.columnTypeOptions?.type;let n;return rt(t)&&(ku.has(t)?n=ku.get(t):Gh.warn(`Unknown column type configured in column configuration: ${t}`)),De(n)&&(n=uw(e.arrowType)),n}function ww(e,t,n,r,o){const i=Qr(),a=d.useMemo(()=>bw(e.columns),[e.columns]),[l,s]=d.useState(a);d.useEffect(()=>{s(a)},[a]);const c=d.useMemo(()=>Wh(e,o),[e,o]),u=d.useMemo(()=>jh(e,o),[e,o]),h=c||rt(u)&&u>0,g=rt(e.rowHeight)&&e.rowHeight>tn("4rem"),f=d.useMemo(()=>Mu(t).map(p=>{let m={...p,...Tu(p,l),isStretched:h};const w=Ou(m);return(e.editingMode===nn.EditingMode.READ_ONLY||n||w.isEditableType===!1)&&(m={...m,isEditable:!1}),e.editingMode!==nn.EditingMode.READ_ONLY&&m.isEditable==!0&&(m={...m,icon:"editable"},m.isRequired&&e.editingMode===nn.EditingMode.DYNAMIC&&(m={...m,isHidden:!1})),w(m,i)}),[t,l,h,e.editingMode,n,i]);return{columns:d.useMemo(()=>{const p=Mu(t).map(v=>{let C={...v,...Tu(v,l),isStretched:h,isWrappingAllowed:g};const R=Ou(C);return(e.editingMode===nn.EditingMode.READ_ONLY||n||R.isEditableType===!1)&&(C={...C,isEditable:!1}),e.editingMode!==nn.EditingMode.READ_ONLY&&C.isEditable==!0&&(C={...C,icon:"editable"},C.isRequired&&e.editingMode===nn.EditingMode.DYNAMIC&&(C={...C,isHidden:!1})),R(C,i)}).filter(v=>!v.isHidden),m=[],w=[];r?.length?(p.forEach(v=>{v.isIndex&&!r.includes(v.name)&&!r.includes(v.id)&&v.isPinned!==!1&&m.push(v)}),r.forEach(v=>{const C=p.find(R=>R.name===v||R.id===v);C&&(C.isPinned?m.push(C):w.push(C))})):p.forEach(v=>{v.isPinned?m.push(v):w.push(v)});const y=[...m,...w];return y.length>0?y:[ki(Nh())]},[t,l,g,h,n,e.editingMode,r,i]),allColumns:f,setColumnConfigMapping:s}}function qr(e){return e.isIndex?ua:De(e.name)?"":e.name}class ra{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,c)=>{const u=n.get(c);u&&(l[qr(u)]=u.getCellValue(s))}),r.edited_rows[i]=l}),this.addedRows.forEach(o=>{const i={};let a=!1;o.forEach((l,s,c)=>{const u=n.get(s);if(u){const h=u.getCellValue(l);u.isRequired&&u.isEditable&&Ms(l)&&(a=!0),rt(h)&&(i[qr(u)]=h)}}),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(qr(a),a)}),Object.keys(r.edited_rows).forEach(a=>{const l=Number(a),s=r.edited_rows[a];Object.keys(s).forEach(c=>{const u=s[c],h=i.get(c);if(h){const g=h.getCell(u);g&&(this.editedCells.has(l)||this.editedCells.set(l,new Map),this.editedCells.get(l)?.set(h.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 c=a[s],u=i.get(s);if(u){const h=u.getCell(c);h&&l.set(u.indexNumber,h)}}),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(!(De(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 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 yw(e){return{changeColumnFormat:d.useCallback((t,n)=>{e(r=>Si({columnId:t,columnConfigMapping:r,updatedProps:{type_config:{format:n}}}))},[e])}}function xw(e,t,n,r,o,i){const a=d.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,u)=>c+(u.width??r*2),0)>n*.6,[e,n,r]),l=t||a?0:e.filter(c=>c.isPinned).length,s=d.useCallback(c=>{i(u=>Si({columnId:c,columnConfigMapping:u,updatedProps:{pinned:!1}})),o(!0,!1)},[o,i]);return{pinColumn:d.useCallback(c=>{i(u=>Si({columnId:c,columnConfigMapping:u,updatedProps:{pinned:!0}})),o(!0,!1)},[o,i]),unpinColumn:s,freezeColumns:l}}function Cw(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(c=>c.id))},[e,t,n,r,o])}}function kw(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 Sw(e){switch(e.kind){case Z.Number:return e.data?.toString()??"";case Z.Boolean:return e.data?.toString()??"";case Z.Markdown:case Z.RowID:case Z.Text:case Z.Uri:return e.data??"";case Z.Bubble:case Z.Image:return e.data.join("");case Z.Drilldown:return e.data.map(t=>t.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function Du(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function Mw(e,t){return e=Du(e),t=Du(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 Iw(e,t){return e>t?1:e===t?0:-1}function Rw(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(c=>{const u=e.columns.findIndex(h=>c.column===h||h.id!==void 0&&c.column.id===h.id);return u===-1?void 0:u}),[o,e.columns]),a=d.useMemo(()=>{const c=o.map((h,g)=>({sort:h,col:i[g]})).filter(h=>h.col!==void 0);if(c.length===0)return;const u=c.map(()=>new Array(n));for(let h=0;h<c.length;h++){const{col:g}=c[h],f=[g,0];for(let p=0;p<n;p++)f[1]=p,u[h][p]=Sw(r(f))}return Tr(n).sort((h,g)=>{for(let f=0;f<c.length;f++){const{sort:p}=c[f],m=u[f][h],w=u[f][g];let y;if(p.mode==="raw"?y=Iw(m,w):p.mode==="smart"?y=Mw(m,w):y=m.localeCompare(w),y!==0)return(p.direction??"asc")==="desc"&&(y=-y),y}return 0})},[r,n,o,i]),l=d.useCallback(c=>a===void 0?c:a[c],[a]),s=d.useCallback(([c,u])=>a===void 0?r([c,u]):(u=a[u],r([c,u])),[r,a]);return a===void 0?{getCellContent:e.getCellContent,getOriginalIndex:l}:{getOriginalIndex:l,getCellContent:s}}function Ew(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 Tw(e,t,n){const[r,o]=d.useState(),{getCellContent:i,getOriginalIndex:a}=Rw({columns:t.map(c=>Zl(c)),getCellContent:n,rows:e,sort:r}),l=d.useMemo(()=>Ew(t,r),[t,r]),s=d.useCallback((c,u,h)=>{const g=l[c];let f;u==="auto"?(f="asc",r&&r.column.id===g.id&&(r.direction==="asc"?f="desc":f=void 0)):f=u,f===void 0||h&&f===r?.direction?o(void 0):o({column:Zl(g),direction:f,mode:g.sortMode})},[r,l]);return{columns:l,sortColumn:s,getOriginalIndex:a,getCellContent:i}}function Ow(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 Dw(){return{provideEditor:d.useCallback(e=>{if(e.kind===Z.Text&&e.readonly&&B1(e.data))return{editor:q1}},[])}}const Pw={kind:Z.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:c,graphKind:u="area",displayValues:h,hideAxis:g}=t.data;const[f,p]=s;if(l.length===0)return!0;l=l.map(M=>Math.min(1,Math.max(0,(M-f)/(p-f))));const m=r.cellHorizontalPadding,w=m+o.x,y=o.y+3,v=o.height-6,C=o.width-m*2,R=p-f,E=p<=0?y:f>=0?y+v:y+v*(p/R);if(!g&&f<=0&&p>=0&&(n.beginPath(),n.moveTo(w,E),n.lineTo(w+C,E),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),u==="bar"){n.beginPath();const M=2,H=(l.length-1)*M,S=(C-H)/l.length;let x=w;for(const L of l){const T=y+v-L*v;n.moveTo(x,E),n.lineTo(x+S,E),n.lineTo(x+S,T),n.lineTo(x,T),x+=S+M}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{l.length===1&&(l=[l[0],l[0]],h&&(h=[h[0],h[0]])),n.beginPath();const M=(o.width-16)/(l.length-1),H=l.map((x,L)=>({x:w+M*L,y:y+v-x*v}));n.moveTo(H[0].x,H[0].y);let S=0;if(H.length>2)for(S=1;S<H.length-2;S++){const x=(H[S].x+H[S+1].x)/2,L=(H[S].y+H[S+1].y)/2;n.quadraticCurveTo(H[S].x,H[S].y,x,L)}if(n.quadraticCurveTo(H[S].x,H[S].y,H[S+1].x,H[S+1].y),n.strokeStyle=c??r.accentColor,n.lineWidth=1+i*.5,n.stroke(),n.lineTo(o.x+o.width-m,E),n.lineTo(o.x+m,E),n.closePath(),u==="area"){n.globalAlpha=.2+.2*i;const x=n.createLinearGradient(0,y,0,y+v*1.4);x.addColorStop(0,c??r.accentColor);const[L,T,I]=bi(c??r.accentColor);x.addColorStop(1,`rgba(${L}, ${T}, ${I}, 0)`),n.fillStyle=x,n.fill(),n.globalAlpha=1}if(a!==void 0&&(u==="line"||u==="area")&&h!==void 0){n.beginPath();const x=Math.min(l.length-1,Math.max(0,Math.round((a-m)/M)));n.moveTo(w+x*M,o.y+1),n.lineTo(w+x*M,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(h[x],w,o.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function Pu(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)}}function Hu(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 Le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hu(Object(n),!0).forEach(function(r){si(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Hw=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Uh(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,c=e.onChange,u=e.onInputChange,h=e.onMenuClose,g=e.onMenuOpen,f=e.value,p=ur(e,Hw),m=d.useState(l!==void 0?l:n),w=gr(m,2),y=w[0],v=w[1],C=d.useState(s!==void 0?s:o),R=gr(C,2),E=R[0],M=R[1],H=d.useState(f!==void 0?f:a),S=gr(H,2),x=S[0],L=S[1],T=d.useCallback(function(Y,ae){typeof c=="function"&&c(Y,ae),L(Y)},[c]),I=d.useCallback(function(Y,ae){var ee;typeof u=="function"&&(ee=u(Y,ae)),v(ee!==void 0?ee:Y)},[u]),O=d.useCallback(function(){typeof g=="function"&&g(),M(!0)},[g]),D=d.useCallback(function(){typeof h=="function"&&h(),M(!1)},[h]),k=l!==void 0?l:y,Q=s!==void 0?s:E,N=f!==void 0?f:x;return Le(Le({},p),{},{inputValue:k,menuIsOpen:Q,onChange:T,onInputChange:I,onMenuClose:D,onMenuOpen:O,value:N})}function Lw(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 Aw(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 Fw=(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(Aw(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=Lw(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})(),zw=function(e,t,n){for(var r=0,o=0;r=o,o=_l(),r===38&&o===12&&(t[n]=1),!Cd(o);)xd();return Pg(e,kd)},_w=function(e,t){var n=-1,r=44;do switch(Cd(r)){case 0:r===38&&_l()===12&&(t[n]=1),e[n]+=zw(kd-1,t,n);break;case 2:e[n]+=Dg(r);break;case 4:if(r===44){e[++n]=_l()===58?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Og(r)}while(r=xd());return e},$w=function(e,t){return Rg(_w(Eg(e),t))},Lu=new WeakMap,Vw=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&&!Lu.get(n))&&!r){Lu.set(e,!0);for(var o=[],i=$w(t,o),a=n.props,l=0,s=0;l<i.length;l++)for(var c=0;c<a.length;c++,s++)e.props[s]=o[l]?i[l].replace(/&\f/g,a[c]):a[c]+" "+i[l]}}},Bw=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function Xh(e,t){switch(Tg(e,t)){case 5103:return Ct+"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 Ct+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ct+e+fa+e+yn+e+e;case 6828:case 4268:return Ct+e+yn+e+e;case 6165:return Ct+e+yn+"flex-"+e+e;case 5187:return Ct+e+Lt(e,/(\w+).+(:[^]+)/,Ct+"box-$1$2"+yn+"flex-$1$2")+e;case 5443:return Ct+e+yn+"flex-item-"+Lt(e,/flex-|-self/,"")+e;case 4675:return Ct+e+yn+"flex-line-pack"+Lt(e,/align-content|flex-|-self/,"")+e;case 5548:return Ct+e+yn+Lt(e,"shrink","negative")+e;case 5292:return Ct+e+yn+Lt(e,"basis","preferred-size")+e;case 6060:return Ct+"box-"+Lt(e,"-grow","")+Ct+e+yn+Lt(e,"grow","positive")+e;case 4554:return Ct+Lt(e,/([^-])(transform)/g,"$1"+Ct+"$2")+e;case 6187:return Lt(Lt(Lt(e,/(zoom-|grab)/,Ct+"$1"),/(image-set)/,Ct+"$1"),e,"")+e;case 5495:case 3959:return Lt(e,/(image-set\([^]*)/,Ct+"$1$`$1");case 4968:return Lt(Lt(e,/(.+:)(flex-)?(.*)/,Ct+"box-pack:$3"+yn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ct+e+e;case 4095:case 3583:case 4068:case 2532:return Lt(e,/(.+)-inline(.+)/,Ct+"$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(hc(e)-1-t>6)switch(Wr(e,t+1)){case 109:if(Wr(e,t+4)!==45)break;case 102:return Lt(e,/(.+:)(.+)-([^]+)/,"$1"+Ct+"$2-$3$1"+fa+(Wr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~fc(e,"stretch")?Xh(Lt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Wr(e,t+1)!==115)break;case 6444:switch(Wr(e,hc(e)-3-(~fc(e,"!important")&&10))){case 107:return Lt(e,":",":"+Ct)+e;case 101:return Lt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ct+(Wr(e,14)===45?"inline-":"")+"box$3$1"+Ct+"$2$3$1"+yn+"$2box$3")+e}break;case 5936:switch(Wr(e,t+11)){case 114:return Ct+e+yn+Lt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ct+e+yn+Lt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ct+e+yn+Lt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ct+e+yn+e+e}return e}var Nw=function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Sg:e.return=Xh(e.value,e.length);break;case kg:return la([Xo(e,{value:Lt(e.value,"@","@"+Ct)})],r);case yg:if(e.length)return xg(e.props,function(o){switch(Cg(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return la([Xo(e,{props:[Lt(o,/:(read-\w+)/,":"+fa+"$1")]})],r);case"::placeholder":return la([Xo(e,{props:[Lt(o,/:(plac\w+)/,":"+Ct+"input-$1")]}),Xo(e,{props:[Lt(o,/:(plac\w+)/,":"+fa+"$1")]}),Xo(e,{props:[Lt(o,/:(plac\w+)/,yn+"input-$1")]})],r)}return""})}},Ww=[Nw],jw=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(p){var m=p.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var r=e.stylisPlugins||Ww,o={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(p){for(var m=p.getAttribute("data-emotion").split(" "),w=1;w<m.length;w++)o[m[w]]=!0;a.push(p)});var l,s=[Vw,Bw];{var c,u=[vg,bg(function(p){c.insert(p)})],h=Wp(s.concat(r,u)),g=function(p){return la(Hg(p),h)};l=function(p,m,w,y){c=w,g(p?p+"{"+m.styles+"}":m.styles),y&&(f.inserted[m.name]=!0)}}var f={key:t,sheet:new Fw({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 f.sheet.hydrate(a),f},Gw=function(e){return e()},Uw=d.useInsertionEffect?d.useInsertionEffect:!1,Xw=Uw||Gw,$s={}.hasOwnProperty,qh=d.createContext(typeof HTMLElement<"u"?jw({key:"css"}):null);qh.Provider;var qw=function(e){return d.forwardRef(function(t,n){var r=d.useContext(qh);return e(t,r,n)})},Kw=d.createContext({}),Yl="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Zw=function(e,t){var n={};for(var r in t)$s.call(t,r)&&(n[r]=t[r]);return n[Yl]=e,n},Yw=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Mg(t,n,r),Xw(function(){return Ig(t,n,r)}),null},Qw=qw(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var o=e[Yl],i=[r],a="";typeof e.className=="string"?a=wg(t.registered,i,e.className):e.className!=null&&(a=e.className+" ");var l=bd(i,void 0,d.useContext(Kw));a+=t.key+"-"+l.name;var s={};for(var c in e)$s.call(e,c)&&c!=="css"&&c!==Yl&&(s[c]=e[c]);return s.ref=n,s.className=a,d.createElement(d.Fragment,null,d.createElement(Yw,{cache:t,serialized:l,isStringTag:typeof o=="string"}),d.createElement(o,s))}),Jw=Qw,Fe=function(e,t){var n=arguments;if(t==null||!$s.call(t,"css"))return d.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=Jw,o[1]=Zw(e,t);for(var i=2;i<r;i++)o[i]=n[i];return d.createElement.apply(null,o)};function Vs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return bd(t)}var ey=function(){var e=Vs.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 ty(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const ny=Math.min,ry=Math.max,Ma=Math.round,oa=Math.floor,Ql=e=>({x:e,y:e});function oy(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 Aa(){return typeof window<"u"}function Kh(e){return Yh(e)?(e.nodeName||"").toLowerCase():"#document"}function Or(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zh(e){var t;return(t=(Yh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yh(e){return Aa()?e instanceof Node||e instanceof Or(e).Node:!1}function iy(e){return Aa()?e instanceof Element||e instanceof Or(e).Element:!1}function Bs(e){return Aa()?e instanceof HTMLElement||e instanceof Or(e).HTMLElement:!1}function Au(e){return!Aa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Or(e).ShadowRoot}const ay=new Set(["inline","contents"]);function Qh(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ns(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ay.has(o)}const ly=new Set(["html","body","#document"]);function sy(e){return ly.has(Kh(e))}function Ns(e){return Or(e).getComputedStyle(e)}function cy(e){if(Kh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Au(e)&&e.host||Zh(e);return Au(t)?t.host:t}function Jh(e){const t=cy(e);return sy(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bs(t)&&Qh(t)?t:Jh(t)}function Ia(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Jh(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Or(o);if(i){const l=Jl(a);return t.concat(a,a.visualViewport||[],Qh(o)?o:[],l&&n?Ia(l):[])}return t.concat(o,Ia(o,[],n))}function Jl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uy(e){const t=Ns(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Bs(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=Ma(n)!==i||Ma(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function Ws(e){return iy(e)?e:e.contextElement}function Fu(e){const t=Ws(e);if(!Bs(t))return Ql(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=uy(t);let a=(i?Ma(n.width):n.width)/r,l=(i?Ma(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}function zu(e,t,n,r){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),i=Ws(e);let a=Ql(1);t&&(a=Fu(e));const l=Ql(0);let s=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,u=o.width/a.x,h=o.height/a.y;if(i){const g=Or(i),f=r;let p=g,m=Jl(p);for(;m&&r&&f!==p;){const w=Fu(m),y=m.getBoundingClientRect(),v=Ns(m),C=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*w.x,R=y.top+(m.clientTop+parseFloat(v.paddingTop))*w.y;s*=w.x,c*=w.y,u*=w.x,h*=w.y,s+=C,c+=R,p=Or(m),m=Jl(p)}}return oy({width:u,height:h,x:s,y:c})}function ef(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dy(e,t){let n=null,r;const o=Zh(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 c=e.getBoundingClientRect(),{left:u,top:h,width:g,height:f}=c;if(l||t(),!g||!f)return;const p=oa(h),m=oa(o.clientWidth-(u+g)),w=oa(o.clientHeight-(h+f)),y=oa(u),v={rootMargin:-p+"px "+-m+"px "+-w+"px "+-y+"px",threshold:ry(0,ny(1,s))||1};let C=!0;function R(E){const M=E[0].intersectionRatio;if(M!==s){if(!C)return a();M?a(!1,M):r=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!ef(c,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(R,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,v)}n.observe(e)}return a(!0),i}function hy(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,c=Ws(e),u=o||i?[...c?Ia(c):[],...Ia(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const h=c&&l?dy(c,n):null;let g=-1,f=null;a&&(f=new ResizeObserver(y=>{let[v]=y;v&&v.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=f)==null||C.observe(t)})),n()}),c&&!s&&f.observe(c),f.observe(t));let p,m=s?zu(e):null;s&&w();function w(){const y=zu(e);m&&!ef(m,y)&&n(),m=y,p=requestAnimationFrame(w)}return n(),()=>{var y;u.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),h?.(),(y=f)==null||y.disconnect(),f=null,s&&cancelAnimationFrame(p)}}var es=d.useLayoutEffect,fy=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ra=function(){};function py(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function gy(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(py(e,a)));return i.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var Ea=function(e){return Sy(e)?e.filter(Boolean):gg(e)==="object"&&e!==null?[e]:[]},tf=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,fy);return Le({},t)},Xt=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 my(e){return Fa(e)?window.innerHeight:e.clientHeight}function nf(e){return Fa(e)?window.pageYOffset:e.scrollTop}function Ta(e,t){if(Fa(e)){window.scrollTo(0,t);return}e.scrollTop=t}function vy(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 by(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function ia(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ra,o=nf(e),i=t-o,a=10,l=0;function s(){l+=a;var c=by(l,o,i,n);Ta(e,c),l<n?window.requestAnimationFrame(s):r(e)}s()}function _u(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?Ta(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&Ta(e,Math.max(t.offsetTop-o,0))}function wy(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function $u(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function yy(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var rf=!1,xy={get passive(){return rf=!0}},aa=typeof window<"u"?window:{};aa.addEventListener&&aa.removeEventListener&&(aa.addEventListener("p",Ra,xy),aa.removeEventListener("p",Ra,!1));var Cy=rf;function ky(e){return e!=null}function Sy(e){return Array.isArray(e)}function ui(e,t,n){return e?t:n}var My=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=gr(i,1),l=a[0];return!n.includes(l)});return o.reduce(function(i,a){var l=gr(a,2),s=l[0],c=l[1];return i[s]=c,i},{})},Iy=["children","innerProps"],Ry=["children","innerProps"];function Ey(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,a=e.isFixedPosition,l=e.controlHeight,s=vy(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u=s.getBoundingClientRect(),h=u.height,g=n.getBoundingClientRect(),f=g.bottom,p=g.height,m=g.top,w=n.offsetParent.getBoundingClientRect(),y=w.top,v=a?window.innerHeight:my(s),C=nf(s),R=parseInt(getComputedStyle(n).marginBottom,10),E=parseInt(getComputedStyle(n).marginTop,10),M=y-E,H=v-m,S=M+C,x=h-C-m,L=f-v+C+R,T=C+m-E,I=160;switch(o){case"auto":case"bottom":if(H>=p)return{placement:"bottom",maxHeight:t};if(x>=p&&!a)return i&&ia(s,L,I),{placement:"bottom",maxHeight:t};if(!a&&x>=r||a&&H>=r){i&&ia(s,L,I);var O=a?H-R:x-R;return{placement:"bottom",maxHeight:O}}if(o==="auto"||a){var D=t,k=a?M:S;return k>=r&&(D=Math.min(k-R-l,t)),{placement:"top",maxHeight:D}}if(o==="bottom")return i&&Ta(s,L),{placement:"bottom",maxHeight:t};break;case"top":if(M>=p)return{placement:"top",maxHeight:t};if(S>=p&&!a)return i&&ia(s,T,I),{placement:"top",maxHeight:t};if(!a&&S>=r||a&&M>=r){var Q=t;return(!a&&S>=r||a&&M>=r)&&(Q=a?M-E:S-E),i&&ia(s,T,I),{placement:"top",maxHeight:Q}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}function Ty(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var of=function(e){return e==="auto"?"bottom":e},Oy=function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,l=o.colors;return Le((n={label:"menu"},si(n,Ty(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})},af=d.createContext(null),Dy=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(af)||{},c=s.setPortalPlacement,u=d.useRef(null),h=d.useState(r),g=gr(h,2),f=g[0],p=g[1],m=d.useState(null),w=gr(m,2),y=w[0],v=w[1],C=l.spacing.controlHeight;return es(function(){var R=u.current;if(R){var E=i==="fixed",M=a&&!E,H=Ey({maxHeight:r,menuEl:R,minHeight:n,placement:o,shouldScroll:M,isFixedPosition:E,controlHeight:C});p(H.maxHeight),v(H.placement),c?.(H.placement)}},[r,o,i,a,n,c,C]),t({ref:u,placerProps:Le(Le({},e),{},{placement:y||of(o),maxHeight:f})})},Py=function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return Fe("div",Ve({},Xt(e,"menu",{menu:!0}),{ref:n},r),t)},Hy=Py,Ly=function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return Le({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},Ay=function(e){var t=e.children,n=e.innerProps,r=e.innerRef,o=e.isMulti;return Fe("div",Ve({},Xt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},n),t)},lf=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return Le({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Fy=lf,zy=lf,_y=function(e){var t=e.children,n=t===void 0?"No options":t,r=e.innerProps,o=ur(e,Iy);return Fe("div",Ve({},Xt(Le(Le({},o),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},$y=function(e){var t=e.children,n=t===void 0?"Loading...":t,r=e.innerProps,o=ur(e,Ry);return Fe("div",Ve({},Xt(Le(Le({},o),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},Vy=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}},By=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),c=d.useState(of(i)),u=gr(c,2),h=u[0],g=u[1],f=d.useMemo(function(){return{setPortalPlacement:g}},[]),p=d.useState(null),m=gr(p,2),w=m[0],y=m[1],v=d.useCallback(function(){if(r){var M=wy(r),H=a==="fixed"?0:window.pageYOffset,S=M[h]+H;(S!==w?.offset||M.left!==w?.rect.left||M.width!==w?.rect.width)&&y({offset:S,rect:M})}},[r,a,h,w?.offset,w?.rect.left,w?.rect.width]);es(function(){v()},[v]);var C=d.useCallback(function(){typeof s.current=="function"&&(s.current(),s.current=null),r&&l.current&&(s.current=hy(r,l.current,v,{elementResize:"ResizeObserver"in window}))},[r,v]);es(function(){C()},[C]);var R=d.useCallback(function(M){l.current=M,C()},[C]);if(!t&&a!=="fixed"||!w)return null;var E=Fe("div",Ve({ref:R},Xt(Le(Le({},e),{},{offset:w.offset,position:a,rect:w.rect}),"menuPortal",{"menu-portal":!0}),o),n);return Fe(af.Provider,{value:f},t?md.createPortal(E,t):E)},Ny=function(e){var t=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},Wy=function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return Fe("div",Ve({},Xt(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},jy=function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return Le({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")})},Gy=function(e){var t=e.children,n=e.innerProps,r=e.isMulti,o=e.hasValue;return Fe("div",Ve({},Xt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)},Uy=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Xy=function(e){var t=e.children,n=e.innerProps;return Fe("div",Ve({},Xt(e,"indicatorsContainer",{indicators:!0}),n),t)},Vu,qy=["size"],Ky=["innerProps","isRtl","size"],Zy={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},sf=function(e){var t=e.size,n=ur(e,qy);return Fe("svg",Ve({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Zy},n))},js=function(e){return Fe(sf,Ve({size:20},e),Fe("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},cf=function(e){return Fe(sf,Ve({size:20},e),Fe("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},uf=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return Le({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:o*2,":hover":{color:n?i.neutral80:i.neutral40}})},Yy=uf,Qy=function(e){var t=e.children,n=e.innerProps;return Fe("div",Ve({},Xt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Fe(cf,null))},Jy=uf,ex=function(e){var t=e.children,n=e.innerProps;return Fe("div",Ve({},Xt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Fe(js,null))},tx=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return Le({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:o*2,marginTop:o*2})},nx=function(e){var t=e.innerProps;return Fe("span",Ve({},t,Xt(e,"indicatorSeparator",{"indicator-separator":!0})))},rx=ey(Vu||(Vu=ty([`
193
- 0%, 80%, 100% { opacity: 0; }
194
- 40% { opacity: 1; }
195
- `]))),ox=function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return Le({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})},El=function(e){var t=e.delay,n=e.offset;return Fe("span",{css:Vs({animation:"".concat(rx," 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"},"","")})},ix=function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=r===void 0?4:r,i=ur(e,Ky);return Fe("div",Ve({},Xt(Le(Le({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Fe(El,{delay:0,offset:n}),Fe(El,{delay:160,offset:!0}),Fe(El,{delay:320,offset:!n}))},ax=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius,l=o.spacing;return Le({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},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}})},lx=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return Fe("div",Ve({ref:o},Xt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},sx=lx,cx=["data"],ux=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},dx=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,c=e.theme,u=e.selectProps;return Fe("div",Ve({},Xt(e,"group",{group:!0}),l),Fe(i,Ve({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),s),Fe("div",null,t))},hx=function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return Le({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"})},fx=function(e){var t=tf(e);t.data;var n=ur(t,cx);return Fe("div",Ve({},Xt(e,"groupHeading",{"group-heading":!0}),n))},px=dx,gx=["innerRef","isDisabled","isHidden","inputClassName"],mx=function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return Le(Le({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},vx),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},df={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},vx={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Le({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},df)},bx=function(e){return Le({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},df)},wx=function(e){var t=e.cx,n=e.value,r=tf(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,s=ur(r,gx);return Fe("div",Ve({},Xt(e,"input",{"input-container":!0}),{"data-value":n||""}),Fe("input",Ve({className:t({input:!0},l),ref:o,style:bx(a),disabled:i},s)))},yx=wx,xx=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return Le({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},Cx=function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return Le({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})},kx=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return Le({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}})},hf=function(e){var t=e.children,n=e.innerProps;return Fe("div",n,t)},Sx=hf,Mx=hf;function Ix(e){var t=e.children,n=e.innerProps;return Fe("div",Ve({role:"button"},n),t||Fe(js,{size:14}))}var Rx=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,c=n.Label,u=n.Remove;return Fe(s,{data:r,innerProps:Le(Le({},Xt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},Fe(c,{data:r,innerProps:Le({},Xt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),Fe(u,{data:r,innerProps:Le(Le({},Xt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},Ex=Rx,Tx=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return Le({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}})},Ox=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return Fe("div",Ve({},Xt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},Dx=Ox,Px=function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return Le({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Hx=function(e){var t=e.children,n=e.innerProps;return Fe("div",Ve({},Xt(e,"placeholder",{placeholder:!0}),n),t)},Lx=Hx,Ax=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return Le({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})},Fx=function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return Fe("div",Ve({},Xt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},zx=Fx,Gs={ClearIndicator:ex,Control:sx,DropdownIndicator:Qy,DownChevron:cf,CrossIcon:js,Group:px,GroupHeading:fx,IndicatorsContainer:Xy,IndicatorSeparator:nx,Input:yx,LoadingIndicator:ix,Menu:Hy,MenuList:Ay,MenuPortal:By,LoadingMessage:$y,NoOptionsMessage:_y,MultiValue:Ex,MultiValueContainer:Sx,MultiValueLabel:Mx,MultiValueRemove:Ix,Option:Dx,Placeholder:Lx,SelectContainer:Wy,SingleValue:zx,ValueContainer:Gy},_x=function(e){return Le(Le({},Gs),e.components)},Bu=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function $x(e,t){return!!(e===t||Bu(e)&&Bu(t))}function Vx(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!$x(e[n],t[n]))return!1;return!0}function Bx(e,t){t===void 0&&(t=Vx);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 Nx={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"},Wx=function(e){return Fe("span",Ve({css:Nx},e))},Nu=Wx,jx={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,c=e.isAppleDevice,u=function(f,p){return f&&f.length?"".concat(f.indexOf(p)+1," of ").concat(f.length):""};if(t==="value"&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if(t==="menu"&&c){var h=l?" disabled":"",g="".concat(s?" selected":"").concat(h);return"".concat(i).concat(g,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Gx=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,c=e.isAppleDevice,u=l.ariaLiveMessages,h=l.getOptionLabel,g=l.inputValue,f=l.isMulti,p=l.isOptionDisabled,m=l.isSearchable,w=l.menuIsOpen,y=l.options,v=l.screenReaderStatus,C=l.tabSelectsValue,R=l.isLoading,E=l["aria-label"],M=l["aria-live"],H=d.useMemo(function(){return Le(Le({},jx),u||{})},[u]),S=d.useMemo(function(){var D="";if(t&&H.onChange){var k=t.option,Q=t.options,N=t.removedValue,Y=t.removedValues,ae=t.value,ee=function(se){return Array.isArray(se)?null:se},K=N||k||ee(ae),pe=K?h(K):"",oe=Q||Y||void 0,de=oe?oe.map(h):[],he=Le({isDisabled:K&&p(K,a),label:pe,labels:de},t);D=H.onChange(he)}return D},[t,H,p,a,h]),x=d.useMemo(function(){var D="",k=n||r,Q=!!(n&&a&&a.includes(n));if(k&&H.onFocus){var N={focused:k,label:h(k),isDisabled:p(k,a),isSelected:Q,options:o,context:k===n?"menu":"value",selectValue:a,isAppleDevice:c};D=H.onFocus(N)}return D},[n,r,h,p,H,o,a,c]),L=d.useMemo(function(){var D="";if(w&&y.length&&!R&&H.onFilter){var k=v({count:o.length});D=H.onFilter({inputValue:g,resultsMessage:k})}return D},[o,g,w,H,y,v,R]),T=t?.action==="initial-input-focus",I=d.useMemo(function(){var D="";if(H.guidance){var k=r?"value":w?"menu":"input";D=H.guidance({"aria-label":E,context:k,isDisabled:n&&p(n,a),isMulti:f,isSearchable:m,tabSelectsValue:C,isInitialFocus:T})}return D},[E,n,r,f,p,m,w,H,a,C,T]),O=Fe(d.Fragment,null,Fe("span",{id:"aria-selection"},S),Fe("span",{id:"aria-focused"},x),Fe("span",{id:"aria-results"},L),Fe("span",{id:"aria-guidance"},I));return Fe(d.Fragment,null,Fe(Nu,{id:s},T&&O),Fe(Nu,{"aria-live":M,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!T&&O))},Ux=Gx,ts=[{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źẑżžẓẕƶȥɀⱬꝣ"}],Xx=new RegExp("["+ts.map(function(e){return e.letters}).join("")+"]","g"),ff={};for(var Tl=0;Tl<ts.length;Tl++)for(var Ol=ts[Tl],Dl=0;Dl<Ol.letters.length;Dl++)ff[Ol.letters[Dl]]=Ol.base;var pf=function(e){return e.replace(Xx,function(t){return ff[t]})},qx=Bx(pf),Wu=function(e){return e.replace(/^\s+|\s+$/g,"")},Kx=function(e){return"".concat(e.label," ").concat(e.value)},Zx=function(e){return function(t,n){if(t.data.__isNew__)return!0;var r=Le({ignoreCase:!0,ignoreAccents:!0,stringify:Kx,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,i=r.ignoreAccents,a=r.stringify,l=r.trim,s=r.matchFrom,c=l?Wu(n):n,u=l?Wu(a(t)):a(t);return o&&(c=c.toLowerCase(),u=u.toLowerCase()),i&&(c=qx(c),u=pf(u)),s==="start"?u.substr(0,c.length)===c:u.indexOf(c)>-1}},Yx=["innerRef"];function Qx(e){var t=e.innerRef,n=ur(e,Yx),r=My(n,"onExited","in","enter","exit","appear");return Fe("input",Ve({ref:t},r,{css:Vs({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 Jx=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function eC(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),c=d.useRef(null),u=d.useCallback(function(w,y){if(c.current!==null){var v=c.current,C=v.scrollTop,R=v.scrollHeight,E=v.clientHeight,M=c.current,H=y>0,S=R-E-C,x=!1;S>y&&a.current&&(r&&r(w),a.current=!1),H&&l.current&&(i&&i(w),l.current=!1),H&&y>S?(n&&!a.current&&n(w),M.scrollTop=R,x=!0,a.current=!0):!H&&-y>C&&(o&&!l.current&&o(w),M.scrollTop=0,x=!0,l.current=!0),x&&Jx(w)}},[n,r,o,i]),h=d.useCallback(function(w){u(w,w.deltaY)},[u]),g=d.useCallback(function(w){s.current=w.changedTouches[0].clientY},[]),f=d.useCallback(function(w){var y=s.current-w.changedTouches[0].clientY;u(w,y)},[u]),p=d.useCallback(function(w){if(w){var y=Cy?{passive:!1}:!1;w.addEventListener("wheel",h,y),w.addEventListener("touchstart",g,y),w.addEventListener("touchmove",f,y)}},[f,g,h]),m=d.useCallback(function(w){w&&(w.removeEventListener("wheel",h,!1),w.removeEventListener("touchstart",g,!1),w.removeEventListener("touchmove",f,!1))},[f,g,h]);return d.useEffect(function(){if(t){var w=c.current;return p(w),function(){m(w)}}},[t,p,m]),function(w){c.current=w}}var ju=["boxSizing","height","overflow","paddingRight","position"],Gu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Uu(e){e.cancelable&&e.preventDefault()}function Xu(e){e.stopPropagation()}function qu(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Ku(){return"ontouchstart"in window||navigator.maxTouchPoints}var Zu=!!(typeof window<"u"&&window.document&&window.document.createElement),li=0,Co={capture:!1,passive:!1};function tC(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(Zu){var c=document.body,u=c&&c.style;if(r&&ju.forEach(function(p){var m=u&&u[p];o.current[p]=m}),r&&li<1){var h=parseInt(o.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,f=window.innerWidth-g+h||0;Object.keys(Gu).forEach(function(p){var m=Gu[p];u&&(u[p]=m)}),u&&(u.paddingRight="".concat(f,"px"))}c&&Ku()&&(c.addEventListener("touchmove",Uu,Co),s&&(s.addEventListener("touchstart",qu,Co),s.addEventListener("touchmove",Xu,Co))),li+=1}},[r]),l=d.useCallback(function(s){if(Zu){var c=document.body,u=c&&c.style;li=Math.max(li-1,0),r&&li<1&&ju.forEach(function(h){var g=o.current[h];u&&(u[h]=g)}),c&&Ku()&&(c.removeEventListener("touchmove",Uu,Co),s&&(s.removeEventListener("touchstart",qu,Co),s.removeEventListener("touchmove",Xu,Co)))}},[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 nC=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},rC={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function oC(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,c=eC({isEnabled:o,onBottomArrive:i,onBottomLeave:a,onTopArrive:l,onTopLeave:s}),u=tC({isEnabled:n}),h=function(g){c(g),u(g)};return Fe(d.Fragment,null,n&&Fe("div",{onClick:nC,css:rC}),t(h))}var iC={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},aC=function(e){var t=e.name,n=e.onFocus;return Fe("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:iC,value:"",onChange:function(){}})},lC=aC;function Us(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 sC(){return Us(/^iPhone/i)}function gf(){return Us(/^Mac/i)}function cC(){return Us(/^iPad/i)||gf()&&navigator.maxTouchPoints>1}function uC(){return sC()||cC()}function dC(){return gf()||uC()}var hC=function(e){return e.label},mf=function(e){return e.label},vf=function(e){return e.value},fC=function(e){return!!e.isDisabled},pC={clearIndicator:Jy,container:Ny,control:ax,dropdownIndicator:Yy,group:ux,groupHeading:hx,indicatorsContainer:Uy,indicatorSeparator:tx,input:mx,loadingIndicator:ox,loadingMessage:zy,menu:Oy,menuList:Ly,menuPortal:Vy,multiValue:xx,multiValueLabel:Cx,multiValueRemove:kx,noOptionsMessage:Fy,option:Tx,placeholder:Px,singleValue:Ax,valueContainer:jy},gC={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%)"},mC=4,bf=4,vC=38,bC=bf*2,wC={baseUnit:bf,controlHeight:vC,menuGutter:bC},Pl={borderRadius:mC,colors:gC,spacing:wC},yC={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:$u(),captureMenuScroll:!$u(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Zx(),formatGroupLabel:hC,getOptionLabel:mf,getOptionValue:vf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:fC,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!yy(),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 Yu(e,t,n,r){var o=xf(e,t,n),i=Cf(e,t,n),a=yf(e,t),l=Oa(e,t);return{type:"option",data:t,isDisabled:o,isSelected:i,label:a,value:l,index:r}}function da(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(a,l){return Yu(e,a,t,l)}).filter(function(a){return Ju(e,a)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Yu(e,n,t,r);return Ju(e,i)?i:void 0}).filter(ky)}function wf(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 Qu(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 xC(e,t){return wf(da(e,t))}function Ju(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,i=t.isSelected,a=t.label,l=t.value;return(!Sf(e)||!i)&&kf(e,{label:a,value:l,data:o},r)}function CC(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 kC(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Hl=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},yf=function(e,t){return e.getOptionLabel(t)},Oa=function(e,t){return e.getOptionValue(t)};function xf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Cf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Oa(e,t);return n.some(function(o){return Oa(e,o)===r})}function kf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Sf=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},SC=1,Xs=(function(e){jg(n,e);var t=Xg(n);function n(r){var o;if(Gg(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,c){var u=o.props,h=u.onChange,g=u.name;c.name=g,o.ariaOnChange(s,c),h(s,c)},o.setValue=function(s,c,u){var h=o.props,g=h.closeMenuOnSelect,f=h.isMulti,p=h.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(o.setState({inputIsHiddenAfterUpdate:!f}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(s,{action:c,option:u})},o.selectOption=function(s){var c=o.props,u=c.blurInputOnSelect,h=c.isMulti,g=c.name,f=o.state.selectValue,p=h&&o.isOptionSelected(s,f),m=o.isOptionDisabled(s,f);if(p){var w=o.getOptionValue(s);o.setValue(f.filter(function(y){return o.getOptionValue(y)!==w}),"deselect-option",s)}else if(!m)h?o.setValue([].concat(To(f),[s]),"select-option",s):o.setValue(s,"select-option");else{o.ariaOnChange(s,{action:"select-option",option:s,name:g});return}u&&o.blurInput()},o.removeValue=function(s){var c=o.props.isMulti,u=o.state.selectValue,h=o.getOptionValue(s),g=u.filter(function(p){return o.getOptionValue(p)!==h}),f=ui(c,g,g[0]||null);o.onChange(f,{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,c=o.state.selectValue,u=c[c.length-1],h=c.slice(0,c.length-1),g=ui(s,h,h[0]||null);u&&o.onChange(g,{action:"pop-value",removedValue:u})},o.getFocusedOptionId=function(s){return Hl(o.state.focusableOptionsWithIds,s)},o.getFocusableOptionsWithIds=function(){return Qu(da(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return gy.apply(void 0,[o.props.classNamePrefix].concat(c))},o.getOptionLabel=function(s){return yf(o.props,s)},o.getOptionValue=function(s){return Oa(o.props,s)},o.getStyles=function(s,c){var u=o.props.unstyled,h=pC[s](c,u);h.boxSizing="border-box";var g=o.props.styles[s];return g?g(h,c):h},o.getClassNames=function(s,c){var u,h;return(u=(h=o.props.classNames)[s])===null||u===void 0?void 0:u.call(h,c)},o.getElementId=function(s){return"".concat(o.state.instancePrefix,"-").concat(s)},o.getComponents=function(){return _x(o.props)},o.buildCategorizedOptions=function(){return da(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return wf(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(s,c){o.setState({ariaSelection:Le({value:s},c)})},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 c=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&o.onMenuClose():c&&o.openMenu("first"):(c&&(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 c=o.props,u=c.isMulti,h=c.menuIsOpen;o.focusInput(),h?(o.setState({inputIsHiddenAfterUpdate:!u}),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 c=s.touches,u=c&&c.item(0);u&&(o.initialTouchX=u.clientX,o.initialTouchY=u.clientY,o.userIsDragging=!1)},o.onTouchMove=function(s){var c=s.touches,u=c&&c.item(0);if(u){var h=Math.abs(u.clientX-o.initialTouchX),g=Math.abs(u.clientY-o.initialTouchY),f=5;o.userIsDragging=h>f||g>f}},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 c=o.props.inputValue,u=s.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(u,{action:"input-change",prevInputValue:c}),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 c=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:c}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(s){if(!(o.blockOptionHover||o.state.focusedOption===s)){var c=o.getFocusableOptions(),u=c.indexOf(s);o.setState({focusedOption:s,focusedOptionId:u>-1?o.getFocusedOptionId(s):null})}},o.shouldHideSelectedOptions=function(){return Sf(o.props)},o.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),o.focus()},o.onKeyDown=function(s){var c=o.props,u=c.isMulti,h=c.backspaceRemovesValue,g=c.escapeClearsValue,f=c.inputValue,p=c.isClearable,m=c.isDisabled,w=c.menuIsOpen,y=c.onKeyDown,v=c.tabSelectsValue,C=c.openMenuOnFocus,R=o.state,E=R.focusedOption,M=R.focusedValue,H=R.selectValue;if(!m&&!(typeof y=="function"&&(y(s),s.defaultPrevented))){switch(o.blockOptionHover=!0,s.key){case"ArrowLeft":if(!u||f)return;o.focusValue("previous");break;case"ArrowRight":if(!u||f)return;o.focusValue("next");break;case"Delete":case"Backspace":if(f)return;if(M)o.removeValue(M);else{if(!h)return;u?o.popValue():p&&o.clearValue()}break;case"Tab":if(o.isComposing||s.shiftKey||!w||!v||!E||C&&o.isOptionSelected(E,H))return;o.selectOption(E);break;case"Enter":if(s.keyCode===229)break;if(w){if(!E||o.isComposing)return;o.selectOption(E);break}return;case"Escape":w?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:f}),o.onMenuClose()):p&&g&&o.clearValue();break;case" ":if(f)return;if(!w){o.openMenu("first");break}if(!E)return;o.selectOption(E);break;case"ArrowUp":w?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":w?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!w)return;o.focusOption("pageup");break;case"PageDown":if(!w)return;o.focusOption("pagedown");break;case"Home":if(!w)return;o.focusOption("first");break;case"End":if(!w)return;o.focusOption("last");break;default:return}s.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++SC),o.state.selectValue=Ea(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=Hl(i,a[l])}return o}return Ug(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&&_u(this.menuListRef,this.focusedOptionRef),dC()&&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&&(_u(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(),c=r==="first"?0:s.length-1;if(!this.props.isMulti){var u=s.indexOf(a[0]);u>-1&&(c=u)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:s[c],focusedOptionId:this.getFocusedOptionId(s[c])},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,c=-1;if(i.length){switch(r){case"previous":l===0?c=0:l===-1?c=s:c=l-1;break;case"next":l>-1&&l<s&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:i[c]})}}}},{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(Pl):Le(Le({},Pl),this.props.theme):Pl})},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,s=this.selectOption,c=this.setValue,u=this.props,h=u.isMulti,g=u.isRtl,f=u.options,p=this.hasValue();return{clearValue:r,cx:o,getStyles:i,getClassNames:a,getValue:l,hasValue:p,isMulti:h,isRtl:g,options:f,selectOption:s,selectProps:u,setValue:c,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 xf(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return Cf(this.props,r,o)}},{key:"filterOption",value:function(r,o){return kf(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,c=r.form,u=r.menuIsOpen,h=r.required,g=this.getComponents(),f=g.Input,p=this.state,m=p.inputIsHidden,w=p.ariaSelection,y=this.commonProps,v=a||this.getElementId("input"),C=Le(Le(Le({"aria-autocomplete":"list","aria-expanded":u,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":h,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},u&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?w?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?d.createElement(f,Ve({},y,{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:c,type:"text",value:l},C)):d.createElement(Qx,Ve({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ra,onFocus:this.onInputFocus,disabled:o,tabIndex:s,inputMode:"none",form:c,value:""},C))})},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),i=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,s=o.MultiValueRemove,c=o.SingleValue,u=o.Placeholder,h=this.commonProps,g=this.props,f=g.controlShouldRenderValue,p=g.isDisabled,m=g.isMulti,w=g.inputValue,y=g.placeholder,v=this.state,C=v.selectValue,R=v.focusedValue,E=v.isFocused;if(!this.hasValue()||!f)return w?null:d.createElement(u,Ve({},h,{key:"placeholder",isDisabled:p,isFocused:E,innerProps:{id:this.getElementId("placeholder")}}),y);if(m)return C.map(function(H,S){var x=H===R,L="".concat(r.getOptionLabel(H),"-").concat(r.getOptionValue(H));return d.createElement(i,Ve({},h,{components:{Container:a,Label:l,Remove:s},isFocused:x,isDisabled:p,key:L,index:S,removeProps:{onClick:function(){return r.removeValue(H)},onTouchEnd:function(){return r.removeValue(H)},onMouseDown:function(T){T.preventDefault()}},data:H}),r.formatOptionLabel(H,"value"))});if(w)return null;var M=C[0];return d.createElement(c,Ve({},h,{data:M,isDisabled:p}),this.formatOptionLabel(M,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||s)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ve({},i,{innerProps:u,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,c=this.state.isFocused;if(!o||!s)return null;var u={"aria-hidden":"true"};return d.createElement(o,Ve({},i,{innerProps:u,isDisabled:l,isFocused:c}))}},{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,Ve({},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,Ve({},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,c=o.MenuPortal,u=o.LoadingMessage,h=o.NoOptionsMessage,g=o.Option,f=this.commonProps,p=this.state.focusedOption,m=this.props,w=m.captureMenuScroll,y=m.inputValue,v=m.isLoading,C=m.loadingMessage,R=m.minMenuHeight,E=m.maxMenuHeight,M=m.menuIsOpen,H=m.menuPlacement,S=m.menuPosition,x=m.menuPortalTarget,L=m.menuShouldBlockScroll,T=m.menuShouldScrollIntoView,I=m.noOptionsMessage,O=m.onMenuScrollToTop,D=m.onMenuScrollToBottom;if(!M)return null;var k=function(K,pe){var oe=K.type,de=K.data,he=K.isDisabled,se=K.isSelected,z=K.label,P=K.value,G=p===de,le=he?void 0:function(){return r.onOptionHover(de)},ce=he?void 0:function(){return r.selectOption(de)},we="".concat(r.getElementId("option"),"-").concat(pe),ge={id:we,onClick:ce,onMouseMove:le,onMouseOver:le,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:se};return d.createElement(g,Ve({},f,{innerProps:ge,data:de,isDisabled:he,isSelected:se,key:we,label:z,type:oe,value:P,isFocused:G,innerRef:G?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(K.data,"menu"))},Q;if(this.hasOptions())Q=this.getCategorizedOptions().map(function(K){if(K.type==="group"){var pe=K.data,oe=K.options,de=K.index,he="".concat(r.getElementId("group"),"-").concat(de),se="".concat(he,"-heading");return d.createElement(i,Ve({},f,{key:he,data:pe,options:oe,Heading:a,headingProps:{id:se,data:K.data},label:r.formatGroupLabel(K.data)}),K.options.map(function(z){return k(z,"".concat(de,"-").concat(z.index))}))}else if(K.type==="option")return k(K,"".concat(K.index))});else if(v){var N=C({inputValue:y});if(N===null)return null;Q=d.createElement(u,f,N)}else{var Y=I({inputValue:y});if(Y===null)return null;Q=d.createElement(h,f,Y)}var ae={minMenuHeight:R,maxMenuHeight:E,menuPlacement:H,menuPosition:S,menuShouldScrollIntoView:T},ee=d.createElement(Dy,Ve({},f,ae),function(K){var pe=K.ref,oe=K.placerProps,de=oe.placement,he=oe.maxHeight;return d.createElement(l,Ve({},f,ae,{innerRef:pe,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:v,placement:de}),d.createElement(oC,{captureEnabled:w,onTopArrive:O,onBottomArrive:D,lockEnabled:L},function(se){return d.createElement(s,Ve({},f,{innerRef:function(z){r.getMenuListRef(z),se(z)},innerProps:{role:"listbox","aria-multiselectable":f.isMulti,id:r.getElementId("listbox")},isLoading:v,maxHeight:he,focusedOption:p}),Q)}))});return x||S==="fixed"?d.createElement(c,Ve({},f,{appendTo:x,controlElement:this.controlRef,menuPlacement:H,menuPosition:S}),ee):ee}},{key:"renderFormField",value:function(){var r=this,o=this.props,i=o.delimiter,a=o.isDisabled,l=o.isMulti,s=o.name,c=o.required,u=this.state.selectValue;if(c&&!this.hasValue()&&!a)return d.createElement(lC,{name:s,onFocus:this.onValueInputFocus});if(!(!s||a))if(l)if(i){var h=u.map(function(p){return r.getOptionValue(p)}).join(i);return d.createElement("input",{name:s,type:"hidden",value:h})}else{var g=u.length>0?u.map(function(p,m){return d.createElement("input",{key:"i-".concat(m),name:s,type:"hidden",value:r.getOptionValue(p)})}):d.createElement("input",{name:s,type:"hidden",value:""});return d.createElement("div",null,g)}else{var f=u[0]?this.getOptionValue(u[0]):"";return d.createElement("input",{name:s,type:"hidden",value:f})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,i=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,s=o.isFocused,c=o.selectValue,u=this.getFocusableOptions();return d.createElement(Ux,Ve({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:s,selectValue:c,focusableOptions:u,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,c=s.className,u=s.id,h=s.isDisabled,g=s.menuIsOpen,f=this.state.isFocused,p=this.commonProps=this.getCommonProps();return d.createElement(a,Ve({},p,{className:c,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:f}),this.renderLiveRegion(),d.createElement(o,Ve({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:f,menuIsOpen:g}),d.createElement(l,Ve({},p,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(i,Ve({},p,{isDisabled:h}),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,c=o.isFocused,u=o.prevWasFocused,h=o.instancePrefix,g=r.options,f=r.value,p=r.menuIsOpen,m=r.inputValue,w=r.isMulti,y=Ea(f),v={};if(i&&(f!==i.value||g!==i.options||p!==i.menuIsOpen||m!==i.inputValue)){var C=p?xC(r,y):[],R=p?Qu(da(r,y),"".concat(h,"-option")):[],E=a?CC(o,y):null,M=kC(o,C),H=Hl(R,M);v={selectValue:y,focusedOption:M,focusedOptionId:H,focusableOptionsWithIds:R,focusedValue:E,clearFocusValueOnUpdate:!1}}var S=l!=null&&r!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},x=s,L=c&&u;return c&&!L&&(x={value:ui(w,y,y[0]||null),options:y,action:"initial-input-focus"},L=!u),s?.action==="initial-input-focus"&&(x=null),Le(Le(Le({},v),S),{},{prevProps:r,ariaSelection:x,prevWasFocused:L})}}]),n})(d.Component);Xs.defaultProps=yC;var MC=d.forwardRef(function(e,t){var n=Uh(e);return d.createElement(Xs,Ve({ref:t},n))}),Mf=MC;const IC=e=>{const{Menu:t}=Gs,{children:n,...r}=e;return d.createElement(t,{...r},n)},RC=sn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),EC=sn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),TC=sn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),OC=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:o}=e,{allowedValues:i,value:a}=t.data,[l,s]=d.useState(a),[c,u]=d.useState(r??""),h=sh(),g=d.useMemo(()=>i.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:f?.toString()??""}:f),[i]);return t.readonly?d.createElement(TC,null,d.createElement(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:l??"",onChange:()=>{}})):d.createElement(RC,null,d.createElement(Mf,{className:"glide-select",inputValue:c,onInputChange:u,menuPlacement:"auto",value:g.find(f=>f.value===l),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:p})=>({...f,fontSize:h.editorFontSize,fontFamily:h.fontFamily,cursor:p?"pointer":void 0,paddingLeft:h.cellHorizontalPadding,paddingRight:h.cellHorizontalPadding,":active":{...f[":active"],color:h.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:h.bgCell,neutral5:h.bgCell,neutral10:h.bgCell,neutral20:h.bgCellMedium,neutral30:h.bgCellMedium,neutral40:h.bgCellMedium,neutral50:h.textLight,neutral60:h.textMedium,neutral70:h.textMedium,neutral80:h.textDark,neutral90:h.textDark,neutral100:h.textDark,primary:h.accentColor,primary75:h.accentColor,primary50:h.accentColor,primary25:h.accentLight}}),menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>d.createElement(EC,null,d.createElement(IC,{className:"click-outside-ignore",...f}))},options:g,onChange:async f=>{f!==null&&(s(f.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:f.value}}))}}))},DC={kind:Z.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+Jn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:OC,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 PC(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 HC={marginRight:8},LC={display:"flex",alignItems:"center",flexGrow:1},AC={kind:Z.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:c,color:u}=t.data,h=o.x+r.cellHorizontalPadding,g=o.y+o.height/2,f=a-i,p=(l-i)/f,m=`${PC(r.baseFontStyle,.9)} ${r.fontFamily}`,w=bs(n,m)/2;n.save();let y=0;s!==void 0&&(n.font=m,y=Dr(c??s,n,m).width+r.cellHorizontalPadding);const v=o.width-r.cellHorizontalPadding*2-y;if(v>=w){const C=n.createLinearGradient(h,g,h+v,g),R=u??r.accentColor;C.addColorStop(0,R),C.addColorStop(p,R),C.addColorStop(p,r.bgBubble),C.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=C,Pu(n,h,g-w/2,v,w,w/2),n.fill(),n.beginPath(),Pu(n,h+.5,g-w/2+.5,v-1,w-1,(w-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+Jn(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:LC},d.createElement("input",{style:HC,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}}},FC=sn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Ll=(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}`)}},zC=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?Ll(n,t.min,i):t.min,l=t.max instanceof Date?Ll(n,t.max,i):t.max,s=Ll(n,t.date,i);return e.value.readonly?kt.createElement(eo,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):kt.createElement(FC,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:a,max:l,step:o,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-i)}})}})},_C={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return vs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:zC}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}};var $C=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],ed=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},Al={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(o){return ed(e,o,r)})||n.some(function(o){return ed(e,o,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function VC(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?Al.formatCreateLabel:i,l=e.isValidNewOption,s=l===void 0?Al.isValidNewOption:l,c=e.getNewOptionData,u=c===void 0?Al.getNewOptionData:c,h=e.onCreateOption,g=e.options,f=g===void 0?[]:g,p=e.onChange,m=ur(e,$C),w=m.getOptionValue,y=w===void 0?vf:w,v=m.getOptionLabel,C=v===void 0?mf:v,R=m.inputValue,E=m.isLoading,M=m.isMulti,H=m.value,S=m.name,x=d.useMemo(function(){return s(R,Ea(H),f,{getOptionValue:y,getOptionLabel:C})?u(R,a(R)):void 0},[a,u,C,y,R,s,f,H]),L=d.useMemo(function(){return(n||!E)&&x?o==="first"?[x].concat(To(f)):[].concat(To(f),[x]):f},[n,o,E,x,f]),T=d.useCallback(function(I,O){if(O.action!=="select-option")return p(I,O);var D=Array.isArray(I)?I:[I];if(D[D.length-1]===x){if(h)h(R);else{var k=u(R,R),Q={action:"create-option",name:S,option:k};p(ui(M,[].concat(To(Ea(H)),[k]),k),Q)}return}p(I,O)},[u,R,M,S,x,h,p,H]);return Le(Le({},m),{},{options:L,onChange:T})}var BC=d.forwardRef(function(e,t){var n=Uh(e),r=VC(n);return d.createElement(Xs,Ve({ref:t},r))}),NC=BC;const qs="__value",WC=new RegExp(`^${qs}\\d+__`),jC=sn("div")({name:"Wrap",class:"gdg-w1i61rz",propsAsIs:!1}),GC=sn("div")({name:"PortalWrap",class:"gdg-phbadu4",propsAsIs:!1}),ha=e=>e.map(t=>typeof t=="string"||t===null||t===void 0?{value:t,label:t??"",color:void 0}:{value:t.value,label:t.label??t.value??"",color:t.color??void 0}),If=(e,t,n)=>e==null?[]:e.map((r,o)=>{const i=n?`${qs}${o}__`:"",a=t.find(l=>l.value===r);return a?{...a,value:`${i}${a.value}`}:{value:`${i}${r}`,label:r}}),UC=e=>{const{Menu:t}=Gs,{children:n,...r}=e;return d.createElement(t,{...r},n)},XC=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:o,portalElementRef:i}=e,{options:a,values:l,allowCreation:s,allowDuplicates:c}=t.data,u=sh(),[h,g]=d.useState(l),[f,p]=d.useState(!0),[m,w]=d.useState(n??""),y=d.useMemo(()=>ha(a??[]),[a]),v=s&&c&&y.length===0,C=d.useCallback(S=>{f&&S.stopPropagation()},[f]),R={control:(S,x)=>({...S,border:0,boxShadow:"none",backgroundColor:u.bgCell,pointerEvents:x.isDisabled?"auto":S.pointerEvents,cursor:x.isDisabled?"default":S.cursor}),valueContainer:S=>({...S,flexWrap:S.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:S=>({...S,backgroundColor:u.bgCell}),option:(S,x)=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark,...x.isFocused?{backgroundColor:u.accentLight,cursor:"pointer"}:{},":active":{...S[":active"],color:u.accentFg,backgroundColor:u.accentColor}}),input:(S,{isDisabled:x})=>x?{display:"none"}:{...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textDark},placeholder:S=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),noOptionsMessage:S=>({...S,fontSize:u.editorFontSize,fontFamily:u.fontFamily,color:u.textLight}),clearIndicator:S=>({...S,color:u.textLight,":hover":{color:u.textDark,cursor:"pointer"}}),multiValue:(S,{data:x})=>({...S,backgroundColor:x.color??u.bgBubble,borderRadius:`${u.roundingRadius??u.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(S,{data:x,isDisabled:L})=>({...S,paddingRight:L?u.bubblePadding:0,paddingLeft:u.bubblePadding,paddingTop:0,paddingBottom:0,color:x.color?Bl(x.color)>.5?"black":"white":u.textBubble,fontSize:u.editorFontSize,fontFamily:u.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:u.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(S,{data:x,isDisabled:L,isFocused:T})=>L?{display:"none"}:{...S,color:x.color?Bl(x.color)>.5?"black":"white":u.textBubble,backgroundColor:void 0,borderRadius:T?`${u.roundingRadius??u.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}},E=d.useCallback(S=>{const x=S.map(L=>c&&L.startsWith(qs)?L.replace(new RegExp(WC),""):L);g(x),r({...t,data:{...t.data,values:x}})},[t,r,c]),M=S=>{switch(S.key){case"Enter":case"Tab":if(!m){o(t,[0,1]);return}c&&s&&(w(""),E([...h??[],m]),p(!1),S.preventDefault())}},H=s?NC:Mf;return d.createElement(jC,{onKeyDown:C,"data-testid":"multi-select-cell"},d.createElement(H,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:m,onInputChange:w,options:y,placeholder:t.readonly?"":s?"Add...":void 0,noOptionsMessage:S=>s&&c&&S.inputValue?`Create "${S.inputValue}"`:void 0,menuIsOpen:t.readonly?!1:f,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1),value:If(h,y,c),onKeyDown:t.readonly?void 0:M,menuPlacement:"auto",menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:R,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:S=>v?null:d.createElement(GC,null,d.createElement(UC,{className:"click-outside-ignore",...S}))},onChange:async S=>{S!==null&&E(S.map(x=>x.value))}}))},qC={kind:Z.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(a==null)return!0;const s=ha(l??[]),c={x:o.x+r.cellHorizontalPadding,y:o.y+r.cellVerticalPadding,width:o.width-2*r.cellHorizontalPadding,height:o.height-2*r.cellVerticalPadding},u=Math.max(1,Math.floor(c.height/(r.bubbleHeight+r.bubblePadding)));let{x:h}=c,g=1,f=u===1?c.y+(c.height-r.bubbleHeight)/2:c.y+(c.height-u*r.bubbleHeight-(u-1)*r.bubblePadding)/2;for(const p of a){const m=s.find(R=>R.value===p),w=m?.color??(i?r.bgBubbleSelected:r.bgBubble),y=m?.label??p,v=Dr(y,n).width+r.bubblePadding*2,C=r.bubbleHeight/2;if(h!==c.x&&h+v>c.x+c.width&&g<u&&(g++,f+=r.bubbleHeight+r.bubblePadding,h=c.x),n.fillStyle=w,n.beginPath(),Yn(n,h,f,v,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?Bl(w)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(y,h+r.bubblePadding,f+C+Jn(n,r)),h+=v+r.bubbleMargin,h>c.x+c.width+r.cellHorizontalPadding&&g>=u)break}return!0},measure:(e,t,n)=>{const{values:r,options:o}=t.data;if(!r)return n.cellHorizontalPadding*2;const i=If(r,ha(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:XC,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e||!e.trim())return{...t,values:[]};let n=e.split(",").map(r=>r.trim());if(t.allowDuplicates||(n=n.filter((r,o)=>n.indexOf(r)===o)),!t.allowCreation){const r=ha(t.options??[]);n=n.filter(o=>r.find(i=>i.value===o))}if(n.length!==0)return{...t,values:n}}},KC="None";function td(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 ZC=e=>{const{cell:t,theme:n,ctx:r}=e;vs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},KC,t.contentAlign),r.fillStyle=n.textDark};function YC(e){const t=d.useCallback((r,o)=>{const{cell:i,theme:a,ctx:l,rect:s}=r,c=r.col;if(Oo(i))td(l,s,a);else if(Ms(i)&&c<e.length){const u=e[c];["checkbox","line_chart","bar_chart","progress"].includes(u.kind)?o():ZC(r),u.isRequired&&u.isEditable&&td(l,s,a);return}o()},[e]),n=d.useMemo(()=>[Pw,DC,AC,_C,qC,...rw],[]);return{drawCell:t,customRenderers:n}}function QC(){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:Xr(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Xr(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:Xr(e.colors.darkenedBgMix100,.9),bgHeaderHovered:Xr(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(tn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${tn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${tn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Xr(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(tn(e.spacing.sm)),cellVerticalPadding:Math.round(tn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:Gp(e.colors.secondaryBg,.1),bubbleHeight:Math.round(tn("1.25rem")),bubblePadding:Math.round(tn(e.spacing.sm)),bubbleMargin:Math.round(tn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(tn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(tn("25rem")),minColumnWidth:Math.round(tn("3.125rem")),maxColumnWidth:Math.round(tn("62.5rem")),maxColumnAutoWidth:Math.round(tn("31.25rem")),defaultRowHeight:Math.round(tn("2.1875rem")),defaultHeaderHeight:Math.round(tn("2.1875rem")),bgRowHovered:jp(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:t}},[e])}const JC=rs.getLogger("useDataEditor");function ek(e,t,n,r,o,i,a,l,s){const c=d.useCallback(([m,w],y)=>{const v=e[m];if(!v.isEditable)return;const C=v.indexNumber,R=n.current.getOriginalRowIndex(o(w)),E=r([m,w]),M=v.getCellValue(E),H=v.getCellValue(y);if(!Oo(E)&&H===M)return;const S=v.getCell(H,!0);Oo(S)?JC.warn(`Not applying the cell edit since it causes this error:
196
- ${S.data}`):(n.current.setCell(C,R,{...S,lastUpdated:performance.now()}),l())},[e,n,o,r,l]),u=d.useCallback(()=>{if(t)return;const m=new Map;e.forEach(w=>{m.set(w.indexNumber,w.getCell(w.defaultValue))}),n.current.addRow(m),a()},[e,n,t,a]),h=d.useCallback(()=>{t||(u(),l())},[u,l,t]),g=d.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const w=m.rows.toArray().map(y=>n.current.getOriginalRowIndex(o(y)));return n.current.deleteRows(w),a(),s(),l(),!1}if(m.current?.range){const w=[],y=m.current.range;for(let v=y.y;v<y.y+y.height;v++)for(let C=y.x;C<y.x+y.width;C++){const R=e[C];R.isEditable&&!R.isRequired&&(w.push({cell:[C,v]}),c([C,v],R.getCell(null)))}return w.length>0&&(l(),i(w)),!1}return!0},[e,n,t,i,o,l,c,s,a]),f=d.useCallback((m,w)=>{const[y,v]=m,C=[];for(let R=0;R<w.length;R++){const E=w[R];if(R+v>=n.current.getNumRows()){if(t)break;u()}for(let M=0;M<E.length;M++){const H=E[M],S=R+v,x=M+y;if(x>=e.length)break;const L=e[x];if(L.isEditable){const T=L.getCell(H,!0);if(rt(T)&&!Oo(T)){const I=L.indexNumber,O=n.current.getOriginalRowIndex(o(S)),D=L.getCellValue(r([x,S]));L.getCellValue(T)!==D&&(n.current.setCell(I,O,{...T,lastUpdated:performance.now()}),C.push({cell:[x,S]}))}}}C.length>0&&(l(),i(C))}return!1},[e,n,t,o,r,u,l,i]),p=d.useCallback((m,w)=>{const y=m[0];if(y>=e.length)return!0;const v=e[y];if(v.validateInput){const C=v.validateInput(v.getCellValue(w));return C===!0||C===!1?C:v.getCell(C)}return!0},[e]);return{onCellEdited:c,onPaste:f,onRowAppended:h,onDelete:g,validateCell:p}}const Rf=",",di='"',tk='"',Ef=`
197
- `,nk="\uFEFF",rk=new RegExp(`[${[Rf,di,Ef].join("")}]`),nd=rs.getLogger("useDataExporter");function rd(e){return e.map(t=>ok(t)).join(Rf)+Ef}function ok(e){if(De(e))return"";const t=ot(e);return rk.test(t)?`${di}${t.replace(new RegExp(di,"g"),tk+di)}${di}`:t}async function od(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(nk));const i=n.map(a=>a.name);await e.write(o.encode(rd(i)));for(let a=0;a<r;a++){const l=[];n.forEach((s,c,u)=>{l.push(s.getCellValue(t([c,a])))}),await e.write(o.encode(rd(l)))}await e.close()}function ik(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 ns(()=>import("./es6--XPcqeHG-DdkxL8eW.js"),__vite__mapDeps([14,1,2])).then(a=>a.a)).showSaveFilePicker({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await od(i,e,t,n)}catch(i){if(i instanceof Error&&i.name==="AbortError")return;try{nd.warn("Failed to export data as CSV with FileSystem API, trying fallback method",i);let a="";const l=new WritableStream({write:h=>{a+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await od(l.getWriter(),e,t,n);const s=new Blob([a],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(s),u=Ng({enforceDownloadInNewTab:r,url:c,filename:o});u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c)}catch(a){nd.error("Failed to export data as CSV",a)}}},[t,n,e,r])}}function ak(e,t,n,r){return{getCellContent:d.useCallback(([o,i])=>{if(o>t.length-1)return Mt("Column index out of bounds","This error should never happen. Please report this bug.");if(i>n-1)return Mt("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),c=r.current.isAddedRow(s);if(a.isEditable||c){const g=r.current.getCell(l,s);if(rt(g))return{...a.getCell(a.getCellValue(g),!1),lastUpdated:g.lastUpdated};if(c)return Mt("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 u=e.getCell(s,l),h=Up(e,s,l);return fw(a,u,h,e.styler?.cssStyles)}catch(a){return Mt("Error during cell creation",`This error should never happen. Please report this bug.
198
- Error: ${a}`)}},[t,n,e,r])}}function lk(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 sk(e,t,n,r,o){const[i,a]=d.useState({columns:Ye.empty(),rows:Ye.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(nn.SelectionMode.SINGLE_ROW)),s=l&&e.selectionMode.includes(nn.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(nn.SelectionMode.MULTI_COLUMN)),u=c&&e.selectionMode.includes(nn.SelectionMode.MULTI_COLUMN),h=!t&&!n&&(e.selectionMode.includes(nn.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(nn.SelectionMode.MULTI_CELL)),g=h&&e.selectionMode.includes(nn.SelectionMode.MULTI_CELL),f=i.rows.length>0,p=i.columns.length>0,m=i.current!==void 0,w=d.useCallback(v=>{const C=!rl(v.rows.toArray(),i.rows.toArray()),R=!rl(v.columns.toArray(),i.columns.toArray()),E=!rl(v.current,i.current),M=l&&C||c&&R||h&&E;let H=v;if(R&&H.columns.length>=0){let S=H.columns;r.forEach((x,L)=>{x.isIndex&&(S=S.remove(L))}),S.length<H.columns.length&&(H={...H,columns:S})}a(H),M&&o(H,h)},[i,l,c,h,o,r]),y=d.useCallback((v=!1,C=!1)=>{const R={columns:C?i.columns:Ye.empty(),rows:v?i.rows:Ye.empty(),current:void 0};a(R),(!v&&l||!C&&c||h)&&o(R,h)},[i,l,c,h,o]);return{gridSelection:i,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:u,isCellSelectionActivated:h,isMultiCellSelectionActivated:g,isRowSelected:f,isColumnSelected:p,isCellSelected:m,clearSelection:y,processSelectionChange:w}}function ck(e,t,n,r,o,i,a,l,s,c,u){const h=e.rowHeight??t.defaultRowHeight,g=r?2:1,f=e.editingMode===nn.EditingMode.DYNAMIC?1:0,p=n+f,m=Iu({numRows:p,rowHeight:h,theme:t,numHeaderRows:g}),w=mw(e,s),y=gw(s,u),v=y?Math.max(1,Math.min(n,3)):1,C=Iu({numRows:v,rowHeight:h,theme:t});let R=Math.max(m,C),E=Math.min(R,t.defaultTableHeight);y&&c&&c>0?R=Math.max(c,R):w&&(E=Math.max(w,C),R=Math.max(E,R)),i&&(E=Math.min(E,i),R=Math.min(R,i),w||(E=R));const M=t.minColumnWidth+2*t.tableBorderWidth,H=Math.max(o,M);let S,x=H;const L=Wh(e,l),T=jh(e,l),I=pw(l);L?S=H:T?(S=Math.min(Math.max(T,M),H),x=Math.min(Math.max(T,x),H)):I&&(S=void 0);const[O,D]=d.useState({width:S||"100%",height:y?"100%":E});return d.useLayoutEffect(()=>{L&&O.width==="100%"&&D(k=>({...k,width:H}))},[H]),d.useLayoutEffect(()=>{D(k=>({...k,width:S||"100%"}))},[S]),d.useLayoutEffect(()=>{D(k=>({...k,height:y?"100%":E}))},[E,n,c,y,u]),d.useLayoutEffect(()=>{if(a){const k=L||rt(T)&&T>0;D({width:k?x:"100%",height:R})}else D({width:S||"100%",height:E})},[a]),{minHeight:C,maxHeight:R,minWidth:M,maxWidth:x,rowHeight:h,resizableSize:O,setResizableSize:D}}const uk=600,dk="⚠️ Please fill out this cell.";function hk(e,t,n=[]){const[r,o]=d.useState(),i=d.useRef(null),a=d.useCallback(s=>{if(clearTimeout(i.current),i.current=0,o(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const c=s.location[0],u=s.location[1];let h;if(c<0||c>=e.length||n.includes(u))return;const g=e[c];if(s.kind==="header"&&rt(g))h=g.help;else if(s.kind==="cell"){const f=t([c,u]);Oo(f)?h=f.errorDetails:g.isRequired&&g.isEditable&&Ms(f)?h=dk:$1(f)&&(h=f.tooltip)}h&&(i.current=setTimeout(()=>{h&&o({content:h,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},uk))}},[e,t,o,i,n]),l=d.useCallback(()=>{o(void 0)},[o]);return{tooltip:r,clearTooltip:l,onItemHovered:a}}const Tf=Qn("div",{target:"e1hnsd047"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}),""),Er=Qn("div",{target:"e1hnsd046"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}}),""),Of=Qn("div",{target:"e1hnsd045"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs}),""),fk=Qn("div",{target:"e1hnsd044"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS}),""),pk=Qn("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.md,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"}),""),gk=Qn("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.md,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"}),""),mk=Qn("span",{target:"e1hnsd041"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"}),""),vk=Qn("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.md,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}}),""),id=[{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:"}],bk={number:id,progress:id,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 wk({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:o,onCloseMenu:i,children:a}){const l=Qr(),{colors:s,fontSizes:c,radii:u,fontWeights:h}=l,g=bk[e]||[];return g.length===0?ve.jsx(ve.Fragment,{}):ve.jsx(Da,{triggerType:pd.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:ve.jsx(Tf,{role:"menu",children:g.map(f=>ve.jsxs(Er,{onClick:()=>{o(f.format),i()},role:"menuitem",children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:f.icon}),f.label]},f.format))}),placement:Pa.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},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",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:Mi(l)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:c.sm,fontWeight:h.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:a})}const yk=d.memo(wk);function xk({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:o,onCloseMenu:i,onSortColumn:a,onHideColumn:l,column:s,onChangeFormat:c,onAutosize:u}){const h=Qr(),[g,f]=d.useState(!1),{colors:p,fontSizes:m,radii:w,fontWeights:y}=h,{isCopied:v,copyToClipboard:C}=Tp();d.useEffect(()=>{function M(H){H.preventDefault()}return document.addEventListener("wheel",M,{passive:!1}),document.addEventListener("touchmove",M,{passive:!1}),()=>{document.removeEventListener("wheel",M),document.removeEventListener("touchmove",M)}},[]);const R=d.useCallback(()=>{i()},[i]),E=d.useCallback(()=>{C(s.title)},[s.title,C]);return ve.jsx(Da,{autoFocus:!0,"aria-label":"Dataframe column menu",content:ve.jsxs(Tf,{children:[ve.jsxs(fk,{children:[ve.jsx(pk,{title:s.kind,children:ve.jsx(qn,{iconValue:s.typeIcon||":material/notes:",size:"base",color:"inherit"})}),ve.jsxs(gk,{title:s.title,children:[ve.jsx(mk,{children:s.title}),ve.jsx(vk,{onClick:E,title:"Copy column name","aria-label":"Copy column name",children:ve.jsx(qn,{iconValue:v?":material/check:":":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),a&&ve.jsxs(ve.Fragment,{children:[ve.jsxs(Er,{onClick:()=>{a("asc"),R()},role:"menuitem",children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),ve.jsxs(Er,{onClick:()=>{a("desc"),R()},role:"menuitem",children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),ve.jsx(Of,{})]}),c&&ve.jsx(yk,{columnKind:s.kind,isOpen:g,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onChangeFormat:c,onCloseMenu:R,children:ve.jsxs(Er,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),isActive:g,hasSubmenu:!0,children:[ve.jsxs("div",{children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),u&&ve.jsxs(Er,{onClick:()=>{u(),R()},children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&ve.jsxs(Er,{onClick:()=>{o(),R()},children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&ve.jsxs(Er,{onClick:()=>{r(),R()},children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),l&&ve.jsxs(Er,{onClick:()=>{l(),R()},children:[ve.jsx(qn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Pa.bottomRight,accessibilityType:gd.menu,showArrow:!1,popoverMargin:tn("0.375rem"),onClickOutside:g?void 0:R,onEsc:R,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${h.sizes.borderWidth} solid ${h.colors.borderColor}`,backgroundColor:Mi(h)?p.bgColor:p.secondaryBg,color:p.bodyText,fontSize:m.sm,fontWeight:y.normal,borderTopLeftRadius:w.default,borderTopRightRadius:w.default,borderBottomLeftRadius:w.default,borderBottomRightRadius:w.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:ve.jsx("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const Ck=d.memo(xk),kk="(index)";function Fl(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const ad=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const o=Qr();return ve.jsx($g,{isIndeterminate:n,checked:t,onChange:i=>{r(i.target.checked)},"aria-label":e,checkmarkType:Bg.default,labelPlacement:Vg.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.fadedText40;return{outline:0,width:o.sizes.checkbox,height:o.sizes.checkbox,marginTop:o.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&(a||l)?`0 0 0 0.2rem ${Xr(o.colors.primary,.5)}`:"",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})},Sk=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:o,children:i,isOpen:a,onClose:l})=>{const s=Qr(),c=f=>!(f.isHidden===!0||Fl(f,t)),u=e.every(c),h=e.some(c)&&!u,g=f=>{e.forEach(p=>{const m=Fl(p,t);f?(o(p.id),m&&n(w=>[...w,p.id])):r(p.id)})};return ve.jsx(Da,{triggerType:pd.click,placement:Pa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>ve.jsxs("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto"},children:[ve.jsx(ad,{label:"Select all",isIndeterminate:h,initialValue:u,onChange:f=>{g(f)}}),ve.jsx(Of,{}),ve.jsx("div",{children:e.map(f=>{const p=Fl(f,t);return ve.jsx(ad,{label:!f.title&&f.isIndex?kk:f.title,initialValue:!(f.isHidden===!0||p),onChange:m=>{m?(o(f.id),p&&n(w=>[...w,f.id])):r(f.id)}},f.id)})})]}),isOpen:a,onClickOutside:l,onClick:()=>a?l():void 0,onEsc:l,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:s.radii.default,borderTopRightRadius:s.radii.default,borderBottomLeftRadius:s.radii.default,borderBottomRightRadius:s.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:Mi(s)?s.colors.bgColor:s.colors.secondaryBg,color:s.colors.bodyText,fontSize:s.fontSizes.sm,fontWeight:s.fontWeights.normal,minWidth:s.sizes.minMenuWidth,maxWidth:`calc(${s.sizes.minMenuWidth} * 2)`,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:ve.jsx("div",{children:i})})},Mk=d.memo(Sk),ld=Qn("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":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:e.spacing.sm,right:e.spacing.sm,padding:e.spacing.sm,borderRadius:e.radii.default,"& .gdg-search-status":{paddingTop:e.spacing.twoXS,fontSize:e.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:e.iconSizes.xl,height:e.iconSizes.xl,"& .button-icon":{width:e.iconSizes.base,height:e.iconSizes.base}}}}),"");function Ik({top:e,left:t,content:n,clearTooltip:r}){const[o,i]=d.useState(!0),a=Qr(),{colors:l,fontSizes:s,radii:c,fontWeights:u}=a,h=d.useCallback(()=>{i(!1),r()},[r,i]);return ve.jsx(Da,{content:ve.jsx(Op,{"data-testid":"stDataFrameTooltipContent",children:ve.jsx(Dp,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Pa.top,accessibilityType:gd.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:h,onEsc:h,overrides:{Body:{style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:Mi(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:u.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:o,children:ve.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const Rk=d.memo(Ik),sd=150,Ek=15e4,Tk="0.5rem";function Ok({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:o,fragmentId:i,customToolbarActions:a,widthConfig:l,heightConfig:s}){const{expanded:c,expand:u,collapse:h,width:g,height:f}=uc(Ag),{isInHorizontalLayout:p,isInRoot:m}=uc(Pp),w=d.useRef(null),y=d.useRef(null),v=Hp(),{height:C,elementRef:R}=Lp(),E=QC(),{getRowThemeOverride:M,onItemHovered:H}=lk(E),{libConfig:{enforceDownloadInNewTab:S=!1}}=d.useContext(Ap),[x,L]=d.useState(!0),[T,I]=d.useState(!1),[O,D]=d.useState(!1),[k,Q]=d.useState(!1),[N,Y]=d.useState(),[ae,ee]=d.useState(!1),K=d.useCallback(()=>ee(xe=>!xe),[]),pe=d.useCallback(()=>ee(!1),[]),oe=d.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);De(e.editingMode)&&(e.editingMode=nn.EditingMode.READ_ONLY);const{READ_ONLY:de,DYNAMIC:he}=nn.EditingMode,se=t.dimensions,z=Math.max(0,se.numDataRows),P=z===0&&!(e.editingMode===he&&se.numDataColumns>0),G=z>Ek,le=!G&&!P&&e.editingMode!==he,ce=!P&&e.editingMode===he&&!n,we=d.useRef(new ra(z)),[ge,Qe]=d.useState(we.current.getNumRows());d.useEffect(()=>{we.current=new ra(z),Qe(we.current.getNumRows())},[z]);const Se=d.useCallback(()=>{we.current=new ra(z),Qe(we.current.getNumRows())},[z]),[Dt,bt]=d.useState(e.columnOrder);d.useEffect(()=>{bt(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:Te,allColumns:re,setColumnConfigMapping:me}=ww(e,t,n,Dt,l);d.useEffect(()=>{if(e.editingMode===de||!r)return;const xe=r.getStringValue({id:e.id,formId:e.formId});xe&&(we.current.fromJson(xe,Te),Qe(we.current.getNumRows()))},[]);const{getCellContent:ye}=ak(t,Te,ge,we),{columns:ne,sortColumn:be,getOriginalIndex:Oe,getCellContent:Pe}=Tw(z,Te,ye),it=d.useCallback((xe,mt)=>{if(!r)return;const Ft={selection:{rows:[],columns:[],cells:[]}};if(Ft.selection.rows=xe.rows.toArray().map(Yt=>Oe(Yt)),Ft.selection.columns=xe.columns.toArray().map(Yt=>qr(ne[Yt])),mt&&xe.current){const{cell:Yt,range:jt}=xe.current;if(jt)for(let fn=jt.y;fn<jt.y+jt.height;fn++)for(let $n=jt.x;$n<jt.x+jt.width;$n++)ne[$n].isIndex||Ft.selection.cells.push([Oe(fn),qr(ne[$n])]);else if(Yt){const[fn,$n]=Yt;ne[fn].isIndex||Ft.selection.cells.push([Oe($n),qr(ne[fn])])}}const _n=JSON.stringify(Ft),Tn=r.getStringValue({id:e.id,formId:e.formId});(Tn===void 0||Tn!==_n)&&r.setStringValue({id:e.id,formId:e.formId},_n,{fromUi:!0},i)},[ne,e.id,e.formId,r,i,Oe]),{debouncedCallback:Ae}=bu(it,sd),{gridSelection:Ze,isRowSelectionActivated:Ie,isMultiRowSelectionActivated:Me,isColumnSelectionActivated:ze,isMultiColumnSelectionActivated:ct,isCellSelectionActivated:Je,isMultiCellSelectionActivated:We,isRowSelected:ht,isColumnSelected:Wt,isCellSelected:Et,clearSelection:ut,processSelectionChange:qt}=sk(e,P,n,ne,Ae);d.useEffect(()=>{Je||ut(!0,!0)},[c]);const Kt=d.useCallback(xe=>{y.current?.updateCells(xe)},[]);d.useEffect(()=>{if(!Ie&&!ze&&!Je||!r)return;const xe=r.getStringValue({id:e.id,formId:e.formId});if(xe){const mt=ne.map(jt=>qr(jt)),Ft=JSON.parse(xe);let _n=Ye.empty(),Tn=Ye.empty(),Yt;if(Ft.selection?.rows?.forEach(jt=>{_n=_n.add(jt)}),Ft.selection?.columns?.forEach(jt=>{Tn=Tn.add(mt.indexOf(jt))}),Je&&!We){const[jt,fn]=Ft.selection?.cells?.[0]??[];jt!==void 0&&fn!==void 0&&(Yt=[mt.indexOf(fn),jt])}if(_n.length>0||Tn.length>0||Yt!==void 0){const jt={rows:_n,columns:Tn,current:Yt?{cell:Yt,range:{x:Yt[0],y:Yt[1],width:1,height:1},rangeStack:[]}:void 0};qt(jt)}}},[]);const On=d.useCallback(()=>{ge!==we.current.getNumRows()&&Qe(we.current.getNumRows())},[ge]),St=d.useCallback(()=>{if(!r)return;const xe=we.current.toJson(ne);let mt=r.getStringValue({id:e.id,formId:e.formId});mt===void 0&&(mt=new ra(0).toJson([])),xe!==mt&&r.setStringValue({id:e.id,formId:e.formId},xe,{fromUi:!0},i)},[ne,e.id,e.formId,r,i]),{debouncedCallback:ft}=bu(St,sd),{exportToCsv:Dn}=ik(Pe,ne,ge,S),{onCellEdited:wt,onPaste:cn,onRowAppended:pn,onDelete:Re,validateCell:dt}=ek(ne,e.editingMode!==he,we,Pe,Oe,Kt,On,ft,ut),At=d.useMemo(()=>P?[0]:ce?[ge]:[],[P,ce,ge]),{tooltip:dn,clearTooltip:$t,onItemHovered:rn}=hk(ne,Pe,At),{drawCell:Pn,customRenderers:on}=YC(ne),{provideEditor:Zt}=Dw(),Be=d.useCallback(xe=>({...xe,hasMenu:!P}),[P]),yt=d.useMemo(()=>ne.map(xe=>Be(Zl(xe))),[ne,Be]),{columns:In,onColumnResize:Pt}=kw(yt),pt=t.dimensions.numHeaderRows>1,{minHeight:xn,maxHeight:er,minWidth:tr,maxWidth:B,rowHeight:_e,resizableSize:Ne,setResizableSize:Tt}=ck(e,E,ge,pt,g||0,f,c,l,s,C,m),an=d.useCallback(([xe,mt])=>({...V1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:E.glideTheme.textLight},span:[0,Math.max(ne.length-1,0)]}),[ne,E.glideTheme.textLight]),hn=d.useCallback(()=>{Se(),ut()},[Se,ut]);zg({element:e,widgetMgr:r,onFormCleared:hn});const{pinColumn:Rn,unpinColumn:gn,freezeColumns:Bt}=xw(ne,P,g||0,E.minColumnWidth,ut,me),{changeColumnFormat:En}=yw(me),{hideColumn:Cn,showColumn:Lo}=Ow(ut,me),{onColumnMoved:no}=Cw(ne,Bt,Rn,gn,bt);d.useEffect(()=>{let xe;const mt=requestAnimationFrame(()=>{xe=setTimeout(()=>{if(R.current&&y.current){const Ft=R.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Ft&&(D(Ft.height>R.current.clientHeight),Q(Ft.width>R.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(mt),xe&&clearTimeout(xe)}},[Ne,ge,In,R]),d.useEffect(()=>{re.length==ne.length&&ee(!1)},[re.length,ne.length]);const Hr=!!(p||l?.useContent&&!m);return ve.jsxs(ld,{className:"stDataFrame","data-testid":"stDataFrame",ref:R,isInHorizontalLayout:p,minHeight:xn,disableResize:Hr,onPointerDown:xe=>{if(R.current){const mt=R.current.getBoundingClientRect(),Ft=(v||Math.round(tn(Tk)))+1;k&&mt.height-Ft<xe.clientY-mt.top&&xe.stopPropagation(),O&&mt.width-Ft<xe.clientX-mt.left&&xe.stopPropagation()}},onBlur:xe=>{!x&&!oe&&!xe.currentTarget.contains(xe.relatedTarget)&&!Je&&ut(!0,!0)},children:[ve.jsxs(Fg,{isFullScreen:c,disableFullscreenMode:o,locked:ht&&!Ie||Et||oe&&x||ae,onExpand:u,onCollapse:h,target:ld,children:[a?.map(xe=>xe),(Ie&&ht||ze&&Wt||Je&&Et)&&ve.jsx(xo,{label:"Clear selection",icon:Wg,onClick:()=>{ut(),$t()}}),ce&&ht&&ve.jsx(xo,{label:"Delete row(s)",icon:qg,onClick:()=>{Re&&(Re(Ze),$t())}}),ce&&!ht&&ve.jsx(xo,{label:"Add row",icon:Sd,onClick:()=>{pn&&(L(!0),pn(),$t(),y.current?.scrollTo(0,ge,"vertical"))}}),!P&&re.length>ne.length&&ve.jsx(Mk,{columns:re,columnOrder:Dt,setColumnOrder:bt,hideColumn:Cn,showColumn:Lo,isOpen:ae,onClose:pe,children:ve.jsx(xo,{label:"Show/hide columns",icon:Id,onClick:K})}),!G&&!P&&ve.jsx(xo,{label:"Download as CSV",icon:Kg,onClick:Dn}),!P&&ve.jsx(xo,{label:"Search",icon:Md,onClick:()=>{T?I(!1):(L(!0),I(!0)),$t()}})]}),ve.jsx(Fp,{"data-testid":"stDataFrameResizable",ref:w,defaultSize:Ne,style:{border:`${E.tableBorderWidth}px solid ${E.glideTheme.borderColor}`,borderRadius:`${E.tableBorderRadius}`},minHeight:xn,maxHeight:er,minWidth:tr,maxWidth:Hr?void 0:B,size:Ne,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!Hr,bottomLeft:!1,topLeft:!1},grid:[1,_e],snapGap:_e/3,onResizeStop:(xe,mt,Ft,_n)=>{if(w.current){const Tn=2*E.tableBorderWidth;Tt({width:w.current.size.width,height:er-w.current.size.height===Tn?w.current.size.height+Tn:w.current.size.height})}},children:ve.jsx(P1,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:y,columns:In,rows:P?1:ge,minColumnWidth:E.minColumnWidth,maxColumnWidth:E.maxColumnWidth,maxColumnAutoWidth:E.maxColumnAutoWidth,rowHeight:_e,headerHeight:E.defaultHeaderHeight,getCellContent:P?an:Pe,onColumnResize:oe?void 0:Pt,resizeIndicator:"header",freezeColumns:Bt,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:oe?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:ze?void 0:no,onItemHovered:xe=>{H?.(xe),rn?.(xe)},keybindings:{downFill:!0,...Je||G?{selectAll:!1}:{}},onKeyDown:xe=>{(xe.ctrlKey||xe.metaKey)&&xe.key==="f"&&(I(mt=>!mt),xe.stopPropagation(),xe.preventDefault())},showSearch:T,searchResults:T?void 0:[],onSearchClose:()=>{I(!1),$t()},onHeaderClicked:(xe,mt)=>{!le||ze||(T&&I(!1),Ie&&ht?ut():ut(!0,!0),be(xe,"auto"))},gridSelection:Ze,onGridSelectionChange:xe=>{(x||oe)&&(qt(xe),dn!==void 0&&$t(),Y(void 0),ee(!1))},theme:E.glideTheme,getRowThemeOverride:M,onMouseMove:xe=>{xe.kind==="out-of-bounds"&&x?L(!1):xe.kind!=="out-of-bounds"&&!x&&L(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:k?-v:void 0,paddingRight:O?-v:void 0},provideEditor:Zt,drawCell:Pn,customRenderers:on,imageEditorOverride:nw,headerIcons:E.headerIcons,validateCell:dt,onHeaderMenuClick:(xe,mt)=>{ae||Y({columnIdx:xe,headerBounds:mt})},onPaste:!1,...Ie&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:E.glideTheme.bgHeader,bgCellMedium:E.glideTheme.bgHeader,textMedium:E.glideTheme.textLight}},rowSelectionMode:Me?"multi":"auto",rowSelect:n?"none":Me?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...ze&&{columnSelect:n?"none":ct?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:ct?"multi":"auto",rangeSelectionBlending:"additive"},...Je&&{rangeSelect:We?"rect":"cell",rangeSelectionBlending:"additive"},...!P&&e.editingMode!==de&&!n&&{fillHandle:!oe,onCellEdited:wt,onPaste:cn,onDelete:Re},...!P&&e.editingMode===he&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:E.glideTheme.bgHeader,bgCellMedium:E.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:pn,onHeaderClicked:void 0}})}),dn?.content&&ve.jsx(Rk,{top:dn.top,left:dn.left,content:dn.content,clearTooltip:$t}),N&&md.createPortal(ve.jsx(Ck,{top:N.headerBounds.y+N.headerBounds.height,left:N.headerBounds.x+N.headerBounds.width,column:Te[N.columnIdx],onCloseMenu:()=>Y(void 0),onSortColumn:le?xe=>{T&&I(!1),ut(!(Ie&&ht),!0),be(N.columnIdx,xe,!0)}:void 0,isColumnPinned:Te[N.columnIdx].isPinned,onUnpinColumn:()=>{gn(Te[N.columnIdx].id)},onPinColumn:()=>{Rn(Te[N.columnIdx].id)},onHideColumn:()=>{Cn(Te[N.columnIdx].id)},onChangeFormat:xe=>{En(Te[N.columnIdx].id,xe),setTimeout(()=>{y.current?.remeasureColumns(Ye.fromSingleSelection(N.columnIdx))},100)},onAutosize:()=>{y.current?.remeasureColumns(Ye.fromSingleSelection(N.columnIdx))}}),document.querySelector("#portal"))]})}const Dk=Lg(Ok),Df=d.memo(Dk),Pk=({data:e,height:t,width:n,customToolbarActions:r})=>ve.jsx(Df,{element:new nn({useContainerWidth:!0,editingMode:nn.EditingMode.READ_ONLY,disabled:!0,data:void 0,styler:null,width:void 0,height:t??null,id:"",columns:"",formId:"",columnOrder:[],selectionMode:[]}),data:e,widgetMgr:void 0,disabled:!0,fragmentId:void 0,disableFullscreenMode:!0,customToolbarActions:r,widthConfig:n??new cc.WidthConfig({useStretch:!0}),heightConfig:t?new cc.HeightConfig({pixelHeight:t}):void 0}),jk=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:Pk,default:Df},Symbol.toStringTag,{value:"Module"}));export{Io as E,lh as M,tm as V,Pk as Y,hb as a,sn as f,jk as i,ko as k,L0 as u};