aptechka 0.40.0 → 0.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
  display: block;
3
3
  width: 100%;
4
4
  height: 100%;
5
- `,e(this,h).classList.add("source-consumer"),Array.from(this.attributes).forEach(o=>{if(o.name!=="srcset"){const y=o.nodeValue||"",I=me.kebabToCamel(o.name);I in e(this,h)&&(e(this,h)[I]=y||!0)}}),this.appendChild(e(this,h)),r(this,d,new ge.SourceManager({srcset:t})),r(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(o=>{(!e(this,f)||e(this,f)&&e(this,v))&&_(this,B,G).call(this,o.current)}),e(this,z).observe(this),e(this,d).connect()}disconnectedCallback(){e(this,z).disconnect(),e(this,d).close(),e(this,h).onloadeddata=null,e(this,h).onload=null,e(this,h).onerror=null,r(this,b,!1),r(this,v,!1),e(this,h).remove(),e(this,c).reset(),clearTimeout(e(this,U))}}d=new WeakMap,h=new WeakMap,b=new WeakMap,v=new WeakMap,f=new WeakMap,F=new WeakMap,A=new WeakMap,c=new WeakMap,z=new WeakMap,U=new WeakMap,S=new WeakMap,B=new WeakSet,G=function(t){if(clearTimeout(e(this,U)),e(this,h).onloadeddata=null,e(this,h).onload=null,e(this,h).onerror=null,e(this,c).set("loaded",!1),e(this,c).set("error",!1),e(this,c).set("loading",!1),e(this,c).set("clear",!1),t){r(this,A,`${e(this,F)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0),r(this,S,i?t.url:t.name+t.extension),this.consumeSource(e(this,S)),!e(this,f)&&!e(this,b)&&re.loading.add(e(this,A)),e(this,h).onloadeddata=()=>{e(this,O).call(this)},e(this,h).onload=()=>{e(this,O).call(this)},e(this,h).onerror=()=>{e(this,Z).call(this,e(this,S))}}else r(this,S,null),this.consumeSource(null)},Q=new WeakMap,O=new WeakMap,Z=new WeakMap;class fe extends D{createConsumer(){return document.createElement("img")}consumeSource(n){if(n&&this.hasAttribute("webp")&&Ee.device.isWebp){const t=n.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=n||""}}customElements.get("e-image")||customElements.define("e-image",fe);function we(a){const n=a.match(/\{([\d-]+)\}/);if(n){const t=n[1].split("-");if(t.length===2){const i=parseInt(t[0],10),o=parseInt(t[1],10);return{start:i,end:o}}}return null}var p,P,M,L,w,k,x,Y,E,C;class pe extends D{constructor(t){super();s(this,p,[]);s(this,P,new X.CSSProperty(this,"--fit","contain"));s(this,M,new X.CSSProperty(this,"--autoplay",!1));s(this,L,new X.CSSProperty(this,"--offset-x",.5));s(this,w,new X.CSSProperty(this,"--offset-y",.5));s(this,k,null);s(this,x,0);s(this,Y,1);s(this,E,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,P).current==="cover"?r(this,k,le.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,L).current,e(this,w).current)):r(this,k,le.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,L).current,e(this,w).current))}});s(this,C,t=>{if(this.status.isFalse("loaded")||!e(this,k))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,p)[e(this,x)];i&&t.detail.context.drawImage(i,...e(this,k)),e(this,M).current&&r(this,x,(e(this,x)+1)%e(this,p).length)});de.isBrowser&&(r(this,Y,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,P).subscribe(e(this,E)),e(this,L).subscribe(e(this,E)),e(this,w).subscribe(e(this,E)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,C))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,C))}))}setProgress(t){e(this,p).length&&r(this,x,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,M).observe(),e(this,P).observe(),e(this,L).observe(),e(this,w).observe(),ue.elementResizer.subscribe(this,e(this,E))}disconnectedCallback(){super.disconnectedCallback(),e(this,M).unobserve(),e(this,P).unobserve(),e(this,L).unobserve(),e(this,w).unobserve(),r(this,p,[]),ue.elementResizer.unsubscribe(e(this,E)),this.consumerElement.removeEventListener("canvasRender",e(this,C))}createConsumer(){return new Se.CanvasElement}consumeSource(t){return ce(this,null,function*(){var i,o,y,I;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,C));const g=[],m=we(t);if(m)for(let l=m.start;l<=m.end;l++){const oe=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,Y),"0")),K=new Image;K.src=oe,g.push(K)}else{const l=new Image;l.src=t,g.push(l)}try{yield Promise.all(g.map((l,oe)=>new Promise((K,be)=>{l.onload=()=>{K()},l.onerror=Ce=>{be(`${l.src} Image not found`)}}))),r(this,p,g),e(this,E).call(this),(o=(i=this.consumerElement).onload)==null||o.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,C))}catch(l){console.error(l),(I=(y=this.consumerElement).onerror)==null||I.call(y,new Event("error"))}}})}}p=new WeakMap,P=new WeakMap,M=new WeakMap,L=new WeakMap,w=new WeakMap,k=new WeakMap,x=new WeakMap,Y=new WeakMap,E=new WeakMap,C=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",pe);var T,H;class ye extends D{constructor(){super(...arguments);s(this,T,0);s(this,H,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,T)&&r(this,T,t),q.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,T)}}),this.consumerElement.readyState===4&&ne.ticker.unsubscribe(e(this,H))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{ne.ticker.subscribe(e(this,H)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),ne.ticker.unsubscribe(e(this,H)),r(this,T,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}T=new WeakMap,H=new WeakMap;customElements.get("e-video")||customElements.define("e-video",ye);var u,W,R,N,$,ee,te,se,j,ae;const V=class V extends D{constructor(){super();s(this,j);s(this,u);s(this,W);s(this,R,!1);s(this,N,!1);s(this,$,()=>{r(this,R,e(this,R)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),r(this,u,new window.YT.Player(e(this,W),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,ee),onError:e(this,te),onStateChange:e(this,se)}}))});s(this,ee,()=>{r(this,N,!0),_(this,j,ae).call(this)});s(this,te,t=>{var i,o;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(o=(i=this.consumerElement).onerror)==null||o.call(i,new Event("error"))});s(this,se,()=>{});r(this,W,"yt-"+me.generateId(10)),V.__apiReady||(window.onYouTubeIframeAPIReady=()=>{V.__apiReady=!0,q.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,N)?e(this,u).playVideo():r(this,R,!0))}),this.addEventListener("sourceRelease",()=>{e(this,u)&&this.hasAttribute("capture-autoplay")&&(e(this,u).pauseVideo(),this.hasAttribute("replay")&&e(this,u).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,W),t}consumeSource(t){var i;if(t){if(!document.getElementById("youtube-script")){const o=document.createElement("script");o.id,o.src="https://www.youtube.com/iframe_api";const y=document.getElementsByTagName("script")[0];(i=y.parentNode)==null||i.insertBefore(o,y)}e(this,u)?_(this,j,ae).call(this):V.__apiReady?e(this,$).call(this):addEventListener("youTubeIframeAPIReady",e(this,$))}else e(this,u)&&e(this,u).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,u)&&e(this,u).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,$))}};u=new WeakMap,W=new WeakMap,R=new WeakMap,N=new WeakMap,$=new WeakMap,ee=new WeakMap,te=new WeakMap,se=new WeakMap,j=new WeakSet,ae=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,u).loadVideoByUrl(this.currentURL):e(this,u).loadVideoById(this.currentURL)),e(this,R)?e(this,u).playVideo():e(this,u).stopVideo(),r(this,R,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},V.__apiReady=!1;let J=V;customElements.get("e-youtube")||customElements.define("e-youtube",J);exports.ImageElement=fe;exports.SequenceElement=pe;exports.SourceElement=D;exports.VideoElement=ye;exports.YouTubeElement=J;
5
+ `,e(this,h).classList.add("source-consumer"),Array.from(this.attributes).forEach(o=>{if(o.name!=="srcset"){const y=o.nodeValue||"",I=me.kebabToCamel(o.name);I in e(this,h)&&(e(this,h)[I]=y||!0)}}),this.appendChild(e(this,h)),r(this,d,new ge.SourceManager({srcset:t})),r(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(o=>{(!e(this,f)||e(this,f)&&e(this,v))&&_(this,B,G).call(this,o.current)}),e(this,d).connect(),e(this,z).observe(this)}disconnectedCallback(){e(this,z).disconnect(),e(this,d).close(),e(this,h).onloadeddata=null,e(this,h).onload=null,e(this,h).onerror=null,r(this,b,!1),r(this,v,!1),e(this,h).remove(),e(this,c).reset(),clearTimeout(e(this,U))}}d=new WeakMap,h=new WeakMap,b=new WeakMap,v=new WeakMap,f=new WeakMap,F=new WeakMap,A=new WeakMap,c=new WeakMap,z=new WeakMap,U=new WeakMap,S=new WeakMap,B=new WeakSet,G=function(t){if(clearTimeout(e(this,U)),e(this,h).onloadeddata=null,e(this,h).onload=null,e(this,h).onerror=null,e(this,c).set("loaded",!1),e(this,c).set("error",!1),e(this,c).set("loading",!1),e(this,c).set("clear",!1),t){r(this,A,`${e(this,F)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0),r(this,S,i?t.url:t.name+t.extension),this.consumeSource(e(this,S)),!e(this,f)&&!e(this,b)&&re.loading.add(e(this,A)),e(this,h).onloadeddata=()=>{e(this,O).call(this)},e(this,h).onload=()=>{e(this,O).call(this)},e(this,h).onerror=()=>{e(this,Z).call(this,e(this,S))}}else r(this,S,null),this.consumeSource(null)},Q=new WeakMap,O=new WeakMap,Z=new WeakMap;class fe extends D{createConsumer(){return document.createElement("img")}consumeSource(n){if(n&&this.hasAttribute("webp")&&Ee.device.isWebp){const t=n.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=n||""}}customElements.get("e-image")||customElements.define("e-image",fe);function we(a){const n=a.match(/\{([\d-]+)\}/);if(n){const t=n[1].split("-");if(t.length===2){const i=parseInt(t[0],10),o=parseInt(t[1],10);return{start:i,end:o}}}return null}var p,P,M,L,w,k,x,Y,E,C;class pe extends D{constructor(t){super();s(this,p,[]);s(this,P,new X.CSSProperty(this,"--fit","contain"));s(this,M,new X.CSSProperty(this,"--autoplay",!1));s(this,L,new X.CSSProperty(this,"--offset-x",.5));s(this,w,new X.CSSProperty(this,"--offset-y",.5));s(this,k,null);s(this,x,0);s(this,Y,1);s(this,E,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,P).current==="cover"?r(this,k,le.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,L).current,e(this,w).current)):r(this,k,le.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,L).current,e(this,w).current))}});s(this,C,t=>{if(this.status.isFalse("loaded")||!e(this,k))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,p)[e(this,x)];i&&t.detail.context.drawImage(i,...e(this,k)),e(this,M).current&&r(this,x,(e(this,x)+1)%e(this,p).length)});de.isBrowser&&(r(this,Y,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,P).subscribe(e(this,E)),e(this,L).subscribe(e(this,E)),e(this,w).subscribe(e(this,E)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,C))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,C))}))}setProgress(t){e(this,p).length&&r(this,x,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,M).observe(),e(this,P).observe(),e(this,L).observe(),e(this,w).observe(),ue.elementResizer.subscribe(this,e(this,E))}disconnectedCallback(){super.disconnectedCallback(),e(this,M).unobserve(),e(this,P).unobserve(),e(this,L).unobserve(),e(this,w).unobserve(),r(this,p,[]),ue.elementResizer.unsubscribe(e(this,E)),this.consumerElement.removeEventListener("canvasRender",e(this,C))}createConsumer(){return new Se.CanvasElement}consumeSource(t){return ce(this,null,function*(){var i,o,y,I;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,C));const g=[],m=we(t);if(m)for(let l=m.start;l<=m.end;l++){const oe=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,Y),"0")),K=new Image;K.src=oe,g.push(K)}else{const l=new Image;l.src=t,g.push(l)}try{yield Promise.all(g.map((l,oe)=>new Promise((K,be)=>{l.onload=()=>{K()},l.onerror=Ce=>{be(`${l.src} Image not found`)}}))),r(this,p,g),e(this,E).call(this),(o=(i=this.consumerElement).onload)==null||o.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,C))}catch(l){console.error(l),(I=(y=this.consumerElement).onerror)==null||I.call(y,new Event("error"))}}})}}p=new WeakMap,P=new WeakMap,M=new WeakMap,L=new WeakMap,w=new WeakMap,k=new WeakMap,x=new WeakMap,Y=new WeakMap,E=new WeakMap,C=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",pe);var T,H;class ye extends D{constructor(){super(...arguments);s(this,T,0);s(this,H,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,T)&&r(this,T,t),q.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,T)}}),this.consumerElement.readyState===4&&ne.ticker.unsubscribe(e(this,H))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{ne.ticker.subscribe(e(this,H)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),ne.ticker.unsubscribe(e(this,H)),r(this,T,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}T=new WeakMap,H=new WeakMap;customElements.get("e-video")||customElements.define("e-video",ye);var u,W,R,N,$,ee,te,se,j,ae;const V=class V extends D{constructor(){super();s(this,j);s(this,u);s(this,W);s(this,R,!1);s(this,N,!1);s(this,$,()=>{r(this,R,e(this,R)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),r(this,u,new window.YT.Player(e(this,W),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,ee),onError:e(this,te),onStateChange:e(this,se)}}))});s(this,ee,()=>{r(this,N,!0),_(this,j,ae).call(this)});s(this,te,t=>{var i,o;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(o=(i=this.consumerElement).onerror)==null||o.call(i,new Event("error"))});s(this,se,()=>{});r(this,W,"yt-"+me.generateId(10)),V.__apiReady||(window.onYouTubeIframeAPIReady=()=>{V.__apiReady=!0,q.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,N)?e(this,u).playVideo():r(this,R,!0))}),this.addEventListener("sourceRelease",()=>{e(this,u)&&this.hasAttribute("capture-autoplay")&&(e(this,u).pauseVideo(),this.hasAttribute("replay")&&e(this,u).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,W),t}consumeSource(t){var i;if(t){if(!document.getElementById("youtube-script")){const o=document.createElement("script");o.id,o.src="https://www.youtube.com/iframe_api";const y=document.getElementsByTagName("script")[0];(i=y.parentNode)==null||i.insertBefore(o,y)}e(this,u)?_(this,j,ae).call(this):V.__apiReady?e(this,$).call(this):addEventListener("youTubeIframeAPIReady",e(this,$))}else e(this,u)&&e(this,u).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,u)&&e(this,u).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,$))}};u=new WeakMap,W=new WeakMap,R=new WeakMap,N=new WeakMap,$=new WeakMap,ee=new WeakMap,te=new WeakMap,se=new WeakMap,j=new WeakSet,ae=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,u).loadVideoByUrl(this.currentURL):e(this,u).loadVideoById(this.currentURL)),e(this,R)?e(this,u).playVideo():e(this,u).stopVideo(),r(this,R,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},V.__apiReady=!1;let J=V;customElements.get("e-youtube")||customElements.define("e-youtube",J);exports.ImageElement=fe;exports.SequenceElement=pe;exports.SourceElement=D;exports.VideoElement=ye;exports.YouTubeElement=J;
@@ -110,7 +110,7 @@ class te extends HTMLElement {
110
110
  srcset: t
111
111
  })), r(this, f, this.hasAttribute("lazy")), e(this, d).subscribe((o) => {
112
112
  (!e(this, f) || e(this, f) && e(this, v)) && V(this, H, X).call(this, o.current);
113
- }), e(this, _).observe(this), e(this, d).connect();
113
+ }), e(this, d).connect(), e(this, _).observe(this);
114
114
  }
115
115
  disconnectedCallback() {
116
116
  e(this, _).disconnect(), e(this, d).close(), e(this, h).onloadeddata = null, e(this, h).onload = null, e(this, h).onerror = null, r(this, b, !1), r(this, v, !1), e(this, h).remove(), e(this, c).reset(), clearTimeout(e(this, B));
@@ -1 +1 @@
1
- "use strict";var b=r=>{throw TypeError(r)};var I=(r,n,t)=>n.has(r)||b("Cannot "+t);var e=(r,n,t)=>(I(r,n,"read from private field"),t?t.call(r):n.get(r)),o=(r,n,t)=>n.has(r)?b("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(r):n.set(r,t),i=(r,n,t,h)=>(I(r,n,"write to private field"),h?h.call(r,t):n.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("../order/index.cjs"),T=require("../window-resizer/vanilla/index.cjs"),A=require("../Store-C2J4Q87x.cjs");var q,x,w,d,a,u,f;class _{constructor(n){o(this,q);o(this,x);o(this,w);o(this,d);o(this,a);o(this,u);o(this,f);i(this,q,n);const t=n.split(".");i(this,x,t.length>1?t.slice(0,-1).join("."):t.join("."));const h=/\d+x/g,p=t.find(l=>l.match(h));i(this,w,p?parseInt(p):1);const c=/\d+max/g,g=/\d+min/g,S=/\d+mar/g,s=/\d+mir/g,m=t.find(l=>l.match(c)),E=t.find(l=>l.match(g)),$=t.find(l=>l.match(S)),V=t.find(l=>l.match(s));$?(i(this,a,parseInt($)),i(this,u,"max"),i(this,d,`(max-aspect-ratio: ${e(this,a)})`)):V?(i(this,a,parseInt(V)),i(this,u,"max"),i(this,d,`(min-aspect-ratio: ${e(this,a)})`)):m?(i(this,a,parseInt(m)),i(this,u,"max"),i(this,d,`(max-width: ${e(this,a)}px)`)):E?(i(this,a,parseInt(E)),i(this,d,`(min-width: ${e(this,a)}px)`),i(this,u,"min")):(i(this,a,0),i(this,d,`(min-width: ${e(this,a)}px)`),i(this,u,"min")),i(this,x,e(this,x).replace(`.${e(this,a)}${e(this,u)}`,"")),i(this,f,t[t.length-1]===e(this,x)?"":"."+t[t.length-1]),i(this,f,e(this,f).replace(`.${e(this,a)}${e(this,u)}`,""))}get url(){return e(this,q)}get name(){return e(this,x)}get density(){return e(this,w)}get query(){return e(this,d)}get extension(){return e(this,f)}get queryType(){return e(this,u)}get queryValue(){return e(this,a)}}q=new WeakMap,x=new WeakMap,w=new WeakMap,d=new WeakMap,a=new WeakMap,u=new WeakMap,f=new WeakMap;var y;class k{constructor(n){o(this,y);i(this,y,new Map);const t=typeof n=="string"?n.trim().split(",").map(s=>s.trim()).filter(s=>!!s):n,h=[];t.forEach(s=>{const m=new _(s);h.push([m.query,m])});const p=h.filter(s=>s[1].queryType.includes("max")).sort((s,m)=>m[1].queryValue-s[1].queryValue),c=h.filter(s=>s[1].queryType.includes("min")&&s[1].queryValue!==0).sort((s,m)=>s[1].queryValue-m[1].queryValue),g=h.filter(s=>s[0]==="(min-width: 0px)");(g?[...g,...p,...c]:[...p,...c]).forEach(s=>{e(this,y).has(s[0])||e(this,y).set(s[0],[]),e(this,y).get(s[0]).push(s[1])})}get mediaBuckets(){return e(this,y)}}y=new WeakMap;var R,M;class B extends A.Store{constructor(t){super(void 0);o(this,R);o(this,M,()=>{let t;e(this,R).mediaBuckets.forEach((c,g)=>{matchMedia(g).matches&&(t=c)});let h,p=0;t==null||t.forEach(c=>{c.density>p&&c.density<=Math.max(devicePixelRatio,1)&&(p=c.density,h=c)}),t!=null&&t.length&&!h&&(h=t[0]),this.current=h});i(this,R,new k(t.srcset))}close(){super.close(),this.disconnect()}connect(){T.windowResizer.subscribe(e(this,M),z.RESIZE_ORDER.SOURCE_MANAGER)}disconnect(){T.windowResizer.unsubscribe(e(this,M))}}R=new WeakMap,M=new WeakMap;exports.Source=_;exports.SourceManager=B;exports.SourceSet=k;
1
+ "use strict";var b=r=>{throw TypeError(r)};var I=(r,n,t)=>n.has(r)||b("Cannot "+t);var e=(r,n,t)=>(I(r,n,"read from private field"),t?t.call(r):n.get(r)),o=(r,n,t)=>n.has(r)?b("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(r):n.set(r,t),i=(r,n,t,h)=>(I(r,n,"write to private field"),h?h.call(r,t):n.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("../order/index.cjs"),T=require("../window-resizer/vanilla/index.cjs"),A=require("../Store-C2J4Q87x.cjs");var w,x,R,d,a,u,f;class _{constructor(n){o(this,w);o(this,x);o(this,R);o(this,d);o(this,a);o(this,u);o(this,f);i(this,w,n);const t=n.split(".");i(this,x,t.length>1?t.slice(0,-1).join("."):t.join("."));const h=/\d+x/g,p=t.find(l=>l.match(h));i(this,R,p?parseInt(p):1);const c=/\d+max/g,g=/\d+min/g,S=/\d+mar/g,s=/\d+mir/g,m=t.find(l=>l.match(c)),E=t.find(l=>l.match(g)),$=t.find(l=>l.match(S)),V=t.find(l=>l.match(s));$?(i(this,a,parseInt($)),i(this,u,"max"),i(this,d,`(max-aspect-ratio: ${e(this,a)})`)):V?(i(this,a,parseInt(V)),i(this,u,"max"),i(this,d,`(min-aspect-ratio: ${e(this,a)})`)):m?(i(this,a,parseInt(m)),i(this,u,"max"),i(this,d,`(max-width: ${e(this,a)}px)`)):E?(i(this,a,parseInt(E)),i(this,d,`(min-width: ${e(this,a)}px)`),i(this,u,"min")):(i(this,a,0),i(this,d,`(min-width: ${e(this,a)}px)`),i(this,u,"min")),i(this,x,e(this,x).replace(`.${e(this,a)}${e(this,u)}`,"")),i(this,f,t[t.length-1]===e(this,x)?"":"."+t[t.length-1]),i(this,f,e(this,f).replace(`.${e(this,a)}${e(this,u)}`,""))}get url(){return e(this,w)}get name(){return e(this,x)}get density(){return e(this,R)}get query(){return e(this,d)}get extension(){return e(this,f)}get queryType(){return e(this,u)}get queryValue(){return e(this,a)}}w=new WeakMap,x=new WeakMap,R=new WeakMap,d=new WeakMap,a=new WeakMap,u=new WeakMap,f=new WeakMap;var y;class k{constructor(n){o(this,y);i(this,y,new Map);const t=typeof n=="string"?n.trim().split(",").map(s=>s.trim()).filter(s=>!!s):n,h=[];t.forEach(s=>{const m=new _(s);h.push([m.query,m])});const p=h.filter(s=>s[1].queryType.includes("max")).sort((s,m)=>m[1].queryValue-s[1].queryValue),c=h.filter(s=>s[1].queryType.includes("min")&&s[1].queryValue!==0).sort((s,m)=>s[1].queryValue-m[1].queryValue),g=h.filter(s=>s[0]==="(min-width: 0px)");(g?[...g,...p,...c]:[...p,...c]).forEach(s=>{e(this,y).has(s[0])||e(this,y).set(s[0],[]),e(this,y).get(s[0]).push(s[1])})}get mediaBuckets(){return e(this,y)}}y=new WeakMap;var M,q;class B extends A.Store{constructor(t){super(void 0);o(this,M);o(this,q,()=>{let t;e(this,M).mediaBuckets.forEach((c,g)=>{matchMedia(g).matches&&(t=c)});let h,p=0;t==null||t.forEach(c=>{c.density>p&&c.density<=Math.max(devicePixelRatio,1)&&(p=c.density,h=c)}),t!=null&&t.length&&!h&&(h=t[0]),this.current=h});i(this,M,new k(t.srcset))}close(){super.close(),this.disconnect()}connect(){T.windowResizer.subscribe(e(this,q),z.RESIZE_ORDER.SOURCE_MANAGER),e(this,q).call(this)}disconnect(){T.windowResizer.unsubscribe(e(this,q))}}M=new WeakMap,q=new WeakMap;exports.Source=_;exports.SourceManager=B;exports.SourceSet=k;
@@ -6,21 +6,21 @@ var e = (r, n, t) => (k(r, n, "read from private field"), t ? t.call(r) : n.get(
6
6
  import { RESIZE_ORDER as B } from "../order/index.js";
7
7
  import { windowResizer as A } from "../window-resizer/vanilla/index.js";
8
8
  import { S } from "../Store-Cm3LPXlx.js";
9
- var q, f, w, p, h, m, y;
9
+ var w, f, E, p, h, m, y;
10
10
  class T {
11
11
  constructor(n) {
12
- o(this, q);
13
- o(this, f);
14
12
  o(this, w);
13
+ o(this, f);
14
+ o(this, E);
15
15
  o(this, p);
16
16
  o(this, h);
17
17
  o(this, m);
18
18
  o(this, y);
19
- s(this, q, n);
19
+ s(this, w, n);
20
20
  const t = n.split(".");
21
21
  s(this, f, t.length > 1 ? t.slice(0, -1).join(".") : t.join("."));
22
22
  const a = /\d+x/g, d = t.find((l) => l.match(a));
23
- s(this, w, d ? parseInt(d) : 1);
23
+ s(this, E, d ? parseInt(d) : 1);
24
24
  const c = /\d+max/g, g = /\d+min/g, $ = /\d+mar/g, i = /\d+mir/g, u = t.find((l) => l.match(c)), M = t.find((l) => l.match(g)), V = t.find((l) => l.match($)), I = t.find((l) => l.match(i));
25
25
  V ? (s(this, h, parseInt(V)), s(this, m, "max"), s(this, p, `(max-aspect-ratio: ${e(this, h)})`)) : I ? (s(this, h, parseInt(I)), s(this, m, "max"), s(this, p, `(min-aspect-ratio: ${e(this, h)})`)) : u ? (s(this, h, parseInt(u)), s(this, m, "max"), s(this, p, `(max-width: ${e(this, h)}px)`)) : M ? (s(this, h, parseInt(M)), s(this, p, `(min-width: ${e(this, h)}px)`), s(this, m, "min")) : (s(this, h, 0), s(this, p, `(min-width: ${e(this, h)}px)`), s(this, m, "min")), s(this, f, e(this, f).replace(
26
26
  `.${e(this, h)}${e(this, m)}`,
@@ -31,13 +31,13 @@ class T {
31
31
  ));
32
32
  }
33
33
  get url() {
34
- return e(this, q);
34
+ return e(this, w);
35
35
  }
36
36
  get name() {
37
37
  return e(this, f);
38
38
  }
39
39
  get density() {
40
- return e(this, w);
40
+ return e(this, E);
41
41
  }
42
42
  get query() {
43
43
  return e(this, p);
@@ -52,7 +52,7 @@ class T {
52
52
  return e(this, h);
53
53
  }
54
54
  }
55
- q = new WeakMap(), f = new WeakMap(), w = new WeakMap(), p = new WeakMap(), h = new WeakMap(), m = new WeakMap(), y = new WeakMap();
55
+ w = new WeakMap(), f = new WeakMap(), E = new WeakMap(), p = new WeakMap(), h = new WeakMap(), m = new WeakMap(), y = new WeakMap();
56
56
  var x;
57
57
  class P {
58
58
  constructor(n) {
@@ -73,14 +73,14 @@ class P {
73
73
  }
74
74
  }
75
75
  x = new WeakMap();
76
- var E, R;
76
+ var R, q;
77
77
  class _ extends S {
78
78
  constructor(t) {
79
79
  super(void 0);
80
- o(this, E);
81
- o(this, R, () => {
80
+ o(this, R);
81
+ o(this, q, () => {
82
82
  let t;
83
- e(this, E).mediaBuckets.forEach((c, g) => {
83
+ e(this, R).mediaBuckets.forEach((c, g) => {
84
84
  matchMedia(g).matches && (t = c);
85
85
  });
86
86
  let a, d = 0;
@@ -88,19 +88,19 @@ class _ extends S {
88
88
  c.density > d && c.density <= Math.max(devicePixelRatio, 1) && (d = c.density, a = c);
89
89
  }), t != null && t.length && !a && (a = t[0]), this.current = a;
90
90
  });
91
- s(this, E, new P(t.srcset));
91
+ s(this, R, new P(t.srcset));
92
92
  }
93
93
  close() {
94
94
  super.close(), this.disconnect();
95
95
  }
96
96
  connect() {
97
- A.subscribe(e(this, R), B.SOURCE_MANAGER);
97
+ A.subscribe(e(this, q), B.SOURCE_MANAGER), e(this, q).call(this);
98
98
  }
99
99
  disconnect() {
100
- A.unsubscribe(e(this, R));
100
+ A.unsubscribe(e(this, q));
101
101
  }
102
102
  }
103
- E = new WeakMap(), R = new WeakMap();
103
+ R = new WeakMap(), q = new WeakMap();
104
104
  export {
105
105
  T as Source,
106
106
  _ as SourceManager,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.40.0",
3
+ "version": "0.40.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -369,8 +369,8 @@
369
369
  "@types/node": "^22.2.0",
370
370
  "@types/react": "^18.3.3",
371
371
  "@types/react-dom": "^18.3.0",
372
- "@vitejs/plugin-react": "^4.3.1",
373
372
  "@types/three": "^0.167.1",
373
+ "@vitejs/plugin-react": "^4.3.1",
374
374
  "tsx": "^4.17.0",
375
375
  "vite": "5.4.0",
376
376
  "vite-plugin-dts": "^3.8.1",
@@ -380,6 +380,7 @@
380
380
  "react": "^18.3.1",
381
381
  "react-dom": "^18.3.1",
382
382
  "three": "^0.167.1",
383
+ "typograf": "^7.4.1",
383
384
  "urlpattern-polyfill": "^10.0.0"
384
385
  },
385
386
  "peerDependencies": {