aptechka 0.42.9 → 0.42.10

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.
@@ -4,6 +4,7 @@ export interface MorphParameters {
4
4
  base?: string;
5
5
  waitForHeadToLoad?: boolean;
6
6
  cachePages?: boolean;
7
+ trailingSlash?: boolean;
7
8
  }
8
9
  export interface MorphNavigationEntry {
9
10
  pathname: string;
@@ -1 +1 @@
1
- "use strict";var ot=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),ht=n=>{throw TypeError(n)};var Q=(n,t,i)=>t.has(n)||ht("Cannot "+i);var e=(n,t,i)=>(Q(n,t,"read from private field"),i?i.call(n):t.get(n)),o=(n,t,i)=>t.has(n)?ht("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,i),c=(n,t,i,s)=>(Q(n,t,"write to private field"),s?s.call(n,i):t.set(n,i),i),y=(n,t,i)=>(Q(n,t,"access private method"),i);var z=(n,t,i)=>new Promise((s,l)=>{var u=f=>{try{L(i.next(f))}catch(P){l(P)}},a=f=>{try{L(i.throw(f))}catch(P){l(P)}},L=f=>f.done?s(f.value):Promise.resolve(f.value).then(u,a);L((i=i.apply(n,t)).next())});var ct=(n,t,i)=>(t=n[ot("asyncIterator")])?t.call(n):(n=n[ot("iterator")](),t={},i=(s,l)=>(l=n[s])&&(t[s]=u=>new Promise((a,L,f)=>(u=l.call(n,u),f=u.done,Promise.resolve(u.value).then(P=>a({value:P,done:f}),L)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pt=require("../browser-CpzFX2xg.cjs"),K=require("../events-KVanG9sR.cjs"),V=require("../url-BiHPIsKq.cjs"),dt=require("../loading/index.cjs");var T,h,p,q,x,H,D,k;class lt{constructor(t,i){o(this,T);o(this,h);o(this,p);o(this,q);o(this,x);o(this,H);o(this,D,t=>{t.preventDefault(),e(this,T).links.forEach(i=>{var s;e(this,p)===e(i,p)||(s=e(i,H))!=null&&s.includes(e(this,p))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,T).navigate(e(this,p),{historyAction:e(this,q),state:e(this,x)})});o(this,k,()=>{e(this,T).prefetch(e(this,p)),e(this,h).removeEventListener("pointerenter",e(this,k))});var u,a;c(this,T,i),c(this,h,t),c(this,p,e(this,h).getAttribute("href")||"/"),c(this,q,e(this,h).getAttribute("data-history-action")||"push"),c(this,x,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,D));const s=i.normalizePath(e(this,p)),l=i.normalizePath(location.pathname);c(this,H,(u=e(this,h).getAttribute("data-match-paths"))==null?void 0:u.split(",").map(L=>i.normalizePath(L.trim()).pathname)),e(this,h).hasAttribute("data-include")?l.pathname.includes(s.pathname)&&e(this,h).classList.add("current"):s.pathname===l.pathname||(a=e(this,H))!=null&&a.includes(l.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,k))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,D)),e(this,h).removeEventListener("pointerenter",e(this,k)),e(this,h).classList.remove("current")}}T=new WeakMap,h=new WeakMap,p=new WeakMap,q=new WeakMap,x=new WeakMap,H=new WeakMap,D=new WeakMap,k=new WeakMap;var I,O,R,S,E,Y,M,b,g,_,B,v,m,U,X,ut,Z,G;class gt{constructor(t){o(this,m);o(this,I,null);o(this,O,null);o(this,R,null);o(this,S,null);o(this,E,[]);o(this,Y,new DOMParser);o(this,M,new Map);o(this,b);o(this,g,null);o(this,_);o(this,B);o(this,v,[]);o(this,G,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(pt.isBrowser){c(this,I,V.normalizeBase(t==null?void 0:t.base)),c(this,O,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,R,(t==null?void 0:t.cachePages)!==!1),c(this,S,y(this,m,X).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,g,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,g)),document.documentElement.setAttribute("data-current-leaf",i.leaf),this.findLinks(),addEventListener("popstate",e(this,G)),V.changeHistory("replace",e(this,g),i.parameters,i.hash),e(this,S).map(s=>[...s.children]).flat().forEach(s=>{s instanceof HTMLElement&&s.classList.add("current")})}}get currentPathname(){return e(this,g)}get previousPathname(){return e(this,_)}get currentState(){return e(this,B)}get links(){return e(this,E)}normalizePath(t){return V.splitPath(t,e(this,I))}prefetch(t){return z(this,null,function*(){const i=this.normalizePath(t);return y(this,m,U).call(this,i.pathname)})}navigate(l){return z(this,arguments,function*(t,{historyAction:i="push",state:s}={}){var $;if(e(this,v).length)return;const u=this.normalizePath(t);let{pathname:a,hash:L,parameters:f,leaf:P}=u;if(e(this,b)===a||e(this,g)===a)return;c(this,B,s),c(this,b,a);const N=e(this,M).has(a);try{dt.loading.add("__morph");let F=!0;if(K.dispatchEvent(document,"morphBeforeNavigation",{detail:{pathname:a,isCached:N,state:s}}),this.preprocessor)try{yield new Promise((r,w)=>{var A;(A=this.preprocessor)==null||A.call(this,{pathname:a,resolve:r,reject:w,isCached:N,state:s})})}catch(r){r?console.error(r):console.log("Route change canceled"),F=!1}if(!F||e(this,b)!==a)return;const tt=e(this,M).get(a)||(yield y(this,m,U).call(this,a));if(e(this,b)!==a)return;const et=Array.from(document.head.children),it=Array.from(tt.head.cloneNode(!0).children),st=y(this,m,ut).call(this,et,it),mt=y(this,m,Z).call(this,et,st),W=y(this,m,Z).call(this,it,st);W.forEach((r,w)=>{if(r.tagName==="SCRIPT"&&r.getAttribute("src")){const A=document.createElement("script");A.type="module",A.src=r.getAttribute("src"),W[w]=A}}),W.forEach(r=>{document.head.appendChild(r)});const J=W.filter(r=>!r.hasAttribute("data-no-waiting")&&(r.tagName==="STYLE"||r.tagName==="SCRIPT"||r.tagName==="LINK")&&r.getAttribute("rel")!=="canonical");e(this,O)&&J.length&&(yield new Promise(r=>z(this,null,function*(){let w=0;try{for(var A=ct(J),nt,C,rt;nt=!(C=yield A.next()).done;nt=!1){const j=C.value;j.onload=()=>{w++,w===J.length&&r()}}}catch(C){rt=[C]}finally{try{nt&&(C=A.return)&&(yield C.call(A))}finally{if(rt)throw rt[0]}}}))),mt.forEach(r=>{r.hasAttribute("data-permanent")||r.remove()}),c(this,_,e(this,g)),c(this,g,a),V.changeHistory(i,a,f,L);const ft=y(this,m,X).call(this,tt.body.cloneNode(!0));e(this,v).forEach(r=>clearTimeout(r)),c(this,v,[]),e(this,S).forEach((r,w)=>{const A=ft[w],nt=getComputedStyle(r).getPropertyValue("--morph-duration"),C=[...A.childNodes];if(nt){const rt=[...r.childNodes];rt.forEach(d=>{d instanceof HTMLElement&&d.classList.add("old")}),C.forEach(d=>{d instanceof HTMLElement&&d.classList.add("new")}),r.append(...C),setTimeout(()=>{C.forEach(d=>{d instanceof HTMLElement&&d.classList.add("in")})},10);const j={element:r,pathname:a,isCached:N,state:s};K.dispatchEvent(document,"morphBeforeElementOut",{detail:j});const at=setTimeout(()=>{rt.forEach(d=>d.remove()),C.forEach(d=>{d instanceof HTMLElement&&(d.classList.remove("new","in"),d.classList.add("current"))}),K.dispatchEvent(document,"morphAfterElementOut",{detail:j}),c(this,v,e(this,v).filter(d=>d!==at))},(parseFloat(nt)||0)*1e3+10);e(this,v).push(at)}else r.innerHTML="",r.append(...C)}),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",a),document.documentElement.setAttribute("data-current-leaf",P),($=this.postprocessor)==null||$.call(this,{pathname:a,isCached:N,state:s}),K.dispatchEvent(document,"morphAfterNavigation",{detail:{pathname:a,isCached:N,state:s}}),dt.loading.complete("__morph")}catch(F){console.error(F)}c(this,b,void 0)})}addLink(t){e(this,E).push(new lt(t,this))}addLinks(t){t.forEach(i=>{this.addLink(i)})}removeLink(t){c(this,E,e(this,E).filter(i=>i.element===t?(i.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var s;return((s=i.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!i.hasAttribute("download")&&!i.hasAttribute("data-morph-skip")&&!i.closest("[data-morph-skip]")});e(this,E).forEach(i=>i.destroy()),c(this,E,t.map(i=>new lt(i,this)))}}I=new WeakMap,O=new WeakMap,R=new WeakMap,S=new WeakMap,E=new WeakMap,Y=new WeakMap,M=new WeakMap,b=new WeakMap,g=new WeakMap,_=new WeakMap,B=new WeakMap,v=new WeakMap,m=new WeakSet,U=function(t){return z(this,null,function*(){const i=e(this,M).get(t);if(i)return i;const l=yield(yield fetch(t)).text(),u=e(this,Y).parseFromString(l,"text/html");return e(this,R)&&e(this,M).set(t,u),u})},X=function(t){const i=[...t.querySelectorAll("[data-morph]")];return i.length?i:[t]},ut=function(t,i){return t.filter(s=>i.find(l=>l.outerHTML===s.outerHTML))},Z=function(t,i){return t.filter(s=>!i.find(l=>l.outerHTML===s.outerHTML))},G=new WeakMap;exports.Morph=gt;
1
+ "use strict";var ht=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),ct=n=>{throw TypeError(n)};var U=(n,t,i)=>t.has(n)||ct("Cannot "+i);var e=(n,t,i)=>(U(n,t,"read from private field"),i?i.call(n):t.get(n)),r=(n,t,i)=>t.has(n)?ct("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,i),c=(n,t,i,s)=>(U(n,t,"write to private field"),s?s.call(n,i):t.set(n,i),i),y=(n,t,i)=>(U(n,t,"access private method"),i);var z=(n,t,i)=>new Promise((s,d)=>{var u=f=>{try{L(i.next(f))}catch(P){d(P)}},o=f=>{try{L(i.throw(f))}catch(P){d(P)}},L=f=>f.done?s(f.value):Promise.resolve(f.value).then(u,o);L((i=i.apply(n,t)).next())});var lt=(n,t,i)=>(t=n[ht("asyncIterator")])?t.call(n):(n=n[ht("iterator")](),t={},i=(s,d)=>(d=n[s])&&(t[s]=u=>new Promise((o,L,f)=>(u=d.call(n,u),f=u.done,Promise.resolve(u.value).then(P=>o({value:P,done:f}),L)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const gt=require("../browser-CpzFX2xg.cjs"),V=require("../events-KVanG9sR.cjs"),Y=require("../url-CHQeS8b5.cjs"),dt=require("../loading/index.cjs");var T,h,p,q,x,H,D,k;class ut{constructor(t,i){r(this,T);r(this,h);r(this,p);r(this,q);r(this,x);r(this,H);r(this,D,t=>{t.preventDefault(),e(this,T).links.forEach(i=>{var s;e(this,p)===e(i,p)||(s=e(i,H))!=null&&s.includes(e(this,p))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,T).navigate(e(this,p),{historyAction:e(this,q),state:e(this,x)})});r(this,k,()=>{e(this,T).prefetch(e(this,p)),e(this,h).removeEventListener("pointerenter",e(this,k))});var u,o;c(this,T,i),c(this,h,t),c(this,p,e(this,h).getAttribute("href")||"/"),c(this,q,e(this,h).getAttribute("data-history-action")||"push"),c(this,x,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,D));const s=i.normalizePath(e(this,p)),d=i.normalizePath(location.pathname);c(this,H,(u=e(this,h).getAttribute("data-match-paths"))==null?void 0:u.split(",").map(L=>i.normalizePath(L.trim()).pathname)),e(this,h).hasAttribute("data-include")?d.pathname.includes(s.pathname)&&e(this,h).classList.add("current"):s.pathname===d.pathname||(o=e(this,H))!=null&&o.includes(d.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,k))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,D)),e(this,h).removeEventListener("pointerenter",e(this,k)),e(this,h).classList.remove("current")}}T=new WeakMap,h=new WeakMap,p=new WeakMap,q=new WeakMap,x=new WeakMap,H=new WeakMap,D=new WeakMap,k=new WeakMap;var I,O,R,_,S,E,G,M,b,g,B,F,v,m,X,Z,mt,$,J;class Lt{constructor(t){r(this,m);r(this,I,null);r(this,O,null);r(this,R,null);r(this,_,!1);r(this,S,null);r(this,E,[]);r(this,G,new DOMParser);r(this,M,new Map);r(this,b);r(this,g,null);r(this,B);r(this,F);r(this,v,[]);r(this,J,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(gt.isBrowser){c(this,I,Y.normalizeBase(t==null?void 0:t.base)),c(this,O,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,R,(t==null?void 0:t.cachePages)!==!1),c(this,_,(t==null?void 0:t.trailingSlash)||!1),c(this,S,y(this,m,Z).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,g,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,g)),document.documentElement.setAttribute("data-current-leaf",i.leaf),this.findLinks(),addEventListener("popstate",e(this,J)),Y.changeHistory("replace",e(this,g),i.parameters,i.hash),e(this,S).map(s=>[...s.children]).flat().forEach(s=>{s instanceof HTMLElement&&s.classList.add("current")})}}get currentPathname(){return e(this,g)}get previousPathname(){return e(this,B)}get currentState(){return e(this,F)}get links(){return e(this,E)}normalizePath(t){return Y.splitPath(t,e(this,I),e(this,_))}prefetch(t){return z(this,null,function*(){const i=this.normalizePath(t);return y(this,m,X).call(this,i.pathname)})}navigate(d){return z(this,arguments,function*(t,{historyAction:i="push",state:s}={}){var tt;if(e(this,v).length)return;const u=this.normalizePath(t);let{pathname:o,hash:L,parameters:f,leaf:P}=u;if(e(this,b)===o||e(this,g)===o)return;c(this,F,s),c(this,b,o);const N=e(this,M).has(o);try{dt.loading.add("__morph");let W=!0;if(V.dispatchEvent(document,"morphBeforeNavigation",{detail:{pathname:o,isCached:N,state:s}}),this.preprocessor)try{yield new Promise((a,w)=>{var A;(A=this.preprocessor)==null||A.call(this,{pathname:o,resolve:a,reject:w,isCached:N,state:s})})}catch(a){a?console.error(a):console.log("Route change canceled"),W=!1}if(!W||e(this,b)!==o)return;const et=e(this,M).get(o)||(yield y(this,m,X).call(this,o));if(e(this,b)!==o)return;const it=Array.from(document.head.children),st=Array.from(et.head.cloneNode(!0).children),nt=y(this,m,mt).call(this,it,st),ft=y(this,m,$).call(this,it,nt),j=y(this,m,$).call(this,st,nt);j.forEach((a,w)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const A=document.createElement("script");A.type="module",A.src=a.getAttribute("src"),j[w]=A}}),j.forEach(a=>{document.head.appendChild(a)});const Q=j.filter(a=>!a.hasAttribute("data-no-waiting")&&(a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK")&&a.getAttribute("rel")!=="canonical");e(this,O)&&Q.length&&(yield new Promise(a=>z(this,null,function*(){let w=0;try{for(var A=lt(Q),at,C,rt;at=!(C=yield A.next()).done;at=!1){const K=C.value;K.onload=()=>{w++,w===Q.length&&a()}}}catch(C){rt=[C]}finally{try{at&&(C=A.return)&&(yield C.call(A))}finally{if(rt)throw rt[0]}}}))),ft.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),c(this,B,e(this,g)),c(this,g,o),Y.changeHistory(i,o,f,L);const pt=y(this,m,Z).call(this,et.body.cloneNode(!0));e(this,v).forEach(a=>clearTimeout(a)),c(this,v,[]),e(this,S).forEach((a,w)=>{const A=pt[w],at=getComputedStyle(a).getPropertyValue("--morph-duration"),C=[...A.childNodes];if(at){const rt=[...a.childNodes];rt.forEach(l=>{l instanceof HTMLElement&&l.classList.add("old")}),C.forEach(l=>{l instanceof HTMLElement&&l.classList.add("new")}),a.append(...C),setTimeout(()=>{C.forEach(l=>{l instanceof HTMLElement&&l.classList.add("in")})},10);const K={element:a,pathname:o,isCached:N,state:s};V.dispatchEvent(document,"morphBeforeElementOut",{detail:K});const ot=setTimeout(()=>{rt.forEach(l=>l.remove()),C.forEach(l=>{l instanceof HTMLElement&&(l.classList.remove("new","in"),l.classList.add("current"))}),V.dispatchEvent(document,"morphAfterElementOut",{detail:K}),c(this,v,e(this,v).filter(l=>l!==ot))},(parseFloat(at)||0)*1e3+10);e(this,v).push(ot)}else a.innerHTML="",a.append(...C)}),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",o),document.documentElement.setAttribute("data-current-leaf",P),(tt=this.postprocessor)==null||tt.call(this,{pathname:o,isCached:N,state:s}),V.dispatchEvent(document,"morphAfterNavigation",{detail:{pathname:o,isCached:N,state:s}}),dt.loading.complete("__morph")}catch(W){console.error(W)}c(this,b,void 0)})}addLink(t){e(this,E).push(new ut(t,this))}addLinks(t){t.forEach(i=>{this.addLink(i)})}removeLink(t){c(this,E,e(this,E).filter(i=>i.element===t?(i.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var s;return((s=i.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!i.hasAttribute("download")&&!i.hasAttribute("data-morph-skip")&&!i.closest("[data-morph-skip]")});e(this,E).forEach(i=>i.destroy()),c(this,E,t.map(i=>new ut(i,this)))}}I=new WeakMap,O=new WeakMap,R=new WeakMap,_=new WeakMap,S=new WeakMap,E=new WeakMap,G=new WeakMap,M=new WeakMap,b=new WeakMap,g=new WeakMap,B=new WeakMap,F=new WeakMap,v=new WeakMap,m=new WeakSet,X=function(t){return z(this,null,function*(){const i=e(this,M).get(t);if(i)return i;const d=yield(yield fetch(t)).text(),u=e(this,G).parseFromString(d,"text/html");return e(this,R)&&e(this,M).set(t,u),u})},Z=function(t){const i=[...t.querySelectorAll("[data-morph]")];return i.length?i:[t]},mt=function(t,i){return t.filter(s=>i.find(d=>d.outerHTML===s.outerHTML))},$=function(t,i){return t.filter(s=>!i.find(d=>d.outerHTML===s.outerHTML))},J=new WeakMap;exports.Morph=Lt;
@@ -1,56 +1,56 @@
1
- var rt = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), ot = (n) => {
1
+ var ot = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), ht = (n) => {
2
2
  throw TypeError(n);
3
3
  };
4
- var J = (n, t, s) => t.has(n) || ot("Cannot " + s);
5
- var e = (n, t, s) => (J(n, t, "read from private field"), s ? s.call(n) : t.get(n)), o = (n, t, s) => t.has(n) ? ot("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), c = (n, t, s, i) => (J(n, t, "write to private field"), i ? i.call(n, s) : t.set(n, s), s), P = (n, t, s) => (J(n, t, "access private method"), s);
6
- var z = (n, t, s) => new Promise((i, l) => {
4
+ var Q = (n, t, i) => t.has(n) || ht("Cannot " + i);
5
+ var e = (n, t, i) => (Q(n, t, "read from private field"), i ? i.call(n) : t.get(n)), r = (n, t, i) => t.has(n) ? ht("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, i), c = (n, t, i, s) => (Q(n, t, "write to private field"), s ? s.call(n, i) : t.set(n, i), i), P = (n, t, i) => (Q(n, t, "access private method"), i);
6
+ var z = (n, t, i) => new Promise((s, d) => {
7
7
  var u = (f) => {
8
8
  try {
9
- g(s.next(f));
9
+ g(i.next(f));
10
10
  } catch (b) {
11
- l(b);
11
+ d(b);
12
12
  }
13
- }, r = (f) => {
13
+ }, o = (f) => {
14
14
  try {
15
- g(s.throw(f));
15
+ g(i.throw(f));
16
16
  } catch (b) {
17
- l(b);
17
+ d(b);
18
18
  }
19
- }, g = (f) => f.done ? i(f.value) : Promise.resolve(f.value).then(u, r);
20
- g((s = s.apply(n, t)).next());
19
+ }, g = (f) => f.done ? s(f.value) : Promise.resolve(f.value).then(u, o);
20
+ g((i = i.apply(n, t)).next());
21
21
  });
22
- var ht = (n, t, s) => (t = n[rt("asyncIterator")]) ? t.call(n) : (n = n[rt("iterator")](), t = {}, s = (i, l) => (l = n[i]) && (t[i] = (u) => new Promise((r, g, f) => (u = l.call(n, u), f = u.done, Promise.resolve(u.value).then((b) => r({ value: b, done: f }), g)))), s("next"), s("return"), t);
23
- import { i as pt } from "../browser-0zX67oeU.js";
24
- import { d as V } from "../events-CsVF98U6.js";
25
- import { n as Lt, c as ct, s as gt } from "../url-B5eH5z6S.js";
22
+ var ct = (n, t, i) => (t = n[ot("asyncIterator")]) ? t.call(n) : (n = n[ot("iterator")](), t = {}, i = (s, d) => (d = n[s]) && (t[s] = (u) => new Promise((o, g, f) => (u = d.call(n, u), f = u.done, Promise.resolve(u.value).then((b) => o({ value: b, done: f }), g)))), i("next"), i("return"), t);
23
+ import { i as Lt } from "../browser-0zX67oeU.js";
24
+ import { d as Y } from "../events-CsVF98U6.js";
25
+ import { n as gt, c as lt, s as Et } from "../url-DqQuzXwT.js";
26
26
  import { loading as dt } from "../loading/index.js";
27
27
  var T, h, p, x, D, H, I, M;
28
- class lt {
29
- constructor(t, s) {
30
- o(this, T);
31
- o(this, h);
32
- o(this, p);
33
- o(this, x);
34
- o(this, D);
35
- o(this, H);
36
- o(this, I, (t) => {
37
- t.preventDefault(), e(this, T).links.forEach((s) => {
38
- var i;
39
- e(this, p) === e(s, p) || (i = e(s, H)) != null && i.includes(e(this, p)) ? e(s, h).classList.add("clicked") : e(s, h).classList.remove("clicked");
28
+ class ut {
29
+ constructor(t, i) {
30
+ r(this, T);
31
+ r(this, h);
32
+ r(this, p);
33
+ r(this, x);
34
+ r(this, D);
35
+ r(this, H);
36
+ r(this, I, (t) => {
37
+ t.preventDefault(), e(this, T).links.forEach((i) => {
38
+ var s;
39
+ e(this, p) === e(i, p) || (s = e(i, H)) != null && s.includes(e(this, p)) ? e(i, h).classList.add("clicked") : e(i, h).classList.remove("clicked");
40
40
  }), e(this, T).navigate(e(this, p), {
41
41
  historyAction: e(this, x),
42
42
  state: e(this, D)
43
43
  });
44
44
  });
45
- o(this, M, () => {
45
+ r(this, M, () => {
46
46
  e(this, T).prefetch(e(this, p)), e(this, h).removeEventListener("pointerenter", e(this, M));
47
47
  });
48
- var u, r;
49
- c(this, T, s), c(this, h, t), c(this, p, e(this, h).getAttribute("href") || "/"), c(this, x, e(this, h).getAttribute(
48
+ var u, o;
49
+ c(this, T, i), c(this, h, t), c(this, p, e(this, h).getAttribute("href") || "/"), c(this, x, e(this, h).getAttribute(
50
50
  "data-history-action"
51
51
  ) || "push"), c(this, D, e(this, h).getAttribute("data-state") || void 0), e(this, h).addEventListener("click", e(this, I));
52
- const i = s.normalizePath(e(this, p)), l = s.normalizePath(location.pathname);
53
- c(this, H, (u = e(this, h).getAttribute("data-match-paths")) == null ? void 0 : u.split(",").map((g) => s.normalizePath(g.trim()).pathname)), e(this, h).hasAttribute("data-include") ? l.pathname.includes(i.pathname) && e(this, h).classList.add("current") : i.pathname === l.pathname || (r = e(this, H)) != null && r.includes(l.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));
52
+ const s = i.normalizePath(e(this, p)), d = i.normalizePath(location.pathname);
53
+ c(this, H, (u = e(this, h).getAttribute("data-match-paths")) == null ? void 0 : u.split(",").map((g) => i.normalizePath(g.trim()).pathname)), e(this, h).hasAttribute("data-include") ? d.pathname.includes(s.pathname) && e(this, h).classList.add("current") : s.pathname === d.pathname || (o = e(this, H)) != null && o.includes(d.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));
54
54
  }
55
55
  get element() {
56
56
  return e(this, h);
@@ -60,41 +60,42 @@ class lt {
60
60
  }
61
61
  }
62
62
  T = new WeakMap(), h = new WeakMap(), p = new WeakMap(), x = new WeakMap(), D = new WeakMap(), H = new WeakMap(), I = new WeakMap(), M = new WeakMap();
63
- var R, B, F, N, E, Y, k, y, L, O, _, v, m, Q, U, ut, X, j;
64
- class yt {
63
+ var R, B, F, O, S, E, j, k, y, L, _, q, v, m, U, X, mt, Z, G;
64
+ class bt {
65
65
  constructor(t) {
66
- o(this, m);
67
- o(this, R, null);
68
- o(this, B, null);
69
- o(this, F, null);
70
- o(this, N, null);
71
- o(this, E, []);
72
- o(this, Y, new DOMParser());
73
- o(this, k, /* @__PURE__ */ new Map());
74
- o(this, y);
75
- o(this, L, null);
76
- o(this, O);
77
- o(this, _);
78
- o(this, v, []);
79
- o(this, j, (t) => {
66
+ r(this, m);
67
+ r(this, R, null);
68
+ r(this, B, null);
69
+ r(this, F, null);
70
+ r(this, O, !1);
71
+ r(this, S, null);
72
+ r(this, E, []);
73
+ r(this, j, new DOMParser());
74
+ r(this, k, /* @__PURE__ */ new Map());
75
+ r(this, y);
76
+ r(this, L, null);
77
+ r(this, _);
78
+ r(this, q);
79
+ r(this, v, []);
80
+ r(this, G, (t) => {
80
81
  t.state && this.navigate(t.state, { historyAction: "none" });
81
82
  });
82
- if (pt) {
83
- c(this, R, Lt(t == null ? void 0 : t.base)), c(this, B, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, F, (t == null ? void 0 : t.cachePages) !== !1), c(this, N, P(this, m, U).call(this, document.body));
84
- const s = this.normalizePath(location.pathname);
85
- c(this, L, s.pathname), document.documentElement.setAttribute(
83
+ if (Lt) {
84
+ c(this, R, gt(t == null ? void 0 : t.base)), c(this, B, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, F, (t == null ? void 0 : t.cachePages) !== !1), c(this, O, (t == null ? void 0 : t.trailingSlash) || !1), c(this, S, P(this, m, X).call(this, document.body));
85
+ const i = this.normalizePath(location.pathname);
86
+ c(this, L, i.pathname), document.documentElement.setAttribute(
86
87
  "data-current-pathname",
87
88
  e(this, L)
88
89
  ), document.documentElement.setAttribute(
89
90
  "data-current-leaf",
90
- s.leaf
91
- ), this.findLinks(), addEventListener("popstate", e(this, j)), ct(
91
+ i.leaf
92
+ ), this.findLinks(), addEventListener("popstate", e(this, G)), lt(
92
93
  "replace",
93
94
  e(this, L),
94
- s.parameters,
95
- s.hash
96
- ), e(this, N).map((i) => [...i.children]).flat().forEach((i) => {
97
- i instanceof HTMLElement && i.classList.add("current");
95
+ i.parameters,
96
+ i.hash
97
+ ), e(this, S).map((s) => [...s.children]).flat().forEach((s) => {
98
+ s instanceof HTMLElement && s.classList.add("current");
98
99
  });
99
100
  }
100
101
  }
@@ -102,186 +103,186 @@ class yt {
102
103
  return e(this, L);
103
104
  }
104
105
  get previousPathname() {
105
- return e(this, O);
106
+ return e(this, _);
106
107
  }
107
108
  get currentState() {
108
- return e(this, _);
109
+ return e(this, q);
109
110
  }
110
111
  get links() {
111
112
  return e(this, E);
112
113
  }
113
114
  normalizePath(t) {
114
- return gt(t, e(this, R));
115
+ return Et(t, e(this, R), e(this, O));
115
116
  }
116
117
  prefetch(t) {
117
118
  return z(this, null, function* () {
118
- const s = this.normalizePath(t);
119
- return P(this, m, Q).call(this, s.pathname);
119
+ const i = this.normalizePath(t);
120
+ return P(this, m, U).call(this, i.pathname);
120
121
  });
121
122
  }
122
- navigate(l) {
123
- return z(this, arguments, function* (t, { historyAction: s = "push", state: i } = {}) {
124
- var Z;
123
+ navigate(d) {
124
+ return z(this, arguments, function* (t, { historyAction: i = "push", state: s } = {}) {
125
+ var $;
125
126
  if (e(this, v).length)
126
127
  return;
127
128
  const u = this.normalizePath(t);
128
- let { pathname: r, hash: g, parameters: f, leaf: b } = u;
129
- if (e(this, y) === r || e(this, L) === r)
129
+ let { pathname: o, hash: g, parameters: f, leaf: b } = u;
130
+ if (e(this, y) === o || e(this, L) === o)
130
131
  return;
131
- c(this, _, i), c(this, y, r);
132
- const C = e(this, k).has(r);
132
+ c(this, q, s), c(this, y, o);
133
+ const N = e(this, k).has(o);
133
134
  try {
134
135
  dt.add("__morph");
135
- let q = !0;
136
- if (V(document, "morphBeforeNavigation", {
136
+ let W = !0;
137
+ if (Y(document, "morphBeforeNavigation", {
137
138
  detail: {
138
- pathname: r,
139
- isCached: C,
140
- state: i
139
+ pathname: o,
140
+ isCached: N,
141
+ state: s
141
142
  }
142
143
  }), this.preprocessor)
143
144
  try {
144
145
  yield new Promise((a, A) => {
145
146
  var w;
146
- (w = this.preprocessor) == null || w.call(this, { pathname: r, resolve: a, reject: A, isCached: C, state: i });
147
+ (w = this.preprocessor) == null || w.call(this, { pathname: o, resolve: a, reject: A, isCached: N, state: s });
147
148
  });
148
149
  } catch (a) {
149
- a ? console.error(a) : console.log("Route change canceled"), q = !1;
150
+ a ? console.error(a) : console.log("Route change canceled"), W = !1;
150
151
  }
151
- if (!q || e(this, y) !== r)
152
+ if (!W || e(this, y) !== o)
152
153
  return;
153
- const $ = e(this, k).get(r) || (yield P(this, m, Q).call(this, r));
154
- if (e(this, y) !== r)
154
+ const tt = e(this, k).get(o) || (yield P(this, m, U).call(this, o));
155
+ if (e(this, y) !== o)
155
156
  return;
156
- const tt = Array.from(document.head.children), et = Array.from(
157
- $.head.cloneNode(!0).children
158
- ), st = P(this, m, ut).call(this, tt, et), mt = P(this, m, X).call(this, tt, st), W = P(this, m, X).call(this, et, st);
159
- W.forEach((a, A) => {
157
+ const et = Array.from(document.head.children), it = Array.from(
158
+ tt.head.cloneNode(!0).children
159
+ ), st = P(this, m, mt).call(this, et, it), ft = P(this, m, Z).call(this, et, st), K = P(this, m, Z).call(this, it, st);
160
+ K.forEach((a, A) => {
160
161
  if (a.tagName === "SCRIPT" && a.getAttribute("src")) {
161
162
  const w = document.createElement("script");
162
- w.type = "module", w.src = a.getAttribute("src"), W[A] = w;
163
+ w.type = "module", w.src = a.getAttribute("src"), K[A] = w;
163
164
  }
164
- }), W.forEach((a) => {
165
+ }), K.forEach((a) => {
165
166
  document.head.appendChild(a);
166
167
  });
167
- const G = W.filter(
168
+ const J = K.filter(
168
169
  (a) => !a.hasAttribute("data-no-waiting") && (a.tagName === "STYLE" || a.tagName === "SCRIPT" || a.tagName === "LINK") && a.getAttribute("rel") !== "canonical"
169
170
  );
170
- e(this, B) && G.length && (yield new Promise((a) => z(this, null, function* () {
171
+ e(this, B) && J.length && (yield new Promise((a) => z(this, null, function* () {
171
172
  let A = 0;
172
173
  try {
173
- for (var w = ht(G), it, S, nt; it = !(S = yield w.next()).done; it = !1) {
174
- const K = S.value;
175
- K.onload = () => {
176
- A++, A === G.length && a();
174
+ for (var w = ct(J), nt, C, at; nt = !(C = yield w.next()).done; nt = !1) {
175
+ const V = C.value;
176
+ V.onload = () => {
177
+ A++, A === J.length && a();
177
178
  };
178
179
  }
179
- } catch (S) {
180
- nt = [S];
180
+ } catch (C) {
181
+ at = [C];
181
182
  } finally {
182
183
  try {
183
- it && (S = w.return) && (yield S.call(w));
184
+ nt && (C = w.return) && (yield C.call(w));
184
185
  } finally {
185
- if (nt)
186
- throw nt[0];
186
+ if (at)
187
+ throw at[0];
187
188
  }
188
189
  }
189
- }))), mt.forEach((a) => {
190
+ }))), ft.forEach((a) => {
190
191
  a.hasAttribute("data-permanent") || a.remove();
191
- }), c(this, O, e(this, L)), c(this, L, r), ct(s, r, f, g);
192
- const ft = P(this, m, U).call(this, $.body.cloneNode(!0));
193
- e(this, v).forEach((a) => clearTimeout(a)), c(this, v, []), e(this, N).forEach((a, A) => {
194
- const w = ft[A], it = getComputedStyle(a).getPropertyValue("--morph-duration"), S = [...w.childNodes];
195
- if (it) {
196
- const nt = [...a.childNodes];
197
- nt.forEach((d) => {
198
- d instanceof HTMLElement && d.classList.add("old");
199
- }), S.forEach((d) => {
200
- d instanceof HTMLElement && d.classList.add("new");
201
- }), a.append(...S), setTimeout(() => {
202
- S.forEach((d) => {
203
- d instanceof HTMLElement && d.classList.add("in");
192
+ }), c(this, _, e(this, L)), c(this, L, o), lt(i, o, f, g);
193
+ const pt = P(this, m, X).call(this, tt.body.cloneNode(!0));
194
+ e(this, v).forEach((a) => clearTimeout(a)), c(this, v, []), e(this, S).forEach((a, A) => {
195
+ const w = pt[A], nt = getComputedStyle(a).getPropertyValue("--morph-duration"), C = [...w.childNodes];
196
+ if (nt) {
197
+ const at = [...a.childNodes];
198
+ at.forEach((l) => {
199
+ l instanceof HTMLElement && l.classList.add("old");
200
+ }), C.forEach((l) => {
201
+ l instanceof HTMLElement && l.classList.add("new");
202
+ }), a.append(...C), setTimeout(() => {
203
+ C.forEach((l) => {
204
+ l instanceof HTMLElement && l.classList.add("in");
204
205
  });
205
206
  }, 10);
206
- const K = {
207
+ const V = {
207
208
  element: a,
208
- pathname: r,
209
- isCached: C,
210
- state: i
209
+ pathname: o,
210
+ isCached: N,
211
+ state: s
211
212
  };
212
- V(document, "morphBeforeElementOut", {
213
- detail: K
213
+ Y(document, "morphBeforeElementOut", {
214
+ detail: V
214
215
  });
215
- const at = setTimeout(() => {
216
- nt.forEach((d) => d.remove()), S.forEach((d) => {
217
- d instanceof HTMLElement && (d.classList.remove("new", "in"), d.classList.add("current"));
218
- }), V(document, "morphAfterElementOut", {
219
- detail: K
220
- }), c(this, v, e(this, v).filter((d) => d !== at));
221
- }, (parseFloat(it) || 0) * 1e3 + 10);
222
- e(this, v).push(at);
216
+ const rt = setTimeout(() => {
217
+ at.forEach((l) => l.remove()), C.forEach((l) => {
218
+ l instanceof HTMLElement && (l.classList.remove("new", "in"), l.classList.add("current"));
219
+ }), Y(document, "morphAfterElementOut", {
220
+ detail: V
221
+ }), c(this, v, e(this, v).filter((l) => l !== rt));
222
+ }, (parseFloat(nt) || 0) * 1e3 + 10);
223
+ e(this, v).push(rt);
223
224
  } else
224
- a.innerHTML = "", a.append(...S);
225
- }), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", r), document.documentElement.setAttribute("data-current-leaf", b), (Z = this.postprocessor) == null || Z.call(this, { pathname: r, isCached: C, state: i }), V(document, "morphAfterNavigation", {
225
+ a.innerHTML = "", a.append(...C);
226
+ }), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", o), document.documentElement.setAttribute("data-current-leaf", b), ($ = this.postprocessor) == null || $.call(this, { pathname: o, isCached: N, state: s }), Y(document, "morphAfterNavigation", {
226
227
  detail: {
227
- pathname: r,
228
- isCached: C,
229
- state: i
228
+ pathname: o,
229
+ isCached: N,
230
+ state: s
230
231
  }
231
232
  }), dt.complete("__morph");
232
- } catch (q) {
233
- console.error(q);
233
+ } catch (W) {
234
+ console.error(W);
234
235
  }
235
236
  c(this, y, void 0);
236
237
  });
237
238
  }
238
239
  addLink(t) {
239
- e(this, E).push(new lt(t, this));
240
+ e(this, E).push(new ut(t, this));
240
241
  }
241
242
  addLinks(t) {
242
- t.forEach((s) => {
243
- this.addLink(s);
243
+ t.forEach((i) => {
244
+ this.addLink(i);
244
245
  });
245
246
  }
246
247
  removeLink(t) {
247
- c(this, E, e(this, E).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
248
+ c(this, E, e(this, E).filter((i) => i.element === t ? (i.destroy(), !1) : !0));
248
249
  }
249
250
  findLinks() {
250
251
  const t = [
251
252
  ...document.documentElement.querySelectorAll("a")
252
253
  ].filter(
253
- (s) => {
254
- var i;
255
- return ((i = s.getAttribute("href")) == null ? void 0 : i.startsWith("/")) && !s.hasAttribute("download") && !s.hasAttribute("data-morph-skip") && !s.closest("[data-morph-skip]");
254
+ (i) => {
255
+ var s;
256
+ return ((s = i.getAttribute("href")) == null ? void 0 : s.startsWith("/")) && !i.hasAttribute("download") && !i.hasAttribute("data-morph-skip") && !i.closest("[data-morph-skip]");
256
257
  }
257
258
  );
258
- e(this, E).forEach((s) => s.destroy()), c(this, E, t.map((s) => new lt(s, this)));
259
+ e(this, E).forEach((i) => i.destroy()), c(this, E, t.map((i) => new ut(i, this)));
259
260
  }
260
261
  }
261
- R = new WeakMap(), B = new WeakMap(), F = new WeakMap(), N = new WeakMap(), E = new WeakMap(), Y = new WeakMap(), k = new WeakMap(), y = new WeakMap(), L = new WeakMap(), O = new WeakMap(), _ = new WeakMap(), v = new WeakMap(), m = new WeakSet(), Q = function(t) {
262
+ R = new WeakMap(), B = new WeakMap(), F = new WeakMap(), O = new WeakMap(), S = new WeakMap(), E = new WeakMap(), j = new WeakMap(), k = new WeakMap(), y = new WeakMap(), L = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), v = new WeakMap(), m = new WeakSet(), U = function(t) {
262
263
  return z(this, null, function* () {
263
- const s = e(this, k).get(t);
264
- if (s)
265
- return s;
266
- const l = yield (yield fetch(t)).text(), u = e(this, Y).parseFromString(l, "text/html");
264
+ const i = e(this, k).get(t);
265
+ if (i)
266
+ return i;
267
+ const d = yield (yield fetch(t)).text(), u = e(this, j).parseFromString(d, "text/html");
267
268
  return e(this, F) && e(this, k).set(t, u), u;
268
269
  });
269
- }, U = function(t) {
270
- const s = [...t.querySelectorAll("[data-morph]")];
271
- return s.length ? s : [t];
272
- }, ut = function(t, s) {
270
+ }, X = function(t) {
271
+ const i = [...t.querySelectorAll("[data-morph]")];
272
+ return i.length ? i : [t];
273
+ }, mt = function(t, i) {
273
274
  return t.filter(
274
- (i) => s.find(
275
- (l) => l.outerHTML === i.outerHTML
275
+ (s) => i.find(
276
+ (d) => d.outerHTML === s.outerHTML
276
277
  )
277
278
  );
278
- }, X = function(t, s) {
279
+ }, Z = function(t, i) {
279
280
  return t.filter(
280
- (i) => !s.find(
281
- (l) => l.outerHTML === i.outerHTML
281
+ (s) => !i.find(
282
+ (d) => d.outerHTML === s.outerHTML
282
283
  )
283
284
  );
284
- }, j = new WeakMap();
285
+ }, G = new WeakMap();
285
286
  export {
286
- yt as Morph
287
+ bt as Morph
287
288
  };
@@ -1 +1 @@
1
- "use strict";var F=n=>{throw TypeError(n)};var W=(n,c,t)=>c.has(n)||F("Cannot "+t);var e=(n,c,t)=>(W(n,c,"read from private field"),t?t.call(n):c.get(n)),s=(n,c,t)=>c.has(n)?F("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(n):c.set(n,t),i=(n,c,t,h)=>(W(n,c,"write to private field"),h?h.call(n,t):c.set(n,t),t),v=(n,c,t)=>(W(n,c,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../css-property/index.cjs"),X=require("../Store-C2J4Q87x.cjs"),I=require("../events-KVanG9sR.cjs"),Y=require("../function-MthRj-GJ.cjs"),Z=require("../style-At6aDoqG.cjs"),G=require("../url-BiHPIsKq.cjs"),J=require("../window-resizer/index.cjs"),ee=require("../browser-CpzFX2xg.cjs");var C,d,O,S,u,m,p,g,f,y,b,w,l,K,T,N,A,B,k,_,R,x,D;const a=class a extends HTMLElement{constructor(){super(...arguments);s(this,l);s(this,C);s(this,d);s(this,O);s(this,S);s(this,u);s(this,m);s(this,p);s(this,g);s(this,f);s(this,y);s(this,b);s(this,w);s(this,T);s(this,A);s(this,k);s(this,_);s(this,R);s(this,x);this.urlValue="",i(this,C,-1),i(this,d,new X.Store(!1)),i(this,u,new E.CSSProperty(this,"--history",!1)),i(this,m,new E.CSSProperty(this,"--restore",!1)),i(this,p,new E.CSSProperty(this,"--dominance",0)),i(this,g,new E.CSSProperty(this,"--group","")),i(this,f,new E.CSSProperty(this,"--click-outside",!1)),i(this,y,new E.CSSProperty(this,"--escape",!1)),i(this,b,!1),this.open=t=>{if(e(this,d).current)return;i(this,w,t==null?void 0:t.trigger),e(this,p).current&&(a.__opened=a.__opened.filter(o=>o!==this&&v(this,l,D).call(this,this,o)?(o.close(),!1):!0)),a.__opened.push(this),i(this,C,a.__opened.length-1),clearTimeout(e(this,O)),this.classList.remove("closing"),this.classList.add("triggered"),this.style.display="block",I.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,w)}}),e(this,u).current&&e(this,b)&&history.pushState(history.state,"",e(this,l,K)),e(this,d).current=!0;const h=()=>{addEventListener("click",e(this,T)),addEventListener("keydown",e(this,A)),e(this,x).call(this),this.style.opacity="1",this.classList.add("opened"),I.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,w)}}),i(this,S,void 0),this.setAttribute("aria-hidden","false")};t!=null&&t.skipTransition?h():i(this,S,setTimeout(h,10))},this.close=()=>{e(this,d).current&&(removeEventListener("click",e(this,T)),removeEventListener("keydown",e(this,A)),e(this,d).current=!1,a.__opened=a.__opened.filter(t=>t===this?!1:!e(t,S)&&v(this,l,D).call(this,this,t)?(t.close(),!1):!0),v(this,l,N).call(this),this.classList.remove("opened"),this.classList.add("closing"),this.setAttribute("aria-hidden","true"),this.style.opacity="0",I.dispatchEvent(this,"popoverClosing",{custom:!0}),setTimeout(()=>{this.classList.remove("triggered"),this.classList.remove("closing"),this.style.display="none",I.dispatchEvent(this,"popoverClosed",{custom:!0})},Z.getElementTransitionDurationMS(this)+10))},i(this,T,t=>{e(this,f).current&&v(this,l,B).call(this,()=>{var U;const h=t.composedPath();if(h.find(j=>j instanceof HTMLElement&&j.hasAttribute("data-popover-content")))return;const o=h[0],z=o instanceof Node&&(this.contains(o)||((U=this.shadowRoot)==null?void 0:U.contains(o))),P=o instanceof HTMLElement&&o.hasAttribute("data-outside");(!z||P)&&this.close()})}),i(this,A,t=>{e(this,y).current&&v(this,l,B).call(this,()=>{t.code==="Escape"&&this.close()})}),i(this,k,()=>{i(this,b,!1),e(this,d).current&&e(this,u).current&&!location.search.includes(this.id)?this.close():!e(this,d).current&&e(this,u).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),i(this,b,!0)}),i(this,_,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,R).call(this)}),i(this,R,Y.debounce(()=>{e(this,x).call(this)},10)),i(this,x,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")})}get history(){return e(this,u)}get restore(){return e(this,m)}get dominance(){return e(this,p)}get group(){return e(this,g)}get clickOutside(){return e(this,f)}get escape(){return e(this,y)}get opened(){return e(this,d)}get lastTrigger(){return e(this,w)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,d).current&&G.updateSearchParameter(this.id,t)}connectedCallback(){e(this,u).observe(),e(this,m).observe(),e(this,p).observe(),e(this,g).observe(),e(this,f).observe(),e(this,y).observe(),this.style.opacity="0",this.style.display="none",this.setAttribute("role","dialog"),this.setAttribute("aria-hidden","true"),this.classList.remove("closing"),this.classList.remove("closed"),this.classList.remove("triggered"),this.classList.remove("opened"),addEventListener("popstate",e(this,k)),setTimeout(()=>{e(this,m).current?(this.urlValue=G.parseSearchParameters(location.search)[this.id],e(this,k).call(this)):(v(this,l,N).call(this),i(this,b,!0))},0),J.windowResizer.subscribe(e(this,_))}disconnectedCallback(){J.windowResizer.unsubscribe(e(this,_)),e(this,u).close(),e(this,m).close(),e(this,p).close(),e(this,g).close(),e(this,f).close(),e(this,y).close(),this.style.opacity="",this.style.display="",this.removeAttribute("role"),this.removeAttribute("aria-hidden"),a.__opened=a.__opened.filter(t=>t!==this),clearTimeout(e(this,O)),clearTimeout(e(this,S)),removeEventListener("popstate",e(this,k)),removeEventListener("click",e(this,T)),removeEventListener("keydown",e(this,A)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),v(this,l,N).call(this)}};C=new WeakMap,d=new WeakMap,O=new WeakMap,S=new WeakMap,u=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakMap,l=new WeakSet,K=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},T=new WeakMap,N=function(){if(e(this,u).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},A=new WeakMap,B=function(t){(a.__opened[e(this,C)-1]||a.__opened.length===1||a.__opened.filter(h=>h!==this).every(h=>e(this,p).current>h.dominance.current))&&t()},k=new WeakMap,_=new WeakMap,R=new WeakMap,x=new WeakMap,D=function(t,h){if(e(t,g).current===e(h,g).current&&t.dominance.current>=h.dominance.current)return!0},a.__opened=[];let q=a;customElements.get("e-popover")||customElements.define("e-popover",q);var r,L,V,M,$,H;class Q extends HTMLElement{constructor(){super();s(this,r);s(this,L,new E.CSSProperty(this,"--type","open"));s(this,V,()=>{this.classList.add("triggered")});s(this,M,()=>{this.classList.add("opened"),this.setAttribute("aria-expanded","true")});s(this,$,()=>{this.classList.remove("opened")});s(this,H,()=>{this.classList.remove("triggered"),this.setAttribute("aria-expanded","false")});ee.isBrowser&&(this.addEventListener("click",()=>{if(e(this,r)){const t=e(this,L).current;t==="open"||t==="toggle"&&!e(this,r).opened.current?e(this,r).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,r).opened.current)&&e(this,r).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&t.currentTarget.click()}))}get type(){return e(this,L)}get popoverElement(){return e(this,r)}connectedCallback(){var h;e(this,L).subscribe(o=>{e(this,r)instanceof q&&(o.current!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,r).opened.current?"true":"false"),this.setAttribute("aria-controls",e(this,r).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");if(t){let o=null;if(t==="parent"){const z=this.closest("[popover-target]");if(z)o=z;else{const P=this.getRootNode();P instanceof ShadowRoot?o=P.host.closest("[popover-target]"):P instanceof HTMLElement&&(o=P.closest("[popover-target]"))}}else t==="sibling"?o=(h=this.parentElement)==null?void 0:h.querySelector("[popover-target]"):o=document.querySelector(`#${t}`)||this.getRootNode().querySelector(`#${t}`);o instanceof HTMLElement?(i(this,r,o),e(this,r).addEventListener("popoverTriggered",e(this,V)),e(this,r).addEventListener("popoverOpened",e(this,M)),e(this,r).addEventListener("popoverClosing",e(this,$)),e(this,r).addEventListener("popoverClosed",e(this,H))):console.warn(this,`target ${t} not found`)}this.isConnected&&e(this,L).observe()}disconnectedCallback(){e(this,L).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),e(this,r)&&(e(this,r).removeEventListener("popoverTriggered",e(this,V)),e(this,r).removeEventListener("popoverOpened",e(this,M)),e(this,r).removeEventListener("popoverClosing",e(this,$)),e(this,r).removeEventListener("popoverClosed",e(this,H)))}}r=new WeakMap,L=new WeakMap,V=new WeakMap,M=new WeakMap,$=new WeakMap,H=new WeakMap;customElements.get("e-popover-button")||customElements.define("e-popover-button",Q);exports.PopoverButtonElement=Q;exports.PopoverElement=q;
1
+ "use strict";var F=n=>{throw TypeError(n)};var W=(n,c,t)=>c.has(n)||F("Cannot "+t);var e=(n,c,t)=>(W(n,c,"read from private field"),t?t.call(n):c.get(n)),s=(n,c,t)=>c.has(n)?F("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(n):c.set(n,t),i=(n,c,t,h)=>(W(n,c,"write to private field"),h?h.call(n,t):c.set(n,t),t),v=(n,c,t)=>(W(n,c,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../css-property/index.cjs"),X=require("../Store-C2J4Q87x.cjs"),I=require("../events-KVanG9sR.cjs"),Y=require("../function-MthRj-GJ.cjs"),Z=require("../style-At6aDoqG.cjs"),G=require("../url-CHQeS8b5.cjs"),J=require("../window-resizer/index.cjs"),ee=require("../browser-CpzFX2xg.cjs");var C,d,O,S,u,m,p,g,f,y,b,w,l,K,T,N,A,B,k,_,R,x,D;const a=class a extends HTMLElement{constructor(){super(...arguments);s(this,l);s(this,C);s(this,d);s(this,O);s(this,S);s(this,u);s(this,m);s(this,p);s(this,g);s(this,f);s(this,y);s(this,b);s(this,w);s(this,T);s(this,A);s(this,k);s(this,_);s(this,R);s(this,x);this.urlValue="",i(this,C,-1),i(this,d,new X.Store(!1)),i(this,u,new E.CSSProperty(this,"--history",!1)),i(this,m,new E.CSSProperty(this,"--restore",!1)),i(this,p,new E.CSSProperty(this,"--dominance",0)),i(this,g,new E.CSSProperty(this,"--group","")),i(this,f,new E.CSSProperty(this,"--click-outside",!1)),i(this,y,new E.CSSProperty(this,"--escape",!1)),i(this,b,!1),this.open=t=>{if(e(this,d).current)return;i(this,w,t==null?void 0:t.trigger),e(this,p).current&&(a.__opened=a.__opened.filter(o=>o!==this&&v(this,l,D).call(this,this,o)?(o.close(),!1):!0)),a.__opened.push(this),i(this,C,a.__opened.length-1),clearTimeout(e(this,O)),this.classList.remove("closing"),this.classList.add("triggered"),this.style.display="block",I.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,w)}}),e(this,u).current&&e(this,b)&&history.pushState(history.state,"",e(this,l,K)),e(this,d).current=!0;const h=()=>{addEventListener("click",e(this,T)),addEventListener("keydown",e(this,A)),e(this,x).call(this),this.style.opacity="1",this.classList.add("opened"),I.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,w)}}),i(this,S,void 0),this.setAttribute("aria-hidden","false")};t!=null&&t.skipTransition?h():i(this,S,setTimeout(h,10))},this.close=()=>{e(this,d).current&&(removeEventListener("click",e(this,T)),removeEventListener("keydown",e(this,A)),e(this,d).current=!1,a.__opened=a.__opened.filter(t=>t===this?!1:!e(t,S)&&v(this,l,D).call(this,this,t)?(t.close(),!1):!0),v(this,l,N).call(this),this.classList.remove("opened"),this.classList.add("closing"),this.setAttribute("aria-hidden","true"),this.style.opacity="0",I.dispatchEvent(this,"popoverClosing",{custom:!0}),setTimeout(()=>{this.classList.remove("triggered"),this.classList.remove("closing"),this.style.display="none",I.dispatchEvent(this,"popoverClosed",{custom:!0})},Z.getElementTransitionDurationMS(this)+10))},i(this,T,t=>{e(this,f).current&&v(this,l,B).call(this,()=>{var U;const h=t.composedPath();if(h.find(j=>j instanceof HTMLElement&&j.hasAttribute("data-popover-content")))return;const o=h[0],z=o instanceof Node&&(this.contains(o)||((U=this.shadowRoot)==null?void 0:U.contains(o))),P=o instanceof HTMLElement&&o.hasAttribute("data-outside");(!z||P)&&this.close()})}),i(this,A,t=>{e(this,y).current&&v(this,l,B).call(this,()=>{t.code==="Escape"&&this.close()})}),i(this,k,()=>{i(this,b,!1),e(this,d).current&&e(this,u).current&&!location.search.includes(this.id)?this.close():!e(this,d).current&&e(this,u).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),i(this,b,!0)}),i(this,_,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,R).call(this)}),i(this,R,Y.debounce(()=>{e(this,x).call(this)},10)),i(this,x,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")})}get history(){return e(this,u)}get restore(){return e(this,m)}get dominance(){return e(this,p)}get group(){return e(this,g)}get clickOutside(){return e(this,f)}get escape(){return e(this,y)}get opened(){return e(this,d)}get lastTrigger(){return e(this,w)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,d).current&&G.updateSearchParameter(this.id,t)}connectedCallback(){e(this,u).observe(),e(this,m).observe(),e(this,p).observe(),e(this,g).observe(),e(this,f).observe(),e(this,y).observe(),this.style.opacity="0",this.style.display="none",this.setAttribute("role","dialog"),this.setAttribute("aria-hidden","true"),this.classList.remove("closing"),this.classList.remove("closed"),this.classList.remove("triggered"),this.classList.remove("opened"),addEventListener("popstate",e(this,k)),setTimeout(()=>{e(this,m).current?(this.urlValue=G.parseSearchParameters(location.search)[this.id],e(this,k).call(this)):(v(this,l,N).call(this),i(this,b,!0))},0),J.windowResizer.subscribe(e(this,_))}disconnectedCallback(){J.windowResizer.unsubscribe(e(this,_)),e(this,u).close(),e(this,m).close(),e(this,p).close(),e(this,g).close(),e(this,f).close(),e(this,y).close(),this.style.opacity="",this.style.display="",this.removeAttribute("role"),this.removeAttribute("aria-hidden"),a.__opened=a.__opened.filter(t=>t!==this),clearTimeout(e(this,O)),clearTimeout(e(this,S)),removeEventListener("popstate",e(this,k)),removeEventListener("click",e(this,T)),removeEventListener("keydown",e(this,A)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),v(this,l,N).call(this)}};C=new WeakMap,d=new WeakMap,O=new WeakMap,S=new WeakMap,u=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakMap,l=new WeakSet,K=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},T=new WeakMap,N=function(){if(e(this,u).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},A=new WeakMap,B=function(t){(a.__opened[e(this,C)-1]||a.__opened.length===1||a.__opened.filter(h=>h!==this).every(h=>e(this,p).current>h.dominance.current))&&t()},k=new WeakMap,_=new WeakMap,R=new WeakMap,x=new WeakMap,D=function(t,h){if(e(t,g).current===e(h,g).current&&t.dominance.current>=h.dominance.current)return!0},a.__opened=[];let q=a;customElements.get("e-popover")||customElements.define("e-popover",q);var r,L,V,M,$,H;class Q extends HTMLElement{constructor(){super();s(this,r);s(this,L,new E.CSSProperty(this,"--type","open"));s(this,V,()=>{this.classList.add("triggered")});s(this,M,()=>{this.classList.add("opened"),this.setAttribute("aria-expanded","true")});s(this,$,()=>{this.classList.remove("opened")});s(this,H,()=>{this.classList.remove("triggered"),this.setAttribute("aria-expanded","false")});ee.isBrowser&&(this.addEventListener("click",()=>{if(e(this,r)){const t=e(this,L).current;t==="open"||t==="toggle"&&!e(this,r).opened.current?e(this,r).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,r).opened.current)&&e(this,r).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&t.currentTarget.click()}))}get type(){return e(this,L)}get popoverElement(){return e(this,r)}connectedCallback(){var h;e(this,L).subscribe(o=>{e(this,r)instanceof q&&(o.current!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,r).opened.current?"true":"false"),this.setAttribute("aria-controls",e(this,r).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");if(t){let o=null;if(t==="parent"){const z=this.closest("[popover-target]");if(z)o=z;else{const P=this.getRootNode();P instanceof ShadowRoot?o=P.host.closest("[popover-target]"):P instanceof HTMLElement&&(o=P.closest("[popover-target]"))}}else t==="sibling"?o=(h=this.parentElement)==null?void 0:h.querySelector("[popover-target]"):o=document.querySelector(`#${t}`)||this.getRootNode().querySelector(`#${t}`);o instanceof HTMLElement?(i(this,r,o),e(this,r).addEventListener("popoverTriggered",e(this,V)),e(this,r).addEventListener("popoverOpened",e(this,M)),e(this,r).addEventListener("popoverClosing",e(this,$)),e(this,r).addEventListener("popoverClosed",e(this,H))):console.warn(this,`target ${t} not found`)}this.isConnected&&e(this,L).observe()}disconnectedCallback(){e(this,L).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),e(this,r)&&(e(this,r).removeEventListener("popoverTriggered",e(this,V)),e(this,r).removeEventListener("popoverOpened",e(this,M)),e(this,r).removeEventListener("popoverClosing",e(this,$)),e(this,r).removeEventListener("popoverClosed",e(this,H)))}}r=new WeakMap,L=new WeakMap,V=new WeakMap,M=new WeakMap,$=new WeakMap,H=new WeakMap;customElements.get("e-popover-button")||customElements.define("e-popover-button",Q);exports.PopoverButtonElement=Q;exports.PopoverElement=q;
@@ -8,7 +8,7 @@ import { S as K } from "../Store-Cm3LPXlx.js";
8
8
  import { d as z } from "../events-CsVF98U6.js";
9
9
  import { d as Q } from "../function-C10DGppn.js";
10
10
  import { g as X } from "../style-j2TwriJ_.js";
11
- import { u as Y, p as Z } from "../url-B5eH5z6S.js";
11
+ import { u as Y, p as Z } from "../url-DqQuzXwT.js";
12
12
  import { windowResizer as G } from "../window-resizer/index.js";
13
13
  import { i as ee } from "../browser-0zX67oeU.js";
14
14
  var x, d, V, T, p, v, u, g, f, y, L, w, l, J, A, N, k, B, S, _, O, P, D;
@@ -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-BiHPIsKq.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-CHQeS8b5.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-B5eH5z6S.js";
27
+ import { n as rt, c as ot, s as ct } from "../url-DqQuzXwT.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";function h(t,r="",c=!1){r=r.endsWith("/")?r.slice(0,-1):r,t=t.replace(r,""),t.startsWith("/")&&(t=t.slice(1));const e=t.split("#"),n=e[0].split("?");let s=n[0].startsWith("/")?n[0]:"/"+n[0];c?s=!s.endsWith("/")&&s!=="/"?s+"/":s:s=s.endsWith("/")&&s!=="/"?s.slice(0,-1):s;const i=r+s,a=n==null?void 0:n[1],o=e==null?void 0:e[1];return{leaf:s,pathname:i,parameters:a,hash:o}}function p(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function f(t,r,c,e){const n=c||location.search,s=e?e.startsWith("#")?e:"#"+e:"",i=n?n.startsWith("?")?n:"?"+n:"",a=`${r}${s}${i}`;t==="push"?history.pushState(a,"",a):t==="replace"&&history.replaceState(a,"",a)}function l(t){const r=new URLSearchParams(t),c={};for(const[e,n]of r)c[e]=n;return c}function m(t,r){const c=new URL(location.href),e=(r==null?void 0:r.toString())||"";c.searchParams.set(t,e),history.replaceState(history.state,"",c.href)}exports.changeHistory=f;exports.normalizeBase=p;exports.parseSearchParameters=l;exports.splitPath=h;exports.updateSearchParameter=m;
@@ -0,0 +1,37 @@
1
+ function h(t, s = "", c = !1) {
2
+ s = s.endsWith("/") ? s.slice(0, -1) : s, t = t.replace(s, ""), t.startsWith("/") && (t = t.slice(1));
3
+ const n = t.split("#"), e = n[0].split("?");
4
+ let r = e[0].startsWith("/") ? e[0] : "/" + e[0];
5
+ c ? r = !r.endsWith("/") && r !== "/" ? r + "/" : r : r = r.endsWith("/") && r !== "/" ? r.slice(0, -1) : r;
6
+ const i = s + r, o = e == null ? void 0 : e[1], a = n == null ? void 0 : n[1];
7
+ return {
8
+ leaf: r,
9
+ pathname: i,
10
+ parameters: o,
11
+ hash: a
12
+ };
13
+ }
14
+ function f(t = "/") {
15
+ return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
16
+ }
17
+ function p(t, s, c, n) {
18
+ const e = c || location.search, r = n ? n.startsWith("#") ? n : "#" + n : "", i = e ? e.startsWith("?") ? e : "?" + e : "", o = `${s}${r}${i}`;
19
+ t === "push" ? history.pushState(o, "", o) : t === "replace" && history.replaceState(o, "", o);
20
+ }
21
+ function l(t) {
22
+ const s = new URLSearchParams(t), c = {};
23
+ for (const [n, e] of s)
24
+ c[n] = e;
25
+ return c;
26
+ }
27
+ function W(t, s) {
28
+ const c = new URL(location.href), n = (s == null ? void 0 : s.toString()) || "";
29
+ c.searchParams.set(t, n), history.replaceState(history.state, "", c.href);
30
+ }
31
+ export {
32
+ p as c,
33
+ f as n,
34
+ l as p,
35
+ h as s,
36
+ W as u
37
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),I=require("../browser-CpzFX2xg.cjs"),f=require("../canvas-CU5Xjahf.cjs"),h=require("../coordinates-D8Np3cPD.cjs"),u=require("../dom-JBOkFLTh.cjs"),s=require("../easings-GegIwET5.cjs"),v=require("../events-KVanG9sR.cjs"),y=require("../file-DSpfWdd9.cjs"),C=require("../function-MthRj-GJ.cjs"),w=require("../gestures-DHLrn6Q8.cjs"),T=require("../jss-GJLvaNfT.cjs"),d=require("../layout-Ctc2p3uz.cjs"),i=require("../math-GDWEqu7y.cjs"),p=require("../polyfills-BANSrI_m.cjs"),c=require("../object-CCiXnER2.cjs"),l=require("../string-DhgS_iFl.cjs"),O=require("../style-At6aDoqG.cjs"),m=require("../url-BiHPIsKq.cjs");function q(t,e,...o){return[...t.slice(0,e),...o,...t.slice(e)]}function Q(t,e){const o=t.length;e=e%o;const n=new Array(o);for(let a=0;a<o;a++){const r=(a+e)%o;n[r]=t[a]}return n}function B(t,e=2){if(!+t)return"0 Bytes";const o=1024,n=e<0?0:e,a=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],r=Math.floor(Math.log(t)/Math.log(o));return`${parseFloat((t/Math.pow(o,r)).toFixed(n))} ${a[r]}`}function D(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(e=>{console.error("Failed to copy text to clipboard:",e)});else{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.top="0",e.style.left="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(o){console.error("Failed to copy text to clipboard:",o)}document.body.removeChild(e)}}function A(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function R(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function S(t,e){const o=t.style.getPropertyValue(e);if(o){const n=o.toString();return n.startsWith("var")?S(t,n.slice(4,-1)):n}}function N(...t){const e={};return Array.from(document.styleSheets).forEach(o=>{Array.from(o.cssRules).forEach(n=>{n instanceof CSSStyleRule&&n.selectorText===":root"&&t.forEach(a=>{const r=S(n,a);r&&(e[a]=r)})})}),t.forEach(o=>{e[o]||console.warn(`variable named ${o} not found`)}),e}function z(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function M(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function V(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}function j(t,{behaviour:e="instant",offset:o=0,center:n=!1}={}){var r;const a=u.getElement(t);if(a){const g=u.findScrollParentElement(a),E=d.getCumulativeOffsetTop(a),x=(typeof o=="number"?o:((r=u.getElement(o))==null?void 0:r.offsetHeight)||0)*-1,P=n?innerHeight/2*-1+a.offsetHeight/2:0;g==null||g.scroll({top:E+x+P,behavior:e})}}function U(t,e){if(t){const n=t.content.cloneNode(!0).firstElementChild;return n&&(e==null||e(n)),n}return null}exports.parseAttribute=b.parseAttribute;exports.parseAttributeValue=b.parseAttributeValue;exports.isBrowser=I.isBrowser;exports.contain=f.contain;exports.cover=f.cover;exports.fixPosition=f.fixPosition;exports.measureText=f.measureText;exports.getPointerPosition=h.getPointerPosition;exports.normalize=h.normalize;exports.screenToCartesian=h.screenToCartesian;exports.findParentElement=u.findParentElement;exports.findScrollParentElement=u.findScrollParentElement;exports.getAllParentElements=u.getAllParentElements;exports.getElement=u.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=v.dispatchEvent;exports.createJSONAndSave=y.createJSONAndSave;exports.downloadURI=y.downloadURI;exports.debounce=C.debounce;exports.throttle=C.throttle;exports.setupDrag=w.setupDrag;exports.createStylesheet=T.createStylesheet;exports.styleToString=T.styleToString;exports.getCumulativeOffsetLeft=d.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=d.getCumulativeOffsetTop;exports.getCumulativePosition=d.getCumulativePosition;exports.getStickyOffset=d.getStickyOffset;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.loopNumber=p.loopNumber;exports.nullishCoalescing=p.nullishCoalescing;exports.preciseNumber=p.preciseNumber;exports.roundNumberTo=p.roundNumberTo;exports.toStep=p.toStep;exports.cloneDeep=c.cloneDeep;exports.compareObjects=c.compareObjects;exports.isESClass=c.isESClass;exports.isNullish=c.isNullish;exports.isObject=c.isObject;exports.mergeDeep=c.mergeDeep;exports.mixin=c.mixin;exports.omit=c.omit;exports.pick=c.pick;exports.camelToKebab=l.camelToKebab;exports.capitalize=l.capitalize;exports.generateId=l.generateId;exports.isUppercase=l.isUppercase;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.changeHistory=m.changeHistory;exports.normalizeBase=m.normalizeBase;exports.parseSearchParameters=m.parseSearchParameters;exports.splitPath=m.splitPath;exports.updateSearchParameter=m.updateSearchParameter;exports.cloneTemplateContent=U;exports.copyTextToClipboard=D;exports.decode=M;exports.dotCircleCollision=R;exports.dotRectCollision=A;exports.encode=z;exports.formatBytes=B;exports.getRootVariables=N;exports.insert=q;exports.scrollToElement=j;exports.shiftArray=Q;exports.wait=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),I=require("../browser-CpzFX2xg.cjs"),f=require("../canvas-CU5Xjahf.cjs"),h=require("../coordinates-D8Np3cPD.cjs"),u=require("../dom-JBOkFLTh.cjs"),s=require("../easings-GegIwET5.cjs"),v=require("../events-KVanG9sR.cjs"),y=require("../file-DSpfWdd9.cjs"),C=require("../function-MthRj-GJ.cjs"),w=require("../gestures-DHLrn6Q8.cjs"),T=require("../jss-GJLvaNfT.cjs"),d=require("../layout-Ctc2p3uz.cjs"),i=require("../math-GDWEqu7y.cjs"),p=require("../polyfills-BANSrI_m.cjs"),c=require("../object-CCiXnER2.cjs"),l=require("../string-DhgS_iFl.cjs"),O=require("../style-At6aDoqG.cjs"),m=require("../url-CHQeS8b5.cjs");function q(t,e,...o){return[...t.slice(0,e),...o,...t.slice(e)]}function Q(t,e){const o=t.length;e=e%o;const n=new Array(o);for(let a=0;a<o;a++){const r=(a+e)%o;n[r]=t[a]}return n}function B(t,e=2){if(!+t)return"0 Bytes";const o=1024,n=e<0?0:e,a=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],r=Math.floor(Math.log(t)/Math.log(o));return`${parseFloat((t/Math.pow(o,r)).toFixed(n))} ${a[r]}`}function D(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(e=>{console.error("Failed to copy text to clipboard:",e)});else{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.top="0",e.style.left="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(o){console.error("Failed to copy text to clipboard:",o)}document.body.removeChild(e)}}function A(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function R(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function S(t,e){const o=t.style.getPropertyValue(e);if(o){const n=o.toString();return n.startsWith("var")?S(t,n.slice(4,-1)):n}}function N(...t){const e={};return Array.from(document.styleSheets).forEach(o=>{Array.from(o.cssRules).forEach(n=>{n instanceof CSSStyleRule&&n.selectorText===":root"&&t.forEach(a=>{const r=S(n,a);r&&(e[a]=r)})})}),t.forEach(o=>{e[o]||console.warn(`variable named ${o} not found`)}),e}function z(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function M(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function V(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}function j(t,{behaviour:e="instant",offset:o=0,center:n=!1}={}){var r;const a=u.getElement(t);if(a){const g=u.findScrollParentElement(a),E=d.getCumulativeOffsetTop(a),x=(typeof o=="number"?o:((r=u.getElement(o))==null?void 0:r.offsetHeight)||0)*-1,P=n?innerHeight/2*-1+a.offsetHeight/2:0;g==null||g.scroll({top:E+x+P,behavior:e})}}function U(t,e){if(t){const n=t.content.cloneNode(!0).firstElementChild;return n&&(e==null||e(n)),n}return null}exports.parseAttribute=b.parseAttribute;exports.parseAttributeValue=b.parseAttributeValue;exports.isBrowser=I.isBrowser;exports.contain=f.contain;exports.cover=f.cover;exports.fixPosition=f.fixPosition;exports.measureText=f.measureText;exports.getPointerPosition=h.getPointerPosition;exports.normalize=h.normalize;exports.screenToCartesian=h.screenToCartesian;exports.findParentElement=u.findParentElement;exports.findScrollParentElement=u.findScrollParentElement;exports.getAllParentElements=u.getAllParentElements;exports.getElement=u.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=v.dispatchEvent;exports.createJSONAndSave=y.createJSONAndSave;exports.downloadURI=y.downloadURI;exports.debounce=C.debounce;exports.throttle=C.throttle;exports.setupDrag=w.setupDrag;exports.createStylesheet=T.createStylesheet;exports.styleToString=T.styleToString;exports.getCumulativeOffsetLeft=d.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=d.getCumulativeOffsetTop;exports.getCumulativePosition=d.getCumulativePosition;exports.getStickyOffset=d.getStickyOffset;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.loopNumber=p.loopNumber;exports.nullishCoalescing=p.nullishCoalescing;exports.preciseNumber=p.preciseNumber;exports.roundNumberTo=p.roundNumberTo;exports.toStep=p.toStep;exports.cloneDeep=c.cloneDeep;exports.compareObjects=c.compareObjects;exports.isESClass=c.isESClass;exports.isNullish=c.isNullish;exports.isObject=c.isObject;exports.mergeDeep=c.mergeDeep;exports.mixin=c.mixin;exports.omit=c.omit;exports.pick=c.pick;exports.camelToKebab=l.camelToKebab;exports.capitalize=l.capitalize;exports.generateId=l.generateId;exports.isUppercase=l.isUppercase;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.changeHistory=m.changeHistory;exports.normalizeBase=m.normalizeBase;exports.parseSearchParameters=m.parseSearchParameters;exports.splitPath=m.splitPath;exports.updateSearchParameter=m.updateSearchParameter;exports.cloneTemplateContent=U;exports.copyTextToClipboard=D;exports.decode=M;exports.dotCircleCollision=R;exports.dotRectCollision=A;exports.encode=z;exports.formatBytes=B;exports.getRootVariables=N;exports.insert=q;exports.scrollToElement=j;exports.shiftArray=Q;exports.wait=V;
@@ -17,7 +17,7 @@ import { l as Fe, n as je, p as He, r as Ue, t as ke } from "../polyfills-CxfUK5
17
17
  import { c as qe, d as Ke, i as We, b as Ge, a as Je, m as Le, e as Ye, o as Ze, p as Xe } from "../object-D6MVWB4l.js";
18
18
  import { c as et, a as tt, g as ot, i as st, k as at, s as nt, t as rt, u as it } from "../string-f0Dnk0L1.js";
19
19
  import { g as lt, a as ut } from "../style-j2TwriJ_.js";
20
- import { c as pt, n as mt, p as dt, s as xt, u as ht } from "../url-B5eH5z6S.js";
20
+ import { c as pt, n as mt, p as dt, s as xt, u as ht } from "../url-DqQuzXwT.js";
21
21
  function h(t, e, ...o) {
22
22
  return [...t.slice(0, e), ...o, ...t.slice(e)];
23
23
  }
@@ -1,4 +1,4 @@
1
- export declare function splitPath(value: string, base?: string): {
1
+ export declare function splitPath(value: string, base?: string, trailingSlash?: boolean): {
2
2
  leaf: string;
3
3
  pathname: string;
4
4
  parameters: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.42.9",
3
+ "version": "0.42.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -1,37 +0,0 @@
1
- function a(t, r = "") {
2
- r = r.endsWith("/") ? r.slice(0, -1) : r, t = t.replace(r, ""), t.startsWith("/") && (t = t.slice(1));
3
- const c = t.split("#"), s = c[0].split("?");
4
- let n = s[0].startsWith("/") ? s[0] : "/" + s[0];
5
- n = n.endsWith("/") && n !== "/" ? n.slice(0, -1) : n;
6
- const o = r + n, i = s == null ? void 0 : s[1], e = c == null ? void 0 : c[1];
7
- return {
8
- leaf: n,
9
- pathname: o,
10
- parameters: i,
11
- hash: e
12
- };
13
- }
14
- function h(t = "/") {
15
- return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
16
- }
17
- function p(t, r, c, s) {
18
- const n = c || location.search, o = s ? s.startsWith("#") ? s : "#" + s : "", i = n ? n.startsWith("?") ? n : "?" + n : "", e = `${r}${o}${i}`;
19
- t === "push" ? history.pushState(e, "", e) : t === "replace" && history.replaceState(e, "", e);
20
- }
21
- function f(t) {
22
- const r = new URLSearchParams(t), c = {};
23
- for (const [s, n] of r)
24
- c[s] = n;
25
- return c;
26
- }
27
- function l(t, r) {
28
- const c = new URL(location.href), s = (r == null ? void 0 : r.toString()) || "";
29
- c.searchParams.set(t, s), history.replaceState(history.state, "", c.href);
30
- }
31
- export {
32
- p as c,
33
- h as n,
34
- f as p,
35
- a as s,
36
- l as u
37
- };
@@ -1 +0,0 @@
1
- "use strict";function o(t,s=""){s=s.endsWith("/")?s.slice(0,-1):s,t=t.replace(s,""),t.startsWith("/")&&(t=t.slice(1));const n=t.split("#"),r=n[0].split("?");let e=r[0].startsWith("/")?r[0]:"/"+r[0];e=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;const a=s+e,i=r==null?void 0:r[1],c=n==null?void 0:n[1];return{leaf:e,pathname:a,parameters:i,hash:c}}function h(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function p(t,s,n,r){const e=n||location.search,a=r?r.startsWith("#")?r:"#"+r:"",i=e?e.startsWith("?")?e:"?"+e:"",c=`${s}${a}${i}`;t==="push"?history.pushState(c,"",c):t==="replace"&&history.replaceState(c,"",c)}function f(t){const s=new URLSearchParams(t),n={};for(const[r,e]of s)n[r]=e;return n}function l(t,s){const n=new URL(location.href),r=(s==null?void 0:s.toString())||"";n.searchParams.set(t,r),history.replaceState(history.state,"",n.href)}exports.changeHistory=p;exports.normalizeBase=h;exports.parseSearchParameters=f;exports.splitPath=o;exports.updateSearchParameter=l;