import{r as s,i as t,f as e,h as n,H as r}from"./p-5ab6b26f.js";import{c as i}from"./p-20d65ce5.js";const a={lines:{dur:1e3,lines:12,fn:(s,t,e)=>({y1:17,y2:29,style:{transform:`rotate(${30*t+(t<6?180:-180)}deg)`,"animation-delay":`${s*t/e-s}ms`}})},"lines-small":{dur:1e3,lines:12,fn:(s,t,e)=>({y1:12,y2:20,style:{transform:`rotate(${30*t+(t<6?180:-180)}deg)`,"animation-delay":`${s*t/e-s}ms`}})},bubbles:{dur:1e3,circles:9,fn:(s,t,e)=>{const n=`${s*t/e-s}ms`,r=2*Math.PI*t/e;return{r:5,style:{top:`${9*Math.sin(r)}px`,left:`${9*Math.cos(r)}px`,"animation-delay":n}}}},circles:{dur:1e3,circles:8,fn:(s,t,e)=>{const n=t/e,r=`${s*n-s}ms`,i=2*Math.PI*n;return{r:5,style:{top:`${9*Math.sin(i)}px`,left:`${9*Math.cos(i)}px`,"animation-delay":r}}}},crescent:{dur:750,circles:1,fn:()=>({r:26,style:{}})},dots:{dur:750,circles:3,fn:(s,t)=>({r:6,style:{left:`${9-9*t}px`,"animation-delay":-110*t+"ms"}})}};class o{constructor(t){s(this,t),this.paused=!1}getName(){const s=this.name||t.get("spinner"),n=e(this);return s||("ios"===n?"lines":"crescent")}hostData(){const s=e(this);return{class:Object.assign({},i(this.color),{[s]:!0,[`spinner-${this.getName()}`]:!0,"spinner-paused":!!this.paused||t.getBoolean("_testing")})}}__stencil_render(){const s=this.getName(),t=a[s]||a.lines,e="number"==typeof this.duration&&this.duration>10?this.duration:t.dur,n=[];if(void 0!==t.circles)for(let s=0;s<t.circles;s++)n.push(l(t,e,s,t.circles));else if(void 0!==t.lines)for(let s=0;s<t.lines;s++)n.push(c(t,e,s,t.lines));return n}render(){return n(r,this.hostData(),this.__stencil_render())}static get style(){return":host{display:inline-block;position:relative;width:28px;height:28px;color:var(--color);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.ion-color){color:var(--ion-color-base)}svg{left:0;top:0;-webkit-transform-origin:center;transform-origin:center;position:absolute;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0)}:host-context([dir=rtl]) svg,[dir=rtl] svg{left:unset;right:unset;right:0;-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}:host(.spinner-lines) line,:host(.spinner-lines-small) line{stroke-width:4px;stroke-linecap:round;stroke:currentColor}:host(.spinner-lines) svg,:host(.spinner-lines-small) svg{-webkit-animation:spinner-fade-out 1s linear infinite;animation:spinner-fade-out 1s linear infinite}:host(.spinner-bubbles) svg{-webkit-animation:spinner-scale-out 1s linear infinite;animation:spinner-scale-out 1s linear infinite;fill:currentColor}:host(.spinner-circles) svg{-webkit-animation:spinner-fade-out 1s linear infinite;animation:spinner-fade-out 1s linear infinite;fill:currentColor}:host(.spinner-crescent) circle{fill:transparent;stroke-width:4px;stroke-dasharray:128px;stroke-dashoffset:82px;stroke:currentColor}:host(.spinner-crescent) svg{-webkit-animation:spinner-rotate 1s linear infinite;animation:spinner-rotate 1s linear infinite}:host(.spinner-dots) circle{stroke-width:0;fill:currentColor}:host(.spinner-dots) svg{-webkit-animation:spinner-dots 1s linear infinite;animation:spinner-dots 1s linear infinite}:host(.spinner-paused) svg{-webkit-animation-play-state:paused;animation-play-state:paused}\@-webkit-keyframes spinner-fade-out{0%{opacity:1}to{opacity:0}}\@keyframes spinner-fade-out{0%{opacity:1}to{opacity:0}}\@-webkit-keyframes spinner-scale-out{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(0);transform:scale(0)}}\@keyframes spinner-scale-out{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(0);transform:scale(0)}}\@-webkit-keyframes spinner-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}\@keyframes spinner-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}\@-webkit-keyframes spinner-dots{0%{-webkit-transform:scale(1);transform:scale(1);opacity:.9}50%{-webkit-transform:scale(.4);transform:scale(.4);opacity:.3}to{-webkit-transform:scale(1);transform:scale(1);opacity:.9}}\@keyframes spinner-dots{0%{-webkit-transform:scale(1);transform:scale(1);opacity:.9}50%{-webkit-transform:scale(.4);transform:scale(.4);opacity:.3}to{-webkit-transform:scale(1);transform:scale(1);opacity:.9}}"}}const l=(s,t,e,r)=>{const i=s.fn(t,e,r);return i.style["animation-duration"]=`${t}ms`,n("svg",{viewBox:"0 0 64 64",style:i.style},n("circle",{transform:"translate(32,32)",r:i.r}))},c=(s,t,e,r)=>{const i=s.fn(t,e,r);return i.style["animation-duration"]=`${t}ms`,n("svg",{viewBox:"0 0 64 64",style:i.style},n("line",{transform:"translate(32,32)",y1:i.y1,y2:i.y2}))};export{o as ion_spinner};