import{n as o,bm as S,i as x,r as u,R as d,j as r,c3 as f,z as g,aE as m}from"./index.qnLB2_zl.js";const $=o(S,{shouldForwardProp:x,target:"e1xotax90"})(({theme:e})=>({fontSize:e.fontSizes.sm,width:e.sizes.spinnerSize,height:e.sizes.spinnerSize,borderWidth:e.sizes.spinnerThickness,justifyContents:"center",padding:e.spacing.none,margin:e.spacing.none,borderColor:e.colors.borderColor,borderTopColor:e.colors.secondary,flexGrow:0,flexShrink:0})),T=o("div",{target:"e1xotax91"})(({theme:e,width:t,cache:n})=>({width:t,...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),h=o("div",{target:"e1xotax92"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),y=o("div",{target:"e1xotax93"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"center",width:"100%"})),z=e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),s=e%60;if(t===0&&n===0)return`(${s.toFixed(1)} seconds)`;if(t===0){const l=`${n} minute${n===1?"":"s"}`,p=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${p})`}const i=`${t} hour${t===1?"":"s"}`,a=n===0?"":`, ${n} minute${n===1?"":"s"}`,c=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${i}${a}${c})`};function b({width:e,element:t}){const{cache:n,showTime:s}=t,[i,a]=d.useState(0);return d.useEffect(()=>{if(!s)return;const c=setInterval(()=>{a(l=>l+.1)},100);return()=>clearInterval(c)},[s]),r(T,{className:f({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",width:e,cache:n,children:g(y,{children:[r($,{}),r(m,{source:t.text,allowHTML:!1}),s&&r(h,{children:z(i)})]})})}const C=u.memo(b);export{C as default};
