streamlit-nightly 1.38.1.dev20240919__py2.py3-none-any.whl → 1.38.1.dev20240921__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.
@@ -23,6 +23,7 @@ import google.protobuf.descriptor
23
23
  import google.protobuf.internal.containers
24
24
  import google.protobuf.internal.enum_type_wrapper
25
25
  import google.protobuf.message
26
+ import streamlit.proto.LabelVisibilityMessage_pb2
26
27
  import sys
27
28
  import typing
28
29
 
@@ -63,21 +64,52 @@ class ButtonGroup(google.protobuf.message.Message):
63
64
  ONLY_SELECTED: ButtonGroup.SelectionVisualization.ValueType # 0
64
65
  ALL_UP_TO_SELECTED: ButtonGroup.SelectionVisualization.ValueType # 1
65
66
 
67
+ class _Style:
68
+ ValueType = typing.NewType("ValueType", builtins.int)
69
+ V: typing_extensions.TypeAlias = ValueType
70
+
71
+ class _StyleEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ButtonGroup._Style.ValueType], builtins.type):
72
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
73
+ SEGMENT: ButtonGroup._Style.ValueType # 0
74
+ PILLS: ButtonGroup._Style.ValueType # 1
75
+ BORDERLESS: ButtonGroup._Style.ValueType # 2
76
+
77
+ class Style(_Style, metaclass=_StyleEnumTypeWrapper): ...
78
+ SEGMENT: ButtonGroup.Style.ValueType # 0
79
+ PILLS: ButtonGroup.Style.ValueType # 1
80
+ BORDERLESS: ButtonGroup.Style.ValueType # 2
81
+
66
82
  @typing.final
67
83
  class Option(google.protobuf.message.Message):
68
84
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
69
85
 
70
86
  CONTENT_FIELD_NUMBER: builtins.int
71
87
  SELECTED_CONTENT_FIELD_NUMBER: builtins.int
88
+ CONTENT_ICON_FIELD_NUMBER: builtins.int
89
+ SELECTED_CONTENT_ICON_FIELD_NUMBER: builtins.int
72
90
  content: builtins.str
73
91
  selected_content: builtins.str
92
+ """when set, this is the content that will be displayed when the option is selected"""
93
+ content_icon: builtins.str
94
+ """when set, this is the icon that will be displayed next to the option"""
95
+ selected_content_icon: builtins.str
96
+ """when set, this is the icon that will be displayed next to the option when then option is selected"""
74
97
  def __init__(
75
98
  self,
76
99
  *,
77
100
  content: builtins.str = ...,
78
- selected_content: builtins.str = ...,
101
+ selected_content: builtins.str | None = ...,
102
+ content_icon: builtins.str | None = ...,
103
+ selected_content_icon: builtins.str | None = ...,
79
104
  ) -> None: ...
80
- def ClearField(self, field_name: typing.Literal["content", b"content", "selected_content", b"selected_content"]) -> None: ...
105
+ def HasField(self, field_name: typing.Literal["_content_icon", b"_content_icon", "_selected_content", b"_selected_content", "_selected_content_icon", b"_selected_content_icon", "content_icon", b"content_icon", "selected_content", b"selected_content", "selected_content_icon", b"selected_content_icon"]) -> builtins.bool: ...
106
+ def ClearField(self, field_name: typing.Literal["_content_icon", b"_content_icon", "_selected_content", b"_selected_content", "_selected_content_icon", b"_selected_content_icon", "content", b"content", "content_icon", b"content_icon", "selected_content", b"selected_content", "selected_content_icon", b"selected_content_icon"]) -> None: ...
107
+ @typing.overload
108
+ def WhichOneof(self, oneof_group: typing.Literal["_content_icon", b"_content_icon"]) -> typing.Literal["content_icon"] | None: ...
109
+ @typing.overload
110
+ def WhichOneof(self, oneof_group: typing.Literal["_selected_content", b"_selected_content"]) -> typing.Literal["selected_content"] | None: ...
111
+ @typing.overload
112
+ def WhichOneof(self, oneof_group: typing.Literal["_selected_content_icon", b"_selected_content_icon"]) -> typing.Literal["selected_content_icon"] | None: ...
81
113
 
82
114
  ID_FIELD_NUMBER: builtins.int
83
115
  OPTIONS_FIELD_NUMBER: builtins.int
@@ -88,12 +120,19 @@ class ButtonGroup(google.protobuf.message.Message):
88
120
  VALUE_FIELD_NUMBER: builtins.int
89
121
  SET_VALUE_FIELD_NUMBER: builtins.int
90
122
  SELECTION_VISUALIZATION_FIELD_NUMBER: builtins.int
123
+ STYLE_FIELD_NUMBER: builtins.int
124
+ LABEL_FIELD_NUMBER: builtins.int
125
+ LABEL_VISIBILITY_FIELD_NUMBER: builtins.int
126
+ HELP_FIELD_NUMBER: builtins.int
91
127
  id: builtins.str
92
128
  disabled: builtins.bool
93
129
  click_mode: global___ButtonGroup.ClickMode.ValueType
94
130
  form_id: builtins.str
95
131
  set_value: builtins.bool
96
132
  selection_visualization: global___ButtonGroup.SelectionVisualization.ValueType
133
+ style: global___ButtonGroup.Style.ValueType
134
+ label: builtins.str
135
+ help: builtins.str
97
136
  @property
98
137
  def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ButtonGroup.Option]: ...
99
138
  @property
@@ -104,6 +143,8 @@ class ButtonGroup(google.protobuf.message.Message):
104
143
  def value(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
105
144
  """value passed by the backend"""
106
145
 
146
+ @property
147
+ def label_visibility(self) -> streamlit.proto.LabelVisibilityMessage_pb2.LabelVisibilityMessage: ...
107
148
  def __init__(
108
149
  self,
109
150
  *,
@@ -116,7 +157,13 @@ class ButtonGroup(google.protobuf.message.Message):
116
157
  value: collections.abc.Iterable[builtins.int] | None = ...,
117
158
  set_value: builtins.bool = ...,
118
159
  selection_visualization: global___ButtonGroup.SelectionVisualization.ValueType = ...,
160
+ style: global___ButtonGroup.Style.ValueType = ...,
161
+ label: builtins.str = ...,
162
+ label_visibility: streamlit.proto.LabelVisibilityMessage_pb2.LabelVisibilityMessage | None = ...,
163
+ help: builtins.str | None = ...,
119
164
  ) -> None: ...
120
- def ClearField(self, field_name: typing.Literal["click_mode", b"click_mode", "default", b"default", "disabled", b"disabled", "form_id", b"form_id", "id", b"id", "options", b"options", "selection_visualization", b"selection_visualization", "set_value", b"set_value", "value", b"value"]) -> None: ...
165
+ def HasField(self, field_name: typing.Literal["_help", b"_help", "help", b"help", "label_visibility", b"label_visibility"]) -> builtins.bool: ...
166
+ def ClearField(self, field_name: typing.Literal["_help", b"_help", "click_mode", b"click_mode", "default", b"default", "disabled", b"disabled", "form_id", b"form_id", "help", b"help", "id", b"id", "label", b"label", "label_visibility", b"label_visibility", "options", b"options", "selection_visualization", b"selection_visualization", "set_value", b"set_value", "style", b"style", "value", b"value"]) -> None: ...
167
+ def WhichOneof(self, oneof_group: typing.Literal["_help", b"_help"]) -> typing.Literal["help"] | None: ...
121
168
 
122
169
  global___ButtonGroup = ButtonGroup
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.5513bd04.css",
4
- "main.js": "./static/js/main.61ca8755.js",
4
+ "main.js": "./static/js/main.829dd23b.js",
5
5
  "static/js/6679.265ca09c.chunk.js": "./static/js/6679.265ca09c.chunk.js",
6
6
  "static/js/9464.7e9a3c0a.chunk.js": "./static/js/9464.7e9a3c0a.chunk.js",
7
7
  "static/js/9077.e0a8db2a.chunk.js": "./static/js/9077.e0a8db2a.chunk.js",
@@ -21,7 +21,7 @@
21
21
  "static/js/8237.210a5ac4.chunk.js": "./static/js/8237.210a5ac4.chunk.js",
22
22
  "static/js/5828.f8572ba4.chunk.js": "./static/js/5828.f8572ba4.chunk.js",
23
23
  "static/js/9060.1ec8dc2b.chunk.js": "./static/js/9060.1ec8dc2b.chunk.js",
24
- "static/js/5625.3a8dc81f.chunk.js": "./static/js/5625.3a8dc81f.chunk.js",
24
+ "static/js/5625.fe6c22ad.chunk.js": "./static/js/5625.fe6c22ad.chunk.js",
25
25
  "static/js/6141.43a8fda3.chunk.js": "./static/js/6141.43a8fda3.chunk.js",
26
26
  "static/js/4103.d863052a.chunk.js": "./static/js/4103.d863052a.chunk.js",
27
27
  "static/js/1086.464de8f9.chunk.js": "./static/js/1086.464de8f9.chunk.js",
@@ -154,6 +154,6 @@
154
154
  },
155
155
  "entrypoints": [
156
156
  "static/css/main.5513bd04.css",
157
- "static/js/main.61ca8755.js"
157
+ "static/js/main.829dd23b.js"
158
158
  ]
159
159
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.61ca8755.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.829dd23b.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5625],{15625:(e,t,r)=>{r.r(t),r.d(t,{default:()=>V});var n=r(58878),o=r(8151),i=Object.freeze({radio:"radio",checkbox:"checkbox"}),l=(Object.freeze({change:"change"}),"default"),a=r(35331),c=r(65266),u=(0,r(57224).I4)("div",(function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=1===r?void 0:t!==l?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}}));function s(e){return s="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},s(e)}function f(){return f=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},f.apply(this,arguments)}function d(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 p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){O(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function 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 n,o,i=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(c){a=!0,o=c}finally{try{l||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 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,n=new Array(t);r<t;r++)n[r]=e[r];return n}function h(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 m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function v(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=S(e);if(t){var o=S(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===s(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}(this,r)}}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}u.displayName="StyledRoot",u.displayName="StyledRoot";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&&m(e,t)}(d,e);var t,r,o,s=v(d);function d(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return O(g(e=s.call.apply(s,[this].concat(r))),"childRefs",{}),e}return t=d,r=[{key:"render",value:function(){var e=this,t=this.props,r=t.overrides,o=void 0===r?{}:r,s=t.mode,d=void 0===s?i.checkbox:s,b=t.children,h=t.selected,m=t.disabled,v=t.onClick,g=t.kind,S=t.shape,O=t.size,C=y((0,a._O)(o.Root,u),2),L=C[0],j=C[1],w=this.props["aria-label"]||this.props.ariaLabel,E=d===i.radio,k=n.Children.count(b);return n.createElement(c.U.Consumer,null,(function(t){return n.createElement(L,f({"aria-label":w||t.buttongroup.ariaLabel,"data-baseweb":"button-group",role:E?"radiogroup":"group",$shape:S,$length:b.length},j),n.Children.map(b,(function(t,r){if(!n.isValidElement(t))return null;var o=t.props.isSelected?t.props.isSelected:function(e,t){return!(!Array.isArray(e)&&"number"!==typeof e)&&(Array.isArray(e)?e.includes(t):e===t)}(h,r);return E&&(e.childRefs[r]=n.createRef()),n.cloneElement(t,{disabled:m||t.props.disabled,isSelected:o,ref:E?e.childRefs[r]:void 0,tabIndex:!E||o||E&&(!h||-1===h)&&0===r?0:-1,onKeyDown:function(t){if(E){var r=Number(h)?Number(h):0;if("ArrowUp"===t.key||"ArrowLeft"===t.key){t.preventDefault&&t.preventDefault();var n=r-1<0?k-1:r-1;v&&v(t,n),e.childRefs[n].current&&e.childRefs[n].current.focus()}if("ArrowDown"===t.key||"ArrowRight"===t.key){t.preventDefault&&t.preventDefault();var o=r+1>k-1?0:r+1;v&&v(t,o),e.childRefs[o].current&&e.childRefs[o].current.focus()}}},kind:g,onClick:function(e){m||(t.props.onClick&&t.props.onClick(e),v&&v(e,r))},shape:S,size:O,overrides:p({BaseButton:{style:function(e){var t=e.$theme;return 1===b.length?{}:S!==l?{marginLeft:t.sizing.scale100,marginRight:t.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":o,role:E?"radio":"checkbox"}}},t.props.overrides)})})))}))}}],r&&h(t.prototype,r),o&&h(t,o),Object.defineProperty(t,"prototype",{writable:!1}),d}(n.Component);O(C,"defaultProps",{disabled:!1,onClick:function(){},shape:l,size:"default",kind:"secondary"});var L=r(34914),j=r(84720),w=r(36459),E=r(94426),k=r(29669),R=r(70474),P=r(78286),I=r(93480),M=r(997),x=r(25571),A=r(3101),_=r(90782);function D(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function T(e,t,r,o,i,l){const a=function(e,t,r,n){return r.indexOf(n)>-1||t===k.e2.ClickMode.SINGLE_SELECT&&e===k.e2.SelectionVisualization.ALL_UP_TO_SELECTED&&r.length>0&&n<r[0]}(r,o,i,t);let c=e.content,u=e.contentIcon;return a&&(c=e.selectedContent?e.selectedContent:c,u=e.selectedContentIcon?e.selectedContentIcon:u),(0,n.forwardRef)((function(t,r){var n,o;const{element:i,kind:s,size:f}=function(e,t,r){const n=r===k.e2.Style.PILLS?j.KX.PILLS:r===k.e2.Style.BORDERLESS?j.KX.BORDERLESS_ICON:j.KX.SEGMENT,o=r===k.e2.Style.BORDERLESS?j.Pj.XSMALL:j.Pj.MEDIUM,i=r===k.e2.Style.BORDERLESS?"lg":"base";return{element:(0,_.jsxs)(_.Fragment,{children:[t&&(0,_.jsx)(E.$,{size:i,iconValue:t}),e&&(0,_.jsx)(L.Ay,{source:e,allowHTML:!1})]}),kind:n,size:o}}(null!==(n=c)&&void 0!==n?n:"",null!==(o=u)&&void 0!==o?o:void 0,l),d=function(e,t){return e&&(t=`${t}Active`),t}(!(!a||e.selectedContent||e.selectedContentIcon),s);return(0,_.jsx)(w.Ay,{...t,size:f,kind:d,children:i})}))}function F(e,t){return e.getIntArrayValue(t)}function z(e){var t;return null!==(t=e.default)&&void 0!==t?t:null}function U(e){var t;return null!==(t=e.value)&&void 0!==t?t:null}function B(e){var t;const{disabled:r,element:l,fragmentId:a,widgetMgr:c}=e,{clickMode:u,options:s,selectionVisualization:f,style:d,label:p,labelVisibility:y,help:b}=l,h=(0,o.u)(),[m,v]=(0,A.t)({getStateFromWidgetMgr:F,getDefaultStateFromProto:z,getCurrStateFromProto:U,updateWidgetMgrState:D,element:l,widgetMgr:c,fragmentId:a});let g;u===k.e2.ClickMode.SINGLE_SELECT?g=i.radio:u===k.e2.ClickMode.MULTI_SELECT&&(g=i.checkbox);const S=(0,n.useMemo)((()=>s.map(((e,t)=>{const r=T(e,t,f,u,m,d);return(0,_.jsx)(r,{},`${e.content}-${t}`)}))),[u,s,f,d,m]),O=d===k.e2.Style.BORDERLESS?h.spacing.threeXS:h.spacing.twoXS;return(0,_.jsxs)("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[(0,_.jsx)(R.L,{label:p,disabled:r,labelVisibility:(0,x.yv)(null!==(t=null===y||void 0===y?void 0:y.value)&&void 0!==t?t:k.Qx.LabelVisibilityOptions.COLLAPSED),children:b&&(0,_.jsx)(P.Cl,{children:(0,_.jsx)(I.A,{content:b,placement:M.W.TOP})})}),(0,_.jsx)(C,{disabled:r,mode:g,onClick:(e,t)=>{const r=function(e,t,r){return e==k.e2.ClickMode.MULTI_SELECT?function(e,t){return t.includes(e)?t.filter((t=>t!==e)):[...t,e]}(t,null!==r&&void 0!==r?r:[]):null!==r&&void 0!==r&&r.includes(t)?[]:[t]}(u,t,m);v({value:r,fromUi:!0})},selected:u===k.e2.ClickMode.MULTI_SELECT?m:(L=m,0===L.length?-1:L[0]),overrides:{Root:{style:{flexWrap:"wrap",gap:O}}},children:S})]});var L}const V=(0,n.memo)(B)},34752:(e,t,r)=>{r.d(t,{X:()=>l,o:()=>i});var n=r(58878),o=r(25571);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,o.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o._L)(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}}function l(e){let{element:t,widgetMgr:r,onFormCleared:i}=e;(0,n.useEffect)((()=>{if(!(0,o._L)(t.formId))return;const e=r.addFormClearedListener(t.formId,i);return()=>{e.disconnect()}}),[t,r,i])}},3101:(e,t,r)=>{r.d(t,{t:()=>l});var n=r(58878),o=r(34752),i=r(25571);function l(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:r,getCurrStateFromProto:l,updateWidgetMgrState:a,element:c,widgetMgr:u,fragmentId:s}=e;const[f,d]=(0,n.useState)((()=>{var e;return null!==(e=t(u,c))&&void 0!==e?e:r(c)})),[p,y]=(0,n.useState)({value:f,fromUi:!1});(0,n.useEffect)((()=>{(0,i.hX)(p)||(y(null),d(p.value),a(c,u,p,s))}),[p,a,c,u,s]),(0,n.useEffect)((()=>{c.setValue&&(c.setValue=!1,y({value:l(c),fromUi:!1}))}),[c,l]);const b=(0,n.useCallback)((()=>{y({value:r(c),fromUi:!0})}),[y,c,r]);return(0,o.X)({widgetMgr:u,element:c,onFormCleared:b}),[f,y]}}}]);