aptechka 0.38.2 → 0.38.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 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=`
1
+ "use strict";var he=a=>{throw TypeError(a)};var ie=(a,n,t)=>n.has(a)||he("Cannot "+t);var e=(a,n,t)=>(ie(a,n,"read from private field"),t?t.call(a):n.get(a)),s=(a,n,t)=>n.has(a)?he("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,t),r=(a,n,t,i)=>(ie(a,n,"write to private field"),i?i.call(a,t):n.set(a,t),t),x=(a,n,t)=>(ie(a,n,"access private method"),t);var ce=(a,n,t)=>new Promise((i,c)=>{var y=m=>{try{g(t.next(m))}catch(l){c(l)}},j=m=>{try{g(t.throw(m))}catch(l){c(l)}},g=m=>m.done?i(m.value):Promise.resolve(m.value).then(y,j);g((t=t.apply(a,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ge=require("../device/index.cjs"),Ee=require("../source/index.cjs"),ve=require("../class-linked-status/index.cjs"),de=require("../browser-CpzFX2xg.cjs"),G=require("../events-KVanG9sR.cjs"),me=require("../string-DhgS_iFl.cjs"),re=require("../loading/index.cjs"),K=require("../css-property/index.cjs"),ue=require("../element-resizer/vanilla/index.cjs"),le=require("../canvas-CU5Xjahf.cjs"),Se=require("../canvas/index.cjs"),ne=require("../ticker/vanilla/index.cjs");let we=0;var d,o,E,_,f,$,R,h,q,V,v,z,X,Q,H,Z;class N 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 ve.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,q,null);s(this,V);s(this,v,null);s(this,Q,t=>{const i=t[0];e(this,f)&&(!e(this,_)||this.hasAttribute("reload-source"))&&i.isIntersecting&&this.triggerLazyLoad(),i.isIntersecting?G.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&x(this,z,X).call(this,void 0),G.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)&&re.loading.complete(e(this,R));const t=getComputedStyle(this).getPropertyValue("--clear-duration");t?r(this,V,setTimeout(()=>{e(this,h).set("clear",!0)},parseFloat(t)*1e3)):e(this,h).set("clear",!0),r(this,E,!0)});s(this,Z,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)&&re.loading.error(e(this,R)),r(this,E,!0)});de.isBrowser&&window.IntersectionObserver&&(r(this,$,`source-consumer-${++we}`),r(this,q,new IntersectionObserver(e(this,Q))))}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,X).call(this,e(this,d).current),r(this,_,!0)}connectedCallback(){const t=this.getAttribute("srcset");t&&(r(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 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;
5
+ `,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(i=>{if(i.name!=="srcset"){const c=i.nodeValue||"",y=me.kebabToCamel(i.name);y in e(this,o)&&(e(this,o)[y]=c||!0)}}),this.appendChild(e(this,o)),r(this,d,new Ee.SourceManager({srcset:t})),r(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(i=>{(!e(this,f)||e(this,f)&&e(this,_))&&x(this,z,X).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,X=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){r(this,R,`${e(this,$)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,h).set("loading",!0),r(this,v,i?t.url:t.name+t.extension),this.consumeSource(e(this,v)),!e(this,f)&&!e(this,E)&&re.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,Z).call(this,e(this,v))}}else r(this,v,null),this.consumeSource(null)},Q=new WeakMap,H=new WeakMap,Z=new WeakMap;class fe extends N{createConsumer(){return document.createElement("img")}consumeSource(n){if(n&&this.hasAttribute("webp")&&ge.device.isWebp){const t=n.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=n||""}}customElements.get("e-image")||customElements.define("e-image",fe);function Le(a){const n=a.match(/\{([\d-]+)\}/);if(n){const t=n[1].split("-");if(t.length===2){const i=parseInt(t[0],10),c=parseInt(t[1],10);return{start:i,end:c}}}return null}var p,I,U,S,w,A,P,O,b,L;class pe extends N{constructor(t){super();s(this,p,[]);s(this,I,new K.CSSProperty(this,"--fit","contain"));s(this,U,new K.CSSProperty(this,"--autoplay",!1));s(this,S,new K.CSSProperty(this,"--offset-x",.5));s(this,w,new K.CSSProperty(this,"--offset-y",.5));s(this,A,null);s(this,P,0);s(this,O,1);s(this,b,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,I).current==="cover"?r(this,A,le.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,S).current,e(this,w).current)):r(this,A,le.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&&r(this,P,(e(this,P)+1)%e(this,p).length)});de.isBrowser&&(r(this,O,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,I).subscribe(e(this,b)),e(this,S).subscribe(e(this,b)),e(this,w).subscribe(e(this,b)),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&&r(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(),ue.elementResizer.subscribe(this,e(this,b))}disconnectedCallback(){super.disconnectedCallback(),e(this,U).unobserve(),e(this,I).unobserve(),e(this,S).unobserve(),e(this,w).unobserve(),r(this,p,[]),ue.elementResizer.unsubscribe(e(this,b)),this.consumerElement.removeEventListener("canvasRender",e(this,L))}createConsumer(){return new Se.CanvasElement}consumeSource(t){return ce(this,null,function*(){var i,c,y,j;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,L));const g=[],m=Le(t);if(m)for(let l=m.start;l<=m.end;l++){const oe=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,O),"0")),D=new Image;D.src=oe,g.push(D)}else{const l=new Image;l.src=t,g.push(l)}try{yield Promise.all(g.map((l,oe)=>new Promise((D,be)=>{l.onload=()=>{D()},l.onerror=Ce=>{be(`${l.src} Image not found`)}}))),r(this,p,g),e(this,b).call(this),(c=(i=this.consumerElement).onload)==null||c.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,L))}catch(l){console.error(l),(j=(y=this.consumerElement).onerror)==null||j.call(y,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,b=new WeakMap,L=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",pe);var k,B;class ye extends N{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)&&r(this,k,t),G.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,k)}}),this.consumerElement.readyState===4&&ne.ticker.unsubscribe(e(this,B))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{ne.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(),ne.ticker.unsubscribe(e(this,B)),r(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",ye);var u,M,C,Y,W,ee,te,se,F,ae;const T=class T extends N{constructor(){super();s(this,F);s(this,u);s(this,M);s(this,C,!1);s(this,Y,!1);s(this,W,()=>{r(this,C,e(this,C)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),r(this,u,new window.YT.Player(e(this,M),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,ee),onError:e(this,te),onStateChange:e(this,se)}}))});s(this,ee,()=>{r(this,Y,!0),x(this,F,ae).call(this)});s(this,te,t=>{var i,c;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(c=(i=this.consumerElement).onerror)==null||c.call(i,new Event("error"))});s(this,se,()=>{});r(this,M,"yt-"+me.generateId(10)),T.__apiReady||(window.onYouTubeIframeAPIReady=()=>{T.__apiReady=!0,G.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,Y)?e(this,u).playVideo():r(this,C,!0))}),this.addEventListener("sourceRelease",()=>{e(this,u)&&this.hasAttribute("capture-autoplay")&&(e(this,u).pauseVideo(),this.hasAttribute("replay")&&e(this,u).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 c=document.createElement("script");c.id,c.src="https://www.youtube.com/iframe_api";const y=document.getElementsByTagName("script")[0];(i=y.parentNode)==null||i.insertBefore(c,y)}e(this,u)?x(this,F,ae).call(this):T.__apiReady?e(this,W).call(this):addEventListener("youTubeIframeAPIReady",e(this,W))}else e(this,u)&&e(this,u).stopVideo()}disconnectedCallback(){super.disconnectedCallback(),e(this,u)&&e(this,u).destroy(),removeEventListener("youTubeIframeAPIReady",e(this,W))}};u=new WeakMap,M=new WeakMap,C=new WeakMap,Y=new WeakMap,W=new WeakMap,ee=new WeakMap,te=new WeakMap,se=new WeakMap,F=new WeakSet,ae=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,u).loadVideoByUrl(this.currentURL):e(this,u).loadVideoById(this.currentURL)),e(this,C)?e(this,u).playVideo():e(this,u).stopVideo(),r(this,C,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},T.__apiReady=!1;let J=T;customElements.get("e-youtube")||customElements.define("e-youtube",J);exports.ImageElement=fe;exports.SequenceElement=pe;exports.SourceElement=N;exports.VideoElement=ye;exports.YouTubeElement=J;
@@ -1,39 +1,39 @@
1
- var oe = (a) => {
1
+ var he = (a) => {
2
2
  throw TypeError(a);
3
3
  };
4
- var te = (a, r, t) => r.has(a) || oe("Cannot " + t);
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, u) => {
4
+ var se = (a, n, t) => n.has(a) || he("Cannot " + t);
5
+ var e = (a, n, t) => (se(a, n, "read from private field"), t ? t.call(a) : n.get(a)), s = (a, n, t) => n.has(a) ? he("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, t), r = (a, n, t, i) => (se(a, n, "write to private field"), i ? i.call(a, t) : n.set(a, t), t), T = (a, n, t) => (se(a, n, "access private method"), t);
6
+ var ce = (a, n, t) => new Promise((i, c) => {
7
7
  var b = (m) => {
8
8
  try {
9
9
  g(t.next(m));
10
10
  } catch (l) {
11
- u(l);
11
+ c(l);
12
12
  }
13
- }, O = (m) => {
13
+ }, Y = (m) => {
14
14
  try {
15
15
  g(t.throw(m));
16
16
  } catch (l) {
17
- u(l);
17
+ c(l);
18
18
  }
19
- }, g = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(b, O);
20
- g((t = t.apply(a, r)).next());
19
+ }, g = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(b, Y);
20
+ g((t = t.apply(a, n)).next());
21
21
  });
22
- import { device as de } from "../device/index.js";
23
- import { SourceManager as me } from "../source/index.js";
24
- import { ClassLinkedStatus as fe } from "../class-linked-status/index.js";
25
- import { i as ue } from "../browser-0zX67oeU.js";
26
- import { d as K } from "../events-CsVF98U6.js";
27
- import { k as pe, g as be } from "../string-f0Dnk0L1.js";
28
- import { loading as se } from "../loading/index.js";
29
- import { CSSProperty as D } from "../css-property/index.js";
30
- import { elementResizer as ce } from "../element-resizer/vanilla/index.js";
31
- import { c as ye, a as ge } from "../canvas-DeZ0SLUJ.js";
32
- import { CanvasElement as Ee } from "../canvas/index.js";
33
- import { ticker as ie } from "../ticker/vanilla/index.js";
34
- let ve = 0;
35
- var d, o, E, V, f, H, R, h, U, z, v, _, j, X, q, G;
36
- class ee extends HTMLElement {
22
+ import { device as me } from "../device/index.js";
23
+ import { SourceManager as fe } from "../source/index.js";
24
+ import { ClassLinkedStatus as pe } from "../class-linked-status/index.js";
25
+ import { i as le } from "../browser-0zX67oeU.js";
26
+ import { d as X } from "../events-CsVF98U6.js";
27
+ import { k as be, g as ye } from "../string-f0Dnk0L1.js";
28
+ import { loading as ie } from "../loading/index.js";
29
+ import { CSSProperty as j } from "../css-property/index.js";
30
+ import { elementResizer as ue } from "../element-resizer/vanilla/index.js";
31
+ import { c as ge, a as Ee } from "../canvas-DeZ0SLUJ.js";
32
+ import { CanvasElement as ve } from "../canvas/index.js";
33
+ import { ticker as re } from "../ticker/vanilla/index.js";
34
+ let we = 0;
35
+ var d, o, E, V, f, H, R, h, U, z, v, _, K, G, q, J;
36
+ class te extends HTMLElement {
37
37
  constructor() {
38
38
  super();
39
39
  s(this, _);
@@ -44,7 +44,7 @@ class ee extends HTMLElement {
44
44
  s(this, f, !1);
45
45
  s(this, H, "");
46
46
  s(this, R, "");
47
- s(this, h, new fe(this, {
47
+ s(this, h, new pe(this, {
48
48
  loading: !1,
49
49
  loaded: !1,
50
50
  error: !1,
@@ -53,22 +53,22 @@ class ee extends HTMLElement {
53
53
  s(this, U, null);
54
54
  s(this, z);
55
55
  s(this, v, null);
56
- s(this, X, (t) => {
56
+ s(this, G, (t) => {
57
57
  const i = t[0];
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 }));
58
+ e(this, f) && (!e(this, V) || this.hasAttribute("reload-source")) && i.isIntersecting && this.triggerLazyLoad(), i.isIntersecting ? X(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && T(this, _, K).call(this, void 0), X(this, "sourceRelease", { custom: !0 }));
59
59
  });
60
60
  s(this, q, () => {
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));
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) && ie.complete(e(this, R));
62
62
  const t = getComputedStyle(this).getPropertyValue("--clear-duration");
63
- t ? n(this, z, setTimeout(() => {
63
+ t ? r(this, z, setTimeout(() => {
64
64
  e(this, h).set("clear", !0);
65
- }, parseFloat(t) * 1e3)) : e(this, h).set("clear", !0), n(this, E, !0);
65
+ }, parseFloat(t) * 1e3)) : e(this, h).set("clear", !0), r(this, E, !0);
66
66
  });
67
- s(this, G, (t) => {
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);
67
+ s(this, J, (t) => {
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) && ie.error(e(this, R)), r(this, E, !0);
69
69
  });
70
- ue && window.IntersectionObserver && (n(this, H, `source-consumer-${++ve}`), n(this, U, new IntersectionObserver(
71
- e(this, X)
70
+ le && window.IntersectionObserver && (r(this, H, `source-consumer-${++we}`), r(this, U, new IntersectionObserver(
71
+ e(this, G)
72
72
  )));
73
73
  }
74
74
  get consumerElement() {
@@ -87,94 +87,94 @@ class ee extends HTMLElement {
87
87
  return e(this, v);
88
88
  }
89
89
  triggerLazyLoad() {
90
- e(this, d).current && e(this, d).current !== e(this, d).previous && T(this, _, j).call(this, e(this, d).current), n(this, V, !0);
90
+ e(this, d).current && e(this, d).current !== e(this, d).previous && T(this, _, K).call(this, e(this, d).current), r(this, V, !0);
91
91
  }
92
92
  connectedCallback() {
93
93
  const t = this.getAttribute("srcset");
94
- t && (n(this, o, this.createConsumer()), e(this, o).style.cssText = `
94
+ t && (r(this, o, this.createConsumer()), e(this, o).style.cssText = `
95
95
  display: block;
96
96
  width: 100%;
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 u = i.nodeValue || "", b = pe(i.name);
101
- b in e(this, o) && (e(this, o)[b] = u || !0);
100
+ const c = i.nodeValue || "", b = be(i.name);
101
+ b in e(this, o) && (e(this, o)[b] = c || !0);
102
102
  }
103
- }), this.appendChild(e(this, o)), n(this, d, new me({
103
+ }), this.appendChild(e(this, o)), r(this, d, new fe({
104
104
  srcset: t
105
- })), n(this, f, this.hasAttribute("lazy")), e(this, d).subscribe((i) => {
106
- (!e(this, f) || e(this, f) && e(this, V)) && T(this, _, j).call(this, i.current);
105
+ })), r(this, f, this.hasAttribute("lazy")), e(this, d).subscribe((i) => {
106
+ (!e(this, f) || e(this, f) && e(this, V)) && T(this, _, K).call(this, i.current);
107
107
  }), e(this, U).observe(this), e(this, d).connect());
108
108
  }
109
109
  disconnectedCallback() {
110
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(), R = new WeakMap(), h = new WeakMap(), U = new WeakMap(), z = new WeakMap(), v = new WeakMap(), _ = new WeakSet(), j = function(t) {
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(), K = function(t) {
114
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}`);
115
+ r(this, R, `${e(this, H)}-${t.url}`);
116
116
  const i = this.hasAttribute("keep-source-parameters");
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 = () => {
117
+ e(this, h).set("loading", !0), r(this, v, i ? t.url : t.name + t.extension), this.consumeSource(e(this, v)), !e(this, f) && !e(this, E) && ie.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);
121
121
  }, e(this, o).onerror = () => {
122
- e(this, G).call(this, e(this, v));
122
+ e(this, J).call(this, e(this, v));
123
123
  };
124
124
  } else
125
- n(this, v, null), this.consumeSource(null);
126
- }, X = new WeakMap(), q = new WeakMap(), G = new WeakMap();
127
- class we extends ee {
125
+ r(this, v, null), this.consumeSource(null);
126
+ }, G = new WeakMap(), q = new WeakMap(), J = new WeakMap();
127
+ class Le extends te {
128
128
  createConsumer() {
129
129
  return document.createElement("img");
130
130
  }
131
- consumeSource(r) {
132
- if (r && this.hasAttribute("webp") && de.isWebp) {
133
- const t = r.split(".").slice(0, -1).join(".") + ".webp";
131
+ consumeSource(n) {
132
+ if (n && this.hasAttribute("webp") && me.isWebp) {
133
+ const t = n.split(".").slice(0, -1).join(".") + ".webp";
134
134
  this.consumerElement.src = t;
135
135
  } else
136
- this.consumerElement.src = r || "";
136
+ this.consumerElement.src = n || "";
137
137
  }
138
138
  }
139
- customElements.get("e-image") || customElements.define("e-image", we);
140
- function Le(a) {
141
- const r = a.match(/\{([\d-]+)\}/);
142
- if (r) {
143
- const t = r[1].split("-");
139
+ customElements.get("e-image") || customElements.define("e-image", Le);
140
+ function Ce(a) {
141
+ const n = a.match(/\{([\d-]+)\}/);
142
+ if (n) {
143
+ const t = n[1].split("-");
144
144
  if (t.length === 2) {
145
- const i = parseInt(t[0], 10), u = parseInt(t[1], 10);
146
- return { start: i, end: u };
145
+ const i = parseInt(t[0], 10), c = parseInt(t[1], 10);
146
+ return { start: i, end: c };
147
147
  }
148
148
  }
149
149
  return null;
150
150
  }
151
151
  var p, I, B, w, L, A, k, F, y, C;
152
- class Ce extends ee {
152
+ class Se extends te {
153
153
  constructor(t) {
154
154
  super();
155
155
  s(this, p, []);
156
- s(this, I, new D(
156
+ s(this, I, new j(
157
157
  this,
158
158
  "--fit",
159
159
  "contain"
160
160
  ));
161
- s(this, B, new D(this, "--autoplay", !1));
162
- s(this, w, new D(this, "--offset-x", 0.5));
163
- s(this, L, new D(this, "--offset-y", 0.5));
161
+ s(this, B, new j(this, "--autoplay", !1));
162
+ s(this, w, new j(this, "--offset-x", 0.5));
163
+ s(this, L, new j(this, "--offset-y", 0.5));
164
164
  s(this, A, null);
165
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, I).current === "cover" ? n(this, A, ye(
170
+ e(this, I).current === "cover" ? r(this, A, ge(
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, A, ge(
177
+ )) : r(this, A, Ee(
178
178
  t.naturalWidth,
179
179
  t.naturalHeight,
180
180
  this.consumerElement.width,
@@ -189,9 +189,9 @@ class Ce extends ee {
189
189
  return;
190
190
  t.detail.context.clearRect(0, 0, t.detail.width, t.detail.height);
191
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);
192
+ i && t.detail.context.drawImage(i, ...e(this, A)), e(this, B).current && r(this, k, (e(this, k) + 1) % e(this, p).length);
193
193
  });
194
- ue && (n(this, F, parseInt(
194
+ le && (r(this, F, parseInt(
195
195
  ((t == null ? void 0 : t.pad) || this.getAttribute("pad") || "1").toString()
196
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(
@@ -206,36 +206,36 @@ class Ce extends ee {
206
206
  }));
207
207
  }
208
208
  setProgress(t) {
209
- e(this, p).length && n(this, k, Math.floor((e(this, p).length - 1) * t));
209
+ e(this, p).length && r(this, k, Math.floor((e(this, p).length - 1) * t));
210
210
  }
211
211
  connectedCallback() {
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));
212
+ super.connectedCallback(), e(this, B).observe(), e(this, I).observe(), e(this, w).observe(), e(this, L).observe(), ue.subscribe(this, e(this, y));
213
213
  }
214
214
  disconnectedCallback() {
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(
215
+ super.disconnectedCallback(), e(this, B).unobserve(), e(this, I).unobserve(), e(this, w).unobserve(), e(this, L).unobserve(), r(this, p, []), ue.unsubscribe(e(this, y)), this.consumerElement.removeEventListener(
216
216
  "canvasRender",
217
217
  e(this, C)
218
218
  );
219
219
  }
220
220
  createConsumer() {
221
- return new Ee();
221
+ return new ve();
222
222
  }
223
223
  consumeSource(t) {
224
- return he(this, null, function* () {
225
- var i, u, b, O;
224
+ return ce(this, null, function* () {
225
+ var i, c, b, Y;
226
226
  if (t) {
227
227
  this.consumerElement.removeEventListener(
228
228
  "canvasRender",
229
229
  e(this, C)
230
230
  );
231
- const g = [], m = Le(t);
231
+ const g = [], m = Ce(t);
232
232
  if (m)
233
233
  for (let l = m.start; l <= m.end; l++) {
234
- const ae = t.replace(
234
+ const oe = t.replace(
235
235
  /\{([^}]+)\}/,
236
236
  l.toString().padStart(e(this, F), "0")
237
- ), Y = new Image();
238
- Y.src = ae, g.push(Y);
237
+ ), D = new Image();
238
+ D.src = oe, g.push(D);
239
239
  }
240
240
  else {
241
241
  const l = new Image();
@@ -243,45 +243,45 @@ class Ce extends ee {
243
243
  }
244
244
  try {
245
245
  yield Promise.all(
246
- g.map((l, ae) => new Promise((Y, le) => {
246
+ g.map((l, oe) => new Promise((D, de) => {
247
247
  l.onload = () => {
248
- Y();
249
- }, l.onerror = (Re) => {
250
- le(`${l.src} Image not found`);
248
+ D();
249
+ }, l.onerror = (Ie) => {
250
+ de(`${l.src} Image not found`);
251
251
  };
252
252
  }))
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(
253
+ ), r(this, p, g), e(this, y).call(this), (c = (i = this.consumerElement).onload) == null || c.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
254
254
  "canvasRender",
255
255
  e(this, C)
256
256
  );
257
257
  } catch (l) {
258
- console.error(l), (O = (b = this.consumerElement).onerror) == null || O.call(b, new Event("error"));
258
+ console.error(l), (Y = (b = this.consumerElement).onerror) == null || Y.call(b, new Event("error"));
259
259
  }
260
260
  }
261
261
  });
262
262
  }
263
263
  }
264
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
- customElements.get("e-sequence") || customElements.define("e-sequence", Ce);
265
+ customElements.get("e-sequence") || customElements.define("e-sequence", Se);
266
266
  var P, M;
267
- class Se extends ee {
267
+ class Re extends te {
268
268
  constructor() {
269
269
  super(...arguments);
270
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, P) && n(this, P, t), K(this, "videoReadyStateChange", {
274
+ t > e(this, P) && r(this, P, t), X(this, "videoReadyStateChange", {
275
275
  detail: {
276
276
  readyState: this.consumerElement.readyState,
277
277
  progress: e(this, P)
278
278
  }
279
- }), this.consumerElement.readyState === 4 && ie.unsubscribe(e(this, M));
279
+ }), this.consumerElement.readyState === 4 && re.unsubscribe(e(this, M));
280
280
  });
281
281
  }
282
282
  connectedCallback() {
283
283
  super.connectedCallback(), this.addEventListener("sourceCapture", () => {
284
- ie.subscribe(e(this, M)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
284
+ re.subscribe(e(this, M)), this.hasAttribute("capture-autoplay") && this.consumerElement.play();
285
285
  }), this.addEventListener("sourceRelease", () => {
286
286
  this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
287
287
  "state-0",
@@ -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, P, 0);
296
+ super.disconnectedCallback(), re.unsubscribe(e(this, M)), r(this, P, 0);
297
297
  }
298
298
  createConsumer() {
299
299
  return document.createElement("video");
@@ -303,43 +303,44 @@ class Se extends ee {
303
303
  }
304
304
  }
305
305
  P = new WeakMap(), M = new WeakMap();
306
- customElements.get("e-video") || customElements.define("e-video", Se);
307
- var c, W, S, $, J, Q, Z, N, ne;
308
- const x = class x extends ee {
306
+ customElements.get("e-video") || customElements.define("e-video", Re);
307
+ var u, W, S, N, $, Q, Z, ee, O, ae;
308
+ const x = class x extends te {
309
309
  constructor() {
310
310
  super();
311
- s(this, N);
312
- s(this, c);
311
+ s(this, O);
312
+ s(this, u);
313
313
  s(this, W);
314
314
  s(this, S, !1);
315
+ s(this, N, !1);
315
316
  s(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
+ r(this, S, e(this, S) || this.hasAttribute("autoplay") && !this.hasAttribute("capture-autoplay")), r(this, u, new window.YT.Player(e(this, W), {
317
318
  playerVars: {
318
319
  mute: this.hasAttribute("muted") ? 1 : 0,
319
320
  controls: this.hasAttribute("controls") ? 1 : 0
320
321
  },
321
322
  events: {
322
- onReady: e(this, J),
323
- onError: e(this, Q),
324
- onStateChange: e(this, Z)
323
+ onReady: e(this, Q),
324
+ onError: e(this, Z),
325
+ onStateChange: e(this, ee)
325
326
  }
326
327
  }));
327
328
  });
328
- s(this, J, () => {
329
- T(this, N, ne).call(this);
329
+ s(this, Q, () => {
330
+ r(this, N, !0), T(this, O, ae).call(this);
330
331
  });
331
- s(this, Q, (t) => {
332
- var i, u;
333
- console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (u = (i = this.consumerElement).onerror) == null || u.call(i, new Event("error"));
332
+ s(this, Z, (t) => {
333
+ var i, c;
334
+ console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (c = (i = this.consumerElement).onerror) == null || c.call(i, new Event("error"));
334
335
  });
335
- s(this, Z, () => {
336
+ s(this, ee, () => {
336
337
  });
337
- n(this, W, "yt-" + be(10)), x.__apiReady || (window.onYouTubeIframeAPIReady = () => {
338
- x.__apiReady = !0, K(window, "youTubeIframeAPIReady");
338
+ r(this, W, "yt-" + ye(10)), x.__apiReady || (window.onYouTubeIframeAPIReady = () => {
339
+ x.__apiReady = !0, X(window, "youTubeIframeAPIReady");
339
340
  }), this.addEventListener("sourceCapture", () => {
340
- this.hasAttribute("capture-autoplay") && (e(this, c) ? e(this, c).playVideo() : n(this, S, !0));
341
+ this.hasAttribute("capture-autoplay") && (e(this, N) ? e(this, u).playVideo() : r(this, S, !0));
341
342
  }), this.addEventListener("sourceRelease", () => {
342
- e(this, c) && this.hasAttribute("capture-autoplay") && (e(this, c).pauseVideo(), this.hasAttribute("replay") && e(this, c).seekTo(0));
343
+ e(this, u) && this.hasAttribute("capture-autoplay") && (e(this, u).pauseVideo(), this.hasAttribute("replay") && e(this, u).seekTo(0));
343
344
  });
344
345
  }
345
346
  static __onYouTubeIframeAPIReady() {
@@ -353,28 +354,28 @@ const x = class x extends ee {
353
354
  var i;
354
355
  if (t) {
355
356
  if (!document.getElementById("youtube-script")) {
356
- const u = document.createElement("script");
357
- u.id, u.src = "https://www.youtube.com/iframe_api";
357
+ const c = document.createElement("script");
358
+ c.id, c.src = "https://www.youtube.com/iframe_api";
358
359
  const b = document.getElementsByTagName("script")[0];
359
- (i = b.parentNode) == null || i.insertBefore(u, b);
360
+ (i = b.parentNode) == null || i.insertBefore(c, b);
360
361
  }
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();
362
+ e(this, u) ? T(this, O, ae).call(this) : x.__apiReady ? e(this, $).call(this) : addEventListener("youTubeIframeAPIReady", e(this, $));
363
+ } else e(this, u) && e(this, u).stopVideo();
363
364
  }
364
365
  disconnectedCallback() {
365
- super.disconnectedCallback(), e(this, c) && e(this, c).destroy(), removeEventListener("youTubeIframeAPIReady", e(this, $));
366
+ super.disconnectedCallback(), e(this, u) && e(this, u).destroy(), removeEventListener("youTubeIframeAPIReady", e(this, $));
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
+ u = new WeakMap(), W = new WeakMap(), S = new WeakMap(), N = new WeakMap(), $ = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), ee = new WeakMap(), O = new WeakSet(), ae = function() {
369
370
  var t, i;
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
+ this.currentURL && (this.currentURL.startsWith("http") ? e(this, u).loadVideoByUrl(this.currentURL) : e(this, u).loadVideoById(this.currentURL)), e(this, S) ? e(this, u).playVideo() : e(this, u).stopVideo(), r(this, S, !1), (i = (t = this.consumerElement).onload) == null || i.call(t, new Event("load"));
371
372
  }, x.__apiReady = !1;
372
- let re = x;
373
- customElements.get("e-youtube") || customElements.define("e-youtube", re);
373
+ let ne = x;
374
+ customElements.get("e-youtube") || customElements.define("e-youtube", ne);
374
375
  export {
375
- we as ImageElement,
376
- Ce as SequenceElement,
377
- ee as SourceElement,
378
- Se as VideoElement,
379
- re as YouTubeElement
376
+ Le as ImageElement,
377
+ Se as SequenceElement,
378
+ te as SourceElement,
379
+ Re as VideoElement,
380
+ ne as YouTubeElement
380
381
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.38.2",
3
+ "version": "0.38.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"