aptechka 0.69.6 → 0.69.8
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.
- package/lib/{SourceElement-DJtFrWOz.js → SourceElement-CvsoT5yg.js} +18 -18
- package/lib/{SourceElement-DDhkg7kr.cjs → SourceElement-DX6W2-19.cjs} +2 -2
- package/lib/billboard/BillboardElement.d.ts +1 -0
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +103 -99
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +1 -1
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +1 -1
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +1 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +1 -1
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var J = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var J = (o) => {
|
|
2
|
+
throw TypeError(o);
|
|
3
3
|
};
|
|
4
|
-
var N = (
|
|
5
|
-
var t = (
|
|
4
|
+
var N = (o, n, e) => n.has(o) || J("Cannot " + e);
|
|
5
|
+
var t = (o, n, e) => (N(o, n, "read from private field"), e ? e.call(o) : n.get(o)), i = (o, n, e) => n.has(o) ? J("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(o) : n.set(o, e), s = (o, n, e, l) => (N(o, n, "write to private field"), l ? l.call(o, e) : n.set(o, e), e), F = (o, n, e) => (N(o, n, "access private method"), e);
|
|
6
6
|
import { ElementLinkedStore as Y } from "./element-linked-store/index.js";
|
|
7
7
|
import { i as tt } from "./index-Bv9zgfdb.js";
|
|
8
8
|
import { d as H } from "./events-CsVF98U6.js";
|
|
@@ -110,7 +110,7 @@ class nt extends it {
|
|
|
110
110
|
}
|
|
111
111
|
I = new WeakMap(), v = new WeakMap();
|
|
112
112
|
let ht = 0;
|
|
113
|
-
var m, r, y, E, p, C, A,
|
|
113
|
+
var m, r, y, E, p, C, A, a, M, R, q, V, $, j, _, z, G, B, P;
|
|
114
114
|
class yt extends HTMLElement {
|
|
115
115
|
constructor(e) {
|
|
116
116
|
super();
|
|
@@ -122,7 +122,7 @@ class yt extends HTMLElement {
|
|
|
122
122
|
i(this, p, !1);
|
|
123
123
|
i(this, C, "");
|
|
124
124
|
i(this, A, "");
|
|
125
|
-
i(this,
|
|
125
|
+
i(this, a, new Y(this, {
|
|
126
126
|
loading: !1,
|
|
127
127
|
loaded: !1,
|
|
128
128
|
error: !1,
|
|
@@ -138,20 +138,20 @@ class yt extends HTMLElement {
|
|
|
138
138
|
t(this, p) && (!t(this, E) || this.hasAttribute("reload-source")) && l.isIntersecting && this.triggerLazyLoad(), l.isIntersecting ? H(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (F(this, $, j).call(this, void 0), s(this, E, !1)), H(this, "sourceRelease", { custom: !0 }));
|
|
139
139
|
});
|
|
140
140
|
i(this, z, () => {
|
|
141
|
-
t(this,
|
|
141
|
+
t(this, a).set("loaded", !0), t(this, a).set("error", !1), t(this, a).set("loading", !1), !t(this, p) && !t(this, y) && W.complete(t(this, A)), H(this, "sourceLoaded", { custom: !0 });
|
|
142
142
|
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
143
143
|
e ? s(this, R, setTimeout(() => {
|
|
144
|
-
t(this,
|
|
145
|
-
}, parseFloat(e) * 1e3)) : t(this,
|
|
144
|
+
t(this, a).set("clear", !0);
|
|
145
|
+
}, parseFloat(e) * 1e3)) : t(this, a).set("clear", !0), s(this, y, !0);
|
|
146
146
|
});
|
|
147
147
|
i(this, G, (e) => {
|
|
148
|
-
t(this,
|
|
148
|
+
t(this, a).set("loaded", !1), t(this, a).set("error", !0), t(this, a).set("loading", !1), !t(this, p) && !t(this, y) && W.error(t(this, A)), H(this, "sourceError", { custom: !0 }), s(this, y, !0);
|
|
149
149
|
});
|
|
150
150
|
i(this, B, () => {
|
|
151
|
-
t(this,
|
|
151
|
+
t(this, a).set("playing", !0);
|
|
152
152
|
});
|
|
153
153
|
i(this, P, () => {
|
|
154
|
-
t(this,
|
|
154
|
+
t(this, a).set("playing", !1);
|
|
155
155
|
});
|
|
156
156
|
s(this, V, e == null ? void 0 : e.sourceSetOptions), tt && window.IntersectionObserver && s(this, M, new IntersectionObserver(
|
|
157
157
|
t(this, _)
|
|
@@ -164,7 +164,7 @@ class yt extends HTMLElement {
|
|
|
164
164
|
return t(this, m);
|
|
165
165
|
}
|
|
166
166
|
get status() {
|
|
167
|
-
return t(this,
|
|
167
|
+
return t(this, a);
|
|
168
168
|
}
|
|
169
169
|
get isLazy() {
|
|
170
170
|
return t(this, p);
|
|
@@ -181,7 +181,7 @@ class yt extends HTMLElement {
|
|
|
181
181
|
connectedCallback() {
|
|
182
182
|
s(this, C, `source-consumer-${++ht}`);
|
|
183
183
|
const e = this.getAttribute("srcset") || "", l = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
184
|
-
l && t(this,
|
|
184
|
+
l && t(this, a).addElement(l), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
|
|
185
185
|
display: block;
|
|
186
186
|
width: 100%;
|
|
187
187
|
height: 100%;
|
|
@@ -199,14 +199,14 @@ class yt extends HTMLElement {
|
|
|
199
199
|
}
|
|
200
200
|
disconnectedCallback() {
|
|
201
201
|
var e;
|
|
202
|
-
clearTimeout(t(this, R)), t(this, M).disconnect(), (e = t(this, m)) == null || e.close(), t(this, r) && (t(this, r).removeEventListener("play", t(this, B)), t(this, r).removeEventListener("pause", t(this, P)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).remove()), s(this, y, !1), s(this, E, !1), t(this,
|
|
202
|
+
clearTimeout(t(this, R)), t(this, M).disconnect(), (e = t(this, m)) == null || e.close(), t(this, r) && (t(this, r).removeEventListener("play", t(this, B)), t(this, r).removeEventListener("pause", t(this, P)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).remove()), s(this, y, !1), s(this, E, !1), t(this, a).reset();
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
m = new WeakMap(), r = new WeakMap(), y = new WeakMap(), E = new WeakMap(), p = new WeakMap(), C = new WeakMap(), A = new WeakMap(),
|
|
206
|
-
if (clearTimeout(t(this, R)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this,
|
|
205
|
+
m = new WeakMap(), r = new WeakMap(), y = new WeakMap(), E = new WeakMap(), p = new WeakMap(), C = new WeakMap(), A = new WeakMap(), a = new WeakMap(), M = new WeakMap(), R = new WeakMap(), q = new WeakMap(), V = new WeakMap(), $ = new WeakSet(), j = function(e) {
|
|
206
|
+
if (clearTimeout(t(this, R)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, a).set("loaded", !1), t(this, a).set("error", !1), t(this, a).set("loading", !1), t(this, a).set("clear", !1), t(this, a).set("playing", !1), e) {
|
|
207
207
|
s(this, A, `${t(this, C)}-${e.url}`);
|
|
208
208
|
const l = this.hasAttribute("keep-source-parameters");
|
|
209
|
-
t(this,
|
|
209
|
+
t(this, a).set("loading", !0), s(this, q, l ? e.url : e.name + e.extension), this.consumeSource(t(this, q)), !t(this, p) && !t(this, y) && W.add(t(this, A)), t(this, r).onloadeddata = () => {
|
|
210
210
|
t(this, z).call(this);
|
|
211
211
|
}, t(this, r).onload = () => {
|
|
212
212
|
t(this, z).call(this);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Q=
|
|
1
|
+
"use strict";var Q=o=>{throw TypeError(o)};var N=(o,n,e)=>n.has(o)||Q("Cannot "+e);var t=(o,n,e)=>(N(o,n,"read from private field"),e?e.call(o):n.get(o)),i=(o,n,e)=>n.has(o)?Q("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,e),s=(o,n,e,c)=>(N(o,n,"write to private field"),c?c.call(o,e):n.set(o,e),e),D=(o,n,e)=>(N(o,n,"access private method"),e);const et=require("./element-linked-store/index.cjs"),st=require("./index-DekP7OZe.cjs"),F=require("./events-KVanG9sR.cjs"),it=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");const W=require("./loading/index.cjs"),rt=require("./order/index.cjs"),X=require("./window-resizer/index.cjs"),nt=require("./Store-Cd1GlEmZ.cjs");var T,q,z,L,u,f,v;class Y{constructor(n){i(this,T);i(this,q);i(this,z);i(this,L);i(this,u);i(this,f);i(this,v);s(this,T,n);let e=n.split(".");const c=/\b\d{1,2}x\b/g,d=e.find(g=>g.match(c)&&parseInt(g));s(this,z,d?parseInt(d):1),d&&(e=e.slice(0,-1)),s(this,q,e.length>1?e.slice(0,-1).join("."):e.join("."));const l=/\d+max/g,x=/\d+min/g,P=/\d+mar/g,U=/\d+mir/g,K=e.find(g=>g.match(l)),h=e.find(g=>g.match(x)),E=e.find(g=>g.match(P)),J=e.find(g=>g.match(U));E?(s(this,u,parseInt(E)),s(this,f,"max"),s(this,L,`(max-aspect-ratio: ${t(this,u)})`)):J?(s(this,u,parseInt(J)),s(this,f,"max"),s(this,L,`(min-aspect-ratio: ${t(this,u)})`)):K?(s(this,u,parseInt(K)),s(this,f,"max"),s(this,L,`(max-width: ${t(this,u)}px)`)):h?(s(this,u,parseInt(h)),s(this,L,`(min-width: ${t(this,u)}px)`),s(this,f,"min")):(s(this,u,0),s(this,L,`(min-width: ${t(this,u)}px)`),s(this,f,"min")),s(this,q,t(this,q).replace(`.${t(this,u)}${t(this,f)}`,"")),s(this,v,e[e.length-1]===t(this,q)?"":"."+e[e.length-1]),s(this,v,t(this,v).replace(`.${t(this,u)}${t(this,f)}`,""))}get url(){return t(this,T)}get name(){return t(this,q)}get density(){return t(this,z)}get query(){return t(this,L)}get extension(){return t(this,v)}get queryType(){return t(this,f)}get queryValue(){return t(this,u)}}T=new WeakMap,q=new WeakMap,z=new WeakMap,L=new WeakMap,u=new WeakMap,f=new WeakMap,v=new WeakMap;var w;class Z{constructor(n,e){i(this,w);s(this,w,new Map);const c=(e==null?void 0:e.mediaBuckets)!==!1,d=typeof n=="string"?c?n.trim().split(",").map(h=>h.trim()).filter(h=>!!h):[n]:n,l=[];d.forEach(h=>{const E=new Y(h);l.push([E.query,E])});const x=l.filter(h=>h[1].queryType.includes("max")).sort((h,E)=>E[1].queryValue-h[1].queryValue),P=l.filter(h=>h[1].queryType.includes("min")&&h[1].queryValue!==0).sort((h,E)=>h[1].queryValue-E[1].queryValue),U=l.filter(h=>h[0]==="(min-width: 0px)");(U?[...U,...x,...P]:[...x,...P]).forEach(h=>{t(this,w).has(h[0])||t(this,w).set(h[0],[]),t(this,w).get(h[0]).push(h[1])})}get mediaBuckets(){return t(this,w)}}w=new WeakMap;var M,R;class tt extends nt.Store{constructor(e){super(void 0);i(this,M);i(this,R,()=>{let e;t(this,M).mediaBuckets.forEach((l,x)=>{matchMedia(x).matches&&(e=l)});let c,d=0;e==null||e.forEach(l=>{l.density>d&&l.density<=Math.max(devicePixelRatio,1)&&(d=l.density,c=l)}),e!=null&&e.length&&!c&&(c=e[0]),this.current=c});s(this,M,new Z(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,M,new Z(e.srcset,e.sourceSetOptions)),t(this,R).call(this)}close(){super.close(),this.disconnect()}connect(){X.windowResizer.subscribe(t(this,R),rt.RESIZE_ORDER.SOURCE_MANAGER),t(this,R).call(this)}disconnect(){X.windowResizer.unsubscribe(t(this,R))}}M=new WeakMap,R=new WeakMap;let ht=0;var m,r,y,b,p,O,k,a,A,I,S,C,$,H,j,V,G,B,_;class at extends HTMLElement{constructor(e){super();i(this,$);i(this,m,null);i(this,r,null);i(this,y,!1);i(this,b,!1);i(this,p,!1);i(this,O,"");i(this,k,"");i(this,a,new et.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1,playing:!1}));i(this,A,null);i(this,I);i(this,S,null);i(this,C);i(this,j,e=>{const c=e[0];t(this,p)&&(!t(this,b)||this.hasAttribute("reload-source"))&&c.isIntersecting&&this.triggerLazyLoad(),c.isIntersecting?F.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(D(this,$,H).call(this,void 0),s(this,b,!1)),F.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,V,()=>{t(this,a).set("loaded",!0),t(this,a).set("error",!1),t(this,a).set("loading",!1),!t(this,p)&&!t(this,y)&&W.loading.complete(t(this,k)),F.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,I,setTimeout(()=>{t(this,a).set("clear",!0)},parseFloat(e)*1e3)):t(this,a).set("clear",!0),s(this,y,!0)});i(this,G,e=>{t(this,a).set("loaded",!1),t(this,a).set("error",!0),t(this,a).set("loading",!1),!t(this,p)&&!t(this,y)&&W.loading.error(t(this,k)),F.dispatchEvent(this,"sourceError",{custom:!0}),s(this,y,!0)});i(this,B,()=>{t(this,a).set("playing",!0)});i(this,_,()=>{t(this,a).set("playing",!1)});s(this,C,e==null?void 0:e.sourceSetOptions),st.isBrowser&&window.IntersectionObserver&&s(this,A,new IntersectionObserver(t(this,j)))}get consumerElement(){return t(this,r)}get sourceManager(){return t(this,m)}get status(){return t(this,a)}get isLazy(){return t(this,p)}get currentURL(){return t(this,S)}get isFirstLoadHappened(){return t(this,y)}triggerLazyLoad(){!t(this,b)&&t(this,m).current&&t(this,m).current!==t(this,m).previous&&(s(this,b,!0),D(this,$,H).call(this,t(this,m).current))}connectedCallback(){s(this,O,`source-consumer-${++ht}`);const e=this.getAttribute("srcset")||"",c=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;c&&t(this,a).addElement(c),s(this,r,this.createConsumer()),t(this,r).style.cssText=`
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
|
-
`,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,B)),t(this,r).addEventListener("pause",t(this,_)),Array.from(this.attributes).forEach(d=>{if(d.name!=="srcset"){const l=d.nodeValue||"",x=it.kebabToCamel(d.name);x in t(this,r)&&(t(this,r)[x]=l||!0)}}),this.appendChild(t(this,r)),s(this,m,new tt({srcset:e,sourceSetOptions:t(this,C)})),s(this,p,this.hasAttribute("lazy")),t(this,m).subscribe(d=>{(!t(this,p)||t(this,p)&&t(this,b))&&D(this,$,H).call(this,d.current)}),t(this,m).connect(),t(this,A).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,I)),t(this,A).disconnect(),(e=t(this,m))==null||e.close(),t(this,r)&&(t(this,r).removeEventListener("play",t(this,B)),t(this,r).removeEventListener("pause",t(this,_)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).remove()),s(this,y,!1),s(this,b,!1),t(this,
|
|
5
|
+
`,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,B)),t(this,r).addEventListener("pause",t(this,_)),Array.from(this.attributes).forEach(d=>{if(d.name!=="srcset"){const l=d.nodeValue||"",x=it.kebabToCamel(d.name);x in t(this,r)&&(t(this,r)[x]=l||!0)}}),this.appendChild(t(this,r)),s(this,m,new tt({srcset:e,sourceSetOptions:t(this,C)})),s(this,p,this.hasAttribute("lazy")),t(this,m).subscribe(d=>{(!t(this,p)||t(this,p)&&t(this,b))&&D(this,$,H).call(this,d.current)}),t(this,m).connect(),t(this,A).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,I)),t(this,A).disconnect(),(e=t(this,m))==null||e.close(),t(this,r)&&(t(this,r).removeEventListener("play",t(this,B)),t(this,r).removeEventListener("pause",t(this,_)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).remove()),s(this,y,!1),s(this,b,!1),t(this,a).reset()}}m=new WeakMap,r=new WeakMap,y=new WeakMap,b=new WeakMap,p=new WeakMap,O=new WeakMap,k=new WeakMap,a=new WeakMap,A=new WeakMap,I=new WeakMap,S=new WeakMap,C=new WeakMap,$=new WeakSet,H=function(e){if(clearTimeout(t(this,I)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,a).set("loaded",!1),t(this,a).set("error",!1),t(this,a).set("loading",!1),t(this,a).set("clear",!1),t(this,a).set("playing",!1),e){s(this,k,`${t(this,O)}-${e.url}`);const c=this.hasAttribute("keep-source-parameters");t(this,a).set("loading",!0),s(this,S,c?e.url:e.name+e.extension),this.consumeSource(t(this,S)),!t(this,p)&&!t(this,y)&&W.loading.add(t(this,k)),t(this,r).onloadeddata=()=>{t(this,V).call(this)},t(this,r).onload=()=>{t(this,V).call(this)},t(this,r).onerror=()=>{t(this,G).call(this,t(this,S))}}else s(this,S,null),this.consumeSource(null)},j=new WeakMap,V=new WeakMap,G=new WeakMap,B=new WeakMap,_=new WeakMap;exports.Source=Y;exports.SourceElement=at;exports.SourceManager=tt;exports.SourceSet=Z;
|
|
@@ -16,6 +16,7 @@ export declare class BillboardElement extends HTMLElement {
|
|
|
16
16
|
#private;
|
|
17
17
|
handleSet: ((number: number) => boolean) | undefined;
|
|
18
18
|
get counter(): number;
|
|
19
|
+
get rawCounter(): number;
|
|
19
20
|
get loop(): CSSProperty<boolean>;
|
|
20
21
|
get autoplay(): CSSProperty<string | false>;
|
|
21
22
|
get autoplayDuration(): number;
|
package/lib/billboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var nt=l=>{throw TypeError(l)};var et=(l,n,e)=>n.has(l)||nt("Cannot "+e);var t=(l,n,e)=>(et(l,n,"read from private field"),e?e.call(l):n.get(l)),s=(l,n,e)=>n.has(l)?nt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(l):n.set(l,e),h=(l,n,e,i)=>(et(l,n,"write to private field"),i?i.call(l,e):n.set(l,e),e),c=(l,n,e)=>(et(l,n,"access private method"),e);var H=(l,n,e)=>new Promise((i,r)=>{var a=A=>{try{Z(e.next(A))}catch(tt){r(tt)}},y=A=>{try{Z(e.throw(A))}catch(tt){r(tt)}},Z=A=>A.done?i(A.value):Promise.resolve(A.value).then(a,y);Z((e=e.apply(l,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("../index-DekP7OZe.cjs"),it=require("../custom-elements-Dh4TWRDJ.cjs"),Y=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const $=require("../css-property/index.cjs"),ft=require("../events-KVanG9sR.cjs"),pt=require("../gestures-C7gbKx11.cjs"),Et=require("../math-GDWEqu7y.cjs"),rt=require("../number-ChAm68cm.cjs");var m,B,Q,f,ht,at,ot,st;class lt{constructor(n,e){s(this,f);s(this,m);s(this,B,null);s(this,Q,!1);this.element=n,h(this,m,e)}destroy(){c(this,f,st).call(this)}updateClasses(n){const e=n===t(this,m).counter;t(this,Q)&&!e?this.element.classList.add("was-current"):this.element.classList.remove("was-current"),c(this,f,ot).call(this),c(this,f,st).call(this),n===t(this,m).counter?c(this,f,ht).call(this):n<t(this,m).counter?this.element.classList.add("previous"):this.element.classList.add("next"),c(this,f,at).call(this,n)}}m=new WeakMap,B=new WeakMap,Q=new WeakMap,f=new WeakSet,ht=function(){h(this,Q,!0),this.element.classList.add("current"),h(this,B,requestAnimationFrame(()=>{this.element.classList.add("current-active")}))},at=function(n){n===rt.loopNumber(t(this,m).counter-1,t(this,m).length)?this.element.classList.add("previous-sibling"):n===(t(this,m).counter+1)%t(this,m).length&&this.element.classList.add("next-sibling")},ot=function(){this.element.classList.remove("current","previous","next","previous-sibling","next-sibling","current-active")},st=function(){t(this,B)&&(cancelAnimationFrame(t(this,B)),h(this,B,null))};var z,M,L,C,S,I,T,p,o,b,P,d,ct,U,F,V,K,W,X;class J extends HTMLElement{constructor(){super(...arguments);s(this,d);s(this,z,new $.CSSProperty(this,"--resize",!0));s(this,M,new $.CSSProperty(this,"--loop",!0));s(this,L,new $.CSSProperty(this,"--autoplay",!1));s(this,C,new $.CSSProperty(this,"--swipe","x"));s(this,S);s(this,I,!1);s(this,T,[]);s(this,p,new Map);s(this,o,-1);s(this,b,0);s(this,P,[]);s(this,F,e=>{h(this,I,e.isIntersecting),t(this,I)?c(this,d,U).call(this):clearInterval(t(this,S))});s(this,V,()=>{clearInterval(t(this,S)),t(this,I)&&h(this,S,setInterval(t(this,W),this.autoplayDuration))});s(this,W,()=>{c(this,d,K).call(this,t(this,o)+1)});s(this,X,e=>{if(!t(this,C).current)return;let i=0;pt.setupDrag(r=>{const a=e.x-r.x,y=e.y-r.y;t(this,C).current==="x"?Math.abs(a)>Math.abs(y)&&Math.abs(a)>10&&(i=Math.sign(a)):t(this,C).current==="y"&&Math.abs(y)>Math.abs(a)&&Math.abs(y)>10&&(i=Math.sign(y))},()=>{i&&this.shift(i)})})}get counter(){return t(this,o)}get loop(){return t(this,M)}get autoplay(){return t(this,L)}get autoplayDuration(){return parseFloat(t(this,L).current||"0")*1e3}get swipe(){return t(this,C)}get items(){return t(this,T)}get groups(){return t(this,p)}get length(){return t(this,b)}addItem(e){const i=new lt(e,this);t(this,T).push(i);const r=e.getAttribute("data-billboard-item-group")||"default";let a=t(this,p).get(r);a||(a=[],t(this,p).set(r,a)),a.push(i),c(this,d,ct).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(c(this,d,K).call(this,e),c(this,d,U).call(this))}shift(e){this.set(t(this,o)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(i=>{this.addItem(i)}),t(this,p).forEach(i=>{var r;(r=i[0])==null||r.element.classList.add("current")}),t(this,L).subscribe(i=>{i.current?(D.intersector.subscribe(this,t(this,F)),c(this,d,U).call(this)):(h(this,I,!0),D.intersector.unsubscribe(t(this,F)),clearInterval(t(this,S)),c(this,d,K).call(this,0))}),t(this,L).observe(),t(this,C).observe(),t(this,M).observe(),t(this,z).observe(),c(this,d,K).call(this,0),this.addEventListener("pointerdown",t(this,X))}disconnectedCallback(){t(this,L).unobserve(),t(this,C).unobserve(),t(this,M).unobserve(),t(this,z).unobserve(),t(this,T).forEach(e=>e.destroy()),h(this,T,[]),t(this,p).clear(),D.intersector.unsubscribe(t(this,F)),clearInterval(t(this,S)),t(this,P).forEach(e=>{clearTimeout(e)})}}z=new WeakMap,M=new WeakMap,L=new WeakMap,C=new WeakMap,S=new WeakMap,I=new WeakMap,T=new WeakMap,p=new WeakMap,o=new WeakMap,b=new WeakMap,P=new WeakMap,d=new WeakSet,ct=function(){h(this,b,0),t(this,p).forEach(e=>{e.length>t(this,b)&&h(this,b,e.length)})},U=function(){t(this,L).current!==!1&&t(this,V).call(this)},F=new WeakMap,V=new WeakMap,K=function(){return H(this,arguments,function*(e=t(this,o)){const i=t(this,o);t(this,M).current?h(this,o,rt.loopNumber(e,t(this,b))):h(this,o,Et.clamp(e,0,t(this,b)-1)),i!==t(this,o)&&(t(this,P).forEach(r=>{clearTimeout(r)}),this.classList.remove("forward","backward","next-round","prev-round"),t(this,o)-i>=0?this.classList.add("forward"):t(this,o)-i<0&&this.classList.add("backward"),t(this,p).forEach(r=>{r.forEach((a,y)=>{a.updateClasses(y)})}),this.classList.toggle("has-length",t(this,b)>1),this.classList.toggle("start",t(this,o)===0),this.classList.toggle("end",t(this,o)===t(this,b)-1),this.style.setProperty("--counter",t(this,o).toString()),this.style.setProperty("--sections",t(this,b).toString()),ft.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,o)}}),t(this,z).current&&t(this,P).push(setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)),t(this,P).push(setTimeout(()=>{this.classList.remove("next-round","prev-round")},10)))})},W=new WeakMap,X=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",J);var E,N,g,R,_;class ut extends HTMLElement{constructor(){super(...arguments);s(this,E,null);s(this,N,null);s(this,g,[]);s(this,R,e=>{const i=e.currentTarget,r=t(this,g).findIndex(a=>a===i);r>=0&&t(this,E).set(r)});s(this,_,()=>{t(this,g).forEach((e,i)=>{i===t(this,E).counter?e.classList.add("current"):e.classList.remove("current")})})}get buttonElements(){return t(this,g)}connectedCallback(){return H(this,null,function*(){var e;if(yield it.whenDefined("e-billboard"),h(this,E,Y.findParentElement(this,J)),t(this,E)&&this.isConnected){this.innerHTML="";const i=t(this,E).length;h(this,N,document.createElement("div"));for(let r=0;r<i;r++){const a=document.createElement("button");a.setAttribute("aria-label",`Go to item ${r+1}`),t(this,g).push(a),t(this,N).appendChild(a)}this.appendChild(t(this,N)),t(this,g).forEach(r=>{r.addEventListener("click",t(this,R))}),(e=t(this,E))==null||e.addEventListener("billboardChange",t(this,_)),t(this,_).call(this)}})}disconnectedCallback(){var e;t(this,g).forEach(i=>{i.removeEventListener("click",t(this,R))}),(e=t(this,E))==null||e.removeEventListener("billboardChange",t(this,_)),this.innerHTML="",h(this,g,[])}}E=new WeakMap,N=new WeakMap,g=new WeakMap,R=new WeakMap,_=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",ut);var q,j;class dt extends HTMLElement{constructor(){super(...arguments);s(this,q,null);s(this,j,()=>{var r;const e=(((r=t(this,q))==null?void 0:r.counter)||0)+1,i=parseInt(this.getAttribute("pad")||"0");this.textContent=e.toString().padStart(i,"0")})}connectedCallback(){return H(this,null,function*(){var e;yield it.whenDefined("e-billboard"),h(this,q,Y.findParentElement(this,J)),(e=t(this,q))==null||e.addEventListener("billboardChange",t(this,j)),t(this,j).call(this)})}disconnectedCallback(){var e;(e=t(this,q))==null||e.removeEventListener("billboardChange",t(this,j))}}q=new WeakMap,j=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-counter")&&customElements.define("e-billboard-counter",dt);var G,w,v,k;class bt extends HTMLElement{constructor(){super();s(this,G,null);s(this,w,new $.CSSProperty(this,"--index",0));s(this,v,null);s(this,k,()=>{t(this,G).updateClasses(t(this,w).current)});this.addEventListener("click",e=>{t(this,v)&&(!this.handleClick||this.handleClick(e))&&t(this,v).set(t(this,w).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return H(this,null,function*(){yield it.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),h(this,v,Y.findParentElement(this,J)),t(this,v)&&(h(this,G,new lt(this,t(this,v))),t(this,v).addEventListener("billboardChange",t(this,k)),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,v))==null||e.removeEventListener("billboardChange",t(this,k)),t(this,G).destroy()}}G=new WeakMap,w=new WeakMap,v=new WeakMap,k=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",bt);var x,u,O;class mt extends HTMLElement{constructor(){super();s(this,x,new $.CSSProperty(this,"--step",1));s(this,u,null);s(this,O,()=>{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 H(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,h(this,u,Y.findParentElement(this,J)),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,O)),setTimeout(()=>{t(this,O).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,O))}}x=new WeakMap,u=new WeakMap,O=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",mt);exports.BillboardBulletsElement=ut;exports.BillboardCounterElement=dt;exports.BillboardElement=J;exports.BillboardSetButtonElement=bt;exports.BillboardStepButtonElement=mt;
|
|
1
|
+
"use strict";var nt=h=>{throw TypeError(h)};var st=(h,r,e)=>r.has(h)||nt("Cannot "+e);var t=(h,r,e)=>(st(h,r,"read from private field"),e?e.call(h):r.get(h)),s=(h,r,e)=>r.has(h)?nt("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(h):r.set(h,e),l=(h,r,e,i)=>(st(h,r,"write to private field"),i?i.call(h,e):r.set(h,e),e),c=(h,r,e)=>(st(h,r,"access private method"),e);var H=(h,r,e)=>new Promise((i,n)=>{var a=A=>{try{tt(e.next(A))}catch(et){n(et)}},y=A=>{try{tt(e.throw(A))}catch(et){n(et)}},tt=A=>A.done?i(A.value):Promise.resolve(A.value).then(a,y);tt((e=e.apply(h,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("../index-DekP7OZe.cjs"),rt=require("../custom-elements-Dh4TWRDJ.cjs"),Z=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const $=require("../css-property/index.cjs"),pt=require("../events-KVanG9sR.cjs"),Et=require("../gestures-C7gbKx11.cjs"),gt=require("../math-GDWEqu7y.cjs"),ht=require("../number-ChAm68cm.cjs");var m,B,Q,f,at,ot,ct,it;class lt{constructor(r,e){s(this,f);s(this,m);s(this,B,null);s(this,Q,!1);this.element=r,l(this,m,e)}destroy(){c(this,f,it).call(this)}updateClasses(r){const e=r===t(this,m).counter;t(this,Q)&&!e?this.element.classList.add("was-current"):this.element.classList.remove("was-current"),c(this,f,ct).call(this),c(this,f,it).call(this),r===t(this,m).counter?c(this,f,at).call(this):r<t(this,m).counter?this.element.classList.add("previous"):this.element.classList.add("next"),c(this,f,ot).call(this,r)}}m=new WeakMap,B=new WeakMap,Q=new WeakMap,f=new WeakSet,at=function(){l(this,Q,!0),this.element.classList.add("current"),l(this,B,requestAnimationFrame(()=>{this.element.classList.add("current-active")}))},ot=function(r){r===ht.loopNumber(t(this,m).counter-1,t(this,m).length)?this.element.classList.add("previous-sibling"):r===(t(this,m).counter+1)%t(this,m).length&&this.element.classList.add("next-sibling")},ct=function(){this.element.classList.remove("current","previous","next","previous-sibling","next-sibling","current-active")},it=function(){t(this,B)&&(cancelAnimationFrame(t(this,B)),l(this,B,null))};var z,M,L,C,S,I,T,p,o,R,b,P,d,ut,V,F,W,K,X,Y;class J extends HTMLElement{constructor(){super(...arguments);s(this,d);s(this,z,new $.CSSProperty(this,"--resize",!0));s(this,M,new $.CSSProperty(this,"--loop",!0));s(this,L,new $.CSSProperty(this,"--autoplay",!1));s(this,C,new $.CSSProperty(this,"--swipe","x"));s(this,S);s(this,I,!1);s(this,T,[]);s(this,p,new Map);s(this,o,-1);s(this,R,-1);s(this,b,0);s(this,P,[]);s(this,F,e=>{l(this,I,e.isIntersecting),t(this,I)?c(this,d,V).call(this):clearInterval(t(this,S))});s(this,W,()=>{clearInterval(t(this,S)),t(this,I)&&l(this,S,setInterval(t(this,X),this.autoplayDuration))});s(this,X,()=>{c(this,d,K).call(this,t(this,o)+1)});s(this,Y,e=>{if(!t(this,C).current)return;let i=0;Et.setupDrag(n=>{const a=e.x-n.x,y=e.y-n.y;t(this,C).current==="x"?Math.abs(a)>Math.abs(y)&&Math.abs(a)>10&&(i=Math.sign(a)):t(this,C).current==="y"&&Math.abs(y)>Math.abs(a)&&Math.abs(y)>10&&(i=Math.sign(y))},()=>{i&&this.shift(i)})})}get counter(){return t(this,o)}get rawCounter(){return t(this,R)}get loop(){return t(this,M)}get autoplay(){return t(this,L)}get autoplayDuration(){return parseFloat(t(this,L).current||"0")*1e3}get swipe(){return t(this,C)}get items(){return t(this,T)}get groups(){return t(this,p)}get length(){return t(this,b)}addItem(e){const i=new lt(e,this);t(this,T).push(i);const n=e.getAttribute("data-billboard-item-group")||"default";let a=t(this,p).get(n);a||(a=[],t(this,p).set(n,a)),a.push(i),c(this,d,ut).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(c(this,d,K).call(this,e),c(this,d,V).call(this))}shift(e){this.set(t(this,o)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(i=>{this.addItem(i)}),t(this,p).forEach(i=>{var n;(n=i[0])==null||n.element.classList.add("current")}),t(this,L).subscribe(i=>{i.current?(D.intersector.subscribe(this,t(this,F)),c(this,d,V).call(this)):(l(this,I,!0),D.intersector.unsubscribe(t(this,F)),clearInterval(t(this,S)),c(this,d,K).call(this,0))}),t(this,L).observe(),t(this,C).observe(),t(this,M).observe(),t(this,z).observe(),c(this,d,K).call(this,0),this.addEventListener("pointerdown",t(this,Y))}disconnectedCallback(){t(this,L).unobserve(),t(this,C).unobserve(),t(this,M).unobserve(),t(this,z).unobserve(),t(this,T).forEach(e=>e.destroy()),l(this,T,[]),t(this,p).clear(),D.intersector.unsubscribe(t(this,F)),clearInterval(t(this,S)),t(this,P).forEach(e=>{clearTimeout(e)})}}z=new WeakMap,M=new WeakMap,L=new WeakMap,C=new WeakMap,S=new WeakMap,I=new WeakMap,T=new WeakMap,p=new WeakMap,o=new WeakMap,R=new WeakMap,b=new WeakMap,P=new WeakMap,d=new WeakSet,ut=function(){l(this,b,0),t(this,p).forEach(e=>{e.length>t(this,b)&&l(this,b,e.length)})},V=function(){t(this,L).current!==!1&&t(this,W).call(this)},F=new WeakMap,W=new WeakMap,K=function(){return H(this,arguments,function*(e=t(this,o)){const i=t(this,o);t(this,M).current?l(this,o,ht.loopNumber(e,t(this,b))):l(this,o,gt.clamp(e,0,t(this,b)-1)),l(this,R,e),i!==t(this,o)&&(t(this,P).forEach(n=>{clearTimeout(n)}),this.classList.remove("forward","backward","next-round","prev-round"),t(this,o)-i>=0?this.classList.add("forward"):t(this,o)-i<0&&this.classList.add("backward"),t(this,p).forEach(n=>{n.forEach((a,y)=>{a.updateClasses(y)})}),this.classList.toggle("has-length",t(this,b)>1),this.classList.toggle("start",t(this,o)===0),this.classList.toggle("end",t(this,o)===t(this,b)-1),this.style.setProperty("--counter",t(this,o).toString()),this.style.setProperty("--sections",t(this,b).toString()),pt.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,o)}}),t(this,z).current&&t(this,P).push(setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)),t(this,P).push(setTimeout(()=>{this.classList.remove("next-round","prev-round")},10)))})},X=new WeakMap,Y=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",J);var E,N,g,U,_;class dt extends HTMLElement{constructor(){super(...arguments);s(this,E,null);s(this,N,null);s(this,g,[]);s(this,U,e=>{const i=e.currentTarget,n=t(this,g).findIndex(a=>a===i);n>=0&&t(this,E).set(n)});s(this,_,()=>{t(this,g).forEach((e,i)=>{i===t(this,E).counter?e.classList.add("current"):e.classList.remove("current")})})}get buttonElements(){return t(this,g)}connectedCallback(){return H(this,null,function*(){var e;if(yield rt.whenDefined("e-billboard"),l(this,E,Z.findParentElement(this,J)),t(this,E)&&this.isConnected){this.innerHTML="";const i=t(this,E).length;l(this,N,document.createElement("div"));for(let n=0;n<i;n++){const a=document.createElement("button");a.setAttribute("aria-label",`Go to item ${n+1}`),t(this,g).push(a),t(this,N).appendChild(a)}this.appendChild(t(this,N)),t(this,g).forEach(n=>{n.addEventListener("click",t(this,U))}),(e=t(this,E))==null||e.addEventListener("billboardChange",t(this,_)),t(this,_).call(this)}})}disconnectedCallback(){var e;t(this,g).forEach(i=>{i.removeEventListener("click",t(this,U))}),(e=t(this,E))==null||e.removeEventListener("billboardChange",t(this,_)),this.innerHTML="",l(this,g,[])}}E=new WeakMap,N=new WeakMap,g=new WeakMap,U=new WeakMap,_=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",dt);var q,j;class bt extends HTMLElement{constructor(){super(...arguments);s(this,q,null);s(this,j,()=>{var n;const e=(((n=t(this,q))==null?void 0:n.counter)||0)+1,i=parseInt(this.getAttribute("pad")||"0");this.textContent=e.toString().padStart(i,"0")})}connectedCallback(){return H(this,null,function*(){var e;yield rt.whenDefined("e-billboard"),l(this,q,Z.findParentElement(this,J)),(e=t(this,q))==null||e.addEventListener("billboardChange",t(this,j)),t(this,j).call(this)})}disconnectedCallback(){var e;(e=t(this,q))==null||e.removeEventListener("billboardChange",t(this,j))}}q=new WeakMap,j=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-counter")&&customElements.define("e-billboard-counter",bt);var G,w,v,k;class mt extends HTMLElement{constructor(){super();s(this,G,null);s(this,w,new $.CSSProperty(this,"--index",0));s(this,v,null);s(this,k,()=>{t(this,G).updateClasses(t(this,w).current)});this.addEventListener("click",e=>{t(this,v)&&(!this.handleClick||this.handleClick(e))&&t(this,v).set(t(this,w).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return H(this,null,function*(){yield rt.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),l(this,v,Z.findParentElement(this,J)),t(this,v)&&(l(this,G,new lt(this,t(this,v))),t(this,v).addEventListener("billboardChange",t(this,k)),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,v))==null||e.removeEventListener("billboardChange",t(this,k)),t(this,G).destroy()}}G=new WeakMap,w=new WeakMap,v=new WeakMap,k=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",mt);var x,u,O;class ft extends HTMLElement{constructor(){super();s(this,x,new $.CSSProperty(this,"--step",1));s(this,u,null);s(this,O,()=>{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 H(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,l(this,u,Z.findParentElement(this,J)),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,O)),setTimeout(()=>{t(this,O).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,O))}}x=new WeakMap,u=new WeakMap,O=new WeakMap;D.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",ft);exports.BillboardBulletsElement=dt;exports.BillboardCounterElement=bt;exports.BillboardElement=J;exports.BillboardSetButtonElement=mt;exports.BillboardStepButtonElement=ft;
|
package/lib/billboard/index.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ht = (h) => {
|
|
2
2
|
throw TypeError(h);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var t = (h,
|
|
6
|
-
var P = (h,
|
|
4
|
+
var st = (h, r, e) => r.has(h) || ht("Cannot " + e);
|
|
5
|
+
var t = (h, r, e) => (st(h, r, "read from private field"), e ? e.call(h) : r.get(h)), s = (h, r, e) => r.has(h) ? ht("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(h) : r.set(h, e), l = (h, r, e, i) => (st(h, r, "write to private field"), i ? i.call(h, e) : r.set(h, e), e), c = (h, r, e) => (st(h, r, "access private method"), e);
|
|
6
|
+
var P = (h, r, e) => new Promise((i, n) => {
|
|
7
7
|
var a = (M) => {
|
|
8
8
|
try {
|
|
9
|
-
|
|
10
|
-
} catch (
|
|
11
|
-
|
|
9
|
+
tt(e.next(M));
|
|
10
|
+
} catch (et) {
|
|
11
|
+
n(et);
|
|
12
12
|
}
|
|
13
13
|
}, y = (M) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
tt(e.throw(M));
|
|
16
|
+
} catch (et) {
|
|
17
|
+
n(et);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
}, tt = (M) => M.done ? i(M.value) : Promise.resolve(M.value).then(a, y);
|
|
20
|
+
tt((e = e.apply(h, r)).next());
|
|
21
21
|
});
|
|
22
|
-
import { a as
|
|
22
|
+
import { a as it, i as Z } from "../index-Bv9zgfdb.js";
|
|
23
23
|
import { w as nt } from "../custom-elements-DBnCK7Zx.js";
|
|
24
|
-
import { b as
|
|
24
|
+
import { b as _ } from "../dom-CVWzyXPH.js";
|
|
25
25
|
import "construct-style-sheets-polyfill";
|
|
26
26
|
import { CSSProperty as z } from "../css-property/index.js";
|
|
27
|
-
import { d as
|
|
28
|
-
import { s as
|
|
29
|
-
import { c as
|
|
30
|
-
import { l as
|
|
31
|
-
var m, I, O, f,
|
|
32
|
-
class
|
|
33
|
-
constructor(
|
|
27
|
+
import { d as bt } from "../events-CsVF98U6.js";
|
|
28
|
+
import { s as mt } from "../gestures-CcXV6fCp.js";
|
|
29
|
+
import { c as ft } from "../math-BOBiC4TN.js";
|
|
30
|
+
import { l as lt } from "../number-CumqY64S.js";
|
|
31
|
+
var m, I, O, f, ot, ct, dt, rt;
|
|
32
|
+
class at {
|
|
33
|
+
constructor(r, e) {
|
|
34
34
|
s(this, f);
|
|
35
35
|
s(this, m);
|
|
36
36
|
s(this, I, null);
|
|
37
37
|
s(this, O, !1);
|
|
38
|
-
this.element =
|
|
38
|
+
this.element = r, l(this, m, e);
|
|
39
39
|
}
|
|
40
40
|
destroy() {
|
|
41
|
-
c(this, f,
|
|
41
|
+
c(this, f, rt).call(this);
|
|
42
42
|
}
|
|
43
|
-
updateClasses(
|
|
44
|
-
const e =
|
|
45
|
-
t(this, O) && !e ? this.element.classList.add("was-current") : this.element.classList.remove("was-current"), c(this, f,
|
|
43
|
+
updateClasses(r) {
|
|
44
|
+
const e = r === t(this, m).counter;
|
|
45
|
+
t(this, O) && !e ? this.element.classList.add("was-current") : this.element.classList.remove("was-current"), c(this, f, dt).call(this), c(this, f, rt).call(this), r === t(this, m).counter ? c(this, f, ot).call(this) : r < t(this, m).counter ? this.element.classList.add("previous") : this.element.classList.add("next"), c(this, f, ct).call(this, r);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
m = new WeakMap(), I = new WeakMap(), O = new WeakMap(), f = new WeakSet(),
|
|
48
|
+
m = new WeakMap(), I = new WeakMap(), O = new WeakMap(), f = new WeakSet(), ot = function() {
|
|
49
49
|
l(this, O, !0), this.element.classList.add("current"), l(this, I, requestAnimationFrame(() => {
|
|
50
50
|
this.element.classList.add("current-active");
|
|
51
51
|
}));
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
},
|
|
52
|
+
}, ct = function(r) {
|
|
53
|
+
r === lt(t(this, m).counter - 1, t(this, m).length) ? this.element.classList.add("previous-sibling") : r === (t(this, m).counter + 1) % t(this, m).length && this.element.classList.add("next-sibling");
|
|
54
|
+
}, dt = function() {
|
|
55
55
|
this.element.classList.remove(
|
|
56
56
|
"current",
|
|
57
57
|
"previous",
|
|
@@ -60,11 +60,11 @@ m = new WeakMap(), I = new WeakMap(), O = new WeakMap(), f = new WeakSet(), at =
|
|
|
60
60
|
"next-sibling",
|
|
61
61
|
"current-active"
|
|
62
62
|
);
|
|
63
|
-
},
|
|
63
|
+
}, rt = function() {
|
|
64
64
|
t(this, I) && (cancelAnimationFrame(t(this, I)), l(this, I, null));
|
|
65
65
|
};
|
|
66
|
-
var F, S, L, C, k, T, B, p, o, b, D, u,
|
|
67
|
-
class
|
|
66
|
+
var F, S, L, C, k, T, B, p, o, Q, b, D, u, ut, V, $, W, K, X, Y;
|
|
67
|
+
class U extends HTMLElement {
|
|
68
68
|
constructor() {
|
|
69
69
|
super(...arguments);
|
|
70
70
|
s(this, u);
|
|
@@ -77,24 +77,25 @@ class R extends HTMLElement {
|
|
|
77
77
|
s(this, B, []);
|
|
78
78
|
s(this, p, /* @__PURE__ */ new Map());
|
|
79
79
|
s(this, o, -1);
|
|
80
|
+
s(this, Q, -1);
|
|
80
81
|
s(this, b, 0);
|
|
81
82
|
s(this, D, []);
|
|
82
83
|
s(this, $, (e) => {
|
|
83
|
-
l(this, T, e.isIntersecting), t(this, T) ? c(this, u,
|
|
84
|
-
});
|
|
85
|
-
s(this, V, () => {
|
|
86
|
-
clearInterval(t(this, k)), t(this, T) && l(this, k, setInterval(t(this, W), this.autoplayDuration));
|
|
84
|
+
l(this, T, e.isIntersecting), t(this, T) ? c(this, u, V).call(this) : clearInterval(t(this, k));
|
|
87
85
|
});
|
|
88
86
|
s(this, W, () => {
|
|
87
|
+
clearInterval(t(this, k)), t(this, T) && l(this, k, setInterval(t(this, X), this.autoplayDuration));
|
|
88
|
+
});
|
|
89
|
+
s(this, X, () => {
|
|
89
90
|
c(this, u, K).call(this, t(this, o) + 1);
|
|
90
91
|
});
|
|
91
|
-
s(this,
|
|
92
|
+
s(this, Y, (e) => {
|
|
92
93
|
if (!t(this, C).current)
|
|
93
94
|
return;
|
|
94
95
|
let i = 0;
|
|
95
|
-
|
|
96
|
-
(
|
|
97
|
-
const a = e.x -
|
|
96
|
+
mt(
|
|
97
|
+
(n) => {
|
|
98
|
+
const a = e.x - n.x, y = e.y - n.y;
|
|
98
99
|
t(this, C).current === "x" ? Math.abs(a) > Math.abs(y) && Math.abs(a) > 10 && (i = Math.sign(a)) : t(this, C).current === "y" && Math.abs(y) > Math.abs(a) && Math.abs(y) > 10 && (i = Math.sign(y));
|
|
99
100
|
},
|
|
100
101
|
() => {
|
|
@@ -106,6 +107,9 @@ class R extends HTMLElement {
|
|
|
106
107
|
get counter() {
|
|
107
108
|
return t(this, o);
|
|
108
109
|
}
|
|
110
|
+
get rawCounter() {
|
|
111
|
+
return t(this, Q);
|
|
112
|
+
}
|
|
109
113
|
get loop() {
|
|
110
114
|
return t(this, S);
|
|
111
115
|
}
|
|
@@ -128,14 +132,14 @@ class R extends HTMLElement {
|
|
|
128
132
|
return t(this, b);
|
|
129
133
|
}
|
|
130
134
|
addItem(e) {
|
|
131
|
-
const i = new
|
|
135
|
+
const i = new at(e, this);
|
|
132
136
|
t(this, B).push(i);
|
|
133
|
-
const
|
|
134
|
-
let a = t(this, p).get(
|
|
135
|
-
a || (a = [], t(this, p).set(
|
|
137
|
+
const n = e.getAttribute("data-billboard-item-group") || "default";
|
|
138
|
+
let a = t(this, p).get(n);
|
|
139
|
+
a || (a = [], t(this, p).set(n, a)), a.push(i), c(this, u, ut).call(this);
|
|
136
140
|
}
|
|
137
141
|
set(e) {
|
|
138
|
-
(!this.handleSet || this.handleSet(e)) && (c(this, u, K).call(this, e), c(this, u,
|
|
142
|
+
(!this.handleSet || this.handleSet(e)) && (c(this, u, K).call(this, e), c(this, u, V).call(this));
|
|
139
143
|
}
|
|
140
144
|
shift(e) {
|
|
141
145
|
this.set(t(this, o) + e);
|
|
@@ -148,34 +152,34 @@ class R extends HTMLElement {
|
|
|
148
152
|
].forEach((i) => {
|
|
149
153
|
this.addItem(i);
|
|
150
154
|
}), t(this, p).forEach((i) => {
|
|
151
|
-
var
|
|
152
|
-
(
|
|
155
|
+
var n;
|
|
156
|
+
(n = i[0]) == null || n.element.classList.add("current");
|
|
153
157
|
}), t(this, L).subscribe((i) => {
|
|
154
|
-
i.current ? (
|
|
155
|
-
}), t(this, L).observe(), t(this, C).observe(), t(this, S).observe(), t(this, F).observe(), c(this, u, K).call(this, 0), this.addEventListener("pointerdown", t(this,
|
|
158
|
+
i.current ? (it.subscribe(this, t(this, $)), c(this, u, V).call(this)) : (l(this, T, !0), it.unsubscribe(t(this, $)), clearInterval(t(this, k)), c(this, u, K).call(this, 0));
|
|
159
|
+
}), t(this, L).observe(), t(this, C).observe(), t(this, S).observe(), t(this, F).observe(), c(this, u, K).call(this, 0), this.addEventListener("pointerdown", t(this, Y));
|
|
156
160
|
}
|
|
157
161
|
disconnectedCallback() {
|
|
158
|
-
t(this, L).unobserve(), t(this, C).unobserve(), t(this, S).unobserve(), t(this, F).unobserve(), t(this, B).forEach((e) => e.destroy()), l(this, B, []), t(this, p).clear(),
|
|
162
|
+
t(this, L).unobserve(), t(this, C).unobserve(), t(this, S).unobserve(), t(this, F).unobserve(), t(this, B).forEach((e) => e.destroy()), l(this, B, []), t(this, p).clear(), it.unsubscribe(t(this, $)), clearInterval(t(this, k)), t(this, D).forEach((e) => {
|
|
159
163
|
clearTimeout(e);
|
|
160
164
|
});
|
|
161
165
|
}
|
|
162
166
|
}
|
|
163
|
-
F = new WeakMap(), S = new WeakMap(), L = new WeakMap(), C = new WeakMap(), k = new WeakMap(), T = new WeakMap(), B = new WeakMap(), p = new WeakMap(), o = new WeakMap(), b = new WeakMap(), D = new WeakMap(), u = new WeakSet(),
|
|
167
|
+
F = new WeakMap(), S = new WeakMap(), L = new WeakMap(), C = new WeakMap(), k = new WeakMap(), T = new WeakMap(), B = new WeakMap(), p = new WeakMap(), o = new WeakMap(), Q = new WeakMap(), b = new WeakMap(), D = new WeakMap(), u = new WeakSet(), ut = function() {
|
|
164
168
|
l(this, b, 0), t(this, p).forEach((e) => {
|
|
165
169
|
e.length > t(this, b) && l(this, b, e.length);
|
|
166
170
|
});
|
|
167
|
-
},
|
|
168
|
-
t(this, L).current !== !1 && t(this,
|
|
169
|
-
}, $ = new WeakMap(),
|
|
171
|
+
}, V = function() {
|
|
172
|
+
t(this, L).current !== !1 && t(this, W).call(this);
|
|
173
|
+
}, $ = new WeakMap(), W = new WeakMap(), K = function() {
|
|
170
174
|
return P(this, arguments, function* (e = t(this, o)) {
|
|
171
175
|
const i = t(this, o);
|
|
172
|
-
t(this, S).current ? l(this, o,
|
|
173
|
-
clearTimeout(
|
|
174
|
-
}), this.classList.remove("forward", "backward", "next-round", "prev-round"), t(this, o) - i >= 0 ? this.classList.add("forward") : t(this, o) - i < 0 && this.classList.add("backward"), t(this, p).forEach((
|
|
175
|
-
|
|
176
|
+
t(this, S).current ? l(this, o, lt(e, t(this, b))) : l(this, o, ft(e, 0, t(this, b) - 1)), l(this, Q, e), i !== t(this, o) && (t(this, D).forEach((n) => {
|
|
177
|
+
clearTimeout(n);
|
|
178
|
+
}), this.classList.remove("forward", "backward", "next-round", "prev-round"), t(this, o) - i >= 0 ? this.classList.add("forward") : t(this, o) - i < 0 && this.classList.add("backward"), t(this, p).forEach((n) => {
|
|
179
|
+
n.forEach((a, y) => {
|
|
176
180
|
a.updateClasses(y);
|
|
177
181
|
});
|
|
178
|
-
}), this.classList.toggle("has-length", t(this, b) > 1), this.classList.toggle("start", t(this, o) === 0), this.classList.toggle("end", t(this, o) === t(this, b) - 1), this.style.setProperty("--counter", t(this, o).toString()), this.style.setProperty("--sections", t(this, b).toString()),
|
|
182
|
+
}), this.classList.toggle("has-length", t(this, b) > 1), this.classList.toggle("start", t(this, o) === 0), this.classList.toggle("end", t(this, o) === t(this, b) - 1), this.style.setProperty("--counter", t(this, o).toString()), this.style.setProperty("--sections", t(this, b).toString()), bt(this, "billboardChange", {
|
|
179
183
|
detail: {
|
|
180
184
|
counter: t(this, o)
|
|
181
185
|
}
|
|
@@ -189,41 +193,41 @@ F = new WeakMap(), S = new WeakMap(), L = new WeakMap(), C = new WeakMap(), k =
|
|
|
189
193
|
}, 10)
|
|
190
194
|
));
|
|
191
195
|
});
|
|
192
|
-
},
|
|
193
|
-
customElements.get("e-billboard") || customElements.define("e-billboard",
|
|
194
|
-
var g, q,
|
|
195
|
-
class
|
|
196
|
+
}, X = new WeakMap(), Y = new WeakMap();
|
|
197
|
+
customElements.get("e-billboard") || customElements.define("e-billboard", U);
|
|
198
|
+
var g, q, E, R, N;
|
|
199
|
+
class pt extends HTMLElement {
|
|
196
200
|
constructor() {
|
|
197
201
|
super(...arguments);
|
|
198
202
|
s(this, g, null);
|
|
199
203
|
s(this, q, null);
|
|
200
|
-
s(this,
|
|
201
|
-
s(this,
|
|
202
|
-
const i = e.currentTarget,
|
|
203
|
-
|
|
204
|
+
s(this, E, []);
|
|
205
|
+
s(this, R, (e) => {
|
|
206
|
+
const i = e.currentTarget, n = t(this, E).findIndex((a) => a === i);
|
|
207
|
+
n >= 0 && t(this, g).set(n);
|
|
204
208
|
});
|
|
205
209
|
s(this, N, () => {
|
|
206
|
-
t(this,
|
|
210
|
+
t(this, E).forEach((e, i) => {
|
|
207
211
|
i === t(this, g).counter ? e.classList.add("current") : e.classList.remove("current");
|
|
208
212
|
});
|
|
209
213
|
});
|
|
210
214
|
}
|
|
211
215
|
get buttonElements() {
|
|
212
|
-
return t(this,
|
|
216
|
+
return t(this, E);
|
|
213
217
|
}
|
|
214
218
|
connectedCallback() {
|
|
215
219
|
return P(this, null, function* () {
|
|
216
220
|
var e;
|
|
217
|
-
if (yield nt("e-billboard"), l(this, g,
|
|
221
|
+
if (yield nt("e-billboard"), l(this, g, _(this, U)), t(this, g) && this.isConnected) {
|
|
218
222
|
this.innerHTML = "";
|
|
219
223
|
const i = t(this, g).length;
|
|
220
224
|
l(this, q, document.createElement("div"));
|
|
221
|
-
for (let
|
|
225
|
+
for (let n = 0; n < i; n++) {
|
|
222
226
|
const a = document.createElement("button");
|
|
223
|
-
a.setAttribute("aria-label", `Go to item ${
|
|
227
|
+
a.setAttribute("aria-label", `Go to item ${n + 1}`), t(this, E).push(a), t(this, q).appendChild(a);
|
|
224
228
|
}
|
|
225
|
-
this.appendChild(t(this, q)), t(this,
|
|
226
|
-
|
|
229
|
+
this.appendChild(t(this, q)), t(this, E).forEach((n) => {
|
|
230
|
+
n.addEventListener("click", t(this, R));
|
|
227
231
|
}), (e = t(this, g)) == null || e.addEventListener(
|
|
228
232
|
"billboardChange",
|
|
229
233
|
t(this, N)
|
|
@@ -233,31 +237,31 @@ class ft extends HTMLElement {
|
|
|
233
237
|
}
|
|
234
238
|
disconnectedCallback() {
|
|
235
239
|
var e;
|
|
236
|
-
t(this,
|
|
237
|
-
i.removeEventListener("click", t(this,
|
|
240
|
+
t(this, E).forEach((i) => {
|
|
241
|
+
i.removeEventListener("click", t(this, R));
|
|
238
242
|
}), (e = t(this, g)) == null || e.removeEventListener(
|
|
239
243
|
"billboardChange",
|
|
240
244
|
t(this, N)
|
|
241
|
-
), this.innerHTML = "", l(this,
|
|
245
|
+
), this.innerHTML = "", l(this, E, []);
|
|
242
246
|
}
|
|
243
247
|
}
|
|
244
|
-
g = new WeakMap(), q = new WeakMap(),
|
|
245
|
-
|
|
248
|
+
g = new WeakMap(), q = new WeakMap(), E = new WeakMap(), R = new WeakMap(), N = new WeakMap();
|
|
249
|
+
Z && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", pt);
|
|
246
250
|
var H, G;
|
|
247
|
-
class
|
|
251
|
+
class gt extends HTMLElement {
|
|
248
252
|
constructor() {
|
|
249
253
|
super(...arguments);
|
|
250
254
|
s(this, H, null);
|
|
251
255
|
s(this, G, () => {
|
|
252
|
-
var
|
|
253
|
-
const e = (((
|
|
256
|
+
var n;
|
|
257
|
+
const e = (((n = t(this, H)) == null ? void 0 : n.counter) || 0) + 1, i = parseInt(this.getAttribute("pad") || "0");
|
|
254
258
|
this.textContent = e.toString().padStart(i, "0");
|
|
255
259
|
});
|
|
256
260
|
}
|
|
257
261
|
connectedCallback() {
|
|
258
262
|
return P(this, null, function* () {
|
|
259
263
|
var e;
|
|
260
|
-
yield nt("e-billboard"), l(this, H,
|
|
264
|
+
yield nt("e-billboard"), l(this, H, _(this, U)), (e = t(this, H)) == null || e.addEventListener(
|
|
261
265
|
"billboardChange",
|
|
262
266
|
t(this, G)
|
|
263
267
|
), t(this, G).call(this);
|
|
@@ -272,26 +276,26 @@ class pt extends HTMLElement {
|
|
|
272
276
|
}
|
|
273
277
|
}
|
|
274
278
|
H = new WeakMap(), G = new WeakMap();
|
|
275
|
-
|
|
276
|
-
var j, w,
|
|
277
|
-
class
|
|
279
|
+
Z && !customElements.get("e-billboard-counter") && customElements.define("e-billboard-counter", gt);
|
|
280
|
+
var j, w, v, x;
|
|
281
|
+
class Et extends HTMLElement {
|
|
278
282
|
constructor() {
|
|
279
283
|
super();
|
|
280
284
|
s(this, j, null);
|
|
281
285
|
s(this, w, new z(this, "--index", 0));
|
|
282
|
-
s(this,
|
|
286
|
+
s(this, v, null);
|
|
283
287
|
s(this, x, () => {
|
|
284
288
|
t(this, j).updateClasses(t(this, w).current);
|
|
285
289
|
});
|
|
286
290
|
this.addEventListener("click", (e) => {
|
|
287
|
-
t(this,
|
|
291
|
+
t(this, v) && (!this.handleClick || this.handleClick(e)) && t(this, v).set(t(this, w).current);
|
|
288
292
|
}), this.addEventListener("keydown", (e) => {
|
|
289
293
|
e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
|
|
290
294
|
});
|
|
291
295
|
}
|
|
292
296
|
connectedCallback() {
|
|
293
297
|
return P(this, null, function* () {
|
|
294
|
-
yield nt("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), l(this,
|
|
298
|
+
yield nt("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), l(this, v, _(this, U)), t(this, v) && (l(this, j, new at(this, t(this, v))), t(this, v).addEventListener(
|
|
295
299
|
"billboardChange",
|
|
296
300
|
t(this, x)
|
|
297
301
|
), t(this, x).call(this), t(this, w).subscribe(t(this, x)), t(this, w).observe());
|
|
@@ -299,14 +303,14 @@ class gt extends HTMLElement {
|
|
|
299
303
|
}
|
|
300
304
|
disconnectedCallback() {
|
|
301
305
|
var e;
|
|
302
|
-
this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, w).unsubscribe(t(this, x)), t(this, w).unobserve(), (e = t(this,
|
|
306
|
+
this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, w).unsubscribe(t(this, x)), t(this, w).unobserve(), (e = t(this, v)) == null || e.removeEventListener(
|
|
303
307
|
"billboardChange",
|
|
304
308
|
t(this, x)
|
|
305
309
|
), t(this, j).destroy();
|
|
306
310
|
}
|
|
307
311
|
}
|
|
308
|
-
j = new WeakMap(), w = new WeakMap(),
|
|
309
|
-
|
|
312
|
+
j = new WeakMap(), w = new WeakMap(), v = new WeakMap(), x = new WeakMap();
|
|
313
|
+
Z && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", Et);
|
|
310
314
|
var A, d, J;
|
|
311
315
|
class vt extends HTMLElement {
|
|
312
316
|
constructor() {
|
|
@@ -325,7 +329,7 @@ class vt extends HTMLElement {
|
|
|
325
329
|
connectedCallback() {
|
|
326
330
|
return P(this, null, function* () {
|
|
327
331
|
var e;
|
|
328
|
-
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, l(this, d,
|
|
332
|
+
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, l(this, d, _(this, U)), (e = t(this, d)) == null || e.addEventListener(
|
|
329
333
|
"billboardChange",
|
|
330
334
|
t(this, J)
|
|
331
335
|
), setTimeout(() => {
|
|
@@ -342,11 +346,11 @@ class vt extends HTMLElement {
|
|
|
342
346
|
}
|
|
343
347
|
}
|
|
344
348
|
A = new WeakMap(), d = new WeakMap(), J = new WeakMap();
|
|
345
|
-
|
|
349
|
+
Z && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", vt);
|
|
346
350
|
export {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
+
pt as BillboardBulletsElement,
|
|
352
|
+
gt as BillboardCounterElement,
|
|
353
|
+
U as BillboardElement,
|
|
354
|
+
Et as BillboardSetButtonElement,
|
|
351
355
|
vt as BillboardStepButtonElement
|
|
352
356
|
};
|
package/lib/iframe/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-
|
|
1
|
+
"use strict";var u=r=>{throw TypeError(r)};var a=(r,t,e)=>t.has(r)||u("Cannot "+e);var s=(r,t,e)=>(a(r,t,"read from private field"),e?e.call(r):t.get(r)),o=(r,t,e)=>t.has(r)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(a(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../SourceElement-DX6W2-19.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const f=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");var n,l,m;class E extends h.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});o(this,n,null);o(this,l,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("load"))});o(this,m,()=>{var e,i;(i=(e=this.consumerElement).onload)==null||i.call(e,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(e){s(this,n)&&(s(this,n).onload=null,s(this,n).onerror=null),this.consumerElement.innerHTML=(e==null?void 0:e.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",c(this,n,this.consumerElement.querySelector("iframe")),s(this,n)&&(s(this,n).onload=s(this,l),s(this,n).onerror=s(this,m))}}n=new WeakMap,l=new WeakMap,m=new WeakMap;f.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",E);exports.IFrameElement=E;
|
package/lib/iframe/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var a = (r) => {
|
|
|
3
3
|
};
|
|
4
4
|
var u = (r, t, e) => t.has(r) || a("Cannot " + e);
|
|
5
5
|
var s = (r, t, e) => (u(r, t, "read from private field"), e ? e.call(r) : t.get(r)), i = (r, t, e) => t.has(r) ? a("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), c = (r, t, e, o) => (u(r, t, "write to private field"), o ? o.call(r, e) : t.set(r, e), e);
|
|
6
|
-
import { a as E } from "../SourceElement-
|
|
6
|
+
import { a as E } from "../SourceElement-CvsoT5yg.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as f } from "../index-Bv9zgfdb.js";
|
package/lib/image/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Viewport-DB0qAZPJ.cjs"),i=require("../SourceElement-DX6W2-19.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const n=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");class t extends i.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(e){if(e&&this.hasAttribute("webp")&&s.device.isWebp){const r=e.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=r}else this.consumerElement.src=e||""}}n.isBrowser&&!customElements.get("e-image")&&customElements.define("e-image",t);exports.ImageElement=t;
|
package/lib/image/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as m } from "../Viewport-DA10iWAO.js";
|
|
2
|
-
import { a as s } from "../SourceElement-
|
|
2
|
+
import { a as s } from "../SourceElement-CvsoT5yg.js";
|
|
3
3
|
import "../window-resizer/index.js";
|
|
4
4
|
import "../Store-0BVty6AZ.js";
|
|
5
5
|
import { i } from "../index-Bv9zgfdb.js";
|
package/lib/sequence/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var x=s=>{throw TypeError(s)};var I=(s,n,e)=>n.has(s)||x("Cannot "+e);var t=(s,n,e)=>(I(s,n,"read from private field"),e?e.call(s):n.get(s)),c=(s,n,e)=>n.has(s)?x("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(s):n.set(s,e),l=(s,n,e,i)=>(I(s,n,"write to private field"),i?i.call(s,e):n.set(s,e),e);var L=(s,n,e)=>new Promise((i,f)=>{var w=o=>{try{u(e.next(o))}catch(r){f(r)}},y=o=>{try{u(e.throw(o))}catch(r){f(r)}},u=o=>o.done?i(o.value):Promise.resolve(o.value).then(w,y);u((e=e.apply(s,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../css-property/index.cjs"),R=require("../element-resizer/index.cjs"),k=require("../index-DekP7OZe.cjs"),z=require("../canvas-CU5Xjahf.cjs");require("construct-style-sheets-polyfill");const H=require("../SourceElement-
|
|
1
|
+
"use strict";var x=s=>{throw TypeError(s)};var I=(s,n,e)=>n.has(s)||x("Cannot "+e);var t=(s,n,e)=>(I(s,n,"read from private field"),e?e.call(s):n.get(s)),c=(s,n,e)=>n.has(s)?x("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(s):n.set(s,e),l=(s,n,e,i)=>(I(s,n,"write to private field"),i?i.call(s,e):n.set(s,e),e);var L=(s,n,e)=>new Promise((i,f)=>{var w=o=>{try{u(e.next(o))}catch(r){f(r)}},y=o=>{try{u(e.throw(o))}catch(r){f(r)}},u=o=>o.done?i(o.value):Promise.resolve(o.value).then(w,y);u((e=e.apply(s,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../css-property/index.cjs"),R=require("../element-resizer/index.cjs"),k=require("../index-DekP7OZe.cjs"),z=require("../canvas-CU5Xjahf.cjs");require("construct-style-sheets-polyfill");const H=require("../SourceElement-DX6W2-19.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const M=require("../canvas/index.cjs");function W(s){const n=s.match(/\{([\d-]+)\}/);if(n){const e=n[1].split("-");if(e.length===2){const i=parseInt(e[0],10),f=parseInt(e[1],10);return{start:i,end:f}}}return null}var h,E,S,m,d,b,g,p,a,v;class B extends H.SourceElement{constructor(e){super();c(this,h,[]);c(this,E,new q.CSSProperty(this,"--fit","contain"));c(this,S,new q.CSSProperty(this,"--autoplay",!1));c(this,m,new q.CSSProperty(this,"--offset-x",.5));c(this,d,new q.CSSProperty(this,"--offset-y",.5));c(this,b,null);c(this,g,0);c(this,p,1);c(this,a,()=>{if(t(this,h).length){const e=t(this,h)[0];t(this,E).current==="cover"?l(this,b,z.cover(e.naturalWidth,e.naturalHeight,this.consumerElement.width,this.consumerElement.height,t(this,m).current,t(this,d).current)):l(this,b,z.contain(e.naturalWidth,e.naturalHeight,this.consumerElement.width,this.consumerElement.height,t(this,m).current,t(this,d).current))}});c(this,v,e=>{if(this.status.isFalse("loaded")||!t(this,b))return;e.detail.context.clearRect(0,0,e.detail.width,e.detail.height);const i=t(this,h)[t(this,g)];i&&e.detail.context.drawImage(i,...t(this,b)),t(this,S).current&&l(this,g,(t(this,g)+1)%t(this,h).length)});k.isBrowser&&(l(this,p,parseInt(((e==null?void 0:e.pad)||this.getAttribute("pad")||"1").toString())),t(this,E).subscribe(t(this,a)),t(this,m).subscribe(t(this,a)),t(this,d).subscribe(t(this,a)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",t(this,v))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",t(this,v))}))}setProgress(e){t(this,h).length&&l(this,g,Math.floor((t(this,h).length-1)*e))}connectedCallback(){super.connectedCallback(),t(this,S).observe(),t(this,E).observe(),t(this,m).observe(),t(this,d).observe(),R.elementResizer.subscribe(this,t(this,a))}disconnectedCallback(){super.disconnectedCallback(),t(this,S).unobserve(),t(this,E).unobserve(),t(this,m).unobserve(),t(this,d).unobserve(),l(this,h,[]),R.elementResizer.unsubscribe(t(this,a)),this.consumerElement.removeEventListener("canvasRender",t(this,v))}createConsumer(){return new M.CanvasElement}consumeSource(e){return L(this,null,function*(){var i,f,w,y;if(e){this.consumerElement.removeEventListener("canvasRender",t(this,v));const u=[],o=W(e);if(o)for(let r=o.start;r<=o.end;r++){const P=e.replace(/\{([^}]+)\}/,r.toString().padStart(t(this,p),"0")),C=new Image;C.src=P,u.push(C)}else{const r=new Image;r.src=e,u.push(r)}try{yield Promise.all(u.map((r,P)=>new Promise((C,_)=>{r.onload=()=>{C()},r.onerror=j=>{_(`${r.src} Image not found`)}}))),l(this,h,u),t(this,a).call(this),(f=(i=this.consumerElement).onload)==null||f.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",t(this,v))}catch(r){console.error(r),(y=(w=this.consumerElement).onerror)==null||y.call(w,new Event("error"))}}})}}h=new WeakMap,E=new WeakMap,S=new WeakMap,m=new WeakMap,d=new WeakMap,b=new WeakMap,g=new WeakMap,p=new WeakMap,a=new WeakMap,v=new WeakMap;k.isBrowser&&!customElements.get("e-sequence")&&customElements.define("e-sequence",B);exports.SequenceElement=B;
|
package/lib/sequence/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { elementResizer as k } from "../element-resizer/index.js";
|
|
|
24
24
|
import { i as q } from "../index-Bv9zgfdb.js";
|
|
25
25
|
import { c as B, a as H } from "../canvas-DeZ0SLUJ.js";
|
|
26
26
|
import "construct-style-sheets-polyfill";
|
|
27
|
-
import { a as W } from "../SourceElement-
|
|
27
|
+
import { a as W } from "../SourceElement-CvsoT5yg.js";
|
|
28
28
|
import "../window-resizer/index.js";
|
|
29
29
|
import "../Store-0BVty6AZ.js";
|
|
30
30
|
import { CanvasElement as A } from "../canvas/index.js";
|
package/lib/source/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../SourceElement-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../SourceElement-DX6W2-19.cjs");exports.Source=e.Source;exports.SourceElement=e.SourceElement;exports.SourceManager=e.SourceManager;exports.SourceSet=e.SourceSet;
|
package/lib/source/index.js
CHANGED
package/lib/video/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=e=>{throw TypeError(e)};var m=(e,s,t)=>s.has(e)||h("Cannot "+t);var i=(e,s,t)=>(m(e,s,"read from private field"),t?t.call(e):s.get(e)),u=(e,s,t)=>s.has(e)?h("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),c=(e,s,t,l)=>(m(e,s,"write to private field"),l?l.call(e,t):s.set(e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../SourceElement-
|
|
1
|
+
"use strict";var h=e=>{throw TypeError(e)};var m=(e,s,t)=>s.has(e)||h("Cannot "+t);var i=(e,s,t)=>(m(e,s,"read from private field"),t?t.call(e):s.get(e)),u=(e,s,t)=>s.has(e)?h("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),c=(e,s,t,l)=>(m(e,s,"write to private field"),l?l.call(e,t):s.set(e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../SourceElement-DX6W2-19.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const p=require("../index-DekP7OZe.cjs"),b=require("../events-KVanG9sR.cjs");require("construct-style-sheets-polyfill");const o=require("../ticker/index.cjs");var r,n,a;class d extends E.SourceElement{constructor(){super(...arguments);u(this,r,0);u(this,n,!1);u(this,a,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>i(this,r)&&c(this,r,t),b.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:i(this,r)}}),this.consumerElement.readyState===4&&(o.ticker.unsubscribe(i(this,a)),i(this,n)&&this.sourceManager.current&&this.consumerElement.play())})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{c(this,n,!1),this.hasAttribute("capture-autoplay")&&(this.sourceManager.current?this.consumerElement.play():c(this,n,!0)),o.ticker.subscribe(i(this,a))}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&this.consumerElement.pause(),this.hasAttribute("release-pause")&&this.consumerElement.pause(),this.hasAttribute("release-stop")&&(this.consumerElement.pause(),this.consumerElement.currentTime=0),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")}),this.addEventListener("click",()=>{this.hasAttribute("click-controls")&&(this.consumerElement.paused?this.consumerElement.play():this.consumerElement.pause())})}disconnectedCallback(){super.disconnectedCallback(),o.ticker.unsubscribe(i(this,a)),c(this,r,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.hasAttribute("volume")&&(this.consumerElement.volume=parseFloat(this.getAttribute("volume")||"1"))}}r=new WeakMap,n=new WeakMap,a=new WeakMap;p.isBrowser&&!customElements.get("e-video")&&customElements.define("e-video",d);exports.VideoElement=d;
|
package/lib/video/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var l = (e) => {
|
|
|
3
3
|
};
|
|
4
4
|
var h = (e, s, t) => s.has(e) || l("Cannot " + t);
|
|
5
5
|
var i = (e, s, t) => (h(e, s, "read from private field"), t ? t.call(e) : s.get(e)), c = (e, s, t) => s.has(e) ? l("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), o = (e, s, t, m) => (h(e, s, "write to private field"), m ? m.call(e, t) : s.set(e, t), t);
|
|
6
|
-
import { a as d } from "../SourceElement-
|
|
6
|
+
import { a as d } from "../SourceElement-CvsoT5yg.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as p } from "../index-Bv9zgfdb.js";
|
package/lib/youtube/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var v=s=>{throw TypeError(s)};var E=(s,r,t)=>r.has(s)||v("Cannot "+t);var e=(s,r,t)=>(E(s,r,"read from private field"),t?t.call(s):r.get(s)),o=(s,r,t)=>r.has(s)?v("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),u=(s,r,t,a)=>(E(s,r,"write to private field"),a?a.call(s,t):r.set(s,t),t),w=(s,r,t)=>(E(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../SourceElement-
|
|
1
|
+
"use strict";var v=s=>{throw TypeError(s)};var E=(s,r,t)=>r.has(s)||v("Cannot "+t);var e=(s,r,t)=>(E(s,r,"read from private field"),t?t.call(s):r.get(s)),o=(s,r,t)=>r.has(s)?v("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),u=(s,r,t,a)=>(E(s,r,"write to private field"),a?a.call(s,t):r.set(s,t),t),w=(s,r,t)=>(E(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../SourceElement-DX6W2-19.cjs");require("../window-resizer/index.cjs");require("../Store-Cd1GlEmZ.cjs");const L=require("../index-DekP7OZe.cjs"),T=require("../events-KVanG9sR.cjs"),_=require("../string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");var i,c,n,y,l,f,b,R,p,I;const d=class d extends A.SourceElement{constructor(){super();o(this,p);o(this,i);o(this,c);o(this,n,!1);o(this,y,!1);o(this,l,()=>{u(this,n,e(this,n)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),u(this,i,new window.YT.Player(e(this,c),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,f),onError:e(this,b),onStateChange:e(this,R)}}))});o(this,f,()=>{u(this,y,!0),w(this,p,I).call(this)});o(this,b,t=>{var a,h;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(h=(a=this.consumerElement).onerror)==null||h.call(a,new Event("error"))});o(this,R,()=>{});u(this,c,"yt-"+_.generateId(10)),d.__apiReady||(window.onYouTubeIframeAPIReady=()=>{d.__apiReady=!0,T.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,y)?e(this,i).playVideo():u(this,n,!0))}),this.addEventListener("sourceRelease",()=>{e(this,i)&&this.hasAttribute("capture-autoplay")&&(e(this,i).pauseVideo(),this.hasAttribute("replay")&&e(this,i).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,c),t}consumeSource(t){var a;if(t){if(!document.getElementById("youtube-script")){const h=document.createElement("script");h.id,h.src="https://www.youtube.com/iframe_api";const g=document.getElementsByTagName("script")[0];(a=g.parentNode)==null||a.insertBefore(h,g)}e(this,i)?w(this,p,I).call(this):d.__apiReady?e(this,l).call(this):addEventListener("youTubeIframeAPIReady",e(this,l))}else e(this,i)&&e(this,i).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,i)&&e(this,i).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,l))}};i=new WeakMap,c=new WeakMap,n=new WeakMap,y=new WeakMap,l=new WeakMap,f=new WeakMap,b=new WeakMap,R=new WeakMap,p=new WeakSet,I=function(){var t,a;this.currentURL&&(this.currentURL.startsWith("http")?e(this,i).loadVideoByUrl(this.currentURL):e(this,i).loadVideoById(this.currentURL)),e(this,n)?e(this,i).playVideo():e(this,i).stopVideo(),u(this,n,!1),(a=(t=this.consumerElement).onload)==null||a.call(t,new Event("load"))},d.__apiReady=!1;let m=d;L.isBrowser&&!customElements.get("e-youtube")&&customElements.define("e-youtube",m);exports.YouTubeElement=m;
|
package/lib/youtube/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var L = (s) => {
|
|
|
3
3
|
};
|
|
4
4
|
var b = (s, r, t) => r.has(s) || L("Cannot " + t);
|
|
5
5
|
var e = (s, r, t) => (b(s, r, "read from private field"), t ? t.call(s) : r.get(s)), o = (s, r, t) => r.has(s) ? L("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(s) : r.set(s, t), u = (s, r, t, a) => (b(s, r, "write to private field"), a ? a.call(s, t) : r.set(s, t), t), E = (s, r, t) => (b(s, r, "access private method"), t);
|
|
6
|
-
import { a as g } from "../SourceElement-
|
|
6
|
+
import { a as g } from "../SourceElement-CvsoT5yg.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as v } from "../index-Bv9zgfdb.js";
|