aptechka 0.4.38 → 0.4.40

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 tt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var K=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var i=(n,t,e)=>(K(n,t,"read from private field"),e?e.call(n):t.get(n)),o=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)},a=(n,t,e,r)=>(K(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e);var m=(n,t,e)=>(K(n,t,"access private method"),e);var T=(n,t,e)=>new Promise((r,s)=>{var c=u=>{try{d(e.next(u))}catch(f){s(f)}},L=u=>{try{d(e.throw(u))}catch(f){s(f)}},d=u=>u.done?r(u.value):Promise.resolve(u.value).then(c,L);d((e=e.apply(n,t)).next())});var et=(n,t,e)=>(t=n[tt("asyncIterator")])?t.call(n):(n=n[tt("iterator")](),t={},e=(r,s)=>(s=n[r])&&(t[r]=c=>new Promise((L,d,u)=>(c=s.call(n,c),u=c.done,Promise.resolve(c.value).then(f=>L({value:f,done:u}),d)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("../notifier/index.cjs"),ct=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var y,l,b,H,S,P;class lt{constructor(t,e){o(this,y,void 0);o(this,l,void 0);o(this,b,void 0);o(this,H,void 0);o(this,S,t=>{t.preventDefault(),i(this,y).navigate(i(this,b),i(this,H))});o(this,P,()=>{i(this,y).prefetch(i(this,b)),i(this,l).removeEventListener("pointerenter",i(this,P))});a(this,y,e),a(this,l,t),a(this,b,i(this,l).getAttribute("href")||"/"),a(this,H,i(this,l).getAttribute("data-history-action")||"push"),i(this,l).addEventListener("click",i(this,S));const r=e.normalizePath(i(this,b)),s=e.normalizePath(location.pathname);i(this,l).hasAttribute("data-include")?s.pathname.includes(r.pathname)&&i(this,l).classList.add("current"):r.pathname===s.pathname&&i(this,l).classList.add("current"),i(this,l).hasAttribute("data-prefetch")&&i(this,l).addEventListener("pointerenter",i(this,P))}destroy(){i(this,l).removeEventListener("click",i(this,S)),i(this,l).removeEventListener("pointerenter",i(this,P)),i(this,l).classList.remove("current")}}y=new WeakMap,l=new WeakMap,b=new WeakMap,H=new WeakMap,S=new WeakMap,P=new WeakMap;var p,A,N,C,k,O,w,E,M,W,q,x,Y,z,_,D,G,$,st,R,J,j;class ut{constructor(t){o(this,x);o(this,z);o(this,D);o(this,$);o(this,R);o(this,p,null);o(this,A,null);o(this,N,null);o(this,C,null);o(this,k,[]);o(this,O,new DOMParser);o(this,w,new Map);o(this,E,void 0);o(this,M,null);o(this,W,new it.Notifier);o(this,q,new it.Notifier);o(this,j,t=>{t.state&&this.navigate(t.state,"none")});ct.isBrowser&&(a(this,p,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(a(this,p,t.base),t.base.endsWith("/")||a(this,p,i(this,p)+"/")):a(this,p,"/"),a(this,A,(t==null?void 0:t.waitForHeadToLoad)!==!1),a(this,N,(t==null?void 0:t.cachePages)!==!1),a(this,C,m(this,D,G).call(this,document)),a(this,M,location.pathname),m(this,z,_).call(this),addEventListener("popstate",i(this,j)))}normalizePath(t){t=t.replace(i(this,p),""),t.startsWith("/")&&(t=t.slice(1));const e=t.split("#"),r=e[0].split("?"),s=r[0].endsWith("/")?r[0].slice(0,-1):r[0],c=i(this,p)+s,L=r==null?void 0:r[1],d=e==null?void 0:e[1];return{leaf:s,pathname:c,parameters:L,hash:d}}beforeNavigationEvent(t){return i(this,W).subscribe(t)}afterNavigationEvent(t){return i(this,q).subscribe(t)}prefetch(t){return T(this,null,function*(){const e=this.normalizePath(t);return m(this,x,Y).call(this,e.pathname)})}navigate(t,e="push"){return T(this,null,function*(){var u;const r=this.normalizePath(t);let{pathname:s,hash:c,parameters:L}=r;if(i(this,E)===s||i(this,M)===s)return;a(this,E,s);const d=i(this,w).has(s);try{let f=!0;if(i(this,W).notify({pathname:s,isCached:d}),this.preprocessor)try{yield new Promise((h,g)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:s,resolve:h,reject:g,isCached:d})})}catch(h){h?console.error(h):console.log("Route change canceled"),f=!1}if(!f||i(this,E)!==s)return;const Q=i(this,w).get(s)||(yield m(this,x,Y).call(this,s));if(i(this,E)!==s)return;const U=Array.from(document.head.children),V=Array.from(Q.head.cloneNode(!0).children),X=m(this,$,st).call(this,U,V),nt=m(this,R,J).call(this,U,X),F=m(this,R,J).call(this,V,X);nt.forEach(h=>{h.hasAttribute("data-permanent")||h.remove()}),F.forEach((h,g)=>{if(h.tagName==="SCRIPT"&&h.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=h.getAttribute("src"),F[g]=v}}),F.forEach(h=>{document.head.appendChild(h)});const B=F.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");i(this,A)&&B.length&&(yield new Promise(h=>T(this,null,function*(){let g=0;try{for(var v=et(B),mt,pt,gt;mt=!(pt=yield v.next()).done;mt=!1){const at=pt.value;at.onload=()=>{g++,g===B.length&&h()}}}catch(pt){gt=[pt]}finally{try{mt&&(pt=v.return)&&(yield pt.call(v))}finally{if(gt)throw gt[0]}}}))),a(this,M,s);const I=L||location.search,rt=c?c.startsWith("#")?c:"#"+c:"",ot=I?I.startsWith("?")?I:"?"+I:"",Z=`${s}${rt}${ot}`;e==="push"?history.pushState(s,"",Z):e==="replace"&&history.replaceState(s,"",Z);const ht=m(this,D,G).call(this,Q);i(this,C).forEach((h,g)=>{const v=ht[g];h.innerHTML=v.innerHTML}),m(this,z,_).call(this),(u=this.postprocessor)==null||u.call(this,{pathname:s,isCached:d}),i(this,q).notify({pathname:s,isCached:d})}catch(f){console.error(f)}a(this,E,void 0)})}}p=new WeakMap,A=new WeakMap,N=new WeakMap,C=new WeakMap,k=new WeakMap,O=new WeakMap,w=new WeakMap,E=new WeakMap,M=new WeakMap,W=new WeakMap,q=new WeakMap,x=new WeakSet,Y=function(t){return T(this,null,function*(){const e=i(this,w).get(t);if(e)return e;const s=yield(yield fetch(t)).text(),c=i(this,O).parseFromString(s,"text/html");return i(this,N)&&i(this,w).set(t,c),c})},z=new WeakSet,_=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var r;return(r=e.getAttribute("href"))==null?void 0:r.startsWith("/")});i(this,k).forEach(e=>e.destroy()),a(this,k,t.map(e=>new lt(e,this)))},D=new WeakSet,G=function(t){const e=t.querySelectorAll("[data-morph]");return e.length?[...e]:[t.body]},$=new WeakSet,st=function(t,e){return t.filter(r=>e.find(s=>s.outerHTML===r.outerHTML))},R=new WeakSet,J=function(t,e){return t.filter(r=>!e.find(s=>s.outerHTML===r.outerHTML))},j=new WeakMap;exports.Morph=ut;
1
+ "use strict";var rt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var J=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var s=(n,t,e)=>(J(n,t,"read from private field"),e?e.call(n):t.get(n)),o=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)},c=(n,t,e,r)=>(J(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e);var p=(n,t,e)=>(J(n,t,"access private method"),e);var H=(n,t,e)=>new Promise((r,i)=>{var h=f=>{try{u(e.next(f))}catch(m){i(m)}},d=f=>{try{u(e.throw(f))}catch(m){i(m)}},u=f=>f.done?r(f.value):Promise.resolve(f.value).then(h,d);u((e=e.apply(n,t)).next())});var ot=(n,t,e)=>(t=n[rt("asyncIterator")])?t.call(n):(n=n[rt("iterator")](),t={},e=(r,i)=>(i=n[r])&&(t[r]=h=>new Promise((d,u,f)=>(h=i.call(n,h),f=h.done,Promise.resolve(h.value).then(m=>d({value:m,done:f}),u)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("../notifier/index.cjs"),mt=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var y,l,b,A,N,M;class pt{constructor(t,e){o(this,y,void 0);o(this,l,void 0);o(this,b,void 0);o(this,A,void 0);o(this,N,t=>{t.preventDefault(),s(this,y).navigate(s(this,b),s(this,A))});o(this,M,()=>{s(this,y).prefetch(s(this,b)),s(this,l).removeEventListener("pointerenter",s(this,M))});var d;c(this,y,e),c(this,l,t),c(this,b,s(this,l).getAttribute("href")||"/"),c(this,A,s(this,l).getAttribute("data-history-action")||"push"),s(this,l).addEventListener("click",s(this,N));const r=e.normalizePath(s(this,b)),i=e.normalizePath(location.pathname),h=(d=s(this,l).getAttribute("data-match-paths"))==null?void 0:d.split(",").map(u=>e.normalizePath(u.trim()).pathname);s(this,l).hasAttribute("data-include")?i.pathname.includes(r.pathname)&&s(this,l).classList.add("current"):(r.pathname===i.pathname||h!=null&&h.includes(i.pathname))&&s(this,l).classList.add("current"),s(this,l).hasAttribute("data-prefetch")&&s(this,l).addEventListener("pointerenter",s(this,M))}destroy(){s(this,l).removeEventListener("click",s(this,N)),s(this,l).removeEventListener("pointerenter",s(this,M)),s(this,l).classList.remove("current")}}y=new WeakMap,l=new WeakMap,b=new WeakMap,A=new WeakMap,N=new WeakMap,M=new WeakMap;var g,S,C,k,W,$,w,L,P,z,q,x,Q,D,U,R,V,j,ht,F,X,B;class gt{constructor(t){o(this,x);o(this,D);o(this,R);o(this,j);o(this,F);o(this,g,null);o(this,S,null);o(this,C,null);o(this,k,null);o(this,W,[]);o(this,$,new DOMParser);o(this,w,new Map);o(this,L,void 0);o(this,P,null);o(this,z,new at.Notifier);o(this,q,new at.Notifier);o(this,B,t=>{t.state&&this.navigate(t.state,"none")});mt.isBrowser&&(c(this,g,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(c(this,g,t.base),t.base.endsWith("/")||c(this,g,s(this,g)+"/")):c(this,g,"/"),c(this,S,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,C,(t==null?void 0:t.cachePages)!==!1),c(this,k,p(this,R,V).call(this,document.body)),c(this,P,location.pathname),p(this,D,U).call(this),addEventListener("popstate",s(this,B)))}normalizePath(t){t=t.replace(s(this,g),""),t.startsWith("/")&&(t=t.slice(1));const e=t.split("#"),r=e[0].split("?"),i=r[0].endsWith("/")?r[0].slice(0,-1):r[0],h=s(this,g)+i,d=r==null?void 0:r[1],u=e==null?void 0:e[1];return{leaf:i,pathname:h,parameters:d,hash:u}}beforeNavigationEvent(t){return s(this,z).subscribe(t)}afterNavigationEvent(t){return s(this,q).subscribe(t)}prefetch(t){return H(this,null,function*(){const e=this.normalizePath(t);return p(this,x,Q).call(this,e.pathname)})}navigate(t,e="push"){return H(this,null,function*(){var f;const r=this.normalizePath(t);let{pathname:i,hash:h,parameters:d}=r;if(s(this,L)===i||s(this,P)===i)return;c(this,L,i);const u=s(this,w).has(i);try{let m=!0;if(s(this,z).notify({pathname:i,isCached:u}),this.preprocessor)try{yield new Promise((a,E)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:i,resolve:a,reject:E,isCached:u})})}catch(a){a?console.error(a):console.log("Route change canceled"),m=!1}if(!m||s(this,L)!==i)return;const Z=s(this,w).get(i)||(yield p(this,x,Q).call(this,i));if(s(this,L)!==i)return;const tt=Array.from(document.head.children),et=Array.from(Z.head.cloneNode(!0).children),st=p(this,j,ht).call(this,tt,et),ct=p(this,F,X).call(this,tt,st),I=p(this,F,X).call(this,et,st);ct.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),I.forEach((a,E)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=a.getAttribute("src"),I[E]=v}}),I.forEach(a=>{document.head.appendChild(a)});const K=I.filter(a=>a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK");s(this,S)&&K.length&&(yield new Promise(a=>H(this,null,function*(){let E=0;try{for(var v=ot(K),dt,Y,T;dt=!(Y=yield v.next()).done;dt=!1){const _=Y.value;_.onload=()=>{E++,E===K.length&&a()}}}catch(Y){T=[Y]}finally{try{dt&&(Y=v.return)&&(yield Y.call(v))}finally{if(T)throw T[0]}}}))),c(this,P,i);const O=d||location.search,lt=h?h.startsWith("#")?h:"#"+h:"",ut=O?O.startsWith("?")?O:"?"+O:"",it=`${i}${lt}${ut}`;e==="push"?history.pushState(i,"",it):e==="replace"&&history.replaceState(i,"",it);const ft=p(this,R,V).call(this,Z.body.cloneNode(!0));s(this,k).forEach((a,E)=>{const v=ft[E];let dt=[...a.childNodes],Y=[...v.childNodes];dt.forEach(T=>{if(T instanceof HTMLElement){const _=T.hasAttribute("data-remain");let nt;Y=Y.filter(G=>G instanceof HTMLElement&&G.outerHTML===T.outerHTML?(nt=G,!1):!0),_&&nt||T.remove()}else T.remove()}),a.append(...Y)}),p(this,D,U).call(this),(f=this.postprocessor)==null||f.call(this,{pathname:i,isCached:u}),s(this,q).notify({pathname:i,isCached:u})}catch(m){console.error(m)}c(this,L,void 0)})}}g=new WeakMap,S=new WeakMap,C=new WeakMap,k=new WeakMap,W=new WeakMap,$=new WeakMap,w=new WeakMap,L=new WeakMap,P=new WeakMap,z=new WeakMap,q=new WeakMap,x=new WeakSet,Q=function(t){return H(this,null,function*(){const e=s(this,w).get(t);if(e)return e;const i=yield(yield fetch(t)).text(),h=s(this,$).parseFromString(i,"text/html");return s(this,C)&&s(this,w).set(t,h),h})},D=new WeakSet,U=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var r;return(r=e.getAttribute("href"))==null?void 0:r.startsWith("/")});s(this,W).forEach(e=>e.destroy()),c(this,W,t.map(e=>new pt(e,this)))},R=new WeakSet,V=function(t){return[...t.querySelectorAll("[data-morph]")]},j=new WeakSet,ht=function(t,e){return t.filter(r=>e.find(i=>i.outerHTML===r.outerHTML))},F=new WeakSet,X=function(t,e){return t.filter(r=>!e.find(i=>i.outerHTML===r.outerHTML))},B=new WeakMap;exports.Morph=gt;
@@ -1,94 +1,95 @@
1
- var tt = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n);
2
- var Y = (n, t, e) => {
1
+ var rt = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n);
2
+ var Q = (n, t, e) => {
3
3
  if (!t.has(n))
4
4
  throw TypeError("Cannot " + e);
5
5
  };
6
- var s = (n, t, e) => (Y(n, t, "read from private field"), e ? e.call(n) : t.get(n)), o = (n, t, e) => {
6
+ var s = (n, t, e) => (Q(n, t, "read from private field"), e ? e.call(n) : t.get(n)), o = (n, t, e) => {
7
7
  if (t.has(n))
8
8
  throw TypeError("Cannot add the same private member more than once");
9
9
  t instanceof WeakSet ? t.add(n) : t.set(n, e);
10
- }, a = (n, t, e, r) => (Y(n, t, "write to private field"), r ? r.call(n, e) : t.set(n, e), e);
11
- var m = (n, t, e) => (Y(n, t, "access private method"), e);
10
+ }, c = (n, t, e, r) => (Q(n, t, "write to private field"), r ? r.call(n, e) : t.set(n, e), e);
11
+ var p = (n, t, e) => (Q(n, t, "access private method"), e);
12
12
  var T = (n, t, e) => new Promise((r, i) => {
13
- var c = (u) => {
13
+ var h = (f) => {
14
14
  try {
15
- f(e.next(u));
16
- } catch (d) {
17
- i(d);
15
+ u(e.next(f));
16
+ } catch (m) {
17
+ i(m);
18
18
  }
19
- }, v = (u) => {
19
+ }, d = (f) => {
20
20
  try {
21
- f(e.throw(u));
22
- } catch (d) {
23
- i(d);
21
+ u(e.throw(f));
22
+ } catch (m) {
23
+ i(m);
24
24
  }
25
- }, f = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(c, v);
26
- f((e = e.apply(n, t)).next());
25
+ }, u = (f) => f.done ? r(f.value) : Promise.resolve(f.value).then(h, d);
26
+ u((e = e.apply(n, t)).next());
27
27
  });
28
- var et = (n, t, e) => (t = n[tt("asyncIterator")]) ? t.call(n) : (n = n[tt("iterator")](), t = {}, e = (r, i) => (i = n[r]) && (t[r] = (c) => new Promise((v, f, u) => (c = i.call(n, c), u = c.done, Promise.resolve(c.value).then((d) => v({ value: d, done: u }), f)))), e("next"), e("return"), t);
29
- import { Notifier as st } from "../notifier/index.js";
30
- import { i as ct } from "../browser-0zX67oeU.js";
28
+ var ot = (n, t, e) => (t = n[rt("asyncIterator")]) ? t.call(n) : (n = n[rt("iterator")](), t = {}, e = (r, i) => (i = n[r]) && (t[r] = (h) => new Promise((d, u, f) => (h = i.call(n, h), f = h.done, Promise.resolve(h.value).then((m) => d({ value: m, done: f }), u)))), e("next"), e("return"), t);
29
+ import { Notifier as at } from "../notifier/index.js";
30
+ import { i as mt } from "../browser-0zX67oeU.js";
31
31
  import "../path-data-polyfill-DgeDWYeI.js";
32
- var y, l, w, A, M, P;
33
- class lt {
32
+ var y, l, b, A, N, M;
33
+ class pt {
34
34
  constructor(t, e) {
35
35
  o(this, y, void 0);
36
36
  o(this, l, void 0);
37
- o(this, w, void 0);
37
+ o(this, b, void 0);
38
38
  o(this, A, void 0);
39
- o(this, M, (t) => {
40
- t.preventDefault(), s(this, y).navigate(s(this, w), s(this, A));
39
+ o(this, N, (t) => {
40
+ t.preventDefault(), s(this, y).navigate(s(this, b), s(this, A));
41
41
  });
42
- o(this, P, () => {
43
- s(this, y).prefetch(s(this, w)), s(this, l).removeEventListener("pointerenter", s(this, P));
42
+ o(this, M, () => {
43
+ s(this, y).prefetch(s(this, b)), s(this, l).removeEventListener("pointerenter", s(this, M));
44
44
  });
45
- a(this, y, e), a(this, l, t), a(this, w, s(this, l).getAttribute("href") || "/"), a(this, A, s(this, l).getAttribute(
45
+ var d;
46
+ c(this, y, e), c(this, l, t), c(this, b, s(this, l).getAttribute("href") || "/"), c(this, A, s(this, l).getAttribute(
46
47
  "data-history-action"
47
- ) || "push"), s(this, l).addEventListener("click", s(this, M));
48
- const r = e.normalizePath(s(this, w)), i = e.normalizePath(location.pathname);
49
- s(this, l).hasAttribute("data-include") ? i.pathname.includes(r.pathname) && s(this, l).classList.add("current") : r.pathname === i.pathname && s(this, l).classList.add("current"), s(this, l).hasAttribute("data-prefetch") && s(this, l).addEventListener("pointerenter", s(this, P));
48
+ ) || "push"), s(this, l).addEventListener("click", s(this, N));
49
+ const r = e.normalizePath(s(this, b)), i = e.normalizePath(location.pathname), h = (d = s(this, l).getAttribute("data-match-paths")) == null ? void 0 : d.split(",").map((u) => e.normalizePath(u.trim()).pathname);
50
+ s(this, l).hasAttribute("data-include") ? i.pathname.includes(r.pathname) && s(this, l).classList.add("current") : (r.pathname === i.pathname || h != null && h.includes(i.pathname)) && s(this, l).classList.add("current"), s(this, l).hasAttribute("data-prefetch") && s(this, l).addEventListener("pointerenter", s(this, M));
50
51
  }
51
52
  destroy() {
52
- s(this, l).removeEventListener("click", s(this, M)), s(this, l).removeEventListener("pointerenter", s(this, P)), s(this, l).classList.remove("current");
53
+ s(this, l).removeEventListener("click", s(this, N)), s(this, l).removeEventListener("pointerenter", s(this, M)), s(this, l).classList.remove("current");
53
54
  }
54
55
  }
55
- y = new WeakMap(), l = new WeakMap(), w = new WeakMap(), A = new WeakMap(), M = new WeakMap(), P = new WeakMap();
56
- var p, N, S, C, k, q, b, L, H, W, x, z, j, D, G, R, J, O, it, F, Q, B;
57
- class pt {
56
+ y = new WeakMap(), l = new WeakMap(), b = new WeakMap(), A = new WeakMap(), N = new WeakMap(), M = new WeakMap();
57
+ var E, C, S, k, W, O, w, v, P, z, x, D, U, R, V, F, X, B, ht, I, Z, K;
58
+ class bt {
58
59
  constructor(t) {
59
- o(this, z);
60
60
  o(this, D);
61
61
  o(this, R);
62
- o(this, O);
63
62
  o(this, F);
64
- o(this, p, null);
65
- o(this, N, null);
66
- o(this, S, null);
63
+ o(this, B);
64
+ o(this, I);
65
+ o(this, E, null);
67
66
  o(this, C, null);
68
- o(this, k, []);
69
- o(this, q, new DOMParser());
70
- o(this, b, /* @__PURE__ */ new Map());
71
- o(this, L, void 0);
72
- o(this, H, null);
73
- o(this, W, new st());
74
- o(this, x, new st());
75
- o(this, B, (t) => {
67
+ o(this, S, null);
68
+ o(this, k, null);
69
+ o(this, W, []);
70
+ o(this, O, new DOMParser());
71
+ o(this, w, /* @__PURE__ */ new Map());
72
+ o(this, v, void 0);
73
+ o(this, P, null);
74
+ o(this, z, new at());
75
+ o(this, x, new at());
76
+ o(this, K, (t) => {
76
77
  t.state && this.navigate(t.state, "none");
77
78
  });
78
- ct && (a(this, p, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (a(this, p, t.base), t.base.endsWith("/") || a(this, p, s(this, p) + "/")) : a(this, p, "/"), a(this, N, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), a(this, S, (t == null ? void 0 : t.cachePages) !== !1), a(this, C, m(this, R, J).call(this, document)), a(this, H, location.pathname), m(this, D, G).call(this), addEventListener("popstate", s(this, B)));
79
+ mt && (c(this, E, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (c(this, E, t.base), t.base.endsWith("/") || c(this, E, s(this, E) + "/")) : c(this, E, "/"), c(this, C, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, S, (t == null ? void 0 : t.cachePages) !== !1), c(this, k, p(this, F, X).call(this, document.body)), c(this, P, location.pathname), p(this, R, V).call(this), addEventListener("popstate", s(this, K)));
79
80
  }
80
81
  normalizePath(t) {
81
- t = t.replace(s(this, p), ""), t.startsWith("/") && (t = t.slice(1));
82
- const e = t.split("#"), r = e[0].split("?"), i = r[0].endsWith("/") ? r[0].slice(0, -1) : r[0], c = s(this, p) + i, v = r == null ? void 0 : r[1], f = e == null ? void 0 : e[1];
82
+ t = t.replace(s(this, E), ""), t.startsWith("/") && (t = t.slice(1));
83
+ const e = t.split("#"), r = e[0].split("?"), i = r[0].endsWith("/") ? r[0].slice(0, -1) : r[0], h = s(this, E) + i, d = r == null ? void 0 : r[1], u = e == null ? void 0 : e[1];
83
84
  return {
84
85
  leaf: i,
85
- pathname: c,
86
- parameters: v,
87
- hash: f
86
+ pathname: h,
87
+ parameters: d,
88
+ hash: u
88
89
  };
89
90
  }
90
91
  beforeNavigationEvent(t) {
91
- return s(this, W).subscribe(t);
92
+ return s(this, z).subscribe(t);
92
93
  }
93
94
  afterNavigationEvent(t) {
94
95
  return s(this, x).subscribe(t);
@@ -96,119 +97,128 @@ class pt {
96
97
  prefetch(t) {
97
98
  return T(this, null, function* () {
98
99
  const e = this.normalizePath(t);
99
- return m(this, z, j).call(this, e.pathname);
100
+ return p(this, D, U).call(this, e.pathname);
100
101
  });
101
102
  }
102
103
  navigate(t, e = "push") {
103
104
  return T(this, null, function* () {
104
- var u;
105
+ var f;
105
106
  const r = this.normalizePath(t);
106
- let { pathname: i, hash: c, parameters: v } = r;
107
- if (s(this, L) === i || s(this, H) === i)
107
+ let { pathname: i, hash: h, parameters: d } = r;
108
+ if (s(this, v) === i || s(this, P) === i)
108
109
  return;
109
- a(this, L, i);
110
- const f = s(this, b).has(i);
110
+ c(this, v, i);
111
+ const u = s(this, w).has(i);
111
112
  try {
112
- let d = !0;
113
- if (s(this, W).notify({
113
+ let m = !0;
114
+ if (s(this, z).notify({
114
115
  pathname: i,
115
- isCached: f
116
+ isCached: u
116
117
  }), this.preprocessor)
117
118
  try {
118
- yield new Promise((h, g) => {
119
- var E;
120
- (E = this.preprocessor) == null || E.call(this, { pathname: i, resolve: h, reject: g, isCached: f });
119
+ yield new Promise((a, g) => {
120
+ var L;
121
+ (L = this.preprocessor) == null || L.call(this, { pathname: i, resolve: a, reject: g, isCached: u });
121
122
  });
122
- } catch (h) {
123
- h ? console.error(h) : console.log("Route change canceled"), d = !1;
123
+ } catch (a) {
124
+ a ? console.error(a) : console.log("Route change canceled"), m = !1;
124
125
  }
125
- if (!d || s(this, L) !== i)
126
+ if (!m || s(this, v) !== i)
126
127
  return;
127
- const U = s(this, b).get(i) || (yield m(this, z, j).call(this, i));
128
- if (s(this, L) !== i)
128
+ const _ = s(this, w).get(i) || (yield p(this, D, U).call(this, i));
129
+ if (s(this, v) !== i)
129
130
  return;
130
- const V = Array.from(document.head.children), X = Array.from(
131
- U.head.cloneNode(!0).children
132
- ), Z = m(this, O, it).call(this, V, X), nt = m(this, F, Q).call(this, V, Z), I = m(this, F, Q).call(this, X, Z);
133
- nt.forEach((h) => {
134
- h.hasAttribute("data-permanent") || h.remove();
135
- }), I.forEach((h, g) => {
136
- if (h.tagName === "SCRIPT" && h.getAttribute("src")) {
137
- const E = document.createElement("script");
138
- E.type = "module", E.src = h.getAttribute("src"), I[g] = E;
131
+ const tt = Array.from(document.head.children), et = Array.from(
132
+ _.head.cloneNode(!0).children
133
+ ), st = p(this, B, ht).call(this, tt, et), ct = p(this, I, Z).call(this, tt, st), $ = p(this, I, Z).call(this, et, st);
134
+ ct.forEach((a) => {
135
+ a.hasAttribute("data-permanent") || a.remove();
136
+ }), $.forEach((a, g) => {
137
+ if (a.tagName === "SCRIPT" && a.getAttribute("src")) {
138
+ const L = document.createElement("script");
139
+ L.type = "module", L.src = a.getAttribute("src"), $[g] = L;
139
140
  }
140
- }), I.forEach((h) => {
141
- document.head.appendChild(h);
141
+ }), $.forEach((a) => {
142
+ document.head.appendChild(a);
142
143
  });
143
- const K = I.filter(
144
- (h) => h.tagName === "STYLE" || h.tagName === "SCRIPT" || h.tagName === "LINK"
144
+ const Y = $.filter(
145
+ (a) => a.tagName === "STYLE" || a.tagName === "SCRIPT" || a.tagName === "LINK"
145
146
  );
146
- s(this, N) && K.length && (yield new Promise((h) => T(this, null, function* () {
147
+ s(this, C) && Y.length && (yield new Promise((a) => T(this, null, function* () {
147
148
  let g = 0;
148
149
  try {
149
- for (var E = et(K), Lt, vt, wt; Lt = !(vt = yield E.next()).done; Lt = !1) {
150
- const at = vt.value;
151
- at.onload = () => {
152
- g++, g === K.length && h();
150
+ for (var L = ot(Y), dt, j, H; dt = !(j = yield L.next()).done; dt = !1) {
151
+ const G = j.value;
152
+ G.onload = () => {
153
+ g++, g === Y.length && a();
153
154
  };
154
155
  }
155
- } catch (vt) {
156
- wt = [vt];
156
+ } catch (j) {
157
+ H = [j];
157
158
  } finally {
158
159
  try {
159
- Lt && (vt = E.return) && (yield vt.call(E));
160
+ dt && (j = L.return) && (yield j.call(L));
160
161
  } finally {
161
- if (wt)
162
- throw wt[0];
162
+ if (H)
163
+ throw H[0];
163
164
  }
164
165
  }
165
- }))), a(this, H, i);
166
- const $ = v || location.search, rt = c ? c.startsWith("#") ? c : "#" + c : "", ot = $ ? $.startsWith("?") ? $ : "?" + $ : "", _ = `${i}${rt}${ot}`;
167
- e === "push" ? history.pushState(i, "", _) : e === "replace" && history.replaceState(i, "", _);
168
- const ht = m(this, R, J).call(this, U);
169
- s(this, C).forEach((h, g) => {
170
- const E = ht[g];
171
- h.innerHTML = E.innerHTML;
172
- }), m(this, D, G).call(this), (u = this.postprocessor) == null || u.call(this, { pathname: i, isCached: f }), s(this, x).notify({ pathname: i, isCached: f });
173
- } catch (d) {
174
- console.error(d);
166
+ }))), c(this, P, i);
167
+ const q = d || location.search, lt = h ? h.startsWith("#") ? h : "#" + h : "", ut = q ? q.startsWith("?") ? q : "?" + q : "", it = `${i}${lt}${ut}`;
168
+ e === "push" ? history.pushState(i, "", it) : e === "replace" && history.replaceState(i, "", it);
169
+ const ft = p(this, F, X).call(this, _.body.cloneNode(!0));
170
+ s(this, k).forEach((a, g) => {
171
+ const L = ft[g];
172
+ let dt = [...a.childNodes], j = [...L.childNodes];
173
+ dt.forEach((H) => {
174
+ if (H instanceof HTMLElement) {
175
+ const G = H.hasAttribute("data-remain");
176
+ let nt;
177
+ j = j.filter(
178
+ (J) => J instanceof HTMLElement && J.outerHTML === H.outerHTML ? (nt = J, !1) : !0
179
+ ), G && nt || H.remove();
180
+ } else
181
+ H.remove();
182
+ }), a.append(...j);
183
+ }), p(this, R, V).call(this), (f = this.postprocessor) == null || f.call(this, { pathname: i, isCached: u }), s(this, x).notify({ pathname: i, isCached: u });
184
+ } catch (m) {
185
+ console.error(m);
175
186
  }
176
- a(this, L, void 0);
187
+ c(this, v, void 0);
177
188
  });
178
189
  }
179
190
  }
180
- p = new WeakMap(), N = new WeakMap(), S = new WeakMap(), C = new WeakMap(), k = new WeakMap(), q = new WeakMap(), b = new WeakMap(), L = new WeakMap(), H = new WeakMap(), W = new WeakMap(), x = new WeakMap(), z = new WeakSet(), j = function(t) {
191
+ E = new WeakMap(), C = new WeakMap(), S = new WeakMap(), k = new WeakMap(), W = new WeakMap(), O = new WeakMap(), w = new WeakMap(), v = new WeakMap(), P = new WeakMap(), z = new WeakMap(), x = new WeakMap(), D = new WeakSet(), U = function(t) {
181
192
  return T(this, null, function* () {
182
- const e = s(this, b).get(t);
193
+ const e = s(this, w).get(t);
183
194
  if (e)
184
195
  return e;
185
- const i = yield (yield fetch(t)).text(), c = s(this, q).parseFromString(i, "text/html");
186
- return s(this, S) && s(this, b).set(t, c), c;
196
+ const i = yield (yield fetch(t)).text(), h = s(this, O).parseFromString(i, "text/html");
197
+ return s(this, S) && s(this, w).set(t, h), h;
187
198
  });
188
- }, D = new WeakSet(), G = function() {
199
+ }, R = new WeakSet(), V = function() {
189
200
  const t = [
190
201
  ...document.documentElement.querySelectorAll("a")
191
202
  ].filter((e) => {
192
203
  var r;
193
204
  return (r = e.getAttribute("href")) == null ? void 0 : r.startsWith("/");
194
205
  });
195
- s(this, k).forEach((e) => e.destroy()), a(this, k, t.map((e) => new lt(e, this)));
196
- }, R = new WeakSet(), J = function(t) {
197
- const e = t.querySelectorAll("[data-morph]");
198
- return e.length ? [...e] : [t.body];
199
- }, O = new WeakSet(), it = function(t, e) {
206
+ s(this, W).forEach((e) => e.destroy()), c(this, W, t.map((e) => new pt(e, this)));
207
+ }, F = new WeakSet(), X = function(t) {
208
+ return [...t.querySelectorAll("[data-morph]")];
209
+ }, B = new WeakSet(), ht = function(t, e) {
200
210
  return t.filter(
201
211
  (r) => e.find(
202
212
  (i) => i.outerHTML === r.outerHTML
203
213
  )
204
214
  );
205
- }, F = new WeakSet(), Q = function(t, e) {
215
+ }, I = new WeakSet(), Z = function(t, e) {
206
216
  return t.filter(
207
217
  (r) => !e.find(
208
218
  (i) => i.outerHTML === r.outerHTML
209
219
  )
210
220
  );
211
- }, B = new WeakMap();
221
+ }, K = new WeakMap();
212
222
  export {
213
- pt as Morph
223
+ bt as Morph
214
224
  };
@@ -55,7 +55,7 @@ export interface StorePassport<T extends StoreManagerType = StoreManagerType> {
55
55
  export type StoreMiddleware<T> = (value: T) => T;
56
56
  export interface StoreOptions<StoreType, StoreManager extends StoreManagerType = StoreManagerType> {
57
57
  equalityCheck?: StoreEqualityCheckCallback<StoreType>;
58
- passport?: StorePassport<StoreManager>;
58
+ passport?: StorePassport<StoreManager> | undefined;
59
59
  validate?: StoreMiddleware<StoreType>;
60
60
  skipSubscribeNotification?: boolean;
61
61
  notifyAndClose?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.4.38",
3
+ "version": "0.4.40",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"