aptechka 0.75.0 → 0.76.1

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 (42) hide show
  1. package/lib/SourceElement-DE6khDs3.cjs +5 -0
  2. package/lib/{SourceElement-Cvtgjo07.js → SourceElement-DJxX7uN5.js} +91 -92
  3. package/lib/element-linked-store/index.cjs +1 -1
  4. package/lib/element-linked-store/index.js +38 -29
  5. package/lib/en3/{en3.d.ts → En3.d.ts} +1 -5
  6. package/lib/en3/En3View.d.ts +2 -1
  7. package/lib/en3/index.cjs +2 -2
  8. package/lib/en3/index.d.ts +1 -1
  9. package/lib/en3/index.js +144 -253
  10. package/lib/en3/utils/getCurrentViewport.d.ts +2 -1
  11. package/lib/iframe/index.cjs +1 -1
  12. package/lib/iframe/index.js +1 -1
  13. package/lib/image/index.cjs +1 -1
  14. package/lib/image/index.js +1 -1
  15. package/lib/{layout-DpZo-I0y.js → layout-BSMtwCga.js} +2 -2
  16. package/lib/layout-box/index.js +1 -1
  17. package/lib/morph/index.js +1 -1
  18. package/lib/scroll/{ScrollbarElement.d.ts → ScrollScrollbarElement.d.ts} +2 -2
  19. package/lib/scroll/index.cjs +1 -1
  20. package/lib/scroll/index.d.ts +1 -1
  21. package/lib/scroll/index.js +4 -4
  22. package/lib/{scroll-DPkCFTxg.js → scroll-DNGJVxa2.js} +1 -1
  23. package/lib/scroll-kit/ScrollRegionElement.d.ts +38 -0
  24. package/lib/{custom-scrollbar/index.d.ts → scroll-kit/ScrollbarElement.d.ts} +2 -2
  25. package/lib/scroll-kit/SmoothScrollElement.d.ts +16 -0
  26. package/lib/scroll-kit/index.cjs +1 -0
  27. package/lib/scroll-kit/index.d.ts +3 -0
  28. package/lib/scroll-kit/index.js +382 -0
  29. package/lib/sequence/index.cjs +1 -1
  30. package/lib/sequence/index.js +1 -1
  31. package/lib/source/index.cjs +1 -1
  32. package/lib/source/index.js +1 -1
  33. package/lib/utils/index.js +2 -2
  34. package/lib/video/index.cjs +1 -1
  35. package/lib/video/index.js +1 -1
  36. package/lib/youtube/index.cjs +1 -1
  37. package/lib/youtube/index.js +1 -1
  38. package/package.json +9 -9
  39. package/lib/SourceElement-0vRhCW3O.cjs +0 -5
  40. package/lib/custom-scrollbar/index.cjs +0 -1
  41. package/lib/custom-scrollbar/index.js +0 -100
  42. package/lib/en3/En3Raycaster.d.ts +0 -20
@@ -0,0 +1,5 @@
1
+ "use strict";var Y=c=>{throw TypeError(c)};var Z=(c,n,e)=>n.has(c)||Y("Cannot "+e);var t=(c,n,e)=>(Z(c,n,"read from private field"),e?e.call(c):n.get(c)),i=(c,n,e)=>n.has(c)?Y("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,e),s=(c,n,e,a)=>(Z(c,n,"write to private field"),a?a.call(c,e):n.set(c,e),e),F=(c,n,e)=>(Z(c,n,"access private method"),e);const it=require("./element-linked-store/index.cjs"),rt=require("./index-DekP7OZe.cjs"),w=require("./events-KVanG9sR.cjs"),nt=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");const J=require("./loading/index.cjs"),at=require("./order/index.cjs"),tt=require("./window-resizer/index.cjs"),ht=require("./Store-Cd1GlEmZ.cjs");var V,b,C,S,d,p,M;class et{constructor(n){i(this,V);i(this,b);i(this,C);i(this,S);i(this,d);i(this,p);i(this,M);s(this,V,n);let e=n.split(".");const a=/\b\d{1,2}x\b/g,h=e.find(y=>y.match(a)&&parseInt(y));s(this,C,h?parseInt(h):1),h&&(e=e.slice(0,-1)),s(this,b,e.length>1?e.slice(0,-1).join("."):e.join("."));const l=/\d+max/g,m=/\d+min/g,N=/\d+mar/g,U=/\d+mir/g,W=e.find(y=>y.match(l)),u=e.find(y=>y.match(m)),x=e.find(y=>y.match(N)),X=e.find(y=>y.match(U));x?(s(this,d,parseInt(x)),s(this,p,"max"),s(this,S,`(max-aspect-ratio: ${t(this,d)})`)):X?(s(this,d,parseInt(X)),s(this,p,"max"),s(this,S,`(min-aspect-ratio: ${t(this,d)})`)):W?(s(this,d,parseInt(W)),s(this,p,"max"),s(this,S,`(max-width: ${t(this,d)}px)`)):u?(s(this,d,parseInt(u)),s(this,S,`(min-width: ${t(this,d)}px)`),s(this,p,"min")):(s(this,d,0),s(this,S,`(min-width: ${t(this,d)}px)`),s(this,p,"min")),s(this,b,t(this,b).replace(`.${t(this,d)}${t(this,p)}`,"")),s(this,M,e[e.length-1]===t(this,b)?"":"."+e[e.length-1]),s(this,M,t(this,M).replace(`.${t(this,d)}${t(this,p)}`,""))}get url(){return t(this,V)}get name(){return t(this,b)}get density(){return t(this,C)}get query(){return t(this,S)}get extension(){return t(this,M)}get queryType(){return t(this,p)}get queryValue(){return t(this,d)}}V=new WeakMap,b=new WeakMap,C=new WeakMap,S=new WeakMap,d=new WeakMap,p=new WeakMap,M=new WeakMap;var q;class Q{constructor(n,e){i(this,q);s(this,q,new Map);const a=(e==null?void 0:e.mediaBuckets)!==!1,h=typeof n=="string"?a?n.trim().split(",").map(u=>u.trim()).filter(u=>!!u):[n]:n,l=[];h.forEach(u=>{const x=new et(u);l.push([x.query,x])});const m=l.filter(u=>u[1].queryType.includes("max")).sort((u,x)=>x[1].queryValue-u[1].queryValue),N=l.filter(u=>u[1].queryType.includes("min")&&u[1].queryValue!==0).sort((u,x)=>u[1].queryValue-x[1].queryValue),U=l.filter(u=>u[0]==="(min-width: 0px)");(U?[...U,...m,...N]:[...m,...N]).forEach(u=>{t(this,q).has(u[0])||t(this,q).set(u[0],[]),t(this,q).get(u[0]).push(u[1])})}get mediaBuckets(){return t(this,q)}}q=new WeakMap;var I,$;class st extends ht.Store{constructor(e){super(void 0);i(this,I);i(this,$,()=>{let e;t(this,I).mediaBuckets.forEach((l,m)=>{matchMedia(m).matches&&(e=l)});let a,h=0;e==null||e.forEach(l=>{l.density>h&&l.density<=Math.max(devicePixelRatio,1)&&(h=l.density,a=l)}),e!=null&&e.length&&!a&&(a=e[0]),this.current=a});s(this,I,new Q(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,I,new Q(e.srcset,e.sourceSetOptions)),t(this,$).call(this)}close(){super.close(),this.disconnect()}connect(){tt.windowResizer.subscribe(t(this,$),at.RESIZE_ORDER.SOURCE_MANAGER),t(this,$).call(this)}disconnect(){tt.windowResizer.unsubscribe(t(this,$))}}I=new WeakMap,$=new WeakMap;function ot(c){if(isNaN(c))return"0:00";const n=Math.floor(Math.max(0,c)),e=Math.floor(n/3600),a=Math.floor(n%3600/60),l=(n%60).toString().padStart(2,"0");if(e>0){const m=a.toString().padStart(2,"0");return`${e}:${m}:${l}`}else return`${a}:${l}`}let ct=0;var f,r,R,E,L,g,B,A,o,k,O,v,P,T,j,G,_,K,D,H,z;class ut extends HTMLElement{constructor(e){super();i(this,T);i(this,f,null);i(this,r,null);i(this,R,this);i(this,E,!1);i(this,L,!1);i(this,g,!1);i(this,B,"");i(this,A,"");i(this,o,new it.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1,playing:!1,metadata:!1}));i(this,k,null);i(this,O);i(this,v,null);i(this,P);i(this,G,e=>{const a=e[0];t(this,g)&&(!t(this,L)||this.hasAttribute("reload-source"))&&a.isIntersecting&&this.triggerLazyLoad(),a.isIntersecting?w.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(F(this,T,j).call(this,void 0),s(this,L,!1)),w.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,_,()=>{t(this,o).set("loaded",!0),t(this,o).set("error",!1),t(this,o).set("loading",!1),!t(this,g)&&!t(this,E)&&J.loading.complete(t(this,A)),w.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,O,setTimeout(()=>{t(this,o).set("clear",!0)},parseFloat(e)*1e3)):t(this,o).set("clear",!0),s(this,E,!0)});i(this,K,e=>{t(this,o).set("loaded",!1),t(this,o).set("error",!0),t(this,o).set("loading",!1),!t(this,g)&&!t(this,E)&&J.loading.error(t(this,A)),w.dispatchEvent(this,"sourceError",{custom:!0}),s(this,E,!0)});i(this,D,()=>{t(this,o).set("playing",!0),w.dispatchEvent(this,"sourcePlay",{custom:!0})});i(this,H,()=>{t(this,o).set("playing",!1),w.dispatchEvent(this,"sourcePause",{custom:!0})});i(this,z,()=>{const e=t(this,r);(e.tagName==="VIDEO"||e.tagName==="AUDIO")&&e.readyState>=1&&(t(this,o).set("metadata",!0),w.dispatchEvent(this,"sourceMetadataLoaded",{custom:!0}),this.querySelectorAll("[data-source-duration]").forEach(a=>{a.textContent=ot(e.duration)}))});s(this,P,e==null?void 0:e.sourceSetOptions),rt.isBrowser&&window.IntersectionObserver&&s(this,k,new IntersectionObserver(t(this,G))),t(this,o).subscribe(a=>{var l;const h=(l=this.getAttribute("data-global-play-class"))==null?void 0:l.split(",");h!=null&&h.length&&(a.current.playing?h.forEach(m=>{document.documentElement.classList.add(m.trim())}):h.forEach(m=>{document.documentElement.classList.remove(m.trim())}))})}get consumerElement(){return t(this,r)}get consumerHolderElement(){return t(this,R)}get sourceManager(){return t(this,f)}get status(){return t(this,o)}get isLazy(){return t(this,g)}get currentURL(){return t(this,v)}get isFirstLoadHappened(){return t(this,E)}triggerLazyLoad(){!t(this,L)&&t(this,f).current&&t(this,f).current!==t(this,f).previous&&(s(this,L,!0),F(this,T,j).call(this,t(this,f).current))}connectedCallback(){s(this,B,`source-consumer-${++ct}`);const e=this.getAttribute("srcset")||"",a=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;a&&t(this,o).addElement(a),s(this,R,this.querySelector("[data-consumer-holder]")||this),this.querySelectorAll(".source-consumer").forEach(h=>h==null?void 0:h.remove()),s(this,r,this.createConsumer()),t(this,r).style.cssText=`
2
+ display: block;
3
+ width: 100%;
4
+ height: 100%;
5
+ `,t(this,r).classList.add("source-consumer"),t(this,r).addEventListener("play",t(this,D)),t(this,r).addEventListener("pause",t(this,H)),t(this,r).addEventListener("loadedmetadata",t(this,z)),t(this,z).call(this),Array.from(this.attributes).forEach(h=>{if(h.name!=="srcset"){const l=h.nodeValue||"",m=nt.kebabToCamel(h.name);m in t(this,r)&&(t(this,r)[m]=l||!0)}}),t(this,R).appendChild(t(this,r)),s(this,f,new st({srcset:e,sourceSetOptions:t(this,P)})),s(this,g,this.hasAttribute("lazy")),t(this,f).subscribe(h=>{(!t(this,g)||t(this,g)&&t(this,L))&&F(this,T,j).call(this,h.current)}),t(this,f).connect(),t(this,k).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,O)),t(this,k).disconnect(),(e=t(this,f))==null||e.close(),t(this,r)&&(this.consumeSource(null),t(this,r).removeEventListener("play",t(this,D)),t(this,r).removeEventListener("pause",t(this,H)),t(this,r).removeEventListener("loadedmetadata",t(this,z)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,r).onerror=null,t(this,r).remove()),s(this,E,!1),s(this,L,!1),t(this,o).reset()}}f=new WeakMap,r=new WeakMap,R=new WeakMap,E=new WeakMap,L=new WeakMap,g=new WeakMap,B=new WeakMap,A=new WeakMap,o=new WeakMap,k=new WeakMap,O=new WeakMap,v=new WeakMap,P=new WeakMap,T=new WeakSet,j=function(e){if(clearTimeout(t(this,O)),t(this,r).onloadeddata=null,t(this,r).onload=null,t(this,r).onerror=null,t(this,o).set("loaded",!1),t(this,o).set("error",!1),t(this,o).set("loading",!1),t(this,o).set("clear",!1),t(this,o).set("playing",!1),t(this,o).set("metadata",!1),e){s(this,A,`${t(this,B)}-${e.url}`);const a=this.hasAttribute("keep-source-parameters");t(this,o).set("loading",!0),s(this,v,a?e.url:e.name+e.extension),this.consumeSource(t(this,v)),!t(this,g)&&!t(this,E)&&J.loading.add(t(this,A)),t(this,r).onloadeddata=()=>{t(this,_).call(this)},t(this,r).onload=()=>{t(this,_).call(this)},t(this,r).onerror=()=>{t(this,K).call(this,t(this,v))}}else s(this,v,null),this.consumeSource(null)},G=new WeakMap,_=new WeakMap,K=new WeakMap,D=new WeakMap,H=new WeakMap,z=new WeakMap;exports.Source=et;exports.SourceElement=ut;exports.SourceManager=st;exports.SourceSet=Q;
@@ -1,54 +1,54 @@
1
- var X = (l) => {
2
- throw TypeError(l);
1
+ var X = (c) => {
2
+ throw TypeError(c);
3
3
  };
4
- var Z = (l, a, e) => a.has(l) || X("Cannot " + e);
5
- var t = (l, a, e) => (Z(l, a, "read from private field"), e ? e.call(l) : a.get(l)), i = (l, a, e) => a.has(l) ? X("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(l) : a.set(l, e), s = (l, a, e, n) => (Z(l, a, "write to private field"), n ? n.call(l, e) : a.set(l, e), e), j = (l, a, e) => (Z(l, a, "access private method"), e);
4
+ var Z = (c, a, e) => a.has(c) || X("Cannot " + e);
5
+ var t = (c, a, e) => (Z(c, a, "read from private field"), e ? e.call(c) : a.get(c)), i = (c, a, e) => a.has(c) ? X("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(c) : a.set(c, e), s = (c, a, e, n) => (Z(c, a, "write to private field"), n ? n.call(c, e) : a.set(c, e), e), j = (c, a, e) => (Z(c, a, "access private method"), e);
6
6
  import { ElementLinkedStore as et } from "./element-linked-store/index.js";
7
7
  import { i as st } from "./index-Bv9zgfdb.js";
8
- import { d as q } from "./events-CsVF98U6.js";
8
+ import { d as w } from "./events-CsVF98U6.js";
9
9
  import { k as it } from "./string-BlMQbe8b.js";
10
10
  import "construct-style-sheets-polyfill";
11
11
  import { loading as J } from "./loading/index.js";
12
12
  import { RESIZE_ORDER as rt } from "./order/index.js";
13
13
  import { windowResizer as Y } from "./window-resizer/index.js";
14
14
  import { S as at } from "./Store-0BVty6AZ.js";
15
- var z, S, B, L, d, p, $;
15
+ var C, S, z, L, d, p, q;
16
16
  class nt {
17
17
  constructor(a) {
18
- i(this, z);
18
+ i(this, C);
19
19
  i(this, S);
20
- i(this, B);
20
+ i(this, z);
21
21
  i(this, L);
22
22
  i(this, d);
23
23
  i(this, p);
24
- i(this, $);
25
- s(this, z, a);
24
+ i(this, q);
25
+ s(this, C, a);
26
26
  let e = a.split(".");
27
- const n = /\b\d{1,2}x\b/g, u = e.find((y) => y.match(n) && parseInt(y));
28
- s(this, B, u ? parseInt(u) : 1), u && (e = e.slice(0, -1)), s(this, S, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
29
- const h = /\d+max/g, m = /\d+min/g, w = /\d+mar/g, F = /\d+mir/g, W = e.find((y) => y.match(h)), c = e.find((y) => y.match(m)), x = e.find((y) => y.match(w)), Q = e.find((y) => y.match(F));
30
- x ? (s(this, d, parseInt(x)), s(this, p, "max"), s(this, L, `(max-aspect-ratio: ${t(this, d)})`)) : Q ? (s(this, d, parseInt(Q)), s(this, p, "max"), s(this, L, `(min-aspect-ratio: ${t(this, d)})`)) : W ? (s(this, d, parseInt(W)), s(this, p, "max"), s(this, L, `(max-width: ${t(this, d)}px)`)) : c ? (s(this, d, parseInt(c)), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")) : (s(this, d, 0), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")), s(this, S, t(this, S).replace(
27
+ const n = /\b\d{1,2}x\b/g, h = e.find((y) => y.match(n) && parseInt(y));
28
+ s(this, z, h ? parseInt(h) : 1), h && (e = e.slice(0, -1)), s(this, S, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
29
+ const u = /\d+max/g, m = /\d+min/g, U = /\d+mar/g, F = /\d+mir/g, W = e.find((y) => y.match(u)), l = e.find((y) => y.match(m)), x = e.find((y) => y.match(U)), Q = e.find((y) => y.match(F));
30
+ x ? (s(this, d, parseInt(x)), s(this, p, "max"), s(this, L, `(max-aspect-ratio: ${t(this, d)})`)) : Q ? (s(this, d, parseInt(Q)), s(this, p, "max"), s(this, L, `(min-aspect-ratio: ${t(this, d)})`)) : W ? (s(this, d, parseInt(W)), s(this, p, "max"), s(this, L, `(max-width: ${t(this, d)}px)`)) : l ? (s(this, d, parseInt(l)), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")) : (s(this, d, 0), s(this, L, `(min-width: ${t(this, d)}px)`), s(this, p, "min")), s(this, S, t(this, S).replace(
31
31
  `.${t(this, d)}${t(this, p)}`,
32
32
  ""
33
- )), s(this, $, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, $, t(this, $).replace(
33
+ )), s(this, q, e[e.length - 1] === t(this, S) ? "" : "." + e[e.length - 1]), s(this, q, t(this, q).replace(
34
34
  `.${t(this, d)}${t(this, p)}`,
35
35
  ""
36
36
  ));
37
37
  }
38
38
  get url() {
39
- return t(this, z);
39
+ return t(this, C);
40
40
  }
41
41
  get name() {
42
42
  return t(this, S);
43
43
  }
44
44
  get density() {
45
- return t(this, B);
45
+ return t(this, z);
46
46
  }
47
47
  get query() {
48
48
  return t(this, L);
49
49
  }
50
50
  get extension() {
51
- return t(this, $);
51
+ return t(this, q);
52
52
  }
53
53
  get queryType() {
54
54
  return t(this, p);
@@ -57,20 +57,20 @@ class nt {
57
57
  return t(this, d);
58
58
  }
59
59
  }
60
- z = new WeakMap(), S = new WeakMap(), B = new WeakMap(), L = new WeakMap(), d = new WeakMap(), p = new WeakMap(), $ = new WeakMap();
60
+ C = new WeakMap(), S = new WeakMap(), z = new WeakMap(), L = new WeakMap(), d = new WeakMap(), p = new WeakMap(), q = new WeakMap();
61
61
  var M;
62
62
  class tt {
63
63
  constructor(a, e) {
64
64
  i(this, M);
65
65
  s(this, M, /* @__PURE__ */ new Map());
66
- const n = (e == null ? void 0 : e.mediaBuckets) !== !1, u = typeof a == "string" ? n ? a.trim().split(",").map((c) => c.trim()).filter((c) => !!c) : [a] : a, h = [];
67
- u.forEach((c) => {
68
- const x = new nt(c);
69
- h.push([x.query, x]);
66
+ const n = (e == null ? void 0 : e.mediaBuckets) !== !1, h = typeof a == "string" ? n ? a.trim().split(",").map((l) => l.trim()).filter((l) => !!l) : [a] : a, u = [];
67
+ h.forEach((l) => {
68
+ const x = new nt(l);
69
+ u.push([x.query, x]);
70
70
  });
71
- const m = h.filter((c) => c[1].queryType.includes("max")).sort((c, x) => x[1].queryValue - c[1].queryValue), w = h.filter((c) => c[1].queryType.includes("min") && c[1].queryValue !== 0).sort((c, x) => c[1].queryValue - x[1].queryValue), F = h.filter((c) => c[0] === "(min-width: 0px)");
72
- (F ? [...F, ...m, ...w] : [...m, ...w]).forEach((c) => {
73
- t(this, M).has(c[0]) || t(this, M).set(c[0], []), t(this, M).get(c[0]).push(c[1]);
71
+ const m = u.filter((l) => l[1].queryType.includes("max")).sort((l, x) => x[1].queryValue - l[1].queryValue), U = u.filter((l) => l[1].queryType.includes("min") && l[1].queryValue !== 0).sort((l, x) => l[1].queryValue - x[1].queryValue), F = u.filter((l) => l[0] === "(min-width: 0px)");
72
+ (F ? [...F, ...m, ...U] : [...m, ...U]).forEach((l) => {
73
+ t(this, M).has(l[0]) || t(this, M).set(l[0], []), t(this, M).get(l[0]).push(l[1]);
74
74
  });
75
75
  }
76
76
  get mediaBuckets() {
@@ -78,60 +78,60 @@ class tt {
78
78
  }
79
79
  }
80
80
  M = new WeakMap();
81
- var k, A;
81
+ var I, $;
82
82
  class ht extends at {
83
83
  constructor(e) {
84
84
  super(void 0);
85
- i(this, k);
86
- i(this, A, () => {
85
+ i(this, I);
86
+ i(this, $, () => {
87
87
  let e;
88
- t(this, k).mediaBuckets.forEach((h, m) => {
89
- matchMedia(m).matches && (e = h);
88
+ t(this, I).mediaBuckets.forEach((u, m) => {
89
+ matchMedia(m).matches && (e = u);
90
90
  });
91
- let n, u = 0;
92
- e == null || e.forEach((h) => {
93
- h.density > u && h.density <= Math.max(devicePixelRatio, 1) && (u = h.density, n = h);
91
+ let n, h = 0;
92
+ e == null || e.forEach((u) => {
93
+ u.density > h && u.density <= Math.max(devicePixelRatio, 1) && (h = u.density, n = u);
94
94
  }), e != null && e.length && !n && (n = e[0]), this.current = n;
95
95
  });
96
- s(this, k, new tt(e.srcset, e.sourceSetOptions));
96
+ s(this, I, new tt(e.srcset, e.sourceSetOptions));
97
97
  }
98
98
  updateSource(e) {
99
- s(this, k, new tt(e.srcset, e.sourceSetOptions)), t(this, A).call(this);
99
+ s(this, I, new tt(e.srcset, e.sourceSetOptions)), t(this, $).call(this);
100
100
  }
101
101
  close() {
102
102
  super.close(), this.disconnect();
103
103
  }
104
104
  connect() {
105
- Y.subscribe(t(this, A), rt.SOURCE_MANAGER), t(this, A).call(this);
105
+ Y.subscribe(t(this, $), rt.SOURCE_MANAGER), t(this, $).call(this);
106
106
  }
107
107
  disconnect() {
108
- Y.unsubscribe(t(this, A));
108
+ Y.unsubscribe(t(this, $));
109
109
  }
110
110
  }
111
- k = new WeakMap(), A = new WeakMap();
112
- function ot(l) {
113
- if (isNaN(l)) return "0:00";
114
- const a = Math.floor(Math.max(0, l)), e = Math.floor(a / 3600), n = Math.floor(a % 3600 / 60), h = (a % 60).toString().padStart(2, "0");
111
+ I = new WeakMap(), $ = new WeakMap();
112
+ function ot(c) {
113
+ if (isNaN(c)) return "0:00";
114
+ const a = Math.floor(Math.max(0, c)), e = Math.floor(a / 3600), n = Math.floor(a % 3600 / 60), u = (a % 60).toString().padStart(2, "0");
115
115
  if (e > 0) {
116
116
  const m = n.toString().padStart(2, "0");
117
- return `${e}:${m}:${h}`;
117
+ return `${e}:${m}:${u}`;
118
118
  } else
119
- return `${n}:${h}`;
119
+ return `${n}:${u}`;
120
120
  }
121
- let lt = 0;
122
- var f, r, O, E, b, g, P, I, o, R, T, v, D, V, _, G, H, K, N, U, C;
121
+ let ct = 0;
122
+ var f, r, k, E, b, g, B, A, o, O, R, v, P, T, _, G, D, K, H, N, V;
123
123
  class Lt extends HTMLElement {
124
124
  constructor(e) {
125
125
  super();
126
- i(this, V);
126
+ i(this, T);
127
127
  i(this, f, null);
128
128
  i(this, r, null);
129
- i(this, O, this);
129
+ i(this, k, this);
130
130
  i(this, E, !1);
131
131
  i(this, b, !1);
132
132
  i(this, g, !1);
133
- i(this, P, "");
134
- i(this, I, "");
133
+ i(this, B, "");
134
+ i(this, A, "");
135
135
  i(this, o, new et(this, {
136
136
  loading: !1,
137
137
  loaded: !1,
@@ -140,46 +140,46 @@ class Lt extends HTMLElement {
140
140
  playing: !1,
141
141
  metadata: !1
142
142
  }));
143
- i(this, R, null);
144
- i(this, T);
143
+ i(this, O, null);
144
+ i(this, R);
145
145
  i(this, v, null);
146
- i(this, D);
146
+ i(this, P);
147
147
  i(this, G, (e) => {
148
148
  const n = e[0];
149
- t(this, g) && (!t(this, b) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ? q(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (j(this, V, _).call(this, void 0), s(this, b, !1)), q(this, "sourceRelease", { custom: !0 }));
149
+ t(this, g) && (!t(this, b) || this.hasAttribute("reload-source")) && n.isIntersecting && this.triggerLazyLoad(), n.isIntersecting ? w(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (j(this, T, _).call(this, void 0), s(this, b, !1)), w(this, "sourceRelease", { custom: !0 }));
150
150
  });
151
- i(this, H, () => {
152
- t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && J.complete(t(this, I)), q(this, "sourceLoaded", { custom: !0 });
151
+ i(this, D, () => {
152
+ t(this, o).set("loaded", !0), t(this, o).set("error", !1), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && J.complete(t(this, A)), w(this, "sourceLoaded", { custom: !0 });
153
153
  const e = getComputedStyle(this).getPropertyValue("--clear-duration");
154
- e ? s(this, T, setTimeout(() => {
154
+ e ? s(this, R, setTimeout(() => {
155
155
  t(this, o).set("clear", !0);
156
156
  }, parseFloat(e) * 1e3)) : t(this, o).set("clear", !0), s(this, E, !0);
157
157
  });
158
158
  i(this, K, (e) => {
159
- t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && J.error(t(this, I)), q(this, "sourceError", { custom: !0 }), s(this, E, !0);
159
+ t(this, o).set("loaded", !1), t(this, o).set("error", !0), t(this, o).set("loading", !1), !t(this, g) && !t(this, E) && J.error(t(this, A)), w(this, "sourceError", { custom: !0 }), s(this, E, !0);
160
160
  });
161
- i(this, N, () => {
162
- t(this, o).set("playing", !0), q(this, "sourcePlay", { custom: !0 });
161
+ i(this, H, () => {
162
+ t(this, o).set("playing", !0), w(this, "sourcePlay", { custom: !0 });
163
163
  });
164
- i(this, U, () => {
165
- t(this, o).set("playing", !1), q(this, "sourcePause", { custom: !0 });
164
+ i(this, N, () => {
165
+ t(this, o).set("playing", !1), w(this, "sourcePause", { custom: !0 });
166
166
  });
167
- i(this, C, () => {
167
+ i(this, V, () => {
168
168
  const e = t(this, r);
169
- (e.tagName === "VIDEO" || e.tagName === "AUDIO") && e.readyState >= 1 && (t(this, o).set("metadata", !0), q(this, "sourceMetadataLoaded", { custom: !0 }), this.querySelectorAll("[data-source-duration]").forEach((n) => {
169
+ (e.tagName === "VIDEO" || e.tagName === "AUDIO") && e.readyState >= 1 && (t(this, o).set("metadata", !0), w(this, "sourceMetadataLoaded", { custom: !0 }), this.querySelectorAll("[data-source-duration]").forEach((n) => {
170
170
  n.textContent = ot(e.duration);
171
171
  }));
172
172
  });
173
- s(this, D, e == null ? void 0 : e.sourceSetOptions), st && window.IntersectionObserver && s(this, R, new IntersectionObserver(
173
+ s(this, P, e == null ? void 0 : e.sourceSetOptions), st && window.IntersectionObserver && s(this, O, new IntersectionObserver(
174
174
  t(this, G)
175
175
  )), t(this, o).subscribe((n) => {
176
- var h;
177
- const u = (h = this.getAttribute("data-global-play-class")) == null ? void 0 : h.split(
176
+ var u;
177
+ const h = (u = this.getAttribute("data-global-play-class")) == null ? void 0 : u.split(
178
178
  ","
179
179
  );
180
- u != null && u.length && (n.current.playing ? u.forEach((m) => {
180
+ h != null && h.length && (n.current.playing ? h.forEach((m) => {
181
181
  document.documentElement.classList.add(m.trim());
182
- }) : u.forEach((m) => {
182
+ }) : h.forEach((m) => {
183
183
  document.documentElement.classList.remove(m.trim());
184
184
  }));
185
185
  });
@@ -188,7 +188,7 @@ class Lt extends HTMLElement {
188
188
  return t(this, r);
189
189
  }
190
190
  get consumerHolderElement() {
191
- return t(this, O);
191
+ return t(this, k);
192
192
  }
193
193
  get sourceManager() {
194
194
  return t(this, f);
@@ -206,53 +206,52 @@ class Lt extends HTMLElement {
206
206
  return t(this, E);
207
207
  }
208
208
  triggerLazyLoad() {
209
- !t(this, b) && t(this, f).current && t(this, f).current !== t(this, f).previous && (s(this, b, !0), j(this, V, _).call(this, t(this, f).current));
209
+ !t(this, b) && t(this, f).current && t(this, f).current !== t(this, f).previous && (s(this, b, !0), j(this, T, _).call(this, t(this, f).current));
210
210
  }
211
211
  connectedCallback() {
212
- var u;
213
- s(this, P, `source-consumer-${++lt}`);
212
+ s(this, B, `source-consumer-${++ct}`);
214
213
  const e = this.getAttribute("srcset") || "", n = this.hasAttribute("notify") ? this.closest(this.getAttribute("notify")) : null;
215
- n && t(this, o).addElement(n), s(this, O, this.querySelector("[data-consumer-holder]") || this), (u = this.querySelector(".source-consumer")) == null || u.remove(), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
214
+ n && t(this, o).addElement(n), s(this, k, this.querySelector("[data-consumer-holder]") || this), this.querySelectorAll(".source-consumer").forEach((h) => h == null ? void 0 : h.remove()), s(this, r, this.createConsumer()), t(this, r).style.cssText = `
216
215
  display: block;
217
216
  width: 100%;
218
217
  height: 100%;
219
- `, t(this, r).classList.add("source-consumer"), t(this, r).addEventListener("play", t(this, N)), t(this, r).addEventListener("pause", t(this, U)), t(this, r).addEventListener(
218
+ `, t(this, r).classList.add("source-consumer"), t(this, r).addEventListener("play", t(this, H)), t(this, r).addEventListener("pause", t(this, N)), t(this, r).addEventListener(
220
219
  "loadedmetadata",
221
- t(this, C)
222
- ), t(this, C).call(this), Array.from(this.attributes).forEach((h) => {
220
+ t(this, V)
221
+ ), t(this, V).call(this), Array.from(this.attributes).forEach((h) => {
223
222
  if (h.name !== "srcset") {
224
- const m = h.nodeValue || "", w = it(h.name);
225
- w in t(this, r) && (t(this, r)[w] = m || !0);
223
+ const u = h.nodeValue || "", m = it(h.name);
224
+ m in t(this, r) && (t(this, r)[m] = u || !0);
226
225
  }
227
- }), t(this, O).appendChild(t(this, r)), s(this, f, new ht({
226
+ }), t(this, k).appendChild(t(this, r)), s(this, f, new ht({
228
227
  srcset: e,
229
- sourceSetOptions: t(this, D)
228
+ sourceSetOptions: t(this, P)
230
229
  })), s(this, g, this.hasAttribute("lazy")), t(this, f).subscribe((h) => {
231
- (!t(this, g) || t(this, g) && t(this, b)) && j(this, V, _).call(this, h.current);
232
- }), t(this, f).connect(), t(this, R).observe(this);
230
+ (!t(this, g) || t(this, g) && t(this, b)) && j(this, T, _).call(this, h.current);
231
+ }), t(this, f).connect(), t(this, O).observe(this);
233
232
  }
234
233
  disconnectedCallback() {
235
234
  var e;
236
- clearTimeout(t(this, T)), t(this, R).disconnect(), (e = t(this, f)) == null || e.close(), t(this, r) && (this.consumeSource(null), t(this, r).removeEventListener("play", t(this, N)), t(this, r).removeEventListener("pause", t(this, U)), t(this, r).removeEventListener(
235
+ clearTimeout(t(this, R)), t(this, O).disconnect(), (e = t(this, f)) == null || e.close(), t(this, r) && (this.consumeSource(null), t(this, r).removeEventListener("play", t(this, H)), t(this, r).removeEventListener("pause", t(this, N)), t(this, r).removeEventListener(
237
236
  "loadedmetadata",
238
- t(this, C)
237
+ t(this, V)
239
238
  ), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, r).onerror = null, t(this, r).remove()), s(this, E, !1), s(this, b, !1), t(this, o).reset();
240
239
  }
241
240
  }
242
- f = new WeakMap(), r = new WeakMap(), O = new WeakMap(), E = new WeakMap(), b = new WeakMap(), g = new WeakMap(), P = new WeakMap(), I = new WeakMap(), o = new WeakMap(), R = new WeakMap(), T = new WeakMap(), v = new WeakMap(), D = new WeakMap(), V = new WeakSet(), _ = function(e) {
243
- if (clearTimeout(t(this, T)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, o).set("loaded", !1), t(this, o).set("error", !1), t(this, o).set("loading", !1), t(this, o).set("clear", !1), t(this, o).set("playing", !1), t(this, o).set("metadata", !1), e) {
244
- s(this, I, `${t(this, P)}-${e.url}`);
241
+ f = new WeakMap(), r = new WeakMap(), k = new WeakMap(), E = new WeakMap(), b = new WeakMap(), g = new WeakMap(), B = new WeakMap(), A = new WeakMap(), o = new WeakMap(), O = new WeakMap(), R = new WeakMap(), v = new WeakMap(), P = new WeakMap(), T = new WeakSet(), _ = function(e) {
242
+ if (clearTimeout(t(this, R)), t(this, r).onloadeddata = null, t(this, r).onload = null, t(this, r).onerror = null, t(this, o).set("loaded", !1), t(this, o).set("error", !1), t(this, o).set("loading", !1), t(this, o).set("clear", !1), t(this, o).set("playing", !1), t(this, o).set("metadata", !1), e) {
243
+ s(this, A, `${t(this, B)}-${e.url}`);
245
244
  const n = this.hasAttribute("keep-source-parameters");
246
- t(this, o).set("loading", !0), s(this, v, n ? e.url : e.name + e.extension), this.consumeSource(t(this, v)), !t(this, g) && !t(this, E) && J.add(t(this, I)), t(this, r).onloadeddata = () => {
247
- t(this, H).call(this);
245
+ t(this, o).set("loading", !0), s(this, v, n ? e.url : e.name + e.extension), this.consumeSource(t(this, v)), !t(this, g) && !t(this, E) && J.add(t(this, A)), t(this, r).onloadeddata = () => {
246
+ t(this, D).call(this);
248
247
  }, t(this, r).onload = () => {
249
- t(this, H).call(this);
248
+ t(this, D).call(this);
250
249
  }, t(this, r).onerror = () => {
251
250
  t(this, K).call(this, t(this, v));
252
251
  };
253
252
  } else
254
253
  s(this, v, null), this.consumeSource(null);
255
- }, G = new WeakMap(), H = new WeakMap(), K = new WeakMap(), N = new WeakMap(), U = new WeakMap(), C = new WeakMap();
254
+ }, G = new WeakMap(), D = new WeakMap(), K = new WeakMap(), H = new WeakMap(), N = new WeakMap(), V = new WeakMap();
256
255
  export {
257
256
  nt as S,
258
257
  Lt as a,
@@ -1 +1 @@
1
- "use strict";var S=Object.defineProperty,b=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var a=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var u=e=>{throw TypeError(e)};var l=(e,s,t)=>s in e?S(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,f=(e,s)=>{for(var t in s||(s={}))g.call(s,t)&&l(e,t,s[t]);if(a)for(var t of a(s))k.call(s,t)&&l(e,t,s[t]);return e},d=(e,s)=>b(e,p(s));var m=(e,s,t)=>s.has(e)||u("Cannot "+t);var h=(e,s,t)=>(m(e,s,"read from private field"),t?t.call(e):s.get(e)),y=(e,s,t)=>s.has(e)?u("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),c=(e,s,t,r)=>(m(e,s,"write to private field"),r?r.call(e,t):s.set(e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../Store-Cd1GlEmZ.cjs"),E=require("../string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");require("../index-DekP7OZe.cjs");var i;class L extends q.Store{constructor(t,r){super(r);y(this,i);c(this,i,Array.isArray(t)?t:[t]);for(const o in this.initial)this.set(o,this.initial[o])}addElement(t){h(this,i).push(t)}removeElement(t){c(this,i,h(this,i).filter(r=>r!==t))}isTrue(t){return this.current[t]===!0}isFalse(t){return this.current[t]===!1}reset(){super.reset();for(const t in this.initial)this.set(t,this.initial[t])}set(t,r){const o=t;this.current=d(f({},this.current),{[t]:r}),o.startsWith("--")?r?h(this,i).forEach(n=>n.style.setProperty(o,r.toString())):h(this,i).forEach(n=>n.style.removeProperty(o)):r?h(this,i).forEach(n=>n.classList.add(E.camelToKebab(o))):h(this,i).forEach(n=>n.classList.remove(E.camelToKebab(o)))}}i=new WeakMap;exports.ElementLinkedStore=L;
1
+ "use strict";var m=Object.defineProperty,P=Object.defineProperties;var g=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var p=s=>{throw TypeError(s)};var y=(s,r,t)=>r in s?m(s,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[r]=t,S=(s,r)=>{for(var t in r||(r={}))q.call(r,t)&&y(s,t,r[t]);if(E)for(var t of E(r))b.call(r,t)&&y(s,t,r[t]);return s},L=(s,r)=>P(s,g(r));var a=(s,r,t)=>r.has(s)||p("Cannot "+t);var n=(s,r,t)=>(a(s,r,"read from private field"),t?t.call(s):r.get(s)),f=(s,r,t)=>r.has(s)?p("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),l=(s,r,t,i)=>(a(s,r,"write to private field"),i?i.call(s,t):r.set(s,t),t),u=(s,r,t)=>(a(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../Store-Cd1GlEmZ.cjs");require("construct-style-sheets-polyfill");require("../index-DekP7OZe.cjs");var h,c,d;class A extends k.Store{constructor(t,i){super(i);f(this,c);f(this,h);l(this,h,Array.isArray(t)?t:[t]);for(const e in this.initial)this.set(e,this.initial[e])}addElement(t){n(this,h).push(t);for(const i in this.current)u(this,c,d).call(this,[t],i,this.current[i])}removeElement(t){const i=n(this,h).find(e=>e===t);if(i){l(this,h,n(this,h).filter(e=>e!==t));for(const e in this.current)u(this,c,d).call(this,[i],e,!1)}}isTrue(t){return this.current[t]===!0}isFalse(t){return this.current[t]===!1}reset(){super.reset();for(const t in this.initial)this.set(t,this.initial[t])}set(t,i){const e=t;this.current=L(S({},this.current),{[t]:i}),e.startsWith("--")?i?n(this,h).forEach(o=>o.style.setProperty(e,i.toString())):n(this,h).forEach(o=>o.style.removeProperty(e)):i?n(this,h).forEach(o=>o.classList.add(e)):n(this,h).forEach(o=>o.classList.remove(e))}}h=new WeakMap,c=new WeakSet,d=function(t,i,e){i.startsWith("--")?e?t.forEach(o=>o.style.setProperty(i,e.toString())):t.forEach(o=>o.style.removeProperty(i)):e?t.forEach(o=>o.classList.add(i)):t.forEach(o=>o.classList.remove(i))};exports.ElementLinkedStore=A;
@@ -1,38 +1,45 @@
1
- var d = Object.defineProperty, S = Object.defineProperties;
2
- var k = Object.getOwnPropertyDescriptors;
3
- var c = Object.getOwnPropertySymbols;
4
- var L = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
5
- var f = (s) => {
1
+ var S = Object.defineProperty, P = Object.defineProperties;
2
+ var g = Object.getOwnPropertyDescriptors;
3
+ var u = Object.getOwnPropertySymbols;
4
+ var x = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
5
+ var y = (s) => {
6
6
  throw TypeError(s);
7
7
  };
8
- var l = (s, r, t) => r in s ? d(s, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[r] = t, m = (s, r) => {
8
+ var E = (s, r, t) => r in s ? S(s, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[r] = t, m = (s, r) => {
9
9
  for (var t in r || (r = {}))
10
- L.call(r, t) && l(s, t, r[t]);
11
- if (c)
12
- for (var t of c(r))
13
- b.call(r, t) && l(s, t, r[t]);
10
+ x.call(r, t) && E(s, t, r[t]);
11
+ if (u)
12
+ for (var t of u(r))
13
+ A.call(r, t) && E(s, t, r[t]);
14
14
  return s;
15
- }, p = (s, r) => S(s, k(r));
16
- var u = (s, r, t) => r.has(s) || f("Cannot " + t);
17
- var n = (s, r, t) => (u(s, r, "read from private field"), t ? t.call(s) : r.get(s)), y = (s, r, t) => r.has(s) ? f("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(s) : r.set(s, t), a = (s, r, t, i) => (u(s, r, "write to private field"), i ? i.call(s, t) : r.set(s, t), t);
18
- import { S as x } from "../Store-0BVty6AZ.js";
19
- import { c as E } from "../string-BlMQbe8b.js";
15
+ }, L = (s, r) => P(s, g(r));
16
+ var f = (s, r, t) => r.has(s) || y("Cannot " + t);
17
+ var c = (s, r, t) => (f(s, r, "read from private field"), t ? t.call(s) : r.get(s)), a = (s, r, t) => r.has(s) ? y("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(s) : r.set(s, t), l = (s, r, t, i) => (f(s, r, "write to private field"), i ? i.call(s, t) : r.set(s, t), t), d = (s, r, t) => (f(s, r, "access private method"), t);
18
+ import { S as W } from "../Store-0BVty6AZ.js";
20
19
  import "construct-style-sheets-polyfill";
21
20
  import "../index-Bv9zgfdb.js";
22
- var e;
23
- class K extends x {
21
+ var h, n, p;
22
+ class j extends W {
24
23
  constructor(t, i) {
25
24
  super(i);
26
- y(this, e);
27
- a(this, e, Array.isArray(t) ? t : [t]);
28
- for (const o in this.initial)
29
- this.set(o, this.initial[o]);
25
+ a(this, n);
26
+ a(this, h);
27
+ l(this, h, Array.isArray(t) ? t : [t]);
28
+ for (const e in this.initial)
29
+ this.set(e, this.initial[e]);
30
30
  }
31
31
  addElement(t) {
32
- n(this, e).push(t);
32
+ c(this, h).push(t);
33
+ for (const i in this.current)
34
+ d(this, n, p).call(this, [t], i, this.current[i]);
33
35
  }
34
36
  removeElement(t) {
35
- a(this, e, n(this, e).filter((i) => i !== t));
37
+ const i = c(this, h).find((e) => e === t);
38
+ if (i) {
39
+ l(this, h, c(this, h).filter((e) => e !== t));
40
+ for (const e in this.current)
41
+ d(this, n, p).call(this, [i], e, !1);
42
+ }
36
43
  }
37
44
  isTrue(t) {
38
45
  return this.current[t] === !0;
@@ -46,13 +53,15 @@ class K extends x {
46
53
  this.set(t, this.initial[t]);
47
54
  }
48
55
  set(t, i) {
49
- const o = t;
50
- this.current = p(m({}, this.current), { [t]: i }), o.startsWith("--") ? i ? n(this, e).forEach(
51
- (h) => h.style.setProperty(o, i.toString())
52
- ) : n(this, e).forEach((h) => h.style.removeProperty(o)) : i ? n(this, e).forEach((h) => h.classList.add(E(o))) : n(this, e).forEach((h) => h.classList.remove(E(o)));
56
+ const e = t;
57
+ this.current = L(m({}, this.current), { [t]: i }), e.startsWith("--") ? i ? c(this, h).forEach(
58
+ (o) => o.style.setProperty(e, i.toString())
59
+ ) : c(this, h).forEach((o) => o.style.removeProperty(e)) : i ? c(this, h).forEach((o) => o.classList.add(e)) : c(this, h).forEach((o) => o.classList.remove(e));
53
60
  }
54
61
  }
55
- e = new WeakMap();
62
+ h = new WeakMap(), n = new WeakSet(), p = function(t, i, e) {
63
+ i.startsWith("--") ? e ? t.forEach((o) => o.style.setProperty(i, e.toString())) : t.forEach((o) => o.style.removeProperty(i)) : e ? t.forEach((o) => o.classList.add(i)) : t.forEach((o) => o.classList.remove(i));
64
+ };
56
65
  export {
57
- K as ElementLinkedStore
66
+ j as ElementLinkedStore
58
67
  };
@@ -2,7 +2,6 @@ import { WebGLRenderer, WebGLRendererParameters } from 'three';
2
2
  import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
3
3
  import { ElementOrSelector } from '../utils';
4
4
  import { En3View, En3ViewOptions } from './En3View';
5
- import { En3Raycaster } from './En3Raycaster';
6
5
  export interface En3Options {
7
6
  webGLRendererParameters?: WebGLRendererParameters;
8
7
  maxPixelRatio?: number;
@@ -12,12 +11,11 @@ export interface En3Options {
12
11
  position?: 'fixed' | 'absolute' | 'relative';
13
12
  composer?: typeof EffectComposer;
14
13
  }
15
- declare class En3 {
14
+ export declare class En3 {
16
15
  #private;
17
16
  get CDNVersion(): string;
18
17
  get containerElement(): HTMLElement;
19
18
  get webglRenderer(): WebGLRenderer;
20
- get raycaster(): En3Raycaster;
21
19
  get views(): Map<string, En3View>;
22
20
  get view(): En3View;
23
21
  get camera(): import('three').PerspectiveCamera | import('three').OrthographicCamera;
@@ -33,5 +31,3 @@ declare class En3 {
33
31
  destroyView(viewName: string): void;
34
32
  render(view: En3View): void;
35
33
  }
36
- export declare const en3: En3;
37
- export {};
@@ -1,6 +1,7 @@
1
1
  import { LayoutBox, LayoutBoxOptions } from '../layout-box';
2
2
  import { ElementOrSelector } from '../utils';
3
3
  import { Object3D, OrthographicCamera, PerspectiveCamera, Scene } from 'three';
4
+ import { En3 } from './En3';
4
5
  export interface En3ViewOptions {
5
6
  cameraType?: 'perspective' | 'orthographic';
6
7
  cameraDistance?: number;
@@ -20,7 +21,7 @@ export type En3ViewBeforeRenderCallback = () => void;
20
21
  export declare class En3View {
21
22
  #private;
22
23
  beforeRenderCallback: En3ViewBeforeRenderCallback | undefined;
23
- constructor(name: string, options?: En3ViewOptions);
24
+ constructor(en3: En3, name: string, options?: En3ViewOptions);
24
25
  get name(): string;
25
26
  get camera(): PerspectiveCamera | OrthographicCamera;
26
27
  get scene(): Scene;
package/lib/en3/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var de=Object.defineProperty,ue=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var Q=s=>{throw TypeError(s)};var J=(s,e,i)=>e in s?de(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,k=(s,e)=>{for(var i in e||(e={}))fe.call(e,i)&&J(s,i,e[i]);if(Z)for(var i of Z(e))ge.call(e,i)&&J(s,i,e[i]);return s},ee=(s,e)=>ue(s,me(e));var te=(s,e,i)=>e.has(s)||Q("Cannot "+i);var t=(s,e,i)=>(te(s,e,"read from private field"),i?i.call(s):e.get(s)),r=(s,e,i)=>e.has(s)?Q("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,i),h=(s,e,i,a)=>(te(s,e,"write to private field"),a?a.call(s,i):e.set(s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("three"),ie=require("../order/index.cjs"),se=require("../window-resizer/index.cjs"),re=require("../ticker/index.cjs"),ae=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");require("../index-DekP7OZe.cjs");const he=require("../layout-box/index.cjs");function ne(s){const e=i=>{i.dispose();for(const a of Object.keys(i)){const n=i[a];n&&typeof n=="object"&&"minFilter"in n&&n.dispose()}};s.traverse(i=>{if(i instanceof u.Mesh){if(i.geometry.dispose(),!Array.isArray(i.material)&&i.material.isMaterial)e(i.material);else if(Array.isArray(i.material))for(const a of i.material)e(a)}})}var P,o,C,D,y,O,R,p;class Y{constructor(e,i){r(this,P);r(this,o);r(this,C);r(this,D);r(this,y);r(this,O);r(this,R);r(this,p);h(this,P,e),h(this,o,(i==null?void 0:i.cameraType)==="orthographic"?new u.OrthographicCamera:new u.PerspectiveCamera),h(this,C,new u.Scene),h(this,D,[]),h(this,y,(i==null?void 0:i.cameraDistance)||1e3),t(this,o).near=(i==null?void 0:i.cameraNear)||1,t(this,o).far=(i==null?void 0:i.cameraFar)||11e3,h(this,O,(i==null?void 0:i.cameraFov)||"auto"),t(this,o).position.z=t(this,y),t(this,o).name=`Cameras.${t(this,P)}`,h(this,R,ae.getElement(i==null?void 0:i.sizeElement)||document.documentElement),this.beforeRenderCallback=i==null?void 0:i.beforeRender,h(this,p,new he.LayoutBox(t(this,R))),t(this,p).onResize(()=>{this.resize()})}get name(){return t(this,P)}get camera(){return t(this,o)}get scene(){return t(this,C)}get box(){return t(this,p)}get cameraDistance(){return t(this,y)}set cameraDistance(e){h(this,y,e),this.resize()}get sizeElement(){return t(this,R)}get isClipped(){return t(this,R)!==d.containerElement}resize(){const{width:e,height:i}=t(this,p);t(this,o).userData.controlled||(t(this,o).position.z=t(this,y)),t(this,o)instanceof u.PerspectiveCamera?(t(this,o).aspect=e/i,t(this,o).fov=t(this,O)==="auto"?2*Math.atan(i/2/t(this,y))*(180/Math.PI):t(this,o).userData.controlled?t(this,o).fov:t(this,O)):t(this,o)instanceof u.OrthographicCamera&&(t(this,o).left=e/-2,t(this,o).right=e/2,t(this,o).top=i/2,t(this,o).bottom=i/-2),t(this,o).updateProjectionMatrix()}destroy(){t(this,D).forEach(e=>{e.userData.box.destroy()}),t(this,C).clear(),ne(t(this,C)),d.destroyView(this.name),t(this,p).destroy()}attachToHTMLElement(e,i,a){const n=new he.LayoutBox(e,ee(k({},a),{containerElement:t(this,R),cartesian:!0,scrollStep:!this.isClipped}));return n.bindObject(i),i.userData.box=n,t(this,D).push(i),i}detachFromHTMLElement(e){h(this,D,t(this,D).filter(i=>i===e?(e.userData.box.destroy(),!1):!0))}add(...e){const i=e[0],a=e[1],n=e[2];return a&&this.attachToHTMLElement(a,i,n),this.scene.add(i),i}remove(e,i){this.scene.remove(e),i&&this.detachFromHTMLElement(e)}}P=new WeakMap,o=new WeakMap,C=new WeakMap,D=new WeakMap,y=new WeakMap,O=new WeakMap,R=new WeakMap,p=new WeakMap;var A,q,F,z,I;class Ee{constructor(e){r(this,A);r(this,q);r(this,F);r(this,z);r(this,I);h(this,A,e.targetName||void 0),h(this,q,e.eventDispatcher||e.object3D),h(this,F,e.propagation||!1),h(this,z,e.object3D),h(this,I,t(this,A)?()=>t(this,z).getObjectByName(t(this,A))||t(this,z):()=>t(this,z))}get object3D(){return t(this,z)}get eventDispatcher(){return t(this,q)}get propagation(){return t(this,F)}get target(){return t(this,I).call(this)}dispatch(e,i){this.eventDispatcher.dispatchEvent(k({originalEvent:i,type:e},this.intersection))}}A=new WeakMap,q=new WeakMap,F=new WeakMap,z=new WeakMap,I=new WeakMap;var w,m,H,N,_,B,$;class xe{constructor(){r(this,w,[]);r(this,m,[]);r(this,H,new u.Vector2);r(this,N,new u.Raycaster);r(this,_,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerDown",e)});r(this,B,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerUp",e)});r(this,$,e=>{if(!t(this,w).length)return;t(this,H).x=e.clientX/d.width*2-1,t(this,H).y=-(e.clientY/d.height)*2+1,d.camera&&t(this,N).setFromCamera(t(this,H),d.camera);const i=[];for(const c of t(this,w)){const g=t(this,N).intersectObject(c.target);g.length&&(c.intersection=g[0],i.push(c))}let a=!1;const n=t(this,m).filter(c=>!i.find(g=>g.object3D.uuid===c.object3D.uuid)),b=i.sort((c,g)=>g.object3D.position.z-c.object3D.position.z).filter((c,g)=>a?(n.push(c),!1):(a=!c.propagation,!0)),v=b.filter(c=>!t(this,m).find(g=>g.object3D.uuid===c.object3D.uuid));for(let c=0;c<n.length;c++)n[c].dispatch("pointerLeave",e);for(let c=0;c<v.length;c++)v[c].dispatch("pointerEnter",e);h(this,m,b);for(let c=0;c<t(this,m).length;c++)t(this,m)[c].dispatch("pointerMove",e)});d.containerElement.addEventListener("pointerdown",t(this,_)),d.containerElement.addEventListener("pointerup",t(this,B)),d.containerElement.addEventListener("pointermove",t(this,$))}destroy(){d.containerElement.removeEventListener("pointerdown",t(this,_)),d.containerElement.removeEventListener("pointerup",t(this,B)),d.containerElement.removeEventListener("pointermove",t(this,$)),h(this,w,[]),h(this,m,[])}add(e,i){if(t(this,w).find(n=>n.object3D.uuid===e.uuid))return;const a=new Ee(k({object3D:e},i));t(this,w).push(a)}remove(e){h(this,w,t(this,w).filter(i=>i.object3D.uuid!==e.uuid)),h(this,m,t(this,m).filter(i=>i.object3D.uuid!==e.uuid))}}w=new WeakMap,m=new WeakMap,H=new WeakMap,N=new WeakMap,_=new WeakMap,B=new WeakMap,$=new WeakMap;var K,E,l,j,f,M,T,L,W,S,x,G,U;class be{constructor(){r(this,K,`https://unpkg.com/three@0.${u.REVISION}.x`);r(this,E,null);r(this,l,null);r(this,j,null);r(this,f,new Map);r(this,M,0);r(this,T,0);r(this,L,0);r(this,W,2);r(this,S,!1);r(this,x,null);r(this,G,e=>{e instanceof CustomEvent||(h(this,M,t(this,E).clientWidth),h(this,T,t(this,E).clientHeight),h(this,L,Math.min(t(this,W),devicePixelRatio||1)),t(this,l).setPixelRatio(t(this,L)),t(this,l).setSize(t(this,M),t(this,T)),t(this,x)&&(t(this,x).setPixelRatio(t(this,L)),t(this,x).setSize(t(this,M),t(this,T))))});r(this,U,()=>{t(this,l).setRenderTarget(null),t(this,f).forEach(e=>{this.render(e)})})}get CDNVersion(){return t(this,K)}get containerElement(){return t(this,E)}get webglRenderer(){return t(this,l)}get raycaster(){return t(this,j)}get views(){return t(this,f)}get view(){return this.getView("default")}get camera(){return this.getView("default").camera}get scene(){return this.getView("default").scene}get width(){return t(this,M)}get height(){return t(this,T)}get pixelRatio(){return t(this,L)}get composer(){return t(this,x)}setup(e){if(t(this,S))return;h(this,E,ae.getElement(e==null?void 0:e.containerElement)||document.body),h(this,W,(e==null?void 0:e.maxPixelRatio)||2),h(this,l,new u.WebGLRenderer(e==null?void 0:e.webGLRendererParameters)),t(this,l).domElement.style.cssText=`
1
+ "use strict";var j=Object.defineProperty,p=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var H=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var $=i=>{throw TypeError(i)};var N=(i,e,r)=>e in i?j(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,I=(i,e)=>{for(var r in e||(e={}))te.call(e,r)&&N(i,r,e[r]);if(H)for(var r of H(e))re.call(e,r)&&N(i,r,e[r]);return i},B=(i,e)=>p(i,ee(e));var W=(i,e,r)=>e.has(i)||$("Cannot "+r);var t=(i,e,r)=>(W(i,e,"read from private field"),r?r.call(i):e.get(i)),n=(i,e,r)=>e.has(i)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,r),h=(i,e,r,s)=>(W(i,e,"write to private field"),s?s.call(i,r):e.set(i,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("three"),G=require("../order/index.cjs"),K=require("../window-resizer/index.cjs"),U=require("../ticker/index.cjs"),J=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");require("../index-DekP7OZe.cjs");const Z=require("../layout-box/index.cjs");function Q(i){const e=r=>{r.dispose();for(const s of Object.keys(r)){const a=r[s];a&&typeof a=="object"&&"minFilter"in a&&a.dispose()}};i.traverse(r=>{if(r instanceof d.Mesh){if(r.geometry.dispose(),!Array.isArray(r.material)&&r.material.isMaterial)e(r.material);else if(Array.isArray(r.material))for(const s of r.material)e(s)}})}var T,S,c,b,g,o,v,x,w;class F{constructor(e,r,s){n(this,T);n(this,S);n(this,c);n(this,b);n(this,g);n(this,o);n(this,v);n(this,x);n(this,w);h(this,T,e),h(this,S,r),h(this,c,(s==null?void 0:s.cameraType)==="orthographic"?new d.OrthographicCamera:new d.PerspectiveCamera),h(this,b,new d.Scene),h(this,g,[]),h(this,o,(s==null?void 0:s.cameraDistance)||1e3),t(this,c).near=(s==null?void 0:s.cameraNear)||1,t(this,c).far=(s==null?void 0:s.cameraFar)||11e3,h(this,v,(s==null?void 0:s.cameraFov)||"auto"),t(this,c).position.z=t(this,o),t(this,c).name=`Cameras.${t(this,S)}`,h(this,x,J.getElement(s==null?void 0:s.sizeElement)||document.documentElement),this.beforeRenderCallback=s==null?void 0:s.beforeRender,h(this,w,new Z.LayoutBox(t(this,x))),t(this,w).onResize(()=>{this.resize()})}get name(){return t(this,S)}get camera(){return t(this,c)}get scene(){return t(this,b)}get box(){return t(this,w)}get cameraDistance(){return t(this,o)}set cameraDistance(e){h(this,o,e),this.resize()}get sizeElement(){return t(this,x)}get isClipped(){return t(this,x)!==t(this,T).containerElement}resize(){const{width:e,height:r}=t(this,w);t(this,c).userData.controlled||(t(this,c).position.z=t(this,o)),t(this,c)instanceof d.PerspectiveCamera?(t(this,c).aspect=e/r,t(this,c).fov=t(this,v)==="auto"?2*Math.atan(r/2/t(this,o))*(180/Math.PI):t(this,c).userData.controlled?t(this,c).fov:t(this,v)):t(this,c)instanceof d.OrthographicCamera&&(t(this,c).left=e/-2,t(this,c).right=e/2,t(this,c).top=r/2,t(this,c).bottom=r/-2),t(this,c).updateProjectionMatrix()}destroy(){t(this,g).forEach(e=>{e.userData.box.destroy()}),t(this,b).clear(),Q(t(this,b)),t(this,T).destroyView(this.name),t(this,w).destroy()}attachToHTMLElement(e,r,s){const a=new Z.LayoutBox(e,B(I({},s),{containerElement:t(this,x),cartesian:!0,scrollStep:!this.isClipped}));return a.bindObject(r),r.userData.box=a,t(this,g).push(r),r}detachFromHTMLElement(e){h(this,g,t(this,g).filter(r=>r===e?(e.userData.box.destroy(),!1):!0))}add(...e){const r=e[0],s=e[1],a=e[2];return s&&this.attachToHTMLElement(s,r,a),this.scene.add(r),r}remove(e,r){this.scene.remove(e),r&&this.detachFromHTMLElement(e)}}T=new WeakMap,S=new WeakMap,c=new WeakMap,b=new WeakMap,g=new WeakMap,o=new WeakMap,v=new WeakMap,x=new WeakMap,w=new WeakMap;var k,u,l,m,R,z,V,D,C,f,P,A;class se{constructor(){n(this,k,`https://unpkg.com/three@0.${d.REVISION}.x`);n(this,u,null);n(this,l,null);n(this,m,new Map);n(this,R,0);n(this,z,0);n(this,V,0);n(this,D,2);n(this,C,!1);n(this,f,null);n(this,P,e=>{e instanceof CustomEvent||(h(this,R,t(this,u).clientWidth),h(this,z,t(this,u).clientHeight),h(this,V,Math.min(t(this,D),devicePixelRatio||1)),t(this,l).setPixelRatio(t(this,V)),t(this,l).setSize(t(this,R),t(this,z)),t(this,f)&&(t(this,f).setPixelRatio(t(this,V)),t(this,f).setSize(t(this,R),t(this,z))))});n(this,A,()=>{t(this,l).setRenderTarget(null),t(this,m).forEach(e=>{this.render(e)})})}get CDNVersion(){return t(this,k)}get containerElement(){return t(this,u)}get webglRenderer(){return t(this,l)}get views(){return t(this,m)}get view(){return this.getView("default")}get camera(){return this.getView("default").camera}get scene(){return this.getView("default").scene}get width(){return t(this,R)}get height(){return t(this,z)}get pixelRatio(){return t(this,V)}get composer(){return t(this,f)}setup(e){if(t(this,C))return;h(this,u,J.getElement(e==null?void 0:e.containerElement)||document.body),h(this,D,(e==null?void 0:e.maxPixelRatio)||2),h(this,l,new d.WebGLRenderer(e==null?void 0:e.webGLRendererParameters)),t(this,l).domElement.style.cssText=`
2
2
  position: ${(e==null?void 0:e.position)||"fixed"};
3
3
  left: 0;
4
4
  top: 0;
5
5
  width: 100%;
6
6
  height: 100%;
7
7
  z-index: ${(e==null?void 0:e.zIndex)||0};
8
- `,(t(this,E).shadowRoot||t(this,E)).append(t(this,l).domElement),t(this,f).set("default",new Y("default",k({sizeElement:t(this,E)},e==null?void 0:e.view))),h(this,j,new xe),e!=null&&e.composer&&(h(this,x,new e.composer(t(this,l))),this.render=()=>{t(this,x).render()}),h(this,S,!0),se.windowResizer.subscribe(t(this,G),ie.RESIZE_ORDER.CANVAS),re.ticker.subscribe(t(this,U),{order:ie.TICK_ORDER.CANVAS,culling:t(this,E)})}destroy(){var e;t(this,S)&&(se.windowResizer.unsubscribe(t(this,G)),re.ticker.unsubscribe(t(this,U)),t(this,j).destroy(),t(this,f).forEach(i=>{i.destroy()}),t(this,f).clear(),t(this,l).dispose(),t(this,l).domElement.remove(),h(this,l,null),(e=t(this,x))==null||e.dispose(),h(this,x,null),h(this,S,!1))}createView(e,i){const a=t(this,f).size,n=new Y(e,i);return t(this,f).set(e,n),a===1&&t(this,l).setScissorTest(!0),n}getView(e){return t(this,f).get(e)}destroyView(e){const i=t(this,f).get(e);i&&(t(this,f).delete(e),i.destroy(),t(this,f).size<=1&&t(this,l).setScissorTest(!1))}render(e){var i;if(t(this,f).size>1||this.view.isClipped){const a=e.box.left+e.box.CSSTranslation.x+e.box.scrollValue.x,n=d.height-e.box.height-e.box.top+e.box.CSSTranslation.y+e.box.scrollValue.y*-1;t(this,l).setScissor(a,n,e.box.width,e.box.height),t(this,l).setViewport(a,n,e.box.width,e.box.height)}(i=e.beforeRenderCallback)==null||i.call(e),t(this,l).render(e.scene,e.camera)}}K=new WeakMap,E=new WeakMap,l=new WeakMap,j=new WeakMap,f=new WeakMap,M=new WeakMap,T=new WeakMap,L=new WeakMap,W=new WeakMap,S=new WeakMap,x=new WeakMap,G=new WeakMap,U=new WeakMap;const d=new be;function we(s,e,i){const a=e.x,n=e.y,V=i||s.image.width/s.image.height;let b=0,v=0,c=s.offset.x,g=s.offset.y,ce=s.rotation,oe=s.center.x,le=s.center.y;a/n>V?(b=1,v=n/a*V):(v=1,b=a/n/V),s.matrix.setUvTransform(c,g,b,v,ce,oe,le)}const X=new u.Vector3,ye=new u.Vector3;function ve(s,e="default"){const i=d.getView(e),{width:a,height:n}=d,V=a/n;s instanceof u.Vector3?X.copy(s):X.set(...s);const b=i.camera.getWorldPosition(ye).distanceTo(X);if(i.camera instanceof u.OrthographicCamera)return{width:a/i.camera.zoom,height:n/i.camera.zoom,factor:1,distance:b,aspect:V};{const v=i.camera.fov*Math.PI/180,c=2*Math.tan(v/2)*b,g=c*(a/n);return{width:g,height:c,factor:a/g,distance:b,aspect:V}}}function De(s,e){s.traverse(i=>{i instanceof u.Mesh&&i.material&&(Array.isArray(i.material)?i.material:[i.material]).forEach(e)})}function Re(s,e){s.traverse(i=>{i instanceof u.Mesh&&e(i)})}exports.En3View=Y;exports.coverTexture=we;exports.dispose=ne;exports.en3=d;exports.getCurrentViewport=ve;exports.traverseMaterials=De;exports.traverseMeshes=Re;
8
+ `,(t(this,u).shadowRoot||t(this,u)).append(t(this,l).domElement),t(this,m).set("default",new F(this,"default",I({sizeElement:t(this,u)},e==null?void 0:e.view))),e!=null&&e.composer&&(h(this,f,new e.composer(t(this,l))),this.render=()=>{t(this,f).render()}),h(this,C,!0),K.windowResizer.subscribe(t(this,P),G.RESIZE_ORDER.CANVAS),U.ticker.subscribe(t(this,A),{order:G.TICK_ORDER.CANVAS,culling:t(this,u)})}destroy(){var e;t(this,C)&&(K.windowResizer.unsubscribe(t(this,P)),U.ticker.unsubscribe(t(this,A)),t(this,m).forEach(r=>{r.destroy()}),t(this,m).clear(),t(this,l).dispose(),t(this,l).domElement.remove(),h(this,l,null),(e=t(this,f))==null||e.dispose(),h(this,f,null),h(this,C,!1))}createView(e,r){const s=t(this,m).size,a=new F(this,e,r);return t(this,m).set(e,a),s===1&&t(this,l).setScissorTest(!0),a}getView(e){return t(this,m).get(e)}destroyView(e){const r=t(this,m).get(e);r&&(t(this,m).delete(e),r.destroy(),t(this,m).size<=1&&t(this,l).setScissorTest(!1))}render(e){var r;if(t(this,m).size>1||this.view.isClipped){const s=e.box.left+e.box.CSSTranslation.x+e.box.scrollValue.x,a=this.height-e.box.height-e.box.top+e.box.CSSTranslation.y+e.box.scrollValue.y*-1;t(this,l).setScissor(s,a,e.box.width,e.box.height),t(this,l).setViewport(s,a,e.box.width,e.box.height)}(r=e.beforeRenderCallback)==null||r.call(e),t(this,l).render(e.scene,e.camera)}}k=new WeakMap,u=new WeakMap,l=new WeakMap,m=new WeakMap,R=new WeakMap,z=new WeakMap,V=new WeakMap,D=new WeakMap,C=new WeakMap,f=new WeakMap,P=new WeakMap,A=new WeakMap;function ie(i,e,r){const s=e.x,a=e.y,y=r||i.image.width/i.image.height;let M=0,E=0,q=i.offset.x,L=i.offset.y,O=i.rotation,X=i.center.x,Y=i.center.y;s/a>y?(M=1,E=a/s*y):(E=1,M=s/a/y),i.matrix.setUvTransform(q,L,M,E,O,X,Y)}const _=new d.Vector3,ae=new d.Vector3;function he(i,e,r="default"){const s=i.getView(r),{width:a,height:y}=i,M=a/y;e instanceof d.Vector3?_.copy(e):_.set(...e);const E=s.camera.getWorldPosition(ae).distanceTo(_);if(s.camera instanceof d.OrthographicCamera)return{width:a/s.camera.zoom,height:y/s.camera.zoom,factor:1,distance:E,aspect:M};{const q=s.camera.fov*Math.PI/180,L=2*Math.tan(q/2)*E,O=L*(a/y);return{width:O,height:L,factor:a/O,distance:E,aspect:M}}}function ne(i,e){i.traverse(r=>{r instanceof d.Mesh&&r.material&&(Array.isArray(r.material)?r.material:[r.material]).forEach(e)})}function ce(i,e){i.traverse(r=>{r instanceof d.Mesh&&e(r)})}exports.En3=se;exports.En3View=F;exports.coverTexture=ie;exports.dispose=Q;exports.getCurrentViewport=he;exports.traverseMaterials=ne;exports.traverseMeshes=ce;
@@ -1,4 +1,4 @@
1
- export { en3 } from './en3';
1
+ export { En3, type En3Options } from './En3';
2
2
  export { En3View, type En3ViewOptions, type En3AttachedObject3D, type En3AttachOptions, type En3ViewBeforeRenderCallback, } from './En3View';
3
3
  export { coverTexture } from './utils/coverTexture';
4
4
  export { dispose } from './utils/dispose';