import{o as e}from"./rolldown-runtime.C0FnF6B9.js";import{r as t}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{a as n,i as r,t as i}from"./emotion-styled.browser.esm.Dj5rZcu_.js";import{r as a}from"./StreamlitMarkdown.DYzuPhFL.js";import{t as o}from"./DynamicIcon.CshBYn8E.js";var s=e(t(),1),c=i(`div`,{target:`e1dfnxdh0`})(({theme:e,cache:t})=>({...t?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),l=i(`div`,{target:`e1dfnxdh1`})(({theme:e})=>({display:`flex`,alignItems:`center`,width:`100%`,gap:e.spacing.sm})),u=i(`div`,{target:`e1dfnxdh2`})(({theme:e})=>({display:`flex`,gap:e.spacing.sm,alignItems:`baseline`})),d=i(`span`,{target:`e1dfnxdh3`})(({theme:e})=>({opacity:e.opacities.secondary,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.none,whiteSpace:`nowrap`})),f=e=>{let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return t===0&&n===0?`(${r.toFixed(1)} seconds)`:t===0?`(${`${n} minute${n===1?``:`s`}`}${r===0?``:`, ${r.toFixed(1)} seconds`})`:`(${`${t} hour${t===1?``:`s`}`}${n===0?``:`, ${n} minute${n===1?``:`s`}`}${r===0?``:`, ${r.toFixed(1)} seconds`})`};function p({element:e}){let{cache:t,showTime:i}=e,[p,m]=(0,s.useState)(0),h=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!i)return;h.current=Date.now();let e=()=>{if(h.current!==null){let e=(Date.now()-h.current)/1e3;m(e)}};e();let t=setInterval(e,100);return()=>clearInterval(t)},[i]),r(c,{className:t?`stSpinner stCacheSpinner`:`stSpinner`,"data-testid":`stSpinner`,cache:t,children:n(l,{children:[r(o,{size:`lg`,iconValue:`spinner`}),n(u,{children:[r(`div`,{role:`status`,children:r(a,{source:e.text,allowHTML:!1})}),i&&r(d,{children:f(p)})]})]})})}var m=(0,s.memo)(p);export{m as default};