import{r as t,d as i,c as s,k as e,h as a,e as n}from"./p-8e32a29b.js";import{g as h,P as o}from"./p-e38e590d.js";import{a as r,d as c}from"./p-8a939906.js";import{t as l}from"./p-afa29539.js";const d=class{constructor(e){t(this,e),this.animationEnabled=!0,this.mode=i(this),this.animated=!0,this.ionNavWillLoad=s(this,"ionNavWillLoad",7),this.ionNavWillChange=s(this,"ionNavWillChange",3),this.ionNavDidChange=s(this,"ionNavDidChange",3)}swipeHandlerChanged(){this.gesture&&this.gesture.setDisabled(void 0===this.swipeHandler)}async connectedCallback(){this.gesture=(await __sc_import_dos_wc_library("./p-5c285b20.js")).createSwipeBackGesture(this.el,()=>!!this.swipeHandler&&this.swipeHandler.canStart()&&this.animationEnabled,()=>this.swipeHandler&&this.swipeHandler.onStart(),t=>this.ani&&this.ani.progressStep(t),(t,i,s)=>{if(this.ani){this.animationEnabled=!1,this.ani.onFinish(()=>{this.animationEnabled=!0,this.swipeHandler&&this.swipeHandler.onEnd(t)},{oneTimeCallback:!0});let e=t?-.001:.001;t?e+=h(new o(0,0),new o(.32,.72),new o(0,1),new o(1,1),i):(this.ani.easing("cubic-bezier(1, 0, 0.68, 0.28)"),e+=h(new o(0,0),new o(1,0),new o(.68,.28),new o(1,1),i)),this.ani.progressEnd(t?1:0,e,s)}}),this.swipeHandlerChanged()}componentWillLoad(){this.ionNavWillLoad.emit()}disconnectedCallback(){this.gesture&&(this.gesture.destroy(),this.gesture=void 0)}async commit(t,i,s){const e=await this.lock();let a=!1;try{a=await this.transition(t,i,s)}catch(t){console.error(t)}return e(),a}async setRouteId(t,i,s){return{changed:await this.setRoot(t,i,{duration:"root"===s?0:void 0,direction:"back"===s?"back":"forward"}),element:this.activeEl}}async getRouteId(){const t=this.activeEl;return t?{id:t.tagName,element:t}:void 0}async setRoot(t,i,s){if(this.activeComponent===t)return!1;const e=this.activeEl,a=await r(this.delegate,this.el,t,["ion-page","ion-page-invisible"],i);return this.activeComponent=t,this.activeEl=a,await this.commit(a,e,s),await c(this.delegate,e),!0}async transition(t,i,s={}){if(i===t)return!1;this.ionNavWillChange.emit();const{el:a,mode:n}=this,h=this.animated&&e.getBoolean("animated",!0),o=this.animation||s.animationBuilder||e.get("navAnimation");return await l(Object.assign({mode:n,animated:h,animationBuilder:o,enteringEl:t,leavingEl:i,baseEl:a,progressCallback:s.progressAnimation?t=>this.ani=t:void 0},s)),this.ionNavDidChange.emit(),!0}async lock(){const t=this.waitPromise;let i;return this.waitPromise=new Promise(t=>i=t),void 0!==t&&await t,i}render(){return a("slot",null)}get el(){return n(this)}static get watchers(){return{swipeHandler:["swipeHandlerChanged"]}}static get style(){return":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}"}};export{d as ion_router_outlet};