import{z as c,r as a,j as o,o as u,ak as g,Y as f,q as S}from"./index.Drusyo5m.js";const x=c("div",{target:"e1l5y6pi0"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=c("div",{target:"e1l5y6pi1"})(({theme:e})=>({display:"flex",alignItems:"center",width:"100%",gap:e.spacing.sm})),$=c("div",{target:"e1l5y6pi2"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"})),h=c("span",{target:"e1l5y6pi3"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.none,whiteSpace:"nowrap"})),y=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const p=`${t} minute${t===1?"":"s"}`,d=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${p}${d})`}const l=`${n} hour${n===1?"":"s"}`,i=t===0?"":`, ${t} minute${t===1?"":"s"}`,r=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${i}${r})`};function w({element:e}){const{cache:n,showTime:t}=e,[s,l]=a.useState(0),i=a.useRef(null);return a.useEffect(()=>{if(!t)return;i.current=Date.now();const r=()=>{if(i.current!==null){const m=(Date.now()-i.current)/1e3;l(m)}};r();const p=setInterval(r,100);return()=>clearInterval(p)},[t]),o(x,{className:g({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:u(T,{children:[o(f,{size:"lg",iconValue:"spinner"}),u($,{children:[o(S,{source:e.text,allowHTML:!1}),t&&o(h,{children:y(s)})]})]})})}const v=a.memo(w);export{v as default};
