aptechka 0.38.0 → 0.38.2
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 oe=a=>{throw TypeError(a)};var se=(a,r,t)=>r.has(a)||oe("Cannot "+t);var e=(a,r,t)=>(se(a,r,"read from private field"),t?t.call(a):r.get(a)),s=(a,r,t)=>r.has(a)?oe("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(a):r.set(a,t),n=(a,r,t,i)=>(se(a,r,"write to private field"),i?i.call(a,t):r.set(a,t),t),x=(a,r,t)=>(se(a,r,"access private method"),t);var he=(a,r,t)=>new Promise((i,
|
|
1
|
+
"use strict";var oe=a=>{throw TypeError(a)};var se=(a,r,t)=>r.has(a)||oe("Cannot "+t);var e=(a,r,t)=>(se(a,r,"read from private field"),t?t.call(a):r.get(a)),s=(a,r,t)=>r.has(a)?oe("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(a):r.set(a,t),n=(a,r,t,i)=>(se(a,r,"write to private field"),i?i.call(a,t):r.set(a,t),t),x=(a,r,t)=>(se(a,r,"access private method"),t);var he=(a,r,t)=>new Promise((i,u)=>{var b=m=>{try{g(t.next(m))}catch(l){u(l)}},N=m=>{try{g(t.throw(m))}catch(l){u(l)}},g=m=>m.done?i(m.value):Promise.resolve(m.value).then(b,N);g((t=t.apply(a,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ye=require("../device/index.cjs"),ge=require("../source/index.cjs"),Ee=require("../class-linked-status/index.cjs"),le=require("../browser-CpzFX2xg.cjs"),X=require("../events-KVanG9sR.cjs"),de=require("../string-DhgS_iFl.cjs"),ie=require("../loading/index.cjs"),D=require("../css-property/index.cjs"),ce=require("../element-resizer/vanilla/index.cjs"),ue=require("../canvas-CU5Xjahf.cjs"),ve=require("../canvas/index.cjs"),re=require("../ticker/vanilla/index.cjs");let Se=0;var d,o,E,_,f,$,R,h,q,V,v,z,K,J,H,Q;class F extends HTMLElement{constructor(){super();s(this,z);s(this,d,null);s(this,o,null);s(this,E,!1);s(this,_,!1);s(this,f,!1);s(this,$,"");s(this,R,"");s(this,h,new Ee.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,q,null);s(this,V);s(this,v,null);s(this,J,t=>{const i=t[0];e(this,f)&&(!e(this,_)||this.hasAttribute("reload-source"))&&i.isIntersecting&&this.triggerLazyLoad(),i.isIntersecting?X.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&x(this,z,K).call(this,void 0),X.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,H,()=>{e(this,h).set("loaded",!0),e(this,h).set("error",!1),e(this,h).set("loading",!1),!e(this,f)&&!e(this,E)&&ie.loading.complete(e(this,R));const t=getComputedStyle(this).getPropertyValue("--clear-duration");t?n(this,V,setTimeout(()=>{e(this,h).set("clear",!0)},parseFloat(t)*1e3)):e(this,h).set("clear",!0),n(this,E,!0)});s(this,Q,t=>{e(this,h).set("loaded",!1),e(this,h).set("error",!0),e(this,h).set("loading",!1),!e(this,f)&&!e(this,E)&&ie.loading.error(e(this,R)),n(this,E,!0)});le.isBrowser&&window.IntersectionObserver&&(n(this,$,`source-consumer-${++Se}`),n(this,q,new IntersectionObserver(e(this,J))))}get consumerElement(){return e(this,o)}get sourceManager(){return e(this,d)}get status(){return e(this,h)}get isLazy(){return e(this,f)}get currentURL(){return e(this,v)}triggerLazyLoad(){e(this,d).current&&e(this,d).current!==e(this,d).previous&&x(this,z,K).call(this,e(this,d).current),n(this,_,!0)}connectedCallback(){const t=this.getAttribute("srcset");t&&(n(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(i=>{if(i.name!=="srcset"){const
|
|
5
|
+
`,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(i=>{if(i.name!=="srcset"){const u=i.nodeValue||"",b=de.kebabToCamel(i.name);b in e(this,o)&&(e(this,o)[b]=u||!0)}}),this.appendChild(e(this,o)),n(this,d,new ge.SourceManager({srcset:t})),n(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(i=>{(!e(this,f)||e(this,f)&&e(this,_))&&x(this,z,K).call(this,i.current)}),e(this,q).observe(this),e(this,d).connect())}disconnectedCallback(){e(this,q).disconnect(),e(this,d).close(),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,o).remove(),e(this,h).reset(),clearTimeout(e(this,V))}}d=new WeakMap,o=new WeakMap,E=new WeakMap,_=new WeakMap,f=new WeakMap,$=new WeakMap,R=new WeakMap,h=new WeakMap,q=new WeakMap,V=new WeakMap,v=new WeakMap,z=new WeakSet,K=function(t){if(clearTimeout(e(this,V)),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).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){n(this,R,`${e(this,$)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,h).set("loading",!0),n(this,v,i?t.url:t.name+t.extension),this.consumeSource(e(this,v)),!e(this,f)&&!e(this,E)&&ie.loading.add(e(this,R)),e(this,o).onloadeddata=()=>{e(this,H).call(this)},e(this,o).onload=()=>{e(this,H).call(this)},e(this,o).onerror=()=>{e(this,Q).call(this,e(this,v))}}else n(this,v,null),this.consumeSource(null)},J=new WeakMap,H=new WeakMap,Q=new WeakMap;class me extends F{createConsumer(){return document.createElement("img")}consumeSource(r){if(r&&this.hasAttribute("webp")&&ye.device.isWebp){const t=r.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=r||""}}customElements.get("e-image")||customElements.define("e-image",me);function we(a){const r=a.match(/\{([\d-]+)\}/);if(r){const t=r[1].split("-");if(t.length===2){const i=parseInt(t[0],10),u=parseInt(t[1],10);return{start:i,end:u}}}return null}var p,I,U,S,w,A,P,O,y,L;class fe extends F{constructor(t){super();s(this,p,[]);s(this,I,new D.CSSProperty(this,"--fit","contain"));s(this,U,new D.CSSProperty(this,"--autoplay",!1));s(this,S,new D.CSSProperty(this,"--offset-x",.5));s(this,w,new D.CSSProperty(this,"--offset-y",.5));s(this,A,null);s(this,P,0);s(this,O,1);s(this,y,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,I).current==="cover"?n(this,A,ue.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,S).current,e(this,w).current)):n(this,A,ue.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,S).current,e(this,w).current))}});s(this,L,t=>{if(this.status.isFalse("loaded")||!e(this,A))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,p)[e(this,P)];i&&t.detail.context.drawImage(i,...e(this,A)),e(this,U).current&&n(this,P,(e(this,P)+1)%e(this,p).length)});le.isBrowser&&(n(this,O,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,I).subscribe(e(this,y)),e(this,S).subscribe(e(this,y)),e(this,w).subscribe(e(this,y)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,L))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,L))}))}setProgress(t){e(this,p).length&&n(this,P,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,U).observe(),e(this,I).observe(),e(this,S).observe(),e(this,w).observe(),ce.elementResizer.subscribe(this,e(this,y))}disconnectedCallback(){super.disconnectedCallback(),e(this,U).unobserve(),e(this,I).unobserve(),e(this,S).unobserve(),e(this,w).unobserve(),n(this,p,[]),ce.elementResizer.unsubscribe(e(this,y)),this.consumerElement.removeEventListener("canvasRender",e(this,L))}createConsumer(){return new ve.CanvasElement}consumeSource(t){return he(this,null,function*(){var i,u,b,N;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,L));const g=[],m=we(t);if(m)for(let l=m.start;l<=m.end;l++){const ae=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,O),"0")),j=new Image;j.src=ae,g.push(j)}else{const l=new Image;l.src=t,g.push(l)}try{yield Promise.all(g.map((l,ae)=>new Promise((j,be)=>{l.onload=()=>{j()},l.onerror=Le=>{be(`${l.src} Image not found`)}}))),n(this,p,g),e(this,y).call(this),(u=(i=this.consumerElement).onload)==null||u.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,L))}catch(l){console.error(l),(N=(b=this.consumerElement).onerror)==null||N.call(b,new Event("error"))}}})}}p=new WeakMap,I=new WeakMap,U=new WeakMap,S=new WeakMap,w=new WeakMap,A=new WeakMap,P=new WeakMap,O=new WeakMap,y=new WeakMap,L=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",fe);var k,B;class pe extends F{constructor(){super(...arguments);s(this,k,0);s(this,B,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,k)&&n(this,k,t),X.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,k)}}),this.consumerElement.readyState===4&&re.ticker.unsubscribe(e(this,B))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{re.ticker.subscribe(e(this,B)),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(),re.ticker.unsubscribe(e(this,B)),n(this,k,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}k=new WeakMap,B=new WeakMap;customElements.get("e-video")||customElements.define("e-video",pe);var c,M,C,W,Z,ee,te,Y,ne;const T=class T extends F{constructor(){super();s(this,Y);s(this,c);s(this,M);s(this,C,!1);s(this,W,()=>{n(this,C,e(this,C)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),n(this,c,new window.YT.Player(e(this,M),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,Z),onError:e(this,ee),onStateChange:e(this,te)}}))});s(this,Z,()=>{x(this,Y,ne).call(this)});s(this,ee,t=>{var i,u;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(u=(i=this.consumerElement).onerror)==null||u.call(i,new Event("error"))});s(this,te,()=>{});n(this,M,"yt-"+de.generateId(10)),T.__apiReady||(window.onYouTubeIframeAPIReady=()=>{T.__apiReady=!0,X.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,c)?e(this,c).playVideo():n(this,C,!0))}),this.addEventListener("sourceRelease",()=>{e(this,c)&&this.hasAttribute("capture-autoplay")&&(e(this,c).pauseVideo(),this.hasAttribute("replay")&&e(this,c).seekTo(0))})}static __onYouTubeIframeAPIReady(){this.__apiReady=!0}createConsumer(){const t=document.createElement("div");return t.id=e(this,M),t}consumeSource(t){var i;if(t){if(!document.getElementById("youtube-script")){const u=document.createElement("script");u.id,u.src="https://www.youtube.com/iframe_api";const b=document.getElementsByTagName("script")[0];(i=b.parentNode)==null||i.insertBefore(u,b)}e(this,c)?x(this,Y,ne).call(this):T.__apiReady?e(this,W).call(this):addEventListener("youTubeIframeAPIReady",e(this,W))}else e(this,c)&&e(this,c).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,c)&&e(this,c).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,W))}};c=new WeakMap,M=new WeakMap,C=new WeakMap,W=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,Y=new WeakSet,ne=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,c).loadVideoByUrl(this.currentURL):e(this,c).loadVideoById(this.currentURL)),e(this,C)?e(this,c).playVideo():e(this,c).stopVideo(),n(this,C,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},T.__apiReady=!1;let G=T;customElements.get("e-youtube")||customElements.define("e-youtube",G);exports.ImageElement=me;exports.SequenceElement=fe;exports.SourceElement=F;exports.VideoElement=pe;exports.YouTubeElement=G;
|
|
@@ -3,18 +3,18 @@ var oe = (a) => {
|
|
|
3
3
|
};
|
|
4
4
|
var te = (a, r, t) => r.has(a) || oe("Cannot " + t);
|
|
5
5
|
var e = (a, r, t) => (te(a, r, "read from private field"), t ? t.call(a) : r.get(a)), s = (a, r, t) => r.has(a) ? oe("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, t), n = (a, r, t, i) => (te(a, r, "write to private field"), i ? i.call(a, t) : r.set(a, t), t), T = (a, r, t) => (te(a, r, "access private method"), t);
|
|
6
|
-
var he = (a, r, t) => new Promise((i,
|
|
6
|
+
var he = (a, r, t) => new Promise((i, u) => {
|
|
7
7
|
var b = (m) => {
|
|
8
8
|
try {
|
|
9
9
|
g(t.next(m));
|
|
10
10
|
} catch (l) {
|
|
11
|
-
|
|
11
|
+
u(l);
|
|
12
12
|
}
|
|
13
13
|
}, O = (m) => {
|
|
14
14
|
try {
|
|
15
15
|
g(t.throw(m));
|
|
16
16
|
} catch (l) {
|
|
17
|
-
|
|
17
|
+
u(l);
|
|
18
18
|
}
|
|
19
19
|
}, g = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(b, O);
|
|
20
20
|
g((t = t.apply(a, r)).next());
|
|
@@ -32,7 +32,7 @@ import { c as ye, a as ge } from "../canvas-DeZ0SLUJ.js";
|
|
|
32
32
|
import { CanvasElement as Ee } from "../canvas/index.js";
|
|
33
33
|
import { ticker as ie } from "../ticker/vanilla/index.js";
|
|
34
34
|
let ve = 0;
|
|
35
|
-
var d, o, E, V, f, H,
|
|
35
|
+
var d, o, E, V, f, H, R, h, U, z, v, _, j, X, q, G;
|
|
36
36
|
class ee extends HTMLElement {
|
|
37
37
|
constructor() {
|
|
38
38
|
super();
|
|
@@ -43,8 +43,8 @@ class ee extends HTMLElement {
|
|
|
43
43
|
s(this, V, !1);
|
|
44
44
|
s(this, f, !1);
|
|
45
45
|
s(this, H, "");
|
|
46
|
-
s(this,
|
|
47
|
-
s(this,
|
|
46
|
+
s(this, R, "");
|
|
47
|
+
s(this, h, new fe(this, {
|
|
48
48
|
loading: !1,
|
|
49
49
|
loaded: !1,
|
|
50
50
|
error: !1,
|
|
@@ -58,14 +58,14 @@ class ee extends HTMLElement {
|
|
|
58
58
|
e(this, f) && (!e(this, V) || this.hasAttribute("reload-source")) && i.isIntersecting && this.triggerLazyLoad(), i.isIntersecting ? K(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && T(this, _, j).call(this, void 0), K(this, "sourceRelease", { custom: !0 }));
|
|
59
59
|
});
|
|
60
60
|
s(this, q, () => {
|
|
61
|
-
e(this,
|
|
61
|
+
e(this, h).set("loaded", !0), e(this, h).set("error", !1), e(this, h).set("loading", !1), !e(this, f) && !e(this, E) && se.complete(e(this, R));
|
|
62
62
|
const t = getComputedStyle(this).getPropertyValue("--clear-duration");
|
|
63
|
-
t
|
|
64
|
-
e(this,
|
|
65
|
-
}, parseFloat(t) * 1e3)), n(this, E, !0);
|
|
63
|
+
t ? n(this, z, setTimeout(() => {
|
|
64
|
+
e(this, h).set("clear", !0);
|
|
65
|
+
}, parseFloat(t) * 1e3)) : e(this, h).set("clear", !0), n(this, E, !0);
|
|
66
66
|
});
|
|
67
67
|
s(this, G, (t) => {
|
|
68
|
-
e(this,
|
|
68
|
+
e(this, h).set("loaded", !1), e(this, h).set("error", !0), e(this, h).set("loading", !1), !e(this, f) && !e(this, E) && se.error(e(this, R)), n(this, E, !0);
|
|
69
69
|
});
|
|
70
70
|
ue && window.IntersectionObserver && (n(this, H, `source-consumer-${++ve}`), n(this, U, new IntersectionObserver(
|
|
71
71
|
e(this, X)
|
|
@@ -78,7 +78,7 @@ class ee extends HTMLElement {
|
|
|
78
78
|
return e(this, d);
|
|
79
79
|
}
|
|
80
80
|
get status() {
|
|
81
|
-
return e(this,
|
|
81
|
+
return e(this, h);
|
|
82
82
|
}
|
|
83
83
|
get isLazy() {
|
|
84
84
|
return e(this, f);
|
|
@@ -97,8 +97,8 @@ class ee extends HTMLElement {
|
|
|
97
97
|
height: 100%;
|
|
98
98
|
`, e(this, o).classList.add("source-consumer"), Array.from(this.attributes).forEach((i) => {
|
|
99
99
|
if (i.name !== "srcset") {
|
|
100
|
-
const
|
|
101
|
-
b in e(this, o) && (e(this, o)[b] =
|
|
100
|
+
const u = i.nodeValue || "", b = pe(i.name);
|
|
101
|
+
b in e(this, o) && (e(this, o)[b] = u || !0);
|
|
102
102
|
}
|
|
103
103
|
}), this.appendChild(e(this, o)), n(this, d, new me({
|
|
104
104
|
srcset: t
|
|
@@ -107,14 +107,14 @@ class ee extends HTMLElement {
|
|
|
107
107
|
}), e(this, U).observe(this), e(this, d).connect());
|
|
108
108
|
}
|
|
109
109
|
disconnectedCallback() {
|
|
110
|
-
e(this, U).disconnect(), e(this, d).close(), e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).onerror = null, e(this, o).remove(), e(this,
|
|
110
|
+
e(this, U).disconnect(), e(this, d).close(), e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).onerror = null, e(this, o).remove(), e(this, h).reset(), clearTimeout(e(this, z));
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
d = new WeakMap(), o = new WeakMap(), E = new WeakMap(), V = new WeakMap(), f = new WeakMap(), H = new WeakMap(),
|
|
114
|
-
if (clearTimeout(e(this, z)), e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).onerror = null, e(this,
|
|
115
|
-
n(this,
|
|
113
|
+
d = new WeakMap(), o = new WeakMap(), E = new WeakMap(), V = new WeakMap(), f = new WeakMap(), H = new WeakMap(), R = new WeakMap(), h = new WeakMap(), U = new WeakMap(), z = new WeakMap(), v = new WeakMap(), _ = new WeakSet(), j = function(t) {
|
|
114
|
+
if (clearTimeout(e(this, z)), e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).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) {
|
|
115
|
+
n(this, R, `${e(this, H)}-${t.url}`);
|
|
116
116
|
const i = this.hasAttribute("keep-source-parameters");
|
|
117
|
-
e(this,
|
|
117
|
+
e(this, h).set("loading", !0), n(this, v, i ? t.url : t.name + t.extension), this.consumeSource(e(this, v)), !e(this, f) && !e(this, E) && se.add(e(this, R)), e(this, o).onloadeddata = () => {
|
|
118
118
|
e(this, q).call(this);
|
|
119
119
|
}, e(this, o).onload = () => {
|
|
120
120
|
e(this, q).call(this);
|
|
@@ -142,18 +142,18 @@ function Le(a) {
|
|
|
142
142
|
if (r) {
|
|
143
143
|
const t = r[1].split("-");
|
|
144
144
|
if (t.length === 2) {
|
|
145
|
-
const i = parseInt(t[0], 10),
|
|
146
|
-
return { start: i, end:
|
|
145
|
+
const i = parseInt(t[0], 10), u = parseInt(t[1], 10);
|
|
146
|
+
return { start: i, end: u };
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
return null;
|
|
150
150
|
}
|
|
151
|
-
var p,
|
|
151
|
+
var p, I, B, w, L, A, k, F, y, C;
|
|
152
152
|
class Ce extends ee {
|
|
153
153
|
constructor(t) {
|
|
154
154
|
super();
|
|
155
155
|
s(this, p, []);
|
|
156
|
-
s(this,
|
|
156
|
+
s(this, I, new D(
|
|
157
157
|
this,
|
|
158
158
|
"--fit",
|
|
159
159
|
"contain"
|
|
@@ -161,20 +161,20 @@ class Ce extends ee {
|
|
|
161
161
|
s(this, B, new D(this, "--autoplay", !1));
|
|
162
162
|
s(this, w, new D(this, "--offset-x", 0.5));
|
|
163
163
|
s(this, L, new D(this, "--offset-y", 0.5));
|
|
164
|
-
s(this,
|
|
165
|
-
s(this,
|
|
164
|
+
s(this, A, null);
|
|
165
|
+
s(this, k, 0);
|
|
166
166
|
s(this, F, 1);
|
|
167
167
|
s(this, y, () => {
|
|
168
168
|
if (e(this, p).length) {
|
|
169
169
|
const t = e(this, p)[0];
|
|
170
|
-
e(this,
|
|
170
|
+
e(this, I).current === "cover" ? n(this, A, ye(
|
|
171
171
|
t.naturalWidth,
|
|
172
172
|
t.naturalHeight,
|
|
173
173
|
this.consumerElement.width,
|
|
174
174
|
this.consumerElement.height,
|
|
175
175
|
e(this, w).current,
|
|
176
176
|
e(this, L).current
|
|
177
|
-
)) : n(this,
|
|
177
|
+
)) : n(this, A, ge(
|
|
178
178
|
t.naturalWidth,
|
|
179
179
|
t.naturalHeight,
|
|
180
180
|
this.consumerElement.width,
|
|
@@ -185,15 +185,15 @@ class Ce extends ee {
|
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
187
|
s(this, C, (t) => {
|
|
188
|
-
if (this.status.isFalse("loaded") || !e(this,
|
|
188
|
+
if (this.status.isFalse("loaded") || !e(this, A))
|
|
189
189
|
return;
|
|
190
190
|
t.detail.context.clearRect(0, 0, t.detail.width, t.detail.height);
|
|
191
|
-
const i = e(this, p)[e(this,
|
|
192
|
-
i && t.detail.context.drawImage(i, ...e(this,
|
|
191
|
+
const i = e(this, p)[e(this, k)];
|
|
192
|
+
i && t.detail.context.drawImage(i, ...e(this, A)), e(this, B).current && n(this, k, (e(this, k) + 1) % e(this, p).length);
|
|
193
193
|
});
|
|
194
194
|
ue && (n(this, F, parseInt(
|
|
195
195
|
((t == null ? void 0 : t.pad) || this.getAttribute("pad") || "1").toString()
|
|
196
|
-
)), e(this,
|
|
196
|
+
)), e(this, I).subscribe(e(this, y)), e(this, w).subscribe(e(this, y)), e(this, L).subscribe(e(this, y)), this.addEventListener("sourceCapture", (i) => {
|
|
197
197
|
this.consumerElement.addEventListener(
|
|
198
198
|
"canvasRender",
|
|
199
199
|
e(this, C)
|
|
@@ -206,13 +206,13 @@ class Ce extends ee {
|
|
|
206
206
|
}));
|
|
207
207
|
}
|
|
208
208
|
setProgress(t) {
|
|
209
|
-
e(this, p).length && n(this,
|
|
209
|
+
e(this, p).length && n(this, k, Math.floor((e(this, p).length - 1) * t));
|
|
210
210
|
}
|
|
211
211
|
connectedCallback() {
|
|
212
|
-
super.connectedCallback(), e(this, B).observe(), e(this,
|
|
212
|
+
super.connectedCallback(), e(this, B).observe(), e(this, I).observe(), e(this, w).observe(), e(this, L).observe(), ce.subscribe(this, e(this, y));
|
|
213
213
|
}
|
|
214
214
|
disconnectedCallback() {
|
|
215
|
-
super.disconnectedCallback(), e(this, B).unobserve(), e(this,
|
|
215
|
+
super.disconnectedCallback(), e(this, B).unobserve(), e(this, I).unobserve(), e(this, w).unobserve(), e(this, L).unobserve(), n(this, p, []), ce.unsubscribe(e(this, y)), this.consumerElement.removeEventListener(
|
|
216
216
|
"canvasRender",
|
|
217
217
|
e(this, C)
|
|
218
218
|
);
|
|
@@ -222,7 +222,7 @@ class Ce extends ee {
|
|
|
222
222
|
}
|
|
223
223
|
consumeSource(t) {
|
|
224
224
|
return he(this, null, function* () {
|
|
225
|
-
var i,
|
|
225
|
+
var i, u, b, O;
|
|
226
226
|
if (t) {
|
|
227
227
|
this.consumerElement.removeEventListener(
|
|
228
228
|
"canvasRender",
|
|
@@ -250,7 +250,7 @@ class Ce extends ee {
|
|
|
250
250
|
le(`${l.src} Image not found`);
|
|
251
251
|
};
|
|
252
252
|
}))
|
|
253
|
-
), n(this, p, g), e(this, y).call(this), (
|
|
253
|
+
), n(this, p, g), e(this, y).call(this), (u = (i = this.consumerElement).onload) == null || u.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
|
|
254
254
|
"canvasRender",
|
|
255
255
|
e(this, C)
|
|
256
256
|
);
|
|
@@ -261,20 +261,20 @@ class Ce extends ee {
|
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
p = new WeakMap(),
|
|
264
|
+
p = new WeakMap(), I = new WeakMap(), B = new WeakMap(), w = new WeakMap(), L = new WeakMap(), A = new WeakMap(), k = new WeakMap(), F = new WeakMap(), y = new WeakMap(), C = new WeakMap();
|
|
265
265
|
customElements.get("e-sequence") || customElements.define("e-sequence", Ce);
|
|
266
|
-
var
|
|
266
|
+
var P, M;
|
|
267
267
|
class Se extends ee {
|
|
268
268
|
constructor() {
|
|
269
269
|
super(...arguments);
|
|
270
|
-
s(this,
|
|
270
|
+
s(this, P, 0);
|
|
271
271
|
s(this, M, () => {
|
|
272
272
|
this.classList.add(`state-${this.consumerElement.readyState}`);
|
|
273
273
|
const t = this.consumerElement.readyState / 4;
|
|
274
|
-
t > e(this,
|
|
274
|
+
t > e(this, P) && n(this, P, t), K(this, "videoReadyStateChange", {
|
|
275
275
|
detail: {
|
|
276
276
|
readyState: this.consumerElement.readyState,
|
|
277
|
-
progress: e(this,
|
|
277
|
+
progress: e(this, P)
|
|
278
278
|
}
|
|
279
279
|
}), this.consumerElement.readyState === 4 && ie.unsubscribe(e(this, M));
|
|
280
280
|
});
|
|
@@ -293,7 +293,7 @@ class Se extends ee {
|
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
295
|
disconnectedCallback() {
|
|
296
|
-
super.disconnectedCallback(), ie.unsubscribe(e(this, M)), n(this,
|
|
296
|
+
super.disconnectedCallback(), ie.unsubscribe(e(this, M)), n(this, P, 0);
|
|
297
297
|
}
|
|
298
298
|
createConsumer() {
|
|
299
299
|
return document.createElement("video");
|
|
@@ -302,18 +302,18 @@ class Se extends ee {
|
|
|
302
302
|
this.consumerElement.src = t || "", this.consumerElement.autoplay = !0;
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
|
|
305
|
+
P = new WeakMap(), M = new WeakMap();
|
|
306
306
|
customElements.get("e-video") || customElements.define("e-video", Se);
|
|
307
|
-
var
|
|
307
|
+
var c, W, S, $, J, Q, Z, N, ne;
|
|
308
308
|
const x = class x extends ee {
|
|
309
309
|
constructor() {
|
|
310
310
|
super();
|
|
311
311
|
s(this, N);
|
|
312
|
-
s(this,
|
|
312
|
+
s(this, c);
|
|
313
313
|
s(this, W);
|
|
314
|
-
s(this,
|
|
314
|
+
s(this, S, !1);
|
|
315
315
|
s(this, $, () => {
|
|
316
|
-
n(this,
|
|
316
|
+
n(this, S, e(this, S) || this.hasAttribute("autoplay") && !this.hasAttribute("capture-autoplay")), n(this, c, new window.YT.Player(e(this, W), {
|
|
317
317
|
playerVars: {
|
|
318
318
|
mute: this.hasAttribute("muted") ? 1 : 0,
|
|
319
319
|
controls: this.hasAttribute("controls") ? 1 : 0
|
|
@@ -329,17 +329,17 @@ const x = class x extends ee {
|
|
|
329
329
|
T(this, N, ne).call(this);
|
|
330
330
|
});
|
|
331
331
|
s(this, Q, (t) => {
|
|
332
|
-
var i,
|
|
333
|
-
console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (
|
|
332
|
+
var i, u;
|
|
333
|
+
console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (u = (i = this.consumerElement).onerror) == null || u.call(i, new Event("error"));
|
|
334
334
|
});
|
|
335
335
|
s(this, Z, () => {
|
|
336
336
|
});
|
|
337
337
|
n(this, W, "yt-" + be(10)), x.__apiReady || (window.onYouTubeIframeAPIReady = () => {
|
|
338
338
|
x.__apiReady = !0, K(window, "youTubeIframeAPIReady");
|
|
339
339
|
}), this.addEventListener("sourceCapture", () => {
|
|
340
|
-
this.hasAttribute("capture-autoplay") && (e(this,
|
|
340
|
+
this.hasAttribute("capture-autoplay") && (e(this, c) ? e(this, c).playVideo() : n(this, S, !0));
|
|
341
341
|
}), this.addEventListener("sourceRelease", () => {
|
|
342
|
-
e(this,
|
|
342
|
+
e(this, c) && this.hasAttribute("capture-autoplay") && (e(this, c).pauseVideo(), this.hasAttribute("replay") && e(this, c).seekTo(0));
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
static __onYouTubeIframeAPIReady() {
|
|
@@ -353,21 +353,21 @@ const x = class x extends ee {
|
|
|
353
353
|
var i;
|
|
354
354
|
if (t) {
|
|
355
355
|
if (!document.getElementById("youtube-script")) {
|
|
356
|
-
const
|
|
357
|
-
|
|
356
|
+
const u = document.createElement("script");
|
|
357
|
+
u.id, u.src = "https://www.youtube.com/iframe_api";
|
|
358
358
|
const b = document.getElementsByTagName("script")[0];
|
|
359
|
-
(i = b.parentNode) == null || i.insertBefore(
|
|
359
|
+
(i = b.parentNode) == null || i.insertBefore(u, b);
|
|
360
360
|
}
|
|
361
|
-
e(this,
|
|
362
|
-
} else e(this,
|
|
361
|
+
e(this, c) ? T(this, N, ne).call(this) : x.__apiReady ? e(this, $).call(this) : addEventListener("youTubeIframeAPIReady", e(this, $));
|
|
362
|
+
} else e(this, c) && e(this, c).stopVideo();
|
|
363
363
|
}
|
|
364
364
|
disconnectedCallback() {
|
|
365
|
-
super.disconnectedCallback(), e(this,
|
|
365
|
+
super.disconnectedCallback(), e(this, c) && e(this, c).destroy(), removeEventListener("youTubeIframeAPIReady", e(this, $));
|
|
366
366
|
}
|
|
367
367
|
};
|
|
368
|
-
|
|
368
|
+
c = new WeakMap(), W = new WeakMap(), S = new WeakMap(), $ = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), N = new WeakSet(), ne = function() {
|
|
369
369
|
var t, i;
|
|
370
|
-
this.currentURL && (this.currentURL.startsWith("http") ? e(this,
|
|
370
|
+
this.currentURL && (this.currentURL.startsWith("http") ? e(this, c).loadVideoByUrl(this.currentURL) : e(this, c).loadVideoById(this.currentURL)), e(this, S) ? e(this, c).playVideo() : e(this, c).stopVideo(), n(this, S, !1), (i = (t = this.consumerElement).onload) == null || i.call(t, new Event("load"));
|
|
371
371
|
}, x.__apiReady = !1;
|
|
372
372
|
let re = x;
|
|
373
373
|
customElements.get("e-youtube") || customElements.define("e-youtube", re);
|