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