1234 |
- /*!
- * (C) Ionic http://ionicframework.com - MIT License
- */
- import{d as e}from"./p-17e21141.js";import{w as o}from"./p-7b30edcc.js";let t;const i=(e,o,i)=>{const n=o.startsWith("animation")?(r=e,void 0===t&&(t=void 0===r.style.animationName&&void 0!==r.style.webkitAnimationName?"-webkit-":""),t):"";var r;e.style.setProperty(n+o,i)},n=(e=[],o)=>{if(void 0!==o){const t=Array.isArray(o)?o:[o];return[...e,...t]}return e},r=t=>{let r,a,s,d,l,f,c,v,m,u,p,y=[],g=[],A=[],b=!1,C={},E=[],h=[],S={},k=0,R=!1,w=!1,T=!0,D=!1,F=!0,W=!1;const j=t,I=[],K=[],M=[],x=[],P=[],q=[],z=[],B=[],G=[],H=[],J=[],L="function"==typeof AnimationEffect||void 0!==o&&"function"==typeof o.AnimationEffect,N="function"==typeof Element&&"function"==typeof Element.prototype.animate&&L,O=()=>J,Q=(e,o)=>{const t=o.findIndex((o=>o.c===e));t>-1&&o.splice(t,1)},U=(e,o)=>(((null==o?void 0:o.oneTimeCallback)?K:I).push({c:e,o}),p),V=()=>{N&&(J.forEach((e=>{e.cancel()})),J.length=0)},X=()=>{q.forEach((e=>{(null==e?void 0:e.parentNode)&&e.parentNode.removeChild(e)})),q.length=0},Y=()=>void 0!==l?l:c?c.getFill():"both",Z=()=>void 0!==v?v:void 0!==f?f:c?c.getDirection():"normal",$=()=>R?"linear":void 0!==s?s:c?c.getEasing():"linear",_=()=>w?0:void 0!==m?m:void 0!==a?a:c?c.getDuration():0,ee=()=>void 0!==d?d:c?c.getIterations():1,oe=()=>void 0!==u?u:void 0!==r?r:c?c.getDelay():0,te=()=>{0!==k&&(k--,0===k&&((()=>{G.forEach((e=>e())),H.forEach((e=>e()));const e=T?1:0,o=E,t=h,n=S;x.forEach((e=>{const r=e.classList;o.forEach((e=>r.add(e))),t.forEach((e=>r.remove(e)));for(const o in n)n.hasOwnProperty(o)&&i(e,o,n[o])})),m=void 0,v=void 0,u=void 0,I.forEach((o=>o.c(e,p))),K.forEach((o=>o.c(e,p))),K.length=0,F=!0,T&&(D=!0),T=!0})(),c&&c.animationFinish()))},ie=()=>{(()=>{z.forEach((e=>e())),B.forEach((e=>e()));const e=g,o=A,t=C;x.forEach((n=>{const r=n.classList;e.forEach((e=>r.add(e))),o.forEach((e=>r.remove(e)));for(const e in t)t.hasOwnProperty(e)&&i(n,e,t[e])}))})(),y.length>0&&N&&(x.forEach((e=>{const o=e.animate(y,{id:j,delay:oe(),duration:_(),easing:$(),iterations:ee(),fill:Y(),direction:Z()});o.pause(),J.push(o)})),J.length>0&&(J[0].onfinish=()=>{te()})),b=!0},ne=e=>{e=Math.min(Math.max(e,0),.9999),N&&J.forEach((o=>{o.currentTime=o.effect.getComputedTiming().delay+_()*e,o.pause()}))},re=e=>{J.forEach((e=>{e.effect.updateTiming({delay:oe(),duration:_(),easing:$(),iterations:ee(),fill:Y(),direction:Z()})})),void 0!==e&&ne(e)},ae=(e=!1,o=!0,t)=>(e&&P.forEach((i=>{i.update(e,o,t)})),N&&re(t),p),se=()=>{b&&(N?J.forEach((e=>{e.pause()})):x.forEach((e=>{i(e,"animation-play-state","paused")})),W=!0)},de=e=>new Promise((o=>{(null==e?void 0:e.sync)&&(w=!0,U((()=>w=!1),{oneTimeCallback:!0})),b||ie(),D&&(N&&(ne(0),re()),D=!1),F&&(k=P.length+1,F=!1);const t=()=>{Q(i,K),o()},i=()=>{Q(t,M),o()};U(i,{oneTimeCallback:!0}),M.push({c:t,o:{oneTimeCallback:!0}}),P.forEach((e=>{e.play()})),N?(J.forEach((e=>{e.play()})),0!==y.length&&0!==x.length||te()):te(),W=!1})),le=(e,o)=>{const t=y[0];return void 0===t||void 0!==t.offset&&0!==t.offset?y=[{offset:0,[e]:o},...y]:t[e]=o,p};return p={parentAnimation:c,elements:x,childAnimations:P,id:j,animationFinish:te,from:le,to:(e,o)=>{const t=y[y.length-1];return void 0===t||void 0!==t.offset&&1!==t.offset?y=[...y,{offset:1,[e]:o}]:t[e]=o,p},fromTo:(e,o,t)=>le(e,o).to(e,t),parent:e=>(c=e,p),play:de,pause:()=>(P.forEach((e=>{e.pause()})),se(),p),stop:()=>{P.forEach((e=>{e.stop()})),b&&(V(),b=!1),R=!1,w=!1,F=!0,v=void 0,m=void 0,u=void 0,k=0,D=!1,T=!0,W=!1,M.forEach((e=>e.c(0,p))),M.length=0},destroy:e=>(P.forEach((o=>{o.destroy(e)})),(e=>{V(),e&&X()})(e),x.length=0,P.length=0,y.length=0,I.length=0,K.length=0,b=!1,F=!0,p),keyframes:e=>{const o=y!==e;return y=e,o&&(e=>{N&&O().forEach((o=>{const t=o.effect;if(t.setKeyframes)t.setKeyframes(e);else{const i=new KeyframeEffect(t.target,e,t.getTiming());o.effect=i}}))})(y),p},addAnimation:e=>{if(null!=e)if(Array.isArray(e))for(const o of e)o.parent(p),P.push(o);else e.parent(p),P.push(e);return p},addElement:o=>{if(null!=o)if(1===o.nodeType)x.push(o);else if(o.length>=0)for(let e=0;e<o.length;e++)x.push(o[e]);else e("createAnimation - Invalid addElement value.");return p},update:ae,fill:e=>(l=e,ae(!0),p),direction:e=>(f=e,ae(!0),p),iterations:e=>(d=e,ae(!0),p),duration:e=>(N||0!==e||(e=1),a=e,ae(!0),p),easing:e=>(s=e,ae(!0),p),delay:e=>(r=e,ae(!0),p),getWebAnimations:O,getKeyframes:()=>y,getFill:Y,getDirection:Z,getDelay:oe,getIterations:ee,getEasing:$,getDuration:_,afterAddRead:e=>(G.push(e),p),afterAddWrite:e=>(H.push(e),p),afterClearStyles:(e=[])=>{for(const o of e)S[o]="";return p},afterStyles:(e={})=>(S=e,p),afterRemoveClass:e=>(h=n(h,e),p),afterAddClass:e=>(E=n(E,e),p),beforeAddRead:e=>(z.push(e),p),beforeAddWrite:e=>(B.push(e),p),beforeClearStyles:(e=[])=>{for(const o of e)C[o]="";return p},beforeStyles:(e={})=>(C=e,p),beforeRemoveClass:e=>(A=n(A,e),p),beforeAddClass:e=>(g=n(g,e),p),onFinish:U,isRunning:()=>0!==k&&!W,progressStart:(e=!1,o)=>(P.forEach((t=>{t.progressStart(e,o)})),se(),R=e,b||ie(),ae(!1,!0,o),p),progressStep:e=>(P.forEach((o=>{o.progressStep(e)})),ne(e),p),progressEnd:(e,o,t)=>(R=!1,P.forEach((i=>{i.progressEnd(e,o,t)})),void 0!==t&&(m=t),D=!1,T=!0,0===e?(v="reverse"===Z()?"normal":"reverse","reverse"===v&&(T=!1),N?(ae(),ne(1-o)):(u=(1-o)*_()*-1,ae(!1,!1))):1===e&&(N?(ae(),ne(o)):(u=o*_()*-1,ae(!1,!1))),void 0===e||c||de(),p)}};export{r as c}
|