aptechka 0.69.5 → 0.69.6
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-DDhkg7kr.cjs +5 -0
- package/lib/SourceElement-DJtFrWOz.js +224 -0
- 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/SourceElement.d.ts +1 -0
- 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
- package/lib/SourceElement-D_YeNqsI.cjs +0 -5
- package/lib/SourceElement-jbviggZp.js +0 -217
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var Q=a=>{throw TypeError(a)};var N=(a,n,e)=>n.has(a)||Q("Cannot "+e);var t=(a,n,e)=>(N(a,n,"read from private field"),e?e.call(a):n.get(a)),i=(a,n,e)=>n.has(a)?Q("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),s=(a,n,e,c)=>(N(a,n,"write to private field"),c?c.call(a,e):n.set(a,e),e),D=(a,n,e)=>(N(a,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,o,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,o,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,o).set("loaded",!0),t(this,o).set("error",!1),t(this,o).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,o).set("clear",!0)},parseFloat(e)*1e3)):t(this,o).set("clear",!0),s(this,y,!0)});i(this,G,e=>{t(this,o).set("loaded",!1),t(this,o).set("error",!0),t(this,o).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,o).set("playing",!0)});i(this,_,()=>{t(this,o).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,o)}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,o).addElement(c),s(this,r,this.createConsumer()),t(this,r).style.cssText=`
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
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,o).reset()}}m=new WeakMap,r=new WeakMap,y=new WeakMap,b=new WeakMap,p=new WeakMap,O=new WeakMap,k=new WeakMap,o=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,o).set("loaded",!1),t(this,o).set("error",!1),t(this,o).set("loading",!1),t(this,o).set("clear",!1),e){s(this,k,`${t(this,O)}-${e.url}`);const c=this.hasAttribute("keep-source-parameters");t(this,o).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;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
var J = (a) => {
|
|
2
|
+
throw TypeError(a);
|
|
3
|
+
};
|
|
4
|
+
var N = (a, n, e) => n.has(a) || J("Cannot " + e);
|
|
5
|
+
var t = (a, n, e) => (N(a, n, "read from private field"), e ? e.call(a) : n.get(a)), i = (a, n, e) => n.has(a) ? J("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, e), s = (a, n, e, l) => (N(a, n, "write to private field"), l ? l.call(a, e) : n.set(a, e), e), F = (a, n, e) => (N(a, n, "access private method"), e);
|
|
6
|
+
import { ElementLinkedStore as Y } from "./element-linked-store/index.js";
|
|
7
|
+
import { i as tt } from "./index-Bv9zgfdb.js";
|
|
8
|
+
import { d as H } from "./events-CsVF98U6.js";
|
|
9
|
+
import { k as et } from "./string-BlMQbe8b.js";
|
|
10
|
+
import "construct-style-sheets-polyfill";
|
|
11
|
+
import { loading as W } from "./loading/index.js";
|
|
12
|
+
import { RESIZE_ORDER as st } from "./order/index.js";
|
|
13
|
+
import { windowResizer as Q } from "./window-resizer/index.js";
|
|
14
|
+
import { S as it } from "./Store-0BVty6AZ.js";
|
|
15
|
+
var T, w, O, L, u, f, k;
|
|
16
|
+
class rt {
|
|
17
|
+
constructor(n) {
|
|
18
|
+
i(this, T);
|
|
19
|
+
i(this, w);
|
|
20
|
+
i(this, O);
|
|
21
|
+
i(this, L);
|
|
22
|
+
i(this, u);
|
|
23
|
+
i(this, f);
|
|
24
|
+
i(this, k);
|
|
25
|
+
s(this, T, n);
|
|
26
|
+
let e = n.split(".");
|
|
27
|
+
const l = /\b\d{1,2}x\b/g, d = e.find((g) => g.match(l) && parseInt(g));
|
|
28
|
+
s(this, O, d ? parseInt(d) : 1), d && (e = e.slice(0, -1)), s(this, w, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
29
|
+
const c = /\d+max/g, x = /\d+min/g, U = /\d+mar/g, D = /\d+mir/g, K = e.find((g) => g.match(c)), h = e.find((g) => g.match(x)), b = e.find((g) => g.match(U)), Z = e.find((g) => g.match(D));
|
|
30
|
+
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this, L, `(max-aspect-ratio: ${t(this, u)})`)) : Z ? (s(this, u, parseInt(Z)), 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, w, t(this, w).replace(
|
|
31
|
+
`.${t(this, u)}${t(this, f)}`,
|
|
32
|
+
""
|
|
33
|
+
)), s(this, k, e[e.length - 1] === t(this, w) ? "" : "." + e[e.length - 1]), s(this, k, t(this, k).replace(
|
|
34
|
+
`.${t(this, u)}${t(this, f)}`,
|
|
35
|
+
""
|
|
36
|
+
));
|
|
37
|
+
}
|
|
38
|
+
get url() {
|
|
39
|
+
return t(this, T);
|
|
40
|
+
}
|
|
41
|
+
get name() {
|
|
42
|
+
return t(this, w);
|
|
43
|
+
}
|
|
44
|
+
get density() {
|
|
45
|
+
return t(this, O);
|
|
46
|
+
}
|
|
47
|
+
get query() {
|
|
48
|
+
return t(this, L);
|
|
49
|
+
}
|
|
50
|
+
get extension() {
|
|
51
|
+
return t(this, k);
|
|
52
|
+
}
|
|
53
|
+
get queryType() {
|
|
54
|
+
return t(this, f);
|
|
55
|
+
}
|
|
56
|
+
get queryValue() {
|
|
57
|
+
return t(this, u);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
T = new WeakMap(), w = new WeakMap(), O = new WeakMap(), L = new WeakMap(), u = new WeakMap(), f = new WeakMap(), k = new WeakMap();
|
|
61
|
+
var S;
|
|
62
|
+
class X {
|
|
63
|
+
constructor(n, e) {
|
|
64
|
+
i(this, S);
|
|
65
|
+
s(this, S, /* @__PURE__ */ new Map());
|
|
66
|
+
const l = (e == null ? void 0 : e.mediaBuckets) !== !1, d = typeof n == "string" ? l ? n.trim().split(",").map((h) => h.trim()).filter((h) => !!h) : [n] : n, c = [];
|
|
67
|
+
d.forEach((h) => {
|
|
68
|
+
const b = new rt(h);
|
|
69
|
+
c.push([b.query, b]);
|
|
70
|
+
});
|
|
71
|
+
const x = c.filter((h) => h[1].queryType.includes("max")).sort((h, b) => b[1].queryValue - h[1].queryValue), U = c.filter((h) => h[1].queryType.includes("min") && h[1].queryValue !== 0).sort((h, b) => h[1].queryValue - b[1].queryValue), D = c.filter((h) => h[0] === "(min-width: 0px)");
|
|
72
|
+
(D ? [...D, ...x, ...U] : [...x, ...U]).forEach((h) => {
|
|
73
|
+
t(this, S).has(h[0]) || t(this, S).set(h[0], []), t(this, S).get(h[0]).push(h[1]);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
get mediaBuckets() {
|
|
77
|
+
return t(this, S);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
S = new WeakMap();
|
|
81
|
+
var I, v;
|
|
82
|
+
class nt extends it {
|
|
83
|
+
constructor(e) {
|
|
84
|
+
super(void 0);
|
|
85
|
+
i(this, I);
|
|
86
|
+
i(this, v, () => {
|
|
87
|
+
let e;
|
|
88
|
+
t(this, I).mediaBuckets.forEach((c, x) => {
|
|
89
|
+
matchMedia(x).matches && (e = c);
|
|
90
|
+
});
|
|
91
|
+
let l, d = 0;
|
|
92
|
+
e == null || e.forEach((c) => {
|
|
93
|
+
c.density > d && c.density <= Math.max(devicePixelRatio, 1) && (d = c.density, l = c);
|
|
94
|
+
}), e != null && e.length && !l && (l = e[0]), this.current = l;
|
|
95
|
+
});
|
|
96
|
+
s(this, I, new X(e.srcset, e.sourceSetOptions));
|
|
97
|
+
}
|
|
98
|
+
updateSource(e) {
|
|
99
|
+
s(this, I, new X(e.srcset, e.sourceSetOptions)), t(this, v).call(this);
|
|
100
|
+
}
|
|
101
|
+
close() {
|
|
102
|
+
super.close(), this.disconnect();
|
|
103
|
+
}
|
|
104
|
+
connect() {
|
|
105
|
+
Q.subscribe(t(this, v), st.SOURCE_MANAGER), t(this, v).call(this);
|
|
106
|
+
}
|
|
107
|
+
disconnect() {
|
|
108
|
+
Q.unsubscribe(t(this, v));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
I = new WeakMap(), v = new WeakMap();
|
|
112
|
+
let ht = 0;
|
|
113
|
+
var m, r, y, E, p, C, A, o, M, R, q, V, $, j, _, z, G, B, P;
|
|
114
|
+
class yt extends HTMLElement {
|
|
115
|
+
constructor(e) {
|
|
116
|
+
super();
|
|
117
|
+
i(this, $);
|
|
118
|
+
i(this, m, null);
|
|
119
|
+
i(this, r, null);
|
|
120
|
+
i(this, y, !1);
|
|
121
|
+
i(this, E, !1);
|
|
122
|
+
i(this, p, !1);
|
|
123
|
+
i(this, C, "");
|
|
124
|
+
i(this, A, "");
|
|
125
|
+
i(this, o, new Y(this, {
|
|
126
|
+
loading: !1,
|
|
127
|
+
loaded: !1,
|
|
128
|
+
error: !1,
|
|
129
|
+
clear: !1,
|
|
130
|
+
playing: !1
|
|
131
|
+
}));
|
|
132
|
+
i(this, M, null);
|
|
133
|
+
i(this, R);
|
|
134
|
+
i(this, q, null);
|
|
135
|
+
i(this, V);
|
|
136
|
+
i(this, _, (e) => {
|
|
137
|
+
const l = e[0];
|
|
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
|
+
});
|
|
140
|
+
i(this, z, () => {
|
|
141
|
+
t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, p) && !t(this, y) && W.complete(t(this, A)), H(this, "sourceLoaded", { custom: !0 });
|
|
142
|
+
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
143
|
+
e ? s(this, R, setTimeout(() => {
|
|
144
|
+
t(this, o).set("clear", !0);
|
|
145
|
+
}, parseFloat(e) * 1e3)) : t(this, o).set("clear", !0), s(this, y, !0);
|
|
146
|
+
});
|
|
147
|
+
i(this, G, (e) => {
|
|
148
|
+
t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, p) && !t(this, y) && W.error(t(this, A)), H(this, "sourceError", { custom: !0 }), s(this, y, !0);
|
|
149
|
+
});
|
|
150
|
+
i(this, B, () => {
|
|
151
|
+
t(this, o).set("playing", !0);
|
|
152
|
+
});
|
|
153
|
+
i(this, P, () => {
|
|
154
|
+
t(this, o).set("playing", !1);
|
|
155
|
+
});
|
|
156
|
+
s(this, V, e == null ? void 0 : e.sourceSetOptions), tt && window.IntersectionObserver && s(this, M, new IntersectionObserver(
|
|
157
|
+
t(this, _)
|
|
158
|
+
));
|
|
159
|
+
}
|
|
160
|
+
get consumerElement() {
|
|
161
|
+
return t(this, r);
|
|
162
|
+
}
|
|
163
|
+
get sourceManager() {
|
|
164
|
+
return t(this, m);
|
|
165
|
+
}
|
|
166
|
+
get status() {
|
|
167
|
+
return t(this, o);
|
|
168
|
+
}
|
|
169
|
+
get isLazy() {
|
|
170
|
+
return t(this, p);
|
|
171
|
+
}
|
|
172
|
+
get currentURL() {
|
|
173
|
+
return t(this, q);
|
|
174
|
+
}
|
|
175
|
+
get isFirstLoadHappened() {
|
|
176
|
+
return t(this, y);
|
|
177
|
+
}
|
|
178
|
+
triggerLazyLoad() {
|
|
179
|
+
!t(this, E) && t(this, m).current && t(this, m).current !== t(this, m).previous && (s(this, E, !0), F(this, $, j).call(this, t(this, m).current));
|
|
180
|
+
}
|
|
181
|
+
connectedCallback() {
|
|
182
|
+
s(this, C, `source-consumer-${++ht}`);
|
|
183
|
+
const e = this.getAttribute("srcset") || "", l = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
184
|
+
l && t(this, o).addElement(l), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
|
|
185
|
+
display: block;
|
|
186
|
+
width: 100%;
|
|
187
|
+
height: 100%;
|
|
188
|
+
`, t(this, r).classList.add("source-consumer"), t(this, r).addEventListener("play", t(this, B)), t(this, r).addEventListener("pause", t(this, P)), Array.from(this.attributes).forEach((d) => {
|
|
189
|
+
if (d.name !== "srcset") {
|
|
190
|
+
const c = d.nodeValue || "", x = et(d.name);
|
|
191
|
+
x in t(this, r) && (t(this, r)[x] = c || !0);
|
|
192
|
+
}
|
|
193
|
+
}), this.appendChild(t(this, r)), s(this, m, new nt({
|
|
194
|
+
srcset: e,
|
|
195
|
+
sourceSetOptions: t(this, V)
|
|
196
|
+
})), s(this, p, this.hasAttribute("lazy")), t(this, m).subscribe((d) => {
|
|
197
|
+
(!t(this, p) || t(this, p) && t(this, E)) && F(this, $, j).call(this, d.current);
|
|
198
|
+
}), t(this, m).connect(), t(this, M).observe(this);
|
|
199
|
+
}
|
|
200
|
+
disconnectedCallback() {
|
|
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, o).reset();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
m = new WeakMap(), r = new WeakMap(), y = new WeakMap(), E = new WeakMap(), p = new WeakMap(), C = new WeakMap(), A = new WeakMap(), o = 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, o).set("loaded", !1), t(this, o).set("error", !1), t(this, o).set("loading", !1), t(this, o).set("clear", !1), e) {
|
|
207
|
+
s(this, A, `${t(this, C)}-${e.url}`);
|
|
208
|
+
const l = this.hasAttribute("keep-source-parameters");
|
|
209
|
+
t(this, o).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
|
+
t(this, z).call(this);
|
|
211
|
+
}, t(this, r).onload = () => {
|
|
212
|
+
t(this, z).call(this);
|
|
213
|
+
}, t(this, r).onerror = () => {
|
|
214
|
+
t(this, G).call(this, t(this, q));
|
|
215
|
+
};
|
|
216
|
+
} else
|
|
217
|
+
s(this, q, null), this.consumeSource(null);
|
|
218
|
+
}, _ = new WeakMap(), z = new WeakMap(), G = new WeakMap(), B = new WeakMap(), P = new WeakMap();
|
|
219
|
+
export {
|
|
220
|
+
rt as S,
|
|
221
|
+
yt as a,
|
|
222
|
+
X as b,
|
|
223
|
+
nt as c
|
|
224
|
+
};
|
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-DDhkg7kr.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-DJtFrWOz.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-DDhkg7kr.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-DJtFrWOz.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-DDhkg7kr.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-DJtFrWOz.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-DDhkg7kr.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-DDhkg7kr.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-DJtFrWOz.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-DDhkg7kr.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-DJtFrWOz.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-0BVty6AZ.js";
|
|
9
9
|
import { i as v } from "../index-Bv9zgfdb.js";
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var Z=h=>{throw TypeError(h)};var G=(h,r,e)=>r.has(h)||Z("Cannot "+e);var t=(h,r,e)=>(G(h,r,"read from private field"),e?e.call(h):r.get(h)),i=(h,r,e)=>r.has(h)?Z("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(h):r.set(h,e),s=(h,r,e,o)=>(G(h,r,"write to private field"),o?o.call(h,e):r.set(h,e),e),P=(h,r,e)=>(G(h,r,"access private method"),e);const Y=require("./element-linked-store/index.cjs"),tt=require("./index-DekP7OZe.cjs"),U=require("./events-KVanG9sR.cjs"),et=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");const K=require("./loading/index.cjs"),st=require("./order/index.cjs"),J=require("./window-resizer/index.cjs"),it=require("./Store-Cd1GlEmZ.cjs");var T,w,z,q,u,f,R;class Q{constructor(r){i(this,T);i(this,w);i(this,z);i(this,q);i(this,u);i(this,f);i(this,R);s(this,T,r);let e=r.split(".");const o=/\b\d{1,2}x\b/g,d=e.find(g=>g.match(o)&&parseInt(g));s(this,z,d?parseInt(d):1),d&&(e=e.slice(0,-1)),s(this,w,e.length>1?e.slice(0,-1).join("."):e.join("."));const l=/\d+max/g,x=/\d+min/g,B=/\d+mar/g,_=/\d+mir/g,j=e.find(g=>g.match(l)),n=e.find(g=>g.match(x)),b=e.find(g=>g.match(B)),W=e.find(g=>g.match(_));b?(s(this,u,parseInt(b)),s(this,f,"max"),s(this,q,`(max-aspect-ratio: ${t(this,u)})`)):W?(s(this,u,parseInt(W)),s(this,f,"max"),s(this,q,`(min-aspect-ratio: ${t(this,u)})`)):j?(s(this,u,parseInt(j)),s(this,f,"max"),s(this,q,`(max-width: ${t(this,u)}px)`)):n?(s(this,u,parseInt(n)),s(this,q,`(min-width: ${t(this,u)}px)`),s(this,f,"min")):(s(this,u,0),s(this,q,`(min-width: ${t(this,u)}px)`),s(this,f,"min")),s(this,w,t(this,w).replace(`.${t(this,u)}${t(this,f)}`,"")),s(this,R,e[e.length-1]===t(this,w)?"":"."+e[e.length-1]),s(this,R,t(this,R).replace(`.${t(this,u)}${t(this,f)}`,""))}get url(){return t(this,T)}get name(){return t(this,w)}get density(){return t(this,z)}get query(){return t(this,q)}get extension(){return t(this,R)}get queryType(){return t(this,f)}get queryValue(){return t(this,u)}}T=new WeakMap,w=new WeakMap,z=new WeakMap,q=new WeakMap,u=new WeakMap,f=new WeakMap,R=new WeakMap;var S;class N{constructor(r,e){i(this,S);s(this,S,new Map);const o=(e==null?void 0:e.mediaBuckets)!==!1,d=typeof r=="string"?o?r.trim().split(",").map(n=>n.trim()).filter(n=>!!n):[r]:r,l=[];d.forEach(n=>{const b=new Q(n);l.push([b.query,b])});const x=l.filter(n=>n[1].queryType.includes("max")).sort((n,b)=>b[1].queryValue-n[1].queryValue),B=l.filter(n=>n[1].queryType.includes("min")&&n[1].queryValue!==0).sort((n,b)=>n[1].queryValue-b[1].queryValue),_=l.filter(n=>n[0]==="(min-width: 0px)");(_?[..._,...x,...B]:[...x,...B]).forEach(n=>{t(this,S).has(n[0])||t(this,S).set(n[0],[]),t(this,S).get(n[0]).push(n[1])})}get mediaBuckets(){return t(this,S)}}S=new WeakMap;var A,k;class X extends it.Store{constructor(e){super(void 0);i(this,A);i(this,k,()=>{let e;t(this,A).mediaBuckets.forEach((l,x)=>{matchMedia(x).matches&&(e=l)});let o,d=0;e==null||e.forEach(l=>{l.density>d&&l.density<=Math.max(devicePixelRatio,1)&&(d=l.density,o=l)}),e!=null&&e.length&&!o&&(o=e[0]),this.current=o});s(this,A,new N(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,A,new N(e.srcset,e.sourceSetOptions)),t(this,k).call(this)}close(){super.close(),this.disconnect()}connect(){J.windowResizer.subscribe(t(this,k),st.RESIZE_ORDER.SOURCE_MANAGER),t(this,k).call(this)}disconnect(){J.windowResizer.unsubscribe(t(this,k))}}A=new WeakMap,k=new WeakMap;let rt=0;var m,a,y,E,p,O,M,c,I,$,L,C,v,D,F,V,H;class nt extends HTMLElement{constructor(e){super();i(this,v);i(this,m,null);i(this,a,null);i(this,y,!1);i(this,E,!1);i(this,p,!1);i(this,O,"");i(this,M,"");i(this,c,new Y.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1}));i(this,I,null);i(this,$);i(this,L,null);i(this,C);i(this,F,e=>{const o=e[0];t(this,p)&&(!t(this,E)||this.hasAttribute("reload-source"))&&o.isIntersecting&&this.triggerLazyLoad(),o.isIntersecting?U.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(P(this,v,D).call(this,void 0),s(this,E,!1)),U.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,V,()=>{t(this,c).set("loaded",!0),t(this,c).set("error",!1),t(this,c).set("loading",!1),!t(this,p)&&!t(this,y)&&K.loading.complete(t(this,M)),U.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,$,setTimeout(()=>{t(this,c).set("clear",!0)},parseFloat(e)*1e3)):t(this,c).set("clear",!0),s(this,y,!0)});i(this,H,e=>{t(this,c).set("loaded",!1),t(this,c).set("error",!0),t(this,c).set("loading",!1),!t(this,p)&&!t(this,y)&&K.loading.error(t(this,M)),U.dispatchEvent(this,"sourceError",{custom:!0}),s(this,y,!0)});s(this,C,e==null?void 0:e.sourceSetOptions),tt.isBrowser&&window.IntersectionObserver&&s(this,I,new IntersectionObserver(t(this,F)))}get consumerElement(){return t(this,a)}get sourceManager(){return t(this,m)}get status(){return t(this,c)}get isLazy(){return t(this,p)}get currentURL(){return t(this,L)}get isFirstLoadHappened(){return t(this,y)}triggerLazyLoad(){!t(this,E)&&t(this,m).current&&t(this,m).current!==t(this,m).previous&&(s(this,E,!0),P(this,v,D).call(this,t(this,m).current))}connectedCallback(){s(this,O,`source-consumer-${++rt}`);const e=this.getAttribute("srcset")||"",o=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;o&&t(this,c).addElement(o),s(this,a,this.createConsumer()),t(this,a).style.cssText=`
|
|
2
|
-
display: block;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
`,t(this,a).classList.add("source-consumer"),Array.from(this.attributes).forEach(d=>{if(d.name!=="srcset"){const l=d.nodeValue||"",x=et.kebabToCamel(d.name);x in t(this,a)&&(t(this,a)[x]=l||!0)}}),this.appendChild(t(this,a)),s(this,m,new X({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,E))&&P(this,v,D).call(this,d.current)}),t(this,m).connect(),t(this,I).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,$)),t(this,I).disconnect(),(e=t(this,m))==null||e.close(),t(this,a)&&(t(this,a).onloadeddata=null,t(this,a).onload=null,t(this,a).onerror=null,t(this,a).remove()),s(this,y,!1),s(this,E,!1),t(this,c).reset()}}m=new WeakMap,a=new WeakMap,y=new WeakMap,E=new WeakMap,p=new WeakMap,O=new WeakMap,M=new WeakMap,c=new WeakMap,I=new WeakMap,$=new WeakMap,L=new WeakMap,C=new WeakMap,v=new WeakSet,D=function(e){if(clearTimeout(t(this,$)),t(this,a).onloadeddata=null,t(this,a).onload=null,t(this,a).onerror=null,t(this,c).set("loaded",!1),t(this,c).set("error",!1),t(this,c).set("loading",!1),t(this,c).set("clear",!1),e){s(this,M,`${t(this,O)}-${e.url}`);const o=this.hasAttribute("keep-source-parameters");t(this,c).set("loading",!0),s(this,L,o?e.url:e.name+e.extension),this.consumeSource(t(this,L)),!t(this,p)&&!t(this,y)&&K.loading.add(t(this,M)),t(this,a).onloadeddata=()=>{t(this,V).call(this)},t(this,a).onload=()=>{t(this,V).call(this)},t(this,a).onerror=()=>{t(this,H).call(this,t(this,L))}}else s(this,L,null),this.consumeSource(null)},F=new WeakMap,V=new WeakMap,H=new WeakMap;exports.Source=Q;exports.SourceElement=nt;exports.SourceManager=X;exports.SourceSet=N;
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
var W = (n) => {
|
|
2
|
-
throw TypeError(n);
|
|
3
|
-
};
|
|
4
|
-
var G = (n, r, e) => r.has(n) || W("Cannot " + e);
|
|
5
|
-
var t = (n, r, e) => (G(n, r, "read from private field"), e ? e.call(n) : r.get(n)), i = (n, r, e) => r.has(n) ? W("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(n) : r.set(n, e), s = (n, r, e, o) => (G(n, r, "write to private field"), o ? o.call(n, e) : r.set(n, e), e), U = (n, r, e) => (G(n, r, "access private method"), e);
|
|
6
|
-
import { ElementLinkedStore as Q } from "./element-linked-store/index.js";
|
|
7
|
-
import { i as X } from "./index-Bv9zgfdb.js";
|
|
8
|
-
import { d as D } from "./events-CsVF98U6.js";
|
|
9
|
-
import { k as Y } from "./string-BlMQbe8b.js";
|
|
10
|
-
import "construct-style-sheets-polyfill";
|
|
11
|
-
import { loading as K } from "./loading/index.js";
|
|
12
|
-
import { RESIZE_ORDER as tt } from "./order/index.js";
|
|
13
|
-
import { windowResizer as Z } from "./window-resizer/index.js";
|
|
14
|
-
import { S as et } from "./Store-0BVty6AZ.js";
|
|
15
|
-
var O, w, C, E, u, f, k;
|
|
16
|
-
class st {
|
|
17
|
-
constructor(r) {
|
|
18
|
-
i(this, O);
|
|
19
|
-
i(this, w);
|
|
20
|
-
i(this, C);
|
|
21
|
-
i(this, E);
|
|
22
|
-
i(this, u);
|
|
23
|
-
i(this, f);
|
|
24
|
-
i(this, k);
|
|
25
|
-
s(this, O, r);
|
|
26
|
-
let e = r.split(".");
|
|
27
|
-
const o = /\b\d{1,2}x\b/g, d = e.find((g) => g.match(o) && parseInt(g));
|
|
28
|
-
s(this, C, d ? parseInt(d) : 1), d && (e = e.slice(0, -1)), s(this, w, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
29
|
-
const l = /\d+max/g, x = /\d+min/g, B = /\d+mar/g, P = /\d+mir/g, _ = e.find((g) => g.match(l)), h = e.find((g) => g.match(x)), b = e.find((g) => g.match(B)), N = e.find((g) => g.match(P));
|
|
30
|
-
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this, E, `(max-aspect-ratio: ${t(this, u)})`)) : N ? (s(this, u, parseInt(N)), s(this, f, "max"), s(this, E, `(min-aspect-ratio: ${t(this, u)})`)) : _ ? (s(this, u, parseInt(_)), s(this, f, "max"), s(this, E, `(max-width: ${t(this, u)}px)`)) : h ? (s(this, u, parseInt(h)), s(this, E, `(min-width: ${t(this, u)}px)`), s(this, f, "min")) : (s(this, u, 0), s(this, E, `(min-width: ${t(this, u)}px)`), s(this, f, "min")), s(this, w, t(this, w).replace(
|
|
31
|
-
`.${t(this, u)}${t(this, f)}`,
|
|
32
|
-
""
|
|
33
|
-
)), s(this, k, e[e.length - 1] === t(this, w) ? "" : "." + e[e.length - 1]), s(this, k, t(this, k).replace(
|
|
34
|
-
`.${t(this, u)}${t(this, f)}`,
|
|
35
|
-
""
|
|
36
|
-
));
|
|
37
|
-
}
|
|
38
|
-
get url() {
|
|
39
|
-
return t(this, O);
|
|
40
|
-
}
|
|
41
|
-
get name() {
|
|
42
|
-
return t(this, w);
|
|
43
|
-
}
|
|
44
|
-
get density() {
|
|
45
|
-
return t(this, C);
|
|
46
|
-
}
|
|
47
|
-
get query() {
|
|
48
|
-
return t(this, E);
|
|
49
|
-
}
|
|
50
|
-
get extension() {
|
|
51
|
-
return t(this, k);
|
|
52
|
-
}
|
|
53
|
-
get queryType() {
|
|
54
|
-
return t(this, f);
|
|
55
|
-
}
|
|
56
|
-
get queryValue() {
|
|
57
|
-
return t(this, u);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
O = new WeakMap(), w = new WeakMap(), C = new WeakMap(), E = new WeakMap(), u = new WeakMap(), f = new WeakMap(), k = new WeakMap();
|
|
61
|
-
var S;
|
|
62
|
-
class J {
|
|
63
|
-
constructor(r, e) {
|
|
64
|
-
i(this, S);
|
|
65
|
-
s(this, S, /* @__PURE__ */ new Map());
|
|
66
|
-
const o = (e == null ? void 0 : e.mediaBuckets) !== !1, d = typeof r == "string" ? o ? r.trim().split(",").map((h) => h.trim()).filter((h) => !!h) : [r] : r, l = [];
|
|
67
|
-
d.forEach((h) => {
|
|
68
|
-
const b = new st(h);
|
|
69
|
-
l.push([b.query, b]);
|
|
70
|
-
});
|
|
71
|
-
const x = l.filter((h) => h[1].queryType.includes("max")).sort((h, b) => b[1].queryValue - h[1].queryValue), B = l.filter((h) => h[1].queryType.includes("min") && h[1].queryValue !== 0).sort((h, b) => h[1].queryValue - b[1].queryValue), P = l.filter((h) => h[0] === "(min-width: 0px)");
|
|
72
|
-
(P ? [...P, ...x, ...B] : [...x, ...B]).forEach((h) => {
|
|
73
|
-
t(this, S).has(h[0]) || t(this, S).set(h[0], []), t(this, S).get(h[0]).push(h[1]);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
get mediaBuckets() {
|
|
77
|
-
return t(this, S);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
S = new WeakMap();
|
|
81
|
-
var M, A;
|
|
82
|
-
class it extends et {
|
|
83
|
-
constructor(e) {
|
|
84
|
-
super(void 0);
|
|
85
|
-
i(this, M);
|
|
86
|
-
i(this, A, () => {
|
|
87
|
-
let e;
|
|
88
|
-
t(this, M).mediaBuckets.forEach((l, x) => {
|
|
89
|
-
matchMedia(x).matches && (e = l);
|
|
90
|
-
});
|
|
91
|
-
let o, d = 0;
|
|
92
|
-
e == null || e.forEach((l) => {
|
|
93
|
-
l.density > d && l.density <= Math.max(devicePixelRatio, 1) && (d = l.density, o = l);
|
|
94
|
-
}), e != null && e.length && !o && (o = e[0]), this.current = o;
|
|
95
|
-
});
|
|
96
|
-
s(this, M, new J(e.srcset, e.sourceSetOptions));
|
|
97
|
-
}
|
|
98
|
-
updateSource(e) {
|
|
99
|
-
s(this, M, new J(e.srcset, e.sourceSetOptions)), t(this, A).call(this);
|
|
100
|
-
}
|
|
101
|
-
close() {
|
|
102
|
-
super.close(), this.disconnect();
|
|
103
|
-
}
|
|
104
|
-
connect() {
|
|
105
|
-
Z.subscribe(t(this, A), tt.SOURCE_MANAGER), t(this, A).call(this);
|
|
106
|
-
}
|
|
107
|
-
disconnect() {
|
|
108
|
-
Z.unsubscribe(t(this, A));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
M = new WeakMap(), A = new WeakMap();
|
|
112
|
-
let rt = 0;
|
|
113
|
-
var m, a, y, L, p, V, I, c, R, $, q, z, T, F, H, v, j;
|
|
114
|
-
class pt extends HTMLElement {
|
|
115
|
-
constructor(e) {
|
|
116
|
-
super();
|
|
117
|
-
i(this, T);
|
|
118
|
-
i(this, m, null);
|
|
119
|
-
i(this, a, null);
|
|
120
|
-
i(this, y, !1);
|
|
121
|
-
i(this, L, !1);
|
|
122
|
-
i(this, p, !1);
|
|
123
|
-
i(this, V, "");
|
|
124
|
-
i(this, I, "");
|
|
125
|
-
i(this, c, new Q(this, {
|
|
126
|
-
loading: !1,
|
|
127
|
-
loaded: !1,
|
|
128
|
-
error: !1,
|
|
129
|
-
clear: !1
|
|
130
|
-
}));
|
|
131
|
-
i(this, R, null);
|
|
132
|
-
i(this, $);
|
|
133
|
-
i(this, q, null);
|
|
134
|
-
i(this, z);
|
|
135
|
-
i(this, H, (e) => {
|
|
136
|
-
const o = e[0];
|
|
137
|
-
t(this, p) && (!t(this, L) || this.hasAttribute("reload-source")) && o.isIntersecting && this.triggerLazyLoad(), o.isIntersecting ? D(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (U(this, T, F).call(this, void 0), s(this, L, !1)), D(this, "sourceRelease", { custom: !0 }));
|
|
138
|
-
});
|
|
139
|
-
i(this, v, () => {
|
|
140
|
-
t(this, c).set("loaded", !0), t(this, c).set("error", !1), t(this, c).set("loading", !1), !t(this, p) && !t(this, y) && K.complete(t(this, I)), D(this, "sourceLoaded", { custom: !0 });
|
|
141
|
-
const e = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
142
|
-
e ? s(this, $, setTimeout(() => {
|
|
143
|
-
t(this, c).set("clear", !0);
|
|
144
|
-
}, parseFloat(e) * 1e3)) : t(this, c).set("clear", !0), s(this, y, !0);
|
|
145
|
-
});
|
|
146
|
-
i(this, j, (e) => {
|
|
147
|
-
t(this, c).set("loaded", !1), t(this, c).set("error", !0), t(this, c).set("loading", !1), !t(this, p) && !t(this, y) && K.error(t(this, I)), D(this, "sourceError", { custom: !0 }), s(this, y, !0);
|
|
148
|
-
});
|
|
149
|
-
s(this, z, e == null ? void 0 : e.sourceSetOptions), X && window.IntersectionObserver && s(this, R, new IntersectionObserver(
|
|
150
|
-
t(this, H)
|
|
151
|
-
));
|
|
152
|
-
}
|
|
153
|
-
get consumerElement() {
|
|
154
|
-
return t(this, a);
|
|
155
|
-
}
|
|
156
|
-
get sourceManager() {
|
|
157
|
-
return t(this, m);
|
|
158
|
-
}
|
|
159
|
-
get status() {
|
|
160
|
-
return t(this, c);
|
|
161
|
-
}
|
|
162
|
-
get isLazy() {
|
|
163
|
-
return t(this, p);
|
|
164
|
-
}
|
|
165
|
-
get currentURL() {
|
|
166
|
-
return t(this, q);
|
|
167
|
-
}
|
|
168
|
-
get isFirstLoadHappened() {
|
|
169
|
-
return t(this, y);
|
|
170
|
-
}
|
|
171
|
-
triggerLazyLoad() {
|
|
172
|
-
!t(this, L) && t(this, m).current && t(this, m).current !== t(this, m).previous && (s(this, L, !0), U(this, T, F).call(this, t(this, m).current));
|
|
173
|
-
}
|
|
174
|
-
connectedCallback() {
|
|
175
|
-
s(this, V, `source-consumer-${++rt}`);
|
|
176
|
-
const e = this.getAttribute("srcset") || "", o = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
|
|
177
|
-
o && t(this, c).addElement(o), s(this, a, this.createConsumer()), t(this, a).style.cssText = `
|
|
178
|
-
display: block;
|
|
179
|
-
width: 100%;
|
|
180
|
-
height: 100%;
|
|
181
|
-
`, t(this, a).classList.add("source-consumer"), Array.from(this.attributes).forEach((d) => {
|
|
182
|
-
if (d.name !== "srcset") {
|
|
183
|
-
const l = d.nodeValue || "", x = Y(d.name);
|
|
184
|
-
x in t(this, a) && (t(this, a)[x] = l || !0);
|
|
185
|
-
}
|
|
186
|
-
}), this.appendChild(t(this, a)), s(this, m, new it({
|
|
187
|
-
srcset: e,
|
|
188
|
-
sourceSetOptions: t(this, z)
|
|
189
|
-
})), s(this, p, this.hasAttribute("lazy")), t(this, m).subscribe((d) => {
|
|
190
|
-
(!t(this, p) || t(this, p) && t(this, L)) && U(this, T, F).call(this, d.current);
|
|
191
|
-
}), t(this, m).connect(), t(this, R).observe(this);
|
|
192
|
-
}
|
|
193
|
-
disconnectedCallback() {
|
|
194
|
-
var e;
|
|
195
|
-
clearTimeout(t(this, $)), t(this, R).disconnect(), (e = t(this, m)) == null || e.close(), t(this, a) && (t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, a).remove()), s(this, y, !1), s(this, L, !1), t(this, c).reset();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
m = new WeakMap(), a = new WeakMap(), y = new WeakMap(), L = new WeakMap(), p = new WeakMap(), V = new WeakMap(), I = new WeakMap(), c = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), q = new WeakMap(), z = new WeakMap(), T = new WeakSet(), F = function(e) {
|
|
199
|
-
if (clearTimeout(t(this, $)), t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, c).set("loaded", !1), t(this, c).set("error", !1), t(this, c).set("loading", !1), t(this, c).set("clear", !1), e) {
|
|
200
|
-
s(this, I, `${t(this, V)}-${e.url}`);
|
|
201
|
-
const o = this.hasAttribute("keep-source-parameters");
|
|
202
|
-
t(this, c).set("loading", !0), s(this, q, o ? e.url : e.name + e.extension), this.consumeSource(t(this, q)), !t(this, p) && !t(this, y) && K.add(t(this, I)), t(this, a).onloadeddata = () => {
|
|
203
|
-
t(this, v).call(this);
|
|
204
|
-
}, t(this, a).onload = () => {
|
|
205
|
-
t(this, v).call(this);
|
|
206
|
-
}, t(this, a).onerror = () => {
|
|
207
|
-
t(this, j).call(this, t(this, q));
|
|
208
|
-
};
|
|
209
|
-
} else
|
|
210
|
-
s(this, q, null), this.consumeSource(null);
|
|
211
|
-
}, H = new WeakMap(), v = new WeakMap(), j = new WeakMap();
|
|
212
|
-
export {
|
|
213
|
-
st as S,
|
|
214
|
-
pt as a,
|
|
215
|
-
J as b,
|
|
216
|
-
it as c
|
|
217
|
-
};
|