streamlit-nightly 1.42.1.dev20250216__py2.py3-none-any.whl → 1.42.2.dev20250217__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. streamlit/elements/bokeh_chart.py +2 -3
  2. streamlit/elements/graphviz_chart.py +2 -3
  3. streamlit/elements/lib/column_types.py +97 -44
  4. streamlit/elements/lib/subtitle_utils.py +2 -2
  5. streamlit/elements/lib/utils.py +1 -2
  6. streamlit/elements/vega_charts.py +2 -5
  7. streamlit/runtime/caching/cache_utils.py +2 -3
  8. streamlit/runtime/caching/hashing.py +1 -2
  9. streamlit/runtime/forward_msg_cache.py +1 -5
  10. streamlit/runtime/fragment.py +3 -5
  11. streamlit/runtime/memory_media_file_storage.py +1 -2
  12. streamlit/static/index.html +1 -1
  13. streamlit/static/static/js/{FileDownload.esm.K0RIIaSL.js → FileDownload.esm.NwWY1bYI.js} +1 -1
  14. streamlit/static/static/js/{FileDropzone.DRcTUuNN.js → FileDropzone.CZxPg3X2.js} +1 -1
  15. streamlit/static/static/js/{FormClearHelper.Dha_cfuU.js → FormClearHelper.Doa6Lh7Q.js} +1 -1
  16. streamlit/static/static/js/{Hooks.BrulV197.js → Hooks.CxtftrJy.js} +1 -1
  17. streamlit/static/static/js/{InputInstructions.C_m6JNSV.js → InputInstructions.CWLH2hJc.js} +1 -1
  18. streamlit/static/static/js/{ProgressBar.CXgDz0lS.js → ProgressBar.WE22u_Ob.js} +1 -1
  19. streamlit/static/static/js/{RenderInPortalIfExists.DbjYtj_E.js → RenderInPortalIfExists.BUcod3KW.js} +1 -1
  20. streamlit/static/static/js/{Toolbar.B5RomQbU.js → Toolbar.C714dqzb.js} +1 -1
  21. streamlit/static/static/js/{base-input.B_U9Mij-.js → base-input.C0t7SpL6.js} +1 -1
  22. streamlit/static/static/js/{createSuper.DiPn7x2M.js → createSuper.ViswZ8TH.js} +1 -1
  23. streamlit/static/static/js/{data-grid-overlay-editor.CxpMznuV.js → data-grid-overlay-editor.BhPr4kO6.js} +1 -1
  24. streamlit/static/static/js/{downloader.CMxfwi0g.js → downloader.91Q7jIso.js} +1 -1
  25. streamlit/static/static/js/{es6.CWDfc2yc.js → es6.DNX_sNKu.js} +2 -2
  26. streamlit/static/static/js/{iframeResizer.contentWindow.CyCMpBzy.js → iframeResizer.contentWindow.CDWUcDmU.js} +1 -1
  27. streamlit/static/static/js/{index.CTrIDSw5.js → index.-b7dNs6l.js} +1 -1
  28. streamlit/static/static/js/{index.eP8uJaty.js → index.0VYiXfju.js} +1 -1
  29. streamlit/static/static/js/{index.vyj1usur.js → index.B3HJ1joN.js} +28 -28
  30. streamlit/static/static/js/{index.B7-ka68B.js → index.BJ2gQSjT.js} +1 -1
  31. streamlit/static/static/js/{index.FVzOj77v.js → index.BLBTL57W.js} +1 -1
  32. streamlit/static/static/js/{index.OiKVkRzb.js → index.BNP-YHIi.js} +1 -1
  33. streamlit/static/static/js/{index.CLXysuIS.js → index.BOAkIKUg.js} +1 -1
  34. streamlit/static/static/js/{index.CxX3WJZV.js → index.BU0eO7qf.js} +1 -1
  35. streamlit/static/static/js/{index.11KmKkMp.js → index.BVHKdy_B.js} +1 -1
  36. streamlit/static/static/js/{index.YBzhCbWe.js → index.BY7jwxwh.js} +1 -1
  37. streamlit/static/static/js/{index.BoLiyuG0.js → index.BeOYoTtD.js} +1 -1
  38. streamlit/static/static/js/{index.CMM3vxd_.js → index.Byw8b24h.js} +1 -1
  39. streamlit/static/static/js/{index.DcCioSks.js → index.C2dTzC3_.js} +1 -1
  40. streamlit/static/static/js/{index.DaR46enR.js → index.CC8zeoS7.js} +1 -1
  41. streamlit/static/static/js/{index.BW9gD4O1.js → index.CCj1lvY2.js} +1 -1
  42. streamlit/static/static/js/{index.Ctuil2Zq.js → index.CPeAZG1R.js} +1 -1
  43. streamlit/static/static/js/{index.Djk5RccG.js → index.CX29idWq.js} +1 -1
  44. streamlit/static/static/js/{index.CxT-55oh.js → index.ChTsHUaC.js} +1 -1
  45. streamlit/static/static/js/{index.Di8ddb5O.js → index.CiWJLcV9.js} +1 -1
  46. streamlit/static/static/js/{index.B9xlEQvM.js → index.DAlDuq3e.js} +1 -1
  47. streamlit/static/static/js/{index.CnzapoES.js → index.DZlSz8lf.js} +1 -1
  48. streamlit/static/static/js/{index.DsPUu3xS.js → index.Df7Lr-8j.js} +1 -1
  49. streamlit/static/static/js/{index.CBswNuTs.js → index.DoLrZkRU.js} +1 -1
  50. streamlit/static/static/js/{index.CmyE8x29.js → index.DxXPukev.js} +1 -1
  51. streamlit/static/static/js/{index.FjL8doTL.js → index.Dz2gm3-U.js} +1 -1
  52. streamlit/static/static/js/{index.CZjrVNQ3.js → index.FawRMwD-.js} +1 -1
  53. streamlit/static/static/js/{index.CGHmjGTj.js → index.VDF9za4g.js} +1 -1
  54. streamlit/static/static/js/{index.D4y-ZpWF.js → index.Vo9Xk_-P.js} +1 -1
  55. streamlit/static/static/js/{index.CrDkQv4h.js → index.aoRAdNJI.js} +1 -1
  56. streamlit/static/static/js/{index.DeuQX1T6.js → index.bLZVjplR.js} +3 -3
  57. streamlit/static/static/js/{index.fz6QTJde.js → index.hEabuvQl.js} +1 -1
  58. streamlit/static/static/js/{index.DUqWz4q7.js → index.idE2oxkV.js} +1 -1
  59. streamlit/static/static/js/{index.Bb_vborY.js → index.jaOfuXT_.js} +1 -1
  60. streamlit/static/static/js/{index.XB-MiuZp.js → index.mQsqDFei.js} +1 -1
  61. streamlit/static/static/js/{index.B5QCo4O8.js → index.rqm-tyVr.js} +1 -1
  62. streamlit/static/static/js/{index.68LnD3a5.js → index.wclN5y6j.js} +1 -1
  63. streamlit/static/static/js/{index.ZlPieA63.js → index.xj8ZjDtP.js} +1 -1
  64. streamlit/static/static/js/{input.D-b9-dhW.js → input.CeAboTLQ.js} +1 -1
  65. streamlit/static/static/js/{memory.C27_0JRm.js → memory.BilaH12K.js} +1 -1
  66. streamlit/static/static/js/{mergeWith.D8F46YVj.js → mergeWith.B34IaY8d.js} +1 -1
  67. streamlit/static/static/js/{number-overlay-editor.CaHpEyvW.js → number-overlay-editor.BCo5wJKi.js} +1 -1
  68. streamlit/static/static/js/{possibleConstructorReturn.CnSJ4CFa.js → possibleConstructorReturn.CRrAWWQi.js} +1 -1
  69. streamlit/static/static/js/{sandbox.Cx5mAMmC.js → sandbox.ZIG5vd5E.js} +1 -1
  70. streamlit/static/static/js/{textarea.YeGMY3Ts.js → textarea.B7ggnxCh.js} +1 -1
  71. streamlit/static/static/js/{timepicker.BSApuR_7.js → timepicker.D1BZ0rZq.js} +1 -1
  72. streamlit/static/static/js/{toConsumableArray.DFJurSxu.js → toConsumableArray.bbNBXf55.js} +1 -1
  73. streamlit/static/static/js/{uniqueId.B4ugkryR.js → uniqueId.BRO0jXkb.js} +1 -1
  74. streamlit/static/static/js/{useBasicWidgetState.e9cw5rKa.js → useBasicWidgetState.DNqxSbNL.js} +1 -1
  75. streamlit/static/static/js/{useOnInputChange.CHDPgswc.js → useOnInputChange.LSJywRT_.js} +1 -1
  76. streamlit/static/static/js/{withFullScreenWrapper.BKBYrOn-.js → withFullScreenWrapper.wyYj-oat.js} +1 -1
  77. streamlit/testing/v1/app_test.py +2 -4
  78. streamlit/util.py +6 -9
  79. streamlit/watcher/util.py +2 -7
  80. streamlit/web/server/app_static_file_handler.py +16 -1
  81. {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250217.dist-info}/METADATA +1 -1
  82. {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250217.dist-info}/RECORD +86 -86
  83. {streamlit_nightly-1.42.1.dev20250216.data → streamlit_nightly-1.42.2.dev20250217.data}/scripts/streamlit.cmd +0 -0
  84. {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250217.dist-info}/WHEEL +0 -0
  85. {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250217.dist-info}/entry_points.txt +0 -0
  86. {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250217.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.CxT-55oh.js","./RenderInPortalIfExists.DbjYtj_E.js","./index.CnzapoES.js","./index.vyj1usur.js","./FormClearHelper.Dha_cfuU.js","./withFullScreenWrapper.BKBYrOn-.js","./Toolbar.B5RomQbU.js","./mergeWith.D8F46YVj.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.DFJurSxu.js","./possibleConstructorReturn.CnSJ4CFa.js","./createSuper.DiPn7x2M.js","./FileDownload.esm.K0RIIaSL.js","../css/index.Bmkmz40k.css","./index.CLXysuIS.js","./threshold.DjX0wlsa.js","./value.CgPGBV_l.js","./timer.CAwTRJ_g.js","./index.68LnD3a5.js","./useBasicWidgetState.e9cw5rKa.js","./index.DW_MHI2K.js","../css/index.DzuxGC_t.css","./index.B7-ka68B.js","./index.DUqWz4q7.js","./index.BW9gD4O1.js","./index.XB-MiuZp.js","./Hooks.BrulV197.js","./index.CmyE8x29.js","./index.CGHmjGTj.js","./index.B5QCo4O8.js","./UploadFileInfo.C-jY39rj.js","./ProgressBar.CXgDz0lS.js","./index.fz6QTJde.js","./FileDropzone.DRcTUuNN.js","./InputInstructions.C_m6JNSV.js","./inputUtils.CQWz5UKz.js","./textarea.YeGMY3Ts.js","./base-input.B_U9Mij-.js","./index.CxX3WJZV.js","./index.DaR46enR.js","./index.FVzOj77v.js","./timepicker.BSApuR_7.js","./input.D-b9-dhW.js","./index.ZlPieA63.js","./index.CBswNuTs.js","./index.B9xlEQvM.js","./index.eP8uJaty.js","./index.DcCioSks.js","./index.CTrIDSw5.js","./index.CMM3vxd_.js","./uniqueId.B4ugkryR.js","./useOnInputChange.CHDPgswc.js","./index.Di8ddb5O.js","./index.D4y-ZpWF.js","./index.Bb_vborY.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.ChTsHUaC.js","./RenderInPortalIfExists.BUcod3KW.js","./index.DZlSz8lf.js","./index.B3HJ1joN.js","./FormClearHelper.Doa6Lh7Q.js","./withFullScreenWrapper.wyYj-oat.js","./Toolbar.C714dqzb.js","./mergeWith.B34IaY8d.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.bbNBXf55.js","./possibleConstructorReturn.CRrAWWQi.js","./createSuper.ViswZ8TH.js","./FileDownload.esm.NwWY1bYI.js","../css/index.Bmkmz40k.css","./index.BOAkIKUg.js","./threshold.DjX0wlsa.js","./value.CgPGBV_l.js","./timer.CAwTRJ_g.js","./index.wclN5y6j.js","./useBasicWidgetState.DNqxSbNL.js","./index.DW_MHI2K.js","../css/index.DzuxGC_t.css","./index.BJ2gQSjT.js","./index.idE2oxkV.js","./index.CCj1lvY2.js","./index.mQsqDFei.js","./Hooks.CxtftrJy.js","./index.DxXPukev.js","./index.VDF9za4g.js","./index.rqm-tyVr.js","./UploadFileInfo.C-jY39rj.js","./ProgressBar.WE22u_Ob.js","./index.hEabuvQl.js","./FileDropzone.CZxPg3X2.js","./InputInstructions.CWLH2hJc.js","./inputUtils.CQWz5UKz.js","./textarea.B7ggnxCh.js","./base-input.C0t7SpL6.js","./index.BU0eO7qf.js","./index.CC8zeoS7.js","./index.BLBTL57W.js","./timepicker.D1BZ0rZq.js","./input.CeAboTLQ.js","./index.xj8ZjDtP.js","./index.DoLrZkRU.js","./index.DAlDuq3e.js","./index.0VYiXfju.js","./index.C2dTzC3_.js","./index.-b7dNs6l.js","./index.Byw8b24h.js","./uniqueId.BRO0jXkb.js","./useOnInputChange.LSJywRT_.js","./index.CiWJLcV9.js","./index.Vo9Xk_-P.js","./index.jaOfuXT_.js"])))=>i.map(i=>d[i]);
2
2
  var Pd=Object.defineProperty;var Uc=ye=>{throw TypeError(ye)};var Ld=(ye,$,e)=>$ in ye?Pd(ye,$,{enumerable:!0,configurable:!0,writable:!0,value:e}):ye[$]=e;var Aa=(ye,$,e)=>Ld(ye,typeof $!="symbol"?$+"":$,e),gs=(ye,$,e)=>$.has(ye)||Uc("Cannot "+e);var Cr=(ye,$,e)=>(gs(ye,$,"read from private field"),e?e.call(ye):$.get(ye)),vi=(ye,$,e)=>$.has(ye)?Uc("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(ye):$.set(ye,e),gi=(ye,$,e,Y)=>(gs(ye,$,"write to private field"),Y?Y.call(ye,e):$.set(ye,e),e),Hr=(ye,$,e)=>(gs(ye,$,"access private method"),e);function _mergeNamespaces(ye,$){for(var e=0;e<$.length;e++){const Y=$[e];if(typeof Y!="string"&&!Array.isArray(Y)){for(const Me in Y)if(Me!=="default"&&!(Me in ye)){const Ae=Object.getOwnPropertyDescriptor(Y,Me);Ae&&Object.defineProperty(ye,Me,Ae.get?Ae:{enumerable:!0,get:()=>Y[Me]})}}}return Object.freeze(Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"}))}(function(){const $=document.createElement("link").relList;if($&&$.supports&&$.supports("modulepreload"))return;for(const Me of document.querySelectorAll('link[rel="modulepreload"]'))Y(Me);new MutationObserver(Me=>{for(const Ae of Me)if(Ae.type==="childList")for(const Se of Ae.addedNodes)Se.tagName==="LINK"&&Se.rel==="modulepreload"&&Y(Se)}).observe(document,{childList:!0,subtree:!0});function e(Me){const Ae={};return Me.integrity&&(Ae.integrity=Me.integrity),Me.referrerPolicy&&(Ae.referrerPolicy=Me.referrerPolicy),Me.crossOrigin==="use-credentials"?Ae.credentials="include":Me.crossOrigin==="anonymous"?Ae.credentials="omit":Ae.credentials="same-origin",Ae}function Y(Me){if(Me.ep)return;Me.ep=!0;const Ae=e(Me);fetch(Me.href,Ae)}})();var commonjsGlobal$2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(ye){return ye&&ye.__esModule&&Object.prototype.hasOwnProperty.call(ye,"default")?ye.default:ye}function getAugmentedNamespace(ye){if(ye.__esModule)return ye;var $=ye.default;if(typeof $=="function"){var e=function Y(){return this instanceof Y?Reflect.construct($,arguments,this.constructor):$.apply(this,arguments)};e.prototype=$.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(ye).forEach(function(Y){var Me=Object.getOwnPropertyDescriptor(ye,Y);Object.defineProperty(e,Y,Me.get?Me:{enumerable:!0,get:function(){return ye[Y]}})}),e}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -691,7 +691,7 @@ If this is an installed component that works locally, the app may be having trou
691
691
 
692
692
  For more troubleshooting help, please see the [Streamlit Component docs](${COMPONENT_DEVELOPER_URL}) or visit our [forums](${COMMUNITY_URL}).`,e}function tryParseArgs(ye,$,e,Y){if(!Y)try{return parseArgs(ye,$)}catch(Me){const Ae=ensureError(Me);e(Ae)}return[{},[]]}function compareDataframeArgs(ye,$){return ye===$||ye.length===$.length&&ye.every((e,Y)=>{const Me=$[Y];return e.key===Me.key&&e.value===Me.value})}function ComponentInstance(ye){const $=useTheme(),[e,Y]=reactExports.useState(),{disabled:Me,element:Ae,registry:Se,widgetMgr:ve,width:ze,fragmentId:Te}=ye,{componentName:we,jsonArgs:De,specialArgs:Ie,url:Ce}=Ae,[Ne,qe]=tryParseArgs(De,Ie,Y,e),Le=reactExports.useRef({args:{},dataframeArgs:[]}),Fe=compareDataframeArgs(Le.current.dataframeArgs,qe);Le.current.args=Ne,Le.current.dataframeArgs=qe;const[We,je]=reactExports.useState(),[Ue,Ge]=reactExports.useState(isNaN(Ne.height)?void 0:Ne.height),He=reactExports.useRef(!1),Xe=reactExports.useRef(null),st=reactExports.useRef(),Je=useTimeout(()=>log$8.warn(getWarnMessage(we,Ce)),COMPONENT_READY_WARNING_TIME_MS/4),Qe=useTimeout(()=>je(!0),COMPONENT_READY_WARNING_TIME_MS);if(reactExports.useEffect(()=>{He.current&&sendRenderMessage(Le.current.args,Le.current.dataframeArgs,Me,$,Xe.current??void 0)},[Me,Ue,Fe,De,$,ze]),reactExports.useEffect(()=>{const ft=bt=>{if(bt===void 0){log$8.warn("handleSetFrameHeight: missing 'height' prop");return}if(bt!==Ue){if(m$3(Xe.current)){log$8.warn("handleSetFrameHeight: missing our iframeRef!");return}Xe.current.height=bt.toString(),Ge(bt)}},yt=()=>{sendRenderMessage(Le.current.args,Le.current.dataframeArgs,Me,$,Xe.current??void 0),Je(),Qe(),He.current=!0,je(!1)};st.current={isReady:()=>He.current,element:Ae,widgetMgr:ve,setComponentError:Y,componentReadyCallback:yt,frameHeightCallback:ft,fragmentId:Te}},[we,Me,Ae,Ue,Fe,We,De,$,ve,Qe,Je,Te]),reactExports.useEffect(()=>{var yt;const ft=((yt=Xe.current)==null?void 0:yt.contentWindow)??void 0;if(ft)return Se.registerListener(ft,createIframeMessageHandler(st)),()=>{ft&&Se.deregisterListener(ft)}},[Se,we]),e)return jsx$1(ErrorElement,{name:e.name,message:e.message});const rt=!He.current&&!We&&Ue!==0&&jsx$1(Skeleton,{element:Skeleton$1.create({height:Ue,style:Skeleton$1.SkeletonStyle.ELEMENT})}),ut=!He.current&&We?jsx$1(AlertElement$1,{width:ze,body:getWarnMessage(we,Ce),kind:Kind.WARNING}):null;return jsxs(Fragment,{children:[rt,ut,jsx$1(StyledComponentIframe,{className:"stCustomComponentV1","data-testid":"stCustomComponentV1",allow:DEFAULT_IFRAME_FEATURE_POLICY,ref:Xe,src:getSrc(we,Se,Ce),width:ze,height:Ue??0,scrolling:"no",sandbox:DEFAULT_IFRAME_SANDBOX_POLICY,title:we,componentReady:He.current})]})}const ComponentInstance$1=reactExports.memo(ComponentInstance),log$7=loglevelExports$1.getLogger("ComponentRegistry");class ComponentRegistry{constructor($){this.msgListeners=new Map,this.registerListener=(e,Y)=>{this.msgListeners.has(e)&&log$7.warn("MessageEventSource registered multiple times!",e),this.msgListeners.set(e,Y)},this.deregisterListener=e=>{this.msgListeners.delete(e)||log$7.warn("Could not deregister unregistered MessageEventSource!")},this.getComponentURL=(e,Y)=>this.endpoints.buildComponentURL(e,Y),this.onMessageEvent=e=>{if(m$3(e.data)||!e.data.hasOwnProperty("isStreamlitMessage"))return;if(m$3(e.source)){log$7.warn("Received component message with no eventSource!",e.data);return}const Y=this.msgListeners.get(e.source);if(m$3(Y)||typeof Y!="function"){log$7.warn("Received component message for unregistered ComponentInstance!",e.data);return}const{type:Me}=e.data;if(m$3(Me)){log$7.warn("Received Streamlit message with no type!",e.data);return}Y(Me,e.data)},this.endpoints=$,window.addEventListener("message",this.onMessageEvent)}}const Maybe=reactExports.memo(function ye({children:$}){return jsx$1(Fragment,{children:$})},(ye,$)=>!(ye.enable||$.enable));function makeMarkdownHeading(ye,$){switch(ye.toLowerCase()){case Tags.H1:return`# ${$}`;case Tags.H2:return`## ${$}`;case Tags.H3:return`### ${$}`;default:throw new Error(`Unrecognized tag for header: ${ye}`)}}function Heading(ye){const{width:$,element:e}=ye,{tag:Y,anchor:Me,body:Ae,help:Se,hideAnchor:ve,divider:ze}=e,Te=React.useContext(IsSidebarContext),we=React.useContext(IsDialogContext),[De,...Ie]=Ae.split(`
693
693
  `);return jsxs("div",{style:{width:$},className:"stHeading","data-testid":"stHeading",children:[jsxs(StyledStreamlitMarkdown,{isCaption:!1,isInSidebarOrDialog:Te||we,style:{width:$},"data-testid":"stMarkdownContainer",children:[jsx$1(HeadingWithActionElements,{anchor:Me,help:Se,hideAnchor:ve,tag:Y,children:jsx$1(RenderedMarkdown,{allowHTML:!1,source:makeMarkdownHeading(Y,De),overrideComponents:{p:reactExports.Fragment,h1:reactExports.Fragment,h2:reactExports.Fragment,h3:reactExports.Fragment,h4:reactExports.Fragment,h5:reactExports.Fragment,h6:reactExports.Fragment}})}),Ie.length>0&&jsx$1(RenderedMarkdown,{source:Ie.join(`
694
- `),allowHTML:!1})]}),ze&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ze.includes("linear"),color:ze})]})}const StyledCheckbox$1=newStyled("div",{target:"e6x5rwu0"})(({width:ye,theme:$})=>({width:ye,display:"flex",alignItems:"center",minHeight:$.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"e6x5rwu1"})(({visibility:ye})=>({display:ye===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:ye===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(ye,$){let e=$.spacing.lg;return ye==="medium"?e=$.spacing.threeXL:ye==="large"&&(e=$.spacing.fourXL),e}const StyledHorizontalBlock=newStyled("div",{target:"e6rk8up0"})(({theme:ye,gap:$})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth($,ye)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"e6rk8up1"})(({theme:ye,isStale:$,width:e,elementType:Y})=>({width:e,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:ye.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${ye.spacing.lg}`,zIndex:ye.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${ye.spacing.xs}`,marginBottom:`-${ye.spacing.xs}`},...$&&Y!=="skeleton"&&STALE_STYLES,...Y==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(Y)?{marginBottom:`-${ye.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"e6rk8up2"})(({theme:ye,weight:$,gap:e,showBorder:Y,verticalAlignment:Me})=>{const{VerticalAlignment:Ae}=Block$2.Column,Se=$*100,ve=translateGapWidth(e,ye),ze=`calc(${Se}% - ${ve})`;return{width:ze,flex:`1 1 ${ze}`,[`@media (max-width: ${ye.breakpoints.columns})`]:{minWidth:`calc(100% - ${ye.spacing.twoXL})`},...Me===Ae.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:ye.spacing.sm}},...Me===Ae.TOP&&{[`& ${StyledElementContainer}:first-of-type > ${StyledCheckbox$1}`]:{marginTop:ye.spacing.sm}},...Me===Ae.CENTER&&{marginTop:"auto",marginBottom:"auto"},...Y&&{border:`${ye.sizes.borderWidth} solid ${ye.colors.borderColor}`,borderRadius:ye.radii.default,padding:`calc(${ye.spacing.lg} - ${ye.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"e6rk8up3"})(({width:ye,theme:$})=>({width:ye,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:$.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"e6rk8up4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"e6rk8up5"})(({theme:ye,border:$,height:e})=>({...$&&{border:`${ye.sizes.borderWidth} solid ${ye.colors.borderColor}`,borderRadius:ye.radii.default,padding:`calc(${ye.spacing.lg} - ${ye.sizes.borderWidth})`},...e&&{height:`${e}px`,overflow:"auto"}})),Audio=React.lazy(()=>__vitePreload(()=>import("./index.CZjrVNQ3.js"),[],import.meta.url)),Balloons=React.lazy(()=>__vitePreload(()=>import("./index.CxT-55oh.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React.lazy(()=>__vitePreload(()=>import("./index.CnzapoES.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React.lazy(()=>__vitePreload(()=>import("./index.vyj1usur.js").then(ye=>ye.c),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url)),ArrowVegaLiteChart=React.lazy(()=>__vitePreload(()=>import("./index.CLXysuIS.js"),__vite__mapDeps([15,6,5,7,16,17,18,4]),import.meta.url)),Toast=React.lazy(()=>__vitePreload(()=>import("./index.Djk5RccG.js"),[],import.meta.url)),BokehChart=React.lazy(()=>__vitePreload(()=>import("./index.Ctuil2Zq.js"),[],import.meta.url)),DebouncedBokehChart=debounceRender(BokehChart,100),DeckGlJsonChart=React.lazy(()=>__vitePreload(()=>import("./index.68LnD3a5.js"),__vite__mapDeps([19,10,11,6,5,20,4,16,17,21,22]),import.meta.url)),GraphVizChart=React.lazy(()=>__vitePreload(()=>import("./index.B7-ka68B.js"),__vite__mapDeps([23,18,17,6,5]),import.meta.url)),IFrame=React.lazy(()=>__vitePreload(()=>import("./index.CrDkQv4h.js"),[],import.meta.url)),ImageList=React.lazy(()=>__vitePreload(()=>import("./index.DUqWz4q7.js"),__vite__mapDeps([24,6,5]),import.meta.url)),LinkButton=React.lazy(()=>__vitePreload(()=>import("./index.YBzhCbWe.js"),[],import.meta.url)),PageLink=React.lazy(()=>__vitePreload(()=>import("./index.OiKVkRzb.js"),[],import.meta.url)),PlotlyChart=React.lazy(()=>__vitePreload(()=>import("./index.BW9gD4O1.js"),__vite__mapDeps([25,4,5]),import.meta.url)),Video=React.lazy(()=>__vitePreload(()=>import("./index.FjL8doTL.js"),[],import.meta.url)),AudioInput=React.lazy(()=>__vitePreload(()=>import("./index.XB-MiuZp.js"),__vite__mapDeps([26,4,6,27,9,13]),import.meta.url)),Button=React.lazy(()=>__vitePreload(()=>import("./index.11KmKkMp.js"),[],import.meta.url)),ButtonGroup=React.lazy(()=>__vitePreload(()=>import("./index.CmyE8x29.js"),__vite__mapDeps([28,20,4]),import.meta.url)),DownloadButton=React.lazy(()=>__vitePreload(()=>import("./index.CGHmjGTj.js"),__vite__mapDeps([29,9]),import.meta.url)),CameraInput=React.lazy(()=>__vitePreload(()=>import("./index.B5QCo4O8.js"),__vite__mapDeps([30,21,4,31,32]),import.meta.url)),ChatInput=React.lazy(()=>__vitePreload(()=>import("./index.fz6QTJde.js"),__vite__mapDeps([33,34,35,36,21,31,37,38]),import.meta.url)),Checkbox=React.lazy(()=>__vitePreload(()=>import("./index.CxX3WJZV.js"),__vite__mapDeps([39,20,4]),import.meta.url)),ColorPicker=React.lazy(()=>__vitePreload(()=>import("./index.DaR46enR.js"),__vite__mapDeps([40,20,4]),import.meta.url)),DateInput=React.lazy(()=>__vitePreload(()=>import("./index.FVzOj77v.js"),__vite__mapDeps([41,20,4,42,11,12,43,38]),import.meta.url)),Html=React.lazy(()=>__vitePreload(()=>import("./index.DsPUu3xS.js"),[],import.meta.url)),Multiselect=React.lazy(()=>__vitePreload(()=>import("./index.ZlPieA63.js"),__vite__mapDeps([44,20,4]),import.meta.url)),Progress=React.lazy(()=>__vitePreload(()=>import("./index.CBswNuTs.js"),__vite__mapDeps([45,32]),import.meta.url)),Spinner=React.lazy(()=>__vitePreload(()=>import("./index.BoLiyuG0.js"),[],import.meta.url)),Radio=React.lazy(()=>__vitePreload(()=>import("./index.B9xlEQvM.js"),__vite__mapDeps([46,20,4]),import.meta.url)),Selectbox$1=React.lazy(()=>__vitePreload(()=>import("./index.eP8uJaty.js"),__vite__mapDeps([47,20,4]),import.meta.url)),Slider$1=React.lazy(()=>__vitePreload(()=>import("./index.DcCioSks.js"),__vite__mapDeps([48,8,20,4]),import.meta.url)),FileUploader=React.lazy(()=>__vitePreload(()=>import("./index.CTrIDSw5.js"),__vite__mapDeps([49,21,4,34,32,27,31]),import.meta.url)),TextArea=React.lazy(()=>__vitePreload(()=>import("./index.CMM3vxd_.js"),__vite__mapDeps([50,51,52,36,35,20,4,37,38]),import.meta.url)),TextInput=React.lazy(()=>__vitePreload(()=>import("./index.Di8ddb5O.js"),__vite__mapDeps([53,51,52,36,20,4,35,43,38]),import.meta.url)),TimeInput=React.lazy(()=>__vitePreload(()=>import("./index.D4y-ZpWF.js"),__vite__mapDeps([54,20,4,42,11,12]),import.meta.url)),NumberInput=React.lazy(()=>__vitePreload(()=>import("./index.Bb_vborY.js"),__vite__mapDeps([55,8,51,4,35,43,38]),import.meta.url)),StreamlitSyntaxHighlighter=React.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(ye,$){return ye?jsx$1(Fragment,{}):$}const RawElementNodeRenderer=ye=>{const{node:$}=ye;if(!$)throw new Error("ElementNode not found.");const e={width:ye.width,disableFullscreenMode:ye.disableFullscreenMode},Y={...e,widgetMgr:ye.widgetMgr,disabled:ye.widgetsDisabled,fragmentId:$.fragmentId};switch($.element.type){case"alert":{const Ae=$.element.alert;return jsx$1(AlertElement$1,{icon:Ae.icon,body:Ae.body,kind:getAlertElementKind(Ae.format),...e})}case"arrowTable":return jsx$1(ArrowTable$1,{element:$.quiverElement,...e});case"audio":return jsx$1(Audio,{element:$.element.audio,endpoints:ye.endpoints,...e,elementMgr:ye.widgetMgr});case"balloons":return hideIfStale(ye.isStale,jsx$1(Balloons,{scriptRunId:ye.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:$.element.bokehChart,...e});case"code":{const Ae=$.element.code;return jsx$1(StreamlitSyntaxHighlighter,{language:Ae.language,showLineNumbers:Ae.showLineNumbers,wrapLines:Ae.wrapLines,height:Ae.height,children:Ae.codeText})}case"deckGlJsonChart":return jsx$1(DeckGlJsonChart,{element:$.element.deckGlJsonChart,...Y});case"docString":return jsx$1(DocString$1,{element:$.element.docString,...e});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement$1,{element:$.element.exception,...e});case"graphvizChart":return jsx$1(GraphVizChart,{element:$.element.graphvizChart,...e});case"heading":return jsx$1(Heading,{element:$.element.heading,...e});case"iframe":return jsx$1(IFrame,{element:$.element.iframe,...e});case"imgs":return jsx$1(ImageList,{element:$.element.imgs,endpoints:ye.endpoints,...e});case"json":return jsx$1(Json$1,{element:$.element.json,...e});case"markdown":return jsx$1(Markdown$1,{element:$.element.markdown,...e});case"metric":return jsx$1(Metric$1,{element:$.element.metric});case"html":return jsx$1(Html,{element:$.element.html,...e});case"pageLink":{const Ae=$.element.pageLink,Se=Y.disabled||Ae.disabled;return jsx$1(PageLink,{element:Ae,disabled:Se,...e})}case"progress":return jsx$1(Progress,{element:$.element.progress,...e});case"skeleton":return jsx$1(Skeleton,{element:$.element.skeleton});case"snow":return hideIfStale(ye.isStale,jsx$1(Snow,{scriptRunId:ye.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:$.element.spinner,...e});case"text":return jsx$1(TextElement$1,{element:$.element.text,...e});case"video":return jsx$1(Video,{element:$.element.video,endpoints:ye.endpoints,...e,elementMgr:ye.widgetMgr});case"toast":{const Ae=$.element.toast;return jsx$1(Toast,{body:Ae.body,icon:Ae.icon,...e},$.scriptRunId)}case"arrowDataFrame":{const Ae=$.element.arrowDataFrame;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ArrowDataFrame,{element:Ae,data:$.quiverElement,...Ae.id&&{key:Ae.id},...Y})}case"arrowVegaLiteChart":const Me=$.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:Me,...Y},Me.id||void 0);case"audioInput":{const Ae=$.element.audioInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(AudioInput,{uploadClient:ye.uploadClient,element:Ae,...Y},Ae.id)}case"button":{const Ae=$.element.button;if(Y.disabled=Y.disabled||Ae.disabled,Ae.isFormSubmitter){const{formId:Se}=Ae,ve=ye.formsData.formsWithUploads.has(Se);return jsx$1(FormSubmitContent,{element:Ae,hasInProgressUpload:ve,...Y})}return jsx$1(Button,{element:Ae,...Y})}case"buttonGroup":{const Ae=$.element.buttonGroup;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ButtonGroup,{element:Ae,...Y},Ae.id)}case"downloadButton":{const Ae=$.element.downloadButton;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(DownloadButton,{endpoints:ye.endpoints,element:Ae,...Y},Ae.id)}case"cameraInput":{const Ae=$.element.cameraInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(CameraInput,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"chatInput":{const Ae=$.element.chatInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ChatInput,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"checkbox":{const Ae=$.element.checkbox;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Checkbox,{element:Ae,...Y},Ae.id)}case"colorPicker":{const Ae=$.element.colorPicker;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ColorPicker,{element:Ae,...Y},Ae.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:ye.componentRegistry,element:$.element.componentInstance,...Y});case"dateInput":{const Ae=$.element.dateInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(DateInput,{element:Ae,...Y},Ae.id)}case"fileUploader":{const Ae=$.element.fileUploader;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(FileUploader,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"linkButton":{const Ae=$.element.linkButton;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(LinkButton,{element:Ae,...Y})}case"multiselect":{const Ae=$.element.multiselect;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Multiselect,{element:Ae,...Y},Ae.id)}case"numberInput":{const Ae=$.element.numberInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(NumberInput,{element:Ae,...Y},Ae.id)}case"plotlyChart":{const Ae=$.element.plotlyChart;return jsx$1(PlotlyChart,{element:Ae,...Y},Ae.id)}case"radio":{const Ae=$.element.radio;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Radio,{element:Ae,...Y},Ae.id)}case"selectbox":{const Ae=$.element.selectbox;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Selectbox$1,{element:Ae,...Y},Ae.id)}case"slider":{const Ae=$.element.slider;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Slider$1,{element:Ae,...Y},Ae.id)}case"textArea":{const Ae=$.element.textArea;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TextArea,{element:Ae,...Y},Ae.id)}case"textInput":{const Ae=$.element.textInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TextInput,{element:Ae,...Y},Ae.id)}case"timeInput":{const Ae=$.element.timeInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TimeInput,{element:Ae,...Y},Ae.id)}default:throw new Error(`Unrecognized Element type ${$.element.type}`)}},ElementNodeRenderer=ye=>{const{isFullScreen:$,fragmentIdsThisRun:e}=React.useContext(LibContext),{node:Y,width:Me}=ye,Ae=Y.element.type||"",Se=shouldComponentBeEnabled(Ae,ye.scriptRunState),ve=isComponentStale(Se,Y,ye.scriptRunState,ye.scriptRunId,e),ze=getElementId(Y.element),Te=getKeyFromId(ze);return jsx$1(Maybe,{enable:Se,children:jsx$1(StyledElementContainer,{className:classNames("stElementContainer","element-container",convertKeyToClassName(Te)),"data-testid":"stElementContainer","data-stale":ve,isStale:ve&&!$,width:Me,elementType:Ae,children:jsx$1(ErrorBoundary,{width:Me,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(Skeleton,{element:Skeleton$1.create({style:Skeleton$1.SkeletonStyle.ELEMENT})}),children:jsx$1(RawElementNodeRenderer,{...ye,isStale:ve})})})})})},BlockNodeRenderer=ye=>{const{node:$}=ye,{fragmentIdsThisRun:e}=reactExports.useContext(LibContext);if($.isEmpty&&!$.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const Y=shouldComponentBeEnabled("",ye.scriptRunState),Me=isComponentStale(Y,$,ye.scriptRunState,ye.scriptRunId,e),Ae={...ye,node:$},Se=ye.disableFullscreenMode||d$2($.deltaBlock.dialog)||d$2($.deltaBlock.popover),ve=jsx$1(LayoutBlock,{...Ae,disableFullscreenMode:Se});if($.deltaBlock.dialog)return jsx$1(Dialog$1,{element:$.deltaBlock.dialog,deltaMsgReceivedAt:$.deltaMsgReceivedAt,children:ve});if($.deltaBlock.expandable)return jsx$1(Expander$1,{empty:$.isEmpty,isStale:Me,element:$.deltaBlock.expandable,children:ve});if($.deltaBlock.popover)return jsx$1(Popover$1,{empty:$.isEmpty,element:$.deltaBlock.popover,width:ye.width,children:ve});if($.deltaBlock.type==="form"){const{formId:ze,clearOnSubmit:Te,enterToSubmit:we,border:De}=$.deltaBlock.form,Ie=ye.formsData.submitButtons.get(ze),Ce=Ie!==void 0&&Ie.length>0;return jsx$1(Form$1,{formId:ze,clearOnSubmit:Te,enterToSubmit:we,width:ye.width,hasSubmitButton:Ce,scriptRunState:ye.scriptRunState,widgetMgr:ye.widgetMgr,border:De,children:ve})}if($.deltaBlock.chatMessage)return jsx$1(ChatMessage$1,{element:$.deltaBlock.chatMessage,endpoints:ye.endpoints,children:ve});if($.deltaBlock.column)return jsx$1(StyledColumn,{weight:$.deltaBlock.column.weight??0,gap:$.deltaBlock.column.gap??"",verticalAlignment:$.deltaBlock.column.verticalAlignment??void 0,showBorder:$.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ve});if($.deltaBlock.tabContainer){const Te={...Ae,isStale:Me,renderTabContent:we=>jsx$1(VerticalBlock,{...we})};return jsx$1(Tabs$1,{...Te})}return ve},ChildRenderer=ye=>{const{libConfig:$}=reactExports.useContext(LibContext);assignDividerColor(ye.node,useTheme());const e=new Set;return jsx$1(Fragment,{children:ye.node.children&&ye.node.children.map((Y,Me)=>{const Ae=$.disableFullscreenMode||ye.disableFullscreenMode;if(Y instanceof ElementNode){const Se={...ye,disableFullscreenMode:Ae,node:Y},ve=getElementId(Y.element)||Me.toString();return e.has(ve)?null:(e.add(ve),jsx$1(ElementNodeRenderer,{...Se},ve))}if(Y instanceof BlockNode){const Se={...ye,disableFullscreenMode:Ae,node:Y};return jsx$1(BlockNodeRenderer,{...Se},Me)}throw new Error(`Unrecognized AppNode: ${Y}`)})})};function ScrollToBottomVerticalBlockWrapper(ye){const{border:$,height:e,children:Y}=ye,Me=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:$,height:e,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:Me,children:Y})}const VerticalBlock=ye=>{var De,Ie;const $=reactExports.useRef(null),[e,Y]=React.useState(-1),Me=reactExports.useMemo(()=>new ResizeObserver(([Ce])=>{window.requestAnimationFrame(()=>{Y(Ce.target.getBoundingClientRect().width||-1)})}),[Y]),Ae=((De=ye.node.deltaBlock.vertical)==null?void 0:De.border)??!1,Se=((Ie=ye.node.deltaBlock.vertical)==null?void 0:Ie.height)||void 0,ve=Se&&ye.node.children.find(Ce=>Ce instanceof BlockNode&&Ce.deltaBlock.type==="chatMessage")!==void 0;reactExports.useEffect(()=>($.current&&Me.observe($.current),()=>{Me.disconnect()}),[Me,ve]);const ze=ve?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,Te={...ye,width:e},we=getKeyFromId(ye.node.deltaBlock.id);return jsx$1(ze,{border:Ae,height:Se,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:$,children:jsx$1(StyledVerticalBlock,{width:e,className:classNames("stVerticalBlock",convertKeyToClassName(we)),"data-testid":"stVerticalBlock",children:jsx$1(ChildRenderer,{...Te})})})})},HorizontalBlock=ye=>{var e;const $=((e=ye.node.deltaBlock.horizontal)==null?void 0:e.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:$,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...ye})})};function LayoutBlock(ye){return ye.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...ye}):jsx$1(VerticalBlock,{...ye})}const StyledDataFrameOverlay=newStyled("div",{target:"e19n7mk11"})(({theme:ye})=>({position:"fixed",top:0,left:0,zIndex:ye.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React.createContext(null),PortalProvider=({children:ye})=>{const $=reactExports.useRef(null),e=reactExports.useCallback(()=>$.current,[]);return jsxs(PortalContext.Provider,{value:e,children:[ye,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:$})]})};function ThemeProvider({theme:ye,baseuiTheme:$,children:e}){return jsx$1(ThemeProvider$1,{theme:$||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:ye,children:e})})}function toCodePoint(ye,$){const e=[];let Y=0,Me=0,Ae=0;for(;Ae<ye.length;)Y=ye.charCodeAt(Ae++),Me?(e.push((65536+(Me-55296<<10)+(Y-56320)).toString(16)),Me=0):55296<=Y&&Y<=56319?Me=Y:e.push(Y.toString(16));return e.join("-")}const UFE0Fg=/\uFE0F/g,U200D="‍";function grabTheRightIcon(ye){return toCodePoint(ye.indexOf(U200D)<0?ye.replace(UFE0Fg,""):ye)}function iconToUrl(ye){const $=/^:(.+)\/(.+):$/,e=ye.match($);return e===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${e[2]}/default/24px.svg`}function handleFavicon(ye,$,e){const Y=extractEmoji(ye);let Me;Y&&!ye.startsWith(":material")?Me=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(Y)}.png`:ye.startsWith(":material")?Me=iconToUrl(ye):Me=e.buildMediaURL(ye),overwriteFavicon(Me),$({type:"SET_PAGE_FAVICON",favicon:Me})}function overwriteFavicon(ye){const $=document.querySelector("link[rel='shortcut icon']");$&&($.href=ye)}function extractEmoji(ye){const $=ye.replace("-","_");return nodeEmoji.hasEmoji(nodeEmoji.get($))?nodeEmoji.get($):nodeEmoji.hasEmoji(ye)?ye:""}var lib$2={},flattenNames={},_baseForOwn,hasRequired_baseForOwn;function require_baseForOwn(){if(hasRequired_baseForOwn)return _baseForOwn;hasRequired_baseForOwn=1;var ye=require_baseFor(),$=requireKeys();function e(Y,Me){return Y&&ye(Y,Me,$)}return _baseForOwn=e,_baseForOwn}var _castFunction,hasRequired_castFunction;function require_castFunction(){if(hasRequired_castFunction)return _castFunction;hasRequired_castFunction=1;var ye=requireIdentity();function $(e){return typeof e=="function"?e:ye}return _castFunction=$,_castFunction}var forOwn_1,hasRequiredForOwn;function requireForOwn(){if(hasRequiredForOwn)return forOwn_1;hasRequiredForOwn=1;var ye=require_baseForOwn(),$=require_castFunction();function e(Y,Me){return Y&&ye(Y,$(Me))}return forOwn_1=e,forOwn_1}var _setCacheAdd,hasRequired_setCacheAdd;function require_setCacheAdd(){if(hasRequired_setCacheAdd)return _setCacheAdd;hasRequired_setCacheAdd=1;var ye="__lodash_hash_undefined__";function $(e){return this.__data__.set(e,ye),this}return _setCacheAdd=$,_setCacheAdd}var _setCacheHas,hasRequired_setCacheHas;function require_setCacheHas(){if(hasRequired_setCacheHas)return _setCacheHas;hasRequired_setCacheHas=1;function ye($){return this.__data__.has($)}return _setCacheHas=ye,_setCacheHas}var _SetCache,hasRequired_SetCache;function require_SetCache(){if(hasRequired_SetCache)return _SetCache;hasRequired_SetCache=1;var ye=require_MapCache(),$=require_setCacheAdd(),e=require_setCacheHas();function Y(Me){var Ae=-1,Se=Me==null?0:Me.length;for(this.__data__=new ye;++Ae<Se;)this.add(Me[Ae])}return Y.prototype.add=Y.prototype.push=$,Y.prototype.has=e,_SetCache=Y,_SetCache}var _arraySome,hasRequired_arraySome;function require_arraySome(){if(hasRequired_arraySome)return _arraySome;hasRequired_arraySome=1;function ye($,e){for(var Y=-1,Me=$==null?0:$.length;++Y<Me;)if(e($[Y],Y,$))return!0;return!1}return _arraySome=ye,_arraySome}var _cacheHas,hasRequired_cacheHas;function require_cacheHas(){if(hasRequired_cacheHas)return _cacheHas;hasRequired_cacheHas=1;function ye($,e){return $.has(e)}return _cacheHas=ye,_cacheHas}var _equalArrays,hasRequired_equalArrays;function require_equalArrays(){if(hasRequired_equalArrays)return _equalArrays;hasRequired_equalArrays=1;var ye=require_SetCache(),$=require_arraySome(),e=require_cacheHas(),Y=1,Me=2;function Ae(Se,ve,ze,Te,we,De){var Ie=ze&Y,Ce=Se.length,Ne=ve.length;if(Ce!=Ne&&!(Ie&&Ne>Ce))return!1;var qe=De.get(Se),Le=De.get(ve);if(qe&&Le)return qe==ve&&Le==Se;var Fe=-1,We=!0,je=ze&Me?new ye:void 0;for(De.set(Se,ve),De.set(ve,Se);++Fe<Ce;){var Ue=Se[Fe],Ge=ve[Fe];if(Te)var He=Ie?Te(Ge,Ue,Fe,ve,Se,De):Te(Ue,Ge,Fe,Se,ve,De);if(He!==void 0){if(He)continue;We=!1;break}if(je){if(!$(ve,function(Xe,st){if(!e(je,st)&&(Ue===Xe||we(Ue,Xe,ze,Te,De)))return je.push(st)})){We=!1;break}}else if(!(Ue===Ge||we(Ue,Ge,ze,Te,De))){We=!1;break}}return De.delete(Se),De.delete(ve),We}return _equalArrays=Ae,_equalArrays}var _equalByTag,hasRequired_equalByTag;function require_equalByTag(){if(hasRequired_equalByTag)return _equalByTag;hasRequired_equalByTag=1;var ye=require_Symbol(),$=require_Uint8Array(),e=requireEq(),Y=require_equalArrays(),Me=require_mapToArray(),Ae=require_setToArray(),Se=1,ve=2,ze="[object Boolean]",Te="[object Date]",we="[object Error]",De="[object Map]",Ie="[object Number]",Ce="[object RegExp]",Ne="[object Set]",qe="[object String]",Le="[object Symbol]",Fe="[object ArrayBuffer]",We="[object DataView]",je=ye?ye.prototype:void 0,Ue=je?je.valueOf:void 0;function Ge(He,Xe,st,Je,Qe,rt,ut){switch(st){case We:if(He.byteLength!=Xe.byteLength||He.byteOffset!=Xe.byteOffset)return!1;He=He.buffer,Xe=Xe.buffer;case Fe:return!(He.byteLength!=Xe.byteLength||!rt(new $(He),new $(Xe)));case ze:case Te:case Ie:return e(+He,+Xe);case we:return He.name==Xe.name&&He.message==Xe.message;case Ce:case qe:return He==Xe+"";case De:var ft=Me;case Ne:var yt=Je&Se;if(ft||(ft=Ae),He.size!=Xe.size&&!yt)return!1;var bt=ut.get(He);if(bt)return bt==Xe;Je|=ve,ut.set(He,Xe);var At=Y(ft(He),ft(Xe),Je,Qe,rt,ut);return ut.delete(He),At;case Le:if(Ue)return Ue.call(He)==Ue.call(Xe)}return!1}return _equalByTag=Ge,_equalByTag}var _equalObjects,hasRequired_equalObjects;function require_equalObjects(){if(hasRequired_equalObjects)return _equalObjects;hasRequired_equalObjects=1;var ye=require_getAllKeys(),$=1,e=Object.prototype,Y=e.hasOwnProperty;function Me(Ae,Se,ve,ze,Te,we){var De=ve&$,Ie=ye(Ae),Ce=Ie.length,Ne=ye(Se),qe=Ne.length;if(Ce!=qe&&!De)return!1;for(var Le=Ce;Le--;){var Fe=Ie[Le];if(!(De?Fe in Se:Y.call(Se,Fe)))return!1}var We=we.get(Ae),je=we.get(Se);if(We&&je)return We==Se&&je==Ae;var Ue=!0;we.set(Ae,Se),we.set(Se,Ae);for(var Ge=De;++Le<Ce;){Fe=Ie[Le];var He=Ae[Fe],Xe=Se[Fe];if(ze)var st=De?ze(Xe,He,Fe,Se,Ae,we):ze(He,Xe,Fe,Ae,Se,we);if(!(st===void 0?He===Xe||Te(He,Xe,ve,ze,we):st)){Ue=!1;break}Ge||(Ge=Fe=="constructor")}if(Ue&&!Ge){var Je=Ae.constructor,Qe=Se.constructor;Je!=Qe&&"constructor"in Ae&&"constructor"in Se&&!(typeof Je=="function"&&Je instanceof Je&&typeof Qe=="function"&&Qe instanceof Qe)&&(Ue=!1)}return we.delete(Ae),we.delete(Se),Ue}return _equalObjects=Me,_equalObjects}var _baseIsEqualDeep,hasRequired_baseIsEqualDeep;function require_baseIsEqualDeep(){if(hasRequired_baseIsEqualDeep)return _baseIsEqualDeep;hasRequired_baseIsEqualDeep=1;var ye=require_Stack(),$=require_equalArrays(),e=require_equalByTag(),Y=require_equalObjects(),Me=require_getTag(),Ae=requireIsArray(),Se=requireIsBuffer$1(),ve=requireIsTypedArray(),ze=1,Te="[object Arguments]",we="[object Array]",De="[object Object]",Ie=Object.prototype,Ce=Ie.hasOwnProperty;function Ne(qe,Le,Fe,We,je,Ue){var Ge=Ae(qe),He=Ae(Le),Xe=Ge?we:Me(qe),st=He?we:Me(Le);Xe=Xe==Te?De:Xe,st=st==Te?De:st;var Je=Xe==De,Qe=st==De,rt=Xe==st;if(rt&&Se(qe)){if(!Se(Le))return!1;Ge=!0,Je=!1}if(rt&&!Je)return Ue||(Ue=new ye),Ge||ve(qe)?$(qe,Le,Fe,We,je,Ue):e(qe,Le,Xe,Fe,We,je,Ue);if(!(Fe&ze)){var ut=Je&&Ce.call(qe,"__wrapped__"),ft=Qe&&Ce.call(Le,"__wrapped__");if(ut||ft){var yt=ut?qe.value():qe,bt=ft?Le.value():Le;return Ue||(Ue=new ye),je(yt,bt,Fe,We,Ue)}}return rt?(Ue||(Ue=new ye),Y(qe,Le,Fe,We,je,Ue)):!1}return _baseIsEqualDeep=Ne,_baseIsEqualDeep}var _baseIsEqual,hasRequired_baseIsEqual;function require_baseIsEqual(){if(hasRequired_baseIsEqual)return _baseIsEqual;hasRequired_baseIsEqual=1;var ye=require_baseIsEqualDeep(),$=requireIsObjectLike();function e(Y,Me,Ae,Se,ve){return Y===Me?!0:Y==null||Me==null||!$(Y)&&!$(Me)?Y!==Y&&Me!==Me:ye(Y,Me,Ae,Se,e,ve)}return _baseIsEqual=e,_baseIsEqual}var _baseIsMatch,hasRequired_baseIsMatch;function require_baseIsMatch(){if(hasRequired_baseIsMatch)return _baseIsMatch;hasRequired_baseIsMatch=1;var ye=require_Stack(),$=require_baseIsEqual(),e=1,Y=2;function Me(Ae,Se,ve,ze){var Te=ve.length,we=Te,De=!ze;if(Ae==null)return!we;for(Ae=Object(Ae);Te--;){var Ie=ve[Te];if(De&&Ie[2]?Ie[1]!==Ae[Ie[0]]:!(Ie[0]in Ae))return!1}for(;++Te<we;){Ie=ve[Te];var Ce=Ie[0],Ne=Ae[Ce],qe=Ie[1];if(De&&Ie[2]){if(Ne===void 0&&!(Ce in Ae))return!1}else{var Le=new ye;if(ze)var Fe=ze(Ne,qe,Ce,Ae,Se,Le);if(!(Fe===void 0?$(qe,Ne,e|Y,ze,Le):Fe))return!1}}return!0}return _baseIsMatch=Me,_baseIsMatch}var _isStrictComparable,hasRequired_isStrictComparable;function require_isStrictComparable(){if(hasRequired_isStrictComparable)return _isStrictComparable;hasRequired_isStrictComparable=1;var ye=requireIsObject();function $(e){return e===e&&!ye(e)}return _isStrictComparable=$,_isStrictComparable}var _getMatchData,hasRequired_getMatchData;function require_getMatchData(){if(hasRequired_getMatchData)return _getMatchData;hasRequired_getMatchData=1;var ye=require_isStrictComparable(),$=requireKeys();function e(Y){for(var Me=$(Y),Ae=Me.length;Ae--;){var Se=Me[Ae],ve=Y[Se];Me[Ae]=[Se,ve,ye(ve)]}return Me}return _getMatchData=e,_getMatchData}var _matchesStrictComparable,hasRequired_matchesStrictComparable;function require_matchesStrictComparable(){if(hasRequired_matchesStrictComparable)return _matchesStrictComparable;hasRequired_matchesStrictComparable=1;function ye($,e){return function(Y){return Y==null?!1:Y[$]===e&&(e!==void 0||$ in Object(Y))}}return _matchesStrictComparable=ye,_matchesStrictComparable}var _baseMatches,hasRequired_baseMatches;function require_baseMatches(){if(hasRequired_baseMatches)return _baseMatches;hasRequired_baseMatches=1;var ye=require_baseIsMatch(),$=require_getMatchData(),e=require_matchesStrictComparable();function Y(Me){var Ae=$(Me);return Ae.length==1&&Ae[0][2]?e(Ae[0][0],Ae[0][1]):function(Se){return Se===Me||ye(Se,Me,Ae)}}return _baseMatches=Y,_baseMatches}var _baseHasIn,hasRequired_baseHasIn;function require_baseHasIn(){if(hasRequired_baseHasIn)return _baseHasIn;hasRequired_baseHasIn=1;function ye($,e){return $!=null&&e in Object($)}return _baseHasIn=ye,_baseHasIn}var _hasPath,hasRequired_hasPath;function require_hasPath(){if(hasRequired_hasPath)return _hasPath;hasRequired_hasPath=1;var ye=require_castPath(),$=requireIsArguments(),e=requireIsArray(),Y=require_isIndex(),Me=requireIsLength(),Ae=require_toKey();function Se(ve,ze,Te){ze=ye(ze,ve);for(var we=-1,De=ze.length,Ie=!1;++we<De;){var Ce=Ae(ze[we]);if(!(Ie=ve!=null&&Te(ve,Ce)))break;ve=ve[Ce]}return Ie||++we!=De?Ie:(De=ve==null?0:ve.length,!!De&&Me(De)&&Y(Ce,De)&&(e(ve)||$(ve)))}return _hasPath=Se,_hasPath}var hasIn_1,hasRequiredHasIn;function requireHasIn(){if(hasRequiredHasIn)return hasIn_1;hasRequiredHasIn=1;var ye=require_baseHasIn(),$=require_hasPath();function e(Y,Me){return Y!=null&&$(Y,Me,ye)}return hasIn_1=e,hasIn_1}var _baseMatchesProperty,hasRequired_baseMatchesProperty;function require_baseMatchesProperty(){if(hasRequired_baseMatchesProperty)return _baseMatchesProperty;hasRequired_baseMatchesProperty=1;var ye=require_baseIsEqual(),$=requireGet(),e=requireHasIn(),Y=require_isKey(),Me=require_isStrictComparable(),Ae=require_matchesStrictComparable(),Se=require_toKey(),ve=1,ze=2;function Te(we,De){return Y(we)&&Me(De)?Ae(Se(we),De):function(Ie){var Ce=$(Ie,we);return Ce===void 0&&Ce===De?e(Ie,we):ye(De,Ce,ve|ze)}}return _baseMatchesProperty=Te,_baseMatchesProperty}var _basePropertyDeep,hasRequired_basePropertyDeep;function require_basePropertyDeep(){if(hasRequired_basePropertyDeep)return _basePropertyDeep;hasRequired_basePropertyDeep=1;var ye=require_baseGet();function $(e){return function(Y){return ye(Y,e)}}return _basePropertyDeep=$,_basePropertyDeep}var property_1,hasRequiredProperty;function requireProperty(){if(hasRequiredProperty)return property_1;hasRequiredProperty=1;var ye=require_baseProperty(),$=require_basePropertyDeep(),e=require_isKey(),Y=require_toKey();function Me(Ae){return e(Ae)?ye(Y(Ae)):$(Ae)}return property_1=Me,property_1}var _baseIteratee,hasRequired_baseIteratee;function require_baseIteratee(){if(hasRequired_baseIteratee)return _baseIteratee;hasRequired_baseIteratee=1;var ye=require_baseMatches(),$=require_baseMatchesProperty(),e=requireIdentity(),Y=requireIsArray(),Me=requireProperty();function Ae(Se){return typeof Se=="function"?Se:Se==null?e:typeof Se=="object"?Y(Se)?$(Se[0],Se[1]):ye(Se):Me(Se)}return _baseIteratee=Ae,_baseIteratee}var _createBaseEach,hasRequired_createBaseEach;function require_createBaseEach(){if(hasRequired_createBaseEach)return _createBaseEach;hasRequired_createBaseEach=1;var ye=requireIsArrayLike();function $(e,Y){return function(Me,Ae){if(Me==null)return Me;if(!ye(Me))return e(Me,Ae);for(var Se=Me.length,ve=Y?Se:-1,ze=Object(Me);(Y?ve--:++ve<Se)&&Ae(ze[ve],ve,ze)!==!1;);return Me}}return _createBaseEach=$,_createBaseEach}var _baseEach,hasRequired_baseEach;function require_baseEach(){if(hasRequired_baseEach)return _baseEach;hasRequired_baseEach=1;var ye=require_baseForOwn(),$=require_createBaseEach(),e=$(ye);return _baseEach=e,_baseEach}var _baseMap,hasRequired_baseMap;function require_baseMap(){if(hasRequired_baseMap)return _baseMap;hasRequired_baseMap=1;var ye=require_baseEach(),$=requireIsArrayLike();function e(Y,Me){var Ae=-1,Se=$(Y)?Array(Y.length):[];return ye(Y,function(ve,ze,Te){Se[++Ae]=Me(ve,ze,Te)}),Se}return _baseMap=e,_baseMap}var map_1,hasRequiredMap;function requireMap(){if(hasRequiredMap)return map_1;hasRequiredMap=1;var ye=require_arrayMap(),$=require_baseIteratee(),e=require_baseMap(),Y=requireIsArray();function Me(Ae,Se){var ve=Y(Ae)?ye:e;return ve(Ae,$(Se,3))}return map_1=Me,map_1}var hasRequiredFlattenNames;function requireFlattenNames(){if(hasRequiredFlattenNames)return flattenNames;hasRequiredFlattenNames=1,Object.defineProperty(flattenNames,"__esModule",{value:!0}),flattenNames.flattenNames=void 0;var ye=requireIsString(),$=ze(ye),e=requireForOwn(),Y=ze(e),Me=requireIsPlainObject(),Ae=ze(Me),Se=requireMap(),ve=ze(Se);function ze(we){return we&&we.__esModule?we:{default:we}}var Te=flattenNames.flattenNames=function we(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ie=[];return(0,ve.default)(De,function(Ce){Array.isArray(Ce)?we(Ce).map(function(Ne){return Ie.push(Ne)}):(0,Ae.default)(Ce)?(0,Y.default)(Ce,function(Ne,qe){Ne===!0&&Ie.push(qe),Ie.push(qe+"-"+Ne)}):(0,$.default)(Ce)&&Ie.push(Ce)}),Ie};return flattenNames.default=Te,flattenNames}var mergeClasses={},hasRequiredMergeClasses;function requireMergeClasses(){if(hasRequiredMergeClasses)return mergeClasses;hasRequiredMergeClasses=1,Object.defineProperty(mergeClasses,"__esModule",{value:!0}),mergeClasses.mergeClasses=void 0;var ye=requireForOwn(),$=Ae(ye),e=requireCloneDeep(),Y=Ae(e),Me=Object.assign||function(ve){for(var ze=1;ze<arguments.length;ze++){var Te=arguments[ze];for(var we in Te)Object.prototype.hasOwnProperty.call(Te,we)&&(ve[we]=Te[we])}return ve};function Ae(ve){return ve&&ve.__esModule?ve:{default:ve}}var Se=mergeClasses.mergeClasses=function(ze){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],we=ze.default&&(0,Y.default)(ze.default)||{};return Te.map(function(De){var Ie=ze[De];return Ie&&(0,$.default)(Ie,function(Ce,Ne){we[Ne]||(we[Ne]={}),we[Ne]=Me({},we[Ne],Ie[Ne])}),De}),we};return mergeClasses.default=Se,mergeClasses}var autoprefix={},hasRequiredAutoprefix;function requireAutoprefix(){if(hasRequiredAutoprefix)return autoprefix;hasRequiredAutoprefix=1,Object.defineProperty(autoprefix,"__esModule",{value:!0}),autoprefix.autoprefix=void 0;var ye=requireForOwn(),$=Y(ye),e=Object.assign||function(Se){for(var ve=1;ve<arguments.length;ve++){var ze=arguments[ve];for(var Te in ze)Object.prototype.hasOwnProperty.call(ze,Te)&&(Se[Te]=ze[Te])}return Se};function Y(Se){return Se&&Se.__esModule?Se:{default:Se}}var Me={borderRadius:function(ve){return{msBorderRadius:ve,MozBorderRadius:ve,OBorderRadius:ve,WebkitBorderRadius:ve,borderRadius:ve}},boxShadow:function(ve){return{msBoxShadow:ve,MozBoxShadow:ve,OBoxShadow:ve,WebkitBoxShadow:ve,boxShadow:ve}},userSelect:function(ve){return{WebkitTouchCallout:ve,KhtmlUserSelect:ve,MozUserSelect:ve,msUserSelect:ve,WebkitUserSelect:ve,userSelect:ve}},flex:function(ve){return{WebkitBoxFlex:ve,MozBoxFlex:ve,WebkitFlex:ve,msFlex:ve,flex:ve}},flexBasis:function(ve){return{WebkitFlexBasis:ve,flexBasis:ve}},justifyContent:function(ve){return{WebkitJustifyContent:ve,justifyContent:ve}},transition:function(ve){return{msTransition:ve,MozTransition:ve,OTransition:ve,WebkitTransition:ve,transition:ve}},transform:function(ve){return{msTransform:ve,MozTransform:ve,OTransform:ve,WebkitTransform:ve,transform:ve}},absolute:function(ve){var ze=ve&&ve.split(" ");return{position:"absolute",top:ze&&ze[0],right:ze&&ze[1],bottom:ze&&ze[2],left:ze&&ze[3]}},extend:function(ve,ze){var Te=ze[ve];return Te||{extend:ve}}},Ae=autoprefix.autoprefix=function(ve){var ze={};return(0,$.default)(ve,function(Te,we){var De={};(0,$.default)(Te,function(Ie,Ce){var Ne=Me[Ce];Ne?De=e({},De,Ne(Ie)):De[Ce]=Ie}),ze[we]=De}),ze};return autoprefix.default=Ae,autoprefix}var hover={},hasRequiredHover;function requireHover(){if(hasRequiredHover)return hover;hasRequiredHover=1,Object.defineProperty(hover,"__esModule",{value:!0}),hover.hover=void 0;var ye=Object.assign||function(ze){for(var Te=1;Te<arguments.length;Te++){var we=arguments[Te];for(var De in we)Object.prototype.hasOwnProperty.call(we,De)&&(ze[De]=we[De])}return ze},$=requireReact(),e=Y($);function Y(ze){return ze&&ze.__esModule?ze:{default:ze}}function Me(ze,Te){if(!(ze instanceof Te))throw new TypeError("Cannot call a class as a function")}function Ae(ze,Te){if(!ze)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Te&&(typeof Te=="object"||typeof Te=="function")?Te:ze}function Se(ze,Te){if(typeof Te!="function"&&Te!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Te);ze.prototype=Object.create(Te&&Te.prototype,{constructor:{value:ze,enumerable:!1,writable:!0,configurable:!0}}),Te&&(Object.setPrototypeOf?Object.setPrototypeOf(ze,Te):ze.__proto__=Te)}var ve=hover.hover=function(Te){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(De){Se(Ie,De);function Ie(){var Ce,Ne,qe,Le;Me(this,Ie);for(var Fe=arguments.length,We=Array(Fe),je=0;je<Fe;je++)We[je]=arguments[je];return Le=(Ne=(qe=Ae(this,(Ce=Ie.__proto__||Object.getPrototypeOf(Ie)).call.apply(Ce,[this].concat(We))),qe),qe.state={hover:!1},qe.handleMouseOver=function(){return qe.setState({hover:!0})},qe.handleMouseOut=function(){return qe.setState({hover:!1})},qe.render=function(){return e.default.createElement(we,{onMouseOver:qe.handleMouseOver,onMouseOut:qe.handleMouseOut},e.default.createElement(Te,ye({},qe.props,qe.state)))},Ne),Ae(qe,Le)}return Ie}(e.default.Component)};return hover.default=ve,hover}var active={},hasRequiredActive;function requireActive(){if(hasRequiredActive)return active;hasRequiredActive=1,Object.defineProperty(active,"__esModule",{value:!0}),active.active=void 0;var ye=Object.assign||function(ze){for(var Te=1;Te<arguments.length;Te++){var we=arguments[Te];for(var De in we)Object.prototype.hasOwnProperty.call(we,De)&&(ze[De]=we[De])}return ze},$=requireReact(),e=Y($);function Y(ze){return ze&&ze.__esModule?ze:{default:ze}}function Me(ze,Te){if(!(ze instanceof Te))throw new TypeError("Cannot call a class as a function")}function Ae(ze,Te){if(!ze)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Te&&(typeof Te=="object"||typeof Te=="function")?Te:ze}function Se(ze,Te){if(typeof Te!="function"&&Te!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Te);ze.prototype=Object.create(Te&&Te.prototype,{constructor:{value:ze,enumerable:!1,writable:!0,configurable:!0}}),Te&&(Object.setPrototypeOf?Object.setPrototypeOf(ze,Te):ze.__proto__=Te)}var ve=active.active=function(Te){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(De){Se(Ie,De);function Ie(){var Ce,Ne,qe,Le;Me(this,Ie);for(var Fe=arguments.length,We=Array(Fe),je=0;je<Fe;je++)We[je]=arguments[je];return Le=(Ne=(qe=Ae(this,(Ce=Ie.__proto__||Object.getPrototypeOf(Ie)).call.apply(Ce,[this].concat(We))),qe),qe.state={active:!1},qe.handleMouseDown=function(){return qe.setState({active:!0})},qe.handleMouseUp=function(){return qe.setState({active:!1})},qe.render=function(){return e.default.createElement(we,{onMouseDown:qe.handleMouseDown,onMouseUp:qe.handleMouseUp},e.default.createElement(Te,ye({},qe.props,qe.state)))},Ne),Ae(qe,Le)}return Ie}(e.default.Component)};return active.default=ve,active}var loop={},hasRequiredLoop;function requireLoop(){if(hasRequiredLoop)return loop;hasRequiredLoop=1,Object.defineProperty(loop,"__esModule",{value:!0});var ye=function(e,Y){var Me={},Ae=function(ve){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Me[ve]=ze};return e===0&&Ae("first-child"),e===Y-1&&Ae("last-child"),(e===0||e%2===0)&&Ae("even"),Math.abs(e%2)===1&&Ae("odd"),Ae("nth-child",e),Me};return loop.default=ye,loop}var hasRequiredLib$2;function requireLib$2(){if(hasRequiredLib$2)return lib$2;hasRequiredLib$2=1,Object.defineProperty(lib$2,"__esModule",{value:!0}),lib$2.ReactCSS=lib$2.loop=lib$2.handleActive=lib$2.handleHover=lib$2.hover=void 0;var ye=requireFlattenNames(),$=Ie(ye),e=requireMergeClasses(),Y=Ie(e),Me=requireAutoprefix(),Ae=Ie(Me),Se=requireHover(),ve=Ie(Se),ze=requireActive(),Te=Ie(ze),we=requireLoop(),De=Ie(we);function Ie(Ne){return Ne&&Ne.__esModule?Ne:{default:Ne}}lib$2.hover=ve.default,lib$2.handleHover=ve.default,lib$2.handleActive=Te.default,lib$2.loop=De.default;var Ce=lib$2.ReactCSS=function(qe){for(var Le=arguments.length,Fe=Array(Le>1?Le-1:0),We=1;We<Le;We++)Fe[We-1]=arguments[We];var je=(0,$.default)(Fe),Ue=(0,Y.default)(qe,je);return(0,Ae.default)(Ue)};return lib$2.default=Ce,lib$2}var libExports$1=requireLib$2();const reactCSS=getDefaultExportFromCjs$1(libExports$1);var calculateChange$2=function ye($,e,Y,Me,Ae){var Se=Ae.clientWidth,ve=Ae.clientHeight,ze=typeof $.pageX=="number"?$.pageX:$.touches[0].pageX,Te=typeof $.pageY=="number"?$.pageY:$.touches[0].pageY,we=ze-(Ae.getBoundingClientRect().left+window.pageXOffset),De=Te-(Ae.getBoundingClientRect().top+window.pageYOffset);if(Y==="vertical"){var Ie=void 0;if(De<0?Ie=0:De>ve?Ie=1:Ie=Math.round(De*100/ve)/100,e.a!==Ie)return{h:e.h,s:e.s,l:e.l,a:Ie,source:"rgb"}}else{var Ce=void 0;if(we<0?Ce=0:we>Se?Ce=1:Ce=Math.round(we*100/Se)/100,Me!==Ce)return{h:e.h,s:e.s,l:e.l,a:Ce,source:"rgb"}}return null},checkboardCache={},render=function ye($,e,Y,Me){if(typeof document>"u"&&!Me)return null;var Ae=Me?new Me:document.createElement("canvas");Ae.width=Y*2,Ae.height=Y*2;var Se=Ae.getContext("2d");return Se?(Se.fillStyle=$,Se.fillRect(0,0,Ae.width,Ae.height),Se.fillStyle=e,Se.fillRect(0,0,Y,Y),Se.translate(Y,Y),Se.fillRect(0,0,Y,Y),Ae.toDataURL()):null},get$1=function ye($,e,Y,Me){var Ae=$+"-"+e+"-"+Y+(Me?"-server":"");if(checkboardCache[Ae])return checkboardCache[Ae];var Se=render($,e,Y,Me);return checkboardCache[Ae]=Se,Se},_extends$p=Object.assign||function(ye){for(var $=1;$<arguments.length;$++){var e=arguments[$];for(var Y in e)Object.prototype.hasOwnProperty.call(e,Y)&&(ye[Y]=e[Y])}return ye},Checkboard=function ye($){var e=$.white,Y=$.grey,Me=$.size,Ae=$.renderers,Se=$.borderRadius,ve=$.boxShadow,ze=$.children,Te=reactCSS({default:{grid:{borderRadius:Se,boxShadow:ve,absolute:"0px 0px 0px 0px",background:"url("+get$1(e,Y,Me,Ae.canvas)+") center left"}}});return reactExports.isValidElement(ze)?React.cloneElement(ze,_extends$p({},ze.props,{style:_extends$p({},ze.props.style,Te.grid)})):React.createElement("div",{style:Te.grid})};Checkboard.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var _extends$o=Object.assign||function(ye){for(var $=1;$<arguments.length;$++){var e=arguments[$];for(var Y in e)Object.prototype.hasOwnProperty.call(e,Y)&&(ye[Y]=e[Y])}return ye},_createClass$c=function(){function ye($,e){for(var Y=0;Y<e.length;Y++){var Me=e[Y];Me.enumerable=Me.enumerable||!1,Me.configurable=!0,"value"in Me&&(Me.writable=!0),Object.defineProperty($,Me.key,Me)}}return function($,e,Y){return e&&ye($.prototype,e),Y&&ye($,Y),$}}();function _classCallCheck$c(ye,$){if(!(ye instanceof $))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$c(ye,$){if(!ye)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:ye}function _inherits$c(ye,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);ye.prototype=Object.create($&&$.prototype,{constructor:{value:ye,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(ye,$):ye.__proto__=$)}var Alpha=function(ye){_inherits$c($,ye);function $(){var e,Y,Me,Ae;_classCallCheck$c(this,$);for(var Se=arguments.length,ve=Array(Se),ze=0;ze<Se;ze++)ve[ze]=arguments[ze];return Ae=(Y=(Me=_possibleConstructorReturn$c(this,(e=$.__proto__||Object.getPrototypeOf($)).call.apply(e,[this].concat(ve))),Me),Me.handleChange=function(Te){var we=calculateChange$2(Te,Me.props.hsl,Me.props.direction,Me.props.a,Me.container);we&&typeof Me.props.onChange=="function"&&Me.props.onChange(we,Te)},Me.handleMouseDown=function(Te){Me.handleChange(Te),window.addEventListener("mousemove",Me.handleChange),window.addEventListener("mouseup",Me.handleMouseUp)},Me.handleMouseUp=function(){Me.unbindEventListeners()},Me.unbindEventListeners=function(){window.removeEventListener("mousemove",Me.handleChange),window.removeEventListener("mouseup",Me.handleMouseUp)},Y),_possibleConstructorReturn$c(Me,Ae)}return _createClass$c($,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var Y=this,Me=this.props.rgb,Ae=reactCSS({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+Me.r+","+Me.g+","+Me.b+`, 0) 0%,
694
+ `),allowHTML:!1})]}),ze&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ze.includes("linear"),color:ze})]})}const StyledCheckbox$1=newStyled("div",{target:"e6x5rwu0"})(({width:ye,theme:$})=>({width:ye,display:"flex",alignItems:"center",minHeight:$.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"e6x5rwu1"})(({visibility:ye})=>({display:ye===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:ye===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(ye,$){let e=$.spacing.lg;return ye==="medium"?e=$.spacing.threeXL:ye==="large"&&(e=$.spacing.fourXL),e}const StyledHorizontalBlock=newStyled("div",{target:"e6rk8up0"})(({theme:ye,gap:$})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth($,ye)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"e6rk8up1"})(({theme:ye,isStale:$,width:e,elementType:Y})=>({width:e,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:ye.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${ye.spacing.lg}`,zIndex:ye.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${ye.spacing.xs}`,marginBottom:`-${ye.spacing.xs}`},...$&&Y!=="skeleton"&&STALE_STYLES,...Y==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(Y)?{marginBottom:`-${ye.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"e6rk8up2"})(({theme:ye,weight:$,gap:e,showBorder:Y,verticalAlignment:Me})=>{const{VerticalAlignment:Ae}=Block$2.Column,Se=$*100,ve=translateGapWidth(e,ye),ze=`calc(${Se}% - ${ve})`;return{width:ze,flex:`1 1 ${ze}`,[`@media (max-width: ${ye.breakpoints.columns})`]:{minWidth:`calc(100% - ${ye.spacing.twoXL})`},...Me===Ae.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:ye.spacing.sm}},...Me===Ae.TOP&&{[`& ${StyledElementContainer}:first-of-type > ${StyledCheckbox$1}`]:{marginTop:ye.spacing.sm}},...Me===Ae.CENTER&&{marginTop:"auto",marginBottom:"auto"},...Y&&{border:`${ye.sizes.borderWidth} solid ${ye.colors.borderColor}`,borderRadius:ye.radii.default,padding:`calc(${ye.spacing.lg} - ${ye.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"e6rk8up3"})(({width:ye,theme:$})=>({width:ye,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:$.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"e6rk8up4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"e6rk8up5"})(({theme:ye,border:$,height:e})=>({...$&&{border:`${ye.sizes.borderWidth} solid ${ye.colors.borderColor}`,borderRadius:ye.radii.default,padding:`calc(${ye.spacing.lg} - ${ye.sizes.borderWidth})`},...e&&{height:`${e}px`,overflow:"auto"}})),Audio=React.lazy(()=>__vitePreload(()=>import("./index.FawRMwD-.js"),[],import.meta.url)),Balloons=React.lazy(()=>__vitePreload(()=>import("./index.ChTsHUaC.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React.lazy(()=>__vitePreload(()=>import("./index.DZlSz8lf.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React.lazy(()=>__vitePreload(()=>import("./index.B3HJ1joN.js").then(ye=>ye.c),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url)),ArrowVegaLiteChart=React.lazy(()=>__vitePreload(()=>import("./index.BOAkIKUg.js"),__vite__mapDeps([15,6,5,7,16,17,18,4]),import.meta.url)),Toast=React.lazy(()=>__vitePreload(()=>import("./index.CX29idWq.js"),[],import.meta.url)),BokehChart=React.lazy(()=>__vitePreload(()=>import("./index.CPeAZG1R.js"),[],import.meta.url)),DebouncedBokehChart=debounceRender(BokehChart,100),DeckGlJsonChart=React.lazy(()=>__vitePreload(()=>import("./index.wclN5y6j.js"),__vite__mapDeps([19,10,11,6,5,20,4,16,17,21,22]),import.meta.url)),GraphVizChart=React.lazy(()=>__vitePreload(()=>import("./index.BJ2gQSjT.js"),__vite__mapDeps([23,18,17,6,5]),import.meta.url)),IFrame=React.lazy(()=>__vitePreload(()=>import("./index.aoRAdNJI.js"),[],import.meta.url)),ImageList=React.lazy(()=>__vitePreload(()=>import("./index.idE2oxkV.js"),__vite__mapDeps([24,6,5]),import.meta.url)),LinkButton=React.lazy(()=>__vitePreload(()=>import("./index.BY7jwxwh.js"),[],import.meta.url)),PageLink=React.lazy(()=>__vitePreload(()=>import("./index.BNP-YHIi.js"),[],import.meta.url)),PlotlyChart=React.lazy(()=>__vitePreload(()=>import("./index.CCj1lvY2.js"),__vite__mapDeps([25,4,5]),import.meta.url)),Video=React.lazy(()=>__vitePreload(()=>import("./index.Dz2gm3-U.js"),[],import.meta.url)),AudioInput=React.lazy(()=>__vitePreload(()=>import("./index.mQsqDFei.js"),__vite__mapDeps([26,4,6,27,9,13]),import.meta.url)),Button=React.lazy(()=>__vitePreload(()=>import("./index.BVHKdy_B.js"),[],import.meta.url)),ButtonGroup=React.lazy(()=>__vitePreload(()=>import("./index.DxXPukev.js"),__vite__mapDeps([28,20,4]),import.meta.url)),DownloadButton=React.lazy(()=>__vitePreload(()=>import("./index.VDF9za4g.js"),__vite__mapDeps([29,9]),import.meta.url)),CameraInput=React.lazy(()=>__vitePreload(()=>import("./index.rqm-tyVr.js"),__vite__mapDeps([30,21,4,31,32]),import.meta.url)),ChatInput=React.lazy(()=>__vitePreload(()=>import("./index.hEabuvQl.js"),__vite__mapDeps([33,34,35,36,21,31,37,38]),import.meta.url)),Checkbox=React.lazy(()=>__vitePreload(()=>import("./index.BU0eO7qf.js"),__vite__mapDeps([39,20,4]),import.meta.url)),ColorPicker=React.lazy(()=>__vitePreload(()=>import("./index.CC8zeoS7.js"),__vite__mapDeps([40,20,4]),import.meta.url)),DateInput=React.lazy(()=>__vitePreload(()=>import("./index.BLBTL57W.js"),__vite__mapDeps([41,20,4,42,11,12,43,38]),import.meta.url)),Html=React.lazy(()=>__vitePreload(()=>import("./index.Df7Lr-8j.js"),[],import.meta.url)),Multiselect=React.lazy(()=>__vitePreload(()=>import("./index.xj8ZjDtP.js"),__vite__mapDeps([44,20,4]),import.meta.url)),Progress=React.lazy(()=>__vitePreload(()=>import("./index.DoLrZkRU.js"),__vite__mapDeps([45,32]),import.meta.url)),Spinner=React.lazy(()=>__vitePreload(()=>import("./index.BeOYoTtD.js"),[],import.meta.url)),Radio=React.lazy(()=>__vitePreload(()=>import("./index.DAlDuq3e.js"),__vite__mapDeps([46,20,4]),import.meta.url)),Selectbox$1=React.lazy(()=>__vitePreload(()=>import("./index.0VYiXfju.js"),__vite__mapDeps([47,20,4]),import.meta.url)),Slider$1=React.lazy(()=>__vitePreload(()=>import("./index.C2dTzC3_.js"),__vite__mapDeps([48,8,20,4]),import.meta.url)),FileUploader=React.lazy(()=>__vitePreload(()=>import("./index.-b7dNs6l.js"),__vite__mapDeps([49,21,4,34,32,27,31]),import.meta.url)),TextArea=React.lazy(()=>__vitePreload(()=>import("./index.Byw8b24h.js"),__vite__mapDeps([50,51,52,36,35,20,4,37,38]),import.meta.url)),TextInput=React.lazy(()=>__vitePreload(()=>import("./index.CiWJLcV9.js"),__vite__mapDeps([53,51,52,36,20,4,35,43,38]),import.meta.url)),TimeInput=React.lazy(()=>__vitePreload(()=>import("./index.Vo9Xk_-P.js"),__vite__mapDeps([54,20,4,42,11,12]),import.meta.url)),NumberInput=React.lazy(()=>__vitePreload(()=>import("./index.jaOfuXT_.js"),__vite__mapDeps([55,8,51,4,35,43,38]),import.meta.url)),StreamlitSyntaxHighlighter=React.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(ye,$){return ye?jsx$1(Fragment,{}):$}const RawElementNodeRenderer=ye=>{const{node:$}=ye;if(!$)throw new Error("ElementNode not found.");const e={width:ye.width,disableFullscreenMode:ye.disableFullscreenMode},Y={...e,widgetMgr:ye.widgetMgr,disabled:ye.widgetsDisabled,fragmentId:$.fragmentId};switch($.element.type){case"alert":{const Ae=$.element.alert;return jsx$1(AlertElement$1,{icon:Ae.icon,body:Ae.body,kind:getAlertElementKind(Ae.format),...e})}case"arrowTable":return jsx$1(ArrowTable$1,{element:$.quiverElement,...e});case"audio":return jsx$1(Audio,{element:$.element.audio,endpoints:ye.endpoints,...e,elementMgr:ye.widgetMgr});case"balloons":return hideIfStale(ye.isStale,jsx$1(Balloons,{scriptRunId:ye.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:$.element.bokehChart,...e});case"code":{const Ae=$.element.code;return jsx$1(StreamlitSyntaxHighlighter,{language:Ae.language,showLineNumbers:Ae.showLineNumbers,wrapLines:Ae.wrapLines,height:Ae.height,children:Ae.codeText})}case"deckGlJsonChart":return jsx$1(DeckGlJsonChart,{element:$.element.deckGlJsonChart,...Y});case"docString":return jsx$1(DocString$1,{element:$.element.docString,...e});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement$1,{element:$.element.exception,...e});case"graphvizChart":return jsx$1(GraphVizChart,{element:$.element.graphvizChart,...e});case"heading":return jsx$1(Heading,{element:$.element.heading,...e});case"iframe":return jsx$1(IFrame,{element:$.element.iframe,...e});case"imgs":return jsx$1(ImageList,{element:$.element.imgs,endpoints:ye.endpoints,...e});case"json":return jsx$1(Json$1,{element:$.element.json,...e});case"markdown":return jsx$1(Markdown$1,{element:$.element.markdown,...e});case"metric":return jsx$1(Metric$1,{element:$.element.metric});case"html":return jsx$1(Html,{element:$.element.html,...e});case"pageLink":{const Ae=$.element.pageLink,Se=Y.disabled||Ae.disabled;return jsx$1(PageLink,{element:Ae,disabled:Se,...e})}case"progress":return jsx$1(Progress,{element:$.element.progress,...e});case"skeleton":return jsx$1(Skeleton,{element:$.element.skeleton});case"snow":return hideIfStale(ye.isStale,jsx$1(Snow,{scriptRunId:ye.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:$.element.spinner,...e});case"text":return jsx$1(TextElement$1,{element:$.element.text,...e});case"video":return jsx$1(Video,{element:$.element.video,endpoints:ye.endpoints,...e,elementMgr:ye.widgetMgr});case"toast":{const Ae=$.element.toast;return jsx$1(Toast,{body:Ae.body,icon:Ae.icon,...e},$.scriptRunId)}case"arrowDataFrame":{const Ae=$.element.arrowDataFrame;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ArrowDataFrame,{element:Ae,data:$.quiverElement,...Ae.id&&{key:Ae.id},...Y})}case"arrowVegaLiteChart":const Me=$.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:Me,...Y},Me.id||void 0);case"audioInput":{const Ae=$.element.audioInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(AudioInput,{uploadClient:ye.uploadClient,element:Ae,...Y},Ae.id)}case"button":{const Ae=$.element.button;if(Y.disabled=Y.disabled||Ae.disabled,Ae.isFormSubmitter){const{formId:Se}=Ae,ve=ye.formsData.formsWithUploads.has(Se);return jsx$1(FormSubmitContent,{element:Ae,hasInProgressUpload:ve,...Y})}return jsx$1(Button,{element:Ae,...Y})}case"buttonGroup":{const Ae=$.element.buttonGroup;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ButtonGroup,{element:Ae,...Y},Ae.id)}case"downloadButton":{const Ae=$.element.downloadButton;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(DownloadButton,{endpoints:ye.endpoints,element:Ae,...Y},Ae.id)}case"cameraInput":{const Ae=$.element.cameraInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(CameraInput,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"chatInput":{const Ae=$.element.chatInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ChatInput,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"checkbox":{const Ae=$.element.checkbox;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Checkbox,{element:Ae,...Y},Ae.id)}case"colorPicker":{const Ae=$.element.colorPicker;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ColorPicker,{element:Ae,...Y},Ae.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:ye.componentRegistry,element:$.element.componentInstance,...Y});case"dateInput":{const Ae=$.element.dateInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(DateInput,{element:Ae,...Y},Ae.id)}case"fileUploader":{const Ae=$.element.fileUploader;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(FileUploader,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"linkButton":{const Ae=$.element.linkButton;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(LinkButton,{element:Ae,...Y})}case"multiselect":{const Ae=$.element.multiselect;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Multiselect,{element:Ae,...Y},Ae.id)}case"numberInput":{const Ae=$.element.numberInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(NumberInput,{element:Ae,...Y},Ae.id)}case"plotlyChart":{const Ae=$.element.plotlyChart;return jsx$1(PlotlyChart,{element:Ae,...Y},Ae.id)}case"radio":{const Ae=$.element.radio;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Radio,{element:Ae,...Y},Ae.id)}case"selectbox":{const Ae=$.element.selectbox;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Selectbox$1,{element:Ae,...Y},Ae.id)}case"slider":{const Ae=$.element.slider;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Slider$1,{element:Ae,...Y},Ae.id)}case"textArea":{const Ae=$.element.textArea;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TextArea,{element:Ae,...Y},Ae.id)}case"textInput":{const Ae=$.element.textInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TextInput,{element:Ae,...Y},Ae.id)}case"timeInput":{const Ae=$.element.timeInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TimeInput,{element:Ae,...Y},Ae.id)}default:throw new Error(`Unrecognized Element type ${$.element.type}`)}},ElementNodeRenderer=ye=>{const{isFullScreen:$,fragmentIdsThisRun:e}=React.useContext(LibContext),{node:Y,width:Me}=ye,Ae=Y.element.type||"",Se=shouldComponentBeEnabled(Ae,ye.scriptRunState),ve=isComponentStale(Se,Y,ye.scriptRunState,ye.scriptRunId,e),ze=getElementId(Y.element),Te=getKeyFromId(ze);return jsx$1(Maybe,{enable:Se,children:jsx$1(StyledElementContainer,{className:classNames("stElementContainer","element-container",convertKeyToClassName(Te)),"data-testid":"stElementContainer","data-stale":ve,isStale:ve&&!$,width:Me,elementType:Ae,children:jsx$1(ErrorBoundary,{width:Me,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(Skeleton,{element:Skeleton$1.create({style:Skeleton$1.SkeletonStyle.ELEMENT})}),children:jsx$1(RawElementNodeRenderer,{...ye,isStale:ve})})})})})},BlockNodeRenderer=ye=>{const{node:$}=ye,{fragmentIdsThisRun:e}=reactExports.useContext(LibContext);if($.isEmpty&&!$.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const Y=shouldComponentBeEnabled("",ye.scriptRunState),Me=isComponentStale(Y,$,ye.scriptRunState,ye.scriptRunId,e),Ae={...ye,node:$},Se=ye.disableFullscreenMode||d$2($.deltaBlock.dialog)||d$2($.deltaBlock.popover),ve=jsx$1(LayoutBlock,{...Ae,disableFullscreenMode:Se});if($.deltaBlock.dialog)return jsx$1(Dialog$1,{element:$.deltaBlock.dialog,deltaMsgReceivedAt:$.deltaMsgReceivedAt,children:ve});if($.deltaBlock.expandable)return jsx$1(Expander$1,{empty:$.isEmpty,isStale:Me,element:$.deltaBlock.expandable,children:ve});if($.deltaBlock.popover)return jsx$1(Popover$1,{empty:$.isEmpty,element:$.deltaBlock.popover,width:ye.width,children:ve});if($.deltaBlock.type==="form"){const{formId:ze,clearOnSubmit:Te,enterToSubmit:we,border:De}=$.deltaBlock.form,Ie=ye.formsData.submitButtons.get(ze),Ce=Ie!==void 0&&Ie.length>0;return jsx$1(Form$1,{formId:ze,clearOnSubmit:Te,enterToSubmit:we,width:ye.width,hasSubmitButton:Ce,scriptRunState:ye.scriptRunState,widgetMgr:ye.widgetMgr,border:De,children:ve})}if($.deltaBlock.chatMessage)return jsx$1(ChatMessage$1,{element:$.deltaBlock.chatMessage,endpoints:ye.endpoints,children:ve});if($.deltaBlock.column)return jsx$1(StyledColumn,{weight:$.deltaBlock.column.weight??0,gap:$.deltaBlock.column.gap??"",verticalAlignment:$.deltaBlock.column.verticalAlignment??void 0,showBorder:$.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ve});if($.deltaBlock.tabContainer){const Te={...Ae,isStale:Me,renderTabContent:we=>jsx$1(VerticalBlock,{...we})};return jsx$1(Tabs$1,{...Te})}return ve},ChildRenderer=ye=>{const{libConfig:$}=reactExports.useContext(LibContext);assignDividerColor(ye.node,useTheme());const e=new Set;return jsx$1(Fragment,{children:ye.node.children&&ye.node.children.map((Y,Me)=>{const Ae=$.disableFullscreenMode||ye.disableFullscreenMode;if(Y instanceof ElementNode){const Se={...ye,disableFullscreenMode:Ae,node:Y},ve=getElementId(Y.element)||Me.toString();return e.has(ve)?null:(e.add(ve),jsx$1(ElementNodeRenderer,{...Se},ve))}if(Y instanceof BlockNode){const Se={...ye,disableFullscreenMode:Ae,node:Y};return jsx$1(BlockNodeRenderer,{...Se},Me)}throw new Error(`Unrecognized AppNode: ${Y}`)})})};function ScrollToBottomVerticalBlockWrapper(ye){const{border:$,height:e,children:Y}=ye,Me=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:$,height:e,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:Me,children:Y})}const VerticalBlock=ye=>{var De,Ie;const $=reactExports.useRef(null),[e,Y]=React.useState(-1),Me=reactExports.useMemo(()=>new ResizeObserver(([Ce])=>{window.requestAnimationFrame(()=>{Y(Ce.target.getBoundingClientRect().width||-1)})}),[Y]),Ae=((De=ye.node.deltaBlock.vertical)==null?void 0:De.border)??!1,Se=((Ie=ye.node.deltaBlock.vertical)==null?void 0:Ie.height)||void 0,ve=Se&&ye.node.children.find(Ce=>Ce instanceof BlockNode&&Ce.deltaBlock.type==="chatMessage")!==void 0;reactExports.useEffect(()=>($.current&&Me.observe($.current),()=>{Me.disconnect()}),[Me,ve]);const ze=ve?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,Te={...ye,width:e},we=getKeyFromId(ye.node.deltaBlock.id);return jsx$1(ze,{border:Ae,height:Se,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:$,children:jsx$1(StyledVerticalBlock,{width:e,className:classNames("stVerticalBlock",convertKeyToClassName(we)),"data-testid":"stVerticalBlock",children:jsx$1(ChildRenderer,{...Te})})})})},HorizontalBlock=ye=>{var e;const $=((e=ye.node.deltaBlock.horizontal)==null?void 0:e.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:$,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...ye})})};function LayoutBlock(ye){return ye.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...ye}):jsx$1(VerticalBlock,{...ye})}const StyledDataFrameOverlay=newStyled("div",{target:"e19n7mk11"})(({theme:ye})=>({position:"fixed",top:0,left:0,zIndex:ye.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React.createContext(null),PortalProvider=({children:ye})=>{const $=reactExports.useRef(null),e=reactExports.useCallback(()=>$.current,[]);return jsxs(PortalContext.Provider,{value:e,children:[ye,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:$})]})};function ThemeProvider({theme:ye,baseuiTheme:$,children:e}){return jsx$1(ThemeProvider$1,{theme:$||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:ye,children:e})})}function toCodePoint(ye,$){const e=[];let Y=0,Me=0,Ae=0;for(;Ae<ye.length;)Y=ye.charCodeAt(Ae++),Me?(e.push((65536+(Me-55296<<10)+(Y-56320)).toString(16)),Me=0):55296<=Y&&Y<=56319?Me=Y:e.push(Y.toString(16));return e.join("-")}const UFE0Fg=/\uFE0F/g,U200D="‍";function grabTheRightIcon(ye){return toCodePoint(ye.indexOf(U200D)<0?ye.replace(UFE0Fg,""):ye)}function iconToUrl(ye){const $=/^:(.+)\/(.+):$/,e=ye.match($);return e===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${e[2]}/default/24px.svg`}function handleFavicon(ye,$,e){const Y=extractEmoji(ye);let Me;Y&&!ye.startsWith(":material")?Me=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(Y)}.png`:ye.startsWith(":material")?Me=iconToUrl(ye):Me=e.buildMediaURL(ye),overwriteFavicon(Me),$({type:"SET_PAGE_FAVICON",favicon:Me})}function overwriteFavicon(ye){const $=document.querySelector("link[rel='shortcut icon']");$&&($.href=ye)}function extractEmoji(ye){const $=ye.replace("-","_");return nodeEmoji.hasEmoji(nodeEmoji.get($))?nodeEmoji.get($):nodeEmoji.hasEmoji(ye)?ye:""}var lib$2={},flattenNames={},_baseForOwn,hasRequired_baseForOwn;function require_baseForOwn(){if(hasRequired_baseForOwn)return _baseForOwn;hasRequired_baseForOwn=1;var ye=require_baseFor(),$=requireKeys();function e(Y,Me){return Y&&ye(Y,Me,$)}return _baseForOwn=e,_baseForOwn}var _castFunction,hasRequired_castFunction;function require_castFunction(){if(hasRequired_castFunction)return _castFunction;hasRequired_castFunction=1;var ye=requireIdentity();function $(e){return typeof e=="function"?e:ye}return _castFunction=$,_castFunction}var forOwn_1,hasRequiredForOwn;function requireForOwn(){if(hasRequiredForOwn)return forOwn_1;hasRequiredForOwn=1;var ye=require_baseForOwn(),$=require_castFunction();function e(Y,Me){return Y&&ye(Y,$(Me))}return forOwn_1=e,forOwn_1}var _setCacheAdd,hasRequired_setCacheAdd;function require_setCacheAdd(){if(hasRequired_setCacheAdd)return _setCacheAdd;hasRequired_setCacheAdd=1;var ye="__lodash_hash_undefined__";function $(e){return this.__data__.set(e,ye),this}return _setCacheAdd=$,_setCacheAdd}var _setCacheHas,hasRequired_setCacheHas;function require_setCacheHas(){if(hasRequired_setCacheHas)return _setCacheHas;hasRequired_setCacheHas=1;function ye($){return this.__data__.has($)}return _setCacheHas=ye,_setCacheHas}var _SetCache,hasRequired_SetCache;function require_SetCache(){if(hasRequired_SetCache)return _SetCache;hasRequired_SetCache=1;var ye=require_MapCache(),$=require_setCacheAdd(),e=require_setCacheHas();function Y(Me){var Ae=-1,Se=Me==null?0:Me.length;for(this.__data__=new ye;++Ae<Se;)this.add(Me[Ae])}return Y.prototype.add=Y.prototype.push=$,Y.prototype.has=e,_SetCache=Y,_SetCache}var _arraySome,hasRequired_arraySome;function require_arraySome(){if(hasRequired_arraySome)return _arraySome;hasRequired_arraySome=1;function ye($,e){for(var Y=-1,Me=$==null?0:$.length;++Y<Me;)if(e($[Y],Y,$))return!0;return!1}return _arraySome=ye,_arraySome}var _cacheHas,hasRequired_cacheHas;function require_cacheHas(){if(hasRequired_cacheHas)return _cacheHas;hasRequired_cacheHas=1;function ye($,e){return $.has(e)}return _cacheHas=ye,_cacheHas}var _equalArrays,hasRequired_equalArrays;function require_equalArrays(){if(hasRequired_equalArrays)return _equalArrays;hasRequired_equalArrays=1;var ye=require_SetCache(),$=require_arraySome(),e=require_cacheHas(),Y=1,Me=2;function Ae(Se,ve,ze,Te,we,De){var Ie=ze&Y,Ce=Se.length,Ne=ve.length;if(Ce!=Ne&&!(Ie&&Ne>Ce))return!1;var qe=De.get(Se),Le=De.get(ve);if(qe&&Le)return qe==ve&&Le==Se;var Fe=-1,We=!0,je=ze&Me?new ye:void 0;for(De.set(Se,ve),De.set(ve,Se);++Fe<Ce;){var Ue=Se[Fe],Ge=ve[Fe];if(Te)var He=Ie?Te(Ge,Ue,Fe,ve,Se,De):Te(Ue,Ge,Fe,Se,ve,De);if(He!==void 0){if(He)continue;We=!1;break}if(je){if(!$(ve,function(Xe,st){if(!e(je,st)&&(Ue===Xe||we(Ue,Xe,ze,Te,De)))return je.push(st)})){We=!1;break}}else if(!(Ue===Ge||we(Ue,Ge,ze,Te,De))){We=!1;break}}return De.delete(Se),De.delete(ve),We}return _equalArrays=Ae,_equalArrays}var _equalByTag,hasRequired_equalByTag;function require_equalByTag(){if(hasRequired_equalByTag)return _equalByTag;hasRequired_equalByTag=1;var ye=require_Symbol(),$=require_Uint8Array(),e=requireEq(),Y=require_equalArrays(),Me=require_mapToArray(),Ae=require_setToArray(),Se=1,ve=2,ze="[object Boolean]",Te="[object Date]",we="[object Error]",De="[object Map]",Ie="[object Number]",Ce="[object RegExp]",Ne="[object Set]",qe="[object String]",Le="[object Symbol]",Fe="[object ArrayBuffer]",We="[object DataView]",je=ye?ye.prototype:void 0,Ue=je?je.valueOf:void 0;function Ge(He,Xe,st,Je,Qe,rt,ut){switch(st){case We:if(He.byteLength!=Xe.byteLength||He.byteOffset!=Xe.byteOffset)return!1;He=He.buffer,Xe=Xe.buffer;case Fe:return!(He.byteLength!=Xe.byteLength||!rt(new $(He),new $(Xe)));case ze:case Te:case Ie:return e(+He,+Xe);case we:return He.name==Xe.name&&He.message==Xe.message;case Ce:case qe:return He==Xe+"";case De:var ft=Me;case Ne:var yt=Je&Se;if(ft||(ft=Ae),He.size!=Xe.size&&!yt)return!1;var bt=ut.get(He);if(bt)return bt==Xe;Je|=ve,ut.set(He,Xe);var At=Y(ft(He),ft(Xe),Je,Qe,rt,ut);return ut.delete(He),At;case Le:if(Ue)return Ue.call(He)==Ue.call(Xe)}return!1}return _equalByTag=Ge,_equalByTag}var _equalObjects,hasRequired_equalObjects;function require_equalObjects(){if(hasRequired_equalObjects)return _equalObjects;hasRequired_equalObjects=1;var ye=require_getAllKeys(),$=1,e=Object.prototype,Y=e.hasOwnProperty;function Me(Ae,Se,ve,ze,Te,we){var De=ve&$,Ie=ye(Ae),Ce=Ie.length,Ne=ye(Se),qe=Ne.length;if(Ce!=qe&&!De)return!1;for(var Le=Ce;Le--;){var Fe=Ie[Le];if(!(De?Fe in Se:Y.call(Se,Fe)))return!1}var We=we.get(Ae),je=we.get(Se);if(We&&je)return We==Se&&je==Ae;var Ue=!0;we.set(Ae,Se),we.set(Se,Ae);for(var Ge=De;++Le<Ce;){Fe=Ie[Le];var He=Ae[Fe],Xe=Se[Fe];if(ze)var st=De?ze(Xe,He,Fe,Se,Ae,we):ze(He,Xe,Fe,Ae,Se,we);if(!(st===void 0?He===Xe||Te(He,Xe,ve,ze,we):st)){Ue=!1;break}Ge||(Ge=Fe=="constructor")}if(Ue&&!Ge){var Je=Ae.constructor,Qe=Se.constructor;Je!=Qe&&"constructor"in Ae&&"constructor"in Se&&!(typeof Je=="function"&&Je instanceof Je&&typeof Qe=="function"&&Qe instanceof Qe)&&(Ue=!1)}return we.delete(Ae),we.delete(Se),Ue}return _equalObjects=Me,_equalObjects}var _baseIsEqualDeep,hasRequired_baseIsEqualDeep;function require_baseIsEqualDeep(){if(hasRequired_baseIsEqualDeep)return _baseIsEqualDeep;hasRequired_baseIsEqualDeep=1;var ye=require_Stack(),$=require_equalArrays(),e=require_equalByTag(),Y=require_equalObjects(),Me=require_getTag(),Ae=requireIsArray(),Se=requireIsBuffer$1(),ve=requireIsTypedArray(),ze=1,Te="[object Arguments]",we="[object Array]",De="[object Object]",Ie=Object.prototype,Ce=Ie.hasOwnProperty;function Ne(qe,Le,Fe,We,je,Ue){var Ge=Ae(qe),He=Ae(Le),Xe=Ge?we:Me(qe),st=He?we:Me(Le);Xe=Xe==Te?De:Xe,st=st==Te?De:st;var Je=Xe==De,Qe=st==De,rt=Xe==st;if(rt&&Se(qe)){if(!Se(Le))return!1;Ge=!0,Je=!1}if(rt&&!Je)return Ue||(Ue=new ye),Ge||ve(qe)?$(qe,Le,Fe,We,je,Ue):e(qe,Le,Xe,Fe,We,je,Ue);if(!(Fe&ze)){var ut=Je&&Ce.call(qe,"__wrapped__"),ft=Qe&&Ce.call(Le,"__wrapped__");if(ut||ft){var yt=ut?qe.value():qe,bt=ft?Le.value():Le;return Ue||(Ue=new ye),je(yt,bt,Fe,We,Ue)}}return rt?(Ue||(Ue=new ye),Y(qe,Le,Fe,We,je,Ue)):!1}return _baseIsEqualDeep=Ne,_baseIsEqualDeep}var _baseIsEqual,hasRequired_baseIsEqual;function require_baseIsEqual(){if(hasRequired_baseIsEqual)return _baseIsEqual;hasRequired_baseIsEqual=1;var ye=require_baseIsEqualDeep(),$=requireIsObjectLike();function e(Y,Me,Ae,Se,ve){return Y===Me?!0:Y==null||Me==null||!$(Y)&&!$(Me)?Y!==Y&&Me!==Me:ye(Y,Me,Ae,Se,e,ve)}return _baseIsEqual=e,_baseIsEqual}var _baseIsMatch,hasRequired_baseIsMatch;function require_baseIsMatch(){if(hasRequired_baseIsMatch)return _baseIsMatch;hasRequired_baseIsMatch=1;var ye=require_Stack(),$=require_baseIsEqual(),e=1,Y=2;function Me(Ae,Se,ve,ze){var Te=ve.length,we=Te,De=!ze;if(Ae==null)return!we;for(Ae=Object(Ae);Te--;){var Ie=ve[Te];if(De&&Ie[2]?Ie[1]!==Ae[Ie[0]]:!(Ie[0]in Ae))return!1}for(;++Te<we;){Ie=ve[Te];var Ce=Ie[0],Ne=Ae[Ce],qe=Ie[1];if(De&&Ie[2]){if(Ne===void 0&&!(Ce in Ae))return!1}else{var Le=new ye;if(ze)var Fe=ze(Ne,qe,Ce,Ae,Se,Le);if(!(Fe===void 0?$(qe,Ne,e|Y,ze,Le):Fe))return!1}}return!0}return _baseIsMatch=Me,_baseIsMatch}var _isStrictComparable,hasRequired_isStrictComparable;function require_isStrictComparable(){if(hasRequired_isStrictComparable)return _isStrictComparable;hasRequired_isStrictComparable=1;var ye=requireIsObject();function $(e){return e===e&&!ye(e)}return _isStrictComparable=$,_isStrictComparable}var _getMatchData,hasRequired_getMatchData;function require_getMatchData(){if(hasRequired_getMatchData)return _getMatchData;hasRequired_getMatchData=1;var ye=require_isStrictComparable(),$=requireKeys();function e(Y){for(var Me=$(Y),Ae=Me.length;Ae--;){var Se=Me[Ae],ve=Y[Se];Me[Ae]=[Se,ve,ye(ve)]}return Me}return _getMatchData=e,_getMatchData}var _matchesStrictComparable,hasRequired_matchesStrictComparable;function require_matchesStrictComparable(){if(hasRequired_matchesStrictComparable)return _matchesStrictComparable;hasRequired_matchesStrictComparable=1;function ye($,e){return function(Y){return Y==null?!1:Y[$]===e&&(e!==void 0||$ in Object(Y))}}return _matchesStrictComparable=ye,_matchesStrictComparable}var _baseMatches,hasRequired_baseMatches;function require_baseMatches(){if(hasRequired_baseMatches)return _baseMatches;hasRequired_baseMatches=1;var ye=require_baseIsMatch(),$=require_getMatchData(),e=require_matchesStrictComparable();function Y(Me){var Ae=$(Me);return Ae.length==1&&Ae[0][2]?e(Ae[0][0],Ae[0][1]):function(Se){return Se===Me||ye(Se,Me,Ae)}}return _baseMatches=Y,_baseMatches}var _baseHasIn,hasRequired_baseHasIn;function require_baseHasIn(){if(hasRequired_baseHasIn)return _baseHasIn;hasRequired_baseHasIn=1;function ye($,e){return $!=null&&e in Object($)}return _baseHasIn=ye,_baseHasIn}var _hasPath,hasRequired_hasPath;function require_hasPath(){if(hasRequired_hasPath)return _hasPath;hasRequired_hasPath=1;var ye=require_castPath(),$=requireIsArguments(),e=requireIsArray(),Y=require_isIndex(),Me=requireIsLength(),Ae=require_toKey();function Se(ve,ze,Te){ze=ye(ze,ve);for(var we=-1,De=ze.length,Ie=!1;++we<De;){var Ce=Ae(ze[we]);if(!(Ie=ve!=null&&Te(ve,Ce)))break;ve=ve[Ce]}return Ie||++we!=De?Ie:(De=ve==null?0:ve.length,!!De&&Me(De)&&Y(Ce,De)&&(e(ve)||$(ve)))}return _hasPath=Se,_hasPath}var hasIn_1,hasRequiredHasIn;function requireHasIn(){if(hasRequiredHasIn)return hasIn_1;hasRequiredHasIn=1;var ye=require_baseHasIn(),$=require_hasPath();function e(Y,Me){return Y!=null&&$(Y,Me,ye)}return hasIn_1=e,hasIn_1}var _baseMatchesProperty,hasRequired_baseMatchesProperty;function require_baseMatchesProperty(){if(hasRequired_baseMatchesProperty)return _baseMatchesProperty;hasRequired_baseMatchesProperty=1;var ye=require_baseIsEqual(),$=requireGet(),e=requireHasIn(),Y=require_isKey(),Me=require_isStrictComparable(),Ae=require_matchesStrictComparable(),Se=require_toKey(),ve=1,ze=2;function Te(we,De){return Y(we)&&Me(De)?Ae(Se(we),De):function(Ie){var Ce=$(Ie,we);return Ce===void 0&&Ce===De?e(Ie,we):ye(De,Ce,ve|ze)}}return _baseMatchesProperty=Te,_baseMatchesProperty}var _basePropertyDeep,hasRequired_basePropertyDeep;function require_basePropertyDeep(){if(hasRequired_basePropertyDeep)return _basePropertyDeep;hasRequired_basePropertyDeep=1;var ye=require_baseGet();function $(e){return function(Y){return ye(Y,e)}}return _basePropertyDeep=$,_basePropertyDeep}var property_1,hasRequiredProperty;function requireProperty(){if(hasRequiredProperty)return property_1;hasRequiredProperty=1;var ye=require_baseProperty(),$=require_basePropertyDeep(),e=require_isKey(),Y=require_toKey();function Me(Ae){return e(Ae)?ye(Y(Ae)):$(Ae)}return property_1=Me,property_1}var _baseIteratee,hasRequired_baseIteratee;function require_baseIteratee(){if(hasRequired_baseIteratee)return _baseIteratee;hasRequired_baseIteratee=1;var ye=require_baseMatches(),$=require_baseMatchesProperty(),e=requireIdentity(),Y=requireIsArray(),Me=requireProperty();function Ae(Se){return typeof Se=="function"?Se:Se==null?e:typeof Se=="object"?Y(Se)?$(Se[0],Se[1]):ye(Se):Me(Se)}return _baseIteratee=Ae,_baseIteratee}var _createBaseEach,hasRequired_createBaseEach;function require_createBaseEach(){if(hasRequired_createBaseEach)return _createBaseEach;hasRequired_createBaseEach=1;var ye=requireIsArrayLike();function $(e,Y){return function(Me,Ae){if(Me==null)return Me;if(!ye(Me))return e(Me,Ae);for(var Se=Me.length,ve=Y?Se:-1,ze=Object(Me);(Y?ve--:++ve<Se)&&Ae(ze[ve],ve,ze)!==!1;);return Me}}return _createBaseEach=$,_createBaseEach}var _baseEach,hasRequired_baseEach;function require_baseEach(){if(hasRequired_baseEach)return _baseEach;hasRequired_baseEach=1;var ye=require_baseForOwn(),$=require_createBaseEach(),e=$(ye);return _baseEach=e,_baseEach}var _baseMap,hasRequired_baseMap;function require_baseMap(){if(hasRequired_baseMap)return _baseMap;hasRequired_baseMap=1;var ye=require_baseEach(),$=requireIsArrayLike();function e(Y,Me){var Ae=-1,Se=$(Y)?Array(Y.length):[];return ye(Y,function(ve,ze,Te){Se[++Ae]=Me(ve,ze,Te)}),Se}return _baseMap=e,_baseMap}var map_1,hasRequiredMap;function requireMap(){if(hasRequiredMap)return map_1;hasRequiredMap=1;var ye=require_arrayMap(),$=require_baseIteratee(),e=require_baseMap(),Y=requireIsArray();function Me(Ae,Se){var ve=Y(Ae)?ye:e;return ve(Ae,$(Se,3))}return map_1=Me,map_1}var hasRequiredFlattenNames;function requireFlattenNames(){if(hasRequiredFlattenNames)return flattenNames;hasRequiredFlattenNames=1,Object.defineProperty(flattenNames,"__esModule",{value:!0}),flattenNames.flattenNames=void 0;var ye=requireIsString(),$=ze(ye),e=requireForOwn(),Y=ze(e),Me=requireIsPlainObject(),Ae=ze(Me),Se=requireMap(),ve=ze(Se);function ze(we){return we&&we.__esModule?we:{default:we}}var Te=flattenNames.flattenNames=function we(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ie=[];return(0,ve.default)(De,function(Ce){Array.isArray(Ce)?we(Ce).map(function(Ne){return Ie.push(Ne)}):(0,Ae.default)(Ce)?(0,Y.default)(Ce,function(Ne,qe){Ne===!0&&Ie.push(qe),Ie.push(qe+"-"+Ne)}):(0,$.default)(Ce)&&Ie.push(Ce)}),Ie};return flattenNames.default=Te,flattenNames}var mergeClasses={},hasRequiredMergeClasses;function requireMergeClasses(){if(hasRequiredMergeClasses)return mergeClasses;hasRequiredMergeClasses=1,Object.defineProperty(mergeClasses,"__esModule",{value:!0}),mergeClasses.mergeClasses=void 0;var ye=requireForOwn(),$=Ae(ye),e=requireCloneDeep(),Y=Ae(e),Me=Object.assign||function(ve){for(var ze=1;ze<arguments.length;ze++){var Te=arguments[ze];for(var we in Te)Object.prototype.hasOwnProperty.call(Te,we)&&(ve[we]=Te[we])}return ve};function Ae(ve){return ve&&ve.__esModule?ve:{default:ve}}var Se=mergeClasses.mergeClasses=function(ze){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],we=ze.default&&(0,Y.default)(ze.default)||{};return Te.map(function(De){var Ie=ze[De];return Ie&&(0,$.default)(Ie,function(Ce,Ne){we[Ne]||(we[Ne]={}),we[Ne]=Me({},we[Ne],Ie[Ne])}),De}),we};return mergeClasses.default=Se,mergeClasses}var autoprefix={},hasRequiredAutoprefix;function requireAutoprefix(){if(hasRequiredAutoprefix)return autoprefix;hasRequiredAutoprefix=1,Object.defineProperty(autoprefix,"__esModule",{value:!0}),autoprefix.autoprefix=void 0;var ye=requireForOwn(),$=Y(ye),e=Object.assign||function(Se){for(var ve=1;ve<arguments.length;ve++){var ze=arguments[ve];for(var Te in ze)Object.prototype.hasOwnProperty.call(ze,Te)&&(Se[Te]=ze[Te])}return Se};function Y(Se){return Se&&Se.__esModule?Se:{default:Se}}var Me={borderRadius:function(ve){return{msBorderRadius:ve,MozBorderRadius:ve,OBorderRadius:ve,WebkitBorderRadius:ve,borderRadius:ve}},boxShadow:function(ve){return{msBoxShadow:ve,MozBoxShadow:ve,OBoxShadow:ve,WebkitBoxShadow:ve,boxShadow:ve}},userSelect:function(ve){return{WebkitTouchCallout:ve,KhtmlUserSelect:ve,MozUserSelect:ve,msUserSelect:ve,WebkitUserSelect:ve,userSelect:ve}},flex:function(ve){return{WebkitBoxFlex:ve,MozBoxFlex:ve,WebkitFlex:ve,msFlex:ve,flex:ve}},flexBasis:function(ve){return{WebkitFlexBasis:ve,flexBasis:ve}},justifyContent:function(ve){return{WebkitJustifyContent:ve,justifyContent:ve}},transition:function(ve){return{msTransition:ve,MozTransition:ve,OTransition:ve,WebkitTransition:ve,transition:ve}},transform:function(ve){return{msTransform:ve,MozTransform:ve,OTransform:ve,WebkitTransform:ve,transform:ve}},absolute:function(ve){var ze=ve&&ve.split(" ");return{position:"absolute",top:ze&&ze[0],right:ze&&ze[1],bottom:ze&&ze[2],left:ze&&ze[3]}},extend:function(ve,ze){var Te=ze[ve];return Te||{extend:ve}}},Ae=autoprefix.autoprefix=function(ve){var ze={};return(0,$.default)(ve,function(Te,we){var De={};(0,$.default)(Te,function(Ie,Ce){var Ne=Me[Ce];Ne?De=e({},De,Ne(Ie)):De[Ce]=Ie}),ze[we]=De}),ze};return autoprefix.default=Ae,autoprefix}var hover={},hasRequiredHover;function requireHover(){if(hasRequiredHover)return hover;hasRequiredHover=1,Object.defineProperty(hover,"__esModule",{value:!0}),hover.hover=void 0;var ye=Object.assign||function(ze){for(var Te=1;Te<arguments.length;Te++){var we=arguments[Te];for(var De in we)Object.prototype.hasOwnProperty.call(we,De)&&(ze[De]=we[De])}return ze},$=requireReact(),e=Y($);function Y(ze){return ze&&ze.__esModule?ze:{default:ze}}function Me(ze,Te){if(!(ze instanceof Te))throw new TypeError("Cannot call a class as a function")}function Ae(ze,Te){if(!ze)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Te&&(typeof Te=="object"||typeof Te=="function")?Te:ze}function Se(ze,Te){if(typeof Te!="function"&&Te!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Te);ze.prototype=Object.create(Te&&Te.prototype,{constructor:{value:ze,enumerable:!1,writable:!0,configurable:!0}}),Te&&(Object.setPrototypeOf?Object.setPrototypeOf(ze,Te):ze.__proto__=Te)}var ve=hover.hover=function(Te){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(De){Se(Ie,De);function Ie(){var Ce,Ne,qe,Le;Me(this,Ie);for(var Fe=arguments.length,We=Array(Fe),je=0;je<Fe;je++)We[je]=arguments[je];return Le=(Ne=(qe=Ae(this,(Ce=Ie.__proto__||Object.getPrototypeOf(Ie)).call.apply(Ce,[this].concat(We))),qe),qe.state={hover:!1},qe.handleMouseOver=function(){return qe.setState({hover:!0})},qe.handleMouseOut=function(){return qe.setState({hover:!1})},qe.render=function(){return e.default.createElement(we,{onMouseOver:qe.handleMouseOver,onMouseOut:qe.handleMouseOut},e.default.createElement(Te,ye({},qe.props,qe.state)))},Ne),Ae(qe,Le)}return Ie}(e.default.Component)};return hover.default=ve,hover}var active={},hasRequiredActive;function requireActive(){if(hasRequiredActive)return active;hasRequiredActive=1,Object.defineProperty(active,"__esModule",{value:!0}),active.active=void 0;var ye=Object.assign||function(ze){for(var Te=1;Te<arguments.length;Te++){var we=arguments[Te];for(var De in we)Object.prototype.hasOwnProperty.call(we,De)&&(ze[De]=we[De])}return ze},$=requireReact(),e=Y($);function Y(ze){return ze&&ze.__esModule?ze:{default:ze}}function Me(ze,Te){if(!(ze instanceof Te))throw new TypeError("Cannot call a class as a function")}function Ae(ze,Te){if(!ze)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Te&&(typeof Te=="object"||typeof Te=="function")?Te:ze}function Se(ze,Te){if(typeof Te!="function"&&Te!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Te);ze.prototype=Object.create(Te&&Te.prototype,{constructor:{value:ze,enumerable:!1,writable:!0,configurable:!0}}),Te&&(Object.setPrototypeOf?Object.setPrototypeOf(ze,Te):ze.__proto__=Te)}var ve=active.active=function(Te){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(De){Se(Ie,De);function Ie(){var Ce,Ne,qe,Le;Me(this,Ie);for(var Fe=arguments.length,We=Array(Fe),je=0;je<Fe;je++)We[je]=arguments[je];return Le=(Ne=(qe=Ae(this,(Ce=Ie.__proto__||Object.getPrototypeOf(Ie)).call.apply(Ce,[this].concat(We))),qe),qe.state={active:!1},qe.handleMouseDown=function(){return qe.setState({active:!0})},qe.handleMouseUp=function(){return qe.setState({active:!1})},qe.render=function(){return e.default.createElement(we,{onMouseDown:qe.handleMouseDown,onMouseUp:qe.handleMouseUp},e.default.createElement(Te,ye({},qe.props,qe.state)))},Ne),Ae(qe,Le)}return Ie}(e.default.Component)};return active.default=ve,active}var loop={},hasRequiredLoop;function requireLoop(){if(hasRequiredLoop)return loop;hasRequiredLoop=1,Object.defineProperty(loop,"__esModule",{value:!0});var ye=function(e,Y){var Me={},Ae=function(ve){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Me[ve]=ze};return e===0&&Ae("first-child"),e===Y-1&&Ae("last-child"),(e===0||e%2===0)&&Ae("even"),Math.abs(e%2)===1&&Ae("odd"),Ae("nth-child",e),Me};return loop.default=ye,loop}var hasRequiredLib$2;function requireLib$2(){if(hasRequiredLib$2)return lib$2;hasRequiredLib$2=1,Object.defineProperty(lib$2,"__esModule",{value:!0}),lib$2.ReactCSS=lib$2.loop=lib$2.handleActive=lib$2.handleHover=lib$2.hover=void 0;var ye=requireFlattenNames(),$=Ie(ye),e=requireMergeClasses(),Y=Ie(e),Me=requireAutoprefix(),Ae=Ie(Me),Se=requireHover(),ve=Ie(Se),ze=requireActive(),Te=Ie(ze),we=requireLoop(),De=Ie(we);function Ie(Ne){return Ne&&Ne.__esModule?Ne:{default:Ne}}lib$2.hover=ve.default,lib$2.handleHover=ve.default,lib$2.handleActive=Te.default,lib$2.loop=De.default;var Ce=lib$2.ReactCSS=function(qe){for(var Le=arguments.length,Fe=Array(Le>1?Le-1:0),We=1;We<Le;We++)Fe[We-1]=arguments[We];var je=(0,$.default)(Fe),Ue=(0,Y.default)(qe,je);return(0,Ae.default)(Ue)};return lib$2.default=Ce,lib$2}var libExports$1=requireLib$2();const reactCSS=getDefaultExportFromCjs$1(libExports$1);var calculateChange$2=function ye($,e,Y,Me,Ae){var Se=Ae.clientWidth,ve=Ae.clientHeight,ze=typeof $.pageX=="number"?$.pageX:$.touches[0].pageX,Te=typeof $.pageY=="number"?$.pageY:$.touches[0].pageY,we=ze-(Ae.getBoundingClientRect().left+window.pageXOffset),De=Te-(Ae.getBoundingClientRect().top+window.pageYOffset);if(Y==="vertical"){var Ie=void 0;if(De<0?Ie=0:De>ve?Ie=1:Ie=Math.round(De*100/ve)/100,e.a!==Ie)return{h:e.h,s:e.s,l:e.l,a:Ie,source:"rgb"}}else{var Ce=void 0;if(we<0?Ce=0:we>Se?Ce=1:Ce=Math.round(we*100/Se)/100,Me!==Ce)return{h:e.h,s:e.s,l:e.l,a:Ce,source:"rgb"}}return null},checkboardCache={},render=function ye($,e,Y,Me){if(typeof document>"u"&&!Me)return null;var Ae=Me?new Me:document.createElement("canvas");Ae.width=Y*2,Ae.height=Y*2;var Se=Ae.getContext("2d");return Se?(Se.fillStyle=$,Se.fillRect(0,0,Ae.width,Ae.height),Se.fillStyle=e,Se.fillRect(0,0,Y,Y),Se.translate(Y,Y),Se.fillRect(0,0,Y,Y),Ae.toDataURL()):null},get$1=function ye($,e,Y,Me){var Ae=$+"-"+e+"-"+Y+(Me?"-server":"");if(checkboardCache[Ae])return checkboardCache[Ae];var Se=render($,e,Y,Me);return checkboardCache[Ae]=Se,Se},_extends$p=Object.assign||function(ye){for(var $=1;$<arguments.length;$++){var e=arguments[$];for(var Y in e)Object.prototype.hasOwnProperty.call(e,Y)&&(ye[Y]=e[Y])}return ye},Checkboard=function ye($){var e=$.white,Y=$.grey,Me=$.size,Ae=$.renderers,Se=$.borderRadius,ve=$.boxShadow,ze=$.children,Te=reactCSS({default:{grid:{borderRadius:Se,boxShadow:ve,absolute:"0px 0px 0px 0px",background:"url("+get$1(e,Y,Me,Ae.canvas)+") center left"}}});return reactExports.isValidElement(ze)?React.cloneElement(ze,_extends$p({},ze.props,{style:_extends$p({},ze.props.style,Te.grid)})):React.createElement("div",{style:Te.grid})};Checkboard.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var _extends$o=Object.assign||function(ye){for(var $=1;$<arguments.length;$++){var e=arguments[$];for(var Y in e)Object.prototype.hasOwnProperty.call(e,Y)&&(ye[Y]=e[Y])}return ye},_createClass$c=function(){function ye($,e){for(var Y=0;Y<e.length;Y++){var Me=e[Y];Me.enumerable=Me.enumerable||!1,Me.configurable=!0,"value"in Me&&(Me.writable=!0),Object.defineProperty($,Me.key,Me)}}return function($,e,Y){return e&&ye($.prototype,e),Y&&ye($,Y),$}}();function _classCallCheck$c(ye,$){if(!(ye instanceof $))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$c(ye,$){if(!ye)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:ye}function _inherits$c(ye,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);ye.prototype=Object.create($&&$.prototype,{constructor:{value:ye,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(ye,$):ye.__proto__=$)}var Alpha=function(ye){_inherits$c($,ye);function $(){var e,Y,Me,Ae;_classCallCheck$c(this,$);for(var Se=arguments.length,ve=Array(Se),ze=0;ze<Se;ze++)ve[ze]=arguments[ze];return Ae=(Y=(Me=_possibleConstructorReturn$c(this,(e=$.__proto__||Object.getPrototypeOf($)).call.apply(e,[this].concat(ve))),Me),Me.handleChange=function(Te){var we=calculateChange$2(Te,Me.props.hsl,Me.props.direction,Me.props.a,Me.container);we&&typeof Me.props.onChange=="function"&&Me.props.onChange(we,Te)},Me.handleMouseDown=function(Te){Me.handleChange(Te),window.addEventListener("mousemove",Me.handleChange),window.addEventListener("mouseup",Me.handleMouseUp)},Me.handleMouseUp=function(){Me.unbindEventListeners()},Me.unbindEventListeners=function(){window.removeEventListener("mousemove",Me.handleChange),window.removeEventListener("mouseup",Me.handleMouseUp)},Y),_possibleConstructorReturn$c(Me,Ae)}return _createClass$c($,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var Y=this,Me=this.props.rgb,Ae=reactCSS({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+Me.r+","+Me.g+","+Me.b+`, 0) 0%,
695
695
  rgba(`+Me.r+","+Me.g+","+Me.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:Me.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+Me.r+","+Me.g+","+Me.b+`, 0) 0%,
696
696
  rgba(`+Me.r+","+Me.g+","+Me.b+", 1) 100%)"},pointer:{left:0,top:Me.a*100+"%"}},overwrite:_extends$o({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return React.createElement("div",{style:Ae.alpha},React.createElement("div",{style:Ae.checkboard},React.createElement(Checkboard,{renderers:this.props.renderers})),React.createElement("div",{style:Ae.gradient}),React.createElement("div",{style:Ae.container,ref:function(ve){return Y.container=ve},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React.createElement("div",{style:Ae.pointer},this.props.pointer?React.createElement(this.props.pointer,this.props):React.createElement("div",{style:Ae.slider}))))}}]),$}(reactExports.PureComponent||reactExports.Component),_createClass$b=function(){function ye($,e){for(var Y=0;Y<e.length;Y++){var Me=e[Y];Me.enumerable=Me.enumerable||!1,Me.configurable=!0,"value"in Me&&(Me.writable=!0),Object.defineProperty($,Me.key,Me)}}return function($,e,Y){return e&&ye($.prototype,e),Y&&ye($,Y),$}}();function _defineProperty$c(ye,$,e){return $ in ye?Object.defineProperty(ye,$,{value:e,enumerable:!0,configurable:!0,writable:!0}):ye[$]=e,ye}function _classCallCheck$b(ye,$){if(!(ye instanceof $))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$b(ye,$){if(!ye)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:ye}function _inherits$b(ye,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);ye.prototype=Object.create($&&$.prototype,{constructor:{value:ye,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(ye,$):ye.__proto__=$)}var DEFAULT_ARROW_OFFSET=1,UP_KEY_CODE=38,DOWN_KEY_CODE=40,VALID_KEY_CODES=[UP_KEY_CODE,DOWN_KEY_CODE],isValidKeyCode=function ye($){return VALID_KEY_CODES.indexOf($)>-1},getNumberValue=function ye($){return Number(String($).replace(/%/g,""))},idCounter=1,EditableInput=function(ye){_inherits$b($,ye);function $(e){_classCallCheck$b(this,$);var Y=_possibleConstructorReturn$b(this,($.__proto__||Object.getPrototypeOf($)).call(this));return Y.handleBlur=function(){Y.state.blurValue&&Y.setState({value:Y.state.blurValue,blurValue:null})},Y.handleChange=function(Me){Y.setUpdatedValue(Me.target.value,Me)},Y.handleKeyDown=function(Me){var Ae=getNumberValue(Me.target.value);if(!isNaN(Ae)&&isValidKeyCode(Me.keyCode)){var Se=Y.getArrowOffset(),ve=Me.keyCode===UP_KEY_CODE?Ae+Se:Ae-Se;Y.setUpdatedValue(ve,Me)}},Y.handleDrag=function(Me){if(Y.props.dragLabel){var Ae=Math.round(Y.props.value+Me.movementX);Ae>=0&&Ae<=Y.props.dragMax&&Y.props.onChange&&Y.props.onChange(Y.getValueObjectWithLabel(Ae),Me)}},Y.handleMouseDown=function(Me){Y.props.dragLabel&&(Me.preventDefault(),Y.handleDrag(Me),window.addEventListener("mousemove",Y.handleDrag),window.addEventListener("mouseup",Y.handleMouseUp))},Y.handleMouseUp=function(){Y.unbindEventListeners()},Y.unbindEventListeners=function(){window.removeEventListener("mousemove",Y.handleDrag),window.removeEventListener("mouseup",Y.handleMouseUp)},Y.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},Y.inputId="rc-editable-input-"+idCounter++,Y}return _createClass$b($,[{key:"componentDidUpdate",value:function(Y,Me){this.props.value!==this.state.value&&(Y.value!==this.props.value||Me.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(Y){return _defineProperty$c({},this.props.label,Y)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||DEFAULT_ARROW_OFFSET}},{key:"setUpdatedValue",value:function(Y,Me){var Ae=this.props.label?this.getValueObjectWithLabel(Y):Y;this.props.onChange&&this.props.onChange(Ae,Me),this.setState({value:Y})}},{key:"render",value:function(){var Y=this,Me=reactCSS({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return React.createElement("div",{style:Me.wrap},React.createElement("input",{id:this.inputId,style:Me.input,ref:function(Se){return Y.input=Se},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?React.createElement("label",{htmlFor:this.inputId,style:Me.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),$}(reactExports.PureComponent||reactExports.Component),calculateChange$1=function ye($,e,Y,Me){var Ae=Me.clientWidth,Se=Me.clientHeight,ve=typeof $.pageX=="number"?$.pageX:$.touches[0].pageX,ze=typeof $.pageY=="number"?$.pageY:$.touches[0].pageY,Te=ve-(Me.getBoundingClientRect().left+window.pageXOffset),we=ze-(Me.getBoundingClientRect().top+window.pageYOffset);if(e==="vertical"){var De=void 0;if(we<0)De=359;else if(we>Se)De=0;else{var Ie=-(we*100/Se)+100;De=360*Ie/100}if(Y.h!==De)return{h:De,s:Y.s,l:Y.l,a:Y.a,source:"hsl"}}else{var Ce=void 0;if(Te<0)Ce=0;else if(Te>Ae)Ce=359;else{var Ne=Te*100/Ae;Ce=360*Ne/100}if(Y.h!==Ce)return{h:Ce,s:Y.s,l:Y.l,a:Y.a,source:"hsl"}}return null},_createClass$a=function(){function ye($,e){for(var Y=0;Y<e.length;Y++){var Me=e[Y];Me.enumerable=Me.enumerable||!1,Me.configurable=!0,"value"in Me&&(Me.writable=!0),Object.defineProperty($,Me.key,Me)}}return function($,e,Y){return e&&ye($.prototype,e),Y&&ye($,Y),$}}();function _classCallCheck$a(ye,$){if(!(ye instanceof $))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$a(ye,$){if(!ye)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:ye}function _inherits$a(ye,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);ye.prototype=Object.create($&&$.prototype,{constructor:{value:ye,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(ye,$):ye.__proto__=$)}var Hue=function(ye){_inherits$a($,ye);function $(){var e,Y,Me,Ae;_classCallCheck$a(this,$);for(var Se=arguments.length,ve=Array(Se),ze=0;ze<Se;ze++)ve[ze]=arguments[ze];return Ae=(Y=(Me=_possibleConstructorReturn$a(this,(e=$.__proto__||Object.getPrototypeOf($)).call.apply(e,[this].concat(ve))),Me),Me.handleChange=function(Te){var we=calculateChange$1(Te,Me.props.direction,Me.props.hsl,Me.container);we&&typeof Me.props.onChange=="function"&&Me.props.onChange(we,Te)},Me.handleMouseDown=function(Te){Me.handleChange(Te),window.addEventListener("mousemove",Me.handleChange),window.addEventListener("mouseup",Me.handleMouseUp)},Me.handleMouseUp=function(){Me.unbindEventListeners()},Y),_possibleConstructorReturn$a(Me,Ae)}return _createClass$a($,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var Y=this,Me=this.props.direction,Ae=Me===void 0?"horizontal":Me,Se=reactCSS({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:Ae==="vertical"});return React.createElement("div",{style:Se.hue},React.createElement("div",{className:"hue-"+Ae,style:Se.container,ref:function(ze){return Y.container=ze},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React.createElement("style",null,`
697
697
  .hue-horizontal {
@@ -808,4 +808,4 @@ The app's main file \`${ye}\` has
808
808
  not been pushed to GitHub. Please add it to continue.
809
809
  `,allowHTML:!1})}}const StyledParagraph=newStyled("p",{target:"edgwnvj0"})({textAlign:"justify"});function NoRepositoryDetected(){return{title:"Unable to deploy",body:jsxs(StyledParagraph,{children:["The app’s code is not connected to a remote GitHub repository. To deploy on Streamlit Community Cloud, please put your code in a GitHub repository and publish the current branch. Read more in"," ",jsx$1("a",{href:STREAMLIT_COMMUNITY_CLOUD_DOCS_URL,rel:"noopener noreferrer",target:"_blank",children:"our documentation"}),"."]})}}function ModalBody({children:ye}){const{colors:$,fontSizes:e,spacing:Y}=useTheme();return jsx$1(ModalBody$2,{style:{marginTop:Y.none,marginLeft:Y.none,marginRight:Y.none,marginBottom:Y.none,paddingTop:Y.md,paddingRight:Y.none,paddingBottom:Y.none,paddingLeft:Y.none,color:$.bodyText,fontSize:e.md,overflowY:"auto"},children:ye})}function DeployModal(ye){const{children:$,onClose:e}=ye;return jsxs(Modal,{isOpen:!0,closeable:!0,onClose:e,size:"auto",children:[jsx$1(ModalHeader,{children:"Deploy this app using..."}),jsx$1(ModalBody,{children:$})]})}function DeployCard(ye){const{colors:$,spacing:e,radii:Y,breakpoints:Me,sizes:Ae}=useTheme(),{children:Se}=ye;return jsx$1(Card,{overrides:{Root:{style:{borderTopWidth:Ae.borderWidth,borderBottomWidth:Ae.borderWidth,borderLeftWidth:Ae.borderWidth,borderRightWidth:Ae.borderWidth,borderTopStyle:"solid",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"solid",borderTopColor:$.borderColor,borderBottomColor:$.borderColor,borderLeftColor:$.borderColor,borderRightColor:$.borderColor,borderTopLeftRadius:"none",borderTopRightRadius:"none",borderBottomLeftRadius:"none",borderBottomRightRadius:"none",":last-child":{borderRightStyle:"none",borderBottomRightRadius:Y.xl},":first-child":{borderBottomLeftRadius:Y.xl},[`@media (max-width: ${Me.md})`]:{":last-child":{borderBottomLeftRadius:Y.xl}}}},Contents:{style:{marginBottom:0,marginTop:0,marginLeft:0,marginRight:0,height:"100%"}},Body:{style:{padding:e.twoXL,marginBottom:0,marginTop:0,marginLeft:0,marginRight:0,height:"100%",display:"flex",flexDirection:"column",[`@media (max-width: ${Me.md})`]:{padding:e.xl}}}},children:Se})}const Checkmark="data:image/svg+xml,%3csvg%20width='12'%20height='9'%20viewBox='0%200%2012%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.00009%206.78L1.68676%204.46667C1.42676%204.20667%201.00676%204.20667%200.746758%204.46667C0.486758%204.72667%200.486758%205.14667%200.746758%205.40667L3.53342%208.19334C3.79342%208.45334%204.21342%208.45334%204.47342%208.19334L11.5268%201.14C11.7868%200.880005%2011.7868%200.460005%2011.5268%200.200005C11.2668%20-0.0599951%2010.8468%20-0.0599951%2010.5868%200.200005L4.00009%206.78Z'%20fill='%23808495'/%3e%3c/svg%3e",StyledHeader=newStyled("div",{target:"edlp5wu0"})(({theme:ye})=>({fontFamily:ye.fonts.sansSerif,fontWeight:ye.fontWeights.bold,fontSize:ye.fontSizes.lg,color:ye.colors.grey90,marginTop:ye.spacing.twoXL,marginBottom:ye.spacing.twoXS,[`@media (max-width: ${ye.breakpoints.md})`]:{marginTop:ye.spacing.md}})),StyledSubheader=newStyled("div",{target:"edlp5wu1"})(({theme:ye})=>({fontFamily:ye.fonts.sansSerif,fontWeight:ye.fontWeights.normal,fontSize:ye.fontSizes.md,color:ye.colors.grey90,marginTop:ye.spacing.twoXS,marginBottom:ye.spacing.md,[`@media (max-width: ${ye.breakpoints.md})`]:{marginTop:ye.spacing.md}})),StyledCardContainer=newStyled("div",{target:"edlp5wu2"})(({theme:ye})=>({display:"grid",maxWidth:`calc(1.25 * ${ye.sizes.contentMaxWidth})`,gridTemplateColumns:"1fr 1fr 1fr",gridGap:ye.spacing.none,[`@media (max-width: ${ye.breakpoints.md})`]:{gridTemplateColumns:"1fr"}})),StyledElement=newStyled("div",{target:"edlp5wu3"})(({theme:ye})=>({display:"inline-flex",marginTop:ye.spacing.sm,"& > span":{fontFamily:ye.fonts.sansSerif,fontWeight:ye.fontWeights.normal,fontSize:ye.fontSizes.md,marginLeft:ye.spacing.twoXL,color:ye.colors.gray70},"& > img":{position:"absolute",marginTop:ye.spacing.sm}})),StyledActionsWrapper=newStyled("div",{target:"edlp5wu4"})(({theme:ye})=>({display:"flex",marginTop:ye.spacing.threeXL,"& > button":{marginRight:ye.spacing.twoXL},[`@media (max-width: ${ye.breakpoints.md})`]:{marginTop:ye.spacing.xl}}));function DeployListElement(ye){const{children:$}=ye;return jsxs(StyledElement,{children:[jsx$1("img",{src:Checkmark,alt:"Checkmark"}),jsx$1("span",{children:$})]})}const{GitStates}=GitInfo,openUrl=ye=>{window.open(ye,"_blank")},getDeployAppUrl=ye=>{if(ye){const $=new URL(DEPLOY_URL);return $.searchParams.set("repository",ye.repository??""),$.searchParams.set("branch",ye.branch??""),$.searchParams.set("mainModule",ye.module??""),$.toString()}return STREAMLIT_CLOUD_URL};function DeployDialog(ye){const{gitInfo:$}=reactExports.useContext(AppContext),{onClose:e,metricsMgr:Y}=ye,Me=reactExports.useCallback(()=>{const{showDeployError:Ae,isDeployErrorModalOpen:Se,metricsMgr:ve}=ye;if(ve.enqueue("menuClick",{label:"deployButtonInDialog"}),!$){const Ne=NoRepositoryDetected();Ae(Ne.title,Ne.body);return}const{repository:ze,branch:Te,module:we,untrackedFiles:De,state:Ie}=$;if((!ze||!Te||!we)&&Ie===GitStates.DEFAULT){const Ne=NoRepositoryDetected();Ae(Ne.title,Ne.body);return}if(Ie===GitStates.HEAD_DETACHED){const Ne=DetachedHead();Ae(Ne.title,Ne.body);return}if(we&&(De!=null&&De.includes(we))){const Ne=ModuleIsNotAdded(we);Ae(Ne.title,Ne.body);return}Se&&e(),openUrl(getDeployAppUrl($))},[ye,e,$]);return jsx$1(DeployModal,{onClose:e,children:jsxs(StyledCardContainer,{children:[jsxs(DeployCard,{children:[jsxs(Body,{style:{flexGrow:1},children:[jsx$1("img",{src:StreamlitLogo,alt:"Streamlit Logo","data-testid":"stDeployDialogCommunityCloudIcon"}),jsx$1(StyledHeader,{children:"Streamlit Community Cloud"}),jsx$1(StyledSubheader,{children:"For community, always free"}),jsx$1(DeployListElement,{children:"For personal hobbies and learning"}),jsx$1(DeployListElement,{children:"Deploy unlimited public apps"}),jsx$1(DeployListElement,{children:"Explore and learn from Streamlit’s community and popular apps"})]}),jsx$1(Action,{children:jsxs(StyledActionsWrapper,{children:[jsx$1(BaseButton,{kind:BaseButtonKind.PRIMARY,onClick:Me,children:"Deploy now"}),jsx$1(BaseButton,{onClick:()=>{Y.enqueue("menuClick",{label:"readMoreCommunityCloudInDeployDialog"}),openUrl(STREAMLIT_COMMUNITY_CLOUD_DOCS_URL)},kind:BaseButtonKind.MINIMAL,children:"Learn more"})]})})]}),jsxs(DeployCard,{children:[jsxs(Body,{style:{flexGrow:1},children:[jsx$1("img",{src:Snowflake,alt:"Snowflake","data-testid":"stDeployDialogSnowflakeDeploymentIcon"}),jsx$1(StyledHeader,{children:"Snowflake"}),jsx$1(StyledSubheader,{children:"For enterprise"}),jsx$1(DeployListElement,{children:"Enterprise-level security, support, and fully managed infrastructure"}),jsx$1(DeployListElement,{children:"Deploy unlimited private apps with role-based sharing"}),jsx$1(DeployListElement,{children:"Integrate with Snowflake’s full data stack"})]}),jsx$1(Action,{children:jsxs(StyledActionsWrapper,{children:[jsx$1(BaseButton,{kind:BaseButtonKind.SECONDARY,onClick:()=>{Y.enqueue("menuClick",{label:"startTrialInDeployDialog"}),openUrl(SNOWFLAKE_TRIAL_URL)},children:"Start trial"}),jsx$1(BaseButton,{onClick:()=>{Y.enqueue("menuClick",{label:"learnMoreSnowflakeInDeployDialog"}),openUrl(SNOWFLAKE_LEARN_MORE_URL)},kind:BaseButtonKind.MINIMAL,children:"Learn more"})]})})]}),jsxs(DeployCard,{children:[jsxs(Body,{style:{flexGrow:2},children:[jsx$1("img",{src:Rocket,alt:"Rocket","data-testid":"stDeployDialogCustomDeploymentIcon"}),jsx$1(StyledHeader,{children:"Other platforms"}),jsx$1(StyledSubheader,{children:"For custom deployment "}),jsx$1(DeployListElement,{children:"Deploy on your own hardware or cloud service"}),jsx$1(DeployListElement,{children:"Set up and maintain your own authentication, resources, and costs"})]}),jsx$1(Action,{children:jsx$1(StyledActionsWrapper,{children:jsx$1(BaseButton,{onClick:()=>{Y.enqueue("menuClick",{label:"readMoreDeployTutorialInDeployDialog"}),openUrl(STREAMLIT_DEPLOY_TUTORIAL_URL)},kind:BaseButtonKind.MINIMAL,children:"Learn more"})})})]})]})})}function StreamlitDialog(ye){switch(ye.type){case DialogType.ABOUT:return aboutDialog(ye);case DialogType.CLEAR_CACHE:return clearCacheDialog(ye);case DialogType.SETTINGS:return settingsDialog(ye);case DialogType.SCRIPT_COMPILE_ERROR:return scriptCompileErrorDialog(ye);case DialogType.THEME_CREATOR:return jsx$1(ThemeCreatorDialog,{...ye});case DialogType.WARNING:return warningDialog(ye);case DialogType.DEPLOY_DIALOG:return jsx$1(DeployDialog,{...ye});case DialogType.DEPLOY_ERROR:return deployErrorDialog(ye);case void 0:return noDialog(ye);default:return typeNotRecognizedDialog(ye)}}function aboutDialog(ye){if(ye.aboutSectionMd){const $={overflowY:"auto",overflowX:"hidden",maxHeight:"35vh"},e=`
810
810
  `,Y=[`Made with Streamlit v${ye.sessionInfo.current.streamlitVersion}`,STREAMLIT_HOME_URL,`Copyright ${new Date().getFullYear()} Snowflake Inc. All rights reserved.`].join(e),Me=`${ye.aboutSectionMd} ${e} ${e} ${Y}`;return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:"About"}),jsx$1(ModalBody$1,{children:jsx$1(StyledAboutInfo,{children:jsx$1(StreamlitMarkdown$1,{source:Me,allowHTML:!1,style:$})})})]})}return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:"Made with"}),jsx$1(ModalBody$1,{children:jsxs("div",{children:[ye.sessionInfo.isSet&&jsxs(Fragment,{children:["Streamlit v",ye.sessionInfo.current.streamlitVersion,jsx$1("br",{})]}),jsx$1(StyledAboutLink,{href:STREAMLIT_HOME_URL,children:STREAMLIT_HOME_URL}),jsx$1("br",{}),"Copyright ",new Date().getFullYear()," Snowflake Inc. All rights reserved."]})})]})}function clearCacheDialog(ye){const e=["**Are you sure you want to clear the app's function caches?**","This will remove all cached entries from functions using","`@st.cache_data` and `@st.cache_resource`."].join(`
811
- `);return jsx$1("div",{"data-testid":"stClearCacheDialog",children:jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:"Clear caches"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitMarkdown$1,{source:e,allowHTML:!1})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:ye.onClose,children:"Cancel"}),jsx$1(ModalButton,{autoFocus:!0,kind:BaseButtonKind.SECONDARY,onClick:ye.confirmCallback,children:"Clear caches"})]})]})})}function scriptCompileErrorDialog(ye){var $;return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,size:"auto",autoFocus:!1,children:[jsx$1(ModalHeader,{children:"Script execution error"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitSyntaxHighlighter$1,{showLineNumbers:!1,wrapLines:!1,children:($=ye.exception)!=null&&$.message?ye.exception.message:"No message"})}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:ye.onClose,children:"Close"})})]})}function settingsDialog(ye){return jsx$1(SettingsDialog,{...ye})}function warningDialog(ye){return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:ye.title}),jsx$1(ModalBody$1,{children:ye.msg})]})}function deployErrorDialog({title:ye,msg:$,onClose:e,onContinue:Y,onTryAgain:Me}){const Ae=()=>{e(),Y&&Y()};return jsxs(Modal,{isOpen:!0,onClose:e,children:[jsx$1(ModalHeader,{children:ye}),jsx$1(ModalBody$1,{children:jsx$1(StyledDeployErrorContent,{children:$})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:Me,children:"Try again"}),jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:Ae,children:Y?"Continue anyway":"Close"})]})]})}function noDialog({onClose:ye}){return jsx$1(Modal,{isOpen:!1,onClose:ye})}function typeNotRecognizedDialog(ye){return jsx$1(Modal,{isOpen:!0,onClose:ye.onClose,children:jsx$1(ModalBody$1,{children:`Dialog type "${ye.type}" not recognized.`})})}class SessionEventDispatcher{constructor(){this.onSessionEvent=new distExports.Signal}handleSessionEventMsg($){this.onSessionEvent.emit($)}}var _baseSet,hasRequired_baseSet;function require_baseSet(){if(hasRequired_baseSet)return _baseSet;hasRequired_baseSet=1;var ye=require_assignValue(),$=require_castPath(),e=require_isIndex(),Y=requireIsObject(),Me=require_toKey();function Ae(Se,ve,ze,Te){if(!Y(Se))return Se;ve=$(ve,Se);for(var we=-1,De=ve.length,Ie=De-1,Ce=Se;Ce!=null&&++we<De;){var Ne=Me(ve[we]),qe=ze;if(Ne==="__proto__"||Ne==="constructor"||Ne==="prototype")return Se;if(we!=Ie){var Le=Ce[Ne];qe=Te?Te(Le,Ne,Ce):void 0,qe===void 0&&(qe=Y(Le)?Le:e(ve[we+1])?[]:{})}ye(Ce,Ne,qe),Ce=Ce[Ne]}return Se}return _baseSet=Ae,_baseSet}var _basePickBy,hasRequired_basePickBy;function require_basePickBy(){if(hasRequired_basePickBy)return _basePickBy;hasRequired_basePickBy=1;var ye=require_baseGet(),$=require_baseSet(),e=require_castPath();function Y(Me,Ae,Se){for(var ve=-1,ze=Ae.length,Te={};++ve<ze;){var we=Ae[ve],De=ye(Me,we);Se(De,we)&&$(Te,e(we,Me),De)}return Te}return _basePickBy=Y,_basePickBy}var _basePick,hasRequired_basePick;function require_basePick(){if(hasRequired_basePick)return _basePick;hasRequired_basePick=1;var ye=require_basePickBy(),$=requireHasIn();function e(Y,Me){return ye(Y,Me,function(Ae,Se){return $(Y,Se)})}return _basePick=e,_basePick}var pick_1,hasRequiredPick;function requirePick(){if(hasRequiredPick)return pick_1;hasRequiredPick=1;var ye=require_basePick(),$=require_flatRest(),e=$(function(Y,Me){return Y==null?{}:ye(Y,Me)});return pick_1=e,pick_1}var pickExports=requirePick();const pick=getDefaultExportFromCjs$1(pickExports),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json",log$1=loglevelExports$1.getLogger("MetricsManager");class MetricsManager{constructor($){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId="",this.pendingEvents=[],this.appHash="Not initialized",this.metadata={},this.setAppHash=e=>{this.appHash=e},this.setMetricsConfig=(e="")=>{this.metricsUrl=e},this.sessionInfo=$}async initialize({gatherUsageStats:$,sendMessageToHost:e}){this.sendMessageToHost=e,this.actuallySendMetrics=$&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(log$1.error("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),log$1.info("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue($,e={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([$,e]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send($,e))}setMetadata($){this.metadata=$}async requestDefaultMetricsConfig(){const $=p$3();if($){const e=window.localStorage.getItem("stMetricsConfig");if(e){this.metricsUrl=e;return}}try{const e=await fetch(DEFAULT_METRICS_CONFIG,{signal:AbortSignal.timeout(5e3)});if(!e.ok)this.metricsUrl=void 0,log$1.error("Failed to fetch metrics config: ",e.status);else{const Y=await e.json();this.metricsUrl=Y.url??void 0,$&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(e){log$1.error("Failed to fetch metrics config:",e)}}send($,e={}){const Y=this.buildEventProto($,e);this.metricsUrl==="postMessage"?this.postMessageEvent($,Y):this.track(Y)}sendPendingEvents(){this.pendingEvents.forEach(([$,e])=>{this.send($,e)}),this.pendingEvents=[]}async track($){const e=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($.toJSON())});await fetch(e)}postMessageEvent($,e){this.sendMessageToHost({type:"METRICS_EVENT",eventName:$,data:e})}buildEventProto($,e){const Y=new MetricsEvent({event:$,anonymousId:this.anonymousId,...this.getHostTrackingData(),...this.getInstallationData(),reportHash:this.appHash,dev:IS_DEV_ENV,source:"browser",streamlitVersion:this.sessionInfo.current.streamlitVersion,isHello:this.sessionInfo.isHello,...this.getContextData()});if($==="menuClick")Y.label=e.label;else if($==="pageProfile")return new MetricsEvent({...Y,...e});return Y}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3}}getHostTrackingData(){return this.metadata?pick(this.metadata,["hostedAt","owner","repo","branch","mainModule","creatorId"]):{}}getContextData(){return{contextPageUrl:window.location.href,contextPageTitle:document.title,contextPagePath:window.location.pathname,contextPageReferrer:document.referrer,contextPageSearch:window.location.search,contextLocale:window.navigator.language,contextUserAgent:window.navigator.userAgent}}getAnonymousId(){if(!this.actuallySendMetrics)return;const $="ajs_anonymous_id",e=p$3(),Y=f$2($),Me=e?window.localStorage.getItem($):null,Ae=new Date;if(Ae.setFullYear(new Date().getFullYear()+1),Y)this.anonymousId=Y,e&&window.localStorage.setItem($,Y);else if(Me){try{this.anonymousId=JSON.parse(Me)}catch{this.anonymousId=Me}setCookie($,this.anonymousId,Ae)}else this.anonymousId=v4(),setCookie($,this.anonymousId,Ae),e&&window.localStorage.setItem($,this.anonymousId)}}const StyledApp=newStyled("div",{target:"ee4bbma0"})(({theme:ye})=>{const $=hasLightBackgroundColor(ye);return{position:"absolute",background:ye.colors.bgColor,color:ye.colors.bodyText,top:ye.spacing.none,left:ye.spacing.none,right:ye.spacing.none,bottom:ye.spacing.none,colorScheme:$?"light":"dark",overflow:"hidden","@media print":{float:"none",height:ye.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"ej964cx0"})({margin:0}),StyledInstruction=newStyled("p",{target:"ej964cx1"})({margin:0}),ScreencastDialog=({onClose:ye,toggleRecordAudio:$,recordAudio:e,startRecording:Y})=>{const[Me,Ae]=reactExports.useState(e),Se=reactExports.useCallback(ze=>{const{checked:Te}=ze.target;Te!==Me&&(Ae(Te),$())},[Me,$]),ve=reactExports.useCallback(()=>{Y(),ye()},[Y,ye]);return jsxs(Modal,{isOpen:!0,onClose:ye,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsxs(ModalBody$1,{children:[jsx$1("p",{children:"This will record a video with the contents of your screen, so you can easily share what you're seeing with others."}),jsx$1("p",{children:jsxs(StyledRecordAudioLabel,{"data-testid":"stScreencastAudioCheckbox",children:[jsx$1("input",{type:"checkbox",name:"recordAudio",checked:Me,onChange:Se})," ","Also record audio"]})}),jsx$1(StyledInstruction,{"data-testid":"stScreencastInstruction",children:jsx$1(StreamlitMarkdown$1,{source:"Press `Esc` any time to stop recording.",allowHTML:!1})})]}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:ve,children:"Start recording!"})})]})},StyledVideo=newStyled("video",{target:"emkt0dj0"})(({theme:ye})=>({width:ye.sizes.full,borderRadius:ye.radii.md})),StyledDialogContainer=newStyled("div",{target:"emkt0dj1"})(({theme:ye})=>({display:"flex",flexDirection:"column",width:ye.sizes.full})),StyledRow=newStyled("div",{target:"emkt0dj2"})(({theme:ye})=>({display:"flex",flexDirection:"row",paddingTop:ye.spacing.md,paddingBottom:ye.spacing.md})),StyledFirstColumn=newStyled("div",{target:"emkt0dj3"})(({theme:ye})=>({paddingRight:ye.spacing.lg,textAlign:"right",color:ye.colors.gray,fontWeight:ye.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"emkt0dj4"})(({theme:ye})=>({flex:1,paddingRight:ye.spacing.lg,marginRight:"6em",[`@media (max-width: ${ye.breakpoints.sm})`]:{marginRight:ye.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"emkt0dj5"})(({theme:ye})=>({marginTop:ye.spacing.sm,marginBottom:ye.spacing.none,fontSize:ye.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"emkt0dj6"})(({theme:ye})=>({marginTop:ye.spacing.twoXS})),VideoRecordedDialog=({onClose:ye,videoBlob:$,fileName:e})=>{const Y=URL.createObjectURL($),Me=()=>{const Ae=document.createElement("a");Ae.setAttribute("href",Y),Ae.setAttribute("download",`${e}.webm`),Ae.click(),ye()};return jsxs(Modal,{isOpen:!0,onClose:ye,overrides:{Dialog:{style:{width:"80vw"}}},children:[jsx$1(ModalHeader,{children:"Next steps"}),jsx$1(ModalBody$1,{children:jsxs(StyledDialogContainer,{"data-testid":"stVideoRecordedDialog",children:[jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 1"}),jsxs(StyledSecondColumn,{children:[jsx$1("p",{children:"Preview your video below:"}),jsx$1(StyledVideo,{src:Y,controls:!0})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 2"}),jsxs(StyledSecondColumn,{children:[jsx$1(StyledDownloadButtonContainer,{children:jsx$1(BaseButton,{kind:BaseButtonKind.SECONDARY,onClick:Me,children:"Save video to disk"})}),jsxs(StyledVideoFormatInstructions,{children:["This video is encoded in the"," ",jsx$1("a",{href:"https://www.webmproject.org/",children:"WebM format"}),", which is only supported by newer video players. You can also play it by dragging the file directly into your browser."]})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 3"}),jsxs(StyledSecondColumn,{children:["Share your video with the world on Twitter, LinkedIn, YouTube, or just plain email!"," ",jsx$1("span",{role:"img","aria-label":"Happy",children:"😀"})]})]})]})})]})},StyledScreenCastWarningDialog=newStyled("div",{target:"e1o5y2010"})({display:"flex"}),StyledUnsupportedScreenCastIcon=newStyled("div",{target:"e1o5y2011"})(({theme:ye})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:ye.spacing.twoXL,marginLeft:ye.spacing.sm,fontSize:ye.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1o5y2012"})(({theme:ye})=>({margin:ye.spacing.none})),UnsupportedBrowserDialog=({onClose:ye})=>jsxs(Modal,{isOpen:!0,onClose:ye,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsx$1(ModalBody$1,{children:jsxs(StyledScreenCastWarningDialog,{"data-testid":"stUnsupportedBrowserDialog",children:[jsx$1(StyledUnsupportedScreenCastIcon,{children:jsx$1("span",{role:"img","aria-label":"Alien Monster",children:"👾"})}),jsx$1(StyledUnsupportedScreenCastExplanation,{children:"Due to limitations with some browsers, this feature is only supported on recent desktop versions of Chrome, Firefox, and Edge."})]})})]}),UnsupportedBrowserDialog$1=reactExports.memo(UnsupportedBrowserDialog),screencastCounterAnimation=keyframes("0%{opacity:0;}25%{opacity:1;}100%{opacity:0;}"),StyledCountdown=newStyled("div",{target:"evez3ra0"})(({theme:ye})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:ye.sizes.full,height:ye.sizes.full,fontSize:"40vh",color:ye.colors.red,fontWeight:ye.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${ye.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:ye,endCallback:$})=>{const[e,Y]=reactExports.useState(ye);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const Ae=e-1;Ae>=0&&Y(Ae),Ae===0&&$()},children:jsx$1("span",{children:e})},`frame${e}`)},log=loglevelExports$1.getLogger("withScreencast");function withScreencast(ye){const $=e=>{const{testOverride:Y}=e,Me=reactExports.useRef(null),[Ae,Se]=reactExports.useState("streamlit-screencast"),[ve,ze]=reactExports.useState(!1),[Te,we]=reactExports.useState(void 0),[De,Ie]=reactExports.useState(Y||"OFF"),Ce=reactExports.useCallback(()=>{ze(Ue=>!Ue)},[]),Ne=reactExports.useCallback(async()=>{if(!(De==="OFF"||m$3(Me.current))){if(De==="COUNTDOWN"){Ie("OFF");return}if(De==="RECORDING"){const Ue=Me.current;if(!Ue||Ue.getState()==="inactive")Ie("OFF");else{const Ge=await Ue.stop();we(Ge),Ie("PREVIEW_FILE")}}}},[De]),qe=reactExports.useCallback(async()=>{if(!ScreenCastRecorder.isSupportedBrowser()){Ie("UNSUPPORTED");return}Me.current=new ScreenCastRecorder({recordAudio:ve,onErrorOrStop:()=>{Ne().catch(Ue=>log.warn(`withScreencast.stopRecording threw an error: ${Ue}`))}});try{await Me.current.initialize()}catch(Ue){log.warn(`ScreenCastRecorder.initialize error: ${Ue}`),Ie("UNSUPPORTED");return}Ie("COUNTDOWN")},[ve,Ne]),Le=reactExports.useCallback(Ue=>{if(!ScreenCastRecorder.isSupportedBrowser()){Ie("UNSUPPORTED");return}if(De==="OFF"){Se(Ue),Ie("SETUP");return}Ne().catch(Ge=>log.warn(`withScreencast.stopRecording threw an error: ${Ge}`))},[De,Ne]),Fe=reactExports.useCallback(async()=>{if(m$3(Me.current))throw new Error("Countdown finished but recorder is null");Me.current.start()?Ie("RECORDING"):Ne().catch(Ge=>log.warn(`withScreencast.stopRecording threw an error: ${Ge}`))},[Ne]),We=reactExports.useCallback(()=>{Ie("OFF")},[]);return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(ye,{...e,screenCast:{currentState:De,toggleRecordAudio:Ce,startRecording:Le,stopRecording:Ne}}),De==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:We}),De==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:ve,onClose:We,startRecording:qe,toggleRecordAudio:Ce}),De==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:Fe}),De==="PREVIEW_FILE"&&Te&&jsx$1(VideoRecordedDialog,{onClose:We,videoBlob:Te,fileName:Ae})]})};return $.displayName=`withScreencast(${ye.displayName||ye.name||"Component"})`,hoistNonReactStatics($,ye)}const showDevelopmentOptions=(ye,$)=>$==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==$||Config.ToolbarMode.MINIMAL==$?!1:ye||isLocalhost();function getTitle(ye){return ye||"Streamlit"}class StrategyV1{constructor($){this.appNav=$,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession($){var Se,ve;this.appPages=$.appPages,this.currentPageScriptHash=$.pageScriptHash,this.hideSidebarNav=((Se=$.config)==null?void 0:Se.hideSidebarNav)??!1;const e=this.appPages[0],Y=e.urlPathname??"",Me=((ve=this.appPages.find(ze=>ze.pageScriptHash===this.currentPageScriptHash))==null?void 0:ve.urlPathname)??"",Ae=e.pageScriptHash===this.currentPageScriptHash;return this.appNav.onUpdatePageUrl(Y,Me,Ae),document.title=getTitle(Me??""),[{hideSidebarNav:this.hideSidebarNav,appPages:this.appPages,currentPageScriptHash:this.currentPageScriptHash},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:this.appPages}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:Ae?"":Me,currentPageScriptHash:this.currentPageScriptHash})}]}handlePagesChanged($){const{appPages:e}=$;return[{appPages:e},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:e})}]}handlePageNotFound($){var Me;const{pageName:e}=$;this.appNav.onPageNotFound(e);const Y=((Me=this.appPages[0])==null?void 0:Me.pageScriptHash)??"";return this.currentPageScriptHash=Y,[{currentPageScriptHash:Y},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:Y})}]}handleNavigation($){}findPageByUrlPath($){return this.appPages.length===0?null:this.appPages.find(e=>$.endsWith("/"+e.urlPathname))??this.appPages[0]}clearPageElements($,e,Y){return AppRoot.empty(e,!1,Y,$.logo)}}class StrategyV2{constructor($){this.appNav=$,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession($){var e;return this.mainScriptHash=$.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((e=$.config)==null?void 0:e.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged($){}handlePageNotFound($){const{pageName:e}=$;return this.appNav.onPageNotFound(e),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation($){const{sections:e,position:Y,appPages:Me}=$;this.appPages=Me,this.hideSidebarNav=Y===Navigation.Position.HIDDEN;const Ae=$.pageScriptHash,Se=Me.find(Te=>Te.pageScriptHash===Ae),ve=Me.find(Te=>Te.isDefault);this.mainPage=ve;const ze=Se.urlPathname;if(!this.appNav.isPageTitleSet){const Te=getTitle(Se.pageName);document.title=Te,this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:Se.pageName??""})}return!this.appNav.isPageIconSet&&Se.icon&&this.appNav.onPageIconChange(Se.icon),this.appNav.onUpdatePageUrl(ve.urlPathname??"",ze,Se.isDefault??!1),[{appPages:Me,navSections:e,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:$.expanded,currentPageScriptHash:Ae},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:Me}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:Se.isDefault?"":ze,currentPageScriptHash:Ae})}]}findPageByUrlPath($){return this.appPages.find(e=>$.endsWith("/"+e.urlPathname))??this.mainPage}clearPageElements($,e,Y){return $.filterMainScriptElements(e)}}class AppNavigation{constructor($,e,Y,Me){this.hostCommunicationMgr=$,this.onUpdatePageUrl=e,this.onPageNotFound=Y,this.onPageIconChange=Me,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession($){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession($)}handleNavigation($){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation($)}handlePagesChanged($){return this.strategy.handlePagesChanged($)}handlePageNotFound($){return this.strategy.handlePageNotFound($)}findPageByUrlPath($){return this.strategy.findPageByUrlPath($)}handlePageConfigChanged($){this.isPageIconSet=!!$.favicon,this.isPageTitleSet=!!$.title}clearPageElements($,e,Y){return this.strategy.clearPageElements($,e,Y)}}var define_PACKAGE_METADATA_default={version:"1.42.0"};const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>",LOG=loglevelExports$1.getLogger("App");class App extends reactExports.PureComponent{constructor($){super($),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(Y,Me,Ae)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:Y,msg:Me,onContinue:Ae,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(Y,Me)=>{const[,Ae,Se]=createPresetThemes(),ve=isPresetTheme(this.props.theme.activeTheme);Y===Ae.name&&ve?this.props.theme.setTheme(Ae):Y===Se.name&&ve?this.props.theme.setTheme(Se):Me&&this.props.theme.setImportedTheme(Me)},this.handleConnectionStateChanged=Y=>{if(LOG.info(`Connection state changed from ${this.state.connectionState} to ${Y}`),Y===ConnectionState.CONNECTED){LOG.info("Reconnected to server.");const Me=this.state.scriptRunState===ScriptRunState.RUNNING,Ae=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED;(!this.sessionInfo.last||Me||Ae)&&(LOG.info("Requesting a script run."),this.widgetMgr.sendUpdateWidgetsMessage(void 0),this.setState({dialog:null})),this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_CONNECTED"})}else this.state.connectionState===ConnectionState.CONNECTED&&this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_DISCONNECTED",attemptingToReconnect:Y!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:Y})},this.handleGitInfoChanged=Y=>{this.setState({gitInfo:Y})},this.handleCustomParentMessage=Y=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:Y.message}):LOG.error("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=Y=>{const Me=(Ae,Se,ve)=>{const ze=Ae[Se];if(ze in ve)return ve[ze](Ae[ze]);throw new Error(`Cannot handle ${Se} "${ze}".`)};try{Me(Y,"type",{newSession:Ae=>this.handleNewSession(Ae),sessionStatusChanged:Ae=>this.handleSessionStatusChanged(Ae),sessionEvent:Ae=>this.handleSessionEvent(Ae),delta:Ae=>this.handleDeltaMsg(Ae,Y.metadata),pageConfigChanged:Ae=>this.handlePageConfigChanged(Ae),pageInfoChanged:Ae=>this.handlePageInfoChanged(Ae),pagesChanged:Ae=>this.handlePagesChanged(Ae),pageNotFound:Ae=>this.handlePageNotFound(Ae),gitInfoChanged:Ae=>this.handleGitInfoChanged(Ae),scriptFinished:Ae=>this.handleScriptFinished(Ae),pageProfile:Ae=>this.handlePageProfileMsg(Ae),autoRerun:Ae=>this.handleAutoRerun(Ae),fileUrlsResponse:Ae=>this.uploadClient.onFileURLsResponse(Ae),parentMessage:Ae=>this.handleCustomParentMessage(Ae),logo:Ae=>this.handleLogo(Ae,Y.metadata),navigation:Ae=>this.handleNavigation(Ae),authRedirect:Ae=>{isInChildFrame()?this.hostCommunicationMgr.sendMessageToSameOriginHost({type:"REDIRECT_TO_URL",url:Ae.url}):window.location.href=Ae.url}})}catch(Ae){const Se=ensureError(Ae);LOG.error(Se),this.showError("Bad message format",Se.message)}},this.handleLogo=(Y,Me)=>{const Ae={activeScriptHash:Me.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(Y,Ae)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=Y=>{const{title:Me,favicon:Ae,layout:Se,initialSidebarState:ve,menuItems:ze}=Y;this.appNavigation.handlePageConfigChanged(Y),Me&&(this.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:Me}),document.title=Me),Ae&&this.onPageIconChanged(Ae),Se!==this.state.layout&&this.setState(Te=>({layout:Se,userSettings:{...Te.userSettings,wideMode:Se===PageConfig.Layout.WIDE}})),ve!==this.state.initialSidebarState&&this.setState(()=>({initialSidebarState:ve})),this.setState({menuItems:ze})},this.handlePageInfoChanged=Y=>{const{queryString:Me}=Y,Ae=document.location.pathname+(Me?`?${Me}`:"");window.history.pushState({},"",Ae),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:Me?`?${Me}`:""})},this.onPageNotFound=Y=>{const Me=Y?`You have requested page /${Y}, but no corresponding file was found in the app's pages/ directory`:"The page that you have requested does not seem to exist";this.showError("Page not found",`${Me}. Running the app's main page.`)},this.handlePageNotFound=Y=>{this.maybeSetState(this.appNavigation.handlePageNotFound(Y))},this.onPageIconChanged=Y=>{handleFavicon(Y,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=Y=>{this.maybeSetState(this.appNavigation.handlePagesChanged(Y))},this.handleNavigation=Y=>{this.maybeSetState(this.appNavigation.handleNavigation(Y))},this.handlePageProfileMsg=Y=>{var Se,ve,ze;const Me=PageProfile.toObject(Y),Ae=getBrowserInfo();this.metricsMgr.enqueue("pageProfile",{...Me,isFragmentRun:!!Me.isFragmentRun,appId:this.sessionInfo.current.appId,numPages:(Se=this.state.appPages)==null?void 0:Se.length,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,pageScriptHash:this.state.currentPageScriptHash,activeTheme:(ze=(ve=this.props.theme)==null?void 0:ve.activeTheme)==null?void 0:ze.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:Ae})},this.handleAutoRerun=Y=>{const Me=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(Y.fragmentId,!0)},Y.interval*1e3);this.setState(Ae=>({autoReruns:[...Ae.autoReruns,Me]}))},this.handleSessionStatusChanged=Y=>{this.setState(Me=>{let{scriptRunState:Ae}=Me,{dialog:Se}=Me;return Y.scriptIsRunning&&Me.scriptRunState!==ScriptRunState.STOP_REQUESTED?(Ae=ScriptRunState.RUNNING,d$2(Se)&&Se.type===DialogType.SCRIPT_COMPILE_ERROR&&(Se=void 0)):!Y.scriptIsRunning&&Me.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&Me.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(Ae=ScriptRunState.NOT_RUNNING),{userSettings:{...Me.userSettings,runOnSave:!!Y.runOnSave},dialog:Se,scriptRunState:Ae}})},this.handleSessionEvent=Y=>{if(this.sessionEventDispatcher.handleSessionEventMsg(Y),Y.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const Me={type:DialogType.SCRIPT_COMPILE_ERROR,exception:Y.scriptCompilationException,onClose:()=>{}};this.openDialog(Me)}},this.maybeUpdatePageUrl=(Y,Me,Ae)=>{const Se=this.getBaseUriParts();if(Se){const{pathname:ve}=Se,ze=extractPageNameFromPathName(document.location.pathname,ve);if((ze===""?Y:ze)!==Me){const we=Ae?"":Me,De=preserveEmbedQueryParams(),Ie=De?`?${De}`:"",Ne=`${ve==="/"?"":ve}/${we}${Ie}`;window.history.pushState({},"",Ne)}}},this.handleNewSession=Y=>{const Me=Y.initialize;if(this.hasStreamlitVersionChanged(Me)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(Y);const{appHash:Ae,currentPageScriptHash:Se}=this.state,{scriptRunId:ve,name:ze,mainScriptPath:Te,fragmentIdsThisRun:we,pageScriptHash:De,mainScriptHash:Ie}=Y;if(we.length)this.setState({fragmentIdsThisRun:we,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const Ne=Y.config,qe=Y.customTheme;this.processThemeInput(qe),this.setState({allowRunOnSave:Ne.allowRunOnSave,hideTopBar:Ne.hideTopBar,toolbarMode:Ne.toolbarMode,latestRunTime:performance.now(),mainScriptHash:Ie,fragmentIdsThisRun:we}),this.maybeSetState(this.appNavigation.handleNewSession(Y)),this.onPageIconChanged("./favicon.png")}const Ce=hashString(this.sessionInfo.current.installationId+Te);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(Ce),this.metricsMgr.enqueue("updateReport"),Ae===Ce&&Se===De?this.setState({scriptRunId:ve}):this.clearAppState(Ce,ve,ze,Ie)},this.handleOneTimeInitialization=Y=>{const Me=Y.initialize,Ae=Y.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(Y)),this.metricsMgr.initialize({gatherUsageStats:Ae.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(Me.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:Y}=this.state,Me=this.appNavigation.findPageByUrlPath(document.location.pathname),Ae=document.location.toString().includes("#"),Se=(Me==null?void 0:Me.pageScriptHash)===Y;m$3(Me)||Ae&&Se||this.onPageChange(Me.pageScriptHash)},this.setAndSendTheme=Y=>{this.props.theme.setTheme(Y),this.setState({hideColoredLine:!isPresetTheme(Y)}),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(Y.emotion)})},this.createThemeHash=Y=>{if(!Y)return"hash_for_undefined_custom_theme";const Me=Object.entries(Y);return Me.sort(),hashString(Me.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=Y=>{const{runOnSave:Me}=this.state.userSettings,{runOnSave:Ae}=Y;if(this.setState({userSettings:Y}),Me!==Ae&&this.isServerConnected()){const Se=new BackMsg$1({setRunOnSave:Ae});Se.type="setRunOnSave",this.sendBackMsg(Se)}},this.handleDeltaMsg=(Y,Me)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,Y,Me),!this.pendingElementsTimerRunning){this.pendingElementsTimerRunning=!0;const Ae=this.state.scriptRunState===ScriptRunState.RUNNING;setTimeout(()=>{this.pendingElementsTimerRunning=!1,Ae&&this.setState({elements:this.pendingElementsBuffer})},ELEMENT_LIST_BUFFER_TIMEOUT_MS)}},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({debugShutdownRuntime:!0});Y.type="debugShutdownRuntime",this.sendBackMsg(Y)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({debugDisconnectWebsocket:!0});Y.type="debugDisconnectWebsocket",this.sendBackMsg(Y)}},this.debugClearForwardMsgCache=()=>{var Y,Me;isLocalhost()&&((Me=(Y=this.connectionManager)==null?void 0:Y.websocketConnection)==null||Me.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(Y=>{clearInterval(Y)}),this.setState({autoReruns:[]})},this.rerunScript=(Y=!1)=>{if(this.closeDialog(),!this.isServerConnected()){LOG.error("Cannot rerun script when disconnected from server.");return}this.state.scriptRunState===ScriptRunState.RUNNING||this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||(this.setState({scriptRunState:ScriptRunState.RERUN_REQUESTED}),Y===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){LOG.error("Cannot load git information when disconnected from server.");return}this.sendBackMsg(new BackMsg$1({loadGitInfo:!0}))},this.onPageChange=Y=>{const{elements:Me,mainScriptHash:Ae}=this.state;this.cleanupAutoReruns();const Se=this.appNavigation.clearPageElements(Me,Ae,void 0),ve=new Set(Array.from(Se.getElements()).map(ze=>getElementId(ze)).filter(notUndefined));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(ve),void 0,Y)},this.isAppInReadyState=Y=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&Y.scriptRunState===ScriptRunState.RUNNING&&Y.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(Y,Me,Ae,Se)=>{const ve=this.getBaseUriParts();if(!ve){LOG.error("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ze}=this.state,{pathname:Te}=ve;let we=this.getQueryString(),De="";Ae?Ae!=ze&&(we=preserveEmbedQueryParams(),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:we})):ze?Ae=ze:(De=extractPageNameFromPathName(document.location.pathname,Te),Ae=""),this.sendBackMsg(new BackMsg$1({rerunScript:{queryString:we,widgetStates:Y,pageScriptHash:Ae,pageName:De,fragmentId:Me,isAutoRerun:Se}}))},this.stopScript=()=>{if(!this.isServerConnected()){LOG.error("Cannot stop app when disconnected from server.");return}if(this.state.scriptRunState===ScriptRunState.NOT_RUNNING||this.state.scriptRunState===ScriptRunState.STOP_REQUESTED)return;const Y=new BackMsg$1({stopScript:!0});Y.type="stopScript",this.sendBackMsg(Y),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const Y={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(Y)}else LOG.error("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var Me;const Y={type:DialogType.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:((Me=this.state.dialog)==null?void 0:Me.type)===DialogType.DEPLOY_ERROR,metricsMgr:this.metricsMgr};this.openDialog(Y)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const Y={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(Y)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const Y=new BackMsg$1({clearCache:!0});Y.type="clearCache",this.sendBackMsg(Y)}else LOG.error("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({appHeartbeat:!0});Y.type="appHeartbeat",this.sendBackMsg(Y)}else LOG.error("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=Y=>{this.connectionManager?(LOG.info(Y),this.connectionManager.sendMessage(Y)):LOG.error(`Not connected. Cannot send back message: ${Y}`)},this.handleConnectionError=Y=>{this.showError("Connection error",Y)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(Y=!0)=>{const Me={type:DialogType.SETTINGS,isServerConnected:this.isServerConnected(),settings:this.state.userSettings,allowRunOnSave:this.state.allowRunOnSave,onSave:this.saveSettings,onClose:()=>{},developerMode:showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),openThemeCreator:this.openThemeCreatorDialog,animateModal:Y,metricsMgr:this.metricsMgr};this.openDialog(Me)},this.aboutCallback=()=>{const{menuItems:Y}=this.state,Me={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:Y==null?void 0:Y.aboutSectionMd};this.openDialog(Me)},this.printCallback=()=>{const{scriptRunState:Y}=this.state;if(Y!==ScriptRunState.NOT_RUNNING){setTimeout(this.printCallback,500);return}let Me;try{const Ae=getIFrameEnclosingApp(this.embeddingId);Ae&&Ae.contentWindow?Me=Ae.contentWindow.window:Me=window}catch{Me=window}finally{Me||(Me=window),Me.print()}},this.screencastCallback=()=>{const{scriptName:Y}=this.state,{startRecording:Me}=this.props.screenCast,Ae=hooks().format("YYYY-MM-DD-HH-MM-SS");Me(`streamlit-${Y}-${Ae}`)},this.handleFullScreen=Y=>{this.setState({isFullScreen:Y})},this.setLibConfig=Y=>{this.setState({libConfig:Y})},this.setAppConfig=Y=>{this.setState({appConfig:Y})},this.addScriptFinishedHandler=Y=>{this.setState((Me,Ae)=>({scriptFinishedHandlers:Me.scriptFinishedHandlers.concat(Y)}))},this.removeScriptFinishedHandler=Y=>{this.setState((Me,Ae)=>({scriptFinishedHandlers:without(Me.scriptFinishedHandlers,Y)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:Y}=this.state,Me=Y&&Y.length>0?Y:document.location.search;return Me.startsWith("?")?Me.substring(1):Me},this.isInCloudEnvironment=()=>{const{hostMenuItems:Y}=this.state;return Y&&(Y==null?void 0:Y.length)>0},this.showDeployButton=()=>showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&!this.isInCloudEnvironment()&&this.sessionInfo.isSet&&!this.sessionInfo.isHello,this.deployButtonClicked=()=>{this.metricsMgr.enqueue("menuClick",{label:"deployButtonInApp"}),this.sendLoadGitInfoBackMsg(),this.openDeployDialog()},this.requestFileURLs=(Y,Me)=>{if(this.isServerConnected()){const Ae=new BackMsg$1({fileUrlsRequest:{requestId:Y,fileNames:Me.map(Se=>Se.name),sessionId:this.sessionInfo.current.sessionId}});Ae.type="fileUrlsRequest",this.sendBackMsg(Ae)}},this.handleKeyDown=Y=>{switch(Y){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=Y=>{Y==="esc"&&this.props.screenCast.stopRecording()},J$1();let e=this.createThemeHash();isPresetTheme($.theme.activeTheme)||(e=this.createThemeHash(toThemeInput($.theme.activeTheme.emotion))),this.state={connectionState:ConnectionState.INITIAL,elements:AppRoot.empty("",!0),isFullScreen:!1,scriptName:"",scriptRunId:INITIAL_SCRIPT_RUN_ID,appHash:null,scriptRunState:ScriptRunState.NOT_RUNNING,userSettings:{wideMode:!1,runOnSave:!1},layout:PageConfig.Layout.CENTERED,initialSidebarState:PageConfig.SidebarState.AUTO,menuItems:void 0,allowRunOnSave:!0,scriptFinishedHandlers:[],themeHash:e,gitInfo:null,formsData:createFormsData(),appPages:[],navSections:[],currentPageScriptHash:"",mainScriptHash:"",hideTopBar:!0,hideSidebarNav:!0,hideColoredLine:!1,expandSidebarNav:!1,toolbarMode:Config.ToolbarMode.MINIMAL,latestRunTime:performance.now(),fragmentIdsThisRun:[],isOwner:!1,hostMenuItems:[],hostToolbarItems:[],hostHideSidebarNav:!1,sidebarChevronDownshift:0,pageLinkBaseUrl:"",queryParams:"",deployedAppMetadata:{},libConfig:{},appConfig:{},autoReruns:[],inputsDisabled:!1},this.connectionManager=null,this.widgetMgr=new WidgetStateManager({sendRerunBackMsg:this.sendRerunBackMsg,formsDataChanged:Y=>this.setState({formsData:Y})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:$.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:Y=>{this.setState({inputsDisabled:Y})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:Y=>this.setState({isOwner:Y}),fileUploadClientConfigChanged:Y=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(Y)},hostMenuItemsChanged:Y=>{this.setState({hostMenuItems:Y})},hostToolbarItemsChanged:Y=>{this.setState({hostToolbarItems:Y})},hostHideSidebarNavChanged:Y=>{this.setState({hostHideSidebarNav:Y})},sidebarChevronDownshiftChanged:Y=>{this.setState({sidebarChevronDownshift:Y})},pageLinkBaseUrlChanged:Y=>{this.setState({pageLinkBaseUrl:Y})},queryParamsChanged:Y=>{this.setState({queryParams:Y})},deployedAppMetadataChanged:Y=>{this.setState({deployedAppMetadata:Y})},restartWebsocketConnection:()=>{this.connectionManager||(this.setState({scriptRunState:ScriptRunState.RERUN_REQUESTED}),this.initializeConnectionManager())},terminateWebsocketConnection:()=>{var Y;(Y=this.connectionManager)==null||Y.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:Y=>this.widgetMgr.setFormsWithUploadsInProgress(Y),requestFileURLs:this.requestFileURLs}),this.componentRegistry=new ComponentRegistry(this.endpoints),this.pendingElementsTimerRunning=!1,this.pendingElementsBuffer=this.state.elements,this.appNavigation=new AppNavigation(this.hostCommunicationMgr,this.maybeUpdatePageUrl,this.onPageNotFound,this.onPageIconChanged),window.streamlitDebug={clearForwardMsgCache:this.debugClearForwardMsgCache,disconnectWebsocket:this.debugDisconnectWebsocket,shutdownRuntime:this.debugShutdownRuntime}}initializeConnectionManager(){this.connectionManager=new ConnectionManager({getLastSessionId:()=>{var $;return($=this.sessionInfo.last)==null?void 0:$.sessionId},endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:$=>{const{allowedOrigins:e,useExternalAuthToken:Y,disableFullscreenMode:Me,enableCustomParentMessages:Ae,mapboxToken:Se,enforceDownloadInNewTab:ve,metricsUrl:ze}=$,Te={allowedOrigins:e,useExternalAuthToken:Y,enableCustomParentMessages:Ae},we={mapboxToken:Se,disableFullscreenMode:Me,enforceDownloadInNewTab:ve};this.metricsMgr.setMetricsConfig(ze),this.hostCommunicationMgr.setAllowedOrigins(Te),this.setAppConfig(Te),this.setLibConfig(we)}})}componentDidMount(){this.initializeConnectionManager(),mark(this.state.scriptRunState),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}),isScrollingHidden()&&document.body.classList.add("embedded"),isInChildFrame()&&(window.iFrameResizer={heightCalculationMethod:()=>{const $=document.querySelectorAll("[data-iframe-height]"),e=Array.from($).map(Y=>Math.ceil(Y.getBoundingClientRect().bottom));return Math.max(0,...e)}},__vitePreload(()=>import("./iframeResizer.contentWindow.CyCMpBzy.js").then($=>$.i),[],import.meta.url)),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(this.props.theme.activeTheme.emotion)}),this.metricsMgr.enqueue("viewReport"),window.addEventListener("popstate",this.onHistoryChange,!1)}componentDidUpdate($,e){window.prerenderReady===!1&&this.isAppInReadyState(e)&&(window.prerenderReady=!0),this.state.scriptRunState!==e.scriptRunState&&(mark(this.state.scriptRunState),this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&measure("script-run-cycle",ScriptRunState.RUNNING,ScriptRunState.NOT_RUNNING),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}))}componentWillUnmount(){var $;($=this.connectionManager)==null||$.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError($,e){LOG.error(e);const Y={type:DialogType.WARNING,title:$,msg:jsx$1(StreamlitMarkdown$1,{source:e,allowHTML:!1}),onClose:()=>{}};this.openDialog(Y)}hasStreamlitVersionChanged($){var Y;let e;if(((Y=window.__streamlit)==null?void 0:Y.ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION)===!0?e=define_PACKAGE_METADATA_default.version:this.sessionInfo.isSet&&(e=this.sessionInfo.current.streamlitVersion),e){const{environmentInfo:Me}=$;if(d$2(Me)&&d$2(Me.streamlitVersion))return e!=Me.streamlitVersion}return!1}maybeSetState($){if($){const[e,Y]=$;this.setState(e,Y)}}processThemeInput($){const e=this.createThemeHash($);if(e===this.state.themeHash)return;this.setState({themeHash:e});const Y=!isPresetTheme(this.props.theme.activeTheme);if($){const Me=createTheme(CUSTOM_THEME_NAME,$);this.props.theme.addThemes([Me]),(getCachedTheme()===null||Y)&&this.setAndSendTheme(Me)}else this.props.theme.addThemes([]),Y&&this.setAndSendTheme(getHostSpecifiedTheme());$!=null&&$.fontFaces&&this.props.theme.setImportedTheme($)}handleScriptFinished($){if($===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(e=>e())},0),$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:Y,fragmentIdsThisRun:Me})=>({elements:this.pendingElementsBuffer.clearStaleNodes(Y,Me)}),()=>{this.pendingElementsBuffer=this.state.elements});const e=new Set(Array.from(this.state.elements.getElements()).map(Y=>getElementId(Y)).filter(notUndefined));this.widgetMgr.removeInactive(e)}this.connectionManager!==null&&$!==ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState($,e,Y,Me){const{hideSidebarNav:Ae,elements:Se}=this.state,ve=Ae&&Se.sidebar||void 0;this.setState({scriptRunId:e,scriptName:Y,appHash:$,elements:this.appNavigation.clearPageElements(this.pendingElementsBuffer,Me,ve)},()=>{this.pendingElementsBuffer=this.state.elements;const ze=new Set(Array.from(this.state.elements.getElements()).map(Te=>getElementId(Te)).filter(notUndefined));this.widgetMgr.removeInactive(ze)})}openDialog($){this.setState({dialog:$})}render(){const{allowRunOnSave:$,connectionState:e,dialog:Y,elements:Me,initialSidebarState:Ae,menuItems:Se,isFullScreen:ve,scriptRunId:ze,scriptRunState:Te,userSettings:we,hideTopBar:De,hideSidebarNav:Ie,hideColoredLine:Ce,expandSidebarNav:Ne,currentPageScriptHash:qe,hostHideSidebarNav:Le,pageLinkBaseUrl:Fe,sidebarChevronDownshift:We,hostMenuItems:je,hostToolbarItems:Ue,libConfig:Ge,appConfig:He,inputsDisabled:Xe,appPages:st,navSections:Je}=this.state,Qe=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),rt=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":we.wideMode}),ut=Y?StreamlitDialog({...Y,onClose:this.closeDialog}):null,ft=Xe||e!==ConnectionState.CONNECTED;return jsx$1(AppContext.Provider,{value:{initialSidebarState:Ae,wideMode:we.wideMode,embedded:isEmbed(),showPadding:!isEmbed()||isPaddingDisplayed(),disableScrolling:isScrollingHidden(),showToolbar:!isEmbed()||isToolbarDisplayed(),showColoredLine:!Ce&&!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Fe,sidebarChevronDownshift:We,gitInfo:this.state.gitInfo,appConfig:He},children:jsx$1(LibContext.Provider,{value:{isFullScreen:ve,setFullScreen:this.handleFullScreen,addScriptFinishedHandler:this.addScriptFinishedHandler,removeScriptFinishedHandler:this.removeScriptFinishedHandler,activeTheme:this.props.theme.activeTheme,setTheme:this.setAndSendTheme,availableThemes:this.props.theme.availableThemes,addThemes:this.props.theme.addThemes,onPageChange:this.onPageChange,currentPageScriptHash:qe,libConfig:Ge,fragmentIdsThisRun:this.state.fragmentIdsThisRun,locale:window.navigator.language},children:jsx$1(ReactHotkeys,{keyName:"r,c,esc",onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,children:jsxs(StyledApp,{className:rt,"data-testid":"stApp","data-test-script-state":ze==INITIAL_SCRIPT_RUN_ID?"initial":Te,"data-test-connection-state":e,children:[jsxs(Header,{children:[!De&&jsxs(Fragment,{children:[jsx$1(StatusWidget,{connectionState:e,sessionEventDispatcher:this.sessionEventDispatcher,scriptRunState:Te,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:$}),jsx$1(ToolbarActions,{hostToolbarItems:Ue,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,metricsMgr:this.metricsMgr})]}),this.showDeployButton()&&jsx$1(DeployButton,{onClick:this.deployButtonClicked.bind(this)}),jsx$1(MainMenu$1,{isServerConnected:this.isServerConnected(),quickRerunCallback:this.rerunScript,clearCacheCallback:this.openClearCacheDialog,settingsCallback:this.settingsCallback,aboutCallback:this.aboutCallback,printCallback:this.printCallback,screencastCallback:this.screencastCallback,screenCastState:this.props.screenCast.currentState,hostMenuItems:je,developmentMode:Qe,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:Se,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode})]}),jsx$1(AppView,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:Me,scriptRunId:ze,scriptRunState:Te,widgetMgr:this.widgetMgr,widgetsDisabled:ft,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:Me.logo,appPages:st,navSections:Je,onPageChange:this.onPageChange,currentPageScriptHash:qe,hideSidebarNav:Ie||Le,expandSidebarNav:Ne}),ut]})})})})}}const AppWithScreenCast=withScreencast(App);function useThemeManager(){const ye=getDefaultTheme(),[$,e]=reactExports.useState(ye),[Y,Me]=reactExports.useState([]),[Ae,Se]=reactExports.useState([...createPresetThemes(),...isPresetTheme(ye)?[]:[ye]]),ve=De=>{Se([...createPresetThemes(),...De])},ze=reactExports.useCallback(De=>{De!==$&&(e(De),De.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(De))},[e,$]),Te=reactExports.useCallback(()=>{$.name===AUTO_THEME_NAME&&ze(getHostSpecifiedTheme());const De=Ae.filter(Ie=>Ie.name!==AUTO_THEME_NAME);Se([createAutoTheme(),...De])},[$.name,Ae,ze]),we=reactExports.useCallback(De=>{De.fontFaces&&Me(De.fontFaces);const Ie=new CustomThemeConfig(De),Ce=createTheme(CUSTOM_THEME_NAME,Ie);ze(Ce)},[Me,ze]);return reactExports.useEffect(()=>{const De=window.matchMedia("(prefers-color-scheme: dark)");return De.addEventListener("change",Te),window.addEventListener("afterprint",Te),()=>{window.removeEventListener("afterprint",Te),De.removeEventListener("change",Te)}},[$,Ae,Te]),[{setTheme:ze,activeTheme:$,addThemes:ve,availableThemes:Ae,setImportedTheme:we},Y]}const ThemedApp=({streamlitExecutionStartedAt:ye})=>{const[$,e]=useThemeManager(),{activeTheme:Y}=$,Me=Y.name===CUSTOM_THEME_NAME&&e.length>0;return jsx$1(RootStyleProvider,{theme:Y,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[Me&&jsx$1(FontFaceDeclaration,{fontFaces:e}),jsx$1(AppWithScreenCast,{theme:$,streamlitExecutionStartedAt:ye})]})})})},streamlitExecutionStartedAt=Date.now(),engine=new StyletronClient({prefix:"st-"});ReactDOM.render(jsx$1(Provider$1,{value:engine,children:jsx$1(ThemedApp,{streamlitExecutionStartedAt})}),document.getElementById("root"));export{require_baseKeys as $,ACCESSIBILITY_TYPE as A,PLACEMENT as B,jsxs as C,hasLightBackgroundColor as D,EmotionIconBase as E,Fragment as F,DynamicIcon as G,Popover$2 as H,requireToString as I,require$$0 as J,m$3 as K,merge$3 as L,d$2 as M,numbro$1 as N,hooks as O,PortalContext as P,getTimezone as Q,React as R,moment as S,isUnsignedIntegerType as T,isIntegerType as U,isDurationType as V,isPeriodType as W,format as X,isBooleanType as Y,requireIsArray as Z,_extends$K as _,range as a,DEFAULT_IFRAME_FEATURE_POLICY as a$,require_getTag as a0,requireIsArguments as a1,requireIsArrayLike as a2,requireIsBuffer$1 as a3,require_isPrototype as a4,requireIsTypedArray as a5,Field as a6,Null as a7,DataFrameCellType as a8,isTimeType as a9,Resizable as aA,getBlue80 as aB,getSequentialColorsArray as aC,getDivergingColorsArray as aD,getCategoricalColorsArray as aE,getGray70 as aF,getGray30 as aG,debounce$3 as aH,Global as aI,require_baseMerge as aJ,require_createAssigner as aK,toaster as aL,Kind as aM,AlertElement$1 as aN,propTypesExports as aO,_assertThisInitialized as aP,StyledInlineCode as aQ,ErrorElement as aR,ensureError as aS,Skeleton$1 as aT,Skeleton as aU,hoistNonReactStatics as aV,lib$3 as aW,parseToRgba as aX,assertNever as aY,DeckGlJsonChart$1 as aZ,DEFAULT_IFRAME_SANDBOX_POLICY as a_,convertTimeToDate as aa,isDecimalType as ab,isRangeIndexType as ac,isStringType as ad,isEmptyType as ae,isDatetimeType as af,isDateType as ag,isObjectType as ah,isBytesType as ai,isNumericType as aj,isCategoricalType as ak,isListType as al,Arrow$2 as am,loglevelExports$1 as an,_defineProperty$n as ao,_objectWithoutProperties$f as ap,jsx as aq,_typeof$b as ar,css as as,transparentize as at,mix$1 as au,getStyledCell as av,isEqual as aw,StyledTooltipContentWrapper as ax,StreamlitMarkdown$1 as ay,LibContext as az,reactDomExports as b,classNames as b$,darken as b0,BaseButtonSize as b1,BaseButtonKind as b2,BaseButtonTooltip as b3,DynamicButtonLabel as b4,IsSidebarContext as b5,Placement as b6,getIncreasingGreen as b7,getDecreasingRed as b8,getGray90 as b9,StyledSpinnerIcon as bA,AcceptFileValue as bB,chatInputAcceptFileProtoValueToEnum as bC,isFocusVisible as bD,getOverride as bE,getOverrideProps as bF,StyledContent as bG,Checkbox$1 as bH,StyledCheckbox$1 as bI,BaseColorPicker$1 as bJ,useStyletron as bK,mergeOverride as bL,toObjectOverride as bM,Icon$1 as bN,requireReactDom as bO,UIDConsumer as bP,StatefulMenu as bQ,mergeOverrides as bR,ChevronDown$1 as bS,ThemeContext as bT,forkBlur as bU,forkFocus as bV,Select as bW,without as bX,fuzzyFilterSelectOptions as bY,VirtualDropdown as bZ,TYPE as b_,PlotlyChart$1 as ba,keysToSnakeCase as bb,WindowDimensionsContext as bc,Video$1 as bd,zip as be,FileUploaderState as bf,UploadedFileInfo as bg,StyledSpinner as bh,ENABLE_PERIPHERALS_DOCS_URL as bi,Icon$2 as bj,BaseButton as bk,blend as bl,labelVisibilityProtoValueToEnum as bm,TooltipIcon as bn,WidgetLabel as bo,Tooltip as bp,styled as bq,getOverrides as br,LocaleContext as bs,ButtonGroup$1 as bt,StyledWidgetLabelHelpInline as bu,LabelVisibilityMessage as bv,themeColors as bw,libExports as bx,CAMERA_PERMISSION_URL as by,StyledWidgetLabelHelp as bz,require_hasPath as c,UISelectbox as c0,isValidFormId as c1,toPropertyKey as c2,_setPrototypeOf$9 as c3,hexToRgb as c4,withWrapper as c5,__awaiter as c6,PropTypes as c7,isFromWindows as c8,StyledWidgetInstructions as c9,isFromMac as ca,SIZE$1 as cb,CUSTOM_INPUT_TYPE as cc,ADJOINED as cd,DeleteAlt$1 as ce,filterOptions as cf,ENHANCER_POSITION as cg,pick as ch,Slider$2 as ci,ChevronLeft as cj,ChevronRight as ck,isInForm as cl,TextInput$1 as cm,ThemeProvider$1 as cn,createThemedStyled as co,createThemedUseStyletron as cp,createThemedWithStyle as cq,expandBorderStyles as cr,withStyle as cs,getAugmentedNamespace as ct,requireReactIs$1 as cu,NumberInput$1 as cv,requireReact as d,requirePropTypes as e,requireClassnames as f,getDefaultExportFromCjs$1 as g,require_root as h,isPropValid as i,jsx$1 as j,keyframes as k,requireIsObject as l,requireToNumber as m,newStyled as n,require_Set as o,require_setToArray as p,require_SetCache as q,reactExports as r,require_arrayIncludes as s,require_cacheHas as t,require_arrayIncludesWith as u,requireFlatten as v,groupBy as w,__vitePreload as x,useTheme as y,convertRemToPx as z};
811
+ `);return jsx$1("div",{"data-testid":"stClearCacheDialog",children:jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:"Clear caches"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitMarkdown$1,{source:e,allowHTML:!1})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:ye.onClose,children:"Cancel"}),jsx$1(ModalButton,{autoFocus:!0,kind:BaseButtonKind.SECONDARY,onClick:ye.confirmCallback,children:"Clear caches"})]})]})})}function scriptCompileErrorDialog(ye){var $;return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,size:"auto",autoFocus:!1,children:[jsx$1(ModalHeader,{children:"Script execution error"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitSyntaxHighlighter$1,{showLineNumbers:!1,wrapLines:!1,children:($=ye.exception)!=null&&$.message?ye.exception.message:"No message"})}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:ye.onClose,children:"Close"})})]})}function settingsDialog(ye){return jsx$1(SettingsDialog,{...ye})}function warningDialog(ye){return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:ye.title}),jsx$1(ModalBody$1,{children:ye.msg})]})}function deployErrorDialog({title:ye,msg:$,onClose:e,onContinue:Y,onTryAgain:Me}){const Ae=()=>{e(),Y&&Y()};return jsxs(Modal,{isOpen:!0,onClose:e,children:[jsx$1(ModalHeader,{children:ye}),jsx$1(ModalBody$1,{children:jsx$1(StyledDeployErrorContent,{children:$})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:Me,children:"Try again"}),jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:Ae,children:Y?"Continue anyway":"Close"})]})]})}function noDialog({onClose:ye}){return jsx$1(Modal,{isOpen:!1,onClose:ye})}function typeNotRecognizedDialog(ye){return jsx$1(Modal,{isOpen:!0,onClose:ye.onClose,children:jsx$1(ModalBody$1,{children:`Dialog type "${ye.type}" not recognized.`})})}class SessionEventDispatcher{constructor(){this.onSessionEvent=new distExports.Signal}handleSessionEventMsg($){this.onSessionEvent.emit($)}}var _baseSet,hasRequired_baseSet;function require_baseSet(){if(hasRequired_baseSet)return _baseSet;hasRequired_baseSet=1;var ye=require_assignValue(),$=require_castPath(),e=require_isIndex(),Y=requireIsObject(),Me=require_toKey();function Ae(Se,ve,ze,Te){if(!Y(Se))return Se;ve=$(ve,Se);for(var we=-1,De=ve.length,Ie=De-1,Ce=Se;Ce!=null&&++we<De;){var Ne=Me(ve[we]),qe=ze;if(Ne==="__proto__"||Ne==="constructor"||Ne==="prototype")return Se;if(we!=Ie){var Le=Ce[Ne];qe=Te?Te(Le,Ne,Ce):void 0,qe===void 0&&(qe=Y(Le)?Le:e(ve[we+1])?[]:{})}ye(Ce,Ne,qe),Ce=Ce[Ne]}return Se}return _baseSet=Ae,_baseSet}var _basePickBy,hasRequired_basePickBy;function require_basePickBy(){if(hasRequired_basePickBy)return _basePickBy;hasRequired_basePickBy=1;var ye=require_baseGet(),$=require_baseSet(),e=require_castPath();function Y(Me,Ae,Se){for(var ve=-1,ze=Ae.length,Te={};++ve<ze;){var we=Ae[ve],De=ye(Me,we);Se(De,we)&&$(Te,e(we,Me),De)}return Te}return _basePickBy=Y,_basePickBy}var _basePick,hasRequired_basePick;function require_basePick(){if(hasRequired_basePick)return _basePick;hasRequired_basePick=1;var ye=require_basePickBy(),$=requireHasIn();function e(Y,Me){return ye(Y,Me,function(Ae,Se){return $(Y,Se)})}return _basePick=e,_basePick}var pick_1,hasRequiredPick;function requirePick(){if(hasRequiredPick)return pick_1;hasRequiredPick=1;var ye=require_basePick(),$=require_flatRest(),e=$(function(Y,Me){return Y==null?{}:ye(Y,Me)});return pick_1=e,pick_1}var pickExports=requirePick();const pick=getDefaultExportFromCjs$1(pickExports),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json",log$1=loglevelExports$1.getLogger("MetricsManager");class MetricsManager{constructor($){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId="",this.pendingEvents=[],this.appHash="Not initialized",this.metadata={},this.setAppHash=e=>{this.appHash=e},this.setMetricsConfig=(e="")=>{this.metricsUrl=e},this.sessionInfo=$}async initialize({gatherUsageStats:$,sendMessageToHost:e}){this.sendMessageToHost=e,this.actuallySendMetrics=$&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(log$1.error("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),log$1.info("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue($,e={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([$,e]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send($,e))}setMetadata($){this.metadata=$}async requestDefaultMetricsConfig(){const $=p$3();if($){const e=window.localStorage.getItem("stMetricsConfig");if(e){this.metricsUrl=e;return}}try{const e=await fetch(DEFAULT_METRICS_CONFIG,{signal:AbortSignal.timeout(5e3)});if(!e.ok)this.metricsUrl=void 0,log$1.error("Failed to fetch metrics config: ",e.status);else{const Y=await e.json();this.metricsUrl=Y.url??void 0,$&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(e){log$1.error("Failed to fetch metrics config:",e)}}send($,e={}){const Y=this.buildEventProto($,e);this.metricsUrl==="postMessage"?this.postMessageEvent($,Y):this.track(Y)}sendPendingEvents(){this.pendingEvents.forEach(([$,e])=>{this.send($,e)}),this.pendingEvents=[]}async track($){const e=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($.toJSON())});await fetch(e)}postMessageEvent($,e){this.sendMessageToHost({type:"METRICS_EVENT",eventName:$,data:e})}buildEventProto($,e){const Y=new MetricsEvent({event:$,anonymousId:this.anonymousId,...this.getHostTrackingData(),...this.getInstallationData(),reportHash:this.appHash,dev:IS_DEV_ENV,source:"browser",streamlitVersion:this.sessionInfo.current.streamlitVersion,isHello:this.sessionInfo.isHello,...this.getContextData()});if($==="menuClick")Y.label=e.label;else if($==="pageProfile")return new MetricsEvent({...Y,...e});return Y}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3}}getHostTrackingData(){return this.metadata?pick(this.metadata,["hostedAt","owner","repo","branch","mainModule","creatorId"]):{}}getContextData(){return{contextPageUrl:window.location.href,contextPageTitle:document.title,contextPagePath:window.location.pathname,contextPageReferrer:document.referrer,contextPageSearch:window.location.search,contextLocale:window.navigator.language,contextUserAgent:window.navigator.userAgent}}getAnonymousId(){if(!this.actuallySendMetrics)return;const $="ajs_anonymous_id",e=p$3(),Y=f$2($),Me=e?window.localStorage.getItem($):null,Ae=new Date;if(Ae.setFullYear(new Date().getFullYear()+1),Y)this.anonymousId=Y,e&&window.localStorage.setItem($,Y);else if(Me){try{this.anonymousId=JSON.parse(Me)}catch{this.anonymousId=Me}setCookie($,this.anonymousId,Ae)}else this.anonymousId=v4(),setCookie($,this.anonymousId,Ae),e&&window.localStorage.setItem($,this.anonymousId)}}const StyledApp=newStyled("div",{target:"ee4bbma0"})(({theme:ye})=>{const $=hasLightBackgroundColor(ye);return{position:"absolute",background:ye.colors.bgColor,color:ye.colors.bodyText,top:ye.spacing.none,left:ye.spacing.none,right:ye.spacing.none,bottom:ye.spacing.none,colorScheme:$?"light":"dark",overflow:"hidden","@media print":{float:"none",height:ye.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"ej964cx0"})({margin:0}),StyledInstruction=newStyled("p",{target:"ej964cx1"})({margin:0}),ScreencastDialog=({onClose:ye,toggleRecordAudio:$,recordAudio:e,startRecording:Y})=>{const[Me,Ae]=reactExports.useState(e),Se=reactExports.useCallback(ze=>{const{checked:Te}=ze.target;Te!==Me&&(Ae(Te),$())},[Me,$]),ve=reactExports.useCallback(()=>{Y(),ye()},[Y,ye]);return jsxs(Modal,{isOpen:!0,onClose:ye,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsxs(ModalBody$1,{children:[jsx$1("p",{children:"This will record a video with the contents of your screen, so you can easily share what you're seeing with others."}),jsx$1("p",{children:jsxs(StyledRecordAudioLabel,{"data-testid":"stScreencastAudioCheckbox",children:[jsx$1("input",{type:"checkbox",name:"recordAudio",checked:Me,onChange:Se})," ","Also record audio"]})}),jsx$1(StyledInstruction,{"data-testid":"stScreencastInstruction",children:jsx$1(StreamlitMarkdown$1,{source:"Press `Esc` any time to stop recording.",allowHTML:!1})})]}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:ve,children:"Start recording!"})})]})},StyledVideo=newStyled("video",{target:"emkt0dj0"})(({theme:ye})=>({width:ye.sizes.full,borderRadius:ye.radii.md})),StyledDialogContainer=newStyled("div",{target:"emkt0dj1"})(({theme:ye})=>({display:"flex",flexDirection:"column",width:ye.sizes.full})),StyledRow=newStyled("div",{target:"emkt0dj2"})(({theme:ye})=>({display:"flex",flexDirection:"row",paddingTop:ye.spacing.md,paddingBottom:ye.spacing.md})),StyledFirstColumn=newStyled("div",{target:"emkt0dj3"})(({theme:ye})=>({paddingRight:ye.spacing.lg,textAlign:"right",color:ye.colors.gray,fontWeight:ye.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"emkt0dj4"})(({theme:ye})=>({flex:1,paddingRight:ye.spacing.lg,marginRight:"6em",[`@media (max-width: ${ye.breakpoints.sm})`]:{marginRight:ye.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"emkt0dj5"})(({theme:ye})=>({marginTop:ye.spacing.sm,marginBottom:ye.spacing.none,fontSize:ye.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"emkt0dj6"})(({theme:ye})=>({marginTop:ye.spacing.twoXS})),VideoRecordedDialog=({onClose:ye,videoBlob:$,fileName:e})=>{const Y=URL.createObjectURL($),Me=()=>{const Ae=document.createElement("a");Ae.setAttribute("href",Y),Ae.setAttribute("download",`${e}.webm`),Ae.click(),ye()};return jsxs(Modal,{isOpen:!0,onClose:ye,overrides:{Dialog:{style:{width:"80vw"}}},children:[jsx$1(ModalHeader,{children:"Next steps"}),jsx$1(ModalBody$1,{children:jsxs(StyledDialogContainer,{"data-testid":"stVideoRecordedDialog",children:[jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 1"}),jsxs(StyledSecondColumn,{children:[jsx$1("p",{children:"Preview your video below:"}),jsx$1(StyledVideo,{src:Y,controls:!0})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 2"}),jsxs(StyledSecondColumn,{children:[jsx$1(StyledDownloadButtonContainer,{children:jsx$1(BaseButton,{kind:BaseButtonKind.SECONDARY,onClick:Me,children:"Save video to disk"})}),jsxs(StyledVideoFormatInstructions,{children:["This video is encoded in the"," ",jsx$1("a",{href:"https://www.webmproject.org/",children:"WebM format"}),", which is only supported by newer video players. You can also play it by dragging the file directly into your browser."]})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 3"}),jsxs(StyledSecondColumn,{children:["Share your video with the world on Twitter, LinkedIn, YouTube, or just plain email!"," ",jsx$1("span",{role:"img","aria-label":"Happy",children:"😀"})]})]})]})})]})},StyledScreenCastWarningDialog=newStyled("div",{target:"e1o5y2010"})({display:"flex"}),StyledUnsupportedScreenCastIcon=newStyled("div",{target:"e1o5y2011"})(({theme:ye})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:ye.spacing.twoXL,marginLeft:ye.spacing.sm,fontSize:ye.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1o5y2012"})(({theme:ye})=>({margin:ye.spacing.none})),UnsupportedBrowserDialog=({onClose:ye})=>jsxs(Modal,{isOpen:!0,onClose:ye,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsx$1(ModalBody$1,{children:jsxs(StyledScreenCastWarningDialog,{"data-testid":"stUnsupportedBrowserDialog",children:[jsx$1(StyledUnsupportedScreenCastIcon,{children:jsx$1("span",{role:"img","aria-label":"Alien Monster",children:"👾"})}),jsx$1(StyledUnsupportedScreenCastExplanation,{children:"Due to limitations with some browsers, this feature is only supported on recent desktop versions of Chrome, Firefox, and Edge."})]})})]}),UnsupportedBrowserDialog$1=reactExports.memo(UnsupportedBrowserDialog),screencastCounterAnimation=keyframes("0%{opacity:0;}25%{opacity:1;}100%{opacity:0;}"),StyledCountdown=newStyled("div",{target:"evez3ra0"})(({theme:ye})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:ye.sizes.full,height:ye.sizes.full,fontSize:"40vh",color:ye.colors.red,fontWeight:ye.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${ye.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:ye,endCallback:$})=>{const[e,Y]=reactExports.useState(ye);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const Ae=e-1;Ae>=0&&Y(Ae),Ae===0&&$()},children:jsx$1("span",{children:e})},`frame${e}`)},log=loglevelExports$1.getLogger("withScreencast");function withScreencast(ye){const $=e=>{const{testOverride:Y}=e,Me=reactExports.useRef(null),[Ae,Se]=reactExports.useState("streamlit-screencast"),[ve,ze]=reactExports.useState(!1),[Te,we]=reactExports.useState(void 0),[De,Ie]=reactExports.useState(Y||"OFF"),Ce=reactExports.useCallback(()=>{ze(Ue=>!Ue)},[]),Ne=reactExports.useCallback(async()=>{if(!(De==="OFF"||m$3(Me.current))){if(De==="COUNTDOWN"){Ie("OFF");return}if(De==="RECORDING"){const Ue=Me.current;if(!Ue||Ue.getState()==="inactive")Ie("OFF");else{const Ge=await Ue.stop();we(Ge),Ie("PREVIEW_FILE")}}}},[De]),qe=reactExports.useCallback(async()=>{if(!ScreenCastRecorder.isSupportedBrowser()){Ie("UNSUPPORTED");return}Me.current=new ScreenCastRecorder({recordAudio:ve,onErrorOrStop:()=>{Ne().catch(Ue=>log.warn(`withScreencast.stopRecording threw an error: ${Ue}`))}});try{await Me.current.initialize()}catch(Ue){log.warn(`ScreenCastRecorder.initialize error: ${Ue}`),Ie("UNSUPPORTED");return}Ie("COUNTDOWN")},[ve,Ne]),Le=reactExports.useCallback(Ue=>{if(!ScreenCastRecorder.isSupportedBrowser()){Ie("UNSUPPORTED");return}if(De==="OFF"){Se(Ue),Ie("SETUP");return}Ne().catch(Ge=>log.warn(`withScreencast.stopRecording threw an error: ${Ge}`))},[De,Ne]),Fe=reactExports.useCallback(async()=>{if(m$3(Me.current))throw new Error("Countdown finished but recorder is null");Me.current.start()?Ie("RECORDING"):Ne().catch(Ge=>log.warn(`withScreencast.stopRecording threw an error: ${Ge}`))},[Ne]),We=reactExports.useCallback(()=>{Ie("OFF")},[]);return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(ye,{...e,screenCast:{currentState:De,toggleRecordAudio:Ce,startRecording:Le,stopRecording:Ne}}),De==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:We}),De==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:ve,onClose:We,startRecording:qe,toggleRecordAudio:Ce}),De==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:Fe}),De==="PREVIEW_FILE"&&Te&&jsx$1(VideoRecordedDialog,{onClose:We,videoBlob:Te,fileName:Ae})]})};return $.displayName=`withScreencast(${ye.displayName||ye.name||"Component"})`,hoistNonReactStatics($,ye)}const showDevelopmentOptions=(ye,$)=>$==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==$||Config.ToolbarMode.MINIMAL==$?!1:ye||isLocalhost();function getTitle(ye){return ye||"Streamlit"}class StrategyV1{constructor($){this.appNav=$,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession($){var Se,ve;this.appPages=$.appPages,this.currentPageScriptHash=$.pageScriptHash,this.hideSidebarNav=((Se=$.config)==null?void 0:Se.hideSidebarNav)??!1;const e=this.appPages[0],Y=e.urlPathname??"",Me=((ve=this.appPages.find(ze=>ze.pageScriptHash===this.currentPageScriptHash))==null?void 0:ve.urlPathname)??"",Ae=e.pageScriptHash===this.currentPageScriptHash;return this.appNav.onUpdatePageUrl(Y,Me,Ae),document.title=getTitle(Me??""),[{hideSidebarNav:this.hideSidebarNav,appPages:this.appPages,currentPageScriptHash:this.currentPageScriptHash},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:this.appPages}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:Ae?"":Me,currentPageScriptHash:this.currentPageScriptHash})}]}handlePagesChanged($){const{appPages:e}=$;return[{appPages:e},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:e})}]}handlePageNotFound($){var Me;const{pageName:e}=$;this.appNav.onPageNotFound(e);const Y=((Me=this.appPages[0])==null?void 0:Me.pageScriptHash)??"";return this.currentPageScriptHash=Y,[{currentPageScriptHash:Y},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:Y})}]}handleNavigation($){}findPageByUrlPath($){return this.appPages.length===0?null:this.appPages.find(e=>$.endsWith("/"+e.urlPathname))??this.appPages[0]}clearPageElements($,e,Y){return AppRoot.empty(e,!1,Y,$.logo)}}class StrategyV2{constructor($){this.appNav=$,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession($){var e;return this.mainScriptHash=$.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((e=$.config)==null?void 0:e.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged($){}handlePageNotFound($){const{pageName:e}=$;return this.appNav.onPageNotFound(e),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation($){const{sections:e,position:Y,appPages:Me}=$;this.appPages=Me,this.hideSidebarNav=Y===Navigation.Position.HIDDEN;const Ae=$.pageScriptHash,Se=Me.find(Te=>Te.pageScriptHash===Ae),ve=Me.find(Te=>Te.isDefault);this.mainPage=ve;const ze=Se.urlPathname;if(!this.appNav.isPageTitleSet){const Te=getTitle(Se.pageName);document.title=Te,this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:Se.pageName??""})}return!this.appNav.isPageIconSet&&Se.icon&&this.appNav.onPageIconChange(Se.icon),this.appNav.onUpdatePageUrl(ve.urlPathname??"",ze,Se.isDefault??!1),[{appPages:Me,navSections:e,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:$.expanded,currentPageScriptHash:Ae},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:Me}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:Se.isDefault?"":ze,currentPageScriptHash:Ae})}]}findPageByUrlPath($){return this.appPages.find(e=>$.endsWith("/"+e.urlPathname))??this.mainPage}clearPageElements($,e,Y){return $.filterMainScriptElements(e)}}class AppNavigation{constructor($,e,Y,Me){this.hostCommunicationMgr=$,this.onUpdatePageUrl=e,this.onPageNotFound=Y,this.onPageIconChange=Me,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession($){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession($)}handleNavigation($){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation($)}handlePagesChanged($){return this.strategy.handlePagesChanged($)}handlePageNotFound($){return this.strategy.handlePageNotFound($)}findPageByUrlPath($){return this.strategy.findPageByUrlPath($)}handlePageConfigChanged($){this.isPageIconSet=!!$.favicon,this.isPageTitleSet=!!$.title}clearPageElements($,e,Y){return this.strategy.clearPageElements($,e,Y)}}var define_PACKAGE_METADATA_default={version:"1.42.1"};const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>",LOG=loglevelExports$1.getLogger("App");class App extends reactExports.PureComponent{constructor($){super($),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(Y,Me,Ae)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:Y,msg:Me,onContinue:Ae,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(Y,Me)=>{const[,Ae,Se]=createPresetThemes(),ve=isPresetTheme(this.props.theme.activeTheme);Y===Ae.name&&ve?this.props.theme.setTheme(Ae):Y===Se.name&&ve?this.props.theme.setTheme(Se):Me&&this.props.theme.setImportedTheme(Me)},this.handleConnectionStateChanged=Y=>{if(LOG.info(`Connection state changed from ${this.state.connectionState} to ${Y}`),Y===ConnectionState.CONNECTED){LOG.info("Reconnected to server.");const Me=this.state.scriptRunState===ScriptRunState.RUNNING,Ae=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED;(!this.sessionInfo.last||Me||Ae)&&(LOG.info("Requesting a script run."),this.widgetMgr.sendUpdateWidgetsMessage(void 0),this.setState({dialog:null})),this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_CONNECTED"})}else this.state.connectionState===ConnectionState.CONNECTED&&this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_DISCONNECTED",attemptingToReconnect:Y!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:Y})},this.handleGitInfoChanged=Y=>{this.setState({gitInfo:Y})},this.handleCustomParentMessage=Y=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:Y.message}):LOG.error("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=Y=>{const Me=(Ae,Se,ve)=>{const ze=Ae[Se];if(ze in ve)return ve[ze](Ae[ze]);throw new Error(`Cannot handle ${Se} "${ze}".`)};try{Me(Y,"type",{newSession:Ae=>this.handleNewSession(Ae),sessionStatusChanged:Ae=>this.handleSessionStatusChanged(Ae),sessionEvent:Ae=>this.handleSessionEvent(Ae),delta:Ae=>this.handleDeltaMsg(Ae,Y.metadata),pageConfigChanged:Ae=>this.handlePageConfigChanged(Ae),pageInfoChanged:Ae=>this.handlePageInfoChanged(Ae),pagesChanged:Ae=>this.handlePagesChanged(Ae),pageNotFound:Ae=>this.handlePageNotFound(Ae),gitInfoChanged:Ae=>this.handleGitInfoChanged(Ae),scriptFinished:Ae=>this.handleScriptFinished(Ae),pageProfile:Ae=>this.handlePageProfileMsg(Ae),autoRerun:Ae=>this.handleAutoRerun(Ae),fileUrlsResponse:Ae=>this.uploadClient.onFileURLsResponse(Ae),parentMessage:Ae=>this.handleCustomParentMessage(Ae),logo:Ae=>this.handleLogo(Ae,Y.metadata),navigation:Ae=>this.handleNavigation(Ae),authRedirect:Ae=>{isInChildFrame()?this.hostCommunicationMgr.sendMessageToSameOriginHost({type:"REDIRECT_TO_URL",url:Ae.url}):window.location.href=Ae.url}})}catch(Ae){const Se=ensureError(Ae);LOG.error(Se),this.showError("Bad message format",Se.message)}},this.handleLogo=(Y,Me)=>{const Ae={activeScriptHash:Me.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(Y,Ae)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=Y=>{const{title:Me,favicon:Ae,layout:Se,initialSidebarState:ve,menuItems:ze}=Y;this.appNavigation.handlePageConfigChanged(Y),Me&&(this.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:Me}),document.title=Me),Ae&&this.onPageIconChanged(Ae),Se!==this.state.layout&&this.setState(Te=>({layout:Se,userSettings:{...Te.userSettings,wideMode:Se===PageConfig.Layout.WIDE}})),ve!==this.state.initialSidebarState&&this.setState(()=>({initialSidebarState:ve})),this.setState({menuItems:ze})},this.handlePageInfoChanged=Y=>{const{queryString:Me}=Y,Ae=document.location.pathname+(Me?`?${Me}`:"");window.history.pushState({},"",Ae),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:Me?`?${Me}`:""})},this.onPageNotFound=Y=>{const Me=Y?`You have requested page /${Y}, but no corresponding file was found in the app's pages/ directory`:"The page that you have requested does not seem to exist";this.showError("Page not found",`${Me}. Running the app's main page.`)},this.handlePageNotFound=Y=>{this.maybeSetState(this.appNavigation.handlePageNotFound(Y))},this.onPageIconChanged=Y=>{handleFavicon(Y,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=Y=>{this.maybeSetState(this.appNavigation.handlePagesChanged(Y))},this.handleNavigation=Y=>{this.maybeSetState(this.appNavigation.handleNavigation(Y))},this.handlePageProfileMsg=Y=>{var Se,ve,ze;const Me=PageProfile.toObject(Y),Ae=getBrowserInfo();this.metricsMgr.enqueue("pageProfile",{...Me,isFragmentRun:!!Me.isFragmentRun,appId:this.sessionInfo.current.appId,numPages:(Se=this.state.appPages)==null?void 0:Se.length,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,pageScriptHash:this.state.currentPageScriptHash,activeTheme:(ze=(ve=this.props.theme)==null?void 0:ve.activeTheme)==null?void 0:ze.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:Ae})},this.handleAutoRerun=Y=>{const Me=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(Y.fragmentId,!0)},Y.interval*1e3);this.setState(Ae=>({autoReruns:[...Ae.autoReruns,Me]}))},this.handleSessionStatusChanged=Y=>{this.setState(Me=>{let{scriptRunState:Ae}=Me,{dialog:Se}=Me;return Y.scriptIsRunning&&Me.scriptRunState!==ScriptRunState.STOP_REQUESTED?(Ae=ScriptRunState.RUNNING,d$2(Se)&&Se.type===DialogType.SCRIPT_COMPILE_ERROR&&(Se=void 0)):!Y.scriptIsRunning&&Me.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&Me.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(Ae=ScriptRunState.NOT_RUNNING),{userSettings:{...Me.userSettings,runOnSave:!!Y.runOnSave},dialog:Se,scriptRunState:Ae}})},this.handleSessionEvent=Y=>{if(this.sessionEventDispatcher.handleSessionEventMsg(Y),Y.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const Me={type:DialogType.SCRIPT_COMPILE_ERROR,exception:Y.scriptCompilationException,onClose:()=>{}};this.openDialog(Me)}},this.maybeUpdatePageUrl=(Y,Me,Ae)=>{const Se=this.getBaseUriParts();if(Se){const{pathname:ve}=Se,ze=extractPageNameFromPathName(document.location.pathname,ve);if((ze===""?Y:ze)!==Me){const we=Ae?"":Me,De=preserveEmbedQueryParams(),Ie=De?`?${De}`:"",Ne=`${ve==="/"?"":ve}/${we}${Ie}`;window.history.pushState({},"",Ne)}}},this.handleNewSession=Y=>{const Me=Y.initialize;if(this.hasStreamlitVersionChanged(Me)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(Y);const{appHash:Ae,currentPageScriptHash:Se}=this.state,{scriptRunId:ve,name:ze,mainScriptPath:Te,fragmentIdsThisRun:we,pageScriptHash:De,mainScriptHash:Ie}=Y;if(we.length)this.setState({fragmentIdsThisRun:we,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const Ne=Y.config,qe=Y.customTheme;this.processThemeInput(qe),this.setState({allowRunOnSave:Ne.allowRunOnSave,hideTopBar:Ne.hideTopBar,toolbarMode:Ne.toolbarMode,latestRunTime:performance.now(),mainScriptHash:Ie,fragmentIdsThisRun:we}),this.maybeSetState(this.appNavigation.handleNewSession(Y)),this.onPageIconChanged("./favicon.png")}const Ce=hashString(this.sessionInfo.current.installationId+Te);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(Ce),this.metricsMgr.enqueue("updateReport"),Ae===Ce&&Se===De?this.setState({scriptRunId:ve}):this.clearAppState(Ce,ve,ze,Ie)},this.handleOneTimeInitialization=Y=>{const Me=Y.initialize,Ae=Y.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(Y)),this.metricsMgr.initialize({gatherUsageStats:Ae.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(Me.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:Y}=this.state,Me=this.appNavigation.findPageByUrlPath(document.location.pathname),Ae=document.location.toString().includes("#"),Se=(Me==null?void 0:Me.pageScriptHash)===Y;m$3(Me)||Ae&&Se||this.onPageChange(Me.pageScriptHash)},this.setAndSendTheme=Y=>{this.props.theme.setTheme(Y),this.setState({hideColoredLine:!isPresetTheme(Y)}),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(Y.emotion)})},this.createThemeHash=Y=>{if(!Y)return"hash_for_undefined_custom_theme";const Me=Object.entries(Y);return Me.sort(),hashString(Me.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=Y=>{const{runOnSave:Me}=this.state.userSettings,{runOnSave:Ae}=Y;if(this.setState({userSettings:Y}),Me!==Ae&&this.isServerConnected()){const Se=new BackMsg$1({setRunOnSave:Ae});Se.type="setRunOnSave",this.sendBackMsg(Se)}},this.handleDeltaMsg=(Y,Me)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,Y,Me),!this.pendingElementsTimerRunning){this.pendingElementsTimerRunning=!0;const Ae=this.state.scriptRunState===ScriptRunState.RUNNING;setTimeout(()=>{this.pendingElementsTimerRunning=!1,Ae&&this.setState({elements:this.pendingElementsBuffer})},ELEMENT_LIST_BUFFER_TIMEOUT_MS)}},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({debugShutdownRuntime:!0});Y.type="debugShutdownRuntime",this.sendBackMsg(Y)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({debugDisconnectWebsocket:!0});Y.type="debugDisconnectWebsocket",this.sendBackMsg(Y)}},this.debugClearForwardMsgCache=()=>{var Y,Me;isLocalhost()&&((Me=(Y=this.connectionManager)==null?void 0:Y.websocketConnection)==null||Me.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(Y=>{clearInterval(Y)}),this.setState({autoReruns:[]})},this.rerunScript=(Y=!1)=>{if(this.closeDialog(),!this.isServerConnected()){LOG.error("Cannot rerun script when disconnected from server.");return}this.state.scriptRunState===ScriptRunState.RUNNING||this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||(this.setState({scriptRunState:ScriptRunState.RERUN_REQUESTED}),Y===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){LOG.error("Cannot load git information when disconnected from server.");return}this.sendBackMsg(new BackMsg$1({loadGitInfo:!0}))},this.onPageChange=Y=>{const{elements:Me,mainScriptHash:Ae}=this.state;this.cleanupAutoReruns();const Se=this.appNavigation.clearPageElements(Me,Ae,void 0),ve=new Set(Array.from(Se.getElements()).map(ze=>getElementId(ze)).filter(notUndefined));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(ve),void 0,Y)},this.isAppInReadyState=Y=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&Y.scriptRunState===ScriptRunState.RUNNING&&Y.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(Y,Me,Ae,Se)=>{const ve=this.getBaseUriParts();if(!ve){LOG.error("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ze}=this.state,{pathname:Te}=ve;let we=this.getQueryString(),De="";Ae?Ae!=ze&&(we=preserveEmbedQueryParams(),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:we})):ze?Ae=ze:(De=extractPageNameFromPathName(document.location.pathname,Te),Ae=""),this.sendBackMsg(new BackMsg$1({rerunScript:{queryString:we,widgetStates:Y,pageScriptHash:Ae,pageName:De,fragmentId:Me,isAutoRerun:Se}}))},this.stopScript=()=>{if(!this.isServerConnected()){LOG.error("Cannot stop app when disconnected from server.");return}if(this.state.scriptRunState===ScriptRunState.NOT_RUNNING||this.state.scriptRunState===ScriptRunState.STOP_REQUESTED)return;const Y=new BackMsg$1({stopScript:!0});Y.type="stopScript",this.sendBackMsg(Y),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const Y={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(Y)}else LOG.error("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var Me;const Y={type:DialogType.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:((Me=this.state.dialog)==null?void 0:Me.type)===DialogType.DEPLOY_ERROR,metricsMgr:this.metricsMgr};this.openDialog(Y)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const Y={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(Y)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const Y=new BackMsg$1({clearCache:!0});Y.type="clearCache",this.sendBackMsg(Y)}else LOG.error("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({appHeartbeat:!0});Y.type="appHeartbeat",this.sendBackMsg(Y)}else LOG.error("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=Y=>{this.connectionManager?(LOG.info(Y),this.connectionManager.sendMessage(Y)):LOG.error(`Not connected. Cannot send back message: ${Y}`)},this.handleConnectionError=Y=>{this.showError("Connection error",Y)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(Y=!0)=>{const Me={type:DialogType.SETTINGS,isServerConnected:this.isServerConnected(),settings:this.state.userSettings,allowRunOnSave:this.state.allowRunOnSave,onSave:this.saveSettings,onClose:()=>{},developerMode:showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),openThemeCreator:this.openThemeCreatorDialog,animateModal:Y,metricsMgr:this.metricsMgr};this.openDialog(Me)},this.aboutCallback=()=>{const{menuItems:Y}=this.state,Me={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:Y==null?void 0:Y.aboutSectionMd};this.openDialog(Me)},this.printCallback=()=>{const{scriptRunState:Y}=this.state;if(Y!==ScriptRunState.NOT_RUNNING){setTimeout(this.printCallback,500);return}let Me;try{const Ae=getIFrameEnclosingApp(this.embeddingId);Ae&&Ae.contentWindow?Me=Ae.contentWindow.window:Me=window}catch{Me=window}finally{Me||(Me=window),Me.print()}},this.screencastCallback=()=>{const{scriptName:Y}=this.state,{startRecording:Me}=this.props.screenCast,Ae=hooks().format("YYYY-MM-DD-HH-MM-SS");Me(`streamlit-${Y}-${Ae}`)},this.handleFullScreen=Y=>{this.setState({isFullScreen:Y})},this.setLibConfig=Y=>{this.setState({libConfig:Y})},this.setAppConfig=Y=>{this.setState({appConfig:Y})},this.addScriptFinishedHandler=Y=>{this.setState((Me,Ae)=>({scriptFinishedHandlers:Me.scriptFinishedHandlers.concat(Y)}))},this.removeScriptFinishedHandler=Y=>{this.setState((Me,Ae)=>({scriptFinishedHandlers:without(Me.scriptFinishedHandlers,Y)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:Y}=this.state,Me=Y&&Y.length>0?Y:document.location.search;return Me.startsWith("?")?Me.substring(1):Me},this.isInCloudEnvironment=()=>{const{hostMenuItems:Y}=this.state;return Y&&(Y==null?void 0:Y.length)>0},this.showDeployButton=()=>showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&!this.isInCloudEnvironment()&&this.sessionInfo.isSet&&!this.sessionInfo.isHello,this.deployButtonClicked=()=>{this.metricsMgr.enqueue("menuClick",{label:"deployButtonInApp"}),this.sendLoadGitInfoBackMsg(),this.openDeployDialog()},this.requestFileURLs=(Y,Me)=>{if(this.isServerConnected()){const Ae=new BackMsg$1({fileUrlsRequest:{requestId:Y,fileNames:Me.map(Se=>Se.name),sessionId:this.sessionInfo.current.sessionId}});Ae.type="fileUrlsRequest",this.sendBackMsg(Ae)}},this.handleKeyDown=Y=>{switch(Y){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=Y=>{Y==="esc"&&this.props.screenCast.stopRecording()},J$1();let e=this.createThemeHash();isPresetTheme($.theme.activeTheme)||(e=this.createThemeHash(toThemeInput($.theme.activeTheme.emotion))),this.state={connectionState:ConnectionState.INITIAL,elements:AppRoot.empty("",!0),isFullScreen:!1,scriptName:"",scriptRunId:INITIAL_SCRIPT_RUN_ID,appHash:null,scriptRunState:ScriptRunState.NOT_RUNNING,userSettings:{wideMode:!1,runOnSave:!1},layout:PageConfig.Layout.CENTERED,initialSidebarState:PageConfig.SidebarState.AUTO,menuItems:void 0,allowRunOnSave:!0,scriptFinishedHandlers:[],themeHash:e,gitInfo:null,formsData:createFormsData(),appPages:[],navSections:[],currentPageScriptHash:"",mainScriptHash:"",hideTopBar:!0,hideSidebarNav:!0,hideColoredLine:!1,expandSidebarNav:!1,toolbarMode:Config.ToolbarMode.MINIMAL,latestRunTime:performance.now(),fragmentIdsThisRun:[],isOwner:!1,hostMenuItems:[],hostToolbarItems:[],hostHideSidebarNav:!1,sidebarChevronDownshift:0,pageLinkBaseUrl:"",queryParams:"",deployedAppMetadata:{},libConfig:{},appConfig:{},autoReruns:[],inputsDisabled:!1},this.connectionManager=null,this.widgetMgr=new WidgetStateManager({sendRerunBackMsg:this.sendRerunBackMsg,formsDataChanged:Y=>this.setState({formsData:Y})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:$.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:Y=>{this.setState({inputsDisabled:Y})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:Y=>this.setState({isOwner:Y}),fileUploadClientConfigChanged:Y=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(Y)},hostMenuItemsChanged:Y=>{this.setState({hostMenuItems:Y})},hostToolbarItemsChanged:Y=>{this.setState({hostToolbarItems:Y})},hostHideSidebarNavChanged:Y=>{this.setState({hostHideSidebarNav:Y})},sidebarChevronDownshiftChanged:Y=>{this.setState({sidebarChevronDownshift:Y})},pageLinkBaseUrlChanged:Y=>{this.setState({pageLinkBaseUrl:Y})},queryParamsChanged:Y=>{this.setState({queryParams:Y})},deployedAppMetadataChanged:Y=>{this.setState({deployedAppMetadata:Y})},restartWebsocketConnection:()=>{this.connectionManager||(this.setState({scriptRunState:ScriptRunState.RERUN_REQUESTED}),this.initializeConnectionManager())},terminateWebsocketConnection:()=>{var Y;(Y=this.connectionManager)==null||Y.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:Y=>this.widgetMgr.setFormsWithUploadsInProgress(Y),requestFileURLs:this.requestFileURLs}),this.componentRegistry=new ComponentRegistry(this.endpoints),this.pendingElementsTimerRunning=!1,this.pendingElementsBuffer=this.state.elements,this.appNavigation=new AppNavigation(this.hostCommunicationMgr,this.maybeUpdatePageUrl,this.onPageNotFound,this.onPageIconChanged),window.streamlitDebug={clearForwardMsgCache:this.debugClearForwardMsgCache,disconnectWebsocket:this.debugDisconnectWebsocket,shutdownRuntime:this.debugShutdownRuntime}}initializeConnectionManager(){this.connectionManager=new ConnectionManager({getLastSessionId:()=>{var $;return($=this.sessionInfo.last)==null?void 0:$.sessionId},endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:$=>{const{allowedOrigins:e,useExternalAuthToken:Y,disableFullscreenMode:Me,enableCustomParentMessages:Ae,mapboxToken:Se,enforceDownloadInNewTab:ve,metricsUrl:ze}=$,Te={allowedOrigins:e,useExternalAuthToken:Y,enableCustomParentMessages:Ae},we={mapboxToken:Se,disableFullscreenMode:Me,enforceDownloadInNewTab:ve};this.metricsMgr.setMetricsConfig(ze),this.hostCommunicationMgr.setAllowedOrigins(Te),this.setAppConfig(Te),this.setLibConfig(we)}})}componentDidMount(){this.initializeConnectionManager(),mark(this.state.scriptRunState),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}),isScrollingHidden()&&document.body.classList.add("embedded"),isInChildFrame()&&(window.iFrameResizer={heightCalculationMethod:()=>{const $=document.querySelectorAll("[data-iframe-height]"),e=Array.from($).map(Y=>Math.ceil(Y.getBoundingClientRect().bottom));return Math.max(0,...e)}},__vitePreload(()=>import("./iframeResizer.contentWindow.CDWUcDmU.js").then($=>$.i),[],import.meta.url)),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(this.props.theme.activeTheme.emotion)}),this.metricsMgr.enqueue("viewReport"),window.addEventListener("popstate",this.onHistoryChange,!1)}componentDidUpdate($,e){window.prerenderReady===!1&&this.isAppInReadyState(e)&&(window.prerenderReady=!0),this.state.scriptRunState!==e.scriptRunState&&(mark(this.state.scriptRunState),this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&measure("script-run-cycle",ScriptRunState.RUNNING,ScriptRunState.NOT_RUNNING),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}))}componentWillUnmount(){var $;($=this.connectionManager)==null||$.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError($,e){LOG.error(e);const Y={type:DialogType.WARNING,title:$,msg:jsx$1(StreamlitMarkdown$1,{source:e,allowHTML:!1}),onClose:()=>{}};this.openDialog(Y)}hasStreamlitVersionChanged($){var Y;let e;if(((Y=window.__streamlit)==null?void 0:Y.ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION)===!0?e=define_PACKAGE_METADATA_default.version:this.sessionInfo.isSet&&(e=this.sessionInfo.current.streamlitVersion),e){const{environmentInfo:Me}=$;if(d$2(Me)&&d$2(Me.streamlitVersion))return e!=Me.streamlitVersion}return!1}maybeSetState($){if($){const[e,Y]=$;this.setState(e,Y)}}processThemeInput($){const e=this.createThemeHash($);if(e===this.state.themeHash)return;this.setState({themeHash:e});const Y=!isPresetTheme(this.props.theme.activeTheme);if($){const Me=createTheme(CUSTOM_THEME_NAME,$);this.props.theme.addThemes([Me]),(getCachedTheme()===null||Y)&&this.setAndSendTheme(Me)}else this.props.theme.addThemes([]),Y&&this.setAndSendTheme(getHostSpecifiedTheme());$!=null&&$.fontFaces&&this.props.theme.setImportedTheme($)}handleScriptFinished($){if($===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(e=>e())},0),$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:Y,fragmentIdsThisRun:Me})=>({elements:this.pendingElementsBuffer.clearStaleNodes(Y,Me)}),()=>{this.pendingElementsBuffer=this.state.elements});const e=new Set(Array.from(this.state.elements.getElements()).map(Y=>getElementId(Y)).filter(notUndefined));this.widgetMgr.removeInactive(e)}this.connectionManager!==null&&$!==ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState($,e,Y,Me){const{hideSidebarNav:Ae,elements:Se}=this.state,ve=Ae&&Se.sidebar||void 0;this.setState({scriptRunId:e,scriptName:Y,appHash:$,elements:this.appNavigation.clearPageElements(this.pendingElementsBuffer,Me,ve)},()=>{this.pendingElementsBuffer=this.state.elements;const ze=new Set(Array.from(this.state.elements.getElements()).map(Te=>getElementId(Te)).filter(notUndefined));this.widgetMgr.removeInactive(ze)})}openDialog($){this.setState({dialog:$})}render(){const{allowRunOnSave:$,connectionState:e,dialog:Y,elements:Me,initialSidebarState:Ae,menuItems:Se,isFullScreen:ve,scriptRunId:ze,scriptRunState:Te,userSettings:we,hideTopBar:De,hideSidebarNav:Ie,hideColoredLine:Ce,expandSidebarNav:Ne,currentPageScriptHash:qe,hostHideSidebarNav:Le,pageLinkBaseUrl:Fe,sidebarChevronDownshift:We,hostMenuItems:je,hostToolbarItems:Ue,libConfig:Ge,appConfig:He,inputsDisabled:Xe,appPages:st,navSections:Je}=this.state,Qe=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),rt=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":we.wideMode}),ut=Y?StreamlitDialog({...Y,onClose:this.closeDialog}):null,ft=Xe||e!==ConnectionState.CONNECTED;return jsx$1(AppContext.Provider,{value:{initialSidebarState:Ae,wideMode:we.wideMode,embedded:isEmbed(),showPadding:!isEmbed()||isPaddingDisplayed(),disableScrolling:isScrollingHidden(),showToolbar:!isEmbed()||isToolbarDisplayed(),showColoredLine:!Ce&&!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Fe,sidebarChevronDownshift:We,gitInfo:this.state.gitInfo,appConfig:He},children:jsx$1(LibContext.Provider,{value:{isFullScreen:ve,setFullScreen:this.handleFullScreen,addScriptFinishedHandler:this.addScriptFinishedHandler,removeScriptFinishedHandler:this.removeScriptFinishedHandler,activeTheme:this.props.theme.activeTheme,setTheme:this.setAndSendTheme,availableThemes:this.props.theme.availableThemes,addThemes:this.props.theme.addThemes,onPageChange:this.onPageChange,currentPageScriptHash:qe,libConfig:Ge,fragmentIdsThisRun:this.state.fragmentIdsThisRun,locale:window.navigator.language},children:jsx$1(ReactHotkeys,{keyName:"r,c,esc",onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,children:jsxs(StyledApp,{className:rt,"data-testid":"stApp","data-test-script-state":ze==INITIAL_SCRIPT_RUN_ID?"initial":Te,"data-test-connection-state":e,children:[jsxs(Header,{children:[!De&&jsxs(Fragment,{children:[jsx$1(StatusWidget,{connectionState:e,sessionEventDispatcher:this.sessionEventDispatcher,scriptRunState:Te,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:$}),jsx$1(ToolbarActions,{hostToolbarItems:Ue,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,metricsMgr:this.metricsMgr})]}),this.showDeployButton()&&jsx$1(DeployButton,{onClick:this.deployButtonClicked.bind(this)}),jsx$1(MainMenu$1,{isServerConnected:this.isServerConnected(),quickRerunCallback:this.rerunScript,clearCacheCallback:this.openClearCacheDialog,settingsCallback:this.settingsCallback,aboutCallback:this.aboutCallback,printCallback:this.printCallback,screencastCallback:this.screencastCallback,screenCastState:this.props.screenCast.currentState,hostMenuItems:je,developmentMode:Qe,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:Se,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode})]}),jsx$1(AppView,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:Me,scriptRunId:ze,scriptRunState:Te,widgetMgr:this.widgetMgr,widgetsDisabled:ft,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:Me.logo,appPages:st,navSections:Je,onPageChange:this.onPageChange,currentPageScriptHash:qe,hideSidebarNav:Ie||Le,expandSidebarNav:Ne}),ut]})})})})}}const AppWithScreenCast=withScreencast(App);function useThemeManager(){const ye=getDefaultTheme(),[$,e]=reactExports.useState(ye),[Y,Me]=reactExports.useState([]),[Ae,Se]=reactExports.useState([...createPresetThemes(),...isPresetTheme(ye)?[]:[ye]]),ve=De=>{Se([...createPresetThemes(),...De])},ze=reactExports.useCallback(De=>{De!==$&&(e(De),De.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(De))},[e,$]),Te=reactExports.useCallback(()=>{$.name===AUTO_THEME_NAME&&ze(getHostSpecifiedTheme());const De=Ae.filter(Ie=>Ie.name!==AUTO_THEME_NAME);Se([createAutoTheme(),...De])},[$.name,Ae,ze]),we=reactExports.useCallback(De=>{De.fontFaces&&Me(De.fontFaces);const Ie=new CustomThemeConfig(De),Ce=createTheme(CUSTOM_THEME_NAME,Ie);ze(Ce)},[Me,ze]);return reactExports.useEffect(()=>{const De=window.matchMedia("(prefers-color-scheme: dark)");return De.addEventListener("change",Te),window.addEventListener("afterprint",Te),()=>{window.removeEventListener("afterprint",Te),De.removeEventListener("change",Te)}},[$,Ae,Te]),[{setTheme:ze,activeTheme:$,addThemes:ve,availableThemes:Ae,setImportedTheme:we},Y]}const ThemedApp=({streamlitExecutionStartedAt:ye})=>{const[$,e]=useThemeManager(),{activeTheme:Y}=$,Me=Y.name===CUSTOM_THEME_NAME&&e.length>0;return jsx$1(RootStyleProvider,{theme:Y,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[Me&&jsx$1(FontFaceDeclaration,{fontFaces:e}),jsx$1(AppWithScreenCast,{theme:$,streamlitExecutionStartedAt:ye})]})})})},streamlitExecutionStartedAt=Date.now(),engine=new StyletronClient({prefix:"st-"});ReactDOM.render(jsx$1(Provider$1,{value:engine,children:jsx$1(ThemedApp,{streamlitExecutionStartedAt})}),document.getElementById("root"));export{require_baseKeys as $,ACCESSIBILITY_TYPE as A,PLACEMENT as B,jsxs as C,hasLightBackgroundColor as D,EmotionIconBase as E,Fragment as F,DynamicIcon as G,Popover$2 as H,requireToString as I,require$$0 as J,m$3 as K,merge$3 as L,d$2 as M,numbro$1 as N,hooks as O,PortalContext as P,getTimezone as Q,React as R,moment as S,isUnsignedIntegerType as T,isIntegerType as U,isDurationType as V,isPeriodType as W,format as X,isBooleanType as Y,requireIsArray as Z,_extends$K as _,range as a,DEFAULT_IFRAME_FEATURE_POLICY as a$,require_getTag as a0,requireIsArguments as a1,requireIsArrayLike as a2,requireIsBuffer$1 as a3,require_isPrototype as a4,requireIsTypedArray as a5,Field as a6,Null as a7,DataFrameCellType as a8,isTimeType as a9,Resizable as aA,getBlue80 as aB,getSequentialColorsArray as aC,getDivergingColorsArray as aD,getCategoricalColorsArray as aE,getGray70 as aF,getGray30 as aG,debounce$3 as aH,Global as aI,require_baseMerge as aJ,require_createAssigner as aK,toaster as aL,Kind as aM,AlertElement$1 as aN,propTypesExports as aO,_assertThisInitialized as aP,StyledInlineCode as aQ,ErrorElement as aR,ensureError as aS,Skeleton$1 as aT,Skeleton as aU,hoistNonReactStatics as aV,lib$3 as aW,parseToRgba as aX,assertNever as aY,DeckGlJsonChart$1 as aZ,DEFAULT_IFRAME_SANDBOX_POLICY as a_,convertTimeToDate as aa,isDecimalType as ab,isRangeIndexType as ac,isStringType as ad,isEmptyType as ae,isDatetimeType as af,isDateType as ag,isObjectType as ah,isBytesType as ai,isNumericType as aj,isCategoricalType as ak,isListType as al,Arrow$2 as am,loglevelExports$1 as an,_defineProperty$n as ao,_objectWithoutProperties$f as ap,jsx as aq,_typeof$b as ar,css as as,transparentize as at,mix$1 as au,getStyledCell as av,isEqual as aw,StyledTooltipContentWrapper as ax,StreamlitMarkdown$1 as ay,LibContext as az,reactDomExports as b,classNames as b$,darken as b0,BaseButtonSize as b1,BaseButtonKind as b2,BaseButtonTooltip as b3,DynamicButtonLabel as b4,IsSidebarContext as b5,Placement as b6,getIncreasingGreen as b7,getDecreasingRed as b8,getGray90 as b9,StyledSpinnerIcon as bA,AcceptFileValue as bB,chatInputAcceptFileProtoValueToEnum as bC,isFocusVisible as bD,getOverride as bE,getOverrideProps as bF,StyledContent as bG,Checkbox$1 as bH,StyledCheckbox$1 as bI,BaseColorPicker$1 as bJ,useStyletron as bK,mergeOverride as bL,toObjectOverride as bM,Icon$1 as bN,requireReactDom as bO,UIDConsumer as bP,StatefulMenu as bQ,mergeOverrides as bR,ChevronDown$1 as bS,ThemeContext as bT,forkBlur as bU,forkFocus as bV,Select as bW,without as bX,fuzzyFilterSelectOptions as bY,VirtualDropdown as bZ,TYPE as b_,PlotlyChart$1 as ba,keysToSnakeCase as bb,WindowDimensionsContext as bc,Video$1 as bd,zip as be,FileUploaderState as bf,UploadedFileInfo as bg,StyledSpinner as bh,ENABLE_PERIPHERALS_DOCS_URL as bi,Icon$2 as bj,BaseButton as bk,blend as bl,labelVisibilityProtoValueToEnum as bm,TooltipIcon as bn,WidgetLabel as bo,Tooltip as bp,styled as bq,getOverrides as br,LocaleContext as bs,ButtonGroup$1 as bt,StyledWidgetLabelHelpInline as bu,LabelVisibilityMessage as bv,themeColors as bw,libExports as bx,CAMERA_PERMISSION_URL as by,StyledWidgetLabelHelp as bz,require_hasPath as c,UISelectbox as c0,isValidFormId as c1,toPropertyKey as c2,_setPrototypeOf$9 as c3,hexToRgb as c4,withWrapper as c5,__awaiter as c6,PropTypes as c7,isFromWindows as c8,StyledWidgetInstructions as c9,isFromMac as ca,SIZE$1 as cb,CUSTOM_INPUT_TYPE as cc,ADJOINED as cd,DeleteAlt$1 as ce,filterOptions as cf,ENHANCER_POSITION as cg,pick as ch,Slider$2 as ci,ChevronLeft as cj,ChevronRight as ck,isInForm as cl,TextInput$1 as cm,ThemeProvider$1 as cn,createThemedStyled as co,createThemedUseStyletron as cp,createThemedWithStyle as cq,expandBorderStyles as cr,withStyle as cs,getAugmentedNamespace as ct,requireReactIs$1 as cu,NumberInput$1 as cv,requireReact as d,requirePropTypes as e,requireClassnames as f,getDefaultExportFromCjs$1 as g,require_root as h,isPropValid as i,jsx$1 as j,keyframes as k,requireIsObject as l,requireToNumber as m,newStyled as n,require_Set as o,require_setToArray as p,require_SetCache as q,reactExports as r,require_arrayIncludes as s,require_cacheHas as t,require_arrayIncludesWith as u,requireFlatten as v,groupBy as w,__vitePreload as x,useTheme as y,convertRemToPx as z};