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 2.06 kB
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[9678],{9678:(t,e,n)=>{n.r(e),n.d(e,{startTapClick:()=>o});var i=n(884),o=function(t){var e,n,o,f,v=10*-l,p=0,L=t.getBoolean("animated",!0)&&t.getBoolean("rippleEffect",!0),m=new WeakMap,h=function(t){v=(0,i.n)(t),g(t)},E=function(){clearTimeout(f),f=void 0,n&&(S(!1),n=void 0)},w=function(t){n||void 0!==e&&null!==e.parentElement||(e=void 0,k(a(t),t))},g=function(t){k(void 0,t)},k=function(t,e){if(!t||t!==n){clearTimeout(f),f=void 0;var o=(0,i.p)(e),a=o.x,c=o.y;if(n){if(m.has(n))throw new Error("internal error");n.classList.contains(s)||T(n,a,c),S(!0)}if(t){var d=m.get(t);d&&(clearTimeout(d),m.delete(t));var l=r(t)?0:u;t.classList.remove(s),f=setTimeout((function(){T(t,a,c),f=void 0}),l)}n=t}},T=function(t,e,n){p=Date.now(),t.classList.add(s);var i=L&&c(t);i&&i.addRipple&&(b(),o=i.addRipple(e,n))},b=function(){void 0!==o&&(o.then((function(t){return t()})),o=void 0)},S=function(t){b();var e=n;if(e){var i=d-Date.now()+p;if(t&&i>0&&!r(e)){var o=setTimeout((function(){e.classList.remove(s),m.delete(e)}),d);m.set(e,o)}else e.classList.remove(s)}},C=document;C.addEventListener("ionScrollStart",(function(t){e=t.target,E()})),C.addEventListener("ionScrollEnd",(function(){e=void 0})),C.addEventListener("ionGestureCaptured",E),C.addEventListener("touchstart",(function(t){v=(0,i.n)(t),w(t)}),!0),C.addEventListener("touchcancel",h,!0),C.addEventListener("touchend",h,!0),C.addEventListener("mousedown",(function(t){var e=(0,i.n)(t)-l;v<e&&w(t)}),!0),C.addEventListener("mouseup",(function(t){var e=(0,i.n)(t)-l;v<e&&g(t)}),!0)},a=function(t){if(!t.composedPath)return t.target.closest(".ion-activatable");for(var e=t.composedPath(),n=0;n<e.length-2;n++){var i=e[n];if(i.classList&&i.classList.contains("ion-activatable"))return i}},r=function(t){return t.classList.contains("ion-activatable-instant")},c=function(t){if(t.shadowRoot){var e=t.shadowRoot.querySelector("ion-ripple-effect");if(e)return e}return t.querySelector("ion-ripple-effect")},s="activated",u=200,d=200,l=2500}}]);