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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. streamlit/__init__.py +5 -1
  2. streamlit/commands/execution_control.py +89 -14
  3. streamlit/commands/navigation.py +4 -6
  4. streamlit/commands/page_config.py +4 -6
  5. streamlit/components/v1/component_arrow.py +7 -7
  6. streamlit/components/v2/__init__.py +514 -0
  7. streamlit/components/v2/bidi_component/__init__.py +20 -0
  8. streamlit/components/v2/bidi_component/constants.py +29 -0
  9. streamlit/components/v2/bidi_component/main.py +534 -0
  10. streamlit/components/v2/bidi_component/serialization.py +272 -0
  11. streamlit/components/v2/bidi_component/state.py +92 -0
  12. streamlit/components/v2/component_definition_resolver.py +143 -0
  13. streamlit/components/v2/component_file_watcher.py +403 -0
  14. streamlit/components/v2/component_manager.py +439 -0
  15. streamlit/components/v2/component_manifest_handler.py +122 -0
  16. streamlit/components/v2/component_path_utils.py +245 -0
  17. streamlit/components/v2/component_registry.py +426 -0
  18. streamlit/components/v2/get_bidi_component_manager.py +51 -0
  19. streamlit/components/v2/manifest_scanner.py +615 -0
  20. streamlit/components/v2/presentation.py +198 -0
  21. streamlit/components/v2/types.py +324 -0
  22. streamlit/config.py +456 -53
  23. streamlit/config_option.py +4 -1
  24. streamlit/config_util.py +650 -1
  25. streamlit/connections/snowflake_connection.py +1 -1
  26. streamlit/connections/snowpark_connection.py +1 -1
  27. streamlit/dataframe_util.py +33 -26
  28. streamlit/delta_generator.py +13 -4
  29. streamlit/delta_generator_singletons.py +11 -15
  30. streamlit/deprecation_util.py +17 -6
  31. streamlit/elements/alert.py +16 -0
  32. streamlit/elements/arrow.py +68 -10
  33. streamlit/elements/bokeh_chart.py +10 -78
  34. streamlit/elements/code.py +2 -2
  35. streamlit/elements/deck_gl_json_chart.py +98 -40
  36. streamlit/elements/dialog_decorator.py +2 -1
  37. streamlit/elements/exception.py +4 -2
  38. streamlit/elements/form.py +27 -0
  39. streamlit/elements/graphviz_chart.py +1 -3
  40. streamlit/elements/heading.py +63 -10
  41. streamlit/elements/html.py +13 -2
  42. streamlit/elements/image.py +3 -5
  43. streamlit/elements/layouts.py +59 -33
  44. streamlit/elements/lib/built_in_chart_utils.py +50 -19
  45. streamlit/elements/lib/color_util.py +9 -19
  46. streamlit/elements/lib/column_config_utils.py +9 -12
  47. streamlit/elements/lib/column_types.py +40 -12
  48. streamlit/elements/lib/dialog.py +2 -2
  49. streamlit/elements/lib/image_utils.py +3 -5
  50. streamlit/elements/lib/layout_utils.py +100 -13
  51. streamlit/elements/lib/mutable_status_container.py +2 -2
  52. streamlit/elements/lib/options_selector_utils.py +2 -2
  53. streamlit/elements/lib/pandas_styler_utils.py +17 -9
  54. streamlit/elements/lib/shortcut_utils.py +152 -0
  55. streamlit/elements/lib/utils.py +4 -4
  56. streamlit/elements/map.py +80 -37
  57. streamlit/elements/markdown.py +50 -3
  58. streamlit/elements/media.py +5 -7
  59. streamlit/elements/metric.py +34 -6
  60. streamlit/elements/pdf.py +2 -4
  61. streamlit/elements/plotly_chart.py +197 -20
  62. streamlit/elements/progress.py +2 -4
  63. streamlit/elements/space.py +113 -0
  64. streamlit/elements/spinner.py +1 -1
  65. streamlit/elements/text.py +20 -3
  66. streamlit/elements/toast.py +2 -0
  67. streamlit/elements/vega_charts.py +356 -149
  68. streamlit/elements/widgets/audio_input.py +12 -11
  69. streamlit/elements/widgets/button.py +280 -43
  70. streamlit/elements/widgets/button_group.py +60 -9
  71. streamlit/elements/widgets/camera_input.py +3 -5
  72. streamlit/elements/widgets/chat.py +307 -43
  73. streamlit/elements/widgets/color_picker.py +8 -1
  74. streamlit/elements/widgets/data_editor.py +88 -44
  75. streamlit/elements/widgets/file_uploader.py +9 -11
  76. streamlit/elements/widgets/multiselect.py +4 -3
  77. streamlit/elements/widgets/number_input.py +4 -4
  78. streamlit/elements/widgets/radio.py +10 -3
  79. streamlit/elements/widgets/select_slider.py +8 -5
  80. streamlit/elements/widgets/selectbox.py +6 -3
  81. streamlit/elements/widgets/slider.py +38 -42
  82. streamlit/elements/widgets/text_widgets.py +2 -0
  83. streamlit/elements/widgets/time_widgets.py +587 -21
  84. streamlit/elements/write.py +27 -6
  85. streamlit/emojis.py +1 -1
  86. streamlit/errors.py +137 -0
  87. streamlit/git_util.py +1 -1
  88. streamlit/hello/hello.py +8 -0
  89. streamlit/hello/utils.py +2 -1
  90. streamlit/material_icon_names.py +1 -1
  91. streamlit/navigation/page.py +11 -1
  92. streamlit/net_util.py +2 -2
  93. streamlit/proto/Alert_pb2.pyi +3 -3
  94. streamlit/proto/AppPage_pb2.pyi +7 -1
  95. streamlit/proto/ArrowData_pb2.py +27 -0
  96. streamlit/proto/ArrowData_pb2.pyi +52 -0
  97. streamlit/proto/ArrowNamedDataSet_pb2.pyi +7 -1
  98. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +7 -1
  99. streamlit/proto/Arrow_pb2.py +10 -10
  100. streamlit/proto/Arrow_pb2.pyi +19 -12
  101. streamlit/proto/AudioInput_pb2.pyi +7 -1
  102. streamlit/proto/Audio_pb2.pyi +7 -1
  103. streamlit/proto/AuthRedirect_pb2.pyi +7 -1
  104. streamlit/proto/AutoRerun_pb2.pyi +7 -1
  105. streamlit/proto/BackMsg_pb2.py +4 -2
  106. streamlit/proto/BackMsg_pb2.pyi +34 -4
  107. streamlit/proto/Balloons_pb2.pyi +7 -1
  108. streamlit/proto/BidiComponent_pb2.py +34 -0
  109. streamlit/proto/BidiComponent_pb2.pyi +159 -0
  110. streamlit/proto/Block_pb2.py +7 -7
  111. streamlit/proto/Block_pb2.pyi +39 -36
  112. streamlit/proto/BokehChart_pb2.pyi +7 -1
  113. streamlit/proto/ButtonGroup_pb2.pyi +9 -9
  114. streamlit/proto/Button_pb2.py +2 -2
  115. streamlit/proto/Button_pb2.pyi +11 -2
  116. streamlit/proto/CameraInput_pb2.pyi +7 -1
  117. streamlit/proto/ChatInput_pb2.py +6 -6
  118. streamlit/proto/ChatInput_pb2.pyi +18 -6
  119. streamlit/proto/Checkbox_pb2.pyi +3 -3
  120. streamlit/proto/ClientState_pb2.pyi +10 -4
  121. streamlit/proto/Code_pb2.pyi +7 -1
  122. streamlit/proto/ColorPicker_pb2.pyi +7 -1
  123. streamlit/proto/Common_pb2.py +3 -3
  124. streamlit/proto/Common_pb2.pyi +35 -23
  125. streamlit/proto/Components_pb2.pyi +19 -13
  126. streamlit/proto/DataFrame_pb2.pyi +55 -49
  127. streamlit/proto/DateInput_pb2.pyi +7 -1
  128. streamlit/proto/DateTimeInput_pb2.py +28 -0
  129. streamlit/proto/DateTimeInput_pb2.pyi +92 -0
  130. streamlit/proto/DeckGlJsonChart_pb2.py +10 -4
  131. streamlit/proto/DeckGlJsonChart_pb2.pyi +12 -6
  132. streamlit/proto/Delta_pb2.pyi +7 -1
  133. streamlit/proto/DocString_pb2.pyi +10 -4
  134. streamlit/proto/DownloadButton_pb2.py +2 -2
  135. streamlit/proto/DownloadButton_pb2.pyi +16 -2
  136. streamlit/proto/Element_pb2.py +7 -3
  137. streamlit/proto/Element_pb2.pyi +33 -5
  138. streamlit/proto/Empty_pb2.pyi +7 -1
  139. streamlit/proto/Exception_pb2.pyi +7 -1
  140. streamlit/proto/Favicon_pb2.pyi +7 -1
  141. streamlit/proto/FileUploader_pb2.pyi +7 -1
  142. streamlit/proto/ForwardMsg_pb2.py +12 -10
  143. streamlit/proto/ForwardMsg_pb2.pyi +42 -15
  144. streamlit/proto/GapSize_pb2.pyi +4 -4
  145. streamlit/proto/GitInfo_pb2.pyi +3 -3
  146. streamlit/proto/GraphVizChart_pb2.pyi +7 -1
  147. streamlit/proto/Heading_pb2.pyi +7 -1
  148. streamlit/proto/HeightConfig_pb2.py +2 -2
  149. streamlit/proto/HeightConfig_pb2.pyi +13 -4
  150. streamlit/proto/Html_pb2.py +2 -2
  151. streamlit/proto/Html_pb2.pyi +11 -2
  152. streamlit/proto/IFrame_pb2.pyi +7 -1
  153. streamlit/proto/Image_pb2.pyi +10 -4
  154. streamlit/proto/Json_pb2.pyi +7 -1
  155. streamlit/proto/LabelVisibilityMessage_pb2.pyi +3 -3
  156. streamlit/proto/LinkButton_pb2.py +2 -2
  157. streamlit/proto/LinkButton_pb2.pyi +15 -2
  158. streamlit/proto/Logo_pb2.pyi +7 -1
  159. streamlit/proto/Markdown_pb2.pyi +3 -3
  160. streamlit/proto/Metric_pb2.pyi +7 -7
  161. streamlit/proto/MetricsEvent_pb2.pyi +10 -4
  162. streamlit/proto/MultiSelect_pb2.pyi +7 -1
  163. streamlit/proto/NamedDataSet_pb2.pyi +7 -1
  164. streamlit/proto/Navigation_pb2.pyi +3 -3
  165. streamlit/proto/NewSession_pb2.py +18 -18
  166. streamlit/proto/NewSession_pb2.pyi +59 -40
  167. streamlit/proto/NumberInput_pb2.pyi +3 -3
  168. streamlit/proto/PageConfig_pb2.pyi +7 -7
  169. streamlit/proto/PageInfo_pb2.pyi +7 -1
  170. streamlit/proto/PageLink_pb2.py +2 -2
  171. streamlit/proto/PageLink_pb2.pyi +11 -2
  172. streamlit/proto/PageNotFound_pb2.pyi +7 -1
  173. streamlit/proto/PageProfile_pb2.pyi +13 -7
  174. streamlit/proto/PagesChanged_pb2.pyi +7 -1
  175. streamlit/proto/ParentMessage_pb2.pyi +7 -1
  176. streamlit/proto/PlotlyChart_pb2.py +8 -6
  177. streamlit/proto/PlotlyChart_pb2.pyi +9 -7
  178. streamlit/proto/Progress_pb2.pyi +7 -1
  179. streamlit/proto/Radio_pb2.pyi +7 -1
  180. streamlit/proto/RootContainer_pb2.pyi +1 -1
  181. streamlit/proto/Selectbox_pb2.pyi +7 -1
  182. streamlit/proto/SessionEvent_pb2.pyi +7 -1
  183. streamlit/proto/SessionStatus_pb2.pyi +7 -1
  184. streamlit/proto/Skeleton_pb2.pyi +3 -3
  185. streamlit/proto/Slider_pb2.pyi +5 -5
  186. streamlit/proto/Snow_pb2.pyi +7 -1
  187. streamlit/proto/Space_pb2.py +27 -0
  188. streamlit/proto/Space_pb2.pyi +48 -0
  189. streamlit/proto/Spinner_pb2.pyi +7 -1
  190. streamlit/proto/TextAlignmentConfig_pb2.py +29 -0
  191. streamlit/proto/TextAlignmentConfig_pb2.pyi +68 -0
  192. streamlit/proto/TextArea_pb2.pyi +7 -1
  193. streamlit/proto/TextInput_pb2.pyi +3 -3
  194. streamlit/proto/Text_pb2.pyi +7 -1
  195. streamlit/proto/TimeInput_pb2.pyi +7 -1
  196. streamlit/proto/Toast_pb2.pyi +7 -1
  197. streamlit/proto/VegaLiteChart_pb2.pyi +7 -1
  198. streamlit/proto/Video_pb2.pyi +6 -6
  199. streamlit/proto/WidgetStates_pb2.py +2 -2
  200. streamlit/proto/WidgetStates_pb2.pyi +23 -7
  201. streamlit/proto/WidthConfig_pb2.py +2 -2
  202. streamlit/proto/WidthConfig_pb2.pyi +13 -4
  203. streamlit/proto/openmetrics_data_model_pb2.pyi +52 -52
  204. streamlit/runtime/app_session.py +65 -2
  205. streamlit/runtime/caching/cache_data_api.py +5 -5
  206. streamlit/runtime/caching/cache_errors.py +4 -1
  207. streamlit/runtime/caching/cache_resource_api.py +5 -4
  208. streamlit/runtime/caching/cache_utils.py +3 -2
  209. streamlit/runtime/caching/cached_message_replay.py +3 -3
  210. streamlit/runtime/caching/hashing.py +4 -5
  211. streamlit/runtime/caching/legacy_cache_api.py +2 -1
  212. streamlit/runtime/connection_factory.py +1 -3
  213. streamlit/runtime/download_data_util.py +53 -0
  214. streamlit/runtime/forward_msg_queue.py +5 -1
  215. streamlit/runtime/fragment.py +2 -1
  216. streamlit/runtime/media_file_manager.py +178 -2
  217. streamlit/runtime/memory_media_file_storage.py +1 -1
  218. streamlit/runtime/metrics_util.py +91 -3
  219. streamlit/runtime/runtime.py +14 -0
  220. streamlit/runtime/scriptrunner/exec_code.py +2 -1
  221. streamlit/runtime/scriptrunner/script_runner.py +5 -3
  222. streamlit/runtime/scriptrunner_utils/script_run_context.py +3 -6
  223. streamlit/runtime/secrets.py +2 -4
  224. streamlit/runtime/session_manager.py +3 -1
  225. streamlit/runtime/state/common.py +30 -5
  226. streamlit/runtime/state/presentation.py +85 -0
  227. streamlit/runtime/state/query_params.py +80 -29
  228. streamlit/runtime/state/safe_session_state.py +2 -2
  229. streamlit/runtime/state/session_state.py +221 -17
  230. streamlit/runtime/state/widgets.py +19 -3
  231. streamlit/runtime/websocket_session_manager.py +3 -1
  232. streamlit/source_util.py +2 -2
  233. streamlit/static/index.html +2 -2
  234. streamlit/static/manifest.json +557 -239
  235. streamlit/static/static/css/{index.CIiu7Ygf.css → index.BpABIXK9.css} +1 -1
  236. streamlit/static/static/css/index.DgR7E2CV.css +1 -0
  237. streamlit/static/static/js/{ErrorOutline.esm.DUpR0_Ka.js → ErrorOutline.esm.ZJDbmVTx.js} +1 -1
  238. streamlit/static/static/js/{FileDownload.esm.CN4j9-1w.js → FileDownload.esm.Dx0vI3vH.js} +1 -1
  239. streamlit/static/static/js/{FileHelper.CaIUKG91.js → FileHelper.B7Ero7qQ.js} +3 -3
  240. streamlit/static/static/js/{FormClearHelper.DTcdrasw.js → FormClearHelper.CG2XN1_g.js} +1 -1
  241. streamlit/static/static/js/IFrameUtil.DefezniK.js +1 -0
  242. streamlit/static/static/js/InputInstructions.Cj5-1zf6.js +1 -0
  243. streamlit/static/static/js/Particles.BfWfv0Aw.js +1 -0
  244. streamlit/static/static/js/{ProgressBar.DetlP5aY.js → ProgressBar.CGQ8OgfO.js} +2 -2
  245. streamlit/static/static/js/StreamlitSyntaxHighlighter.DTKLpwhl.js +20 -0
  246. streamlit/static/static/js/{Toolbar.C77ar7rq.js → Toolbar.B2qFUmd9.js} +1 -1
  247. streamlit/static/static/js/_arrayIncludes.B19Iyn2B.js +1 -0
  248. streamlit/static/static/js/_baseIndexOf.BTknn6Gb.js +1 -0
  249. streamlit/static/static/js/{base-input.BQft14La.js → base-input.o9tL8MDP.js} +4 -4
  250. streamlit/static/static/js/{checkbox.yZOfXCeX.js → checkbox.0BeV1IBL.js} +1 -1
  251. streamlit/static/static/js/{createSuper.Dh9w1cs8.js → createSuper.RBO59fEm.js} +1 -1
  252. streamlit/static/static/js/data-grid-overlay-editor.CiTkUy0t.js +1 -0
  253. streamlit/static/static/js/{downloader.MeHtkq8r.js → downloader.DwNZg3Mw.js} +1 -1
  254. streamlit/static/static/js/embed.XT9xNd3F.js +195 -0
  255. streamlit/static/static/js/{es6.VpBPGCnM.js → es6.x9KsYQg-.js} +2 -2
  256. streamlit/static/static/js/{iframeResizer.contentWindow.yMw_ARIL.js → iframeResizer.contentWindow.ZVXpMPi0.js} +1 -1
  257. streamlit/static/static/js/index.5VPOamri.js +1 -0
  258. streamlit/static/static/js/index.8HslT92O.js +14 -0
  259. streamlit/static/static/js/index.AnXMIBz3.js +7 -0
  260. streamlit/static/static/js/index.B0yp3bM1.js +6 -0
  261. streamlit/static/static/js/index.B1fRb5wF.js +1 -0
  262. streamlit/static/static/js/index.B527JZdO.js +3 -0
  263. streamlit/static/static/js/index.BHgV-yW4.js +1 -0
  264. streamlit/static/static/js/index.BQr-XwGV.js +1 -0
  265. streamlit/static/static/js/index.BTtmaLDB.js +1 -0
  266. streamlit/static/static/js/index.BWB_91TA.js +1 -0
  267. streamlit/static/static/js/index.BfEKaEmw.js +1 -0
  268. streamlit/static/static/js/index.BfXjTO8b.js +1 -0
  269. streamlit/static/static/js/index.Bjy4NRu9.js +3 -0
  270. streamlit/static/static/js/index.Bu5JWpT_.js +1 -0
  271. streamlit/static/static/js/index.BuCx76ZV.js +1 -0
  272. streamlit/static/static/js/index.BxjzhVUb.js +2 -0
  273. streamlit/static/static/js/index.By55VdPY.js +1 -0
  274. streamlit/static/static/js/index.CF5MxTbK.js +1 -0
  275. streamlit/static/static/js/index.CLmq_z9K.js +1 -0
  276. streamlit/static/static/js/index.CNH4rdSz.js +1 -0
  277. streamlit/static/static/js/{index.B0H9IXUJ.js → index.CTgm_-jO.js} +10 -41
  278. streamlit/static/static/js/index.C_rK-Swb.js +188 -0
  279. streamlit/static/static/js/index.CjozwSzS.js +1 -0
  280. streamlit/static/static/js/{index.CH1tqnSs.js → index.CkGVt6-G.js} +1 -1
  281. streamlit/static/static/js/index.CuvXOyER.js +2 -0
  282. streamlit/static/static/js/{index.FFOzOWzC.js → index.CyUHWoCC.js} +2 -2
  283. streamlit/static/static/js/index.CyroQtI4.js +2 -0
  284. streamlit/static/static/js/index.D6HmkoDm.js +263 -0
  285. streamlit/static/static/js/index.DAqCNvsO.js +1 -0
  286. streamlit/static/static/js/index.DB_w_CZQ.js +1 -0
  287. streamlit/static/static/js/index.DBalctjj.js +2 -0
  288. streamlit/static/static/js/index.DK0RFJUG.js +11 -0
  289. streamlit/static/static/js/index.DMxc2XFp.js +151 -0
  290. streamlit/static/static/js/index.DO5utP74.js +2 -0
  291. streamlit/static/static/js/index.DS7lf09n.js +1 -0
  292. streamlit/static/static/js/index.DWexTVLY.js +1 -0
  293. streamlit/static/static/js/index.DXxnU5ej.js +1 -0
  294. streamlit/static/static/js/index.DcU3uDvB.js +2 -0
  295. streamlit/static/static/js/index.DlltaH7J.js +1 -0
  296. streamlit/static/static/js/index.DpNTZz82.js +27 -0
  297. streamlit/static/static/js/index.Dr9HIhQw.js +1 -0
  298. streamlit/static/static/js/index.DsgAU5lc.js +1 -0
  299. streamlit/static/static/js/{index.64ejlaaT.js → index.KfXqjDYy.js} +1 -1
  300. streamlit/static/static/js/index.PaidgjCs.js +1 -0
  301. streamlit/static/static/js/index.RJZuWCGA.js +1 -0
  302. streamlit/static/static/js/{index.Ctn27_AE.js → index.hbeqcRTn.js} +53 -122
  303. streamlit/static/static/js/index.q5hIQwAY.js +1 -0
  304. streamlit/static/static/js/index.rORSX6IW.js +1 -0
  305. streamlit/static/static/js/index.uSX757_v.js +1 -0
  306. streamlit/static/static/js/index.x_QRaLMd.js +1 -0
  307. streamlit/static/static/js/{input.s6pjQ49A.js → input.D5oh9-aB.js} +2 -2
  308. streamlit/static/static/js/main.q9oGOg0H.js +13 -0
  309. streamlit/static/static/js/{memory.Cuvsdfrl.js → memory.5kCSFUJS.js} +1 -1
  310. streamlit/static/static/js/moment.C3j7ZXd7.js +4 -0
  311. streamlit/static/static/js/number-overlay-editor.Cn_LsK8N.js +9 -0
  312. streamlit/static/static/js/pandasStylerUtils.BqhXt51_.js +1 -0
  313. streamlit/static/static/js/{possibleConstructorReturn.CqidKeei.js → possibleConstructorReturn.DD9NK1Z8.js} +1 -1
  314. streamlit/static/static/js/record.B-tDciZb.js +1 -0
  315. streamlit/static/static/js/{sandbox.CCQREcJx.js → sandbox.DACSyz29.js} +1 -1
  316. streamlit/static/static/js/styled-components.C3R090At.js +1 -0
  317. streamlit/static/static/js/threshold.Q1mXg5rX.js +1 -0
  318. streamlit/static/static/js/throttle.B0GR3Iyz.js +1 -0
  319. streamlit/static/static/js/{timepicker.mkJF97Bb.js → timepicker.BdhzPxrv.js} +1 -1
  320. streamlit/static/static/js/timer.C2hYhUse.js +1 -0
  321. streamlit/static/static/js/{toConsumableArray.De7I7KVR.js → toConsumableArray.Db2pdqM2.js} +1 -1
  322. streamlit/static/static/js/uniqueId.CtqIr-Yh.js +1 -0
  323. streamlit/static/static/js/urls.BwSlolu9.js +1 -0
  324. streamlit/static/static/js/{useBasicWidgetState.CedkNjUW.js → useBasicWidgetState.Bfp6TnSw.js} +1 -1
  325. streamlit/static/static/js/useIntlLocale.hRV75Xgj.js +12 -0
  326. streamlit/static/static/js/{useTextInputAutoExpand.Ca7w8dVs.js → useTextInputAutoExpand.QepX7n8Y.js} +1 -1
  327. streamlit/static/static/js/useUpdateUiValue.DHx8TzX6.js +1 -0
  328. streamlit/static/static/js/useWaveformController.WxVzpzEX.js +1 -0
  329. streamlit/static/static/js/value.B4vHRSi7.js +1 -0
  330. streamlit/static/static/js/wavesurfer.esm.vI8Eid4k.js +73 -0
  331. streamlit/static/static/js/withCalculatedWidth.DcKeRSWJ.js +1 -0
  332. streamlit/static/static/js/withFullScreenWrapper.CrHddARq.js +1 -0
  333. streamlit/static/static/media/MaterialSymbols-Rounded.C7IFxh57.woff2 +0 -0
  334. streamlit/string_util.py +9 -4
  335. streamlit/testing/v1/app_test.py +17 -2
  336. streamlit/testing/v1/element_tree.py +85 -9
  337. streamlit/testing/v1/util.py +2 -2
  338. streamlit/type_util.py +3 -4
  339. streamlit/url_util.py +1 -3
  340. streamlit/user_info.py +1 -2
  341. streamlit/util.py +3 -1
  342. streamlit/watcher/event_based_path_watcher.py +23 -12
  343. streamlit/watcher/local_sources_watcher.py +11 -1
  344. streamlit/watcher/path_watcher.py +9 -6
  345. streamlit/watcher/polling_path_watcher.py +4 -1
  346. streamlit/watcher/util.py +2 -2
  347. streamlit/web/bootstrap.py +24 -0
  348. streamlit/web/cli.py +51 -22
  349. streamlit/web/server/bidi_component_request_handler.py +193 -0
  350. streamlit/web/server/component_file_utils.py +97 -0
  351. streamlit/web/server/component_request_handler.py +8 -21
  352. streamlit/web/server/oauth_authlib_routes.py +5 -2
  353. streamlit/web/server/oidc_mixin.py +3 -1
  354. streamlit/web/server/routes.py +2 -2
  355. streamlit/web/server/server.py +9 -0
  356. streamlit/web/server/server_util.py +3 -1
  357. streamlit/web/server/upload_file_request_handler.py +19 -1
  358. {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/METADATA +10 -7
  359. streamlit-1.52.0.dist-info/RECORD +620 -0
  360. streamlit/static/static/css/index.CHEnSPGk.css +0 -1
  361. streamlit/static/static/js/Hooks.BRba_Own.js +0 -1
  362. streamlit/static/static/js/InputInstructions.xnSDuYeQ.js +0 -1
  363. streamlit/static/static/js/Particles.CElH0XX2.js +0 -1
  364. streamlit/static/static/js/data-grid-overlay-editor.DcuHuCyW.js +0 -1
  365. streamlit/static/static/js/index.6xX1278W.js +0 -975
  366. streamlit/static/static/js/index.B-hiXRzw.js +0 -1
  367. streamlit/static/static/js/index.B4cAbHP6.js +0 -1
  368. streamlit/static/static/js/index.B4dUQfni.js +0 -1
  369. streamlit/static/static/js/index.BPQo7BKk.js +0 -1
  370. streamlit/static/static/js/index.Baqa90pe.js +0 -2
  371. streamlit/static/static/js/index.Bj9JgOEC.js +0 -1
  372. streamlit/static/static/js/index.BjCwMzj4.js +0 -3
  373. streamlit/static/static/js/index.Bm3VbPB5.js +0 -1
  374. streamlit/static/static/js/index.Bxz2yX3P.js +0 -1
  375. streamlit/static/static/js/index.BycLveZ4.js +0 -1
  376. streamlit/static/static/js/index.C9BdUqTi.js +0 -1
  377. streamlit/static/static/js/index.CFMf5_ez.js +0 -197
  378. streamlit/static/static/js/index.CGYqqs6j.js +0 -1
  379. streamlit/static/static/js/index.CMItVsFA.js +0 -1
  380. streamlit/static/static/js/index.CTBk8Vk2.js +0 -1
  381. streamlit/static/static/js/index.CiAQIz1H.js +0 -7
  382. streamlit/static/static/js/index.Cj7DSzVR.js +0 -73
  383. streamlit/static/static/js/index.Ck8rQ9OL.js +0 -1
  384. streamlit/static/static/js/index.ClELlchS.js +0 -1617
  385. streamlit/static/static/js/index.Cnpi3o3E.js +0 -1
  386. streamlit/static/static/js/index.D2QEXQq_.js +0 -1
  387. streamlit/static/static/js/index.DH71Ezyj.js +0 -1
  388. streamlit/static/static/js/index.DHh-U0dK.js +0 -3
  389. streamlit/static/static/js/index.DK7hD7_w.js +0 -1
  390. streamlit/static/static/js/index.DKv_lNO7.js +0 -2
  391. streamlit/static/static/js/index.DNLrMXgm.js +0 -12
  392. streamlit/static/static/js/index.DW0Grddz.js +0 -1
  393. streamlit/static/static/js/index.Dbe-Q3C-.js +0 -2
  394. streamlit/static/static/js/index.DcPNYEUo.js +0 -1
  395. streamlit/static/static/js/index.DuxqVQpd.js +0 -1
  396. streamlit/static/static/js/index.GRUzrudl.js +0 -1
  397. streamlit/static/static/js/number-overlay-editor.DdgVR5m3.js +0 -9
  398. streamlit/static/static/js/uniqueId.RI1LJdtz.js +0 -1
  399. streamlit/static/static/js/useUpdateUiValue.DeXelfRH.js +0 -1
  400. streamlit/static/static/js/withFullScreenWrapper.C3561XxJ.js +0 -1
  401. streamlit/static/static/media/MaterialSymbols-Rounded.DeCZgS-4.woff2 +0 -0
  402. streamlit-1.50.0.dist-info/RECORD +0 -557
  403. {streamlit-1.50.0.data → streamlit-1.52.0.data}/scripts/streamlit.cmd +0 -0
  404. {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/WHEEL +0 -0
  405. {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/entry_points.txt +0 -0
  406. {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,27 @@
1
+ import{cH as Rt,cI as _t,cJ as Ot,cK as _e,cL as Mt,cM as Ft,cN as Pt,cO as Bt,cP as Ht,cQ as At,c7 as fe,cR as Tt,cS as $t,al as Ee,ag as Oe,aB as s,r as C,bP as g,bA as _,x as ge,g as Nt,l as qe,j as A,o as Dt,T as jt,P as Lt,ac as zt,cT as Gt,m as Wt}from"./index.DMxc2XFp.js";import{u as Ut}from"./useBasicWidgetState.Bfp6TnSw.js";import{t as It,d as Vt}from"./throttle.B0GR3Iyz.js";import"./FormClearHelper.CG2XN1_g.js";function xt(r){return typeof r=="function"?r:Rt}function qt(r,e){var t=_e(r)?_t:Ot;return t(r,xt(e))}function $(r,e){var t=_e(r)?Mt:Ft;return t(r,Pt(e))}const Xt=Object.freeze(Object.defineProperty({__proto__:null,default:$},Symbol.toStringTag,{value:"Module"}));function Yt(r,e){return r&&Bt(r,xt(e))}const Kt=Object.freeze(Object.defineProperty({__proto__:null,default:Yt},Symbol.toStringTag,{value:"Module"}));var Zt="[object String]";function Jt(r){return typeof r=="string"||!_e(r)&&Ht(r)&&At(r)==Zt}const Qt=Object.freeze(Object.defineProperty({__proto__:null,default:Jt},Symbol.toStringTag,{value:"Module"}));function Xe(r){return r===void 0}var R={},j={};const er=fe(Qt),Me=fe(Kt),tr=fe(Tt),rr=fe(Xt);var Ye;function nr(){if(Ye)return j;Ye=1,Object.defineProperty(j,"__esModule",{value:!0}),j.flattenNames=void 0;var r=er,e=h(r),t=Me,n=h(t),a=tr,i=h(a),o=rr,l=h(o);function h(p){return p&&p.__esModule?p:{default:p}}var c=j.flattenNames=function p(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=[];return(0,l.default)(u,function(f){Array.isArray(f)?p(f).map(function(v){return d.push(v)}):(0,i.default)(f)?(0,n.default)(f,function(v,b){v===!0&&d.push(b),d.push(b+"-"+v)}):(0,e.default)(f)&&d.push(f)}),d};return j.default=c,j}var L={};const ar=fe($t);var Ke;function ir(){if(Ke)return L;Ke=1,Object.defineProperty(L,"__esModule",{value:!0}),L.mergeClasses=void 0;var r=Me,e=i(r),t=ar,n=i(t),a=Object.assign||function(l){for(var h=1;h<arguments.length;h++){var c=arguments[h];for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(l[p]=c[p])}return l};function i(l){return l&&l.__esModule?l:{default:l}}var o=L.mergeClasses=function(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],p=h.default&&(0,n.default)(h.default)||{};return c.map(function(u){var d=h[u];return d&&(0,e.default)(d,function(f,v){p[v]||(p[v]={}),p[v]=a({},p[v],d[v])}),u}),p};return L.default=o,L}var z={},Ze;function or(){if(Ze)return z;Ze=1,Object.defineProperty(z,"__esModule",{value:!0}),z.autoprefix=void 0;var r=Me,e=n(r),t=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var c in h)Object.prototype.hasOwnProperty.call(h,c)&&(o[c]=h[c])}return o};function n(o){return o&&o.__esModule?o:{default:o}}var a={borderRadius:function(l){return{msBorderRadius:l,MozBorderRadius:l,OBorderRadius:l,WebkitBorderRadius:l,borderRadius:l}},boxShadow:function(l){return{msBoxShadow:l,MozBoxShadow:l,OBoxShadow:l,WebkitBoxShadow:l,boxShadow:l}},userSelect:function(l){return{WebkitTouchCallout:l,KhtmlUserSelect:l,MozUserSelect:l,msUserSelect:l,WebkitUserSelect:l,userSelect:l}},flex:function(l){return{WebkitBoxFlex:l,MozBoxFlex:l,WebkitFlex:l,msFlex:l,flex:l}},flexBasis:function(l){return{WebkitFlexBasis:l,flexBasis:l}},justifyContent:function(l){return{WebkitJustifyContent:l,justifyContent:l}},transition:function(l){return{msTransition:l,MozTransition:l,OTransition:l,WebkitTransition:l,transition:l}},transform:function(l){return{msTransform:l,MozTransform:l,OTransform:l,WebkitTransform:l,transform:l}},absolute:function(l){var h=l&&l.split(" ");return{position:"absolute",top:h&&h[0],right:h&&h[1],bottom:h&&h[2],left:h&&h[3]}},extend:function(l,h){var c=h[l];return c||{extend:l}}},i=z.autoprefix=function(l){var h={};return(0,e.default)(l,function(c,p){var u={};(0,e.default)(c,function(d,f){var v=a[f];v?u=t({},u,v(d)):u[f]=d}),h[p]=u}),h};return z.default=i,z}var G={},Je;function lr(){if(Je)return G;Je=1,Object.defineProperty(G,"__esModule",{value:!0}),G.hover=void 0;var r=Object.assign||function(h){for(var c=1;c<arguments.length;c++){var p=arguments[c];for(var u in p)Object.prototype.hasOwnProperty.call(p,u)&&(h[u]=p[u])}return h},e=Ee(),t=n(e);function n(h){return h&&h.__esModule?h:{default:h}}function a(h,c){if(!(h instanceof c))throw new TypeError("Cannot call a class as a function")}function i(h,c){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:h}function o(h,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);h.prototype=Object.create(c&&c.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(h,c):h.__proto__=c)}var l=G.hover=function(c){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(u){o(d,u);function d(){var f,v,b,m;a(this,d);for(var E=arguments.length,M=Array(E),k=0;k<E;k++)M[k]=arguments[k];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(M))),b),b.state={hover:!1},b.handleMouseOver=function(){return b.setState({hover:!0})},b.handleMouseOut=function(){return b.setState({hover:!1})},b.render=function(){return t.default.createElement(p,{onMouseOver:b.handleMouseOver,onMouseOut:b.handleMouseOut},t.default.createElement(c,r({},b.props,b.state)))},v),i(b,m)}return d}(t.default.Component)};return G.default=l,G}var W={},Qe;function sr(){if(Qe)return W;Qe=1,Object.defineProperty(W,"__esModule",{value:!0}),W.active=void 0;var r=Object.assign||function(h){for(var c=1;c<arguments.length;c++){var p=arguments[c];for(var u in p)Object.prototype.hasOwnProperty.call(p,u)&&(h[u]=p[u])}return h},e=Ee(),t=n(e);function n(h){return h&&h.__esModule?h:{default:h}}function a(h,c){if(!(h instanceof c))throw new TypeError("Cannot call a class as a function")}function i(h,c){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:h}function o(h,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);h.prototype=Object.create(c&&c.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(h,c):h.__proto__=c)}var l=W.active=function(c){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(u){o(d,u);function d(){var f,v,b,m;a(this,d);for(var E=arguments.length,M=Array(E),k=0;k<E;k++)M[k]=arguments[k];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(M))),b),b.state={active:!1},b.handleMouseDown=function(){return b.setState({active:!0})},b.handleMouseUp=function(){return b.setState({active:!1})},b.render=function(){return t.default.createElement(p,{onMouseDown:b.handleMouseDown,onMouseUp:b.handleMouseUp},t.default.createElement(c,r({},b.props,b.state)))},v),i(b,m)}return d}(t.default.Component)};return W.default=l,W}var xe={},et;function hr(){if(et)return xe;et=1,Object.defineProperty(xe,"__esModule",{value:!0});var r=function(t,n){var a={},i=function(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a[l]=h};return t===0&&i("first-child"),t===n-1&&i("last-child"),(t===0||t%2===0)&&i("even"),Math.abs(t%2)===1&&i("odd"),i("nth-child",t),a};return xe.default=r,xe}var tt;function cr(){if(tt)return R;tt=1,Object.defineProperty(R,"__esModule",{value:!0}),R.ReactCSS=R.loop=R.handleActive=R.handleHover=R.hover=void 0;var r=nr(),e=d(r),t=ir(),n=d(t),a=or(),i=d(a),o=lr(),l=d(o),h=sr(),c=d(h),p=hr(),u=d(p);function d(v){return v&&v.__esModule?v:{default:v}}R.hover=l.default,R.handleHover=l.default,R.handleActive=c.default,R.loop=u.default;var f=R.ReactCSS=function(b){for(var m=arguments.length,E=Array(m>1?m-1:0),M=1;M<m;M++)E[M-1]=arguments[M];var k=(0,e.default)(E),T=(0,n.default)(b,k);return(0,i.default)(T)};return R.default=f,R}var Fe=cr();const y=Oe(Fe);var pr=function(e,t,n,a,i){var o=i.clientWidth,l=i.clientHeight,h=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,c=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,p=h-(i.getBoundingClientRect().left+window.pageXOffset),u=c-(i.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var d=void 0;if(u<0?d=0:u>l?d=1:d=Math.round(u*100/l)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var f=void 0;if(p<0?f=0:p>o?f=1:f=Math.round(p*100/o)/100,a!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},Ce={},ur=function(e,t,n,a){if(typeof document>"u"&&!a)return null;var i=a?new a:document.createElement("canvas");i.width=n*2,i.height=n*2;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),i.toDataURL()):null},dr=function(e,t,n,a){var i=e+"-"+t+"-"+n+(a?"-server":"");if(Ce[i])return Ce[i];var o=ur(e,t,n,a);return Ce[i]=o,o},rt=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},le=function(e){var t=e.white,n=e.grey,a=e.size,i=e.renderers,o=e.borderRadius,l=e.boxShadow,h=e.children,c=y({default:{grid:{borderRadius:o,boxShadow:l,absolute:"0px 0px 0px 0px",background:"url("+dr(t,n,a,i.canvas)+") center left"}}});return C.isValidElement(h)?s.cloneElement(h,rt({},h.props,{style:rt({},h.props.style,c.grid)})):s.createElement("div",{style:c.grid})};le.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var fr=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},gr=function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function br(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function vr(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Pe=function(r){vr(e,r);function e(){var t,n,a,i;br(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(n=(a=nt(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),a),a.handleChange=function(c){var p=pr(c,a.props.hsl,a.props.direction,a.props.a,a.container);p&&typeof a.props.onChange=="function"&&a.props.onChange(p,c)},a.handleMouseDown=function(c){a.handleChange(c),window.addEventListener("mousemove",a.handleChange),window.addEventListener("mouseup",a.handleMouseUp)},a.handleMouseUp=function(){a.unbindEventListeners()},a.unbindEventListeners=function(){window.removeEventListener("mousemove",a.handleChange),window.removeEventListener("mouseup",a.handleMouseUp)},n),nt(a,i)}return gr(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var n=this,a=this.props.rgb,i=y({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+a.r+","+a.g+","+a.b+`, 0) 0%,
2
+ rgba(`+a.r+","+a.g+","+a.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:a.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+a.r+","+a.g+","+a.b+`, 0) 0%,
3
+ rgba(`+a.r+","+a.g+","+a.b+", 1) 100%)"},pointer:{left:0,top:a.a*100+"%"}},overwrite:fr({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return s.createElement("div",{style:i.alpha},s.createElement("div",{style:i.checkboard},s.createElement(le,{renderers:this.props.renderers})),s.createElement("div",{style:i.gradient}),s.createElement("div",{style:i.container,ref:function(l){return n.container=l},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("div",{style:i.pointer},this.props.pointer?s.createElement(this.props.pointer,this.props):s.createElement("div",{style:i.slider}))))}}]),e}(C.PureComponent||C.Component),xr=function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function mr(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function wr(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Er(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Sr=1,mt=38,Cr=40,kr=[mt,Cr],Rr=function(e){return kr.indexOf(e)>-1},_r=function(e){return Number(String(e).replace(/%/g,""))},Or=1,w=function(r){Er(e,r);function e(t){yr(this,e);var n=wr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(a){n.setUpdatedValue(a.target.value,a)},n.handleKeyDown=function(a){var i=_r(a.target.value);if(!isNaN(i)&&Rr(a.keyCode)){var o=n.getArrowOffset(),l=a.keyCode===mt?i+o:i-o;n.setUpdatedValue(l,a)}},n.handleDrag=function(a){if(n.props.dragLabel){var i=Math.round(n.props.value+a.movementX);i>=0&&i<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(i),a)}},n.handleMouseDown=function(a){n.props.dragLabel&&(a.preventDefault(),n.handleDrag(a),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(t.value).toUpperCase(),blurValue:String(t.value).toUpperCase()},n.inputId="rc-editable-input-"+Or++,n}return xr(e,[{key:"componentDidUpdate",value:function(n,a){this.props.value!==this.state.value&&(n.value!==this.props.value||a.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(n){return mr({},this.props.label,n)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||Sr}},{key:"setUpdatedValue",value:function(n,a){var i=this.props.label?this.getValueObjectWithLabel(n):n;this.props.onChange&&this.props.onChange(i,a),this.setState({value:n})}},{key:"render",value:function(){var n=this,a=y({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return s.createElement("div",{style:a.wrap},s.createElement("input",{id:this.inputId,style:a.input,ref:function(o){return n.input=o},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?s.createElement("label",{htmlFor:this.inputId,style:a.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(C.PureComponent||C.Component),Mr=function(e,t,n,a){var i=a.clientWidth,o=a.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,h=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(a.getBoundingClientRect().left+window.pageXOffset),p=h-(a.getBoundingClientRect().top+window.pageYOffset);if(t==="vertical"){var u=void 0;if(p<0)u=359;else if(p>o)u=0;else{var d=-(p*100/o)+100;u=360*d/100}if(n.h!==u)return{h:u,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var f=void 0;if(c<0)f=0;else if(c>i)f=359;else{var v=c*100/i;f=360*v/100}if(n.h!==f)return{h:f,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null},Fr=function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function Pr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function at(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Br(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var se=function(r){Br(e,r);function e(){var t,n,a,i;Pr(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(n=(a=at(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),a),a.handleChange=function(c){var p=Mr(c,a.props.direction,a.props.hsl,a.container);p&&typeof a.props.onChange=="function"&&a.props.onChange(p,c)},a.handleMouseDown=function(c){a.handleChange(c),window.addEventListener("mousemove",a.handleChange),window.addEventListener("mouseup",a.handleMouseUp)},a.handleMouseUp=function(){a.unbindEventListeners()},n),at(a,i)}return Fr(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var n=this,a=this.props.direction,i=a===void 0?"horizontal":a,o=y({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:i==="vertical"});return s.createElement("div",{style:o.hue},s.createElement("div",{className:"hue-"+i,style:o.container,ref:function(h){return n.container=h},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("style",null,`
4
+ .hue-horizontal {
5
+ background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0
6
+ 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
7
+ background: -webkit-linear-gradient(to right, #f00 0%, #ff0
8
+ 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
9
+ }
10
+
11
+ .hue-vertical {
12
+ background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,
13
+ #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
14
+ background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,
15
+ #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
16
+ }
17
+ `),s.createElement("div",{style:o.pointer},this.props.pointer?s.createElement(this.props.pointer,this.props):s.createElement("div",{style:o.slider}))))}}]),e}(C.PureComponent||C.Component),be=function(e){var t=e.zDepth,n=e.radius,a=e.background,i=e.children,o=e.styles,l=o===void 0?{}:o,h=y(_({default:{wrap:{position:"relative",display:"inline-block"},content:{position:"relative"},bg:{absolute:"0px 0px 0px 0px",boxShadow:"0 "+t+"px "+t*4+"px rgba(0,0,0,.24)",borderRadius:n,background:a}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}}},l),{"zDepth-1":t===1});return s.createElement("div",{style:h.wrap},s.createElement("div",{style:h.bg}),s.createElement("div",{style:h.content},i))};be.propTypes={background:g.string,zDepth:g.oneOf([0,1,2,3,4,5]),radius:g.number,styles:g.object};be.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}};var Hr=function(e,t,n){var a=n.getBoundingClientRect(),i=a.width,o=a.height,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,h=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(n.getBoundingClientRect().left+window.pageXOffset),p=h-(n.getBoundingClientRect().top+window.pageYOffset);c<0?c=0:c>i&&(c=i),p<0?p=0:p>o&&(p=o);var u=c/i,d=1-p/o;return{h:t.h,s:u,v:d,a:t.a,source:"hsv"}},Ar=function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function Tr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function $r(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Nr(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var ve=function(r){Nr(e,r);function e(t){Tr(this,e);var n=$r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=function(a){typeof n.props.onChange=="function"&&n.throttle(n.props.onChange,Hr(a,n.props.hsl,n.container),a)},n.handleMouseDown=function(a){n.handleChange(a);var i=n.getContainerRenderWindow();i.addEventListener("mousemove",n.handleChange),i.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.throttle=It(function(a,i,o){a(i,o)},50),n}return Ar(e,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var n=this.container,a=window;!a.document.contains(n)&&a.parent!==a;)a=a.parent;return a}},{key:"unbindEventListeners",value:function(){var n=this.getContainerRenderWindow();n.removeEventListener("mousemove",this.handleChange),n.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var n=this,a=this.props.style||{},i=a.color,o=a.white,l=a.black,h=a.pointer,c=a.circle,p=y({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-(this.props.hsv.v*100)+100+"%",left:this.props.hsv.s*100+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:`0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),
18
+ 0 0 1px 2px rgba(0,0,0,.4)`,borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:i,white:o,black:l,pointer:h,circle:c}},{custom:!!this.props.style});return s.createElement("div",{style:p.color,ref:function(d){return n.container=d},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("style",null,`
19
+ .saturation-white {
20
+ background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
21
+ background: linear-gradient(to right, #fff, rgba(255,255,255,0));
22
+ }
23
+ .saturation-black {
24
+ background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
25
+ background: linear-gradient(to top, #000, rgba(0,0,0,0));
26
+ }
27
+ `),s.createElement("div",{style:p.white,className:"saturation-white"},s.createElement("div",{style:p.black,className:"saturation-black"}),s.createElement("div",{style:p.pointer},this.props.pointer?s.createElement(this.props.pointer,this.props):s.createElement("div",{style:p.circle}))))}}]),e}(C.PureComponent||C.Component);function we(r){"@babel/helpers - typeof";return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},we(r)}var Dr=/^\s+/,jr=/\s+$/;function x(r,e){if(r=r||"",e=e||{},r instanceof x)return r;if(!(this instanceof x))return new x(r,e);var t=Lr(r);this._originalInput=r,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=t.ok}x.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t,n,a,i,o,l;return t=e.r/255,n=e.g/255,a=e.b/255,t<=.03928?i=t/12.92:i=Math.pow((t+.055)/1.055,2.4),n<=.03928?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),a<=.03928?l=a/12.92:l=Math.pow((a+.055)/1.055,2.4),.2126*i+.7152*o+.0722*l},setAlpha:function(e){return this._a=yt(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=ot(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=ot(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+n+"%, "+a+"%)":"hsva("+t+", "+n+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var e=it(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=it(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+n+"%, "+a+"%)":"hsla("+t+", "+n+"%, "+a+"%, "+this._roundA+")"},toHex:function(e){return lt(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return Ur(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(S(this._r,255)*100)+"%",g:Math.round(S(this._g,255)*100)+"%",b:Math.round(S(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(S(this._r,255)*100)+"%, "+Math.round(S(this._g,255)*100)+"%, "+Math.round(S(this._b,255)*100)+"%)":"rgba("+Math.round(S(this._r,255)*100)+"%, "+Math.round(S(this._g,255)*100)+"%, "+Math.round(S(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:rn[lt(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+st(this._r,this._g,this._b,this._a),n=t,a=this._gradientType?"GradientType = 1, ":"";if(e){var i=x(e);n="#"+st(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,a=this._a<1&&this._a>=0,i=!t&&a&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return i?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return x(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Xr,arguments)},brighten:function(){return this._applyModification(Yr,arguments)},darken:function(){return this._applyModification(Kr,arguments)},desaturate:function(){return this._applyModification(Ir,arguments)},saturate:function(){return this._applyModification(Vr,arguments)},greyscale:function(){return this._applyModification(qr,arguments)},spin:function(){return this._applyModification(Zr,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(en,arguments)},complement:function(){return this._applyCombination(Jr,arguments)},monochromatic:function(){return this._applyCombination(tn,arguments)},splitcomplement:function(){return this._applyCombination(Qr,arguments)},triad:function(){return this._applyCombination(ht,[3])},tetrad:function(){return this._applyCombination(ht,[4])}};x.fromRatio=function(r,e){if(we(r)=="object"){var t={};for(var n in r)r.hasOwnProperty(n)&&(n==="a"?t[n]=r[n]:t[n]=pe(r[n]));r=t}return x(r,e)};function Lr(r){var e={r:0,g:0,b:0},t=1,n=null,a=null,i=null,o=!1,l=!1;return typeof r=="string"&&(r=ln(r)),we(r)=="object"&&(H(r.r)&&H(r.g)&&H(r.b)?(e=zr(r.r,r.g,r.b),o=!0,l=String(r.r).substr(-1)==="%"?"prgb":"rgb"):H(r.h)&&H(r.s)&&H(r.v)?(n=pe(r.s),a=pe(r.v),e=Wr(r.h,n,a),o=!0,l="hsv"):H(r.h)&&H(r.s)&&H(r.l)&&(n=pe(r.s),i=pe(r.l),e=Gr(r.h,n,i),o=!0,l="hsl"),r.hasOwnProperty("a")&&(t=r.a)),t=yt(t),{ok:o,format:r.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}function zr(r,e,t){return{r:S(r,255)*255,g:S(e,255)*255,b:S(t,255)*255}}function it(r,e,t){r=S(r,255),e=S(e,255),t=S(t,255);var n=Math.max(r,e,t),a=Math.min(r,e,t),i,o,l=(n+a)/2;if(n==a)i=o=0;else{var h=n-a;switch(o=l>.5?h/(2-n-a):h/(n+a),n){case r:i=(e-t)/h+(e<t?6:0);break;case e:i=(t-r)/h+2;break;case t:i=(r-e)/h+4;break}i/=6}return{h:i,s:o,l}}function Gr(r,e,t){var n,a,i;r=S(r,360),e=S(e,100),t=S(t,100);function o(c,p,u){return u<0&&(u+=1),u>1&&(u-=1),u<1/6?c+(p-c)*6*u:u<1/2?p:u<2/3?c+(p-c)*(2/3-u)*6:c}if(e===0)n=a=i=t;else{var l=t<.5?t*(1+e):t+e-t*e,h=2*t-l;n=o(h,l,r+1/3),a=o(h,l,r),i=o(h,l,r-1/3)}return{r:n*255,g:a*255,b:i*255}}function ot(r,e,t){r=S(r,255),e=S(e,255),t=S(t,255);var n=Math.max(r,e,t),a=Math.min(r,e,t),i,o,l=n,h=n-a;if(o=n===0?0:h/n,n==a)i=0;else{switch(n){case r:i=(e-t)/h+(e<t?6:0);break;case e:i=(t-r)/h+2;break;case t:i=(r-e)/h+4;break}i/=6}return{h:i,s:o,v:l}}function Wr(r,e,t){r=S(r,360)*6,e=S(e,100),t=S(t,100);var n=Math.floor(r),a=r-n,i=t*(1-e),o=t*(1-a*e),l=t*(1-(1-a)*e),h=n%6,c=[t,o,i,i,l,t][h],p=[l,t,t,o,i,i][h],u=[i,i,l,t,t,o][h];return{r:c*255,g:p*255,b:u*255}}function lt(r,e,t,n){var a=[B(Math.round(r).toString(16)),B(Math.round(e).toString(16)),B(Math.round(t).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function Ur(r,e,t,n,a){var i=[B(Math.round(r).toString(16)),B(Math.round(e).toString(16)),B(Math.round(t).toString(16)),B(wt(n))];return a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function st(r,e,t,n){var a=[B(wt(n)),B(Math.round(r).toString(16)),B(Math.round(e).toString(16)),B(Math.round(t).toString(16))];return a.join("")}x.equals=function(r,e){return!r||!e?!1:x(r).toRgbString()==x(e).toRgbString()};x.random=function(){return x.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Ir(r,e){e=e===0?0:e||10;var t=x(r).toHsl();return t.s-=e/100,t.s=Se(t.s),x(t)}function Vr(r,e){e=e===0?0:e||10;var t=x(r).toHsl();return t.s+=e/100,t.s=Se(t.s),x(t)}function qr(r){return x(r).desaturate(100)}function Xr(r,e){e=e===0?0:e||10;var t=x(r).toHsl();return t.l+=e/100,t.l=Se(t.l),x(t)}function Yr(r,e){e=e===0?0:e||10;var t=x(r).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),x(t)}function Kr(r,e){e=e===0?0:e||10;var t=x(r).toHsl();return t.l-=e/100,t.l=Se(t.l),x(t)}function Zr(r,e){var t=x(r).toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,x(t)}function Jr(r){var e=x(r).toHsl();return e.h=(e.h+180)%360,x(e)}function ht(r,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=x(r).toHsl(),n=[x(r)],a=360/e,i=1;i<e;i++)n.push(x({h:(t.h+i*a)%360,s:t.s,l:t.l}));return n}function Qr(r){var e=x(r).toHsl(),t=e.h;return[x(r),x({h:(t+72)%360,s:e.s,l:e.l}),x({h:(t+216)%360,s:e.s,l:e.l})]}function en(r,e,t){e=e||6,t=t||30;var n=x(r).toHsl(),a=360/t,i=[x(r)];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(x(n));return i}function tn(r,e){e=e||6;for(var t=x(r).toHsv(),n=t.h,a=t.s,i=t.v,o=[],l=1/e;e--;)o.push(x({h:n,s:a,v:i})),i=(i+l)%1;return o}x.mix=function(r,e,t){t=t===0?0:t||50;var n=x(r).toRgb(),a=x(e).toRgb(),i=t/100,o={r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a};return x(o)};x.readability=function(r,e){var t=x(r),n=x(e);return(Math.max(t.getLuminance(),n.getLuminance())+.05)/(Math.min(t.getLuminance(),n.getLuminance())+.05)};x.isReadable=function(r,e,t){var n=x.readability(r,e),a,i;switch(i=!1,a=sn(t),a.level+a.size){case"AAsmall":case"AAAlarge":i=n>=4.5;break;case"AAlarge":i=n>=3;break;case"AAAsmall":i=n>=7;break}return i};x.mostReadable=function(r,e,t){var n=null,a=0,i,o,l,h;t=t||{},o=t.includeFallbackColors,l=t.level,h=t.size;for(var c=0;c<e.length;c++)i=x.readability(r,e[c]),i>a&&(a=i,n=x(e[c]));return x.isReadable(r,n,{level:l,size:h})||!o?n:(t.includeFallbackColors=!1,x.mostReadable(r,["#fff","#000"],t))};var Re=x.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},rn=x.hexNames=nn(Re);function nn(r){var e={};for(var t in r)r.hasOwnProperty(t)&&(e[r[t]]=t);return e}function yt(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}function S(r,e){an(r)&&(r="100%");var t=on(r);return r=Math.min(e,Math.max(0,parseFloat(r))),t&&(r=parseInt(r*e,10)/100),Math.abs(r-e)<1e-6?1:r%e/parseFloat(e)}function Se(r){return Math.min(1,Math.max(0,r))}function F(r){return parseInt(r,16)}function an(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}function on(r){return typeof r=="string"&&r.indexOf("%")!=-1}function B(r){return r.length==1?"0"+r:""+r}function pe(r){return r<=1&&(r=r*100+"%"),r}function wt(r){return Math.round(parseFloat(r)*255).toString(16)}function ct(r){return F(r)/255}var P=function(){var r="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+r+")",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",a="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function H(r){return!!P.CSS_UNIT.exec(r)}function ln(r){r=r.replace(Dr,"").replace(jr,"").toLowerCase();var e=!1;if(Re[r])r=Re[r],e=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=P.rgb.exec(r))?{r:t[1],g:t[2],b:t[3]}:(t=P.rgba.exec(r))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=P.hsl.exec(r))?{h:t[1],s:t[2],l:t[3]}:(t=P.hsla.exec(r))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=P.hsv.exec(r))?{h:t[1],s:t[2],v:t[3]}:(t=P.hsva.exec(r))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=P.hex8.exec(r))?{r:F(t[1]),g:F(t[2]),b:F(t[3]),a:ct(t[4]),format:e?"name":"hex8"}:(t=P.hex6.exec(r))?{r:F(t[1]),g:F(t[2]),b:F(t[3]),format:e?"name":"hex"}:(t=P.hex4.exec(r))?{r:F(t[1]+""+t[1]),g:F(t[2]+""+t[2]),b:F(t[3]+""+t[3]),a:ct(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=P.hex3.exec(r))?{r:F(t[1]+""+t[1]),g:F(t[2]+""+t[2]),b:F(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function sn(r){var e,t;return r=r||{level:"AA",size:"small"},e=(r.level||"AA").toUpperCase(),t=(r.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}var pt=function(e){var t=["r","g","b","a","h","s","l","v"],n=0,a=0;return qt(t,function(i){if(e[i]&&(n+=1,isNaN(e[i])||(a+=1),i==="s"||i==="l")){var o=/^\d+%$/;o.test(e[i])&&(a+=1)}}),n===a?e:!1},ue=function(e,t){var n=e.hex?x(e.hex):x(e),a=n.toHsl(),i=n.toHsv(),o=n.toRgb(),l=n.toHex();a.s===0&&(a.h=t||0,i.h=t||0);var h=l==="000000"&&o.a===0;return{hsl:a,hex:h?"transparent":"#"+l,rgb:o,hsv:i,oldHue:e.h||t||a.h,source:e.source}},N=function(e){if(e==="transparent")return!0;var t=String(e).charAt(0)==="#"?1:0;return e.length!==4+t&&e.length<7+t&&x(e).isValid()},Be=function(e){if(!e)return"#fff";var t=ue(e);if(t.hex==="transparent")return"rgba(0,0,0,0.4)";var n=(t.rgb.r*299+t.rgb.g*587+t.rgb.b*114)/1e3;return n>=128?"#000":"#fff"},ke=function(e,t){var n=e.replace("°","");return x(t+" ("+n+")")._ok},he=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},hn=function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function cn(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function pn(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function un(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var O=function(e){var t=function(n){un(a,n);function a(i){cn(this,a);var o=pn(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return o.handleChange=function(l,h){var c=pt(l);if(c){var p=ue(l,l.h||o.state.oldHue);o.setState(p),o.props.onChangeComplete&&o.debounce(o.props.onChangeComplete,p,h),o.props.onChange&&o.props.onChange(p,h)}},o.handleSwatchHover=function(l,h){var c=pt(l);if(c){var p=ue(l,l.h||o.state.oldHue);o.props.onSwatchHover&&o.props.onSwatchHover(p,h)}},o.state=he({},ue(i.color,0)),o.debounce=Vt(function(l,h,c){l(h,c)},100),o}return hn(a,[{key:"render",value:function(){var o={};return this.props.onSwatchHover&&(o.onSwatchHover=this.handleSwatchHover),s.createElement(e,he({},this.props,this.state,{onChange:this.handleChange},o))}}],[{key:"getDerivedStateFromProps",value:function(o,l){return he({},ue(o.color,l.oldHue))}}]),a}(C.PureComponent||C.Component);return t.propTypes=he({},e.propTypes),t.defaultProps=he({},e.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),t},dn=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},fn=function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function gn(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function ut(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function bn(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var vn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(n){bn(a,n);function a(){var i,o,l,h;gn(this,a);for(var c=arguments.length,p=Array(c),u=0;u<c;u++)p[u]=arguments[u];return h=(o=(l=ut(this,(i=a.__proto__||Object.getPrototypeOf(a)).call.apply(i,[this].concat(p))),l),l.state={focus:!1},l.handleFocus=function(){return l.setState({focus:!0})},l.handleBlur=function(){return l.setState({focus:!1})},o),ut(l,h)}return fn(a,[{key:"render",value:function(){return s.createElement(t,{onFocus:this.handleFocus,onBlur:this.handleBlur},s.createElement(e,dn({},this.props,this.state)))}}]),a}(s.Component)},dt=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},xn=13,mn=function(e){var t=e.color,n=e.style,a=e.onClick,i=a===void 0?function(){}:a,o=e.onHover,l=e.title,h=l===void 0?t:l,c=e.children,p=e.focus,u=e.focusStyle,d=u===void 0?{}:u,f=t==="transparent",v=y({default:{swatch:dt({background:t,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},n,p?d:{})}}),b=function(T){return i(t,T)},m=function(T){return T.keyCode===xn&&i(t,T)},E=function(T){return o(t,T)},M={};return o&&(M.onMouseOver=E),s.createElement("div",dt({style:v.swatch,onClick:b,title:h,tabIndex:0,onKeyDown:m},M),c,f&&s.createElement(le,{borderRadius:v.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))};const D=vn(mn);var yn=function(e){var t=e.direction,n=y({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:t==="vertical"});return s.createElement("div",{style:n.picker})},wn=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Et=function(e){var t=e.rgb,n=e.hsl,a=e.width,i=e.height,o=e.onChange,l=e.direction,h=e.style,c=e.renderers,p=e.pointer,u=e.className,d=u===void 0?"":u,f=y({default:{picker:{position:"relative",width:a,height:i},alpha:{radius:"2px",style:h}}});return s.createElement("div",{style:f.picker,className:"alpha-picker "+d},s.createElement(Pe,wn({},f.alpha,{rgb:t,hsl:n,pointer:p,renderers:c,onChange:o,direction:l})))};Et.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:yn};O(Et);var En=function(e){var t=e.colors,n=e.onClick,a=e.onSwatchHover,i=y({default:{swatches:{marginRight:"-10px"},swatch:{width:"22px",height:"22px",float:"left",marginRight:"10px",marginBottom:"10px",borderRadius:"4px"},clear:{clear:"both"}}});return s.createElement("div",{style:i.swatches},$(t,function(o){return s.createElement(D,{key:o,color:o,style:i.swatch,onClick:n,onHover:a,focusStyle:{boxShadow:"0 0 4px "+o}})}),s.createElement("div",{style:i.clear}))},He=function(e){var t=e.onChange,n=e.onSwatchHover,a=e.hex,i=e.colors,o=e.width,l=e.triangle,h=e.styles,c=h===void 0?{}:h,p=e.className,u=p===void 0?"":p,d=a==="transparent",f=function(m,E){N(m)&&t({hex:m,source:"hex"},E)},v=y(_({default:{card:{width:o,background:"#fff",boxShadow:"0 1px rgba(0,0,0,.1)",borderRadius:"6px",position:"relative"},head:{height:"110px",background:a,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},body:{padding:"10px"},label:{fontSize:"18px",color:Be(a),position:"relative"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 10px 10px 10px",borderColor:"transparent transparent "+a+" transparent",position:"absolute",top:"-10px",left:"50%",marginLeft:"-10px"},input:{width:"100%",fontSize:"12px",color:"#666",border:"0px",outline:"none",height:"22px",boxShadow:"inset 0 0 0 1px #ddd",borderRadius:"4px",padding:"0 7px",boxSizing:"border-box"}},"hide-triangle":{triangle:{display:"none"}}},c),{"hide-triangle":l==="hide"});return s.createElement("div",{style:v.card,className:"block-picker "+u},s.createElement("div",{style:v.triangle}),s.createElement("div",{style:v.head},d&&s.createElement(le,{borderRadius:"6px 6px 0 0"}),s.createElement("div",{style:v.label},a)),s.createElement("div",{style:v.body},s.createElement(En,{colors:i,onClick:f,onSwatchHover:n}),s.createElement(w,{style:{input:v.input},value:a,onChange:f})))};He.propTypes={width:g.oneOfType([g.string,g.number]),colors:g.arrayOf(g.string),triangle:g.oneOf(["top","hide"]),styles:g.object};He.defaultProps={width:170,colors:["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],triangle:"top",styles:{}};O(He);var U={100:"#ffcdd2",300:"#e57373",500:"#f44336",700:"#d32f2f",900:"#b71c1c"},I={100:"#f8bbd0",300:"#f06292",500:"#e91e63",700:"#c2185b",900:"#880e4f"},V={100:"#e1bee7",300:"#ba68c8",500:"#9c27b0",700:"#7b1fa2",900:"#4a148c"},q={100:"#d1c4e9",300:"#9575cd",500:"#673ab7",700:"#512da8",900:"#311b92"},X={100:"#c5cae9",300:"#7986cb",500:"#3f51b5",700:"#303f9f",900:"#1a237e"},Y={100:"#bbdefb",300:"#64b5f6",500:"#2196f3",700:"#1976d2",900:"#0d47a1"},K={100:"#b3e5fc",300:"#4fc3f7",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Z={100:"#b2ebf2",300:"#4dd0e1",500:"#00bcd4",700:"#0097a7",900:"#006064"},J={100:"#b2dfdb",300:"#4db6ac",500:"#009688",700:"#00796b",900:"#004d40"},de={100:"#c8e6c9",300:"#81c784",500:"#4caf50",700:"#388e3c"},Q={100:"#dcedc8",300:"#aed581",500:"#8bc34a",700:"#689f38",900:"#33691e"},ee={100:"#f0f4c3",300:"#dce775",500:"#cddc39",700:"#afb42b",900:"#827717"},te={100:"#fff9c4",300:"#fff176",500:"#ffeb3b",700:"#fbc02d",900:"#f57f17"},re={100:"#ffecb3",300:"#ffd54f",500:"#ffc107",700:"#ffa000",900:"#ff6f00"},ne={100:"#ffe0b2",300:"#ffb74d",500:"#ff9800",700:"#f57c00",900:"#e65100"},ae={100:"#ffccbc",300:"#ff8a65",500:"#ff5722",700:"#e64a19",900:"#bf360c"},ie={100:"#d7ccc8",300:"#a1887f",500:"#795548",700:"#5d4037",900:"#3e2723"},oe={100:"#cfd8dc",300:"#90a4ae",500:"#607d8b",700:"#455a64",900:"#263238"},St=function(e){var t=e.color,n=e.onClick,a=e.onSwatchHover,i=e.hover,o=e.active,l=e.circleSize,h=e.circleSpacing,c=y({default:{swatch:{width:l,height:l,marginRight:h,marginBottom:h,transform:"scale(1)",transition:"100ms transform ease"},Swatch:{borderRadius:"50%",background:"transparent",boxShadow:"inset 0 0 0 "+(l/2+1)+"px "+t,transition:"100ms box-shadow ease"}},hover:{swatch:{transform:"scale(1.2)"}},active:{Swatch:{boxShadow:"inset 0 0 0 3px "+t}}},{hover:i,active:o});return s.createElement("div",{style:c.swatch},s.createElement(D,{style:c.Swatch,color:t,onClick:n,onHover:a,focusStyle:{boxShadow:c.Swatch.boxShadow+", 0 0 5px "+t}}))};St.defaultProps={circleSize:28,circleSpacing:14};const Sn=Fe.handleHover(St);var Ae=function(e){var t=e.width,n=e.onChange,a=e.onSwatchHover,i=e.colors,o=e.hex,l=e.circleSize,h=e.styles,c=h===void 0?{}:h,p=e.circleSpacing,u=e.className,d=u===void 0?"":u,f=y(_({default:{card:{width:t,display:"flex",flexWrap:"wrap",marginRight:-p,marginBottom:-p}}},c)),v=function(m,E){return n({hex:m,source:"hex"},E)};return s.createElement("div",{style:f.card,className:"circle-picker "+d},$(i,function(b){return s.createElement(Sn,{key:b,color:b,onClick:v,onSwatchHover:a,active:o===b.toLowerCase(),circleSize:l,circleSpacing:p})}))};Ae.propTypes={width:g.oneOfType([g.string,g.number]),circleSize:g.number,circleSpacing:g.number,styles:g.object};Ae.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[U[500],I[500],V[500],q[500],X[500],Y[500],K[500],Z[500],J[500],de[500],Q[500],ee[500],te[500],re[500],ne[500],ae[500],ie[500],oe[500]],styles:{}};O(Ae);var me={},ft;function Cn(){if(ft)return me;ft=1,Object.defineProperty(me,"__esModule",{value:!0});var r=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var c in h)Object.prototype.hasOwnProperty.call(h,c)&&(o[c]=h[c])}return o},e=Ee(),t=n(e);function n(o){return o&&o.__esModule?o:{default:o}}function a(o,l){var h={};for(var c in o)l.indexOf(c)>=0||Object.prototype.hasOwnProperty.call(o,c)&&(h[c]=o[c]);return h}var i=24;return me.default=function(o){var l=o.fill,h=l===void 0?"currentColor":l,c=o.width,p=c===void 0?i:c,u=o.height,d=u===void 0?i:u,f=o.style,v=f===void 0?{}:f,b=a(o,["fill","width","height","style"]);return t.default.createElement("svg",r({viewBox:"0 0 "+i+" "+i,style:r({fill:h,width:p,height:d},v)},b),t.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},me}var kn=Cn();const Rn=Oe(kn);var _n=function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function On(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Mn(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Fn(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Ct=function(r){Fn(e,r);function e(t){On(this,e);var n=Mn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.toggleViews=function(){n.state.view==="hex"?n.setState({view:"rgb"}):n.state.view==="rgb"?n.setState({view:"hsl"}):n.state.view==="hsl"&&(n.props.hsl.a===1?n.setState({view:"hex"}):n.setState({view:"rgb"}))},n.handleChange=function(a,i){a.hex?N(a.hex)&&n.props.onChange({hex:a.hex,source:"hex"},i):a.r||a.g||a.b?n.props.onChange({r:a.r||n.props.rgb.r,g:a.g||n.props.rgb.g,b:a.b||n.props.rgb.b,source:"rgb"},i):a.a?(a.a<0?a.a=0:a.a>1&&(a.a=1),n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:Math.round(a.a*100)/100,source:"rgb"},i)):(a.h||a.s||a.l)&&(typeof a.s=="string"&&a.s.includes("%")&&(a.s=a.s.replace("%","")),typeof a.l=="string"&&a.l.includes("%")&&(a.l=a.l.replace("%","")),a.s==1?a.s=.01:a.l==1&&(a.l=.01),n.props.onChange({h:a.h||n.props.hsl.h,s:Number(Xe(a.s)?n.props.hsl.s:a.s),l:Number(Xe(a.l)?n.props.hsl.l:a.l),source:"hsl"},i))},n.showHighlight=function(a){a.currentTarget.style.background="#eee"},n.hideHighlight=function(a){a.currentTarget.style.background="transparent"},t.hsl.a!==1&&t.view==="hex"?n.state={view:"rgb"}:n.state={view:t.view},n}return _n(e,[{key:"render",value:function(){var n=this,a=y({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),i=void 0;return this.state.view==="hex"?i=s.createElement("div",{style:a.fields,className:"flexbox-fix"},s.createElement("div",{style:a.field},s.createElement(w,{style:{input:a.input,label:a.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=s.createElement("div",{style:a.fields,className:"flexbox-fix"},s.createElement("div",{style:a.field},s.createElement(w,{style:{input:a.input,label:a.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),s.createElement("div",{style:a.field},s.createElement(w,{style:{input:a.input,label:a.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),s.createElement("div",{style:a.field},s.createElement(w,{style:{input:a.input,label:a.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),s.createElement("div",{style:a.alpha},s.createElement(w,{style:{input:a.input,label:a.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(i=s.createElement("div",{style:a.fields,className:"flexbox-fix"},s.createElement("div",{style:a.field},s.createElement(w,{style:{input:a.input,label:a.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),s.createElement("div",{style:a.field},s.createElement(w,{style:{input:a.input,label:a.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),s.createElement("div",{style:a.field},s.createElement(w,{style:{input:a.input,label:a.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),s.createElement("div",{style:a.alpha},s.createElement(w,{style:{input:a.input,label:a.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),s.createElement("div",{style:a.wrap,className:"flexbox-fix"},i,s.createElement("div",{style:a.toggle},s.createElement("div",{style:a.icon,onClick:this.toggleViews,ref:function(l){return n.icon=l}},s.createElement(Rn,{style:a.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.hsl.a!==1&&a.view==="hex"?{view:"rgb"}:null}}]),e}(s.Component);Ct.defaultProps={view:"hex"};var gt=function(){var e=y({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return s.createElement("div",{style:e.picker})},Pn=function(){var e=y({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return s.createElement("div",{style:e.picker})},Te=function(e){var t=e.width,n=e.onChange,a=e.disableAlpha,i=e.rgb,o=e.hsl,l=e.hsv,h=e.hex,c=e.renderers,p=e.styles,u=p===void 0?{}:p,d=e.className,f=d===void 0?"":d,v=e.defaultView,b=y(_({default:{picker:{width:t,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},u),{disableAlpha:a});return s.createElement("div",{style:b.picker,className:"chrome-picker "+f},s.createElement("div",{style:b.saturation},s.createElement(ve,{style:b.Saturation,hsl:o,hsv:l,pointer:Pn,onChange:n})),s.createElement("div",{style:b.body},s.createElement("div",{style:b.controls,className:"flexbox-fix"},s.createElement("div",{style:b.color},s.createElement("div",{style:b.swatch},s.createElement("div",{style:b.active}),s.createElement(le,{renderers:c}))),s.createElement("div",{style:b.toggles},s.createElement("div",{style:b.hue},s.createElement(se,{style:b.Hue,hsl:o,pointer:gt,onChange:n})),s.createElement("div",{style:b.alpha},s.createElement(Pe,{style:b.Alpha,rgb:i,hsl:o,pointer:gt,renderers:c,onChange:n})))),s.createElement(Ct,{rgb:i,hsl:o,hex:h,view:v,onChange:n,disableAlpha:a})))};Te.propTypes={width:g.oneOfType([g.string,g.number]),disableAlpha:g.bool,styles:g.object,defaultView:g.oneOf(["hex","rgb","hsl"])};Te.defaultProps={width:225,disableAlpha:!1,styles:{}};const Bn=O(Te);var Hn=function(e){var t=e.color,n=e.onClick,a=n===void 0?function(){}:n,i=e.onSwatchHover,o=e.active,l=y({default:{color:{background:t,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:Be(t),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:o,"color-#FFFFFF":t==="#FFFFFF",transparent:t==="transparent"});return s.createElement(D,{style:l.color,color:t,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+t}},s.createElement("div",{style:l.dot}))},An=function(e){var t=e.hex,n=e.rgb,a=e.onChange,i=y({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:t},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),o=function(h,c){h.r||h.g||h.b?a({r:h.r||n.r,g:h.g||n.g,b:h.b||n.b,source:"rgb"},c):a({hex:h.hex,source:"hex"},c)};return s.createElement("div",{style:i.fields,className:"flexbox-fix"},s.createElement("div",{style:i.active}),s.createElement(w,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:t,onChange:o}),s.createElement(w,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:n.r,onChange:o}),s.createElement(w,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:n.g,onChange:o}),s.createElement(w,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:n.b,onChange:o}))},$e=function(e){var t=e.onChange,n=e.onSwatchHover,a=e.colors,i=e.hex,o=e.rgb,l=e.styles,h=l===void 0?{}:l,c=e.className,p=c===void 0?"":c,u=y(_({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},h)),d=function(v,b){v.hex?N(v.hex)&&t({hex:v.hex,source:"hex"},b):t(v,b)};return s.createElement(be,{style:u.Compact,styles:h},s.createElement("div",{style:u.compact,className:"compact-picker "+p},s.createElement("div",null,$(a,function(f){return s.createElement(Hn,{key:f,color:f,active:f.toLowerCase()===i,onClick:d,onSwatchHover:n})}),s.createElement("div",{style:u.clear})),s.createElement(An,{hex:i,rgb:o,onChange:d})))};$e.propTypes={colors:g.arrayOf(g.string),styles:g.object};$e.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};O($e);var Tn=function(e){var t=e.hover,n=e.color,a=e.onClick,i=e.onSwatchHover,o={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},l=y({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:o}},{hover:t});return s.createElement("div",{style:l.swatch},s.createElement(D,{color:n,onClick:a,onHover:i,focusStyle:o}))};const $n=Fe.handleHover(Tn);var Ne=function(e){var t=e.width,n=e.colors,a=e.onChange,i=e.onSwatchHover,o=e.triangle,l=e.styles,h=l===void 0?{}:l,c=e.className,p=c===void 0?"":c,u=y(_({default:{card:{width:t,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},h),{"hide-triangle":o==="hide","top-left-triangle":o==="top-left","top-right-triangle":o==="top-right","bottom-left-triangle":o==="bottom-left","bottom-right-triangle":o==="bottom-right"}),d=function(v,b){return a({hex:v,source:"hex"},b)};return s.createElement("div",{style:u.card,className:"github-picker "+p},s.createElement("div",{style:u.triangleShadow}),s.createElement("div",{style:u.triangle}),$(n,function(f){return s.createElement($n,{color:f,key:f,onClick:d,onSwatchHover:i})}))};Ne.propTypes={width:g.oneOfType([g.string,g.number]),colors:g.arrayOf(g.string),triangle:g.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:g.object};Ne.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};O(Ne);var Nn=function(e){var t=e.direction,n=y({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:t==="vertical"});return s.createElement("div",{style:n.picker})},Dn=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},De=function(e){var t=e.width,n=e.height,a=e.onChange,i=e.hsl,o=e.direction,l=e.pointer,h=e.styles,c=h===void 0?{}:h,p=e.className,u=p===void 0?"":p,d=y(_({default:{picker:{position:"relative",width:t,height:n},hue:{radius:"2px"}}},c)),f=function(b){return a({a:1,h:b.h,l:.5,s:1})};return s.createElement("div",{style:d.picker,className:"hue-picker "+u},s.createElement(se,Dn({},d.hue,{hsl:i,pointer:l,onChange:f,direction:o})))};De.propTypes={styles:g.object};De.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:Nn,styles:{}};O(De);var jn=function(e){var t=e.onChange,n=e.hex,a=e.rgb,i=e.styles,o=i===void 0?{}:i,l=e.className,h=l===void 0?"":l,c=y(_({default:{material:{width:"98px",height:"98px",padding:"16px",fontFamily:"Roboto"},HEXwrap:{position:"relative"},HEXinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"2px solid "+n,outline:"none",height:"30px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},Hex:{style:{}},RGBwrap:{position:"relative"},RGBinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"1px solid #eee",outline:"none",height:"30px"},RGBlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},split:{display:"flex",marginRight:"-10px",paddingTop:"11px"},third:{flex:"1",paddingRight:"10px"}}},o)),p=function(d,f){d.hex?N(d.hex)&&t({hex:d.hex,source:"hex"},f):(d.r||d.g||d.b)&&t({r:d.r||a.r,g:d.g||a.g,b:d.b||a.b,source:"rgb"},f)};return s.createElement(be,{styles:o},s.createElement("div",{style:c.material,className:"material-picker "+h},s.createElement(w,{style:{wrap:c.HEXwrap,input:c.HEXinput,label:c.HEXlabel},label:"hex",value:n,onChange:p}),s.createElement("div",{style:c.split,className:"flexbox-fix"},s.createElement("div",{style:c.third},s.createElement(w,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:"r",value:a.r,onChange:p})),s.createElement("div",{style:c.third},s.createElement(w,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:"g",value:a.g,onChange:p})),s.createElement("div",{style:c.third},s.createElement(w,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:"b",value:a.b,onChange:p})))))};O(jn);var Ln=function(e){var t=e.onChange,n=e.rgb,a=e.hsv,i=e.hex,o=y({default:{fields:{paddingTop:"5px",paddingBottom:"9px",width:"80px",position:"relative"},divider:{height:"5px"},RGBwrap:{position:"relative"},RGBinput:{marginLeft:"40%",width:"40%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"5px",fontSize:"13px",paddingLeft:"3px",marginRight:"10px"},RGBlabel:{left:"0px",top:"0px",width:"34px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px",position:"absolute"},HEXwrap:{position:"relative"},HEXinput:{marginLeft:"20%",width:"80%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"6px",fontSize:"13px",paddingLeft:"3px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",width:"14px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px"},fieldSymbols:{position:"absolute",top:"5px",right:"-7px",fontSize:"13px"},symbol:{height:"20px",lineHeight:"22px",paddingBottom:"7px"}}}),l=function(c,p){c["#"]?N(c["#"])&&t({hex:c["#"],source:"hex"},p):c.r||c.g||c.b?t({r:c.r||n.r,g:c.g||n.g,b:c.b||n.b,source:"rgb"},p):(c.h||c.s||c.v)&&t({h:c.h||a.h,s:c.s||a.s,v:c.v||a.v,source:"hsv"},p)};return s.createElement("div",{style:o.fields},s.createElement(w,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"h",value:Math.round(a.h),onChange:l}),s.createElement(w,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"s",value:Math.round(a.s*100),onChange:l}),s.createElement(w,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"v",value:Math.round(a.v*100),onChange:l}),s.createElement("div",{style:o.divider}),s.createElement(w,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:n.r,onChange:l}),s.createElement(w,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:n.g,onChange:l}),s.createElement(w,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:n.b,onChange:l}),s.createElement("div",{style:o.divider}),s.createElement(w,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"#",value:i.replace("#",""),onChange:l}),s.createElement("div",{style:o.fieldSymbols},s.createElement("div",{style:o.symbol},"°"),s.createElement("div",{style:o.symbol},"%"),s.createElement("div",{style:o.symbol},"%")))},zn=function(e){var t=e.hsl,n=y({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}},"black-outline":{picker:{boxShadow:"inset 0 0 0 1px #000"}}},{"black-outline":t.l>.5});return s.createElement("div",{style:n.picker})},Gn=function(){var e=y({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return s.createElement("div",{style:e.pointer},s.createElement("div",{style:e.left},s.createElement("div",{style:e.leftInside})),s.createElement("div",{style:e.right},s.createElement("div",{style:e.rightInside})))},bt=function(e){var t=e.onClick,n=e.label,a=e.children,i=e.active,o=y({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return s.createElement("div",{style:o.button,onClick:t},n||a)},Wn=function(e){var t=e.rgb,n=e.currentColor,a=y({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+t.r+","+t.g+", "+t.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:n,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return s.createElement("div",null,s.createElement("div",{style:a.label},"new"),s.createElement("div",{style:a.swatches},s.createElement("div",{style:a.new}),s.createElement("div",{style:a.current})),s.createElement("div",{style:a.label},"current"))},Un=function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function In(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Vn(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function qn(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var je=function(r){qn(e,r);function e(t){In(this,e);var n=Vn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.state={currentColor:t.hex},n}return Un(e,[{key:"render",value:function(){var n=this.props,a=n.styles,i=a===void 0?{}:a,o=n.className,l=o===void 0?"":o,h=y(_({default:{picker:{background:"#DCDCDC",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)",boxSizing:"initial",width:"513px"},head:{backgroundImage:"linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)",borderBottom:"1px solid #B1B1B1",boxShadow:"inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)",height:"23px",lineHeight:"24px",borderRadius:"4px 4px 0 0",fontSize:"13px",color:"#4D4D4D",textAlign:"center"},body:{padding:"15px 15px 0",display:"flex"},saturation:{width:"256px",height:"256px",position:"relative",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0",overflow:"hidden"},hue:{position:"relative",height:"256px",width:"19px",marginLeft:"10px",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0"},controls:{width:"180px",marginLeft:"10px"},top:{display:"flex"},previews:{width:"60px"},actions:{flex:"1",marginLeft:"20px"}}},i));return s.createElement("div",{style:h.picker,className:"photoshop-picker "+l},s.createElement("div",{style:h.head},this.props.header),s.createElement("div",{style:h.body,className:"flexbox-fix"},s.createElement("div",{style:h.saturation},s.createElement(ve,{hsl:this.props.hsl,hsv:this.props.hsv,pointer:zn,onChange:this.props.onChange})),s.createElement("div",{style:h.hue},s.createElement(se,{direction:"vertical",hsl:this.props.hsl,pointer:Gn,onChange:this.props.onChange})),s.createElement("div",{style:h.controls},s.createElement("div",{style:h.top,className:"flexbox-fix"},s.createElement("div",{style:h.previews},s.createElement(Wn,{rgb:this.props.rgb,currentColor:this.state.currentColor})),s.createElement("div",{style:h.actions},s.createElement(bt,{label:"OK",onClick:this.props.onAccept,active:!0}),s.createElement(bt,{label:"Cancel",onClick:this.props.onCancel}),s.createElement(Ln,{onChange:this.props.onChange,rgb:this.props.rgb,hsv:this.props.hsv,hex:this.props.hex}))))))}}]),e}(s.Component);je.propTypes={header:g.string,styles:g.object};je.defaultProps={header:"Color Picker",styles:{}};O(je);var Xn=function(e){var t=e.onChange,n=e.rgb,a=e.hsl,i=e.hex,o=e.disableAlpha,l=y({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:o}),h=function(p,u){p.hex?N(p.hex)&&t({hex:p.hex,source:"hex"},u):p.r||p.g||p.b?t({r:p.r||n.r,g:p.g||n.g,b:p.b||n.b,a:n.a,source:"rgb"},u):p.a&&(p.a<0?p.a=0:p.a>100&&(p.a=100),p.a/=100,t({h:a.h,s:a.s,l:a.l,a:p.a,source:"rgb"},u))};return s.createElement("div",{style:l.fields,className:"flexbox-fix"},s.createElement("div",{style:l.double},s.createElement(w,{style:{input:l.input,label:l.label},label:"hex",value:i.replace("#",""),onChange:h})),s.createElement("div",{style:l.single},s.createElement(w,{style:{input:l.input,label:l.label},label:"r",value:n.r,onChange:h,dragLabel:"true",dragMax:"255"})),s.createElement("div",{style:l.single},s.createElement(w,{style:{input:l.input,label:l.label},label:"g",value:n.g,onChange:h,dragLabel:"true",dragMax:"255"})),s.createElement("div",{style:l.single},s.createElement(w,{style:{input:l.input,label:l.label},label:"b",value:n.b,onChange:h,dragLabel:"true",dragMax:"255"})),s.createElement("div",{style:l.alpha},s.createElement(w,{style:{input:l.input,label:l.label},label:"a",value:Math.round(n.a*100),onChange:h,dragLabel:"true",dragMax:"100"})))},Yn=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},kt=function(e){var t=e.colors,n=e.onClick,a=n===void 0?function(){}:n,i=e.onSwatchHover,o=y({default:{colors:{margin:"0 -10px",padding:"10px 0 0 10px",borderTop:"1px solid #eee",display:"flex",flexWrap:"wrap",position:"relative"},swatchWrap:{width:"16px",height:"16px",margin:"0 10px 10px 0"},swatch:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15)"}},"no-presets":{colors:{display:"none"}}},{"no-presets":!t||!t.length}),l=function(c,p){a({hex:c,source:"hex"},p)};return s.createElement("div",{style:o.colors,className:"flexbox-fix"},t.map(function(h){var c=typeof h=="string"?{color:h}:h,p=""+c.color+(c.title||"");return s.createElement("div",{key:p,style:o.swatchWrap},s.createElement(D,Yn({},c,{style:o.swatch,onClick:l,onHover:i,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+c.color}})))}))};kt.propTypes={colors:g.arrayOf(g.oneOfType([g.string,g.shape({color:g.string,title:g.string})])).isRequired};var Kn=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Le=function(e){var t=e.width,n=e.rgb,a=e.hex,i=e.hsv,o=e.hsl,l=e.onChange,h=e.onSwatchHover,c=e.disableAlpha,p=e.presetColors,u=e.renderers,d=e.styles,f=d===void 0?{}:d,v=e.className,b=v===void 0?"":v,m=y(_({default:Kn({picker:{width:t,padding:"10px 10px 0",boxSizing:"initial",background:"#fff",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"},saturation:{width:"100%",paddingBottom:"75%",position:"relative",overflow:"hidden"},Saturation:{radius:"3px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},controls:{display:"flex"},sliders:{padding:"4px 0",flex:"1"},color:{width:"24px",height:"24px",position:"relative",marginTop:"4px",marginLeft:"4px",borderRadius:"3px"},activeColor:{absolute:"0px 0px 0px 0px",borderRadius:"2px",background:"rgba("+n.r+","+n.g+","+n.b+","+n.a+")",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hue:{position:"relative",height:"10px",overflow:"hidden"},Hue:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},alpha:{position:"relative",height:"10px",marginTop:"4px",overflow:"hidden"},Alpha:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"}},f),disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},f),{disableAlpha:c});return s.createElement("div",{style:m.picker,className:"sketch-picker "+b},s.createElement("div",{style:m.saturation},s.createElement(ve,{style:m.Saturation,hsl:o,hsv:i,onChange:l})),s.createElement("div",{style:m.controls,className:"flexbox-fix"},s.createElement("div",{style:m.sliders},s.createElement("div",{style:m.hue},s.createElement(se,{style:m.Hue,hsl:o,onChange:l})),s.createElement("div",{style:m.alpha},s.createElement(Pe,{style:m.Alpha,rgb:n,hsl:o,renderers:u,onChange:l}))),s.createElement("div",{style:m.color},s.createElement(le,null),s.createElement("div",{style:m.activeColor}))),s.createElement(Xn,{rgb:n,hsl:o,hex:a,onChange:l,disableAlpha:c}),s.createElement(kt,{colors:p,onClick:l,onSwatchHover:h}))};Le.propTypes={disableAlpha:g.bool,width:g.oneOfType([g.string,g.number]),styles:g.object};Le.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]};O(Le);var ce=function(e){var t=e.hsl,n=e.offset,a=e.onClick,i=a===void 0?function(){}:a,o=e.active,l=e.first,h=e.last,c=y({default:{swatch:{height:"12px",background:"hsl("+t.h+", 50%, "+n*100+"%)",cursor:"pointer"}},first:{swatch:{borderRadius:"2px 0 0 2px"}},last:{swatch:{borderRadius:"0 2px 2px 0"}},active:{swatch:{transform:"scaleY(1.8)",borderRadius:"3.6px/2px"}}},{active:o,first:l,last:h}),p=function(d){return i({h:t.h,s:.5,l:n,source:"hsl"},d)};return s.createElement("div",{style:c.swatch,onClick:p})},Zn=function(e){var t=e.onClick,n=e.hsl,a=y({default:{swatches:{marginTop:"20px"},swatch:{boxSizing:"border-box",width:"20%",paddingRight:"1px",float:"left"},clear:{clear:"both"}}}),i=.1;return s.createElement("div",{style:a.swatches},s.createElement("div",{style:a.swatch},s.createElement(ce,{hsl:n,offset:".80",active:Math.abs(n.l-.8)<i&&Math.abs(n.s-.5)<i,onClick:t,first:!0})),s.createElement("div",{style:a.swatch},s.createElement(ce,{hsl:n,offset:".65",active:Math.abs(n.l-.65)<i&&Math.abs(n.s-.5)<i,onClick:t})),s.createElement("div",{style:a.swatch},s.createElement(ce,{hsl:n,offset:".50",active:Math.abs(n.l-.5)<i&&Math.abs(n.s-.5)<i,onClick:t})),s.createElement("div",{style:a.swatch},s.createElement(ce,{hsl:n,offset:".35",active:Math.abs(n.l-.35)<i&&Math.abs(n.s-.5)<i,onClick:t})),s.createElement("div",{style:a.swatch},s.createElement(ce,{hsl:n,offset:".20",active:Math.abs(n.l-.2)<i&&Math.abs(n.s-.5)<i,onClick:t,last:!0})),s.createElement("div",{style:a.clear}))},Jn=function(){var e=y({default:{picker:{width:"14px",height:"14px",borderRadius:"6px",transform:"translate(-7px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return s.createElement("div",{style:e.picker})},ze=function(e){var t=e.hsl,n=e.onChange,a=e.pointer,i=e.styles,o=i===void 0?{}:i,l=e.className,h=l===void 0?"":l,c=y(_({default:{hue:{height:"12px",position:"relative"},Hue:{radius:"2px"}}},o));return s.createElement("div",{style:c.wrap||{},className:"slider-picker "+h},s.createElement("div",{style:c.hue},s.createElement(se,{style:c.Hue,hsl:t,pointer:a,onChange:n})),s.createElement("div",{style:c.swatches},s.createElement(Zn,{hsl:t,onClick:n})))};ze.propTypes={styles:g.object};ze.defaultProps={pointer:Jn,styles:{}};O(ze);var ye={},vt;function Qn(){if(vt)return ye;vt=1,Object.defineProperty(ye,"__esModule",{value:!0});var r=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var c in h)Object.prototype.hasOwnProperty.call(h,c)&&(o[c]=h[c])}return o},e=Ee(),t=n(e);function n(o){return o&&o.__esModule?o:{default:o}}function a(o,l){var h={};for(var c in o)l.indexOf(c)>=0||Object.prototype.hasOwnProperty.call(o,c)&&(h[c]=o[c]);return h}var i=24;return ye.default=function(o){var l=o.fill,h=l===void 0?"currentColor":l,c=o.width,p=c===void 0?i:c,u=o.height,d=u===void 0?i:u,f=o.style,v=f===void 0?{}:f,b=a(o,["fill","width","height","style"]);return t.default.createElement("svg",r({viewBox:"0 0 "+i+" "+i,style:r({fill:h,width:p,height:d},v)},b),t.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},ye}var ea=Qn();const ta=Oe(ea);var ra=function(e){var t=e.color,n=e.onClick,a=n===void 0?function(){}:n,i=e.onSwatchHover,o=e.first,l=e.last,h=e.active,c=y({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:t,marginBottom:"1px"},check:{color:Be(t),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:o,last:l,active:h,"color-#FFFFFF":t==="#FFFFFF",transparent:t==="transparent"});return s.createElement(D,{color:t,style:c.color,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+t}},s.createElement("div",{style:c.check},s.createElement(ta,null)))},na=function(e){var t=e.onClick,n=e.onSwatchHover,a=e.group,i=e.active,o=y({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return s.createElement("div",{style:o.group},$(a,function(l,h){return s.createElement(ra,{key:l,color:l,active:l.toLowerCase()===i,first:h===0,last:h===a.length-1,onClick:t,onSwatchHover:n})}))},Ge=function(e){var t=e.width,n=e.height,a=e.onChange,i=e.onSwatchHover,o=e.colors,l=e.hex,h=e.styles,c=h===void 0?{}:h,p=e.className,u=p===void 0?"":p,d=y(_({default:{picker:{width:t,height:n},overflow:{height:n,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},c)),f=function(b,m){return a({hex:b,source:"hex"},m)};return s.createElement("div",{style:d.picker,className:"swatches-picker "+u},s.createElement(be,null,s.createElement("div",{style:d.overflow},s.createElement("div",{style:d.body},$(o,function(v){return s.createElement(na,{key:v.toString(),group:v,active:l,onClick:f,onSwatchHover:i})}),s.createElement("div",{style:d.clear})))))};Ge.propTypes={width:g.oneOfType([g.string,g.number]),height:g.oneOfType([g.string,g.number]),colors:g.arrayOf(g.arrayOf(g.string)),styles:g.object};Ge.defaultProps={width:320,height:240,colors:[[U[900],U[700],U[500],U[300],U[100]],[I[900],I[700],I[500],I[300],I[100]],[V[900],V[700],V[500],V[300],V[100]],[q[900],q[700],q[500],q[300],q[100]],[X[900],X[700],X[500],X[300],X[100]],[Y[900],Y[700],Y[500],Y[300],Y[100]],[K[900],K[700],K[500],K[300],K[100]],[Z[900],Z[700],Z[500],Z[300],Z[100]],[J[900],J[700],J[500],J[300],J[100]],["#194D33",de[700],de[500],de[300],de[100]],[Q[900],Q[700],Q[500],Q[300],Q[100]],[ee[900],ee[700],ee[500],ee[300],ee[100]],[te[900],te[700],te[500],te[300],te[100]],[re[900],re[700],re[500],re[300],re[100]],[ne[900],ne[700],ne[500],ne[300],ne[100]],[ae[900],ae[700],ae[500],ae[300],ae[100]],[ie[900],ie[700],ie[500],ie[300],ie[100]],[oe[900],oe[700],oe[500],oe[300],oe[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};O(Ge);var We=function(e){var t=e.onChange,n=e.onSwatchHover,a=e.hex,i=e.colors,o=e.width,l=e.triangle,h=e.styles,c=h===void 0?{}:h,p=e.className,u=p===void 0?"":p,d=y(_({default:{card:{width:o,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},c),{"hide-triangle":l==="hide","top-left-triangle":l==="top-left","top-right-triangle":l==="top-right"}),f=function(b,m){N(b)&&t({hex:b,source:"hex"},m)};return s.createElement("div",{style:d.card,className:"twitter-picker "+u},s.createElement("div",{style:d.triangleShadow}),s.createElement("div",{style:d.triangle}),s.createElement("div",{style:d.body},$(i,function(v,b){return s.createElement(D,{key:b,color:v,hex:v,style:d.swatch,onClick:f,onHover:n,focusStyle:{boxShadow:"0 0 4px "+v}})}),s.createElement("div",{style:d.hash},"#"),s.createElement(w,{label:null,style:{input:d.input},value:a.replace("#",""),onChange:f}),s.createElement("div",{style:d.clear})))};We.propTypes={width:g.oneOfType([g.string,g.number]),triangle:g.oneOf(["hide","top-left","top-right"]),colors:g.arrayOf(g.string),styles:g.object};We.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};O(We);var Ue=function(e){var t=y({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(e.hsl.s*100)+"%, "+Math.round(e.hsl.l*100)+"%)"}}});return s.createElement("div",{style:t.picker})};Ue.propTypes={hsl:g.shape({h:g.number,s:g.number,l:g.number,a:g.number})};Ue.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var Ie=function(e){var t=y({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return s.createElement("div",{style:t.picker})};Ie.propTypes={hsl:g.shape({h:g.number,s:g.number,l:g.number,a:g.number})};Ie.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var aa=function(e){var t=e.onChange,n=e.rgb,a=e.hsl,i=e.hex,o=e.hsv,l=function(f,v){if(f.hex)N(f.hex)&&t({hex:f.hex,source:"hex"},v);else if(f.rgb){var b=f.rgb.split(",");ke(f.rgb,"rgb")&&t({r:b[0],g:b[1],b:b[2],a:1,source:"rgb"},v)}else if(f.hsv){var m=f.hsv.split(",");ke(f.hsv,"hsv")&&(m[2]=m[2].replace("%",""),m[1]=m[1].replace("%",""),m[0]=m[0].replace("°",""),m[1]==1?m[1]=.01:m[2]==1&&(m[2]=.01),t({h:Number(m[0]),s:Number(m[1]),v:Number(m[2]),source:"hsv"},v))}else if(f.hsl){var E=f.hsl.split(",");ke(f.hsl,"hsl")&&(E[2]=E[2].replace("%",""),E[1]=E[1].replace("%",""),E[0]=E[0].replace("°",""),u[1]==1?u[1]=.01:u[2]==1&&(u[2]=.01),t({h:Number(E[0]),s:Number(E[1]),v:Number(E[2]),source:"hsl"},v))}},h=y({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),c=n.r+", "+n.g+", "+n.b,p=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.l*100)+"%",u=Math.round(o.h)+"°, "+Math.round(o.s*100)+"%, "+Math.round(o.v*100)+"%";return s.createElement("div",{style:h.wrap,className:"flexbox-fix"},s.createElement("div",{style:h.fields},s.createElement("div",{style:h.double},s.createElement(w,{style:{input:h.input,label:h.label},label:"hex",value:i,onChange:l})),s.createElement("div",{style:h.column},s.createElement("div",{style:h.single},s.createElement(w,{style:{input:h.input2,label:h.label2},label:"rgb",value:c,onChange:l})),s.createElement("div",{style:h.single},s.createElement(w,{style:{input:h.input2,label:h.label2},label:"hsv",value:u,onChange:l})),s.createElement("div",{style:h.single},s.createElement(w,{style:{input:h.input2,label:h.label2},label:"hsl",value:p,onChange:l})))))},Ve=function(e){var t=e.width,n=e.onChange,a=e.rgb,i=e.hsl,o=e.hsv,l=e.hex,h=e.header,c=e.styles,p=c===void 0?{}:c,u=e.className,d=u===void 0?"":u,f=y(_({default:{picker:{width:t,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+a.r+", "+a.g+", "+a.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},p));return s.createElement("div",{style:f.picker,className:"google-picker "+d},s.createElement("div",{style:f.head},h),s.createElement("div",{style:f.swatch}),s.createElement("div",{style:f.saturation},s.createElement(ve,{hsl:i,hsv:o,pointer:Ue,onChange:n})),s.createElement("div",{style:f.body},s.createElement("div",{style:f.controls,className:"flexbox-fix"},s.createElement("div",{style:f.hue},s.createElement(se,{style:f.Hue,hsl:i,radius:"4px",pointer:Ie,onChange:n}))),s.createElement(aa,{rgb:a,hsl:i,hex:l,hsv:o,onChange:n})))};Ve.propTypes={width:g.oneOfType([g.string,g.number]),styles:g.object,header:g.string};Ve.defaultProps={width:652,styles:{},header:"Color picker"};O(Ve);const ia=ge("div",{target:"eyjgl9x0"})(({disabled:r,theme:e})=>({fontFamily:e.genericFonts.bodyFont,display:"flex",flexDirection:"column",alignItems:"flex-start",cursor:r?"not-allowed":"default",minWidth:e.sizes.minElementHeight})),oa=ge("div",{target:"eyjgl9x1"})(({theme:r})=>({div:{fontFamily:`${r.genericFonts.bodyFont} !important`},label:{fontSize:`${r.fontSizes.sm} !important`,color:`${r.colors.bodyText} !important`},input:{fontSize:`${r.fontSizes.md} !important`,height:`${r.sizes.minElementHeight} !important`,backgroundColor:`${r.colors.secondaryBg} !important`,color:`${r.colors.bodyText} !important`,borderRadius:`${r.radii.default} !important`,boxShadow:"none !important","&:focus-visible":{outline:`${r.sizes.borderWidth} solid ${r.colors.primary} !important`}},svg:{fill:`${r.colors.bodyText} !important`}})),la=ge("div",{target:"eyjgl9x2"})(({disabled:r,theme:e})=>({height:e.sizes.minElementHeight,borderRadius:e.radii.default,borderColor:e.colors.borderColor,cursor:r?"not-allowed":"pointer",pointerEvents:r?"none":"auto",boxShadow:"none",lineHeight:e.lineHeights.base,gap:e.spacing.md,"&:focus":{outline:"none"},display:"flex"})),sa=ge("div",{target:"eyjgl9x3"})(({backgroundColor:r,disabled:e,theme:t})=>({width:t.sizes.minElementHeight,height:t.sizes.minElementHeight,borderRadius:t.radii.default,borderColor:t.colors.borderColor,borderWidth:t.sizes.borderWidth,opacity:e?"0.4":"",backgroundColor:r,borderStyle:"solid",cursor:"pointer",lineHeight:t.lineHeights.base,"&:focus":{outline:"none"}})),ha=ge("div",{target:"eyjgl9x4"})({display:"flex",alignItems:"center"});ve.prototype.getContainerRenderWindow=function(){const r=this.container;let e=window,t=window;try{for(;!e.document.contains(r)&&e.parent!==e;)t=e,e=e.parent}catch{e=t}return e};const ca=r=>{const{disabled:e,value:t,showValue:n,label:a,labelVisibility:i,onChange:o,help:l}=r,[h,c]=C.useState(t),p=Nt();C.useEffect(()=>{c(t)},[t]);const u=C.useCallback(v=>{c(v.hex)},[]),d=C.useCallback(()=>{o(h)},[o,h]),f={default:{picker:{borderRadius:p.radii.default,boxShadow:"none",backgroundColor:p.colors.bgColor},saturation:{borderRadius:`${p.radii.default} ${p.radii.default} 0 0`,userSelect:"none"},body:{padding:p.spacing.xl}}};return qe(ia,{className:"stColorPicker","data-testid":"stColorPicker",disabled:e,children:[A(zt,{label:a,disabled:e,labelVisibility:i,children:l&&A(Dt,{children:A(jt,{content:l,placement:Lt.TOP_RIGHT})})}),A(Gt,{onClose:d,placement:"bottomLeft",content:()=>A(oa,{"data-testid":"stColorPickerPopover",children:A(Bn,{color:h,onChange:u,disableAlpha:!0,styles:f})}),children:qe(la,{disabled:e,children:[A(sa,{"data-testid":"stColorPickerBlock",backgroundColor:h,disabled:e}),n&&A(ha,{children:h.toUpperCase()})]})})]})},pa=C.memo(ca),ua=(r,e)=>r.getStringValue(e),da=r=>r.default??null,fa=r=>r.value??null,ga=(r,e,t,n)=>{e.setStringValue(r,t.value,{fromUi:t.fromUi},n)},ba=({element:r,disabled:e,widgetMgr:t,fragmentId:n})=>{const[a,i]=Ut({getStateFromWidgetMgr:ua,getDefaultStateFromProto:da,getCurrStateFromProto:fa,updateWidgetMgrState:ga,element:r,widgetMgr:t,fragmentId:n}),o=C.useCallback(l=>{i({value:l,fromUi:!0})},[i]);return A(pa,{label:r.label,labelVisibility:Wt(r.labelVisibility?.value),help:r.help,onChange:o,disabled:e,value:a})},wa=C.memo(ba);export{wa as default};
@@ -0,0 +1 @@
1
+ import{x as a,r as t,n as i,j as d,e}from"./index.DMxc2XFp.js";import{D as c,a as l}from"./IFrameUtil.DefezniK.js";const m=a("iframe",{target:"evfee5y0"})(({theme:o,disableScrolling:r})=>({width:"100%",height:"100%",colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:r?"hidden":void 0}));function n(o){return e(o)||o===""?void 0:o}function f({element:o}){const r=n(o.src),s=i(r)?void 0:n(o.srcdoc);return d(m,{className:"stIFrame","data-testid":"stIFrame",allow:l,disableScrolling:!o.scrolling,src:r,srcDoc:s,scrolling:o.scrolling?"auto":"no",sandbox:c,title:"st.iframe",tabIndex:o.tabIndex??void 0})}const F=t.memo(f);export{F as default};
@@ -0,0 +1 @@
1
+ import{x as f,r as e,g as w,l as x,j as i,Z as m,S as L,$ as r,a0 as R,k,n as C,a1 as B,a2 as E}from"./index.DMxc2XFp.js";const z=f("button",{target:"ee3yv4c0"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),H=f("div",{target:"ee3yv4c1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),D=f("div",{target:"ee3yv4c2"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function M(o){const t=k(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:o.colors.bgColor,filter:t?"brightness(0.98)":"brightness(1.2)",color:o.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function I(o){if(o.length>104){let s=o.replace(/^(.{104}[^\s]*).*/,"$1");return s.length>104&&(s=s.substring(0,104).split(" ").slice(0,-1).join(" ")),s.trim()}return o}function j({element:o}){const{body:t,icon:s,duration:d}=o,n=w(),c=I(t),l=t!==c,[a,S]=e.useState(!l),[y,T]=e.useState(0),b=e.useCallback(()=>{S(!a)},[a]),g=e.useMemo(()=>M(n),[n]),p=e.useMemo(()=>x(H,{expanded:a,children:[s&&i(m,{iconValue:s,size:"xl",testid:"stToastDynamicIcon"}),x(D,{children:[i(L,{source:a?t:c,allowHTML:!1,isToast:!0}),l&&i(z,{"data-testid":"stToastViewButton",onClick:b,children:a?"view less":"view more"})]})]}),[l,a,t,s,c,b]);e.useEffect(()=>{if(n.inSidebar)return;const v=C(d)?d===0?0:d*1e3:4e3,u=r.info(p,{overrides:{...g},autoHideDuration:v});return T(u),()=>{r.update(u,{overrides:{Body:{style:{display:"none"}}}}),r.clear(u)}},[]),e.useEffect(()=>{r.update(y,{children:p,overrides:{...g}})},[y,p,g]);const h=i(E,{kind:B.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return i(R,{children:n.inSidebar&&h})}const O=e.memo(j);export{O as default};
@@ -1 +1 @@
1
- import{r as l,m as s,j as d,l as V,U as x}from"./index.6xX1278W.js";import{u as U}from"./useBasicWidgetState.CedkNjUW.js";import"./FormClearHelper.DTcdrasw.js";const h=(t,e)=>t.getStringValue(e),v=t=>t.options.length===0||s(t.default)?null:t.options[t.default],w=t=>t.rawValue??null,y=(t,e,o,a)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},a)},C=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:i,help:u,label:n,labelVisibility:c,placeholder:p,acceptNewOptions:f}=e,[g,r]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:w,updateWidgetMgrState:y,element:e,widgetMgr:o,fragmentId:a}),b=l.useCallback(S=>{r({value:S,fromUi:!0})},[r]),m=s(e.default)&&!t;return d(x,{label:n,labelVisibility:V(c?.value),options:i,disabled:t,onChange:b,value:g,help:u,placeholder:p,clearable:m,acceptNewOptions:f??!1})},P=l.memo(C);export{P as default};
1
+ import{r as l,e as s,j as d,m as V,U as x}from"./index.DMxc2XFp.js";import{u as U}from"./useBasicWidgetState.Bfp6TnSw.js";import"./FormClearHelper.CG2XN1_g.js";const h=(t,e)=>t.getStringValue(e),v=t=>t.options.length===0||s(t.default)?null:t.options[t.default],w=t=>t.rawValue??null,y=(t,e,o,a)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},a)},C=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:i,help:u,label:n,labelVisibility:c,placeholder:p,acceptNewOptions:f}=e,[g,r]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:w,updateWidgetMgrState:y,element:e,widgetMgr:o,fragmentId:a}),b=l.useCallback(S=>{r({value:S,fromUi:!0})},[r]),m=s(e.default)&&!t;return d(x,{label:n,labelVisibility:V(c?.value),options:i,disabled:t,onChange:b,value:g,help:u,placeholder:p,clearable:m,acceptNewOptions:f??!1})},P=l.memo(C);export{P as default};
@@ -0,0 +1 @@
1
+ import{r as o,E as T,_ as V,Q as $e,cj as v,ck as me,x as g,l as F,j as a,P as Q,b as ye,B as Ce,ax as z,T as We,a0 as H,g as Z,ay as we,Z as ve,bU as Ne,k as Pe,f as Oe,b1 as qe,cl as Ke,e as j,bM as he,bN as Xe}from"./index.DMxc2XFp.js";import{g as je,C as Ge,I as Ye,F as _,E as xe,b as _e,s as Qe,u as Ze,a as Je}from"./FileHelper.B7Ero7qQ.js";import{u as et}from"./useWaveformController.WxVzpzEX.js";import{I as tt}from"./InputInstructions.Cj5-1zf6.js";import{u as ot,T as rt}from"./useTextInputAutoExpand.QepX7n8Y.js";import{i as nt}from"./inputUtils.CptNuJwn.js";import{E as at}from"./ErrorOutline.esm.ZJDbmVTx.js";import{U as be}from"./UploadFileInfo.C-jY39rj.js";import"./base-input.o9tL8MDP.js";var Ie=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});Ie.displayName="AttachFile";var Ee=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M18 6.7l-8.48 8.48-3.54-3.54a.996.996 0 10-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 00-.01-1.42c-.37-.38-1-.38-1.39.01z"}))});Ee.displayName="Check";var ze=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}))});ze.displayName="Close";var Se=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm0 4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"}))});Se.displayName="ErrorOutline";var Fe=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),o.createElement("path",{d:"M17.91 11c-.49 0-.9.36-.98.85C16.52 14.21 14.47 16 12 16s-4.52-1.79-4.93-4.15a.998.998 0 00-.98-.85c-.61 0-1.09.54-1 1.14.49 3 2.89 5.34 5.91 5.78V20c0 .55.45 1 1 1s1-.45 1-1v-2.08c3.02-.44 5.42-2.78 5.91-5.78.1-.6-.39-1.14-1-1.14z"}))});Fe.displayName="Mic";var Ue=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(T,V({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("rect",{width:24,height:24,fill:"none"}),o.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"}))});Ue.displayName="Send";const N=$e.getLogger("ChatInput"),Re=(e,t)=>t===v.Directory?{...e,webkitdirectory:"",multiple:!0}:e,it=(e,t)=>{if(!t||t.length===0)return!0;const n=e.name.toLowerCase(),l=n.lastIndexOf(".");if(l===-1||l===n.length-1)return t.some(m=>m===""||m===".");const u=n.substring(l),c=n.substring(l+1);return t.some(m=>{const C=m.toLowerCase();return C.startsWith(".")?u===C:c===C})},st=(e,t)=>it(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||"This type of"} files are not allowed.`},De=e=>{switch(e){case v.None:return"a file";case v.Single:return"a file";case v.Multiple:return"files";case v.Directory:return"a directory";default:return me(e),"a file"}},lt=g("div",{target:"e15560op0"})(({theme:e,height:t})=>({backgroundColor:e.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${e.sizes.emptyDropdownHeight}, ${t})`,width:"100%",zIndex:e.zIndices.priority})),ct=g("div",{target:"e15560op1"})(({theme:e,height:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:t,width:"100%",fontWeight:e.fontWeights.bold})),dt=g("div",{target:"e15560op2"})(({theme:e,disabled:t})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${e.sizes.borderWidth}`,cursor:t?"not-allowed":"auto"})),ut=g("div",{target:"e15560op3"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),pt=g("div",{target:"e15560op4"})(({theme:e})=>({marginTop:"0.625em",marginLeft:e.spacing.sm,height:e.spacing.xl,width:e.sizes.borderWidth,backgroundColor:e.colors.fadedText20})),gt=g("div",{target:"e15560op5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,overflowX:"auto"})),ft=g("div",{target:"e15560op6"})({display:"flex"}),ht=g("div",{target:"e15560op7"})({flex:"0 0 auto"}),mt=g("div",{target:"e15560op8"})(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing.sm,gap:e.spacing.twoXS})),yt=g("div",{target:"e15560op9"})(({theme:e})=>({color:e.colors.fadedText60})),Ct=g("div",{target:"e15560op10"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploaded"?e.colors.bodyText:e.colors.fadedText60})),wt=g("div",{target:"e15560op11"})(({theme:e})=>({marginRight:e.spacing.md,color:e.colors.fadedText60})),vt=g("small",{target:"e15560op12"})(({theme:e})=>({display:"flex",alignItems:"center",maxHeight:e.sizes.smallElementHeight,color:e.colors.fadedText60,"& :hover":{color:e.colors.bodyText}})),xt=({getRootProps:e,getInputProps:t,acceptFile:n,disabled:l,theme:u})=>{const c=Re(t(),n);return F(dt,{disabled:l,children:[F(ut,{"data-testid":"stChatInputFileUploadButton",disabled:l,...e(),children:[a("input",{...c}),a(We,{content:`Upload or drag and drop ${De(n)}`,placement:Q.TOP,onMouseEnterDelay:500,children:a(ye,{kind:Ce.MINIMAL,disabled:l,children:a(z,{content:Ie,size:"lg",color:l?u.colors.fadedText40:u.colors.fadedText60})})})]}),a(pt,{})]})},bt=o.memo(xt),It=({getRootProps:e,getInputProps:t,acceptFile:n,inputHeight:l})=>{const u=Re(t(),n);return F(H,{children:[a(lt,{height:l,...e(),children:a("input",{...u})}),a(ct,{height:l,children:`Drag and drop ${De(n)} here`})]})},Et=o.memo(It);function zt({children:e,content:t}){const n=Z();return a(we,{content:t,placement:Q.TOP,overrides:{Body:{style:{top:`-${n.sizes.minElementHeight}`}}},children:e})}const St=({fileInfo:e})=>{const t=Z(),{type:n}=e.status;switch(n){case"uploading":return a(ve,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(zt,{content:e.status.errorMessage,children:a(z,{color:t.colors.redTextColor,content:at,size:"lg"})});case"uploaded":return a(z,{content:Ye,size:"lg"});default:return me(n),null}},Ft=({fileInfo:e,onDelete:t})=>F(mt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[a(yt,{children:a(St,{fileInfo:e})}),a(Ct,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:e.name}),a(wt,{children:je(e.size,_.Byte)}),a(vt,{"data-testid":"stChatInputDeleteBtn",children:a(ye,{onClick:()=>t(e.id),kind:Ce.MINIMAL,children:a(z,{content:Ge,size:"lg"})})})]}),Ut=o.memo(Ft),Rt=({items:e,onDelete:t})=>a(gt,{"data-testid":"stChatUploadedFiles",children:a(ft,{children:e.map(n=>a(ht,{children:a(Ut,{fileInfo:n,onDelete:t})},n.id))})}),Dt=o.memo(Rt),Tt=(e,t)=>{const n=[],l=[];return e.forEach(u=>{const c=st(u,t.fileType);c.isValid?n.push(u):l.push({file:u,errors:[{code:xe.FileInvalidType,message:c.errorMessage||"File type not allowed."}]})}),{accepted:n,rejected:l}},Vt=({acceptMultipleFiles:e,acceptDirectoryFiles:t,maxFileSize:n,uploadClient:l,uploadFile:u,addFiles:c,getNextLocalFileId:m,deleteExistingFiles:C,onUploadComplete:S,element:w})=>(h,f)=>{if(t&&h.length>0){const{accepted:p,rejected:x}=Tt(h,w);h=p,f=[...f,...x]}if(!e&&h.length===0&&f.length>1){const p=f.findIndex(x=>x.errors?.[0].code===xe.TooManyFiles);p>=0&&(h.push(f[p].file),f.splice(p,1))}if(!e&&h.length>0&&C(),l.fetchFileURLs(h).then(p=>{Ne(p,h).forEach(([x,P])=>{u(x,P)})}).catch(p=>{c(h.map(x=>new be(x.name,x.size,m(),{type:"error",errorMessage:p})))}),f.length>0){const p=f.map(x=>_e(x,m(),n));c(p)}S()},Mt=({getNextLocalFileId:e,addFiles:t,updateFile:n,uploadClient:l,element:u,onUploadProgress:c,onUploadComplete:m})=>(C,S)=>{const w=S.webkitRelativePath||S.name,h=new AbortController,f=new be(w,S.size,e(),{type:"uploading",abortController:h,progress:1});t([f]),l.uploadFile({formId:"",...u},C.uploadUrl,S,p=>c(p,f.id),h.signal).then(()=>m(f.id,C)).catch(p=>{p instanceof DOMException&&p.name==="AbortError"||n(f.id,f.setStatus({type:"error",errorMessage:p?p.toString():"Unknown error"}))})},At=g("div",{target:"eyzqfg10"})("border:none;position:relative;display:flex;"),Bt=g("div",{target:"eyzqfg11"})(({theme:e,extended:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",paddingLeft:e.spacing.lg,maxHeight:t?"none":e.sizes.minElementHeight,gap:e.spacing.sm,overflow:"hidden",":focus-within":{borderColor:e.colors.primary}})),L=g("button",{target:"eyzqfg12"})(({theme:e,disabled:t,extended:n,hasError:l})=>{const u=Pe(e),[c,m]=u?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40],C=()=>l?e.colors.redTextColor:t?c:m;return{border:"none",backgroundColor:e.colors.transparent,borderTopRightRadius:n?"0":e.radii.chatInput,borderTopLeftRadius:n?e.radii.default:"0",borderBottomRightRadius:e.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.sm,color:C(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:u?e.colors.gray10:e.colors.gray90},"&:hover":{color:l?e.colors.red70:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.gray60,cursor:"not-allowed"}}}),kt=g("div",{target:"eyzqfg13"})(({theme:e,isRecording:t})=>({display:"flex",alignItems:t?"center":"flex-end",height:"100%",position:t?"static":"absolute",right:t?void 0:0,bottom:t?void 0:0,marginBottom:t?0:`-${e.sizes.borderWidth}`,pointerEvents:"none",gap:0,paddingRight:t?e.spacing.sm:0})),Lt=g("div",{target:"eyzqfg14"})(({theme:e,acceptAudio:t})=>({position:"absolute",bottom:"0px",right:t?`calc(2 * (${e.iconSizes.xl} + 2 * ${e.spacing.sm}) + 2 * ${e.spacing.sm})`:`calc(${e.iconSizes.xl} + 2 * ${e.spacing.sm} + ${e.spacing.sm})`})),Ht=g("div",{target:"eyzqfg15"})(({isRecording:e})=>({display:e?"flex":"none",flex:e?1:void 0,alignItems:"center",minWidth:0})),$t=g("div",{target:"eyzqfg16"})(({theme:e})=>({position:"relative",width:"100%",minHeight:e.sizes.minElementHeight,borderRadius:e.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}})),G=(e,t,n)=>n.map(l=>l.id===e?t:l),Y=(e,t)=>t.find(n=>n.id===e);function Wt({disabled:e,element:t,widgetMgr:n,fragmentId:l,uploadClient:u}){const c=Z(),{placeholder:m,maxChars:C}=t,S=o.useRef(0),w=o.useRef(null),h=o.useRef(!1),f=o.useRef(null),p=o.useRef(null),{width:x,elementRef:P}=Oe(),{innerWidth:J,innerHeight:ee}=qe(),[R,O]=o.useState(t.default),[U,D]=o.useState([]),[M,q]=o.useState(!1),[A,te]=o.useState(!1),[K,B]=o.useState(null),k=t.acceptAudio??!1;o.useEffect(()=>()=>{p.current&&p.current.abort()},[]);const b=ot({textareaRef:w,dependencies:[m]}),$=o.useMemo(()=>U.some(r=>r.status.type==="uploading")?!1:R!==""||U.length>0,[U,R]),E=Ke(t.acceptFile),oe=Qe(t.maxUploadSizeMb,_.Megabyte,_.Byte),re=o.useCallback(r=>D(s=>[...s,...r]),[]),ne=o.useCallback(r=>{r.status.type==="uploading"&&r.status.abortController.abort(),r.status.type==="uploaded"&&r.status.fileUrls.deleteUrl&&u.deleteFile(r.status.fileUrls.deleteUrl).catch(s=>{N.error("Failed to delete file from server:",s)})},[u]),ae=o.useCallback(r=>{D(s=>{const d=Y(r,s);return j(d)?s:(ne(d),s.filter(i=>i.id!==r))})},[ne]),ie=o.useCallback(()=>{const r=U.filter(s=>s.status.type==="uploaded").map(s=>{const{name:d,size:i,status:I}=s,{fileId:X,fileUrls:He}=I;return new he({fileId:X,fileUrls:He,name:d,size:i})});return new Xe({uploadedFileInfo:r})},[U]),se=()=>S.current++,Te=Vt({acceptMultipleFiles:E===v.Multiple||E===v.Directory,acceptDirectoryFiles:E===v.Directory,maxFileSize:oe,uploadClient:u,uploadFile:Mt({getNextLocalFileId:se,addFiles:re,updateFile:(r,s)=>{D(d=>G(r,s,d))},uploadClient:u,element:t,onUploadProgress:(r,s)=>{D(d=>{const i=Y(s,d);if(j(i)||i.status.type!=="uploading")return d;const I=Math.round(r.loaded*100/r.total);return i.status.progress===I?d:G(s,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:I}),d)})},onUploadComplete:(r,s)=>{D(d=>{const i=Y(r,d);return j(i)||i.status.type!=="uploading"?d:G(i.id,i.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}),d)})}}),addFiles:re,getNextLocalFileId:se,deleteExistingFiles:()=>U.forEach(r=>ae(r.id)),onUploadComplete:()=>{w.current&&w.current.focus()},element:t}),{getRootProps:le,getInputProps:ce}=Ze({onDrop:Te,multiple:E===v.Multiple||E===v.Directory,accept:Je(t.fileType),maxSize:oe}),W=o.useCallback(r=>{if(w.current&&w.current.focus(),!$&&!r||e)return;const s=ie(),d={data:R,fileUploaderState:s,audioFileInfo:r};n.setChatInputValue(t,d,{fromUi:!0},l),D([]),O(""),b.clearScrollHeight()},[$,e,R,ie,n,t,l,b]),de=o.useCallback(async r=>{const s=new Date().toISOString().replace(/[:.]/g,"-"),d=new File([r],`audio-${s}.wav`,{type:"audio/wav"});try{te(!0);const i=await u.fetchFileURLs([d]);if(i.length===0)throw new Error("Failed to get upload URL for audio file");const I=i[0];p.current=new AbortController,await u.uploadFile({formId:"",...t},I.uploadUrl,d,()=>{},p.current.signal);const X=new he({fileId:I.fileId,fileUrls:I,name:d.name,size:d.size});W(X)}catch(i){const I="Recording failed";N.error("Audio upload failed:",i),B(I),w.current&&w.current.focus()}finally{te(!1)}},[u,t,W]),Ve=o.useMemo(()=>({onApprove:de,onPermissionDenied:()=>{const r="Microphone access denied";B(r),N.error("Permission denied:",r)},onError:r=>{B("Recording failed"),N.error("Recording error:",r)},onRecordStart:()=>{B(null)}}),[de]),y=et({containerRef:f,sampleRate:t.audioSampleRate??void 0,events:Ve}),ue=o.useCallback(()=>{W()},[W]),Me=r=>{const{metaKey:s,ctrlKey:d,shiftKey:i}=r;nt(r)&&!i&&!d&&!s&&(r.preventDefault(),ue())},Ae=r=>{const{value:s}=r.target;C!==0&&s.length>C||(O(s),b.updateScrollHeight(),K&&B(null))},pe=o.useCallback(async r=>{r.preventDefault(),r.stopPropagation(),!(!k||e||y.state==="recording")&&await y.start()},[k,e,y]),Be=o.useCallback(()=>{y.cancel(),w.current&&w.current.focus()},[y]),ge=o.useCallback(async()=>{const{blob:r}=await y.stop();await y.approve(r)},[y]),fe=o.useCallback(r=>{pe(r)},[pe]),ke=o.useCallback(()=>{ge()},[ge]);o.useEffect(()=>{if(t.setValue&&!h.current){h.current=!0;const r=t.value||"";O(r)}},[t.setValue,t.value]),o.useEffect(()=>{h.current=!1},[t]),o.useEffect(()=>{const r=i=>{i.preventDefault(),i.stopPropagation(),!M&&i.dataTransfer?.types.includes("Files")&&q(!0)},s=i=>{i.preventDefault(),i.stopPropagation(),M&&(i.clientX<=0&&i.clientY<=0||i.clientX>=J&&i.clientY>=ee)&&q(!1)},d=i=>{i.preventDefault(),i.stopPropagation(),M&&q(!1)};return window.addEventListener("dragover",r),window.addEventListener("drop",d),window.addEventListener("dragleave",s),()=>{window.removeEventListener("dragover",r),window.removeEventListener("drop",d),window.removeEventListener("dragleave",s)}},[M,J,ee]);const Le=E!==v.None&&M;return F(H,{children:[E===v.None?null:a(Dt,{items:[...U],onDelete:ae}),a(At,{className:"stChatInput","data-testid":"stChatInput",ref:P,children:Le?a(Et,{getRootProps:le,getInputProps:ce,acceptFile:E,inputHeight:b.height}):F(Bt,{extended:b.isExtended||y.state==="recording",children:[a(Ht,{isRecording:y.state==="recording",children:a($t,{ref:f})}),E===v.None||y.state==="recording"?null:a(bt,{getRootProps:le,getInputProps:ce,acceptFile:E,disabled:e,theme:c}),y.state!=="recording"&&a(rt,{inputRef:w,value:R,placeholder:m,onChange:Ae,onKeyDown:Me,"aria-label":m,disabled:e,rows:1,overrides:{Root:{style:{minHeight:c.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:c.fontWeights.normal,lineHeight:c.lineHeights.inputWidget,"::placeholder":{color:c.colors.fadedText60},height:b.height,maxHeight:b.maxHeight,paddingLeft:c.spacing.none,paddingBottom:c.spacing.sm,paddingTop:c.spacing.sm,paddingRight:k?`calc(2 * (${c.iconSizes.xl} + 2 * ${c.spacing.sm}))`:`calc(${c.iconSizes.xl} + 2 * ${c.spacing.sm} + ${c.spacing.sm})`}}}}),y.state!=="recording"&&x>c.breakpoints.hideWidgetDetails&&a(Lt,{acceptAudio:k,children:a(tt,{dirty:$,value:R,maxLength:C,type:"chat",inForm:!1})}),a(kt,{isRecording:y.state==="recording",children:y.state==="recording"?F(H,{children:[a(L,{onClick:Be,disabled:e,extended:b.isExtended,"data-testid":"stChatInputCancelButton",children:a(z,{content:ze,size:"lg",color:"inherit"})}),a(L,{onClick:ke,disabled:e||A,extended:b.isExtended,"data-testid":"stChatInputApproveButton",children:A?a(ve,{size:"lg",iconValue:"spinner"}):a(z,{content:Ee,size:"lg",color:"inherit"})})]}):F(H,{children:[k&&a(H,{children:K?a(we,{content:K,placement:Q.TOP,error:!0,children:a(L,{onClick:fe,disabled:e||A,extended:b.isExtended,hasError:!0,"data-testid":"stChatInputMicButton",children:a(z,{content:Se,size:"xl",color:"inherit"})})}):a(L,{onClick:fe,disabled:e||A,extended:b.isExtended,"data-testid":"stChatInputMicButton",children:a(z,{content:Fe,size:"xl",color:"inherit"})})}),a(L,{onClick:ue,disabled:!$||e||A,extended:b.isExtended,"data-testid":"stChatInputSubmitButton",children:a(z,{content:Ue,size:"xl",color:"inherit"})})]})})]})})]})}const _t=o.memo(Wt);export{_t as default};
@@ -0,0 +1 @@
1
+ import{x as p,J as o,r as C,K as m,l as g,j as s,M as N,S as T,N as b}from"./index.DMxc2XFp.js";import{g as A,a as L,f as w}from"./pandasStylerUtils.BqhXt51_.js";import"./moment.C3j7ZXd7.js";import"./_baseIndexOf.BTknn6Gb.js";const M=p("div",{target:"e15vb32f0"})(({theme:t})=>({fontSize:t.fontSizes.md,fontFamily:t.genericFonts.bodyFont,lineHeight:t.lineHeights.small,captionSide:"bottom"})),h=p("div",{target:"e15vb32f1"})(({theme:t})=>({fontFamily:t.genericFonts.bodyFont,fontSize:t.fontSizes.sm,paddingTop:t.spacing.sm,paddingBottom:0,color:t.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),O=p("div",{target:"e15vb32f2"})(({theme:t,borderMode:e})=>({border:e===o.BorderMode.ALL?`${t.sizes.borderWidth} solid ${t.colors.dataframeBorderColor}`:"none",borderRadius:t.radii.default,overflow:"auto"})),v=p("table",{target:"e15vb32f3"})(({theme:t})=>({width:t.sizes.full,color:t.colors.bodyText,borderSpacing:0})),S=(t,e=o.BorderMode.ALL)=>({borderBottom:e!==o.BorderMode.NONE?`${t.sizes.borderWidth} solid ${t.colors.dataframeBorderColor}`:"none","tbody tr:last-child &":{borderBottom:e===o.BorderMode.ALL||e===o.BorderMode.HORIZONTAL?"none":void 0},borderRight:e===o.BorderMode.ALL?`${t.sizes.borderWidth} solid ${t.colors.dataframeBorderColor}`:"none","&:last-child":{borderRight:e===o.BorderMode.ALL?"none":void 0,paddingRight:e===o.BorderMode.NONE?"0":t.spacing.xs},verticalAlign:"middle",padding:`${t.spacing.twoXS} ${t.spacing.xs}`,"&:not(:first-of-type)":{paddingLeft:e===o.BorderMode.NONE||e===o.BorderMode.HORIZONTAL?t.spacing.lg:t.spacing.xs},"&:first-of-type":{paddingLeft:e===o.BorderMode.NONE?"0":t.spacing.xs},fontWeight:t.fontWeights.normal}),u=p("td",{target:"e15vb32f4"})(({theme:t,borderMode:e})=>S(t,e)),B=p("th",{target:"e15vb32f5"})(({theme:t,borderMode:e})=>({...S(t,e),textAlign:"inherit",color:t.colors.fadedText60,"&:first-of-type":{paddingLeft:e===o.BorderMode.NONE?"0":t.spacing.sm},"&:not(:first-of-type)":{paddingLeft:e===o.BorderMode.NONE||e===o.BorderMode.HORIZONTAL?t.spacing.lg:t.spacing.sm}})),H=p(u,{target:"e15vb32f6"})(({theme:t})=>({color:t.colors.gray70,fontStyle:"italic",fontSize:t.fontSizes.md,textAlign:"center"}));function R(t){const e=t.data,{cssId:l,cssStyles:n,caption:d}=e.styler??{},{numHeaderRows:f,numDataRows:c,numColumns:a}=e.dimensions,r=m(c),i=t.element.borderMode;return g(M,{className:"stTable","data-testid":"stTable",children:[n&&s("style",{children:n}),s(O,{borderMode:i,children:g(v,{id:l,"data-testid":"stTableStyledTable",children:[f>0&&E(e,i),s("tbody",{children:r.length===0?s("tr",{children:s(H,{"data-testid":"stTableStyledEmptyTableCell",colSpan:a||1,borderMode:i,children:"empty"})}):r.map(y=>x(e,y,a,i))})]})}),d&&s(h,{children:d})]})}function E(t,e){const l=e===o.BorderMode.NONE||e===o.BorderMode.HORIZONTAL;return s("thead",{children:A(t).map((n,d)=>s("tr",{children:n.map((f,c)=>{let a="inherit";if(l&&t.dimensions.numDataRows>0){const{contentType:r}=t.getCell(0,c);a=N(r)?"right":"left"}return s(B,{className:f.cssClass,scope:"col",borderMode:e,style:{textAlign:a},children:s(T,{source:f.name||" ",allowHTML:!1})},c)})},d))})}function x(t,e,l,n){return s("tr",{children:m(l).map(d=>$(t,e,d,n))},e)}function $(t,e,l,n){const{type:d,content:f,contentType:c}=t.getCell(e,l),a=L(t,e,l);let r=a?.displayContent||w(f,c),i=!1;const y={textAlign:N(c)?"right":"left"};switch(r?.endsWith('<span class="pd-t"></span>')&&(r=r.replace(/<span class="pd-t"><\/span>$/,""),i=!0),d){case b.INDEX:return g(B,{scope:"row",id:a?.cssId,className:a?.cssClass,borderMode:n,children:[i&&s("span",{className:"pd-t"}),s(T,{source:r||" ",allowHTML:!1})]},l);case b.DATA:return g(u,{id:a?.cssId,className:a?.cssClass,style:y,borderMode:n,children:[i&&s("span",{className:"pd-t"}),s(T,{source:r||" ",allowHTML:!1})]},l);default:throw new Error(`Cannot parse type "${d}".`)}}const Z=C.memo(R);export{Z as default};