UNPKG

@tindtechnologies/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

1 lines 9.96 kB
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[6653],{6653:(n,t,i)=>{i.d(t,{c:()=>f});var e=i(884),o=function(n,t,i){n.style.setProperty(t,i)},r=function(n,t){n.style.removeProperty(t)},a=[],u=function(n,t){if(void 0===n&&(n=[]),void 0!==t){var i=Array.isArray(t)?t:[t];return n.concat(i)}return n},f=function(){var n,t,i,f,c,l,s,d,m,h,v,p,g,y=[],E=[],A=[],b=!1,w={},S=[],C=[],T={},k=0,_=!1,x=!1,D=!0,F=!1,q=!0,L=[],R=[],P=[],M=[],O=[],I=[],N=[],U=[],W=[],X=[],j="function"==typeof AnimationEffect||"function"==typeof window.AnimationEffect,z="function"==typeof Element&&"function"==typeof Element.prototype.animate&&j,V=function(n,t){return(t&&t.oneTimeCallback?R:L).push({c:n,o:t}),g},Y=function(){if(z)X.forEach((function(n){n.cancel()})),X.length=0;else{var n=P.slice();(0,e.a)((function(){n.forEach((function(n){r(n,"animation-name"),r(n,"animation-duration"),r(n,"animation-timing-function"),r(n,"animation-iteration-count"),r(n,"animation-delay"),r(n,"animation-play-state"),r(n,"animation-fill-mode"),r(n,"animation-direction")}))}))}},K=function(){O.forEach((function(n){n&&n.parentNode&&n.parentNode.removeChild(n)})),O.length=0},B=function(){return void 0!==c?c:s?s.getFill():"both"},G=function(){return void 0!==m?m:void 0!==l?l:s?s.getDirection():"normal"},H=function(){return _?"linear":void 0!==i?i:s?s.getEasing():"linear"},J=function(){return x?0:void 0!==h?h:void 0!==t?t:s?s.getDuration():0},Q=function(){return void 0!==f?f:s?s.getIterations():1},Z=function(){return void 0!==v?v:void 0!==n?n:s?s.getDelay():0},$=function(){0!==k&&0==--k&&(function(){var n,t,i;un(),U.forEach((function(n){n()})),W.forEach((function(n){n()})),n=S,t=C,i=T,P.forEach((function(e){var r=e.classList;for(var a in n.forEach((function(n){return r.add(n)})),t.forEach((function(n){return r.remove(n)})),i)i.hasOwnProperty(a)&&o(e,a,i[a])}));var e=D?1:0;L.forEach((function(n){return n.c(e,g)})),R.forEach((function(n){return n.c(e,g)})),R.length=0,q=!0,F=!0}(),s&&s.animationFinish())},nn=function(n){var t,i,r;void 0===n&&(n=!0),I.forEach((function(n){n()})),N.forEach((function(n){n()})),t=E,i=A,r=w,P.forEach((function(n){var e=n.classList;for(var a in t.forEach((function(n){return e.add(n)})),i.forEach((function(n){return e.remove(n)})),r)r.hasOwnProperty(a)&&o(n,a,r[a])})),y.length>0&&(z?(P.forEach((function(n){var t=n.animate(y,{delay:Z(),duration:J(),easing:H(),iterations:Q(),fill:B(),direction:G()});t.pause(),X.push(t)})),X.length>0&&(X[0].onfinish=function(){$()})):function(n){void 0===n&&(n=!0),K(),P.forEach((function(t){if(y.length>0){var i=(void 0===(f=y)&&(f=[]),f.map((function(n){var t=n.offset,i=[];for(var e in n)n.hasOwnProperty(e)&&"offset"!==e&&i.push(e+": "+n[e]+";");return 100*t+"% { "+i.join(" ")+" }"})).join(" "));p=function(n){var t=a.indexOf(n);return t<0&&(t=a.push(n)-1),"ion-animation-"+t}(i);var r=function(n,t,i){var e=function(n){var t=n.getRootNode();return t.head||t}(i),o=e.querySelector("#"+n);if(o)return o;var r=(i.ownerDocument||document).createElement("style");return r.id=n,r.textContent="@keyframes "+n+" { "+t+" } @keyframes "+n+"-alt { "+t+" }",e.appendChild(r),r}(p,i,t);O.push(r),o(t,"animation-duration",J()+"ms"),o(t,"animation-timing-function",H()),o(t,"animation-delay",Z()+"ms"),o(t,"animation-fill-mode",B()),o(t,"animation-direction",G());var u=Q()===1/0?"infinite":Q().toString();o(t,"animation-iteration-count",u),o(t,"animation-play-state","paused"),n&&o(t,"animation-name",r.id+"-alt"),(0,e.a)((function(){o(t,"animation-name",r.id||null)}))}var f}))}(n)),b=!0},tn=function(n){if(n=Math.min(Math.max(n,0),.999),z)X.forEach((function(t){t.currentTime=t.effect.getComputedTiming().delay+J()*n,t.pause()}));else{var t="-"+((Z()||0)+J()*n)+"ms";P.forEach((function(n){y.length>0&&(o(n,"animation-delay",t),o(n,"animation-play-state","paused"))}))}},en=function(n){void 0===n&&(n=!0),P.forEach((function(t){(0,e.a)((function(){o(t,"animation-name",p||null),o(t,"animation-duration",J()+"ms"),o(t,"animation-timing-function",H()),o(t,"animation-delay",Z()+"ms"),o(t,"animation-fill-mode",B()||null),o(t,"animation-direction",G()||null);var i=Q()===1/0?"infinite":Q().toString();o(t,"animation-iteration-count",i),n&&o(t,"animation-name",p+"-alt"),(0,e.a)((function(){o(t,"animation-name",p||null)}))}))}))},on=function(n,t){return void 0===n&&(n=!1),void 0===t&&(t=!0),n&&M.forEach((function(t){t.update(n)})),z?X.forEach((function(n){n.effect.updateTiming({delay:Z(),duration:J(),easing:H(),iterations:Q(),fill:B(),direction:G()})})):en(t),g},rn=function(){b&&(z?X.forEach((function(n){n.pause()})):P.forEach((function(n){o(n,"animation-play-state","paused")})))},an=function(){d=void 0,$()},un=function(){d&&clearTimeout(d)},fn=function(n){return new Promise((function(t){n&&n.sync&&(x=!0,V((function(){return x=!1}),{oneTimeCallback:!0})),b||nn(),F&&(z?tn(0):en(),F=!1),q&&(k=M.length+1,q=!1),V((function(){return t()}),{oneTimeCallback:!0}),M.forEach((function(n){n.play()})),z?(X.forEach((function(n){n.play()})),0!==y.length&&0!==P.length||$()):function(){if(un(),P.forEach((function(n){y.length>0&&(0,e.a)((function(){o(n,"animation-play-state","running")}))})),0===y.length||0===P.length)$();else{var n=Z()||0,t=J()||0,i=Q()||1;d=setTimeout(an,n+t*i+100),a=P[0],u=function(){un(),(0,e.a)((function(){P.forEach((function(n){r(n,"animation-duration"),r(n,"animation-delay"),r(n,"animation-play-state")})),(0,e.a)($)}))},c={passive:!0},l=function(){f&&f()},s=function(n){a===n.target&&(l(),u())},a&&(a.addEventListener("webkitAnimationEnd",s,c),a.addEventListener("animationend",s,c),f=function(){a.removeEventListener("webkitAnimationEnd",s,c),a.removeEventListener("animationend",s,c)})}var a,u,f,c,l,s}()}))},cn=function(n,t){var i,e=y[0];return void 0!==e&&0===e.offset?e[n]=t:y=[(i={offset:0},i[n]=t,i)].concat(y),g};return g={parentAnimation:s,elements:P,childAnimations:M,animationFinish:$,from:cn,to:function(n,t){var i,e=y[y.length-1];return void 0!==e&&1===e.offset?e[n]=t:y=y.concat([(i={offset:1},i[n]=t,i)]),g},fromTo:function(n,t,i){return cn(n,t).to(n,i)},parent:function(n){return s=n,g},play:fn,playAsync:function(){return fn()},playSync:function(){return fn({sync:!0}),g},pause:function(){return M.forEach((function(n){n.pause()})),rn(),g},stop:function(){M.forEach((function(n){n.stop()})),b&&(Y(),b=!1)},destroy:function(){return M.forEach((function(n){n.destroy()})),Y(),K(),P.length=0,M.length=0,y.length=0,L.length=0,R.length=0,b=!1,q=!0,g},keyframes:function(n){return y=n,g},addAnimation:function(n){if(null!=n)if(Array.isArray(n))for(var t=0,i=n;t<i.length;t++){var e=i[t];e.parent(g),M.push(e)}else n.parent(g),M.push(n);return g},addElement:function(n){if(null!=n)if(1===n.nodeType)P.push(n);else if(n.length>=0)for(var t=0;t<n.length;t++)P.push(n[t]);else console.error("Invalid addElement value");return g},update:on,fill:function(n){return c=n,on(!0),g},direction:function(n){return l=n,on(!0),g},iterations:function(n){return f=n,on(!0),g},duration:function(n){return z||0!==n||(n=1),t=n,on(!0),g},easing:function(n){return i=n,on(!0),g},delay:function(t){return n=t,on(!0),g},getWebAnimations:function(){return X},getKeyframes:function(){return y},getFill:B,getDirection:G,getDelay:Z,getIterations:Q,getEasing:H,getDuration:J,afterAddRead:function(n){return U.push(n),g},afterAddWrite:function(n){return W.push(n),g},afterClearStyles:function(n){void 0===n&&(n=[]);for(var t=0,i=n;t<i.length;t++){var e=i[t];T[e]=""}return g},afterStyles:function(n){return void 0===n&&(n={}),T=n,g},afterRemoveClass:function(n){return C=u(C,n),g},afterAddClass:function(n){return S=u(S,n),g},beforeAddRead:function(n){return I.push(n),g},beforeAddWrite:function(n){return N.push(n),g},beforeClearStyles:function(n){void 0===n&&(n=[]);for(var t=0,i=n;t<i.length;t++){var e=i[t];w[e]=""}return g},beforeStyles:function(n){return void 0===n&&(n={}),w=n,g},beforeRemoveClass:function(n){return A=u(A,n),g},beforeAddClass:function(n){return E=u(E,n),g},onFinish:V,progressStart:function(n){return void 0===n&&(n=!1),M.forEach((function(t){t.progressStart(n)})),rn(),_=n,b?(on(),tn(0)):nn(),g},progressStep:function(n){return M.forEach((function(t){t.progressStep(n)})),tn(n),g},progressEnd:function(n,t,i){return _=!1,M.forEach((function(e){e.progressEnd(n,t,i)})),void 0!==i&&(h=i),F=!1,(D=1===n)?z||(v=t*J()*-1,on(!1,!1)):(m="reverse"===G()?"normal":"reverse",z?(on(),tn(1-t)):(v=(1-t)*J()*-1,on(!1,!1))),V((function(){D=!0,h=void 0,m=void 0,v=void 0}),{oneTimeCallback:!0}),s||fn(),g}}}},884:(n,t,i)=>{i.d(t,{a:()=>e,b:()=>f,c:()=>u,d:()=>d,e:()=>m,f:()=>r,h:()=>o,i:()=>s,n:()=>c,p:()=>l,r:()=>a});var e=function(n){return"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(n):"function"==typeof requestAnimationFrame?requestAnimationFrame(n):setTimeout(n)},o=function(n){return!!n.shadowRoot&&!!n.attachShadow},r=function(n){var t=n.closest("ion-item");return t?t.querySelector("ion-label"):null},a=function(n,t,i,e,r){if(n||o(t)){var a=t.querySelector("input.aux-input");a||((a=t.ownerDocument.createElement("input")).type="hidden",a.classList.add("aux-input"),t.appendChild(a)),a.disabled=r,a.name=i,a.value=e||""}},u=function(n,t,i){return Math.max(n,Math.min(t,i))},f=function(n,t){if(!n){var i="ASSERT: "+t;throw console.error(i),new Error(i)}},c=function(n){return n.timeStamp||Date.now()},l=function(n){if(n){var t=n.changedTouches;if(t&&t.length>0){var i=t[0];return{x:i.clientX,y:i.clientY}}if(void 0!==n.pageX)return{x:n.pageX,y:n.pageY}}return{x:0,y:0}},s=function(n){var t="rtl"===document.dir;switch(n){case"start":return t;case"end":return!t;default:throw new Error('"'+n+'" is not a valid value for [side]. Use "start" or "end" instead.')}},d=function(n,t){var i=n._original||n;return{_original:n,emit:m(i.emit.bind(i),t)}},m=function(n,t){var i;return void 0===t&&(t=0),function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];clearTimeout(i),i=setTimeout.apply(void 0,[n,t].concat(e))}}}}]);