aptechka 0.4.41 → 0.4.43

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 rt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var J=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var i=(n,t,e)=>(J(n,t,"read from private field"),e?e.call(n):t.get(n)),o=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)},c=(n,t,e,r)=>(J(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e);var p=(n,t,e)=>(J(n,t,"access private method"),e);var T=(n,t,e)=>new Promise((r,s)=>{var h=d=>{try{u(e.next(d))}catch(m){s(m)}},f=d=>{try{u(e.throw(d))}catch(m){s(m)}},u=d=>d.done?r(d.value):Promise.resolve(d.value).then(h,f);u((e=e.apply(n,t)).next())});var ot=(n,t,e)=>(t=n[rt("asyncIterator")])?t.call(n):(n=n[rt("iterator")](),t={},e=(r,s)=>(s=n[r])&&(t[r]=h=>new Promise((f,u,d)=>(h=s.call(n,h),d=h.done,Promise.resolve(h.value).then(m=>f({value:m,done:d}),u)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("../notifier/index.cjs"),mt=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var P,l,w,H,N,M;class pt{constructor(t,e){o(this,P,void 0);o(this,l,void 0);o(this,w,void 0);o(this,H,void 0);o(this,N,t=>{t.preventDefault(),i(this,P).navigate(i(this,w),i(this,H))});o(this,M,()=>{i(this,P).prefetch(i(this,w)),i(this,l).removeEventListener("pointerenter",i(this,M))});var f;c(this,P,e),c(this,l,t),c(this,w,i(this,l).getAttribute("href")||"/"),c(this,H,i(this,l).getAttribute("data-history-action")||"push"),i(this,l).addEventListener("click",i(this,N));const r=e.normalizePath(i(this,w)),s=e.normalizePath(location.pathname),h=(f=i(this,l).getAttribute("data-match-paths"))==null?void 0:f.split(",").map(u=>e.normalizePath(u.trim()).pathname);i(this,l).hasAttribute("data-include")?s.pathname.includes(r.pathname)&&i(this,l).classList.add("current"):(r.pathname===s.pathname||h!=null&&h.includes(s.pathname))&&i(this,l).classList.add("current"),i(this,l).hasAttribute("data-prefetch")&&i(this,l).addEventListener("pointerenter",i(this,M))}destroy(){i(this,l).removeEventListener("click",i(this,N)),i(this,l).removeEventListener("pointerenter",i(this,M)),i(this,l).classList.remove("current")}}P=new WeakMap,l=new WeakMap,w=new WeakMap,H=new WeakMap,N=new WeakMap,M=new WeakMap;var g,S,C,k,z,$,y,v,L,W,q,x,Q,D,U,R,V,j,ht,F,X,B;class gt{constructor(t){o(this,x);o(this,D);o(this,R);o(this,j);o(this,F);o(this,g,null);o(this,S,null);o(this,C,null);o(this,k,null);o(this,z,[]);o(this,$,new DOMParser);o(this,y,new Map);o(this,v,void 0);o(this,L,null);o(this,W,new at.Notifier);o(this,q,new at.Notifier);o(this,B,t=>{t.state&&this.navigate(t.state,"none")});mt.isBrowser&&(c(this,g,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(c(this,g,t.base),t.base.endsWith("/")||c(this,g,i(this,g)+"/")):c(this,g,"/"),c(this,S,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,C,(t==null?void 0:t.cachePages)!==!1),c(this,k,p(this,R,V).call(this,document.body)),c(this,L,this.normalizePath(location.pathname).pathname),document.documentElement.setAttribute("data-current-pathname",i(this,L)),p(this,D,U).call(this),addEventListener("popstate",i(this,B)))}get currentPathname(){return i(this,L)}normalizePath(t){t=t.replace(i(this,g),""),t.startsWith("/")&&(t=t.slice(1));const e=t.split("#"),r=e[0].split("?"),s=r[0].endsWith("/")?r[0].slice(0,-1):r[0],h=i(this,g)+s,f=r==null?void 0:r[1],u=e==null?void 0:e[1];return{leaf:s,pathname:h,parameters:f,hash:u}}beforeNavigationEvent(t){return i(this,W).subscribe(t)}afterNavigationEvent(t){return i(this,q).subscribe(t)}prefetch(t){return T(this,null,function*(){const e=this.normalizePath(t);return p(this,x,Q).call(this,e.pathname)})}navigate(t,e="push"){return T(this,null,function*(){var d;const r=this.normalizePath(t);let{pathname:s,hash:h,parameters:f}=r;if(i(this,v)===s||i(this,L)===s)return;c(this,v,s);const u=i(this,y).has(s);try{let m=!0;if(i(this,W).notify({pathname:s,isCached:u}),this.preprocessor)try{yield new Promise((a,E)=>{var b;(b=this.preprocessor)==null||b.call(this,{pathname:s,resolve:a,reject:E,isCached:u})})}catch(a){a?console.error(a):console.log("Route change canceled"),m=!1}if(!m||i(this,v)!==s)return;const Z=i(this,y).get(s)||(yield p(this,x,Q).call(this,s));if(i(this,v)!==s)return;const tt=Array.from(document.head.children),et=Array.from(Z.head.cloneNode(!0).children),it=p(this,j,ht).call(this,tt,et),ct=p(this,F,X).call(this,tt,it),I=p(this,F,X).call(this,et,it);ct.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),I.forEach((a,E)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const b=document.createElement("script");b.type="module",b.src=a.getAttribute("src"),I[E]=b}}),I.forEach(a=>{document.head.appendChild(a)});const K=I.filter(a=>a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK");i(this,S)&&K.length&&(yield new Promise(a=>T(this,null,function*(){let E=0;try{for(var b=ot(K),ft,Y,A;ft=!(Y=yield b.next()).done;ft=!1){const _=Y.value;_.onload=()=>{E++,E===K.length&&a()}}}catch(Y){A=[Y]}finally{try{ft&&(Y=b.return)&&(yield Y.call(b))}finally{if(A)throw A[0]}}}))),c(this,L,s);const O=f||location.search,lt=h?h.startsWith("#")?h:"#"+h:"",ut=O?O.startsWith("?")?O:"?"+O:"",st=`${s}${lt}${ut}`;e==="push"?history.pushState(s,"",st):e==="replace"&&history.replaceState(s,"",st);const dt=p(this,R,V).call(this,Z.body.cloneNode(!0));i(this,k).forEach((a,E)=>{const b=dt[E];let ft=[...a.childNodes],Y=[...b.childNodes];ft.forEach(A=>{if(A instanceof HTMLElement){const _=A.hasAttribute("data-remain");let nt;Y=Y.filter(G=>G instanceof HTMLElement&&G.outerHTML===A.outerHTML?(nt=G,!1):!0),_&&nt||A.remove()}else A.remove()}),a.append(...Y)}),p(this,D,U).call(this),document.documentElement.setAttribute("data-current-pathname",s),(d=this.postprocessor)==null||d.call(this,{pathname:s,isCached:u}),i(this,q).notify({pathname:s,isCached:u})}catch(m){console.error(m)}c(this,v,void 0)})}}g=new WeakMap,S=new WeakMap,C=new WeakMap,k=new WeakMap,z=new WeakMap,$=new WeakMap,y=new WeakMap,v=new WeakMap,L=new WeakMap,W=new WeakMap,q=new WeakMap,x=new WeakSet,Q=function(t){return T(this,null,function*(){const e=i(this,y).get(t);if(e)return e;const s=yield(yield fetch(t)).text(),h=i(this,$).parseFromString(s,"text/html");return i(this,C)&&i(this,y).set(t,h),h})},D=new WeakSet,U=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var r;return(r=e.getAttribute("href"))==null?void 0:r.startsWith("/")});i(this,z).forEach(e=>e.destroy()),c(this,z,t.map(e=>new pt(e,this)))},R=new WeakSet,V=function(t){return[...t.querySelectorAll("[data-morph]")]},j=new WeakSet,ht=function(t,e){return t.filter(r=>e.find(s=>s.outerHTML===r.outerHTML))},F=new WeakSet,X=function(t,e){return t.filter(r=>!e.find(s=>s.outerHTML===r.outerHTML))},B=new WeakMap;exports.Morph=gt;
1
+ "use strict";var rt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var J=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var i=(n,t,e)=>(J(n,t,"read from private field"),e?e.call(n):t.get(n)),o=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)},c=(n,t,e,r)=>(J(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e);var p=(n,t,e)=>(J(n,t,"access private method"),e);var T=(n,t,e)=>new Promise((r,s)=>{var h=d=>{try{u(e.next(d))}catch(m){s(m)}},f=d=>{try{u(e.throw(d))}catch(m){s(m)}},u=d=>d.done?r(d.value):Promise.resolve(d.value).then(h,f);u((e=e.apply(n,t)).next())});var ot=(n,t,e)=>(t=n[rt("asyncIterator")])?t.call(n):(n=n[rt("iterator")](),t={},e=(r,s)=>(s=n[r])&&(t[r]=h=>new Promise((f,u,d)=>(h=s.call(n,h),d=h.done,Promise.resolve(h.value).then(m=>f({value:m,done:d}),u)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("../notifier/index.cjs"),mt=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var P,l,w,H,N,M;class pt{constructor(t,e){o(this,P,void 0);o(this,l,void 0);o(this,w,void 0);o(this,H,void 0);o(this,N,t=>{t.preventDefault(),i(this,P).navigate(i(this,w),i(this,H))});o(this,M,()=>{i(this,P).prefetch(i(this,w)),i(this,l).removeEventListener("pointerenter",i(this,M))});var f;c(this,P,e),c(this,l,t),c(this,w,i(this,l).getAttribute("href")||"/"),c(this,H,i(this,l).getAttribute("data-history-action")||"push"),i(this,l).addEventListener("click",i(this,N));const r=e.normalizePath(i(this,w)),s=e.normalizePath(location.pathname),h=(f=i(this,l).getAttribute("data-match-paths"))==null?void 0:f.split(",").map(u=>e.normalizePath(u.trim()).pathname);i(this,l).hasAttribute("data-include")?s.pathname.includes(r.pathname)&&i(this,l).classList.add("current"):(r.pathname===s.pathname||h!=null&&h.includes(s.pathname))&&i(this,l).classList.add("current"),i(this,l).hasAttribute("data-prefetch")&&i(this,l).addEventListener("pointerenter",i(this,M))}destroy(){i(this,l).removeEventListener("click",i(this,N)),i(this,l).removeEventListener("pointerenter",i(this,M)),i(this,l).classList.remove("current")}}P=new WeakMap,l=new WeakMap,w=new WeakMap,H=new WeakMap,N=new WeakMap,M=new WeakMap;var g,S,C,k,z,$,y,v,L,W,q,x,Q,D,U,R,V,j,ht,F,X,B;class gt{constructor(t){o(this,x);o(this,D);o(this,R);o(this,j);o(this,F);o(this,g,null);o(this,S,null);o(this,C,null);o(this,k,null);o(this,z,[]);o(this,$,new DOMParser);o(this,y,new Map);o(this,v,void 0);o(this,L,null);o(this,W,new at.Notifier);o(this,q,new at.Notifier);o(this,B,t=>{t.state&&this.navigate(t.state,"none")});mt.isBrowser&&(c(this,g,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(c(this,g,t.base),t.base.endsWith("/")||c(this,g,i(this,g)+"/")):c(this,g,"/"),c(this,S,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,C,(t==null?void 0:t.cachePages)!==!1),c(this,k,p(this,R,V).call(this,document.body)),c(this,L,this.normalizePath(location.pathname).pathname),document.documentElement.setAttribute("data-current-pathname",i(this,L)),p(this,D,U).call(this),addEventListener("popstate",i(this,B)))}get currentPathname(){return i(this,L)}normalizePath(t){t=t.replace(i(this,g),""),t.startsWith("/")&&(t=t.slice(1));const e=t.split("#"),r=e[0].split("?"),s=r[0].endsWith("/")?r[0].slice(0,-1):r[0],h=i(this,g)+s,f=r==null?void 0:r[1],u=e==null?void 0:e[1];return{leaf:s,pathname:h,parameters:f,hash:u}}beforeNavigationEvent(t){return i(this,W).subscribe(t)}afterNavigationEvent(t){return i(this,q).subscribe(t)}prefetch(t){return T(this,null,function*(){const e=this.normalizePath(t);return p(this,x,Q).call(this,e.pathname)})}navigate(t,e="push"){return T(this,null,function*(){var d;const r=this.normalizePath(t);let{pathname:s,hash:h,parameters:f}=r;if(i(this,v)===s||i(this,L)===s)return;c(this,v,s);const u=i(this,y).has(s);try{let m=!0;if(i(this,W).notify({pathname:s,isCached:u}),this.preprocessor)try{yield new Promise((a,E)=>{var b;(b=this.preprocessor)==null||b.call(this,{pathname:s,resolve:a,reject:E,isCached:u})})}catch(a){a?console.error(a):console.log("Route change canceled"),m=!1}if(!m||i(this,v)!==s)return;const Z=i(this,y).get(s)||(yield p(this,x,Q).call(this,s));if(i(this,v)!==s)return;const tt=Array.from(document.head.children),et=Array.from(Z.head.cloneNode(!0).children),it=p(this,j,ht).call(this,tt,et),ct=p(this,F,X).call(this,tt,it),I=p(this,F,X).call(this,et,it);I.forEach((a,E)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const b=document.createElement("script");b.type="module",b.src=a.getAttribute("src"),I[E]=b}}),I.forEach(a=>{document.head.appendChild(a)});const K=I.filter(a=>a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK");i(this,S)&&K.length&&(yield new Promise(a=>T(this,null,function*(){let E=0;try{for(var b=ot(K),ft,Y,A;ft=!(Y=yield b.next()).done;ft=!1){const _=Y.value;_.onload=()=>{E++,E===K.length&&a()}}}catch(Y){A=[Y]}finally{try{ft&&(Y=b.return)&&(yield Y.call(b))}finally{if(A)throw A[0]}}}))),ct.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),c(this,L,s);const O=f||location.search,lt=h?h.startsWith("#")?h:"#"+h:"",ut=O?O.startsWith("?")?O:"?"+O:"",st=`${s}${lt}${ut}`;e==="push"?history.pushState(s,"",st):e==="replace"&&history.replaceState(s,"",st);const dt=p(this,R,V).call(this,Z.body.cloneNode(!0));i(this,k).forEach((a,E)=>{const b=dt[E];let ft=[...a.childNodes],Y=[...b.childNodes];ft.forEach(A=>{if(A instanceof HTMLElement){const _=A.hasAttribute("data-remain");let nt;Y=Y.filter(G=>G instanceof HTMLElement&&G.outerHTML===A.outerHTML?(nt=G,!1):!0),_&&nt||A.remove()}else A.remove()}),a.append(...Y)}),p(this,D,U).call(this),document.documentElement.setAttribute("data-current-pathname",s),(d=this.postprocessor)==null||d.call(this,{pathname:s,isCached:u}),i(this,q).notify({pathname:s,isCached:u})}catch(m){console.error(m)}c(this,v,void 0)})}}g=new WeakMap,S=new WeakMap,C=new WeakMap,k=new WeakMap,z=new WeakMap,$=new WeakMap,y=new WeakMap,v=new WeakMap,L=new WeakMap,W=new WeakMap,q=new WeakMap,x=new WeakSet,Q=function(t){return T(this,null,function*(){const e=i(this,y).get(t);if(e)return e;const s=yield(yield fetch(t)).text(),h=i(this,$).parseFromString(s,"text/html");return i(this,C)&&i(this,y).set(t,h),h})},D=new WeakSet,U=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var r;return(r=e.getAttribute("href"))==null?void 0:r.startsWith("/")});i(this,z).forEach(e=>e.destroy()),c(this,z,t.map(e=>new pt(e,this)))},R=new WeakSet,V=function(t){return[...t.querySelectorAll("[data-morph]")]},j=new WeakSet,ht=function(t,e){return t.filter(r=>e.find(s=>s.outerHTML===r.outerHTML))},F=new WeakSet,X=function(t,e){return t.filter(r=>!e.find(s=>s.outerHTML===r.outerHTML))},B=new WeakMap;exports.Morph=gt;
@@ -137,9 +137,7 @@ class bt {
137
137
  const tt = Array.from(document.head.children), et = Array.from(
138
138
  _.head.cloneNode(!0).children
139
139
  ), st = p(this, B, ht).call(this, tt, et), ct = p(this, I, Z).call(this, tt, st), $ = p(this, I, Z).call(this, et, st);
140
- ct.forEach((o) => {
141
- o.hasAttribute("data-permanent") || o.remove();
142
- }), $.forEach((o, g) => {
140
+ $.forEach((o, g) => {
143
141
  if (o.tagName === "SCRIPT" && o.getAttribute("src")) {
144
142
  const L = document.createElement("script");
145
143
  L.type = "module", L.src = o.getAttribute("src"), $[g] = L;
@@ -169,7 +167,9 @@ class bt {
169
167
  throw M[0];
170
168
  }
171
169
  }
172
- }))), c(this, b, i);
170
+ }))), ct.forEach((o) => {
171
+ o.hasAttribute("data-permanent") || o.remove();
172
+ }), c(this, b, i);
173
173
  const q = f || location.search, lt = h ? h.startsWith("#") ? h : "#" + h : "", ut = q ? q.startsWith("?") ? q : "?" + q : "", it = `${i}${lt}${ut}`;
174
174
  e === "push" ? history.pushState(i, "", it) : e === "replace" && history.replaceState(i, "", it);
175
175
  const dt = p(this, F, X).call(this, _.body.cloneNode(!0));
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../attributes-Bf2svn4j.cjs"),P=require("../browser-CpzFX2xg.cjs"),h=require("../canvas-CU5Xjahf.cjs"),b=require("../coordinates-D8Np3cPD.cjs"),g=require("../dom-JBOkFLTh.cjs"),o=require("../easings-DsS5-Kqc.cjs"),S=require("../events-Crwi8fz6.cjs"),T=require("../file-EevnUtRj.cjs"),x=require("../function-MthRj-GJ.cjs"),q=require("../gestures-DHLrn6Q8.cjs"),C=require("../layout-8ryRAMGJ.cjs"),c=require("../math-GDWEqu7y.cjs"),O=require("../number-yVpzMdbQ.cjs"),l=require("../object-CCiXnER2.cjs"),D=require("../polyfills-CrcS4RcO.cjs"),p=require("../string-DhgS_iFl.cjs"),E=require("../style-At6aDoqG.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");function Q(t,e,...a){return[...t.slice(0,e),...a,...t.slice(e)]}function M(t,e){const a=t.length;e=e%a;const i=new Array(a);for(let s=0;s<a;s++){const r=(s+e)%a;i[r]=t[s]}return i}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 z(...t){const e={};return Array.from(document.styleSheets).forEach(a=>{Array.from(a.cssRules).forEach(i=>{i instanceof CSSStyleRule&&i.selectorText===":root"&&t.forEach(s=>{const r=i.styleMap.get(s);r&&(e[s]=r.toString())})})}),t.forEach(a=>{e[a]||console.warn(`variable named ${a} not found`)}),e}function N(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function j(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function w(t,{pathSelector:e="path"}={}){const a=document.createElement(null);a.innerHTML=t;const i=a.firstElementChild,r=i.querySelector(e).getPathData(),n=i.getAttribute("viewBox").split(" ").map(m=>m.trim()),u={x:parseInt(n[0]),y:parseInt(n[1]),width:parseInt(n[2]),height:parseInt(n[3])},d=Math.min(u.width,u.height);return r.forEach(m=>{m.values=m.values.map(f=>f/d)}),r}function k(t,e,a,i,s){const r=[];for(let n=0;n<=1;n+=1/s){const u=Math.pow(1-n,3)*t.x+3*Math.pow(1-n,2)*n*e.x+3*(1-n)*Math.pow(n,2)*a.x+Math.pow(n,3)*i.x,d=Math.pow(1-n,3)*t.y+3*Math.pow(1-n,2)*n*e.y+3*(1-n)*Math.pow(n,2)*a.y+Math.pow(n,3)*i.y;r.push({x:u,y:d})}return r}function B(t,e){const a=(e==null?void 0:e.segments)||20,i=w(t,e);let s=[];for(let r=0;r<i.length-1;r++){const{type:n,values:u}=i[r];if(n==="M"&&r===0)s.push({x:u[0],y:u[1]});else if(n==="C"){const d=s[s.length-1],m={x:u[0],y:u[1]},f={x:u[2],y:u[3]},I={x:u[4],y:u[5]},v=k(d,m,f,I,a);s=[...s,...v]}}return s}exports.parseAttribute=y.parseAttribute;exports.parseAttributeValue=y.parseAttributeValue;exports.isBrowser=P.isBrowser;exports.contain=h.contain;exports.cover=h.cover;exports.fixPosition=h.fixPosition;exports.measureText=h.measureText;exports.getPointerPosition=b.getPointerPosition;exports.normalize=b.normalize;exports.screenToCartesian=b.screenToCartesian;exports.findParentElement=g.findParentElement;exports.findScrollParentElement=g.findScrollParentElement;exports.getAllParentElements=g.getAllParentElements;exports.getElement=g.getElement;exports.easeInCubic=o.easeInCubic;exports.easeInExpo=o.easeInExpo;exports.easeInOutCubic=o.easeInOutCubic;exports.easeInOutExpo=o.easeInOutExpo;exports.easeInOutQuad=o.easeInOutQuad;exports.easeInOutQuart=o.easeInOutQuart;exports.easeInOutQuint=o.easeInOutQuint;exports.easeInQuad=o.easeInQuad;exports.easeInQuart=o.easeInQuart;exports.easeInQuint=o.easeInQuint;exports.easeOutCubic=o.easeOutCubic;exports.easeOutExpo=o.easeOutExpo;exports.easeOutQuad=o.easeOutQuad;exports.easeOutQuart=o.easeOutQuart;exports.easeOutQuint=o.easeOutQuint;exports.linear=o.linear;exports.dispatchSizeChangeEvent=S.dispatchSizeChangeEvent;exports.createJSONAndSave=T.createJSONAndSave;exports.debounce=x.debounce;exports.throttle=x.throttle;exports.setupDrag=q.setupDrag;exports.getCumulativeOffsetLeft=C.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=C.getCumulativeOffsetTop;exports.getCumulativePosition=C.getCumulativePosition;exports.calculateDistance=c.calculateDistance;exports.calculateDistanceWithRadius=c.calculateDistanceWithRadius;exports.clamp=c.clamp;exports.damp=c.damp;exports.lerp=c.lerp;exports.mapRange=c.mapRange;exports.round=c.round;exports.smootherstep=c.smootherstep;exports.smoothstep=c.smoothstep;exports.step=c.step;exports.preciseNumber=O.preciseNumber;exports.roundNumberTo=O.roundNumberTo;exports.cloneDeep=l.cloneDeep;exports.compareObjects=l.compareObjects;exports.isESClass=l.isESClass;exports.isNullish=l.isNullish;exports.isObject=l.isObject;exports.mergeDeep=l.mergeDeep;exports.mixin=l.mixin;exports.omit=l.omit;exports.pick=l.pick;exports.nullishCoalescing=D.nullishCoalescing;exports.camelToKebab=p.camelToKebab;exports.capitalize=p.capitalize;exports.generateId=p.generateId;exports.isUppercase=p.isUppercase;exports.kebabToCamel=p.kebabToCamel;exports.snakeToDotted=p.snakeToDotted;exports.toPascalCase=p.toPascalCase;exports.uncapitalize=p.uncapitalize;exports.getElementTransitionDurationMS=E.getElementTransitionDurationMS;exports.getElementTransitionDurationS=E.getElementTransitionDurationS;exports.decode=j;exports.dotCircleCollision=R;exports.dotRectCollision=A;exports.encode=N;exports.getPathData=w;exports.getPoints=B;exports.getRootVariables=z;exports.insert=Q;exports.shiftArray=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../attributes-Bf2svn4j.cjs"),S=require("../browser-CpzFX2xg.cjs"),h=require("../canvas-CU5Xjahf.cjs"),b=require("../coordinates-D8Np3cPD.cjs"),g=require("../dom-JBOkFLTh.cjs"),i=require("../easings-DsS5-Kqc.cjs"),T=require("../events-Crwi8fz6.cjs"),q=require("../file-EevnUtRj.cjs"),x=require("../function-MthRj-GJ.cjs"),D=require("../gestures-DHLrn6Q8.cjs"),C=require("../layout-8ryRAMGJ.cjs"),c=require("../math-GDWEqu7y.cjs"),O=require("../number-yVpzMdbQ.cjs"),l=require("../object-CCiXnER2.cjs"),Q=require("../polyfills-CrcS4RcO.cjs"),p=require("../string-DhgS_iFl.cjs"),E=require("../style-At6aDoqG.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");function A(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function M(t,e){const n=t.length;e=e%n;const s=new Array(n);for(let o=0;o<n;o++){const r=(o+e)%n;s[r]=t[o]}return s}function R(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function z(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function v(t,e){const n=t.styleMap.get(e);if(n){const s=n.toString();return s.startsWith("var")?v(t,s.slice(4,-1)):s}}function N(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(s=>{s instanceof CSSStyleRule&&s.selectorText===":root"&&t.forEach(o=>{const r=v(s,o);r&&(e[o]=r)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function j(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function k(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function w(t,{pathSelector:e="path"}={}){const n=document.createElement(null);n.innerHTML=t;const s=n.firstElementChild,r=s.querySelector(e).getPathData(),a=s.getAttribute("viewBox").split(" ").map(m=>m.trim()),u={x:parseInt(a[0]),y:parseInt(a[1]),width:parseInt(a[2]),height:parseInt(a[3])},d=Math.min(u.width,u.height);return r.forEach(m=>{m.values=m.values.map(f=>f/d)}),r}function V(t,e,n,s,o){const r=[];for(let a=0;a<=1;a+=1/o){const u=Math.pow(1-a,3)*t.x+3*Math.pow(1-a,2)*a*e.x+3*(1-a)*Math.pow(a,2)*n.x+Math.pow(a,3)*s.x,d=Math.pow(1-a,3)*t.y+3*Math.pow(1-a,2)*a*e.y+3*(1-a)*Math.pow(a,2)*n.y+Math.pow(a,3)*s.y;r.push({x:u,y:d})}return r}function B(t,e){const n=(e==null?void 0:e.segments)||20,s=w(t,e);let o=[];for(let r=0;r<s.length-1;r++){const{type:a,values:u}=s[r];if(a==="M"&&r===0)o.push({x:u[0],y:u[1]});else if(a==="C"){const d=o[o.length-1],m={x:u[0],y:u[1]},f={x:u[2],y:u[3]},I={x:u[4],y:u[5]},P=V(d,m,f,I,n);o=[...o,...P]}}return o}exports.parseAttribute=y.parseAttribute;exports.parseAttributeValue=y.parseAttributeValue;exports.isBrowser=S.isBrowser;exports.contain=h.contain;exports.cover=h.cover;exports.fixPosition=h.fixPosition;exports.measureText=h.measureText;exports.getPointerPosition=b.getPointerPosition;exports.normalize=b.normalize;exports.screenToCartesian=b.screenToCartesian;exports.findParentElement=g.findParentElement;exports.findScrollParentElement=g.findScrollParentElement;exports.getAllParentElements=g.getAllParentElements;exports.getElement=g.getElement;exports.easeInCubic=i.easeInCubic;exports.easeInExpo=i.easeInExpo;exports.easeInOutCubic=i.easeInOutCubic;exports.easeInOutExpo=i.easeInOutExpo;exports.easeInOutQuad=i.easeInOutQuad;exports.easeInOutQuart=i.easeInOutQuart;exports.easeInOutQuint=i.easeInOutQuint;exports.easeInQuad=i.easeInQuad;exports.easeInQuart=i.easeInQuart;exports.easeInQuint=i.easeInQuint;exports.easeOutCubic=i.easeOutCubic;exports.easeOutExpo=i.easeOutExpo;exports.easeOutQuad=i.easeOutQuad;exports.easeOutQuart=i.easeOutQuart;exports.easeOutQuint=i.easeOutQuint;exports.linear=i.linear;exports.dispatchSizeChangeEvent=T.dispatchSizeChangeEvent;exports.createJSONAndSave=q.createJSONAndSave;exports.debounce=x.debounce;exports.throttle=x.throttle;exports.setupDrag=D.setupDrag;exports.getCumulativeOffsetLeft=C.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=C.getCumulativeOffsetTop;exports.getCumulativePosition=C.getCumulativePosition;exports.calculateDistance=c.calculateDistance;exports.calculateDistanceWithRadius=c.calculateDistanceWithRadius;exports.clamp=c.clamp;exports.damp=c.damp;exports.lerp=c.lerp;exports.mapRange=c.mapRange;exports.round=c.round;exports.smootherstep=c.smootherstep;exports.smoothstep=c.smoothstep;exports.step=c.step;exports.preciseNumber=O.preciseNumber;exports.roundNumberTo=O.roundNumberTo;exports.cloneDeep=l.cloneDeep;exports.compareObjects=l.compareObjects;exports.isESClass=l.isESClass;exports.isNullish=l.isNullish;exports.isObject=l.isObject;exports.mergeDeep=l.mergeDeep;exports.mixin=l.mixin;exports.omit=l.omit;exports.pick=l.pick;exports.nullishCoalescing=Q.nullishCoalescing;exports.camelToKebab=p.camelToKebab;exports.capitalize=p.capitalize;exports.generateId=p.generateId;exports.isUppercase=p.isUppercase;exports.kebabToCamel=p.kebabToCamel;exports.snakeToDotted=p.snakeToDotted;exports.toPascalCase=p.toPascalCase;exports.uncapitalize=p.uncapitalize;exports.getElementTransitionDurationMS=E.getElementTransitionDurationMS;exports.getElementTransitionDurationS=E.getElementTransitionDurationS;exports.decode=k;exports.dotCircleCollision=z;exports.dotRectCollision=R;exports.encode=j;exports.getPathData=w;exports.getPoints=B;exports.getRootVariables=N;exports.insert=A;exports.shiftArray=M;
@@ -1,174 +1,181 @@
1
- import { a as S, p as M } from "../attributes-69we3byR.js";
1
+ import { a as M, p as P } from "../attributes-69we3byR.js";
2
2
  import { i as T } from "../browser-0zX67oeU.js";
3
- import { a as D, c as Q, f as R, m as z } from "../canvas-DeZ0SLUJ.js";
4
- import { g as B, n as N, s as j } from "../coordinates-CgdGoSYs.js";
5
- import { f as q, b as L, a as V, g as H } from "../dom-0S_WDL4g.js";
6
- import { c as K, n as W, f as $, p as F, b as G, i as X, m as Y, e as Z, g as _, j as ee, d as te, o as ae, a as se, h as oe, k as ne, l as re } from "../easings-BKi40vHz.js";
7
- import { d as ce } from "../events-_C2CztxR.js";
8
- import { c as le } from "../file-lxi_oXJf.js";
9
- import { d as fe, t as me } from "../function-C10DGppn.js";
10
- import { s as de } from "../gestures-D2Fdra_G.js";
11
- import { g as ge, a as be, b as we } from "../layout-HoBT_Da2.js";
12
- import { e as Ce, f as ve, c as Ee, d as Ie, l as Oe, m as Se, r as Me, b as Pe, a as Te, s as Ae } from "../math-BOBiC4TN.js";
13
- import { p as Qe, r as Re } from "../number-Bo5RdrA1.js";
14
- import { c as ke, d as Be, i as Ne, b as je, a as Ue, m as qe, e as Le, o as Ve, p as He } from "../object-D6MVWB4l.js";
3
+ import { a as Q, c as R, f as z, m as k } from "../canvas-DeZ0SLUJ.js";
4
+ import { g as B, n as N, s as V } from "../coordinates-CgdGoSYs.js";
5
+ import { f as q, b as L, a as W, g as H } from "../dom-0S_WDL4g.js";
6
+ import { c as K, n as $, f as F, p as G, b as X, i as Y, m as Z, e as _, g as ee, j as te, d as ae, o as se, a as ne, h as oe, k as re, l as ie } from "../easings-BKi40vHz.js";
7
+ import { d as ue } from "../events-_C2CztxR.js";
8
+ import { c as pe } from "../file-lxi_oXJf.js";
9
+ import { d as me, t as he } from "../function-C10DGppn.js";
10
+ import { s as xe } from "../gestures-D2Fdra_G.js";
11
+ import { g as be, a as we, b as ye } from "../layout-HoBT_Da2.js";
12
+ import { e as ve, f as Ee, c as Ie, d as Oe, l as Se, m as Me, r as Pe, b as Ae, a as Te, s as De } from "../math-BOBiC4TN.js";
13
+ import { p as Re, r as ze } from "../number-Bo5RdrA1.js";
14
+ import { c as je, d as Be, i as Ne, b as Ve, a as Ue, m as qe, e as Le, o as We, p as He } from "../object-D6MVWB4l.js";
15
15
  import { n as Ke } from "../polyfills-DJUYczFm.js";
16
- import { c as $e, a as Fe, g as Ge, i as Xe, k as Ye, s as Ze, t as _e, u as et } from "../string-f0Dnk0L1.js";
17
- import { a as at, g as st } from "../style-CklEF62D.js";
16
+ import { c as Fe, a as Ge, g as Xe, i as Ye, k as Ze, s as _e, t as et, u as tt } from "../string-f0Dnk0L1.js";
17
+ import { a as st, g as nt } from "../style-CklEF62D.js";
18
18
  import "../path-data-polyfill-DgeDWYeI.js";
19
- function x(t, e, ...s) {
20
- return [...t.slice(0, e), ...s, ...t.slice(e)];
19
+ function g(t, e, ...a) {
20
+ return [...t.slice(0, e), ...a, ...t.slice(e)];
21
21
  }
22
- function g(t, e) {
23
- const s = t.length;
24
- e = e % s;
25
- const n = new Array(s);
26
- for (let o = 0; o < s; o++) {
27
- const r = (o + e) % s;
22
+ function b(t, e) {
23
+ const a = t.length;
24
+ e = e % a;
25
+ const n = new Array(a);
26
+ for (let o = 0; o < a; o++) {
27
+ const r = (o + e) % a;
28
28
  n[r] = t[o];
29
29
  }
30
30
  return n;
31
31
  }
32
- function b(t, e) {
32
+ function w(t, e) {
33
33
  return t.x < e.x + e.width && t.x > e.x && t.y < e.y + e.height && t.y > e.y;
34
34
  }
35
- function w(t, e) {
35
+ function y(t, e) {
36
36
  return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
37
37
  }
38
- function y(...t) {
38
+ function p(t, e) {
39
+ const a = t.styleMap.get(e);
40
+ if (a) {
41
+ const n = a.toString();
42
+ return n.startsWith("var") ? p(t, n.slice(4, -1)) : n;
43
+ }
44
+ }
45
+ function C(...t) {
39
46
  const e = {};
40
- return Array.from(document.styleSheets).forEach((s) => {
41
- Array.from(s.cssRules).forEach((n) => {
47
+ return Array.from(document.styleSheets).forEach((a) => {
48
+ Array.from(a.cssRules).forEach((n) => {
42
49
  n instanceof CSSStyleRule && n.selectorText === ":root" && t.forEach((o) => {
43
- const r = n.styleMap.get(o);
44
- r && (e[o] = r.toString());
50
+ const r = p(n, o);
51
+ r && (e[o] = r);
45
52
  });
46
53
  });
47
- }), t.forEach((s) => {
48
- e[s] || console.warn(`variable named ${s} not found`);
54
+ }), t.forEach((a) => {
55
+ e[a] || console.warn(`variable named ${a} not found`);
49
56
  }), e;
50
57
  }
51
- function C(t) {
58
+ function v(t) {
52
59
  const e = window.atob(t);
53
60
  return decodeURIComponent(window.escape(e));
54
61
  }
55
- function v(t) {
62
+ function E(t) {
56
63
  const e = window.unescape(encodeURIComponent(t));
57
64
  return window.btoa(e);
58
65
  }
59
- function m(t, { pathSelector: e = "path" } = {}) {
60
- const s = document.createElement(null);
61
- s.innerHTML = t;
62
- const n = s.firstElementChild, r = n.querySelector(e).getPathData(), a = n.getAttribute("viewBox").split(" ").map((c) => c.trim()), i = {
63
- x: parseInt(a[0]),
64
- y: parseInt(a[1]),
65
- width: parseInt(a[2]),
66
- height: parseInt(a[3])
66
+ function h(t, { pathSelector: e = "path" } = {}) {
67
+ const a = document.createElement(null);
68
+ a.innerHTML = t;
69
+ const n = a.firstElementChild, r = n.querySelector(e).getPathData(), s = n.getAttribute("viewBox").split(" ").map((c) => c.trim()), i = {
70
+ x: parseInt(s[0]),
71
+ y: parseInt(s[1]),
72
+ width: parseInt(s[2]),
73
+ height: parseInt(s[3])
67
74
  }, u = Math.min(i.width, i.height);
68
75
  return r.forEach((c) => {
69
76
  c.values = c.values.map((l) => l / u);
70
77
  }), r;
71
78
  }
72
- function h(t, e, s, n, o) {
79
+ function d(t, e, a, n, o) {
73
80
  const r = [];
74
- for (let a = 0; a <= 1; a += 1 / o) {
75
- const i = Math.pow(1 - a, 3) * t.x + 3 * Math.pow(1 - a, 2) * a * e.x + 3 * (1 - a) * Math.pow(a, 2) * s.x + Math.pow(a, 3) * n.x, u = Math.pow(1 - a, 3) * t.y + 3 * Math.pow(1 - a, 2) * a * e.y + 3 * (1 - a) * Math.pow(a, 2) * s.y + Math.pow(a, 3) * n.y;
81
+ for (let s = 0; s <= 1; s += 1 / o) {
82
+ const i = Math.pow(1 - s, 3) * t.x + 3 * Math.pow(1 - s, 2) * s * e.x + 3 * (1 - s) * Math.pow(s, 2) * a.x + Math.pow(s, 3) * n.x, u = Math.pow(1 - s, 3) * t.y + 3 * Math.pow(1 - s, 2) * s * e.y + 3 * (1 - s) * Math.pow(s, 2) * a.y + Math.pow(s, 3) * n.y;
76
83
  r.push({ x: i, y: u });
77
84
  }
78
85
  return r;
79
86
  }
80
- function E(t, e) {
81
- const s = (e == null ? void 0 : e.segments) || 20, n = m(t, e);
87
+ function I(t, e) {
88
+ const a = (e == null ? void 0 : e.segments) || 20, n = h(t, e);
82
89
  let o = [];
83
90
  for (let r = 0; r < n.length - 1; r++) {
84
- const { type: a, values: i } = n[r];
85
- if (a === "M" && r === 0)
91
+ const { type: s, values: i } = n[r];
92
+ if (s === "M" && r === 0)
86
93
  o.push({ x: i[0], y: i[1] });
87
- else if (a === "C") {
88
- const u = o[o.length - 1], c = { x: i[0], y: i[1] }, l = { x: i[2], y: i[3] }, p = { x: i[4], y: i[5] }, f = h(u, c, l, p, s);
89
- o = [...o, ...f];
94
+ else if (s === "C") {
95
+ const u = o[o.length - 1], c = { x: i[0], y: i[1] }, l = { x: i[2], y: i[3] }, f = { x: i[4], y: i[5] }, m = d(u, c, l, f, a);
96
+ o = [...o, ...m];
90
97
  }
91
98
  }
92
99
  return o;
93
100
  }
94
101
  export {
95
- Ce as calculateDistance,
96
- ve as calculateDistanceWithRadius,
97
- $e as camelToKebab,
98
- Fe as capitalize,
99
- Ee as clamp,
100
- ke as cloneDeep,
102
+ ve as calculateDistance,
103
+ Ee as calculateDistanceWithRadius,
104
+ Fe as camelToKebab,
105
+ Ge as capitalize,
106
+ Ie as clamp,
107
+ je as cloneDeep,
101
108
  Be as compareObjects,
102
- D as contain,
103
- Q as cover,
104
- le as createJSONAndSave,
105
- Ie as damp,
106
- fe as debounce,
107
- v as decode,
108
- ce as dispatchSizeChangeEvent,
109
- w as dotCircleCollision,
110
- b as dotRectCollision,
109
+ Q as contain,
110
+ R as cover,
111
+ pe as createJSONAndSave,
112
+ Oe as damp,
113
+ me as debounce,
114
+ E as decode,
115
+ ue as dispatchSizeChangeEvent,
116
+ y as dotCircleCollision,
117
+ w as dotRectCollision,
111
118
  K as easeInCubic,
112
- W as easeInExpo,
113
- $ as easeInOutCubic,
114
- F as easeInOutExpo,
115
- G as easeInOutQuad,
116
- X as easeInOutQuart,
117
- Y as easeInOutQuint,
118
- Z as easeInQuad,
119
- _ as easeInQuart,
120
- ee as easeInQuint,
121
- te as easeOutCubic,
122
- ae as easeOutExpo,
123
- se as easeOutQuad,
119
+ $ as easeInExpo,
120
+ F as easeInOutCubic,
121
+ G as easeInOutExpo,
122
+ X as easeInOutQuad,
123
+ Y as easeInOutQuart,
124
+ Z as easeInOutQuint,
125
+ _ as easeInQuad,
126
+ ee as easeInQuart,
127
+ te as easeInQuint,
128
+ ae as easeOutCubic,
129
+ se as easeOutExpo,
130
+ ne as easeOutQuad,
124
131
  oe as easeOutQuart,
125
- ne as easeOutQuint,
126
- C as encode,
132
+ re as easeOutQuint,
133
+ v as encode,
127
134
  q as findParentElement,
128
135
  L as findScrollParentElement,
129
- R as fixPosition,
130
- Ge as generateId,
131
- V as getAllParentElements,
132
- ge as getCumulativeOffsetLeft,
133
- be as getCumulativeOffsetTop,
134
- we as getCumulativePosition,
136
+ z as fixPosition,
137
+ Xe as generateId,
138
+ W as getAllParentElements,
139
+ be as getCumulativeOffsetLeft,
140
+ we as getCumulativeOffsetTop,
141
+ ye as getCumulativePosition,
135
142
  H as getElement,
136
- at as getElementTransitionDurationMS,
137
- st as getElementTransitionDurationS,
138
- m as getPathData,
143
+ st as getElementTransitionDurationMS,
144
+ nt as getElementTransitionDurationS,
145
+ h as getPathData,
139
146
  B as getPointerPosition,
140
- E as getPoints,
141
- y as getRootVariables,
142
- x as insert,
147
+ I as getPoints,
148
+ C as getRootVariables,
149
+ g as insert,
143
150
  T as isBrowser,
144
151
  Ne as isESClass,
145
- je as isNullish,
152
+ Ve as isNullish,
146
153
  Ue as isObject,
147
- Xe as isUppercase,
148
- Ye as kebabToCamel,
149
- Oe as lerp,
150
- re as linear,
151
- Se as mapRange,
152
- z as measureText,
154
+ Ye as isUppercase,
155
+ Ze as kebabToCamel,
156
+ Se as lerp,
157
+ ie as linear,
158
+ Me as mapRange,
159
+ k as measureText,
153
160
  qe as mergeDeep,
154
161
  Le as mixin,
155
162
  N as normalize,
156
163
  Ke as nullishCoalescing,
157
- Ve as omit,
158
- S as parseAttribute,
159
- M as parseAttributeValue,
164
+ We as omit,
165
+ M as parseAttribute,
166
+ P as parseAttributeValue,
160
167
  He as pick,
161
- Qe as preciseNumber,
162
- Me as round,
163
- Re as roundNumberTo,
164
- j as screenToCartesian,
165
- de as setupDrag,
166
- g as shiftArray,
167
- Pe as smootherstep,
168
+ Re as preciseNumber,
169
+ Pe as round,
170
+ ze as roundNumberTo,
171
+ V as screenToCartesian,
172
+ xe as setupDrag,
173
+ b as shiftArray,
174
+ Ae as smootherstep,
168
175
  Te as smoothstep,
169
- Ze as snakeToDotted,
170
- Ae as step,
171
- me as throttle,
172
- _e as toPascalCase,
173
- et as uncapitalize
176
+ _e as snakeToDotted,
177
+ De as step,
178
+ he as throttle,
179
+ et as toPascalCase,
180
+ tt as uncapitalize
174
181
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.4.41",
3
+ "version": "0.4.43",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"