aptechka 0.65.2 → 0.65.3

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 V=n=>{throw TypeError(n)};var K=(n,a,e)=>a.has(n)||V("Cannot "+e);var t=(n,a,e)=>(K(n,a,"read from private field"),e?e.call(n):a.get(n)),i=(n,a,e)=>a.has(n)?V("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,e),c=(n,a,e,s)=>(K(n,a,"write to private field"),s?s.call(n,e):a.set(n,e),e),f=(n,a,e)=>(K(n,a,"access private method"),e);var Q=(n,a,e)=>new Promise((s,r)=>{var h=k=>{try{O(e.next(k))}catch(J){r(J)}},u=k=>{try{O(e.throw(k))}catch(J){r(J)}},O=k=>k.done?s(k.value):Promise.resolve(k.value).then(h,u);O((e=e.apply(n,a)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../index-DekP7OZe.cjs"),U=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const M=require("../css-property/index.cjs"),tt=require("../events-KVanG9sR.cjs"),et=require("../gestures-C7gbKx11.cjs"),st=require("../math-GDWEqu7y.cjs"),W=require("../number-DyefJ5a1.cjs");var I,S,g,E,C,A,z,m,l,b,o,R,_,T,j,B,F,G;class $ extends HTMLElement{constructor(){super(...arguments);i(this,o);i(this,I,new M.CSSProperty(this,"--resize",!0));i(this,S,new M.CSSProperty(this,"--loop",!0));i(this,g,new M.CSSProperty(this,"--autoplay",!1));i(this,E,new M.CSSProperty(this,"--swipe","x"));i(this,C);i(this,A,!1);i(this,z,[]);i(this,m,new Map);i(this,l,0);i(this,b,0);i(this,T,e=>{c(this,A,e.isIntersecting),t(this,A)?f(this,o,_).call(this):clearInterval(t(this,C))});i(this,j,()=>{clearInterval(t(this,C)),t(this,A)&&c(this,C,setInterval(t(this,F),parseFloat(t(this,g).current||"0")*1e3))});i(this,F,()=>{f(this,o,B).call(this,t(this,l)+1)});i(this,G,e=>{if(!t(this,E).current)return;let s=0;et.setupDrag(r=>{const h=e.x-r.x,u=e.y-r.y;t(this,E).current==="x"?Math.abs(h)>Math.abs(u)&&Math.abs(h)>10&&(s=Math.sign(h)):t(this,E).current==="y"&&Math.abs(u)>Math.abs(h)&&Math.abs(u)>10&&(s=Math.sign(u))},()=>{s&&this.shift(s)})})}get counter(){return t(this,l)}get loop(){return t(this,S)}get autoplay(){return t(this,g)}get swipe(){return t(this,E)}get itemElements(){return t(this,z)}get groups(){return t(this,m)}get length(){return t(this,b)}addItem(e){f(this,o,R).call(this,e),f(this,o,B).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(f(this,o,B).call(this,e),f(this,o,_).call(this))}shift(e){this.set(t(this,l)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(s=>{f(this,o,R).call(this,s)}),t(this,m).forEach(s=>{var r;(r=s[0])==null||r.classList.add("current")}),t(this,g).subscribe(s=>{s.current?(P.intersector.subscribe(this,t(this,T)),f(this,o,_).call(this)):(c(this,A,!0),P.intersector.unsubscribe(t(this,T)),clearInterval(t(this,C)),f(this,o,B).call(this,0))}),t(this,g).observe(),t(this,E).observe(),t(this,S).observe(),t(this,I).observe(),f(this,o,B).call(this,0),this.addEventListener("pointerdown",t(this,G))}disconnectedCallback(){t(this,g).unobserve(),t(this,E).unobserve(),t(this,S).unobserve(),t(this,I).unobserve(),t(this,m).clear(),P.intersector.unsubscribe(t(this,T)),clearInterval(t(this,C))}}I=new WeakMap,S=new WeakMap,g=new WeakMap,E=new WeakMap,C=new WeakMap,A=new WeakMap,z=new WeakMap,m=new WeakMap,l=new WeakMap,b=new WeakMap,o=new WeakSet,R=function(e){t(this,z).push(e);const s=e.getAttribute("data-billboard-item-group")||"default";let r=t(this,m).get(s);r||(r=[],t(this,m).set(s,r)),r.push(e),c(this,b,0),t(this,m).forEach(h=>{h.length>t(this,b)&&c(this,b,h.length)})},_=function(){t(this,g).current!==!1&&t(this,j).call(this)},T=new WeakMap,j=new WeakMap,B=function(e=t(this,l)){const s=t(this,l);t(this,S).current?c(this,l,W.loopNumber(e,t(this,b))):c(this,l,st.clamp(e,0,t(this,b)-1)),this.classList.remove("forward","backward"),t(this,l)-s>=0?this.classList.add("forward"):t(this,l)-s<0&&this.classList.add("backward"),t(this,m).forEach(r=>{r.forEach((h,u)=>{h.classList.remove("current","previous","next","previous-sibling","next-sibling"),u===t(this,l)?h.classList.add("current"):u<t(this,l)?h.classList.add("previous"):u>t(this,l)&&h.classList.add("next"),u===W.loopNumber(t(this,l)-1,this.length)?h.classList.add("previous-sibling"):u===(t(this,l)+1)%this.length&&h.classList.add("next-sibling")})}),this.classList.toggle("has-length",t(this,b)>1),this.classList.toggle("start",t(this,l)===0),this.classList.toggle("end",t(this,l)===t(this,b)-1),this.style.setProperty("--counter",t(this,l).toString()),this.style.setProperty("--sections",t(this,b).toString()),t(this,l)!==s&&(tt.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,l)}}),t(this,I).current&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0))},F=new WeakMap,G=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",$);var p,q,v,N,D;class X extends HTMLElement{constructor(){super(...arguments);i(this,p,null);i(this,q,null);i(this,v,[]);i(this,N,e=>{const s=e.currentTarget,r=t(this,v).findIndex(h=>h===s);r>=0&&t(this,p).set(r)});i(this,D,()=>{t(this,v).forEach((e,s)=>{s===t(this,p).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return Q(this,null,function*(){var e;if(c(this,p,U.findParentElement(this,$)),t(this,p)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){this.innerHTML="";const s=t(this,p).length;c(this,q,document.createElement("div"));for(let r=0;r<s;r++){const h=document.createElement("button");h.setAttribute("aria-label",`Go to item ${r+1}`),t(this,v).push(h),t(this,q).appendChild(h)}this.appendChild(t(this,q)),t(this,v).forEach(r=>{r.addEventListener("click",t(this,N))}),(e=t(this,p))==null||e.addEventListener("billboardChange",t(this,D)),t(this,D).call(this)}})}disconnectedCallback(){var e;t(this,v).forEach(s=>{s.removeEventListener("click",t(this,N))}),(e=t(this,p))==null||e.removeEventListener("billboardChange",t(this,D)),this.innerHTML="",c(this,v,[])}}p=new WeakMap,q=new WeakMap,v=new WeakMap,N=new WeakMap,D=new WeakMap;P.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",X);var L,w,y;class Y extends HTMLElement{constructor(){super();i(this,L,new M.CSSProperty(this,"--index",0));i(this,w,null);i(this,y,()=>{var e;t(this,L).current===((e=t(this,w))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,w)&&(!this.handleClick||this.handleClick(e))&&t(this,w).set(t(this,L).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){var e;this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),c(this,w,U.findParentElement(this,$)),(e=t(this,w))==null||e.addEventListener("billboardChange",t(this,y)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,y).call(this)}),t(this,L).subscribe(t(this,y)),t(this,L).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,L).unsubscribe(t(this,y)),t(this,L).unobserve(),(e=t(this,w))==null||e.removeEventListener("billboardChange",t(this,y))}}L=new WeakMap,w=new WeakMap,y=new WeakMap;P.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",Y);var x,d,H;class Z extends HTMLElement{constructor(){super();i(this,x,new M.CSSProperty(this,"--step",1));i(this,d,null);i(this,H,()=>{t(this,d)&&(!t(this,d).loop.current&&(t(this,d).counter===0&&t(this,x).current<=0||t(this,d).counter===t(this,d).length-1&&t(this,x).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,d)&&(!this.handleClick||this.handleClick(e))&&t(this,d).shift(t(this,x).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return Q(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),t(this,x).observe(),this.tabIndex=0,c(this,d,U.findParentElement(this,$)),(e=t(this,d))==null||e.addEventListener("billboardChange",t(this,H)),setTimeout(()=>{t(this,H).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,x).unobserve(),(e=t(this,d))==null||e.removeEventListener("billboardChange",t(this,H))}}x=new WeakMap,d=new WeakMap,H=new WeakMap;P.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",Z);exports.BillboardBulletsElement=X;exports.BillboardElement=$;exports.BillboardSetButtonElement=Y;exports.BillboardStepButtonElement=Z;
1
+ "use strict";var W=n=>{throw TypeError(n)};var Q=(n,l,e)=>l.has(n)||W("Cannot "+e);var t=(n,l,e)=>(Q(n,l,"read from private field"),e?e.call(n):l.get(n)),i=(n,l,e)=>l.has(n)?W("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,e),c=(n,l,e,s)=>(Q(n,l,"write to private field"),s?s.call(n,e):l.set(n,e),e),d=(n,l,e)=>(Q(n,l,"access private method"),e);var F=(n,l,e)=>new Promise((s,r)=>{var o=g=>{try{x(e.next(g))}catch(N){r(N)}},f=g=>{try{x(e.throw(g))}catch(N){r(N)}},x=g=>g.done?s(g.value):Promise.resolve(g.value).then(o,f);x((e=e.apply(n,l)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../index-DekP7OZe.cjs"),V=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const P=require("../css-property/index.cjs"),et=require("../events-KVanG9sR.cjs"),st=require("../gestures-C7gbKx11.cjs"),it=require("../math-GDWEqu7y.cjs"),X=require("../number-DyefJ5a1.cjs");var T,A,v,E,y,B,$,m,h,b,a,R,G,q,O,U,M,J,K;class j extends HTMLElement{constructor(){super(...arguments);i(this,a);i(this,T,new P.CSSProperty(this,"--resize",!0));i(this,A,new P.CSSProperty(this,"--loop",!0));i(this,v,new P.CSSProperty(this,"--autoplay",!1));i(this,E,new P.CSSProperty(this,"--swipe","x"));i(this,y);i(this,B,!1);i(this,$,[]);i(this,m,new Map);i(this,h,0);i(this,b,0);i(this,q,e=>{c(this,B,e.isIntersecting),t(this,B)?d(this,a,G).call(this):clearInterval(t(this,y))});i(this,O,()=>{clearInterval(t(this,y)),t(this,B)&&c(this,y,setInterval(t(this,J),parseFloat(t(this,v).current||"0")*1e3))});i(this,J,()=>{d(this,a,M).call(this,t(this,h)+1)});i(this,K,e=>{if(!t(this,E).current)return;let s=0;st.setupDrag(r=>{const o=e.x-r.x,f=e.y-r.y;t(this,E).current==="x"?Math.abs(o)>Math.abs(f)&&Math.abs(o)>10&&(s=Math.sign(o)):t(this,E).current==="y"&&Math.abs(f)>Math.abs(o)&&Math.abs(f)>10&&(s=Math.sign(f))},()=>{s&&this.shift(s)})})}get counter(){return t(this,h)}get loop(){return t(this,A)}get autoplay(){return t(this,v)}get swipe(){return t(this,E)}get itemElements(){return t(this,$)}get groups(){return t(this,m)}get length(){return t(this,b)}addItem(e){d(this,a,R).call(this,e),d(this,a,M).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(d(this,a,M).call(this,e),d(this,a,G).call(this))}shift(e){this.set(t(this,h)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(s=>{d(this,a,R).call(this,s)}),t(this,m).forEach(s=>{var r;(r=s[0])==null||r.classList.add("current")}),t(this,v).subscribe(s=>{s.current?(I.intersector.subscribe(this,t(this,q)),d(this,a,G).call(this)):(c(this,B,!0),I.intersector.unsubscribe(t(this,q)),clearInterval(t(this,y)),d(this,a,M).call(this,0))}),t(this,v).observe(),t(this,E).observe(),t(this,A).observe(),t(this,T).observe(),d(this,a,M).call(this,0),this.addEventListener("pointerdown",t(this,K))}disconnectedCallback(){t(this,v).unobserve(),t(this,E).unobserve(),t(this,A).unobserve(),t(this,T).unobserve(),t(this,m).clear(),I.intersector.unsubscribe(t(this,q)),clearInterval(t(this,y))}}T=new WeakMap,A=new WeakMap,v=new WeakMap,E=new WeakMap,y=new WeakMap,B=new WeakMap,$=new WeakMap,m=new WeakMap,h=new WeakMap,b=new WeakMap,a=new WeakSet,R=function(e){t(this,$).push(e);const s=e.getAttribute("data-billboard-item-group")||"default";let r=t(this,m).get(s);r||(r=[],t(this,m).set(s,r)),r.push(e),c(this,b,0),t(this,m).forEach(o=>{o.length>t(this,b)&&c(this,b,o.length)})},G=function(){t(this,v).current!==!1&&t(this,O).call(this)},q=new WeakMap,O=new WeakMap,U=function(e,s){e.classList.remove("current","previous","next","previous-sibling","next-sibling"),s===t(this,h)?e.classList.add("current"):s<t(this,h)?e.classList.add("previous"):s>t(this,h)&&e.classList.add("next"),s===X.loopNumber(t(this,h)-1,this.length)?e.classList.add("previous-sibling"):s===(t(this,h)+1)%this.length&&e.classList.add("next-sibling")},M=function(){return F(this,arguments,function*(e=t(this,h)){const s=t(this,h);t(this,A).current?c(this,h,X.loopNumber(e,t(this,b))):c(this,h,it.clamp(e,0,t(this,b)-1)),this.classList.remove("forward","backward"),t(this,h)-s>=0?this.classList.add("forward"):t(this,h)-s<0&&this.classList.add("backward");let r=[];t(this,m).forEach(o=>{o.forEach((f,x)=>{const g=f.classList.contains("visited");x===t(this,h)&&!g?(f.classList.add("visited"),r.push(new Promise(N=>{setTimeout(()=>{d(this,a,U).call(this,f,x),N()},0)}))):d(this,a,U).call(this,f,x)})}),r.length&&(yield Promise.all(r)),this.classList.toggle("has-length",t(this,b)>1),this.classList.toggle("start",t(this,h)===0),this.classList.toggle("end",t(this,h)===t(this,b)-1),this.style.setProperty("--counter",t(this,h).toString()),this.style.setProperty("--sections",t(this,b).toString()),t(this,h)!==s&&(et.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,h)}}),t(this,T).current&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0))})},J=new WeakMap,K=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",j);var p,D,L,_,H;class Y extends HTMLElement{constructor(){super(...arguments);i(this,p,null);i(this,D,null);i(this,L,[]);i(this,_,e=>{const s=e.currentTarget,r=t(this,L).findIndex(o=>o===s);r>=0&&t(this,p).set(r)});i(this,H,()=>{t(this,L).forEach((e,s)=>{s===t(this,p).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return F(this,null,function*(){var e;if(c(this,p,V.findParentElement(this,j)),t(this,p)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){this.innerHTML="";const s=t(this,p).length;c(this,D,document.createElement("div"));for(let r=0;r<s;r++){const o=document.createElement("button");o.setAttribute("aria-label",`Go to item ${r+1}`),t(this,L).push(o),t(this,D).appendChild(o)}this.appendChild(t(this,D)),t(this,L).forEach(r=>{r.addEventListener("click",t(this,_))}),(e=t(this,p))==null||e.addEventListener("billboardChange",t(this,H)),t(this,H).call(this)}})}disconnectedCallback(){var e;t(this,L).forEach(s=>{s.removeEventListener("click",t(this,_))}),(e=t(this,p))==null||e.removeEventListener("billboardChange",t(this,H)),this.innerHTML="",c(this,L,[])}}p=new WeakMap,D=new WeakMap,L=new WeakMap,_=new WeakMap,H=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",Y);var w,C,k;class Z extends HTMLElement{constructor(){super();i(this,w,new P.CSSProperty(this,"--index",0));i(this,C,null);i(this,k,()=>{var e;t(this,w).current===((e=t(this,C))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,C)&&(!this.handleClick||this.handleClick(e))&&t(this,C).set(t(this,w).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){var e;this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),c(this,C,V.findParentElement(this,j)),(e=t(this,C))==null||e.addEventListener("billboardChange",t(this,k)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,k).call(this)}),t(this,w).subscribe(t(this,k)),t(this,w).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,w).unsubscribe(t(this,k)),t(this,w).unobserve(),(e=t(this,C))==null||e.removeEventListener("billboardChange",t(this,k))}}w=new WeakMap,C=new WeakMap,k=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",Z);var S,u,z;class tt extends HTMLElement{constructor(){super();i(this,S,new P.CSSProperty(this,"--step",1));i(this,u,null);i(this,z,()=>{t(this,u)&&(!t(this,u).loop.current&&(t(this,u).counter===0&&t(this,S).current<=0||t(this,u).counter===t(this,u).length-1&&t(this,S).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,u)&&(!this.handleClick||this.handleClick(e))&&t(this,u).shift(t(this,S).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return F(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),t(this,S).observe(),this.tabIndex=0,c(this,u,V.findParentElement(this,j)),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,z)),setTimeout(()=>{t(this,z).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,S).unobserve(),(e=t(this,u))==null||e.removeEventListener("billboardChange",t(this,z))}}S=new WeakMap,u=new WeakMap,z=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",tt);exports.BillboardBulletsElement=Y;exports.BillboardElement=j;exports.BillboardSetButtonElement=Z;exports.BillboardStepButtonElement=tt;
@@ -1,67 +1,67 @@
1
- var X = (n) => {
1
+ var Y = (n) => {
2
2
  throw TypeError(n);
3
3
  };
4
- var O = (n, a, e) => a.has(n) || X("Cannot " + e);
5
- var t = (n, a, e) => (O(n, a, "read from private field"), e ? e.call(n) : a.get(n)), i = (n, a, e) => a.has(n) ? X("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(n) : a.set(n, e), c = (n, a, e, s) => (O(n, a, "write to private field"), s ? s.call(n, e) : a.set(n, e), e), f = (n, a, e) => (O(n, a, "access private method"), e);
6
- var Q = (n, a, e) => new Promise((s, r) => {
7
- var h = (y) => {
4
+ var Q = (n, l, e) => l.has(n) || Y("Cannot " + e);
5
+ var t = (n, l, e) => (Q(n, l, "read from private field"), e ? e.call(n) : l.get(n)), i = (n, l, e) => l.has(n) ? Y("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(n) : l.set(n, e), c = (n, l, e, s) => (Q(n, l, "write to private field"), s ? s.call(n, e) : l.set(n, e), e), d = (n, l, e) => (Q(n, l, "access private method"), e);
6
+ var F = (n, l, e) => new Promise((s, r) => {
7
+ var o = (g) => {
8
8
  try {
9
- J(e.next(y));
10
- } catch (K) {
11
- r(K);
9
+ A(e.next(g));
10
+ } catch ($) {
11
+ r($);
12
12
  }
13
- }, b = (y) => {
13
+ }, f = (g) => {
14
14
  try {
15
- J(e.throw(y));
16
- } catch (K) {
17
- r(K);
15
+ A(e.throw(g));
16
+ } catch ($) {
17
+ r($);
18
18
  }
19
- }, J = (y) => y.done ? s(y.value) : Promise.resolve(y.value).then(h, b);
20
- J((e = e.apply(n, a)).next());
19
+ }, A = (g) => g.done ? s(g.value) : Promise.resolve(g.value).then(o, f);
20
+ A((e = e.apply(n, l)).next());
21
21
  });
22
- import { a as R, i as V } from "../index-Bv9zgfdb.js";
23
- import { b as W } from "../dom-CVWzyXPH.js";
22
+ import { a as R, i as W } from "../index-Bv9zgfdb.js";
23
+ import { b as X } from "../dom-CVWzyXPH.js";
24
24
  import "construct-style-sheets-polyfill";
25
- import { CSSProperty as S } from "../css-property/index.js";
26
- import { d as Z } from "../events-CsVF98U6.js";
27
- import { s as _ } from "../gestures-CcXV6fCp.js";
28
- import { c as tt } from "../math-BOBiC4TN.js";
29
- import { l as Y } from "../number-CbdpfO3u.js";
30
- var T, A, g, v, k, M, z, m, l, u, o, U, N, B, q, I, F, G;
31
- class j extends HTMLElement {
25
+ import { CSSProperty as T } from "../css-property/index.js";
26
+ import { d as _ } from "../events-CsVF98U6.js";
27
+ import { s as tt } from "../gestures-CcXV6fCp.js";
28
+ import { c as et } from "../math-BOBiC4TN.js";
29
+ import { l as Z } from "../number-CbdpfO3u.js";
30
+ var B, M, v, E, C, I, N, m, h, u, a, U, G, D, j, V, S, J, K;
31
+ class O extends HTMLElement {
32
32
  constructor() {
33
33
  super(...arguments);
34
- i(this, o);
35
- i(this, T, new S(this, "--resize", !0));
36
- i(this, A, new S(this, "--loop", !0));
37
- i(this, g, new S(this, "--autoplay", !1));
38
- i(this, v, new S(this, "--swipe", "x"));
39
- i(this, k);
40
- i(this, M, !1);
41
- i(this, z, []);
34
+ i(this, a);
35
+ i(this, B, new T(this, "--resize", !0));
36
+ i(this, M, new T(this, "--loop", !0));
37
+ i(this, v, new T(this, "--autoplay", !1));
38
+ i(this, E, new T(this, "--swipe", "x"));
39
+ i(this, C);
40
+ i(this, I, !1);
41
+ i(this, N, []);
42
42
  i(this, m, /* @__PURE__ */ new Map());
43
- i(this, l, 0);
43
+ i(this, h, 0);
44
44
  i(this, u, 0);
45
- i(this, B, (e) => {
46
- c(this, M, e.isIntersecting), t(this, M) ? f(this, o, N).call(this) : clearInterval(t(this, k));
45
+ i(this, D, (e) => {
46
+ c(this, I, e.isIntersecting), t(this, I) ? d(this, a, G).call(this) : clearInterval(t(this, C));
47
47
  });
48
- i(this, q, () => {
49
- clearInterval(t(this, k)), t(this, M) && c(this, k, setInterval(
50
- t(this, F),
51
- parseFloat(t(this, g).current || "0") * 1e3
48
+ i(this, j, () => {
49
+ clearInterval(t(this, C)), t(this, I) && c(this, C, setInterval(
50
+ t(this, J),
51
+ parseFloat(t(this, v).current || "0") * 1e3
52
52
  ));
53
53
  });
54
- i(this, F, () => {
55
- f(this, o, I).call(this, t(this, l) + 1);
54
+ i(this, J, () => {
55
+ d(this, a, S).call(this, t(this, h) + 1);
56
56
  });
57
- i(this, G, (e) => {
58
- if (!t(this, v).current)
57
+ i(this, K, (e) => {
58
+ if (!t(this, E).current)
59
59
  return;
60
60
  let s = 0;
61
- _(
61
+ tt(
62
62
  (r) => {
63
- const h = e.x - r.x, b = e.y - r.y;
64
- t(this, v).current === "x" ? Math.abs(h) > Math.abs(b) && Math.abs(h) > 10 && (s = Math.sign(h)) : t(this, v).current === "y" && Math.abs(b) > Math.abs(h) && Math.abs(b) > 10 && (s = Math.sign(b));
63
+ const o = e.x - r.x, f = e.y - r.y;
64
+ t(this, E).current === "x" ? Math.abs(o) > Math.abs(f) && Math.abs(o) > 10 && (s = Math.sign(o)) : t(this, E).current === "y" && Math.abs(f) > Math.abs(o) && Math.abs(f) > 10 && (s = Math.sign(f));
65
65
  },
66
66
  () => {
67
67
  s && this.shift(s);
@@ -70,19 +70,19 @@ class j extends HTMLElement {
70
70
  });
71
71
  }
72
72
  get counter() {
73
- return t(this, l);
73
+ return t(this, h);
74
74
  }
75
75
  get loop() {
76
- return t(this, A);
76
+ return t(this, M);
77
77
  }
78
78
  get autoplay() {
79
- return t(this, g);
79
+ return t(this, v);
80
80
  }
81
81
  get swipe() {
82
- return t(this, v);
82
+ return t(this, E);
83
83
  }
84
84
  get itemElements() {
85
- return t(this, z);
85
+ return t(this, N);
86
86
  }
87
87
  get groups() {
88
88
  return t(this, m);
@@ -91,13 +91,13 @@ class j extends HTMLElement {
91
91
  return t(this, u);
92
92
  }
93
93
  addItem(e) {
94
- f(this, o, U).call(this, e), f(this, o, I).call(this);
94
+ d(this, a, U).call(this, e), d(this, a, S).call(this);
95
95
  }
96
96
  set(e) {
97
- (!this.handleSet || this.handleSet(e)) && (f(this, o, I).call(this, e), f(this, o, N).call(this));
97
+ (!this.handleSet || this.handleSet(e)) && (d(this, a, S).call(this, e), d(this, a, G).call(this));
98
98
  }
99
99
  shift(e) {
100
- this.set(t(this, l) + e);
100
+ this.set(t(this, h) + e);
101
101
  }
102
102
  connectedCallback() {
103
103
  [
@@ -105,171 +105,184 @@ class j extends HTMLElement {
105
105
  `[data-billboard-item${this.id ? `="${this.id}"` : ""}]`
106
106
  )
107
107
  ].forEach((s) => {
108
- f(this, o, U).call(this, s);
108
+ d(this, a, U).call(this, s);
109
109
  }), t(this, m).forEach((s) => {
110
110
  var r;
111
111
  (r = s[0]) == null || r.classList.add("current");
112
- }), t(this, g).subscribe((s) => {
113
- s.current ? (R.subscribe(this, t(this, B)), f(this, o, N).call(this)) : (c(this, M, !0), R.unsubscribe(t(this, B)), clearInterval(t(this, k)), f(this, o, I).call(this, 0));
114
- }), t(this, g).observe(), t(this, v).observe(), t(this, A).observe(), t(this, T).observe(), f(this, o, I).call(this, 0), this.addEventListener("pointerdown", t(this, G));
112
+ }), t(this, v).subscribe((s) => {
113
+ s.current ? (R.subscribe(this, t(this, D)), d(this, a, G).call(this)) : (c(this, I, !0), R.unsubscribe(t(this, D)), clearInterval(t(this, C)), d(this, a, S).call(this, 0));
114
+ }), t(this, v).observe(), t(this, E).observe(), t(this, M).observe(), t(this, B).observe(), d(this, a, S).call(this, 0), this.addEventListener("pointerdown", t(this, K));
115
115
  }
116
116
  disconnectedCallback() {
117
- t(this, g).unobserve(), t(this, v).unobserve(), t(this, A).unobserve(), t(this, T).unobserve(), t(this, m).clear(), R.unsubscribe(t(this, B)), clearInterval(t(this, k));
117
+ t(this, v).unobserve(), t(this, E).unobserve(), t(this, M).unobserve(), t(this, B).unobserve(), t(this, m).clear(), R.unsubscribe(t(this, D)), clearInterval(t(this, C));
118
118
  }
119
119
  }
120
- T = new WeakMap(), A = new WeakMap(), g = new WeakMap(), v = new WeakMap(), k = new WeakMap(), M = new WeakMap(), z = new WeakMap(), m = new WeakMap(), l = new WeakMap(), u = new WeakMap(), o = new WeakSet(), U = function(e) {
121
- t(this, z).push(e);
120
+ B = new WeakMap(), M = new WeakMap(), v = new WeakMap(), E = new WeakMap(), C = new WeakMap(), I = new WeakMap(), N = new WeakMap(), m = new WeakMap(), h = new WeakMap(), u = new WeakMap(), a = new WeakSet(), U = function(e) {
121
+ t(this, N).push(e);
122
122
  const s = e.getAttribute("data-billboard-item-group") || "default";
123
123
  let r = t(this, m).get(s);
124
- r || (r = [], t(this, m).set(s, r)), r.push(e), c(this, u, 0), t(this, m).forEach((h) => {
125
- h.length > t(this, u) && c(this, u, h.length);
124
+ r || (r = [], t(this, m).set(s, r)), r.push(e), c(this, u, 0), t(this, m).forEach((o) => {
125
+ o.length > t(this, u) && c(this, u, o.length);
126
126
  });
127
- }, N = function() {
128
- t(this, g).current !== !1 && t(this, q).call(this);
129
- }, B = new WeakMap(), q = new WeakMap(), I = function(e = t(this, l)) {
130
- const s = t(this, l);
131
- t(this, A).current ? c(this, l, Y(e, t(this, u))) : c(this, l, tt(e, 0, t(this, u) - 1)), this.classList.remove("forward", "backward"), t(this, l) - s >= 0 ? this.classList.add("forward") : t(this, l) - s < 0 && this.classList.add("backward"), t(this, m).forEach((r) => {
132
- r.forEach((h, b) => {
133
- h.classList.remove(
134
- "current",
135
- "previous",
136
- "next",
137
- "previous-sibling",
138
- "next-sibling"
139
- ), b === t(this, l) ? h.classList.add("current") : b < t(this, l) ? h.classList.add("previous") : b > t(this, l) && h.classList.add("next"), b === Y(t(this, l) - 1, this.length) ? h.classList.add("previous-sibling") : b === (t(this, l) + 1) % this.length && h.classList.add("next-sibling");
140
- });
141
- }), this.classList.toggle("has-length", t(this, u) > 1), this.classList.toggle("start", t(this, l) === 0), this.classList.toggle("end", t(this, l) === t(this, u) - 1), this.style.setProperty("--counter", t(this, l).toString()), this.style.setProperty("--sections", t(this, u).toString()), t(this, l) !== s && (Z(this, "billboardChange", {
142
- detail: {
143
- counter: t(this, l)
144
- }
145
- }), t(this, T).current && setTimeout(() => {
146
- window.dispatchEvent(new Event("resize"));
147
- }, 0));
148
- }, F = new WeakMap(), G = new WeakMap();
149
- customElements.get("e-billboard") || customElements.define("e-billboard", j);
150
- var p, D, E, $, H;
151
- class et extends HTMLElement {
127
+ }, G = function() {
128
+ t(this, v).current !== !1 && t(this, j).call(this);
129
+ }, D = new WeakMap(), j = new WeakMap(), V = function(e, s) {
130
+ e.classList.remove(
131
+ "current",
132
+ "previous",
133
+ "next",
134
+ "previous-sibling",
135
+ "next-sibling"
136
+ ), s === t(this, h) ? e.classList.add("current") : s < t(this, h) ? e.classList.add("previous") : s > t(this, h) && e.classList.add("next"), s === Z(t(this, h) - 1, this.length) ? e.classList.add("previous-sibling") : s === (t(this, h) + 1) % this.length && e.classList.add("next-sibling");
137
+ }, S = function() {
138
+ return F(this, arguments, function* (e = t(this, h)) {
139
+ const s = t(this, h);
140
+ t(this, M).current ? c(this, h, Z(e, t(this, u))) : c(this, h, et(e, 0, t(this, u) - 1)), this.classList.remove("forward", "backward"), t(this, h) - s >= 0 ? this.classList.add("forward") : t(this, h) - s < 0 && this.classList.add("backward");
141
+ let r = [];
142
+ t(this, m).forEach((o) => {
143
+ o.forEach((f, A) => {
144
+ const g = f.classList.contains("visited");
145
+ A === t(this, h) && !g ? (f.classList.add("visited"), r.push(
146
+ new Promise(($) => {
147
+ setTimeout(() => {
148
+ d(this, a, V).call(this, f, A), $();
149
+ }, 0);
150
+ })
151
+ )) : d(this, a, V).call(this, f, A);
152
+ });
153
+ }), r.length && (yield Promise.all(r)), this.classList.toggle("has-length", t(this, u) > 1), this.classList.toggle("start", t(this, h) === 0), this.classList.toggle("end", t(this, h) === t(this, u) - 1), this.style.setProperty("--counter", t(this, h).toString()), this.style.setProperty("--sections", t(this, u).toString()), t(this, h) !== s && (_(this, "billboardChange", {
154
+ detail: {
155
+ counter: t(this, h)
156
+ }
157
+ }), t(this, B).current && setTimeout(() => {
158
+ window.dispatchEvent(new Event("resize"));
159
+ }, 0));
160
+ });
161
+ }, J = new WeakMap(), K = new WeakMap();
162
+ customElements.get("e-billboard") || customElements.define("e-billboard", O);
163
+ var p, H, L, q, P;
164
+ class st extends HTMLElement {
152
165
  constructor() {
153
166
  super(...arguments);
154
167
  i(this, p, null);
155
- i(this, D, null);
156
- i(this, E, []);
157
- i(this, $, (e) => {
158
- const s = e.currentTarget, r = t(this, E).findIndex((h) => h === s);
168
+ i(this, H, null);
169
+ i(this, L, []);
170
+ i(this, q, (e) => {
171
+ const s = e.currentTarget, r = t(this, L).findIndex((o) => o === s);
159
172
  r >= 0 && t(this, p).set(r);
160
173
  });
161
- i(this, H, () => {
162
- t(this, E).forEach((e, s) => {
174
+ i(this, P, () => {
175
+ t(this, L).forEach((e, s) => {
163
176
  s === t(this, p).counter ? e.classList.add("current") : e.classList.remove("current");
164
177
  });
165
178
  });
166
179
  }
167
180
  connectedCallback() {
168
- return Q(this, null, function* () {
181
+ return F(this, null, function* () {
169
182
  var e;
170
- if (c(this, p, W(this, j)), t(this, p) && (yield customElements.whenDefined("e-billboard"), this.isConnected)) {
183
+ if (c(this, p, X(this, O)), t(this, p) && (yield customElements.whenDefined("e-billboard"), this.isConnected)) {
171
184
  this.innerHTML = "";
172
185
  const s = t(this, p).length;
173
- c(this, D, document.createElement("div"));
186
+ c(this, H, document.createElement("div"));
174
187
  for (let r = 0; r < s; r++) {
175
- const h = document.createElement("button");
176
- h.setAttribute("aria-label", `Go to item ${r + 1}`), t(this, E).push(h), t(this, D).appendChild(h);
188
+ const o = document.createElement("button");
189
+ o.setAttribute("aria-label", `Go to item ${r + 1}`), t(this, L).push(o), t(this, H).appendChild(o);
177
190
  }
178
- this.appendChild(t(this, D)), t(this, E).forEach((r) => {
179
- r.addEventListener("click", t(this, $));
191
+ this.appendChild(t(this, H)), t(this, L).forEach((r) => {
192
+ r.addEventListener("click", t(this, q));
180
193
  }), (e = t(this, p)) == null || e.addEventListener(
181
194
  "billboardChange",
182
- t(this, H)
183
- ), t(this, H).call(this);
195
+ t(this, P)
196
+ ), t(this, P).call(this);
184
197
  }
185
198
  });
186
199
  }
187
200
  disconnectedCallback() {
188
201
  var e;
189
- t(this, E).forEach((s) => {
190
- s.removeEventListener("click", t(this, $));
202
+ t(this, L).forEach((s) => {
203
+ s.removeEventListener("click", t(this, q));
191
204
  }), (e = t(this, p)) == null || e.removeEventListener(
192
205
  "billboardChange",
193
- t(this, H)
194
- ), this.innerHTML = "", c(this, E, []);
206
+ t(this, P)
207
+ ), this.innerHTML = "", c(this, L, []);
195
208
  }
196
209
  }
197
- p = new WeakMap(), D = new WeakMap(), E = new WeakMap(), $ = new WeakMap(), H = new WeakMap();
198
- V && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", et);
199
- var L, w, x;
200
- class st extends HTMLElement {
210
+ p = new WeakMap(), H = new WeakMap(), L = new WeakMap(), q = new WeakMap(), P = new WeakMap();
211
+ W && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", st);
212
+ var w, k, x;
213
+ class it extends HTMLElement {
201
214
  constructor() {
202
215
  super();
203
- i(this, L, new S(this, "--index", 0));
204
- i(this, w, null);
216
+ i(this, w, new T(this, "--index", 0));
217
+ i(this, k, null);
205
218
  i(this, x, () => {
206
219
  var e;
207
- t(this, L).current === ((e = t(this, w)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
220
+ t(this, w).current === ((e = t(this, k)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
208
221
  });
209
222
  this.addEventListener("click", (e) => {
210
- t(this, w) && (!this.handleClick || this.handleClick(e)) && t(this, w).set(t(this, L).current);
223
+ t(this, k) && (!this.handleClick || this.handleClick(e)) && t(this, k).set(t(this, w).current);
211
224
  }), this.addEventListener("keydown", (e) => {
212
225
  e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
213
226
  });
214
227
  }
215
228
  connectedCallback() {
216
229
  var e;
217
- this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), c(this, w, W(this, j)), (e = t(this, w)) == null || e.addEventListener(
230
+ this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), c(this, k, X(this, O)), (e = t(this, k)) == null || e.addEventListener(
218
231
  "billboardChange",
219
232
  t(this, x)
220
233
  ), customElements.whenDefined("e-billboard").then(() => {
221
234
  this.isConnected && t(this, x).call(this);
222
- }), t(this, L).subscribe(t(this, x)), t(this, L).observe();
235
+ }), t(this, w).subscribe(t(this, x)), t(this, w).observe();
223
236
  }
224
237
  disconnectedCallback() {
225
238
  var e;
226
- this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, L).unsubscribe(t(this, x)), t(this, L).unobserve(), (e = t(this, w)) == null || e.removeEventListener(
239
+ this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, w).unsubscribe(t(this, x)), t(this, w).unobserve(), (e = t(this, k)) == null || e.removeEventListener(
227
240
  "billboardChange",
228
241
  t(this, x)
229
242
  );
230
243
  }
231
244
  }
232
- L = new WeakMap(), w = new WeakMap(), x = new WeakMap();
233
- V && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", st);
234
- var C, d, P;
235
- class it extends HTMLElement {
245
+ w = new WeakMap(), k = new WeakMap(), x = new WeakMap();
246
+ W && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", it);
247
+ var y, b, z;
248
+ class rt extends HTMLElement {
236
249
  constructor() {
237
250
  super();
238
- i(this, C, new S(this, "--step", 1));
239
- i(this, d, null);
240
- i(this, P, () => {
241
- t(this, d) && (!t(this, d).loop.current && (t(this, d).counter === 0 && t(this, C).current <= 0 || t(this, d).counter === t(this, d).length - 1 && t(this, C).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
251
+ i(this, y, new T(this, "--step", 1));
252
+ i(this, b, null);
253
+ i(this, z, () => {
254
+ t(this, b) && (!t(this, b).loop.current && (t(this, b).counter === 0 && t(this, y).current <= 0 || t(this, b).counter === t(this, b).length - 1 && t(this, y).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
242
255
  });
243
256
  this.addEventListener("click", (e) => {
244
- t(this, d) && (!this.handleClick || this.handleClick(e)) && t(this, d).shift(t(this, C).current);
257
+ t(this, b) && (!this.handleClick || this.handleClick(e)) && t(this, b).shift(t(this, y).current);
245
258
  }), this.addEventListener("keydown", (e) => {
246
259
  e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
247
260
  });
248
261
  }
249
262
  connectedCallback() {
250
- return Q(this, null, function* () {
263
+ return F(this, null, function* () {
251
264
  var e;
252
- yield customElements.whenDefined("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), t(this, C).observe(), this.tabIndex = 0, c(this, d, W(this, j)), (e = t(this, d)) == null || e.addEventListener(
265
+ yield customElements.whenDefined("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), t(this, y).observe(), this.tabIndex = 0, c(this, b, X(this, O)), (e = t(this, b)) == null || e.addEventListener(
253
266
  "billboardChange",
254
- t(this, P)
267
+ t(this, z)
255
268
  ), setTimeout(() => {
256
- t(this, P).call(this);
269
+ t(this, z).call(this);
257
270
  }, 0);
258
271
  });
259
272
  }
260
273
  disconnectedCallback() {
261
274
  var e;
262
- this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, C).unobserve(), (e = t(this, d)) == null || e.removeEventListener(
275
+ this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, y).unobserve(), (e = t(this, b)) == null || e.removeEventListener(
263
276
  "billboardChange",
264
- t(this, P)
277
+ t(this, z)
265
278
  );
266
279
  }
267
280
  }
268
- C = new WeakMap(), d = new WeakMap(), P = new WeakMap();
269
- V && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", it);
281
+ y = new WeakMap(), b = new WeakMap(), z = new WeakMap();
282
+ W && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", rt);
270
283
  export {
271
- et as BillboardBulletsElement,
272
- j as BillboardElement,
273
- st as BillboardSetButtonElement,
274
- it as BillboardStepButtonElement
284
+ st as BillboardBulletsElement,
285
+ O as BillboardElement,
286
+ it as BillboardSetButtonElement,
287
+ rt as BillboardStepButtonElement
275
288
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.65.2",
3
+ "version": "0.65.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"