aptechka 0.70.4 → 0.70.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var Yt=Object.defineProperty,Xt=Object.defineProperties;var jt=Object.getOwnPropertyDescriptors;var xt=Object.getOwnPropertySymbols;var Ut=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable;var Ht=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r),qt=r=>{throw TypeError(r)};var Nt=(r,t,s)=>t in r?Yt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s,pt=(r,t)=>{for(var s in t||(t={}))Ut.call(t,s)&&Nt(r,s,t[s]);if(xt)for(var s of xt(t))Kt.call(t,s)&&Nt(r,s,t[s]);return r},Et=(r,t)=>Xt(r,jt(t));var gt=(r,t,s)=>t.has(r)||qt("Cannot "+s);var e=(r,t,s)=>(gt(r,t,"read from private field"),s?s.call(r):t.get(r)),a=(r,t,s)=>t.has(r)?qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),n=(r,t,s,i)=>(gt(r,t,"write to private field"),i?i.call(r,s):t.set(r,s),s),p=(r,t,s)=>(gt(r,t,"access private method"),s);var Y=(r,t,s)=>new Promise((i,u)=>{var w=g=>{try{v(s.next(g))}catch(F){u(F)}},H=g=>{try{v(s.throw(g))}catch(F){u(F)}},v=g=>g.done?i(g.value):Promise.resolve(g.value).then(w,H);v((s=s.apply(r,t)).next())});var Dt=(r,t,s)=>(t=r[Ht("asyncIterator")])?t.call(r):(r=r[Ht("iterator")](),t={},s=(i,u)=>(u=r[i])&&(t[i]=w=>new Promise((H,v,g)=>(w=u.call(r,w),g=w.done,Promise.resolve(w.value).then(F=>H({value:F,done:g}),v)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Vt=require("../index-DekP7OZe.cjs"),X=require("../events-KVanG9sR.cjs"),$t=require("../polyfills-Df4r-ETT.cjs"),It=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const ct=require("../url-BT4fssbO.cjs"),Gt=require("../css-value-parser/index.cjs");class zt extends HTMLElement{connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,i]of Object.entries(t))this.setAttribute(s,i)}}Vt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",zt);var C,l,D,st,$;class St{constructor(t,s){a(this,C);a(this,l);a(this,D);a(this,st,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,C).previousPathname)history.back();else{n(this,D,e(this,l).getAttribute("href")||"/");const u=e(this,l).getAttribute("data-history-action")||"push",w=e(this,l).hasAttribute("data-center-scroll"),H=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),v=H?Gt.cssValueParser.parse(H):void 0,g=e(this,l).hasAttribute("data-revalidate"),F=e(this,l).hasAttribute("data-keep-search-parameters"),d=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(N=>N.trim()),ot=e(this,l).hasAttribute("data-clear-state");e(this,C).navigate(e(this,D),{historyAction:u,centerScroll:w,offsetScroll:v,revalidate:g,keepSearchParameters:F,submorph:d,clearState:ot})}});a(this,$,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,C).prefetch(e(this,D),t),e(this,l).removeEventListener("pointerenter",e(this,$))});n(this,C,s),n(this,l,t),n(this,D,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,st)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,$))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,C).normalizePath(t),i=e(this,C).normalizePath(e(this,D));e(this,l).hasAttribute("data-include")&&s.pathname.includes(i.pathname)?e(this,l).classList.add("current"):i.pathname===s.pathname?e(this,l).classList.add("current"):e(this,l).classList.remove("current")}destroy(){e(this,l).removeEventListener("click",e(this,st)),e(this,l).removeEventListener("pointerenter",e(this,$)),e(this,l).classList.remove("current")}}C=new WeakMap,l=new WeakMap,D=new WeakMap,st=new WeakMap,$=new WeakMap;const Jt=new DOMParser;var T,I,b,P,j,R,G,U,V;class Rt{constructor(t,s){a(this,T);a(this,I);a(this,b,{x:0,y:0});a(this,P,null);a(this,j,null);a(this,R,null);a(this,G,null);a(this,U,null);a(this,V,null);n(this,T,t),n(this,I,s)}get path(){return e(this,I)}get scrollState(){return e(this,b)}get document(){return e(this,R)}setInitialDocument(t){n(this,P,t.cloneNode(!0))}abort(){var t;return(t=e(this,U))==null?void 0:t.abort(`[${e(this,I)}] page loading cancelled`)}fetch(t){return Y(this,null,function*(){return e(this,V)||e(this,P)&&e(this,P).documentElement.hasAttribute("data-cache")&&!t||e(this,P)&&e(this,T).isPopstateNavigation?e(this,V):(n(this,V,new Promise(s=>Y(this,null,function*(){try{n(this,U,new AbortController);const u=yield(yield fetch(e(this,I),{signal:e(this,U).signal})).text(),w=Jt.parseFromString(u,"text/html");this.setInitialDocument(w)}catch(i){console.warn(i)}finally{n(this,U,null),n(this,V,null),s()}}))),e(this,V))})}cloneDocument(){n(this,R,(e(this,j)||e(this,P)).cloneNode(!0))}get title(){let t="";if(e(this,R).title)t=e(this,R).title;else{const s=e(this,R).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,I)}return t}clearScrollState(){e(this,b).x=0,e(this,b).y=0}clearDocumentState(){n(this,j,null)}saveScrollState(){e(this,P).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,b).x=0,e(this,b).y=0):(e(this,b).x=e(this,T).scrollValue.left,e(this,b).y=e(this,T).scrollValue.top)}restoreScrollPosition(){e(this,T).scrollElement.scroll({top:e(this,b).y,left:e(this,b).x,behavior:"instant"})}saveDocumentState(){e(this,P).documentElement.hasAttribute("data-no-page-restoration")?n(this,j,null):n(this,j,document.cloneNode(!0))}renewScrollPosition(){e(this,T).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){n(this,G,t)}clearState(){const t=e(this,G);return n(this,G,null),t}}T=new WeakMap,I=new WeakMap,b=new WeakMap,P=new WeakMap,j=new WeakMap,R=new WeakMap,G=new WeakMap,U=new WeakMap,V=new WeakMap;var A,J,E,z,f,it,B,M,L,rt,x,K,Q,Z,nt,c,ht,wt,Bt,yt,bt,Lt,Pt,ut,_;const et=class et{constructor(t){a(this,c);a(this,A,null);a(this,J,null);a(this,E,[]);a(this,z);a(this,f,null);a(this,it);a(this,B,[]);a(this,M,!1);a(this,L,null);a(this,rt,!1);a(this,x,new Map);a(this,K,null);a(this,Q,0);a(this,Z,0);a(this,nt,t=>{var s;return((s=t.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!t.hasAttribute("download")&&!t.hasAttribute("data-morph-skip")&&!t.closest("[data-morph-skip]")&&t.getAttribute("target")!=="_blank"});a(this,ut,t=>Y(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),n(this,M,!0),yield this.navigate(t.state.path,{historyAction:"none"}),n(this,M,!1))}));a(this,_,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,Z),u=t-e(this,Q);n(this,Z,s),n(this,Q,t),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",t>0),document.documentElement.classList.toggle("scroll-y-forward",i>0),document.documentElement.classList.toggle("scroll-y-backward",i<0),document.documentElement.classList.toggle("scroll-x-forward",u>0),document.documentElement.classList.toggle("scroll-x-backward",u<0),X.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(Vt.isBrowser&&!et.instance){et.instance=this,n(this,A,{base:ct.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:t==null?void 0:t.scrollSelector,morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),n(this,J,p(this,c,wt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash+location.search);n(this,f,s.path);const i=new Rt(this,e(this,f));i.setInitialDocument(document),e(this,x).set(e(this,f),i),document.documentElement.setAttribute("data-current-pathname",e(this,f)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",e(this,ut)),ct.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),n(this,K,new zt),p(this,c,Lt).call(this,document)}}get currentPath(){return e(this,f)}get previousPathname(){return e(this,it)}get links(){return e(this,E)}get scrollElement(){return e(this,L)}get isPopstateNavigation(){return e(this,M)}get scrollValue(){let t=0,s=0;return e(this,rt)?(t=window.scrollY,s=window.scrollX):(t=e(this,L).scrollTop,s=e(this,L).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,x).get(e(this,f));s&&s.saveState(t)}getState(){const t=e(this,x).get(e(this,f));return t==null?void 0:t.clearState()}normalizePath(t){return ct.splitPath(t,{base:e(this,A).base,trailingSlash:e(this,A).trailingSlash})}prefetch(t,s){return Y(this,null,function*(){if(e(this,B).length)return;const i=p(this,c,ht).call(this,t);i==null||i.fetch(s)})}navigate(F){return Y(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:u,revalidate:w,keepSearchParameters:H,submorph:v,clearState:g}={}){var ot;if(e(this,B).length)return;const d=this.normalizePath(((ot=this.pathnameModifier)==null?void 0:ot.call(this,t))||t);if(e(this,z)===d.path||e(this,f)===d.path){e(this,M)||p(this,c,Pt).call(this,d.hash||0,{centerScroll:i,offsetScroll:u,behavior:"smooth"});return}n(this,z,d.path),e(this,E).forEach(N=>{N.checkCurrent(d.path)});try{let N=!0;if(this.preprocessor)try{yield new Promise((o,k)=>{var y;(y=this.preprocessor)==null||y.call(this,{path:t,resolve:o,reject:k,submorph:v})})}catch(o){o?console.error(o):console.log("Route change canceled"),N=!1}if(!N||e(this,z)!==d.path){e(this,E).forEach(o=>{o.checkCurrent(e(this,f))});return}const At={path:d.path,submorph:v};X.dispatchEvent(document,"morphNavigation",{detail:At});const dt=p(this,c,ht).call(this,e(this,f)),m=p(this,c,ht).call(this,t);if(e(this,x).forEach(o=>{o.path!==d.path&&o.abort()}),yield m==null?void 0:m.fetch(w),e(this,z)!==d.path){e(this,E).forEach(o=>{o.checkCurrent(e(this,f))});return}dt.clearState(),dt.saveScrollState(),dt.saveDocumentState(),e(this,M)||(m.clearScrollState(),m.clearDocumentState()),g&&m.clearState(),m.cloneDocument(),e(this,K).textContent=m.title,document.body.appendChild(e(this,K));const mt=Et(pt({},At),{document:m.document});X.dispatchEvent(document,"morphStart",{detail:mt});const kt=Array.from(document.head.children),Ct=Array.from(m.document.head.children),Tt=p(this,c,Bt).call(this,kt,Ct),Ft=p(this,c,yt).call(this,kt,Tt),at=p(this,c,yt).call(this,Ct,Tt);at.forEach((o,k)=>{if(o.tagName==="SCRIPT"&&o.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=o.getAttribute("src"),at[k]=y}}),at.forEach(o=>{document.head.appendChild(o)});const ft=at.filter(o=>{if(o.hasAttribute("data-no-waiting"))return!1;if(p(this,c,bt).call(this,o))return!0});e(this,A).waitForHeadToLoad&&ft.length&&(yield new Promise(o=>Y(this,null,function*(){let k=0;try{for(var y=Dt(ft),tt,O,W;tt=!(O=yield y.next()).done;tt=!1){const lt=O.value;lt.onload=()=>{k++,k===ft.length&&o()}}}catch(O){W=[O]}finally{try{tt&&(O=y.return)&&(yield O.call(y))}finally{if(W)throw W[0]}}}))),yield It.wait(10);const Mt=[];Ft.forEach(o=>{o.hasAttribute("data-permanent")||(p(this,c,bt).call(this,o)?Mt.push(o):o.remove())});const Ot=p(this,c,wt).call(this,m.document.body);e(this,A).morphInsideScrollContainer||p(this,c,Lt).call(this,m.document),document.documentElement.setAttribute("data-current-pathname",d.pathname),document.documentElement.setAttribute("data-current-leaf",d.leaf),ct.changeHistory({action:s,pathname:d.pathname,searchParameters:d.parameters||(H?location.search:""),hash:d.hash}),e(this,K).remove(),n(this,it,e(this,f)),n(this,f,d.path),e(this,J).forEach((o,k)=>{const y=Ot[k],tt=getComputedStyle(o).getPropertyValue("--morph-duration");let O=[],W=[];v?v.forEach(h=>{const S=o.querySelector(h),q=y.querySelector(h);S&&q&&(W.push(S),O.push(q))}):(O.push(...y.childNodes),W.push(...o.childNodes)),W.forEach(h=>{h instanceof HTMLElement&&(this.destroyOldLinks(h),h.classList.add("old"))}),O.forEach(h=>{h instanceof HTMLElement&&(this.findNewLinks(h),h.classList.add("new"))}),v?O.forEach((h,S)=>{var q;(q=W[S].parentElement)==null||q.insertBefore(h,W[S])}):o.prepend(...O),$t.requestIdleCallback(()=>{W.forEach(h=>{h instanceof HTMLElement&&h.classList.add("old-idle")}),O.forEach(h=>{var S;h instanceof HTMLElement&&((S=h.parentElement)==null||S.style.setProperty("--new-content-height",h.offsetHeight+"px"),h.classList.add("new-idle"))})});const lt=Et(pt({},mt),{morphElement:o});X.dispatchEvent(document,"morphNewChildrenAdded",{detail:lt});const Wt=new Promise(h=>{setTimeout(()=>{W.forEach(S=>S.remove()),O.forEach(S=>{var q;S instanceof HTMLElement&&((q=S.parentElement)==null||q.style.removeProperty("--new-content-height"),S.classList.remove("new-idle","new"))}),X.dispatchEvent(document,"morphOldChildrenRemoved",{detail:lt}),h()},(parseFloat(tt)||0)*1e3+10)});e(this,B).push(Wt)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-m.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),X.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:m.scrollState}),d.hash?(m.clearScrollState(),p(this,c,Pt).call(this,d.hash,{centerScroll:i,offsetScroll:u})):e(this,M)?m.restoreScrollPosition():m.renewScrollPosition(),yield Promise.all(e(this,B)),Mt.forEach(o=>o.remove()),n(this,B,[]),e(this,J).forEach(o=>{o.querySelectorAll("script").forEach(y=>{const tt=document.createElement("script");tt.type="module",tt.src=y.getAttribute("src"),y.replaceWith(tt)})}),X.dispatchEvent(document,"morphComplete",{detail:mt}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(N){console.error(N)}n(this,z,void 0)})}addLink(t){e(this,E).push(new St(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){n(this,E,e(this,E).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){n(this,E,e(this,E).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,nt));e(this,E).push(...s.map(i=>new St(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,nt));e(this,E).forEach(s=>s.destroy()),n(this,E,t.map(s=>new St(s,this)))}};A=new WeakMap,J=new WeakMap,E=new WeakMap,z=new WeakMap,f=new WeakMap,it=new WeakMap,B=new WeakMap,M=new WeakMap,L=new WeakMap,rt=new WeakMap,x=new WeakMap,K=new WeakMap,Q=new WeakMap,Z=new WeakMap,nt=new WeakMap,c=new WeakSet,ht=function(t){let s=e(this,x).get(t);return s||(s=new Rt(this,t),e(this,x).set(t,s)),s},wt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Bt=function(t,s){return t.filter(i=>s.find(u=>u.outerHTML===i.outerHTML))},yt=function(t,s){return t.filter(i=>!s.find(u=>u.outerHTML===i.outerHTML))},bt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},Lt=function(t){var s,i;(s=e(this,L))==null||s.removeEventListener("scroll",e(this,_)),n(this,Z,0),n(this,Q,0),n(this,L,e(this,A).scrollSelector&&t.querySelector(e(this,A).scrollSelector)||window),n(this,rt,e(this,L)===window),(i=e(this,L))==null||i.addEventListener("scroll",e(this,_)),e(this,_).call(this)},Pt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&It.scrollToElement(i,{scrollElement:e(this,L),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},ut=new WeakMap,_=new WeakMap,et.instance=null;let vt=et;exports.Morph=vt;
1
+ "use strict";var Yt=Object.defineProperty,Xt=Object.defineProperties;var jt=Object.getOwnPropertyDescriptors;var xt=Object.getOwnPropertySymbols;var Ut=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable;var Ht=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r),qt=r=>{throw TypeError(r)};var Nt=(r,t,s)=>t in r?Yt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s,pt=(r,t)=>{for(var s in t||(t={}))Ut.call(t,s)&&Nt(r,s,t[s]);if(xt)for(var s of xt(t))Kt.call(t,s)&&Nt(r,s,t[s]);return r},Et=(r,t)=>Xt(r,jt(t));var gt=(r,t,s)=>t.has(r)||qt("Cannot "+s);var e=(r,t,s)=>(gt(r,t,"read from private field"),s?s.call(r):t.get(r)),a=(r,t,s)=>t.has(r)?qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),n=(r,t,s,i)=>(gt(r,t,"write to private field"),i?i.call(r,s):t.set(r,s),s),p=(r,t,s)=>(gt(r,t,"access private method"),s);var Y=(r,t,s)=>new Promise((i,u)=>{var w=g=>{try{v(s.next(g))}catch(F){u(F)}},H=g=>{try{v(s.throw(g))}catch(F){u(F)}},v=g=>g.done?i(g.value):Promise.resolve(g.value).then(w,H);v((s=s.apply(r,t)).next())});var Dt=(r,t,s)=>(t=r[Ht("asyncIterator")])?t.call(r):(r=r[Ht("iterator")](),t={},s=(i,u)=>(u=r[i])&&(t[i]=w=>new Promise((H,v,g)=>(w=u.call(r,w),g=w.done,Promise.resolve(w.value).then(F=>H({value:F,done:g}),v)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Vt=require("../index-DekP7OZe.cjs"),X=require("../events-KVanG9sR.cjs"),$t=require("../polyfills-Df4r-ETT.cjs"),It=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const ct=require("../url-BT4fssbO.cjs"),Gt=require("../css-value-parser/index.cjs");class zt extends HTMLElement{connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,i]of Object.entries(t))this.setAttribute(s,i)}}Vt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",zt);var C,l,D,st,$;class St{constructor(t,s){a(this,C);a(this,l);a(this,D);a(this,st,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,C).previousPathname)history.back();else{n(this,D,e(this,l).getAttribute("href")||"/");const u=e(this,l).getAttribute("data-history-action")||"push",w=e(this,l).hasAttribute("data-center-scroll"),H=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),v=H?Gt.cssValueParser.parse(H):void 0,g=e(this,l).hasAttribute("data-revalidate"),F=e(this,l).hasAttribute("data-keep-search-parameters"),d=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(N=>N.trim()),ot=e(this,l).hasAttribute("data-clear-state");e(this,C).navigate(e(this,D),{historyAction:u,centerScroll:w,offsetScroll:v,revalidate:g,keepSearchParameters:F,submorph:d,clearState:ot})}});a(this,$,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,C).prefetch(e(this,D),t),e(this,l).removeEventListener("pointerenter",e(this,$))});n(this,C,s),n(this,l,t),n(this,D,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,st)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,$))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,C).normalizePath(t),i=e(this,C).normalizePath(e(this,D));e(this,l).hasAttribute("data-include")&&s.pathname.includes(i.pathname)?e(this,l).classList.add("current"):i.pathname===s.pathname?e(this,l).classList.add("current"):e(this,l).classList.remove("current")}destroy(){e(this,l).removeEventListener("click",e(this,st)),e(this,l).removeEventListener("pointerenter",e(this,$)),e(this,l).classList.remove("current")}}C=new WeakMap,l=new WeakMap,D=new WeakMap,st=new WeakMap,$=new WeakMap;const Jt=new DOMParser;var T,I,b,P,j,R,G,U,V;class Rt{constructor(t,s){a(this,T);a(this,I);a(this,b,{x:0,y:0});a(this,P,null);a(this,j,null);a(this,R,null);a(this,G,null);a(this,U,null);a(this,V,null);n(this,T,t),n(this,I,s)}get path(){return e(this,I)}get scrollState(){return e(this,b)}get document(){return e(this,R)}setInitialDocument(t){n(this,P,t.cloneNode(!0))}abort(){var t;return(t=e(this,U))==null?void 0:t.abort(`[${e(this,I)}] page loading cancelled`)}fetch(t){return Y(this,null,function*(){return e(this,V)||e(this,P)&&e(this,P).documentElement.hasAttribute("data-cache")&&!t||e(this,P)&&e(this,T).isPopstateNavigation?e(this,V):(n(this,V,new Promise(s=>Y(this,null,function*(){try{n(this,U,new AbortController);const u=yield(yield fetch(e(this,I),{signal:e(this,U).signal})).text(),w=Jt.parseFromString(u,"text/html");this.setInitialDocument(w)}catch(i){console.warn(i)}finally{n(this,U,null),n(this,V,null),s()}}))),e(this,V))})}cloneDocument(){n(this,R,(e(this,j)||e(this,P)).cloneNode(!0))}get title(){let t="";if(e(this,R).title)t=e(this,R).title;else{const s=e(this,R).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,I)}return t}clearScrollState(){e(this,b).x=0,e(this,b).y=0}clearDocumentState(){n(this,j,null)}saveScrollState(){e(this,P).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,b).x=0,e(this,b).y=0):(e(this,b).x=e(this,T).scrollValue.left,e(this,b).y=e(this,T).scrollValue.top)}restoreScrollPosition(){e(this,T).scrollElement.scroll({top:e(this,b).y,left:e(this,b).x,behavior:"instant"})}saveDocumentState(){e(this,P).documentElement.hasAttribute("data-no-page-restoration")?n(this,j,null):n(this,j,document.cloneNode(!0))}renewScrollPosition(){e(this,T).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){n(this,G,t)}clearState(){const t=e(this,G);return n(this,G,null),t}}T=new WeakMap,I=new WeakMap,b=new WeakMap,P=new WeakMap,j=new WeakMap,R=new WeakMap,G=new WeakMap,U=new WeakMap,V=new WeakMap;var A,J,E,z,f,it,B,M,L,rt,x,K,Q,Z,nt,c,ht,wt,Bt,yt,bt,Lt,Pt,ut,_;const et=class et{constructor(t){a(this,c);a(this,A,null);a(this,J,null);a(this,E,[]);a(this,z);a(this,f,null);a(this,it);a(this,B,[]);a(this,M,!1);a(this,L,null);a(this,rt,!1);a(this,x,new Map);a(this,K,null);a(this,Q,0);a(this,Z,0);a(this,nt,t=>{var s;return((s=t.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!t.hasAttribute("download")&&!t.hasAttribute("data-morph-skip")&&!t.closest("[data-morph-skip]")&&t.getAttribute("target")!=="_blank"});a(this,ut,t=>Y(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),n(this,M,!0),yield this.navigate(t.state.path,{historyAction:"none"}),n(this,M,!1))}));a(this,_,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,Z),u=t-e(this,Q);n(this,Z,s),n(this,Q,t),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",t>0),document.documentElement.classList.toggle("scroll-y-forward",i>0),document.documentElement.classList.toggle("scroll-y-backward",i<0),document.documentElement.classList.toggle("scroll-x-forward",u>0),document.documentElement.classList.toggle("scroll-x-backward",u<0),X.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(Vt.isBrowser&&!et.instance){et.instance=this,n(this,A,{base:ct.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:t==null?void 0:t.scrollSelector,morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),n(this,J,p(this,c,wt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash+location.search);n(this,f,s.path);const i=new Rt(this,e(this,f));i.setInitialDocument(document),e(this,x).set(e(this,f),i),document.documentElement.setAttribute("data-current-pathname",e(this,f)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",e(this,ut)),ct.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),n(this,K,new zt),p(this,c,Lt).call(this,document)}}get currentPath(){return e(this,f)}get previousPathname(){return e(this,it)}get links(){return e(this,E)}get scrollElement(){return e(this,L)}get isPopstateNavigation(){return e(this,M)}get scrollValue(){let t=0,s=0;return e(this,rt)?(t=window.scrollY,s=window.scrollX):(t=e(this,L).scrollTop,s=e(this,L).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,x).get(e(this,f));s&&s.saveState(t)}getState(){const t=e(this,x).get(e(this,f));return t==null?void 0:t.clearState()}normalizePath(t){return ct.splitPath(t,{base:e(this,A).base,trailingSlash:e(this,A).trailingSlash})}prefetch(t,s){return Y(this,null,function*(){if(e(this,B).length)return;const i=p(this,c,ht).call(this,t);i==null||i.fetch(s)})}navigate(F){return Y(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:u,revalidate:w,keepSearchParameters:H,submorph:v,clearState:g}={}){var ot;if(e(this,B).length)return;const d=this.normalizePath(((ot=this.pathnameModifier)==null?void 0:ot.call(this,t))||t);if(e(this,z)===d.path||e(this,f)===d.path){e(this,M)||p(this,c,Pt).call(this,d.hash||0,{centerScroll:i,offsetScroll:u,behavior:"smooth"});return}n(this,z,d.path),e(this,E).forEach(N=>{N.checkCurrent(d.path)});try{let N=!0;if(this.preprocessor)try{yield new Promise((o,k)=>{var y;(y=this.preprocessor)==null||y.call(this,{path:t,resolve:o,reject:k,submorph:v})})}catch(o){o?console.error(o):console.log("Route change canceled"),N=!1}if(!N||e(this,z)!==d.path){e(this,E).forEach(o=>{o.checkCurrent(e(this,f))});return}const At={path:d.path,submorph:v};X.dispatchEvent(document,"morphNavigation",{detail:At});const dt=p(this,c,ht).call(this,e(this,f)),m=p(this,c,ht).call(this,t);if(e(this,x).forEach(o=>{o.path!==d.path&&o.abort()}),yield m==null?void 0:m.fetch(w),e(this,z)!==d.path){e(this,E).forEach(o=>{o.checkCurrent(e(this,f))});return}dt.clearState(),dt.saveScrollState(),dt.saveDocumentState(),e(this,M)||(m.clearScrollState(),m.clearDocumentState()),g&&m.clearState(),m.cloneDocument(),e(this,K).textContent=m.title,document.body.appendChild(e(this,K));const mt=Et(pt({},At),{document:m.document});X.dispatchEvent(document,"morphStart",{detail:mt});const kt=Array.from(document.head.children),Ct=Array.from(m.document.head.children),Tt=p(this,c,Bt).call(this,kt,Ct),Ft=p(this,c,yt).call(this,kt,Tt),at=p(this,c,yt).call(this,Ct,Tt);at.forEach((o,k)=>{if(o.tagName==="SCRIPT"&&o.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=o.getAttribute("src"),at[k]=y}}),at.forEach(o=>{document.head.appendChild(o)});const ft=at.filter(o=>{if(o.hasAttribute("data-no-waiting"))return!1;if(p(this,c,bt).call(this,o))return!0});e(this,A).waitForHeadToLoad&&ft.length&&(yield new Promise(o=>Y(this,null,function*(){let k=0;try{for(var y=Dt(ft),tt,O,W;tt=!(O=yield y.next()).done;tt=!1){const lt=O.value;lt.onload=()=>{k++,k===ft.length&&o()}}}catch(O){W=[O]}finally{try{tt&&(O=y.return)&&(yield O.call(y))}finally{if(W)throw W[0]}}}))),yield It.wait(10);const Mt=[];Ft.forEach(o=>{o.hasAttribute("data-permanent")||(p(this,c,bt).call(this,o)?Mt.push(o):o.remove())});const Ot=p(this,c,wt).call(this,m.document.body);e(this,A).morphInsideScrollContainer||p(this,c,Lt).call(this,m.document),document.documentElement.setAttribute("data-current-pathname",d.pathname),document.documentElement.setAttribute("data-current-leaf",d.leaf),ct.changeHistory({action:s,pathname:d.pathname,searchParameters:d.parameters||(H?location.search:""),hash:d.hash}),e(this,K).remove(),n(this,it,e(this,f)),n(this,f,d.path),e(this,J).forEach((o,k)=>{const y=Ot[k],tt=getComputedStyle(o).getPropertyValue("--morph-duration");let O=[],W=[];v?v.forEach(h=>{const S=o.querySelector(h),q=y.querySelector(h);S&&q&&(W.push(S),O.push(q))}):(O.push(...y.childNodes),W.push(...o.childNodes)),W.forEach(h=>{h instanceof HTMLElement&&(this.destroyOldLinks(h),h.classList.add("old"))}),O.forEach(h=>{h instanceof HTMLElement&&(this.findNewLinks(h),h.classList.add("new"))}),v?O.forEach((h,S)=>{var q;(q=W[S].parentElement)==null||q.insertBefore(h,W[S])}):o.prepend(...O),$t.requestIdleCallback(()=>{W.forEach(h=>{h instanceof HTMLElement&&h.classList.add("old-idle")}),O.forEach(h=>{var S;h instanceof HTMLElement&&((S=h.parentElement)==null||S.style.setProperty("--new-content-height",h.offsetHeight+"px"),h.classList.add("new-idle"))})});const lt=Et(pt({},mt),{morphElement:o});X.dispatchEvent(document,"morphNewChildrenAdded",{detail:lt});const Wt=new Promise(h=>{setTimeout(()=>{W.forEach(S=>S.remove()),O.forEach(S=>{var q;S instanceof HTMLElement&&((q=S.parentElement)==null||q.style.removeProperty("--new-content-height"),S.classList.remove("new-idle","new"))}),X.dispatchEvent(document,"morphOldChildrenRemoved",{detail:lt}),h()},(parseFloat(tt)||0)*1e3+10)});e(this,B).push(Wt)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-m.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),X.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:m.scrollState}),d.hash?(m.clearScrollState(),p(this,c,Pt).call(this,d.hash,{centerScroll:i,offsetScroll:u})):e(this,M)?m.restoreScrollPosition():m.renewScrollPosition(),yield Promise.all(e(this,B)),Mt.forEach(o=>o.remove()),n(this,B,[]),e(this,J).forEach(o=>{o.querySelectorAll("script").forEach(y=>{const tt=document.createElement("script");tt.type="module",tt.src=y.getAttribute("src"),y.replaceWith(tt)})}),X.dispatchEvent(document,"morphComplete",{detail:mt}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(N){console.error(N)}n(this,z,void 0)})}addLink(t){e(this,E).push(new St(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){n(this,E,e(this,E).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){n(this,E,e(this,E).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,nt));e(this,E).push(...s.map(i=>new St(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,nt));e(this,E).forEach(s=>s.destroy()),n(this,E,t.map(s=>new St(s,this)))}};A=new WeakMap,J=new WeakMap,E=new WeakMap,z=new WeakMap,f=new WeakMap,it=new WeakMap,B=new WeakMap,M=new WeakMap,L=new WeakMap,rt=new WeakMap,x=new WeakMap,K=new WeakMap,Q=new WeakMap,Z=new WeakMap,nt=new WeakMap,c=new WeakSet,ht=function(t){let s=t.split("#")[0],i=e(this,x).get(s);return i||(i=new Rt(this,s),e(this,x).set(s,i)),i},wt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Bt=function(t,s){return t.filter(i=>s.find(u=>u.outerHTML===i.outerHTML))},yt=function(t,s){return t.filter(i=>!s.find(u=>u.outerHTML===i.outerHTML))},bt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},Lt=function(t){var s,i;(s=e(this,L))==null||s.removeEventListener("scroll",e(this,_)),n(this,Z,0),n(this,Q,0),n(this,L,e(this,A).scrollSelector&&t.querySelector(e(this,A).scrollSelector)||window),n(this,rt,e(this,L)===window),(i=e(this,L))==null||i.addEventListener("scroll",e(this,_)),e(this,_).call(this)},Pt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&It.scrollToElement(i,{scrollElement:e(this,L),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},ut=new WeakMap,_=new WeakMap,et.instance=null;let vt=et;exports.Morph=vt;
@@ -1,37 +1,37 @@
1
- var Wt = Object.defineProperty, Yt = Object.defineProperties;
1
+ var Ot = Object.defineProperty, Yt = Object.defineProperties;
2
2
  var Xt = Object.getOwnPropertyDescriptors;
3
3
  var Tt = Object.getOwnPropertySymbols;
4
4
  var Ut = Object.prototype.hasOwnProperty, jt = Object.prototype.propertyIsEnumerable;
5
- var xt = (r, t) => (t = Symbol[r]) ? t : Symbol.for("Symbol." + r), Nt = (r) => {
5
+ var xt = (r, t) => (t = Symbol[r]) ? t : Symbol.for("Symbol." + r), Mt = (r) => {
6
6
  throw TypeError(r);
7
7
  };
8
- var Mt = (r, t, s) => t in r ? Wt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[t] = s, ft = (r, t) => {
8
+ var Ht = (r, t, s) => t in r ? Ot(r, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[t] = s, ft = (r, t) => {
9
9
  for (var s in t || (t = {}))
10
- Ut.call(t, s) && Mt(r, s, t[s]);
10
+ Ut.call(t, s) && Ht(r, s, t[s]);
11
11
  if (Tt)
12
12
  for (var s of Tt(t))
13
- jt.call(t, s) && Mt(r, s, t[s]);
13
+ jt.call(t, s) && Ht(r, s, t[s]);
14
14
  return r;
15
15
  }, pt = (r, t) => Yt(r, Xt(t));
16
- var Et = (r, t, s) => t.has(r) || Nt("Cannot " + s);
17
- var e = (r, t, s) => (Et(r, t, "read from private field"), s ? s.call(r) : t.get(r)), a = (r, t, s) => t.has(r) ? Nt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s), n = (r, t, s, i) => (Et(r, t, "write to private field"), i ? i.call(r, s) : t.set(r, s), s), p = (r, t, s) => (Et(r, t, "access private method"), s);
16
+ var Et = (r, t, s) => t.has(r) || Mt("Cannot " + s);
17
+ var e = (r, t, s) => (Et(r, t, "read from private field"), s ? s.call(r) : t.get(r)), a = (r, t, s) => t.has(r) ? Mt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s), n = (r, t, s, i) => (Et(r, t, "write to private field"), i ? i.call(r, s) : t.set(r, s), s), p = (r, t, s) => (Et(r, t, "access private method"), s);
18
18
  var Y = (r, t, s) => new Promise((i, u) => {
19
19
  var y = (g) => {
20
20
  try {
21
21
  w(s.next(g));
22
- } catch (B) {
23
- u(B);
22
+ } catch (W) {
23
+ u(W);
24
24
  }
25
- }, N = (g) => {
25
+ }, M = (g) => {
26
26
  try {
27
27
  w(s.throw(g));
28
- } catch (B) {
29
- u(B);
28
+ } catch (W) {
29
+ u(W);
30
30
  }
31
- }, w = (g) => g.done ? i(g.value) : Promise.resolve(g.value).then(y, N);
31
+ }, w = (g) => g.done ? i(g.value) : Promise.resolve(g.value).then(y, M);
32
32
  w((s = s.apply(r, t)).next());
33
33
  });
34
- var Ht = (r, t, s) => (t = r[xt("asyncIterator")]) ? t.call(r) : (r = r[xt("iterator")](), t = {}, s = (i, u) => (u = r[i]) && (t[i] = (y) => new Promise((N, w, g) => (y = u.call(r, y), g = y.done, Promise.resolve(y.value).then((B) => N({ value: B, done: g }), w)))), s("next"), s("return"), t);
34
+ var Nt = (r, t, s) => (t = r[xt("asyncIterator")]) ? t.call(r) : (r = r[xt("iterator")](), t = {}, s = (i, u) => (u = r[i]) && (t[i] = (y) => new Promise((M, w, g) => (y = u.call(r, y), g = y.done, Promise.resolve(y.value).then((W) => M({ value: W, done: g }), w)))), s("next"), s("return"), t);
35
35
  import { i as Vt } from "../index-Bv9zgfdb.js";
36
36
  import { d as X } from "../events-CsVF98U6.js";
37
37
  import { r as Kt } from "../polyfills-DJrTJQky.js";
@@ -65,15 +65,15 @@ class gt {
65
65
  n(this, I, e(this, l).getAttribute("href") || "/");
66
66
  const u = e(this, l).getAttribute(
67
67
  "data-history-action"
68
- ) || "push", y = e(this, l).hasAttribute("data-center-scroll"), N = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), w = N ? Zt.parse(N) : void 0, g = e(this, l).hasAttribute("data-revalidate"), B = e(this, l).hasAttribute(
68
+ ) || "push", y = e(this, l).hasAttribute("data-center-scroll"), M = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), w = M ? Zt.parse(M) : void 0, g = e(this, l).hasAttribute("data-revalidate"), W = e(this, l).hasAttribute(
69
69
  "data-keep-search-parameters"
70
- ), d = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((H) => H.trim()), ot = e(this, l).hasAttribute("data-clear-state");
70
+ ), d = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((N) => N.trim()), ot = e(this, l).hasAttribute("data-clear-state");
71
71
  e(this, C).navigate(e(this, I), {
72
72
  historyAction: u,
73
73
  centerScroll: y,
74
74
  offsetScroll: w,
75
75
  revalidate: g,
76
- keepSearchParameters: B,
76
+ keepSearchParameters: W,
77
77
  submorph: d,
78
78
  clearState: ot
79
79
  });
@@ -199,7 +199,7 @@ class It {
199
199
  }
200
200
  }
201
201
  T = new WeakMap(), R = new WeakMap(), b = new WeakMap(), P = new WeakMap(), U = new WeakMap(), V = new WeakMap(), G = new WeakMap(), j = new WeakMap(), q = new WeakMap();
202
- var A, J, E, z, f, it, F, x, L, rt, M, K, Q, Z, nt, c, ct, St, zt, wt, yt, vt, bt, ht, _;
202
+ var A, J, E, z, f, it, F, x, L, rt, H, K, Q, Z, nt, c, ct, St, zt, wt, yt, vt, bt, ht, _;
203
203
  const et = class et {
204
204
  constructor(t) {
205
205
  a(this, c);
@@ -213,7 +213,7 @@ const et = class et {
213
213
  a(this, x, !1);
214
214
  a(this, L, null);
215
215
  a(this, rt, !1);
216
- a(this, M, /* @__PURE__ */ new Map());
216
+ a(this, H, /* @__PURE__ */ new Map());
217
217
  a(this, K, null);
218
218
  a(this, Q, 0);
219
219
  a(this, Z, 0);
@@ -259,7 +259,7 @@ const et = class et {
259
259
  );
260
260
  n(this, f, s.path);
261
261
  const i = new It(this, e(this, f));
262
- i.setInitialDocument(document), e(this, M).set(e(this, f), i), document.documentElement.setAttribute(
262
+ i.setInitialDocument(document), e(this, H).set(e(this, f), i), document.documentElement.setAttribute(
263
263
  "data-current-pathname",
264
264
  e(this, f)
265
265
  ), document.documentElement.setAttribute(
@@ -293,11 +293,11 @@ const et = class et {
293
293
  return e(this, rt) ? (t = window.scrollY, s = window.scrollX) : (t = e(this, L).scrollTop, s = e(this, L).scrollLeft), { top: t, left: s };
294
294
  }
295
295
  saveState(t) {
296
- const s = e(this, M).get(e(this, f));
296
+ const s = e(this, H).get(e(this, f));
297
297
  s && s.saveState(t);
298
298
  }
299
299
  getState() {
300
- const t = e(this, M).get(e(this, f));
300
+ const t = e(this, H).get(e(this, f));
301
301
  return t == null ? void 0 : t.clearState();
302
302
  }
303
303
  normalizePath(t) {
@@ -314,13 +314,13 @@ const et = class et {
314
314
  i == null || i.fetch(s);
315
315
  });
316
316
  }
317
- navigate(B) {
317
+ navigate(W) {
318
318
  return Y(this, arguments, function* (t, {
319
319
  historyAction: s = "push",
320
320
  centerScroll: i,
321
321
  offsetScroll: u,
322
322
  revalidate: y,
323
- keepSearchParameters: N,
323
+ keepSearchParameters: M,
324
324
  submorph: w,
325
325
  clearState: g
326
326
  } = {}) {
@@ -338,11 +338,11 @@ const et = class et {
338
338
  });
339
339
  return;
340
340
  }
341
- n(this, z, d.path), e(this, E).forEach((H) => {
342
- H.checkCurrent(d.path);
341
+ n(this, z, d.path), e(this, E).forEach((N) => {
342
+ N.checkCurrent(d.path);
343
343
  });
344
344
  try {
345
- let H = !0;
345
+ let N = !0;
346
346
  if (this.preprocessor)
347
347
  try {
348
348
  yield new Promise((o, k) => {
@@ -355,9 +355,9 @@ const et = class et {
355
355
  });
356
356
  });
357
357
  } catch (o) {
358
- o ? console.error(o) : console.log("Route change canceled"), H = !1;
358
+ o ? console.error(o) : console.log("Route change canceled"), N = !1;
359
359
  }
360
- if (!H || e(this, z) !== d.path) {
360
+ if (!N || e(this, z) !== d.path) {
361
361
  e(this, E).forEach((o) => {
362
362
  o.checkCurrent(e(this, f));
363
363
  });
@@ -371,7 +371,7 @@ const et = class et {
371
371
  detail: Lt
372
372
  });
373
373
  const ut = p(this, c, ct).call(this, e(this, f)), m = p(this, c, ct).call(this, t);
374
- if (e(this, M).forEach((o) => {
374
+ if (e(this, H).forEach((o) => {
375
375
  o.path !== d.path && o.abort();
376
376
  }), yield m == null ? void 0 : m.fetch(y), e(this, z) !== d.path) {
377
377
  e(this, E).forEach((o) => {
@@ -404,20 +404,20 @@ const et = class et {
404
404
  e(this, A).waitForHeadToLoad && mt.length && (yield new Promise((o) => Y(this, null, function* () {
405
405
  let k = 0;
406
406
  try {
407
- for (var v = Ht(mt), tt, O, W; tt = !(O = yield v.next()).done; tt = !1) {
408
- const lt = O.value;
407
+ for (var v = Nt(mt), tt, B, O; tt = !(B = yield v.next()).done; tt = !1) {
408
+ const lt = B.value;
409
409
  lt.onload = () => {
410
410
  k++, k === mt.length && o();
411
411
  };
412
412
  }
413
- } catch (O) {
414
- W = [O];
413
+ } catch (B) {
414
+ O = [B];
415
415
  } finally {
416
416
  try {
417
- tt && (O = v.return) && (yield O.call(v));
417
+ tt && (B = v.return) && (yield B.call(v));
418
418
  } finally {
419
- if (W)
420
- throw W[0];
419
+ if (O)
420
+ throw O[0];
421
421
  }
422
422
  }
423
423
  }))), yield $t(10);
@@ -425,7 +425,7 @@ const et = class et {
425
425
  Ft.forEach((o) => {
426
426
  o.hasAttribute("data-permanent") || (p(this, c, yt).call(this, o) ? Ct.push(o) : o.remove());
427
427
  });
428
- const Bt = p(this, c, St).call(this, m.document.body);
428
+ const Wt = p(this, c, St).call(this, m.document.body);
429
429
  e(this, A).morphInsideScrollContainer || p(this, c, vt).call(this, m.document), document.documentElement.setAttribute(
430
430
  "data-current-pathname",
431
431
  d.pathname
@@ -435,28 +435,28 @@ const et = class et {
435
435
  ), Dt({
436
436
  action: s,
437
437
  pathname: d.pathname,
438
- searchParameters: d.parameters || (N ? location.search : ""),
438
+ searchParameters: d.parameters || (M ? location.search : ""),
439
439
  hash: d.hash
440
440
  }), e(this, K).remove(), n(this, it, e(this, f)), n(this, f, d.path), e(this, J).forEach((o, k) => {
441
- const v = Bt[k], tt = getComputedStyle(o).getPropertyValue("--morph-duration");
442
- let O = [], W = [];
441
+ const v = Wt[k], tt = getComputedStyle(o).getPropertyValue("--morph-duration");
442
+ let B = [], O = [];
443
443
  w ? w.forEach((h) => {
444
444
  const S = o.querySelector(h), D = v.querySelector(h);
445
- S && D && (W.push(S), O.push(D));
446
- }) : (O.push(...v.childNodes), W.push(...o.childNodes)), W.forEach((h) => {
445
+ S && D && (O.push(S), B.push(D));
446
+ }) : (B.push(...v.childNodes), O.push(...o.childNodes)), O.forEach((h) => {
447
447
  h instanceof HTMLElement && (this.destroyOldLinks(h), h.classList.add("old"));
448
- }), O.forEach((h) => {
448
+ }), B.forEach((h) => {
449
449
  h instanceof HTMLElement && (this.findNewLinks(h), h.classList.add("new"));
450
- }), w ? O.forEach((h, S) => {
450
+ }), w ? B.forEach((h, S) => {
451
451
  var D;
452
- (D = W[S].parentElement) == null || D.insertBefore(
452
+ (D = O[S].parentElement) == null || D.insertBefore(
453
453
  h,
454
- W[S]
454
+ O[S]
455
455
  );
456
- }) : o.prepend(...O), Kt(() => {
457
- W.forEach((h) => {
456
+ }) : o.prepend(...B), Kt(() => {
457
+ O.forEach((h) => {
458
458
  h instanceof HTMLElement && h.classList.add("old-idle");
459
- }), O.forEach((h) => {
459
+ }), B.forEach((h) => {
460
460
  var S;
461
461
  h instanceof HTMLElement && ((S = h.parentElement) == null || S.style.setProperty(
462
462
  "--new-content-height",
@@ -470,9 +470,9 @@ const et = class et {
470
470
  X(document, "morphNewChildrenAdded", {
471
471
  detail: lt
472
472
  });
473
- const Ot = new Promise((h) => {
473
+ const Bt = new Promise((h) => {
474
474
  setTimeout(() => {
475
- W.forEach((S) => S.remove()), O.forEach((S) => {
475
+ O.forEach((S) => S.remove()), B.forEach((S) => {
476
476
  var D;
477
477
  S instanceof HTMLElement && ((D = S.parentElement) == null || D.style.removeProperty(
478
478
  "--new-content-height"
@@ -482,7 +482,7 @@ const et = class et {
482
482
  }), h();
483
483
  }, (parseFloat(tt) || 0) * 1e3 + 10);
484
484
  });
485
- e(this, F).push(Ot);
485
+ e(this, F).push(Bt);
486
486
  }), this.isPopstateNavigation ? document.documentElement.style.setProperty(
487
487
  "--new-document-scroll-position",
488
488
  (this.scrollValue.top - m.scrollState.y) * 1 + "px"
@@ -504,8 +504,8 @@ const et = class et {
504
504
  }), document.documentElement.style.removeProperty(
505
505
  "--new-document-scroll-position"
506
506
  ), window.dispatchEvent(new Event("resize"));
507
- } catch (H) {
508
- console.error(H);
507
+ } catch (N) {
508
+ console.error(N);
509
509
  }
510
510
  n(this, z, void 0);
511
511
  });
@@ -539,9 +539,9 @@ const et = class et {
539
539
  e(this, E).forEach((s) => s.destroy()), n(this, E, t.map((s) => new gt(s, this)));
540
540
  }
541
541
  };
542
- A = new WeakMap(), J = new WeakMap(), E = new WeakMap(), z = new WeakMap(), f = new WeakMap(), it = new WeakMap(), F = new WeakMap(), x = new WeakMap(), L = new WeakMap(), rt = new WeakMap(), M = new WeakMap(), K = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), nt = new WeakMap(), c = new WeakSet(), ct = function(t) {
543
- let s = e(this, M).get(t);
544
- return s || (s = new It(this, t), e(this, M).set(t, s)), s;
542
+ A = new WeakMap(), J = new WeakMap(), E = new WeakMap(), z = new WeakMap(), f = new WeakMap(), it = new WeakMap(), F = new WeakMap(), x = new WeakMap(), L = new WeakMap(), rt = new WeakMap(), H = new WeakMap(), K = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), nt = new WeakMap(), c = new WeakSet(), ct = function(t) {
543
+ let s = t.split("#")[0], i = e(this, H).get(s);
544
+ return i || (i = new It(this, s), e(this, H).set(s, i)), i;
545
545
  }, St = function(t) {
546
546
  const s = [...t.querySelectorAll("[data-morph]")];
547
547
  return s.length ? s : [t];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.70.4",
3
+ "version": "0.70.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"