streamlit-nightly 1.21.1.dev20230423__py2.py3-none-any.whl → 1.21.1.dev20230425__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. streamlit/__init__.py +0 -7
  2. streamlit/elements/arrow.py +7 -264
  3. streamlit/elements/data_editor.py +109 -100
  4. streamlit/elements/file_uploader.py +17 -0
  5. streamlit/elements/layouts.py +0 -5
  6. streamlit/elements/lib/column_config_utils.py +371 -0
  7. streamlit/elements/lib/pandas_styler_utils.py +275 -0
  8. streamlit/runtime/connection_factory.py +5 -5
  9. streamlit/static/asset-manifest.json +20 -20
  10. streamlit/static/index.html +1 -1
  11. streamlit/static/static/js/{14.a19a6cd8.chunk.js → 14.9399e424.chunk.js} +1 -1
  12. streamlit/static/static/js/{227.087adf66.chunk.js → 227.9ccac1d5.chunk.js} +1 -1
  13. streamlit/static/static/js/{242.0daf8b47.chunk.js → 242.1b3289e0.chunk.js} +1 -1
  14. streamlit/static/static/js/{279.fdac58fc.chunk.js → 279.35b01780.chunk.js} +1 -1
  15. streamlit/static/static/js/{289.481fd42d.chunk.js → 289.e6157e40.chunk.js} +1 -1
  16. streamlit/static/static/js/{467.242e14ff.chunk.js → 467.50ac84df.chunk.js} +1 -1
  17. streamlit/static/static/js/{491.d0b710e9.chunk.js → 491.5a33a8ce.chunk.js} +1 -1
  18. streamlit/static/static/js/503.15864587.chunk.js +1 -0
  19. streamlit/static/static/js/{511.9f04ae9e.chunk.js → 511.e6ca580f.chunk.js} +1 -1
  20. streamlit/static/static/js/{578.ceaadcd5.chunk.js → 578.a65fcea0.chunk.js} +1 -1
  21. streamlit/static/static/js/{619.365611c8.chunk.js → 619.0325af0e.chunk.js} +1 -1
  22. streamlit/static/static/js/{628.7f41e2de.chunk.js → 628.9c70196b.chunk.js} +1 -1
  23. streamlit/static/static/js/{681.a2ba76c7.chunk.js → 681.9e30a8cd.chunk.js} +1 -1
  24. streamlit/static/static/js/{745.e2bcf16d.chunk.js → 745.e75ba963.chunk.js} +1 -1
  25. streamlit/static/static/js/{807.6789990f.chunk.js → 807.122f8b05.chunk.js} +1 -1
  26. streamlit/static/static/js/{828.096c1ad3.chunk.js → 828.0fde3da8.chunk.js} +1 -1
  27. streamlit/static/static/js/{871.ba625aee.chunk.js → 871.90a7dbae.chunk.js} +1 -1
  28. streamlit/static/static/js/{main.5e4731c6.js → main.ff35bd72.js} +2 -2
  29. streamlit/testing/element_tree.py +426 -548
  30. streamlit/type_util.py +19 -7
  31. {streamlit_nightly-1.21.1.dev20230423.dist-info → streamlit_nightly-1.21.1.dev20230425.dist-info}/METADATA +1 -1
  32. {streamlit_nightly-1.21.1.dev20230423.dist-info → streamlit_nightly-1.21.1.dev20230425.dist-info}/RECORD +38 -37
  33. streamlit/elements/show.py +0 -105
  34. streamlit/static/static/js/728.82770810.chunk.js +0 -1
  35. /streamlit/static/static/css/{728.23fa976d.chunk.css → 503.23fa976d.chunk.css} +0 -0
  36. /streamlit/static/static/js/{main.5e4731c6.js.LICENSE.txt → main.ff35bd72.js.LICENSE.txt} +0 -0
  37. {streamlit_nightly-1.21.1.dev20230423.data → streamlit_nightly-1.21.1.dev20230425.data}/scripts/streamlit.cmd +0 -0
  38. {streamlit_nightly-1.21.1.dev20230423.dist-info → streamlit_nightly-1.21.1.dev20230425.dist-info}/WHEEL +0 -0
  39. {streamlit_nightly-1.21.1.dev20230423.dist-info → streamlit_nightly-1.21.1.dev20230425.dist-info}/entry_points.txt +0 -0
  40. {streamlit_nightly-1.21.1.dev20230423.dist-info → streamlit_nightly-1.21.1.dev20230425.dist-info}/top_level.txt +0 -0
@@ -215,27 +215,27 @@ def connection_factory(
215
215
  default names and define corresponding sections in your config.toml file.
216
216
 
217
217
  >>> import streamlit as st
218
- >>> conn = st.connection("sql") # Config section defined in [connections.sql] in secrets.toml.
218
+ >>> conn = st.experimental_connection("sql") # Config section defined in [connections.sql] in secrets.toml.
219
219
 
220
220
  Creating a SQLConnection with a custom name requires you to explicitly specify the
221
221
  type. If type is not passed in as a kwarg, we try to infer it from the contents of
222
222
  your secrets.toml.
223
223
 
224
224
  >>> import streamlit as st
225
- >>> conn1 = st.connection("my_sql_connection", type="sql") # Config section defined in [connections.my_sql_connection].
226
- >>> conn2 = st.connection("my_other_sql_connection") # Type is inferred from [connections.my_other_sql_connection].
225
+ >>> conn1 = st.experimental_connection("my_sql_connection", type="sql") # Config section defined in [connections.my_sql_connection].
226
+ >>> conn2 = st.experimental_connection("my_other_sql_connection") # Type is inferred from [connections.my_other_sql_connection].
227
227
 
228
228
  Passing the full module path to the connection class that you want to use can be
229
229
  useful, especially when working with a custom connection:
230
230
 
231
231
  >>> import streamlit as st
232
- >>> conn = st.connection("my_sql_connection", type="streamlit.connections.SQLConnection")
232
+ >>> conn = st.experimental_connection("my_sql_connection", type="streamlit.connections.SQLConnection")
233
233
 
234
234
  Finally, you can even pass the connection class to use directly to this function.
235
235
 
236
236
  >>> import streamlit as st
237
237
  >>> from streamlit.connections import SQLConnection
238
- >>> conn = st.connection("my_sql_connection", type=SQLConnection)
238
+ >>> conn = st.experimental_connection("my_sql_connection", type=SQLConnection)
239
239
  """
240
240
  USE_ENV_PREFIX = "env:"
241
241
 
@@ -1,40 +1,40 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.f4a8738f.css",
4
- "main.js": "./static/js/main.5e4731c6.js",
4
+ "main.js": "./static/js/main.ff35bd72.js",
5
5
  "static/js/464.53a4cca5.chunk.js": "./static/js/464.53a4cca5.chunk.js",
6
6
  "static/js/248.1f4c1c4f.chunk.js": "./static/js/248.1f4c1c4f.chunk.js",
7
7
  "static/js/787.35855372.chunk.js": "./static/js/787.35855372.chunk.js",
8
8
  "static/js/274.dc861c12.chunk.js": "./static/js/274.dc861c12.chunk.js",
9
- "static/css/728.23fa976d.chunk.css": "./static/css/728.23fa976d.chunk.css",
10
- "static/js/728.82770810.chunk.js": "./static/js/728.82770810.chunk.js",
11
- "static/js/745.e2bcf16d.chunk.js": "./static/js/745.e2bcf16d.chunk.js",
9
+ "static/css/503.23fa976d.chunk.css": "./static/css/503.23fa976d.chunk.css",
10
+ "static/js/503.15864587.chunk.js": "./static/js/503.15864587.chunk.js",
11
+ "static/js/745.e75ba963.chunk.js": "./static/js/745.e75ba963.chunk.js",
12
12
  "static/js/261.7064465b.chunk.js": "./static/js/261.7064465b.chunk.js",
13
13
  "static/js/187.23c06ae4.chunk.js": "./static/js/187.23c06ae4.chunk.js",
14
- "static/js/491.d0b710e9.chunk.js": "./static/js/491.d0b710e9.chunk.js",
14
+ "static/js/491.5a33a8ce.chunk.js": "./static/js/491.5a33a8ce.chunk.js",
15
15
  "static/js/510.7a54dd75.chunk.js": "./static/js/510.7a54dd75.chunk.js",
16
16
  "static/js/429.c723ecb4.chunk.js": "./static/js/429.c723ecb4.chunk.js",
17
17
  "static/js/705.9a33d07f.chunk.js": "./static/js/705.9a33d07f.chunk.js",
18
- "static/js/578.ceaadcd5.chunk.js": "./static/js/578.ceaadcd5.chunk.js",
18
+ "static/js/578.a65fcea0.chunk.js": "./static/js/578.a65fcea0.chunk.js",
19
19
  "static/js/634.d0ee8e33.chunk.js": "./static/js/634.d0ee8e33.chunk.js",
20
20
  "static/js/784.21b8ebe2.chunk.js": "./static/js/784.21b8ebe2.chunk.js",
21
21
  "static/js/551.1570fa55.chunk.js": "./static/js/551.1570fa55.chunk.js",
22
22
  "static/js/830.7f4f1060.chunk.js": "./static/js/830.7f4f1060.chunk.js",
23
- "static/js/681.a2ba76c7.chunk.js": "./static/js/681.a2ba76c7.chunk.js",
24
- "static/js/242.0daf8b47.chunk.js": "./static/js/242.0daf8b47.chunk.js",
23
+ "static/js/681.9e30a8cd.chunk.js": "./static/js/681.9e30a8cd.chunk.js",
24
+ "static/js/242.1b3289e0.chunk.js": "./static/js/242.1b3289e0.chunk.js",
25
25
  "static/js/334.fc426162.chunk.js": "./static/js/334.fc426162.chunk.js",
26
- "static/js/828.096c1ad3.chunk.js": "./static/js/828.096c1ad3.chunk.js",
27
- "static/js/619.365611c8.chunk.js": "./static/js/619.365611c8.chunk.js",
28
- "static/js/807.6789990f.chunk.js": "./static/js/807.6789990f.chunk.js",
29
- "static/js/467.242e14ff.chunk.js": "./static/js/467.242e14ff.chunk.js",
30
- "static/js/279.fdac58fc.chunk.js": "./static/js/279.fdac58fc.chunk.js",
26
+ "static/js/828.0fde3da8.chunk.js": "./static/js/828.0fde3da8.chunk.js",
27
+ "static/js/619.0325af0e.chunk.js": "./static/js/619.0325af0e.chunk.js",
28
+ "static/js/807.122f8b05.chunk.js": "./static/js/807.122f8b05.chunk.js",
29
+ "static/js/467.50ac84df.chunk.js": "./static/js/467.50ac84df.chunk.js",
30
+ "static/js/279.35b01780.chunk.js": "./static/js/279.35b01780.chunk.js",
31
31
  "static/js/157.ccd0341b.chunk.js": "./static/js/157.ccd0341b.chunk.js",
32
- "static/js/14.a19a6cd8.chunk.js": "./static/js/14.a19a6cd8.chunk.js",
33
- "static/js/511.9f04ae9e.chunk.js": "./static/js/511.9f04ae9e.chunk.js",
34
- "static/js/289.481fd42d.chunk.js": "./static/js/289.481fd42d.chunk.js",
35
- "static/js/628.7f41e2de.chunk.js": "./static/js/628.7f41e2de.chunk.js",
36
- "static/js/227.087adf66.chunk.js": "./static/js/227.087adf66.chunk.js",
37
- "static/js/871.ba625aee.chunk.js": "./static/js/871.ba625aee.chunk.js",
32
+ "static/js/14.9399e424.chunk.js": "./static/js/14.9399e424.chunk.js",
33
+ "static/js/511.e6ca580f.chunk.js": "./static/js/511.e6ca580f.chunk.js",
34
+ "static/js/289.e6157e40.chunk.js": "./static/js/289.e6157e40.chunk.js",
35
+ "static/js/628.9c70196b.chunk.js": "./static/js/628.9c70196b.chunk.js",
36
+ "static/js/227.9ccac1d5.chunk.js": "./static/js/227.9ccac1d5.chunk.js",
37
+ "static/js/871.90a7dbae.chunk.js": "./static/js/871.90a7dbae.chunk.js",
38
38
  "static/js/714.ba8c0399.chunk.js": "./static/js/714.ba8c0399.chunk.js",
39
39
  "static/js/432.fd437391.chunk.js": "./static/js/432.fd437391.chunk.js",
40
40
  "static/js/998.983f28f4.chunk.js": "./static/js/998.983f28f4.chunk.js",
@@ -143,6 +143,6 @@
143
143
  },
144
144
  "entrypoints": [
145
145
  "static/css/main.f4a8738f.css",
146
- "static/js/main.5e4731c6.js"
146
+ "static/js/main.ff35bd72.js"
147
147
  ]
148
148
  }
@@ -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"/><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.5e4731c6.js"></script><link href="./static/css/main.f4a8738f.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"/><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.ff35bd72.js"></script><link href="./static/css/main.f4a8738f.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.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[14],{28014:function(e,t,i){i.r(t),i.d(t,{default:function(){return F}});var n=i(1413),a=i(15671),r=i(43144),o=i(97326),l=i(60136),s=i(29388),u=i(47313),d=i(16031),m=i(78947),h=i(83985),c=i(17076),f=i(46332),p=i(7976),g=i(64243),b=i(70816),v=i.n(b),y=i(65167),T=i(73290),R=i(80213),V=i(47167),k=i(2120),x=(0,V.Z)("div",{target:"e88czh83"})((function(e){var t=e.disabled,i=e.theme;return{alignItems:"center",backgroundColor:t?i.colors.gray:i.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",height:i.radii.xl,justifyContent:"center",width:i.radii.xl,":focus":{outline:"none"},":focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,k.DZ)(i.colors.primary,.5))}}}),""),w=(0,V.Z)("div",{target:"e88czh82"})((function(e){var t=e.disabled,i=e.theme;return{fontFamily:i.fonts.monospace,fontSize:i.fontSizes.sm,paddingBottom:i.spacing.twoThirdsSmFont,color:t?i.colors.gray:i.colors.primary,top:"-22px",position:"absolute",whiteSpace:"nowrap",backgroundColor:i.colors.transparent,lineHeight:i.lineHeights.base,fontWeight:"normal"}}),""),S=(0,V.Z)("div",{target:"e88czh81"})((function(e){var t=e.theme;return{paddingBottom:t.spacing.none,paddingLeft:t.spacing.none,paddingRight:t.spacing.none,paddingTop:t.spacing.twoThirdsSmFont,justifyContent:"space-between",alignItems:"center",display:"flex"}}),""),C=(0,V.Z)("div",{target:"e88czh80"})((function(e){var t=e.disabled,i=e.theme;return{lineHeight:i.lineHeights.base,fontWeight:"normal",fontSize:i.fontSizes.sm,fontFamily:i.fonts.monospace,color:t?i.colors.fadedText40:"inherit"}}),""),D=i(46417),B=function(e){(0,l.Z)(i,e);var t=(0,s.Z)(i);function i(e){var r;return(0,a.Z)(this,i),(r=t.call(this,e)).formClearHelper=new f.Kz,r.state=void 0,r.sliderRef=u.createRef(),r.thumbRef=[],r.thumbValueRef=[],r.commitWidgetValueDebounced=void 0,r.commitWidgetValue=function(e){r.props.widgetMgr.setDoubleArrayValue(r.props.element,r.state.value,e)},r.onFormCleared=function(){r.setState((function(e,t){return{value:t.element.default}}),(function(){return r.commitWidgetValue({fromUi:!0})}))},r.handleChange=function(e){var t=e.value;r.setState({value:t},(function(){return r.commitWidgetValueDebounced({fromUi:!0})}))},r.renderThumb=u.forwardRef((function(e,t){var i,a=e.$value,o=e.$thumbIndex,l=o||0;r.thumbRef[l]=t,(i=r.thumbValueRef)[l]||(i[l]=u.createRef());var s=a?r.formatValue(a[o]):"",m=(0,d.pick)(e,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]);return r.props.element.options.length>0||r.isDateTimeType(),r.thumbValueAlignment(r.thumbRef[l].current,r.thumbValueRef[l].current),(0,D.jsx)(x,(0,n.Z)((0,n.Z)({},m),{},{disabled:!0===e.$disabled,ref:r.thumbRef[l],"aria-valuetext":s,"aria-label":r.props.element.label,children:(0,D.jsx)(w,{className:"StyledThumbValue","data-testid":"stThumbValue",disabled:!0===e.$disabled,ref:r.thumbValueRef[l],children:s})}))})),r.renderTickBar=function(){var e=r.props,t=e.disabled,i=e.element,n=i.max,a=i.min;return(0,D.jsxs)(S,{"data-testid":"stTickBar",children:[(0,D.jsx)(C,{disabled:t,"data-testid":"stTickBarMin",children:r.formatValue(a)}),(0,D.jsx)(C,{disabled:t,"data-testid":"stTickBarMax",children:r.formatValue(n)})]})},r.commitWidgetValueDebounced=(0,g.Ds)(200,r.commitWidgetValue.bind((0,o.Z)(r))),r.state={value:r.initialValue},r}return(0,r.Z)(i,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getDoubleArrayValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){for(var e=0;e<Math.min(this.thumbRef.length,this.thumbValueRef.length);e++)this.thumbValueAlignment(this.thumbRef[e].current,this.thumbValueRef[e].current);this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"value",get:function(){var e=this.props.element,t=e.min,i=e.max,n=this.state.value,a=n[0],r=n.length>1?n[1]:n[0];return a>r&&(a=r),a<t&&(a=t),a>i&&(a=i),r<t&&(r=t),r>i&&(r=i),n.length>1?[a,r]:[a]}},{key:"isDateTimeType",value:function(){var e=this.props.element.dataType;return e===p.iR.DataType.DATETIME||e===p.iR.DataType.DATE||e===p.iR.DataType.TIME}},{key:"formatValue",value:function(e){var t=this.props.element,i=t.format,n=t.options;return this.isDateTimeType()?v().utc(e/1e3).format(i):n.length>0?(0,c.sprintf)(i,n[e]):(0,c.sprintf)(i,e)}},{key:"thumbValueAlignment",value:function(e,t){var i=this.sliderRef.current;if(i&&e&&t){var n=i.getBoundingClientRect(),a=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=a.left+a.width/2,l=o-r.width/2<n.left,s=o+r.width/2>n.right;t.style.left=l?"0":"",t.style.right=s?"0":""}}},{key:"render",value:function(){var e,t=this.props,i=t.disabled,a=t.element,r=t.theme,o=t.width,l=t.widgetMgr,s=r.colors,u=r.fonts,d=r.fontSizes,h=r.spacing,c={width:o};return this.formClearHelper.manageFormClearListener(l,a.formId,this.onFormCleared),(0,D.jsxs)("div",{ref:this.sliderRef,className:"stSlider",style:c,children:[(0,D.jsx)(y.ON,{label:a.label,disabled:i,labelVisibility:(0,g.iF)(null===(e=a.labelVisibility)||void 0===e?void 0:e.value),children:a.help&&(0,D.jsx)(y.dT,{children:(0,D.jsx)(T.ZP,{content:a.help,placement:R.ug.TOP_RIGHT})})}),(0,D.jsx)(m.Z,{min:a.min,max:a.max,step:a.step,value:this.value,onChange:this.handleChange,disabled:i,overrides:{Root:{style:{paddingTop:h.twoThirdsSmFont}},Thumb:this.renderThumb,Tick:{style:{fontFamily:u.monospace,fontSize:d.sm}},Track:{style:{backgroundColor:"none !important",paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:h.twoThirdsSmFont}},InnerTrack:{style:function(e){var t=e.$disabled;return(0,n.Z)({height:"4px"},t?{background:s.darkenedBgMix25}:{})}},TickBar:this.renderTickBar}})]})}}]),i}(u.PureComponent),F=(0,h.b)(B)}}]);
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[14],{28014:function(e,t,i){i.r(t),i.d(t,{default:function(){return F}});var n=i(1413),a=i(15671),r=i(43144),o=i(97326),l=i(60136),s=i(29388),u=i(47313),d=i(16031),m=i(78947),h=i(83985),c=i(17076),f=i(46332),p=i(7976),g=i(64243),b=i(70816),v=i.n(b),y=i(65167),T=i(73290),R=i(10612),V=i(47167),k=i(2120),x=(0,V.Z)("div",{target:"e88czh83"})((function(e){var t=e.disabled,i=e.theme;return{alignItems:"center",backgroundColor:t?i.colors.gray:i.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",height:i.radii.xl,justifyContent:"center",width:i.radii.xl,":focus":{outline:"none"},":focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,k.DZ)(i.colors.primary,.5))}}}),""),w=(0,V.Z)("div",{target:"e88czh82"})((function(e){var t=e.disabled,i=e.theme;return{fontFamily:i.fonts.monospace,fontSize:i.fontSizes.sm,paddingBottom:i.spacing.twoThirdsSmFont,color:t?i.colors.gray:i.colors.primary,top:"-22px",position:"absolute",whiteSpace:"nowrap",backgroundColor:i.colors.transparent,lineHeight:i.lineHeights.base,fontWeight:"normal"}}),""),S=(0,V.Z)("div",{target:"e88czh81"})((function(e){var t=e.theme;return{paddingBottom:t.spacing.none,paddingLeft:t.spacing.none,paddingRight:t.spacing.none,paddingTop:t.spacing.twoThirdsSmFont,justifyContent:"space-between",alignItems:"center",display:"flex"}}),""),C=(0,V.Z)("div",{target:"e88czh80"})((function(e){var t=e.disabled,i=e.theme;return{lineHeight:i.lineHeights.base,fontWeight:"normal",fontSize:i.fontSizes.sm,fontFamily:i.fonts.monospace,color:t?i.colors.fadedText40:"inherit"}}),""),D=i(46417),B=function(e){(0,l.Z)(i,e);var t=(0,s.Z)(i);function i(e){var r;return(0,a.Z)(this,i),(r=t.call(this,e)).formClearHelper=new f.Kz,r.state=void 0,r.sliderRef=u.createRef(),r.thumbRef=[],r.thumbValueRef=[],r.commitWidgetValueDebounced=void 0,r.commitWidgetValue=function(e){r.props.widgetMgr.setDoubleArrayValue(r.props.element,r.state.value,e)},r.onFormCleared=function(){r.setState((function(e,t){return{value:t.element.default}}),(function(){return r.commitWidgetValue({fromUi:!0})}))},r.handleChange=function(e){var t=e.value;r.setState({value:t},(function(){return r.commitWidgetValueDebounced({fromUi:!0})}))},r.renderThumb=u.forwardRef((function(e,t){var i,a=e.$value,o=e.$thumbIndex,l=o||0;r.thumbRef[l]=t,(i=r.thumbValueRef)[l]||(i[l]=u.createRef());var s=a?r.formatValue(a[o]):"",m=(0,d.pick)(e,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]);return r.props.element.options.length>0||r.isDateTimeType(),r.thumbValueAlignment(r.thumbRef[l].current,r.thumbValueRef[l].current),(0,D.jsx)(x,(0,n.Z)((0,n.Z)({},m),{},{disabled:!0===e.$disabled,ref:r.thumbRef[l],"aria-valuetext":s,"aria-label":r.props.element.label,children:(0,D.jsx)(w,{className:"StyledThumbValue","data-testid":"stThumbValue",disabled:!0===e.$disabled,ref:r.thumbValueRef[l],children:s})}))})),r.renderTickBar=function(){var e=r.props,t=e.disabled,i=e.element,n=i.max,a=i.min;return(0,D.jsxs)(S,{"data-testid":"stTickBar",children:[(0,D.jsx)(C,{disabled:t,"data-testid":"stTickBarMin",children:r.formatValue(a)}),(0,D.jsx)(C,{disabled:t,"data-testid":"stTickBarMax",children:r.formatValue(n)})]})},r.commitWidgetValueDebounced=(0,g.Ds)(200,r.commitWidgetValue.bind((0,o.Z)(r))),r.state={value:r.initialValue},r}return(0,r.Z)(i,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getDoubleArrayValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){for(var e=0;e<Math.min(this.thumbRef.length,this.thumbValueRef.length);e++)this.thumbValueAlignment(this.thumbRef[e].current,this.thumbValueRef[e].current);this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"value",get:function(){var e=this.props.element,t=e.min,i=e.max,n=this.state.value,a=n[0],r=n.length>1?n[1]:n[0];return a>r&&(a=r),a<t&&(a=t),a>i&&(a=i),r<t&&(r=t),r>i&&(r=i),n.length>1?[a,r]:[a]}},{key:"isDateTimeType",value:function(){var e=this.props.element.dataType;return e===p.iR.DataType.DATETIME||e===p.iR.DataType.DATE||e===p.iR.DataType.TIME}},{key:"formatValue",value:function(e){var t=this.props.element,i=t.format,n=t.options;return this.isDateTimeType()?v().utc(e/1e3).format(i):n.length>0?(0,c.sprintf)(i,n[e]):(0,c.sprintf)(i,e)}},{key:"thumbValueAlignment",value:function(e,t){var i=this.sliderRef.current;if(i&&e&&t){var n=i.getBoundingClientRect(),a=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=a.left+a.width/2,l=o-r.width/2<n.left,s=o+r.width/2>n.right;t.style.left=l?"0":"",t.style.right=s?"0":""}}},{key:"render",value:function(){var e,t=this.props,i=t.disabled,a=t.element,r=t.theme,o=t.width,l=t.widgetMgr,s=r.colors,u=r.fonts,d=r.fontSizes,h=r.spacing,c={width:o};return this.formClearHelper.manageFormClearListener(l,a.formId,this.onFormCleared),(0,D.jsxs)("div",{ref:this.sliderRef,className:"stSlider",style:c,children:[(0,D.jsx)(y.ON,{label:a.label,disabled:i,labelVisibility:(0,g.iF)(null===(e=a.labelVisibility)||void 0===e?void 0:e.value),children:a.help&&(0,D.jsx)(y.dT,{children:(0,D.jsx)(T.ZP,{content:a.help,placement:R.ug.TOP_RIGHT})})}),(0,D.jsx)(m.Z,{min:a.min,max:a.max,step:a.step,value:this.value,onChange:this.handleChange,disabled:i,overrides:{Root:{style:{paddingTop:h.twoThirdsSmFont}},Thumb:this.renderThumb,Tick:{style:{fontFamily:u.monospace,fontSize:d.sm}},Track:{style:{backgroundColor:"none !important",paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:h.twoThirdsSmFont}},InnerTrack:{style:function(e){var t=e.$disabled;return(0,n.Z)({height:"4px"},t?{background:s.darkenedBgMix25}:{})}},TickBar:this.renderTickBar}})]})}}]),i}(u.PureComponent),F=(0,h.b)(B)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[227],{34227:function(e,t,n){n.r(t),n.d(t,{default:function(){return v}});var r=n(29439),i=n(15671),o=n(43144),a=n(60136),l=n(29388),u=n(47313),s=n(11197),p=n(46332),d=n(65167),m=n(73290),c=n(80213),f=n(64243),h=n(46417),g=function(e){(0,a.Z)(n,e);var t=(0,l.Z)(n);function n(){var e;(0,i.Z)(this,n);for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return(e=t.call.apply(t,[this].concat(a))).formClearHelper=new p.Kz,e.state={value:e.initialValue},e.commitWidgetValue=function(t){e.props.widgetMgr.setStringValue(e.props.element,e.state.value,t)},e.onFormCleared=function(){e.setState((function(e,t){return{value:t.element.default}}),(function(){return e.commitWidgetValue({fromUi:!0})}))},e.handleChange=function(t){var n;n=null===t?e.initialValue:e.dateToString(t),e.setState({value:n},(function(){return e.commitWidgetValue({fromUi:!0})}))},e.stringToDate=function(e){var t=e.split(":").map(Number),n=(0,r.Z)(t,2),i=n[0],o=n[1],a=new Date;return a.setHours(i),a.setMinutes(o),a},e.dateToString=function(e){var t=e.getHours().toString().padStart(2,"0"),n=e.getMinutes().toString().padStart(2,"0");return"".concat(t,":").concat(n)},e}return(0,o.Z)(n,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getStringValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"render",value:function(){var e,t=this.props,n=t.disabled,r=t.width,i=t.element,o=t.widgetMgr,a={width:r},l={Select:{props:{disabled:n,overrides:{ControlContainer:{style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}},IconsContainer:{style:function(){return{paddingRight:".5rem"}}},ValueContainer:{style:function(){return{paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}}},SingleValue:{props:{className:"stTimeInput-timeDisplay"}},Dropdown:{style:function(){return{paddingTop:0,paddingBottom:0}}},Popover:{props:{overrides:{Body:{style:function(){return{marginTop:"1px"}}}}}}}}}};return this.formClearHelper.manageFormClearListener(o,i.formId,this.onFormCleared),(0,h.jsxs)("div",{className:"stTimeInput",style:a,children:[(0,h.jsx)(d.ON,{label:i.label,disabled:n,labelVisibility:(0,f.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,h.jsx)(d.dT,{children:(0,h.jsx)(m.ZP,{content:i.help,placement:c.ug.TOP_RIGHT})})}),(0,h.jsx)(s.Z,{format:"24",step:i.step?Number(i.step):900,value:this.stringToDate(this.state.value),onChange:this.handleChange,overrides:l,creatable:!0,"aria-label":i.label})]})}}]),n}(u.PureComponent),v=g}}]);
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[227],{34227:function(e,t,n){n.r(t),n.d(t,{default:function(){return v}});var r=n(29439),i=n(15671),o=n(43144),a=n(60136),l=n(29388),u=n(47313),s=n(11197),p=n(46332),d=n(65167),m=n(73290),c=n(10612),f=n(64243),h=n(46417),g=function(e){(0,a.Z)(n,e);var t=(0,l.Z)(n);function n(){var e;(0,i.Z)(this,n);for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return(e=t.call.apply(t,[this].concat(a))).formClearHelper=new p.Kz,e.state={value:e.initialValue},e.commitWidgetValue=function(t){e.props.widgetMgr.setStringValue(e.props.element,e.state.value,t)},e.onFormCleared=function(){e.setState((function(e,t){return{value:t.element.default}}),(function(){return e.commitWidgetValue({fromUi:!0})}))},e.handleChange=function(t){var n;n=null===t?e.initialValue:e.dateToString(t),e.setState({value:n},(function(){return e.commitWidgetValue({fromUi:!0})}))},e.stringToDate=function(e){var t=e.split(":").map(Number),n=(0,r.Z)(t,2),i=n[0],o=n[1],a=new Date;return a.setHours(i),a.setMinutes(o),a},e.dateToString=function(e){var t=e.getHours().toString().padStart(2,"0"),n=e.getMinutes().toString().padStart(2,"0");return"".concat(t,":").concat(n)},e}return(0,o.Z)(n,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getStringValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"render",value:function(){var e,t=this.props,n=t.disabled,r=t.width,i=t.element,o=t.widgetMgr,a={width:r},l={Select:{props:{disabled:n,overrides:{ControlContainer:{style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}},IconsContainer:{style:function(){return{paddingRight:".5rem"}}},ValueContainer:{style:function(){return{paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}}},SingleValue:{props:{className:"stTimeInput-timeDisplay"}},Dropdown:{style:function(){return{paddingTop:0,paddingBottom:0}}},Popover:{props:{overrides:{Body:{style:function(){return{marginTop:"1px"}}}}}}}}}};return this.formClearHelper.manageFormClearListener(o,i.formId,this.onFormCleared),(0,h.jsxs)("div",{className:"stTimeInput",style:a,children:[(0,h.jsx)(d.ON,{label:i.label,disabled:n,labelVisibility:(0,f.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,h.jsx)(d.dT,{children:(0,h.jsx)(m.ZP,{content:i.help,placement:c.ug.TOP_RIGHT})})}),(0,h.jsx)(s.Z,{format:"24",step:i.step?Number(i.step):900,value:this.stringToDate(this.state.value),onChange:this.handleChange,overrides:l,creatable:!0,"aria-label":i.label})]})}}]),n}(u.PureComponent),v=g}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[242],{30242:function(e,t,o){o.r(t),o.d(t,{default:function(){return G}});var r=o(15671),i=o(43144),n=o(60136),a=o(29388),l=o(47313),c=o(83985),s=o(64243),u=o(74969),d=o(15160);function p(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function h(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?p(Object(o),!0).forEach((function(t){f(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):p(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function f(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function m(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme.colors;return t?o||r?l.tickFillDisabled:l.tickFill:i&&(r||o)?a?l.tickFillErrorSelectedHoverActive:n?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:n?l.tickFillErrorHover:l.tickFillError:r||o?a?l.tickFillSelectedHoverActive:n?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:n?l.tickFillHover:l.tickFill}function b(e){var t=e.$disabled,o=e.$theme.colors;return t?o.contentSecondary:o.contentPrimary}var g=(0,d.zo)("label",(function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:"top"===o||"bottom"===o?"column":"row",display:"flex",alignItems:"top"===o||"bottom"===o?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}}));g.displayName="Root",g.displayName="Root";var v=(0,d.zo)("span",(function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,c=n.animation,s=o?n.colors.tickMarkFillDisabled:r?n.colors.tickMarkFillError:n.colors.tickMarkFill,u=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(s,'"/>\n </svg>\n ')),d=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(s,'"/>\n </svg>\n ')),p=n.borders.checkboxBorderRadius,h=function(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:o||i?"transparent":r?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:c.timing200,transitionTimingFunction:c.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:h,borderRightColor:h,borderTopColor:h,borderBottomColor:h,borderTopLeftRadius:p,borderTopRightRadius:p,borderBottomRightRadius:p,borderBottomLeftRadius:p,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(u,"');"):t?"url('data:image/svg+xml,".concat(d,"');"):null,backgroundColor:m(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));v.displayName="Checkmark",v.displayName="Checkmark";var y=(0,d.zo)("div",(function(e){var t=e.$theme.typography;return h(h(h({verticalAlign:"middle"},function(e){var t,o=e.$labelPlacement,r=void 0===o?"":o,i=e.$theme,n=i.sizing.scale300;switch(r){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),f({},"padding".concat(t),n)}(e)),{},{color:b(e)},t.LabelMedium),{},{lineHeight:"24px"})}));y.displayName="Label",y.displayName="Label";var k=(0,d.zo)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});k.displayName="Input",k.displayName="Input";var $=(0,d.zo)("div",(function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat("rtl"===e.$theme.direction?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}}));$.displayName="Toggle",$.displayName="Toggle";var w=(0,d.zo)("div",(function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}}));w.displayName="ToggleTrack",w.displayName="ToggleTrack";var F=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),x=(Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),o(75643));function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},C.apply(this,arguments)}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},P(e,t)}function S(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=M(e);if(t){var i=M(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return L(this,o)}}function L(e,t){if(t&&("object"===R(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return j(e)}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M(e){return M=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},M(e)}function E(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var B=function(e){return e.stopPropagation()},V=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&&P(e,t)}(n,e);var t,o,r,i=S(n);function n(){var e;O(this,n);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return E(j(e=i.call.apply(i,[this].concat(o))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),E(j(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),E(j(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),E(j(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),E(j(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),E(j(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,x.E)(t)&&e.setState({isFocusVisible:!0})})),E(j(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=n,(o=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,o=e.inputRef;t&&o.current&&o.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,o=void 0===t?{}:t,r=e.onChange,i=e.labelPlacement,n=void 0===i?this.props.checkmarkType===F.toggle?"left":"right":i,a=e.inputRef,c=e.isIndeterminate,s=e.error,d=e.disabled,p=e.value,h=e.name,f=e.type,m=e.checked,b=e.children,x=e.required,R=e.title,O=o.Root,T=o.Checkmark,P=o.Label,S=o.Input,L=o.Toggle,j=o.ToggleTrack,M=(0,u.XG)(O)||g,E=(0,u.XG)(T)||v,V=(0,u.XG)(P)||y,z=(0,u.XG)(S)||k,H=(0,u.XG)(L)||$,D=(0,u.XG)(j)||w,I={onChange:r,onFocus:this.onFocus,onBlur:this.onBlur},A={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},W={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:s,$checked:m,$isIndeterminate:c,$required:x,$disabled:d,$value:p},U=b&&l.createElement(V,C({$labelPlacement:n},W,(0,u.ch)(P)),this.props.containsInteractiveElement?l.createElement("div",{onClick:function(e){return e.preventDefault()}},b):b);return l.createElement(M,C({"data-baseweb":"checkbox",title:R||null,$labelPlacement:n},W,A,(0,u.ch)(O)),("top"===n||"left"===n)&&U,this.props.checkmarkType===F.toggle?l.createElement(D,C({},W,(0,u.ch)(j)),l.createElement(H,C({},W,(0,u.ch)(L)))):l.createElement(E,C({},W,(0,u.ch)(T))),l.createElement(z,C({value:p,name:h,checked:m,required:x,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":c?"mixed":m,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":s||null,"aria-required":x||null,disabled:d,type:f,ref:a,onClick:B},W,I,(0,u.ch)(S))),("bottom"===n||"right"===n)&&U)}}])&&T(t.prototype,o),r&&T(t,r),Object.defineProperty(t,"prototype",{writable:!1}),n}(l.Component);E(V,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:l.createRef(),error:!1,type:"checkbox",checkmarkType:F.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});var z=V,H=o(2120),D=o(46332),I=o(73290),A=o(80213),W=o(65167),U=o(50412),N=(0,o(47167).Z)("div",{target:"ek41t0m0"})((function(e){var t=e.visibility;return{display:t===s.Ws.Collapsed?"none":"flex",visibility:t===s.Ws.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}}),""),_=o(46417),Z=function(e){(0,n.Z)(o,e);var t=(0,a.Z)(o);function o(){var e;(0,r.Z)(this,o);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(e=t.call.apply(t,[this].concat(n))).formClearHelper=new D.Kz,e.state={value:e.initialValue},e.commitWidgetValue=function(t){e.props.widgetMgr.setBoolValue(e.props.element,e.state.value,t)},e.onFormCleared=function(){e.setState((function(e,t){return{value:t.element.default}}),(function(){return e.commitWidgetValue({fromUi:!0})}))},e.onChange=function(t){var o=t.target.checked;e.setState({value:o},(function(){return e.commitWidgetValue({fromUi:!0})}))},e}return(0,i.Z)(o,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getBoolValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"render",value:function(){var e,t=this.props,o=t.theme,r=t.width,i=t.element,n=t.disabled,a=t.widgetMgr,l=o.colors,c=o.spacing,u={width:r},d=n?l.fadedText40:l.bodyText;return this.formClearHelper.manageFormClearListener(a,i.formId,this.onFormCleared),(0,_.jsx)("div",{className:"row-widget stCheckbox",style:u,children:(0,_.jsx)(z,{checked:this.state.value,disabled:n,onChange:this.onChange,"aria-label":i.label,overrides:{Root:{style:function(e){var t=e.$isFocusVisible;return{marginBottom:0,marginTop:0,paddingRight:c.twoThirdsSmFont,backgroundColor:t?l.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Checkmark:{style:function(e){var t=e.$isFocusVisible,o=e.$checked,r=o&&!n?l.primary:l.fadedText40;return{outline:0,width:"1rem",height:"1rem",marginTop:"0.30rem",boxShadow:t&&o?"0 0 0 0.2rem ".concat((0,H.DZ)(l.primary,.5)):"",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftColor:r,borderRightColor:r,borderTopColor:r,borderBottomColor:r}}},Label:{style:{color:d}}},children:(0,_.jsxs)(N,{visibility:(0,s.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:[(0,_.jsx)(U.Z,{source:i.label,allowHTML:!1,isLabel:!0,isCheckbox:!0}),i.help&&(0,_.jsx)(W.Hp,{color:d,children:(0,_.jsx)(I.ZP,{content:i.help,placement:A.ug.TOP_RIGHT})})]})})})}}]),o}(l.PureComponent),G=(0,c.b)(Z)}}]);
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[242],{30242:function(e,t,o){o.r(t),o.d(t,{default:function(){return G}});var r=o(15671),i=o(43144),n=o(60136),a=o(29388),l=o(47313),c=o(83985),s=o(64243),u=o(74969),d=o(15160);function p(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function h(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?p(Object(o),!0).forEach((function(t){f(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):p(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function f(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function m(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme.colors;return t?o||r?l.tickFillDisabled:l.tickFill:i&&(r||o)?a?l.tickFillErrorSelectedHoverActive:n?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:n?l.tickFillErrorHover:l.tickFillError:r||o?a?l.tickFillSelectedHoverActive:n?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:n?l.tickFillHover:l.tickFill}function b(e){var t=e.$disabled,o=e.$theme.colors;return t?o.contentSecondary:o.contentPrimary}var g=(0,d.zo)("label",(function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:"top"===o||"bottom"===o?"column":"row",display:"flex",alignItems:"top"===o||"bottom"===o?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}}));g.displayName="Root",g.displayName="Root";var v=(0,d.zo)("span",(function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,c=n.animation,s=o?n.colors.tickMarkFillDisabled:r?n.colors.tickMarkFillError:n.colors.tickMarkFill,u=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(s,'"/>\n </svg>\n ')),d=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(s,'"/>\n </svg>\n ')),p=n.borders.checkboxBorderRadius,h=function(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:o||i?"transparent":r?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:c.timing200,transitionTimingFunction:c.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:h,borderRightColor:h,borderTopColor:h,borderBottomColor:h,borderTopLeftRadius:p,borderTopRightRadius:p,borderBottomRightRadius:p,borderBottomLeftRadius:p,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(u,"');"):t?"url('data:image/svg+xml,".concat(d,"');"):null,backgroundColor:m(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));v.displayName="Checkmark",v.displayName="Checkmark";var y=(0,d.zo)("div",(function(e){var t=e.$theme.typography;return h(h(h({verticalAlign:"middle"},function(e){var t,o=e.$labelPlacement,r=void 0===o?"":o,i=e.$theme,n=i.sizing.scale300;switch(r){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),f({},"padding".concat(t),n)}(e)),{},{color:b(e)},t.LabelMedium),{},{lineHeight:"24px"})}));y.displayName="Label",y.displayName="Label";var k=(0,d.zo)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});k.displayName="Input",k.displayName="Input";var $=(0,d.zo)("div",(function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat("rtl"===e.$theme.direction?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}}));$.displayName="Toggle",$.displayName="Toggle";var w=(0,d.zo)("div",(function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}}));w.displayName="ToggleTrack",w.displayName="ToggleTrack";var F=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),x=(Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),o(75643));function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},C.apply(this,arguments)}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},P(e,t)}function S(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=M(e);if(t){var i=M(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return L(this,o)}}function L(e,t){if(t&&("object"===R(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return j(e)}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M(e){return M=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},M(e)}function E(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var B=function(e){return e.stopPropagation()},V=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&&P(e,t)}(n,e);var t,o,r,i=S(n);function n(){var e;O(this,n);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return E(j(e=i.call.apply(i,[this].concat(o))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),E(j(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),E(j(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),E(j(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),E(j(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),E(j(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,x.E)(t)&&e.setState({isFocusVisible:!0})})),E(j(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=n,(o=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,o=e.inputRef;t&&o.current&&o.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,o=void 0===t?{}:t,r=e.onChange,i=e.labelPlacement,n=void 0===i?this.props.checkmarkType===F.toggle?"left":"right":i,a=e.inputRef,c=e.isIndeterminate,s=e.error,d=e.disabled,p=e.value,h=e.name,f=e.type,m=e.checked,b=e.children,x=e.required,R=e.title,O=o.Root,T=o.Checkmark,P=o.Label,S=o.Input,L=o.Toggle,j=o.ToggleTrack,M=(0,u.XG)(O)||g,E=(0,u.XG)(T)||v,V=(0,u.XG)(P)||y,z=(0,u.XG)(S)||k,H=(0,u.XG)(L)||$,D=(0,u.XG)(j)||w,I={onChange:r,onFocus:this.onFocus,onBlur:this.onBlur},A={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},W={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:s,$checked:m,$isIndeterminate:c,$required:x,$disabled:d,$value:p},U=b&&l.createElement(V,C({$labelPlacement:n},W,(0,u.ch)(P)),this.props.containsInteractiveElement?l.createElement("div",{onClick:function(e){return e.preventDefault()}},b):b);return l.createElement(M,C({"data-baseweb":"checkbox",title:R||null,$labelPlacement:n},W,A,(0,u.ch)(O)),("top"===n||"left"===n)&&U,this.props.checkmarkType===F.toggle?l.createElement(D,C({},W,(0,u.ch)(j)),l.createElement(H,C({},W,(0,u.ch)(L)))):l.createElement(E,C({},W,(0,u.ch)(T))),l.createElement(z,C({value:p,name:h,checked:m,required:x,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":c?"mixed":m,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":s||null,"aria-required":x||null,disabled:d,type:f,ref:a,onClick:B},W,I,(0,u.ch)(S))),("bottom"===n||"right"===n)&&U)}}])&&T(t.prototype,o),r&&T(t,r),Object.defineProperty(t,"prototype",{writable:!1}),n}(l.Component);E(V,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:l.createRef(),error:!1,type:"checkbox",checkmarkType:F.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});var z=V,H=o(2120),D=o(46332),I=o(73290),A=o(10612),W=o(65167),U=o(50412),N=(0,o(47167).Z)("div",{target:"ek41t0m0"})((function(e){var t=e.visibility;return{display:t===s.Ws.Collapsed?"none":"flex",visibility:t===s.Ws.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}}),""),_=o(46417),Z=function(e){(0,n.Z)(o,e);var t=(0,a.Z)(o);function o(){var e;(0,r.Z)(this,o);for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return(e=t.call.apply(t,[this].concat(n))).formClearHelper=new D.Kz,e.state={value:e.initialValue},e.commitWidgetValue=function(t){e.props.widgetMgr.setBoolValue(e.props.element,e.state.value,t)},e.onFormCleared=function(){e.setState((function(e,t){return{value:t.element.default}}),(function(){return e.commitWidgetValue({fromUi:!0})}))},e.onChange=function(t){var o=t.target.checked;e.setState({value:o},(function(){return e.commitWidgetValue({fromUi:!0})}))},e}return(0,i.Z)(o,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getBoolValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"render",value:function(){var e,t=this.props,o=t.theme,r=t.width,i=t.element,n=t.disabled,a=t.widgetMgr,l=o.colors,c=o.spacing,u={width:r},d=n?l.fadedText40:l.bodyText;return this.formClearHelper.manageFormClearListener(a,i.formId,this.onFormCleared),(0,_.jsx)("div",{className:"row-widget stCheckbox",style:u,children:(0,_.jsx)(z,{checked:this.state.value,disabled:n,onChange:this.onChange,"aria-label":i.label,overrides:{Root:{style:function(e){var t=e.$isFocusVisible;return{marginBottom:0,marginTop:0,paddingRight:c.twoThirdsSmFont,backgroundColor:t?l.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Checkmark:{style:function(e){var t=e.$isFocusVisible,o=e.$checked,r=o&&!n?l.primary:l.fadedText40;return{outline:0,width:"1rem",height:"1rem",marginTop:"0.30rem",boxShadow:t&&o?"0 0 0 0.2rem ".concat((0,H.DZ)(l.primary,.5)):"",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftColor:r,borderRightColor:r,borderTopColor:r,borderBottomColor:r}}},Label:{style:{color:d}}},children:(0,_.jsxs)(N,{visibility:(0,s.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:[(0,_.jsx)(U.Z,{source:i.label,allowHTML:!1,isLabel:!0,isCheckbox:!0}),i.help&&(0,_.jsx)(W.Hp,{color:d,children:(0,_.jsx)(I.ZP,{content:i.help,placement:A.ug.TOP_RIGHT})})]})})})}}]),o}(l.PureComponent),G=(0,c.b)(Z)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[279],{83279:function(e,t,r){r.r(t),r.d(t,{default:function(){return fe}});var o=r(15671),n=r(43144),i=r(60136),a=r(29388),s=r(47313),l=r(93433),u=r(83985),c=r(74969),p=r(15160);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){return e.$isActive?2:e.$isHovered?1:0}function m(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(b(e)){case 0:return t.tickFillErrorSelected;case 1:return t.tickFillErrorSelectedHover;case 2:return t.tickFillErrorSelectedHoverActive}else switch(b(e)){case 0:return t.tickFillSelected;case 1:return t.tickFillSelectedHover;case 2:return t.tickFillSelectedHoverActive}return null}function v(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(b(e)){case 0:return t.tickFillError;case 1:return t.tickFillErrorHover;case 2:return t.tickFillErrorHoverActive}else switch(b(e)){case 0:return t.tickFill;case 1:return t.tickFillHover;case 2:return t.tickFillActive}}function y(e){var t=e.$disabled,r=e.$theme.colors;return t?r.contentSecondary:r.contentPrimary}var g=(0,p.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"}}));g.displayName="RadioGroupRoot",g.displayName="RadioGroupRoot";var w=(0,p.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,u="rtl"===i.direction?"Left":"Right";return h(t={flexDirection:"top"===n||"bottom"===n?"column":"row",display:"flex",alignItems:"center",cursor:r?"not-allowed":"pointer",marginTop:s.scale200},"margin".concat(u),l?s.scale200:null),h(t,"marginBottom",o&&!l?null:s.scale200),t}));w.displayName="Root",w.displayName="Root";var k=(0,p.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{backgroundColor:v(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}}));k.displayName="RadioMarkInner",k.displayName="RadioMarkInner";var O=(0,p.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{alignItems:"center",backgroundColor:m(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}}));O.displayName="RadioMarkOuter",O.displayName="RadioMarkOuter";var R=(0,p.zo)("div",(function(e){var t=e.$theme.typography;return f(f({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 h({},"padding".concat(t),i)}(e)),{},{color:y(e)},t.LabelMedium)}));R.displayName="Label",R.displayName="Label";var j=(0,p.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"});j.displayName="Input",j.displayName="Input";var F=(0,p.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 f(f({},r.typography.ParagraphSmall),{},(h(t={color:r.colors.contentSecondary,cursor:"auto"},"margin".concat(i),"horizontal"===o?null:r.sizing.scale900),h(t,"margin".concat(a),n?r.sizing.scale200:null),h(t,"maxWidth","240px"),t))}));F.displayName="Description",F.displayName="Description";var P=r(75643);function $(e){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(e)}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},S.apply(this,arguments)}function M(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(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(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(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 x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(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 I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}function L(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=D(e);if(t){var n=D(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return A(this,r)}}function A(e,t){if(t&&("object"===$(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return B(e)}function B(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},D(e)}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var V=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&&I(e,t)}(i,e);var t,r,o,n=L(i);function i(){var e;x(this,i);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return T(B(e=n.call.apply(n,[this].concat(r))),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),T(B(e),"handleFocus",(function(t,r){(0,P.E)(t)&&e.setState({isFocusVisible:!0}),e.setState({focusedRadioIndex:r}),e.props.onFocus&&e.props.onFocus(t)})),T(B(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=i,(r=[{key:"render",value:function(){var e=this,t=this.props.overrides,r=void 0===t?{}:t,o=M((0,c.jb)(r.RadioGroupRoot,g),2),n=o[0],i=o[1];return s.createElement(n,S({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},i),s.Children.map(this.props.children,(function(t,r){if(!s.isValidElement(t))return null;var o=e.props.value===t.props.value;return s.cloneElement(t,{align:e.props.align,autoFocus:e.props.autoFocus,checked:o,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||o?"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})})))}}])&&C(t.prototype,r),o&&C(t,o),Object.defineProperty(t,"prototype",{writable:!1}),i}(s.Component);T(V,"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:{}});var z=V,_="vertical",H="horizontal";function N(e){return N="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},N(e)}function U(){return U=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},U.apply(this,arguments)}function Z(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 W(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 W(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 W(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 q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function K(e,t){return K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},K(e,t)}function J(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=Y(e);if(t){var n=Y(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Q(this,r)}}function Q(e,t){if(t&&("object"===N(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return X(e)}function X(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}function ee(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var te=function(e){return e.stopPropagation()},re=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&&K(e,t)}(i,e);var t,r,o,n=J(i);function i(){var e;q(this,i);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return ee(X(e=n.call.apply(n,[this].concat(r))),"state",{isActive:!1,isHovered:!1}),ee(X(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter&&e.props.onMouseEnter(t)})),ee(X(e),"onMouseLeave",(function(t){e.setState({isHovered:!1}),e.props.onMouseLeave&&e.props.onMouseLeave(t)})),ee(X(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown&&e.props.onMouseDown(t)})),ee(X(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp&&e.props.onMouseUp(t)})),e}return t=i,(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,o=Z((0,c.jb)(r.Root,w),2),n=o[0],i=o[1],a=Z((0,c.jb)(r.Label,R),2),l=a[0],u=a[1],p=Z((0,c.jb)(r.Input,j),2),d=p[0],f=p[1],h=Z((0,c.jb)(r.Description,F),2),b=h[0],m=h[1],v=Z((0,c.jb)(r.RadioMarkInner,k),2),y=v[0],g=v[1],P=Z((0,c.jb)(r.RadioMarkOuter,O),2),$=P[0],S=P[1],M={$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},E=s.createElement(l,U({},M,u),this.props.containsInteractiveElement?s.createElement("div",{onClick:function(e){return e.preventDefault()}},this.props.children):this.props.children);return s.createElement(s.Fragment,null,s.createElement(n,U({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},M,i),("top"===(e=this.props.labelPlacement)||"left"===e)&&E,s.createElement($,U({},M,S),s.createElement(y,U({},M,g))),s.createElement(d,U({"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:te,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},M,f)),function(e){return"bottom"===e||"right"===e}(this.props.labelPlacement)&&E),!!this.props.description&&s.createElement(b,U({},M,m),this.props.description))}}])&&G(t.prototype,r),o&&G(t,o),Object.defineProperty(t,"prototype",{writable:!1}),i}(s.Component);ee(re,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:s.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});var oe=re,ne=r(65167),ie=r(73290),ae=r(80213),se=r(46417),le=function(e){(0,i.Z)(r,e);var t=(0,a.Z)(r);function r(){var e;(0,o.Z)(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(e=t.call.apply(t,[this].concat(i))).state={value:e.props.value},e.onChange=function(t){var r=parseInt(t.target.value,10);e.setState({value:r},(function(){return e.props.onChange(r)}))},e}return(0,n.Z)(r,[{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.props.value!==this.state.value&&this.setState((function(e,t){return{value:t.value}}))}},{key:"render",value:function(){var e=this.props,t=e.theme,r=e.width,o=e.help,n=e.label,i=e.horizontal,a=e.labelVisibility,s=this.props.disabled,u=t.colors,c=t.radii,p={width:r},d=(0,l.Z)(this.props.options);return 0===d.length&&(d.push("No options to select."),s=!0),(0,se.jsxs)("div",{className:"row-widget stRadio",style:p,children:[(0,se.jsx)(ne.ON,{label:n,disabled:s,labelVisibility:a,children:o&&(0,se.jsx)(ne.Hp,{children:(0,se.jsx)(ie.ZP,{content:o,placement:ae.ug.TOP_RIGHT})})}),(0,se.jsx)(z,{onChange:this.onChange,value:this.state.value.toString(),disabled:s,align:i?H:_,"aria-label":n,children:d.map((function(e,t){return(0,se.jsx)(oe,{value:t.toString(),overrides:{Root:{style:function(e){return{marginBottom:0,marginTop:0,marginRight:"1rem",paddingLeft:0,alignItems:"start",paddingRight:"2px",backgroundColor:e.$isFocusVisible?u.darkenedBgMix25:"",borderTopLeftRadius:c.md,borderTopRightRadius:c.md,borderBottomLeftRadius:c.md,borderBottomRightRadius:c.md}}},RadioMarkOuter:{style:function(e){return{width:"1rem",height:"1rem",marginTop:"0.35rem",marginRight:"0",backgroundColor:e.$checked&&!s?u.primary:u.fadedText40}}},RadioMarkInner:{style:function(e){var t=e.$checked;return{height:t?"6px":".75rem",width:t?"6px":".75rem"}}},Label:{style:{color:s?u.fadedText40:u.bodyText,position:"relative",top:"1px"}}},children:e},t)}))})]})}}]),r}(s.PureComponent),ue=(0,u.b)(le),ce=r(46332),pe=r(64243),de=function(e){(0,i.Z)(r,e);var t=(0,a.Z)(r);function r(){var e;(0,o.Z)(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(e=t.call.apply(t,[this].concat(i))).formClearHelper=new ce.Kz,e.state={value:e.initialValue},e.commitWidgetValue=function(t){e.props.widgetMgr.setIntValue(e.props.element,e.state.value,t)},e.onFormCleared=function(){e.setState((function(e,t){return{value:t.element.default}}),(function(){return e.commitWidgetValue({fromUi:!0})}))},e.onChange=function(t){e.setState({value:t},(function(){return e.commitWidgetValue({fromUi:!0})}))},e}return(0,n.Z)(r,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getIntValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"render",value:function(){var e=this.props,t=e.disabled,r=e.element,o=e.width,n=e.widgetMgr,i=r.horizontal,a=r.options,s=r.label,l=r.labelVisibility,u=r.help;return this.formClearHelper.manageFormClearListener(n,r.formId,this.onFormCleared),(0,se.jsx)(ue,{label:s,onChange:this.onChange,options:a,width:o,disabled:t,horizontal:i,labelVisibility:(0,pe.iF)(null===l||void 0===l?void 0:l.value),value:this.state.value,help:u})}}]),r}(s.PureComponent),fe=de}}]);
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[279],{83279:function(e,t,r){r.r(t),r.d(t,{default:function(){return fe}});var o=r(15671),n=r(43144),i=r(60136),a=r(29388),s=r(47313),l=r(93433),u=r(83985),c=r(74969),p=r(15160);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){return e.$isActive?2:e.$isHovered?1:0}function m(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(b(e)){case 0:return t.tickFillErrorSelected;case 1:return t.tickFillErrorSelectedHover;case 2:return t.tickFillErrorSelectedHoverActive}else switch(b(e)){case 0:return t.tickFillSelected;case 1:return t.tickFillSelectedHover;case 2:return t.tickFillSelectedHoverActive}return null}function v(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(b(e)){case 0:return t.tickFillError;case 1:return t.tickFillErrorHover;case 2:return t.tickFillErrorHoverActive}else switch(b(e)){case 0:return t.tickFill;case 1:return t.tickFillHover;case 2:return t.tickFillActive}}function y(e){var t=e.$disabled,r=e.$theme.colors;return t?r.contentSecondary:r.contentPrimary}var g=(0,p.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"}}));g.displayName="RadioGroupRoot",g.displayName="RadioGroupRoot";var w=(0,p.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,u="rtl"===i.direction?"Left":"Right";return h(t={flexDirection:"top"===n||"bottom"===n?"column":"row",display:"flex",alignItems:"center",cursor:r?"not-allowed":"pointer",marginTop:s.scale200},"margin".concat(u),l?s.scale200:null),h(t,"marginBottom",o&&!l?null:s.scale200),t}));w.displayName="Root",w.displayName="Root";var k=(0,p.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{backgroundColor:v(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}}));k.displayName="RadioMarkInner",k.displayName="RadioMarkInner";var O=(0,p.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{alignItems:"center",backgroundColor:m(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}}));O.displayName="RadioMarkOuter",O.displayName="RadioMarkOuter";var R=(0,p.zo)("div",(function(e){var t=e.$theme.typography;return f(f({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 h({},"padding".concat(t),i)}(e)),{},{color:y(e)},t.LabelMedium)}));R.displayName="Label",R.displayName="Label";var j=(0,p.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"});j.displayName="Input",j.displayName="Input";var F=(0,p.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 f(f({},r.typography.ParagraphSmall),{},(h(t={color:r.colors.contentSecondary,cursor:"auto"},"margin".concat(i),"horizontal"===o?null:r.sizing.scale900),h(t,"margin".concat(a),n?r.sizing.scale200:null),h(t,"maxWidth","240px"),t))}));F.displayName="Description",F.displayName="Description";var P=r(75643);function $(e){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(e)}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},S.apply(this,arguments)}function M(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(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(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(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 x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(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 I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}function L(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=D(e);if(t){var n=D(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return A(this,r)}}function A(e,t){if(t&&("object"===$(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return B(e)}function B(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},D(e)}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var V=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&&I(e,t)}(i,e);var t,r,o,n=L(i);function i(){var e;x(this,i);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return T(B(e=n.call.apply(n,[this].concat(r))),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),T(B(e),"handleFocus",(function(t,r){(0,P.E)(t)&&e.setState({isFocusVisible:!0}),e.setState({focusedRadioIndex:r}),e.props.onFocus&&e.props.onFocus(t)})),T(B(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=i,(r=[{key:"render",value:function(){var e=this,t=this.props.overrides,r=void 0===t?{}:t,o=M((0,c.jb)(r.RadioGroupRoot,g),2),n=o[0],i=o[1];return s.createElement(n,S({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},i),s.Children.map(this.props.children,(function(t,r){if(!s.isValidElement(t))return null;var o=e.props.value===t.props.value;return s.cloneElement(t,{align:e.props.align,autoFocus:e.props.autoFocus,checked:o,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||o?"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})})))}}])&&C(t.prototype,r),o&&C(t,o),Object.defineProperty(t,"prototype",{writable:!1}),i}(s.Component);T(V,"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:{}});var z=V,_="vertical",H="horizontal";function N(e){return N="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},N(e)}function U(){return U=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},U.apply(this,arguments)}function Z(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 W(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 W(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 W(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 q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function K(e,t){return K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},K(e,t)}function J(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=Y(e);if(t){var n=Y(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Q(this,r)}}function Q(e,t){if(t&&("object"===N(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return X(e)}function X(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}function ee(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var te=function(e){return e.stopPropagation()},re=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&&K(e,t)}(i,e);var t,r,o,n=J(i);function i(){var e;q(this,i);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return ee(X(e=n.call.apply(n,[this].concat(r))),"state",{isActive:!1,isHovered:!1}),ee(X(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter&&e.props.onMouseEnter(t)})),ee(X(e),"onMouseLeave",(function(t){e.setState({isHovered:!1}),e.props.onMouseLeave&&e.props.onMouseLeave(t)})),ee(X(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown&&e.props.onMouseDown(t)})),ee(X(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp&&e.props.onMouseUp(t)})),e}return t=i,(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,o=Z((0,c.jb)(r.Root,w),2),n=o[0],i=o[1],a=Z((0,c.jb)(r.Label,R),2),l=a[0],u=a[1],p=Z((0,c.jb)(r.Input,j),2),d=p[0],f=p[1],h=Z((0,c.jb)(r.Description,F),2),b=h[0],m=h[1],v=Z((0,c.jb)(r.RadioMarkInner,k),2),y=v[0],g=v[1],P=Z((0,c.jb)(r.RadioMarkOuter,O),2),$=P[0],S=P[1],M={$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},E=s.createElement(l,U({},M,u),this.props.containsInteractiveElement?s.createElement("div",{onClick:function(e){return e.preventDefault()}},this.props.children):this.props.children);return s.createElement(s.Fragment,null,s.createElement(n,U({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},M,i),("top"===(e=this.props.labelPlacement)||"left"===e)&&E,s.createElement($,U({},M,S),s.createElement(y,U({},M,g))),s.createElement(d,U({"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:te,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},M,f)),function(e){return"bottom"===e||"right"===e}(this.props.labelPlacement)&&E),!!this.props.description&&s.createElement(b,U({},M,m),this.props.description))}}])&&G(t.prototype,r),o&&G(t,o),Object.defineProperty(t,"prototype",{writable:!1}),i}(s.Component);ee(re,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:s.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});var oe=re,ne=r(65167),ie=r(73290),ae=r(10612),se=r(46417),le=function(e){(0,i.Z)(r,e);var t=(0,a.Z)(r);function r(){var e;(0,o.Z)(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(e=t.call.apply(t,[this].concat(i))).state={value:e.props.value},e.onChange=function(t){var r=parseInt(t.target.value,10);e.setState({value:r},(function(){return e.props.onChange(r)}))},e}return(0,n.Z)(r,[{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.props.value!==this.state.value&&this.setState((function(e,t){return{value:t.value}}))}},{key:"render",value:function(){var e=this.props,t=e.theme,r=e.width,o=e.help,n=e.label,i=e.horizontal,a=e.labelVisibility,s=this.props.disabled,u=t.colors,c=t.radii,p={width:r},d=(0,l.Z)(this.props.options);return 0===d.length&&(d.push("No options to select."),s=!0),(0,se.jsxs)("div",{className:"row-widget stRadio",style:p,children:[(0,se.jsx)(ne.ON,{label:n,disabled:s,labelVisibility:a,children:o&&(0,se.jsx)(ne.Hp,{children:(0,se.jsx)(ie.ZP,{content:o,placement:ae.ug.TOP_RIGHT})})}),(0,se.jsx)(z,{onChange:this.onChange,value:this.state.value.toString(),disabled:s,align:i?H:_,"aria-label":n,children:d.map((function(e,t){return(0,se.jsx)(oe,{value:t.toString(),overrides:{Root:{style:function(e){return{marginBottom:0,marginTop:0,marginRight:"1rem",paddingLeft:0,alignItems:"start",paddingRight:"2px",backgroundColor:e.$isFocusVisible?u.darkenedBgMix25:"",borderTopLeftRadius:c.md,borderTopRightRadius:c.md,borderBottomLeftRadius:c.md,borderBottomRightRadius:c.md}}},RadioMarkOuter:{style:function(e){return{width:"1rem",height:"1rem",marginTop:"0.35rem",marginRight:"0",backgroundColor:e.$checked&&!s?u.primary:u.fadedText40}}},RadioMarkInner:{style:function(e){var t=e.$checked;return{height:t?"6px":".75rem",width:t?"6px":".75rem"}}},Label:{style:{color:s?u.fadedText40:u.bodyText,position:"relative",top:"1px"}}},children:e},t)}))})]})}}]),r}(s.PureComponent),ue=(0,u.b)(le),ce=r(46332),pe=r(64243),de=function(e){(0,i.Z)(r,e);var t=(0,a.Z)(r);function r(){var e;(0,o.Z)(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(e=t.call.apply(t,[this].concat(i))).formClearHelper=new ce.Kz,e.state={value:e.initialValue},e.commitWidgetValue=function(t){e.props.widgetMgr.setIntValue(e.props.element,e.state.value,t)},e.onFormCleared=function(){e.setState((function(e,t){return{value:t.element.default}}),(function(){return e.commitWidgetValue({fromUi:!0})}))},e.onChange=function(t){e.setState({value:t},(function(){return e.commitWidgetValue({fromUi:!0})}))},e}return(0,n.Z)(r,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getIntValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"render",value:function(){var e=this.props,t=e.disabled,r=e.element,o=e.width,n=e.widgetMgr,i=r.horizontal,a=r.options,s=r.label,l=r.labelVisibility,u=r.help;return this.formClearHelper.manageFormClearListener(n,r.formId,this.onFormCleared),(0,se.jsx)(ue,{label:s,onChange:this.onChange,options:a,width:o,disabled:t,horizontal:i,labelVisibility:(0,pe.iF)(null===l||void 0===l?void 0:l.value),value:this.state.value,help:u})}}]),r}(s.PureComponent),fe=de}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[289],{75006:function(e,t,r){r.d(t,{Z:function(){return f}});r(47313);var n,o=r(64243),i=r(65167),a=r(1413),u=r(30168),l=r(47167),s=(0,r(30686).F4)(n||(n=(0,u.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),c=(0,l.Z)("span",{target:"e1m4n6jn0"})((function(e){var t=e.includeDot,r=e.shouldBlink,n=e.theme;return(0,a.Z)((0,a.Z)({},t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{}),r?{color:n.colors.red,animationName:"".concat(s),animationDuration:"0.5s",animationIterationCount:5}:{})}),""),p=r(46417),f=function(e){var t=e.dirty,r=e.value,n=e.maxLength,a=e.className,u=e.type,l=[],s=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l.push((0,p.jsx)(c,{includeDot:l.length>0,shouldBlink:t,children:e},l.length))};return t&&("multiline"===(void 0===u?"single":u)?(0,o.Ge)()?s("Press \u2318+Enter to apply"):s("Press Ctrl+Enter to apply"):s("Press Enter to apply")),n&&s("".concat(r.length,"/").concat(n),t&&r.length>=n),(0,p.jsx)(i.X7,{className:a,children:l})}},69289:function(e,t,r){r.r(t),r.d(t,{default:function(){return _}});var n=r(15671),o=r(43144),i=r(60136),a=r(29388),u=r(47313),l=r(46332),s=r(74969),c=r(53998),p=r(37613),f=r(15160),d=r(12903);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=(0,f.zo)("div",(function(e){return m(m({},(0,d.d5)(m(m({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));b.displayName="StyledTextAreaRoot",b.displayName="StyledTextAreaRoot";var v=(0,f.zo)("div",(function(e){return(0,d.hB)(m({$positive:!1},e))}));v.displayName="StyledTextareaContainer",v.displayName="StyledTextareaContainer";var g=(0,f.zo)("textarea",(function(e){return m(m({},(0,d.Hx)(e)),{},{resize:e.$resize||"none"})}));function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w.apply(this,arguments)}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,u=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){u=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return P(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 P(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 P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function F(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=V(e);if(t){var o=V(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return k(this,r)}}function k(e,t){if(t&&("object"===O(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},V(e)}function B(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}g.displayName="StyledTextarea",g.displayName="StyledTextarea";var D=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)}(i,e);var t,r,n,o=F(i);function i(){var e;x(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return B(T(e=o.call.apply(o,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),B(T(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),B(T(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=i,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=j((0,s.jb)(t.Root,b),2),n=r[0],o=r[1],i=(0,s.aO)({Input:{component:g},InputContainer:{component:v}},t);return u.createElement(n,w({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},o),u.createElement(c.Z,w({},this.props,{type:p.iB.textarea,overrides:i,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&S(t.prototype,r),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(u.Component);B(D,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:p.NO.default});var E=D,$=r(75006),z=r(65167),Z=r(73290),A=r(80213),N=r(64243);var R=(0,r(47167).Z)("div",{target:"e1y61itm0"})({name:"1om1ktf",styles:"div{border-width:1px;}"}),U=r(46417),K=function(e){(0,i.Z)(r,e);var t=(0,a.Z)(r);function r(){var e;(0,n.Z)(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return(e=t.call.apply(t,[this].concat(i))).formClearHelper=new l.Kz,e.state={dirty:!1,value:e.initialValue},e.commitWidgetValue=function(t){e.props.widgetMgr.setStringValue(e.props.element,e.state.value,t),e.setState({dirty:!1})},e.onFormCleared=function(){e.setState((function(e,t){return{value:t.element.default}}),(function(){return e.commitWidgetValue({fromUi:!0})}))},e.onBlur=function(){e.state.dirty&&e.commitWidgetValue({fromUi:!0})},e.onChange=function(t){var r=t.target.value,n=e.props.element.maxChars;0!==n&&r.length>n||((0,N.$b)(e.props.element)?e.setState({dirty:!1,value:r},(function(){return e.commitWidgetValue({fromUi:!0})})):e.setState({dirty:!0,value:r}))},e.isEnterKeyPressed=function(e){var t=e.keyCode;return"Enter"===e.key||13===t||10===t},e.onKeyDown=function(t){var r=t.metaKey,n=t.ctrlKey,o=e.state.dirty;e.isEnterKeyPressed(t)&&(n||r)&&o&&(t.preventDefault(),e.commitWidgetValue({fromUi:!0}))},e}return(0,o.Z)(r,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getStringValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"render",value:function(){var e,t=this.props,r=t.element,n=t.disabled,o=t.width,i=t.widgetMgr,a=this.state,u=a.value,l=a.dirty,s={width:o},c=r.height,p=r.placeholder;return this.formClearHelper.manageFormClearListener(i,r.formId,this.onFormCleared),(0,U.jsxs)("div",{className:"stTextArea",style:s,children:[(0,U.jsx)(z.ON,{label:r.label,disabled:n,labelVisibility:(0,N.iF)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),children:r.help&&(0,U.jsx)(z.dT,{children:(0,U.jsx)(Z.ZP,{content:r.help,placement:A.ug.TOP_RIGHT})})}),(0,U.jsx)(R,{children:(0,U.jsx)(E,{"data-testid":"stTextArea",value:u,placeholder:p,onBlur:this.onBlur,onChange:this.onChange,onKeyDown:this.onKeyDown,"aria-label":r.label,disabled:n,overrides:{Input:{style:{lineHeight:"1.4",height:c?"".concat(c,"px"):"",minHeight:"95px",resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:"1rem",paddingLeft:"1rem",paddingBottom:"1rem",paddingTop:"1rem"}}}})}),(0,U.jsx)($.Z,{dirty:l,value:u,maxLength:r.maxChars,type:"multiline"})]})}}]),r}(u.PureComponent),_=K}}]);
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[289],{75006:function(e,t,r){r.d(t,{Z:function(){return f}});r(47313);var n,o=r(64243),i=r(65167),a=r(1413),u=r(30168),l=r(47167),s=(0,r(30686).F4)(n||(n=(0,u.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),c=(0,l.Z)("span",{target:"e1m4n6jn0"})((function(e){var t=e.includeDot,r=e.shouldBlink,n=e.theme;return(0,a.Z)((0,a.Z)({},t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{}),r?{color:n.colors.red,animationName:"".concat(s),animationDuration:"0.5s",animationIterationCount:5}:{})}),""),p=r(46417),f=function(e){var t=e.dirty,r=e.value,n=e.maxLength,a=e.className,u=e.type,l=[],s=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l.push((0,p.jsx)(c,{includeDot:l.length>0,shouldBlink:t,children:e},l.length))};return t&&("multiline"===(void 0===u?"single":u)?(0,o.Ge)()?s("Press \u2318+Enter to apply"):s("Press Ctrl+Enter to apply"):s("Press Enter to apply")),n&&s("".concat(r.length,"/").concat(n),t&&r.length>=n),(0,p.jsx)(i.X7,{className:a,children:l})}},69289:function(e,t,r){r.r(t),r.d(t,{default:function(){return _}});var n=r(15671),o=r(43144),i=r(60136),a=r(29388),u=r(47313),l=r(46332),s=r(74969),c=r(53998),p=r(37613),f=r(15160),d=r(12903);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=(0,f.zo)("div",(function(e){return m(m({},(0,d.d5)(m(m({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));b.displayName="StyledTextAreaRoot",b.displayName="StyledTextAreaRoot";var v=(0,f.zo)("div",(function(e){return(0,d.hB)(m({$positive:!1},e))}));v.displayName="StyledTextareaContainer",v.displayName="StyledTextareaContainer";var g=(0,f.zo)("textarea",(function(e){return m(m({},(0,d.Hx)(e)),{},{resize:e.$resize||"none"})}));function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w.apply(this,arguments)}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,u=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){u=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return P(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 P(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 P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function F(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=V(e);if(t){var o=V(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return k(this,r)}}function k(e,t){if(t&&("object"===O(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},V(e)}function B(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}g.displayName="StyledTextarea",g.displayName="StyledTextarea";var D=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)}(i,e);var t,r,n,o=F(i);function i(){var e;x(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return B(T(e=o.call.apply(o,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),B(T(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),B(T(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=i,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=j((0,s.jb)(t.Root,b),2),n=r[0],o=r[1],i=(0,s.aO)({Input:{component:g},InputContainer:{component:v}},t);return u.createElement(n,w({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},o),u.createElement(c.Z,w({},this.props,{type:p.iB.textarea,overrides:i,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&S(t.prototype,r),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(u.Component);B(D,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:p.NO.default});var E=D,$=r(75006),z=r(65167),Z=r(73290),A=r(10612),N=r(64243);var R=(0,r(47167).Z)("div",{target:"e1y61itm0"})({name:"1om1ktf",styles:"div{border-width:1px;}"}),U=r(46417),K=function(e){(0,i.Z)(r,e);var t=(0,a.Z)(r);function r(){var e;(0,n.Z)(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return(e=t.call.apply(t,[this].concat(i))).formClearHelper=new l.Kz,e.state={dirty:!1,value:e.initialValue},e.commitWidgetValue=function(t){e.props.widgetMgr.setStringValue(e.props.element,e.state.value,t),e.setState({dirty:!1})},e.onFormCleared=function(){e.setState((function(e,t){return{value:t.element.default}}),(function(){return e.commitWidgetValue({fromUi:!0})}))},e.onBlur=function(){e.state.dirty&&e.commitWidgetValue({fromUi:!0})},e.onChange=function(t){var r=t.target.value,n=e.props.element.maxChars;0!==n&&r.length>n||((0,N.$b)(e.props.element)?e.setState({dirty:!1,value:r},(function(){return e.commitWidgetValue({fromUi:!0})})):e.setState({dirty:!0,value:r}))},e.isEnterKeyPressed=function(e){var t=e.keyCode;return"Enter"===e.key||13===t||10===t},e.onKeyDown=function(t){var r=t.metaKey,n=t.ctrlKey,o=e.state.dirty;e.isEnterKeyPressed(t)&&(n||r)&&o&&(t.preventDefault(),e.commitWidgetValue({fromUi:!0}))},e}return(0,o.Z)(r,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getStringValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}},{key:"render",value:function(){var e,t=this.props,r=t.element,n=t.disabled,o=t.width,i=t.widgetMgr,a=this.state,u=a.value,l=a.dirty,s={width:o},c=r.height,p=r.placeholder;return this.formClearHelper.manageFormClearListener(i,r.formId,this.onFormCleared),(0,U.jsxs)("div",{className:"stTextArea",style:s,children:[(0,U.jsx)(z.ON,{label:r.label,disabled:n,labelVisibility:(0,N.iF)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),children:r.help&&(0,U.jsx)(z.dT,{children:(0,U.jsx)(Z.ZP,{content:r.help,placement:A.ug.TOP_RIGHT})})}),(0,U.jsx)(R,{children:(0,U.jsx)(E,{"data-testid":"stTextArea",value:u,placeholder:p,onBlur:this.onBlur,onChange:this.onChange,onKeyDown:this.onKeyDown,"aria-label":r.label,disabled:n,overrides:{Input:{style:{lineHeight:"1.4",height:c?"".concat(c,"px"):"",minHeight:"95px",resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:"1rem",paddingLeft:"1rem",paddingBottom:"1rem",paddingTop:"1rem"}}}})}),(0,U.jsx)($.Z,{dirty:l,value:u,maxLength:r.maxChars,type:"multiline"})]})}}]),r}(u.PureComponent),_=K}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[467],{82467:function(e,r,n){n.r(r),n.d(r,{default:function(){return h}});var t=n(47313),o=n(83985),s=n(16168),i=n(50412),a=n(54922),l=n(47167),c=n(17208),u=n(81097),m=(0,l.Z)(c.Q,{shouldForwardProp:u.Z,target:"e17lx80j1"})((function(e){var r=e.theme,n=e.$usingCustomTheme;return{marginTop:r.spacing.none,marginBottom:r.spacing.none,marginRight:r.spacing.none,marginLeft:r.spacing.none,borderColor:r.colors.fadedText10,borderTopColor:n?r.colors.primary:r.colors.blue70,flexGrow:0,flexShrink:0}}),""),g=(0,l.Z)("div",{target:"e17lx80j0"})((function(e){return{display:"flex",gap:e.theme.spacing.lg,alignItems:"center",width:"100%"}}),""),d=n(46417);var h=function(e){var r=e.width,n=e.element,l=(0,o.u)(),c=t.useContext(a.I).activeTheme,u=!(0,s.MJ)(c),h={width:r};return(0,d.jsx)("div",{className:"stSpinner",style:h,children:(0,d.jsxs)(g,{children:[(0,d.jsx)(m,{$size:l.iconSizes.twoXL,$usingCustomTheme:u}),(0,d.jsx)(i.Z,{source:n.text,allowHTML:!1})]})})}}}]);
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[467],{82467:function(e,r,n){n.r(r),n.d(r,{default:function(){return h}});var t=n(47313),o=n(83985),s=n(81512),i=n(50412),a=n(54922),l=n(47167),c=n(17208),u=n(81097),m=(0,l.Z)(c.Q,{shouldForwardProp:u.Z,target:"e17lx80j1"})((function(e){var r=e.theme,n=e.$usingCustomTheme;return{marginTop:r.spacing.none,marginBottom:r.spacing.none,marginRight:r.spacing.none,marginLeft:r.spacing.none,borderColor:r.colors.fadedText10,borderTopColor:n?r.colors.primary:r.colors.blue70,flexGrow:0,flexShrink:0}}),""),g=(0,l.Z)("div",{target:"e17lx80j0"})((function(e){return{display:"flex",gap:e.theme.spacing.lg,alignItems:"center",width:"100%"}}),""),d=n(46417);var h=function(e){var r=e.width,n=e.element,l=(0,o.u)(),c=t.useContext(a.I).activeTheme,u=!(0,s.MJ)(c),h={width:r};return(0,d.jsx)("div",{className:"stSpinner",style:h,children:(0,d.jsxs)(g,{children:[(0,d.jsx)(m,{$size:l.iconSizes.twoXL,$usingCustomTheme:u}),(0,d.jsx)(i.Z,{source:n.text,allowHTML:!1})]})})}}}]);
@@ -1 +1 @@
1
- (self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[491],{8798:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return H}});var i=n(4942),r=n(15671),a=n(43144),o=n(60136),s=n(29388),c=n(1413),h=n(47313),l=n(59603),u=n(1905),p=n.n(u),d=n(16117),m=n(83985),f=n(16168),w=n(24821),v=n(41043),g=n(49774),x=n(40519),b=n(31186),k=n(96721),Z=n(20024),S=n(21906),y=n(26419),j=n(74165),T=n(15861),V=n(317),C=n(53499),E=n(28664),M=n(31881),O=n.n(M),F=n(81003),L=function(t){(0,o.Z)(n,t);var e=(0,s.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,a.Z)(n)}((0,E.Z)(Error)),N=function(t){(0,o.Z)(n,t);var e=(0,s.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,a.Z)(n)}((0,E.Z)(Error)),P=function(){function t(){(0,r.Z)(this,t)}return(0,a.Z)(t,null,[{key:"get",value:function(){var e=(0,T.Z)((0,j.Z)().mark((function e(n){var i,r,a;return(0,j.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.current,r=i.commandLine,a=i.userMapboxToken,t.token&&t.commandLine===r.toLowerCase()){e.next=10;break}if(""===a){e.next=6;break}t.token=a,e.next=9;break;case 6:return e.next=8,this.fetchToken("https://data.streamlit.io/tokens.json","mapbox");case 8:t.token=e.sent;case 9:t.commandLine=r.toLowerCase();case 10:return e.abrupt("return",t.token);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"fetchToken",value:function(){var t=(0,T.Z)((0,j.Z)().mark((function t(e,n){var i,r,a;return(0,j.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,O().get(e);case 3:if(i=t.sent,null!=(r=i.data[n])&&""!==r){t.next=7;break}throw new Error('Missing token "'.concat(n,'"'));case 7:return t.abrupt("return",r);case 10:throw t.prev=10,t.t0=t.catch(0),a=(0,F.b)(t.t0),new N("".concat(a.message," (").concat(e,")"));case 14:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(e,n){return t.apply(this,arguments)}}()}]),t}();P.token=void 0,P.commandLine=void 0,P.isRunningLocal=function(){var t=window.location.hostname;return"localhost"===t||"127.0.0.1"===t};var I=n(67861),z=n.n(I),D=n(46135),q=n(46417),A=function(t){var e=t.error,n=t.width,i=t.deltaType;return e instanceof L?(0,q.jsx)(D.Z,{width:n,name:"No Mapbox token provided",message:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("p",{children:["To use ",(0,q.jsxs)("code",{children:["st.",i]})," or ",(0,q.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,q.jsxs)("p",{children:["To get a token, create an account at"," ",(0,q.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,q.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,q.jsx)("code",{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,q.jsxs)("p",{children:["See"," ",(0,q.jsx)("a",{href:"https://docs.streamlit.io/library/advanced-features/configuration#view-all-configuration-options",children:"our documentation"})," ","for more info on how to set config options."]})]})}):e instanceof N?(0,q.jsx)(D.Z,{width:n,name:"Error fetching Streamlit Mapbox token",message:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("p",{children:"This app requires an internet connection."}),(0,q.jsx)("p",{children:"Please check your connection and try again."}),(0,q.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,q.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,q.jsx)(D.Z,{width:n,name:"Error fetching Streamlit Mapbox token",message:e.message})},J=function(t){return function(e){var n=function(n){(0,o.Z)(h,n);var i=(0,s.Z)(h);function h(n){var a;return(0,r.Z)(this,h),(a=i.call(this,n)).initMapboxToken=(0,T.Z)((0,j.Z)().mark((function t(){var e,n;return(0,j.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,P.get(a.props.sessionInfo);case 3:e=t.sent,a.setState({mapboxToken:e,isFetching:!1}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(0),n=(0,F.b)(t.t0),a.setState({mapboxTokenError:n,isFetching:!1});case 11:case"end":return t.stop()}}),t,null,[[0,7]])}))),a.render=function(){var n=a.state,i=n.mapboxToken,r=n.mapboxTokenError,o=n.isFetching,s=a.props.width;return r?(0,q.jsx)(A,{width:s,error:r,deltaType:t}):o?(0,q.jsx)(V.Z,{body:"Loading...",kind:C.h.INFO,width:s}):(0,q.jsx)(e,(0,c.Z)((0,c.Z)({},a.props),{},{mapboxToken:i,width:s}))},a.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0},a.initMapboxToken(),a}return(0,a.Z)(h)}(h.PureComponent);return n.displayName="withMapboxToken(".concat(e.displayName||e.name,")"),z()(n,e)}},_=n(64243),B=n(47167),G=(0,B.Z)("div",{target:"e1q4dr931"})((function(t){var e=t.width,n=t.height;return{marginTop:t.theme.spacing.sm,position:"relative",height:n,width:e}}),""),R=(0,B.Z)("div",{target:"e1q4dr930"})((function(t){var e=t.theme;return{position:"absolute",right:"2.625rem",top:e.spacing.md,zIndex:1,"button:not(:disabled)":{background:e.colors.bgColor,"& + button":{borderTopColor:e.colors.secondaryBg},"& span":{filter:(0,f.Iy)(e)?"":"invert(100%)"}}}}),""),W=(n(81627),{classes:(0,c.Z)((0,c.Z)((0,c.Z)((0,c.Z)({},w),x),g),b)});(0,S.fh)([k.w,Z.E]);var X=new v.Z({configuration:W}),$=function(t){(0,o.Z)(n,t);var e=(0,s.Z)(n);function n(){var t;(0,r.Z)(this,n);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return(t=e.call.apply(e,[this].concat(a))).state={viewState:{bearing:0,pitch:0,zoom:11},initialized:!1,initialViewState:{}},t.componentDidMount=function(){t.setState({initialized:!0})},t.createTooltip=function(e){var n=t.props.element;if(!e||!e.object||!n.tooltip)return!1;var i=JSON.parse(n.tooltip);return i.html?i.html=t.interpolate(e,i.html):i.text=t.interpolate(e,i.text),i},t.interpolate=function(t,e){var n=e.match(/{(.*?)}/g);return n&&n.forEach((function(n){var i=n.substring(1,n.length-1);t.object.hasOwnProperty(i)&&(e=e.replace(n,t.object[i]))})),e},t.onViewStateChange=function(e){var n=e.viewState;t.setState({viewState:n})},t}return(0,a.Z)(n,[{key:"render",value:function(){var t=n.getDeckObject(this.props),e=this.state.viewState;return(0,q.jsx)(G,{className:"stDeckGlJsonChart",width:t.initialViewState.width,height:t.initialViewState.height,children:(0,q.jsxs)(l.Z,{viewState:e,onViewStateChange:this.onViewStateChange,height:t.initialViewState.height,width:t.initialViewState.width,layers:this.state.initialized?t.layers:[],getTooltip:this.createTooltip,ContextProvider:d.X$.Provider,controller:!0,children:[(0,q.jsx)(d.Z3,{height:t.initialViewState.height,width:t.initialViewState.width,mapStyle:t.mapStyle&&("string"===typeof t.mapStyle?t.mapStyle:t.mapStyle[0]),mapboxApiAccessToken:this.props.mapboxToken}),(0,q.jsx)(R,{children:(0,q.jsx)(d.Pv,{className:"zoomButton",showCompass:!1})})]})})}}],[{key:"getDerivedStateFromProps",value:function(t,e){var r=n.getDeckObject(t);if(!p()(r.initialViewState,e.initialViewState)){var a=Object.keys(r.initialViewState).reduce((function(t,n){return r.initialViewState[n]===e.initialViewState[n]?t:(0,c.Z)((0,c.Z)({},t),{},(0,i.Z)({},n,r.initialViewState[n]))}),{});return{viewState:(0,c.Z)((0,c.Z)({},e.viewState),a),initialViewState:r.initialViewState}}return null}}]),n}(h.PureComponent);$.getDeckObject=function(t){var e=t.element,n=t.width,i=t.height,r=t.theme,a=JSON.parse(e.json);if(!(0,_.bb)(a.mapStyle)){var o=(0,f.Iy)(r)?"light":"dark";a.mapStyle="mapbox://styles/mapbox/".concat(o,"-v9")}return i?(a.initialViewState.height=i,a.initialViewState.width=n):(a.initialViewState.height||(a.initialViewState.height=500),e.useContainerWidth&&(a.initialViewState.width=n)),delete a.views,X.convert(a)};var H=(0,m.b)(J("st.pydeck_chart")((0,y.Z)($)))},50413:function(){},30643:function(){},69081:function(){},49125:function(){}}]);
1
+ (self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[491],{8798:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return H}});var i=n(4942),r=n(15671),a=n(43144),o=n(60136),s=n(29388),c=n(1413),h=n(47313),l=n(59603),u=n(1905),p=n.n(u),d=n(16117),m=n(83985),f=n(81512),w=n(24821),v=n(41043),g=n(49774),x=n(40519),b=n(31186),k=n(96721),Z=n(20024),S=n(21906),y=n(26419),j=n(74165),T=n(15861),V=n(317),C=n(53499),E=n(28664),M=n(31881),O=n.n(M),F=n(81003),L=function(t){(0,o.Z)(n,t);var e=(0,s.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,a.Z)(n)}((0,E.Z)(Error)),N=function(t){(0,o.Z)(n,t);var e=(0,s.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,a.Z)(n)}((0,E.Z)(Error)),P=function(){function t(){(0,r.Z)(this,t)}return(0,a.Z)(t,null,[{key:"get",value:function(){var e=(0,T.Z)((0,j.Z)().mark((function e(n){var i,r,a;return(0,j.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.current,r=i.commandLine,a=i.userMapboxToken,t.token&&t.commandLine===r.toLowerCase()){e.next=10;break}if(""===a){e.next=6;break}t.token=a,e.next=9;break;case 6:return e.next=8,this.fetchToken("https://data.streamlit.io/tokens.json","mapbox");case 8:t.token=e.sent;case 9:t.commandLine=r.toLowerCase();case 10:return e.abrupt("return",t.token);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"fetchToken",value:function(){var t=(0,T.Z)((0,j.Z)().mark((function t(e,n){var i,r,a;return(0,j.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,O().get(e);case 3:if(i=t.sent,null!=(r=i.data[n])&&""!==r){t.next=7;break}throw new Error('Missing token "'.concat(n,'"'));case 7:return t.abrupt("return",r);case 10:throw t.prev=10,t.t0=t.catch(0),a=(0,F.b)(t.t0),new N("".concat(a.message," (").concat(e,")"));case 14:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(e,n){return t.apply(this,arguments)}}()}]),t}();P.token=void 0,P.commandLine=void 0,P.isRunningLocal=function(){var t=window.location.hostname;return"localhost"===t||"127.0.0.1"===t};var I=n(67861),z=n.n(I),D=n(46135),q=n(46417),A=function(t){var e=t.error,n=t.width,i=t.deltaType;return e instanceof L?(0,q.jsx)(D.Z,{width:n,name:"No Mapbox token provided",message:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("p",{children:["To use ",(0,q.jsxs)("code",{children:["st.",i]})," or ",(0,q.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,q.jsxs)("p",{children:["To get a token, create an account at"," ",(0,q.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,q.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,q.jsx)("code",{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,q.jsxs)("p",{children:["See"," ",(0,q.jsx)("a",{href:"https://docs.streamlit.io/library/advanced-features/configuration#view-all-configuration-options",children:"our documentation"})," ","for more info on how to set config options."]})]})}):e instanceof N?(0,q.jsx)(D.Z,{width:n,name:"Error fetching Streamlit Mapbox token",message:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("p",{children:"This app requires an internet connection."}),(0,q.jsx)("p",{children:"Please check your connection and try again."}),(0,q.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,q.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,q.jsx)(D.Z,{width:n,name:"Error fetching Streamlit Mapbox token",message:e.message})},J=function(t){return function(e){var n=function(n){(0,o.Z)(h,n);var i=(0,s.Z)(h);function h(n){var a;return(0,r.Z)(this,h),(a=i.call(this,n)).initMapboxToken=(0,T.Z)((0,j.Z)().mark((function t(){var e,n;return(0,j.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,P.get(a.props.sessionInfo);case 3:e=t.sent,a.setState({mapboxToken:e,isFetching:!1}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(0),n=(0,F.b)(t.t0),a.setState({mapboxTokenError:n,isFetching:!1});case 11:case"end":return t.stop()}}),t,null,[[0,7]])}))),a.render=function(){var n=a.state,i=n.mapboxToken,r=n.mapboxTokenError,o=n.isFetching,s=a.props.width;return r?(0,q.jsx)(A,{width:s,error:r,deltaType:t}):o?(0,q.jsx)(V.Z,{body:"Loading...",kind:C.h.INFO,width:s}):(0,q.jsx)(e,(0,c.Z)((0,c.Z)({},a.props),{},{mapboxToken:i,width:s}))},a.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0},a.initMapboxToken(),a}return(0,a.Z)(h)}(h.PureComponent);return n.displayName="withMapboxToken(".concat(e.displayName||e.name,")"),z()(n,e)}},_=n(64243),B=n(47167),G=(0,B.Z)("div",{target:"e1q4dr931"})((function(t){var e=t.width,n=t.height;return{marginTop:t.theme.spacing.sm,position:"relative",height:n,width:e}}),""),R=(0,B.Z)("div",{target:"e1q4dr930"})((function(t){var e=t.theme;return{position:"absolute",right:"2.625rem",top:e.spacing.md,zIndex:1,"button:not(:disabled)":{background:e.colors.bgColor,"& + button":{borderTopColor:e.colors.secondaryBg},"& span":{filter:(0,f.Iy)(e)?"":"invert(100%)"}}}}),""),W=(n(81627),{classes:(0,c.Z)((0,c.Z)((0,c.Z)((0,c.Z)({},w),x),g),b)});(0,S.fh)([k.w,Z.E]);var X=new v.Z({configuration:W}),$=function(t){(0,o.Z)(n,t);var e=(0,s.Z)(n);function n(){var t;(0,r.Z)(this,n);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return(t=e.call.apply(e,[this].concat(a))).state={viewState:{bearing:0,pitch:0,zoom:11},initialized:!1,initialViewState:{}},t.componentDidMount=function(){t.setState({initialized:!0})},t.createTooltip=function(e){var n=t.props.element;if(!e||!e.object||!n.tooltip)return!1;var i=JSON.parse(n.tooltip);return i.html?i.html=t.interpolate(e,i.html):i.text=t.interpolate(e,i.text),i},t.interpolate=function(t,e){var n=e.match(/{(.*?)}/g);return n&&n.forEach((function(n){var i=n.substring(1,n.length-1);t.object.hasOwnProperty(i)&&(e=e.replace(n,t.object[i]))})),e},t.onViewStateChange=function(e){var n=e.viewState;t.setState({viewState:n})},t}return(0,a.Z)(n,[{key:"render",value:function(){var t=n.getDeckObject(this.props),e=this.state.viewState;return(0,q.jsx)(G,{className:"stDeckGlJsonChart",width:t.initialViewState.width,height:t.initialViewState.height,children:(0,q.jsxs)(l.Z,{viewState:e,onViewStateChange:this.onViewStateChange,height:t.initialViewState.height,width:t.initialViewState.width,layers:this.state.initialized?t.layers:[],getTooltip:this.createTooltip,ContextProvider:d.X$.Provider,controller:!0,children:[(0,q.jsx)(d.Z3,{height:t.initialViewState.height,width:t.initialViewState.width,mapStyle:t.mapStyle&&("string"===typeof t.mapStyle?t.mapStyle:t.mapStyle[0]),mapboxApiAccessToken:this.props.mapboxToken}),(0,q.jsx)(R,{children:(0,q.jsx)(d.Pv,{className:"zoomButton",showCompass:!1})})]})})}}],[{key:"getDerivedStateFromProps",value:function(t,e){var r=n.getDeckObject(t);if(!p()(r.initialViewState,e.initialViewState)){var a=Object.keys(r.initialViewState).reduce((function(t,n){return r.initialViewState[n]===e.initialViewState[n]?t:(0,c.Z)((0,c.Z)({},t),{},(0,i.Z)({},n,r.initialViewState[n]))}),{});return{viewState:(0,c.Z)((0,c.Z)({},e.viewState),a),initialViewState:r.initialViewState}}return null}}]),n}(h.PureComponent);$.getDeckObject=function(t){var e=t.element,n=t.width,i=t.height,r=t.theme,a=JSON.parse(e.json);if(!(0,_.bb)(a.mapStyle)){var o=(0,f.Iy)(r)?"light":"dark";a.mapStyle="mapbox://styles/mapbox/".concat(o,"-v9")}return i?(a.initialViewState.height=i,a.initialViewState.width=n):(a.initialViewState.height||(a.initialViewState.height=500),e.useContainerWidth&&(a.initialViewState.width=n)),delete a.views,X.convert(a)};var H=(0,m.b)(J("st.pydeck_chart")((0,y.Z)($)))},50413:function(){},30643:function(){},69081:function(){},49125:function(){}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkstreamlit_browser=self.webpackChunkstreamlit_browser||[]).push([[503],{5655:function(e,t,n){n.r(t),n.d(t,{default:function(){return xe}});var i=n(29439),r=n(1413),o=n(47313),a=n(56130),l=n(91719),d=n(30161),u=n(46332),s=n(26419),c=n(7976),f=n(64243),h=n(15671),g=n(43144),m=function(){function e(t){(0,h.Z)(this,e),this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}return(0,g.Z)(e,[{key:"toJson",value:function(e){var t=new Map;e.forEach((function(e){t.set(e.indexNumber,e)}));var n={edited_cells:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((function(e,i,r){e.forEach((function(e,r,o){var a=t.get(r);a&&(n.edited_cells["".concat(i,":").concat(r)]=a.getCellValue(e))}))})),this.addedRows.forEach((function(e){var i={};e.forEach((function(e,n,r){var o=t.get(n);if(o){var a=o.getCellValue(e);(0,f.bb)(a)&&(i[n]=a)}})),n.added_rows.push(i)})),n.deleted_rows=this.deletedRows,JSON.stringify(n,(function(e,t){return void 0===t?null:t}))}},{key:"fromJson",value:function(e,t){var n=this,r=JSON.parse(e),o=new Map;t.forEach((function(e){o.set(e.indexNumber,e)})),Object.keys(r.edited_cells).forEach((function(e){var t=e.split(":").map(Number),a=(0,i.Z)(t,2),l=a[0],d=a[1],u=o.get(d);if(u){var s,c=u.getCell(r.edited_cells[e]);if(c)0==n.editedCells.has(l)&&n.editedCells.set(l,new Map),null===(s=n.editedCells.get(l))||void 0===s||s.set(d,c)}})),r.added_rows.forEach((function(e){var i=new Map;t.forEach((function(e){i.set(e.indexNumber,e.getCell(void 0))})),Object.keys(e).forEach((function(t){var n=o.get(Number(t));if(n){var r=n.getCell(e[Number(t)]);r&&i.set(Number(t),r)}})),n.addedRows.push(i)})),this.deletedRows=r.deleted_rows}},{key:"isAddedRow",value:function(e){return e>=this.numRows}},{key:"getCell",value:function(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);var n=this.editedCells.get(t);return void 0!==n?n.get(e):void 0}},{key:"setCell",value:function(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)}}},{key:"addRow",value:function(e){this.addedRows.push(e)}},{key:"deleteRows",value:function(e){var t=this;e.sort((function(e,t){return t-e})).forEach((function(e){t.deleteRow(e)}))}},{key:"deleteRow",value:function(e){(0,f.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((function(e,t){return e-t}))),this.editedCells.delete(e)))}},{key:"getOriginalRowIndex",value:function(e){for(var t=e,n=0;n<this.deletedRows.length&&!(this.deletedRows[n]>t);n++)t+=1;return t}},{key:"getNumRows",value:function(){return this.numRows+this.addedRows.length-this.deletedRows.length}}]),e}(),v=n(2120),p=n(83985);var b=function(){var e=(0,p.u)(),t=o.useMemo((function(){return{editable:function(e){return'<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,v.DZ)(e.colors.primary,.9),borderColor:e.colors.fadedText05,horizontalBorderColor:e.colors.fadedText05,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,v.DZ)(e.colors.primary,.9),bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.bgMix,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,v.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.md,headerIcons:t}},w=n(72599),y=n(45429),C=n(16031),x=n(35394),R=n.n(x),Z=["true","t","yes","y","on","1"],M=["false","f","no","n","off","0"];function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e="\u26a0\ufe0f ".concat(e),{kind:a.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?"\n\n".concat(t,"\n"):""),displayData:e,isError:!0}}function k(e){return e.hasOwnProperty("isError")&&e.isError}function N(e){return(0,r.Z)((0,r.Z)({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 T(e,t){return(0,f.le)(e)?t||{}:(0,f.le)(t)?e||{}:(0,C.merge)(e,t)}function S(e){if((0,f.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(n){return[e]}}try{var t=JSON.parse(JSON.stringify(e,(function(e,t){return"bigint"===typeof t?Number(t):t})));return(0,C.isArray)(t)?t.map((function(e){return["string","number","boolean","null"].includes(typeof e)?e:O(e)})):[O(t)]}catch(n){return[O(e)]}}function O(e){try{try{return(0,C.toString)(e)}catch(t){return JSON.stringify(e,(function(e,t){return"bigint"===typeof t?Number(t):t}))}}catch(t){return"[".concat(typeof e,"]")}}function I(e){if((0,f.le)(e))return null;if("boolean"===typeof e)return e;var t=O(e).toLowerCase().trim();return""===t?null:!!Z.includes(t)||!M.includes(t)&&void 0}function H(e){if((0,f.le)(e))return null;if((0,C.isArray)(e))return NaN;if("string"===typeof e){if(0===e.trim().length)return null;try{var t=R().unformat(e.trim());if((0,f.bb)(t))return t}catch(n){}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!Number.isNaN(e)&&Number.isFinite(e)?(0===t&&(e=Math.round(e)),R()(e).format(n?"0,0.".concat("0".repeat(t)):"0,0.[".concat("0".repeat(t),"]"))):""}function D(e){var t={kind:a.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isIndex?"faded":"normal"};return(0,r.Z)((0,r.Z)({},e),{},{kind:"object",sortMode:"default",isEditable:!1,getCell:function(e){try{var n=(0,f.bb)(e)?O(e):null,i=(0,f.bb)(n)?n:"";return(0,r.Z)((0,r.Z)({},t),{},{data:n,displayData:i,isMissingValue:(0,f.le)(e)})}catch(o){return E(O(e),"The value cannot be interpreted as a string. Error: ".concat(o))}},getCellValue:function(e){return void 0===e.data?null:e.data}})}D.isEditableType=!1;var z=D;function V(e){var t=e.columnTypeOptions||{},n=void 0;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(l){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(l)}var i={kind:a.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},o=function(i){if((0,f.le)(i))return!e.isRequired;var r=O(i);return!(n instanceof RegExp&&!1===n.test(r))&&(!(t.max_chars&&r.length>t.max_chars)||r.slice(0,t.max_chars))};return(0,r.Z)((0,r.Z)({},e),{},{kind:"text",sortMode:"default",validateInput:o,getCell:function(e,t){if("string"===typeof n)return E(O(e),n);if(t){var a=o(e);if(!1===a)return E(O(e),"Invalid input.");"string"===typeof a&&(e=a)}try{var d=(0,f.bb)(e)?O(e):null,u=(0,f.bb)(d)?d:"";return(0,r.Z)((0,r.Z)({},i),{},{isMissingValue:(0,f.le)(d),data:d,displayData:u})}catch(l){return E("Incompatible value","The value cannot be interpreted as string. Error: ".concat(l))}},getCellValue:function(e){return void 0===e.data?null:e.data}})}V.isEditableType=!0;var L=V;function W(e){var t={kind:a.p6.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"};return(0,r.Z)((0,r.Z)({},e),{},{kind:"checkbox",sortMode:"default",getCell:function(e){var n;return void 0===(n=I(e))?E(O(e),"The value cannot be interpreted as boolean."):(0,r.Z)((0,r.Z)({},t),{},{data:n})},getCellValue:function(e){return void 0===e.data?null:e.data}})}W.isEditableType=!0;var B=W,_=n(93433);function j(e){var t="string",n=T({options:"bool"===y.fu.getTypeName(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map((function(e){return typeof e})));1===i.size&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));var o={kind:a.p6.Custom,allowOverlay:e.isEditable,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,data:{kind:"dropdown-cell",allowedValues:[].concat((0,_.Z)(!0!==e.isRequired?[""]:[]),(0,_.Z)(n.options.filter((function(e){return""!==e})).map((function(e){return O(e)})))),value:"",readonly:!e.isEditable}};return(0,r.Z)((0,r.Z)({},e),{},{kind:"selectbox",sortMode:"default",getCell:function(e,t){var n="";return(0,f.bb)(e)&&(n=O(e)),t&&!o.data.allowedValues.includes(n)?E(O(n),"The value is not part of the allowed options."):(0,r.Z)((0,r.Z)({},o),{},{isMissingValue:""===n,copyData:n,data:(0,r.Z)((0,r.Z)({},o.data),{},{value:n})})},getCellValue:function(e){var n,i,r,o,a,l,d;return void 0===(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!==(o=H(null===(a=e.data)||void 0===a?void 0:a.value))&&void 0!==o?o:null:"boolean"===t?null!==(l=I(null===(d=e.data)||void 0===d?void 0:d.value))&&void 0!==l?l:null:null===(r=e.data)||void 0===r?void 0:r.value}})}j.isEditableType=!0;var F=j;function P(e){var t={kind:a.p6.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"};return(0,r.Z)((0,r.Z)({},e),{},{kind:"list",sortMode:"default",isEditable:!1,getCell:function(e){return(0,r.Z)((0,r.Z)({},t),{},{data:S(e),isMissingValue:(0,f.le)(e)})},getCellValue:function(e){return void 0===e.data?null:e.data}})}P.isEditableType=!1;var J=P;function Y(e){var t=y.fu.getTypeName(e.arrowType),n=T({precision:t.startsWith("int")||"range"===t||t.startsWith("uint")?0:void 0,min:t.startsWith("uint")?0:void 0},e.columnTypeOptions),i=(0,f.le)(n.min)||n.min<0,o=(0,f.bb)(n.precision)?n.precision:void 0,l={kind:a.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:i,fixedDecimals:o};return(0,r.Z)((0,r.Z)({},e),{},{kind:"number",sortMode:"smart",getCell:function(e){var t=H(e);if((0,f.bb)(t)){if(Number.isNaN(t))return E(O(e),"The value cannot be interpreted as a number.");if((0,f.bb)(n.precision)&&(t=0===n.precision?Math.trunc(t):Math.trunc(t*Math.pow(10,n.precision))/Math.pow(10,n.precision)),(0,f.bb)(n.min)&&(t=Math.max(t,n.min)),(0,f.bb)(n.max)&&(t=Math.min(t,n.max)),Number.isInteger(t)&&!Number.isSafeInteger(t))return E(O(e),"The value is larger than the maximum supported integer values in number columns (2^53).")}return(0,r.Z)((0,r.Z)({},l),{},{data:t,displayData:(0,f.bb)(t)?A(t):"",isMissingValue:(0,f.le)(t)})},getCellValue:function(e){return void 0===e.data?null:e.data}})}Y.isEditableType=!0;var q=Y,U=new Map(Object.entries({object:z,text:L,checkbox:B,selectbox:F,list:J,number:q}));function G(e,t,n){var i=new RegExp("".concat(e,"[,\\s].*{(?:[^}]*[\\s;]{1})?").concat(t,":\\s*([^;}]+)[;]?.*}"),"gm");n=n.replace(/{/g," {");var r=i.exec(n);if(r)return r[1].trim()}function K(e){return e.replace(/(\r\n|\n|\r)/gm," ")}function X(e,t,n){var i={},o=G(t,"color",n);o&&(i.textDark=o);var a=G(t,"background-color",n);return a&&(i.bgCell=a),"yellow"===a&&void 0===o&&(i.textDark="#31333F"),i?(0,r.Z)((0,r.Z)({},e),{},{themeOverride:i}):e}function Q(e,t){var n=e.types.index[t],i=e.indexNames[t],r=!0;return"range"===y.fu.getTypeName(n)&&(r=!1),{id:"index-".concat(t),name:i,title:i,isEditable:r,arrowType:n,isIndex:!0,isHidden:!1}}function $(e,t){var n,i=e.columns[0][t],r=e.types.data[t];if((0,f.le)(r)&&(r={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===y.fu.getTypeName(r)){var o=e.getCategoricalOptions(t);(0,f.bb)(o)&&(n={options:o})}return{id:"column-".concat(i,"-").concat(t),name:i,title:i,isEditable:!0,arrowType:r,columnTypeOptions:n,isIndex:!1,isHidden:!1}}var ee=function(e,t,n,l){var d=o.useCallback((function(o){var d=(0,i.Z)(o,2),u=d[0],s=d[1];if(u>t.length-1)return E("Column index out of bounds.","This should never happen. Please report this bug.");if(s>n-1)return E("Row index out of bounds.","This should never happen. Please report this bug.");var c=t[u],h=c.indexNumber,g=l.current.getOriginalRowIndex(s);if(c.isEditable||l.current.isAddedRow(g)){var m=l.current.getCell(h,g);if(void 0!==m)return m}try{return function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(k(n="object"===e.kind?e.getCell((0,f.bb)(t.content)?K(y.fu.format(t.content,t.contentType,t.field)):null):e.getCell(t.content)))return n;if(!e.isEditable){if((0,f.bb)(t.displayContent)){var o=K(t.displayContent);(n.kind===a.p6.Text||n.kind===a.p6.Number)&&(n=(0,r.Z)((0,r.Z)({},n),{},{displayData:o}))}i&&t.cssId&&(n=X(n,t.cssId,i))}return n}(c,e.getCell(g+1,h),e.cssStyles)}catch(v){return(0,w.H)(v),E("Error during cell creation.","This should never happen. Please report this bug. \nError: ".concat(v))}}),[t,n,e,l]);return{getCellContent:d}};var te=function(e,t,n,r,a){var l,d=function(e){return Math.max(35*e+1+2,73)}(t+1+(e.editingMode===c.Eh.EditingMode.DYNAMIC?1:0)),u=Math.min(d,400);e.height&&(u=Math.max(e.height,73),d=Math.max(e.height,d)),r&&(u=Math.min(u,r),d=Math.min(d,r),e.height||(u=d));var s=n;e.useContainerWidth?l=n:e.width&&(l=Math.min(Math.max(e.width,52),n),s=Math.min(Math.max(e.width,s),n));var h=o.useState({width:l||"100%",height:u}),g=(0,i.Z)(h,2),m=g[0],v=g[1];return o.useLayoutEffect((function(){e.useContainerWidth&&"100%"===m.width&&v({width:n,height:m.height})}),[n]),o.useLayoutEffect((function(){v({width:m.width,height:u})}),[t]),o.useLayoutEffect((function(){v({width:l||"100%",height:m.height})}),[l]),o.useLayoutEffect((function(){v({width:m.width,height:u})}),[u]),o.useLayoutEffect((function(){if(a){var t=e.useContainerWidth||(0,f.bb)(e.width)&&e.width>0;v({width:t?s:"100%",height:d})}else v({width:l||"100%",height:u})}),[a]),{rowHeight:35,minHeight:73,maxHeight:d,minWidth:52,maxWidth:s,resizableSize:m,setResizableSize:v}};var ne=function(e,t,n,a,l,d,u){var s=o.useCallback((function(t,o){var d=(0,i.Z)(t,2),s=d[0],c=d[1],f=e[s],h=f.indexNumber,g=n.current.getOriginalRowIndex(l(c)),m=a([s,c]),v=f.getCellValue(m),p=f.getCellValue(o);if(k(m)||p!==v){var b=f.getCell(p,!0);k(b)?(0,w.KE)("Not applying the cell edit since it causes this error:\n ".concat(b.data)):(n.current.setCell(h,g,(0,r.Z)((0,r.Z)({},b),{},{lastUpdated:performance.now()})),u())}}),[e,n,l,a,u]),c=o.useCallback((function(){if(!t){var i=new Map;e.forEach((function(e){i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i),u(!1,!1)}}),[e,n,t,u]),h=o.useCallback((function(i){var r;if(i.rows.length>0){if(t)return!0;var o=i.rows.toArray().map((function(e){return n.current.getOriginalRowIndex(l(e))}));return n.current.deleteRows(o),u(!0),!1}if(null!==(r=i.current)&&void 0!==r&&r.range){for(var a=[],c=i.current.range,f=c.y;f<c.y+c.height;f++)for(var h=c.x;h<c.x+c.width;h++){var g=e[h];g.isEditable&&!g.isRequired&&(a.push({cell:[h,f]}),s([h,f],g.getCell(null)))}return a.length>0&&(u(),d(a)),!1}return!0}),[e,n,t,d,l,u,s]),g=o.useCallback((function(o,s){for(var h=(0,i.Z)(o,2),g=h[0],m=h[1],v=[],p=0;p<s.length;p++){var b=s[p];if(p+m>=n.current.getNumRows()){if(t)break;c()}for(var w=0;w<b.length;w++){var y=b[w],C=p+m,x=w+g;if(x>=e.length)break;var R=e[x];if(R.isEditable){var Z=R.getCell(y,!0);if((0,f.bb)(Z)&&!k(Z)){var M=R.indexNumber,E=n.current.getOriginalRowIndex(l(C)),N=R.getCellValue(a([x,C]));R.getCellValue(Z)!==N&&(n.current.setCell(M,E,(0,r.Z)((0,r.Z)({},Z),{},{lastUpdated:performance.now()})),v.push({cell:[x,C]}))}}}v.length>0&&(u(),d(v))}return!1}),[e,n,t,l,a,c,u,d]),m=o.useCallback((function(t,n){var i=t[0];if(i>=e.length)return!0;var r=e[i];if(r.validateInput){var o=r.validateInput(r.getCellValue(n));return!0===o||!1===o?o:r.getCell(o)}return!0}),[e]);return{onCellEdited:s,onPaste:g,onRowAppended:c,onDelete:h,validateCell:m}};var ie=function(e){var t=(0,o.useState)((function(){return new Map})),n=(0,i.Z)(t,2),a=n[0],l=n[1],d=o.useCallback((function(e,t,n,i){e.id&&l(new Map(a).set(e.id,i))}),[a]);return{columns:e.map((function(e){return e.id&&a.has(e.id)&&void 0!==a.get(e.id)?(0,r.Z)((0,r.Z)({},e),{},{width:a.get(e.id),grow:0}):e})),onColumnResize:d}},re=n(34264);var oe=function(e,t,n){var a=o.useState(),l=(0,i.Z)(a,2),d=l[0],u=l[1],s=(0,re.fF)({columns:t.map((function(e){return N(e)})),getCellContent:n,rows:e,sort:d}),c=s.getCellContent,f=s.getOriginalIndex,h=function(e,t){return void 0===t?e:e.map((function(e){return e.id===t.column.id?(0,r.Z)((0,r.Z)({},e),{},{title:"asc"===t.direction?"\u2191 ".concat(e.title):"\u2193 ".concat(e.title)}):e}))}(t,d),g=o.useCallback((function(e){var t="asc",n=h[e];if(d&&d.column.id===n.id){if("asc"!==d.direction)return void u(void 0);t="desc"}u({column:N(n),direction:t,mode:n.sortMode})}),[d,h]);return{columns:h,sortColumn:g,getOriginalIndex:f,getCellContent:c}},ae="index",le="col:",de={small:75,medium:200,large:400};function ue(e){var t;return(0,f.bb)(e.customType)&&(U.has(e.customType)?t=U.get(e.customType):(0,w.KE)("Unknown column type configured in column configuration: ".concat(e.customType))),(0,f.le)(t)&&(t=function(e){var t=e?y.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty"].includes(t)?L:["object","date","time","datetime","datetimetz","decimal","bytes"].includes(t)?z:["bool"].includes(t)?B:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range"].includes(t)?q:"categorical"===t?F:t.startsWith("list")?J:z):z}(e.arrowType)),t}var se=function(e,t,n){var i=function(e){if(!e.columns)return new Map;try{return new Map(Object.entries(JSON.parse(e.columns)))}catch(t){return(0,w.H)(t),new Map}}(e),o=e.useContainerWidth||(0,f.bb)(e.width)&&e.width>0,a=function(e){var t,n,i,o,a,l,d=[],u=null!==(t=null===(n=e.types)||void 0===n||null===(i=n.index)||void 0===i?void 0:i.length)&&void 0!==t?t:0,s=null!==(o=null===(a=e.columns)||void 0===a||null===(l=a[0])||void 0===l?void 0:l.length)&&void 0!==o?o:0;if(0===u&&0===s)return d.push({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0}),d;for(var c=0;c<u;c++){var f=(0,r.Z)((0,r.Z)({},Q(e,c)),{},{indexNumber:c});d.push(f)}for(var h=0;h<s;h++){var g=(0,r.Z)((0,r.Z)({},$(e,h)),{},{indexNumber:h+u});d.push(g)}return d}(t).map((function(t){var a=(0,r.Z)((0,r.Z)((0,r.Z)({},t),function(e,t){var n,i;return t?(t.has(e.name)?i=t.get(e.name):t.has("".concat(le).concat(e.indexNumber))?i=t.get("".concat(le).concat(e.indexNumber)):e.isIndex&&t.has(ae)&&(i=t.get(ae)),i?(0,C.merge)((0,r.Z)({},e),{title:i.title,width:(0,f.bb)(i.width)&&i.width in de?de[i.width]:void 0,customType:null===(n=i.type)||void 0===n?void 0:n.toLowerCase().trim(),isEditable:(0,f.bb)(i.disabled)?!i.disabled:void 0,isHidden:i.hidden,isRequired:i.required,columnTypeOptions:i.type_options,contentAlignment:i.alignment,defaultValue:i.default,help:i.help}):e):e}(t,i)),{},{isStretched:o}),l=ue(a);return(e.editingMode===c.Eh.EditingMode.READ_ONLY||n||!1===l.isEditableType)&&(a=(0,r.Z)((0,r.Z)({},a),{},{isEditable:!1})),e.editingMode!==c.Eh.EditingMode.READ_ONLY&&1==a.isEditable&&(a=(0,r.Z)((0,r.Z)({},a),{},{icon:"editable"})),l(a)})).filter((function(e){return!e.isHidden}));return{columns:a.length>0?a:[z({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}};var ce=function(e,t){var n=o.useState(),r=(0,i.Z)(n,2),a=r[0],l=r[1],d=o.useRef(null),u=o.useCallback((function(n){if(clearTimeout(d.current),d.current=0,l(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){var i,r=n.location[0],o=n.location[1];if(r<0)return;if("header"===n.kind&&e.length>r&&(0,f.bb)(e[r]))i=e[r].help;else if("cell"===n.kind){var a=t([r,o]);(function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip})(a)&&(i=a.tooltip)}i&&(d.current=setTimeout((function(){i&&l({content:i,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,l,d]);return{tooltip:a,clearTooltip:o.useCallback((function(){l(void 0)}),[l]),onItemHovered:u}},fe=n(4942),he=(0,n(47167).Z)("div",{target:"e17g77xh0"})((function(e){var t;return{position:"relative",display:"inline-block","& .glideDataEditor":{height:"100%",minWidth:"100%",borderRadius:e.theme.radii.md},"& .dvn-scroller":(t={scrollbarWidth:"thin"},(0,fe.Z)(t,"overflowX","overlay !important"),(0,fe.Z)(t,"overflowY","overlay !important"),t)}}),""),ge=n(84028),me=n(18550),ve=n(98345),pe=n(44642),be=n(74903),we=n(46417);var ye=function(e){var t=e.top,n=e.left,r=e.content,a=e.clearTooltip,l=o.useState(!0),d=(0,i.Z)(l,2),u=d[0],s=d[1],c=(0,p.u)(),f=c.colors,h=c.fontSizes,g=c.radii,m=o.useCallback((function(){s(!1),a()}),[a,s]);return(0,we.jsx)(ge.Z,{content:(0,we.jsx)(pe.Uo,{className:"stTooltipContent",children:(0,we.jsx)(ve.ZP,{style:{fontSize:h.sm},source:r,allowHTML:!1})}),placement:me.r4.top,accessibilityType:me.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:g.md,borderTopRightRadius:g.md,borderBottomLeftRadius:g.md,borderBottomRightRadius:g.md,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,be.Iy)(c)?f.bgColor:f.secondaryBg,color:f.bodyText,fontSize:h.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:u,children:(0,we.jsx)("div",{className:"stTooltipTarget",style:{position:"fixed",top:t,left:n}})})},Ce=(n(47288),function(e){var t=e.cell,n=e.theme;return!!function(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}(t)&&((0,a.uN)((0,r.Z)((0,r.Z)({},e),{},{theme:(0,r.Z)((0,r.Z)({},n),{},{textDark:n.textLight,textMedium:n.textLight}),spriteManager:{},hyperWrapping:!1}),"None",t.contentAlign),!0)});var xe=(0,s.Z)((function(e){var t=e.element,n=e.data,s=e.width,h=e.height,g=e.disabled,v=e.widgetMgr,p=e.isFullScreen,w=o.useRef(null),y=o.useRef(null),C=(0,l.Bn)(),x=b(),R=o.useState(!0),Z=(0,i.Z)(R,2),M=Z[0],E=Z[1],k=o.useMemo((function(){return window.matchMedia&&window.matchMedia("(pointer: coarse)").matches}),[]),T=o.useState({columns:a.EV.empty(),rows:a.EV.empty(),current:void 0}),S=(0,i.Z)(T,2),O=S[0],I=S[1],H=o.useCallback((function(){I({columns:a.EV.empty(),rows:a.EV.empty(),current:void 0})}),[]),A=o.useCallback((function(e){var t;null===(t=y.current)||void 0===t||t.updateCells(e)}),[]);(0,f.le)(t.editingMode)&&(t.editingMode=c.Eh.EditingMode.READ_ONLY);var D=c.Eh.EditingMode,z=D.READ_ONLY,V=D.DYNAMIC,L=n.dimensions,W=Math.max(0,L.rows-1),B=0===W&&!(t.editingMode===V&&L.dataColumns>0),_=W>15e4,j=o.useRef(new m(W)),F=o.useState(j.current.getNumRows()),P=(0,i.Z)(F,2),J=P[0],Y=P[1];o.useEffect((function(){j.current=new m(W),Y(j.current.getNumRows())}),[W]);var q=o.useCallback((function(){j.current=new m(W),Y(j.current.getNumRows())}),[W]),U=se(t,n,g).columns;o.useEffect((function(){if(t.editingMode!==z){var e=v.getStringValue(t);e&&(j.current.fromJson(e,U),Y(j.current.getNumRows()))}}),[]);var G=ee(n,U,J,j).getCellContent,K=oe(W,U,G),X=K.columns,Q=K.sortColumn,$=K.getOriginalIndex,re=K.getCellContent,ae=o.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];J!==j.current.getNumRows()&&Y(j.current.getNumRows()),e&&H(),(0,f.Ds)(100,(function(){var e=j.current.toJson(X),i=v.getStringValue(t);void 0===i&&(i=new m(0).toJson([])),e!==i&&v.setStringValue(t,e,{fromUi:n})}))()}),[v,t,J,H,X]),le=ne(X,t.editingMode!==V,j,re,$,A,ae),de=le.onCellEdited,ue=le.onPaste,fe=le.onRowAppended,ge=le.onDelete,me=le.validateCell,ve=ce(X,re),pe=ve.tooltip,be=ve.clearTooltip,xe=ve.onItemHovered,Re=ie(X.map((function(e){return N(e)}))),Ze=Re.columns,Me=Re.onColumnResize,Ee=te(t,J,s,h,p),ke=Ee.rowHeight,Ne=Ee.minHeight,Te=Ee.maxHeight,Se=Ee.minWidth,Oe=Ee.maxWidth,Ie=Ee.resizableSize,He=Ee.setResizableSize,Ae=o.useCallback((function(e){var t=(0,i.Z)(e,2);t[0],t[1];return(0,r.Z)((0,r.Z)({},function(e,t){var n=t?"faded":"normal";return{kind:a.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}(!0,!1)),{},{displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:x.textLight},span:[0,Math.max(X.length-1,0)]})}),[X,x.textLight]);return o.useEffect((function(){var e=new u.Kz;return e.manageFormClearListener(v,t.formId,q),function(){e.disconnect()}}),[t.formId,q,v]),(0,we.jsxs)(he,{className:"stDataFrame",onBlur:function(){M||k||H()},children:[(0,we.jsx)(d.e,{"data-testid":"stDataFrameResizable",ref:w,defaultSize:Ie,style:{border:"1px solid ".concat(x.borderColor),borderRadius:"".concat(x.tableBorderRadius)},minHeight:Ne,maxHeight:Te,minWidth:Se,maxWidth:Oe,size:Ie,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,ke],snapGap:ke/3,onResizeStop:function(e,t,n,i){w.current&&He({width:w.current.size.width,height:Te-w.current.size.height===3?w.current.size.height+3:w.current.size.height})},children:(0,we.jsx)(a.Nd,(0,r.Z)((0,r.Z)({className:"glideDataEditor",ref:y,columns:Ze,rows:B?1:J,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:ke,headerHeight:ke,getCellContent:B?Ae:re,onColumnResize:Me,freezeColumns:B?0:X.filter((function(e){return e.isIndex})).length,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:function(e){return!(e>=X.length&&(t.useContainerWidth||"100%"===Ie.width))},getCellsForSelection:!0,rowMarkers:"none",rangeSelect:k?"none":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:xe,keybindings:{search:!0,downFill:!0},onHeaderClicked:B||_?void 0:Q,gridSelection:O,onGridSelectionChange:function(e){(M||k)&&(I(e),void 0!==pe&&be())},drawCell:Ce,theme:x,onMouseMove:function(e){"out-of-bounds"===e.kind&&M?E(!1):"out-of-bounds"===e.kind||M||E(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:1},customRenderers:C.customRenderers,headerIcons:x.headerIcons,validateCell:me,onPaste:!1},!B&&t.editingMode!==z&&!g&&{fillHandle:!k,onCellEdited:de,onPaste:ue,onDelete:ge}),!B&&t.editingMode===V&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkerTheme:{bgCell:x.bgHeader,bgCellMedium:x.bgHeader},rowMarkers:"checkbox",rowSelectionMode:"auto",rowSelect:g?"none":"multi",onRowAppended:g?void 0:fe,onHeaderClicked:void 0}))}),pe&&pe.content&&(0,we.jsx)(ye,{top:pe.top,left:pe.left,content:pe.content,clearTooltip:be})]})}))}}]);