aptechka 0.37.2 → 0.37.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Y=r=>{throw TypeError(r)};var D=(r,i,t)=>i.has(r)||Y("Cannot "+t);var e=(r,i,t)=>(D(r,i,"read from private field"),t?t.call(r):i.get(r)),s=(r,i,t)=>i.has(r)?Y("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(r):i.set(r,t),a=(r,i,t,n)=>(D(r,i,"write to private field"),n?n.call(r,t):i.set(r,t),t),H=(r,i,t)=>(D(r,i,"access private method"),t);var G=(r,i,t)=>new Promise((n,l)=>{var S=d=>{try{b(t.next(d))}catch(h){l(h)}},$=d=>{try{b(t.throw(d))}catch(h){l(h)}},b=d=>d.done?n(d.value):Promise.resolve(d.value).then(S,$);b((t=t.apply(r,i)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const re=require("../device/index.cjs"),ne=require("../source/index.cjs"),ae=require("../class-linked-status/index.cjs"),Z=require("../browser-CpzFX2xg.cjs"),N=require("../events-KVanG9sR.cjs"),oe=require("../string-DhgS_iFl.cjs"),U=require("../loading/index.cjs"),O=require("../css-property/index.cjs"),J=require("../element-resizer/vanilla/index.cjs"),Q=require("../canvas-CU5Xjahf.cjs"),ce=require("../canvas/index.cjs"),K=require("../ticker/vanilla/index.cjs");let he=0;var u,o,p,I,m,_,C,c,q,P,R,V,W,T,F;class j extends HTMLElement{constructor(){super();s(this,R);s(this,u,null);s(this,o,null);s(this,p,!1);s(this,I,!1);s(this,m,!1);s(this,_,"");s(this,C,"");s(this,c,new ae.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,q,null);s(this,P);s(this,W,t=>{const n=t[0];e(this,m)&&(!e(this,I)||this.hasAttribute("reload-source"))&&n.isIntersecting&&this.triggerLazyLoad(),n.isIntersecting?N.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&H(this,R,V).call(this,void 0),N.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,T,()=>{e(this,c).set("loaded",!0),e(this,c).set("error",!1),e(this,c).set("loading",!1),!e(this,m)&&!e(this,p)&&U.loading.complete(e(this,C));const t=getComputedStyle(this).getPropertyValue("--clear-duration");t&&a(this,P,setTimeout(()=>e(this,c).set("clear",!0),parseFloat(t)*1e3)),a(this,p,!0)});s(this,F,t=>{e(this,c).set("loaded",!1),e(this,c).set("error",!0),e(this,c).set("loading",!1),!e(this,m)&&!e(this,p)&&U.loading.error(e(this,C)),a(this,p,!0)});Z.isBrowser&&window.IntersectionObserver&&(a(this,_,`source-consumer-${++he}`),a(this,q,new IntersectionObserver(e(this,W))))}get consumerElement(){return e(this,o)}get sourceManager(){return e(this,u)}get status(){return e(this,c)}get isLazy(){return e(this,m)}triggerLazyLoad(){e(this,u).current&&e(this,u).current!==e(this,u).previous&&H(this,R,V).call(this,e(this,u).current),a(this,I,!0)}connectedCallback(){const t=this.getAttribute("srcset");t&&(a(this,o,this.createConsumer()),e(this,o).style.cssText=`
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
|
-
`,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(n=>{if(n.name!=="srcset"){const l=n.nodeValue||"",
|
|
5
|
+
`,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(n=>{if(n.name!=="srcset"){const l=n.nodeValue||"",S=oe.kebabToCamel(n.name);S in e(this,o)&&(e(this,o)[S]=l||!0)}}),this.appendChild(e(this,o)),a(this,u,new ne.SourceManager({srcset:t})),a(this,m,this.hasAttribute("lazy")),e(this,u).subscribe(n=>{(!e(this,m)||e(this,m)&&e(this,I))&&H(this,R,V).call(this,n.current)}),e(this,q).observe(this),e(this,u).connect())}disconnectedCallback(){e(this,q).disconnect(),e(this,u).close(),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,o).remove(),e(this,c).reset(),clearTimeout(e(this,P))}}u=new WeakMap,o=new WeakMap,p=new WeakMap,I=new WeakMap,m=new WeakMap,_=new WeakMap,C=new WeakMap,c=new WeakMap,q=new WeakMap,P=new WeakMap,R=new WeakSet,V=function(t){if(clearTimeout(e(this,P)),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,c).set("loaded",!1),e(this,c).set("error",!1),e(this,c).set("loading",!1),e(this,c).set("clear",!1),t){a(this,C,`${e(this,_)}-${t.url}`);const n=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0);const l=n?t.url:t.name+t.extension;this.consumeSource(l),!e(this,m)&&!e(this,p)&&U.loading.add(e(this,C)),e(this,o).onloadeddata=()=>{e(this,T).call(this)},e(this,o).onload=()=>{e(this,T).call(this)},e(this,o).onerror=()=>{e(this,F).call(this,l)}}else this.consumeSource(null)},W=new WeakMap,T=new WeakMap,F=new WeakMap;class ee extends j{createConsumer(){return document.createElement("img")}consumeSource(i){if(i&&this.hasAttribute("webp")&&re.device.isWebp){const t=i.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=i||""}}customElements.get("e-image")||customElements.define("e-image",ee);function le(r){const i=r.match(/\{([\d-]+)\}/);if(i){const t=i[1].split("-");if(t.length===2){const n=parseInt(t[0],10),l=parseInt(t[1],10);return{start:n,end:l}}}return null}var f,w,A,E,v,L,k,M,g,y;class te extends j{constructor(t){super();s(this,f,[]);s(this,w,new O.CSSProperty(this,"--fit","contain"));s(this,A,new O.CSSProperty(this,"--autoplay",!1));s(this,E,new O.CSSProperty(this,"--offset-x",.5));s(this,v,new O.CSSProperty(this,"--offset-y",.5));s(this,L,null);s(this,k,0);s(this,M,1);s(this,g,()=>{if(e(this,f).length){const t=e(this,f)[0];e(this,w).current==="cover"?a(this,L,Q.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,E).current,e(this,v).current)):a(this,L,Q.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,E).current,e(this,v).current))}});s(this,y,t=>{if(this.status.isFalse("loaded")||!e(this,L))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const n=e(this,f)[e(this,k)];n&&t.detail.context.drawImage(n,...e(this,L)),e(this,A).current&&a(this,k,(e(this,k)+1)%e(this,f).length)});Z.isBrowser&&(a(this,M,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,w).subscribe(e(this,g)),e(this,E).subscribe(e(this,g)),e(this,v).subscribe(e(this,g)),this.addEventListener("sourceCapture",n=>{this.consumerElement.addEventListener("canvasRender",e(this,y))}),this.addEventListener("sourceRelease",n=>{this.consumerElement.removeEventListener("canvasRender",e(this,y))}))}setProgress(t){e(this,f).length&&a(this,k,Math.floor((e(this,f).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,A).observe(),e(this,w).observe(),e(this,E).observe(),e(this,v).observe(),J.elementResizer.subscribe(this,e(this,g))}disconnectedCallback(){super.disconnectedCallback(),e(this,A).unobserve(),e(this,w).unobserve(),e(this,E).unobserve(),e(this,v).unobserve(),a(this,f,[]),J.elementResizer.unsubscribe(e(this,g)),this.consumerElement.removeEventListener("canvasRender",e(this,y))}createConsumer(){return new ce.CanvasElement}consumeSource(t){return G(this,null,function*(){var n,l,S,$;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,y));const b=[],d=le(t);if(d)for(let h=d.start;h<=d.end;h++){const X=t.replace(/\{([^}]+)\}/,h.toString().padStart(e(this,M),"0")),B=new Image;B.src=X,b.push(B)}else{const h=new Image;h.src=t,b.push(h)}try{yield Promise.all(b.map((h,X)=>new Promise((B,ie)=>{h.onload=()=>{B()},h.onerror=ue=>{ie(`${h.src} Image not found`)}}))),a(this,f,b),e(this,g).call(this),(l=(n=this.consumerElement).onload)==null||l.call(n,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,y))}catch(h){console.error(h),($=(S=this.consumerElement).onerror)==null||$.call(S,new Event("error"))}}})}}f=new WeakMap,w=new WeakMap,A=new WeakMap,E=new WeakMap,v=new WeakMap,L=new WeakMap,k=new WeakMap,M=new WeakMap,g=new WeakMap,y=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",te);var x,z;class se extends j{constructor(){super(...arguments);s(this,x,0);s(this,z,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,x)&&a(this,x,t),N.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,x)}}),this.consumerElement.readyState===4&&K.ticker.unsubscribe(e(this,z))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{K.ticker.subscribe(e(this,z)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),K.ticker.unsubscribe(e(this,z)),a(this,x,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}x=new WeakMap,z=new WeakMap;customElements.get("e-video")||customElements.define("e-video",se);exports.ImageElement=ee;exports.SequenceElement=te;exports.SourceElement=j;exports.VideoElement=se;
|
|
@@ -1,138 +1,145 @@
|
|
|
1
|
-
var
|
|
1
|
+
var G = (r) => {
|
|
2
2
|
throw TypeError(r);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var e = (r,
|
|
6
|
-
var
|
|
4
|
+
var U = (r, i, t) => i.has(r) || G("Cannot " + t);
|
|
5
|
+
var e = (r, i, t) => (U(r, i, "read from private field"), t ? t.call(r) : i.get(r)), s = (r, i, t) => i.has(r) ? G("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(r) : i.set(r, t), o = (r, i, t, n) => (U(r, i, "write to private field"), n ? n.call(r, t) : i.set(r, t), t), B = (r, i, t) => (U(r, i, "access private method"), t);
|
|
6
|
+
var J = (r, i, t) => new Promise((n, l) => {
|
|
7
7
|
var S = (m) => {
|
|
8
8
|
try {
|
|
9
9
|
b(t.next(m));
|
|
10
|
-
} catch (
|
|
11
|
-
l(
|
|
10
|
+
} catch (c) {
|
|
11
|
+
l(c);
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, W = (m) => {
|
|
14
14
|
try {
|
|
15
15
|
b(t.throw(m));
|
|
16
|
-
} catch (
|
|
17
|
-
l(
|
|
16
|
+
} catch (c) {
|
|
17
|
+
l(c);
|
|
18
18
|
}
|
|
19
|
-
}, b = (m) => m.done ? n(m.value) : Promise.resolve(m.value).then(S,
|
|
20
|
-
b((t = t.apply(r,
|
|
19
|
+
}, b = (m) => m.done ? n(m.value) : Promise.resolve(m.value).then(S, W);
|
|
20
|
+
b((t = t.apply(r, i)).next());
|
|
21
21
|
});
|
|
22
|
-
import { device as
|
|
23
|
-
import { SourceManager as
|
|
24
|
-
import { ClassLinkedStatus as
|
|
25
|
-
import { i as
|
|
26
|
-
import { d as
|
|
27
|
-
import { k as
|
|
22
|
+
import { device as ee } from "../device/index.js";
|
|
23
|
+
import { SourceManager as te } from "../source/index.js";
|
|
24
|
+
import { ClassLinkedStatus as se } from "../class-linked-status/index.js";
|
|
25
|
+
import { i as Z } from "../browser-0zX67oeU.js";
|
|
26
|
+
import { d as N } from "../events-CsVF98U6.js";
|
|
27
|
+
import { k as ie } from "../string-f0Dnk0L1.js";
|
|
28
28
|
import { loading as j } from "../loading/index.js";
|
|
29
|
-
import { CSSProperty as
|
|
30
|
-
import { elementResizer as
|
|
31
|
-
import { c as
|
|
32
|
-
import { CanvasElement as
|
|
33
|
-
import { ticker as
|
|
34
|
-
let
|
|
35
|
-
var u,
|
|
36
|
-
class
|
|
29
|
+
import { CSSProperty as F } from "../css-property/index.js";
|
|
30
|
+
import { elementResizer as Q } from "../element-resizer/vanilla/index.js";
|
|
31
|
+
import { c as re, a as ne } from "../canvas-DeZ0SLUJ.js";
|
|
32
|
+
import { CanvasElement as oe } from "../canvas/index.js";
|
|
33
|
+
import { ticker as K } from "../ticker/vanilla/index.js";
|
|
34
|
+
let ae = 0;
|
|
35
|
+
var u, a, g, x, d, M, C, h, A, R, P, O, V, $, D;
|
|
36
|
+
class X extends HTMLElement {
|
|
37
37
|
constructor() {
|
|
38
38
|
super();
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
s(this, P);
|
|
40
|
+
s(this, u, null);
|
|
41
|
+
s(this, a, null);
|
|
42
|
+
s(this, g, !1);
|
|
43
|
+
s(this, x, !1);
|
|
44
|
+
s(this, d, !1);
|
|
45
|
+
s(this, M, "");
|
|
46
|
+
s(this, C, "");
|
|
47
|
+
s(this, h, new se(this, {
|
|
48
48
|
loading: !1,
|
|
49
49
|
loaded: !1,
|
|
50
|
-
error: !1
|
|
50
|
+
error: !1,
|
|
51
|
+
clear: !1
|
|
51
52
|
}));
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
s(this, A, null);
|
|
54
|
+
s(this, R);
|
|
55
|
+
s(this, V, (t) => {
|
|
54
56
|
const n = t[0];
|
|
55
|
-
e(this, d) && (!e(this, x) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ?
|
|
57
|
+
e(this, d) && (!e(this, x) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ? N(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && B(this, P, O).call(this, void 0), N(this, "sourceRelease", { custom: !0 }));
|
|
56
58
|
});
|
|
57
|
-
|
|
58
|
-
e(this,
|
|
59
|
+
s(this, $, () => {
|
|
60
|
+
e(this, h).set("loaded", !0), e(this, h).set("error", !1), e(this, h).set("loading", !1), !e(this, d) && !e(this, g) && j.complete(e(this, C));
|
|
61
|
+
const t = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
62
|
+
t && o(this, R, setTimeout(
|
|
63
|
+
() => e(this, h).set("clear", !0),
|
|
64
|
+
parseFloat(t) * 1e3
|
|
65
|
+
)), o(this, g, !0);
|
|
59
66
|
});
|
|
60
|
-
|
|
61
|
-
e(this,
|
|
67
|
+
s(this, D, (t) => {
|
|
68
|
+
e(this, h).set("loaded", !1), e(this, h).set("error", !0), e(this, h).set("loading", !1), !e(this, d) && !e(this, g) && j.error(e(this, C)), o(this, g, !0);
|
|
62
69
|
});
|
|
63
|
-
|
|
64
|
-
e(this,
|
|
70
|
+
Z && window.IntersectionObserver && (o(this, M, `source-consumer-${++ae}`), o(this, A, new IntersectionObserver(
|
|
71
|
+
e(this, V)
|
|
65
72
|
)));
|
|
66
73
|
}
|
|
67
74
|
get consumerElement() {
|
|
68
|
-
return e(this,
|
|
75
|
+
return e(this, a);
|
|
69
76
|
}
|
|
70
77
|
get sourceManager() {
|
|
71
78
|
return e(this, u);
|
|
72
79
|
}
|
|
73
80
|
get status() {
|
|
74
|
-
return e(this,
|
|
81
|
+
return e(this, h);
|
|
75
82
|
}
|
|
76
83
|
get isLazy() {
|
|
77
84
|
return e(this, d);
|
|
78
85
|
}
|
|
79
86
|
triggerLazyLoad() {
|
|
80
|
-
e(this, u).current && e(this, u).current !== e(this, u).previous &&
|
|
87
|
+
e(this, u).current && e(this, u).current !== e(this, u).previous && B(this, P, O).call(this, e(this, u).current), o(this, x, !0);
|
|
81
88
|
}
|
|
82
89
|
connectedCallback() {
|
|
83
90
|
const t = this.getAttribute("srcset");
|
|
84
|
-
t && (
|
|
91
|
+
t && (o(this, a, this.createConsumer()), e(this, a).style.cssText = `
|
|
85
92
|
display: block;
|
|
86
93
|
width: 100%;
|
|
87
94
|
height: 100%;
|
|
88
|
-
`, e(this,
|
|
95
|
+
`, e(this, a).classList.add("source-consumer"), Array.from(this.attributes).forEach((n) => {
|
|
89
96
|
if (n.name !== "srcset") {
|
|
90
|
-
const l = n.nodeValue || "", S =
|
|
91
|
-
S in e(this,
|
|
97
|
+
const l = n.nodeValue || "", S = ie(n.name);
|
|
98
|
+
S in e(this, a) && (e(this, a)[S] = l || !0);
|
|
92
99
|
}
|
|
93
|
-
}), this.appendChild(e(this,
|
|
100
|
+
}), this.appendChild(e(this, a)), o(this, u, new te({
|
|
94
101
|
srcset: t
|
|
95
|
-
})),
|
|
96
|
-
(!e(this, d) || e(this, d) && e(this, x)) &&
|
|
102
|
+
})), o(this, d, this.hasAttribute("lazy")), e(this, u).subscribe((n) => {
|
|
103
|
+
(!e(this, d) || e(this, d) && e(this, x)) && B(this, P, O).call(this, n.current);
|
|
97
104
|
}), e(this, A).observe(this), e(this, u).connect());
|
|
98
105
|
}
|
|
99
106
|
disconnectedCallback() {
|
|
100
|
-
e(this, A).disconnect(), e(this, u).close(), e(this,
|
|
107
|
+
e(this, A).disconnect(), e(this, u).close(), e(this, a).onloadeddata = null, e(this, a).onload = null, e(this, a).onerror = null, e(this, a).remove(), e(this, h).reset(), clearTimeout(e(this, R));
|
|
101
108
|
}
|
|
102
109
|
}
|
|
103
|
-
u = new WeakMap(),
|
|
104
|
-
if (e(this,
|
|
105
|
-
|
|
110
|
+
u = new WeakMap(), a = new WeakMap(), g = new WeakMap(), x = new WeakMap(), d = new WeakMap(), M = new WeakMap(), C = new WeakMap(), h = new WeakMap(), A = new WeakMap(), R = new WeakMap(), P = new WeakSet(), O = function(t) {
|
|
111
|
+
if (clearTimeout(e(this, R)), e(this, a).onloadeddata = null, e(this, a).onload = null, e(this, a).onerror = null, e(this, h).set("loaded", !1), e(this, h).set("error", !1), e(this, h).set("loading", !1), e(this, h).set("clear", !1), t) {
|
|
112
|
+
o(this, C, `${e(this, M)}-${t.url}`);
|
|
106
113
|
const n = this.hasAttribute("keep-source-parameters");
|
|
107
|
-
e(this,
|
|
114
|
+
e(this, h).set("loading", !0);
|
|
108
115
|
const l = n ? t.url : t.name + t.extension;
|
|
109
|
-
this.consumeSource(l), !e(this, d) && !e(this, g) && j.add(e(this, C)), e(this,
|
|
116
|
+
this.consumeSource(l), !e(this, d) && !e(this, g) && j.add(e(this, C)), e(this, a).onloadeddata = () => {
|
|
110
117
|
e(this, $).call(this);
|
|
111
|
-
}, e(this,
|
|
118
|
+
}, e(this, a).onload = () => {
|
|
112
119
|
e(this, $).call(this);
|
|
113
|
-
}, e(this,
|
|
114
|
-
e(this,
|
|
120
|
+
}, e(this, a).onerror = () => {
|
|
121
|
+
e(this, D).call(this, l);
|
|
115
122
|
};
|
|
116
123
|
} else
|
|
117
124
|
this.consumeSource(null);
|
|
118
|
-
},
|
|
119
|
-
class
|
|
125
|
+
}, V = new WeakMap(), $ = new WeakMap(), D = new WeakMap();
|
|
126
|
+
class he extends X {
|
|
120
127
|
createConsumer() {
|
|
121
128
|
return document.createElement("img");
|
|
122
129
|
}
|
|
123
|
-
consumeSource(
|
|
124
|
-
if (
|
|
125
|
-
const t =
|
|
130
|
+
consumeSource(i) {
|
|
131
|
+
if (i && this.hasAttribute("webp") && ee.isWebp) {
|
|
132
|
+
const t = i.split(".").slice(0, -1).join(".") + ".webp";
|
|
126
133
|
this.consumerElement.src = t;
|
|
127
134
|
} else
|
|
128
|
-
this.consumerElement.src =
|
|
135
|
+
this.consumerElement.src = i || "";
|
|
129
136
|
}
|
|
130
137
|
}
|
|
131
|
-
customElements.get("e-image") || customElements.define("e-image",
|
|
132
|
-
function
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
const t =
|
|
138
|
+
customElements.get("e-image") || customElements.define("e-image", he);
|
|
139
|
+
function ce(r) {
|
|
140
|
+
const i = r.match(/\{([\d-]+)\}/);
|
|
141
|
+
if (i) {
|
|
142
|
+
const t = i[1].split("-");
|
|
136
143
|
if (t.length === 2) {
|
|
137
144
|
const n = parseInt(t[0], 10), l = parseInt(t[1], 10);
|
|
138
145
|
return { start: n, end: l };
|
|
@@ -140,33 +147,33 @@ function he(r) {
|
|
|
140
147
|
}
|
|
141
148
|
return null;
|
|
142
149
|
}
|
|
143
|
-
var f, w,
|
|
144
|
-
class
|
|
150
|
+
var f, w, z, E, v, L, k, H, p, y;
|
|
151
|
+
class le extends X {
|
|
145
152
|
constructor(t) {
|
|
146
153
|
super();
|
|
147
|
-
|
|
148
|
-
|
|
154
|
+
s(this, f, []);
|
|
155
|
+
s(this, w, new F(
|
|
149
156
|
this,
|
|
150
157
|
"--fit",
|
|
151
158
|
"contain"
|
|
152
159
|
));
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
+
s(this, z, new F(this, "--autoplay", !1));
|
|
161
|
+
s(this, E, new F(this, "--offset-x", 0.5));
|
|
162
|
+
s(this, v, new F(this, "--offset-y", 0.5));
|
|
163
|
+
s(this, L, null);
|
|
164
|
+
s(this, k, 0);
|
|
165
|
+
s(this, H, 1);
|
|
166
|
+
s(this, p, () => {
|
|
160
167
|
if (e(this, f).length) {
|
|
161
168
|
const t = e(this, f)[0];
|
|
162
|
-
e(this, w).current === "cover" ?
|
|
169
|
+
e(this, w).current === "cover" ? o(this, L, re(
|
|
163
170
|
t.naturalWidth,
|
|
164
171
|
t.naturalHeight,
|
|
165
172
|
this.consumerElement.width,
|
|
166
173
|
this.consumerElement.height,
|
|
167
174
|
e(this, E).current,
|
|
168
175
|
e(this, v).current
|
|
169
|
-
)) :
|
|
176
|
+
)) : o(this, L, ne(
|
|
170
177
|
t.naturalWidth,
|
|
171
178
|
t.naturalHeight,
|
|
172
179
|
this.consumerElement.width,
|
|
@@ -176,14 +183,14 @@ class ce extends N {
|
|
|
176
183
|
));
|
|
177
184
|
}
|
|
178
185
|
});
|
|
179
|
-
|
|
186
|
+
s(this, y, (t) => {
|
|
180
187
|
if (this.status.isFalse("loaded") || !e(this, L))
|
|
181
188
|
return;
|
|
182
189
|
t.detail.context.clearRect(0, 0, t.detail.width, t.detail.height);
|
|
183
190
|
const n = e(this, f)[e(this, k)];
|
|
184
|
-
n && t.detail.context.drawImage(n, ...e(this, L)), e(this,
|
|
191
|
+
n && t.detail.context.drawImage(n, ...e(this, L)), e(this, z).current && o(this, k, (e(this, k) + 1) % e(this, f).length);
|
|
185
192
|
});
|
|
186
|
-
|
|
193
|
+
Z && (o(this, H, parseInt(
|
|
187
194
|
((t == null ? void 0 : t.pad) || this.getAttribute("pad") || "1").toString()
|
|
188
195
|
)), e(this, w).subscribe(e(this, p)), e(this, E).subscribe(e(this, p)), e(this, v).subscribe(e(this, p)), this.addEventListener("sourceCapture", (n) => {
|
|
189
196
|
this.consumerElement.addEventListener(
|
|
@@ -198,82 +205,82 @@ class ce extends N {
|
|
|
198
205
|
}));
|
|
199
206
|
}
|
|
200
207
|
setProgress(t) {
|
|
201
|
-
e(this, f).length &&
|
|
208
|
+
e(this, f).length && o(this, k, Math.floor((e(this, f).length - 1) * t));
|
|
202
209
|
}
|
|
203
210
|
connectedCallback() {
|
|
204
|
-
super.connectedCallback(), e(this,
|
|
211
|
+
super.connectedCallback(), e(this, z).observe(), e(this, w).observe(), e(this, E).observe(), e(this, v).observe(), Q.subscribe(this, e(this, p));
|
|
205
212
|
}
|
|
206
213
|
disconnectedCallback() {
|
|
207
|
-
super.disconnectedCallback(), e(this,
|
|
214
|
+
super.disconnectedCallback(), e(this, z).unobserve(), e(this, w).unobserve(), e(this, E).unobserve(), e(this, v).unobserve(), o(this, f, []), Q.unsubscribe(e(this, p)), this.consumerElement.removeEventListener(
|
|
208
215
|
"canvasRender",
|
|
209
216
|
e(this, y)
|
|
210
217
|
);
|
|
211
218
|
}
|
|
212
219
|
createConsumer() {
|
|
213
|
-
return new
|
|
220
|
+
return new oe();
|
|
214
221
|
}
|
|
215
222
|
consumeSource(t) {
|
|
216
|
-
return
|
|
217
|
-
var n, l, S,
|
|
223
|
+
return J(this, null, function* () {
|
|
224
|
+
var n, l, S, W;
|
|
218
225
|
if (t) {
|
|
219
226
|
this.consumerElement.removeEventListener(
|
|
220
227
|
"canvasRender",
|
|
221
228
|
e(this, y)
|
|
222
229
|
);
|
|
223
|
-
const b = [], m =
|
|
230
|
+
const b = [], m = ce(t);
|
|
224
231
|
if (m)
|
|
225
|
-
for (let
|
|
226
|
-
const
|
|
232
|
+
for (let c = m.start; c <= m.end; c++) {
|
|
233
|
+
const Y = t.replace(
|
|
227
234
|
/\{([^}]+)\}/,
|
|
228
|
-
|
|
229
|
-
),
|
|
230
|
-
|
|
235
|
+
c.toString().padStart(e(this, H), "0")
|
|
236
|
+
), q = new Image();
|
|
237
|
+
q.src = Y, b.push(q);
|
|
231
238
|
}
|
|
232
239
|
else {
|
|
233
|
-
const
|
|
234
|
-
|
|
240
|
+
const c = new Image();
|
|
241
|
+
c.src = t, b.push(c);
|
|
235
242
|
}
|
|
236
243
|
try {
|
|
237
244
|
yield Promise.all(
|
|
238
|
-
b.map((
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
},
|
|
242
|
-
|
|
245
|
+
b.map((c, Y) => new Promise((q, _) => {
|
|
246
|
+
c.onload = () => {
|
|
247
|
+
q();
|
|
248
|
+
}, c.onerror = (me) => {
|
|
249
|
+
_(`${c.src} Image not found`);
|
|
243
250
|
};
|
|
244
251
|
}))
|
|
245
|
-
),
|
|
252
|
+
), o(this, f, b), e(this, p).call(this), (l = (n = this.consumerElement).onload) == null || l.call(n, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
|
|
246
253
|
"canvasRender",
|
|
247
254
|
e(this, y)
|
|
248
255
|
);
|
|
249
|
-
} catch (
|
|
250
|
-
console.error(
|
|
256
|
+
} catch (c) {
|
|
257
|
+
console.error(c), (W = (S = this.consumerElement).onerror) == null || W.call(S, new Event("error"));
|
|
251
258
|
}
|
|
252
259
|
}
|
|
253
260
|
});
|
|
254
261
|
}
|
|
255
262
|
}
|
|
256
|
-
f = new WeakMap(), w = new WeakMap(),
|
|
257
|
-
customElements.get("e-sequence") || customElements.define("e-sequence",
|
|
258
|
-
var I,
|
|
259
|
-
class
|
|
263
|
+
f = new WeakMap(), w = new WeakMap(), z = new WeakMap(), E = new WeakMap(), v = new WeakMap(), L = new WeakMap(), k = new WeakMap(), H = new WeakMap(), p = new WeakMap(), y = new WeakMap();
|
|
264
|
+
customElements.get("e-sequence") || customElements.define("e-sequence", le);
|
|
265
|
+
var I, T;
|
|
266
|
+
class ue extends X {
|
|
260
267
|
constructor() {
|
|
261
268
|
super(...arguments);
|
|
262
|
-
|
|
263
|
-
|
|
269
|
+
s(this, I, 0);
|
|
270
|
+
s(this, T, () => {
|
|
264
271
|
this.classList.add(`state-${this.consumerElement.readyState}`);
|
|
265
272
|
const t = this.consumerElement.readyState / 4;
|
|
266
|
-
t > e(this, I) &&
|
|
273
|
+
t > e(this, I) && o(this, I, t), N(this, "videoReadyStateChange", {
|
|
267
274
|
detail: {
|
|
268
275
|
readyState: this.consumerElement.readyState,
|
|
269
276
|
progress: e(this, I)
|
|
270
277
|
}
|
|
271
|
-
}), this.consumerElement.readyState === 4 &&
|
|
278
|
+
}), this.consumerElement.readyState === 4 && K.unsubscribe(e(this, T));
|
|
272
279
|
});
|
|
273
280
|
}
|
|
274
281
|
connectedCallback() {
|
|
275
282
|
super.connectedCallback(), this.addEventListener("sourceCapture", () => {
|
|
276
|
-
|
|
283
|
+
K.subscribe(e(this, T)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
|
|
277
284
|
}), this.addEventListener("sourceRelease", () => {
|
|
278
285
|
this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
|
|
279
286
|
"state-0",
|
|
@@ -285,7 +292,7 @@ class le extends N {
|
|
|
285
292
|
});
|
|
286
293
|
}
|
|
287
294
|
disconnectedCallback() {
|
|
288
|
-
super.disconnectedCallback(),
|
|
295
|
+
super.disconnectedCallback(), K.unsubscribe(e(this, T)), o(this, I, 0);
|
|
289
296
|
}
|
|
290
297
|
createConsumer() {
|
|
291
298
|
return document.createElement("video");
|
|
@@ -294,11 +301,11 @@ class le extends N {
|
|
|
294
301
|
this.consumerElement.src = t || "", this.consumerElement.autoplay = !0;
|
|
295
302
|
}
|
|
296
303
|
}
|
|
297
|
-
I = new WeakMap(),
|
|
298
|
-
customElements.get("e-video") || customElements.define("e-video",
|
|
304
|
+
I = new WeakMap(), T = new WeakMap();
|
|
305
|
+
customElements.get("e-video") || customElements.define("e-video", ue);
|
|
299
306
|
export {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
307
|
+
he as ImageElement,
|
|
308
|
+
le as SequenceElement,
|
|
309
|
+
X as SourceElement,
|
|
310
|
+
ue as VideoElement
|
|
304
311
|
};
|