streamlit-nightly 1.34.1.dev20240505__py2.py3-none-any.whl → 1.34.1.dev20240507__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 (65) hide show
  1. streamlit/__init__.py +1 -0
  2. streamlit/commands/logo.py +107 -0
  3. streamlit/components/v1/component_registry.py +8 -3
  4. streamlit/proto/ForwardMsg_pb2.py +10 -9
  5. streamlit/proto/ForwardMsg_pb2.pyi +9 -3
  6. streamlit/proto/Logo_pb2.py +26 -0
  7. streamlit/proto/Logo_pb2.pyi +51 -0
  8. streamlit/runtime/app_session.py +2 -6
  9. streamlit/runtime/forward_msg_queue.py +23 -3
  10. streamlit/runtime/runtime.py +0 -2
  11. streamlit/runtime/state/query_params.py +4 -2
  12. streamlit/runtime/state/query_params_proxy.py +11 -5
  13. streamlit/runtime/state/session_state_proxy.py +11 -3
  14. streamlit/runtime/websocket_session_manager.py +0 -2
  15. streamlit/static/asset-manifest.json +23 -23
  16. streamlit/static/index.html +1 -1
  17. streamlit/static/static/js/1168.7452e363.chunk.js +1 -0
  18. streamlit/static/static/js/1307.0f0cca93.chunk.js +1 -0
  19. streamlit/static/static/js/1792.8bd6ce2a.chunk.js +1 -0
  20. streamlit/static/static/js/1955.426e67ca.chunk.js +2 -0
  21. streamlit/static/static/js/2178.90362aae.chunk.js +1 -0
  22. streamlit/static/static/js/{2469.3e9c3ce9.chunk.js → 2469.09ea79bb.chunk.js} +1 -1
  23. streamlit/static/static/js/{7217.d970c074.chunk.js → 2736.4336e2b9.chunk.js} +1 -1
  24. streamlit/static/static/js/3092.21bb8f7b.chunk.js +1 -0
  25. streamlit/static/static/js/329.464ed8ec.chunk.js +2 -0
  26. streamlit/static/static/js/3513.ebc278c4.chunk.js +1 -0
  27. streamlit/static/static/js/4113.9b2db2e3.chunk.js +1 -0
  28. streamlit/static/static/js/{4477.e10e4373.chunk.js → 4477.1bd49702.chunk.js} +1 -1
  29. streamlit/static/static/js/5249.f2f4070d.chunk.js +1 -0
  30. streamlit/static/static/js/5441.5bacdeda.chunk.js +1 -0
  31. streamlit/static/static/js/6853.93dd1c4c.chunk.js +1 -0
  32. streamlit/static/static/js/{7323.2808d029.chunk.js → 7323.b74cc85b.chunk.js} +2 -2
  33. streamlit/static/static/js/7805.acc6316a.chunk.js +1 -0
  34. streamlit/static/static/js/8427.bd0a7cf3.chunk.js +1 -0
  35. streamlit/static/static/js/8477.de889fe5.chunk.js +1 -0
  36. streamlit/static/static/js/{8492.3e609489.chunk.js → 8492.0d93bd08.chunk.js} +1 -1
  37. streamlit/static/static/js/8536.f8de3d9a.chunk.js +1 -0
  38. streamlit/static/static/js/main.b84b6de2.js +2 -0
  39. {streamlit_nightly-1.34.1.dev20240505.dist-info → streamlit_nightly-1.34.1.dev20240507.dist-info}/METADATA +2 -2
  40. {streamlit_nightly-1.34.1.dev20240505.dist-info → streamlit_nightly-1.34.1.dev20240507.dist-info}/RECORD +48 -45
  41. streamlit/static/static/js/1168.fc5c673b.chunk.js +0 -1
  42. streamlit/static/static/js/1307.8ea033f1.chunk.js +0 -1
  43. streamlit/static/static/js/1792.b8efa879.chunk.js +0 -1
  44. streamlit/static/static/js/2736.914069e5.chunk.js +0 -2
  45. streamlit/static/static/js/3061.67758376.chunk.js +0 -1
  46. streamlit/static/static/js/3092.bc07c48b.chunk.js +0 -1
  47. streamlit/static/static/js/3513.e3e7300a.chunk.js +0 -1
  48. streamlit/static/static/js/4113.1e7eff4d.chunk.js +0 -1
  49. streamlit/static/static/js/4253.749d5244.chunk.js +0 -2
  50. streamlit/static/static/js/5441.71804c26.chunk.js +0 -1
  51. streamlit/static/static/js/6150.427a30f5.chunk.js +0 -1
  52. streamlit/static/static/js/6853.3cbd385e.chunk.js +0 -1
  53. streamlit/static/static/js/7805.51638fbc.chunk.js +0 -1
  54. streamlit/static/static/js/8427.65ddaf36.chunk.js +0 -1
  55. streamlit/static/static/js/8477.7419a0aa.chunk.js +0 -1
  56. streamlit/static/static/js/8536.f13dff49.chunk.js +0 -1
  57. streamlit/static/static/js/main.3b0201f6.js +0 -2
  58. /streamlit/static/static/js/{4253.749d5244.chunk.js.LICENSE.txt → 1955.426e67ca.chunk.js.LICENSE.txt} +0 -0
  59. /streamlit/static/static/js/{2736.914069e5.chunk.js.LICENSE.txt → 329.464ed8ec.chunk.js.LICENSE.txt} +0 -0
  60. /streamlit/static/static/js/{7323.2808d029.chunk.js.LICENSE.txt → 7323.b74cc85b.chunk.js.LICENSE.txt} +0 -0
  61. /streamlit/static/static/js/{main.3b0201f6.js.LICENSE.txt → main.b84b6de2.js.LICENSE.txt} +0 -0
  62. {streamlit_nightly-1.34.1.dev20240505.data → streamlit_nightly-1.34.1.dev20240507.data}/scripts/streamlit.cmd +0 -0
  63. {streamlit_nightly-1.34.1.dev20240505.dist-info → streamlit_nightly-1.34.1.dev20240507.dist-info}/WHEEL +0 -0
  64. {streamlit_nightly-1.34.1.dev20240505.dist-info → streamlit_nightly-1.34.1.dev20240507.dist-info}/entry_points.txt +0 -0
  65. {streamlit_nightly-1.34.1.dev20240505.dist-info → streamlit_nightly-1.34.1.dev20240507.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[3513],{33513:(e,t,i)=>{i.r(t),i.d(t,{default:()=>r});i(66845);var l=i(81354),s=i(27446),a=i(9003),d=i(63730),n=i(40864);const r=function(e){const{disabled:t,element:i,widgetMgr:r,width:o,endpoints:u,fragmentId:c}=e,h={width:o},p="primary"===i.type?l.nW.PRIMARY:l.nW.SECONDARY,b=!i.help||o;return(0,n.jsx)("div",{className:"row-widget stDownloadButton","data-testid":"stDownloadButton",style:h,children:(0,n.jsx)(s.t,{help:i.help,children:(0,n.jsx)(a.ZP,{kind:p,size:l.V5.SMALL,disabled:t,onClick:()=>{r.setTriggerValue(i,{fromUi:!0},c);const e=document.createElement("a"),t=u.buildMediaURL(i.url);e.setAttribute("href",t),e.setAttribute("target","_self"),e.setAttribute("download",""),e.click()},fluidWidth:!!i.useContainerWidth&&b,children:(0,n.jsx)(d.ZP,{source:i.label,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})})})})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4113],{34113:(e,r,t)=>{t.r(r),t.d(r,{default:()=>f});var o=t(66845),a=t(46927),n=t(68411),l=t(27446),i=t(63730),s=t(66694),d=t(84457),c=t(1515);const g=(0,c.Z)("div",{target:"e11k5jya2"})((e=>{let{}=e;return{display:"flex",flexDirection:"column"}}),""),p=(0,c.Z)("a",{target:"e11k5jya1"})((e=>{let{disabled:r,isCurrentPage:t,fluidWidth:o,theme:a}=e;return{textDecoration:"none",width:"number"==typeof o?"".concat(o,"px"):"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:a.spacing.sm,borderRadius:a.spacing.twoXS,paddingLeft:a.spacing.sm,paddingRight:a.spacing.sm,marginTop:a.spacing.threeXS,marginBottom:a.spacing.threeXS,lineHeight:a.lineHeights.menuItem,backgroundColor:t?a.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:t?a.colors.darkenedBgMix25:a.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:a.colors.darkenedBgMix15},"@media print":{paddingLeft:a.spacing.none},...r?{borderColor:a.colors.fadedText10,backgroundColor:a.colors.transparent,color:a.colors.fadedText40,cursor:"not-allowed","&:hover":{color:a.colors.fadedText40,backgroundColor:a.colors.transparent}}:{}}}),""),u=(0,c.Z)("span",{target:"e11k5jya0"})((e=>{let{disabled:r,theme:t}=e;return{color:t.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:t.colors.fadedText10,backgroundColor:t.colors.transparent,color:t.colors.fadedText40,cursor:"not-allowed"}:{}}}),"");var h=t(40864);const f=function(e){const{onPageChange:r,currentPageScriptHash:t}=o.useContext(s.E),c=o.useContext(d.Z),{disabled:f,element:x,width:b}=e,k={width:b},m=function(e,r){return!(null!==e||!r)||!(null===e&&!r)&&!0===e}(x.useContainerWidth,c),C=t===x.pageScriptHash;return(0,h.jsx)("div",{className:"row-widget stPageLink","data-testid":"stPageLink",style:k,children:(0,h.jsx)(l.t,{help:x.help,placement:n.u.TOP_RIGHT,children:(0,h.jsx)(g,{children:(0,h.jsxs)(p,{"data-testid":"stPageLink-NavLink",disabled:f,isCurrentPage:C,fluidWidth:!!m&&b,href:x.page,target:x.external?"_blank":"",rel:"noreferrer",onClick:e=>{x.external?f&&e.preventDefault():(e.preventDefault(),f||r(x.pageScriptHash))},children:[x.icon&&(0,h.jsx)(a.S,{size:"lg",children:x.icon}),(0,h.jsx)(u,{disabled:f,children:(0,h.jsx)(i.ZP,{source:x.label,allowHTML:!1,isLabel:!0,boldLabel:C,largerLabel:!0,disableLinks:!0})})]})})})})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4477],{87814:(e,t,r)=>{r.d(t,{K:()=>n});var o=r(50641);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},74477:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ue});var o=r(66845),n=r(25621),i=r(80318),a=r(80745);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=0,p=1,d=2;function f(e){return e.$isActive?d:e.$isHovered?p:c}function h(e){var t=e.$theme.colors,r=e.$disabled,o=e.$checked,n=e.$isFocusVisible,i=e.$error;if(r)return t.tickFillDisabled;if(!o)return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;if(i)switch(f(e)){case c:return t.tickFillErrorSelected;case p:return t.tickFillErrorSelectedHover;case d:return t.tickFillErrorSelectedHoverActive}else switch(f(e)){case c:return t.tickFillSelected;case p:return t.tickFillSelectedHover;case d:return t.tickFillSelectedHoverActive}return null}function b(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(f(e)){case c:return t.tickFillError;case p:return t.tickFillErrorHover;case d:return t.tickFillErrorHoverActive}else switch(f(e)){case c:return t.tickFill;case p:return t.tickFillHover;case d:return t.tickFillActive}}function m(e){var t=e.$disabled,r=e.$theme.colors;return t?r.contentSecondary:r.contentPrimary}var v=(0,a.zo)("div",(function(e){var t=e.$disabled,r=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:"horizontal"===r?"row":"column",alignItems:"horizontal"===r?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}}));v.displayName="RadioGroupRoot",v.displayName="RadioGroupRoot";var y=(0,a.zo)("label",(function(e){var t,r=e.$disabled,o=e.$hasDescription,n=e.$labelPlacement,i=e.$theme,a=e.$align,s=i.sizing,l="horizontal"===a,c="rtl"===i.direction?"Left":"Right";return u(t={flexDirection:"top"===n||"bottom"===n?"column":"row",display:"flex",alignItems:"center",cursor:r?"not-allowed":"pointer",marginTop:s.scale200},"margin".concat(c),l?s.scale200:null),u(t,"marginBottom",o&&!l?null:s.scale200),t}));y.displayName="Root",y.displayName="Root";var g=(0,a.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{backgroundColor:b(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?o.scale200:o.scale550,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve,width:e.$checked?o.scale200:o.scale550}}));g.displayName="RadioMarkInner",g.displayName="RadioMarkInner";var w=(0,a.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{alignItems:"center",backgroundColor:h(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:o.scale700,justifyContent:"center",marginTop:o.scale0,marginRight:o.scale0,marginBottom:o.scale0,marginLeft:o.scale0,outline:"none",verticalAlign:"middle",width:o.scale700,flexShrink:0,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve}}));w.displayName="RadioMarkOuter",w.displayName="RadioMarkOuter";var R=(0,a.zo)("div",(function(e){var t=e.$theme.typography;return l(l({verticalAlign:"middle"},function(e){var t,r=e.$labelPlacement,o=void 0===r?"":r,n=e.$theme;switch(o){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="rtl"===n.direction?"Left":"Right";break;default:t="rtl"===n.direction?"Right":"Left"}var i=n.sizing.scale300;return u({},"padding".concat(t),i)}(e)),{},{color:m(e)},t.LabelMedium)}));R.displayName="Label",R.displayName="Label";var O=(0,a.zo)("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});O.displayName="Input",O.displayName="Input";var j=(0,a.zo)("div",(function(e){var t,r=e.$theme,o=e.$align,n="horizontal"===o,i="rtl"===r.direction?"Right":"Left",a="rtl"===r.direction?"Left":"Right";return l(l({},r.typography.ParagraphSmall),{},(u(t={color:r.colors.contentSecondary,cursor:"auto"},"margin".concat(i),"horizontal"===o?null:r.sizing.scale900),u(t,"margin".concat(a),n?r.sizing.scale200:null),u(t,"maxWidth","240px"),t))}));j.displayName="Description",j.displayName="Description";var k=r(17964);function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},M.apply(this,arguments)}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return $(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function S(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function x(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=L(e);if(t){var n=L(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===F(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,r)}}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var T=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(s,e);var t,r,n,a=x(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return I(E(e=a.call.apply(a,[this].concat(r))),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),I(E(e),"handleFocus",(function(t,r){(0,k.E)(t)&&e.setState({isFocusVisible:!0}),e.setState({focusedRadioIndex:r}),e.props.onFocus&&e.props.onFocus(t)})),I(E(e),"handleBlur",(function(t,r){!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1}),e.setState({focusedRadioIndex:-1}),e.props.onBlur&&e.props.onBlur(t)})),e}return t=s,(r=[{key:"render",value:function(){var e=this,t=this.props.overrides,r=void 0===t?{}:t,n=P((0,i.jb)(r.RadioGroupRoot,v),2),a=n[0],s=n[1];return o.createElement(a,M({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},s),o.Children.map(this.props.children,(function(t,r){if(!o.isValidElement(t))return null;var n=e.props.value===t.props.value;return o.cloneElement(t,{align:e.props.align,autoFocus:e.props.autoFocus,checked:n,disabled:e.props.disabled||t.props.disabled,error:e.props.error,isFocused:e.state.focusedRadioIndex===r,isFocusVisible:e.state.isFocusVisible,tabIndex:0===r&&!e.props.value||n?"0":"-1",labelPlacement:e.props.labelPlacement,name:e.props.name,onBlur:function(t){return e.handleBlur(t,r)},onFocus:function(t){return e.handleFocus(t,r)},onChange:e.props.onChange,onMouseEnter:e.props.onMouseEnter,onMouseLeave:e.props.onMouseLeave})})))}}])&&S(t.prototype,r),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);I(T,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});const B=T;var D="vertical",V="horizontal";function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},z.apply(this,arguments)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return H(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function U(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function N(e,t){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},N(e,t)}function W(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=G(e);if(t){var n=G(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===A(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return q(e)}(this,r)}}function q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var K=function(e){return e.stopPropagation()},J=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N(e,t)}(s,e);var t,r,n,a=W(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return Z(q(e=a.call.apply(a,[this].concat(r))),"state",{isActive:!1,isHovered:!1}),Z(q(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter&&e.props.onMouseEnter(t)})),Z(q(e),"onMouseLeave",(function(t){e.setState({isHovered:!1}),e.props.onMouseLeave&&e.props.onMouseLeave(t)})),Z(q(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown&&e.props.onMouseDown(t)})),Z(q(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp&&e.props.onMouseUp(t)})),e}return t=s,(r=[{key:"componentDidMount",value:function(){var e;this.props.autoFocus&&null!==(e=this.props.inputRef)&&void 0!==e&&e.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var e,t=this.props.overrides,r=void 0===t?{}:t,n=_((0,i.jb)(r.Root,y),2),a=n[0],s=n[1],l=_((0,i.jb)(r.Label,R),2),u=l[0],c=l[1],p=_((0,i.jb)(r.Input,O),2),d=p[0],f=p[1],h=_((0,i.jb)(r.Description,j),2),b=h[0],m=h[1],v=_((0,i.jb)(r.RadioMarkInner,g),2),k=v[0],F=v[1],M=_((0,i.jb)(r.RadioMarkOuter,w),2),P=M[0],$=M[1],S={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},C=o.createElement(u,z({},S,c),this.props.containsInteractiveElement?o.createElement("div",{onClick:function(e){return e.preventDefault()}},this.props.children):this.props.children);return o.createElement(o.Fragment,null,o.createElement(a,z({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},S,s),("top"===(e=this.props.labelPlacement)||"left"===e)&&C,o.createElement(P,z({},S,$),o.createElement(k,z({},S,F))),o.createElement(d,z({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:K,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},S,f)),function(e){return"bottom"===e||"right"===e}(this.props.labelPlacement)&&C),!!this.props.description&&o.createElement(b,z({},S,m),this.props.description))}}])&&U(t.prototype,r),n&&U(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);Z(J,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:o.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const Q=J;var X=r(98478),Y=r(86659),ee=r(8879),te=r(68411),re=r(21e3),oe=r(40864);class ne extends o.PureComponent{constructor(){var e;super(...arguments),this.state={value:null!==(e=this.props.value)&&void 0!==e?e:null},this.onChange=e=>{const t=parseInt(e.target.value,10);this.setState({value:t},(()=>this.props.onChange(t)))}}componentDidUpdate(e){e.value!==this.props.value&&this.props.value!==this.state.value&&this.setState(((e,t)=>{var r;return{value:null!==(r=t.value)&&void 0!==r?r:null}}))}render(){const{theme:e,width:t,help:r,label:o,horizontal:n,labelVisibility:i}=this.props;let{disabled:a}=this.props;const{colors:s,radii:l}=e,u={width:t},c=[...this.props.options],p=[...this.props.captions],d=p.length>0;return 0===c.length&&(c.push("No options to select."),a=!0),(0,oe.jsxs)("div",{className:"row-widget stRadio","data-testid":"stRadio",style:u,children:[(0,oe.jsx)(X.O,{label:o,disabled:a,labelVisibility:i,children:r&&(0,oe.jsx)(Y.Hp,{children:(0,oe.jsx)(ee.Z,{content:r,placement:te.u.TOP_RIGHT})})}),(0,oe.jsx)(B,{onChange:this.onChange,value:null!==this.state.value?this.state.value.toString():void 0,disabled:a,align:n?V:D,"aria-label":o,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:d?"0.5rem":"0"}}},children:c.map(((e,t)=>{return(0,oe.jsxs)(Q,{value:t.toString(),overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:0,marginTop:0,marginRight:d?"0.5rem":"1rem",paddingLeft:0,alignItems:"start",paddingRight:"2px",backgroundColor:t?s.darkenedBgMix25:"",borderTopLeftRadius:l.md,borderTopRightRadius:l.md,borderBottomLeftRadius:l.md,borderBottomRightRadius:l.md}}},RadioMarkOuter:{style:e=>{let{$checked:t}=e;return{width:"1rem",height:"1rem",marginTop:"0.35rem",marginRight:"0",backgroundColor:t&&!a?s.primary:s.fadedText40}}},RadioMarkInner:{style:e=>{let{$checked:t}=e;return{height:t?"6px":"14px",width:t?"6px":"14px"}}},Label:{style:{color:a?s.fadedText40:s.bodyText,position:"relative",top:"1px"}}},children:[(0,oe.jsx)(re.ZP,{source:e,allowHTML:!1,isLabel:!0,largerLabel:!0}),d&&(0,oe.jsx)(re.ZP,{source:(r=p[t],""==r&&n&&d?"&nbsp;":r),allowHTML:!1,isCaption:!0,isLabel:!0})]},t);var r}))})]})}}const ie=(0,n.b)(ne);var ae=r(87814),se=r(50641);class le extends o.PureComponent{constructor(){super(...arguments),this.formClearHelper=new ae.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:r,fragmentId:o}=this.props;t.setIntValue(r,this.state.value,e,o)},this.onFormCleared=()=>{this.setState(((e,t)=>{var r;return{value:null!==(r=t.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{this.setState({value:e},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){var e;const t=this.props.widgetMgr.getIntValue(this.props.element);return null!==(e=null!==t&&void 0!==t?t:this.props.element.default)&&void 0!==e?e:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==e&&void 0!==e?e:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){const{disabled:e,element:t,width:r,widgetMgr:o}=this.props,{horizontal:n,options:i,captions:a,label:s,labelVisibility:l,help:u}=t;return this.formClearHelper.manageFormClearListener(o,t.formId,this.onFormCleared),(0,oe.jsx)(ie,{label:s,onChange:this.onChange,options:i,captions:a,width:r,disabled:e,horizontal:n,labelVisibility:(0,se.iF)(null===l||void 0===l?void 0:l.value),value:this.state.value,help:u})}}const ue=le}}]);
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4477],{87814:(e,t,r)=>{r.d(t,{K:()=>n});var o=r(50641);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},74477:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ue});var o=r(66845),n=r(25621),i=r(80318),a=r(80745);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=0,p=1,d=2;function f(e){return e.$isActive?d:e.$isHovered?p:c}function h(e){var t=e.$theme.colors,r=e.$disabled,o=e.$checked,n=e.$isFocusVisible,i=e.$error;if(r)return t.tickFillDisabled;if(!o)return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;if(i)switch(f(e)){case c:return t.tickFillErrorSelected;case p:return t.tickFillErrorSelectedHover;case d:return t.tickFillErrorSelectedHoverActive}else switch(f(e)){case c:return t.tickFillSelected;case p:return t.tickFillSelectedHover;case d:return t.tickFillSelectedHoverActive}return null}function b(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(f(e)){case c:return t.tickFillError;case p:return t.tickFillErrorHover;case d:return t.tickFillErrorHoverActive}else switch(f(e)){case c:return t.tickFill;case p:return t.tickFillHover;case d:return t.tickFillActive}}function m(e){var t=e.$disabled,r=e.$theme.colors;return t?r.contentSecondary:r.contentPrimary}var v=(0,a.zo)("div",(function(e){var t=e.$disabled,r=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:"horizontal"===r?"row":"column",alignItems:"horizontal"===r?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}}));v.displayName="RadioGroupRoot",v.displayName="RadioGroupRoot";var y=(0,a.zo)("label",(function(e){var t,r=e.$disabled,o=e.$hasDescription,n=e.$labelPlacement,i=e.$theme,a=e.$align,s=i.sizing,l="horizontal"===a,c="rtl"===i.direction?"Left":"Right";return u(t={flexDirection:"top"===n||"bottom"===n?"column":"row",display:"flex",alignItems:"center",cursor:r?"not-allowed":"pointer",marginTop:s.scale200},"margin".concat(c),l?s.scale200:null),u(t,"marginBottom",o&&!l?null:s.scale200),t}));y.displayName="Root",y.displayName="Root";var g=(0,a.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{backgroundColor:b(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?o.scale200:o.scale550,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve,width:e.$checked?o.scale200:o.scale550}}));g.displayName="RadioMarkInner",g.displayName="RadioMarkInner";var w=(0,a.zo)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{alignItems:"center",backgroundColor:h(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:o.scale700,justifyContent:"center",marginTop:o.scale0,marginRight:o.scale0,marginBottom:o.scale0,marginLeft:o.scale0,outline:"none",verticalAlign:"middle",width:o.scale700,flexShrink:0,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve}}));w.displayName="RadioMarkOuter",w.displayName="RadioMarkOuter";var R=(0,a.zo)("div",(function(e){var t=e.$theme.typography;return l(l({verticalAlign:"middle"},function(e){var t,r=e.$labelPlacement,o=void 0===r?"":r,n=e.$theme;switch(o){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="rtl"===n.direction?"Left":"Right";break;default:t="rtl"===n.direction?"Right":"Left"}var i=n.sizing.scale300;return u({},"padding".concat(t),i)}(e)),{},{color:m(e)},t.LabelMedium)}));R.displayName="Label",R.displayName="Label";var O=(0,a.zo)("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});O.displayName="Input",O.displayName="Input";var j=(0,a.zo)("div",(function(e){var t,r=e.$theme,o=e.$align,n="horizontal"===o,i="rtl"===r.direction?"Right":"Left",a="rtl"===r.direction?"Left":"Right";return l(l({},r.typography.ParagraphSmall),{},(u(t={color:r.colors.contentSecondary,cursor:"auto"},"margin".concat(i),"horizontal"===o?null:r.sizing.scale900),u(t,"margin".concat(a),n?r.sizing.scale200:null),u(t,"maxWidth","240px"),t))}));j.displayName="Description",j.displayName="Description";var k=r(17964);function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},M.apply(this,arguments)}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return $(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function S(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function x(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=L(e);if(t){var n=L(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===F(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,r)}}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var T=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(s,e);var t,r,n,a=x(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return I(E(e=a.call.apply(a,[this].concat(r))),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),I(E(e),"handleFocus",(function(t,r){(0,k.E)(t)&&e.setState({isFocusVisible:!0}),e.setState({focusedRadioIndex:r}),e.props.onFocus&&e.props.onFocus(t)})),I(E(e),"handleBlur",(function(t,r){!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1}),e.setState({focusedRadioIndex:-1}),e.props.onBlur&&e.props.onBlur(t)})),e}return t=s,(r=[{key:"render",value:function(){var e=this,t=this.props.overrides,r=void 0===t?{}:t,n=P((0,i.jb)(r.RadioGroupRoot,v),2),a=n[0],s=n[1];return o.createElement(a,M({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},s),o.Children.map(this.props.children,(function(t,r){if(!o.isValidElement(t))return null;var n=e.props.value===t.props.value;return o.cloneElement(t,{align:e.props.align,autoFocus:e.props.autoFocus,checked:n,disabled:e.props.disabled||t.props.disabled,error:e.props.error,isFocused:e.state.focusedRadioIndex===r,isFocusVisible:e.state.isFocusVisible,tabIndex:0===r&&!e.props.value||n?"0":"-1",labelPlacement:e.props.labelPlacement,name:e.props.name,onBlur:function(t){return e.handleBlur(t,r)},onFocus:function(t){return e.handleFocus(t,r)},onChange:e.props.onChange,onMouseEnter:e.props.onMouseEnter,onMouseLeave:e.props.onMouseLeave})})))}}])&&S(t.prototype,r),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);I(T,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});const B=T;var D="vertical",V="horizontal";function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},z.apply(this,arguments)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return H(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function U(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function N(e,t){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},N(e,t)}function W(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=G(e);if(t){var n=G(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===A(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return q(e)}(this,r)}}function q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var K=function(e){return e.stopPropagation()},J=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N(e,t)}(s,e);var t,r,n,a=W(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return Z(q(e=a.call.apply(a,[this].concat(r))),"state",{isActive:!1,isHovered:!1}),Z(q(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter&&e.props.onMouseEnter(t)})),Z(q(e),"onMouseLeave",(function(t){e.setState({isHovered:!1}),e.props.onMouseLeave&&e.props.onMouseLeave(t)})),Z(q(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown&&e.props.onMouseDown(t)})),Z(q(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp&&e.props.onMouseUp(t)})),e}return t=s,(r=[{key:"componentDidMount",value:function(){var e;this.props.autoFocus&&null!==(e=this.props.inputRef)&&void 0!==e&&e.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var e,t=this.props.overrides,r=void 0===t?{}:t,n=_((0,i.jb)(r.Root,y),2),a=n[0],s=n[1],l=_((0,i.jb)(r.Label,R),2),u=l[0],c=l[1],p=_((0,i.jb)(r.Input,O),2),d=p[0],f=p[1],h=_((0,i.jb)(r.Description,j),2),b=h[0],m=h[1],v=_((0,i.jb)(r.RadioMarkInner,g),2),k=v[0],F=v[1],M=_((0,i.jb)(r.RadioMarkOuter,w),2),P=M[0],$=M[1],S={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},C=o.createElement(u,z({},S,c),this.props.containsInteractiveElement?o.createElement("div",{onClick:function(e){return e.preventDefault()}},this.props.children):this.props.children);return o.createElement(o.Fragment,null,o.createElement(a,z({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},S,s),("top"===(e=this.props.labelPlacement)||"left"===e)&&C,o.createElement(P,z({},S,$),o.createElement(k,z({},S,F))),o.createElement(d,z({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:K,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},S,f)),function(e){return"bottom"===e||"right"===e}(this.props.labelPlacement)&&C),!!this.props.description&&o.createElement(b,z({},S,m),this.props.description))}}])&&U(t.prototype,r),n&&U(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);Z(J,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:o.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const Q=J;var X=r(98478),Y=r(86659),ee=r(8879),te=r(68411),re=r(63730),oe=r(40864);class ne extends o.PureComponent{constructor(){var e;super(...arguments),this.state={value:null!==(e=this.props.value)&&void 0!==e?e:null},this.onChange=e=>{const t=parseInt(e.target.value,10);this.setState({value:t},(()=>this.props.onChange(t)))}}componentDidUpdate(e){e.value!==this.props.value&&this.props.value!==this.state.value&&this.setState(((e,t)=>{var r;return{value:null!==(r=t.value)&&void 0!==r?r:null}}))}render(){const{theme:e,width:t,help:r,label:o,horizontal:n,labelVisibility:i}=this.props;let{disabled:a}=this.props;const{colors:s,radii:l}=e,u={width:t},c=[...this.props.options],p=[...this.props.captions],d=p.length>0;return 0===c.length&&(c.push("No options to select."),a=!0),(0,oe.jsxs)("div",{className:"row-widget stRadio","data-testid":"stRadio",style:u,children:[(0,oe.jsx)(X.O,{label:o,disabled:a,labelVisibility:i,children:r&&(0,oe.jsx)(Y.Hp,{children:(0,oe.jsx)(ee.Z,{content:r,placement:te.u.TOP_RIGHT})})}),(0,oe.jsx)(B,{onChange:this.onChange,value:null!==this.state.value?this.state.value.toString():void 0,disabled:a,align:n?V:D,"aria-label":o,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:d?"0.5rem":"0"}}},children:c.map(((e,t)=>{return(0,oe.jsxs)(Q,{value:t.toString(),overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:0,marginTop:0,marginRight:d?"0.5rem":"1rem",paddingLeft:0,alignItems:"start",paddingRight:"2px",backgroundColor:t?s.darkenedBgMix25:"",borderTopLeftRadius:l.md,borderTopRightRadius:l.md,borderBottomLeftRadius:l.md,borderBottomRightRadius:l.md}}},RadioMarkOuter:{style:e=>{let{$checked:t}=e;return{width:"1rem",height:"1rem",marginTop:"0.35rem",marginRight:"0",backgroundColor:t&&!a?s.primary:s.fadedText40}}},RadioMarkInner:{style:e=>{let{$checked:t}=e;return{height:t?"6px":"14px",width:t?"6px":"14px"}}},Label:{style:{color:a?s.fadedText40:s.bodyText,position:"relative",top:"1px"}}},children:[(0,oe.jsx)(re.ZP,{source:e,allowHTML:!1,isLabel:!0,largerLabel:!0}),d&&(0,oe.jsx)(re.ZP,{source:(r=p[t],""==r&&n&&d?"&nbsp;":r),allowHTML:!1,isCaption:!0,isLabel:!0})]},t);var r}))})]})}}const ie=(0,n.b)(ne);var ae=r(87814),se=r(50641);class le extends o.PureComponent{constructor(){super(...arguments),this.formClearHelper=new ae.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:r,fragmentId:o}=this.props;t.setIntValue(r,this.state.value,e,o)},this.onFormCleared=()=>{this.setState(((e,t)=>{var r;return{value:null!==(r=t.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{this.setState({value:e},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){var e;const t=this.props.widgetMgr.getIntValue(this.props.element);return null!==(e=null!==t&&void 0!==t?t:this.props.element.default)&&void 0!==e?e:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==e&&void 0!==e?e:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){const{disabled:e,element:t,width:r,widgetMgr:o}=this.props,{horizontal:n,options:i,captions:a,label:s,labelVisibility:l,help:u}=t;return this.formClearHelper.manageFormClearListener(o,t.formId,this.onFormCleared),(0,oe.jsx)(ie,{label:s,onChange:this.onChange,options:i,captions:a,width:r,disabled:e,horizontal:n,labelVisibility:(0,se.iF)(null===l||void 0===l?void 0:l.value),value:this.state.value,help:u})}}const ue=le}}]);