streamlit 1.51.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.
- streamlit/__init__.py +1 -0
- streamlit/commands/execution_control.py +89 -14
- streamlit/components/v1/component_arrow.py +7 -7
- streamlit/components/v2/__init__.py +59 -3
- streamlit/components/v2/bidi_component/main.py +161 -13
- streamlit/components/v2/bidi_component/serialization.py +13 -6
- streamlit/components/v2/component_manager.py +11 -3
- streamlit/components/v2/component_registry.py +18 -1
- streamlit/components/v2/types.py +2 -2
- streamlit/connections/snowflake_connection.py +1 -1
- streamlit/connections/snowpark_connection.py +1 -1
- streamlit/dataframe_util.py +18 -18
- streamlit/delta_generator.py +7 -0
- streamlit/delta_generator_singletons.py +8 -14
- streamlit/elements/alert.py +16 -0
- streamlit/elements/arrow.py +36 -6
- streamlit/elements/bokeh_chart.py +10 -78
- streamlit/elements/code.py +2 -2
- streamlit/elements/deck_gl_json_chart.py +1 -1
- streamlit/elements/exception.py +1 -1
- streamlit/elements/form.py +27 -0
- streamlit/elements/heading.py +60 -5
- streamlit/elements/html.py +13 -2
- streamlit/elements/image.py +1 -1
- streamlit/elements/layouts.py +28 -22
- streamlit/elements/lib/built_in_chart_utils.py +49 -16
- streamlit/elements/lib/color_util.py +1 -1
- streamlit/elements/lib/column_config_utils.py +6 -5
- streamlit/elements/lib/layout_utils.py +50 -0
- streamlit/elements/lib/pandas_styler_utils.py +17 -9
- streamlit/elements/lib/shortcut_utils.py +152 -0
- streamlit/elements/markdown.py +50 -3
- streamlit/elements/metric.py +31 -1
- streamlit/elements/plotly_chart.py +75 -6
- streamlit/elements/spinner.py +1 -1
- streamlit/elements/text.py +20 -3
- streamlit/elements/toast.py +2 -0
- streamlit/elements/vega_charts.py +17 -1
- streamlit/elements/widgets/audio_input.py +8 -7
- streamlit/elements/widgets/button.py +279 -40
- streamlit/elements/widgets/button_group.py +27 -2
- streamlit/elements/widgets/camera_input.py +1 -1
- streamlit/elements/widgets/chat.py +300 -42
- streamlit/elements/widgets/color_picker.py +7 -0
- streamlit/elements/widgets/data_editor.py +68 -28
- streamlit/elements/widgets/file_uploader.py +4 -1
- streamlit/elements/widgets/number_input.py +2 -0
- streamlit/elements/widgets/text_widgets.py +2 -0
- streamlit/elements/widgets/time_widgets.py +581 -9
- streamlit/errors.py +22 -0
- streamlit/git_util.py +1 -1
- streamlit/navigation/page.py +7 -0
- streamlit/net_util.py +2 -2
- streamlit/proto/Alert_pb2.pyi +3 -3
- streamlit/proto/AppPage_pb2.pyi +7 -1
- streamlit/proto/ArrowData_pb2.pyi +7 -1
- streamlit/proto/ArrowNamedDataSet_pb2.pyi +7 -1
- streamlit/proto/ArrowVegaLiteChart_pb2.pyi +7 -1
- streamlit/proto/Arrow_pb2.py +10 -10
- streamlit/proto/Arrow_pb2.pyi +19 -12
- streamlit/proto/AudioInput_pb2.pyi +7 -1
- streamlit/proto/Audio_pb2.pyi +7 -1
- streamlit/proto/AuthRedirect_pb2.pyi +7 -1
- streamlit/proto/AutoRerun_pb2.pyi +7 -1
- streamlit/proto/BackMsg_pb2.py +4 -2
- streamlit/proto/BackMsg_pb2.pyi +34 -4
- streamlit/proto/Balloons_pb2.pyi +7 -1
- streamlit/proto/BidiComponent_pb2.pyi +10 -4
- streamlit/proto/Block_pb2.pyi +35 -35
- streamlit/proto/BokehChart_pb2.pyi +7 -1
- streamlit/proto/ButtonGroup_pb2.pyi +9 -9
- streamlit/proto/Button_pb2.py +2 -2
- streamlit/proto/Button_pb2.pyi +11 -2
- streamlit/proto/CameraInput_pb2.pyi +7 -1
- streamlit/proto/ChatInput_pb2.py +6 -6
- streamlit/proto/ChatInput_pb2.pyi +18 -6
- streamlit/proto/Checkbox_pb2.pyi +3 -3
- streamlit/proto/ClientState_pb2.pyi +10 -4
- streamlit/proto/Code_pb2.pyi +7 -1
- streamlit/proto/ColorPicker_pb2.pyi +7 -1
- streamlit/proto/Common_pb2.py +3 -3
- streamlit/proto/Common_pb2.pyi +35 -23
- streamlit/proto/Components_pb2.pyi +19 -13
- streamlit/proto/DataFrame_pb2.pyi +55 -49
- streamlit/proto/DateInput_pb2.pyi +7 -1
- streamlit/proto/DateTimeInput_pb2.py +28 -0
- streamlit/proto/DateTimeInput_pb2.pyi +92 -0
- streamlit/proto/DeckGlJsonChart_pb2.pyi +3 -3
- streamlit/proto/Delta_pb2.pyi +7 -1
- streamlit/proto/DocString_pb2.pyi +10 -4
- streamlit/proto/DownloadButton_pb2.py +2 -2
- streamlit/proto/DownloadButton_pb2.pyi +16 -2
- streamlit/proto/Element_pb2.py +5 -3
- streamlit/proto/Element_pb2.pyi +23 -5
- streamlit/proto/Empty_pb2.pyi +7 -1
- streamlit/proto/Exception_pb2.pyi +7 -1
- streamlit/proto/Favicon_pb2.pyi +7 -1
- streamlit/proto/FileUploader_pb2.pyi +7 -1
- streamlit/proto/ForwardMsg_pb2.py +12 -10
- streamlit/proto/ForwardMsg_pb2.pyi +42 -15
- streamlit/proto/GapSize_pb2.pyi +4 -4
- streamlit/proto/GitInfo_pb2.pyi +3 -3
- streamlit/proto/GraphVizChart_pb2.pyi +7 -1
- streamlit/proto/Heading_pb2.pyi +7 -1
- streamlit/proto/HeightConfig_pb2.pyi +7 -1
- streamlit/proto/Html_pb2.py +2 -2
- streamlit/proto/Html_pb2.pyi +11 -2
- streamlit/proto/IFrame_pb2.pyi +7 -1
- streamlit/proto/Image_pb2.pyi +10 -4
- streamlit/proto/Json_pb2.pyi +7 -1
- streamlit/proto/LabelVisibilityMessage_pb2.pyi +3 -3
- streamlit/proto/LinkButton_pb2.py +2 -2
- streamlit/proto/LinkButton_pb2.pyi +15 -2
- streamlit/proto/Logo_pb2.pyi +7 -1
- streamlit/proto/Markdown_pb2.pyi +3 -3
- streamlit/proto/Metric_pb2.pyi +7 -7
- streamlit/proto/MetricsEvent_pb2.pyi +10 -4
- streamlit/proto/MultiSelect_pb2.pyi +7 -1
- streamlit/proto/NamedDataSet_pb2.pyi +7 -1
- streamlit/proto/Navigation_pb2.pyi +3 -3
- streamlit/proto/NewSession_pb2.pyi +40 -40
- streamlit/proto/NumberInput_pb2.pyi +3 -3
- streamlit/proto/PageConfig_pb2.pyi +7 -7
- streamlit/proto/PageInfo_pb2.pyi +7 -1
- streamlit/proto/PageLink_pb2.py +2 -2
- streamlit/proto/PageLink_pb2.pyi +11 -2
- streamlit/proto/PageNotFound_pb2.pyi +7 -1
- streamlit/proto/PageProfile_pb2.pyi +13 -7
- streamlit/proto/PagesChanged_pb2.pyi +7 -1
- streamlit/proto/ParentMessage_pb2.pyi +7 -1
- streamlit/proto/PlotlyChart_pb2.pyi +6 -6
- streamlit/proto/Progress_pb2.pyi +7 -1
- streamlit/proto/Radio_pb2.pyi +7 -1
- streamlit/proto/RootContainer_pb2.pyi +1 -1
- streamlit/proto/Selectbox_pb2.pyi +7 -1
- streamlit/proto/SessionEvent_pb2.pyi +7 -1
- streamlit/proto/SessionStatus_pb2.pyi +7 -1
- streamlit/proto/Skeleton_pb2.pyi +3 -3
- streamlit/proto/Slider_pb2.pyi +5 -5
- streamlit/proto/Snow_pb2.pyi +7 -1
- streamlit/proto/Space_pb2.pyi +7 -1
- streamlit/proto/Spinner_pb2.pyi +7 -1
- streamlit/proto/TextAlignmentConfig_pb2.py +29 -0
- streamlit/proto/TextAlignmentConfig_pb2.pyi +68 -0
- streamlit/proto/TextArea_pb2.pyi +7 -1
- streamlit/proto/TextInput_pb2.pyi +3 -3
- streamlit/proto/Text_pb2.pyi +7 -1
- streamlit/proto/TimeInput_pb2.pyi +7 -1
- streamlit/proto/Toast_pb2.pyi +7 -1
- streamlit/proto/VegaLiteChart_pb2.pyi +7 -1
- streamlit/proto/Video_pb2.pyi +6 -6
- streamlit/proto/WidgetStates_pb2.pyi +10 -4
- streamlit/proto/WidthConfig_pb2.pyi +7 -1
- streamlit/proto/openmetrics_data_model_pb2.pyi +52 -52
- streamlit/runtime/app_session.py +38 -1
- streamlit/runtime/caching/cache_data_api.py +1 -1
- streamlit/runtime/caching/cache_resource_api.py +2 -2
- streamlit/runtime/caching/cache_utils.py +1 -1
- streamlit/runtime/caching/hashing.py +1 -1
- streamlit/runtime/download_data_util.py +53 -0
- streamlit/runtime/forward_msg_queue.py +1 -0
- streamlit/runtime/media_file_manager.py +178 -2
- streamlit/runtime/metrics_util.py +87 -3
- streamlit/runtime/scriptrunner/script_runner.py +3 -1
- streamlit/runtime/state/query_params.py +80 -29
- streamlit/runtime/state/session_state.py +2 -2
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +530 -229
- streamlit/static/static/js/{ErrorOutline.esm.YoJdlW1p.js → ErrorOutline.esm.ZJDbmVTx.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.Ddx8VEYy.js → FileDownload.esm.Dx0vI3vH.js} +1 -1
- streamlit/static/static/js/{FileHelper.90EtOmj9.js → FileHelper.B7Ero7qQ.js} +3 -3
- streamlit/static/static/js/{FormClearHelper.BB1Km6eP.js → FormClearHelper.CG2XN1_g.js} +1 -1
- streamlit/static/static/js/IFrameUtil.DefezniK.js +1 -0
- streamlit/static/static/js/InputInstructions.Cj5-1zf6.js +1 -0
- streamlit/static/static/js/Particles.BfWfv0Aw.js +1 -0
- streamlit/static/static/js/{ProgressBar.DLY8H6nE.js → ProgressBar.CGQ8OgfO.js} +2 -2
- streamlit/static/static/js/StreamlitSyntaxHighlighter.DTKLpwhl.js +20 -0
- streamlit/static/static/js/{Toolbar.D8nHCkuz.js → Toolbar.B2qFUmd9.js} +1 -1
- streamlit/static/static/js/_arrayIncludes.B19Iyn2B.js +1 -0
- streamlit/static/static/js/_baseIndexOf.BTknn6Gb.js +1 -0
- streamlit/static/static/js/{base-input.CJGiNqed.js → base-input.o9tL8MDP.js} +4 -4
- streamlit/static/static/js/{checkbox.Cpdd482O.js → checkbox.0BeV1IBL.js} +1 -1
- streamlit/static/static/js/{createSuper.CuQIogbW.js → createSuper.RBO59fEm.js} +1 -1
- streamlit/static/static/js/data-grid-overlay-editor.CiTkUy0t.js +1 -0
- streamlit/static/static/js/{downloader.CN0K7xlu.js → downloader.DwNZg3Mw.js} +1 -1
- streamlit/static/static/js/embed.XT9xNd3F.js +195 -0
- streamlit/static/static/js/{es6.BJcsVXQ0.js → es6.x9KsYQg-.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.XzUvQqcZ.js → iframeResizer.contentWindow.ZVXpMPi0.js} +1 -1
- streamlit/static/static/js/index.5VPOamri.js +1 -0
- streamlit/static/static/js/index.8HslT92O.js +14 -0
- streamlit/static/static/js/index.AnXMIBz3.js +7 -0
- streamlit/static/static/js/index.B0yp3bM1.js +6 -0
- streamlit/static/static/js/index.B1fRb5wF.js +1 -0
- streamlit/static/static/js/index.B527JZdO.js +3 -0
- streamlit/static/static/js/index.BHgV-yW4.js +1 -0
- streamlit/static/static/js/index.BQr-XwGV.js +1 -0
- streamlit/static/static/js/index.BTtmaLDB.js +1 -0
- streamlit/static/static/js/index.BWB_91TA.js +1 -0
- streamlit/static/static/js/index.BfEKaEmw.js +1 -0
- streamlit/static/static/js/index.BfXjTO8b.js +1 -0
- streamlit/static/static/js/index.Bjy4NRu9.js +3 -0
- streamlit/static/static/js/index.Bu5JWpT_.js +1 -0
- streamlit/static/static/js/index.BuCx76ZV.js +1 -0
- streamlit/static/static/js/index.BxjzhVUb.js +2 -0
- streamlit/static/static/js/index.By55VdPY.js +1 -0
- streamlit/static/static/js/index.CF5MxTbK.js +1 -0
- streamlit/static/static/js/index.CLmq_z9K.js +1 -0
- streamlit/static/static/js/index.CNH4rdSz.js +1 -0
- streamlit/static/static/js/{index.D3GPA5k4.js → index.CTgm_-jO.js} +9 -40
- streamlit/static/static/js/index.C_rK-Swb.js +188 -0
- streamlit/static/static/js/index.CjozwSzS.js +1 -0
- streamlit/static/static/js/{index.DOFlg3dS.js → index.CkGVt6-G.js} +1 -1
- streamlit/static/static/js/index.CuvXOyER.js +2 -0
- streamlit/static/static/js/{index.B_dWA3vd.js → index.CyUHWoCC.js} +2 -2
- streamlit/static/static/js/index.CyroQtI4.js +2 -0
- streamlit/static/static/js/index.D6HmkoDm.js +263 -0
- streamlit/static/static/js/index.DAqCNvsO.js +1 -0
- streamlit/static/static/js/index.DB_w_CZQ.js +1 -0
- streamlit/static/static/js/index.DBalctjj.js +2 -0
- streamlit/static/static/js/index.DK0RFJUG.js +11 -0
- streamlit/static/static/js/index.DMxc2XFp.js +151 -0
- streamlit/static/static/js/index.DO5utP74.js +2 -0
- streamlit/static/static/js/index.DS7lf09n.js +1 -0
- streamlit/static/static/js/index.DWexTVLY.js +1 -0
- streamlit/static/static/js/index.DXxnU5ej.js +1 -0
- streamlit/static/static/js/index.DcU3uDvB.js +2 -0
- streamlit/static/static/js/index.DlltaH7J.js +1 -0
- streamlit/static/static/js/index.DpNTZz82.js +27 -0
- streamlit/static/static/js/index.Dr9HIhQw.js +1 -0
- streamlit/static/static/js/index.DsgAU5lc.js +1 -0
- streamlit/static/static/js/{index.DPUXkcQL.js → index.KfXqjDYy.js} +1 -1
- streamlit/static/static/js/index.PaidgjCs.js +1 -0
- streamlit/static/static/js/index.RJZuWCGA.js +1 -0
- streamlit/static/static/js/{index.CxIUUfab.js → index.hbeqcRTn.js} +53 -122
- streamlit/static/static/js/index.q5hIQwAY.js +1 -0
- streamlit/static/static/js/index.rORSX6IW.js +1 -0
- streamlit/static/static/js/index.uSX757_v.js +1 -0
- streamlit/static/static/js/index.x_QRaLMd.js +1 -0
- streamlit/static/static/js/{input.D4MN_FzN.js → input.D5oh9-aB.js} +2 -2
- streamlit/static/static/js/main.q9oGOg0H.js +13 -0
- streamlit/static/static/js/{memory.DrZjtdGT.js → memory.5kCSFUJS.js} +1 -1
- streamlit/static/static/js/moment.C3j7ZXd7.js +4 -0
- streamlit/static/static/js/number-overlay-editor.Cn_LsK8N.js +9 -0
- streamlit/static/static/js/pandasStylerUtils.BqhXt51_.js +1 -0
- streamlit/static/static/js/{possibleConstructorReturn.exeeJQEP.js → possibleConstructorReturn.DD9NK1Z8.js} +1 -1
- streamlit/static/static/js/{sandbox.ClO3IuUr.js → sandbox.DACSyz29.js} +1 -1
- streamlit/static/static/js/styled-components.C3R090At.js +1 -0
- streamlit/static/static/js/threshold.Q1mXg5rX.js +1 -0
- streamlit/static/static/js/throttle.B0GR3Iyz.js +1 -0
- streamlit/static/static/js/{timepicker.DAhu-vcF.js → timepicker.BdhzPxrv.js} +1 -1
- streamlit/static/static/js/timer.C2hYhUse.js +1 -0
- streamlit/static/static/js/{toConsumableArray.DNbljYEC.js → toConsumableArray.Db2pdqM2.js} +1 -1
- streamlit/static/static/js/uniqueId.CtqIr-Yh.js +1 -0
- streamlit/static/static/js/urls.BwSlolu9.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.D6sOH6oI.js → useBasicWidgetState.Bfp6TnSw.js} +1 -1
- streamlit/static/static/js/useIntlLocale.hRV75Xgj.js +12 -0
- streamlit/static/static/js/{useTextInputAutoExpand.4u3_GcuN.js → useTextInputAutoExpand.QepX7n8Y.js} +1 -1
- streamlit/static/static/js/useUpdateUiValue.DHx8TzX6.js +1 -0
- streamlit/static/static/js/useWaveformController.WxVzpzEX.js +1 -0
- streamlit/static/static/js/value.B4vHRSi7.js +1 -0
- streamlit/static/static/js/withCalculatedWidth.DcKeRSWJ.js +1 -0
- streamlit/static/static/js/withFullScreenWrapper.CrHddARq.js +1 -0
- streamlit/string_util.py +8 -1
- streamlit/testing/v1/app_test.py +15 -0
- streamlit/testing/v1/element_tree.py +62 -0
- streamlit/web/bootstrap.py +24 -0
- streamlit/web/server/oauth_authlib_routes.py +5 -2
- streamlit/web/server/upload_file_request_handler.py +16 -0
- {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/METADATA +9 -5
- {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/RECORD +274 -239
- streamlit/static/static/js/InputInstructions.jhH15PqV.js +0 -1
- streamlit/static/static/js/Particles.DUsputn1.js +0 -1
- streamlit/static/static/js/data-grid-overlay-editor.2Ufgxc6y.js +0 -1
- streamlit/static/static/js/index.B1ZQh4P1.js +0 -1
- streamlit/static/static/js/index.BKstZk0M.js +0 -27
- streamlit/static/static/js/index.BMcFsUee.js +0 -1
- streamlit/static/static/js/index.BR-IdcTb.js +0 -2
- streamlit/static/static/js/index.BgnZEMVh.js +0 -1
- streamlit/static/static/js/index.BohqXifI.js +0 -1
- streamlit/static/static/js/index.Br5nxKNj.js +0 -2
- streamlit/static/static/js/index.BrIKVbNc.js +0 -3
- streamlit/static/static/js/index.BtWUPzle.js +0 -1
- streamlit/static/static/js/index.C0RLraek.js +0 -1
- streamlit/static/static/js/index.CAIjskgG.js +0 -1
- streamlit/static/static/js/index.CAj-7vWz.js +0 -949
- streamlit/static/static/js/index.CMtEit2O.js +0 -1
- streamlit/static/static/js/index.CkRlykEE.js +0 -12
- streamlit/static/static/js/index.CmN3FXfI.js +0 -1617
- streamlit/static/static/js/index.CwbFI1_-.js +0 -1
- streamlit/static/static/js/index.D2KPNy7e.js +0 -1
- streamlit/static/static/js/index.DGAh7DMq.js +0 -1
- streamlit/static/static/js/index.DKb_NvmG.js +0 -197
- streamlit/static/static/js/index.DMqgUYKq.js +0 -1
- streamlit/static/static/js/index.DX1xY89g.js +0 -1
- streamlit/static/static/js/index.DYATBCsq.js +0 -2
- streamlit/static/static/js/index.DaSmGJ76.js +0 -3
- streamlit/static/static/js/index.Dd7bMeLP.js +0 -1
- streamlit/static/static/js/index.DjmmgI5U.js +0 -1
- streamlit/static/static/js/index.Dq56CyM2.js +0 -1
- streamlit/static/static/js/index.DuiXaS5_.js +0 -7
- streamlit/static/static/js/index.DvFidMLe.js +0 -2
- streamlit/static/static/js/index.DwkhC5Pc.js +0 -1
- streamlit/static/static/js/index.Q-3sFn1v.js +0 -1
- streamlit/static/static/js/index.QJ5QO9sJ.js +0 -1
- streamlit/static/static/js/index.VwTaeety.js +0 -1
- streamlit/static/static/js/index.YOqQbeX8.js +0 -1
- streamlit/static/static/js/number-overlay-editor.DRwAw1In.js +0 -9
- streamlit/static/static/js/uniqueId.oG4Gvj1v.js +0 -1
- streamlit/static/static/js/useUpdateUiValue.F2R3eTeR.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.zothJIsI.js +0 -1
- {streamlit-1.51.0.data → streamlit-1.52.0.data}/scripts/streamlit.cmd +0 -0
- {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/WHEEL +0 -0
- {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{r as O,b8 as Hr,b9 as Ar,ba as Er,bb as Rr,al as Xr,cv as Qr,ag as Jr,am as X,ao as Ae,ap as Ee,cw as Zr,an as Lr,s as W,cx as Tr,cy as Gr,at as xr,av as ir,bR as en,b2 as Ne,bd as tn,be as rn,aS as nn,aw as an,cz as on}from"./index.DMxc2XFp.js";import{D as Ce,a as Ie,T as sn}from"./timepicker.BdhzPxrv.js";import{I as ln}from"./input.D5oh9-aB.js";import{d as un}from"./base-input.o9tL8MDP.js";var cn=["title","size","color","overrides"];function ht(){return ht=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ht.apply(this,arguments)}function dn(t,r){if(t==null)return{};var n=pn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function pn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function fn(t,r){return gn(t)||vn(t,r)||yn(t,r)||hn()}function hn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yn(t,r){if(t){if(typeof t=="string")return sr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sr(t,r)}}function sr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function vn(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,s=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function gn(t){if(Array.isArray(t))return t}function mn(t,r){var n=Hr(),a=fn(n,2),e=a[1],o=t.title,i=o===void 0?"Left":o,s=t.size,u=t.color,c=t.overrides,h=c===void 0?{}:c,d=dn(t,cn),m=Ar({component:e.icons&&e.icons.ChevronLeft?e.icons.ChevronLeft:null},h&&h.Svg?Er(h.Svg):{});return O.createElement(Rr,ht({viewBox:"0 0 24 24",ref:r,title:i,size:s,color:u,overrides:{Svg:m}},d),O.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 12.2652 9.10536 12.5196 9.29289 12.7071L13.2929 16.7071C13.6834 17.0976 14.3166 17.0976 14.7071 16.7071C15.0976 16.3166 15.0976 15.6834 14.7071 15.2929L11.4142 12L14.7071 8.70711C15.0976 8.31658 15.0976 7.68342 14.7071 7.29289C14.3166 6.90237 13.6834 6.90237 13.2929 7.29289L9.29289 11.2929C9.10536 11.4804 9 11.7348 9 12Z"}))}const lr=O.forwardRef(mn);var bn=["title","size","color","overrides"];function yt(){return yt=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},yt.apply(this,arguments)}function On(t,r){if(t==null)return{};var n=Sn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function Sn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function Dn(t,r){return kn(t)||wn(t,r)||$n(t,r)||_n()}function _n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $n(t,r){if(t){if(typeof t=="string")return ur(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ur(t,r)}}function ur(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function wn(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,s=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function kn(t){if(Array.isArray(t))return t}function Pn(t,r){var n=Hr(),a=Dn(n,2),e=a[1],o=t.title,i=o===void 0?"Right":o,s=t.size,u=t.color,c=t.overrides,h=c===void 0?{}:c,d=On(t,bn),m=Ar({component:e.icons&&e.icons.ChevronRight?e.icons.ChevronRight:null},h&&h.Svg?Er(h.Svg):{});return O.createElement(Rr,yt({viewBox:"0 0 24 24",ref:r,title:i,size:s,color:u,overrides:{Svg:m}},d),O.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 7.29289C8.90237 7.68342 8.90237 8.31658 9.29289 8.70711L12.5858 12L9.29289 15.2929C8.90237 15.6834 8.90237 16.3166 9.29289 16.7071C9.68342 17.0976 10.3166 17.0976 10.7071 16.7071L14.7071 12.7071C14.8946 12.5196 15 12.2652 15 12C15 11.7348 14.8946 11.4804 14.7071 11.2929L10.7071 7.29289C10.3166 6.90237 9.68342 6.90237 9.29289 7.29289Z"}))}const cr=O.forwardRef(Pn);var rt={exports:{}},nt,dr;function Mn(){if(dr)return nt;dr=1;function t(p){return p&&typeof p=="object"&&"default"in p?p.default:p}var r=t(Xr()),n=Qr();function a(p,v){for(var D=Object.getOwnPropertyNames(v),f=0;f<D.length;f++){var l=D[f],M=Object.getOwnPropertyDescriptor(v,l);M&&M.configurable&&p[l]===void 0&&Object.defineProperty(p,l,M)}return p}function e(){return(e=Object.assign||function(p){for(var v=1;v<arguments.length;v++){var D=arguments[v];for(var f in D)Object.prototype.hasOwnProperty.call(D,f)&&(p[f]=D[f])}return p}).apply(this,arguments)}function o(p,v){p.prototype=Object.create(v.prototype),a(p.prototype.constructor=p,v)}function i(p,v){if(p==null)return{};var D,f,l={},M=Object.keys(p);for(f=0;f<M.length;f++)D=M[f],0<=v.indexOf(D)||(l[D]=p[D]);return l}function s(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}var u=function(p,v,D,f,l,M,Y,te){if(!p){var E;if(v===void 0)E=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var L=[D,f,l,M,Y,te],N=0;(E=new Error(v.replace(/%s/g,function(){return L[N++]}))).name="Invariant Violation"}throw E.framesToPop=1,E}},c=u;function h(p,v,D){if("selectionStart"in p&&"selectionEnd"in p)p.selectionStart=v,p.selectionEnd=D;else{var f=p.createTextRange();f.collapse(!0),f.moveStart("character",v),f.moveEnd("character",D-v),f.select()}}function d(p){var v=0,D=0;if("selectionStart"in p&&"selectionEnd"in p)v=p.selectionStart,D=p.selectionEnd;else{var f=document.selection.createRange();f.parentElement()===p&&(v=-f.moveStart("character",-p.value.length),D=-f.moveEnd("character",-p.value.length))}return{start:v,end:D,length:D-v}}var m={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},g="_";function y(p,v,D){var f="",l="",M=null,Y=[];if(v===void 0&&(v=g),D==null&&(D=m),!p||typeof p!="string")return{maskChar:v,formatChars:D,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var te=!1;return p.split("").forEach(function(E){te=!te&&E==="\\"||(te||!D[E]?(Y.push(f.length),f.length===Y.length-1&&(l+=E)):M=f.length+1,f+=E,!1)}),{maskChar:v,formatChars:D,prefix:l,mask:f,lastEditablePosition:M,permanents:Y}}function b(p,v){return p.permanents.indexOf(v)!==-1}function S(p,v,D){var f=p.mask,l=p.formatChars;if(!D)return!1;if(b(p,v))return f[v]===D;var M=l[f[v]];return new RegExp(M).test(D)}function $(p,v){return v.split("").every(function(D,f){return b(p,f)||!S(p,f,D)})}function _(p,v){var D=p.maskChar,f=p.prefix;if(!D){for(;v.length>f.length&&b(p,v.length-1);)v=v.slice(0,v.length-1);return v.length}for(var l=f.length,M=v.length;M>=f.length;M--){var Y=v[M];if(!b(p,M)&&S(p,M,Y)){l=M+1;break}}return l}function k(p,v){return _(p,v)===p.mask.length}function w(p,v){var D=p.maskChar,f=p.mask,l=p.prefix;if(!D){for((v=A(p,"",v,0)).length<l.length&&(v=l);v.length<f.length&&b(p,v.length);)v+=f[v.length];return v}if(v)return A(p,w(p,""),v,0);for(var M=0;M<f.length;M++)b(p,M)?v+=f[M]:v+=D;return v}function j(p,v,D,f){var l=D+f,M=p.maskChar,Y=p.mask,te=p.prefix,E=v.split("");if(M)return E.map(function(N,re){return re<D||l<=re?N:b(p,re)?Y[re]:M}).join("");for(var L=l;L<E.length;L++)b(p,L)&&(E[L]="");return D=Math.max(te.length,D),E.splice(D,l-D),v=E.join(""),w(p,v)}function A(p,v,D,f){var l=p.mask,M=p.maskChar,Y=p.prefix,te=D.split(""),E=k(p,v);return!M&&f>v.length&&(v+=l.slice(v.length,f)),te.every(function(L){for(;ie=L,b(p,z=f)&&ie!==l[z];){if(f>=v.length&&(v+=l[f]),N=L,re=f,M&&b(p,re)&&N===M)return!0;if(++f>=l.length)return!1}var N,re,z,ie;return!S(p,f,L)&&L!==M||(f<v.length?v=M||E||f<Y.length?v.slice(0,f)+L+v.slice(f+1):(v=v.slice(0,f)+L+v.slice(f),w(p,v)):M||(v+=L),++f<l.length)}),v}function T(p,v,D,f){var l=p.mask,M=p.maskChar,Y=D.split(""),te=f;return Y.every(function(E){for(;N=E,b(p,L=f)&&N!==l[L];)if(++f>=l.length)return!1;var L,N;return(S(p,f,E)||E===M)&&f++,f<l.length}),f-te}function F(p,v){for(var D=v;0<=D;--D)if(!b(p,D))return D;return null}function I(p,v){for(var D=p.mask,f=v;f<D.length;++f)if(!b(p,f))return f;return null}function B(p){return p||p===0?p+"":""}function H(p,v,D,f,l){var M=p.mask,Y=p.prefix,te=p.lastEditablePosition,E=v,L="",N=0,re=0,z=Math.min(l.start,D.start);return D.end>l.start?re=(N=T(p,f,L=E.slice(l.start,D.end),z))?l.length:0:E.length<f.length&&(re=f.length-E.length),E=f,re&&(re===1&&!l.length&&(z=l.start===D.start?I(p,D.start):F(p,D.start)),E=j(p,E,z,re)),E=A(p,E,L,z),(z+=N)>=M.length?z=M.length:z<Y.length&&!N?z=Y.length:z>=Y.length&&z<te&&N&&(z=I(p,z)),L||(L=null),{value:E=w(p,E),enteredString:L,selection:{start:z,end:z}}}function C(){var p=new RegExp("windows","i"),v=new RegExp("phone","i"),D=navigator.userAgent;return p.test(D)&&v.test(D)}function R(p){return typeof p=="function"}function U(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function ve(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function oe(p){return(ve()?U():function(){return setTimeout(p,1e3/60)})(p)}function G(p){(ve()||clearTimeout)(p)}var ee=function(p){function v(f){var l=p.call(this,f)||this;l.focused=!1,l.mounted=!1,l.previousSelection=null,l.selectionDeferId=null,l.saveSelectionLoopDeferId=null,l.saveSelectionLoop=function(){l.previousSelection=l.getSelection(),l.saveSelectionLoopDeferId=oe(l.saveSelectionLoop)},l.runSaveSelectionLoop=function(){l.saveSelectionLoopDeferId===null&&l.saveSelectionLoop()},l.stopSaveSelectionLoop=function(){l.saveSelectionLoopDeferId!==null&&(G(l.saveSelectionLoopDeferId),l.saveSelectionLoopDeferId=null,l.previousSelection=null)},l.getInputDOMNode=function(){if(!l.mounted)return null;var P=n.findDOMNode(s(s(l))),x=typeof window<"u"&&P instanceof window.Element;if(P&&!x)return null;if(P.nodeName!=="INPUT"&&(P=P.querySelector("input")),!P)throw new Error("react-input-mask: inputComponent doesn't contain input node");return P},l.getInputValue=function(){var P=l.getInputDOMNode();return P?P.value:null},l.setInputValue=function(P){var x=l.getInputDOMNode();x&&(l.value=P,x.value=P)},l.setCursorToEnd=function(){var P=_(l.maskOptions,l.value),x=I(l.maskOptions,P);x!==null&&l.setCursorPosition(x)},l.setSelection=function(P,x,q){q===void 0&&(q={});var V=l.getInputDOMNode(),Q=l.isFocused();V&&Q&&(q.deferred||h(V,P,x),l.selectionDeferId!==null&&G(l.selectionDeferId),l.selectionDeferId=oe(function(){l.selectionDeferId=null,h(V,P,x)}),l.previousSelection={start:P,end:x,length:Math.abs(x-P)})},l.getSelection=function(){return d(l.getInputDOMNode())},l.getCursorPosition=function(){return l.getSelection().start},l.setCursorPosition=function(P){l.setSelection(P,P)},l.isFocused=function(){return l.focused},l.getBeforeMaskedValueChangeConfig=function(){var P=l.maskOptions,x=P.mask,q=P.maskChar,V=P.permanents,Q=P.formatChars;return{mask:x,maskChar:q,permanents:V,alwaysShowMask:!!l.props.alwaysShowMask,formatChars:Q}},l.isInputAutofilled=function(P,x,q,V){var Q=l.getInputDOMNode();try{if(Q.matches(":-webkit-autofill"))return!0}catch{}return!l.focused||V.end<q.length&&x.end===P.length},l.onChange=function(P){var x=s(s(l)).beforePasteState,q=s(s(l)).previousSelection,V=l.props.beforeMaskedValueChange,Q=l.getInputValue(),fe=l.value,he=l.getSelection();l.isInputAutofilled(Q,he,fe,q)&&(fe=w(l.maskOptions,""),q={start:0,end:0,length:0}),x&&(q=x.selection,fe=x.value,he={start:q.start+Q.length,end:q.start+Q.length,length:0},Q=fe.slice(0,q.start)+Q+fe.slice(q.end),l.beforePasteState=null);var $e=H(l.maskOptions,Q,he,fe,q),Ve=$e.enteredString,me=$e.selection,ke=$e.value;if(R(V)){var He=V({value:ke,selection:me},{value:fe,selection:q},Ve,l.getBeforeMaskedValueChangeConfig());ke=He.value,me=He.selection}l.setInputValue(ke),R(l.props.onChange)&&l.props.onChange(P),l.isWindowsPhoneBrowser?l.setSelection(me.start,me.end,{deferred:!0}):l.setSelection(me.start,me.end)},l.onFocus=function(P){var x=l.props.beforeMaskedValueChange,q=l.maskOptions,V=q.mask,Q=q.prefix;if(l.focused=!0,l.mounted=!0,V){if(l.value)_(l.maskOptions,l.value)<l.maskOptions.mask.length&&l.setCursorToEnd();else{var fe=w(l.maskOptions,Q),he=w(l.maskOptions,fe),$e=_(l.maskOptions,he),Ve=I(l.maskOptions,$e),me={start:Ve,end:Ve};if(R(x)){var ke=x({value:he,selection:me},{value:l.value,selection:null},null,l.getBeforeMaskedValueChangeConfig());he=ke.value,me=ke.selection}var He=he!==l.getInputValue();He&&l.setInputValue(he),He&&R(l.props.onChange)&&l.props.onChange(P),l.setSelection(me.start,me.end)}l.runSaveSelectionLoop()}R(l.props.onFocus)&&l.props.onFocus(P)},l.onBlur=function(P){var x=l.props.beforeMaskedValueChange,q=l.maskOptions.mask;if(l.stopSaveSelectionLoop(),l.focused=!1,q&&!l.props.alwaysShowMask&&$(l.maskOptions,l.value)){var V="";R(x)&&(V=x({value:V,selection:null},{value:l.value,selection:l.previousSelection},null,l.getBeforeMaskedValueChangeConfig()).value);var Q=V!==l.getInputValue();Q&&l.setInputValue(V),Q&&R(l.props.onChange)&&l.props.onChange(P)}R(l.props.onBlur)&&l.props.onBlur(P)},l.onMouseDown=function(P){if(!l.focused&&document.addEventListener){l.mouseDownX=P.clientX,l.mouseDownY=P.clientY,l.mouseDownTime=new Date().getTime();var x=function q(V){if(document.removeEventListener("mouseup",q),l.focused){var Q=Math.abs(V.clientX-l.mouseDownX),fe=Math.abs(V.clientY-l.mouseDownY),he=Math.max(Q,fe),$e=new Date().getTime()-l.mouseDownTime;(he<=10&&$e<=200||he<=5&&$e<=300)&&l.setCursorToEnd()}};document.addEventListener("mouseup",x)}R(l.props.onMouseDown)&&l.props.onMouseDown(P)},l.onPaste=function(P){R(l.props.onPaste)&&l.props.onPaste(P),P.defaultPrevented||(l.beforePasteState={value:l.getInputValue(),selection:l.getSelection()},l.setInputValue(""))},l.handleRef=function(P){l.props.children==null&&R(l.props.inputRef)&&l.props.inputRef(P)};var M=f.mask,Y=f.maskChar,te=f.formatChars,E=f.alwaysShowMask,L=f.beforeMaskedValueChange,N=f.defaultValue,re=f.value;l.maskOptions=y(M,Y,te),N==null&&(N=""),re==null&&(re=N);var z=B(re);if(l.maskOptions.mask&&(E||z)&&(z=w(l.maskOptions,z),R(L))){var ie=f.value;f.value==null&&(ie=N),z=L({value:z,selection:null},{value:ie=B(ie),selection:null},null,l.getBeforeMaskedValueChangeConfig()).value}return l.value=z,l}o(v,p);var D=v.prototype;return D.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=C(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},D.componentDidUpdate=function(){var f=this.previousSelection,l=this.props,M=l.beforeMaskedValueChange,Y=l.alwaysShowMask,te=l.mask,E=l.maskChar,L=l.formatChars,N=this.maskOptions,re=Y||this.isFocused(),z=this.props.value!=null,ie=z?B(this.props.value):this.value,P=f?f.start:null;if(this.maskOptions=y(te,E,L),this.maskOptions.mask){!N.mask&&this.isFocused()&&this.runSaveSelectionLoop();var x=this.maskOptions.mask&&this.maskOptions.mask!==N.mask;if(N.mask||z||(ie=this.getInputValue()),(x||this.maskOptions.mask&&(ie||re))&&(ie=w(this.maskOptions,ie)),x){var q=_(this.maskOptions,ie);(P===null||q<P)&&(P=k(this.maskOptions,ie)?q:I(this.maskOptions,q))}!this.maskOptions.mask||!$(this.maskOptions,ie)||re||z&&this.props.value||(ie="");var V={start:P,end:P};if(R(M)){var Q=M({value:ie,selection:V},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());ie=Q.value,V=Q.selection}this.value=ie;var fe=this.getInputValue()!==this.value;fe?(this.setInputValue(this.value),this.forceUpdate()):x&&this.forceUpdate();var he=!1;V.start!=null&&V.end!=null&&(he=!f||f.start!==V.start||f.end!==V.end),(he||fe)&&this.setSelection(V.start,V.end)}else N.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},D.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&G(this.selectionDeferId),this.stopSaveSelectionLoop()},D.render=function(){var f,l=this.props,M=(l.mask,l.alwaysShowMask,l.maskChar,l.formatChars,l.inputRef,l.beforeMaskedValueChange,l.children),Y=i(l,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(M){R(M)||c(!1);var te=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],E=e({},Y);te.forEach(function(N){return delete E[N]}),f=M(E),te.filter(function(N){return f.props[N]!=null&&f.props[N]!==Y[N]}).length&&c(!1)}else f=r.createElement("input",e({ref:this.handleRef},Y));var L={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(Y.disabled||Y.readOnly||(L.onChange=this.onChange,L.onPaste=this.onPaste,L.onMouseDown=this.onMouseDown),Y.value!=null&&(L.value=this.value)),f=r.cloneElement(f,L)},v}(r.Component);return nt=ee,nt}var pr;function Cn(){return pr||(pr=1,rt.exports=Mn()),rt.exports}var In=Cn();const Hn=Jr(In);var An=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],En=["Input"],Rn=["mask","maskChar","overrides"];function fr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function at(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?fr(Object(n),!0).forEach(function(a){Ln(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Ln(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function qe(t){"@babel/helpers - typeof";return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qe(t)}function We(){return We=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},We.apply(this,arguments)}function vt(t,r){if(t==null)return{};var n=Tn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function Tn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}var jr=O.forwardRef(function(t,r){t.startEnhancer,t.endEnhancer,t.error,t.positive;var n=t.onChange,a=t.onFocus,e=t.onBlur,o=t.value,i=t.disabled,s=t.readOnly,u=vt(t,An);return O.createElement(Hn,We({onChange:n,onFocus:a,onBlur:e,value:o,disabled:i,readOnly:s},u),function(c){return O.createElement(un,We({ref:r,onChange:n,onFocus:a,onBlur:e,value:o,disabled:i,readOnly:s},c))})});jr.displayName="MaskOverride";function Br(t){var r=t.mask,n=t.maskChar,a=t.overrides;a=a===void 0?{}:a;var e=a.Input,o=e===void 0?{}:e,i=vt(a,En),s=vt(t,Rn),u=jr,c={},h={};typeof o=="function"?u=o:qe(o)==="object"&&(u=o.component||u,c=o.props||{},h=o.style||{}),qe(c)==="object"&&(c=at(at({},c),{},{mask:c.mask||r,maskChar:c.maskChar||n}));var d=at({Input:{component:u,props:c,style:h}},i);return O.createElement(ln,We({},s,{overrides:d}))}Br.defaultProps={maskChar:" "};var Tt=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),Fr=[0,1,2,3,4,5,6],xn=[0,1,2,3,4,5,6,7,8,9,10,11],le={high:"high",default:"default"},_e={startDate:"startDate",endDate:"endDate"},jn={locked:"locked"};function hr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Me(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?hr(Object(n),!0).forEach(function(a){Bn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Bn(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var xt=X("label",function(t){var r=t.$disabled,n=t.$theme,a=n.colors,e=n.typography;return Me(Me({},e.font250),{},{width:"100%",color:r?a.contentSecondary:a.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});xt.displayName="Label";xt.displayName="Label";var jt=X("span",function(t){var r=t.$theme.sizing;return{display:"flex",width:"100%",marginTop:r.scale300,marginRight:0,marginBottom:r.scale300,marginLeft:0}});jt.displayName="LabelContainer";jt.displayName="LabelContainer";var Bt=X("span",function(t){var r=t.$disabled,n=t.$counterError,a=t.$theme,e=a.colors,o=a.typography;return Me(Me({},o.font100),{},{flex:0,width:"100%",color:n?e.negative400:r?e.contentSecondary:e.contentPrimary})});Bt.displayName="LabelEndEnhancer";Bt.displayName="LabelEndEnhancer";var Ft=X("div",function(t){var r=t.$error,n=t.$positive,a=t.$theme,e=a.colors,o=a.sizing,i=a.typography,s=e.contentSecondary;return r?s=e.negative400:n&&(s=e.positive400),Me(Me({},i.font100),{},{color:s,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:o.scale300,marginRight:0,marginBottom:o.scale300,marginLeft:0})});Ft.displayName="Caption";Ft.displayName="Caption";var Nt=X("div",function(t){var r=t.$theme.sizing;return{width:"100%",marginBottom:r.scale600}});Nt.displayName="ControlContainer";Nt.displayName="ControlContainer";function we(){return we=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},we.apply(this,arguments)}function Ue(t){"@babel/helpers - typeof";return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ue(t)}function Fn(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Nn(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function Wn(t,r,n){return r&&Nn(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Vn(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&>(t,r)}function gt(t,r){return gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},gt(t,r)}function Yn(t){var r=Un();return function(){var a=Ke(t),e;if(r){var o=Ke(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return zn(this,e)}}function zn(t,r){if(r&&(Ue(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qn(t)}function qn(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Un(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ke(t){return Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ke(t)}function Kn(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function Xn(t,r,n,a){return r&&typeof r!="boolean"?typeof r=="function"?r(a):r:n&&typeof n!="boolean"?typeof n=="function"?n(a):n:t?typeof t=="function"?t(a):t:null}var mt=function(t){Vn(n,t);var r=Yn(n);function n(){return Fn(this,n),r.apply(this,arguments)}return Wn(n,[{key:"render",value:function(){var e=this.props,o=e.overrides,i=o.Label,s=o.LabelEndEnhancer,u=o.LabelContainer,c=o.Caption,h=o.ControlContainer,d=e.label,m=e.caption,g=e.disabled,y=e.error,b=e.positive,S=e.htmlFor,$=e.children,_=e.counter,k=O.Children.only($).props,w={$disabled:!!g,$error:!!y,$positive:!!b},j=Ae(i)||xt,A=Ae(s)||Bt,T=Ae(u)||jt,F=Ae(c)||Ft,I=Ae(h)||Nt,B=Xn(m,y,b,w),H=this.props.labelEndEnhancer;if(_){var C=null,R=null,U=null;Ue(_)==="object"&&(R=_.length,C=_.maxLength,U=_.error),C=C||k.maxLength,R==null&&typeof k.value=="string"&&(R=k.value.length),R==null&&(R=0),w.$length=R,C==null?H||(H="".concat(R)):(w.$maxLength=R,H||(H="".concat(R,"/").concat(C)),R>C&&U==null&&(U=!0)),U&&(w.$error=!0,w.$counterError=!0)}return O.createElement(O.Fragment,null,d&&O.createElement(T,we({},w,Ee(u)),O.createElement(j,we({"data-baseweb":"form-control-label",htmlFor:S||k.id},w,Ee(i)),typeof d=="function"?d(w):d),!!H&&O.createElement(A,we({},w,Ee(s)),typeof H=="function"?H(w):H)),O.createElement(Zr,null,function(ve){return O.createElement(I,we({"data-baseweb":"form-control-container"},w,Ee(h)),O.Children.map($,function(oe,G){if(oe){var ee=oe.key||String(G);return O.cloneElement(oe,{key:ee,"aria-errormessage":y?ve:null,"aria-describedby":m||b?ve:null,disabled:k.disabled||g,error:typeof k.error<"u"?k.error:w.$error,positive:typeof k.positive<"u"?k.positive:w.$positive})}}),(!!m||!!y||b)&&O.createElement(F,we({"data-baseweb":"form-control-caption",id:ve},w,Ee(c)),B))}))}}]),n}(O.Component);Kn(mt,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function yr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function vr(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?yr(Object(n),!0).forEach(function(a){Qn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Qn(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Jn=function(r){return xn.map(function(n){return{id:n.toString(),label:r(n)}})},Zn=function(r,n){return r.map(function(a){return n.includes(Number(a.id))?a:vr(vr({},a),{},{disabled:!0})})},Gn=function(r){var n=r.filterMonthsList,a=r.formatMonthLabel,e=Jn(a);return n&&(e=Zn(e,n)),e};function ea(t){var r=t.$range,n=r===void 0?!1:r,a=t.$disabled,e=a===void 0?!1:a,o=t.$isHighlighted,i=o===void 0?!1:o,s=t.$isHovered,u=s===void 0?!1:s,c=t.$selected,h=c===void 0?!1:c,d=t.$hasRangeSelected,m=d===void 0?!1:d,g=t.$startDate,y=g===void 0?!1:g,b=t.$endDate,S=b===void 0?!1:b,$=t.$pseudoSelected,_=$===void 0?!1:$,k=t.$hasRangeHighlighted,w=k===void 0?!1:k,j=t.$pseudoHighlighted,A=j===void 0?!1:j,T=t.$hasRangeOnRight,F=T===void 0?!1:T,I=t.$startOfMonth,B=I===void 0?!1:I,H=t.$endOfMonth,C=H===void 0?!1:H,R=t.$outsideMonth,U=R===void 0?!1:R;return"".concat(+n).concat(+e).concat(+(i||u)).concat(+h).concat(+m).concat(+y).concat(+S).concat(+_).concat(+w).concat(+A).concat(+(w&&!A&&F)).concat(+(w&&!A&&!F)).concat(+B).concat(+C).concat(+U)}function ta(t,r){return oa(t)||aa(t,r)||na(t,r)||ra()}function ra(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function na(t,r){if(t){if(typeof t=="string")return gr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gr(t,r)}}function gr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function aa(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,s=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function oa(t){if(Array.isArray(t))return t}function mr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function ne(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?mr(Object(n),!0).forEach(function(a){Be(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Be(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Wt=X("div",function(t){var r=t.$separateRangeInputs;return ne({width:"100%"},r?{display:"flex",justifyContent:"center"}:{})});Wt.displayName="StyledInputWrapper";Wt.displayName="StyledInputWrapper";var Vt=X("div",function(t){var r=t.$theme;return ne(ne({},r.typography.LabelMedium),{},{marginBottom:r.sizing.scale300})});Vt.displayName="StyledInputLabel";Vt.displayName="StyledInputLabel";var Yt=X("div",function(t){var r=t.$theme;return{width:"100%",marginRight:r.sizing.scale300}});Yt.displayName="StyledStartDate";Yt.displayName="StyledStartDate";var zt=X("div",function(t){return t.$theme,{width:"100%"}});zt.displayName="StyledEndDate";zt.displayName="StyledEndDate";var qt=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=r.borders;return ne(ne({},n.font200),{},{color:a.calendarForeground,backgroundColor:a.calendarBackground,textAlign:"center",borderTopLeftRadius:e.surfaceBorderRadius,borderTopRightRadius:e.surfaceBorderRadius,borderBottomRightRadius:e.surfaceBorderRadius,borderBottomLeftRadius:e.surfaceBorderRadius,display:"inline-block"})});qt.displayName="StyledRoot";qt.displayName="StyledRoot";var Ut=X("div",function(t){var r=t.$orientation;return{display:"flex",flexDirection:r===Tt.vertical?"column":"row"}});Ut.displayName="StyledMonthContainer";Ut.displayName="StyledMonthContainer";var Kt=X("div",function(t){var r=t.$theme.sizing,n=t.$density;return{paddingTop:r.scale300,paddingBottom:n===le.high?r.scale400:r.scale300,paddingLeft:r.scale500,paddingRight:r.scale500}});Kt.displayName="StyledCalendarContainer";Kt.displayName="StyledCalendarContainer";var Xe=X("div",function(t){var r=t.$theme,n=r.direction==="rtl"?"right":"left";return{marginBottom:r.sizing.scale600,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,textAlign:n}});Xe.displayName="StyledSelectorContainer";Xe.displayName="StyledSelectorContainer";var Xt=X("div",function(t){var r=t.$theme,n=r.typography,a=r.borders,e=r.colors,o=r.sizing,i=t.$density;return ne(ne({},i===le.high?n.LabelMedium:n.LabelLarge),{},{color:e.calendarHeaderForeground,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:o.scale600,paddingBottom:o.scale300,paddingLeft:o.scale600,paddingRight:o.scale600,backgroundColor:e.calendarHeaderBackground,borderTopLeftRadius:a.surfaceBorderRadius,borderTopRightRadius:a.surfaceBorderRadius,borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:i===le.high?"calc(".concat(o.scale800," + ").concat(o.scale0,")"):o.scale950})});Xt.displayName="StyledCalendarHeader";Xt.displayName="StyledCalendarHeader";var Qt=X("div",function(t){return{color:t.$theme.colors.calendarHeaderForeground,backgroundColor:t.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});Qt.displayName="StyledMonthHeader";Qt.displayName="StyledMonthHeader";var Jt=X("button",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=t.$isFocusVisible,o=t.$density;return ne(ne({},o===le.high?n.LabelMedium:n.LabelLarge),{},{alignItems:"center",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,color:a.calendarHeaderForeground,cursor:"pointer",display:"flex",outline:"none",":focus":{boxShadow:e?"0 0 0 3px ".concat(a.accent):"none"}})});Jt.displayName="StyledMonthYearSelectButton";Jt.displayName="StyledMonthYearSelectButton";var Zt=X("span",function(t){var r=t.$theme.direction==="rtl"?"marginRight":"marginLeft";return Be({alignItems:"center",display:"flex"},r,t.$theme.sizing.scale500)});Zt.displayName="StyledMonthYearSelectIconContainer";Zt.displayName="StyledMonthYearSelectIconContainer";function Nr(t){var r=t.$theme,n=t.$disabled,a=t.$isFocusVisible;return{boxSizing:"border-box",display:"flex",color:n?r.colors.calendarHeaderForegroundDisabled:r.colors.calendarHeaderForeground,cursor:n?"default":"pointer",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",marginBottom:0,marginTop:0,outline:"none",":focus":n?{}:{boxShadow:a?"0 0 0 3px ".concat(r.colors.accent):"none"}}}var Gt=X("button",Nr);Gt.displayName="StyledPrevButton";Gt.displayName="StyledPrevButton";var er=X("button",Nr);er.displayName="StyledNextButton";er.displayName="StyledNextButton";var tr=X("div",function(t){return{display:"inline-block"}});tr.displayName="StyledMonth";tr.displayName="StyledMonth";var rr=X("div",function(t){var r=t.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:r.scale0}});rr.displayName="StyledWeek";rr.displayName="StyledWeek";function K(t,r){var n,a=t.substr(0,12)+"1"+t.substr(13),e=t.substr(0,13)+"1"+t.substr(14);return n={},Be(n,t,r),Be(n,a,r),Be(n,e,r),n}function ot(t,r){var n=r.colors,a={":before":{content:null},":after":{content:null}},e=a,o={color:n.calendarForegroundDisabled,":before":{content:null},":after":{content:null}},i={color:n.calendarForegroundDisabled,":before":{borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",backgroundColor:"transparent"},":after":{borderTopLeftRadius:"0%",borderTopRightRadius:"0%",borderBottomLeftRadius:"0%",borderBottomRightRadius:"0%",borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}},s={":before":{content:null}},u=1;t&&t[u]==="1"&&(e=o);var c=Object.assign({},K("001000000000000",{color:n.calendarDayForegroundPseudoSelected}),K("000100000000000",{color:n.calendarDayForegroundSelected}),K("001100000000000",{color:n.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},K("000000000000001",i),K("101000000000000",s),K("101010000000000",s),K("100100000000000",{color:n.calendarDayForegroundSelected}),K("101100000000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),K("100111100000000",{color:n.calendarDayForegroundSelected,":before":{content:null}}),K("101111100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),K("100111000000000",{color:n.calendarDayForegroundSelected}),K("100110100000000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),K("100100001010000",{color:n.calendarDayForegroundSelected}),K("100100001001000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),K("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},K("100010010000000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},K("100000001100000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),K("101111000000000",{color:n.calendarDayForegroundSelectedHighlighted}),K("101110100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),K("101010010000000",{color:n.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),K("100000000000001",i),K("100000001010001",i),K("100000001001001",i),K("100010000000001",i));return c[t]||e}var nr=X("div",function(t){var r=t.$disabled,n=t.$isFocusVisible,a=t.$isHighlighted,e=t.$peekNextMonth,o=t.$pseudoSelected,i=t.$range,s=t.$selected,u=t.$outsideMonth,c=t.$outsideMonthWithinRange,h=t.$hasDateLabel,d=t.$density,m=t.$hasLockedBehavior,g=t.$selectedInput,y=t.$value,b=t.$theme,S=b.colors,$=b.typography,_=b.sizing,k=ea(t),w;h?d===le.high?w="60px":w="70px":d===le.high?w="40px":w="48px";var j=Array.isArray(y)?y:[y,null],A=ta(j,2),T=A[0],F=A[1],I=g===_e.startDate?F!==null&&typeof F<"u":T!==null&&typeof T<"u",B=i&&!(m&&!I);return ne(ne(ne({},d===le.high?$.ParagraphSmall:$.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:r||!e&&u?"default":"pointer",color:S.calendarForeground,display:"inline-block",width:d===le.high?"42px":"50px",height:w,lineHeight:d===le.high?_.scale700:_.scale900,textAlign:"center",paddingTop:_.scale300,paddingBottom:_.scale300,paddingLeft:_.scale300,paddingRight:_.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},ot(k,t.$theme)),{},{":after":ne(ne({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:n&&(!u||e)?"0 0 0 3px ".concat(S.accent):"none",backgroundColor:s?S.calendarDayBackgroundSelectedHighlighted:o&&a?S.calendarDayBackgroundPseudoSelectedHighlighted:S.calendarBackground,height:h?"100%":d===le.high?"42px":"50px",width:"100%",position:"absolute",top:h?0:"-1px",left:0,paddingTop:_.scale200,paddingBottom:_.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:S.borderSelected,borderBottomColor:S.borderSelected,borderRightColor:S.borderSelected,borderLeftColor:S.borderSelected,borderTopLeftRadius:h?_.scale800:"100%",borderTopRightRadius:h?_.scale800:"100%",borderBottomLeftRadius:h?_.scale800:"100%",borderBottomRightRadius:h?_.scale800:"100%"},ot(k,t.$theme)[":after"]||{}),c?{content:null}:{})},B?{":before":ne(ne({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:S.mono300,position:"absolute",height:"100%",width:"50%",top:0,left:"50%",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftWidth:"0",borderRightWidth:"0",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},ot(k,t.$theme)[":before"]||{}),c?{backgroundColor:S.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});nr.displayName="StyledDay";nr.displayName="StyledDay";var ar=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=t.$selected;return ne(ne({},n.ParagraphXSmall),{},{color:e?a.contentInverseTertiary:a.contentTertiary})});ar.displayName="StyledDayLabel";ar.displayName="StyledDayLabel";var or=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=r.sizing,o=t.$density;return ne(ne({},n.LabelMedium),{},{color:a.contentTertiary,boxSizing:"border-box",position:"relative",cursor:"default",display:"inline-block",width:o===le.high?"42px":"50px",height:o===le.high?"40px":"48px",textAlign:"center",lineHeight:e.scale900,paddingTop:e.scale300,paddingBottom:e.scale300,paddingLeft:e.scale200,paddingRight:e.scale200,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,backgroundColor:"transparent"})});or.displayName="StyledWeekdayHeader";or.displayName="StyledWeekdayHeader";function bt(t){"@babel/helpers - typeof";return bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},bt(t)}function ye(){return ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ye.apply(this,arguments)}function be(t,r){return ua(t)||la(t,r)||sa(t,r)||ia()}function ia(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
5
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sa(t,r){if(t){if(typeof t=="string")return br(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return br(t,r)}}function br(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function la(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,s=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function ua(t){if(Array.isArray(t))return t}function Or(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Ye(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Or(Object(n),!0).forEach(function(a){ae(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Or(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ca(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function da(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function pa(t,r,n){return r&&da(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function fa(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&Ot(t,r)}function Ot(t,r){return Ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},Ot(t,r)}function ha(t){var r=va();return function(){var a=Qe(t),e;if(r){var o=Qe(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return ya(this,e)}}function ya(t,r){if(r&&(bt(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return se(t)}function se(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function va(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qe(t){return Qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qe(t)}function ae(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Sr=function(r){return r.$theme,{cursor:"pointer"}},it=2e3,st=2030,Dr=0,_r=11,lt={NEXT:"next",PREVIOUS:"previous"};function $r(t){return t.split("-").map(Number)}var Wr=function(t){fa(n,t);var r=ha(n);function n(a){var e;return ca(this,n),e=r.call(this,a),ae(se(e),"dateHelpers",void 0),ae(se(e),"monthItems",void 0),ae(se(e),"yearItems",void 0),ae(se(e),"state",{isMonthDropdownOpen:!1,isYearDropdownOpen:!1,isFocusVisible:!1}),ae(se(e),"getDateProp",function(){return e.props.date||e.dateHelpers.date()}),ae(se(e),"getYearItems",function(){var o=e.getDateProp(),i=e.props.maxDate,s=e.props.minDate,u=i?e.dateHelpers.getYear(i):st,c=s?e.dateHelpers.getYear(s):it,h=e.dateHelpers.getMonth(o);e.yearItems=Array.from({length:u-c+1},function(S,$){return c+$}).map(function(S){return{id:S.toString(),label:S.toString()}});var d=i?e.dateHelpers.getMonth(i):_r,m=s?e.dateHelpers.getMonth(s):Dr,g=Array.from({length:d+1},function(S,$){return $}),y=Array.from({length:12-m},function(S,$){return $+m});if(h>g[g.length-1]){var b=e.yearItems.length-1;e.yearItems[b]=Ye(Ye({},e.yearItems[b]),{},{disabled:!0})}h<y[0]&&(e.yearItems[0]=Ye(Ye({},e.yearItems[0]),{},{disabled:!0}))}),ae(se(e),"getMonthItems",function(){var o=e.getDateProp(),i=e.dateHelpers.getYear(o),s=e.props.maxDate,u=e.props.minDate,c=s?e.dateHelpers.getYear(s):st,h=u?e.dateHelpers.getYear(u):it,d=s?e.dateHelpers.getMonth(s):_r,m=Array.from({length:d+1},function(_,k){return k}),g=u?e.dateHelpers.getMonth(u):Dr,y=Array.from({length:12-g},function(_,k){return k+g}),b=m.filter(function(_){return y.includes(_)}),S=i===c&&i===h?b:i===c?m:i===h?y:null,$=function(k){return e.dateHelpers.getMonthInLocale(k,e.props.locale)};e.monthItems=Gn({filterMonthsList:S,formatMonthLabel:$})}),ae(se(e),"increaseMonth",function(){e.props.onMonthChange&&e.props.onMonthChange({date:e.dateHelpers.addMonths(e.getDateProp(),1-e.props.order)})}),ae(se(e),"decreaseMonth",function(){e.props.onMonthChange&&e.props.onMonthChange({date:e.dateHelpers.subMonths(e.getDateProp(),1)})}),ae(se(e),"isMultiMonthHorizontal",function(){var o=e.props,i=o.monthsShown,s=o.orientation;return i?s===Tt.horizontal&&i>1:!1}),ae(se(e),"isHiddenPaginationButton",function(o){var i=e.props,s=i.monthsShown,u=i.order;if(s&&e.isMultiMonthHorizontal())if(o===lt.NEXT){var c=u===s-1;return!c}else{var h=u===0;return!h}return!1}),ae(se(e),"handleFocus",function(o){Lr(o)&&e.setState({isFocusVisible:!0})}),ae(se(e),"handleBlur",function(o){e.state.isFocusVisible!==!1&&e.setState({isFocusVisible:!1})}),ae(se(e),"renderPreviousMonthButton",function(o){var i=o.locale,s=o.theme,u=e.getDateProp(),c=e.props,h=c.overrides,d=h===void 0?{}:h,m=c.density,g=e.dateHelpers.monthDisabledBefore(u,e.props),y=!1;g&&(y=!0);var b=e.dateHelpers.subMonths(u,1),S=e.props.minDate?e.dateHelpers.getYear(e.props.minDate):it;e.dateHelpers.getYear(b)<S&&(y=!0);var $=e.isHiddenPaginationButton(lt.PREVIOUS);$&&(y=!0);var _=W(d.PrevButton,Gt),k=be(_,2),w=k[0],j=k[1],A=W(d.PrevButtonIcon,s.direction==="rtl"?cr:lr),T=be(A,2),F=T[0],I=T[1],B=e.decreaseMonth;return g&&(B=null),O.createElement(w,ye({"aria-label":i.datepicker.previousMonth,tabIndex:0,onClick:B,disabled:y,$isFocusVisible:e.state.isFocusVisible,type:"button",$disabled:y,$order:e.props.order},j),$?null:O.createElement(F,ye({size:m===le.high?24:36,overrides:{Svg:{style:Sr}}},I)))}),ae(se(e),"renderNextMonthButton",function(o){var i=o.locale,s=o.theme,u=e.getDateProp(),c=e.props,h=c.overrides,d=h===void 0?{}:h,m=c.density,g=e.dateHelpers.monthDisabledAfter(u,e.props),y=!1;g&&(y=!0);var b=e.dateHelpers.addMonths(u,1),S=e.props.maxDate?e.dateHelpers.getYear(e.props.maxDate):st;e.dateHelpers.getYear(b)>S&&(y=!0);var $=e.isHiddenPaginationButton(lt.NEXT);$&&(y=!0);var _=W(d.NextButton,er),k=be(_,2),w=k[0],j=k[1],A=W(d.NextButtonIcon,s.direction==="rtl"?lr:cr),T=be(A,2),F=T[0],I=T[1],B=e.increaseMonth;return g&&(B=null),O.createElement(w,ye({"aria-label":i.datepicker.nextMonth,tabIndex:0,onClick:B,disabled:y,type:"button",$disabled:y,$isFocusVisible:e.state.isFocusVisible,$order:e.props.order},j),$?null:O.createElement(F,ye({size:m===le.high?24:36,overrides:{Svg:{style:Sr}}},I)))}),ae(se(e),"canArrowsOpenDropdown",function(o){return!e.state.isMonthDropdownOpen&&!e.state.isYearDropdownOpen&&(o.key==="ArrowUp"||o.key==="ArrowDown")}),ae(se(e),"renderMonthYearDropdown",function(){var o=e.getDateProp(),i=e.dateHelpers.getMonth(o),s=e.dateHelpers.getYear(o),u=e.props,c=u.locale,h=u.overrides,d=h===void 0?{}:h,m=u.density,g=W(d.MonthYearSelectButton,Jt),y=be(g,2),b=y[0],S=y[1],$=W(d.MonthYearSelectIconContainer,Zt),_=be($,2),k=_[0],w=_[1],j=W(d.MonthYearSelectPopover,Tr),A=be(j,2),T=A[0],F=A[1],I=W(d.MonthYearSelectStatefulMenu,Gr),B=be(I,2),H=B[0],C=B[1];C.overrides=xr({List:{style:{height:"auto",maxHeight:"257px"}}},C&&C.overrides);var R=e.monthItems.findIndex(function(G){return G.id===e.dateHelpers.getMonth(o).toString()}),U=e.yearItems.findIndex(function(G){return G.id===e.dateHelpers.getYear(o).toString()}),ve="".concat(e.dateHelpers.getMonthInLocale(e.dateHelpers.getMonth(o),c)),oe="".concat(e.dateHelpers.getYear(o));return e.isMultiMonthHorizontal()?O.createElement("div",null,"".concat(ve," ").concat(oe)):O.createElement(O.Fragment,null,O.createElement(T,ye({placement:"bottom",autoFocus:!0,focusLock:!0,isOpen:e.state.isMonthDropdownOpen,onClick:function(){e.setState(function(ee){return{isMonthDropdownOpen:!ee.isMonthDropdownOpen}})},onClickOutside:function(){return e.setState({isMonthDropdownOpen:!1})},onEsc:function(){return e.setState({isMonthDropdownOpen:!1})},content:function(){return O.createElement(H,ye({initialState:{highlightedIndex:R,isFocused:!0},items:e.monthItems,onItemSelect:function(p){var v=p.item,D=p.event;D.preventDefault();var f=$r(v.id),l=e.dateHelpers.set(o,{year:s,month:f});e.props.onMonthChange&&e.props.onMonthChange({date:l}),e.setState({isMonthDropdownOpen:!1})}},C))}},F),O.createElement(b,ye({"aria-live":"polite",type:"button",$isFocusVisible:e.state.isFocusVisible,$density:m,onKeyUp:function(ee){e.canArrowsOpenDropdown(ee)&&e.setState({isMonthDropdownOpen:!0})},onKeyDown:function(ee){e.canArrowsOpenDropdown(ee)&&ee.preventDefault(),ee.key==="Tab"&&e.setState({isMonthDropdownOpen:!1})}},S),ve,O.createElement(k,w,O.createElement(ir,{title:"",overrides:{Svg:{props:{role:"presentation"}}},size:m===le.high?16:24})))),O.createElement(T,ye({placement:"bottom",focusLock:!0,isOpen:e.state.isYearDropdownOpen,onClick:function(){e.setState(function(ee){return{isYearDropdownOpen:!ee.isYearDropdownOpen}})},onClickOutside:function(){return e.setState({isYearDropdownOpen:!1})},onEsc:function(){return e.setState({isYearDropdownOpen:!1})},content:function(){return O.createElement(H,ye({initialState:{highlightedIndex:U,isFocused:!0},items:e.yearItems,onItemSelect:function(p){var v=p.item,D=p.event;D.preventDefault();var f=$r(v.id),l=e.dateHelpers.set(o,{year:f,month:i});e.props.onYearChange&&e.props.onYearChange({date:l}),e.setState({isYearDropdownOpen:!1})}},C))}},F),O.createElement(b,ye({"aria-live":"polite",type:"button",$isFocusVisible:e.state.isFocusVisible,$density:m,onKeyUp:function(ee){e.canArrowsOpenDropdown(ee)&&e.setState({isYearDropdownOpen:!0})},onKeyDown:function(ee){e.canArrowsOpenDropdown(ee)&&ee.preventDefault(),ee.key==="Tab"&&e.setState({isYearDropdownOpen:!1})}},S),oe,O.createElement(k,w,O.createElement(ir,{title:"",overrides:{Svg:{props:{role:"presentation"}}},size:m===le.high?16:24})))))}),e.dateHelpers=new Ce(a.adapter),e.monthItems=[],e.yearItems=[],e}return pa(n,[{key:"componentDidMount",value:function(){this.getYearItems(),this.getMonthItems()}},{key:"componentDidUpdate",value:function(e){var o=this.dateHelpers.getMonth(this.props.date)!==this.dateHelpers.getMonth(e.date),i=this.dateHelpers.getYear(this.props.date)!==this.dateHelpers.getYear(e.date);o&&this.getYearItems(),i&&this.getMonthItems()}},{key:"render",value:function(){var e=this,o=this.props,i=o.overrides,s=i===void 0?{}:i,u=o.density,c=W(s.CalendarHeader,Xt),h=be(c,2),d=h[0],m=h[1],g=W(s.MonthHeader,Qt),y=be(g,2),b=y[0],S=y[1],$=W(s.WeekdayHeader,or),_=be($,2),k=_[0],w=_[1],j=this.dateHelpers.getStartOfWeek(this.getDateProp(),this.props.locale);return O.createElement(en.Consumer,null,function(A){return O.createElement(Ne.Consumer,null,function(T){return O.createElement(O.Fragment,null,O.createElement(d,ye({},m,{$density:e.props.density,onFocus:rn(m,e.handleFocus),onBlur:tn(m,e.handleBlur)}),e.renderPreviousMonthButton({locale:T,theme:A}),e.renderMonthYearDropdown(),e.renderNextMonthButton({locale:T,theme:A})),O.createElement(b,ye({role:"presentation"},S),Fr.map(function(F){var I=e.dateHelpers.addDays(j,F);return O.createElement(k,ye({key:F,alt:e.dateHelpers.getWeekdayInLocale(I,e.props.locale)},w,{$density:u}),e.dateHelpers.getWeekdayMinInLocale(I,e.props.locale))})))})})}}]),n}(O.Component);ae(Wr,"defaultProps",{adapter:Ie,locale:null,maxDate:null,minDate:null,onYearChange:function(){},overrides:{}});function St(t){"@babel/helpers - typeof";return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},St(t)}function Fe(){return Fe=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Fe.apply(this,arguments)}function Re(t,r){return Oa(t)||ba(t,r)||ma(t,r)||ga()}function ga(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
6
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ma(t,r){if(t){if(typeof t=="string")return wr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wr(t,r)}}function wr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function ba(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,s=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function Oa(t){if(Array.isArray(t))return t}function Sa(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Da(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function _a(t,r,n){return r&&Da(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $a(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&Dt(t,r)}function Dt(t,r){return Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},Dt(t,r)}function wa(t){var r=Pa();return function(){var a=Je(t),e;if(r){var o=Je(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return ka(this,e)}}function ka(t,r){if(r&&(St(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ue(t)}function ue(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Je(t){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Je(t)}function ce(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Vr=function(t){$a(n,t);var r=wa(n);function n(a){var e;return Sa(this,n),e=r.call(this,a),ce(ue(e),"dayElm",void 0),ce(ue(e),"state",{isHovered:!1,isFocusVisible:!1}),ce(ue(e),"dateHelpers",void 0),ce(ue(e),"getDateProp",function(){return e.props.date===void 0?e.dateHelpers.date():e.props.date}),ce(ue(e),"getMonthProp",function(){return e.props.month===void 0||e.props.month===null?e.dateHelpers.getMonth(e.getDateProp()):e.props.month}),ce(ue(e),"onSelect",function(o){var i=e.props,s=i.range,u=i.value,c;if(Array.isArray(u)&&s&&e.props.hasLockedBehavior){var h=e.props.value,d=null,m=null;e.props.selectedInput===_e.startDate?(d=o,m=Array.isArray(h)&&h[1]?h[1]:null):e.props.selectedInput===_e.endDate&&(d=Array.isArray(h)&&h[0]?h[0]:null,m=o),c=[d],m&&c.push(m)}else if(Array.isArray(u)&&s&&!e.props.hasLockedBehavior){var g=Re(u,2),y=g[0],b=g[1];!y&&!b||y&&b?c=[o,null]:!y&&b&&e.dateHelpers.isAfter(b,o)?c=[o,b]:!y&&b&&e.dateHelpers.isAfter(o,b)?c=[b,o]:y&&!b&&e.dateHelpers.isAfter(o,y)?c=[y,o]:c=[o,y]}else c=o;e.props.onSelect({date:c})}),ce(ue(e),"onKeyDown",function(o){var i=e.getDateProp(),s=e.props,u=s.highlighted,c=s.disabled;o.key==="Enter"&&u&&!c&&(o.preventDefault(),e.onSelect(i))}),ce(ue(e),"onClick",function(o){var i=e.getDateProp(),s=e.props.disabled;s||(e.props.onClick({event:o,date:i}),e.onSelect(i))}),ce(ue(e),"onFocus",function(o){Lr(o)&&e.setState({isFocusVisible:!0}),e.props.onFocus({event:o,date:e.getDateProp()})}),ce(ue(e),"onBlur",function(o){e.state.isFocusVisible!==!1&&e.setState({isFocusVisible:!1}),e.props.onBlur({event:o,date:e.getDateProp()})}),ce(ue(e),"onMouseOver",function(o){e.setState({isHovered:!0}),e.props.onMouseOver({event:o,date:e.getDateProp()})}),ce(ue(e),"onMouseLeave",function(o){e.setState({isHovered:!1}),e.props.onMouseLeave({event:o,date:e.getDateProp()})}),ce(ue(e),"isOutsideMonth",function(){var o=e.getMonthProp();return o!==void 0&&o!==e.dateHelpers.getMonth(e.getDateProp())}),ce(ue(e),"getOrderedDates",function(){var o=e.props,i=o.highlightedDate,s=o.value;if(!s||!Array.isArray(s)||!s[0]||!s[1]&&!i)return[];var u=s[0],c=s.length>1&&s[1]?s[1]:i;if(!u||!c)return[];var h=e.clampToDayStart(u),d=e.clampToDayStart(c);return e.dateHelpers.isAfter(h,d)?[d,h]:[h,d]}),ce(ue(e),"isOutsideOfMonthButWithinRange",function(){var o=e.clampToDayStart(e.getDateProp()),i=e.getOrderedDates();if(i.length<2||e.dateHelpers.isSameDay(i[0],i[1]))return!1;var s=e.dateHelpers.getDate(o);if(s>15){var u=e.clampToDayStart(e.dateHelpers.addDays(e.dateHelpers.getEndOfMonth(o),1));return e.dateHelpers.isOnOrBeforeDay(i[0],e.dateHelpers.getEndOfMonth(o))&&e.dateHelpers.isOnOrAfterDay(i[1],u)}else{var c=e.clampToDayStart(e.dateHelpers.subDays(e.dateHelpers.getStartOfMonth(o),1));return e.dateHelpers.isOnOrAfterDay(i[1],e.dateHelpers.getStartOfMonth(o))&&e.dateHelpers.isOnOrBeforeDay(i[0],c)}}),ce(ue(e),"clampToDayStart",function(o){var i=e.dateHelpers,s=i.setSeconds,u=i.setMinutes,c=i.setHours;return s(u(c(o,0),0),0)}),e.dateHelpers=new Ce(a.adapter),e}return _a(n,[{key:"componentDidMount",value:function(){this.dayElm&&this.props.focusedCalendar&&(this.props.highlighted||!this.props.highlightedDate&&this.isSelected())&&this.dayElm.focus()}},{key:"componentDidUpdate",value:function(e){this.dayElm&&this.props.focusedCalendar&&(this.props.highlighted||!this.props.highlightedDate&&this.isSelected())&&this.dayElm.focus()}},{key:"isSelected",value:function(){var e=this.getDateProp(),o=this.props.value;return Array.isArray(o)?this.dateHelpers.isSameDay(e,o[0])||this.dateHelpers.isSameDay(e,o[1]):this.dateHelpers.isSameDay(e,o)}},{key:"isPseudoSelected",value:function(){var e=this.getDateProp(),o=this.props.value;if(Array.isArray(o)){var i=Re(o,2),s=i[0],u=i[1];if(!s&&!u)return!1;if(s&&u)return this.dateHelpers.isDayInRange(this.clampToDayStart(e),this.clampToDayStart(s),this.clampToDayStart(u))}}},{key:"isPseudoHighlighted",value:function(){var e=this.getDateProp(),o=this.props,i=o.value,s=o.highlightedDate;if(Array.isArray(i)){var u=Re(i,2),c=u[0],h=u[1];if(!c&&!h)return!1;if(s&&c&&!h)return this.dateHelpers.isAfter(s,c)?this.dateHelpers.isDayInRange(this.clampToDayStart(e),this.clampToDayStart(c),this.clampToDayStart(s)):this.dateHelpers.isDayInRange(this.clampToDayStart(e),this.clampToDayStart(s),this.clampToDayStart(c));if(s&&!c&&h)return this.dateHelpers.isAfter(s,h)?this.dateHelpers.isDayInRange(this.clampToDayStart(e),this.clampToDayStart(h),this.clampToDayStart(s)):this.dateHelpers.isDayInRange(this.clampToDayStart(e),this.clampToDayStart(s),this.clampToDayStart(h))}}},{key:"getSharedProps",value:function(){var e=this.getDateProp(),o=this.props,i=o.value,s=o.highlightedDate,u=o.range,c=o.highlighted,h=o.peekNextMonth,d=c,m=this.isSelected(),g=!!(Array.isArray(i)&&u&&s&&(i[0]&&!i[1]&&!this.dateHelpers.isSameDay(i[0],s)||!i[0]&&i[1]&&!this.dateHelpers.isSameDay(i[1],s))),y=!h&&this.isOutsideMonth(),b=!!(Array.isArray(i)&&u&&y&&!h&&this.isOutsideOfMonthButWithinRange());return{$date:e,$density:this.props.density,$disabled:this.props.disabled,$endDate:Array.isArray(i)&&!!(i[0]&&i[1])&&u&&m&&this.dateHelpers.isSameDay(e,i[1])||!1,$hasDateLabel:!!this.props.dateLabel,$hasRangeHighlighted:g,$hasRangeOnRight:Array.isArray(i)&&g&&s&&(i[0]&&this.dateHelpers.isAfter(s,i[0])||i[1]&&this.dateHelpers.isAfter(s,i[1])),$hasRangeSelected:Array.isArray(i)?!!(i[0]&&i[1]):!1,$highlightedDate:s,$isHighlighted:d,$isHovered:this.state.isHovered,$isFocusVisible:this.state.isFocusVisible,$startOfMonth:this.dateHelpers.isStartOfMonth(e),$endOfMonth:this.dateHelpers.isEndOfMonth(e),$month:this.getMonthProp(),$outsideMonth:y,$outsideMonthWithinRange:b,$peekNextMonth:h,$pseudoHighlighted:u&&!d&&!m?this.isPseudoHighlighted():!1,$pseudoSelected:u&&!m?this.isPseudoSelected():!1,$range:u,$selected:m,$startDate:Array.isArray(i)&&i[0]&&i[1]&&u&&m?this.dateHelpers.isSameDay(e,i[0]):!1,$hasLockedBehavior:this.props.hasLockedBehavior,$selectedInput:this.props.selectedInput,$value:this.props.value}}},{key:"getAriaLabel",value:function(e,o){var i=this.getDateProp();return"".concat(e.$selected?e.$range?e.$endDate?o.datepicker.selectedEndDateLabel:o.datepicker.selectedStartDateLabel:o.datepicker.selectedLabel:e.$disabled?o.datepicker.dateNotAvailableLabel:o.datepicker.chooseLabel," ").concat(this.dateHelpers.format(i,"fullOrdinalWeek",this.props.locale),". ").concat(e.$disabled?"":o.datepicker.dateAvailableLabel)}},{key:"render",value:function(){var e=this,o=this.getDateProp(),i=this.props,s=i.peekNextMonth,u=i.overrides,c=u===void 0?{}:u,h=this.getSharedProps(),d=W(c.Day,nr),m=Re(d,2),g=m[0],y=m[1],b=W(c.DayLabel,ar),S=Re(b,2),$=S[0],_=S[1],k=this.props.dateLabel&&this.props.dateLabel(o);return!s&&h.$outsideMonth?O.createElement(g,Fe({role:"gridcell"},h,y,{onFocus:this.onFocus,onBlur:this.onBlur})):O.createElement(Ne.Consumer,null,function(w){return O.createElement(g,Fe({"aria-label":e.getAriaLabel(h,w),ref:function(A){e.dayElm=A},role:"gridcell","aria-roledescription":"button",tabIndex:e.props.highlighted||!e.props.highlightedDate&&e.isSelected()?0:-1},h,y,{onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onKeyDown:e.onKeyDown,onMouseOver:e.onMouseOver,onMouseLeave:e.onMouseLeave}),O.createElement("div",null,e.dateHelpers.getDate(o)),k?O.createElement($,Fe({},h,_),k):null)})}}]),n}(O.Component);ce(Vr,"defaultProps",{disabled:!1,highlighted:!1,range:!1,adapter:Ie,onClick:function(){},onSelect:function(){},onFocus:function(){},onBlur:function(){},onMouseOver:function(){},onMouseLeave:function(){},overrides:{},peekNextMonth:!0,value:null});function _t(t){"@babel/helpers - typeof";return _t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_t(t)}function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},$t.apply(this,arguments)}function Ma(t,r){return Aa(t)||Ha(t,r)||Ia(t,r)||Ca()}function Ca(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
7
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ia(t,r){if(t){if(typeof t=="string")return kr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kr(t,r)}}function kr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Ha(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,s=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function Aa(t){if(Array.isArray(t))return t}function Ea(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Ra(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function La(t,r,n){return r&&Ra(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ta(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&wt(t,r)}function wt(t,r){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},wt(t,r)}function xa(t){var r=Ba();return function(){var a=Ze(t),e;if(r){var o=Ze(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return ja(this,e)}}function ja(t,r){if(r&&(_t(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kt(t)}function kt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ba(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ze(t){return Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ze(t)}function Pt(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Yr=function(t){Ta(n,t);var r=xa(n);function n(a){var e;return Ea(this,n),e=r.call(this,a),Pt(kt(e),"dateHelpers",void 0),Pt(kt(e),"renderDays",function(){var o=e.dateHelpers.getStartOfWeek(e.props.date||e.dateHelpers.date(),e.props.locale),i=[];return i.concat(Fr.map(function(s){var u=e.dateHelpers.addDays(o,s);return O.createElement(Vr,{adapter:e.props.adapter,date:u,dateLabel:e.props.dateLabel,density:e.props.density,disabled:e.dateHelpers.isDayDisabled(u,e.props),excludeDates:e.props.excludeDates,filterDate:e.props.filterDate,highlightedDate:e.props.highlightedDate,highlighted:e.dateHelpers.isSameDay(u,e.props.highlightedDate),includeDates:e.props.includeDates,focusedCalendar:e.props.focusedCalendar,range:e.props.range,key:s,locale:e.props.locale,minDate:e.props.minDate,maxDate:e.props.maxDate,month:e.props.month,onSelect:e.props.onChange,onBlur:e.props.onDayBlur,onFocus:e.props.onDayFocus,onClick:e.props.onDayClick,onMouseOver:e.props.onDayMouseOver,onMouseLeave:e.props.onDayMouseLeave,overrides:e.props.overrides,peekNextMonth:e.props.peekNextMonth,value:e.props.value,hasLockedBehavior:e.props.hasLockedBehavior,selectedInput:e.props.selectedInput})}))}),e.dateHelpers=new Ce(a.adapter),e}return La(n,[{key:"render",value:function(){var e=this.props.overrides,o=e===void 0?{}:e,i=W(o.Week,rr),s=Ma(i,2),u=s[0],c=s[1];return O.createElement(u,$t({role:"row"},c),this.renderDays())}}]),n}(O.Component);Pt(Yr,"defaultProps",{adapter:Ie,highlightedDate:null,onDayClick:function(){},onDayFocus:function(){},onDayBlur:function(){},onDayMouseOver:function(){},onDayMouseLeave:function(){},onChange:function(){},overrides:{},peekNextMonth:!1});function Mt(t){"@babel/helpers - typeof";return Mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Mt(t)}function Fa(t,r){return Ya(t)||Va(t,r)||Wa(t,r)||Na()}function Na(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
8
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wa(t,r){if(t){if(typeof t=="string")return Pr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pr(t,r)}}function Pr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Va(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,s=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function Ya(t){if(Array.isArray(t))return t}function za(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function qa(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function Ua(t,r,n){return r&&qa(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ka(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&Ct(t,r)}function Ct(t,r){return Ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},Ct(t,r)}function Xa(t){var r=Ja();return function(){var a=Ge(t),e;if(r){var o=Ge(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return Qa(this,e)}}function Qa(t,r){if(r&&(Mt(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xe(t)}function xe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ja(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ge(t){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ge(t)}function je(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Za={dateLabel:null,density:le.high,excludeDates:null,filterDate:null,highlightDates:null,includeDates:null,locale:null,maxDate:null,minDate:null,month:null,adapter:Ie,onDayClick:function(){},onDayFocus:function(){},onDayBlur:function(){},onDayMouseOver:function(){},onDayMouseLeave:function(){},overrides:{},peekNextMonth:!1,value:null},Ga=6,zr=function(t){Ka(n,t);var r=Xa(n);function n(a){var e;return za(this,n),e=r.call(this,a),je(xe(e),"dateHelpers",void 0),je(xe(e),"getDateProp",function(){return e.props.date||e.dateHelpers.date()}),je(xe(e),"isWeekInMonth",function(o){var i=e.getDateProp(),s=e.dateHelpers.addDays(o,6);return e.dateHelpers.isSameMonth(o,i)||e.dateHelpers.isSameMonth(s,i)}),je(xe(e),"renderWeeks",function(){for(var o=[],i=e.dateHelpers.getStartOfWeek(e.dateHelpers.getStartOfMonth(e.getDateProp()),e.props.locale),s=0,u=!0;u||e.props.fixedHeight&&e.props.peekNextMonth&&s<Ga;)o.push(O.createElement(Yr,{adapter:e.props.adapter,date:i,dateLabel:e.props.dateLabel,density:e.props.density,excludeDates:e.props.excludeDates,filterDate:e.props.filterDate,highlightedDate:e.props.highlightedDate,includeDates:e.props.includeDates,focusedCalendar:e.props.focusedCalendar,range:e.props.range,key:s,locale:e.props.locale,minDate:e.props.minDate,maxDate:e.props.maxDate,month:e.dateHelpers.getMonth(e.getDateProp()),onDayBlur:e.props.onDayBlur,onDayFocus:e.props.onDayFocus,onDayClick:e.props.onDayClick,onDayMouseOver:e.props.onDayMouseOver,onDayMouseLeave:e.props.onDayMouseLeave,onChange:e.props.onChange,overrides:e.props.overrides,peekNextMonth:e.props.peekNextMonth,value:e.props.value,hasLockedBehavior:e.props.hasLockedBehavior,selectedInput:e.props.selectedInput})),s++,i=e.dateHelpers.addWeeks(i,1),u=e.isWeekInMonth(i);return o}),e.dateHelpers=new Ce(a.adapter),e}return Ua(n,[{key:"render",value:function(){var e=this.props.overrides,o=e===void 0?{}:e,i=W(o.Month,tr),s=Fa(i,2),u=s[0],c=s[1];return O.createElement(u,c,this.renderWeeks())}}]),n}(O.Component);je(zr,"defaultProps",Za);function It(t){"@babel/helpers - typeof";return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},It(t)}var eo=["overrides"];function to(t,r){if(t==null)return{};var n=ro(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function ro(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function Se(t,r){return oo(t)||ao(t,r)||qr(t,r)||no()}function no(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
9
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ao(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,s=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function oo(t){if(Array.isArray(t))return t}function ut(t){return lo(t)||so(t)||qr(t)||io()}function io(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
10
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qr(t,r){if(t){if(typeof t=="string")return Ht(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ht(t,r)}}function so(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function lo(t){if(Array.isArray(t))return Ht(t)}function Ht(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function De(){return De=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},De.apply(this,arguments)}function uo(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function co(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function po(t,r,n){return r&&co(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function fo(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&At(t,r)}function At(t,r){return At=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},At(t,r)}function ho(t){var r=vo();return function(){var a=et(t),e;if(r){var o=et(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return yo(this,e)}}function yo(t,r){if(r&&(It(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return J(t)}function J(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function et(t){return et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},et(t)}function Z(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Ur=function(t){fo(n,t);var r=ho(n);function n(a){var e;uo(this,n),e=r.call(this,a),Z(J(e),"dateHelpers",void 0),Z(J(e),"calendar",void 0),Z(J(e),"getDateInView",function(){var d=e.props,m=d.highlightedDate,g=d.value,y=e.dateHelpers.getEffectiveMinDate(e.props),b=e.dateHelpers.getEffectiveMaxDate(e.props),S=e.dateHelpers.date(),$=e.getSingleDate(g)||m;return $||(y&&e.dateHelpers.isBefore(S,y)?y:b&&e.dateHelpers.isAfter(S,b)?b:S)}),Z(J(e),"handleMonthChange",function(d){e.setHighlightedDate(e.dateHelpers.getStartOfMonth(d)),e.props.onMonthChange&&e.props.onMonthChange({date:d})}),Z(J(e),"handleYearChange",function(d){e.setHighlightedDate(d),e.props.onYearChange&&e.props.onYearChange({date:d})}),Z(J(e),"changeMonth",function(d){var m=d.date;e.setState({date:m},function(){return e.handleMonthChange(e.state.date)})}),Z(J(e),"changeYear",function(d){var m=d.date;e.setState({date:m},function(){return e.handleYearChange(e.state.date)})}),Z(J(e),"renderCalendarHeader",function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.state.date,m=arguments.length>1?arguments[1]:void 0;return O.createElement(Wr,De({},e.props,{key:"month-header-".concat(m),date:d,order:m,onMonthChange:e.changeMonth,onYearChange:e.changeYear}))}),Z(J(e),"onKeyDown",function(d){switch(d.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"Home":case"End":case"PageUp":case"PageDown":e.handleArrowKey(d.key),d.preventDefault(),d.stopPropagation();break}}),Z(J(e),"handleArrowKey",function(d){var m=e.state.highlightedDate,g=m,y=e.dateHelpers.date();switch(d){case"ArrowLeft":g=e.dateHelpers.subDays(g||y,1);break;case"ArrowRight":g=e.dateHelpers.addDays(g||y,1);break;case"ArrowUp":g=e.dateHelpers.subWeeks(g||y,1);break;case"ArrowDown":g=e.dateHelpers.addWeeks(g||y,1);break;case"Home":g=e.dateHelpers.getStartOfWeek(g||y);break;case"End":g=e.dateHelpers.getEndOfWeek(g||y);break;case"PageUp":g=e.dateHelpers.subMonths(g||y,1);break;case"PageDown":g=e.dateHelpers.addMonths(g||y,1);break}e.setState({highlightedDate:g,date:g})}),Z(J(e),"focusCalendar",function(){e.state.focused||e.setState({focused:!0})}),Z(J(e),"blurCalendar",function(){if(typeof document<"u"){var d=document.activeElement;e.calendar&&!e.calendar.contains(d)&&e.setState({focused:!1})}}),Z(J(e),"handleTabbing",function(d){if(typeof document<"u"&&d.keyCode===9){var m=document.activeElement,g=e.state.rootElement?e.state.rootElement.querySelectorAll('[tabindex="0"]'):null,y=g?g.length:0;d.shiftKey?g&&m===g[0]&&(d.preventDefault(),g[y-1].focus()):g&&m===g[y-1]&&(d.preventDefault(),g[0].focus())}}),Z(J(e),"onDayFocus",function(d){var m=d.date;e.setState({highlightedDate:m}),e.focusCalendar(),e.props.onDayFocus&&e.props.onDayFocus(d)}),Z(J(e),"onDayMouseOver",function(d){var m=d.date;e.setState({highlightedDate:m}),e.props.onDayMouseOver&&e.props.onDayMouseOver(d)}),Z(J(e),"onDayMouseLeave",function(d){var m=d.date,g=e.props.value,y=e.getSingleDate(g);e.setState({highlightedDate:y||m}),e.props.onDayMouseLeave&&e.props.onDayMouseLeave(d)}),Z(J(e),"handleDateChange",function(d){var m=e.props.onChange,g=m===void 0?function(k){}:m,y=d.date;if(Array.isArray(d.date)){var b=ut(e.state.time),S=d.date[0]?e.dateHelpers.applyDateToTime(b[0],d.date[0]):null,$=d.date[1]?e.dateHelpers.applyDateToTime(b[1],d.date[1]):null;b[0]=S,$?(y=[S,$],b[1]=$):y=[S],e.setState({time:b})}else if(!Array.isArray(e.props.value)&&d.date){var _=e.dateHelpers.applyDateToTime(e.state.time[0],d.date);y=_,e.setState({time:[_]})}g({date:y})}),Z(J(e),"handleTimeChange",function(d,m){var g=e.props.onChange,y=g===void 0?function(_){}:g,b=ut(e.state.time);if(b[m]=e.dateHelpers.applyTimeToDate(b[m],d),e.setState({time:b}),Array.isArray(e.props.value)){var S=e.props.value.map(function(_,k){return _&&m===k?e.dateHelpers.applyTimeToDate(_,d):_});y({date:[S[0],S[1]]})}else{var $=e.dateHelpers.applyTimeToDate(e.props.value,d);y({date:$})}}),Z(J(e),"renderMonths",function(d){for(var m=e.props,g=m.overrides,y=g===void 0?{}:g,b=m.orientation,S=[],$=W(y.CalendarContainer,Kt),_=Se($,2),k=_[0],w=_[1],j=W(y.MonthContainer,Ut),A=Se(j,2),T=A[0],F=A[1],I=0;I<(e.props.monthsShown||1);++I){var B=[],H=e.dateHelpers.addMonths(e.state.date,I),C="month-".concat(I);B.push(e.renderCalendarHeader(H,I)),B.push(O.createElement(k,De({key:C,ref:function(U){e.calendar=U},role:"grid","aria-roledescription":d.ariaRoleDescCalMonth,"aria-multiselectable":e.props.range||null,onKeyDown:e.onKeyDown},w,{$density:e.props.density}),O.createElement(zr,{adapter:e.props.adapter,date:H,dateLabel:e.props.dateLabel,density:e.props.density,excludeDates:e.props.excludeDates,filterDate:e.props.filterDate,highlightedDate:e.state.highlightedDate,includeDates:e.props.includeDates,focusedCalendar:e.state.focused,range:e.props.range,locale:e.props.locale,maxDate:e.props.maxDate,minDate:e.props.minDate,month:e.dateHelpers.getMonth(e.state.date),onDayBlur:e.blurCalendar,onDayFocus:e.onDayFocus,onDayClick:e.props.onDayClick,onDayMouseOver:e.onDayMouseOver,onDayMouseLeave:e.onDayMouseLeave,onChange:e.handleDateChange,overrides:y,value:e.props.value,peekNextMonth:e.props.peekNextMonth,fixedHeight:e.props.fixedHeight,hasLockedBehavior:!!e.props.hasLockedBehavior,selectedInput:e.props.selectedInput}))),S.push(O.createElement("div",{key:"month-component-".concat(I)},B))}return O.createElement(T,De({$orientation:b},F),S)}),Z(J(e),"renderTimeSelect",function(d,m,g){var y=e.props.overrides,b=y===void 0?{}:y,S=W(b.TimeSelectContainer,Xe),$=Se(S,2),_=$[0],k=$[1],w=W(b.TimeSelectFormControl,mt),j=Se(w,2),A=j[0],T=j[1],F=W(b.TimeSelect,sn),I=Se(F,2),B=I[0],H=I[1];return O.createElement(_,k,O.createElement(A,De({label:g},T),O.createElement(B,De({value:d&&e.dateHelpers.date(d),onChange:m,nullable:!0},H))))}),Z(J(e),"renderQuickSelect",function(){var d=e.props.overrides,m=d===void 0?{}:d,g=W(m.QuickSelectContainer,Xe),y=Se(g,2),b=y[0],S=y[1],$=W(m.QuickSelectFormControl,mt),_=Se($,2),k=_[0],w=_[1],j=W(m.QuickSelect,nn),A=Se(j,2),T=A[0],F=A[1],I=F.overrides,B=to(F,eo);if(!e.props.quickSelect)return null;var H=e.dateHelpers.set(e.dateHelpers.date(),{hours:12,minutes:0,seconds:0});return O.createElement(Ne.Consumer,null,function(C){return O.createElement(b,S,O.createElement(k,De({label:C.datepicker.quickSelectLabel},w),O.createElement(T,De({"aria-label":C.datepicker.quickSelectAriaLabel,labelKey:"id",onChange:function(U){U.option?(e.setState({quickSelectId:U.option.id}),e.props.onChange&&(e.props.range?e.props.onChange({date:[U.option.beginDate,U.option.endDate||H]}):e.props.onChange({date:U.option.beginDate}))):(e.setState({quickSelectId:null}),e.props.onChange&&e.props.onChange({date:[]})),e.props.onQuickSelectChange&&e.props.onQuickSelectChange(U.option)},options:e.props.quickSelectOptions||[{id:C.datepicker.pastWeek,beginDate:e.dateHelpers.subWeeks(H,1)},{id:C.datepicker.pastMonth,beginDate:e.dateHelpers.subMonths(H,1)},{id:C.datepicker.pastThreeMonths,beginDate:e.dateHelpers.subMonths(H,3)},{id:C.datepicker.pastSixMonths,beginDate:e.dateHelpers.subMonths(H,6)},{id:C.datepicker.pastYear,beginDate:e.dateHelpers.subYears(H,1)},{id:C.datepicker.pastTwoYears,beginDate:e.dateHelpers.subYears(H,2)}],placeholder:C.datepicker.quickSelectPlaceholder,value:e.state.quickSelectId&&[{id:e.state.quickSelectId}],overrides:xr({Dropdown:{style:{textAlign:"start"}}},I)},B))))})});var o=e.props,i=o.highlightedDate,s=o.value,u=o.adapter;e.dateHelpers=new Ce(u);var c=e.getDateInView(),h=[];return Array.isArray(s)?h=ut(s):s&&(h=[s]),e.state={highlightedDate:e.getSingleDate(s)||(i&&e.dateHelpers.isSameMonth(c,i)?i:e.dateHelpers.date()),focused:!1,date:c,quickSelectId:null,rootElement:null,time:h},e}return po(n,[{key:"componentDidMount",value:function(){this.props.autoFocusCalendar&&this.focusCalendar()}},{key:"componentDidUpdate",value:function(e){if(this.props.highlightedDate&&!this.dateHelpers.isSameDay(this.props.highlightedDate,e.highlightedDate)&&this.setState({date:this.props.highlightedDate}),this.props.autoFocusCalendar&&this.props.autoFocusCalendar!==e.autoFocusCalendar&&this.focusCalendar(),e.value!==this.props.value){var o=this.getDateInView();this.isInView(o)||this.setState({date:o})}}},{key:"isInView",value:function(e){var o=this.state.date,i=this.dateHelpers.getYear(e)-this.dateHelpers.getYear(o),s=i*12+this.dateHelpers.getMonth(e)-this.dateHelpers.getMonth(o);return s>=0&&s<(this.props.monthsShown||1)}},{key:"getSingleDate",value:function(e){return Array.isArray(e)?e[0]||null:e}},{key:"setHighlightedDate",value:function(e){var o=this.props.value,i=this.getSingleDate(o),s;i&&this.dateHelpers.isSameMonth(i,e)&&this.dateHelpers.isSameYear(i,e)?s={highlightedDate:i}:s={highlightedDate:e},this.setState(s)}},{key:"render",value:function(){var e=this,o=this.props.overrides,i=o===void 0?{}:o,s=W(i.Root,qt),u=Se(s,2),c=u[0],h=u[1],d=[].concat(this.props.value),m=Se(d,2),g=m[0],y=m[1];return O.createElement(Ne.Consumer,null,function(b){return O.createElement(c,De({$density:e.props.density,"data-baseweb":"calendar",role:"application","aria-roledescription":"datepicker",ref:function($){$&&$ instanceof HTMLElement&&!e.state.rootElement&&e.setState({rootElement:$})},"aria-label":b.datepicker.ariaLabelCalendar,onKeyDown:e.props.trapTabbing?e.handleTabbing:null},h),e.renderMonths({ariaRoleDescCalMonth:b.datepicker.ariaRoleDescriptionCalendarMonth}),e.props.timeSelectStart&&e.renderTimeSelect(g,function(S){return e.handleTimeChange(S,0)},b.datepicker.timeSelectStartLabel),e.props.timeSelectEnd&&e.props.range&&e.renderTimeSelect(y,function(S){return e.handleTimeChange(S,1)},b.datepicker.timeSelectEndLabel),e.renderQuickSelect())})}}]),n}(O.Component);Z(Ur,"defaultProps",{autoFocusCalendar:!1,dateLabel:null,density:le.default,excludeDates:null,filterDate:null,highlightedDate:null,includeDates:null,range:!1,locale:null,maxDate:null,minDate:null,onDayClick:function(){},onDayFocus:function(){},onDayMouseOver:function(){},onDayMouseLeave:function(){},onMonthChange:function(){},onYearChange:function(){},onChange:function(){},orientation:Tt.horizontal,overrides:{},peekNextMonth:!1,adapter:Ie,value:null,trapTabbing:!1});function ct(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.replace(/\${(.*?)}/g,function(n,a){return r[a]===void 0?"${"+a+"}":r[a]})}function Et(t){"@babel/helpers - typeof";return Et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Et(t)}function Pe(){return Pe=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Pe.apply(this,arguments)}function Mr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Cr(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Mr(Object(n),!0).forEach(function(a){de(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function dt(t){return bo(t)||mo(t)||Kr(t)||go()}function go(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
11
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mo(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bo(t){if(Array.isArray(t))return Lt(t)}function Oo(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function So(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function Do(t,r,n){return r&&So(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _o(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&Rt(t,r)}function Rt(t,r){return Rt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},Rt(t,r)}function $o(t){var r=ko();return function(){var a=tt(t),e;if(r){var o=tt(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return wo(this,e)}}function wo(t,r){if(r&&(Et(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pe(t)}function pe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ko(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function tt(t){return tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},tt(t)}function de(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function Oe(t,r){return Co(t)||Mo(t,r)||Kr(t,r)||Po()}function Po(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kr(t,r){if(t){if(typeof t=="string")return Lt(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lt(t,r)}}function Lt(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Mo(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,s=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function Co(t){if(Array.isArray(t))return t}var ze="yyyy/MM/dd",ge="–",Io=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,e=r,o=n.split(" ".concat(ge," ")),i=Oe(o,2),s=i[0],u=s===void 0?"":s,c=i[1],h=c===void 0?"":c;return a===_e.startDate&&h&&(e="".concat(e," ").concat(ge," ").concat(h)),a===_e.endDate&&(e="".concat(u," ").concat(ge," ").concat(e)),e},Ho=function(t){_o(n,t);var r=$o(n);function n(a){var e;return Oo(this,n),e=r.call(this,a),de(pe(e),"calendar",void 0),de(pe(e),"dateHelpers",void 0),de(pe(e),"handleChange",function(o){var i=e.props.onChange,s=e.props.onRangeChange;Array.isArray(o)?(i&&o.every(Boolean)&&i({date:o}),s&&s({date:dt(o)})):(i&&i({date:o}),s&&s({date:o}))}),de(pe(e),"onCalendarSelect",function(o){var i=!1,s=!1,u=!1,c=o.date;if(Array.isArray(c)&&e.props.range){if(!c[0]||!c[1])i=!0,s=!0,u=null;else if(c[0]&&c[1]){var h=c,d=Oe(h,2),m=d[0],g=d[1];e.dateHelpers.isAfter(m,g)?e.hasLockedBehavior()?(c=e.props.value,i=!0):c=[m,m]:e.dateHelpers.dateRangeIncludesDates(c,e.props.excludeDates)&&(c=e.props.value,i=!0),e.state.lastActiveElm&&e.state.lastActiveElm.focus()}}else e.state.lastActiveElm&&e.state.lastActiveElm.focus();var y=function($,_){if(!$||!_)return!1;var k=e.dateHelpers.format($,"keyboardDate"),w=e.dateHelpers.format(_,"keyboardDate");return k===w?e.dateHelpers.getHours($)!==e.dateHelpers.getHours(_)||e.dateHelpers.getMinutes($)!==e.dateHelpers.getMinutes(_):!1},b=e.props.value;Array.isArray(c)&&Array.isArray(b)?c.some(function(S,$){return y(b[$],S)})&&(i=!0):!Array.isArray(c)&&!Array.isArray(b)&&y(b,c)&&(i=!0),e.setState(Cr(Cr({isOpen:i,isPseudoFocused:s},u===null?{}:{calendarFocused:u}),{},{inputValue:e.formatDisplayValue(c)})),e.handleChange(c)}),de(pe(e),"formatDisplayValue",function(o){var i=e.props,s=i.displayValueAtRangeIndex,u=i.formatDisplayValue;i.range;var c=e.normalizeDashes(e.props.formatString);if(typeof s=="number"&&o&&Array.isArray(o)){var h=o[s];return u?u(h,c):e.formatDate(h,c)}return u?u(o,c):e.formatDate(o,c)}),de(pe(e),"open",function(o){e.setState({isOpen:!0,isPseudoFocused:!0,calendarFocused:!1,selectedInput:o},e.props.onOpen)}),de(pe(e),"close",function(){var o=!1;e.setState({isOpen:!1,selectedInput:null,isPseudoFocused:o,calendarFocused:!1},e.props.onClose)}),de(pe(e),"handleEsc",function(){e.state.lastActiveElm&&e.state.lastActiveElm.focus(),e.close()}),de(pe(e),"handleInputBlur",function(){e.state.isPseudoFocused||e.close()}),de(pe(e),"getMask",function(){var o=e.props,i=o.formatString,s=o.mask,u=o.range,c=o.separateRangeInputs;return s===null||s===void 0&&i!==ze?null:s?e.normalizeDashes(s):u&&!c?"9999/99/99 ".concat(ge," 9999/99/99"):"9999/99/99"}),de(pe(e),"handleInputChange",function(o,i){var s=e.props.range&&e.props.separateRangeInputs?Io(o.currentTarget.value,e.state.inputValue,i):o.currentTarget.value,u=e.getMask(),c=e.normalizeDashes(e.props.formatString);(typeof u=="string"&&s===u.replace(/9/g," ")||s.length===0)&&(e.props.range?e.handleChange([]):e.handleChange(null)),e.setState({inputValue:s});var h=function(U){return c===ze?e.dateHelpers.parse(U,"slashDate",e.props.locale):e.dateHelpers.parseString(U,c,e.props.locale)};if(e.props.range&&typeof e.props.displayValueAtRangeIndex!="number"){var d=e.normalizeDashes(s).split(" ".concat(ge," ")),m=Oe(d,2),g=m[0],y=m[1],b=e.dateHelpers.date(g),S=e.dateHelpers.date(y);c&&(b=h(g),S=h(y));var $=e.dateHelpers.isValid(b)&&e.dateHelpers.isValid(S),_=e.dateHelpers.isAfter(S,b)||e.dateHelpers.isEqual(b,S);$&&_&&e.handleChange([b,S])}else{var k=e.normalizeDashes(s),w=e.dateHelpers.date(k),j=e.props.formatString;k.replace(/(\s)*/g,"").length<j.replace(/(\s)*/g,"").length?w=null:w=h(k);var A=e.props,T=A.displayValueAtRangeIndex,F=A.range,I=A.value;if(w&&e.dateHelpers.isValid(w))if(F&&Array.isArray(I)&&typeof T=="number"){var B=Oe(I,2),H=B[0],C=B[1];T===0?(H=w,C?e.dateHelpers.isAfter(C,H)||e.dateHelpers.isEqual(H,C)?e.handleChange([H,C]):e.handleChange(dt(I)):e.handleChange([H])):T===1&&(C=w,H?e.dateHelpers.isAfter(C,H)||e.dateHelpers.isEqual(H,C)?e.handleChange([H,C]):e.handleChange(dt(I)):e.handleChange([C,C]))}else e.handleChange(w)}}),de(pe(e),"handleKeyDown",function(o){!e.state.isOpen&&o.keyCode===40?e.open():e.state.isOpen&&o.key==="ArrowDown"?(o.preventDefault(),e.focusCalendar()):e.state.isOpen&&o.keyCode===9&&e.close()}),de(pe(e),"focusCalendar",function(){if(typeof document<"u"){var o=document.activeElement;e.setState({calendarFocused:!0,lastActiveElm:o})}}),de(pe(e),"normalizeDashes",function(o){return o.replace(/-/g,ge).replace(/—/g,ge)}),de(pe(e),"hasLockedBehavior",function(){return e.props.rangedCalendarBehavior===jn.locked&&e.props.range&&e.props.separateRangeInputs}),e.dateHelpers=new Ce(a.adapter),e.state={calendarFocused:!1,isOpen:!1,selectedInput:null,isPseudoFocused:!1,lastActiveElm:null,inputValue:e.formatDisplayValue(a.value)||""},e}return Do(n,[{key:"getNullDatePlaceholder",value:function(e){return(this.getMask()||e).split(ge)[0].replace(/[0-9]|[a-z]/g," ")}},{key:"formatDate",value:function(e,o){var i=this,s=function(d){return o===ze?i.dateHelpers.format(d,"slashDate",i.props.locale):i.dateHelpers.formatDate(d,o,i.props.locale)};if(e){if(Array.isArray(e)&&!e[0]&&!e[1])return"";if(Array.isArray(e)&&!e[0]&&e[1]){var u=s(e[1]),c=this.getNullDatePlaceholder(o);return[c,u].join(" ".concat(ge," "))}else return Array.isArray(e)?e.map(function(h){return h?s(h):""}).join(" ".concat(ge," ")):s(e)}else return""}},{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.setState({inputValue:this.formatDisplayValue(this.props.value)})}},{key:"renderInputComponent",value:function(e,o){var i=this,s=this.props.overrides,u=s===void 0?{}:s,c=W(u.Input,Br),h=Oe(c,2),d=h[0],m=h[1],g=this.props.placeholder||this.props.placeholder===""?this.props.placeholder:this.props.range&&!this.props.separateRangeInputs?"YYYY/MM/DD ".concat(ge," YYYY/MM/DD"):"YYYY/MM/DD",y=(this.state.inputValue||"").split(" ".concat(ge," ")),b=Oe(y,2),S=b[0],$=S===void 0?"":S,_=b[1],k=_===void 0?"":_,w=o===_e.startDate?$:o===_e.endDate?k:this.state.inputValue;return O.createElement(d,Pe({"aria-disabled":this.props.disabled,"aria-label":this.props["aria-label"]||(this.props.range?e.datepicker.ariaLabelRange:e.datepicker.ariaLabel),error:this.props.error,positive:this.props.positive,"aria-describedby":this.props["aria-describedby"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":this.props.required||null,disabled:this.props.disabled,size:this.props.size,value:w,onFocus:function(){return i.open(o)},onBlur:this.handleInputBlur,onKeyDown:this.handleKeyDown,onChange:function(A){return i.handleInputChange(A,o)},placeholder:g,mask:this.getMask(),required:this.props.required,clearable:this.props.clearable},m))}},{key:"render",value:function(){var e=this,o=this.props,i=o.overrides,s=i===void 0?{}:i,u=o.startDateLabel,c=u===void 0?"Start Date":u,h=o.endDateLabel,d=h===void 0?"End Date":h,m=W(s.Popover,Tr),g=Oe(m,2),y=g[0],b=g[1],S=W(s.InputWrapper,Wt),$=Oe(S,2),_=$[0],k=$[1],w=W(s.StartDate,Yt),j=Oe(w,2),A=j[0],T=j[1],F=W(s.EndDate,zt),I=Oe(F,2),B=I[0],H=I[1],C=W(s.InputLabel,Vt),R=Oe(C,2),U=R[0],ve=R[1];return O.createElement(Ne.Consumer,null,function(oe){return O.createElement(O.Fragment,null,O.createElement(y,Pe({accessibilityType:on.none,focusLock:!1,autoFocus:!1,mountNode:e.props.mountNode,placement:an.bottom,isOpen:e.state.isOpen,onClickOutside:e.close,onEsc:e.handleEsc,content:O.createElement(Ur,Pe({adapter:e.props.adapter,autoFocusCalendar:e.state.calendarFocused,trapTabbing:!0,value:e.props.value},e.props,{onChange:e.onCalendarSelect,selectedInput:e.state.selectedInput,hasLockedBehavior:e.hasLockedBehavior()}))},b),O.createElement(_,Pe({},k,{$separateRangeInputs:e.props.range&&e.props.separateRangeInputs}),e.props.range&&e.props.separateRangeInputs?O.createElement(O.Fragment,null,O.createElement(A,T,O.createElement(U,ve,c),e.renderInputComponent(oe,_e.startDate)),O.createElement(B,H,O.createElement(U,ve,d),e.renderInputComponent(oe,_e.endDate))):O.createElement(O.Fragment,null,e.renderInputComponent(oe)))),O.createElement("p",{id:e.props["aria-describedby"],style:{position:"fixed",width:"0px",height:"0px",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(100%)"}},oe.datepicker.screenReaderMessageInput),O.createElement("p",{"aria-live":"assertive",style:{position:"fixed",width:"0px",height:"0px",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(100%)"}},!e.props.value||Array.isArray(e.props.value)&&!e.props.value[0]&&!e.props.value[1]?"":Array.isArray(e.props.value)?e.props.value[0]&&e.props.value[1]?ct(oe.datepicker.selectedDateRange,{startDate:e.formatDisplayValue(e.props.value[0]),endDate:e.formatDisplayValue(e.props.value[1])}):"".concat(ct(oe.datepicker.selectedDate,{date:e.formatDisplayValue(e.props.value[0])})," ").concat(oe.datepicker.selectSecondDatePrompt):ct(oe.datepicker.selectedDate,{date:e.state.inputValue||""})))})}}]),n}(O.Component);de(Ho,"defaultProps",{"aria-describedby":"datepicker--screenreader--message--input",value:null,formatString:ze,adapter:Ie});const Ao={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Eo=(t,r,n)=>{let a;const e=Ao[t];return typeof e=="string"?a=e:r===1?a=e.one:a=e.other.replace("{{count}}",r.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function pt(t){return(r={})=>{const n=r.width?String(r.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Ro={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lo={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},To={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xo={date:pt({formats:Ro,defaultWidth:"full"}),time:pt({formats:Lo,defaultWidth:"full"}),dateTime:pt({formats:To,defaultWidth:"full"})},jo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Bo=(t,r,n,a)=>jo[t];function Le(t){return(r,n)=>{const a=n?.context?String(n.context):"standalone";let e;if(a==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,s=n?.width?String(n.width):i;e=t.formattingValues[s]||t.formattingValues[i]}else{const i=t.defaultWidth,s=n?.width?String(n.width):t.defaultWidth;e=t.values[s]||t.values[i]}const o=t.argumentCallback?t.argumentCallback(r):r;return e[o]}}const Fo={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},No={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wo={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Vo={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Yo={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},zo={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},qo=(t,r)=>{const n=Number(t),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Uo={ordinalNumber:qo,era:Le({values:Fo,defaultWidth:"wide"}),quarter:Le({values:No,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Le({values:Wo,defaultWidth:"wide"}),day:Le({values:Vo,defaultWidth:"wide"}),dayPeriod:Le({values:Yo,defaultWidth:"wide",formattingValues:zo,defaultFormattingWidth:"wide"})};function Te(t){return(r,n={})=>{const a=n.width,e=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],o=r.match(e);if(!o)return null;const i=o[0],s=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Xo(s,d=>d.test(i)):Ko(s,d=>d.test(i));let c;c=t.valueCallback?t.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;const h=r.slice(i.length);return{value:c,rest:h}}}function Ko(t,r){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r(t[n]))return n}function Xo(t,r){for(let n=0;n<t.length;n++)if(r(t[n]))return n}function Qo(t){return(r,n={})=>{const a=r.match(t.matchPattern);if(!a)return null;const e=a[0],o=r.match(t.parsePattern);if(!o)return null;let i=t.valueCallback?t.valueCallback(o[0]):o[0];i=n.valueCallback?n.valueCallback(i):i;const s=r.slice(e.length);return{value:i,rest:s}}}const Jo=/^(\d+)(th|st|nd|rd)?/i,Zo=/\d+/i,Go={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ei={any:[/^b/i,/^(a|c)/i]},ti={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ri={any:[/1/i,/2/i,/3/i,/4/i]},ni={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ai={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},oi={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ii={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},si={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},li={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ui={ordinalNumber:Qo({matchPattern:Jo,parsePattern:Zo,valueCallback:t=>parseInt(t,10)}),era:Te({matchPatterns:Go,defaultMatchWidth:"wide",parsePatterns:ei,defaultParseWidth:"any"}),quarter:Te({matchPatterns:ti,defaultMatchWidth:"wide",parsePatterns:ri,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Te({matchPatterns:ni,defaultMatchWidth:"wide",parsePatterns:ai,defaultParseWidth:"any"}),day:Te({matchPatterns:oi,defaultMatchWidth:"wide",parsePatterns:ii,defaultParseWidth:"any"}),dayPeriod:Te({matchPatterns:si,defaultMatchWidth:"any",parsePatterns:li,defaultParseWidth:"any"})},ft={code:"en-US",formatDistance:Eo,formatLong:xo,formatRelative:Bo,localize:Uo,match:ui,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ir=t=>t?.getWeekInfo?.()??t?.weekInfo??null,hi=t=>{const r=O.useMemo(()=>{try{return Ir(new Intl.Locale(t))}catch{return Ir(new Intl.Locale("en-US"))}},[t]);if(!r)return ft;const n=r.firstDay===7?0:r.firstDay;return{...ft,options:{...ft.options,weekStartsOn:n}}};export{le as D,Ho as a,ft as e,hi as u};
|
streamlit/static/static/js/{useTextInputAutoExpand.4u3_GcuN.js → useTextInputAutoExpand.QepX7n8Y.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{am as v,s as j,at as $,r as s,v as A,au as F,g as N}from"./index.DMxc2XFp.js";import{a as z,b as B,c as R,B as C}from"./base-input.o9tL8MDP.js";function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var O=v("div",function(e){return l(l({},z(l(l({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})});O.displayName="StyledTextAreaRoot";O.displayName="StyledTextAreaRoot";var _=v("div",function(e){return B(l({$positive:!1},e))});_.displayName="StyledTextareaContainer";_.displayName="StyledTextareaContainer";var S=v("textarea",function(e){return l(l({},R(e)),{},{resize:e.$resize||"none"})});S.displayName="StyledTextarea";S.displayName="StyledTextarea";function g(e){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(e)}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(this,arguments)}function K(e,t){return q(e)||L(e,t)||U(e,t)||M()}function M(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U(e,t){if(e){if(typeof e=="string")return P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(e,t)}}function P(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function L(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,u;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,u=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw u}}return n}}function q(e){if(Array.isArray(e))return e}function V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function W(e,t,r){return t&&G(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function X(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},m(e,t)}function Y(e){var t=J();return function(){var n=d(e),o;if(t){var i=d(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Z(this,o)}}function Z(e,t){if(t&&(g(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function f(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},d(e)}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Q=function(e){X(r,e);var t=Y(r);function r(){var n;V(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),p(f(n),"state",{isFocused:n.props.autoFocus||!1}),p(f(n),"onFocus",function(u){n.setState({isFocused:!0}),n.props.onFocus(u)}),p(f(n),"onBlur",function(u){n.setState({isFocused:!1}),n.props.onBlur(u)}),n}return W(r,[{key:"render",value:function(){var o=this.props.overrides,i=o===void 0?{}:o,a=j(i.Root,O),u=K(a,2),c=u[0],h=u[1],b=$({Input:{component:S},InputContainer:{component:_}},i);return s.createElement(c,y({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},h),s.createElement(C,y({},this.props,{type:F.textarea,overrides:b,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}]),r}(s.Component);p(Q,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:A.default});const k=6.5,T=1,ee=e=>{let t=0;const{current:r}=e;return r&&(r.style.height="auto",t=r.scrollHeight,r.style.height=""),t},te=(e,t,r)=>e>0&&r.current?Math.abs(e-t)>T:!1,re=(e,t)=>{if(e.current&&t.current){const{offsetHeight:r}=e.current;t.current.minHeight=r,t.current.maxHeight=r*k}},ne=(e,t,r)=>e?`${t+T}px`:r?String(r):"",oe=e=>e?`${e}px`:"",ue=({textareaRef:e,dependencies:t=[]})=>{const r=N(),n=s.useRef({minHeight:0,maxHeight:0}),[o,i]=s.useState(0),[a,u]=s.useState(!1),c=s.useCallback(()=>{i(ee(e))},[e,i]),h=s.useCallback(()=>{i(0)},[i]);s.useLayoutEffect(()=>{e.current&&re(e,n)},[e]),s.useLayoutEffect(()=>{const{minHeight:H}=n.current;u(te(o,H,e))},[o,e]),s.useLayoutEffect(()=>{c()},[e,c,...t]);const{maxHeight:b}=n.current,x=r.sizes.minElementHeight,E=ne(a,o,x),I=oe(b);return{isExtended:a,height:E,maxHeight:I,updateScrollHeight:c,clearScrollHeight:h}};export{Q as T,ue as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,aa as p}from"./index.DMxc2XFp.js";import{i as b}from"./inputUtils.CptNuJwn.js";function i({formId:r,maxChars:s,setDirty:n,setUiValue:e,setValueWithSource:f,additionalAction:t}){return o.useCallback(u=>{const{value:a}=u.target;s!==0&&a.length>s||(n(!0),e(a),p({formId:r})&&f({value:a,fromUi:!0}),t&&t())},[r,s,n,e,f,t])}function F(r,s,n,e,f,t=!1){return o.useCallback(u=>{const a=t?u.metaKey||u.ctrlKey:!0;!b(u)||!a||(u.preventDefault(),n&&s(),e.allowFormEnterToSubmit(r)&&e.submitForm(r,f))},[r,f,n,s,e,t])}function K(r,s,n,e){o.useEffect(()=>{e||r!==s&&n(r)},[r,s,e,n])}export{i as a,F as b,K as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as Z,r as i,aL as M,aI as $,aM as I}from"./index.DMxc2XFp.js";async function q(l,e=16e3){if(!l||l.size===0)throw new Error("Invalid or empty blob provided");if(!window.AudioContext)throw new Error("AudioContext not supported in this browser");const o=new AudioContext;try{const n=await l.arrayBuffer(),r=await o.decodeAudioData(n),d=e??r.sampleRate,s=await J(r,d);return K(s,d)}finally{o.close()}}async function J(l,e){const{duration:o,numberOfChannels:n,sampleRate:r}=l,d=Math.ceil(o*e);if(!window.OfflineAudioContext)throw new Error("OfflineAudioContext not supported");const s=new OfflineAudioContext(1,d,e),p=s.createBufferSource();if(p.buffer=l,n>1){const h=s.createChannelSplitter(n),m=s.createChannelMerger(1);p.connect(h);for(let c=0;c<n;c++){const u=s.createGain();u.gain.value=1/n,h.connect(u,c),u.connect(m,0,0)}m.connect(s.destination)}else p.connect(s.destination);p.start(0);try{return await s.startRendering()}catch(h){throw new Error(`Failed to resample audio from ${r}Hz to ${e}Hz: ${h instanceof Error?h.message:String(h)}`)}}function K(l,e){const n=l.length,r=n*2+44,d=new ArrayBuffer(r),s=new DataView(d),p=l.getChannelData(0),h=(c,u)=>{for(let y=0;y<u.length;y++)s.setUint8(c+y,u.charCodeAt(y))};h(0,"RIFF"),s.setUint32(4,r-8,!0),h(8,"WAVE"),h(12,"fmt "),s.setUint32(16,16,!0),s.setUint16(20,1,!0),s.setUint16(22,1,!0),s.setUint32(24,e,!0),s.setUint32(28,e*2,!0),s.setUint16(32,2,!0),s.setUint16(34,16,!0),h(36,"data"),s.setUint32(40,n*2,!0);let m=44;for(let c=0;c<n;c++){const u=Math.max(-1,Math.min(1,p[c]));s.setInt16(m,u*32767,!0),m+=2}return new Blob([d],{type:"audio/wav"})}class O{constructor(){this.wavesurfer=null,this.currentBlobUrl=null,this.events={},this.isPlaying=!1}initialize(e){this.wavesurfer=e,this.setupEventListeners()}setupEventListeners(){this.wavesurfer&&(this.teardownEventListeners(),this.handleTimeUpdate=e=>{this.events.onTimeUpdate?.(e*1e3)},this.handlePause=()=>{this.isPlaying=!1,this.events.onPause?.()},this.handlePlay=()=>{this.isPlaying=!0,this.events.onPlay?.()},this.handleFinish=()=>{this.isPlaying=!1,this.events.onFinish?.()},this.handleReady=()=>{this.events.onReady?.()},this.handleError=e=>{const o=e instanceof Error?e:new Error(String(e));this.events.onError?.(o)},this.wavesurfer.on("timeupdate",this.handleTimeUpdate),this.wavesurfer.on("pause",this.handlePause),this.wavesurfer.on("play",this.handlePlay),this.wavesurfer.on("finish",this.handleFinish),this.wavesurfer.on("ready",this.handleReady),this.wavesurfer.on("error",this.handleError))}setEventHandlers(e){this.events=e}async load(e){if(!this.wavesurfer)throw new Error("WaveSurfer not initialized");this.cleanupPreviousUrl();let o,n=null;try{if(e instanceof Blob)n=URL.createObjectURL(e),o=n;else if(e instanceof ArrayBuffer){const r=new Blob([e]);n=URL.createObjectURL(r),o=n}else o=e;this.currentBlobUrl=n,await this.wavesurfer.load(o)}catch(r){throw this.cleanupPreviousUrl(),r}}async play(){if(!this.wavesurfer)throw new Error("WaveSurfer not initialized");await this.wavesurfer.play()}pause(){this.wavesurfer&&this.wavesurfer.pause()}getDuration(){return this.wavesurfer?this.wavesurfer.getDuration()*1e3:0}getCurrentTime(){return this.wavesurfer?this.wavesurfer.getCurrentTime()*1e3:0}getIsPlaying(){return this.isPlaying}seekToStart(){this.wavesurfer&&this.wavesurfer.seekTo(0)}cleanupPreviousUrl(){this.currentBlobUrl&&(URL.revokeObjectURL(this.currentBlobUrl),this.currentBlobUrl=null)}destroy(){this.pause(),this.cleanupPreviousUrl(),this.wavesurfer&&(this.teardownEventListeners(),this.wavesurfer.empty(),this.wavesurfer=null),this.events={},this.isPlaying=!1,this.handleTimeUpdate=void 0,this.handlePause=void 0,this.handlePlay=void 0,this.handleFinish=void 0,this.handleReady=void 0,this.handleError=void 0}teardownEventListeners(){this.wavesurfer&&(this.handleTimeUpdate&&(this.wavesurfer.un("timeupdate",this.handleTimeUpdate),this.handleTimeUpdate=void 0),this.handlePause&&(this.wavesurfer.un("pause",this.handlePause),this.handlePause=void 0),this.handlePlay&&(this.wavesurfer.un("play",this.handlePlay),this.handlePlay=void 0),this.handleFinish&&(this.wavesurfer.un("finish",this.handleFinish),this.handleFinish=void 0),this.handleReady&&(this.wavesurfer.un("ready",this.handleReady),this.handleReady=void 0),this.handleError&&(this.wavesurfer.un("error",this.handleError),this.handleError=void 0))}}function W(l){return l.name==="NotAllowedError"||l.name==="PermissionDeniedError"||l.message?.toLowerCase().includes("permission denied")}class Q{constructor(e={}){this.wavesurfer=null,this.recordPlugin=null,this.isRecording=!1,this.recordEndResolve=null,this.recordEndReject=null,this.events={},this.options=e}initialize(e,o){this.wavesurfer=e;try{const n={renderRecordedAudio:!1,mimeType:"audio/webm"};this.recordPlugin=e.registerPlugin(o.create(n)),this.setupEventListeners()}catch(n){const r=n instanceof Error?n:new Error(String(n));throw W(r)?(this.events.onPermissionDenied?.(),new Error("Microphone permission denied")):(this.events.onError?.(r),r)}}setupEventListeners(){this.recordPlugin&&(this.recordPlugin.on("record-start",()=>{this.isRecording=!0,this.events.onRecordStart?.()}),this.recordPlugin.on("record-end",e=>{this.isRecording=!1,this.events.onRecordEnd?.(e),this.recordEndResolve&&e&&e.size>0?(this.recordEndResolve(e),this.recordEndResolve=null,this.recordEndReject=null):this.recordEndReject?(this.recordEndReject(new Error("Invalid or empty recording")),this.recordEndResolve=null,this.recordEndReject=null):(this.recordEndResolve=null,this.recordEndReject=null)}),this.recordPlugin.on("record-progress",e=>{this.events.onRecordProgress?.(e)}))}setEventHandlers(e){this.events=e}async startRecording(){if(!this.recordPlugin)throw new Error("Record plugin not initialized");if(this.isRecording)return;const e=typeof this.options.sampleRate=="number"?this.options.sampleRate:void 0,o={};e!==void 0&&(o.sampleRate={ideal:e}),await this.startRecordingWithConstraints(o,e!==void 0)}async startRecordingWithConstraints(e,o){if(!this.recordPlugin)throw new Error("Record plugin not initialized");try{const n=Object.keys(e).length?e:void 0;await this.recordPlugin.startRecording(n)}catch(n){const r=n instanceof Error?n:new Error(String(n));if(W(r))throw this.events.onPermissionDenied?.(),new Error("Microphone permission denied");if(o&&(r.name==="OverconstrainedError"||r.name==="NotReadableError")){this.options.sampleRate=void 0,await this.startRecordingWithConstraints({},!1);return}throw this.events.onError?.(r),r}}async stopRecording(){if(!this.recordPlugin||!this.isRecording)throw new Error("Not currently recording");try{return new Promise((e,o)=>{this.recordEndResolve=e,this.recordEndReject=o,this.recordPlugin?.stopRecording()})}catch(e){const o=e instanceof Error?e:new Error(String(e));throw this.events.onError?.(o),o}}cancelRecording(){this.recordPlugin&&this.isRecording&&(this.recordPlugin.stopRecording(),this.isRecording=!1,this.recordEndResolve=null,this.recordEndReject=null)}destroy(){this.cancelRecording(),this.recordPlugin&&(this.recordPlugin.destroy(),this.recordPlugin=null),this.wavesurfer=null,this.events={}}}const X=4,Y=4,ee=8,re=0,te=16e3;function se({containerRef:l,sampleRate:e,events:o,waveformPadding:n=0}){const r=Z(),[d,s]=i.useState("idle"),[p,h]=i.useState(null),[m,c]=i.useState(!1),u=i.useRef(null),y=i.useRef(null),a=i.useRef(null),f=i.useRef(o),S=i.useRef(!1),D=i.useRef(!1),E=i.useRef(new Set),P=i.useRef(!1),b=e===void 0?te:e,A=i.useCallback(()=>{E.current.clear(),c(!1),y.current&&(y.current.destroy(),y.current=null),a.current&&(a.current.destroy(),a.current=null),u.current&&(u.current.destroy(),u.current=null),S.current=!1,P.current=!1,s("idle"),h(null)},[]),x=i.useCallback(()=>{const t=Array.from(E.current);E.current.clear(),t.forEach(w=>{w.resolve()})},[]),_=i.useCallback(t=>{c(!1);const w=Array.from(E.current);E.current.clear(),w.forEach(v=>{v.reject(t)})},[]),T=i.useCallback(t=>{const w={onPlay:()=>{c(!0),f.current.onPlaybackPlay?.()},onPause:()=>{c(!1),f.current.onPlaybackPause?.()},onFinish:()=>{c(!1),f.current.onPlaybackFinish?.()},onReady:()=>{x()},onError:v=>{c(!1),_(v),f.current.onError?.(v)}};t.setEventHandlers(w)},[x,_]);i.useEffect(()=>{f.current=o,a.current&&T(a.current)},[o,T]);const U=i.useCallback(async()=>{if(!(S.current||D.current||!l.current)){D.current=!0;try{const[t,w]=await Promise.all([M(()=>import("./wavesurfer.esm.vI8Eid4k.js"),[],import.meta.url),M(()=>import("./record.B-tDciZb.js"),[],import.meta.url)]),v=t.default,B=w.default,k=v.create({container:l.current,waveColor:r.colors.primary,progressColor:r.colors.bodyText,height:n>0?$(r.sizes.largestElementHeight)-2*n:"auto",barWidth:X,barGap:Y,barRadius:ee,cursorWidth:re,interact:!0});u.current=k,P.current=!1;const C=new Q({sampleRate:b});C.initialize(k,B),C.setEventHandlers({onRecordProgress:g=>{f.current.onProgressMs?.(g)},onPermissionDenied:()=>{f.current.onPermissionDenied(),s("idle")},onError:g=>{f.current.onError(g),s("idle")}}),y.current=C;const R=new O;R.initialize(k),a.current=R,T(R),S.current=!0}catch(t){const w=t instanceof Error?t:new Error(String(t));f.current.onError?.(w)}finally{D.current=!1}}},[l,r,b,T,n]);i.useEffect(()=>(U(),()=>{A()}),[A,U]),i.useEffect(()=>{const t=u.current;if(t){if(d==="recording"){t.setOptions({waveColor:r.colors.primary,progressColor:r.colors.primary});return}if(P.current){t.setOptions({interact:!0,waveColor:I(r.colors.fadedText40,r.colors.secondaryBg),progressColor:r.colors.bodyText});return}t.setOptions({waveColor:r.colors.primary,progressColor:r.colors.bodyText})}},[d,r.colors.bodyText,r.colors.fadedText40,r.colors.primary,r.colors.secondaryBg]);const F=i.useCallback(async()=>{if(d!=="recording"){if(S.current||await U(),!y.current)throw new Error("Record backend not initialized");u.current&&u.current.setOptions({waveColor:r.colors.primary,progressColor:r.colors.primary}),P.current=!1,await y.current.startRecording(),s("recording"),h(null),c(!1),f.current.onRecordStart?.()}},[d,U,r.colors.primary]),L=i.useCallback(()=>{a.current&&u.current&&(a.current.destroy(),a.current=new O,a.current.initialize(u.current),E.current.clear(),c(!1),T(a.current)),P.current=!1},[T]),z=i.useCallback(()=>{a.current?.seekToStart(),c(!1),P.current=!0,u.current&&u.current.setOptions({interact:!0,waveColor:I(r.colors.fadedText40,r.colors.secondaryBg),progressColor:r.colors.bodyText})},[r.colors.bodyText,r.colors.fadedText40,r.colors.secondaryBg]),H=i.useCallback(async()=>{if(d!=="recording")throw new Error("Not currently recording");if(!y.current||!a.current)throw new Error("Backends not initialized");try{const t=await y.current.stopRecording();h(t),await new Promise((k,C)=>{if(!a.current){C(new Error("Player not initialized"));return}const R={resolve:()=>{E.current.delete(R),k()},reject:g=>{E.current.delete(R),C(g)}};E.current.add(R),a.current.load(t).catch(g=>{E.current.delete(R),C(g instanceof Error?g:new Error(String(g)))})}),s("idle"),c(!1),z();const v={durationMs:a.current?.getDuration()??0,sampleRate:typeof b=="number"?b:null,mimeType:t.type||"audio/webm",size:t.size},B={blob:t,meta:v};return f.current.onRecordReady?.(t),B}catch(t){const w=t instanceof Error?t:new Error(String(t));return c(!1),s("idle"),f.current.onError(w),{blob:new Blob,meta:{durationMs:0,sampleRate:null,mimeType:"audio/webm",size:0}}}},[d,z,b]),j=i.useCallback(async t=>{const w=t??p;if(!w){const v=new Error("No recorded audio to approve");f.current.onError(v);return}try{const v=await q(w,b);await f.current.onApprove?.(v),h(null),s("idle")}catch(v){const B=v instanceof Error?v:new Error(String(v));f.current.onError(B)}},[p,b]),N=i.useCallback(()=>{d==="recording"&&y.current?.cancelRecording(),L(),h(null),s("idle"),c(!1),P.current=!1,f.current.onCancel?.()},[d,L]),V=i.useMemo(()=>({isPlaying:()=>a.current?.getIsPlaying()??!1,play:async()=>{if(!a.current)throw new Error("Player not initialized");await a.current.play()},pause:()=>{a.current?.pause()},load:async t=>{if(S.current||await U(),!a.current)throw new Error("Player not initialized");await a.current.load(t),z()},getCurrentTimeMs:()=>a.current?.getCurrentTime()??0,getDurationMs:()=>a.current?.getDuration()??0}),[z,U]),G=i.useCallback(t=>{f.current=t},[]);return i.useEffect(()=>()=>{A()},[A]),{state:d,isPlaybackPlaying:m,mountRef:l,start:F,stop:H,approve:j,cancel:N,destroy:A,playback:V,setEventHandlers:G}}export{se as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function qn(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function T(n,e){if((r=(n=e?n.toExponential(e-1):n.toExponential()).indexOf("e"))<0)return null;var r,t=n.slice(0,r);return[t.length>1?t[0]+t.slice(2):t,+n.slice(r+1)]}function zn(n){return n=T(Math.abs(n)),n?n[1]:NaN}function Cn(n,e){return function(r,t){for(var i=r.length,a=[],f=0,o=n[0],u=0;i>0&&o>0&&(u+o+1>t&&(o=Math.max(1,t-u)),a.push(r.substring(i-=o,i+o)),!((u+=o+1)>t));)o=n[f=(f+1)%n.length];return a.reverse().join(e)}}function In(n){return function(e){return e.replace(/[0-9]/g,function(r){return n[+r]})}}var _n=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Z(n){if(!(e=_n.exec(n)))throw new Error("invalid format: "+n);var e;return new Q({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Z.prototype=Q.prototype;function Q(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}Q.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Dn(n){n:for(var e=n.length,r=1,t=-1,i;r<e;++r)switch(n[r]){case".":t=i=r;break;case"0":t===0&&(t=r),i=r;break;default:if(!+n[r])break n;t>0&&(t=0);break}return t>0?n.slice(0,t)+n.slice(i+1):n}var yn;function Ln(n,e){var r=T(n,e);if(!r)return n+"";var t=r[0],i=r[1],a=i-(yn=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,f=t.length;return a===f?t:a>f?t+new Array(a-f+1).join("0"):a>0?t.slice(0,a)+"."+t.slice(a):"0."+new Array(1-a).join("0")+T(n,Math.max(0,e+a-1))[0]}function fn(n,e){var r=T(n,e);if(!r)return n+"";var t=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+t:t.length>i+1?t.slice(0,i+1)+"."+t.slice(i+1):t+new Array(i-t.length+2).join("0")}const an={"%":(n,e)=>(n*100).toFixed(e),b:n=>Math.round(n).toString(2),c:n=>n+"",d:qn,e:(n,e)=>n.toExponential(e),f:(n,e)=>n.toFixed(e),g:(n,e)=>n.toPrecision(e),o:n=>Math.round(n).toString(8),p:(n,e)=>fn(n*100,e),r:fn,s:Ln,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function on(n){return n}var sn=Array.prototype.map,un=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function On(n){var e=n.grouping===void 0||n.thousands===void 0?on:Cn(sn.call(n.grouping,Number),n.thousands+""),r=n.currency===void 0?"":n.currency[0]+"",t=n.currency===void 0?"":n.currency[1]+"",i=n.decimal===void 0?".":n.decimal+"",a=n.numerals===void 0?on:In(sn.call(n.numerals,String)),f=n.percent===void 0?"%":n.percent+"",o=n.minus===void 0?"−":n.minus+"",u=n.nan===void 0?"NaN":n.nan+"";function N(c){c=Z(c);var R=c.fill,S=c.align,m=c.sign,H=c.symbol,k=c.zero,E=c.width,X=c.comma,y=c.precision,nn=c.trim,x=c.type;x==="n"?(X=!0,x="g"):an[x]||(y===void 0&&(y=12),nn=!0,x="g"),(k||R==="0"&&S==="=")&&(k=!0,R="0",S="=");var En=H==="$"?r:H==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",Pn=H==="$"?t:/[%p]/.test(x)?f:"",en=an[x],jn=/[defgprs%]/.test(x);y=y===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function rn(s){var w=En,d=Pn,v,tn,C;if(x==="c")d=en(s)+d,s="";else{s=+s;var I=s<0||1/s<0;if(s=isNaN(s)?u:en(Math.abs(s),y),nn&&(s=Dn(s)),I&&+s==0&&m!=="+"&&(I=!1),w=(I?m==="("?m:o:m==="-"||m==="("?"":m)+w,d=(x==="s"?un[8+yn/3]:"")+d+(I&&m==="("?")":""),jn){for(v=-1,tn=s.length;++v<tn;)if(C=s.charCodeAt(v),48>C||C>57){d=(C===46?i+s.slice(v+1):s.slice(v))+d,s=s.slice(0,v);break}}}X&&!k&&(s=e(s,1/0));var _=w.length+s.length+d.length,p=_<E?new Array(E-_+1).join(R):"";switch(X&&k&&(s=e(p+s,p.length?E-d.length:1/0),p=""),S){case"<":s=w+s+d+p;break;case"=":s=w+p+s+d;break;case"^":s=p.slice(0,_=p.length>>1)+w+s+d+p.slice(_);break;default:s=p+w+s+d;break}return a(s)}return rn.toString=function(){return c+""},rn}function g(c,R){var S=N((c=Z(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(zn(R)/3)))*3,H=Math.pow(10,-m),k=un[8+m/3];return function(E){return S(H*E)+k}}return{format:N,formatPrefix:g}}var D,Tn,Bn;Fn({thousands:",",grouping:[3],currency:["$",""]});function Fn(n){return D=On(n),Tn=D.format,Bn=D.formatPrefix,D}function W(n,e,r){n.prototype=e.prototype=r,r.constructor=n}function wn(n,e){var r=Object.create(n.prototype);for(var t in e)r[t]=e[t];return r}function z(){}var P=.7,B=1/P,A="\\s*([+-]?\\d+)\\s*",j="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",b="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gn=/^#([0-9a-f]{3,8})$/,Vn=new RegExp(`^rgb\\(${A},${A},${A}\\)$`),Xn=new RegExp(`^rgb\\(${b},${b},${b}\\)$`),Un=new RegExp(`^rgba\\(${A},${A},${A},${j}\\)$`),Yn=new RegExp(`^rgba\\(${b},${b},${b},${j}\\)$`),Zn=new RegExp(`^hsl\\(${j},${b},${b}\\)$`),Jn=new RegExp(`^hsla\\(${j},${b},${b},${j}\\)$`),cn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};W(z,q,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:hn,formatHex:hn,formatHex8:Kn,formatHsl:Qn,formatRgb:xn,toString:xn});function hn(){return this.rgb().formatHex()}function Kn(){return this.rgb().formatHex8()}function Qn(){return $n(this).formatHsl()}function xn(){return this.rgb().formatRgb()}function q(n){var e,r;return n=(n+"").trim().toLowerCase(),(e=Gn.exec(n))?(r=e[1].length,e=parseInt(e[1],16),r===6?dn(e):r===3?new h(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?L(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?L(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Vn.exec(n))?new h(e[1],e[2],e[3],1):(e=Xn.exec(n))?new h(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Un.exec(n))?L(e[1],e[2],e[3],e[4]):(e=Yn.exec(n))?L(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Zn.exec(n))?mn(e[1],e[2]/100,e[3]/100,1):(e=Jn.exec(n))?mn(e[1],e[2]/100,e[3]/100,e[4]):cn.hasOwnProperty(n)?dn(cn[n]):n==="transparent"?new h(NaN,NaN,NaN,0):null}function dn(n){return new h(n>>16&255,n>>8&255,n&255,1)}function L(n,e,r,t){return t<=0&&(n=e=r=NaN),new h(n,e,r,t)}function Wn(n){return n instanceof z||(n=q(n)),n?(n=n.rgb(),new h(n.r,n.g,n.b,n.opacity)):new h}function F(n,e,r,t){return arguments.length===1?Wn(n):new h(n,e,r,t??1)}function h(n,e,r,t){this.r=+n,this.g=+e,this.b=+r,this.opacity=+t}W(h,F,wn(z,{brighter(n){return n=n==null?B:Math.pow(B,n),new h(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?P:Math.pow(P,n),new h(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new h(M(this.r),M(this.g),M(this.b),G(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ln,formatHex:ln,formatHex8:ne,formatRgb:gn,toString:gn}));function ln(){return`#${$(this.r)}${$(this.g)}${$(this.b)}`}function ne(){return`#${$(this.r)}${$(this.g)}${$(this.b)}${$((isNaN(this.opacity)?1:this.opacity)*255)}`}function gn(){const n=G(this.opacity);return`${n===1?"rgb(":"rgba("}${M(this.r)}, ${M(this.g)}, ${M(this.b)}${n===1?")":`, ${n})`}`}function G(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function M(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function $(n){return n=M(n),(n<16?"0":"")+n.toString(16)}function mn(n,e,r,t){return t<=0?n=e=r=NaN:r<=0||r>=1?n=e=NaN:e<=0&&(n=NaN),new l(n,e,r,t)}function $n(n){if(n instanceof l)return new l(n.h,n.s,n.l,n.opacity);if(n instanceof z||(n=q(n)),!n)return new l;if(n instanceof l)return n;n=n.rgb();var e=n.r/255,r=n.g/255,t=n.b/255,i=Math.min(e,r,t),a=Math.max(e,r,t),f=NaN,o=a-i,u=(a+i)/2;return o?(e===a?f=(r-t)/o+(r<t)*6:r===a?f=(t-e)/o+2:f=(e-r)/o+4,o/=u<.5?a+i:2-a-i,f*=60):o=u>0&&u<1?0:f,new l(f,o,u,n.opacity)}function ee(n,e,r,t){return arguments.length===1?$n(n):new l(n,e,r,t??1)}function l(n,e,r,t){this.h=+n,this.s=+e,this.l=+r,this.opacity=+t}W(l,ee,wn(z,{brighter(n){return n=n==null?B:Math.pow(B,n),new l(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?P:Math.pow(P,n),new l(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,r=this.l,t=r+(r<.5?r:1-r)*e,i=2*r-t;return new h(U(n>=240?n-240:n+120,i,t),U(n,i,t),U(n<120?n+240:n-120,i,t),this.opacity)},clamp(){return new l(bn(this.h),O(this.s),O(this.l),G(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=G(this.opacity);return`${n===1?"hsl(":"hsla("}${bn(this.h)}, ${O(this.s)*100}%, ${O(this.l)*100}%${n===1?")":`, ${n})`}`}}));function bn(n){return n=(n||0)%360,n<0?n+360:n}function O(n){return Math.max(0,Math.min(1,n||0))}function U(n,e,r){return(n<60?e+(r-e)*n/60:n<180?r:n<240?e+(r-e)*(240-n)/60:e)*255}function Mn(n,e,r,t,i){var a=n*n,f=a*n;return((1-3*n+3*a-f)*e+(4-6*a+3*f)*r+(1+3*n+3*a-3*f)*t+f*i)/6}function re(n){var e=n.length-1;return function(r){var t=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=n[t],a=n[t+1],f=t>0?n[t-1]:2*i-a,o=t<e-1?n[t+2]:2*a-i;return Mn((r-t/e)*e,f,i,a,o)}}function te(n){var e=n.length;return function(r){var t=Math.floor(((r%=1)<0?++r:r)*e),i=n[(t+e-1)%e],a=n[t%e],f=n[(t+1)%e],o=n[(t+2)%e];return Mn((r-t/e)*e,i,a,f,o)}}const V=n=>()=>n;function Nn(n,e){return function(r){return n+r*e}}function ie(n,e,r){return n=Math.pow(n,r),e=Math.pow(e,r)-n,r=1/r,function(t){return Math.pow(n+t*e,r)}}function he(n,e){var r=e-n;return r?Nn(n,r>180||r<-180?r-360*Math.round(r/360):r):V(isNaN(n)?e:n)}function fe(n){return(n=+n)==1?kn:function(e,r){return r-e?ie(e,r,n):V(isNaN(e)?r:e)}}function kn(n,e){var r=e-n;return r?Nn(n,r):V(isNaN(n)?e:n)}const pn=function n(e){var r=fe(e);function t(i,a){var f=r((i=F(i)).r,(a=F(a)).r),o=r(i.g,a.g),u=r(i.b,a.b),N=kn(i.opacity,a.opacity);return function(g){return i.r=f(g),i.g=o(g),i.b=u(g),i.opacity=N(g),i+""}}return t.gamma=n,t}(1);function vn(n){return function(e){var r=e.length,t=new Array(r),i=new Array(r),a=new Array(r),f,o;for(f=0;f<r;++f)o=F(e[f]),t[f]=o.r||0,i[f]=o.g||0,a[f]=o.b||0;return t=n(t),i=n(i),a=n(a),o.opacity=1,function(u){return o.r=t(u),o.g=i(u),o.b=a(u),o+""}}}var xe=vn(re),de=vn(te);function An(n,e){e||(e=[]);var r=n?Math.min(e.length,n.length):0,t=e.slice(),i;return function(a){for(i=0;i<r;++i)t[i]=n[i]*(1-a)+e[i]*a;return t}}function Rn(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function le(n,e){return(Rn(e)?An:Sn)(n,e)}function Sn(n,e){var r=e?e.length:0,t=n?Math.min(r,n.length):0,i=new Array(t),a=new Array(r),f;for(f=0;f<t;++f)i[f]=Hn(n[f],e[f]);for(;f<r;++f)a[f]=e[f];return function(o){for(f=0;f<t;++f)a[f]=i[f](o);return a}}function ae(n,e){var r=new Date;return n=+n,e=+e,function(t){return r.setTime(n*(1-t)+e*t),r}}function J(n,e){return n=+n,e=+e,function(r){return n*(1-r)+e*r}}function oe(n,e){var r={},t={},i;(n===null||typeof n!="object")&&(n={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in n?r[i]=Hn(n[i],e[i]):t[i]=e[i];return function(a){for(i in r)t[i]=r[i](a);return t}}var K=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Y=new RegExp(K.source,"g");function se(n){return function(){return n}}function ue(n){return function(e){return n(e)+""}}function ce(n,e){var r=K.lastIndex=Y.lastIndex=0,t,i,a,f=-1,o=[],u=[];for(n=n+"",e=e+"";(t=K.exec(n))&&(i=Y.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),o[f]?o[f]+=a:o[++f]=a),(t=t[0])===(i=i[0])?o[f]?o[f]+=i:o[++f]=i:(o[++f]=null,u.push({i:f,x:J(t,i)})),r=Y.lastIndex;return r<e.length&&(a=e.slice(r),o[f]?o[f]+=a:o[++f]=a),o.length<2?u[0]?ue(u[0].x):se(e):(e=u.length,function(N){for(var g=0,c;g<e;++g)o[(c=u[g]).i]=c.x(N);return o.join("")})}function Hn(n,e){var r=typeof e,t;return e==null||r==="boolean"?V(e):(r==="number"?J:r==="string"?(t=q(e))?(e=t,pn):ce:e instanceof q?pn:e instanceof Date?ae:Rn(e)?An:Array.isArray(e)?Sn:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?oe:J)(n,e)}export{F as A,z as C,h as R,Hn as a,Bn as b,Tn as c,pn as d,zn as e,Z as f,ce as g,q as h,J as i,On as j,W as k,wn as l,P as m,B as n,he as o,ee as p,kn as q,Wn as r,le as s,re as t,te as u,ae as v,An as w,oe as x,xe as y,de as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as l,f as h,j as s,d as n}from"./index.DMxc2XFp.js";const o=t=>{const a=e=>{const{width:i,elementRef:c}=h();return s(n,{ref:c,children:s(t,{...e,width:i})})};return a.displayName=`withCalculatedWidth(${t.displayName||t.name})`,l(a,t)};export{o as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,x as m,b0 as p,b1 as h,g as x,f as y,j as i,h as g}from"./index.DMxc2XFp.js";const f=n.createContext(null);f.displayName="ElementFullscreenContext";const w=m("div",{target:"e13s7uld0"})(({theme:e,isExpanded:t})=>({width:"100%",height:"100%",...t?{position:"fixed",top:0,left:0,bottom:0,right:0,background:e.colors.bgColor,zIndex:e.zIndices.fullscreenWrapper,padding:e.spacing.md,paddingTop:e.sizes.fullScreenHeaderHeight,overflow:"auto",display:"flex",alignItems:"center",justifyContent:"center"}:{}})),C=()=>{const{setFullScreen:e}=n.useContext(p),[t,s]=n.useState(!1),{fullHeight:a,fullWidth:c}=h(),l=n.useCallback(r=>{s(r),e(r)},[e]),u=n.useCallback(()=>{document.body.style.overflow="hidden",l(!0)},[l]),o=n.useCallback(()=>{document.body.style.overflow="unset",l(!1)},[l]),d=n.useCallback(r=>{r.keyCode===27&&t&&o()},[o,t]);return n.useEffect(()=>(document.addEventListener("keydown",d,!1),()=>{document.removeEventListener("keydown",d,!1)}),[d]),n.useMemo(()=>({expanded:t,zoomIn:u,zoomOut:o,fullHeight:a,fullWidth:c}),[t,u,o,a,c])},F=({children:e})=>{const t=x(),{expanded:s,fullHeight:a,fullWidth:c,zoomIn:l,zoomOut:u}=C(),{width:o,elementRef:d}=y(),r=n.useMemo(()=>({width:s?c:o,height:s?a:void 0,expanded:s,expand:l,collapse:u}),[s,a,c,o,l,u]);return i(f.Provider,{value:r,children:i(w,{ref:d,isExpanded:s,"data-testid":"stFullScreenFrame",theme:t,children:e})})};function b(e){const t=s=>i(F,{children:i(e,{...s})});return t.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,g(t,e)}export{f as E,b as w};
|
streamlit/string_util.py
CHANGED
|
@@ -64,7 +64,14 @@ def is_material_icon(maybe_icon: str) -> bool:
|
|
|
64
64
|
|
|
65
65
|
def validate_icon_or_emoji(icon: str | None) -> str:
|
|
66
66
|
"""Validate an icon or emoji and return it in normalized format if valid."""
|
|
67
|
-
if icon is
|
|
67
|
+
if icon is None:
|
|
68
|
+
return ""
|
|
69
|
+
|
|
70
|
+
# Support the special case of the spinner icon:
|
|
71
|
+
if icon == "spinner":
|
|
72
|
+
return "spinner"
|
|
73
|
+
|
|
74
|
+
if icon.startswith(":material"):
|
|
68
75
|
return validate_material_icon(icon)
|
|
69
76
|
return validate_emoji(icon)
|
|
70
77
|
|
streamlit/testing/v1/app_test.py
CHANGED
|
@@ -48,6 +48,7 @@ from streamlit.testing.v1.element_tree import (
|
|
|
48
48
|
Column,
|
|
49
49
|
Dataframe,
|
|
50
50
|
DateInput,
|
|
51
|
+
DateTimeInput,
|
|
51
52
|
Divider,
|
|
52
53
|
ElementList,
|
|
53
54
|
ElementTree,
|
|
@@ -608,6 +609,20 @@ class AppTest:
|
|
|
608
609
|
"""
|
|
609
610
|
return self._tree.date_input
|
|
610
611
|
|
|
612
|
+
@property
|
|
613
|
+
def datetime_input(self) -> WidgetList[DateTimeInput]:
|
|
614
|
+
"""Sequence of all ``st.datetime_input`` widgets.
|
|
615
|
+
|
|
616
|
+
Returns
|
|
617
|
+
-------
|
|
618
|
+
WidgetList of DateTimeInput
|
|
619
|
+
Sequence of all ``st.datetime_input`` widgets. Individual widgets can
|
|
620
|
+
be accessed from a WidgetList by index (order on the page) or key.
|
|
621
|
+
For example, ``at.datetime_input[0]`` for the first widget or
|
|
622
|
+
``at.datetime_input(key="my_key")`` for a widget with a given key.
|
|
623
|
+
"""
|
|
624
|
+
return self._tree.datetime_input
|
|
625
|
+
|
|
611
626
|
@property
|
|
612
627
|
def divider(self) -> ElementList[Divider]:
|
|
613
628
|
"""Sequence of all ``st.divider`` elements.
|
|
@@ -40,6 +40,7 @@ from streamlit.elements.widgets.select_slider import SelectSliderSerde
|
|
|
40
40
|
from streamlit.elements.widgets.slider import SliderSerde, SliderStep
|
|
41
41
|
from streamlit.elements.widgets.time_widgets import (
|
|
42
42
|
DateInputSerde,
|
|
43
|
+
DateTimeInputSerde,
|
|
43
44
|
DateWidgetReturn,
|
|
44
45
|
TimeInputSerde,
|
|
45
46
|
_parse_date_value,
|
|
@@ -62,6 +63,7 @@ if TYPE_CHECKING:
|
|
|
62
63
|
from streamlit.proto.Code_pb2 import Code as CodeProto
|
|
63
64
|
from streamlit.proto.ColorPicker_pb2 import ColorPicker as ColorPickerProto
|
|
64
65
|
from streamlit.proto.DateInput_pb2 import DateInput as DateInputProto
|
|
66
|
+
from streamlit.proto.DateTimeInput_pb2 import DateTimeInput as DateTimeInputProto
|
|
65
67
|
from streamlit.proto.Element_pb2 import Element as ElementProto
|
|
66
68
|
from streamlit.proto.Exception_pb2 import Exception as ExceptionProto
|
|
67
69
|
from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
|
|
@@ -1323,6 +1325,7 @@ class TextInput(Widget):
|
|
|
1323
1325
|
|
|
1324
1326
|
|
|
1325
1327
|
TimeValue: TypeAlias = time | datetime
|
|
1328
|
+
DateTimeWidgetValue: TypeAlias = datetime
|
|
1326
1329
|
|
|
1327
1330
|
|
|
1328
1331
|
@dataclass(repr=False)
|
|
@@ -1382,6 +1385,59 @@ class TimeInput(Widget):
|
|
|
1382
1385
|
return self.set_value(dt.time())
|
|
1383
1386
|
|
|
1384
1387
|
|
|
1388
|
+
@dataclass(repr=False)
|
|
1389
|
+
class DateTimeInput(Widget):
|
|
1390
|
+
"""A representation of ``st.datetime_input``."""
|
|
1391
|
+
|
|
1392
|
+
_value: DateTimeWidgetValue | None | InitialValue
|
|
1393
|
+
proto: DateTimeInputProto = field(repr=False)
|
|
1394
|
+
label: str
|
|
1395
|
+
format: str
|
|
1396
|
+
min: str
|
|
1397
|
+
max: str
|
|
1398
|
+
step: int
|
|
1399
|
+
help: str
|
|
1400
|
+
form_id: str
|
|
1401
|
+
|
|
1402
|
+
def __init__(self, proto: DateTimeInputProto, root: ElementTree) -> None:
|
|
1403
|
+
super().__init__(proto, root)
|
|
1404
|
+
self._value = InitialValue()
|
|
1405
|
+
self.type = "date_time_input"
|
|
1406
|
+
|
|
1407
|
+
def set_value(self, v: DateTimeWidgetValue | None) -> DateTimeInput:
|
|
1408
|
+
"""Set the value of the widget."""
|
|
1409
|
+
self._value = v
|
|
1410
|
+
return self
|
|
1411
|
+
|
|
1412
|
+
@property
|
|
1413
|
+
def _widget_state(self) -> WidgetState:
|
|
1414
|
+
from datetime import datetime
|
|
1415
|
+
|
|
1416
|
+
datetime_ui_format = "%Y/%m/%d, %H:%M"
|
|
1417
|
+
|
|
1418
|
+
ws = WidgetState()
|
|
1419
|
+
ws.id = self.id
|
|
1420
|
+
|
|
1421
|
+
# Parse min and max values for validation
|
|
1422
|
+
min_dt = datetime.strptime(self.min, datetime_ui_format)
|
|
1423
|
+
max_dt = datetime.strptime(self.max, datetime_ui_format)
|
|
1424
|
+
|
|
1425
|
+
serde = DateTimeInputSerde(value=None, min=min_dt, max=max_dt)
|
|
1426
|
+
serialized_value = serde.serialize(self.value)
|
|
1427
|
+
if serialized_value is not None:
|
|
1428
|
+
ws.string_array_value.data[:] = serialized_value
|
|
1429
|
+
return ws
|
|
1430
|
+
|
|
1431
|
+
@property
|
|
1432
|
+
def value(self) -> datetime | None:
|
|
1433
|
+
"""The current value of the widget. (datetime)""" # noqa: D400
|
|
1434
|
+
if not isinstance(self._value, InitialValue):
|
|
1435
|
+
return self._value
|
|
1436
|
+
state = self.root.session_state
|
|
1437
|
+
assert state
|
|
1438
|
+
return state[self.id] # type: ignore
|
|
1439
|
+
|
|
1440
|
+
|
|
1385
1441
|
@dataclass(repr=False)
|
|
1386
1442
|
class Toast(Element):
|
|
1387
1443
|
proto: ToastProto = field(repr=False)
|
|
@@ -1532,6 +1588,10 @@ class Block:
|
|
|
1532
1588
|
def date_input(self) -> WidgetList[DateInput]:
|
|
1533
1589
|
return WidgetList(self.get("date_input")) # type: ignore
|
|
1534
1590
|
|
|
1591
|
+
@property
|
|
1592
|
+
def datetime_input(self) -> WidgetList[DateTimeInput]:
|
|
1593
|
+
return WidgetList(self.get("date_time_input")) # type: ignore
|
|
1594
|
+
|
|
1535
1595
|
@property
|
|
1536
1596
|
def divider(self) -> ElementList[Divider]:
|
|
1537
1597
|
return ElementList(self.get("divider")) # type: ignore
|
|
@@ -1986,6 +2046,8 @@ def parse_tree_from_messages(messages: list[ForwardMsg]) -> ElementTree:
|
|
|
1986
2046
|
new_node = ColorPicker(elt.color_picker, root=root)
|
|
1987
2047
|
elif ty == "date_input":
|
|
1988
2048
|
new_node = DateInput(elt.date_input, root=root)
|
|
2049
|
+
elif ty == "date_time_input":
|
|
2050
|
+
new_node = DateTimeInput(elt.date_time_input, root=root)
|
|
1989
2051
|
elif ty == "exception":
|
|
1990
2052
|
new_node = Exception(elt.exception, root=root)
|
|
1991
2053
|
elif ty == "heading":
|
streamlit/web/bootstrap.py
CHANGED
|
@@ -58,6 +58,29 @@ def _fix_sys_path(main_script_path: str) -> None:
|
|
|
58
58
|
sys.path.insert(0, os.path.dirname(main_script_path))
|
|
59
59
|
|
|
60
60
|
|
|
61
|
+
def _maybe_install_uvloop(running_in_event_loop: bool) -> None:
|
|
62
|
+
"""Install uvloop as the default event loop policy if available."""
|
|
63
|
+
|
|
64
|
+
if running_in_event_loop:
|
|
65
|
+
return
|
|
66
|
+
|
|
67
|
+
if env_util.IS_WINDOWS:
|
|
68
|
+
return
|
|
69
|
+
|
|
70
|
+
try:
|
|
71
|
+
import uvloop
|
|
72
|
+
except ModuleNotFoundError:
|
|
73
|
+
return
|
|
74
|
+
|
|
75
|
+
try:
|
|
76
|
+
uvloop.install()
|
|
77
|
+
_LOGGER.debug("uvloop installed as default event loop policy.")
|
|
78
|
+
except Exception:
|
|
79
|
+
_LOGGER.warning(
|
|
80
|
+
"Failed to install uvloop. Falling back to default loop.", exc_info=True
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
61
84
|
def _fix_tornado_crash() -> None:
|
|
62
85
|
"""Set default asyncio policy to be compatible with Tornado 6.
|
|
63
86
|
|
|
@@ -326,6 +349,7 @@ def run(
|
|
|
326
349
|
# This prevents the task from being garbage collected
|
|
327
350
|
server._bootstrap_task = task
|
|
328
351
|
else:
|
|
352
|
+
_maybe_install_uvloop(running_in_event_loop)
|
|
329
353
|
# No running event loop, so we can use asyncio.run
|
|
330
354
|
# This is the normal case when running streamlit from the command line
|
|
331
355
|
_LOGGER.debug("Starting new event loop for server")
|
|
@@ -162,8 +162,11 @@ class AuthCallbackHandler(AuthHandlerMixin, tornado.web.RequestHandler):
|
|
|
162
162
|
return
|
|
163
163
|
|
|
164
164
|
if provider is None:
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
# See https://github.com/streamlit/streamlit/issues/13101
|
|
166
|
+
_LOGGER.warning(
|
|
167
|
+
"Missing provider for OAuth callback; this often indicates a stale "
|
|
168
|
+
"or replayed callback (for example, from browser back/forward "
|
|
169
|
+
"navigation).",
|
|
167
170
|
)
|
|
168
171
|
self.redirect_to_base()
|
|
169
172
|
return
|