streamlit-nightly 1.32.3.dev20240326__py2.py3-none-any.whl → 1.32.3.dev20240328__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/__init__.py +4 -2
- streamlit/components/v1/__init__.py +3 -17
- streamlit/components/v1/{custom_component.py → components.py} +159 -11
- streamlit/delta_generator.py +3 -0
- streamlit/elements/widgets/time_widgets.py +5 -21
- streamlit/errors.py +0 -6
- streamlit/proto/AutoRerun_pb2.py +25 -0
- streamlit/proto/AutoRerun_pb2.pyi +48 -0
- streamlit/proto/ClientState_pb2.py +3 -3
- streamlit/proto/ClientState_pb2.pyi +4 -1
- streamlit/proto/Delta_pb2.py +2 -2
- streamlit/proto/Delta_pb2.pyi +4 -1
- streamlit/proto/ForwardMsg_pb2.py +10 -9
- streamlit/proto/ForwardMsg_pb2.pyi +12 -3
- streamlit/proto/NewSession_pb2.py +24 -24
- streamlit/proto/NewSession_pb2.pyi +8 -1
- streamlit/proto/PageProfile_pb2.py +6 -6
- streamlit/proto/PageProfile_pb2.pyi +4 -1
- streamlit/runtime/app_session.py +67 -24
- streamlit/runtime/caching/cache_data_api.py +3 -3
- streamlit/runtime/caching/cache_resource_api.py +2 -2
- streamlit/runtime/fragment.py +239 -0
- streamlit/runtime/metrics_util.py +17 -9
- streamlit/runtime/runtime.py +6 -12
- streamlit/runtime/scriptrunner/script_requests.py +53 -37
- streamlit/runtime/scriptrunner/script_run_context.py +15 -2
- streamlit/runtime/scriptrunner/script_runner.py +63 -14
- streamlit/runtime/state/common.py +2 -0
- streamlit/runtime/state/session_state.py +51 -7
- streamlit/runtime/state/widgets.py +10 -2
- streamlit/static/asset-manifest.json +19 -19
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/1074.73973756.chunk.js +1 -0
- streamlit/static/static/js/1451.3b0a3e31.chunk.js +1 -0
- streamlit/static/static/js/1792.b8efa879.chunk.js +1 -0
- streamlit/static/static/js/{3092.3d4df25e.chunk.js → 3092.ad569cc8.chunk.js} +1 -1
- streamlit/static/static/js/3513.e3e7300a.chunk.js +1 -0
- streamlit/static/static/js/4177.69f9f18d.chunk.js +1 -0
- streamlit/static/static/js/4319.a6745434.chunk.js +1 -0
- streamlit/static/static/js/{4477.2555c11a.chunk.js → 4477.e10e4373.chunk.js} +1 -1
- streamlit/static/static/js/{4666.99f3abc3.chunk.js → 4666.b694c5a9.chunk.js} +1 -1
- streamlit/static/static/js/5106.44f0ff51.chunk.js +1 -0
- streamlit/static/static/js/5379.6571574f.chunk.js +1 -0
- streamlit/static/static/js/6013.8e80e091.chunk.js +1 -0
- streamlit/static/static/js/6718.802da17e.chunk.js +1 -0
- streamlit/static/static/js/7175.be4076bc.chunk.js +1 -0
- streamlit/static/static/js/{7602.f0420392.chunk.js → 7602.6175e969.chunk.js} +1 -1
- streamlit/static/static/js/{8492.e6dab83f.chunk.js → 8492.f56c9d4c.chunk.js} +1 -1
- streamlit/static/static/js/8691.9ccf7f89.chunk.js +1 -0
- streamlit/static/static/js/main.722453f0.js +2 -0
- streamlit/testing/v1/local_script_runner.py +2 -0
- streamlit/time_util.py +88 -0
- streamlit/web/server/component_request_handler.py +2 -2
- streamlit/web/server/server.py +2 -1
- {streamlit_nightly-1.32.3.dev20240326.dist-info → streamlit_nightly-1.32.3.dev20240328.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.32.3.dev20240326.dist-info → streamlit_nightly-1.32.3.dev20240328.dist-info}/RECORD +61 -63
- streamlit/components/lib/__init__.py +0 -13
- streamlit/components/lib/local_component_registry.py +0 -82
- streamlit/components/types/__init__.py +0 -13
- streamlit/components/types/base_component_registry.py +0 -98
- streamlit/components/types/base_custom_component.py +0 -137
- streamlit/components/v1/component_registry.py +0 -103
- streamlit/static/static/js/1074.71719df6.chunk.js +0 -1
- streamlit/static/static/js/1451.e3be1711.chunk.js +0 -1
- streamlit/static/static/js/1792.16c16498.chunk.js +0 -1
- streamlit/static/static/js/3513.57cff89c.chunk.js +0 -1
- streamlit/static/static/js/4177.ab9a7aa1.chunk.js +0 -1
- streamlit/static/static/js/4319.213fc321.chunk.js +0 -1
- streamlit/static/static/js/5106.22187bfc.chunk.js +0 -1
- streamlit/static/static/js/5379.e466522d.chunk.js +0 -1
- streamlit/static/static/js/6013.75c92264.chunk.js +0 -1
- streamlit/static/static/js/6718.97945fc6.chunk.js +0 -1
- streamlit/static/static/js/7175.8c1b4d38.chunk.js +0 -1
- streamlit/static/static/js/8691.24a5792f.chunk.js +0 -1
- streamlit/static/static/js/main.7fde7092.js +0 -2
- /streamlit/static/static/js/{main.7fde7092.js.LICENSE.txt → main.722453f0.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.32.3.dev20240326.data → streamlit_nightly-1.32.3.dev20240328.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.32.3.dev20240326.dist-info → streamlit_nightly-1.32.3.dev20240328.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.32.3.dev20240326.dist-info → streamlit_nightly-1.32.3.dev20240328.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.32.3.dev20240326.dist-info → streamlit_nightly-1.32.3.dev20240328.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5379],{79986:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),s=r(50669),a=r(1515);const l=(0,r(7865).F4)(n||(n=(0,s.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),u=(0,a.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var c=r(40864);const d=e=>{let{dirty:t,value:r,maxLength:n,className:s,type:a="single",inForm:l}=e;const d=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,c.jsx)(u,{includeDot:d.length>0,shouldBlink:t,children:e},d.length))};if(t){const e=l?"submit form":"apply";if("multiline"===a){const t=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(t,"+Enter to ").concat(e))}else"single"===a&&p("Press Enter to ".concat(e))}return n&&("chat"!==a||t)&&p("".concat(r.length,"/").concat(n),t&&r.length>=n),(0,c.jsx)(i.X7,{"data-testid":"InputInstructions",className:s,children:d})}},87814:(e,t,r)=>{"use strict";r.d(t,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},35379:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var n=r(66845),o=r(87814),i=r(118),s=r(79986),a=r(98478),l=r(86659),u=r(8879),c=r(68411),d=r(50641),p=r(48266);const f=(0,r(1515).Z)("div",{target:"ezh4s2r0"})({name:"1om1ktf",styles:"div{border-width:1px;}"});var h=r(70479),m=r.n(h),y=r(40864);class b extends n.PureComponent{get initialValue(){var e;const t=this.props.widgetMgr.getStringValue(this.props.element);return null!==(e=null!==t&&void 0!==t?t:this.props.element.default)&&void 0!==e?e:null}constructor(e){super(e),this.formClearHelper=new o.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:r,fragmentId:n}=this.props;t.setStringValue(r,this.state.value,e,n),this.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((e,t)=>{var r;return{value:null!==(r=t.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=e=>{const{value:t}=e.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&t.length>n||this.setState({dirty:!0,value:t})},this.isEnterKeyPressed=e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))},this.onKeyDown=e=>{const{metaKey:t,ctrlKey:r}=e,{dirty:n}=this.state;if(this.isEnterKeyPressed(e)&&(r||t)&&n){e.preventDefault(),this.commitWidgetValue({fromUi:!0});const{formId:t}=this.props.element;(0,d.$b)({formId:t})&&this.props.widgetMgr.submitForm(this.props.element.formId)}},this.id=m()("text_area_")}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==e&&void 0!==e?e:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{element:t,disabled:r,width:n,widgetMgr:o}=this.props,{value:h,dirty:m}=this.state,b={width:n},{height:v,placeholder:g}=t;return this.formClearHelper.manageFormClearListener(o,t.formId,this.onFormCleared),(0,y.jsxs)("div",{className:"stTextArea","data-testid":"stTextArea",style:b,children:[(0,y.jsx)(a.O,{label:t.label,disabled:r,labelVisibility:(0,d.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),htmlFor:this.id,children:t.help&&(0,y.jsx)(l.dT,{children:(0,y.jsx)(u.Z,{content:t.help,placement:c.u.TOP_RIGHT})})}),(0,y.jsx)(f,{children:(0,y.jsx)(i.Z,{value:null!==h&&void 0!==h?h:"",placeholder:g,onBlur:this.onBlur,onChange:this.onChange,onKeyDown:this.onKeyDown,"aria-label":t.label,disabled:r,id:this.id,overrides:{Input:{style:{lineHeight:"1.4",height:v?"".concat(v,"px"):"",minHeight:"95px",resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:"1rem",paddingLeft:"1rem",paddingBottom:"1rem",paddingTop:"1rem"}}}})}),n>p.A.hideWidgetDetails&&(0,y.jsx)(s.Z,{dirty:m,value:null!==h&&void 0!==h?h:"",maxLength:t.maxChars,type:"multiline",inForm:(0,d.$b)({formId:t.formId})})]})}}const v=b},118:(e,t,r)=>{"use strict";r.d(t,{Z:()=>F});var n=r(66845),o=r(80318),i=r(9656),s=r(38254),a=r(80745),l=r(98479);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,a.zo)("div",(function(e){return c(c({},(0,l.d5)(c(c({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,a.zo)("div",(function(e){return(0,l.hB)(c({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,a.zo)("textarea",(function(e){return c(c({},(0,l.Hx)(e)),{},{resize:e.$resize||"none"})}));function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=x(e);if(t){var o=x(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===m(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return j(e)}(this,r)}}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},x(e)}function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var C=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}(u,e);var t,r,a,l=w(u);function u(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return P(j(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),P(j(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),P(j(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=u,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),a=r[0],l=r[1],u=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(a,y({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.Z,y({},this.props,{type:s.iB.textarea,overrides:u,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&g(t.prototype,r),a&&g(t,a),Object.defineProperty(t,"prototype",{writable:!1}),u}(n.Component);P(C,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:s.NO.default});const F=C},70479:(e,t,r)=>{var n=r(38145),o=0;e.exports=function(e){var t=++o;return n(e)+t}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6013],{79986:(e,t,r)=>{r.d(t,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),a=r(50669),s=r(1515);const l=(0,r(7865).F4)(n||(n=(0,a.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),c=(0,s.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var u=r(40864);const d=e=>{let{dirty:t,value:r,maxLength:n,className:a,type:s="single",inForm:l}=e;const d=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,u.jsx)(c,{includeDot:d.length>0,shouldBlink:t,children:e},d.length))};if(t){const e=l?"submit form":"apply";if("multiline"===s){const t=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(t,"+Enter to ").concat(e))}else"single"===s&&p("Press Enter to ".concat(e))}return n&&("chat"!==s||t)&&p("".concat(r.length,"/").concat(n),t&&r.length>=n),(0,u.jsx)(i.X7,{"data-testid":"InputInstructions",className:a,children:d})}},46013:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var n=r(66845),o=r(25621),i=r(25773),a=r(69),s=n.forwardRef((function(e,t){return n.createElement(a.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))}));s.displayName="Send";var l=r(118),c=r(46927),u=r(79986),d=r(92627),p=r(48266),f=r(1515);const h=(0,f.Z)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.lg,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:"".concat(n,"px")}}),""),y=(0,f.Z)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.lg,display:"flex",alignItems:"center"}}),""),g=(0,f.Z)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.Iy)(t),[i,a]=o?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?t.radii.none:t.radii.lg,borderTopLeftRadius:n?t.radii.lg:t.radii.none,borderBottomRightRadius:t.radii.lg,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,margin:0,padding:t.spacing.sm,color:r?i:a,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:o?t.colors.gray10:t.colors.gray90},"&:hover":{backgroundColor:t.colors.primary,color:t.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),""),b=(0,f.Z)("div",{target:"e1d2x3se1"})((()=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:"0px",pointerEvents:"none"})),""),m=(0,f.Z)("div",{target:"e1d2x3se0"})({name:"1lm6gnd",styles:"position:absolute;bottom:0px;right:3rem"});var v=r(40864);const x=function(e){let{width:t,element:r,widgetMgr:i,fragmentId:a}=e;const f=(0,o.u)(),[x,w]=(0,n.useState)(!1),[O,j]=(0,n.useState)(r.default),[C,S]=(0,n.useState)(0),P=(0,n.useRef)(null),R=(0,n.useRef)({minHeight:0,maxHeight:0}),k=()=>{O&&(i.setStringTriggerValue(r,O,{fromUi:!0},a),w(!1),j(""),S(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";j(e),w(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(P.current){const{offsetHeight:e}=P.current;R.current.minHeight=e,R.current.maxHeight=6.5*e}}),[P]);const{disabled:I,placeholder:E,maxChars:B}=r,T=(0,d.Iy)(f),{minHeight:F,maxHeight:Z}=R.current,z=T?f.colors.gray70:f.colors.gray80,A=!!(C>0&&P.current)&&Math.abs(C-F)>1;return(0,v.jsx)(h,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,v.jsxs)(y,{children:[(0,v.jsx)(l.Z,{inputRef:P,value:O,placeholder:E,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(w(""!==t),j(t),S((()=>{let e=0;const{current:t}=P;if(t){const r=t.placeholder;t.placeholder="",t.style.height="auto",e=t.scrollHeight,t.placeholder=r,t.style.height=""}return e})()))},onKeyDown:e=>{const{metaKey:t,ctrlKey:r,shiftKey:n}=e;(e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))})(e)&&!n&&!r&&!t&&(e.preventDefault(),k())},"aria-label":E,disabled:I,rows:1,overrides:{Root:{style:{outline:"none",backgroundColor:f.colors.transparent,borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",width:"".concat(t,"px")}},InputContainer:{style:{backgroundColor:f.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:"1.4",backgroundColor:f.colors.transparent,"::placeholder":{color:z},height:A?"".concat(C+1,"px"):"auto",maxHeight:Z?"".concat(Z,"px"):"none",paddingRight:"3rem",paddingLeft:f.spacing.sm,paddingBottom:f.spacing.sm,paddingTop:f.spacing.sm}}}}),t>p.A.hideWidgetDetails&&(0,v.jsx)(m,{children:(0,v.jsx)(u.Z,{dirty:x,value:O,maxLength:B,type:"chat",inForm:!1})}),(0,v.jsx)(b,{children:(0,v.jsx)(g,{onClick:k,disabled:!x||I,extended:A,"data-testid":"stChatInputSubmitButton",children:(0,v.jsx)(c.Z,{content:s,size:"xl",color:"inherit"})})})]})})}},118:(e,t,r)=>{r.d(t,{Z:()=>P});var n=r(66845),o=r(80318),i=r(9656),a=r(38254),s=r(80745),l=r(98479);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,s.zo)("div",(function(e){return u(u({},(0,l.d5)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.zo)("div",(function(e){return(0,l.hB)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.zo)("textarea",(function(e){return u(u({},(0,l.Hx)(e)),{},{resize:e.$resize||"none"})}));function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){s=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,r)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(c,e);var t,r,s,l=w(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(O(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),C(O(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),C(O(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=c,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),s=r[0],l=r[1],c=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(s,g({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.Z,g({},this.props,{type:a.iB.textarea,overrides:c,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),s&&v(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(n.Component);C(S,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:a.NO.default});const P=S}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6718],{87814:(e,t,r)=>{r.d(t,{K:()=>n});var o=r(50641);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},36718:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var o=r(66845),n=r(97142),i=r(27420),l=r(90481),a=r(25621),s=r(87814),u=r(98478),d=r(86659),c=r(8879),p=r(68411),f=r(50641);const b=(0,r(1515).Z)("div",{target:"e1ipygm10"})((()=>({position:"absolute",top:"50%",right:"2.05em"})),"");var y=r(40864);class g extends o.PureComponent{constructor(){super(...arguments),this.formClearHelper=new s.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:r,fragmentId:o}=this.props;t.setStringValue(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.handleChange=e=>{let t;t=null===e?null:this.dateToString(e),this.setState({value:t},(()=>this.commitWidgetValue({fromUi:!0})))},this.stringToDate=e=>{if(null===e)return null;const[t,r]=e.split(":").map(Number),o=new Date;return o.setHours(t),o.setMinutes(r),o},this.dateToString=e=>{const t=e.getHours().toString().padStart(2,"0"),r=e.getMinutes().toString().padStart(2,"0");return"".concat(t,":").concat(r)}}get initialValue(){var e;const t=this.props.widgetMgr.getStringValue(this.props.element);return null!==(e=null!==t&&void 0!==t?t:this.props.element.default)&&void 0!==e?e:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==e&&void 0!==e?e:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{disabled:t,width:r,element:o,widgetMgr:a,theme:s}=this.props,g=(0,f.le)(o.default)&&!t,m={width:r},h={Select:{props:{disabled:t,overrides:{ControlContainer:{style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}},IconsContainer:{style:()=>({paddingRight:".5rem"})},ValueContainer:{style:()=>({paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"})},SingleValue:{props:{"data-testid":"stTimeInput-timeDisplay"}},Dropdown:{style:()=>({paddingTop:0,paddingBottom:0})},Popover:{props:{overrides:{Body:{style:()=>({marginTop:"1px"})}}}},SelectArrow:{component:l.Z,props:{overrides:{Svg:{style:()=>({width:s.iconSizes.xl,height:s.iconSizes.xl})}}}}}}}};return this.formClearHelper.manageFormClearListener(a,o.formId,this.onFormCleared),(0,y.jsxs)("div",{className:"stTimeInput","data-testid":"stTimeInput",style:m,children:[(0,y.jsx)(u.O,{label:o.label,disabled:t,labelVisibility:(0,f.iF)(null===(e=o.labelVisibility)||void 0===e?void 0:e.value),children:o.help&&(0,y.jsx)(d.dT,{children:(0,y.jsx)(c.Z,{content:o.help,placement:p.u.TOP_RIGHT})})}),(0,y.jsx)(n.Z,{format:"24",step:o.step?Number(o.step):900,value:(0,f.le)(this.state.value)?void 0:this.stringToDate(this.state.value),onChange:this.handleChange,overrides:h,nullable:g,creatable:!0,"aria-label":o.label}),g&&!(0,f.le)(this.state.value)&&(0,y.jsx)(b,{onClick:()=>{this.handleChange(null)},"data-testid":"stTimeInputClearButton",children:(0,y.jsx)(i.i,{overrides:{Svg:{style:{color:s.colors.darkGray,transform:"scale(1.41)",width:s.spacing.twoXL,":hover":{fill:s.colors.bodyText}}}},$isFocusVisible:!1})})]})}}const m=(0,a.b)(g)},71077:(e,t,r)=>{r.r(t),r.d(t,{ThemeConsumer:()=>l,ThemeProvider:()=>o.Z,createThemedStyled:()=>n.Tp,createThemedUseStyletron:()=>n.fj,createThemedWithStyle:()=>n.o4,expandBorderStyles:()=>i.Qj,hexToRgb:()=>i.oo,styled:()=>n.zo,useStyletron:()=>n.hQ,withStyle:()=>n.w1,withWrapper:()=>n.Le});var o=r(42274),n=r(80745),i=r(30067),l=o.N.Consumer},92990:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getOverride=f,t.getOverrideProps=b,t.getOverrides=g,t.mergeConfigurationOverrides=h,t.mergeOverride=m,t.mergeOverrides=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object.assign({},e,t);return Object.keys(r).reduce((function(r,o){return r[o]=m(y(e[o]),y(t[o])),r}),{})},t.toObjectOverride=y,t.useOverrides=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.useMemo((function(){return Object.keys(e).reduce((function(r,o){return r[o]=g(t[o],e[o]),r}),{})}),[t])};var o,n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==p(e)&&"function"!==typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=n?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,r&&r.set(e,o);return o}(r(66845)),i=r(75738),l=(o=r(70924))&&o.__esModule?o:{default:o};function a(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},s.apply(this,arguments)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(e){return(0,i.isValidElementType)(e)?e:e&&"object"===p(e)?e.component:e}function b(e){return e&&"object"===p(e)?"object"===p(e.props)?d(d({},e.props),{},{$style:e.style}):{$style:e.style}:{}}function y(e){return(0,i.isValidElementType)(e)?{component:e}:e||{}}function g(e,t){var r=f(e)||t;if(e&&"object"===p(e)&&"function"===typeof e.props){0;var o=n.forwardRef((function(t,o){var i=e.props(t),l=b(d(d({},e),{},{props:i}));return n.createElement(r,s({ref:o},l))}));return o.displayName=r.displayName,[o,{}]}var i=b(e);return[r,i]}function m(e,t){var r=d(d({},e),t);return e.props&&t.props&&(r.props=h(e.props,t.props)),e.style&&t.style&&(r.style=h(e.style,t.style)),r}function h(e,t){return"object"===p(e)&&"object"===p(t)?(0,l.default)({},e,t):function(){return(0,l.default)({},"function"===typeof e?e.apply(void 0,arguments):e,"function"===typeof t?t.apply(void 0,arguments):t)}}},13373:(e,t,r)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!==typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var a=i?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(n,l,a):n[l]=e[l]}n.default=e,r&&r.set(e,n);return n}(r(66845)),l=r(71077),a=r(92990),s=(n=r(86737))&&n.__esModule?n:{default:n},u=["title","size","color","overrides"];function d(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},c.apply(this,arguments)}function p(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);l=!0);}catch(s){a=!0,n=s}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function y(e,t){var r=f((0,l.useStyletron)(),2)[1],o=e.title,n=void 0===o?"Delete Alt":o,d=e.size,b=e.color,y=e.overrides,g=void 0===y?{}:y,m=p(e,u),h=(0,a.mergeOverride)({component:r.icons&&r.icons.DeleteAlt?r.icons.DeleteAlt:null},g&&g.Svg?(0,a.toObjectOverride)(g.Svg):{});return i.createElement(s.default,c({viewBox:"0 0 24 24",ref:t,title:n,size:d,color:b,overrides:{Svg:h}},m),i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"}))}var g=i.forwardRef(y);t.default=g},86737:(e,t,r)=>{function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!==typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var a=i?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(n,l,a):n[l]=e[l]}n.default=e,r&&r.set(e,n);return n}(r(66845)),l=r(92990),a=r(61637),s=(n=r(72620))&&n.__esModule?n:{default:n},u=["children","title","size","color","overrides"];function d(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},c.apply(this,arguments)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);l=!0);}catch(s){a=!0,n=s}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function m(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var h=function(e,t){var r=e.children,o=e.title,n=e.size,d=e.color,p=e.overrides,b=void 0===p?{}:p,g=m(e,u),h=y((0,l.getOverrides)(b.Svg,a.Svg),2),v=h[0],O=h[1],S=v.__STYLETRON__?f(f({title:o,$color:d,$size:n},g),O):f(f({title:o,color:d,size:n},(0,s.default)(g)),(0,s.default)(O));return i.createElement(v,c({"data-baseweb":"icon",ref:t},S),o?i.createElement("title",null,o):null,r)},v=i.forwardRef(h);t.default=v},72620:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={};for(var r in e)"$"!==r[0]&&(t[r]=e[r]);return t}},61637:(e,t,r)=>{function o(e){var t=e.$theme,r=e.$size,o=e.$color,n=t.sizing.scale600;r&&(n=t.sizing[r]?t.sizing[r]:"number"===typeof r?"".concat(r,"px"):r);var i="currentColor";return o&&(i=t.colors[o]?t.colors[o]:o),{display:"inline-block",fill:i,color:i,height:n,width:n}}Object.defineProperty(t,"__esModule",{value:!0}),t.Svg=void 0,t.getSvgStyles=o;var n=(0,r(71077).styled)("svg",o);t.Svg=n,n.displayName="Svg",n.displayName="Svg"},80912:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.STATE_CHANGE_TYPE=t.SIZE=t.ENHANCER_POSITION=t.CUSTOM_INPUT_TYPE=t.ADJOINED=void 0;t.STATE_CHANGE_TYPE={change:"change"};t.CUSTOM_INPUT_TYPE={textarea:"textarea"};t.ADJOINED={none:"none",left:"left",right:"right",both:"both"};t.SIZE={mini:"mini",default:"default",compact:"compact",large:"large"};t.ENHANCER_POSITION={start:"start",end:"end"}},27420:(e,t,r)=>{t.i=void 0;var o,n=r(71077),i=r(80912),l=(o=r(13373))&&o.__esModule?o:{default:o};function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var d=(0,n.styled)("button",(function(e){var t,r=e.$theme,o=e.$size,n=e.$isFocusVisible,l=(t={},u(t,i.SIZE.mini,r.sizing.scale400),u(t,i.SIZE.compact,r.sizing.scale400),u(t,i.SIZE.default,r.sizing.scale300),u(t,i.SIZE.large,r.sizing.scale200),t)[o];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:l,paddingRight:l,outline:n?"solid 3px ".concat(r.colors.accent):"none",color:r.colors.contentPrimary}}));d.displayName="StyledMaskToggleButton",d.displayName="StyledMaskToggleButton";var c=(0,n.styled)("div",(function(e){var t,r=e.$alignTop,o=void 0!==r&&r,n=e.$size,l=e.$theme,a=(t={},u(t,i.SIZE.mini,l.sizing.scale200),u(t,i.SIZE.compact,l.sizing.scale200),u(t,i.SIZE.default,l.sizing.scale100),u(t,i.SIZE.large,l.sizing.scale0),t)[n];return{display:"flex",alignItems:o?"flex-start":"center",paddingLeft:a,paddingRight:a,paddingTop:o?l.sizing.scale500:"0px",color:l.colors.contentPrimary}}));c.displayName="StyledClearIconContainer",c.displayName="StyledClearIconContainer";var p=(0,n.styled)(l.default,(function(e){var t=e.$theme;return{cursor:"pointer",outline:e.$isFocusVisible?"solid 3px ".concat(t.colors.accent):"none"}}));function f(e,t){var r;return(r={},u(r,i.SIZE.mini,t.font100),u(r,i.SIZE.compact,t.font200),u(r,i.SIZE.default,t.font300),u(r,i.SIZE.large,t.font400),r)[e]}t.i=p,p.displayName="StyledClearIcon",p.displayName="StyledClearIcon";var b=function(e){var t=e.$isFocused,r=e.$adjoined,o=e.$error,n=e.$disabled,l=e.$positive,a=e.$size,u=e.$theme,d=e.$theme,c=d.borders,p=d.colors,b=d.sizing,y=d.typography,g=d.animation,m=e.$hasIconTrailing;return s(s(s(s({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:g.timing200,transitionTimingFunction:g.easeOutCurve},function(e,t){var r=t.inputBorderRadius;return e===i.SIZE.mini&&(r=t.inputBorderRadiusMini),{borderTopLeftRadius:r,borderBottomLeftRadius:r,borderTopRightRadius:r,borderBottomRightRadius:r}}(a,c)),f(a,y)),function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0;return e?{borderLeftColor:n.inputFillDisabled,borderRightColor:n.inputFillDisabled,borderTopColor:n.inputFillDisabled,borderBottomColor:n.inputFillDisabled,backgroundColor:n.inputFillDisabled}:t?{borderLeftColor:n.borderSelected,borderRightColor:n.borderSelected,borderTopColor:n.borderSelected,borderBottomColor:n.borderSelected,backgroundColor:n.inputFillActive}:r?{borderLeftColor:n.inputBorderError,borderRightColor:n.inputBorderError,borderTopColor:n.inputBorderError,borderBottomColor:n.inputBorderError,backgroundColor:n.inputFillError}:o?{borderLeftColor:n.inputBorderPositive,borderRightColor:n.inputBorderPositive,borderTopColor:n.inputBorderPositive,borderBottomColor:n.inputBorderPositive,backgroundColor:n.inputFillPositive}:{borderLeftColor:n.inputBorder,borderRightColor:n.inputBorder,borderTopColor:n.inputBorder,borderBottomColor:n.inputBorder,backgroundColor:n.inputFill}}(n,t,o,l,p)),function(e,t,r,o,n){var l=e===i.ADJOINED.both||e===i.ADJOINED.left&&"rtl"!==o||e===i.ADJOINED.right&&"rtl"===o||n&&"rtl"===o,a=e===i.ADJOINED.both||e===i.ADJOINED.right&&"rtl"!==o||e===i.ADJOINED.left&&"rtl"===o||n&&"rtl"!==o;return{paddingLeft:l?r.scale550:"0px",paddingRight:a?r.scale550:"0px"}}(r,0,b,u.direction,m))};var y=(0,n.styled)("div",b);y.displayName="Root",y.displayName="Root";var g=(0,n.styled)("div",(function(e){var t=e.$size,r=e.$disabled,o=e.$isFocused,n=e.$error,l=e.$positive,a=e.$theme,d=a.colors,c=a.sizing,p=a.typography,b=a.animation;return s(s(s({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:b.timing200,transitionTimingFunction:b.easeOutCurve},f(t,p)),function(e,t){var r;return(r={},u(r,i.SIZE.mini,{paddingRight:t.scale400,paddingLeft:t.scale400}),u(r,i.SIZE.compact,{paddingRight:t.scale400,paddingLeft:t.scale400}),u(r,i.SIZE.default,{paddingRight:t.scale300,paddingLeft:t.scale300}),u(r,i.SIZE.large,{paddingRight:t.scale200,paddingLeft:t.scale200}),r)[e]}(t,c)),function(e,t,r,o,n){return e?{color:n.inputEnhancerTextDisabled,backgroundColor:n.inputFillDisabled}:t?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:r?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}(r,o,n,l,d))}));g.displayName="InputEnhancer",g.displayName="InputEnhancer";var m=function(e){var t=e.$isFocused,r=e.$error,o=e.$disabled,n=e.$positive,i=e.$size,l=e.$theme,a=l.colors,u=l.typography,d=l.animation;return s(s({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:d.timing200,transitionTimingFunction:d.easeOutCurve},f(i,u)),function(e,t,r,o,n){return e?{color:n.inputTextDisabled,backgroundColor:n.inputFillDisabled}:t?{color:n.contentPrimary,backgroundColor:n.inputFillActive}:r?{color:n.contentPrimary,backgroundColor:n.inputFillError}:o?{color:n.contentPrimary,backgroundColor:n.inputFillPositive}:{color:n.contentPrimary,backgroundColor:n.inputFill}}(o,t,r,n,a))};var h=(0,n.styled)("div",m);h.displayName="InputContainer",h.displayName="InputContainer";var v=function(e){var t=e.$disabled,r=(e.$isFocused,e.$error,e.$size),o=e.$theme,n=o.colors,l=o.sizing;return s(s(s({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:t?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},f(r,o.typography)),function(e,t){var r;return(r={},u(r,i.SIZE.mini,{paddingTop:t.scale100,paddingBottom:t.scale100,paddingLeft:t.scale550,paddingRight:t.scale550}),u(r,i.SIZE.compact,{paddingTop:t.scale200,paddingBottom:t.scale200,paddingLeft:t.scale550,paddingRight:t.scale550}),u(r,i.SIZE.default,{paddingTop:t.scale400,paddingBottom:t.scale400,paddingLeft:t.scale550,paddingRight:t.scale550}),u(r,i.SIZE.large,{paddingTop:t.scale550,paddingBottom:t.scale550,paddingLeft:t.scale550,paddingRight:t.scale550}),r)[e]}(r,l)),function(e,t,r,o){return e?{color:o.inputTextDisabled,"-webkit-text-fill-color":o.inputTextDisabled,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholderDisabled}}:{color:o.contentPrimary,caretColor:o.contentPrimary,"::placeholder":{color:o.inputPlaceholder}}}(t,0,0,n))};var O=(0,n.styled)("input",v);O.displayName="Input",O.displayName="Input"},70924:(e,t)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e){return Array.isArray(e)||"[object Object]"=={}.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){t=t||{};for(var n,i,l=arguments.length<=1?0:arguments.length-1,a=0;a<l;a++)for(var s in n=(a+1<1||arguments.length<=a+1?void 0:arguments[a+1])||{})void 0!==r(n[s])&&(o(i=n[s])?t[s]=e(t[s]||Array.isArray(i)&&[]||{},i):t[s]=i);return t}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7175],{79986:(t,e,i)=>{i.d(e,{Z:()=>c});i(66845);var s,r=i(50641),o=i(86659),n=i(50669),a=i(1515);const l=(0,i(7865).F4)(s||(s=(0,n.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),d=(0,a.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:i,theme:s}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:s.colors.gray,margin:"0 5px"}}:{},...i?{color:s.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var u=i(40864);const c=t=>{let{dirty:e,value:i,maxLength:s,className:n,type:a="single",inForm:l}=t;const c=[],h=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c.push((0,u.jsx)(d,{includeDot:c.length>0,shouldBlink:e,children:t},c.length))};if(e){const t=l?"submit form":"apply";if("multiline"===a){const e=(0,r.Ge)()?"\u2318":"Ctrl";h("Press ".concat(e,"+Enter to ").concat(t))}else"single"===a&&h("Press Enter to ".concat(t))}return s&&("chat"!==a||e)&&h("".concat(i.length,"/").concat(s),e&&i.length>=s),(0,u.jsx)(o.X7,{"data-testid":"InputInstructions",className:n,children:c})}},87814:(t,e,i)=>{i.d(e,{K:()=>r});var s=i(50641);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,i){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,s.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,i),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},67175:(t,e,i)=>{i.r(e),i.d(e,{default:()=>M});var s=i(66845),r=i(20607),o=i(89997),n=i(25621),a=i(52347),l=i(87814),d=i(23849),u=i(16295),c=i(48266),h=i(8879),m=i(68411),p=i(46927),g=i(82534),b=i(79986),f=i(98478),v=i(86659),y=i(50641),x=i(1515);const I=(0,x.Z)("div",{target:"e116k4er3"})((t=>{let{theme:e}=t;return{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",borderWidth:"1px",borderStyle:"solid",borderColor:e.colors.widgetBorderColor||e.colors.widgetBackgroundColor||e.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.lg,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}}),""),C=(0,x.Z)("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),V=(0,x.Z)("button",{target:"e116k4er1"})((t=>{let{theme:e}=t;return{margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:"".concat(32,"px"),justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.widgetBackgroundColor||e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:e.radii.lg,borderBottomRightRadius:e.radii.lg},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}}),""),w=(0,x.Z)("div",{target:"e116k4er0"})((t=>{let{theme:e,clearable:i}=t;return{position:"absolute",marginRight:e.spacing.twoXS,left:0,right:"".concat(64+(i?12:0),"px")}}),"");var F=i(70479),D=i.n(F),k=i(40864);class S extends s.PureComponent{constructor(t){super(t),this.formClearHelper=new l.K,this.id=void 0,this.inputRef=s.createRef(),this.formatValue=t=>{if((0,y.le)(t))return null;const e=function(t){return null==t||""===t?void 0:t}(this.props.element.format);if(null==e)return t.toString();try{return(0,a.sprintf)(e,t)}catch(i){return(0,d.KE)("Error in sprintf(".concat(e,", ").concat(t,"): ").concat(i)),String(t)}},this.isIntData=()=>this.props.element.dataType===u.Y2.DataType.INT,this.getMin=()=>this.props.element.hasMin?this.props.element.min:-1/0,this.getMax=()=>this.props.element.hasMax?this.props.element.max:1/0,this.getStep=()=>{const{step:t}=this.props.element;return t||(this.isIntData()?1:.01)},this.commitWidgetValue=t=>{const{value:e}=this.state,{element:i,widgetMgr:s,fragmentId:r}=this.props,o=this.props.element,n=this.getMin(),a=this.getMax();if((0,y.bb)(e)&&(n>e||e>a)){const t=this.inputRef.current;t&&t.reportValidity()}else{var l;const n=null!==(l=null!==e&&void 0!==e?e:o.default)&&void 0!==l?l:null;this.isIntData()?s.setIntValue(i,n,t,r):s.setDoubleValue(i,n,t,r),this.setState({dirty:!1,value:n,formattedValue:this.formatValue(n)})}},this.onFormCleared=()=>{this.setState(((t,e)=>{var i;return{value:null!==(i=e.element.default)&&void 0!==i?i:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0}),this.setState({isFocused:!1})},this.onFocus=()=>{this.setState({isFocused:!0})},this.onChange=t=>{const{value:e}=t.target;if(""===e)this.setState({dirty:!0,value:null,formattedValue:null});else{let t;t=this.isIntData()?parseInt(e,10):parseFloat(e),this.setState({dirty:!0,value:t,formattedValue:e})}},this.onKeyDown=t=>{const{key:e}=t;switch(e){case"ArrowUp":t.preventDefault(),this.modifyValueUsingStep("increment")();break;case"ArrowDown":t.preventDefault(),this.modifyValueUsingStep("decrement")()}},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,y.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId))},this.modifyValueUsingStep=t=>()=>{const{value:e}=this.state,i=this.getStep();switch(t){case"increment":this.canIncrement&&this.setState({dirty:!0,value:(null!==e&&void 0!==e?e:this.getMin())+i},(()=>{this.commitWidgetValue({fromUi:!0})}));break;case"decrement":this.canDecrement&&this.setState({dirty:!0,value:(null!==e&&void 0!==e?e:this.getMax())-i},(()=>{this.commitWidgetValue({fromUi:!0})}))}},this.state={dirty:!1,value:this.initialValue,formattedValue:this.formatValue(this.initialValue),isFocused:!1},this.id=D()("number_input_")}get initialValue(){var t;const e=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null,formattedValue:this.formatValue(null!==t&&void 0!==t?t:null)},(()=>{this.commitWidgetValue({fromUi:!1})}))}get canDecrement(){return!(0,y.le)(this.state.value)&&this.state.value-this.getStep()>=this.getMin()}get canIncrement(){return!(0,y.le)(this.state.value)&&this.state.value+this.getStep()<=this.getMax()}render(){var t;const{element:e,width:i,disabled:s,widgetMgr:n,theme:a}=this.props,{formattedValue:l,dirty:d,isFocused:u}=this.state,x={width:i},F=!this.canDecrement||s,D=!this.canIncrement||s,S=(0,y.le)(e.default)&&!s;return this.formClearHelper.manageFormClearListener(n,e.formId,this.onFormCleared),(0,k.jsxs)("div",{className:"stNumberInput",style:x,"data-testid":"stNumberInput",children:[(0,k.jsx)(f.O,{label:e.label,disabled:s,labelVisibility:(0,y.iF)(null===(t=e.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:e.help&&(0,k.jsx)(v.dT,{children:(0,k.jsx)(h.Z,{content:e.help,placement:m.u.TOP_RIGHT})})}),(0,k.jsxs)(I,{className:u?"focused":"","data-testid":"stNumberInputContainer",children:[(0,k.jsx)(g.Z,{type:"number",inputRef:this.inputRef,value:null!==l&&void 0!==l?l:"",placeholder:e.placeholder,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,clearable:S,clearOnEscape:S,disabled:s,"aria-label":e.label,id:this.id,overrides:{ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,transform:"scale(1.4)",width:a.spacing.twoXL,marginRight:"-1.25em",":hover":{fill:a.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInput-Input",step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),i>c.A.hideNumberInputControls&&(0,k.jsxs)(C,{children:[(0,k.jsx)(V,{className:"step-down","data-testid":"stNumberInput-StepDown",onClick:this.modifyValueUsingStep("decrement"),disabled:F,tabIndex:-1,children:(0,k.jsx)(p.Z,{content:r.W,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),(0,k.jsx)(V,{className:"step-up","data-testid":"stNumberInput-StepUp",onClick:this.modifyValueUsingStep("increment"),disabled:D,tabIndex:-1,children:(0,k.jsx)(p.Z,{content:o.v,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),i>c.A.hideWidgetDetails&&(0,k.jsx)(w,{clearable:S,children:(0,k.jsx)(b.Z,{dirty:d,value:null!==l&&void 0!==l?l:"",className:"input-instructions",inForm:(0,y.$b)({formId:e.formId})})})]})}}const M=(0,n.b)(S)}}]);
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7602],{90186:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(66845),r=s(25621),o=s(66694),a=s(92627),n=s(38570),l=s(80318),d=s(40864);let c;!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(c||(c={}));const h=function(e){let{value:t,width:s,size:h=c.SMALL,overrides:u}=e;const g=(0,r.u)(),p={xs:g.spacing.twoXS,sm:g.spacing.sm,md:g.spacing.lg,lg:g.spacing.xl,xl:g.spacing.twoXL},{activeTheme:m}=i.useContext(o.E),f=!(0,a.MJ)(m),S={BarContainer:{style:{marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:s?s.toString():void 0,marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none,height:p[h],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?g.colors.primary:g.colors.blue70,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})}};return(0,d.jsx)(n.Z,{value:t,overrides:(0,l.aO)(S,u)})}},47602:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i,r=s(47869),o=s(18080),a=s(62813),n=s.n(a),l=s(66845),d=s(16295),c=s(46927),h=s(68411),u=s(8879),g=s(98478),p=s(86659),m=s(87814),f=s(23849),S=s(50641),C=s(77367),R=s(90186),x=s(1515),w=s(35704);function b(e,t){switch(e){case i.XSMALL:return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.sm),fontSize:t.fontSizes.sm};case i.SMALL:return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.md)};case i.LARGE:return{padding:"".concat(t.spacing.md," ").concat(t.spacing.md)};default:return{padding:"".concat(t.spacing.xs," ").concat(t.spacing.md)}}}!function(e){e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large"}(i||(i={}));const F=(0,x.Z)("div",{target:"etz5kuj9"})((()=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),v=(0,x.Z)("div",{target:"etz5kuj8"})((e=>{let{theme:t,width:s}=e;return{backgroundColor:t.colors.secondaryBg,borderRadius:"".concat(t.radii.lg," ").concat(t.radii.lg," 0 0"),width:"100%",height:9*s/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}}),""),I=(0,x.Z)("p",{target:"etz5kuj7"})((e=>{let{theme:t}=e;return{marginTop:t.spacing.sm,textAlign:"center"}}),""),M=(0,x.Z)("img",{target:"etz5kuj6"})((e=>{let{theme:t,opacity:s}=e;return{borderRadius:"".concat(t.radii.lg," ").concat(t.radii.lg," 0 0"),objectFit:"contain",opacity:s}}),""),y=(0,x.Z)("a",{target:"etz5kuj5"})((e=>{let{theme:t}=e;return{color:t.colors.primary,display:"block",textDecoration:"none"}}),""),E=(0,x.Z)("span",{target:"etz5kuj4"})((()=>({display:"flex",alignItems:"center"})),""),T=(0,x.Z)("div",{target:"etz5kuj3"})((e=>{let{theme:t}=e;return{position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:1,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6}}),""),j=(0,x.Z)("div",{target:"etz5kuj1"})((()=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),L=(0,x.Z)("button",{target:"etz5kuj0"})((e=>{let{theme:t}=e;return{position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:"1px solid ".concat(t.colors.fadedText10),borderRadius:"0 0 ".concat(t.radii.lg," ").concat(t.radii.lg),"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:"".concat(t.spacing.xs," ").concat(t.spacing.md),margin:0,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,w.DZ)(t.colors.primary,.5))},...b(i.MEDIUM,t)}}),"");var U=s(40864);const P=function(e){let{disabled:t,onClick:s,children:i,progress:r}=e;return(0,U.jsxs)(L,{disabled:t||!1,onClick:s||(()=>{}),progress:r||null,"data-testid":"stCameraInputButton",children:[i,r&&(0,U.jsx)(j,{children:(0,U.jsx)(R.Z,{value:r,size:R.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(77979),z=s(9003),Z=s(81354),D=s(11765);let O;!function(e){e.USER="user",e.ENVIRONMENT="environment"}(O||(O={}));const X=e=>{let{switchFacingMode:t}=e;return(0,U.jsx)(T,{"data-testid":"stCameraSwitchButton",children:(0,U.jsx)(h.Z,{content:"Switch camera",placement:h.u.TOP_RIGHT,children:(0,U.jsx)(z.ZP,{kind:Z.nW.MINIMAL,onClick:t,children:(0,U.jsx)(c.Z,{content:k.Z,size:"twoXL",color:D.Z.white})})})})};var B=s(3084),_=s(25621),W=s(91706),A=s(48051),V=s.n(A),G=s(84192);let N;!function(e){e.PENDING="pending",e.SUCCESS="success",e.ERROR="error"}(N||(N={}));const H=e=>{let{width:t}=e;return(0,U.jsxs)(v,{width:t,children:[(0,U.jsx)(c.Z,{size:"threeXL",color:D.Z.gray60,content:B.n}),(0,U.jsxs)(I,{children:["This app would like to use your camera.",(0,U.jsx)(y,{href:G.U3,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]})},$=e=>{let{handleCapture:t,width:s,disabled:i,clearPhotoInProgress:r,setClearPhotoInProgress:o,facingMode:a,setFacingMode:n,testOverride:d}=e;const[c,h]=(0,l.useState)(d||N.PENDING),u=(0,l.useRef)(null),[g,p]=(0,l.useState)(s),m=(0,l.useCallback)((0,S.Ds)(1e3,p),[]);(0,l.useEffect)((()=>{m(s)}),[s,m]);const f=(0,_.u)();return(0,U.jsxs)(F,{width:g,"data-testid":"stWebcamComponent",children:[c===N.SUCCESS||i||r?W.tq&&(0,U.jsx)(X,{switchFacingMode:n}):(0,U.jsx)(H,{width:g}),(0,U.jsx)(v,{"data-testid":"stWebcamStyledBox",hidden:c!==N.SUCCESS&&!i&&!r,width:g,children:!i&&(0,U.jsx)(V(),{audio:!1,ref:u,screenshotFormat:"image/jpeg",screenshotQuality:1,width:g,height:9*g/16,style:{borderRadius:"".concat(f.radii.lg," ").concat(f.radii.lg," 0 0")},onUserMediaError:()=>{h(N.ERROR)},onUserMedia:()=>{h(N.SUCCESS),o(!1)},videoConstraints:{width:{ideal:g},facingMode:a}})}),(0,U.jsx)(P,{onClick:function(){if(null!==u.current){const e=u.current.getScreenshot();t(e)}},disabled:c!==N.SUCCESS||i||r,children:"Take Photo"})]})};class K extends l.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new m.K,this.getProgress=()=>{if(this.state.files.length>0&&"uploading"===this.state.files[this.state.files.length-1].status.type){return this.state.files[this.state.files.length-1].status.progress}},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState((e=>({facingMode:e.facingMode===O.USER?O.ENVIRONMENT:O.USER})))},this.handleCapture=e=>{if(null===e)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});return(t=e,s="camera-input-".concat((new Date).toISOString().replace(/:/g,"_"),".jpg"),fetch(t).then((e=>e.arrayBuffer())).then((e=>new File([e],s,{type:"image/jpeg"})))).then((e=>this.props.uploadClient.fetchFileURLs([e]).then((t=>({file:e,fileUrls:t[0]}))))).then((e=>{let{file:t,fileUrls:s}=e;return this.uploadFile(s,t)})).then((()=>{return e=150,new Promise((t=>setTimeout(t,e)));var e})).then((()=>{this.setState(((t,s)=>({imgSrc:e,shutter:t.shutter,minShutterEffectPassed:!0})))})).catch((e=>{(0,f.H)(e)}));var t,s},this.removeCapture=()=>{0!==this.state.files.length&&(this.state.files.forEach((e=>this.deleteFile(e.id))),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:s}=this.props,i=s.getFileUploaderStateValue(t);n()(e,i)||s.setFileUploaderStateValue(t,e,{fromUi:!0})},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();null!=e&&(this.setState({imgSrc:null}),this.props.widgetMgr.setFileUploaderStateValue(this.props.element,e,{fromUi:!0}))}))},this.deleteFile=e=>{const t=this.getFile(e);null!=t&&("uploading"===t.status.type&&t.status.cancelToken.cancel(),"uploaded"===t.status.type&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((s=>({files:s.files.map((s=>s.id===e?t:s))})))},this.onUploadComplete=(e,t)=>{this.setState((()=>({shutter:!1})));const s=this.getFile(e);null!=s&&"uploading"===s.status.type&&this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(null==s||"uploading"!==s.status.type)return;const i=Math.round(100*e.loaded/e.total);s.status.progress!==i&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:i}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,t)=>{const s=o.Z.CancelToken.source(),i=new C.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(i),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,i.id)),s.token).then((()=>this.onUploadComplete(i.id,e))).catch((e=>{o.Z.isCancel(e)||this.updateFile(i.id,i.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.state=this.initialValue}get initialValue(){const e={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:O.USER},{widgetMgr:t,element:s}=this.props,i=t.getFileUploaderStateValue(s);if(null==i)return e;const{uploadedFileInfo:r}=i;return null==r||0===r.length?e:{files:r.map((e=>{const t=e.name,s=e.size,i=e.fileId,r=e.fileUrls;return new C.R(t,s,this.nextLocalFileId(),{type:"uploaded",fileId:i,fileUrls:r})})),imgSrc:0===r.length?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:O.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:s}=this.props;void 0===s.getFileUploaderStateValue(t)&&s.setFileUploaderStateValue(t,e,{fromUi:!1})}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:s,status:i}=e;return new d.jM({fileId:i.fileId,fileUrls:i.fileUrls,name:t,size:s})}));return new d.xO({uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:i,width:o}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,U.jsxs)(F,{width:o,className:"row-widget","data-testid":"stCameraInput",children:[(0,U.jsx)(g.O,{label:t.label,disabled:i,labelVisibility:(0,S.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,U.jsx)(p.dT,{children:(0,U.jsx)(u.Z,{content:t.help,placement:h.u.TOP_RIGHT})})}),this.state.imgSrc?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(v,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&(0,U.jsx)(M,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:9*o/16})}),(0,U.jsx)(P,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||i,children:this.getProgress()?"Uploading...":(0,U.jsxs)(E,{children:[(0,U.jsx)(c.Z,{content:r.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,U.jsx)($,{handleCapture:this.handleCapture,width:o,disabled:i,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}const q=K},77367:(e,t,s)=>{s.d(t,{R:()=>i});class i{setStatus(e){return new i(this.name,this.size,this.id,e)}constructor(e,t,s,i){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=s,this.status=i}}},87814:(e,t,s)=>{s.d(t,{K:()=>r});var i=s(50641);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7602],{90186:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(66845),r=s(25621),o=s(66694),a=s(92627),n=s(38570),l=s(80318),d=s(40864);let c;!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(c||(c={}));const h=function(e){let{value:t,width:s,size:h=c.SMALL,overrides:u}=e;const g=(0,r.u)(),p={xs:g.spacing.twoXS,sm:g.spacing.sm,md:g.spacing.lg,lg:g.spacing.xl,xl:g.spacing.twoXL},{activeTheme:m}=i.useContext(o.E),f=!(0,a.MJ)(m),S={BarContainer:{style:{marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:s?s.toString():void 0,marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none,height:p[h],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?g.colors.primary:g.colors.blue70,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})}};return(0,d.jsx)(n.Z,{value:t,overrides:(0,l.aO)(S,u)})}},47602:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i,r=s(47869),o=s(18080),a=s(62813),n=s.n(a),l=s(66845),d=s(16295),c=s(46927),h=s(68411),u=s(8879),g=s(98478),p=s(86659),m=s(87814),f=s(23849),S=s(50641),C=s(77367),R=s(90186),x=s(1515),w=s(35704);function b(e,t){switch(e){case i.XSMALL:return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.sm),fontSize:t.fontSizes.sm};case i.SMALL:return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.md)};case i.LARGE:return{padding:"".concat(t.spacing.md," ").concat(t.spacing.md)};default:return{padding:"".concat(t.spacing.xs," ").concat(t.spacing.md)}}}!function(e){e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large"}(i||(i={}));const F=(0,x.Z)("div",{target:"etz5kuj9"})((()=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),I=(0,x.Z)("div",{target:"etz5kuj8"})((e=>{let{theme:t,width:s}=e;return{backgroundColor:t.colors.secondaryBg,borderRadius:"".concat(t.radii.lg," ").concat(t.radii.lg," 0 0"),width:"100%",height:9*s/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}}),""),v=(0,x.Z)("p",{target:"etz5kuj7"})((e=>{let{theme:t}=e;return{marginTop:t.spacing.sm,textAlign:"center"}}),""),M=(0,x.Z)("img",{target:"etz5kuj6"})((e=>{let{theme:t,opacity:s}=e;return{borderRadius:"".concat(t.radii.lg," ").concat(t.radii.lg," 0 0"),objectFit:"contain",opacity:s}}),""),y=(0,x.Z)("a",{target:"etz5kuj5"})((e=>{let{theme:t}=e;return{color:t.colors.primary,display:"block",textDecoration:"none"}}),""),E=(0,x.Z)("span",{target:"etz5kuj4"})((()=>({display:"flex",alignItems:"center"})),""),T=(0,x.Z)("div",{target:"etz5kuj3"})((e=>{let{theme:t}=e;return{position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:1,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6}}),""),j=(0,x.Z)("div",{target:"etz5kuj1"})((()=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),L=(0,x.Z)("button",{target:"etz5kuj0"})((e=>{let{theme:t}=e;return{position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:"1px solid ".concat(t.colors.fadedText10),borderRadius:"0 0 ".concat(t.radii.lg," ").concat(t.radii.lg),"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:"".concat(t.spacing.xs," ").concat(t.spacing.md),margin:0,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,w.DZ)(t.colors.primary,.5))},...b(i.MEDIUM,t)}}),"");var U=s(40864);const P=function(e){let{disabled:t,onClick:s,children:i,progress:r}=e;return(0,U.jsxs)(L,{disabled:t||!1,onClick:s||(()=>{}),progress:r||null,"data-testid":"stCameraInputButton",children:[i,r&&(0,U.jsx)(j,{children:(0,U.jsx)(R.Z,{value:r,size:R.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(77979),z=s(9003),Z=s(81354),D=s(11765);let O;!function(e){e.USER="user",e.ENVIRONMENT="environment"}(O||(O={}));const X=e=>{let{switchFacingMode:t}=e;return(0,U.jsx)(T,{"data-testid":"stCameraSwitchButton",children:(0,U.jsx)(h.Z,{content:"Switch camera",placement:h.u.TOP_RIGHT,children:(0,U.jsx)(z.ZP,{kind:Z.nW.MINIMAL,onClick:t,children:(0,U.jsx)(c.Z,{content:k.Z,size:"twoXL",color:D.Z.white})})})})};var B=s(3084),_=s(25621),W=s(91706),A=s(48051),V=s.n(A),G=s(84192);let N;!function(e){e.PENDING="pending",e.SUCCESS="success",e.ERROR="error"}(N||(N={}));const H=e=>{let{width:t}=e;return(0,U.jsxs)(I,{width:t,children:[(0,U.jsx)(c.Z,{size:"threeXL",color:D.Z.gray60,content:B.n}),(0,U.jsxs)(v,{children:["This app would like to use your camera.",(0,U.jsx)(y,{href:G.U3,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]})},$=e=>{let{handleCapture:t,width:s,disabled:i,clearPhotoInProgress:r,setClearPhotoInProgress:o,facingMode:a,setFacingMode:n,testOverride:d}=e;const[c,h]=(0,l.useState)(d||N.PENDING),u=(0,l.useRef)(null),[g,p]=(0,l.useState)(s),m=(0,l.useCallback)((0,S.Ds)(1e3,p),[]);(0,l.useEffect)((()=>{m(s)}),[s,m]);const f=(0,_.u)();return(0,U.jsxs)(F,{width:g,"data-testid":"stWebcamComponent",children:[c===N.SUCCESS||i||r?W.tq&&(0,U.jsx)(X,{switchFacingMode:n}):(0,U.jsx)(H,{width:g}),(0,U.jsx)(I,{"data-testid":"stWebcamStyledBox",hidden:c!==N.SUCCESS&&!i&&!r,width:g,children:!i&&(0,U.jsx)(V(),{audio:!1,ref:u,screenshotFormat:"image/jpeg",screenshotQuality:1,width:g,height:9*g/16,style:{borderRadius:"".concat(f.radii.lg," ").concat(f.radii.lg," 0 0")},onUserMediaError:()=>{h(N.ERROR)},onUserMedia:()=>{h(N.SUCCESS),o(!1)},videoConstraints:{width:{ideal:g},facingMode:a}})}),(0,U.jsx)(P,{onClick:function(){if(null!==u.current){const e=u.current.getScreenshot();t(e)}},disabled:c!==N.SUCCESS||i||r,children:"Take Photo"})]})};class K extends l.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new m.K,this.getProgress=()=>{if(this.state.files.length>0&&"uploading"===this.state.files[this.state.files.length-1].status.type){return this.state.files[this.state.files.length-1].status.progress}},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState((e=>({facingMode:e.facingMode===O.USER?O.ENVIRONMENT:O.USER})))},this.handleCapture=e=>{if(null===e)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});return(t=e,s="camera-input-".concat((new Date).toISOString().replace(/:/g,"_"),".jpg"),fetch(t).then((e=>e.arrayBuffer())).then((e=>new File([e],s,{type:"image/jpeg"})))).then((e=>this.props.uploadClient.fetchFileURLs([e]).then((t=>({file:e,fileUrls:t[0]}))))).then((e=>{let{file:t,fileUrls:s}=e;return this.uploadFile(s,t)})).then((()=>{return e=150,new Promise((t=>setTimeout(t,e)));var e})).then((()=>{this.setState(((t,s)=>({imgSrc:e,shutter:t.shutter,minShutterEffectPassed:!0})))})).catch((e=>{(0,f.H)(e)}));var t,s},this.removeCapture=()=>{0!==this.state.files.length&&(this.state.files.forEach((e=>this.deleteFile(e.id))),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props,r=s.getFileUploaderStateValue(t);n()(e,r)||s.setFileUploaderStateValue(t,e,{fromUi:!0},i)},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();if(null==e)return;this.setState({imgSrc:null});const{widgetMgr:t,element:s,fragmentId:i}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},i)}))},this.deleteFile=e=>{const t=this.getFile(e);null!=t&&("uploading"===t.status.type&&t.status.cancelToken.cancel(),"uploaded"===t.status.type&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((s=>({files:s.files.map((s=>s.id===e?t:s))})))},this.onUploadComplete=(e,t)=>{this.setState((()=>({shutter:!1})));const s=this.getFile(e);null!=s&&"uploading"===s.status.type&&this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(null==s||"uploading"!==s.status.type)return;const i=Math.round(100*e.loaded/e.total);s.status.progress!==i&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:i}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,t)=>{const s=o.Z.CancelToken.source(),i=new C.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(i),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,i.id)),s.token).then((()=>this.onUploadComplete(i.id,e))).catch((e=>{o.Z.isCancel(e)||this.updateFile(i.id,i.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.state=this.initialValue}get initialValue(){const e={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:O.USER},{widgetMgr:t,element:s}=this.props,i=t.getFileUploaderStateValue(s);if(null==i)return e;const{uploadedFileInfo:r}=i;return null==r||0===r.length?e:{files:r.map((e=>{const t=e.name,s=e.size,i=e.fileId,r=e.fileUrls;return new C.R(t,s,this.nextLocalFileId(),{type:"uploaded",fileId:i,fileUrls:r})})),imgSrc:0===r.length?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:O.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props;void 0===s.getFileUploaderStateValue(t)&&s.setFileUploaderStateValue(t,e,{fromUi:!1},i)}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:s,status:i}=e;return new d.jM({fileId:i.fileId,fileUrls:i.fileUrls,name:t,size:s})}));return new d.xO({uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:i,width:o}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,U.jsxs)(F,{width:o,className:"row-widget","data-testid":"stCameraInput",children:[(0,U.jsx)(g.O,{label:t.label,disabled:i,labelVisibility:(0,S.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,U.jsx)(p.dT,{children:(0,U.jsx)(u.Z,{content:t.help,placement:h.u.TOP_RIGHT})})}),this.state.imgSrc?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&(0,U.jsx)(M,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:9*o/16})}),(0,U.jsx)(P,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||i,children:this.getProgress()?"Uploading...":(0,U.jsxs)(E,{children:[(0,U.jsx)(c.Z,{content:r.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,U.jsx)($,{handleCapture:this.handleCapture,width:o,disabled:i,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}const q=K},77367:(e,t,s)=>{s.d(t,{R:()=>i});class i{setStatus(e){return new i(this.name,this.size,this.id,e)}constructor(e,t,s,i){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=s,this.status=i}}},87814:(e,t,s)=>{s.d(t,{K:()=>r});var i=s(50641);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8492],{28492:(e,t,o)=>{o.r(t),o.d(t,{default:()=>N});var r=o(66845),i=o(25621),n=o(50641),a=o(80318),l=o(80745);function s(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function c(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){d(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function d(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function u(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 p(e){var t=e.$disabled,o=e.$theme.colors;return t?o.contentSecondary:o.contentPrimary}var h=(0,l.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"}}));h.displayName="Root",h.displayName="Root";var m=(0,l.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,s=n.animation,c=o?n.colors.tickMarkFillDisabled:r?n.colors.tickMarkFillError:n.colors.tickMarkFill,d=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(c,'"/>\n </svg>\n ')),p=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(c,'"/>\n </svg>\n ')),h=n.borders.checkboxBorderRadius,m=function(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:o||i?"transparent":r?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:s.timing200,transitionTimingFunction:s.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:m,borderRightColor:m,borderTopColor:m,borderBottomColor:m,borderTopLeftRadius:h,borderTopRightRadius:h,borderBottomRightRadius:h,borderBottomLeftRadius:h,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(d,"');"):t?"url('data:image/svg+xml,".concat(p,"');"):null,backgroundColor:u(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));m.displayName="Checkmark",m.displayName="Checkmark";var g=(0,l.zo)("div",(function(e){var t=e.$theme.typography;return c(c(c({verticalAlign:"middle"},function(e){var t,o=e.$labelPlacement,r=void 0===o?"":o,i=e.$theme,n=i.sizing.scale300;switch(r){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),d({},"padding".concat(t),n)}(e)),{},{color:p(e)},t.LabelMedium),{},{lineHeight:"24px"})}));g.displayName="Label",g.displayName="Label";var b=(0,l.zo)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});b.displayName="Input",b.displayName="Input";var f=(0,l.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)}}));f.displayName="Toggle",f.displayName="Toggle";var v=(0,l.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}}));v.displayName="ToggleTrack",v.displayName="ToggleTrack";var y=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),k=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),$=o(17964);function w(e){return w="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},w(e)}function x(){return x=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},x.apply(this,arguments)}function F(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function C(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=L(e);if(t){var i=L(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return function(e,t){if(t&&("object"===w(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}(this,o)}}function T(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 O(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var S=function(e){return e.stopPropagation()},P=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(l,e);var t,o,i,n=C(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return O(T(e=n.call.apply(n,[this].concat(o))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),O(T(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),O(T(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),O(T(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),O(T(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),O(T(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,$.E)(t)&&e.setState({isFocusVisible:!0})})),O(T(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=l,(o=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,o=e.inputRef;t&&o.current&&o.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,o=void 0===t?{}:t,i=e.onChange,n=e.labelPlacement,l=void 0===n?this.props.checkmarkType===y.toggle?"left":"right":n,s=e.inputRef,c=e.isIndeterminate,d=e.error,u=e.disabled,p=e.value,k=e.name,$=e.type,w=e.checked,F=e.children,R=e.required,C=e.title,T=o.Root,L=o.Checkmark,O=o.Label,P=o.Input,M=o.Toggle,j=o.ToggleTrack,B=(0,a.XG)(T)||h,E=(0,a.XG)(L)||m,H=(0,a.XG)(O)||g,V=(0,a.XG)(P)||b,I=(0,a.XG)(M)||f,z=(0,a.XG)(j)||v,D={onChange:i,onFocus:this.onFocus,onBlur:this.onBlur},W={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},A={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:d,$checked:w,$isIndeterminate:c,$required:R,$disabled:u,$value:p},U=F&&r.createElement(H,x({$labelPlacement:l},A,(0,a.ch)(O)),this.props.containsInteractiveElement?r.createElement("div",{onClick:function(e){return e.preventDefault()}},F):F);return r.createElement(B,x({"data-baseweb":"checkbox",title:C||null,$labelPlacement:l},A,W,(0,a.ch)(T)),("top"===l||"left"===l)&&U,this.props.checkmarkType===y.toggle?r.createElement(z,x({},A,(0,a.ch)(j)),r.createElement(I,x({},A,(0,a.ch)(M)))):r.createElement(E,x({},A,(0,a.ch)(L))),r.createElement(V,x({value:p,name:k,checked:w,required:R,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":c?"mixed":w,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":d||null,"aria-required":R||null,disabled:u,type:$,ref:s,onClick:S},A,D,(0,a.ch)(P))),("bottom"===l||"right"===l)&&U)}}])&&F(t.prototype,o),i&&F(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.Component);O(P,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:r.createRef(),error:!1,type:"checkbox",checkmarkType:y.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const M=P;var j=o(16295),B=o(35704),E=o(87814),H=o(92627),V=o(8879),I=o(68411),z=o(86659),D=o(21e3);const W=(0,o(1515).Z)("div",{target:"edwcd610"})((e=>{let{visibility:t}=e;return{display:t===n.Ws.Collapsed?"none":"flex",visibility:t===n.Ws.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}}),"");var A=o(40864);class U extends r.PureComponent{constructor(){super(...arguments),this.formClearHelper=new E.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{this.props.widgetMgr.setBoolValue(this.props.element,this.state.value,e)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{const t=e.target.checked;this.setState({value:t},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){const e=this.props.widgetMgr.getBoolValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{theme:t,width:o,element:r,disabled:i,widgetMgr:a}=this.props,{colors:l,spacing:s}=t,c=(0,H.Iy)(t),d={width:o},u=i?l.fadedText40:l.bodyText;return this.formClearHelper.manageFormClearListener(a,r.formId,this.onFormCleared),(0,A.jsx)("div",{className:"row-widget stCheckbox","data-testid":"stCheckbox",style:d,children:(0,A.jsx)(M,{checked:this.state.value,disabled:i,onChange:this.onChange,"aria-label":r.label,checkmarkType:r.type===j.XZ.StyleType.TOGGLE?y.toggle:y.default,labelPlacement:k.right,overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:0,marginTop:0,paddingRight:s.twoThirdsSmFont,backgroundColor:t?l.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Toggle:{style:e=>{let{$checked:t}=e,o=c?l.bgColor:l.bodyText;return i&&(o=c?l.gray60:l.gray90),{width:"12px",height:"12px",transform:t?"translateX(16px)":"",backgroundColor:o,boxShadow:""}}},ToggleTrack:{style:e=>{let{$checked:o,$isHovered:r}=e,n=l.fadedText40;return r&&!i&&(n=l.fadedText20),o&&!i&&(n=l.primary),{marginRight:0,marginLeft:"2px",paddingLeft:"2px",paddingRight:"2px",width:"32px",minWidth:"32px",height:"16px",minHeight:"16px",borderBottomLeftRadius:t.radii.lg,borderTopLeftRadius:t.radii.lg,borderBottomRightRadius:t.radii.lg,borderTopRightRadius:t.radii.lg,backgroundColor:n}}},Checkmark:{style:e=>{let{$isFocusVisible:t,$checked:o}=e;const r=o&&!i?l.primary:l.fadedText40;return{outline:0,width:"1rem",height:"1rem",marginTop:"0.30rem",boxShadow:t&&o?"0 0 0 0.2rem ".concat((0,B.DZ)(l.primary,.5)):"",borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",borderLeftColor:r,borderRightColor:r,borderTopColor:r,borderBottomColor:r}}},Label:{style:{position:"relative",top:"1px",color:u}}},children:(0,A.jsxs)(W,{visibility:(0,n.iF)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),"data-testid":"stWidgetLabel",children:[(0,A.jsx)(D.ZP,{source:r.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),r.help&&(0,A.jsx)(z.Hp,{color:u,children:(0,A.jsx)(V.Z,{content:r.help,placement:I.u.TOP_RIGHT})})]})})})}}const N=(0,i.b)(U)},87814:(e,t,o)=>{o.d(t,{K:()=>i});var r=o(50641);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,r.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8492],{28492:(e,t,o)=>{o.r(t),o.d(t,{default:()=>N});var r=o(66845),i=o(25621),n=o(50641),a=o(80318),l=o(80745);function s(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function c(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){d(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function d(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function u(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 p(e){var t=e.$disabled,o=e.$theme.colors;return t?o.contentSecondary:o.contentPrimary}var h=(0,l.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"}}));h.displayName="Root",h.displayName="Root";var m=(0,l.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,s=n.animation,c=o?n.colors.tickMarkFillDisabled:r?n.colors.tickMarkFillError:n.colors.tickMarkFill,d=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(c,'"/>\n </svg>\n ')),p=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(c,'"/>\n </svg>\n ')),h=n.borders.checkboxBorderRadius,m=function(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:o||i?"transparent":r?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:s.timing200,transitionTimingFunction:s.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:m,borderRightColor:m,borderTopColor:m,borderBottomColor:m,borderTopLeftRadius:h,borderTopRightRadius:h,borderBottomRightRadius:h,borderBottomLeftRadius:h,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(d,"');"):t?"url('data:image/svg+xml,".concat(p,"');"):null,backgroundColor:u(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));m.displayName="Checkmark",m.displayName="Checkmark";var g=(0,l.zo)("div",(function(e){var t=e.$theme.typography;return c(c(c({verticalAlign:"middle"},function(e){var t,o=e.$labelPlacement,r=void 0===o?"":o,i=e.$theme,n=i.sizing.scale300;switch(r){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),d({},"padding".concat(t),n)}(e)),{},{color:p(e)},t.LabelMedium),{},{lineHeight:"24px"})}));g.displayName="Label",g.displayName="Label";var b=(0,l.zo)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});b.displayName="Input",b.displayName="Input";var f=(0,l.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)}}));f.displayName="Toggle",f.displayName="Toggle";var v=(0,l.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}}));v.displayName="ToggleTrack",v.displayName="ToggleTrack";var y=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),k=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),$=o(17964);function w(e){return w="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},w(e)}function x(){return x=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},x.apply(this,arguments)}function F(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},R(e,t)}function C(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=L(e);if(t){var i=L(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return function(e,t){if(t&&("object"===w(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}(this,o)}}function T(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 O(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var S=function(e){return e.stopPropagation()},P=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(l,e);var t,o,i,n=C(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return O(T(e=n.call.apply(n,[this].concat(o))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),O(T(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),O(T(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),O(T(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),O(T(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),O(T(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,$.E)(t)&&e.setState({isFocusVisible:!0})})),O(T(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=l,(o=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,o=e.inputRef;t&&o.current&&o.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,o=void 0===t?{}:t,i=e.onChange,n=e.labelPlacement,l=void 0===n?this.props.checkmarkType===y.toggle?"left":"right":n,s=e.inputRef,c=e.isIndeterminate,d=e.error,u=e.disabled,p=e.value,k=e.name,$=e.type,w=e.checked,F=e.children,R=e.required,C=e.title,T=o.Root,L=o.Checkmark,O=o.Label,P=o.Input,M=o.Toggle,j=o.ToggleTrack,B=(0,a.XG)(T)||h,E=(0,a.XG)(L)||m,H=(0,a.XG)(O)||g,I=(0,a.XG)(P)||b,V=(0,a.XG)(M)||f,z=(0,a.XG)(j)||v,D={onChange:i,onFocus:this.onFocus,onBlur:this.onBlur},W={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},A={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:d,$checked:w,$isIndeterminate:c,$required:R,$disabled:u,$value:p},U=F&&r.createElement(H,x({$labelPlacement:l},A,(0,a.ch)(O)),this.props.containsInteractiveElement?r.createElement("div",{onClick:function(e){return e.preventDefault()}},F):F);return r.createElement(B,x({"data-baseweb":"checkbox",title:C||null,$labelPlacement:l},A,W,(0,a.ch)(T)),("top"===l||"left"===l)&&U,this.props.checkmarkType===y.toggle?r.createElement(z,x({},A,(0,a.ch)(j)),r.createElement(V,x({},A,(0,a.ch)(M)))):r.createElement(E,x({},A,(0,a.ch)(L))),r.createElement(I,x({value:p,name:k,checked:w,required:R,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":c?"mixed":w,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":d||null,"aria-required":R||null,disabled:u,type:$,ref:s,onClick:S},A,D,(0,a.ch)(P))),("bottom"===l||"right"===l)&&U)}}])&&F(t.prototype,o),i&&F(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.Component);O(P,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:r.createRef(),error:!1,type:"checkbox",checkmarkType:y.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const M=P;var j=o(16295),B=o(35704),E=o(87814),H=o(92627),I=o(8879),V=o(68411),z=o(86659),D=o(21e3);const W=(0,o(1515).Z)("div",{target:"edwcd610"})((e=>{let{visibility:t}=e;return{display:t===n.Ws.Collapsed?"none":"flex",visibility:t===n.Ws.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}}),"");var A=o(40864);class U extends r.PureComponent{constructor(){super(...arguments),this.formClearHelper=new E.K,this.state={value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:o,fragmentId:r}=this.props;t.setBoolValue(o,this.state.value,e,r)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.onChange=e=>{const t=e.target.checked;this.setState({value:t},(()=>this.commitWidgetValue({fromUi:!0})))}}get initialValue(){const e=this.props.widgetMgr.getBoolValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{theme:t,width:o,element:r,disabled:i,widgetMgr:a}=this.props,{colors:l,spacing:s}=t,c=(0,H.Iy)(t),d={width:o},u=i?l.fadedText40:l.bodyText;return this.formClearHelper.manageFormClearListener(a,r.formId,this.onFormCleared),(0,A.jsx)("div",{className:"row-widget stCheckbox","data-testid":"stCheckbox",style:d,children:(0,A.jsx)(M,{checked:this.state.value,disabled:i,onChange:this.onChange,"aria-label":r.label,checkmarkType:r.type===j.XZ.StyleType.TOGGLE?y.toggle:y.default,labelPlacement:k.right,overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:0,marginTop:0,paddingRight:s.twoThirdsSmFont,backgroundColor:t?l.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Toggle:{style:e=>{let{$checked:t}=e,o=c?l.bgColor:l.bodyText;return i&&(o=c?l.gray60:l.gray90),{width:"12px",height:"12px",transform:t?"translateX(16px)":"",backgroundColor:o,boxShadow:""}}},ToggleTrack:{style:e=>{let{$checked:o,$isHovered:r}=e,n=l.fadedText40;return r&&!i&&(n=l.fadedText20),o&&!i&&(n=l.primary),{marginRight:0,marginLeft:"2px",paddingLeft:"2px",paddingRight:"2px",width:"32px",minWidth:"32px",height:"16px",minHeight:"16px",borderBottomLeftRadius:t.radii.lg,borderTopLeftRadius:t.radii.lg,borderBottomRightRadius:t.radii.lg,borderTopRightRadius:t.radii.lg,backgroundColor:n}}},Checkmark:{style:e=>{let{$isFocusVisible:t,$checked:o}=e;const r=o&&!i?l.primary:l.fadedText40;return{outline:0,width:"1rem",height:"1rem",marginTop:"0.30rem",boxShadow:t&&o?"0 0 0 0.2rem ".concat((0,B.DZ)(l.primary,.5)):"",borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",borderLeftColor:r,borderRightColor:r,borderTopColor:r,borderBottomColor:r}}},Label:{style:{position:"relative",top:"1px",color:u}}},children:(0,A.jsxs)(W,{visibility:(0,n.iF)(null===(e=r.labelVisibility)||void 0===e?void 0:e.value),"data-testid":"stWidgetLabel",children:[(0,A.jsx)(D.ZP,{source:r.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),r.help&&(0,A.jsx)(z.Hp,{color:u,children:(0,A.jsx)(I.Z,{content:r.help,placement:V.u.TOP_RIGHT})})]})})})}}const N=(0,i.b)(U)},87814:(e,t,o)=>{o.d(t,{K:()=>i});var r=o(50641);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,r.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8691],{79986:(t,e,r)=>{"use strict";r.d(e,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),a=r(50669),s=r(1515);const l=(0,r(7865).F4)(n||(n=(0,a.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),u=(0,s.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:r,theme:n}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var c=r(40864);const d=t=>{let{dirty:e,value:r,maxLength:n,className:a,type:s="single",inForm:l}=t;const d=[],p=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,c.jsx)(u,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};if(e){const t=l?"submit form":"apply";if("multiline"===s){const e=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(e,"+Enter to ").concat(t))}else"single"===s&&p("Press Enter to ".concat(t))}return n&&("chat"!==s||e)&&p("".concat(r.length,"/").concat(n),e&&r.length>=n),(0,c.jsx)(i.X7,{"data-testid":"InputInstructions",className:a,children:d})}},87814:(t,e,r)=>{"use strict";r.d(e,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,r){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,n.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,r),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},58691:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>v});var n=r(66845),o=r(70479),i=r.n(o),a=r(82534),s=r(16295),l=r(87814),u=r(79986),c=r(98478),d=r(86659),p=r(8879),h=r(68411),f=r(50641),m=r(48266);const y=(0,r(1515).Z)("div",{target:"e11y4ecf0"})((t=>{let{width:e}=t;return{position:"relative",width:e}}),"");var b=r(40864);class g extends n.PureComponent{constructor(t){var e;super(t),e=this,this.formClearHelper=new l.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=function(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{widgetMgr:n,element:o,fragmentId:i}=e.props;n.setStringValue(o,e.state.value,t,i),r&&e.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((t,e)=>{var r;return{value:null!==(r=e.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=t=>{const{value:e}=t.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&e.length>n||((0,f.$b)(this.props.element)?this.setState({dirty:!0,value:e},(()=>{this.commitWidgetValue({fromUi:!0},!1)})):this.setState({dirty:!0,value:e}))},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,f.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId))},this.id=i()("text_input_")}get initialValue(){var t;const e=this.props.widgetMgr.getStringValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}getTypeString(){return this.props.element.type===s.oi.Type.PASSWORD?"password":"text"}render(){var t;const{dirty:e,value:r}=this.state,{element:n,width:o,disabled:i,widgetMgr:s}=this.props,{placeholder:l}=n;return this.formClearHelper.manageFormClearListener(s,n.formId,this.onFormCleared),(0,b.jsxs)(y,{className:"row-widget stTextInput","data-testid":"stTextInput",width:o,children:[(0,b.jsx)(c.O,{label:n.label,disabled:i,labelVisibility:(0,f.iF)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:n.help&&(0,b.jsx)(d.dT,{children:(0,b.jsx)(p.Z,{content:n.help,placement:h.u.TOP_RIGHT})})}),(0,b.jsx)(a.Z,{value:null!==r&&void 0!==r?r:"",placeholder:l,onBlur:this.onBlur,onChange:this.onChange,onKeyPress:this.onKeyPress,"aria-label":n.label,disabled:i,id:this.id,type:this.getTypeString(),autoComplete:n.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},Root:{props:{"data-testid":"textInputRootElement"},style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}}}}),o>m.A.hideWidgetDetails&&(0,b.jsx)(u.Z,{dirty:e,value:null!==r&&void 0!==r?r:"",maxLength:n.maxChars,inForm:(0,f.$b)({formId:n.formId})})]})}}const v=g},82534:(t,e,r)=>{"use strict";r.d(e,{Z:()=>C});var n=r(66845),o=r(80318),i=r(32510),a=r(9656),s=r(98479),l=r(38254);function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var c=["Root","StartEnhancer","EndEnhancer"],d=["startEnhancer","endEnhancer","overrides"];function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p.apply(this,arguments)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(l){s=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=w(t);if(e){var o=w(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===u(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}(this,r)}}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function j(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var O=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b(t,e)}(w,t);var e,r,u,f=g(w);function w(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,w);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return j(v(t=f.call.apply(f,[this].concat(r))),"state",{isFocused:t.props.autoFocus||!1}),j(v(t),"onFocus",(function(e){t.setState({isFocused:!0}),t.props.onFocus(e)})),j(v(t),"onBlur",(function(e){t.setState({isFocused:!1}),t.props.onBlur(e)})),t}return e=w,(r=[{key:"render",value:function(){var t=this.props,e=t.startEnhancer,r=t.endEnhancer,u=t.overrides,f=u.Root,y=u.StartEnhancer,b=u.EndEnhancer,g=m(u,c),v=m(t,d),w=h((0,o.jb)(f,s.fC),2),j=w[0],O=w[1],C=h((0,o.jb)(y,s.Fp),2),S=C[0],P=C[1],E=h((0,o.jb)(b,s.Fp),2),I=E[0],W=E[1],V=(0,i.t)(this.props,this.state);return n.createElement(j,p({"data-baseweb":"input"},V,O,{$adjoined:F(e,r),$hasIconTrailing:this.props.clearable||"password"==this.props.type}),x(e)&&n.createElement(S,p({},V,P,{$position:l.Xf.start}),"function"===typeof e?e(V):e),n.createElement(a.Z,p({},v,{overrides:g,adjoined:F(e,r),onFocus:this.onFocus,onBlur:this.onBlur})),x(r)&&n.createElement(I,p({},V,W,{$position:l.Xf.end}),"function"===typeof r?r(V):r))}}])&&y(e.prototype,r),u&&y(e,u),Object.defineProperty(e,"prototype",{writable:!1}),w}(n.Component);function F(t,e){return x(t)&&x(e)?l.y4.both:x(t)?l.y4.left:x(e)?l.y4.right:l.y4.none}function x(t){return Boolean(t||0===t)}j(O,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:l.NO.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});const C=O},70479:(t,e,r)=>{var n=r(38145),o=0;t.exports=function(t){var e=++o;return n(t)+e}}}]);
|