import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n,r}from"./emotion-styled.browser.esm.C7ab1lZK.js";import"./protobuf.CBn3jIav.js";import{n as i}from"./types.cZoyy9Y-.js";import{t as a}from"./useEmotionTheme.BIIZ9T_O.js";import{t as o}from"./toastQueue.CEO36h9N.js";import{i as s}from"./ErrorElement.CD9rg9H1.js";import{t as c}from"./AlertElement.i0agV2UI.js";var l=e(t(),1);function u({element:e}){let{body:t,icon:u,duration:d}=e,f=a();(0,l.useEffect)(()=>{if(f.inSidebar)return;let e=i(d)?d===0?void 0:d*1e3:4e3,n=o.add({body:t,icon:u||void 0},{timeout:e});return()=>{o.close(n)}},[]);let p=n(c,{kind:s.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return n(r,{children:f.inSidebar&&p})}var d=(0,l.memo)(u);export{d as default};