streamlit-nightly 1.38.1.dev20240909__py2.py3-none-any.whl → 1.38.1.dev20240910__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 (90) hide show
  1. streamlit/__init__.py +1 -1
  2. streamlit/cli_util.py +59 -0
  3. streamlit/commands/experimental_query_params.py +33 -10
  4. streamlit/commands/page_config.py +6 -3
  5. streamlit/components/v1/custom_component.py +3 -5
  6. streamlit/config_option.py +3 -3
  7. streamlit/delta_generator.py +1 -1
  8. streamlit/elements/arrow.py +1 -1
  9. streamlit/elements/form.py +1 -1
  10. streamlit/elements/lib/built_in_chart_utils.py +1 -2
  11. streamlit/{color_util.py → elements/lib/color_util.py} +8 -20
  12. streamlit/elements/lib/options_selector_utils.py +191 -4
  13. streamlit/elements/lib/policies.py +1 -1
  14. streamlit/elements/lib/utils.py +11 -168
  15. streamlit/elements/map.py +6 -1
  16. streamlit/elements/plotly_chart.py +1 -1
  17. streamlit/elements/vega_charts.py +2 -2
  18. streamlit/elements/widgets/button.py +7 -5
  19. streamlit/elements/widgets/button_group.py +8 -8
  20. streamlit/elements/widgets/camera_input.py +1 -1
  21. streamlit/elements/widgets/chat.py +7 -5
  22. streamlit/elements/widgets/checkbox.py +1 -1
  23. streamlit/elements/widgets/color_picker.py +1 -1
  24. streamlit/elements/widgets/data_editor.py +1 -1
  25. streamlit/elements/widgets/file_uploader.py +1 -1
  26. streamlit/elements/widgets/multiselect.py +3 -5
  27. streamlit/elements/widgets/number_input.py +2 -2
  28. streamlit/elements/widgets/radio.py +3 -6
  29. streamlit/elements/widgets/select_slider.py +7 -5
  30. streamlit/elements/widgets/selectbox.py +3 -6
  31. streamlit/elements/widgets/slider.py +2 -2
  32. streamlit/elements/widgets/text_widgets.py +1 -1
  33. streamlit/elements/widgets/time_widgets.py +1 -1
  34. streamlit/errors.py +22 -0
  35. streamlit/file_util.py +4 -4
  36. streamlit/net_util.py +4 -2
  37. streamlit/runtime/app_session.py +1 -1
  38. streamlit/runtime/caching/storage/local_disk_cache_storage.py +2 -2
  39. streamlit/runtime/state/__init__.py +1 -5
  40. streamlit/runtime/state/common.py +1 -14
  41. streamlit/runtime/state/query_params.py +9 -2
  42. streamlit/runtime/state/widgets.py +0 -9
  43. streamlit/static/asset-manifest.json +19 -19
  44. streamlit/static/index.html +1 -1
  45. streamlit/static/static/js/1260.4017a70f.chunk.js +5 -0
  46. streamlit/static/static/js/{245.532167ed.chunk.js → 245.68a062da.chunk.js} +1 -1
  47. streamlit/static/static/js/{3156.0542d233.chunk.js → 3156.002c6ee0.chunk.js} +1 -1
  48. streamlit/static/static/js/3560.ce031236.chunk.js +1 -0
  49. streamlit/static/static/js/{4103.2a961369.chunk.js → 4103.d863052a.chunk.js} +1 -1
  50. streamlit/static/static/js/{5180.5e064ef1.chunk.js → 5180.e826dd46.chunk.js} +1 -1
  51. streamlit/static/static/js/5618.08be9e66.chunk.js +5 -0
  52. streamlit/static/static/js/{5625.0394ecdc.chunk.js → 5625.3a8dc81f.chunk.js} +1 -1
  53. streamlit/static/static/js/{5711.28939a95.chunk.js → 5711.2f36e813.chunk.js} +1 -1
  54. streamlit/static/static/js/6088.c137d543.chunk.js +1 -0
  55. streamlit/static/static/js/{6360.17e58a87.chunk.js → 6360.6d7cfa35.chunk.js} +1 -1
  56. streamlit/static/static/js/{7193.bc9bdd04.chunk.js → 7193.2594a18c.chunk.js} +1 -1
  57. streamlit/static/static/js/8166.11abccb8.chunk.js +1 -0
  58. streamlit/static/static/js/{8237.ed5d881b.chunk.js → 8237.210a5ac4.chunk.js} +1 -1
  59. streamlit/static/static/js/8815.0284d089.chunk.js +1 -0
  60. streamlit/static/static/js/9114.1ee3d4dd.chunk.js +1 -0
  61. streamlit/static/static/js/954.3cc76210.chunk.js +5 -0
  62. streamlit/static/static/js/{main.5d1dd93c.js → main.7b7fe9ac.js} +2 -2
  63. streamlit/string_util.py +13 -5
  64. streamlit/time_util.py +3 -14
  65. streamlit/util.py +1 -127
  66. streamlit/watcher/local_sources_watcher.py +1 -1
  67. streamlit/web/bootstrap.py +2 -2
  68. streamlit/web/cli.py +2 -2
  69. {streamlit_nightly-1.38.1.dev20240909.dist-info → streamlit_nightly-1.38.1.dev20240910.dist-info}/METADATA +1 -1
  70. {streamlit_nightly-1.38.1.dev20240909.dist-info → streamlit_nightly-1.38.1.dev20240910.dist-info}/RECORD +79 -82
  71. streamlit/case_converters.py +0 -91
  72. streamlit/code_util.py +0 -90
  73. streamlit/constants.py +0 -19
  74. streamlit/static/static/js/1260.5ebd5704.chunk.js +0 -5
  75. streamlit/static/static/js/3560.17463b1c.chunk.js +0 -1
  76. streamlit/static/static/js/5618.6d42e995.chunk.js +0 -5
  77. streamlit/static/static/js/6088.00849717.chunk.js +0 -1
  78. streamlit/static/static/js/8166.0d1971ea.chunk.js +0 -1
  79. streamlit/static/static/js/8815.0b7dc879.chunk.js +0 -1
  80. streamlit/static/static/js/9114.c676bef4.chunk.js +0 -1
  81. streamlit/static/static/js/954.bf90fe19.chunk.js +0 -5
  82. /streamlit/{echo.py → commands/echo.py} +0 -0
  83. /streamlit/elements/{form_utils.py → lib/form_utils.py} +0 -0
  84. /streamlit/{js_number.py → elements/lib/js_number.py} +0 -0
  85. /streamlit/static/static/js/{main.5d1dd93c.js.LICENSE.txt → main.7b7fe9ac.js.LICENSE.txt} +0 -0
  86. /streamlit/{folder_black_list.py → watcher/folder_black_list.py} +0 -0
  87. {streamlit_nightly-1.38.1.dev20240909.data → streamlit_nightly-1.38.1.dev20240910.data}/scripts/streamlit.cmd +0 -0
  88. {streamlit_nightly-1.38.1.dev20240909.dist-info → streamlit_nightly-1.38.1.dev20240910.dist-info}/WHEEL +0 -0
  89. {streamlit_nightly-1.38.1.dev20240909.dist-info → streamlit_nightly-1.38.1.dev20240910.dist-info}/entry_points.txt +0 -0
  90. {streamlit_nightly-1.38.1.dev20240909.dist-info → streamlit_nightly-1.38.1.dev20240910.dist-info}/top_level.txt +0 -0
streamlit/file_util.py CHANGED
@@ -20,7 +20,7 @@ import io
20
20
  import os
21
21
  from pathlib import Path
22
22
 
23
- from streamlit import env_util, util
23
+ from streamlit import env_util, errors
24
24
  from streamlit.string_util import is_binary_string
25
25
 
26
26
  # Configuration and credentials are stored inside the ~/.streamlit folder
@@ -77,7 +77,7 @@ def streamlit_read(path, binary=False):
77
77
  """
78
78
  filename = get_streamlit_file_path(path)
79
79
  if os.stat(filename).st_size == 0:
80
- raise util.Error('Read zero byte file: "%s"' % filename)
80
+ raise errors.Error(f'Read zero byte file: "{filename}"')
81
81
 
82
82
  mode = "r"
83
83
  if binary:
@@ -109,13 +109,13 @@ def streamlit_write(path, binary=False):
109
109
  with open(path, mode) as handle:
110
110
  yield handle
111
111
  except OSError as e:
112
- msg = ["Unable to write file: %s" % os.path.abspath(path)]
112
+ msg = [f"Unable to write file: {os.path.abspath(path)}"]
113
113
  if e.errno == errno.EINVAL and env_util.IS_DARWIN:
114
114
  msg.append(
115
115
  "Python is limited to files below 2GB on OSX. "
116
116
  "See https://bugs.python.org/issue24658"
117
117
  )
118
- raise util.Error("\n".join(msg))
118
+ raise errors.Error("\n".join(msg))
119
119
 
120
120
 
121
121
  def get_static_dir() -> str:
streamlit/net_util.py CHANGED
@@ -16,7 +16,6 @@ from __future__ import annotations
16
16
 
17
17
  from typing import Final
18
18
 
19
- from streamlit import util
20
19
  from streamlit.logger import get_logger
21
20
 
22
21
  _LOGGER: Final = get_logger(__name__)
@@ -25,6 +24,9 @@ _LOGGER: Final = get_logger(__name__)
25
24
  _AWS_CHECK_IP: Final = "http://checkip.amazonaws.com"
26
25
  _AWS_CHECK_IP_HTTPS: Final = "https://checkip.amazonaws.com"
27
26
 
27
+ # URL of Streamlit's help page.
28
+ _HELP_DOC: Final = "https://docs.streamlit.io/"
29
+
28
30
  _external_ip: str | None = None
29
31
  _internal_ip: str | None = None
30
32
 
@@ -53,7 +55,7 @@ def get_external_ip() -> str | None:
53
55
  else:
54
56
  _LOGGER.warning(
55
57
  "Did not auto detect external IP.\nPlease go to %s for debugging hints.",
56
- util.HELP_DOC,
58
+ _HELP_DOC,
57
59
  )
58
60
  _external_ip = None
59
61
 
@@ -22,7 +22,6 @@ from typing import TYPE_CHECKING, Callable, Final
22
22
 
23
23
  import streamlit.elements.exception as exception_utils
24
24
  from streamlit import config, runtime
25
- from streamlit.case_converters import to_snake_case
26
25
  from streamlit.logger import get_logger
27
26
  from streamlit.proto.ClientState_pb2 import ClientState
28
27
  from streamlit.proto.Common_pb2 import FileURLs, FileURLsRequest
@@ -41,6 +40,7 @@ from streamlit.runtime.metrics_util import Installation
41
40
  from streamlit.runtime.pages_manager import PagesManager
42
41
  from streamlit.runtime.scriptrunner import RerunData, ScriptRunner, ScriptRunnerEvent
43
42
  from streamlit.runtime.secrets import secrets_singleton
43
+ from streamlit.string_util import to_snake_case
44
44
  from streamlit.version import STREAMLIT_VERSION_STRING
45
45
  from streamlit.watcher import LocalSourcesWatcher
46
46
 
@@ -63,7 +63,7 @@ import os
63
63
  import shutil
64
64
  from typing import Final
65
65
 
66
- from streamlit import util
66
+ from streamlit import errors
67
67
  from streamlit.file_util import get_streamlit_file_path, streamlit_read, streamlit_write
68
68
  from streamlit.logger import get_logger
69
69
  from streamlit.runtime.caching.storage.cache_storage_protocol import (
@@ -164,7 +164,7 @@ class LocalDiskCacheStorage(CacheStorage):
164
164
  try:
165
165
  with streamlit_write(path, binary=True) as output:
166
166
  output.write(value)
167
- except util.Error as e:
167
+ except errors.Error as e:
168
168
  _LOGGER.debug(e)
169
169
  # Clean up file so we don't leave zero byte files.
170
170
  try:
@@ -24,10 +24,7 @@ from streamlit.runtime.state.session_state_proxy import (
24
24
  SessionStateProxy,
25
25
  get_session_state,
26
26
  )
27
- from streamlit.runtime.state.widgets import (
28
- NoValue,
29
- register_widget,
30
- )
27
+ from streamlit.runtime.state.widgets import register_widget
31
28
 
32
29
  __all__ = [
33
30
  "WidgetArgs",
@@ -40,6 +37,5 @@ __all__ = [
40
37
  "SessionStateStatProvider",
41
38
  "SessionStateProxy",
42
39
  "get_session_state",
43
- "NoValue",
44
40
  "register_widget",
45
41
  ]
@@ -18,7 +18,6 @@ from __future__ import annotations
18
18
 
19
19
  from dataclasses import dataclass, field
20
20
  from typing import (
21
- TYPE_CHECKING,
22
21
  Any,
23
22
  Callable,
24
23
  Dict,
@@ -34,7 +33,7 @@ from typing import (
34
33
 
35
34
  from typing_extensions import TypeAlias, TypeGuard
36
35
 
37
- from streamlit import config, util
36
+ from streamlit import util
38
37
  from streamlit.errors import (
39
38
  StreamlitAPIException,
40
39
  )
@@ -60,10 +59,6 @@ from streamlit.proto.TextArea_pb2 import TextArea
60
59
  from streamlit.proto.TextInput_pb2 import TextInput
61
60
  from streamlit.proto.TimeInput_pb2 import TimeInput
62
61
 
63
- if TYPE_CHECKING:
64
- from streamlit.runtime.scriptrunner_utils.script_run_context import ScriptRunContext
65
-
66
-
67
62
  # Protobuf types for all widgets.
68
63
  WidgetProto: TypeAlias = Union[
69
64
  Arrow,
@@ -242,11 +237,3 @@ def require_valid_user_key(key: str) -> None:
242
237
  raise StreamlitAPIException(
243
238
  f"Keys beginning with {GENERATED_ELEMENT_ID_PREFIX} are reserved."
244
239
  )
245
-
246
-
247
- def save_for_app_testing(ctx: ScriptRunContext, k: str, v: Any):
248
- if config.get_option("global.appTest"):
249
- try:
250
- ctx.session_state[TESTING_KEY][k] = v
251
- except KeyError:
252
- ctx.session_state[TESTING_KEY] = {k: v}
@@ -15,10 +15,9 @@
15
15
  from __future__ import annotations
16
16
 
17
17
  from dataclasses import dataclass, field
18
- from typing import TYPE_CHECKING, Iterable, Iterator, MutableMapping
18
+ from typing import TYPE_CHECKING, Final, Iterable, Iterator, MutableMapping
19
19
  from urllib import parse
20
20
 
21
- from streamlit.constants import EMBED_QUERY_PARAMS_KEYS
22
21
  from streamlit.errors import StreamlitAPIException
23
22
  from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
24
23
  from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_run_ctx
@@ -27,6 +26,14 @@ if TYPE_CHECKING:
27
26
  from _typeshed import SupportsKeysAndGetItem
28
27
 
29
28
 
29
+ EMBED_QUERY_PARAM: Final[str] = "embed"
30
+ EMBED_OPTIONS_QUERY_PARAM: Final[str] = "embed_options"
31
+ EMBED_QUERY_PARAMS_KEYS: Final[list[str]] = [
32
+ EMBED_QUERY_PARAM,
33
+ EMBED_OPTIONS_QUERY_PARAM,
34
+ ]
35
+
36
+
30
37
  @dataclass
31
38
  class QueryParams(MutableMapping[str, str]):
32
39
  """A lightweight wrapper of a dict that sends forwardMsgs when state changes.
@@ -75,15 +75,6 @@ ELEMENT_TYPE_TO_VALUE_TYPE: Final[Mapping[ElementType, ValueFieldName]] = (
75
75
  )
76
76
 
77
77
 
78
- class NoValue:
79
- """Return this from DeltaGenerator.foo_widget() when you want the st.foo_widget()
80
- call to return None. This is needed because `DeltaGenerator._enqueue`
81
- replaces `None` with a `DeltaGenerator` (for use in non-widget elements).
82
- """
83
-
84
- pass
85
-
86
-
87
78
  def register_widget(
88
79
  element_type: ElementType,
89
80
  element_proto: WidgetProto,
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.5513bd04.css",
4
- "main.js": "./static/js/main.5d1dd93c.js",
4
+ "main.js": "./static/js/main.7b7fe9ac.js",
5
5
  "static/js/6679.265ca09c.chunk.js": "./static/js/6679.265ca09c.chunk.js",
6
6
  "static/js/9464.7e9a3c0a.chunk.js": "./static/js/9464.7e9a3c0a.chunk.js",
7
7
  "static/js/9077.e0a8db2a.chunk.js": "./static/js/9077.e0a8db2a.chunk.js",
8
8
  "static/js/3391.663b9d47.chunk.js": "./static/js/3391.663b9d47.chunk.js",
9
9
  "static/css/3156.93909c7e.chunk.css": "./static/css/3156.93909c7e.chunk.css",
10
- "static/js/3156.0542d233.chunk.js": "./static/js/3156.0542d233.chunk.js",
10
+ "static/js/3156.002c6ee0.chunk.js": "./static/js/3156.002c6ee0.chunk.js",
11
11
  "static/css/5711.c24b25fa.chunk.css": "./static/css/5711.c24b25fa.chunk.css",
12
- "static/js/5711.28939a95.chunk.js": "./static/js/5711.28939a95.chunk.js",
12
+ "static/js/5711.2f36e813.chunk.js": "./static/js/5711.2f36e813.chunk.js",
13
13
  "static/js/3861.0dedcd19.chunk.js": "./static/js/3861.0dedcd19.chunk.js",
14
14
  "static/js/8642.dfef7dcb.chunk.js": "./static/js/8642.dfef7dcb.chunk.js",
15
15
  "static/js/7493.95e79b96.chunk.js": "./static/js/7493.95e79b96.chunk.js",
@@ -18,28 +18,28 @@
18
18
  "static/js/9923.7061d124.chunk.js": "./static/js/9923.7061d124.chunk.js",
19
19
  "static/js/583.61ac7fde.chunk.js": "./static/js/583.61ac7fde.chunk.js",
20
20
  "static/js/4827.f9cb5fa3.chunk.js": "./static/js/4827.f9cb5fa3.chunk.js",
21
- "static/js/8237.ed5d881b.chunk.js": "./static/js/8237.ed5d881b.chunk.js",
21
+ "static/js/8237.210a5ac4.chunk.js": "./static/js/8237.210a5ac4.chunk.js",
22
22
  "static/js/5828.f8572ba4.chunk.js": "./static/js/5828.f8572ba4.chunk.js",
23
23
  "static/js/9060.1ec8dc2b.chunk.js": "./static/js/9060.1ec8dc2b.chunk.js",
24
- "static/js/5625.0394ecdc.chunk.js": "./static/js/5625.0394ecdc.chunk.js",
24
+ "static/js/5625.3a8dc81f.chunk.js": "./static/js/5625.3a8dc81f.chunk.js",
25
25
  "static/js/6141.43a8fda3.chunk.js": "./static/js/6141.43a8fda3.chunk.js",
26
- "static/js/4103.2a961369.chunk.js": "./static/js/4103.2a961369.chunk.js",
26
+ "static/js/4103.d863052a.chunk.js": "./static/js/4103.d863052a.chunk.js",
27
27
  "static/js/1086.1bb52316.chunk.js": "./static/js/1086.1bb52316.chunk.js",
28
- "static/js/245.532167ed.chunk.js": "./static/js/245.532167ed.chunk.js",
29
- "static/js/7193.bc9bdd04.chunk.js": "./static/js/7193.bc9bdd04.chunk.js",
30
- "static/js/6360.17e58a87.chunk.js": "./static/js/6360.17e58a87.chunk.js",
28
+ "static/js/245.68a062da.chunk.js": "./static/js/245.68a062da.chunk.js",
29
+ "static/js/7193.2594a18c.chunk.js": "./static/js/7193.2594a18c.chunk.js",
30
+ "static/js/6360.6d7cfa35.chunk.js": "./static/js/6360.6d7cfa35.chunk.js",
31
31
  "static/js/8790.0b98f286.chunk.js": "./static/js/8790.0b98f286.chunk.js",
32
- "static/js/8815.0b7dc879.chunk.js": "./static/js/8815.0b7dc879.chunk.js",
32
+ "static/js/8815.0284d089.chunk.js": "./static/js/8815.0284d089.chunk.js",
33
33
  "static/js/9528.746f7a0e.chunk.js": "./static/js/9528.746f7a0e.chunk.js",
34
34
  "static/js/7809.063e3004.chunk.js": "./static/js/7809.063e3004.chunk.js",
35
- "static/js/6088.00849717.chunk.js": "./static/js/6088.00849717.chunk.js",
36
- "static/js/8166.0d1971ea.chunk.js": "./static/js/8166.0d1971ea.chunk.js",
37
- "static/js/9114.c676bef4.chunk.js": "./static/js/9114.c676bef4.chunk.js",
38
- "static/js/5180.5e064ef1.chunk.js": "./static/js/5180.5e064ef1.chunk.js",
39
- "static/js/5618.6d42e995.chunk.js": "./static/js/5618.6d42e995.chunk.js",
40
- "static/js/1260.5ebd5704.chunk.js": "./static/js/1260.5ebd5704.chunk.js",
41
- "static/js/3560.17463b1c.chunk.js": "./static/js/3560.17463b1c.chunk.js",
42
- "static/js/954.bf90fe19.chunk.js": "./static/js/954.bf90fe19.chunk.js",
35
+ "static/js/6088.c137d543.chunk.js": "./static/js/6088.c137d543.chunk.js",
36
+ "static/js/8166.11abccb8.chunk.js": "./static/js/8166.11abccb8.chunk.js",
37
+ "static/js/9114.1ee3d4dd.chunk.js": "./static/js/9114.1ee3d4dd.chunk.js",
38
+ "static/js/5180.e826dd46.chunk.js": "./static/js/5180.e826dd46.chunk.js",
39
+ "static/js/5618.08be9e66.chunk.js": "./static/js/5618.08be9e66.chunk.js",
40
+ "static/js/1260.4017a70f.chunk.js": "./static/js/1260.4017a70f.chunk.js",
41
+ "static/js/3560.ce031236.chunk.js": "./static/js/3560.ce031236.chunk.js",
42
+ "static/js/954.3cc76210.chunk.js": "./static/js/954.3cc76210.chunk.js",
43
43
  "static/js/3966.e0686958.chunk.js": "./static/js/3966.e0686958.chunk.js",
44
44
  "static/js/8161.9b75f98a.chunk.js": "./static/js/8161.9b75f98a.chunk.js",
45
45
  "static/js/6817.6adfea98.chunk.js": "./static/js/6817.6adfea98.chunk.js",
@@ -153,6 +153,6 @@
153
153
  },
154
154
  "entrypoints": [
155
155
  "static/css/main.5513bd04.css",
156
- "static/js/main.5d1dd93c.js"
156
+ "static/js/main.7b7fe9ac.js"
157
157
  ]
158
158
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.5d1dd93c.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.7b7fe9ac.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -0,0 +1,5 @@
1
+ (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1260],{68035:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});r(58878);var n=r(25571),o=r(78286),i=r(89653);const s=r(60667).i7`
2
+ 50% {
3
+ color: rgba(0, 0, 0, 0);
4
+ }
5
+ `,a=(0,i.A)("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:`${s}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(90782);const u=t=>{let{dirty:e,value:r,maxLength:i,className:s,type:u="single",inForm:c}=t;const d=[],p=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,l.jsx)(a,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};if(e){const t=c?"submit form":"apply";if("multiline"===u){p(`Press ${(0,n.u_)()?"\u2318":"Ctrl"}+Enter to ${t}`)}else"single"===u&&p(`Press Enter to ${t}`)}return i&&("chat"!==u||e)&&p(`${r.length}/${i}`,e&&r.length>=i),(0,l.jsx)(o.tp,{"data-testid":"InputInstructions",className:s,children:d})}},34752:(t,e,r)=>{"use strict";r.d(e,{X:()=>s,o:()=>i});var n=r(58878),o=r(25571);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,r){(0,o.se)(this.formClearListener)&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,o._L)(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}}function s(t){let{element:e,widgetMgr:r,onFormCleared:i}=t;(0,n.useEffect)((()=>{if(!(0,o._L)(e.formId))return;const t=r.addFormClearedListener(e.formId,i);return()=>{t.disconnect()}}),[e,r,i])}},81260:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>v});var n=r(58878),o=r(32698),i=r.n(o),s=r(59095),a=r(8151),l=r(29669),u=r(34752),c=r(68035),d=r(70474),p=r(78286),h=r(93480),f=r(997),m=r(25571);const y=(0,r(89653).A)("div",{target:"e11y4ecf0"})((t=>{let{width:e}=t;return{position:"relative",width:e}}),"");var b=r(90782);class g extends n.PureComponent{constructor(t){var e;super(t),e=this,this.formClearHelper=new u.o,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];const{widgetMgr:n,element:o,fragmentId:i}=e.props;n.setStringValue(o,e.state.value,t,i),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,m.Ml)(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,m.Ml)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId))},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===l.ks.Type.PASSWORD?"password":"text"}render(){var t;const{dirty:e,value:r}=this.state,{element:n,width:o,disabled:i,widgetMgr:a,theme:l}=this.props,{placeholder:u}=n;return this.formClearHelper.manageFormClearListener(a,n.formId,this.onFormCleared),(0,b.jsxs)(y,{className:"stTextInput","data-testid":"stTextInput",width:o,children:[(0,b.jsx)(d.L,{label:n.label,disabled:i,labelVisibility:(0,m.yv)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:n.help&&(0,b.jsx)(p.j,{children:(0,b.jsx)(h.A,{content:n.help,placement:f.W.TOP_RIGHT})})}),(0,b.jsx)(s.A,{value:null!==r&&void 0!==r?r:"",placeholder:u,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:l.lineHeights.inputWidget,paddingRight:l.spacing.sm,paddingLeft:l.spacing.sm,paddingBottom:l.spacing.sm,paddingTop:l.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:l.sizes.minElementHeight,borderLeftWidth:l.sizes.borderWidth,borderRightWidth:l.sizes.borderWidth,borderTopWidth:l.sizes.borderWidth,borderBottomWidth:l.sizes.borderWidth}}}}),o>l.breakpoints.hideWidgetDetails&&(0,b.jsx)(c.A,{dirty:e,value:null!==r&&void 0!==r?r:"",maxLength:n.maxChars,inForm:(0,m.Ml)({formId:n.formId})})]})}}const v=(0,a.b)(g)},59095:(t,e,r)=>{"use strict";r.d(e,{A:()=>P});var n=r(58878),o=r(35331),i=r(4842),s=r(18648),a=r(81301),l=r(92850);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 O(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var j=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 O(v(t=f.call.apply(f,[this].concat(r))),"state",{isFocused:t.props.autoFocus||!1}),O(v(t),"onFocus",(function(e){t.setState({isFocused:!0}),t.props.onFocus(e)})),O(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._O)(f,a.bL),2),O=w[0],j=w[1],P=h((0,o._O)(y,a.P2),2),S=P[0],E=P[1],x=h((0,o._O)(b,a.P2),2),I=x[0],W=x[1],_=(0,i.e)(this.props,this.state);return n.createElement(O,p({"data-baseweb":"input"},_,j,{$adjoined:C(e,r),$hasIconTrailing:this.props.clearable||"password"==this.props.type}),F(e)&&n.createElement(S,p({},_,E,{$position:l.vN.start}),"function"===typeof e?e(_):e),n.createElement(s.A,p({},v,{overrides:g,adjoined:C(e,r),onFocus:this.onFocus,onBlur:this.onBlur})),F(r)&&n.createElement(I,p({},_,W,{$position:l.vN.end}),"function"===typeof r?r(_):r))}}])&&y(e.prototype,r),u&&y(e,u),Object.defineProperty(e,"prototype",{writable:!1}),w}(n.Component);function C(t,e){return F(t)&&F(e)?l.fb.both:F(t)?l.fb.left:F(e)?l.fb.right:l.fb.none}function F(t){return Boolean(t||0===t)}O(j,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:l.SK.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});const P=j},32698:(t,e,r)=>{var n=r(30136),o=0;t.exports=function(t){var e=++o;return n(t)+e}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[245],{245:(e,t,o)=>{o.r(t),o.d(t,{default:()=>U});var r=o(58878),i=o(8151),n=o(35331),a=o(57224);function l(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function s(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?l(Object(o),!0).forEach((function(t){c(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):l(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function d(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme.colors;return t?o||r?l.tickFillDisabled:l.tickFill:i&&(r||o)?a?l.tickFillErrorSelectedHoverActive:n?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:n?l.tickFillErrorHover:l.tickFillError:r||o?a?l.tickFillSelectedHoverActive:n?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:n?l.tickFillHover:l.tickFill}function u(e){var t=e.$disabled,o=e.$theme.colors;return t?o.contentSecondary:o.contentPrimary}var h=(0,a.I4)("label",(function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:"top"===o||"bottom"===o?"column":"row",display:"flex",alignItems:"top"===o||"bottom"===o?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}}));h.displayName="Root",h.displayName="Root";var p=(0,a.I4)("span",(function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,s=n.animation,c=o?n.colors.tickMarkFillDisabled:r?n.colors.tickMarkFillError:n.colors.tickMarkFill,u=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(c,'"/>\n </svg>\n ')),h=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(c,'"/>\n </svg>\n ')),p=n.borders.checkboxBorderRadius,m=function(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:o||i?"transparent":r?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:s.timing200,transitionTimingFunction:s.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:m,borderRightColor:m,borderTopColor:m,borderBottomColor:m,borderTopLeftRadius:p,borderTopRightRadius:p,borderBottomRightRadius:p,borderBottomLeftRadius:p,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(u,"');"):t?"url('data:image/svg+xml,".concat(h,"');"):null,backgroundColor:d(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));p.displayName="Checkmark",p.displayName="Checkmark";var m=(0,a.I4)("div",(function(e){var t=e.$theme.typography;return s(s(s({verticalAlign:"middle"},function(e){var t,o=e.$labelPlacement,r=void 0===o?"":o,i=e.$theme,n=i.sizing.scale300;switch(r){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),c({},"padding".concat(t),n)}(e)),{},{color:u(e)},t.LabelMedium),{},{lineHeight:"24px"})}));m.displayName="Label",m.displayName="Label";var g=(0,a.I4)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});g.displayName="Input",g.displayName="Input";var b=(0,a.I4)("div",(function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat("rtl"===e.$theme.direction?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}}));b.displayName="Toggle",b.displayName="Toggle";var f=(0,a.I4)("div",(function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}}));f.displayName="ToggleTrack",f.displayName="ToggleTrack";var v=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),y=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),k=o(56498);function $(e){return $="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},$(e)}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},w.apply(this,arguments)}function F(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function C(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 o,r=T(e);if(t){var i=T(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return function(e,t){if(t&&("object"===$(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return R(e)}(this,o)}}function R(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T(e){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},T(e)}function L(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var S=function(e){return e.stopPropagation()},P=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)}(l,e);var t,o,i,a=C(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return L(R(e=a.call.apply(a,[this].concat(o))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),L(R(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),L(R(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),L(R(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),L(R(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),L(R(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,k.pP)(t)&&e.setState({isFocusVisible:!0})})),L(R(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=l,(o=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,o=e.inputRef;t&&o.current&&o.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,o=void 0===t?{}:t,i=e.onChange,a=e.labelPlacement,l=void 0===a?this.props.checkmarkType===v.toggle?"left":"right":a,s=e.inputRef,c=e.isIndeterminate,d=e.error,u=e.disabled,y=e.value,k=e.name,$=e.type,F=e.checked,x=e.children,C=e.required,R=e.title,T=o.Root,L=o.Checkmark,P=o.Label,O=o.Input,M=o.Toggle,j=o.ToggleTrack,B=(0,n.De)(T)||h,E=(0,n.De)(L)||p,I=(0,n.De)(P)||m,D=(0,n.De)(O)||g,V=(0,n.De)(M)||b,W=(0,n.De)(j)||f,H={onChange:i,onFocus:this.onFocus,onBlur:this.onBlur},z={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},A={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:d,$checked:F,$isIndeterminate:c,$required:C,$disabled:u,$value:y},N=x&&r.createElement(I,w({$labelPlacement:l},A,(0,n.PC)(P)),this.props.containsInteractiveElement?r.createElement("div",{onClick:function(e){return e.preventDefault()}},x):x);return r.createElement(B,w({"data-baseweb":"checkbox",title:R||null,$labelPlacement:l},A,z,(0,n.PC)(T)),("top"===l||"left"===l)&&N,this.props.checkmarkType===v.toggle?r.createElement(W,w({},A,(0,n.PC)(j)),r.createElement(V,w({},A,(0,n.PC)(M)))):r.createElement(E,w({},A,(0,n.PC)(L))),r.createElement(D,w({value:y,name:k,checked:F,required:C,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":c?"mixed":F,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":d||null,"aria-required":C||null,disabled:u,type:$,ref:s,onClick:S},A,H,(0,n.PC)(O))),("bottom"===l||"right"===l)&&N)}}])&&F(t.prototype,o),i&&F(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.Component);L(P,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:r.createRef(),error:!1,type:"checkbox",checkmarkType:v.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const O=P;var M=o(32735),j=o(25571),B=o(29669),E=o(34752),I=o(58144),D=o(93480),V=o(997),W=o(78286),H=o(34914),z=o(90114),A=o(90782);class N extends r.PureComponent{constructor(){super(...arguments),this.formClearHelper=new E.o,this.state={value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:o,fragmentId:r}=this.props;t.setBoolValue(o,this.state.value,e,r)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{const t=e.target.checked;this.setState({value:t},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){const e=this.props.widgetMgr.getBoolValue(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{theme:t,width:o,element:r,disabled:i,widgetMgr:n}=this.props,{colors:a,spacing:l,sizes:s}=t,c=(0,I.iq)(t),d=i?a.fadedText40:a.bodyText;return this.formClearHelper.manageFormClearListener(n,r.formId,this.onFormCleared),(0,A.jsx)(z.p,{className:"stCheckbox","data-testid":"stCheckbox",width:o,children:(0,A.jsx)(O,{checked:this.state.value,disabled:i,onChange:this.onChange,"aria-label":r.label,checkmarkType:r.type===B.Sc.StyleType.TOGGLE?v.toggle:v.default,labelPlacement:y.right,overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:l.none,marginTop:l.none,paddingRight:l.twoThirdsSmFont,backgroundColor:t?a.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Toggle:{style:e=>{let{$checked:o}=e,r=c?a.bgColor:a.bodyText;return i&&(r=c?a.gray70:a.gray90),{width:`calc(${s.checkbox} - ${t.spacing.twoXS})`,height:`calc(${s.checkbox} - ${t.spacing.twoXS})`,transform:o?`translateX(${s.checkbox})`:"",backgroundColor:r,boxShadow:""}}},ToggleTrack:{style:e=>{let{$checked:o,$isHovered:r}=e,n=a.fadedText40;return r&&!i&&(n=a.fadedText20),o&&!i&&(n=a.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${s.checkbox})`,minWidth:`calc(2 * ${s.checkbox})`,height:s.checkbox,minHeight:s.checkbox,borderBottomLeftRadius:t.radii.lg,borderTopLeftRadius:t.radii.lg,borderBottomRightRadius:t.radii.lg,borderTopRightRadius:t.radii.lg,backgroundColor:n}}},Checkmark:{style:e=>{let{$isFocusVisible:o,$checked:r}=e;const n=r&&!i?a.primary:a.fadedText40;return{outline:0,width:s.checkbox,height:s.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:o&&r?`0 0 0 0.2rem ${(0,M.No)(a.primary,.5)}`:"",borderLeftWidth:s.borderWidth,borderRightWidth:s.borderWidth,borderTopWidth:s.borderWidth,borderBottomWidth:s.borderWidth,borderLeftColor:n,borderRightColor:n,borderTopColor:n,borderBottomColor:n}}},Label:{style:{position:"relative",color:d}}},children:(0,A.jsxs)(z.x,{visibility:(0,j.yv)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),"data-testid":"stWidgetLabel",children:[(0,A.jsx)(H.Ay,{source:r.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),r.help&&(0,A.jsx)(W.Cl,{color:d,children:(0,A.jsx)(D.A,{content:r.help,placement:V.W.TOP_RIGHT})})]})})})}}const U=(0,i.b)(N)},34752:(e,t,o)=>{o.d(t,{o:()=>i});var r=o(25571);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){(0,r.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,r._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),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
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[245],{245:(e,t,o)=>{o.r(t),o.d(t,{default:()=>G});var r=o(58878),i=o(8151),n=o(35331),a=o(57224);function l(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function c(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?l(Object(o),!0).forEach((function(t){s(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):l(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function s(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function d(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme.colors;return t?o||r?l.tickFillDisabled:l.tickFill:i&&(r||o)?a?l.tickFillErrorSelectedHoverActive:n?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:n?l.tickFillErrorHover:l.tickFillError:r||o?a?l.tickFillSelectedHoverActive:n?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:n?l.tickFillHover:l.tickFill}function u(e){var t=e.$disabled,o=e.$theme.colors;return t?o.contentSecondary:o.contentPrimary}var g=(0,a.I4)("label",(function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:"top"===o||"bottom"===o?"column":"row",display:"flex",alignItems:"top"===o||"bottom"===o?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}}));g.displayName="Root",g.displayName="Root";var h=(0,a.I4)("span",(function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,c=n.animation,s=o?n.colors.tickMarkFillDisabled:r?n.colors.tickMarkFillError:n.colors.tickMarkFill,u=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(s,'"/>\n </svg>\n ')),g=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(s,'"/>\n </svg>\n ')),h=n.borders.checkboxBorderRadius,p=function(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:o||i?"transparent":r?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:c.timing200,transitionTimingFunction:c.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:p,borderRightColor:p,borderTopColor:p,borderBottomColor:p,borderTopLeftRadius:h,borderTopRightRadius:h,borderBottomRightRadius:h,borderBottomLeftRadius:h,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(u,"');"):t?"url('data:image/svg+xml,".concat(g,"');"):null,backgroundColor:d(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));h.displayName="Checkmark",h.displayName="Checkmark";var p=(0,a.I4)("div",(function(e){var t=e.$theme.typography;return c(c(c({verticalAlign:"middle"},function(e){var t,o=e.$labelPlacement,r=void 0===o?"":o,i=e.$theme,n=i.sizing.scale300;switch(r){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),s({},"padding".concat(t),n)}(e)),{},{color:u(e)},t.LabelMedium),{},{lineHeight:"24px"})}));p.displayName="Label",p.displayName="Label";var b=(0,a.I4)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});b.displayName="Input",b.displayName="Input";var m=(0,a.I4)("div",(function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat("rtl"===e.$theme.direction?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}}));m.displayName="Toggle",m.displayName="Toggle";var f=(0,a.I4)("div",(function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}}));f.displayName="ToggleTrack",f.displayName="ToggleTrack";var v=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),y=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),k=o(56498);function $(e){return $="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},$(e)}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},w.apply(this,arguments)}function F(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function C(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 o,r=S(e);if(t){var i=S(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return function(e,t){if(t&&("object"===$(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return R(e)}(this,o)}}function R(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function L(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var T=function(e){return e.stopPropagation()},O=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)}(l,e);var t,o,i,a=C(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return L(R(e=a.call.apply(a,[this].concat(o))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),L(R(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),L(R(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),L(R(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),L(R(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),L(R(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,k.pP)(t)&&e.setState({isFocusVisible:!0})})),L(R(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=l,(o=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,o=e.inputRef;t&&o.current&&o.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,o=void 0===t?{}:t,i=e.onChange,a=e.labelPlacement,l=void 0===a?this.props.checkmarkType===v.toggle?"left":"right":a,c=e.inputRef,s=e.isIndeterminate,d=e.error,u=e.disabled,y=e.value,k=e.name,$=e.type,F=e.checked,x=e.children,C=e.required,R=e.title,S=o.Root,L=o.Checkmark,O=o.Label,P=o.Input,M=o.Toggle,j=o.ToggleTrack,B=(0,n.De)(S)||g,E=(0,n.De)(L)||h,I=(0,n.De)(O)||p,D=(0,n.De)(P)||b,W=(0,n.De)(M)||m,H=(0,n.De)(j)||f,z={onChange:i,onFocus:this.onFocus,onBlur:this.onBlur},V={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},A={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:d,$checked:F,$isIndeterminate:s,$required:C,$disabled:u,$value:y},_=x&&r.createElement(I,w({$labelPlacement:l},A,(0,n.PC)(O)),this.props.containsInteractiveElement?r.createElement("div",{onClick:function(e){return e.preventDefault()}},x):x);return r.createElement(B,w({"data-baseweb":"checkbox",title:R||null,$labelPlacement:l},A,V,(0,n.PC)(S)),("top"===l||"left"===l)&&_,this.props.checkmarkType===v.toggle?r.createElement(H,w({},A,(0,n.PC)(j)),r.createElement(W,w({},A,(0,n.PC)(M)))):r.createElement(E,w({},A,(0,n.PC)(L))),r.createElement(D,w({value:y,name:k,checked:F,required:C,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":s?"mixed":F,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":d||null,"aria-required":C||null,disabled:u,type:$,ref:c,onClick:T},A,z,(0,n.PC)(P))),("bottom"===l||"right"===l)&&_)}}])&&F(t.prototype,o),i&&F(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.Component);L(O,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:r.createRef(),error:!1,type:"checkbox",checkmarkType:v.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const P=O;var M=o(32735),j=o(25571),B=o(29669),E=o(3101),I=o(58144),D=o(93480),W=o(997),H=o(78286),z=o(34914),V=o(90114),A=o(90782);function _(e){var t;let{width:o,element:n,disabled:a,widgetMgr:l,fragmentId:c}=e;const[s,d]=(0,E.t)({getStateFromWidgetMgr:N,getDefaultStateFromProto:U,getCurrStateFromProto:X,updateWidgetMgrState:q,element:n,widgetMgr:l,fragmentId:c}),u=(0,r.useCallback)((e=>{d({value:e.target.checked,fromUi:!0})}),[d]),g=(0,i.u)(),{colors:h,spacing:p,sizes:b}=g,m=(0,I.iq)(g),f=a?h.fadedText40:h.bodyText;return(0,A.jsx)(V.p,{className:"row-widget stCheckbox","data-testid":"stCheckbox",width:o,children:(0,A.jsx)(P,{checked:s,disabled:a,onChange:u,"aria-label":n.label,checkmarkType:n.type===B.Sc.StyleType.TOGGLE?v.toggle:v.default,labelPlacement:y.right,overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:p.none,marginTop:p.none,paddingRight:p.twoThirdsSmFont,backgroundColor:t?h.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Toggle:{style:e=>{let{$checked:t}=e,o=m?h.bgColor:h.bodyText;return a&&(o=m?h.gray70:h.gray90),{width:`calc(${b.checkbox} - ${g.spacing.twoXS})`,height:`calc(${b.checkbox} - ${g.spacing.twoXS})`,transform:t?`translateX(${b.checkbox})`:"",backgroundColor:o,boxShadow:""}}},ToggleTrack:{style:e=>{let{$checked:t,$isHovered:o}=e,r=h.fadedText40;return o&&!a&&(r=h.fadedText20),t&&!a&&(r=h.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:g.spacing.twoXS,paddingLeft:g.spacing.threeXS,paddingRight:g.spacing.threeXS,width:`calc(2 * ${b.checkbox})`,minWidth:`calc(2 * ${b.checkbox})`,height:b.checkbox,minHeight:b.checkbox,borderBottomLeftRadius:g.radii.lg,borderTopLeftRadius:g.radii.lg,borderBottomRightRadius:g.radii.lg,borderTopRightRadius:g.radii.lg,backgroundColor:r}}},Checkmark:{style:e=>{let{$isFocusVisible:t,$checked:o}=e;const r=o&&!a?h.primary:h.fadedText40;return{outline:0,width:b.checkbox,height:b.checkbox,marginTop:g.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:t&&o?`0 0 0 0.2rem ${(0,M.No)(h.primary,.5)}`:"",borderLeftWidth:b.borderWidth,borderRightWidth:b.borderWidth,borderTopWidth:b.borderWidth,borderBottomWidth:b.borderWidth,borderLeftColor:r,borderRightColor:r,borderTopColor:r,borderBottomColor:r}}},Label:{style:{position:"relative",color:f}}},children:(0,A.jsxs)(V.x,{visibility:(0,j.yv)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),"data-testid":"stWidgetLabel",children:[(0,A.jsx)(z.Ay,{source:n.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),n.help&&(0,A.jsx)(H.Cl,{color:f,children:(0,A.jsx)(D.A,{content:n.help,placement:W.W.TOP_RIGHT})})]})})})}function N(e,t){return e.getBoolValue(t)}function U(e){var t;return null!==(t=e.default)&&void 0!==t?t:null}function X(e){var t;return null!==(t=e.value)&&void 0!==t?t:null}function q(e,t,o,r){t.setBoolValue(e,o.value,{fromUi:o.fromUi},r)}const G=(0,r.memo)(_)},34752:(e,t,o)=>{o.d(t,{X:()=>a,o:()=>n});var r=o(58878),i=o(25571);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){(0,i.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),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}}function a(e){let{element:t,widgetMgr:o,onFormCleared:n}=e;(0,r.useEffect)((()=>{if(!(0,i._L)(t.formId))return;const e=o.addFormClearedListener(t.formId,n);return()=>{e.disconnect()}}),[t,o,n])}},3101:(e,t,o)=>{o.d(t,{t:()=>a});var r=o(58878),i=o(34752),n=o(25571);function a(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:o,getCurrStateFromProto:a,updateWidgetMgrState:l,element:c,widgetMgr:s,fragmentId:d}=e;const[u,g]=(0,r.useState)((()=>{var e;return null!==(e=t(s,c))&&void 0!==e?e:o(c)})),[h,p]=(0,r.useState)({value:u,fromUi:!1});(0,r.useEffect)((()=>{(0,n.hX)(h)||(p(null),g(h.value),l(c,s,h,d))}),[h,l,c,s,d]),(0,r.useEffect)((()=>{c.setValue&&(c.setValue=!1,p({value:a(c),fromUi:!1}))}),[c,a]);const b=(0,r.useCallback)((()=>{p({value:o(c),fromUi:!0})}),[p,c,o]);return(0,i.X)({widgetMgr:s,element:c,onFormCleared:b}),[u,p]}}}]);