streamlit-nightly 1.41.2.dev20241216__py2.py3-none-any.whl → 1.41.2.dev20241217__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 (69) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/static/js/{FileDownload.esm.DE_VPP64.js → FileDownload.esm.QqCMUILn.js} +1 -1
  3. streamlit/static/static/js/{FormClearHelper.UF4mydK_.js → FormClearHelper.B6Bz_GbB.js} +1 -1
  4. streamlit/static/static/js/{Hooks.Bcpyt7Wg.js → Hooks.BJs-bpsL.js} +1 -1
  5. streamlit/static/static/js/{InputInstructions.B656liTy.js → InputInstructions.BwlO8jRj.js} +1 -1
  6. streamlit/static/static/js/{ProgressBar.FzszoqRr.js → ProgressBar.B55rfZBG.js} +1 -1
  7. streamlit/static/static/js/{RenderInPortalIfExists.DDvF2mgt.js → RenderInPortalIfExists.Czz6vPJ8.js} +1 -1
  8. streamlit/static/static/js/{Toolbar.BgA8y34Q.js → Toolbar.DTpf_4hM.js} +1 -1
  9. streamlit/static/static/js/{base-input.DX-faI4B.js → base-input.5iLiCHpv.js} +1 -1
  10. streamlit/static/static/js/{createSuper.D1pzoKsm.js → createSuper.ByXUD3CY.js} +1 -1
  11. streamlit/static/static/js/{data-grid-overlay-editor.sNIykWAm.js → data-grid-overlay-editor.D9j_rZRt.js} +1 -1
  12. streamlit/static/static/js/{downloader.DI6wdUqz.js → downloader.CQK3UQry.js} +1 -1
  13. streamlit/static/static/js/{es6.CLXBGJMD.js → es6.C8ohRbW7.js} +2 -2
  14. streamlit/static/static/js/{getPrototypeOf.CaWLizsU.js → getPrototypeOf.DzacAWFK.js} +1 -1
  15. streamlit/static/static/js/{iframeResizer.contentWindow.Dqu1tYra.js → iframeResizer.contentWindow.-9v2TlC_.js} +1 -1
  16. streamlit/static/static/js/{index.DHDmf3UX.js → index.ALAY1YUc.js} +1 -1
  17. streamlit/static/static/js/{index.tMt7jAqV.js → index.B60aqwr7.js} +1 -1
  18. streamlit/static/static/js/{index.CwnPK3gx.js → index.B8is6IAj.js} +1 -1
  19. streamlit/static/static/js/{index.DcxJ_blk.js → index.BRMdTfDY.js} +1 -1
  20. streamlit/static/static/js/{index.BlsQN9hy.js → index.BV11qw37.js} +1 -1
  21. streamlit/static/static/js/{index.Cagh8jLL.js → index.BayydfX0.js} +1 -1
  22. streamlit/static/static/js/{index.BULH4QCI.js → index.BcbWCkO4.js} +1 -1
  23. streamlit/static/static/js/{index.CqglyHhp.js → index.BixGIbC5.js} +1 -1
  24. streamlit/static/static/js/{index.Dt3jg_pt.js → index.Bnlq1gA7.js} +1 -1
  25. streamlit/static/static/js/{index.BmBj8wmP.js → index.Bt81IJiu.js} +1 -1
  26. streamlit/static/static/js/{index.D88yAb1w.js → index.C6aGEDUC.js} +1 -1
  27. streamlit/static/static/js/{index.Bbrszxlv.js → index.CawcX6dO.js} +1 -1
  28. streamlit/static/static/js/{index.DoYRr9kC.js → index.CgFCoGQM.js} +1 -1
  29. streamlit/static/static/js/{index.C6icGi6m.js → index.ClxFeb0x.js} +1 -1
  30. streamlit/static/static/js/{index.Dq7_cmGP.js → index.CpYg-rJx.js} +1 -1
  31. streamlit/static/static/js/{index.DmgiRd4M.js → index.CuApUHlx.js} +1 -1
  32. streamlit/static/static/js/{index.Tg6VFvwj.js → index.CuYk4ioW.js} +1 -1
  33. streamlit/static/static/js/{index.DrQE7SgU.js → index.CvCo5a1I.js} +1 -1
  34. streamlit/static/static/js/{index.ChNVIZUY.js → index.D3j-YI8c.js} +1 -1
  35. streamlit/static/static/js/{index.KpCzZZdY.js → index.D54tamnX.js} +1 -1
  36. streamlit/static/static/js/{index.BiZ0OjWX.js → index.DB4bAANU.js} +1 -1
  37. streamlit/static/static/js/{index.CVUYODJp.js → index.DIJ9HldI.js} +1 -1
  38. streamlit/static/static/js/{index.fcHu0yZM.js → index.DSrZB-JX.js} +1 -1
  39. streamlit/static/static/js/{index.B-vpOz0z.js → index.DXlDoScw.js} +1 -1
  40. streamlit/static/static/js/{index.CLrSNjcw.js → index.DdQG8WhP.js} +1 -1
  41. streamlit/static/static/js/{index.BzjEVFap.js → index.DhrIC-YG.js} +1 -1
  42. streamlit/static/static/js/{index.CmL6Ujex.js → index.DiLaw-x6.js} +1 -1
  43. streamlit/static/static/js/{index.B6UwsLmD.js → index.Dm7Vtozc.js} +1 -1
  44. streamlit/static/static/js/{index.B-jmSIBo.js → index.Dt0U2KOG.js} +1 -1
  45. streamlit/static/static/js/{index.DbmG7oF7.js → index.DzIG_URz.js} +1 -1
  46. streamlit/static/static/js/{index.SfNQsyET.js → index.P6pRVKPa.js} +1 -1
  47. streamlit/static/static/js/{index.fQqwNpY6.js → index.QYI5Zkk5.js} +28 -28
  48. streamlit/static/static/js/{index.CMtdKSYN.js → index.XdL5yZbP.js} +1 -1
  49. streamlit/static/static/js/{index.CF2F2422.js → index.ZGuf7st3.js} +1 -1
  50. streamlit/static/static/js/{index.4j9i5Wg5.js → index.ZNccfOFU.js} +4 -4
  51. streamlit/static/static/js/{index.Yo0KGqSD.js → index.i2leGeFb.js} +1 -1
  52. streamlit/static/static/js/{index.BD3NXAcL.js → index.sJIiloxS.js} +1 -1
  53. streamlit/static/static/js/{input.DrirTqD6.js → input.UThnFXU1.js} +1 -1
  54. streamlit/static/static/js/{memory.IBXdsXhr.js → memory.CVB_139e.js} +1 -1
  55. streamlit/static/static/js/{number-overlay-editor.BsG9fuDJ.js → number-overlay-editor.D2gvCDkR.js} +1 -1
  56. streamlit/static/static/js/{sandbox.DrSD_F6e.js → sandbox.CYgOA7dZ.js} +1 -1
  57. streamlit/static/static/js/{slicedToArray.DmzdLRl6.js → slicedToArray.Bf2KQWXt.js} +1 -1
  58. streamlit/static/static/js/{textarea.ByKVEWnq.js → textarea.XS9Z04B8.js} +1 -1
  59. streamlit/static/static/js/{timepicker.BJTOoYzK.js → timepicker.DD6Nvtec.js} +1 -1
  60. streamlit/static/static/js/{uniqueId.DQt2BqFT.js → uniqueId.CdXVO49k.js} +1 -1
  61. streamlit/static/static/js/{useBasicWidgetState.PtBBWxeH.js → useBasicWidgetState.CqotU0hk.js} +1 -1
  62. streamlit/static/static/js/{useOnInputChange.DZvxzQw9.js → useOnInputChange.OZdr94Fw.js} +1 -1
  63. streamlit/static/static/js/{withFullScreenWrapper.D-zBVHlJ.js → withFullScreenWrapper.Cr1985j6.js} +1 -1
  64. {streamlit_nightly-1.41.2.dev20241216.dist-info → streamlit_nightly-1.41.2.dev20241217.dist-info}/METADATA +1 -1
  65. {streamlit_nightly-1.41.2.dev20241216.dist-info → streamlit_nightly-1.41.2.dev20241217.dist-info}/RECORD +69 -69
  66. {streamlit_nightly-1.41.2.dev20241216.data → streamlit_nightly-1.41.2.dev20241217.data}/scripts/streamlit.cmd +0 -0
  67. {streamlit_nightly-1.41.2.dev20241216.dist-info → streamlit_nightly-1.41.2.dev20241217.dist-info}/WHEEL +0 -0
  68. {streamlit_nightly-1.41.2.dev20241216.dist-info → streamlit_nightly-1.41.2.dev20241217.dist-info}/entry_points.txt +0 -0
  69. {streamlit_nightly-1.41.2.dev20241216.dist-info → streamlit_nightly-1.41.2.dev20241217.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.DrQE7SgU.js","./RenderInPortalIfExists.DDvF2mgt.js","./index.CF2F2422.js","./index.fQqwNpY6.js","./FormClearHelper.UF4mydK_.js","./withFullScreenWrapper.D-zBVHlJ.js","./Toolbar.BgA8y34Q.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./slicedToArray.DmzdLRl6.js","./getPrototypeOf.CaWLizsU.js","./createSuper.D1pzoKsm.js","./FileDownload.esm.DE_VPP64.js","../css/index.B26BQfSF.css","./index.BmBj8wmP.js","./threshold.skajmqVB.js","./string.Bl9OLDCw.js","./timer.DwZfkapc.js","./index.BULH4QCI.js","./useBasicWidgetState.PtBBWxeH.js","./_commonjs-dynamic-modules.TDtrdbi3.js","../css/index.CG16XVnL.css","./index.CmL6Ujex.js","./index.DHDmf3UX.js","./index.BD3NXAcL.js","./index.B6UwsLmD.js","./Hooks.Bcpyt7Wg.js","./index.tMt7jAqV.js","./index.Dt3jg_pt.js","./index.B-jmSIBo.js","./UploadFileInfo.C-jY39rj.js","./ProgressBar.FzszoqRr.js","./index.DcxJ_blk.js","./InputInstructions.B656liTy.js","./inputUtils.CQWz5UKz.js","./textarea.ByKVEWnq.js","./base-input.DX-faI4B.js","./index.D88yAb1w.js","./index.BzjEVFap.js","./index.BlsQN9hy.js","./timepicker.BJTOoYzK.js","./input.DrirTqD6.js","./index.B-vpOz0z.js","./index.C6icGi6m.js","./index.DoYRr9kC.js","./index.KpCzZZdY.js","./index.CMtdKSYN.js","./index.DmgiRd4M.js","./index.Bbrszxlv.js","./uniqueId.DQt2BqFT.js","./useOnInputChange.DZvxzQw9.js","./index.CLrSNjcw.js","./index.fcHu0yZM.js","./index.BiZ0OjWX.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.CvCo5a1I.js","./RenderInPortalIfExists.Czz6vPJ8.js","./index.ZGuf7st3.js","./index.QYI5Zkk5.js","./FormClearHelper.B6Bz_GbB.js","./withFullScreenWrapper.Cr1985j6.js","./Toolbar.DTpf_4hM.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./slicedToArray.Bf2KQWXt.js","./getPrototypeOf.DzacAWFK.js","./createSuper.ByXUD3CY.js","./FileDownload.esm.QqCMUILn.js","../css/index.B26BQfSF.css","./index.Bt81IJiu.js","./threshold.skajmqVB.js","./string.Bl9OLDCw.js","./timer.DwZfkapc.js","./index.BcbWCkO4.js","./useBasicWidgetState.CqotU0hk.js","./_commonjs-dynamic-modules.TDtrdbi3.js","../css/index.CG16XVnL.css","./index.DiLaw-x6.js","./index.ALAY1YUc.js","./index.sJIiloxS.js","./index.Dm7Vtozc.js","./Hooks.BJs-bpsL.js","./index.B60aqwr7.js","./index.Bnlq1gA7.js","./index.Dt0U2KOG.js","./UploadFileInfo.C-jY39rj.js","./ProgressBar.B55rfZBG.js","./index.BRMdTfDY.js","./InputInstructions.BwlO8jRj.js","./inputUtils.CQWz5UKz.js","./textarea.XS9Z04B8.js","./base-input.5iLiCHpv.js","./index.C6aGEDUC.js","./index.DhrIC-YG.js","./index.BV11qw37.js","./timepicker.DD6Nvtec.js","./input.UThnFXU1.js","./index.DXlDoScw.js","./index.ClxFeb0x.js","./index.CgFCoGQM.js","./index.D54tamnX.js","./index.XdL5yZbP.js","./index.CuApUHlx.js","./index.CawcX6dO.js","./uniqueId.CdXVO49k.js","./useOnInputChange.OZdr94Fw.js","./index.DdQG8WhP.js","./index.DSrZB-JX.js","./index.DB4bAANU.js"])))=>i.map(i=>d[i]);
2
2
  var sr=Object.defineProperty;var Wn=tt=>{throw TypeError(tt)};var ur=(tt,nt,et)=>nt in tt?sr(tt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):tt[nt]=et;var T1=(tt,nt,et)=>ur(tt,typeof nt!="symbol"?nt+"":nt,et),Rn=(tt,nt,et)=>nt.has(tt)||Wn("Cannot "+et);var _0=(tt,nt,et)=>(Rn(tt,nt,"read from private field"),et?et.call(tt):nt.get(tt)),Q0=(tt,nt,et)=>nt.has(tt)?Wn("Cannot add the same private member more than once"):nt instanceof WeakSet?nt.add(tt):nt.set(tt,et),K0=(tt,nt,et,rt)=>(Rn(tt,nt,"write to private field"),rt?rt.call(tt,et):nt.set(tt,et),et),$0=(tt,nt,et)=>(Rn(tt,nt,"access private method"),et);function _mergeNamespaces(tt,nt){for(var et=0;et<nt.length;et++){const rt=nt[et];if(typeof rt!="string"&&!Array.isArray(rt)){for(const ot in rt)if(ot!=="default"&&!(ot in tt)){const at=Object.getOwnPropertyDescriptor(rt,ot);at&&Object.defineProperty(tt,ot,at.get?at:{enumerable:!0,get:()=>rt[ot]})}}}return Object.freeze(Object.defineProperty(tt,Symbol.toStringTag,{value:"Module"}))}(function(){const nt=document.createElement("link").relList;if(nt&&nt.supports&&nt.supports("modulepreload"))return;for(const ot of document.querySelectorAll('link[rel="modulepreload"]'))rt(ot);new MutationObserver(ot=>{for(const at of ot)if(at.type==="childList")for(const st of at.addedNodes)st.tagName==="LINK"&&st.rel==="modulepreload"&&rt(st)}).observe(document,{childList:!0,subtree:!0});function et(ot){const at={};return ot.integrity&&(at.integrity=ot.integrity),ot.referrerPolicy&&(at.referrerPolicy=ot.referrerPolicy),ot.crossOrigin==="use-credentials"?at.credentials="include":ot.crossOrigin==="anonymous"?at.credentials="omit":at.credentials="same-origin",at}function rt(ot){if(ot.ep)return;ot.ep=!0;const at=et(ot);fetch(ot.href,at)}})();var commonjsGlobal$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(tt){return tt&&tt.__esModule&&Object.prototype.hasOwnProperty.call(tt,"default")?tt.default:tt}function getAugmentedNamespace(tt){if(tt.__esModule)return tt;var nt=tt.default;if(typeof nt=="function"){var et=function rt(){return this instanceof rt?Reflect.construct(nt,arguments,this.constructor):nt.apply(this,arguments)};et.prototype=nt.prototype}else et={};return Object.defineProperty(et,"__esModule",{value:!0}),Object.keys(tt).forEach(function(rt){var ot=Object.getOwnPropertyDescriptor(tt,rt);Object.defineProperty(et,rt,ot.get?ot:{enumerable:!0,get:function(){return tt[rt]}})}),et}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -437,7 +437,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
437
437
  `):[];at.shift();const st=at.map(ut=>ut.trim()).join(`
438
438
  `);return jsxs(AlertContainer,{kind:Kind.ERROR,width:ot,children:[jsxs(StyledErrorName,{children:[nt,": "]}),et,rt?jsx$1(StyledStackTrace,{"data-testid":"stErrorElementStack",children:jsx$1(StyledCode,{children:st})}):null]})}const Fn=class Fn extends React$1.PureComponent{constructor(){super(...arguments),this.state={error:null},this.componentDidCatch=nt=>{logError(`${nt.name}: ${nt.message}
439
439
  ${nt.stack}`)}}render(){const{error:nt}=this.state;return nt?nt.name==="ChunkLoadError"?jsx$1(ErrorElement,{width:this.props.width,name:"Network issue",message:jsxs("p",{children:["Cannot load Streamlit frontend code. This can happen when you update Streamlit while a Streamlit app is running.",jsx$1("br",{}),"To fix this, simply reload this app by pressing"," ",jsx$1(StyledInlineCode,{children:"F5"}),","," ",jsx$1(StyledInlineCode,{children:"Ctrl+R"}),", or"," ",jsx$1(StyledInlineCode,{children:"Cmd+R"}),".",jsx$1("br",{}),"If the error persists, try force-clearing your browser's cache as described"," ",jsx$1("a",{href:"https://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache#Cache_clearing_and_disabling",rel:"noopener noreferrer",target:"_blank",children:"here"})]})}):jsx$1(ErrorElement,{width:this.props.width,name:nt.name,message:nt.message,stack:nt.stack}):this.props.children}};Fn.getDerivedStateFromError=nt=>({error:nt});let ErrorBoundary=Fn;var PLACEMENT={auto:"auto",topLeft:"topLeft",top:"top",topRight:"topRight",rightTop:"rightTop",right:"right",rightBottom:"rightBottom",bottomRight:"bottomRight",bottom:"bottom",bottomLeft:"bottomLeft",leftBottom:"leftBottom",left:"left",leftTop:"leftTop"},TRIGGER_TYPE={click:"click",hover:"hover"},STATE_CHANGE_TYPE$1={open:"open",close:"close"},ACCESSIBILITY_TYPE={none:"none",menu:"menu",tooltip:"tooltip"},POPOVER_MARGIN=8,ARROW_SIZE=6,ANIMATE_OUT_TIME=0,ANIMATE_IN_TIME=20,ARROW_WIDTH=Math.ceil(Math.sqrt(Math.pow(ARROW_SIZE*2,2)/2));function _typeof$c(tt){"@babel/helpers - typeof";return _typeof$c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(nt){return typeof nt}:function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$c(tt)}function ownKeys$l(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$k(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$l(Object(et),!0).forEach(function(rt){_defineProperty$o(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$l(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _classCallCheck$k(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$a(tt,nt){for(var et=0;et<nt.length;et++){var rt=nt[et];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(tt,rt.key,rt)}}function _createClass$i(tt,nt,et){return nt&&_defineProperties$a(tt.prototype,nt),Object.defineProperty(tt,"prototype",{writable:!1}),tt}function _inherits$k(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function");tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,writable:!0,configurable:!0}}),Object.defineProperty(tt,"prototype",{writable:!1}),nt&&_setPrototypeOf$a(tt,nt)}function _setPrototypeOf$a(tt,nt){return _setPrototypeOf$a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,ot){return rt.__proto__=ot,rt},_setPrototypeOf$a(tt,nt)}function _createSuper$9(tt){var nt=_isNativeReflectConstruct$9();return function(){var rt=_getPrototypeOf$a(tt),ot;if(nt){var at=_getPrototypeOf$a(this).constructor;ot=Reflect.construct(rt,arguments,at)}else ot=rt.apply(this,arguments);return _possibleConstructorReturn$k(this,ot)}}function _possibleConstructorReturn$k(tt,nt){if(nt&&(_typeof$c(nt)==="object"||typeof nt=="function"))return nt;if(nt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$a(tt)}function _assertThisInitialized$a(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _isNativeReflectConstruct$9(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$a(tt){return _getPrototypeOf$a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$a(tt)}function _defineProperty$o(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var defaultStateReducer=function tt(nt,et){return et},StatefulContainer$1=function(tt){_inherits$k(et,tt);var nt=_createSuper$9(et);function et(){var rt;_classCallCheck$k(this,et);for(var ot=arguments.length,at=new Array(ot),st=0;st<ot;st++)at[st]=arguments[st];return rt=nt.call.apply(nt,[this].concat(at)),_defineProperty$o(_assertThisInitialized$a(rt),"state",_objectSpread$k({isOpen:!1},rt.props.initialState)),_defineProperty$o(_assertThisInitialized$a(rt),"onBlur",function(ut){rt.props.onBlur&&rt.props.onBlur(ut),!(rt.props.focusLock||rt.props.autoFocus)&&rt.close()}),_defineProperty$o(_assertThisInitialized$a(rt),"onClick",function(ut){rt.props.onClick&&rt.props.onClick(ut),rt.state.isOpen?rt.close():rt.open()}),_defineProperty$o(_assertThisInitialized$a(rt),"onClickOutside",function(){rt.close()}),_defineProperty$o(_assertThisInitialized$a(rt),"onEsc",function(){rt.close()}),_defineProperty$o(_assertThisInitialized$a(rt),"onFocus",function(ut){rt.props.onFocus&&rt.props.onFocus(ut),isFocusVisible(ut)&&rt.open()}),_defineProperty$o(_assertThisInitialized$a(rt),"onMouseEnter",function(ut){rt.props.onMouseEnter&&rt.props.onMouseEnter(ut),rt.open()}),_defineProperty$o(_assertThisInitialized$a(rt),"onMouseLeave",function(ut){rt.props.onMouseLeave&&rt.props.onMouseLeave(ut),rt.close()}),_defineProperty$o(_assertThisInitialized$a(rt),"onContentClose",function(){rt.close()}),_defineProperty$o(_assertThisInitialized$a(rt),"renderContent",function(){var ut=rt.props.content;return typeof ut=="function"?ut({close:rt.onContentClose}):ut}),rt}return _createClass$i(et,[{key:"open",value:function(){this.internalSetState(STATE_CHANGE_TYPE$1.open,{isOpen:!0}),this.props.onOpen&&this.props.onOpen()}},{key:"close",value:function(){this.internalSetState(STATE_CHANGE_TYPE$1.close,{isOpen:!1}),this.props.onClose&&this.props.onClose()}},{key:"internalSetState",value:function(ot,at){var st=this.props.stateReducer;if(typeof st!="function"){this.setState(at);return}this.setState(function(ut){return st(ot,at,ut)})}},{key:"render",value:function(){var ot=this.props,at=ot.accessibilityType,st=ot.autoFocus,ut=ot.animateOutTime,ct=ot.dismissOnClickOutside,pt=ot.dismissOnEsc,dt=ot.focusLock,ft=ot.ignoreBoundary,bt=ot.mountNode,ht=ot.onBlur,Mt=ot.onClick,mt=ot.onFocus,Ot=ot.onMouseEnter,zt=ot.onMouseLeave,yt=ot.onMouseEnterDelay,vt=ot.onMouseLeaveDelay,At=ot.overrides,St=ot.placement,Et=ot.popperOptions,Tt=ot.renderAll,Rt=ot.returnFocus,Ct=ot.showArrow,wt=ot.triggerType,Lt=ot.popoverMargin,Ht=ot.focusOptions,jt={accessibilityType:at,animateOutTime:ut,autoFocus:st,content:this.renderContent,focusLock:dt,ignoreBoundary:ft,isOpen:this.state.isOpen,mountNode:bt,onBlur:ht,onClick:Mt,onFocus:mt,onMouseEnter:Ot,onMouseLeave:zt,onMouseEnterDelay:yt,onMouseLeaveDelay:vt,overrides:At,placement:St,popperOptions:Et,renderAll:Tt,returnFocus:Rt,showArrow:Ct,triggerType:wt,popoverMargin:Lt,focusOptions:Ht};return ct&&(jt.onClickOutside=this.onClickOutside),pt&&(jt.onEsc=this.onEsc),wt===TRIGGER_TYPE.hover?(jt.onBlur=this.onBlur,jt.onFocus=this.onFocus,jt.onMouseEnter=this.onMouseEnter,jt.onMouseLeave=this.onMouseLeave):jt.onClick=this.onClick,this.props.children(jt)}}]),et}(reactExports.Component);_defineProperty$o(StatefulContainer$1,"defaultProps",{accessibilityType:ACCESSIBILITY_TYPE.menu,ignoreBoundary:!1,overrides:{},onMouseEnterDelay:200,onMouseLeaveDelay:200,placement:PLACEMENT.auto,popperOptions:{},showArrow:!1,triggerType:TRIGGER_TYPE.click,dismissOnClickOutside:!0,dismissOnEsc:!0,stateReducer:defaultStateReducer,popoverMargin:POPOVER_MARGIN});var FOCUS_GROUP="data-focus-lock",FOCUS_DISABLED="data-focus-lock-disabled",FOCUS_ALLOW="data-no-focus-lock",FOCUS_AUTO="data-autofocus-inside",FOCUS_NO_AUTOFOCUS="data-no-autofocus";function assignRef(tt,nt){return typeof tt=="function"?tt(nt):tt&&(tt.current=nt),tt}function useCallbackRef(tt,nt){var et=reactExports.useState(function(){return{value:tt,callback:nt,facade:{get current(){return et.value},set current(rt){var ot=et.value;ot!==rt&&(et.value=rt,et.callback(rt,ot))}}}})[0];return et.callback=nt,et.facade}var useIsomorphicLayoutEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,currentValues=new WeakMap;function useMergeRefs(tt,nt){var et=useCallbackRef(null,function(rt){return tt.forEach(function(ot){return assignRef(ot,rt)})});return useIsomorphicLayoutEffect(function(){var rt=currentValues.get(et);if(rt){var ot=new Set(rt),at=new Set(tt),st=et.current;ot.forEach(function(ut){at.has(ut)||assignRef(ut,null)}),at.forEach(function(ut){ot.has(ut)||assignRef(ut,st)})}currentValues.set(et,tt)},[tt]),et}var hiddenGuard={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function ItoI(tt){return tt}function innerCreateMedium(tt,nt){nt===void 0&&(nt=ItoI);var et=[],rt=!1,ot={read:function(){if(rt)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return et.length?et[et.length-1]:tt},useMedium:function(at){var st=nt(at,rt);return et.push(st),function(){et=et.filter(function(ut){return ut!==st})}},assignSyncMedium:function(at){for(rt=!0;et.length;){var st=et;et=[],st.forEach(at)}et={push:function(ut){return at(ut)},filter:function(){return et}}},assignMedium:function(at){rt=!0;var st=[];if(et.length){var ut=et;et=[],ut.forEach(at),st=et}var ct=function(){var dt=st;st=[],dt.forEach(at)},pt=function(){return Promise.resolve().then(ct)};pt(),et={push:function(dt){st.push(dt),pt()},filter:function(dt){return st=st.filter(dt),et}}}};return ot}function createMedium(tt,nt){return nt===void 0&&(nt=ItoI),innerCreateMedium(tt,nt)}function createSidecarMedium(tt){tt===void 0&&(tt={});var nt=innerCreateMedium(null);return nt.options=__assign$2({async:!0,ssr:!1},tt),nt}var mediumFocus=createMedium({},function(tt){var nt=tt.target,et=tt.currentTarget;return{target:nt,currentTarget:et}}),mediumBlur=createMedium(),mediumEffect=createMedium(),mediumSidecar=createSidecarMedium({async:!0,ssr:typeof document<"u"}),focusScope=reactExports.createContext(void 0),emptyArray=[],FocusLock=reactExports.forwardRef(function tt(nt,et){var rt,ot=reactExports.useState(),at=ot[0],st=ot[1],ut=reactExports.useRef(),ct=reactExports.useRef(!1),pt=reactExports.useRef(null),dt=reactExports.useState({}),ft=dt[1],bt=nt.children,ht=nt.disabled,Mt=ht===void 0?!1:ht,mt=nt.noFocusGuards,Ot=mt===void 0?!1:mt,zt=nt.persistentFocus,yt=zt===void 0?!1:zt,vt=nt.crossFrame,At=vt===void 0?!0:vt,St=nt.autoFocus,Et=St===void 0?!0:St;nt.allowTextSelection;var Tt=nt.group,Rt=nt.className,Ct=nt.whiteList,wt=nt.hasPositiveIndices,Lt=nt.shards,Ht=Lt===void 0?emptyArray:Lt,jt=nt.as,s0=jt===void 0?"div":jt,Ut=nt.lockProps,Yt=Ut===void 0?{}:Ut,O0=nt.sideCar,a0=nt.returnFocus,b0=a0===void 0?!1:a0,kt=nt.focusOptions,o0=nt.onActivation,qt=nt.onDeactivation,Dt=reactExports.useState({}),Bt=Dt[0],p0=reactExports.useCallback(function(Zt){var Kt=Zt.captureFocusRestore;if(!pt.current){var n0,c0=(n0=document)==null?void 0:n0.activeElement;pt.current=c0,c0!==document.body&&(pt.current=Kt(c0))}ut.current&&o0&&o0(ut.current),ct.current=!0,ft()},[o0]),r0=reactExports.useCallback(function(){ct.current=!1,qt&&qt(ut.current),ft()},[qt]),l0=reactExports.useCallback(function(Zt){var Kt=pt.current;if(Kt){var n0=(typeof Kt=="function"?Kt():Kt)||document.body,c0=typeof b0=="function"?b0(n0):b0;if(c0){var u0=typeof c0=="object"?c0:void 0;pt.current=null,Zt?Promise.resolve().then(function(){return n0.focus(u0)}):n0.focus(u0)}}},[b0]),f0=reactExports.useCallback(function(Zt){ct.current&&mediumFocus.useMedium(Zt)},[]),i0=mediumBlur.useMedium,$t=reactExports.useCallback(function(Zt){ut.current!==Zt&&(ut.current=Zt,st(Zt))},[]),It=_extends$Q((rt={},rt[FOCUS_DISABLED]=Mt&&"disabled",rt[FOCUS_GROUP]=Tt,rt),Yt),Vt=Ot!==!0,xt=Vt&&Ot!=="tail",Ft=useMergeRefs([et,$t]),Pt=reactExports.useMemo(function(){return{observed:ut,shards:Ht,enabled:!Mt,active:ct.current}},[Mt,ct.current,Ht,at]);return reactExports.createElement(reactExports.Fragment,null,Vt&&[reactExports.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:Mt?-1:0,style:hiddenGuard}),wt?reactExports.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:Mt?-1:1,style:hiddenGuard}):null],!Mt&&reactExports.createElement(O0,{id:Bt,sideCar:mediumSidecar,observed:at,disabled:Mt,persistentFocus:yt,crossFrame:At,autoFocus:Et,whiteList:Ct,shards:Ht,onActivation:p0,onDeactivation:r0,returnFocus:l0,focusOptions:kt,noFocusGuards:Ot}),reactExports.createElement(s0,_extends$Q({ref:Ft},It,{className:Rt,onBlur:i0,onFocus:f0}),reactExports.createElement(focusScope.Provider,{value:Pt},bt)),xt&&reactExports.createElement("div",{"data-focus-guard":!0,tabIndex:Mt?-1:0,style:hiddenGuard}))});FocusLock.propTypes={};function _inheritsLoose(tt,nt){tt.prototype=Object.create(nt.prototype),tt.prototype.constructor=tt,_setPrototypeOf$e(tt,nt)}function withSideEffect(tt,nt){function et(rt){return rt.displayName||rt.name||"Component"}return function(ot){var at=[],st;function ut(){st=tt(at.map(function(pt){return pt.props})),nt(st)}var ct=function(pt){_inheritsLoose(dt,pt);function dt(){return pt.apply(this,arguments)||this}dt.peek=function(){return st};var ft=dt.prototype;return ft.componentDidMount=function(){at.push(this),ut()},ft.componentDidUpdate=function(){ut()},ft.componentWillUnmount=function(){var ht=at.indexOf(this);at.splice(ht,1),ut()},ft.render=function(){return React$1.createElement(ot,this.props)},dt}(reactExports.PureComponent);return _defineProperty$u(ct,"displayName","SideEffect("+et(ot)+")"),ct}}var toArray$2=function(tt){for(var nt=Array(tt.length),et=0;et<tt.length;++et)nt[et]=tt[et];return nt},asArray=function(tt){return Array.isArray(tt)?tt:[tt]},getFirst=function(tt){return Array.isArray(tt)?tt[0]:tt},isElementHidden=function(tt){if(tt.nodeType!==Node.ELEMENT_NODE)return!1;var nt=window.getComputedStyle(tt,null);return!nt||!nt.getPropertyValue?!1:nt.getPropertyValue("display")==="none"||nt.getPropertyValue("visibility")==="hidden"},getParentNode=function(tt){return tt.parentNode&&tt.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?tt.parentNode.host:tt.parentNode},isTopNode=function(tt){return tt===document||tt&&tt.nodeType===Node.DOCUMENT_NODE},isInert=function(tt){return tt.hasAttribute("inert")},isVisibleUncached=function(tt,nt){return!tt||isTopNode(tt)||!isElementHidden(tt)&&!isInert(tt)&&nt(getParentNode(tt))},isVisibleCached=function(tt,nt){var et=tt.get(nt);if(et!==void 0)return et;var rt=isVisibleUncached(nt,isVisibleCached.bind(void 0,tt));return tt.set(nt,rt),rt},isAutoFocusAllowedUncached=function(tt,nt){return tt&&!isTopNode(tt)?isAutoFocusAllowed(tt)?nt(getParentNode(tt)):!1:!0},isAutoFocusAllowedCached=function(tt,nt){var et=tt.get(nt);if(et!==void 0)return et;var rt=isAutoFocusAllowedUncached(nt,isAutoFocusAllowedCached.bind(void 0,tt));return tt.set(nt,rt),rt},getDataset=function(tt){return tt.dataset},isHTMLButtonElement=function(tt){return tt.tagName==="BUTTON"},isHTMLInputElement=function(tt){return tt.tagName==="INPUT"},isRadioElement=function(tt){return isHTMLInputElement(tt)&&tt.type==="radio"},notHiddenInput=function(tt){return!((isHTMLInputElement(tt)||isHTMLButtonElement(tt))&&(tt.type==="hidden"||tt.disabled))},isAutoFocusAllowed=function(tt){var nt=tt.getAttribute(FOCUS_NO_AUTOFOCUS);return![!0,"true",""].includes(nt)},isGuard=function(tt){var nt;return!!(tt&&(!((nt=getDataset(tt))===null||nt===void 0)&&nt.focusGuard))},isNotAGuard=function(tt){return!isGuard(tt)},isDefined=function(tt){return!!tt},tabSort=function(tt,nt){var et=Math.max(0,tt.tabIndex),rt=Math.max(0,nt.tabIndex),ot=et-rt,at=tt.index-nt.index;if(ot){if(!et)return 1;if(!rt)return-1}return ot||at},getTabIndex=function(tt){return tt.tabIndex<0&&!tt.hasAttribute("tabindex")?0:tt.tabIndex},orderByTabIndex=function(tt,nt,et){return toArray$2(tt).map(function(rt,ot){var at=getTabIndex(rt);return{node:rt,index:ot,tabIndex:et&&at===-1?(rt.dataset||{}).focusGuard?0:-1:at}}).filter(function(rt){return!nt||rt.tabIndex>=0}).sort(tabSort)},tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(tt,nt){return toArray$2((tt.shadowRoot||tt).children).reduce(function(et,rt){return et.concat(rt.matches(nt?queryGuardTabbables:queryTabbables)?[rt]:[],getFocusablesWithShadowDom(rt))},[])},getFocusablesWithIFrame=function(tt,nt){var et;return tt instanceof HTMLIFrameElement&&(!((et=tt.contentDocument)===null||et===void 0)&&et.body)?getFocusables([tt.contentDocument.body],nt):[tt]},getFocusables=function(tt,nt){return tt.reduce(function(et,rt){var ot,at=getFocusablesWithShadowDom(rt,nt),st=(ot=[]).concat.apply(ot,at.map(function(ut){return getFocusablesWithIFrame(ut,nt)}));return et.concat(st,rt.parentNode?toArray$2(rt.parentNode.querySelectorAll(queryTabbables)).filter(function(ut){return ut===rt}):[])},[])},getParentAutofocusables=function(tt){var nt=tt.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray$2(nt).map(function(et){return getFocusables([et])}).reduce(function(et,rt){return et.concat(rt)},[])},filterFocusable=function(tt,nt){return toArray$2(tt).filter(function(et){return isVisibleCached(nt,et)}).filter(function(et){return notHiddenInput(et)})},filterAutoFocusable=function(tt,nt){return nt===void 0&&(nt=new Map),toArray$2(tt).filter(function(et){return isAutoFocusAllowedCached(nt,et)})},getTabbableNodes=function(tt,nt,et){return orderByTabIndex(filterFocusable(getFocusables(tt,et),nt),!0,et)},getFocusableNodes=function(tt,nt){return orderByTabIndex(filterFocusable(getFocusables(tt),nt),!1)},parentAutofocusables=function(tt,nt){return filterFocusable(getParentAutofocusables(tt),nt)},contains=function(tt,nt){return tt.shadowRoot?contains(tt.shadowRoot,nt):Object.getPrototypeOf(tt).contains!==void 0&&Object.getPrototypeOf(tt).contains.call(tt,nt)?!0:toArray$2(tt.children).some(function(et){var rt;if(et instanceof HTMLIFrameElement){var ot=(rt=et.contentDocument)===null||rt===void 0?void 0:rt.body;return ot?contains(ot,nt):!1}return contains(et,nt)})},filterNested=function(tt){for(var nt=new Set,et=tt.length,rt=0;rt<et;rt+=1)for(var ot=rt+1;ot<et;ot+=1){var at=tt[rt].compareDocumentPosition(tt[ot]);(at&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&nt.add(ot),(at&Node.DOCUMENT_POSITION_CONTAINS)>0&&nt.add(rt)}return tt.filter(function(st,ut){return!nt.has(ut)})},getTopParent=function(tt){return tt.parentNode?getTopParent(tt.parentNode):tt},getAllAffectedNodes=function(tt){var nt=asArray(tt);return nt.filter(Boolean).reduce(function(et,rt){var ot=rt.getAttribute(FOCUS_GROUP);return et.push.apply(et,ot?filterNested(toArray$2(getTopParent(rt).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(ot,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[rt]),et},[])},safeProbe=function(tt){try{return tt()}catch{return}},getActiveElement=function(tt){if(tt===void 0&&(tt=document),!(!tt||!tt.activeElement)){var nt=tt.activeElement;return nt.shadowRoot?getActiveElement(nt.shadowRoot):nt instanceof HTMLIFrameElement&&safeProbe(function(){return nt.contentWindow.document})?getActiveElement(nt.contentWindow.document):nt}},focusInFrame=function(tt,nt){return tt===nt},focusInsideIframe=function(tt,nt){return!!toArray$2(tt.querySelectorAll("iframe")).some(function(et){return focusInFrame(et,nt)})},focusInside=function(tt,nt){return nt===void 0&&(nt=getActiveElement(getFirst(tt).ownerDocument)),!nt||nt.dataset&&nt.dataset.focusGuard?!1:getAllAffectedNodes(tt).some(function(et){return contains(et,nt)||focusInsideIframe(et,nt)})},focusIsHidden=function(tt){tt===void 0&&(tt=document);var nt=getActiveElement(tt);return nt?toArray$2(tt.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function(et){return contains(et,nt)}):!1},findSelectedRadio=function(tt,nt){return nt.filter(isRadioElement).filter(function(et){return et.name===tt.name}).filter(function(et){return et.checked})[0]||tt},correctNode=function(tt,nt){return isRadioElement(tt)&&tt.name?findSelectedRadio(tt,nt):tt},correctNodes=function(tt){var nt=new Set;return tt.forEach(function(et){return nt.add(correctNode(et,tt))}),tt.filter(function(et){return nt.has(et)})},pickFirstFocus=function(tt){return tt[0]&&tt.length>1?correctNode(tt[0],tt):tt[0]},pickFocusable=function(tt,nt){return tt.indexOf(correctNode(nt,tt))},NEW_FOCUS="NEW_FOCUS",newFocus=function(tt,nt,et,rt,ot){var at=tt.length,st=tt[0],ut=tt[at-1],ct=isGuard(rt);if(!(rt&&tt.indexOf(rt)>=0)){var pt=rt!==void 0?et.indexOf(rt):-1,dt=ot?et.indexOf(ot):pt,ft=ot?tt.indexOf(ot):-1;if(pt===-1)return ft!==-1?ft:NEW_FOCUS;if(ft===-1)return NEW_FOCUS;var bt=pt-dt,ht=et.indexOf(st),Mt=et.indexOf(ut),mt=correctNodes(et),Ot=rt!==void 0?mt.indexOf(rt):-1,zt=Ot-(ot?mt.indexOf(ot):pt);if(!bt&&ft>=0||nt.length===0)return ft;var yt=pickFocusable(tt,nt[0]),vt=pickFocusable(tt,nt[nt.length-1]);if(pt<=ht&&ct&&Math.abs(bt)>1)return vt;if(pt>=Mt&&ct&&Math.abs(bt)>1)return yt;if(bt&&Math.abs(zt)>1)return ft;if(pt<=ht)return vt;if(pt>Mt)return yt;if(bt)return Math.abs(bt)>1?ft:(at+ft+bt)%at}},findAutoFocused=function(tt){return function(nt){var et,rt=(et=getDataset(nt))===null||et===void 0?void 0:et.autofocus;return nt.autofocus||rt!==void 0&&rt!=="false"||tt.indexOf(nt)>=0}},pickAutofocus=function(tt,nt,et){var rt=tt.map(function(at){var st=at.node;return st}),ot=filterAutoFocusable(rt.filter(findAutoFocused(et)));return ot&&ot.length?pickFirstFocus(ot):pickFirstFocus(filterAutoFocusable(nt))},getParents=function(tt,nt){return nt===void 0&&(nt=[]),nt.push(tt),tt.parentNode&&getParents(tt.parentNode.host||tt.parentNode,nt),nt},getCommonParent=function(tt,nt){for(var et=getParents(tt),rt=getParents(nt),ot=0;ot<et.length;ot+=1){var at=et[ot];if(rt.indexOf(at)>=0)return at}return!1},getTopCommonParent=function(tt,nt,et){var rt=asArray(tt),ot=asArray(nt),at=rt[0],st=!1;return ot.filter(Boolean).forEach(function(ut){st=getCommonParent(st||ut,ut)||st,et.filter(Boolean).forEach(function(ct){var pt=getCommonParent(at,ct);pt&&(!st||contains(pt,st)?st=pt:st=getCommonParent(pt,st))})}),st},allParentAutofocusables=function(tt,nt){return tt.reduce(function(et,rt){return et.concat(parentAutofocusables(rt,nt))},[])},reorderNodes=function(tt,nt){var et=new Map;return nt.forEach(function(rt){return et.set(rt.node,rt)}),tt.map(function(rt){return et.get(rt)}).filter(isDefined)},focusSolver=function(tt,nt){var et=getActiveElement(asArray(tt).length>0?document:getFirst(tt).ownerDocument),rt=getAllAffectedNodes(tt).filter(isNotAGuard),ot=getTopCommonParent(et||tt,tt,rt),at=new Map,st=getFocusableNodes(rt,at),ut=st.filter(function(Mt){var mt=Mt.node;return isNotAGuard(mt)});if(ut[0]){var ct=getFocusableNodes([ot],at).map(function(Mt){var mt=Mt.node;return mt}),pt=reorderNodes(ct,ut),dt=pt.map(function(Mt){var mt=Mt.node;return mt}),ft=pt.filter(function(Mt){var mt=Mt.tabIndex;return mt>=0}).map(function(Mt){var mt=Mt.node;return mt}),bt=newFocus(dt,ft,ct,et,nt);if(bt===NEW_FOCUS){var ht=pickAutofocus(st,ft,allParentAutofocusables(rt,at))||pickAutofocus(st,dt,allParentAutofocusables(rt,at));if(ht)return{node:ht};console.warn("focus-lock: cannot find any node to move focus into");return}return bt===void 0?bt:pt[bt]}},expandFocusableNodes=function(tt){var nt=getAllAffectedNodes(tt).filter(isNotAGuard),et=getTopCommonParent(tt,tt,nt),rt=orderByTabIndex(getFocusables([et],!0),!0,!0),ot=getFocusables(nt,!1);return rt.map(function(at){var st=at.node,ut=at.index;return{node:st,index:ut,lockItem:ot.indexOf(st)>=0,guard:isGuard(st)}})},focusOn=function(tt,nt){tt&&("focus"in tt&&tt.focus(nt),"contentWindow"in tt&&tt.contentWindow&&tt.contentWindow.focus())},guardCount=0,lockDisabled=!1,moveFocusInside=function(tt,nt,et){et===void 0&&(et={});var rt=focusSolver(tt,nt);if(!lockDisabled&&rt){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(rt.node,et.focusOptions),guardCount--}};function weakRef(tt){if(!tt)return null;if(typeof WeakRef>"u")return function(){return tt||null};var nt=tt?new WeakRef(tt):null;return function(){return(nt==null?void 0:nt.deref())||null}}var recordElementLocation=function(tt){if(!tt)return null;for(var nt=[],et=tt;et&&et!==document.body;)nt.push({current:weakRef(et),parent:weakRef(et.parentElement),left:weakRef(et.previousElementSibling),right:weakRef(et.nextElementSibling)}),et=et.parentElement;return{element:weakRef(tt),stack:nt,ownerDocument:tt.ownerDocument}},restoreFocusTo=function(tt){var nt,et,rt,ot,at;if(tt)for(var st=tt.stack,ut=tt.ownerDocument,ct=new Map,pt=0,dt=st;pt<dt.length;pt++){var ft=dt[pt],bt=(nt=ft.parent)===null||nt===void 0?void 0:nt.call(ft);if(bt&&ut.contains(bt)){for(var ht=(et=ft.left)===null||et===void 0?void 0:et.call(ft),Mt=ft.current(),mt=bt.contains(Mt)?Mt:void 0,Ot=(rt=ft.right)===null||rt===void 0?void 0:rt.call(ft),zt=getTabbableNodes([bt],ct),yt=(at=(ot=mt??(ht==null?void 0:ht.nextElementSibling))!==null&&ot!==void 0?ot:Ot)!==null&&at!==void 0?at:ht;yt;){for(var vt=0,At=zt;vt<At.length;vt++){var St=At[vt];if(yt!=null&&yt.contains(St.node))return St.node}yt=yt.nextElementSibling}if(zt.length)return zt[0].node}}},captureFocusRestore=function(tt){var nt=recordElementLocation(tt);return function(){return restoreFocusTo(nt)}},getRelativeFocusable=function(tt,nt,et){if(!tt||!nt)return console.error("no element or scope given"),{};var rt=asArray(nt);if(rt.every(function(st){return!contains(st,tt)}))return console.error("Active element is not contained in the scope"),{};var ot=et?getTabbableNodes(rt,new Map):getFocusableNodes(rt,new Map),at=ot.findIndex(function(st){var ut=st.node;return ut===tt});if(at!==-1)return{prev:ot[at-1],next:ot[at+1],first:ot[0],last:ot[ot.length-1]}},getBoundary=function(tt,nt){var et=nt?getTabbableNodes(asArray(tt),new Map):getFocusableNodes(asArray(tt),new Map);return{first:et[0],last:et[et.length-1]}},defaultOptions$1=function(tt){return Object.assign({scope:document.body,cycle:!0,onlyTabbable:!0},tt)},moveFocus=function(tt,nt,et){nt===void 0&&(nt={});var rt=defaultOptions$1(nt),ot=getRelativeFocusable(tt,rt.scope,rt.onlyTabbable);if(ot){var at=et(ot,rt.cycle);at&&focusOn(at.node,rt.focusOptions)}},focusNextElement=function(tt,nt){nt===void 0&&(nt={}),moveFocus(tt,nt,function(et,rt){var ot=et.next,at=et.first;return ot||rt&&at})},focusPrevElement=function(tt,nt){nt===void 0&&(nt={}),moveFocus(tt,nt,function(et,rt){var ot=et.prev,at=et.last;return ot||rt&&at})},pickBoundary=function(tt,nt,et){var rt,ot=getBoundary(tt,(rt=nt.onlyTabbable)!==null&&rt!==void 0?rt:!0),at=ot[et];at&&focusOn(at.node,nt.focusOptions)},focusFirstElement=function(tt,nt){nt===void 0&&(nt={}),pickBoundary(tt,nt,"first")},focusLastElement=function(tt,nt){nt===void 0&&(nt={}),pickBoundary(tt,nt,"last")};function deferAction(tt){setTimeout(tt,1)}var inlineProp=function tt(nt,et){var rt={};return rt[nt]=et,rt},extractRef=function tt(nt){return nt&&"current"in nt?nt.current:nt},focusOnBody=function tt(){return document&&document.activeElement===document.body},isFreeFocus=function tt(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,tryRestoreFocus=function tt(){return null},lastPortaledElement=null,focusWasOutsideWindow=!1,windowFocused=!1,defaultWhitelist=function tt(){return!0},focusWhitelisted=function tt(nt){return(lastActiveTrap.whiteList||defaultWhitelist)(nt)},recordPortal=function tt(nt,et){lastPortaledElement={observerNode:nt,portaledElement:et}},focusIsPortaledPair=function tt(nt){return lastPortaledElement&&lastPortaledElement.portaledElement===nt};function autoGuard(tt,nt,et,rt){var ot=null,at=tt;do{var st=rt[at];if(st.guard)st.node.dataset.focusAutoGuard&&(ot=st);else if(st.lockItem){if(at!==tt)return;ot=null}else break}while((at+=et)!==nt);ot&&(ot.node.tabIndex=0)}var focusWasOutside=function tt(nt){return nt?!!focusWasOutsideWindow:focusWasOutsideWindow==="meanwhile"},checkInHost=function tt(nt,et,rt){return et&&(et.host===nt&&(!et.activeElement||rt.contains(et.activeElement))||et.parentNode&&tt(nt,et.parentNode,rt))},withinHost=function tt(nt,et){return et.some(function(rt){return checkInHost(nt,rt,rt)})},getNodeFocusables=function tt(nt){return getFocusableNodes(nt,new Map)},isNotFocusable=function tt(nt){return!getNodeFocusables([nt.parentNode]).some(function(et){return et.node===nt})},activateTrap=function tt(){var nt=!1;if(lastActiveTrap){var et=lastActiveTrap,rt=et.observed,ot=et.persistentFocus,at=et.autoFocus,st=et.shards,ut=et.crossFrame,ct=et.focusOptions,pt=et.noFocusGuards,dt=rt||lastPortaledElement&&lastPortaledElement.portaledElement;if(focusOnBody()&&lastActiveFocus&&(!document.body.contains(lastActiveFocus)||isNotFocusable(lastActiveFocus))){lastActiveFocus=null;var ft=tryRestoreFocus();ft&&ft.focus()}var bt=document&&document.activeElement;if(dt){var ht=[dt].concat(st.map(extractRef).filter(Boolean)),Mt=function(){if(!focusWasOutside(ut)||!pt||!lastActiveFocus||windowFocused)return!1;var vt=getNodeFocusables(ht),At=vt.findIndex(function(St){var Et=St.node;return Et===lastActiveFocus});return At===0||At===vt.length-1};if((!bt||focusWhitelisted(bt))&&(ot||Mt()||!isFreeFocus()||!lastActiveFocus&&at)&&(dt&&!(focusInside(ht)||bt&&withinHost(bt,ht)||focusIsPortaledPair(bt))&&(document&&!lastActiveFocus&&bt&&!at?(bt.blur&&bt.blur(),document.body.focus()):(nt=moveFocusInside(ht,lastActiveFocus,{focusOptions:ct}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement,tryRestoreFocus=captureFocusRestore(lastActiveFocus)),document&&bt!==document.activeElement&&document.querySelector("[data-focus-auto-guard]")){var mt=document&&document.activeElement,Ot=expandFocusableNodes(ht),zt=Ot.map(function(yt){var vt=yt.node;return vt}).indexOf(mt);zt>-1&&(Ot.filter(function(yt){var vt=yt.guard,At=yt.node;return vt&&At.dataset.focusAutoGuard}).forEach(function(yt){var vt=yt.node;return vt.removeAttribute("tabIndex")}),autoGuard(zt,Ot.length,1,Ot),autoGuard(zt,-1,-1,Ot))}}}return nt},onTrap=function tt(nt){activateTrap()&&nt&&(nt.stopPropagation(),nt.preventDefault())},onBlur=function tt(){return deferAction(activateTrap)},onFocus=function tt(nt){var et=nt.target,rt=nt.currentTarget;rt.contains(et)||recordPortal(rt,et)},FocusWatcher=function tt(){return null},onWindowFocus=function tt(){windowFocused=!0},onWindowBlur=function tt(){windowFocused=!1,focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function tt(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("focus",onWindowFocus),window.addEventListener("blur",onWindowBlur)},detachHandler=function tt(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("focus",onWindowFocus),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(tt){return tt.filter(function(nt){var et=nt.disabled;return!et})}var focusLockAPI={moveFocusInside,focusInside,focusNextElement,focusPrevElement,focusFirstElement,focusLastElement,captureFocusRestore};function handleStateChangeOnClient(tt){var nt=tt.slice(-1)[0];nt&&!lastActiveTrap&&attachHandler();var et=lastActiveTrap,rt=et&&nt&&nt.id===et.id;lastActiveTrap=nt,et&&!rt&&(et.onDeactivation(),tt.filter(function(ot){var at=ot.id;return at===et.id}).length||et.returnFocus(!nt)),nt?(lastActiveFocus=null,(!rt||et.observed!==nt.observed)&&nt.onActivation(focusLockAPI),activateTrap(),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(tt){return tt(focusLockAPI)});const FocusTrap=withSideEffect(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=reactExports.forwardRef(function tt(nt,et){return reactExports.createElement(FocusLock,_extends$Q({sideCar:FocusTrap,ref:et},nt))}),_ref=FocusLock.propTypes||{};_ref.sideCar;_objectWithoutPropertiesLoose$m(_ref,["sideCar"]);FocusLockCombination.propTypes={};var useFocusInside=function tt(nt){reactExports.useEffect(function(){var et=!0;return mediumEffect.useMedium(function(rt){var ot=nt&&nt.current;et&&ot&&(rt.focusInside(ot)||rt.moveFocusInside(ot,null))}),function(){et=!1}},[nt])};function MoveFocusInside(tt){var nt=tt.disabled,et=nt===void 0?!1:nt,rt=tt.className,ot=tt.children,at=reactExports.useRef(null);return useFocusInside(et?void 0:at),reactExports.createElement("div",_extends$Q({},inlineProp(FOCUS_AUTO,!et),{ref:at,className:rt}),ot)}MoveFocusInside.propTypes={};function ownKeys$k(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$j(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$k(Object(et),!0).forEach(function(rt){_defineProperty$n(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$k(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _defineProperty$n(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}function _slicedToArray$g(tt,nt){return _arrayWithHoles$g(tt)||_iterableToArrayLimit$g(tt,nt)||_unsupportedIterableToArray$g(tt,nt)||_nonIterableRest$g()}function _nonIterableRest$g(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
440
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$g(tt,nt){if(tt){if(typeof tt=="string")return _arrayLikeToArray$g(tt,nt);var et=Object.prototype.toString.call(tt).slice(8,-1);if(et==="Object"&&tt.constructor&&(et=tt.constructor.name),et==="Map"||et==="Set")return Array.from(tt);if(et==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(et))return _arrayLikeToArray$g(tt,nt)}}function _arrayLikeToArray$g(tt,nt){(nt==null||nt>tt.length)&&(nt=tt.length);for(var et=0,rt=new Array(nt);et<nt;et++)rt[et]=tt[et];return rt}function _iterableToArrayLimit$g(tt,nt){var et=tt==null?null:typeof Symbol<"u"&&tt[Symbol.iterator]||tt["@@iterator"];if(et!=null){var rt=[],ot=!0,at=!1,st,ut;try{for(et=et.call(tt);!(ot=(st=et.next()).done)&&(rt.push(st.value),!(nt&&rt.length===nt));ot=!0);}catch(ct){at=!0,ut=ct}finally{try{!ot&&et.return!=null&&et.return()}finally{if(at)throw ut}}return rt}}function _arrayWithHoles$g(tt){if(Array.isArray(tt))return tt}var OPPOSITE_POSITIONS={top:"bottom",bottom:"top",right:"left",left:"right"};function getOppositePosition(tt){return OPPOSITE_POSITIONS[tt]}function isVerticalPosition(tt){return tt==="top"||tt==="bottom"}function capitalize(tt){return tt.charAt(0).toUpperCase()+tt.slice(1)}function fromPopperPlacement(tt){var nt=tt.replace(/(top|bottom)-start$/,"$1Left").replace(/(top|bottom)-end$/,"$1Right").replace(/(left|right)-start$/,"$1Top").replace(/(left|right)-end$/,"$1Bottom");return PLACEMENT[nt]||null}function splitPlacement(tt){var nt=tt.match(/^([a-z]+)([A-Z][a-z]+)?/)||[];return nt.slice(1,3).filter(Boolean).map(function(et){return et.toLowerCase()})}function getPopoverMarginStyles(tt,nt,et){var rt=splitPlacement(nt),ot=_slicedToArray$g(rt,1),at=ot[0],st=getOppositePosition(at);if(!st)return null;var ut="margin".concat(capitalize(st));return _defineProperty$n({},ut,"".concat(tt+et,"px"))}function getStartPosition(tt,nt,et,rt){tt=_objectSpread$j({},tt);var ot=splitPlacement(nt),at=_slicedToArray$g(ot,1),st=at[0],ut=(et>0?et:rt)*2;return isVerticalPosition(st)?tt.top+=st==="top"?ut:-ut:tt.left+=st==="left"?ut:-ut,"translate3d(".concat(tt.left,"px, ").concat(tt.top,"px, 0)")}function getEndPosition(tt){return"translate3d(".concat(tt.left,"px, ").concat(tt.top,"px, 0)")}function getArrowPositionStyles(tt,nt){var et,rt=splitPlacement(nt),ot=_slicedToArray$g(rt,1),at=ot[0],st=getOppositePosition(at);if(!st)return null;var ut=isVerticalPosition(at)?"left":"top";return et={},_defineProperty$n(et,ut,"".concat(tt[ut],"px")),_defineProperty$n(et,st,"-".concat(ARROW_SIZE-2,"px")),et}function ownKeys$j(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$i(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$j(Object(et),!0).forEach(function(rt){_defineProperty$m(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$j(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _defineProperty$m(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}function getBodyStyles(tt){var nt=tt.$animationDuration,et=tt.$isOpen,rt=tt.$isAnimating,ot=tt.$placement,at=tt.$popoverOffset,st=tt.$showArrow,ut=tt.$theme,ct=tt.$popoverMargin,pt=tt.$isHoverTrigger;return _objectSpread$i(_objectSpread$i({position:"absolute",top:0,left:0,backgroundColor:ut.colors.backgroundTertiary,borderTopLeftRadius:ut.borders.popoverBorderRadius,borderTopRightRadius:ut.borders.popoverBorderRadius,borderBottomRightRadius:ut.borders.popoverBorderRadius,borderBottomLeftRadius:ut.borders.popoverBorderRadius,boxShadow:ut.lighting.shadow600,transitionProperty:"opacity,transform",transitionDuration:rt?et?"0.1s":"".concat(nt,"ms"):"0s",transitionTimingFunction:et?ut.animation.easeOutCurve:ut.animation.easeInCurve,opacity:rt&&et?1:0,transform:rt&&et?getEndPosition(at):getStartPosition(at,ot,st?ARROW_SIZE:0,ct)},getPopoverMarginStyles(st?ARROW_SIZE:0,ot,ct)),pt?{animationDuration:".1s",animationName:{"0%":{pointerEvents:"none"},"99%":{pointerEvents:"none"},"100%":{pointerEvents:"auto"}}}:{})}var Body$2=styled("div",getBodyStyles);Body$2.displayName="Body";Body$2.displayName="Body";function getArrowStyles(tt){var nt=tt.$arrowOffset,et=tt.$placement,rt=tt.$theme;return _objectSpread$i({backgroundColor:rt.colors.backgroundTertiary,boxShadow:rt.lighting.shadow600,width:"".concat(ARROW_WIDTH,"px"),height:"".concat(ARROW_WIDTH,"px"),transform:"rotate(45deg)",position:"absolute"},getArrowPositionStyles(nt,et))}var Arrow$1=styled("div",getArrowStyles);Arrow$1.displayName="Arrow";Arrow$1.displayName="Arrow";function getInnerStyles(tt){var nt=tt.$theme;return{backgroundColor:nt.colors.backgroundTertiary,borderTopLeftRadius:nt.borders.popoverBorderRadius,borderTopRightRadius:nt.borders.popoverBorderRadius,borderBottomRightRadius:nt.borders.popoverBorderRadius,borderBottomLeftRadius:nt.borders.popoverBorderRadius,color:nt.colors.contentPrimary,position:"relative"}}var Inner$1=styled("div",getInnerStyles);Inner$1.displayName="Inner";Inner$1.displayName="Inner";var Padding=styled("div",{paddingLeft:"12px",paddingTop:"12px",paddingRight:"12px",paddingBottom:"12px"});Padding.displayName="Padding";Padding.displayName="Padding";var Hidden=styled("div",{display:"none"});Hidden.displayName="Hidden";Hidden.displayName="Hidden";var baseDefaultProps$1={accessibilityType:ACCESSIBILITY_TYPE.menu,focusLock:!1,autoFocus:!0,returnFocus:!0,ignoreBoundary:!1,overrides:{},onMouseEnterDelay:200,onMouseLeaveDelay:200,placement:PLACEMENT.auto,showArrow:!1,triggerType:TRIGGER_TYPE.click,renderAll:!1};function ownKeys$i(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$h(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$i(Object(et),!0).forEach(function(rt){_defineProperty$l(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$i(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _extends$A(){return _extends$A=Object.assign?Object.assign.bind():function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_extends$A.apply(this,arguments)}function _typeof$b(tt){"@babel/helpers - typeof";return _typeof$b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(nt){return typeof nt}:function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$b(tt)}function _classCallCheck$j(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$9(tt,nt){for(var et=0;et<nt.length;et++){var rt=nt[et];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(tt,rt.key,rt)}}function _createClass$h(tt,nt,et){return nt&&_defineProperties$9(tt.prototype,nt),Object.defineProperty(tt,"prototype",{writable:!1}),tt}function _inherits$j(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function");tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,writable:!0,configurable:!0}}),Object.defineProperty(tt,"prototype",{writable:!1}),nt&&_setPrototypeOf$9(tt,nt)}function _setPrototypeOf$9(tt,nt){return _setPrototypeOf$9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,ot){return rt.__proto__=ot,rt},_setPrototypeOf$9(tt,nt)}function _createSuper$8(tt){var nt=_isNativeReflectConstruct$8();return function(){var rt=_getPrototypeOf$9(tt),ot;if(nt){var at=_getPrototypeOf$9(this).constructor;ot=Reflect.construct(rt,arguments,at)}else ot=rt.apply(this,arguments);return _possibleConstructorReturn$j(this,ot)}}function _possibleConstructorReturn$j(tt,nt){if(nt&&(_typeof$b(nt)==="object"||typeof nt=="function"))return nt;if(nt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$9(tt)}function _assertThisInitialized$9(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _isNativeReflectConstruct$8(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$9(tt){return _getPrototypeOf$9=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$9(tt)}function _defineProperty$l(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var PopoverInner=function(tt){_inherits$j(et,tt);var nt=_createSuper$8(et);function et(){var rt;_classCallCheck$j(this,et);for(var ot=arguments.length,at=new Array(ot),st=0;st<ot;st++)at[st]=arguments[st];return rt=nt.call.apply(nt,[this].concat(at)),_defineProperty$l(_assertThisInitialized$9(rt),"animateInTimer",void 0),_defineProperty$l(_assertThisInitialized$9(rt),"animateOutTimer",void 0),_defineProperty$l(_assertThisInitialized$9(rt),"animateOutCompleteTimer",void 0),_defineProperty$l(_assertThisInitialized$9(rt),"onMouseEnterTimer",void 0),_defineProperty$l(_assertThisInitialized$9(rt),"onMouseLeaveTimer",void 0),_defineProperty$l(_assertThisInitialized$9(rt),"anchorRef",reactExports.createRef()),_defineProperty$l(_assertThisInitialized$9(rt),"popperRef",reactExports.createRef()),_defineProperty$l(_assertThisInitialized$9(rt),"arrowRef",reactExports.createRef()),_defineProperty$l(_assertThisInitialized$9(rt),"state",rt.getDefaultState(rt.props)),_defineProperty$l(_assertThisInitialized$9(rt),"animateIn",function(){rt.props.isOpen&&rt.setState({isAnimating:!0})}),_defineProperty$l(_assertThisInitialized$9(rt),"animateOut",function(){rt.props.isOpen||(rt.setState({isAnimating:!0}),rt.animateOutCompleteTimer=setTimeout(function(){rt.setState({isAnimating:!1,placement:rt.props.placement})},rt.props.animateOutTime||ANIMATE_OUT_TIME))}),_defineProperty$l(_assertThisInitialized$9(rt),"onAnchorClick",function(ut){rt.props.onClick&&rt.props.onClick(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"onAnchorMouseEnter",function(ut){rt.onMouseLeaveTimer&&clearTimeout(rt.onMouseLeaveTimer),rt.triggerOnMouseEnterWithDelay(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"onAnchorMouseLeave",function(ut){rt.onMouseEnterTimer&&clearTimeout(rt.onMouseEnterTimer),rt.triggerOnMouseLeaveWithDelay(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"onPopoverMouseEnter",function(){rt.onMouseLeaveTimer&&clearTimeout(rt.onMouseLeaveTimer)}),_defineProperty$l(_assertThisInitialized$9(rt),"onPopoverMouseLeave",function(ut){rt.triggerOnMouseLeaveWithDelay(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"onPopperUpdate",function(ut,ct){var pt=fromPopperPlacement(ct.placement)||PLACEMENT.top;return rt.setState({arrowOffset:ut.arrow,popoverOffset:ut.popper,placement:pt}),rt.animateInTimer=setTimeout(rt.animateIn,ANIMATE_IN_TIME),ct}),_defineProperty$l(_assertThisInitialized$9(rt),"triggerOnMouseLeave",function(ut){rt.props.onMouseLeave&&rt.props.onMouseLeave(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"triggerOnMouseEnter",function(ut){rt.props.onMouseEnter&&rt.props.onMouseEnter(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"onDocumentClick",function(ut){var ct=ut.composedPath?ut.composedPath()[0]:ut.target,pt=rt.popperRef.current,dt=rt.anchorRef.current;!pt||pt===ct||ct instanceof Node&&pt.contains(ct)||!dt||dt===ct||ct instanceof Node&&dt.contains(ct)||rt.props.onClickOutside&&rt.props.onClickOutside(ut)}),rt}return _createClass$h(et,[{key:"componentDidMount",value:function(){this.setState({isMounted:!0})}},{key:"componentDidUpdate",value:function(ot,at){this.init(ot,at),this.props.accessibilityType!==ACCESSIBILITY_TYPE.tooltip&&this.props.autoFocus&&!this.state.autoFocusAfterPositioning&&this.popperRef.current!==null&&this.popperRef.current.getBoundingClientRect().top>0&&this.setState({autoFocusAfterPositioning:!0})}},{key:"init",value:function(ot,at){if(this.props.isOpen!==ot.isOpen||this.state.isMounted!==at.isMounted||this.state.isLayerMounted!==at.isLayerMounted){if(this.props.isOpen&&this.state.isLayerMounted){this.clearTimers();return}if(!this.props.isOpen&&ot.isOpen){this.animateOutTimer=setTimeout(this.animateOut,20);return}}}},{key:"componentWillUnmount",value:function(){this.clearTimers()}},{key:"getDefaultState",value:function(ot){return{isAnimating:!1,arrowOffset:{left:0,top:0},popoverOffset:{left:0,top:0},placement:ot.placement,isMounted:!1,isLayerMounted:!1,autoFocusAfterPositioning:!1}}},{key:"clearTimers",value:function(){[this.animateInTimer,this.animateOutTimer,this.animateOutCompleteTimer,this.onMouseEnterTimer,this.onMouseLeaveTimer].forEach(function(ot){ot&&clearTimeout(ot)})}},{key:"triggerOnMouseLeaveWithDelay",value:function(ot){var at=this,st=this.props.onMouseLeaveDelay;if(st){this.onMouseLeaveTimer=setTimeout(function(){return at.triggerOnMouseLeave(ot)},st);return}this.triggerOnMouseLeave(ot)}},{key:"triggerOnMouseEnterWithDelay",value:function(ot){var at=this,st=this.props.onMouseEnterDelay;if(st){this.onMouseEnterTimer=setTimeout(function(){return at.triggerOnMouseEnter(ot)},st);return}this.triggerOnMouseEnter(ot)}},{key:"isClickTrigger",value:function(){return this.props.triggerType===TRIGGER_TYPE.click}},{key:"isHoverTrigger",value:function(){return this.props.triggerType===TRIGGER_TYPE.hover}},{key:"isAccessibilityTypeMenu",value:function(){return this.props.accessibilityType===ACCESSIBILITY_TYPE.menu}},{key:"isAccessibilityTypeTooltip",value:function(){return this.props.accessibilityType===ACCESSIBILITY_TYPE.tooltip}},{key:"getAnchorIdAttr",value:function(){var ot=this.getPopoverIdAttr();return ot?"".concat(ot,"__anchor"):null}},{key:"getPopoverIdAttr",value:function(){return this.props.id||null}},{key:"getAnchorProps",value:function(){var ot=this.props.isOpen,at={ref:this.anchorRef},st=this.getPopoverIdAttr();if(this.isAccessibilityTypeMenu()){var ut=this.isClickTrigger()?"aria-controls":"aria-owns";at[ut]=ot?st:null,at["aria-haspopup"]=!0,at["aria-expanded"]=!!ot}else this.isAccessibilityTypeTooltip()&&(at.id=this.getAnchorIdAttr(),at["aria-describedby"]=ot?st:null);return this.isHoverTrigger()?(at.onMouseEnter=this.onAnchorMouseEnter,at.onMouseLeave=this.onAnchorMouseLeave,at.onBlur=this.props.onBlur,at.onFocus=this.props.onFocus):at.onClick=this.onAnchorClick,at}},{key:"getPopoverBodyProps",value:function(){var ot={},at=this.getPopoverIdAttr();return this.isAccessibilityTypeMenu()?ot.id=at:this.isAccessibilityTypeTooltip()&&(ot.id=at,ot.role="tooltip"),this.isHoverTrigger()&&(ot.onMouseEnter=this.onPopoverMouseEnter,ot.onMouseLeave=this.onPopoverMouseLeave),ot}},{key:"getSharedProps",value:function(){var ot=this.props,at=ot.isOpen,st=ot.showArrow,ut=ot.popoverMargin,ct=ut===void 0?POPOVER_MARGIN:ut,pt=this.state,dt=pt.isAnimating,ft=pt.arrowOffset,bt=pt.popoverOffset,ht=pt.placement;return{$showArrow:!!st,$arrowOffset:ft,$popoverOffset:bt,$placement:ht,$isAnimating:dt,$animationDuration:this.props.animateOutTime||ANIMATE_OUT_TIME,$isOpen:at,$popoverMargin:ct,$isHoverTrigger:this.isHoverTrigger()}}},{key:"getAnchorFromChildren",value:function(){var ot=this.props.children,at=reactExports.Children.toArray(ot);return at.length!==1&&console.error("[baseui] Exactly 1 child must be passed to Popover/Tooltip, found ".concat(at.length," children")),at[0]}},{key:"renderAnchor",value:function(){var ot=this.getAnchorFromChildren();if(!ot)return null;var at=reactExports.isValidElement(ot),st=this.getAnchorProps();return _typeof$b(ot)==="object"&&at?reactExports.cloneElement(ot,st):reactExports.createElement("span",_extends$A({key:"popover-anchor"},st),ot)}},{key:"renderPopover",value:function(ot){var at=this.props,st=at.showArrow,ut=at.overrides,ct=ut===void 0?{}:ut,pt=ct.Arrow,dt=ct.Body,ft=ct.Inner,bt=getOverride(pt)||Arrow$1,ht=getOverride(dt)||Body$2,Mt=getOverride(ft)||Inner$1,mt=this.getSharedProps(),Ot=this.getPopoverBodyProps();return reactExports.createElement(ht,_extends$A({key:"popover-body",ref:this.popperRef,"data-baseweb":this.props["data-baseweb"]||"popover"},Ot,mt,getOverrideProps(dt)),st?reactExports.createElement(bt,_extends$A({key:"popover-arrow",ref:this.arrowRef},mt,getOverrideProps(pt))):null,reactExports.createElement(Mt,_extends$A({},mt,getOverrideProps(ft)),ot))}},{key:"renderContent",value:function(){var ot=this.props.content;return typeof ot=="function"?ot():ot}},{key:"render",value:function(){var ot=this,at=this.state.isMounted&&(this.props.isOpen||this.state.isAnimating),st=[this.renderAnchor()],ut=at||this.props.renderAll?this.renderContent():null,ct={modifiers:{preventOverflow:{enabled:!this.props.ignoreBoundary,padding:0}}};return ut&&(at?st.push(reactExports.createElement(Layer,{key:"new-layer",mountNode:this.props.mountNode,onEscape:this.props.onEsc,onDocumentClick:this.isHoverTrigger()?void 0:this.onDocumentClick,isHoverLayer:this.isHoverTrigger(),onMount:function(){return ot.setState({isLayerMounted:!0})},onUnmount:function(){return ot.setState({isLayerMounted:!1})}},reactExports.createElement(Tether,{anchorRef:this.anchorRef.current,arrowRef:this.arrowRef.current,popperRef:this.popperRef.current,popperOptions:_objectSpread$h(_objectSpread$h({},ct),this.props.popperOptions),onPopperUpdate:this.onPopperUpdate,placement:this.state.placement},this.props.focusLock&&this.props.accessibilityType!==ACCESSIBILITY_TYPE.tooltip?reactExports.createElement(FocusLockCombination,{disabled:!this.props.focusLock,noFocusGuards:!1,returnFocus:!this.isHoverTrigger()&&this.props.returnFocus,autoFocus:this.state.autoFocusAfterPositioning,crossFrame:!1,focusOptions:this.props.focusOptions},this.renderPopover(ut)):reactExports.createElement(MoveFocusInside,{disabled:!this.props.autoFocus||!this.state.autoFocusAfterPositioning},this.renderPopover(ut))))):st.push(reactExports.createElement(Hidden,{key:"hidden-layer"},ut))),st}}]),et}(reactExports.Component);_defineProperty$l(PopoverInner,"defaultProps",baseDefaultProps$1);var Popover$1=function tt(nt){var et=nt.innerRef,rt=useUID();return reactExports.createElement(PopoverInner,_extends$A({id:nt.id||rt,ref:et},nt))};Popover$1.defaultProps=baseDefaultProps$1;var _excluded$i=["children"];function _objectWithoutProperties$k(tt,nt){if(tt==null)return{};var et=_objectWithoutPropertiesLoose$i(tt,nt),rt,ot;if(Object.getOwnPropertySymbols){var at=Object.getOwnPropertySymbols(tt);for(ot=0;ot<at.length;ot++)rt=at[ot],!(nt.indexOf(rt)>=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(et[rt]=tt[rt])}return et}function _objectWithoutPropertiesLoose$i(tt,nt){if(tt==null)return{};var et={},rt=Object.keys(tt),ot,at;for(at=0;at<rt.length;at++)ot=rt[at],!(nt.indexOf(ot)>=0)&&(et[ot]=tt[ot]);return et}function StatefulPopover(tt){var nt=tt.children,et=_objectWithoutProperties$k(tt,_excluded$i);return reactExports.createElement(StatefulContainer$1,et,function(rt){return reactExports.createElement(Popover$1,rt,nt)})}StatefulPopover.defaultProps={accessibilityType:ACCESSIBILITY_TYPE.menu,ignoreBoundary:!1,overrides:{},onMouseEnterDelay:200,onMouseLeaveDelay:200,placement:PLACEMENT.auto,showArrow:!1,triggerType:TRIGGER_TYPE.click,dismissOnClickOutside:!0,dismissOnEsc:!0,stateReducer:function tt(nt,et){return et},popoverMargin:POPOVER_MARGIN};var baseDefaultProps={accessibilityType:ACCESSIBILITY_TYPE.tooltip,focusLock:!1,autoFocus:!1,returnFocus:!1,onMouseEnterDelay:200,onMouseLeaveDelay:200,overrides:{},placement:PLACEMENT.auto,popoverMargin:0,showArrow:!1,triggerType:TRIGGER_TYPE.hover,renderAll:!1};function _typeof$a(tt){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(nt){return typeof nt}:function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$a(tt)}function ownKeys$h(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$g(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$h(Object(et),!0).forEach(function(rt){_defineProperty$k(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$h(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _classCallCheck$i(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$8(tt,nt){for(var et=0;et<nt.length;et++){var rt=nt[et];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(tt,rt.key,rt)}}function _createClass$g(tt,nt,et){return nt&&_defineProperties$8(tt.prototype,nt),Object.defineProperty(tt,"prototype",{writable:!1}),tt}function _inherits$i(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function");tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,writable:!0,configurable:!0}}),Object.defineProperty(tt,"prototype",{writable:!1}),nt&&_setPrototypeOf$8(tt,nt)}function _setPrototypeOf$8(tt,nt){return _setPrototypeOf$8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,ot){return rt.__proto__=ot,rt},_setPrototypeOf$8(tt,nt)}function _createSuper$7(tt){var nt=_isNativeReflectConstruct$7();return function(){var rt=_getPrototypeOf$8(tt),ot;if(nt){var at=_getPrototypeOf$8(this).constructor;ot=Reflect.construct(rt,arguments,at)}else ot=rt.apply(this,arguments);return _possibleConstructorReturn$i(this,ot)}}function _possibleConstructorReturn$i(tt,nt){if(nt&&(_typeof$a(nt)==="object"||typeof nt=="function"))return nt;if(nt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$8(tt)}function _assertThisInitialized$8(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _isNativeReflectConstruct$7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$8(tt){return _getPrototypeOf$8=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$8(tt)}function _defineProperty$k(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var StatefulContainer=function(tt){_inherits$i(et,tt);var nt=_createSuper$7(et);function et(){return _classCallCheck$i(this,et),nt.apply(this,arguments)}return _createClass$g(et,[{key:"render",value:function(){return reactExports.createElement(StatefulContainer$1,this.props)}}]),et}(reactExports.Component);_defineProperty$k(StatefulContainer,"defaultProps",_objectSpread$g({},baseDefaultProps));function ownKeys$g(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$f(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$g(Object(et),!0).forEach(function(rt){_defineProperty$j(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$g(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _defineProperty$j(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var Body$1=styled("div",function(tt){return _objectSpread$f(_objectSpread$f({},getBodyStyles(tt)),{},{backgroundColor:tt.$theme.colors.tooltipBackground,borderTopLeftRadius:tt.$theme.borders.radius300,borderTopRightRadius:tt.$theme.borders.radius300,borderBottomRightRadius:tt.$theme.borders.radius300,borderBottomLeftRadius:tt.$theme.borders.radius300,boxShadow:tt.$theme.lighting.shadow400,color:tt.$theme.colors.tooltipText,transitionProperty:"opacity",transform:getEndPosition(tt.$popoverOffset)})});Body$1.displayName="Body";Body$1.displayName="Body";var Inner=styled("div",function(tt){return _objectSpread$f(_objectSpread$f(_objectSpread$f({},getInnerStyles(tt)),{},{backgroundColor:tt.$theme.colors.tooltipBackground,borderTopLeftRadius:tt.$theme.borders.radius300,borderTopRightRadius:tt.$theme.borders.radius300,borderBottomRightRadius:tt.$theme.borders.radius300,borderBottomLeftRadius:tt.$theme.borders.radius300,paddingTop:tt.$theme.sizing.scale300,paddingBottom:tt.$theme.sizing.scale300,paddingLeft:tt.$theme.sizing.scale600,paddingRight:tt.$theme.sizing.scale600},tt.$theme.typography.font150),{},{color:tt.$theme.colors.tooltipText})});Inner.displayName="Inner";Inner.displayName="Inner";var Arrow=styled("div",function(tt){return _objectSpread$f(_objectSpread$f({},getArrowStyles(tt)),{},{backgroundColor:tt.$theme.colors.tooltipBackground})});Arrow.displayName="Arrow";Arrow.displayName="Arrow";function _typeof$9(tt){"@babel/helpers - typeof";return _typeof$9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(nt){return typeof nt}:function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$9(tt)}function ownKeys$f(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$e(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$f(Object(et),!0).forEach(function(rt){_defineProperty$i(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$f(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _extends$z(){return _extends$z=Object.assign?Object.assign.bind():function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_extends$z.apply(this,arguments)}function _classCallCheck$h(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$7(tt,nt){for(var et=0;et<nt.length;et++){var rt=nt[et];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(tt,rt.key,rt)}}function _createClass$f(tt,nt,et){return nt&&_defineProperties$7(tt.prototype,nt),Object.defineProperty(tt,"prototype",{writable:!1}),tt}function _inherits$h(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function");tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,writable:!0,configurable:!0}}),Object.defineProperty(tt,"prototype",{writable:!1}),nt&&_setPrototypeOf$7(tt,nt)}function _setPrototypeOf$7(tt,nt){return _setPrototypeOf$7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,ot){return rt.__proto__=ot,rt},_setPrototypeOf$7(tt,nt)}function _createSuper$6(tt){var nt=_isNativeReflectConstruct$6();return function(){var rt=_getPrototypeOf$7(tt),ot;if(nt){var at=_getPrototypeOf$7(this).constructor;ot=Reflect.construct(rt,arguments,at)}else ot=rt.apply(this,arguments);return _possibleConstructorReturn$h(this,ot)}}function _possibleConstructorReturn$h(tt,nt){if(nt&&(_typeof$9(nt)==="object"||typeof nt=="function"))return nt;if(nt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$7(tt)}function _assertThisInitialized$7(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _isNativeReflectConstruct$6(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$7(tt){return _getPrototypeOf$7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$7(tt)}function _defineProperty$i(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var Tooltip$1=function(tt){_inherits$h(et,tt);var nt=_createSuper$6(et);function et(){return _classCallCheck$h(this,et),nt.apply(this,arguments)}return _createClass$f(et,[{key:"render",value:function(){var ot=mergeOverrides({Arrow,Body:Body$1,Inner},this.props.overrides);return reactExports.createElement(Popover$1,_extends$z({autoFocus:!1,"data-baseweb":"tooltip"},this.props,{overrides:ot}))}}]),et}(reactExports.Component);_defineProperty$i(Tooltip$1,"defaultProps",_objectSpread$e({},baseDefaultProps));var _excluded$h=["children"];function _objectWithoutProperties$j(tt,nt){if(tt==null)return{};var et=_objectWithoutPropertiesLoose$h(tt,nt),rt,ot;if(Object.getOwnPropertySymbols){var at=Object.getOwnPropertySymbols(tt);for(ot=0;ot<at.length;ot++)rt=at[ot],!(nt.indexOf(rt)>=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(et[rt]=tt[rt])}return et}function _objectWithoutPropertiesLoose$h(tt,nt){if(tt==null)return{};var et={},rt=Object.keys(tt),ot,at;for(at=0;at<rt.length;at++)ot=rt[at],!(nt.indexOf(ot)>=0)&&(et[ot]=tt[ot]);return et}function StatefulTooltip(tt){var nt=tt.children,et=_objectWithoutProperties$j(tt,_excluded$h);return reactExports.createElement(StatefulContainer,et,function(rt){return reactExports.createElement(Tooltip$1,rt,nt)})}StatefulTooltip.defaultProps=StatefulContainer.defaultProps;const StyledWrapper=newStyled("div",{target:"ec3xk5x0"})({display:"table",tableLayout:"fixed",width:"100%"}),StyledEllipsizedDiv=newStyled("div",{target:"ec3xk5x1"})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell"}),StyledTooltipContentWrapper=newStyled("div",{target:"ec3xk5x2"})(({theme:tt})=>({boxSizing:"border-box",fontSize:`${tt.fontSizes.sm}`,maxWidth:`calc(${tt.sizes.contentMaxWidth} - 2 * ${tt.spacing.threeXL})`,maxHeight:tt.sizes.maxTooltipHeight,overflow:["auto","overlay"],padding:`${tt.spacing.xs} ${tt.spacing.md}`,[`@media (max-width: ${tt.breakpoints.sm})`]:{maxWidth:`calc(100% - ${tt.spacing.threeXL})`},img:{maxWidth:"100%"},"*":{fontSize:`${tt.fontSizes.sm} !important`}}));var Placement;(function(tt){tt.AUTO="auto",tt.TOP_LEFT="topLeft",tt.TOP="top",tt.TOP_RIGHT="topRight",tt.RIGHT_TOP="rightTop",tt.RIGHT="right",tt.RIGHT_BOTTOM="rightBottom",tt.BOTTOM_RIGHT="bottomRight",tt.BOTTOM="bottom",tt.BOTTOM_LEFT="bottomLeft",tt.LEFT_BOTTOM="leftBottom",tt.LEFT="left",tt.LEFT_TOP="leftTop"})(Placement||(Placement={}));function Tooltip({content:tt,placement:nt,children:et,inline:rt,style:ot,onMouseEnterDelay:at}){const st=useTheme(),{colors:ut,fontSizes:ct,radii:pt,fontWeights:dt}=st;return jsx$1(StatefulTooltip,{content:tt?jsx$1(StyledTooltipContentWrapper,{className:"stTooltipContent","data-testid":"stTooltipContent",children:tt}):null,placement:PLACEMENT[nt],accessibilityType:ACCESSIBILITY_TYPE.tooltip,showArrow:!1,popoverMargin:10,onMouseEnterDelay:at,overrides:{Body:{style:{borderTopLeftRadius:pt.default,borderTopRightRadius:pt.default,borderBottomLeftRadius:pt.default,borderBottomRightRadius:pt.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:hasLightBackgroundColor(st)?ut.bgColor:ut.secondaryBg,color:ut.bodyText,fontSize:ct.sm,fontWeight:dt.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:jsx$1("div",{style:{display:"flex",flexDirection:"row",justifyContent:rt?"flex-end":"",...ot},"data-testid":"stTooltipHoverTarget",className:"stTooltipHoverTarget",children:et})})}function OverflowTooltip({content:tt,placement:nt,children:et,inline:rt,style:ot}){const at=React$1.useRef(null),[st,ut]=reactExports.useState(!1);return React$1.useEffect(()=>{const ct=at!=null&&at.current?at.current.offsetWidth<at.current.scrollWidth:!1;ct!==st&&ut(ct)},[et,st]),jsx$1(Tooltip,{content:st?tt:"",placement:nt,inline:rt,children:jsx$1(StyledWrapper,{children:jsx$1(StyledEllipsizedDiv,{ref:at,style:ot,children:et})})})}const StyledTooltipIconWrapper=newStyled("div",{target:"eqrpmav0"})(({isLatex:tt,theme:nt})=>({display:"flex",alignItems:"center",marginTop:tt?nt.spacing.md:"0","& .stTooltipHoverTarget > svg":{stroke:nt.colors.fadedText60,strokeWidth:2.25}})),StyledLabelHelpWrapper=newStyled("div",{target:"eqrpmav1"})(({isLatex:tt})=>({display:"flex",visibility:"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center",...tt?{justifyContent:"center"}:{}})),StyledLabelHelpInline=newStyled("label",{target:"eqrpmav2"})(({theme:tt})=>({marginLeft:tt.spacing.xs,position:"relative",display:"flex",flexDirection:"row"}));function TooltipIcon({placement:tt=Placement.AUTO,isLatex:nt=!1,content:et,children:rt,markdownProps:ot,onMouseEnterDelay:at}){const st=useTheme();return jsx$1(StyledTooltipIconWrapper,{className:"stTooltipIcon","data-testid":"stTooltipIcon",isLatex:nt,children:jsx$1(Tooltip,{content:jsx$1(StreamlitMarkdown$1,{style:{fontSize:st.fontSizes.sm},source:et,allowHTML:!1,...ot||{}}),placement:tt,onMouseEnterDelay:at,inline:!0,children:rt||jsx$1(HelpCircle,{className:"icon",size:st.iconSizes.base})})})}const InlineTooltipIcon=({placement:tt=Placement.TOP_RIGHT,isLatex:nt=!1,content:et,children:rt,markdownProps:ot})=>jsx$1(StyledLabelHelpInline,{children:jsx$1(TooltipIcon,{placement:tt,isLatex:nt,content:et,markdownProps:ot,children:rt})}),streamlitLogo="data:image/svg+xml,%3csvg%20width='301'%20height='165'%20viewBox='0%200%20301%20165'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M150.731%20101.547L98.1387%2073.7471L6.84674%2025.4969C6.7634%2025.4136%206.59674%2025.4136%206.51341%2025.4136C3.18007%2023.8303%20-0.236608%2027.1636%201.0134%2030.497L47.5302%20149.139L47.5385%20149.164C47.5885%20149.281%2047.6302%20149.397%2047.6802%20149.514C49.5885%20153.939%2053.7552%20156.672%2058.2886%20157.747C58.6719%20157.831%2058.9461%20157.906%2059.4064%20157.998C59.8645%20158.1%2060.5052%20158.239%2061.0552%20158.281C61.1469%20158.289%2061.2302%20158.289%2061.3219%20158.297H61.3886C61.4552%20158.306%2061.5219%20158.306%2061.5886%20158.314H61.6802C61.7386%20158.322%2061.8052%20158.322%2061.8636%20158.322H61.9719C62.0386%20158.331%2062.1052%20158.331%2062.1719%20158.331V158.331C121.084%20164.754%20180.519%20164.754%20239.431%20158.331V158.331C240.139%20158.331%20240.831%20158.297%20241.497%20158.231C241.714%20158.206%20241.922%20158.181%20242.131%20158.156C242.156%20158.147%20242.189%20158.147%20242.214%20158.139C242.356%20158.122%20242.497%20158.097%20242.639%20158.072C242.847%20158.047%20243.056%20158.006%20243.264%20157.964C243.681%20157.872%20243.87%20157.806%20244.436%20157.611C245.001%20157.417%20245.94%20157.077%20246.527%20156.794C247.115%20156.511%20247.522%20156.239%20248.014%20155.931C248.622%20155.547%20249.201%20155.155%20249.788%20154.715C250.041%20154.521%20250.214%20154.397%20250.397%20154.222L250.297%20154.164L150.731%20101.547Z'%20fill='%23FF4B4B'/%3e%3cpath%20d='M294.766%2025.4981H294.683L203.357%2073.7483L254.124%20149.357L300.524%2030.4981V30.3315C301.691%2026.8314%20298.108%2023.6648%20294.766%2025.4981'%20fill='%237D353B'/%3e%3cpath%20d='M155.598%202.55572C153.264%20-0.852624%20148.181%20-0.852624%20145.931%202.55572L98.1389%2073.7477L150.731%20101.548L250.398%20154.222C251.024%20153.609%20251.526%20153.012%20252.056%20152.381C252.806%20151.456%20253.506%20150.465%20254.123%20149.356L203.356%2073.7477L155.598%202.55572Z'%20fill='%23BD4043'/%3e%3c/svg%3e";function convertRemToEm(tt){return tt.replace(/rem$/,"em")}function sharedMarkdownStyle(tt){return{a:{color:tt.colors.linkText,textDecoration:"underline"}}}function convertFontSizes(tt,nt,et,rt,ot,at){return ot?at?convertRemToEm(rt):nt:at?convertRemToEm(et):tt}function getMarkdownHeadingDefinitions(tt,nt,et){return{"h1, h2, h3, h4, h5, h6":{fontFamily:tt.genericFonts.headingFont,fontWeight:tt.fontWeights.bold,lineHeight:tt.lineHeights.headings,margin:0,color:"inherit"},h1:{fontSize:convertFontSizes(tt.fontSizes.fourXL,tt.fontSizes.xl,tt.fontSizes.threeXL,tt.fontSizes.xl,nt,et),fontWeight:nt?tt.fontWeights.bold:tt.fontWeights.extrabold,padding:`${tt.spacing.xl} 0 ${tt.spacing.lg} 0`},"h1 b, h1 strong":{fontWeight:tt.fontWeights.extrabold},"h2, h3":{letterSpacing:"-0.005em"},h2:{fontSize:convertFontSizes(tt.fontSizes.threeXL,tt.fontSizes.lg,tt.fontSizes.twoXL,tt.fontSizes.lg,nt,et),padding:`${tt.spacing.lg} 0 ${tt.spacing.lg} 0`},h3:{fontSize:convertFontSizes(tt.fontSizes.twoXL,tt.fontSizes.mdLg,tt.fontSizes.lg,tt.fontSizes.mdLg,nt,et),padding:`${tt.spacing.sm} 0 ${tt.spacing.lg} 0`},h4:{fontSize:convertFontSizes(tt.fontSizes.xl,tt.fontSizes.md,tt.fontSizes.md,tt.fontSizes.md,nt,et),padding:`${tt.spacing.md} 0 ${tt.spacing.lg} 0`},h5:{fontSize:convertFontSizes(tt.fontSizes.lg,tt.fontSizes.sm,tt.fontSizes.md,tt.fontSizes.md,nt,et),padding:`0 0 ${tt.spacing.lg} 0`},h6:{fontSize:convertFontSizes(tt.fontSizes.md,tt.fontSizes.twoSm,tt.fontSizes.md,tt.fontSizes.md,nt,et),padding:`0 0 ${tt.spacing.lg} 0`}}}const StyledStreamlitMarkdown=newStyled("div",{target:"e121c1cl0"})(({theme:tt,isCaption:nt,isInSidebarOrDialog:et,isLabel:rt,boldLabel:ot,largerLabel:at,isToast:st})=>{const ut=rt&&!at||st||nt;return{fontFamily:tt.genericFonts.bodyFont,fontSize:ut?tt.fontSizes.sm:tt.fontSizes.md,marginBottom:rt?"":`-${tt.spacing.lg}`,opacity:nt?.6:void 0,color:"inherit",...sharedMarkdownStyle(tt),...getMarkdownHeadingDefinitions(tt,et,nt),p:{wordBreak:"break-word",marginBottom:rt?tt.spacing.none:"",fontWeight:ot?tt.fontWeights.bold:"",marginTop:tt.spacing.none,marginLeft:tt.spacing.none,marginRight:tt.spacing.none},img:{maxWidth:"100%",maxHeight:rt?"1em":void 0,verticalAlign:"middle"},li:{margin:"0.2em 0 0.2em 1.2em",padding:"0 0 0 0.6em"},blockquote:{margin:"1em 0 1em 0",padding:"0 0 0 1.2em",borderLeft:`${tt.sizes.borderWidth} solid ${tt.colors.lightGray}`},"b, strong":{fontWeight:tt.fontWeights.bold},hr:{margin:"2em 0",padding:0,color:"inherit",backgroundColor:"transparent",border:"none",borderBottom:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,"&:not([size])":{height:tt.sizes.borderWidth}},table:{marginBottom:tt.spacing.lg,borderCollapse:"collapse"},tr:{borderTop:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`},th:{textAlign:"inherit"},"th, td":{padding:`${tt.spacing.xs} ${tt.spacing.md}`,border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`},"span.has-background-color":{padding:`${tt.spacing.threeXS} ${tt.spacing.twoXS}`,margin:tt.spacing.none,borderRadius:tt.radii.md},"p, ol, ul, dl, li":{fontSize:"inherit"}}}),StyledLinkIcon=newStyled("a",{target:"e121c1cl1"})(({theme:tt})=>({lineHeight:0,display:"inline-flex",alignItems:"center",justifyContent:"center",svg:{stroke:tt.colors.fadedText60,strokeWidth:2.25},"&:hover svg":{stroke:tt.colors.bodyText}})),StyledHeadingWithActionElements=newStyled("div",{target:"e121c1cl2"})(({theme:tt})=>({"h1, h2, h3, h4, h5, h6, span":{scrollMarginTop:tt.sizes.headerHeight},...sharedMarkdownStyle(tt),wordBreak:"break-word",textWrap:"pretty",[StyledLinkIcon]:{visibility:"hidden"},"&:hover":{[StyledLinkIcon]:{visibility:"visible"}}})),StyledHeadingActionElements=newStyled("span",{target:"e121c1cl3"})(({theme:tt})=>({marginLeft:tt.spacing.sm,display:"inline-flex",gap:tt.spacing.sm,verticalAlign:"middle","& > *":{marginLeft:"0 !important"}})),StyledHeaderDivider=newStyled("hr",{target:"e121c1cl4"})(({theme:tt,rainbow:nt,color:et})=>({height:`${tt.spacing.threeXS} !important`,marginTop:tt.spacing.sm,marginBottom:tt.spacing.none,border:"none",borderRadius:tt.radii.full,...nt?{background:et}:{backgroundColor:et}})),StyledPreWrapper=newStyled("div",{target:"e121c1cl5"})(({theme:tt})=>({marginBottom:tt.spacing.lg}));var Tags;(function(tt){tt.H1="h1",tt.H2="h2",tt.H3="h3"})(Tags||(Tags={}));function createAnchorFromText(tt){let nt="";return tt&&/^[\x00-\x7F]*$/.test(tt)?nt=tt==null?void 0:tt.toLowerCase().split(/[^\p{L}\p{N}]+/gu).filter(Boolean).join("-"):tt&&(nt=xxhash.h32(tt,43981).toString(16)),nt}function transformLinkUri(tt){return tt}const scrollNodeIntoView=once$1(tt=>{tt.scrollIntoView(!0)}),HeaderActionElements=({elementId:tt,help:nt,hideAnchor:et})=>{const rt=useTheme();return!nt&&et?jsx$1(Fragment,{}):jsxs(StyledHeadingActionElements,{"data-testid":"stHeaderActionElements",children:[nt&&jsx$1(InlineTooltipIcon,{content:nt}),tt&&!et&&jsx$1(StyledLinkIcon,{href:`#${tt}`,children:jsx$1(Link2,{size:rt.iconSizes.base})})]})},HeadingWithActionElements=({tag:tt,anchor:nt,help:et,hideAnchor:rt,children:ot,tagProps:at})=>{const st=React$1.useContext(IsSidebarContext),ut=React$1.useContext(IsDialogContext),[ct,pt]=React$1.useState(nt),[dt,ft]=React$1.useState(null),{addScriptFinishedHandler:bt,removeScriptFinishedHandler:ht}=React$1.useContext(LibContext),Mt=React$1.useCallback(()=>{dt!==null&&window.setTimeout(()=>{scrollNodeIntoView(dt)},300)},[dt]);React$1.useEffect(()=>(bt(Mt),()=>{ht(Mt)}),[bt,ht,Mt]);const mt=React$1.useCallback(At=>{if(At===null)return;const St=nt||createAnchorFromText(At.textContent);pt(St);const Et=window.location.hash.slice(1);Et&&Et===St&&ft(At)},[nt]),Ot=st||ut,zt=jsx$1(HeaderActionElements,{elementId:ct,help:et,hideAnchor:rt||Ot}),yt=Ot?{}:{ref:mt,id:ct},vt=React$1.createElement(tt,{...at,...yt},jsxs(Fragment,{children:[ot,zt]}));return Ot?vt:jsx$1(StyledHeadingWithActionElements,{"data-testid":"stHeadingWithActionElements",children:vt})},CustomHeading=({node:tt,children:nt,...et})=>{const rt=et["data-anchor"];return jsx$1(HeadingWithActionElements,{tag:tt.tagName,anchor:rt,tagProps:et,children:nt})},CustomCodeTag=({inline:tt,className:nt,children:et,...rt})=>{const ot=/language-(\w+)/.exec(nt||""),at=String(et).trim().replace(/\n$/,""),st=ot&&ot[1]||"";return tt?jsx$1(StyledInlineCode,{className:nt,...omit$1(rt,"node"),children:et}):jsx$1(StreamlitSyntaxHighlighter$1,{language:st,showLineNumbers:!1,children:at})},CustomPreTag=({children:tt})=>jsx$1(StyledPreWrapper,{"data-testid":"stMarkdownPre",children:tt});function RenderedMarkdown({allowHTML:tt,source:nt,overrideComponents:et,isLabel:rt,disableLinks:ot}){const at={pre:CustomPreTag,code:CustomCodeTag,a:LinkWithTargetBlank,h1:CustomHeading,h2:CustomHeading,h3:CustomHeading,h4:CustomHeading,h5:CustomHeading,h6:CustomHeading,...et||{}},st=useTheme(),{red:ut,orange:ct,yellow:pt,green:dt,blue:ft,violet:bt,purple:ht,gray:Mt,primary:mt}=getMarkdownTextColors(st),{redbg:Ot,orangebg:zt,yellowbg:yt,greenbg:vt,bluebg:At,violetbg:St,purplebg:Et,graybg:Tt,primarybg:Rt}=getMarkdownBgColors(st),Ct=new Map(Object.entries({red:`color: ${ut}`,blue:`color: ${ft}`,green:`color: ${dt}`,violet:`color: ${bt}`,orange:`color: ${ct}`,gray:`color: ${Mt}`,grey:`color: ${Mt}`,primary:`color: ${mt}`,rainbow:`color: transparent; background-clip: text; -webkit-background-clip: text; background-image: linear-gradient(to right,
440
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$g(tt,nt){if(tt){if(typeof tt=="string")return _arrayLikeToArray$g(tt,nt);var et=Object.prototype.toString.call(tt).slice(8,-1);if(et==="Object"&&tt.constructor&&(et=tt.constructor.name),et==="Map"||et==="Set")return Array.from(tt);if(et==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(et))return _arrayLikeToArray$g(tt,nt)}}function _arrayLikeToArray$g(tt,nt){(nt==null||nt>tt.length)&&(nt=tt.length);for(var et=0,rt=new Array(nt);et<nt;et++)rt[et]=tt[et];return rt}function _iterableToArrayLimit$g(tt,nt){var et=tt==null?null:typeof Symbol<"u"&&tt[Symbol.iterator]||tt["@@iterator"];if(et!=null){var rt=[],ot=!0,at=!1,st,ut;try{for(et=et.call(tt);!(ot=(st=et.next()).done)&&(rt.push(st.value),!(nt&&rt.length===nt));ot=!0);}catch(ct){at=!0,ut=ct}finally{try{!ot&&et.return!=null&&et.return()}finally{if(at)throw ut}}return rt}}function _arrayWithHoles$g(tt){if(Array.isArray(tt))return tt}var OPPOSITE_POSITIONS={top:"bottom",bottom:"top",right:"left",left:"right"};function getOppositePosition(tt){return OPPOSITE_POSITIONS[tt]}function isVerticalPosition(tt){return tt==="top"||tt==="bottom"}function capitalize(tt){return tt.charAt(0).toUpperCase()+tt.slice(1)}function fromPopperPlacement(tt){var nt=tt.replace(/(top|bottom)-start$/,"$1Left").replace(/(top|bottom)-end$/,"$1Right").replace(/(left|right)-start$/,"$1Top").replace(/(left|right)-end$/,"$1Bottom");return PLACEMENT[nt]||null}function splitPlacement(tt){var nt=tt.match(/^([a-z]+)([A-Z][a-z]+)?/)||[];return nt.slice(1,3).filter(Boolean).map(function(et){return et.toLowerCase()})}function getPopoverMarginStyles(tt,nt,et){var rt=splitPlacement(nt),ot=_slicedToArray$g(rt,1),at=ot[0],st=getOppositePosition(at);if(!st)return null;var ut="margin".concat(capitalize(st));return _defineProperty$n({},ut,"".concat(tt+et,"px"))}function getStartPosition(tt,nt,et,rt){tt=_objectSpread$j({},tt);var ot=splitPlacement(nt),at=_slicedToArray$g(ot,1),st=at[0],ut=(et>0?et:rt)*2;return isVerticalPosition(st)?tt.top+=st==="top"?ut:-ut:tt.left+=st==="left"?ut:-ut,"translate3d(".concat(tt.left,"px, ").concat(tt.top,"px, 0)")}function getEndPosition(tt){return"translate3d(".concat(tt.left,"px, ").concat(tt.top,"px, 0)")}function getArrowPositionStyles(tt,nt){var et,rt=splitPlacement(nt),ot=_slicedToArray$g(rt,1),at=ot[0],st=getOppositePosition(at);if(!st)return null;var ut=isVerticalPosition(at)?"left":"top";return et={},_defineProperty$n(et,ut,"".concat(tt[ut],"px")),_defineProperty$n(et,st,"-".concat(ARROW_SIZE-2,"px")),et}function ownKeys$j(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$i(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$j(Object(et),!0).forEach(function(rt){_defineProperty$m(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$j(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _defineProperty$m(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}function getBodyStyles(tt){var nt=tt.$animationDuration,et=tt.$isOpen,rt=tt.$isAnimating,ot=tt.$placement,at=tt.$popoverOffset,st=tt.$showArrow,ut=tt.$theme,ct=tt.$popoverMargin,pt=tt.$isHoverTrigger;return _objectSpread$i(_objectSpread$i({position:"absolute",top:0,left:0,backgroundColor:ut.colors.backgroundTertiary,borderTopLeftRadius:ut.borders.popoverBorderRadius,borderTopRightRadius:ut.borders.popoverBorderRadius,borderBottomRightRadius:ut.borders.popoverBorderRadius,borderBottomLeftRadius:ut.borders.popoverBorderRadius,boxShadow:ut.lighting.shadow600,transitionProperty:"opacity,transform",transitionDuration:rt?et?"0.1s":"".concat(nt,"ms"):"0s",transitionTimingFunction:et?ut.animation.easeOutCurve:ut.animation.easeInCurve,opacity:rt&&et?1:0,transform:rt&&et?getEndPosition(at):getStartPosition(at,ot,st?ARROW_SIZE:0,ct)},getPopoverMarginStyles(st?ARROW_SIZE:0,ot,ct)),pt?{animationDuration:".1s",animationName:{"0%":{pointerEvents:"none"},"99%":{pointerEvents:"none"},"100%":{pointerEvents:"auto"}}}:{})}var Body$2=styled("div",getBodyStyles);Body$2.displayName="Body";Body$2.displayName="Body";function getArrowStyles(tt){var nt=tt.$arrowOffset,et=tt.$placement,rt=tt.$theme;return _objectSpread$i({backgroundColor:rt.colors.backgroundTertiary,boxShadow:rt.lighting.shadow600,width:"".concat(ARROW_WIDTH,"px"),height:"".concat(ARROW_WIDTH,"px"),transform:"rotate(45deg)",position:"absolute"},getArrowPositionStyles(nt,et))}var Arrow$1=styled("div",getArrowStyles);Arrow$1.displayName="Arrow";Arrow$1.displayName="Arrow";function getInnerStyles(tt){var nt=tt.$theme;return{backgroundColor:nt.colors.backgroundTertiary,borderTopLeftRadius:nt.borders.popoverBorderRadius,borderTopRightRadius:nt.borders.popoverBorderRadius,borderBottomRightRadius:nt.borders.popoverBorderRadius,borderBottomLeftRadius:nt.borders.popoverBorderRadius,color:nt.colors.contentPrimary,position:"relative"}}var Inner$1=styled("div",getInnerStyles);Inner$1.displayName="Inner";Inner$1.displayName="Inner";var Padding=styled("div",{paddingLeft:"12px",paddingTop:"12px",paddingRight:"12px",paddingBottom:"12px"});Padding.displayName="Padding";Padding.displayName="Padding";var Hidden=styled("div",{display:"none"});Hidden.displayName="Hidden";Hidden.displayName="Hidden";var baseDefaultProps$1={accessibilityType:ACCESSIBILITY_TYPE.menu,focusLock:!1,autoFocus:!0,returnFocus:!0,ignoreBoundary:!1,overrides:{},onMouseEnterDelay:200,onMouseLeaveDelay:200,placement:PLACEMENT.auto,showArrow:!1,triggerType:TRIGGER_TYPE.click,renderAll:!1};function ownKeys$i(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$h(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$i(Object(et),!0).forEach(function(rt){_defineProperty$l(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$i(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _extends$A(){return _extends$A=Object.assign?Object.assign.bind():function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_extends$A.apply(this,arguments)}function _typeof$b(tt){"@babel/helpers - typeof";return _typeof$b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(nt){return typeof nt}:function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$b(tt)}function _classCallCheck$j(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$9(tt,nt){for(var et=0;et<nt.length;et++){var rt=nt[et];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(tt,rt.key,rt)}}function _createClass$h(tt,nt,et){return nt&&_defineProperties$9(tt.prototype,nt),Object.defineProperty(tt,"prototype",{writable:!1}),tt}function _inherits$j(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function");tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,writable:!0,configurable:!0}}),Object.defineProperty(tt,"prototype",{writable:!1}),nt&&_setPrototypeOf$9(tt,nt)}function _setPrototypeOf$9(tt,nt){return _setPrototypeOf$9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,ot){return rt.__proto__=ot,rt},_setPrototypeOf$9(tt,nt)}function _createSuper$8(tt){var nt=_isNativeReflectConstruct$8();return function(){var rt=_getPrototypeOf$9(tt),ot;if(nt){var at=_getPrototypeOf$9(this).constructor;ot=Reflect.construct(rt,arguments,at)}else ot=rt.apply(this,arguments);return _possibleConstructorReturn$j(this,ot)}}function _possibleConstructorReturn$j(tt,nt){if(nt&&(_typeof$b(nt)==="object"||typeof nt=="function"))return nt;if(nt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$9(tt)}function _assertThisInitialized$9(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _isNativeReflectConstruct$8(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$9(tt){return _getPrototypeOf$9=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$9(tt)}function _defineProperty$l(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var PopoverInner=function(tt){_inherits$j(et,tt);var nt=_createSuper$8(et);function et(){var rt;_classCallCheck$j(this,et);for(var ot=arguments.length,at=new Array(ot),st=0;st<ot;st++)at[st]=arguments[st];return rt=nt.call.apply(nt,[this].concat(at)),_defineProperty$l(_assertThisInitialized$9(rt),"animateInTimer",void 0),_defineProperty$l(_assertThisInitialized$9(rt),"animateOutTimer",void 0),_defineProperty$l(_assertThisInitialized$9(rt),"animateOutCompleteTimer",void 0),_defineProperty$l(_assertThisInitialized$9(rt),"onMouseEnterTimer",void 0),_defineProperty$l(_assertThisInitialized$9(rt),"onMouseLeaveTimer",void 0),_defineProperty$l(_assertThisInitialized$9(rt),"anchorRef",reactExports.createRef()),_defineProperty$l(_assertThisInitialized$9(rt),"popperRef",reactExports.createRef()),_defineProperty$l(_assertThisInitialized$9(rt),"arrowRef",reactExports.createRef()),_defineProperty$l(_assertThisInitialized$9(rt),"state",rt.getDefaultState(rt.props)),_defineProperty$l(_assertThisInitialized$9(rt),"animateIn",function(){rt.props.isOpen&&rt.setState({isAnimating:!0})}),_defineProperty$l(_assertThisInitialized$9(rt),"animateOut",function(){rt.props.isOpen||(rt.setState({isAnimating:!0}),rt.animateOutCompleteTimer=setTimeout(function(){rt.setState({isAnimating:!1,placement:rt.props.placement})},rt.props.animateOutTime||ANIMATE_OUT_TIME))}),_defineProperty$l(_assertThisInitialized$9(rt),"onAnchorClick",function(ut){rt.props.onClick&&rt.props.onClick(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"onAnchorMouseEnter",function(ut){rt.onMouseLeaveTimer&&clearTimeout(rt.onMouseLeaveTimer),rt.triggerOnMouseEnterWithDelay(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"onAnchorMouseLeave",function(ut){rt.onMouseEnterTimer&&clearTimeout(rt.onMouseEnterTimer),rt.triggerOnMouseLeaveWithDelay(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"onPopoverMouseEnter",function(){rt.onMouseLeaveTimer&&clearTimeout(rt.onMouseLeaveTimer)}),_defineProperty$l(_assertThisInitialized$9(rt),"onPopoverMouseLeave",function(ut){rt.triggerOnMouseLeaveWithDelay(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"onPopperUpdate",function(ut,ct){var pt=fromPopperPlacement(ct.placement)||PLACEMENT.top;return rt.setState({arrowOffset:ut.arrow,popoverOffset:ut.popper,placement:pt}),rt.animateInTimer=setTimeout(rt.animateIn,ANIMATE_IN_TIME),ct}),_defineProperty$l(_assertThisInitialized$9(rt),"triggerOnMouseLeave",function(ut){rt.props.onMouseLeave&&rt.props.onMouseLeave(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"triggerOnMouseEnter",function(ut){rt.props.onMouseEnter&&rt.props.onMouseEnter(ut)}),_defineProperty$l(_assertThisInitialized$9(rt),"onDocumentClick",function(ut){var ct=ut.composedPath?ut.composedPath()[0]:ut.target,pt=rt.popperRef.current,dt=rt.anchorRef.current;!pt||pt===ct||ct instanceof Node&&pt.contains(ct)||!dt||dt===ct||ct instanceof Node&&dt.contains(ct)||rt.props.onClickOutside&&rt.props.onClickOutside(ut)}),rt}return _createClass$h(et,[{key:"componentDidMount",value:function(){this.setState({isMounted:!0})}},{key:"componentDidUpdate",value:function(ot,at){this.init(ot,at),this.props.accessibilityType!==ACCESSIBILITY_TYPE.tooltip&&this.props.autoFocus&&!this.state.autoFocusAfterPositioning&&this.popperRef.current!==null&&this.popperRef.current.getBoundingClientRect().top>0&&this.setState({autoFocusAfterPositioning:!0})}},{key:"init",value:function(ot,at){if(this.props.isOpen!==ot.isOpen||this.state.isMounted!==at.isMounted||this.state.isLayerMounted!==at.isLayerMounted){if(this.props.isOpen&&this.state.isLayerMounted){this.clearTimers();return}if(!this.props.isOpen&&ot.isOpen){this.animateOutTimer=setTimeout(this.animateOut,20);return}}}},{key:"componentWillUnmount",value:function(){this.clearTimers()}},{key:"getDefaultState",value:function(ot){return{isAnimating:!1,arrowOffset:{left:0,top:0},popoverOffset:{left:0,top:0},placement:ot.placement,isMounted:!1,isLayerMounted:!1,autoFocusAfterPositioning:!1}}},{key:"clearTimers",value:function(){[this.animateInTimer,this.animateOutTimer,this.animateOutCompleteTimer,this.onMouseEnterTimer,this.onMouseLeaveTimer].forEach(function(ot){ot&&clearTimeout(ot)})}},{key:"triggerOnMouseLeaveWithDelay",value:function(ot){var at=this,st=this.props.onMouseLeaveDelay;if(st){this.onMouseLeaveTimer=setTimeout(function(){return at.triggerOnMouseLeave(ot)},st);return}this.triggerOnMouseLeave(ot)}},{key:"triggerOnMouseEnterWithDelay",value:function(ot){var at=this,st=this.props.onMouseEnterDelay;if(st){this.onMouseEnterTimer=setTimeout(function(){return at.triggerOnMouseEnter(ot)},st);return}this.triggerOnMouseEnter(ot)}},{key:"isClickTrigger",value:function(){return this.props.triggerType===TRIGGER_TYPE.click}},{key:"isHoverTrigger",value:function(){return this.props.triggerType===TRIGGER_TYPE.hover}},{key:"isAccessibilityTypeMenu",value:function(){return this.props.accessibilityType===ACCESSIBILITY_TYPE.menu}},{key:"isAccessibilityTypeTooltip",value:function(){return this.props.accessibilityType===ACCESSIBILITY_TYPE.tooltip}},{key:"getAnchorIdAttr",value:function(){var ot=this.getPopoverIdAttr();return ot?"".concat(ot,"__anchor"):null}},{key:"getPopoverIdAttr",value:function(){return this.props.id||null}},{key:"getAnchorProps",value:function(){var ot=this.props.isOpen,at={ref:this.anchorRef},st=this.getPopoverIdAttr();if(this.isAccessibilityTypeMenu()){var ut=this.isClickTrigger()?"aria-controls":"aria-owns";at[ut]=ot?st:null,at["aria-haspopup"]=!0,at["aria-expanded"]=!!ot}else this.isAccessibilityTypeTooltip()&&(at.id=this.getAnchorIdAttr(),at["aria-describedby"]=ot?st:null);return this.isHoverTrigger()?(at.onMouseEnter=this.onAnchorMouseEnter,at.onMouseLeave=this.onAnchorMouseLeave,at.onBlur=this.props.onBlur,at.onFocus=this.props.onFocus):at.onClick=this.onAnchorClick,at}},{key:"getPopoverBodyProps",value:function(){var ot={},at=this.getPopoverIdAttr();return this.isAccessibilityTypeMenu()?ot.id=at:this.isAccessibilityTypeTooltip()&&(ot.id=at,ot.role="tooltip"),this.isHoverTrigger()&&(ot.onMouseEnter=this.onPopoverMouseEnter,ot.onMouseLeave=this.onPopoverMouseLeave),ot}},{key:"getSharedProps",value:function(){var ot=this.props,at=ot.isOpen,st=ot.showArrow,ut=ot.popoverMargin,ct=ut===void 0?POPOVER_MARGIN:ut,pt=this.state,dt=pt.isAnimating,ft=pt.arrowOffset,bt=pt.popoverOffset,ht=pt.placement;return{$showArrow:!!st,$arrowOffset:ft,$popoverOffset:bt,$placement:ht,$isAnimating:dt,$animationDuration:this.props.animateOutTime||ANIMATE_OUT_TIME,$isOpen:at,$popoverMargin:ct,$isHoverTrigger:this.isHoverTrigger()}}},{key:"getAnchorFromChildren",value:function(){var ot=this.props.children,at=reactExports.Children.toArray(ot);return at.length!==1&&console.error("[baseui] Exactly 1 child must be passed to Popover/Tooltip, found ".concat(at.length," children")),at[0]}},{key:"renderAnchor",value:function(){var ot=this.getAnchorFromChildren();if(!ot)return null;var at=reactExports.isValidElement(ot),st=this.getAnchorProps();return _typeof$b(ot)==="object"&&at?reactExports.cloneElement(ot,st):reactExports.createElement("span",_extends$A({key:"popover-anchor"},st),ot)}},{key:"renderPopover",value:function(ot){var at=this.props,st=at.showArrow,ut=at.overrides,ct=ut===void 0?{}:ut,pt=ct.Arrow,dt=ct.Body,ft=ct.Inner,bt=getOverride(pt)||Arrow$1,ht=getOverride(dt)||Body$2,Mt=getOverride(ft)||Inner$1,mt=this.getSharedProps(),Ot=this.getPopoverBodyProps();return reactExports.createElement(ht,_extends$A({key:"popover-body",ref:this.popperRef,"data-baseweb":this.props["data-baseweb"]||"popover"},Ot,mt,getOverrideProps(dt)),st?reactExports.createElement(bt,_extends$A({key:"popover-arrow",ref:this.arrowRef},mt,getOverrideProps(pt))):null,reactExports.createElement(Mt,_extends$A({},mt,getOverrideProps(ft)),ot))}},{key:"renderContent",value:function(){var ot=this.props.content;return typeof ot=="function"?ot():ot}},{key:"render",value:function(){var ot=this,at=this.state.isMounted&&(this.props.isOpen||this.state.isAnimating),st=[this.renderAnchor()],ut=at||this.props.renderAll?this.renderContent():null,ct={modifiers:{preventOverflow:{enabled:!this.props.ignoreBoundary,padding:0}}};return ut&&(at?st.push(reactExports.createElement(Layer,{key:"new-layer",mountNode:this.props.mountNode,onEscape:this.props.onEsc,onDocumentClick:this.isHoverTrigger()?void 0:this.onDocumentClick,isHoverLayer:this.isHoverTrigger(),onMount:function(){return ot.setState({isLayerMounted:!0})},onUnmount:function(){return ot.setState({isLayerMounted:!1})}},reactExports.createElement(Tether,{anchorRef:this.anchorRef.current,arrowRef:this.arrowRef.current,popperRef:this.popperRef.current,popperOptions:_objectSpread$h(_objectSpread$h({},ct),this.props.popperOptions),onPopperUpdate:this.onPopperUpdate,placement:this.state.placement},this.props.focusLock&&this.props.accessibilityType!==ACCESSIBILITY_TYPE.tooltip?reactExports.createElement(FocusLockCombination,{disabled:!this.props.focusLock,noFocusGuards:!1,returnFocus:!this.isHoverTrigger()&&this.props.returnFocus,autoFocus:this.state.autoFocusAfterPositioning,crossFrame:!1,focusOptions:this.props.focusOptions},this.renderPopover(ut)):reactExports.createElement(MoveFocusInside,{disabled:!this.props.autoFocus||!this.state.autoFocusAfterPositioning},this.renderPopover(ut))))):st.push(reactExports.createElement(Hidden,{key:"hidden-layer"},ut))),st}}]),et}(reactExports.Component);_defineProperty$l(PopoverInner,"defaultProps",baseDefaultProps$1);var Popover$1=function tt(nt){var et=nt.innerRef,rt=useUID();return reactExports.createElement(PopoverInner,_extends$A({id:nt.id||rt,ref:et},nt))};Popover$1.defaultProps=baseDefaultProps$1;var _excluded$i=["children"];function _objectWithoutProperties$k(tt,nt){if(tt==null)return{};var et=_objectWithoutPropertiesLoose$i(tt,nt),rt,ot;if(Object.getOwnPropertySymbols){var at=Object.getOwnPropertySymbols(tt);for(ot=0;ot<at.length;ot++)rt=at[ot],!(nt.indexOf(rt)>=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(et[rt]=tt[rt])}return et}function _objectWithoutPropertiesLoose$i(tt,nt){if(tt==null)return{};var et={},rt=Object.keys(tt),ot,at;for(at=0;at<rt.length;at++)ot=rt[at],!(nt.indexOf(ot)>=0)&&(et[ot]=tt[ot]);return et}function StatefulPopover(tt){var nt=tt.children,et=_objectWithoutProperties$k(tt,_excluded$i);return reactExports.createElement(StatefulContainer$1,et,function(rt){return reactExports.createElement(Popover$1,rt,nt)})}StatefulPopover.defaultProps={accessibilityType:ACCESSIBILITY_TYPE.menu,ignoreBoundary:!1,overrides:{},onMouseEnterDelay:200,onMouseLeaveDelay:200,placement:PLACEMENT.auto,showArrow:!1,triggerType:TRIGGER_TYPE.click,dismissOnClickOutside:!0,dismissOnEsc:!0,stateReducer:function tt(nt,et){return et},popoverMargin:POPOVER_MARGIN};var baseDefaultProps={accessibilityType:ACCESSIBILITY_TYPE.tooltip,focusLock:!1,autoFocus:!1,returnFocus:!1,onMouseEnterDelay:200,onMouseLeaveDelay:200,overrides:{},placement:PLACEMENT.auto,popoverMargin:0,showArrow:!1,triggerType:TRIGGER_TYPE.hover,renderAll:!1};function _typeof$a(tt){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(nt){return typeof nt}:function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$a(tt)}function ownKeys$h(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$g(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$h(Object(et),!0).forEach(function(rt){_defineProperty$k(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$h(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _classCallCheck$i(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$8(tt,nt){for(var et=0;et<nt.length;et++){var rt=nt[et];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(tt,rt.key,rt)}}function _createClass$g(tt,nt,et){return nt&&_defineProperties$8(tt.prototype,nt),Object.defineProperty(tt,"prototype",{writable:!1}),tt}function _inherits$i(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function");tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,writable:!0,configurable:!0}}),Object.defineProperty(tt,"prototype",{writable:!1}),nt&&_setPrototypeOf$8(tt,nt)}function _setPrototypeOf$8(tt,nt){return _setPrototypeOf$8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,ot){return rt.__proto__=ot,rt},_setPrototypeOf$8(tt,nt)}function _createSuper$7(tt){var nt=_isNativeReflectConstruct$7();return function(){var rt=_getPrototypeOf$8(tt),ot;if(nt){var at=_getPrototypeOf$8(this).constructor;ot=Reflect.construct(rt,arguments,at)}else ot=rt.apply(this,arguments);return _possibleConstructorReturn$i(this,ot)}}function _possibleConstructorReturn$i(tt,nt){if(nt&&(_typeof$a(nt)==="object"||typeof nt=="function"))return nt;if(nt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$8(tt)}function _assertThisInitialized$8(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _isNativeReflectConstruct$7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$8(tt){return _getPrototypeOf$8=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$8(tt)}function _defineProperty$k(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var StatefulContainer=function(tt){_inherits$i(et,tt);var nt=_createSuper$7(et);function et(){return _classCallCheck$i(this,et),nt.apply(this,arguments)}return _createClass$g(et,[{key:"render",value:function(){return reactExports.createElement(StatefulContainer$1,this.props)}}]),et}(reactExports.Component);_defineProperty$k(StatefulContainer,"defaultProps",_objectSpread$g({},baseDefaultProps));function ownKeys$g(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$f(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$g(Object(et),!0).forEach(function(rt){_defineProperty$j(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$g(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _defineProperty$j(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var Body$1=styled("div",function(tt){return _objectSpread$f(_objectSpread$f({},getBodyStyles(tt)),{},{backgroundColor:tt.$theme.colors.tooltipBackground,borderTopLeftRadius:tt.$theme.borders.radius300,borderTopRightRadius:tt.$theme.borders.radius300,borderBottomRightRadius:tt.$theme.borders.radius300,borderBottomLeftRadius:tt.$theme.borders.radius300,boxShadow:tt.$theme.lighting.shadow400,color:tt.$theme.colors.tooltipText,transitionProperty:"opacity",transform:getEndPosition(tt.$popoverOffset)})});Body$1.displayName="Body";Body$1.displayName="Body";var Inner=styled("div",function(tt){return _objectSpread$f(_objectSpread$f(_objectSpread$f({},getInnerStyles(tt)),{},{backgroundColor:tt.$theme.colors.tooltipBackground,borderTopLeftRadius:tt.$theme.borders.radius300,borderTopRightRadius:tt.$theme.borders.radius300,borderBottomRightRadius:tt.$theme.borders.radius300,borderBottomLeftRadius:tt.$theme.borders.radius300,paddingTop:tt.$theme.sizing.scale300,paddingBottom:tt.$theme.sizing.scale300,paddingLeft:tt.$theme.sizing.scale600,paddingRight:tt.$theme.sizing.scale600},tt.$theme.typography.font150),{},{color:tt.$theme.colors.tooltipText})});Inner.displayName="Inner";Inner.displayName="Inner";var Arrow=styled("div",function(tt){return _objectSpread$f(_objectSpread$f({},getArrowStyles(tt)),{},{backgroundColor:tt.$theme.colors.tooltipBackground})});Arrow.displayName="Arrow";Arrow.displayName="Arrow";function _typeof$9(tt){"@babel/helpers - typeof";return _typeof$9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(nt){return typeof nt}:function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$9(tt)}function ownKeys$f(tt,nt){var et=Object.keys(tt);if(Object.getOwnPropertySymbols){var rt=Object.getOwnPropertySymbols(tt);nt&&(rt=rt.filter(function(ot){return Object.getOwnPropertyDescriptor(tt,ot).enumerable})),et.push.apply(et,rt)}return et}function _objectSpread$e(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt]!=null?arguments[nt]:{};nt%2?ownKeys$f(Object(et),!0).forEach(function(rt){_defineProperty$i(tt,rt,et[rt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)):ownKeys$f(Object(et)).forEach(function(rt){Object.defineProperty(tt,rt,Object.getOwnPropertyDescriptor(et,rt))})}return tt}function _extends$z(){return _extends$z=Object.assign?Object.assign.bind():function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_extends$z.apply(this,arguments)}function _classCallCheck$h(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _defineProperties$7(tt,nt){for(var et=0;et<nt.length;et++){var rt=nt[et];rt.enumerable=rt.enumerable||!1,rt.configurable=!0,"value"in rt&&(rt.writable=!0),Object.defineProperty(tt,rt.key,rt)}}function _createClass$f(tt,nt,et){return nt&&_defineProperties$7(tt.prototype,nt),Object.defineProperty(tt,"prototype",{writable:!1}),tt}function _inherits$h(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function");tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,writable:!0,configurable:!0}}),Object.defineProperty(tt,"prototype",{writable:!1}),nt&&_setPrototypeOf$7(tt,nt)}function _setPrototypeOf$7(tt,nt){return _setPrototypeOf$7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,ot){return rt.__proto__=ot,rt},_setPrototypeOf$7(tt,nt)}function _createSuper$6(tt){var nt=_isNativeReflectConstruct$6();return function(){var rt=_getPrototypeOf$7(tt),ot;if(nt){var at=_getPrototypeOf$7(this).constructor;ot=Reflect.construct(rt,arguments,at)}else ot=rt.apply(this,arguments);return _possibleConstructorReturn$h(this,ot)}}function _possibleConstructorReturn$h(tt,nt){if(nt&&(_typeof$9(nt)==="object"||typeof nt=="function"))return nt;if(nt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$7(tt)}function _assertThisInitialized$7(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _isNativeReflectConstruct$6(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$7(tt){return _getPrototypeOf$7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(et){return et.__proto__||Object.getPrototypeOf(et)},_getPrototypeOf$7(tt)}function _defineProperty$i(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}var Tooltip$1=function(tt){_inherits$h(et,tt);var nt=_createSuper$6(et);function et(){return _classCallCheck$h(this,et),nt.apply(this,arguments)}return _createClass$f(et,[{key:"render",value:function(){var ot=mergeOverrides({Arrow,Body:Body$1,Inner},this.props.overrides);return reactExports.createElement(Popover$1,_extends$z({autoFocus:!1,"data-baseweb":"tooltip"},this.props,{overrides:ot}))}}]),et}(reactExports.Component);_defineProperty$i(Tooltip$1,"defaultProps",_objectSpread$e({},baseDefaultProps));var _excluded$h=["children"];function _objectWithoutProperties$j(tt,nt){if(tt==null)return{};var et=_objectWithoutPropertiesLoose$h(tt,nt),rt,ot;if(Object.getOwnPropertySymbols){var at=Object.getOwnPropertySymbols(tt);for(ot=0;ot<at.length;ot++)rt=at[ot],!(nt.indexOf(rt)>=0)&&Object.prototype.propertyIsEnumerable.call(tt,rt)&&(et[rt]=tt[rt])}return et}function _objectWithoutPropertiesLoose$h(tt,nt){if(tt==null)return{};var et={},rt=Object.keys(tt),ot,at;for(at=0;at<rt.length;at++)ot=rt[at],!(nt.indexOf(ot)>=0)&&(et[ot]=tt[ot]);return et}function StatefulTooltip(tt){var nt=tt.children,et=_objectWithoutProperties$j(tt,_excluded$h);return reactExports.createElement(StatefulContainer,et,function(rt){return reactExports.createElement(Tooltip$1,rt,nt)})}StatefulTooltip.defaultProps=StatefulContainer.defaultProps;const StyledWrapper=newStyled("div",{target:"ec3xk5x0"})({display:"table",tableLayout:"fixed",width:"100%"}),StyledEllipsizedDiv=newStyled("div",{target:"ec3xk5x1"})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell"}),StyledTooltipContentWrapper=newStyled("div",{target:"ec3xk5x2"})(({theme:tt})=>({boxSizing:"border-box",fontSize:`${tt.fontSizes.sm}`,maxWidth:`calc(${tt.sizes.contentMaxWidth} - 2 * ${tt.spacing.threeXL})`,maxHeight:tt.sizes.maxTooltipHeight,overflow:["auto","overlay"],padding:`${tt.spacing.xs} ${tt.spacing.md}`,[`@media (max-width: ${tt.breakpoints.sm})`]:{maxWidth:`calc(100% - ${tt.spacing.threeXL})`},img:{maxWidth:"100%"},"*":{fontSize:`${tt.fontSizes.sm} !important`}}));var Placement;(function(tt){tt.AUTO="auto",tt.TOP_LEFT="topLeft",tt.TOP="top",tt.TOP_RIGHT="topRight",tt.RIGHT_TOP="rightTop",tt.RIGHT="right",tt.RIGHT_BOTTOM="rightBottom",tt.BOTTOM_RIGHT="bottomRight",tt.BOTTOM="bottom",tt.BOTTOM_LEFT="bottomLeft",tt.LEFT_BOTTOM="leftBottom",tt.LEFT="left",tt.LEFT_TOP="leftTop"})(Placement||(Placement={}));function Tooltip({content:tt,placement:nt,children:et,inline:rt,style:ot,onMouseEnterDelay:at}){const st=useTheme(),{colors:ut,fontSizes:ct,radii:pt,fontWeights:dt}=st,ft=reactExports.useRef(null);return jsx$1(StatefulTooltip,{onOpen:()=>{var ht;const bt=(ht=ft.current)==null?void 0:ht.parentElement;bt&&setTimeout(()=>{var yt;const Mt=bt.getBoundingClientRect(),mt=Mt.x,Ot=mt+Mt.width-window.innerWidth,zt=bt.parentElement;if(Ot>0&&zt){const vt=new DOMMatrix((yt=window.getComputedStyle(zt))==null?void 0:yt.transform);zt.style.transform=`translate3d(${vt.e-Ot}px, ${vt.f}px, 0px)`}mt<0&&(bt.style.left=`${-mt}px`)},0)},content:tt?jsx$1(StyledTooltipContentWrapper,{className:"stTooltipContent","data-testid":"stTooltipContent",ref:ft,children:tt}):null,placement:PLACEMENT[nt],accessibilityType:ACCESSIBILITY_TYPE.tooltip,showArrow:!1,popoverMargin:10,onMouseEnterDelay:at,overrides:{Body:{style:{borderTopLeftRadius:pt.default,borderTopRightRadius:pt.default,borderBottomLeftRadius:pt.default,borderBottomRightRadius:pt.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:hasLightBackgroundColor(st)?ut.bgColor:ut.secondaryBg,color:ut.bodyText,fontSize:ct.sm,fontWeight:dt.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:jsx$1("div",{style:{display:"flex",flexDirection:"row",justifyContent:rt?"flex-end":"",...ot},"data-testid":"stTooltipHoverTarget",className:"stTooltipHoverTarget",children:et})})}function OverflowTooltip({content:tt,placement:nt,children:et,inline:rt,style:ot}){const at=React$1.useRef(null),[st,ut]=reactExports.useState(!1);return React$1.useEffect(()=>{const ct=at!=null&&at.current?at.current.offsetWidth<at.current.scrollWidth:!1;ct!==st&&ut(ct)},[et,st]),jsx$1(Tooltip,{content:st?tt:"",placement:nt,inline:rt,children:jsx$1(StyledWrapper,{children:jsx$1(StyledEllipsizedDiv,{ref:at,style:ot,children:et})})})}const StyledTooltipIconWrapper=newStyled("div",{target:"eqrpmav0"})(({isLatex:tt,theme:nt})=>({display:"flex",alignItems:"center",marginTop:tt?nt.spacing.md:"0","& .stTooltipHoverTarget > svg":{stroke:nt.colors.fadedText60,strokeWidth:2.25}})),StyledLabelHelpWrapper=newStyled("div",{target:"eqrpmav1"})(({isLatex:tt})=>({display:"flex",visibility:"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center",...tt?{justifyContent:"center"}:{}})),StyledLabelHelpInline=newStyled("label",{target:"eqrpmav2"})(({theme:tt})=>({marginLeft:tt.spacing.xs,position:"relative",display:"flex",flexDirection:"row"}));function TooltipIcon({placement:tt=Placement.AUTO,isLatex:nt=!1,content:et,children:rt,markdownProps:ot,onMouseEnterDelay:at}){const st=useTheme();return jsx$1(StyledTooltipIconWrapper,{className:"stTooltipIcon","data-testid":"stTooltipIcon",isLatex:nt,children:jsx$1(Tooltip,{content:jsx$1(StreamlitMarkdown$1,{style:{fontSize:st.fontSizes.sm},source:et,allowHTML:!1,...ot||{}}),placement:tt,onMouseEnterDelay:at,inline:!0,children:rt||jsx$1(HelpCircle,{className:"icon",size:st.iconSizes.base})})})}const InlineTooltipIcon=({placement:tt=Placement.TOP_RIGHT,isLatex:nt=!1,content:et,children:rt,markdownProps:ot})=>jsx$1(StyledLabelHelpInline,{children:jsx$1(TooltipIcon,{placement:tt,isLatex:nt,content:et,markdownProps:ot,children:rt})}),streamlitLogo="data:image/svg+xml,%3csvg%20width='301'%20height='165'%20viewBox='0%200%20301%20165'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M150.731%20101.547L98.1387%2073.7471L6.84674%2025.4969C6.7634%2025.4136%206.59674%2025.4136%206.51341%2025.4136C3.18007%2023.8303%20-0.236608%2027.1636%201.0134%2030.497L47.5302%20149.139L47.5385%20149.164C47.5885%20149.281%2047.6302%20149.397%2047.6802%20149.514C49.5885%20153.939%2053.7552%20156.672%2058.2886%20157.747C58.6719%20157.831%2058.9461%20157.906%2059.4064%20157.998C59.8645%20158.1%2060.5052%20158.239%2061.0552%20158.281C61.1469%20158.289%2061.2302%20158.289%2061.3219%20158.297H61.3886C61.4552%20158.306%2061.5219%20158.306%2061.5886%20158.314H61.6802C61.7386%20158.322%2061.8052%20158.322%2061.8636%20158.322H61.9719C62.0386%20158.331%2062.1052%20158.331%2062.1719%20158.331V158.331C121.084%20164.754%20180.519%20164.754%20239.431%20158.331V158.331C240.139%20158.331%20240.831%20158.297%20241.497%20158.231C241.714%20158.206%20241.922%20158.181%20242.131%20158.156C242.156%20158.147%20242.189%20158.147%20242.214%20158.139C242.356%20158.122%20242.497%20158.097%20242.639%20158.072C242.847%20158.047%20243.056%20158.006%20243.264%20157.964C243.681%20157.872%20243.87%20157.806%20244.436%20157.611C245.001%20157.417%20245.94%20157.077%20246.527%20156.794C247.115%20156.511%20247.522%20156.239%20248.014%20155.931C248.622%20155.547%20249.201%20155.155%20249.788%20154.715C250.041%20154.521%20250.214%20154.397%20250.397%20154.222L250.297%20154.164L150.731%20101.547Z'%20fill='%23FF4B4B'/%3e%3cpath%20d='M294.766%2025.4981H294.683L203.357%2073.7483L254.124%20149.357L300.524%2030.4981V30.3315C301.691%2026.8314%20298.108%2023.6648%20294.766%2025.4981'%20fill='%237D353B'/%3e%3cpath%20d='M155.598%202.55572C153.264%20-0.852624%20148.181%20-0.852624%20145.931%202.55572L98.1389%2073.7477L150.731%20101.548L250.398%20154.222C251.024%20153.609%20251.526%20153.012%20252.056%20152.381C252.806%20151.456%20253.506%20150.465%20254.123%20149.356L203.356%2073.7477L155.598%202.55572Z'%20fill='%23BD4043'/%3e%3c/svg%3e";function convertRemToEm(tt){return tt.replace(/rem$/,"em")}function sharedMarkdownStyle(tt){return{a:{color:tt.colors.linkText,textDecoration:"underline"}}}function convertFontSizes(tt,nt,et,rt,ot,at){return ot?at?convertRemToEm(rt):nt:at?convertRemToEm(et):tt}function getMarkdownHeadingDefinitions(tt,nt,et){return{"h1, h2, h3, h4, h5, h6":{fontFamily:tt.genericFonts.headingFont,fontWeight:tt.fontWeights.bold,lineHeight:tt.lineHeights.headings,margin:0,color:"inherit"},h1:{fontSize:convertFontSizes(tt.fontSizes.fourXL,tt.fontSizes.xl,tt.fontSizes.threeXL,tt.fontSizes.xl,nt,et),fontWeight:nt?tt.fontWeights.bold:tt.fontWeights.extrabold,padding:`${tt.spacing.xl} 0 ${tt.spacing.lg} 0`},"h1 b, h1 strong":{fontWeight:tt.fontWeights.extrabold},"h2, h3":{letterSpacing:"-0.005em"},h2:{fontSize:convertFontSizes(tt.fontSizes.threeXL,tt.fontSizes.lg,tt.fontSizes.twoXL,tt.fontSizes.lg,nt,et),padding:`${tt.spacing.lg} 0 ${tt.spacing.lg} 0`},h3:{fontSize:convertFontSizes(tt.fontSizes.twoXL,tt.fontSizes.mdLg,tt.fontSizes.lg,tt.fontSizes.mdLg,nt,et),padding:`${tt.spacing.sm} 0 ${tt.spacing.lg} 0`},h4:{fontSize:convertFontSizes(tt.fontSizes.xl,tt.fontSizes.md,tt.fontSizes.md,tt.fontSizes.md,nt,et),padding:`${tt.spacing.md} 0 ${tt.spacing.lg} 0`},h5:{fontSize:convertFontSizes(tt.fontSizes.lg,tt.fontSizes.sm,tt.fontSizes.md,tt.fontSizes.md,nt,et),padding:`0 0 ${tt.spacing.lg} 0`},h6:{fontSize:convertFontSizes(tt.fontSizes.md,tt.fontSizes.twoSm,tt.fontSizes.md,tt.fontSizes.md,nt,et),padding:`0 0 ${tt.spacing.lg} 0`}}}const StyledStreamlitMarkdown=newStyled("div",{target:"e121c1cl0"})(({theme:tt,isCaption:nt,isInSidebarOrDialog:et,isLabel:rt,boldLabel:ot,largerLabel:at,isToast:st})=>{const ut=rt&&!at||st||nt;return{fontFamily:tt.genericFonts.bodyFont,fontSize:ut?tt.fontSizes.sm:tt.fontSizes.md,marginBottom:rt?"":`-${tt.spacing.lg}`,opacity:nt?.6:void 0,color:"inherit",...sharedMarkdownStyle(tt),...getMarkdownHeadingDefinitions(tt,et,nt),p:{wordBreak:"break-word",marginBottom:rt?tt.spacing.none:"",fontWeight:ot?tt.fontWeights.bold:"",marginTop:tt.spacing.none,marginLeft:tt.spacing.none,marginRight:tt.spacing.none},img:{maxWidth:"100%",maxHeight:rt?"1em":void 0,verticalAlign:"middle"},li:{margin:"0.2em 0 0.2em 1.2em",padding:"0 0 0 0.6em"},blockquote:{margin:"1em 0 1em 0",padding:"0 0 0 1.2em",borderLeft:`${tt.sizes.borderWidth} solid ${tt.colors.lightGray}`},"b, strong":{fontWeight:tt.fontWeights.bold},hr:{margin:"2em 0",padding:0,color:"inherit",backgroundColor:"transparent",border:"none",borderBottom:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,"&:not([size])":{height:tt.sizes.borderWidth}},table:{marginBottom:tt.spacing.lg,borderCollapse:"collapse"},tr:{borderTop:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`},th:{textAlign:"inherit"},"th, td":{padding:`${tt.spacing.xs} ${tt.spacing.md}`,border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`},"span.has-background-color":{padding:`${tt.spacing.threeXS} ${tt.spacing.twoXS}`,margin:tt.spacing.none,borderRadius:tt.radii.md},"p, ol, ul, dl, li":{fontSize:"inherit"}}}),StyledLinkIcon=newStyled("a",{target:"e121c1cl1"})(({theme:tt})=>({lineHeight:0,display:"inline-flex",alignItems:"center",justifyContent:"center",svg:{stroke:tt.colors.fadedText60,strokeWidth:2.25},"&:hover svg":{stroke:tt.colors.bodyText}})),StyledHeadingWithActionElements=newStyled("div",{target:"e121c1cl2"})(({theme:tt})=>({"h1, h2, h3, h4, h5, h6, span":{scrollMarginTop:tt.sizes.headerHeight},...sharedMarkdownStyle(tt),wordBreak:"break-word",textWrap:"pretty",[StyledLinkIcon]:{visibility:"hidden"},"&:hover":{[StyledLinkIcon]:{visibility:"visible"}}})),StyledHeadingActionElements=newStyled("span",{target:"e121c1cl3"})(({theme:tt})=>({marginLeft:tt.spacing.sm,display:"inline-flex",gap:tt.spacing.sm,verticalAlign:"middle","& > *":{marginLeft:"0 !important"}})),StyledHeaderDivider=newStyled("hr",{target:"e121c1cl4"})(({theme:tt,rainbow:nt,color:et})=>({height:`${tt.spacing.threeXS} !important`,marginTop:tt.spacing.sm,marginBottom:tt.spacing.none,border:"none",borderRadius:tt.radii.full,...nt?{background:et}:{backgroundColor:et}})),StyledPreWrapper=newStyled("div",{target:"e121c1cl5"})(({theme:tt})=>({marginBottom:tt.spacing.lg}));var Tags;(function(tt){tt.H1="h1",tt.H2="h2",tt.H3="h3"})(Tags||(Tags={}));function createAnchorFromText(tt){let nt="";return tt&&/^[\x00-\x7F]*$/.test(tt)?nt=tt==null?void 0:tt.toLowerCase().split(/[^\p{L}\p{N}]+/gu).filter(Boolean).join("-"):tt&&(nt=xxhash.h32(tt,43981).toString(16)),nt}function transformLinkUri(tt){return tt}const scrollNodeIntoView=once$1(tt=>{tt.scrollIntoView(!0)}),HeaderActionElements=({elementId:tt,help:nt,hideAnchor:et})=>{const rt=useTheme();return!nt&&et?jsx$1(Fragment,{}):jsxs(StyledHeadingActionElements,{"data-testid":"stHeaderActionElements",children:[nt&&jsx$1(InlineTooltipIcon,{content:nt}),tt&&!et&&jsx$1(StyledLinkIcon,{href:`#${tt}`,children:jsx$1(Link2,{size:rt.iconSizes.base})})]})},HeadingWithActionElements=({tag:tt,anchor:nt,help:et,hideAnchor:rt,children:ot,tagProps:at})=>{const st=React$1.useContext(IsSidebarContext),ut=React$1.useContext(IsDialogContext),[ct,pt]=React$1.useState(nt),[dt,ft]=React$1.useState(null),{addScriptFinishedHandler:bt,removeScriptFinishedHandler:ht}=React$1.useContext(LibContext),Mt=React$1.useCallback(()=>{dt!==null&&window.setTimeout(()=>{scrollNodeIntoView(dt)},300)},[dt]);React$1.useEffect(()=>(bt(Mt),()=>{ht(Mt)}),[bt,ht,Mt]);const mt=React$1.useCallback(At=>{if(At===null)return;const St=nt||createAnchorFromText(At.textContent);pt(St);const Et=window.location.hash.slice(1);Et&&Et===St&&ft(At)},[nt]),Ot=st||ut,zt=jsx$1(HeaderActionElements,{elementId:ct,help:et,hideAnchor:rt||Ot}),yt=Ot?{}:{ref:mt,id:ct},vt=React$1.createElement(tt,{...at,...yt},jsxs(Fragment,{children:[ot,zt]}));return Ot?vt:jsx$1(StyledHeadingWithActionElements,{"data-testid":"stHeadingWithActionElements",children:vt})},CustomHeading=({node:tt,children:nt,...et})=>{const rt=et["data-anchor"];return jsx$1(HeadingWithActionElements,{tag:tt.tagName,anchor:rt,tagProps:et,children:nt})},CustomCodeTag=({inline:tt,className:nt,children:et,...rt})=>{const ot=/language-(\w+)/.exec(nt||""),at=String(et).trim().replace(/\n$/,""),st=ot&&ot[1]||"";return tt?jsx$1(StyledInlineCode,{className:nt,...omit$1(rt,"node"),children:et}):jsx$1(StreamlitSyntaxHighlighter$1,{language:st,showLineNumbers:!1,children:at})},CustomPreTag=({children:tt})=>jsx$1(StyledPreWrapper,{"data-testid":"stMarkdownPre",children:tt});function RenderedMarkdown({allowHTML:tt,source:nt,overrideComponents:et,isLabel:rt,disableLinks:ot}){const at={pre:CustomPreTag,code:CustomCodeTag,a:LinkWithTargetBlank,h1:CustomHeading,h2:CustomHeading,h3:CustomHeading,h4:CustomHeading,h5:CustomHeading,h6:CustomHeading,...et||{}},st=useTheme(),{red:ut,orange:ct,yellow:pt,green:dt,blue:ft,violet:bt,purple:ht,gray:Mt,primary:mt}=getMarkdownTextColors(st),{redbg:Ot,orangebg:zt,yellowbg:yt,greenbg:vt,bluebg:At,violetbg:St,purplebg:Et,graybg:Tt,primarybg:Rt}=getMarkdownBgColors(st),Ct=new Map(Object.entries({red:`color: ${ut}`,blue:`color: ${ft}`,green:`color: ${dt}`,violet:`color: ${bt}`,orange:`color: ${ct}`,gray:`color: ${Mt}`,grey:`color: ${Mt}`,primary:`color: ${mt}`,rainbow:`color: transparent; background-clip: text; -webkit-background-clip: text; background-image: linear-gradient(to right,
441
441
  ${ut}, ${ct}, ${pt}, ${dt}, ${ft}, ${bt}, ${ht});`,"red-background":`background-color: ${Ot}`,"blue-background":`background-color: ${At}`,"green-background":`background-color: ${vt}`,"violet-background":`background-color: ${St}`,"orange-background":`background-color: ${zt}`,"gray-background":`background-color: ${Tt}`,"grey-background":`background-color: ${Tt}`,"primary-background":`background-color: ${Rt}`,"rainbow-background":`background: linear-gradient(to right,
442
442
  ${Ot}, ${zt}, ${yt}, ${vt}, ${At}, ${St}, ${Et});`}));function wt(){return a0=>{visit(a0,"textDirective",(b0,kt,o0)=>{const qt=String(b0.name);if(Ct.has(qt)){const Dt=b0.data||(b0.data={}),Bt=Ct.get(qt);Dt.hName="span",Dt.hProperties=Dt.hProperties||{},Dt.hProperties.style=Bt,Bt&&(/background-color:/.test(Bt)||/background:/.test(Bt))&&(Dt.hProperties.className=(Dt.hProperties.className||"")+" has-background-color")}else b0.type="text",b0.value=`:${qt}`,b0.data={}})}}function Lt(){return a0=>{function b0(kt,o0){return{type:"text",value:kt,data:{hName:"span",hProperties:{role:"img",ariaLabel:o0+" icon",style:{display:"inline-block",fontFamily:st.genericFonts.iconFont,fontWeight:st.fontWeights.normal,userSelect:"none",verticalAlign:"bottom",whiteSpace:"nowrap",wordWrap:"normal"}},hChildren:[{type:"text",value:o0}]}}}return findAndReplace(a0,[[/:material_(\w+):/g,b0]]),a0}}function Ht(){return a0=>{function b0(){return{type:"text",value:"",data:{hName:"img",hProperties:{src:streamlitLogo,alt:"Streamlit logo",style:{display:"inline-block",userSelect:"none",height:"0.75em",verticalAlign:"baseline",marginBottom:"-0.05ex"}}}}}return findAndReplace(a0,[[/:streamlit:/g,b0]]),a0}}function jt(){return a0=>(visit(a0,(b0,kt,o0)=>{if(!(o0&&(o0.type==="link"||o0.type==="linkReference"))&&b0.type==="text"&&b0.value){const qt=[[/(^|\s)<->(\s|$)/g,"$1↔$2"],[/(^|\s)->(\s|$)/g,"$1→$2"],[/(^|\s)<-(\s|$)/g,"$1←$2"],[/(^|\s)--(\s|$)/g,"$1—$2"],[/(^|\s)>=(\s|$)/g,"$1≥$2"],[/(^|\s)<=(\s|$)/g,"$1≤$2"],[/(^|\s)~=(\s|$)/g,"$1≈$2"]];let Dt=b0.value;for(const[Bt,p0]of qt)Dt=Dt.replace(Bt,p0);Dt!==b0.value&&(b0.value=Dt)}}),a0)}const s0=[remarkMath,plugin,remarkGfm,remarkDirective,wt,Lt,Ht,jt],Ut=[rehypeKatex,...tt?[rehypeRaw]:[]],Yt=nt.replaceAll(":material/",":material_"),O0=["table","thead","tbody","tr","th","td","h1","h2","h3","h4","h5","h6","ul","ol","li","input","hr","blockquote",...ot?["a"]:[]];return jsx$1(ErrorBoundary,{children:jsx$1(ReactMarkdown,{remarkPlugins:s0,rehypePlugins:Ut,components:at,transformLinkUri,disallowedElements:rt?O0:[],unwrapDisallowed:!0,children:Yt})})}const StreamlitMarkdown=({source:tt,allowHTML:nt,style:et,isCaption:rt,isLabel:ot,boldLabel:at,largerLabel:st,disableLinks:ut,isToast:ct})=>{const pt=reactExports.useContext(IsSidebarContext),dt=reactExports.useContext(IsDialogContext);return jsx$1(StyledStreamlitMarkdown,{isCaption:!!rt,isInSidebarOrDialog:pt||dt,isLabel:ot,boldLabel:at,largerLabel:st,isToast:ct,style:et,"data-testid":rt?"stCaptionContainer":"stMarkdownContainer",children:jsx$1(RenderedMarkdown,{source:tt,allowHTML:nt,isLabel:ot,disableLinks:ut})})};function LinkWithTargetBlank(tt){const{href:nt}=tt;if(nt&&nt.startsWith("#")){const{children:ut,...ct}=tt;return jsx$1("a",{...omit$1(ct,"node"),children:ut})}const{title:et,children:rt,target:ot,rel:at,...st}=tt;return jsx$1("a",{href:nt,title:et,target:ot||"_blank",rel:at||"noopener noreferrer",...omit$1(st,"node"),children:rt})}const StreamlitMarkdown$1=reactExports.memo(StreamlitMarkdown),DynamicButtonLabel=({icon:tt,label:nt})=>{const et=tt.startsWith(":material");return jsxs(Fragment,{children:[tt&&jsx$1(DynamicIcon,{size:et?"lg":"base",margin:nt?et?"0 sm 0 0":"0 md 0 0":"0",color:"inherit",iconValue:tt}),nt&&jsx$1(StreamlitMarkdown$1,{source:nt,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})]})};var BaseButtonKind;(function(tt){tt.PRIMARY="primary",tt.SECONDARY="secondary",tt.TERTIARY="tertiary",tt.GHOST="ghost",tt.LINK="link",tt.ICON="icon",tt.BORDERLESS_ICON="borderlessIcon",tt.BORDERLESS_ICON_ACTIVE="borderlessIconActive",tt.MINIMAL="minimal",tt.PRIMARY_FORM_SUBMIT="primaryFormSubmit",tt.SECONDARY_FORM_SUBMIT="secondaryFormSubmit",tt.TERTIARY_FORM_SUBMIT="tertiaryFormSubmit",tt.HEADER_BUTTON="header",tt.HEADER_NO_PADDING="headerNoPadding",tt.ELEMENT_TOOLBAR="elementToolbar",tt.PILLS="pills",tt.PILLS_ACTIVE="pillsActive",tt.SEGMENTED_CONTROL="segmented_control",tt.SEGMENTED_CONTROL_ACTIVE="segmented_controlActive"})(BaseButtonKind||(BaseButtonKind={}));var BaseButtonSize;(function(tt){tt.XSMALL="xsmall",tt.SMALL="small",tt.MEDIUM="medium",tt.LARGE="large"})(BaseButtonSize||(BaseButtonSize={}));function getSizeStyle(tt,nt){switch(tt){case"xsmall":return{padding:`${nt.spacing.twoXS} ${nt.spacing.sm}`,fontSize:nt.fontSizes.sm};case"small":return{padding:`${nt.spacing.twoXS} ${nt.spacing.md}`};case"large":return{padding:`${nt.spacing.md} ${nt.spacing.md}`};default:return{padding:`${nt.spacing.xs} ${nt.spacing.md}`}}}const StyledBaseButton=newStyled("button",{target:"ekbtr7h0"})(({fluidWidth:tt,size:nt,theme:et})=>{const rt=typeof tt=="number"?`${tt}px`:"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:et.fontWeights.normal,padding:`${et.spacing.xs} ${et.spacing.md}`,borderRadius:et.radii.default,minHeight:et.sizes.minElementHeight,margin:et.spacing.none,lineHeight:et.lineHeights.base,textTransform:"none",fontSize:"inherit",fontFamily:"inherit",color:"inherit",width:tt?rt:"auto",cursor:"pointer",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${transparentize(et.colors.primary,.5)}`},...getSizeStyle(nt,et)}}),StyledPrimaryButton=newStyled(StyledBaseButton,{target:"ekbtr7h1"})(({theme:tt})=>({backgroundColor:tt.colors.primary,color:tt.colors.white,border:`${tt.sizes.borderWidth} solid ${tt.colors.primary}`,"&:hover":{backgroundColor:darken(tt.colors.primary,.05)},"&:active":{backgroundColor:"transparent",color:tt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{borderColor:tt.colors.borderColor,backgroundColor:tt.colors.transparent,color:tt.colors.fadedText40,cursor:"not-allowed"}})),StyledSecondaryButton=newStyled(StyledBaseButton,{target:"ekbtr7h2"})(({theme:tt})=>({backgroundColor:tt.colors.lightenedBg05,border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,"&:hover":{borderColor:tt.colors.primary,color:tt.colors.primary},"&:active":{color:tt.colors.white,borderColor:tt.colors.primary,backgroundColor:tt.colors.primary},"&:focus:not(:active)":{borderColor:tt.colors.primary,color:tt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{borderColor:tt.colors.borderColor,backgroundColor:tt.colors.transparent,color:tt.colors.fadedText40,cursor:"not-allowed"}})),StyledTertiaryButton=newStyled(StyledBaseButton,{target:"ekbtr7h3"})(({theme:tt})=>({padding:tt.spacing.none,backgroundColor:tt.colors.transparent,border:"none","&:active":{color:tt.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:tt.colors.primary,boxShadow:`0 0 0 0.2rem ${transparentize(tt.colors.primary,.5)}`},"&:hover":{color:tt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:tt.colors.transparent,color:tt.colors.fadedText40,cursor:"not-allowed"}})),StyledGhostButton=newStyled(StyledBaseButton,{target:"ekbtr7h4"})(({theme:tt})=>({backgroundColor:tt.colors.transparent,border:`${tt.sizes.borderWidth} solid ${tt.colors.transparent}`,"&:hover":{borderColor:tt.colors.transparent,color:tt.colors.primary},"&:active":{color:tt.colors.primary,borderColor:tt.colors.transparent,backgroundColor:tt.colors.transparent},"&:focus:not(:active)":{borderColor:tt.colors.transparent,color:tt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:tt.colors.lightGray,borderColor:tt.colors.transparent,color:tt.colors.gray}})),StyledLinkButton=newStyled(StyledBaseButton,{target:"ekbtr7h5"})(({theme:tt})=>({backgroundColor:tt.colors.transparent,padding:tt.spacing.none,border:"none",color:tt.colors.primary,"&:hover":{textDecoration:"underline"},"&:active":{backgroundColor:tt.colors.transparent,color:tt.colors.primary,textDecoration:"underline"},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:tt.colors.lightGray,borderColor:tt.colors.transparent,color:tt.colors.gray}})),StyledMinimalButton=newStyled(StyledBaseButton,{target:"ekbtr7h6"})(({theme:tt})=>({backgroundColor:tt.colors.transparent,border:"none",boxShadow:"none",padding:tt.spacing.none,"&:hover, &:active, &:focus-visible":{color:tt.colors.primary}})),StyledPrimaryFormSubmitButton=newStyled(StyledPrimaryButton,{target:"ekbtr7h7"})(),StyledSecondaryFormSubmitButton=newStyled(StyledSecondaryButton,{target:"ekbtr7h8"})(),StyledTertiaryFormSubmitButton=newStyled(StyledTertiaryButton,{target:"ekbtr7h9"})(),StyledIconButton=newStyled(StyledBaseButton,{target:"ekbtr7h10"})(({theme:tt})=>({backgroundColor:tt.colors.transparent,border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,flex:"1 1 0",padding:0,"&:hover":{borderColor:tt.colors.primary,color:tt.colors.primary},"&:active":{backgroundColor:tt.colors.primary,borderColor:tt.colors.primary,color:tt.colors.white},"&:not(:active)":{boxShadow:"none"},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:tt.colors.lightGray,borderColor:tt.colors.transparent,color:tt.colors.gray,cursor:"not-allowed"}})),StyledButtonGroupBaseButton=newStyled(StyledBaseButton,{target:"ekbtr7h12"})(({theme:tt})=>({background:tt.colors.bgColor,color:tt.colors.text,border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,fontSize:tt.fontSizes.sm,lineHeight:tt.lineHeights.base,fontWeight:tt.fontWeights.normal,height:tt.sizes.largeLogoHeight,minHeight:tt.sizes.largeLogoHeight,maxWidth:tt.sizes.contentMaxWidth,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","&:hover":{borderColor:tt.colors.primary,color:tt.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:tt.colors.fadedText20,borderColor:tt.colors.fadedText20,cursor:"not-allowed"},"& div":{textOverflow:"ellipsis",overflow:"hidden"},"& p":{fontSize:tt.fontSizes.sm,textOverflow:"ellipsis",overflow:"hidden"}})),StyledPillsButton=newStyled(StyledButtonGroupBaseButton,{target:"ekbtr7h13"})(({theme:tt})=>({borderRadius:tt.radii.full,padding:`${tt.spacing.twoXS} ${tt.spacing.md}`,gap:tt.spacing.xs})),StyledPillsButtonActive=newStyled(StyledPillsButton,{target:"ekbtr7h14"})(({theme:tt})=>({backgroundColor:transparentize(tt.colors.primary,.9),borderColor:tt.colors.primary,color:tt.colors.primary,"&:hover":{backgroundColor:transparentize(tt.colors.primary,.8),borderColor:tt.colors.primary,color:tt.colors.primary}})),StyledSegmentedControlButton=newStyled(StyledButtonGroupBaseButton,{target:"ekbtr7h15"})(({theme:tt})=>({padding:`${tt.spacing.twoXS} ${tt.spacing.lg}`,borderRadius:"0",flex:"1 0 fit-content",maxWidth:"100%",marginRight:`-${tt.sizes.borderWidth}`,"&:first-child":{borderTopLeftRadius:tt.radii.default,borderBottomLeftRadius:tt.radii.default},"&:last-child":{borderTopRightRadius:tt.radii.default,borderBottomRightRadius:tt.radii.default,marginRight:tt.spacing.none},"&:hover":{zIndex:tt.zIndices.priority}})),StyledSegmentedControlButtonActive=newStyled(StyledSegmentedControlButton,{target:"ekbtr7h16"})(({theme:tt})=>({backgroundColor:transparentize(tt.colors.primary,.9),borderColor:tt.colors.primary,color:tt.colors.primary,zIndex:tt.zIndices.priority,"&:hover":{backgroundColor:transparentize(tt.colors.primary,.8)}})),StyledHeaderButton=newStyled(StyledBaseButton,{target:"ekbtr7h17"})(({theme:tt})=>({backgroundColor:tt.colors.transparent,border:"none",padding:tt.spacing.sm,fontSize:tt.fontSizes.sm,marginLeft:tt.spacing.threeXS,marginRight:tt.spacing.threeXS,lineHeight:tt.lineHeights.none,minWidth:tt.spacing.threeXL,minHeight:tt.spacing.threeXL,"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${transparentize(tt.colors.gray90,.8)}`},"&:hover":{backgroundColor:tt.colors.darkenedBgMix25},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:tt.colors.lightGray,borderColor:tt.colors.transparent,color:tt.colors.gray}})),StyledHeaderNoPaddingButton=newStyled(StyledHeaderButton,{target:"ekbtr7h18"})(()=>({padding:0})),StyledBorderlessIconButton=newStyled(StyledBaseButton,{target:"ekbtr7h19"})(({size:tt,theme:nt})=>{const et={xsmall:nt.spacing.threeXS,small:nt.spacing.twoXS,medium:nt.spacing.md,large:nt.spacing.lg};return{backgroundColor:nt.colors.transparent,color:nt.colors.fadedText60,padding:et[tt],marginLeft:nt.spacing.none,marginRight:nt.spacing.none,border:"none",display:"flex",minHeight:"unset","&:focus":{boxShadow:"none",outline:"none"},"&:hover":{color:nt.colors.text},"&:disabled, &:disabled:hover, &:disabled:active":{color:nt.colors.fadedText10,cursor:"not-allowed",img:{opacity:.4}}}}),StyledBorderlessIconButtonActive=newStyled(StyledBorderlessIconButton,{target:"ekbtr7h20"})(({theme:tt})=>({color:tt.colors.bodyText,"&:disabled, &:disabled:hover, &:disabled:active":{color:tt.colors.fadedText40}})),StyledTooltipNormal=newStyled("div",{target:"ekbtr7h21"})(({theme:tt})=>({display:"block",[`@media (max-width: ${tt.breakpoints.sm})`]:{display:"none"}})),StyledTooltipMobile=newStyled("div",{target:"ekbtr7h22"})(({theme:tt})=>({display:"none",[`@media (max-width: ${tt.breakpoints.sm})`]:{display:"block"}})),StyledElementToolbarButton=newStyled(StyledBaseButton,{target:"ekbtr7h23"})(({theme:tt})=>({backgroundColor:tt.colors.transparent,border:"none",padding:tt.spacing.xs,fontSize:tt.fontSizes.twoSm,marginLeft:tt.spacing.none,marginRight:tt.spacing.none,display:"flex",gap:tt.spacing.xs,alignItems:"center",minHeight:"unset",lineHeight:tt.iconSizes.md,"&:focus":{outline:"none",border:"none",boxShadow:"none"},"&:focus-visible":{outline:"none",border:"none",boxShadow:"none",backgroundColor:tt.colors.darkenedBgMix25},"&:hover":{backgroundColor:tt.colors.darkenedBgMix25},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:tt.colors.lightGray,borderColor:tt.colors.transparent,color:tt.colors.gray}}));function BaseButton(tt){const{kind:nt,size:et,disabled:rt,onClick:ot,fluidWidth:at,children:st,autoFocus:ut}=tt;let ct=StyledPrimaryButton;return nt===BaseButtonKind.SECONDARY?ct=StyledSecondaryButton:nt===BaseButtonKind.TERTIARY?ct=StyledTertiaryButton:nt===BaseButtonKind.GHOST?ct=StyledGhostButton:nt===BaseButtonKind.LINK?ct=StyledLinkButton:nt===BaseButtonKind.ICON?ct=StyledIconButton:nt===BaseButtonKind.PILLS?ct=StyledPillsButton:nt===BaseButtonKind.PILLS_ACTIVE?ct=StyledPillsButtonActive:nt===BaseButtonKind.SEGMENTED_CONTROL?ct=StyledSegmentedControlButton:nt===BaseButtonKind.SEGMENTED_CONTROL_ACTIVE?ct=StyledSegmentedControlButtonActive:nt===BaseButtonKind.BORDERLESS_ICON?ct=StyledBorderlessIconButton:nt===BaseButtonKind.BORDERLESS_ICON_ACTIVE?ct=StyledBorderlessIconButtonActive:nt===BaseButtonKind.MINIMAL?ct=StyledMinimalButton:nt===BaseButtonKind.PRIMARY_FORM_SUBMIT?ct=StyledPrimaryFormSubmitButton:nt===BaseButtonKind.SECONDARY_FORM_SUBMIT?ct=StyledSecondaryFormSubmitButton:nt===BaseButtonKind.TERTIARY_FORM_SUBMIT?ct=StyledTertiaryFormSubmitButton:nt===BaseButtonKind.HEADER_BUTTON?ct=StyledHeaderButton:nt===BaseButtonKind.HEADER_NO_PADDING?ct=StyledHeaderNoPaddingButton:nt===BaseButtonKind.ELEMENT_TOOLBAR&&(ct=StyledElementToolbarButton),jsx$1(ct,{kind:nt,size:et??BaseButtonSize.MEDIUM,fluidWidth:at||!1,disabled:rt||!1,onClick:ot||(()=>{}),autoFocus:ut||!1,"data-testid":tt["data-testid"]??`stBaseButton-${nt}`,"aria-label":tt["aria-label"]??"",children:st})}function BaseButtonTooltip({children:tt,help:nt,placement:et}){return nt?jsxs(Fragment,{children:[jsx$1(StyledTooltipNormal,{children:jsx$1(TooltipIcon,{content:nt,placement:et||Placement.TOP,children:tt})}),jsx$1(StyledTooltipMobile,{children:tt})]}):tt}function FormSubmitButton(tt){const{disabled:nt,element:et,widgetMgr:rt,hasInProgressUpload:ot,width:at,fragmentId:st}=tt,{formId:ut}=et,ct={width:at};let pt=BaseButtonKind.SECONDARY_FORM_SUBMIT;et.type==="primary"?pt=BaseButtonKind.PRIMARY_FORM_SUBMIT:et.type==="tertiary"&&(pt=BaseButtonKind.TERTIARY_FORM_SUBMIT),reactExports.useEffect(()=>(rt.addSubmitButton(ut,et),()=>rt.removeSubmitButton(ut,et)),[rt,ut,et]);const dt=et.help?at:!0;return jsx$1("div",{className:"stFormSubmitButton","data-testid":"stFormSubmitButton",style:ct,children:jsx$1(BaseButtonTooltip,{help:et.help,children:jsx$1(BaseButton,{kind:pt,size:BaseButtonSize.SMALL,fluidWidth:et.useContainerWidth?dt:!1,disabled:nt||ot,onClick:()=>{rt.submitForm(et.formId,st,et)},children:jsx$1(DynamicButtonLabel,{icon:et.icon,label:et.label})})})})}const StyledFormSubmitContent=newStyled("div",{target:"e2juff40"})({display:"flex"}),StyledForm=newStyled("div",{target:"e2juff41"})(({theme:tt,border:nt})=>({...nt&&{border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,borderRadius:tt.radii.default,padding:`calc(${tt.spacing.lg} - ${tt.sizes.borderWidth})`}})),StyledErrorContainer=newStyled("div",{target:"e2juff42"})(({theme:tt})=>({marginTop:tt.spacing.lg}));function FormSubmitContent(tt){const{width:nt}=tt;return jsx$1(StyledFormSubmitContent,{style:{width:nt},children:jsx$1(FormSubmitButton,{...tt})})}const StyledAlertContent=newStyled("div",{target:"e1kq8pmp0"})(({theme:tt})=>({display:"flex",gap:tt.spacing.sm,width:"100%",[`${StyledEmojiIcon}, ${StyledIcon}, ${StyledMaterialIcon}`]:{position:"relative",top:"2px"},[`${StyledCodeBlock} code`]:{paddingRight:tt.spacing.lg}}));function getAlertElementKind(tt){switch(tt){case Alert.Format.ERROR:return Kind.ERROR;case Alert.Format.INFO:return Kind.INFO;case Alert.Format.SUCCESS:return Kind.SUCCESS;case Alert.Format.WARNING:return Kind.WARNING;default:throw new Error(`Unexpected alert type: ${tt}`)}}function AlertElement({icon:tt,body:nt,kind:et,width:rt}){const ot=useTheme(),at={width:tt?`calc(100% - (${ot.iconSizes.lg} + ${ot.spacing.sm}))`:"100%"};return jsx$1("div",{className:"stAlert","data-testid":"stAlert",children:jsx$1(AlertContainer,{width:rt,kind:et,children:jsxs(StyledAlertContent,{children:[tt&&jsx$1(DynamicIcon,{iconValue:tt,size:"lg",testid:"stAlertDynamicIcon"}),jsx$1(StreamlitMarkdown$1,{source:nt,allowHTML:!1,style:at})]})})})}var ScriptRunState;(function(tt){tt.NOT_RUNNING="notRunning",tt.RUNNING="running",tt.RERUN_REQUESTED="rerunRequested",tt.STOP_REQUESTED="stopRequested",tt.COMPILATION_ERROR="compilationError"})(ScriptRunState||(ScriptRunState={}));const MISSING_SUBMIT_BUTTON_WARNING=`**Missing Submit Button**
443
443
 
@@ -680,7 +680,7 @@ If this is an installed component that works locally, the app may be having trou
680
680
 
681
681
  For more troubleshooting help, please see the [Streamlit Component docs](${COMPONENT_DEVELOPER_URL}) or visit our [forums](${COMMUNITY_URL}).`,et}function tryParseArgs(tt,nt,et,rt){if(!rt)try{return parseArgs(tt,nt)}catch(ot){const at=ensureError(ot);et(at)}return[{},[]]}function compareDataframeArgs(tt,nt){return tt===nt||tt.length===nt.length&&tt.every((et,rt)=>{const ot=nt[rt];return et.key===ot.key&&et.value===ot.value})}function ComponentInstance(tt){const[nt,et]=reactExports.useState(),{disabled:rt,element:ot,registry:at,theme:st,widgetMgr:ut,width:ct,fragmentId:pt}=tt,{componentName:dt,jsonArgs:ft,specialArgs:bt,url:ht}=ot,[Mt,mt]=tryParseArgs(ft,bt,et,nt),Ot=reactExports.useRef({args:{},dataframeArgs:[]}),zt=compareDataframeArgs(Ot.current.dataframeArgs,mt);Ot.current.args=Mt,Ot.current.dataframeArgs=mt;const[yt,vt]=reactExports.useState(),[At,St]=reactExports.useState(isNaN(Mt.height)?void 0:Mt.height),Et=reactExports.useRef(!1),Tt=reactExports.useRef(null),Rt=reactExports.useRef(),Ct=useTimeout(()=>logWarning(getWarnMessage(dt,ht)),COMPONENT_READY_WARNING_TIME_MS/4),wt=useTimeout(()=>vt(!0),COMPONENT_READY_WARNING_TIME_MS);if(reactExports.useEffect(()=>{Et.current&&sendRenderMessage(Ot.current.args,Ot.current.dataframeArgs,rt,st,Tt.current??void 0)},[rt,At,zt,ft,st,ct]),reactExports.useEffect(()=>{const jt=Ut=>{Ut!==void 0&&Ut!==At&&(isNullOrUndefined$1(Tt.current)||(Tt.current.height=Ut.toString(),St(Ut)))},s0=()=>{sendRenderMessage(Ot.current.args,Ot.current.dataframeArgs,rt,st,Tt.current??void 0),Ct(),wt(),Et.current=!0,vt(!1)};Rt.current={isReady:()=>Et.current,element:ot,widgetMgr:ut,setComponentError:et,componentReadyCallback:s0,frameHeightCallback:jt,fragmentId:pt}},[dt,rt,ot,At,zt,yt,ft,st,ut,wt,Ct,pt]),reactExports.useEffect(()=>{var s0;const jt=((s0=Tt.current)==null?void 0:s0.contentWindow)??void 0;if(jt)return at.registerListener(jt,createIframeMessageHandler(Rt)),()=>{jt&&at.deregisterListener(jt)}},[at,dt]),nt)return jsx$1(ErrorElement,{name:nt.name,message:nt.message});const Lt=!Et.current&&!yt&&At!==0&&jsx$1(Skeleton,{element:Skeleton$1.create({height:At,style:Skeleton$1.SkeletonStyle.ELEMENT})}),Ht=!Et.current&&yt?jsx$1(AlertElement,{width:ct,body:getWarnMessage(dt,ht),kind:Kind.WARNING}):null;return jsxs(Fragment,{children:[Lt,Ht,jsx$1(StyledComponentIframe,{className:"stCustomComponentV1","data-testid":"stCustomComponentV1",allow:DEFAULT_IFRAME_FEATURE_POLICY,ref:Tt,src:getSrc(dt,at,ht),width:ct,height:At??0,scrolling:"no",sandbox:DEFAULT_IFRAME_SANDBOX_POLICY,title:dt,componentReady:Et.current})]})}const ComponentInstance$1=withTheme(ComponentInstance);class ComponentRegistry{constructor(nt){this.msgListeners=new Map,this.registerListener=(et,rt)=>{this.msgListeners.has(et),this.msgListeners.set(et,rt)},this.deregisterListener=et=>{this.msgListeners.delete(et)},this.getComponentURL=(et,rt)=>this.endpoints.buildComponentURL(et,rt),this.onMessageEvent=et=>{if(isNullOrUndefined$1(et.data)||!et.data.hasOwnProperty("isStreamlitMessage"))return;if(isNullOrUndefined$1(et.source)){logWarning("Received component message with no eventSource!",et.data);return}const rt=this.msgListeners.get(et.source);if(isNullOrUndefined$1(rt)||typeof rt!="function"){logWarning("Received component message for unregistered ComponentInstance!",et.data);return}const{type:ot}=et.data;if(isNullOrUndefined$1(ot)){logWarning("Received Streamlit message with no type!",et.data);return}rt(ot,et.data)},this.endpoints=nt,window.addEventListener("message",this.onMessageEvent)}}const Maybe=reactExports.memo(function tt({children:nt}){return jsx$1(Fragment,{children:nt})},(tt,nt)=>!(tt.enable||nt.enable));function makeMarkdownHeading(tt,nt){switch(tt.toLowerCase()){case Tags.H1:return`# ${nt}`;case Tags.H2:return`## ${nt}`;case Tags.H3:return`### ${nt}`;default:throw new Error(`Unrecognized tag for header: ${tt}`)}}function Heading(tt){const{width:nt,element:et}=tt,{tag:rt,anchor:ot,body:at,help:st,hideAnchor:ut,divider:ct}=et,pt=React$1.useContext(IsSidebarContext),dt=React$1.useContext(IsDialogContext),[ft,...bt]=at.split(`
682
682
  `);return jsxs("div",{style:{width:nt},className:"stHeading","data-testid":"stHeading",children:[jsxs(StyledStreamlitMarkdown,{isCaption:!1,isInSidebarOrDialog:pt||dt,style:{width:nt},"data-testid":"stMarkdownContainer",children:[jsx$1(HeadingWithActionElements,{anchor:ot,help:st,hideAnchor:ut,tag:rt,children:jsx$1(RenderedMarkdown,{allowHTML:!1,source:makeMarkdownHeading(rt,ft),overrideComponents:{p:reactExports.Fragment,h1:reactExports.Fragment,h2:reactExports.Fragment,h3:reactExports.Fragment,h4:reactExports.Fragment,h5:reactExports.Fragment,h6:reactExports.Fragment}})}),bt.length>0&&jsx$1(RenderedMarkdown,{source:bt.join(`
683
- `),allowHTML:!1})]}),ct&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ct.includes("linear"),color:ct})]})}const StyledCheckbox$1=newStyled("div",{target:"e1eyve560"})(({width:tt,theme:nt})=>({width:tt,display:"flex",alignItems:"center",minHeight:nt.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"e1eyve561"})(({visibility:tt})=>({display:tt===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:tt===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(tt,nt){let et=nt.spacing.lg;return tt==="medium"?et=nt.spacing.threeXL:tt==="large"&&(et=nt.spacing.fourXL),et}const StyledHorizontalBlock=newStyled("div",{target:"epboeck0"})(({theme:tt,gap:nt})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth(nt,tt)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"epboeck1"})(({theme:tt,isStale:nt,width:et,elementType:rt})=>({width:et,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:tt.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${tt.spacing.lg}`,zIndex:tt.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${tt.spacing.xs}`,marginBottom:`-${tt.spacing.xs}`},...nt&&rt!=="skeleton"?{opacity:.33,transition:"opacity 1s ease-in 0.5s"}:{},...rt==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(rt)?{marginBottom:`-${tt.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"epboeck2"})(({theme:tt,weight:nt,gap:et,showBorder:rt,verticalAlignment:ot})=>{const{VerticalAlignment:at}=Block$2.Column,st=nt*100,ut=translateGapWidth(et,tt),ct=`calc(${st}% - ${ut})`;return{width:ct,flex:`1 1 ${ct}`,[`@media (max-width: ${tt.breakpoints.columns})`]:{minWidth:`calc(100% - ${tt.spacing.twoXL})`},...ot===at.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:tt.spacing.sm}},...ot===at.TOP&&{[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginTop:tt.spacing.sm}},...ot===at.CENTER&&{marginTop:"auto",marginBottom:"auto"},...rt&&{border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,borderRadius:tt.radii.default,padding:`calc(${tt.spacing.lg} - ${tt.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"epboeck3"})(({width:tt,theme:nt})=>({width:tt,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:nt.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"epboeck4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"epboeck5"})(({theme:tt,border:nt,height:et})=>({...nt&&{border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,borderRadius:tt.radii.default,padding:`calc(${tt.spacing.lg} - ${tt.sizes.borderWidth})`},...et&&{height:`${et}px`,overflow:"auto"}})),Audio=React$1.lazy(()=>__vitePreload(()=>import("./index.SfNQsyET.js"),[],import.meta.url)),Balloons=React$1.lazy(()=>__vitePreload(()=>import("./index.DrQE7SgU.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React$1.lazy(()=>__vitePreload(()=>import("./index.CF2F2422.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.fQqwNpY6.js").then(tt=>tt.c),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),ArrowVegaLiteChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BmBj8wmP.js"),__vite__mapDeps([14,15,16,17,4,6,5]),import.meta.url)),Toast=React$1.lazy(()=>__vitePreload(()=>import("./index.CVUYODJp.js"),[],import.meta.url)),BokehChart=React$1.lazy(()=>__vitePreload(()=>import("./index.Dq7_cmGP.js"),[],import.meta.url)),DebouncedBokehChart=debounceRender(BokehChart,100),DeckGlJsonChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BULH4QCI.js"),__vite__mapDeps([18,9,10,6,5,19,4,20,15,16,21]),import.meta.url)),GraphVizChart=React$1.lazy(()=>__vitePreload(()=>import("./index.CmL6Ujex.js"),__vite__mapDeps([22,17,16,20,6,5]),import.meta.url)),IFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.CqglyHhp.js"),[],import.meta.url)),ImageList=React$1.lazy(()=>__vitePreload(()=>import("./index.DHDmf3UX.js"),__vite__mapDeps([23,6,5]),import.meta.url)),LinkButton=React$1.lazy(()=>__vitePreload(()=>import("./index.CwnPK3gx.js"),[],import.meta.url)),PageLink=React$1.lazy(()=>__vitePreload(()=>import("./index.DbmG7oF7.js"),[],import.meta.url)),PlotlyChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BD3NXAcL.js"),__vite__mapDeps([24,4,5]),import.meta.url)),Video=React$1.lazy(()=>__vitePreload(()=>import("./index.Cagh8jLL.js"),[],import.meta.url)),AudioInput=React$1.lazy(()=>__vitePreload(()=>import("./index.B6UwsLmD.js"),__vite__mapDeps([25,4,6,26,8,12]),import.meta.url)),Button=React$1.lazy(()=>__vitePreload(()=>import("./index.Yo0KGqSD.js"),[],import.meta.url)),ButtonGroup=React$1.lazy(()=>__vitePreload(()=>import("./index.tMt7jAqV.js"),__vite__mapDeps([27,19,4]),import.meta.url)),DownloadButton=React$1.lazy(()=>__vitePreload(()=>import("./index.Dt3jg_pt.js"),__vite__mapDeps([28,8]),import.meta.url)),CameraInput=React$1.lazy(()=>__vitePreload(()=>import("./index.B-jmSIBo.js"),__vite__mapDeps([29,4,30,31]),import.meta.url)),ChatInput=React$1.lazy(()=>__vitePreload(()=>import("./index.DcxJ_blk.js"),__vite__mapDeps([32,33,34,35,36]),import.meta.url)),Checkbox=React$1.lazy(()=>__vitePreload(()=>import("./index.D88yAb1w.js"),__vite__mapDeps([37,19,4]),import.meta.url)),ColorPicker=React$1.lazy(()=>__vitePreload(()=>import("./index.BzjEVFap.js"),__vite__mapDeps([38,19,4]),import.meta.url)),DateInput=React$1.lazy(()=>__vitePreload(()=>import("./index.BlsQN9hy.js"),__vite__mapDeps([39,19,4,40,10,11,41,36]),import.meta.url)),Html=React$1.lazy(()=>__vitePreload(()=>import("./index.Tg6VFvwj.js"),[],import.meta.url)),Multiselect=React$1.lazy(()=>__vitePreload(()=>import("./index.B-vpOz0z.js"),__vite__mapDeps([42,19,4]),import.meta.url)),Progress=React$1.lazy(()=>__vitePreload(()=>import("./index.C6icGi6m.js"),__vite__mapDeps([43,31]),import.meta.url)),Spinner=React$1.lazy(()=>__vitePreload(()=>import("./index.ChNVIZUY.js"),[],import.meta.url)),Radio=React$1.lazy(()=>__vitePreload(()=>import("./index.DoYRr9kC.js"),__vite__mapDeps([44,19,4]),import.meta.url)),Selectbox$1=React$1.lazy(()=>__vitePreload(()=>import("./index.KpCzZZdY.js"),__vite__mapDeps([45,19,4]),import.meta.url)),Slider$1=React$1.lazy(()=>__vitePreload(()=>import("./index.CMtdKSYN.js"),__vite__mapDeps([46,7,19,4]),import.meta.url)),FileUploader=React$1.lazy(()=>__vitePreload(()=>import("./index.DmgiRd4M.js"),__vite__mapDeps([47,4,31,26,30]),import.meta.url)),TextArea=React$1.lazy(()=>__vitePreload(()=>import("./index.Bbrszxlv.js"),__vite__mapDeps([48,49,50,34,33,19,4,35,36]),import.meta.url)),TextInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CLrSNjcw.js"),__vite__mapDeps([51,49,50,34,19,4,33,41,36]),import.meta.url)),TimeInput=React$1.lazy(()=>__vitePreload(()=>import("./index.fcHu0yZM.js"),__vite__mapDeps([52,19,4,40,10,11]),import.meta.url)),NumberInput=React$1.lazy(()=>__vitePreload(()=>import("./index.BiZ0OjWX.js"),__vite__mapDeps([53,7,49,4,33,41,36]),import.meta.url)),StreamlitSyntaxHighlighter=React$1.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(tt,nt){return tt?jsx$1(Fragment,{}):nt}const RawElementNodeRenderer=tt=>{const{node:nt}=tt;if(!nt)throw new Error("ElementNode not found.");const et={width:tt.width,disableFullscreenMode:tt.disableFullscreenMode},rt={...et,widgetMgr:tt.widgetMgr,disabled:tt.widgetsDisabled,fragmentId:nt.fragmentId};switch(nt.element.type){case"alert":{const at=nt.element.alert;return jsx$1(AlertElement,{icon:at.icon,body:at.body,kind:getAlertElementKind(at.format),...et})}case"arrowTable":return jsx$1(ArrowTable,{element:nt.quiverElement,...et});case"audio":return jsx$1(Audio,{element:nt.element.audio,endpoints:tt.endpoints,...et,elementMgr:tt.widgetMgr});case"balloons":return hideIfStale(tt.isStale,jsx$1(Balloons,{scriptRunId:tt.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:nt.element.bokehChart,...et});case"code":{const at=nt.element.code;return jsx$1(StreamlitSyntaxHighlighter,{language:at.language,showLineNumbers:at.showLineNumbers,wrapLines:at.wrapLines,children:at.codeText})}case"deckGlJsonChart":return jsx$1(DeckGlJsonChart,{element:nt.element.deckGlJsonChart,...rt});case"docString":return jsx$1(DocString,{element:nt.element.docString,...et});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement,{element:nt.element.exception,...et});case"graphvizChart":return jsx$1(GraphVizChart,{element:nt.element.graphvizChart,...et});case"heading":return jsx$1(Heading,{element:nt.element.heading,...et});case"iframe":return jsx$1(IFrame,{element:nt.element.iframe,...et});case"imgs":return jsx$1(ImageList,{element:nt.element.imgs,endpoints:tt.endpoints,...et});case"json":return jsx$1(Json,{element:nt.element.json,...et});case"markdown":return jsx$1(Markdown,{element:nt.element.markdown,...et});case"metric":return jsx$1(Metric,{element:nt.element.metric});case"html":return jsx$1(Html,{element:nt.element.html,...et});case"pageLink":{const at=nt.element.pageLink,st=rt.disabled||at.disabled;return jsx$1(PageLink,{element:at,disabled:st,...et})}case"progress":return jsx$1(Progress,{element:nt.element.progress,...et});case"skeleton":return jsx$1(Skeleton,{element:nt.element.skeleton});case"snow":return hideIfStale(tt.isStale,jsx$1(Snow,{scriptRunId:tt.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:nt.element.spinner,...et});case"text":return jsx$1(TextElement,{element:nt.element.text,...et});case"video":return jsx$1(Video,{element:nt.element.video,endpoints:tt.endpoints,...et,elementMgr:tt.widgetMgr});case"toast":{const at=nt.element.toast;return jsx$1(Toast,{body:at.body,icon:at.icon,...et},nt.scriptRunId)}case"arrowDataFrame":{const at=nt.element.arrowDataFrame;return rt.disabled=rt.disabled||at.disabled,jsx$1(ArrowDataFrame,{element:at,data:nt.quiverElement,...at.id&&{key:at.id},...rt})}case"arrowVegaLiteChart":const ot=nt.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:ot,...rt},ot.id||void 0);case"audioInput":{const at=nt.element.audioInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(AudioInput,{uploadClient:tt.uploadClient,element:at,...rt},at.id)}case"button":{const at=nt.element.button;if(rt.disabled=rt.disabled||at.disabled,at.isFormSubmitter){const{formId:st}=at,ut=tt.formsData.formsWithUploads.has(st);return jsx$1(FormSubmitContent,{element:at,hasInProgressUpload:ut,...rt})}return jsx$1(Button,{element:at,...rt})}case"buttonGroup":{const at=nt.element.buttonGroup;return rt.disabled=rt.disabled||at.disabled,jsx$1(ButtonGroup,{element:at,...rt},at.id)}case"downloadButton":{const at=nt.element.downloadButton;return rt.disabled=rt.disabled||at.disabled,jsx$1(DownloadButton,{endpoints:tt.endpoints,element:at,...rt},at.id)}case"cameraInput":{const at=nt.element.cameraInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(CameraInput,{element:at,uploadClient:tt.uploadClient,...rt},at.id)}case"chatInput":{const at=nt.element.chatInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(ChatInput,{element:at,...rt},at.id)}case"checkbox":{const at=nt.element.checkbox;return rt.disabled=rt.disabled||at.disabled,jsx$1(Checkbox,{element:at,...rt},at.id)}case"colorPicker":{const at=nt.element.colorPicker;return rt.disabled=rt.disabled||at.disabled,jsx$1(ColorPicker,{element:at,...rt},at.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:tt.componentRegistry,element:nt.element.componentInstance,...rt});case"dateInput":{const at=nt.element.dateInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(DateInput,{element:at,...rt},at.id)}case"fileUploader":{const at=nt.element.fileUploader;return rt.disabled=rt.disabled||at.disabled,jsx$1(FileUploader,{element:at,uploadClient:tt.uploadClient,...rt},at.id)}case"linkButton":{const at=nt.element.linkButton;return rt.disabled=rt.disabled||at.disabled,jsx$1(LinkButton,{element:at,...rt})}case"multiselect":{const at=nt.element.multiselect;return rt.disabled=rt.disabled||at.disabled,jsx$1(Multiselect,{element:at,...rt},at.id)}case"numberInput":{const at=nt.element.numberInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(NumberInput,{element:at,...rt},at.id)}case"plotlyChart":{const at=nt.element.plotlyChart;return jsx$1(PlotlyChart,{element:at,...rt},at.id)}case"radio":{const at=nt.element.radio;return rt.disabled=rt.disabled||at.disabled,jsx$1(Radio,{element:at,...rt},at.id)}case"selectbox":{const at=nt.element.selectbox;return rt.disabled=rt.disabled||at.disabled,jsx$1(Selectbox$1,{element:at,...rt},at.id)}case"slider":{const at=nt.element.slider;return rt.disabled=rt.disabled||at.disabled,jsx$1(Slider$1,{element:at,...rt},at.id)}case"textArea":{const at=nt.element.textArea;return rt.disabled=rt.disabled||at.disabled,jsx$1(TextArea,{element:at,...rt},at.id)}case"textInput":{const at=nt.element.textInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(TextInput,{element:at,...rt},at.id)}case"timeInput":{const at=nt.element.timeInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(TimeInput,{element:at,...rt},at.id)}default:throw new Error(`Unrecognized Element type ${nt.element.type}`)}},ElementNodeRenderer=tt=>{const{isFullScreen:nt,fragmentIdsThisRun:et}=React$1.useContext(LibContext),{node:rt,width:ot}=tt,at=rt.element.type||"",st=shouldComponentBeEnabled(at,tt.scriptRunState),ut=isComponentStale(st,rt,tt.scriptRunState,tt.scriptRunId,et),ct=getElementId(rt.element),pt=getKeyFromId(ct);return jsx$1(Maybe,{enable:st,children:jsx$1(StyledElementContainer,{className:classNames("stElementContainer","element-container",convertKeyToClassName(pt)),"data-testid":"stElementContainer","data-stale":ut,isStale:ut&&!nt,width:ot,elementType:at,children:jsx$1(ErrorBoundary,{width:ot,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(Skeleton,{element:Skeleton$1.create({style:Skeleton$1.SkeletonStyle.ELEMENT})}),children:jsx$1(RawElementNodeRenderer,{...tt,isStale:ut})})})})})},BlockNodeRenderer=tt=>{const{node:nt}=tt,{fragmentIdsThisRun:et}=reactExports.useContext(LibContext);if(nt.isEmpty&&!nt.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const rt=shouldComponentBeEnabled("",tt.scriptRunState),ot=isComponentStale(rt,nt,tt.scriptRunState,tt.scriptRunId,et),at={...tt,node:nt},st=tt.disableFullscreenMode||notNullOrUndefined(nt.deltaBlock.dialog)||notNullOrUndefined(nt.deltaBlock.popover),ut=jsx$1(LayoutBlock,{...at,disableFullscreenMode:st});if(nt.deltaBlock.dialog)return jsx$1(DialogWithProvider,{element:nt.deltaBlock.dialog,deltaMsgReceivedAt:nt.deltaMsgReceivedAt,children:ut});if(nt.deltaBlock.expandable)return jsx$1(Expander,{empty:nt.isEmpty,isStale:ot,element:nt.deltaBlock.expandable,children:ut});if(nt.deltaBlock.popover)return jsx$1(Popover,{empty:nt.isEmpty,element:nt.deltaBlock.popover,width:tt.width,children:ut});if(nt.deltaBlock.type==="form"){const{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,border:ft}=nt.deltaBlock.form,bt=tt.formsData.submitButtons.get(ct),ht=bt!==void 0&&bt.length>0;return jsx$1(Form,{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,width:tt.width,hasSubmitButton:ht,scriptRunState:tt.scriptRunState,widgetMgr:tt.widgetMgr,border:ft,children:ut})}if(nt.deltaBlock.chatMessage)return jsx$1(ChatMessage,{element:nt.deltaBlock.chatMessage,endpoints:tt.endpoints,children:ut});if(nt.deltaBlock.column)return jsx$1(StyledColumn,{weight:nt.deltaBlock.column.weight??0,gap:nt.deltaBlock.column.gap??"",verticalAlignment:nt.deltaBlock.column.verticalAlignment??void 0,showBorder:nt.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ut});if(nt.deltaBlock.tabContainer){const pt={...at,isStale:ot,renderTabContent:dt=>jsx$1(VerticalBlock,{...dt})};return jsx$1(Tabs,{...pt})}return ut},ChildRenderer=tt=>{const{libConfig:nt}=reactExports.useContext(LibContext);assignDividerColor(tt.node,useTheme());const et=new Set;return jsx$1(Fragment,{children:tt.node.children&&tt.node.children.map((rt,ot)=>{const at=nt.disableFullscreenMode||tt.disableFullscreenMode;if(rt instanceof ElementNode){const st={...tt,disableFullscreenMode:at,node:rt},ut=getElementId(rt.element)||ot.toString();return et.has(ut)?null:(et.add(ut),jsx$1(ElementNodeRenderer,{...st},ut))}if(rt instanceof BlockNode){const st={...tt,disableFullscreenMode:at,node:rt};return jsx$1(BlockNodeRenderer,{...st},ot)}throw new Error(`Unrecognized AppNode: ${rt}`)})})};function ScrollToBottomVerticalBlockWrapper(tt){const{border:nt,height:et,children:rt}=tt,ot=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:nt,height:et,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:ot,children:rt})}const VerticalBlock=tt=>{var ft,bt;const nt=reactExports.useRef(null),[et,rt]=React$1.useState(-1),ot=reactExports.useMemo(()=>new ResizeObserver(([ht])=>{window.requestAnimationFrame(()=>{rt(ht.target.getBoundingClientRect().width||-1)})}),[rt]),at=((ft=tt.node.deltaBlock.vertical)==null?void 0:ft.border)??!1,st=((bt=tt.node.deltaBlock.vertical)==null?void 0:bt.height)||void 0,ut=st&&tt.node.children.find(ht=>ht instanceof BlockNode&&ht.deltaBlock.type==="chatMessage")!==void 0;reactExports.useEffect(()=>(nt.current&&ot.observe(nt.current),()=>{ot.disconnect()}),[ot,ut]);const ct=ut?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,pt={...tt,width:et},dt=getKeyFromId(tt.node.deltaBlock.id);return jsx$1(ct,{border:at,height:st,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:nt,children:jsx$1(StyledVerticalBlock,{width:et,className:classNames("stVerticalBlock",convertKeyToClassName(dt)),"data-testid":"stVerticalBlock",children:jsx$1(ChildRenderer,{...pt})})})})},HorizontalBlock=tt=>{var et;const nt=((et=tt.node.deltaBlock.horizontal)==null?void 0:et.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:nt,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...tt})})};function LayoutBlock(tt){return tt.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...tt}):jsx$1(VerticalBlock,{...tt})}const StyledDataFrameOverlay=newStyled("div",{target:"e1cp3dxa1"})(({theme:tt})=>({position:"fixed",top:0,left:0,zIndex:tt.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React$1.createContext(null),PortalProvider=({children:tt})=>{const nt=reactExports.useRef(null),et=reactExports.useCallback(()=>nt.current,[]);return jsxs(PortalContext.Provider,{value:et,children:[tt,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:nt})]})};function ThemeProvider({theme:tt,baseuiTheme:nt,children:et}){return jsx$1(ThemeProvider$1,{theme:nt||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:tt,children:et})})}function toCodePoint(tt,nt){const et=[];let rt=0,ot=0,at=0;for(;at<tt.length;)rt=tt.charCodeAt(at++),ot?(et.push((65536+(ot-55296<<10)+(rt-56320)).toString(16)),ot=0):55296<=rt&&rt<=56319?ot=rt:et.push(rt.toString(16));return et.join("-")}const UFE0Fg=/\uFE0F/g,U200D="‍";function grabTheRightIcon(tt){return toCodePoint(tt.indexOf(U200D)<0?tt.replace(UFE0Fg,""):tt)}function iconToUrl(tt){const nt=/^:(.+)\/(.+):$/,et=tt.match(nt);return et===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${et[2]}/default/24px.svg`}function handleFavicon(tt,nt,et){const rt=extractEmoji(tt);let ot;rt&&!tt.startsWith(":material")?ot=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(rt)}.png`:tt.startsWith(":material")?ot=iconToUrl(tt):ot=et.buildMediaURL(tt),overwriteFavicon(ot),nt({type:"SET_PAGE_FAVICON",favicon:ot})}function overwriteFavicon(tt){const nt=document.querySelector("link[rel='shortcut icon']");nt&&(nt.href=tt)}function extractEmoji(tt){const nt=tt.replace("-","_");return nodeEmoji$1.hasEmoji(nodeEmoji$1.get(nt))?nodeEmoji$1.get(nt):nodeEmoji$1.hasEmoji(tt)?tt:""}var lib$2={},flattenNames$1={},baseFor$1=_baseFor,keys$2=keys_1;function baseForOwn$4(tt,nt){return tt&&baseFor$1(tt,nt,keys$2)}var _baseForOwn=baseForOwn$4,identity$3=identity_1;function castFunction$2(tt){return typeof tt=="function"?tt:identity$3}var _castFunction=castFunction$2,baseForOwn$3=_baseForOwn,castFunction$1=_castFunction;function forOwn(tt,nt){return tt&&baseForOwn$3(tt,castFunction$1(nt))}var forOwn_1=forOwn,HASH_UNDEFINED$3="__lodash_hash_undefined__";function setCacheAdd$2(tt){return this.__data__.set(tt,HASH_UNDEFINED$3),this}var _setCacheAdd=setCacheAdd$2;function setCacheHas$2(tt){return this.__data__.has(tt)}var _setCacheHas=setCacheHas$2,MapCache$1=_MapCache,setCacheAdd$1=_setCacheAdd,setCacheHas$1=_setCacheHas;function SetCache$3(tt){var nt=-1,et=tt==null?0:tt.length;for(this.__data__=new MapCache$1;++nt<et;)this.add(tt[nt])}SetCache$3.prototype.add=SetCache$3.prototype.push=setCacheAdd$1;SetCache$3.prototype.has=setCacheHas$1;var _SetCache=SetCache$3;function arraySome$2(tt,nt){for(var et=-1,rt=tt==null?0:tt.length;++et<rt;)if(nt(tt[et],et,tt))return!0;return!1}var _arraySome=arraySome$2;function cacheHas$3(tt,nt){return tt.has(nt)}var _cacheHas=cacheHas$3,SetCache$2=_SetCache,arraySome$1=_arraySome,cacheHas$2=_cacheHas,COMPARE_PARTIAL_FLAG$b=1,COMPARE_UNORDERED_FLAG$7=2;function equalArrays$3(tt,nt,et,rt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$b,ut=tt.length,ct=nt.length;if(ut!=ct&&!(st&&ct>ut))return!1;var pt=at.get(tt),dt=at.get(nt);if(pt&&dt)return pt==nt&&dt==tt;var ft=-1,bt=!0,ht=et&COMPARE_UNORDERED_FLAG$7?new SetCache$2:void 0;for(at.set(tt,nt),at.set(nt,tt);++ft<ut;){var Mt=tt[ft],mt=nt[ft];if(rt)var Ot=st?rt(mt,Mt,ft,nt,tt,at):rt(Mt,mt,ft,tt,nt,at);if(Ot!==void 0){if(Ot)continue;bt=!1;break}if(ht){if(!arraySome$1(nt,function(zt,yt){if(!cacheHas$2(ht,yt)&&(Mt===zt||ot(Mt,zt,et,rt,at)))return ht.push(yt)})){bt=!1;break}}else if(!(Mt===mt||ot(Mt,mt,et,rt,at))){bt=!1;break}}return at.delete(tt),at.delete(nt),bt}var _equalArrays=equalArrays$3,Symbol$2=_Symbol,Uint8Array$2=_Uint8Array,eq$1=eq_1,equalArrays$2=_equalArrays,mapToArray$1=_mapToArray,setToArray$1=_setToArray,COMPARE_PARTIAL_FLAG$a=1,COMPARE_UNORDERED_FLAG$6=2,boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$2="[object Error]",mapTag$3="[object Map]",numberTag$2="[object Number]",regexpTag$2="[object RegExp]",setTag$3="[object Set]",stringTag$2="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",symbolProto$2=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf$1=symbolProto$2?symbolProto$2.valueOf:void 0;function equalByTag$2(tt,nt,et,rt,ot,at,st){switch(et){case dataViewTag$3:if(tt.byteLength!=nt.byteLength||tt.byteOffset!=nt.byteOffset)return!1;tt=tt.buffer,nt=nt.buffer;case arrayBufferTag$2:return!(tt.byteLength!=nt.byteLength||!at(new Uint8Array$2(tt),new Uint8Array$2(nt)));case boolTag$2:case dateTag$2:case numberTag$2:return eq$1(+tt,+nt);case errorTag$2:return tt.name==nt.name&&tt.message==nt.message;case regexpTag$2:case stringTag$2:return tt==nt+"";case mapTag$3:var ut=mapToArray$1;case setTag$3:var ct=rt&COMPARE_PARTIAL_FLAG$a;if(ut||(ut=setToArray$1),tt.size!=nt.size&&!ct)return!1;var pt=st.get(tt);if(pt)return pt==nt;rt|=COMPARE_UNORDERED_FLAG$6,st.set(tt,nt);var dt=equalArrays$2(ut(tt),ut(nt),rt,ot,at,st);return st.delete(tt),dt;case symbolTag$2:if(symbolValueOf$1)return symbolValueOf$1.call(tt)==symbolValueOf$1.call(nt)}return!1}var _equalByTag=equalByTag$2,getAllKeys$1=_getAllKeys,COMPARE_PARTIAL_FLAG$9=1,objectProto$h=Object.prototype,hasOwnProperty$f=objectProto$h.hasOwnProperty;function equalObjects$2(tt,nt,et,rt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$9,ut=getAllKeys$1(tt),ct=ut.length,pt=getAllKeys$1(nt),dt=pt.length;if(ct!=dt&&!st)return!1;for(var ft=ct;ft--;){var bt=ut[ft];if(!(st?bt in nt:hasOwnProperty$f.call(nt,bt)))return!1}var ht=at.get(tt),Mt=at.get(nt);if(ht&&Mt)return ht==nt&&Mt==tt;var mt=!0;at.set(tt,nt),at.set(nt,tt);for(var Ot=st;++ft<ct;){bt=ut[ft];var zt=tt[bt],yt=nt[bt];if(rt)var vt=st?rt(yt,zt,bt,nt,tt,at):rt(zt,yt,bt,tt,nt,at);if(!(vt===void 0?zt===yt||ot(zt,yt,et,rt,at):vt)){mt=!1;break}Ot||(Ot=bt=="constructor")}if(mt&&!Ot){var At=tt.constructor,St=nt.constructor;At!=St&&"constructor"in tt&&"constructor"in nt&&!(typeof At=="function"&&At instanceof At&&typeof St=="function"&&St instanceof St)&&(mt=!1)}return at.delete(tt),at.delete(nt),mt}var _equalObjects=equalObjects$2,Stack$2=_Stack,equalArrays$1=_equalArrays,equalByTag$1=_equalByTag,equalObjects$1=_equalObjects,getTag$1=_getTag,isArray$7=isArray_1,isBuffer$2=isBufferExports,isTypedArray$2=isTypedArray_1,COMPARE_PARTIAL_FLAG$8=1,argsTag$3="[object Arguments]",arrayTag$2="[object Array]",objectTag$4="[object Object]",objectProto$g=Object.prototype,hasOwnProperty$e=objectProto$g.hasOwnProperty;function baseIsEqualDeep$2(tt,nt,et,rt,ot,at){var st=isArray$7(tt),ut=isArray$7(nt),ct=st?arrayTag$2:getTag$1(tt),pt=ut?arrayTag$2:getTag$1(nt);ct=ct==argsTag$3?objectTag$4:ct,pt=pt==argsTag$3?objectTag$4:pt;var dt=ct==objectTag$4,ft=pt==objectTag$4,bt=ct==pt;if(bt&&isBuffer$2(tt)){if(!isBuffer$2(nt))return!1;st=!0,dt=!1}if(bt&&!dt)return at||(at=new Stack$2),st||isTypedArray$2(tt)?equalArrays$1(tt,nt,et,rt,ot,at):equalByTag$1(tt,nt,ct,et,rt,ot,at);if(!(et&COMPARE_PARTIAL_FLAG$8)){var ht=dt&&hasOwnProperty$e.call(tt,"__wrapped__"),Mt=ft&&hasOwnProperty$e.call(nt,"__wrapped__");if(ht||Mt){var mt=ht?tt.value():tt,Ot=Mt?nt.value():nt;return at||(at=new Stack$2),ot(mt,Ot,et,rt,at)}}return bt?(at||(at=new Stack$2),equalObjects$1(tt,nt,et,rt,ot,at)):!1}var _baseIsEqualDeep=baseIsEqualDeep$2,baseIsEqualDeep$1=_baseIsEqualDeep,isObjectLike$1=isObjectLike_1;function baseIsEqual$4(tt,nt,et,rt,ot){return tt===nt?!0:tt==null||nt==null||!isObjectLike$1(tt)&&!isObjectLike$1(nt)?tt!==tt&&nt!==nt:baseIsEqualDeep$1(tt,nt,et,rt,baseIsEqual$4,ot)}var _baseIsEqual=baseIsEqual$4,Stack$1=_Stack,baseIsEqual$3=_baseIsEqual,COMPARE_PARTIAL_FLAG$7=1,COMPARE_UNORDERED_FLAG$5=2;function baseIsMatch$2(tt,nt,et,rt){var ot=et.length,at=ot,st=!rt;if(tt==null)return!at;for(tt=Object(tt);ot--;){var ut=et[ot];if(st&&ut[2]?ut[1]!==tt[ut[0]]:!(ut[0]in tt))return!1}for(;++ot<at;){ut=et[ot];var ct=ut[0],pt=tt[ct],dt=ut[1];if(st&&ut[2]){if(pt===void 0&&!(ct in tt))return!1}else{var ft=new Stack$1;if(rt)var bt=rt(pt,dt,ct,tt,nt,ft);if(!(bt===void 0?baseIsEqual$3(dt,pt,COMPARE_PARTIAL_FLAG$7|COMPARE_UNORDERED_FLAG$5,rt,ft):bt))return!1}}return!0}var _baseIsMatch=baseIsMatch$2,isObject$3=isObject_1;function isStrictComparable$3(tt){return tt===tt&&!isObject$3(tt)}var _isStrictComparable=isStrictComparable$3,isStrictComparable$2=_isStrictComparable,keys$1=keys_1;function getMatchData$2(tt){for(var nt=keys$1(tt),et=nt.length;et--;){var rt=nt[et],ot=tt[rt];nt[et]=[rt,ot,isStrictComparable$2(ot)]}return nt}var _getMatchData=getMatchData$2;function matchesStrictComparable$3(tt,nt){return function(et){return et==null?!1:et[tt]===nt&&(nt!==void 0||tt in Object(et))}}var _matchesStrictComparable=matchesStrictComparable$3,baseIsMatch$1=_baseIsMatch,getMatchData$1=_getMatchData,matchesStrictComparable$2=_matchesStrictComparable;function baseMatches$2(tt){var nt=getMatchData$1(tt);return nt.length==1&&nt[0][2]?matchesStrictComparable$2(nt[0][0],nt[0][1]):function(et){return et===tt||baseIsMatch$1(et,tt,nt)}}var _baseMatches=baseMatches$2;function baseHasIn$2(tt,nt){return tt!=null&&nt in Object(tt)}var _baseHasIn=baseHasIn$2,castPath$3=_castPath,isArguments$1=isArguments_1,isArray$6=isArray_1,isIndex$2=_isIndex,isLength$1=isLength_1,toKey$4=_toKey;function hasPath$2(tt,nt,et){nt=castPath$3(nt,tt);for(var rt=-1,ot=nt.length,at=!1;++rt<ot;){var st=toKey$4(nt[rt]);if(!(at=tt!=null&&et(tt,st)))break;tt=tt[st]}return at||++rt!=ot?at:(ot=tt==null?0:tt.length,!!ot&&isLength$1(ot)&&isIndex$2(st,ot)&&(isArray$6(tt)||isArguments$1(tt)))}var _hasPath=hasPath$2,baseHasIn$1=_baseHasIn,hasPath$1=_hasPath;function hasIn$3(tt,nt){return tt!=null&&hasPath$1(tt,nt,baseHasIn$1)}var hasIn_1=hasIn$3,baseIsEqual$2=_baseIsEqual,get$2=get_1,hasIn$2=hasIn_1,isKey$2=_isKey,isStrictComparable$1=_isStrictComparable,matchesStrictComparable$1=_matchesStrictComparable,toKey$3=_toKey,COMPARE_PARTIAL_FLAG$6=1,COMPARE_UNORDERED_FLAG$4=2;function baseMatchesProperty$2(tt,nt){return isKey$2(tt)&&isStrictComparable$1(nt)?matchesStrictComparable$1(toKey$3(tt),nt):function(et){var rt=get$2(et,tt);return rt===void 0&&rt===nt?hasIn$2(et,tt):baseIsEqual$2(nt,rt,COMPARE_PARTIAL_FLAG$6|COMPARE_UNORDERED_FLAG$4)}}var _baseMatchesProperty=baseMatchesProperty$2,baseGet$3=_baseGet;function basePropertyDeep$2(tt){return function(nt){return baseGet$3(nt,tt)}}var _basePropertyDeep=basePropertyDeep$2,baseProperty$1=_baseProperty,basePropertyDeep$1=_basePropertyDeep,isKey$1=_isKey,toKey$2=_toKey;function property$2(tt){return isKey$1(tt)?baseProperty$1(toKey$2(tt)):basePropertyDeep$1(tt)}var property_1=property$2,baseMatches$1=_baseMatches,baseMatchesProperty$1=_baseMatchesProperty,identity$2=identity_1,isArray$5=isArray_1,property$1=property_1;function baseIteratee$5(tt){return typeof tt=="function"?tt:tt==null?identity$2:typeof tt=="object"?isArray$5(tt)?baseMatchesProperty$1(tt[0],tt[1]):baseMatches$1(tt):property$1(tt)}var _baseIteratee=baseIteratee$5,isArrayLike$2=isArrayLike_1;function createBaseEach$2(tt,nt){return function(et,rt){if(et==null)return et;if(!isArrayLike$2(et))return tt(et,rt);for(var ot=et.length,at=nt?ot:-1,st=Object(et);(nt?at--:++at<ot)&&rt(st[at],at,st)!==!1;);return et}}var _createBaseEach=createBaseEach$2,baseForOwn$2=_baseForOwn,createBaseEach$1=_createBaseEach,baseEach$3=createBaseEach$1(baseForOwn$2),_baseEach=baseEach$3,baseEach$2=_baseEach,isArrayLike$1=isArrayLike_1;function baseMap$3(tt,nt){var et=-1,rt=isArrayLike$1(tt)?Array(tt.length):[];return baseEach$2(tt,function(ot,at,st){rt[++et]=nt(ot,at,st)}),rt}var _baseMap=baseMap$3,arrayMap$3=_arrayMap,baseIteratee$4=_baseIteratee,baseMap$2=_baseMap,isArray$4=isArray_1;function map$1(tt,nt){var et=isArray$4(tt)?arrayMap$3:baseMap$2;return et(tt,baseIteratee$4(nt))}var map_1=map$1;Object.defineProperty(flattenNames$1,"__esModule",{value:!0});flattenNames$1.flattenNames=void 0;var _isString2=isString_1,_isString3=_interopRequireDefault$7(_isString2),_forOwn2$2=forOwn_1,_forOwn3$2=_interopRequireDefault$7(_forOwn2$2),_isPlainObject2=isPlainObject_1,_isPlainObject3=_interopRequireDefault$7(_isPlainObject2),_map2=map_1,_map3=_interopRequireDefault$7(_map2);function _interopRequireDefault$7(tt){return tt&&tt.__esModule?tt:{default:tt}}var flattenNames=flattenNames$1.flattenNames=function tt(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],et=[];return(0,_map3.default)(nt,function(rt){Array.isArray(rt)?tt(rt).map(function(ot){return et.push(ot)}):(0,_isPlainObject3.default)(rt)?(0,_forOwn3$2.default)(rt,function(ot,at){ot===!0&&et.push(at),et.push(at+"-"+ot)}):(0,_isString3.default)(rt)&&et.push(rt)}),et};flattenNames$1.default=flattenNames;var mergeClasses$1={};Object.defineProperty(mergeClasses$1,"__esModule",{value:!0});mergeClasses$1.mergeClasses=void 0;var _forOwn2$1=forOwn_1,_forOwn3$1=_interopRequireDefault$6(_forOwn2$1),_cloneDeep2=cloneDeep_1,_cloneDeep3=_interopRequireDefault$6(_cloneDeep2),_extends$w=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt};function _interopRequireDefault$6(tt){return tt&&tt.__esModule?tt:{default:tt}}var mergeClasses=mergeClasses$1.mergeClasses=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],rt=nt.default&&(0,_cloneDeep3.default)(nt.default)||{};return et.map(function(ot){var at=nt[ot];return at&&(0,_forOwn3$1.default)(at,function(st,ut){rt[ut]||(rt[ut]={}),rt[ut]=_extends$w({},rt[ut],at[ut])}),ot}),rt};mergeClasses$1.default=mergeClasses;var autoprefix$1={};Object.defineProperty(autoprefix$1,"__esModule",{value:!0});autoprefix$1.autoprefix=void 0;var _forOwn2=forOwn_1,_forOwn3=_interopRequireDefault$5(_forOwn2),_extends$v=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt};function _interopRequireDefault$5(tt){return tt&&tt.__esModule?tt:{default:tt}}var transforms={borderRadius:function tt(nt){return{msBorderRadius:nt,MozBorderRadius:nt,OBorderRadius:nt,WebkitBorderRadius:nt,borderRadius:nt}},boxShadow:function tt(nt){return{msBoxShadow:nt,MozBoxShadow:nt,OBoxShadow:nt,WebkitBoxShadow:nt,boxShadow:nt}},userSelect:function tt(nt){return{WebkitTouchCallout:nt,KhtmlUserSelect:nt,MozUserSelect:nt,msUserSelect:nt,WebkitUserSelect:nt,userSelect:nt}},flex:function tt(nt){return{WebkitBoxFlex:nt,MozBoxFlex:nt,WebkitFlex:nt,msFlex:nt,flex:nt}},flexBasis:function tt(nt){return{WebkitFlexBasis:nt,flexBasis:nt}},justifyContent:function tt(nt){return{WebkitJustifyContent:nt,justifyContent:nt}},transition:function tt(nt){return{msTransition:nt,MozTransition:nt,OTransition:nt,WebkitTransition:nt,transition:nt}},transform:function tt(nt){return{msTransform:nt,MozTransform:nt,OTransform:nt,WebkitTransform:nt,transform:nt}},absolute:function tt(nt){var et=nt&&nt.split(" ");return{position:"absolute",top:et&&et[0],right:et&&et[1],bottom:et&&et[2],left:et&&et[3]}},extend:function tt(nt,et){var rt=et[nt];return rt||{extend:nt}}},autoprefix=autoprefix$1.autoprefix=function tt(nt){var et={};return(0,_forOwn3.default)(nt,function(rt,ot){var at={};(0,_forOwn3.default)(rt,function(st,ut){var ct=transforms[ut];ct?at=_extends$v({},at,ct(st)):at[ut]=st}),et[ot]=at}),et};autoprefix$1.default=autoprefix;var hover$1={};Object.defineProperty(hover$1,"__esModule",{value:!0});hover$1.hover=void 0;var _extends$u=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_react$3=reactExports,_react2$3=_interopRequireDefault$4(_react$3);function _interopRequireDefault$4(tt){return tt&&tt.__esModule?tt:{default:tt}}function _classCallCheck$f(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$f(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$f(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var hover=hover$1.hover=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(rt){_inherits$f(ot,rt);function ot(){var at,st,ut,ct;_classCallCheck$f(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$f(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={hover:!1},ut.handleMouseOver=function(){return ut.setState({hover:!0})},ut.handleMouseOut=function(){return ut.setState({hover:!1})},ut.render=function(){return _react2$3.default.createElement(et,{onMouseOver:ut.handleMouseOver,onMouseOut:ut.handleMouseOut},_react2$3.default.createElement(nt,_extends$u({},ut.props,ut.state)))},st),_possibleConstructorReturn$f(ut,ct)}return ot}(_react2$3.default.Component)};hover$1.default=hover;var active$1={};Object.defineProperty(active$1,"__esModule",{value:!0});active$1.active=void 0;var _extends$t=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_react$2=reactExports,_react2$2=_interopRequireDefault$3(_react$2);function _interopRequireDefault$3(tt){return tt&&tt.__esModule?tt:{default:tt}}function _classCallCheck$e(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$e(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$e(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var active=active$1.active=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(rt){_inherits$e(ot,rt);function ot(){var at,st,ut,ct;_classCallCheck$e(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$e(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={active:!1},ut.handleMouseDown=function(){return ut.setState({active:!0})},ut.handleMouseUp=function(){return ut.setState({active:!1})},ut.render=function(){return _react2$2.default.createElement(et,{onMouseDown:ut.handleMouseDown,onMouseUp:ut.handleMouseUp},_react2$2.default.createElement(nt,_extends$t({},ut.props,ut.state)))},st),_possibleConstructorReturn$e(ut,ct)}return ot}(_react2$2.default.Component)};active$1.default=active;var loop={};Object.defineProperty(loop,"__esModule",{value:!0});var loopable=function tt(nt,et){var rt={},ot=function(st){var ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;rt[st]=ut};return nt===0&&ot("first-child"),nt===et-1&&ot("last-child"),(nt===0||nt%2===0)&&ot("even"),Math.abs(nt%2)===1&&ot("odd"),ot("nth-child",nt),rt};loop.default=loopable;Object.defineProperty(lib$2,"__esModule",{value:!0});lib$2.ReactCSS=lib$2.loop=lib$2.handleActive=handleHover=lib$2.handleHover=lib$2.hover=void 0;var _flattenNames=flattenNames$1,_flattenNames2=_interopRequireDefault$2(_flattenNames),_mergeClasses=mergeClasses$1,_mergeClasses2=_interopRequireDefault$2(_mergeClasses),_autoprefix=autoprefix$1,_autoprefix2=_interopRequireDefault$2(_autoprefix),_hover2=hover$1,_hover3=_interopRequireDefault$2(_hover2),_active=active$1,_active2=_interopRequireDefault$2(_active),_loop2=loop,_loop3=_interopRequireDefault$2(_loop2);function _interopRequireDefault$2(tt){return tt&&tt.__esModule?tt:{default:tt}}lib$2.hover=_hover3.default;var handleHover=lib$2.handleHover=_hover3.default;lib$2.handleActive=_active2.default;lib$2.loop=_loop3.default;var ReactCSS=lib$2.ReactCSS=function tt(nt){for(var et=arguments.length,rt=Array(et>1?et-1:0),ot=1;ot<et;ot++)rt[ot-1]=arguments[ot];var at=(0,_flattenNames2.default)(rt),st=(0,_mergeClasses2.default)(nt,at);return(0,_autoprefix2.default)(st)},_default$2=lib$2.default=ReactCSS,calculateChange$2=function tt(nt,et,rt,ot,at){var st=at.clientWidth,ut=at.clientHeight,ct=typeof nt.pageX=="number"?nt.pageX:nt.touches[0].pageX,pt=typeof nt.pageY=="number"?nt.pageY:nt.touches[0].pageY,dt=ct-(at.getBoundingClientRect().left+window.pageXOffset),ft=pt-(at.getBoundingClientRect().top+window.pageYOffset);if(rt==="vertical"){var bt=void 0;if(ft<0?bt=0:ft>ut?bt=1:bt=Math.round(ft*100/ut)/100,et.a!==bt)return{h:et.h,s:et.s,l:et.l,a:bt,source:"rgb"}}else{var ht=void 0;if(dt<0?ht=0:dt>st?ht=1:ht=Math.round(dt*100/st)/100,ot!==ht)return{h:et.h,s:et.s,l:et.l,a:ht,source:"rgb"}}return null},checkboardCache={},render=function tt(nt,et,rt,ot){if(typeof document>"u"&&!ot)return null;var at=ot?new ot:document.createElement("canvas");at.width=rt*2,at.height=rt*2;var st=at.getContext("2d");return st?(st.fillStyle=nt,st.fillRect(0,0,at.width,at.height),st.fillStyle=et,st.fillRect(0,0,rt,rt),st.translate(rt,rt),st.fillRect(0,0,rt,rt),at.toDataURL()):null},get$1=function tt(nt,et,rt,ot){var at=nt+"-"+et+"-"+rt+(ot?"-server":"");if(checkboardCache[at])return checkboardCache[at];var st=render(nt,et,rt,ot);return checkboardCache[at]=st,st},_extends$s=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},Checkboard=function tt(nt){var et=nt.white,rt=nt.grey,ot=nt.size,at=nt.renderers,st=nt.borderRadius,ut=nt.boxShadow,ct=nt.children,pt=_default$2({default:{grid:{borderRadius:st,boxShadow:ut,absolute:"0px 0px 0px 0px",background:"url("+get$1(et,rt,ot,at.canvas)+") center left"}}});return reactExports.isValidElement(ct)?React$1.cloneElement(ct,_extends$s({},ct.props,{style:_extends$s({},ct.props.style,pt.grid)})):React$1.createElement("div",{style:pt.grid})};Checkboard.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var _extends$r=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_createClass$d=function(){function tt(nt,et){for(var rt=0;rt<et.length;rt++){var ot=et[rt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(nt,ot.key,ot)}}return function(nt,et,rt){return et&&tt(nt.prototype,et),rt&&tt(nt,rt),nt}}();function _classCallCheck$d(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$d(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$d(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var Alpha=function(tt){_inherits$d(nt,tt);function nt(){var et,rt,ot,at;_classCallCheck$d(this,nt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(rt=(ot=_possibleConstructorReturn$d(this,(et=nt.__proto__||Object.getPrototypeOf(nt)).call.apply(et,[this].concat(ut))),ot),ot.handleChange=function(pt){var dt=calculateChange$2(pt,ot.props.hsl,ot.props.direction,ot.props.a,ot.container);dt&&typeof ot.props.onChange=="function"&&ot.props.onChange(dt,pt)},ot.handleMouseDown=function(pt){ot.handleChange(pt),window.addEventListener("mousemove",ot.handleChange),window.addEventListener("mouseup",ot.handleMouseUp)},ot.handleMouseUp=function(){ot.unbindEventListeners()},ot.unbindEventListeners=function(){window.removeEventListener("mousemove",ot.handleChange),window.removeEventListener("mouseup",ot.handleMouseUp)},rt),_possibleConstructorReturn$d(ot,at)}return _createClass$d(nt,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var rt=this,ot=this.props.rgb,at=_default$2({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("+ot.r+","+ot.g+","+ot.b+`, 0) 0%,
683
+ `),allowHTML:!1})]}),ct&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ct.includes("linear"),color:ct})]})}const StyledCheckbox$1=newStyled("div",{target:"e1eyve560"})(({width:tt,theme:nt})=>({width:tt,display:"flex",alignItems:"center",minHeight:nt.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"e1eyve561"})(({visibility:tt})=>({display:tt===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:tt===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(tt,nt){let et=nt.spacing.lg;return tt==="medium"?et=nt.spacing.threeXL:tt==="large"&&(et=nt.spacing.fourXL),et}const StyledHorizontalBlock=newStyled("div",{target:"epboeck0"})(({theme:tt,gap:nt})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth(nt,tt)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"epboeck1"})(({theme:tt,isStale:nt,width:et,elementType:rt})=>({width:et,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:tt.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${tt.spacing.lg}`,zIndex:tt.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${tt.spacing.xs}`,marginBottom:`-${tt.spacing.xs}`},...nt&&rt!=="skeleton"?{opacity:.33,transition:"opacity 1s ease-in 0.5s"}:{},...rt==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(rt)?{marginBottom:`-${tt.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"epboeck2"})(({theme:tt,weight:nt,gap:et,showBorder:rt,verticalAlignment:ot})=>{const{VerticalAlignment:at}=Block$2.Column,st=nt*100,ut=translateGapWidth(et,tt),ct=`calc(${st}% - ${ut})`;return{width:ct,flex:`1 1 ${ct}`,[`@media (max-width: ${tt.breakpoints.columns})`]:{minWidth:`calc(100% - ${tt.spacing.twoXL})`},...ot===at.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:tt.spacing.sm}},...ot===at.TOP&&{[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginTop:tt.spacing.sm}},...ot===at.CENTER&&{marginTop:"auto",marginBottom:"auto"},...rt&&{border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,borderRadius:tt.radii.default,padding:`calc(${tt.spacing.lg} - ${tt.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"epboeck3"})(({width:tt,theme:nt})=>({width:tt,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:nt.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"epboeck4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"epboeck5"})(({theme:tt,border:nt,height:et})=>({...nt&&{border:`${tt.sizes.borderWidth} solid ${tt.colors.borderColor}`,borderRadius:tt.radii.default,padding:`calc(${tt.spacing.lg} - ${tt.sizes.borderWidth})`},...et&&{height:`${et}px`,overflow:"auto"}})),Audio=React$1.lazy(()=>__vitePreload(()=>import("./index.P6pRVKPa.js"),[],import.meta.url)),Balloons=React$1.lazy(()=>__vitePreload(()=>import("./index.CvCo5a1I.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React$1.lazy(()=>__vitePreload(()=>import("./index.ZGuf7st3.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.QYI5Zkk5.js").then(tt=>tt.c),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),ArrowVegaLiteChart=React$1.lazy(()=>__vitePreload(()=>import("./index.Bt81IJiu.js"),__vite__mapDeps([14,15,16,17,4,6,5]),import.meta.url)),Toast=React$1.lazy(()=>__vitePreload(()=>import("./index.DIJ9HldI.js"),[],import.meta.url)),BokehChart=React$1.lazy(()=>__vitePreload(()=>import("./index.CpYg-rJx.js"),[],import.meta.url)),DebouncedBokehChart=debounceRender(BokehChart,100),DeckGlJsonChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BcbWCkO4.js"),__vite__mapDeps([18,9,10,6,5,19,4,20,15,16,21]),import.meta.url)),GraphVizChart=React$1.lazy(()=>__vitePreload(()=>import("./index.DiLaw-x6.js"),__vite__mapDeps([22,17,16,20,6,5]),import.meta.url)),IFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.BixGIbC5.js"),[],import.meta.url)),ImageList=React$1.lazy(()=>__vitePreload(()=>import("./index.ALAY1YUc.js"),__vite__mapDeps([23,6,5]),import.meta.url)),LinkButton=React$1.lazy(()=>__vitePreload(()=>import("./index.B8is6IAj.js"),[],import.meta.url)),PageLink=React$1.lazy(()=>__vitePreload(()=>import("./index.DzIG_URz.js"),[],import.meta.url)),PlotlyChart=React$1.lazy(()=>__vitePreload(()=>import("./index.sJIiloxS.js"),__vite__mapDeps([24,4,5]),import.meta.url)),Video=React$1.lazy(()=>__vitePreload(()=>import("./index.BayydfX0.js"),[],import.meta.url)),AudioInput=React$1.lazy(()=>__vitePreload(()=>import("./index.Dm7Vtozc.js"),__vite__mapDeps([25,4,6,26,8,12]),import.meta.url)),Button=React$1.lazy(()=>__vitePreload(()=>import("./index.i2leGeFb.js"),[],import.meta.url)),ButtonGroup=React$1.lazy(()=>__vitePreload(()=>import("./index.B60aqwr7.js"),__vite__mapDeps([27,19,4]),import.meta.url)),DownloadButton=React$1.lazy(()=>__vitePreload(()=>import("./index.Bnlq1gA7.js"),__vite__mapDeps([28,8]),import.meta.url)),CameraInput=React$1.lazy(()=>__vitePreload(()=>import("./index.Dt0U2KOG.js"),__vite__mapDeps([29,4,30,31]),import.meta.url)),ChatInput=React$1.lazy(()=>__vitePreload(()=>import("./index.BRMdTfDY.js"),__vite__mapDeps([32,33,34,35,36]),import.meta.url)),Checkbox=React$1.lazy(()=>__vitePreload(()=>import("./index.C6aGEDUC.js"),__vite__mapDeps([37,19,4]),import.meta.url)),ColorPicker=React$1.lazy(()=>__vitePreload(()=>import("./index.DhrIC-YG.js"),__vite__mapDeps([38,19,4]),import.meta.url)),DateInput=React$1.lazy(()=>__vitePreload(()=>import("./index.BV11qw37.js"),__vite__mapDeps([39,19,4,40,10,11,41,36]),import.meta.url)),Html=React$1.lazy(()=>__vitePreload(()=>import("./index.CuYk4ioW.js"),[],import.meta.url)),Multiselect=React$1.lazy(()=>__vitePreload(()=>import("./index.DXlDoScw.js"),__vite__mapDeps([42,19,4]),import.meta.url)),Progress=React$1.lazy(()=>__vitePreload(()=>import("./index.ClxFeb0x.js"),__vite__mapDeps([43,31]),import.meta.url)),Spinner=React$1.lazy(()=>__vitePreload(()=>import("./index.D3j-YI8c.js"),[],import.meta.url)),Radio=React$1.lazy(()=>__vitePreload(()=>import("./index.CgFCoGQM.js"),__vite__mapDeps([44,19,4]),import.meta.url)),Selectbox$1=React$1.lazy(()=>__vitePreload(()=>import("./index.D54tamnX.js"),__vite__mapDeps([45,19,4]),import.meta.url)),Slider$1=React$1.lazy(()=>__vitePreload(()=>import("./index.XdL5yZbP.js"),__vite__mapDeps([46,7,19,4]),import.meta.url)),FileUploader=React$1.lazy(()=>__vitePreload(()=>import("./index.CuApUHlx.js"),__vite__mapDeps([47,4,31,26,30]),import.meta.url)),TextArea=React$1.lazy(()=>__vitePreload(()=>import("./index.CawcX6dO.js"),__vite__mapDeps([48,49,50,34,33,19,4,35,36]),import.meta.url)),TextInput=React$1.lazy(()=>__vitePreload(()=>import("./index.DdQG8WhP.js"),__vite__mapDeps([51,49,50,34,19,4,33,41,36]),import.meta.url)),TimeInput=React$1.lazy(()=>__vitePreload(()=>import("./index.DSrZB-JX.js"),__vite__mapDeps([52,19,4,40,10,11]),import.meta.url)),NumberInput=React$1.lazy(()=>__vitePreload(()=>import("./index.DB4bAANU.js"),__vite__mapDeps([53,7,49,4,33,41,36]),import.meta.url)),StreamlitSyntaxHighlighter=React$1.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(tt,nt){return tt?jsx$1(Fragment,{}):nt}const RawElementNodeRenderer=tt=>{const{node:nt}=tt;if(!nt)throw new Error("ElementNode not found.");const et={width:tt.width,disableFullscreenMode:tt.disableFullscreenMode},rt={...et,widgetMgr:tt.widgetMgr,disabled:tt.widgetsDisabled,fragmentId:nt.fragmentId};switch(nt.element.type){case"alert":{const at=nt.element.alert;return jsx$1(AlertElement,{icon:at.icon,body:at.body,kind:getAlertElementKind(at.format),...et})}case"arrowTable":return jsx$1(ArrowTable,{element:nt.quiverElement,...et});case"audio":return jsx$1(Audio,{element:nt.element.audio,endpoints:tt.endpoints,...et,elementMgr:tt.widgetMgr});case"balloons":return hideIfStale(tt.isStale,jsx$1(Balloons,{scriptRunId:tt.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:nt.element.bokehChart,...et});case"code":{const at=nt.element.code;return jsx$1(StreamlitSyntaxHighlighter,{language:at.language,showLineNumbers:at.showLineNumbers,wrapLines:at.wrapLines,children:at.codeText})}case"deckGlJsonChart":return jsx$1(DeckGlJsonChart,{element:nt.element.deckGlJsonChart,...rt});case"docString":return jsx$1(DocString,{element:nt.element.docString,...et});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement,{element:nt.element.exception,...et});case"graphvizChart":return jsx$1(GraphVizChart,{element:nt.element.graphvizChart,...et});case"heading":return jsx$1(Heading,{element:nt.element.heading,...et});case"iframe":return jsx$1(IFrame,{element:nt.element.iframe,...et});case"imgs":return jsx$1(ImageList,{element:nt.element.imgs,endpoints:tt.endpoints,...et});case"json":return jsx$1(Json,{element:nt.element.json,...et});case"markdown":return jsx$1(Markdown,{element:nt.element.markdown,...et});case"metric":return jsx$1(Metric,{element:nt.element.metric});case"html":return jsx$1(Html,{element:nt.element.html,...et});case"pageLink":{const at=nt.element.pageLink,st=rt.disabled||at.disabled;return jsx$1(PageLink,{element:at,disabled:st,...et})}case"progress":return jsx$1(Progress,{element:nt.element.progress,...et});case"skeleton":return jsx$1(Skeleton,{element:nt.element.skeleton});case"snow":return hideIfStale(tt.isStale,jsx$1(Snow,{scriptRunId:tt.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:nt.element.spinner,...et});case"text":return jsx$1(TextElement,{element:nt.element.text,...et});case"video":return jsx$1(Video,{element:nt.element.video,endpoints:tt.endpoints,...et,elementMgr:tt.widgetMgr});case"toast":{const at=nt.element.toast;return jsx$1(Toast,{body:at.body,icon:at.icon,...et},nt.scriptRunId)}case"arrowDataFrame":{const at=nt.element.arrowDataFrame;return rt.disabled=rt.disabled||at.disabled,jsx$1(ArrowDataFrame,{element:at,data:nt.quiverElement,...at.id&&{key:at.id},...rt})}case"arrowVegaLiteChart":const ot=nt.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:ot,...rt},ot.id||void 0);case"audioInput":{const at=nt.element.audioInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(AudioInput,{uploadClient:tt.uploadClient,element:at,...rt},at.id)}case"button":{const at=nt.element.button;if(rt.disabled=rt.disabled||at.disabled,at.isFormSubmitter){const{formId:st}=at,ut=tt.formsData.formsWithUploads.has(st);return jsx$1(FormSubmitContent,{element:at,hasInProgressUpload:ut,...rt})}return jsx$1(Button,{element:at,...rt})}case"buttonGroup":{const at=nt.element.buttonGroup;return rt.disabled=rt.disabled||at.disabled,jsx$1(ButtonGroup,{element:at,...rt},at.id)}case"downloadButton":{const at=nt.element.downloadButton;return rt.disabled=rt.disabled||at.disabled,jsx$1(DownloadButton,{endpoints:tt.endpoints,element:at,...rt},at.id)}case"cameraInput":{const at=nt.element.cameraInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(CameraInput,{element:at,uploadClient:tt.uploadClient,...rt},at.id)}case"chatInput":{const at=nt.element.chatInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(ChatInput,{element:at,...rt},at.id)}case"checkbox":{const at=nt.element.checkbox;return rt.disabled=rt.disabled||at.disabled,jsx$1(Checkbox,{element:at,...rt},at.id)}case"colorPicker":{const at=nt.element.colorPicker;return rt.disabled=rt.disabled||at.disabled,jsx$1(ColorPicker,{element:at,...rt},at.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:tt.componentRegistry,element:nt.element.componentInstance,...rt});case"dateInput":{const at=nt.element.dateInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(DateInput,{element:at,...rt},at.id)}case"fileUploader":{const at=nt.element.fileUploader;return rt.disabled=rt.disabled||at.disabled,jsx$1(FileUploader,{element:at,uploadClient:tt.uploadClient,...rt},at.id)}case"linkButton":{const at=nt.element.linkButton;return rt.disabled=rt.disabled||at.disabled,jsx$1(LinkButton,{element:at,...rt})}case"multiselect":{const at=nt.element.multiselect;return rt.disabled=rt.disabled||at.disabled,jsx$1(Multiselect,{element:at,...rt},at.id)}case"numberInput":{const at=nt.element.numberInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(NumberInput,{element:at,...rt},at.id)}case"plotlyChart":{const at=nt.element.plotlyChart;return jsx$1(PlotlyChart,{element:at,...rt},at.id)}case"radio":{const at=nt.element.radio;return rt.disabled=rt.disabled||at.disabled,jsx$1(Radio,{element:at,...rt},at.id)}case"selectbox":{const at=nt.element.selectbox;return rt.disabled=rt.disabled||at.disabled,jsx$1(Selectbox$1,{element:at,...rt},at.id)}case"slider":{const at=nt.element.slider;return rt.disabled=rt.disabled||at.disabled,jsx$1(Slider$1,{element:at,...rt},at.id)}case"textArea":{const at=nt.element.textArea;return rt.disabled=rt.disabled||at.disabled,jsx$1(TextArea,{element:at,...rt},at.id)}case"textInput":{const at=nt.element.textInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(TextInput,{element:at,...rt},at.id)}case"timeInput":{const at=nt.element.timeInput;return rt.disabled=rt.disabled||at.disabled,jsx$1(TimeInput,{element:at,...rt},at.id)}default:throw new Error(`Unrecognized Element type ${nt.element.type}`)}},ElementNodeRenderer=tt=>{const{isFullScreen:nt,fragmentIdsThisRun:et}=React$1.useContext(LibContext),{node:rt,width:ot}=tt,at=rt.element.type||"",st=shouldComponentBeEnabled(at,tt.scriptRunState),ut=isComponentStale(st,rt,tt.scriptRunState,tt.scriptRunId,et),ct=getElementId(rt.element),pt=getKeyFromId(ct);return jsx$1(Maybe,{enable:st,children:jsx$1(StyledElementContainer,{className:classNames("stElementContainer","element-container",convertKeyToClassName(pt)),"data-testid":"stElementContainer","data-stale":ut,isStale:ut&&!nt,width:ot,elementType:at,children:jsx$1(ErrorBoundary,{width:ot,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(Skeleton,{element:Skeleton$1.create({style:Skeleton$1.SkeletonStyle.ELEMENT})}),children:jsx$1(RawElementNodeRenderer,{...tt,isStale:ut})})})})})},BlockNodeRenderer=tt=>{const{node:nt}=tt,{fragmentIdsThisRun:et}=reactExports.useContext(LibContext);if(nt.isEmpty&&!nt.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const rt=shouldComponentBeEnabled("",tt.scriptRunState),ot=isComponentStale(rt,nt,tt.scriptRunState,tt.scriptRunId,et),at={...tt,node:nt},st=tt.disableFullscreenMode||notNullOrUndefined(nt.deltaBlock.dialog)||notNullOrUndefined(nt.deltaBlock.popover),ut=jsx$1(LayoutBlock,{...at,disableFullscreenMode:st});if(nt.deltaBlock.dialog)return jsx$1(DialogWithProvider,{element:nt.deltaBlock.dialog,deltaMsgReceivedAt:nt.deltaMsgReceivedAt,children:ut});if(nt.deltaBlock.expandable)return jsx$1(Expander,{empty:nt.isEmpty,isStale:ot,element:nt.deltaBlock.expandable,children:ut});if(nt.deltaBlock.popover)return jsx$1(Popover,{empty:nt.isEmpty,element:nt.deltaBlock.popover,width:tt.width,children:ut});if(nt.deltaBlock.type==="form"){const{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,border:ft}=nt.deltaBlock.form,bt=tt.formsData.submitButtons.get(ct),ht=bt!==void 0&&bt.length>0;return jsx$1(Form,{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,width:tt.width,hasSubmitButton:ht,scriptRunState:tt.scriptRunState,widgetMgr:tt.widgetMgr,border:ft,children:ut})}if(nt.deltaBlock.chatMessage)return jsx$1(ChatMessage,{element:nt.deltaBlock.chatMessage,endpoints:tt.endpoints,children:ut});if(nt.deltaBlock.column)return jsx$1(StyledColumn,{weight:nt.deltaBlock.column.weight??0,gap:nt.deltaBlock.column.gap??"",verticalAlignment:nt.deltaBlock.column.verticalAlignment??void 0,showBorder:nt.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ut});if(nt.deltaBlock.tabContainer){const pt={...at,isStale:ot,renderTabContent:dt=>jsx$1(VerticalBlock,{...dt})};return jsx$1(Tabs,{...pt})}return ut},ChildRenderer=tt=>{const{libConfig:nt}=reactExports.useContext(LibContext);assignDividerColor(tt.node,useTheme());const et=new Set;return jsx$1(Fragment,{children:tt.node.children&&tt.node.children.map((rt,ot)=>{const at=nt.disableFullscreenMode||tt.disableFullscreenMode;if(rt instanceof ElementNode){const st={...tt,disableFullscreenMode:at,node:rt},ut=getElementId(rt.element)||ot.toString();return et.has(ut)?null:(et.add(ut),jsx$1(ElementNodeRenderer,{...st},ut))}if(rt instanceof BlockNode){const st={...tt,disableFullscreenMode:at,node:rt};return jsx$1(BlockNodeRenderer,{...st},ot)}throw new Error(`Unrecognized AppNode: ${rt}`)})})};function ScrollToBottomVerticalBlockWrapper(tt){const{border:nt,height:et,children:rt}=tt,ot=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:nt,height:et,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:ot,children:rt})}const VerticalBlock=tt=>{var ft,bt;const nt=reactExports.useRef(null),[et,rt]=React$1.useState(-1),ot=reactExports.useMemo(()=>new ResizeObserver(([ht])=>{window.requestAnimationFrame(()=>{rt(ht.target.getBoundingClientRect().width||-1)})}),[rt]),at=((ft=tt.node.deltaBlock.vertical)==null?void 0:ft.border)??!1,st=((bt=tt.node.deltaBlock.vertical)==null?void 0:bt.height)||void 0,ut=st&&tt.node.children.find(ht=>ht instanceof BlockNode&&ht.deltaBlock.type==="chatMessage")!==void 0;reactExports.useEffect(()=>(nt.current&&ot.observe(nt.current),()=>{ot.disconnect()}),[ot,ut]);const ct=ut?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,pt={...tt,width:et},dt=getKeyFromId(tt.node.deltaBlock.id);return jsx$1(ct,{border:at,height:st,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:nt,children:jsx$1(StyledVerticalBlock,{width:et,className:classNames("stVerticalBlock",convertKeyToClassName(dt)),"data-testid":"stVerticalBlock",children:jsx$1(ChildRenderer,{...pt})})})})},HorizontalBlock=tt=>{var et;const nt=((et=tt.node.deltaBlock.horizontal)==null?void 0:et.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:nt,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...tt})})};function LayoutBlock(tt){return tt.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...tt}):jsx$1(VerticalBlock,{...tt})}const StyledDataFrameOverlay=newStyled("div",{target:"e1cp3dxa1"})(({theme:tt})=>({position:"fixed",top:0,left:0,zIndex:tt.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React$1.createContext(null),PortalProvider=({children:tt})=>{const nt=reactExports.useRef(null),et=reactExports.useCallback(()=>nt.current,[]);return jsxs(PortalContext.Provider,{value:et,children:[tt,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:nt})]})};function ThemeProvider({theme:tt,baseuiTheme:nt,children:et}){return jsx$1(ThemeProvider$1,{theme:nt||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:tt,children:et})})}function toCodePoint(tt,nt){const et=[];let rt=0,ot=0,at=0;for(;at<tt.length;)rt=tt.charCodeAt(at++),ot?(et.push((65536+(ot-55296<<10)+(rt-56320)).toString(16)),ot=0):55296<=rt&&rt<=56319?ot=rt:et.push(rt.toString(16));return et.join("-")}const UFE0Fg=/\uFE0F/g,U200D="‍";function grabTheRightIcon(tt){return toCodePoint(tt.indexOf(U200D)<0?tt.replace(UFE0Fg,""):tt)}function iconToUrl(tt){const nt=/^:(.+)\/(.+):$/,et=tt.match(nt);return et===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${et[2]}/default/24px.svg`}function handleFavicon(tt,nt,et){const rt=extractEmoji(tt);let ot;rt&&!tt.startsWith(":material")?ot=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(rt)}.png`:tt.startsWith(":material")?ot=iconToUrl(tt):ot=et.buildMediaURL(tt),overwriteFavicon(ot),nt({type:"SET_PAGE_FAVICON",favicon:ot})}function overwriteFavicon(tt){const nt=document.querySelector("link[rel='shortcut icon']");nt&&(nt.href=tt)}function extractEmoji(tt){const nt=tt.replace("-","_");return nodeEmoji$1.hasEmoji(nodeEmoji$1.get(nt))?nodeEmoji$1.get(nt):nodeEmoji$1.hasEmoji(tt)?tt:""}var lib$2={},flattenNames$1={},baseFor$1=_baseFor,keys$2=keys_1;function baseForOwn$4(tt,nt){return tt&&baseFor$1(tt,nt,keys$2)}var _baseForOwn=baseForOwn$4,identity$3=identity_1;function castFunction$2(tt){return typeof tt=="function"?tt:identity$3}var _castFunction=castFunction$2,baseForOwn$3=_baseForOwn,castFunction$1=_castFunction;function forOwn(tt,nt){return tt&&baseForOwn$3(tt,castFunction$1(nt))}var forOwn_1=forOwn,HASH_UNDEFINED$3="__lodash_hash_undefined__";function setCacheAdd$2(tt){return this.__data__.set(tt,HASH_UNDEFINED$3),this}var _setCacheAdd=setCacheAdd$2;function setCacheHas$2(tt){return this.__data__.has(tt)}var _setCacheHas=setCacheHas$2,MapCache$1=_MapCache,setCacheAdd$1=_setCacheAdd,setCacheHas$1=_setCacheHas;function SetCache$3(tt){var nt=-1,et=tt==null?0:tt.length;for(this.__data__=new MapCache$1;++nt<et;)this.add(tt[nt])}SetCache$3.prototype.add=SetCache$3.prototype.push=setCacheAdd$1;SetCache$3.prototype.has=setCacheHas$1;var _SetCache=SetCache$3;function arraySome$2(tt,nt){for(var et=-1,rt=tt==null?0:tt.length;++et<rt;)if(nt(tt[et],et,tt))return!0;return!1}var _arraySome=arraySome$2;function cacheHas$3(tt,nt){return tt.has(nt)}var _cacheHas=cacheHas$3,SetCache$2=_SetCache,arraySome$1=_arraySome,cacheHas$2=_cacheHas,COMPARE_PARTIAL_FLAG$b=1,COMPARE_UNORDERED_FLAG$7=2;function equalArrays$3(tt,nt,et,rt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$b,ut=tt.length,ct=nt.length;if(ut!=ct&&!(st&&ct>ut))return!1;var pt=at.get(tt),dt=at.get(nt);if(pt&&dt)return pt==nt&&dt==tt;var ft=-1,bt=!0,ht=et&COMPARE_UNORDERED_FLAG$7?new SetCache$2:void 0;for(at.set(tt,nt),at.set(nt,tt);++ft<ut;){var Mt=tt[ft],mt=nt[ft];if(rt)var Ot=st?rt(mt,Mt,ft,nt,tt,at):rt(Mt,mt,ft,tt,nt,at);if(Ot!==void 0){if(Ot)continue;bt=!1;break}if(ht){if(!arraySome$1(nt,function(zt,yt){if(!cacheHas$2(ht,yt)&&(Mt===zt||ot(Mt,zt,et,rt,at)))return ht.push(yt)})){bt=!1;break}}else if(!(Mt===mt||ot(Mt,mt,et,rt,at))){bt=!1;break}}return at.delete(tt),at.delete(nt),bt}var _equalArrays=equalArrays$3,Symbol$2=_Symbol,Uint8Array$2=_Uint8Array,eq$1=eq_1,equalArrays$2=_equalArrays,mapToArray$1=_mapToArray,setToArray$1=_setToArray,COMPARE_PARTIAL_FLAG$a=1,COMPARE_UNORDERED_FLAG$6=2,boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$2="[object Error]",mapTag$3="[object Map]",numberTag$2="[object Number]",regexpTag$2="[object RegExp]",setTag$3="[object Set]",stringTag$2="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",symbolProto$2=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf$1=symbolProto$2?symbolProto$2.valueOf:void 0;function equalByTag$2(tt,nt,et,rt,ot,at,st){switch(et){case dataViewTag$3:if(tt.byteLength!=nt.byteLength||tt.byteOffset!=nt.byteOffset)return!1;tt=tt.buffer,nt=nt.buffer;case arrayBufferTag$2:return!(tt.byteLength!=nt.byteLength||!at(new Uint8Array$2(tt),new Uint8Array$2(nt)));case boolTag$2:case dateTag$2:case numberTag$2:return eq$1(+tt,+nt);case errorTag$2:return tt.name==nt.name&&tt.message==nt.message;case regexpTag$2:case stringTag$2:return tt==nt+"";case mapTag$3:var ut=mapToArray$1;case setTag$3:var ct=rt&COMPARE_PARTIAL_FLAG$a;if(ut||(ut=setToArray$1),tt.size!=nt.size&&!ct)return!1;var pt=st.get(tt);if(pt)return pt==nt;rt|=COMPARE_UNORDERED_FLAG$6,st.set(tt,nt);var dt=equalArrays$2(ut(tt),ut(nt),rt,ot,at,st);return st.delete(tt),dt;case symbolTag$2:if(symbolValueOf$1)return symbolValueOf$1.call(tt)==symbolValueOf$1.call(nt)}return!1}var _equalByTag=equalByTag$2,getAllKeys$1=_getAllKeys,COMPARE_PARTIAL_FLAG$9=1,objectProto$h=Object.prototype,hasOwnProperty$f=objectProto$h.hasOwnProperty;function equalObjects$2(tt,nt,et,rt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$9,ut=getAllKeys$1(tt),ct=ut.length,pt=getAllKeys$1(nt),dt=pt.length;if(ct!=dt&&!st)return!1;for(var ft=ct;ft--;){var bt=ut[ft];if(!(st?bt in nt:hasOwnProperty$f.call(nt,bt)))return!1}var ht=at.get(tt),Mt=at.get(nt);if(ht&&Mt)return ht==nt&&Mt==tt;var mt=!0;at.set(tt,nt),at.set(nt,tt);for(var Ot=st;++ft<ct;){bt=ut[ft];var zt=tt[bt],yt=nt[bt];if(rt)var vt=st?rt(yt,zt,bt,nt,tt,at):rt(zt,yt,bt,tt,nt,at);if(!(vt===void 0?zt===yt||ot(zt,yt,et,rt,at):vt)){mt=!1;break}Ot||(Ot=bt=="constructor")}if(mt&&!Ot){var At=tt.constructor,St=nt.constructor;At!=St&&"constructor"in tt&&"constructor"in nt&&!(typeof At=="function"&&At instanceof At&&typeof St=="function"&&St instanceof St)&&(mt=!1)}return at.delete(tt),at.delete(nt),mt}var _equalObjects=equalObjects$2,Stack$2=_Stack,equalArrays$1=_equalArrays,equalByTag$1=_equalByTag,equalObjects$1=_equalObjects,getTag$1=_getTag,isArray$7=isArray_1,isBuffer$2=isBufferExports,isTypedArray$2=isTypedArray_1,COMPARE_PARTIAL_FLAG$8=1,argsTag$3="[object Arguments]",arrayTag$2="[object Array]",objectTag$4="[object Object]",objectProto$g=Object.prototype,hasOwnProperty$e=objectProto$g.hasOwnProperty;function baseIsEqualDeep$2(tt,nt,et,rt,ot,at){var st=isArray$7(tt),ut=isArray$7(nt),ct=st?arrayTag$2:getTag$1(tt),pt=ut?arrayTag$2:getTag$1(nt);ct=ct==argsTag$3?objectTag$4:ct,pt=pt==argsTag$3?objectTag$4:pt;var dt=ct==objectTag$4,ft=pt==objectTag$4,bt=ct==pt;if(bt&&isBuffer$2(tt)){if(!isBuffer$2(nt))return!1;st=!0,dt=!1}if(bt&&!dt)return at||(at=new Stack$2),st||isTypedArray$2(tt)?equalArrays$1(tt,nt,et,rt,ot,at):equalByTag$1(tt,nt,ct,et,rt,ot,at);if(!(et&COMPARE_PARTIAL_FLAG$8)){var ht=dt&&hasOwnProperty$e.call(tt,"__wrapped__"),Mt=ft&&hasOwnProperty$e.call(nt,"__wrapped__");if(ht||Mt){var mt=ht?tt.value():tt,Ot=Mt?nt.value():nt;return at||(at=new Stack$2),ot(mt,Ot,et,rt,at)}}return bt?(at||(at=new Stack$2),equalObjects$1(tt,nt,et,rt,ot,at)):!1}var _baseIsEqualDeep=baseIsEqualDeep$2,baseIsEqualDeep$1=_baseIsEqualDeep,isObjectLike$1=isObjectLike_1;function baseIsEqual$4(tt,nt,et,rt,ot){return tt===nt?!0:tt==null||nt==null||!isObjectLike$1(tt)&&!isObjectLike$1(nt)?tt!==tt&&nt!==nt:baseIsEqualDeep$1(tt,nt,et,rt,baseIsEqual$4,ot)}var _baseIsEqual=baseIsEqual$4,Stack$1=_Stack,baseIsEqual$3=_baseIsEqual,COMPARE_PARTIAL_FLAG$7=1,COMPARE_UNORDERED_FLAG$5=2;function baseIsMatch$2(tt,nt,et,rt){var ot=et.length,at=ot,st=!rt;if(tt==null)return!at;for(tt=Object(tt);ot--;){var ut=et[ot];if(st&&ut[2]?ut[1]!==tt[ut[0]]:!(ut[0]in tt))return!1}for(;++ot<at;){ut=et[ot];var ct=ut[0],pt=tt[ct],dt=ut[1];if(st&&ut[2]){if(pt===void 0&&!(ct in tt))return!1}else{var ft=new Stack$1;if(rt)var bt=rt(pt,dt,ct,tt,nt,ft);if(!(bt===void 0?baseIsEqual$3(dt,pt,COMPARE_PARTIAL_FLAG$7|COMPARE_UNORDERED_FLAG$5,rt,ft):bt))return!1}}return!0}var _baseIsMatch=baseIsMatch$2,isObject$3=isObject_1;function isStrictComparable$3(tt){return tt===tt&&!isObject$3(tt)}var _isStrictComparable=isStrictComparable$3,isStrictComparable$2=_isStrictComparable,keys$1=keys_1;function getMatchData$2(tt){for(var nt=keys$1(tt),et=nt.length;et--;){var rt=nt[et],ot=tt[rt];nt[et]=[rt,ot,isStrictComparable$2(ot)]}return nt}var _getMatchData=getMatchData$2;function matchesStrictComparable$3(tt,nt){return function(et){return et==null?!1:et[tt]===nt&&(nt!==void 0||tt in Object(et))}}var _matchesStrictComparable=matchesStrictComparable$3,baseIsMatch$1=_baseIsMatch,getMatchData$1=_getMatchData,matchesStrictComparable$2=_matchesStrictComparable;function baseMatches$2(tt){var nt=getMatchData$1(tt);return nt.length==1&&nt[0][2]?matchesStrictComparable$2(nt[0][0],nt[0][1]):function(et){return et===tt||baseIsMatch$1(et,tt,nt)}}var _baseMatches=baseMatches$2;function baseHasIn$2(tt,nt){return tt!=null&&nt in Object(tt)}var _baseHasIn=baseHasIn$2,castPath$3=_castPath,isArguments$1=isArguments_1,isArray$6=isArray_1,isIndex$2=_isIndex,isLength$1=isLength_1,toKey$4=_toKey;function hasPath$2(tt,nt,et){nt=castPath$3(nt,tt);for(var rt=-1,ot=nt.length,at=!1;++rt<ot;){var st=toKey$4(nt[rt]);if(!(at=tt!=null&&et(tt,st)))break;tt=tt[st]}return at||++rt!=ot?at:(ot=tt==null?0:tt.length,!!ot&&isLength$1(ot)&&isIndex$2(st,ot)&&(isArray$6(tt)||isArguments$1(tt)))}var _hasPath=hasPath$2,baseHasIn$1=_baseHasIn,hasPath$1=_hasPath;function hasIn$3(tt,nt){return tt!=null&&hasPath$1(tt,nt,baseHasIn$1)}var hasIn_1=hasIn$3,baseIsEqual$2=_baseIsEqual,get$2=get_1,hasIn$2=hasIn_1,isKey$2=_isKey,isStrictComparable$1=_isStrictComparable,matchesStrictComparable$1=_matchesStrictComparable,toKey$3=_toKey,COMPARE_PARTIAL_FLAG$6=1,COMPARE_UNORDERED_FLAG$4=2;function baseMatchesProperty$2(tt,nt){return isKey$2(tt)&&isStrictComparable$1(nt)?matchesStrictComparable$1(toKey$3(tt),nt):function(et){var rt=get$2(et,tt);return rt===void 0&&rt===nt?hasIn$2(et,tt):baseIsEqual$2(nt,rt,COMPARE_PARTIAL_FLAG$6|COMPARE_UNORDERED_FLAG$4)}}var _baseMatchesProperty=baseMatchesProperty$2,baseGet$3=_baseGet;function basePropertyDeep$2(tt){return function(nt){return baseGet$3(nt,tt)}}var _basePropertyDeep=basePropertyDeep$2,baseProperty$1=_baseProperty,basePropertyDeep$1=_basePropertyDeep,isKey$1=_isKey,toKey$2=_toKey;function property$2(tt){return isKey$1(tt)?baseProperty$1(toKey$2(tt)):basePropertyDeep$1(tt)}var property_1=property$2,baseMatches$1=_baseMatches,baseMatchesProperty$1=_baseMatchesProperty,identity$2=identity_1,isArray$5=isArray_1,property$1=property_1;function baseIteratee$5(tt){return typeof tt=="function"?tt:tt==null?identity$2:typeof tt=="object"?isArray$5(tt)?baseMatchesProperty$1(tt[0],tt[1]):baseMatches$1(tt):property$1(tt)}var _baseIteratee=baseIteratee$5,isArrayLike$2=isArrayLike_1;function createBaseEach$2(tt,nt){return function(et,rt){if(et==null)return et;if(!isArrayLike$2(et))return tt(et,rt);for(var ot=et.length,at=nt?ot:-1,st=Object(et);(nt?at--:++at<ot)&&rt(st[at],at,st)!==!1;);return et}}var _createBaseEach=createBaseEach$2,baseForOwn$2=_baseForOwn,createBaseEach$1=_createBaseEach,baseEach$3=createBaseEach$1(baseForOwn$2),_baseEach=baseEach$3,baseEach$2=_baseEach,isArrayLike$1=isArrayLike_1;function baseMap$3(tt,nt){var et=-1,rt=isArrayLike$1(tt)?Array(tt.length):[];return baseEach$2(tt,function(ot,at,st){rt[++et]=nt(ot,at,st)}),rt}var _baseMap=baseMap$3,arrayMap$3=_arrayMap,baseIteratee$4=_baseIteratee,baseMap$2=_baseMap,isArray$4=isArray_1;function map$1(tt,nt){var et=isArray$4(tt)?arrayMap$3:baseMap$2;return et(tt,baseIteratee$4(nt))}var map_1=map$1;Object.defineProperty(flattenNames$1,"__esModule",{value:!0});flattenNames$1.flattenNames=void 0;var _isString2=isString_1,_isString3=_interopRequireDefault$7(_isString2),_forOwn2$2=forOwn_1,_forOwn3$2=_interopRequireDefault$7(_forOwn2$2),_isPlainObject2=isPlainObject_1,_isPlainObject3=_interopRequireDefault$7(_isPlainObject2),_map2=map_1,_map3=_interopRequireDefault$7(_map2);function _interopRequireDefault$7(tt){return tt&&tt.__esModule?tt:{default:tt}}var flattenNames=flattenNames$1.flattenNames=function tt(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],et=[];return(0,_map3.default)(nt,function(rt){Array.isArray(rt)?tt(rt).map(function(ot){return et.push(ot)}):(0,_isPlainObject3.default)(rt)?(0,_forOwn3$2.default)(rt,function(ot,at){ot===!0&&et.push(at),et.push(at+"-"+ot)}):(0,_isString3.default)(rt)&&et.push(rt)}),et};flattenNames$1.default=flattenNames;var mergeClasses$1={};Object.defineProperty(mergeClasses$1,"__esModule",{value:!0});mergeClasses$1.mergeClasses=void 0;var _forOwn2$1=forOwn_1,_forOwn3$1=_interopRequireDefault$6(_forOwn2$1),_cloneDeep2=cloneDeep_1,_cloneDeep3=_interopRequireDefault$6(_cloneDeep2),_extends$w=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt};function _interopRequireDefault$6(tt){return tt&&tt.__esModule?tt:{default:tt}}var mergeClasses=mergeClasses$1.mergeClasses=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],rt=nt.default&&(0,_cloneDeep3.default)(nt.default)||{};return et.map(function(ot){var at=nt[ot];return at&&(0,_forOwn3$1.default)(at,function(st,ut){rt[ut]||(rt[ut]={}),rt[ut]=_extends$w({},rt[ut],at[ut])}),ot}),rt};mergeClasses$1.default=mergeClasses;var autoprefix$1={};Object.defineProperty(autoprefix$1,"__esModule",{value:!0});autoprefix$1.autoprefix=void 0;var _forOwn2=forOwn_1,_forOwn3=_interopRequireDefault$5(_forOwn2),_extends$v=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt};function _interopRequireDefault$5(tt){return tt&&tt.__esModule?tt:{default:tt}}var transforms={borderRadius:function tt(nt){return{msBorderRadius:nt,MozBorderRadius:nt,OBorderRadius:nt,WebkitBorderRadius:nt,borderRadius:nt}},boxShadow:function tt(nt){return{msBoxShadow:nt,MozBoxShadow:nt,OBoxShadow:nt,WebkitBoxShadow:nt,boxShadow:nt}},userSelect:function tt(nt){return{WebkitTouchCallout:nt,KhtmlUserSelect:nt,MozUserSelect:nt,msUserSelect:nt,WebkitUserSelect:nt,userSelect:nt}},flex:function tt(nt){return{WebkitBoxFlex:nt,MozBoxFlex:nt,WebkitFlex:nt,msFlex:nt,flex:nt}},flexBasis:function tt(nt){return{WebkitFlexBasis:nt,flexBasis:nt}},justifyContent:function tt(nt){return{WebkitJustifyContent:nt,justifyContent:nt}},transition:function tt(nt){return{msTransition:nt,MozTransition:nt,OTransition:nt,WebkitTransition:nt,transition:nt}},transform:function tt(nt){return{msTransform:nt,MozTransform:nt,OTransform:nt,WebkitTransform:nt,transform:nt}},absolute:function tt(nt){var et=nt&&nt.split(" ");return{position:"absolute",top:et&&et[0],right:et&&et[1],bottom:et&&et[2],left:et&&et[3]}},extend:function tt(nt,et){var rt=et[nt];return rt||{extend:nt}}},autoprefix=autoprefix$1.autoprefix=function tt(nt){var et={};return(0,_forOwn3.default)(nt,function(rt,ot){var at={};(0,_forOwn3.default)(rt,function(st,ut){var ct=transforms[ut];ct?at=_extends$v({},at,ct(st)):at[ut]=st}),et[ot]=at}),et};autoprefix$1.default=autoprefix;var hover$1={};Object.defineProperty(hover$1,"__esModule",{value:!0});hover$1.hover=void 0;var _extends$u=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_react$3=reactExports,_react2$3=_interopRequireDefault$4(_react$3);function _interopRequireDefault$4(tt){return tt&&tt.__esModule?tt:{default:tt}}function _classCallCheck$f(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$f(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$f(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var hover=hover$1.hover=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(rt){_inherits$f(ot,rt);function ot(){var at,st,ut,ct;_classCallCheck$f(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$f(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={hover:!1},ut.handleMouseOver=function(){return ut.setState({hover:!0})},ut.handleMouseOut=function(){return ut.setState({hover:!1})},ut.render=function(){return _react2$3.default.createElement(et,{onMouseOver:ut.handleMouseOver,onMouseOut:ut.handleMouseOut},_react2$3.default.createElement(nt,_extends$u({},ut.props,ut.state)))},st),_possibleConstructorReturn$f(ut,ct)}return ot}(_react2$3.default.Component)};hover$1.default=hover;var active$1={};Object.defineProperty(active$1,"__esModule",{value:!0});active$1.active=void 0;var _extends$t=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_react$2=reactExports,_react2$2=_interopRequireDefault$3(_react$2);function _interopRequireDefault$3(tt){return tt&&tt.__esModule?tt:{default:tt}}function _classCallCheck$e(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$e(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$e(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var active=active$1.active=function tt(nt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(rt){_inherits$e(ot,rt);function ot(){var at,st,ut,ct;_classCallCheck$e(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$e(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={active:!1},ut.handleMouseDown=function(){return ut.setState({active:!0})},ut.handleMouseUp=function(){return ut.setState({active:!1})},ut.render=function(){return _react2$2.default.createElement(et,{onMouseDown:ut.handleMouseDown,onMouseUp:ut.handleMouseUp},_react2$2.default.createElement(nt,_extends$t({},ut.props,ut.state)))},st),_possibleConstructorReturn$e(ut,ct)}return ot}(_react2$2.default.Component)};active$1.default=active;var loop={};Object.defineProperty(loop,"__esModule",{value:!0});var loopable=function tt(nt,et){var rt={},ot=function(st){var ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;rt[st]=ut};return nt===0&&ot("first-child"),nt===et-1&&ot("last-child"),(nt===0||nt%2===0)&&ot("even"),Math.abs(nt%2)===1&&ot("odd"),ot("nth-child",nt),rt};loop.default=loopable;Object.defineProperty(lib$2,"__esModule",{value:!0});lib$2.ReactCSS=lib$2.loop=lib$2.handleActive=handleHover=lib$2.handleHover=lib$2.hover=void 0;var _flattenNames=flattenNames$1,_flattenNames2=_interopRequireDefault$2(_flattenNames),_mergeClasses=mergeClasses$1,_mergeClasses2=_interopRequireDefault$2(_mergeClasses),_autoprefix=autoprefix$1,_autoprefix2=_interopRequireDefault$2(_autoprefix),_hover2=hover$1,_hover3=_interopRequireDefault$2(_hover2),_active=active$1,_active2=_interopRequireDefault$2(_active),_loop2=loop,_loop3=_interopRequireDefault$2(_loop2);function _interopRequireDefault$2(tt){return tt&&tt.__esModule?tt:{default:tt}}lib$2.hover=_hover3.default;var handleHover=lib$2.handleHover=_hover3.default;lib$2.handleActive=_active2.default;lib$2.loop=_loop3.default;var ReactCSS=lib$2.ReactCSS=function tt(nt){for(var et=arguments.length,rt=Array(et>1?et-1:0),ot=1;ot<et;ot++)rt[ot-1]=arguments[ot];var at=(0,_flattenNames2.default)(rt),st=(0,_mergeClasses2.default)(nt,at);return(0,_autoprefix2.default)(st)},_default$2=lib$2.default=ReactCSS,calculateChange$2=function tt(nt,et,rt,ot,at){var st=at.clientWidth,ut=at.clientHeight,ct=typeof nt.pageX=="number"?nt.pageX:nt.touches[0].pageX,pt=typeof nt.pageY=="number"?nt.pageY:nt.touches[0].pageY,dt=ct-(at.getBoundingClientRect().left+window.pageXOffset),ft=pt-(at.getBoundingClientRect().top+window.pageYOffset);if(rt==="vertical"){var bt=void 0;if(ft<0?bt=0:ft>ut?bt=1:bt=Math.round(ft*100/ut)/100,et.a!==bt)return{h:et.h,s:et.s,l:et.l,a:bt,source:"rgb"}}else{var ht=void 0;if(dt<0?ht=0:dt>st?ht=1:ht=Math.round(dt*100/st)/100,ot!==ht)return{h:et.h,s:et.s,l:et.l,a:ht,source:"rgb"}}return null},checkboardCache={},render=function tt(nt,et,rt,ot){if(typeof document>"u"&&!ot)return null;var at=ot?new ot:document.createElement("canvas");at.width=rt*2,at.height=rt*2;var st=at.getContext("2d");return st?(st.fillStyle=nt,st.fillRect(0,0,at.width,at.height),st.fillStyle=et,st.fillRect(0,0,rt,rt),st.translate(rt,rt),st.fillRect(0,0,rt,rt),at.toDataURL()):null},get$1=function tt(nt,et,rt,ot){var at=nt+"-"+et+"-"+rt+(ot?"-server":"");if(checkboardCache[at])return checkboardCache[at];var st=render(nt,et,rt,ot);return checkboardCache[at]=st,st},_extends$s=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},Checkboard=function tt(nt){var et=nt.white,rt=nt.grey,ot=nt.size,at=nt.renderers,st=nt.borderRadius,ut=nt.boxShadow,ct=nt.children,pt=_default$2({default:{grid:{borderRadius:st,boxShadow:ut,absolute:"0px 0px 0px 0px",background:"url("+get$1(et,rt,ot,at.canvas)+") center left"}}});return reactExports.isValidElement(ct)?React$1.cloneElement(ct,_extends$s({},ct.props,{style:_extends$s({},ct.props.style,pt.grid)})):React$1.createElement("div",{style:pt.grid})};Checkboard.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var _extends$r=Object.assign||function(tt){for(var nt=1;nt<arguments.length;nt++){var et=arguments[nt];for(var rt in et)Object.prototype.hasOwnProperty.call(et,rt)&&(tt[rt]=et[rt])}return tt},_createClass$d=function(){function tt(nt,et){for(var rt=0;rt<et.length;rt++){var ot=et[rt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(nt,ot.key,ot)}}return function(nt,et,rt){return et&&tt(nt.prototype,et),rt&&tt(nt,rt),nt}}();function _classCallCheck$d(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$d(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$d(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var Alpha=function(tt){_inherits$d(nt,tt);function nt(){var et,rt,ot,at;_classCallCheck$d(this,nt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(rt=(ot=_possibleConstructorReturn$d(this,(et=nt.__proto__||Object.getPrototypeOf(nt)).call.apply(et,[this].concat(ut))),ot),ot.handleChange=function(pt){var dt=calculateChange$2(pt,ot.props.hsl,ot.props.direction,ot.props.a,ot.container);dt&&typeof ot.props.onChange=="function"&&ot.props.onChange(dt,pt)},ot.handleMouseDown=function(pt){ot.handleChange(pt),window.addEventListener("mousemove",ot.handleChange),window.addEventListener("mouseup",ot.handleMouseUp)},ot.handleMouseUp=function(){ot.unbindEventListeners()},ot.unbindEventListeners=function(){window.removeEventListener("mousemove",ot.handleChange),window.removeEventListener("mouseup",ot.handleMouseUp)},rt),_possibleConstructorReturn$d(ot,at)}return _createClass$d(nt,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var rt=this,ot=this.props.rgb,at=_default$2({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("+ot.r+","+ot.g+","+ot.b+`, 0) 0%,
684
684
  rgba(`+ot.r+","+ot.g+","+ot.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:ot.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("+ot.r+","+ot.g+","+ot.b+`, 0) 0%,
685
685
  rgba(`+ot.r+","+ot.g+","+ot.b+", 1) 100%)"},pointer:{left:0,top:ot.a*100+"%"}},overwrite:_extends$r({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return React$1.createElement("div",{style:at.alpha},React$1.createElement("div",{style:at.checkboard},React$1.createElement(Checkboard,{renderers:this.props.renderers})),React$1.createElement("div",{style:at.gradient}),React$1.createElement("div",{style:at.container,ref:function(ut){return rt.container=ut},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React$1.createElement("div",{style:at.pointer},this.props.pointer?React$1.createElement(this.props.pointer,this.props):React$1.createElement("div",{style:at.slider}))))}}]),nt}(reactExports.PureComponent||reactExports.Component),_createClass$c=function(){function tt(nt,et){for(var rt=0;rt<et.length;rt++){var ot=et[rt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(nt,ot.key,ot)}}return function(nt,et,rt){return et&&tt(nt.prototype,et),rt&&tt(nt,rt),nt}}();function _defineProperty$d(tt,nt,et){return nt in tt?Object.defineProperty(tt,nt,{value:et,enumerable:!0,configurable:!0,writable:!0}):tt[nt]=et,tt}function _classCallCheck$c(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$c(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$c(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var DEFAULT_ARROW_OFFSET=1,UP_KEY_CODE=38,DOWN_KEY_CODE=40,VALID_KEY_CODES=[UP_KEY_CODE,DOWN_KEY_CODE],isValidKeyCode=function tt(nt){return VALID_KEY_CODES.indexOf(nt)>-1},getNumberValue=function tt(nt){return Number(String(nt).replace(/%/g,""))},idCounter=1,EditableInput=function(tt){_inherits$c(nt,tt);function nt(et){_classCallCheck$c(this,nt);var rt=_possibleConstructorReturn$c(this,(nt.__proto__||Object.getPrototypeOf(nt)).call(this));return rt.handleBlur=function(){rt.state.blurValue&&rt.setState({value:rt.state.blurValue,blurValue:null})},rt.handleChange=function(ot){rt.setUpdatedValue(ot.target.value,ot)},rt.handleKeyDown=function(ot){var at=getNumberValue(ot.target.value);if(!isNaN(at)&&isValidKeyCode(ot.keyCode)){var st=rt.getArrowOffset(),ut=ot.keyCode===UP_KEY_CODE?at+st:at-st;rt.setUpdatedValue(ut,ot)}},rt.handleDrag=function(ot){if(rt.props.dragLabel){var at=Math.round(rt.props.value+ot.movementX);at>=0&&at<=rt.props.dragMax&&rt.props.onChange&&rt.props.onChange(rt.getValueObjectWithLabel(at),ot)}},rt.handleMouseDown=function(ot){rt.props.dragLabel&&(ot.preventDefault(),rt.handleDrag(ot),window.addEventListener("mousemove",rt.handleDrag),window.addEventListener("mouseup",rt.handleMouseUp))},rt.handleMouseUp=function(){rt.unbindEventListeners()},rt.unbindEventListeners=function(){window.removeEventListener("mousemove",rt.handleDrag),window.removeEventListener("mouseup",rt.handleMouseUp)},rt.state={value:String(et.value).toUpperCase(),blurValue:String(et.value).toUpperCase()},rt.inputId="rc-editable-input-"+idCounter++,rt}return _createClass$c(nt,[{key:"componentDidUpdate",value:function(rt,ot){this.props.value!==this.state.value&&(rt.value!==this.props.value||ot.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(rt){return _defineProperty$d({},this.props.label,rt)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||DEFAULT_ARROW_OFFSET}},{key:"setUpdatedValue",value:function(rt,ot){var at=this.props.label?this.getValueObjectWithLabel(rt):rt;this.props.onChange&&this.props.onChange(at,ot),this.setState({value:rt})}},{key:"render",value:function(){var rt=this,ot=_default$2({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$1.createElement("div",{style:ot.wrap},React$1.createElement("input",{id:this.inputId,style:ot.input,ref:function(st){return rt.input=st},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$1.createElement("label",{htmlFor:this.inputId,style:ot.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),nt}(reactExports.PureComponent||reactExports.Component),calculateChange$1=function tt(nt,et,rt,ot){var at=ot.clientWidth,st=ot.clientHeight,ut=typeof nt.pageX=="number"?nt.pageX:nt.touches[0].pageX,ct=typeof nt.pageY=="number"?nt.pageY:nt.touches[0].pageY,pt=ut-(ot.getBoundingClientRect().left+window.pageXOffset),dt=ct-(ot.getBoundingClientRect().top+window.pageYOffset);if(et==="vertical"){var ft=void 0;if(dt<0)ft=359;else if(dt>st)ft=0;else{var bt=-(dt*100/st)+100;ft=360*bt/100}if(rt.h!==ft)return{h:ft,s:rt.s,l:rt.l,a:rt.a,source:"hsl"}}else{var ht=void 0;if(pt<0)ht=0;else if(pt>at)ht=359;else{var Mt=pt*100/at;ht=360*Mt/100}if(rt.h!==ht)return{h:ht,s:rt.s,l:rt.l,a:rt.a,source:"hsl"}}return null},_createClass$b=function(){function tt(nt,et){for(var rt=0;rt<et.length;rt++){var ot=et[rt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(nt,ot.key,ot)}}return function(nt,et,rt){return et&&tt(nt.prototype,et),rt&&tt(nt,rt),nt}}();function _classCallCheck$b(tt,nt){if(!(tt instanceof nt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$b(tt,nt){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return nt&&(typeof nt=="object"||typeof nt=="function")?nt:tt}function _inherits$b(tt,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof nt);tt.prototype=Object.create(nt&&nt.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),nt&&(Object.setPrototypeOf?Object.setPrototypeOf(tt,nt):tt.__proto__=nt)}var Hue=function(tt){_inherits$b(nt,tt);function nt(){var et,rt,ot,at;_classCallCheck$b(this,nt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(rt=(ot=_possibleConstructorReturn$b(this,(et=nt.__proto__||Object.getPrototypeOf(nt)).call.apply(et,[this].concat(ut))),ot),ot.handleChange=function(pt){var dt=calculateChange$1(pt,ot.props.direction,ot.props.hsl,ot.container);dt&&typeof ot.props.onChange=="function"&&ot.props.onChange(dt,pt)},ot.handleMouseDown=function(pt){ot.handleChange(pt),window.addEventListener("mousemove",ot.handleChange),window.addEventListener("mouseup",ot.handleMouseUp)},ot.handleMouseUp=function(){ot.unbindEventListeners()},rt),_possibleConstructorReturn$b(ot,at)}return _createClass$b(nt,[{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 rt=this,ot=this.props.direction,at=ot===void 0?"horizontal":ot,st=_default$2({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:at==="vertical"});return React$1.createElement("div",{style:st.hue},React$1.createElement("div",{className:"hue-"+at,style:st.container,ref:function(ct){return rt.container=ct},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React$1.createElement("style",null,`
686
686
  .hue-horizontal {
@@ -795,4 +795,4 @@ not been pushed to GitHub. Please add it to continue.
795
795
  `):" "+renderReason(at[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+st,"ERR_NOT_SUPPORT")}return rt},adapters:knownAdapters};function throwIfCancellationRequested(tt){if(tt.cancelToken&&tt.cancelToken.throwIfRequested(),tt.signal&&tt.signal.aborted)throw new CanceledError(null,tt)}function dispatchRequest(tt){return throwIfCancellationRequested(tt),tt.headers=AxiosHeaders.from(tt.headers),tt.data=transformData.call(tt,tt.transformRequest),["post","put","patch"].indexOf(tt.method)!==-1&&tt.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(tt.adapter||defaults.adapter)(tt).then(function(rt){return throwIfCancellationRequested(tt),rt.data=transformData.call(tt,tt.transformResponse,rt),rt.headers=AxiosHeaders.from(rt.headers),rt},function(rt){return isCancel(rt)||(throwIfCancellationRequested(tt),rt&&rt.response&&(rt.response.data=transformData.call(tt,tt.transformResponse,rt.response),rt.response.headers=AxiosHeaders.from(rt.response.headers))),Promise.reject(rt)})}const VERSION="1.7.9",validators$1={};["object","boolean","number","function","string","symbol"].forEach((tt,nt)=>{validators$1[tt]=function(rt){return typeof rt===tt||"a"+(nt<1?"n ":" ")+tt}});const deprecatedWarnings={};validators$1.transitional=function tt(nt,et,rt){function ot(at,st){return"[Axios v"+VERSION+"] Transitional option '"+at+"'"+st+(rt?". "+rt:"")}return(at,st,ut)=>{if(nt===!1)throw new AxiosError(ot(st," has been removed"+(et?" in "+et:"")),AxiosError.ERR_DEPRECATED);return et&&!deprecatedWarnings[st]&&(deprecatedWarnings[st]=!0,console.warn(ot(st," has been deprecated since v"+et+" and will be removed in the near future"))),nt?nt(at,st,ut):!0}};validators$1.spelling=function tt(nt){return(et,rt)=>(console.warn(`${rt} is likely a misspelling of ${nt}`),!0)};function assertOptions(tt,nt,et){if(typeof tt!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const rt=Object.keys(tt);let ot=rt.length;for(;ot-- >0;){const at=rt[ot],st=nt[at];if(st){const ut=tt[at],ct=ut===void 0||st(ut,at,tt);if(ct!==!0)throw new AxiosError("option "+at+" must be "+ct,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(et!==!0)throw new AxiosError("Unknown option "+at,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(nt){this.defaults=nt,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(nt,et){try{return await this._request(nt,et)}catch(rt){if(rt instanceof Error){let ot={};Error.captureStackTrace?Error.captureStackTrace(ot):ot=new Error;const at=ot.stack?ot.stack.replace(/^.+\n/,""):"";try{rt.stack?at&&!String(rt.stack).endsWith(at.replace(/^.+\n.+\n/,""))&&(rt.stack+=`
796
796
  `+at):rt.stack=at}catch{}}throw rt}}_request(nt,et){typeof nt=="string"?(et=et||{},et.url=nt):et=nt||{},et=mergeConfig(this.defaults,et);const{transitional:rt,paramsSerializer:ot,headers:at}=et;rt!==void 0&&validator.assertOptions(rt,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),ot!=null&&(utils$1.isFunction(ot)?et.paramsSerializer={serialize:ot}:validator.assertOptions(ot,{encode:validators.function,serialize:validators.function},!0)),validator.assertOptions(et,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),et.method=(et.method||this.defaults.method||"get").toLowerCase();let st=at&&utils$1.merge(at.common,at[et.method]);at&&utils$1.forEach(["delete","get","head","post","put","patch","common"],Mt=>{delete at[Mt]}),et.headers=AxiosHeaders.concat(st,at);const ut=[];let ct=!0;this.interceptors.request.forEach(function(mt){typeof mt.runWhen=="function"&&mt.runWhen(et)===!1||(ct=ct&&mt.synchronous,ut.unshift(mt.fulfilled,mt.rejected))});const pt=[];this.interceptors.response.forEach(function(mt){pt.push(mt.fulfilled,mt.rejected)});let dt,ft=0,bt;if(!ct){const Mt=[dispatchRequest.bind(this),void 0];for(Mt.unshift.apply(Mt,ut),Mt.push.apply(Mt,pt),bt=Mt.length,dt=Promise.resolve(et);ft<bt;)dt=dt.then(Mt[ft++],Mt[ft++]);return dt}bt=ut.length;let ht=et;for(ft=0;ft<bt;){const Mt=ut[ft++],mt=ut[ft++];try{ht=Mt(ht)}catch(Ot){mt.call(this,Ot);break}}try{dt=dispatchRequest.call(this,ht)}catch(Mt){return Promise.reject(Mt)}for(ft=0,bt=pt.length;ft<bt;)dt=dt.then(pt[ft++],pt[ft++]);return dt}getUri(nt){nt=mergeConfig(this.defaults,nt);const et=buildFullPath(nt.baseURL,nt.url);return buildURL(et,nt.params,nt.paramsSerializer)}}utils$1.forEach(["delete","get","head","options"],function tt(nt){Axios.prototype[nt]=function(et,rt){return this.request(mergeConfig(rt||{},{method:nt,url:et,data:(rt||{}).data}))}});utils$1.forEach(["post","put","patch"],function tt(nt){function et(rt){return function(at,st,ut){return this.request(mergeConfig(ut||{},{method:nt,headers:rt?{"Content-Type":"multipart/form-data"}:{},url:at,data:st}))}}Axios.prototype[nt]=et(),Axios.prototype[nt+"Form"]=et(!0)});class CancelToken{constructor(nt){if(typeof nt!="function")throw new TypeError("executor must be a function.");let et;this.promise=new Promise(function(at){et=at});const rt=this;this.promise.then(ot=>{if(!rt._listeners)return;let at=rt._listeners.length;for(;at-- >0;)rt._listeners[at](ot);rt._listeners=null}),this.promise.then=ot=>{let at;const st=new Promise(ut=>{rt.subscribe(ut),at=ut}).then(ot);return st.cancel=function(){rt.unsubscribe(at)},st},nt(function(at,st,ut){rt.reason||(rt.reason=new CanceledError(at,st,ut),et(rt.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(nt){if(this.reason){nt(this.reason);return}this._listeners?this._listeners.push(nt):this._listeners=[nt]}unsubscribe(nt){if(!this._listeners)return;const et=this._listeners.indexOf(nt);et!==-1&&this._listeners.splice(et,1)}toAbortSignal(){const nt=new AbortController,et=rt=>{nt.abort(rt)};return this.subscribe(et),nt.signal.unsubscribe=()=>this.unsubscribe(et),nt.signal}static source(){let nt;return{token:new CancelToken(function(ot){nt=ot}),cancel:nt}}}function spread(tt){return function(et){return tt.apply(null,et)}}function isAxiosError(tt){return utils$1.isObject(tt)&&tt.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([tt,nt])=>{HttpStatusCode[nt]=tt});function createInstance(tt){const nt=new Axios(tt),et=bind(Axios.prototype.request,nt);return utils$1.extend(et,Axios.prototype,nt,{allOwnKeys:!0}),utils$1.extend(et,nt,null,{allOwnKeys:!0}),et.create=function(ot){return createInstance(mergeConfig(tt,ot))},et}const axios=createInstance(defaults);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function tt(nt){return Promise.all(nt)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=tt=>formDataToJSON(utils$1.isHTMLForm(tt)?new FormData(tt):tt);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;const LOG="WebsocketConnection",SERVER_PING_PATH="_stcore/health",HOST_CONFIG_PATH="_stcore/host-config",WEBSOCKET_STREAM_PATH="_stcore/stream",PING_MINIMUM_RETRY_PERIOD_MS=500,PING_MAXIMUM_RETRY_PERIOD_MS=1e3*60,PING_TIMEOUT_MS=15*1e3,WEBSOCKET_TIMEOUT_MS=15*1e3,CORS_ERROR_MESSAGE_DOCUMENTATION_LINK="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS";class WebsocketConnection{constructor(nt){this.uriIndex=0,this.lastDispatchedMessageIndex=-1,this.nextMessageIndex=0,this.messageQueue={},this.state=ConnectionState.INITIAL,this.args=nt,this.cache=new ForwardMsgCache(nt.endpoints),this.stepFsm("INITIALIZED")}getBaseUriParts(){if(this.state===ConnectionState.CONNECTED)return this.args.baseUriPartsList[this.uriIndex]}disconnect(){this.setFsmState(ConnectionState.DISCONNECTED_FOREVER)}setFsmState(nt,et){switch(this.state=nt,this.state){case ConnectionState.PINGING_SERVER:this.pingServer();break}switch(this.args.onConnectionStateChange(nt,et),this.state){case ConnectionState.CONNECTING:this.connectToWebSocket();break;case ConnectionState.DISCONNECTED_FOREVER:this.closeConnection();break}}stepFsm(nt,et){if(logMessage(LOG,`State: ${this.state}; Event: ${nt}`),nt==="FATAL_ERROR"&&this.state!==ConnectionState.DISCONNECTED_FOREVER){this.setFsmState(ConnectionState.DISCONNECTED_FOREVER,et);return}switch(this.state){case ConnectionState.INITIAL:if(nt==="INITIALIZED"){this.setFsmState(ConnectionState.PINGING_SERVER);return}break;case ConnectionState.CONNECTING:if(nt==="CONNECTION_SUCCEEDED"){this.setFsmState(ConnectionState.CONNECTED);return}if(nt==="CONNECTION_TIMED_OUT"||nt==="CONNECTION_ERROR"||nt==="CONNECTION_CLOSED"){this.setFsmState(ConnectionState.PINGING_SERVER);return}break;case ConnectionState.CONNECTED:if(nt==="CONNECTION_CLOSED"||nt==="CONNECTION_ERROR"){this.setFsmState(ConnectionState.PINGING_SERVER);return}break;case ConnectionState.PINGING_SERVER:if(nt==="SERVER_PING_SUCCEEDED"){this.setFsmState(ConnectionState.CONNECTING);return}break;case ConnectionState.DISCONNECTED_FOREVER:logWarning(LOG,`Discarding ${nt} while in ${ConnectionState.DISCONNECTED_FOREVER}`);return}throw new Error(`Unsupported state transition.
797
797
  State: ${this.state}
798
- Event: ${nt}`)}async pingServer(){this.uriIndex=await doInitPings(this.args.baseUriPartsList,PING_MINIMUM_RETRY_PERIOD_MS,PING_MAXIMUM_RETRY_PERIOD_MS,this.args.onRetry,this.args.onHostConfigResp),this.stepFsm("SERVER_PING_SUCCEEDED")}async getSessionTokens(){var et,rt;const nt=await this.args.claimHostAuthToken();return this.args.resetHostAuthToken(),[nt??"PLACEHOLDER_AUTH_TOKEN",...(et=this.args.sessionInfo.last)!=null&&et.sessionId?[(rt=this.args.sessionInfo.last)==null?void 0:rt.sessionId]:[]]}async connectToWebSocket(){const nt=buildWsUri(this.args.baseUriPartsList[this.uriIndex],WEBSOCKET_STREAM_PATH);if(notNullOrUndefined(this.websocket))throw new Error("Websocket already exists");const et=await this.getSessionTokens();this.websocket=new WebSocket(nt,["streamlit",...et]),this.websocket.binaryType="arraybuffer",this.setConnectionTimeout(nt);const rt=this.websocket,ot=()=>rt===this.websocket;this.websocket.addEventListener("message",at=>{ot()&&this.handleMessage(at.data).catch(st=>{const ut=`Failed to process a Websocket message (${st})`;logError(LOG,ut),this.stepFsm("FATAL_ERROR",ut)})}),this.websocket.addEventListener("open",()=>{ot()&&this.stepFsm("CONNECTION_SUCCEEDED")}),this.websocket.addEventListener("close",()=>{ot()&&(this.closeConnection(),this.stepFsm("CONNECTION_CLOSED"))}),this.websocket.addEventListener("error",()=>{ot()&&(logError(LOG,"WebSocket onerror"),this.closeConnection(),this.stepFsm("CONNECTION_ERROR"))})}setConnectionTimeout(nt){if(notNullOrUndefined(this.wsConnectionTimeoutId))throw new Error("WS timeout is already set");const et=this.websocket;this.wsConnectionTimeoutId=window.setTimeout(()=>{if(et===this.websocket&&!isNullOrUndefined$1(this.wsConnectionTimeoutId)){if(isNullOrUndefined$1(this.websocket)){this.closeConnection(),this.stepFsm("FATAL_ERROR","Null Websocket in setConnectionTimeout");return}this.websocket.readyState===0&&(this.closeConnection(),this.stepFsm("CONNECTION_TIMED_OUT"))}},WEBSOCKET_TIMEOUT_MS),logMessage(LOG,`Set WS timeout ${this.wsConnectionTimeoutId}`)}closeConnection(){this.websocket&&(this.websocket.close(),this.websocket=void 0),notNullOrUndefined(this.wsConnectionTimeoutId)&&(logMessage(LOG,`Clearing WS timeout ${this.wsConnectionTimeoutId}`),window.clearTimeout(this.wsConnectionTimeoutId),this.wsConnectionTimeoutId=void 0)}sendMessage(nt){if(!this.websocket)return;const et=BackMsg.create(nt),rt=BackMsg.encode(et).finish();this.websocket.send(rt)}incrementMessageCacheRunCount(nt){this.cache.incrementRunCount(nt)}async handleMessage(nt){const et=this.nextMessageIndex;this.nextMessageIndex+=1,PerformanceEvents.record({name:"BeginHandleMessage",messageIndex:et});const rt=new Uint8Array(nt),ot=ForwardMsg.decode(rt);for(PerformanceEvents.record({name:"DecodedMessage",messageIndex:et,messageType:ot.type,len:nt.byteLength}),this.messageQueue[et]=await this.cache.processMessagePayload(ot,rt),PerformanceEvents.record({name:"GotCachedPayload",messageIndex:et});this.lastDispatchedMessageIndex+1 in this.messageQueue;){const at=this.lastDispatchedMessageIndex+1;this.args.onMessage(this.messageQueue[at]),PerformanceEvents.record({name:"DispatchedMessage",messageIndex:at,messageType:this.messageQueue[at].type}),delete this.messageQueue[at],this.lastDispatchedMessageIndex=at}}}function doInitPings(tt,nt,et,rt,ot){const at=new Resolver;let st=0,ut=0,ct=()=>{};const pt=()=>{ut++,ut>=tt.length&&(ut=0),ct()},dt=ht=>{const Mt=Math.random()*.4-.2,mt=st===1?nt:nt*2**(st-1)*(1+Mt),Ot=Math.min(et,mt);rt(st,ht,Ot),window.setTimeout(pt,Ot)},ft=()=>{const ht=tt[ut];new URL(buildHttpUri(ht,"")).hostname==="localhost"?dt(jsx$1(StreamlitMarkdown$1,{source:"\nIs Streamlit still running? If you accidentally stopped Streamlit, just restart it in your terminal:\n\n```bash\nstreamlit run yourscript.py\n```\n ",allowHTML:!1})):dt("Connection failed with status 0.")},bt=()=>{dt(jsxs(reactExports.Fragment,{children:[jsx$1("p",{children:"Cannot connect to Streamlit (HTTP status: 403)."}),jsxs("p",{children:["If you are trying to access a Streamlit app running on another server, this could be due to the app's"," ",jsx$1("a",{href:CORS_ERROR_MESSAGE_DOCUMENTATION_LINK,children:"CORS"})," settings."]})]}))};return ct=()=>{const ht=tt[ut],Mt=buildHttpUri(ht,SERVER_PING_PATH),mt=buildHttpUri(ht,HOST_CONFIG_PATH);ut===0&&st++,Promise.all([axios.get(Mt,{timeout:PING_TIMEOUT_MS}),axios.get(mt,{timeout:PING_TIMEOUT_MS})]).then(([Ot,zt])=>{ot(zt.data),at.resolve(ut)}).catch(Ot=>{if(Ot.code==="ECONNABORTED")return dt("Connection timed out.");if(Ot.response){const{data:zt,status:yt}=Ot.response;return yt===0?ft():yt===403?bt():dt(`Connection failed with status ${yt}, and response "${zt}".`)}return Ot.request?ft():dt(Ot.message)})},ct(),at.promise}const RETRY_COUNT_FOR_WARNING=6;class ConnectionManager{constructor(nt){this.connectionState=ConnectionState.INITIAL,this.setConnectionState=(et,rt)=>{this.connectionState!==et&&(this.connectionState=et,this.props.connectionStateChanged(et)),rt&&this.props.onConnectionError(rt)},this.showRetryError=(et,rt,ot)=>{et===RETRY_COUNT_FOR_WARNING&&this.props.onConnectionError(rt)},this.props=nt,this.connect()}isConnected(){return this.connectionState===ConnectionState.CONNECTED}getBaseUriParts(){if(this.connection instanceof WebsocketConnection)return this.connection.getBaseUriParts()}sendMessage(nt){this.connection instanceof WebsocketConnection&&this.isConnected()?this.connection.sendMessage(nt):logError(`Cannot send message when server is disconnected: ${nt}`)}incrementMessageCacheRunCount(nt){this.connection instanceof WebsocketConnection&&this.connection.incrementMessageCacheRunCount(nt)}async connect(){try{this.connection=await this.connectToRunningServer()}catch(nt){const et=ensureError(nt);logError(et.message),this.setConnectionState(ConnectionState.DISCONNECTED_FOREVER,et.message)}}disconnect(){var nt;(nt=this.connection)==null||nt.disconnect()}connectToRunningServer(){const nt=getPossibleBaseUris();return new WebsocketConnection({sessionInfo:this.props.sessionInfo,endpoints:this.props.endpoints,baseUriPartsList:nt,onMessage:this.props.onMessage,onConnectionStateChange:this.setConnectionState,onRetry:this.showRetryError,claimHostAuthToken:this.props.claimHostAuthToken,resetHostAuthToken:this.props.resetHostAuthToken,onHostConfigResp:this.props.onHostConfigResp})}}class SessionEventDispatcher{constructor(){this.onSessionEvent=new dist.Signal}handleSessionEventMsg(nt){this.onSessionEvent.emit(nt)}}const MEDIA_ENDPOINT="/media",UPLOAD_FILE_ENDPOINT="/_stcore/upload_file",COMPONENT_ENDPOINT_BASE="/component",FORWARD_MSG_CACHE_ENDPOINT="/_stcore/message";class DefaultStreamlitEndpoints{constructor(nt){this.getServerUri=nt.getServerUri,this.csrfEnabled=nt.csrfEnabled}buildComponentURL(nt,et){return buildHttpUri(this.requireServerUri(),`${COMPONENT_ENDPOINT_BASE}/${nt}/${et}`)}setFileUploadClientConfig({prefix:nt,headers:et}){this.fileUploadClientConfig={prefix:nt,headers:et}}buildMediaURL(nt){return nt.startsWith(MEDIA_ENDPOINT)?buildHttpUri(this.requireServerUri(),nt):nt}buildFileUploadURL(nt){return this.fileUploadClientConfig?makePath(this.fileUploadClientConfig.prefix,nt):nt.startsWith(UPLOAD_FILE_ENDPOINT)?buildHttpUri(this.requireServerUri(),nt):nt}buildAppPageURL(nt,et){const rt=et.urlPathname,ot=et.isDefault?"":rt;if(notNullOrUndefined(nt)&&nt.length>0)return`${nt}/${ot}`;const{port:at,protocol:st}=window.location,{basePath:ut,host:ct}=this.requireServerUri(),pt=at?`:${at}`:"",dt=ut?`${ut}/`:"";return`${st}//${ct}${pt}/${dt}${ot}`}async uploadFileUploaderFile(nt,et,rt,ot,at){const st=new FormData;st.append(et.name,et);const ut=this.getAdditionalHeaders();return this.csrfRequest(this.buildFileUploadURL(nt),{cancelToken:at,method:"PUT",data:st,responseType:"text",headers:ut,onUploadProgress:ot}).then(()=>{})}getAdditionalHeaders(){let nt={};return this.fileUploadClientConfig&&(nt={...nt,...this.fileUploadClientConfig.headers}),nt}async deleteFileAtURL(nt,et){const rt=this.getAdditionalHeaders();return this.csrfRequest(this.buildFileUploadURL(nt),{method:"DELETE",data:{sessionId:et},headers:rt}).then(()=>{})}async fetchCachedForwardMsg(nt){const et=this.requireServerUri(),rt=await axios.request({url:buildHttpUri(et,`${FORWARD_MSG_CACHE_ENDPOINT}?hash=${nt}`),method:"GET",responseType:"arraybuffer"});return new Uint8Array(rt.data)}requireServerUri(){const nt=this.getServerUri();if(notNullOrUndefined(nt))return this.cachedServerUri=nt,nt;if(notNullOrUndefined(this.cachedServerUri))return this.cachedServerUri;throw new Error("not connected to a server!")}csrfRequest(nt,et){if(et.url=nt,this.csrfEnabled){const rt=getCookie("_streamlit_xsrf");notNullOrUndefined(rt)&&(et.headers={"X-Xsrftoken":rt,...et.headers||{}},et.withCredentials=!0)}return axios.request(et)}}var assignValue=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject=isObject_1,toKey=_toKey;function baseSet$1(tt,nt,et,rt){if(!isObject(tt))return tt;nt=castPath$1(nt,tt);for(var ot=-1,at=nt.length,st=at-1,ut=tt;ut!=null&&++ot<at;){var ct=toKey(nt[ot]),pt=et;if(ct==="__proto__"||ct==="constructor"||ct==="prototype")return tt;if(ot!=st){var dt=ut[ct];pt=rt?rt(dt,ct,ut):void 0,pt===void 0&&(pt=isObject(dt)?dt:isIndex(nt[ot+1])?[]:{})}assignValue(ut,ct,pt),ut=ut[ct]}return tt}var _baseSet=baseSet$1,baseGet=_baseGet,baseSet=_baseSet,castPath=_castPath;function basePickBy$1(tt,nt,et){for(var rt=-1,ot=nt.length,at={};++rt<ot;){var st=nt[rt],ut=baseGet(tt,st);et(ut,st)&&baseSet(at,castPath(st,tt),ut)}return at}var _basePickBy=basePickBy$1,basePickBy=_basePickBy,hasIn=hasIn_1;function basePick$1(tt,nt){return basePickBy(tt,nt,function(et,rt){return hasIn(tt,rt)})}var _basePick=basePick$1,basePick=_basePick,flatRest=_flatRest,pick=flatRest(function(tt,nt){return tt==null?{}:basePick(tt,nt)}),pick_1=pick;const pick$1=getDefaultExportFromCjs$1(pick_1),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json";class MetricsManager{constructor(nt){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId="",this.pendingEvents=[],this.appHash="Not initialized",this.metadata={},this.setAppHash=et=>{this.appHash=et},this.setMetricsConfig=(et="")=>{this.metricsUrl=et},this.sessionInfo=nt}async initialize({gatherUsageStats:nt,sendMessageToHost:et}){this.sendMessageToHost=et,this.actuallySendMetrics=nt&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(logError("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),logAlways("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue(nt,et={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([nt,et]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send(nt,et))}setMetadata(nt){this.metadata=nt}async requestDefaultMetricsConfig(){const nt=localStorageAvailable();if(nt){const et=window.localStorage.getItem("stMetricsConfig");if(et){this.metricsUrl=et;return}}try{const et=await fetch(DEFAULT_METRICS_CONFIG,{signal:AbortSignal.timeout(5e3)});if(!et.ok)this.metricsUrl=void 0,logError("Failed to fetch metrics config: ",et.status);else{const rt=await et.json();this.metricsUrl=rt.url??void 0,nt&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(et){logError("Failed to fetch metrics config:",et)}}send(nt,et={}){const rt=this.buildEventProto(nt,et);this.metricsUrl==="postMessage"?this.postMessageEvent(nt,rt):this.track(rt)}sendPendingEvents(){this.pendingEvents.forEach(([nt,et])=>{this.send(nt,et)}),this.pendingEvents=[]}async track(nt){const et=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(nt.toJSON())});await fetch(et)}postMessageEvent(nt,et){this.sendMessageToHost({type:"METRICS_EVENT",eventName:nt,data:et})}buildEventProto(nt,et){const rt=new MetricsEvent({event:nt,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(nt==="menuClick")rt.label=et.label;else if(nt==="pageProfile")return new MetricsEvent({...rt,...et});return rt}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3}}getHostTrackingData(){return this.metadata?pick$1(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 nt="ajs_anonymous_id",et=localStorageAvailable(),rt=getCookie(nt),ot=et?window.localStorage.getItem(nt):null,at=new Date;at.setFullYear(new Date().getFullYear()+1),rt?(this.anonymousId=rt,et&&window.localStorage.setItem(nt,rt)):ot?(this.anonymousId=JSON.parse(ot),setCookie(nt,this.anonymousId,at)):(this.anonymousId=v4(),setCookie(nt,this.anonymousId,at),et&&window.localStorage.setItem(nt,this.anonymousId))}}const StyledApp=newStyled("div",{target:"e10tffaf0"})(({theme:tt})=>{const nt=hasLightBackgroundColor(tt);return{position:"absolute",background:tt.colors.bgColor,color:tt.colors.bodyText,top:tt.spacing.none,left:tt.spacing.none,right:tt.spacing.none,bottom:tt.spacing.none,colorScheme:nt?"light":"dark",overflow:"hidden","@media print":{float:"none",height:tt.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"e1nhbas40"})({margin:0}),StyledInstruction=newStyled("p",{target:"e1nhbas41"})({margin:0});class ScreencastDialog extends reactExports.PureComponent{constructor(){super(...arguments),this.state={recordAudio:this.props.recordAudio},this.handleRecordAudioCheckbox=nt=>{const{checked:et}=nt.target,{recordAudio:rt}=this.state,{toggleRecordAudio:ot}=this.props;et!==rt&&this.setState({recordAudio:et},ot)},this.handleStartButton=()=>{const{startRecording:nt,onClose:et}=this.props;nt(),et()}}render(){const{recordAudio:nt}=this.state,{onClose:et}=this.props;return jsxs(Modal,{isOpen:!0,onClose:et,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:nt,onChange:this.handleRecordAudioCheckbox})," ","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:this.handleStartButton,children:"Start recording!"})})]})}}const StyledVideo=newStyled("video",{target:"ec1y6ev0"})(({theme:tt})=>({width:tt.sizes.full,borderRadius:tt.radii.md})),StyledDialogContainer=newStyled("div",{target:"ec1y6ev1"})(({theme:tt})=>({display:"flex",flexDirection:"column",width:tt.sizes.full})),StyledRow=newStyled("div",{target:"ec1y6ev2"})(({theme:tt})=>({display:"flex",flexDirection:"row",paddingTop:tt.spacing.md,paddingBottom:tt.spacing.md})),StyledFirstColumn=newStyled("div",{target:"ec1y6ev3"})(({theme:tt})=>({paddingRight:tt.spacing.lg,textAlign:"right",color:tt.colors.gray,fontWeight:tt.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"ec1y6ev4"})(({theme:tt})=>({flex:1,paddingRight:tt.spacing.lg,marginRight:"6em",[`@media (max-width: ${tt.breakpoints.sm})`]:{marginRight:tt.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"ec1y6ev5"})(({theme:tt})=>({marginTop:tt.spacing.sm,marginBottom:tt.spacing.none,fontSize:tt.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"ec1y6ev6"})(({theme:tt})=>({marginTop:tt.spacing.twoXS})),VideoRecordedDialog=({onClose:tt,videoBlob:nt,fileName:et})=>{const rt=URL.createObjectURL(nt),ot=()=>{const at=document.createElement("a");at.setAttribute("href",rt),at.setAttribute("download",`${et}.webm`),at.click(),tt()};return jsxs(Modal,{isOpen:!0,onClose:tt,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:rt,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:ot,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:"e1xu6skw0"})({display:"flex"}),StyledUnsupportedScreenCastIcon=newStyled("div",{target:"e1xu6skw1"})(({theme:tt})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:tt.spacing.twoXL,marginLeft:tt.spacing.sm,fontSize:tt.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1xu6skw2"})(({theme:tt})=>({margin:tt.spacing.none})),UnsupportedBrowserDialog=({onClose:tt})=>jsxs(Modal,{isOpen:!0,onClose:tt,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:"e1442ngl0"})(({theme:tt})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:tt.sizes.full,height:tt.sizes.full,fontSize:"40vh",color:tt.colors.red,fontWeight:tt.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${tt.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:tt,endCallback:nt})=>{const[et,rt]=reactExports.useState(tt);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const at=et-1;at>=0&&rt(at),at===0&&nt()},children:jsx$1("span",{children:et})},`frame${et}`)};function withScreencast(tt){const et=class et extends reactExports.PureComponent{constructor(){super(...arguments),this.state={fileName:"streamlit-screencast",recordAudio:!1,currentState:this.props.testOverride||"OFF"},this.toggleRecordAudio=()=>{const{recordAudio:ot}=this.state;this.setState({recordAudio:!ot})},this.showDialog=ot=>{const{currentState:at}=this.state;ScreenCastRecorder.isSupportedBrowser()?at==="OFF"?this.setState({fileName:ot,currentState:"SETUP"}):this.stopRecording().catch(st=>logWarning(`withScreencast.stopRecording threw an error: ${st}`)):this.setState({currentState:"UNSUPPORTED"})},this.startRecording=async()=>{const{recordAudio:ot}=this.state;this.recorder=new ScreenCastRecorder({recordAudio:ot,onErrorOrStop:()=>this.stopRecording()});try{await this.recorder.initialize()}catch{this.setState({currentState:"UNSUPPORTED"});return}this.setState({currentState:"COUNTDOWN"})},this.stopRecording=async()=>{let ot;const{currentState:at}=this.state;at==="OFF"||isNullOrUndefined$1(this.recorder)||(at==="COUNTDOWN"&&this.setState({currentState:"OFF"}),at==="RECORDING"&&(this.recorder.getState()==="inactive"?this.setState({currentState:"OFF"}):(ot=await this.recorder.stop(),this.setState({outputBlob:ot,currentState:"PREVIEW_FILE"}))))},this.onCountdownEnd=async()=>{if(isNullOrUndefined$1(this.recorder))throw new Error("Countdown finished but recorder is null");this.recorder.start()?this.setState({currentState:"RECORDING"}):this.stopRecording().catch(at=>logWarning(`withScreencast.stopRecording threw an error: ${at}`))},this.getScreenCastProps=()=>({currentState:this.state.currentState,toggleRecordAudio:this.toggleRecordAudio,startRecording:this.showDialog,stopRecording:this.stopRecording}),this.closeDialog=()=>{this.setState({currentState:"OFF"})},this.render=()=>{const{outputBlob:ot,fileName:at,recordAudio:st,currentState:ut}=this.state;return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(tt,{...this.props,screenCast:this.getScreenCastProps()}),ut==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:this.closeDialog}),ut==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:st,onClose:this.closeDialog,startRecording:this.startRecording,toggleRecordAudio:this.toggleRecordAudio}),ut==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:this.onCountdownEnd}),ut==="PREVIEW_FILE"&&ot&&jsx$1(VideoRecordedDialog,{onClose:this.closeDialog,videoBlob:ot,fileName:at})]})}}};et.displayName=`withScreencast(${tt.displayName||tt.name})`;let nt=et;return hoistNonReactStatics$2(nt,tt)}const showDevelopmentOptions=(tt,nt)=>nt==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==nt||Config.ToolbarMode.MINIMAL==nt?!1:tt||isLocalhost();function getTitle(tt){return tt||"Streamlit"}class StrategyV1{constructor(nt){this.appNav=nt,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession(nt){var st,ut;this.appPages=nt.appPages,this.currentPageScriptHash=nt.pageScriptHash,this.hideSidebarNav=((st=nt.config)==null?void 0:st.hideSidebarNav)??!1;const et=this.appPages[0],rt=et.urlPathname??"",ot=((ut=this.appPages.find(ct=>ct.pageScriptHash===this.currentPageScriptHash))==null?void 0:ut.urlPathname)??"",at=et.pageScriptHash===this.currentPageScriptHash;return this.appNav.onUpdatePageUrl(rt,ot,at),document.title=getTitle(ot??""),[{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:at?"":ot,currentPageScriptHash:this.currentPageScriptHash})}]}handlePagesChanged(nt){const{appPages:et}=nt;return[{appPages:et},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:et})}]}handlePageNotFound(nt){var ot;const{pageName:et}=nt;this.appNav.onPageNotFound(et);const rt=((ot=this.appPages[0])==null?void 0:ot.pageScriptHash)??"";return this.currentPageScriptHash=rt,[{currentPageScriptHash:rt},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:rt})}]}handleNavigation(nt){}findPageByUrlPath(nt){return this.appPages.length===0?null:this.appPages.find(et=>nt.endsWith("/"+et.urlPathname))??this.appPages[0]}clearPageElements(nt,et,rt){return AppRoot.empty(et,!1,rt,nt.logo)}}class StrategyV2{constructor(nt){this.appNav=nt,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession(nt){var et;return this.mainScriptHash=nt.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((et=nt.config)==null?void 0:et.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged(nt){}handlePageNotFound(nt){const{pageName:et}=nt;return this.appNav.onPageNotFound(et),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation(nt){const{sections:et,position:rt,appPages:ot}=nt;this.appPages=ot,this.hideSidebarNav=rt===Navigation.Position.HIDDEN;const at=nt.pageScriptHash,st=ot.find(pt=>pt.pageScriptHash===at),ut=ot.find(pt=>pt.isDefault);this.mainPage=ut;const ct=st.urlPathname;if(!this.appNav.isPageTitleSet){const pt=getTitle(st.pageName);document.title=pt,this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:st.pageName??""})}return!this.appNav.isPageIconSet&&st.icon&&this.appNav.onPageIconChange(st.icon),this.appNav.onUpdatePageUrl(ut.urlPathname??"",ct,st.isDefault??!1),[{appPages:ot,navSections:et,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:nt.expanded,currentPageScriptHash:at},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:ot}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:st.isDefault?"":ct,currentPageScriptHash:at})}]}findPageByUrlPath(nt){return this.appPages.find(et=>nt.endsWith("/"+et.urlPathname))??this.mainPage}clearPageElements(nt,et,rt){return nt.filterMainScriptElements(et)}}class AppNavigation{constructor(nt,et,rt,ot){this.hostCommunicationMgr=nt,this.onUpdatePageUrl=et,this.onPageNotFound=rt,this.onPageIconChange=ot,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession(nt){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession(nt)}handleNavigation(nt){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation(nt)}handlePagesChanged(nt){return this.strategy.handlePagesChanged(nt)}handlePageNotFound(nt){return this.strategy.handlePageNotFound(nt)}findPageByUrlPath(nt){return this.strategy.findPageByUrlPath(nt)}handlePageConfigChanged(nt){this.isPageIconSet=!!nt.favicon,this.isPageTitleSet=!!nt.title}clearPageElements(nt,et,rt){return this.strategy.clearPageElements(nt,et,rt)}}const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>";class App extends reactExports.PureComponent{constructor(nt){super(nt),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(rt,ot,at)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:rt,msg:ot,onContinue:at,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(rt,ot)=>{const[,at,st]=createPresetThemes(),ut=isPresetTheme(this.props.theme.activeTheme);rt===at.name&&ut?this.props.theme.setTheme(at):rt===st.name&&ut?this.props.theme.setTheme(st):ot&&this.props.theme.setImportedTheme(ot)},this.handleConnectionStateChanged=rt=>{if(logMessage(`Connection state changed from ${this.state.connectionState} to ${rt}`),rt===ConnectionState.CONNECTED){const ot=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||this.state.scriptRunState===ScriptRunState.RUNNING;(!this.sessionInfo.last||ot)&&(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:rt!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:rt})},this.handleGitInfoChanged=rt=>{this.setState({gitInfo:rt})},this.handleCustomParentMessage=rt=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:rt.message}):logError("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=rt=>{const ot=(at,st,ut)=>{const ct=at[st];if(ct in ut)return ut[ct](at[ct]);throw new Error(`Cannot handle ${st} "${ct}".`)};try{ot(rt,"type",{newSession:at=>this.handleNewSession(at),sessionStatusChanged:at=>this.handleSessionStatusChanged(at),sessionEvent:at=>this.handleSessionEvent(at),delta:at=>this.handleDeltaMsg(at,rt.metadata),pageConfigChanged:at=>this.handlePageConfigChanged(at),pageInfoChanged:at=>this.handlePageInfoChanged(at),pagesChanged:at=>this.handlePagesChanged(at),pageNotFound:at=>this.handlePageNotFound(at),gitInfoChanged:at=>this.handleGitInfoChanged(at),scriptFinished:at=>this.handleScriptFinished(at),pageProfile:at=>this.handlePageProfileMsg(at),autoRerun:at=>this.handleAutoRerun(at),fileUrlsResponse:at=>this.uploadClient.onFileURLsResponse(at),parentMessage:at=>this.handleCustomParentMessage(at),logo:at=>this.handleLogo(at,rt.metadata),navigation:at=>this.handleNavigation(at)})}catch(at){const st=ensureError(at);logError(st),this.showError("Bad message format",st.message)}},this.handleLogo=(rt,ot)=>{const at={activeScriptHash:ot.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(rt,at)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=rt=>{const{title:ot,favicon:at,layout:st,initialSidebarState:ut,menuItems:ct}=rt;this.appNavigation.handlePageConfigChanged(rt),ot&&(this.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:ot}),document.title=ot),at&&this.onPageIconChanged(at),st!==this.state.layout&&this.setState(pt=>({layout:st,userSettings:{...pt.userSettings,wideMode:st===PageConfig.Layout.WIDE}})),ut!==this.state.initialSidebarState&&this.setState(()=>({initialSidebarState:ut})),this.setState({menuItems:ct})},this.handlePageInfoChanged=rt=>{const{queryString:ot}=rt,at=document.location.pathname+(ot?`?${ot}`:"");window.history.pushState({},"",at),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:ot?`?${ot}`:""})},this.onPageNotFound=rt=>{const ot=rt?`You have requested page /${rt}, 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",`${ot}. Running the app's main page.`)},this.handlePageNotFound=rt=>{this.maybeSetState(this.appNavigation.handlePageNotFound(rt))},this.onPageIconChanged=rt=>{handleFavicon(rt,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=rt=>{this.maybeSetState(this.appNavigation.handlePagesChanged(rt))},this.handleNavigation=rt=>{this.maybeSetState(this.appNavigation.handleNavigation(rt))},this.handlePageProfileMsg=rt=>{var st,ut,ct;const ot=PageProfile.toObject(rt),at=getBrowserInfo();this.metricsMgr.enqueue("pageProfile",{...ot,isFragmentRun:!!ot.isFragmentRun,appId:this.sessionInfo.current.appId,numPages:(st=this.state.appPages)==null?void 0:st.length,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,pageScriptHash:this.state.currentPageScriptHash,activeTheme:(ct=(ut=this.props.theme)==null?void 0:ut.activeTheme)==null?void 0:ct.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:at})},this.handleAutoRerun=rt=>{const ot=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(rt.fragmentId,!0)},rt.interval*1e3);this.setState(at=>({autoReruns:[...at.autoReruns,ot]}))},this.handleSessionStatusChanged=rt=>{this.setState(ot=>{let{scriptRunState:at}=ot,{dialog:st}=ot;return rt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.STOP_REQUESTED?(at=ScriptRunState.RUNNING,notNullOrUndefined(st)&&st.type===DialogType.SCRIPT_COMPILE_ERROR&&(st=void 0)):!rt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&ot.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(at=ScriptRunState.NOT_RUNNING),{userSettings:{...ot.userSettings,runOnSave:!!rt.runOnSave},dialog:st,scriptRunState:at}})},this.handleSessionEvent=rt=>{if(this.sessionEventDispatcher.handleSessionEventMsg(rt),rt.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const ot={type:DialogType.SCRIPT_COMPILE_ERROR,exception:rt.scriptCompilationException,onClose:()=>{}};this.openDialog(ot)}},this.maybeUpdatePageUrl=(rt,ot,at)=>{const st=this.getBaseUriParts();if(st){const{basePath:ut}=st,ct=extractPageNameFromPathName(document.location.pathname,ut);if((ct===""?rt:ct)!==ot){const dt=at?"":ot,ft=preserveEmbedQueryParams(),bt=ft?`?${ft}`:"",Mt=`${ut?`/${ut}`:""}/${dt}${bt}`;window.history.pushState({},"",Mt)}}},this.handleNewSession=rt=>{const ot=rt.initialize;if(this.hasStreamlitVersionChanged(ot)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(rt);const{appHash:at,currentPageScriptHash:st}=this.state,{scriptRunId:ut,name:ct,mainScriptPath:pt,fragmentIdsThisRun:dt,pageScriptHash:ft,mainScriptHash:bt}=rt;if(dt.length)this.setState({fragmentIdsThisRun:dt,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const Mt=rt.config,mt=rt.customTheme;this.processThemeInput(mt),this.setState({allowRunOnSave:Mt.allowRunOnSave,hideTopBar:Mt.hideTopBar,toolbarMode:Mt.toolbarMode,latestRunTime:performance.now(),mainScriptHash:bt,fragmentIdsThisRun:dt}),this.maybeSetState(this.appNavigation.handleNewSession(rt)),this.onPageIconChanged("./favicon.png")}const ht=hashString(this.sessionInfo.current.installationId+pt);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(ht),this.metricsMgr.enqueue("updateReport"),at===ht&&st===ft?this.setState({scriptRunId:ut}):this.clearAppState(ht,ut,ct,bt)},this.handleOneTimeInitialization=rt=>{const ot=rt.initialize,at=rt.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(rt)),this.metricsMgr.initialize({gatherUsageStats:at.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(ot.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:rt}=this.state,ot=this.appNavigation.findPageByUrlPath(document.location.pathname),at=document.location.toString().includes("#"),st=(ot==null?void 0:ot.pageScriptHash)===rt;isNullOrUndefined$1(ot)||at&&st||this.onPageChange(ot.pageScriptHash)},this.setAndSendTheme=rt=>{this.props.theme.setTheme(rt),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(rt.emotion)})},this.createThemeHash=rt=>{if(!rt)return"hash_for_undefined_custom_theme";const ot=Object.entries(rt);return ot.sort(),hashString(ot.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=rt=>{const{runOnSave:ot}=this.state.userSettings,{runOnSave:at}=rt;if(this.setState({userSettings:rt}),ot!==at&&this.isServerConnected()){const st=new BackMsg({setRunOnSave:at});st.type="setRunOnSave",this.sendBackMsg(st)}},this.handleDeltaMsg=(rt,ot)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,rt,ot),!this.pendingElementsTimerRunning){this.pendingElementsTimerRunning=!0;const at=this.state.scriptRunState===ScriptRunState.RUNNING;setTimeout(()=>{this.pendingElementsTimerRunning=!1,at&&this.setState({elements:this.pendingElementsBuffer})},ELEMENT_LIST_BUFFER_TIMEOUT_MS)}},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){const rt=new BackMsg({debugShutdownRuntime:!0});rt.type="debugShutdownRuntime",this.sendBackMsg(rt)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const rt=new BackMsg({debugDisconnectWebsocket:!0});rt.type="debugDisconnectWebsocket",this.sendBackMsg(rt)}},this.debugClearForwardMsgCache=()=>{var rt,ot;isLocalhost()&&((ot=(rt=this.connectionManager)==null?void 0:rt.connection)==null||ot.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(rt=>{clearInterval(rt)}),this.setState({autoReruns:[]})},this.rerunScript=(rt=!1)=>{if(this.closeDialog(),!this.isServerConnected()){logError("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}),rt===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){logError("Cannot load git information when disconnected from server.");return}this.sendBackMsg(new BackMsg({loadGitInfo:!0}))},this.onPageChange=rt=>{const{elements:ot,mainScriptHash:at}=this.state;this.cleanupAutoReruns();const st=this.appNavigation.clearPageElements(ot,at,void 0),ut=new Set(Array.from(st.getElements()).map(ct=>getElementId(ct)).filter(notUndefined));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(ut),void 0,rt)},this.isAppInReadyState=rt=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&rt.scriptRunState===ScriptRunState.RUNNING&&rt.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(rt,ot,at,st)=>{const ut=this.getBaseUriParts();if(!ut){logError("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ct}=this.state,{basePath:pt}=ut;let dt=this.getQueryString(),ft="";at?at!=ct&&(dt=preserveEmbedQueryParams(),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:dt})):ct?at=ct:(ft=extractPageNameFromPathName(document.location.pathname,pt),at=""),this.sendBackMsg(new BackMsg({rerunScript:{queryString:dt,widgetStates:rt,pageScriptHash:at,pageName:ft,fragmentId:ot,isAutoRerun:st}})),PerformanceEvents.record({name:"RequestedRerun",scriptRunState:this.state.scriptRunState})},this.stopScript=()=>{if(!this.isServerConnected()){logError("Cannot stop app when disconnected from server.");return}if(this.state.scriptRunState===ScriptRunState.NOT_RUNNING||this.state.scriptRunState===ScriptRunState.STOP_REQUESTED)return;const rt=new BackMsg({stopScript:!0});rt.type="stopScript",this.sendBackMsg(rt),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const rt={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(rt)}else logError("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var ot;const rt={type:DialogType.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:((ot=this.state.dialog)==null?void 0:ot.type)===DialogType.DEPLOY_ERROR,metricsMgr:this.metricsMgr};this.openDialog(rt)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const rt={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(rt)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const rt=new BackMsg({clearCache:!0});rt.type="clearCache",this.sendBackMsg(rt)}else logError("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const rt=new BackMsg({appHeartbeat:!0});rt.type="appHeartbeat",this.sendBackMsg(rt)}else logError("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=rt=>{this.connectionManager?this.connectionManager.sendMessage(rt):logError(`Not connected. Cannot send back message: ${rt}`)},this.handleConnectionError=rt=>{this.showError("Connection error",rt)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(rt=!0)=>{const ot={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:rt,metricsMgr:this.metricsMgr};this.openDialog(ot)},this.aboutCallback=()=>{const{menuItems:rt}=this.state,ot={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:rt==null?void 0:rt.aboutSectionMd};this.openDialog(ot)},this.printCallback=()=>{const{scriptRunState:rt}=this.state;if(rt!==ScriptRunState.NOT_RUNNING){setTimeout(this.printCallback,500);return}let ot;try{const at=getIFrameEnclosingApp(this.embeddingId);at&&at.contentWindow?ot=at.contentWindow.window:ot=window}catch{ot=window}finally{ot||(ot=window),ot.print()}},this.screencastCallback=()=>{const{scriptName:rt}=this.state,{startRecording:ot}=this.props.screenCast,at=hooks().format("YYYY-MM-DD-HH-MM-SS");ot(`streamlit-${rt}-${at}`)},this.handleFullScreen=rt=>{this.setState({isFullScreen:rt})},this.setLibConfig=rt=>{this.setState({libConfig:rt})},this.setAppConfig=rt=>{this.setState({appConfig:rt})},this.addScriptFinishedHandler=rt=>{this.setState((ot,at)=>({scriptFinishedHandlers:ot.scriptFinishedHandlers.concat(rt)}))},this.removeScriptFinishedHandler=rt=>{this.setState((ot,at)=>({scriptFinishedHandlers:without$1(ot.scriptFinishedHandlers,rt)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:rt}=this.state,ot=rt&&rt.length>0?rt:document.location.search;return ot.startsWith("?")?ot.substring(1):ot},this.isInCloudEnvironment=()=>{const{hostMenuItems:rt}=this.state;return rt&&(rt==null?void 0:rt.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=(rt,ot)=>{if(this.isServerConnected()){const at=new BackMsg({fileUrlsRequest:{requestId:rt,fileNames:ot.map(st=>st.name),sessionId:this.sessionInfo.current.sessionId}});at.type="fileUrlsRequest",this.sendBackMsg(at)}},this.handleKeyDown=rt=>{switch(rt){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=rt=>{rt==="esc"&&this.props.screenCast.stopRecording()},J$1();let et=this.createThemeHash();isPresetTheme(nt.theme.activeTheme)||(et=this.createThemeHash(toThemeInput(nt.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:et,gitInfo:null,formsData:createFormsData(),appPages:[],navSections:[],currentPageScriptHash:"",mainScriptHash:"",hideTopBar:!0,hideSidebarNav:!0,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:rt=>this.setState({formsData:rt})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:nt.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:rt=>{this.setState({inputsDisabled:rt})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:rt=>this.setState({isOwner:rt}),fileUploadClientConfigChanged:rt=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(rt)},hostMenuItemsChanged:rt=>{this.setState({hostMenuItems:rt})},hostToolbarItemsChanged:rt=>{this.setState({hostToolbarItems:rt})},hostHideSidebarNavChanged:rt=>{this.setState({hostHideSidebarNav:rt})},sidebarChevronDownshiftChanged:rt=>{this.setState({sidebarChevronDownshift:rt})},pageLinkBaseUrlChanged:rt=>{this.setState({pageLinkBaseUrl:rt})},queryParamsChanged:rt=>{this.setState({queryParams:rt})},deployedAppMetadataChanged:rt=>{this.setState({deployedAppMetadata:rt})},restartWebsocketConnection:()=>{this.connectionManager||this.initializeConnectionManager()},terminateWebsocketConnection:()=>{var rt;(rt=this.connectionManager)==null||rt.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:rt=>this.widgetMgr.setFormsWithUploadsInProgress(rt),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({sessionInfo:this.sessionInfo,endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:nt=>{const{allowedOrigins:et,useExternalAuthToken:rt,disableFullscreenMode:ot,enableCustomParentMessages:at,mapboxToken:st,enforceDownloadInNewTab:ut,metricsUrl:ct}=nt,pt={allowedOrigins:et,useExternalAuthToken:rt,enableCustomParentMessages:at},dt={mapboxToken:st,disableFullscreenMode:ot,enforceDownloadInNewTab:ut};this.metricsMgr.setMetricsConfig(ct),this.hostCommunicationMgr.setAllowedOrigins(pt),this.setAppConfig(pt),this.setLibConfig(dt)}})}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 nt=document.querySelectorAll("[data-iframe-height]"),et=Array.from(nt).map(rt=>Math.ceil(rt.getBoundingClientRect().bottom));return Math.max(0,...et)}},__vitePreload(()=>import("./iframeResizer.contentWindow.Dqu1tYra.js").then(nt=>nt.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(nt,et){window.prerenderReady===!1&&this.isAppInReadyState(et)&&(window.prerenderReady=!0),this.state.scriptRunState!==et.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 nt;(nt=this.connectionManager)==null||nt.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError(nt,et){logError(et);const rt={type:DialogType.WARNING,title:nt,msg:et,onClose:()=>{}};this.openDialog(rt)}hasStreamlitVersionChanged(nt){if(this.sessionInfo.isSet){const et=this.sessionInfo.current.streamlitVersion,{environmentInfo:rt}=nt;if(notNullOrUndefined(rt)&&notNullOrUndefined(rt.streamlitVersion))return et!=rt.streamlitVersion}return!1}maybeSetState(nt){if(nt){const[et,rt]=nt;this.setState(et,rt)}}processThemeInput(nt){const et=this.createThemeHash(nt);if(et===this.state.themeHash)return;this.setState({themeHash:et});const rt=!isPresetTheme(this.props.theme.activeTheme);if(nt){const ot=createTheme(CUSTOM_THEME_NAME,nt);this.props.theme.addThemes([ot]),(getCachedTheme()===null||rt)&&this.setAndSendTheme(ot)}else this.props.theme.addThemes([]),rt&&this.setAndSendTheme(getHostSpecifiedTheme())}handleScriptFinished(nt){if(nt===ForwardMsg.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(et=>et())},0),nt===ForwardMsg.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:rt,fragmentIdsThisRun:ot})=>({elements:this.pendingElementsBuffer.clearStaleNodes(rt,ot)}),()=>{this.pendingElementsBuffer=this.state.elements});const et=new Set(Array.from(this.state.elements.getElements()).map(rt=>getElementId(rt)).filter(notUndefined));this.widgetMgr.removeInactive(et)}this.connectionManager!==null&&nt!==ForwardMsg.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState(nt,et,rt,ot){const{hideSidebarNav:at,elements:st}=this.state,ut=at&&st.sidebar||void 0;this.setState({scriptRunId:et,scriptName:rt,appHash:nt,elements:this.appNavigation.clearPageElements(this.pendingElementsBuffer,ot,ut)},()=>{this.pendingElementsBuffer=this.state.elements;const ct=new Set(Array.from(this.state.elements.getElements()).map(pt=>getElementId(pt)).filter(notUndefined));this.widgetMgr.removeInactive(ct)})}openDialog(nt){this.setState({dialog:nt})}render(){const{allowRunOnSave:nt,connectionState:et,dialog:rt,elements:ot,initialSidebarState:at,menuItems:st,isFullScreen:ut,scriptRunId:ct,scriptRunState:pt,userSettings:dt,hideTopBar:ft,hideSidebarNav:bt,expandSidebarNav:ht,currentPageScriptHash:Mt,hostHideSidebarNav:mt,pageLinkBaseUrl:Ot,sidebarChevronDownshift:zt,hostMenuItems:yt,hostToolbarItems:vt,libConfig:At,appConfig:St,inputsDisabled:Et,appPages:Tt,navSections:Rt}=this.state,Ct=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),wt=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":dt.wideMode}),Lt=rt?StreamlitDialog({...rt,onClose:this.closeDialog}):null,Ht=Et||et!==ConnectionState.CONNECTED;return jsx$1(AppContext.Provider,{value:{initialSidebarState:at,wideMode:dt.wideMode,embedded:isEmbed(),showPadding:!isEmbed()||isPaddingDisplayed(),disableScrolling:isScrollingHidden(),showToolbar:!isEmbed()||isToolbarDisplayed(),showColoredLine:!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Ot,sidebarChevronDownshift:zt,gitInfo:this.state.gitInfo,appConfig:St},children:jsx$1(LibContext.Provider,{value:{isFullScreen:ut,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:Mt,libConfig:At,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:wt,"data-testid":"stApp","data-test-script-state":ct==INITIAL_SCRIPT_RUN_ID?"initial":pt,"data-test-connection-state":et,children:[jsxs(Header,{children:[!ft&&jsxs(Fragment,{children:[jsx$1(StatusWidget,{connectionState:et,sessionEventDispatcher:this.sessionEventDispatcher,scriptRunState:pt,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:nt}),jsx$1(ToolbarActions,{hostToolbarItems:vt,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:yt,developmentMode:Ct,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:st,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode})]}),jsx$1(AppView,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:ot,scriptRunId:ct,scriptRunState:pt,widgetMgr:this.widgetMgr,widgetsDisabled:Ht,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:ot.logo,appPages:Tt,navSections:Rt,onPageChange:this.onPageChange,currentPageScriptHash:Mt,hideSidebarNav:bt||mt,expandSidebarNav:ht}),Lt]})})})})}}const AppWithScreencast=withScreencast(App);function useThemeManager(){const tt=getDefaultTheme(),[nt,et]=reactExports.useState(tt),[rt,ot]=reactExports.useState([]),[at,st]=reactExports.useState([...createPresetThemes(),...isPresetTheme(tt)?[]:[tt]]),ut=ft=>{st([...createPresetThemes(),...ft])},ct=reactExports.useCallback(ft=>{ft!==nt&&(et(ft),ft.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(ft))},[et,nt]),pt=reactExports.useCallback(()=>{nt.name===AUTO_THEME_NAME&&ct(getHostSpecifiedTheme());const ft=at.filter(bt=>bt.name!==AUTO_THEME_NAME);st([createAutoTheme(),...ft])},[nt.name,at,ct]),dt=reactExports.useCallback(ft=>{ft.fontFaces&&ot(ft.fontFaces);const bt=new CustomThemeConfig(ft),ht=createTheme(CUSTOM_THEME_NAME,bt);ct(ht)},[ot,ct]);return reactExports.useEffect(()=>{const ft=window.matchMedia("(prefers-color-scheme: dark)");return ft.addEventListener("change",pt),window.addEventListener("afterprint",pt),()=>{window.removeEventListener("afterprint",pt),ft.removeEventListener("change",pt)}},[nt,at,pt]),[{setTheme:ct,activeTheme:nt,addThemes:ut,availableThemes:at,setImportedTheme:dt},rt]}const ThemedApp=({streamlitExecutionStartedAt:tt})=>{const[nt,et]=useThemeManager(),{activeTheme:rt}=nt,ot=rt.name===CUSTOM_THEME_NAME&&et.length>0;return jsx$1(RootStyleProvider,{theme:rt,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[ot&&jsx$1(FontFaceDeclaration,{fontFaces:et}),jsx$1(AppWithScreencast,{theme:nt,streamlitExecutionStartedAt:tt})]})})})},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{isEqual$1 as $,isNullOrUndefined$1 as A,merge$6 as B,numbro$1 as C,notNullOrUndefined as D,EmotionIconBase as E,Fragment as F,hooks as G,formatPeriodType as H,moment$1 as I,getTypeName as J,format as K,convertToSeconds as L,useTheme as M,Arrow$2 as N,logError as O,PortalContext as P,transparentize as Q,React$1 as R,convertRemToPx as S,logWarning as T,_defineProperty$u as U,_objectWithoutProperties$o as V,_typeof$g as W,jsx as X,css$2 as Y,_toConsumableArray$3 as Z,_extends$Q as _,range$1 as a,TooltipIcon as a$,StyledTooltipContentWrapper as a0,StreamlitMarkdown$1 as a1,PLACEMENT as a2,ACCESSIBILITY_TYPE as a3,hasLightBackgroundColor as a4,Popover$1 as a5,LibContext as a6,debounce$4 as a7,jsxs as a8,Resizable as a9,_unsupportedIterableToArray$l as aA,getAugmentedNamespace as aB,DEFAULT_IFRAME_FEATURE_POLICY as aC,DEFAULT_IFRAME_SANDBOX_POLICY as aD,darken as aE,BaseButtonSize as aF,BaseButtonKind as aG,BaseButtonTooltip as aH,DynamicButtonLabel as aI,IsSidebarContext as aJ,Placement as aK,getGray90 as aL,getIncreasingGreen as aM,getDecreasingRed as aN,PlotlyChart$1 as aO,keysToSnakeCase as aP,WindowDimensionsContext as aQ,Video$1 as aR,zip$1 as aS,FileUploaderState as aT,UploadedFileInfo as aU,StyledSpinner as aV,ENABLE_PERIPHERALS_DOCS_URL as aW,Icon$2 as aX,BaseButton as aY,blend as aZ,labelVisibilityProtoValueToEnum as a_,IndexTypeName as aa,_baseMerge as ab,_createAssigner as ac,getGray70 as ad,getGray30 as ae,getCategoricalColorsArray as af,getDivergingColorsArray as ag,getSequentialColorsArray as ah,getBlue80 as ai,Global as aj,ensureError as ak,withTheme as al,DynamicIcon as am,toaster as an,Kind as ao,AlertElement as ap,_assertThisInitialized$e as aq,StyledInlineCode as ar,ErrorElement as as,axios as at,Skeleton$1 as au,Skeleton as av,hoistNonReactStatics$2 as aw,lib$3 as ax,parseToRgba as ay,DeckGlJsonChart$1 as az,reactDomExports as b,ThemeProvider$1 as b$,WidgetLabel as b0,Tooltip as b1,styled as b2,getOverrides as b3,LocaleContext as b4,ButtonGroup$1 as b5,LabelVisibilityMessage as b6,StyledWidgetLabelHelpInline as b7,themeColors as b8,isMobile_1 as b9,classNames as bA,UISelectbox as bB,isValidFormId as bC,toPropertyKey as bD,_setPrototypeOf$e as bE,hexToRgb as bF,withWrapper as bG,StyledWidgetInstructions as bH,isFromMac as bI,CUSTOM_INPUT_TYPE as bJ,SIZE$1 as bK,DeleteAlt$1 as bL,ADJOINED as bM,filterOptions as bN,ENHANCER_POSITION as bO,pick$1 as bP,Slider$2 as bQ,isFromWindows as bR,__awaiter as bS,__generator as bT,__spread as bU,PropTypes as bV,ChevronLeft as bW,ChevronRight as bX,isInForm as bY,toString_1 as bZ,TextInput$1 as b_,CAMERA_PERMISSION_URL as ba,StyledWidgetLabelHelp as bb,isFocusVisible as bc,getOverride as bd,getOverrideProps as be,Checkbox$1 as bf,StyledContent as bg,StyledCheckbox$1 as bh,BaseColorPicker as bi,useStyletron as bj,mergeOverride as bk,toObjectOverride as bl,Icon$1 as bm,UIDConsumer as bn,StatefulMenu as bo,mergeOverrides as bp,ChevronDown$1 as bq,ThemeContext as br,forkFocus as bs,forkBlur as bt,Select as bu,without$1 as bv,fuzzyFilterSelectOptions as bw,TYPE as bx,VirtualDropdown as by,isPresetTheme as bz,_hasPath as c,createThemedStyled as c0,createThemedUseStyletron as c1,createThemedWithStyle as c2,expandBorderStyles as c3,withStyle as c4,reactIsExports$1 as c5,NumberInput$1 as c6,commonjsGlobal$1 as d,classnamesExports as e,_root as f,getDefaultExportFromCjs$1 as g,isObject_1 as h,isPropValid as i,jsx$1 as j,keyframes as k,_Set as l,_setToArray as m,newStyled as n,_SetCache as o,propTypesExports as p,_arrayIncludes as q,reactExports as r,_arrayIncludesWith as s,toNumber_1 as t,_cacheHas as u,groupBy$1 as v,__vitePreload as w,flatten$2 as x,require$$0 as y,toString$9 as z};
798
+ Event: ${nt}`)}async pingServer(){this.uriIndex=await doInitPings(this.args.baseUriPartsList,PING_MINIMUM_RETRY_PERIOD_MS,PING_MAXIMUM_RETRY_PERIOD_MS,this.args.onRetry,this.args.onHostConfigResp),this.stepFsm("SERVER_PING_SUCCEEDED")}async getSessionTokens(){var et,rt;const nt=await this.args.claimHostAuthToken();return this.args.resetHostAuthToken(),[nt??"PLACEHOLDER_AUTH_TOKEN",...(et=this.args.sessionInfo.last)!=null&&et.sessionId?[(rt=this.args.sessionInfo.last)==null?void 0:rt.sessionId]:[]]}async connectToWebSocket(){const nt=buildWsUri(this.args.baseUriPartsList[this.uriIndex],WEBSOCKET_STREAM_PATH);if(notNullOrUndefined(this.websocket))throw new Error("Websocket already exists");const et=await this.getSessionTokens();this.websocket=new WebSocket(nt,["streamlit",...et]),this.websocket.binaryType="arraybuffer",this.setConnectionTimeout(nt);const rt=this.websocket,ot=()=>rt===this.websocket;this.websocket.addEventListener("message",at=>{ot()&&this.handleMessage(at.data).catch(st=>{const ut=`Failed to process a Websocket message (${st})`;logError(LOG,ut),this.stepFsm("FATAL_ERROR",ut)})}),this.websocket.addEventListener("open",()=>{ot()&&this.stepFsm("CONNECTION_SUCCEEDED")}),this.websocket.addEventListener("close",()=>{ot()&&(this.closeConnection(),this.stepFsm("CONNECTION_CLOSED"))}),this.websocket.addEventListener("error",()=>{ot()&&(logError(LOG,"WebSocket onerror"),this.closeConnection(),this.stepFsm("CONNECTION_ERROR"))})}setConnectionTimeout(nt){if(notNullOrUndefined(this.wsConnectionTimeoutId))throw new Error("WS timeout is already set");const et=this.websocket;this.wsConnectionTimeoutId=window.setTimeout(()=>{if(et===this.websocket&&!isNullOrUndefined$1(this.wsConnectionTimeoutId)){if(isNullOrUndefined$1(this.websocket)){this.closeConnection(),this.stepFsm("FATAL_ERROR","Null Websocket in setConnectionTimeout");return}this.websocket.readyState===0&&(this.closeConnection(),this.stepFsm("CONNECTION_TIMED_OUT"))}},WEBSOCKET_TIMEOUT_MS),logMessage(LOG,`Set WS timeout ${this.wsConnectionTimeoutId}`)}closeConnection(){this.websocket&&(this.websocket.close(),this.websocket=void 0),notNullOrUndefined(this.wsConnectionTimeoutId)&&(logMessage(LOG,`Clearing WS timeout ${this.wsConnectionTimeoutId}`),window.clearTimeout(this.wsConnectionTimeoutId),this.wsConnectionTimeoutId=void 0)}sendMessage(nt){if(!this.websocket)return;const et=BackMsg.create(nt),rt=BackMsg.encode(et).finish();this.websocket.send(rt)}incrementMessageCacheRunCount(nt){this.cache.incrementRunCount(nt)}async handleMessage(nt){const et=this.nextMessageIndex;this.nextMessageIndex+=1,PerformanceEvents.record({name:"BeginHandleMessage",messageIndex:et});const rt=new Uint8Array(nt),ot=ForwardMsg.decode(rt);for(PerformanceEvents.record({name:"DecodedMessage",messageIndex:et,messageType:ot.type,len:nt.byteLength}),this.messageQueue[et]=await this.cache.processMessagePayload(ot,rt),PerformanceEvents.record({name:"GotCachedPayload",messageIndex:et});this.lastDispatchedMessageIndex+1 in this.messageQueue;){const at=this.lastDispatchedMessageIndex+1;this.args.onMessage(this.messageQueue[at]),PerformanceEvents.record({name:"DispatchedMessage",messageIndex:at,messageType:this.messageQueue[at].type}),delete this.messageQueue[at],this.lastDispatchedMessageIndex=at}}}function doInitPings(tt,nt,et,rt,ot){const at=new Resolver;let st=0,ut=0,ct=()=>{};const pt=()=>{ut++,ut>=tt.length&&(ut=0),ct()},dt=ht=>{const Mt=Math.random()*.4-.2,mt=st===1?nt:nt*2**(st-1)*(1+Mt),Ot=Math.min(et,mt);rt(st,ht,Ot),window.setTimeout(pt,Ot)},ft=()=>{const ht=tt[ut];new URL(buildHttpUri(ht,"")).hostname==="localhost"?dt(jsx$1(StreamlitMarkdown$1,{source:"\nIs Streamlit still running? If you accidentally stopped Streamlit, just restart it in your terminal:\n\n```bash\nstreamlit run yourscript.py\n```\n ",allowHTML:!1})):dt("Connection failed with status 0.")},bt=()=>{dt(jsxs(reactExports.Fragment,{children:[jsx$1("p",{children:"Cannot connect to Streamlit (HTTP status: 403)."}),jsxs("p",{children:["If you are trying to access a Streamlit app running on another server, this could be due to the app's"," ",jsx$1("a",{href:CORS_ERROR_MESSAGE_DOCUMENTATION_LINK,children:"CORS"})," settings."]})]}))};return ct=()=>{const ht=tt[ut],Mt=buildHttpUri(ht,SERVER_PING_PATH),mt=buildHttpUri(ht,HOST_CONFIG_PATH);ut===0&&st++,Promise.all([axios.get(Mt,{timeout:PING_TIMEOUT_MS}),axios.get(mt,{timeout:PING_TIMEOUT_MS})]).then(([Ot,zt])=>{ot(zt.data),at.resolve(ut)}).catch(Ot=>{if(Ot.code==="ECONNABORTED")return dt("Connection timed out.");if(Ot.response){const{data:zt,status:yt}=Ot.response;return yt===0?ft():yt===403?bt():dt(`Connection failed with status ${yt}, and response "${zt}".`)}return Ot.request?ft():dt(Ot.message)})},ct(),at.promise}const RETRY_COUNT_FOR_WARNING=6;class ConnectionManager{constructor(nt){this.connectionState=ConnectionState.INITIAL,this.setConnectionState=(et,rt)=>{this.connectionState!==et&&(this.connectionState=et,this.props.connectionStateChanged(et)),rt&&this.props.onConnectionError(rt)},this.showRetryError=(et,rt,ot)=>{et===RETRY_COUNT_FOR_WARNING&&this.props.onConnectionError(rt)},this.props=nt,this.connect()}isConnected(){return this.connectionState===ConnectionState.CONNECTED}getBaseUriParts(){if(this.connection instanceof WebsocketConnection)return this.connection.getBaseUriParts()}sendMessage(nt){this.connection instanceof WebsocketConnection&&this.isConnected()?this.connection.sendMessage(nt):logError(`Cannot send message when server is disconnected: ${nt}`)}incrementMessageCacheRunCount(nt){this.connection instanceof WebsocketConnection&&this.connection.incrementMessageCacheRunCount(nt)}async connect(){try{this.connection=await this.connectToRunningServer()}catch(nt){const et=ensureError(nt);logError(et.message),this.setConnectionState(ConnectionState.DISCONNECTED_FOREVER,et.message)}}disconnect(){var nt;(nt=this.connection)==null||nt.disconnect()}connectToRunningServer(){const nt=getPossibleBaseUris();return new WebsocketConnection({sessionInfo:this.props.sessionInfo,endpoints:this.props.endpoints,baseUriPartsList:nt,onMessage:this.props.onMessage,onConnectionStateChange:this.setConnectionState,onRetry:this.showRetryError,claimHostAuthToken:this.props.claimHostAuthToken,resetHostAuthToken:this.props.resetHostAuthToken,onHostConfigResp:this.props.onHostConfigResp})}}class SessionEventDispatcher{constructor(){this.onSessionEvent=new dist.Signal}handleSessionEventMsg(nt){this.onSessionEvent.emit(nt)}}const MEDIA_ENDPOINT="/media",UPLOAD_FILE_ENDPOINT="/_stcore/upload_file",COMPONENT_ENDPOINT_BASE="/component",FORWARD_MSG_CACHE_ENDPOINT="/_stcore/message";class DefaultStreamlitEndpoints{constructor(nt){this.getServerUri=nt.getServerUri,this.csrfEnabled=nt.csrfEnabled}buildComponentURL(nt,et){return buildHttpUri(this.requireServerUri(),`${COMPONENT_ENDPOINT_BASE}/${nt}/${et}`)}setFileUploadClientConfig({prefix:nt,headers:et}){this.fileUploadClientConfig={prefix:nt,headers:et}}buildMediaURL(nt){return nt.startsWith(MEDIA_ENDPOINT)?buildHttpUri(this.requireServerUri(),nt):nt}buildFileUploadURL(nt){return this.fileUploadClientConfig?makePath(this.fileUploadClientConfig.prefix,nt):nt.startsWith(UPLOAD_FILE_ENDPOINT)?buildHttpUri(this.requireServerUri(),nt):nt}buildAppPageURL(nt,et){const rt=et.urlPathname,ot=et.isDefault?"":rt;if(notNullOrUndefined(nt)&&nt.length>0)return`${nt}/${ot}`;const{port:at,protocol:st}=window.location,{basePath:ut,host:ct}=this.requireServerUri(),pt=at?`:${at}`:"",dt=ut?`${ut}/`:"";return`${st}//${ct}${pt}/${dt}${ot}`}async uploadFileUploaderFile(nt,et,rt,ot,at){const st=new FormData;st.append(et.name,et);const ut=this.getAdditionalHeaders();return this.csrfRequest(this.buildFileUploadURL(nt),{cancelToken:at,method:"PUT",data:st,responseType:"text",headers:ut,onUploadProgress:ot}).then(()=>{})}getAdditionalHeaders(){let nt={};return this.fileUploadClientConfig&&(nt={...nt,...this.fileUploadClientConfig.headers}),nt}async deleteFileAtURL(nt,et){const rt=this.getAdditionalHeaders();return this.csrfRequest(this.buildFileUploadURL(nt),{method:"DELETE",data:{sessionId:et},headers:rt}).then(()=>{})}async fetchCachedForwardMsg(nt){const et=this.requireServerUri(),rt=await axios.request({url:buildHttpUri(et,`${FORWARD_MSG_CACHE_ENDPOINT}?hash=${nt}`),method:"GET",responseType:"arraybuffer"});return new Uint8Array(rt.data)}requireServerUri(){const nt=this.getServerUri();if(notNullOrUndefined(nt))return this.cachedServerUri=nt,nt;if(notNullOrUndefined(this.cachedServerUri))return this.cachedServerUri;throw new Error("not connected to a server!")}csrfRequest(nt,et){if(et.url=nt,this.csrfEnabled){const rt=getCookie("_streamlit_xsrf");notNullOrUndefined(rt)&&(et.headers={"X-Xsrftoken":rt,...et.headers||{}},et.withCredentials=!0)}return axios.request(et)}}var assignValue=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject=isObject_1,toKey=_toKey;function baseSet$1(tt,nt,et,rt){if(!isObject(tt))return tt;nt=castPath$1(nt,tt);for(var ot=-1,at=nt.length,st=at-1,ut=tt;ut!=null&&++ot<at;){var ct=toKey(nt[ot]),pt=et;if(ct==="__proto__"||ct==="constructor"||ct==="prototype")return tt;if(ot!=st){var dt=ut[ct];pt=rt?rt(dt,ct,ut):void 0,pt===void 0&&(pt=isObject(dt)?dt:isIndex(nt[ot+1])?[]:{})}assignValue(ut,ct,pt),ut=ut[ct]}return tt}var _baseSet=baseSet$1,baseGet=_baseGet,baseSet=_baseSet,castPath=_castPath;function basePickBy$1(tt,nt,et){for(var rt=-1,ot=nt.length,at={};++rt<ot;){var st=nt[rt],ut=baseGet(tt,st);et(ut,st)&&baseSet(at,castPath(st,tt),ut)}return at}var _basePickBy=basePickBy$1,basePickBy=_basePickBy,hasIn=hasIn_1;function basePick$1(tt,nt){return basePickBy(tt,nt,function(et,rt){return hasIn(tt,rt)})}var _basePick=basePick$1,basePick=_basePick,flatRest=_flatRest,pick=flatRest(function(tt,nt){return tt==null?{}:basePick(tt,nt)}),pick_1=pick;const pick$1=getDefaultExportFromCjs$1(pick_1),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json";class MetricsManager{constructor(nt){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId="",this.pendingEvents=[],this.appHash="Not initialized",this.metadata={},this.setAppHash=et=>{this.appHash=et},this.setMetricsConfig=(et="")=>{this.metricsUrl=et},this.sessionInfo=nt}async initialize({gatherUsageStats:nt,sendMessageToHost:et}){this.sendMessageToHost=et,this.actuallySendMetrics=nt&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(logError("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),logAlways("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue(nt,et={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([nt,et]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send(nt,et))}setMetadata(nt){this.metadata=nt}async requestDefaultMetricsConfig(){const nt=localStorageAvailable();if(nt){const et=window.localStorage.getItem("stMetricsConfig");if(et){this.metricsUrl=et;return}}try{const et=await fetch(DEFAULT_METRICS_CONFIG,{signal:AbortSignal.timeout(5e3)});if(!et.ok)this.metricsUrl=void 0,logError("Failed to fetch metrics config: ",et.status);else{const rt=await et.json();this.metricsUrl=rt.url??void 0,nt&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(et){logError("Failed to fetch metrics config:",et)}}send(nt,et={}){const rt=this.buildEventProto(nt,et);this.metricsUrl==="postMessage"?this.postMessageEvent(nt,rt):this.track(rt)}sendPendingEvents(){this.pendingEvents.forEach(([nt,et])=>{this.send(nt,et)}),this.pendingEvents=[]}async track(nt){const et=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(nt.toJSON())});await fetch(et)}postMessageEvent(nt,et){this.sendMessageToHost({type:"METRICS_EVENT",eventName:nt,data:et})}buildEventProto(nt,et){const rt=new MetricsEvent({event:nt,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(nt==="menuClick")rt.label=et.label;else if(nt==="pageProfile")return new MetricsEvent({...rt,...et});return rt}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3}}getHostTrackingData(){return this.metadata?pick$1(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 nt="ajs_anonymous_id",et=localStorageAvailable(),rt=getCookie(nt),ot=et?window.localStorage.getItem(nt):null,at=new Date;at.setFullYear(new Date().getFullYear()+1),rt?(this.anonymousId=rt,et&&window.localStorage.setItem(nt,rt)):ot?(this.anonymousId=JSON.parse(ot),setCookie(nt,this.anonymousId,at)):(this.anonymousId=v4(),setCookie(nt,this.anonymousId,at),et&&window.localStorage.setItem(nt,this.anonymousId))}}const StyledApp=newStyled("div",{target:"e10tffaf0"})(({theme:tt})=>{const nt=hasLightBackgroundColor(tt);return{position:"absolute",background:tt.colors.bgColor,color:tt.colors.bodyText,top:tt.spacing.none,left:tt.spacing.none,right:tt.spacing.none,bottom:tt.spacing.none,colorScheme:nt?"light":"dark",overflow:"hidden","@media print":{float:"none",height:tt.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"e1nhbas40"})({margin:0}),StyledInstruction=newStyled("p",{target:"e1nhbas41"})({margin:0});class ScreencastDialog extends reactExports.PureComponent{constructor(){super(...arguments),this.state={recordAudio:this.props.recordAudio},this.handleRecordAudioCheckbox=nt=>{const{checked:et}=nt.target,{recordAudio:rt}=this.state,{toggleRecordAudio:ot}=this.props;et!==rt&&this.setState({recordAudio:et},ot)},this.handleStartButton=()=>{const{startRecording:nt,onClose:et}=this.props;nt(),et()}}render(){const{recordAudio:nt}=this.state,{onClose:et}=this.props;return jsxs(Modal,{isOpen:!0,onClose:et,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:nt,onChange:this.handleRecordAudioCheckbox})," ","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:this.handleStartButton,children:"Start recording!"})})]})}}const StyledVideo=newStyled("video",{target:"ec1y6ev0"})(({theme:tt})=>({width:tt.sizes.full,borderRadius:tt.radii.md})),StyledDialogContainer=newStyled("div",{target:"ec1y6ev1"})(({theme:tt})=>({display:"flex",flexDirection:"column",width:tt.sizes.full})),StyledRow=newStyled("div",{target:"ec1y6ev2"})(({theme:tt})=>({display:"flex",flexDirection:"row",paddingTop:tt.spacing.md,paddingBottom:tt.spacing.md})),StyledFirstColumn=newStyled("div",{target:"ec1y6ev3"})(({theme:tt})=>({paddingRight:tt.spacing.lg,textAlign:"right",color:tt.colors.gray,fontWeight:tt.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"ec1y6ev4"})(({theme:tt})=>({flex:1,paddingRight:tt.spacing.lg,marginRight:"6em",[`@media (max-width: ${tt.breakpoints.sm})`]:{marginRight:tt.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"ec1y6ev5"})(({theme:tt})=>({marginTop:tt.spacing.sm,marginBottom:tt.spacing.none,fontSize:tt.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"ec1y6ev6"})(({theme:tt})=>({marginTop:tt.spacing.twoXS})),VideoRecordedDialog=({onClose:tt,videoBlob:nt,fileName:et})=>{const rt=URL.createObjectURL(nt),ot=()=>{const at=document.createElement("a");at.setAttribute("href",rt),at.setAttribute("download",`${et}.webm`),at.click(),tt()};return jsxs(Modal,{isOpen:!0,onClose:tt,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:rt,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:ot,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:"e1xu6skw0"})({display:"flex"}),StyledUnsupportedScreenCastIcon=newStyled("div",{target:"e1xu6skw1"})(({theme:tt})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:tt.spacing.twoXL,marginLeft:tt.spacing.sm,fontSize:tt.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1xu6skw2"})(({theme:tt})=>({margin:tt.spacing.none})),UnsupportedBrowserDialog=({onClose:tt})=>jsxs(Modal,{isOpen:!0,onClose:tt,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:"e1442ngl0"})(({theme:tt})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:tt.sizes.full,height:tt.sizes.full,fontSize:"40vh",color:tt.colors.red,fontWeight:tt.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${tt.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:tt,endCallback:nt})=>{const[et,rt]=reactExports.useState(tt);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const at=et-1;at>=0&&rt(at),at===0&&nt()},children:jsx$1("span",{children:et})},`frame${et}`)};function withScreencast(tt){const et=class et extends reactExports.PureComponent{constructor(){super(...arguments),this.state={fileName:"streamlit-screencast",recordAudio:!1,currentState:this.props.testOverride||"OFF"},this.toggleRecordAudio=()=>{const{recordAudio:ot}=this.state;this.setState({recordAudio:!ot})},this.showDialog=ot=>{const{currentState:at}=this.state;ScreenCastRecorder.isSupportedBrowser()?at==="OFF"?this.setState({fileName:ot,currentState:"SETUP"}):this.stopRecording().catch(st=>logWarning(`withScreencast.stopRecording threw an error: ${st}`)):this.setState({currentState:"UNSUPPORTED"})},this.startRecording=async()=>{const{recordAudio:ot}=this.state;this.recorder=new ScreenCastRecorder({recordAudio:ot,onErrorOrStop:()=>this.stopRecording()});try{await this.recorder.initialize()}catch{this.setState({currentState:"UNSUPPORTED"});return}this.setState({currentState:"COUNTDOWN"})},this.stopRecording=async()=>{let ot;const{currentState:at}=this.state;at==="OFF"||isNullOrUndefined$1(this.recorder)||(at==="COUNTDOWN"&&this.setState({currentState:"OFF"}),at==="RECORDING"&&(this.recorder.getState()==="inactive"?this.setState({currentState:"OFF"}):(ot=await this.recorder.stop(),this.setState({outputBlob:ot,currentState:"PREVIEW_FILE"}))))},this.onCountdownEnd=async()=>{if(isNullOrUndefined$1(this.recorder))throw new Error("Countdown finished but recorder is null");this.recorder.start()?this.setState({currentState:"RECORDING"}):this.stopRecording().catch(at=>logWarning(`withScreencast.stopRecording threw an error: ${at}`))},this.getScreenCastProps=()=>({currentState:this.state.currentState,toggleRecordAudio:this.toggleRecordAudio,startRecording:this.showDialog,stopRecording:this.stopRecording}),this.closeDialog=()=>{this.setState({currentState:"OFF"})},this.render=()=>{const{outputBlob:ot,fileName:at,recordAudio:st,currentState:ut}=this.state;return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(tt,{...this.props,screenCast:this.getScreenCastProps()}),ut==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:this.closeDialog}),ut==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:st,onClose:this.closeDialog,startRecording:this.startRecording,toggleRecordAudio:this.toggleRecordAudio}),ut==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:this.onCountdownEnd}),ut==="PREVIEW_FILE"&&ot&&jsx$1(VideoRecordedDialog,{onClose:this.closeDialog,videoBlob:ot,fileName:at})]})}}};et.displayName=`withScreencast(${tt.displayName||tt.name})`;let nt=et;return hoistNonReactStatics$2(nt,tt)}const showDevelopmentOptions=(tt,nt)=>nt==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==nt||Config.ToolbarMode.MINIMAL==nt?!1:tt||isLocalhost();function getTitle(tt){return tt||"Streamlit"}class StrategyV1{constructor(nt){this.appNav=nt,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession(nt){var st,ut;this.appPages=nt.appPages,this.currentPageScriptHash=nt.pageScriptHash,this.hideSidebarNav=((st=nt.config)==null?void 0:st.hideSidebarNav)??!1;const et=this.appPages[0],rt=et.urlPathname??"",ot=((ut=this.appPages.find(ct=>ct.pageScriptHash===this.currentPageScriptHash))==null?void 0:ut.urlPathname)??"",at=et.pageScriptHash===this.currentPageScriptHash;return this.appNav.onUpdatePageUrl(rt,ot,at),document.title=getTitle(ot??""),[{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:at?"":ot,currentPageScriptHash:this.currentPageScriptHash})}]}handlePagesChanged(nt){const{appPages:et}=nt;return[{appPages:et},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:et})}]}handlePageNotFound(nt){var ot;const{pageName:et}=nt;this.appNav.onPageNotFound(et);const rt=((ot=this.appPages[0])==null?void 0:ot.pageScriptHash)??"";return this.currentPageScriptHash=rt,[{currentPageScriptHash:rt},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:rt})}]}handleNavigation(nt){}findPageByUrlPath(nt){return this.appPages.length===0?null:this.appPages.find(et=>nt.endsWith("/"+et.urlPathname))??this.appPages[0]}clearPageElements(nt,et,rt){return AppRoot.empty(et,!1,rt,nt.logo)}}class StrategyV2{constructor(nt){this.appNav=nt,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession(nt){var et;return this.mainScriptHash=nt.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((et=nt.config)==null?void 0:et.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged(nt){}handlePageNotFound(nt){const{pageName:et}=nt;return this.appNav.onPageNotFound(et),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation(nt){const{sections:et,position:rt,appPages:ot}=nt;this.appPages=ot,this.hideSidebarNav=rt===Navigation.Position.HIDDEN;const at=nt.pageScriptHash,st=ot.find(pt=>pt.pageScriptHash===at),ut=ot.find(pt=>pt.isDefault);this.mainPage=ut;const ct=st.urlPathname;if(!this.appNav.isPageTitleSet){const pt=getTitle(st.pageName);document.title=pt,this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:st.pageName??""})}return!this.appNav.isPageIconSet&&st.icon&&this.appNav.onPageIconChange(st.icon),this.appNav.onUpdatePageUrl(ut.urlPathname??"",ct,st.isDefault??!1),[{appPages:ot,navSections:et,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:nt.expanded,currentPageScriptHash:at},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:ot}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:st.isDefault?"":ct,currentPageScriptHash:at})}]}findPageByUrlPath(nt){return this.appPages.find(et=>nt.endsWith("/"+et.urlPathname))??this.mainPage}clearPageElements(nt,et,rt){return nt.filterMainScriptElements(et)}}class AppNavigation{constructor(nt,et,rt,ot){this.hostCommunicationMgr=nt,this.onUpdatePageUrl=et,this.onPageNotFound=rt,this.onPageIconChange=ot,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession(nt){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession(nt)}handleNavigation(nt){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation(nt)}handlePagesChanged(nt){return this.strategy.handlePagesChanged(nt)}handlePageNotFound(nt){return this.strategy.handlePageNotFound(nt)}findPageByUrlPath(nt){return this.strategy.findPageByUrlPath(nt)}handlePageConfigChanged(nt){this.isPageIconSet=!!nt.favicon,this.isPageTitleSet=!!nt.title}clearPageElements(nt,et,rt){return this.strategy.clearPageElements(nt,et,rt)}}const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>";class App extends reactExports.PureComponent{constructor(nt){super(nt),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(rt,ot,at)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:rt,msg:ot,onContinue:at,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(rt,ot)=>{const[,at,st]=createPresetThemes(),ut=isPresetTheme(this.props.theme.activeTheme);rt===at.name&&ut?this.props.theme.setTheme(at):rt===st.name&&ut?this.props.theme.setTheme(st):ot&&this.props.theme.setImportedTheme(ot)},this.handleConnectionStateChanged=rt=>{if(logMessage(`Connection state changed from ${this.state.connectionState} to ${rt}`),rt===ConnectionState.CONNECTED){const ot=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||this.state.scriptRunState===ScriptRunState.RUNNING;(!this.sessionInfo.last||ot)&&(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:rt!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:rt})},this.handleGitInfoChanged=rt=>{this.setState({gitInfo:rt})},this.handleCustomParentMessage=rt=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:rt.message}):logError("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=rt=>{const ot=(at,st,ut)=>{const ct=at[st];if(ct in ut)return ut[ct](at[ct]);throw new Error(`Cannot handle ${st} "${ct}".`)};try{ot(rt,"type",{newSession:at=>this.handleNewSession(at),sessionStatusChanged:at=>this.handleSessionStatusChanged(at),sessionEvent:at=>this.handleSessionEvent(at),delta:at=>this.handleDeltaMsg(at,rt.metadata),pageConfigChanged:at=>this.handlePageConfigChanged(at),pageInfoChanged:at=>this.handlePageInfoChanged(at),pagesChanged:at=>this.handlePagesChanged(at),pageNotFound:at=>this.handlePageNotFound(at),gitInfoChanged:at=>this.handleGitInfoChanged(at),scriptFinished:at=>this.handleScriptFinished(at),pageProfile:at=>this.handlePageProfileMsg(at),autoRerun:at=>this.handleAutoRerun(at),fileUrlsResponse:at=>this.uploadClient.onFileURLsResponse(at),parentMessage:at=>this.handleCustomParentMessage(at),logo:at=>this.handleLogo(at,rt.metadata),navigation:at=>this.handleNavigation(at)})}catch(at){const st=ensureError(at);logError(st),this.showError("Bad message format",st.message)}},this.handleLogo=(rt,ot)=>{const at={activeScriptHash:ot.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(rt,at)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=rt=>{const{title:ot,favicon:at,layout:st,initialSidebarState:ut,menuItems:ct}=rt;this.appNavigation.handlePageConfigChanged(rt),ot&&(this.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:ot}),document.title=ot),at&&this.onPageIconChanged(at),st!==this.state.layout&&this.setState(pt=>({layout:st,userSettings:{...pt.userSettings,wideMode:st===PageConfig.Layout.WIDE}})),ut!==this.state.initialSidebarState&&this.setState(()=>({initialSidebarState:ut})),this.setState({menuItems:ct})},this.handlePageInfoChanged=rt=>{const{queryString:ot}=rt,at=document.location.pathname+(ot?`?${ot}`:"");window.history.pushState({},"",at),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:ot?`?${ot}`:""})},this.onPageNotFound=rt=>{const ot=rt?`You have requested page /${rt}, 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",`${ot}. Running the app's main page.`)},this.handlePageNotFound=rt=>{this.maybeSetState(this.appNavigation.handlePageNotFound(rt))},this.onPageIconChanged=rt=>{handleFavicon(rt,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=rt=>{this.maybeSetState(this.appNavigation.handlePagesChanged(rt))},this.handleNavigation=rt=>{this.maybeSetState(this.appNavigation.handleNavigation(rt))},this.handlePageProfileMsg=rt=>{var st,ut,ct;const ot=PageProfile.toObject(rt),at=getBrowserInfo();this.metricsMgr.enqueue("pageProfile",{...ot,isFragmentRun:!!ot.isFragmentRun,appId:this.sessionInfo.current.appId,numPages:(st=this.state.appPages)==null?void 0:st.length,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,pageScriptHash:this.state.currentPageScriptHash,activeTheme:(ct=(ut=this.props.theme)==null?void 0:ut.activeTheme)==null?void 0:ct.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:at})},this.handleAutoRerun=rt=>{const ot=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(rt.fragmentId,!0)},rt.interval*1e3);this.setState(at=>({autoReruns:[...at.autoReruns,ot]}))},this.handleSessionStatusChanged=rt=>{this.setState(ot=>{let{scriptRunState:at}=ot,{dialog:st}=ot;return rt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.STOP_REQUESTED?(at=ScriptRunState.RUNNING,notNullOrUndefined(st)&&st.type===DialogType.SCRIPT_COMPILE_ERROR&&(st=void 0)):!rt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&ot.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(at=ScriptRunState.NOT_RUNNING),{userSettings:{...ot.userSettings,runOnSave:!!rt.runOnSave},dialog:st,scriptRunState:at}})},this.handleSessionEvent=rt=>{if(this.sessionEventDispatcher.handleSessionEventMsg(rt),rt.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const ot={type:DialogType.SCRIPT_COMPILE_ERROR,exception:rt.scriptCompilationException,onClose:()=>{}};this.openDialog(ot)}},this.maybeUpdatePageUrl=(rt,ot,at)=>{const st=this.getBaseUriParts();if(st){const{basePath:ut}=st,ct=extractPageNameFromPathName(document.location.pathname,ut);if((ct===""?rt:ct)!==ot){const dt=at?"":ot,ft=preserveEmbedQueryParams(),bt=ft?`?${ft}`:"",Mt=`${ut?`/${ut}`:""}/${dt}${bt}`;window.history.pushState({},"",Mt)}}},this.handleNewSession=rt=>{const ot=rt.initialize;if(this.hasStreamlitVersionChanged(ot)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(rt);const{appHash:at,currentPageScriptHash:st}=this.state,{scriptRunId:ut,name:ct,mainScriptPath:pt,fragmentIdsThisRun:dt,pageScriptHash:ft,mainScriptHash:bt}=rt;if(dt.length)this.setState({fragmentIdsThisRun:dt,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const Mt=rt.config,mt=rt.customTheme;this.processThemeInput(mt),this.setState({allowRunOnSave:Mt.allowRunOnSave,hideTopBar:Mt.hideTopBar,toolbarMode:Mt.toolbarMode,latestRunTime:performance.now(),mainScriptHash:bt,fragmentIdsThisRun:dt}),this.maybeSetState(this.appNavigation.handleNewSession(rt)),this.onPageIconChanged("./favicon.png")}const ht=hashString(this.sessionInfo.current.installationId+pt);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(ht),this.metricsMgr.enqueue("updateReport"),at===ht&&st===ft?this.setState({scriptRunId:ut}):this.clearAppState(ht,ut,ct,bt)},this.handleOneTimeInitialization=rt=>{const ot=rt.initialize,at=rt.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(rt)),this.metricsMgr.initialize({gatherUsageStats:at.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(ot.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:rt}=this.state,ot=this.appNavigation.findPageByUrlPath(document.location.pathname),at=document.location.toString().includes("#"),st=(ot==null?void 0:ot.pageScriptHash)===rt;isNullOrUndefined$1(ot)||at&&st||this.onPageChange(ot.pageScriptHash)},this.setAndSendTheme=rt=>{this.props.theme.setTheme(rt),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(rt.emotion)})},this.createThemeHash=rt=>{if(!rt)return"hash_for_undefined_custom_theme";const ot=Object.entries(rt);return ot.sort(),hashString(ot.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=rt=>{const{runOnSave:ot}=this.state.userSettings,{runOnSave:at}=rt;if(this.setState({userSettings:rt}),ot!==at&&this.isServerConnected()){const st=new BackMsg({setRunOnSave:at});st.type="setRunOnSave",this.sendBackMsg(st)}},this.handleDeltaMsg=(rt,ot)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,rt,ot),!this.pendingElementsTimerRunning){this.pendingElementsTimerRunning=!0;const at=this.state.scriptRunState===ScriptRunState.RUNNING;setTimeout(()=>{this.pendingElementsTimerRunning=!1,at&&this.setState({elements:this.pendingElementsBuffer})},ELEMENT_LIST_BUFFER_TIMEOUT_MS)}},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){const rt=new BackMsg({debugShutdownRuntime:!0});rt.type="debugShutdownRuntime",this.sendBackMsg(rt)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const rt=new BackMsg({debugDisconnectWebsocket:!0});rt.type="debugDisconnectWebsocket",this.sendBackMsg(rt)}},this.debugClearForwardMsgCache=()=>{var rt,ot;isLocalhost()&&((ot=(rt=this.connectionManager)==null?void 0:rt.connection)==null||ot.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(rt=>{clearInterval(rt)}),this.setState({autoReruns:[]})},this.rerunScript=(rt=!1)=>{if(this.closeDialog(),!this.isServerConnected()){logError("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}),rt===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){logError("Cannot load git information when disconnected from server.");return}this.sendBackMsg(new BackMsg({loadGitInfo:!0}))},this.onPageChange=rt=>{const{elements:ot,mainScriptHash:at}=this.state;this.cleanupAutoReruns();const st=this.appNavigation.clearPageElements(ot,at,void 0),ut=new Set(Array.from(st.getElements()).map(ct=>getElementId(ct)).filter(notUndefined));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(ut),void 0,rt)},this.isAppInReadyState=rt=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&rt.scriptRunState===ScriptRunState.RUNNING&&rt.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(rt,ot,at,st)=>{const ut=this.getBaseUriParts();if(!ut){logError("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ct}=this.state,{basePath:pt}=ut;let dt=this.getQueryString(),ft="";at?at!=ct&&(dt=preserveEmbedQueryParams(),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:dt})):ct?at=ct:(ft=extractPageNameFromPathName(document.location.pathname,pt),at=""),this.sendBackMsg(new BackMsg({rerunScript:{queryString:dt,widgetStates:rt,pageScriptHash:at,pageName:ft,fragmentId:ot,isAutoRerun:st}})),PerformanceEvents.record({name:"RequestedRerun",scriptRunState:this.state.scriptRunState})},this.stopScript=()=>{if(!this.isServerConnected()){logError("Cannot stop app when disconnected from server.");return}if(this.state.scriptRunState===ScriptRunState.NOT_RUNNING||this.state.scriptRunState===ScriptRunState.STOP_REQUESTED)return;const rt=new BackMsg({stopScript:!0});rt.type="stopScript",this.sendBackMsg(rt),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const rt={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(rt)}else logError("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var ot;const rt={type:DialogType.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:((ot=this.state.dialog)==null?void 0:ot.type)===DialogType.DEPLOY_ERROR,metricsMgr:this.metricsMgr};this.openDialog(rt)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const rt={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(rt)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const rt=new BackMsg({clearCache:!0});rt.type="clearCache",this.sendBackMsg(rt)}else logError("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const rt=new BackMsg({appHeartbeat:!0});rt.type="appHeartbeat",this.sendBackMsg(rt)}else logError("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=rt=>{this.connectionManager?this.connectionManager.sendMessage(rt):logError(`Not connected. Cannot send back message: ${rt}`)},this.handleConnectionError=rt=>{this.showError("Connection error",rt)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(rt=!0)=>{const ot={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:rt,metricsMgr:this.metricsMgr};this.openDialog(ot)},this.aboutCallback=()=>{const{menuItems:rt}=this.state,ot={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:rt==null?void 0:rt.aboutSectionMd};this.openDialog(ot)},this.printCallback=()=>{const{scriptRunState:rt}=this.state;if(rt!==ScriptRunState.NOT_RUNNING){setTimeout(this.printCallback,500);return}let ot;try{const at=getIFrameEnclosingApp(this.embeddingId);at&&at.contentWindow?ot=at.contentWindow.window:ot=window}catch{ot=window}finally{ot||(ot=window),ot.print()}},this.screencastCallback=()=>{const{scriptName:rt}=this.state,{startRecording:ot}=this.props.screenCast,at=hooks().format("YYYY-MM-DD-HH-MM-SS");ot(`streamlit-${rt}-${at}`)},this.handleFullScreen=rt=>{this.setState({isFullScreen:rt})},this.setLibConfig=rt=>{this.setState({libConfig:rt})},this.setAppConfig=rt=>{this.setState({appConfig:rt})},this.addScriptFinishedHandler=rt=>{this.setState((ot,at)=>({scriptFinishedHandlers:ot.scriptFinishedHandlers.concat(rt)}))},this.removeScriptFinishedHandler=rt=>{this.setState((ot,at)=>({scriptFinishedHandlers:without$1(ot.scriptFinishedHandlers,rt)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:rt}=this.state,ot=rt&&rt.length>0?rt:document.location.search;return ot.startsWith("?")?ot.substring(1):ot},this.isInCloudEnvironment=()=>{const{hostMenuItems:rt}=this.state;return rt&&(rt==null?void 0:rt.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=(rt,ot)=>{if(this.isServerConnected()){const at=new BackMsg({fileUrlsRequest:{requestId:rt,fileNames:ot.map(st=>st.name),sessionId:this.sessionInfo.current.sessionId}});at.type="fileUrlsRequest",this.sendBackMsg(at)}},this.handleKeyDown=rt=>{switch(rt){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=rt=>{rt==="esc"&&this.props.screenCast.stopRecording()},J$1();let et=this.createThemeHash();isPresetTheme(nt.theme.activeTheme)||(et=this.createThemeHash(toThemeInput(nt.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:et,gitInfo:null,formsData:createFormsData(),appPages:[],navSections:[],currentPageScriptHash:"",mainScriptHash:"",hideTopBar:!0,hideSidebarNav:!0,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:rt=>this.setState({formsData:rt})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:nt.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:rt=>{this.setState({inputsDisabled:rt})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:rt=>this.setState({isOwner:rt}),fileUploadClientConfigChanged:rt=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(rt)},hostMenuItemsChanged:rt=>{this.setState({hostMenuItems:rt})},hostToolbarItemsChanged:rt=>{this.setState({hostToolbarItems:rt})},hostHideSidebarNavChanged:rt=>{this.setState({hostHideSidebarNav:rt})},sidebarChevronDownshiftChanged:rt=>{this.setState({sidebarChevronDownshift:rt})},pageLinkBaseUrlChanged:rt=>{this.setState({pageLinkBaseUrl:rt})},queryParamsChanged:rt=>{this.setState({queryParams:rt})},deployedAppMetadataChanged:rt=>{this.setState({deployedAppMetadata:rt})},restartWebsocketConnection:()=>{this.connectionManager||this.initializeConnectionManager()},terminateWebsocketConnection:()=>{var rt;(rt=this.connectionManager)==null||rt.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:rt=>this.widgetMgr.setFormsWithUploadsInProgress(rt),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({sessionInfo:this.sessionInfo,endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:nt=>{const{allowedOrigins:et,useExternalAuthToken:rt,disableFullscreenMode:ot,enableCustomParentMessages:at,mapboxToken:st,enforceDownloadInNewTab:ut,metricsUrl:ct}=nt,pt={allowedOrigins:et,useExternalAuthToken:rt,enableCustomParentMessages:at},dt={mapboxToken:st,disableFullscreenMode:ot,enforceDownloadInNewTab:ut};this.metricsMgr.setMetricsConfig(ct),this.hostCommunicationMgr.setAllowedOrigins(pt),this.setAppConfig(pt),this.setLibConfig(dt)}})}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 nt=document.querySelectorAll("[data-iframe-height]"),et=Array.from(nt).map(rt=>Math.ceil(rt.getBoundingClientRect().bottom));return Math.max(0,...et)}},__vitePreload(()=>import("./iframeResizer.contentWindow.-9v2TlC_.js").then(nt=>nt.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(nt,et){window.prerenderReady===!1&&this.isAppInReadyState(et)&&(window.prerenderReady=!0),this.state.scriptRunState!==et.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 nt;(nt=this.connectionManager)==null||nt.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError(nt,et){logError(et);const rt={type:DialogType.WARNING,title:nt,msg:et,onClose:()=>{}};this.openDialog(rt)}hasStreamlitVersionChanged(nt){if(this.sessionInfo.isSet){const et=this.sessionInfo.current.streamlitVersion,{environmentInfo:rt}=nt;if(notNullOrUndefined(rt)&&notNullOrUndefined(rt.streamlitVersion))return et!=rt.streamlitVersion}return!1}maybeSetState(nt){if(nt){const[et,rt]=nt;this.setState(et,rt)}}processThemeInput(nt){const et=this.createThemeHash(nt);if(et===this.state.themeHash)return;this.setState({themeHash:et});const rt=!isPresetTheme(this.props.theme.activeTheme);if(nt){const ot=createTheme(CUSTOM_THEME_NAME,nt);this.props.theme.addThemes([ot]),(getCachedTheme()===null||rt)&&this.setAndSendTheme(ot)}else this.props.theme.addThemes([]),rt&&this.setAndSendTheme(getHostSpecifiedTheme())}handleScriptFinished(nt){if(nt===ForwardMsg.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(et=>et())},0),nt===ForwardMsg.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||nt===ForwardMsg.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:rt,fragmentIdsThisRun:ot})=>({elements:this.pendingElementsBuffer.clearStaleNodes(rt,ot)}),()=>{this.pendingElementsBuffer=this.state.elements});const et=new Set(Array.from(this.state.elements.getElements()).map(rt=>getElementId(rt)).filter(notUndefined));this.widgetMgr.removeInactive(et)}this.connectionManager!==null&&nt!==ForwardMsg.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState(nt,et,rt,ot){const{hideSidebarNav:at,elements:st}=this.state,ut=at&&st.sidebar||void 0;this.setState({scriptRunId:et,scriptName:rt,appHash:nt,elements:this.appNavigation.clearPageElements(this.pendingElementsBuffer,ot,ut)},()=>{this.pendingElementsBuffer=this.state.elements;const ct=new Set(Array.from(this.state.elements.getElements()).map(pt=>getElementId(pt)).filter(notUndefined));this.widgetMgr.removeInactive(ct)})}openDialog(nt){this.setState({dialog:nt})}render(){const{allowRunOnSave:nt,connectionState:et,dialog:rt,elements:ot,initialSidebarState:at,menuItems:st,isFullScreen:ut,scriptRunId:ct,scriptRunState:pt,userSettings:dt,hideTopBar:ft,hideSidebarNav:bt,expandSidebarNav:ht,currentPageScriptHash:Mt,hostHideSidebarNav:mt,pageLinkBaseUrl:Ot,sidebarChevronDownshift:zt,hostMenuItems:yt,hostToolbarItems:vt,libConfig:At,appConfig:St,inputsDisabled:Et,appPages:Tt,navSections:Rt}=this.state,Ct=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),wt=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":dt.wideMode}),Lt=rt?StreamlitDialog({...rt,onClose:this.closeDialog}):null,Ht=Et||et!==ConnectionState.CONNECTED;return jsx$1(AppContext.Provider,{value:{initialSidebarState:at,wideMode:dt.wideMode,embedded:isEmbed(),showPadding:!isEmbed()||isPaddingDisplayed(),disableScrolling:isScrollingHidden(),showToolbar:!isEmbed()||isToolbarDisplayed(),showColoredLine:!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Ot,sidebarChevronDownshift:zt,gitInfo:this.state.gitInfo,appConfig:St},children:jsx$1(LibContext.Provider,{value:{isFullScreen:ut,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:Mt,libConfig:At,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:wt,"data-testid":"stApp","data-test-script-state":ct==INITIAL_SCRIPT_RUN_ID?"initial":pt,"data-test-connection-state":et,children:[jsxs(Header,{children:[!ft&&jsxs(Fragment,{children:[jsx$1(StatusWidget,{connectionState:et,sessionEventDispatcher:this.sessionEventDispatcher,scriptRunState:pt,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:nt}),jsx$1(ToolbarActions,{hostToolbarItems:vt,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:yt,developmentMode:Ct,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:st,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode})]}),jsx$1(AppView,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:ot,scriptRunId:ct,scriptRunState:pt,widgetMgr:this.widgetMgr,widgetsDisabled:Ht,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:ot.logo,appPages:Tt,navSections:Rt,onPageChange:this.onPageChange,currentPageScriptHash:Mt,hideSidebarNav:bt||mt,expandSidebarNav:ht}),Lt]})})})})}}const AppWithScreencast=withScreencast(App);function useThemeManager(){const tt=getDefaultTheme(),[nt,et]=reactExports.useState(tt),[rt,ot]=reactExports.useState([]),[at,st]=reactExports.useState([...createPresetThemes(),...isPresetTheme(tt)?[]:[tt]]),ut=ft=>{st([...createPresetThemes(),...ft])},ct=reactExports.useCallback(ft=>{ft!==nt&&(et(ft),ft.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(ft))},[et,nt]),pt=reactExports.useCallback(()=>{nt.name===AUTO_THEME_NAME&&ct(getHostSpecifiedTheme());const ft=at.filter(bt=>bt.name!==AUTO_THEME_NAME);st([createAutoTheme(),...ft])},[nt.name,at,ct]),dt=reactExports.useCallback(ft=>{ft.fontFaces&&ot(ft.fontFaces);const bt=new CustomThemeConfig(ft),ht=createTheme(CUSTOM_THEME_NAME,bt);ct(ht)},[ot,ct]);return reactExports.useEffect(()=>{const ft=window.matchMedia("(prefers-color-scheme: dark)");return ft.addEventListener("change",pt),window.addEventListener("afterprint",pt),()=>{window.removeEventListener("afterprint",pt),ft.removeEventListener("change",pt)}},[nt,at,pt]),[{setTheme:ct,activeTheme:nt,addThemes:ut,availableThemes:at,setImportedTheme:dt},rt]}const ThemedApp=({streamlitExecutionStartedAt:tt})=>{const[nt,et]=useThemeManager(),{activeTheme:rt}=nt,ot=rt.name===CUSTOM_THEME_NAME&&et.length>0;return jsx$1(RootStyleProvider,{theme:rt,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[ot&&jsx$1(FontFaceDeclaration,{fontFaces:et}),jsx$1(AppWithScreencast,{theme:nt,streamlitExecutionStartedAt:tt})]})})})},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{isEqual$1 as $,isNullOrUndefined$1 as A,merge$6 as B,numbro$1 as C,notNullOrUndefined as D,EmotionIconBase as E,Fragment as F,hooks as G,formatPeriodType as H,moment$1 as I,getTypeName as J,format as K,convertToSeconds as L,useTheme as M,Arrow$2 as N,logError as O,PortalContext as P,transparentize as Q,React$1 as R,convertRemToPx as S,logWarning as T,_defineProperty$u as U,_objectWithoutProperties$o as V,_typeof$g as W,jsx as X,css$2 as Y,_toConsumableArray$3 as Z,_extends$Q as _,range$1 as a,TooltipIcon as a$,StyledTooltipContentWrapper as a0,StreamlitMarkdown$1 as a1,PLACEMENT as a2,ACCESSIBILITY_TYPE as a3,hasLightBackgroundColor as a4,Popover$1 as a5,LibContext as a6,debounce$4 as a7,jsxs as a8,Resizable as a9,_unsupportedIterableToArray$l as aA,getAugmentedNamespace as aB,DEFAULT_IFRAME_FEATURE_POLICY as aC,DEFAULT_IFRAME_SANDBOX_POLICY as aD,darken as aE,BaseButtonSize as aF,BaseButtonKind as aG,BaseButtonTooltip as aH,DynamicButtonLabel as aI,IsSidebarContext as aJ,Placement as aK,getGray90 as aL,getIncreasingGreen as aM,getDecreasingRed as aN,PlotlyChart$1 as aO,keysToSnakeCase as aP,WindowDimensionsContext as aQ,Video$1 as aR,zip$1 as aS,FileUploaderState as aT,UploadedFileInfo as aU,StyledSpinner as aV,ENABLE_PERIPHERALS_DOCS_URL as aW,Icon$2 as aX,BaseButton as aY,blend as aZ,labelVisibilityProtoValueToEnum as a_,IndexTypeName as aa,_baseMerge as ab,_createAssigner as ac,getGray70 as ad,getGray30 as ae,getCategoricalColorsArray as af,getDivergingColorsArray as ag,getSequentialColorsArray as ah,getBlue80 as ai,Global as aj,ensureError as ak,withTheme as al,DynamicIcon as am,toaster as an,Kind as ao,AlertElement as ap,_assertThisInitialized$e as aq,StyledInlineCode as ar,ErrorElement as as,axios as at,Skeleton$1 as au,Skeleton as av,hoistNonReactStatics$2 as aw,lib$3 as ax,parseToRgba as ay,DeckGlJsonChart$1 as az,reactDomExports as b,ThemeProvider$1 as b$,WidgetLabel as b0,Tooltip as b1,styled as b2,getOverrides as b3,LocaleContext as b4,ButtonGroup$1 as b5,LabelVisibilityMessage as b6,StyledWidgetLabelHelpInline as b7,themeColors as b8,isMobile_1 as b9,classNames as bA,UISelectbox as bB,isValidFormId as bC,toPropertyKey as bD,_setPrototypeOf$e as bE,hexToRgb as bF,withWrapper as bG,StyledWidgetInstructions as bH,isFromMac as bI,CUSTOM_INPUT_TYPE as bJ,SIZE$1 as bK,DeleteAlt$1 as bL,ADJOINED as bM,filterOptions as bN,ENHANCER_POSITION as bO,pick$1 as bP,Slider$2 as bQ,isFromWindows as bR,__awaiter as bS,__generator as bT,__spread as bU,PropTypes as bV,ChevronLeft as bW,ChevronRight as bX,isInForm as bY,toString_1 as bZ,TextInput$1 as b_,CAMERA_PERMISSION_URL as ba,StyledWidgetLabelHelp as bb,isFocusVisible as bc,getOverride as bd,getOverrideProps as be,Checkbox$1 as bf,StyledContent as bg,StyledCheckbox$1 as bh,BaseColorPicker as bi,useStyletron as bj,mergeOverride as bk,toObjectOverride as bl,Icon$1 as bm,UIDConsumer as bn,StatefulMenu as bo,mergeOverrides as bp,ChevronDown$1 as bq,ThemeContext as br,forkFocus as bs,forkBlur as bt,Select as bu,without$1 as bv,fuzzyFilterSelectOptions as bw,TYPE as bx,VirtualDropdown as by,isPresetTheme as bz,_hasPath as c,createThemedStyled as c0,createThemedUseStyletron as c1,createThemedWithStyle as c2,expandBorderStyles as c3,withStyle as c4,reactIsExports$1 as c5,NumberInput$1 as c6,commonjsGlobal$1 as d,classnamesExports as e,_root as f,getDefaultExportFromCjs$1 as g,isObject_1 as h,isPropValid as i,jsx$1 as j,keyframes as k,_Set as l,_setToArray as m,newStyled as n,_SetCache as o,propTypesExports as p,_arrayIncludes as q,reactExports as r,_arrayIncludesWith as s,toNumber_1 as t,_cacheHas as u,groupBy$1 as v,__vitePreload as w,flatten$2 as x,require$$0 as y,toString$9 as z};