streamlit-nightly 1.32.3.dev20240326__py2.py3-none-any.whl → 1.32.3.dev20240328__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. streamlit/__init__.py +4 -2
  2. streamlit/components/v1/__init__.py +3 -17
  3. streamlit/components/v1/{custom_component.py → components.py} +159 -11
  4. streamlit/delta_generator.py +3 -0
  5. streamlit/elements/widgets/time_widgets.py +5 -21
  6. streamlit/errors.py +0 -6
  7. streamlit/proto/AutoRerun_pb2.py +25 -0
  8. streamlit/proto/AutoRerun_pb2.pyi +48 -0
  9. streamlit/proto/ClientState_pb2.py +3 -3
  10. streamlit/proto/ClientState_pb2.pyi +4 -1
  11. streamlit/proto/Delta_pb2.py +2 -2
  12. streamlit/proto/Delta_pb2.pyi +4 -1
  13. streamlit/proto/ForwardMsg_pb2.py +10 -9
  14. streamlit/proto/ForwardMsg_pb2.pyi +12 -3
  15. streamlit/proto/NewSession_pb2.py +24 -24
  16. streamlit/proto/NewSession_pb2.pyi +8 -1
  17. streamlit/proto/PageProfile_pb2.py +6 -6
  18. streamlit/proto/PageProfile_pb2.pyi +4 -1
  19. streamlit/runtime/app_session.py +67 -24
  20. streamlit/runtime/caching/cache_data_api.py +3 -3
  21. streamlit/runtime/caching/cache_resource_api.py +2 -2
  22. streamlit/runtime/fragment.py +239 -0
  23. streamlit/runtime/metrics_util.py +17 -9
  24. streamlit/runtime/runtime.py +6 -12
  25. streamlit/runtime/scriptrunner/script_requests.py +53 -37
  26. streamlit/runtime/scriptrunner/script_run_context.py +15 -2
  27. streamlit/runtime/scriptrunner/script_runner.py +63 -14
  28. streamlit/runtime/state/common.py +2 -0
  29. streamlit/runtime/state/session_state.py +51 -7
  30. streamlit/runtime/state/widgets.py +10 -2
  31. streamlit/static/asset-manifest.json +19 -19
  32. streamlit/static/index.html +1 -1
  33. streamlit/static/static/js/1074.73973756.chunk.js +1 -0
  34. streamlit/static/static/js/1451.3b0a3e31.chunk.js +1 -0
  35. streamlit/static/static/js/1792.b8efa879.chunk.js +1 -0
  36. streamlit/static/static/js/{3092.3d4df25e.chunk.js → 3092.ad569cc8.chunk.js} +1 -1
  37. streamlit/static/static/js/3513.e3e7300a.chunk.js +1 -0
  38. streamlit/static/static/js/4177.69f9f18d.chunk.js +1 -0
  39. streamlit/static/static/js/4319.a6745434.chunk.js +1 -0
  40. streamlit/static/static/js/{4477.2555c11a.chunk.js → 4477.e10e4373.chunk.js} +1 -1
  41. streamlit/static/static/js/{4666.99f3abc3.chunk.js → 4666.b694c5a9.chunk.js} +1 -1
  42. streamlit/static/static/js/5106.44f0ff51.chunk.js +1 -0
  43. streamlit/static/static/js/5379.6571574f.chunk.js +1 -0
  44. streamlit/static/static/js/6013.8e80e091.chunk.js +1 -0
  45. streamlit/static/static/js/6718.802da17e.chunk.js +1 -0
  46. streamlit/static/static/js/7175.be4076bc.chunk.js +1 -0
  47. streamlit/static/static/js/{7602.f0420392.chunk.js → 7602.6175e969.chunk.js} +1 -1
  48. streamlit/static/static/js/{8492.e6dab83f.chunk.js → 8492.f56c9d4c.chunk.js} +1 -1
  49. streamlit/static/static/js/8691.9ccf7f89.chunk.js +1 -0
  50. streamlit/static/static/js/main.722453f0.js +2 -0
  51. streamlit/testing/v1/local_script_runner.py +2 -0
  52. streamlit/time_util.py +88 -0
  53. streamlit/web/server/component_request_handler.py +2 -2
  54. streamlit/web/server/server.py +2 -1
  55. {streamlit_nightly-1.32.3.dev20240326.dist-info → streamlit_nightly-1.32.3.dev20240328.dist-info}/METADATA +1 -1
  56. {streamlit_nightly-1.32.3.dev20240326.dist-info → streamlit_nightly-1.32.3.dev20240328.dist-info}/RECORD +61 -63
  57. streamlit/components/lib/__init__.py +0 -13
  58. streamlit/components/lib/local_component_registry.py +0 -82
  59. streamlit/components/types/__init__.py +0 -13
  60. streamlit/components/types/base_component_registry.py +0 -98
  61. streamlit/components/types/base_custom_component.py +0 -137
  62. streamlit/components/v1/component_registry.py +0 -103
  63. streamlit/static/static/js/1074.71719df6.chunk.js +0 -1
  64. streamlit/static/static/js/1451.e3be1711.chunk.js +0 -1
  65. streamlit/static/static/js/1792.16c16498.chunk.js +0 -1
  66. streamlit/static/static/js/3513.57cff89c.chunk.js +0 -1
  67. streamlit/static/static/js/4177.ab9a7aa1.chunk.js +0 -1
  68. streamlit/static/static/js/4319.213fc321.chunk.js +0 -1
  69. streamlit/static/static/js/5106.22187bfc.chunk.js +0 -1
  70. streamlit/static/static/js/5379.e466522d.chunk.js +0 -1
  71. streamlit/static/static/js/6013.75c92264.chunk.js +0 -1
  72. streamlit/static/static/js/6718.97945fc6.chunk.js +0 -1
  73. streamlit/static/static/js/7175.8c1b4d38.chunk.js +0 -1
  74. streamlit/static/static/js/8691.24a5792f.chunk.js +0 -1
  75. streamlit/static/static/js/main.7fde7092.js +0 -2
  76. /streamlit/static/static/js/{main.7fde7092.js.LICENSE.txt → main.722453f0.js.LICENSE.txt} +0 -0
  77. {streamlit_nightly-1.32.3.dev20240326.data → streamlit_nightly-1.32.3.dev20240328.data}/scripts/streamlit.cmd +0 -0
  78. {streamlit_nightly-1.32.3.dev20240326.dist-info → streamlit_nightly-1.32.3.dev20240328.dist-info}/WHEEL +0 -0
  79. {streamlit_nightly-1.32.3.dev20240326.dist-info → streamlit_nightly-1.32.3.dev20240328.dist-info}/entry_points.txt +0 -0
  80. {streamlit_nightly-1.32.3.dev20240326.dist-info → streamlit_nightly-1.32.3.dev20240328.dist-info}/top_level.txt +0 -0
@@ -1,98 +0,0 @@
1
- # Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- from __future__ import annotations
16
-
17
- from abc import abstractmethod
18
- from typing import Protocol
19
-
20
- from streamlit.components.types.base_custom_component import BaseCustomComponent
21
-
22
-
23
- class BaseComponentRegistry(Protocol):
24
- """Interface for ComponentRegistries."""
25
-
26
- @abstractmethod
27
- def register_component(self, component: BaseCustomComponent) -> None:
28
- """Register a CustomComponent.
29
-
30
- Parameters
31
- ----------
32
- component : CustomComponent
33
- The component to register.
34
- """
35
- raise NotImplementedError
36
-
37
- @abstractmethod
38
- def get_component_path(self, name: str) -> str | None:
39
- """Return the filesystem path for the component with the given name.
40
-
41
- If no such component is registered, or if the component exists but is
42
- being served from a URL, return None instead.
43
-
44
- Parameters
45
- ----------
46
- name: name of the component
47
-
48
- Returns
49
- -------
50
- str or None
51
- The name of the specified component or None if no component with the given name has been registered.
52
- """
53
- raise NotImplementedError
54
-
55
- @abstractmethod
56
- def get_module_name(self, name: str) -> str | None:
57
- """Return the module name for the component with the given name.
58
-
59
- If no such component is registered, return None instead.
60
-
61
- Parameters
62
- ----------
63
- name: name of the component
64
-
65
- Returns
66
- -------
67
- str or None
68
- The module_name of the specified component or None if no component with the given name has been registered.
69
- """
70
- raise NotImplementedError
71
-
72
- @abstractmethod
73
- def get_component(self, name: str) -> BaseCustomComponent | None:
74
- """Return the registered component with the given name.
75
-
76
- If no such component is registered, return None instead.
77
-
78
- Parameters
79
- ----------
80
- name: name of the component
81
-
82
- Returns
83
- -------
84
- component or None
85
- The component with the provided name or None if component with the given name has been registered.
86
- """
87
- raise NotImplementedError
88
-
89
- @abstractmethod
90
- def get_components(self) -> list[BaseCustomComponent]:
91
- """Returns a list of custom components that are registered in this registry.
92
-
93
- Returns
94
- -------
95
- list[CustomComponents]
96
- A list of registered custom components.
97
- """
98
- raise NotImplementedError
@@ -1,137 +0,0 @@
1
- # Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- from __future__ import annotations
16
-
17
- import os
18
- from abc import ABC, abstractmethod
19
- from typing import Any
20
-
21
- from streamlit import util
22
- from streamlit.errors import StreamlitAPIException
23
-
24
-
25
- class MarshallComponentException(StreamlitAPIException):
26
- """Class for exceptions generated during custom component marshalling."""
27
-
28
- pass
29
-
30
-
31
- class BaseCustomComponent(ABC):
32
- """Interface for CustomComponents."""
33
-
34
- def __init__(
35
- self,
36
- name: str,
37
- path: str | None = None,
38
- url: str | None = None,
39
- module_name: str | None = None,
40
- ):
41
- if (path is None and url is None) or (path is not None and url is not None):
42
- raise StreamlitAPIException(
43
- "Either 'path' or 'url' must be set, but not both."
44
- )
45
-
46
- self._name = name
47
- self._path = path
48
- self._url = url
49
- self._module_name = module_name
50
-
51
- def __repr__(self) -> str:
52
- return util.repr_(self)
53
-
54
- def __call__(
55
- self,
56
- *args,
57
- default: Any = None,
58
- key: str | None = None,
59
- **kwargs,
60
- ) -> Any:
61
- """An alias for create_instance."""
62
- return self.create_instance(*args, default=default, key=key, **kwargs)
63
-
64
- @property
65
- def abspath(self) -> str | None:
66
- if self._path is None:
67
- return None
68
- return os.path.abspath(self._path)
69
-
70
- @property
71
- def module_name(self) -> str | None:
72
- return self._module_name
73
-
74
- @property
75
- def name(self) -> str:
76
- return self._name
77
-
78
- @property
79
- def path(self) -> str | None:
80
- return self._path
81
-
82
- @property
83
- def url(self) -> str | None:
84
- return self._url
85
-
86
- def __str__(self) -> str:
87
- return f"'{self.name}': {self.path if self.path is not None else self.url}"
88
-
89
- @abstractmethod
90
- def __eq__(self, other) -> bool:
91
- """Equality operator."""
92
- return NotImplemented
93
-
94
- @abstractmethod
95
- def __ne__(self, other) -> bool:
96
- """Inequality operator."""
97
- return NotImplemented
98
-
99
- @abstractmethod
100
- def create_instance(
101
- self,
102
- *args,
103
- default: Any = None,
104
- key: str | None = None,
105
- **kwargs,
106
- ) -> Any:
107
- """Create a new instance of the component.
108
-
109
- Parameters
110
- ----------
111
- *args
112
- Must be empty; all args must be named. (This parameter exists to
113
- enforce correct use of the function.)
114
- default: any or None
115
- The default return value for the component. This is returned when
116
- the component's frontend hasn't yet specified a value with
117
- `setComponentValue`.
118
- key: str or None
119
- If not None, this is the user key we use to generate the
120
- component's "widget ID".
121
- **kwargs
122
- Keyword args to pass to the component.
123
-
124
- Raises
125
- ------
126
- MarshallComponentException
127
- Raised when args is not empty or component cannot be marshalled.
128
- StreamlitAPIException
129
- Raised when PyArrow is not installed.
130
-
131
- Returns
132
- -------
133
- any or None
134
- The component's widget value.
135
-
136
- """
137
- raise NotImplementedError
@@ -1,103 +0,0 @@
1
- # Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- from __future__ import annotations
16
-
17
- import inspect
18
- import os
19
- from types import FrameType
20
-
21
- from streamlit.components.types.base_component_registry import BaseComponentRegistry
22
- from streamlit.components.v1.custom_component import CustomComponent
23
- from streamlit.runtime import get_instance
24
-
25
-
26
- def _get_module_name(caller_frame: FrameType) -> str:
27
- # Get the caller's module name. `__name__` gives us the module's
28
- # fully-qualified name, which includes its package.
29
- module = inspect.getmodule(caller_frame)
30
- assert module is not None
31
- module_name = module.__name__
32
-
33
- # If the caller was the main module that was executed (that is, if the
34
- # user executed `python my_component.py`), then this name will be
35
- # "__main__" instead of the actual package name. In this case, we use
36
- # the main module's filename, sans `.py` extension, as the component name.
37
- if module_name == "__main__":
38
- file_path = inspect.getfile(caller_frame)
39
- filename = os.path.basename(file_path)
40
- module_name, _ = os.path.splitext(filename)
41
-
42
- return module_name
43
-
44
-
45
- def declare_component(
46
- name: str,
47
- path: str | None = None,
48
- url: str | None = None,
49
- ) -> CustomComponent:
50
- """Create and register a custom component.
51
-
52
- Parameters
53
- ----------
54
- name: str
55
- A short, descriptive name for the component. Like, "slider".
56
- path: str or None
57
- The path to serve the component's frontend files from. Either
58
- `path` or `url` must be specified, but not both.
59
- url: str or None
60
- The URL that the component is served from. Either `path` or `url`
61
- must be specified, but not both.
62
-
63
- Returns
64
- -------
65
- CustomComponent
66
- A CustomComponent that can be called like a function.
67
- Calling the component will create a new instance of the component
68
- in the Streamlit app.
69
-
70
- """
71
-
72
- # Get our stack frame.
73
- current_frame: FrameType | None = inspect.currentframe()
74
- assert current_frame is not None
75
- # Get the stack frame of our calling function.
76
- caller_frame = current_frame.f_back
77
- assert caller_frame is not None
78
- module_name = _get_module_name(caller_frame)
79
-
80
- # Build the component name.
81
- component_name = f"{module_name}.{name}"
82
-
83
- # Create our component object, and register it.
84
- component = CustomComponent(
85
- name=component_name, path=path, url=url, module_name=module_name
86
- )
87
- get_instance().component_registry.register_component(component)
88
-
89
- return component
90
-
91
-
92
- # Keep for backwards-compatibility for now as we don't know whether existing custom
93
- # components use this method. We made significant refactors to the custom component
94
- # registry code in https://github.com/streamlit/streamlit/pull/8193 and after
95
- # that is out in the wild, we can follow-up with more refactorings, e.g. remove
96
- # the following class and method. When we do that, we should conduct some testing with
97
- # popular custom components.
98
- class ComponentRegistry:
99
- @classmethod
100
- def instance(cls) -> BaseComponentRegistry:
101
- """Returns the ComponentRegistry of the runtime instance."""
102
-
103
- return get_instance().component_registry
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1074],{87814:(e,t,s)=>{s.d(t,{K:()=>o});var i=s(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},91074:(e,t,s)=>{s.r(t),s.d(t,{default:()=>w});var i=s(66845),o=s(91706),r=s(81810),l=s.n(r),a=s(25621),n=s(87814),d=s(90481),p=s(91034),h=s(12576),c=s(98478),u=s(86659);const m=(0,s(1515).Z)("div",{target:"e6zijwc0"})((e=>{let{theme:t}=e;return{"span[aria-disabled='true']":{background:t.colors.fadedText05}}}),"");var g=s(8879),v=s(68411),f=s(7978),b=s(97965),S=s(50641),y=s(40864);class x extends i.PureComponent{constructor(){super(...arguments),this.formClearHelper=new n.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{this.props.widgetMgr.setIntArrayValue(this.props.element,this.state.value,e)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{this.props.element.maxSelections&&"select"===e.type&&this.state.value.length>=this.props.element.maxSelections||this.setState(this.generateNewState(e),(()=>{this.commitWidgetValue({fromUi:!0})}))},this.filterOptions=(e,t)=>{if(this.overMaxSelections())return[];const s=e.filter((e=>!this.state.value.includes(Number(e.value))));return(0,b.HX)(s,t)}}overMaxSelections(){return this.props.element.maxSelections>0&&this.state.value.length>=this.props.element.maxSelections}getNoResultsMsg(){const{maxSelections:e}=this.props.element,{value:t}=this.state;if(0===e)return"No results";if(t.length===e){const t=1!==e?"options":"option";return"You can only select up to ".concat(e," ").concat(t,". Remove an option first.")}return"No results"}get initialValue(){const e=this.props.widgetMgr.getIntArrayValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}get valueFromState(){return this.state.value.map((e=>{const t=this.props.element.options[e];return{value:e.toString(),label:t}}))}generateNewState(e){const t=()=>{var t;const s=null===(t=e.option)||void 0===t?void 0:t.value;return parseInt(s,10)};switch(e.type){case"remove":return{value:l()(this.state.value,t())};case"clear":return{value:[]};case"select":return{value:this.state.value.concat([t()])};default:throw new Error("State transition is unknown: ".concat(e.type))}}render(){var e;const{element:t,theme:s,width:i,widgetMgr:r}=this.props,l={width:i},{options:a}=t,n=0===a.length||this.props.disabled,b=0===a.length?"No options to select.":t.placeholder,x=a.map(((e,t)=>({label:e,value:t.toString()})));this.formClearHelper.manageFormClearListener(r,t.formId,this.onFormCleared);const w=a.length>10;return(0,y.jsxs)("div",{className:"row-widget stMultiSelect","data-testid":"stMultiSelect",style:l,children:[(0,y.jsx)(c.O,{label:t.label,disabled:n,labelVisibility:(0,S.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,y.jsx)(u.dT,{children:(0,y.jsx)(g.Z,{content:t.help,placement:v.u.TOP_RIGHT})})}),(0,y.jsx)(m,{children:(0,y.jsx)(p.Z,{options:x,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:b,type:h.wD.select,multi:!0,onChange:this.onChange,value:this.valueFromState,disabled:n,size:"compact",noResultsMsg:this.getNoResultsMsg(),filterOptions:this.filterOptions,closeOnSelect:!1,overrides:{SelectArrow:{component:d.Z,props:{overrides:{Svg:{style:()=>({width:s.iconSizes.xl,height:s.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:s.spacing.sm})},ControlContainer:{style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}},Placeholder:{style:()=>({flex:"inherit"})},ValueContainer:{style:()=>({minHeight:"38.4px",paddingLeft:s.spacing.sm,paddingTop:0,paddingBottom:0,paddingRight:0})},ClearIcon:{props:{overrides:{Svg:{style:{color:s.colors.darkGray,transform:"scale(1.5)",width:s.spacing.twoXL,":hover":{fill:s.colors.bodyText}}}}}},SearchIcon:{style:{color:s.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{borderTopLeftRadius:s.radii.md,borderTopRightRadius:s.radii.md,borderBottomRightRadius:s.radii.md,borderBottomLeftRadius:s.radii.md,fontSize:s.fontSizes.sm,paddingLeft:s.spacing.sm,marginLeft:0,marginRight:s.spacing.sm,height:"28px"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"10px",height:"10px"}}}}},Text:{style:{fontSize:s.fontSizes.md}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:s.fontSizes.sm}}}}},Input:{props:{readOnly:o.tq&&!1===w?"readonly":null}},Dropdown:{component:f.Z}}})})]})}}const w=(0,a.b)(x)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1451],{61451:(t,e,s)=>{s.r(e),s.d(e,{default:()=>C});var i=s(66845),a=s(53608),r=s.n(a),o=s(25621),n=s(15791),l=s(28278),d=s(13553),p=s(87814),m=s(98478),h=s(86659),c=s(8879),u=s(68411),g=s(50641),f=s(40864);const v="YYYY/MM/DD";function y(t){return t.map((t=>new Date(t)))}class b extends i.PureComponent{constructor(){super(...arguments),this.formClearHelper=new p.K,this.state={values:this.initialValue,isRange:this.props.element.isRange,isEmpty:!1},this.commitWidgetValue=t=>{var e;this.props.widgetMgr.setStringArrayValue(this.props.element,(e=this.state.values)?e.map((t=>r()(t).format(v))):[],t)},this.onFormCleared=()=>{const t=y(this.props.element.default);this.setState({values:t,isEmpty:!t},(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=t=>{let{date:e}=t;if(null===e||void 0===e)return void this.setState({values:[],isEmpty:!0});const s=[];Array.isArray(e)?e.forEach((t=>{t&&s.push(t)})):s.push(e),this.setState({values:s,isEmpty:!s},(()=>{this.state.isEmpty||this.commitWidgetValue({fromUi:!0})}))},this.handleClose=()=>{const{isEmpty:t}=this.state;t&&this.setState(((t,e)=>({values:y(e.element.default),isEmpty:!y(e.element.default)})),(()=>{this.commitWidgetValue({fromUi:!0})}))},this.getMaxDate=()=>{const{element:t}=this.props,e=t.max;return e&&e.length>0?r()(e,v).toDate():void 0}}get initialValue(){const t=this.props.widgetMgr.getStringArrayValue(this.props.element);return y(void 0!==t?t:this.props.element.default||[])}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1;const e=t.map((t=>new Date(t)));this.setState({values:e,isEmpty:!e},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var t;const{width:e,element:s,disabled:i,theme:a,widgetMgr:o}=this.props,{values:p,isRange:y}=this.state,{colors:b,fontSizes:C,lineHeights:x}=a,D={width:e},W=r()(s.min,v).toDate(),F=this.getMaxDate(),I=0===s.default.length&&!i,V=s.format.replaceAll(/[a-zA-Z]/g,"9"),S=s.format.replaceAll("Y","y").replaceAll("D","d");return this.formClearHelper.manageFormClearListener(o,s.formId,this.onFormCleared),(0,f.jsxs)("div",{className:"stDateInput",style:D,"data-testid":"stDateInput",children:[(0,f.jsx)(m.O,{label:s.label,disabled:i,labelVisibility:(0,g.iF)(null===(t=s.labelVisibility)||void 0===t?void 0:t.value),children:s.help&&(0,f.jsx)(h.dT,{children:(0,f.jsx)(c.Z,{content:s.help,placement:u.u.TOP_RIGHT})})}),(0,f.jsx)(n.Z,{density:l.pw.high,formatString:S,mask:y?"".concat(V," \u2013 ").concat(V):V,placeholder:y?"".concat(s.format," \u2013 ").concat(s.format):s.format,disabled:i,onChange:this.handleChange,onClose:this.handleClose,overrides:{Popover:{props:{placement:d.r4.bottomLeft,overrides:{Body:{style:{border:"1px solid ".concat(b.fadedText10)}}}}},CalendarContainer:{style:{fontSize:C.sm,paddingRight:a.spacing.sm,paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},Week:{style:{fontSize:C.sm}},Day:{style:t=>{let{$pseudoHighlighted:e,$pseudoSelected:s,$selected:i,$isHovered:a}=t;return{fontSize:C.sm,lineHeight:x.base,"::before":{backgroundColor:i||s||e||a?"".concat(b.secondaryBg," !important"):b.transparent},"::after":{borderColor:b.transparent}}}},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:b.transparent},":focus":{backgroundColor:b.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:b.transparent},":focus":{backgroundColor:b.transparent,outline:0}}},Input:{props:{maskChar:null,overrides:{Root:{style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}},ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,transform:"scale(1.41)",width:a.spacing.twoXL,marginRight:"-8px",":hover":{fill:a.colors.bodyText}}}}}},Input:{style:{paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem",lineHeight:1.4},props:{"data-testid":"stDateInput-Input"}}}}}},value:p,minDate:W,maxDate:F,range:y,clearable:I})]})}}const C=(0,o.b)(b)},87814:(t,e,s)=>{s.d(e,{K:()=>a});var i=s(50641);class a{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,s){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,i.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,s),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1792],{61792:(e,t,i)=>{i.r(t),i.d(t,{default:()=>n});i(66845);var s=i(81354),l=i(27446),a=i(9003),d=i(21e3),r=i(40864);const n=function(e){const{disabled:t,element:i,widgetMgr:n,width:h}=e,u={width:h},c="primary"===i.type?s.nW.PRIMARY:s.nW.SECONDARY,p=!i.help||h;return(0,r.jsx)("div",{className:"row-widget stButton","data-testid":"stButton",style:u,children:(0,r.jsx)(l.t,{help:i.help,children:(0,r.jsx)(a.ZP,{kind:c,size:s.V5.SMALL,disabled:t,fluidWidth:!!i.useContainerWidth&&p,onClick:()=>n.setTriggerValue(i,{fromUi:!0}),children:(0,r.jsx)(d.ZP,{source:i.label,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})})})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[3513],{33513:(e,t,i)=>{i.r(t),i.d(t,{default:()=>r});i(66845);var l=i(81354),s=i(27446),a=i(9003),d=i(21e3),n=i(40864);const r=function(e){const{disabled:t,element:i,widgetMgr:r,width:o,endpoints:u}=e,c={width:o},h="primary"===i.type?l.nW.PRIMARY:l.nW.SECONDARY,p=!i.help||o;return(0,n.jsx)("div",{className:"row-widget stDownloadButton","data-testid":"stDownloadButton",style:c,children:(0,n.jsx)(s.t,{help:i.help,children:(0,n.jsx)(a.ZP,{kind:h,size:l.V5.SMALL,disabled:t,onClick:()=>{r.setTriggerValue(i,{fromUi:!0});const e=document.createElement("a"),t=u.buildMediaURL(i.url);e.setAttribute("href",t),e.setAttribute("target","_self"),e.setAttribute("download",""),e.click()},fluidWidth:!!i.useContainerWidth&&p,children:(0,n.jsx)(d.ZP,{source:i.label,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})})})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4177],{94177:(e,t,i)=>{i.r(t),i.d(t,{default:()=>d});var s=i(66845),r=i(87814),o=i(74516),l=i(50641),a=i(40864);class n extends s.PureComponent{constructor(){super(...arguments),this.formClearHelper=new r.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{this.props.widgetMgr.setStringValue(this.props.element,this.state.value,e)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onColorClose=e=>{this.setState({value:e},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){const e=this.props.widgetMgr.getStringValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{element:t,width:i,disabled:s,widgetMgr:r}=this.props,{value:n}=this.state;return this.formClearHelper.manageFormClearListener(r,t.formId,this.onFormCleared),(0,a.jsx)(o.Z,{label:t.label,labelVisibility:(0,l.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),help:t.help,onChange:this.onColorClose,disabled:s,width:i,value:n})}}const d=n},87814:(e,t,i)=>{i.d(t,{K:()=>r});var s=i(50641);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,s.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,i),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4319],{87814:(e,t,i)=>{i.d(t,{K:()=>l});var s=i(50641);class l{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,s.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,i),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},94319:(e,t,i)=>{i.r(t),i.d(t,{default:()=>h});var s=i(66845),l=i(25621),o=i(87814),r=i(97965),a=i(50641),n=i(40864);class d extends s.PureComponent{constructor(){super(...arguments),this.formClearHelper=new o.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{this.props.widgetMgr.setIntValue(this.props.element,this.state.value,e)},this.onFormCleared=()=>{this.setState(((e,t)=>{var i;return{value:null!==(i=t.element.default)&&void 0!==i?i:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{this.setState({value:e},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){var e;const t=this.props.widgetMgr.getIntValue(this.props.element);return null!==(e=null!==t&&void 0!==t?t:this.props.element.default)&&void 0!==e?e:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==e&&void 0!==e?e:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){const{options:e,help:t,label:i,labelVisibility:s,formId:l,placeholder:o}=this.props.element,{disabled:d,widgetMgr:h}=this.props,m=(0,a.le)(this.props.element.default)&&!d;return this.formClearHelper.manageFormClearListener(h,l,this.onFormCleared),(0,n.jsx)(r.ZP,{label:i,labelVisibility:(0,a.iF)(null===s||void 0===s?void 0:s.value),options:e,disabled:d,width:this.props.width,onChange:this.onChange,value:this.state.value,help:t,placeholder:o,clearable:m})}}const h=(0,l.b)(d)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5106],{87814:(e,t,i)=>{i.d(t,{K:()=>n});var s=i(50641);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,s.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,i),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},5106:(e,t,i)=>{i.r(t),i.d(t,{default:()=>F});var s=i(66845),n=i(1866),o=i.n(n),a=i(70461),r=i(25621),l=i(52347),d=i(87814),h=i(16295),m=i(50641),u=i(53608),c=i.n(u),p=i(98478),g=i(86659),f=i(8879),b=i(68411),v=i(1515),T=i(35704);const y=(0,v.Z)("div",{target:"ew7r33m3"})((e=>{let{disabled:t,theme:i}=e;return{alignItems:"center",backgroundColor:t?i.colors.gray:i.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",height:i.radii.xl,justifyContent:"center",width:i.radii.xl,":focus":{outline:"none"},":focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,T.DZ)(i.colors.primary,.5))}}}),""),R=(0,v.Z)("div",{target:"ew7r33m2"})((e=>{let{disabled:t,theme:i}=e;return{fontFamily:i.genericFonts.codeFont,fontSize:i.fontSizes.sm,paddingBottom:i.spacing.twoThirdsSmFont,color:t?i.colors.gray:i.colors.primary,top:"-22px",position:"absolute",whiteSpace:"nowrap",backgroundColor:i.colors.transparent,lineHeight:i.lineHeights.base,fontWeight:"normal"}}),""),V=(0,v.Z)("div",{target:"ew7r33m1"})((e=>{let{theme:t}=e;return{paddingBottom:t.spacing.none,paddingLeft:t.spacing.none,paddingRight:t.spacing.none,paddingTop:t.spacing.twoThirdsSmFont,justifyContent:"space-between",alignItems:"center",display:"flex"}}),""),x=(0,v.Z)("div",{target:"ew7r33m0"})((e=>{let{disabled:t,theme:i}=e;return{lineHeight:i.lineHeights.base,fontWeight:"normal",fontSize:i.fontSizes.sm,fontFamily:i.genericFonts.codeFont,color:t?i.colors.fadedText40:"inherit"}}),"");var C=i(40864);class w extends s.PureComponent{constructor(e){super(e),this.formClearHelper=new d.K,this.state=void 0,this.sliderRef=s.createRef(),this.thumbRef=[],this.thumbValueRef=[],this.commitWidgetValueDebounced=void 0,this.commitWidgetValue=e=>{this.props.widgetMgr.setDoubleArrayValue(this.props.element,this.state.value,e)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let{value:t}=e;this.setState({value:t},(()=>this.commitWidgetValueDebounced({fromUi:!0})))},this.renderThumb=s.forwardRef(((e,t)=>{var i;const{$value:n,$thumbIndex:a}=e,r=a||0;this.thumbRef[r]=t,(i=this.thumbValueRef)[r]||(i[r]=s.createRef());const l=n?this.formatValue(n[a]):"",d=o()(e,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),h={};return(this.props.element.options.length>0||this.isDateTimeType())&&(h["aria-valuetext"]=l),(0,C.jsx)(y,{...d,disabled:!0===e.$disabled,ref:this.thumbRef[r],"aria-valuetext":l,"aria-label":this.props.element.label,children:(0,C.jsx)(R,{className:"StyledThumbValue","data-testid":"stThumbValue",disabled:!0===e.$disabled,ref:this.thumbValueRef[r],children:l})})})),this.renderTickBar=()=>{const{disabled:e,element:t}=this.props,{max:i,min:s}=t;return(0,C.jsxs)(V,{"data-testid":"stTickBar",children:[(0,C.jsx)(x,{disabled:e,"data-testid":"stTickBarMin",children:this.formatValue(s)}),(0,C.jsx)(x,{disabled:e,"data-testid":"stTickBarMax",children:this.formatValue(i)})]})},this.commitWidgetValueDebounced=(0,m.Ds)(200,this.commitWidgetValue.bind(this)),this.state={value:this.initialValue}}get initialValue(){const e=this.props.widgetMgr.getDoubleArrayValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){setTimeout((()=>{this.thumbValueAlignment()}),0),this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}get value(){const{min:e,max:t}=this.props.element,{value:i}=this.state;let s=i[0],n=i.length>1?i[1]:i[0];return s>n&&(s=n),s<e&&(s=e),s>t&&(s=t),n<e&&(n=e),n>t&&(n=t),i.length>1?[s,n]:[s]}isDateTimeType(){const{dataType:e}=this.props.element;return e===h.iR.DataType.DATETIME||e===h.iR.DataType.DATE||e===h.iR.DataType.TIME}formatValue(e){const{format:t,options:i}=this.props.element;return this.isDateTimeType()?c().utc(e/1e3).format(t):i.length>0?(0,l.sprintf)(t,i[e]):(0,l.sprintf)(t,e)}alignValueOnThumb(e,t,i){if(e&&t&&i){const s=e.getBoundingClientRect(),n=t.getBoundingClientRect(),o=i.getBoundingClientRect(),a=n.left+n.width/2,r=a-o.width/2<s.left,l=a+o.width/2>s.right;i.style.left=r?"0":"",i.style.right=l?"0":""}}thumbValueAlignment(){var e,t,i,s;const n=this.sliderRef.current,o=null===(e=this.thumbRef[0])||void 0===e?void 0:e.current,a=null===(t=this.thumbRef[1])||void 0===t?void 0:t.current,r=null===(i=this.thumbValueRef[0])||void 0===i?void 0:i.current,l=null===(s=this.thumbValueRef[1])||void 0===s?void 0:s.current;if(this.alignValueOnThumb(n,o,r),this.alignValueOnThumb(n,a,l),n&&o&&a&&r&&l){const e=n.getBoundingClientRect(),t=o.getBoundingClientRect(),i=a.getBoundingClientRect(),s=r.getBoundingClientRect(),d=l.getBoundingClientRect();if(s.right+16>d.left){d.left-16-s.width>e.left?r.style.right="".concat(d.width+16-(i.right-t.right),"px"):l.style.left="".concat(s.width+16-(i.left-t.left),"px")}}}render(){var e;const{disabled:t,element:i,theme:s,width:n,widgetMgr:o}=this.props,{colors:r,fonts:l,fontSizes:d,spacing:h}=s,u={width:n};return this.formClearHelper.manageFormClearListener(o,i.formId,this.onFormCleared),this.thumbValueAlignment(),(0,C.jsxs)("div",{ref:this.sliderRef,className:"stSlider","data-testid":"stSlider",style:u,children:[(0,C.jsx)(p.O,{label:i.label,disabled:t,labelVisibility:(0,m.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,C.jsx)(g.dT,{children:(0,C.jsx)(f.Z,{content:i.help,placement:b.u.TOP_RIGHT})})}),(0,C.jsx)(a.Z,{min:i.min,max:i.max,step:i.step,value:this.value,onChange:this.handleChange,disabled:t,overrides:{Root:{style:{paddingTop:h.twoThirdsSmFont}},Thumb:this.renderThumb,Tick:{style:{fontFamily:l.monospace,fontSize:d.sm}},Track:{style:{backgroundColor:"none !important",paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:h.twoThirdsSmFont}},InnerTrack:{style:e=>{let{$disabled:t}=e;return{height:"4px",...t?{background:r.darkenedBgMix25}:{}}}},TickBar:this.renderTickBar}})]})}}const F=(0,r.b)(w)}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5379],{79986:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),s=r(50669),a=r(1515);const l=(0,r(7865).F4)(n||(n=(0,s.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),u=(0,a.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var c=r(40864);const d=e=>{let{dirty:t,value:r,maxLength:n,className:s,type:a="single",inForm:l}=e;const d=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,c.jsx)(u,{includeDot:d.length>0,shouldBlink:t,children:e},d.length))};if(t){const e=l?"submit form":"apply";if("multiline"===a){const t=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(t,"+Enter to ").concat(e))}else"single"===a&&p("Press Enter to ".concat(e))}return n&&("chat"!==a||t)&&p("".concat(r.length,"/").concat(n),t&&r.length>=n),(0,c.jsx)(i.X7,{"data-testid":"InputInstructions",className:s,children:d})}},87814:(e,t,r)=>{"use strict";r.d(t,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},35379:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var n=r(66845),o=r(87814),i=r(118),s=r(79986),a=r(98478),l=r(86659),u=r(8879),c=r(68411),d=r(50641),p=r(48266);const f=(0,r(1515).Z)("div",{target:"ezh4s2r0"})({name:"1om1ktf",styles:"div{border-width:1px;}"});var h=r(70479),m=r.n(h),y=r(40864);class b extends n.PureComponent{get initialValue(){var e;const t=this.props.widgetMgr.getStringValue(this.props.element);return null!==(e=null!==t&&void 0!==t?t:this.props.element.default)&&void 0!==e?e:null}constructor(e){super(e),this.formClearHelper=new o.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=e=>{this.props.widgetMgr.setStringValue(this.props.element,this.state.value,e),this.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((e,t)=>{var r;return{value:null!==(r=t.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=e=>{const{value:t}=e.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&t.length>n||this.setState({dirty:!0,value:t})},this.isEnterKeyPressed=e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))},this.onKeyDown=e=>{const{metaKey:t,ctrlKey:r}=e,{dirty:n}=this.state;if(this.isEnterKeyPressed(e)&&(r||t)&&n){e.preventDefault(),this.commitWidgetValue({fromUi:!0});const{formId:t}=this.props.element;(0,d.$b)({formId:t})&&this.props.widgetMgr.submitForm(this.props.element.formId)}},this.id=m()("text_area_")}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==e&&void 0!==e?e:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{element:t,disabled:r,width:n,widgetMgr:o}=this.props,{value:h,dirty:m}=this.state,b={width:n},{height:v,placeholder:g}=t;return this.formClearHelper.manageFormClearListener(o,t.formId,this.onFormCleared),(0,y.jsxs)("div",{className:"stTextArea","data-testid":"stTextArea",style:b,children:[(0,y.jsx)(a.O,{label:t.label,disabled:r,labelVisibility:(0,d.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),htmlFor:this.id,children:t.help&&(0,y.jsx)(l.dT,{children:(0,y.jsx)(u.Z,{content:t.help,placement:c.u.TOP_RIGHT})})}),(0,y.jsx)(f,{children:(0,y.jsx)(i.Z,{value:null!==h&&void 0!==h?h:"",placeholder:g,onBlur:this.onBlur,onChange:this.onChange,onKeyDown:this.onKeyDown,"aria-label":t.label,disabled:r,id:this.id,overrides:{Input:{style:{lineHeight:"1.4",height:v?"".concat(v,"px"):"",minHeight:"95px",resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:"1rem",paddingLeft:"1rem",paddingBottom:"1rem",paddingTop:"1rem"}}}})}),n>p.A.hideWidgetDetails&&(0,y.jsx)(s.Z,{dirty:m,value:null!==h&&void 0!==h?h:"",maxLength:t.maxChars,type:"multiline",inForm:(0,d.$b)({formId:t.formId})})]})}}const v=b},118:(e,t,r)=>{"use strict";r.d(t,{Z:()=>F});var n=r(66845),o=r(80318),i=r(9656),s=r(38254),a=r(80745),l=r(98479);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}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 p=(0,a.zo)("div",(function(e){return c(c({},(0,l.d5)(c(c({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,a.zo)("div",(function(e){return(0,l.hB)(c({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,a.zo)("textarea",(function(e){return c(c({},(0,l.Hx)(e)),{},{resize:e.$resize||"none"})}));function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(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 b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}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 O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=x(e);if(t){var o=x(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===m(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return j(e)}(this,r)}}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},x(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}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var C=function(e){!function(e,t){if("function"!==typeof t&&null!==t)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&&O(e,t)}(u,e);var t,r,a,l=w(u);function u(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return P(j(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),P(j(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),P(j(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=u,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),a=r[0],l=r[1],u=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(a,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},l),n.createElement(i.Z,y({},this.props,{type:s.iB.textarea,overrides:u,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&g(t.prototype,r),a&&g(t,a),Object.defineProperty(t,"prototype",{writable:!1}),u}(n.Component);P(C,"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:s.NO.default});const F=C},70479:(e,t,r)=>{var n=r(38145),o=0;e.exports=function(e){var t=++o;return n(e)+t}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6013],{79986:(e,t,r)=>{r.d(t,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),a=r(50669),s=r(1515);const l=(0,r(7865).F4)(n||(n=(0,a.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),c=(0,s.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var u=r(40864);const d=e=>{let{dirty:t,value:r,maxLength:n,className:a,type:s="single",inForm:l}=e;const d=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,u.jsx)(c,{includeDot:d.length>0,shouldBlink:t,children:e},d.length))};if(t){const e=l?"submit form":"apply";if("multiline"===s){const t=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(t,"+Enter to ").concat(e))}else"single"===s&&p("Press Enter to ".concat(e))}return n&&("chat"!==s||t)&&p("".concat(r.length,"/").concat(n),t&&r.length>=n),(0,u.jsx)(i.X7,{"data-testid":"InputInstructions",className:a,children:d})}},46013:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var n=r(66845),o=r(25621),i=r(25773),a=r(69),s=n.forwardRef((function(e,t){return n.createElement(a.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))}));s.displayName="Send";var l=r(118),c=r(46927),u=r(79986),d=r(92627),p=r(48266),f=r(1515);const h=(0,f.Z)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.lg,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:"".concat(n,"px")}}),""),y=(0,f.Z)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.lg,display:"flex",alignItems:"center"}}),""),g=(0,f.Z)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.Iy)(t),[i,a]=o?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?t.radii.none:t.radii.lg,borderTopLeftRadius:n?t.radii.lg:t.radii.none,borderBottomRightRadius:t.radii.lg,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,margin:0,padding:t.spacing.sm,color:r?i:a,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:o?t.colors.gray10:t.colors.gray90},"&:hover":{backgroundColor:t.colors.primary,color:t.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),""),b=(0,f.Z)("div",{target:"e1d2x3se1"})((()=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:"0px",pointerEvents:"none"})),""),m=(0,f.Z)("div",{target:"e1d2x3se0"})({name:"1lm6gnd",styles:"position:absolute;bottom:0px;right:3rem"});var v=r(40864);const x=function(e){let{width:t,element:r,widgetMgr:i}=e;const a=(0,o.u)(),[f,x]=(0,n.useState)(!1),[w,O]=(0,n.useState)(r.default),[j,C]=(0,n.useState)(0),S=(0,n.useRef)(null),P=(0,n.useRef)({minHeight:0,maxHeight:0}),R=()=>{w&&(i.setStringTriggerValue(r,w,{fromUi:!0}),x(!1),O(""),C(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";O(e),x(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(S.current){const{offsetHeight:e}=S.current;P.current.minHeight=e,P.current.maxHeight=6.5*e}}),[S]);const{disabled:k,placeholder:E,maxChars:I}=r,B=(0,d.Iy)(a),{minHeight:T,maxHeight:F}=P.current,Z=B?a.colors.gray70:a.colors.gray80,z=!!(j>0&&S.current)&&Math.abs(j-T)>1;return(0,v.jsx)(h,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,v.jsxs)(y,{children:[(0,v.jsx)(l.Z,{inputRef:S,value:w,placeholder:E,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(x(""!==t),O(t),C((()=>{let e=0;const{current:t}=S;if(t){const r=t.placeholder;t.placeholder="",t.style.height="auto",e=t.scrollHeight,t.placeholder=r,t.style.height=""}return e})()))},onKeyDown:e=>{const{metaKey:t,ctrlKey:r,shiftKey:n}=e;(e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))})(e)&&!n&&!r&&!t&&(e.preventDefault(),R())},"aria-label":E,disabled:k,rows:1,overrides:{Root:{style:{outline:"none",backgroundColor:a.colors.transparent,borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",width:"".concat(t,"px")}},InputContainer:{style:{backgroundColor:a.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:"1.4",backgroundColor:a.colors.transparent,"::placeholder":{color:Z},height:z?"".concat(j+1,"px"):"auto",maxHeight:F?"".concat(F,"px"):"none",paddingRight:"3rem",paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}}}}),t>p.A.hideWidgetDetails&&(0,v.jsx)(m,{children:(0,v.jsx)(u.Z,{dirty:f,value:w,maxLength:I,type:"chat",inForm:!1})}),(0,v.jsx)(b,{children:(0,v.jsx)(g,{onClick:R,disabled:!f||k,extended:z,"data-testid":"stChatInputSubmitButton",children:(0,v.jsx)(c.Z,{content:s,size:"xl",color:"inherit"})})})]})})}},118:(e,t,r)=>{r.d(t,{Z:()=>P});var n=r(66845),o=r(80318),i=r(9656),a=r(38254),s=r(80745),l=r(98479);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}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 p=(0,s.zo)("div",(function(e){return u(u({},(0,l.d5)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.zo)("div",(function(e){return(0,l.hB)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.zo)("textarea",(function(e){return u(u({},(0,l.Hx)(e)),{},{resize:e.$resize||"none"})}));function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(){return g=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},g.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){s=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(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 x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,r)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)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&&x(e,t)}(c,e);var t,r,s,l=w(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(O(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),C(O(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),C(O(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=c,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),s=r[0],l=r[1],c=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(s,g({"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},l),n.createElement(i.Z,g({},this.props,{type:a.iB.textarea,overrides:c,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),s&&v(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(n.Component);C(S,"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.NO.default});const P=S}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6718],{87814:(e,t,r)=>{r.d(t,{K:()=>n});var o=r(50641);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},36718:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var o=r(66845),n=r(97142),i=r(27420),l=r(90481),a=r(25621),s=r(87814),u=r(98478),d=r(86659),c=r(8879),p=r(68411),f=r(50641);const b=(0,r(1515).Z)("div",{target:"e1ipygm10"})((()=>({position:"absolute",top:"50%",right:"2.05em"})),"");var y=r(40864);class g extends o.PureComponent{constructor(){super(...arguments),this.formClearHelper=new s.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{this.props.widgetMgr.setStringValue(this.props.element,this.state.value,e)},this.onFormCleared=()=>{this.setState(((e,t)=>{var r;return{value:null!==(r=t.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let t;t=null===e?null:this.dateToString(e),this.setState({value:t},(()=>this.commitWidgetValue({fromUi:!0})))},this.stringToDate=e=>{if(null===e)return null;const[t,r]=e.split(":").map(Number),o=new Date;return o.setHours(t),o.setMinutes(r),o},this.dateToString=e=>{const t=e.getHours().toString().padStart(2,"0"),r=e.getMinutes().toString().padStart(2,"0");return"".concat(t,":").concat(r)}}get initialValue(){var e;const t=this.props.widgetMgr.getStringValue(this.props.element);return null!==(e=null!==t&&void 0!==t?t:this.props.element.default)&&void 0!==e?e:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==e&&void 0!==e?e:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{disabled:t,width:r,element:o,widgetMgr:a,theme:s}=this.props,g=(0,f.le)(o.default)&&!t,m={width:r},h={Select:{props:{disabled:t,overrides:{ControlContainer:{style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}},IconsContainer:{style:()=>({paddingRight:".5rem"})},ValueContainer:{style:()=>({paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"})},SingleValue:{props:{"data-testid":"stTimeInput-timeDisplay"}},Dropdown:{style:()=>({paddingTop:0,paddingBottom:0})},Popover:{props:{overrides:{Body:{style:()=>({marginTop:"1px"})}}}},SelectArrow:{component:l.Z,props:{overrides:{Svg:{style:()=>({width:s.iconSizes.xl,height:s.iconSizes.xl})}}}}}}}};return this.formClearHelper.manageFormClearListener(a,o.formId,this.onFormCleared),(0,y.jsxs)("div",{className:"stTimeInput","data-testid":"stTimeInput",style:m,children:[(0,y.jsx)(u.O,{label:o.label,disabled:t,labelVisibility:(0,f.iF)(null===(e=o.labelVisibility)||void 0===e?void 0:e.value),children:o.help&&(0,y.jsx)(d.dT,{children:(0,y.jsx)(c.Z,{content:o.help,placement:p.u.TOP_RIGHT})})}),(0,y.jsx)(n.Z,{format:"24",step:o.step?Number(o.step):900,value:(0,f.le)(this.state.value)?void 0:this.stringToDate(this.state.value),onChange:this.handleChange,overrides:h,nullable:g,creatable:!0,"aria-label":o.label}),g&&!(0,f.le)(this.state.value)&&(0,y.jsx)(b,{onClick:()=>{this.handleChange(null)},"data-testid":"stTimeInputClearButton",children:(0,y.jsx)(i.i,{overrides:{Svg:{style:{color:s.colors.darkGray,transform:"scale(1.41)",width:s.spacing.twoXL,":hover":{fill:s.colors.bodyText}}}},$isFocusVisible:!1})})]})}}const m=(0,a.b)(g)},71077:(e,t,r)=>{r.r(t),r.d(t,{ThemeConsumer:()=>l,ThemeProvider:()=>o.Z,createThemedStyled:()=>n.Tp,createThemedUseStyletron:()=>n.fj,createThemedWithStyle:()=>n.o4,expandBorderStyles:()=>i.Qj,hexToRgb:()=>i.oo,styled:()=>n.zo,useStyletron:()=>n.hQ,withStyle:()=>n.w1,withWrapper:()=>n.Le});var o=r(42274),n=r(80745),i=r(30067),l=o.N.Consumer},92990:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getOverride=f,t.getOverrideProps=b,t.getOverrides=g,t.mergeConfigurationOverrides=h,t.mergeOverride=m,t.mergeOverrides=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object.assign({},e,t);return Object.keys(r).reduce((function(r,o){return r[o]=m(y(e[o]),y(t[o])),r}),{})},t.toObjectOverride=y,t.useOverrides=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.useMemo((function(){return Object.keys(e).reduce((function(r,o){return r[o]=g(t[o],e[o]),r}),{})}),[t])};var o,n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==p(e)&&"function"!==typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=n?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,r&&r.set(e,o);return o}(r(66845)),i=r(75738),l=(o=r(70924))&&o.__esModule?o:{default:o};function a(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},s.apply(this,arguments)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(e){return(0,i.isValidElementType)(e)?e:e&&"object"===p(e)?e.component:e}function b(e){return e&&"object"===p(e)?"object"===p(e.props)?d(d({},e.props),{},{$style:e.style}):{$style:e.style}:{}}function y(e){return(0,i.isValidElementType)(e)?{component:e}:e||{}}function g(e,t){var r=f(e)||t;if(e&&"object"===p(e)&&"function"===typeof e.props){0;var o=n.forwardRef((function(t,o){var i=e.props(t),l=b(d(d({},e),{},{props:i}));return n.createElement(r,s({ref:o},l))}));return o.displayName=r.displayName,[o,{}]}var i=b(e);return[r,i]}function m(e,t){var r=d(d({},e),t);return e.props&&t.props&&(r.props=h(e.props,t.props)),e.style&&t.style&&(r.style=h(e.style,t.style)),r}function h(e,t){return"object"===p(e)&&"object"===p(t)?(0,l.default)({},e,t):function(){return(0,l.default)({},"function"===typeof e?e.apply(void 0,arguments):e,"function"===typeof t?t.apply(void 0,arguments):t)}}},13373:(e,t,r)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!==typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var a=i?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(n,l,a):n[l]=e[l]}n.default=e,r&&r.set(e,n);return n}(r(66845)),l=r(71077),a=r(92990),s=(n=r(86737))&&n.__esModule?n:{default:n},u=["title","size","color","overrides"];function d(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},c.apply(this,arguments)}function p(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);l=!0);}catch(s){a=!0,n=s}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function y(e,t){var r=f((0,l.useStyletron)(),2)[1],o=e.title,n=void 0===o?"Delete Alt":o,d=e.size,b=e.color,y=e.overrides,g=void 0===y?{}:y,m=p(e,u),h=(0,a.mergeOverride)({component:r.icons&&r.icons.DeleteAlt?r.icons.DeleteAlt:null},g&&g.Svg?(0,a.toObjectOverride)(g.Svg):{});return i.createElement(s.default,c({viewBox:"0 0 24 24",ref:t,title:n,size:d,color:b,overrides:{Svg:h}},m),i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"}))}var g=i.forwardRef(y);t.default=g},86737:(e,t,r)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!==typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var a=i?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(n,l,a):n[l]=e[l]}n.default=e,r&&r.set(e,n);return n}(r(66845)),l=r(92990),a=r(61637),s=(n=r(72620))&&n.__esModule?n:{default:n},u=["children","title","size","color","overrides"];function d(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},c.apply(this,arguments)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);l=!0);}catch(s){a=!0,n=s}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function m(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var h=function(e,t){var r=e.children,o=e.title,n=e.size,d=e.color,p=e.overrides,b=void 0===p?{}:p,g=m(e,u),h=y((0,l.getOverrides)(b.Svg,a.Svg),2),v=h[0],O=h[1],S=v.__STYLETRON__?f(f({title:o,$color:d,$size:n},g),O):f(f({title:o,color:d,size:n},(0,s.default)(g)),(0,s.default)(O));return i.createElement(v,c({"data-baseweb":"icon",ref:t},S),o?i.createElement("title",null,o):null,r)},v=i.forwardRef(h);t.default=v},72620:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={};for(var r in e)"$"!==r[0]&&(t[r]=e[r]);return t}},61637:(e,t,r)=>{function o(e){var t=e.$theme,r=e.$size,o=e.$color,n=t.sizing.scale600;r&&(n=t.sizing[r]?t.sizing[r]:"number"===typeof r?"".concat(r,"px"):r);var i="currentColor";return o&&(i=t.colors[o]?t.colors[o]:o),{display:"inline-block",fill:i,color:i,height:n,width:n}}Object.defineProperty(t,"__esModule",{value:!0}),t.Svg=void 0,t.getSvgStyles=o;var n=(0,r(71077).styled)("svg",o);t.Svg=n,n.displayName="Svg",n.displayName="Svg"},80912:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.STATE_CHANGE_TYPE=t.SIZE=t.ENHANCER_POSITION=t.CUSTOM_INPUT_TYPE=t.ADJOINED=void 0;t.STATE_CHANGE_TYPE={change:"change"};t.CUSTOM_INPUT_TYPE={textarea:"textarea"};t.ADJOINED={none:"none",left:"left",right:"right",both:"both"};t.SIZE={mini:"mini",default:"default",compact:"compact",large:"large"};t.ENHANCER_POSITION={start:"start",end:"end"}},27420:(e,t,r)=>{t.i=void 0;var o,n=r(71077),i=r(80912),l=(o=r(13373))&&o.__esModule?o:{default:o};function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var d=(0,n.styled)("button",(function(e){var t,r=e.$theme,o=e.$size,n=e.$isFocusVisible,l=(t={},u(t,i.SIZE.mini,r.sizing.scale400),u(t,i.SIZE.compact,r.sizing.scale400),u(t,i.SIZE.default,r.sizing.scale300),u(t,i.SIZE.large,r.sizing.scale200),t)[o];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:l,paddingRight:l,outline:n?"solid 3px ".concat(r.colors.accent):"none",color:r.colors.contentPrimary}}));d.displayName="StyledMaskToggleButton",d.displayName="StyledMaskToggleButton";var c=(0,n.styled)("div",(function(e){var t,r=e.$alignTop,o=void 0!==r&&r,n=e.$size,l=e.$theme,a=(t={},u(t,i.SIZE.mini,l.sizing.scale200),u(t,i.SIZE.compact,l.sizing.scale200),u(t,i.SIZE.default,l.sizing.scale100),u(t,i.SIZE.large,l.sizing.scale0),t)[n];return{display:"flex",alignItems:o?"flex-start":"center",paddingLeft:a,paddingRight:a,paddingTop:o?l.sizing.scale500:"0px",color:l.colors.contentPrimary}}));c.displayName="StyledClearIconContainer",c.displayName="StyledClearIconContainer";var p=(0,n.styled)(l.default,(function(e){var t=e.$theme;return{cursor:"pointer",outline:e.$isFocusVisible?"solid 3px ".concat(t.colors.accent):"none"}}));function f(e,t){var r;return(r={},u(r,i.SIZE.mini,t.font100),u(r,i.SIZE.compact,t.font200),u(r,i.SIZE.default,t.font300),u(r,i.SIZE.large,t.font400),r)[e]}t.i=p,p.displayName="StyledClearIcon",p.displayName="StyledClearIcon";var b=function(e){var t=e.$isFocused,r=e.$adjoined,o=e.$error,n=e.$disabled,l=e.$positive,a=e.$size,u=e.$theme,d=e.$theme,c=d.borders,p=d.colors,b=d.sizing,y=d.typography,g=d.animation,m=e.$hasIconTrailing;return s(s(s(s({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:g.timing200,transitionTimingFunction:g.easeOutCurve},function(e,t){var r=t.inputBorderRadius;return e===i.SIZE.mini&&(r=t.inputBorderRadiusMini),{borderTopLeftRadius:r,borderBottomLeftRadius:r,borderTopRightRadius:r,borderBottomRightRadius:r}}(a,c)),f(a,y)),function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0;return e?{borderLeftColor:n.inputFillDisabled,borderRightColor:n.inputFillDisabled,borderTopColor:n.inputFillDisabled,borderBottomColor:n.inputFillDisabled,backgroundColor:n.inputFillDisabled}:t?{borderLeftColor:n.borderSelected,borderRightColor:n.borderSelected,borderTopColor:n.borderSelected,borderBottomColor:n.borderSelected,backgroundColor:n.inputFillActive}:r?{borderLeftColor:n.inputBorderError,borderRightColor:n.inputBorderError,borderTopColor:n.inputBorderError,borderBottomColor:n.inputBorderError,backgroundColor:n.inputFillError}:o?{borderLeftColor:n.inputBorderPositive,borderRightColor:n.inputBorderPositive,borderTopColor:n.inputBorderPositive,borderBottomColor:n.inputBorderPositive,backgroundColor:n.inputFillPositive}:{borderLeftColor:n.inputBorder,borderRightColor:n.inputBorder,borderTopColor:n.inputBorder,borderBottomColor:n.inputBorder,backgroundColor:n.inputFill}}(n,t,o,l,p)),function(e,t,r,o,n){var l=e===i.ADJOINED.both||e===i.ADJOINED.left&&"rtl"!==o||e===i.ADJOINED.right&&"rtl"===o||n&&"rtl"===o,a=e===i.ADJOINED.both||e===i.ADJOINED.right&&"rtl"!==o||e===i.ADJOINED.left&&"rtl"===o||n&&"rtl"!==o;return{paddingLeft:l?r.scale550:"0px",paddingRight:a?r.scale550:"0px"}}(r,0,b,u.direction,m))};var y=(0,n.styled)("div",b);y.displayName="Root",y.displayName="Root";var g=(0,n.styled)("div",(function(e){var t=e.$size,r=e.$disabled,o=e.$isFocused,n=e.$error,l=e.$positive,a=e.$theme,d=a.colors,c=a.sizing,p=a.typography,b=a.animation;return s(s(s({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:b.timing200,transitionTimingFunction:b.easeOutCurve},f(t,p)),function(e,t){var r;return(r={},u(r,i.SIZE.mini,{paddingRight:t.scale400,paddingLeft:t.scale400}),u(r,i.SIZE.compact,{paddingRight:t.scale400,paddingLeft:t.scale400}),u(r,i.SIZE.default,{paddingRight:t.scale300,paddingLeft:t.scale300}),u(r,i.SIZE.large,{paddingRight:t.scale200,paddingLeft:t.scale200}),r)[e]}(t,c)),function(e,t,r,o,n){return e?{color:n.inputEnhancerTextDisabled,backgroundColor:n.inputFillDisabled}:t?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:r?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}(r,o,n,l,d))}));g.displayName="InputEnhancer",g.displayName="InputEnhancer";var m=function(e){var t=e.$isFocused,r=e.$error,o=e.$disabled,n=e.$positive,i=e.$size,l=e.$theme,a=l.colors,u=l.typography,d=l.animation;return s(s({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:d.timing200,transitionTimingFunction:d.easeOutCurve},f(i,u)),function(e,t,r,o,n){return e?{color:n.inputTextDisabled,backgroundColor:n.inputFillDisabled}:t?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:r?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}(o,t,r,n,a))};var h=(0,n.styled)("div",m);h.displayName="InputContainer",h.displayName="InputContainer";var v=function(e){var t=e.$disabled,r=(e.$isFocused,e.$error,e.$size),o=e.$theme,n=o.colors,l=o.sizing;return s(s(s({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:t?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},f(r,o.typography)),function(e,t){var r;return(r={},u(r,i.SIZE.mini,{paddingTop:t.scale100,paddingBottom:t.scale100,paddingLeft:t.scale550,paddingRight:t.scale550}),u(r,i.SIZE.compact,{paddingTop:t.scale200,paddingBottom:t.scale200,paddingLeft:t.scale550,paddingRight:t.scale550}),u(r,i.SIZE.default,{paddingTop:t.scale400,paddingBottom:t.scale400,paddingLeft:t.scale550,paddingRight:t.scale550}),u(r,i.SIZE.large,{paddingTop:t.scale550,paddingBottom:t.scale550,paddingLeft:t.scale550,paddingRight:t.scale550}),r)[e]}(r,l)),function(e,t,r,o){return e?{color:o.inputTextDisabled,"-webkit-text-fill-color":o.inputTextDisabled,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholderDisabled}}:{color:o.contentPrimary,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholder}}}(t,0,0,n))};var O=(0,n.styled)("input",v);O.displayName="Input",O.displayName="Input"},70924:(e,t)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e){return Array.isArray(e)||"[object Object]"=={}.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){t=t||{};for(var n,i,l=arguments.length<=1?0:arguments.length-1,a=0;a<l;a++)for(var s in n=(a+1<1||arguments.length<=a+1?void 0:arguments[a+1])||{})void 0!==r(n[s])&&(o(i=n[s])?t[s]=e(t[s]||Array.isArray(i)&&[]||{},i):t[s]=i);return t}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7175],{79986:(t,e,i)=>{i.d(e,{Z:()=>c});i(66845);var s,r=i(50641),o=i(86659),n=i(50669),a=i(1515);const l=(0,i(7865).F4)(s||(s=(0,n.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),d=(0,a.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:i,theme:s}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:s.colors.gray,margin:"0 5px"}}:{},...i?{color:s.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var u=i(40864);const c=t=>{let{dirty:e,value:i,maxLength:s,className:n,type:a="single",inForm:l}=t;const c=[],h=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c.push((0,u.jsx)(d,{includeDot:c.length>0,shouldBlink:e,children:t},c.length))};if(e){const t=l?"submit form":"apply";if("multiline"===a){const e=(0,r.Ge)()?"\u2318":"Ctrl";h("Press ".concat(e,"+Enter to ").concat(t))}else"single"===a&&h("Press Enter to ".concat(t))}return s&&("chat"!==a||e)&&h("".concat(i.length,"/").concat(s),e&&i.length>=s),(0,u.jsx)(o.X7,{"data-testid":"InputInstructions",className:n,children:c})}},87814:(t,e,i)=>{i.d(e,{K:()=>r});var s=i(50641);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,i){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,s.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,i),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},67175:(t,e,i)=>{i.r(e),i.d(e,{default:()=>M});var s=i(66845),r=i(20607),o=i(89997),n=i(25621),a=i(52347),l=i(87814),d=i(23849),u=i(16295),c=i(48266),h=i(8879),m=i(68411),p=i(46927),g=i(82534),b=i(79986),f=i(98478),v=i(86659),y=i(50641),x=i(1515);const I=(0,x.Z)("div",{target:"e116k4er3"})((t=>{let{theme:e}=t;return{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",borderWidth:"1px",borderStyle:"solid",borderColor:e.colors.widgetBorderColor||e.colors.widgetBackgroundColor||e.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.lg,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}}),""),C=(0,x.Z)("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),V=(0,x.Z)("button",{target:"e116k4er1"})((t=>{let{theme:e}=t;return{margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:"".concat(32,"px"),justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.widgetBackgroundColor||e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:e.radii.lg,borderBottomRightRadius:e.radii.lg},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}}),""),w=(0,x.Z)("div",{target:"e116k4er0"})((t=>{let{theme:e,clearable:i}=t;return{position:"absolute",marginRight:e.spacing.twoXS,left:0,right:"".concat(64+(i?12:0),"px")}}),"");var F=i(70479),D=i.n(F),k=i(40864);class S extends s.PureComponent{constructor(t){super(t),this.formClearHelper=new l.K,this.id=void 0,this.inputRef=s.createRef(),this.formatValue=t=>{if((0,y.le)(t))return null;const e=function(t){return null==t||""===t?void 0:t}(this.props.element.format);if(null==e)return t.toString();try{return(0,a.sprintf)(e,t)}catch(i){return(0,d.KE)("Error in sprintf(".concat(e,", ").concat(t,"): ").concat(i)),String(t)}},this.isIntData=()=>this.props.element.dataType===u.Y2.DataType.INT,this.getMin=()=>this.props.element.hasMin?this.props.element.min:-1/0,this.getMax=()=>this.props.element.hasMax?this.props.element.max:1/0,this.getStep=()=>{const{step:t}=this.props.element;return t||(this.isIntData()?1:.01)},this.commitWidgetValue=t=>{const{value:e}=this.state,{element:i,widgetMgr:s}=this.props,r=this.props.element,o=this.getMin(),n=this.getMax();if((0,y.bb)(e)&&(o>e||e>n)){const t=this.inputRef.current;t&&t.reportValidity()}else{var a;const o=null!==(a=null!==e&&void 0!==e?e:r.default)&&void 0!==a?a:null;this.isIntData()?s.setIntValue(i,o,t):s.setDoubleValue(i,o,t),this.setState({dirty:!1,value:o,formattedValue:this.formatValue(o)})}},this.onFormCleared=()=>{this.setState(((t,e)=>{var i;return{value:null!==(i=e.element.default)&&void 0!==i?i:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0}),this.setState({isFocused:!1})},this.onFocus=()=>{this.setState({isFocused:!0})},this.onChange=t=>{const{value:e}=t.target;if(""===e)this.setState({dirty:!0,value:null,formattedValue:null});else{let t;t=this.isIntData()?parseInt(e,10):parseFloat(e),this.setState({dirty:!0,value:t,formattedValue:e})}},this.onKeyDown=t=>{const{key:e}=t;switch(e){case"ArrowUp":t.preventDefault(),this.modifyValueUsingStep("increment")();break;case"ArrowDown":t.preventDefault(),this.modifyValueUsingStep("decrement")()}},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,y.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId))},this.modifyValueUsingStep=t=>()=>{const{value:e}=this.state,i=this.getStep();switch(t){case"increment":this.canIncrement&&this.setState({dirty:!0,value:(null!==e&&void 0!==e?e:this.getMin())+i},(()=>{this.commitWidgetValue({fromUi:!0})}));break;case"decrement":this.canDecrement&&this.setState({dirty:!0,value:(null!==e&&void 0!==e?e:this.getMax())-i},(()=>{this.commitWidgetValue({fromUi:!0})}))}},this.state={dirty:!1,value:this.initialValue,formattedValue:this.formatValue(this.initialValue),isFocused:!1},this.id=D()("number_input_")}get initialValue(){var t;const e=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null,formattedValue:this.formatValue(null!==t&&void 0!==t?t:null)},(()=>{this.commitWidgetValue({fromUi:!1})}))}get canDecrement(){return!(0,y.le)(this.state.value)&&this.state.value-this.getStep()>=this.getMin()}get canIncrement(){return!(0,y.le)(this.state.value)&&this.state.value+this.getStep()<=this.getMax()}render(){var t;const{element:e,width:i,disabled:s,widgetMgr:n,theme:a}=this.props,{formattedValue:l,dirty:d,isFocused:u}=this.state,x={width:i},F=!this.canDecrement||s,D=!this.canIncrement||s,S=(0,y.le)(e.default)&&!s;return this.formClearHelper.manageFormClearListener(n,e.formId,this.onFormCleared),(0,k.jsxs)("div",{className:"stNumberInput",style:x,"data-testid":"stNumberInput",children:[(0,k.jsx)(f.O,{label:e.label,disabled:s,labelVisibility:(0,y.iF)(null===(t=e.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:e.help&&(0,k.jsx)(v.dT,{children:(0,k.jsx)(h.Z,{content:e.help,placement:m.u.TOP_RIGHT})})}),(0,k.jsxs)(I,{className:u?"focused":"","data-testid":"stNumberInputContainer",children:[(0,k.jsx)(g.Z,{type:"number",inputRef:this.inputRef,value:null!==l&&void 0!==l?l:"",placeholder:e.placeholder,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,clearable:S,clearOnEscape:S,disabled:s,"aria-label":e.label,id:this.id,overrides:{ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,transform:"scale(1.4)",width:a.spacing.twoXL,marginRight:"-1.25em",":hover":{fill:a.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInput-Input",step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),i>c.A.hideNumberInputControls&&(0,k.jsxs)(C,{children:[(0,k.jsx)(V,{className:"step-down","data-testid":"stNumberInput-StepDown",onClick:this.modifyValueUsingStep("decrement"),disabled:F,tabIndex:-1,children:(0,k.jsx)(p.Z,{content:r.W,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),(0,k.jsx)(V,{className:"step-up","data-testid":"stNumberInput-StepUp",onClick:this.modifyValueUsingStep("increment"),disabled:D,tabIndex:-1,children:(0,k.jsx)(p.Z,{content:o.v,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),i>c.A.hideWidgetDetails&&(0,k.jsx)(w,{clearable:S,children:(0,k.jsx)(b.Z,{dirty:d,value:null!==l&&void 0!==l?l:"",className:"input-instructions",inForm:(0,y.$b)({formId:e.formId})})})]})}}const M=(0,n.b)(S)}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8691],{79986:(t,e,r)=>{"use strict";r.d(e,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),s=r(50669),a=r(1515);const l=(0,r(7865).F4)(n||(n=(0,s.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),u=(0,a.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:r,theme:n}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var c=r(40864);const d=t=>{let{dirty:e,value:r,maxLength:n,className:s,type:a="single",inForm:l}=t;const d=[],p=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,c.jsx)(u,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};if(e){const t=l?"submit form":"apply";if("multiline"===a){const e=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(e,"+Enter to ").concat(t))}else"single"===a&&p("Press Enter to ".concat(t))}return n&&("chat"!==a||e)&&p("".concat(r.length,"/").concat(n),e&&r.length>=n),(0,c.jsx)(i.X7,{"data-testid":"InputInstructions",className:s,children:d})}},87814:(t,e,r)=>{"use strict";r.d(e,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,r){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,n.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,r),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},58691:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>v});var n=r(66845),o=r(70479),i=r.n(o),s=r(82534),a=r(16295),l=r(87814),u=r(79986),c=r(98478),d=r(86659),p=r(8879),h=r(68411),f=r(50641),m=r(48266);const y=(0,r(1515).Z)("div",{target:"e11y4ecf0"})((t=>{let{width:e}=t;return{position:"relative",width:e}}),"");var b=r(40864);class g extends n.PureComponent{constructor(t){var e;super(t),e=this,this.formClearHelper=new l.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=function(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.props.widgetMgr.setStringValue(e.props.element,e.state.value,t),r&&e.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((t,e)=>{var r;return{value:null!==(r=e.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=t=>{const{value:e}=t.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&e.length>n||((0,f.$b)(this.props.element)?this.setState({dirty:!0,value:e},(()=>{this.commitWidgetValue({fromUi:!0},!1)})):this.setState({dirty:!0,value:e}))},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,f.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId))},this.id=i()("text_input_")}get initialValue(){var t;const e=this.props.widgetMgr.getStringValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}getTypeString(){return this.props.element.type===a.oi.Type.PASSWORD?"password":"text"}render(){var t;const{dirty:e,value:r}=this.state,{element:n,width:o,disabled:i,widgetMgr:a}=this.props,{placeholder:l}=n;return this.formClearHelper.manageFormClearListener(a,n.formId,this.onFormCleared),(0,b.jsxs)(y,{className:"row-widget stTextInput","data-testid":"stTextInput",width:o,children:[(0,b.jsx)(c.O,{label:n.label,disabled:i,labelVisibility:(0,f.iF)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:n.help&&(0,b.jsx)(d.dT,{children:(0,b.jsx)(p.Z,{content:n.help,placement:h.u.TOP_RIGHT})})}),(0,b.jsx)(s.Z,{value:null!==r&&void 0!==r?r:"",placeholder:l,onBlur:this.onBlur,onChange:this.onChange,onKeyPress:this.onKeyPress,"aria-label":n.label,disabled:i,id:this.id,type:this.getTypeString(),autoComplete:n.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},Root:{props:{"data-testid":"textInputRootElement"},style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}}}}),o>m.A.hideWidgetDetails&&(0,b.jsx)(u.Z,{dirty:e,value:null!==r&&void 0!==r?r:"",maxLength:n.maxChars,inForm:(0,f.$b)({formId:n.formId})})]})}}const v=g},82534:(t,e,r)=>{"use strict";r.d(e,{Z:()=>C});var n=r(66845),o=r(80318),i=r(32510),s=r(9656),a=r(98479),l=r(38254);function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var c=["Root","StartEnhancer","EndEnhancer"],d=["startEnhancer","endEnhancer","overrides"];function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p.apply(this,arguments)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=w(t);if(e){var o=w(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===u(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}(this,r)}}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function j(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var O=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b(t,e)}(w,t);var e,r,u,f=g(w);function w(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,w);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return j(v(t=f.call.apply(f,[this].concat(r))),"state",{isFocused:t.props.autoFocus||!1}),j(v(t),"onFocus",(function(e){t.setState({isFocused:!0}),t.props.onFocus(e)})),j(v(t),"onBlur",(function(e){t.setState({isFocused:!1}),t.props.onBlur(e)})),t}return e=w,(r=[{key:"render",value:function(){var t=this.props,e=t.startEnhancer,r=t.endEnhancer,u=t.overrides,f=u.Root,y=u.StartEnhancer,b=u.EndEnhancer,g=m(u,c),v=m(t,d),w=h((0,o.jb)(f,a.fC),2),j=w[0],O=w[1],C=h((0,o.jb)(y,a.Fp),2),S=C[0],P=C[1],E=h((0,o.jb)(b,a.Fp),2),I=E[0],W=E[1],V=(0,i.t)(this.props,this.state);return n.createElement(j,p({"data-baseweb":"input"},V,O,{$adjoined:F(e,r),$hasIconTrailing:this.props.clearable||"password"==this.props.type}),x(e)&&n.createElement(S,p({},V,P,{$position:l.Xf.start}),"function"===typeof e?e(V):e),n.createElement(s.Z,p({},v,{overrides:g,adjoined:F(e,r),onFocus:this.onFocus,onBlur:this.onBlur})),x(r)&&n.createElement(I,p({},V,W,{$position:l.Xf.end}),"function"===typeof r?r(V):r))}}])&&y(e.prototype,r),u&&y(e,u),Object.defineProperty(e,"prototype",{writable:!1}),w}(n.Component);function F(t,e){return x(t)&&x(e)?l.y4.both:x(t)?l.y4.left:x(e)?l.y4.right:l.y4.none}function x(t){return Boolean(t||0===t)}j(O,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:l.NO.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});const C=O},70479:(t,e,r)=>{var n=r(38145),o=0;t.exports=function(t){var e=++o;return n(t)+e}}}]);