streamlit-nightly 1.30.1.dev20240128__py2.py3-none-any.whl → 1.30.1.dev20240129__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.
@@ -14,7 +14,6 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- import contextlib
18
17
  import dataclasses
19
18
  import inspect
20
19
  import json as json
@@ -203,14 +202,30 @@ class WriteMixin:
203
202
  if type_util.is_type(
204
203
  chunk, "openai.types.chat.chat_completion_chunk.ChatCompletionChunk"
205
204
  ):
206
- # Try to convert openai chat completion chunk to a string:
207
- with contextlib.suppress(Exception):
205
+ # Try to convert OpenAI chat completion chunk to a string:
206
+ try:
208
207
  chunk = chunk.choices[0].delta.content or ""
208
+ except AttributeError as err:
209
+ raise StreamlitAPIException(
210
+ "Failed to parse the OpenAI ChatCompletionChunk. "
211
+ "The most likely cause is a change of the chunk object structure "
212
+ "due to a recent OpenAI update. You might be able to fix this "
213
+ "by downgrading the OpenAI library or upgrading Streamlit. Also, "
214
+ "please report this issue to: https://github.com/streamlit/streamlit/issues."
215
+ ) from err
209
216
 
210
217
  if type_util.is_type(chunk, "langchain_core.messages.ai.AIMessageChunk"):
211
- # Try to convert langchain_core message chunk to a string:
212
- with contextlib.suppress(Exception):
218
+ # Try to convert LangChain message chunk to a string:
219
+ try:
213
220
  chunk = chunk.content or ""
221
+ except AttributeError as err:
222
+ raise StreamlitAPIException(
223
+ "Failed to parse the LangChain AIMessageChunk. "
224
+ "The most likely cause is a change of the chunk object structure "
225
+ "due to a recent LangChain update. You might be able to fix this "
226
+ "by downgrading the OpenAI library or upgrading Streamlit. Also, "
227
+ "please report this issue to: https://github.com/streamlit/streamlit/issues."
228
+ ) from err
214
229
 
215
230
  if isinstance(chunk, str):
216
231
  first_text = False
@@ -99,6 +99,10 @@ class QueryParams(MutableMapping[str, str]):
99
99
  {key for key in self._query_params if key not in EMBED_QUERY_PARAMS_KEYS}
100
100
  )
101
101
 
102
+ def __str__(self) -> str:
103
+ self._ensure_single_query_api_used()
104
+ return str(self._query_params)
105
+
102
106
  def _send_query_param_msg(self) -> None:
103
107
  # Avoid circular imports
104
108
  from streamlit.runtime.scriptrunner import get_script_run_ctx
@@ -33,6 +33,10 @@ class QueryParamsProxy(MutableMapping[str, str]):
33
33
  with get_session_state().query_params() as qp:
34
34
  return len(qp)
35
35
 
36
+ def __str__(self) -> str:
37
+ with get_session_state().query_params() as qp:
38
+ return str(qp)
39
+
36
40
  @gather_metrics("query_params.get_item")
37
41
  def __getitem__(self, key: str) -> str:
38
42
  with get_session_state().query_params() as qp:
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.77d1c464.css",
4
- "main.js": "./static/js/main.58bb20cc.js",
4
+ "main.js": "./static/js/main.0f3a455c.js",
5
5
  "static/js/9336.2d95d840.chunk.js": "./static/js/9336.2d95d840.chunk.js",
6
6
  "static/js/9330.c0dd1723.chunk.js": "./static/js/9330.c0dd1723.chunk.js",
7
7
  "static/js/7217.d970c074.chunk.js": "./static/js/7217.d970c074.chunk.js",
8
8
  "static/js/3301.1d1b10bb.chunk.js": "./static/js/3301.1d1b10bb.chunk.js",
9
9
  "static/css/6692.bb444a79.chunk.css": "./static/css/6692.bb444a79.chunk.css",
10
- "static/js/6692.e19556bc.chunk.js": "./static/js/6692.e19556bc.chunk.js",
10
+ "static/js/6692.6ac4ea6f.chunk.js": "./static/js/6692.6ac4ea6f.chunk.js",
11
11
  "static/css/43.c24b25fa.chunk.css": "./static/css/43.c24b25fa.chunk.css",
12
12
  "static/js/43.8ca4bc8a.chunk.js": "./static/js/43.8ca4bc8a.chunk.js",
13
13
  "static/js/8427.55f2bb27.chunk.js": "./static/js/8427.55f2bb27.chunk.js",
@@ -30,7 +30,7 @@
30
30
  "static/js/1074.161eb70d.chunk.js": "./static/js/1074.161eb70d.chunk.js",
31
31
  "static/js/8477.7419a0aa.chunk.js": "./static/js/8477.7419a0aa.chunk.js",
32
32
  "static/js/6853.3cbd385e.chunk.js": "./static/js/6853.3cbd385e.chunk.js",
33
- "static/js/4477.c4e655fe.chunk.js": "./static/js/4477.c4e655fe.chunk.js",
33
+ "static/js/4477.2555c11a.chunk.js": "./static/js/4477.2555c11a.chunk.js",
34
34
  "static/js/4319.213fc321.chunk.js": "./static/js/4319.213fc321.chunk.js",
35
35
  "static/js/5106.22187bfc.chunk.js": "./static/js/5106.22187bfc.chunk.js",
36
36
  "static/js/4666.3a6efd97.chunk.js": "./static/js/4666.3a6efd97.chunk.js",
@@ -150,6 +150,6 @@
150
150
  },
151
151
  "entrypoints": [
152
152
  "static/css/main.77d1c464.css",
153
- "static/js/main.58bb20cc.js"
153
+ "static/js/main.0f3a455c.js"
154
154
  ]
155
155
  }
@@ -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.58bb20cc.js"></script><link href="./static/css/main.77d1c464.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.0f3a455c.js"></script><link href="./static/css/main.77d1c464.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4477],{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}}},74477:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ue});var o=r(66845),n=r(25621),i=r(80318),a=r(80745);function s(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 l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(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 c=0,p=1,d=2;function f(e){return e.$isActive?d:e.$isHovered?p:c}function h(e){var t=e.$theme.colors,r=e.$disabled,o=e.$checked,n=e.$isFocusVisible,i=e.$error;if(r)return t.tickFillDisabled;if(!o)return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;if(i)switch(f(e)){case c:return t.tickFillErrorSelected;case p:return t.tickFillErrorSelectedHover;case d:return t.tickFillErrorSelectedHoverActive}else switch(f(e)){case c:return t.tickFillSelected;case p:return t.tickFillSelectedHover;case d:return t.tickFillSelectedHoverActive}return null}function b(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(f(e)){case c:return t.tickFillError;case p:return t.tickFillErrorHover;case d:return t.tickFillErrorHoverActive}else switch(f(e)){case c:return t.tickFill;case p:return t.tickFillHover;case d:return t.tickFillActive}}function m(e){var t=e.$disabled,r=e.$theme.colors;return t?r.contentSecondary:r.contentPrimary}var v=(0,a.zo)("div",(function(e){var t=e.$disabled,r=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:"horizontal"===r?"row":"column",alignItems:"horizontal"===r?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}}));v.displayName="RadioGroupRoot",v.displayName="RadioGroupRoot";var y=(0,a.zo)("label",(function(e){var t,r=e.$disabled,o=e.$hasDescription,n=e.$labelPlacement,i=e.$theme,a=e.$align,s=i.sizing,l="horizontal"===a,c="rtl"===i.direction?"Left":"Right";return u(t={flexDirection:"top"===n||"bottom"===n?"column":"row",display:"flex",alignItems:"center",cursor:r?"not-allowed":"pointer",marginTop:s.scale200},"margin".concat(c),l?s.scale200:null),u(t,"marginBottom",o&&!l?null:s.scale200),t}));y.displayName="Root",y.displayName="Root";var g=(0,a.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{backgroundColor:b(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?o.scale200:o.scale550,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve,width:e.$checked?o.scale200:o.scale550}}));g.displayName="RadioMarkInner",g.displayName="RadioMarkInner";var w=(0,a.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{alignItems:"center",backgroundColor:h(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:o.scale700,justifyContent:"center",marginTop:o.scale0,marginRight:o.scale0,marginBottom:o.scale0,marginLeft:o.scale0,outline:"none",verticalAlign:"middle",width:o.scale700,flexShrink:0,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve}}));w.displayName="RadioMarkOuter",w.displayName="RadioMarkOuter";var R=(0,a.zo)("div",(function(e){var t=e.$theme.typography;return l(l({verticalAlign:"middle"},function(e){var t,r=e.$labelPlacement,o=void 0===r?"":r,n=e.$theme;switch(o){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="rtl"===n.direction?"Left":"Right";break;default:t="rtl"===n.direction?"Right":"Left"}var i=n.sizing.scale300;return u({},"padding".concat(t),i)}(e)),{},{color:m(e)},t.LabelMedium)}));R.displayName="Label",R.displayName="Label";var O=(0,a.zo)("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});O.displayName="Input",O.displayName="Input";var j=(0,a.zo)("div",(function(e){var t,r=e.$theme,o=e.$align,n="horizontal"===o,i="rtl"===r.direction?"Right":"Left",a="rtl"===r.direction?"Left":"Right";return l(l({},r.typography.ParagraphSmall),{},(u(t={color:r.colors.contentSecondary,cursor:"auto"},"margin".concat(i),"horizontal"===o?null:r.sizing.scale900),u(t,"margin".concat(a),n?r.sizing.scale200:null),u(t,"maxWidth","240px"),t))}));j.displayName="Description",j.displayName="Description";var k=r(17964);function F(e){return F="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},F(e)}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},M.apply(this,arguments)}function P(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=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return $(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 $(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 $(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 S(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function x(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,o=E(e);if(t){var n=E(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===F(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return L(e)}(this,r)}}function L(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var T=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&&C(e,t)}(s,e);var t,r,n,a=x(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return I(L(e=a.call.apply(a,[this].concat(r))),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),I(L(e),"handleFocus",(function(t,r){(0,k.E)(t)&&e.setState({isFocusVisible:!0}),e.setState({focusedRadioIndex:r}),e.props.onFocus&&e.props.onFocus(t)})),I(L(e),"handleBlur",(function(t,r){!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1}),e.setState({focusedRadioIndex:-1}),e.props.onBlur&&e.props.onBlur(t)})),e}return t=s,(r=[{key:"render",value:function(){var e=this,t=this.props.overrides,r=void 0===t?{}:t,n=P((0,i.jb)(r.RadioGroupRoot,v),2),a=n[0],s=n[1];return o.createElement(a,M({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},s),o.Children.map(this.props.children,(function(t,r){if(!o.isValidElement(t))return null;var n=e.props.value===t.props.value;return o.cloneElement(t,{align:e.props.align,autoFocus:e.props.autoFocus,checked:n,disabled:e.props.disabled||t.props.disabled,error:e.props.error,isFocused:e.state.focusedRadioIndex===r,isFocusVisible:e.state.isFocusVisible,tabIndex:0===r&&!e.props.value||n?"0":"-1",labelPlacement:e.props.labelPlacement,name:e.props.name,onBlur:function(t){return e.handleBlur(t,r)},onFocus:function(t){return e.handleFocus(t,r)},onChange:e.props.onChange,onMouseEnter:e.props.onMouseEnter,onMouseLeave:e.props.onMouseLeave})})))}}])&&S(t.prototype,r),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);I(T,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});const B=T;var D="vertical",V="horizontal";function A(e){return A="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},A(e)}function z(){return z=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},z.apply(this,arguments)}function _(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=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return H(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 H(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 H(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 U(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function N(e,t){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},N(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,o=G(e);if(t){var n=G(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===A(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return q(e)}(this,r)}}function q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var K=function(e){return e.stopPropagation()},J=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&&N(e,t)}(s,e);var t,r,n,a=W(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return Z(q(e=a.call.apply(a,[this].concat(r))),"state",{isActive:!1,isHovered:!1}),Z(q(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter&&e.props.onMouseEnter(t)})),Z(q(e),"onMouseLeave",(function(t){e.setState({isHovered:!1}),e.props.onMouseLeave&&e.props.onMouseLeave(t)})),Z(q(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown&&e.props.onMouseDown(t)})),Z(q(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp&&e.props.onMouseUp(t)})),e}return t=s,(r=[{key:"componentDidMount",value:function(){var e;this.props.autoFocus&&null!==(e=this.props.inputRef)&&void 0!==e&&e.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var e,t=this.props.overrides,r=void 0===t?{}:t,n=_((0,i.jb)(r.Root,y),2),a=n[0],s=n[1],l=_((0,i.jb)(r.Label,R),2),u=l[0],c=l[1],p=_((0,i.jb)(r.Input,O),2),d=p[0],f=p[1],h=_((0,i.jb)(r.Description,j),2),b=h[0],m=h[1],v=_((0,i.jb)(r.RadioMarkInner,g),2),k=v[0],F=v[1],M=_((0,i.jb)(r.RadioMarkOuter,w),2),P=M[0],$=M[1],S={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},C=o.createElement(u,z({},S,c),this.props.containsInteractiveElement?o.createElement("div",{onClick:function(e){return e.preventDefault()}},this.props.children):this.props.children);return o.createElement(o.Fragment,null,o.createElement(a,z({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},S,s),("top"===(e=this.props.labelPlacement)||"left"===e)&&C,o.createElement(P,z({},S,$),o.createElement(k,z({},S,F))),o.createElement(d,z({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:K,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},S,f)),function(e){return"bottom"===e||"right"===e}(this.props.labelPlacement)&&C),!!this.props.description&&o.createElement(b,z({},S,m),this.props.description))}}])&&U(t.prototype,r),n&&U(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);Z(J,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:o.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const Q=J;var X=r(98478),Y=r(86659),ee=r(8879),te=r(68411),re=r(21e3),oe=r(40864);class ne extends o.PureComponent{constructor(){var e;super(...arguments),this.state={value:null!==(e=this.props.value)&&void 0!==e?e:null},this.onChange=e=>{const t=parseInt(e.target.value,10);this.setState({value:t},(()=>this.props.onChange(t)))}}componentDidUpdate(e){e.value!==this.props.value&&this.props.value!==this.state.value&&this.setState(((e,t)=>{var r;return{value:null!==(r=t.value)&&void 0!==r?r:null}}))}render(){const{theme:e,width:t,help:r,label:o,horizontal:n,labelVisibility:i}=this.props;let{disabled:a}=this.props;const{colors:s,radii:l}=e,u={width:t},c=[...this.props.options],p=[...this.props.captions],d=p.length>0;return 0===c.length&&(c.push("No options to select."),a=!0),(0,oe.jsxs)("div",{className:"row-widget stRadio","data-testid":"stRadio",style:u,children:[(0,oe.jsx)(X.O,{label:o,disabled:a,labelVisibility:i,children:r&&(0,oe.jsx)(Y.Hp,{children:(0,oe.jsx)(ee.Z,{content:r,placement:te.u.TOP_RIGHT})})}),(0,oe.jsx)(B,{onChange:this.onChange,value:null!==this.state.value?this.state.value.toString():void 0,disabled:a,align:n?V:D,"aria-label":o,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:d?"0.5rem":"0"}}},children:c.map(((e,t)=>{return(0,oe.jsxs)(Q,{value:t.toString(),overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:0,marginTop:0,marginRight:d?"0.5rem":"1rem",paddingLeft:0,alignItems:"start",paddingRight:"2px",backgroundColor:t?s.darkenedBgMix25:"",borderTopLeftRadius:l.md,borderTopRightRadius:l.md,borderBottomLeftRadius:l.md,borderBottomRightRadius:l.md}}},RadioMarkOuter:{style:e=>{let{$checked:t}=e;return{width:"1rem",height:"1rem",marginTop:"0.35rem",marginRight:"0",backgroundColor:t&&!a?s.primary:s.fadedText40}}},RadioMarkInner:{style:e=>{let{$checked:t}=e;return{height:t?"6px":"14px",width:t?"6px":"14px"}}},Label:{style:{color:a?s.fadedText40:s.bodyText,position:"relative",top:"1px"}}},children:[(0,oe.jsx)(re.ZP,{source:e,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0}),d&&(0,oe.jsx)(re.ZP,{source:(r=p[t],""==r&&n&&d?"&nbsp;":r),allowHTML:!1,isCaption:!0,isLabel:!0})]},t);var r}))})]})}}const ie=(0,n.b)(ne);var ae=r(87814),se=r(50641);class le extends o.PureComponent{constructor(){super(...arguments),this.formClearHelper=new ae.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 r;return{value:null!==(r=t.element.default)&&void 0!==r?r: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{disabled:e,element:t,width:r,widgetMgr:o}=this.props,{horizontal:n,options:i,captions:a,label:s,labelVisibility:l,help:u}=t;return this.formClearHelper.manageFormClearListener(o,t.formId,this.onFormCleared),(0,oe.jsx)(ie,{label:s,onChange:this.onChange,options:i,captions:a,width:r,disabled:e,horizontal:n,labelVisibility:(0,se.iF)(null===l||void 0===l?void 0:l.value),value:this.state.value,help:u})}}const ue=le}}]);
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4477],{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}}},74477:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ue});var o=r(66845),n=r(25621),i=r(80318),a=r(80745);function s(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 l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(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 c=0,p=1,d=2;function f(e){return e.$isActive?d:e.$isHovered?p:c}function h(e){var t=e.$theme.colors,r=e.$disabled,o=e.$checked,n=e.$isFocusVisible,i=e.$error;if(r)return t.tickFillDisabled;if(!o)return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;if(i)switch(f(e)){case c:return t.tickFillErrorSelected;case p:return t.tickFillErrorSelectedHover;case d:return t.tickFillErrorSelectedHoverActive}else switch(f(e)){case c:return t.tickFillSelected;case p:return t.tickFillSelectedHover;case d:return t.tickFillSelectedHoverActive}return null}function b(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(f(e)){case c:return t.tickFillError;case p:return t.tickFillErrorHover;case d:return t.tickFillErrorHoverActive}else switch(f(e)){case c:return t.tickFill;case p:return t.tickFillHover;case d:return t.tickFillActive}}function m(e){var t=e.$disabled,r=e.$theme.colors;return t?r.contentSecondary:r.contentPrimary}var v=(0,a.zo)("div",(function(e){var t=e.$disabled,r=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:"horizontal"===r?"row":"column",alignItems:"horizontal"===r?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}}));v.displayName="RadioGroupRoot",v.displayName="RadioGroupRoot";var y=(0,a.zo)("label",(function(e){var t,r=e.$disabled,o=e.$hasDescription,n=e.$labelPlacement,i=e.$theme,a=e.$align,s=i.sizing,l="horizontal"===a,c="rtl"===i.direction?"Left":"Right";return u(t={flexDirection:"top"===n||"bottom"===n?"column":"row",display:"flex",alignItems:"center",cursor:r?"not-allowed":"pointer",marginTop:s.scale200},"margin".concat(c),l?s.scale200:null),u(t,"marginBottom",o&&!l?null:s.scale200),t}));y.displayName="Root",y.displayName="Root";var g=(0,a.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{backgroundColor:b(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?o.scale200:o.scale550,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve,width:e.$checked?o.scale200:o.scale550}}));g.displayName="RadioMarkInner",g.displayName="RadioMarkInner";var w=(0,a.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{alignItems:"center",backgroundColor:h(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:o.scale700,justifyContent:"center",marginTop:o.scale0,marginRight:o.scale0,marginBottom:o.scale0,marginLeft:o.scale0,outline:"none",verticalAlign:"middle",width:o.scale700,flexShrink:0,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve}}));w.displayName="RadioMarkOuter",w.displayName="RadioMarkOuter";var R=(0,a.zo)("div",(function(e){var t=e.$theme.typography;return l(l({verticalAlign:"middle"},function(e){var t,r=e.$labelPlacement,o=void 0===r?"":r,n=e.$theme;switch(o){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="rtl"===n.direction?"Left":"Right";break;default:t="rtl"===n.direction?"Right":"Left"}var i=n.sizing.scale300;return u({},"padding".concat(t),i)}(e)),{},{color:m(e)},t.LabelMedium)}));R.displayName="Label",R.displayName="Label";var O=(0,a.zo)("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});O.displayName="Input",O.displayName="Input";var j=(0,a.zo)("div",(function(e){var t,r=e.$theme,o=e.$align,n="horizontal"===o,i="rtl"===r.direction?"Right":"Left",a="rtl"===r.direction?"Left":"Right";return l(l({},r.typography.ParagraphSmall),{},(u(t={color:r.colors.contentSecondary,cursor:"auto"},"margin".concat(i),"horizontal"===o?null:r.sizing.scale900),u(t,"margin".concat(a),n?r.sizing.scale200:null),u(t,"maxWidth","240px"),t))}));j.displayName="Description",j.displayName="Description";var k=r(17964);function F(e){return F="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},F(e)}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},M.apply(this,arguments)}function P(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=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return $(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 $(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 $(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 S(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function x(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,o=L(e);if(t){var n=L(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===F(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,r)}}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var T=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&&C(e,t)}(s,e);var t,r,n,a=x(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return I(E(e=a.call.apply(a,[this].concat(r))),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),I(E(e),"handleFocus",(function(t,r){(0,k.E)(t)&&e.setState({isFocusVisible:!0}),e.setState({focusedRadioIndex:r}),e.props.onFocus&&e.props.onFocus(t)})),I(E(e),"handleBlur",(function(t,r){!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1}),e.setState({focusedRadioIndex:-1}),e.props.onBlur&&e.props.onBlur(t)})),e}return t=s,(r=[{key:"render",value:function(){var e=this,t=this.props.overrides,r=void 0===t?{}:t,n=P((0,i.jb)(r.RadioGroupRoot,v),2),a=n[0],s=n[1];return o.createElement(a,M({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},s),o.Children.map(this.props.children,(function(t,r){if(!o.isValidElement(t))return null;var n=e.props.value===t.props.value;return o.cloneElement(t,{align:e.props.align,autoFocus:e.props.autoFocus,checked:n,disabled:e.props.disabled||t.props.disabled,error:e.props.error,isFocused:e.state.focusedRadioIndex===r,isFocusVisible:e.state.isFocusVisible,tabIndex:0===r&&!e.props.value||n?"0":"-1",labelPlacement:e.props.labelPlacement,name:e.props.name,onBlur:function(t){return e.handleBlur(t,r)},onFocus:function(t){return e.handleFocus(t,r)},onChange:e.props.onChange,onMouseEnter:e.props.onMouseEnter,onMouseLeave:e.props.onMouseLeave})})))}}])&&S(t.prototype,r),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);I(T,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});const B=T;var D="vertical",V="horizontal";function A(e){return A="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},A(e)}function z(){return z=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},z.apply(this,arguments)}function _(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=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return H(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 H(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 H(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 U(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function N(e,t){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},N(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,o=G(e);if(t){var n=G(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===A(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return q(e)}(this,r)}}function q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var K=function(e){return e.stopPropagation()},J=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&&N(e,t)}(s,e);var t,r,n,a=W(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return Z(q(e=a.call.apply(a,[this].concat(r))),"state",{isActive:!1,isHovered:!1}),Z(q(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter&&e.props.onMouseEnter(t)})),Z(q(e),"onMouseLeave",(function(t){e.setState({isHovered:!1}),e.props.onMouseLeave&&e.props.onMouseLeave(t)})),Z(q(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown&&e.props.onMouseDown(t)})),Z(q(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp&&e.props.onMouseUp(t)})),e}return t=s,(r=[{key:"componentDidMount",value:function(){var e;this.props.autoFocus&&null!==(e=this.props.inputRef)&&void 0!==e&&e.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var e,t=this.props.overrides,r=void 0===t?{}:t,n=_((0,i.jb)(r.Root,y),2),a=n[0],s=n[1],l=_((0,i.jb)(r.Label,R),2),u=l[0],c=l[1],p=_((0,i.jb)(r.Input,O),2),d=p[0],f=p[1],h=_((0,i.jb)(r.Description,j),2),b=h[0],m=h[1],v=_((0,i.jb)(r.RadioMarkInner,g),2),k=v[0],F=v[1],M=_((0,i.jb)(r.RadioMarkOuter,w),2),P=M[0],$=M[1],S={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},C=o.createElement(u,z({},S,c),this.props.containsInteractiveElement?o.createElement("div",{onClick:function(e){return e.preventDefault()}},this.props.children):this.props.children);return o.createElement(o.Fragment,null,o.createElement(a,z({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},S,s),("top"===(e=this.props.labelPlacement)||"left"===e)&&C,o.createElement(P,z({},S,$),o.createElement(k,z({},S,F))),o.createElement(d,z({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:K,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},S,f)),function(e){return"bottom"===e||"right"===e}(this.props.labelPlacement)&&C),!!this.props.description&&o.createElement(b,z({},S,m),this.props.description))}}])&&U(t.prototype,r),n&&U(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);Z(J,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:o.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const Q=J;var X=r(98478),Y=r(86659),ee=r(8879),te=r(68411),re=r(21e3),oe=r(40864);class ne extends o.PureComponent{constructor(){var e;super(...arguments),this.state={value:null!==(e=this.props.value)&&void 0!==e?e:null},this.onChange=e=>{const t=parseInt(e.target.value,10);this.setState({value:t},(()=>this.props.onChange(t)))}}componentDidUpdate(e){e.value!==this.props.value&&this.props.value!==this.state.value&&this.setState(((e,t)=>{var r;return{value:null!==(r=t.value)&&void 0!==r?r:null}}))}render(){const{theme:e,width:t,help:r,label:o,horizontal:n,labelVisibility:i}=this.props;let{disabled:a}=this.props;const{colors:s,radii:l}=e,u={width:t},c=[...this.props.options],p=[...this.props.captions],d=p.length>0;return 0===c.length&&(c.push("No options to select."),a=!0),(0,oe.jsxs)("div",{className:"row-widget stRadio","data-testid":"stRadio",style:u,children:[(0,oe.jsx)(X.O,{label:o,disabled:a,labelVisibility:i,children:r&&(0,oe.jsx)(Y.Hp,{children:(0,oe.jsx)(ee.Z,{content:r,placement:te.u.TOP_RIGHT})})}),(0,oe.jsx)(B,{onChange:this.onChange,value:null!==this.state.value?this.state.value.toString():void 0,disabled:a,align:n?V:D,"aria-label":o,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:d?"0.5rem":"0"}}},children:c.map(((e,t)=>{return(0,oe.jsxs)(Q,{value:t.toString(),overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:0,marginTop:0,marginRight:d?"0.5rem":"1rem",paddingLeft:0,alignItems:"start",paddingRight:"2px",backgroundColor:t?s.darkenedBgMix25:"",borderTopLeftRadius:l.md,borderTopRightRadius:l.md,borderBottomLeftRadius:l.md,borderBottomRightRadius:l.md}}},RadioMarkOuter:{style:e=>{let{$checked:t}=e;return{width:"1rem",height:"1rem",marginTop:"0.35rem",marginRight:"0",backgroundColor:t&&!a?s.primary:s.fadedText40}}},RadioMarkInner:{style:e=>{let{$checked:t}=e;return{height:t?"6px":"14px",width:t?"6px":"14px"}}},Label:{style:{color:a?s.fadedText40:s.bodyText,position:"relative",top:"1px"}}},children:[(0,oe.jsx)(re.ZP,{source:e,allowHTML:!1,isLabel:!0,largerLabel:!0}),d&&(0,oe.jsx)(re.ZP,{source:(r=p[t],""==r&&n&&d?"&nbsp;":r),allowHTML:!1,isCaption:!0,isLabel:!0})]},t);var r}))})]})}}const ie=(0,n.b)(ne);var ae=r(87814),se=r(50641);class le extends o.PureComponent{constructor(){super(...arguments),this.formClearHelper=new ae.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 r;return{value:null!==(r=t.element.default)&&void 0!==r?r: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{disabled:e,element:t,width:r,widgetMgr:o}=this.props,{horizontal:n,options:i,captions:a,label:s,labelVisibility:l,help:u}=t;return this.formClearHelper.manageFormClearListener(o,t.formId,this.onFormCleared),(0,oe.jsx)(ie,{label:s,onChange:this.onChange,options:i,captions:a,width:r,disabled:e,horizontal:n,labelVisibility:(0,se.iF)(null===l||void 0===l?void 0:l.value),value:this.state.value,help:u})}}const ue=le}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6692],{2706:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Tt});var i=n(66845),o=n(35396),a=n(17330),l=n(57463),r=n(97943),s=n(41342),d=n(17875),c=n(87814),u=n(62622),m=n(16295),h=n(50641),g=n(25621),p=n(34367),f=n(31011),b=n(21e3),v=n(68411),y=n(9003),w=n(81354),x=n(46927),C=n(1515),T=n(27466);const E=(0,C.Z)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:n,target:i}=e;return{padding:"0.5rem 0 0.5rem 0.5rem",position:"absolute",top:n?"-2.4rem":"-1rem",right:t.spacing.none,transition:"none",...!n&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:"-2.4rem"},...i&&{["".concat(i,":hover &, ").concat(i,":active &, ").concat(i,":focus-visible &")]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:"-2.4rem"}}}}}),""),M=(0,C.Z)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,T.Iy)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.lg,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var k=n(40864);function N(e){let{label:t,show_label:n,icon:i,onClick:o}=e;const a=(0,g.u)(),l=n?t:"";return(0,k.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,k.jsx)(v.Z,{content:(0,k.jsx)(b.ZP,{source:t,allowHTML:!1,style:{fontSize:a.fontSizes.sm}}),placement:v.u.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,k.jsxs)(y.ZP,{onClick:e=>{o&&o(),e.stopPropagation()},kind:w.nW.ELEMENT_TOOLBAR,children:[i&&(0,k.jsx)(x.Z,{content:i,size:"md",testid:"stElementToolbarButtonIcon"}),l&&(0,k.jsx)("span",{children:l})]})})})}const R=e=>{let{onExpand:t,onCollapse:n,isFullScreen:i,locked:o,children:a,target:l,disableFullscreenMode:r}=e;return(0,k.jsx)(E,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:o||i,target:l,children:(0,k.jsxs)(M,{children:[a,t&&!r&&!i&&(0,k.jsx)(N,{label:"Fullscreen",icon:p.i,onClick:()=>t()}),n&&!r&&i&&(0,k.jsx)(N,{label:"Close fullscreen",icon:f.m,onClick:()=>n()})]})})};var S=n(38145),_=n.n(S),O=n(96825),I=n.n(O),D=n(29724),H=n.n(D),A=n(52347),z=n(53608),F=n.n(z);n(87717),n(55842);const V=["true","t","yes","y","on","1"],j=["false","f","no","n","off","0"];function L(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e="\u26a0\ufe0f ".concat(e),{kind:o.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?"\n\n".concat(t,"\n"):""),displayData:e,isError:!0}}function W(e){return e.hasOwnProperty("isError")&&e.isError}function B(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function P(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?{kind:o.p6.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:o.p6.Loading,allowOverlay:!1}}function Y(e,t){const n=t?"faded":"normal";return{kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Z(e){return{id:e.id,title:e.title,hasMenu:!1,themeOverride:e.themeOverride,icon:e.icon,...e.isStretched&&{grow:e.isIndex?1:3},...e.width&&{width:e.width}}}function q(e,t){return(0,h.le)(e)?t||{}:(0,h.le)(t)?e||{}:I()(e,t)}function J(e){if((0,h.le)(e))return[];if("number"===typeof e||"boolean"===typeof e)return[e];if("string"===typeof e){if(""===e)return[];if(!e.trim().startsWith("[")||!e.trim().endsWith("]"))return e.split(",");try{return JSON.parse(e)}catch(t){return[e]}}try{const t=JSON.parse(JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t)));return Array.isArray(t)?t.map((e=>["string","number","boolean","null"].includes(typeof e)?e:K(e))):[K(t)]}catch(t){return[K(e)]}}function K(e){try{try{return _()(e)}catch(t){return JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t))}}catch(t){return"[".concat(typeof e,"]")}}function X(e){if((0,h.le)(e))return null;if("boolean"===typeof e)return e;const t=K(e).toLowerCase().trim();return""===t?null:!!V.includes(t)||!j.includes(t)&&void 0}function G(e){if((0,h.le)(e))return null;if(Array.isArray(e))return NaN;if("string"===typeof e){if(0===e.trim().length)return null;try{const t=H().unformat(e.trim());if((0,h.bb)(t))return t}catch(t){}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function U(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,h.le)(t)||""===t?(0===n&&(e=Math.round(e)),H()(e).format((0,h.bb)(n)?"0,0.".concat("0".repeat(n)):"0,0.[0000]")):"percent"===t?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):"duration[ns]"===t?F().duration(e/1e6,"milliseconds").humanize():(0,A.sprintf)(t,e)}function Q(e,t){return"locale"===t?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(e.toDate()):"distance"===t?e.fromNow():"relative"===t?e.calendar():e.format(t)}function $(e){if((0,h.le)(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if("string"===typeof e&&0===e.trim().length)return null;try{const t=Number(e);if(!isNaN(t)){let e=t;t>=10**18?e=t/1e3**3:t>=10**15?e=t/1e6:t>=10**12&&(e=t/1e3);const n=F().unix(e).utc();if(n.isValid())return n.toDate()}if("string"===typeof e){const t=F().utc(e);if(t.isValid())return t.toDate();const n=F().utc(e,[F().HTML5_FMT.TIME_MS,F().HTML5_FMT.TIME_SECONDS,F().HTML5_FMT.TIME]);if(n.isValid())return n.toDate()}}catch(t){return}}function ee(e){if(e%1===0)return 0;let t=e.toString();return-1!==t.indexOf("e")&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),-1===t.indexOf(".")?0:t.split(".")[1].length}const te=new RegExp(/(\r\n|\n|\r)/gm);function ne(e){return-1!==e.indexOf("\n")?e.replace(te," "):e}var ie=n(23849),oe=n(72789);function ae(e){const t={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isIndex?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(e){try{const n=(0,h.bb)(e)?K(e):null,i=(0,h.bb)(n)?ne(n):"";return{...t,data:n,displayData:i,isMissingValue:(0,h.le)(e)}}catch(n){return L(K(e),"The value cannot be interpreted as a string. Error: ".concat(n))}},getCellValue:e=>void 0===e.data?null:e.data}}ae.isEditableType=!1;const le=ae;function re(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(l){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(l)}const i={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},a=i=>{if((0,h.le)(i))return!e.isRequired;let o=K(i),a=!1;return t.max_chars&&o.length>t.max_chars&&(o=o.slice(0,t.max_chars),a=!0),!(n instanceof RegExp&&!1===n.test(o))&&(!a||o)};return{...e,kind:"text",sortMode:"default",validateInput:a,getCell(e,t){if("string"===typeof n)return L(K(e),n);if(t){const t=a(e);if(!1===t)return L(K(e),"Invalid input.");"string"===typeof t&&(e=t)}try{const t=(0,h.bb)(e)?K(e):null,n=(0,h.bb)(t)?ne(t):"";return{...i,isMissingValue:(0,h.le)(t),data:t,displayData:n}}catch(l){return L("Incompatible value","The value cannot be interpreted as string. Error: ".concat(l))}},getCellValue:e=>void 0===e.data?null:e.data}}re.isEditableType=!0;const se=re;function de(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function ce(e,t,n,i,a,l,r){var s;const d=q({format:n,step:i,timezone:r},t.columnTypeOptions);let c,u,m;if((0,h.bb)(d.timezone))try{var g;c=(null===(g=de(F()(),d.timezone))||void 0===g?void 0:g.utcOffset())||void 0}catch(b){}(0,h.bb)(d.min_value)&&(u=$(d.min_value)||void 0),(0,h.bb)(d.max_value)&&(m=$(d.max_value)||void 0);const p={kind:o.p6.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isIndex?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:(null===(s=d.step)||void 0===s?void 0:s.toString())||"1",format:a,min:u,max:m}},f=e=>{const n=$(e);return null===n?!t.isRequired:void 0!==n&&(!((0,h.bb)(u)&&l(n)<l(u))&&!((0,h.bb)(m)&&l(n)>l(m)))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(e,t){if(!0===t){const t=f(e);if(!1===t)return L(K(e),"Invalid input.");t instanceof Date&&(e=t)}const i=$(e);let o="",a="",l=c;if(void 0===i)return L(K(e),"The value cannot be interpreted as a datetime object.");if(null!==i){let e=F().utc(i);if(!e.isValid())return L(K(i),"This should never happen. Please report this bug. \nError: ".concat(e.toString()));if(d.timezone){try{e=de(e,d.timezone)}catch(b){return L(e.toISOString(),"Failed to adjust to the provided timezone: ".concat(d.timezone,". \nError: ").concat(b))}l=e.utcOffset()}try{a=Q(e,d.format||n)}catch(b){return L(e.toISOString(),"Failed to format the date for rendering with: ".concat(d.format,". \nError: ").concat(b))}o=Q(e,n)}return{...p,copyData:o,isMissingValue:(0,h.le)(i),data:{...p.data,date:i,displayDate:a,timezoneOffset:l}}},getCellValue(e){var t;return(0,h.le)(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.date)?null:l(e.data.date)}}}function ue(e){var t,n,i,o,a;let l="YYYY-MM-DD HH:mm:ss";(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?l="YYYY-MM-DD HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(l="YYYY-MM-DD HH:mm:ss.SSS");const r=null===(i=e.arrowType)||void 0===i||null===(o=i.meta)||void 0===o?void 0:o.timezone,s=(0,h.bb)(r)||(0,h.bb)(null===e||void 0===e||null===(a=e.columnTypeOptions)||void 0===a?void 0:a.timezone);return ce("datetime",e,s?l+"Z":l,1,"datetime-local",(e=>s?e.toISOString():e.toISOString().replace("Z","")),r)}function me(e){var t,n;let i="HH:mm:ss";return(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?i="HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(i="HH:mm:ss.SSS"),ce("time",e,i,1,"time",(e=>e.toISOString().split("T")[1].replace("Z","")))}function he(e){return ce("date",e,"YYYY-MM-DD",1,"date",(e=>e.toISOString().split("T")[0]))}function ge(e){const t={kind:o.p6.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(e){let n=null;return n=X(e),void 0===n?L(K(e),"The value cannot be interpreted as boolean."):{...t,data:n,isMissingValue:(0,h.le)(n)}},getCellValue:e=>void 0===e.data?null:e.data}}ue.isEditableType=!0,me.isEditableType=!0,he.isEditableType=!0,ge.isEditableType=!0;const pe=ge;function fe(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function be(e){const t=oe.fu.getTypeName(e.arrowType),n=q({step:fe(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:"timedelta64[ns]"===t?"duration[ns]":void 0},e.columnTypeOptions),i=(0,h.le)(n.min_value)||n.min_value<0,a=(0,h.bb)(n.step)&&!Number.isNaN(n.step)?ee(n.step):void 0,l={kind:o.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:i,fixedDecimals:a},r=t=>{let i=G(t);if((0,h.le)(i))return!e.isRequired;if(Number.isNaN(i))return!1;let o=!1;return(0,h.bb)(n.max_value)&&i>n.max_value&&(i=n.max_value,o=!0),!((0,h.bb)(n.min_value)&&i<n.min_value)&&(!o||i)};return{...e,kind:"number",sortMode:"smart",validateInput:r,getCell(e,t){if(!0===t){const t=r(e);if(!1===t)return L(K(e),"Invalid input.");"number"===typeof t&&(e=t)}let i=G(e),o="";if((0,h.bb)(i)){if(Number.isNaN(i))return L(K(e),"The value cannot be interpreted as a number.");if((0,h.bb)(a)&&(s=i,i=0===(d=a)?Math.trunc(s):Math.trunc(s*10**d)/10**d),Number.isInteger(i)&&!Number.isSafeInteger(i))return L(K(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{o=U(i,n.format,a)}catch(c){return L(K(i),(0,h.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(c):"Failed to format the number. Error: ".concat(c))}}var s,d;return{...l,data:i,displayData:o,isMissingValue:(0,h.le)(i)}},getCellValue:e=>void 0===e.data?null:e.data}}be.isEditableType=!0;const ve=be;function ye(e){let t="string";const n=q({options:"bool"===oe.fu.getTypeName(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map((e=>typeof e)));1===i.size&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const a={kind:o.p6.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,data:{kind:"dropdown-cell",allowedValues:[...!0!==e.isRequired?[null]:[],...n.options.filter((e=>null!==e&&""!==e)).map((e=>K(e)))],value:"",readonly:!e.isEditable}};return{...e,kind:"selectbox",sortMode:"default",getCell(e,t){let n=null;return(0,h.bb)(e)&&""!==e&&(n=K(e)),t&&!a.data.allowedValues.includes(n)?L(K(n),"The value is not part of the allowed options."):{...a,isMissingValue:null===n,copyData:n||"",data:{...a.data,value:n}}},getCellValue(e){var n,i,o,a,l,r,s;return(0,h.le)(null===(n=e.data)||void 0===n?void 0:n.value)||""===(null===(i=e.data)||void 0===i?void 0:i.value)?null:"number"===t?null!==(a=G(null===(l=e.data)||void 0===l?void 0:l.value))&&void 0!==a?a:null:"boolean"===t?null!==(r=X(null===(s=e.data)||void 0===s?void 0:s.value))&&void 0!==r?r:null:null===(o=e.data)||void 0===o?void 0:o.value}}}ye.isEditableType=!0;const we=ye;function xe(e){const t={kind:o.p6.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(e){const n=(0,h.le)(e)?[]:J(e);return{...t,data:n,isMissingValue:(0,h.le)(e),copyData:(0,h.le)(e)?"":K(n.map((e=>"string"===typeof e&&e.includes(",")?e.replace(/,/g," "):e)))}},getCellValue:e=>(0,h.le)(e.data)||B(e)?null:e.data}}xe.isEditableType=!1;const Ce=xe;function Te(e,t,n){const i=new RegExp("".concat(e,"[,\\s].*{(?:[^}]*[\\s;]{1})?").concat(t,":\\s*([^;}]+)[;]?.*}"),"gm");n=n.replace(/{/g," {");const o=i.exec(n);if(o)return o[1].trim()}function Ee(e,t){const n=e.types.index[t],i=e.indexNames[t];let o=!0;return"range"===oe.fu.getTypeName(n)&&(o=!1),{id:"index-".concat(t),name:i,title:i,isEditable:o,arrowType:n,isIndex:!0,isHidden:!1}}function Me(e,t){const n=e.columns[0][t];let i,o=e.types.data[t];if((0,h.le)(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===oe.fu.getTypeName(o)){const n=e.getCategoricalOptions(t);(0,h.bb)(n)&&(i={options:n})}return{id:"column-".concat(n,"-").concat(t),name:n,title:n,isEditable:!0,arrowType:o,columnTypeOptions:i,isIndex:!1,isHidden:!1}}function ke(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=e.arrowType?oe.fu.getTypeName(e.arrowType):null;let a;if("object"===e.kind)a=e.getCell((0,h.bb)(t.content)?ne(oe.fu.format(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&(0,h.bb)(t.content)&&("number"===typeof t.content||"bigint"===typeof t.content)){var l,r;let n;var s,d,c;if("time"===i&&(0,h.bb)(null===(l=t.field)||void 0===l||null===(r=l.type)||void 0===r?void 0:r.unit))n=F().unix(oe.fu.convertToSeconds(t.content,null!==(s=null===(d=t.field)||void 0===d||null===(c=d.type)||void 0===c?void 0:c.unit)&&void 0!==s?s:0)).utc().toDate();else n=F().utc(Number(t.content)).toDate();a=e.getCell(n)}else if("decimal"===i){const n=(0,h.le)(t.content)?null:oe.fu.format(t.content,t.contentType,t.field);a=e.getCell(n)}else a=e.getCell(t.content);if(W(a))return a;if(!e.isEditable){if((0,h.bb)(t.displayContent)){var u,m;const e=ne(t.displayContent);a.kind===o.p6.Text||a.kind===o.p6.Number?a={...a,displayData:e}:a.kind===o.p6.Custom&&"date-picker-cell"===(null===(u=a.data)||void 0===u?void 0:u.kind)?a={...a,data:{...a.data,displayDate:e}}:a.kind===o.p6.Custom&&"link-cell"===(null===(m=a.data)||void 0===m?void 0:m.kind)&&(a={...a,data:{...a.data,displayText:e}})}n&&t.cssId&&(a=function(e,t,n){const i={},o=Te(t,"color",n);o&&(i.textDark=o);const a=Te(t,"background-color",n);return a&&(i.bgCell=a),"yellow"===a&&void 0===o&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}(a,t.cssId,n))}return a}function Ne(e){const t=e.columnTypeOptions||{};let n,i;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(r){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(r)}if(!(0,h.le)(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch(r){i=void 0}const a={kind:o.p6.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"link-cell",href:"",displayText:""},copyData:""},l=i=>{if((0,h.le)(i))return!e.isRequired;const o=K(i);return!(t.max_chars&&o.length>t.max_chars)&&!(n instanceof RegExp&&!1===n.test(o))};return{...e,kind:"link",sortMode:"default",validateInput:l,getCell(e,o){if((0,h.le)(e))return{...a,data:{...a.data,href:null},isMissingValue:!0};const s=e;if("string"===typeof n)return L(K(s),n);if(o){if(!1===l(s))return L(K(s),"Invalid input.")}let d="";return s&&(d=void 0!==i?function(e,t){if((0,h.le)(t))return"";try{const n=t.match(e);return n&&void 0!==n[1]?n[1]:t}catch(r){return t}}(i,s):t.display_text||s),{...a,data:{kind:"link-cell",href:s,displayText:d},copyData:s,cursor:"pointer",isMissingValue:(0,h.le)(s)}},getCellValue(e){var t;return(0,h.le)(null===(t=e.data)||void 0===t?void 0:t.href)?null:e.data.href}}}Ne.isEditableType=!0;const Re=Ne;function Se(e){const t={kind:o.p6.Image,data:[],displayData:[],allowAdd:!1,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:e.isIndex?"faded":"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(e){const n=(0,h.bb)(e)?[K(e)]:[];return{...t,data:n,isMissingValue:!(0,h.bb)(e),displayData:n}},getCellValue:e=>void 0===e.data||0===e.data.length?null:e.data[0]}}Se.isEditableType=!1;const _e=Se;function Oe(e){const t=fe(oe.fu.getTypeName(e.arrowType)),n=q({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=U(n.max_value,n.format)}catch(r){i=K(n.max_value)}const a=(0,h.le)(n.step)||Number.isNaN(n.step)?void 0:ee(n.step),l={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:i,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(e){if((0,h.le)(e))return P();if((0,h.le)(n.min_value)||(0,h.le)(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return L("Invalid min/max parameters","The min_value (".concat(n.min_value,") and max_value (").concat(n.max_value,") parameters must be valid numbers."));if((0,h.le)(n.step)||Number.isNaN(n.step))return L("Invalid step parameter","The step parameter (".concat(n.step,") must be a valid number."));const t=G(e);if(Number.isNaN(t)||(0,h.le)(t))return L(K(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return L(K(e),"The value is larger than the maximum supported integer values in number columns (2^53).");let i="";try{i=U(t,n.format,a)}catch(r){return L(K(t),(0,h.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(r):"Failed to format the number. Error: ".concat(r))}const o=Math.min(n.max_value,Math.max(n.min_value,t));return{...l,isMissingValue:(0,h.le)(e),copyData:String(t),data:{...l.data,value:o,label:i}}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.value)?null:null===(n=e.data)||void 0===n?void 0:n.value}}}Oe.isEditableType=!1;const Ie=Oe;function De(e,t,n){const i=q({y_min:0,y_max:1},t.columnTypeOptions),a={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[i.y_min,i.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(e){if((0,h.le)(i.y_min)||(0,h.le)(i.y_max)||Number.isNaN(i.y_min)||Number.isNaN(i.y_max)||i.y_min>=i.y_max)return L("Invalid min/max y-axis configuration","The y_min (".concat(i.y_min,") and y_max (").concat(i.y_max,") configuration options must be valid numbers."));if((0,h.le)(e))return P();const t=J(e),o=[];let l=[];if(0===t.length)return P();let r=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER;for(let n=0;n<t.length;n++){const e=G(t[n]);if(Number.isNaN(e)||(0,h.le)(e))return L(K(t),"The value cannot be interpreted as a numeric array. ".concat(K(e)," is not a number."));e>r&&(r=e),e<s&&(s=e),o.push(e)}return"line"===n&&o.length<=2?P():(l=o.length>0&&(r>i.y_max||s<i.y_min)?o.map((e=>r-s===0?r>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-s)/(r-s))+(i.y_min||0))):o,{...a,copyData:o.join(","),data:{...a.data,values:l,displayValues:o.map((e=>U(e)))},isMissingValue:(0,h.le)(e)})},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.values)?null:null===(n=e.data)||void 0===n?void 0:n.values}}}function He(e){return De("line_chart",e,"line")}function Ae(e){return De("bar_chart",e,"bar")}He.isEditableType=!1,Ae.isEditableType=!1;const ze=(0,C.Z)("div",{target:"ex7xuzc0"})({name:"iatp2c",styles:"display:flex;flex-grow:1;align-items:center;min-height:21px;.gdg-link-area{flex-grow:1;flex-shrink:1;cursor:pointer;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gdg-link-color);text-decoration:underline!important;padding-bottom:3px;}"}),Fe=e=>{const{uri:t,onChange:n,readonly:i,validatedSelection:a,preview:l}=e;return i?(0,k.jsx)(ze,{children:(0,k.jsx)("a",{"data-testid":"stLinkCell",className:"gdg-link-area",href:null!==t&&void 0!==t?t:"",target:"_blank",rel:"noopener noreferrer",children:l})}):(0,k.jsx)(o.t5,{validatedSelection:a,highlight:!0,autoFocus:!0,value:null!==t&&void 0!==t?t:"",onChange:n})};const Ve={draw:(e,t)=>{const{ctx:n,rect:i,theme:a,hoverX:l=-100}=e,{href:r,displayText:s}=t.data;if((0,h.le)(r))return;const d=s||r,c=a.cellHorizontalPadding,u=i.x+c,m=i.x+l,g="".concat(a.baseFontStyle," ").concat(a.fontFamily);n.font=g;const p=(0,o.aX)(n,g),f=i.y+i.height/2+p;if(m>i.x&&m<i.x+i.width){const e=(0,o.P7)(d,n,g);n.moveTo(u,Math.floor(f+5)+.5),n.lineTo(u+e.width,Math.floor(f+5)+.5),n.strokeStyle=a.linkColor,n.stroke()}return n.fillStyle=a.linkColor,n.fillText(d,u,f),n.closePath(),!0},isMatch:e=>"link-cell"===e.data.kind,kind:o.p6.Custom,measure:(e,t,n)=>{const{href:i,displayText:o}=t.data;return(0,h.le)(i)?0:e.measureText(o||i).width+2*n.cellHorizontalPadding},needsHover:!0,needsHoverPosition:!0,onSelect:e=>{const t=function(e){var t;const n=document.createElement("canvas").getContext("2d",{alpha:!1});if(null===n)return;const{posX:i,bounds:o,cell:a,theme:l}=e,r="".concat(l.baseFontStyle," ").concat(l.fontFamily);n.font=r;const{href:s,displayText:d}=a.data,c=o.x+i,u=n.measureText(null!==(t=d||s)&&void 0!==t?t:"").width,m=o.x+l.cellHorizontalPadding;return c>m&&c<m+u?s:void 0}(e);(0,h.le)(t)||window.open(t,"_blank","noopener,noreferrer")},onDelete:e=>({...e,data:{...e.data,displayText:"",href:""}}),provideEditor:()=>e=>{var t;const{onChange:n,value:i,validatedSelection:o}=e,{href:a,displayText:l}=i.data;return(0,k.jsx)(Fe,{uri:i.data.href,preview:null!==(t=l||a)&&void 0!==t?t:"",validatedSelection:o,readonly:!0===i.readonly,onChange:e=>n({...i,copyData:e.target.value,data:{...i.data,href:e.target.value}})})},onPaste:(e,t)=>e===t.href?void 0:{...t,href:e}},je=new Map(Object.entries({object:le,text:se,checkbox:pe,selectbox:we,list:Ce,number:ve,link:Re,datetime:ue,date:he,time:me,line_chart:He,bar_chart:Ae,image:_e,progress:Ie})),Le=[Ve],We="_index",Be="_pos:",Pe={small:75,medium:200,large:400};function Ye(e){if(!(0,h.le)(e))return"number"===typeof e?e:e in Pe?Pe[e]:void 0}function Ze(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==We?n=t.get(e.name):t.has("".concat(Be).concat(e.indexNumber))?n=t.get("".concat(Be).concat(e.indexNumber)):e.isIndex&&t.has(We)&&(n=t.get(We)),n?I()({...e},{title:n.label,width:Ye(n.width),isEditable:(0,h.bb)(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help}):e}function qe(e){var t;const n=null===(t=e.columnTypeOptions)||void 0===t?void 0:t.type;let i;return(0,h.bb)(n)&&(je.has(n)?i=je.get(n):(0,ie.KE)("Unknown column type configured in column configuration: ".concat(n))),(0,h.le)(i)&&(i=function(e){let t=e?oe.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty"].includes(t)?se:["datetime","datetimetz"].includes(t)?ue:"time"===t?me:"date"===t?he:["object","bytes"].includes(t)?le:["bool"].includes(t)?pe:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?ve:"categorical"===t?we:t.startsWith("list")?Ce:le):le}(e.arrowType)),i}const Je=function(e,t,n){const o=i.useMemo((()=>function(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return(0,ie.H)(t),new Map}}(e.columns)),[e.columns]),a=e.useContainerWidth||(0,h.bb)(e.width)&&e.width>0;return{columns:i.useMemo((()=>{let i=function(e){const t=[],{dimensions:n}=e,i=n.headerColumns,o=n.dataColumns;if(0===i&&0===o)return t.push({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0}),t;for(let a=0;a<i;a++){const n={...Ee(e,a),indexNumber:a};t.push(n)}for(let a=0;a<o;a++){const n={...Me(e,a),indexNumber:a+i};t.push(n)}return t}(t).map((t=>{let i={...t,...Ze(t,o),isStretched:a};const l=qe(i);return(e.editingMode===m.Eh.EditingMode.READ_ONLY||n||!1===l.isEditableType)&&(i={...i,isEditable:!1}),e.editingMode!==m.Eh.EditingMode.READ_ONLY&&1==i.isEditable&&(i={...i,icon:"editable"},i.isRequired&&e.editingMode===m.Eh.EditingMode.DYNAMIC&&(i={...i,isHidden:!1})),l(i)})).filter((e=>!e.isHidden));if(e.columnOrder&&e.columnOrder.length>0){const t=[];i.forEach((e=>{e.isIndex&&t.push(e)})),e.columnOrder.forEach((e=>{const n=i.find((t=>t.name===e));n&&!n.isIndex&&t.push(n)})),i=t}return i.length>0?i:[le({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}),[t,o,a,n,e.editingMode,e.columnOrder])}};function Ke(e){return e.isIndex?We:(0,h.le)(e.name)?"":e.name}const Xe=class{constructor(e){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=e}toJson(e){const t=new Map;e.forEach((e=>{t.set(e.indexNumber,e)}));const n={edited_rows:{},added_rows:[],deleted_rows:[]};this.editedCells.forEach(((e,i,o)=>{const a={};e.forEach(((e,n,i)=>{const o=t.get(n);o&&(a[Ke(o)]=o.getCellValue(e))})),n.edited_rows[i]=a})),this.addedRows.forEach((e=>{const i={};let o=!1;e.forEach(((e,n,a)=>{const l=t.get(n);if(l){const t=l.getCellValue(e);l.isRequired&&l.isEditable&&B(e)&&(o=!0),(0,h.bb)(t)&&(i[Ke(l)]=t)}})),o||n.added_rows.push(i)})),n.deleted_rows=this.deletedRows;return JSON.stringify(n,((e,t)=>void 0===t?null:t))}fromJson(e,t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const n=JSON.parse(e),i=new Map;t.forEach((e=>{i.set(e.indexNumber,e)}));const o=new Map;t.forEach((e=>{o.set(Ke(e),e)})),Object.keys(n.edited_rows).forEach((e=>{const t=Number(e),i=n.edited_rows[e];Object.keys(i).forEach((e=>{const n=i[e],a=o.get(e);if(a){const e=a.getCell(n);var l;if(e)this.editedCells.has(t)||this.editedCells.set(t,new Map),null===(l=this.editedCells.get(t))||void 0===l||l.set(a.indexNumber,e)}}))})),n.added_rows.forEach((e=>{const t=new Map;Object.keys(e).forEach((n=>{const i=e[n],a=o.get(n);if(a){const e=a.getCell(i);e&&t.set(a.indexNumber,e)}})),this.addedRows.push(t)})),this.deletedRows=n.deleted_rows}isAddedRow(e){return e>=this.numRows}getCell(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);const n=this.editedCells.get(t);return void 0!==n?n.get(e):void 0}setCell(e,t,n){if(this.isAddedRow(t)){if(t-this.numRows>=this.addedRows.length)return;this.addedRows[t-this.numRows].set(e,n)}else{void 0===this.editedCells.get(t)&&this.editedCells.set(t,new Map);this.editedCells.get(t).set(e,n)}}addRow(e){this.addedRows.push(e)}deleteRows(e){e.sort(((e,t)=>t-e)).forEach((e=>{this.deleteRow(e)}))}deleteRow(e){(0,h.le)(e)||e<0||(this.isAddedRow(e)?this.addedRows.splice(e-this.numRows,1):(this.deletedRows.includes(e)||(this.deletedRows.push(e),this.deletedRows=this.deletedRows.sort(((e,t)=>e-t))),this.editedCells.delete(e)))}getOriginalRowIndex(e){let t=e;for(let n=0;n<this.deletedRows.length&&!(this.deletedRows[n]>t);n++)t+=1;return t}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}};var Ge=n(35704);const Ue=function(){const e=(0,g.u)(),t=i.useMemo((()=>({editable:e=>'<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="'.concat(e.bgColor,'"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>')})),[]);return{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:(0,Ge.DZ)(e.colors.primary,.9),borderColor:e.colors.fadedText05,horizontalBorderColor:e.colors.fadedText05,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,Ge.DZ)(e.colors.primary,.9),bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:"".concat(e.fontSizes.sm),baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:(0,Ge.DZ)(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:8,cellVerticalPadding:3,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.linkText,drilldownBorder:e.colors.darkenedBgMix25,tableBorderRadius:e.radii.lg,headerIcons:t}};const Qe=function(e,t,n,o){return{getCellContent:i.useCallback((i=>{let[a,l]=i;if(a>t.length-1)return L("Column index out of bounds.","This should never happen. Please report this bug.");if(l>n-1)return L("Row index out of bounds.","This should never happen. Please report this bug.");const r=t[a],s=r.indexNumber,d=o.current.getOriginalRowIndex(l);if(r.isEditable||o.current.isAddedRow(d)){const e=o.current.getCell(s,d);if(void 0!==e)return e}try{return ke(r,e.getCell(d+1,s),e.cssStyles)}catch(c){return(0,ie.H)(c),L("Error during cell creation.","This should never happen. Please report this bug. \nError: ".concat(c))}}),[t,n,e,o])}};var $e=n(37753);const et=function(e,t,n){const[o,a]=i.useState(),{getCellContent:l,getOriginalIndex:r}=(0,$e.fF)({columns:t.map((e=>Z(e))),getCellContent:n,rows:e,sort:o}),s=i.useMemo((()=>function(e,t){return void 0===t?e:e.map((e=>e.id===t.column.id?{...e,title:"asc"===t.direction?"\u2191 ".concat(e.title):"\u2193 ".concat(e.title)}:e))}(t,o)),[t,o]),d=i.useCallback((e=>{let t="asc";const n=s[e];if(o&&o.column.id===n.id){if("asc"!==o.direction)return void a(void 0);t="desc"}a({column:Z(n),direction:t,mode:n.sortMode})}),[o,s]);return{columns:s,sortColumn:d,getOriginalIndex:r,getCellContent:l}};var tt=n(95345);const nt=",",it='"',ot='"',at="\n";function lt(e){return e.map((e=>function(e){if((0,h.le)(e))return"";const t=K(e);if(new RegExp("[".concat([nt,it,at].join(""),"]")).test(t))return"".concat(it).concat(t.replace(new RegExp(it,"g"),ot+it)).concat(it);return t}(e))).join(nt)+at}const rt=function(e,t,n){return{exportToCsv:i.useCallback((async()=>{const i=(new Date).toISOString().slice(0,16).replace(":","-"),o="".concat(i,"_export.csv"),a=await(0,tt.Kr)({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1}),l=new TextEncoder,r=await a.createWritable();await r.write(l.encode("\ufeff"));const s=t.map((e=>e.name));await r.write(l.encode(lt(s)));for(let d=0;d<n;d++){const n=[];t.forEach(((t,i,o)=>{n.push(t.getCellValue(e([i,d])))})),await r.write(l.encode(lt(n)))}await r.close()}),[t,n,e])}};const st=function(e,t,n,o,a,l,r){const s=i.useCallback(((t,i)=>{let[l,s]=t;const d=e[l];if(!d.isEditable)return;const c=d.indexNumber,u=n.current.getOriginalRowIndex(a(s)),m=o([l,s]),h=d.getCellValue(m),g=d.getCellValue(i);if(!W(m)&&g===h)return;const p=d.getCell(g,!0);W(p)?(0,ie.KE)("Not applying the cell edit since it causes this error:\n ".concat(p.data)):(n.current.setCell(c,u,{...p,lastUpdated:performance.now()}),r())}),[e,n,a,o,r]),d=i.useCallback((()=>{if(t)return;const i=new Map;e.forEach((e=>{i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i)}),[e,n,t]),c=i.useCallback((()=>{t||(d(),r())}),[d,r,t]),u=i.useCallback((i=>{var o;if(i.rows.length>0){if(t)return!0;const e=i.rows.toArray().map((e=>n.current.getOriginalRowIndex(a(e))));return n.current.deleteRows(e),r(!0),!1}if(null!==(o=i.current)&&void 0!==o&&o.range){const t=[],n=i.current.range;for(let i=n.y;i<n.y+n.height;i++)for(let o=n.x;o<n.x+n.width;o++){const n=e[o];n.isEditable&&!n.isRequired&&(t.push({cell:[o,i]}),s([o,i],n.getCell(null)))}return t.length>0&&(r(),l(t)),!1}return!0}),[e,n,t,l,a,r,s]),m=i.useCallback(((i,s)=>{const[c,u]=i,m=[];for(let g=0;g<s.length;g++){const i=s[g];if(g+u>=n.current.getNumRows()){if(t)break;d()}for(let t=0;t<i.length;t++){const l=i[t],r=g+u,s=t+c;if(s>=e.length)break;const d=e[s];if(d.isEditable){const e=d.getCell(l,!0);if((0,h.bb)(e)&&!W(e)){const t=d.indexNumber,i=n.current.getOriginalRowIndex(a(r)),l=d.getCellValue(o([s,r]));d.getCellValue(e)!==l&&(n.current.setCell(t,i,{...e,lastUpdated:performance.now()}),m.push({cell:[s,r]}))}}}m.length>0&&(r(),l(m))}return!1}),[e,n,t,a,o,d,r,l]),g=i.useCallback(((t,n)=>{const i=t[0];if(i>=e.length)return!0;const o=e[i];if(o.validateInput){const e=o.validateInput(o.getCellValue(n));return!0===e||!1===e?e:o.getCell(e)}return!0}),[e]);return{onCellEdited:s,onPaste:m,onRowAppended:c,onDelete:u,validateCell:g}};const dt=function(e,t){const[n,o]=i.useState(),a=i.useRef(null),l=i.useCallback((n=>{if(clearTimeout(a.current),a.current=0,o(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){const i=n.location[0],l=n.location[1];let r;if(i<0||i>=e.length)return;const s=e[i];if("header"===n.kind&&(0,h.bb)(s))r=s.help;else if("cell"===n.kind){const e=t([i,l]);s.isRequired&&s.isEditable&&B(e)?r="\u26a0\ufe0f Please fill out this cell.":function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip}(e)&&(r=e.tooltip)}r&&(a.current=setTimeout((()=>{r&&o({content:r,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,o,a]);return{tooltip:n,clearTooltip:i.useCallback((()=>{o(void 0)}),[o]),onItemHovered:l}};var ct=n(94379);const ut=function(e,t){return{drawCell:i.useCallback((n=>{const{cell:i,theme:a,ctx:l,rect:r}=n,s=t?n.col-1:n.col;if(B(i)&&s<e.length){let t=!1;const i=e[s];return["checkbox","line_chart","bar_chart","progress"].includes(i.kind)||((e=>{const{cell:t,theme:n}=e;(0,o.uN)({...e,theme:{...n,textDark:n.textLight,textMedium:n.textLight},spriteManager:{},hyperWrapping:!1},"None",t.contentAlign)})(n),t=!0),i.isRequired&&i.isEditable&&function(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}(l,r,a),t}return!1}),[e,t]),customRenderers:[...(0,ct.Bn)().customRenderers,...Le]}};const mt=function(e){const[t,n]=(0,i.useState)((()=>new Map)),o=i.useCallback(((e,i,o,a)=>{e.id&&n(new Map(t).set(e.id,a))}),[t]);return{columns:i.useMemo((()=>e.map((e=>e.id&&t.has(e.id)&&void 0!==t.get(e.id)?{...e,width:t.get(e.id),grow:0}:e))),[e,t]),onColumnResize:o}},ht=35,gt=2*ht+3;const pt=function(e,t,n,o,a){let l,r=function(e){return Math.max(e*ht+1+2,gt)}(t+1+(e.editingMode===m.Eh.EditingMode.DYNAMIC?1:0)),s=Math.min(r,400);e.height&&(s=Math.max(e.height,gt),r=Math.max(e.height,r)),o&&(s=Math.min(s,o),r=Math.min(r,o),e.height||(s=r));let d=n;e.useContainerWidth?l=n:e.width&&(l=Math.min(Math.max(e.width,52),n),d=Math.min(Math.max(e.width,d),n));const[c,u]=i.useState({width:l||"100%",height:s});return i.useLayoutEffect((()=>{e.useContainerWidth&&"100%"===c.width&&u({width:n,height:c.height})}),[n]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[t]),i.useLayoutEffect((()=>{u({width:l||"100%",height:c.height})}),[l]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[s]),i.useLayoutEffect((()=>{if(a){const t=e.useContainerWidth||(0,h.bb)(e.width)&&e.width>0;u({width:t?d:"100%",height:r})}else u({width:l||"100%",height:s})}),[a]),{minHeight:gt,maxHeight:r,minWidth:52,maxWidth:d,resizableSize:c,setResizableSize:u}},ft=(0,C.Z)("img",{target:"e24uaba0"})((()=>({maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"})),""),bt=e=>{let{urls:t}=e;const n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,k.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,k.jsx)(ft,{src:n})}):(0,k.jsx)(ft,{src:n})};var vt=n(31572),yt=n(13553),wt=n(80152);const xt=function(e){let{top:t,left:n,content:o,clearTooltip:a}=e;const[l,r]=i.useState(!0),s=(0,g.u)(),{colors:d,fontSizes:c,radii:u}=s,m=i.useCallback((()=>{r(!1),a()}),[a,r]);return(0,k.jsx)(vt.Z,{content:(0,k.jsx)(wt.Uo,{className:"stTooltipContent",children:(0,k.jsx)(b.ZP,{style:{fontSize:c.sm},source:o,allowHTML:!1})}),placement:yt.r4.top,accessibilityType:yt.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:u.md,borderTopRightRadius:u.md,borderBottomLeftRadius:u.md,borderBottomRightRadius:u.md,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,T.Iy)(s)?d.bgColor:d.secondaryBg,color:d.bodyText,fontSize:c.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:l,children:(0,k.jsx)("div",{className:"stTooltipTarget","data-testid":"stTooltipTarget",style:{position:"fixed",top:t,left:n}})})},Ct=(0,C.Z)("div",{target:"e1w7nams0"})((e=>{let{hasCustomizedScrollbars:t,theme:n}=e;return{position:"relative",display:"inline-block","& .glideDataEditor":{height:"100%",minWidth:"100%",borderRadius:n.radii.lg},"& .dvn-scroller":{...!t&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}}}),"");n(2739),n(24665);const Tt=(0,u.Z)((function(e){let{element:t,data:n,width:u,height:g,disabled:p,widgetMgr:f,isFullScreen:b,disableFullscreenMode:v,expand:y,collapse:w}=e;const x=i.useRef(null),C=i.useRef(null),T=i.useRef(null),E=Ue(),[M,S]=i.useState(!0),[_,O]=i.useState(!1),[I,D]=i.useState(!1),[H,A]=i.useState(!1),z=i.useMemo((()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),[]),F=i.useMemo((()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome")),[]),[V,j]=i.useState({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0}),L=i.useCallback((()=>{j({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0})}),[]),W=i.useCallback((()=>{j({columns:V.columns,rows:V.rows,current:void 0})}),[V]),B=i.useCallback((e=>{var t;null===(t=C.current)||void 0===t||t.updateCells(e)}),[]);(0,h.le)(t.editingMode)&&(t.editingMode=m.Eh.EditingMode.READ_ONLY);const{READ_ONLY:P,DYNAMIC:q}=m.Eh.EditingMode,J=n.dimensions,K=Math.max(0,J.rows-1),X=0===K&&!(t.editingMode===q&&J.dataColumns>0),G=K>15e4,U=i.useRef(new Xe(K)),[Q,$]=i.useState(U.current.getNumRows());i.useEffect((()=>{U.current=new Xe(K),$(U.current.getNumRows())}),[K]);const ee=i.useCallback((()=>{U.current=new Xe(K),$(U.current.getNumRows())}),[K]),{columns:te}=Je(t,n,p);i.useEffect((()=>{if(t.editingMode!==P){const e=f.getStringValue(t);e&&(U.current.fromJson(e,te),$(U.current.getNumRows()))}}),[]);const{getCellContent:ne}=Qe(n,te,Q,U),{columns:ie,sortColumn:oe,getOriginalIndex:ae,getCellContent:le}=et(K,te,ne),re=i.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Q!==U.current.getNumRows()&&$(U.current.getNumRows()),e&&L(),(0,h.Ds)(100,(()=>{const e=U.current.toJson(ie);let i=f.getStringValue(t);void 0===i&&(i=new Xe(0).toJson([])),e!==i&&f.setStringValue(t,e,{fromUi:n})}))()}),[f,t,Q,L,ie]),{exportToCsv:se}=rt(le,ie,Q),{onCellEdited:de,onPaste:ce,onRowAppended:ue,onDelete:me,validateCell:he}=st(ie,t.editingMode!==q,U,le,ae,B,re),{tooltip:ge,clearTooltip:pe,onItemHovered:fe}=dt(ie,le),{drawCell:be,customRenderers:ve}=ut(ie,t.editingMode===q),{columns:ye,onColumnResize:we}=mt(ie.map((e=>Z(e)))),{minHeight:xe,maxHeight:Ce,minWidth:Te,maxWidth:Ee,resizableSize:Me,setResizableSize:ke}=pt(t,Q,u,g,b),Ne=i.useCallback((e=>{let[t,n]=e;return{...Y(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:E.textLight},span:[0,Math.max(ie.length-1,0)]}}),[ie,E.textLight]);i.useEffect((()=>{const e=new c.K;return e.manageFormClearListener(f,t.formId,ee),()=>{e.disconnect()}}),[t.formId,ee,f]);const Re=!X&&t.editingMode===q&&!p,Se=V.rows.length>0,_e=void 0!==V.current,Oe=X?0:ie.filter((e=>e.isIndex)).length;return i.useEffect((()=>{if(T.current){var e,t;const n=null===(e=T.current)||void 0===e||null===(t=e.querySelector(".dvn-stack"))||void 0===t?void 0:t.getBoundingClientRect();n&&(D(n.height>T.current.clientHeight),A(n.width>T.current.clientWidth))}}),[Me,Q,ye]),(0,k.jsxs)(Ct,{"data-testid":"stDataFrame",className:"stDataFrame",hasCustomizedScrollbars:F,ref:T,onMouseDown:e=>{if(T.current&&F){const t=T.current.getBoundingClientRect();H&&t.height-7<e.clientY-t.top&&e.stopPropagation(),I&&t.width-7<e.clientX-t.left&&e.stopPropagation()}},onBlur:e=>{M||z||e.currentTarget.contains(e.relatedTarget)||W()},children:[(0,k.jsxs)(R,{isFullScreen:b,disableFullscreenMode:v,locked:Se||_e||z&&M,onExpand:y,onCollapse:w,target:Ct,children:[Re&&Se&&(0,k.jsx)(N,{label:"Delete row(s)",icon:l.H,onClick:()=>{me&&(me(V),pe())}}),Re&&!Se&&(0,k.jsx)(N,{label:"Add row",icon:r.m,onClick:()=>{ue&&(S(!0),ue(),pe())}}),!G&&!X&&(0,k.jsx)(N,{label:"Download as CSV",icon:s.k,onClick:()=>se()}),!X&&(0,k.jsx)(N,{label:"Search",icon:d.o,onClick:()=>{_?O(!1):(S(!0),O(!0)),pe()}})]}),(0,k.jsx)(a.e,{"data-testid":"stDataFrameResizable",ref:x,defaultSize:Me,style:{border:"1px solid ".concat(E.borderColor),borderRadius:"".concat(E.tableBorderRadius)},minHeight:xe,maxHeight:Ce,minWidth:Te,maxWidth:Ee,size:Me,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,ht],snapGap:ht/3,onResizeStop:(e,t,n,i)=>{x.current&&ke({width:x.current.size.width,height:Ce-x.current.size.height===3?x.current.size.height+3:x.current.size.height})},children:(0,k.jsx)(o.Nd,{className:"glideDataEditor",ref:C,columns:ye,rows:X?1:Q,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:ht,headerHeight:ht,getCellContent:X?Ne:le,onColumnResize:we,freezeColumns:Oe,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:e=>!(e>=ie.length&&(t.useContainerWidth||"100%"===Me.width)),getCellsForSelection:!0,rowMarkers:"none",rangeSelect:z?"none":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:fe,keybindings:{downFill:!0},onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(O((e=>!e)),e.stopPropagation(),e.preventDefault())},showSearch:_,onSearchClose:()=>{O(!1),pe()},onHeaderClicked:X||G?void 0:oe,gridSelection:V,onGridSelectionChange:e=>{(M||z)&&(j(e),void 0!==ge&&pe())},theme:E,onMouseMove:e=>{"out-of-bounds"===e.kind&&M?S(!1):"out-of-bounds"===e.kind||M||S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:1,...F&&{paddingBottom:H?-6:void 0,paddingRight:I?-6:void 0}},drawCell:be,customRenderers:ve,imageEditorOverride:bt,headerIcons:E.headerIcons,validateCell:he,onPaste:!1,...!X&&t.editingMode!==P&&!p&&{fillHandle:!z,onCellEdited:de,onPaste:ce,onDelete:me},...!X&&t.editingMode===q&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkerTheme:{bgCell:E.bgHeader,bgCellMedium:E.bgHeader},rowMarkers:"checkbox",rowSelectionMode:"multi",rowSelect:p?"none":"multi",onRowAppended:p?void 0:ue,onHeaderClicked:void 0}})}),ge&&ge.content&&(0,k.jsx)(xt,{top:ge.top,left:ge.left,content:ge.content,clearTooltip:pe})]})}),!0)},87814:(e,t,n)=>{n.d(t,{K:()=>o});var i=n(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,n){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,n),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}}}}]);