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.DsRKNFfx.js";import"./protobuf.DC2L68b9.js";import{n as i}from"./types.cZoyy9Y-.js";import{t as a}from"./useEmotionTheme.D29Ufy6b.js";import{t as o}from"./toastQueue.CEO36h9N.js";import{i as s}from"./ErrorElement.BWmlOcKX.js";import{t as c}from"./AlertElement.BAyMiYwt.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};