streamlit 1.48.0__py3-none-any.whl → 1.49.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. streamlit/__init__.py +3 -10
  2. streamlit/commands/logo.py +4 -3
  3. streamlit/commands/navigation.py +1 -1
  4. streamlit/commands/page_config.py +4 -1
  5. streamlit/components/v1/custom_component.py +2 -2
  6. streamlit/config.py +82 -1
  7. streamlit/connections/snowflake_connection.py +3 -1
  8. streamlit/delta_generator.py +3 -0
  9. streamlit/elements/arrow.py +155 -70
  10. streamlit/elements/bokeh_chart.py +13 -3
  11. streamlit/elements/deck_gl_json_chart.py +0 -1
  12. streamlit/elements/dialog_decorator.py +7 -59
  13. streamlit/elements/form.py +10 -1
  14. streamlit/elements/graphviz_chart.py +57 -6
  15. streamlit/elements/heading.py +17 -16
  16. streamlit/elements/iframe.py +13 -22
  17. streamlit/elements/image.py +64 -37
  18. streamlit/elements/layouts.py +2 -2
  19. streamlit/elements/lib/built_in_chart_utils.py +2 -5
  20. streamlit/elements/lib/column_config_utils.py +18 -4
  21. streamlit/elements/lib/column_types.py +75 -30
  22. streamlit/elements/lib/dialog.py +3 -3
  23. streamlit/elements/lib/image_utils.py +19 -11
  24. streamlit/elements/lib/layout_utils.py +15 -2
  25. streamlit/elements/lib/utils.py +20 -41
  26. streamlit/elements/markdown.py +7 -6
  27. streamlit/elements/media.py +6 -13
  28. streamlit/elements/metric.py +78 -1
  29. streamlit/elements/pdf.py +192 -0
  30. streamlit/elements/plotly_chart.py +3 -2
  31. streamlit/elements/pyplot.py +53 -11
  32. streamlit/elements/toast.py +81 -5
  33. streamlit/elements/vega_charts.py +3 -8
  34. streamlit/elements/widgets/audio_input.py +0 -1
  35. streamlit/elements/widgets/button.py +0 -4
  36. streamlit/elements/widgets/button_group.py +5 -4
  37. streamlit/elements/widgets/camera_input.py +0 -1
  38. streamlit/elements/widgets/chat.py +11 -13
  39. streamlit/elements/widgets/checkbox.py +0 -1
  40. streamlit/elements/widgets/color_picker.py +0 -1
  41. streamlit/elements/widgets/data_editor.py +142 -62
  42. streamlit/elements/widgets/file_uploader.py +74 -37
  43. streamlit/elements/widgets/multiselect.py +0 -1
  44. streamlit/elements/widgets/number_input.py +0 -1
  45. streamlit/elements/widgets/radio.py +0 -1
  46. streamlit/elements/widgets/select_slider.py +0 -1
  47. streamlit/elements/widgets/selectbox.py +0 -1
  48. streamlit/elements/widgets/slider.py +0 -1
  49. streamlit/elements/widgets/text_widgets.py +0 -2
  50. streamlit/elements/widgets/time_widgets.py +0 -2
  51. streamlit/errors.py +11 -0
  52. streamlit/material_icon_names.py +1 -1
  53. streamlit/proto/Arrow_pb2.py +14 -8
  54. streamlit/proto/Arrow_pb2.pyi +11 -3
  55. streamlit/proto/Block_pb2.py +16 -16
  56. streamlit/proto/Block_pb2.pyi +2 -0
  57. streamlit/proto/ChatInput_pb2.py +3 -3
  58. streamlit/proto/ChatInput_pb2.pyi +2 -0
  59. streamlit/proto/FileUploader_pb2.py +2 -2
  60. streamlit/proto/FileUploader_pb2.pyi +5 -1
  61. streamlit/proto/GraphVizChart_pb2.py +4 -2
  62. streamlit/proto/GraphVizChart_pb2.pyi +1 -1
  63. streamlit/proto/IFrame_pb2.py +8 -2
  64. streamlit/proto/IFrame_pb2.pyi +3 -0
  65. streamlit/proto/Image_pb2.py +4 -2
  66. streamlit/proto/Image_pb2.pyi +1 -10
  67. streamlit/proto/Metric_pb2.py +8 -6
  68. streamlit/proto/Metric_pb2.pyi +34 -10
  69. streamlit/proto/Toast_pb2.py +2 -2
  70. streamlit/proto/Toast_pb2.pyi +10 -1
  71. streamlit/runtime/caching/__init__.py +14 -2
  72. streamlit/runtime/caching/cache_data_api.py +0 -17
  73. streamlit/runtime/caching/cache_resource_api.py +0 -16
  74. streamlit/runtime/caching/cached_message_replay.py +8 -20
  75. streamlit/runtime/caching/hashing.py +31 -1
  76. streamlit/runtime/credentials.py +4 -4
  77. streamlit/runtime/fragment.py +0 -42
  78. streamlit/runtime/websocket_session_manager.py +1 -1
  79. streamlit/static/index.html +2 -2
  80. streamlit/static/manifest.json +224 -252
  81. streamlit/static/static/css/{index.CJVRHjQZ.css → index.C8X8rNzw.css} +1 -1
  82. streamlit/static/static/css/index.COe1010n.css +1 -0
  83. streamlit/static/static/js/{ErrorOutline.esm.D_4oFNKB.js → ErrorOutline.esm.u9XvzxL8.js} +1 -1
  84. streamlit/static/static/js/{FileDownload.esm.NPgaLlUE.js → FileDownload.esm.CaRyZ-b2.js} +1 -1
  85. streamlit/static/static/js/FileHelper.Dk2SwIi3.js +5 -0
  86. streamlit/static/static/js/FormClearHelper.l_UPPvkg.js +1 -0
  87. streamlit/static/static/js/{Hooks.BGm9sd4U.js → Hooks.BxrVEftw.js} +1 -1
  88. streamlit/static/static/js/InputInstructions.C254RU9X.js +1 -0
  89. streamlit/static/static/js/Particles.DkY6FDnc.js +1 -0
  90. streamlit/static/static/js/ProgressBar.BPtSM82n.js +2 -0
  91. streamlit/static/static/js/Toolbar.BO_3WBaS.js +1 -0
  92. streamlit/static/static/js/{base-input.DeBqm5mN.js → base-input.egUI4LjJ.js} +4 -4
  93. streamlit/static/static/js/{checkbox.C0odQfKb.js → checkbox.ButpszcE.js} +2 -2
  94. streamlit/static/static/js/createSuper.DYJA5xa6.js +1 -0
  95. streamlit/static/static/js/data-grid-overlay-editor.C9gQLEnU.js +1 -0
  96. streamlit/static/static/js/{downloader.Bx1D0jhz.js → downloader.B3TjsSPZ.js} +1 -1
  97. streamlit/static/static/js/es6.BYSNuG4D.js +2 -0
  98. streamlit/static/static/js/iframeResizer.contentWindow.CNPHJsF2.js +1 -0
  99. streamlit/static/static/js/index.0tDq1WXk.js +1 -0
  100. streamlit/static/static/js/index.BBnWuh07.js +976 -0
  101. streamlit/static/static/js/index.BDZorv41.js +1 -0
  102. streamlit/static/static/js/{index.DwaoC4Zp.js → index.BH79B25f.js} +3 -3
  103. streamlit/static/static/js/index.BeTC4Yl-.js +197 -0
  104. streamlit/static/static/js/index.BnOd05Ko.js +2 -0
  105. streamlit/static/static/js/index.BoJaJReB.js +1 -0
  106. streamlit/static/static/js/index.Bp1Of6L8.js +1 -0
  107. streamlit/static/static/js/index.Bpe4-O2W.js +1 -0
  108. streamlit/static/static/js/index.BrD9sbpx.js +1 -0
  109. streamlit/static/static/js/index.C1qCS-sd.js +1 -0
  110. streamlit/static/static/js/index.C3EXAI-u.js +1 -0
  111. streamlit/static/static/js/index.C77g9sAQ.js +3 -0
  112. streamlit/static/static/js/{index.PyIqRRSR.js → index.CFePF7s4.js} +1 -1
  113. streamlit/static/static/js/index.CFjU0x00.js +1 -0
  114. streamlit/static/static/js/index.Ca3y4ztK.js +1 -0
  115. streamlit/static/static/js/{index.ClRTsv8m.js → index.Cb9gN2T2.js} +2 -2
  116. streamlit/static/static/js/{index.wDYef4mQ.js → index.CbwuUwu4.js} +9 -9
  117. streamlit/static/static/js/index.CeXLlclc.js +1 -0
  118. streamlit/static/static/js/index.CfiZGqj3.js +3 -0
  119. streamlit/static/static/js/index.CjQnYKID.js +1 -0
  120. streamlit/static/static/js/index.Cl_966eE.js +3858 -0
  121. streamlit/static/static/js/{index.DCpyIFTV.js → index.CqSRo6zQ.js} +1 -1
  122. streamlit/static/static/js/index.CuEFSQ-o.js +1 -0
  123. streamlit/static/static/js/index.D4jR1m1z.js +1 -0
  124. streamlit/static/static/js/index.DGcW849X.js +1 -0
  125. streamlit/static/static/js/index.DKb-BAE2.js +1 -0
  126. streamlit/static/static/js/index.DP1rDFP0.js +1 -0
  127. streamlit/static/static/js/{index.HeVbRh9H.js → index.DStzYLqM.js} +2 -2
  128. streamlit/static/static/js/index.DVKQKDLu.js +1 -0
  129. streamlit/static/static/js/index.DWedOrkQ.js +1 -0
  130. streamlit/static/static/js/index.DYbRPmVF.js +1 -0
  131. streamlit/static/static/js/index.DgpIMUsr.js +1 -0
  132. streamlit/static/static/js/index.DtwkPJs5.js +5367 -0
  133. streamlit/static/static/js/{index.CnfWsQzS.js → index.MQLQLR5Z.js} +1 -1
  134. streamlit/static/static/js/index.uInpwWAP.js +1 -0
  135. streamlit/static/static/js/index.z992t-BQ.js +7 -0
  136. streamlit/static/static/js/{input.BL2buuce.js → input.CbP5ZuQ7.js} +2 -2
  137. streamlit/static/static/js/{memory.CUxjUWS7.js → memory.BuacVo2L.js} +1 -1
  138. streamlit/static/static/js/number-overlay-editor.BZb9zRl_.js +9 -0
  139. streamlit/static/static/js/{possibleConstructorReturn.DbvQboK3.js → possibleConstructorReturn.DSM84rOS.js} +1 -1
  140. streamlit/static/static/js/{sandbox.6lnFVWhX.js → sandbox.C480llMG.js} +1 -1
  141. streamlit/static/static/js/{timepicker.Bg4xAK95.js → timepicker.BunxCVp7.js} +4 -4
  142. streamlit/static/static/js/{toConsumableArray.D9x7Ktv4.js → toConsumableArray.B4o8rEx1.js} +3 -3
  143. streamlit/static/static/js/uniqueId.tii0yosY.js +1 -0
  144. streamlit/static/static/js/{useBasicWidgetState.CUSYQZpm.js → useBasicWidgetState.Bnm4FD6K.js} +1 -1
  145. streamlit/static/static/js/useTextInputAutoExpand.Dgtwc1m0.js +2 -0
  146. streamlit/static/static/js/useUpdateUiValue.DjXdMFGw.js +1 -0
  147. streamlit/static/static/js/withFullScreenWrapper.0cy2pVf5.js +1 -0
  148. streamlit/static/static/media/MaterialSymbols-Rounded.CBxVaFdk.woff2 +0 -0
  149. streamlit/user_info.py +16 -13
  150. streamlit/web/server/browser_websocket_handler.py +15 -0
  151. streamlit/web/server/oauth_authlib_routes.py +3 -59
  152. {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/METADATA +4 -2
  153. {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/RECORD +157 -160
  154. streamlit/static/static/css/index.CQt5TjGB.css +0 -1
  155. streamlit/static/static/js/FileHelper.B2t9ikoS.js +0 -5
  156. streamlit/static/static/js/FormClearHelper.BLEIUk6L.js +0 -1
  157. streamlit/static/static/js/InputInstructions.DtUxCBS8.js +0 -1
  158. streamlit/static/static/js/Particles.BDRPO7r3.js +0 -1
  159. streamlit/static/static/js/ProgressBar.B64DUUqp.js +0 -2
  160. streamlit/static/static/js/Toolbar.B3FquPk5.js +0 -1
  161. streamlit/static/static/js/createSuper.DqQ5L3XG.js +0 -1
  162. streamlit/static/static/js/data-grid-overlay-editor.DbNsQa8Y.js +0 -1
  163. streamlit/static/static/js/es6.CbPK4m0H.js +0 -2
  164. streamlit/static/static/js/iframeResizer.contentWindow.CfLKrptA.js +0 -1
  165. streamlit/static/static/js/index.0XDwe9RV.js +0 -203
  166. streamlit/static/static/js/index.4lI9TuZm.js +0 -3
  167. streamlit/static/static/js/index.6s0nVIis.js +0 -3855
  168. streamlit/static/static/js/index.9E7bRUBU.js +0 -1
  169. streamlit/static/static/js/index.B9PgeLrZ.js +0 -1
  170. streamlit/static/static/js/index.B9vzGbOt.js +0 -1
  171. streamlit/static/static/js/index.BDrQKMCm.js +0 -1
  172. streamlit/static/static/js/index.BPsoiGgP.js +0 -1
  173. streamlit/static/static/js/index.CJzdLAun.js +0 -1
  174. streamlit/static/static/js/index.CNNlC1NL.js +0 -1
  175. streamlit/static/static/js/index.CO1sClzJ.js +0 -2
  176. streamlit/static/static/js/index.CZnagxXD.js +0 -1
  177. streamlit/static/static/js/index.Cb0xSF7V.js +0 -5366
  178. streamlit/static/static/js/index.CgUt3tz_.js +0 -1
  179. streamlit/static/static/js/index.CjImmcsV.js +0 -1
  180. streamlit/static/static/js/index.CrJ1XD_V.js +0 -1
  181. streamlit/static/static/js/index.CtiKsjSC.js +0 -1
  182. streamlit/static/static/js/index.CwAuytgV.js +0 -1
  183. streamlit/static/static/js/index.D7GB-kly.js +0 -1
  184. streamlit/static/static/js/index.DA5wU0mQ.js +0 -1
  185. streamlit/static/static/js/index.DE9wNOje.js +0 -1
  186. streamlit/static/static/js/index.DHnB-C8A.js +0 -1
  187. streamlit/static/static/js/index.DRTn9zvD.js +0 -1
  188. streamlit/static/static/js/index.DjMjyJl9.js +0 -7
  189. streamlit/static/static/js/index.DvRPFfw6.js +0 -781
  190. streamlit/static/static/js/index.F9tSej94.js +0 -1
  191. streamlit/static/static/js/index.J2D_m7LY.js +0 -197
  192. streamlit/static/static/js/index.dfivzJNz.js +0 -1
  193. streamlit/static/static/js/index.mRztGO69.js +0 -3
  194. streamlit/static/static/js/index.tB1kn_7z.js +0 -1
  195. streamlit/static/static/js/mergeWith.C1kp1zIi.js +0 -1
  196. streamlit/static/static/js/number-overlay-editor.WpheGpmR.js +0 -9
  197. streamlit/static/static/js/threshold.DjX0wlsa.js +0 -1
  198. streamlit/static/static/js/timer.CAwTRJ_g.js +0 -1
  199. streamlit/static/static/js/uniqueId.Bm8FHN92.js +0 -1
  200. streamlit/static/static/js/useTextInputAutoExpand.Bf2egQOG.js +0 -2
  201. streamlit/static/static/js/useUpdateUiValue.lE5xnYWF.js +0 -1
  202. streamlit/static/static/js/value.CgPGBV_l.js +0 -1
  203. streamlit/static/static/js/withFullScreenWrapper.CCOXR7N6.js +0 -1
  204. streamlit/static/static/media/MaterialSymbols-Rounded.DsbC8sYI.woff2 +0 -0
  205. {streamlit-1.48.0.data → streamlit-1.49.0.data}/scripts/streamlit.cmd +0 -0
  206. {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/WHEEL +0 -0
  207. {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/entry_points.txt +0 -0
  208. {streamlit-1.48.0.dist-info → streamlit-1.49.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ import{r as y,E as O,_ as T,v as I,t as X,e as F,j as p,an as Q,P as B,b as J,B as K,ao as W,be as L,b0 as Y,a5 as Z,aQ as ee,u as te,a0 as re,bf as ie,bg as oe,x as ne,aR as ae,m as P,bh as se,bi as le,l as de,R as ce,T as ue,W as fe,F as he}from"./index.BBnWuh07.js";import{U as z}from"./UploadFileInfo.C-jY39rj.js";import{F as pe}from"./FormClearHelper.l_UPPvkg.js";import{P as ge,S as me}from"./ProgressBar.BPtSM82n.js";var k=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(O,T({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},i,{ref:l}),y.createElement("rect",{width:24,height:24,fill:"none"}),y.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});k.displayName="SwitchCamera";var $=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(O,T({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),y.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});$.displayName="Video";var A=y.forwardRef(function(i,l){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(O,T({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},i,{ref:l}),y.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});A.displayName="X";function ve(i,l){switch(i){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const N=I("div",{target:"etzmx8d0"})({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"}),V=I("div",{target:"etzmx8d1"})(({theme:i,width:l})=>({backgroundColor:i.colors.secondaryBg,borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"})),Se=I("p",{target:"etzmx8d2"})(({theme:i})=>({marginTop:i.spacing.sm,textAlign:"center"})),ye=I("img",{target:"etzmx8d3"})(({theme:i,opacity:l})=>({borderRadius:`${i.radii.default} ${i.radii.default} 0 0`,objectFit:"contain",opacity:l})),be=I("a",{target:"etzmx8d4"})(({theme:i})=>({color:i.colors.link,textDecoration:i.linkUnderline?"underline":"none",display:"block"})),Ce=I("span",{target:"etzmx8d5"})({display:"flex",alignItems:"center"}),we=I("div",{target:"etzmx8d6"})(({theme:i})=>({position:"absolute",top:i.spacing.lg,right:i.spacing.lg,zIndex:i.zIndices.priority,color:i.colors.fadedText40,mixBlendMode:"difference",opacity:.6})),Me=I("div",{target:"etzmx8d8"})({height:"fit-content",width:"100%",position:"absolute",bottom:0}),Ue=I("button",{target:"etzmx8d9"})(({theme:i})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:i.colors.lightenedBg05,border:`${i.sizes.borderWidth} solid ${i.colors.borderColor}`,borderRadius:`0 0 ${i.radii.default} ${i.radii.default}`,"&:hover":{borderColor:i.colors.primary,color:i.colors.primary},"&:active":{color:i.colors.white,borderColor:i.colors.primary,backgroundColor:i.colors.primary},"&:focus:not(:active)":{borderColor:i.colors.primary,color:i.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:i.colors.fadedText40,borderColor:i.colors.borderColor,backgroundColor:i.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,margin:i.spacing.none,lineHeight:i.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${X(i.colors.primary,.5)}`},...ve("medium",i)}));function Ie({disabled:i,onClick:l,children:t,progress:n}){return F(Ue,{disabled:i||!1,onClick:l||(()=>{}),progress:n||null,"data-testid":"stCameraInputButton",children:[t,n?p(Me,{children:p(ge,{value:n,size:me.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const H=y.memo(Ie);var R=function(i){return i.USER="user",i.ENVIRONMENT="environment",i}({});const Ee=({switchFacingMode:i})=>p(we,{"data-testid":"stCameraInputSwitchButton",children:p(Q,{content:"Switch camera",placement:B.TOP_RIGHT,children:p(J,{kind:K.MINIMAL,onClick:i,children:p(W,{content:k,size:"twoXL",color:L.white})})})}),Fe=y.memo(Ee);var _={exports:{}},xe=_.exports,j;function Pe(){return j||(j=1,function(i,l){(function(n,o){i.exports=o(Y())})(xe,function(t){return function(n){var o={};function a(s){if(o[s])return o[s].exports;var f=o[s]={i:s,l:!1,exports:{}};return n[s].call(f.exports,f,f.exports,a),f.l=!0,f.exports}return a.m=n,a.c=o,a.d=function(s,f,g){a.o(s,f)||Object.defineProperty(s,f,{enumerable:!0,get:g})},a.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},a.t=function(s,f){if(f&1&&(s=a(s)),f&8||f&4&&typeof s=="object"&&s&&s.__esModule)return s;var g=Object.create(null);if(a.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:s}),f&2&&typeof s!="string")for(var U in s)a.d(g,U,(function(M){return s[M]}).bind(null,U));return g},a.n=function(s){var f=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(f,"a",f),f},a.o=function(s,f){return Object.prototype.hasOwnProperty.call(s,f)},a.p="",a(a.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(n,o,a){a.r(o);var s=a("react"),f=function(){var m=function(u,e){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,d){r.__proto__=d}||function(r,d){for(var c in d)d.hasOwnProperty(c)&&(r[c]=d[c])},m(u,e)};return function(u,e){m(u,e);function r(){this.constructor=u}u.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),g=function(){return g=Object.assign||function(m){for(var u,e=1,r=arguments.length;e<r;e++){u=arguments[e];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(m[d]=u[d])}return m},g.apply(this,arguments)},U=function(m,u){var e={};for(var r in m)Object.prototype.hasOwnProperty.call(m,r)&&u.indexOf(r)<0&&(e[r]=m[r]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,r=Object.getOwnPropertySymbols(m);d<r.length;d++)u.indexOf(r[d])<0&&Object.prototype.propertyIsEnumerable.call(m,r[d])&&(e[r[d]]=m[r[d]]);return e};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(u){var e=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return e?new Promise(function(r,d){e.call(navigator,u,r,d)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function M(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var E=function(m){f(u,m);function u(e){var r=m.call(this,e)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return u.prototype.componentDidMount=function(){var e=this,r=e.state,d=e.props;if(this.unmounted=!1,!M()){d.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},u.prototype.componentDidUpdate=function(e){var r=this.props;if(!M()){r.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(e.audioConstraints)!==JSON.stringify(r.audioConstraints),c=JSON.stringify(e.videoConstraints)!==JSON.stringify(r.videoConstraints),C=e.minScreenshotWidth!==r.minScreenshotWidth,S=e.minScreenshotHeight!==r.minScreenshotHeight;(c||C||S)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},u.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},u.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map(function(r){e.removeTrack(r),r.stop()}),e.getAudioTracks().map(function(r){e.removeTrack(r),r.stop()})):e.stop())},u.prototype.stopAndCleanup=function(){var e=this.state;e.hasUserMedia&&(u.stopMediaStream(this.stream),e.src&&window.URL.revokeObjectURL(e.src))},u.prototype.getScreenshot=function(e){var r=this,d=r.state,c=r.props;if(!d.hasUserMedia)return null;var C=this.getCanvas(e);return C&&C.toDataURL(c.screenshotFormat,c.screenshotQuality)},u.prototype.getCanvas=function(e){var r=this,d=r.state,c=r.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var C=this.video.videoWidth,S=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var v=C/S;C=c.minScreenshotWidth||this.video.clientWidth,S=C/v,c.minScreenshotHeight&&S<c.minScreenshotHeight&&(S=c.minScreenshotHeight,C=S*v)}this.canvas=document.createElement("canvas"),this.canvas.width=e?.width||C,this.canvas.height=e?.height||S,this.ctx=this.canvas.getContext("2d")}var w=this,b=w.ctx,h=w.canvas;return b&&h&&(h.width=e?.width||h.width,h.height=e?.height||h.height,c.mirrored&&(b.translate(h.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,e?.width||h.width,e?.height||h.height),c.mirrored&&(b.scale(-1,1),b.translate(-h.width,0))),h},u.prototype.requestUserMedia=function(){var e=this,r=this.props,d=function(S,v){var w={video:typeof v<"u"?v:!0};r.audio&&(w.audio=typeof S<"u"?S:!0),e.requestUserMediaId++;var b=e.requestUserMediaId;navigator.mediaDevices.getUserMedia(w).then(function(h){e.unmounted||b!==e.requestUserMediaId?u.stopMediaStream(h):e.handleUserMedia(null,h)}).catch(function(h){e.handleUserMedia(h)})};if("mediaDevices"in navigator)d(r.audioConstraints,r.videoConstraints);else{var c=function(S){return{optional:[{sourceId:S}]}},C=function(S){var v=S.deviceId;return typeof v=="string"?v:Array.isArray(v)&&v.length>0?v[0]:typeof v=="object"&&v.ideal?v.ideal:null};MediaStreamTrack.getSources(function(S){var v=null,w=null;S.forEach(function(x){x.kind==="audio"?v=x.id:x.kind==="video"&&(w=x.id)});var b=C(r.audioConstraints);b&&(v=b);var h=C(r.videoConstraints);h&&(w=h),d(c(v),c(w))})}},u.prototype.handleUserMedia=function(e,r){var d=this.props;if(e||!r){this.setState({hasUserMedia:!1}),d.onUserMediaError(e);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}d.onUserMedia(r)},u.prototype.render=function(){var e=this,r=this,d=r.state,c=r.props,C=c.audio;c.forceScreenshotSourceSize;var S=c.disablePictureInPicture;c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var v=c.mirrored,w=c.style,b=w===void 0?{}:w,h=c.children,x=U(c,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),D=v?g(g({},b),{transform:(b.transform||"")+" scaleX(-1)"}):b,G={getScreenshot:this.getScreenshot.bind(this)};return s.createElement(s.Fragment,null,s.createElement("video",g({autoPlay:!0,disablePictureInPicture:S,src:d.src,muted:!C,playsInline:!0,ref:function(q){e.video=q},style:D},x)),h&&h(G))},u.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},u}(s.Component);o.default=E},react:function(n,o){n.exports=t}}).default})}(_)),_.exports}var Re=Pe();const _e=Z(Re),Oe=({width:i})=>F(V,{width:i,children:[p(W,{size:"threeXL",color:L.gray60,content:$}),F(Se,{children:["This app would like to use your camera.",p(be,{href:ie,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Te=({handleCapture:i,width:l,disabled:t,clearPhotoInProgress:n,setClearPhotoInProgress:o,facingMode:a,setFacingMode:s,testOverride:f})=>{const[g,U]=y.useState(f||"pending"),M=y.useRef(null),[E,m]=y.useState(l),u=y.useCallback(ee(1e3,m),[]);y.useEffect(()=>{u(l)},[l,u]);function e(){if(M.current!==null){const d=M.current.getScreenshot();i(d)}}const r=te();return F(N,{"data-testid":"stCameraInputWebcamComponent",children:[g!=="success"&&!t&&!n?p(Oe,{width:E}):re()&&p(Fe,{switchFacingMode:s}),p(V,{"data-testid":"stCameraInputWebcamStyledBox",hidden:g!=="success"&&!t&&!n,width:E,children:!t&&p(_e,{audio:!1,ref:M,screenshotFormat:"image/jpeg",screenshotQuality:1,width:E,height:E*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{U("error")},onUserMedia:()=>{U("success"),o(!1)},videoConstraints:{width:{ideal:E},facingMode:a}})}),p(H,{onClick:e,disabled:g!=="success"||t||n,children:"Take Photo"})]})},We=y.memo(Te),Ve=150,ze=ne.getLogger("CameraInput");class je extends y.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new pe,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=t=>{this.setState({clearPhotoInProgress:t})},this.setFacingMode=()=>{this.setState(t=>({facingMode:t.facingMode===R.USER?R.ENVIRONMENT:R.USER}))},this.handleCapture=t=>{if(t===null)return Promise.resolve();this.setState({imgSrc:t,shutter:!0,minShutterEffectPassed:!1});const n=o=>new Promise(a=>setTimeout(a,o));return Be(t,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(a=>({file:o,fileUrls:a[0]}))).then(({file:o,fileUrls:a})=>this.uploadFile(a,o)).then(()=>n(Ve)).then(()=>{this.setState((o,a)=>({imgSrc:t,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{ze.error(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(t=>this.deleteFile(t.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:n,widgetMgr:o,fragmentId:a}=this.props,s=o.getFileUploaderStateValue(n);ae(t,s)||o.setFileUploaderStateValue(n,t,{fromUi:!0},a)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(P(t))return;this.setState({imgSrc:null});const{widgetMgr:n,element:o,fragmentId:a}=this.props;n.setFileUploaderStateValue(o,t,{fromUi:!0},a)})},this.deleteFile=t=>{const n=this.getFile(t);P(n)||(n.status.type==="uploading"&&n.status.abortController.abort(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(n.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{this.setState(n=>({files:[...n.files,t]}))},this.removeFile=t=>{this.setState(n=>({files:n.files.filter(o=>o.id!==t)}))},this.getFile=t=>this.state.files.find(n=>n.id===t),this.updateFile=(t,n)=>{this.setState(o=>({files:o.files.map(a=>a.id===t?n:a)}))},this.onUploadComplete=(t,n)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(t);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}))},this.onUploadProgress=(t,n)=>{const o=this.getFile(n);if(P(o)||o.status.type!=="uploading")return;const a=Math.round(t.loaded*100/t.total);o.status.progress!==a&&this.updateFile(n,o.setStatus({type:"uploading",abortController:o.status.abortController,progress:a}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(t,n)=>{const o=new AbortController,a=new z(n.name,n.size,this.nextLocalFileId(),{type:"uploading",abortController:o,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,n,s=>this.onUploadProgress(s,a.id),o.signal).then(()=>this.onUploadComplete(a.id,t)).catch(s=>{s instanceof DOMException&&s.name==="AbortError"||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:s?s.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:R.USER},{widgetMgr:t,element:n}=this.props,o=t.getFileUploaderStateValue(n);if(P(o))return l;const{uploadedFileInfo:a}=o;return P(a)||a.length===0?l:{files:a.map(s=>{const f=s.name,g=s.size,U=s.fileId,M=s.fileUrls;return new z(f,g,this.nextLocalFileId(),{type:"uploaded",fileId:U,fileUrls:M})}),imgSrc:a.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:R.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=t=>t.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:t,widgetMgr:n,fragmentId:o}=this.props;n.getFileUploaderStateValue(t)===void 0&&n.setFileUploaderStateValue(t,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:n,size:o,status:a}=t;return new se({fileId:a.fileId,fileUrls:a.fileUrls,name:n,size:o})});return new le({uploadedFileInfo:l})}render(){const{element:l,widgetMgr:t,disabled:n,width:o}=this.props;return this.formClearHelper.manageFormClearListener(t,l.formId,this.onFormCleared),F(N,{className:"stCameraInput","data-testid":"stCameraInput",children:[p(fe,{label:l.label,disabled:n,labelVisibility:de(l.labelVisibility?.value),children:l.help&&p(ce,{children:p(ue,{content:l.help,placement:B.TOP_RIGHT})})}),this.state.imgSrc?F(he,{children:[p(V,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&p(ye,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:o*9/16})}),p(H,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||n,children:this.getProgress()?"Uploading...":F(Ce,{children:[p(W,{content:A,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):p(We,{handleCapture:this.handleCapture,width:o,disabled:n,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function Be(i,l){return fetch(i).then(t=>t.arrayBuffer()).then(t=>new File([t],l,{type:"image/jpeg"}))}const Ne=oe(je);export{Ne as default};
@@ -0,0 +1,3 @@
1
+ import{bq as ce,bw as pe,bx as fe,by as ge,bz as ye,bA as me,ap as ve,ad as be,aC as he,bB as Se,aq as Oe,bC as Ce,b0 as K,bD as Ie,v as ae,bE as Pe,bF as $e,r as H,M as _e,m as J,u as Te,e as Ee,j as z,l as Re,R as we,T as De,P as xe,W as Ae,Z as We}from"./index.BBnWuh07.js";import{u as Be}from"./useBasicWidgetState.Bnm4FD6K.js";import{T as Me}from"./timepicker.BunxCVp7.js";import"./FormClearHelper.l_UPPvkg.js";import"./possibleConstructorReturn.DSM84rOS.js";import"./createSuper.DYJA5xa6.js";var Ne=ce.Consumer;const Le=Object.freeze(Object.defineProperty({__proto__:null,ThemeConsumer:Ne,ThemeProvider:pe,createThemedStyled:fe,createThemedUseStyletron:ge,createThemedWithStyle:ye,expandBorderStyles:me,hexToRgb:ve,styled:be,useStyletron:he,withStyle:Se,withWrapper:Oe},Symbol.toStringTag,{value:"Module"}));var C={};const Y=Ce(Le);var w={},X;function Fe(){if(X)return w;X=1,Object.defineProperty(w,"__esModule",{value:!0}),w.STATE_CHANGE_TYPE=w.SIZE=w.ENHANCER_POSITION=w.CUSTOM_INPUT_TYPE=w.ADJOINED=void 0;var f={change:"change"};w.STATE_CHANGE_TYPE=f;var c={textarea:"textarea"};w.CUSTOM_INPUT_TYPE=c;var h={none:"none",left:"left",right:"right",both:"both"};w.ADJOINED=h;var m={mini:"mini",default:"default",compact:"compact",large:"large"};w.SIZE=m;var b={start:"start",end:"end"};return w.ENHANCER_POSITION=b,w}var q={},A={},k={},Q;function ze(){if(Q)return k;Q=1,Object.defineProperty(k,"__esModule",{value:!0}),k.default=c;function f(m){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},f(m)}function c(m){m=m||{};for(var b=arguments.length<=1?0:arguments.length-1,v,y,S=0;S<b;S++){v=(S+1<1||arguments.length<=S+1?void 0:arguments[S+1])||{};for(var g in v)f(v[g])!==void 0&&(y=v[g],h(y)?m[g]=c(m[g]||Array.isArray(y)&&[]||{},y):m[g]=y)}return m}function h(m){return Array.isArray(m)||{}.toString.call(m)=="[object Object]"}return k}var ee;function le(){if(ee)return A;ee=1,Object.defineProperty(A,"__esModule",{value:!0}),A.getOverride=E,A.getOverrideProps=_,A.getOverrides=L,A.mergeConfigurationOverrides=N,A.mergeOverride=x,A.mergeOverrides=M,A.toObjectOverride=D,A.useOverrides=F;var f=v(K()),c=Ie(),h=m(ze());function m(i){return i&&i.__esModule?i:{default:i}}function b(i){if(typeof WeakMap!="function")return null;var t=new WeakMap,u=new WeakMap;return(b=function(r){return r?u:t})(i)}function v(i,t){if(i&&i.__esModule)return i;if(i===null||P(i)!=="object"&&typeof i!="function")return{default:i};var u=b(t);if(u&&u.has(i))return u.get(i);var s={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in i)if(a!=="default"&&Object.prototype.hasOwnProperty.call(i,a)){var l=r?Object.getOwnPropertyDescriptor(i,a):null;l&&(l.get||l.set)?Object.defineProperty(s,a,l):s[a]=i[a]}return s.default=i,u&&u.set(i,s),s}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var u=arguments[t];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(i[s]=u[s])}return i},y.apply(this,arguments)}function S(i,t){var u=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),u.push.apply(u,s)}return u}function g(i){for(var t=1;t<arguments.length;t++){var u=arguments[t]!=null?arguments[t]:{};t%2?S(Object(u),!0).forEach(function(s){$(i,s,u[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):S(Object(u)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(u,s))})}return i}function $(i,t,u){return t in i?Object.defineProperty(i,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[t]=u,i}function P(i){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(i)}function E(i){return(0,c.isValidElementType)(i)?i:i&&P(i)==="object"?i.component:i}function _(i){return i&&P(i)==="object"?P(i.props)==="object"?g(g({},i.props),{},{$style:i.style}):{$style:i.style}:{}}function D(i){return(0,c.isValidElementType)(i)?{component:i}:i||{}}function L(i,t){var u=E(i)||t;if(i&&P(i)==="object"&&typeof i.props=="function"){var s=f.forwardRef(function(a,l){var n=i.props(a),e=_(g(g({},i),{},{props:n}));return f.createElement(u,y({ref:l},e))});return s.displayName=u.displayName,[s,{}]}var r=_(i);return[u,r]}function M(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=Object.assign({},i,t),s=Object.keys(u);return s.reduce(function(r,a){return r[a]=x(D(i[a]),D(t[a])),r},{})}function x(i,t){var u=g(g({},i),t);return i.props&&t.props&&(u.props=N(i.props,t.props)),i.style&&t.style&&(u.style=N(i.style,t.style)),u}function N(i,t){return P(i)==="object"&&P(t)==="object"?(0,h.default)({},i,t):function(){return(0,h.default)({},typeof i=="function"?i.apply(void 0,arguments):i,typeof t=="function"?t.apply(void 0,arguments):t)}}function F(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return f.useMemo(function(){return Object.keys(i).reduce(function(u,s){return u[s]=L(t[s],i[s]),u},{})},[t])}return A}var j={},Z={},te;function Ze(){if(te)return Z;te=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.Svg=void 0,Z.getSvgStyles=c;var f=Y;function c(m){var b=m.$theme,v=m.$size,y=m.$color,S=b.sizing.scale600;v&&(b.sizing[v]?S=b.sizing[v]:typeof v=="number"?S="".concat(v,"px"):S=v);var g="currentColor";return y&&(b.colors[y]?g=b.colors[y]:g=y),{display:"inline-block",fill:g,color:g,height:S,width:S}}var h=(0,f.styled)("svg",c);return Z.Svg=h,h.displayName="Svg",h.displayName="Svg",Z}var V={},re;function qe(){if(re)return V;re=1,Object.defineProperty(V,"__esModule",{value:!0}),V.default=f;function f(c){var h={};for(var m in c)m[0]!=="$"&&(h[m]=c[m]);return h}return V}var ne;function je(){if(ne)return j;ne=1;function f(r){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},f(r)}Object.defineProperty(j,"__esModule",{value:!0}),j.default=void 0;var c=g(K()),h=le(),m=Ze(),b=y(qe()),v=["children","title","size","color","overrides"];function y(r){return r&&r.__esModule?r:{default:r}}function S(r){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(S=function(e){return e?l:a})(r)}function g(r,a){if(r&&r.__esModule)return r;if(r===null||f(r)!=="object"&&typeof r!="function")return{default:r};var l=S(a);if(l&&l.has(r))return l.get(r);var n={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)){var p=e?Object.getOwnPropertyDescriptor(r,o):null;p&&(p.get||p.set)?Object.defineProperty(n,o,p):n[o]=r[o]}return n.default=r,l&&l.set(r,n),n}function $(){return $=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(r[n]=l[n])}return r},$.apply(this,arguments)}function P(r,a){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);a&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),l.push.apply(l,n)}return l}function E(r){for(var a=1;a<arguments.length;a++){var l=arguments[a]!=null?arguments[a]:{};a%2?P(Object(l),!0).forEach(function(n){_(r,n,l[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):P(Object(l)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(l,n))})}return r}function _(r,a,l){return a in r?Object.defineProperty(r,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[a]=l,r}function D(r,a){return F(r)||N(r,a)||M(r,a)||L()}function L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M(r,a){if(r){if(typeof r=="string")return x(r,a);var l=Object.prototype.toString.call(r).slice(8,-1);if(l==="Object"&&r.constructor&&(l=r.constructor.name),l==="Map"||l==="Set")return Array.from(r);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return x(r,a)}}function x(r,a){(a==null||a>r.length)&&(a=r.length);for(var l=0,n=new Array(a);l<a;l++)n[l]=r[l];return n}function N(r,a){var l=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(l!=null){var n=[],e=!0,o=!1,p,d;try{for(l=l.call(r);!(e=(p=l.next()).done)&&(n.push(p.value),!(a&&n.length===a));e=!0);}catch(O){o=!0,d=O}finally{try{!e&&l.return!=null&&l.return()}finally{if(o)throw d}}return n}}function F(r){if(Array.isArray(r))return r}function i(r,a){if(r==null)return{};var l=t(r,a),n,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(e=0;e<o.length;e++)n=o[e],!(a.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(l[n]=r[n])}return l}function t(r,a){if(r==null)return{};var l={},n=Object.keys(r),e,o;for(o=0;o<n.length;o++)e=n[o],!(a.indexOf(e)>=0)&&(l[e]=r[e]);return l}var u=function(a,l){var n=a.children,e=a.title,o=a.size,p=a.color,d=a.overrides,O=d===void 0?{}:d,I=i(a,v),R=(0,h.getOverrides)(O.Svg,m.Svg),W=D(R,2),T=W[0],B=W[1],U=T.__STYLETRON__?E(E({title:e,$color:p,$size:o},I),B):E(E({title:e,color:p,size:o},(0,b.default)(I)),(0,b.default)(B));return c.createElement(T,$({"data-baseweb":"icon",ref:l},U),e?c.createElement("title",null,e):null,n)},s=c.forwardRef(u);return j.default=s,j}var oe;function ke(){if(oe)return q;oe=1;function f(t){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},f(t)}Object.defineProperty(q,"__esModule",{value:!0}),q.default=void 0;var c=g(K()),h=Y,m=le(),b=y(je()),v=["title","size","color","overrides"];function y(t){return t&&t.__esModule?t:{default:t}}function S(t){if(typeof WeakMap!="function")return null;var u=new WeakMap,s=new WeakMap;return(S=function(a){return a?s:u})(t)}function g(t,u){if(t&&t.__esModule)return t;if(t===null||f(t)!=="object"&&typeof t!="function")return{default:t};var s=S(u);if(s&&s.has(t))return s.get(t);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if(l!=="default"&&Object.prototype.hasOwnProperty.call(t,l)){var n=a?Object.getOwnPropertyDescriptor(t,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=t[l]}return r.default=t,s&&s.set(t,r),r}function $(){return $=Object.assign?Object.assign.bind():function(t){for(var u=1;u<arguments.length;u++){var s=arguments[u];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},$.apply(this,arguments)}function P(t,u){if(t==null)return{};var s=E(t,u),r,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],!(u.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function E(t,u){if(t==null)return{};var s={},r=Object.keys(t),a,l;for(l=0;l<r.length;l++)a=r[l],!(u.indexOf(a)>=0)&&(s[a]=t[a]);return s}function _(t,u){return N(t)||x(t,u)||L(t,u)||D()}function D(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(t,u){if(t){if(typeof t=="string")return M(t,u);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return M(t,u)}}function M(t,u){(u==null||u>t.length)&&(u=t.length);for(var s=0,r=new Array(u);s<u;s++)r[s]=t[s];return r}function x(t,u){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var r=[],a=!0,l=!1,n,e;try{for(s=s.call(t);!(a=(n=s.next()).done)&&(r.push(n.value),!(u&&r.length===u));a=!0);}catch(o){l=!0,e=o}finally{try{!a&&s.return!=null&&s.return()}finally{if(l)throw e}}return r}}function N(t){if(Array.isArray(t))return t}function F(t,u){var s=(0,h.useStyletron)(),r=_(s,2),a=r[1],l=t.title,n=l===void 0?"Delete Alt":l,e=t.size,o=t.color,p=t.overrides,d=p===void 0?{}:p,O=P(t,v),I=(0,m.mergeOverride)({component:a.icons&&a.icons.DeleteAlt?a.icons.DeleteAlt:null},d&&d.Svg?(0,m.toObjectOverride)(d.Svg):{});return c.createElement(b.default,$({viewBox:"0 0 24 24",ref:u,title:n,size:e,color:o,overrides:{Svg:I}},O),c.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 i=c.forwardRef(F);return q.default=i,q}var ie;function Ve(){if(ie)return C;ie=1,Object.defineProperty(C,"__esModule",{value:!0}),C.getRootStyles=C.getInputStyles=C.getInputContainerStyles=C.StyledMaskToggleButton=C.StyledClearIconContainer=C.StyledClearIcon=C.Root=C.InputEnhancer=C.InputContainer=C.Input=void 0;var f=Y,c=Fe(),h=m(ke());function m(n){return n&&n.__esModule?n:{default:n}}function b(n,e){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(n);e&&(p=p.filter(function(d){return Object.getOwnPropertyDescriptor(n,d).enumerable})),o.push.apply(o,p)}return o}function v(n){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?b(Object(o),!0).forEach(function(p){y(n,p,o[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach(function(p){Object.defineProperty(n,p,Object.getOwnPropertyDescriptor(o,p))})}return n}function y(n,e,o){return e in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o,n}var S=(0,f.styled)("button",function(n){var e,o=n.$theme,p=n.$size,d=n.$isFocusVisible,O=(e={},y(e,c.SIZE.mini,o.sizing.scale400),y(e,c.SIZE.compact,o.sizing.scale400),y(e,c.SIZE.default,o.sizing.scale300),y(e,c.SIZE.large,o.sizing.scale200),e)[p];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:O,paddingRight:O,outline:d?"solid 3px ".concat(o.colors.accent):"none",color:o.colors.contentPrimary}});C.StyledMaskToggleButton=S,S.displayName="StyledMaskToggleButton",S.displayName="StyledMaskToggleButton";var g=(0,f.styled)("div",function(n){var e,o=n.$alignTop,p=o===void 0?!1:o,d=n.$size,O=n.$theme,I=(e={},y(e,c.SIZE.mini,O.sizing.scale200),y(e,c.SIZE.compact,O.sizing.scale200),y(e,c.SIZE.default,O.sizing.scale100),y(e,c.SIZE.large,O.sizing.scale0),e)[d];return{display:"flex",alignItems:p?"flex-start":"center",paddingLeft:I,paddingRight:I,paddingTop:p?O.sizing.scale500:"0px",color:O.colors.contentPrimary}});C.StyledClearIconContainer=g,g.displayName="StyledClearIconContainer",g.displayName="StyledClearIconContainer";var $=(0,f.styled)(h.default,function(n){var e=n.$theme,o=n.$isFocusVisible;return{cursor:"pointer",outline:o?"solid 3px ".concat(e.colors.accent):"none"}});C.StyledClearIcon=$,$.displayName="StyledClearIcon",$.displayName="StyledClearIcon";function P(n,e){var o;return(o={},y(o,c.SIZE.mini,{paddingTop:e.scale100,paddingBottom:e.scale100,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.compact,{paddingTop:e.scale200,paddingBottom:e.scale200,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.default,{paddingTop:e.scale400,paddingBottom:e.scale400,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.large,{paddingTop:e.scale550,paddingBottom:e.scale550,paddingLeft:e.scale550,paddingRight:e.scale550}),o)[n]}function E(n,e,o,p,d){var O=n===c.ADJOINED.both||n===c.ADJOINED.left&&p!=="rtl"||n===c.ADJOINED.right&&p==="rtl"||d&&p==="rtl",I=n===c.ADJOINED.both||n===c.ADJOINED.right&&p!=="rtl"||n===c.ADJOINED.left&&p==="rtl"||d&&p!=="rtl";return{paddingLeft:O?o.scale550:"0px",paddingRight:I?o.scale550:"0px"}}function _(n,e){var o;return(o={},y(o,c.SIZE.mini,e.font100),y(o,c.SIZE.compact,e.font200),y(o,c.SIZE.default,e.font300),y(o,c.SIZE.large,e.font400),o)[n]}function D(n,e,o){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,d=arguments.length>4?arguments[4]:void 0;return n?{borderLeftColor:d.inputFillDisabled,borderRightColor:d.inputFillDisabled,borderTopColor:d.inputFillDisabled,borderBottomColor:d.inputFillDisabled,backgroundColor:d.inputFillDisabled}:e?{borderLeftColor:d.borderSelected,borderRightColor:d.borderSelected,borderTopColor:d.borderSelected,borderBottomColor:d.borderSelected,backgroundColor:d.inputFillActive}:o?{borderLeftColor:d.inputBorderError,borderRightColor:d.inputBorderError,borderTopColor:d.inputBorderError,borderBottomColor:d.inputBorderError,backgroundColor:d.inputFillError}:p?{borderLeftColor:d.inputBorderPositive,borderRightColor:d.inputBorderPositive,borderTopColor:d.inputBorderPositive,borderBottomColor:d.inputBorderPositive,backgroundColor:d.inputFillPositive}:{borderLeftColor:d.inputBorder,borderRightColor:d.inputBorder,borderTopColor:d.inputBorder,borderBottomColor:d.inputBorder,backgroundColor:d.inputFill}}function L(n,e){var o=e.inputBorderRadius;return n===c.SIZE.mini&&(o=e.inputBorderRadiusMini),{borderTopLeftRadius:o,borderBottomLeftRadius:o,borderTopRightRadius:o,borderBottomRightRadius:o}}var M=function(e){var o=e.$isFocused,p=e.$adjoined,d=e.$error,O=e.$disabled,I=e.$positive,R=e.$size,W=e.$theme,T=e.$theme,B=T.borders,U=T.colors,ue=T.sizing,se=T.typography,G=T.animation,de=e.$hasIconTrailing;return v(v(v(v({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},L(R,B)),_(R,se)),D(O,o,d,I,U)),E(p,R,ue,W.direction,de))};C.getRootStyles=M;var x=(0,f.styled)("div",M);C.Root=x,x.displayName="Root",x.displayName="Root";function N(n,e){var o;return(o={},y(o,c.SIZE.mini,{paddingRight:e.scale400,paddingLeft:e.scale400}),y(o,c.SIZE.compact,{paddingRight:e.scale400,paddingLeft:e.scale400}),y(o,c.SIZE.default,{paddingRight:e.scale300,paddingLeft:e.scale300}),y(o,c.SIZE.large,{paddingRight:e.scale200,paddingLeft:e.scale200}),o)[n]}function F(n,e,o,p,d){return n?{color:d.inputEnhancerTextDisabled,backgroundColor:d.inputFillDisabled}:e?{color:d.contentPrimary,backgroundColor:d.inputFillActive}:o?{color:d.contentPrimary,backgroundColor:d.inputFillError}:p?{color:d.contentPrimary,backgroundColor:d.inputFillPositive}:{color:d.contentPrimary,backgroundColor:d.inputFill}}var i=(0,f.styled)("div",function(n){var e=n.$size,o=n.$disabled,p=n.$isFocused,d=n.$error,O=n.$positive,I=n.$theme,R=I.colors,W=I.sizing,T=I.typography,B=I.animation;return v(v(v({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:B.timing200,transitionTimingFunction:B.easeOutCurve},_(e,T)),N(e,W)),F(o,p,d,O,R))});C.InputEnhancer=i,i.displayName="InputEnhancer",i.displayName="InputEnhancer";function t(n,e,o,p,d){return n?{color:d.inputTextDisabled,backgroundColor:d.inputFillDisabled}:e?{color:d.contentPrimary,backgroundColor:d.inputFillActive}:o?{color:d.contentPrimary,backgroundColor:d.inputFillError}:p?{color:d.contentPrimary,backgroundColor:d.inputFillPositive}:{color:d.contentPrimary,backgroundColor:d.inputFill}}var u=function(e){var o=e.$isFocused,p=e.$error,d=e.$disabled,O=e.$positive,I=e.$size,R=e.$theme,W=R.colors,T=R.typography,B=R.animation;return v(v({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:B.timing200,transitionTimingFunction:B.easeOutCurve},_(I,T)),t(d,o,p,O,W))};C.getInputContainerStyles=u;var s=(0,f.styled)("div",u);C.InputContainer=s,s.displayName="InputContainer",s.displayName="InputContainer";function r(n,e,o,p){return n?{color:p.inputTextDisabled,"-webkit-text-fill-color":p.inputTextDisabled,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholderDisabled}}:{color:p.contentPrimary,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholder}}}var a=function(e){var o=e.$disabled,p=e.$isFocused,d=e.$error,O=e.$size,I=e.$theme,R=I.colors,W=I.sizing,T=I.typography;return v(v(v({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:o?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},_(O,T)),P(O,W)),r(o,p,d,R))};C.getInputStyles=a;var l=(0,f.styled)("input",a);return C.Input=l,l.displayName="Input",l.displayName="Input",C}var He=Ve();const Ue=ae("div",{target:"e1hlhgmz0"})({position:"absolute",top:"50%",right:"2.05em"}),Je=ae(Pe,{shouldForwardProp:$e,target:"e1hlhgmz1"})(({theme:f,$isHighlighted:c})=>({paddingRight:f.spacing.lg,paddingLeft:f.spacing.lg,paddingTop:f.spacing.sm,paddingBottom:f.spacing.sm,background:c?f.colors.darkenedBgMix15:void 0,"&:hover, &:active, &:focus-visible":{background:f.colors.darkenedBgMix15}}));function Ke({disabled:f,element:c,widgetMgr:h,fragmentId:m}){const[b,v]=Be({getStateFromWidgetMgr:Ye,getDefaultStateFromProto:Ge,getCurrStateFromProto:Xe,updateWidgetMgrState:Qe,element:c,widgetMgr:h,fragmentId:m}),y=H.useContext(_e),S=J(c.default)&&!f,g=Te(),$={Select:{props:{disabled:f,overrides:{ControlContainer:{style:{height:g.sizes.minElementHeight,borderLeftWidth:g.sizes.borderWidth,borderRightWidth:g.sizes.borderWidth,borderTopWidth:g.sizes.borderWidth,borderBottomWidth:g.sizes.borderWidth}},IconsContainer:{style:()=>({paddingRight:g.spacing.sm})},ValueContainer:{style:()=>({lineHeight:g.lineHeights.inputWidget,paddingRight:g.spacing.sm,paddingLeft:g.spacing.md,paddingBottom:g.spacing.sm,paddingTop:g.spacing.sm})},SingleValue:{style:{fontWeight:g.fontWeights.normal},props:{"data-testid":"stTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:g.spacing.none,paddingBottom:g.spacing.none,boxShadow:"none",maxHeight:g.sizes.maxDropdownHeight})},DropdownListItem:{component:Je},Popover:{props:{ignoreBoundary:y,overrides:{Body:{style:()=>({marginTop:g.spacing.px})}}}},Placeholder:{style:()=>({color:g.colors.fadedText60})},SelectArrow:{component:We,props:{overrides:{Svg:{style:()=>({width:g.iconSizes.xl,height:g.iconSizes.xl})}}}}}}}},P=H.useCallback(_=>{const D=_===null?null:et(_);v({value:D,fromUi:!0})},[v]),E=H.useCallback(()=>{P(null)},[P]);return Ee("div",{className:"stTimeInput","data-testid":"stTimeInput",children:[z(Ae,{label:c.label,disabled:f,labelVisibility:Re(c.labelVisibility?.value),children:c.help&&z(we,{children:z(De,{content:c.help,placement:xe.TOP_RIGHT})})}),z(Me,{format:"24",step:c.step?Number(c.step):900,value:J(b)?void 0:tt(b),onChange:P,overrides:$,nullable:S,creatable:!0,"aria-label":c.label}),S&&!J(b)&&z(Ue,{onClick:E,"data-testid":"stTimeInputClearButton",children:z(He.StyledClearIcon,{overrides:{Svg:{style:{color:g.colors.darkGray,padding:g.spacing.threeXS,height:g.sizes.clearIconSize,width:g.sizes.clearIconSize,":hover":{fill:g.colors.bodyText}}}},$isFocusVisible:!1})})]})}function Ye(f,c){return f.getStringValue(c)??null}function Ge(f){return f.default??null}function Xe(f){return f.value??null}function Qe(f,c,h,m){c.setStringValue(f,h.value,{fromUi:h.fromUi},m)}function et(f){const c=f.getHours().toString().padStart(2,"0"),h=f.getMinutes().toString().padStart(2,"0");return`${c}:${h}`}function tt(f){if(f===null)return null;const[c,h]=f.split(":").map(Number),m=new Date;return m.setHours(c),m.setMinutes(h),m}const ut=H.memo(Ke);export{ut as default};
@@ -0,0 +1 @@
1
+ import{v as U,r as a,a6 as k,u as H,a7 as S,e as B,j as n,l as j,R as O,T as _,P as K,W as $,y as q,a8 as w}from"./index.BBnWuh07.js";import{u as A}from"./uniqueId.tii0yosY.js";import{I as G}from"./InputInstructions.C254RU9X.js";import{u as N}from"./useBasicWidgetState.Bnm4FD6K.js";import{u as J,a as M,b as Q}from"./useUpdateUiValue.DjXdMFGw.js";import{I as X}from"./input.CbP5ZuQ7.js";import"./FormClearHelper.l_UPPvkg.js";import"./inputUtils.CptNuJwn.js";import"./base-input.egUI4LjJ.js";const Y=U("div",{target:"e1o1zy6o0"})("position:relative;");function Z({disabled:o,element:t,widgetMgr:s,fragmentId:u}){const[r,c]=a.useState(()=>W(s,t)??null),{width:T,elementRef:y}=k(),[i,p]=a.useState(!1),x=a.useCallback(()=>{c(t.default??null),p(!0)},[t.default]),[V,m]=N({getStateFromWidgetMgr:W,getDefaultStateFromProto:tt,getCurrStateFromProto:et,updateWidgetMgrState:ot,element:t,widgetMgr:s,fragmentId:u,onFormCleared:x});J(V,r,c,i);const[C,g]=a.useState(!1),e=H(),[f]=a.useState(()=>A("text_input_")),{placeholder:F,formId:l,icon:d,maxChars:b}=t,h=a.useCallback(()=>{p(!1),m({value:r,fromUi:!0})},[r,m]),v=S({formId:l})?s.allowFormEnterToSubmit(l):i,E=C&&T>e.breakpoints.hideWidgetDetails,z=a.useCallback(()=>{i&&h(),g(!1)},[i,h]),R=a.useCallback(()=>{g(!0)},[]),P=M({formId:l,maxChars:b,setDirty:p,setUiValue:c,setValueWithSource:m}),L=Q(l,h,i,s,u),I=d?.startsWith(":material"),D=I?"lg":"base";return B(Y,{className:"stTextInput","data-testid":"stTextInput",ref:y,children:[n($,{label:t.label,disabled:o,labelVisibility:j(t.labelVisibility?.value),htmlFor:f,children:t.help&&n(O,{children:n(_,{content:t.help,placement:K.TOP_RIGHT})})}),n(X,{value:r??"",placeholder:F,onBlur:z,onFocus:R,onChange:P,onKeyPress:L,"aria-label":t.label,disabled:o,id:f,type:at(t),autoComplete:t.autocomplete,startEnhancer:d&&n(q,{"data-testid":"stTextInputIcon",iconValue:d,size:D}),overrides:{Input:{style:{fontWeight:e.fontWeights.normal,minWidth:0,lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:e.spacing.md,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,"::placeholder":{color:e.colors.fadedText60}}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,paddingLeft:d?e.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:e.iconSizes.lg,color:I?e.colors.fadedText60:"inherit"}}}}),E&&n(G,{dirty:i,value:r??"",maxLength:b,inForm:S({formId:l}),allowEnterToSubmit:v})]})}function W(o,t){return o.getStringValue(t)??null}function tt(o){return o.default??null}function et(o){return o.value??null}function ot(o,t,s,u){t.setStringValue(o,s.value,{fromUi:s.fromUi},u)}function at(o){return o.type===w.Type.PASSWORD?"password":"text"}const mt=a.memo(Z);export{mt as default};