aptechka 0.1.11 → 0.1.14

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.
@@ -10,7 +10,6 @@ export declare class Tweened extends Animated {
10
10
  start(): void;
11
11
  pause(): void;
12
12
  stop(): void;
13
- get max(): import("../store").Store<number, keyof import("../store").StoreManagers, import("../store").StoreEntry<number>>;
14
13
  protected update(): void;
15
14
  protected handleAnimationFrame(e: TickerCallbackEntry): void;
16
15
  }
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty,c=Object.defineProperties;var l=Object.getOwnPropertyDescriptors;var r=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var i=(a,t,e)=>t in a?h(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,n=(a,t)=>{for(var e in t||(t={}))g.call(t,e)&&i(a,e,t[e]);if(r)for(var e of r(t))A.call(t,e)&&i(a,e,t[e]);return a},s=(a,t)=>c(a,l(t));var m=(a,t,e)=>(i(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../Animated-Bf-gPIQM.cjs"),x=require("../easings-DsS5-Kqc.cjs"),F=require("../Damped-BwpMU9Gi.cjs");class f extends d.Animated{constructor(e){super(s(n({},e),{min:(e==null?void 0:e.min)||0,max:(e==null?void 0:e.max)||1e3}));m(this,"easing");this.easing=(e==null?void 0:e.easing)||x.linear}start(){this.listenAnimationFrame()}pause(){this.unlistenAnimationFrame()}stop(){this.reset()}get max(){return super.max}update(){const e=(this.target-this.min.current)/(this.delta||1),u=this.easing(e);this.current=this.min.current+u*this.delta}handleAnimationFrame(e){this.shift(e.elapsed),(e.elapsed&&this.current===0||this.current===this.delta)&&this.unlistenAnimationFrame()}}exports.Animated=d.Animated;exports.Damped=F.Damped;exports.Tweened=f;
1
+ "use strict";var u=Object.defineProperty,c=Object.defineProperties;var l=Object.getOwnPropertyDescriptors;var r=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var i=(a,t,e)=>t in a?u(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,n=(a,t)=>{for(var e in t||(t={}))g.call(t,e)&&i(a,e,t[e]);if(r)for(var e of r(t))A.call(t,e)&&i(a,e,t[e]);return a},s=(a,t)=>c(a,l(t));var m=(a,t,e)=>(i(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../Animated-Bf-gPIQM.cjs"),F=require("../easings-DsS5-Kqc.cjs"),f=require("../Damped-BwpMU9Gi.cjs");class q extends d.Animated{constructor(e){super(s(n({},e),{min:(e==null?void 0:e.min)||0,max:(e==null?void 0:e.max)||1e3}));m(this,"easing");this.easing=(e==null?void 0:e.easing)||F.linear}start(){this.listenAnimationFrame()}pause(){this.unlistenAnimationFrame()}stop(){this.reset()}update(){const e=(this.target-this.min.current)/(this.delta||1),h=this.easing(e);this.current=this.min.current+h*this.delta}handleAnimationFrame(e){this.shift(e.elapsed),(e.elapsed&&this.current===0||this.current===this.delta)&&this.unlistenAnimationFrame()}}exports.Animated=d.Animated;exports.Damped=f.Damped;exports.Tweened=q;
@@ -1,27 +1,27 @@
1
1
  var d = Object.defineProperty, l = Object.defineProperties;
2
2
  var u = Object.getOwnPropertyDescriptors;
3
3
  var i = Object.getOwnPropertySymbols;
4
- var c = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
4
+ var c = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
5
5
  var r = (a, t, e) => t in a ? d(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, s = (a, t) => {
6
6
  for (var e in t || (t = {}))
7
7
  c.call(t, e) && r(a, e, t[e]);
8
8
  if (i)
9
9
  for (var e of i(t))
10
- x.call(t, e) && r(a, e, t[e]);
10
+ A.call(t, e) && r(a, e, t[e]);
11
11
  return a;
12
12
  }, m = (a, t) => l(a, u(t));
13
13
  var n = (a, t, e) => (r(a, typeof t != "symbol" ? t + "" : t, e), e);
14
- import { A as g } from "../Animated-Br_4OSth.js";
15
- import { l as A } from "../easings-BKi40vHz.js";
14
+ import { A as f } from "../Animated-Br_4OSth.js";
15
+ import { l as g } from "../easings-BKi40vHz.js";
16
16
  import { D as b } from "../Damped-urvryQLo.js";
17
- class w extends g {
17
+ class w extends f {
18
18
  constructor(e) {
19
19
  super(m(s({}, e), {
20
20
  min: (e == null ? void 0 : e.min) || 0,
21
21
  max: (e == null ? void 0 : e.max) || 1e3
22
22
  }));
23
23
  n(this, "easing");
24
- this.easing = (e == null ? void 0 : e.easing) || A;
24
+ this.easing = (e == null ? void 0 : e.easing) || g;
25
25
  }
26
26
  start() {
27
27
  this.listenAnimationFrame();
@@ -32,9 +32,6 @@ class w extends g {
32
32
  stop() {
33
33
  this.reset();
34
34
  }
35
- get max() {
36
- return super.max;
37
- }
38
35
  update() {
39
36
  const e = (this.target - this.min.current) / (this.delta || 1), h = this.easing(e);
40
37
  this.current = this.min.current + h * this.delta;
@@ -44,7 +41,7 @@ class w extends g {
44
41
  }
45
42
  }
46
43
  export {
47
- g as Animated,
44
+ f as Animated,
48
45
  b as Damped,
49
46
  w as Tweened
50
47
  };
@@ -22,5 +22,6 @@ export declare class Morph {
22
22
  constructor(parameters?: MorphParameters);
23
23
  beforeNavigationEvent(callback: MorphNavigationCallback): () => void;
24
24
  afterNavigationEvent(callback: MorphNavigationCallback): () => void;
25
+ prefetch(pathname: string): Promise<Document>;
25
26
  navigate(pathname: string, historyAction?: MorphHistoryAction): Promise<void>;
26
27
  }
@@ -1 +1 @@
1
- "use strict";var st=Object.defineProperty;var U=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var ot=(i,t,e)=>t in i?st(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var Y=(i,t,e)=>(ot(i,typeof t!="symbol"?t+"":t,e),e),_=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var s=(i,t,e)=>(_(i,t,"read from private field"),e?e.call(i):t.get(i)),o=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},r=(i,t,e,n)=>(_(i,t,"write to private field"),n?n.call(i,e):t.set(i,e),e);var d=(i,t,e)=>(_(i,t,"access private method"),e);var F=(i,t,e)=>new Promise((n,h)=>{var u=l=>{try{g(e.next(l))}catch(w){h(w)}},E=l=>{try{g(e.throw(l))}catch(w){h(w)}},g=l=>l.done?n(l.value):Promise.resolve(l.value).then(u,E);g((e=e.apply(i,t)).next())});var V=(i,t,e)=>(t=i[U("asyncIterator")])?t.call(i):(i=i[U("iterator")](),t={},e=(n,h)=>(h=i[n])&&(t[n]=u=>new Promise((E,g,l)=>(u=h.call(i,u),l=u.done,Promise.resolve(u.value).then(w=>E({value:w,done:l}),g)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("../notifier/index.cjs"),nt=require("../browser-CpzFX2xg.cjs");var H,f,y,T,N;class rt{constructor(t,e){o(this,H,void 0);o(this,f,void 0);o(this,y,void 0);o(this,T,void 0);o(this,N,t=>{t.preventDefault(),s(this,H).navigate(s(this,y),s(this,T))});r(this,H,e),r(this,f,t),r(this,y,s(this,f).getAttribute("href")||"/"),r(this,T,s(this,f).getAttribute("data-history-action")||"push"),s(this,f).addEventListener("click",s(this,N)),s(this,y)===location.pathname&&s(this,f).classList.add("current")}destroy(){s(this,f).removeEventListener("click",s(this,N)),s(this,f).classList.remove("current")}}H=new WeakMap,f=new WeakMap,y=new WeakMap,T=new WeakMap,N=new WeakMap;var a,P,S,k,C,O,b,v,M,A,x,I,Z,j,$,D,z,q,G,m,p,R,J,B;class ct{constructor(t){o(this,I);o(this,j);o(this,D);o(this,q);o(this,m);o(this,R);o(this,a,null);o(this,P,null);o(this,S,null);o(this,k,null);o(this,C,[]);o(this,O,new DOMParser);o(this,b,new Map);o(this,v,void 0);o(this,M,null);Y(this,"preprocessor");Y(this,"postprocessor");o(this,A,new X.Notifier);o(this,x,new X.Notifier);o(this,B,t=>{t.state&&this.navigate(t.state,"none")});nt.isBrowser&&(r(this,a,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(r(this,a,t.base),t.base.endsWith("/")||r(this,a,s(this,a)+"/")):r(this,a,"/"),r(this,P,(t==null?void 0:t.waitForHeadToLoad)!==!1),r(this,S,(t==null?void 0:t.cachePages)!==!1),r(this,k,d(this,q,G).call(this,document)),r(this,M,location.pathname),d(this,D,z).call(this),addEventListener("popstate",s(this,B)))}beforeNavigationEvent(t){return s(this,A).subscribe(t)}afterNavigationEvent(t){return s(this,x).subscribe(t)}navigate(t,e="push"){return F(this,null,function*(){var h;if(t=d(this,j,$).call(this,t),s(this,v)===t||s(this,M)===t)return;r(this,v,t);const n=s(this,b).has(t);try{let u=!0;if(this.preprocessor)try{yield new Promise((c,L)=>{var W;(W=this.preprocessor)==null||W.call(this,{pathname:t,resolve:c,reject:L,isCached:n})})}catch(c){c?console.error(c):console.log("Route change canceled"),u=!1}if(s(this,A).notify({pathname:t,isCached:n}),!u||s(this,v)!==t)return;const E=yield d(this,I,Z).call(this,t);if(s(this,S)&&s(this,b).set(t,E),s(this,v)!==t)return;const g=Array.from(document.head.children),l=Array.from(E.head.cloneNode(!0).children),w=d(this,m,p).call(this,g,l),tt=d(this,R,J).call(this,g,w),Q=d(this,R,J).call(this,l,w);tt.forEach(c=>c.remove()),Q.forEach(c=>document.head.appendChild(c));const K=Q.filter(c=>c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK");s(this,P)&&K.length&&(yield new Promise(c=>F(this,null,function*(){let L=0;try{for(var W=V(K),ut,dt,ft;ut=!(dt=yield W.next()).done;ut=!1){const it=dt.value;it.onload=()=>{L++,L===K.length&&c()}}}catch(dt){ft=[dt]}finally{try{ut&&(dt=W.return)&&(yield dt.call(W))}finally{if(ft)throw ft[0]}}})));const et=d(this,q,G).call(this,E);s(this,k).forEach((c,L)=>{const W=et[L];c.innerHTML=W.innerHTML}),r(this,M,t),e==="push"?history.pushState(t,"",t+location.search):e==="replace"&&history.replaceState(t,"",t+location.search),d(this,D,z).call(this),(h=this.postprocessor)==null||h.call(this,{pathname:t,isCached:n}),s(this,x).notify({pathname:t,isCached:n})}catch(u){console.error(u)}r(this,v,void 0)})}}a=new WeakMap,P=new WeakMap,S=new WeakMap,k=new WeakMap,C=new WeakMap,O=new WeakMap,b=new WeakMap,v=new WeakMap,M=new WeakMap,A=new WeakMap,x=new WeakMap,I=new WeakSet,Z=function(t){return F(this,null,function*(){const e=s(this,b).get(t);if(e)return e;const h=yield(yield fetch(t)).text();return s(this,O).parseFromString(h,"text/html")})},j=new WeakSet,$=function(t){return t=t.replace(s(this,a),""),t.startsWith("/")&&(t=t.slice(1)),s(this,a)+t},D=new WeakSet,z=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var n;return(n=e.getAttribute("href"))==null?void 0:n.startsWith("/")});s(this,C).forEach(e=>e.destroy()),r(this,C,t.map(e=>new rt(e,this)))},q=new WeakSet,G=function(t){const e=t.querySelectorAll("[data-morph]");return e.length?[...e]:[t.body]},m=new WeakSet,p=function(t,e){return t.filter(n=>e.find(h=>h.outerHTML===n.outerHTML))},R=new WeakSet,J=function(t,e){return t.filter(n=>!e.find(h=>h.outerHTML===n.outerHTML))},B=new WeakMap;exports.Morph=ct;
1
+ "use strict";var nt=Object.defineProperty;var V=(s,t)=>(t=Symbol[s])?t:Symbol.for("Symbol."+s);var ot=(s,t,e)=>t in s?nt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var _=(s,t,e)=>(ot(s,typeof t!="symbol"?t+"":t,e),e),m=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var i=(s,t,e)=>(m(s,t,"read from private field"),e?e.call(s):t.get(s)),n=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},r=(s,t,e,o)=>(m(s,t,"write to private field"),o?o.call(s,e):t.set(s,e),e);var f=(s,t,e)=>(m(s,t,"access private method"),e);var T=(s,t,e)=>new Promise((o,c)=>{var l=u=>{try{g(e.next(u))}catch(v){c(v)}},y=u=>{try{g(e.throw(u))}catch(v){c(v)}},g=u=>u.done?o(u.value):Promise.resolve(u.value).then(l,y);g((e=e.apply(s,t)).next())});var X=(s,t,e)=>(t=s[V("asyncIterator")])?t.call(s):(s=s[V("iterator")](),t={},e=(o,c)=>(c=s[o])&&(t[o]=l=>new Promise((y,g,u)=>(l=c.call(s,l),u=l.done,Promise.resolve(l.value).then(v=>y({value:v,done:u}),g)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("../notifier/index.cjs"),rt=require("../browser-CpzFX2xg.cjs");var M,d,w,N,P,S;class ht{constructor(t,e){n(this,M,void 0);n(this,d,void 0);n(this,w,void 0);n(this,N,void 0);n(this,P,t=>{t.preventDefault(),i(this,M).navigate(i(this,w),i(this,N))});n(this,S,()=>{i(this,M).prefetch(i(this,w))});r(this,M,e),r(this,d,t),r(this,w,i(this,d).getAttribute("href")||"/"),r(this,N,i(this,d).getAttribute("data-history-action")||"push"),i(this,d).addEventListener("click",i(this,P)),i(this,w)===location.pathname&&i(this,d).classList.add("current"),i(this,d).hasAttribute("data-prefetch")&&i(this,d).addEventListener("pointerenter",i(this,S))}destroy(){i(this,d).removeEventListener("click",i(this,P)),i(this,d).removeEventListener("pointerenter",i(this,S)),i(this,d).classList.remove("current")}}M=new WeakMap,d=new WeakMap,w=new WeakMap,N=new WeakMap,P=new WeakMap,S=new WeakMap;var a,k,A,C,x,j,E,L,H,D,q,R,z,p,$,W,G,F,J,B,tt,O,Q,K;class ct{constructor(t){n(this,R);n(this,p);n(this,W);n(this,F);n(this,B);n(this,O);n(this,a,null);n(this,k,null);n(this,A,null);n(this,C,null);n(this,x,[]);n(this,j,new DOMParser);n(this,E,new Map);n(this,L,void 0);n(this,H,null);_(this,"preprocessor");_(this,"postprocessor");n(this,D,new Z.Notifier);n(this,q,new Z.Notifier);n(this,K,t=>{t.state&&this.navigate(t.state,"none")});rt.isBrowser&&(r(this,a,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(r(this,a,t.base),t.base.endsWith("/")||r(this,a,i(this,a)+"/")):r(this,a,"/"),r(this,k,(t==null?void 0:t.waitForHeadToLoad)!==!1),r(this,A,(t==null?void 0:t.cachePages)!==!1),r(this,C,f(this,F,J).call(this,document)),r(this,H,location.pathname),f(this,W,G).call(this),addEventListener("popstate",i(this,K)))}beforeNavigationEvent(t){return i(this,D).subscribe(t)}afterNavigationEvent(t){return i(this,q).subscribe(t)}prefetch(t){return T(this,null,function*(){return f(this,R,z).call(this,t)})}navigate(t,e="push"){return T(this,null,function*(){var c;if(t=f(this,p,$).call(this,t),i(this,L)===t||i(this,H)===t)return;r(this,L,t);const o=i(this,E).has(t);try{let l=!0;if(this.preprocessor)try{yield new Promise((h,b)=>{var I;(I=this.preprocessor)==null||I.call(this,{pathname:t,resolve:h,reject:b,isCached:o})})}catch(h){h?console.error(h):console.log("Route change canceled"),l=!1}if(i(this,D).notify({pathname:t,isCached:o}),!l||i(this,L)!==t)return;const y=i(this,E).get(t)||(yield f(this,R,z).call(this,t));if(i(this,L)!==t)return;const g=Array.from(document.head.children),u=Array.from(y.head.cloneNode(!0).children),v=f(this,B,tt).call(this,g,u),et=f(this,O,Q).call(this,g,v),U=f(this,O,Q).call(this,u,v);et.forEach(h=>h.remove()),U.forEach(h=>document.head.appendChild(h));const Y=U.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");i(this,k)&&Y.length&&(yield new Promise(h=>T(this,null,function*(){let b=0;try{for(var I=X(Y),dt,ft,at;dt=!(ft=yield I.next()).done;dt=!1){const st=ft.value;st.onload=()=>{b++,b===Y.length&&h()}}}catch(ft){at=[ft]}finally{try{dt&&(ft=I.return)&&(yield ft.call(I))}finally{if(at)throw at[0]}}})));const it=f(this,F,J).call(this,y);i(this,C).forEach((h,b)=>{const I=it[b];h.innerHTML=I.innerHTML}),r(this,H,t),e==="push"?history.pushState(t,"",t+location.search):e==="replace"&&history.replaceState(t,"",t+location.search),f(this,W,G).call(this),(c=this.postprocessor)==null||c.call(this,{pathname:t,isCached:o}),i(this,q).notify({pathname:t,isCached:o})}catch(l){console.error(l)}r(this,L,void 0)})}}a=new WeakMap,k=new WeakMap,A=new WeakMap,C=new WeakMap,x=new WeakMap,j=new WeakMap,E=new WeakMap,L=new WeakMap,H=new WeakMap,D=new WeakMap,q=new WeakMap,R=new WeakSet,z=function(t){return T(this,null,function*(){const e=i(this,E).get(t);if(e)return e;const c=yield(yield fetch(t)).text(),l=i(this,j).parseFromString(c,"text/html");return i(this,A)&&i(this,E).set(t,l),l})},p=new WeakSet,$=function(t){return t=t.replace(i(this,a),""),t.startsWith("/")&&(t=t.slice(1)),i(this,a)+t},W=new WeakSet,G=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var o;return(o=e.getAttribute("href"))==null?void 0:o.startsWith("/")});i(this,x).forEach(e=>e.destroy()),r(this,x,t.map(e=>new ht(e,this)))},F=new WeakSet,J=function(t){const e=t.querySelectorAll("[data-morph]");return e.length?[...e]:[t.body]},B=new WeakSet,tt=function(t,e){return t.filter(o=>e.find(c=>c.outerHTML===o.outerHTML))},O=new WeakSet,Q=function(t,e){return t.filter(o=>!e.find(c=>c.outerHTML===o.outerHTML))},K=new WeakMap;exports.Morph=ct;
@@ -1,179 +1,191 @@
1
- var st = Object.defineProperty;
2
- var V = (i, t) => (t = Symbol[i]) ? t : Symbol.for("Symbol." + i);
3
- var ot = (i, t, e) => t in i ? st(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
4
- var j = (i, t, e) => (ot(i, typeof t != "symbol" ? t + "" : t, e), e), z = (i, t, e) => {
5
- if (!t.has(i))
1
+ var ot = Object.defineProperty;
2
+ var X = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s);
3
+ var nt = (s, t, e) => t in s ? ot(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
4
+ var j = (s, t, e) => (nt(s, typeof t != "symbol" ? t + "" : t, e), e), z = (s, t, e) => {
5
+ if (!t.has(s))
6
6
  throw TypeError("Cannot " + e);
7
7
  };
8
- var s = (i, t, e) => (z(i, t, "read from private field"), e ? e.call(i) : t.get(i)), o = (i, t, e) => {
9
- if (t.has(i))
8
+ var i = (s, t, e) => (z(s, t, "read from private field"), e ? e.call(s) : t.get(s)), o = (s, t, e) => {
9
+ if (t.has(s))
10
10
  throw TypeError("Cannot add the same private member more than once");
11
- t instanceof WeakSet ? t.add(i) : t.set(i, e);
12
- }, r = (i, t, e, n) => (z(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e);
13
- var d = (i, t, e) => (z(i, t, "access private method"), e);
14
- var F = (i, t, e) => new Promise((n, h) => {
15
- var u = (l) => {
11
+ t instanceof WeakSet ? t.add(s) : t.set(s, e);
12
+ }, r = (s, t, e, n) => (z(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e);
13
+ var d = (s, t, e) => (z(s, t, "access private method"), e);
14
+ var T = (s, t, e) => new Promise((n, c) => {
15
+ var l = (f) => {
16
16
  try {
17
- g(e.next(l));
18
- } catch (w) {
19
- h(w);
17
+ g(e.next(f));
18
+ } catch (L) {
19
+ c(L);
20
20
  }
21
- }, L = (l) => {
21
+ }, y = (f) => {
22
22
  try {
23
- g(e.throw(l));
24
- } catch (w) {
25
- h(w);
23
+ g(e.throw(f));
24
+ } catch (L) {
25
+ c(L);
26
26
  }
27
- }, g = (l) => l.done ? n(l.value) : Promise.resolve(l.value).then(u, L);
28
- g((e = e.apply(i, t)).next());
27
+ }, g = (f) => f.done ? n(f.value) : Promise.resolve(f.value).then(l, y);
28
+ g((e = e.apply(s, t)).next());
29
29
  });
30
- var X = (i, t, e) => (t = i[V("asyncIterator")]) ? t.call(i) : (i = i[V("iterator")](), t = {}, e = (n, h) => (h = i[n]) && (t[n] = (u) => new Promise((L, g, l) => (u = h.call(i, u), l = u.done, Promise.resolve(u.value).then((w) => L({ value: w, done: l }), g)))), e("next"), e("return"), t);
31
- import { Notifier as Z } from "../notifier/index.js";
32
- import { i as nt } from "../browser-0zX67oeU.js";
33
- var M, f, y, T, N;
34
- class rt {
30
+ var Z = (s, t, e) => (t = s[X("asyncIterator")]) ? t.call(s) : (s = s[X("iterator")](), t = {}, e = (n, c) => (c = s[n]) && (t[n] = (l) => new Promise((y, g, f) => (l = c.call(s, l), f = l.done, Promise.resolve(l.value).then((L) => y({ value: L, done: f }), g)))), e("next"), e("return"), t);
31
+ import { Notifier as _ } from "../notifier/index.js";
32
+ import { i as rt } from "../browser-0zX67oeU.js";
33
+ var H, u, E, N, P, S;
34
+ class ht {
35
35
  constructor(t, e) {
36
- o(this, M, void 0);
37
- o(this, f, void 0);
38
- o(this, y, void 0);
39
- o(this, T, void 0);
40
- o(this, N, (t) => {
41
- t.preventDefault(), s(this, M).navigate(s(this, y), s(this, T));
36
+ o(this, H, void 0);
37
+ o(this, u, void 0);
38
+ o(this, E, void 0);
39
+ o(this, N, void 0);
40
+ o(this, P, (t) => {
41
+ t.preventDefault(), i(this, H).navigate(i(this, E), i(this, N));
42
+ });
43
+ o(this, S, () => {
44
+ i(this, H).prefetch(i(this, E));
42
45
  });
43
- r(this, M, e), r(this, f, t), r(this, y, s(this, f).getAttribute("href") || "/"), r(this, T, s(this, f).getAttribute("data-history-action") || "push"), s(this, f).addEventListener("click", s(this, N)), s(this, y) === location.pathname && s(this, f).classList.add("current");
46
+ r(this, H, e), r(this, u, t), r(this, E, i(this, u).getAttribute("href") || "/"), r(this, N, i(this, u).getAttribute(
47
+ "data-history-action"
48
+ ) || "push"), i(this, u).addEventListener("click", i(this, P)), i(this, E) === location.pathname && i(this, u).classList.add("current"), i(this, u).hasAttribute("data-prefetch") && i(this, u).addEventListener("pointerenter", i(this, S));
44
49
  }
45
50
  destroy() {
46
- s(this, f).removeEventListener("click", s(this, N)), s(this, f).classList.remove("current");
51
+ i(this, u).removeEventListener("click", i(this, P)), i(this, u).removeEventListener("pointerenter", i(this, S)), i(this, u).classList.remove("current");
47
52
  }
48
53
  }
49
- M = new WeakMap(), f = new WeakMap(), y = new WeakMap(), T = new WeakMap(), N = new WeakMap();
50
- var a, P, S, k, C, q, b, E, H, A, x, I, _, O, $, D, G, m, J, B, p, R, Q, K;
54
+ H = new WeakMap(), u = new WeakMap(), E = new WeakMap(), N = new WeakMap(), P = new WeakMap(), S = new WeakMap();
55
+ var a, k, A, C, x, I, w, v, M, D, R, W, G, O, $, m, J, F, Q, B, tt, p, U, K;
51
56
  class ut {
52
57
  constructor(t) {
53
- o(this, I);
58
+ o(this, W);
54
59
  o(this, O);
55
- o(this, D);
56
60
  o(this, m);
61
+ o(this, F);
57
62
  o(this, B);
58
- o(this, R);
63
+ o(this, p);
59
64
  o(this, a, null);
60
- o(this, P, null);
61
- o(this, S, null);
62
65
  o(this, k, null);
63
- o(this, C, []);
64
- o(this, q, new DOMParser());
65
- o(this, b, /* @__PURE__ */ new Map());
66
- o(this, E, void 0);
67
- o(this, H, null);
66
+ o(this, A, null);
67
+ o(this, C, null);
68
+ o(this, x, []);
69
+ o(this, I, new DOMParser());
70
+ o(this, w, /* @__PURE__ */ new Map());
71
+ o(this, v, void 0);
72
+ o(this, M, null);
68
73
  j(this, "preprocessor");
69
74
  j(this, "postprocessor");
70
- o(this, A, new Z());
71
- o(this, x, new Z());
75
+ o(this, D, new _());
76
+ o(this, R, new _());
72
77
  o(this, K, (t) => {
73
78
  t.state && this.navigate(t.state, "none");
74
79
  });
75
- nt && (r(this, a, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (r(this, a, t.base), t.base.endsWith("/") || r(this, a, s(this, a) + "/")) : r(this, a, "/"), r(this, P, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), r(this, S, (t == null ? void 0 : t.cachePages) !== !1), r(this, k, d(this, m, J).call(this, document)), r(this, H, location.pathname), d(this, D, G).call(this), addEventListener("popstate", s(this, K)));
80
+ rt && (r(this, a, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (r(this, a, t.base), t.base.endsWith("/") || r(this, a, i(this, a) + "/")) : r(this, a, "/"), r(this, k, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), r(this, A, (t == null ? void 0 : t.cachePages) !== !1), r(this, C, d(this, F, Q).call(this, document)), r(this, M, location.pathname), d(this, m, J).call(this), addEventListener("popstate", i(this, K)));
76
81
  }
77
82
  beforeNavigationEvent(t) {
78
- return s(this, A).subscribe(t);
83
+ return i(this, D).subscribe(t);
79
84
  }
80
85
  afterNavigationEvent(t) {
81
- return s(this, x).subscribe(t);
86
+ return i(this, R).subscribe(t);
87
+ }
88
+ prefetch(t) {
89
+ return T(this, null, function* () {
90
+ return d(this, W, G).call(this, t);
91
+ });
82
92
  }
83
93
  navigate(t, e = "push") {
84
- return F(this, null, function* () {
85
- var h;
86
- if (t = d(this, O, $).call(this, t), s(this, E) === t || s(this, H) === t)
94
+ return T(this, null, function* () {
95
+ var c;
96
+ if (t = d(this, O, $).call(this, t), i(this, v) === t || i(this, M) === t)
87
97
  return;
88
- r(this, E, t);
89
- const n = s(this, b).has(t);
98
+ r(this, v, t);
99
+ const n = i(this, w).has(t);
90
100
  try {
91
- let u = !0;
101
+ let l = !0;
92
102
  if (this.preprocessor)
93
103
  try {
94
- yield new Promise((c, v) => {
95
- var W;
96
- (W = this.preprocessor) == null || W.call(this, { pathname: t, resolve: c, reject: v, isCached: n });
104
+ yield new Promise((h, b) => {
105
+ var q;
106
+ (q = this.preprocessor) == null || q.call(this, { pathname: t, resolve: h, reject: b, isCached: n });
97
107
  });
98
- } catch (c) {
99
- c ? console.error(c) : console.log("Route change canceled"), u = !1;
108
+ } catch (h) {
109
+ h ? console.error(h) : console.log("Route change canceled"), l = !1;
100
110
  }
101
- if (s(this, A).notify({
111
+ if (i(this, D).notify({
102
112
  pathname: t,
103
113
  isCached: n
104
- }), !u || s(this, E) !== t)
114
+ }), !l || i(this, v) !== t)
105
115
  return;
106
- const L = yield d(this, I, _).call(this, t);
107
- if (s(this, S) && s(this, b).set(t, L), s(this, E) !== t)
116
+ const y = i(this, w).get(t) || (yield d(this, W, G).call(this, t));
117
+ if (i(this, v) !== t)
108
118
  return;
109
- const g = Array.from(document.head.children), l = Array.from(L.head.cloneNode(!0).children), w = d(this, B, p).call(this, g, l), tt = d(this, R, Q).call(this, g, w), U = d(this, R, Q).call(this, l, w);
110
- tt.forEach((c) => c.remove()), U.forEach((c) => document.head.appendChild(c));
111
- const Y = U.filter(
112
- (c) => c.tagName === "STYLE" || c.tagName === "SCRIPT" || c.tagName === "LINK"
119
+ const g = Array.from(document.head.children), f = Array.from(
120
+ y.head.cloneNode(!0).children
121
+ ), L = d(this, B, tt).call(this, g, f), et = d(this, p, U).call(this, g, L), V = d(this, p, U).call(this, f, L);
122
+ et.forEach((h) => h.remove()), V.forEach((h) => document.head.appendChild(h));
123
+ const Y = V.filter(
124
+ (h) => h.tagName === "STYLE" || h.tagName === "SCRIPT" || h.tagName === "LINK"
113
125
  );
114
- s(this, P) && Y.length && (yield new Promise((c) => F(this, null, function* () {
115
- let v = 0;
126
+ i(this, k) && Y.length && (yield new Promise((h) => T(this, null, function* () {
127
+ let b = 0;
116
128
  try {
117
- for (var W = X(Y), at, gt, wt; at = !(gt = yield W.next()).done; at = !1) {
118
- const it = gt.value;
119
- it.onload = () => {
120
- v++, v === Y.length && c();
129
+ for (var q = Z(Y), gt, Lt, vt; gt = !(Lt = yield q.next()).done; gt = !1) {
130
+ const st = Lt.value;
131
+ st.onload = () => {
132
+ b++, b === Y.length && h();
121
133
  };
122
134
  }
123
- } catch (gt) {
124
- wt = [gt];
135
+ } catch (Lt) {
136
+ vt = [Lt];
125
137
  } finally {
126
138
  try {
127
- at && (gt = W.return) && (yield gt.call(W));
139
+ gt && (Lt = q.return) && (yield Lt.call(q));
128
140
  } finally {
129
- if (wt)
130
- throw wt[0];
141
+ if (vt)
142
+ throw vt[0];
131
143
  }
132
144
  }
133
145
  })));
134
- const et = d(this, m, J).call(this, L);
135
- s(this, k).forEach((c, v) => {
136
- const W = et[v];
137
- c.innerHTML = W.innerHTML;
138
- }), r(this, H, t), e === "push" ? history.pushState(t, "", t + location.search) : e === "replace" && history.replaceState(t, "", t + location.search), d(this, D, G).call(this), (h = this.postprocessor) == null || h.call(this, { pathname: t, isCached: n }), s(this, x).notify({ pathname: t, isCached: n });
139
- } catch (u) {
140
- console.error(u);
146
+ const it = d(this, F, Q).call(this, y);
147
+ i(this, C).forEach((h, b) => {
148
+ const q = it[b];
149
+ h.innerHTML = q.innerHTML;
150
+ }), r(this, M, t), e === "push" ? history.pushState(t, "", t + location.search) : e === "replace" && history.replaceState(t, "", t + location.search), d(this, m, J).call(this), (c = this.postprocessor) == null || c.call(this, { pathname: t, isCached: n }), i(this, R).notify({ pathname: t, isCached: n });
151
+ } catch (l) {
152
+ console.error(l);
141
153
  }
142
- r(this, E, void 0);
154
+ r(this, v, void 0);
143
155
  });
144
156
  }
145
157
  }
146
- a = new WeakMap(), P = new WeakMap(), S = new WeakMap(), k = new WeakMap(), C = new WeakMap(), q = new WeakMap(), b = new WeakMap(), E = new WeakMap(), H = new WeakMap(), A = new WeakMap(), x = new WeakMap(), I = new WeakSet(), _ = function(t) {
147
- return F(this, null, function* () {
148
- const e = s(this, b).get(t);
158
+ a = new WeakMap(), k = new WeakMap(), A = new WeakMap(), C = new WeakMap(), x = new WeakMap(), I = new WeakMap(), w = new WeakMap(), v = new WeakMap(), M = new WeakMap(), D = new WeakMap(), R = new WeakMap(), W = new WeakSet(), G = function(t) {
159
+ return T(this, null, function* () {
160
+ const e = i(this, w).get(t);
149
161
  if (e)
150
162
  return e;
151
- const h = yield (yield fetch(t)).text();
152
- return s(this, q).parseFromString(h, "text/html");
163
+ const c = yield (yield fetch(t)).text(), l = i(this, I).parseFromString(c, "text/html");
164
+ return i(this, A) && i(this, w).set(t, l), l;
153
165
  });
154
166
  }, O = new WeakSet(), $ = function(t) {
155
- return t = t.replace(s(this, a), ""), t.startsWith("/") && (t = t.slice(1)), s(this, a) + t;
156
- }, D = new WeakSet(), G = function() {
157
- const t = [...document.documentElement.querySelectorAll("a")].filter(
158
- (e) => {
159
- var n;
160
- return (n = e.getAttribute("href")) == null ? void 0 : n.startsWith("/");
161
- }
162
- );
163
- s(this, C).forEach((e) => e.destroy()), r(this, C, t.map((e) => new rt(e, this)));
164
- }, m = new WeakSet(), J = function(t) {
167
+ return t = t.replace(i(this, a), ""), t.startsWith("/") && (t = t.slice(1)), i(this, a) + t;
168
+ }, m = new WeakSet(), J = function() {
169
+ const t = [
170
+ ...document.documentElement.querySelectorAll("a")
171
+ ].filter((e) => {
172
+ var n;
173
+ return (n = e.getAttribute("href")) == null ? void 0 : n.startsWith("/");
174
+ });
175
+ i(this, x).forEach((e) => e.destroy()), r(this, x, t.map((e) => new ht(e, this)));
176
+ }, F = new WeakSet(), Q = function(t) {
165
177
  const e = t.querySelectorAll("[data-morph]");
166
178
  return e.length ? [...e] : [t.body];
167
- }, B = new WeakSet(), p = function(t, e) {
179
+ }, B = new WeakSet(), tt = function(t, e) {
168
180
  return t.filter(
169
181
  (n) => e.find(
170
- (h) => h.outerHTML === n.outerHTML
182
+ (c) => c.outerHTML === n.outerHTML
171
183
  )
172
184
  );
173
- }, R = new WeakSet(), Q = function(t, e) {
185
+ }, p = new WeakSet(), U = function(t, e) {
174
186
  return t.filter(
175
187
  (n) => !e.find(
176
- (h) => h.outerHTML === n.outerHTML
188
+ (c) => c.outerHTML === n.outerHTML
177
189
  )
178
190
  );
179
191
  }, K = new WeakMap();
@@ -0,0 +1,5 @@
1
+ export declare function getRootVariables<T extends string, V extends {
2
+ [key in T]: string;
3
+ } = {
4
+ [key in T]: string;
5
+ }>(...names: T[]): V;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),f=require("../browser-CpzFX2xg.cjs"),p=require("../dom-qY2LdCVL.cjs"),n=require("../easings-DsS5-Kqc.cjs"),I=require("../events-Crwi8fz6.cjs"),y=require("../file-EevnUtRj.cjs"),g=require("../function-MthRj-GJ.cjs"),h=require("../layout-8ryRAMGJ.cjs"),u=require("../math-GDWEqu7y.cjs"),O=require("../number-yVpzMdbQ.cjs"),o=require("../object-C1ph624j.cjs"),r=require("../string-vBu90jhV.cjs"),C=require("../style-At6aDoqG.cjs");function E(t,e,...i){return[...t.slice(0,e),...i,...t.slice(e)]}function w(t,e){const i=t.measureText(e),a=i.actualBoundingBoxAscent+i.actualBoundingBoxDescent,s=i.width;return{height:a,width:s}}function Q(t){return Math.floor(t)+.5}function S(t,e,i,a,s,l){let m=t/e,x=i/a,c=0,d=0;return s=typeof s=="undefined"?.5:s,l=typeof l=="undefined"?.5:l,m>x?(c=a,d=a*m):(d=i,c=i/m),[(i-d)*s,(a-c)*l,d,c]}function T(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function D(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function P(t,e,i=!1){let a=t.x-e.width/2,s=e.height/2-t.y;return i&&(a=a/(e.width/2),s=s/(e.height/2)),{x:a,y:s}}function q(t,e){const i=t.x/e.x,a=t.y/e.y;return{x:i,y:a}}function v(t,e){return e=e||{x:0,y:0,width:document.documentElement.offsetWidth,height:innerHeight},{x:(t.x-e.x)/e.width*e.width,y:(t.y-e.y)/e.height*e.height}}function R(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function N(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}exports.parseAttribute=b.parseAttribute;exports.parseAttributeValue=b.parseAttributeValue;exports.isBrowser=f.isBrowser;exports.findParentElement=p.findParentElement;exports.findScrollParentElement=p.findScrollParentElement;exports.getElement=p.getElement;exports.easeInCubic=n.easeInCubic;exports.easeInExpo=n.easeInExpo;exports.easeInOutCubic=n.easeInOutCubic;exports.easeInOutExpo=n.easeInOutExpo;exports.easeInOutQuad=n.easeInOutQuad;exports.easeInOutQuart=n.easeInOutQuart;exports.easeInOutQuint=n.easeInOutQuint;exports.easeInQuad=n.easeInQuad;exports.easeInQuart=n.easeInQuart;exports.easeInQuint=n.easeInQuint;exports.easeOutCubic=n.easeOutCubic;exports.easeOutExpo=n.easeOutExpo;exports.easeOutQuad=n.easeOutQuad;exports.easeOutQuart=n.easeOutQuart;exports.easeOutQuint=n.easeOutQuint;exports.linear=n.linear;exports.dispatchSizeChangeEvent=I.dispatchSizeChangeEvent;exports.createJSONAndSave=y.createJSONAndSave;exports.debounce=g.debounce;exports.throttle=g.throttle;exports.getCumulativeOffsetLeft=h.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=h.getCumulativeOffsetTop;exports.getCumulativePosition=h.getCumulativePosition;exports.calculateDistance=u.calculateDistance;exports.calculateDistanceWithRadius=u.calculateDistanceWithRadius;exports.clamp=u.clamp;exports.damp=u.damp;exports.lerp=u.lerp;exports.mapRange=u.mapRange;exports.round=u.round;exports.smootherstep=u.smootherstep;exports.smoothstep=u.smoothstep;exports.step=u.step;exports.preciseNumber=O.preciseNumber;exports.roundNumberTo=O.roundNumberTo;exports.cloneDeep=o.cloneDeep;exports.compareObjects=o.compareObjects;exports.isESClass=o.isESClass;exports.isNullish=o.isNullish;exports.isObject=o.isObject;exports.mergeDeep=o.mergeDeep;exports.omit=o.omit;exports.pick=o.pick;exports.camelToKebab=r.camelToKebab;exports.capitalize=r.capitalize;exports.generateId=r.generateId;exports.kebabToCamel=r.kebabToCamel;exports.snakeToDotted=r.snakeToDotted;exports.toPascalCase=r.toPascalCase;exports.uncapitalize=r.uncapitalize;exports.getElementTransitionDurationMS=C.getElementTransitionDurationMS;exports.getElementTransitionDurationS=C.getElementTransitionDurationS;exports.cover=S;exports.decode=N;exports.dotCircleCollision=D;exports.dotRectCollision=T;exports.encode=R;exports.fixPosition=Q;exports.getPointerPosition=v;exports.insert=E;exports.measureText=w;exports.normalize=q;exports.screenToCartesian=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),x=require("../browser-CpzFX2xg.cjs"),p=require("../dom-qY2LdCVL.cjs"),a=require("../easings-DsS5-Kqc.cjs"),y=require("../events-Crwi8fz6.cjs"),E=require("../file-EevnUtRj.cjs"),g=require("../function-MthRj-GJ.cjs"),h=require("../layout-8ryRAMGJ.cjs"),o=require("../math-GDWEqu7y.cjs"),f=require("../number-yVpzMdbQ.cjs"),u=require("../object-C1ph624j.cjs"),l=require("../string-vBu90jhV.cjs"),O=require("../style-At6aDoqG.cjs");function I(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function S(t,e){const n=t.measureText(e),i=n.actualBoundingBoxAscent+n.actualBoundingBoxDescent,s=n.width;return{height:i,width:s}}function w(t){return Math.floor(t)+.5}function Q(t,e,n,i,s,r){let m=t/e,C=n/i,c=0,d=0;return s=typeof s=="undefined"?.5:s,r=typeof r=="undefined"?.5:r,m>C?(c=i,d=i*m):(d=n,c=n/m),[(n-d)*s,(i-c)*r,d,c]}function T(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function v(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function D(t,e,n=!1){let i=t.x-e.width/2,s=e.height/2-t.y;return n&&(i=i/(e.width/2),s=s/(e.height/2)),{x:i,y:s}}function P(t,e){const n=t.x/e.x,i=t.y/e.y;return{x:n,y:i}}function q(t,e){return e=e||{x:0,y:0,width:document.documentElement.offsetWidth,height:innerHeight},{x:(t.x-e.x)/e.width*e.width,y:(t.y-e.y)/e.height*e.height}}function R(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(i=>{i instanceof CSSStyleRule&&i.selectorText===":root"&&t.forEach(s=>{const r=i.styleMap.get(s);r?e[s]=r.toString():console.warn(`variable named ${s} not found`)})})}),e}function A(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function N(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}exports.parseAttribute=b.parseAttribute;exports.parseAttributeValue=b.parseAttributeValue;exports.isBrowser=x.isBrowser;exports.findParentElement=p.findParentElement;exports.findScrollParentElement=p.findScrollParentElement;exports.getElement=p.getElement;exports.easeInCubic=a.easeInCubic;exports.easeInExpo=a.easeInExpo;exports.easeInOutCubic=a.easeInOutCubic;exports.easeInOutExpo=a.easeInOutExpo;exports.easeInOutQuad=a.easeInOutQuad;exports.easeInOutQuart=a.easeInOutQuart;exports.easeInOutQuint=a.easeInOutQuint;exports.easeInQuad=a.easeInQuad;exports.easeInQuart=a.easeInQuart;exports.easeInQuint=a.easeInQuint;exports.easeOutCubic=a.easeOutCubic;exports.easeOutExpo=a.easeOutExpo;exports.easeOutQuad=a.easeOutQuad;exports.easeOutQuart=a.easeOutQuart;exports.easeOutQuint=a.easeOutQuint;exports.linear=a.linear;exports.dispatchSizeChangeEvent=y.dispatchSizeChangeEvent;exports.createJSONAndSave=E.createJSONAndSave;exports.debounce=g.debounce;exports.throttle=g.throttle;exports.getCumulativeOffsetLeft=h.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=h.getCumulativeOffsetTop;exports.getCumulativePosition=h.getCumulativePosition;exports.calculateDistance=o.calculateDistance;exports.calculateDistanceWithRadius=o.calculateDistanceWithRadius;exports.clamp=o.clamp;exports.damp=o.damp;exports.lerp=o.lerp;exports.mapRange=o.mapRange;exports.round=o.round;exports.smootherstep=o.smootherstep;exports.smoothstep=o.smoothstep;exports.step=o.step;exports.preciseNumber=f.preciseNumber;exports.roundNumberTo=f.roundNumberTo;exports.cloneDeep=u.cloneDeep;exports.compareObjects=u.compareObjects;exports.isESClass=u.isESClass;exports.isNullish=u.isNullish;exports.isObject=u.isObject;exports.mergeDeep=u.mergeDeep;exports.omit=u.omit;exports.pick=u.pick;exports.camelToKebab=l.camelToKebab;exports.capitalize=l.capitalize;exports.generateId=l.generateId;exports.kebabToCamel=l.kebabToCamel;exports.snakeToDotted=l.snakeToDotted;exports.toPascalCase=l.toPascalCase;exports.uncapitalize=l.uncapitalize;exports.getElementTransitionDurationMS=O.getElementTransitionDurationMS;exports.getElementTransitionDurationS=O.getElementTransitionDurationS;exports.cover=Q;exports.decode=N;exports.dotCircleCollision=v;exports.dotRectCollision=T;exports.encode=A;exports.fixPosition=w;exports.getPointerPosition=q;exports.getRootVariables=R;exports.insert=I;exports.measureText=S;exports.normalize=P;exports.screenToCartesian=D;
@@ -4,6 +4,7 @@ export { isBrowser } from './browser';
4
4
  export { measureText, fixPosition, cover } from './canvas';
5
5
  export { dotRectCollision, dotCircleCollision } from './collisions';
6
6
  export { screenToCartesian, normalize, getPointerPosition } from './coordinates';
7
+ export { getRootVariables } from './cssom';
7
8
  export { encode, decode } from './decoding';
8
9
  export { findParentElement, getElement, findScrollParentElement, type ElementOrSelector, } from './dom';
9
10
  export { linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint, easeInExpo, easeOutExpo, easeInOutExpo, type EasingFunction, } from './easings';
@@ -1,139 +1,151 @@
1
- import { a as I, p as E } from "../attributes-69we3byR.js";
2
- import { i as S } from "../browser-0zX67oeU.js";
3
- import { f as P, a as R, g as T } from "../dom-BY7JhTx5.js";
4
- import { c as v, n as B, f as A, p as N, b as j, i as z, m as M, e as U, g as q, j as J, d as K, o as V, a as F, h as G, k as W, l as X } from "../easings-BKi40vHz.js";
1
+ import { a as S, p as I } from "../attributes-69we3byR.js";
2
+ import { i as Q } from "../browser-0zX67oeU.js";
3
+ import { f as D, a as T, g as P } from "../dom-BY7JhTx5.js";
4
+ import { c as k, n as B, f as M, p as N, b as j, i as z, m as U, e as V, g as q, j as J, d as K, o as $, a as F, h as G, k as W, l as X } from "../easings-BKi40vHz.js";
5
5
  import { d as Z } from "../events-_C2CztxR.js";
6
- import { c as $ } from "../file-lxi_oXJf.js";
7
- import { d as L, t as ee } from "../function-C10DGppn.js";
8
- import { g as te, a as se, b as ne } from "../layout-HoBT_Da2.js";
9
- import { e as ie, f as ue, c as re, d as le, l as de, m as ce, r as me, b as pe, a as xe, s as fe } from "../math-BOBiC4TN.js";
10
- import { p as ge, r as be } from "../number-Bo5RdrA1.js";
11
- import { c as ye, d as Ce, i as Oe, b as Ie, a as Ee, m as Qe, o as Se, p as De } from "../object-DIPjdukP.js";
12
- import { c as Re, a as Te, g as ke, k as ve, s as Be, t as Ae, u as Ne } from "../string-3lAkpJJP.js";
13
- import { g as ze, a as Me } from "../style-j2TwriJ_.js";
14
- function d(a, e, ...t) {
15
- return [...a.slice(0, e), ...t, ...a.slice(e)];
6
+ import { c as H } from "../file-lxi_oXJf.js";
7
+ import { d as ee, t as te } from "../function-C10DGppn.js";
8
+ import { g as se, a as ne, b as oe } from "../layout-HoBT_Da2.js";
9
+ import { e as re, f as ue, c as le, d as ce, l as de, m as me, r as pe, b as fe, a as xe, s as he } from "../math-BOBiC4TN.js";
10
+ import { p as be, r as ye } from "../number-Bo5RdrA1.js";
11
+ import { c as Ce, d as Oe, i as Ee, b as Se, a as Ie, m as Re, o as Qe, p as ve } from "../object-DIPjdukP.js";
12
+ import { c as Te, a as Pe, g as Ae, k as ke, s as Be, t as Me, u as Ne } from "../string-3lAkpJJP.js";
13
+ import { g as ze, a as Ue } from "../style-j2TwriJ_.js";
14
+ function c(t, e, ...a) {
15
+ return [...t.slice(0, e), ...a, ...t.slice(e)];
16
16
  }
17
- function c(a, e) {
18
- const t = a.measureText(e), s = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent, n = t.width;
17
+ function d(t, e) {
18
+ const a = t.measureText(e), s = a.actualBoundingBoxAscent + a.actualBoundingBoxDescent, n = a.width;
19
19
  return {
20
20
  height: s,
21
21
  width: n
22
22
  };
23
23
  }
24
- function m(a) {
25
- return Math.floor(a) + 0.5;
24
+ function m(t) {
25
+ return Math.floor(t) + 0.5;
26
26
  }
27
- function p(a, e, t, s, n, o) {
28
- let r = a / e, l = t / s, i = 0, u = 0;
29
- return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o, r > l ? (i = s, u = s * r) : (u = t, i = t / r), [
30
- (t - u) * n,
27
+ function p(t, e, a, s, n, o) {
28
+ let u = t / e, l = a / s, i = 0, r = 0;
29
+ return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o, u > l ? (i = s, r = s * u) : (r = a, i = a / u), [
30
+ (a - r) * n,
31
31
  (s - i) * o,
32
- u,
32
+ r,
33
33
  i
34
34
  ];
35
35
  }
36
- function x(a, e) {
37
- return a.x < e.x + e.width && a.x > e.x && a.y < e.y + e.height && a.y > e.y;
36
+ function f(t, e) {
37
+ return t.x < e.x + e.width && t.x > e.x && t.y < e.y + e.height && t.y > e.y;
38
38
  }
39
- function f(a, e) {
40
- return Math.sqrt((a.x - e.x) ** 2 + (a.y - e.y) ** 2) < e.radius;
39
+ function x(t, e) {
40
+ return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
41
41
  }
42
- function h(a, e, t = !1) {
43
- let s = a.x - e.width / 2, n = e.height / 2 - a.y;
44
- return t && (s = s / (e.width / 2), n = n / (e.height / 2)), { x: s, y: n };
42
+ function h(t, e, a = !1) {
43
+ let s = t.x - e.width / 2, n = e.height / 2 - t.y;
44
+ return a && (s = s / (e.width / 2), n = n / (e.height / 2)), { x: s, y: n };
45
45
  }
46
- function g(a, e) {
47
- const t = a.x / e.x, s = a.y / e.y;
48
- return { x: t, y: s };
46
+ function g(t, e) {
47
+ const a = t.x / e.x, s = t.y / e.y;
48
+ return { x: a, y: s };
49
49
  }
50
- function b(a, e) {
50
+ function b(t, e) {
51
51
  return e = e || {
52
52
  x: 0,
53
53
  y: 0,
54
54
  width: document.documentElement.offsetWidth,
55
55
  height: innerHeight
56
56
  }, {
57
- x: (a.x - e.x) / e.width * e.width,
58
- y: (a.y - e.y) / e.height * e.height
57
+ x: (t.x - e.x) / e.width * e.width,
58
+ y: (t.y - e.y) / e.height * e.height
59
59
  };
60
60
  }
61
- function w(a) {
62
- const e = window.atob(a);
61
+ function y(...t) {
62
+ const e = {};
63
+ return Array.from(document.styleSheets).forEach((a) => {
64
+ Array.from(a.cssRules).forEach((s) => {
65
+ s instanceof CSSStyleRule && s.selectorText === ":root" && t.forEach((n) => {
66
+ const o = s.styleMap.get(n);
67
+ o ? e[n] = o.toString() : console.warn(`variable named ${n} not found`);
68
+ });
69
+ });
70
+ }), e;
71
+ }
72
+ function w(t) {
73
+ const e = window.atob(t);
63
74
  return decodeURIComponent(window.escape(e));
64
75
  }
65
- function y(a) {
66
- const e = window.unescape(encodeURIComponent(a));
76
+ function C(t) {
77
+ const e = window.unescape(encodeURIComponent(t));
67
78
  return window.btoa(e);
68
79
  }
69
80
  export {
70
- ie as calculateDistance,
81
+ re as calculateDistance,
71
82
  ue as calculateDistanceWithRadius,
72
- Re as camelToKebab,
73
- Te as capitalize,
74
- re as clamp,
75
- ye as cloneDeep,
76
- Ce as compareObjects,
83
+ Te as camelToKebab,
84
+ Pe as capitalize,
85
+ le as clamp,
86
+ Ce as cloneDeep,
87
+ Oe as compareObjects,
77
88
  p as cover,
78
- $ as createJSONAndSave,
79
- le as damp,
80
- L as debounce,
81
- y as decode,
89
+ H as createJSONAndSave,
90
+ ce as damp,
91
+ ee as debounce,
92
+ C as decode,
82
93
  Z as dispatchSizeChangeEvent,
83
- f as dotCircleCollision,
84
- x as dotRectCollision,
85
- v as easeInCubic,
94
+ x as dotCircleCollision,
95
+ f as dotRectCollision,
96
+ k as easeInCubic,
86
97
  B as easeInExpo,
87
- A as easeInOutCubic,
98
+ M as easeInOutCubic,
88
99
  N as easeInOutExpo,
89
100
  j as easeInOutQuad,
90
101
  z as easeInOutQuart,
91
- M as easeInOutQuint,
92
- U as easeInQuad,
102
+ U as easeInOutQuint,
103
+ V as easeInQuad,
93
104
  q as easeInQuart,
94
105
  J as easeInQuint,
95
106
  K as easeOutCubic,
96
- V as easeOutExpo,
107
+ $ as easeOutExpo,
97
108
  F as easeOutQuad,
98
109
  G as easeOutQuart,
99
110
  W as easeOutQuint,
100
111
  w as encode,
101
- P as findParentElement,
102
- R as findScrollParentElement,
112
+ D as findParentElement,
113
+ T as findScrollParentElement,
103
114
  m as fixPosition,
104
- ke as generateId,
105
- te as getCumulativeOffsetLeft,
106
- se as getCumulativeOffsetTop,
107
- ne as getCumulativePosition,
108
- T as getElement,
115
+ Ae as generateId,
116
+ se as getCumulativeOffsetLeft,
117
+ ne as getCumulativeOffsetTop,
118
+ oe as getCumulativePosition,
119
+ P as getElement,
109
120
  ze as getElementTransitionDurationMS,
110
- Me as getElementTransitionDurationS,
121
+ Ue as getElementTransitionDurationS,
111
122
  b as getPointerPosition,
112
- d as insert,
113
- S as isBrowser,
114
- Oe as isESClass,
115
- Ie as isNullish,
116
- Ee as isObject,
117
- ve as kebabToCamel,
123
+ y as getRootVariables,
124
+ c as insert,
125
+ Q as isBrowser,
126
+ Ee as isESClass,
127
+ Se as isNullish,
128
+ Ie as isObject,
129
+ ke as kebabToCamel,
118
130
  de as lerp,
119
131
  X as linear,
120
- ce as mapRange,
121
- c as measureText,
122
- Qe as mergeDeep,
132
+ me as mapRange,
133
+ d as measureText,
134
+ Re as mergeDeep,
123
135
  g as normalize,
124
- Se as omit,
125
- I as parseAttribute,
126
- E as parseAttributeValue,
127
- De as pick,
128
- ge as preciseNumber,
129
- me as round,
130
- be as roundNumberTo,
136
+ Qe as omit,
137
+ S as parseAttribute,
138
+ I as parseAttributeValue,
139
+ ve as pick,
140
+ be as preciseNumber,
141
+ pe as round,
142
+ ye as roundNumberTo,
131
143
  h as screenToCartesian,
132
- pe as smootherstep,
144
+ fe as smootherstep,
133
145
  xe as smoothstep,
134
146
  Be as snakeToDotted,
135
- fe as step,
136
- ee as throttle,
137
- Ae as toPascalCase,
147
+ he as step,
148
+ te as throttle,
149
+ Me as toPascalCase,
138
150
  Ne as uncapitalize
139
151
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.1.11",
3
+ "version": "0.1.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"