mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
1 line
9.9 KiB
JavaScript
1 line
9.9 KiB
JavaScript
|
|
(self.webpackChunkgabinete_digital=self.webpackChunkgabinete_digital||[]).push([[5174],{45174:function(t,e,o){"use strict";o.r(e),o.d(e,{ion_route:function(){return a},ion_route_redirect:function(){return h},ion_router:function(){return S},ion_router_link:function(){return D}});var n=o(31667),r=o(36177),i=o(13772),s=o(61269);const a=class{constructor(t){(0,n.r)(this,t),this.ionRouteDataChanged=(0,n.e)(this,"ionRouteDataChanged",7),this.url=""}onUpdate(t){this.ionRouteDataChanged.emit(t)}onComponentProps(t,e){if(t===e)return;const o=t?Object.keys(t):[],n=e?Object.keys(e):[];if(o.length===n.length){for(const n of o)if(t[n]!==e[n])return void this.onUpdate(t)}else this.onUpdate(t)}connectedCallback(){this.ionRouteDataChanged.emit()}static get watchers(){return{url:["onUpdate"],component:["onUpdate"],componentProps:["onComponentProps"]}}},h=class{constructor(t){(0,n.r)(this,t),this.ionRouteRedirectChanged=(0,n.e)(this,"ionRouteRedirectChanged",7)}propDidChange(){this.ionRouteRedirectChanged.emit()}connectedCallback(){this.ionRouteRedirectChanged.emit()}static get watchers(){return{from:["propDidChange"],to:["propDidChange"]}}},c=t=>"/"+t.filter(t=>t.length>0).join("/"),l=t=>{if(null==t)return[""];const e=t.split("?")[0].split("/").map(t=>t.trim()).filter(t=>t.length>0);return 0===e.length?[""]:e},u=async(t,e,o,n,r=!1,i)=>{try{const s=f(t);if(n>=e.length||!s)return r;await s.componentOnReady();const a=e[n],h=await s.setRouteId(a.id,a.params,o,i);return h.changed&&(o="root",r=!0),r=await u(h.element,e,o,n+1,r,i),h.markVisible&&await h.markVisible(),r}catch(s){return console.error(s),!1}},d=":not([no-router]) ion-nav, :not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet",f=t=>{if(t)return t.matches(d)?t:t.querySelector(d)||void 0},g=(t,e)=>e.find(e=>((t,e)=>{const{from:o,to:n}=e;if(void 0===n)return!1;if(o.length>t.length)return!1;for(let r=0;r<o.length;r++){const e=o[r];if("*"===e)return!0;if(e!==t[r])return!1}return o.length===t.length})(t,e)),p=(t,e)=>{const o=Math.min(t.length,e.length);let n=0;for(;n<o&&t[n].toLowerCase()===e[n].id;n++);return n},m=(t,e)=>{const o=new R(t);let n,r=!1;for(let i=0;i<e.length;i++){const t=e[i].path;if(""===t[0])r=!0;else{for(const e of t){const t=o.next();if(":"===e[0]){if(""===t)return null;n=n||[],(n[i]||(n[i]={}))[e.slice(1)]=t}else if(t!==e)return null}r=!1}}return r&&r!==(""===o.next())?null:n?e.map((t,e)=>({id:t.id,path:t.path,params:w(t.params,n[e]),beforeEnter:t.beforeEnter,beforeLeave:t.beforeLeave})):e},w=(t,e)=>!t&&e?e:t&&!e?t:t&&e?Object.assign(Object.assign({},t),e):void 0,b=(t,e)=>{let o=null,n=0;for(const r of e){const e=m(t,r);if(null!==e){const t=v(e);t>n&&(n=t,o=e)}}return o},v=t=>{let e=1,o=1;for(const n of t)for(const t of n.path)":"===t[0]?e+=Math.pow(1,o):""!==t&&(e+=Math.pow(2,o)),o++;return e};class R{constructor(t){this.path=t.slice()}next(){return this.path.length>0?this.path.shift():""}}const y=t=>Array.from(t.children).filter(t=>"ION-ROUTE-REDIRECT"===t.tagName).map(t=>{const e=k(t,"to");return{from:l(k(t,"from")),to:null==e?void 0:l(e)}}),C=t=>E(P(t)),P=(t,e=t)=>Array.from(e.children).filter(t=>"ION-ROUTE"===t.tagName&&t.component).map(e=>{const o=k(e,"component");if(null==o)throw new Error("component missing in ion-route");return{path:l(k(e,"url")),id:o.toLowerCase(),params:e.componentProps,beforeLeave:e.beforeLeave,beforeEnter:e.beforeEnter,children:P(t,e)}}),k=(t,e)=>e in t?t[e]:t.hasAttribute(e)?t.getAttribute(e):null,E=t=>{const e=[];for(const o of t)L([],e,o);return e},L=(t,e,o)=>{const n=t.slice();if(n.push({id:o.id,path:o.path,params:o.params,beforeLeave:o.beforeLeave,beforeEnter:o.beforeEnter}),0!==o.children.length)for(const r of o.children)L(n,e,r);else e.push(n)},S=class{constructor(t){(0,n.r)(this,t),this.ionRouteWillChange=(0,n.e)(this,"ionRouteWillChange",7),this.ionRouteDidChange=(0,n.e)(this,"ionRouteDidChange",7),this.previousPath=null,this.busy=!1,this.state=0,this.lastState=0,this.root="/",this.useHash=!0}async componentWillLoad(){console.debug("[ion-router] router will load"),await(f(document.body)?Promise.resolve():new Promise(t=>
|