UNPKG

@tindtechnologies/universalviewer

Version:

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

2 lines (1 loc) 5.6 kB
import{a as l,b as g}from"./chunk-JUZN4GG2.js";import{d as w}from"./chunk-LFCA4LRO.js";import{a as b,b as p}from"./chunk-TVVVZZ43.js";import{a as y,e as E,i as v,l as k,n as m,o as C}from"./chunk-VNJCZCB4.js";import"./chunk-L67DAW3A.js";var f=function(o,r,e,a){return new(e||(e=Promise))(function(i,t){function u(n){try{h(a.next(n))}catch(c){t(c)}}function s(n){try{h(a.throw(n))}catch(c){t(c)}}function h(n){n.done?i(n.value):new e(function(c){c(n.value)}).then(u,s)}h((a=a.apply(o,r||[])).next())})},d=function(o,r){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},a,i,t,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(n){return function(c){return h([n,c])}}function h(n){if(a)throw new TypeError("Generator is already executing.");for(;e;)try{if(a=1,i&&(t=n[0]&2?i.return:n[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,n[1])).done)return t;switch(i=0,t&&(n=[n[0]&2,t.value]),n[0]){case 0:case 1:t=n;break;case 4:return e.label++,{value:n[1],done:!1};case 5:e.label++,i=n[1],n=[0];continue;case 7:n=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(n[0]===6||n[0]===2)){e=0;continue}if(n[0]===3&&(!t||n[1]>t[0]&&n[1]<t[3])){e.label=n[1];break}if(n[0]===6&&e.label<t[1]){e.label=t[1],t=n;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(n);break}t[2]&&e.ops.pop(),e.trys.pop();continue}n=r.call(o,e)}catch(c){n=[6,c],i=0}finally{a=t=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},B=function(){function o(r){y(this,r),this.animationEnabled=!0,this.mode=C(this),this.animated=!0,this.ionNavWillLoad=v(this,"ionNavWillLoad",7),this.ionNavWillChange=v(this,"ionNavWillChange",3),this.ionNavDidChange=v(this,"ionNavDidChange",3)}return o.prototype.swipeHandlerChanged=function(){this.gesture&&this.gesture.setDisabled(this.swipeHandler===void 0)},o.prototype.connectedCallback=function(){return f(this,void 0,void 0,function(){var r,e=this;return d(this,function(a){switch(a.label){case 0:return r=this,[4,import("./swipe-back-5ccee2ef-VZEIAALR.js")];case 1:return r.gesture=a.sent().createSwipeBackGesture(this.el,function(){return!!e.swipeHandler&&e.swipeHandler.canStart()&&e.animationEnabled},function(){return e.swipeHandler&&e.swipeHandler.onStart()},function(i){return e.ani&&e.ani.progressStep(i)},function(i,t,u){if(e.ani){e.animationEnabled=!1,e.ani.onFinish(function(){e.animationEnabled=!0,e.swipeHandler&&e.swipeHandler.onEnd(i)},{oneTimeCallback:!0});var s=i?-.001:.001;i?s+=g(new l(0,0),new l(.32,.72),new l(0,1),new l(1,1),t):(e.ani.easing("cubic-bezier(1, 0, 0.68, 0.28)"),s+=g(new l(0,0),new l(1,0),new l(.68,.28),new l(1,1),t)),e.ani.progressEnd(i?1:0,s,u)}}),this.swipeHandlerChanged(),[2]}})})},o.prototype.componentWillLoad=function(){this.ionNavWillLoad.emit()},o.prototype.disconnectedCallback=function(){this.gesture&&(this.gesture.destroy(),this.gesture=void 0)},o.prototype.commit=function(r,e,a){return f(this,void 0,void 0,function(){var i,t,u;return d(this,function(s){switch(s.label){case 0:return[4,this.lock()];case 1:i=s.sent(),t=!1,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.transition(r,e,a)];case 3:return t=s.sent(),[3,5];case 4:return u=s.sent(),console.error(u),[3,5];case 5:return i(),[2,t]}})})},o.prototype.setRouteId=function(r,e,a){return f(this,void 0,void 0,function(){var i;return d(this,function(t){switch(t.label){case 0:return[4,this.setRoot(r,e,{duration:a==="root"?0:void 0,direction:a==="back"?"back":"forward"})];case 1:return i=t.sent(),[2,{changed:i,element:this.activeEl}]}})})},o.prototype.getRouteId=function(){return f(this,void 0,void 0,function(){var r;return d(this,function(e){return r=this.activeEl,[2,r?{id:r.tagName,element:r}:void 0]})})},o.prototype.setRoot=function(r,e,a){return f(this,void 0,void 0,function(){var i,t;return d(this,function(u){switch(u.label){case 0:return this.activeComponent===r?[2,!1]:(i=this.activeEl,[4,b(this.delegate,this.el,r,["ion-page","ion-page-invisible"],e)]);case 1:return t=u.sent(),this.activeComponent=r,this.activeEl=t,[4,this.commit(t,i,a)];case 2:return u.sent(),[4,p(this.delegate,i)];case 3:return u.sent(),[2,!0]}})})},o.prototype.transition=function(r,e,a){return a===void 0&&(a={}),f(this,void 0,void 0,function(){var i,t,u,s,h,n=this;return d(this,function(c){switch(c.label){case 0:return e===r?[2,!1]:(this.ionNavWillChange.emit(),i=this,t=i.el,u=i.mode,s=this.animated&&m.getBoolean("animated",!0),h=this.animation||a.animationBuilder||m.get("navAnimation"),[4,w(Object.assign({mode:u,animated:s,animationBuilder:h,enteringEl:r,leavingEl:e,baseEl:t,progressCallback:a.progressAnimation?function(H){return n.ani=H}:void 0},a))]);case 1:return c.sent(),this.ionNavDidChange.emit(),[2,!0]}})})},o.prototype.lock=function(){return f(this,void 0,void 0,function(){var r,e;return d(this,function(a){switch(a.label){case 0:return r=this.waitPromise,this.waitPromise=new Promise(function(i){return e=i}),r===void 0?[3,2]:[4,r];case 1:a.sent(),a.label=2;case 2:return[2,e]}})})},o.prototype.render=function(){return E("slot",null)},Object.defineProperty(o.prototype,"el",{get:function(){return k(this)},enumerable:!0,configurable:!0}),Object.defineProperty(o,"watchers",{get:function(){return{swipeHandler:["swipeHandlerChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(o,"style",{get:function(){return":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}"},enumerable:!0,configurable:!0}),o}();export{B as ion_router_outlet};