streamlit-nightly 1.52.3.dev20260112__py3-none-any.whl → 1.53.1.dev20260114__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 (225) hide show
  1. streamlit/__init__.py +1 -1
  2. streamlit/auth_util.py +1 -1
  3. streamlit/cli_util.py +1 -1
  4. streamlit/commands/logo.py +2 -0
  5. streamlit/commands/page_config.py +16 -16
  6. streamlit/components/v2/__init__.py +2 -2
  7. streamlit/components/v2/bidi_component/main.py +2 -2
  8. streamlit/connections/base_connection.py +16 -4
  9. streamlit/connections/snowflake_connection.py +255 -206
  10. streamlit/dataframe_util.py +1 -3
  11. streamlit/elements/arrow.py +5 -1
  12. streamlit/elements/form.py +2 -2
  13. streamlit/elements/lib/color_util.py +1 -1
  14. streamlit/elements/lib/image_utils.py +1 -1
  15. streamlit/elements/metric.py +49 -48
  16. streamlit/elements/vega_charts.py +4 -1
  17. streamlit/elements/widgets/button.py +9 -9
  18. streamlit/elements/widgets/chat.py +5 -9
  19. streamlit/elements/widgets/data_editor.py +3 -3
  20. streamlit/elements/widgets/file_uploader.py +10 -11
  21. streamlit/elements/widgets/multiselect.py +1 -1
  22. streamlit/elements/widgets/select_slider.py +4 -0
  23. streamlit/elements/widgets/time_widgets.py +1 -1
  24. streamlit/elements/write.py +1 -2
  25. streamlit/errors.py +2 -0
  26. streamlit/external/langchain/streamlit_callback_handler.py +1 -1
  27. streamlit/proto/Alert_pb2.pyi +31 -31
  28. streamlit/proto/AppPage_pb2.pyi +30 -30
  29. streamlit/proto/ArrowData_pb2.pyi +15 -15
  30. streamlit/proto/ArrowNamedDataSet_pb2.pyi +25 -25
  31. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +45 -45
  32. streamlit/proto/Arrow_pb2.pyi +126 -97
  33. streamlit/proto/AudioInput_pb2.pyi +39 -39
  34. streamlit/proto/Audio_pb2.pyi +39 -39
  35. streamlit/proto/AuthRedirect_pb2.pyi +15 -15
  36. streamlit/proto/AutoRerun_pb2.pyi +18 -18
  37. streamlit/proto/BackMsg_pb2.pyi +64 -64
  38. streamlit/proto/Balloons_pb2.pyi +15 -15
  39. streamlit/proto/BidiComponent_pb2.pyi +100 -100
  40. streamlit/proto/Block_pb2.pyi +295 -264
  41. streamlit/proto/BokehChart_pb2.pyi +21 -21
  42. streamlit/proto/ButtonGroup_pb2.pyi +96 -96
  43. streamlit/proto/ButtonLikeIconPosition_pb2.pyi +12 -12
  44. streamlit/proto/Button_pb2.pyi +63 -50
  45. streamlit/proto/CameraInput_pb2.pyi +34 -34
  46. streamlit/proto/ChatInput_pb2.pyi +63 -63
  47. streamlit/proto/Checkbox_pb2.pyi +49 -49
  48. streamlit/proto/ClientState_pb2.pyi +85 -85
  49. streamlit/proto/Code_pb2.pyi +41 -28
  50. streamlit/proto/ColorPicker_pb2.pyi +43 -43
  51. streamlit/proto/Common_pb2.pyi +175 -175
  52. streamlit/proto/Components_pb2.pyi +110 -110
  53. streamlit/proto/DataFrame_pb2.pyi +209 -209
  54. streamlit/proto/DateInput_pb2.pyi +59 -59
  55. streamlit/proto/DateTimeInput_pb2.pyi +62 -62
  56. streamlit/proto/DeckGlJsonChart_pb2.pyi +91 -56
  57. streamlit/proto/Delta_pb2.pyi +44 -44
  58. streamlit/proto/DocString_pb2.pyi +51 -51
  59. streamlit/proto/DownloadButton_pb2.pyi +59 -59
  60. streamlit/proto/Element_pb2.pyi +319 -319
  61. streamlit/proto/Empty_pb2.pyi +10 -10
  62. streamlit/proto/Exception_pb2.pyi +37 -37
  63. streamlit/proto/Favicon_pb2.pyi +15 -15
  64. streamlit/proto/FileUploader_pb2.pyi +49 -49
  65. streamlit/proto/ForwardMsg_pb2.pyi +176 -170
  66. streamlit/proto/GapSize_pb2.pyi +23 -23
  67. streamlit/proto/GitInfo_pb2.pyi +37 -37
  68. streamlit/proto/GraphVizChart_pb2.pyi +38 -25
  69. streamlit/proto/Heading_pb2.pyi +30 -30
  70. streamlit/proto/HeightConfig_pb2.pyi +31 -31
  71. streamlit/proto/Html_pb2.pyi +18 -18
  72. streamlit/proto/IFrame_pb2.pyi +76 -47
  73. streamlit/proto/Image_pb2.pyi +49 -36
  74. streamlit/proto/Json_pb2.pyi +25 -25
  75. streamlit/proto/LabelVisibilityMessage_pb2.pyi +18 -18
  76. streamlit/proto/LinkButton_pb2.pyi +43 -43
  77. streamlit/proto/Logo_pb2.pyi +24 -24
  78. streamlit/proto/Markdown_pb2.pyi +30 -30
  79. streamlit/proto/Metric_pb2.pyi +59 -59
  80. streamlit/proto/MetricsEvent_pb2.pyi +171 -171
  81. streamlit/proto/MultiSelect_pb2.pyi +72 -66
  82. streamlit/proto/NamedDataSet_pb2.pyi +25 -25
  83. streamlit/proto/Navigation_pb2.pyi +35 -35
  84. streamlit/proto/NewSession_pb2.pyi +511 -498
  85. streamlit/proto/NumberInput_pb2.pyi +79 -79
  86. streamlit/proto/PageConfig_pb2.pyi +71 -71
  87. streamlit/proto/PageInfo_pb2.pyi +15 -15
  88. streamlit/proto/PageLink_pb2.pyi +47 -47
  89. streamlit/proto/PageNotFound_pb2.pyi +15 -15
  90. streamlit/proto/PageProfile_pb2.pyi +85 -85
  91. streamlit/proto/PagesChanged_pb2.pyi +19 -19
  92. streamlit/proto/ParentMessage_pb2.pyi +15 -15
  93. streamlit/proto/PlotlyChart_pb2.pyi +79 -64
  94. streamlit/proto/Progress_pb2.pyi +18 -18
  95. streamlit/proto/Radio_pb2.pyi +62 -62
  96. streamlit/proto/RootContainer_pb2.pyi +12 -12
  97. streamlit/proto/Selectbox_pb2.pyi +80 -70
  98. streamlit/proto/SessionEvent_pb2.pyi +27 -27
  99. streamlit/proto/SessionStatus_pb2.pyi +18 -18
  100. streamlit/proto/Skeleton_pb2.pyi +25 -25
  101. streamlit/proto/Slider_pb2.pyi +74 -74
  102. streamlit/proto/Snow_pb2.pyi +15 -15
  103. streamlit/proto/Space_pb2.pyi +10 -10
  104. streamlit/proto/Spinner_pb2.pyi +21 -21
  105. streamlit/proto/TextAlignmentConfig_pb2.pyi +18 -18
  106. streamlit/proto/TextArea_pb2.pyi +72 -59
  107. streamlit/proto/TextInput_pb2.pyi +67 -67
  108. streamlit/proto/Text_pb2.pyi +18 -18
  109. streamlit/proto/TimeInput_pb2.pyi +52 -52
  110. streamlit/proto/Toast_pb2.pyi +25 -25
  111. streamlit/proto/Transient_pb2.pyi +19 -19
  112. streamlit/proto/VegaLiteChart_pb2.pyi +32 -32
  113. streamlit/proto/Video_pb2.pyi +65 -65
  114. streamlit/proto/WidgetStates_pb2.pyi +91 -85
  115. streamlit/proto/WidthConfig_pb2.pyi +31 -31
  116. streamlit/proto/openmetrics_data_model_pb2.pyi +269 -269
  117. streamlit/runtime/app_session.py +1 -1
  118. streamlit/runtime/caching/cache_data_api.py +25 -21
  119. streamlit/runtime/caching/cache_resource_api.py +69 -41
  120. streamlit/runtime/connection_factory.py +67 -41
  121. streamlit/runtime/credentials.py +2 -2
  122. streamlit/runtime/metrics_util.py +3 -3
  123. streamlit/runtime/secrets.py +1 -1
  124. streamlit/runtime/stats.py +1 -3
  125. streamlit/static/index.html +1 -1
  126. streamlit/static/manifest.json +304 -304
  127. streamlit/static/static/js/{ErrorOutline.esm.BjVqd_6R.js → ErrorOutline.esm.BAZUU4id.js} +1 -1
  128. streamlit/static/static/js/{FileDownload.esm.DJCSsghl.js → FileDownload.esm.C6tTTniR.js} +1 -1
  129. streamlit/static/static/js/{FileHelper.C---TH7o.js → FileHelper.BOHlwlc9.js} +1 -1
  130. streamlit/static/static/js/{FormClearHelper.C-6BC487.js → FormClearHelper.D4lty7rT.js} +1 -1
  131. streamlit/static/static/js/{InputInstructions.sxc3InCI.js → InputInstructions.BWw9lhud.js} +1 -1
  132. streamlit/static/static/js/{Particles.S8yD7iW-.js → Particles.BDi7fIn-.js} +1 -1
  133. streamlit/static/static/js/{ProgressBar.BiYsyZCC.js → ProgressBar.DCHh4N3P.js} +1 -1
  134. streamlit/static/static/js/{StreamlitSyntaxHighlighter.9jZF8jX1.js → StreamlitSyntaxHighlighter.BRydQwEj.js} +1 -1
  135. streamlit/static/static/js/{TableChart.esm.BdA4Q1rZ.js → TableChart.esm.7KFX5I_G.js} +1 -1
  136. streamlit/static/static/js/{Toolbar.B9DaaDfN.js → Toolbar.guIuiwEF.js} +1 -1
  137. streamlit/static/static/js/{WidgetLabelHelpIconInline.DxODTLS2.js → WidgetLabelHelpIconInline.CzodezAH.js} +1 -1
  138. streamlit/static/static/js/{base-input.Gf1cKuQR.js → base-input.Cg7NpsfS.js} +1 -1
  139. streamlit/static/static/js/{checkbox.CnoNruf3.js → checkbox.Bs20OTna.js} +1 -1
  140. streamlit/static/static/js/{createDownloadLinkElement.B48AepiL.js → createDownloadLinkElement.DSqCyu38.js} +1 -1
  141. streamlit/static/static/js/{data-grid-overlay-editor.Cmdq9aqU.js → data-grid-overlay-editor.Ch4SqNfY.js} +1 -1
  142. streamlit/static/static/js/{downloader.CQLoQdMX.js → downloader.Oj5CTGJA.js} +1 -1
  143. streamlit/static/static/js/{embed.oKwocwU8.js → embed.CqzzUq73.js} +1 -1
  144. streamlit/static/static/js/{es6.BRxlY_y5.js → es6.CYrlw0Vn.js} +2 -2
  145. streamlit/static/static/js/{formatNumber.DaagZyZe.js → formatNumber.CT_v8e75.js} +1 -1
  146. streamlit/static/static/js/{iconPosition.Q3hNvmK4.js → iconPosition.DPAvXTmd.js} +1 -1
  147. streamlit/static/static/js/{iframeResizer.contentWindow.B6EBvI9L.js → iframeResizer.contentWindow.T4DvQsIf.js} +1 -1
  148. streamlit/static/static/js/{index.BoX8d5rK.js → index.AGYZDQZm.js} +1 -1
  149. streamlit/static/static/js/{index.KtjGDGY5.js → index.B3HdcUdo.js} +1 -1
  150. streamlit/static/static/js/{index.B9kZB0o1.js → index.B8ZZdPqF.js} +1 -1
  151. streamlit/static/static/js/{index.CFCBhOfx.js → index.B9Oowxt8.js} +1 -1
  152. streamlit/static/static/js/{index.CCQ5p_WC.js → index.BEzgNZOm.js} +1 -1
  153. streamlit/static/static/js/{index.D1pK_Vw2.js → index.BJnWg9Jq.js} +1 -1
  154. streamlit/static/static/js/{index.na9UBuse.js → index.BPxuKK0S.js} +1 -1
  155. streamlit/static/static/js/{index.QTaWooav.js → index.BTA0d5oq.js} +1 -1
  156. streamlit/static/static/js/{index.pU9mQeVC.js → index.BTqav7_K.js} +1 -1
  157. streamlit/static/static/js/{index.BXEC4cf3.js → index.BZ8xp-w9.js} +1 -1
  158. streamlit/static/static/js/{index.BF23fbfs.js → index.BoWBzl6h.js} +1 -1
  159. streamlit/static/static/js/index.Bqgt60FU.js +1 -0
  160. streamlit/static/static/js/{index.Dh5SAThV.js → index.BsYYrijt.js} +1 -1
  161. streamlit/static/static/js/{index.19_qtO6t.js → index.CGRIbGGV.js} +1 -1
  162. streamlit/static/static/js/{index.CSfsEKCF.js → index.CJQq5LcR.js} +1 -1
  163. streamlit/static/static/js/{index.Fu73QtkD.js → index.CPYB1awG.js} +1 -1
  164. streamlit/static/static/js/{index.BzwlrgZO.js → index.CVKk1nkB.js} +1 -1
  165. streamlit/static/static/js/{index.B03eQZoH.js → index.CVXiBeDI.js} +1 -1
  166. streamlit/static/static/js/{index.BRfGUOQ-.js → index.CXVpBAvU.js} +4 -4
  167. streamlit/static/static/js/{index.slgxPafU.js → index.Cfe-tCQJ.js} +1 -1
  168. streamlit/static/static/js/{index.D6X2coHR.js → index.ClFk8x0U.js} +1 -1
  169. streamlit/static/static/js/{index.WXybx2Xq.js → index.CnXxoVEM.js} +1 -1
  170. streamlit/static/static/js/{index.j4fnjyHo.js → index.Cw4eSvJ7.js} +1 -1
  171. streamlit/static/static/js/{index.KN1VmyYN.js → index.D6HCANv6.js} +1 -1
  172. streamlit/static/static/js/{index.CP-hoxJM.js → index.D7KbBAWb.js} +1 -1
  173. streamlit/static/static/js/{index.CCFwVy90.js → index.D84XHt50.js} +1 -1
  174. streamlit/static/static/js/{index.BkSwGJoh.js → index.DL_Ooizi.js} +1 -1
  175. streamlit/static/static/js/{index.QHnxuesF.js → index.DNyw7S7Z.js} +1 -1
  176. streamlit/static/static/js/{index.BAI9aHCq.js → index.DPlPEuq6.js} +1 -1
  177. streamlit/static/static/js/{index.CJ4oJe0V.js → index.DQzRwgrT.js} +1 -1
  178. streamlit/static/static/js/{index.CVlg41MB.js → index.DXRGd--0.js} +1 -1
  179. streamlit/static/static/js/{index.CIbgt5wY.js → index.DZDt5hYD.js} +1 -1
  180. streamlit/static/static/js/{index.BVT89mQw.js → index.DesNeXSA.js} +1 -1
  181. streamlit/static/static/js/{index.Boa0Egng.js → index.Dg9k4R8B.js} +1 -1
  182. streamlit/static/static/js/{index.43b777iP.js → index.Do9A7QCt.js} +1 -1
  183. streamlit/static/static/js/{index.DJ7P09eb.js → index.DrSH3pK3.js} +1 -1
  184. streamlit/static/static/js/{index.OpATzEaW.js → index.Dtd5z2rM.js} +1 -1
  185. streamlit/static/static/js/{index.BnfTPrHb.js → index.DzldU3Hy.js} +1 -1
  186. streamlit/static/static/js/{index.C0fSEz-3.js → index.GZi6GTJa.js} +1 -1
  187. streamlit/static/static/js/{index.CYE7b5Du.js → index.LOA31DFn.js} +1 -1
  188. streamlit/static/static/js/{index.Ca7MUNWJ.js → index.MtwRNvlS.js} +1 -1
  189. streamlit/static/static/js/{index.BbSFVZ3p.js → index.XHtvnZ0-.js} +1 -1
  190. streamlit/static/static/js/{index.CvIqsWy1.js → index.Yj6vcyFD.js} +1 -1
  191. streamlit/static/static/js/{index.BGBTkulf.js → index.b-MrPulo.js} +1 -1
  192. streamlit/static/static/js/{index.DGYHxruh.js → index.hcUYvTqs.js} +1 -1
  193. streamlit/static/static/js/{index.CvB9JBqS.js → index.tLZuZM89.js} +6 -6
  194. streamlit/static/static/js/{index.Xg-Qttib.js → index.wngeYhKj.js} +1 -1
  195. streamlit/static/static/js/{index.whRT3Vm3.js → index.xCV2qwtw.js} +1 -1
  196. streamlit/static/static/js/{input.CPzINTl-.js → input.CYXuTqoa.js} +1 -1
  197. streamlit/static/static/js/{main.DSPn8dUe.js → main.BE-siVKv.js} +1 -1
  198. streamlit/static/static/js/{memory.CfD8IGoU.js → memory.V554ztRg.js} +1 -1
  199. streamlit/static/static/js/{number-overlay-editor.4Ae0qegV.js → number-overlay-editor.BiUTOXIl.js} +1 -1
  200. streamlit/static/static/js/{pandasStylerUtils.D2EjZ7k6.js → pandasStylerUtils.Dej3Tstq.js} +1 -1
  201. streamlit/static/static/js/{sandbox.C6vcPIm0.js → sandbox.gpd7KGMo.js} +1 -1
  202. streamlit/static/static/js/{styled-components.BBmp8buj.js → styled-components.Coj4dr6D.js} +1 -1
  203. streamlit/static/static/js/{throttle.BPcPpy-S.js → throttle.gZUdtYp7.js} +1 -1
  204. streamlit/static/static/js/{timepicker.ryzkTs2C.js → timepicker.B-Y4aU15.js} +1 -1
  205. streamlit/static/static/js/{toConsumableArray.Dg1nDaB_.js → toConsumableArray.CcKcKvEd.js} +1 -1
  206. streamlit/static/static/js/uniqueId.PRn3V1WU.js +1 -0
  207. streamlit/static/static/js/{useBasicWidgetState.A4U5lzAm.js → useBasicWidgetState.D-fc_aIL.js} +1 -1
  208. streamlit/static/static/js/{useIntlLocale.DWJgLlNz.js → useIntlLocale.CY32IeNt.js} +1 -1
  209. streamlit/static/static/js/{useTextInputAutoExpand.BrBonw8t.js → useTextInputAutoExpand.C0jK7TwF.js} +1 -1
  210. streamlit/static/static/js/{useUpdateUiValue.BkOWyNVX.js → useUpdateUiValue.CDQloDgB.js} +1 -1
  211. streamlit/static/static/js/{useWaveformController.CBlvXlgZ.js → useWaveformController.BLEIAIDo.js} +1 -1
  212. streamlit/static/static/js/{withCalculatedWidth.D4cpOyNe.js → withCalculatedWidth.B3oSlRC0.js} +1 -1
  213. streamlit/static/static/js/{withFullScreenWrapper.BMim3w94.js → withFullScreenWrapper.Cw_ebNmr.js} +1 -1
  214. streamlit/testing/v1/app_test.py +1 -1
  215. streamlit/user_info.py +225 -166
  216. streamlit/web/server/starlette/starlette_routes.py +1 -3
  217. streamlit/web/server/stats_request_handler.py +1 -3
  218. {streamlit_nightly-1.52.3.dev20260112.dist-info → streamlit_nightly-1.53.1.dev20260114.dist-info}/METADATA +1 -1
  219. {streamlit_nightly-1.52.3.dev20260112.dist-info → streamlit_nightly-1.53.1.dev20260114.dist-info}/RECORD +223 -223
  220. streamlit/static/static/js/index.CrPjcPY1.js +0 -1
  221. streamlit/static/static/js/uniqueId.BFHzT5KQ.js +0 -1
  222. {streamlit_nightly-1.52.3.dev20260112.data → streamlit_nightly-1.53.1.dev20260114.data}/scripts/streamlit.cmd +0 -0
  223. {streamlit_nightly-1.52.3.dev20260112.dist-info → streamlit_nightly-1.53.1.dev20260114.dist-info}/WHEEL +0 -0
  224. {streamlit_nightly-1.52.3.dev20260112.dist-info → streamlit_nightly-1.53.1.dev20260114.dist-info}/entry_points.txt +0 -0
  225. {streamlit_nightly-1.52.3.dev20260112.dist-info → streamlit_nightly-1.53.1.dev20260114.dist-info}/top_level.txt +0 -0
@@ -1,2 +1,2 @@
1
- import{F as Kt,r as P,j as ne}from"./index.BRfGUOQ-.js";const{entries:St,setPrototypeOf:pt,isFrozen:Zt,getPrototypeOf:Jt,getOwnPropertyDescriptor:Qt}=Object;let{freeze:R,seal:b,create:Fe}=Object,{apply:ze,construct:Ge}=typeof Reflect<"u"&&Reflect;R||(R=function(n){return n});b||(b=function(n){return n});ze||(ze=function(n,s){for(var a=arguments.length,c=new Array(a>2?a-2:0),m=2;m<a;m++)c[m-2]=arguments[m];return n.apply(s,c)});Ge||(Ge=function(n){for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return new n(...a)});const pe=O(Array.prototype.forEach),en=O(Array.prototype.lastIndexOf),Tt=O(Array.prototype.pop),Z=O(Array.prototype.push),tn=O(Array.prototype.splice),de=O(String.prototype.toLowerCase),xe=O(String.prototype.toString),Pe=O(String.prototype.match),J=O(String.prototype.replace),nn=O(String.prototype.indexOf),on=O(String.prototype.trim),y=O(Object.prototype.hasOwnProperty),S=O(RegExp.prototype.test),Q=rn(TypeError);function O(o){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return ze(o,n,a)}}function rn(o){return function(){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return Ge(o,s)}}function l(o,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:de;pt&&pt(o,null);let a=n.length;for(;a--;){let c=n[a];if(typeof c=="string"){const m=s(c);m!==c&&(Zt(n)||(n[a]=m),c=m)}o[c]=!0}return o}function an(o){for(let n=0;n<o.length;n++)y(o,n)||(o[n]=null);return o}function C(o){const n=Fe(null);for(const[s,a]of St(o))y(o,s)&&(Array.isArray(a)?n[s]=an(a):a&&typeof a=="object"&&a.constructor===Object?n[s]=C(a):n[s]=a);return n}function ee(o,n){for(;o!==null;){const a=Qt(o,n);if(a){if(a.get)return O(a.get);if(typeof a.value=="function")return O(a.value)}o=Jt(o)}function s(){return null}return s}const dt=R(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ke=R(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ve=R(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sn=R(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ue=R(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ln=R(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Et=R(["#text"]),_t=R(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),He=R(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),At=R(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Te=R(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),cn=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fn=b(/<%[\w\W]*|[\w\W]*%>/gm),un=b(/\$\{[\w\W]*/gm),mn=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),pn=b(/^aria-[\-\w]+$/),Rt=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Tn=b(/^(?:\w+script|data):/i),dn=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ot=b(/^html$/i),En=b(/^[a-z][.\w]*(-[.\w]+)+$/i);var gt=Object.freeze({__proto__:null,ARIA_ATTR:pn,ATTR_WHITESPACE:dn,CUSTOM_ELEMENT:En,DATA_ATTR:mn,DOCTYPE_NAME:Ot,ERB_EXPR:fn,IS_ALLOWED_URI:Rt,IS_SCRIPT_OR_DATA:Tn,MUSTACHE_EXPR:cn,TMPLIT_EXPR:un});const te={element:1,text:3,progressingInstruction:7,comment:8,document:9},_n=function(){return typeof window>"u"?null:window},An=function(n,s){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const c="data-tt-policy-suffix";s&&s.hasAttribute(c)&&(a=s.getAttribute(c));const m="dompurify"+(a?"#"+a:"");try{return n.createPolicy(m,{createHTML(D){return D},createScriptURL(D){return D}})}catch{return console.warn("TrustedTypes policy "+m+" could not be created."),null}},ht=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Lt(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_n();const n=r=>Lt(r);if(n.version="3.3.1",n.removed=[],!o||!o.document||o.document.nodeType!==te.document||!o.Element)return n.isSupported=!1,n;let{document:s}=o;const a=s,c=a.currentScript,{DocumentFragment:m,HTMLTemplateElement:D,Node:Y,Element:oe,NodeFilter:X,NamedNodeMap:Dt=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:Nt,DOMParser:It,trustedTypes:ie}=o,j=oe.prototype,Ct=ee(j,"cloneNode"),Mt=ee(j,"remove"),wt=ee(j,"nextSibling"),xt=ee(j,"childNodes"),re=ee(j,"parentNode");if(typeof D=="function"){const r=s.createElement("template");r.content&&r.content.ownerDocument&&(s=r.content.ownerDocument)}let g,V="";const{implementation:_e,createNodeIterator:Pt,createDocumentFragment:kt,getElementsByTagName:vt}=s,{importNode:Ut}=a;let h=ht();n.isSupported=typeof St=="function"&&typeof re=="function"&&_e&&_e.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ae,ERB_EXPR:ge,TMPLIT_EXPR:he,DATA_ATTR:Ht,ARIA_ATTR:Ft,IS_SCRIPT_OR_DATA:zt,ATTR_WHITESPACE:Be,CUSTOM_ELEMENT:Gt}=gt;let{IS_ALLOWED_URI:Ye}=gt,d=null;const Xe=l({},[...dt,...ke,...ve,...Ue,...Et]);let E=null;const je=l({},[..._t,...He,...At,...Te]);let u=Object.seal(Fe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,Se=null;const U=Object.seal(Fe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ve=!0,Re=!0,$e=!1,qe=!0,H=!1,ae=!0,k=!1,Oe=!1,Le=!1,F=!1,se=!1,le=!1,Ke=!0,Ze=!1;const Wt="user-content-";let be=!0,q=!1,z={},N=null;const ye=l({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Je=null;const Qe=l({},["audio","video","img","source","image","track"]);let De=null;const et=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ce="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xhtml";let G=M,Ne=!1,Ie=null;const Bt=l({},[ce,fe,M],xe);let ue=l({},["mi","mo","mn","ms","mtext"]),me=l({},["annotation-xml"]);const Yt=l({},["title","style","font","a","script"]);let K=null;const Xt=["application/xhtml+xml","text/html"],jt="text/html";let T=null,W=null;const Vt=s.createElement("form"),tt=function(e){return e instanceof RegExp||e instanceof Function},Ce=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(W&&W===e)){if((!e||typeof e!="object")&&(e={}),e=C(e),K=Xt.indexOf(e.PARSER_MEDIA_TYPE)===-1?jt:e.PARSER_MEDIA_TYPE,T=K==="application/xhtml+xml"?xe:de,d=y(e,"ALLOWED_TAGS")?l({},e.ALLOWED_TAGS,T):Xe,E=y(e,"ALLOWED_ATTR")?l({},e.ALLOWED_ATTR,T):je,Ie=y(e,"ALLOWED_NAMESPACES")?l({},e.ALLOWED_NAMESPACES,xe):Bt,De=y(e,"ADD_URI_SAFE_ATTR")?l(C(et),e.ADD_URI_SAFE_ATTR,T):et,Je=y(e,"ADD_DATA_URI_TAGS")?l(C(Qe),e.ADD_DATA_URI_TAGS,T):Qe,N=y(e,"FORBID_CONTENTS")?l({},e.FORBID_CONTENTS,T):ye,$=y(e,"FORBID_TAGS")?l({},e.FORBID_TAGS,T):C({}),Se=y(e,"FORBID_ATTR")?l({},e.FORBID_ATTR,T):C({}),z=y(e,"USE_PROFILES")?e.USE_PROFILES:!1,Ve=e.ALLOW_ARIA_ATTR!==!1,Re=e.ALLOW_DATA_ATTR!==!1,$e=e.ALLOW_UNKNOWN_PROTOCOLS||!1,qe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=e.SAFE_FOR_TEMPLATES||!1,ae=e.SAFE_FOR_XML!==!1,k=e.WHOLE_DOCUMENT||!1,F=e.RETURN_DOM||!1,se=e.RETURN_DOM_FRAGMENT||!1,le=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,Ke=e.SANITIZE_DOM!==!1,Ze=e.SANITIZE_NAMED_PROPS||!1,be=e.KEEP_CONTENT!==!1,q=e.IN_PLACE||!1,Ye=e.ALLOWED_URI_REGEXP||Rt,G=e.NAMESPACE||M,ue=e.MATHML_TEXT_INTEGRATION_POINTS||ue,me=e.HTML_INTEGRATION_POINTS||me,u=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),H&&(Re=!1),se&&(F=!0),z&&(d=l({},Et),E=[],z.html===!0&&(l(d,dt),l(E,_t)),z.svg===!0&&(l(d,ke),l(E,He),l(E,Te)),z.svgFilters===!0&&(l(d,ve),l(E,He),l(E,Te)),z.mathMl===!0&&(l(d,Ue),l(E,At),l(E,Te))),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?U.tagCheck=e.ADD_TAGS:(d===Xe&&(d=C(d)),l(d,e.ADD_TAGS,T))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?U.attributeCheck=e.ADD_ATTR:(E===je&&(E=C(E)),l(E,e.ADD_ATTR,T))),e.ADD_URI_SAFE_ATTR&&l(De,e.ADD_URI_SAFE_ATTR,T),e.FORBID_CONTENTS&&(N===ye&&(N=C(N)),l(N,e.FORBID_CONTENTS,T)),e.ADD_FORBID_CONTENTS&&(N===ye&&(N=C(N)),l(N,e.ADD_FORBID_CONTENTS,T)),be&&(d["#text"]=!0),k&&l(d,["html","head","body"]),d.table&&(l(d,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=e.TRUSTED_TYPES_POLICY,V=g.createHTML("")}else g===void 0&&(g=An(ie,c)),g!==null&&typeof V=="string"&&(V=g.createHTML(""));R&&R(e),W=e}},nt=l({},[...ke,...ve,...sn]),ot=l({},[...Ue,...ln]),$t=function(e){let t=re(e);(!t||!t.tagName)&&(t={namespaceURI:G,tagName:"template"});const i=de(e.tagName),f=de(t.tagName);return Ie[e.namespaceURI]?e.namespaceURI===fe?t.namespaceURI===M?i==="svg":t.namespaceURI===ce?i==="svg"&&(f==="annotation-xml"||ue[f]):!!nt[i]:e.namespaceURI===ce?t.namespaceURI===M?i==="math":t.namespaceURI===fe?i==="math"&&me[f]:!!ot[i]:e.namespaceURI===M?t.namespaceURI===fe&&!me[f]||t.namespaceURI===ce&&!ue[f]?!1:!ot[i]&&(Yt[i]||!nt[i]):!!(K==="application/xhtml+xml"&&Ie[e.namespaceURI]):!1},I=function(e){Z(n.removed,{element:e});try{re(e).removeChild(e)}catch{Mt(e)}},v=function(e,t){try{Z(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{Z(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(F||se)try{I(t)}catch{}else try{t.setAttribute(e,"")}catch{}},it=function(e){let t=null,i=null;if(Le)e="<remove></remove>"+e;else{const p=Pe(e,/^[\r\n\t ]+/);i=p&&p[0]}K==="application/xhtml+xml"&&G===M&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const f=g?g.createHTML(e):e;if(G===M)try{t=new It().parseFromString(f,K)}catch{}if(!t||!t.documentElement){t=_e.createDocument(G,"template",null);try{t.documentElement.innerHTML=Ne?V:f}catch{}}const A=t.body||t.documentElement;return e&&i&&A.insertBefore(s.createTextNode(i),A.childNodes[0]||null),G===M?vt.call(t,k?"html":"body")[0]:k?t.documentElement:A},rt=function(e){return Pt.call(e.ownerDocument||e,e,X.SHOW_ELEMENT|X.SHOW_COMMENT|X.SHOW_TEXT|X.SHOW_PROCESSING_INSTRUCTION|X.SHOW_CDATA_SECTION,null)},Me=function(e){return e instanceof Nt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Dt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},at=function(e){return typeof Y=="function"&&e instanceof Y};function w(r,e,t){pe(r,i=>{i.call(n,e,t,W)})}const st=function(e){let t=null;if(w(h.beforeSanitizeElements,e,null),Me(e))return I(e),!0;const i=T(e.nodeName);if(w(h.uponSanitizeElement,e,{tagName:i,allowedTags:d}),ae&&e.hasChildNodes()&&!at(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent)||e.nodeType===te.progressingInstruction||ae&&e.nodeType===te.comment&&S(/<[/\w]/g,e.data))return I(e),!0;if(!(U.tagCheck instanceof Function&&U.tagCheck(i))&&(!d[i]||$[i])){if(!$[i]&&ct(i)&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,i)||u.tagNameCheck instanceof Function&&u.tagNameCheck(i)))return!1;if(be&&!N[i]){const f=re(e)||e.parentNode,A=xt(e)||e.childNodes;if(A&&f){const p=A.length;for(let L=p-1;L>=0;--L){const x=Ct(A[L],!0);x.__removalCount=(e.__removalCount||0)+1,f.insertBefore(x,wt(e))}}}return I(e),!0}return e instanceof oe&&!$t(e)||(i==="noscript"||i==="noembed"||i==="noframes")&&S(/<\/no(script|embed|frames)/i,e.innerHTML)?(I(e),!0):(H&&e.nodeType===te.text&&(t=e.textContent,pe([Ae,ge,he],f=>{t=J(t,f," ")}),e.textContent!==t&&(Z(n.removed,{element:e.cloneNode()}),e.textContent=t)),w(h.afterSanitizeElements,e,null),!1)},lt=function(e,t,i){if(Ke&&(t==="id"||t==="name")&&(i in s||i in Vt))return!1;if(!(Re&&!Se[t]&&S(Ht,t))){if(!(Ve&&S(Ft,t))){if(!(U.attributeCheck instanceof Function&&U.attributeCheck(t,e))){if(!E[t]||Se[t]){if(!(ct(e)&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))&&(u.attributeNameCheck instanceof RegExp&&S(u.attributeNameCheck,t)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(t,e))||t==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,i)||u.tagNameCheck instanceof Function&&u.tagNameCheck(i))))return!1}else if(!De[t]){if(!S(Ye,J(i,Be,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&nn(i,"data:")===0&&Je[e])){if(!($e&&!S(zt,J(i,Be,"")))){if(i)return!1}}}}}}}return!0},ct=function(e){return e!=="annotation-xml"&&Pe(e,Gt)},ft=function(e){w(h.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Me(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0};let f=t.length;for(;f--;){const A=t[f],{name:p,namespaceURI:L,value:x}=A,B=T(p),we=x;let _=p==="value"?we:on(we);if(i.attrName=B,i.attrValue=_,i.keepAttr=!0,i.forceKeepAttr=void 0,w(h.uponSanitizeAttribute,e,i),_=i.attrValue,Ze&&(B==="id"||B==="name")&&(v(p,e),_=Wt+_),ae&&S(/((--!?|])>)|<\/(style|title|textarea)/i,_)){v(p,e);continue}if(B==="attributename"&&Pe(_,"href")){v(p,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){v(p,e);continue}if(!qe&&S(/\/>/i,_)){v(p,e);continue}H&&pe([Ae,ge,he],mt=>{_=J(_,mt," ")});const ut=T(e.nodeName);if(!lt(ut,B,_)){v(p,e);continue}if(g&&typeof ie=="object"&&typeof ie.getAttributeType=="function"&&!L)switch(ie.getAttributeType(ut,B)){case"TrustedHTML":{_=g.createHTML(_);break}case"TrustedScriptURL":{_=g.createScriptURL(_);break}}if(_!==we)try{L?e.setAttributeNS(L,p,_):e.setAttribute(p,_),Me(e)?I(e):Tt(n.removed)}catch{v(p,e)}}w(h.afterSanitizeAttributes,e,null)},qt=function r(e){let t=null;const i=rt(e);for(w(h.beforeSanitizeShadowDOM,e,null);t=i.nextNode();)w(h.uponSanitizeShadowNode,t,null),st(t),ft(t),t.content instanceof m&&r(t.content);w(h.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,i=null,f=null,A=null;if(Ne=!r,Ne&&(r="<!-->"),typeof r!="string"&&!at(r))if(typeof r.toString=="function"){if(r=r.toString(),typeof r!="string")throw Q("dirty is not a string, aborting")}else throw Q("toString is not a function");if(!n.isSupported)return r;if(Oe||Ce(e),n.removed=[],typeof r=="string"&&(q=!1),q){if(r.nodeName){const x=T(r.nodeName);if(!d[x]||$[x])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(r instanceof Y)t=it("<!---->"),i=t.ownerDocument.importNode(r,!0),i.nodeType===te.element&&i.nodeName==="BODY"||i.nodeName==="HTML"?t=i:t.appendChild(i);else{if(!F&&!H&&!k&&r.indexOf("<")===-1)return g&&le?g.createHTML(r):r;if(t=it(r),!t)return F?null:le?V:""}t&&Le&&I(t.firstChild);const p=rt(q?r:t);for(;f=p.nextNode();)st(f),ft(f),f.content instanceof m&&qt(f.content);if(q)return r;if(F){if(se)for(A=kt.call(t.ownerDocument);t.firstChild;)A.appendChild(t.firstChild);else A=t;return(E.shadowroot||E.shadowrootmode)&&(A=Ut.call(a,A,!0)),A}let L=k?t.outerHTML:t.innerHTML;return k&&d["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&S(Ot,t.ownerDocument.doctype.name)&&(L="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
1
+ import{F as Kt,r as P,j as ne}from"./index.CXVpBAvU.js";const{entries:St,setPrototypeOf:pt,isFrozen:Zt,getPrototypeOf:Jt,getOwnPropertyDescriptor:Qt}=Object;let{freeze:R,seal:b,create:Fe}=Object,{apply:ze,construct:Ge}=typeof Reflect<"u"&&Reflect;R||(R=function(n){return n});b||(b=function(n){return n});ze||(ze=function(n,s){for(var a=arguments.length,c=new Array(a>2?a-2:0),m=2;m<a;m++)c[m-2]=arguments[m];return n.apply(s,c)});Ge||(Ge=function(n){for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return new n(...a)});const pe=O(Array.prototype.forEach),en=O(Array.prototype.lastIndexOf),Tt=O(Array.prototype.pop),Z=O(Array.prototype.push),tn=O(Array.prototype.splice),de=O(String.prototype.toLowerCase),xe=O(String.prototype.toString),Pe=O(String.prototype.match),J=O(String.prototype.replace),nn=O(String.prototype.indexOf),on=O(String.prototype.trim),y=O(Object.prototype.hasOwnProperty),S=O(RegExp.prototype.test),Q=rn(TypeError);function O(o){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return ze(o,n,a)}}function rn(o){return function(){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return Ge(o,s)}}function l(o,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:de;pt&&pt(o,null);let a=n.length;for(;a--;){let c=n[a];if(typeof c=="string"){const m=s(c);m!==c&&(Zt(n)||(n[a]=m),c=m)}o[c]=!0}return o}function an(o){for(let n=0;n<o.length;n++)y(o,n)||(o[n]=null);return o}function C(o){const n=Fe(null);for(const[s,a]of St(o))y(o,s)&&(Array.isArray(a)?n[s]=an(a):a&&typeof a=="object"&&a.constructor===Object?n[s]=C(a):n[s]=a);return n}function ee(o,n){for(;o!==null;){const a=Qt(o,n);if(a){if(a.get)return O(a.get);if(typeof a.value=="function")return O(a.value)}o=Jt(o)}function s(){return null}return s}const dt=R(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ke=R(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ve=R(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sn=R(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ue=R(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ln=R(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Et=R(["#text"]),_t=R(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),He=R(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),At=R(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Te=R(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),cn=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fn=b(/<%[\w\W]*|[\w\W]*%>/gm),un=b(/\$\{[\w\W]*/gm),mn=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),pn=b(/^aria-[\-\w]+$/),Rt=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Tn=b(/^(?:\w+script|data):/i),dn=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ot=b(/^html$/i),En=b(/^[a-z][.\w]*(-[.\w]+)+$/i);var gt=Object.freeze({__proto__:null,ARIA_ATTR:pn,ATTR_WHITESPACE:dn,CUSTOM_ELEMENT:En,DATA_ATTR:mn,DOCTYPE_NAME:Ot,ERB_EXPR:fn,IS_ALLOWED_URI:Rt,IS_SCRIPT_OR_DATA:Tn,MUSTACHE_EXPR:cn,TMPLIT_EXPR:un});const te={element:1,text:3,progressingInstruction:7,comment:8,document:9},_n=function(){return typeof window>"u"?null:window},An=function(n,s){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const c="data-tt-policy-suffix";s&&s.hasAttribute(c)&&(a=s.getAttribute(c));const m="dompurify"+(a?"#"+a:"");try{return n.createPolicy(m,{createHTML(D){return D},createScriptURL(D){return D}})}catch{return console.warn("TrustedTypes policy "+m+" could not be created."),null}},ht=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Lt(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_n();const n=r=>Lt(r);if(n.version="3.3.1",n.removed=[],!o||!o.document||o.document.nodeType!==te.document||!o.Element)return n.isSupported=!1,n;let{document:s}=o;const a=s,c=a.currentScript,{DocumentFragment:m,HTMLTemplateElement:D,Node:Y,Element:oe,NodeFilter:X,NamedNodeMap:Dt=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:Nt,DOMParser:It,trustedTypes:ie}=o,j=oe.prototype,Ct=ee(j,"cloneNode"),Mt=ee(j,"remove"),wt=ee(j,"nextSibling"),xt=ee(j,"childNodes"),re=ee(j,"parentNode");if(typeof D=="function"){const r=s.createElement("template");r.content&&r.content.ownerDocument&&(s=r.content.ownerDocument)}let g,V="";const{implementation:_e,createNodeIterator:Pt,createDocumentFragment:kt,getElementsByTagName:vt}=s,{importNode:Ut}=a;let h=ht();n.isSupported=typeof St=="function"&&typeof re=="function"&&_e&&_e.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ae,ERB_EXPR:ge,TMPLIT_EXPR:he,DATA_ATTR:Ht,ARIA_ATTR:Ft,IS_SCRIPT_OR_DATA:zt,ATTR_WHITESPACE:Be,CUSTOM_ELEMENT:Gt}=gt;let{IS_ALLOWED_URI:Ye}=gt,d=null;const Xe=l({},[...dt,...ke,...ve,...Ue,...Et]);let E=null;const je=l({},[..._t,...He,...At,...Te]);let u=Object.seal(Fe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,Se=null;const U=Object.seal(Fe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ve=!0,Re=!0,$e=!1,qe=!0,H=!1,ae=!0,k=!1,Oe=!1,Le=!1,F=!1,se=!1,le=!1,Ke=!0,Ze=!1;const Wt="user-content-";let be=!0,q=!1,z={},N=null;const ye=l({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Je=null;const Qe=l({},["audio","video","img","source","image","track"]);let De=null;const et=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ce="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xhtml";let G=M,Ne=!1,Ie=null;const Bt=l({},[ce,fe,M],xe);let ue=l({},["mi","mo","mn","ms","mtext"]),me=l({},["annotation-xml"]);const Yt=l({},["title","style","font","a","script"]);let K=null;const Xt=["application/xhtml+xml","text/html"],jt="text/html";let T=null,W=null;const Vt=s.createElement("form"),tt=function(e){return e instanceof RegExp||e instanceof Function},Ce=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(W&&W===e)){if((!e||typeof e!="object")&&(e={}),e=C(e),K=Xt.indexOf(e.PARSER_MEDIA_TYPE)===-1?jt:e.PARSER_MEDIA_TYPE,T=K==="application/xhtml+xml"?xe:de,d=y(e,"ALLOWED_TAGS")?l({},e.ALLOWED_TAGS,T):Xe,E=y(e,"ALLOWED_ATTR")?l({},e.ALLOWED_ATTR,T):je,Ie=y(e,"ALLOWED_NAMESPACES")?l({},e.ALLOWED_NAMESPACES,xe):Bt,De=y(e,"ADD_URI_SAFE_ATTR")?l(C(et),e.ADD_URI_SAFE_ATTR,T):et,Je=y(e,"ADD_DATA_URI_TAGS")?l(C(Qe),e.ADD_DATA_URI_TAGS,T):Qe,N=y(e,"FORBID_CONTENTS")?l({},e.FORBID_CONTENTS,T):ye,$=y(e,"FORBID_TAGS")?l({},e.FORBID_TAGS,T):C({}),Se=y(e,"FORBID_ATTR")?l({},e.FORBID_ATTR,T):C({}),z=y(e,"USE_PROFILES")?e.USE_PROFILES:!1,Ve=e.ALLOW_ARIA_ATTR!==!1,Re=e.ALLOW_DATA_ATTR!==!1,$e=e.ALLOW_UNKNOWN_PROTOCOLS||!1,qe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=e.SAFE_FOR_TEMPLATES||!1,ae=e.SAFE_FOR_XML!==!1,k=e.WHOLE_DOCUMENT||!1,F=e.RETURN_DOM||!1,se=e.RETURN_DOM_FRAGMENT||!1,le=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,Ke=e.SANITIZE_DOM!==!1,Ze=e.SANITIZE_NAMED_PROPS||!1,be=e.KEEP_CONTENT!==!1,q=e.IN_PLACE||!1,Ye=e.ALLOWED_URI_REGEXP||Rt,G=e.NAMESPACE||M,ue=e.MATHML_TEXT_INTEGRATION_POINTS||ue,me=e.HTML_INTEGRATION_POINTS||me,u=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),H&&(Re=!1),se&&(F=!0),z&&(d=l({},Et),E=[],z.html===!0&&(l(d,dt),l(E,_t)),z.svg===!0&&(l(d,ke),l(E,He),l(E,Te)),z.svgFilters===!0&&(l(d,ve),l(E,He),l(E,Te)),z.mathMl===!0&&(l(d,Ue),l(E,At),l(E,Te))),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?U.tagCheck=e.ADD_TAGS:(d===Xe&&(d=C(d)),l(d,e.ADD_TAGS,T))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?U.attributeCheck=e.ADD_ATTR:(E===je&&(E=C(E)),l(E,e.ADD_ATTR,T))),e.ADD_URI_SAFE_ATTR&&l(De,e.ADD_URI_SAFE_ATTR,T),e.FORBID_CONTENTS&&(N===ye&&(N=C(N)),l(N,e.FORBID_CONTENTS,T)),e.ADD_FORBID_CONTENTS&&(N===ye&&(N=C(N)),l(N,e.ADD_FORBID_CONTENTS,T)),be&&(d["#text"]=!0),k&&l(d,["html","head","body"]),d.table&&(l(d,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=e.TRUSTED_TYPES_POLICY,V=g.createHTML("")}else g===void 0&&(g=An(ie,c)),g!==null&&typeof V=="string"&&(V=g.createHTML(""));R&&R(e),W=e}},nt=l({},[...ke,...ve,...sn]),ot=l({},[...Ue,...ln]),$t=function(e){let t=re(e);(!t||!t.tagName)&&(t={namespaceURI:G,tagName:"template"});const i=de(e.tagName),f=de(t.tagName);return Ie[e.namespaceURI]?e.namespaceURI===fe?t.namespaceURI===M?i==="svg":t.namespaceURI===ce?i==="svg"&&(f==="annotation-xml"||ue[f]):!!nt[i]:e.namespaceURI===ce?t.namespaceURI===M?i==="math":t.namespaceURI===fe?i==="math"&&me[f]:!!ot[i]:e.namespaceURI===M?t.namespaceURI===fe&&!me[f]||t.namespaceURI===ce&&!ue[f]?!1:!ot[i]&&(Yt[i]||!nt[i]):!!(K==="application/xhtml+xml"&&Ie[e.namespaceURI]):!1},I=function(e){Z(n.removed,{element:e});try{re(e).removeChild(e)}catch{Mt(e)}},v=function(e,t){try{Z(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{Z(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(F||se)try{I(t)}catch{}else try{t.setAttribute(e,"")}catch{}},it=function(e){let t=null,i=null;if(Le)e="<remove></remove>"+e;else{const p=Pe(e,/^[\r\n\t ]+/);i=p&&p[0]}K==="application/xhtml+xml"&&G===M&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const f=g?g.createHTML(e):e;if(G===M)try{t=new It().parseFromString(f,K)}catch{}if(!t||!t.documentElement){t=_e.createDocument(G,"template",null);try{t.documentElement.innerHTML=Ne?V:f}catch{}}const A=t.body||t.documentElement;return e&&i&&A.insertBefore(s.createTextNode(i),A.childNodes[0]||null),G===M?vt.call(t,k?"html":"body")[0]:k?t.documentElement:A},rt=function(e){return Pt.call(e.ownerDocument||e,e,X.SHOW_ELEMENT|X.SHOW_COMMENT|X.SHOW_TEXT|X.SHOW_PROCESSING_INSTRUCTION|X.SHOW_CDATA_SECTION,null)},Me=function(e){return e instanceof Nt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Dt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},at=function(e){return typeof Y=="function"&&e instanceof Y};function w(r,e,t){pe(r,i=>{i.call(n,e,t,W)})}const st=function(e){let t=null;if(w(h.beforeSanitizeElements,e,null),Me(e))return I(e),!0;const i=T(e.nodeName);if(w(h.uponSanitizeElement,e,{tagName:i,allowedTags:d}),ae&&e.hasChildNodes()&&!at(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent)||e.nodeType===te.progressingInstruction||ae&&e.nodeType===te.comment&&S(/<[/\w]/g,e.data))return I(e),!0;if(!(U.tagCheck instanceof Function&&U.tagCheck(i))&&(!d[i]||$[i])){if(!$[i]&&ct(i)&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,i)||u.tagNameCheck instanceof Function&&u.tagNameCheck(i)))return!1;if(be&&!N[i]){const f=re(e)||e.parentNode,A=xt(e)||e.childNodes;if(A&&f){const p=A.length;for(let L=p-1;L>=0;--L){const x=Ct(A[L],!0);x.__removalCount=(e.__removalCount||0)+1,f.insertBefore(x,wt(e))}}}return I(e),!0}return e instanceof oe&&!$t(e)||(i==="noscript"||i==="noembed"||i==="noframes")&&S(/<\/no(script|embed|frames)/i,e.innerHTML)?(I(e),!0):(H&&e.nodeType===te.text&&(t=e.textContent,pe([Ae,ge,he],f=>{t=J(t,f," ")}),e.textContent!==t&&(Z(n.removed,{element:e.cloneNode()}),e.textContent=t)),w(h.afterSanitizeElements,e,null),!1)},lt=function(e,t,i){if(Ke&&(t==="id"||t==="name")&&(i in s||i in Vt))return!1;if(!(Re&&!Se[t]&&S(Ht,t))){if(!(Ve&&S(Ft,t))){if(!(U.attributeCheck instanceof Function&&U.attributeCheck(t,e))){if(!E[t]||Se[t]){if(!(ct(e)&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))&&(u.attributeNameCheck instanceof RegExp&&S(u.attributeNameCheck,t)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(t,e))||t==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,i)||u.tagNameCheck instanceof Function&&u.tagNameCheck(i))))return!1}else if(!De[t]){if(!S(Ye,J(i,Be,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&nn(i,"data:")===0&&Je[e])){if(!($e&&!S(zt,J(i,Be,"")))){if(i)return!1}}}}}}}return!0},ct=function(e){return e!=="annotation-xml"&&Pe(e,Gt)},ft=function(e){w(h.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Me(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0};let f=t.length;for(;f--;){const A=t[f],{name:p,namespaceURI:L,value:x}=A,B=T(p),we=x;let _=p==="value"?we:on(we);if(i.attrName=B,i.attrValue=_,i.keepAttr=!0,i.forceKeepAttr=void 0,w(h.uponSanitizeAttribute,e,i),_=i.attrValue,Ze&&(B==="id"||B==="name")&&(v(p,e),_=Wt+_),ae&&S(/((--!?|])>)|<\/(style|title|textarea)/i,_)){v(p,e);continue}if(B==="attributename"&&Pe(_,"href")){v(p,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){v(p,e);continue}if(!qe&&S(/\/>/i,_)){v(p,e);continue}H&&pe([Ae,ge,he],mt=>{_=J(_,mt," ")});const ut=T(e.nodeName);if(!lt(ut,B,_)){v(p,e);continue}if(g&&typeof ie=="object"&&typeof ie.getAttributeType=="function"&&!L)switch(ie.getAttributeType(ut,B)){case"TrustedHTML":{_=g.createHTML(_);break}case"TrustedScriptURL":{_=g.createScriptURL(_);break}}if(_!==we)try{L?e.setAttributeNS(L,p,_):e.setAttribute(p,_),Me(e)?I(e):Tt(n.removed)}catch{v(p,e)}}w(h.afterSanitizeAttributes,e,null)},qt=function r(e){let t=null;const i=rt(e);for(w(h.beforeSanitizeShadowDOM,e,null);t=i.nextNode();)w(h.uponSanitizeShadowNode,t,null),st(t),ft(t),t.content instanceof m&&r(t.content);w(h.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,i=null,f=null,A=null;if(Ne=!r,Ne&&(r="<!-->"),typeof r!="string"&&!at(r))if(typeof r.toString=="function"){if(r=r.toString(),typeof r!="string")throw Q("dirty is not a string, aborting")}else throw Q("toString is not a function");if(!n.isSupported)return r;if(Oe||Ce(e),n.removed=[],typeof r=="string"&&(q=!1),q){if(r.nodeName){const x=T(r.nodeName);if(!d[x]||$[x])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(r instanceof Y)t=it("<!---->"),i=t.ownerDocument.importNode(r,!0),i.nodeType===te.element&&i.nodeName==="BODY"||i.nodeName==="HTML"?t=i:t.appendChild(i);else{if(!F&&!H&&!k&&r.indexOf("<")===-1)return g&&le?g.createHTML(r):r;if(t=it(r),!t)return F?null:le?V:""}t&&Le&&I(t.firstChild);const p=rt(q?r:t);for(;f=p.nextNode();)st(f),ft(f),f.content instanceof m&&qt(f.content);if(q)return r;if(F){if(se)for(A=kt.call(t.ownerDocument);t.firstChild;)A.appendChild(t.firstChild);else A=t;return(E.shadowroot||E.shadowrootmode)&&(A=Ut.call(a,A,!0)),A}let L=k?t.outerHTML:t.innerHTML;return k&&d["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&S(Ot,t.ownerDocument.doctype.name)&&(L="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
2
2
  `+L),H&&pe([Ae,ge,he],x=>{L=J(L,x," ")}),g&&le?g.createHTML(L):L},n.setConfig=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ce(r),Oe=!0},n.clearConfig=function(){W=null,Oe=!1},n.isValidAttribute=function(r,e,t){W||Ce({});const i=T(r),f=T(e);return lt(i,f,t)},n.addHook=function(r,e){typeof e=="function"&&Z(h[r],e)},n.removeHook=function(r,e){if(e!==void 0){const t=en(h[r],e);return t===-1?void 0:tn(h[r],t,1)[0]}return Tt(h[r])},n.removeHooks=function(r){h[r]=[]},n.removeAllHooks=function(){h=ht()},n}var Ee=Lt();const We="data-temp-href-target";Ee.addHook("beforeSanitizeAttributes",function(o){o instanceof HTMLElement&&o.hasAttribute("target")&&o.getAttribute("target")==="_blank"&&o.setAttribute(We,"_blank")});Ee.addHook("afterSanitizeAttributes",function(o){o instanceof HTMLElement&&o.hasAttribute(We)&&(o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"),o.removeAttribute(We))});const bt={USE_PROFILES:{html:!0},FORCE_BODY:!0},gn=Kt("div",{target:"e1o5kn6k0"})(({theme:o})=>({width:"100%","ul, ol, dl":{paddingLeft:o.spacing.threeXL}})),yt=P.forwardRef(function(n,s){return ne(gn,{className:"stHtml","data-testid":"stHtml",ref:s,...n})}),hn={...bt,ADD_TAGS:["script","style"],ADD_ATTR:["src","type","async","defer","nonce","crossorigin","referrerpolicy","integrity"]};function Sn(o){return Ee.sanitize(o,hn)}const Rn=({body:o})=>{const n=P.useRef(null),s=P.useMemo(()=>Sn(o),[o]);return P.useEffect(()=>{const a=n.current;return a?(a.innerHTML=s,Array.from(a.querySelectorAll("script")).forEach(m=>{const D=document.createElement("script");for(const{name:Y,value:oe}of Array.from(m.attributes))try{D.setAttribute(Y,oe)}catch{}m.src||(D.textContent=m.textContent),m.parentNode?.replaceChild(D,m)}),()=>{a.innerHTML=""}):void 0},[s]),ne(yt,{ref:n})},On=P.memo(Rn);function Ln(o){return Ee.sanitize(o,bt)}function bn({body:o}){const n=P.useMemo(()=>Ln(o),[o]);return n?ne(yt,{dangerouslySetInnerHTML:{__html:n}}):null}const yn=P.memo(bn);function Dn({element:o}){const{body:n,unsafeAllowJavascript:s}=o;return s?ne(On,{body:n}):ne(yn,{body:n})}const In=P.memo(Dn);export{In as default};
@@ -1 +1 @@
1
- import{r as l,e as s,j as m,p as V,U as x}from"./index.BRfGUOQ-.js";import{u as U}from"./useBasicWidgetState.A4U5lzAm.js";import"./FormClearHelper.C-6BC487.js";const h=(t,e)=>t.getStringValue(e),v=t=>t.options.length===0||s(t.default)?null:t.options[t.default],w=t=>t.rawValue??null,y=(t,e,o,a)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},a)},C=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:i,help:u,label:n,labelVisibility:c,placeholder:p,acceptNewOptions:f}=e,[g,r]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:w,updateWidgetMgrState:y,element:e,widgetMgr:o,fragmentId:a}),b=l.useCallback(d=>{r({value:d,fromUi:!0})},[r]),S=s(e.default)&&!t;return m(x,{label:n,labelVisibility:V(c?.value),options:i,disabled:t,onChange:b,value:g,help:u,placeholder:p,clearable:S,acceptNewOptions:f??!1})},P=l.memo(C);export{P as default};
1
+ import{r as l,e as s,j as m,p as V,U as x}from"./index.CXVpBAvU.js";import{u as U}from"./useBasicWidgetState.D-fc_aIL.js";import"./FormClearHelper.D4lty7rT.js";const h=(t,e)=>t.getStringValue(e),v=t=>t.options.length===0||s(t.default)?null:t.options[t.default],w=t=>t.rawValue??null,y=(t,e,o,a)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},a)},C=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:i,help:u,label:n,labelVisibility:c,placeholder:p,acceptNewOptions:f}=e,[g,r]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:w,updateWidgetMgrState:y,element:e,widgetMgr:o,fragmentId:a}),b=l.useCallback(d=>{r({value:d,fromUi:!0})},[r]),S=s(e.default)&&!t;return m(x,{label:n,labelVisibility:V(c?.value),options:i,disabled:t,onChange:b,value:g,help:u,placeholder:p,clearable:S,acceptNewOptions:f??!1})},P=l.memo(C);export{P as default};
@@ -1,2 +1,2 @@
1
- import{K as _,r as u,W as ao,ct as W,cu as co,aN as io,l as lo,j as m,X as U,V as fo,cv as go,F as D,aO as V}from"./index.BRfGUOQ-.js";function Co(o,e,r,n){for(var t=-1,s=o==null?0:o.length;++t<s;)r=e(r,o[t],t,o);return r}function xo(o){return function(e){return o?.[e]}}var po={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ho=xo(po),mo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bo="\\u0300-\\u036f",So="\\ufe20-\\ufe2f",yo="\\u20d0-\\u20ff",Ro=bo+So+yo,Eo="["+Ro+"]",Fo=RegExp(Eo,"g");function wo(o){return o=_(o),o&&o.replace(mo,ho).replace(Fo,"")}var vo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ko(o){return o.match(vo)||[]}var Bo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function To(o){return Bo.test(o)}var H="\\ud800-\\udfff",zo="\\u0300-\\u036f",Ao="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",Io=zo+Ao+Uo,J="\\u2700-\\u27bf",Z="a-z\\xdf-\\xf6\\xf8-\\xff",Oo="\\xac\\xb1\\xd7\\xf7",Wo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Lo="\\u2000-\\u206f",Mo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",G="A-Z\\xc0-\\xd6\\xd8-\\xde",jo="\\ufe0e\\ufe0f",K=Oo+Wo+Lo+Mo,Y="['’]",L="["+K+"]",$o="["+Io+"]",q="\\d+",No="["+J+"]",X="["+Z+"]",Q="[^"+H+K+q+J+Z+G+"]",Po="\\ud83c[\\udffb-\\udfff]",_o="(?:"+$o+"|"+Po+")",Do="[^"+H+"]",oo="(?:\\ud83c[\\udde6-\\uddff]){2}",eo="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+G+"]",Vo="\\u200d",M="(?:"+X+"|"+Q+")",Ho="(?:"+w+"|"+Q+")",j="(?:"+Y+"(?:d|ll|m|re|s|t|ve))?",$="(?:"+Y+"(?:D|LL|M|RE|S|T|VE))?",ro=_o+"?",to="["+jo+"]?",Jo="(?:"+Vo+"(?:"+[Do,oo,eo].join("|")+")"+to+ro+")*",Zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Go="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ko=to+ro+Jo,Yo="(?:"+[No,oo,eo].join("|")+")"+Ko,qo=RegExp([w+"?"+X+"+"+j+"(?="+[L,w,"$"].join("|")+")",Ho+"+"+$+"(?="+[L,w+M,"$"].join("|")+")",w+"?"+M+"+"+j,w+"+"+$,Go,Zo,q,Yo].join("|"),"g");function Xo(o){return o.match(qo)||[]}function Qo(o,e,r){return o=_(o),e=e,e===void 0?To(o)?Xo(o):ko(o):o.match(e)||[]}var oe="['’]",ee=RegExp(oe,"g");function re(o){return function(e){return Co(Qo(wo(e).replace(ee,"")),o,"")}}var te=re(function(o,e,r){return o+(r?"-":"")+e.toLowerCase()});const k=u.createContext(null);k.displayName="BidiComponentContext";const v=ao.getLogger("BidiComponent"),N="__",z="__streamlit_arrow_ref__",ne="$$STREAMLIT_INTERNAL_KEY",se=(o,e)=>{if(o&&typeof o=="object"&&!Array.isArray(o)){if(typeof o[z]=="string"){const n=o[z],t=e[n];if(t)try{return W(t)}catch{return null}return null}const r={};for(const[n,t]of Object.entries(o))if(t&&typeof t=="object"&&!Array.isArray(t)&&typeof t[z]=="string"){const s=t[z],a=e[s];if(a)try{r[n]=W(a)}catch{r[n]=null}else r[n]=null}else r[n]=t;return r}return o},ue=({arrowBlobs:o,arrowData:e,bytes:r,data:n,json:t,mixedJson:s})=>{switch(n){case"json":return t?JSON.parse(t):null;case"arrowData":return e??null;case"bytes":return r??null;case"mixed":{if(s&&o){const a=JSON.parse(s),i={};return Object.entries(o).forEach(([l,d])=>{d?.data&&(i[l]=d.data)}),se(a,i)}return null}case"any":case void 0:return null;default:co(n)}},ae=(o,e="--st")=>{const r={};return Object.entries(o).forEach(([n,t])=>{const s=te(n),a=`${e}-${s}`;if(typeof t=="boolean"){r[a]=t?"1":"0";return}if(t==null){r[a]="unset";return}if(Array.isArray(t)){r[a]=t.join(",");return}if(typeof t=="number"||typeof t=="string"){r[a]=String(t);return}r[a]="unset"}),r},ce=o=>{const e=[o.fontSizes.h1FontSize,o.fontSizes.h2FontSize,o.fontSizes.h3FontSize,o.fontSizes.h4FontSize,o.fontSizes.h5FontSize,o.fontSizes.h6FontSize],r=[o.fontWeights.h1FontWeight,o.fontWeights.h2FontWeight,o.fontWeights.h3FontWeight,o.fontWeights.h4FontWeight,o.fontWeights.h5FontWeight,o.fontWeights.h6FontWeight];return{primaryColor:o.colors.primary,backgroundColor:o.colors.bgColor,secondaryBackgroundColor:o.colors.secondaryBg,textColor:o.colors.bodyText,linkColor:o.colors.link,linkUnderline:o.linkUnderline,headingFont:o.genericFonts.headingFont,codeFont:o.genericFonts.codeFont,baseRadius:o.radii.default,buttonRadius:o.radii.button,baseFontSize:typeof o.fontSizes.baseFontSize=="number"?`${o.fontSizes.baseFontSize}px`:String(o.fontSizes.baseFontSize),baseFontWeight:o.fontWeights.normal,codeFontWeight:o.fontWeights.code,codeFontSize:o.fontSizes.codeFontSize,headingFontSizes:e,headingFontSize1:e[0],headingFontSize2:e[1],headingFontSize3:e[2],headingFontSize4:e[3],headingFontSize5:e[4],headingFontSize6:e[5],headingFontWeights:r,headingFontWeight1:r[0],headingFontWeight2:r[1],headingFontWeight3:r[2],headingFontWeight4:r[3],headingFontWeight5:r[4],headingFontWeight6:r[5],borderColor:o.colors.borderColor,dataframeBorderColor:o.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:o.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:o.colors.codeBackgroundColor,font:o.genericFonts.bodyFont,chartCategoricalColors:o.colors.chartCategoricalColors,chartSequentialColors:o.colors.chartSequentialColors,headingColor:o.colors.headingColor,borderColorLight:o.colors.borderColorLight,codeTextColor:o.colors.codeTextColor,widgetBorderColor:o.colors.widgetBorderColor||"transparent",redColor:o.colors.redColor,orangeColor:o.colors.orangeColor,yellowColor:o.colors.yellowColor,blueColor:o.colors.blueColor,greenColor:o.colors.greenColor,violetColor:o.colors.violetColor,grayColor:o.colors.grayColor,redBackgroundColor:o.colors.redBackgroundColor,orangeBackgroundColor:o.colors.orangeBackgroundColor,yellowBackgroundColor:o.colors.yellowBackgroundColor,blueBackgroundColor:o.colors.blueBackgroundColor,greenBackgroundColor:o.colors.greenBackgroundColor,violetBackgroundColor:o.colors.violetBackgroundColor,grayBackgroundColor:o.colors.grayBackgroundColor,redTextColor:o.colors.redTextColor,orangeTextColor:o.colors.orangeTextColor,yellowTextColor:o.colors.yellowTextColor,blueTextColor:o.colors.blueTextColor,greenTextColor:o.colors.greenTextColor,violetTextColor:o.colors.violetTextColor,grayTextColor:o.colors.grayTextColor}},ie=u.memo(({element:o,children:e,widgetMgr:r,fragmentId:n,componentRegistry:t})=>{const{arrowData:s,bytes:a,componentName:i,cssContent:l,cssSourcePath:d,data:f,htmlContent:g,id:c,jsContent:b,json:p,jsSourcePath:h,mixed:C}=o,R=u.useMemo(()=>({id:o.id,formId:o.formId}),[o.id,o.formId]),B=u.useCallback(()=>{const F=r.getJsonValue(R);if(!F)return{};try{return JSON.parse(F)}catch(I){const y=io(I);return v.warn("Failed to parse widget JSON value; returning empty object.",{widgetId:R.id,formId:R.formId,error:y.message}),{}}},[R,r]),T=u.useMemo(()=>ue({arrowBlobs:C?.arrowBlobs||void 0,arrowData:s?.data||void 0,bytes:a,data:f,json:p,mixedJson:C?.json||void 0}),[f,p,s?.data,a,C?.json,C?.arrowBlobs]),S=lo(),E=u.useMemo(()=>ce(S),[S]),x=u.useMemo(()=>({componentName:i,componentRegistry:t,cssContent:l?.trim(),cssSourcePath:d||void 0,data:T,fragmentId:n,getWidgetValue:B,htmlContent:g?.trim(),id:c,formId:o.formId||void 0,jsContent:b||void 0,jsSourcePath:h||void 0,theme:E,widgetMgr:r}),[i,t,l,d,n,B,g,c,o.formId,b,h,T,E,r]);return m(k.Provider,{value:x,children:e})}),no=(o,e)=>{if(o instanceof Error)return o;const r=e?`${e}: ${String(o)}`:String(o);return new Error(r)},A=(o,e,r)=>{const n=no(o,r);v.error(`BidiComponent Error: ${n.message}`,o),e(n)},de=(o,e)=>{try{const n=document.createRange().createContextualFragment(o);e.appendChild(n)}catch(r){v.warn("createContextualFragment failed, falling back to innerHTML",r),e.innerHTML=o}},so=({containerRef:o,setError:e,skip:r=!1})=>{const n=u.useRef(null),{htmlContent:t,cssContent:s,cssSourcePath:a,componentName:i,componentRegistry:{getBidiComponentURL:l}}=U(k),d=u.useMemo(()=>{if(a)return l(i,a)},[i,a,l]),f=fo(d);return u.useEffect(()=>{if(r)return;const g=o.current;if(g)try{if(n.current?.parentNode===g&&g.removeChild(n.current),n.current=document.createElement("div"),t){const c=document.createElement("div");de(t,c),n.current.appendChild(c)}if(s){const c=document.createElement("style");c.textContent=s,n.current.appendChild(c)}else if(d){const c=document.createElement("link");c.href=d,c.rel="stylesheet",f&&(c.crossOrigin=f),c.onerror=()=>{A(new Error(`Failed to load CSS from ${d}`),e)},n.current.appendChild(c)}g.appendChild(n.current)}catch(c){A(c,e,"Failed to process HTML/CSS content")}},[t,s,o,f,d,e,r]),n};class le{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(e){let r=this.hashSeed;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r>>>0,this.hashPrime)>>>0;return(r>>>0).toString(16)}getOrCreateUrlForJs(e,r){const n=this.computeHash(e),t=this.cache.get(n);if(t)return{url:t,hash:n};const s=`${e}
1
+ import{K as _,r as u,W as ao,ct as W,cu as co,aN as io,l as lo,j as m,X as U,V as fo,cv as go,F as D,aO as V}from"./index.CXVpBAvU.js";function Co(o,e,r,n){for(var t=-1,s=o==null?0:o.length;++t<s;)r=e(r,o[t],t,o);return r}function xo(o){return function(e){return o?.[e]}}var po={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ho=xo(po),mo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bo="\\u0300-\\u036f",So="\\ufe20-\\ufe2f",yo="\\u20d0-\\u20ff",Ro=bo+So+yo,Eo="["+Ro+"]",Fo=RegExp(Eo,"g");function wo(o){return o=_(o),o&&o.replace(mo,ho).replace(Fo,"")}var vo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ko(o){return o.match(vo)||[]}var Bo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function To(o){return Bo.test(o)}var H="\\ud800-\\udfff",zo="\\u0300-\\u036f",Ao="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",Io=zo+Ao+Uo,J="\\u2700-\\u27bf",Z="a-z\\xdf-\\xf6\\xf8-\\xff",Oo="\\xac\\xb1\\xd7\\xf7",Wo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Lo="\\u2000-\\u206f",Mo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",G="A-Z\\xc0-\\xd6\\xd8-\\xde",jo="\\ufe0e\\ufe0f",K=Oo+Wo+Lo+Mo,Y="['’]",L="["+K+"]",$o="["+Io+"]",q="\\d+",No="["+J+"]",X="["+Z+"]",Q="[^"+H+K+q+J+Z+G+"]",Po="\\ud83c[\\udffb-\\udfff]",_o="(?:"+$o+"|"+Po+")",Do="[^"+H+"]",oo="(?:\\ud83c[\\udde6-\\uddff]){2}",eo="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+G+"]",Vo="\\u200d",M="(?:"+X+"|"+Q+")",Ho="(?:"+w+"|"+Q+")",j="(?:"+Y+"(?:d|ll|m|re|s|t|ve))?",$="(?:"+Y+"(?:D|LL|M|RE|S|T|VE))?",ro=_o+"?",to="["+jo+"]?",Jo="(?:"+Vo+"(?:"+[Do,oo,eo].join("|")+")"+to+ro+")*",Zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Go="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ko=to+ro+Jo,Yo="(?:"+[No,oo,eo].join("|")+")"+Ko,qo=RegExp([w+"?"+X+"+"+j+"(?="+[L,w,"$"].join("|")+")",Ho+"+"+$+"(?="+[L,w+M,"$"].join("|")+")",w+"?"+M+"+"+j,w+"+"+$,Go,Zo,q,Yo].join("|"),"g");function Xo(o){return o.match(qo)||[]}function Qo(o,e,r){return o=_(o),e=e,e===void 0?To(o)?Xo(o):ko(o):o.match(e)||[]}var oe="['’]",ee=RegExp(oe,"g");function re(o){return function(e){return Co(Qo(wo(e).replace(ee,"")),o,"")}}var te=re(function(o,e,r){return o+(r?"-":"")+e.toLowerCase()});const k=u.createContext(null);k.displayName="BidiComponentContext";const v=ao.getLogger("BidiComponent"),N="__",z="__streamlit_arrow_ref__",ne="$$STREAMLIT_INTERNAL_KEY",se=(o,e)=>{if(o&&typeof o=="object"&&!Array.isArray(o)){if(typeof o[z]=="string"){const n=o[z],t=e[n];if(t)try{return W(t)}catch{return null}return null}const r={};for(const[n,t]of Object.entries(o))if(t&&typeof t=="object"&&!Array.isArray(t)&&typeof t[z]=="string"){const s=t[z],a=e[s];if(a)try{r[n]=W(a)}catch{r[n]=null}else r[n]=null}else r[n]=t;return r}return o},ue=({arrowBlobs:o,arrowData:e,bytes:r,data:n,json:t,mixedJson:s})=>{switch(n){case"json":return t?JSON.parse(t):null;case"arrowData":return e??null;case"bytes":return r??null;case"mixed":{if(s&&o){const a=JSON.parse(s),i={};return Object.entries(o).forEach(([l,d])=>{d?.data&&(i[l]=d.data)}),se(a,i)}return null}case"any":case void 0:return null;default:co(n)}},ae=(o,e="--st")=>{const r={};return Object.entries(o).forEach(([n,t])=>{const s=te(n),a=`${e}-${s}`;if(typeof t=="boolean"){r[a]=t?"1":"0";return}if(t==null){r[a]="unset";return}if(Array.isArray(t)){r[a]=t.join(",");return}if(typeof t=="number"||typeof t=="string"){r[a]=String(t);return}r[a]="unset"}),r},ce=o=>{const e=[o.fontSizes.h1FontSize,o.fontSizes.h2FontSize,o.fontSizes.h3FontSize,o.fontSizes.h4FontSize,o.fontSizes.h5FontSize,o.fontSizes.h6FontSize],r=[o.fontWeights.h1FontWeight,o.fontWeights.h2FontWeight,o.fontWeights.h3FontWeight,o.fontWeights.h4FontWeight,o.fontWeights.h5FontWeight,o.fontWeights.h6FontWeight];return{primaryColor:o.colors.primary,backgroundColor:o.colors.bgColor,secondaryBackgroundColor:o.colors.secondaryBg,textColor:o.colors.bodyText,linkColor:o.colors.link,linkUnderline:o.linkUnderline,headingFont:o.genericFonts.headingFont,codeFont:o.genericFonts.codeFont,baseRadius:o.radii.default,buttonRadius:o.radii.button,baseFontSize:typeof o.fontSizes.baseFontSize=="number"?`${o.fontSizes.baseFontSize}px`:String(o.fontSizes.baseFontSize),baseFontWeight:o.fontWeights.normal,codeFontWeight:o.fontWeights.code,codeFontSize:o.fontSizes.codeFontSize,headingFontSizes:e,headingFontSize1:e[0],headingFontSize2:e[1],headingFontSize3:e[2],headingFontSize4:e[3],headingFontSize5:e[4],headingFontSize6:e[5],headingFontWeights:r,headingFontWeight1:r[0],headingFontWeight2:r[1],headingFontWeight3:r[2],headingFontWeight4:r[3],headingFontWeight5:r[4],headingFontWeight6:r[5],borderColor:o.colors.borderColor,dataframeBorderColor:o.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:o.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:o.colors.codeBackgroundColor,font:o.genericFonts.bodyFont,chartCategoricalColors:o.colors.chartCategoricalColors,chartSequentialColors:o.colors.chartSequentialColors,headingColor:o.colors.headingColor,borderColorLight:o.colors.borderColorLight,codeTextColor:o.colors.codeTextColor,widgetBorderColor:o.colors.widgetBorderColor||"transparent",redColor:o.colors.redColor,orangeColor:o.colors.orangeColor,yellowColor:o.colors.yellowColor,blueColor:o.colors.blueColor,greenColor:o.colors.greenColor,violetColor:o.colors.violetColor,grayColor:o.colors.grayColor,redBackgroundColor:o.colors.redBackgroundColor,orangeBackgroundColor:o.colors.orangeBackgroundColor,yellowBackgroundColor:o.colors.yellowBackgroundColor,blueBackgroundColor:o.colors.blueBackgroundColor,greenBackgroundColor:o.colors.greenBackgroundColor,violetBackgroundColor:o.colors.violetBackgroundColor,grayBackgroundColor:o.colors.grayBackgroundColor,redTextColor:o.colors.redTextColor,orangeTextColor:o.colors.orangeTextColor,yellowTextColor:o.colors.yellowTextColor,blueTextColor:o.colors.blueTextColor,greenTextColor:o.colors.greenTextColor,violetTextColor:o.colors.violetTextColor,grayTextColor:o.colors.grayTextColor}},ie=u.memo(({element:o,children:e,widgetMgr:r,fragmentId:n,componentRegistry:t})=>{const{arrowData:s,bytes:a,componentName:i,cssContent:l,cssSourcePath:d,data:f,htmlContent:g,id:c,jsContent:b,json:p,jsSourcePath:h,mixed:C}=o,R=u.useMemo(()=>({id:o.id,formId:o.formId}),[o.id,o.formId]),B=u.useCallback(()=>{const F=r.getJsonValue(R);if(!F)return{};try{return JSON.parse(F)}catch(I){const y=io(I);return v.warn("Failed to parse widget JSON value; returning empty object.",{widgetId:R.id,formId:R.formId,error:y.message}),{}}},[R,r]),T=u.useMemo(()=>ue({arrowBlobs:C?.arrowBlobs||void 0,arrowData:s?.data||void 0,bytes:a,data:f,json:p,mixedJson:C?.json||void 0}),[f,p,s?.data,a,C?.json,C?.arrowBlobs]),S=lo(),E=u.useMemo(()=>ce(S),[S]),x=u.useMemo(()=>({componentName:i,componentRegistry:t,cssContent:l?.trim(),cssSourcePath:d||void 0,data:T,fragmentId:n,getWidgetValue:B,htmlContent:g?.trim(),id:c,formId:o.formId||void 0,jsContent:b||void 0,jsSourcePath:h||void 0,theme:E,widgetMgr:r}),[i,t,l,d,n,B,g,c,o.formId,b,h,T,E,r]);return m(k.Provider,{value:x,children:e})}),no=(o,e)=>{if(o instanceof Error)return o;const r=e?`${e}: ${String(o)}`:String(o);return new Error(r)},A=(o,e,r)=>{const n=no(o,r);v.error(`BidiComponent Error: ${n.message}`,o),e(n)},de=(o,e)=>{try{const n=document.createRange().createContextualFragment(o);e.appendChild(n)}catch(r){v.warn("createContextualFragment failed, falling back to innerHTML",r),e.innerHTML=o}},so=({containerRef:o,setError:e,skip:r=!1})=>{const n=u.useRef(null),{htmlContent:t,cssContent:s,cssSourcePath:a,componentName:i,componentRegistry:{getBidiComponentURL:l}}=U(k),d=u.useMemo(()=>{if(a)return l(i,a)},[i,a,l]),f=fo(d);return u.useEffect(()=>{if(r)return;const g=o.current;if(g)try{if(n.current?.parentNode===g&&g.removeChild(n.current),n.current=document.createElement("div"),t){const c=document.createElement("div");de(t,c),n.current.appendChild(c)}if(s){const c=document.createElement("style");c.textContent=s,n.current.appendChild(c)}else if(d){const c=document.createElement("link");c.href=d,c.rel="stylesheet",f&&(c.crossOrigin=f),c.onerror=()=>{A(new Error(`Failed to load CSS from ${d}`),e)},n.current.appendChild(c)}g.appendChild(n.current)}catch(c){A(c,e,"Failed to process HTML/CSS content")}},[t,s,o,f,d,e,r]),n};class le{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(e){let r=this.hashSeed;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r>>>0,this.hashPrime)>>>0;return(r>>>0).toString(16)}getOrCreateUrlForJs(e,r){const n=this.computeHash(e),t=this.cache.get(n);if(t)return{url:t,hash:n};const s=`${e}
2
2
  //# sourceURL=${r}-${n}.js`,a=new Blob([s],{type:"text/javascript"}),i=URL.createObjectURL(a);return this.cache.set(n,i),{url:i,hash:n}}}const fe=new le,ge="events";function Ce(o){if(o.includes(N))throw new Error("Base component id must not contain the delimiter sequence");return`${ne}_${o}${N}${ge}`}const P=async({componentId:o,componentIdForWidgetMgr:e,componentName:r,data:n,formId:t,fragmentId:s,getWidgetValue:a,moduleUrl:i,parentElement:l,widgetMgr:d})=>{const f=await import(i);if(!f)throw new Error("JS module does not exist.");if(!f.default||typeof f.default!="function")throw new Error("JS module does not have a default export function.");const g=(b,p)=>{let h={};try{h={...a(),[b]:p}}catch(C){v.error(`Failed to get existing value for ${b}`,C),h={[b]:p}}d.setJsonValue({id:e,formId:t},h,{fromUi:!0},s)},c=(b,p)=>{if(t){v.warn("BidiComponent: setTriggerValue ignored inside st.form. Triggers are not allowed in forms; use setStateValue and form submit instead.");return}const h=Ce(e);d.setTriggerValue({id:h,formId:t},{fromUi:!0},s,{event:b,value:p})};return f.default({name:r,data:n,key:o,parentElement:l,setStateValue:g,setTriggerValue:c})},uo=({containerRef:o,setError:e,skip:r=!1})=>{const t=`st-bidi-component-${u.useMemo(()=>go(),[])}`,{componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,id:f,jsContent:g,jsSourcePath:c,theme:b,widgetMgr:p,componentRegistry:{getBidiComponentURL:h}}=U(k),C=u.useMemo(()=>{if(c)return h(s,c)},[s,c,h]),R=u.useRef(),B=u.useRef(),T=u.useRef(!1);u.useEffect(()=>{const{current:S}=o;if(r||!g&&!C||!S)return;(async()=>{try{if(g){const{url:x}=fe.getOrCreateUrlForJs(g,`st-bidi-${s}`);R.current=await P({componentId:t,componentIdForWidgetMgr:f,componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,moduleUrl:x,parentElement:S,widgetMgr:p})}else if(C){const x=C;try{await new Promise((F,I)=>{const y=document.createElement("script");y.type="module",y.src=x,y.async=!0,y.onload=()=>F(),y.onerror=()=>I(new Error(`Failed to load script from ${C}`)),document.head.appendChild(y),B.current=y}),R.current=await P({componentId:t,componentIdForWidgetMgr:f,componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,moduleUrl:x,parentElement:S,widgetMgr:p})}catch(F){throw no(F,`Failed to load or execute script from ${C}`)}}}catch(x){T.current||A(x,e)}})()},[t,s,o,a,i,l,d,f,g,C,e,r,p,b]),u.useEffect(()=>()=>{T.current=!0;const S=R.current;S&&Promise.resolve(S).then(x=>{x?.()}).catch(x=>{v.error("Failed to run custom component cleanup",x)});const E=B.current;E?.parentNode&&E.parentNode.removeChild(E)},[])},xe=D("div",{target:"epzkg1s0"})(({cssCustomProperties:o})=>({...o,display:"contents"})),O=D("div",{target:"epzkg1s1"})({width:"100%",height:"100%"}),pe=u.memo(()=>{const o=u.useRef(null),e=u.useRef(null),[r,n]=u.useState(!1),[t,s]=u.useState(null),{id:a}=U(k);u.useEffect(()=>{if(o.current)try{if(o.current.shadowRoot){e.current=o.current.shadowRoot,n(!0);return}e.current=o.current.attachShadow({mode:"open"}),n(!0)}catch(l){A(l,s,"Failed to create shadow DOM")}},[a]);const i=!r||!!t;return so({containerRef:e,setError:s,skip:i}),uo({containerRef:e,setError:s,skip:i}),t?m(V,{name:"BidiComponent Error",message:t.message,stack:t.stack}):m(O,{ref:o,"data-testid":"stBidiComponentIsolated"})}),he=u.memo(()=>{const o=u.useRef(null),[e,r]=u.useState(null),n=!!e;return so({containerRef:o,setError:r,skip:n}),uo({containerRef:o,setError:r,skip:n}),e?m(V,{name:"BidiComponent Error",message:e.message,stack:e.stack}):m(O,{ref:o,"data-testid":"stBidiComponentRegular"})}),me=({children:o})=>{const{theme:e}=U(k),r=u.useMemo(()=>ae(e),[e]);return m(xe,{cssCustomProperties:r,children:o})},be=({element:o,widgetMgr:e,fragmentId:r,componentRegistry:n})=>{const{isolateStyles:t}=o;return m(ie,{element:o,widgetMgr:e,fragmentId:r,componentRegistry:n,children:m(O,{className:"stBidiComponent",children:m(me,{children:t?m(pe,{}):m(he,{})})})})},ye=u.memo(be);export{k as BidiComponentContext,ye as default};
@@ -1 +1 @@
1
- import{r as o,E as L,_ as k,F as p,ab as Ue,o as S,j as l,az as I,b as V,c as ve,B as M,h as ze,a0 as be,k as Ce,al as ee,bj as Ie,e as D,bX as Ee,p as Be,ac as De,ad as Le,bS as ke,bT as Ve}from"./index.BRfGUOQ-.js";import{u as Me}from"./FormClearHelper.C-6BC487.js";import{g as oe,F as R,a as Re,D as Ae,I as Pe,s as Ne,b as Te}from"./FileHelper.C---TH7o.js";import{S as qe,P as We}from"./ProgressBar.BiYsyZCC.js";import{U as $}from"./UploadFileInfo.Dr-zDST7.js";const He=e=>{const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current};var ne=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});ne.displayName="ChevronLeft";var re=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});re.displayName="ChevronRight";var ae=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))});ae.displayName="Clear";var le=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});le.displayName="CloudUpload";var se=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});se.displayName="Error";const ie=p("section",{target:"e7fhruq0"})(({isDisabled:e,theme:t})=>({display:"flex",gap:t.spacing.lg,alignItems:"center",padding:t.spacing.lg,backgroundColor:t.colors.secondaryBg,borderRadius:t.radii.default,border:t.colors.widgetBorderColor?`${t.sizes.borderWidth} solid ${t.colors.widgetBorderColor}`:void 0,height:t.sizes.largestElementHeight,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${t.colors.primary}`},cursor:e?"not-allowed":"pointer"})),$e=p("div",{target:"e7fhruq1"})(({theme:e})=>({marginRight:"auto",alignItems:"center",display:"flex",gap:e.spacing.lg,minWidth:0,width:"100%"})),ce=p("span",{target:"e7fhruq2"})(({theme:e})=>({color:e.colors.darkenedBgMix100})),de=p("span",{target:"e7fhruq3"})(({theme:e,disabled:t})=>({color:t?e.colors.fadedText40:e.colors.bodyText})),je=p("span",{target:"e7fhruq4"})(({theme:e,disabled:t})=>({fontSize:e.fontSizes.sm,color:t?e.colors.fadedText40:e.colors.fadedText60,display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",maxWidth:"100%"})),Xe=p("div",{target:"e7fhruq5"})({display:"flex",flexDirection:"column",minWidth:0,maxWidth:"100%"}),Oe=p("span",{target:"e7fhruq6"})({whiteSpace:"nowrap"}),pe=p("div",{target:"e7fhruq7"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),_e=p("ul",{target:"e7fhruq8"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),ue=p("li",{target:"e7fhruq9"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),ge=p("div",{target:"e7fhruq10"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),fe=p("div",{target:"e7fhruq11"})(({theme:e,disabled:t})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t?e.colors.fadedText40:e.colors.bodyText})),he=p("div",{target:"e7fhruq12"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),Ke=p("span",{target:"e7fhruq13"})(({theme:e})=>({marginRight:e.spacing.twoXS})),Ye=p("div",{target:"e7fhruq14"})(({theme:e,disabled:t})=>({display:"flex",padding:e.spacing.twoXS,color:t?e.colors.fadedText40:e.colors.darkenedBgMix100})),Fe=p("small",{target:"e7fhruq15"})(({theme:e})=>({color:e.colors.redTextColor,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),me=p("span",{target:"e7fhruq16"})({}),Ge=e=>({[ie]:{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"auto",gap:e.spacing.sm},[ce]:{display:"none"},[de]:{marginBottom:e.spacing.twoXS},[pe]:{paddingRight:e.spacing.lg},[he]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[fe]:{width:e.sizes.full},[ge]:{flexDirection:"column"},[Fe]:{height:"auto",whiteSpace:"initial"},[me]:{display:"none"},[ue]:{margin:e.spacing.none,padding:e.spacing.none}}),Je=p("div",{target:"e7fhruq17"})(({theme:e,width:t})=>{if(t<Ue("23rem"))return Ge(e)}),Qe=({multiple:e,acceptedExtensions:t,maxSizeBytes:n,acceptDirectory:s=!1,disabled:d})=>{const x=()=>s?"directories":e?"files":"file",c=()=>t.length?` • ${t.map(y=>y.replace(/^\./,"").toUpperCase()).join(", ")}`:null,F=()=>`Limit ${oe(n,R.Byte,0)} per file`;return S($e,{"data-testid":"stFileUploaderDropzoneInstructions",children:[l(ce,{children:l(I,{content:le,size:"threeXL"})}),S(Xe,{children:[S(de,{disabled:d,children:["Drag and drop ",x()," here"]}),S(je,{disabled:d,children:[F(),c()]})]})]})},Ze=o.memo(Qe),et=({onDrop:e,multiple:t,acceptedExtensions:n,maxSizeBytes:s,disabled:d,label:x,acceptDirectory:c=!1})=>l(Ae,{onDrop:e,multiple:t,accept:Re(n),maxSize:s,disabled:d,useFsAccessApi:!1,children:({getRootProps:F,getInputProps:y})=>{const v=y({multiple:t||!!c});return S(ie,{...F(),"data-testid":"stFileUploaderDropzone",isDisabled:d,"aria-label":x,"aria-disabled":d,children:[l("input",{"data-testid":"stFileUploaderDropzoneInput",...v,...c&&{webkitdirectory:""}}),l(Ze,{multiple:t,acceptedExtensions:n,maxSizeBytes:s,acceptDirectory:c,disabled:d}),l(Oe,{children:l(V,{kind:M.SECONDARY,disabled:d,size:ve.SMALL,children:c?"Browse directories":"Browse files"})})]})}}),tt=o.memo(et),ye=p("small",{target:"e1xq3mgd0"})(({kind:e,disabled:t,theme:n})=>{const{redTextColor:s,fadedText60:d,fadedText40:x}=n.colors;let c=d;return t&&(c=x),e==="danger"&&(c=s),{color:c,fontSize:n.fontSizes.sm,lineHeight:n.lineHeights.tight}}),ot=({fileInfo:e,disabled:t})=>e.status.type==="uploading"?l(We,{value:e.status.progress,size:qe.SMALL}):e.status.type==="error"?S(Fe,{children:[l(Ke,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),l(me,{children:l(I,{content:se,size:"lg"})})]}):e.status.type==="uploaded"?l(ye,{disabled:t,children:oe(e.size,R.Byte)}):null,nt=({fileInfo:e,onDelete:t,disabled:n})=>S(he,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[l(Ye,{disabled:n,children:l(I,{content:Pe,size:"twoXL"})}),S(ge,{className:"stFileUploaderFileData",children:[l(fe,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,disabled:n,children:e.name}),l(ot,{fileInfo:e,disabled:n})]}),l("div",{"data-testid":"stFileUploaderDeleteBtn",children:l(V,{onClick:()=>t(e.id),kind:M.MINIMAL,disabled:n,"aria-label":`Remove ${e.name}`,children:l(I,{content:ae,size:"lg"})})})]}),rt=o.memo(nt),at=p("div",{target:"e1o0u1j0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),lt=p("div",{target:"e1o0u1j1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),st=({currentPage:e,totalPages:t,onNext:n,onPrevious:s})=>S(at,{"data-testid":"stFileUploaderPagination",children:[l(ye,{children:`Showing page ${e} of ${t}`}),S(lt,{children:[l(V,{onClick:s,kind:M.MINIMAL,children:l(I,{content:ne,size:"xl"})}),l(V,{onClick:n,kind:M.MINIMAL,children:l(I,{content:re,size:"xl"})})]})]}),it=o.memo(st),te=(e,t)=>Math.ceil(e.length/t),ct=e=>ze(({pageSize:n,items:s,resetOnAdd:d,...x})=>{const[c,F]=o.useState(0),[y,v]=o.useState(()=>te(s,n)),u=He(s);o.useEffect(()=>{u&&u.length!==s.length&&v(te(s,n)),u&&u.length<s.length?d&&F(0):c+1>=y&&F(y-1)},[s,c,n,u,d,y]);const E=()=>{F(Math.min(c+1,y-1))},z=()=>{F(Math.max(0,c-1))},A=s.slice(c*n,c*n+n);return S(be,{children:[l(e,{items:A,...x}),s.length>n?l(it,{pageSize:n,totalPages:y,currentPage:c+1,onNext:E,onPrevious:z}):null]})},e),dt=({items:e,onDelete:t,disabled:n})=>l(_e,{children:e.map(s=>l(ue,{children:l(rt,{fileInfo:s,onDelete:t,disabled:n})},s.id))}),pt=ct(dt),ut=e=>l(pe,{children:l(pt,{...e})}),gt=o.memo(ut),ft=(e,t)=>{const n=t.getFileUploaderStateValue(e);if(D(n))return{files:[],nextLocalId:1};const{uploadedFileInfo:s}=n;if(D(s)||s.length===0)return{files:[],nextLocalId:1};let d=1;return{files:s.map(c=>{const F=c.name,y=c.size,v=c.fileId,u=c.fileUrls,E=new $(F,y,d,{type:"uploaded",fileId:v,fileUrls:u});return d+=1,E}),nextLocalId:d}},H=e=>{const t=e.filter(n=>n.status.type==="uploaded").map(n=>{const{name:s,size:d,status:x}=n,{fileId:c,fileUrls:F}=x;return new ke({fileId:c,fileUrls:F,name:s,size:d})});return new Ve({uploadedFileInfo:t})},ht=({disabled:e,element:t,widgetMgr:n,uploadClient:s,fragmentId:d})=>{const{width:x,elementRef:c}=Ce(),{files:F,nextLocalId:y}=o.useMemo(()=>ft(t,n),[t,n]),v=o.useRef(y),[u,E]=o.useState(()=>F),z=o.useRef(u);o.useEffect(()=>{z.current=u},[u]);const[A,j]=o.useState(!1),B=o.useCallback(()=>{const r=v.current;return v.current+=1,r},[]),P=o.useMemo(()=>{const r=t.maxUploadSizeMb;return Ne(r,R.Megabyte,R.Byte)},[t.maxUploadSizeMb]),U=o.useCallback(r=>{ee.flushSync(()=>{E(a=>{const i=typeof r=="function"?r(a):r;return z.current=i,i})})},[]),N=o.useCallback(r=>{ee.flushSync(()=>{j(r)})},[j]),X=o.useCallback(r=>{U(a=>[...a,r])},[U]),T=o.useCallback(r=>{r.length!==0&&U(a=>[...a,...r])},[U]),O=o.useCallback(r=>{U(a=>a.filter(i=>i.id!==r))},[U]),b=o.useCallback((r,a)=>{U(i=>i.map(g=>g.id===r?a:g))},[U]),C=o.useCallback(r=>z.current.find(a=>a.id===r),[]),_=u.some(r=>r.status.type==="uploading")||A?"updating":"ready";o.useEffect(()=>{n.getFileUploaderStateValue(t)===void 0&&n.setFileUploaderStateValue(t,H(z.current),{fromUi:!1},d)},[n,t,d]),o.useEffect(()=>{if(_!=="ready")return;const r=H(u),a=n.getFileUploaderStateValue(t);Ie(r,a)||n.setFileUploaderStateValue(t,r,{fromUi:!0},d)},[_,u,n,t,d]);const xe=o.useCallback(()=>{U(()=>[]);const r=H([]);n.setFileUploaderStateValue(t,r,{fromUi:!0},d)},[t,d,U,n]);Me({element:t,widgetMgr:n,onFormCleared:xe});const K=o.useCallback(r=>{const a=t.type;if(!a||a.length===0)return!0;const i=r.name.toLowerCase();return a.some(g=>i.endsWith(g.toLowerCase()))},[t.type]),Y=o.useCallback(r=>{const a=[],i=[];return r.forEach(g=>{K(g)?a.push(g):i.push({file:g,errors:[{code:"file-invalid-type",message:`${g.type} files are not allowed.`}]})}),{accepted:a,rejected:i}},[K]),G=o.useCallback((r,a)=>{const i=C(r);D(i)||i.status.type!=="uploading"||b(i.id,i.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}))},[C,b]),J=o.useCallback((r,a)=>{const i=C(a);if(D(i)||i.status.type!=="uploading")return;const g=Math.round(r.loaded*100/r.total);i.status.progress!==g&&b(a,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:g}))},[C,b]),Q=o.useCallback((r,a)=>{const i=new AbortController,g=a.webkitRelativePath||a.name,f=new $(g,a.size,B(),{type:"uploading",abortController:i,progress:1});X(f),s.uploadFile(t,r.uploadUrl,a,h=>J(h,f.id),i.signal).then(()=>G(f.id,r)).catch(h=>{h instanceof DOMException&&h.name==="AbortError"||b(f.id,f.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},[X,t,B,G,J,b,s]),q=o.useCallback(r=>{if(e)return;const a=C(r);D(a)||(a.status.type==="uploading"&&a.status.abortController.abort(),a.status.type==="uploaded"&&a.status.fileUrls.deleteUrl&&s.deleteFile(a.status.fileUrls.deleteUrl),O(r))},[e,C,O,s]),Se=o.useCallback((r,a)=>{const{multipleFiles:i}=t,g=!!t.acceptDirectory;let f=[...r],h=[...a];if(g&&f.length>0){const{accepted:w,rejected:m}=Y(f);f=w,h=[...h,...m]}if(!i&&f.length===0&&h.length>1){const w=h.findIndex(m=>m.errors.length===1&&m.errors[0].code==="too-many-files");w>=0&&(f.push(h[w].file),h.splice(w,1))}if(s.fetchFileURLs(f).then(w=>{if(!i&&f.length>0){const m=z.current.find(W=>W.status.type!=="error");if(m){N(!0);try{q(m.id)}finally{N(!1)}}}Ee(w,f).forEach(([m,W])=>{Q(m,W)})}).catch(w=>{T(f.map(m=>new $(m.name,m.size,B(),{type:"error",errorMessage:w})))}),h.length>0){const w=h.map(m=>Te(m,B(),P));T(w)}},[T,q,t,Y,P,B,s,Q,N]),Z=o.useMemo(()=>u.slice().reverse(),[u]),we=t.type;return S(Je,{className:"stFileUploader","data-testid":"stFileUploader",width:x,ref:c,children:[l(Le,{label:t.label,disabled:e,labelVisibility:Be(t.labelVisibility?.value),children:t.help&&l(De,{content:t.help,label:t.label})}),l(tt,{onDrop:Se,multiple:t.multipleFiles,acceptedExtensions:we,maxSizeBytes:P,label:t.label,disabled:e,acceptDirectory:!!t.acceptDirectory}),Z.length>0&&l(gt,{items:Z,pageSize:3,onDelete:q,resetOnAdd:!0,disabled:e})]})},wt=o.memo(ht);export{wt as default};
1
+ import{r as o,E as L,_ as k,F as p,ab as Ue,o as S,j as l,az as I,b as V,c as ve,B as M,h as ze,a0 as be,k as Ce,al as ee,bj as Ie,e as D,bX as Ee,p as Be,ac as De,ad as Le,bS as ke,bT as Ve}from"./index.CXVpBAvU.js";import{u as Me}from"./FormClearHelper.D4lty7rT.js";import{g as oe,F as R,a as Re,D as Ae,I as Pe,s as Ne,b as Te}from"./FileHelper.BOHlwlc9.js";import{S as qe,P as We}from"./ProgressBar.DCHh4N3P.js";import{U as $}from"./UploadFileInfo.Dr-zDST7.js";const He=e=>{const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current};var ne=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});ne.displayName="ChevronLeft";var re=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});re.displayName="ChevronRight";var ae=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))});ae.displayName="Clear";var le=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});le.displayName="CloudUpload";var se=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});se.displayName="Error";const ie=p("section",{target:"e7fhruq0"})(({isDisabled:e,theme:t})=>({display:"flex",gap:t.spacing.lg,alignItems:"center",padding:t.spacing.lg,backgroundColor:t.colors.secondaryBg,borderRadius:t.radii.default,border:t.colors.widgetBorderColor?`${t.sizes.borderWidth} solid ${t.colors.widgetBorderColor}`:void 0,height:t.sizes.largestElementHeight,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${t.colors.primary}`},cursor:e?"not-allowed":"pointer"})),$e=p("div",{target:"e7fhruq1"})(({theme:e})=>({marginRight:"auto",alignItems:"center",display:"flex",gap:e.spacing.lg,minWidth:0,width:"100%"})),ce=p("span",{target:"e7fhruq2"})(({theme:e})=>({color:e.colors.darkenedBgMix100})),de=p("span",{target:"e7fhruq3"})(({theme:e,disabled:t})=>({color:t?e.colors.fadedText40:e.colors.bodyText})),je=p("span",{target:"e7fhruq4"})(({theme:e,disabled:t})=>({fontSize:e.fontSizes.sm,color:t?e.colors.fadedText40:e.colors.fadedText60,display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",maxWidth:"100%"})),Xe=p("div",{target:"e7fhruq5"})({display:"flex",flexDirection:"column",minWidth:0,maxWidth:"100%"}),Oe=p("span",{target:"e7fhruq6"})({whiteSpace:"nowrap"}),pe=p("div",{target:"e7fhruq7"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),_e=p("ul",{target:"e7fhruq8"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),ue=p("li",{target:"e7fhruq9"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),ge=p("div",{target:"e7fhruq10"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),fe=p("div",{target:"e7fhruq11"})(({theme:e,disabled:t})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t?e.colors.fadedText40:e.colors.bodyText})),he=p("div",{target:"e7fhruq12"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),Ke=p("span",{target:"e7fhruq13"})(({theme:e})=>({marginRight:e.spacing.twoXS})),Ye=p("div",{target:"e7fhruq14"})(({theme:e,disabled:t})=>({display:"flex",padding:e.spacing.twoXS,color:t?e.colors.fadedText40:e.colors.darkenedBgMix100})),Fe=p("small",{target:"e7fhruq15"})(({theme:e})=>({color:e.colors.redTextColor,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),me=p("span",{target:"e7fhruq16"})({}),Ge=e=>({[ie]:{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"auto",gap:e.spacing.sm},[ce]:{display:"none"},[de]:{marginBottom:e.spacing.twoXS},[pe]:{paddingRight:e.spacing.lg},[he]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[fe]:{width:e.sizes.full},[ge]:{flexDirection:"column"},[Fe]:{height:"auto",whiteSpace:"initial"},[me]:{display:"none"},[ue]:{margin:e.spacing.none,padding:e.spacing.none}}),Je=p("div",{target:"e7fhruq17"})(({theme:e,width:t})=>{if(t<Ue("23rem"))return Ge(e)}),Qe=({multiple:e,acceptedExtensions:t,maxSizeBytes:n,acceptDirectory:s=!1,disabled:d})=>{const x=()=>s?"directories":e?"files":"file",c=()=>t.length?` • ${t.map(y=>y.replace(/^\./,"").toUpperCase()).join(", ")}`:null,F=()=>`Limit ${oe(n,R.Byte,0)} per file`;return S($e,{"data-testid":"stFileUploaderDropzoneInstructions",children:[l(ce,{children:l(I,{content:le,size:"threeXL"})}),S(Xe,{children:[S(de,{disabled:d,children:["Drag and drop ",x()," here"]}),S(je,{disabled:d,children:[F(),c()]})]})]})},Ze=o.memo(Qe),et=({onDrop:e,multiple:t,acceptedExtensions:n,maxSizeBytes:s,disabled:d,label:x,acceptDirectory:c=!1})=>l(Ae,{onDrop:e,multiple:t,accept:Re(n),maxSize:s,disabled:d,useFsAccessApi:!1,children:({getRootProps:F,getInputProps:y})=>{const v=y({multiple:t||!!c});return S(ie,{...F(),"data-testid":"stFileUploaderDropzone",isDisabled:d,"aria-label":x,"aria-disabled":d,children:[l("input",{"data-testid":"stFileUploaderDropzoneInput",...v,...c&&{webkitdirectory:""}}),l(Ze,{multiple:t,acceptedExtensions:n,maxSizeBytes:s,acceptDirectory:c,disabled:d}),l(Oe,{children:l(V,{kind:M.SECONDARY,disabled:d,size:ve.SMALL,children:c?"Browse directories":"Browse files"})})]})}}),tt=o.memo(et),ye=p("small",{target:"e1xq3mgd0"})(({kind:e,disabled:t,theme:n})=>{const{redTextColor:s,fadedText60:d,fadedText40:x}=n.colors;let c=d;return t&&(c=x),e==="danger"&&(c=s),{color:c,fontSize:n.fontSizes.sm,lineHeight:n.lineHeights.tight}}),ot=({fileInfo:e,disabled:t})=>e.status.type==="uploading"?l(We,{value:e.status.progress,size:qe.SMALL}):e.status.type==="error"?S(Fe,{children:[l(Ke,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),l(me,{children:l(I,{content:se,size:"lg"})})]}):e.status.type==="uploaded"?l(ye,{disabled:t,children:oe(e.size,R.Byte)}):null,nt=({fileInfo:e,onDelete:t,disabled:n})=>S(he,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[l(Ye,{disabled:n,children:l(I,{content:Pe,size:"twoXL"})}),S(ge,{className:"stFileUploaderFileData",children:[l(fe,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,disabled:n,children:e.name}),l(ot,{fileInfo:e,disabled:n})]}),l("div",{"data-testid":"stFileUploaderDeleteBtn",children:l(V,{onClick:()=>t(e.id),kind:M.MINIMAL,disabled:n,"aria-label":`Remove ${e.name}`,children:l(I,{content:ae,size:"lg"})})})]}),rt=o.memo(nt),at=p("div",{target:"e1o0u1j0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),lt=p("div",{target:"e1o0u1j1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),st=({currentPage:e,totalPages:t,onNext:n,onPrevious:s})=>S(at,{"data-testid":"stFileUploaderPagination",children:[l(ye,{children:`Showing page ${e} of ${t}`}),S(lt,{children:[l(V,{onClick:s,kind:M.MINIMAL,children:l(I,{content:ne,size:"xl"})}),l(V,{onClick:n,kind:M.MINIMAL,children:l(I,{content:re,size:"xl"})})]})]}),it=o.memo(st),te=(e,t)=>Math.ceil(e.length/t),ct=e=>ze(({pageSize:n,items:s,resetOnAdd:d,...x})=>{const[c,F]=o.useState(0),[y,v]=o.useState(()=>te(s,n)),u=He(s);o.useEffect(()=>{u&&u.length!==s.length&&v(te(s,n)),u&&u.length<s.length?d&&F(0):c+1>=y&&F(y-1)},[s,c,n,u,d,y]);const E=()=>{F(Math.min(c+1,y-1))},z=()=>{F(Math.max(0,c-1))},A=s.slice(c*n,c*n+n);return S(be,{children:[l(e,{items:A,...x}),s.length>n?l(it,{pageSize:n,totalPages:y,currentPage:c+1,onNext:E,onPrevious:z}):null]})},e),dt=({items:e,onDelete:t,disabled:n})=>l(_e,{children:e.map(s=>l(ue,{children:l(rt,{fileInfo:s,onDelete:t,disabled:n})},s.id))}),pt=ct(dt),ut=e=>l(pe,{children:l(pt,{...e})}),gt=o.memo(ut),ft=(e,t)=>{const n=t.getFileUploaderStateValue(e);if(D(n))return{files:[],nextLocalId:1};const{uploadedFileInfo:s}=n;if(D(s)||s.length===0)return{files:[],nextLocalId:1};let d=1;return{files:s.map(c=>{const F=c.name,y=c.size,v=c.fileId,u=c.fileUrls,E=new $(F,y,d,{type:"uploaded",fileId:v,fileUrls:u});return d+=1,E}),nextLocalId:d}},H=e=>{const t=e.filter(n=>n.status.type==="uploaded").map(n=>{const{name:s,size:d,status:x}=n,{fileId:c,fileUrls:F}=x;return new ke({fileId:c,fileUrls:F,name:s,size:d})});return new Ve({uploadedFileInfo:t})},ht=({disabled:e,element:t,widgetMgr:n,uploadClient:s,fragmentId:d})=>{const{width:x,elementRef:c}=Ce(),{files:F,nextLocalId:y}=o.useMemo(()=>ft(t,n),[t,n]),v=o.useRef(y),[u,E]=o.useState(()=>F),z=o.useRef(u);o.useEffect(()=>{z.current=u},[u]);const[A,j]=o.useState(!1),B=o.useCallback(()=>{const r=v.current;return v.current+=1,r},[]),P=o.useMemo(()=>{const r=t.maxUploadSizeMb;return Ne(r,R.Megabyte,R.Byte)},[t.maxUploadSizeMb]),U=o.useCallback(r=>{ee.flushSync(()=>{E(a=>{const i=typeof r=="function"?r(a):r;return z.current=i,i})})},[]),N=o.useCallback(r=>{ee.flushSync(()=>{j(r)})},[j]),X=o.useCallback(r=>{U(a=>[...a,r])},[U]),T=o.useCallback(r=>{r.length!==0&&U(a=>[...a,...r])},[U]),O=o.useCallback(r=>{U(a=>a.filter(i=>i.id!==r))},[U]),b=o.useCallback((r,a)=>{U(i=>i.map(g=>g.id===r?a:g))},[U]),C=o.useCallback(r=>z.current.find(a=>a.id===r),[]),_=u.some(r=>r.status.type==="uploading")||A?"updating":"ready";o.useEffect(()=>{n.getFileUploaderStateValue(t)===void 0&&n.setFileUploaderStateValue(t,H(z.current),{fromUi:!1},d)},[n,t,d]),o.useEffect(()=>{if(_!=="ready")return;const r=H(u),a=n.getFileUploaderStateValue(t);Ie(r,a)||n.setFileUploaderStateValue(t,r,{fromUi:!0},d)},[_,u,n,t,d]);const xe=o.useCallback(()=>{U(()=>[]);const r=H([]);n.setFileUploaderStateValue(t,r,{fromUi:!0},d)},[t,d,U,n]);Me({element:t,widgetMgr:n,onFormCleared:xe});const K=o.useCallback(r=>{const a=t.type;if(!a||a.length===0)return!0;const i=r.name.toLowerCase();return a.some(g=>i.endsWith(g.toLowerCase()))},[t.type]),Y=o.useCallback(r=>{const a=[],i=[];return r.forEach(g=>{K(g)?a.push(g):i.push({file:g,errors:[{code:"file-invalid-type",message:`${g.type} files are not allowed.`}]})}),{accepted:a,rejected:i}},[K]),G=o.useCallback((r,a)=>{const i=C(r);D(i)||i.status.type!=="uploading"||b(i.id,i.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}))},[C,b]),J=o.useCallback((r,a)=>{const i=C(a);if(D(i)||i.status.type!=="uploading")return;const g=Math.round(r.loaded*100/r.total);i.status.progress!==g&&b(a,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:g}))},[C,b]),Q=o.useCallback((r,a)=>{const i=new AbortController,g=a.webkitRelativePath||a.name,f=new $(g,a.size,B(),{type:"uploading",abortController:i,progress:1});X(f),s.uploadFile(t,r.uploadUrl,a,h=>J(h,f.id),i.signal).then(()=>G(f.id,r)).catch(h=>{h instanceof DOMException&&h.name==="AbortError"||b(f.id,f.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},[X,t,B,G,J,b,s]),q=o.useCallback(r=>{if(e)return;const a=C(r);D(a)||(a.status.type==="uploading"&&a.status.abortController.abort(),a.status.type==="uploaded"&&a.status.fileUrls.deleteUrl&&s.deleteFile(a.status.fileUrls.deleteUrl),O(r))},[e,C,O,s]),Se=o.useCallback((r,a)=>{const{multipleFiles:i}=t,g=!!t.acceptDirectory;let f=[...r],h=[...a];if(g&&f.length>0){const{accepted:w,rejected:m}=Y(f);f=w,h=[...h,...m]}if(!i&&f.length===0&&h.length>1){const w=h.findIndex(m=>m.errors.length===1&&m.errors[0].code==="too-many-files");w>=0&&(f.push(h[w].file),h.splice(w,1))}if(s.fetchFileURLs(f).then(w=>{if(!i&&f.length>0){const m=z.current.find(W=>W.status.type!=="error");if(m){N(!0);try{q(m.id)}finally{N(!1)}}}Ee(w,f).forEach(([m,W])=>{Q(m,W)})}).catch(w=>{T(f.map(m=>new $(m.name,m.size,B(),{type:"error",errorMessage:w})))}),h.length>0){const w=h.map(m=>Te(m,B(),P));T(w)}},[T,q,t,Y,P,B,s,Q,N]),Z=o.useMemo(()=>u.slice().reverse(),[u]),we=t.type;return S(Je,{className:"stFileUploader","data-testid":"stFileUploader",width:x,ref:c,children:[l(Le,{label:t.label,disabled:e,labelVisibility:Be(t.labelVisibility?.value),children:t.help&&l(De,{content:t.help,label:t.label})}),l(tt,{onDrop:Se,multiple:t.multipleFiles,acceptedExtensions:we,maxSizeBytes:P,label:t.label,disabled:e,acceptDirectory:!!t.acceptDirectory}),Z.length>0&&l(gt,{items:Z,pageSize:3,onDelete:q,resetOnAdd:!0,disabled:e})]})},wt=o.memo(ht);export{wt as default};
@@ -1 +1 @@
1
- import{F as e,r as a,o as t,j as r,q as o}from"./index.BRfGUOQ-.js";import{P as i}from"./ProgressBar.BiYsyZCC.js";const l=e("div",{target:"e1jwj65h0"})(({theme:s})=>({paddingBottom:s.spacing.sm,lineHeight:"normal"}));function n({element:s}){return t("div",{className:"stProgress","data-testid":"stProgress",children:[r(l,{children:r(o,{source:s.text,allowHTML:!1,isLabel:!0})}),r(i,{value:s.value})]})}const m=a.memo(n);export{m as default};
1
+ import{F as e,r as a,o as t,j as r,q as o}from"./index.CXVpBAvU.js";import{P as i}from"./ProgressBar.DCHh4N3P.js";const l=e("div",{target:"e1jwj65h0"})(({theme:s})=>({paddingBottom:s.spacing.sm,lineHeight:"normal"}));function n({element:s}){return t("div",{className:"stProgress","data-testid":"stProgress",children:[r(l,{children:r(o,{source:s.text,allowHTML:!1,isLabel:!0})}),r(i,{value:s.value})]})}const m=a.memo(n);export{m as default};
@@ -1 +1 @@
1
- import{r as u,B as n,u as d,j as o,a as B,b as m,c as h,D as p,d as f}from"./index.BRfGUOQ-.js";import{m as g}from"./iconPosition.Q3hNvmK4.js";function b(l){const{disabled:e,element:t,widgetMgr:s,fragmentId:a}=l,r=t.shortcut?t.shortcut:void 0;let i=n.SECONDARY;t.type==="primary"?i=n.PRIMARY:t.type==="tertiary"&&(i=n.TERTIARY);const c=u.useCallback(()=>{e||s.setTriggerValue(t,{fromUi:!0},a)},[e,s,t,a]);return d({shortcut:r,disabled:e,onActivate:c}),o(f,{className:"stButton","data-testid":"stButton",children:o(B,{help:t.help,containerWidth:!0,children:o(m,{kind:i,size:h.SMALL,disabled:e,containerWidth:!0,onClick:c,children:o(p,{icon:t.icon,iconPosition:g(t.iconPosition),label:t.label,shortcut:r})})})})}const A=u.memo(b);export{A as default};
1
+ import{r as u,B as n,u as d,j as o,a as B,b as m,c as h,D as p,d as f}from"./index.CXVpBAvU.js";import{m as g}from"./iconPosition.DPAvXTmd.js";function b(l){const{disabled:e,element:t,widgetMgr:s,fragmentId:a}=l,r=t.shortcut?t.shortcut:void 0;let i=n.SECONDARY;t.type==="primary"?i=n.PRIMARY:t.type==="tertiary"&&(i=n.TERTIARY);const c=u.useCallback(()=>{e||s.setTriggerValue(t,{fromUi:!0},a)},[e,s,t,a]);return d({shortcut:r,disabled:e,onActivate:c}),o(f,{className:"stButton","data-testid":"stButton",children:o(B,{help:t.help,containerWidth:!0,children:o(m,{kind:i,size:h.SMALL,disabled:e,containerWidth:!0,onClick:c,children:o(p,{icon:t.icon,iconPosition:g(t.iconPosition),label:t.label,shortcut:r})})})})}const A=u.memo(b);export{A as default};
@@ -1 +1 @@
1
- import{F as D,r as a,k as P,l as U,aa as S,ab as j,o as H,j as l,p as q,ac as K,ad as O,ae as _,af as $,Z as w,ag as A}from"./index.BRfGUOQ-.js";import{I as N}from"./InputInstructions.sxc3InCI.js";import{u as Z}from"./useBasicWidgetState.A4U5lzAm.js";import{u as G,a as J,b as M}from"./useUpdateUiValue.BkOWyNVX.js";import{u as Q}from"./uniqueId.BFHzT5KQ.js";import{I as X}from"./input.CPzINTl-.js";import"./FormClearHelper.C-6BC487.js";import"./inputUtils.CptNuJwn.js";import"./base-input.Gf1cKuQR.js";const Y=D("div",{target:"eiqkja70"})("position:relative;");function tt({disabled:o,element:t,widgetMgr:s,fragmentId:u}){const[r,p]=a.useState(()=>W(s,t)??null),{width:T,elementRef:x}=P(),[i,m]=a.useState(!1),y=a.useCallback(()=>{p(t.default??null),m(!0)},[t.default]),[C,h]=Z({getStateFromWidgetMgr:W,getDefaultStateFromProto:et,getCurrStateFromProto:ot,updateWidgetMgrState:at,element:t,widgetMgr:s,fragmentId:u,onFormCleared:y});G(C,r,p,i);const[V,f]=a.useState(!1),e=U(),[b]=a.useState(()=>Q("text_input_")),{placeholder:F,formId:n,icon:d,maxChars:I}=t,g=a.useCallback(()=>{m(!1),h({value:r,fromUi:!0})},[r,h]),v=S({formId:n})?s.allowFormEnterToSubmit(n):i,E=V&&T>j(e.breakpoints.hideWidgetDetails),R=a.useCallback(()=>{i&&g(),f(!1)},[i,g]),L=a.useCallback(()=>{f(!0)},[]),k=J({formId:n,maxChars:I,setDirty:m,setUiValue:p,setValueWithSource:h}),z=M(n,g,i,s,u);return H(Y,{className:"stTextInput","data-testid":"stTextInput",ref:x,children:[l(O,{label:t.label,disabled:o,labelVisibility:q(t.labelVisibility?.value),htmlFor:b,children:t.help&&l(K,{content:t.help,label:t.label})}),l(X,{value:r??"",placeholder:F,onBlur:R,onFocus:L,onChange:k,onKeyPress:z,"aria-label":t.label,disabled:o,id:b,type:st(t),autoComplete:t.autocomplete,startEnhancer:d&&l(w,{"data-testid":"stTextInputIcon",iconValue:d,size:"lg"}),overrides:{Input:{style:{fontWeight:e.fontWeights.normal,minWidth:0,lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:e.spacing.md,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,"::placeholder":{color:e.colors.fadedText60}}},Root:{props:{"data-testid":"stTextInputRootElement"},style:({$isFocused:B})=>{const c=$(e.colors,B);return{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,borderTopColor:c,borderRightColor:c,borderBottomColor:c,borderLeftColor:c,paddingLeft:d?e.spacing.sm:0}}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:e.iconSizes.lg,color:_(d)?e.colors.fadedText60:"inherit"}}}}),E&&l(N,{dirty:i,value:r??"",maxLength:I,inForm:S({formId:n}),allowEnterToSubmit:v})]})}function W(o,t){return o.getStringValue(t)??null}function et(o){return o.default??null}function ot(o){return o.value??null}function at(o,t,s,u){t.setStringValue(o,s.value,{fromUi:s.fromUi},u)}function st(o){return o.type===A.Type.PASSWORD?"password":"text"}const ht=a.memo(tt);export{ht as default};
1
+ import{F as D,r as a,k as P,l as U,aa as S,ab as j,o as H,j as l,p as q,ac as K,ad as O,ae as _,af as $,Z as w,ag as A}from"./index.CXVpBAvU.js";import{I as N}from"./InputInstructions.BWw9lhud.js";import{u as Z}from"./useBasicWidgetState.D-fc_aIL.js";import{u as G,a as J,b as M}from"./useUpdateUiValue.CDQloDgB.js";import{u as Q}from"./uniqueId.PRn3V1WU.js";import{I as X}from"./input.CYXuTqoa.js";import"./FormClearHelper.D4lty7rT.js";import"./inputUtils.CptNuJwn.js";import"./base-input.Cg7NpsfS.js";const Y=D("div",{target:"eiqkja70"})("position:relative;");function tt({disabled:o,element:t,widgetMgr:s,fragmentId:u}){const[r,p]=a.useState(()=>W(s,t)??null),{width:T,elementRef:x}=P(),[i,m]=a.useState(!1),y=a.useCallback(()=>{p(t.default??null),m(!0)},[t.default]),[C,h]=Z({getStateFromWidgetMgr:W,getDefaultStateFromProto:et,getCurrStateFromProto:ot,updateWidgetMgrState:at,element:t,widgetMgr:s,fragmentId:u,onFormCleared:y});G(C,r,p,i);const[V,f]=a.useState(!1),e=U(),[b]=a.useState(()=>Q("text_input_")),{placeholder:F,formId:n,icon:d,maxChars:I}=t,g=a.useCallback(()=>{m(!1),h({value:r,fromUi:!0})},[r,h]),v=S({formId:n})?s.allowFormEnterToSubmit(n):i,E=V&&T>j(e.breakpoints.hideWidgetDetails),R=a.useCallback(()=>{i&&g(),f(!1)},[i,g]),L=a.useCallback(()=>{f(!0)},[]),k=J({formId:n,maxChars:I,setDirty:m,setUiValue:p,setValueWithSource:h}),z=M(n,g,i,s,u);return H(Y,{className:"stTextInput","data-testid":"stTextInput",ref:x,children:[l(O,{label:t.label,disabled:o,labelVisibility:q(t.labelVisibility?.value),htmlFor:b,children:t.help&&l(K,{content:t.help,label:t.label})}),l(X,{value:r??"",placeholder:F,onBlur:R,onFocus:L,onChange:k,onKeyPress:z,"aria-label":t.label,disabled:o,id:b,type:st(t),autoComplete:t.autocomplete,startEnhancer:d&&l(w,{"data-testid":"stTextInputIcon",iconValue:d,size:"lg"}),overrides:{Input:{style:{fontWeight:e.fontWeights.normal,minWidth:0,lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:e.spacing.md,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,"::placeholder":{color:e.colors.fadedText60}}},Root:{props:{"data-testid":"stTextInputRootElement"},style:({$isFocused:B})=>{const c=$(e.colors,B);return{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,borderTopColor:c,borderRightColor:c,borderBottomColor:c,borderLeftColor:c,paddingLeft:d?e.spacing.sm:0}}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:e.iconSizes.lg,color:_(d)?e.colors.fadedText60:"inherit"}}}}),E&&l(N,{dirty:i,value:r??"",maxLength:I,inForm:S({formId:n}),allowEnterToSubmit:v})]})}function W(o,t){return o.getStringValue(t)??null}function et(o){return o.default??null}function ot(o){return o.value??null}function at(o,t,s,u){t.setStringValue(o,s.value,{fromUi:s.fromUi},u)}function st(o){return o.type===A.Type.PASSWORD?"password":"text"}const ht=a.memo(tt);export{ht as default};
@@ -1 +1 @@
1
- import{F as c,ai as d,aj as C,c as t,r as a,B as l,j as n,u as x,a as S,D as L,d as $}from"./index.BRfGUOQ-.js";import{m as R}from"./iconPosition.Q3hNvmK4.js";function T(o,r){switch(o){case t.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case t.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case t.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const f=c("a",{target:"e8hm1sp0"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.button,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:C(i)},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...T(r,i)})),w=c(f,{target:"e8hm1sp1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover, &:focus-visible":{backgroundColor:d(o.colors.primary,.15),borderColor:d(o.colors.primary,.15)},"&:active":{backgroundColor:o.colors.primary,borderColor:d(o.colors.primary,.15)},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),A=c(f,{target:"e8hm1sp2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),z=c(f,{target:"e8hm1sp3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{color:o.colors.primary},"&:hover:not([disabled]), &:focus-visible:not([disabled])":{"span.stMarkdownColoredText":{color:"inherit !important"}},"&:active":{color:d(o.colors.primary,.25)},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),y=a.forwardRef(function({kind:r,size:i,disabled:s,children:e,autoFocus:u,href:b,rel:p,target:B,onClick:k},v){let g=w;return r===l.SECONDARY?g=A:r===l.TERTIARY&&(g=z),n(g,{ref:v,kind:r,size:i||t.MEDIUM,containerWidth:!0,disabled:s||!1,autoFocus:u||!1,href:b,target:B,rel:p,onClick:k,tabIndex:s?-1:0,"data-testid":`stBaseLinkButton-${r}`,children:e})});y.displayName="BaseLinkButton";const D=a.memo(y);function M(o){const{element:r}=o,i=r.shortcut?r.shortcut:void 0;let s=l.SECONDARY;r.type==="primary"?s=l.PRIMARY:r.type==="tertiary"&&(s=l.TERTIARY);const e=a.useRef(null),u=a.useCallback(()=>{r.disabled||e.current?.click()},[r.disabled]),b=a.useCallback(p=>{r.disabled&&p.preventDefault()},[r.disabled]);return x({shortcut:i,disabled:r.disabled,onActivate:u}),n($,{className:"stLinkButton","data-testid":"stLinkButton",children:n(S,{help:r.help,containerWidth:!0,children:n(D,{ref:e,kind:s,size:t.SMALL,disabled:r.disabled,onClick:b,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:n(L,{icon:r.icon,iconPosition:R(r.iconPosition),label:r.label,shortcut:i})})})})}const P=a.memo(M);export{P as default};
1
+ import{F as c,ai as d,aj as C,c as t,r as a,B as l,j as n,u as x,a as S,D as L,d as $}from"./index.CXVpBAvU.js";import{m as R}from"./iconPosition.DPAvXTmd.js";function T(o,r){switch(o){case t.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case t.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case t.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const f=c("a",{target:"e8hm1sp0"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.button,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:C(i)},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...T(r,i)})),w=c(f,{target:"e8hm1sp1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover, &:focus-visible":{backgroundColor:d(o.colors.primary,.15),borderColor:d(o.colors.primary,.15)},"&:active":{backgroundColor:o.colors.primary,borderColor:d(o.colors.primary,.15)},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),A=c(f,{target:"e8hm1sp2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),z=c(f,{target:"e8hm1sp3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{color:o.colors.primary},"&:hover:not([disabled]), &:focus-visible:not([disabled])":{"span.stMarkdownColoredText":{color:"inherit !important"}},"&:active":{color:d(o.colors.primary,.25)},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),y=a.forwardRef(function({kind:r,size:i,disabled:s,children:e,autoFocus:u,href:b,rel:p,target:B,onClick:k},v){let g=w;return r===l.SECONDARY?g=A:r===l.TERTIARY&&(g=z),n(g,{ref:v,kind:r,size:i||t.MEDIUM,containerWidth:!0,disabled:s||!1,autoFocus:u||!1,href:b,target:B,rel:p,onClick:k,tabIndex:s?-1:0,"data-testid":`stBaseLinkButton-${r}`,children:e})});y.displayName="BaseLinkButton";const D=a.memo(y);function M(o){const{element:r}=o,i=r.shortcut?r.shortcut:void 0;let s=l.SECONDARY;r.type==="primary"?s=l.PRIMARY:r.type==="tertiary"&&(s=l.TERTIARY);const e=a.useRef(null),u=a.useCallback(()=>{r.disabled||e.current?.click()},[r.disabled]),b=a.useCallback(p=>{r.disabled&&p.preventDefault()},[r.disabled]);return x({shortcut:i,disabled:r.disabled,onActivate:u}),n($,{className:"stLinkButton","data-testid":"stLinkButton",children:n(S,{help:r.help,containerWidth:!0,children:n(D,{ref:e,kind:s,size:t.SMALL,disabled:r.disabled,onClick:b,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:n(L,{icon:r.icon,iconPosition:R(r.iconPosition),label:r.label,shortcut:i})})})})}const P=a.memo(M);export{P as default};
@@ -1 +1 @@
1
- import{F as f,r as o,V as g,j as l,W as v}from"./index.BRfGUOQ-.js";const T=f("div",{target:"e1z085g90"})(()=>({lineHeight:0})),y=f("audio",{target:"e1z085g91"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0})),h=v.getLogger("Audio");function L({element:t,endpoints:a,elementMgr:s}){const i=o.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=t,E=o.useMemo(()=>{if(!t.id)return!0;const e=s.getElementState(t.id,"preventAutoplay");return e||s.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,s]);o.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),o.useEffect(()=>{const e=i.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),o.useEffect(()=>{const e=i.current;if(!e)return;let r=!1;const c=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):r||(r=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,u,n]),o.useEffect(()=>{const e=i.current;if(!e)return;const r=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[u,n]);const m=g(t.url),A=a.buildMediaURL(t.url);return l(T,{children:l(y,{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!E,src:A,onError:e=>{const r=e.currentTarget.src;h.error(`Client Error: Audio source error - ${r}`),a.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",r)},crossOrigin:m})})}const C=o.memo(L);export{C as default};
1
+ import{F as f,r as o,V as g,j as l,W as v}from"./index.CXVpBAvU.js";const T=f("div",{target:"e1z085g90"})(()=>({lineHeight:0})),y=f("audio",{target:"e1z085g91"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0})),h=v.getLogger("Audio");function L({element:t,endpoints:a,elementMgr:s}){const i=o.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=t,E=o.useMemo(()=>{if(!t.id)return!0;const e=s.getElementState(t.id,"preventAutoplay");return e||s.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,s]);o.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),o.useEffect(()=>{const e=i.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),o.useEffect(()=>{const e=i.current;if(!e)return;let r=!1;const c=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):r||(r=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,u,n]),o.useEffect(()=>{const e=i.current;if(!e)return;const r=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[u,n]);const m=g(t.url),A=a.buildMediaURL(t.url);return l(T,{children:l(y,{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!E,src:A,onError:e=>{const r=e.currentTarget.src;h.error(`Client Error: Audio source error - ${r}`),a.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",r)},crossOrigin:m})})}const C=o.memo(L);export{C as default};
@@ -1,2 +1,2 @@
1
- import{ao as q,x as J,r as c,b9 as Q,l as Y,ba as ee,bb as l,j as L,o as te,p as re,P as ne,bc as oe,ad as ie,bd as ae,b as ue,B as C,c as x,D as le}from"./index.BRfGUOQ-.js";import{W as ce}from"./WidgetLabelHelpIconInline.DxODTLS2.js";import{u as se}from"./useBasicWidgetState.A4U5lzAm.js";import"./FormClearHelper.C-6BC487.js";var fe={secondary:"secondary"},N={default:"default"},pe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==N.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$.apply(this,arguments)}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X(Object(r),!0).forEach(function(n){V(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ye(e,t){return Se(e)||me(e,t)||he(e,t)||be()}function be(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{ao as q,x as J,r as c,b9 as Q,l as Y,ba as ee,bb as l,j as L,o as te,p as re,P as ne,bc as oe,ad as ie,bd as ae,b as ue,B as C,c as x,D as le}from"./index.CXVpBAvU.js";import{W as ce}from"./WidgetLabelHelpIconInline.CzodezAH.js";import{u as se}from"./useBasicWidgetState.D-fc_aIL.js";import"./FormClearHelper.D4lty7rT.js";var fe={secondary:"secondary"},N={default:"default"},pe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==N.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$.apply(this,arguments)}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X(Object(r),!0).forEach(function(n){V(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ye(e,t){return Se(e)||me(e,t)||he(e,t)||be()}function be(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function he(e,t){if(e){if(typeof e=="string")return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(e,t)}}function K(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function me(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,d;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(s){i=!0,d=s}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw d}}return n}}function Se(e){if(Array.isArray(e))return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Oe(e,t,r){return t&&ve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ee(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}function G(e,t){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},G(e,t)}function _e(e){var t=Le();return function(){var n=B(e),o;if(t){var i=B(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return we(this,o)}}function we(e,t){if(t&&(M(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F(e)}function F(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Le(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},B(e)}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Re(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var H=(function(e){Ee(r,e);var t=_e(r);function r(){var n;ge(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),V(F(n),"childRefs",{}),n}return Oe(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,d=a===void 0?{}:a,s=i.mode,y=s===void 0?k.checkbox:s,S=i.children,b=i.selected,E=i.disabled,f=i.onClick,h=i.kind,v=i.shape,m=i.size,I=J(d.Root,z),_=ye(I,2),A=_[0],R=_[1],w=this.props["aria-label"]||this.props.ariaLabel,p=y===k.radio,W=c.Children.count(S);return c.createElement(Q.Consumer,null,function(Z){return c.createElement(A,$({"aria-label":w||Z.buttongroup.ariaLabel,"data-baseweb":"button-group",role:p?"radiogroup":"group",$shape:v,$length:S.length},R),c.Children.map(S,function(g,P){if(!c.isValidElement(g))return null;var D=g.props.isSelected?g.props.isSelected:Re(b,P);return p&&(o.childRefs[P]=c.createRef()),c.cloneElement(g,{disabled:E||g.props.disabled,isSelected:D,ref:p?o.childRefs[P]:void 0,tabIndex:!p||D||p&&(!b||b===-1)&&P===0?0:-1,onKeyDown:function(u){if(p){var O=Number(b)?Number(b):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var T=O-1<0?W-1:O-1;f&&f(u,T),o.childRefs[T].current&&o.childRefs[T].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var j=O+1>W-1?0:O+1;f&&f(u,j),o.childRefs[j].current&&o.childRefs[j].current.focus()}}},kind:h,onClick:function(u){E||(g.props.onClick&&g.props.onClick(u),f&&f(u,P))},shape:v,size:m,overrides:de({BaseButton:{style:function(u){var O=u.$theme;return S.length===1?{}:v!==N.default?{marginLeft:O.sizing.scale100,marginRight:O.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":D,role:p?"radio":"checkbox"}}},g.props.overrides)})}))})}}]),r})(c.Component);V(H,"defaultProps",{disabled:!1,onClick:function(){},shape:N.default,size:pe.default,kind:fe.secondary});function Pe(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Ce(e,t,r){return e===l.ClickMode.MULTI_SELECT?Pe(t,r??[]):r?.includes(t)?[]:[t]}function ke(e){return e.length===0?-1:e[0]}function Be(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ie(e,t,r){const n=r===l.Style.PILLS?C.PILLS:r===l.Style.BORDERLESS?C.BORDERLESS_ICON:C.SEGMENTED_CONTROL,o=r===l.Style.BORDERLESS?x.XSMALL:x.MEDIUM,i=n===C.PILLS||n===C.SEGMENTED_CONTROL,a=r===l.Style.BORDERLESS?"lg":"base";return{element:L(le,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Ae(e,t,r,n){return r.indexOf(n)>-1?!0:t!==l.ClickMode.SINGLE_SELECT||e!==l.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function De(e,t){return e&&(t=`${t}Active`),t}function Te(e,t,r){const n={flexWrap:"wrap",maxWidth:r?"100%":"fit-content",margin:"0 0"},o=r?"100%":"auto";switch(e){case l.Style.BORDERLESS:return{...n,columnGap:t.threeXS,rowGap:t.threeXS};case l.Style.PILLS:return{...n,columnGap:t.twoXS,rowGap:t.twoXS,width:o};case l.Style.SEGMENTED_CONTROL:return{...n,columnGap:t.none,rowGap:t.twoXS,width:o};default:return n}}function je(e,t,r,n,o,i,a){const d=Ae(r,n,o,t);let s=e.content,y=e.contentIcon;return d&&(s=e.selectedContent?e.selectedContent:s,y=e.selectedContentIcon?e.selectedContentIcon:y),c.forwardRef(function(b,E){const{element:f,kind:h,size:v}=Ie(s??"",y??void 0,i),m=De(!!(d&&!e.selectedContent&&!e.selectedContentIcon),h);return L(ue,{...b,size:v,kind:m,containerWidth:a,children:f})})}function Me(e,t){return e.getIntArrayValue(t)}function $e(e){return e.default??[]}function Ge(e){return e.value??[]}function Ne(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o,widthConfig:i}=e,{clickMode:a,options:d,selectionVisualization:s,style:y,label:S,labelVisibility:b,help:E}=r,f=Y(),[h,v]=se({getStateFromWidgetMgr:Me,getDefaultStateFromProto:$e,getCurrStateFromProto:Ge,updateWidgetMgrState:Be,element:r,widgetMgr:o,fragmentId:n}),m=ee(i),I=(R,w)=>{const p=Ce(a,w,h);v({value:p,fromUi:!0})};let _;a===l.ClickMode.SINGLE_SELECT?_=k.radio:a===l.ClickMode.MULTI_SELECT&&(_=k.checkbox);const A=c.useMemo(()=>d.map((R,w)=>{const p=je(R,w,s,a,h,y,m);return L(p,{},`${R.content}-${w}`)}),[a,d,s,y,h,m]);return te(ae,{className:"stButtonGroup","data-testid":"stButtonGroup",containerWidth:m,children:[L(ie,{label:S,disabled:t,labelVisibility:re(b?.value??oe.LabelVisibilityOptions.COLLAPSED),children:E&&L(ce,{content:E,placement:ne.TOP,label:S})}),L(H,{disabled:t,mode:_,onClick:I,selected:a===l.ClickMode.MULTI_SELECT?h:ke(h),overrides:{Root:{style:c.useCallback(()=>Te(y,f.spacing,m),[y,f.spacing,m])}},children:A})]})}const xe=c.memo(Ne);export{xe as default};
@@ -1 +1 @@
1
- import{r as a,E as B,_ as X,l as $,e as L,R as Q,Q as K,bf as j,bg as z,bh as Y,bi as Z,n as k,bj as M,W as P,X as q,k as ee,ba as te,bk as ne,j as A,o as re,b3 as se}from"./index.BRfGUOQ-.js";import{w as oe,E as ae}from"./withFullScreenWrapper.BMim3w94.js";import{a as _,S as H,T as ce}from"./Toolbar.B9DaaDfN.js";import{R as ie}from"./index.CvB9JBqS.js";import{a as J,c as le,b as ue,e as fe,t as de,S as me,d as pe}from"./embed.oKwocwU8.js";import{u as he}from"./FormClearHelper.C-6BC487.js";import{T as ge}from"./TableChart.esm.BdA4Q1rZ.js";import"./moment.C7qA8nIE.js";import"./pandasStylerUtils.D2EjZ7k6.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";import"./index.8HslT92O.js";import"./main.DSPn8dUe.js";import"./throttle.BPcPpy-S.js";import"./formatNumber.DaagZyZe.js";import"./sprintf.DpPCfzXw.js";import"./formatMoment.C6Hwn6X5.js";import"./checkbox.CnoNruf3.js";import"./createDownloadLinkElement.B48AepiL.js";import"./toConsumableArray.Dg1nDaB_.js";import"./FileDownload.esm.DJCSsghl.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";var U=a.forwardRef(function(n,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(B,X({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});U.displayName="InsertChart";const Se=20;function ye(n){"params"in n&&"encoding"in n&&n.params.forEach(e=>{"select"in e&&(["interval","point"].includes(e.select)&&(e.select={type:e.select}),"type"in e.select&&e.select.type==="point"&&!("encodings"in e.select)&&L(e.select.encodings)&&(e.select.encodings=Object.keys(n.encoding)))})}const be=(n,e,s,r,u,l,f,p)=>{const t=JSON.parse(n);if(r==="streamlit"?t.config=J(t.config,l):t.usermeta?.embedOptions?.theme==="streamlit"?(t.config=J(t.config,l),t.usermeta.embedOptions.theme=void 0):t.config=le(t.config,l),t.title&&(typeof t.title=="string"&&(t.title={text:t.title}),t.title.limit=t.title.limit??Math.max(f-40,0)),s&&(t.height=p),e&&(t.width=f,"vconcat"in t&&t.vconcat.forEach(o=>{o===null||typeof o!="object"||"hconcat"in o||"vconcat"in o||"concat"in o||"layer"in o||(o.width=f)})),t.padding||(t.padding={}),L(t.padding.bottom)&&(t.padding.bottom=Se),t.datasets)throw new Error("Datasets should not be passed as part of the spec");return u.length>0&&ye(t),t},we=(n,e,s,r,u)=>{const l=$(),{id:f,formId:p,spec:t,data:o,datasets:c,vegaLiteTheme:d,selectionMode:i}=n,h=a.useMemo(()=>i,[JSON.stringify(i)]),S=a.useMemo(()=>be(t,r,u,d,h,l,e,s),[t,r,u,d,h,l,e,s]);return{id:f,formId:p,vegaLiteTheme:d,spec:S,selectionMode:h,data:o,datasets:c,useContainerWidth:r}},Ce={DATAFRAME_INDEX:"(index)"};function Ee(n){return!n||n.dimensions.numDataRows===0?null:F(n)}function Ne(n){const e=I(n);if(L(e))return null;const s={};for(const[r,u]of Object.entries(e))s[r]=F(u);return s}function I(n){if(n?.length===0)return null;const e={};return n.forEach(s=>{if(!s)return;const r=s.hasName?s.name:null;e[r]=s.data}),e}function F(n,e=0){if(n.dimensions.numDataRows===0)return[];const s=[],{numDataRows:r,numDataColumns:u,numIndexColumns:l}=n.dimensions,f=n.columnTypes[0]??void 0,p=f?.type===Q.INDEX&&(K(f)||j(f)||z(f));for(let t=e;t<r;t++){const o={};if(p){const{content:c}=n.getCell(t,0);o[Ce.DATAFRAME_INDEX]=typeof c=="bigint"?Number(c):c}for(let c=0;c<u;c++){const d=c+l,{content:i,contentType:h}=n.getCell(t,d);if((i instanceof Date||typeof i=="number"&&Number.isFinite(i))&&(j(h)||z(h))&&!Y(h)){const S=new Date(i).getTimezoneOffset()*60*1e3;o[n.columnNames[0][d]]=i.valueOf()+S}else o[n.columnNames[0][d]]=typeof i=="bigint"?Number(i):i}s.push(o)}return s}const De=150,Ve=P.getLogger("useVegaLiteSelections"),Oe=(n,e,s)=>{const{id:r,formId:u,selectionMode:l}=n,f=a.useCallback(t=>{l.forEach(c=>{t.addSignalListener(c,Z(De,(d,i)=>{const h=t.getState({data:(E,v)=>l.some(g=>`${g}_store`===E),recurse:!1});k(h)&&e.setElementState(r,"viewState",h);let S=i;"vlPoint"in i&&"or"in i.vlPoint&&(S=i.vlPoint.or);const V={id:r,formId:u},N=JSON.parse(e.getStringValue(V)||"{}"),D={selection:{...N?.selection||{},[d]:S||{}}};M(N,D)||e.setStringValue(V,JSON.stringify(D),{fromUi:!0},s)}))});const o=e.getElementState(r,"viewState");if(k(o))try{return t.setState(o)}catch(c){Ve.warn("Failed to restore view state",c)}return t},[r,l,e,u,s]),p=a.useCallback(()=>{const t={selection:{}};l.forEach(i=>{t.selection[i]={}});const o={id:r,formId:u},c=e.getStringValue(o),d=c?JSON.parse(c):t;M(d,t)||e.setStringValue(o,JSON.stringify(t),{fromUi:!0},s)},[r,u,s,l,e]);return{maybeConfigureSelections:f,onFormCleared:p}},W="source",Te=P.getLogger("useVegaEmbed");function ve(n,e,s){const r=a.useRef(null),u=a.useRef(null),l=a.useRef(W),f=a.useRef(null),p=a.useRef([]),t=a.useRef(null),o=a.useRef([]),[c,d]=a.useState(!1),{maybeConfigureSelections:i,onFormCleared:h}=Oe(n,e,s);he({widgetMgr:e,element:n,onFormCleared:h});const{data:S,datasets:V}=n;a.useEffect(()=>{t.current=S,o.current=V,r.current===null&&(f.current=S,p.current=V)},[S,V]);const N=a.useCallback(()=>{u.current&&u.current(),u.current=null,r.current=null},[]),D=a.useCallback(async(g,b)=>{if(g.current===null)throw new Error("Element missing.");d(!0);try{N();const w={ast:!0,expr:ue,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:y,view:R,finalize:T}=await fe(g.current,b,w);r.current=i(R),u.current=T;const m=Ne(o.current),C=m?Object.keys(m):[];if(C.length===1){const[x]=C;l.current=x}else C.length===0&&y.data&&(l.current=W);const O=Ee(t.current);if(O&&r.current.insert(l.current,O),m)for(const[x,G]of Object.entries(m))r.current.insert(x,G);return await r.current.runAsync(),await r.current.resize().runAsync(),f.current=t.current,p.current=o.current,r.current}finally{d(!1)}},[N,i]),E=a.useCallback((g,b,w,y)=>{if(!y||y.dimensions.numDataRows===0){try{g.remove(b,de)}catch{}return}if(!w||w.dimensions.numDataRows===0){g.insert(b,F(y));return}y.hash!==w.hash&&(g.data(b,F(y)),Te.info(`Had to clear the ${b} dataset before inserting data through Vega view.`))},[]),v=a.useCallback(async(g,b)=>{if(r.current===null||c)return null;const w=f.current,y=p.current;(w||g)&&E(r.current,l.current,w,g);const R=I(y)??{},T=I(b)??{};for(const[m,C]of Object.entries(T)){const O=m||l.current,x=R[O];E(r.current,O,x,C)}for(const m of Object.keys(R))!Object.hasOwn(T,m)&&m!==l.current&&E(r.current,m,null,null);return await r.current?.resize().runAsync(),f.current=g,p.current=b,r.current},[E,c]);return{createView:D,updateView:v,finalizeView:N}}function Re(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!!(e.facet||e.encoding?.row||e.encoding?.column||e.encoding?.facet)}catch{return!1}}function Ae(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!("vconcat"in e)||!Array.isArray(e.vconcat)?!1:e.vconcat.some(s=>s!==null&&typeof s=="object"&&("hconcat"in s||"vconcat"in s||"concat"in s||"layer"in s))}catch{return!1}}const xe=({disableFullscreenMode:n,element:e,fragmentId:s,widgetMgr:r,widthConfig:u,heightConfig:l})=>{const[f,p]=a.useState(!1),[t,o]=a.useState(!1),{expanded:c,height:d,width:i,expand:h,collapse:S}=q(ae),{width:V,height:N,elementRef:D}=ee([f],0),E=te(u)||e.useContainerWidth,v=ne(l),g=Re(e.spec),b=Ae(e.spec),w=we(e,g?i??0:V,(c?d:N)??0,c&&!b?!0:E,c?!0:v),{createView:y,updateView:R,finalizeView:T}=ve(w,r,s),{data:m,datasets:C,spec:O}=w;return a.useLayoutEffect(()=>(D.current!==null&&y(D,O),T),[y,T,O,i,d,f,D]),a.useEffect(()=>{R(m,C)},[m,C]),a.useEffect(()=>{m||C?.[0]?.data?o(!0):o(!1)},[m,C]),f?A(ie,{data:m??C[0]?.data,height:d??N??void 0,width:u??void 0,customToolbarActions:[A(_,{label:"Show chart",icon:U,onClick:()=>{p(!1)}},"show-chart")]}):re(H,{height:v?c?d:"100%":d,useContainerWidth:c?!0:E,children:[A(ce,{target:H,isFullScreen:c,onExpand:h,onCollapse:S,disableFullscreenMode:n,children:t&&A(_,{label:"Show data",icon:ge,onClick:()=>{p(!0)}})}),A(se,{styles:[me]}),A(pe,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:E,useContainerHeight:v,ref:D})]})},Fe=oe(xe),st=a.memo(Fe);export{me as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,st as default};
1
+ import{r as a,E as B,_ as X,l as $,e as L,R as Q,Q as K,bf as j,bg as z,bh as Y,bi as Z,n as k,bj as M,W as P,X as q,k as ee,ba as te,bk as ne,j as A,o as re,b3 as se}from"./index.CXVpBAvU.js";import{w as oe,E as ae}from"./withFullScreenWrapper.Cw_ebNmr.js";import{a as _,S as H,T as ce}from"./Toolbar.guIuiwEF.js";import{R as ie}from"./index.tLZuZM89.js";import{a as J,c as le,b as ue,e as fe,t as de,S as me,d as pe}from"./embed.CqzzUq73.js";import{u as he}from"./FormClearHelper.D4lty7rT.js";import{T as ge}from"./TableChart.esm.7KFX5I_G.js";import"./moment.C7qA8nIE.js";import"./pandasStylerUtils.Dej3Tstq.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";import"./index.8HslT92O.js";import"./main.BE-siVKv.js";import"./throttle.gZUdtYp7.js";import"./formatNumber.CT_v8e75.js";import"./sprintf.DpPCfzXw.js";import"./formatMoment.C6Hwn6X5.js";import"./checkbox.Bs20OTna.js";import"./createDownloadLinkElement.DSqCyu38.js";import"./toConsumableArray.CcKcKvEd.js";import"./FileDownload.esm.C6tTTniR.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";var U=a.forwardRef(function(n,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(B,X({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});U.displayName="InsertChart";const Se=20;function ye(n){"params"in n&&"encoding"in n&&n.params.forEach(e=>{"select"in e&&(["interval","point"].includes(e.select)&&(e.select={type:e.select}),"type"in e.select&&e.select.type==="point"&&!("encodings"in e.select)&&L(e.select.encodings)&&(e.select.encodings=Object.keys(n.encoding)))})}const be=(n,e,s,r,u,l,f,p)=>{const t=JSON.parse(n);if(r==="streamlit"?t.config=J(t.config,l):t.usermeta?.embedOptions?.theme==="streamlit"?(t.config=J(t.config,l),t.usermeta.embedOptions.theme=void 0):t.config=le(t.config,l),t.title&&(typeof t.title=="string"&&(t.title={text:t.title}),t.title.limit=t.title.limit??Math.max(f-40,0)),s&&(t.height=p),e&&(t.width=f,"vconcat"in t&&t.vconcat.forEach(o=>{o===null||typeof o!="object"||"hconcat"in o||"vconcat"in o||"concat"in o||"layer"in o||(o.width=f)})),t.padding||(t.padding={}),L(t.padding.bottom)&&(t.padding.bottom=Se),t.datasets)throw new Error("Datasets should not be passed as part of the spec");return u.length>0&&ye(t),t},we=(n,e,s,r,u)=>{const l=$(),{id:f,formId:p,spec:t,data:o,datasets:c,vegaLiteTheme:d,selectionMode:i}=n,h=a.useMemo(()=>i,[JSON.stringify(i)]),S=a.useMemo(()=>be(t,r,u,d,h,l,e,s),[t,r,u,d,h,l,e,s]);return{id:f,formId:p,vegaLiteTheme:d,spec:S,selectionMode:h,data:o,datasets:c,useContainerWidth:r}},Ce={DATAFRAME_INDEX:"(index)"};function Ee(n){return!n||n.dimensions.numDataRows===0?null:F(n)}function Ne(n){const e=I(n);if(L(e))return null;const s={};for(const[r,u]of Object.entries(e))s[r]=F(u);return s}function I(n){if(n?.length===0)return null;const e={};return n.forEach(s=>{if(!s)return;const r=s.hasName?s.name:null;e[r]=s.data}),e}function F(n,e=0){if(n.dimensions.numDataRows===0)return[];const s=[],{numDataRows:r,numDataColumns:u,numIndexColumns:l}=n.dimensions,f=n.columnTypes[0]??void 0,p=f?.type===Q.INDEX&&(K(f)||j(f)||z(f));for(let t=e;t<r;t++){const o={};if(p){const{content:c}=n.getCell(t,0);o[Ce.DATAFRAME_INDEX]=typeof c=="bigint"?Number(c):c}for(let c=0;c<u;c++){const d=c+l,{content:i,contentType:h}=n.getCell(t,d);if((i instanceof Date||typeof i=="number"&&Number.isFinite(i))&&(j(h)||z(h))&&!Y(h)){const S=new Date(i).getTimezoneOffset()*60*1e3;o[n.columnNames[0][d]]=i.valueOf()+S}else o[n.columnNames[0][d]]=typeof i=="bigint"?Number(i):i}s.push(o)}return s}const De=150,Ve=P.getLogger("useVegaLiteSelections"),Oe=(n,e,s)=>{const{id:r,formId:u,selectionMode:l}=n,f=a.useCallback(t=>{l.forEach(c=>{t.addSignalListener(c,Z(De,(d,i)=>{const h=t.getState({data:(E,v)=>l.some(g=>`${g}_store`===E),recurse:!1});k(h)&&e.setElementState(r,"viewState",h);let S=i;"vlPoint"in i&&"or"in i.vlPoint&&(S=i.vlPoint.or);const V={id:r,formId:u},N=JSON.parse(e.getStringValue(V)||"{}"),D={selection:{...N?.selection||{},[d]:S||{}}};M(N,D)||e.setStringValue(V,JSON.stringify(D),{fromUi:!0},s)}))});const o=e.getElementState(r,"viewState");if(k(o))try{return t.setState(o)}catch(c){Ve.warn("Failed to restore view state",c)}return t},[r,l,e,u,s]),p=a.useCallback(()=>{const t={selection:{}};l.forEach(i=>{t.selection[i]={}});const o={id:r,formId:u},c=e.getStringValue(o),d=c?JSON.parse(c):t;M(d,t)||e.setStringValue(o,JSON.stringify(t),{fromUi:!0},s)},[r,u,s,l,e]);return{maybeConfigureSelections:f,onFormCleared:p}},W="source",Te=P.getLogger("useVegaEmbed");function ve(n,e,s){const r=a.useRef(null),u=a.useRef(null),l=a.useRef(W),f=a.useRef(null),p=a.useRef([]),t=a.useRef(null),o=a.useRef([]),[c,d]=a.useState(!1),{maybeConfigureSelections:i,onFormCleared:h}=Oe(n,e,s);he({widgetMgr:e,element:n,onFormCleared:h});const{data:S,datasets:V}=n;a.useEffect(()=>{t.current=S,o.current=V,r.current===null&&(f.current=S,p.current=V)},[S,V]);const N=a.useCallback(()=>{u.current&&u.current(),u.current=null,r.current=null},[]),D=a.useCallback(async(g,b)=>{if(g.current===null)throw new Error("Element missing.");d(!0);try{N();const w={ast:!0,expr:ue,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:y,view:R,finalize:T}=await fe(g.current,b,w);r.current=i(R),u.current=T;const m=Ne(o.current),C=m?Object.keys(m):[];if(C.length===1){const[x]=C;l.current=x}else C.length===0&&y.data&&(l.current=W);const O=Ee(t.current);if(O&&r.current.insert(l.current,O),m)for(const[x,G]of Object.entries(m))r.current.insert(x,G);return await r.current.runAsync(),await r.current.resize().runAsync(),f.current=t.current,p.current=o.current,r.current}finally{d(!1)}},[N,i]),E=a.useCallback((g,b,w,y)=>{if(!y||y.dimensions.numDataRows===0){try{g.remove(b,de)}catch{}return}if(!w||w.dimensions.numDataRows===0){g.insert(b,F(y));return}y.hash!==w.hash&&(g.data(b,F(y)),Te.info(`Had to clear the ${b} dataset before inserting data through Vega view.`))},[]),v=a.useCallback(async(g,b)=>{if(r.current===null||c)return null;const w=f.current,y=p.current;(w||g)&&E(r.current,l.current,w,g);const R=I(y)??{},T=I(b)??{};for(const[m,C]of Object.entries(T)){const O=m||l.current,x=R[O];E(r.current,O,x,C)}for(const m of Object.keys(R))!Object.hasOwn(T,m)&&m!==l.current&&E(r.current,m,null,null);return await r.current?.resize().runAsync(),f.current=g,p.current=b,r.current},[E,c]);return{createView:D,updateView:v,finalizeView:N}}function Re(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!!(e.facet||e.encoding?.row||e.encoding?.column||e.encoding?.facet)}catch{return!1}}function Ae(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!("vconcat"in e)||!Array.isArray(e.vconcat)?!1:e.vconcat.some(s=>s!==null&&typeof s=="object"&&("hconcat"in s||"vconcat"in s||"concat"in s||"layer"in s))}catch{return!1}}const xe=({disableFullscreenMode:n,element:e,fragmentId:s,widgetMgr:r,widthConfig:u,heightConfig:l})=>{const[f,p]=a.useState(!1),[t,o]=a.useState(!1),{expanded:c,height:d,width:i,expand:h,collapse:S}=q(ae),{width:V,height:N,elementRef:D}=ee([f],0),E=te(u)||e.useContainerWidth,v=ne(l),g=Re(e.spec),b=Ae(e.spec),w=we(e,g?i??0:V,(c?d:N)??0,c&&!b?!0:E,c?!0:v),{createView:y,updateView:R,finalizeView:T}=ve(w,r,s),{data:m,datasets:C,spec:O}=w;return a.useLayoutEffect(()=>(D.current!==null&&y(D,O),T),[y,T,O,i,d,f,D]),a.useEffect(()=>{R(m,C)},[m,C]),a.useEffect(()=>{m||C?.[0]?.data?o(!0):o(!1)},[m,C]),f?A(ie,{data:m??C[0]?.data,height:d??N??void 0,width:u??void 0,customToolbarActions:[A(_,{label:"Show chart",icon:U,onClick:()=>{p(!1)}},"show-chart")]}):re(H,{height:v?c?d:"100%":d,useContainerWidth:c?!0:E,children:[A(ce,{target:H,isFullScreen:c,onExpand:h,onCollapse:S,disableFullscreenMode:n,children:t&&A(_,{label:"Show data",icon:ge,onClick:()=>{p(!0)}})}),A(se,{styles:[me]}),A(pe,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:E,useContainerHeight:v,ref:D})]})},Fe=oe(xe),st=a.memo(Fe);export{me as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,st as default};
@@ -1,2 +1,2 @@
1
- import{F as f,aj as S,r as s,l as b,aK as y,j as l,aL as x,ay as R,o as h,m as T,Z as v,aM as B,aN as E,aO as j}from"./index.BRfGUOQ-.js";import{l as k}from"./index.8HslT92O.js";import{R as J}from"./main.DSPn8dUe.js";const w=f("div",{target:"e1l93qjt0"})(({theme:o})=>({overflowY:"auto",position:"relative",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),L=f("div",{target:"e1l93qjt1"})(({theme:o})=>({display:"flex",alignItems:"center",gap:o.spacing.sm,padding:o.spacing.sm,paddingLeft:o.spacing.md,fontFamily:o.genericFonts.codeFont,fontSize:o.fontSizes.twoSm,color:o.colors.bodyText,maxWidth:"90vw",wordBreak:"break-all"})),P=f("button",{target:"e1l93qjt2"})(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:o.spacing.threeXS,backgroundColor:"transparent",border:"none",borderRadius:o.radii.md,cursor:"pointer",color:o.colors.fadedText60,transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{backgroundColor:o.colors.darkenedBgMix15,color:o.colors.bodyText},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:S(o)}})),$=f("div",{target:"e1l93qjt3"})(({top:o,left:e})=>({position:"fixed",top:o,left:e}));function I({top:o,left:e,path:t,clearTooltip:d}){const[p,n]=s.useState(!0),r=b(),{colors:i,radii:a}=r,{isCopied:c,copyToClipboard:u,label:m}=y(),g=s.useCallback(()=>{n(!1),d()},[d]),C=s.useCallback(()=>{u(t)},[u,t]);return l(B,{content:h(L,{"data-testid":"stJsonPathTooltip",children:[l("code",{children:t}),l(P,{onClick:C,title:m,"aria-label":m,autoFocus:!0,children:l(v,{size:"sm",iconValue:c?":material/check:":":material/content_copy:"})})]}),placement:R.top,accessibilityType:x.tooltip,showArrow:!1,popoverMargin:15,onClickOutside:g,onEsc:g,overrides:{Body:{style:{borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:T(r)?i.bgColor:i.secondaryBg,color:i.bodyText,borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:p,children:l($,{"data-testid":"stJsonPathTooltipTarget",top:o,left:e})})}const F=s.memo(I);function z(o){return o.length===0?"$":o.reduce((e,t,d)=>{if(t===null)return e;if(/^\d+$/.test(t))return`${e}[${t}]`;if(t===""||/[^a-zA-Z0-9_$]/.test(t)||/^\d/.test(t)){const r=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return`${e}["${r}"]`}return d===0||e===""?t:`${e}.${t}`},"")}function O(){const[o,e]=s.useState(null),t=s.useRef({x:0,y:0});s.useEffect(()=>{const n=r=>{t.current={x:r.clientX,y:r.clientY}};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]);const d=s.useCallback(n=>{const{x:r,y:i}=t.current,a=[...n.namespace,n.name],c=z(a);e({path:c,x:r,y:i})},[]),p=s.useCallback(()=>{e(null)},[]);return{tooltip:o,handleSelect:d,clearTooltip:p}}function A({element:o}){const e=b(),{tooltip:t,handleSelect:d,clearTooltip:p}=O(),{copyToClipboard:n}=y(),r=s.useCallback(c=>{n(JSON.stringify(c.src))},[n]);let i;try{i=JSON.parse(o.body)}catch(c){const u=E(c);try{i=k.parse(o.body)}catch{const g=parseInt(u.message.replace(/[^0-9]/g,""),10);return u.message+=`
1
+ import{F as f,aj as S,r as s,l as b,aK as y,j as l,aL as x,ay as R,o as h,m as T,Z as v,aM as B,aN as E,aO as j}from"./index.CXVpBAvU.js";import{l as k}from"./index.8HslT92O.js";import{R as J}from"./main.BE-siVKv.js";const w=f("div",{target:"e1l93qjt0"})(({theme:o})=>({overflowY:"auto",position:"relative",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),L=f("div",{target:"e1l93qjt1"})(({theme:o})=>({display:"flex",alignItems:"center",gap:o.spacing.sm,padding:o.spacing.sm,paddingLeft:o.spacing.md,fontFamily:o.genericFonts.codeFont,fontSize:o.fontSizes.twoSm,color:o.colors.bodyText,maxWidth:"90vw",wordBreak:"break-all"})),P=f("button",{target:"e1l93qjt2"})(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:o.spacing.threeXS,backgroundColor:"transparent",border:"none",borderRadius:o.radii.md,cursor:"pointer",color:o.colors.fadedText60,transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{backgroundColor:o.colors.darkenedBgMix15,color:o.colors.bodyText},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:S(o)}})),$=f("div",{target:"e1l93qjt3"})(({top:o,left:e})=>({position:"fixed",top:o,left:e}));function I({top:o,left:e,path:t,clearTooltip:d}){const[p,n]=s.useState(!0),r=b(),{colors:i,radii:a}=r,{isCopied:c,copyToClipboard:u,label:m}=y(),g=s.useCallback(()=>{n(!1),d()},[d]),C=s.useCallback(()=>{u(t)},[u,t]);return l(B,{content:h(L,{"data-testid":"stJsonPathTooltip",children:[l("code",{children:t}),l(P,{onClick:C,title:m,"aria-label":m,autoFocus:!0,children:l(v,{size:"sm",iconValue:c?":material/check:":":material/content_copy:"})})]}),placement:R.top,accessibilityType:x.tooltip,showArrow:!1,popoverMargin:15,onClickOutside:g,onEsc:g,overrides:{Body:{style:{borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:T(r)?i.bgColor:i.secondaryBg,color:i.bodyText,borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:p,children:l($,{"data-testid":"stJsonPathTooltipTarget",top:o,left:e})})}const F=s.memo(I);function z(o){return o.length===0?"$":o.reduce((e,t,d)=>{if(t===null)return e;if(/^\d+$/.test(t))return`${e}[${t}]`;if(t===""||/[^a-zA-Z0-9_$]/.test(t)||/^\d/.test(t)){const r=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return`${e}["${r}"]`}return d===0||e===""?t:`${e}.${t}`},"")}function O(){const[o,e]=s.useState(null),t=s.useRef({x:0,y:0});s.useEffect(()=>{const n=r=>{t.current={x:r.clientX,y:r.clientY}};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]);const d=s.useCallback(n=>{const{x:r,y:i}=t.current,a=[...n.namespace,n.name],c=z(a);e({path:c,x:r,y:i})},[]),p=s.useCallback(()=>{e(null)},[]);return{tooltip:o,handleSelect:d,clearTooltip:p}}function A({element:o}){const e=b(),{tooltip:t,handleSelect:d,clearTooltip:p}=O(),{copyToClipboard:n}=y(),r=s.useCallback(c=>{n(JSON.stringify(c.src))},[n]);let i;try{i=JSON.parse(o.body)}catch(c){const u=E(c);try{i=k.parse(o.body)}catch{const g=parseInt(u.message.replace(/[^0-9]/g,""),10);return u.message+=`
2
2
  ${o.body.substring(0,g+1)} ← here`,l(j,{name:"Json Parse Error",message:u.message})}}const a=T(e)?"rjv-default":"monokai";return h(w,{className:"stJson","data-testid":"stJson",children:[l(J,{src:i,collapsed:o.maxExpandDepth??!o.expanded,displayDataTypes:!1,displayObjectSize:!1,name:!1,theme:a,enableClipboard:r,onSelect:d,style:{fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.codeFontSize,fontWeight:e.fontWeights.code,backgroundColor:e.colors.bgColor,whiteSpace:"pre-wrap"}}),t&&l(F,{top:t.y,left:t.x,path:t.path,clearTooltip:p})]})}const D=s.memo(A);export{D as default};