aptechka 0.40.6 → 0.41.0

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.
Files changed (110) hide show
  1. package/lib/accordion/index.d.ts +0 -1
  2. package/lib/animation/Animation.d.ts +0 -1
  3. package/lib/animation/Damped.d.ts +0 -1
  4. package/lib/animation/Tweened.d.ts +0 -1
  5. package/lib/attribute/index.d.ts +0 -1
  6. package/lib/canvas/index.d.ts +0 -1
  7. package/lib/class-linked-status/index.d.ts +0 -1
  8. package/lib/controls/AutoplayControls.d.ts +0 -1
  9. package/lib/controls/Controls.d.ts +0 -1
  10. package/lib/controls/DragControls.d.ts +0 -1
  11. package/lib/controls/KeyboardControls.d.ts +0 -1
  12. package/lib/controls/WheelControls.d.ts +0 -1
  13. package/lib/css-property/index.d.ts +0 -1
  14. package/lib/device/Viewport.d.ts +0 -1
  15. package/lib/element-resizer/react/index.d.ts +0 -1
  16. package/lib/element-resizer/vanilla/index.d.ts +0 -1
  17. package/lib/en3/En3Raycaster.d.ts +0 -1
  18. package/lib/en3/En3View.d.ts +0 -1
  19. package/lib/en3/en3.d.ts +0 -1
  20. package/lib/en3/index.cjs +2 -2
  21. package/lib/en3/index.js +91 -92
  22. package/lib/en3/utils/coverTexture.d.ts +0 -1
  23. package/lib/en3/utils/dispose.d.ts +0 -1
  24. package/lib/en3/utils/getCurrentViewport.d.ts +0 -1
  25. package/lib/en3/utils/traverseMaterials.d.ts +0 -1
  26. package/lib/en3/utils/traverseMeshes.d.ts +0 -1
  27. package/lib/intersector/react/index.d.ts +0 -1
  28. package/lib/intersector/vanilla/index.d.ts +0 -1
  29. package/lib/ladder/index.d.ts +0 -1
  30. package/lib/layout-box/index.d.ts +0 -1
  31. package/lib/media/index.d.ts +0 -1
  32. package/lib/media-elements/iframe/index.d.ts +0 -1
  33. package/lib/media-elements/image/index.d.ts +0 -1
  34. package/lib/media-elements/index.cjs +2 -2
  35. package/lib/media-elements/index.js +31 -32
  36. package/lib/media-elements/sequence/index.d.ts +0 -1
  37. package/lib/media-elements/source/index.d.ts +0 -1
  38. package/lib/media-elements/video/index.d.ts +0 -1
  39. package/lib/media-elements/youtube/index.d.ts +0 -1
  40. package/lib/morph/Link.d.ts +1 -1
  41. package/lib/morph/Morph.d.ts +18 -3
  42. package/lib/morph/index.cjs +1 -1
  43. package/lib/morph/index.js +184 -150
  44. package/lib/need_redo_tweaker/TweakerBooleanManagerElement.d.ts +0 -1
  45. package/lib/need_redo_tweaker/TweakerColorManagerElement.d.ts +0 -1
  46. package/lib/need_redo_tweaker/TweakerElement.d.ts +0 -1
  47. package/lib/need_redo_tweaker/TweakerFieldElement.d.ts +0 -1
  48. package/lib/need_redo_tweaker/TweakerFolderElement.d.ts +0 -1
  49. package/lib/need_redo_tweaker/TweakerLinkManagerElement.d.ts +0 -1
  50. package/lib/need_redo_tweaker/TweakerNumberManagerElement.d.ts +0 -1
  51. package/lib/need_redo_tweaker/TweakerSelectManagerElement.d.ts +0 -1
  52. package/lib/need_redo_tweaker/TweakerStoreManagerElement.d.ts +0 -1
  53. package/lib/need_redo_tweaker/TweakerStringManagerElement.d.ts +0 -1
  54. package/lib/need_redo_tweaker/element-constructor/ElementConstructor.d.ts +0 -1
  55. package/lib/need_redo_tweaker/element-constructor/createStylesheet.d.ts +0 -1
  56. package/lib/need_redo_tweaker/element-constructor/createTheme.d.ts +0 -1
  57. package/lib/need_redo_tweaker/element-constructor/tags.d.ts +0 -1
  58. package/lib/need_redo_tweaker/select/SelectHeadElement.d.ts +0 -1
  59. package/lib/need_redo_tweaker/select/SelectOptionElement.d.ts +0 -1
  60. package/lib/need_redo_tweaker/select/SelectUserElement.d.ts +0 -1
  61. package/lib/need_redo_tweaker/tweakerManagerConstructors.d.ts +0 -1
  62. package/lib/pointer/Pointer.d.ts +0 -1
  63. package/lib/pointer/PointerElement.d.ts +0 -1
  64. package/lib/popover/PopoverButtonElement.d.ts +0 -1
  65. package/lib/popover/PopoverElement.d.ts +0 -1
  66. package/lib/router/Link.d.ts +0 -1
  67. package/lib/router/Router.d.ts +0 -1
  68. package/lib/scroll/react/Scroll.d.ts +0 -1
  69. package/lib/scroll/react/ScrollBulletButtons.d.ts +0 -1
  70. package/lib/scroll/react/ScrollSegment.d.ts +0 -1
  71. package/lib/scroll/react/ScrollSetButton.d.ts +0 -1
  72. package/lib/scroll/react/ScrollStepButton.d.ts +0 -1
  73. package/lib/scroll/react/Scrollbar.d.ts +0 -1
  74. package/lib/scroll/vanilla/ScrollBulletButtonsElement.d.ts +0 -1
  75. package/lib/scroll/vanilla/ScrollButtonElement.d.ts +0 -1
  76. package/lib/scroll/vanilla/ScrollElement.d.ts +0 -1
  77. package/lib/scroll/vanilla/ScrollSection.d.ts +0 -1
  78. package/lib/scroll/vanilla/ScrollSegmentElement.d.ts +0 -1
  79. package/lib/scroll/vanilla/ScrollSetButtonElement.d.ts +0 -1
  80. package/lib/scroll/vanilla/ScrollStepButtonElement.d.ts +0 -1
  81. package/lib/scroll/vanilla/ScrollUserElement.d.ts +0 -1
  82. package/lib/scroll/vanilla/ScrollbarElement.d.ts +0 -1
  83. package/lib/scroll-entries/index.d.ts +0 -1
  84. package/lib/scroll-segment/index.d.ts +0 -1
  85. package/lib/slicer/SlicerElement.d.ts +0 -1
  86. package/lib/slicer/Word.d.ts +0 -1
  87. package/lib/source/SourceManager.d.ts +0 -1
  88. package/lib/source/SourceSet.d.ts +0 -1
  89. package/lib/store/react/useStore.d.ts +0 -1
  90. package/lib/store/vanilla/Composed.d.ts +0 -1
  91. package/lib/store/vanilla/Derived.d.ts +0 -1
  92. package/lib/store/vanilla/DerivedArray.d.ts +0 -1
  93. package/lib/store/vanilla/Resource.d.ts +0 -1
  94. package/lib/store/vanilla/StoreRegistry.d.ts +0 -1
  95. package/lib/studio/Outliner/File/index.d.ts +0 -1
  96. package/lib/studio/Outliner/Folder/index.d.ts +0 -1
  97. package/lib/studio/Outliner/index.d.ts +0 -1
  98. package/lib/studio/Studio/index.d.ts +0 -1
  99. package/lib/studio/Tweaker/index.d.ts +0 -1
  100. package/lib/studio/store.d.ts +0 -1
  101. package/lib/ticker/react/index.d.ts +0 -1
  102. package/lib/ticker/vanilla/index.d.ts +0 -1
  103. package/lib/utils/collisions.d.ts +0 -1
  104. package/lib/utils/coordinates.d.ts +0 -1
  105. package/lib/utils/events.d.ts +1 -1
  106. package/lib/utils/math.d.ts +0 -1
  107. package/lib/utils/ts-react-utility.d.ts +0 -1
  108. package/lib/window-resizer/react/index.d.ts +0 -1
  109. package/lib/window-resizer/vanilla/index.d.ts +0 -1
  110. package/package.json +4 -3
@@ -1,5 +1,4 @@
1
1
  import { Store } from '../store/vanilla';
2
-
3
2
  export type MediaCallback = () => void;
4
3
  export type MediaQueries<T extends string = string> = Map<T, {
5
4
  match: MediaCallback;
@@ -1,5 +1,4 @@
1
1
  import { SourceElement } from '../source';
2
-
3
2
  export declare class IFrameElement extends SourceElement<HTMLElement> {
4
3
  #private;
5
4
  constructor();
@@ -1,5 +1,4 @@
1
1
  import { SourceElement } from '../source';
2
-
3
2
  export declare class ImageElement extends SourceElement<HTMLImageElement> {
4
3
  protected createConsumer(): HTMLImageElement;
5
4
  protected consumeSource(url: string | null): void;
@@ -1,5 +1,5 @@
1
- "use strict";var de=a=>{throw TypeError(a)};var oe=(a,n,t)=>n.has(a)||de("Cannot "+t);var e=(a,n,t)=>(oe(a,n,"read from private field"),t?t.call(a):n.get(a)),s=(a,n,t)=>n.has(a)?de("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,t),r=(a,n,t,i)=>(oe(a,n,"write to private field"),i?i.call(a,t):n.set(a,t),t),q=(a,n,t)=>(oe(a,n,"access private method"),t);var me=(a,n,t)=>new Promise((i,o)=>{var E=m=>{try{v(t.next(m))}catch(l){o(l)}},A=m=>{try{v(t.throw(m))}catch(l){o(l)}},v=m=>m.done?i(m.value):Promise.resolve(m.value).then(E,A);v((t=t.apply(a,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const we=require("../source/index.cjs"),Ce=require("../class-linked-status/index.cjs"),Ee=require("../browser-CpzFX2xg.cjs"),V=require("../events-KVanG9sR.cjs"),ye=require("../string-DhgS_iFl.cjs"),he=require("../loading/index.cjs"),Re=require("../device/index.cjs"),J=require("../css-property/index.cjs"),fe=require("../element-resizer/vanilla/index.cjs"),pe=require("../canvas-CU5Xjahf.cjs"),Ie=require("../canvas/index.cjs"),ce=require("../ticker/vanilla/index.cjs");let Ae=0;var d,h,y,S,f,Y,k,c,B,U,L,N,O,Q,ee,j,te;class $ extends HTMLElement{constructor(t){super();s(this,O);s(this,d,null);s(this,h,null);s(this,y,!1);s(this,S,!1);s(this,f,!1);s(this,Y,"");s(this,k,"");s(this,c,new Ce.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,B,null);s(this,U);s(this,L,null);s(this,N);s(this,ee,t=>{const i=t[0];e(this,f)&&(!e(this,S)||this.hasAttribute("reload-source"))&&i.isIntersecting&&this.triggerLazyLoad(),i.isIntersecting?V.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&q(this,O,Q).call(this,void 0),V.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,j,()=>{e(this,c).set("loaded",!0),e(this,c).set("error",!1),e(this,c).set("loading",!1),!e(this,f)&&!e(this,y)&&he.loading.complete(e(this,k)),V.dispatchEvent(this,"sourceLoaded",{custom:!0});const t=getComputedStyle(this).getPropertyValue("--clear-duration");t?r(this,U,setTimeout(()=>{e(this,c).set("clear",!0)},parseFloat(t)*1e3)):e(this,c).set("clear",!0),r(this,y,!0)});s(this,te,t=>{e(this,c).set("loaded",!1),e(this,c).set("error",!0),e(this,c).set("loading",!1),!e(this,f)&&!e(this,y)&&he.loading.error(e(this,k)),V.dispatchEvent(this,"sourceError",{custom:!0}),r(this,y,!0)});r(this,N,t==null?void 0:t.sourceSetOptions),Ee.isBrowser&&window.IntersectionObserver&&r(this,B,new IntersectionObserver(e(this,ee)))}get consumerElement(){return e(this,h)}get sourceManager(){return e(this,d)}get status(){return e(this,c)}get isLazy(){return e(this,f)}get currentURL(){return e(this,L)}get isFirstLoadHappened(){return e(this,y)}triggerLazyLoad(){!e(this,S)&&e(this,d).current&&e(this,d).current!==e(this,d).previous&&(r(this,S,!0),q(this,O,Q).call(this,e(this,d).current))}connectedCallback(){r(this,Y,`source-consumer-${++Ae}`);const t=this.getAttribute("srcset");if(!t)return;const i=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;i&&e(this,c).addElement(i),r(this,h,this.createConsumer()),e(this,h).style.cssText=`
1
+ "use strict";var de=a=>{throw TypeError(a)};var oe=(a,n,t)=>n.has(a)||de("Cannot "+t);var e=(a,n,t)=>(oe(a,n,"read from private field"),t?t.call(a):n.get(a)),s=(a,n,t)=>n.has(a)?de("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,t),r=(a,n,t,i)=>(oe(a,n,"write to private field"),i?i.call(a,t):n.set(a,t),t),q=(a,n,t)=>(oe(a,n,"access private method"),t);var me=(a,n,t)=>new Promise((i,h)=>{var E=m=>{try{v(t.next(m))}catch(l){h(l)}},A=m=>{try{v(t.throw(m))}catch(l){h(l)}},v=m=>m.done?i(m.value):Promise.resolve(m.value).then(E,A);v((t=t.apply(a,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const we=require("../source/index.cjs"),Ce=require("../class-linked-status/index.cjs"),Ee=require("../browser-CpzFX2xg.cjs"),V=require("../events-KVanG9sR.cjs"),ye=require("../string-DhgS_iFl.cjs"),he=require("../loading/index.cjs"),Re=require("../device/index.cjs"),J=require("../css-property/index.cjs"),fe=require("../element-resizer/vanilla/index.cjs"),pe=require("../canvas-CU5Xjahf.cjs"),Ie=require("../canvas/index.cjs"),ce=require("../ticker/vanilla/index.cjs");let Ae=0;var d,o,y,S,f,Y,k,c,B,U,L,N,O,Q,ee,j,te;class $ extends HTMLElement{constructor(t){super();s(this,O);s(this,d,null);s(this,o,null);s(this,y,!1);s(this,S,!1);s(this,f,!1);s(this,Y,"");s(this,k,"");s(this,c,new Ce.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,B,null);s(this,U);s(this,L,null);s(this,N);s(this,ee,t=>{const i=t[0];e(this,f)&&(!e(this,S)||this.hasAttribute("reload-source"))&&i.isIntersecting&&this.triggerLazyLoad(),i.isIntersecting?V.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&q(this,O,Q).call(this,void 0),V.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,j,()=>{e(this,c).set("loaded",!0),e(this,c).set("error",!1),e(this,c).set("loading",!1),!e(this,f)&&!e(this,y)&&he.loading.complete(e(this,k)),V.dispatchEvent(this,"sourceLoaded",{custom:!0});const t=getComputedStyle(this).getPropertyValue("--clear-duration");t?r(this,U,setTimeout(()=>{e(this,c).set("clear",!0)},parseFloat(t)*1e3)):e(this,c).set("clear",!0),r(this,y,!0)});s(this,te,t=>{e(this,c).set("loaded",!1),e(this,c).set("error",!0),e(this,c).set("loading",!1),!e(this,f)&&!e(this,y)&&he.loading.error(e(this,k)),V.dispatchEvent(this,"sourceError",{custom:!0}),r(this,y,!0)});r(this,N,t==null?void 0:t.sourceSetOptions),Ee.isBrowser&&window.IntersectionObserver&&r(this,B,new IntersectionObserver(e(this,ee)))}get consumerElement(){return e(this,o)}get sourceManager(){return e(this,d)}get status(){return e(this,c)}get isLazy(){return e(this,f)}get currentURL(){return e(this,L)}get isFirstLoadHappened(){return e(this,y)}triggerLazyLoad(){!e(this,S)&&e(this,d).current&&e(this,d).current!==e(this,d).previous&&(r(this,S,!0),q(this,O,Q).call(this,e(this,d).current))}connectedCallback(){r(this,Y,`source-consumer-${++Ae}`);const t=this.getAttribute("srcset")||"",i=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;i&&e(this,c).addElement(i),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,h).classList.add("source-consumer"),Array.from(this.attributes).forEach(o=>{if(o.name!=="srcset"){const E=o.nodeValue||"",A=ye.kebabToCamel(o.name);A in e(this,h)&&(e(this,h)[A]=E||!0)}}),this.appendChild(e(this,h)),r(this,d,new we.SourceManager({srcset:t,sourceSetOptions:e(this,N)})),r(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(o=>{(!e(this,f)||e(this,f)&&e(this,S))&&q(this,O,Q).call(this,o.current)}),e(this,d).connect(),e(this,B).observe(this)}disconnectedCallback(){e(this,B).disconnect(),e(this,d).close(),e(this,h).onloadeddata=null,e(this,h).onload=null,e(this,h).onerror=null,r(this,y,!1),r(this,S,!1),e(this,h).remove(),e(this,c).reset(),clearTimeout(e(this,U))}}d=new WeakMap,h=new WeakMap,y=new WeakMap,S=new WeakMap,f=new WeakMap,Y=new WeakMap,k=new WeakMap,c=new WeakMap,B=new WeakMap,U=new WeakMap,L=new WeakMap,N=new WeakMap,O=new WeakSet,Q=function(t){if(clearTimeout(e(this,U)),e(this,h).onloadeddata=null,e(this,h).onload=null,e(this,h).onerror=null,e(this,c).set("loaded",!1),e(this,c).set("error",!1),e(this,c).set("loading",!1),e(this,c).set("clear",!1),t){r(this,k,`${e(this,Y)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0),r(this,L,i?t.url:t.name+t.extension),this.consumeSource(e(this,L)),!e(this,f)&&!e(this,y)&&he.loading.add(e(this,k)),e(this,h).onloadeddata=()=>{e(this,j).call(this)},e(this,h).onload=()=>{e(this,j).call(this)},e(this,h).onerror=()=>{e(this,te).call(this,e(this,L))}}else r(this,L,null),this.consumeSource(null)},ee=new WeakMap,j=new WeakMap,te=new WeakMap;var b,se,ie;class be extends ${constructor(){super({sourceSetOptions:{mediaBuckets:!1}});s(this,b,null);s(this,se,()=>{var t,i;(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))});s(this,ie,()=>{var t,i;(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(t){e(this,b)&&(e(this,b).onload=null,e(this,b).onerror=null),this.consumerElement.innerHTML=(t==null?void 0:t.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",r(this,b,this.consumerElement.querySelector("iframe")),e(this,b)&&(e(this,b).onload=e(this,se),e(this,b).onerror=e(this,ie))}}b=new WeakMap,se=new WeakMap,ie=new WeakMap;customElements.get("e-iframe")||customElements.define("e-iframe",be);class ge extends ${createConsumer(){return document.createElement("img")}consumeSource(n){if(n&&this.hasAttribute("webp")&&Re.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",ge);function ke(a){const n=a.match(/\{([\d-]+)\}/);if(n){const t=n[1].split("-");if(t.length===2){const i=parseInt(t[0],10),o=parseInt(t[1],10);return{start:i,end:o}}}return null}var p,P,M,w,C,x,T,D,g,R;class ve extends ${constructor(t){super();s(this,p,[]);s(this,P,new J.CSSProperty(this,"--fit","contain"));s(this,M,new J.CSSProperty(this,"--autoplay",!1));s(this,w,new J.CSSProperty(this,"--offset-x",.5));s(this,C,new J.CSSProperty(this,"--offset-y",.5));s(this,x,null);s(this,T,0);s(this,D,1);s(this,g,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,P).current==="cover"?r(this,x,pe.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current)):r(this,x,pe.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current))}});s(this,R,t=>{if(this.status.isFalse("loaded")||!e(this,x))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,p)[e(this,T)];i&&t.detail.context.drawImage(i,...e(this,x)),e(this,M).current&&r(this,T,(e(this,T)+1)%e(this,p).length)});Ee.isBrowser&&(r(this,D,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,P).subscribe(e(this,g)),e(this,w).subscribe(e(this,g)),e(this,C).subscribe(e(this,g)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,R))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,R))}))}setProgress(t){e(this,p).length&&r(this,T,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,M).observe(),e(this,P).observe(),e(this,w).observe(),e(this,C).observe(),fe.elementResizer.subscribe(this,e(this,g))}disconnectedCallback(){super.disconnectedCallback(),e(this,M).unobserve(),e(this,P).unobserve(),e(this,w).unobserve(),e(this,C).unobserve(),r(this,p,[]),fe.elementResizer.unsubscribe(e(this,g)),this.consumerElement.removeEventListener("canvasRender",e(this,R))}createConsumer(){return new Ie.CanvasElement}consumeSource(t){return me(this,null,function*(){var i,o,E,A;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,R));const v=[],m=ke(t);if(m)for(let l=m.start;l<=m.end;l++){const le=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,D),"0")),G=new Image;G.src=le,v.push(G)}else{const l=new Image;l.src=t,v.push(l)}try{yield Promise.all(v.map((l,le)=>new Promise((G,Le)=>{l.onload=()=>{G()},l.onerror=Pe=>{Le(`${l.src} Image not found`)}}))),r(this,p,v),e(this,g).call(this),(o=(i=this.consumerElement).onload)==null||o.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,R))}catch(l){console.error(l),(A=(E=this.consumerElement).onerror)==null||A.call(E,new Event("error"))}}})}}p=new WeakMap,P=new WeakMap,M=new WeakMap,w=new WeakMap,C=new WeakMap,x=new WeakMap,T=new WeakMap,D=new WeakMap,g=new WeakMap,R=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",ve);var _,F;class Se extends ${constructor(){super(...arguments);s(this,_,0);s(this,F,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,_)&&r(this,_,t),V.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,_)}}),this.consumerElement.readyState===4&&ce.ticker.unsubscribe(e(this,F))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{ce.ticker.subscribe(e(this,F)),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(),ce.ticker.unsubscribe(e(this,F)),r(this,_,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}_=new WeakMap,F=new WeakMap;customElements.get("e-video")||customElements.define("e-video",Se);var u,H,I,K,W,re,ne,ae,X,ue;const z=class z extends ${constructor(){super();s(this,X);s(this,u);s(this,H);s(this,I,!1);s(this,K,!1);s(this,W,()=>{r(this,I,e(this,I)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),r(this,u,new window.YT.Player(e(this,H),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,re),onError:e(this,ne),onStateChange:e(this,ae)}}))});s(this,re,()=>{r(this,K,!0),q(this,X,ue).call(this)});s(this,ne,t=>{var i,o;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(o=(i=this.consumerElement).onerror)==null||o.call(i,new Event("error"))});s(this,ae,()=>{});r(this,H,"yt-"+ye.generateId(10)),z.__apiReady||(window.onYouTubeIframeAPIReady=()=>{z.__apiReady=!0,V.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,K)?e(this,u).playVideo():r(this,I,!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,H),t}consumeSource(t){var i;if(t){if(!document.getElementById("youtube-script")){const o=document.createElement("script");o.id,o.src="https://www.youtube.com/iframe_api";const E=document.getElementsByTagName("script")[0];(i=E.parentNode)==null||i.insertBefore(o,E)}e(this,u)?q(this,X,ue).call(this):z.__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,H=new WeakMap,I=new WeakMap,K=new WeakMap,W=new WeakMap,re=new WeakMap,ne=new WeakMap,ae=new WeakMap,X=new WeakSet,ue=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,u).loadVideoByUrl(this.currentURL):e(this,u).loadVideoById(this.currentURL)),e(this,I)?e(this,u).playVideo():e(this,u).stopVideo(),r(this,I,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},z.__apiReady=!1;let Z=z;customElements.get("e-youtube")||customElements.define("e-youtube",Z);exports.IFrameElement=be;exports.ImageElement=ge;exports.SequenceElement=ve;exports.SourceElement=$;exports.VideoElement=Se;exports.YouTubeElement=Z;
5
+ `,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(h=>{if(h.name!=="srcset"){const E=h.nodeValue||"",A=ye.kebabToCamel(h.name);A in e(this,o)&&(e(this,o)[A]=E||!0)}}),this.appendChild(e(this,o)),r(this,d,new we.SourceManager({srcset:t,sourceSetOptions:e(this,N)})),r(this,f,this.hasAttribute("lazy")),e(this,d).subscribe(h=>{(!e(this,f)||e(this,f)&&e(this,S))&&q(this,O,Q).call(this,h.current)}),e(this,d).connect(),e(this,B).observe(this)}disconnectedCallback(){var t;clearTimeout(e(this,U)),e(this,B).disconnect(),(t=e(this,d))==null||t.close(),e(this,o)&&(e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,o).remove()),r(this,y,!1),r(this,S,!1),e(this,c).reset()}}d=new WeakMap,o=new WeakMap,y=new WeakMap,S=new WeakMap,f=new WeakMap,Y=new WeakMap,k=new WeakMap,c=new WeakMap,B=new WeakMap,U=new WeakMap,L=new WeakMap,N=new WeakMap,O=new WeakSet,Q=function(t){if(clearTimeout(e(this,U)),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,c).set("loaded",!1),e(this,c).set("error",!1),e(this,c).set("loading",!1),e(this,c).set("clear",!1),t){r(this,k,`${e(this,Y)}-${t.url}`);const i=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0),r(this,L,i?t.url:t.name+t.extension),this.consumeSource(e(this,L)),!e(this,f)&&!e(this,y)&&he.loading.add(e(this,k)),e(this,o).onloadeddata=()=>{e(this,j).call(this)},e(this,o).onload=()=>{e(this,j).call(this)},e(this,o).onerror=()=>{e(this,te).call(this,e(this,L))}}else r(this,L,null),this.consumeSource(null)},ee=new WeakMap,j=new WeakMap,te=new WeakMap;var b,se,ie;class be extends ${constructor(){super({sourceSetOptions:{mediaBuckets:!1}});s(this,b,null);s(this,se,()=>{var t,i;(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))});s(this,ie,()=>{var t,i;(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("error"))})}createConsumer(){return document.createElement("div")}consumeSource(t){e(this,b)&&(e(this,b).onload=null,e(this,b).onerror=null),this.consumerElement.innerHTML=(t==null?void 0:t.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",r(this,b,this.consumerElement.querySelector("iframe")),e(this,b)&&(e(this,b).onload=e(this,se),e(this,b).onerror=e(this,ie))}}b=new WeakMap,se=new WeakMap,ie=new WeakMap;customElements.get("e-iframe")||customElements.define("e-iframe",be);class ge extends ${createConsumer(){return document.createElement("img")}consumeSource(n){if(n&&this.hasAttribute("webp")&&Re.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",ge);function ke(a){const n=a.match(/\{([\d-]+)\}/);if(n){const t=n[1].split("-");if(t.length===2){const i=parseInt(t[0],10),h=parseInt(t[1],10);return{start:i,end:h}}}return null}var p,P,M,w,C,x,T,D,g,R;class ve extends ${constructor(t){super();s(this,p,[]);s(this,P,new J.CSSProperty(this,"--fit","contain"));s(this,M,new J.CSSProperty(this,"--autoplay",!1));s(this,w,new J.CSSProperty(this,"--offset-x",.5));s(this,C,new J.CSSProperty(this,"--offset-y",.5));s(this,x,null);s(this,T,0);s(this,D,1);s(this,g,()=>{if(e(this,p).length){const t=e(this,p)[0];e(this,P).current==="cover"?r(this,x,pe.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current)):r(this,x,pe.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,w).current,e(this,C).current))}});s(this,R,t=>{if(this.status.isFalse("loaded")||!e(this,x))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const i=e(this,p)[e(this,T)];i&&t.detail.context.drawImage(i,...e(this,x)),e(this,M).current&&r(this,T,(e(this,T)+1)%e(this,p).length)});Ee.isBrowser&&(r(this,D,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,P).subscribe(e(this,g)),e(this,w).subscribe(e(this,g)),e(this,C).subscribe(e(this,g)),this.addEventListener("sourceCapture",i=>{this.consumerElement.addEventListener("canvasRender",e(this,R))}),this.addEventListener("sourceRelease",i=>{this.consumerElement.removeEventListener("canvasRender",e(this,R))}))}setProgress(t){e(this,p).length&&r(this,T,Math.floor((e(this,p).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,M).observe(),e(this,P).observe(),e(this,w).observe(),e(this,C).observe(),fe.elementResizer.subscribe(this,e(this,g))}disconnectedCallback(){super.disconnectedCallback(),e(this,M).unobserve(),e(this,P).unobserve(),e(this,w).unobserve(),e(this,C).unobserve(),r(this,p,[]),fe.elementResizer.unsubscribe(e(this,g)),this.consumerElement.removeEventListener("canvasRender",e(this,R))}createConsumer(){return new Ie.CanvasElement}consumeSource(t){return me(this,null,function*(){var i,h,E,A;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,R));const v=[],m=ke(t);if(m)for(let l=m.start;l<=m.end;l++){const le=t.replace(/\{([^}]+)\}/,l.toString().padStart(e(this,D),"0")),G=new Image;G.src=le,v.push(G)}else{const l=new Image;l.src=t,v.push(l)}try{yield Promise.all(v.map((l,le)=>new Promise((G,Le)=>{l.onload=()=>{G()},l.onerror=Pe=>{Le(`${l.src} Image not found`)}}))),r(this,p,v),e(this,g).call(this),(h=(i=this.consumerElement).onload)==null||h.call(i,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,R))}catch(l){console.error(l),(A=(E=this.consumerElement).onerror)==null||A.call(E,new Event("error"))}}})}}p=new WeakMap,P=new WeakMap,M=new WeakMap,w=new WeakMap,C=new WeakMap,x=new WeakMap,T=new WeakMap,D=new WeakMap,g=new WeakMap,R=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",ve);var _,F;class Se extends ${constructor(){super(...arguments);s(this,_,0);s(this,F,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,_)&&r(this,_,t),V.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,_)}}),this.consumerElement.readyState===4&&ce.ticker.unsubscribe(e(this,F))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{ce.ticker.subscribe(e(this,F)),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(),ce.ticker.unsubscribe(e(this,F)),r(this,_,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}_=new WeakMap,F=new WeakMap;customElements.get("e-video")||customElements.define("e-video",Se);var u,H,I,K,W,re,ne,ae,X,ue;const z=class z extends ${constructor(){super();s(this,X);s(this,u);s(this,H);s(this,I,!1);s(this,K,!1);s(this,W,()=>{r(this,I,e(this,I)||this.hasAttribute("autoplay")&&!this.hasAttribute("capture-autoplay")),r(this,u,new window.YT.Player(e(this,H),{playerVars:{mute:this.hasAttribute("muted")?1:0,controls:this.hasAttribute("controls")?1:0},events:{onReady:e(this,re),onError:e(this,ne),onStateChange:e(this,ae)}}))});s(this,re,()=>{r(this,K,!0),q(this,X,ue).call(this)});s(this,ne,t=>{var i,h;console.error("YouTube: Ошибка при загрузке видео:",this.currentURL,t),(h=(i=this.consumerElement).onerror)==null||h.call(i,new Event("error"))});s(this,ae,()=>{});r(this,H,"yt-"+ye.generateId(10)),z.__apiReady||(window.onYouTubeIframeAPIReady=()=>{z.__apiReady=!0,V.dispatchEvent(window,"youTubeIframeAPIReady")}),this.addEventListener("sourceCapture",()=>{this.hasAttribute("capture-autoplay")&&(e(this,K)?e(this,u).playVideo():r(this,I,!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,H),t}consumeSource(t){var i;if(t){if(!document.getElementById("youtube-script")){const h=document.createElement("script");h.id,h.src="https://www.youtube.com/iframe_api";const E=document.getElementsByTagName("script")[0];(i=E.parentNode)==null||i.insertBefore(h,E)}e(this,u)?q(this,X,ue).call(this):z.__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,H=new WeakMap,I=new WeakMap,K=new WeakMap,W=new WeakMap,re=new WeakMap,ne=new WeakMap,ae=new WeakMap,X=new WeakSet,ue=function(){var t,i;this.currentURL&&(this.currentURL.startsWith("http")?e(this,u).loadVideoByUrl(this.currentURL):e(this,u).loadVideoById(this.currentURL)),e(this,I)?e(this,u).playVideo():e(this,u).stopVideo(),r(this,I,!1),(i=(t=this.consumerElement).onload)==null||i.call(t,new Event("load"))},z.__apiReady=!1;let Z=z;customElements.get("e-youtube")||customElements.define("e-youtube",Z);exports.IFrameElement=be;exports.ImageElement=ge;exports.SequenceElement=ve;exports.SourceElement=$;exports.VideoElement=Se;exports.YouTubeElement=Z;
@@ -3,18 +3,18 @@ var de = (a) => {
3
3
  };
4
4
  var ae = (a, n, t) => n.has(a) || de("Cannot " + t);
5
5
  var e = (a, n, t) => (ae(a, n, "read from private field"), t ? t.call(a) : n.get(a)), s = (a, n, t) => n.has(a) ? de("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, t), r = (a, n, t, i) => (ae(a, n, "write to private field"), i ? i.call(a, t) : n.set(a, t), t), U = (a, n, t) => (ae(a, n, "access private method"), t);
6
- var me = (a, n, t) => new Promise((i, o) => {
6
+ var me = (a, n, t) => new Promise((i, h) => {
7
7
  var y = (m) => {
8
8
  try {
9
9
  v(t.next(m));
10
10
  } catch (l) {
11
- o(l);
11
+ h(l);
12
12
  }
13
13
  }, A = (m) => {
14
14
  try {
15
15
  v(t.throw(m));
16
16
  } catch (l) {
17
- o(l);
17
+ h(l);
18
18
  }
19
19
  }, v = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(y, A);
20
20
  v((t = t.apply(a, n)).next());
@@ -32,13 +32,13 @@ import { c as we, a as Se } from "../canvas-DeZ0SLUJ.js";
32
32
  import { CanvasElement as Ce } from "../canvas/index.js";
33
33
  import { ticker as he } from "../ticker/vanilla/index.js";
34
34
  let Re = 0;
35
- var d, h, E, L, f, q, k, c, _, O, w, N, H, Q, Z, Y, ee;
35
+ var d, o, E, L, f, q, k, c, _, O, w, N, H, Q, Z, Y, ee;
36
36
  class X extends HTMLElement {
37
37
  constructor(t) {
38
38
  super();
39
39
  s(this, H);
40
40
  s(this, d, null);
41
- s(this, h, null);
41
+ s(this, o, null);
42
42
  s(this, E, !1);
43
43
  s(this, L, !1);
44
44
  s(this, f, !1);
@@ -73,7 +73,7 @@ class X extends HTMLElement {
73
73
  ));
74
74
  }
75
75
  get consumerElement() {
76
- return e(this, h);
76
+ return e(this, o);
77
77
  }
78
78
  get sourceManager() {
79
79
  return e(this, d);
@@ -95,38 +95,37 @@ class X extends HTMLElement {
95
95
  }
96
96
  connectedCallback() {
97
97
  r(this, q, `source-consumer-${++Re}`);
98
- const t = this.getAttribute("srcset");
99
- if (!t) return;
100
- const i = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
101
- i && e(this, c).addElement(i), r(this, h, this.createConsumer()), e(this, h).style.cssText = `
98
+ const t = this.getAttribute("srcset") || "", i = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
99
+ i && e(this, c).addElement(i), r(this, o, this.createConsumer()), e(this, o).style.cssText = `
102
100
  display: block;
103
101
  width: 100%;
104
102
  height: 100%;
105
- `, e(this, h).classList.add("source-consumer"), Array.from(this.attributes).forEach((o) => {
106
- if (o.name !== "srcset") {
107
- const y = o.nodeValue || "", A = ge(o.name);
108
- A in e(this, h) && (e(this, h)[A] = y || !0);
103
+ `, e(this, o).classList.add("source-consumer"), Array.from(this.attributes).forEach((h) => {
104
+ if (h.name !== "srcset") {
105
+ const y = h.nodeValue || "", A = ge(h.name);
106
+ A in e(this, o) && (e(this, o)[A] = y || !0);
109
107
  }
110
- }), this.appendChild(e(this, h)), r(this, d, new Ee({
108
+ }), this.appendChild(e(this, o)), r(this, d, new Ee({
111
109
  srcset: t,
112
110
  sourceSetOptions: e(this, N)
113
- })), r(this, f, this.hasAttribute("lazy")), e(this, d).subscribe((o) => {
114
- (!e(this, f) || e(this, f) && e(this, L)) && U(this, H, Q).call(this, o.current);
111
+ })), r(this, f, this.hasAttribute("lazy")), e(this, d).subscribe((h) => {
112
+ (!e(this, f) || e(this, f) && e(this, L)) && U(this, H, Q).call(this, h.current);
115
113
  }), e(this, d).connect(), e(this, _).observe(this);
116
114
  }
117
115
  disconnectedCallback() {
118
- e(this, _).disconnect(), e(this, d).close(), e(this, h).onloadeddata = null, e(this, h).onload = null, e(this, h).onerror = null, r(this, E, !1), r(this, L, !1), e(this, h).remove(), e(this, c).reset(), clearTimeout(e(this, O));
116
+ var t;
117
+ clearTimeout(e(this, O)), e(this, _).disconnect(), (t = e(this, d)) == null || t.close(), e(this, o) && (e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).onerror = null, e(this, o).remove()), r(this, E, !1), r(this, L, !1), e(this, c).reset();
119
118
  }
120
119
  }
121
- d = new WeakMap(), h = new WeakMap(), E = new WeakMap(), L = new WeakMap(), f = new WeakMap(), q = new WeakMap(), k = new WeakMap(), c = new WeakMap(), _ = new WeakMap(), O = new WeakMap(), w = new WeakMap(), N = new WeakMap(), H = new WeakSet(), Q = function(t) {
122
- if (clearTimeout(e(this, O)), e(this, h).onloadeddata = null, e(this, h).onload = null, e(this, h).onerror = null, e(this, c).set("loaded", !1), e(this, c).set("error", !1), e(this, c).set("loading", !1), e(this, c).set("clear", !1), t) {
120
+ d = new WeakMap(), o = new WeakMap(), E = new WeakMap(), L = new WeakMap(), f = new WeakMap(), q = new WeakMap(), k = new WeakMap(), c = new WeakMap(), _ = new WeakMap(), O = new WeakMap(), w = new WeakMap(), N = new WeakMap(), H = new WeakSet(), Q = function(t) {
121
+ if (clearTimeout(e(this, O)), e(this, o).onloadeddata = null, e(this, o).onload = null, e(this, o).onerror = null, e(this, c).set("loaded", !1), e(this, c).set("error", !1), e(this, c).set("loading", !1), e(this, c).set("clear", !1), t) {
123
122
  r(this, k, `${e(this, q)}-${t.url}`);
124
123
  const i = this.hasAttribute("keep-source-parameters");
125
- e(this, c).set("loading", !0), r(this, w, i ? t.url : t.name + t.extension), this.consumeSource(e(this, w)), !e(this, f) && !e(this, E) && oe.add(e(this, k)), e(this, h).onloadeddata = () => {
124
+ e(this, c).set("loading", !0), r(this, w, i ? t.url : t.name + t.extension), this.consumeSource(e(this, w)), !e(this, f) && !e(this, E) && oe.add(e(this, k)), e(this, o).onloadeddata = () => {
126
125
  e(this, Y).call(this);
127
- }, e(this, h).onload = () => {
126
+ }, e(this, o).onload = () => {
128
127
  e(this, Y).call(this);
129
- }, e(this, h).onerror = () => {
128
+ }, e(this, o).onerror = () => {
130
129
  e(this, ee).call(this, e(this, w));
131
130
  };
132
131
  } else
@@ -177,8 +176,8 @@ function ke(a) {
177
176
  if (n) {
178
177
  const t = n[1].split("-");
179
178
  if (t.length === 2) {
180
- const i = parseInt(t[0], 10), o = parseInt(t[1], 10);
181
- return { start: i, end: o };
179
+ const i = parseInt(t[0], 10), h = parseInt(t[1], 10);
180
+ return { start: i, end: h };
182
181
  }
183
182
  }
184
183
  return null;
@@ -257,7 +256,7 @@ class Pe extends X {
257
256
  }
258
257
  consumeSource(t) {
259
258
  return me(this, null, function* () {
260
- var i, o, y, A;
259
+ var i, h, y, A;
261
260
  if (t) {
262
261
  this.consumerElement.removeEventListener(
263
262
  "canvasRender",
@@ -285,7 +284,7 @@ class Pe extends X {
285
284
  ye(`${l.src} Image not found`);
286
285
  };
287
286
  }))
288
- ), r(this, p, v), e(this, g).call(this), (o = (i = this.consumerElement).onload) == null || o.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
287
+ ), r(this, p, v), e(this, g).call(this), (h = (i = this.consumerElement).onload) == null || h.call(i, new Event("load")), this.isLazy || this.consumerElement.addEventListener(
289
288
  "canvasRender",
290
289
  e(this, R)
291
290
  );
@@ -365,8 +364,8 @@ const B = class B extends X {
365
364
  r(this, j, !0), U(this, K, ue).call(this);
366
365
  });
367
366
  s(this, re, (t) => {
368
- var i, o;
369
- console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (o = (i = this.consumerElement).onerror) == null || o.call(i, new Event("error"));
367
+ var i, h;
368
+ console.error("YouTube: Ошибка при загрузке видео:", this.currentURL, t), (h = (i = this.consumerElement).onerror) == null || h.call(i, new Event("error"));
370
369
  });
371
370
  s(this, ne, () => {
372
371
  });
@@ -389,10 +388,10 @@ const B = class B extends X {
389
388
  var i;
390
389
  if (t) {
391
390
  if (!document.getElementById("youtube-script")) {
392
- const o = document.createElement("script");
393
- o.id, o.src = "https://www.youtube.com/iframe_api";
391
+ const h = document.createElement("script");
392
+ h.id, h.src = "https://www.youtube.com/iframe_api";
394
393
  const y = document.getElementsByTagName("script")[0];
395
- (i = y.parentNode) == null || i.insertBefore(o, y);
394
+ (i = y.parentNode) == null || i.insertBefore(h, y);
396
395
  }
397
396
  e(this, u) ? U(this, K, ue).call(this) : B.__apiReady ? e(this, $).call(this) : addEventListener("youTubeIframeAPIReady", e(this, $));
398
397
  } else e(this, u) && e(this, u).stopVideo();
@@ -1,7 +1,6 @@
1
1
  import { SourceManagerSourceSet } from '../../source';
2
2
  import { CanvasElement } from '../../canvas';
3
3
  import { SourceElement } from '../source';
4
-
5
4
  export interface SequenceElementParameters {
6
5
  srcset: SourceManagerSourceSet;
7
6
  pad?: number;
@@ -1,7 +1,6 @@
1
1
  import { SourceManager } from '../../source';
2
2
  import { ClassLinkedStatus } from '../../class-linked-status';
3
3
  import { SourceSetOptions } from '../../source/SourceSet';
4
-
5
4
  export interface SourceEvents {
6
5
  sourceCapture: CustomEvent;
7
6
  sourceRelease: CustomEvent;
@@ -1,5 +1,4 @@
1
1
  import { SourceElement } from '../source';
2
-
3
2
  export interface VideoEvents {
4
3
  videoReadyStateChange: CustomEvent<{
5
4
  readyState: number;
@@ -1,5 +1,4 @@
1
1
  import { SourceElement } from '../source';
2
-
3
2
  export declare class YouTubeElement extends SourceElement<HTMLDivElement> {
4
3
  #private;
5
4
  static __apiReady: boolean;
@@ -1,7 +1,7 @@
1
1
  import { Morph } from './Morph';
2
-
3
2
  export declare class Link {
4
3
  #private;
5
4
  constructor(element: HTMLAnchorElement, morph: Morph);
5
+ get element(): HTMLAnchorElement;
6
6
  destroy(): void;
7
7
  }
@@ -1,6 +1,5 @@
1
1
  import { ChangeHistoryAction } from '../utils';
2
2
  import { Link } from './Link';
3
-
4
3
  export interface MorphParameters {
5
4
  base?: string;
6
5
  waitForHeadToLoad?: boolean;
@@ -11,6 +10,12 @@ export interface MorphNavigationEntry {
11
10
  isCached: boolean;
12
11
  state?: any;
13
12
  }
13
+ export interface MorphElementSwitchEntry {
14
+ element: HTMLElement;
15
+ pathname: string;
16
+ isCached: boolean;
17
+ state?: any;
18
+ }
14
19
  export interface MorphPreprocessorEntry extends MorphNavigationEntry {
15
20
  resolve: () => void;
16
21
  reject: () => void;
@@ -22,6 +27,12 @@ export interface MorphNavigateOptions {
22
27
  historyAction?: ChangeHistoryAction;
23
28
  state?: any;
24
29
  }
30
+ export interface MorphEvents {
31
+ morphBeforeNavigation: CustomEvent<MorphNavigationEntry>;
32
+ morphAfterNavigation: CustomEvent<MorphNavigationEntry>;
33
+ morphBeforeElementOut: CustomEvent<MorphElementSwitchEntry>;
34
+ morphAfterElementOut: CustomEvent<MorphElementSwitchEntry>;
35
+ }
25
36
  export declare class Morph {
26
37
  #private;
27
38
  preprocessor?: MorphPreprocessor;
@@ -37,10 +48,14 @@ export declare class Morph {
37
48
  parameters: string;
38
49
  hash: string;
39
50
  };
40
- beforeNavigationEvent(callback: MorphNavigationCallback): () => void;
41
- afterNavigationEvent(callback: MorphNavigationCallback): () => void;
42
51
  prefetch(path: string): Promise<Document>;
43
52
  navigate(path: string, { historyAction, state }?: MorphNavigateOptions): Promise<void>;
53
+ addLink(element: HTMLAnchorElement): void;
44
54
  addLinks(elements: Array<HTMLAnchorElement>): void;
55
+ removeLink(element: HTMLAnchorElement): void;
45
56
  findLinks(): void;
46
57
  }
58
+ declare global {
59
+ interface DocumentEventMap extends MorphEvents {
60
+ }
61
+ }
@@ -1 +1 @@
1
- "use strict";var at=(s,t)=>(t=Symbol[s])?t:Symbol.for("Symbol."+s),ot=s=>{throw TypeError(s)};var V=(s,t,i)=>t.has(s)||ot("Cannot "+i);var e=(s,t,i)=>(V(s,t,"read from private field"),i?i.call(s):t.get(s)),r=(s,t,i)=>t.has(s)?ot("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),c=(s,t,i,n)=>(V(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),b=(s,t,i)=>(V(s,t,"access private method"),i);var N=(s,t,i)=>new Promise((n,l)=>{var u=m=>{try{g(i.next(m))}catch(w){l(w)}},o=m=>{try{g(i.throw(m))}catch(w){l(w)}},g=m=>m.done?n(m.value):Promise.resolve(m.value).then(u,o);g((i=i.apply(s,t)).next())});var ht=(s,t,i)=>(t=s[at("asyncIterator")])?t.call(s):(s=s[at("iterator")](),t={},i=(n,l)=>(l=s[n])&&(t[n]=u=>new Promise((o,g,m)=>(u=l.call(s,u),m=u.done,Promise.resolve(u.value).then(w=>o({value:w,done:m}),g)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ct=require("../notifier/index.cjs"),gt=require("../browser-CpzFX2xg.cjs"),K=require("../url-BiHPIsKq.cjs"),lt=require("../loading/index.cjs");var A,h,f,T,S,M,C,k;class ut{constructor(t,i){r(this,A);r(this,h);r(this,f);r(this,T);r(this,S);r(this,M);r(this,C,t=>{t.preventDefault(),e(this,A).links.forEach(i=>{var n;e(this,f)===e(i,f)||(n=e(i,M))!=null&&n.includes(e(this,f))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,A).navigate(e(this,f),{historyAction:e(this,T),state:e(this,S)})});r(this,k,()=>{e(this,A).prefetch(e(this,f)),e(this,h).removeEventListener("pointerenter",e(this,k))});var u,o;c(this,A,i),c(this,h,t),c(this,f,e(this,h).getAttribute("href")||"/"),c(this,T,e(this,h).getAttribute("data-history-action")||"push"),c(this,S,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,C));const n=i.normalizePath(e(this,f)),l=i.normalizePath(location.pathname);c(this,M,(u=e(this,h).getAttribute("data-match-paths"))==null?void 0:u.split(",").map(g=>i.normalizePath(g.trim()).pathname)),e(this,h).hasAttribute("data-include")?l.pathname.includes(n.pathname)&&e(this,h).classList.add("current"):n.pathname===l.pathname||(o=e(this,M))!=null&&o.includes(l.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,k))}destroy(){e(this,h).removeEventListener("click",e(this,C)),e(this,h).removeEventListener("pointerenter",e(this,k)),e(this,h).classList.remove("current")}}A=new WeakMap,h=new WeakMap,f=new WeakMap,T=new WeakMap,S=new WeakMap,M=new WeakMap,C=new WeakMap,k=new WeakMap;var z,q,x,_,y,Y,P,L,p,D,R,F,I,d,X,Z,dt,$,G;class Et{constructor(t){r(this,d);r(this,z,null);r(this,q,null);r(this,x,null);r(this,_,null);r(this,y,[]);r(this,Y,new DOMParser);r(this,P,new Map);r(this,L);r(this,p,null);r(this,D);r(this,R);r(this,F,new ct.Notifier);r(this,I,new ct.Notifier);r(this,G,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(gt.isBrowser){c(this,z,K.normalizeBase(t==null?void 0:t.base)),c(this,q,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,x,(t==null?void 0:t.cachePages)!==!1),c(this,_,b(this,d,Z).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,p,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,p)),document.documentElement.setAttribute("data-current-leaf",i.leaf),this.findLinks(),addEventListener("popstate",e(this,G)),K.changeHistory("replace",e(this,p),i.parameters,i.hash)}}get currentPathname(){return e(this,p)}get previousPathname(){return e(this,D)}get currentState(){return e(this,R)}get links(){return e(this,y)}normalizePath(t){return K.splitPath(t,e(this,z))}beforeNavigationEvent(t){return e(this,F).subscribe(t)}afterNavigationEvent(t){return e(this,I).subscribe(t)}prefetch(t){return N(this,null,function*(){const i=this.normalizePath(t);return b(this,d,X).call(this,i.pathname)})}navigate(l){return N(this,arguments,function*(t,{historyAction:i="push",state:n}={}){var tt;const u=this.normalizePath(t);let{pathname:o,hash:g,parameters:m,leaf:w}=u;if(e(this,L)===o||e(this,p)===o)return;c(this,R,n),c(this,L,o);const O=e(this,P).has(o);try{lt.loading.add("__morph");let B=!0;if(e(this,F).notify({pathname:o,isCached:O,state:n}),this.preprocessor)try{yield new Promise((a,E)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:o,resolve:a,reject:E,isCached:O,state:n})})}catch(a){a?console.error(a):console.log("Route change canceled"),B=!1}if(!B||e(this,L)!==o)return;const et=e(this,P).get(o)||(yield b(this,d,X).call(this,o));if(e(this,L)!==o)return;const it=Array.from(document.head.children),st=Array.from(et.head.cloneNode(!0).children),nt=b(this,d,dt).call(this,it,st),mt=b(this,d,$).call(this,it,nt),W=b(this,d,$).call(this,st,nt);W.forEach((a,E)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=a.getAttribute("src"),W[E]=v}}),W.forEach(a=>{document.head.appendChild(a)});const J=W.filter(a=>(a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK")&&a.getAttribute("rel")!=="canonical");e(this,q)&&J.length&&(yield new Promise(a=>N(this,null,function*(){let E=0;try{for(var v=ht(J),pt,Q,j;pt=!(Q=yield v.next()).done;pt=!1){const H=Q.value;H.onload=()=>{E++,E===J.length&&a()}}}catch(Q){j=[Q]}finally{try{pt&&(Q=v.return)&&(yield Q.call(v))}finally{if(j)throw j[0]}}}))),mt.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),c(this,D,e(this,p)),c(this,p,o),K.changeHistory(i,o,m,g);const ft=b(this,d,Z).call(this,et.body.cloneNode(!0));e(this,_).forEach((a,E)=>{const v=ft[E];let pt=[...a.childNodes],Q=[...v.childNodes];pt.forEach(j=>{if(j instanceof HTMLElement){const H=j.getAttribute("data-remain");let rt;Q=Q.filter(U=>U instanceof HTMLElement&&H&&U.getAttribute("data-remain")===H?(rt=U,!1):!0),H&&rt||j.remove()}else j.remove()}),a.append(...Q)}),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",o),document.documentElement.setAttribute("data-current-leaf",w),(tt=this.postprocessor)==null||tt.call(this,{pathname:o,isCached:O,state:n}),e(this,I).notify({pathname:o,isCached:O,state:n}),lt.loading.complete("__morph")}catch(B){console.error(B)}c(this,L,void 0)})}addLinks(t){t.forEach(i=>{e(this,y).push(new ut(i,this))})}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var n;return((n=i.getAttribute("href"))==null?void 0:n.startsWith("/"))&&!i.hasAttribute("download")&&!i.hasAttribute("data-morph-skip")});e(this,y).forEach(i=>i.destroy()),c(this,y,t.map(i=>new ut(i,this)))}}z=new WeakMap,q=new WeakMap,x=new WeakMap,_=new WeakMap,y=new WeakMap,Y=new WeakMap,P=new WeakMap,L=new WeakMap,p=new WeakMap,D=new WeakMap,R=new WeakMap,F=new WeakMap,I=new WeakMap,d=new WeakSet,X=function(t){return N(this,null,function*(){const i=e(this,P).get(t);if(i)return i;const l=yield(yield fetch(t)).text(),u=e(this,Y).parseFromString(l,"text/html");return e(this,x)&&e(this,P).set(t,u),u})},Z=function(t){return[...t.querySelectorAll("[data-morph]")]},dt=function(t,i){return t.filter(n=>i.find(l=>l.outerHTML===n.outerHTML))},$=function(t,i){return t.filter(n=>!i.find(l=>l.outerHTML===n.outerHTML))},G=new WeakMap;exports.Morph=Et;
1
+ "use strict";var ot=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),ht=n=>{throw TypeError(n)};var Q=(n,t,i)=>t.has(n)||ht("Cannot "+i);var e=(n,t,i)=>(Q(n,t,"read from private field"),i?i.call(n):t.get(n)),o=(n,t,i)=>t.has(n)?ht("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,i),c=(n,t,i,s)=>(Q(n,t,"write to private field"),s?s.call(n,i):t.set(n,i),i),A=(n,t,i)=>(Q(n,t,"access private method"),i);var z=(n,t,i)=>new Promise((s,l)=>{var u=f=>{try{g(i.next(f))}catch(b){l(b)}},a=f=>{try{g(i.throw(f))}catch(b){l(b)}},g=f=>f.done?s(f.value):Promise.resolve(f.value).then(u,a);g((i=i.apply(n,t)).next())});var ct=(n,t,i)=>(t=n[ot("asyncIterator")])?t.call(n):(n=n[ot("iterator")](),t={},i=(s,l)=>(l=n[s])&&(t[s]=u=>new Promise((a,g,f)=>(u=l.call(n,u),f=u.done,Promise.resolve(u.value).then(b=>a({value:b,done:f}),g)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pt=require("../browser-CpzFX2xg.cjs"),K=require("../events-KVanG9sR.cjs"),V=require("../url-BiHPIsKq.cjs"),dt=require("../loading/index.cjs");var T,h,p,q,x,H,D,k;class lt{constructor(t,i){o(this,T);o(this,h);o(this,p);o(this,q);o(this,x);o(this,H);o(this,D,t=>{t.preventDefault(),e(this,T).links.forEach(i=>{var s;e(this,p)===e(i,p)||(s=e(i,H))!=null&&s.includes(e(this,p))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,T).navigate(e(this,p),{historyAction:e(this,q),state:e(this,x)})});o(this,k,()=>{e(this,T).prefetch(e(this,p)),e(this,h).removeEventListener("pointerenter",e(this,k))});var u,a;c(this,T,i),c(this,h,t),c(this,p,e(this,h).getAttribute("href")||"/"),c(this,q,e(this,h).getAttribute("data-history-action")||"push"),c(this,x,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,D));const s=i.normalizePath(e(this,p)),l=i.normalizePath(location.pathname);c(this,H,(u=e(this,h).getAttribute("data-match-paths"))==null?void 0:u.split(",").map(g=>i.normalizePath(g.trim()).pathname)),e(this,h).hasAttribute("data-include")?l.pathname.includes(s.pathname)&&e(this,h).classList.add("current"):s.pathname===l.pathname||(a=e(this,H))!=null&&a.includes(l.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,k))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,D)),e(this,h).removeEventListener("pointerenter",e(this,k)),e(this,h).classList.remove("current")}}T=new WeakMap,h=new WeakMap,p=new WeakMap,q=new WeakMap,x=new WeakMap,H=new WeakMap,D=new WeakMap,k=new WeakMap;var I,O,R,S,E,Y,M,P,L,_,B,v,m,U,X,ut,Z,G;class Lt{constructor(t){o(this,m);o(this,I,null);o(this,O,null);o(this,R,null);o(this,S,null);o(this,E,[]);o(this,Y,new DOMParser);o(this,M,new Map);o(this,P);o(this,L,null);o(this,_);o(this,B);o(this,v,[]);o(this,G,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(pt.isBrowser){c(this,I,V.normalizeBase(t==null?void 0:t.base)),c(this,O,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,R,(t==null?void 0:t.cachePages)!==!1),c(this,S,A(this,m,X).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,L,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,L)),document.documentElement.setAttribute("data-current-leaf",i.leaf),this.findLinks(),addEventListener("popstate",e(this,G)),V.changeHistory("replace",e(this,L),i.parameters,i.hash),e(this,S).map(s=>[...s.children]).flat().forEach(s=>{s instanceof HTMLElement&&s.classList.add("current")})}}get currentPathname(){return e(this,L)}get previousPathname(){return e(this,_)}get currentState(){return e(this,B)}get links(){return e(this,E)}normalizePath(t){return V.splitPath(t,e(this,I))}prefetch(t){return z(this,null,function*(){const i=this.normalizePath(t);return A(this,m,U).call(this,i.pathname)})}navigate(l){return z(this,arguments,function*(t,{historyAction:i="push",state:s}={}){var $;if(e(this,v).length)return;const u=this.normalizePath(t);let{pathname:a,hash:g,parameters:f,leaf:b}=u;if(e(this,P)===a||e(this,L)===a)return;c(this,B,s),c(this,P,a);const N=e(this,M).has(a);try{dt.loading.add("__morph");let F=!0;if(K.dispatchEvent(document,"morphBeforeNavigation",{detail:{pathname:a,isCached:N,state:s}}),this.preprocessor)try{yield new Promise((r,w)=>{var y;(y=this.preprocessor)==null||y.call(this,{pathname:a,resolve:r,reject:w,isCached:N,state:s})})}catch(r){r?console.error(r):console.log("Route change canceled"),F=!1}if(!F||e(this,P)!==a)return;const tt=e(this,M).get(a)||(yield A(this,m,U).call(this,a));if(e(this,P)!==a)return;const et=Array.from(document.head.children),it=Array.from(tt.head.cloneNode(!0).children),st=A(this,m,ut).call(this,et,it),mt=A(this,m,Z).call(this,et,st),W=A(this,m,Z).call(this,it,st);W.forEach((r,w)=>{if(r.tagName==="SCRIPT"&&r.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=r.getAttribute("src"),W[w]=y}}),W.forEach(r=>{document.head.appendChild(r)});const J=W.filter(r=>(r.tagName==="STYLE"||r.tagName==="SCRIPT"||r.tagName==="LINK")&&r.getAttribute("rel")!=="canonical");e(this,O)&&J.length&&(yield new Promise(r=>z(this,null,function*(){let w=0;try{for(var y=ct(J),nt,C,rt;nt=!(C=yield y.next()).done;nt=!1){const j=C.value;j.onload=()=>{w++,w===J.length&&r()}}}catch(C){rt=[C]}finally{try{nt&&(C=y.return)&&(yield C.call(y))}finally{if(rt)throw rt[0]}}}))),mt.forEach(r=>{r.hasAttribute("data-permanent")||r.remove()}),c(this,_,e(this,L)),c(this,L,a),V.changeHistory(i,a,f,g);const ft=A(this,m,X).call(this,tt.body.cloneNode(!0));e(this,v).forEach(r=>clearTimeout(r)),c(this,v,[]),e(this,S).forEach((r,w)=>{const y=ft[w],nt=getComputedStyle(r).getPropertyValue("--morph-duration"),C=[...y.childNodes];if(nt){const rt=[...r.childNodes];rt.forEach(d=>{d instanceof HTMLElement&&d.classList.add("old")}),C.forEach(d=>{d instanceof HTMLElement&&d.classList.add("new")}),r.append(...C),setTimeout(()=>{C.forEach(d=>{d instanceof HTMLElement&&d.classList.add("in")})},10);const j={element:r,pathname:a,isCached:N,state:s};K.dispatchEvent(document,"morphBeforeElementOut",{detail:j});const at=setTimeout(()=>{rt.forEach(d=>d.remove()),C.forEach(d=>{d instanceof HTMLElement&&(d.classList.remove("new","in"),d.classList.add("current"))}),K.dispatchEvent(document,"morphAfterElementOut",{detail:j}),c(this,v,e(this,v).filter(d=>d!==at))},(parseFloat(nt)||0)*1e3+10);e(this,v).push(at)}else r.innerHTML="",r.append(...C)}),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",a),document.documentElement.setAttribute("data-current-leaf",b),($=this.postprocessor)==null||$.call(this,{pathname:a,isCached:N,state:s}),K.dispatchEvent(document,"morphAfterNavigation",{detail:{pathname:a,isCached:N,state:s}}),dt.loading.complete("__morph")}catch(F){console.error(F)}c(this,P,void 0)})}addLink(t){e(this,E).push(new lt(t,this))}addLinks(t){t.forEach(i=>{this.addLink(i)})}removeLink(t){c(this,E,e(this,E).filter(i=>i.element===t?(i.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var s;return((s=i.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!i.hasAttribute("download")&&!i.hasAttribute("data-morph-skip")});e(this,E).forEach(i=>i.destroy()),c(this,E,t.map(i=>new lt(i,this)))}}I=new WeakMap,O=new WeakMap,R=new WeakMap,S=new WeakMap,E=new WeakMap,Y=new WeakMap,M=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,B=new WeakMap,v=new WeakMap,m=new WeakSet,U=function(t){return z(this,null,function*(){const i=e(this,M).get(t);if(i)return i;const l=yield(yield fetch(t)).text(),u=e(this,Y).parseFromString(l,"text/html");return e(this,R)&&e(this,M).set(t,u),u})},X=function(t){const i=[...t.querySelectorAll("[data-morph]")];return i.length?i:[t]},ut=function(t,i){return t.filter(s=>i.find(l=>l.outerHTML===s.outerHTML))},Z=function(t,i){return t.filter(s=>!i.find(l=>l.outerHTML===s.outerHTML))},G=new WeakMap;exports.Morph=Lt;