aptechka 0.26.0 → 0.26.1

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 it=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),nt=n=>{throw TypeError(n)};var Y=(n,t,i)=>t.has(n)||nt("Cannot "+i);var e=(n,t,i)=>(Y(n,t,"read from private field"),i?i.call(n):t.get(n)),o=(n,t,i)=>t.has(n)?nt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,i),u=(n,t,i,r)=>(Y(n,t,"write to private field"),r?r.call(n,i):t.set(n,i),i),m=(n,t,i)=>(Y(n,t,"access private method"),i);var T=(n,t,i)=>new Promise((r,s)=>{var d=l=>{try{p(i.next(l))}catch(E){s(E)}},g=l=>{try{p(i.throw(l))}catch(E){s(E)}},p=l=>l.done?r(l.value):Promise.resolve(l.value).then(d,g);p((i=i.apply(n,t)).next())});var st=(n,t,i)=>(t=n[it("asyncIterator")])?t.call(n):(n=n[it("iterator")](),t={},i=(r,s)=>(s=n[r])&&(t[r]=d=>new Promise((g,p,l)=>(d=s.call(n,d),l=d.done,Promise.resolve(d.value).then(E=>g({value:E,done:l}),p)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("../notifier/index.cjs"),ut=require("../browser-CpzFX2xg.cjs"),G=require("../url-C3Vj8msL.cjs"),at=require("../loading/index.cjs");var y,h,f,k,A,C,M;class dt{constructor(t,i){o(this,y);o(this,h);o(this,f);o(this,k);o(this,A);o(this,C,t=>{t.preventDefault(),e(this,y).links.forEach(i=>{var r;e(this,f)===e(i,f)||(r=e(i,A))!=null&&r.includes(e(this,f))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,y).navigate(e(this,f),e(this,k))});o(this,M,()=>{e(this,y).prefetch(e(this,f)),e(this,h).removeEventListener("pointerenter",e(this,M))});var d,g;u(this,y,i),u(this,h,t),u(this,f,e(this,h).getAttribute("href")||"/"),u(this,k,e(this,h).getAttribute("data-history-action")||"push"),e(this,h).addEventListener("click",e(this,C));const r=i.normalizePath(e(this,f)),s=i.normalizePath(location.pathname);u(this,A,(d=e(this,h).getAttribute("data-match-paths"))==null?void 0:d.split(",").map(p=>i.normalizePath(p.trim()).pathname)),e(this,h).hasAttribute("data-include")?s.pathname.includes(r.pathname)&&e(this,h).classList.add("current"):r.pathname===s.pathname||(g=e(this,A))!=null&&g.includes(s.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,M))}destroy(){e(this,h).removeEventListener("click",e(this,C)),e(this,h).removeEventListener("pointerenter",e(this,M)),e(this,h).classList.remove("current")}}y=new WeakMap,h=new WeakMap,f=new WeakMap,k=new WeakMap,A=new WeakMap,C=new WeakMap,M=new WeakMap;var S,z,q,x,H,O,P,L,w,_,D,c,J,Q,U,ot,V,B;class mt{constructor(t){o(this,c);o(this,S,null);o(this,z,null);o(this,q,null);o(this,x,null);o(this,H,[]);o(this,O,new DOMParser);o(this,P,new Map);o(this,L);o(this,w,null);o(this,_,new rt.Notifier);o(this,D,new rt.Notifier);o(this,B,t=>{t.state&&this.navigate(t.state,"none")});if(ut.isBrowser){u(this,S,G.normalizeBase(t==null?void 0:t.base)),u(this,z,(t==null?void 0:t.waitForHeadToLoad)!==!1),u(this,q,(t==null?void 0:t.cachePages)!==!1),u(this,x,m(this,c,U).call(this,document.body));const i=this.normalizePath(location.pathname);u(this,w,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,w)),document.documentElement.setAttribute("data-current-leaf",i.leaf),m(this,c,Q).call(this),addEventListener("popstate",e(this,B))}}get currentPathname(){return e(this,w)}get links(){return e(this,H)}normalizePath(t){return G.splitPath(t,e(this,S))}beforeNavigationEvent(t){return e(this,_).subscribe(t)}afterNavigationEvent(t){return e(this,D).subscribe(t)}prefetch(t){return T(this,null,function*(){const i=this.normalizePath(t);return m(this,c,J).call(this,i.pathname)})}navigate(t,i="push"){return T(this,null,function*(){var E;const r=this.normalizePath(t);let{pathname:s,hash:d,parameters:g,leaf:p}=r;if(e(this,L)===s||e(this,w)===s)return;u(this,L,s);const l=e(this,P).has(s);try{at.loading.add("__morph");let R=!0;if(e(this,_).notify({pathname:s,isCached:l}),this.preprocessor)try{yield new Promise((a,b)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:s,resolve:a,reject:b,isCached:l})})}catch(a){a?console.error(a):console.log("Route change canceled"),R=!1}if(!R||e(this,L)!==s)return;const X=e(this,P).get(s)||(yield m(this,c,J).call(this,s));if(e(this,L)!==s)return;const Z=Array.from(document.head.children),$=Array.from(X.head.cloneNode(!0).children),tt=m(this,c,ot).call(this,Z,$),ht=m(this,c,V).call(this,Z,tt),F=m(this,c,V).call(this,$,tt);F.forEach((a,b)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=a.getAttribute("src"),F[b]=v}}),F.forEach(a=>{document.head.appendChild(a)});const W=F.filter(a=>(a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK")&&a.getAttribute("rel")!=="canonical");e(this,z)&&W.length&&(yield new Promise(a=>T(this,null,function*(){let b=0;try{for(var v=st(W),lt,j,I;lt=!(j=yield v.next()).done;lt=!1){const N=j.value;N.onload=()=>{b++,b===W.length&&a()}}}catch(j){I=[j]}finally{try{lt&&(j=v.return)&&(yield j.call(v))}finally{if(I)throw I[0]}}}))),ht.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),u(this,w,s),G.changeHistory(i,s,g,d);const ct=m(this,c,U).call(this,X.body.cloneNode(!0));e(this,x).forEach((a,b)=>{const v=ct[b];let lt=[...a.childNodes],j=[...v.childNodes];lt.forEach(I=>{if(I instanceof HTMLElement){const N=I.getAttribute("data-remain");let et;j=j.filter(K=>K instanceof HTMLElement&&N&&K.getAttribute("data-remain")===N?(et=K,!1):!0),N&&et||I.remove()}else I.remove()}),a.append(...j)}),m(this,c,Q).call(this),document.documentElement.setAttribute("data-current-pathname",s),document.documentElement.setAttribute("data-current-leaf",p),(E=this.postprocessor)==null||E.call(this,{pathname:s,isCached:l}),e(this,D).notify({pathname:s,isCached:l}),at.loading.complete("__morph")}catch(R){console.error(R)}u(this,L,void 0)})}}S=new WeakMap,z=new WeakMap,q=new WeakMap,x=new WeakMap,H=new WeakMap,O=new WeakMap,P=new WeakMap,L=new WeakMap,w=new WeakMap,_=new WeakMap,D=new WeakMap,c=new WeakSet,J=function(t){return T(this,null,function*(){const i=e(this,P).get(t);if(i)return i;const s=yield(yield fetch(t)).text(),d=e(this,O).parseFromString(s,"text/html");return e(this,q)&&e(this,P).set(t,d),d})},Q=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var r;return(r=i.getAttribute("href"))==null?void 0:r.startsWith("/")});e(this,H).forEach(i=>i.destroy()),u(this,H,t.map(i=>new dt(i,this)))},U=function(t){return[...t.querySelectorAll("[data-morph]")]},ot=function(t,i){return t.filter(r=>i.find(s=>s.outerHTML===r.outerHTML))},V=function(t,i){return t.filter(r=>!i.find(s=>s.outerHTML===r.outerHTML))},B=new WeakMap;exports.Morph=mt;
1
+ "use strict";var it=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),nt=n=>{throw TypeError(n)};var Y=(n,t,i)=>t.has(n)||nt("Cannot "+i);var e=(n,t,i)=>(Y(n,t,"read from private field"),i?i.call(n):t.get(n)),o=(n,t,i)=>t.has(n)?nt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,i),u=(n,t,i,r)=>(Y(n,t,"write to private field"),r?r.call(n,i):t.set(n,i),i),m=(n,t,i)=>(Y(n,t,"access private method"),i);var T=(n,t,i)=>new Promise((r,s)=>{var d=l=>{try{p(i.next(l))}catch(E){s(E)}},g=l=>{try{p(i.throw(l))}catch(E){s(E)}},p=l=>l.done?r(l.value):Promise.resolve(l.value).then(d,g);p((i=i.apply(n,t)).next())});var st=(n,t,i)=>(t=n[it("asyncIterator")])?t.call(n):(n=n[it("iterator")](),t={},i=(r,s)=>(s=n[r])&&(t[r]=d=>new Promise((g,p,l)=>(d=s.call(n,d),l=d.done,Promise.resolve(d.value).then(E=>g({value:E,done:l}),p)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("../notifier/index.cjs"),ut=require("../browser-CpzFX2xg.cjs"),G=require("../url-qZNgg7IM.cjs"),at=require("../loading/index.cjs");var y,h,f,k,A,C,M;class dt{constructor(t,i){o(this,y);o(this,h);o(this,f);o(this,k);o(this,A);o(this,C,t=>{t.preventDefault(),e(this,y).links.forEach(i=>{var r;e(this,f)===e(i,f)||(r=e(i,A))!=null&&r.includes(e(this,f))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,y).navigate(e(this,f),e(this,k))});o(this,M,()=>{e(this,y).prefetch(e(this,f)),e(this,h).removeEventListener("pointerenter",e(this,M))});var d,g;u(this,y,i),u(this,h,t),u(this,f,e(this,h).getAttribute("href")||"/"),u(this,k,e(this,h).getAttribute("data-history-action")||"push"),e(this,h).addEventListener("click",e(this,C));const r=i.normalizePath(e(this,f)),s=i.normalizePath(location.pathname);u(this,A,(d=e(this,h).getAttribute("data-match-paths"))==null?void 0:d.split(",").map(p=>i.normalizePath(p.trim()).pathname)),e(this,h).hasAttribute("data-include")?s.pathname.includes(r.pathname)&&e(this,h).classList.add("current"):r.pathname===s.pathname||(g=e(this,A))!=null&&g.includes(s.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,M))}destroy(){e(this,h).removeEventListener("click",e(this,C)),e(this,h).removeEventListener("pointerenter",e(this,M)),e(this,h).classList.remove("current")}}y=new WeakMap,h=new WeakMap,f=new WeakMap,k=new WeakMap,A=new WeakMap,C=new WeakMap,M=new WeakMap;var S,z,q,x,H,O,P,L,w,_,D,c,J,Q,U,ot,V,B;class mt{constructor(t){o(this,c);o(this,S,null);o(this,z,null);o(this,q,null);o(this,x,null);o(this,H,[]);o(this,O,new DOMParser);o(this,P,new Map);o(this,L);o(this,w,null);o(this,_,new rt.Notifier);o(this,D,new rt.Notifier);o(this,B,t=>{t.state&&this.navigate(t.state,"none")});if(ut.isBrowser){u(this,S,G.normalizeBase(t==null?void 0:t.base)),u(this,z,(t==null?void 0:t.waitForHeadToLoad)!==!1),u(this,q,(t==null?void 0:t.cachePages)!==!1),u(this,x,m(this,c,U).call(this,document.body));const i=this.normalizePath(location.pathname);u(this,w,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,w)),document.documentElement.setAttribute("data-current-leaf",i.leaf),m(this,c,Q).call(this),addEventListener("popstate",e(this,B))}}get currentPathname(){return e(this,w)}get links(){return e(this,H)}normalizePath(t){return G.splitPath(t,e(this,S))}beforeNavigationEvent(t){return e(this,_).subscribe(t)}afterNavigationEvent(t){return e(this,D).subscribe(t)}prefetch(t){return T(this,null,function*(){const i=this.normalizePath(t);return m(this,c,J).call(this,i.pathname)})}navigate(t,i="push"){return T(this,null,function*(){var E;const r=this.normalizePath(t);let{pathname:s,hash:d,parameters:g,leaf:p}=r;if(e(this,L)===s||e(this,w)===s)return;u(this,L,s);const l=e(this,P).has(s);try{at.loading.add("__morph");let R=!0;if(e(this,_).notify({pathname:s,isCached:l}),this.preprocessor)try{yield new Promise((a,b)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:s,resolve:a,reject:b,isCached:l})})}catch(a){a?console.error(a):console.log("Route change canceled"),R=!1}if(!R||e(this,L)!==s)return;const X=e(this,P).get(s)||(yield m(this,c,J).call(this,s));if(e(this,L)!==s)return;const Z=Array.from(document.head.children),$=Array.from(X.head.cloneNode(!0).children),tt=m(this,c,ot).call(this,Z,$),ht=m(this,c,V).call(this,Z,tt),F=m(this,c,V).call(this,$,tt);F.forEach((a,b)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=a.getAttribute("src"),F[b]=v}}),F.forEach(a=>{document.head.appendChild(a)});const W=F.filter(a=>(a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK")&&a.getAttribute("rel")!=="canonical");e(this,z)&&W.length&&(yield new Promise(a=>T(this,null,function*(){let b=0;try{for(var v=st(W),lt,j,I;lt=!(j=yield v.next()).done;lt=!1){const N=j.value;N.onload=()=>{b++,b===W.length&&a()}}}catch(j){I=[j]}finally{try{lt&&(j=v.return)&&(yield j.call(v))}finally{if(I)throw I[0]}}}))),ht.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),u(this,w,s),G.changeHistory(i,s,g,d);const ct=m(this,c,U).call(this,X.body.cloneNode(!0));e(this,x).forEach((a,b)=>{const v=ct[b];let lt=[...a.childNodes],j=[...v.childNodes];lt.forEach(I=>{if(I instanceof HTMLElement){const N=I.getAttribute("data-remain");let et;j=j.filter(K=>K instanceof HTMLElement&&N&&K.getAttribute("data-remain")===N?(et=K,!1):!0),N&&et||I.remove()}else I.remove()}),a.append(...j)}),m(this,c,Q).call(this),document.documentElement.setAttribute("data-current-pathname",s),document.documentElement.setAttribute("data-current-leaf",p),(E=this.postprocessor)==null||E.call(this,{pathname:s,isCached:l}),e(this,D).notify({pathname:s,isCached:l}),at.loading.complete("__morph")}catch(R){console.error(R)}u(this,L,void 0)})}}S=new WeakMap,z=new WeakMap,q=new WeakMap,x=new WeakMap,H=new WeakMap,O=new WeakMap,P=new WeakMap,L=new WeakMap,w=new WeakMap,_=new WeakMap,D=new WeakMap,c=new WeakSet,J=function(t){return T(this,null,function*(){const i=e(this,P).get(t);if(i)return i;const s=yield(yield fetch(t)).text(),d=e(this,O).parseFromString(s,"text/html");return e(this,q)&&e(this,P).set(t,d),d})},Q=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var r;return(r=i.getAttribute("href"))==null?void 0:r.startsWith("/")});e(this,H).forEach(i=>i.destroy()),u(this,H,t.map(i=>new dt(i,this)))},U=function(t){return[...t.querySelectorAll("[data-morph]")]},ot=function(t,i){return t.filter(r=>i.find(s=>s.outerHTML===r.outerHTML))},V=function(t,i){return t.filter(r=>!i.find(s=>s.outerHTML===r.outerHTML))},B=new WeakMap;exports.Morph=mt;
@@ -22,7 +22,7 @@ var T = (s, t, i) => new Promise((r, n) => {
22
22
  var st = (s, t, i) => (t = s[et("asyncIterator")]) ? t.call(s) : (s = s[et("iterator")](), t = {}, i = (r, n) => (n = s[r]) && (t[r] = (d) => new Promise((g, p, l) => (d = n.call(s, d), l = d.done, Promise.resolve(d.value).then((E) => g({ value: E, done: l }), p)))), i("next"), i("return"), t);
23
23
  import { Notifier as nt } from "../notifier/index.js";
24
24
  import { i as lt } from "../browser-0zX67oeU.js";
25
- import { n as ut, s as dt, c as mt } from "../url-BDc0awLa.js";
25
+ import { n as ut, s as dt, c as mt } from "../url-BuZrUXAO.js";
26
26
  import { loading as rt } from "../loading/index.js";
27
27
  var A, h, f, k, y, C, H;
28
28
  class ft {
@@ -1 +1 @@
1
- "use strict";var Z=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n),$=n=>{throw TypeError(n)};var K=(n,e,s)=>e.has(n)||$("Cannot "+s);var t=(n,e,s)=>(K(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),a=(n,e,s,i)=>(K(n,e,"write to private field"),i?i.call(n,s):e.set(n,s),s),W=(n,e,s)=>(K(n,e,"access private method"),s);var M=(n,e,s)=>new Promise((i,h)=>{var o=d=>{try{f(s.next(d))}catch(w){h(w)}},c=d=>{try{f(s.throw(d))}catch(w){h(w)}},f=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,c);f((s=s.apply(n,e)).next())});var Y=(n,e,s)=>(e=n[Z("asyncIterator")])?e.call(n):(n=n[Z("iterator")](),e={},s=(i,h)=>(h=n[i])&&(e[i]=o=>new Promise((c,f,d)=>(o=h.call(n,o),d=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:d}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-C3Vj8msL.cjs"),ot=require("../object-CCiXnER2.cjs");var R,O,A,p,m,v,k,L,b,E,x,et;class ct{constructor(e,s){r(this,x);r(this,R);r(this,O);r(this,A);r(this,p);r(this,m);r(this,v);r(this,k);r(this,L,null);r(this,b,[]);r(this,E,[]);a(this,R,e),a(this,O,s),a(this,A,new URLPattern({pathname:t(this,R)})),a(this,p,null),a(this,m,null),a(this,v,!1),a(this,k,null),tt.isBrowser&&a(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,m)}get nest(){return t(this,k)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(a(this,E,[...t(this,b)]),typeof o.default=="function"&&(a(this,p,o.default),ot.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,x,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),d={pathnameParams:c,searchParams:f};a(this,m,new(t(this,p))(d)),e.appendChild(t(this,m)),a(this,k,t(this,m).querySelector("[data-nest]")||((h=t(this,m).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,m).shadowRoot||t(this,m)),a(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,m))==null||e.remove(),a(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),a(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,m)&&(e=[...t(this,m).querySelectorAll("a")]),(s=t(this,m))!=null&&s.shadowRoot&&(e=[...e,...t(this,m).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,k=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,et=function(){return M(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var S,u,P,U,q,j;class lt{constructor(e,s){r(this,S);r(this,u);r(this,P);r(this,U);r(this,q);r(this,j,e=>{e.preventDefault(),t(this,S).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,u).classList.add("clicked"):t(s,u).classList.remove("clicked")}),t(this,S).navigate(t(this,P),t(this,U))});var o,c;a(this,S,e),a(this,u,s),a(this,P,t(this,u).getAttribute("href")||"/"),a(this,U,t(this,u).getAttribute("data-history-action")||"push"),t(this,u).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);a(this,q,(o=t(this,u).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,u).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,u).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,u).classList.add("current"),t(this,u).classList.add("clicked")):t(this,u).classList.remove("clicked")}destroy(){t(this,u).removeEventListener("click",t(this,j)),t(this,u).classList.remove("current")}}S=new WeakMap,u=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var N,C,g,z,T,y,H,B,I,_,st,D;class ut{constructor(e){r(this,_);r(this,N,null);r(this,C,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y);r(this,H,null);r(this,B,new rt.Notifier);r(this,I,ht.debounce(()=>{const e=s=>s.split("/").length;a(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{e.state&&this.navigate(e.state,"none")});tt.isBrowser&&(e!=null&&e.base?a(this,C,F.normalizeBase(e.base)):a(this,C,"/"),a(this,N,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,B).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;a(this,y,h);const d=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!d.includes(l)&&l.testPathname(f)),it=d.filter(l=>!l.testPathname(f)),G=d.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){a(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),a(this,H,h),F.changeHistory(s,h,c,o);try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,N),h),a(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,_,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,B).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,t(this,C))}}N=new WeakMap,C=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,_=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,N).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),a(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
1
+ "use strict";var Z=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n),$=n=>{throw TypeError(n)};var K=(n,e,s)=>e.has(n)||$("Cannot "+s);var t=(n,e,s)=>(K(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),a=(n,e,s,i)=>(K(n,e,"write to private field"),i?i.call(n,s):e.set(n,s),s),W=(n,e,s)=>(K(n,e,"access private method"),s);var M=(n,e,s)=>new Promise((i,h)=>{var o=d=>{try{f(s.next(d))}catch(w){h(w)}},c=d=>{try{f(s.throw(d))}catch(w){h(w)}},f=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,c);f((s=s.apply(n,e)).next())});var Y=(n,e,s)=>(e=n[Z("asyncIterator")])?e.call(n):(n=n[Z("iterator")](),e={},s=(i,h)=>(h=n[i])&&(e[i]=o=>new Promise((c,f,d)=>(o=h.call(n,o),d=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:d}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-qZNgg7IM.cjs"),ot=require("../object-CCiXnER2.cjs");var R,O,A,p,m,v,k,L,b,E,x,et;class ct{constructor(e,s){r(this,x);r(this,R);r(this,O);r(this,A);r(this,p);r(this,m);r(this,v);r(this,k);r(this,L,null);r(this,b,[]);r(this,E,[]);a(this,R,e),a(this,O,s),a(this,A,new URLPattern({pathname:t(this,R)})),a(this,p,null),a(this,m,null),a(this,v,!1),a(this,k,null),tt.isBrowser&&a(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,m)}get nest(){return t(this,k)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(a(this,E,[...t(this,b)]),typeof o.default=="function"&&(a(this,p,o.default),ot.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,x,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),d={pathnameParams:c,searchParams:f};a(this,m,new(t(this,p))(d)),e.appendChild(t(this,m)),a(this,k,t(this,m).querySelector("[data-nest]")||((h=t(this,m).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,m).shadowRoot||t(this,m)),a(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,m))==null||e.remove(),a(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),a(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,m)&&(e=[...t(this,m).querySelectorAll("a")]),(s=t(this,m))!=null&&s.shadowRoot&&(e=[...e,...t(this,m).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,k=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,et=function(){return M(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var S,u,P,U,q,j;class lt{constructor(e,s){r(this,S);r(this,u);r(this,P);r(this,U);r(this,q);r(this,j,e=>{e.preventDefault(),t(this,S).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,u).classList.add("clicked"):t(s,u).classList.remove("clicked")}),t(this,S).navigate(t(this,P),t(this,U))});var o,c;a(this,S,e),a(this,u,s),a(this,P,t(this,u).getAttribute("href")||"/"),a(this,U,t(this,u).getAttribute("data-history-action")||"push"),t(this,u).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);a(this,q,(o=t(this,u).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,u).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,u).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,u).classList.add("current"),t(this,u).classList.add("clicked")):t(this,u).classList.remove("clicked")}destroy(){t(this,u).removeEventListener("click",t(this,j)),t(this,u).classList.remove("current")}}S=new WeakMap,u=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var N,C,g,z,T,y,H,B,I,_,st,D;class ut{constructor(e){r(this,_);r(this,N,null);r(this,C,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y);r(this,H,null);r(this,B,new rt.Notifier);r(this,I,ht.debounce(()=>{const e=s=>s.split("/").length;a(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{e.state&&this.navigate(e.state,"none")});tt.isBrowser&&(e!=null&&e.base?a(this,C,F.normalizeBase(e.base)):a(this,C,"/"),a(this,N,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,B).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;a(this,y,h);const d=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!d.includes(l)&&l.testPathname(f)),it=d.filter(l=>!l.testPathname(f)),G=d.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){a(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),a(this,H,h),F.changeHistory(s,h,c,o);try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,N),h),a(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,_,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,B).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,t(this,C))}}N=new WeakMap,C=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,_=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,N).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),a(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
@@ -24,7 +24,7 @@ import { URLPattern as at } from "urlpattern-polyfill";
24
24
  import { Notifier as nt } from "../notifier/index.js";
25
25
  import { i as _ } from "../browser-0zX67oeU.js";
26
26
  import { d as ht } from "../function-C10DGppn.js";
27
- import { n as rt, c as ot, s as ct } from "../url-BDc0awLa.js";
27
+ import { n as rt, c as ot, s as ct } from "../url-BuZrUXAO.js";
28
28
  import { i as lt } from "../object-D6MVWB4l.js";
29
29
  var y, U, A, p, d, L, k, v, E, R, M, tt;
30
30
  class ut {
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react");function u(e){const r=t.useCallback(e.subscribe.bind(e),[e]);return[t.useSyncExternalStore(r,()=>e.current,()=>e.current),n=>{e.current=n}]}exports.useStore=u;
@@ -0,0 +1,14 @@
1
+ import { useCallback as e, useSyncExternalStore as u } from "react";
2
+ function S(t) {
3
+ const n = e(t.subscribe.bind(t), [t]);
4
+ return [u(
5
+ n,
6
+ () => t.current,
7
+ () => t.current
8
+ ), (r) => {
9
+ t.current = r;
10
+ }];
11
+ }
12
+ export {
13
+ S as useStore
14
+ };
@@ -0,0 +1 @@
1
+ "use strict";var g=r=>{throw TypeError(r)};var v=(r,s,e)=>s.has(r)||g("Cannot "+e);var c=(r,s,e)=>(v(r,s,"read from private field"),e?e.call(r):s.get(r)),n=(r,s,e)=>s.has(r)?g("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(r):s.set(r,e),h=(r,s,e,t)=>(v(r,s,"write to private field"),t?t.call(r,e):s.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../Store-CDb6RMce.cjs"),m=require("../../function-MthRj-GJ.cjs");var d;class D extends i.Store{constructor(e,t,u){super(null,u);n(this,d);h(this,d,e.subscribe(a=>{this.current=t(a.current)}))}close(){super.close(),c(this,d).call(this)}}d=new WeakMap;var b;class R extends i.Store{constructor(e,t,u){super(null,u);n(this,b);h(this,b,e.subscribe(a=>{this.current=a.current.map((p,x,y)=>t(p,x,y))}))}close(){super.close(),c(this,b).call(this)}}b=new WeakMap;var f,o,l;class C extends i.Store{constructor(e,t,u){super(e,u);n(this,f);n(this,o);n(this,l,0);h(this,o,new i.Store(!1)),h(this,f,t),u!=null&&u.manualControl||this.refetch()}get isPending(){return c(this,o)}refetch(){c(this,o).current=!0,h(this,l,c(this,l)+1);const e=c(this,l);c(this,f).call(this).then(t=>{e===c(this,l)&&(c(this,o).current=!1,this.current=t)})}}f=new WeakMap,o=new WeakMap,l=new WeakMap;var S;class P extends i.Store{constructor(e,t,u){super(null,u);n(this,S,[]);const a=m.debounce(()=>{this.current=t()},0);e.forEach(p=>{c(this,S).push(p.subscribe(()=>{a()}))})}close(){super.close(),c(this,S).forEach(e=>e())}}S=new WeakMap;exports.Store=i.Store;exports.activeStores=i.activeStores;exports.storeRegistry=i.storeRegistry;exports.Composed=P;exports.Derived=D;exports.DerivedArray=R;exports.Resource=C;
@@ -3,9 +3,9 @@ var x = (e) => {
3
3
  };
4
4
  var g = (e, r, s) => r.has(e) || x("Cannot " + s);
5
5
  var c = (e, r, s) => (g(e, r, "read from private field"), s ? s.call(e) : r.get(e)), i = (e, r, s) => r.has(e) ? x("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, s), h = (e, r, s, t) => (g(e, r, "write to private field"), t ? t.call(e, s) : r.set(e, s), s);
6
- import { S as a } from "../Store-OTdcl6SX.js";
7
- import { a as k, s as q } from "../Store-OTdcl6SX.js";
8
- import { d as y } from "../function-C10DGppn.js";
6
+ import { S as a } from "../../Store-OTdcl6SX.js";
7
+ import { a as k, s as q } from "../../Store-OTdcl6SX.js";
8
+ import { d as y } from "../../function-C10DGppn.js";
9
9
  var d;
10
10
  class I extends a {
11
11
  constructor(s, t, u) {
@@ -0,0 +1,25 @@
1
+ function h(t, i = "") {
2
+ i = i.endsWith("/") ? i.slice(0, -1) : i, t = t.replace(i, ""), t.startsWith("/") && (t = t.slice(1));
3
+ const c = t.split("#"), n = c[0].split("?");
4
+ let s = n[0].startsWith("/") ? n[0] : "/" + n[0];
5
+ s = s.endsWith("/") && s !== "/" ? s.slice(0, -1) : s;
6
+ const o = i + s, e = n == null ? void 0 : n[1], r = c == null ? void 0 : c[1];
7
+ return {
8
+ leaf: s,
9
+ pathname: o,
10
+ parameters: e,
11
+ hash: r
12
+ };
13
+ }
14
+ function l(t = "/") {
15
+ return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
16
+ }
17
+ function p(t, i, c, n) {
18
+ const s = c || location.search, o = n ? n.startsWith("#") ? n : "#" + n : "", e = s ? s.startsWith("?") ? s : "?" + s : "", r = `${i}${o}${e}`;
19
+ t === "push" ? history.pushState(null, "", r) : t === "replace" && history.replaceState(null, "", r);
20
+ }
21
+ export {
22
+ p as c,
23
+ l as n,
24
+ h as s
25
+ };
@@ -0,0 +1 @@
1
+ "use strict";function h(t,n=""){n=n.endsWith("/")?n.slice(0,-1):n,t=t.replace(n,""),t.startsWith("/")&&(t=t.slice(1));const r=t.split("#"),i=r[0].split("?");let s=i[0].startsWith("/")?i[0]:"/"+i[0];s=s.endsWith("/")&&s!=="/"?s.slice(0,-1):s;const o=n+s,e=i==null?void 0:i[1],c=r==null?void 0:r[1];return{leaf:s,pathname:o,parameters:e,hash:c}}function l(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function p(t,n,r,i){const s=r||location.search,o=i?i.startsWith("#")?i:"#"+i:"",e=s?s.startsWith("?")?s:"?"+s:"",c=`${n}${o}${e}`;t==="push"?history.pushState(null,"",c):t==="replace"&&history.replaceState(null,"",c)}exports.changeHistory=p;exports.normalizeBase=l;exports.splitPath=h;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../attributes-Bf2svn4j.cjs"),E=require("../browser-CpzFX2xg.cjs"),l=require("../canvas-CU5Xjahf.cjs"),d=require("../coordinates-D8Np3cPD.cjs"),m=require("../dom-JBOkFLTh.cjs"),s=require("../easings-DsS5-Kqc.cjs"),S=require("../events-KVanG9sR.cjs"),f=require("../style-BqzUd8Fy.cjs"),C=require("../function-MthRj-GJ.cjs"),I=require("../gestures-DHLrn6Q8.cjs"),O=require("../jss-GJLvaNfT.cjs"),g=require("../layout-8ryRAMGJ.cjs"),i=require("../math-GDWEqu7y.cjs"),p=require("../polyfills-CM4SCDTt.cjs"),r=require("../object-CCiXnER2.cjs"),u=require("../string-DhgS_iFl.cjs"),b=require("../url-C3Vj8msL.cjs");function T(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function P(t,e){const n=t.length;e=e%n;const a=new Array(n);for(let o=0;o<n;o++){const c=(o+e)%n;a[c]=t[o]}return a}function v(t,e=2){if(!+t)return"0 Bytes";const n=1024,a=e<0?0:e,o=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],c=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,c)).toFixed(a))} ${o[c]}`}function w(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function x(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function y(t,e){const n=t.styleMap.get(e);if(n){const a=n.toString();return a.startsWith("var")?y(t,a.slice(4,-1)):a}}function q(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(a=>{a instanceof CSSStyleRule&&a.selectorText===":root"&&t.forEach(o=>{const c=y(a,o);c&&(e[o]=c)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function Q(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function B(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function D(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}exports.parseAttribute=h.parseAttribute;exports.parseAttributeValue=h.parseAttributeValue;exports.isBrowser=E.isBrowser;exports.contain=l.contain;exports.cover=l.cover;exports.fixPosition=l.fixPosition;exports.measureText=l.measureText;exports.getPointerPosition=d.getPointerPosition;exports.normalize=d.normalize;exports.screenToCartesian=d.screenToCartesian;exports.findParentElement=m.findParentElement;exports.findScrollParentElement=m.findScrollParentElement;exports.getAllParentElements=m.getAllParentElements;exports.getElement=m.getElement;exports.easeInCubic=s.easeInCubic;exports.easeInExpo=s.easeInExpo;exports.easeInOutCubic=s.easeInOutCubic;exports.easeInOutExpo=s.easeInOutExpo;exports.easeInOutQuad=s.easeInOutQuad;exports.easeInOutQuart=s.easeInOutQuart;exports.easeInOutQuint=s.easeInOutQuint;exports.easeInQuad=s.easeInQuad;exports.easeInQuart=s.easeInQuart;exports.easeInQuint=s.easeInQuint;exports.easeOutCubic=s.easeOutCubic;exports.easeOutExpo=s.easeOutExpo;exports.easeOutQuad=s.easeOutQuad;exports.easeOutQuart=s.easeOutQuart;exports.easeOutQuint=s.easeOutQuint;exports.linear=s.linear;exports.dispatchEvent=S.dispatchEvent;exports.createJSONAndSave=f.createJSONAndSave;exports.getElementTransitionDurationMS=f.getElementTransitionDurationMS;exports.getElementTransitionDurationS=f.getElementTransitionDurationS;exports.debounce=C.debounce;exports.throttle=C.throttle;exports.setupDrag=I.setupDrag;exports.createStylesheet=O.createStylesheet;exports.styleToString=O.styleToString;exports.getCumulativeOffsetLeft=g.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=g.getCumulativeOffsetTop;exports.getCumulativePosition=g.getCumulativePosition;exports.calculateDistance=i.calculateDistance;exports.calculateDistanceWithRadius=i.calculateDistanceWithRadius;exports.clamp=i.clamp;exports.damp=i.damp;exports.lerp=i.lerp;exports.mapRange=i.mapRange;exports.round=i.round;exports.smootherstep=i.smootherstep;exports.smoothstep=i.smoothstep;exports.step=i.step;exports.nullishCoalescing=p.nullishCoalescing;exports.preciseNumber=p.preciseNumber;exports.roundNumberTo=p.roundNumberTo;exports.toStep=p.toStep;exports.cloneDeep=r.cloneDeep;exports.compareObjects=r.compareObjects;exports.isESClass=r.isESClass;exports.isNullish=r.isNullish;exports.isObject=r.isObject;exports.mergeDeep=r.mergeDeep;exports.mixin=r.mixin;exports.omit=r.omit;exports.pick=r.pick;exports.camelToKebab=u.camelToKebab;exports.capitalize=u.capitalize;exports.generateId=u.generateId;exports.isUppercase=u.isUppercase;exports.kebabToCamel=u.kebabToCamel;exports.snakeToDotted=u.snakeToDotted;exports.toPascalCase=u.toPascalCase;exports.uncapitalize=u.uncapitalize;exports.changeHistory=b.changeHistory;exports.normalizeBase=b.normalizeBase;exports.splitPath=b.splitPath;exports.decode=B;exports.dotCircleCollision=x;exports.dotRectCollision=w;exports.encode=Q;exports.formatBytes=v;exports.getRootVariables=q;exports.insert=T;exports.shiftArray=P;exports.wait=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../attributes-Bf2svn4j.cjs"),E=require("../browser-CpzFX2xg.cjs"),l=require("../canvas-CU5Xjahf.cjs"),d=require("../coordinates-D8Np3cPD.cjs"),m=require("../dom-JBOkFLTh.cjs"),s=require("../easings-DsS5-Kqc.cjs"),S=require("../events-KVanG9sR.cjs"),f=require("../style-BqzUd8Fy.cjs"),C=require("../function-MthRj-GJ.cjs"),I=require("../gestures-DHLrn6Q8.cjs"),O=require("../jss-GJLvaNfT.cjs"),g=require("../layout-8ryRAMGJ.cjs"),i=require("../math-GDWEqu7y.cjs"),p=require("../polyfills-CM4SCDTt.cjs"),r=require("../object-CCiXnER2.cjs"),u=require("../string-DhgS_iFl.cjs"),b=require("../url-qZNgg7IM.cjs");function T(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function P(t,e){const n=t.length;e=e%n;const a=new Array(n);for(let o=0;o<n;o++){const c=(o+e)%n;a[c]=t[o]}return a}function v(t,e=2){if(!+t)return"0 Bytes";const n=1024,a=e<0?0:e,o=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],c=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,c)).toFixed(a))} ${o[c]}`}function w(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function x(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function y(t,e){const n=t.style.getPropertyValue(e);if(n){const a=n.toString();return a.startsWith("var")?y(t,a.slice(4,-1)):a}}function q(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(a=>{a instanceof CSSStyleRule&&a.selectorText===":root"&&t.forEach(o=>{const c=y(a,o);c&&(e[o]=c)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function Q(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function B(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function D(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}exports.parseAttribute=h.parseAttribute;exports.parseAttributeValue=h.parseAttributeValue;exports.isBrowser=E.isBrowser;exports.contain=l.contain;exports.cover=l.cover;exports.fixPosition=l.fixPosition;exports.measureText=l.measureText;exports.getPointerPosition=d.getPointerPosition;exports.normalize=d.normalize;exports.screenToCartesian=d.screenToCartesian;exports.findParentElement=m.findParentElement;exports.findScrollParentElement=m.findScrollParentElement;exports.getAllParentElements=m.getAllParentElements;exports.getElement=m.getElement;exports.easeInCubic=s.easeInCubic;exports.easeInExpo=s.easeInExpo;exports.easeInOutCubic=s.easeInOutCubic;exports.easeInOutExpo=s.easeInOutExpo;exports.easeInOutQuad=s.easeInOutQuad;exports.easeInOutQuart=s.easeInOutQuart;exports.easeInOutQuint=s.easeInOutQuint;exports.easeInQuad=s.easeInQuad;exports.easeInQuart=s.easeInQuart;exports.easeInQuint=s.easeInQuint;exports.easeOutCubic=s.easeOutCubic;exports.easeOutExpo=s.easeOutExpo;exports.easeOutQuad=s.easeOutQuad;exports.easeOutQuart=s.easeOutQuart;exports.easeOutQuint=s.easeOutQuint;exports.linear=s.linear;exports.dispatchEvent=S.dispatchEvent;exports.createJSONAndSave=f.createJSONAndSave;exports.getElementTransitionDurationMS=f.getElementTransitionDurationMS;exports.getElementTransitionDurationS=f.getElementTransitionDurationS;exports.debounce=C.debounce;exports.throttle=C.throttle;exports.setupDrag=I.setupDrag;exports.createStylesheet=O.createStylesheet;exports.styleToString=O.styleToString;exports.getCumulativeOffsetLeft=g.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=g.getCumulativeOffsetTop;exports.getCumulativePosition=g.getCumulativePosition;exports.calculateDistance=i.calculateDistance;exports.calculateDistanceWithRadius=i.calculateDistanceWithRadius;exports.clamp=i.clamp;exports.damp=i.damp;exports.lerp=i.lerp;exports.mapRange=i.mapRange;exports.round=i.round;exports.smootherstep=i.smootherstep;exports.smoothstep=i.smoothstep;exports.step=i.step;exports.nullishCoalescing=p.nullishCoalescing;exports.preciseNumber=p.preciseNumber;exports.roundNumberTo=p.roundNumberTo;exports.toStep=p.toStep;exports.cloneDeep=r.cloneDeep;exports.compareObjects=r.compareObjects;exports.isESClass=r.isESClass;exports.isNullish=r.isNullish;exports.isObject=r.isObject;exports.mergeDeep=r.mergeDeep;exports.mixin=r.mixin;exports.omit=r.omit;exports.pick=r.pick;exports.camelToKebab=u.camelToKebab;exports.capitalize=u.capitalize;exports.generateId=u.generateId;exports.isUppercase=u.isUppercase;exports.kebabToCamel=u.kebabToCamel;exports.snakeToDotted=u.snakeToDotted;exports.toPascalCase=u.toPascalCase;exports.uncapitalize=u.uncapitalize;exports.changeHistory=b.changeHistory;exports.normalizeBase=b.normalizeBase;exports.splitPath=b.splitPath;exports.decode=B;exports.dotCircleCollision=x;exports.dotRectCollision=w;exports.encode=Q;exports.formatBytes=v;exports.getRootVariables=q;exports.insert=T;exports.shiftArray=P;exports.wait=D;
@@ -1,24 +1,24 @@
1
1
  import { a as b, p as y } from "../attributes-69we3byR.js";
2
2
  import { i as w } from "../browser-0zX67oeU.js";
3
3
  import { a as S, c as O, f as B, m as I } from "../canvas-DeZ0SLUJ.js";
4
- import { g as P, n as v, s as A } from "../coordinates-CgdGoSYs.js";
5
- import { f as D, b as M, a as R, g as k } from "../dom-0S_WDL4g.js";
6
- import { c as j, n as N, f as V, p as U, b as $, i as F, m as K, e as W, g as q, j as G, d as H, o as J, a as L, h as Y, k as Z, l as X } from "../easings-BKi40vHz.js";
4
+ import { g as T, n as v, s as A } from "../coordinates-CgdGoSYs.js";
5
+ import { f as D, b as R, a as M, g as k } from "../dom-0S_WDL4g.js";
6
+ import { c as V, n as j, f as N, p as U, b as $, i as F, m as K, e as W, g as q, j as G, d as H, o as J, a as L, h as Y, k as Z, l as X } from "../easings-BKi40vHz.js";
7
7
  import { d as ee } from "../events-CsVF98U6.js";
8
8
  import { c as te, a as se, g as oe } from "../style-M-RBTQxT.js";
9
9
  import { d as re, t as ie } from "../function-C10DGppn.js";
10
- import { s as ue } from "../gestures-D2Fdra_G.js";
10
+ import { s as ce } from "../gestures-D2Fdra_G.js";
11
11
  import { c as fe, s as pe } from "../jss-CjccJC-K.js";
12
12
  import { g as de, a as xe, b as ge } from "../layout-HoBT_Da2.js";
13
- import { e as be, f as ye, c as Ce, d as we, l as Ee, m as Se, r as Oe, b as Be, a as Ie, s as Te } from "../math-BOBiC4TN.js";
13
+ import { e as be, f as ye, c as Ce, d as we, l as Ee, m as Se, r as Oe, b as Be, a as Ie, s as Pe } from "../math-BOBiC4TN.js";
14
14
  import { n as ve, p as Ae, r as Qe, t as De } from "../polyfills-X6KXuHg-.js";
15
- import { c as Re, d as ke, i as ze, b as je, a as Ne, m as Ve, e as Ue, o as $e, p as Fe } from "../object-D6MVWB4l.js";
15
+ import { c as Me, d as ke, i as ze, b as Ve, a as je, m as Ne, e as Ue, o as $e, p as Fe } from "../object-D6MVWB4l.js";
16
16
  import { c as We, a as qe, g as Ge, i as He, k as Je, s as Le, t as Ye, u as Ze } from "../string-f0Dnk0L1.js";
17
- import { c as _e, n as ea, s as aa } from "../url-BDc0awLa.js";
17
+ import { c as _e, n as ea, s as aa } from "../url-BuZrUXAO.js";
18
18
  function i(a, e, ...t) {
19
19
  return [...a.slice(0, e), ...t, ...a.slice(e)];
20
20
  }
21
- function c(a, e) {
21
+ function u(a, e) {
22
22
  const t = a.length;
23
23
  e = e % t;
24
24
  const s = new Array(t);
@@ -28,7 +28,7 @@ function c(a, e) {
28
28
  }
29
29
  return s;
30
30
  }
31
- function u(a, e = 2) {
31
+ function c(a, e = 2) {
32
32
  if (!+a) return "0 Bytes";
33
33
  const t = 1024, s = e < 0 ? 0 : e, o = [
34
34
  "Bytes",
@@ -50,7 +50,7 @@ function f(a, e) {
50
50
  return Math.sqrt((a.x - e.x) ** 2 + (a.y - e.y) ** 2) < e.radius;
51
51
  }
52
52
  function r(a, e) {
53
- const t = a.styleMap.get(e);
53
+ const t = a.style.getPropertyValue(e);
54
54
  if (t) {
55
55
  const s = t.toString();
56
56
  return s.startsWith("var") ? r(a, s.slice(4, -1)) : s;
@@ -91,7 +91,7 @@ export {
91
91
  qe as capitalize,
92
92
  _e as changeHistory,
93
93
  Ce as clamp,
94
- Re as cloneDeep,
94
+ Me as cloneDeep,
95
95
  ke as compareObjects,
96
96
  S as contain,
97
97
  O as cover,
@@ -103,9 +103,9 @@ export {
103
103
  ee as dispatchEvent,
104
104
  f as dotCircleCollision,
105
105
  l as dotRectCollision,
106
- j as easeInCubic,
107
- N as easeInExpo,
108
- V as easeInOutCubic,
106
+ V as easeInCubic,
107
+ j as easeInExpo,
108
+ N as easeInOutCubic,
109
109
  U as easeInOutExpo,
110
110
  $ as easeInOutQuad,
111
111
  F as easeInOutQuart,
@@ -120,31 +120,31 @@ export {
120
120
  Z as easeOutQuint,
121
121
  m as encode,
122
122
  D as findParentElement,
123
- M as findScrollParentElement,
123
+ R as findScrollParentElement,
124
124
  B as fixPosition,
125
- u as formatBytes,
125
+ c as formatBytes,
126
126
  Ge as generateId,
127
- R as getAllParentElements,
127
+ M as getAllParentElements,
128
128
  de as getCumulativeOffsetLeft,
129
129
  xe as getCumulativeOffsetTop,
130
130
  ge as getCumulativePosition,
131
131
  k as getElement,
132
132
  se as getElementTransitionDurationMS,
133
133
  oe as getElementTransitionDurationS,
134
- P as getPointerPosition,
134
+ T as getPointerPosition,
135
135
  p as getRootVariables,
136
136
  i as insert,
137
137
  w as isBrowser,
138
138
  ze as isESClass,
139
- je as isNullish,
140
- Ne as isObject,
139
+ Ve as isNullish,
140
+ je as isObject,
141
141
  He as isUppercase,
142
142
  Je as kebabToCamel,
143
143
  Ee as lerp,
144
144
  X as linear,
145
145
  Se as mapRange,
146
146
  I as measureText,
147
- Ve as mergeDeep,
147
+ Ne as mergeDeep,
148
148
  Ue as mixin,
149
149
  v as normalize,
150
150
  ea as normalizeBase,
@@ -157,13 +157,13 @@ export {
157
157
  Oe as round,
158
158
  Qe as roundNumberTo,
159
159
  A as screenToCartesian,
160
- ue as setupDrag,
161
- c as shiftArray,
160
+ ce as setupDrag,
161
+ u as shiftArray,
162
162
  Be as smootherstep,
163
163
  Ie as smoothstep,
164
164
  Le as snakeToDotted,
165
165
  aa as splitPath,
166
- Te as step,
166
+ Pe as step,
167
167
  pe as styleToString,
168
168
  ie as throttle,
169
169
  Ye as toPascalCase,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -168,10 +168,15 @@
168
168
  "default": "./lib/source/index.js",
169
169
  "types": "./lib/source/index.d.ts"
170
170
  },
171
- "./store": {
172
- "require": "./lib/store/index.cjs",
173
- "default": "./lib/store/index.js",
174
- "types": "./lib/store/index.d.ts"
171
+ "./store/vanill": {
172
+ "require": "./lib/store/vanill/index.cjs",
173
+ "default": "./lib/store/vanill/index.js",
174
+ "types": "./lib/store/vanill/index.d.ts"
175
+ },
176
+ "./store/react": {
177
+ "require": "./lib/store/react/index.cjs",
178
+ "default": "./lib/store/react/index.js",
179
+ "types": "./lib/store/react/index.d.ts"
175
180
  },
176
181
  "./ticker/vanilla": {
177
182
  "require": "./lib/ticker/vanilla/index.cjs",
@@ -302,8 +307,11 @@
302
307
  "source": [
303
308
  "lib/source/index.d.ts"
304
309
  ],
305
- "store": [
306
- "lib/store/index.d.ts"
310
+ "store/vanilla": [
311
+ "lib/store/vanilla/index.d.ts"
312
+ ],
313
+ "store/react": [
314
+ "lib/store/react/index.d.ts"
307
315
  ],
308
316
  "ticker/vanilla": [
309
317
  "lib/ticker/vanilla/index.d.ts"
@@ -1 +0,0 @@
1
- "use strict";var g=r=>{throw TypeError(r)};var v=(r,s,e)=>s.has(r)||g("Cannot "+e);var c=(r,s,e)=>(v(r,s,"read from private field"),e?e.call(r):s.get(r)),n=(r,s,e)=>s.has(r)?g("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(r):s.set(r,e),h=(r,s,e,t)=>(v(r,s,"write to private field"),t?t.call(r,e):s.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../Store-CDb6RMce.cjs"),m=require("../function-MthRj-GJ.cjs");var d;class D extends i.Store{constructor(e,t,u){super(null,u);n(this,d);h(this,d,e.subscribe(a=>{this.current=t(a.current)}))}close(){super.close(),c(this,d).call(this)}}d=new WeakMap;var b;class R extends i.Store{constructor(e,t,u){super(null,u);n(this,b);h(this,b,e.subscribe(a=>{this.current=a.current.map((p,x,y)=>t(p,x,y))}))}close(){super.close(),c(this,b).call(this)}}b=new WeakMap;var f,o,l;class C extends i.Store{constructor(e,t,u){super(e,u);n(this,f);n(this,o);n(this,l,0);h(this,o,new i.Store(!1)),h(this,f,t),u!=null&&u.manualControl||this.refetch()}get isPending(){return c(this,o)}refetch(){c(this,o).current=!0,h(this,l,c(this,l)+1);const e=c(this,l);c(this,f).call(this).then(t=>{e===c(this,l)&&(c(this,o).current=!1,this.current=t)})}}f=new WeakMap,o=new WeakMap,l=new WeakMap;var S;class P extends i.Store{constructor(e,t,u){super(null,u);n(this,S,[]);const a=m.debounce(()=>{this.current=t()},0);e.forEach(p=>{c(this,S).push(p.subscribe(()=>{a()}))})}close(){super.close(),c(this,S).forEach(e=>e())}}S=new WeakMap;exports.Store=i.Store;exports.activeStores=i.activeStores;exports.storeRegistry=i.storeRegistry;exports.Composed=P;exports.Derived=D;exports.DerivedArray=R;exports.Resource=C;
@@ -1,22 +0,0 @@
1
- function p(t, n = "") {
2
- n = n.endsWith("/") ? n.slice(0, -1) : n, t = t.replace(n, ""), t.startsWith("/") && (t = t.slice(1));
3
- const c = t.split("#"), s = c[0].split("?"), i = s[0].startsWith("/") ? s[0] : "/" + s[0], o = n + i, h = s == null ? void 0 : s[1], r = c == null ? void 0 : c[1];
4
- return {
5
- leaf: i,
6
- pathname: o,
7
- parameters: h,
8
- hash: r
9
- };
10
- }
11
- function e(t = "/") {
12
- return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
13
- }
14
- function l(t, n, c, s) {
15
- const i = c || location.search, o = s ? s.startsWith("#") ? s : "#" + s : "", h = i ? i.startsWith("?") ? i : "?" + i : "", r = `${n}${o}${h}`;
16
- t === "push" ? history.pushState(null, "", r) : t === "replace" && history.replaceState(null, "", r);
17
- }
18
- export {
19
- l as c,
20
- e as n,
21
- p as s
22
- };
@@ -1 +0,0 @@
1
- "use strict";function e(t,n=""){n=n.endsWith("/")?n.slice(0,-1):n,t=t.replace(n,""),t.startsWith("/")&&(t=t.slice(1));const r=t.split("#"),s=r[0].split("?"),i=s[0].startsWith("/")?s[0]:"/"+s[0],o=n+i,h=s==null?void 0:s[1],c=r==null?void 0:r[1];return{leaf:i,pathname:o,parameters:h,hash:c}}function l(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function p(t,n,r,s){const i=r||location.search,o=s?s.startsWith("#")?s:"#"+s:"",h=i?i.startsWith("?")?i:"?"+i:"",c=`${n}${o}${h}`;t==="push"?history.pushState(null,"",c):t==="replace"&&history.replaceState(null,"",c)}exports.changeHistory=p;exports.normalizeBase=l;exports.splitPath=e;