streamlit 1.49.0__py3-none-any.whl → 1.50.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. streamlit/column_config.py +2 -0
  2. streamlit/commands/navigation.py +3 -1
  3. streamlit/components/v1/custom_component.py +17 -42
  4. streamlit/config.py +306 -0
  5. streamlit/connections/base_connection.py +4 -2
  6. streamlit/dataframe_util.py +3 -2
  7. streamlit/delta_generator.py +2 -3
  8. streamlit/elements/arrow.py +63 -43
  9. streamlit/elements/deck_gl_json_chart.py +1 -0
  10. streamlit/elements/form.py +6 -6
  11. streamlit/elements/graphviz_chart.py +23 -6
  12. streamlit/elements/iframe.py +0 -2
  13. streamlit/elements/image.py +10 -9
  14. streamlit/elements/layouts.py +58 -11
  15. streamlit/elements/lib/built_in_chart_utils.py +95 -29
  16. streamlit/elements/lib/column_config_utils.py +5 -0
  17. streamlit/elements/lib/column_types.py +563 -144
  18. streamlit/elements/lib/dialog.py +1 -0
  19. streamlit/elements/lib/layout_utils.py +4 -4
  20. streamlit/elements/lib/pandas_styler_utils.py +30 -14
  21. streamlit/elements/lib/utils.py +17 -5
  22. streamlit/elements/map.py +1 -3
  23. streamlit/elements/media.py +2 -0
  24. streamlit/elements/metric.py +10 -32
  25. streamlit/elements/plotly_chart.py +17 -9
  26. streamlit/elements/pyplot.py +6 -6
  27. streamlit/elements/vega_charts.py +110 -44
  28. streamlit/elements/widgets/audio_input.py +48 -0
  29. streamlit/elements/widgets/button.py +27 -25
  30. streamlit/elements/widgets/button_group.py +1 -0
  31. streamlit/elements/widgets/camera_input.py +1 -0
  32. streamlit/elements/widgets/chat.py +1 -0
  33. streamlit/elements/widgets/checkbox.py +1 -0
  34. streamlit/elements/widgets/color_picker.py +1 -0
  35. streamlit/elements/widgets/data_editor.py +6 -5
  36. streamlit/elements/widgets/file_uploader.py +1 -0
  37. streamlit/elements/widgets/multiselect.py +10 -0
  38. streamlit/elements/widgets/number_input.py +3 -0
  39. streamlit/elements/widgets/radio.py +1 -0
  40. streamlit/elements/widgets/select_slider.py +1 -0
  41. streamlit/elements/widgets/selectbox.py +4 -0
  42. streamlit/elements/widgets/slider.py +1 -0
  43. streamlit/elements/widgets/text_widgets.py +6 -0
  44. streamlit/elements/widgets/time_widgets.py +9 -0
  45. streamlit/elements/write.py +1 -17
  46. streamlit/git_util.py +65 -43
  47. streamlit/material_icon_names.py +1 -1
  48. streamlit/proto/Arrow_pb2.py +10 -8
  49. streamlit/proto/Arrow_pb2.pyi +31 -2
  50. streamlit/proto/AudioInput_pb2.py +2 -2
  51. streamlit/proto/AudioInput_pb2.pyi +6 -2
  52. streamlit/proto/Block_pb2.py +11 -11
  53. streamlit/proto/Block_pb2.pyi +5 -0
  54. streamlit/proto/NewSession_pb2.py +18 -16
  55. streamlit/proto/NewSession_pb2.pyi +135 -2
  56. streamlit/runtime/app_session.py +18 -5
  57. streamlit/runtime/theme_util.py +148 -0
  58. streamlit/static/index.html +2 -2
  59. streamlit/static/manifest.json +221 -221
  60. streamlit/static/static/css/index.CHEnSPGk.css +1 -0
  61. streamlit/static/static/css/{index.C8X8rNzw.css → index.CIiu7Ygf.css} +1 -1
  62. streamlit/static/static/js/{ErrorOutline.esm.u9XvzxL8.js → ErrorOutline.esm.DUpR0_Ka.js} +1 -1
  63. streamlit/static/static/js/{FileDownload.esm.CaRyZ-b2.js → FileDownload.esm.CN4j9-1w.js} +1 -1
  64. streamlit/static/static/js/{FileHelper.Dk2SwIi3.js → FileHelper.CaIUKG91.js} +1 -1
  65. streamlit/static/static/js/{FormClearHelper.l_UPPvkg.js → FormClearHelper.DTcdrasw.js} +1 -1
  66. streamlit/static/static/js/{Hooks.BxrVEftw.js → Hooks.BRba_Own.js} +1 -1
  67. streamlit/static/static/js/InputInstructions.xnSDuYeQ.js +1 -0
  68. streamlit/static/static/js/{Particles.DkY6FDnc.js → Particles.CElH0XX2.js} +1 -1
  69. streamlit/static/static/js/{ProgressBar.BPtSM82n.js → ProgressBar.DetlP5aY.js} +2 -2
  70. streamlit/static/static/js/Toolbar.C77ar7rq.js +1 -0
  71. streamlit/static/static/js/{base-input.egUI4LjJ.js → base-input.BQft14La.js} +3 -3
  72. streamlit/static/static/js/{checkbox.ButpszcE.js → checkbox.yZOfXCeX.js} +1 -1
  73. streamlit/static/static/js/{createSuper.DYJA5xa6.js → createSuper.Dh9w1cs8.js} +1 -1
  74. streamlit/static/static/js/data-grid-overlay-editor.DcuHuCyW.js +1 -0
  75. streamlit/static/static/js/{downloader.B3TjsSPZ.js → downloader.MeHtkq8r.js} +1 -1
  76. streamlit/static/static/js/{es6.BYSNuG4D.js → es6.VpBPGCnM.js} +2 -2
  77. streamlit/static/static/js/{iframeResizer.contentWindow.CNPHJsF2.js → iframeResizer.contentWindow.yMw_ARIL.js} +1 -1
  78. streamlit/static/static/js/{index.DgpIMUsr.js → index.64ejlaaT.js} +1 -1
  79. streamlit/static/static/js/{index.BBnWuh07.js → index.6xX1278W.js} +90 -91
  80. streamlit/static/static/js/index.B-hiXRzw.js +1 -0
  81. streamlit/static/static/js/{index.DtwkPJs5.js → index.B0H9IXUJ.js} +47 -47
  82. streamlit/static/static/js/{index.0tDq1WXk.js → index.B4cAbHP6.js} +1 -1
  83. streamlit/static/static/js/{index.CFjU0x00.js → index.B4dUQfni.js} +1 -1
  84. streamlit/static/static/js/{index.BrD9sbpx.js → index.BPQo7BKk.js} +1 -1
  85. streamlit/static/static/js/index.Baqa90pe.js +2 -0
  86. streamlit/static/static/js/{index.uInpwWAP.js → index.Bj9JgOEC.js} +1 -1
  87. streamlit/static/static/js/index.BjCwMzj4.js +3 -0
  88. streamlit/static/static/js/{index.C3EXAI-u.js → index.Bm3VbPB5.js} +1 -1
  89. streamlit/static/static/js/{index.DGcW849X.js → index.Bxz2yX3P.js} +1 -1
  90. streamlit/static/static/js/{index.CeXLlclc.js → index.BycLveZ4.js} +1 -1
  91. streamlit/static/static/js/{index.CjQnYKID.js → index.C9BdUqTi.js} +1 -1
  92. streamlit/static/static/js/index.CFMf5_ez.js +197 -0
  93. streamlit/static/static/js/index.CGYqqs6j.js +1 -0
  94. streamlit/static/static/js/{index.CFePF7s4.js → index.CH1tqnSs.js} +1 -1
  95. streamlit/static/static/js/{index.BoJaJReB.js → index.CMItVsFA.js} +1 -1
  96. streamlit/static/static/js/{index.CuEFSQ-o.js → index.CTBk8Vk2.js} +1 -1
  97. streamlit/static/static/js/index.CiAQIz1H.js +7 -0
  98. streamlit/static/static/js/index.Cj7DSzVR.js +73 -0
  99. streamlit/static/static/js/index.Ck8rQ9OL.js +1 -0
  100. streamlit/static/static/js/{index.CqSRo6zQ.js → index.ClELlchS.js} +2 -2
  101. streamlit/static/static/js/{index.DP1rDFP0.js → index.Cnpi3o3E.js} +1 -1
  102. streamlit/static/static/js/{index.Cl_966eE.js → index.Ctn27_AE.js} +1 -1
  103. streamlit/static/static/js/{index.D4jR1m1z.js → index.D2QEXQq_.js} +1 -1
  104. streamlit/static/static/js/index.DH71Ezyj.js +1 -0
  105. streamlit/static/static/js/{index.CfiZGqj3.js → index.DHh-U0dK.js} +2 -2
  106. streamlit/static/static/js/{index.Bp1Of6L8.js → index.DK7hD7_w.js} +1 -1
  107. streamlit/static/static/js/{index.MQLQLR5Z.js → index.DKv_lNO7.js} +1 -1
  108. streamlit/static/static/js/index.DNLrMXgm.js +12 -0
  109. streamlit/static/static/js/index.DW0Grddz.js +1 -0
  110. streamlit/static/static/js/{index.Cb9gN2T2.js → index.Dbe-Q3C-.js} +1 -1
  111. streamlit/static/static/js/index.DcPNYEUo.js +1 -0
  112. streamlit/static/static/js/index.DuxqVQpd.js +1 -0
  113. streamlit/static/static/js/{index.BH79B25f.js → index.FFOzOWzC.js} +1 -1
  114. streamlit/static/static/js/{index.DWedOrkQ.js → index.GRUzrudl.js} +1 -1
  115. streamlit/static/static/js/{input.CbP5ZuQ7.js → input.s6pjQ49A.js} +1 -1
  116. streamlit/static/static/js/{memory.BuacVo2L.js → memory.Cuvsdfrl.js} +1 -1
  117. streamlit/static/static/js/{number-overlay-editor.BZb9zRl_.js → number-overlay-editor.DdgVR5m3.js} +1 -1
  118. streamlit/static/static/js/{possibleConstructorReturn.DSM84rOS.js → possibleConstructorReturn.CqidKeei.js} +1 -1
  119. streamlit/static/static/js/{sandbox.C480llMG.js → sandbox.CCQREcJx.js} +1 -1
  120. streamlit/static/static/js/{timepicker.BunxCVp7.js → timepicker.mkJF97Bb.js} +4 -4
  121. streamlit/static/static/js/{toConsumableArray.B4o8rEx1.js → toConsumableArray.De7I7KVR.js} +1 -1
  122. streamlit/static/static/js/{uniqueId.tii0yosY.js → uniqueId.RI1LJdtz.js} +1 -1
  123. streamlit/static/static/js/{useBasicWidgetState.Bnm4FD6K.js → useBasicWidgetState.CedkNjUW.js} +1 -1
  124. streamlit/static/static/js/{useTextInputAutoExpand.Dgtwc1m0.js → useTextInputAutoExpand.Ca7w8dVs.js} +2 -2
  125. streamlit/static/static/js/{useUpdateUiValue.DjXdMFGw.js → useUpdateUiValue.DeXelfRH.js} +1 -1
  126. streamlit/static/static/js/withFullScreenWrapper.C3561XxJ.js +1 -0
  127. streamlit/static/static/media/MaterialSymbols-Rounded.DeCZgS-4.woff2 +0 -0
  128. streamlit/string_util.py +58 -1
  129. streamlit/web/bootstrap.py +0 -31
  130. streamlit/web/server/routes.py +17 -4
  131. streamlit/web/server/server.py +1 -0
  132. {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/METADATA +1 -1
  133. {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/RECORD +137 -136
  134. streamlit/static/static/css/index.COe1010n.css +0 -1
  135. streamlit/static/static/js/InputInstructions.C254RU9X.js +0 -1
  136. streamlit/static/static/js/Toolbar.BO_3WBaS.js +0 -1
  137. streamlit/static/static/js/data-grid-overlay-editor.C9gQLEnU.js +0 -1
  138. streamlit/static/static/js/index.BDZorv41.js +0 -1
  139. streamlit/static/static/js/index.BeTC4Yl-.js +0 -197
  140. streamlit/static/static/js/index.BnOd05Ko.js +0 -2
  141. streamlit/static/static/js/index.Bpe4-O2W.js +0 -1
  142. streamlit/static/static/js/index.C1qCS-sd.js +0 -1
  143. streamlit/static/static/js/index.C77g9sAQ.js +0 -3
  144. streamlit/static/static/js/index.Ca3y4ztK.js +0 -1
  145. streamlit/static/static/js/index.CbwuUwu4.js +0 -12
  146. streamlit/static/static/js/index.DKb-BAE2.js +0 -1
  147. streamlit/static/static/js/index.DStzYLqM.js +0 -73
  148. streamlit/static/static/js/index.DVKQKDLu.js +0 -1
  149. streamlit/static/static/js/index.DYbRPmVF.js +0 -1
  150. streamlit/static/static/js/index.z992t-BQ.js +0 -7
  151. streamlit/static/static/js/withFullScreenWrapper.0cy2pVf5.js +0 -1
  152. streamlit/static/static/media/MaterialSymbols-Rounded.CBxVaFdk.woff2 +0 -0
  153. {streamlit-1.49.0.data → streamlit-1.50.0.data}/scripts/streamlit.cmd +0 -0
  154. {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/WHEEL +0 -0
  155. {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/entry_points.txt +0 -0
  156. {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,197 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.DcuHuCyW.js","./index.6xX1278W.js","../css/index.CIiu7Ygf.css","./withFullScreenWrapper.C3561XxJ.js","./Toolbar.C77ar7rq.js","./FormClearHelper.DTcdrasw.js","./sprintf.D7DtBTRn.js","./checkbox.yZOfXCeX.js","./createDownloadLinkElement.ZaXNnPK4.js","./toConsumableArray.De7I7KVR.js","./possibleConstructorReturn.CqidKeei.js","./createSuper.Dh9w1cs8.js","./FileDownload.esm.CN4j9-1w.js","./number-overlay-editor.DdgVR5m3.js","./es6.VpBPGCnM.js"])))=>i.map(i=>d[i]);
2
+ import{r as f,E as Wl,_ as He,c7 as Fh,a3 as pr,c8 as _h,a$ as wo,b0 as Ah,c9 as Hh,ca as zh,cb as Nc,cc as Bc,ak as $t,cd as Vh,ce as Wc,cf as $h,cg as Nh,ch as Bh,ci as Wh,cj as Uh,ck as qh,a9 as Ir,bc as Ul,a2 as Xh,cl as Gh,m as Oe,b2 as Uc,o as lt,cm as no,bs as Xr,cn as Yh,c4 as Ya,j as ze,co as jh,cp as Kh,v as Qn,ay as rn,aN as Zh,cq as Ws,cr as Jh,cs as Qh,ct as eg,bv as tg,cu as ng,cv as rg,cw as qc,cx as ig,cy as og,cz as Il,cA as Xc,cB as Gc,cC as ag,cD as lg,cE as sg,cF as ug,cG as cg,cH as dg,cI as fg,cJ as hg,cK as gg,cL as Yc,cM as pg,cN as mg,cO as vg,cP as bg,cQ as wg,aL as yg,aM as Cg,cR as Sg,cS as xg,aK as kg,cT as Mg,cU as Rg,cV as Eg,aJ as Ig,u as Kr,cW as on,x as ql,cX as Tg,bM as ro,cY as ar,cZ as _e,aZ as Dg,a8 as jc,c_ as Kc,$ as Og,c$ as Pg,t as Ci,d0 as Lg,d1 as Fg,aP as ja,F as Zc,bK as Ca,d2 as Jc,h as Sa,e as mn,y as jn,bI as xa,d3 as _g,bL as Qc,d4 as Ag,S as Hg,J as Us,d5 as zg,d6 as Vg,L as $g,d7 as Ng,d8 as qs}from"./index.6xX1278W.js";import{w as Bg,E as Wg}from"./withFullScreenWrapper.C3561XxJ.js";import{T as Ug,a as wi}from"./Toolbar.C77ar7rq.js";import{u as qg}from"./FormClearHelper.DTcdrasw.js";import{s as Xg}from"./sprintf.D7DtBTRn.js";import{L as Gg,a as Yg,S as jg}from"./checkbox.yZOfXCeX.js";import{c as Kg}from"./createDownloadLinkElement.ZaXNnPK4.js";import{_ as fr,a as Ii,C as Zg}from"./toConsumableArray.De7I7KVR.js";import{d as Jg,f as Qg,e as ep}from"./possibleConstructorReturn.CqidKeei.js";import{_ as tp}from"./createSuper.Dh9w1cs8.js";import{D as np,F as rp}from"./FileDownload.esm.CN4j9-1w.js";var ed=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Wl,He({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});ed.displayName="Add";var td=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Wl,He({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});td.displayName="Search";var nd=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Wl,He({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});nd.displayName="Visibility";var Ka,Xs;function ip(){if(Xs)return Ka;Xs=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ka=n,Ka}var Za,Gs;function op(){if(Gs)return Za;Gs=1;var e=ip(),t=Fh();function n(r,i){return r!=null&&t(r,i,e)}return Za=n,Za}var ap=op();const lp=pr(ap);function rd(e="This should not happen"){throw new Error(e)}function Hn(e,t="Assertion failed"){if(!e)return rd(t)}function co(e,t){return rd(t??"Hell froze over")}function sp(e,t){try{return e()}catch{return t}}const Ys=Object.prototype.hasOwnProperty;function Di(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Di(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ys.call(e,n)&&++r&&!Ys.call(t,n)||!(n in t)||!Di(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const oa=null,Xl=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 js;(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"})(js||(js={}));var aa;(function(e){e.Triangle="triangle",e.Dots="dots"})(aa||(aa={}));function zo(e){return"width"in e&&typeof e.width=="number"}async function Ks(e){return typeof e=="object"?e:await e()}function Si(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function Mi(e){return e.kind===Un.Marker||e.kind===Un.NewRow}function xi(e){if(!Si(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:co(e,"A cell was passed with an invalid kind")}}function up(e){return lp(e,"editor")}function Gl(e){return!(e.readonly??!1)}var Un;(function(e){e.NewRow="new-row",e.Marker="marker"})(Un||(Un={}));const la={shape:"square",size:4,offsetX:-2,offsetY:-2,outline:0};function Ja(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let Zs;class Qe{items;constructor(t){this.items=t}static create=t=>new Qe(Ja(t));static empty=()=>Zs??(Zs=new Qe([]));static fromSingleSelection=t=>Qe.empty().add(t);static fromArray=t=>{if(t.length===0)return Qe.empty();const n=t.map(i=>[i,i+1]),r=Ja(n);return new Qe(r)};offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new Qe(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Ja([...this.items,n]);return new Qe(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,l]of n.entries()){const[a,s]=l;if(a<=i&&r<=s){const u=[];a<r&&u.push([a,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new Qe(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,i]=this.items[n];if(t>=r&&t<i)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}}var cp=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Qa=_h(function(e){return cp.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),dp=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,s]=a.split("_");n[s]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Js=dp,fp=e=>e.toUpperCase()===e,hp=e=>t=>e.indexOf(t)===-1,id=(e,t)=>{const n={};return Object.keys(e).filter(hp(t)).forEach(r=>{n[r]=e[r]}),n};function gp(e,t,n){const r=id(t,n);if(!e){const i=typeof Qa=="function"?{default:Qa}:Qa;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var pp=(e,t)=>{};function mp(e){let t="";return n=>{const r=(o,l)=>{const{as:a=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!fp(a[0])):n.propsAsIs,c=gp(u,o,["as","class"]);c.ref=l,c.className=n.atomic?Js(n.class,c.className||s):Js(c.className||s,n.class);const{vars:d}=n;if(d){const g={};for(const m in d){const w=d[m],b=w[0],v=w[1]||"",C=typeof b=="function"?b(o):b;pp(C,n.name),g[`--${m}`]=`${C}${v}`}const h=c.style||{},p=Object.keys(h);p.length>0&&p.forEach(m=>{g[m]=h[m]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const l=id(o,["innerRef"]);return r(l,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var cn=mp;const vp=cn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var el={},Ui={},Vo={},$o={},Qs;function bp(){return Qs||(Qs=1,function(e){(function(t,n){n(e,wo(),Ah())})($o,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=p;var i=l(n),o=l(r);function l(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var E in I)Object.prototype.hasOwnProperty.call(I,E)&&(v[E]=I[E])}return v};function s(v,C){var I={};for(var E in v)C.indexOf(E)>=0||Object.prototype.hasOwnProperty.call(v,E)&&(I[E]=v[E]);return I}function u(v,C){if(!(v instanceof C))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(C,I){for(var E=0;E<I.length;E++){var R=I[E];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(C,R.key,R)}}return function(C,I,E){return I&&v(C.prototype,I),E&&v(C,E),C}}();function d(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 h=!1;function p(v){h=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 h?v:v.capture}function w(v){if("touches"in v){var C=v.touches[0],I=C.pageX,E=C.pageY;return{x:I,y:E}}var R=v.screenX,P=v.screenY;return{x:R,y:P}}var b=function(v){g(C,v);function C(){var I;u(this,C);for(var E=arguments.length,R=Array(E),P=0;P<E;P++)R[P]=arguments[P];var x=d(this,(I=C.__proto__||Object.getPrototypeOf(C)).call.apply(I,[this].concat(R)));return x._handleSwipeStart=x._handleSwipeStart.bind(x),x._handleSwipeMove=x._handleSwipeMove.bind(x),x._handleSwipeEnd=x._handleSwipeEnd.bind(x),x._onMouseDown=x._onMouseDown.bind(x),x._onMouseMove=x._onMouseMove.bind(x),x._onMouseUp=x._onMouseUp.bind(x),x._setSwiperRef=x._setSwiperRef.bind(x),x}return c(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(E){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(E))}},{key:"_onMouseMove",value:function(E){this.mouseDown&&this._handleSwipeMove(E)}},{key:"_onMouseUp",value:function(E){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(E)}},{key:"_handleSwipeStart",value:function(E){var R=w(E),P=R.x,x=R.y;this.moveStart={x:P,y:x},this.props.onSwipeStart(E)}},{key:"_handleSwipeMove",value:function(E){if(this.moveStart){var R=w(E),P=R.x,x=R.y,S=P-this.moveStart.x,F=x-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:S,y:F},E);D&&E.cancelable&&E.preventDefault(),this.movePosition={deltaX:S,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(E){this.props.onSwipeEnd(E);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,E):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,E),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,E):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,E)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(E){this.swiper=E,this.props.innerRef(E)}},{key:"render",value:function(){var E=this.props;E.tagName;var R=E.className,P=E.style,x=E.children;E.allowMouseEvents,E.onSwipeUp,E.onSwipeDown,E.onSwipeLeft,E.onSwipeRight,E.onSwipeStart,E.onSwipeMove,E.onSwipeEnd,E.innerRef,E.tolerance;var S=s(E,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:P},S),x)}}]),C}(n.Component);b.displayName="ReactSwipe",b.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},b.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=b})}($o)),$o}var eu;function od(){return eu||(eu=1,function(e){(function(t,n){n(e,bp())})(Vo,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(Vo)),Vo}var qi={},tu;function ad(){if(tu)return qi;tu=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=void 0;var e=t(Hh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,l){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":l==="horizontal","axis-vertical":l!=="horizontal"})},SLIDER:function(o,l){return(0,e.default)({thumbs:!o,slider:o,animated:!l})},ITEM:function(o,l,a){return(0,e.default)({thumb:!o,slide:o,selected:l,previous:a})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return qi.default=r,qi}var Xi={},Gi={},nu;function wp(){if(nu)return Gi;nu=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Gi.outerWidth=e,Gi}var Yi={},ru;function Yl(){if(ru)return Yi;ru=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,l=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",s="("+l.join(",")+")";return a+s};return Yi.default=e,Yi}var ji={},iu;function ld(){if(iu)return ji;iu=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.default=void 0;var e=function(){return window};return ji.default=e,ji}var ou;function sd(){if(ou)return Xi;ou=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.default=void 0;var e=s(wo()),t=l(ad()),n=wp(),r=l(Yl()),i=l(od()),o=l(ld());function l(x){return x&&x.__esModule?x:{default:x}}function a(){if(typeof WeakMap!="function")return null;var x=new WeakMap;return a=function(){return x},x}function s(x){if(x&&x.__esModule)return x;if(x===null||u(x)!=="object"&&typeof x!="function")return{default:x};var S=a();if(S&&S.has(x))return S.get(x);var F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in x)if(Object.prototype.hasOwnProperty.call(x,M)){var T=D?Object.getOwnPropertyDescriptor(x,M):null;T&&(T.get||T.set)?Object.defineProperty(F,M,T):F[M]=x[M]}return F.default=x,S&&S.set(x,F),F}function u(x){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(x)}function c(){return c=Object.assign||function(x){for(var S=1;S<arguments.length;S++){var F=arguments[S];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(x[D]=F[D])}return x},c.apply(this,arguments)}function d(x,S){if(!(x instanceof S))throw new TypeError("Cannot call a class as a function")}function g(x,S){for(var F=0;F<S.length;F++){var D=S[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(x,D.key,D)}}function h(x,S,F){return S&&g(x.prototype,S),x}function p(x,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(S&&S.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),S&&m(x,S)}function m(x,S){return m=Object.setPrototypeOf||function(D,M){return D.__proto__=M,D},m(x,S)}function w(x){var S=C();return function(){var D=I(x),M;if(S){var T=I(this).constructor;M=Reflect.construct(D,arguments,T)}else M=D.apply(this,arguments);return b(this,M)}}function b(x,S){return S&&(u(S)==="object"||typeof S=="function")?S:v(x)}function v(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}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 I(x){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},I(x)}function E(x,S,F){return S in x?Object.defineProperty(x,S,{value:F,enumerable:!0,configurable:!0,writable:!0}):x[S]=F,x}var R=function(S){return S.hasOwnProperty("key")},P=function(x){p(F,x);var S=w(F);function F(D){var M;return d(this,F),M=S.call(this,D),E(v(M),"itemsWrapperRef",void 0),E(v(M),"itemsListRef",void 0),E(v(M),"thumbsRef",void 0),E(v(M),"setItemsWrapperRef",function(T){M.itemsWrapperRef=T}),E(v(M),"setItemsListRef",function(T){M.itemsListRef=T}),E(v(M),"setThumbsRef",function(T,O){M.thumbsRef||(M.thumbsRef=[]),M.thumbsRef[O]=T}),E(v(M),"updateSizes",function(){if(!(!M.props.children||!M.itemsWrapperRef||!M.thumbsRef)){var T=e.Children.count(M.props.children),O=M.itemsWrapperRef.clientWidth,k=M.props.thumbWidth?M.props.thumbWidth:(0,n.outerWidth)(M.thumbsRef[0]),N=Math.floor(O/k),X=N<T,Y=X?T-N:0;M.setState(function(ue,ee){return{itemSize:k,visibleItems:N,firstItem:X?M.getFirstItem(ee.selectedItem):0,lastPosition:Y,showArrows:X}})}}),E(v(M),"handleClickItem",function(T,O,k){if(!R(k)||k.key==="Enter"){var N=M.props.onSelectItem;typeof N=="function"&&N(T,O)}}),E(v(M),"onSwipeStart",function(){M.setState({swiping:!0})}),E(v(M),"onSwipeEnd",function(){M.setState({swiping:!1})}),E(v(M),"onSwipeMove",function(T){var O=T.x;if(!M.state.itemSize||!M.itemsWrapperRef||!M.state.visibleItems)return!1;var k=0,N=e.Children.count(M.props.children),X=-(M.state.firstItem*100)/M.state.visibleItems,Y=Math.max(N-M.state.visibleItems,0),ue=-Y*100/M.state.visibleItems;X===k&&O>0&&(O=0),X===ue&&O<0&&(O=0);var ee=M.itemsWrapperRef.clientWidth,te=X+100/(ee/O);return M.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ce){M.itemsListRef.style[ce]=(0,r.default)(te,"%",M.props.axis)}),!0}),E(v(M),"slideRight",function(T){M.moveTo(M.state.firstItem-(typeof T=="number"?T:1))}),E(v(M),"slideLeft",function(T){M.moveTo(M.state.firstItem+(typeof T=="number"?T:1))}),E(v(M),"moveTo",function(T){T=T<0?0:T,T=T>=M.state.lastPosition?M.state.lastPosition:T,M.setState({firstItem:T})}),M.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},M}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(M){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==M.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(M){var T=M;return M>=this.state.lastPosition&&(T=this.state.lastPosition),M<this.state.firstItem+this.state.visibleItems&&(T=this.state.firstItem),M<this.state.firstItem&&(T=M),T}},{key:"renderItems",value:function(){var M=this;return this.props.children.map(function(T,O){var k=t.default.ITEM(!1,O===M.state.selectedItem),N={key:O,ref:function(Y){return M.setThumbsRef(Y,O)},className:k,onClick:M.handleClickItem.bind(M,O,M.props.children[O]),onKeyDown:M.handleClickItem.bind(M,O,M.props.children[O]),"aria-label":"".concat(M.props.labels.item," ").concat(O+1),style:{width:M.props.thumbWidth}};return e.default.createElement("li",c({},N,{role:"button",tabIndex:0}),T)})}},{key:"render",value:function(){var M=this;if(!this.props.children)return null;var T=e.Children.count(this.props.children)>1,O=this.state.showArrows&&this.state.firstItem>0,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,N={},X=-this.state.firstItem*(this.state.itemSize||0),Y=(0,r.default)(X,"px",this.props.axis),ue=this.props.transitionTime+"ms";return N={WebkitTransform:Y,MozTransform:Y,MsTransform:Y,OTransform:Y,transform:Y,msTransform:Y,WebkitTransitionDuration:ue,MozTransitionDuration:ue,MsTransitionDuration:ue,OTransitionDuration:ue,transitionDuration:ue,msTransitionDuration:ue},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 M.slideRight()},"aria-label":this.props.labels.leftArrow}),T?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:N,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(te){return M.setItemsListRef(te)},style:N},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return M.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Xi.default=P,E(P,"displayName","Thumbs"),E(P,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Xi}var Ki={},au;function yp(){if(au)return Ki;au=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var e=function(){return document};return Ki.default=e,Ki}var An={},lu;function ud(){if(lu)return An;lu=1,Object.defineProperty(An,"__esModule",{value:!0}),An.setPosition=An.getPosition=An.isKeyboardEvent=An.defaultStatusFormatter=An.noop=void 0;var e=wo(),t=n(Yl());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};An.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};An.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};An.isKeyboardEvent=o;var l=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};An.getPosition=l;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return An.setPosition=a,An}var Yn={},su;function Cp(){if(su)return Yn;su=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.fadeAnimationHandler=Yn.slideStopSwipingHandler=Yn.slideSwipeAnimationHandler=Yn.slideAnimationHandler=void 0;var e=wo(),t=r(Yl()),n=ud();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);g&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(d,m).enumerable})),h.push.apply(h,p)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(p){l(d,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(p){Object.defineProperty(d,p,Object.getOwnPropertyDescriptor(h,p))})}return d}function l(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var p={},m=h.selectedItem,w=m,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(m<0||m>b);if(v)return w<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?p.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):p.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):w>b&&(p.itemListStyle=(0,n.setPosition)(0,g.axis)),p;var C=(0,n.getPosition)(m,g),I=(0,t.default)(C,"%",g.axis),E=g.transitionTime+"ms";return p.itemListStyle={WebkitTransform:I,msTransform:I,OTransform:I,transform:I},h.swiping||(p.itemListStyle=o(o({},p.itemListStyle),{},{WebkitTransitionDuration:E,MozTransitionDuration:E,OTransitionDuration:E,transitionDuration:E,msTransitionDuration:E})),p};Yn.slideAnimationHandler=a;var s=function(g,h,p,m){var w={},b=h.axis==="horizontal",v=e.Children.count(h.children),C=0,I=(0,n.getPosition)(p.selectedItem,h),E=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),R=b?g.x:g.y,P=R;I===C&&R>0&&(P=0),I===E&&R<0&&(P=0);var x=I+100/(p.itemSize/P),S=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&S&&(p.selectedItem===0&&x>-100?x-=v*100:p.selectedItem===v-1&&x<-v*100&&(x+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||S||p.swipeMovementStarted)&&(p.swipeMovementStarted||m({swipeMovementStarted:!0}),w.itemListStyle=(0,n.setPosition)(x,h.axis)),S&&!p.cancelClick&&m({cancelClick:!0}),w};Yn.slideSwipeAnimationHandler=s;var u=function(g,h){var p=(0,n.getPosition)(h.selectedItem,g),m=(0,n.setPosition)(p,g.axis);return{itemListStyle:m}};Yn.slideStopSwipingHandler=u;var c=function(g,h){var p=g.transitionTime+"ms",m="ease-in-out",w={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:m,msTransitionTimingFunction:m,MozTransitionTimingFunction:m,WebkitTransitionTimingFunction:m,OTransitionTimingFunction:m};return h.swiping||(w=o(o({},w),{},{WebkitTransitionDuration:p,MozTransitionDuration:p,OTransitionDuration:p,transitionDuration:p,msTransitionDuration:p})),{slideStyle:w,selectedStyle:o(o({},w),{},{opacity:1,position:"relative"}),prevStyle:o({},w)}};return Yn.fadeAnimationHandler=c,Yn}var uu;function Sp(){if(uu)return Ui;uu=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.default=void 0;var e=c(wo()),t=s(od()),n=s(ad()),r=s(sd()),i=s(yp()),o=s(ld()),l=ud(),a=Cp();function s(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var M=u();if(M&&M.has(D))return M.get(D);var T={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var N=O?Object.getOwnPropertyDescriptor(D,k):null;N&&(N.get||N.set)?Object.defineProperty(T,k,N):T[k]=D[k]}return T.default=D,M&&M.set(D,T),T}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(T){return typeof T}:d=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},d(D)}function g(){return g=Object.assign||function(D){for(var M=1;M<arguments.length;M++){var T=arguments[M];for(var O in T)Object.prototype.hasOwnProperty.call(T,O)&&(D[O]=T[O])}return D},g.apply(this,arguments)}function h(D,M){var T=Object.keys(D);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(D);M&&(O=O.filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable})),T.push.apply(T,O)}return T}function p(D){for(var M=1;M<arguments.length;M++){var T=arguments[M]!=null?arguments[M]:{};M%2?h(Object(T),!0).forEach(function(O){S(D,O,T[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(T)):h(Object(T)).forEach(function(O){Object.defineProperty(D,O,Object.getOwnPropertyDescriptor(T,O))})}return D}function m(D,M){if(!(D instanceof M))throw new TypeError("Cannot call a class as a function")}function w(D,M){for(var T=0;T<M.length;T++){var O=M[T];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(D,O.key,O)}}function b(D,M,T){return M&&w(D.prototype,M),D}function v(D,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(M&&M.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),M&&C(D,M)}function C(D,M){return C=Object.setPrototypeOf||function(O,k){return O.__proto__=k,O},C(D,M)}function I(D){var M=P();return function(){var O=x(D),k;if(M){var N=x(this).constructor;k=Reflect.construct(O,arguments,N)}else k=O.apply(this,arguments);return E(this,k)}}function E(D,M){return M&&(d(M)==="object"||typeof M=="function")?M:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function x(D){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},x(D)}function S(D,M,T){return M in D?Object.defineProperty(D,M,{value:T,enumerable:!0,configurable:!0,writable:!0}):D[M]=T,D}var F=function(D){v(T,D);var M=I(T);function T(O){var k;m(this,T),k=M.call(this,O),S(R(k),"thumbsRef",void 0),S(R(k),"carouselWrapperRef",void 0),S(R(k),"listRef",void 0),S(R(k),"itemsRef",void 0),S(R(k),"timer",void 0),S(R(k),"animationHandler",void 0),S(R(k),"setThumbsRef",function(X){k.thumbsRef=X}),S(R(k),"setCarouselWrapperRef",function(X){k.carouselWrapperRef=X}),S(R(k),"setListRef",function(X){k.listRef=X}),S(R(k),"setItemsRef",function(X,Y){k.itemsRef||(k.itemsRef=[]),k.itemsRef[Y]=X}),S(R(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),S(R(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),S(R(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),S(R(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),S(R(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),S(R(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),S(R(k),"navigateWithKeyboard",function(X){if(k.isFocusWithinTheCarousel()){var Y=k.props.axis,ue=Y==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},te=ue?ee.ArrowRight:ee.ArrowDown,ce=ue?ee.ArrowLeft:ee.ArrowUp;te===X.keyCode?k.increment():ce===X.keyCode&&k.decrement()}}),S(R(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var X=k.props.axis==="horizontal",Y=k.itemsRef[0];if(Y){var ue=X?Y.clientWidth:Y.clientHeight;k.setState({itemSize:ue}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),S(R(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),S(R(k),"handleClickItem",function(X,Y){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(X,Y),X!==k.state.selectedItem&&k.setState({selectedItem:X})}}),S(R(k),"handleOnChange",function(X,Y){e.Children.count(k.props.children)<=1||k.props.onChange(X,Y)}),S(R(k),"handleClickThumb",function(X,Y){k.props.onClickThumb(X,Y),k.moveTo(X)}),S(R(k),"onSwipeStart",function(X){k.setState({swiping:!0}),k.props.onSwipeStart(X)}),S(R(k),"onSwipeEnd",function(X){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(X),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),S(R(k),"onSwipeMove",function(X,Y){k.props.onSwipeMove(Y);var ue=k.props.swipeAnimationHandler(X,k.props,k.state,k.setState.bind(R(k)));return k.setState(p({},ue)),!!Object.keys(ue).length}),S(R(k),"decrement",function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof X=="number"?X:1))}),S(R(k),"increment",function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof X=="number"?X:1))}),S(R(k),"moveTo",function(X){if(typeof X=="number"){var Y=e.Children.count(k.props.children)-1;X<0&&(X=k.props.infiniteLoop?Y:0),X>Y&&(X=k.props.infiniteLoop?0:Y),k.selectItem({selectedItem:X}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),S(R(k),"onClickNext",function(){k.increment(1)}),S(R(k),"onClickPrev",function(){k.decrement(1)}),S(R(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),S(R(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),S(R(k),"changeItem",function(X){return function(Y){(!(0,l.isKeyboardEvent)(Y)||Y.key==="Enter")&&k.moveTo(X)}}),S(R(k),"selectItem",function(X){k.setState(p({previousItem:k.state.selectedItem},X),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(X.selectedItem,e.Children.toArray(k.props.children)[X.selectedItem])}),S(R(k),"getInitialImage",function(){var X=k.props.selectedItem,Y=k.itemsRef&&k.itemsRef[X],ue=Y&&Y.getElementsByTagName("img")||[];return ue[0]}),S(R(k),"getVariableItemHeight",function(X){var Y=k.itemsRef&&k.itemsRef[X];if(k.state.hasMount&&Y&&Y.children.length){var ue=Y.children[0].getElementsByTagName("img")||[];if(ue.length>0){var ee=ue[0];if(!ee.complete){var te=function he(){k.forceUpdate(),ee.removeEventListener("load",he)};ee.addEventListener("load",te)}}var ce=ue[0]||Y.children[0],se=ce.clientHeight;return se>0?se:null}return null});var N={initialized:!1,previousItem:O.selectedItem,selectedItem:O.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:O.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return k.animationHandler=typeof O.animationHandler=="function"&&O.animationHandler||O.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,k.state=p(p({},N),k.animationHandler(O,N)),k}return b(T,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,N){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),N.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var k=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var N=k.getInitialImage();N&&!N.complete?N.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var N=this;return this.props.children?e.Children.map(this.props.children,function(X,Y){var ue=Y===N.state.selectedItem,ee=Y===N.state.previousItem,te=ue&&N.state.selectedStyle||ee&&N.state.prevStyle||N.state.slideStyle||{};N.props.centerMode&&N.props.axis==="horizontal"&&(te=p(p({},te),{},{minWidth:N.props.centerSlidePercentage+"%"})),N.state.swiping&&N.state.swipeMovementStarted&&(te=p(p({},te),{},{pointerEvents:"none"}));var ce={ref:function(he){return N.setItemsRef(he,Y)},key:"itemKey"+Y+(k?"clone":""),className:n.default.ITEM(!0,Y===N.state.selectedItem,Y===N.state.previousItem),onClick:N.handleClickItem.bind(N,Y,X),style:te};return e.default.createElement("li",ce,N.props.renderItem(X,{isSelected:Y===N.state.selectedItem,isPrevious:Y===N.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,N=this.props,X=N.showIndicators,Y=N.labels,ue=N.renderIndicator,ee=N.children;return X?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(te,ce){return ue&&ue(k.changeItem(ce),ce===k.state.selectedItem,ce,Y.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var N=this.props.swipeable&&e.Children.count(this.props.children)>1,X=this.props.axis==="horizontal",Y=this.props.showArrows&&e.Children.count(this.props.children)>1,ue=Y&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=Y&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,te=this.renderItems(!0),ce=te.shift(),se=te.pop(),he={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(X){if(he.onSwipeLeft=this.onSwipeForward,he.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var ie=this.getVariableItemHeight(this.state.selectedItem);de.height=ie||"auto"}}else he.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,he.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,he.style=p(p({},he.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,ue,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:de},N?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},he,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&ce):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(L){return k.setListRef(L)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&se,this.renderItems(),this.props.infiniteLoop&&ce)),this.props.renderArrowNext(this.onClickNext,ee,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),T}(e.default.Component);return Ui.default=F,S(F,"displayName","Carousel"),S(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(M,T,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_PREV(!T),onClick:M})},renderArrowNext:function(M,T,O){return e.default.createElement("button",{type:"button","aria-label":O,className:n.default.ARROW_NEXT(!T),onClick:M})},renderIndicator:function(M,T,O,k){return e.default.createElement("li",{className:n.default.DOT(T),onClick:M,onKeyDown:M,value:O,key:O,role:"button",tabIndex:0,"aria-label":"".concat(k," ").concat(O+1)})},renderItem:function(M){return M},renderThumbs:function(M){var T=e.Children.map(M,function(O){var k=O;if(O.type!=="img"&&(k=e.Children.toArray(O.props.children).find(function(N){return N.type==="img"})),!!k)return k});return T.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"),[]):T},statusFormatter:l.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),Ui}var cu={},du;function xp(){return du||(du=1),cu}var fu;function kp(){return fu||(fu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=i(Sp()),n=xp(),r=i(sd());function i(o){return o&&o.__esModule?o:{default:o}}}(el)),el}var Mp=kp(),tl,hu;function Rp(){if(hu)return tl;hu=1;var e=zh(),t=function(){return e.Date.now()};return tl=t,tl}var nl,gu;function cd(){if(gu)return nl;gu=1;var e=Nc(),t=Rp(),n=Bc(),r="Expected a function",i=Math.max,o=Math.min;function l(a,s,u){var c,d,g,h,p,m,w=0,b=!1,v=!1,C=!0;if(typeof a!="function")throw new TypeError(r);s=n(s)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,s):g,C="trailing"in u?!!u.trailing:C);function I(T){var O=c,k=d;return c=d=void 0,w=T,h=a.apply(k,O),h}function E(T){return w=T,p=setTimeout(x,s),b?I(T):h}function R(T){var O=T-m,k=T-w,N=s-O;return v?o(N,g-k):N}function P(T){var O=T-m,k=T-w;return m===void 0||O>=s||O<0||v&&k>=g}function x(){var T=t();if(P(T))return S(T);p=setTimeout(x,R(T))}function S(T){return p=void 0,C&&c?I(T):(c=d=void 0,h)}function F(){p!==void 0&&clearTimeout(p),w=0,c=m=d=p=void 0}function D(){return p===void 0?h:S(t())}function M(){var T=t(),O=P(T);if(c=arguments,d=this,m=T,O){if(p===void 0)return E(m);if(v)return clearTimeout(p),p=setTimeout(x,s),I(m)}return p===void 0&&(p=setTimeout(x,s)),h}return M.cancel=F,M.flush=D,M}return nl=l,nl}var Ep=cd();const dd=pr(Ep);function Cn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{o.current?.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:i}),()=>{l.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Mr(e,t){return e===void 0?void 0:t}const Ip=Math.PI;function pu(e){return e*Ip/180}const fd=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),hd=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},gd=(e,t,n)=>Math.min(e,t-n*2),pd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,jl=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},Tp=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Dp(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const l=f.useRef(dd(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&l.current(()=>e())},t),r}const Op="֑-߿יִ-﷽ﹰ-ﻼ",Pp="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Lp=new RegExp("^[^"+Pp+"]*["+Op+"]");function Kl(e){return Lp.test(e)?"rtl":"not-rtl"}let No;function Tl(){if(typeof document>"u")return 0;if(No!==void 0)return No;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(),No=n-r,No}const Ur=Symbol();function Fp(e){const t=f.useRef([Ur,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const s=t.current[0];s!==Ur&&(a=typeof a=="function"?a(s):a,a===s)||(s!==Ur&&i({}),r(u=>typeof a=="function"?a(s===Ur?u:s):a),t.current[0]=Ur)},[]),l=f.useCallback(()=>{t.current[0]=Ur,i({})},[]);return[t.current[0]===Ur?n:t.current[0],o,l]}function md(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 _p(e){const t=f.useRef(e);return Di(e,t.current)||(t.current=e),t.current}const Ap=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const l=o.length>1;return f.createElement(vp,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Mp.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},o.map(a=>{const s=i?.(a)??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(jl,null)))};function vd(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Zr=vd();function Hp(e){Zr=e}const bd=/[&<>"']/,zp=new RegExp(bd.source,"g"),wd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Vp=new RegExp(wd.source,"g"),$p={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},mu=e=>$p[e];function vn(e,t){if(t){if(bd.test(e))return e.replace(zp,mu)}else if(wd.test(e))return e.replace(Vp,mu);return e}const Np=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function yd(e){return e.replace(Np,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Bp=/(^|[^\[])\^/g;function At(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(Bp,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const Wp=/[^\w:]/g,Up=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function vu(e,t,n){if(e){let r;try{r=decodeURIComponent(yd(n)).replace(Wp,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Up.test(n)&&(n=Yp(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Bo={},qp=/^[^:]+:\/*[^/]*$/,Xp=/^([^:]+:)[\s\S]*$/,Gp=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Yp(e,t){Bo[" "+e]||(qp.test(e)?Bo[" "+e]=e+"/":Bo[" "+e]=Qo(e,"/",!0)),e=Bo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Xp,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Gp,"$1")+t:e+t}const sa={exec:function(){}};function bu(e,t){const n=e.replace(/\|/g,(o,l,a)=>{let s=!1,u=l;for(;--u>=0&&a[u]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Qo(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function jp(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function Kp(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function wu(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function yu(e,t,n,r){const i=t.href,o=t.title?vn(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:vn(l)}}function Zp(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
3
+ `).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[l]=o;return l.length>=r.length?i.slice(r.length):i}).join(`
4
+ `)}class Zl{constructor(t){this.options=t||Zr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Qo(r,`
5
+ `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Zp(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=Qo(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,l,a,s,u,c,d,g,h,p,m=n[1].trim();const w=m.length>1,b={type:"list",raw:"",ordered:w,start:w?+m.slice(0,-1):"",loose:!1,items:[]};m=w?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=w?m:"[*+-]");const v=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=v.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(`
6
+ `,1)[0].replace(/^\t+/,I=>" ".repeat(3*I.length)),d=t.split(`
7
+ `,1)[0],this.options.pedantic?(l=2,h=c.trimLeft()):(l=n[2].search(/[^ ]/),l=l>4?1:l,h=c.slice(l),l+=n[1].length),s=!1,!c&&/^ *$/.test(d)&&(r+=d+`
8
+ `,t=t.substring(d.length+1),p=!0),!p){const I=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),E=new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),R=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),P=new RegExp(`^ {0,${Math.min(3,l-1)}}#`);for(;t&&(g=t.split(`
9
+ `,1)[0],d=g,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(R.test(d)||P.test(d)||I.test(d)||E.test(t)));){if(d.search(/[^ ]/)>=l||!d.trim())h+=`
10
+ `+d.slice(l);else{if(s||c.search(/[^ ]/)>=4||R.test(c)||P.test(c)||E.test(c))break;h+=`
11
+ `+d}!s&&!d.trim()&&(s=!0),r+=g+`
12
+ `,t=t.substring(g.length+1),c=d.slice(l)}}b.loose||(u?b.loose=!0:/\n *\n *$/.test(r)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(h),i&&(o=i[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),b.items.push({type:"list_item",raw:r,task:!!i,checked:o,loose:!1,text:h}),b.raw+=r}b.items[b.items.length-1].raw=r.trimRight(),b.items[b.items.length-1].text=h.trimRight(),b.raw=b.raw.trimRight();const C=b.items.length;for(a=0;a<C;a++)if(this.lexer.state.top=!1,b.items[a].tokens=this.lexer.blockTokens(b.items[a].text,[]),!b.loose){const I=b.items[a].tokens.filter(R=>R.type==="space"),E=I.length>0&&I.some(R=>/\n.*\n/.test(R.raw));b.loose=E}if(b.loose)for(a=0;a<C;a++)b.items[a].loose=!0;return b}}html(t){const n=this.rules.block.html.exec(t);if(n){const r={type:"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:n[0]};if(this.options.sanitize){const i=this.options.sanitizer?this.options.sanitizer(n[0]):vn(n[0]);r.type="paragraph",r.text=i,r.tokens=this.lexer.inline(i)}return r}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),i=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:i,title:o}}}table(t){const n=this.rules.block.table.exec(t);if(n){const r={type:"table",header:bu(n[1]).map(i=>({text:i})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
13
+ `):[]};if(r.header.length===r.align.length){r.raw=n[0];let i=r.align.length,o,l,a,s;for(o=0;o<i;o++)/^ *-+: *$/.test(r.align[o])?r.align[o]="right":/^ *:-+: *$/.test(r.align[o])?r.align[o]="center":/^ *:-+ *$/.test(r.align[o])?r.align[o]="left":r.align[o]=null;for(i=r.rows.length,o=0;o<i;o++)r.rows[o]=bu(r.rows[o],r.header.length).map(u=>({text:u}));for(i=r.header.length,l=0;l<i;l++)r.header[l].tokens=this.lexer.inline(r.header[l].text);for(i=r.rows.length,l=0;l<i;l++)for(s=r.rows[l],a=0;a<s.length;a++)s[a].tokens=this.lexer.inline(s[a].text);return r}}}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)===`
14
+ `?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:vn(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:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):vn(n[0]):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 l=Qo(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{const l=jp(n[2],"()");if(l>-1){const s=(n[0].indexOf("!")===0?5:4)+n[1].length+l;n[2]=n[2].substring(0,l),n[0]=n[0].substring(0,s).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);l&&(i=l[1],o=l[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(r)?i=i.slice(1):i=i.slice(1,-1)),yu(n,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$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))){let i=(r[2]||r[1]).replace(/\s+/g," ");if(i=n[i.toLowerCase()],!i){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return yu(r,i,r[0],this.lexer)}}emStrong(t,n,r=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i||i[3]&&r.match(/[\p{L}\p{N}]/u))return;const o=i[1]||i[2]||"";if(!o||o&&(r===""||this.rules.inline.punctuation.exec(r))){const l=i[0].length-1;let a,s,u=l,c=0;const d=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+l);(i=d.exec(n))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(s=a.length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&l%3&&!((l+s)%3)){c+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+c);const g=t.slice(0,l+i.index+(i[0].length-a.length)+s);if(Math.min(l,s)%2){const p=g.slice(1,-1);return{type:"em",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}const h=g.slice(2,-2);return{type:"strong",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const i=/[^ ]/.test(r),o=/^ /.test(r)&&/ $/.test(r);return i&&o&&(r=r.substring(1,r.length-1)),r=vn(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,n){const r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=vn(this.options.mangle?n(r[1]):r[1]),o="mailto:"+i):(i=vn(r[1]),o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t,n){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=vn(this.options.mangle?n(r[0]):r[0]),o="mailto:"+i;else{let l;do l=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(l!==r[0]);i=vn(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t,n){const r=this.rules.inline.text.exec(t);if(r){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):vn(r[0]):r[0]:i=vn(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}}}}const Ve={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {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|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:sa,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ve._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;Ve._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Ve.def=At(Ve.def).replace("label",Ve._label).replace("title",Ve._title).getRegex();Ve.bullet=/(?:[*+-]|\d{1,9}[.)])/;Ve.listItemStart=At(/^( *)(bull) */).replace("bull",Ve.bullet).getRegex();Ve.list=At(Ve.list).replace(/bull/g,Ve.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ve.def.source+")").getRegex();Ve._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";Ve._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;Ve.html=At(Ve.html,"i").replace("comment",Ve._comment).replace("tag",Ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Ve.paragraph=At(Ve._paragraph).replace("hr",Ve.hr).replace("heading"," {0,3}#{1,6} ").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",Ve._tag).getRegex();Ve.blockquote=At(Ve.blockquote).replace("paragraph",Ve.paragraph).getRegex();Ve.normal={...Ve};Ve.gfm={...Ve.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};Ve.gfm.table=At(Ve.gfm.table).replace("hr",Ve.hr).replace("heading"," {0,3}#{1,6} ").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",Ve._tag).getRegex();Ve.gfm.paragraph=At(Ve._paragraph).replace("hr",Ve.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ve.gfm.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",Ve._tag).getRegex();Ve.pedantic={...Ve.normal,html:At(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ve._comment).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:sa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:At(Ve.normal._paragraph).replace("hr",Ve.hr).replace("heading",` *#{1,6} *[^
15
+ ]`).replace("lheading",Ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const ve={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:sa,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:sa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};ve._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";ve.punctuation=At(ve.punctuation).replace(/punctuation/g,ve._punctuation).getRegex();ve.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;ve.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;ve._comment=At(Ve._comment).replace("(?:-->|$)","-->").getRegex();ve.emStrong.lDelim=At(ve.emStrong.lDelim).replace(/punct/g,ve._punctuation).getRegex();ve.emStrong.rDelimAst=At(ve.emStrong.rDelimAst,"g").replace(/punct/g,ve._punctuation).getRegex();ve.emStrong.rDelimUnd=At(ve.emStrong.rDelimUnd,"g").replace(/punct/g,ve._punctuation).getRegex();ve._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;ve._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;ve._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])?)+(?![-_])/;ve.autolink=At(ve.autolink).replace("scheme",ve._scheme).replace("email",ve._email).getRegex();ve._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;ve.tag=At(ve.tag).replace("comment",ve._comment).replace("attribute",ve._attribute).getRegex();ve._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;ve._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;ve._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;ve.link=At(ve.link).replace("label",ve._label).replace("href",ve._href).replace("title",ve._title).getRegex();ve.reflink=At(ve.reflink).replace("label",ve._label).replace("ref",Ve._label).getRegex();ve.nolink=At(ve.nolink).replace("ref",Ve._label).getRegex();ve.reflinkSearch=At(ve.reflinkSearch,"g").replace("reflink",ve.reflink).replace("nolink",ve.nolink).getRegex();ve.normal={...ve};ve.pedantic={...ve.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:At(/^!?\[(label)\]\((.*?)\)/).replace("label",ve._label).getRegex(),reflink:At(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ve._label).getRegex()};ve.gfm={...ve.normal,escape:At(ve.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_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.!#$%&'*+\/=?_`{\|}~-]+@)))/};ve.gfm.url=At(ve.gfm.url,"i").replace("email",ve.gfm._extended_email).getRegex();ve.breaks={...ve.gfm,br:At(ve.br).replace("{2,}","*").getRegex(),text:At(ve.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function Jp(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Cu(e){let t="",n,r;const i=e.length;for(n=0;n<i;n++)r=e.charCodeAt(n),Math.random()>.5&&(r="x"+r.toString(16)),t+="&#"+r+";";return t}class Tr{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Zr,this.options.tokenizer=this.options.tokenizer||new Zl,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:Ve.normal,inline:ve.normal};this.options.pedantic?(n.block=Ve.pedantic,n.inline=ve.pedantic):this.options.gfm&&(n.block=Ve.gfm,this.options.breaks?n.inline=ve.breaks:n.inline=ve.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ve,inline:ve}}static lex(t,n){return new Tr(n).lex(t)}static lexInline(t,n){return new Tr(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
16
+ `),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,s,u)=>s+" ".repeat(u.length));let r,i,o,l;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
17
+ `:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
18
+ `+r.raw,i.text+=`
19
+ `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
20
+ `+r.raw,i.text+=`
21
+ `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const s=t.slice(1);let u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},s),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){i=n[n.length-1],l&&i.type==="paragraph"?(i.raw+=`
22
+ `+r.raw,i.text+=`
23
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r),l=o.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
24
+ `+r.raw,i.text+=`
25
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,i,o,l=t,a,s,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+wu("a",a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,a.index)+"["+wu("a",a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,a.index+a[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(s||(u=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(r=c.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.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),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,l,u)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t,Cu)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t,Cu))){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const d=t.slice(1);let g;this.options.extensions.startInline.forEach(function(h){g=h.call({lexer:this},d),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(r=this.tokenizer.inlineText(o,Jp)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(u=r.raw.slice(-1)),s=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}class Jl{constructor(t){this.options=t||Zr}code(t,n,r){const i=(n||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(t,i);o!=null&&o!==t&&(r=!0,t=o)}return t=t.replace(/\n$/,"")+`
26
+ `,i?'<pre><code class="'+this.options.langPrefix+vn(i)+'">'+(r?t:vn(t,!0))+`</code></pre>
27
+ `:"<pre><code>"+(r?t:vn(t,!0))+`</code></pre>
28
+ `}blockquote(t){return`<blockquote>
29
+ ${t}</blockquote>
30
+ `}html(t){return t}heading(t,n,r,i){if(this.options.headerIds){const o=this.options.headerPrefix+i.slug(r);return`<h${n} id="${o}">${t}</h${n}>
31
+ `}return`<h${n}>${t}</h${n}>
32
+ `}hr(){return this.options.xhtml?`<hr/>
33
+ `:`<hr>
34
+ `}list(t,n,r){const i=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+i+o+`>
35
+ `+t+"</"+i+`>
36
+ `}listitem(t){return`<li>${t}</li>
37
+ `}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(t){return`<p>${t}</p>
38
+ `}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
39
+ <thead>
40
+ `+t+`</thead>
41
+ `+n+`</table>
42
+ `}tablerow(t){return`<tr>
43
+ ${t}</tr>
44
+ `}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
45
+ `}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){if(t=vu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){if(t=vu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(t){return t}}class Cd{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class Sd{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let r=t,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[t];do i++,r=t+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=i,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}class Dr{constructor(t){this.options=t||Zr,this.options.renderer=this.options.renderer||new Jl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Cd,this.slugger=new Sd}static parse(t,n){return new Dr(n).parse(t)}static parseInline(t,n){return new Dr(n).parseInline(t)}parse(t,n=!0){let r="",i,o,l,a,s,u,c,d,g,h,p,m,w,b,v,C,I,E,R;const P=t.length;for(i=0;i<P;i++){if(h=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(R=this.options.extensions.renderers[h.type].call({parser:this},h),R!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){r+=R||"";continue}switch(h.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(h.tokens),h.depth,yd(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(d="",c="",a=h.header.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(h.header[o].tokens),{header:!0,align:h.align[o]});for(d+=this.renderer.tablerow(c),g="",a=h.rows.length,o=0;o<a;o++){for(u=h.rows[o],c="",s=u.length,l=0;l<s;l++)c+=this.renderer.tablecell(this.parseInline(u[l].tokens),{header:!1,align:h.align[l]});g+=this.renderer.tablerow(c)}r+=this.renderer.table(d,g);continue}case"blockquote":{g=this.parse(h.tokens),r+=this.renderer.blockquote(g);continue}case"list":{for(p=h.ordered,m=h.start,w=h.loose,a=h.items.length,g="",o=0;o<a;o++)v=h.items[o],C=v.checked,I=v.task,b="",v.task&&(E=this.renderer.checkbox(C),w?v.tokens.length>0&&v.tokens[0].type==="paragraph"?(v.tokens[0].text=E+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&v.tokens[0].tokens[0].type==="text"&&(v.tokens[0].tokens[0].text=E+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:E}):b+=E),b+=this.parse(v.tokens,w),g+=this.renderer.listitem(b,I,C);r+=this.renderer.list(g,p,m);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(g=h.tokens?this.parseInline(h.tokens):h.text;i+1<P&&t[i+1].type==="text";)h=t[++i],g+=`
46
+ `+(h.tokens?this.parseInline(h.tokens):h.text);r+=n?this.renderer.paragraph(g):g;continue}default:{const x='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(x);return}else throw new Error(x)}}}return r}parseInline(t,n){n=n||this.renderer;let r="",i,o,l;const a=t.length;for(i=0;i<a;i++){if(o=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(l=this.options.extensions.renderers[o.type].call({parser:this},o),l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){r+=l||"";continue}switch(o.type){case"escape":{r+=n.text(o.text);break}case"html":{r+=n.html(o.text);break}case"link":{r+=n.link(o.href,o.title,this.parseInline(o.tokens,n));break}case"image":{r+=n.image(o.href,o.title,o.text);break}case"strong":{r+=n.strong(this.parseInline(o.tokens,n));break}case"em":{r+=n.em(this.parseInline(o.tokens,n));break}case"codespan":{r+=n.codespan(o.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(o.tokens,n));break}case"text":{r+=n.text(o.text);break}default:{const s='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(s);return}else throw new Error(s)}}}return r}}class Dl{constructor(t){this.options=t||Zr}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}}function Qp(e,t,n){return r=>{if(r.message+=`
47
+ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+vn(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function xd(e,t){return(n,r,i)=>{typeof r=="function"&&(i=r,r=null);const o={...r};r={...Ne.defaults,...o};const l=Qp(r.silent,r.async,i);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(Kp(r),r.hooks&&(r.hooks.options=r),i){const a=r.highlight;let s;try{r.hooks&&(n=r.hooks.preprocess(n)),s=e(n,r)}catch(d){return l(d)}const u=function(d){let g;if(!d)try{r.walkTokens&&Ne.walkTokens(s,r.walkTokens),g=t(s,r),r.hooks&&(g=r.hooks.postprocess(g))}catch(h){d=h}return r.highlight=a,d?l(d):i(null,g)};if(!a||a.length<3||(delete r.highlight,!s.length))return u();let c=0;Ne.walkTokens(s,function(d){d.type==="code"&&(c++,setTimeout(()=>{a(d.text,d.lang,function(g,h){if(g)return u(g);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(a=>e(a,r)).then(a=>r.walkTokens?Promise.all(Ne.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>t(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(l);try{r.hooks&&(n=r.hooks.preprocess(n));const a=e(n,r);r.walkTokens&&Ne.walkTokens(a,r.walkTokens);let s=t(a,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(a){return l(a)}}}function Ne(e,t,n){return xd(Tr.lex,Dr.parse)(e,t,n)}Ne.options=Ne.setOptions=function(e){return Ne.defaults={...Ne.defaults,...e},Hp(Ne.defaults),Ne};Ne.getDefaults=vd;Ne.defaults=Zr;Ne.use=function(...e){const t=Ne.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=Ne.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...l){let a=i.renderer.apply(this,l);return a===!1&&(a=o.apply(this,l)),a}:t.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[i.level]?t[i.level].unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=Ne.defaults.renderer||new Jl;for(const o in n.renderer){const l=i[o];i[o]=(...a)=>{let s=n.renderer[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.renderer=i}if(n.tokenizer){const i=Ne.defaults.tokenizer||new Zl;for(const o in n.tokenizer){const l=i[o];i[o]=(...a)=>{let s=n.tokenizer[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.tokenizer=i}if(n.hooks){const i=Ne.defaults.hooks||new Dl;for(const o in n.hooks){const l=i[o];Dl.passThroughHooks.has(o)?i[o]=a=>{if(Ne.defaults.async)return Promise.resolve(n.hooks[o].call(i,a)).then(u=>l.call(i,u));const s=n.hooks[o].call(i,a);return l.call(i,s)}:i[o]=(...a)=>{let s=n.hooks[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.hooks=i}if(n.walkTokens){const i=Ne.defaults.walkTokens;r.walkTokens=function(o){let l=[];return l.push(n.walkTokens.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}Ne.setOptions(r)})};Ne.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Ne,r)),r.type){case"table":{for(const i of r.header)n=n.concat(Ne.walkTokens(i.tokens,t));for(const i of r.rows)for(const o of i)n=n.concat(Ne.walkTokens(o.tokens,t));break}case"list":{n=n.concat(Ne.walkTokens(r.items,t));break}default:Ne.defaults.extensions&&Ne.defaults.extensions.childTokens&&Ne.defaults.extensions.childTokens[r.type]?Ne.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(Ne.walkTokens(r[i],t))}):r.tokens&&(n=n.concat(Ne.walkTokens(r.tokens,t)))}return n};Ne.parseInline=xd(Tr.lexInline,Dr.parseInline);Ne.Parser=Dr;Ne.parser=Dr.parse;Ne.Renderer=Jl;Ne.TextRenderer=Cd;Ne.Lexer=Tr;Ne.lexer=Tr.lex;Ne.Tokenizer=Zl;Ne.Slugger=Sd;Ne.Hooks=Dl;Ne.parse=Ne;Ne.options;Ne.setOptions;Ne.use;Ne.walkTokens;Ne.parseInline;Dr.parse;Tr.lex;const em=cn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class tm extends $t.PureComponent{targetElement=null;renderMarkdownIntoDiv(){const{targetElement:t,props:n}=this;if(t===null)return;const{contents:r,createNode:i}=n,o=Ne(r),l=document.createRange();l.selectNodeContents(t),l.deleteContents();let a=i?.(o);if(a===void 0){const u=document.createElement("template");u.innerHTML=o,a=u.content}t.append(a);const s=t.getElementsByTagName("a");for(const u of s)u.target="_blank",u.rel="noreferrer noopener"}containerRefHook=t=>{this.targetElement=t,this.renderMarkdownIntoDiv()};render(){return this.renderMarkdownIntoDiv(),$t.createElement(em,{ref:this.containerRefHook})}}const nm=cn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),rm=cn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),im=cn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let Su=0;const Jr=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:o,validatedSelection:l,...a}=e,{onChange:s,className:u}=a,c=f.useRef(null),d=n??"";Hn(s!==void 0,"GrowingEntry must be a controlled input area");const[g]=f.useState(()=>"input-box-"+(Su=(Su+1)%1e7));f.useEffect(()=>{const p=c.current;if(p===null||p.disabled)return;const m=d.toString().length;p.focus(),p.setSelectionRange(i?0:m,m)},[]),f.useLayoutEffect(()=>{if(l!==void 0){const p=typeof l=="number"?[l,null]:l;c.current?.setSelectionRange(p[0],p[1])}},[l]);const h=f.useCallback(p=>{p.key==="Enter"&&p.shiftKey&&o===!0||r?.(p)},[o,r]);return f.createElement(im,{className:"gdg-growing-entry"},f.createElement(rm,{className:u},d+`
48
+ `),f.createElement(nm,{...a,className:(u??"")+" gdg-input",id:g,ref:c,onKeyDown:h,value:d,placeholder:t,dir:"auto"}))},rl={};let xr=null;function om(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function fo(e){const t=e.toLowerCase().trim();if(rl[t]!==void 0)return rl[t];xr=xr||om(),xr.style.color="#000",xr.style.color=t;const n=getComputedStyle(xr).color;xr.style.color="#fff",xr.style.color=t;const r=getComputedStyle(xr).color;if(r!==n)return[0,0,0,1];let i=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return i.length<4&&i.push(1),i=i.map(o=>Number.isNaN(o)?0:o),rl[t]=i,i}function jr(e,t){const[n,r,i]=fo(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const xu=new Map;function ku(e,t){const n=`${e}-${t}`,r=xu.get(n);if(r!==void 0)return r;const i=zn(e,t);return xu.set(n,i),i}function zn(e,t){if(t===void 0)return e;const[n,r,i,o]=fo(e);if(o===1)return e;const[l,a,s,u]=fo(t),c=o+u*(1-o),d=(o*n+u*l*(1-o))/c,g=(o*r+u*a*(1-o))/c,h=(o*i+u*s*(1-o))/c;return`rgba(${d}, ${g}, ${h}, ${c})`}function Ol(e){if(e==="transparent")return 0;function t(o){const l=o/255;return l<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}const[n,r,i]=fo(e);return .2126*t(n)+.7152*t(r)+.0722*t(i)}var ki=new Map,Ri=new Map,Pl=new Map;function am(){ki.clear(),Pl.clear(),Ri.clear()}function lm(e,t,n,r,i){var o,l,a;let s=0,u={};for(let d of e)s+=(o=n.get(d))!=null?o:i,u[d]=((l=u[d])!=null?l:0)+1;let c=t-s;for(let d of Object.keys(u)){let g=u[d],h=(a=n.get(d))!=null?a:i,p=h*g/s,m=c*p*r/g,w=h+m;n.set(d,w)}}function sm(e,t){var n;let r=new Map,i=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;r.set(u,c),i+=c}let o=i/r.size,l=3,a=(t/o+l)/(l+1),s=r.keys();for(let u of s)r.set(u,((n=r.get(u))!=null?n:o)*a);return r}function ao(e,t,n,r){var i,o;let l=Ri.get(n);if(r&&l!==void 0&&l.count>2e4){let u=Pl.get(n);if(u===void 0&&(u=sm(e,l.size),Pl.set(n,u)),l.count>5e5){let d=0;for(let g of t)d+=(i=u.get(g))!=null?i:l.size;return d*1.01}let c=e.measureText(t);return lm(t,c.width,u,Math.max(.05,1-l.count/2e5),l.size),Ri.set(n,{count:l.count+t.length,size:l.size}),c.width}let a=e.measureText(t),s=a.width/t.length;if(((o=l?.count)!=null?o:0)>2e4)return a.width;if(l===void 0)Ri.set(n,{count:t.length,size:s});else{let u=s-l.size,c=t.length/(l.count+t.length),d=l.size+u*c;Ri.set(n,{count:l.count+t.length,size:d})}return a.width}function um(e,t,n,r,i,o,l,a){if(t.length<=1)return t.length;if(i<n)return-1;let s=Math.floor(n/i*o),u=ao(e,t.slice(0,Math.max(0,s)),r,l);if(u!==n)if(u<n){for(;u<n;)s++,u=ao(e,t.slice(0,Math.max(0,s)),r,l);s--}else for(;u>n;){let c=t.lastIndexOf(" ",s-1);c>0?s=c:s--,u=ao(e,t.slice(0,Math.max(0,s)),r,l)}if(t[s]!==" "){let c=0;c=t.lastIndexOf(" ",s),c>0&&(s=c)}return s}function cm(e,t,n,r,i,o){let l=`${t}_${n}_${r}px`,a=ki.get(l);if(a!==void 0)return a;if(r<=0)return[];let s=[],u=t.split(`
49
+ `),c=Ri.get(n),d=c===void 0?t.length:r/c.size*1.5,g=i&&c!==void 0&&c.count>2e4;for(let h of u){let p=ao(e,h.slice(0,Math.max(0,d)),n,g),m=Math.min(h.length,d);if(p<=r)s.push(h);else{for(;p>r;){let w=um(e,h,r,n,p,m,g),b=h.slice(0,Math.max(0,w));h=h.slice(b.length),s.push(b),p=ao(e,h.slice(0,Math.max(0,d)),n,g),m=Math.min(h.length,d)}p>0&&s.push(h)}}return s=s.map((h,p)=>p===0?h.trimEnd():h.trim()),ki.set(l,s),ki.size>500&&ki.delete(ki.keys().next().value),s}function dm(e,t){return $t.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 fm(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(lo(e.current.cell,t))return!0;const i=[e.current.range,...e.current.rangeStack];for(const o of i)if(n>=o.x&&n<o.x+o.width&&r>=o.y&&r<o.y+o.height)return!0}return!1}function ho(e,t){return(e??"")===(t??"")}function hm(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 kd(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function lo(e,t){return e?.[0]===t?.[0]&&e?.[1]===t?.[1]}function Md(e){return[e.x+e.width-1,e.y+e.height-1]}function Mu(e,t,n){const r=n.x,i=n.x+n.width-1,o=n.y,l=n.y+n.height-1,[a,s]=e;if(s<o||s>l)return!1;if(t.span===void 0)return a>=r&&a<=i;const[u,c]=t.span;return u>=r&&u<=i||c>=r&&u<=i||u<r&&c>i}function gm(e,t,n,r){let i=0;if(n.current===void 0)return i;const o=n.current.range;(r||o.height*o.width>1)&&Mu(e,t,o)&&i++;for(const l of n.current.rangeStack)Mu(e,t,l)&&i++;return i}function Rd(e,t){let n=e;if(t!==void 0){let r=[...e];const i=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,i)):(r.splice(t.dest+1,0,i),r.splice(t.src,1)),r=r.map((o,l)=>({...o,sticky:e[l].sticky})),n=r}return n}function Oi(e,t){let n=0;const r=Rd(e,t);for(let i=0;i<r.length;i++){const o=r[i];if(o.sticky)n+=o.width;else break}return n}function Qr(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let i=e-t;i<e;i++)r+=n(i);return r}}function Ll(e,t,n,r,i){const o=Rd(e,r),l=[];for(const u of o)if(u.sticky)l.push(u);else break;if(l.length>0)for(const u of l)n-=u.width;let a=t,s=i??0;for(;s<=n&&a<o.length;)s+=o[a].width,a++;for(let u=t;u<a;u++){const c=o[u];c.sticky||l.push(c)}return l}function pm(e,t,n){let r=0;for(const i of t){const o=i.sticky?r:r+(n??0);if(e<=o+i.width)return i.sourceIndex;r+=i.width}return-1}function mm(e,t,n,r,i,o,l,a,s,u){const c=r+i;if(n&&e<=i)return-2;if(e<=c)return-1;let d=t;for(let p=0;p<u;p++){const m=o-1-p,w=typeof l=="number"?l:l(m);if(d-=w,e>=d)return m}const g=o-u,h=e-(s??0);if(typeof l=="number"){const p=Math.floor((h-c)/l)+a;return p>=g?void 0:p}else{let p=c;for(let m=a;m<g;m++){const w=l(m);if(h<=p+w)return m;p+=w}return}}let ea=0,so={};const vm=typeof window>"u";async function bm(){vm||document?.fonts?.ready===void 0||(await document.fonts.ready,ea=0,so={},am())}bm();function Ed(e,t,n,r){return`${e}_${r??t?.font}_${n}`}function Or(e,t,n,r="middle"){const i=Ed(e,t,r,n);let o=so[i];return o===void 0&&(o=t.measureText(e),so[i]=o,ea++),ea>1e4&&(so={},ea=0),o}function Id(e,t){const n=Ed(e,void 0,"middle",t);return so[n]}function er(e,t){return typeof t!="string"&&(t=t.baseFontFull),wm(e,t)}function Ru(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const Eu=[];function wm(e,t){for(const o of Eu)if(o.key===t)return o.val;const n=Ru(e,"alphabetic"),i=-(Ru(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return Eu.push({key:t,val:i}),i}function ym(e,t,n,r,i,o){const{ctx:l,rect:a,theme:s}=e;let u=Number.MAX_SAFE_INTEGER;const c=500;if(t!==void 0&&(u=n-t,u<c)){const d=1-u/c;l.globalAlpha=d,l.fillStyle=s.bgSearchResult,l.fillRect(a.x+1,a.y+1,a.width-(i?2:1),a.height-(o?2:1)),l.globalAlpha=1,r!==void 0&&(r.fillStyle=s.bgSearchResult)}return u<c}function yo(e,t,n){const{ctx:r,theme:i}=e,o=t??{},l=n??i.textDark;return l!==o.fillStyle&&(r.fillStyle=l,o.fillStyle=l),o}function Ql(e,t,n,r,i){const{rect:o,ctx:l,theme:a}=e;l.fillStyle=a.textDark,or({ctx:l,rect:o,theme:a},t,n,r,i)}function Td(e,t,n,r,i,o,l,a,s){s==="right"?e.fillText(t,n+i-(a.cellHorizontalPadding+.5),r+o/2+l):s==="center"?e.fillText(t,n+i/2,r+o/2+l):e.fillText(t,n+a.cellHorizontalPadding+.5,r+o/2+l)}function es(e,t){const n=Or("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function Cm(e,t){e.includes(`
50
+ `)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function Sm(e,t,n,r,i,o,l,a,s,u){const c=a.baseFontFull,d=cm(e,t,c,i-a.cellHorizontalPadding*2,u??!1),g=es(e,c),h=a.lineHeight*g,p=g+h*(d.length-1),m=p+a.cellVerticalPadding>o;m&&(e.save(),e.rect(n,r,i,o),e.clip());const w=r+o/2-p/2;let b=Math.max(r+a.cellVerticalPadding,w);for(const v of d)if(Td(e,v,n,b,i,g,l,a,s),b+=h,b>r+o)break;m&&e.restore()}function or(e,t,n,r,i){const{ctx:o,rect:l,theme:a}=e,{x:s,y:u,width:c,height:d}=l;r=r??!1,r||(t=Cm(t,c));const g=er(o,a),h=Kl(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(o.direction="rtl"),t.length>0){let p=!1;n==="right"?(o.textAlign="right",p=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,p=!0),r?Sm(o,t,s,u,c,d,g,a,n,i):Td(o,t,s,u,c,d,g,a,n),p&&(o.textAlign="start"),h&&(o.direction="inherit")}}function Jn(e,t,n,r,i,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,i/2,r/2)),tr:Math.max(0,Math.min(o.tr,i/2,r/2)),bl:Math.max(0,Math.min(o.bl,i/2,r/2)),br:Math.max(0,Math.min(o.br,i/2,r/2))},e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function xm(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 km(e,t,n){const r=function(a,s){const u=s.x-a.x,c=s.y-a.y,d=Math.sqrt(u*u+c*c),g=u/d,h=c/d;return{x:u,y:s.y-a.y,len:d,nx:g,ny:h,ang:Math.atan2(h,g)}};let i;const o=t.length;let l=t[o-1];for(let a=0;a<o;a++){let s=t[a%o];const u=t[(a+1)%o],c=r(s,l),d=r(s,u),g=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let p=Math.asin(g<-1?-1:g>1?1:g),m=1,w=!1;h<0?p<0?p=Math.PI+p:(p=Math.PI-p,m=-1,w=!0):p>0&&(m=-1,w=!0),i=s.radius!==void 0?s.radius:n;const b=p/2;let v=Math.abs(Math.cos(b)*i/Math.sin(b)),C;v>Math.min(c.len/2,d.len/2)?(v=Math.min(c.len/2,d.len/2),C=Math.abs(v*Math.sin(b)/Math.cos(b))):C=i;let I=s.x+d.nx*v,E=s.y+d.ny*v;I+=-d.ny*C*m,E+=d.nx*C*m,e.arc(I,E,C,c.ang+Math.PI/2*m,d.ang-Math.PI/2*m,w),l=s,s=u}e.closePath()}function Fl(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p){const m={x:0,y:o+u,width:0,height:0};if(e>=h.length||t>=c||t<-2||e<0)return m;const w=o-i;if(e>=d){const b=l>e?-1:1,v=Oi(h);m.x+=v+s;for(let C=l;C!==e;C+=b)m.x+=h[b===1?C:C-1].width*b}else for(let b=0;b<e;b++)m.x+=h[b].width;if(m.width=h[e].width+1,t===-1)m.y=i,m.height=w;else if(t===-2){m.y=0,m.height=i;let b=e;const v=h[e].group,C=h[e].sticky;for(;b>0&&ho(h[b-1].group,v)&&h[b-1].sticky===C;){const E=h[b-1];m.x-=E.width,m.width+=E.width,b--}let I=e;for(;I+1<h.length&&ho(h[I+1].group,v)&&h[I+1].sticky===C;){const E=h[I+1];m.width+=E.width,I++}if(!C){const E=Oi(h),R=m.x-E;R<0&&(m.x-=R,m.width+=R),m.x+m.width>n&&(m.width=n-m.x)}}else if(t>=c-g){let b=c-t;for(m.y=r;b>0;){const v=t+b-1;m.height=typeof p=="number"?p:p(v),m.y-=m.height,b--}m.height+=1}else{const b=a>t?-1:1;if(typeof p=="number"){const v=t-a;m.y+=v*p}else for(let v=a;v!==t;v+=b)m.y+=p(v)*b;m.height=(typeof p=="number"?p:p(t))+1}return m}const ts=1<<21;function Zn(e,t){return(t+2)*ts+e}function Dd(e){return e%ts}function ns(e){return Math.floor(e/ts)-2}function rs(e){const t=Dd(e),n=ns(e);return[t,n]}class Od{visibleWindow={x:0,y:0,width:0,height:0};freezeCols=0;freezeRows=[];isInWindow=t=>{const n=Dd(t),r=ns(t),i=this.visibleWindow,o=n>=i.x&&n<=i.x+i.width||n<this.freezeCols,l=r>=i.y&&r<=i.y+i.height||this.freezeRows.includes(r);return o&&l};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&&Di(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class Mm extends Od{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 uo{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(ns(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 rs(t)}}function Rm(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 Pd={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 Ld(){return Pd}const Fd=$t.createContext(Pd);function _d(){return $t.useContext(Fd)}function hr(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const i in r)r.hasOwnProperty(i)&&(i==="bgCell"?n[i]=zn(r[i],n[i]):n[i]=r[i]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const _l=150;function Em(e,t,n,r){return r(t)?.measure?.(e,t,n)??_l}function Ad(e,t,n,r,i,o,l,a,s){let u=0;const c=i===void 0?[]:i.map(h=>{const p=Em(e,h[r],t,s);return u=Math.max(u,p),p});if(c.length>5&&a){u=0;let h=0;for(const m of c)h+=m;const p=h/c.length;for(let m=0;m<c.length;m++)c[m]>=p*2?c[m]=0:u=Math.max(u,c[m])}const d=e.font;e.font=t.headerFontFull,u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=d;const g=Math.max(Math.ceil(o),Math.min(Math.floor(l),Math.ceil(u)));return{...n,width:g}}function Im(e,t,n,r,i,o,l,a,s){const u=f.useRef(t),c=f.useRef(n),d=f.useRef(l);u.current=t,c.current=n,d.current=l;const[g,h]=f.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})]},[]);f.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g?.remove()}),[g]);const p=f.useRef({}),m=f.useRef(),[w,b]=f.useState();return f.useLayoutEffect(()=>{const v=c.current;if(v===void 0||e.every(zo))return;let C=Math.max(1,10-Math.floor(e.length/1e4)),I=0;C<u.current&&C>1&&(C--,I=1);const E={x:0,y:0,width:e.length,height:Math.min(u.current,C)},R={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const x=v(E,s.signal),S=I>0?v(R,s.signal):void 0;let F;typeof x=="object"?F=x:F=await Ks(x),S!==void 0&&(typeof S=="object"?F=[...F,...S]:F=[...F,...await Ks(S)]),m.current=e,b(F)})()},[s.signal,e]),f.useMemo(()=>{let C=e.every(zo)?e:h===null?e.map(P=>zo(P)?P:{...P,width:_l}):(h.font=d.current.baseFontFull,e.map((P,x)=>{if(zo(P))return P;if(p.current[P.id]!==void 0)return{...P,width:p.current[P.id]};if(w===void 0||m.current!==e||P.id===void 0)return{...P,width:_l};const S=Ad(h,l,P,x,w,i,o,!0,a);return p.current[P.id]=S.width,S})),I=0,E=0;const R=[];for(const[P,x]of C.entries())I+=x.width,x.grow!==void 0&&x.grow>0&&(E+=x.grow,R.push(P));if(I<r&&R.length>0){const P=[...C],x=r-I;let S=x;for(let F=0;F<R.length;F++){const D=R[F],M=(C[D].grow??0)/E,T=F===R.length-1?S:Math.min(S,Math.floor(x*M));P[D]={...C[D],growOffset:T,width:C[D].width+T},S-=T}C=P}return{sizedColumns:C,nonGrowWidth:I}},[r,e,h,w,l,i,o,a])}var il,Iu;function Tm(){if(Iu)return il;Iu=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 il=e,il}var ol,Tu;function Dm(){if(Tu)return ol;Tu=1;var e=Tm(),t=Bc();function n(r,i,o){return o===void 0&&(o=i,i=void 0),o!==void 0&&(o=t(o),o=o===o?o:0),i!==void 0&&(i=t(i),i=i===i?i:0),e(t(r),i,o)}return ol=n,ol}var Om=Dm();const Wn=pr(Om);var al,Du;function Pm(){if(Du)return al;Du=1;function e(){}return al=e,al}var ll,Ou;function Lm(){if(Ou)return ll;Ou=1;var e=Vh(),t=Pm(),n=Wc(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return ll=i,ll}var sl,Pu;function Fm(){if(Pu)return sl;Pu=1;var e=$h(),t=Nh(),n=Wh(),r=Bh(),i=Lm(),o=Wc(),l=200;function a(s,u,c){var d=-1,g=t,h=s.length,p=!0,m=[],w=m;if(c)p=!1,g=n;else if(h>=l){var b=u?null:i(s);if(b)return o(b);p=!1,g=r,w=new e}else w=u?[]:m;e:for(;++d<h;){var v=s[d],C=u?u(v):v;if(v=c||v!==0?v:0,p&&C===C){for(var I=w.length;I--;)if(w[I]===C)continue e;u&&w.push(C),m.push(v)}else g(w,C,c)||(w!==m&&w.push(C),m.push(v))}return m}return sl=a,sl}var ul,Lu;function _m(){if(Lu)return ul;Lu=1;var e=Fm();function t(n){return n&&n.length?e(n):[]}return ul=t,ul}var Am=_m();const Hm=pr(Am);var zm=Uh();const Fu=pr(zm),Nt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',Vm=e=>{const t=e.fgColor,n=e.bgColor;return`
51
+ ${Nt}<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>`},$m=e=>{const t=e.fgColor,n=e.bgColor;return`
52
+ ${Nt}<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>`},Nm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
53
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
54
+ <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}"/>
55
+ </svg>`},Bm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
56
+ <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}"/>
57
+ <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}"/>
58
+ </svg>`},Wm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
59
+ <path
60
+ 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"
61
+ fill="${n}"
62
+ />
63
+ <path
64
+ fill-rule="evenodd"
65
+ clip-rule="evenodd"
66
+ 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"
67
+ fill="${t}"
68
+ />
69
+ </svg>`},Hd=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
70
+ <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}"/>
71
+ <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}"/>
72
+ <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}"/>
73
+ </svg>
74
+ `},Um=e=>{const t=e.bgColor;return`${Nt}
75
+ <path stroke="${t}" stroke-width="2" d="M12 3v14"/>
76
+ <path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
77
+ <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}"/>
78
+ </svg>
79
+ `},qm=Hd,Xm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
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="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}"/>
82
+ </svg>`},Gm=e=>{const t=e.fgColor,n=e.bgColor;return`
83
+ ${Nt}
84
+ <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}"/>
85
+ <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}"/>
86
+ <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}"/>
87
+ <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}"/>
88
+ <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}"/>
89
+ <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}"/>
90
+ <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}"/>
91
+ </svg>`},Ym=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
92
+ <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}"/>
93
+ <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}"/>
94
+ <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}"/>
95
+ </svg>`},jm=e=>{const t=e.fgColor,n=e.bgColor;return`
96
+ ${Nt}
97
+ <path fill="${t}" d="M3 3h14v14H3z"/>
98
+ <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}"/>
99
+ </svg>`},Km=e=>{const t=e.fgColor,n=e.bgColor;return`
100
+ ${Nt}
101
+ <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}"/>
102
+ <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}"/>
103
+ </svg>`},Zm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
104
+ <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}"/>
105
+ <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}"/>
106
+ </svg>`},Jm=e=>{const t=e.fgColor,n=e.bgColor;return`
107
+ ${Nt}
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 2z" fill="${n}"/>
109
+ <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}"/>
110
+ <path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
111
+ </svg>`},Qm=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
112
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
113
+ <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}"/>
114
+ <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}"/>
115
+ </svg>`},e0=e=>{const t=e.fgColor,n=e.bgColor;return`
116
+ ${Nt}
117
+ <rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
118
+ <rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
119
+ <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}"/>
120
+ </svg>`},t0=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
121
+ <path fill="${t}" d="M4 3h12v14H4z"/>
122
+ <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}"/>
123
+ </svg>`},n0=e=>{const t=e.fgColor,n=e.bgColor;return`
124
+ ${Nt}
125
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
126
+ <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}"/>
127
+ </svg>`},r0=e=>{const t=e.fgColor,n=e.bgColor;return`
128
+ ${Nt}
129
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
130
+ <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}"/>
131
+ </svg>`},i0=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
132
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
133
+ <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}"/>
134
+ </svg>`},o0=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
135
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
136
+ <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}"/>
137
+ <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}"/>
138
+ <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}"/>
139
+ <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}"/>
140
+ </svg>`},a0=e=>{const t=e.fgColor,n=e.bgColor;return`
141
+ ${Nt}
142
+ <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}"/>
143
+ <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}"/>
144
+ </svg>`},l0=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
145
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
146
+ <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}"/>
147
+ </svg>`},s0=e=>{const t=e.fgColor,n=e.bgColor;return`
148
+ ${Nt}
149
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
150
+ <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}"/>
151
+ </svg>`},u0=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
152
+ <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}"/>
153
+ <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}"/>
154
+ <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}"/>
155
+ </svg>`},c0=e=>{const t=e.fgColor,n=e.bgColor;return`${Nt}
156
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
157
+ <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}"/>
158
+ </svg>`},d0=e=>{const t=e.fgColor;return`
159
+ <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
160
+ <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"/>
161
+ </svg>`},f0=e=>{const t=e.fgColor;return`
162
+ <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
163
+ <path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
164
+ </svg>
165
+ `},h0={headerRowID:Vm,headerNumber:Nm,headerCode:$m,headerString:Bm,headerBoolean:Wm,headerAudioUri:qm,headerVideoUri:Xm,headerEmoji:Gm,headerImage:Ym,headerUri:Hd,headerPhone:jm,headerMarkdown:Km,headerDate:Zm,headerTime:Jm,headerEmail:Qm,headerReference:e0,headerIfThenElse:t0,headerSingleValue:n0,headerLookup:r0,headerTextTemplate:i0,headerMath:o0,headerRollup:a0,headerJoinStrings:l0,headerSplitString:s0,headerGeoDistance:u0,headerArray:c0,rowOwnerOverlay:d0,protectedColumnOverlay:f0,renameIcon:Um};function g0(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class p0{onSettled;spriteMap=new Map;headerIcons;inFlight=0;constructor(t,n){this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,i,o,l,a,s=1){const[u,c]=g0(n,a),d=l*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(g);if(h===void 0){const p=this.headerIcons[t];if(p===void 0)return;h=document.createElement("canvas");const m=h.getContext("2d");if(m===null)return;const w=new Image;w.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,h);const b=w.decode();if(b===void 0)return;this.inFlight++,b.then(()=>{m.drawImage(w,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(r.globalAlpha=s),r.drawImage(h,0,0,d,d,i,o,l,l),s<1&&(r.globalAlpha=1)}}function zd(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y);return t}function ka(e,t,n,r,i,o,l,a,s){a=a??t;let u=t,c=e;const d=r-o;let g=!1;for(;u<n&&c<d;){const h=i(c);if(u+h>a&&s(u,c,h,!1,l&&c===r-1)===!0){g=!0;break}u+=h,c++}if(!g){u=n;for(let h=0;h<o;h++){c=r-1-h;const p=i(c);u-=p,s(u,c,p,!0,l&&c===r-1)}}}function Pr(e,t,n,r,i,o){let l=0,a=0;const s=i+r;for(const u of e){const c=u.sticky?a:l+n;if(o(u,c,s,u.sticky?0:a,t)===!0)break;l+=u.width,a+=u.sticky?u.width:0}}function Vd(e,t,n,r,i){let o=0,l=0;for(let a=0;a<e.length;a++){const s=e[a];let u=a+1,c=s.width;for(s.sticky&&(l+=c);u<e.length&&ho(e[u].group,s.group)&&e[u].sticky===e[a].sticky;){const m=e[u];c+=m.width,u++,a++,m.sticky&&(l+=m.width)}const d=s.sticky?0:n,g=o+d,h=s.sticky?0:Math.max(0,l-g),p=Math.min(c-h,t-(g+h));i([s.sourceIndex,e[u-1].sourceIndex],s.group??"",g+h,0,p,r),o+=c}}function $d(e,t,n,r,i,o,l){const[a,s]=e;let u,c;const d=l.find(g=>!g.sticky)?.sourceIndex??0;if(s>d){const g=Math.max(a,d);let h=t,p=r;for(let m=o.sourceIndex-1;m>=g;m--)h-=l[m].width,p+=l[m].width;for(let m=o.sourceIndex+1;m<=s;m++)p+=l[m].width;c={x:h,y:n,width:p,height:i}}if(d>a){const g=Math.min(s,d-1);let h=t,p=r;for(let m=o.sourceIndex-1;m>=a;m--)h-=l[m].width,p+=l[m].width;for(let m=o.sourceIndex+1;m<=g;m++)p+=l[m].width;u={x:h,y:n,width:p,height:i}}return[u,c]}function m0(e,t,n,r){if(r==="any")return Nd(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),kd([t,n],e))return;const i=t-e.x,o=e.x+e.width-t,l=n-e.y+1,a=e.y+e.height-n,s=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="horizontal"?Number.MAX_SAFE_INTEGER:l,r==="horizontal"?Number.MAX_SAFE_INTEGER:a);return s===a?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:s===l?{x:e.x,y:n,width:e.width,height:e.y-n}:s===o?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function go(e,t,n,r,i,o,l,a){return e<=i+l&&i<=e+n&&t<=o+a&&o<=t+r}function Yr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Nd(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:i,height:o}}function v0(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 b0(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const i=-4,o=-4,l=t+4,a=n+4,s=i-e.x,u=e.x+e.width-l,c=o-e.y,d=e.y+e.height-a,g=s>0?e.x+Math.floor(s/r)*r:e.x,h=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,p=c>0?e.y+Math.floor(c/r)*r:e.y,m=d>0?e.y+e.height-Math.floor(d/r)*r:e.y+e.height;return{x:g,y:p,width:h-g,height:m-p}}function w0(e,t,n,r,i){const[o,l,a,s]=t,[u,c,d,g]=i,{x:h,y:p,width:m,height:w}=e,b=[];if(m<=0||w<=0)return b;const v=h+m,C=p+w,I=h<o,E=p<l,R=h+m>a,P=p+w>s,x=h>=o&&h<a||v>o&&v<=a||h<o&&v>a,S=p>=l&&p<s||C>l&&C<=s||p<l&&C>s;if(x&&S){const D=Math.max(h,o),M=Math.max(p,l),T=Math.min(v,a),O=Math.min(C,s);b.push({rect:{x:D,y:M,width:T-D,height:O-M},clip:{x:u,y:c,width:d-u+1,height:g-c+1}})}if(I&&E){const D=h,M=p,T=Math.min(v,o),O=Math.min(C,l);b.push({rect:{x:D,y:M,width:T-D,height:O-M},clip:{x:0,y:0,width:u+1,height:c+1}})}if(E&&x){const D=Math.max(h,o),M=p,T=Math.min(v,a),O=Math.min(C,l);b.push({rect:{x:D,y:M,width:T-D,height:O-M},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(E&&R){const D=Math.max(h,a),M=p,T=v,O=Math.min(C,l);b.push({rect:{x:D,y:M,width:T-D,height:O-M},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(I&&S){const D=h,M=Math.max(p,l),T=Math.min(v,o),O=Math.min(C,s);b.push({rect:{x:D,y:M,width:T-D,height:O-M},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(R&&S){const D=Math.max(h,a),M=Math.max(p,l),T=v,O=Math.min(C,s);b.push({rect:{x:D,y:M,width:T-D,height:O-M},clip:{x:d,y:c,width:n-d+1,height:g-c+1}})}if(I&&P){const D=h,M=Math.max(p,s),T=Math.min(v,o),O=C;b.push({rect:{x:D,y:M,width:T-D,height:O-M},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(P&&x){const D=Math.max(h,o),M=Math.max(p,s),T=Math.min(v,a),O=C;b.push({rect:{x:D,y:M,width:T-D,height:O-M},clip:{x:u,y:g,width:d-u+1,height:r-g+1}})}if(R&&P){const D=Math.max(h,a),M=Math.max(p,s),T=v,O=C;b.push({rect:{x:D,y:M,width:T-D,height:O-M},clip:{x:d,y:g,width:n-d+1,height:r-g+1}})}return b}const y0={kind:Z.Loading,allowOverlay:!1};function _u(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,w,b,v,C,I,E,R,P,x,S,F,D,M,T,O,k,N,X,Y){let ue=C?.size??Number.MAX_SAFE_INTEGER;const ee=performance.now();let te=T.baseFontFull;e.font=te;const ce={ctx:e},se=[0,0],he=w>0?Qr(s,w,u):0;let de,ie;const H=zd(v);return Pr(t,a,o,l,i,(L,G,ne,oe,Se)=>{const me=Math.max(0,oe-G),et=G+me,xe=i+1,bt=L.width-me,St=r-i-1;if(v.length>0){let $e=!1;for(let Fe=0;Fe<v.length;Fe++){const tt=v[Fe];if(go(et,xe,bt,St,tt.x,tt.y,tt.width,tt.height)){$e=!0;break}}if(!$e)return}const Ue=()=>{e.save(),e.beginPath(),e.rect(et,xe,bt,St),e.clip()},re=I.columns.hasIndex(L.sourceIndex),le=d(L.group??"").overrideTheme,be=L.themeOverride===void 0&&le===void 0?T:hr(T,le,L.themeOverride),fe=be.baseFontFull;fe!==te&&(te=fe,e.font=fe),Ue();let we;return ka(Se,ne,r,s,u,w,b,H,($e,Fe,tt,Me,Xe)=>{if(Fe<0||(se[0]=L.sourceIndex,se[1]=Fe,C!==void 0&&!C.has(se)))return;if(v.length>0){let De=!1;for(let ct=0;ct<v.length;ct++){const pt=v[ct];if(go(G,$e,L.width,tt,pt.x,pt.y,pt.width,pt.height)){De=!0;break}}if(!De)return}const Te=I.rows.hasIndex(Fe),Ee=h.hasIndex(Fe),Pe=Fe<s?c(se):y0;let ht=G,nt=L.width,je=!1,kt=!1;if(Pe.span!==void 0){const[De,ct]=Pe.span,pt=`${Fe},${De},${ct},${L.sticky}`;if(ie===void 0&&(ie=new Set),ie.has(pt)){ue--;return}else{const Dn=$d(Pe.span,G,$e,L.width,tt,L,n),ln=L.sticky?Dn[0]:Dn[1];if(!L.sticky&&Dn[0]!==void 0&&(kt=!0),ln!==void 0){ht=ln.x,nt=ln.width,ie.add(pt),e.restore(),we=void 0,e.save(),e.beginPath();const sn=Math.max(0,oe-ln.x);e.rect(ln.x+sn,$e,ln.width-sn,tt),de===void 0&&(de=[]),de.push({x:ln.x+sn,y:$e,width:ln.width-sn,height:tt}),e.clip(),je=!0}}}const wt=g?.(Fe),Dt=Xe&&L.trailingRowOptions?.themeOverride!==void 0?L.trailingRowOptions?.themeOverride:void 0,Ot=Pe.themeOverride===void 0&&wt===void 0&&Dt===void 0?be:hr(be,wt,Dt,Pe.themeOverride);e.beginPath();const an=hm(se,Pe,I);let Kt=gm(se,Pe,I,m);const In=Pe.span!==void 0&&I.columns.some(De=>Pe.span!==void 0&&De>=Pe.span[0]&&De<=Pe.span[1]);an&&!p&&m?Kt=0:an&&m&&(Kt=Math.max(Kt,1)),In&&Kt++,an||(Te&&Kt++,re&&!Xe&&Kt++);const It=Pe.kind===Z.Protected?Ot.bgCellMedium:Ot.bgCell;let gt;if((Me||It!==T.bgCell)&&(gt=zn(It,gt)),Kt>0||Ee){Ee&&(gt=zn(Ot.bgHeader,gt));for(let De=0;De<Kt;De++)gt=zn(Ot.accentLight,gt)}else if(E!==void 0){for(const De of E)if(De[0]===L.sourceIndex&&De[1]===Fe){gt=zn(Ot.bgSearchResult,gt);break}}if(R!==void 0)for(let De=0;De<R.length;De++){const ct=R[De],pt=ct.range;ct.style!=="solid-outline"&&pt.x<=L.sourceIndex&&L.sourceIndex<pt.x+pt.width&&pt.y<=Fe&&Fe<pt.y+pt.height&&(gt=zn(ct.color,gt))}let Tn=!1;if(C!==void 0){const De=$e+1,pt=(Me?De+tt-1:Math.min(De+tt-1,r-he))-De;(pt!==tt-1||ht+1<=oe)&&(Tn=!0,e.save(),e.beginPath(),e.rect(ht+1,De,nt-1,pt),e.clip()),gt=gt===void 0?Ot.bgCell:zn(gt,Ot.bgCell)}const yt=L.sourceIndex===n.length-1,Zt=Fe===s-1;gt!==void 0&&(e.fillStyle=gt,we!==void 0&&(we.fillStyle=gt),C!==void 0?e.fillRect(ht+1,$e+1,nt-(yt?2:1),tt-(Zt?2:1)):e.fillRect(ht,$e,nt,tt)),Pe.style==="faded"&&(e.globalAlpha=.6);let Sn;for(let De=0;De<S.length;De++){const ct=S[De];if(ct.item[0]===L.sourceIndex&&ct.item[1]===Fe){Sn=ct;break}}if(nt>Y&&!kt){const De=Ot.baseFontFull;De!==te&&(e.font=De,te=De),we=Bd(e,Pe,L.sourceIndex,Fe,yt,Zt,ht,$e,nt,tt,Kt>0,Ot,gt??Ot.bgCell,P,x,Sn?.hoverAmount??0,F,M,ee,D,we,O,k,N,X)}return Tn&&e.restore(),Pe.style==="faded"&&(e.globalAlpha=1),ue--,je&&(e.restore(),we?.deprep?.(ce),we=void 0,Ue(),te=fe,e.font=fe),ue<=0}),e.restore(),ue<=0}),de}const Zi=[0,0],Ji={x:0,y:0,width:0,height:0},cl=[void 0,()=>{}];let Al=!1;function C0(){Al=!0}function Bd(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,w,b,v,C,I,E,R,P,x){let S,F;w!==void 0&&w[0][0]===n&&w[0][1]===r&&(S=w[1][0],F=w[1][1]);let D;Zi[0]=n,Zi[1]=r,Ji.x=l,Ji.y=a,Ji.width=s,Ji.height=u,cl[0]=R.getValue(Zi),cl[1]=k=>R.setValue(Zi,k),Al=!1;const M={ctx:e,theme:d,col:n,row:r,cell:t,rect:Ji,highlighted:c,cellFillColor:g,hoverAmount:m,frameTime:v,hoverX:S,drawState:cl,hoverY:F,imageLoader:h,spriteManager:p,hyperWrapping:b,overrideCursor:S!==void 0?x:void 0,requestAnimationFrame:C0},T=ym(M,t.lastUpdated,v,I,i,o),O=P(t);if(O!==void 0){I?.renderer!==O&&(I?.deprep?.(M),I=void 0);const k=O.drawPrep?.(M,I);C!==void 0&&!Mi(M.cell)?C(M,()=>O.draw(M,t)):O.draw(M,t),D=k===void 0?void 0:{deprep:k?.deprep,fillStyle:k?.fillStyle,font:k?.font,renderer:O}}return(T||Al)&&E?.(Zi),D}function is(e,t,n,r,i,o,l,a,s=-20,u=-20,c=void 0,d="center",g="square"){const h=Math.floor(i+l/2),p=g==="circle"?1e4:t.roundingRadius??4;let m=gd(c??t.checkboxMaxSize,l,t.cellVerticalPadding),w=m/2;const b=hd(d,r,o,t.cellHorizontalPadding,m),v=fd(b,h,m),C=pd(r+s,i+u,v);switch(n){case!0:{e.beginPath(),Jn(e,b-m/2,h-m/2,m,m,p),g==="circle"&&(w*=.8,m*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(b-w+m/4.23,h-w+m/1.97),e.lineTo(b-w+m/2.42,h-w+m/1.44),e.lineTo(b-w+m/1.29,h-w+m/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case oa:case!1:{e.beginPath(),Jn(e,b-m/2+.5,h-m/2+.5,m-1,m-1,p),e.lineWidth=1,e.strokeStyle=C?t.textDark:t.textMedium,e.stroke();break}case Xl:{e.beginPath(),Jn(e,b-m/2,h-m/2,m,m,p),e.fillStyle=C?t.textMedium:t.textLight,e.fill(),g==="circle"&&(w*=.8,m*=.8),e.beginPath(),e.moveTo(b-m/3,h),e.lineTo(b+m/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:co()}}function S0(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,w,b,v){const C=l+a;if(C<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,C);const I=r?.[0]?.[0],E=r?.[0]?.[1],R=r?.[1]?.[0],P=r?.[1]?.[1],x=d.headerFontFull;e.font=x,Pr(t,0,o,0,C,(S,F,D,M)=>{if(w!==void 0&&!w.has([S.sourceIndex,-1]))return;const T=Math.max(0,M-F);e.save(),e.beginPath(),e.rect(F+T,a,S.width-T,l),e.clip();const O=m(S.group??"").overrideTheme,k=S.themeOverride===void 0&&O===void 0?d:hr(d,O,S.themeOverride);k.bgHeader!==d.bgHeader&&(e.fillStyle=k.bgHeader,e.fill()),k!==d&&(e.font=k.headerFontFull);const N=c.columns.hasIndex(S.sourceIndex),X=s!==void 0||u||S.headerRowMarkerDisabled===!0,Y=!X&&E===-1&&I===S.sourceIndex,ue=X?0:h.find(he=>he.item[0]===S.sourceIndex&&he.item[1]===-1)?.hoverAmount??0,ee=c?.current!==void 0&&c.current.cell[0]===S.sourceIndex,te=N?k.accentColor:ee?k.bgHeaderHasFocus:k.bgHeader,ce=n?a:0,se=S.sourceIndex===0?0:1;N?(e.fillStyle=te,e.fillRect(F+se,ce,S.width-se,l)):(ee||ue>0)&&(e.beginPath(),e.rect(F+se,ce,S.width-se,l),ee&&(e.fillStyle=k.bgHeaderHasFocus,e.fill()),ue>0&&(e.globalAlpha=ue,e.fillStyle=k.bgHeaderHovered,e.fill(),e.globalAlpha=1)),qd(e,F,ce,S.width,l,S,N,k,Y,Y?R:void 0,Y?P:void 0,ee,ue,g,b,v),e.restore()}),n&&x0(e,t,i,o,a,r,d,g,h,p,m,w)}function x0(e,t,n,r,i,o,l,a,s,u,c,d){const[h,p]=o?.[0]??[];let m=0;Vd(t,n,r,i,(w,b,v,C,I,E)=>{if(d!==void 0&&!d.hasItemInRectangle({x:w[0],y:-2,width:w[1]-w[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(v,C,I,E),e.clip();const R=c(b),P=R?.overrideTheme===void 0?l:hr(l,R.overrideTheme),x=p===-2&&h!==void 0&&h>=w[0]&&h<=w[1],S=x?P.bgGroupHeaderHovered??P.bgHeaderHovered:P.bgGroupHeader??P.bgHeader;if(S!==l.bgHeader&&(e.fillStyle=S,e.fill()),e.fillStyle=P.textGroupHeader??P.textHeader,R!==void 0){let F=v;if(R.icon!==void 0&&(a.drawSprite(R.icon,"normal",e,F+8,(i-20)/2,20,P),F+=26),e.fillText(R.name,F+8,i/2+er(e,l.headerFontFull)),R.actions!==void 0&&x){const D=Wd({x:v,y:C,width:I,height:E},R.actions);e.beginPath();const M=D[0].x-10,T=v+I-M;e.rect(M,0,T,i);const O=e.createLinearGradient(M,0,M+T,0),k=jr(S,0);O.addColorStop(0,k),O.addColorStop(10/T,S),O.addColorStop(1,S),e.fillStyle=O,e.fill(),e.globalAlpha=.6;const[N,X]=o?.[1]??[-1,-1];for(let Y=0;Y<R.actions.length;Y++){const ue=R.actions[Y],ee=D[Y],te=Yr(ee,N+v,X);te&&(e.globalAlpha=1),a.drawSprite(ue.icon,"normal",e,ee.x+ee.width/2-10,ee.y+ee.height/2-10,20,P),te&&(e.globalAlpha=.6)}e.globalAlpha=1}}v!==0&&u(w[0])&&(e.beginPath(),e.moveTo(v+.5,0),e.lineTo(v+.5,i),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()),e.restore(),m=v+I}),e.beginPath(),e.moveTo(m+.5,0),e.lineTo(m+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()}const Wo=30;function k0(e,t,n,r,i){return{x:e+n-Wo,y:Math.max(t,t+r/2-Wo/2),width:Wo,height:Math.min(Wo,r)}}function Wd(e,t){const n=[];let r=e.x+e.width-26*t.length;const i=e.y+e.height/2-13,o=26,l=26;for(let a=0;a<t.length;a++)n.push({x:r,y:i,width:l,height:o}),r+=26;return n}function Qi(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function Ud(e,t,n,r,i,o,l,a){const s=l.cellHorizontalPadding,u=l.headerIconSize,c=k0(n,r,i,o);let d=n+s;const g=t.icon===void 0?void 0:{x:d,y:r+(o-u)/2,width:u,height:u},h=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==void 0&&(d+=Math.ceil(u*1.3));const p={x:d,y:r,width:i-d,height:o};let m;if(t.indicatorIcon!==void 0){const b=e===void 0?Id(t.title,l.headerFontFull)?.width??0:Or(t.title,e,l.headerFontFull).width;p.width=b,d+=b+s,m={x:d,y:r+(o-u)/2,width:u,height:u}}const w=n+i/2;return{menuBounds:Qi(c,w,a),iconBounds:Qi(g,w,a),iconOverlayBounds:Qi(h,w,a),textBounds:Qi(p,w,a),indicatorIconBounds:Qi(m,w,a)}}function Au(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const v=o.rowMarkerChecked;v!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const C=o.headerRowMarkerTheme!==void 0?hr(a,o.headerRowMarkerTheme):a;is(e,C,v,t,n,r,i,!1,void 0,void 0,a.checkboxMaxSize,"center",o.rowMarker),v!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const w=l?a.textHeaderSelected:a.textHeader,b=o.hasMenu===!0&&(s||h&&l)&&m.menuBounds!==void 0;if(o.icon!==void 0&&m.iconBounds!==void 0){let v=l?"selected":"normal";o.style==="highlight"&&(v=l?"selected":"special"),g.drawSprite(o.icon,v,e,m.iconBounds.x,m.iconBounds.y,m.iconBounds.width,a),o.overlayIcon!==void 0&&m.iconOverlayBounds!==void 0&&g.drawSprite(o.overlayIcon,l?"selected":"special",e,m.iconOverlayBounds.x,m.iconOverlayBounds.y,m.iconOverlayBounds.width,a)}if(b&&r>35){const C=p?35:r-35,I=p?35*.7:r-35*.7,E=C/r,R=I/r,P=e.createLinearGradient(t,0,t+r,0),x=jr(w,0);P.addColorStop(p?1:0,w),P.addColorStop(E,w),P.addColorStop(R,x),P.addColorStop(p?0:1,x),e.fillStyle=P}else e.fillStyle=w;if(p&&(e.textAlign="right"),m.textBounds!==void 0&&e.fillText(o.title,p?m.textBounds.x+m.textBounds.width:m.textBounds.x,n+i/2+er(e,a.headerFontFull)),p&&(e.textAlign="left"),o.indicatorIcon!==void 0&&m.indicatorIconBounds!==void 0&&(!b||!go(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=l?"selected":"normal";o.style==="highlight"&&(v=l?"selected":"special"),g.drawSprite(o.indicatorIcon,v,e,m.indicatorIconBounds.x,m.indicatorIconBounds.y,m.indicatorIconBounds.width,a)}if(b&&m.menuBounds!==void 0){const v=m.menuBounds,C=u!==void 0&&c!==void 0&&Yr(v,u+t,c+n);if(C||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===aa.Triangle){e.beginPath();const I=v.x+v.width/2-5.5,E=v.y+v.height/2-3;km(e,[{x:I,y:E},{x:I+11,y:E},{x:I+5.5,y:E+6}],1),e.fillStyle=w,e.fill()}else if(o.menuIcon===aa.Dots){e.beginPath();const I=v.x+v.width/2,E=v.y+v.height/2;xm(e,I,E),e.fillStyle=w,e.fill()}else{const I=v.x+(v.width-a.headerIconSize)/2,E=v.y+(v.height-a.headerIconSize)/2;g.drawSprite(o.menuIcon,"normal",e,I,E,a.headerIconSize,a)}C||(e.globalAlpha=1)}}function qd(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m){const w=Kl(o.title)==="rtl",b=Ud(e,o,t,n,r,i,a,w);p!==void 0?p({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:i},column:o,columnIndex:o.sourceIndex,isSelected:l,hoverAmount:g,isHovered:s,hasSelectedCell:d,spriteManager:h,menuBounds:b?.menuBounds??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>Au(e,t,n,r,i,o,l,a,s,u,c,g,h,m,w,b)):Au(e,t,n,r,i,o,l,a,s,u,c,g,h,m,w,b)}function M0(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,w,b,v){if(b!==void 0||t[t.length-1]!==n[t.length-1])return;const C=zd(w);Pr(t,s,l,a,o,(I,E,R,P,x)=>{if(I!==t[t.length-1])return;E+=I.width;const S=Math.max(E,P);S>r||(e.save(),e.beginPath(),e.rect(S,o+1,1e4,i-o-1),e.clip(),ka(x,R,i,u,c,p,m,C,(F,D,M,T)=>{if(!T&&w.length>0&&!w.some(Y=>go(E,F,1e4,M,Y.x,Y.y,Y.width,Y.height)))return;const O=g.hasIndex(D),k=h.hasIndex(D);e.beginPath();const N=d?.(D),X=N===void 0?v:hr(v,N);X.bgCell!==v.bgCell&&(e.fillStyle=X.bgCell,e.fillRect(E,F,1e4,M)),k&&(e.fillStyle=X.bgHeader,e.fillRect(E,F,1e4,M)),O&&(e.fillStyle=X.accentLight,e.fillRect(E,F,1e4,M))}),e.restore())})}function R0(e,t,n,r,i,o,l,a,s){let u=!1;for(const p of t)if(!p.sticky){u=l(p.sourceIndex);break}const c=s.horizontalBorderColor??s.borderColor,d=s.borderColor,g=u?Oi(t):0;let h;if(g!==0&&(h=ku(d,s.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=h,e.stroke()),i>0){const p=d===c&&h!==void 0?h:ku(c,s.bgCell),m=Qr(o,i,a);e.beginPath(),e.moveTo(0,r-m+.5),e.lineTo(n,r-m+.5),e.strokeStyle=p,e.stroke()}}const Xd=(e,t,n)=>{let r=0,i=t,o=0,l=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),i=Math.max(i,a.x+a.width+1),o=Math.min(o,a.y-1),l=Math.max(l,a.y+a.height+1)}return{minX:r,maxX:i,minY:o,maxY:l}};function E0(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p){const m=p.bgCell,{minX:w,maxX:b,minY:v,maxY:C}=Xd(a,o,l),I=[],E=l-Qr(h,g,u);let R=s,P=n,x=0;for(;R+i<E;){const M=R+i,T=u(P);if(M>=v&&M<=C-1){const k=c?.(P)?.bgCell;k!==void 0&&k!==m&&P>=h-g&&I.push({x:w,y:M,w:b-w,h:T,color:k})}R+=T,P<h-g&&(x=R),P++}let S=0;const F=Math.min(E,C)-x;if(F>0)for(let M=0;M<t.length;M++){const T=t[M];if(T.width===0)continue;const O=T.sticky?S:S+r,k=T.themeOverride?.bgCell;k!==void 0&&k!==m&&O>=w&&O<=b&&d(M+1)&&I.push({x:O,y:x,w:T.width,h:F,color:k}),S+=T.width}if(I.length===0)return;let D;e.beginPath();for(let M=I.length-1;M>=0;M--){const T=I[M];D===void 0?D=T.color:T.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=T.color),e.rect(T.x,T.y,T.w,T.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function Hu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,w,b=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,l);for(const M of s)e.rect(M.x+1,M.y+1,M.width-1,M.height-1);e.clip("evenodd")}const v=w.horizontalBorderColor??w.borderColor,C=w.borderColor,{minX:I,maxX:E,minY:R,maxY:P}=Xd(a,o,l),x=[];e.beginPath();let S=.5;for(let M=0;M<t.length;M++){const T=t[M];if(T.width===0)continue;S+=T.width;const O=T.sticky?S:S+r;O>=I&&O<=E&&h(M+1)&&x.push({x1:O,y1:Math.max(u,R),x2:O,y2:Math.min(l,P),color:C})}let F=l+.5;for(let M=m-p;M<m;M++){const T=d(M);F-=T,x.push({x1:I,y1:F,x2:E,y2:F,color:v})}if(b!==!0){let M=c+.5,T=n;const O=F;for(;M+i<O;){const k=M+i;if(k>=R&&k<=P-1){const N=g?.(T);x.push({x1:I,y1:k,x2:E,y2:k,color:N?.horizontalBorderColor??N?.borderColor??v})}M+=d(T),T++}}const D=qh(x,M=>M.color);for(const M of Object.keys(D)){e.strokeStyle=M;for(const T of D[M])e.moveTo(T.x1,T.y1),e.lineTo(T.x2,T.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function I0(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,w,b,v){const C=[];e.imageSmoothingEnabled=!1;const I=Math.min(i.cellYOffset,l),E=Math.max(i.cellYOffset,l);let R=0;if(typeof b=="number")R+=(E-I)*b;else for(let O=I;O<E;O++)R+=b(O);l>i.cellYOffset&&(R=-R),R+=s-i.translateY;const P=Math.min(i.cellXOffset,o),x=Math.max(i.cellXOffset,o);let S=0;for(let O=P;O<x;O++)S+=m[O].width;o>i.cellXOffset&&(S=-S),S+=a-i.translateX;const F=Oi(w);if(S!==0&&R!==0)return{regions:[]};const D=u>0?Qr(g,u,b):0,M=c-F-Math.abs(S),T=d-h-D-Math.abs(R)-1;if(M>150&&T>150){const O={sx:0,sy:0,sw:c*p,sh:d*p,dx:0,dy:0,dw:c*p,dh:d*p};if(R>0?(O.sy=(h+1)*p,O.sh=T*p,O.dy=(R+h+1)*p,O.dh=T*p,C.push({x:0,y:h,width:c,height:R+1})):R<0&&(O.sy=(-R+h+1)*p,O.sh=T*p,O.dy=(h+1)*p,O.dh=T*p,C.push({x:0,y:d+R-D,width:c,height:-R+D})),S>0?(O.sx=F*p,O.sw=M*p,O.dx=(S+F)*p,O.dw=M*p,C.push({x:F-1,y:0,width:S+2,height:d})):S<0&&(O.sx=(F-S)*p,O.sw=M*p,O.dx=F*p,O.dw=M*p,C.push({x:c+S,y:0,width:-S,height:d})),e.setTransform(1,0,0,1,0,0),v){if(F>0&&S!==0&&R===0&&(r===void 0||n?.[1]!==!1)){const k=F*p,N=d*p;e.drawImage(t,0,0,k,N,0,0,k,N)}if(D>0&&S===0&&R!==0&&(r===void 0||n?.[0]!==!1)){const k=(d-D)*p,N=c*p,X=D*p;e.drawImage(t,0,k,N,X,0,k,N,X)}}e.drawImage(t,O.sx,O.sy,O.sw,O.sh,O.dx,O.dy,O.dw,O.dh),e.scale(p,p)}return e.imageSmoothingEnabled=!0,{regions:C}}function T0(e,t,n,r,i,o,l,a,s,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Pr(s,n,r,i,a,(d,g,h,p)=>{if(d.sourceIndex===u){const m=Math.max(g,p)+1;return c.push({x:m,y:0,width:o-m,height:l}),!0}}),c}function D0(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let r=0;r<e.mappedColumns.length;r++){const i=e.mappedColumns[r],o=t.mappedColumns[r];if(Di(i,o))continue;if(n!==void 0||i.width===o.width)return!1;const{width:l,...a}=i,{width:s,...u}=o;if(!Di(a,u))return!1;n=r}return n===void 0?!0:n}return!0}function zu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m){const w=p?.filter(P=>P.style!=="no-outline");if(w===void 0||w.length===0)return;const b=Oi(a),v=Qr(h,g,d),C=[s,0,a.length,h-g],I=[b,0,t,n-v],E=w.map(P=>{const x=P.range,S=P.style??"dashed";return w0(x,C,t,n,I).map(F=>{const D=F.rect,M=Fl(D.x,D.y,t,n,c,u+c,r,i,o,l,h,s,g,a,d),T=D.width===1&&D.height===1?M:Fl(D.x+D.width-1,D.y+D.height-1,t,n,c,u+c,r,i,o,l,h,s,g,a,d);return D.x+D.width>=a.length&&(T.width-=1),D.y+D.height>=h&&(T.height-=1),{color:P.color,style:S,clip:F.clip,rect:b0({x:M.x,y:M.y,width:T.x+T.width-M.x,height:T.y+T.height-M.y},t,n,8)}})}),R=()=>{e.lineWidth=1;let P=!1;for(const x of E)for(const S of x)if(S?.rect!==void 0&&go(0,0,t,n,S.rect.x,S.rect.y,S.rect.width,S.rect.height)){const F=P,D=!v0(S.clip,S.rect);e.beginPath(),D&&(e.save(),e.rect(S.clip.x,S.clip.y,S.clip.width,S.clip.height),e.clip()),S.style==="dashed"&&!P?(e.setLineDash([5,3]),P=!0):(S.style==="solid"||S.style==="solid-outline")&&P&&(e.setLineDash([]),P=!1),e.strokeStyle=S.style==="solid-outline"?zn(zn(S.color,m.borderColor),m.bgCell):jr(S.color,1),e.closePath(),e.strokeRect(S.rect.x+.5,S.rect.y+.5,S.rect.width-1,S.rect.height-1),D&&(e.restore(),P=F)}P&&e.setLineDash([])};return R(),R}function Vu(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function dl(e,t,n,r,i,o,l,a,s,u,c,d,g,h,p,m,w){if(c.current===void 0)return;const b=m!==!1&&m!==void 0;if(!b)return;const v=typeof m=="object"?{...la,...m}:la,C=c.current.range,I=c.current.cell,E=[C.x+C.width-1,C.y+C.height-1];if(I[1]>=w&&E[1]>=w||!l.some(N=>N.sourceIndex===I[0]||N.sourceIndex===E[0]))return;const[P,x]=c.current.cell,S=g(c.current.cell),F=S.span??[P,P],D=x>=w-h,M=h>0&&!D?Qr(w,h,d)-1:0,T=E[1];let O;if(Pr(l,r,i,o,u,(N,X,Y,ue,ee)=>{if(N.sticky&&P>N.sourceIndex)return;const te=N.sourceIndex<F[0],ce=N.sourceIndex>F[1],se=N.sourceIndex===E[0];if(!(!se&&(te||ce)))return ka(ee,Y,n,w,d,h,p,void 0,(he,de,ie)=>{if(de!==x&&de!==T)return;let H=X,L=N.width;if(S.span!==void 0){const ne=$d(S.span,X,he,N.width,ie,N,a),oe=N.sticky?ne[0]:ne[1];oe!==void 0&&(H=oe.x,L=oe.width)}return de===T&&se&&b&&(O=()=>{ue>H&&!N.sticky&&(e.beginPath(),e.rect(ue,0,t-ue,n),e.clip());const ne=v.size,oe=ne/2,Se=H+L+v.offsetX-oe+.5,me=he+ie+v.offsetY-oe+.5;e.beginPath(),v.shape==="circle"?e.arc(Se+oe,me+oe,oe,0,Math.PI*2):e.rect(Se,me,ne,ne),e.fillStyle=N.themeOverride?.accentColor??s.accentColor,e.fill(),v.outline>0&&(e.lineWidth=v.outline,e.strokeStyle=s.bgCell,v.shape==="circle"?(e.beginPath(),e.arc(Se+oe,me+oe,oe+v.outline/2,0,Math.PI*2),e.stroke()):e.strokeRect(Se-v.outline/2,me-v.outline/2,ne+v.outline,ne+v.outline))}),O!==void 0}),O!==void 0}),O===void 0)return;const k=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-M),e.clip(),O?.(),e.restore()};return k(),k}function O0(e,t,n,r,i,o,l,a,s){s===void 0||s.size===0||(e.beginPath(),Vd(t,n,o,r,(u,c,d,g,h,p)=>{s.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,g,h,p)}),Pr(t,a,o,l,i,(u,c,d,g)=>{const h=Math.max(0,g-c),p=c+h+1,m=u.width-h-1;s.has([u.sourceIndex,-1])&&e.rect(p,r,m,i-r)}),e.clip())}function P0(e,t,n,r,i,o,l,a,s,u){let c=0;return Pr(e,o,r,i,n,(d,g,h,p,m)=>(ka(m,h,t,l,a,s,u,void 0,(w,b,v,C)=>{C||(c=Math.max(b,c))}),!0)),c}function $u(e,t){const{canvasCtx:n,headerCanvasCtx:r,width:i,height:o,cellXOffset:l,cellYOffset:a,translateX:s,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:g,dragAndDropState:h,theme:p,drawFocus:m,headerHeight:w,groupHeaderHeight:b,disabledRows:v,rowHeight:C,verticalBorder:I,overrideCursor:E,isResizing:R,selection:P,fillHandle:x,freezeTrailingRows:S,rows:F,getCellContent:D,getGroupDetails:M,getRowThemeOverride:T,isFocused:O,drawHeaderCallback:k,prelightCells:N,drawCellCallback:X,highlightRegions:Y,resizeCol:ue,imageLoader:ee,lastBlitData:te,hoverValues:ce,hyperWrapping:se,hoverInfo:he,spriteManager:de,maxScaleFactor:ie,hasAppendRow:H,touchMode:L,enqueue:G,renderStateProvider:ne,getCellRenderer:oe,renderStrategy:Se,bufferACtx:me,bufferBCtx:et,damage:xe,minimumCellWidth:bt,resizeIndicator:St}=e;if(i===0||o===0)return;const Ue=Se==="double-buffer",re=Math.min(ie,Math.ceil(window.devicePixelRatio??1)),le=Se!=="direct"&&D0(e,t),be=n.canvas;(be.width!==i*re||be.height!==o*re)&&(be.width=i*re,be.height=o*re,be.style.width=i+"px",be.style.height=o+"px");const fe=r.canvas,we=d?b+w:w,$e=we+1;(fe.width!==i*re||fe.height!==$e*re)&&(fe.width=i*re,fe.height=$e*re,fe.style.width=i+"px",fe.style.height=$e+"px");const Fe=me.canvas,tt=et.canvas;Ue&&(Fe.width!==i*re||Fe.height!==o*re)&&(Fe.width=i*re,Fe.height=o*re,te.current!==void 0&&(te.current.aBufferScroll=void 0)),Ue&&(tt.width!==i*re||tt.height!==o*re)&&(tt.width=i*re,tt.height=o*re,te.current!==void 0&&(te.current.bBufferScroll=void 0));const Me=te.current;if(le===!0&&l===Me?.cellXOffset&&a===Me?.cellYOffset&&s===Me?.translateX&&u===Me?.translateY)return;let Xe=null;Ue&&(Xe=n);const Te=r;let Ee;Ue?xe!==void 0?Ee=Me?.lastBuffer==="b"?et:me:Ee=Me?.lastBuffer==="b"?me:et:Ee=n;const Pe=Ee.canvas,ht=Ue?Pe===Fe?tt:Fe:be,nt=typeof C=="number"?()=>C:C;Te.save(),Ee.save(),Te.beginPath(),Ee.beginPath(),Te.textBaseline="middle",Ee.textBaseline="middle",re!==1&&(Te.scale(re,re),Ee.scale(re,re));const je=Ll(c,l,i,h,s);let kt=[];const wt=m&&P.current?.cell[1]===a&&u===0;let Dt=!1;if(Y!==void 0){for(const yt of Y)if(yt.style!=="no-outline"&&yt.range.y===a&&u===0){Dt=!0;break}}const Ot=()=>{S0(Te,je,d,he,i,s,w,b,h,R,P,p,de,ce,I,M,xe,k,L),Hu(Te,je,a,s,u,i,o,void 0,void 0,b,we,nt,T,I,S,F,p,!0),Te.beginPath(),Te.moveTo(0,$e-.5),Te.lineTo(i,$e-.5),Te.strokeStyle=zn(p.headerBottomBorderColor??p.horizontalBorderColor??p.borderColor,p.bgHeader),Te.stroke(),Dt&&zu(Te,i,o,l,a,s,u,c,g,w,b,C,S,F,Y,p),wt&&dl(Te,i,o,a,s,u,je,c,p,we,P,nt,D,S,H,x,F)};if(xe!==void 0){const yt=je[je.length-1].sourceIndex+1,Zt=xe.hasItemInRegion([{x:l,y:-2,width:yt,height:2},{x:l,y:a,width:yt,height:300},{x:0,y:a,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:l,y:F-S,width:yt,height:S,when:S>0}]),Sn=De=>{_u(De,je,c,o,we,s,u,a,F,nt,D,M,T,v,O,m,S,H,kt,xe,P,N,Y,ee,de,ce,he,X,se,p,G,ne,oe,E,bt);const ct=P.current;x!==!1&&x!==void 0&&m&&ct!==void 0&&xe.has(Md(ct.range))&&dl(De,i,o,a,s,u,je,c,p,we,P,nt,D,S,H,x,F)};Zt&&(Sn(Ee),Xe!==null&&(Xe.save(),Xe.scale(re,re),Xe.textBaseline="middle",Sn(Xe),Xe.restore()),xe.hasHeader()&&(O0(Te,je,i,b,we,s,u,a,xe),Ot())),Ee.restore(),Te.restore();return}if((le!==!0||l!==Me?.cellXOffset||s!==Me?.translateX||wt!==Me?.mustDrawFocusOnHeader||Dt!==Me?.mustDrawHighlightRingsOnHeader)&&Ot(),le===!0){Hn(ht!==void 0&&Me!==void 0);const{regions:yt}=I0(Ee,ht,ht===Fe?Me.aBufferScroll:Me.bBufferScroll,ht===Fe?Me.bBufferScroll:Me.aBufferScroll,Me,l,a,s,u,S,i,o,F,we,re,c,je,C,Ue);kt=yt}else le!==!1&&(Hn(Me!==void 0),kt=T0(Me,l,a,s,u,i,o,we,je,le));R0(Ee,je,i,o,S,F,I,nt,p);const an=zu(Ee,i,o,l,a,s,u,c,g,w,b,C,S,F,Y,p),Kt=m?dl(Ee,i,o,a,s,u,je,c,p,we,P,nt,D,S,H,x,F):void 0;if(Ee.fillStyle=p.bgCell,kt.length>0){Ee.beginPath();for(const yt of kt)Ee.rect(yt.x,yt.y,yt.width,yt.height);Ee.clip(),Ee.fill(),Ee.beginPath()}else Ee.fillRect(0,0,i,o);const In=_u(Ee,je,c,o,we,s,u,a,F,nt,D,M,T,v,O,m,S,H,kt,xe,P,N,Y,ee,de,ce,he,X,se,p,G,ne,oe,E,bt);M0(Ee,je,c,i,o,we,s,u,a,F,nt,T,P.rows,v,S,H,kt,xe,p),E0(Ee,je,a,s,u,i,o,kt,we,nt,T,I,S,F,p),Hu(Ee,je,a,s,u,i,o,kt,In,b,we,nt,T,I,S,F,p),an?.(),Kt?.(),R&&St!=="none"&&Pr(je,0,s,0,we,(yt,Zt)=>yt.sourceIndex===ue?(Vu(Te,Zt+yt.width,0,we+1,zn(p.resizeIndicatorColor??p.accentLight,p.bgHeader)),St==="full"&&Vu(Ee,Zt+yt.width,we,o,zn(p.resizeIndicatorColor??p.accentLight,p.bgCell)),!0):!1),Xe!==null&&(Xe.fillStyle=p.bgCell,Xe.fillRect(0,0,i,o),Xe.drawImage(Ee.canvas,0,0));const It=P0(je,o,we,s,u,a,F,nt,S,H);ee?.setWindow({x:l,y:a,width:je.length,height:It-a},g,Array.from({length:S},(yt,Zt)=>F-1-Zt));const gt=Me!==void 0&&(l!==Me.cellXOffset||s!==Me.translateX),Tn=Me!==void 0&&(a!==Me.cellYOffset||u!==Me.translateY);te.current={cellXOffset:l,cellYOffset:a,translateX:s,translateY:u,mustDrawFocusOnHeader:wt,mustDrawHighlightRingsOnHeader:Dt,lastBuffer:Ue?Pe===Fe?"a":"b":void 0,aBufferScroll:Pe===Fe?[gt,Tn]:Me?.aBufferScroll,bBufferScroll:Pe===tt?[gt,Tn]:Me?.bBufferScroll},Ee.restore(),Te.restore()}const L0=80;function F0(e){const t=e-1;return t*t*t+1}class _0{callback;constructor(t){this.callback=t}currentHoveredItem=void 0;leavingItems=[];lastAnimationTime;addToLeavingItems=t=>{this.leavingItems.some(r=>lo(r.item,t.item))||this.leavingItems.push(t)};removeFromLeavingItems=t=>{const n=this.leavingItems.find(r=>lo(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:F0(t.hoverAmount)}));step=t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const r=(t-this.lastAnimationTime)/L0;for(const o of this.leavingItems)o.hoverAmount=Wn(o.hoverAmount-r,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Wn(this.currentHoveredItem.hoverAmount+r,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0};setHovered=t=>{if(!lo(this.currentHoveredItem?.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const n=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:n}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}}}class A0{fn;val;constructor(t){this.fn=t}get value(){return this.val??(this.val=this.fn())}}function os(e){return new A0(e)}const H0=os(()=>window.navigator.userAgent.includes("Firefox")),ua=os(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ca=os(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function z0(e){const t=f.useRef([]),n=f.useRef(0),r=f.useRef(e);r.current=e;const i=f.useCallback(()=>{const o=()=>window.requestAnimationFrame(l),l=()=>{const a=t.current.map(rs);t.current=[],r.current(new uo(a)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:l)},[]);return f.useCallback(o=>{t.current.length===0&&i();const l=Zn(o[0],o[1]);t.current.includes(l)||t.current.push(l)},[i])}const Rr="header",Kn="group-header",da="out-of-bounds";var Ei;(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"})(Ei||(Ei={}));function Gd(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 V0=(e,t)=>e.kind===Z.Custom?e.copyData:t?.(e)?.getAccessibilityString(e)??"",$0=(e,t)=>{const{width:n,height:r,accessibilityHeight:i,columns:o,cellXOffset:l,cellYOffset:a,headerHeight:s,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:g,getCellContent:h,getRowThemeOverride:p,onHeaderMenuClick:m,onHeaderIndicatorClick:w,enableGroups:b,isFilling:v,onCanvasFocused:C,onCanvasBlur:I,isFocused:E,selection:R,freezeColumns:P,onContextMenu:x,freezeTrailingRows:S,fixedShadowX:F=!0,fixedShadowY:D=!0,drawFocusRing:M,onMouseDown:T,onMouseUp:O,onMouseMoveRaw:k,onMouseMove:N,onItemHovered:X,dragAndDropState:Y,firstColAccessible:ue,onKeyDown:ee,onKeyUp:te,highlightRegions:ce,canvasRef:se,onDragStart:he,onDragEnd:de,eventTargetRef:ie,isResizing:H,resizeColumn:L,isDragging:G,isDraggable:ne=!1,allowResize:oe,disabledRows:Se,hasAppendRow:me,getGroupDetails:et,theme:xe,prelightCells:bt,headerIcons:St,verticalBorder:Ue,drawCell:re,drawHeader:le,onCellFocused:be,onDragOverCell:fe,onDrop:we,onDragLeave:$e,imageWindowLoader:Fe,smoothScrollX:tt=!1,smoothScrollY:Me=!1,experimental:Xe,getCellRenderer:Te,resizeIndicator:Ee="full"}=e,Pe=e.translateX??0,ht=e.translateY??0,nt=Math.max(P,Math.min(o.length-1,l)),je=f.useRef(null),kt=f.useRef(Xe?.eventTarget??window),wt=kt.current,Dt=Fe,Ot=f.useRef(),[an,Kt]=f.useState(!1),In=f.useRef([]),It=f.useRef(),[gt,Tn]=f.useState(),[yt,Zt]=f.useState(),Sn=f.useRef(null),[De,ct]=f.useState(),[pt,Dn]=f.useState(!1),ln=f.useRef(pt);ln.current=pt;const sn=f.useMemo(()=>new p0(St,()=>{dn.current=void 0,Mn.current()}),[St]),On=b?c+s:s,Jt=f.useRef(-1),Qt=(Xe?.enableFirefoxRescaling??!1)&&H0.value,Be=(Xe?.enableSafariRescaling??!1)&&ua.value;f.useLayoutEffect(()=>{window.devicePixelRatio===1||!Qt&&!Be||(Jt.current!==-1&&Kt(!0),window.clearTimeout(Jt.current),Jt.current=window.setTimeout(()=>{Kt(!1),Jt.current=-1},200))},[a,nt,Pe,ht,Qt,Be]);const Mt=dm(o,P),Pn=f.useMemo(()=>F?Oi(Mt,Y):0,[Mt,Y,F]),Lt=f.useCallback((V,Q,ke)=>{const Ie=V.getBoundingClientRect();if(Q>=Mt.length||ke>=g)return;const ge=Ie.width/n,pe=Fl(Q,ke,n,r,c,On,nt,a,Pe,ht,g,P,S,Mt,d);return ge!==1&&(pe.x*=ge,pe.y*=ge,pe.width*=ge,pe.height*=ge),pe.x+=Ie.x,pe.y+=Ie.y,pe},[n,r,c,On,nt,a,Pe,ht,g,P,S,Mt,d]),mt=f.useCallback((V,Q,ke,Ie)=>{const ge=V.getBoundingClientRect(),pe=ge.width/n,qe=(Q-ge.left)/pe,Re=(ke-ge.top)/pe,Ze=5,vt=Ll(Mt,nt,n,void 0,Pe);let fn=0,Wt=0;const Rt=typeof PointerEvent<"u"&&Ie instanceof PointerEvent&&Ie.pointerType==="mouse"||typeof MouseEvent<"u"&&Ie instanceof MouseEvent,ut=typeof PointerEvent<"u"&&Ie instanceof PointerEvent&&Ie.pointerType==="touch"||typeof TouchEvent<"u"&&Ie instanceof TouchEvent;Rt&&(fn=Ie.button,Wt=Ie.buttons);const Ye=pm(qe,vt,Pe),dt=mm(Re,r,b,s,c,g,d,a,ht,S),zt=Ie?.shiftKey===!0,si=Ie?.ctrlKey===!0,Hr=Ie?.metaKey===!0,tn=[qe<0?-1:n<qe?1:0,Re<On?-1:r<Re?1:0];let un;if(Ye===-1||Re<0||qe<0||dt===void 0||qe>n||Re>r){const _t=qe>n?1:qe<0?-1:0,Nn=Re>r?1:Re<0?-1:0;let hn=_t*2,ui=Nn*2;_t===0&&(hn=Ye===-1?Ei.EndPadding:Ei.Center),Nn===0&&(ui=dt===void 0?Ei.EndPadding:Ei.Center);let cr=!1;if(Ye===-1&&dt===-1){const nn=Lt(V,Mt.length-1,-1);Hn(nn!==void 0),cr=Q<nn.x+nn.width+Ze}const rt=qe>n&&qe<n+Tl()||Re>r&&Re<r+Tl();un={kind:da,location:[Ye!==-1?Ye:qe<0?0:Mt.length-1,dt??g-1],region:[hn,ui],shiftKey:zt,ctrlKey:si,metaKey:Hr,isEdge:cr,isTouch:ut,button:fn,buttons:Wt,scrollEdge:tn,isMaybeScrollbar:rt}}else if(dt<=-1){let _t=Lt(V,Ye,dt);Hn(_t!==void 0);let Nn=_t!==void 0&&_t.x+_t.width-Q<=Ze;const hn=Ye-1;Q-_t.x<=Ze&&hn>=0?(Nn=!0,_t=Lt(V,hn,dt),Hn(_t!==void 0),un={kind:b&&dt===-2?Kn:Rr,location:[hn,dt],bounds:_t,group:Mt[hn].group??"",isEdge:Nn,shiftKey:zt,ctrlKey:si,metaKey:Hr,isTouch:ut,localEventX:Q-_t.x,localEventY:ke-_t.y,button:fn,buttons:Wt,scrollEdge:tn}):un={kind:b&&dt===-2?Kn:Rr,group:Mt[Ye].group??"",location:[Ye,dt],bounds:_t,isEdge:Nn,shiftKey:zt,ctrlKey:si,metaKey:Hr,isTouch:ut,localEventX:Q-_t.x,localEventY:ke-_t.y,button:fn,buttons:Wt,scrollEdge:tn}}else{const _t=Lt(V,Ye,dt);Hn(_t!==void 0);const Nn=_t!==void 0&&_t.x+_t.width-Q<Ze;let hn=!1;if(u!==!1&&u!==void 0&&R.current!==void 0){const cr=typeof u=="object"?{...la,...u}:la,rt=cr.size,nn=rt/2,zr=Md(R.current.range),wr=Lt(V,zr[0],zr[1]);if(wr!==void 0){const dr=wr.x+wr.width+cr.offsetX-nn+.5,Vt=wr.y+wr.height+cr.offsetY-nn+.5;hn=Math.abs(dr-Q)<rt&&Math.abs(Vt-ke)<rt}}un={kind:"cell",location:[Ye,dt],bounds:_t,isEdge:Nn,shiftKey:zt,ctrlKey:si,isFillHandle:hn,metaKey:Hr,isTouch:ut,localEventX:Q-_t.x,localEventY:ke-_t.y,button:fn,buttons:Wt,scrollEdge:tn}}return un},[n,Mt,nt,Pe,r,b,s,c,g,d,a,ht,S,Lt,u,R,On]),[xn]=gt??[],lr=f.useRef(()=>{}),Vn=f.useRef(gt);Vn.current=gt;const[B,We]=f.useMemo(()=>{const V=document.createElement("canvas"),Q=document.createElement("canvas");return V.style.display="none",V.style.opacity="0",V.style.position="fixed",Q.style.display="none",Q.style.opacity="0",Q.style.position="fixed",[V.getContext("2d",{alpha:!1}),Q.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>{if(!(B===null||We===null))return document.documentElement.append(B.canvas),document.documentElement.append(We.canvas),()=>{B.canvas.remove(),We.canvas.remove()}},[B,We]);const Ge=f.useMemo(()=>new Mm,[]),Pt=Qt&&an?1:Be&&an?2:5,en=Xe?.disableMinimumCellWidth===!0?1:10,dn=f.useRef(),kn=f.useRef(null),bn=f.useRef(null),Bt=f.useCallback(()=>{const V=je.current,Q=Sn.current;if(V===null||Q===null||(kn.current===null&&(kn.current=V.getContext("2d",{alpha:!1}),V.width=0,V.height=0),bn.current===null&&(bn.current=Q.getContext("2d",{alpha:!1}),Q.width=0,Q.height=0),kn.current===null||bn.current===null||B===null||We===null))return;let ke=!1;const Ie=qe=>{ke=!0,ct(qe)},ge=dn.current,pe={headerCanvasCtx:bn.current,canvasCtx:kn.current,bufferACtx:B,bufferBCtx:We,width:n,height:r,cellXOffset:nt,cellYOffset:a,translateX:Math.round(Pe),translateY:Math.round(ht),mappedColumns:Mt,enableGroups:b,freezeColumns:P,dragAndDropState:Y,theme:xe,headerHeight:s,groupHeaderHeight:c,disabledRows:Se??Qe.empty(),rowHeight:d,verticalBorder:Ue,isResizing:H,resizeCol:L,isFocused:E,selection:R,fillHandle:u,drawCellCallback:re,hasAppendRow:me,overrideCursor:Ie,maxScaleFactor:Pt,freezeTrailingRows:S,rows:g,drawFocus:M,getCellContent:h,getGroupDetails:et??(qe=>({name:qe})),getRowThemeOverride:p,drawHeaderCallback:le,prelightCells:bt,highlightRegions:ce,imageLoader:Dt,lastBlitData:It,damage:Ot.current,hoverValues:In.current,hoverInfo:Vn.current,spriteManager:sn,scrolling:an,hyperWrapping:Xe?.hyperWrapping??!1,touchMode:pt,enqueue:lr.current,renderStateProvider:Ge,renderStrategy:Xe?.renderStrategy??(ua.value?"double-buffer":"single-buffer"),getCellRenderer:Te,minimumCellWidth:en,resizeIndicator:Ee};pe.damage===void 0?(dn.current=pe,$u(pe,ge)):$u(pe,void 0),!ke&&(pe.damage===void 0||pe.damage.has(Vn?.current?.[0]))&&ct(void 0)},[B,We,n,r,nt,a,Pe,ht,Mt,b,P,Y,xe,s,c,Se,d,Ue,H,me,L,E,R,u,S,g,M,Pt,h,et,p,re,le,bt,ce,Dt,sn,an,Xe?.hyperWrapping,Xe?.renderStrategy,pt,Ge,Te,en,Ee]),Mn=f.useRef(Bt);f.useLayoutEffect(()=>{Bt(),Mn.current=Bt},[Bt]),f.useLayoutEffect(()=>{(async()=>{document?.fonts?.ready!==void 0&&(await document.fonts.ready,dn.current=void 0,Mn.current())})()},[]);const Rn=f.useCallback(V=>{Ot.current=V,Mn.current(),Ot.current=void 0},[]),ye=z0(Rn);lr.current=ye;const Ft=f.useCallback(V=>{Rn(new uo(V.map(Q=>Q.cell)))},[Rn]);Dt.setCallback(Rn);const[Yt,$n]=f.useState(!1),[jt,qt]=xn??[],Xt=jt!==void 0&&qt===-1&&jt>=0&&jt<Mt.length&&Mt[jt].headerRowMarkerDisabled!==!0,Ln=jt!==void 0&&qt===-2;let En=!1,Co=!1,Lr=De;if(Lr===void 0&&jt!==void 0&&qt!==void 0&&qt>-1&&qt<g){const V=h([jt,qt],!0);En=V.kind===Un.NewRow||V.kind===Un.Marker&&V.markerKind!=="number",Co=V.kind===Z.Boolean&&Gl(V),Lr=V.cursor}const So=G?"grabbing":(yt??!1)||H?"col-resize":Yt||v?"crosshair":Lr!==void 0?Lr:Xt||En||Co||Ln?"pointer":"default",ei=f.useMemo(()=>({contain:"strict",display:"block",cursor:So}),[So]),qn=f.useRef("default"),wn=ie?.current;wn!=null&&qn.current!==ei.cursor&&(wn.style.cursor=qn.current=ei.cursor);const ti=f.useCallback((V,Q,ke,Ie)=>{if(et===void 0)return;const ge=et(V);if(ge.actions!==void 0){const pe=Wd(Q,ge.actions);for(const[qe,Re]of pe.entries())if(Yr(Re,ke+Q.x,Ie+Re.y))return ge.actions[qe]}},[et]),sr=f.useCallback((V,Q,ke,Ie)=>{const ge=Mt[Q];if(!G&&!H&&!(yt??!1)){const pe=Lt(V,Q,-1);Hn(pe!==void 0);const qe=Ud(void 0,ge,pe.x,pe.y,pe.width,pe.height,xe,Kl(ge.title)==="rtl");if(ge.hasMenu===!0&&qe.menuBounds!==void 0&&Yr(qe.menuBounds,ke,Ie))return{area:"menu",bounds:qe.menuBounds};if(ge.indicatorIcon!==void 0&&qe.indicatorIconBounds!==void 0&&Yr(qe.indicatorIconBounds,ke,Ie))return{area:"indicator",bounds:qe.indicatorIconBounds}}},[Mt,Lt,yt,G,H,xe]),ni=f.useRef(0),mr=f.useRef(),ri=f.useRef(!1),ii=f.useCallback(V=>{const Q=je.current,ke=ie?.current;if(Q===null||V.target!==Q&&V.target!==ke)return;ri.current=!0;const Ie=V.clientX,ge=V.clientY;if(V.target===ke&&ke!==null){const qe=ke.getBoundingClientRect();if(Ie>qe.right||ge>qe.bottom)return}const pe=mt(Q,Ie,ge,V);mr.current=pe.location,pe.isTouch&&(ni.current=Date.now()),ln.current!==pe.isTouch&&Dn(pe.isTouch),!(pe.kind===Rr&&sr(Q,pe.location[0],Ie,ge)!==void 0)&&(pe.kind===Kn&&ti(pe.group,pe.bounds,pe.localEventX,pe.localEventY)!==void 0||(T?.(pe),!pe.isTouch&&ne!==!0&&ne!==pe.kind&&pe.button<3&&pe.button!==1&&V.preventDefault()))},[ie,ne,mt,ti,sr,T]);Cn("pointerdown",ii,wt,!1);const Fr=f.useRef(0),vr=f.useCallback(V=>{const Q=Fr.current;Fr.current=Date.now();const ke=je.current;if(ri.current=!1,O===void 0||ke===null)return;const Ie=ie?.current,ge=V.target!==ke&&V.target!==Ie,pe=V.clientX,qe=V.clientY,Re=V.pointerType==="mouse"?V.button<3:!0;let Ze=mt(ke,pe,qe,V);Ze.isTouch&&ni.current!==0&&Date.now()-ni.current>500&&(Ze={...Ze,isLongTouch:!0}),Q!==0&&Date.now()-Q<(Ze.isTouch?1e3:500)&&(Ze={...Ze,isDoubleClick:!0}),ln.current!==Ze.isTouch&&Dn(Ze.isTouch),!ge&&V.cancelable&&Re&&V.preventDefault();const[vt]=Ze.location,fn=sr(ke,vt,pe,qe);if(Ze.kind===Rr&&fn!==void 0){(Ze.button!==0||mr.current?.[0]!==vt||mr.current?.[1]!==-1)&&O(Ze,!0);return}else if(Ze.kind===Kn){const Wt=ti(Ze.group,Ze.bounds,Ze.localEventX,Ze.localEventY);if(Wt!==void 0){Ze.button===0&&Wt.onClick(Ze);return}}O(Ze,ge)},[O,ie,mt,sr,ti]);Cn("pointerup",vr,wt,!1);const oi=f.useCallback(V=>{const Q=je.current;if(Q===null)return;const ke=ie?.current,Ie=V.target!==Q&&V.target!==ke;let ge,pe,qe=!0;V instanceof MouseEvent?(ge=V.clientX,pe=V.clientY,qe=V.button<3):(ge=V.changedTouches[0].clientX,pe=V.changedTouches[0].clientY);const Re=mt(Q,ge,pe,V);ln.current!==Re.isTouch&&Dn(Re.isTouch),!Ie&&V.cancelable&&qe&&V.preventDefault();const[Ze]=Re.location;if(Re.kind===Rr){const vt=sr(Q,Ze,ge,pe);vt!==void 0&&Re.button===0&&mr.current?.[0]===Ze&&mr.current?.[1]===-1&&(vt.area==="menu"?m?.(Ze,vt.bounds):vt.area==="indicator"&&w?.(Ze,vt.bounds))}},[ie,mt,sr,m,w]);Cn("click",oi,wt,!1);const Ia=f.useCallback(V=>{const Q=je.current,ke=ie?.current;if(Q===null||V.target!==Q&&V.target!==ke||x===void 0)return;const Ie=mt(Q,V.clientX,V.clientY,V);x(Ie,()=>{V.cancelable&&V.preventDefault()})},[ie,mt,x]);Cn("contextmenu",Ia,ie?.current??null,!1);const Li=f.useCallback(V=>{Ot.current=new uo(V.map(Q=>Q.item)),In.current=V,Mn.current(),Ot.current=void 0},[]),Ae=f.useMemo(()=>new _0(Li),[Li]),Fi=f.useRef(Ae);Fi.current=Ae,f.useLayoutEffect(()=>{const V=Fi.current;if(xn===void 0||xn[1]<0){V.setHovered(xn);return}const Q=h(xn,!0),ke=Te(Q),Ie=ke===void 0&&Q.kind===Z.Custom||ke?.needsHover!==void 0&&(typeof ke.needsHover=="boolean"?ke.needsHover:ke.needsHover(Q));V.setHovered(Ie?xn:void 0)},[h,Te,xn]);const xo=f.useRef(),_r=f.useCallback(V=>{const Q=je.current;if(Q===null)return;const ke=ie?.current,Ie=V.target!==Q&&V.target!==ke,ge=mt(Q,V.clientX,V.clientY,V);if(ge.kind!=="out-of-bounds"&&Ie&&!ri.current&&!ge.isTouch)return;const pe=(Re,Ze)=>{Tn(vt=>vt===Re||vt?.[0][0]===Re?.[0][0]&&vt?.[0][1]===Re?.[0][1]&&(vt?.[1][0]===Re?.[1][0]&&vt?.[1][1]===Re?.[1][1]||!Ze)?vt:Re)};if(!Gd(ge,xo.current))ct(void 0),X?.(ge),pe(ge.kind===da?void 0:[ge.location,[ge.localEventX,ge.localEventY]],!0),xo.current=ge;else if(ge.kind==="cell"||ge.kind===Rr||ge.kind===Kn){let Re=!1,Ze=!0;if(ge.kind==="cell"){const fn=h(ge.location);Ze=Te(fn)?.needsHoverPosition??fn.kind===Z.Custom,Re=Ze}else Re=!0;const vt=[ge.location,[ge.localEventX,ge.localEventY]];pe(vt,Ze),Vn.current=vt,Re&&Rn(new uo([ge.location]))}const qe=ge.location[0]>=(ue?0:1);Zt(ge.kind===Rr&&ge.isEdge&&qe&&oe===!0),$n(ge.kind==="cell"&&ge.isFillHandle),k?.(V),N(ge)},[ie,mt,ue,oe,k,N,X,h,Te,Rn]);Cn("pointermove",_r,wt,!0);const Ta=f.useCallback(V=>{const Q=je.current;if(Q===null)return;let ke,Ie;R.current!==void 0&&(ke=Lt(Q,R.current.cell[0],R.current.cell[1]),Ie=R.current.cell),ee?.({bounds:ke,stopPropagation:()=>V.stopPropagation(),preventDefault:()=>V.preventDefault(),cancel:()=>{},ctrlKey:V.ctrlKey,metaKey:V.metaKey,shiftKey:V.shiftKey,altKey:V.altKey,key:V.key,keyCode:V.keyCode,rawEvent:V,location:Ie})},[ee,R,Lt]),tr=f.useCallback(V=>{const Q=je.current;if(Q===null)return;let ke,Ie;R.current!==void 0&&(ke=Lt(Q,R.current.cell[0],R.current.cell[1]),Ie=R.current.cell),te?.({bounds:ke,stopPropagation:()=>V.stopPropagation(),preventDefault:()=>V.preventDefault(),cancel:()=>{},ctrlKey:V.ctrlKey,metaKey:V.metaKey,shiftKey:V.shiftKey,altKey:V.altKey,key:V.key,keyCode:V.keyCode,rawEvent:V,location:Ie})},[te,R,Lt]),_i=f.useCallback(V=>{if(je.current=V,se!==void 0&&(se.current=V),Xe?.eventTarget)kt.current=Xe.eventTarget;else if(V===null)kt.current=window;else{const Q=V.getRootNode();Q===document&&(kt.current=window),kt.current=Q}},[se,Xe?.eventTarget]),ko=f.useCallback(V=>{const Q=je.current;if(Q===null||ne===!1||H){V.preventDefault();return}let ke,Ie;const ge=mt(Q,V.clientX,V.clientY);if(ne!==!0&&ge.kind!==ne){V.preventDefault();return}const pe=(Wt,Rt)=>{ke=Wt,Ie=Rt};let qe,Re,Ze;const vt=(Wt,Rt,ut)=>{qe=Wt,Re=Rt,Ze=ut};let fn=!1;if(he?.({...ge,setData:pe,setDragImage:vt,preventDefault:()=>fn=!0,defaultPrevented:()=>fn}),!fn&&ke!==void 0&&Ie!==void 0&&V.dataTransfer!==null)if(V.dataTransfer.setData(ke,Ie),V.dataTransfer.effectAllowed="copyLink",qe!==void 0&&Re!==void 0&&Ze!==void 0)V.dataTransfer.setDragImage(qe,Re,Ze);else{const[Wt,Rt]=ge.location;if(Rt!==void 0){const ut=document.createElement("canvas"),Ye=Lt(Q,Wt,Rt);Hn(Ye!==void 0);const dt=Math.ceil(window.devicePixelRatio??1);ut.width=Ye.width*dt,ut.height=Ye.height*dt;const zt=ut.getContext("2d");zt!==null&&(zt.scale(dt,dt),zt.textBaseline="middle",Rt===-1?(zt.font=xe.headerFontFull,zt.fillStyle=xe.bgHeader,zt.fillRect(0,0,ut.width,ut.height),qd(zt,0,0,Ye.width,Ye.height,Mt[Wt],!1,xe,!1,void 0,void 0,!1,0,sn,le,!1)):(zt.font=xe.baseFontFull,zt.fillStyle=xe.bgCell,zt.fillRect(0,0,ut.width,ut.height),Bd(zt,h([Wt,Rt]),0,Rt,!1,!1,0,0,Ye.width,Ye.height,!1,xe,xe.bgCell,Dt,sn,1,void 0,!1,0,void 0,void 0,void 0,Ge,Te,()=>{}))),ut.style.left="-100%",ut.style.position="absolute",ut.style.width=`${Ye.width}px`,ut.style.height=`${Ye.height}px`,document.body.append(ut),V.dataTransfer.setDragImage(ut,Ye.width/2,Ye.height/2),window.setTimeout(()=>{ut.remove()},0)}}else V.preventDefault()},[ne,H,mt,he,Lt,xe,Mt,sn,le,h,Dt,Ge,Te]);Cn("dragstart",ko,ie?.current??null,!1,!1);const ai=f.useRef(),Da=f.useCallback(V=>{const Q=je.current;if(we!==void 0&&V.preventDefault(),Q===null||fe===void 0)return;const ke=mt(Q,V.clientX,V.clientY),[Ie,ge]=ke.location,pe=Ie-(ue?0:1),[qe,Re]=ai.current??[];(qe!==pe||Re!==ge)&&(ai.current=[pe,ge],fe([pe,ge],V.dataTransfer))},[ue,mt,fe,we]);Cn("dragover",Da,ie?.current??null,!1,!1);const Oa=f.useCallback(()=>{ai.current=void 0,de?.()},[de]);Cn("dragend",Oa,ie?.current??null,!1,!1);const nr=f.useCallback(V=>{const Q=je.current;if(Q===null||we===void 0)return;V.preventDefault();const ke=mt(Q,V.clientX,V.clientY),[Ie,ge]=ke.location,pe=Ie-(ue?0:1);we([pe,ge],V.dataTransfer)},[ue,mt,we]);Cn("drop",nr,ie?.current??null,!1,!1);const br=f.useCallback(()=>{$e?.()},[$e]);Cn("dragleave",br,ie?.current??null,!1,!1);const Fn=f.useRef(R);Fn.current=R;const U=f.useRef(null),Ht=f.useCallback(V=>{je.current===null||!je.current.contains(document.activeElement)||(V===null&&Fn.current.current!==void 0?se?.current?.focus({preventScroll:!0}):V!==null&&V.focus({preventScroll:!0}),U.current=V)},[se]);f.useImperativeHandle(t,()=>({focus:()=>{const V=U.current;V===null||!document.contains(V)?se?.current?.focus({preventScroll:!0}):V.focus({preventScroll:!0})},getBounds:(V,Q)=>{if(!(se===void 0||se.current===null))return Lt(se.current,V??0,Q??-1)},damage:Ft,getMouseArgsForPosition:(V,Q,ke)=>{if(!(se===void 0||se.current===null))return mt(se.current,V,Q,ke)}}),[se,Ft,Lt,mt]);const ur=f.useRef(),Pa=Dp(()=>{if(n<50||Xe?.disableAccessibilityTree===!0)return null;let V=Ll(Mt,nt,n,Y,Pe);const Q=ue?0:-1;!ue&&V[0]?.sourceIndex===0&&(V=V.slice(1));const[ke,Ie]=R.current?.cell??[],ge=R.current?.range,pe=V.map(Re=>Re.sourceIndex),qe=Ir(a,Math.min(g,a+i));return ke!==void 0&&Ie!==void 0&&!(pe.includes(ke)&&qe.includes(Ie))&&Ht(null),f.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":Mt.length+Q},f.createElement("thead",{role:"rowgroup"},f.createElement("tr",{role:"row","aria-rowindex":1},V.map(Re=>f.createElement("th",{role:"columnheader","aria-selected":R.columns.hasIndex(Re.sourceIndex),"aria-colindex":Re.sourceIndex+1+Q,tabIndex:-1,onFocus:Ze=>{if(Ze.target!==U.current)return be?.([Re.sourceIndex,-1])},key:Re.sourceIndex},Re.title)))),f.createElement("tbody",{role:"rowgroup"},qe.map(Re=>f.createElement("tr",{role:"row","aria-selected":R.rows.hasIndex(Re),key:Re,"aria-rowindex":Re+2},V.map(Ze=>{const vt=Ze.sourceIndex,fn=Zn(vt,Re),Wt=ke===vt&&Ie===Re,Rt=ge!==void 0&&vt>=ge.x&&vt<ge.x+ge.width&&Re>=ge.y&&Re<ge.y+ge.height,ut=`glide-cell-${vt}-${Re}`,Ye=[vt,Re],dt=h(Ye,!0);return f.createElement("td",{key:fn,role:"gridcell","aria-colindex":vt+1+Q,"aria-selected":Rt,"aria-readonly":Mi(dt)||!xi(dt),id:ut,"data-testid":ut,onClick:()=>{const zt=se?.current;if(zt!=null)return ee?.({bounds:Lt(zt,vt,Re),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Ye})},onFocusCapture:zt=>{if(!(zt.target===U.current||ur.current?.[0]===vt&&ur.current?.[1]===Re))return ur.current=Ye,be?.(Ye)},ref:Wt?Ht:void 0,tabIndex:-1},V0(dt,Te))})))))},[n,Mt,nt,Y,Pe,g,a,i,R,Ht,h,se,ee,Lt,be],200),Ar=P===0||!F?0:nt>P?1:Wn(-Pe/100,0,1),La=-a*32+ht,li=D?Wn(-La/100,0,1):0,Is=f.useMemo(()=>{if(!Ar&&!li)return null;const V={position:"absolute",top:0,left:Pn,width:n-Pn,height:r,opacity:Ar,pointerEvents:"none",transition:tt?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},Q={position:"absolute",top:On,left:0,width:n,height:r,opacity:li,pointerEvents:"none",transition:Me?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return f.createElement(f.Fragment,null,Ar>0&&f.createElement("div",{id:"shadow-x",style:V}),li>0&&f.createElement("div",{id:"shadow-y",style:Q}))},[Ar,li,Pn,n,tt,On,r,Me]),j=f.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return f.createElement(f.Fragment,null,f.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Ta,onKeyUp:tr,onFocus:C,onBlur:I,ref:_i,style:ei},Pa),f.createElement("canvas",{ref:Sn,style:j}),Is)},N0=f.memo(f.forwardRef($0));function eo(e,t,n,r){return Wn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const B0=e=>{const[t,n]=f.useState(),[r,i]=f.useState(),[o,l]=f.useState(),[a,s]=f.useState(),[u,c]=f.useState(!1),[d,g]=f.useState(),[h,p]=f.useState(),[m,w]=f.useState(),[b,v]=f.useState(!1),[C,I]=f.useState(),{onHeaderMenuClick:E,onHeaderIndicatorClick:R,getCellContent:P,onColumnMoved:x,onColumnResize:S,onColumnResizeStart:F,onColumnResizeEnd:D,gridRef:M,maxColumnWidth:T,minColumnWidth:O,onRowMoved:k,lockColumns:N,onColumnProposeMove:X,onMouseDown:Y,onMouseUp:ue,onItemHovered:ee,onDragStart:te,canvasRef:ce}=e,se=(S??D??F)!==void 0,{columns:he,selection:de}=e,ie=de.columns,H=f.useCallback(re=>{const[le,be]=re.location;o!==void 0&&a!==le&&le>=N?(c(!0),s(le)):h!==void 0&&be!==void 0?(v(!0),w(Math.max(0,be))):r===void 0&&!u&&!b&&ee?.(re)},[o,h,a,ee,N,r,u,b]),L=x!==void 0,G=f.useCallback(re=>{if(re.button===0){const[le,be]=re.location;if(re.kind==="out-of-bounds"&&re.isEdge&&se){const fe=M?.current?.getBounds(he.length-1,-1);fe!==void 0&&(n(fe.x),i(he.length-1))}else if(re.kind==="header"&&le>=N){const fe=ce?.current;if(re.isEdge&&se&&fe){n(re.bounds.x),i(le);const $e=fe.getBoundingClientRect().width/fe.offsetWidth,Fe=re.bounds.width/$e;F?.(he[le],Fe,le,Fe+(he[le].growOffset??0))}else re.kind==="header"&&L&&(g(re.bounds.x),l(le))}else re.kind==="cell"&&N>0&&le===0&&be!==void 0&&k!==void 0&&(I(re.bounds.y),p(be))}Y?.(re)},[Y,se,N,k,M,he,L,F,ce]),ne=f.useCallback((re,le)=>{u||b||E?.(re,le)},[u,b,E]),oe=f.useCallback((re,le)=>{u||b||R?.(re,le)},[u,b,R]),Se=f.useRef(-1),me=f.useCallback(()=>{Se.current=-1,p(void 0),w(void 0),I(void 0),v(!1),l(void 0),s(void 0),g(void 0),c(!1),i(void 0),n(void 0)},[]),et=f.useCallback((re,le)=>{if(re.button===0){if(r!==void 0){if(ie?.hasIndex(r)===!0)for(const fe of ie){if(fe===r)continue;const we=he[fe],$e=eo(we,Se.current,O,T);S?.(we,$e,fe,$e+(we.growOffset??0))}const be=eo(he[r],Se.current,O,T);if(D?.(he[r],be,r,be+(he[r].growOffset??0)),ie.hasIndex(r))for(const fe of ie){if(fe===r)continue;const we=he[fe],$e=eo(we,Se.current,O,T);D?.(we,$e,fe,$e+(we.growOffset??0))}}me(),o!==void 0&&a!==void 0&&X?.(o,a)!==!1&&x?.(o,a),h!==void 0&&m!==void 0&&k?.(h,m)}ue?.(re,le)},[ue,r,o,a,h,m,ie,D,he,O,T,S,x,k,me,X]),xe=f.useMemo(()=>{if(!(o===void 0||a===void 0)&&o!==a&&X?.(o,a)!==!1)return{src:o,dest:a}},[o,a,X]),bt=f.useCallback(re=>{const le=ce?.current;if(o!==void 0&&d!==void 0)Math.abs(re.clientX-d)>20&&c(!0);else if(h!==void 0&&C!==void 0)Math.abs(re.clientY-C)>20&&v(!0);else if(r!==void 0&&t!==void 0&&le){const fe=le.getBoundingClientRect().width/le.offsetWidth,we=(re.clientX-t)/fe,$e=he[r],Fe=eo($e,we,O,T);if(S?.($e,Fe,r,Fe+($e.growOffset??0)),Se.current=we,ie?.first()===r)for(const tt of ie){if(tt===r)continue;const Me=he[tt],Xe=eo(Me,Se.current,O,T);S?.(Me,Xe,tt,Xe+(Me.growOffset??0))}}},[o,d,h,C,r,t,he,O,T,S,ie,ce]),St=f.useCallback((re,le)=>{if(h===void 0||m===void 0)return P(re,le);let[be,fe]=re;return fe===m?fe=h:(fe>m&&(fe-=1),fe>=h&&(fe+=1)),P([be,fe],le)},[h,m,P]),Ue=f.useCallback(re=>{te?.(re),re.defaultPrevented()||me()},[me,te]);return f.createElement(N0,{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:St,isResizing:r!==void 0,onHeaderMenuClick:ne,onHeaderIndicatorClick:oe,isDragging:u,onItemHovered:H,onDragStart:Ue,onMouseDown:G,allowResize:se,onMouseUp:et,dragAndDropState:xe,onMouseMoveRaw:bt,ref:M})};function W0(e){const t=f.useRef(null),[n,r]=f.useState({width:e?.[0],height:e?.[1]});return f.useLayoutEffect(()=>{const i=l=>{for(const a of l){const{width:s,height:u}=a&&a.contentRect||{};r(c=>c.width===s&&c.height===u?c:{width:s,height:u})}},o=new window.ResizeObserver(i);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const U0=(e,t,n)=>{const r=f.useRef(null),i=f.useRef(null),o=f.useRef(null),l=f.useRef(0),a=f.useRef(t);a.current=t;const s=n.current;f.useEffect(()=>{const u=()=>{if(i.current===!1&&s!==null){const g=[s.scrollLeft,s.scrollTop];if(o.current?.[0]===g[0]&&o.current?.[1]===g[1])if(l.current>10){o.current=null,i.current=null;return}else l.current++;else l.current=0,a.current(g[0],g[1]),o.current=g;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{i.current=!0,o.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},d=g=>{g.touches.length===0&&(i.current=!1,l.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&s!==null){const g=s;return g.addEventListener("touchstart",c),g.addEventListener("touchend",d),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",d),r.current!==null&&window.clearTimeout(r.current)}}},[e,s])},q0=()=>e=>e.isSafari?"scroll":"auto",X0=cn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[q0()]}}),G0=33554400,Y0=5e6;function j0(e){const[t,n]=f.useState(!1),r=typeof window>"u"?null:window,i=f.useRef(0);return Cn("touchstart",f.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),Cn("touchend",f.useCallback(o=>{o.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const K0=e=>{const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:o,draggable:l,className:a,preventDiagonalScrolling:s=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:g,kineticScrollPerfHack:h=!1,scrollRef:p,initialSize:m}=e,w=[],b=g?.sticky??!1,v=g?.fill??!1,C=f.useRef(0),I=f.useRef(0),E=f.useRef(null),R=typeof window>"u"?1:window.devicePixelRatio,P=f.useRef(R);f.useEffect(()=>{if(P.current!==R){C.current=0,I.current=0,P.current=R;const de=E.current;de!==null&&k.current(de.scrollLeft,de.scrollTop)}},[R]);const x=f.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),S=f.useRef(null),F=j0(200),[D,M]=f.useState(!0),T=f.useRef(0);f.useLayoutEffect(()=>{if(!D||F||x.current.lockDirection===void 0)return;const de=E.current;if(de===null)return;const[ie,H]=x.current.lockDirection;ie!==void 0?de.scrollLeft=ie:H!==void 0&&(de.scrollTop=H),x.current.lockDirection=void 0},[F,D]);const O=f.useCallback((de,ie)=>{const H=E.current;if(H===null)return;ie=ie??H.scrollTop,de=de??H.scrollLeft;const L=x.current.scrollTop,G=x.current.scrollLeft,ne=de-G,oe=ie-L;F&&ne!==0&&oe!==0&&(Math.abs(ne)>3||Math.abs(oe)>3)&&s&&x.current.lockDirection===void 0&&(x.current.lockDirection=Math.abs(ne)<Math.abs(oe)?[G,void 0]:[void 0,L]);const Se=x.current.lockDirection;de=Se?.[0]??de,ie=Se?.[1]??ie,x.current.scrollLeft=de,x.current.scrollTop=ie;const me=H.clientWidth,et=H.clientHeight,xe=ie,bt=I.current-xe,St=H.scrollHeight-et;I.current=xe;let Ue;if(St>0&&r>H.scrollHeight+5)if(Math.abs(bt)>2e3||xe===0||xe===St){const re=Math.max(0,Math.min(1,xe/St)),le=r-et;Ue=re*le,C.current=Ue}else C.current-=bt,Ue=C.current;else Ue=xe,C.current=Ue;Ue=Math.max(0,Math.min(Ue,r-et)),C.current=Ue,Se!==void 0&&(window.clearTimeout(T.current),M(!1),T.current=window.setTimeout(()=>M(!0),200)),o({x:de,y:Ue,width:me-c,height:et-u,paddingRight:S.current?.clientWidth??0})},[u,c,r,o,s,F]);U0(h&&ua.value,O,E);const k=f.useRef(O);k.current=O;const N=f.useRef(),X=f.useRef(!1);f.useLayoutEffect(()=>{X.current?O():X.current=!0},[O,u,c]);const Y=f.useCallback(de=>{E.current=de,p!==void 0&&(p.current=de)},[p]);let ue=0,ee=0;const te=Math.min(r,G0);for(w.push(f.createElement("div",{key:ue++,style:{width:i,height:0}}));ee<te;){const de=Math.min(Y0,te-ee);w.push(f.createElement("div",{key:ue++,style:{width:0,height:de}})),ee+=de}const{ref:ce,width:se,height:he}=W0(m);return typeof window<"u"&&(N.current?.height!==he||N.current?.width!==se)&&(window.setTimeout(()=>k.current(),0),N.current={width:se,height:he}),(se??0)===0||(he??0)===0?f.createElement("div",{ref:ce}):f.createElement("div",{ref:ce},f.createElement(X0,{isSafari:ua.value},f.createElement("div",{className:"dvn-underlay"},t),f.createElement("div",{ref:Y,style:N.current,draggable:l,onDragStart:de=>{l||(de.stopPropagation(),de.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>O()},f.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},f.createElement("div",{className:"dvn-stack"},w),d!==void 0&&f.createElement(f.Fragment,null,!v&&f.createElement("div",{className:"dvn-spacer"}),f.createElement("div",{ref:S,style:{height:he,maxHeight:n-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:v?1:void 0,right:b?c??0:void 0,pointerEvents:"auto"}},d))))))},Z0=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:o,enableGroups:l,freezeColumns:a,experimental:s,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:g,scrollRef:h,preventDiagonalScrolling:p,rightElement:m,rightElementProps:w,overscrollX:b,overscrollY:v,initialSize:C,smoothScrollX:I=!1,smoothScrollY:E=!1,isDraggable:R}=e,{paddingRight:P,paddingBottom:x}=s??{},[S,F]=c,D=f.useRef(),M=f.useRef(),T=f.useRef(),O=f.useRef(),k=u+Math.max(0,b??0);let N=l?i+o:i;if(typeof r=="number")N+=n*r;else for(let ee=0;ee<n;ee++)N+=r(ee);v!==void 0&&(N+=v);const X=f.useRef(),Y=f.useCallback(()=>{if(X.current===void 0)return;const ee={...X.current};let te=0,ce=ee.x<0?-ee.x:0,se=0,he=0;ee.x=ee.x<0?0:ee.x;let de=0;for(let oe=0;oe<a;oe++)de+=t[oe].width;for(const oe of t){const Se=te-de;if(ee.x>=Se+oe.width)te+=oe.width,he++,se++;else if(ee.x>Se)te+=oe.width,I?ce+=Se-ee.x:he++,se++;else if(ee.x+ee.width>Se)te+=oe.width,se++;else break}let ie=0,H=0,L=0;if(typeof r=="number")E?(H=Math.floor(ee.y/r),ie=H*r-ee.y):H=Math.ceil(ee.y/r),L=Math.ceil(ee.height/r)+H,ie<0&&L++;else{let oe=0;for(let Se=0;Se<n;Se++){const me=r(Se),et=oe+(E?0:me/2);if(ee.y>=oe+me)oe+=me,H++,L++;else if(ee.y>et)oe+=me,E?ie+=et-ee.y:H++,L++;else if(ee.y+ee.height>me/2+oe)oe+=me,L++;else break}}H=Math.max(0,Math.min(H,n-1)),L=Math.max(H,Math.min(L,n));const G={x:he,y:H,width:se-he,height:L-H},ne=D.current;(ne===void 0||ne.y!==G.y||ne.x!==G.x||ne.height!==G.height||ne.width!==G.width||M.current!==ce||T.current!==ie||ee.width!==O.current?.[0]||ee.height!==O.current?.[1])&&(g?.({x:he,y:H,width:se-he,height:L-H},ee.width,ee.height,ee.paddingRight??0,ce,ie),D.current=G,M.current=ce,T.current=ie,O.current=[ee.width,ee.height])},[t,r,n,g,a,I,E]),ue=f.useCallback(ee=>{X.current=ee,Y()},[Y]);return f.useEffect(()=>{Y()},[Y]),f.createElement(K0,{scrollRef:h,className:d,kineticScrollPerfHack:s?.kineticScrollPerfHack,preventDiagonalScrolling:p,draggable:R===!0||typeof R=="string",scrollWidth:k+(P??0),scrollHeight:N+(x??0),clientHeight:F,rightElement:m,paddingBottom:x,paddingRight:P,rightElementProps:w,update:ue,initialSize:C},f.createElement(B0,{eventTargetRef:h,width:S,height:F,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},J0=cn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),Q0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),ev=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),tv=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),nv=10,rv=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:o,searchValue:l,searchResults:a,onSearchValueChange:s,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:g}=e,[h]=f.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[p,m]=f.useState(""),w=l??p,b=f.useCallback(te=>{m(te),s?.(te)},[s]),[v,C]=f.useState(),I=f.useRef(v);I.current=v,f.useEffect(()=>{a!==void 0&&(a.length>0?C(te=>({rowsSearched:r,results:a.length,selectedIndex:te?.selectedIndex??-1})):C(void 0))},[r,a]);const E=f.useRef();E.current===void 0&&(E.current=new AbortController);const R=f.useRef(),[P,x]=f.useState([]),S=a??P,F=f.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0),E.current!==void 0&&E.current.abort(),E.current=new AbortController},[]),D=f.useRef(n);D.current=n;const M=f.useCallback(te=>{const ce=new RegExp(te.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let se=D.current,he=Math.min(10,r),de=0;C(void 0),x([]);const ie=[],H=async()=>{if(u===void 0)return;const L=performance.now(),G=r-de;let ne=u({x:0,y:se,width:i.length,height:Math.min(he,G,r-se)},E.current.signal);typeof ne=="function"&&(ne=await ne());let oe=!1;for(const[St,Ue]of ne.entries())for(const[re,le]of Ue.entries()){let be;switch(le.kind){case Z.Text:case Z.Number:be=le.displayData;break;case Z.Uri:case Z.Markdown:be=le.data;break;case Z.Boolean:be=typeof le.data=="boolean"?le.data.toString():void 0;break;case Z.Image:case Z.Bubble:be=le.data.join("🐳");break;case Z.Custom:be=le.copyData;break}be!==void 0&&ce.test(be)&&(ie.push([re,St+se]),oe=!0)}const Se=performance.now();oe&&x([...ie]),de+=ne.length,Hn(de<=r);const me=I.current?.selectedIndex??-1;C({results:ie.length,rowsSearched:de,selectedIndex:me}),c?.(ie,me),se+he>=r?se=0:se+=he;const et=Se-L,xe=Math.max(et,1),bt=nv/xe;he=Math.ceil(he*bt),de<r&&ie.length<1e3&&(R.current=window.requestAnimationFrame(H))};F(),R.current=window.requestAnimationFrame(H)},[F,i.length,u,c,r]),T=f.useCallback(()=>{g?.(),C(void 0),x([]),c?.([],-1),F(),t?.current?.focus()},[F,t,g,c]),O=f.useCallback(te=>{b(te.target.value),a===void 0&&(te.target.value===""?(C(void 0),x([]),F()):M(te.target.value))},[M,F,b,a]);f.useEffect(()=>{o.current!==null&&(b(""),C(void 0),P.length>0&&(x([]),c?.([],-1)),d?o.current.focus({preventScroll:!0}):F())},[d,o]);const k=f.useCallback(te=>{if(te?.stopPropagation?.(),v===void 0||v.results===0)return;const ce=(v.selectedIndex+1)%v.results;C({...v,selectedIndex:ce}),c?.(S,ce)},[v,c,S]),N=f.useCallback(te=>{if(te?.stopPropagation?.(),v===void 0||v.results===0)return;let ce=(v.selectedIndex-1)%v.results;ce<0&&(ce+=v.results),C({...v,selectedIndex:ce}),c?.(S,ce)},[c,S,v]),X=f.useCallback(te=>{(te.ctrlKey||te.metaKey)&&te.nativeEvent.code==="KeyF"||te.key==="Escape"?(T(),te.stopPropagation(),te.preventDefault()):te.key==="Enter"&&(te.shiftKey?N():k())},[T,k,N]);f.useEffect(()=>()=>{F()},[F]);const[Y,ue]=f.useState(!1);f.useEffect(()=>{if(d)ue(!0);else{const te=setTimeout(()=>ue(!1),150);return()=>clearTimeout(te)}},[d]);const ee=f.useMemo(()=>{if(!d&&!Y)return null;let te;v!==void 0&&(te=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(te=`${v.selectedIndex+1} of ${te}`));const ce=de=>{de.stopPropagation()},he={width:`${r>0?Math.floor((v?.rowsSearched??0)/r*100):0}%`};return f.createElement(J0,{className:"gdg-search-bar"+(d?"":" out"),onMouseDown:ce,onMouseMove:ce,onMouseUp:ce,onClick:ce},f.createElement("div",{className:"gdg-search-bar-inner"},f.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:O,value:w,tabIndex:d?void 0:-1,onKeyDownCapture:X}),f.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:N,disabled:(v?.results??0)===0},Q0),f.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:k,disabled:(v?.results??0)===0},ev),g!==void 0&&f.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:T},tv)),v!==void 0?f.createElement(f.Fragment,null,f.createElement("div",{className:"gdg-search-status"},f.createElement("div",{"data-testid":"search-result-area"},te)),f.createElement("div",{className:"gdg-search-progress",style:he})):f.createElement("div",{className:"gdg-search-status"},f.createElement("label",{htmlFor:h},"Type to search")))},[d,Y,v,r,h,o,O,w,X,N,k,g,T]);return f.createElement(f.Fragment,null,f.createElement(Z0,{prelightCells:S,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 iv extends f.PureComponent{wrapperRef=f.createRef();componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("pointerdown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("pointerdown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}clickOutside=t=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}};render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...i}=this.props;return f.createElement("div",{...i,ref:this.wrapperRef},this.props.children)}}const ov=()=>e=>Math.max(16,e.targetHeight-10),av=cn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[ov(),"px"]}}),lv=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:o}=e,[l,a]=$t.useState(n);return $t.createElement(iv,{style:{position:"absolute",left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},$t.createElement(av,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:r,onFocus:s=>s.target.setSelectionRange(0,l.length),onChange:s=>a(s.target.value),onKeyDown:s=>{s.key==="Enter"?o(l):s.key==="Escape"&&r()},autoFocus:!0}))};function sv(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function ot(e,t,n){const r=Yd(e,t);return r&&(n.didMatch=!0),r}function Yd(e,t){if(e.length===0)return!1;if(e.includes("|")){const s=e.split("|");for(const u of s)if(Yd(u,t))return!0;return!1}let n=!1,r=!1,i=!1,o=!1;const l=e.split("+"),a=l.pop();if(!sv(a,t))return!1;if(l[0]==="any")return!0;for(const s of l)switch(s){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":i=!0;break;case"meta":o=!0;break;case"primary":ca.value?o=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===o}function uv(e,t,n,r,i,o,l){const a=$t.useCallback((c,d,g,h)=>{(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!l&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const p=n==="mixed"&&(g||h==="drag")||n==="additive",m=(r==="mixed"||r==="additive")&&p,w=(i==="mixed"||i==="additive")&&p;let b={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?e.current?.rangeStack??[]:[]},columns:m?e.columns:Qe.empty(),rows:w?e.rows:Qe.empty()};g&&(o==="multi-rect"||o==="multi-cell")&&b.current!==void 0&&e.current!==void 0&&(b={...b,current:{...b.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(b,d)},[r,e,n,o,l,i,t]),s=$t.useCallback((c,d,g)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,columns:Qe.empty(),rows:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&r==="mixed"||r==="additive";h={current:p?e.current:void 0,columns:m?e.columns:Qe.empty(),rows:c}}t(h,!1)},[r,e,n,i,t]),u=$t.useCallback((c,d,g)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,rows:Qe.empty(),columns:c};else{const p=g&&n==="mixed"||n==="additive",m=g&&i==="mixed"||i==="additive";h={current:p?e.current:void 0,rows:m?e.rows:Qe.empty(),columns:c}}t(h,!1)},[r,e,n,i,t]);return[a,s,u]}function cv(e,t,n,r,i){const o=f.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const g=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=i?g.push({kind:Z.Loading,allowOverlay:!1}):g.push(t([h,d]));c.push(g)}return c}return e?.(u,r.signal)??[]},[r.signal,t,e,i]),l=e!==void 0?o:void 0,a=f.useCallback(u=>{if(l===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=l(c,r.signal);return typeof d=="function"?async()=>(await d()).map(g=>[{kind:Z.Loading,allowOverlay:!1},...g]):d.map(g=>[{kind:Z.Loading,allowOverlay:!1},...g])}return l(c,r.signal)},[r.signal,l,n]);return[e!==void 0?a:void 0,l]}function dv(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===Xl?"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:co()}}function fv(e,t){return e.map((r,i)=>{const o=t[i];return r.map(l=>l.span!==void 0&&l.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:dv(l))})}function Nu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function hv(e){const t=[];for(const n of e){const r=[];for(const i of n)i.format==="url"?r.push(i.rawValue?.toString()??""):i.format==="string-array"?r.push(i.formatted.map(o=>Nu(o,!0)).join(",")):r.push(i.doNotEscape===!0?i.formatted:Nu(i.formatted,!1));t.push(r.join(" "))}return t.join(`
166
+ `)}function fl(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Bu(e){return'"'+e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'}function gv(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function pv(e){const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const n of e){t.push("<tr>");for(const r of n){const i=`gdg-format="${r.format}"`;r.format==="url"?t.push(`<td ${i}><a href="${r.rawValue}">${fl(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${i}><ol>${r.formatted.map((o,l)=>`<li gdg-raw-value=${Bu(r.rawValue[l])}>`+fl(o)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${Bu(r.rawValue?.toString()??"")} ${i}>${fl(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function mv(e,t){const n=fv(e,t),r=hv(n),i=pv(n);return{textPlain:r,textHtml:i}}function Wu(e){const t=document.createElement("html");t.innerHTML=e.replace(/&nbsp;/g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],i=[];let o;for(;r.length>0;){const l=r.pop();if(l===void 0)break;if(l instanceof HTMLTableElement||l.nodeName==="TBODY")r.push(...[...l.children].reverse());else if(l instanceof HTMLTableRowElement)o!==void 0&&i.push(o),o=[],r.push(...[...l.children].reverse());else if(l instanceof HTMLTableCellElement){const a=l.cloneNode(!0),u=a.children.length===1&&a.children[0].nodeName==="P"?a.children[0]:null,c=u?.children.length===1&&u.children[0].nodeName==="FONT",d=a.querySelectorAll("br");for(const p of d)p.replaceWith(`
167
+ `);const g=a.getAttribute("gdg-raw-value"),h=a.getAttribute("gdg-format")??"string";if(a.querySelector("a")!==null)o?.push({rawValue:a.querySelector("a")?.getAttribute("href")??"",formatted:a.textContent??"",format:h});else if(a.querySelector("ol")!==null){const p=a.querySelectorAll("li");o?.push({rawValue:[...p].map(m=>m.getAttribute("gdg-raw-value")??""),formatted:[...p].map(m=>m.textContent??""),format:"string-array"})}else if(g!==null)o?.push({rawValue:gv(g),formatted:a.textContent??"",format:h});else{let p=a.textContent??"";c&&(p=p.replace(/\n(?!\n)/g,"")),o?.push({rawValue:p??"",formatted:p??"",format:h})}}}return o!==void 0&&i.push(o),i}function vv(e,t,n,r,i){const o=e;if(r==="allowPartial"||e.current===void 0||t===void 0)return e;let l=!1;do{if(e?.current===void 0)break;const a=e.current?.range,s=[];if(a.width>2){const d=t({x:a.x,y:a.y,width:1,height:a.height},i.signal);if(typeof d=="function")return o;s.push(...d);const g=t({x:a.x+a.width-1,y:a.y,width:1,height:a.height},i.signal);if(typeof g=="function")return o;s.push(...g)}else{const d=t({x:a.x,y:a.y,width:a.width,height:a.height},i.signal);if(typeof d=="function")return o;s.push(...d)}let u=a.x-n,c=a.x+a.width-1-n;for(const d of s)for(const g of d)g.span!==void 0&&(u=Math.min(g.span[0],u),c=Math.max(g.span[1],c));u===a.x-n&&c===a.x+a.width-1-n?l=!0:e={current:{cell:e.current.cell??[0,0],range:{x:u+n,y:a.y,width:c-u+1,height:a.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!l);return e}function Uu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function bv(e){let t;(function(a){a[a.None=0]="None",a[a.inString=1]="inString",a[a.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],i=0,o=t.None;e=e.replace(/\r\n/g,`
168
+ `);let l=0;for(const a of e){switch(o){case t.None:a===" "||a===`
169
+ `?(r.push(e.slice(i,l)),i=l+1,a===`
170
+ `&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===`
171
+ `)&&(r.push(Uu(e.slice(i,l))),i=l+1,a===`
172
+ `&&(n.push(r),r=[])),o=t.None);break}l++}return i<e.length&&r.push(Uu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function qu(e,t,n){const r=mv(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,s)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([s],{type:"text/html"})})]),!0),l=(a,s)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",s)}catch{o(a,s)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?l(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function jd(e){return e!==!0}function Xu(e){return typeof e=="string"?e:`${e}px`}const wv=()=>e=>e.innerWidth,yv=()=>e=>e.innerHeight,Cv=cn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[wv()],"wmyidgi-1":[yv()]}}),Sv=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(Cv,{innerHeight:Xu(n),innerWidth:Xu(t),...i},r)},xv=2,kv=1300;function Mv(e,t,n){const r=$t.useRef(0),[i,o]=e??[0,0];$t.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let l=!1,a=0;const s=u=>{if(!l){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/kv);const d=r.current**1.618*c*xv;t.current?.scrollBy(i*d,o*d),a=u,n?.()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{l=!0}},[t,i,o,n])}function Rv({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:l,remSize:a}){const[s,u,c,d,g,h]=$t.useMemo(()=>{if(!l||a===16)return[e,t,n,r,i,o];const p=a/16,m=e,w=Ld();return[typeof m=="number"?m*p:b=>Math.ceil(m(b)*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((i??0)*p),Math.ceil((o??0)*p)]},[n,t,i,o,a,e,l,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const kr={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 at(e,t){return e===!0?t:e===!1?"":e}function Gu(e){const t=ca.value;return{activateCell:at(e.activateCell," |Enter|shift+Enter"),clear:at(e.clear,"any+Escape"),closeOverlay:at(e.closeOverlay,"any+Escape"),acceptOverlayDown:at(e.acceptOverlayDown,"Enter"),acceptOverlayUp:at(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:at(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:at(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:at(e.delete,t?"Backspace|Delete":"Delete"),downFill:at(e.downFill,"primary+_68"),scrollToSelectedCell:at(e.scrollToSelectedCell,"primary+Enter"),goDownCell:at(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:at(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:at(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:at(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:at(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:at(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:at(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:at(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:at(e.goToFirstCell,"primary+Home"),goToFirstColumn:at(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:at(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:at(e.goToLastCell,"primary+End"),goToLastColumn:at(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:at(e.goToLastRow,"primary+ArrowDown"),goToNextPage:at(e.goToNextPage,"PageDown"),goToPreviousPage:at(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:at(e.rightFill,"primary+_82"),search:at(e.search,"primary+f"),selectAll:at(e.selectAll,"primary+a"),selectColumn:at(e.selectColumn,"ctrl+ "),selectGrowDown:at(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:at(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:at(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:at(e.selectGrowUp,"shift+ArrowUp"),selectRow:at(e.selectRow,"shift+ "),selectToFirstCell:at(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:at(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:at(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:at(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:at(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:at(e.selectToLastRow,"primary+shift+ArrowDown")}}function Ev(e){const t=_p(e);return $t.useMemo(()=>{if(t===void 0)return Gu(kr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??kr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??kr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??kr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??kr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??kr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??kr.selectToLastCell};return Gu({...kr,...n})},[t])}function Iv(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const l={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(l.subGroups=r.subGroups.map((a,s)=>t(a,i+1,[...o,s])).sort((a,s)=>a.headerIndex-s.headerIndex)),l}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function as(e,t){const n=[];function r(a,s,u=!1){let c=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:s;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=Iv(e.groups);for(let a=0;a<i.length;a++){const s=a<i.length-1?i[a+1].headerIndex:null;r(i[a],s)}let o=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...u}=a;return u})}function Hl(e,t){if(t===void 0||as.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 Tv(e,t,n,r){const i=$t.useMemo(()=>e===void 0?void 0:as(e,t),[e,t]),o=$t.useMemo(()=>i?.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),l=$t.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=$t.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),s=$t.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=Mr(r??e?.themeOverride,$t.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Hl(c,i);return d?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:u}:{rowHeight:a,rows:l,rowNumberMapper:s,getRowThemeOverride:u}}function Dv(e,t){const n=$t.useMemo(()=>e===void 0?void 0:as(e,t),[e,t]);return{getRowGroupingForPath:Zd,updateRowGroupingByPath:Kd,mapper:$t.useCallback(r=>{if(typeof r=="number")return Hl(r,n);const i=Hl(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Kd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,l)=>l===r?{...o,...n}:o):e.map((o,l)=>l===r?{...o,subGroups:Kd(o.subGroups??[],i,n)}:o)}function Zd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Zd(e[n].subGroups??[],r)}function Ov(e,t){const[n]=f.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function Pv(e,t,n,r,i){const[o,l]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,o]),[s,u,c]=Fp(a),d=f.useRef(i);d.current=i;const g=Ov(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),h=(s.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const p=(s.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&p){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,p,c,g]),{visibleRegion:s,setVisibleRegion:u,scrollRef:g}}const Lv=f.lazy(async()=>await Ul(()=>import("./data-grid-overlay-editor.DcuHuCyW.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let Fv=0;function _v(e){return Hm(Fu(Fu(e).filter(t=>t.span!==void 0).map(t=>Ir((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function Uo(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 qo={kind:Z.Loading,allowOverlay:!1},Xo={columns:Qe.empty(),rows:Qe.empty(),current:void 0},Av=(e,t)=>{const[n,r]=f.useState(Xo),[i,o]=f.useState(),l=f.useRef(null),a=f.useRef(null),[s,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:p,width:m,height:w,columns:b,rows:v,getCellContent:C,onCellClicked:I,onCellActivated:E,onFillPattern:R,onFinishedEditing:P,coercePasteValue:x,drawHeader:S,drawCell:F,editorBloom:D,onHeaderClicked:M,onColumnProposeMove:T,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:N,onCellContextMenu:X,className:Y,onHeaderContextMenu:ue,getCellsForSelection:ee,onGroupHeaderContextMenu:te,onGroupHeaderRenamed:ce,onCellEdited:se,onCellsEdited:he,onSearchResultsChanged:de,searchResults:ie,onSearchValueChange:H,searchValue:L,onKeyDown:G,onKeyUp:ne,keybindings:oe,editOnType:Se=!0,onRowAppended:me,onColumnAppended:et,onColumnMoved:xe,validateCell:bt,highlightRegions:St,rangeSelect:Ue="rect",columnSelect:re="multi",rowSelect:le="multi",rangeSelectionBlending:be="exclusive",columnSelectionBlending:fe="exclusive",rowSelectionBlending:we="exclusive",onDelete:$e,onDragStart:Fe,onMouseMove:tt,onPaste:Me,copyHeaders:Xe=!1,freezeColumns:Te=0,cellActivationBehavior:Ee="second-click",rowSelectionMode:Pe="auto",columnSelectionMode:ht="auto",onHeaderMenuClick:nt,onHeaderIndicatorClick:je,getGroupDetails:kt,rowGrouping:wt,onSearchClose:Dt,onItemHovered:Ot,onSelectionCleared:an,showSearch:Kt,onVisibleRegionChanged:In,gridSelection:It,onGridSelectionChange:gt,minColumnWidth:Tn=50,maxColumnWidth:yt=500,maxColumnAutoWidth:Zt,provideEditor:Sn,trailingRowOptions:De,freezeTrailingRows:ct=0,allowedFillDirections:pt="orthogonal",scrollOffsetX:Dn,scrollOffsetY:ln,verticalBorder:sn,onDragOverCell:On,onDrop:Jt,onColumnResize:Qt,onColumnResizeEnd:Be,onColumnResizeStart:Mt,customRenderers:Pn,fillHandle:Lt,experimental:mt,fixedShadowX:xn,fixedShadowY:lr,headerIcons:Vn,imageWindowLoader:B,initialSize:We,isDraggable:Ge,onDragLeave:Pt,onRowMoved:en,overscrollX:dn,overscrollY:kn,preventDiagonalScrolling:bn,rightElement:Bt,rightElementProps:Mn,trapFocus:Rn=!1,smoothScrollX:ye,smoothScrollY:Ft,scaleToRem:Yt=!1,rowHeight:$n=34,headerHeight:jt=36,groupHeaderHeight:qt=jt,theme:Xt,isOutsideClick:Ln,renderers:En,resizeIndicator:Co,scrollToActiveCell:Lr=!0,drawFocusRing:Ea=!0,portalElementRef:So}=e,ei=Ea==="no-editor"?i===void 0:Ea,qn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,wn=qn?.kind??e.rowMarkers??"none",ti=qn?.width??e.rowMarkerWidth,sr=qn?.startIndex??e.rowMarkerStartIndex??1,ni=qn?.theme??e.rowMarkerTheme,mr=qn?.headerTheme,ri=qn?.headerAlwaysVisible,ii=le!=="multi"||qn?.headerDisabled===!0,Fr=qn?.checkboxStyle??"square",vr=Math.max(Tn,20),oi=Math.max(yt,vr),Ia=Math.max(Zt??oi,vr),Li=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ae,rowNumberMapper:Fi,rowHeight:xo,getRowThemeOverride:_r}=Tv(wt,v,$n,h),Ta=f.useMemo(()=>Number.parseFloat(Li.fontSize),[Li]),{rowHeight:tr,headerHeight:_i,groupHeaderHeight:ko,theme:ai,overscrollX:Da,overscrollY:Oa}=Rv({groupHeaderHeight:qt,headerHeight:jt,overscrollX:dn,overscrollY:kn,remSize:Ta,rowHeight:xo,scaleToRem:Yt,theme:Xt}),nr=Ev(oe),br=ti??(v>1e4?48:v>1e3?44:v>100?36:32),Fn=wn!=="none",U=Fn?1:0,Ht=De!==void 0,ur=De?.sticky===!0,[Pa,Ar]=f.useState(!1),La=Kt??Pa,li=f.useCallback(()=>{Dt!==void 0?Dt():Ar(!1)},[Dt]),j=f.useMemo(()=>It===void 0?void 0:Uo(It,U),[It,U])??n,V=f.useRef();V.current===void 0&&(V.current=new AbortController),f.useEffect(()=>()=>V?.current.abort(),[]);const[Q,ke]=cv(ee,C,U,V.current,Ae),Ie=f.useCallback((y,A,_)=>{if(bt===void 0)return!0;const $=[y[0]-U,y[1]];return bt?.($,A,_)},[U,bt]),ge=f.useRef(It),pe=f.useCallback((y,A)=>{A&&(y=vv(y,Q,U,k,V.current)),gt!==void 0?(ge.current=Uo(y,-U),gt(ge.current)):r(y)},[gt,Q,U,k]),qe=Mr(Qt,f.useCallback((y,A,_,$)=>{Qt?.(b[_-U],A,_-U,$)},[Qt,U,b])),Re=Mr(Be,f.useCallback((y,A,_,$)=>{Be?.(b[_-U],A,_-U,$)},[Be,U,b])),Ze=Mr(Mt,f.useCallback((y,A,_,$)=>{Mt?.(b[_-U],A,_-U,$)},[Mt,U,b])),vt=Mr(S,f.useCallback((y,A)=>S?.({...y,columnIndex:y.columnIndex-U},A)??!1,[S,U])),fn=Mr(F,f.useCallback((y,A)=>F?.({...y,col:y.col-U},A)??!1,[F,U])),Wt=f.useCallback(y=>{if($e!==void 0){const A=$e(Uo(y,-U));return typeof A=="boolean"?A:Uo(A,U)}return!0},[$e,U]),[Rt,ut,Ye]=uv(j,pe,be,fe,we,Ue,O),dt=f.useMemo(()=>hr(Ld(),ai),[ai]),[zt,si]=f.useState([0,0,0]),Hr=f.useMemo(()=>{if(En===void 0)return{};const y={};for(const A of En)y[A.kind]=A;return y},[En]),tn=f.useCallback(y=>y.kind!==Z.Custom?Hr[y.kind]:Pn?.find(A=>A.isMatch(y)),[Pn,Hr]);let{sizedColumns:un,nonGrowWidth:_t}=Im(b,Ae,ke,zt[0]-(U===0?0:br)-zt[2],vr,Ia,dt,tn,V.current);wn!=="none"&&(_t+=br);const Nn=f.useMemo(()=>un.some(y=>y.group!==void 0),[un]),hn=Nn?_i+ko:_i,ui=j.rows.length,cr=wn==="none"?void 0:ui===0?!1:ui===Ae?!0:void 0,rt=f.useMemo(()=>wn==="none"?un:[{title:"",width:br,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ni,rowMarker:Fr,rowMarkerChecked:cr,headerRowMarkerTheme:mr,headerRowMarkerAlwaysVisible:ri,headerRowMarkerDisabled:ii},...un],[wn,un,br,ni,Fr,cr,mr,ri,ii]),nn=f.useRef({height:1,width:1,x:0,y:0}),zr=f.useRef(!1),{setVisibleRegion:wr,visibleRegion:dr,scrollRef:Vt}=Pv(Dn,ln,tr,nn,()=>zr.current=!0);nn.current=dr;const rh=dr.x+U,Mo=dr.y,gn=f.useRef(null),yn=f.useCallback(y=>{y===!0?gn.current?.focus():window.requestAnimationFrame(()=>{gn.current?.focus()})},[]),pn=Ht?Ae+1:Ae,Bn=f.useCallback(y=>{const A=U===0?y:y.map($=>({...$,location:[$.location[0]-U,$.location[1]]})),_=he?.(A);if(_!==!0)for(const $ of A)se?.($.location,$.value);return _},[se,he,U]),[Vr,Fa]=f.useState(),Ro=j.current!==void 0&&j.current.range.width*j.current.range.height>1?j.current.range:void 0,Ts=ei?j.current?.cell:void 0,Eo=Ts?.[0],Io=Ts?.[1],ih=f.useMemo(()=>{if((St===void 0||St.length===0)&&(Ro??Eo??Io??Vr)===void 0)return;const y=[];if(St!==void 0)for(const A of St){const _=rt.length-A.range.x-U;_>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+U,width:Math.min(_,A.range.width)},style:A.style})}return Vr!==void 0&&y.push({color:jr(dt.accentColor,0),range:Vr,style:"dashed"}),Ro!==void 0&&y.push({color:jr(dt.accentColor,.5),range:Ro,style:"solid-outline"}),Eo!==void 0&&Io!==void 0&&y.push({color:dt.accentColor,range:{x:Eo,y:Io,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[Vr,Ro,Eo,Io,St,rt.length,dt.accentColor,U]),Ds=f.useRef(rt);Ds.current=rt;const _n=f.useCallback(([y,A],_=!1)=>{const $=Ht&&A===pn-1;if(y===0&&Fn){if($)return qo;const K=Fi(A);return K===void 0?qo:{kind:Un.Marker,allowOverlay:!1,checkboxStyle:Fr,checked:j?.rows.hasIndex(A)===!0,markerKind:wn==="clickable-number"?"number":wn,row:sr+K,drawHandle:en!==void 0,cursor:wn==="clickable-number"?"pointer":void 0}}else if($){const z=y===U?De?.hint??"":"",W=Ds.current[y];if(W?.trailingRowOptions?.disabled===!0)return qo;{const J=W?.trailingRowOptions?.hint??z,ae=W?.trailingRowOptions?.addIcon??De?.addIcon;return{kind:Un.NewRow,hint:J,allowOverlay:!1,icon:ae}}}else{const K=y-U;if(_||mt?.strict===!0){const W=nn.current,J=W.x>K||K>W.x+W.width||W.y>A||A>W.y+W.height||A>=za.current,ae=K===W.extras?.selected?.[0]&&A===W.extras?.selected[1];let Ce=!1;if(W.extras?.freezeRegions!==void 0){for(const Et of W.extras.freezeRegions)if(Yr(Et,K,A)){Ce=!0;break}}if(J&&!ae&&!Ce)return qo}let z=C([K,A]);return U!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+U,z.span[1]+U]}),z}},[Ht,pn,Fn,Fi,Fr,j?.rows,wn,sr,en,U,De?.hint,De?.addIcon,mt?.strict,C]),_a=f.useCallback(y=>{let A=kt?.(y)??{name:y};return ce!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:_=>$a({group:A.name,bounds:_.bounds})}]}),A},[kt,ce]),To=f.useCallback(y=>{const[A,_]=y.cell,$=rt[A],q=$?.group!==void 0?_a($.group)?.overrideTheme:void 0,K=$?.themeOverride,z=_r?.(_);o({...y,theme:hr(dt,q,K,z,y.content.themeOverride)})},[_r,rt,_a,dt]),ci=f.useCallback((y,A,_)=>{if(j.current===void 0)return;const[$,q]=j.current.cell,K=_n([$,q]);if(K.kind!==Z.Boolean&&K.allowOverlay){let z=K;if(_!==void 0)switch(z.kind){case Z.Number:{const W=sp(()=>_==="-"?-0:Number.parseFloat(_),0);z={...z,data:Number.isNaN(W)?0:W};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:_};break}To({target:y,content:z,initialValue:_,cell:[$,q],highlight:_===void 0,forceEditMode:_!==void 0,activation:A})}else K.kind===Z.Boolean&&A.inputType==="keyboard"&&K.readonly!==!0&&(Bn([{location:j.current.cell,value:{...K,data:jd(K.data)}}]),gn.current?.damage([{cell:j.current.cell}]))},[_n,j,Bn,To]),Os=f.useCallback((y,A)=>{const _=gn.current?.getBounds(y,A);if(_===void 0||Vt.current===null)return;const $=_n([y,A]);$.allowOverlay&&To({target:_,content:$,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0,activation:{inputType:"keyboard",key:"Enter"}})},[_n,Vt,To]),Ut=f.useCallback((y,A,_="both",$=0,q=0,K=void 0)=>{if(Vt.current!==null){const z=gn.current,W=a.current,J=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,ae=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,Ce=typeof y!="number"&&y.unit==="px"?y.amount:void 0,Et=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(z!==null&&W!==null){let Je={x:0,y:0,width:0,height:0},Ke=0,ft=0;if((J!==void 0||ae!==void 0)&&(Je=z.getBounds((J??0)+U,ae??0)??Je,Je.width===0||Je.height===0))return;const it=W.getBoundingClientRect(),Ct=it.width/W.offsetWidth;if(Ce!==void 0&&(Je={...Je,x:Ce-it.left-Vt.current.scrollLeft,width:1}),Et!==void 0&&(Je={...Je,y:Et+it.top-Vt.current.scrollTop,height:1}),Je!==void 0){const xt={x:Je.x-$,y:Je.y-q,width:Je.width+2*$,height:Je.height+2*q};let mi=0;for(let Ga=0;Ga<Te;Ga++)mi+=un[Ga].width;let Bi=0;const Wi=ct+(ur?1:0);Wi>0&&(Bi=Qr(pn,Wi,tr));let ir=mi*Ct+it.left+U*br*Ct,vi=it.right,Wr=it.top+hn*Ct,bi=it.bottom-Bi*Ct;const Ao=Je.width+$*2;switch(K?.hAlign){case"start":vi=ir+Ao;break;case"end":ir=vi-Ao;break;case"center":ir=Math.floor((ir+vi)/2)-Ao/2,vi=ir+Ao;break}const Ho=Je.height+q*2;switch(K?.vAlign){case"start":bi=Wr+Ho;break;case"end":Wr=bi-Ho;break;case"center":Wr=Math.floor((Wr+bi)/2)-Ho/2,bi=Wr+Ho;break}ir>xt.x?Ke=xt.x-ir:vi<xt.x+xt.width&&(Ke=xt.x+xt.width-vi),Wr>xt.y?ft=xt.y-Wr:bi<xt.y+xt.height&&(ft=xt.y+xt.height-bi),_==="vertical"||typeof y=="number"&&y<Te?Ke=0:(_==="horizontal"||typeof A=="number"&&A>=pn-Wi)&&(ft=0),(Ke!==0||ft!==0)&&(Ct!==1&&(Ke/=Ct,ft/=Ct),Vt.current.scrollTo({left:Ke+Vt.current.scrollLeft,top:ft+Vt.current.scrollTop,behavior:K?.behavior??"auto"}))}}}},[U,ct,br,Vt,hn,Te,un,pn,ur,tr]),Aa=f.useRef(Os),Ha=f.useRef(C);Aa.current=Os,Ha.current=C;const za=f.useRef(Ae);za.current=Ae;const Ps=f.useRef(rt.length);Ps.current=rt.length;const yr=f.useCallback(async(y,A=!0,_)=>{if(rt[y]?.trailingRowOptions?.disabled===!0)return;const q=me?.();let K,z=!0;q!==void 0&&(K=await q,K==="top"&&(z=!1),typeof K=="number"&&(z=!1));let W=0;const J=()=>{if(za.current<=Ae){W<500&&window.setTimeout(J,W),W=50+W*2;return}const ae=typeof K=="number"?K:z?Ae:0;_o.current(y-U,ae,"both",0,0,_?{behavior:_}:void 0),Rt({cell:[y,ae],range:{x:y,y:ae,width:1,height:1}},!1,!1,"edit");const Ce=Ha.current([y-U,ae]);Ce.allowOverlay&&xi(Ce)&&Ce.readonly!==!0&&A&&window.setTimeout(()=>{Aa.current(y,ae)},0)};J()},[rt,me,U,Ae,Rt]),Do=f.useCallback(async(y,A=!0)=>{const _=et?.();let $,q=!0;_!==void 0&&($=await _,$==="left"&&(q=!1),typeof $=="number"&&(q=!1));let K=0;const z=()=>{if(Ps.current<=rt.length){K<500&&window.setTimeout(z,K),K=50+K*2;return}const W=typeof $=="number"?$:q?rt.length:0;Ut(W-U,y),Rt({cell:[W,y],range:{x:W,y,width:1,height:1}},!1,!1,"edit");const J=Ha.current([W-U,y]);J.allowOverlay&&xi(J)&&J.readonly!==!0&&A&&window.setTimeout(()=>{Aa.current(W,y)},0)};z()},[rt,et,U,Ut,Rt]),di=f.useCallback(y=>{const A=un[y]?.trailingRowOptions?.targetColumn??De?.targetColumn;if(typeof A=="number")return A+(Fn?1:0);if(typeof A=="object"){const _=b.indexOf(A);if(_>=0)return _+(Fn?1:0)}},[un,b,Fn,De?.targetColumn]),Cr=f.useRef(),fi=f.useRef(),Ai=f.useCallback((y,A)=>{const[_,$]=A;return hr(dt,rt[_]?.themeOverride,_r?.($),y.themeOverride)},[_r,rt,dt]),{mapper:$r}=Dv(wt,v),Xn=wt?.navigationBehavior,Hi=f.useCallback(y=>{const A=ca.value?y.metaKey:y.ctrlKey,_=A&&le==="multi",[$,q]=y.location,K=j.columns,z=j.rows,[W,J]=j.current?.cell??[];if(y.kind==="cell"){if(fi.current=void 0,Nr.current=[$,q],$===0&&Fn){if(Ht===!0&&q===Ae||wn==="number"||le==="none")return;const ae=_n(y.location);if(ae.kind!==Un.Marker)return;if(en!==void 0){const Je=tn(ae);Hn(Je?.kind===Un.Marker);const Ke=Je?.onClick?.({...y,cell:ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Ai(ae,y.location),preventDefault:()=>{}});if(Ke===void 0||Ke.checked===ae.checked)return}o(void 0),yn();const Ce=z.hasIndex(q),Et=Cr.current;if(le==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&Et!==void 0&&z.hasIndex(Et)){const Je=[Math.min(Et,q),Math.max(Et,q)+1];_||Pe==="multi"?ut(void 0,Je,!0):ut(Qe.fromSingleSelection(Je),void 0,_)}else le==="multi"&&(_||y.isTouch||Pe==="multi")?Ce?ut(z.remove(q),void 0,!0):(ut(void 0,q,!0),Cr.current=q):Ce&&z.length===1?ut(Qe.empty(),void 0,A):(ut(Qe.fromSingleSelection(q),void 0,A),Cr.current=q)}else if($>=U&&Ht&&q===Ae){const ae=di($);yr(ae??$)}else if(W!==$||J!==q){const ae=_n(y.location),Ce=tn(ae);if(Ce?.onSelect!==void 0){let Ke=!1;if(Ce.onSelect({...y,cell:ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Ke=!0,theme:Ai(ae,y.location)}),Ke)return}if(Xn==="block"&&$r(q).isGroupHeader)return;const Et=ur&&q===Ae,Je=ur&&j!==void 0&&j.current?.cell[1]===Ae;if((y.shiftKey||y.isLongTouch===!0)&&W!==void 0&&J!==void 0&&j.current!==void 0&&!Je){if(Et)return;const Ke=Math.min($,W),ft=Math.max($,W),it=Math.min(q,J),Ct=Math.max(q,J);Rt({...j.current,range:{x:Ke,y:it,width:ft-Ke+1,height:Ct-it+1}},!0,A,"click"),Cr.current=void 0,yn()}else Rt({cell:[$,q],range:{x:$,y:q,width:1,height:1}},!0,A,"click"),Cr.current=void 0,o(void 0),yn()}}else if(y.kind==="header")if(Nr.current=[$,q],o(void 0),Fn&&$===0)Cr.current=void 0,fi.current=void 0,!ii&&le==="multi"&&(z.length!==Ae?ut(Qe.fromSingleSelection([0,Ae]),void 0,A):ut(Qe.empty(),void 0,A),yn());else{const ae=fi.current;if(re==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&ae!==void 0&&K.hasIndex(ae)){const Ce=[Math.min(ae,$),Math.max(ae,$)+1];A||y.isTouch||ht==="multi"?Ye(void 0,Ce,A):Ye(Qe.fromSingleSelection(Ce),void 0,A)}else re==="multi"&&(A||y.isTouch||ht==="multi")?(K.hasIndex($)?Ye(K.remove($),void 0,A):Ye(void 0,$,A),fi.current=$):re!=="none"&&(K.hasIndex($)?Ye(K.remove($),void 0,A):Ye(Qe.fromSingleSelection($),void 0,A),fi.current=$);Cr.current=void 0,yn()}else y.kind===Kn?Nr.current=[$,q]:y.kind===da&&!y.isMaybeScrollbar&&(pe(Xo,!1),o(void 0),yn(),an?.(),Cr.current=void 0,fi.current=void 0)},[le,re,j,Fn,U,Ht,Ae,wn,_n,en,yn,Pe,ht,tn,Ai,ut,di,yr,Xn,$r,ur,Rt,ii,Ye,pe,an]),zi=f.useRef(!1),Nr=f.useRef(),Ls=f.useRef(dr),rr=f.useRef(),oh=f.useCallback(y=>{if(hi.current=!1,Ls.current=nn.current,y.button!==0&&y.button!==1){rr.current=void 0;return}const A=performance.now();rr.current={button:y.button,time:A,location:y.location},y?.kind==="header"&&(zi.current=!0);const _=y.kind==="cell"&&y.isFillHandle;!_&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:j,fillHandle:_}),Nr.current=void 0,!y.isTouch&&y.button===0&&!_?Hi(y):!y.isTouch&&y.button===1&&(Nr.current=y.location))},[j,Hi]),[Va,$a]=f.useState(),Fs=f.useCallback(y=>{if(y.kind!==Kn||re!=="multi")return;const A=ca.value?y.metaKey:y.ctrlKey,[_]=y.location,$=j.columns;if(_<U)return;const q=rt[_];let K=_,z=_;for(let W=_-1;W>=U&&ho(q.group,rt[W].group);W--)K--;for(let W=_+1;W<rt.length&&ho(q.group,rt[W].group);W++)z++;if(yn(),A||y.isTouch||ht==="multi")if($.hasAll([K,z+1])){let W=$;for(let J=K;J<=z;J++)W=W.remove(J);Ye(W,void 0,A)}else Ye(void 0,[K,z+1],A);else Ye(Qe.fromSingleSelection([K,z+1]),void 0,A)},[re,yn,j.columns,rt,U,Ye,ht]),hi=f.useRef(!1),Oo=f.useCallback(async y=>{if(Q!==void 0&&qe!==void 0){const A=nn.current.y,_=nn.current.height;let $=Q({x:y,y:A,width:1,height:Math.min(_,Ae-A)},V.current.signal);typeof $!="object"&&($=await $());const q=un[y-U],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=dt.baseFontFull;const W=Ad(z,dt,q,0,$,vr,oi,!1,tn);qe?.(q,W.width,y,W.width)}}},[un,Q,oi,dt,vr,qe,U,Ae,tn]),[ah,Na]=f.useState(),gi=f.useCallback(async(y,A)=>{const _=y.current?.range;if(_===void 0||Q===void 0||A.current===void 0)return;const $=A.current.range;if(R!==void 0){let W=!1;if(R({fillDestination:{...$,x:$.x-U},patternSource:{..._,x:_.x-U},preventDefault:()=>W=!0}),W)return}let q=Q(_,V.current.signal);typeof q!="object"&&(q=await q());const K=q,z=[];for(let W=0;W<$.width;W++)for(let J=0;J<$.height;J++){const ae=[$.x+W,$.y+J];if(kd(ae,_))continue;const Ce=K[J%_.height][W%_.width];Mi(Ce)||!xi(Ce)||z.push({location:ae,value:{...Ce}})}Bn(z),gn.current?.damage(z.map(W=>({cell:W.location})))},[Q,Bn,R,U]),_s=f.useCallback(()=>{if(j.current===void 0||j.current.range.width<=1)return;const y={...j,current:{...j.current,range:{...j.current.range,width:1}}};gi(y,j)},[gi,j]),As=f.useCallback(()=>{if(j.current===void 0||j.current.range.height<=1)return;const y={...j,current:{...j.current,range:{...j.current.range,height:1}}};gi(y,j)},[gi,j]),lh=f.useCallback((y,A)=>{const _=s;if(u(void 0),Fa(void 0),Na(void 0),zi.current=!1,A)return;if(_?.fillHandle===!0&&j.current!==void 0&&_.previousSelection?.current!==void 0){if(Vr===void 0)return;const Ce={...j,current:{...j.current,range:Nd(_.previousSelection.current.range,Vr)}};gi(_.previousSelection,Ce),pe(Ce,!0);return}const[$,q]=y.location,[K,z]=Nr.current??[],W=()=>{hi.current=!0},J=Ce=>{const Et=Ce.isTouch||K===$&&z===q;if(Et&&I?.([$-U,q],{...Ce,preventDefault:W}),Ce.button===1)return!hi.current;if(!hi.current){const Je=_n(y.location),Ke=tn(Je);if(Ke!==void 0&&Ke.onClick!==void 0&&Et){const it=Ke.onClick({...Ce,cell:Je,posX:Ce.localEventX,posY:Ce.localEventY,bounds:Ce.bounds,theme:Ai(Je,y.location),preventDefault:W});it!==void 0&&!Mi(it)&&Si(it)&&(Bn([{location:Ce.location,value:it}]),gn.current?.damage([{cell:Ce.location}]))}if(hi.current||j.current===void 0)return!1;let ft=!1;switch(Je.activationBehaviorOverride??Ee){case"double-click":case"second-click":{if(_?.previousSelection?.current?.cell===void 0)break;const[it,Ct]=j.current.cell,[xt,mi]=_.previousSelection.current.cell;ft=$===it&&$===xt&&q===Ct&&q===mi&&(Ce.isDoubleClick===!0||Ee==="second-click");break}case"single-click":{ft=!0;break}}if(ft){const Ct={inputType:"pointer",pointerActivation:Ce.isDoubleClick===!0?"double-click":Je.activationBehaviorOverride??Ee,pointerType:Ce.isTouch?"touch":"mouse"};return E?.([$-U,q],Ct),ci(Ce.bounds,Ct),!0}}return!1},ae=y.location[0]-U;if(y.isTouch){const Ce=nn.current,Et=Ls.current;if(Ce.x!==Et.x||Ce.y!==Et.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&lo(j.current?.cell,y.location)){X?.([ae,y.location[1]],{...y,preventDefault:W});return}else if(y.kind==="header"&&j.columns.hasIndex($)){ue?.(ae,{...y,preventDefault:W});return}else if(y.kind===Kn){if(ae<0)return;te?.(ae,{...y,preventDefault:W});return}}y.kind==="cell"?J(y)||Hi(y):y.kind===Kn?N?.(ae,{...y,preventDefault:W}):(y.kind===Rr&&M?.(ae,{...y,preventDefault:W}),Hi(y));return}if(y.kind==="header"){if(ae<0)return;y.isEdge?y.isDoubleClick===!0&&Oo($):y.button===0&&$===K&&q===z&&M?.(ae,{...y,preventDefault:W})}if(y.kind===Kn){if(ae<0)return;y.button===0&&$===K&&q===z&&(N?.(ae,{...y,preventDefault:W}),hi.current||Fs(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&J(y),Nr.current=void 0},[s,j,U,Vr,gi,pe,I,_n,tn,Ee,Ai,Bn,E,ci,X,ue,te,Hi,N,M,Oo,Fs]),sh=f.useCallback(y=>{const A={...y,location:[y.location[0]-U,y.location[1]]};tt?.(A),s!==void 0&&y.buttons===0&&(u(void 0),Fa(void 0),Na(void 0),zi.current=!1),Na(_=>zi.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===_?.[0]&&y.scrollEdge[1]===_[1]?_:s===void 0||(rr.current?.location[0]??0)<U?void 0:y.scrollEdge)},[s,tt,U]),uh=f.useCallback((y,A)=>{nt?.(y-U,A)},[nt,U]),ch=f.useCallback((y,A)=>{je?.(y-U,A)},[je,U]),pi=j?.current?.cell,dh=f.useCallback((y,A,_,$,q,K)=>{zr.current=!1;let z=pi;z!==void 0&&(z=[z[0]-U,z[1]]);const W=Te===0?void 0:{x:0,y:y.y,width:Te,height:y.height},J=[];W!==void 0&&J.push(W),ct>0&&(J.push({x:y.x-U,y:Ae-ct,width:y.width,height:ct}),Te>0&&J.push({x:0,y:Ae-ct,width:Te,height:ct}));const ae={x:y.x-U,y:y.y,width:y.width,height:Ht&&y.y+y.height>=Ae?y.height-1:y.height,tx:q,ty:K,extras:{selected:z,freezeRegion:W,freezeRegions:J}};nn.current=ae,wr(ae),si([A,_,$]),In?.(ae,ae.tx,ae.ty,ae.extras)},[pi,U,Ht,Ae,Te,ct,wr,In]),fh=Mr(T,f.useCallback((y,A)=>T?.(y-U,A-U)!==!1,[T,U])),hh=Mr(xe,f.useCallback((y,A)=>{xe?.(y-U,A-U),re!=="none"&&Ye(Qe.fromSingleSelection(A),void 0,!0)},[re,xe,U,Ye])),Ba=f.useRef(!1),gh=f.useCallback(y=>{if(y.location[0]===0&&U>0){y.preventDefault();return}Fe?.({...y,location:[y.location[0]-U,y.location[1]]}),y.defaultPrevented()||(Ba.current=!0),u(void 0)},[Fe,U]),ph=f.useCallback(()=>{Ba.current=!1},[]),Hs=wt?.selectionBehavior,Po=f.useCallback(y=>{if(Hs!=="block-spanning")return;const{isGroupHeader:A,path:_,groupRows:$}=$r(y);if(A)return[y,y];const q=_[_.length-1],K=y-q,z=y+$-q-1;return[K,z]},[$r,Hs]),Wa=f.useRef(),Ua=f.useCallback(y=>{if(!Gd(y,Wa.current)&&(Wa.current=y,!(rr?.current?.button!==void 0&&rr.current.button>=1))){if(y.buttons!==0&&s!==void 0&&rr.current?.location[0]===0&&U===1&&le==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(rr.current.location[1])&&j.rows.hasIndex(rr.current.location[1])){const A=Math.min(rr.current.location[1],y.location[1]),_=Math.max(rr.current.location[1],y.location[1])+1;ut(Qe.fromSingleSelection([A,_]),void 0,!1)}else if(y.buttons!==0&&s!==void 0&&j.current!==void 0&&!Ba.current&&!zi.current&&(Ue==="rect"||Ue==="multi-rect")){const[A,_]=j.current.cell;let[$,q]=y.location;if(q<0&&(q=nn.current.y),s.fillHandle===!0&&s.previousSelection?.current!==void 0){const K=s.previousSelection.current.range;q=Math.min(q,Ht?Ae-1:Ae);const z=m0(K,$,q,pt);Fa(z)}else{if(Ht&&_===Ae)return;if(Ht&&q===Ae)if(y.kind===da)q--;else return;$=Math.max($,U);const W=Po(_);q=W===void 0?q:Wn(q,W[0],W[1]);const J=$-A,ae=q-_,Ce={x:J>=0?A:$,y:ae>=0?_:q,width:Math.abs(J)+1,height:Math.abs(ae)+1};Rt({...j.current,range:Ce},!0,!1,"drag")}}Ot?.({...y,location:[y.location[0]-U,y.location[1]]})}},[s,U,le,j,Ue,Ot,ut,Ht,Ae,pt,Po,Rt]),mh=f.useCallback(()=>{const y=Wa.current;if(y===void 0)return;const[A,_]=y.scrollEdge;let[$,q]=y.location;const K=nn.current;A===-1?$=K.extras?.freezeRegion?.x??K.x:A===1&&($=K.x+K.width),_===-1?q=Math.max(0,K.y):_===1&&(q=Math.min(Ae-1,K.y+K.height)),$=Wn($,0,rt.length-1),q=Wn(q,0,Ae-1),Ua({...y,location:[$,q]})},[rt.length,Ua,Ae]);Mv(ah,Vt,mh);const Gn=f.useCallback(y=>{if(j.current===void 0)return;const[A,_]=y,[$,q]=j.current.cell,K=j.current.range;let z=K.x,W=K.x+K.width,J=K.y,ae=K.y+K.height;const[Ce,Et]=Po(q)??[0,Ae-1],Je=Et+1;if(_!==0)switch(_){case 2:{ae=Je,J=q,Ut(0,ae,"vertical");break}case-2:{J=Ce,ae=q+1,Ut(0,J,"vertical");break}case 1:{J<q?(J++,Ut(0,J,"vertical")):(ae=Math.min(Je,ae+1),Ut(0,ae,"vertical"));break}case-1:{ae>q+1?(ae--,Ut(0,ae,"vertical")):(J=Math.max(Ce,J-1),Ut(0,J,"vertical"));break}default:co()}if(A!==0)if(A===2)W=rt.length,z=$,Ut(W-1-U,0,"horizontal");else if(A===-2)z=U,W=$+1,Ut(z-U,0,"horizontal");else{let Ke=[];if(Q!==void 0){const ft=Q({x:z,y:J,width:W-z-U,height:ae-J},V.current.signal);typeof ft=="object"&&(Ke=_v(ft))}if(A===1){let ft=!1;if(z<$){if(Ke.length>0){const it=Ir(z+1,$+1).find(Ct=>!Ke.includes(Ct-U));it!==void 0&&(z=it,ft=!0)}else z++,ft=!0;ft&&Ut(z,0,"horizontal")}ft||(W=Math.min(rt.length,W+1),Ut(W-1-U,0,"horizontal"))}else if(A===-1){let ft=!1;if(W>$+1){if(Ke.length>0){const it=Ir(W-1,$,-1).find(Ct=>!Ke.includes(Ct-U));it!==void 0&&(W=it,ft=!0)}else W--,ft=!0;ft&&Ut(W-U,0,"horizontal")}ft||(z=Math.max(U,z-1),Ut(z-U,0,"horizontal"))}else co()}Rt({cell:j.current.cell,range:{x:z,y:J,width:W-z,height:ae-J}},!0,!1,"keyboard-select")},[Q,Po,j,rt.length,U,Ae,Ut,Rt]),qa=f.useRef(Lr);qa.current=Lr;const Sr=f.useCallback((y,A,_,$)=>{const q=pn-(_?0:1);y=Wn(y,U,un.length-1+U),A=Wn(A,0,q);const K=pi?.[0],z=pi?.[1];if(y===K&&A===z)return!1;if($&&j.current!==void 0){const W=[...j.current.rangeStack];(j.current.range.width>1||j.current.range.height>1)&&W.push(j.current.range),pe({...j,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:W}},!0)}else Rt({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),qa.current&&Ut(y-U,A),!0},[pn,U,un.length,pi,j,Ut,pe,Rt]),vh=f.useCallback((y,A)=>{i?.cell!==void 0&&y!==void 0&&Si(y)&&(Bn([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{gn.current?.damage([{cell:i.cell}])})),yn(!0),o(void 0);const[_,$]=A;if(j.current!==void 0&&(_!==0||$!==0)){const q=j.current.cell[1]===pn-1&&y!==void 0,K=j.current.cell[0]===rt.length-1&&y!==void 0;let z=!0;if(q&&$===1&&me!==void 0){z=!1;const W=j.current.cell[0]+_,J=di(W);yr(J??W,!1)}if(K&&_===1&&et!==void 0){z=!1;const W=j.current.cell[1]+$;Do(W,!1)}z&&Sr(Wn(j.current.cell[0]+_,0,rt.length-1),Wn(j.current.cell[1]+$,0,pn-1),q,!1)}P?.(y,A)},[i?.cell,yn,j,P,Bn,pn,Sr,rt.length,yr,Do,me,et,di]),bh=f.useMemo(()=>`gdg-overlay-${Fv++}`,[]),Br=f.useCallback(y=>{yn();const A=[];for(let _=y.x;_<y.x+y.width;_++)for(let $=y.y;$<y.y+y.height;$++){const q=C([_-U,$]);if(!q.allowOverlay&&q.kind!==Z.Boolean)continue;let K;if(q.kind===Z.Custom){const z=tn(q),W=z?.provideEditor?.({...q,location:[_-U,$]});z?.onDelete!==void 0?K=z.onDelete(q):up(W)&&(K=W?.deletedValue?.(q))}else(Si(q)&&q.allowOverlay||q.kind===Z.Boolean)&&(K=tn(q)?.onDelete?.(q));K!==void 0&&!Mi(K)&&Si(K)&&A.push({location:[_,$],value:K})}Bn(A),gn.current?.damage(A.map(_=>({cell:_.location})))},[yn,C,tn,Bn,U]),Vi=i!==void 0,zs=f.useCallback(y=>{const A=()=>{y.stopPropagation(),y.preventDefault()},_={didMatch:!1},{bounds:$}=y,q=j.columns,K=j.rows,z=nr;if(!Vi&&ot(z.clear,y,_))pe(Xo,!1),an?.();else if(!Vi&&ot(z.selectAll,y,_))pe({columns:Qe.empty(),rows:Qe.empty(),current:{cell:j.current?.cell??[U,0],range:{x:U,y:0,width:b.length,height:Ae},rangeStack:[]}},!1);else if(ot(z.search,y,_))l?.current?.focus({preventScroll:!0}),Ar(!0);else if(ot(z.delete,y,_)){const it=Wt?.(j)??!0;if(it!==!1){const Ct=it===!0?j:it;if(Ct.current!==void 0){Br(Ct.current.range);for(const xt of Ct.current.rangeStack)Br(xt)}for(const xt of Ct.rows)Br({x:U,y:xt,width:b.length,height:1});for(const xt of Ct.columns)Br({x:xt,y:0,width:1,height:Ae})}}if(_.didMatch)return A(),!0;if(j.current===void 0)return!1;let[W,J]=j.current.cell;const[,ae]=j.current.cell;let Ce=!1,Et=!1;if(ot(z.scrollToSelectedCell,y,_))_o.current(W-U,J);else if(re!=="none"&&ot(z.selectColumn,y,_))q.hasIndex(W)?Ye(q.remove(W),void 0,!0):re==="single"?Ye(Qe.fromSingleSelection(W),void 0,!0):Ye(void 0,W,!0);else if(le!=="none"&&ot(z.selectRow,y,_))K.hasIndex(J)?ut(K.remove(J),void 0,!0):le==="single"?ut(Qe.fromSingleSelection(J),void 0,!0):ut(void 0,J,!0);else if(!Vi&&$!==void 0&&ot(z.activateCell,y,_))if(J===Ae&&Ht)window.setTimeout(()=>{const it=di(W);yr(it??W)},0);else{const it={inputType:"keyboard",key:y.key};E?.([W-U,J],it),ci($,it)}else j.current.range.height>1&&ot(z.downFill,y,_)?As():j.current.range.width>1&&ot(z.rightFill,y,_)?_s():ot(z.goToNextPage,y,_)?J+=Math.max(1,nn.current.height-4):ot(z.goToPreviousPage,y,_)?J-=Math.max(1,nn.current.height-4):ot(z.goToFirstCell,y,_)?(o(void 0),J=0,W=0):ot(z.goToLastCell,y,_)?(o(void 0),J=Number.MAX_SAFE_INTEGER,W=Number.MAX_SAFE_INTEGER):ot(z.selectToFirstCell,y,_)?(o(void 0),Gn([-2,-2])):ot(z.selectToLastCell,y,_)?(o(void 0),Gn([2,2])):Vi?(ot(z.closeOverlay,y,_)&&o(void 0),ot(z.acceptOverlayDown,y,_)&&(o(void 0),J++),ot(z.acceptOverlayUp,y,_)&&(o(void 0),J--),ot(z.acceptOverlayLeft,y,_)&&(o(void 0),W--),ot(z.acceptOverlayRight,y,_)&&(o(void 0),W++)):(ot(z.goDownCell,y,_)?J+=1:ot(z.goUpCell,y,_)?J-=1:ot(z.goRightCell,y,_)?W+=1:ot(z.goLeftCell,y,_)?W-=1:ot(z.goDownCellRetainSelection,y,_)?(J+=1,Ce=!0):ot(z.goUpCellRetainSelection,y,_)?(J-=1,Ce=!0):ot(z.goRightCellRetainSelection,y,_)?(W+=1,Ce=!0):ot(z.goLeftCellRetainSelection,y,_)?(W-=1,Ce=!0):ot(z.goToLastRow,y,_)?J=Ae-1:ot(z.goToFirstRow,y,_)?J=Number.MIN_SAFE_INTEGER:ot(z.goToLastColumn,y,_)?W=Number.MAX_SAFE_INTEGER:ot(z.goToFirstColumn,y,_)?W=Number.MIN_SAFE_INTEGER:(Ue==="rect"||Ue==="multi-rect")&&(ot(z.selectGrowDown,y,_)?Gn([0,1]):ot(z.selectGrowUp,y,_)?Gn([0,-1]):ot(z.selectGrowRight,y,_)?Gn([1,0]):ot(z.selectGrowLeft,y,_)?Gn([-1,0]):ot(z.selectToLastRow,y,_)?Gn([0,2]):ot(z.selectToFirstRow,y,_)?Gn([0,-2]):ot(z.selectToLastColumn,y,_)?Gn([2,0]):ot(z.selectToFirstColumn,y,_)&&Gn([-2,0])),Et=_.didMatch);if(Xn!==void 0&&Xn!=="normal"&&J!==ae){const it=Xn==="skip-up"||Xn==="skip"||Xn==="block",Ct=Xn==="skip-down"||Xn==="skip"||Xn==="block",xt=J<ae;if(xt&&it){for(;J>=0&&$r(J).isGroupHeader;)J--;J<0&&(J=ae)}else if(!xt&&Ct){for(;J<Ae&&$r(J).isGroupHeader;)J++;J>=Ae&&(J=ae)}}const Ke=Sr(W,J,!1,Ce),ft=_.didMatch;return ft&&(Ke||!Et||Rn)&&A(),ft},[Xn,Vi,j,nr,re,le,Ue,U,$r,Ae,Sr,pe,an,b.length,Wt,Rn,Br,Ye,ut,Ht,di,yr,E,ci,As,_s,Gn]),$i=f.useCallback(y=>{let A=!1;if(G!==void 0&&G({...y,...y.location&&{location:[y.location[0]-U,y.location[1]]},cancel:()=>{A=!0}}),A||zs(y)||j.current===void 0)return;const[_,$]=j.current.cell,q=nn.current;if(Se&&!y.metaKey&&!y.ctrlKey&&j.current!==void 0&&y.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(y.key)&&y.bounds!==void 0&&xi(C([_-U,Math.max(0,Math.min($,Ae-1))]))){if((!Ht||$!==Ae)&&(q.y>$||$>q.y+q.height||q.x>_||_>q.x+q.width))return;const K={inputType:"keyboard",key:y.key};E?.([_-U,$],K),ci(y.bounds,K,y.key),y.stopPropagation(),y.preventDefault()}},[Se,G,zs,j,C,U,Ae,Ht,E,ci]),wh=f.useCallback((y,A)=>{const _=y.location[0]-U;if(y.kind==="header"&&ue?.(_,{...y,preventDefault:A}),y.kind===Kn){if(_<0)return;te?.(_,{...y,preventDefault:A})}if(y.kind==="cell"){const[$,q]=y.location;X?.([_,q],{...y,preventDefault:A}),fm(j,y.location)||Sr($,q,!1,!1)}},[j,X,te,ue,U,Sr]),Xa=f.useCallback(async y=>{if(!nr.paste)return;function A(z,W,J,ae){const Ce=typeof J=="object"?J?.join(`
173
+ `)??"":J?.toString()??"";if(!Mi(z)&&xi(z)&&z.readonly!==!0){const Et=x?.(Ce,z);if(Et!==void 0&&Si(Et))return{location:W,value:Et};const Je=tn(z);if(Je===void 0)return;if(Je.kind===Z.Custom){Hn(z.kind===Z.Custom);const Ke=Je.onPaste?.(Ce,z.data);return Ke===void 0?void 0:{location:W,value:{...z,data:Ke}}}else{const Ke=Je.onPaste?.(Ce,z,{formatted:ae,formattedString:typeof ae=="string"?ae:ae?.join(`
174
+ `),rawValue:J});return Ke===void 0?void 0:(Hn(Ke.kind===z.kind),{location:W,value:Ke})}}}const _=j.columns,$=j.rows,q=Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let K;if(j.current!==void 0?K=[j.current.range.x,j.current.range.y]:_.length===1?K=[_.first()??0,0]:$.length===1&&(K=[U,$.first()??0]),q&&K!==void 0){let z,W;const J="text/plain",ae="text/html";if(navigator.clipboard.read!==void 0){const Ke=await navigator.clipboard.read();for(const ft of Ke){if(ft.types.includes(ae)){const Ct=await(await ft.getType(ae)).text(),xt=Wu(Ct);if(xt!==void 0){z=xt;break}}ft.types.includes(J)&&(W=await(await ft.getType(J)).text())}}else if(navigator.clipboard.readText!==void 0)W=await navigator.clipboard.readText();else if(y!==void 0&&y?.clipboardData!==null){if(y.clipboardData.types.includes(ae)){const Ke=y.clipboardData.getData(ae);z=Wu(Ke)}z===void 0&&y.clipboardData.types.includes(J)&&(W=y.clipboardData.getData(J))}else return;const[Ce,Et]=K,Je=[];do{if(Me===void 0){const Ke=_n(K),ft=W??z?.map(Ct=>Ct.map(xt=>xt.rawValue).join(" ")).join(" ")??"",it=A(Ke,K,ft,void 0);it!==void 0&&Je.push(it);break}if(z===void 0){if(W===void 0)return;z=bv(W)}if(Me===!1||typeof Me=="function"&&Me?.([K[0]-U,K[1]],z.map(Ke=>Ke.map(ft=>ft.rawValue?.toString()??"")))!==!0)return;for(const[Ke,ft]of z.entries()){if(Ke+Et>=Ae)break;for(const[it,Ct]of ft.entries()){const xt=[it+Ce,Ke+Et],[mi,Bi]=xt;if(mi>=rt.length||Bi>=pn)continue;const Wi=_n(xt),ir=A(Wi,xt,Ct.rawValue,Ct.formatted);ir!==void 0&&Je.push(ir)}}}while(!1);Bn(Je),gn.current?.damage(Je.map(Ke=>({cell:Ke.location})))}},[x,tn,_n,j,nr.paste,Vt,rt.length,Bn,pn,Me,U,Ae]);Cn("paste",Xa,d,!1,!0);const Ni=f.useCallback(async(y,A)=>{if(!nr.copy)return;const _=A===!0||Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,$=j.columns,q=j.rows,K=(z,W)=>{if(!Xe)qu(z,W,y);else{const J=W.map(ae=>({kind:Z.Text,data:b[ae].title,displayData:b[ae].title,allowOverlay:!1}));qu([J,...z],W,y)}};if(_&&Q!==void 0){if(j.current!==void 0){let z=Q(j.current.range,V.current.signal);typeof z!="object"&&(z=await z()),K(z,Ir(j.current.range.x-U,j.current.range.x+j.current.range.width-U))}else if(q!==void 0&&q.length>0){const W=[...q].map(J=>{const ae=Q({x:U,y:J,width:b.length,height:1},V.current.signal);return typeof ae=="object"?ae[0]:ae().then(Ce=>Ce[0])});if(W.some(J=>J instanceof Promise)){const J=await Promise.all(W);K(J,Ir(b.length))}else K(W,Ir(b.length))}else if($.length>0){const z=[],W=[];for(const J of $){let ae=Q({x:J,y:0,width:1,height:Ae},V.current.signal);typeof ae!="object"&&(ae=await ae()),z.push(ae),W.push(J-U)}if(z.length===1)K(z[0],W);else{const J=z.reduce((ae,Ce)=>ae.map((Et,Je)=>[...Et,...Ce[Je]]));K(J,W)}}}},[b,Q,j,nr.copy,U,Vt,Ae,Xe]);Cn("copy",Ni,d,!1,!1);const yh=f.useCallback(async y=>{if(!(!nr.cut||!(Vt.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Ni(y),j.current!==void 0)){let _={current:{cell:j.current.cell,range:j.current.range,rangeStack:[]},rows:Qe.empty(),columns:Qe.empty()};const $=Wt?.(_);if($===!1||(_=$===!0?_:$,_.current===void 0))return;Br(_.current.range)}},[Br,j,nr.cut,Ni,Vt,Wt]);Cn("cut",yh,d,!1,!1);const Ch=f.useCallback((y,A)=>{if(de!==void 0){U!==0&&(y=y.map(q=>[q[0]-U,q[1]])),de(y,A);return}if(y.length===0||A===-1)return;const[_,$]=y[A];c.current!==void 0&&c.current[0]===_&&c.current[1]===$||(c.current=[_,$],Sr(_,$,!1,!1))},[de,U,Sr]),[Lo,Fo]=It?.current?.cell??[],_o=f.useRef(Ut);_o.current=Ut,f.useLayoutEffect(()=>{qa.current&&!zr.current&&Lo!==void 0&&Fo!==void 0&&(Lo!==ge.current?.current?.cell[0]||Fo!==ge.current?.current?.cell[1])&&_o.current(Lo,Fo),zr.current=!1},[Lo,Fo]);const Vs=j.current!==void 0&&(j.current.cell[0]>=rt.length||j.current.cell[1]>=pn);f.useLayoutEffect(()=>{Vs&&pe(Xo,!1)},[Vs,pe]);const Sh=f.useMemo(()=>Ht===!0&&De?.tint===!0?Qe.fromSingleSelection(pn-1):Qe.empty(),[pn,Ht,De?.tint]),xh=f.useCallback(y=>typeof sn=="boolean"?sn:sn?.(y-U)??!0,[U,sn]),kh=f.useMemo(()=>{if(Va===void 0||a.current===null)return null;const{bounds:y,group:A}=Va,_=a.current.getBoundingClientRect();return f.createElement(lv,{bounds:y,group:A,canvasBounds:_,onClose:()=>$a(void 0),onFinish:$=>{$a(void 0),ce?.(A,$)}})},[ce,Va]),Mh=Math.min(rt.length,Te+(Fn?1:0));f.useImperativeHandle(t,()=>({appendRow:(y,A)=>yr(y+U,A),appendColumn:(y,A)=>Do(y,A),updateCells:y=>(U!==0&&(y=y.map(A=>({cell:[A.cell[0]+U,A.cell[1]]}))),gn.current?.damage(y)),getBounds:(y,A)=>{if(!(a?.current===null||Vt?.current===null)){if(y===void 0&&A===void 0){const _=a.current.getBoundingClientRect(),$=_.width/Vt.current.clientWidth;return{x:_.x-Vt.current.scrollLeft*$,y:_.y-Vt.current.scrollTop*$,width:Vt.current.scrollWidth*$,height:Vt.current.scrollHeight*$}}return gn.current?.getBounds((y??0)+U,A)}},focus:()=>gn.current?.focus(),emit:async y=>{switch(y){case"delete":$i({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":$i({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":$i({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 Ni(void 0,!0);break;case"paste":await Xa();break}},scrollTo:Ut,remeasureColumns:y=>{for(const A of y)Oo(A+U)},getMouseArgsForPosition:(y,A,_)=>{if(gn?.current===null)return;const $=gn.current.getMouseArgsForPosition(y,A,_);if($!==void 0)return{...$,location:[$.location[0]-U,$.location[1]]}}}),[yr,Do,Oo,Vt,Ni,$i,Xa,U,Ut]);const[$s,Ns]=pi??[],Rh=f.useCallback(y=>{const[A,_]=y;if(_===-1){re!=="none"&&(Ye(Qe.fromSingleSelection(A),void 0,!1),yn());return}$s===A&&Ns===_||(Rt({cell:y,range:{x:A,y:_,width:1,height:1}},!0,!1,"keyboard-nav"),Ut(A,_))},[re,yn,Ut,$s,Ns,Rt,Ye]),[Eh,Ih]=f.useState(!1),Bs=f.useRef(dd(y=>{Ih(y)},5)),Th=f.useCallback(()=>{Bs.current(!0),j.current===void 0&&j.columns.length===0&&j.rows.length===0&&s===void 0&&Rt({cell:[U,Mo],range:{x:U,y:Mo,width:1,height:1}},!0,!1,"keyboard-select")},[Mo,j,s,U,Rt]),Dh=f.useCallback(()=>{Bs.current(!1)},[]),[Oh,Ph]=f.useMemo(()=>{let y;const A=mt?.scrollbarWidthOverride??Tl(),_=Ae+(Ht?1:0);if(typeof tr=="number")y=hn+_*tr;else{let q=0;const K=Math.min(_,10);for(let z=0;z<K;z++)q+=tr(z);q=Math.floor(q/K),y=hn+_*q}y+=A;const $=rt.reduce((q,K)=>K.width+q,0)+A;return[`${Math.min(1e5,$)}px`,`${Math.min(1e5,y)}px`]},[rt,mt?.scrollbarWidthOverride,tr,Ae,Ht,hn]),Lh=f.useMemo(()=>Rm(dt),[dt]);return f.createElement(Fd.Provider,{value:dt},f.createElement(Sv,{style:Lh,className:Y,inWidth:m??Oh,inHeight:w??Ph},f.createElement(rv,{fillHandle:Lt,drawFocusRing:ei,experimental:mt,fixedShadowX:xn,fixedShadowY:lr,getRowThemeOverride:_r,headerIcons:Vn,imageWindowLoader:B,initialSize:We,isDraggable:Ge,onDragLeave:Pt,onRowMoved:en,overscrollX:Da,overscrollY:Oa,preventDiagonalScrolling:bn,rightElement:Bt,rightElementProps:Mn,smoothScrollX:ye,smoothScrollY:Ft,className:Y,enableGroups:Nn,onCanvasFocused:Th,onCanvasBlur:Dh,canvasRef:a,onContextMenu:wh,theme:dt,cellXOffset:rh,cellYOffset:Mo,accessibilityHeight:dr.height,onDragEnd:ph,columns:rt,nonGrowWidth:_t,drawHeader:vt,onColumnProposeMove:fh,drawCell:fn,disabledRows:Sh,freezeColumns:Mh,lockColumns:U,firstColAccessible:U===0,getCellContent:_n,minColumnWidth:vr,maxColumnWidth:oi,searchInputRef:l,showSearch:La,onSearchClose:li,highlightRegions:ih,getCellsForSelection:Q,getGroupDetails:_a,headerHeight:_i,isFocused:Eh,groupHeaderHeight:Nn?ko:0,freezeTrailingRows:ct+(Ht&&De?.sticky===!0?1:0),hasAppendRow:Ht,onColumnResize:qe,onColumnResizeEnd:Re,onColumnResizeStart:Ze,onCellFocused:Rh,onColumnMoved:hh,onDragStart:gh,onHeaderMenuClick:uh,onHeaderIndicatorClick:ch,onItemHovered:Ua,isFilling:s?.fillHandle===!0,onMouseMove:sh,onKeyDown:$i,onKeyUp:ne,onMouseDown:oh,onMouseUp:lh,onDragOverCell:On,onDrop:Jt,onSearchResultsChanged:Ch,onVisibleRegionChanged:dh,clientSize:zt,rowHeight:tr,searchResults:ie,searchValue:L,onSearchValueChange:H,rows:pn,scrollRef:Vt,selection:j,translateX:dr.tx,translateY:dr.ty,verticalBorder:xh,gridRef:gn,getCellRenderer:tn,resizeIndicator:Co}),kh,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(Lv,{...i,validateCell:Ie,bloom:D,id:bh,getCellRenderer:tn,className:mt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:Sn,imageEditorOverride:g,portalElementRef:So,onFinishEditing:vh,markdownDivCreateNode:p,isOutsideClick:Ln,customEventTarget:mt?.eventTarget}))))},Hv=f.forwardRef(Av);function Yu(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:l,height:a,x:s,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=gd(c,a,o.cellVerticalPadding),h=hd(t.contentAlign??"center",s,l,o.cellHorizontalPadding,g),p=fd(h,d,g),m=pd(s+n,u+r,p);return Gl(t)&&m}const zv={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Vv(e,e.cell.data,Gl(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Yu(e)&&e.preventDefault()},onClick:e=>{if(Yu(e))return{...e.cell,data:jd(e.cell.data)}},onPaste:(e,t)=>{let n=oa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Xl),n===t.data?void 0:{...t,data:n}}};function Vv(e,t,n,r,i){if(!n&&t===oa)return;const{ctx:o,hoverAmount:l,theme:a,rect:s,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:p,width:m,height:w}=s;let b=!1;if(i>0){let v=n?1-i+i*l:.4;if(t===oa&&(v*=l),v===0)return;v<1&&(b=!0,o.globalAlpha=v)}is(o,a,t,h,p,m,w,u,c,d,r,g),b&&(o.globalAlpha=1)}const $v=cn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Nv=e=>{const{bubbles:t}=e;return f.createElement($v,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Bv={getAccessibilityString:e=>md(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>Wv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(Nv,{bubbles:t.data})},onPaste:()=>{}};function Wv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:l,y:a,width:s,height:u}=n;let c=l+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>l+s)break;const h=Or(g,i,r.baseFontFull).width;d.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of d)Jn(i,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+er(i,r))}const Uv=cn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),qv=e=>{const{drilldowns:t}=e;return f.createElement(Uv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&f.createElement("img",{src:n.img}),f.createElement("div",null,n.text))))},Xv={getAccessibilityString:e=>md(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Yv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(qv,{drilldowns:t.data})},onPaste:()=>{}},hl={};function Gv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,l=n-o*2,a=4,s=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(hl[g]!==void 0)return{el:hl[g],height:s,width:d,middleWidth:a*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),p=h.getContext("2d");return p===null?null:(h.width=d,h.height=s,p.scale(i,i),hl[g]=h,p.beginPath(),Jn(p,o,o,c,l,r),p.shadowColor="rgba(24, 25, 34, 0.4)",p.shadowBlur=1,p.fillStyle=e,p.fill(),p.shadowColor="rgba(24, 25, 34, 0.3)",p.shadowOffsetY=1,p.shadowBlur=5,p.fillStyle=e,p.fill(),p.shadowOffsetY=0,p.shadowBlur=0,p.shadowBlur=0,p.beginPath(),Jn(p,o+.5,o+.5,c,l,r),p.strokeStyle=t,p.lineWidth=1,p.stroke(),{el:h,height:s,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function Yv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:l,row:a}=e,{x:s,width:u}=n,c=r.baseFontFull,d=es(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),p=g-10,m=r.bubblePadding,w=r.bubbleMargin;let b=s+r.cellHorizontalPadding;const v=r.roundingRadius??6,C=Gv(r.bgCell,r.drilldownBorder,g,v),I=[];for(const E of t){if(b>s+u)break;const P=Or(E.text,i,c).width;let x=0;E.img!==void 0&&o.loadOrGetImage(E.img,l,a)!==void 0&&(x=p-8+4);const S=P+x+m*2;I.push({x:b,width:S}),b+=S+w}if(C!==null){const{el:E,height:R,middleWidth:P,sideWidth:x,width:S,dpr:F,padding:D}=C,M=x/F,T=D/F;for(const O of I){const k=Math.floor(O.x),N=Math.floor(O.width),X=N-(M-T)*2;i.imageSmoothingEnabled=!1,i.drawImage(E,0,0,x,R,k-T,h,M,g),X>0&&i.drawImage(E,x,0,P,R,k+(M-T),h,X,g),i.drawImage(E,S-x,0,x,R,k+N-(M-T),h,M,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[E,R]of I.entries()){const P=t[E];let x=R.x+m;if(P.img!==void 0){const S=o.loadOrGetImage(P.img,l,a);if(S!==void 0){const F=p-8;let D=0,M=0,T=S.width,O=S.height;T>O?(D+=(T-O)/2,T=O):O>T&&(M+=(O-T)/2,O=T),i.beginPath(),Jn(i,x,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(S,D,M,T,O,x,h+g/2-F/2,F,F),i.restore(),x+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(P.text,x,h+g/2+er(i,r))}}const jv={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Kv(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,i=r??Ap;return f.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},gl=4;function Kv(e,t,n,r){const{rect:i,col:o,row:l,theme:a,ctx:s,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,p=g-a.cellVerticalPadding*2,m=[];let w=0;for(let v=0;v<t.length;v++){const C=t[v];if(C.length===0)continue;const I=u.loadOrGetImage(C,o,l);if(I!==void 0){m[v]=I;const E=I.width*(p/I.height);w+=E+gl}}if(w===0)return;w-=gl;let b=c+a.cellHorizontalPadding;r==="right"?b=Math.floor(c+h-a.cellHorizontalPadding-w):r==="center"&&(b=Math.floor(c+h/2-w/2));for(const v of m){if(v===void 0)continue;const C=v.width*(p/v.height);n>0&&(s.beginPath(),Jn(s,b,d+a.cellVerticalPadding,C,p,n),s.save(),s.clip()),s.drawImage(v,b,d+a.cellVerticalPadding,C,p),n>0&&s.restore(),b+=C+gl}}function Zv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const Jv={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(Zv(n,r)*t.skeletonWidthVariability));const s=l.cellHorizontalPadding;a+s*2>=o.width&&(a=o.width-s*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*l.cellVerticalPadding);Jn(i,o.x+s,o.y+(o.height-u)/2,a,u,l.roundingRadius??3),i.fillStyle=jr(l.textDark,.1),i.fill()},onPaste:()=>{}},Qv=()=>e=>e.targetWidth,ju=cn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Qv(),"px"]}}),eb=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:l,validatedSelection:a}=e,s=t.data,u=t.readonly===!0,[c,d]=f.useState(s===""||r),g=f.useCallback(()=>{d(p=>!p)},[]),h=s?"gdg-ml-6":"";return c?f.createElement(ju,{targetWidth:o.width-20},f.createElement(Jr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:s,onKeyDown:p=>{p.key==="Enter"&&p.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>l(t)},f.createElement(Tp,null))):f.createElement(ju,{targetWidth:o.width},f.createElement(tm,{contents:s,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(jl,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},tb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:yo,measure:(e,t,n)=>{const r=t.data.split(`
175
+ `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>or(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:l,validatedSelection:a}=e;return f.createElement(eb,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},nb={getAccessibilityString:e=>e.row.toString(),kind:Un.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:rb,measure:()=>44,draw:e=>ob(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:l}=t,a=n.drawHandle?7+(o-7)/2:o/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function rb(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=ib,n.textAlign="center",o}function ib(e){const{ctx:t}=e;t.textAlign="start"}function ob(e,t,n,r,i,o){const{ctx:l,rect:a,hoverAmount:s,theme:u}=e,{x:c,y:d,width:g,height:h}=a,p=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&p>0){l.globalAlpha=p;const m=7*(n?s:1);if(is(l,u,n,i?c+m:c,d,i?g-m:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){l.globalAlpha=s,l.beginPath();for(const w of[3,6])for(const b of[-5,-1,3])l.rect(c+w,d+h/2+b,2,2);l.fillStyle=u.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),w=u.markerFontFull,b=c+g/2;r==="both"&&s!==0&&(l.globalAlpha=1-s),l.fillStyle=u.textLight,l.font=w,l.fillText(m,b,d+h/2+er(l,w)),s!==0&&(l.globalAlpha=1)}}const ab={getAccessibilityString:()=>"",kind:Un.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>lb(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function lb(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:l,spriteManager:a}=e,{x:s,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(s+1,u+1,c,d-2),r.fillStyle=l.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const m=d-8,w=s+8/2,b=u+8/2;a.drawSprite(n,"normal",r,w,b,m,l,g?1:o),h=m}else{h=24;const p=12,m=g?p:o*p,w=g?0:(1-o)*p*.5,b=l.cellHorizontalPadding+4;m>0&&(r.moveTo(s+b+w,u+d/2),r.lineTo(s+b+w+m,u+d/2),r.moveTo(s+b+w+m*.5,u+d/2-m*.5),r.lineTo(s+b+w+m*.5,u+d/2+m*.5),r.lineWidth=2,r.strokeStyle=l.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=l.textMedium,r.fillText(t,h+s+l.cellHorizontalPadding+.5,u+d/2+er(r,l)),r.beginPath()}function Jd(e,t,n,r,i,o,l){e.textBaseline="alphabetic";const a=sb(e,i,r,t,n?.fullSize??!1);e.beginPath(),Jn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??jr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l?.("text")}function sb(e,t,n,r,i){const o=r.cellHorizontalPadding,l=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+l/2+1,width:t.width-o,height:t.height-l-1};const a=Or(n,e,r.baseFontFull,"alphabetic"),s=t.height-l,u=Math.min(s,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const ub=f.lazy(async()=>await Ul(()=>import("./number-overlay-editor.DdgVR5m3.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)),cb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:yo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:u}=n;a===!0&&t>0&&Jd(r,i,u,s,o,t,l),or(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return f.createElement(f.Suspense,{fallback:null},f.createElement(ub,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},db={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:fb,onPaste:()=>{}};function fb(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:l}=r;t.beginPath();const a=2.5;let s=i+n.cellHorizontalPadding+a;const u=o+l/2,c=Math.cos(pu(30))*a,d=Math.sin(pu(30))*a;for(let g=0;g<12;g++)t.moveTo(s,u-a),t.lineTo(s,u+a),t.moveTo(s+c,u-d),t.lineTo(s-c,u+d),t.moveTo(s-c,u-d),t.lineTo(s+c,u+d),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const hb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>yo(e,t,e.theme.textLight),draw:e=>or(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:i}=e;return $t.createElement(Jr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},gb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:yo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Jd(i,l,g,s,o,n,a),or(e,s,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
176
+ `,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return f.createElement(Jr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:l=>r({...i,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},pb=cn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),mb=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:l}=e,[a,s]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{s(!0)},[]);return a?f.createElement(Jr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(pb,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(jl,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Qd(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-l-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-l/2),{x:i,y:o,width:l,height:a}}function Ku(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=Id(l,o.baseFontFull);if(a===void 0)return!1;const s=Qd(a,n,o,t.contentAlign);return Yr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,i)}const vb={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:yo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:l,ctx:a}=e,s=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Or(s,a,n.baseFontFull),d=Qd(c,l,n,t.contentAlign),{x:g,y:h,width:p,height:m}=d;if(i>=g-4&&i<=g-4+p+8&&o>=h-4&&o<=h-4+m+8){const w=er(a,n.baseFontFull);r("pointer");const b=5,v=h-w;a.beginPath(),a.moveTo(l.x+g,Math.floor(l.y+v+m+b)+.5),a.lineTo(l.x+g+p,Math.floor(l.y+v+m+b)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,or({...e,rect:{...l,x:l.x-1}},s,t.contentAlign),or({...e,rect:{...l,x:l.x-2}},s,t.contentAlign),or({...e,rect:{...l,x:l.x+1}},s,t.contentAlign),or({...e,rect:{...l,x:l.x+2}},s,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,or(e,s,t.contentAlign)},onSelect:e=>{Ku(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;Ku(e)&&t.onClickUri?.(e)},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:i,validatedSelection:o}=t;return f.createElement(mb,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},bb=[nb,ab,zv,Bv,Xv,jv,Jv,tb,cb,db,hb,gb,vb];var pl,Zu;function wb(){if(Zu)return pl;Zu=1;var e=cd(),t=Nc(),n="Expected a function";function r(i,o,l){var a=!0,s=!0;if(typeof i!="function")throw new TypeError(n);return t(l)&&(a="leading"in l?!!l.leading:a,s="trailing"in l?!!l.trailing:s),e(i,o,{leading:a,maxWait:o,trailing:s})}return pl=r,pl}var yb=wb();const Cb=pr(yb),ml=[];class Sb extends Od{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=Cb(()=>{this.imageLoaded(new uo(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const l=r.cells[o];if(this.isInWindow(l)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const l=ml.pop()??new Image;let a=!1;const s={img:void 0,cells:[Zn(n,r)],url:t,cancel:()=>{a||(a=!0,ml.length<12?ml.unshift(l):o||(l.src=""))}},u=new Promise(c=>l.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{l.src=t,await u,await l.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=l;for(const d of c.cells)this.loadedLocations.push(rs(d));o=!0,this.sendLoaded()}}catch{s.cancel()}}),this.cache[i]=s}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const l=Zn(n,r);return o.cells.includes(l)||o.cells.push(l),o.img}else this.loadImage(t,n,r,i)}}const xb=(e,t)=>{const n=f.useMemo(()=>({...h0,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??bb,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new Sb,[e.imageWindowLoader]);return f.createElement(Hv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},kb=f.forwardRef(xb);function Ju(e,t){const n=f.useRef(null),r=f.useRef(),i=f.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return f.useEffect(()=>i,[i]),{debouncedCallback:f.useCallback((...l)=>{r.current=l,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}var Mb=Xh();const Rb=pr(Mb);var ta={exports:{}};/*! Moment Duration Format v2.2.2
177
+ * https://github.com/jsmreese/moment-duration-format
178
+ * Date: 2018-02-16
179
+ *
180
+ * Duration format plugin function for the Moment.js library
181
+ * http://momentjs.com/
182
+ *
183
+ * Copyright 2018 John Madhavan-Reese
184
+ * Released under the MIT license
185
+ */var Eb=ta.exports,Qu;function Ib(){return Qu||(Qu=1,function(e,t){(function(n,r){try{e.exports=r(Gh)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(Eb,function(n){var r=!1,i=!1,o=!1,l=!1,a="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(H,L){return L.length>H.length?!1:H.indexOf(L)!==-1}function c(H){for(var L="";H;)L+="0",H-=1;return L}function d(H){for(var L=H.split("").reverse(),G=0,ne=!0;ne&&G<L.length;)G?L[G]==="9"?L[G]="0":(L[G]=(parseInt(L[G],10)+1).toString(),ne=!1):(parseInt(L[G],10)<5&&(ne=!1),L[G]="0"),G+=1;return ne&&L.push("1"),L.reverse().join("")}function g(H,L){var G=P(k(L).sort(),function(oe){return oe+":"+L[oe]}).join(","),ne=H+"+"+G;return g.cache[ne]||(g.cache[ne]=Intl.NumberFormat(H,L)),g.cache[ne]}g.cache={};function h(H,L,G){var ne=L.useToLocaleString,oe=L.useGrouping,Se=oe&&L.grouping.slice(),me=L.maximumSignificantDigits,et=L.minimumIntegerDigits||1,xe=L.fractionDigits||0,bt=L.groupingSeparator,St=L.decimalSeparator;if(ne&&G){var Ue={minimumIntegerDigits:et,useGrouping:oe};if(xe&&(Ue.maximumFractionDigits=xe,Ue.minimumFractionDigits=xe),me&&H>0&&(Ue.maximumSignificantDigits=me),o){if(!l){var re=O({},L);re.useGrouping=!1,re.decimalSeparator=".",H=parseFloat(h(H,re),10)}return g(G,Ue).format(H)}else{if(!i){var re=O({},L);re.useGrouping=!1,re.decimalSeparator=".",H=parseFloat(h(H,re),10)}return H.toLocaleString(G,Ue)}}var le;me?le=H.toPrecision(me+1):le=H.toFixed(xe+1);var be,fe,we,$e=le.split("e");we=$e[1]||"",$e=$e[0].split("."),fe=$e[1]||"",be=$e[0]||"";var Fe=be.length,tt=fe.length,Me=Fe+tt,Xe=be+fe;(me&&Me===me+1||!me&&tt===xe+1)&&(Xe=d(Xe),Xe.length===Me+1&&(Fe=Fe+1),tt&&(Xe=Xe.slice(0,-1)),be=Xe.slice(0,Fe),fe=Xe.slice(Fe)),me&&(fe=fe.replace(/0*$/,""));var Te=parseInt(we,10);Te>0?fe.length<=Te?(fe=fe+c(Te-fe.length),be=be+fe,fe=""):(be=be+fe.slice(0,Te),fe=fe.slice(Te)):Te<0&&(fe=c(Math.abs(Te)-be.length)+be+fe,be="0"),me||(fe=fe.slice(0,xe),fe.length<xe&&(fe=fe+c(xe-fe.length)),be.length<et&&(be=c(et-be.length)+be));var Ee="";if(oe){$e=be;for(var Pe;$e.length;)Se.length&&(Pe=Se.shift()),Ee&&(Ee=bt+Ee),Ee=$e.slice(-Pe)+Ee,$e=$e.slice(0,-Pe)}else Ee=be;return fe&&(Ee=Ee+St+fe),Ee}function p(H,L){return H.label.length>L.label.length?-1:H.label.length<L.label.length?1:0}function m(H,L){var G=[];return R(k(L),function(ne){if(ne.slice(0,15)==="_durationLabels"){var oe=ne.slice(15).toLowerCase();R(k(L[ne]),function(Se){Se.slice(0,1)===H&&G.push({type:oe,key:Se,label:L[ne][Se]})})}}),G}function w(H,L,G){return L===1&&G===null?H:H+H}var b={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(H){return Object.prototype.toString.call(H)==="[object Array]"}function C(H){return Object.prototype.toString.call(H)==="[object Object]"}function I(H,L){for(var G=H.length;G-=1;)if(L(H[G]))return H[G]}function E(H,L){var G=0,ne=H&&H.length||0,oe;for(typeof L!="function"&&(oe=L,L=function(Se){return Se===oe});G<ne;){if(L(H[G]))return H[G];G+=1}}function R(H,L){var G=0,ne=H.length;if(!(!H||!ne))for(;G<ne;){if(L(H[G],G)===!1)return;G+=1}}function P(H,L){var G=0,ne=H.length,oe=[];if(!H||!ne)return oe;for(;G<ne;)oe[G]=L(H[G],G),G+=1;return oe}function x(H,L){return P(H,function(G){return G[L]})}function S(H){var L=[];return R(H,function(G){G&&L.push(G)}),L}function F(H){var L=[];return R(H,function(G){E(L,G)||L.push(G)}),L}function D(H,L){var G=[];return R(H,function(ne){R(L,function(oe){ne===oe&&G.push(ne)})}),F(G)}function M(H,L){var G=[];return R(H,function(ne,oe){if(!L(ne))return G=H.slice(oe),!1}),G}function T(H,L){var G=H.slice().reverse();return M(G,L).reverse()}function O(H,L){for(var G in L)L.hasOwnProperty(G)&&(H[G]=L[G]);return H}function k(H){var L=[];for(var G in H)H.hasOwnProperty(G)&&L.push(G);return L}function N(H,L){var G=0,ne=H.length;if(!H||!ne)return!1;for(;G<ne;){if(L(H[G],G)===!0)return!0;G+=1}return!1}function X(H){var L=[];return R(H,function(G){L=L.concat(G)}),L}function Y(){var H=0;try{H.toLocaleString("i")}catch(L){return L.name==="RangeError"}return!1}function ue(H){return H(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function ee(H){var L=!0;return L=L&&H(1,"en",{minimumIntegerDigits:1})==="1",L=L&&H(1,"en",{minimumIntegerDigits:2})==="01",L=L&&H(1,"en",{minimumIntegerDigits:3})==="001",!(!L||(L=L&&H(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",L=L&&H(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",L=L&&H(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",L=L&&H(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!L)||(L=L&&H(99.99,"en",{maximumSignificantDigits:1})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:2})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:3})==="100",L=L&&H(99.99,"en",{maximumSignificantDigits:4})==="99.99",L=L&&H(99.99,"en",{maximumSignificantDigits:5})==="99.99",!L)||(L=L&&H(1e3,"en",{useGrouping:!0})==="1,000",L=L&&H(1e3,"en",{useGrouping:!1})==="1000",!L))}function te(){var H=[].slice.call(arguments),L={},G;if(R(H,function(me,et){if(!et){if(!v(me))throw"Expected array as the first argument to durationsFormat.";G=me}if(typeof me=="string"||typeof me=="function"){L.template=me;return}if(typeof me=="number"){L.precision=me;return}C(me)&&O(L,me)}),!G||!G.length)return[];L.returnMomentTypes=!0;var ne=P(G,function(me){return me.format(L)}),oe=D(a,F(x(X(ne),"type"))),Se=L.largest;return Se&&(oe=oe.slice(0,Se)),L.returnMomentTypes=!1,L.outputTypes=oe,P(G,function(me){return me.format(L)})}function ce(){var H=[].slice.call(arguments),L=O({},this.format.defaults),G=this.asMilliseconds(),ne=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(G=0,ne=0);var oe=G<0,Se=n.duration(Math.abs(G),"milliseconds"),me=n.duration(Math.abs(ne),"months");R(H,function(B){if(typeof B=="string"||typeof B=="function"){L.template=B;return}if(typeof B=="number"){L.precision=B;return}C(B)&&O(L,B)});var et={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},xe={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};L.types=a;var bt=function(B){return E(a,function(We){return xe[We].test(B)})},St=new RegExp(P(a,function(B){return xe[B].source}).join("|"),"g");L.duration=this;var Ue=typeof L.template=="function"?L.template.apply(L):L.template,re=L.outputTypes,le=L.returnMomentTypes,be=L.largest,fe=[];re||(v(L.stopTrim)&&(L.stopTrim=L.stopTrim.join("")),L.stopTrim&&R(L.stopTrim.match(St),function(B){var We=bt(B);We==="escape"||We==="general"||fe.push(We)}));var we=n.localeData();we||(we={}),R(k(b),function(B){if(typeof b[B]=="function"){we[B]||(we[B]=b[B]);return}we["_"+B]||(we["_"+B]=b[B])}),R(k(we._durationTimeTemplates),function(B){Ue=Ue.replace("_"+B+"_",we._durationTimeTemplates[B])});var $e=L.userLocale||n.locale(),Fe=L.useLeftUnits,tt=L.usePlural,Me=L.precision,Xe=L.forceLength,Te=L.useGrouping,Ee=L.trunc,Pe=L.useSignificantDigits&&Me>0,ht=Pe?L.precision:0,nt=ht,je=L.minValue,kt=!1,wt=L.maxValue,Dt=!1,Ot=L.useToLocaleString,an=L.groupingSeparator,Kt=L.decimalSeparator,In=L.grouping;Ot=Ot&&(r||o);var It=L.trim;v(It)&&(It=It.join(" ")),It===null&&(be||wt||Pe)&&(It="all"),(It===null||It===!0||It==="left"||It==="right")&&(It="large"),It===!1&&(It="");var gt=function(B){return B.test(It)},Tn=/large/,yt=/small/,Zt=/both/,Sn=/mid/,De=/^all|[^sm]all/,ct=/final/,pt=be>0||N([Tn,Zt,De],gt),Dn=N([yt,Zt,De],gt),ln=N([Sn,De],gt),sn=N([ct,De],gt),On=P(Ue.match(St),function(B,We){var Ge=bt(B);return B.slice(0,1)==="*"&&(B=B.slice(1),Ge!=="escape"&&Ge!=="general"&&fe.push(Ge)),{index:We,length:B.length,text:"",token:Ge==="escape"?B.replace(xe.escape,"$1"):B,type:Ge==="escape"||Ge==="general"?null:Ge}}),Jt={index:0,length:0,token:"",text:"",type:null},Qt=[];Fe&&On.reverse(),R(On,function(B){if(B.type){(Jt.type||Jt.text)&&Qt.push(Jt),Jt=B;return}Fe?Jt.text=B.token+Jt.text:Jt.text+=B.token}),(Jt.type||Jt.text)&&Qt.push(Jt),Fe&&Qt.reverse();var Be=D(a,F(S(x(Qt,"type"))));if(!Be.length)return x(Qt,"text").join("");Be=P(Be,function(B,We){var Ge=We+1===Be.length,Pt=!We,en;B==="years"||B==="months"?en=me.as(B):en=Se.as(B);var dn=Math.floor(en),kn=en-dn,bn=E(Qt,function(Bt){return B===Bt.type});return Pt&&wt&&en>wt&&(Dt=!0),Ge&&je&&Math.abs(L.duration.as(B))<je&&(kt=!0),Pt&&Xe===null&&bn.length>1&&(Xe=!0),Se.subtract(dn,B),me.subtract(dn,B),{rawValue:en,wholeValue:dn,decimalValue:Ge?kn:0,isSmallest:Ge,isLargest:Pt,type:B,tokenLength:bn.length}});var Mt=Ee?Math.floor:Math.round,Pn=function(B,We){var Ge=Math.pow(10,We);return Mt(B*Ge)/Ge},Lt=!1,mt=!1,xn=function(B,We){var Ge={useGrouping:Te,groupingSeparator:an,decimalSeparator:Kt,grouping:In,useToLocaleString:Ot};return Pe&&(ht<=0?(B.rawValue=0,B.wholeValue=0,B.decimalValue=0):(Ge.maximumSignificantDigits=ht,B.significantDigits=ht)),Dt&&!mt&&(B.isLargest?(B.wholeValue=wt,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),kt&&!mt&&(B.isSmallest?(B.wholeValue=je,B.decimalValue=0):(B.wholeValue=0,B.decimalValue=0)),B.isSmallest||B.significantDigits&&B.significantDigits-B.wholeValue.toString().length<=0?Me<0?B.value=Pn(B.wholeValue,Me):Me===0?B.value=Mt(B.wholeValue+B.decimalValue):Pe?(Ee?B.value=Pn(B.rawValue,ht-B.wholeValue.toString().length):B.value=B.rawValue,B.wholeValue&&(ht-=B.wholeValue.toString().length)):(Ge.fractionDigits=Me,Ee?B.value=B.wholeValue+Pn(B.decimalValue,Me):B.value=B.wholeValue+B.decimalValue):Pe&&B.wholeValue?(B.value=Math.round(Pn(B.wholeValue,B.significantDigits-B.wholeValue.toString().length)),ht-=B.wholeValue.toString().length):B.value=B.wholeValue,B.tokenLength>1&&(Xe||Lt)&&(Ge.minimumIntegerDigits=B.tokenLength,mt&&Ge.maximumSignificantDigits<B.tokenLength&&delete Ge.maximumSignificantDigits),!Lt&&(B.value>0||It===""||E(fe,B.type)||E(re,B.type))&&(Lt=!0),B.formattedValue=h(B.value,Ge,$e),Ge.useGrouping=!1,Ge.decimalSeparator=".",B.formattedValueEn=h(B.value,Ge,"en"),B.tokenLength===2&&B.type==="milliseconds"&&(B.formattedValueMS=h(B.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),B};if(Be=P(Be,xn),Be=S(Be),Be.length>1){var lr=function(B){return E(Be,function(We){return We.type===B})},Vn=function(B){var We=lr(B.type);We&&R(B.targets,function(Ge){var Pt=lr(Ge.type);Pt&&parseInt(We.formattedValueEn,10)===Ge.value&&(We.rawValue=0,We.wholeValue=0,We.decimalValue=0,Pt.rawValue+=1,Pt.wholeValue+=1,Pt.decimalValue=0,Pt.formattedValueEn=Pt.wholeValue.toString(),mt=!0)})};R(s,Vn)}return mt&&(Lt=!1,ht=nt,Be=P(Be,xn),Be=S(Be)),re&&!(Dt&&!L.trim)?(Be=P(Be,function(B){return E(re,function(We){return B.type===We})?B:null}),Be=S(Be)):(pt&&(Be=M(Be,function(B){return!B.isSmallest&&!B.wholeValue&&!E(fe,B.type)})),be&&Be.length&&(Be=Be.slice(0,be)),Dn&&Be.length>1&&(Be=T(Be,function(B){return!B.wholeValue&&!E(fe,B.type)&&!B.isLargest})),ln&&(Be=P(Be,function(B,We){return We>0&&We<Be.length-1&&!B.wholeValue?null:B}),Be=S(Be)),sn&&Be.length===1&&!Be[0].wholeValue&&!(!Ee&&Be[0].isSmallest&&Be[0].rawValue<je)&&(Be=[])),le?Be:(R(Qt,function(B){var We=et[B.type],Ge=E(Be,function(Bt){return Bt.type===B.type});if(!(!We||!Ge)){var Pt=Ge.formattedValueEn.split(".");Pt[0]=parseInt(Pt[0],10),Pt[1]?Pt[1]=parseFloat("0."+Pt[1],10):Pt[1]=null;var en=we.durationPluralKey(We,Pt[0],Pt[1]),dn=m(We,we),kn=!1,bn={};R(we._durationLabelTypes,function(Bt){var Mn=E(dn,function(Rn){return Rn.type===Bt.type&&Rn.key===en});Mn&&(bn[Mn.type]=Mn.label,u(B.text,Bt.string)&&(B.text=B.text.replace(Bt.string,Mn.label),kn=!0))}),tt&&!kn&&(dn.sort(p),R(dn,function(Bt){if(bn[Bt.type]===Bt.label)return u(B.text,Bt.label)?!1:void 0;if(u(B.text,Bt.label))return B.text=B.text.replace(Bt.label,bn[Bt.type]),!1}))}}),Qt=P(Qt,function(B){if(!B.type)return B.text;var We=E(Be,function(Pt){return Pt.type===B.type});if(!We)return"";var Ge="";return Fe&&(Ge+=B.text),(oe&&Dt||!oe&&kt)&&(Ge+="< ",Dt=!1,kt=!1),(oe&&kt||!oe&&Dt)&&(Ge+="> ",Dt=!1,kt=!1),oe&&(We.value>0||It===""||E(fe,We.type)||E(re,We.type))&&(Ge+="-",oe=!1),B.type==="milliseconds"&&We.formattedValueMS?Ge+=We.formattedValueMS:Ge+=We.formattedValue,Fe||(Ge+=B.text),Ge}),Qt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function se(){var H=this.duration,L=function(Se){return H._data[Se]},G=E(this.types,L),ne=I(this.types,L);switch(G){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(G===ne)return"d __";case"weeks":return G===ne?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(G===ne)return"M __";case"years":return G===ne?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function he(H){if(!H)throw"Moment Duration Format init cannot find moment instance.";H.duration.format=te,H.duration.fn.format=ce,H.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:se,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},H.updateLocale("en",b)}var de=function(H,L,G){return H.toLocaleString(L,G)};r=Y()&&ee(de),i=r&&ue(de);var ie=function(H,L,G){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(L,G).format(H)};return o=ee(ie),l=o&&ue(ie),he(n),he})}(ta)),ta.exports}Ib();const Tb=["true","t","yes","y","on","1"],Db=["false","f","no","n","off","0"];function Tt(e,t=""){return{kind:Z.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function Ti(e){return Object.hasOwn(e,"isError")&&e.isError}function Ob(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function ls(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function zl(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:Z.Loading,allowOverlay:!1,copyData:""}}function Pb(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Vl(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:"dots",themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&!e.isPinned&&{grow:1},...e.width&&{width:e.width}}}function Pi(e,t){return Oe(e)?t||{}:Oe(t)?e||{}:Uc(e,t)}function ss(e){if(Oe(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:st(n)):[st(t)]}catch{return[st(e)]}}function ef(e){return typeof e=="string"||e instanceof String?!0:(e instanceof Yh&&(e=Array.from(e)),Array.isArray(e)&&e.every(t=>typeof t=="string"||t instanceof String))}function Lb(e){return e?.startsWith("{")&&e.endsWith("}")}function st(e){try{try{return Rb(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function tf(e){if(Oe(e))return null;if(typeof e=="boolean")return e;const t=st(e).toLowerCase().trim();if(t==="")return null;if(Tb.includes(t))return!0;if(Db.includes(t))return!1}function po(e){if(Oe(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=no.unformat(e.trim());if(lt(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function nf(e){return Oe(e)?"":st(e.map(t=>typeof t=="string"&&t.includes(",")?t.replace(/,/g," "):t))}function fa(e){if(Oe(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return st(e)}}function Fb(e){if(e===0||Math.abs(e)>=1e-4)return 4;const n=e.toExponential().split("e");return Math.abs(parseInt(n[1],10))}function qr(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 ha(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Oe(t)||t===""?lt(n)?(n===0&&(e=Math.round(e)),no(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):no(e).format({thousandSeparated:!1,mantissa:Fb(e),trimMantissa:!0}):t==="plain"?no(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?qr(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?qr(e,{style:"percent",minimumFractionDigits:lt(n)?Math.max(n-2,0):0,maximumFractionDigits:lt(n)?Math.max(n-2,0):2}):t==="dollar"?qr(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?qr(e,{style:"currency",currency:"EUR",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?qr(e,{style:"currency",currency:"JPY",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?qr(e,{notation:t}):t==="accounting"?no(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?qr(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):Xg.sprintf(t,e)}function ec(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,i=n==="time"?void 0:"medium",o=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:i,timeStyle:o}).format(e.toDate())}catch(l){if(l instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:i,timeStyle:o}).format(e.toDate());throw l}}else{if(t==="distance")return e.fromNow();if(t==="calendar")return e.calendar();if(t==="iso8601")return n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString()}return e.format(t)}function Go(e){if(Oe(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=Xr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Xr.utc(e);if(n.isValid())return n.toDate();const r=Xr.utc(e,[Xr.HTML5_FMT.TIME_MS,Xr.HTML5_FMT.TIME_SECONDS,Xr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function rf(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 _b(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,i=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*i)/n}const Ab=new RegExp(/(\r\n|\n|\r)/gm);function mo(e){return e.indexOf(`
186
+ `)!==-1?e.replace(Ab," "):e}function Hb(e,t){if(Oe(t))return"";try{const n=t.match(e);return n?.[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const zb=Qn("div",{target:"e1ugbj0f0"})(({theme:e})=>({overflowY:"auto",padding:e.spacing.sm,".react-json-view .copy-icon svg":{fontSize:"0.9em !important",marginRight:`${e.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),of=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?Ya.parse(e):Ya.parse(Ya.stringify(e))}catch{n=void 0}return Oe(n)?ze(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:fa(e)??"",onChange:()=>{}}):ze(zb,{"data-testid":"stJsonColumnViewer",children:ze(jh,{src:n,collapsed:2,theme:Kh(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"}})})},Vb=e=>{const t=e.theme,n=e.value.data;return ze(of,{jsonValue:n.value||n.displayValue,theme:t})},$b=e=>{const t=e.theme,n=e.value;return ze(of,{jsonValue:n.data,theme:t})},Nb={kind:Z.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return Ql(e,r??fa(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??fa(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Vb})},af="line_chart",Bb="area_chart",lf="bar_chart",Wb=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 us(e,t,n,r){const i=Pi({y_min:null,y_max:null,color:void 0},t.columnTypeOptions),o=Wb(r);let l;i.color==="auto"||i.color==="auto-inverse"?l=r.colors.greenColor:l=i.color?o.get(i.color)??i.color:void 0;const a={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,color:l,yAxis:[i.y_min??0,i.y_max??1]}};return{...t,kind:e,typeIcon:e===af?":material/show_chart:":e===lf?":material/bar_chart:":":material/area_chart:",sortMode:"default",isEditable:!1,getCell(s){if(Oe(s))return zl();const u=ss(s),c=[];let d=[];if(u.length===0)return zl();let g=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER;for(let b=0;b<u.length;b++){const v=po(u[b]);if(Number.isNaN(v)||Oe(v))return Tt(st(u),`The value cannot be interpreted as a numeric array. ${st(v)} is not a number.`);v>g&&(g=v),v<h&&(h=v),c.push(v)}let p,m;if(u.length===1){let b;g<=0?b=g===0?1:0:b=g,p=i.y_max??b,m=i.y_min??(g>=0?0:g)}else p=i.y_max??g,m=i.y_min??h;if(Oe(m)||Oe(p)||Number.isNaN(m)||Number.isNaN(p)||m>=p)return Tt("Invalid min/max y-axis configuration",`The y_min (${m}) and y_max (${p}) configuration options must be valid numbers.`);c.length>0&&(g>p||h<m)?d=c.map(b=>g-h===0?g>(p||1)?p:m:(p-m)*((b-h)/(g-h))+m):d=c;let w=l;return(i.color==="auto"&&d[0]>d[d.length-1]||i.color==="auto-inverse"&&d[0]<d[d.length-1])&&(w=r.colors.redColor),{...a,copyData:c.join(","),data:{...a.data,values:d,displayValues:c.map(b=>ha(b)),yAxis:[m,p],color:w},isMissingValue:Oe(s)}},getCellValue(s){return s.kind===Z.Loading||s.data?.values===void 0?null:s.data?.values}}}function sf(e,t){return us(af,e,"line",t)}sf.isEditableType=!1;function uf(e,t){return us(lf,e,"bar",t)}uf.isEditableType=!1;function cf(e,t){return us(Bb,e,"area",t)}cf.isEditableType=!1;function cs(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(rn(t.radii.md),rn(t.radii.maxCheckbox)))},getCell(r){let i=null;return i=tf(r),i===void 0?Tt(st(r),"The value cannot be interpreted as boolean."):{...n,data:i,isMissingValue:Oe(i)}},getCellValue(r){return r.data===void 0?null:r.data}}}cs.isEditableType=!0;function tc(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function ds(e,t,n,r,i,o,l){const a=Pi({format:n,step:r,timezone:l},t.columnTypeOptions);let s;if(lt(a.timezone))try{s=tc(Ws(),a.timezone)?.utcOffset()||void 0}catch{}let u;lt(a.min_value)&&(u=Go(a.min_value)||void 0);let c;lt(a.max_value)&&(c=Go(a.max_value)||void 0);const d={kind:Z.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:a.step?.toString()||"1",format:i,min:u,max:c}},g=h=>{const p=Go(h);return p===null?!t.isRequired:!(p===void 0||lt(u)&&o(p)<o(u)||lt(c)&&o(p)>o(c))};return{...t,kind:e,typeIcon:e==="date"?":material/calendar_month:":e==="time"?":material/access_time:":":material/calendar_today:",sortMode:"default",validateInput:g,getCell(h,p){if(p===!0){const C=g(h);if(C===!1)return Tt(st(h),"Invalid input.");C instanceof Date&&(h=C)}const m=Go(h);let w="",b="",v=s;if(m===void 0)return Tt(st(h),"The value cannot be interpreted as a datetime object.");if(m!==null){let C=Ws.utc(m);if(!C.isValid())return Tt(st(m),`Invalid moment date. This should never happen. Please report this bug.
187
+ Error: ${C.toString()}`);if(a.timezone){try{C=tc(C,a.timezone)}catch(I){return Tt(C.toISOString(),`Failed to adjust to the provided timezone: ${a.timezone}.
188
+ Error: ${I}`)}v=C.utcOffset()}try{b=ec(C,a.format||n,e)}catch(I){return Tt(C.toISOString(),`Failed to format the date for rendering with: ${a.format}.
189
+ Error: ${I}`)}w=ec(C,n,e)}return{...d,copyData:w,isMissingValue:Oe(m),data:{...d.data,date:m,displayDate:b,timezoneOffset:v}}},getCellValue(h){return Oe(h?.data?.date)?null:o(h.data.date)}}}function fs(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=Zh(e.arrowType),r=lt(n)||lt(e?.columnTypeOptions?.timezone);return ds("datetime",e,r?t+"Z":t,1,"datetime-local",i=>r?i.toISOString():i.toISOString().replace("Z",""),n)}fs.isEditableType=!0;function hs(e){let t="HH:mm:ss";return e.columnTypeOptions?.step>=60?t="HH:mm":e.columnTypeOptions?.step<1&&(t="HH:mm:ss.SSS"),ds("time",e,t,1,"time",n=>n.toISOString().split("T")[1].replace("Z",""))}hs.isEditableType=!0;function gs(e){return ds("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}gs.isEditableType=!0;function df(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=lt(n)?[st(n)]:[];return{...t,data:r,isMissingValue:!lt(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}df.isEditableType=!1;function ff(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=lt(n)?mo(fa(n)):"";return{...t,copyData:r,isMissingValue:Oe(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Tt(st(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){return n.data?.value??null}}}ff.isEditableType=!1;function hf(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}.
190
+ Error: ${s}`}let r=!1,i=t.display_text,o;if(!Oe(i)){if(i.startsWith(":material/")&&Jh(i))i=Qh(i).icon,r=!0;else if(i.includes("(")&&i.includes(")"))try{o=new RegExp(i,"us")}catch{o=void 0}}const l={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:eg.iconFont,linkColor:void 0}}},a=s=>{if(Oe(s))return!e.isRequired;const u=st(s);return!(t.max_chars&&u.length>t.max_chars||n instanceof RegExp&&n.test(u)===!1)};return{...e,kind:"link",typeIcon:":material/link:",sortMode:"default",validateInput:a,getCell(s,u){if(Oe(s))return{...l,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const c=s;if(typeof n=="string")return Tt(st(c),n);if(u&&a(c)===!1)return Tt(st(c),"Invalid input.");let d="";return c&&(o!==void 0?d=Hb(o,c):d=i||c),{...l,data:c,displayData:d,isMissingValue:Oe(c),onClickUri:g=>{window.open(c.startsWith("www.")?`https://${c}`:c,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:c}},getCellValue(s){return Oe(s.data)?null:s.data}}}hf.isEditableType=!0;function ps(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(Oe(n))return{...t,data:{...t.data,values:null},isMissingValue:!0,copyData:""};const r=ss(n);return{...t,data:{...t.data,values:r},copyData:nf(r),...e.isEditable&&!ef(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 Oe(n.data?.values)?null:n.data.values}}}ps.isEditableType=!0;const Ub=e=>{const t=ng(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}))},qb=(e,t)=>{if(Oe(e))return[];const n=Ub(t);return e.filter(r=>r!==null&&r!=="").map(r=>{if(typeof r=="string")return{value:st(r).trim(),label:void 0,color:void 0};const i=r.color?tg(n.get(r.color)??r.color,t.colors.bgColor):void 0;return{value:st(r.value).trim(),label:r.label??void 0,color:i}})};function gf(e,t){const n=Pi({options:[],accept_new_options:!1},e.columnTypeOptions),r=qb(n.options,t),i=new Set(r.map(l=>l.value)),o={kind:Z.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"multi-select-cell",values:[],options:r,allowCreation:n.accept_new_options??!1,allowDuplicates:!1},copyData:""};return{...e,kind:"multiselect",sortMode:"default",typeIcon:":material/checklist:",getCell(l,a){if(Oe(l))return{...o,data:{...o.data,values:null},isMissingValue:!0,copyData:""};let s=ss(l);return s=s.map(u=>st(u).trim()),a&&s.length>0&&n.accept_new_options===!1&&(s=s.filter(u=>i.has(u)),s.length===0)?Tt(st(l),"The values could not be matched with the configured options."):{...o,data:{...o.data,values:s},copyData:nf(s),...e.isEditable&&!ef(l)&&{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(l){return Oe(l.data?.values)?null:l.data.values}}}gf.isEditableType=!0;function ms(e){const t=Pi({step:qc(e.arrowType)?1:void 0,min_value:rg(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(ig(e.arrowType)||og(e.arrowType)),r=Oe(t.min_value)||t.min_value<0,i=lt(t.step)&&!Number.isNaN(t.step)?rf(t.step):void 0,o={kind:Z.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:i,thousandSeparator:""},l=a=>{let s=po(a);if(Oe(s))return!e.isRequired;if(Number.isNaN(s))return!1;let u=!1;return lt(t.max_value)&&s>t.max_value&&(s=t.max_value,u=!0),lt(t.min_value)&&s<t.min_value?!1:u?s:!0};return{...e,kind:"number",sortMode:"smart",typeIcon:":material/tag:",validateInput:l,getCell(a,s){if(s===!0){const d=l(a);if(d===!1)return Tt(st(a),"Invalid input.");typeof d=="number"&&(a=d)}let u=po(a),c="";if(lt(u)){if(Number.isNaN(u))return Tt(st(a),"The value cannot be interpreted as a number.");if(lt(i)&&(u=_b(u,i)),Number.isInteger(u)&&!Number.isSafeInteger(u))return Tt(st(a),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=Il(u,e.arrowType):c=ha(u,t.format,i)}catch(d){return Tt(st(u),lt(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${d}`:`Failed to format the number. Error: ${d}`)}}return{...o,data:u,displayData:c,isMissingValue:Oe(u),copyData:Oe(u)?"":st(u)}},getCellValue(a){return a.data===void 0?null:a.data}}}ms.isEditableType=!0;function vo(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=lt(n)?st(n):null,i=lt(r)?mo(r):"";return{...t,data:r,displayData:i,isMissingValue:Oe(n)}}catch(r){return Tt(st(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}vo.isEditableType=!1;function pf(e){const t=qc(e.arrowType),n=Pi({min_value:0,max_value:t?100:1,format:t?"%3d%%":"percent",step:t?1:void 0},e.columnTypeOptions),r=Oe(n.step)||Number.isNaN(n.step)?void 0:rf(n.step);let i;try{i=ha(n.max_value,n.format,r)}catch{i=st(n.max_value)}const o={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,readonly:!0,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step??.01,value:n.min_value,label:String(n.min_value),measureLabel:i}};return{...e,kind:"progress",sortMode:"smart",typeIcon:":material/commit:",isEditable:!1,getCell(l){if(Oe(l))return zl();if(Oe(n.min_value)||Oe(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Tt("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if(lt(n.step)&&Number.isNaN(n.step))return Tt("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const a=po(l);if(Number.isNaN(a)||Oe(a))return Tt(st(l),"The value cannot be interpreted as a number.");if(Number.isInteger(a)&&!Number.isSafeInteger(a))return Tt(st(l),"The value is larger than the maximum supported integer values in number columns (2^53).");let s="";try{s=ha(a,n.format,r)}catch(c){return Tt(st(a),lt(n.format)?`Failed to format the number based on the provided format configuration: (${n.format}). Error: ${c}`:`Failed to format the number. Error: ${c}`)}const u=Math.min(n.max_value,Math.max(n.min_value,a));return{...o,isMissingValue:Oe(l),copyData:String(a),data:{...o.data,value:u,label:s,measureLabel:s.length>i.length?s:i}}},getCellValue(l){return l.kind===Z.Loading||l.data?.value===void 0?null:l.data?.value}}}pf.isEditableType=!1;const Xb=e=>Oe(e)?[]:e.filter(t=>lt(t)&&t!=="").map(t=>{if(typeof t=="object"&&"value"in t){const r=st(t.value).trim();return{value:r,label:t.label??r}}const n=st(t).trim();return{value:n,label:n}});function vs(e){let t="string";const n=Pi({options:Xc(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=s=>typeof s=="object"&&s!==null&&"value"in s,i=s=>r(s)?typeof s.value:typeof s,o=new Set(n.options.map(i));o.size===1&&(o.has("number")||o.has("bigint")?t="number":o.has("boolean")&&(t="boolean"));const l=Xb(n.options),a={kind:Z.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...l],value:""}};return{...e,kind:"selectbox",sortMode:"default",typeIcon:":material/arrow_drop_down_circle:",getCell(s,u){let c=null;return lt(s)&&s!==""&&(c=st(s)),u&&!a.data.allowedValues.some(g=>g===null?c===null:typeof g=="string"?g===c:typeof g=="object"&&"value"in g?g.value===c:!1)?Tt(st(c),"The value is not part of the allowed options."):{...a,isMissingValue:c===null,copyData:c||"",data:{...a.data,value:c}}},getCellValue(s){return Oe(s.data?.value)||s.data?.value===""?null:t==="number"?po(s.data?.value)??null:t==="boolean"?tf(s.data?.value)??null:s.data?.value}}}vs.isEditableType=!0;function bs(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n=`Invalid validate regex: ${t.validate}.
191
+ Error: ${o}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},i=o=>{if(Oe(o))return!e.isRequired;let l=st(o),a=!1;return t.max_chars&&l.length>t.max_chars&&(l=l.slice(0,t.max_chars),a=!0),n instanceof RegExp&&n.test(l)===!1?!1:a?l:!0};return{...e,kind:"text",sortMode:"default",typeIcon:":material/notes:",validateInput:i,getCell(o,l){if(typeof n=="string")return Tt(st(o),n);if(l){const a=i(o);if(a===!1)return Tt(st(o),"Invalid input.");typeof a=="string"&&(o=a)}try{const a=lt(o)?st(o):null,s=lt(a)?mo(a):"";return{...r,isMissingValue:Oe(a),data:a,displayData:s}}catch(a){return Tt("Incompatible value",`The value cannot be interpreted as string. Error: ${a}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}bs.isEditableType=!0;const nc=Qn("img",{target:"e3b94od0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),Gb=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?ze("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:ze(nc,{src:t})}):ze(nc,{src:t})},rc=new Map(Object.entries({object:vo,text:bs,checkbox:cs,selectbox:vs,list:ps,multiselect:gf,number:ms,link:hf,datetime:fs,date:gs,time:hs,line_chart:sf,bar_chart:uf,area_chart:cf,image:df,progress:pf,json:ff})),Yb=[Nb];var jb=Gc();const Kb=pr(jb);var vl,ic;function Zb(){if(ic)return vl;ic=1;var e=ag(),t=lg(),n=sg(),r=Gc(),i=ug(),o=cg(),l=dg(),a=fg(),s="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function g(h){if(h==null)return!0;if(i(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||o(h)||a(h)||n(h)))return!h.length;var p=t(h);if(p==s||p==u)return!h.size;if(l(h))return!e(h).length;for(var m in h)if(d.call(h,m))return!1;return!0}return vl=g,vl}var Jb=Zb();const Qb=pr(Jb);function bl(e,t,n){if(!n.includes(t))return;const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const i=r.exec(n);if(i)return i[1].trim()}function e1(e,t,n){const r={};if(!n.includes(t))return e;const i=bl(t,"color",n);i&&(r.textDark=i,(e.kind===Z.Bubble||e.kind===Z.Custom&&e.data?.kind==="multi-select-cell")&&(r.textBubble=i),e.kind===Z.Uri&&(r.linkColor=i));const o=bl(t,"background-color",n);o&&(r.bgCell=o),o==="yellow"&&i===void 0&&(r.textDark="#31333F");const l=bl(t,"font-weight",n);return l&&(r.baseFontStyle=`${l} ${Eg.sm}`),r?{...e,themeOverride:r}:e}function t1(e){return bg(e)||wg(e)?bs:yg(e)?fs:Yc(e)?hs:Cg(e)?gs:Sg(e)||xg(e)?vo:Xc(e)?cs:kg(e)?ms:Mg(e)?vs:Rg(e)?ps:vo}function mf(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 ws(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function n1(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:i}=mf(n),o=e.columnTypes[t];let l=!0;return vg(o)&&(l=!1),ws({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:i,isEditable:l,arrowType:o,isIndex:!0,isPinned:!0})}function r1(e,t){const n=e.columnNames.map(l=>l[t]),{title:r,group:i}=mf(n),o=e.columnTypes[t];return ws({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:o,group:i})}function vf(){return ws({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:Ig.INDEX,arrowField:new hg("",new gg,!0),pandasType:void 0}})}function oc(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(vf()),t;for(let o=0;o<r;o++)t.push(n1(e,o));for(let o=0;o<i;o++)t.push(r1(e,o+r));return t}function i1(e,t,n,r=void 0){let i;if(e.kind==="object"||e.kind==="json")i=e.getCell(lt(t.content)?mo(Il(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&lt(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let o;Yc(t.contentType)&&lt(t.field?.type?.unit)?o=pg(t.content,t.field):o=Xr.utc(Number(t.content)).toDate(),i=e.getCell(o)}else if(mg(t.contentType)){const o=Oe(t.content)?null:Il(t.content,t.contentType);i=e.getCell(o)}else i=e.getCell(t.content);if(Ti(i))return i;if(!e.isEditable){if(n&&lt(n?.displayContent)){const o=mo(n.displayContent);i.kind===Z.Text?i={...i,displayData:o}:i.kind===Z.Number&&Oe(e.columnTypeOptions?.format)?i={...i,displayData:o}:i.kind===Z.Uri&&Oe(e.columnTypeOptions?.display_text)?i={...i,displayData:o}:i.kind===Z.Custom&&i.data?.kind==="date-picker-cell"&&Oe(e.columnTypeOptions?.format)&&(i={...i,data:{...i.data,displayDate:o}})}r&&n?.cssId&&(i=e1(i,n.cssId,r))}return i}function bf(e,t){return t?t?.useStretch??!1:e.useContainerWidth??!1}function wf(e,t){return t?t.pixelWidth?t.pixelWidth:void 0:e.width||void 0}function o1(e){return e?.useContent??!1}function a1(e,t){return t?t.pixelHeight?t.pixelHeight:void 0:e.height||void 0}const na="_index",ac="_pos:",lc={small:75,medium:200,large:400},yf=ql.getLogger("useColumnLoader");function l1(e){if(!Oe(e)){if(typeof e=="number")return e;if(e in lc)return lc[e]}}const Yo=(e,t)=>Tg(e,t,(r,i)=>{if(Kb(i))return i});function sc(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(na)&&(n=Yo(n,t.get(na)??{})),t.has(`${ac}${e.indexNumber}`)&&(n=Yo(n,t.get(`${ac}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==na&&(n=Yo(n,t.get(e.name)??{})),t.has(e.id)&&(n=Yo(n,t.get(e.id)??{})),Qb(n)?e:Uc({...e},{title:n.label,width:l1(n.width),isEditable:lt(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 s1(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return yf.error(t),new Map}}function uc(e){const t=e.columnTypeOptions?.type;let n;return lt(t)&&(rc.has(t)?n=rc.get(t):yf.warn(`Unknown column type configured in column configuration: ${t}`)),Oe(n)&&(n=t1(e.arrowType)),n}function u1(e,t,n,r,i){const o=Kr(),l=f.useMemo(()=>s1(e.columns),[e.columns]),[a,s]=f.useState(l);f.useEffect(()=>{s(l)},[l]);const u=f.useMemo(()=>bf(e,i),[e,i]),c=f.useMemo(()=>wf(e,i),[e,i]),d=u||lt(c)&&c>0,g=lt(e.rowHeight)&&e.rowHeight>rn("4rem"),h=f.useMemo(()=>oc(t).map(m=>{let w={...m,...sc(m,a),isStretched:d};const b=uc(w);return(e.editingMode===on.EditingMode.READ_ONLY||n||b.isEditableType===!1)&&(w={...w,isEditable:!1}),e.editingMode!==on.EditingMode.READ_ONLY&&w.isEditable==!0&&(w={...w,icon:"editable"},w.isRequired&&e.editingMode===on.EditingMode.DYNAMIC&&(w={...w,isHidden:!1})),b(w,o)}),[t,a,d,e.editingMode,n,o]);return{columns:f.useMemo(()=>{const m=oc(t).map(C=>{let I={...C,...sc(C,a),isStretched:d,isWrappingAllowed:g};const E=uc(I);return(e.editingMode===on.EditingMode.READ_ONLY||n||E.isEditableType===!1)&&(I={...I,isEditable:!1}),e.editingMode!==on.EditingMode.READ_ONLY&&I.isEditable==!0&&(I={...I,icon:"editable"},I.isRequired&&e.editingMode===on.EditingMode.DYNAMIC&&(I={...I,isHidden:!1})),E(I,o)}).filter(C=>!C.isHidden),w=[],b=[];r?.length?(m.forEach(C=>{C.isIndex&&!r.includes(C.name)&&!r.includes(C.id)&&C.isPinned!==!1&&w.push(C)}),r.forEach(C=>{const I=m.find(E=>E.name===C||E.id===C);I&&(I.isPinned?w.push(I):b.push(I))})):m.forEach(C=>{C.isPinned?w.push(C):b.push(C)});const v=[...w,...b];return v.length>0?v:[vo(vf())]},[t,a,g,d,n,e.editingMode,r,o]),allColumns:h,setColumnConfigMapping:s}}function Gr(e){return e.isIndex?na:Oe(e.name)?"":e.name}class jo{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,l,a)=>{const s={};o.forEach((u,c)=>{const d=n.get(c);d&&(s[Gr(d)]=d.getCellValue(u))}),r.edited_rows[l]=s}),this.addedRows.forEach(o=>{const l={};let a=!1;o.forEach((s,u,c)=>{const d=n.get(u);if(d){const g=d.getCellValue(s);d.isRequired&&d.isEditable&&ls(s)&&(a=!0),lt(g)&&(l[Gr(d)]=g)}}),a||r.added_rows.push(l)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,l)=>l===void 0?null:l)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),i=new Map;n.forEach(l=>{i.set(l.indexNumber,l)});const o=new Map;n.forEach(l=>{o.set(Gr(l),l)}),Object.keys(r.edited_rows).forEach(l=>{const a=Number(l),s=r.edited_rows[l];Object.keys(s).forEach(u=>{const c=s[u],d=o.get(u);if(d){const g=d.getCell(c);g&&(this.editedCells.has(a)||this.editedCells.set(a,new Map),this.editedCells.get(a)?.set(d.indexNumber,g))}})}),r.added_rows.forEach(l=>{const a=new Map;n.forEach(s=>{a.set(s.indexNumber,s.getCell(null))}),Object.keys(l).forEach(s=>{const u=l[s],c=o.get(s);if(c){const d=c.getCell(u);d&&a.set(c.indexNumber,d)}}),this.addedRows.push(a)}),this.deletedRows=r.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const r=this.editedCells.get(n);if(r!==void 0)return r.get(t)}setCell(t,n,r){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,r)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,r)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,r)=>r-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Oe(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 bo=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),i=r.get(e),o={...i||{},...n||{}};return(i?.type_config||n?.type_config)&&(o.type_config={...i?.type_config||{},...n?.type_config||{}}),r.set(e,o),r};function c1(e){return{changeColumnFormat:f.useCallback((n,r)=>{e(i=>bo({columnId:n,columnConfigMapping:i,updatedProps:{type_config:{format:r}}}))},[e])}}function d1(e,t,n,r,i,o){const l=f.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??r*2),0)>n*.6,[e,n,r]),a=t||l?0:e.filter(c=>c.isPinned).length,s=f.useCallback(c=>{o(d=>bo({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!1}})),i(!0,!1)},[i,o]);return{pinColumn:f.useCallback(c=>{o(d=>bo({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!0}})),i(!0,!1)},[i,o]),unpinColumn:s,freezeColumns:a}}function f1(e,t,n,r,i){return{onColumnMoved:f.useCallback((l,a)=>{const s=[...e],[u]=s.splice(l,1);s.splice(a,0,u),a<t&&!u.isPinned?n(u.id):a>=t&&u.isPinned&&r(u.id),i(s.map(c=>c.id))},[e,t,n,r,i])}}function h1(e){const[t,n]=f.useState(()=>new Map),r=f.useCallback((o,l,a,s)=>{o.id&&n(new Map(t).set(o.id,s))},[t]);return{columns:f.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:r}}function g1(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 cc(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function p1(e,t){return e=cc(e),t=cc(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 m1(e,t){return e>t?1:e===t?0:-1}function v1(e){const{sort:t,rows:n,getCellContent:r}=e,i=f.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),o=f.useMemo(()=>i.map(u=>{const c=e.columns.findIndex(d=>u.column===d||d.id!==void 0&&u.column.id===d.id);return c===-1?void 0:c}),[i,e.columns]),l=f.useMemo(()=>{const u=i.map((d,g)=>({sort:d,col:o[g]})).filter(d=>d.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let d=0;d<u.length;d++){const{col:g}=u[d],h=[g,0];for(let p=0;p<n;p++)h[1]=p,c[d][p]=g1(r(h))}return Ir(n).sort((d,g)=>{for(let h=0;h<u.length;h++){const{sort:p}=u[h],m=c[h][d],w=c[h][g];let b;if(p.mode==="raw"?b=m1(m,w):p.mode==="smart"?b=p1(m,w):b=m.localeCompare(w),b!==0)return(p.direction??"asc")==="desc"&&(b=-b),b}return 0})},[r,n,i,o]),a=f.useCallback(u=>l===void 0?u:l[u],[l]),s=f.useCallback(([u,c])=>l===void 0?r([u,c]):(c=l[c],r([u,c])),[r,l]);return l===void 0?{getCellContent:e.getCellContent,getOriginalIndex:a}:{getOriginalIndex:a,getCellContent:s}}function b1(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 w1(e,t,n){const[r,i]=f.useState(),{getCellContent:o,getOriginalIndex:l}=v1({columns:t.map(u=>Vl(u)),getCellContent:n,rows:e,sort:r}),a=f.useMemo(()=>b1(t,r),[t,r]),s=f.useCallback((u,c,d)=>{const g=a[u];let h;c==="auto"?(h="asc",r&&r.column.id===g.id&&(r.direction==="asc"?h="desc":h=void 0)):h=c,h===void 0||d&&h===r?.direction?i(void 0):i({column:Vl(g),direction:h,mode:g.sortMode})},[r,a]);return{columns:a,sortColumn:s,getOriginalIndex:l,getCellContent:o}}function y1(e,t){const n=f.useCallback(i=>{t(o=>bo({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=f.useCallback(i=>{t(o=>bo({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function C1(){return{provideEditor:f.useCallback(t=>{if(t.kind===Z.Text&&t.readonly&&Lb(t.data))return{editor:$b}},[])}}const S1={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:i,hoverAmount:o,hoverX:l}=e;let{values:a,yAxis:s,color:u,graphKind:c="area",displayValues:d,hideAxis:g}=t.data;const[h,p]=s;if(a.length===0)return!0;a=a.map(R=>Math.min(1,Math.max(0,(R-h)/(p-h))));const m=r.cellHorizontalPadding,w=m+i.x,b=i.y+3,v=i.height-6,C=i.width-m*2,I=p-h,E=p<=0?b:h>=0?b+v:b+v*(p/I);if(!g&&h<=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),c==="bar"){n.beginPath();const R=2,P=(a.length-1)*R,x=(C-P)/a.length;let S=w;for(const F of a){const D=b+v-F*v;n.moveTo(S,E),n.lineTo(S+x,E),n.lineTo(S+x,D),n.lineTo(S,D),S+=x+R}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{a.length===1&&(a=[a[0],a[0]],d&&(d=[d[0],d[0]])),n.beginPath();const R=(i.width-16)/(a.length-1),P=a.map((S,F)=>({x:w+R*F,y:b+v-S*v}));n.moveTo(P[0].x,P[0].y);let x=0;if(P.length>2)for(x=1;x<P.length-2;x++){const S=(P[x].x+P[x+1].x)/2,F=(P[x].y+P[x+1].y)/2;n.quadraticCurveTo(P[x].x,P[x].y,S,F)}if(n.quadraticCurveTo(P[x].x,P[x].y,P[x+1].x,P[x+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(i.x+i.width-m,E),n.lineTo(i.x+m,E),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const S=n.createLinearGradient(0,b,0,b+v*1.4);S.addColorStop(0,u??r.accentColor);const[F,D,M]=fo(u??r.accentColor);S.addColorStop(1,`rgba(${F}, ${D}, ${M}, 0)`),n.fillStyle=S,n.fill(),n.globalAlpha=1}if(l!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const S=Math.min(a.length-1,Math.max(0,Math.round((l-m)/R)));n.moveTo(w+S*R,i.y+1),n.lineTo(w+S*R,i.y+i.height),n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.save(),n.font=`8px ${r.fontFamily}`,n.fillStyle=r.textMedium,n.textBaseline="top",n.fillText(d[S],w,i.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function dc(e,t,n,r,i,o){if(!(r<=0||i<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,r,i);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,i/2,r/2),tr:Math.min(o.tr,i/2,r/2),bl:Math.min(o.bl,i/2,r/2),br:Math.min(o.br,i/2,r/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function fc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?fc(Object(n),!0).forEach(function(r){ro(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var x1=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Cf(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,l=o===void 0?null:o,a=e.inputValue,s=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,g=e.onMenuOpen,h=e.value,p=ar(e,x1),m=f.useState(a!==void 0?a:n),w=fr(m,2),b=w[0],v=w[1],C=f.useState(s!==void 0?s:i),I=fr(C,2),E=I[0],R=I[1],P=f.useState(h!==void 0?h:l),x=fr(P,2),S=x[0],F=x[1],D=f.useCallback(function(Y,ue){typeof u=="function"&&u(Y,ue),F(Y)},[u]),M=f.useCallback(function(Y,ue){var ee;typeof c=="function"&&(ee=c(Y,ue)),v(ee!==void 0?ee:Y)},[c]),T=f.useCallback(function(){typeof g=="function"&&g(),R(!0)},[g]),O=f.useCallback(function(){typeof d=="function"&&d(),R(!1)},[d]),k=a!==void 0?a:b,N=s!==void 0?s:E,X=h!==void 0?h:S;return Le(Le({},p),{},{inputValue:k,menuIsOpen:N,onChange:D,onInputChange:M,onMenuClose:O,onMenuOpen:T,value:X})}function k1(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const M1=Math.min,R1=Math.max,ga=Math.round,Ko=Math.floor,pa=e=>({x:e,y:e});function E1(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ma(){return typeof window<"u"}function Sf(e){return kf(e)?(e.nodeName||"").toLowerCase():"#document"}function gr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xf(e){var t;return(t=(kf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kf(e){return Ma()?e instanceof Node||e instanceof gr(e).Node:!1}function I1(e){return Ma()?e instanceof Element||e instanceof gr(e).Element:!1}function ys(e){return Ma()?e instanceof HTMLElement||e instanceof gr(e).HTMLElement:!1}function hc(e){return!Ma()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gr(e).ShadowRoot}function Mf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Cs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function T1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function D1(e){return["html","body","#document"].includes(Sf(e))}function Cs(e){return gr(e).getComputedStyle(e)}function O1(e){if(Sf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hc(e)&&e.host||xf(e);return hc(t)?t.host:t}function Rf(e){const t=O1(e);return D1(t)?e.ownerDocument?e.ownerDocument.body:e.body:ys(t)&&Mf(t)?t:Rf(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Rf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=gr(i);if(o){const a=$l(l);return t.concat(l,l.visualViewport||[],Mf(i)?i:[],a&&n?ma(a):[])}return t.concat(i,ma(i,[],n))}function $l(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function P1(e){const t=Cs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ys(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=ga(n)!==o||ga(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function Ss(e){return I1(e)?e:e.contextElement}function gc(e){const t=Ss(e);if(!ys(t))return pa(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=P1(t);let l=(o?ga(n.width):n.width)/r,a=(o?ga(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const L1=pa(0);function F1(e){const t=gr(e);return!T1()||!t.visualViewport?L1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _1(e,t,n){return!1}function pc(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=Ss(e);let l=pa(1);t&&(l=gc(e));const a=_1()?F1(o):pa(0);let s=(i.left+a.x)/l.x,u=(i.top+a.y)/l.y,c=i.width/l.x,d=i.height/l.y;if(o){const g=gr(o),h=r;let p=g,m=$l(p);for(;m&&r&&h!==p;){const w=gc(m),b=m.getBoundingClientRect(),v=Cs(m),C=b.left+(m.clientLeft+parseFloat(v.paddingLeft))*w.x,I=b.top+(m.clientTop+parseFloat(v.paddingTop))*w.y;s*=w.x,u*=w.y,c*=w.x,d*=w.y,s+=C,u+=I,p=gr(m),m=$l(p)}}return E1({width:c,height:d,x:s,y:u})}function A1(e,t){let n=null,r;const i=xf(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function l(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),o();const{left:u,top:c,width:d,height:g}=e.getBoundingClientRect();if(a||t(),!d||!g)return;const h=Ko(c),p=Ko(i.clientWidth-(u+d)),m=Ko(i.clientHeight-(c+g)),w=Ko(u),v={rootMargin:-h+"px "+-p+"px "+-m+"px "+-w+"px",threshold:R1(0,M1(1,s))||1};let C=!0;function I(E){const R=E[0].intersectionRatio;if(R!==s){if(!C)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(I,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,v)}n.observe(e)}return l(!0),o}function H1(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,u=Ss(e),c=i||o?[...u?ma(u):[],...ma(t)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=u&&a?A1(u,n):null;let g=-1,h=null;l&&(h=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),n()}),u&&!s&&h.observe(u),h.observe(t));let p,m=s?pc(e):null;s&&w();function w(){const b=pc(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,p=requestAnimationFrame(w)}return n(),()=>{var b;c.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d?.(),(b=h)==null||b.disconnect(),h=null,s&&cancelAnimationFrame(p)}}var Nl=f.useLayoutEffect,z1=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],va=function(){};function V1(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function $1(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var l in t)t.hasOwnProperty(l)&&t[l]&&o.push("".concat(V1(e,l)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var ba=function(t){return j1(t)?t.filter(Boolean):Dg(t)==="object"&&t!==null?[t]:[]},Ef=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=ar(t,z1);return Le({},n)},Gt=function(t,n,r){var i=t.cx,o=t.getStyles,l=t.getClassNames,a=t.className;return{css:o(n,t),className:i(r??{},l(n,t),a)}};function Ra(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function N1(e){return Ra(e)?window.innerHeight:e.clientHeight}function If(e){return Ra(e)?window.pageYOffset:e.scrollTop}function wa(e,t){if(Ra(e)){window.scrollTo(0,t);return}e.scrollTop=t}function B1(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function W1(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Zo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:va,i=If(e),o=t-i,l=10,a=0;function s(){a+=l;var u=W1(a,i,o,n);wa(e,u),a<n?window.requestAnimationFrame(s):r(e)}s()}function mc(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?wa(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&wa(e,Math.max(t.offsetTop-i,0))}function U1(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 vc(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function q1(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Tf=!1,X1={get passive(){return Tf=!0}},Jo=typeof window<"u"?window:{};Jo.addEventListener&&Jo.removeEventListener&&(Jo.addEventListener("p",va,X1),Jo.removeEventListener("p",va,!1));var G1=Tf;function Y1(e){return e!=null}function j1(e){return Array.isArray(e)}function io(e,t,n){return e?t:n}var K1=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(l){var a=fr(l,1),s=a[0];return!r.includes(s)});return o.reduce(function(l,a){var s=fr(a,2),u=s[0],c=s[1];return l[u]=c,l},{})},Z1=["children","innerProps"],J1=["children","innerProps"];function Q1(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,l=e.isFixedPosition,a=e.controlHeight,s=B1(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=s.getBoundingClientRect(),d=c.height,g=n.getBoundingClientRect(),h=g.bottom,p=g.height,m=g.top,w=n.offsetParent.getBoundingClientRect(),b=w.top,v=l?window.innerHeight:N1(s),C=If(s),I=parseInt(getComputedStyle(n).marginBottom,10),E=parseInt(getComputedStyle(n).marginTop,10),R=b-E,P=v-m,x=R+C,S=d-C-m,F=h-v+C+I,D=C+m-E,M=160;switch(i){case"auto":case"bottom":if(P>=p)return{placement:"bottom",maxHeight:t};if(S>=p&&!l)return o&&Zo(s,F,M),{placement:"bottom",maxHeight:t};if(!l&&S>=r||l&&P>=r){o&&Zo(s,F,M);var T=l?P-I:S-I;return{placement:"bottom",maxHeight:T}}if(i==="auto"||l){var O=t,k=l?R:x;return k>=r&&(O=Math.min(k-I-a,t)),{placement:"top",maxHeight:O}}if(i==="bottom")return o&&wa(s,F),{placement:"bottom",maxHeight:t};break;case"top":if(R>=p)return{placement:"top",maxHeight:t};if(x>=p&&!l)return o&&Zo(s,D,M),{placement:"top",maxHeight:t};if(!l&&x>=r||l&&R>=r){var N=t;return(!l&&x>=r||l&&R>=r)&&(N=l?R-E:x-E),o&&Zo(s,D,M),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function ew(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Df=function(t){return t==="auto"?"bottom":t},tw=function(t,n){var r,i=t.placement,o=t.theme,l=o.borderRadius,a=o.spacing,s=o.colors;return Le((r={label:"menu"},ro(r,ew(i),"100%"),ro(r,"position","absolute"),ro(r,"width","100%"),ro(r,"zIndex",1),r),n?{}:{backgroundColor:s.neutral0,borderRadius:l,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})},Of=f.createContext(null),nw=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,l=t.menuPosition,a=t.menuShouldScrollIntoView,s=t.theme,u=f.useContext(Of)||{},c=u.setPortalPlacement,d=f.useRef(null),g=f.useState(i),h=fr(g,2),p=h[0],m=h[1],w=f.useState(null),b=fr(w,2),v=b[0],C=b[1],I=s.spacing.controlHeight;return Nl(function(){var E=d.current;if(E){var R=l==="fixed",P=a&&!R,x=Q1({maxHeight:i,menuEl:E,minHeight:r,placement:o,shouldScroll:P,isFixedPosition:R,controlHeight:I});m(x.maxHeight),C(x.placement),c?.(x.placement)}},[i,o,l,a,r,c,I]),n({ref:d,placerProps:Le(Le({},t),{},{placement:v||Df(o),maxHeight:p})})},rw=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return _e("div",He({},Gt(t,"menu",{menu:!0}),{ref:r},i),n)},iw=rw,ow=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Le({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},aw=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return _e("div",He({},Gt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},Pf=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return Le({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},lw=Pf,sw=Pf,uw=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=ar(t,Z1);return _e("div",He({},Gt(Le(Le({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},cw=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=ar(t,J1);return _e("div",He({},Gt(Le(Le({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},dw=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},fw=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,l=t.menuPlacement,a=t.menuPosition,s=f.useRef(null),u=f.useRef(null),c=f.useState(Df(l)),d=fr(c,2),g=d[0],h=d[1],p=f.useMemo(function(){return{setPortalPlacement:h}},[]),m=f.useState(null),w=fr(m,2),b=w[0],v=w[1],C=f.useCallback(function(){if(i){var P=U1(i),x=a==="fixed"?0:window.pageYOffset,S=P[g]+x;(S!==b?.offset||P.left!==b?.rect.left||P.width!==b?.rect.width)&&v({offset:S,rect:P})}},[i,a,g,b?.offset,b?.rect.left,b?.rect.width]);Nl(function(){C()},[C]);var I=f.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&s.current&&(u.current=H1(i,s.current,C,{elementResize:"ResizeObserver"in window}))},[i,C]);Nl(function(){I()},[I]);var E=f.useCallback(function(P){s.current=P,I()},[I]);if(!n&&a!=="fixed"||!b)return null;var R=_e("div",He({ref:E},Gt(Le(Le({},t),{},{offset:b.offset,position:a,rect:b.rect}),"menuPortal",{"menu-portal":!0}),o),r);return _e(Of.Provider,{value:p},n?jc.createPortal(R,n):R)},hw=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},gw=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return _e("div",He({},Gt(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},pw=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,l=t.selectProps.controlShouldRenderValue;return Le({alignItems:"center",display:i&&o&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},mw=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return _e("div",He({},Gt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},vw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},bw=function(t){var n=t.children,r=t.innerProps;return _e("div",He({},Gt(t,"indicatorsContainer",{indicators:!0}),r),n)},bc,ww=["size"],yw=["innerProps","isRtl","size"],Cw={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Lf=function(t){var n=t.size,r=ar(t,ww);return _e("svg",He({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Cw},r))},xs=function(t){return _e(Lf,He({size:20},t),_e("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"}))},Ff=function(t){return _e(Lf,He({size:20},t),_e("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"}))},_f=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,l=i.colors;return Le({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?l.neutral60:l.neutral20,padding:o*2,":hover":{color:r?l.neutral80:l.neutral40}})},Sw=_f,xw=function(t){var n=t.children,r=t.innerProps;return _e("div",He({},Gt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||_e(Ff,null))},kw=_f,Mw=function(t){var n=t.children,r=t.innerProps;return _e("div",He({},Gt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||_e(xs,null))},Rw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,l=i.colors;return Le({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?l.neutral10:l.neutral20,marginBottom:o*2,marginTop:o*2})},Ew=function(t){var n=t.innerProps;return _e("span",He({},n,Gt(t,"indicatorSeparator",{"indicator-separator":!0})))},Iw=Og(bc||(bc=k1([`
192
+ 0%, 80%, 100% { opacity: 0; }
193
+ 40% { opacity: 1; }
194
+ `]))),Tw=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,l=o.colors,a=o.spacing.baseUnit;return Le({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?l.neutral60:l.neutral20,padding:a*2})},wl=function(t){var n=t.delay,r=t.offset;return _e("span",{css:Kc({animation:"".concat(Iw," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Dw=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,l=ar(t,yw);return _e("div",He({},Gt(Le(Le({},l),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),_e(wl,{delay:0,offset:r}),_e(wl,{delay:160,offset:!0}),_e(wl,{delay:320,offset:!r}))},Ow=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,l=o.colors,a=o.borderRadius,s=o.spacing;return Le({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?l.neutral5:l.neutral0,borderColor:r?l.neutral10:i?l.primary:l.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:i?l.primary:l.neutral30}})},Pw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,l=t.innerProps,a=t.menuIsOpen;return _e("div",He({ref:o},Gt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),l,{"aria-disabled":r||void 0}),n)},Lw=Pw,Fw=["data"],_w=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},Aw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,l=t.Heading,a=t.headingProps,s=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return _e("div",He({},Gt(t,"group",{group:!0}),s),_e(l,He({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),_e("div",null,n))},Hw=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Le({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},zw=function(t){var n=Ef(t);n.data;var r=ar(n,Fw);return _e("div",He({},Gt(t,"groupHeading",{"group-heading":!0}),r))},Vw=Aw,$w=["innerRef","isDisabled","isHidden","inputClassName"],Nw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,l=o.spacing,a=o.colors;return Le(Le({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},Bw),n?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:a.neutral80})},Af={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Bw={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"},Af)},Ww=function(t){return Le({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Af)},Uw=function(t){var n=t.cx,r=t.value,i=Ef(t),o=i.innerRef,l=i.isDisabled,a=i.isHidden,s=i.inputClassName,u=ar(i,$w);return _e("div",He({},Gt(t,"input",{"input-container":!0}),{"data-value":r||""}),_e("input",He({className:n({input:!0},s),ref:o,style:Ww(a),disabled:l},u)))},qw=Uw,Xw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors;return Le({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:l.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},Gw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,l=t.cropWithEllipsis;return Le({overflow:"hidden",textOverflow:l||l===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Yw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors,a=t.isFocused;return Le({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?l.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},Hf=function(t){var n=t.children,r=t.innerProps;return _e("div",r,n)},jw=Hf,Kw=Hf;function Zw(e){var t=e.children,n=e.innerProps;return _e("div",He({role:"button"},n),t||_e(xs,{size:14}))}var Jw=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,l=t.isDisabled,a=t.removeProps,s=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return _e(u,{data:i,innerProps:Le(Le({},Gt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),o),selectProps:s},_e(c,{data:i,innerProps:Le({},Gt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),_e(d,{data:i,innerProps:Le(Le({},Gt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:s}))},Qw=Jw,ey=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.theme,a=l.spacing,s=l.colors;return Le({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?s.primary:i?s.primary25:"transparent",color:r?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?s.primary:s.primary50}})},ty=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.innerRef,a=t.innerProps;return _e("div",He({},Gt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:l,"aria-disabled":r},a),n)},ny=ty,ry=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Le({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},iy=function(t){var n=t.children,r=t.innerProps;return _e("div",He({},Gt(t,"placeholder",{placeholder:!0}),r),n)},oy=iy,ay=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,l=i.colors;return Le({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?l.neutral40:l.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},ly=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return _e("div",He({},Gt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},sy=ly,ks={ClearIndicator:Mw,Control:Lw,DropdownIndicator:xw,DownChevron:Ff,CrossIcon:xs,Group:Vw,GroupHeading:zw,IndicatorsContainer:bw,IndicatorSeparator:Ew,Input:qw,LoadingIndicator:Dw,Menu:iw,MenuList:aw,MenuPortal:fw,LoadingMessage:cw,NoOptionsMessage:uw,MultiValue:Qw,MultiValueContainer:jw,MultiValueLabel:Kw,MultiValueRemove:Zw,Option:ny,Placeholder:oy,SelectContainer:gw,SingleValue:sy,ValueContainer:mw},uy=function(t){return Le(Le({},ks),t.components)},wc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function cy(e,t){return!!(e===t||wc(e)&&wc(t))}function dy(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!cy(e[n],t[n]))return!1;return!0}function fy(e,t){t===void 0&&(t=dy);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var l=e.apply(this,i);return n={lastResult:l,lastArgs:i,lastThis:this},l}return r.clear=function(){n=null},r}var hy={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"},gy=function(t){return _e("span",He({css:hy},t))},yc=gy,py={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,l=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return l?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,l=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return l?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,l=o===void 0?"":o,a=t.selectValue,s=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(m,w){return m&&m.length?"".concat(m.indexOf(w)+1," of ").concat(m.length):""};if(n==="value"&&a)return"value ".concat(l," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=s?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(l).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},my=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,l=t.isFocused,a=t.selectValue,s=t.selectProps,u=t.id,c=t.isAppleDevice,d=s.ariaLiveMessages,g=s.getOptionLabel,h=s.inputValue,p=s.isMulti,m=s.isOptionDisabled,w=s.isSearchable,b=s.menuIsOpen,v=s.options,C=s.screenReaderStatus,I=s.tabSelectsValue,E=s.isLoading,R=s["aria-label"],P=s["aria-live"],x=f.useMemo(function(){return Le(Le({},py),d||{})},[d]),S=f.useMemo(function(){var k="";if(n&&x.onChange){var N=n.option,X=n.options,Y=n.removedValue,ue=n.removedValues,ee=n.value,te=function(L){return Array.isArray(L)?null:L},ce=Y||N||te(ee),se=ce?g(ce):"",he=X||ue||void 0,de=he?he.map(g):[],ie=Le({isDisabled:ce&&m(ce,a),label:se,labels:de},n);k=x.onChange(ie)}return k},[n,x,m,a,g]),F=f.useMemo(function(){var k="",N=r||i,X=!!(r&&a&&a.includes(r));if(N&&x.onFocus){var Y={focused:N,label:g(N),isDisabled:m(N,a),isSelected:X,options:o,context:N===r?"menu":"value",selectValue:a,isAppleDevice:c};k=x.onFocus(Y)}return k},[r,i,g,m,x,o,a,c]),D=f.useMemo(function(){var k="";if(b&&v.length&&!E&&x.onFilter){var N=C({count:o.length});k=x.onFilter({inputValue:h,resultsMessage:N})}return k},[o,h,b,x,v,C,E]),M=n?.action==="initial-input-focus",T=f.useMemo(function(){var k="";if(x.guidance){var N=i?"value":b?"menu":"input";k=x.guidance({"aria-label":R,context:N,isDisabled:r&&m(r,a),isMulti:p,isSearchable:w,tabSelectsValue:I,isInitialFocus:M})}return k},[R,r,i,p,m,w,b,x,a,I,M]),O=_e(f.Fragment,null,_e("span",{id:"aria-selection"},S),_e("span",{id:"aria-focused"},F),_e("span",{id:"aria-results"},D),_e("span",{id:"aria-guidance"},T));return _e(f.Fragment,null,_e(yc,{id:u},M&&O),_e(yc,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},l&&!M&&O))},vy=my,Bl=[{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źẑżžẓẕƶȥɀⱬꝣ"}],by=new RegExp("["+Bl.map(function(e){return e.letters}).join("")+"]","g"),zf={};for(var yl=0;yl<Bl.length;yl++)for(var Cl=Bl[yl],Sl=0;Sl<Cl.letters.length;Sl++)zf[Cl.letters[Sl]]=Cl.base;var Vf=function(t){return t.replace(by,function(n){return zf[n]})},wy=fy(Vf),Cc=function(t){return t.replace(/^\s+|\s+$/g,"")},yy=function(t){return"".concat(t.label," ").concat(t.value)},Cy=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Le({ignoreCase:!0,ignoreAccents:!0,stringify:yy,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,l=i.ignoreAccents,a=i.stringify,s=i.trim,u=i.matchFrom,c=s?Cc(r):r,d=s?Cc(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),l&&(c=wy(c),d=Vf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},Sy=["innerRef"];function xy(e){var t=e.innerRef,n=ar(e,Sy),r=K1(n,"onExited","in","enter","exit","appear");return _e("input",He({ref:t},r,{css:Kc({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 ky=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function My(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,l=f.useRef(!1),a=f.useRef(!1),s=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(w,b){if(u.current!==null){var v=u.current,C=v.scrollTop,I=v.scrollHeight,E=v.clientHeight,R=u.current,P=b>0,x=I-E-C,S=!1;x>b&&l.current&&(r&&r(w),l.current=!1),P&&a.current&&(o&&o(w),a.current=!1),P&&b>x?(n&&!l.current&&n(w),R.scrollTop=I,S=!0,l.current=!0):!P&&-b>C&&(i&&!a.current&&i(w),R.scrollTop=0,S=!0,a.current=!0),S&&ky(w)}},[n,r,i,o]),d=f.useCallback(function(w){c(w,w.deltaY)},[c]),g=f.useCallback(function(w){s.current=w.changedTouches[0].clientY},[]),h=f.useCallback(function(w){var b=s.current-w.changedTouches[0].clientY;c(w,b)},[c]),p=f.useCallback(function(w){if(w){var b=G1?{passive:!1}:!1;w.addEventListener("wheel",d,b),w.addEventListener("touchstart",g,b),w.addEventListener("touchmove",h,b)}},[h,g,d]),m=f.useCallback(function(w){w&&(w.removeEventListener("wheel",d,!1),w.removeEventListener("touchstart",g,!1),w.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var w=u.current;return p(w),function(){m(w)}}},[t,p,m]),function(w){u.current=w}}var Sc=["boxSizing","height","overflow","paddingRight","position"],xc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function kc(e){e.cancelable&&e.preventDefault()}function Mc(e){e.stopPropagation()}function Rc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Ec(){return"ontouchstart"in window||navigator.maxTouchPoints}var Ic=!!(typeof window<"u"&&window.document&&window.document.createElement),to=0,yi={capture:!1,passive:!1};function Ry(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),l=f.useCallback(function(s){if(Ic){var u=document.body,c=u&&u.style;if(r&&Sc.forEach(function(p){var m=c&&c[p];i.current[p]=m}),r&&to<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(xc).forEach(function(p){var m=xc[p];c&&(c[p]=m)}),c&&(c.paddingRight="".concat(h,"px"))}u&&Ec()&&(u.addEventListener("touchmove",kc,yi),s&&(s.addEventListener("touchstart",Rc,yi),s.addEventListener("touchmove",Mc,yi))),to+=1}},[r]),a=f.useCallback(function(s){if(Ic){var u=document.body,c=u&&u.style;to=Math.max(to-1,0),r&&to<1&&Sc.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&Ec()&&(u.removeEventListener("touchmove",kc,yi),s&&(s.removeEventListener("touchstart",Rc,yi),s.removeEventListener("touchmove",Mc,yi)))}},[r]);return f.useEffect(function(){if(t){var s=o.current;return l(s),function(){a(s)}}},[t,l,a]),function(s){o.current=s}}var Ey=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Iy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Ty(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,l=e.onBottomLeave,a=e.onTopArrive,s=e.onTopLeave,u=My({isEnabled:i,onBottomArrive:o,onBottomLeave:l,onTopArrive:a,onTopLeave:s}),c=Ry({isEnabled:n}),d=function(h){u(h),c(h)};return _e(f.Fragment,null,n&&_e("div",{onClick:Ey,css:Iy}),t(d))}var Dy={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Oy=function(t){var n=t.name,r=t.onFocus;return _e("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Dy,value:"",onChange:function(){}})},Py=Oy;function Ms(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Ly(){return Ms(/^iPhone/i)}function $f(){return Ms(/^Mac/i)}function Fy(){return Ms(/^iPad/i)||$f()&&navigator.maxTouchPoints>1}function _y(){return Ly()||Fy()}function Ay(){return $f()||_y()}var Hy=function(t){return t.label},Nf=function(t){return t.label},Bf=function(t){return t.value},zy=function(t){return!!t.isDisabled},Vy={clearIndicator:kw,container:hw,control:Ow,dropdownIndicator:Sw,group:_w,groupHeading:Hw,indicatorsContainer:vw,indicatorSeparator:Rw,input:Nw,loadingIndicator:Tw,loadingMessage:sw,menu:tw,menuList:ow,menuPortal:dw,multiValue:Xw,multiValueLabel:Gw,multiValueRemove:Yw,noOptionsMessage:lw,option:ey,placeholder:ry,singleValue:ay,valueContainer:pw},$y={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%)"},Ny=4,Wf=4,By=38,Wy=Wf*2,Uy={baseUnit:Wf,controlHeight:By,menuGutter:Wy},xl={borderRadius:Ny,colors:$y,spacing:Uy},qy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:vc(),captureMenuScroll:!vc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Cy(),formatGroupLabel:Hy,getOptionLabel:Nf,getOptionValue:Bf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:zy,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!q1(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Tc(e,t,n,r){var i=Xf(e,t,n),o=Gf(e,t,n),l=qf(e,t),a=ya(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:l,value:a,index:r}}function ra(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(l,a){return Tc(e,l,t,a)}).filter(function(l){return Oc(e,l)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=Tc(e,n,t,r);return Oc(e,o)?o:void 0}).filter(Y1)}function Uf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Ii(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Dc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Ii(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function Xy(e,t){return Uf(ra(e,t))}function Oc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,l=t.label,a=t.value;return(!jf(e)||!o)&&Yf(e,{label:l,value:a,data:i},r)}function Gy(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function Yy(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var kl=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},qf=function(t,n){return t.getOptionLabel(n)},ya=function(t,n){return t.getOptionValue(n)};function Xf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Gf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ya(e,t);return n.some(function(i){return ya(e,i)===r})}function Yf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var jf=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},jy=1,Rs=function(e){Jg(n,e);var t=tp(n);function n(r){var i;if(ep(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=Ay(),i.controlRef=null,i.getControlRef=function(s){i.controlRef=s},i.focusedOptionRef=null,i.getFocusedOptionRef=function(s){i.focusedOptionRef=s},i.menuListRef=null,i.getMenuListRef=function(s){i.menuListRef=s},i.inputRef=null,i.getInputRef=function(s){i.inputRef=s},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(s,u){var c=i.props,d=c.onChange,g=c.name;u.name=g,i.ariaOnChange(s,u),d(s,u)},i.setValue=function(s,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,p=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:p}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(s,{action:u,option:c})},i.selectOption=function(s){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,g=u.name,h=i.state.selectValue,p=d&&i.isOptionSelected(s,h),m=i.isOptionDisabled(s,h);if(p){var w=i.getOptionValue(s);i.setValue(h.filter(function(b){return i.getOptionValue(b)!==w}),"deselect-option",s)}else if(!m)d?i.setValue([].concat(Ii(h),[s]),"select-option",s):i.setValue(s,"select-option");else{i.ariaOnChange(s,{action:"select-option",option:s,name:g});return}c&&i.blurInput()},i.removeValue=function(s){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(s),g=c.filter(function(p){return i.getOptionValue(p)!==d}),h=io(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:s}),i.focusInput()},i.clearValue=function(){var s=i.state.selectValue;i.onChange(io(i.props.isMulti,[],null),{action:"clear",removedValues:s})},i.popValue=function(){var s=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),g=io(s,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(s){return kl(i.state.focusableOptionsWithIds,s)},i.getFocusableOptionsWithIds=function(){return Dc(ra(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return $1.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(s){return qf(i.props,s)},i.getOptionValue=function(s){return ya(i.props,s)},i.getStyles=function(s,u){var c=i.props.unstyled,d=Vy[s](u,c);d.boxSizing="border-box";var g=i.props.styles[s];return g?g(d,u):d},i.getClassNames=function(s,u){var c,d;return(c=(d=i.props.classNames)[s])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(s){return"".concat(i.state.instancePrefix,"-").concat(s)},i.getComponents=function(){return uy(i.props)},i.buildCategorizedOptions=function(){return ra(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return Uf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(s,u){i.setState({ariaSelection:Le({value:s},u)})},i.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(s){i.blockOptionHover=!1},i.onControlMouseDown=function(s){if(!s.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},i.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),s.preventDefault()}},i.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(i.clearValue(),s.preventDefault(),i.openAfterFocus=!1,s.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(s){typeof i.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&Ra(s.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(s)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(s){var u=s.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(s){var u=s.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||g>h}},i.onTouchEnd=function(s){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(s.target)&&i.menuListRef&&!i.menuListRef.contains(s.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(s){i.userIsDragging||i.onControlMouseDown(s)},i.onClearIndicatorTouchEnd=function(s){i.userIsDragging||i.onClearIndicatorMouseDown(s)},i.onDropdownIndicatorTouchEnd=function(s){i.userIsDragging||i.onDropdownIndicatorMouseDown(s)},i.handleInputChange=function(s){var u=i.props.inputValue,c=s.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(s){i.props.onFocus&&i.props.onFocus(s),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(s){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(s),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(s){if(!(i.blockOptionHover||i.state.focusedOption===s)){var u=i.getFocusableOptions(),c=u.indexOf(s);i.setState({focusedOption:s,focusedOptionId:c>-1?i.getFocusedOptionId(s):null})}},i.shouldHideSelectedOptions=function(){return jf(i.props)},i.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),i.focus()},i.onKeyDown=function(s){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,p=u.isClearable,m=u.isDisabled,w=u.menuIsOpen,b=u.onKeyDown,v=u.tabSelectsValue,C=u.openMenuOnFocus,I=i.state,E=I.focusedOption,R=I.focusedValue,P=I.selectValue;if(!m&&!(typeof b=="function"&&(b(s),s.defaultPrevented))){switch(i.blockOptionHover=!0,s.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!d)return;c?i.popValue():p&&i.clearValue()}break;case"Tab":if(i.isComposing||s.shiftKey||!w||!v||!E||C&&i.isOptionSelected(E,P))return;i.selectOption(E);break;case"Enter":if(s.keyCode===229)break;if(w){if(!E||i.isComposing)return;i.selectOption(E);break}return;case"Escape":w?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):p&&g&&i.clearValue();break;case" ":if(h)return;if(!w){i.openMenu("first");break}if(!E)return;i.selectOption(E);break;case"ArrowUp":w?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":w?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!w)return;i.focusOption("pageup");break;case"PageDown":if(!w)return;i.focusOption("pagedown");break;case"Home":if(!w)return;i.focusOption("first");break;case"End":if(!w)return;i.focusOption("last");break;default:return}s.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++jy),i.state.selectValue=ba(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),l=i.buildFocusableOptions(),a=l.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=l[a],i.state.focusedOptionId=kl(o,l[a])}return i}return Qg(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&&mc(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,l=o.isDisabled,a=o.menuIsOpen,s=this.state.isFocused;(s&&!l&&i.isDisabled||s&&a&&!i.menuIsOpen)&&this.focusInput(),s&&l&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!l&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(mc(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,l=this.state,a=l.selectValue,s=l.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(s&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,l=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=l.indexOf(a);a||(s=-1);var u=l.length-1,c=-1;if(l.length){switch(i){case"previous":s===0?c=0:s===-1?c=u:c=s-1;break;case"next":s>-1&&s<u&&(c=s+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:l[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,l=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var s=0,u=a.indexOf(l);l||(u=-1),i==="up"?s=u>0?u-1:a.length-1:i==="down"?s=(u+1)%a.length:i==="pageup"?(s=u-o,s<0&&(s=0)):i==="pagedown"?(s=u+o,s>a.length-1&&(s=a.length-1)):i==="last"&&(s=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[s],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[s])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(xl):Le(Le({},xl),this.props.theme):xl}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,l=this.getStyles,a=this.getClassNames,s=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,p=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:l,getClassNames:a,getValue:s,hasValue:m,isMulti:g,isRtl:h,options:p,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,l=i.isMulti;return o===void 0?l:o}},{key:"isOptionDisabled",value:function(i,o){return Xf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Gf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return Yf(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var l=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:l,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,l=i.isSearchable,a=i.inputId,s=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),p=h.Input,m=this.state,w=m.inputIsHidden,b=m.ariaSelection,v=this.commonProps,C=a||this.getElementId("input"),I=Le(Le(Le({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!l&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return l?f.createElement(p,He({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:C,innerRef:this.getInputRef,isDisabled:o,isHidden:w,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:s},I)):f.createElement(xy,He({id:C,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:va,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},I))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),l=o.MultiValue,a=o.MultiValueContainer,s=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,p=h.controlShouldRenderValue,m=h.isDisabled,w=h.isMulti,b=h.inputValue,v=h.placeholder,C=this.state,I=C.selectValue,E=C.focusedValue,R=C.isFocused;if(!this.hasValue()||!p)return b?null:f.createElement(d,He({},g,{key:"placeholder",isDisabled:m,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),v);if(w)return I.map(function(x,S){var F=x===E,D="".concat(i.getOptionLabel(x),"-").concat(i.getOptionValue(x));return f.createElement(l,He({},g,{components:{Container:a,Label:s,Remove:u},isFocused:F,isDisabled:m,key:D,index:S,removeProps:{onClick:function(){return i.removeValue(x)},onTouchEnd:function(){return i.removeValue(x)},onMouseDown:function(T){T.preventDefault()}},data:x}),i.formatOptionLabel(x,"value"))});if(b)return null;var P=I[0];return f.createElement(c,He({},g,{data:P,isDisabled:m}),this.formatOptionLabel(P,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,l=this.commonProps,a=this.props,s=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||s||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,He({},l,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,l=this.commonProps,a=this.props,s=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,He({},l,{innerProps:d,isDisabled:s,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,l=i.IndicatorSeparator;if(!o||!l)return null;var a=this.commonProps,s=this.props.isDisabled,u=this.state.isFocused;return f.createElement(l,He({},a,{isDisabled:s,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var l=this.commonProps,a=this.props.isDisabled,s=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,He({},l,{innerProps:u,isDisabled:a,isFocused:s}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),l=o.Group,a=o.GroupHeading,s=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,p=this.commonProps,m=this.state.focusedOption,w=this.props,b=w.captureMenuScroll,v=w.inputValue,C=w.isLoading,I=w.loadingMessage,E=w.minMenuHeight,R=w.maxMenuHeight,P=w.menuIsOpen,x=w.menuPlacement,S=w.menuPosition,F=w.menuPortalTarget,D=w.menuShouldBlockScroll,M=w.menuShouldScrollIntoView,T=w.noOptionsMessage,O=w.onMenuScrollToTop,k=w.onMenuScrollToBottom;if(!P)return null;var N=function(se,he){var de=se.type,ie=se.data,H=se.isDisabled,L=se.isSelected,G=se.label,ne=se.value,oe=m===ie,Se=H?void 0:function(){return i.onOptionHover(ie)},me=H?void 0:function(){return i.selectOption(ie)},et="".concat(i.getElementId("option"),"-").concat(he),xe={id:et,onClick:me,onMouseMove:Se,onMouseOver:Se,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:L};return f.createElement(h,He({},p,{innerProps:xe,data:ie,isDisabled:H,isSelected:L,key:et,label:G,type:de,value:ne,isFocused:oe,innerRef:oe?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(se.data,"menu"))},X;if(this.hasOptions())X=this.getCategorizedOptions().map(function(ce){if(ce.type==="group"){var se=ce.data,he=ce.options,de=ce.index,ie="".concat(i.getElementId("group"),"-").concat(de),H="".concat(ie,"-heading");return f.createElement(l,He({},p,{key:ie,data:se,options:he,Heading:a,headingProps:{id:H,data:ce.data},label:i.formatGroupLabel(ce.data)}),ce.options.map(function(L){return N(L,"".concat(de,"-").concat(L.index))}))}else if(ce.type==="option")return N(ce,"".concat(ce.index))});else if(C){var Y=I({inputValue:v});if(Y===null)return null;X=f.createElement(d,p,Y)}else{var ue=T({inputValue:v});if(ue===null)return null;X=f.createElement(g,p,ue)}var ee={minMenuHeight:E,maxMenuHeight:R,menuPlacement:x,menuPosition:S,menuShouldScrollIntoView:M},te=f.createElement(nw,He({},p,ee),function(ce){var se=ce.ref,he=ce.placerProps,de=he.placement,ie=he.maxHeight;return f.createElement(s,He({},p,ee,{innerRef:se,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:C,placement:de}),f.createElement(Ty,{captureEnabled:b,onTopArrive:O,onBottomArrive:k,lockEnabled:D},function(H){return f.createElement(u,He({},p,{innerRef:function(G){i.getMenuListRef(G),H(G)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:i.getElementId("listbox")},isLoading:C,maxHeight:ie,focusedOption:m}),X)}))});return F||S==="fixed"?f.createElement(c,He({},p,{appendTo:F,controlElement:this.controlRef,menuPlacement:x,menuPosition:S}),te):te}},{key:"renderFormField",value:function(){var i=this,o=this.props,l=o.delimiter,a=o.isDisabled,s=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(Py,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(s)if(l){var g=d.map(function(m){return i.getOptionValue(m)}).join(l);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(m,w){return f.createElement("input",{key:"i-".concat(w),name:u,type:"hidden",value:i.getOptionValue(m)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var p=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,l=o.ariaSelection,a=o.focusedOption,s=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(vy,He({},i,{id:this.getElementId("live-region"),ariaSelection:l,focusedOption:a,focusedValue:s,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,l=i.IndicatorsContainer,a=i.SelectContainer,s=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,p=this.state.isFocused,m=this.commonProps=this.getCommonProps();return f.createElement(a,He({},m,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:p}),this.renderLiveRegion(),f.createElement(o,He({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:p,menuIsOpen:h}),f.createElement(s,He({},m,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(l,He({},m,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var l=o.prevProps,a=o.clearFocusValueOnUpdate,s=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,p=i.value,m=i.menuIsOpen,w=i.inputValue,b=i.isMulti,v=ba(p),C={};if(l&&(p!==l.value||h!==l.options||m!==l.menuIsOpen||w!==l.inputValue)){var I=m?Xy(i,v):[],E=m?Dc(ra(i,v),"".concat(g,"-option")):[],R=a?Gy(o,v):null,P=Yy(o,I),x=kl(E,P);C={selectValue:v,focusedOption:P,focusedOptionId:x,focusableOptionsWithIds:E,focusedValue:R,clearFocusValueOnUpdate:!1}}var S=s!=null&&i!==l?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},F=u,D=c&&d;return c&&!D&&(F={value:io(b,v,v[0]||null),options:v,action:"initial-input-focus"},D=!d),u?.action==="initial-input-focus"&&(F=null),Le(Le(Le({},C),S),{},{prevProps:i,ariaSelection:F,prevWasFocused:D})}}]),n}(f.Component);Rs.defaultProps=qy;var Ky=f.forwardRef(function(e,t){var n=Cf(e);return f.createElement(Rs,He({ref:t},n))}),Kf=Ky;const Zy=e=>{const{Menu:t}=ks,{children:n,...r}=e;return f.createElement(t,{...r},n)},Jy=cn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Qy=cn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),eC=cn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),tC=e=>{const{value:t,onFinishedEditing:n,initialValue:r,portalElementRef:i}=e,{allowedValues:o,value:l}=t.data,[a,s]=f.useState(l),[u,c]=f.useState(r??""),d=_d(),g=f.useMemo(()=>o.map(h=>typeof h=="string"||h===null||h===void 0?{value:h,label:h?.toString()??""}:h),[o]);return t.readonly?f.createElement(eC,null,f.createElement(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):f.createElement(Jy,null,f.createElement(Kf,{className:"glide-select",inputValue:u,onInputChange:c,menuPlacement:"auto",value:g.find(h=>h.value===a),styles:{control:h=>({...h,border:0,boxShadow:"none"}),option:(h,{isFocused:p})=>({...h,fontSize:d.editorFontSize,fontFamily:d.fontFamily,cursor:p?"pointer":void 0,paddingLeft:d.cellHorizontalPadding,paddingRight:d.cellHorizontalPadding,":active":{...h[":active"],color:d.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:h=>({...h,colors:{...h.colors,neutral0:d.bgCell,neutral5:d.bgCell,neutral10:d.bgCell,neutral20:d.bgCellMedium,neutral30:d.bgCellMedium,neutral40:d.bgCellMedium,neutral50:d.textLight,neutral60:d.textMedium,neutral70:d.textMedium,neutral80:d.textDark,neutral90:d.textDark,neutral100:d.textDark,primary:d.accentColor,primary75:d.accentColor,primary50:d.accentColor,primary25:d.accentLight}}),menuPortalTarget:i?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:h=>f.createElement(Qy,null,f.createElement(Zy,{className:"click-outside-ignore",...h}))},options:g,onChange:async h=>{h!==null&&(s(h.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:h.value}}))}}))},nC={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,l=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===o:s.value===o),a=typeof l=="string"?l:l?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+er(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:tC,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 rC(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],l=i*t;return e.replace(n,`${Number(l.toPrecision(3))}${o}`)}return e}const iC={marginRight:8},oC={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:i}=e,{min:o,max:l,value:a,label:s,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,d=i.y+i.height/2,g=l-o,h=(a-o)/g,p=`${rC(r.baseFontStyle,.9)} ${r.fontFamily}`,w=es(n,p)/2;n.save();let b=0;s!==void 0&&(n.font=p,b=Or(u??s,n,p).width+r.cellHorizontalPadding);const v=i.width-r.cellHorizontalPadding*2-b;if(v>=w){const C=n.createLinearGradient(c,d,c+v,d);C.addColorStop(0,r.accentColor),C.addColorStop(h,r.accentColor),C.addColorStop(h,r.bgBubble),C.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=C,dc(n,c,d-w/2,v,w,w/2),n.fill(),n.beginPath(),dc(n,c+.5,d-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,i.x+i.width-r.cellHorizontalPadding,d+er(n,p))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),l=t.step.toString(),a=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return f.createElement("label",{style:oC},f.createElement("input",{style:iC,type:"range",value:r,min:i,max:o,step:l,onChange:a,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},lC=cn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Ml=(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}`)}},sC=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.timezoneOffset?t.timezoneOffset*60*1e3:0,l=t.min instanceof Date?Ml(n,t.min,o):t.min,a=t.max instanceof Date?Ml(n,t.max,o):t.max,s=Ml(n,t.date,o);return e.value.readonly?$t.createElement(Jr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):$t.createElement(lC,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:l,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},uC={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Ql(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:sC}),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 cC=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Pc=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),l=String(r.getOptionLabel(n)).toLowerCase();return o===i||l===i},Rl={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return Pc(t,o,i)})||r.some(function(o){return Pc(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function dC(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,l=o===void 0?Rl.formatCreateLabel:o,a=e.isValidNewOption,s=a===void 0?Rl.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?Rl.getNewOptionData:u,d=e.onCreateOption,g=e.options,h=g===void 0?[]:g,p=e.onChange,m=ar(e,cC),w=m.getOptionValue,b=w===void 0?Bf:w,v=m.getOptionLabel,C=v===void 0?Nf:v,I=m.inputValue,E=m.isLoading,R=m.isMulti,P=m.value,x=m.name,S=f.useMemo(function(){return s(I,ba(P),h,{getOptionValue:b,getOptionLabel:C})?c(I,l(I)):void 0},[l,c,C,b,I,s,h,P]),F=f.useMemo(function(){return(n||!E)&&S?i==="first"?[S].concat(Ii(h)):[].concat(Ii(h),[S]):h},[n,i,E,S,h]),D=f.useCallback(function(M,T){if(T.action!=="select-option")return p(M,T);var O=Array.isArray(M)?M:[M];if(O[O.length-1]===S){if(d)d(I);else{var k=c(I,I),N={action:"create-option",name:x,option:k};p(io(R,[].concat(Ii(ba(P)),[k]),k),N)}return}p(M,T)},[c,I,R,x,S,d,p,P]);return Le(Le({},m),{},{options:F,onChange:D})}var fC=f.forwardRef(function(e,t){var n=Cf(e),r=dC(n);return f.createElement(Rs,He({ref:t},r))}),hC=fC;const Es="__value",gC=new RegExp(`^${Es}\\d+__`),pC=cn("div")({name:"Wrap",class:"gdg-w1i61rz",propsAsIs:!1}),mC=cn("div")({name:"PortalWrap",class:"gdg-phbadu4",propsAsIs:!1}),ia=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}),Zf=(e,t,n)=>e==null?[]:e.map((r,i)=>{const o=n?`${Es}${i}__`:"",l=t.find(a=>a.value===r);return l?{...l,value:`${o}${l.value}`}:{value:`${o}${r}`,label:r}}),vC=e=>{const{Menu:t}=ks,{children:n,...r}=e;return f.createElement(t,{...r},n)},bC=e=>{const{value:t,initialValue:n,onChange:r,onFinishedEditing:i,portalElementRef:o}=e,{options:l,values:a,allowCreation:s,allowDuplicates:u}=t.data,c=_d(),[d,g]=f.useState(a),[h,p]=f.useState(!0),[m,w]=f.useState(n??""),b=f.useMemo(()=>ia(l??[]),[l]),v=s&&u&&b.length===0,C=f.useCallback(x=>{h&&x.stopPropagation()},[h]),I={control:(x,S)=>({...x,border:0,boxShadow:"none",backgroundColor:c.bgCell,pointerEvents:S.isDisabled?"auto":x.pointerEvents,cursor:S.isDisabled?"default":x.cursor}),valueContainer:x=>({...x,flexWrap:x.flexWrap??"wrap",overflowX:"auto",overflowY:"hidden"}),menu:x=>({...x,backgroundColor:c.bgCell}),option:(x,S)=>({...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark,...S.isFocused?{backgroundColor:c.accentLight,cursor:"pointer"}:{},":active":{...x[":active"],color:c.accentFg,backgroundColor:c.accentColor}}),input:(x,{isDisabled:S})=>S?{display:"none"}:{...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textDark},placeholder:x=>({...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),noOptionsMessage:x=>({...x,fontSize:c.editorFontSize,fontFamily:c.fontFamily,color:c.textLight}),clearIndicator:x=>({...x,color:c.textLight,":hover":{color:c.textDark,cursor:"pointer"}}),multiValue:(x,{data:S})=>({...x,backgroundColor:S.color??c.bgBubble,borderRadius:`${c.roundingRadius??c.bubbleHeight/2}px`,flexShrink:0,whiteSpace:"nowrap"}),multiValueLabel:(x,{data:S,isDisabled:F})=>({...x,paddingRight:F?c.bubblePadding:0,paddingLeft:c.bubblePadding,paddingTop:0,paddingBottom:0,color:S.color?Ol(S.color)>.5?"black":"white":c.textBubble,fontSize:c.editorFontSize,fontFamily:c.fontFamily,justifyContent:"center",alignItems:"center",display:"flex",height:c.bubbleHeight,whiteSpace:"nowrap"}),multiValueRemove:(x,{data:S,isDisabled:F,isFocused:D})=>F?{display:"none"}:{...x,color:S.color?Ol(S.color)>.5?"black":"white":c.textBubble,backgroundColor:void 0,borderRadius:D?`${c.roundingRadius??c.bubbleHeight/2}px`:void 0,":hover":{cursor:"pointer"}}},E=f.useCallback(x=>{const S=x.map(F=>u&&F.startsWith(Es)?F.replace(new RegExp(gC),""):F);g(S),r({...t,data:{...t.data,values:S}})},[t,r,u]),R=x=>{switch(x.key){case"Enter":case"Tab":if(!m){i(t,[0,1]);return}u&&s&&(w(""),E([...d??[],m]),p(!1),x.preventDefault())}},P=s?hC:Kf;return f.createElement(pC,{onKeyDown:C,"data-testid":"multi-select-cell"},f.createElement(P,{className:"gdg-multi-select",isMulti:!0,isDisabled:t.readonly,isClearable:!0,isSearchable:!0,inputValue:m,onInputChange:w,options:b,placeholder:t.readonly?"":s?"Add...":void 0,noOptionsMessage:x=>s&&u&&x.inputValue?`Create "${x.inputValue}"`:void 0,menuIsOpen:t.readonly?!1:h,onMenuOpen:()=>p(!0),onMenuClose:()=>p(!1),value:Zf(d,b,u),onKeyDown:t.readonly?void 0:R,menuPlacement:"auto",menuPortalTarget:o?.current??document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,openMenuOnClick:!0,closeMenuOnSelect:!0,backspaceRemovesValue:!0,escapeClearsValue:!1,styles:I,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:x=>v?null:f.createElement(mC,null,f.createElement(vC,{className:"click-outside-ignore",...x}))},onChange:async x=>{x!==null&&E(x.map(S=>S.value))}}))},wC={kind:Z.Custom,isMatch:e=>e.data.kind==="multi-select-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i,highlighted:o}=e,{values:l,options:a}=t.data;if(l==null)return!0;const s=ia(a??[]),u={x:i.x+r.cellHorizontalPadding,y:i.y+r.cellVerticalPadding,width:i.width-2*r.cellHorizontalPadding,height:i.height-2*r.cellVerticalPadding},c=Math.max(1,Math.floor(u.height/(r.bubbleHeight+r.bubblePadding)));let{x:d}=u,g=1,h=c===1?u.y+(u.height-r.bubbleHeight)/2:u.y+(u.height-c*r.bubbleHeight-(c-1)*r.bubblePadding)/2;for(const p of l){const m=s.find(E=>E.value===p),w=m?.color??(o?r.bgBubbleSelected:r.bgBubble),b=m?.label??p,C=Or(b,n).width+r.bubblePadding*2,I=r.bubbleHeight/2;if(d!==u.x&&d+C>u.x+u.width&&g<c&&(g++,h+=r.bubbleHeight+r.bubblePadding,d=u.x),n.fillStyle=w,n.beginPath(),Jn(n,d,h,C,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2),n.fill(),n.fillStyle=m?.color?Ol(w)>.5?"#000000":"#ffffff":r.textBubble,n.fillText(b,d+r.bubblePadding,h+I+er(n,r)),d+=C+r.bubbleMargin,d>u.x+u.width+r.cellHorizontalPadding&&g>=c)break}return!0},measure:(e,t,n)=>{const{values:r,options:i}=t.data;if(!r)return n.cellHorizontalPadding*2;const o=Zf(r,ia(i??[]),t.data.allowDuplicates).map(a=>a.label??a.value),l=o.reduce((a,s)=>e.measureText(s).width+a+n.bubblePadding*2+n.bubbleMargin,0);return o.length===0?n.cellHorizontalPadding*2:l+2*n.cellHorizontalPadding-n.bubbleMargin},provideEditor:()=>({editor:bC,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,values:[]}})}),onPaste:(e,t)=>{if(!e||!e.trim())return{...t,values:[]};let n=e.split(",").map(r=>r.trim());if(t.allowDuplicates||(n=n.filter((r,i)=>n.indexOf(r)===i)),!t.allowCreation){const r=ia(t.options??[]);n=n.filter(i=>r.find(o=>o.value===i))}if(n.length!==0)return{...t,values:n}}},yC="None";function Lc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const CC=e=>{const{cell:t,theme:n,ctx:r}=e;Ql({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},yC,t.contentAlign),r.fillStyle=n.textDark};function SC(e){const t=f.useCallback((r,i)=>{const{cell:o,theme:l,ctx:a,rect:s}=r,u=r.col;if(Ti(o))Lc(a,s,l);else if(ls(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():CC(r),c.isRequired&&c.isEditable&&Lc(a,s,l);return}i()},[e]),n=f.useMemo(()=>[S1,nC,aC,uC,wC,...Yb],[]);return{drawCell:t,customRenderers:n}}function xC(){const e=Kr();return f.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:Ci(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Ci(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:Ci(e.colors.darkenedBgMix100,.9),bgHeaderHovered:Ci(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(rn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${rn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${rn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Ci(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(rn(e.spacing.sm)),cellVerticalPadding:Math.round(rn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:Pg(e.colors.secondaryBg,.1),bubbleHeight:Math.round(rn("1.25rem")),bubblePadding:Math.round(rn(e.spacing.sm)),bubbleMargin:Math.round(rn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(rn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(rn("25rem")),minColumnWidth:Math.round(rn("3.125rem")),maxColumnWidth:Math.round(rn("62.5rem")),maxColumnAutoWidth:Math.round(rn("31.25rem")),defaultRowHeight:Math.round(rn("2.1875rem")),defaultHeaderHeight:Math.round(rn("2.1875rem")),bgRowHovered:Lg(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const kC=ql.getLogger("useDataEditor");function MC(e,t,n,r,i,o,l,a,s){const u=f.useCallback(([m,w],b)=>{const v=e[m];if(!v.isEditable)return;const C=v.indexNumber,I=n.current.getOriginalRowIndex(i(w)),E=r([m,w]),R=v.getCellValue(E),P=v.getCellValue(b);if(!Ti(E)&&P===R)return;const x=v.getCell(P,!0);Ti(x)?kC.warn(`Not applying the cell edit since it causes this error:
195
+ ${x.data}`):(n.current.setCell(C,I,{...x,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=f.useCallback(()=>{if(t)return;const m=new Map;e.forEach(w=>{m.set(w.indexNumber,w.getCell(w.defaultValue))}),n.current.addRow(m),l()},[e,n,t,l]),d=f.useCallback(()=>{t||(c(),a())},[c,a,t]),g=f.useCallback(m=>{if(m.rows.length>0){if(t)return!0;const w=m.rows.toArray().map(b=>n.current.getOriginalRowIndex(i(b)));return n.current.deleteRows(w),l(),s(),a(),!1}if(m.current?.range){const w=[],b=m.current.range;for(let v=b.y;v<b.y+b.height;v++)for(let C=b.x;C<b.x+b.width;C++){const I=e[C];I.isEditable&&!I.isRequired&&(w.push({cell:[C,v]}),u([C,v],I.getCell(null)))}return w.length>0&&(a(),o(w)),!1}return!0},[e,n,t,o,i,a,u,s,l]),h=f.useCallback((m,w)=>{const[b,v]=m,C=[];for(let I=0;I<w.length;I++){const E=w[I];if(I+v>=n.current.getNumRows()){if(t)break;c()}for(let R=0;R<E.length;R++){const P=E[R],x=I+v,S=R+b;if(S>=e.length)break;const F=e[S];if(F.isEditable){const D=F.getCell(P,!0);if(lt(D)&&!Ti(D)){const M=F.indexNumber,T=n.current.getOriginalRowIndex(i(x)),O=F.getCellValue(r([S,x]));F.getCellValue(D)!==O&&(n.current.setCell(M,T,{...D,lastUpdated:performance.now()}),C.push({cell:[S,x]}))}}}C.length>0&&(a(),o(C))}return!1},[e,n,t,i,r,c,a,o]),p=f.useCallback((m,w)=>{const b=m[0];if(b>=e.length)return!0;const v=e[b];if(v.validateInput){const C=v.validateInput(v.getCellValue(w));return C===!0||C===!1?C:v.getCell(C)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:g,validateCell:p}}const Jf=",",oo='"',RC='"',Qf=`
196
+ `,EC="\uFEFF",IC=new RegExp(`[${[Jf,oo,Qf].join("")}]`),Fc=ql.getLogger("useDataExporter");function _c(e){return e.map(t=>TC(t)).join(Jf)+Qf}function TC(e){if(Oe(e))return"";const t=st(e);return IC.test(t)?`${oo}${t.replace(new RegExp(oo,"g"),RC+oo)}${oo}`:t}async function Ac(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(EC));const o=n.map(l=>l.name);await e.write(i.encode(_c(o)));for(let l=0;l<r;l++){const a=[];n.forEach((s,u,c)=>{a.push(s.getCellValue(t([u,l])))}),await e.write(i.encode(_c(a)))}await e.close()}function DC(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const l=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Ul(()=>import("./es6.VpBPGCnM.js").then(c=>c.a),__vite__mapDeps([14,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:l,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Ac(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{Fc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let s="";const u=new WritableStream({write:h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await Ac(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Kg({enforceDownloadInNewTab:r,url:d,filename:l});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(s){Fc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function OC(e,t,n,r){return{getCellContent:f.useCallback(([o,l])=>{if(o>t.length-1)return Tt("Column index out of bounds","This error should never happen. Please report this bug.");if(l>n-1)return Tt("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],s=a.indexNumber,u=r.current.getOriginalRowIndex(l),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(s,u);if(lt(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return Tt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${s}; row=${u}`)}const d=e.getCell(u,s),g=Fg(e,u,s);return i1(a,d,g,e.styler?.cssStyles)}catch(a){return Tt("Error during cell creation",`This error should never happen. Please report this bug.
197
+ Error: ${a}`)}},[t,n,e,r])}}function PC(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,l]=o.location;n(l)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function LC(e,t,n,r,i){const[o,l]=f.useState({columns:Qe.empty(),rows:Qe.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.MULTI_ROW)||e.selectionMode.includes(on.SelectionMode.SINGLE_ROW)),s=a&&e.selectionMode.includes(on.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(on.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(on.SelectionMode.MULTI_COLUMN),d=!t&&!n&&(e.selectionMode.includes(on.SelectionMode.SINGLE_CELL)||e.selectionMode.includes(on.SelectionMode.MULTI_CELL)),g=d&&e.selectionMode.includes(on.SelectionMode.MULTI_CELL),h=o.rows.length>0,p=o.columns.length>0,m=o.current!==void 0,w=f.useCallback(v=>{const C=!ja(v.rows.toArray(),o.rows.toArray()),I=!ja(v.columns.toArray(),o.columns.toArray()),E=!ja(v.current,o.current),R=a&&C||u&&I||d&&E;let P=v;if(I&&P.columns.length>=0){let x=P.columns;r.forEach((S,F)=>{S.isIndex&&(x=x.remove(F))}),x.length<P.columns.length&&(P={...P,columns:x})}l(P),R&&i(P,d)},[o,a,u,d,i,r]),b=f.useCallback((v=!1,C=!1)=>{const I={columns:C?o.columns:Qe.empty(),rows:v?o.rows:Qe.empty(),current:void 0};l(I),(!v&&a||!C&&u||d)&&i(I,d)},[o,a,u,d,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:s,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isCellSelectionActivated:d,isMultiCellSelectionActivated:g,isRowSelected:h,isColumnSelected:p,isCellSelected:m,clearSelection:b,processSelectionChange:w}}function FC(e,t,n,r,i,o,l,a,s){const u=e.rowHeight??t.defaultRowHeight,c=t.defaultHeaderHeight+u+2*t.tableBorderWidth,d=r?2:1,g=e.editingMode===on.EditingMode.DYNAMIC?1:0,h=n+g;let p=Math.max(h*u+d*t.defaultHeaderHeight+2*t.tableBorderWidth,c),m=Math.min(p,t.defaultTableHeight);const w=a1(e,s);w&&(m=Math.max(w,c),p=Math.max(w,p)),o&&(m=Math.min(m,o),p=Math.min(p,o),w||(m=p));const b=t.minColumnWidth+2*t.tableBorderWidth,v=Math.max(i,b);let C,I=v;const E=bf(e,a),R=wf(e,a),P=o1(a);E?C=v:R?(C=Math.min(Math.max(R,b),v),I=Math.min(Math.max(R,I),v)):P&&(C=void 0);const[x,S]=f.useState({width:C||"100%",height:m});return f.useLayoutEffect(()=>{E&&x.width==="100%"&&S(F=>({...F,width:v}))},[v]),f.useLayoutEffect(()=>{S(F=>({...F,width:C||"100%"}))},[C]),f.useLayoutEffect(()=>{S(F=>({...F,height:m}))},[m,n]),f.useLayoutEffect(()=>{if(l){const F=E||lt(R)&&R>0;S({width:F?I:"100%",height:p})}else S({width:C||"100%",height:m})},[l]),{minHeight:c,maxHeight:p,minWidth:b,maxWidth:I,rowHeight:u,resizableSize:x,setResizableSize:S}}const _C=600,AC="⚠️ Please fill out this cell.";function HC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),l=f.useCallback(s=>{if(clearTimeout(o.current),o.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const u=s.location[0],c=s.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(s.kind==="header"&&lt(g))d=g.help;else if(s.kind==="cell"){const h=t([u,c]);Ti(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&ls(h)?d=AC:Ob(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},_C))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:l}}const eh=Qn("div",{target:"e32gfpu0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Er=Qn("div",{target:"e32gfpu1"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}})),th=Qn("div",{target:"e32gfpu2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),zC=Qn("div",{target:"e32gfpu3"})(({theme:e})=>({display:"flex",alignItems:"center",padding:`${e.spacing.sm} ${e.spacing.sm}`,cursor:"default",gap:e.spacing.twoXS})),VC=Qn("div",{target:"e32gfpu4"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing.twoXS,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:"transparent",color:e.colors.bodyText,height:"fit-content"})),$C=Qn("div",{target:"e32gfpu5"})(({theme:e})=>({display:"flex",alignItems:"center",flexGrow:1,padding:`${e.spacing.threeXS} ${e.spacing.threeXS}`,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.md,backgroundColor:e.colors.secondaryBg,minWidth:0,overflow:"hidden"})),NC=Qn("span",{target:"e32gfpu6"})(({theme:e})=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,margin:`0 ${e.spacing.xs}`,fontSize:e.fontSizes.twoSm,maxWidth:"4rem"})),BC=Qn("button",{target:"e32gfpu7"})(({theme:e})=>({background:"none",border:"none",padding:e.spacing.twoXS,cursor:"pointer",color:e.colors.bodyText,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.md,transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.colors.fadedText05},"&:active":{backgroundColor:e.colors.fadedText10}})),Hc=[{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:"}],WC={number:Hc,progress:Hc,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 UC({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:l}){const a=Kr(),{colors:s,fontSizes:u,radii:c,fontWeights:d}=a,g=WC[e]||[];return g.length===0?ze(Zc,{}):ze(xa,{triggerType:Jc.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:ze(eh,{role:"menu",children:g.map(h=>mn(Er,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[ze(jn,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:Ca.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:Sa(a)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:l})}const qC=f.memo(UC);function XC({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:l,onHideColumn:a,column:s,onChangeFormat:u,onAutosize:c}){const d=Kr(),[g,h]=f.useState(!1),{colors:p,fontSizes:m,radii:w,fontWeights:b}=d,{isCopied:v,copyToClipboard:C}=_g();f.useEffect(()=>{function R(P){P.preventDefault()}return document.addEventListener("wheel",R,{passive:!1}),document.addEventListener("touchmove",R,{passive:!1}),()=>{document.removeEventListener("wheel",R),document.removeEventListener("touchmove",R)}},[]);const I=f.useCallback(()=>{o()},[o]),E=f.useCallback(()=>{C(s.title)},[s.title,C]);return ze(xa,{autoFocus:!0,"aria-label":"Dataframe column menu",content:mn(eh,{children:[mn(zC,{children:[ze(VC,{title:s.kind,children:ze(jn,{iconValue:s.typeIcon||":material/notes:",size:"base",color:"inherit"})}),mn($C,{title:s.title,children:[ze(NC,{children:s.title}),ze(BC,{onClick:E,title:"Copy column name","aria-label":"Copy column name",children:ze(jn,{iconValue:v?":material/check:":":material/content_copy:",size:"sm",margin:"0",color:"inherit"})})]})]}),l&&mn(Zc,{children:[mn(Er,{onClick:()=>{l("asc"),I()},role:"menuitem",children:[ze(jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),mn(Er,{onClick:()=>{l("desc"),I()},role:"menuitem",children:[ze(jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),ze(th,{})]}),u&&ze(qC,{columnKind:s.kind,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:I,children:mn(Er,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[mn("div",{children:[ze(jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),ze(jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&mn(Er,{onClick:()=>{c(),I()},children:[ze(jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&mn(Er,{onClick:()=>{i(),I()},children:[ze(jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&mn(Er,{onClick:()=>{r(),I()},children:[ze(jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&mn(Er,{onClick:()=>{a(),I()},children:[ze(jn,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:Ca.bottomRight,accessibilityType:Qc.menu,showArrow:!1,popoverMargin:rn("0.375rem"),onClickOutside:g?void 0:I,onEsc:I,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:Sa(d)?p.bgColor:p.secondaryBg,color:p.bodyText,fontSize:m.sm,fontWeight:b.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:ze("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const GC=f.memo(XC),YC="(index)";function El(e,t){return!t.length||e.isIndex?!1:!t.includes(e.id)&&!t.includes(e.name)}const zc=({label:e,initialValue:t,isIndeterminate:n,onChange:r})=>{const i=Kr();return ze(jg,{isIndeterminate:n,checked:t,onChange:o=>{r(o.target.checked)},"aria-label":e,checkmarkType:Yg.default,labelPlacement:Gg.right,overrides:{Root:{style:({$isFocusVisible:o})=>({marginBottom:i.spacing.none,marginTop:i.spacing.none,paddingLeft:i.spacing.md,paddingRight:i.spacing.md,paddingTop:i.spacing.twoXS,paddingBottom:i.spacing.twoXS,backgroundColor:o?i.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:o,$checked:l,$isIndeterminate:a})=>{const s=l||a?i.colors.primary:i.colors.fadedText40;return{outline:0,width:i.sizes.checkbox,height:i.sizes.checkbox,marginTop:i.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:o&&(l||a)?`0 0 0 0.2rem ${Ci(i.colors.primary,.5)}`:"",borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},Label:{style:{lineHeight:i.lineHeights.small,paddingLeft:i.spacing.sm,position:"relative",color:i.colors.bodyText,fontSize:i.fontSizes.sm,fontWeight:i.fontWeights.normal}}},children:e})},jC=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:l,onClose:a})=>{const s=Kr(),u=h=>!(h.isHidden===!0||El(h,t)),c=e.every(u),d=e.some(u)&&!c,g=h=>{e.forEach(p=>{const m=El(p,t);h?(i(p.id),m&&n(w=>[...w,p.id])):r(p.id)})};return ze(xa,{triggerType:Jc.click,placement:Ca.bottomRight,autoFocus:!0,focusLock:!0,content:()=>mn("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto"},children:[ze(zc,{label:"Select all",isIndeterminate:d,initialValue:c,onChange:h=>{g(h)}}),ze(th,{}),ze("div",{children:e.map(h=>{const p=El(h,t);return ze(zc,{label:!h.title&&h.isIndex?YC:h.title,initialValue:!(h.isHidden===!0||p),onChange:m=>{m?(i(h.id),p&&n(w=>[...w,h.id])):r(h.id)}},h.id)})})]}),isOpen:l,onClickOutside:a,onClick:()=>l?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:s.radii.default,borderTopRightRadius:s.radii.default,borderBottomLeftRadius:s.radii.default,borderBottomRightRadius:s.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:Sa(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:ze("div",{children:o})})},KC=f.memo(jC),Vc=Qn("div",{target:"e8es05k0"})(({theme:e,isInHorizontalLayout:t})=>({position:"relative",display:t?"flex":"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",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 ZC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),l=Kr(),{colors:a,fontSizes:s,radii:u,fontWeights:c}=l,d=f.useCallback(()=>{o(!1),r()},[r,o]);return ze(xa,{content:ze(Ag,{"data-testid":"stDataFrameTooltipContent",children:ze(Hg,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Ca.top,accessibilityType:Qc.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:Sa(l)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:s.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:ze("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const JC=f.memo(ZC),$c=150,QC=15e4,eS="0.5rem";function tS({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o,customToolbarActions:l,widthConfig:a,heightConfig:s}){const{expanded:u,expand:c,collapse:d,width:g,height:h}=Us(Wg),{isInHorizontalLayout:p}=Us(zg),m=f.useRef(null),w=f.useRef(null),b=f.useRef(null),v=Vg(),C=xC(),{getRowThemeOverride:I,onItemHovered:E}=PC(C),{libConfig:{enforceDownloadInNewTab:R=!1}}=f.useContext($g),[P,x]=f.useState(!0),[S,F]=f.useState(!1),[D,M]=f.useState(!1),[T,O]=f.useState(!1),[k,N]=f.useState(),[X,Y]=f.useState(!1),ue=f.useCallback(()=>Y(ye=>!ye),[]),ee=f.useCallback(()=>Y(!1),[]),te=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]);Oe(e.editingMode)&&(e.editingMode=on.EditingMode.READ_ONLY);const{READ_ONLY:ce,DYNAMIC:se}=on.EditingMode,he=t.dimensions,de=Math.max(0,he.numDataRows),ie=de===0&&!(e.editingMode===se&&he.numDataColumns>0),H=de>QC,L=!H&&!ie&&e.editingMode!==se,G=!ie&&e.editingMode===se&&!n,ne=f.useRef(new jo(de)),[oe,Se]=f.useState(ne.current.getNumRows());f.useEffect(()=>{ne.current=new jo(de),Se(ne.current.getNumRows())},[de]);const me=f.useCallback(()=>{ne.current=new jo(de),Se(ne.current.getNumRows())},[de]),[et,xe]=f.useState(e.columnOrder);f.useEffect(()=>{xe(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:bt,allColumns:St,setColumnConfigMapping:Ue}=u1(e,t,n,et,a);f.useEffect(()=>{if(e.editingMode===ce||!r)return;const ye=r.getStringValue({id:e.id,formId:e.formId});ye&&(ne.current.fromJson(ye,bt),Se(ne.current.getNumRows()))},[]);const{getCellContent:re}=OC(t,bt,oe,ne),{columns:le,sortColumn:be,getOriginalIndex:fe,getCellContent:we}=w1(de,bt,re),$e=f.useCallback((ye,Ft)=>{if(!r)return;const Yt={selection:{rows:[],columns:[],cells:[]}};if(Yt.selection.rows=ye.rows.toArray().map(qt=>fe(qt)),Yt.selection.columns=ye.columns.toArray().map(qt=>Gr(le[qt])),Ft&&ye.current){const{cell:qt,range:Xt}=ye.current;if(Xt)for(let Ln=Xt.y;Ln<Xt.y+Xt.height;Ln++)for(let En=Xt.x;En<Xt.x+Xt.width;En++)le[En].isIndex||Yt.selection.cells.push([fe(Ln),Gr(le[En])]);else if(qt){const[Ln,En]=qt;le[Ln].isIndex||Yt.selection.cells.push([fe(En),Gr(le[Ln])])}}const $n=JSON.stringify(Yt),jt=r.getStringValue({id:e.id,formId:e.formId});(jt===void 0||jt!==$n)&&r.setStringValue({id:e.id,formId:e.formId},$n,{fromUi:!0},o)},[le,e.id,e.formId,r,o,fe]),{debouncedCallback:Fe}=Ju($e,$c),{gridSelection:tt,isRowSelectionActivated:Me,isMultiRowSelectionActivated:Xe,isColumnSelectionActivated:Te,isMultiColumnSelectionActivated:Ee,isCellSelectionActivated:Pe,isMultiCellSelectionActivated:ht,isRowSelected:nt,isColumnSelected:je,isCellSelected:kt,clearSelection:wt,processSelectionChange:Dt}=LC(e,ie,n,le,Fe);f.useEffect(()=>{Pe||wt(!0,!0)},[u]);const Ot=f.useCallback(ye=>{w.current?.updateCells(ye)},[]);f.useEffect(()=>{if(!Me&&!Te&&!Pe||!r)return;const ye=r.getStringValue({id:e.id,formId:e.formId});if(ye){const Ft=le.map(Xt=>Gr(Xt)),Yt=JSON.parse(ye);let $n=Qe.empty(),jt=Qe.empty(),qt;if(Yt.selection?.rows?.forEach(Xt=>{$n=$n.add(Xt)}),Yt.selection?.columns?.forEach(Xt=>{jt=jt.add(Ft.indexOf(Xt))}),Pe&&!ht){const[Xt,Ln]=Yt.selection?.cells?.[0]??[];Xt!==void 0&&Ln!==void 0&&(qt=[Ft.indexOf(Ln),Xt])}if($n.length>0||jt.length>0||qt!==void 0){const Xt={rows:$n,columns:jt,current:qt?{cell:qt,range:{x:qt[0],y:qt[1],width:1,height:1},rangeStack:[]}:void 0};Dt(Xt)}}},[]);const an=f.useCallback(()=>{oe!==ne.current.getNumRows()&&Se(ne.current.getNumRows())},[oe]),Kt=f.useCallback(()=>{if(!r)return;const ye=ne.current.toJson(le);let Ft=r.getStringValue({id:e.id,formId:e.formId});Ft===void 0&&(Ft=new jo(0).toJson([])),ye!==Ft&&r.setStringValue({id:e.id,formId:e.formId},ye,{fromUi:!0},o)},[le,e.id,e.formId,r,o]),{debouncedCallback:In}=Ju(Kt,$c),{exportToCsv:It}=DC(we,le,oe,R),{onCellEdited:gt,onPaste:Tn,onRowAppended:yt,onDelete:Zt,validateCell:Sn}=MC(le,e.editingMode!==se,ne,we,fe,Ot,an,In,wt),De=f.useMemo(()=>ie?[0]:G?[oe]:[],[ie,G,oe]),{tooltip:ct,clearTooltip:pt,onItemHovered:Dn}=HC(le,we,De),{drawCell:ln,customRenderers:sn}=SC(le),{provideEditor:On}=C1(),Jt=f.useCallback(ye=>({...ye,hasMenu:!ie}),[ie]),Qt=f.useMemo(()=>le.map(ye=>Jt(Vl(ye))),[le,Jt]),{columns:Be,onColumnResize:Mt}=h1(Qt),Pn=t.dimensions.numHeaderRows>1,{minHeight:Lt,maxHeight:mt,minWidth:xn,maxWidth:lr,rowHeight:Vn,resizableSize:B,setResizableSize:We}=FC(e,C,oe,Pn,g||0,h,u,a,s),Ge=f.useCallback(([ye,Ft])=>({...Pb(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:C.glideTheme.textLight},span:[0,Math.max(le.length-1,0)]}),[le,C.glideTheme.textLight]),Pt=f.useCallback(()=>{me(),wt()},[me,wt]);qg({element:e,widgetMgr:r,onFormCleared:Pt});const{pinColumn:en,unpinColumn:dn,freezeColumns:kn}=d1(le,ie,g||0,C.minColumnWidth,wt,Ue),{changeColumnFormat:bn}=c1(Ue),{hideColumn:Bt,showColumn:Mn}=y1(wt,Ue),{onColumnMoved:Rn}=f1(le,kn,en,dn,xe);return f.useEffect(()=>{let ye;const Ft=requestAnimationFrame(()=>{ye=setTimeout(()=>{if(b.current&&w.current){const Yt=b.current?.querySelector(".dvn-stack")?.getBoundingClientRect();Yt&&(M(Yt.height>b.current.clientHeight),O(Yt.width>b.current.clientWidth))}},0)});return()=>{cancelAnimationFrame(Ft),ye&&clearTimeout(ye)}},[B,oe,Be]),f.useEffect(()=>{St.length==le.length&&Y(!1)},[St.length,le.length]),mn(Vc,{className:"stDataFrame","data-testid":"stDataFrame",ref:b,isInHorizontalLayout:p,onPointerDown:ye=>{if(b.current){const Ft=b.current.getBoundingClientRect(),Yt=(v||Math.round(rn(eS)))+1;T&&Ft.height-Yt<ye.clientY-Ft.top&&ye.stopPropagation(),D&&Ft.width-Yt<ye.clientX-Ft.left&&ye.stopPropagation()}},onBlur:ye=>{!P&&!te&&!ye.currentTarget.contains(ye.relatedTarget)&&!Pe&&wt(!0,!0)},children:[mn(Ug,{isFullScreen:u,disableFullscreenMode:i,locked:nt&&!Me||kt||te&&P||X,onExpand:c,onCollapse:d,target:Vc,children:[l?.map(ye=>ye),(Me&&nt||Te&&je||Pe&&kt)&&ze(wi,{label:"Clear selection",icon:Zg,onClick:()=>{wt(),pt()}}),G&&nt&&ze(wi,{label:"Delete row(s)",icon:np,onClick:()=>{Zt&&(Zt(tt),pt())}}),G&&!nt&&ze(wi,{label:"Add row",icon:ed,onClick:()=>{yt&&(x(!0),yt(),pt(),w.current?.scrollTo(0,oe,"vertical"))}}),!ie&&St.length>le.length&&ze(KC,{columns:St,columnOrder:et,setColumnOrder:xe,hideColumn:Bt,showColumn:Mn,isOpen:X,onClose:ee,children:ze(wi,{label:"Show/hide columns",icon:nd,onClick:ue})}),!H&&!ie&&ze(wi,{label:"Download as CSV",icon:rp,onClick:It}),!ie&&ze(wi,{label:"Search",icon:td,onClick:()=>{S?F(!1):(x(!0),F(!0)),pt()}})]}),ze(Ng,{"data-testid":"stDataFrameResizable",ref:m,defaultSize:B,style:{border:`${C.tableBorderWidth}px solid ${C.glideTheme.borderColor}`,borderRadius:`${C.tableBorderRadius}`},minHeight:Lt,maxHeight:mt,minWidth:xn,maxWidth:p?void 0:lr,size:B,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!p,bottomLeft:!1,topLeft:!1},grid:[1,Vn],snapGap:Vn/3,onResizeStop:(ye,Ft,Yt,$n)=>{if(m.current){const jt=2*C.tableBorderWidth;We({width:m.current.size.width,height:mt-m.current.size.height===jt?m.current.size.height+jt:m.current.size.height})}},children:ze(kb,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:w,columns:Be,rows:ie?1:oe,minColumnWidth:C.minColumnWidth,maxColumnWidth:C.maxColumnWidth,maxColumnAutoWidth:C.maxColumnAutoWidth,rowHeight:Vn,headerHeight:C.defaultHeaderHeight,getCellContent:ie?Ge:we,onColumnResize:te?void 0:Mt,resizeIndicator:"header",freezeColumns:kn,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:te?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Te?void 0:Rn,onItemHovered:ye=>{E?.(ye),Dn?.(ye)},keybindings:{downFill:!0,...Pe||H?{selectAll:!1}:{}},onKeyDown:ye=>{(ye.ctrlKey||ye.metaKey)&&ye.key==="f"&&(F(Ft=>!Ft),ye.stopPropagation(),ye.preventDefault())},showSearch:S,searchResults:S?void 0:[],onSearchClose:()=>{F(!1),pt()},onHeaderClicked:(ye,Ft)=>{!L||Te||(S&&F(!1),Me&&nt?wt():wt(!0,!0),be(ye,"auto"))},gridSelection:tt,onGridSelectionChange:ye=>{(P||te)&&(Dt(ye),ct!==void 0&&pt(),N(void 0),Y(!1))},theme:C.glideTheme,getRowThemeOverride:I,onMouseMove:ye=>{ye.kind==="out-of-bounds"&&P?x(!1):ye.kind!=="out-of-bounds"&&!P&&x(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,paddingBottom:T?-v:void 0,paddingRight:D?-v:void 0},provideEditor:On,drawCell:ln,customRenderers:sn,imageEditorOverride:Gb,headerIcons:C.headerIcons,validateCell:Sn,onHeaderMenuClick:(ye,Ft)=>{X||N({columnIdx:ye,headerBounds:Ft})},onPaste:!1,...Me&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:C.glideTheme.bgHeader,bgCellMedium:C.glideTheme.bgHeader,textMedium:C.glideTheme.textLight}},rowSelectionMode:Xe?"multi":"auto",rowSelect:n?"none":Xe?"multi":"single",rowSelectionBlending:"additive",rangeSelectionBlending:"additive"},...Te&&{columnSelect:n?"none":Ee?"multi":"single",columnSelectionBlending:"additive",columnSelectionMode:Ee?"multi":"auto",rangeSelectionBlending:"additive"},...Pe&&{rangeSelect:ht?"rect":"cell",rangeSelectionBlending:"additive"},...!ie&&e.editingMode!==ce&&!n&&{fillHandle:!te,onCellEdited:gt,onPaste:Tn,onDelete:Zt},...!ie&&e.editingMode===se&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:C.glideTheme.bgHeader,bgCellMedium:C.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:yt,onHeaderClicked:void 0}})}),ct?.content&&ze(JC,{top:ct.top,left:ct.left,content:ct.content,clearTooltip:pt}),k&&jc.createPortal(ze(GC,{top:k.headerBounds.y+k.headerBounds.height,left:k.headerBounds.x+k.headerBounds.width,column:bt[k.columnIdx],onCloseMenu:()=>N(void 0),onSortColumn:L?ye=>{S&&F(!1),wt(!(Me&&nt),!0),be(k.columnIdx,ye,!0)}:void 0,isColumnPinned:bt[k.columnIdx].isPinned,onUnpinColumn:()=>{dn(bt[k.columnIdx].id)},onPinColumn:()=>{en(bt[k.columnIdx].id)},onHideColumn:()=>{Bt(bt[k.columnIdx].id)},onChangeFormat:ye=>{bn(bt[k.columnIdx].id,ye),setTimeout(()=>{w.current?.remeasureColumns(Qe.fromSingleSelection(k.columnIdx))},100)},onAutosize:()=>{w.current?.remeasureColumns(Qe.fromSingleSelection(k.columnIdx))}}),document.querySelector("#portal"))]})}const nS=Bg(tS),nh=f.memo(nS),rS=({data:e,height:t,customToolbarActions:n})=>ze(nh,{element:new on({useContainerWidth:!0,editingMode:on.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:n,widthConfig:new qs.WidthConfig({useStretch:!0}),heightConfig:t?new qs.HeightConfig({pixelHeight:t}):void 0}),pS=Object.freeze(Object.defineProperty({__proto__:null,ReadOnlyGrid:rS,default:nh},Symbol.toStringTag,{value:"Module"}));export{iv as C,rS as R,Fd as T,Mi as a,up as b,pS as c,Si as i,Rm as m,cn as s};