streamlit-nightly 1.41.2.dev20241227__py2.py3-none-any.whl → 1.41.2.dev20250124__py2.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 (429) hide show
  1. streamlit/__init__.py +11 -2
  2. streamlit/__main__.py +1 -1
  3. streamlit/auth_util.py +209 -0
  4. streamlit/cli_util.py +1 -1
  5. streamlit/column_config.py +1 -1
  6. streamlit/commands/__init__.py +1 -1
  7. streamlit/commands/echo.py +1 -1
  8. streamlit/commands/execution_control.py +1 -1
  9. streamlit/commands/experimental_query_params.py +1 -1
  10. streamlit/commands/logo.py +1 -1
  11. streamlit/commands/navigation.py +16 -15
  12. streamlit/commands/page_config.py +1 -1
  13. streamlit/components/__init__.py +1 -1
  14. streamlit/components/lib/__init__.py +1 -1
  15. streamlit/components/lib/local_component_registry.py +1 -1
  16. streamlit/components/types/__init__.py +1 -1
  17. streamlit/components/types/base_component_registry.py +1 -1
  18. streamlit/components/types/base_custom_component.py +1 -1
  19. streamlit/components/v1/__init__.py +1 -1
  20. streamlit/components/v1/component_arrow.py +1 -1
  21. streamlit/components/v1/component_registry.py +1 -1
  22. streamlit/components/v1/components.py +1 -1
  23. streamlit/components/v1/custom_component.py +1 -1
  24. streamlit/config.py +18 -3
  25. streamlit/config_option.py +10 -19
  26. streamlit/config_util.py +1 -1
  27. streamlit/connections/__init__.py +1 -1
  28. streamlit/connections/base_connection.py +1 -1
  29. streamlit/connections/snowflake_connection.py +31 -50
  30. streamlit/connections/snowpark_connection.py +1 -1
  31. streamlit/connections/sql_connection.py +1 -1
  32. streamlit/connections/util.py +1 -1
  33. streamlit/cursor.py +1 -1
  34. streamlit/dataframe_util.py +3 -3
  35. streamlit/delta_generator.py +7 -3
  36. streamlit/delta_generator_singletons.py +1 -1
  37. streamlit/deprecation_util.py +1 -1
  38. streamlit/development.py +1 -1
  39. streamlit/elements/__init__.py +1 -1
  40. streamlit/elements/alert.py +1 -1
  41. streamlit/elements/arrow.py +25 -3
  42. streamlit/elements/balloons.py +1 -1
  43. streamlit/elements/bokeh_chart.py +1 -1
  44. streamlit/elements/code.py +9 -1
  45. streamlit/elements/deck_gl_json_chart.py +1 -1
  46. streamlit/elements/dialog_decorator.py +1 -1
  47. streamlit/elements/doc_string.py +1 -1
  48. streamlit/elements/empty.py +1 -1
  49. streamlit/elements/exception.py +8 -10
  50. streamlit/elements/form.py +1 -1
  51. streamlit/elements/graphviz_chart.py +1 -1
  52. streamlit/elements/heading.py +1 -1
  53. streamlit/elements/html.py +1 -1
  54. streamlit/elements/iframe.py +1 -1
  55. streamlit/elements/image.py +1 -1
  56. streamlit/elements/json.py +1 -1
  57. streamlit/elements/layouts.py +1 -1
  58. streamlit/elements/lib/__init__.py +1 -1
  59. streamlit/elements/lib/built_in_chart_utils.py +1 -1
  60. streamlit/elements/lib/color_util.py +1 -1
  61. streamlit/elements/lib/column_config_utils.py +1 -1
  62. streamlit/elements/lib/column_types.py +1 -1
  63. streamlit/elements/lib/dialog.py +1 -1
  64. streamlit/elements/lib/dicttools.py +1 -1
  65. streamlit/elements/lib/event_utils.py +1 -1
  66. streamlit/elements/lib/file_uploader_utils.py +1 -1
  67. streamlit/elements/lib/form_utils.py +1 -1
  68. streamlit/elements/lib/image_utils.py +1 -1
  69. streamlit/elements/lib/js_number.py +1 -1
  70. streamlit/elements/lib/mutable_status_container.py +1 -1
  71. streamlit/elements/lib/options_selector_utils.py +1 -1
  72. streamlit/elements/lib/pandas_styler_utils.py +1 -1
  73. streamlit/elements/lib/policies.py +1 -1
  74. streamlit/elements/lib/streamlit_plotly_theme.py +1 -1
  75. streamlit/elements/lib/subtitle_utils.py +1 -1
  76. streamlit/elements/lib/utils.py +1 -1
  77. streamlit/elements/map.py +1 -1
  78. streamlit/elements/markdown.py +3 -3
  79. streamlit/elements/media.py +1 -1
  80. streamlit/elements/metric.py +1 -1
  81. streamlit/elements/plotly_chart.py +1 -1
  82. streamlit/elements/progress.py +1 -1
  83. streamlit/elements/pyplot.py +1 -1
  84. streamlit/elements/snow.py +1 -1
  85. streamlit/elements/spinner.py +14 -7
  86. streamlit/elements/text.py +1 -1
  87. streamlit/elements/toast.py +1 -1
  88. streamlit/elements/vega_charts.py +20 -6
  89. streamlit/elements/widgets/__init__.py +1 -1
  90. streamlit/elements/widgets/audio_input.py +1 -1
  91. streamlit/elements/widgets/button.py +9 -8
  92. streamlit/elements/widgets/button_group.py +6 -4
  93. streamlit/elements/widgets/camera_input.py +1 -1
  94. streamlit/elements/widgets/chat.py +1 -1
  95. streamlit/elements/widgets/checkbox.py +1 -1
  96. streamlit/elements/widgets/color_picker.py +1 -1
  97. streamlit/elements/widgets/data_editor.py +6 -5
  98. streamlit/elements/widgets/file_uploader.py +1 -1
  99. streamlit/elements/widgets/multiselect.py +1 -1
  100. streamlit/elements/widgets/number_input.py +1 -1
  101. streamlit/elements/widgets/radio.py +1 -1
  102. streamlit/elements/widgets/select_slider.py +1 -1
  103. streamlit/elements/widgets/selectbox.py +1 -1
  104. streamlit/elements/widgets/slider.py +1 -1
  105. streamlit/elements/widgets/text_widgets.py +1 -1
  106. streamlit/elements/widgets/time_widgets.py +63 -3
  107. streamlit/elements/write.py +2 -2
  108. streamlit/emojis.py +2 -2
  109. streamlit/env_util.py +1 -1
  110. streamlit/error_util.py +9 -3
  111. streamlit/errors.py +5 -1
  112. streamlit/external/__init__.py +1 -1
  113. streamlit/external/langchain/__init__.py +1 -1
  114. streamlit/external/langchain/streamlit_callback_handler.py +1 -1
  115. streamlit/file_util.py +1 -1
  116. streamlit/git_util.py +1 -1
  117. streamlit/hello/__init__.py +1 -1
  118. streamlit/hello/animation_demo.py +1 -1
  119. streamlit/hello/dataframe_demo.py +1 -1
  120. streamlit/hello/hello.py +1 -1
  121. streamlit/hello/mapping_demo.py +1 -1
  122. streamlit/hello/plotting_demo.py +1 -1
  123. streamlit/hello/streamlit_app.py +1 -1
  124. streamlit/hello/utils.py +1 -1
  125. streamlit/logger.py +1 -1
  126. streamlit/material_icon_names.py +2 -2
  127. streamlit/navigation/__init__.py +1 -1
  128. streamlit/navigation/page.py +7 -4
  129. streamlit/net_util.py +1 -1
  130. streamlit/platform.py +1 -1
  131. streamlit/proto/Alert_pb2.pyi +1 -1
  132. streamlit/proto/AppPage_pb2.pyi +1 -1
  133. streamlit/proto/ArrowNamedDataSet_pb2.pyi +1 -1
  134. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +1 -1
  135. streamlit/proto/Arrow_pb2.pyi +1 -1
  136. streamlit/proto/AudioInput_pb2.pyi +1 -1
  137. streamlit/proto/Audio_pb2.pyi +1 -1
  138. streamlit/proto/AuthRedirect_pb2.py +27 -0
  139. streamlit/proto/AuthRedirect_pb2.pyi +41 -0
  140. streamlit/proto/AutoRerun_pb2.pyi +1 -1
  141. streamlit/proto/BackMsg_pb2.pyi +1 -1
  142. streamlit/proto/Balloons_pb2.pyi +1 -1
  143. streamlit/proto/Block_pb2.pyi +1 -1
  144. streamlit/proto/BokehChart_pb2.pyi +1 -1
  145. streamlit/proto/ButtonGroup_pb2.pyi +1 -1
  146. streamlit/proto/Button_pb2.pyi +1 -1
  147. streamlit/proto/CameraInput_pb2.pyi +1 -1
  148. streamlit/proto/ChatInput_pb2.pyi +1 -1
  149. streamlit/proto/Checkbox_pb2.pyi +1 -1
  150. streamlit/proto/ClientState_pb2.pyi +1 -1
  151. streamlit/proto/Code_pb2.py +2 -2
  152. streamlit/proto/Code_pb2.pyi +5 -2
  153. streamlit/proto/ColorPicker_pb2.pyi +1 -1
  154. streamlit/proto/Common_pb2.pyi +1 -1
  155. streamlit/proto/Components_pb2.pyi +1 -1
  156. streamlit/proto/DataFrame_pb2.pyi +1 -1
  157. streamlit/proto/DateInput_pb2.pyi +1 -1
  158. streamlit/proto/DeckGlJsonChart_pb2.pyi +1 -1
  159. streamlit/proto/Delta_pb2.pyi +1 -1
  160. streamlit/proto/DocString_pb2.pyi +1 -1
  161. streamlit/proto/DownloadButton_pb2.pyi +1 -1
  162. streamlit/proto/Element_pb2.pyi +1 -1
  163. streamlit/proto/Empty_pb2.pyi +1 -1
  164. streamlit/proto/Exception_pb2.pyi +1 -1
  165. streamlit/proto/Favicon_pb2.pyi +1 -1
  166. streamlit/proto/FileUploader_pb2.pyi +1 -1
  167. streamlit/proto/ForwardMsg_pb2.py +12 -9
  168. streamlit/proto/ForwardMsg_pb2.pyi +34 -4
  169. streamlit/proto/GitInfo_pb2.pyi +1 -1
  170. streamlit/proto/GraphVizChart_pb2.pyi +1 -1
  171. streamlit/proto/Heading_pb2.pyi +1 -1
  172. streamlit/proto/Html_pb2.pyi +1 -1
  173. streamlit/proto/IFrame_pb2.pyi +1 -1
  174. streamlit/proto/Image_pb2.pyi +1 -1
  175. streamlit/proto/Json_pb2.pyi +1 -1
  176. streamlit/proto/LabelVisibilityMessage_pb2.pyi +1 -1
  177. streamlit/proto/LinkButton_pb2.pyi +1 -1
  178. streamlit/proto/Logo_pb2.pyi +1 -1
  179. streamlit/proto/Markdown_pb2.pyi +1 -1
  180. streamlit/proto/Metric_pb2.pyi +1 -1
  181. streamlit/proto/MetricsEvent_pb2.pyi +1 -1
  182. streamlit/proto/MultiSelect_pb2.pyi +1 -1
  183. streamlit/proto/NamedDataSet_pb2.pyi +1 -1
  184. streamlit/proto/Navigation_pb2.pyi +1 -1
  185. streamlit/proto/NewSession_pb2.pyi +1 -1
  186. streamlit/proto/NumberInput_pb2.pyi +1 -1
  187. streamlit/proto/PageConfig_pb2.pyi +1 -1
  188. streamlit/proto/PageInfo_pb2.pyi +1 -1
  189. streamlit/proto/PageLink_pb2.pyi +1 -1
  190. streamlit/proto/PageNotFound_pb2.pyi +1 -1
  191. streamlit/proto/PageProfile_pb2.pyi +1 -1
  192. streamlit/proto/PagesChanged_pb2.pyi +1 -1
  193. streamlit/proto/ParentMessage_pb2.pyi +1 -1
  194. streamlit/proto/PlotlyChart_pb2.pyi +1 -1
  195. streamlit/proto/Progress_pb2.pyi +1 -1
  196. streamlit/proto/Radio_pb2.pyi +1 -1
  197. streamlit/proto/RootContainer_pb2.pyi +1 -1
  198. streamlit/proto/Selectbox_pb2.pyi +1 -1
  199. streamlit/proto/SessionEvent_pb2.pyi +1 -1
  200. streamlit/proto/SessionStatus_pb2.pyi +1 -1
  201. streamlit/proto/Skeleton_pb2.pyi +1 -1
  202. streamlit/proto/Slider_pb2.pyi +1 -1
  203. streamlit/proto/Snow_pb2.pyi +1 -1
  204. streamlit/proto/Spinner_pb2.py +2 -2
  205. streamlit/proto/Spinner_pb2.pyi +6 -2
  206. streamlit/proto/TextArea_pb2.pyi +1 -1
  207. streamlit/proto/TextInput_pb2.pyi +1 -1
  208. streamlit/proto/Text_pb2.pyi +1 -1
  209. streamlit/proto/TimeInput_pb2.pyi +1 -1
  210. streamlit/proto/Toast_pb2.pyi +1 -1
  211. streamlit/proto/VegaLiteChart_pb2.pyi +1 -1
  212. streamlit/proto/Video_pb2.pyi +1 -1
  213. streamlit/proto/WidgetStates_pb2.pyi +1 -1
  214. streamlit/proto/__init__.py +1 -1
  215. streamlit/runtime/__init__.py +1 -1
  216. streamlit/runtime/app_session.py +29 -5
  217. streamlit/runtime/caching/__init__.py +1 -1
  218. streamlit/runtime/caching/cache_data_api.py +3 -3
  219. streamlit/runtime/caching/cache_errors.py +1 -1
  220. streamlit/runtime/caching/cache_resource_api.py +1 -1
  221. streamlit/runtime/caching/cache_type.py +1 -1
  222. streamlit/runtime/caching/cache_utils.py +5 -4
  223. streamlit/runtime/caching/cached_message_replay.py +1 -1
  224. streamlit/runtime/caching/hashing.py +1 -1
  225. streamlit/runtime/caching/legacy_cache_api.py +1 -1
  226. streamlit/runtime/caching/storage/__init__.py +1 -1
  227. streamlit/runtime/caching/storage/cache_storage_protocol.py +1 -1
  228. streamlit/runtime/caching/storage/dummy_cache_storage.py +1 -1
  229. streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py +1 -1
  230. streamlit/runtime/caching/storage/local_disk_cache_storage.py +5 -5
  231. streamlit/runtime/connection_factory.py +1 -1
  232. streamlit/runtime/context.py +1 -1
  233. streamlit/runtime/credentials.py +5 -5
  234. streamlit/runtime/forward_msg_cache.py +4 -2
  235. streamlit/runtime/forward_msg_queue.py +33 -5
  236. streamlit/runtime/fragment.py +2 -2
  237. streamlit/runtime/media_file_manager.py +1 -1
  238. streamlit/runtime/media_file_storage.py +1 -1
  239. streamlit/runtime/memory_media_file_storage.py +1 -1
  240. streamlit/runtime/memory_session_storage.py +1 -1
  241. streamlit/runtime/memory_uploaded_file_manager.py +1 -1
  242. streamlit/runtime/metrics_util.py +2 -1
  243. streamlit/runtime/pages_manager.py +4 -2
  244. streamlit/runtime/runtime.py +22 -6
  245. streamlit/runtime/runtime_util.py +1 -1
  246. streamlit/runtime/script_data.py +1 -1
  247. streamlit/runtime/scriptrunner/__init__.py +1 -1
  248. streamlit/runtime/scriptrunner/exec_code.py +34 -1
  249. streamlit/runtime/scriptrunner/magic.py +1 -1
  250. streamlit/runtime/scriptrunner/magic_funcs.py +1 -1
  251. streamlit/runtime/scriptrunner/script_cache.py +1 -1
  252. streamlit/runtime/scriptrunner/script_runner.py +23 -12
  253. streamlit/runtime/scriptrunner_utils/__init__.py +1 -1
  254. streamlit/runtime/scriptrunner_utils/exceptions.py +1 -1
  255. streamlit/runtime/scriptrunner_utils/script_requests.py +2 -1
  256. streamlit/runtime/scriptrunner_utils/script_run_context.py +2 -2
  257. streamlit/runtime/secrets.py +1 -1
  258. streamlit/runtime/session_manager.py +2 -2
  259. streamlit/runtime/state/__init__.py +1 -1
  260. streamlit/runtime/state/common.py +1 -1
  261. streamlit/runtime/state/query_params.py +2 -2
  262. streamlit/runtime/state/query_params_proxy.py +15 -5
  263. streamlit/runtime/state/safe_session_state.py +1 -1
  264. streamlit/runtime/state/session_state.py +1 -1
  265. streamlit/runtime/state/session_state_proxy.py +1 -1
  266. streamlit/runtime/state/widgets.py +1 -1
  267. streamlit/runtime/stats.py +1 -1
  268. streamlit/runtime/uploaded_file_manager.py +1 -1
  269. streamlit/runtime/websocket_session_manager.py +2 -2
  270. streamlit/source_util.py +1 -1
  271. streamlit/static/index.html +3 -3
  272. streamlit/static/static/css/index.mUTQuMqR.css +1 -0
  273. streamlit/static/static/js/{FileDownload.esm.WslOojMp.js → FileDownload.esm.C1QvS8Zm.js} +1 -1
  274. streamlit/static/static/js/{FormClearHelper.DSgVZ-NK.js → FormClearHelper.mT4-5rFn.js} +1 -1
  275. streamlit/static/static/js/{Hooks.wzeYp0oD.js → Hooks.CVNEuaGG.js} +1 -1
  276. streamlit/static/static/js/InputInstructions.BCvAGBeC.js +1 -0
  277. streamlit/static/static/js/{ProgressBar.D1he2Gib.js → ProgressBar.CcQcYD9u.js} +2 -2
  278. streamlit/static/static/js/RenderInPortalIfExists.DHDG9PHn.js +1 -0
  279. streamlit/static/static/js/Toolbar.yTE_O6B7.js +1 -0
  280. streamlit/static/static/js/{base-input.gDrmzpbY.js → base-input.CQPY9_oN.js} +4 -4
  281. streamlit/static/static/js/createSuper.DE47Tkz4.js +1 -0
  282. streamlit/static/static/js/data-grid-overlay-editor.5JEQwfzp.js +1 -0
  283. streamlit/static/static/js/{downloader.B-SkHjg2.js → downloader.CX7_KkfB.js} +1 -1
  284. streamlit/static/static/js/{es6.DoVDVSd_.js → es6.Be2vwxoI.js} +2 -2
  285. streamlit/static/static/js/{iframeResizer.contentWindow.Exq_q4jU.js → iframeResizer.contentWindow.CFHofqC-.js} +1 -1
  286. streamlit/static/static/js/index.0OeiPvr3.js +1 -0
  287. streamlit/static/static/js/index.1GBg_Cdb.js +1 -0
  288. streamlit/static/static/js/index.4nNgvhbk.js +4 -0
  289. streamlit/static/static/js/index.5F9_LJ-9.js +1 -0
  290. streamlit/static/static/js/index.6v5ZgUAy.js +1 -0
  291. streamlit/static/static/js/index.8tVXPrLX.js +1 -0
  292. streamlit/static/static/js/index.AExANgn1.js +1 -0
  293. streamlit/static/static/js/index.AXOgS1NM.js +1 -0
  294. streamlit/static/static/js/index.B-xzXPZE.js +3 -0
  295. streamlit/static/static/js/index.B0pfFJGU.js +1 -0
  296. streamlit/static/static/js/index.BBjf7kH1.js +1 -0
  297. streamlit/static/static/js/index.BGICDmL0.js +201 -0
  298. streamlit/static/static/js/{index.rDDlhQFp.js → index.BOeLQ18h.js} +1 -1
  299. streamlit/static/static/js/index.BUgJRfqp.js +3 -0
  300. streamlit/static/static/js/index.BpeIAypN.js +1 -0
  301. streamlit/static/static/js/{index.BjQJsYG6.js → index.C0ZNaKGF.js} +1 -1
  302. streamlit/static/static/js/index.C3eR9AQ5.js +1 -0
  303. streamlit/static/static/js/index.CCmrDm8Z.js +2 -0
  304. streamlit/static/static/js/index.CHuo89tL.js +1 -0
  305. streamlit/static/static/js/index.Cbi_d9ak.js +197 -0
  306. streamlit/static/static/js/{index.CyRDf6c5.js → index.Cg7T4wJt.js} +3 -3
  307. streamlit/static/static/js/index.Ci3iebpl.js +1 -0
  308. streamlit/static/static/js/index.CjsaBedq.js +1 -0
  309. streamlit/static/static/js/{index.CLHVvMN0.js → index.CvqaNor_.js} +139 -128
  310. streamlit/static/static/js/index.D0lxtOCO.js +2 -0
  311. streamlit/static/static/js/index.D1AD4NsW.js +1 -0
  312. streamlit/static/static/js/{index.4lqQPLdu.js → index.DLjk_wlB.js} +1 -1
  313. streamlit/static/static/js/{index.DfwGDOWW.js → index.DNDhYAPI.js} +2 -2
  314. streamlit/static/static/js/index.DY6666R7.js +1 -0
  315. streamlit/static/static/js/{index.DaTKmBKa.js → index.Dkr_c_9x.js} +100 -100
  316. streamlit/static/static/js/{index.Bcz23DKe.js → index.Hhv6gSq2.js} +12 -12
  317. streamlit/static/static/js/{index.Bm2n8u7I.js → index.OM83ZHKg.js} +2 -2
  318. streamlit/static/static/js/index.SLleoa9s.js +1 -0
  319. streamlit/static/static/js/{index.2Rr5kbVL.js → index.XCwDes79.js} +1 -1
  320. streamlit/static/static/js/{index.B_RzfO7U.js → index.a6pesEXT.js} +1 -1
  321. streamlit/static/static/js/{index.CAkYXoVB.js → index.er3Zfn3e.js} +2 -2
  322. streamlit/static/static/js/{index.CZ-znj8N.js → index.mtSGfsND.js} +1 -1
  323. streamlit/static/static/js/{input.28wXD4uV.js → input.B07wSbwn.js} +2 -2
  324. streamlit/static/static/js/{memory.jbWyoc5k.js → memory.CC_p93jh.js} +1 -1
  325. streamlit/static/static/js/mergeWith.ivc75cD1.js +1 -0
  326. streamlit/static/static/js/number-overlay-editor.Db2Be6nq.js +9 -0
  327. streamlit/static/static/js/possibleConstructorReturn.BNprLGNF.js +1 -0
  328. streamlit/static/static/js/{sandbox.CfK9-cKf.js → sandbox.BlG3HhHL.js} +1 -1
  329. streamlit/static/static/js/{textarea.C5OZk1uL.js → textarea.Bz6Z-kmO.js} +2 -2
  330. streamlit/static/static/js/threshold.B8r8f5kt.js +1 -0
  331. streamlit/static/static/js/{timepicker.DEpQEk7W.js → timepicker.BMSb5NlP.js} +3 -3
  332. streamlit/static/static/js/timer.RueuYoQV.js +1 -0
  333. streamlit/static/static/js/toConsumableArray.uYLXBIlD.js +3 -0
  334. streamlit/static/static/js/uniqueId.BdisvZXg.js +1 -0
  335. streamlit/static/static/js/{useBasicWidgetState.C2DsWpWi.js → useBasicWidgetState.BJFGEQDL.js} +1 -1
  336. streamlit/static/static/js/{useOnInputChange.Bw6YkmJD.js → useOnInputChange.BmSN_ACz.js} +1 -1
  337. streamlit/static/static/js/value.iufjd77T.js +1 -0
  338. streamlit/static/static/js/withFullScreenWrapper.CbOOMX5j.js +1 -0
  339. streamlit/static/static/media/MaterialSymbols-Rounded.DzyB5T7Y.woff2 +0 -0
  340. streamlit/string_util.py +1 -1
  341. streamlit/temporary_directory.py +1 -1
  342. streamlit/testing/__init__.py +1 -1
  343. streamlit/testing/v1/__init__.py +1 -1
  344. streamlit/testing/v1/app_test.py +1 -1
  345. streamlit/testing/v1/element_tree.py +1 -1
  346. streamlit/testing/v1/local_script_runner.py +1 -1
  347. streamlit/testing/v1/util.py +1 -1
  348. streamlit/time_util.py +1 -1
  349. streamlit/type_util.py +2 -2
  350. streamlit/url_util.py +24 -1
  351. streamlit/user_info.py +445 -25
  352. streamlit/util.py +1 -1
  353. streamlit/version.py +1 -1
  354. streamlit/watcher/__init__.py +1 -1
  355. streamlit/watcher/event_based_path_watcher.py +1 -1
  356. streamlit/watcher/folder_black_list.py +1 -1
  357. streamlit/watcher/local_sources_watcher.py +5 -3
  358. streamlit/watcher/path_watcher.py +1 -1
  359. streamlit/watcher/polling_path_watcher.py +1 -1
  360. streamlit/watcher/util.py +87 -21
  361. streamlit/web/__init__.py +1 -1
  362. streamlit/web/bootstrap.py +22 -2
  363. streamlit/web/cache_storage_manager_config.py +1 -1
  364. streamlit/web/cli.py +1 -1
  365. streamlit/web/server/__init__.py +1 -1
  366. streamlit/web/server/app_static_file_handler.py +1 -1
  367. streamlit/web/server/authlib_tornado_integration.py +58 -0
  368. streamlit/web/server/browser_websocket_handler.py +73 -7
  369. streamlit/web/server/component_request_handler.py +1 -1
  370. streamlit/web/server/media_file_handler.py +1 -1
  371. streamlit/web/server/oauth_authlib_routes.py +176 -0
  372. streamlit/web/server/oidc_mixin.py +108 -0
  373. streamlit/web/server/routes.py +6 -4
  374. streamlit/web/server/server.py +41 -4
  375. streamlit/web/server/server_util.py +25 -1
  376. streamlit/web/server/stats_request_handler.py +1 -1
  377. streamlit/web/server/upload_file_request_handler.py +3 -2
  378. streamlit/web/server/websocket_headers.py +1 -1
  379. {streamlit_nightly-1.41.2.dev20241227.data → streamlit_nightly-1.41.2.dev20250124.data}/scripts/streamlit.cmd +1 -1
  380. {streamlit_nightly-1.41.2.dev20241227.dist-info → streamlit_nightly-1.41.2.dev20250124.dist-info}/METADATA +16 -4
  381. streamlit_nightly-1.41.2.dev20250124.dist-info/RECORD +560 -0
  382. {streamlit_nightly-1.41.2.dev20241227.dist-info → streamlit_nightly-1.41.2.dev20250124.dist-info}/WHEEL +1 -1
  383. streamlit/static/static/css/index.ZIJkhegp.css +0 -1
  384. streamlit/static/static/js/InputInstructions.DpTmOmkP.js +0 -1
  385. streamlit/static/static/js/RenderInPortalIfExists.CphMKHZ_.js +0 -1
  386. streamlit/static/static/js/Toolbar.YZjXpW2P.js +0 -1
  387. streamlit/static/static/js/_commonjs-dynamic-modules.TDtrdbi3.js +0 -1
  388. streamlit/static/static/js/createSuper.Cj3WfXha.js +0 -1
  389. streamlit/static/static/js/data-grid-overlay-editor.CXW3Vrt9.js +0 -1
  390. streamlit/static/static/js/getPrototypeOf.BZAK2f3t.js +0 -1
  391. streamlit/static/static/js/index.1auHKWgw.js +0 -3
  392. streamlit/static/static/js/index.2XFKVtzu.js +0 -1
  393. streamlit/static/static/js/index.B9O1l5Yf.js +0 -32
  394. streamlit/static/static/js/index.BjtDBCFh.js +0 -2
  395. streamlit/static/static/js/index.Bp-uIPRI.js +0 -1
  396. streamlit/static/static/js/index.BrGYP4fV.js +0 -1
  397. streamlit/static/static/js/index.BwUmNKlx.js +0 -1
  398. streamlit/static/static/js/index.CCVCD0op.js +0 -1
  399. streamlit/static/static/js/index.CP7C0jmi.js +0 -1
  400. streamlit/static/static/js/index.CVNaQiWI.js +0 -4
  401. streamlit/static/static/js/index.CX7qwffH.js +0 -1
  402. streamlit/static/static/js/index.CaCnIXu_.js +0 -1
  403. streamlit/static/static/js/index.Ck6XWYeb.js +0 -1
  404. streamlit/static/static/js/index.CmD2DSvp.js +0 -201
  405. streamlit/static/static/js/index.CnX4MRBV.js +0 -1
  406. streamlit/static/static/js/index.DR8k91Kp.js +0 -1
  407. streamlit/static/static/js/index.Dc0EFNHf.js +0 -197
  408. streamlit/static/static/js/index.M9USxdKN.js +0 -1
  409. streamlit/static/static/js/index.MCDV8ab_.js +0 -1
  410. streamlit/static/static/js/index.T4c5nSGV.js +0 -2
  411. streamlit/static/static/js/index.brVZtr01.js +0 -1
  412. streamlit/static/static/js/index.fm1fEqFi.js +0 -1
  413. streamlit/static/static/js/index.vm3Bds7I.js +0 -1
  414. streamlit/static/static/js/index.y_EIxzAg.js +0 -1
  415. streamlit/static/static/js/number-overlay-editor.D5dgP2YW.js +0 -9
  416. streamlit/static/static/js/slicedToArray.DVgs1NsC.js +0 -2
  417. streamlit/static/static/js/string.Bl9OLDCw.js +0 -1
  418. streamlit/static/static/js/threshold.skajmqVB.js +0 -1
  419. streamlit/static/static/js/timer.DwZfkapc.js +0 -1
  420. streamlit/static/static/js/uniqueId.OJw6SDpp.js +0 -1
  421. streamlit/static/static/js/withFullScreenWrapper.BjS0eA06.js +0 -1
  422. streamlit/static/static/media/MaterialSymbols-Rounded.MYSe4dsi.woff2 +0 -0
  423. streamlit/vendor/ipython/__init__.py +0 -0
  424. streamlit/vendor/ipython/modified_sys_path.py +0 -67
  425. streamlit_nightly-1.41.2.dev20241227.dist-info/RECORD +0 -556
  426. /streamlit/static/static/css/{index.B26BQfSF.css → index.Bmkmz40k.css} +0 -0
  427. /streamlit/static/static/css/{index.CG16XVnL.css → index.DzuxGC_t.css} +0 -0
  428. {streamlit_nightly-1.41.2.dev20241227.dist-info → streamlit_nightly-1.41.2.dev20250124.dist-info}/entry_points.txt +0 -0
  429. {streamlit_nightly-1.41.2.dev20241227.dist-info → streamlit_nightly-1.41.2.dev20250124.dist-info}/top_level.txt +0 -0
@@ -1,2 +0,0 @@
1
- import{b2 as Z,b3 as J,r as f,b4 as Q,M as ee,b5 as s,j as b,a7 as K,a_ as te,b6 as re,b7 as ne,a$ as oe,aK as ae,b0 as ie,aY as ue,aG as j,aF as W,am as le,a1 as ce,F as se}from"./index.CLHVvMN0.js";import{a as fe}from"./useBasicWidgetState.C2DsWpWi.js";import"./FormClearHelper.DSgVZ-NK.js";var pe={primary:"primary",secondary:"secondary",tertiary:"tertiary"},G={default:"default",pill:"pill",round:"round",circle:"circle",square:"square"},de={mini:"mini",default:"default",compact:"compact",large:"large"},C=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=Z("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function D(e){"@babel/helpers - typeof";return D=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},D(e)}function M(){return M=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},M.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 ye(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){N(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 me(e,t){return ve(e)||ge(e,t)||he(e,t)||be()}function be(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
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 F(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 F(e,t)}}function F(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 ge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,p;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(c){a=!0,p=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw p}}return n}}function ve(e){if(Array.isArray(e))return e}function Se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oe(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 _e(e,t,r){return t&&Oe(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&&$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(e,t)}function we(e){var t=Re();return function(){var n=k(e),o;if(t){var a=k(this).constructor;o=Reflect.construct(n,arguments,a)}else o=n.apply(this,arguments);return Le(this,o)}}function Le(e,t){if(t&&(D(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X(e)}function X(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Re(){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 k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},k(e)}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pe(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=we(r);function r(){var n;Se(this,r);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=t.call.apply(t,[this].concat(a)),N(X(n),"childRefs",{}),n}return _e(r,[{key:"render",value:function(){var o=this,a=this.props,i=a.overrides,p=i===void 0?{}:i,c=a.mode,P=c===void 0?C.checkbox:c,d=a.children,y=a.selected,h=a.disabled,l=a.onClick,E=a.kind,g=a.shape,w=a.size,I=J(p.Root,z),O=me(I,2),_=O[0],L=O[1],q=this.props["aria-label"]||this.props.ariaLabel,v=P===C.radio,V=f.Children.count(d);return f.createElement(Q.Consumer,null,function(Y){return f.createElement(_,M({"aria-label":q||Y.buttongroup.ariaLabel,"data-baseweb":"button-group",role:v?"radiogroup":"group",$shape:g,$length:d.length},L),f.Children.map(d,function(m,R){if(!f.isValidElement(m))return null;var A=m.props.isSelected?m.props.isSelected:Pe(y,R);return v&&(o.childRefs[R]=f.createRef()),f.cloneElement(m,{disabled:h||m.props.disabled,isSelected:A,ref:v?o.childRefs[R]:void 0,tabIndex:!v||A||v&&(!y||y===-1)&&R===0?0:-1,onKeyDown:function(u){if(v){var S=Number(y)?Number(y):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var T=S-1<0?V-1:S-1;l&&l(u,T),o.childRefs[T].current&&o.childRefs[T].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var B=S+1>V-1?0:S+1;l&&l(u,B),o.childRefs[B].current&&o.childRefs[B].current.focus()}}},kind:E,onClick:function(u){h||(m.props.onClick&&m.props.onClick(u),l&&l(u,R))},shape:g,size:w,overrides:ye({BaseButton:{style:function(u){var S=u.$theme;return d.length===1?{}:g!==G.default?{marginLeft:S.sizing.scale100,marginRight:S.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":A,role:v?"radio":"checkbox"}}},m.props.overrides)})}))})}}]),r}(f.Component);N(H,"defaultProps",{disabled:!1,onClick:function(){},shape:G.default,size:de.default,kind:pe.secondary});function Ce(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function ke(e,t,r){return e==s.ClickMode.MULTI_SELECT?Ce(t,r??[]):r!=null&&r.includes(t)?[]:[t]}function Ie(e){return e.length===0?-1:e[0]}function Ae(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Te(e,t,r){const n=r===s.Style.PILLS?j.PILLS:r===s.Style.BORDERLESS?j.BORDERLESS_ICON:j.SEGMENTED_CONTROL,o=r===s.Style.BORDERLESS?W.XSMALL:W.MEDIUM,a=r===s.Style.BORDERLESS?"lg":"base";return{element:K(se,{children:[t&&b(le,{size:a,iconValue:t}),e&&b(ce,{source:e,allowHTML:!1})]}),kind:n,size:o}}function Be(e,t,r,n){return r.indexOf(n)>-1?!0:t!==s.ClickMode.SINGLE_SELECT||e!==s.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function je(e,t){return e&&(t=`${t}Active`),t}function De(e,t){const r={flexWrap:"wrap",maxWidth:"fit-content"};switch(e){case s.Style.BORDERLESS:return{...r,columnGap:t.threeXS,rowGap:t.threeXS};case s.Style.PILLS:return{...r,columnGap:t.twoXS,rowGap:t.twoXS};case s.Style.SEGMENTED_CONTROL:return{...r,columnGap:t.none,rowGap:t.twoXS,"::after":{content:"''",flex:1e4}};default:return r}}function Me(e,t,r,n,o,a){const i=Be(r,n,o,t);let p=e.content,c=e.contentIcon;return i&&(p=e.selectedContent?e.selectedContent:p,c=e.selectedContentIcon?e.selectedContentIcon:c),f.forwardRef(function(d,y){const{element:h,kind:l,size:E}=Te(p??"",c??void 0,a),g=je(!!(i&&!e.selectedContent&&!e.selectedContentIcon),l);return b(ue,{...d,size:E,kind:g,children:h})})}function $e(e,t){return e.getIntArrayValue(t)}function Ge(e){return e.default??null}function ze(e){return e.value??null}function Ne(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o}=e,{clickMode:a,options:i,selectionVisualization:p,style:c,label:P,labelVisibility:d,help:y}=r,h=ee(),[l,E]=fe({getStateFromWidgetMgr:$e,getDefaultStateFromProto:Ge,getCurrStateFromProto:ze,updateWidgetMgrState:Ae,element:r,widgetMgr:o,fragmentId:n}),g=(O,_)=>{const L=ke(a,_,l);E({value:L,fromUi:!0})};let w;a===s.ClickMode.SINGLE_SELECT?w=C.radio:a===s.ClickMode.MULTI_SELECT&&(w=C.checkbox);const I=f.useMemo(()=>i.map((O,_)=>{const L=Me(O,_,p,a,l,c);return b(L,{},`${O.content}-${_}`)}),[a,i,p,c,l]);return K("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[b(ie,{label:P,disabled:t,labelVisibility:te((d==null?void 0:d.value)??re.LabelVisibilityOptions.COLLAPSED),children:y&&b(ne,{children:b(oe,{content:y,placement:ae.TOP})})}),b(H,{disabled:t,mode:w,onClick:g,selected:a===s.ClickMode.MULTI_SELECT?l:Ie(l),overrides:{Root:{style:f.useCallback(()=>De(c,h.spacing),[c,h.spacing])}},children:I})]})}const xe=f.memo(Ne);export{xe as default};
@@ -1 +0,0 @@
1
- import{n as l,a7 as g,j as s}from"./index.CLHVvMN0.js";import{S as m,T as y}from"./Toolbar.YZjXpW2P.js";import{w as h,u as W,E as b}from"./withFullScreenWrapper.BjS0eA06.js";const F=l("div",{target:"e1kqg1ss0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:t.spacing.lg,maxWidth:"100%",width:"fit-content"})),O=l("div",{target:"e1kqg1ss1"})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:t.radii.default}})),E=l("div",{target:"e1kqg1ss2"})(({theme:t})=>({fontFamily:t.genericFonts.bodyFont,fontSize:t.fontSizes.sm,color:t.colors.fadedText60,textAlign:"center",marginTop:t.spacing.xs,wordWrap:"break-word",padding:t.spacing.threeXS}));var p;(function(t){t[t.OriginalWidth=-1]="OriginalWidth",t[t.ColumnWidth=-2]="ColumnWidth",t[t.AutoWidth=-3]="AutoWidth",t[t.MinImageOrContainer=-4]="MinImageOrContainer",t[t.MaxImageOrContainer=-5]="MaxImageOrContainer"})(p||(p={}));function M({element:t,width:u,endpoints:f,disableFullscreenMode:x}){const{expanded:i,width:w,height:o,expand:C,collapse:I}=W(b),d=i?w:u;let a;const n=t.width;if([-1,-3,-4].includes(n))a=void 0;else if([-2,-5].includes(n))a=d;else if(n>0)a=n;else throw Error(`Invalid image width: ${n}`);const e={};return o&&i?(e.maxHeight=o,e.objectFit="contain"):(e.width=a,e.maxWidth="100%"),g(m,{width:d,height:o,useContainerWidth:i,topCentered:!0,children:[s(y,{target:m,isFullScreen:i,onExpand:C,onCollapse:I,disableFullscreenMode:x}),s(F,{className:"stImage","data-testid":"stImage",children:t.imgs.map((S,c)=>{const r=S;return g(O,{"data-testid":"stImageContainer",children:[s("img",{style:e,src:f.buildMediaURL(r.url),alt:c.toString()}),r.caption&&s(E,{"data-testid":"stImageCaption",style:e,children:` ${r.caption} `})]},c)})})]})}const q=h(M);export{q as default};
@@ -1 +0,0 @@
1
- import{n as W,r as l,M as T,bv as C,bw as V,a7 as L,j as r,a_ as O,bb as $,a$ as k,aK as N,b0 as P,bu as E,bx as A,bq as B,b9 as F,by as H}from"./index.CLHVvMN0.js";import{a as D}from"./useBasicWidgetState.C2DsWpWi.js";import"./FormClearHelper.DSgVZ-NK.js";const K=W("div",{target:"e3xgtfu0"})(({theme:s})=>({"span[aria-disabled='true']":{background:s.colors.fadedText05}})),U=(s,t)=>s.getIntArrayValue(t),j=s=>s.default??null,G=s=>s.value??null,_=(s,t,a,u)=>{t.setIntArrayValue(s,a.value,{fromUi:a.fromUi},u)},Y=s=>{var S;const{element:t,widgetMgr:a,width:u,fragmentId:y}=s,e=T(),[n,g]=D({getStateFromWidgetMgr:U,getDefaultStateFromProto:j,getCurrStateFromProto:G,updateWidgetMgrState:_,element:t,widgetMgr:a,fragmentId:y}),m=t.maxSelections>0&&n.length>=t.maxSelections,f=l.useMemo(()=>{if(t.maxSelections===0)return"No results";if(n.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,n.length]),v=l.useMemo(()=>n.map(o=>{const i=t.options[o];return{value:o.toString(),label:i}}),[t.options,n]),h=l.useCallback(o=>{const i=()=>{var d;const p=(d=o.option)==null?void 0:d.value;return parseInt(p,10)};switch(o.type){case"remove":return C(n,i());case"clear":return[];case"select":return n.concat([i()]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[n]),x=l.useCallback(o=>{t.maxSelections&&o.type==="select"&&n.length>=t.maxSelections||g({value:h(o),fromUi:!0})},[t.maxSelections,h,g,n.length]),z=l.useCallback((o,i)=>{if(m)return[];const p=o.filter(d=>!n.includes(Number(d.value)));return V(p,i)},[m,n]),w={width:u},{options:c}=t,b=c.length===0?!0:s.disabled,I=c.length===0?"No options to select.":t.placeholder,M=c.map((o,i)=>({label:o,value:i.toString()})),R=c.length>10;return L("div",{className:"stMultiSelect","data-testid":"stMultiSelect",style:w,children:[r(P,{label:t.label,disabled:b,labelVisibility:O((S=t.labelVisibility)==null?void 0:S.value),children:t.help&&r($,{children:r(k,{content:t.help,placement:N.TOP_RIGHT})})}),r(K,{children:r(E,{options:M,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:I,type:A.select,multi:!0,onChange:x,value:v,disabled:b,size:"compact",noResultsMsg:f,filterOptions:z,closeOnSelect:!1,overrides:{SelectArrow:{component:B,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",opacity:"0.7"})},ValueContainer:{style:()=>({paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:F&&R===!1?"readonly":null}},Dropdown:{component:H}}})})]})},Q=l.memo(Y);export{Q as default};
@@ -1 +0,0 @@
1
- import{n as s,R as g,a6 as x,aJ as b,M as C,j as n,aH as v,aK as L,a7 as y,am as w,a1 as S}from"./index.CLHVvMN0.js";const T=s("div",{target:"e15akk1j0"})({display:"flex",flexDirection:"column"}),h=s("a",{target:"e15akk1j1"})(({disabled:r,isCurrentPage:o,fluidWidth:t,theme:e})=>({textDecoration:"none",width:typeof t=="number"?`${t}px`:"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),H=s("span",{target:"e15akk1j2"})(({disabled:r,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function P(r,o){return r===null&&o?!0:r===null&&!o?!1:r===!0}function B(r){const{onPageChange:o,currentPageScriptHash:t}=g.useContext(x),e=g.useContext(b),{colors:u}=C(),{disabled:l,element:a,width:i}=r,p={width:i},f=P(a.useContainerWidth,e),c=t===a.pageScriptHash,k=d=>{a.external?l&&d.preventDefault():(d.preventDefault(),l||o(a.pageScriptHash))};return n("div",{className:"stPageLink","data-testid":"stPageLink",style:p,children:n(v,{help:a.help,placement:L.TOP_RIGHT,children:n(T,{children:y(h,{"data-testid":"stPageLink-NavLink",disabled:l,isCurrentPage:c,fluidWidth:f?i:!1,href:a.page,target:a.external?"_blank":"",rel:"noreferrer",onClick:k,children:[a.icon&&n(w,{size:"lg",color:u.bodyText,iconValue:a.icon}),n(H,{disabled:l,children:n(S,{source:a.label,allowHTML:!1,isLabel:!0,boldLabel:c,largerLabel:!0,disableLinks:!0})})]})})})})}export{B as default};
@@ -1 +0,0 @@
1
- import{n as U,r as s,aR as V,j as l}from"./index.CLHVvMN0.js";const b=U("iframe",{target:"e1iolsnz0"})(({theme:a})=>({colorScheme:"normal",border:"none",padding:a.spacing.none,margin:a.spacing.none,width:"100%",aspectRatio:"16 / 9"})),P=528;function w({element:a,width:f,endpoints:m,elementMgr:c}){const i=s.useRef(null),{type:E,url:p,startTime:n,subtitles:v,endTime:d,loop:u,autoplay:T,muted:h}=a,S=s.useMemo(()=>{if(!a.id)return!0;const e=c.getElementState(a.id,"preventAutoplay");return e||c.setElementState(a.id,"preventAutoplay",!0),e??!1},[a.id,c]);s.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),s.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=a.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[a]),s.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const o=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",o),()=>{e&&d>0&&e.removeEventListener("timeupdate",o)}},[d,u,n]),s.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const g=e=>{const{startTime:t,endTime:o,loop:L,autoplay:N,muted:R}=a,r=new URL(e);if(t&&!isNaN(t)&&r.searchParams.append("start",t.toString()),o&&!isNaN(o)&&r.searchParams.append("end",o.toString()),L){r.searchParams.append("loop","1");const y=r.pathname.split("/").pop();y&&r.searchParams.append("playlist",y)}return N&&r.searchParams.append("autoplay","1"),R&&r.searchParams.append("mute","1"),r.toString()};return E===V.Type.YOUTUBE_IFRAME?l(b,{className:"stVideo","data-testid":"stVideo",title:p,src:g(p),allow:"autoplay; encrypted-media",allowFullScreen:!0}):l("video",{className:"stVideo","data-testid":"stVideo",ref:i,controls:!0,muted:h,autoPlay:T&&!S,src:m.buildMediaURL(p),style:{width:f,height:f===0?P:void 0},crossOrigin:void 0,children:v&&v.map((e,t)=>l("track",{kind:"captions",src:m.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0},t))})}export{w as default};
@@ -1 +0,0 @@
1
- import{r as y,E as P,_ as T,n as E,Q,a7 as x,j as h,b1 as J,aK as A,aY as K,aG as Y,aX as O,b8 as B,d as Z,g as ee,ai as te,M as re,b9 as ie,ba as oe,R as ae,O as ne,$ as se,A as _,at as W,aU as le,aT as de,a_ as ce,bb as ue,a$ as pe,b0 as fe,F as he}from"./index.CLHVvMN0.js";import{F as ge}from"./FormClearHelper.DSgVZ-NK.js";import{U as L}from"./UploadFileInfo.C-jY39rj.js";import{P as me,S as ve}from"./ProgressBar.D1he2Gib.js";var $=y.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(P,T({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:l}),y.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});$.displayName="Video";var z=y.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(P,T({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:l}),y.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});z.displayName="X";var N=y.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(P,T({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:l}),y.createElement("rect",{width:24,height:24,fill:"none"}),y.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});N.displayName="SwitchCamera";var j;(function(t){t.XSMALL="xsmall",t.SMALL="small",t.MEDIUM="medium",t.LARGE="large"})(j||(j={}));function Se(t,l){switch(t){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const H=E("div",{target:"e19i1xpo0"})({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"}),V=E("div",{target:"e19i1xpo1"})(({theme:t,width:l})=>({backgroundColor:t.colors.secondaryBg,borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"})),ye=E("p",{target:"e19i1xpo2"})(({theme:t})=>({marginTop:t.spacing.sm,textAlign:"center"})),Me=E("img",{target:"e19i1xpo3"})(({theme:t,opacity:l})=>({borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,objectFit:"contain",opacity:l})),be=E("a",{target:"e19i1xpo4"})(({theme:t})=>({color:t.colors.primary,display:"block",textDecoration:"none"})),we=E("span",{target:"e19i1xpo5"})({display:"flex",alignItems:"center"}),Ue=E("div",{target:"e19i1xpo6"})(({theme:t})=>({position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:t.zIndices.priority,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6})),Ce=E("div",{target:"e19i1xpo8"})({height:"fit-content",width:"100%",position:"absolute",bottom:0}),Ee=E("button",{target:"e19i1xpo9"})(({theme:t})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,borderRadius:`0 0 ${t.radii.default} ${t.radii.default}`,"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:`${t.spacing.xs} ${t.spacing.md}`,margin:t.spacing.none,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${Q(t.colors.primary,.5)}`},...Se("medium",t)}));function D({disabled:t,onClick:l,children:r,progress:a}){return x(Ee,{disabled:t||!1,onClick:l||(()=>{}),progress:a||null,"data-testid":"stCameraInputButton",children:[r,a&&h(Ce,{children:h(me,{value:a,size:ve.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})})]})}var F;(function(t){t.USER="user",t.ENVIRONMENT="environment"})(F||(F={}));const Ie=({switchFacingMode:t})=>h(Ue,{"data-testid":"stCameraInputSwitchButton",children:h(J,{content:"Switch camera",placement:A.TOP_RIGHT,children:h(K,{kind:Y.MINIMAL,onClick:t,children:h(O,{content:N,size:"twoXL",color:B.white})})})});var G={exports:{}};(function(t,l){(function(a,o){t.exports=o(y)})(Z,function(r){return function(a){var o={};function n(s){if(o[s])return o[s].exports;var p=o[s]={i:s,l:!1,exports:{}};return a[s].call(p.exports,p,p.exports,n),p.l=!0,p.exports}return n.m=a,n.c=o,n.d=function(s,p,g){n.o(s,p)||Object.defineProperty(s,p,{enumerable:!0,get:g})},n.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},n.t=function(s,p){if(p&1&&(s=n(s)),p&8||p&4&&typeof s=="object"&&s&&s.__esModule)return s;var g=Object.create(null);if(n.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:s}),p&2&&typeof s!="string")for(var C in s)n.d(g,C,(function(U){return s[U]}).bind(null,C));return g},n.n=function(s){var p=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(p,"a",p),p},n.o=function(s,p){return Object.prototype.hasOwnProperty.call(s,p)},n.p="",n(n.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(a,o,n){n.r(o);var s=n("react"),p=function(){var m=function(u,e){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,d){i.__proto__=d}||function(i,d){for(var c in d)d.hasOwnProperty(c)&&(i[c]=d[c])},m(u,e)};return function(u,e){m(u,e);function i(){this.constructor=u}u.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}(),g=function(){return g=Object.assign||function(m){for(var u,e=1,i=arguments.length;e<i;e++){u=arguments[e];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(m[d]=u[d])}return m},g.apply(this,arguments)},C=function(m,u){var e={};for(var i in m)Object.prototype.hasOwnProperty.call(m,i)&&u.indexOf(i)<0&&(e[i]=m[i]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,i=Object.getOwnPropertySymbols(m);d<i.length;d++)u.indexOf(i[d])<0&&Object.prototype.propertyIsEnumerable.call(m,i[d])&&(e[i[d]]=m[i[d]]);return e};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(u){var e=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return e?new Promise(function(i,d){e.call(navigator,u,i,d)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=function(m){p(u,m);function u(e){var i=m.call(this,e)||this;return i.canvas=null,i.ctx=null,i.requestUserMediaId=0,i.unmounted=!1,i.state={hasUserMedia:!1},i}return u.prototype.componentDidMount=function(){var e=this,i=e.state,d=e.props;if(this.unmounted=!1,!U()){d.onUserMediaError("getUserMedia not supported");return}i.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},u.prototype.componentDidUpdate=function(e){var i=this.props;if(!U()){i.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(e.audioConstraints)!==JSON.stringify(i.audioConstraints),c=JSON.stringify(e.videoConstraints)!==JSON.stringify(i.videoConstraints),M=e.minScreenshotWidth!==i.minScreenshotWidth,S=e.minScreenshotHeight!==i.minScreenshotHeight;(c||M||S)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},u.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},u.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map(function(i){e.removeTrack(i),i.stop()}),e.getAudioTracks().map(function(i){e.removeTrack(i),i.stop()})):e.stop())},u.prototype.stopAndCleanup=function(){var e=this.state;e.hasUserMedia&&(u.stopMediaStream(this.stream),e.src&&window.URL.revokeObjectURL(e.src))},u.prototype.getScreenshot=function(e){var i=this,d=i.state,c=i.props;if(!d.hasUserMedia)return null;var M=this.getCanvas(e);return M&&M.toDataURL(c.screenshotFormat,c.screenshotQuality)},u.prototype.getCanvas=function(e){var i=this,d=i.state,c=i.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var M=this.video.videoWidth,S=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var f=M/S;M=c.minScreenshotWidth||this.video.clientWidth,S=M/f,c.minScreenshotHeight&&S<c.minScreenshotHeight&&(S=c.minScreenshotHeight,M=S*f)}this.canvas=document.createElement("canvas"),this.canvas.width=(e==null?void 0:e.width)||M,this.canvas.height=(e==null?void 0:e.height)||S,this.ctx=this.canvas.getContext("2d")}var w=this,b=w.ctx,v=w.canvas;return b&&v&&(v.width=(e==null?void 0:e.width)||v.width,v.height=(e==null?void 0:e.height)||v.height,c.mirrored&&(b.translate(v.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,(e==null?void 0:e.width)||v.width,(e==null?void 0:e.height)||v.height),c.mirrored&&(b.scale(-1,1),b.translate(-v.width,0))),v},u.prototype.requestUserMedia=function(){var e=this,i=this.props,d=function(S,f){var w={video:typeof f<"u"?f:!0};i.audio&&(w.audio=typeof S<"u"?S:!0),e.requestUserMediaId++;var b=e.requestUserMediaId;navigator.mediaDevices.getUserMedia(w).then(function(v){e.unmounted||b!==e.requestUserMediaId?u.stopMediaStream(v):e.handleUserMedia(null,v)}).catch(function(v){e.handleUserMedia(v)})};if("mediaDevices"in navigator)d(i.audioConstraints,i.videoConstraints);else{var c=function(S){return{optional:[{sourceId:S}]}},M=function(S){var f=S.deviceId;return typeof f=="string"?f:Array.isArray(f)&&f.length>0?f[0]:typeof f=="object"&&f.ideal?f.ideal:null};MediaStreamTrack.getSources(function(S){var f=null,w=null;S.forEach(function(R){R.kind==="audio"?f=R.id:R.kind==="video"&&(w=R.id)});var b=M(i.audioConstraints);b&&(f=b);var v=M(i.videoConstraints);v&&(w=v),d(c(f),c(w))})}},u.prototype.handleUserMedia=function(e,i){var d=this.props;if(e||!i){this.setState({hasUserMedia:!1}),d.onUserMediaError(e);return}this.stream=i;try{this.video&&(this.video.srcObject=i),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(i)})}d.onUserMedia(i)},u.prototype.render=function(){var e=this,i=this,d=i.state,c=i.props,M=c.audio;c.forceScreenshotSourceSize,c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var S=c.mirrored,f=c.style,w=f===void 0?{}:f,b=c.children,v=C(c,["audio","forceScreenshotSourceSize","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),R=S?g(g({},w),{transform:(w.transform||"")+" scaleX(-1)"}):w,X={getScreenshot:this.getScreenshot.bind(this)};return s.createElement(s.Fragment,null,s.createElement("video",g({autoPlay:!0,src:d.src,muted:!M,playsInline:!0,ref:function(q){e.video=q},style:R},v)),b&&b(X))},u.defaultProps={audio:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},u}(s.Component);o.default=I},react:function(a,o){a.exports=r}}).default})})(G);var Fe=G.exports;const xe=ee(Fe);var k;(function(t){t.PENDING="pending",t.SUCCESS="success",t.ERROR="error"})(k||(k={}));const Re=({width:t})=>x(V,{width:t,children:[h(O,{size:"threeXL",color:B.gray60,content:$}),x(ye,{children:["This app would like to use your camera.",h(be,{href:oe,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),_e=({handleCapture:t,width:l,disabled:r,clearPhotoInProgress:a,setClearPhotoInProgress:o,facingMode:n,setFacingMode:s,testOverride:p})=>{const[g,C]=y.useState(p||"pending"),U=y.useRef(null),[I,m]=y.useState(l),u=y.useCallback(te(1e3,m),[]);y.useEffect(()=>{u(l)},[l,u]);function e(){if(U.current!==null){const d=U.current.getScreenshot();t(d)}}const i=re();return x(H,{"data-testid":"stCameraInputWebcamComponent",children:[g!=="success"&&!r&&!a?h(Re,{width:I}):ie&&h(Ie,{switchFacingMode:s}),h(V,{"data-testid":"stCameraInputWebcamStyledBox",hidden:g!=="success"&&!r&&!a,width:I,children:!r&&h(xe,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${i.radii.default} ${i.radii.default} 0 0`},onUserMediaError:()=>{C("error")},onUserMedia:()=>{C("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:n}})}),h(D,{onClick:e,disabled:g!=="success"||r||a,children:"Take Photo"})]})},Pe=150;class je extends ae.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new ge,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=r=>{this.setState({clearPhotoInProgress:r})},this.setFacingMode=()=>{this.setState(r=>({facingMode:r.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=r=>{if(r===null)return Promise.resolve();this.setState({imgSrc:r,shutter:!0,minShutterEffectPassed:!1});const a=o=>new Promise(n=>setTimeout(n,o));return Te(r,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(n=>({file:o,fileUrls:n[0]}))).then(({file:o,fileUrls:n})=>this.uploadFile(n,o)).then(()=>a(Pe)).then(()=>{this.setState((o,n)=>({imgSrc:r,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{ne(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(r=>this.deleteFile(r.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const r=this.createWidgetValue(),{element:a,widgetMgr:o,fragmentId:n}=this.props,s=o.getFileUploaderStateValue(a);se(r,s)||o.setFileUploaderStateValue(a,r,{fromUi:!0},n)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const r=this.createWidgetValue();if(_(r))return;this.setState({imgSrc:null});const{widgetMgr:a,element:o,fragmentId:n}=this.props;a.setFileUploaderStateValue(o,r,{fromUi:!0},n)})},this.deleteFile=r=>{const a=this.getFile(r);_(a)||(a.status.type==="uploading"&&a.status.cancelToken.cancel(),a.status.type==="uploaded"&&a.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(a.status.fileUrls.deleteUrl),this.removeFile(r))},this.addFile=r=>{this.setState(a=>({files:[...a.files,r]}))},this.removeFile=r=>{this.setState(a=>({files:a.files.filter(o=>o.id!==r)}))},this.getFile=r=>this.state.files.find(a=>a.id===r),this.updateFile=(r,a)=>{this.setState(o=>({files:o.files.map(n=>n.id===r?a:n)}))},this.onUploadComplete=(r,a)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(r);_(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}))},this.onUploadProgress=(r,a)=>{const o=this.getFile(a);if(_(o)||o.status.type!=="uploading")return;const n=Math.round(r.loaded*100/r.total);o.status.progress!==n&&this.updateFile(a,o.setStatus({type:"uploading",cancelToken:o.status.cancelToken,progress:n}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(r,a)=>{const o=W.CancelToken.source(),n=new L(a.name,a.size,this.nextLocalFileId(),{type:"uploading",cancelToken:o,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,r.uploadUrl,a,s=>this.onUploadProgress(s,n.id),o.token).then(()=>this.onUploadComplete(n.id,r)).catch(s=>{W.isCancel(s)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:s?s.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:r,element:a}=this.props,o=r.getFileUploaderStateValue(a);if(_(o))return l;const{uploadedFileInfo:n}=o;return _(n)||n.length===0?l:{files:n.map(s=>{const p=s.name,g=s.size,C=s.fileId,U=s.fileUrls;return new L(p,g,this.nextLocalFileId(),{type:"uploaded",fileId:C,fileUrls:U})}),imgSrc:n.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=r=>r.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:r,widgetMgr:a,fragmentId:o}=this.props;a.getFileUploaderStateValue(r)===void 0&&a.setFileUploaderStateValue(r,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(r=>r.status.type==="uploaded").map(r=>{const{name:a,size:o,status:n}=r;return new le({fileId:n.fileId,fileUrls:n.fileUrls,name:a,size:o})});return new de({uploadedFileInfo:l})}render(){var n;const{element:l,widgetMgr:r,disabled:a,width:o}=this.props;return this.formClearHelper.manageFormClearListener(r,l.formId,this.onFormCleared),x(H,{className:"stCameraInput","data-testid":"stCameraInput",children:[h(fe,{label:l.label,disabled:a,labelVisibility:ce((n=l.labelVisibility)==null?void 0:n.value),children:l.help&&h(ue,{children:h(pe,{content:l.help,placement:A.TOP_RIGHT})})}),this.state.imgSrc?x(he,{children:[h(V,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&h(Me,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:o*9/16})}),h(D,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||a,children:this.getProgress()?"Uploading...":x(we,{children:[h(O,{content:z,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):h(_e,{handleCapture:this.handleCapture,width:o,disabled:a,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function Te(t,l){return fetch(t).then(r=>r.arrayBuffer()).then(r=>new File([r],l,{type:"image/jpeg"}))}export{je as default};
@@ -1,4 +0,0 @@
1
- import{r as c,E as ie,_ as oe,bR as Rt,bS as R,bT as L,bU as Lt,R as lt,bV as d,n as m,a7 as S,j as p,aX as j,aY as Z,aG as Q,aF as kt,bW as Bt,bX as Vt,aw as Ht,F as Nt,$ as Wt,aS as $t,at as Xe,A as T,aU as Kt,aT as Xt,a_ as Gt,bb as Yt,a$ as qt,aK as Jt,b0 as Zt}from"./index.CLHVvMN0.js";import{F as Qt}from"./FormClearHelper.DSgVZ-NK.js";import{S as er,P as tr}from"./ProgressBar.D1he2Gib.js";import{u as rr}from"./Hooks.wzeYp0oD.js";import{U as q}from"./UploadFileInfo.C-jY39rj.js";var ct=c.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(ie,oe({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.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"}))});ct.displayName="Clear";var ut=c.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(ie,oe({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.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"}))});ut.displayName="CloudUpload";var pt=c.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(ie,oe({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),c.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"}))});pt.displayName="Error";var ft=c.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(ie,oe({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.createElement("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))});ft.displayName="InsertDriveFile";var P;(function(e){e.Gigabyte="gb",e.Megabyte="mb",e.Kilobyte="kb",e.Byte="b"})(P||(P={}));const Se=Rt()?1024:1e3,ee=["gb","mb","kb","b"],ae=(e,r,t=1)=>{if(r||(r="b"),t<0&&(t=0),e<0)throw new Error("Size must be greater than or equal to 0");const n=ee.indexOf(r),i=e/Se;return n&&e>Se/2?ae(i,ee[n-1],t):`${e.toFixed(t)}${r.toUpperCase()}`},nr=(e,r,t)=>{if(e<0)throw Error("Size must be 0 or greater");const n=ee.findIndex(l=>l===r),i=ee.findIndex(l=>l===t);if(n===-1||i===-1)throw Error("Unexpected byte unit provided");if(n===i)return e;const o=Math.abs(n-i),s=Se**o;return n>i?e/s:e*s};var ir=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function V(e,r){var t=or(e);if(typeof t.path!="string"){var n=e.webkitRelativePath;Object.defineProperty(t,"path",{value:typeof r=="string"?r:typeof n=="string"&&n.length>0?n:e.name,writable:!1,configurable:!1,enumerable:!0})}return t}function or(e){var r=e.name,t=r&&r.lastIndexOf(".")!==-1;if(t&&!e.type){var n=r.split(".").pop().toLowerCase(),i=ir.get(n);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var ar=[".DS_Store","Thumbs.db"];function sr(e){return R(this,void 0,void 0,function(){return L(this,function(r){return te(e)&&lr(e)?[2,fr(e.dataTransfer,e.type)]:cr(e)?[2,ur(e)]:Array.isArray(e)&&e.every(function(t){return"getFile"in t&&typeof t.getFile=="function"})?[2,pr(e)]:[2,[]]})})}function lr(e){return te(e.dataTransfer)}function cr(e){return te(e)&&te(e.target)}function te(e){return typeof e=="object"&&e!==null}function ur(e){return Ee(e.target.files).map(function(r){return V(r)})}function pr(e){return R(this,void 0,void 0,function(){var r;return L(this,function(t){switch(t.label){case 0:return[4,Promise.all(e.map(function(n){return n.getFile()}))];case 1:return r=t.sent(),[2,r.map(function(n){return V(n)})]}})})}function fr(e,r){return R(this,void 0,void 0,function(){var t,n;return L(this,function(i){switch(i.label){case 0:return e===null?[2,[]]:e.items?(t=Ee(e.items).filter(function(o){return o.kind==="file"}),r!=="drop"?[2,t]:[4,Promise.all(t.map(dr))]):[3,2];case 1:return n=i.sent(),[2,Ge(dt(n))];case 2:return[2,Ge(Ee(e.files).map(function(o){return V(o)}))]}})})}function Ge(e){return e.filter(function(r){return ar.indexOf(r.name)===-1})}function Ee(e){if(e===null)return[];for(var r=[],t=0;t<e.length;t++){var n=e[t];r.push(n)}return r}function dr(e){if(typeof e.webkitGetAsEntry!="function")return Ye(e);var r=e.webkitGetAsEntry();return r&&r.isDirectory?gt(r):Ye(e)}function dt(e){return e.reduce(function(r,t){return Lt(r,Array.isArray(t)?dt(t):[t])},[])}function Ye(e){var r=e.getAsFile();if(!r)return Promise.reject(e+" is not a File");var t=V(r);return Promise.resolve(t)}function gr(e){return R(this,void 0,void 0,function(){return L(this,function(r){return[2,e.isDirectory?gt(e):mr(e)]})})}function gt(e){var r=e.createReader();return new Promise(function(t,n){var i=[];function o(){var s=this;r.readEntries(function(l){return R(s,void 0,void 0,function(){var f,w,v;return L(this,function(y){switch(y.label){case 0:if(l.length)return[3,5];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return f=y.sent(),t(f),[3,4];case 3:return w=y.sent(),n(w),[3,4];case 4:return[3,6];case 5:v=Promise.all(l.map(gr)),i.push(v),o(),y.label=6;case 6:return[2]}})})},function(l){n(l)})}o()})}function mr(e){return R(this,void 0,void 0,function(){return L(this,function(r){return[2,new Promise(function(t,n){e.file(function(i){var o=V(i,e.fullPath);t(o)},function(i){n(i)})})]})})}var hr=function(e,r){if(e&&r){var t=Array.isArray(r)?r:r.split(","),n=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return t.some(function(s){var l=s.trim().toLowerCase();return l.charAt(0)==="."?n.toLowerCase().endsWith(l):l.endsWith("/*")?o===l.replace(/\/.*$/,""):i===l})}return!0};function qe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Je(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(t),!0).forEach(function(n){mt(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function mt(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ze(e,r){return Fr(e)||br(e,r)||yr(e,r)||vr()}function vr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yr(e,r){if(e){if(typeof e=="string")return Qe(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Qe(e,r)}}function Qe(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function br(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,o=!1,s,l;try{for(t=t.call(e);!(i=(s=t.next()).done)&&(n.push(s.value),!(r&&n.length===r));i=!0);}catch(f){o=!0,l=f}finally{try{!i&&t.return!=null&&t.return()}finally{if(o)throw l}}return n}}function Fr(e){if(Array.isArray(e))return e}var wr="file-invalid-type",Dr="file-too-large",xr="file-too-small",Sr="too-many-files",Er=function(r){r=Array.isArray(r)&&r.length===1?r[0]:r;var t=Array.isArray(r)?"one of ".concat(r.join(", ")):r;return{code:wr,message:"File type must be ".concat(t)}},et=function(r){return{code:Dr,message:"File is larger than ".concat(r," ").concat(r===1?"byte":"bytes")}},tt=function(r){return{code:xr,message:"File is smaller than ".concat(r," ").concat(r===1?"byte":"bytes")}},Ar={code:Sr,message:"Too many files"};function ht(e,r){var t=e.type==="application/x-moz-file"||hr(e,r);return[t,t?null:Er(r)]}function vt(e,r,t){if(B(e.size))if(B(r)&&B(t)){if(e.size>t)return[!1,et(t)];if(e.size<r)return[!1,tt(r)]}else{if(B(r)&&e.size<r)return[!1,tt(r)];if(B(t)&&e.size>t)return[!1,et(t)]}return[!0,null]}function B(e){return e!=null}function Or(e){var r=e.files,t=e.accept,n=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles;return!o&&r.length>1||o&&s>=1&&r.length>s?!1:r.every(function(l){var f=ht(l,t),w=Ze(f,1),v=w[0],y=vt(l,n,i),O=Ze(y,1),I=O[0];return v&&I})}function re(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function J(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(r){return r==="Files"||r==="application/x-moz-file"}):!!e.target&&!!e.target.files}function rt(e){e.preventDefault()}function Ir(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Cr(e){return e.indexOf("Edge/")!==-1}function Pr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Ir(e)||Cr(e)}function A(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return function(n){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return r.some(function(l){return!re(n)&&l&&l.apply(void 0,[n].concat(o)),re(n)})}}function zr(){return"showOpenFilePicker"in window}function Ur(e){return e=typeof e=="string"?e.split(","):e,[{description:"everything",accept:Array.isArray(e)?e.filter(function(r){return r==="audio/*"||r==="video/*"||r==="image/*"||r==="text/*"||/\w+\/[-+.\w]+/g.test(r)}).reduce(function(r,t){return Je(Je({},r),{},mt({},t,[]))},{}):{}}]}function _r(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Mr(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}var Tr=["children"],jr=["open"],Rr=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Lr=["refKey","onChange","onClick"];function kr(e){return Hr(e)||Vr(e)||yt(e)||Br()}function Br(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hr(e){if(Array.isArray(e))return Ae(e)}function xe(e,r){return $r(e)||Wr(e,r)||yt(e,r)||Nr()}function Nr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yt(e,r){if(e){if(typeof e=="string")return Ae(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ae(e,r)}}function Ae(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Wr(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,o=!1,s,l;try{for(t=t.call(e);!(i=(s=t.next()).done)&&(n.push(s.value),!(r&&n.length===r));i=!0);}catch(f){o=!0,l=f}finally{try{!i&&t.return!=null&&t.return()}finally{if(o)throw l}}return n}}function $r(e){if(Array.isArray(e))return e}function nt(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function g(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?nt(Object(t),!0).forEach(function(n){Oe(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nt(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Oe(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ne(e,r){if(e==null)return{};var t=Kr(e,r),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function Kr(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}var se=c.forwardRef(function(e,r){var t=e.children,n=ne(e,Tr),i=Xr(n),o=i.open,s=ne(i,jr);return c.useImperativeHandle(r,function(){return{open:o}},[o]),lt.createElement(c.Fragment,null,t(g(g({},s),{},{open:o})))});se.displayName="Dropzone";var bt={disabled:!1,getFilesFromEvent:sr,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};se.defaultProps=bt;se.propTypes={children:d.func,accept:d.oneOfType([d.string,d.arrayOf(d.string)]),multiple:d.bool,preventDropOnDocument:d.bool,noClick:d.bool,noKeyboard:d.bool,noDrag:d.bool,noDragEventsBubbling:d.bool,minSize:d.number,maxSize:d.number,maxFiles:d.number,disabled:d.bool,getFilesFromEvent:d.func,onFileDialogCancel:d.func,onFileDialogOpen:d.func,useFsAccessApi:d.bool,onDragEnter:d.func,onDragLeave:d.func,onDragOver:d.func,onDrop:d.func,onDropAccepted:d.func,onDropRejected:d.func,validator:d.func};var Ie={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function Xr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=g(g({},bt),e),t=r.accept,n=r.disabled,i=r.getFilesFromEvent,o=r.maxSize,s=r.minSize,l=r.multiple,f=r.maxFiles,w=r.onDragEnter,v=r.onDragLeave,y=r.onDragOver,O=r.onDrop,I=r.onDropAccepted,le=r.onDropRejected,ce=r.onFileDialogCancel,ue=r.onFileDialogOpen,Pe=r.useFsAccessApi,pe=r.preventDropOnDocument,ze=r.noClick,fe=r.noKeyboard,Ue=r.noDrag,C=r.noDragEventsBubbling,de=r.validator,ge=c.useMemo(function(){return typeof ue=="function"?ue:it},[ue]),H=c.useMemo(function(){return typeof ce=="function"?ce:it},[ce]),D=c.useRef(null),x=c.useRef(null),Pt=c.useReducer(Gr,Ie),_e=xe(Pt,2),N=_e[0],F=_e[1],zt=N.isFocused,Me=N.isFileDialogActive,Te=N.draggedFiles,W=c.useRef(typeof window<"u"&&window.isSecureContext&&Pe&&zr()),je=function(){!W.current&&Me&&setTimeout(function(){if(x.current){var u=x.current.files;u.length||(F({type:"closeDialog"}),H())}},300)};c.useEffect(function(){return window.addEventListener("focus",je,!1),function(){window.removeEventListener("focus",je,!1)}},[x,Me,H,W]);var z=c.useRef([]),Re=function(u){D.current&&D.current.contains(u.target)||(u.preventDefault(),z.current=[])};c.useEffect(function(){return pe&&(document.addEventListener("dragover",rt,!1),document.addEventListener("drop",Re,!1)),function(){pe&&(document.removeEventListener("dragover",rt),document.removeEventListener("drop",Re))}},[D,pe]);var Le=c.useCallback(function(a){a.preventDefault(),a.persist(),G(a),z.current=[].concat(kr(z.current),[a.target]),J(a)&&Promise.resolve(i(a)).then(function(u){re(a)&&!C||(F({draggedFiles:u,isDragActive:!0,type:"setDraggedFiles"}),w&&w(a))})},[i,w,C]),ke=c.useCallback(function(a){a.preventDefault(),a.persist(),G(a);var u=J(a);if(u&&a.dataTransfer)try{a.dataTransfer.dropEffect="copy"}catch{}return u&&y&&y(a),!1},[y,C]),Be=c.useCallback(function(a){a.preventDefault(),a.persist(),G(a);var u=z.current.filter(function(b){return D.current&&D.current.contains(b)}),h=u.indexOf(a.target);h!==-1&&u.splice(h,1),z.current=u,!(u.length>0)&&(F({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),J(a)&&v&&v(a))},[D,v,C]),$=c.useCallback(function(a,u){var h=[],b=[];a.forEach(function(E){var k=ht(E,t),M=xe(k,2),he=M[0],ve=M[1],ye=vt(E,s,o),Y=xe(ye,2),be=Y[0],Fe=Y[1],we=de?de(E):null;if(he&&be&&!we)h.push(E);else{var De=[ve,Fe];we&&(De=De.concat(we)),b.push({file:E,errors:De.filter(function(jt){return jt})})}}),(!l&&h.length>1||l&&f>=1&&h.length>f)&&(h.forEach(function(E){b.push({file:E,errors:[Ar]})}),h.splice(0)),F({acceptedFiles:h,fileRejections:b,type:"setFiles"}),O&&O(h,b,u),b.length>0&&le&&le(b,u),h.length>0&&I&&I(h,u)},[F,l,t,s,o,f,O,I,le,de]),K=c.useCallback(function(a){a.preventDefault(),a.persist(),G(a),z.current=[],J(a)&&Promise.resolve(i(a)).then(function(u){re(a)&&!C||$(u,a)}),F({type:"reset"})},[i,$,C]),U=c.useCallback(function(){if(W.current){F({type:"openDialog"}),ge();var a={multiple:l,types:Ur(t)};window.showOpenFilePicker(a).then(function(u){return i(u)}).then(function(u){$(u,null),F({type:"closeDialog"})}).catch(function(u){_r(u)?(H(u),F({type:"closeDialog"})):Mr(u)&&(W.current=!1,x.current&&(x.current.value=null,x.current.click()))});return}x.current&&(F({type:"openDialog"}),ge(),x.current.value=null,x.current.click())},[F,ge,H,Pe,$,t,l]),Ve=c.useCallback(function(a){!D.current||!D.current.isEqualNode(a.target)||(a.key===" "||a.key==="Enter"||a.keyCode===32||a.keyCode===13)&&(a.preventDefault(),U())},[D,U]),He=c.useCallback(function(){F({type:"focus"})},[]),Ne=c.useCallback(function(){F({type:"blur"})},[]),We=c.useCallback(function(){ze||(Pr()?setTimeout(U,0):U())},[ze,U]),_=function(u){return n?null:u},me=function(u){return fe?null:_(u)},X=function(u){return Ue?null:_(u)},G=function(u){C&&u.stopPropagation()},Ut=c.useMemo(function(){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=a.refKey,h=u===void 0?"ref":u,b=a.role,E=a.onKeyDown,k=a.onFocus,M=a.onBlur,he=a.onClick,ve=a.onDragEnter,ye=a.onDragOver,Y=a.onDragLeave,be=a.onDrop,Fe=ne(a,Rr);return g(g(Oe({onKeyDown:me(A(E,Ve)),onFocus:me(A(k,He)),onBlur:me(A(M,Ne)),onClick:_(A(he,We)),onDragEnter:X(A(ve,Le)),onDragOver:X(A(ye,ke)),onDragLeave:X(A(Y,Be)),onDrop:X(A(be,K)),role:typeof b=="string"&&b!==""?b:"button"},h,D),!n&&!fe?{tabIndex:0}:{}),Fe)}},[D,Ve,He,Ne,We,Le,ke,Be,K,fe,Ue,n]),_t=c.useCallback(function(a){a.stopPropagation()},[]),Mt=c.useMemo(function(){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=a.refKey,h=u===void 0?"ref":u,b=a.onChange,E=a.onClick,k=ne(a,Lr),M=Oe({accept:t,multiple:l,type:"file",style:{display:"none"},onChange:_(A(b,K)),onClick:_(A(E,_t)),tabIndex:-1},h,x);return g(g({},M),k)}},[x,t,l,K,n]),$e=Te.length,Ke=$e>0&&Or({files:Te,accept:t,minSize:s,maxSize:o,multiple:l,maxFiles:f}),Tt=$e>0&&!Ke;return g(g({},N),{},{isDragAccept:Ke,isDragReject:Tt,isFocused:zt&&!n,getRootProps:Ut,getInputProps:Mt,rootRef:D,inputRef:x,open:_(U)})}function Gr(e,r){switch(r.type){case"focus":return g(g({},e),{},{isFocused:!0});case"blur":return g(g({},e),{},{isFocused:!1});case"openDialog":return g(g({},Ie),{},{isFileDialogActive:!0});case"closeDialog":return g(g({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var t=r.isDragActive,n=r.draggedFiles;return g(g({},e),{},{draggedFiles:n,isDragActive:t});case"setFiles":return g(g({},e),{},{acceptedFiles:r.acceptedFiles,fileRejections:r.fileRejections});case"reset":return g({},Ie);default:return e}}function it(){}const Ft=m("section",{target:"es2srfl0"})(({isDisabled:e,theme:r})=>({display:"flex",alignItems:"center",padding:r.spacing.lg,backgroundColor:r.colors.secondaryBg,borderRadius:r.radii.default,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${r.colors.primary}`},color:e?r.colors.gray:r.colors.bodyText})),wt=m("div",{target:"es2srfl1"})({marginRight:"auto",alignItems:"center",display:"flex"}),Dt=m("span",{target:"es2srfl2"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg})),Yr=m("span",{target:"es2srfl3"})(({theme:e})=>({marginBottom:e.spacing.twoXS})),qr=m("div",{target:"es2srfl4"})({display:"flex",flexDirection:"column"}),xt=m("div",{target:"es2srfl5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),Jr=m("ul",{target:"es2srfl6"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),St=m("li",{target:"es2srfl7"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),Et=m("div",{target:"es2srfl8"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),At=m("div",{target:"es2srfl9"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),Ot=m("div",{target:"es2srfl10"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),Zr=m("span",{target:"es2srfl11"})(({theme:e})=>({marginRight:e.spacing.twoXS})),Qr=m("div",{target:"es2srfl12"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100})),It=m("small",{target:"es2srfl13"})(({theme:e})=>({color:e.colors.danger,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),Ct=m("span",{target:"es2srfl14"})({}),ot=e=>({[Ft]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[wt]:{marginBottom:e.spacing.lg},[Dt]:{display:"none"},[xt]:{paddingRight:e.spacing.lg},[Ot]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[At]:{width:e.sizes.full},[Et]:{flexDirection:"column"},[It]:{height:"auto",whiteSpace:"initial"},[Ct]:{display:"none"},[St]:{margin:e.spacing.none,padding:e.spacing.none}}),en=m("div",{target:"es2srfl15"})(({theme:e})=>e.inSidebar?ot(e):{[`@media (max-width: ${e.breakpoints.sm})`]:ot(e)});var at;(function(e){e.DANGER="danger"})(at||(at={}));const Ce=m("small",{target:"e1w6nwfl0"})(({kind:e,theme:r})=>{const{danger:t,fadedText60:n}=r.colors;return{color:e==="danger"?t:n,fontSize:r.fontSizes.sm,lineHeight:r.lineHeights.tight}}),tn=({multiple:e,acceptedExtensions:r,maxSizeBytes:t})=>S(wt,{"data-testid":"stFileUploaderDropzoneInstructions",children:[p(Dt,{children:p(j,{content:ut,size:"threeXL"})}),S(qr,{children:[S(Yr,{children:["Drag and drop file",e?"s":""," here"]}),S(Ce,{children:[`Limit ${ae(t,P.Byte,0)} per file`,r.length?` • ${r.map(n=>n.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),rn=({onDrop:e,multiple:r,acceptedExtensions:t,maxSizeBytes:n,disabled:i,label:o})=>p(se,{onDrop:e,multiple:r,accept:t.length?t:void 0,maxSize:n,disabled:i,useFsAccessApi:!1,children:({getRootProps:s,getInputProps:l})=>S(Ft,{...s(),"data-testid":"stFileUploaderDropzone",isDisabled:i,"aria-label":o,children:[p("input",{"data-testid":"stFileUploaderDropzoneInput",...l()}),p(tn,{multiple:r,acceptedExtensions:t,maxSizeBytes:n}),p(Z,{kind:Q.SECONDARY,disabled:i,size:kt.SMALL,children:"Browse files"})]})}),nn=m("div",{target:"e1vdeh0w0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),on=m("div",{target:"e1vdeh0w1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),an=({currentPage:e,totalPages:r,onNext:t,onPrevious:n})=>S(nn,{"data-testid":"stFileUploaderPagination",children:[p(Ce,{children:`Showing page ${e} of ${r}`}),S(on,{children:[p(Z,{onClick:n,kind:Q.MINIMAL,children:p(j,{content:Bt,size:"xl"})}),p(Z,{onClick:t,kind:Q.MINIMAL,children:p(j,{content:Vt,size:"xl"})})]})]}),st=(e,r)=>Math.ceil(e.length/r),sn=e=>Ht(({pageSize:t,items:n,resetOnAdd:i,...o})=>{const[s,l]=c.useState(0),[f,w]=c.useState(st(n,t)),v=rr(n);c.useEffect(()=>{v&&v.length!==n.length&&w(st(n,t)),v&&v.length<n.length?i&&l(0):s+1>=f&&l(f-1)},[n,s,t,v,i,f]);const y=()=>{l(Math.min(s+1,f-1))},O=()=>{l(Math.max(0,s-1))},I=n.slice(s*t,s*t+t);return S(Nt,{children:[p(e,{items:I,...o}),n.length>t?p(an,{pageSize:t,totalPages:f,currentPage:s+1,onNext:y,onPrevious:O}):null]})},e),ln=({fileInfo:e})=>e.status.type==="uploading"?p(tr,{value:e.status.progress,size:er.SMALL}):e.status.type==="error"?S(It,{children:[p(Zr,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),p(Ct,{children:p(j,{content:pt,size:"lg"})})]}):e.status.type==="uploaded"?p(Ce,{children:ae(e.size,P.Byte)}):null,cn=({fileInfo:e,onDelete:r})=>S(Ot,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[p(Qr,{children:p(j,{content:ft,size:"twoXL"})}),S(Et,{className:"stFileUploaderFileData",children:[p(At,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),p(ln,{fileInfo:e})]}),p("div",{"data-testid":"stFileUploaderDeleteBtn",children:p(Z,{onClick:()=>r(e.id),kind:Q.MINIMAL,children:p(j,{content:ct,size:"lg"})})})]}),un=({items:e,onDelete:r})=>p(Jr,{children:e.map(t=>p(St,{children:p(cn,{fileInfo:t,onDelete:r})},t.id))}),pn=sn(un),fn=e=>p(xt,{children:p(pn,{...e})});class yn extends lt.PureComponent{constructor(r){super(r),this.formClearHelper=new Qt,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:n,widgetMgr:i,fragmentId:o}=this.props,s=i.getFileUploaderStateValue(n);Wt(t,s)||i.setFileUploaderStateValue(n,t,{fromUi:!0},o)},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(t,n)=>{const{element:i}=this.props,{multipleFiles:o}=i;if(!o&&t.length===0&&n.length>1){const s=n.findIndex(l=>l.errors.length===1&&l.errors[0].code==="too-many-files");s>=0&&(t.push(n[s].file),n.splice(s,1))}if(this.props.uploadClient.fetchFileURLs(t).then(s=>{if(!o&&t.length>0){const l=this.state.files.find(f=>f.status.type!=="error");l&&(this.forceUpdatingStatus=!0,this.deleteFile(l.id),this.forceUpdatingStatus=!1)}$t(s,t).forEach(([l,f])=>{this.uploadFile(l,f)})}).catch(s=>{this.addFiles(t.map(l=>new q(l.name,l.size,this.nextLocalFileId(),{type:"error",errorMessage:s})))}),n.length>0){const s=n.map(l=>{const{file:f}=l;return new q(f.name,f.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(l.errors[0].code,l.file)})});this.addFiles(s)}},this.uploadFile=(t,n)=>{const i=Xe.CancelToken.source(),o=new q(n.name,n.size,this.nextLocalFileId(),{type:"uploading",cancelToken:i,progress:1});this.addFile(o),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,n,s=>this.onUploadProgress(s,o.id),i.token).then(()=>this.onUploadComplete(o.id,t)).catch(s=>{Xe.isCancel(s)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:s?s.toString():"Unknown error"}))})},this.onUploadComplete=(t,n)=>{const i=this.getFile(t);T(i)||i.status.type!=="uploading"||this.updateFile(i.id,i.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}))},this.getErrorMessage=(t,n)=>{switch(t){case"file-too-large":return`File must be ${ae(this.maxUploadSizeInBytes,P.Byte)} or smaller.`;case"file-invalid-type":return`${n.type} files are not allowed.`;case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},this.deleteFile=t=>{const n=this.getFile(t);T(n)||(n.status.type==="uploading"&&n.status.cancelToken.cancel(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(n.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{this.setState(n=>({files:[...n.files,t]}))},this.addFiles=t=>{this.setState(n=>({files:[...n.files,...t]}))},this.removeFile=t=>{this.setState(n=>({files:n.files.filter(i=>i.id!==t)}))},this.getFile=t=>this.state.files.find(n=>n.id===t),this.updateFile=(t,n)=>{this.setState(i=>({files:i.files.map(o=>o.id===t?n:o)}))},this.onUploadProgress=(t,n)=>{const i=this.getFile(n);if(T(i)||i.status.type!=="uploading")return;const o=Math.round(t.loaded*100/t.total);i.status.progress!==o&&this.updateFile(n,i.setStatus({type:"uploading",cancelToken:i.status.cancelToken,progress:o}))},this.onFormCleared=()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(T(t))return;const{widgetMgr:n,element:i,fragmentId:o}=this.props;n.setFileUploaderStateValue(i,t,{fromUi:!0},o)})},this.state=this.initialValue}get initialValue(){const r={files:[],newestServerFileId:0},{widgetMgr:t,element:n}=this.props,i=t.getFileUploaderStateValue(n);if(T(i))return r;const{uploadedFileInfo:o}=i;return T(o)||o.length===0?r:{files:o.map(s=>{const l=s.name,f=s.size,w=s.fileId,v=s.fileUrls;return new q(l,f,this.nextLocalFileId(),{type:"uploaded",fileId:w,fileUrls:v})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const r=this.props.element.maxUploadSizeMb;return nr(r,P.Megabyte,P.Byte)}get status(){const r=t=>t.status.type==="uploading";return this.state.files.some(r)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const r=this.createWidgetValue(),{element:t,widgetMgr:n,fragmentId:i}=this.props;n.getFileUploaderStateValue(t)===void 0&&n.setFileUploaderStateValue(t,r,{fromUi:!1},i)}createWidgetValue(){const r=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:n,size:i,status:o}=t,{fileId:s,fileUrls:l}=o;return new Kt({fileId:s,fileUrls:l,name:n,size:i})});return new Xt({uploadedFileInfo:r})}render(){var l;const{files:r}=this.state,{element:t,disabled:n,widgetMgr:i}=this.props,o=t.type;this.formClearHelper.manageFormClearListener(i,t.formId,this.onFormCleared);const s=r.slice().reverse();return S(en,{className:"stFileUploader","data-testid":"stFileUploader",children:[p(Zt,{label:t.label,disabled:n,labelVisibility:Gt((l=t.labelVisibility)==null?void 0:l.value),children:t.help&&p(Yt,{children:p(qt,{content:t.help,placement:Jt.TOP_RIGHT})})}),p(rn,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:o,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:n}),s.length>0&&p(fn,{items:s,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}export{yn as default};
@@ -1 +0,0 @@
1
- import{r as s,E as W,_ as $,n as d,a4 as L,M as V,j as i,a7 as D,aX as K}from"./index.CLHVvMN0.js";import{I as N}from"./InputInstructions.DpTmOmkP.js";import{i as _}from"./inputUtils.CQWz5UKz.js";import{T as q}from"./textarea.C5OZk1uL.js";import"./base-input.gDrmzpbY.js";var E=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(W,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});E.displayName="Send";const M=d("div",{target:"eq6nl9f0"})(({theme:t,width:e})=>({borderRadius:t.radii.default,display:"flex",backgroundColor:t.colors.widgetBackgroundColor??t.colors.secondaryBg,width:`${e}px`})),j=d("div",{target:"eq6nl9f1"})(({theme:t})=>({backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.default,display:"flex",alignItems:"center"})),A=d("button",{target:"eq6nl9f2"})(({theme:t,disabled:e,extended:l})=>{const u=L(t),[o,g]=u?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.default,borderTopLeftRadius:l?t.radii.default:"0",borderBottomRightRadius:t.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?o:g,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:u?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),F=d("div",{target:"eq6nl9f3"})({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,pointerEvents:"none"}),G=d("div",{target:"eq6nl9f4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),U=6.5,H=1;function Z({width:t,element:e,widgetMgr:l,fragmentId:u}){const o=V(),[g,h]=s.useState(!1),[p,f]=s.useState(e.default),[b,x]=s.useState(0),a=s.useRef(null),y=s.useRef({minHeight:0,maxHeight:0}),R=()=>{let r=0;const{current:n}=a;if(n){const c=n.placeholder;n.placeholder="",n.style.height="auto",r=n.scrollHeight,n.placeholder=c,n.style.height=""}return r},C=()=>{a.current&&a.current.focus(),p&&(l.setStringTriggerValue(e,p,{fromUi:!0},u),h(!1),f(""),x(0))},w=r=>{const{metaKey:n,ctrlKey:c,shiftKey:z}=r;_(r)&&!z&&!c&&!n&&(r.preventDefault(),C())},k=r=>{const{value:n}=r.target,{maxChars:c}=e;c!==0&&n.length>c||(h(n!==""),f(n),x(R()))};s.useEffect(()=>{if(e.setValue){e.setValue=!1;const r=e.value||"";f(r),h(r!=="")}},[e]),s.useEffect(()=>{if(a.current){const{offsetHeight:r}=a.current;y.current.minHeight=r,y.current.maxHeight=r*U}},[a]);const{disabled:m,placeholder:I,maxChars:B}=e,{minHeight:T,maxHeight:S}=y.current,v=b>0&&a.current?Math.abs(b-T)>H:!1;return i(M,{className:"stChatInput","data-testid":"stChatInput",width:t,children:D(j,{children:[i(q,{inputRef:a,value:p,placeholder:I,onChange:k,onKeyDown:w,"aria-label":I,disabled:m,rows:1,overrides:{Root:{style:{minHeight:o.sizes.minElementHeight,outline:"none",backgroundColor:o.colors.transparent,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,width:`${t}px`}},InputContainer:{style:{backgroundColor:o.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:o.lineHeights.inputWidget,backgroundColor:o.colors.transparent,resize:"none","::placeholder":{opacity:"0.7"},height:v?`${b+H}px`:"auto",maxHeight:S?`${S}px`:"none",paddingLeft:o.spacing.sm,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,paddingRight:`calc(${o.iconSizes.xl} + 2 * ${o.spacing.sm} + ${o.spacing.sm})`}}}}),t>o.breakpoints.hideWidgetDetails&&i(G,{children:i(N,{dirty:g,value:p,maxLength:B,type:"chat",inForm:!1})}),i(F,{children:i(A,{onClick:C,disabled:!g||m,extended:v,"data-testid":"stChatInputSubmitButton",children:i(K,{content:E,size:"xl",color:"inherit"})})})]})})}export{Z as default};
@@ -1 +0,0 @@
1
- import{n as t,aL as e,a7 as o,j as s,a1 as i}from"./index.CLHVvMN0.js";import{P as l}from"./ProgressBar.D1he2Gib.js";const d=t("div",{target:"eg8e9hd0"})(({theme:a})=>({paddingBottom:a.spacing.sm,lineHeight:"normal",color:e(a)}));function c({element:a,width:r}){return o("div",{className:"stProgress","data-testid":"stProgress",children:[s(d,{children:s(i,{source:a.text,allowHTML:!1,isLabel:!0})}),s(l,{value:a.value,width:r})]})}export{c as default};
@@ -1 +0,0 @@
1
- import{n as t,D as d,j as c,aC as l,aD as g,A as e}from"./index.CLHVvMN0.js";const f=t("iframe",{target:"etgi5ab0"})(({theme:o,disableScrolling:i})=>({colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:i?"hidden":void 0}));function F({element:o,width:i}){const s=o.hasWidth?o.width:i,n=r(o.src),a=d(n)?void 0:r(o.srcdoc);return c(f,{className:"stIFrame","data-testid":"stIFrame",allow:l,disableScrolling:!o.scrolling,src:n,srcDoc:a,width:s,height:o.height,scrolling:o.scrolling?"auto":"no",sandbox:g,title:"st.iframe"})}function r(o){return e(o)||o===""?void 0:o}export{F as default};