aptechka 0.4.34 → 0.4.35

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,w,H,S,P;class lt{constructor(t,e){o(this,y,void 0);o(this,l,void 0);o(this,w,void 0);o(this,H,void 0);o(this,S,t=>{t.preventDefault(),i(this,y).navigate(i(this,w),i(this,H))});o(this,P,()=>{i(this,y).prefetch(i(this,w)),i(this,l).removeEventListener("pointerenter",i(this,P))});a(this,y,e),a(this,l,t),a(this,w,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,w)),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,w=new WeakMap,H=new WeakMap,S=new WeakMap,P=new WeakMap;var g,N,A,C,k,O,b,E,M,W,x,q,Y,z,_,D,G,$,st,R,J,j;class ut{constructor(t){o(this,q);o(this,z);o(this,D);o(this,$);o(this,R);o(this,g,null);o(this,N,null);o(this,A,null);o(this,C,null);o(this,k,[]);o(this,O,new DOMParser);o(this,b,new Map);o(this,E,void 0);o(this,M,null);o(this,W,new it.Notifier);o(this,x,new it.Notifier);o(this,j,t=>{t.state&&this.navigate(t.state,"none")});ct.isBrowser&&(a(this,g,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(a(this,g,t.base),t.base.endsWith("/")||a(this,g,i(this,g)+"/")):a(this,g,"/"),a(this,N,(t==null?void 0:t.waitForHeadToLoad)!==!1),a(this,A,(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,g),""),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,g)+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,x).subscribe(t)}prefetch(t){return T(this,null,function*(){const e=this.normalizePath(t);return m(this,q,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,b).has(s);try{let f=!0;if(i(this,W).notify({pathname:s,isCached:d}),this.preprocessor)try{yield new Promise((h,p)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:s,resolve:h,reject:p,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,b).get(s)||(yield m(this,q,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.remove()}),F.forEach((h,p)=>{if(h.tagName==="SCRIPT"&&h.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=h.getAttribute("src"),F[p]=v}}),F.forEach((h,p)=>{document.head.appendChild(h)});const B=F.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");i(this,N)&&B.length&&(yield new Promise(h=>T(this,null,function*(){let p=0;try{for(var v=et(B),mt,pt,gt;mt=!(pt=yield v.next()).done;mt=!1){const at=pt.value;at.onload=()=>{p++,p===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,p)=>{const v=ht[p];h.innerHTML=v.innerHTML}),m(this,z,_).call(this),(u=this.postprocessor)==null||u.call(this,{pathname:s,isCached:d}),i(this,x).notify({pathname:s,isCached:d})}catch(f){console.error(f)}a(this,E,void 0)})}}g=new WeakMap,N=new WeakMap,A=new WeakMap,C=new WeakMap,k=new WeakMap,O=new WeakMap,b=new WeakMap,E=new WeakMap,M=new WeakMap,W=new WeakMap,x=new WeakMap,q=new WeakSet,Y=function(t){return T(this,null,function*(){const e=i(this,b).get(t);if(e)return e;const s=yield(yield fetch(t)).text(),c=i(this,O).parseFromString(s,"text/html");return i(this,A)&&i(this,b).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 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;
@@ -3,88 +3,88 @@ var Y = (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)), h = (n, t, e) => {
6
+ var s = (n, t, e) => (Y(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, o) => (Y(n, t, "write to private field"), o ? o.call(n, e) : t.set(n, e), 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
11
  var m = (n, t, e) => (Y(n, t, "access private method"), e);
12
- var T = (n, t, e) => new Promise((o, i) => {
12
+ var T = (n, t, e) => new Promise((r, i) => {
13
13
  var c = (u) => {
14
14
  try {
15
- d(e.next(u));
16
- } catch (f) {
17
- i(f);
15
+ f(e.next(u));
16
+ } catch (d) {
17
+ i(d);
18
18
  }
19
19
  }, v = (u) => {
20
20
  try {
21
- d(e.throw(u));
22
- } catch (f) {
23
- i(f);
21
+ f(e.throw(u));
22
+ } catch (d) {
23
+ i(d);
24
24
  }
25
- }, d = (u) => u.done ? o(u.value) : Promise.resolve(u.value).then(c, v);
26
- d((e = e.apply(n, t)).next());
25
+ }, f = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(c, v);
26
+ f((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 = (o, i) => (i = n[o]) && (t[o] = (c) => new Promise((v, d, u) => (c = i.call(n, c), u = c.done, Promise.resolve(c.value).then((f) => v({ value: f, done: u }), d)))), e("next"), e("return"), t);
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
29
  import { Notifier as st } from "../notifier/index.js";
30
30
  import { i as ct } from "../browser-0zX67oeU.js";
31
31
  import "../path-data-polyfill-DgeDWYeI.js";
32
- var y, l, w, M, A, P;
32
+ var y, l, w, A, M, P;
33
33
  class lt {
34
34
  constructor(t, e) {
35
- h(this, y, void 0);
36
- h(this, l, void 0);
37
- h(this, w, void 0);
38
- h(this, M, void 0);
39
- h(this, A, (t) => {
40
- t.preventDefault(), s(this, y).navigate(s(this, w), s(this, M));
35
+ o(this, y, void 0);
36
+ o(this, l, void 0);
37
+ o(this, w, void 0);
38
+ o(this, A, void 0);
39
+ o(this, M, (t) => {
40
+ t.preventDefault(), s(this, y).navigate(s(this, w), s(this, A));
41
41
  });
42
- h(this, P, () => {
42
+ o(this, P, () => {
43
43
  s(this, y).prefetch(s(this, w)), s(this, l).removeEventListener("pointerenter", s(this, P));
44
44
  });
45
- a(this, y, e), a(this, l, t), a(this, w, s(this, l).getAttribute("href") || "/"), a(this, M, s(this, l).getAttribute(
45
+ a(this, y, e), a(this, l, t), a(this, w, s(this, l).getAttribute("href") || "/"), a(this, A, s(this, l).getAttribute(
46
46
  "data-history-action"
47
- ) || "push"), s(this, l).addEventListener("click", s(this, A));
48
- const o = e.normalizePath(s(this, w)), i = e.normalizePath(location.pathname);
49
- s(this, l).hasAttribute("data-include") ? i.pathname.includes(o.pathname) && s(this, l).classList.add("current") : o.pathname === i.pathname && s(this, l).classList.add("current"), s(this, l).hasAttribute("data-prefetch") && s(this, l).addEventListener("pointerenter", s(this, P));
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));
50
50
  }
51
51
  destroy() {
52
- s(this, l).removeEventListener("click", s(this, A)), s(this, l).removeEventListener("pointerenter", s(this, P)), s(this, l).classList.remove("current");
52
+ s(this, l).removeEventListener("click", s(this, M)), s(this, l).removeEventListener("pointerenter", s(this, P)), s(this, l).classList.remove("current");
53
53
  }
54
54
  }
55
- y = new WeakMap(), l = new WeakMap(), w = new WeakMap(), M = new WeakMap(), A = new WeakMap(), P = new WeakMap();
56
- var g, N, S, C, k, q, b, L, H, W, x, z, j, D, G, R, J, O, it, F, Q, B;
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
57
  class pt {
58
58
  constructor(t) {
59
- h(this, z);
60
- h(this, D);
61
- h(this, R);
62
- h(this, O);
63
- h(this, F);
64
- h(this, g, null);
65
- h(this, N, null);
66
- h(this, S, null);
67
- h(this, C, null);
68
- h(this, k, []);
69
- h(this, q, new DOMParser());
70
- h(this, b, /* @__PURE__ */ new Map());
71
- h(this, L, void 0);
72
- h(this, H, null);
73
- h(this, W, new st());
74
- h(this, x, new st());
75
- h(this, B, (t) => {
59
+ o(this, z);
60
+ o(this, D);
61
+ o(this, R);
62
+ o(this, O);
63
+ o(this, F);
64
+ o(this, p, null);
65
+ o(this, N, null);
66
+ o(this, S, null);
67
+ 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) => {
76
76
  t.state && this.navigate(t.state, "none");
77
77
  });
78
- ct && (a(this, g, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (a(this, g, t.base), t.base.endsWith("/") || a(this, g, s(this, g) + "/")) : a(this, g, "/"), 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)));
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
79
  }
80
80
  normalizePath(t) {
81
- t = t.replace(s(this, g), ""), t.startsWith("/") && (t = t.slice(1));
82
- const e = t.split("#"), o = e[0].split("?"), i = o[0].endsWith("/") ? o[0].slice(0, -1) : o[0], c = s(this, g) + i, v = o == null ? void 0 : o[1], d = e == null ? void 0 : e[1];
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];
83
83
  return {
84
84
  leaf: i,
85
85
  pathname: c,
86
86
  parameters: v,
87
- hash: d
87
+ hash: f
88
88
  };
89
89
  }
90
90
  beforeNavigationEvent(t) {
@@ -102,27 +102,27 @@ class pt {
102
102
  navigate(t, e = "push") {
103
103
  return T(this, null, function* () {
104
104
  var u;
105
- const o = this.normalizePath(t);
106
- let { pathname: i, hash: c, parameters: v } = o;
105
+ const r = this.normalizePath(t);
106
+ let { pathname: i, hash: c, parameters: v } = r;
107
107
  if (s(this, L) === i || s(this, H) === i)
108
108
  return;
109
109
  a(this, L, i);
110
- const d = s(this, b).has(i);
110
+ const f = s(this, b).has(i);
111
111
  try {
112
- let f = !0;
112
+ let d = !0;
113
113
  if (s(this, W).notify({
114
114
  pathname: i,
115
- isCached: d
115
+ isCached: f
116
116
  }), this.preprocessor)
117
117
  try {
118
- yield new Promise((r, p) => {
118
+ yield new Promise((h, g) => {
119
119
  var E;
120
- (E = this.preprocessor) == null || E.call(this, { pathname: i, resolve: r, reject: p, isCached: d });
120
+ (E = this.preprocessor) == null || E.call(this, { pathname: i, resolve: h, reject: g, isCached: f });
121
121
  });
122
- } catch (r) {
123
- r ? console.error(r) : console.log("Route change canceled"), f = !1;
122
+ } catch (h) {
123
+ h ? console.error(h) : console.log("Route change canceled"), d = !1;
124
124
  }
125
- if (!f || s(this, L) !== i)
125
+ if (!d || s(this, L) !== i)
126
126
  return;
127
127
  const U = s(this, b).get(i) || (yield m(this, z, j).call(this, i));
128
128
  if (s(this, L) !== i)
@@ -130,26 +130,26 @@ class pt {
130
130
  const V = Array.from(document.head.children), X = Array.from(
131
131
  U.head.cloneNode(!0).children
132
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((r) => {
134
- r.remove();
135
- }), I.forEach((r, p) => {
136
- if (r.tagName === "SCRIPT" && r.getAttribute("src")) {
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
137
  const E = document.createElement("script");
138
- E.type = "module", E.src = r.getAttribute("src"), I[p] = E;
138
+ E.type = "module", E.src = h.getAttribute("src"), I[g] = E;
139
139
  }
140
- }), I.forEach((r, p) => {
141
- document.head.appendChild(r);
140
+ }), I.forEach((h) => {
141
+ document.head.appendChild(h);
142
142
  });
143
143
  const K = I.filter(
144
- (r) => r.tagName === "STYLE" || r.tagName === "SCRIPT" || r.tagName === "LINK"
144
+ (h) => h.tagName === "STYLE" || h.tagName === "SCRIPT" || h.tagName === "LINK"
145
145
  );
146
- s(this, N) && K.length && (yield new Promise((r) => T(this, null, function* () {
147
- let p = 0;
146
+ s(this, N) && K.length && (yield new Promise((h) => T(this, null, function* () {
147
+ let g = 0;
148
148
  try {
149
149
  for (var E = et(K), Lt, vt, wt; Lt = !(vt = yield E.next()).done; Lt = !1) {
150
150
  const at = vt.value;
151
151
  at.onload = () => {
152
- p++, p === K.length && r();
152
+ g++, g === K.length && h();
153
153
  };
154
154
  }
155
155
  } catch (vt) {
@@ -163,21 +163,21 @@ class pt {
163
163
  }
164
164
  }
165
165
  }))), a(this, H, i);
166
- const $ = v || location.search, ot = c ? c.startsWith("#") ? c : "#" + c : "", ht = $ ? $.startsWith("?") ? $ : "?" + $ : "", _ = `${i}${ot}${ht}`;
166
+ const $ = v || location.search, rt = c ? c.startsWith("#") ? c : "#" + c : "", ot = $ ? $.startsWith("?") ? $ : "?" + $ : "", _ = `${i}${rt}${ot}`;
167
167
  e === "push" ? history.pushState(i, "", _) : e === "replace" && history.replaceState(i, "", _);
168
- const rt = m(this, R, J).call(this, U);
169
- s(this, C).forEach((r, p) => {
170
- const E = rt[p];
171
- r.innerHTML = E.innerHTML;
172
- }), m(this, D, G).call(this), (u = this.postprocessor) == null || u.call(this, { pathname: i, isCached: d }), s(this, x).notify({ pathname: i, isCached: d });
173
- } catch (f) {
174
- console.error(f);
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);
175
175
  }
176
176
  a(this, L, void 0);
177
177
  });
178
178
  }
179
179
  }
180
- g = 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) {
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) {
181
181
  return T(this, null, function* () {
182
182
  const e = s(this, b).get(t);
183
183
  if (e)
@@ -189,8 +189,8 @@ g = new WeakMap(), N = new WeakMap(), S = new WeakMap(), C = new WeakMap(), k =
189
189
  const t = [
190
190
  ...document.documentElement.querySelectorAll("a")
191
191
  ].filter((e) => {
192
- var o;
193
- return (o = e.getAttribute("href")) == null ? void 0 : o.startsWith("/");
192
+ var r;
193
+ return (r = e.getAttribute("href")) == null ? void 0 : r.startsWith("/");
194
194
  });
195
195
  s(this, k).forEach((e) => e.destroy()), a(this, k, t.map((e) => new lt(e, this)));
196
196
  }, R = new WeakSet(), J = function(t) {
@@ -198,14 +198,14 @@ g = new WeakMap(), N = new WeakMap(), S = new WeakMap(), C = new WeakMap(), k =
198
198
  return e.length ? [...e] : [t.body];
199
199
  }, O = new WeakSet(), it = function(t, e) {
200
200
  return t.filter(
201
- (o) => e.find(
202
- (i) => i.outerHTML === o.outerHTML
201
+ (r) => e.find(
202
+ (i) => i.outerHTML === r.outerHTML
203
203
  )
204
204
  );
205
205
  }, F = new WeakSet(), Q = function(t, e) {
206
206
  return t.filter(
207
- (o) => !e.find(
208
- (i) => i.outerHTML === o.outerHTML
207
+ (r) => !e.find(
208
+ (i) => i.outerHTML === r.outerHTML
209
209
  )
210
210
  );
211
211
  }, B = new WeakMap();
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-BQGNOHlY.cjs");const t=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const r=require("../tags-CueX-JLX.cjs"),i=require("../createTheme-BSreUYge.cjs"),e=i.createTheme({colorDark:"#1c1c1c",colorDarkAux:"#282828",colorLight:"#ffffff",colorActive:"#00E5B0",tweakerWidth:"500px",tweakerOffset:"20px",tweakerFolderHeight:"40px",timelineWidth:"50vw",timelineHeight:"30vh",timelineOffset:"20px",heightInput:"30px",borderRadius:"12px",borderRadiusSmall:"4px",gapLarge:"16px",gapMedium:"12px",gapSmall:"8px",gapExtraSmall:"4px",fontSizeLarge:"20px",fontSizeMedium:"16px",fontSizeSmall:"14px",durationShort:"0.2s"},{prefix:"aptechka-"});t.isBrowser&&document.head.appendChild(r.style({":root":e.style}).node);exports.aptechkaTheme=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-BQGNOHlY.cjs");const r=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const a=require("../tags-CueX-JLX.cjs"),i=require("../createTheme-BSreUYge.cjs"),t=i.createTheme({colorDark:"#1c1c1c",colorDarkAux:"#282828",colorLight:"#ffffff",colorActive:"#00E5B0",tweakerWidth:"500px",tweakerOffset:"20px",tweakerFolderHeight:"40px",timelineWidth:"50vw",timelineHeight:"30vh",timelineOffset:"20px",heightInput:"30px",borderRadius:"12px",borderRadiusSmall:"4px",gapLarge:"16px",gapMedium:"12px",gapSmall:"8px",gapExtraSmall:"4px",fontSizeLarge:"20px",fontSizeMedium:"16px",fontSizeSmall:"14px",durationShort:"0.2s"},{prefix:"aptechka-"});if(r.isBrowser){const e=a.style({":root":t.style}).node;e.setAttribute("data-permanent",""),document.head.appendChild(e)}exports.aptechkaTheme=t;
@@ -1,9 +1,9 @@
1
1
  import "../Store-Cd-E5W1z.js";
2
- import { i as e } from "../browser-0zX67oeU.js";
2
+ import { i as t } from "../browser-0zX67oeU.js";
3
3
  import "../path-data-polyfill-DgeDWYeI.js";
4
- import { aD as t } from "../tags-BoPv9fDr.js";
5
- import { c as r } from "../createTheme-u3NsrEV6.js";
6
- const i = r(
4
+ import { aD as r } from "../tags-BoPv9fDr.js";
5
+ import { c as a } from "../createTheme-u3NsrEV6.js";
6
+ const o = a(
7
7
  {
8
8
  colorDark: "#1c1c1c",
9
9
  colorDarkAux: "#282828",
@@ -29,11 +29,12 @@ const i = r(
29
29
  },
30
30
  { prefix: "aptechka-" }
31
31
  );
32
- e && document.head.appendChild(
33
- t({
34
- ":root": i.style
35
- }).node
36
- );
32
+ if (t) {
33
+ const e = r({
34
+ ":root": o.style
35
+ }).node;
36
+ e.setAttribute("data-permanent", ""), document.head.appendChild(e);
37
+ }
37
38
  export {
38
- i as aptechkaTheme
39
+ o as aptechkaTheme
39
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.4.34",
3
+ "version": "0.4.35",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"