mirage-engine 0.3.20 → 0.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mirage-engine.js +1433 -1225
- package/dist/mirage-engine.umd.js +18 -18
- package/dist/src/core/Mirage.d.ts +1 -1
- package/package.json +4 -4
package/dist/mirage-engine.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
1
|
+
var Ce = Object.defineProperty, Be = Object.defineProperties;
|
|
2
|
+
var de = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var jA = Object.getOwnPropertySymbols;
|
|
4
|
+
var Ee = Object.prototype.hasOwnProperty, Qe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var RA = (t, A, e) => A in t ? Ce(t, A, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[A] = e, aA = (t, A) => {
|
|
6
|
+
for (var e in A || (A = {}))
|
|
7
|
+
Ee.call(A, e) && RA(t, e, A[e]);
|
|
8
|
+
if (jA)
|
|
9
|
+
for (var e of jA(A))
|
|
10
|
+
Qe.call(A, e) && RA(t, e, A[e]);
|
|
11
|
+
return t;
|
|
12
|
+
}, qA = (t, A) => Be(t, de(A));
|
|
13
|
+
var l = (t, A, e) => (RA(t, typeof A != "symbol" ? A + "" : A, e), e);
|
|
14
|
+
var eA = (t, A, e) => new Promise((s, i) => {
|
|
15
|
+
var o = (n) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
|
|
17
|
+
g(e.next(n));
|
|
18
|
+
} catch (a) {
|
|
19
|
+
i(a);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, r = (n) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
23
|
+
g(e.throw(n));
|
|
24
|
+
} catch (a) {
|
|
25
|
+
i(a);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, g = (n) => n.done ? s(n.value) : Promise.resolve(n.value).then(o, r);
|
|
28
|
+
g((e = e.apply(t, A)).next());
|
|
29
29
|
});
|
|
30
|
-
import * as
|
|
31
|
-
const
|
|
30
|
+
import * as E from "three";
|
|
31
|
+
const iA = 5, LA = 0, mA = 1, pA = 2, ie = 3, re = 4, se = {
|
|
32
32
|
INCLUDE_TREE: "include-tree",
|
|
33
33
|
EXCLUDE_TREE: "exclude-tree",
|
|
34
34
|
INCLUDE_SELF: "include-self",
|
|
35
35
|
EXCLUDE_SELF: "exclude-self",
|
|
36
36
|
END: "end"
|
|
37
|
-
},
|
|
37
|
+
}, tA = {
|
|
38
38
|
NAME: "data-mirage-dom",
|
|
39
39
|
KEY: "mirageDom",
|
|
40
40
|
VALUES: {
|
|
41
41
|
HIDE: "hide",
|
|
42
42
|
SHOW: "show"
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, VA = {
|
|
45
45
|
TRAVELER: "traveler",
|
|
46
46
|
NATIVE: "native",
|
|
47
47
|
CAPTURE_1: "1",
|
|
@@ -54,78 +54,78 @@ const Ie = {
|
|
|
54
54
|
CAPTURE_8: "8",
|
|
55
55
|
CAPTURE_9: "9",
|
|
56
56
|
CAPTURE_10: "10"
|
|
57
|
-
},
|
|
57
|
+
}, H = {
|
|
58
58
|
NAME: "data-mirage-travel",
|
|
59
59
|
KEY: "mirageTravel",
|
|
60
|
-
VALUES:
|
|
61
|
-
MAX_LAYERS: Object.keys(
|
|
62
|
-
},
|
|
60
|
+
VALUES: VA,
|
|
61
|
+
MAX_LAYERS: Object.keys(VA).length - 1
|
|
62
|
+
}, j = {
|
|
63
63
|
NAME: "data-mirage-filter",
|
|
64
64
|
KEY: "mirageFilter",
|
|
65
|
-
VALUES:
|
|
66
|
-
},
|
|
65
|
+
VALUES: se
|
|
66
|
+
}, Z = {
|
|
67
67
|
NAME: "data-mirage-select",
|
|
68
68
|
KEY: "mirageSelect",
|
|
69
|
-
VALUES:
|
|
70
|
-
},
|
|
69
|
+
VALUES: se
|
|
70
|
+
}, ue = {
|
|
71
71
|
NAME: "data-mirage-shader",
|
|
72
72
|
KEY: "mirageShader"
|
|
73
|
-
},
|
|
73
|
+
}, ZA = {
|
|
74
74
|
NAME: "data-mirage-sandwich",
|
|
75
75
|
KEY: "mirageSandwich",
|
|
76
76
|
VALUES: {
|
|
77
77
|
FRONT: "front"
|
|
78
78
|
}
|
|
79
|
-
},
|
|
80
|
-
function
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
r: parseInt(
|
|
84
|
-
g: parseInt(
|
|
85
|
-
b: parseInt(
|
|
86
|
-
a:
|
|
79
|
+
}, DA = 0, nA = 1, fA = 2, fe = 4, SA = 8, TA = 16;
|
|
80
|
+
function we(t) {
|
|
81
|
+
const A = t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
|
|
82
|
+
return A ? {
|
|
83
|
+
r: parseInt(A[1]) / 255,
|
|
84
|
+
g: parseInt(A[2]) / 255,
|
|
85
|
+
b: parseInt(A[3]) / 255,
|
|
86
|
+
a: A[4] !== void 0 ? parseFloat(A[4]) : 1
|
|
87
87
|
} : { r: 1, g: 1, b: 1, a: 1 };
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
|
|
89
|
+
function me(t) {
|
|
90
|
+
const A = {};
|
|
91
|
+
if (t.opacity && (A.opacity = parseFloat(t.opacity)), t.backgroundColor) {
|
|
92
|
+
const e = we(t.backgroundColor);
|
|
93
|
+
A.backgroundColor = [e.r, e.g, e.b, e.a];
|
|
94
94
|
}
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
97
|
-
|
|
95
|
+
if (t.backgroundImage ? A.backgroundImage = t.backgroundImage : t.background && (A.backgroundImage = t.background), t.boxShadow && (A.boxShadow = t.boxShadow), t.borderRadius && (A.borderRadius = parseFloat(t.borderRadius)), t.width && (A.width = parseFloat(t.width)), t.height && (A.height = parseFloat(t.height)), t.transform && t.transform !== "none") {
|
|
96
|
+
const e = new DOMMatrix(t.transform);
|
|
97
|
+
A.x = e.m41, A.y = e.m42, A.z = e.m43, A.scaleX = Math.sqrt(e.m11 * e.m11 + e.m12 * e.m12 + e.m13 * e.m13), A.scaleY = Math.sqrt(e.m21 * e.m21 + e.m22 * e.m22 + e.m23 * e.m23), A.scaleZ = Math.sqrt(e.m31 * e.m31 + e.m32 * e.m32 + e.m33 * e.m33);
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return (t.left || t.right || t.top || t.bottom || t.margin || t.marginLeft || t.marginTop || t.marginRight || t.marginBottom || t.padding || t.paddingLeft || t.paddingTop || t.paddingRight || t.paddingBottom) && (A.layoutChanged = !0), A;
|
|
100
100
|
}
|
|
101
|
-
class
|
|
102
|
-
constructor(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
this.target.contains(
|
|
101
|
+
class oe {
|
|
102
|
+
constructor(A, e) {
|
|
103
|
+
l(this, "target");
|
|
104
|
+
l(this, "observer");
|
|
105
|
+
l(this, "pendingDeletions", /* @__PURE__ */ new Set());
|
|
106
|
+
l(this, "pendingStyles", /* @__PURE__ */ new Map());
|
|
107
|
+
l(this, "isDomDirty", !1);
|
|
108
|
+
l(this, "isRunning", !1);
|
|
109
|
+
l(this, "pendingMask", DA);
|
|
110
|
+
l(this, "mutationTimer", null);
|
|
111
|
+
l(this, "cssTimer", null);
|
|
112
|
+
l(this, "resizeConfig");
|
|
113
|
+
l(this, "resizeTimer", null);
|
|
114
|
+
l(this, "isResizing", !1);
|
|
115
|
+
l(this, "lastScrollX", 0);
|
|
116
|
+
l(this, "lastScrollY", 0);
|
|
117
|
+
l(this, "scrollTimer", null);
|
|
118
|
+
l(this, "onBeforeRender", /* @__PURE__ */ new Set());
|
|
119
|
+
l(this, "onLayoutChange", /* @__PURE__ */ new Set());
|
|
120
|
+
l(this, "onStyleChange", /* @__PURE__ */ new Set());
|
|
121
|
+
l(this, "onScrollChange", /* @__PURE__ */ new Set());
|
|
122
|
+
l(this, "onRender", /* @__PURE__ */ new Set());
|
|
123
|
+
l(this, "onTransitionFinished", (A) => {
|
|
124
|
+
this.target.contains(A.target) && this.mutationTimer === null && (this.cssTimer && clearTimeout(this.cssTimer), this.pendingStyles.size == 0 && (this.pendingMask |= nA | fA, this.cssTimer = window.setTimeout(() => {
|
|
125
125
|
this.isDomDirty = !0, this.cssTimer = null;
|
|
126
126
|
}, 50)));
|
|
127
127
|
});
|
|
128
|
-
|
|
128
|
+
l(this, "onWindowResize", () => {
|
|
129
129
|
if (!this.resizeConfig.enabled) {
|
|
130
130
|
this.isDomDirty = !0;
|
|
131
131
|
return;
|
|
@@ -134,41 +134,41 @@ class Be {
|
|
|
134
134
|
this.isDomDirty = !0, this.resizeConfig.onEnd && this.resizeConfig.onEnd(), this.isResizing = !1, this.resizeTimer = null;
|
|
135
135
|
}, this.resizeConfig.delay);
|
|
136
136
|
});
|
|
137
|
-
|
|
137
|
+
l(this, "renderLoop", () => {
|
|
138
138
|
if (!this.isRunning)
|
|
139
139
|
return;
|
|
140
|
-
this.onBeforeRender.forEach((
|
|
141
|
-
const
|
|
142
|
-
(
|
|
143
|
-
this.pendingMask |=
|
|
144
|
-
}, 150)), this.pendingStyles.size > 0 && (this.onStyleChange.forEach((
|
|
140
|
+
this.onBeforeRender.forEach((s) => s()), this.isDomDirty && (this.isDomDirty = !1, this.onLayoutChange.forEach((s) => s(this.pendingMask, this.pendingDeletions)), this.pendingDeletions.clear(), this.pendingMask = DA);
|
|
141
|
+
const A = window.scrollX, e = window.scrollY;
|
|
142
|
+
(A !== this.lastScrollX || e !== this.lastScrollY) && (this.onScrollChange.forEach((s) => s(A, e)), this.lastScrollX = A, this.lastScrollY = e, this.scrollTimer && clearTimeout(this.scrollTimer), this.scrollTimer = window.setTimeout(() => {
|
|
143
|
+
this.pendingMask |= nA, this.isDomDirty = !0, this.scrollTimer = null;
|
|
144
|
+
}, 150)), this.pendingStyles.size > 0 && (this.onStyleChange.forEach((s) => s(this.pendingStyles)), this.pendingStyles.clear()), this.onRender.forEach((s) => s()), requestAnimationFrame(this.renderLoop);
|
|
145
145
|
});
|
|
146
|
-
var
|
|
147
|
-
this.target =
|
|
148
|
-
const
|
|
149
|
-
|
|
146
|
+
var i, o;
|
|
147
|
+
this.target = A;
|
|
148
|
+
const s = (i = e.resizeDebounce) != null ? i : !0;
|
|
149
|
+
s === !1 ? this.resizeConfig = { enabled: !1, delay: 0 } : s === !0 ? this.resizeConfig = { enabled: !0, delay: 150 } : this.resizeConfig = {
|
|
150
150
|
enabled: !0,
|
|
151
|
-
delay: (
|
|
152
|
-
onStart:
|
|
153
|
-
onEnd:
|
|
154
|
-
}, this.observer = new MutationObserver((
|
|
155
|
-
let
|
|
156
|
-
for (const
|
|
157
|
-
if (
|
|
158
|
-
|
|
159
|
-
|
|
151
|
+
delay: (o = s.delay) != null ? o : 150,
|
|
152
|
+
onStart: s.onStart,
|
|
153
|
+
onEnd: s.onEnd
|
|
154
|
+
}, this.observer = new MutationObserver((r) => {
|
|
155
|
+
let g = DA;
|
|
156
|
+
for (const n of r)
|
|
157
|
+
if (n.type === "childList")
|
|
158
|
+
g |= SA, n.removedNodes.length > 0 && n.removedNodes.forEach((a) => {
|
|
159
|
+
a instanceof HTMLElement && this.pendingDeletions.add(a);
|
|
160
160
|
});
|
|
161
|
-
else if (
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
this.pendingStyles.set(
|
|
161
|
+
else if (n.type === "attributes")
|
|
162
|
+
if (n.attributeName === "style") {
|
|
163
|
+
g |= nA | fA;
|
|
164
|
+
const a = n.target, I = me(a.style);
|
|
165
|
+
this.pendingStyles.set(a, I);
|
|
166
166
|
} else
|
|
167
|
-
|
|
167
|
+
n.attributeName === "class" ? g |= nA | fA : n.attributeName && n.attributeName.startsWith("data-") && (g |= nA | fA, n.attributeName.startsWith("data-mirage") && (g |= SA));
|
|
168
168
|
else
|
|
169
|
-
|
|
170
|
-
if (
|
|
171
|
-
if (this.pendingMask |=
|
|
169
|
+
n.type === "characterData" && (g |= TA | nA);
|
|
170
|
+
if (g !== DA) {
|
|
171
|
+
if (this.pendingMask |= g, g & SA) {
|
|
172
172
|
this.clearTimers(), this.isDomDirty = !0;
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
@@ -193,187 +193,187 @@ class Be {
|
|
|
193
193
|
this.mutationTimer && (clearTimeout(this.mutationTimer), this.mutationTimer = null), this.cssTimer && (clearTimeout(this.cssTimer), this.cssTimer = null), this.scrollTimer && (clearTimeout(this.scrollTimer), this.scrollTimer = null);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
const
|
|
196
|
+
const q = 1, lA = 2, L = {
|
|
197
197
|
BASE: 0,
|
|
198
198
|
SELECTED: 1,
|
|
199
|
-
getCaptureLayer: (
|
|
199
|
+
getCaptureLayer: (t) => 31 - t,
|
|
200
200
|
HIDDEN: 31
|
|
201
|
-
},
|
|
202
|
-
class
|
|
201
|
+
}, PA = Object.values(j.VALUES);
|
|
202
|
+
class ae {
|
|
203
203
|
/**
|
|
204
204
|
* Calculates or retrieves the exact alphabetic baseline (in pixels) for the given font.
|
|
205
205
|
* @param font CSS font shorthand string (e.g., "400 16px Inter")
|
|
206
206
|
* @returns Baseline Y offset in pixels
|
|
207
207
|
*/
|
|
208
|
-
static getBaseline(
|
|
209
|
-
if (this.cache.has(
|
|
210
|
-
return this.cache.get(
|
|
211
|
-
const
|
|
212
|
-
return this.cache.set(
|
|
208
|
+
static getBaseline(A) {
|
|
209
|
+
if (this.cache.has(A))
|
|
210
|
+
return this.cache.get(A);
|
|
211
|
+
const e = this.calculateBaselineFromDOM(A);
|
|
212
|
+
return this.cache.set(A, e), e;
|
|
213
213
|
}
|
|
214
|
-
static calculateBaselineFromDOM(
|
|
214
|
+
static calculateBaselineFromDOM(A) {
|
|
215
215
|
if (typeof document == "undefined")
|
|
216
216
|
return 0;
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
return document.body.removeChild(
|
|
217
|
+
const e = document.createElement("div"), s = document.createElement("span"), i = document.createElement("img");
|
|
218
|
+
e.style.visibility = "hidden", e.style.position = "absolute", e.style.top = "0px", e.style.left = "0px", e.style.font = A, e.style.margin = "0", e.style.padding = "0", e.style.border = "none", s.style.margin = "0", s.style.padding = "0", s.style.border = "none", s.style.lineHeight = "normal", i.width = 1, i.height = 1, i.style.verticalAlign = "baseline", s.appendChild(document.createTextNode("Hidden Text")), e.appendChild(s), e.appendChild(i), document.body.appendChild(e);
|
|
219
|
+
const o = i.offsetTop - s.offsetTop;
|
|
220
|
+
return document.body.removeChild(e), o;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
|
|
224
|
-
class
|
|
225
|
-
constructor(
|
|
223
|
+
l(ae, "cache", /* @__PURE__ */ new Map());
|
|
224
|
+
class pe extends E.MeshBasicMaterial {
|
|
225
|
+
constructor(e, s, i, o, r = 2) {
|
|
226
226
|
super({
|
|
227
227
|
transparent: !0,
|
|
228
|
-
side:
|
|
228
|
+
side: E.FrontSide,
|
|
229
229
|
color: 16777215
|
|
230
230
|
});
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
l(this, "canvas");
|
|
232
|
+
l(this, "ctx");
|
|
233
|
+
l(this, "qualityFactor");
|
|
234
234
|
if (this.canvas = document.createElement("canvas"), this.ctx = this.canvas.getContext("2d"), !this.ctx)
|
|
235
235
|
throw new Error("[Mirage] Failed to create canvas context");
|
|
236
|
-
this.qualityFactor =
|
|
237
|
-
}
|
|
238
|
-
wrapText(
|
|
239
|
-
const
|
|
240
|
-
`),
|
|
241
|
-
return
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
-
|
|
236
|
+
this.qualityFactor = r, this.map = new E.CanvasTexture(this.canvas), this.map.colorSpace = E.LinearSRGBColorSpace, this.map.minFilter = E.LinearFilter, this.map.magFilter = E.LinearFilter, this.updateText(e, s, i, o);
|
|
237
|
+
}
|
|
238
|
+
wrapText(e, s) {
|
|
239
|
+
const i = e.split(`
|
|
240
|
+
`), o = [];
|
|
241
|
+
return i.forEach((r) => {
|
|
242
|
+
const g = r.match(/[^\s\-]+\-?|\-|\s+/g) || [];
|
|
243
|
+
if (g.length === 0) {
|
|
244
|
+
o.push("");
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
|
-
let
|
|
248
|
-
for (let
|
|
249
|
-
const
|
|
250
|
-
this.ctx.measureText(
|
|
247
|
+
let n = g[0];
|
|
248
|
+
for (let a = 1; a < g.length; a++) {
|
|
249
|
+
const I = g[a];
|
|
250
|
+
this.ctx.measureText(n + I).width <= s + 2 ? n += I : (n && o.push(n), n = I.trimStart());
|
|
251
251
|
}
|
|
252
|
-
|
|
253
|
-
}),
|
|
254
|
-
}
|
|
255
|
-
updateText(
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
this.canvas.width !==
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
const
|
|
252
|
+
n && o.push(n);
|
|
253
|
+
}), o;
|
|
254
|
+
}
|
|
255
|
+
updateText(e, s, i, o, r) {
|
|
256
|
+
r !== void 0 && (this.qualityFactor = r);
|
|
257
|
+
const n = (window.devicePixelRatio || 1) * this.qualityFactor, a = i * n, I = o * n;
|
|
258
|
+
this.canvas.width !== a || this.canvas.height !== I ? (this.canvas.width = a, this.canvas.height = I) : this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), this.ctx.setTransform(n, 0, 0, n, 0, 0), this.ctx.font = s.font, this.ctx.fillStyle = s.color, this.ctx.textBaseline = "alphabetic", this.ctx.globalAlpha = 1;
|
|
259
|
+
const c = this.wrapText(e, i), h = s.lineHeight, B = ae.getBaseline(s.font);
|
|
260
|
+
c.forEach((C, w) => {
|
|
261
|
+
const Q = w * h + B;
|
|
262
262
|
let b = 0;
|
|
263
|
-
|
|
263
|
+
s.textAlign === "center" ? b = i / 2 : s.textAlign === "right" && (b = i), this.ctx.textAlign = s.textAlign, this.ctx.fillText(C, b, Q);
|
|
264
264
|
}), this.map && (this.map.needsUpdate = !0);
|
|
265
265
|
}
|
|
266
266
|
dispose() {
|
|
267
267
|
this.map && this.map.dispose(), super.dispose();
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
if (typeof
|
|
272
|
-
return
|
|
273
|
-
const
|
|
274
|
-
return typeof
|
|
270
|
+
function hA(t, A = 0) {
|
|
271
|
+
if (typeof t == "number")
|
|
272
|
+
return t;
|
|
273
|
+
const e = parseFloat(t) || 0;
|
|
274
|
+
return typeof t == "string" && t.includes("%") ? e / 100 * A : e;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
if (!
|
|
278
|
-
return { color: new
|
|
279
|
-
const
|
|
276
|
+
function CA(t) {
|
|
277
|
+
if (!t || t === "transparent")
|
|
278
|
+
return { color: new E.Color(16777215), alpha: 0 };
|
|
279
|
+
const A = t.match(
|
|
280
280
|
/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/
|
|
281
281
|
);
|
|
282
|
-
if (
|
|
283
|
-
const
|
|
284
|
-
return { color: new
|
|
282
|
+
if (A) {
|
|
283
|
+
const e = parseInt(A[1], 10), s = parseInt(A[2], 10), i = parseInt(A[3], 10), o = A[4] !== void 0 ? parseFloat(A[4]) : 1;
|
|
284
|
+
return { color: new E.Color(`rgb(${e}, ${s}, ${i})`), alpha: o };
|
|
285
285
|
}
|
|
286
|
-
return { color: new
|
|
286
|
+
return { color: new E.Color(t), alpha: 1 };
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
const
|
|
290
|
-
let
|
|
291
|
-
for (let
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
|
|
295
|
-
else if (
|
|
296
|
-
|
|
297
|
-
else if (
|
|
298
|
-
|
|
288
|
+
function ne(t) {
|
|
289
|
+
const A = [];
|
|
290
|
+
let e = "", s = 0;
|
|
291
|
+
for (let i = 0; i < t.length; i++) {
|
|
292
|
+
const o = t[i];
|
|
293
|
+
if (o === "(")
|
|
294
|
+
s++;
|
|
295
|
+
else if (o === ")")
|
|
296
|
+
s--;
|
|
297
|
+
else if (o === "," && s === 0) {
|
|
298
|
+
A.push(e.trim()), e = "";
|
|
299
299
|
continue;
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
e += o;
|
|
302
302
|
}
|
|
303
|
-
return
|
|
303
|
+
return e && A.push(e.trim()), A;
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
if (!
|
|
305
|
+
function ye(t) {
|
|
306
|
+
if (!t || typeof t != "string" || !t.includes("linear-gradient"))
|
|
307
307
|
return null;
|
|
308
|
-
const
|
|
309
|
-
if (!
|
|
308
|
+
const A = t.match(/linear-gradient\((.*)\)/);
|
|
309
|
+
if (!A)
|
|
310
310
|
return null;
|
|
311
|
-
const
|
|
312
|
-
let
|
|
313
|
-
const
|
|
314
|
-
if (
|
|
315
|
-
|
|
316
|
-
else if (
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
const
|
|
321
|
-
for (let
|
|
322
|
-
const
|
|
323
|
-
let
|
|
324
|
-
if (
|
|
325
|
-
const
|
|
326
|
-
(
|
|
311
|
+
const e = A[1], s = ne(e);
|
|
312
|
+
let i = Math.PI, o = 0;
|
|
313
|
+
const r = s[0].trim();
|
|
314
|
+
if (r.startsWith("to "))
|
|
315
|
+
r === "to top" ? i = 0 : r === "to right" ? i = Math.PI / 2 : r === "to bottom" ? i = Math.PI : r === "to left" ? i = Math.PI * 1.5 : r === "to top right" || r === "to right top" ? i = Math.PI / 4 : r === "to bottom right" || r === "to right bottom" ? i = Math.PI * 0.75 : r === "to bottom left" || r === "to left bottom" ? i = Math.PI * 1.25 : (r === "to top left" || r === "to left top") && (i = Math.PI * 1.75), o = 1;
|
|
316
|
+
else if (r.endsWith("deg") || r.endsWith("rad") || r.endsWith("turn")) {
|
|
317
|
+
const n = parseFloat(r);
|
|
318
|
+
r.endsWith("deg") ? i = n * (Math.PI / 180) : r.endsWith("rad") ? i = n : r.endsWith("turn") && (i = n * Math.PI * 2), o = 1;
|
|
319
|
+
}
|
|
320
|
+
const g = [];
|
|
321
|
+
for (let n = o; n < s.length && !(g.length >= 8); n++) {
|
|
322
|
+
const a = s[n].trim(), I = a.lastIndexOf(" ");
|
|
323
|
+
let c = a, h = null;
|
|
324
|
+
if (I !== -1 && !a.endsWith(")")) {
|
|
325
|
+
const C = a.substring(I + 1);
|
|
326
|
+
(C.endsWith("%") || C.endsWith("px") || !isNaN(parseFloat(C))) && (c = a.substring(0, I).trim(), h = C);
|
|
327
327
|
}
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
color:
|
|
331
|
-
alpha:
|
|
332
|
-
rawStop:
|
|
328
|
+
const B = CA(c);
|
|
329
|
+
g.push({
|
|
330
|
+
color: B.color,
|
|
331
|
+
alpha: B.alpha,
|
|
332
|
+
rawStop: h,
|
|
333
333
|
stop: 0
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
if (
|
|
337
|
-
for (let
|
|
338
|
-
a
|
|
339
|
-
|
|
340
|
-
let
|
|
341
|
-
for (let
|
|
342
|
-
if (a
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
345
|
-
const
|
|
346
|
-
for (let
|
|
347
|
-
|
|
336
|
+
if (g.length > 0) {
|
|
337
|
+
for (let a = 0; a < g.length; a++)
|
|
338
|
+
g[a].rawStop !== null && (g[a].stop = parseFloat(g[a].rawStop) / 100);
|
|
339
|
+
g[0].rawStop === null && (g[0].stop = 0), g.length > 1 && g[g.length - 1].rawStop === null && (g[g.length - 1].stop = 1);
|
|
340
|
+
let n = 0;
|
|
341
|
+
for (let a = 1; a < g.length; a++)
|
|
342
|
+
if (g[a].rawStop !== null || a === g.length - 1) {
|
|
343
|
+
const I = a - n;
|
|
344
|
+
if (I > 1) {
|
|
345
|
+
const c = g[n].stop, B = (g[a].stop - c) / I;
|
|
346
|
+
for (let C = 1; C < I; C++)
|
|
347
|
+
g[n + C].stop = c + B * C;
|
|
348
348
|
}
|
|
349
|
-
|
|
349
|
+
n = a;
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
return { angle:
|
|
352
|
+
return { angle: i, stops: g };
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
if (!
|
|
354
|
+
function De(t) {
|
|
355
|
+
if (!t || t === "none")
|
|
356
356
|
return null;
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
357
|
+
const A = ne(t);
|
|
358
|
+
if (A.length === 0)
|
|
359
359
|
return null;
|
|
360
|
-
const
|
|
361
|
-
let
|
|
362
|
-
if (
|
|
363
|
-
const
|
|
364
|
-
(
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
const
|
|
368
|
-
return { offsetX:
|
|
360
|
+
const e = A[0].trim(), s = /(rgba?\([^)]+\)|#[0-9a-fA-F]+|[a-zA-Z]+)/, i = e.match(s);
|
|
361
|
+
let o = "transparent", r = e;
|
|
362
|
+
if (i && i[1] !== "inset") {
|
|
363
|
+
const B = i[1];
|
|
364
|
+
(B.startsWith("rgb") || B.startsWith("#") || B === "black" || B === "white" || B === "transparent") && (o = B, r = e.replace(B, "").trim());
|
|
365
|
+
}
|
|
366
|
+
r = r.replace("inset", "").trim();
|
|
367
|
+
const g = r.split(/\s+/).map((B) => parseFloat(B) || 0), n = g[0] || 0, a = g[1] || 0, I = g[2] || 0, c = g[3] || 0, h = CA(o);
|
|
368
|
+
return { offsetX: n, offsetY: a, blurRadius: I, spreadRadius: c, color: h.color, alpha: h.alpha };
|
|
369
369
|
}
|
|
370
|
-
const
|
|
370
|
+
const Se = `varying vec2 vUv;
|
|
371
371
|
varying vec4 vScreenPos;
|
|
372
372
|
void main() {
|
|
373
373
|
vUv = uv;
|
|
374
374
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
375
375
|
vScreenPos = gl_Position;
|
|
376
|
-
}`,
|
|
376
|
+
}`, ve = `varying vec2 vUv;
|
|
377
377
|
uniform vec2 uSize;
|
|
378
378
|
uniform vec2 uMeshSize;
|
|
379
379
|
uniform vec4 uShadowColor;
|
|
@@ -532,388 +532,395 @@ void main() {
|
|
|
532
532
|
|
|
533
533
|
// #include <colorspace_fragment>
|
|
534
534
|
}
|
|
535
|
-
`,
|
|
535
|
+
`, be = `uniform sampler2D uTexture;
|
|
536
536
|
varying vec4 vScreenPos;
|
|
537
537
|
uniform vec2 uTextureRepeat;
|
|
538
|
-
uniform vec2 uTextureOffset;`,
|
|
538
|
+
uniform vec2 uTextureOffset;`, Ne = `vec2 screenUv = (vScreenPos.xy / vScreenPos.w) * 0.5 + 0.5;
|
|
539
539
|
vec2 resultUv = screenUv;
|
|
540
540
|
|
|
541
|
-
`,
|
|
542
|
-
baseColor = blendSrcOver(baseColor, texColor);`,
|
|
543
|
-
vertexShader:
|
|
544
|
-
fragmentShader:
|
|
541
|
+
`, Me = `vec4 texColor = texture2D(uTexture, resultUv);
|
|
542
|
+
baseColor = blendSrcOver(baseColor, texColor);`, $A = {
|
|
543
|
+
vertexShader: Se,
|
|
544
|
+
fragmentShader: ve
|
|
545
545
|
}, Ae = {
|
|
546
|
-
declChunk:
|
|
547
|
-
uvChunk:
|
|
548
|
-
baseColorChunk:
|
|
546
|
+
declChunk: be,
|
|
547
|
+
uvChunk: Ne,
|
|
548
|
+
baseColorChunk: Me
|
|
549
549
|
};
|
|
550
|
-
function
|
|
551
|
-
var
|
|
552
|
-
const
|
|
553
|
-
let
|
|
554
|
-
const
|
|
555
|
-
if (
|
|
556
|
-
for (const [
|
|
557
|
-
typeof
|
|
558
|
-
`,
|
|
559
|
-
`,
|
|
560
|
-
`,
|
|
561
|
-
`,
|
|
562
|
-
`,
|
|
563
|
-
`,
|
|
564
|
-
const
|
|
565
|
-
` +
|
|
566
|
-
`,
|
|
550
|
+
function Re(t, A, e, s = null, i) {
|
|
551
|
+
var U;
|
|
552
|
+
const o = s !== null || !!t.imageSrc;
|
|
553
|
+
let r = "";
|
|
554
|
+
const g = {};
|
|
555
|
+
if (i != null && i.uniforms)
|
|
556
|
+
for (const [S, D] of Object.entries(i.uniforms))
|
|
557
|
+
typeof D == "number" ? (r += `uniform float ${S};
|
|
558
|
+
`, g[S] = { value: D }) : Array.isArray(D) ? D.length === 2 ? (r += `uniform vec2 ${S};
|
|
559
|
+
`, g[S] = { value: new E.Vector2(...D) }) : D.length === 3 ? (r += `uniform vec3 ${S};
|
|
560
|
+
`, g[S] = { value: new E.Vector3(...D) }) : D.length === 4 && (r += `uniform vec4 ${S};
|
|
561
|
+
`, g[S] = { value: new E.Vector4(...D) }) : D && typeof D == "object" && D.type ? (r += `uniform ${D.type} ${S};
|
|
562
|
+
`, g[S] = D) : (r += `uniform float ${S};
|
|
563
|
+
`, g[S] = { value: D });
|
|
564
|
+
const n = i !== void 0, a = (o || n ? Ae.declChunk : "") + `
|
|
565
|
+
` + r, I = `vec2 screenUv = (vScreenPos.xy / vScreenPos.w) * 0.5 + 0.5;
|
|
566
|
+
`, c = t.isTraveler ? `vec2 resultUv = screenUv;
|
|
567
567
|
` : `vec2 localUv = (p / uSize) + 0.5;
|
|
568
568
|
vec2 resultUv = localUv * uTextureRepeat + uTextureOffset;
|
|
569
|
-
`,
|
|
570
|
-
uSize: { value: new
|
|
571
|
-
uMeshSize: { value: new
|
|
572
|
-
uShadowColor: { value: new
|
|
573
|
-
uShadowOffset: { value: new
|
|
569
|
+
`, h = o || n ? I + c + ((i == null ? void 0 : i.uvModifier) || "") : "", B = o || n ? Ae.baseColorChunk : "", C = (i == null ? void 0 : i.colorModifier) || "", w = $A.fragmentShader.replace("#INJECT_DECLARATIONS", a).replace("#INJECT_UV_MODIFIER", h).replace("#INJECT_BASE_COLOR", B).replace("#INJECT_COLOR_MODIFIER", C), Q = CA(t.backgroundColor), b = CA(t.borderColor), f = {
|
|
570
|
+
uSize: { value: new E.Vector2(A, e) },
|
|
571
|
+
uMeshSize: { value: new E.Vector2(A, e) },
|
|
572
|
+
uShadowColor: { value: new E.Vector4(0, 0, 0, 0) },
|
|
573
|
+
uShadowOffset: { value: new E.Vector2(0, 0) },
|
|
574
574
|
uShadowBlur: { value: 0 },
|
|
575
575
|
uShadowSpread: { value: 0 },
|
|
576
576
|
uBgColor: {
|
|
577
|
-
value: new
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
577
|
+
value: new E.Vector4(
|
|
578
|
+
Q.color.r,
|
|
579
|
+
Q.color.g,
|
|
580
|
+
Q.color.b,
|
|
581
|
+
Q.alpha
|
|
582
582
|
)
|
|
583
583
|
},
|
|
584
584
|
uBorderColor: {
|
|
585
|
-
value: new
|
|
585
|
+
value: new E.Vector4(
|
|
586
586
|
b.color.r,
|
|
587
587
|
b.color.g,
|
|
588
588
|
b.color.b,
|
|
589
589
|
b.alpha
|
|
590
590
|
)
|
|
591
591
|
},
|
|
592
|
-
uBorderRadius: { value: new
|
|
593
|
-
uBorderWidth: { value:
|
|
594
|
-
uOpacity: { value: (
|
|
592
|
+
uBorderRadius: { value: new E.Vector4(0, 0, 0, 0) },
|
|
593
|
+
uBorderWidth: { value: hA(t.borderWidth) },
|
|
594
|
+
uOpacity: { value: (U = t.opacity) != null ? U : 1 },
|
|
595
595
|
uTexture: { value: null },
|
|
596
|
-
uTextureRepeat: { value: new
|
|
597
|
-
uTextureOffset: { value: new
|
|
596
|
+
uTextureRepeat: { value: new E.Vector2(1, 1) },
|
|
597
|
+
uTextureOffset: { value: new E.Vector2(0, 0) },
|
|
598
598
|
uGradientCount: { value: 0 },
|
|
599
599
|
uGradientAngle: { value: 0 },
|
|
600
600
|
uGradientColors: {
|
|
601
|
-
value: Array.from({ length: 8 }, () => new
|
|
601
|
+
value: Array.from({ length: 8 }, () => new E.Vector4(0, 0, 0, 0))
|
|
602
602
|
},
|
|
603
603
|
uGradientStops: { value: new Float32Array(8) }
|
|
604
604
|
};
|
|
605
|
-
|
|
606
|
-
const
|
|
607
|
-
uniforms:
|
|
608
|
-
vertexShader:
|
|
609
|
-
fragmentShader:
|
|
605
|
+
ge(f.uBorderRadius.value, t.borderRadius, Math.min(A, e)), o && (f.uTexture.value = s);
|
|
606
|
+
const y = new E.ShaderMaterial({
|
|
607
|
+
uniforms: aA(aA({}, f), g),
|
|
608
|
+
vertexShader: $A.vertexShader,
|
|
609
|
+
fragmentShader: w,
|
|
610
610
|
transparent: !0,
|
|
611
|
-
side:
|
|
611
|
+
side: E.FrontSide
|
|
612
612
|
// for better performance
|
|
613
613
|
});
|
|
614
|
-
return
|
|
614
|
+
return t.backgroundImage && YA(y, { backgroundImage: t.backgroundImage }), y;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
width:
|
|
620
|
-
height:
|
|
621
|
-
borderRadius:
|
|
622
|
-
borderWidth:
|
|
623
|
-
backgroundColor:
|
|
624
|
-
borderColor:
|
|
625
|
-
opacity:
|
|
626
|
-
texture:
|
|
627
|
-
backgroundImage:
|
|
628
|
-
boxShadow:
|
|
616
|
+
function xe(t, A, e, s, i) {
|
|
617
|
+
const o = hA(A.borderWidth);
|
|
618
|
+
YA(t, {
|
|
619
|
+
width: e,
|
|
620
|
+
height: s,
|
|
621
|
+
borderRadius: A.borderRadius,
|
|
622
|
+
borderWidth: o,
|
|
623
|
+
backgroundColor: A.backgroundColor,
|
|
624
|
+
borderColor: A.borderColor,
|
|
625
|
+
opacity: A.opacity,
|
|
626
|
+
texture: i,
|
|
627
|
+
backgroundImage: A.backgroundImage,
|
|
628
|
+
boxShadow: A.boxShadow
|
|
629
629
|
});
|
|
630
630
|
}
|
|
631
|
-
function
|
|
632
|
-
var
|
|
633
|
-
if (
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
if (
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
}
|
|
641
|
-
if (
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
}
|
|
645
|
-
if (
|
|
646
|
-
if (Array.isArray(
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
631
|
+
function YA(t, A) {
|
|
632
|
+
var s, i, o;
|
|
633
|
+
if (A.boxShadow !== void 0) {
|
|
634
|
+
const r = De(A.boxShadow);
|
|
635
|
+
r ? (t.uniforms.uShadowColor.value.set(r.color.r, r.color.g, r.color.b, r.alpha), t.uniforms.uShadowOffset.value.set(r.offsetX, r.offsetY), t.uniforms.uShadowBlur.value = r.blurRadius, t.uniforms.uShadowSpread.value = r.spreadRadius, t.userData.shadowPadding = r.blurRadius + r.spreadRadius + Math.max(Math.abs(r.offsetX), Math.abs(r.offsetY))) : (t.uniforms.uShadowColor.value.w = 0, t.userData.shadowPadding = 0);
|
|
636
|
+
}
|
|
637
|
+
if (A.width !== void 0 && A.height !== void 0 && t.uniforms.uSize.value.set(A.width, A.height), t.uniforms.uMeshSize) {
|
|
638
|
+
const r = t.userData.shadowPadding || 0, g = A.width !== void 0 ? A.width : t.uniforms.uSize.value.x, n = A.height !== void 0 ? A.height : t.uniforms.uSize.value.y;
|
|
639
|
+
t.uniforms.uMeshSize.value.set(g + r * 2, n + r * 2);
|
|
640
|
+
}
|
|
641
|
+
if (A.borderRadius !== void 0) {
|
|
642
|
+
const r = A.width !== void 0 && A.height !== void 0 ? Math.min(A.width, A.height) : Math.min(t.uniforms.uSize.value.x, t.uniforms.uSize.value.y);
|
|
643
|
+
ge(t.uniforms.uBorderRadius.value, A.borderRadius, r);
|
|
644
|
+
}
|
|
645
|
+
if (A.borderWidth !== void 0 && (t.uniforms.uBorderWidth.value = A.borderWidth), A.backgroundColor !== void 0)
|
|
646
|
+
if (Array.isArray(A.backgroundColor)) {
|
|
647
|
+
const r = A.backgroundColor[3] !== void 0 ? A.backgroundColor[3] : t.uniforms.uBgColor.value.w;
|
|
648
|
+
t.uniforms.uBgColor.value.set(
|
|
649
|
+
A.backgroundColor[0],
|
|
650
|
+
A.backgroundColor[1],
|
|
651
|
+
A.backgroundColor[2],
|
|
652
|
+
r
|
|
653
653
|
);
|
|
654
|
-
} else if (typeof
|
|
655
|
-
const
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
654
|
+
} else if (typeof A.backgroundColor == "string") {
|
|
655
|
+
const r = CA(A.backgroundColor);
|
|
656
|
+
t.uniforms.uBgColor.value.set(
|
|
657
|
+
r.color.r,
|
|
658
|
+
r.color.g,
|
|
659
|
+
r.color.b,
|
|
660
|
+
r.alpha
|
|
661
661
|
);
|
|
662
662
|
} else {
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
663
|
+
const r = t.uniforms.uBgColor.value.w;
|
|
664
|
+
t.uniforms.uBgColor.value.set(
|
|
665
|
+
A.backgroundColor.r,
|
|
666
|
+
A.backgroundColor.g,
|
|
667
|
+
A.backgroundColor.b,
|
|
668
|
+
r
|
|
669
669
|
);
|
|
670
670
|
}
|
|
671
|
-
if (
|
|
672
|
-
if (Array.isArray(
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
671
|
+
if (A.borderColor !== void 0)
|
|
672
|
+
if (Array.isArray(A.borderColor)) {
|
|
673
|
+
const r = t.uniforms.uBorderColor.value.w;
|
|
674
|
+
t.uniforms.uBorderColor.value.set(
|
|
675
|
+
A.borderColor[0],
|
|
676
|
+
A.borderColor[1],
|
|
677
|
+
A.borderColor[2],
|
|
678
|
+
r
|
|
679
679
|
);
|
|
680
|
-
} else if (typeof
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
680
|
+
} else if (typeof A.borderColor == "string") {
|
|
681
|
+
const r = CA(A.borderColor);
|
|
682
|
+
t.uniforms.uBorderColor.value.set(
|
|
683
|
+
r.color.r,
|
|
684
|
+
r.color.g,
|
|
685
|
+
r.color.b,
|
|
686
|
+
r.alpha
|
|
687
687
|
);
|
|
688
688
|
} else {
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
689
|
+
const r = t.uniforms.uBorderColor.value.w;
|
|
690
|
+
t.uniforms.uBorderColor.value.set(
|
|
691
|
+
A.borderColor.r,
|
|
692
|
+
A.borderColor.g,
|
|
693
|
+
A.borderColor.b,
|
|
694
|
+
r
|
|
695
695
|
);
|
|
696
696
|
}
|
|
697
|
-
|
|
698
|
-
const
|
|
699
|
-
if (
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
702
|
-
const
|
|
703
|
-
if (
|
|
704
|
-
const
|
|
705
|
-
|
|
697
|
+
A.opacity !== void 0 && (t.uniforms.uOpacity.value = A.opacity), A.bgOpacity !== void 0 && (t.uniforms.uBgColor.value.w = A.bgOpacity), A.borderOpacity !== void 0 && (t.uniforms.uBorderColor.value.w = A.borderOpacity), t.uniforms.uTexture && A.texture !== void 0 && (t.uniforms.uTexture.value = A.texture);
|
|
698
|
+
const e = A.texture !== void 0 ? A.texture : (s = t.uniforms.uTexture) == null ? void 0 : s.value;
|
|
699
|
+
if (e && (e.image instanceof ImageBitmap || e.image instanceof HTMLImageElement || e.image instanceof HTMLCanvasElement)) {
|
|
700
|
+
const r = e.image.naturalWidth || e.image.videoWidth || e.image.width, g = e.image.naturalHeight || e.image.videoHeight || e.image.height, n = (i = A.width) != null ? i : t.uniforms.uSize.value.x, a = (o = A.height) != null ? o : t.uniforms.uSize.value.y;
|
|
701
|
+
if (r && g && n && a) {
|
|
702
|
+
const I = r / g, c = n / a;
|
|
703
|
+
if (I > c) {
|
|
704
|
+
const h = c / I;
|
|
705
|
+
t.uniforms.uTextureRepeat.value.set(h, 1), t.uniforms.uTextureOffset.value.set((1 - h) / 2, 0);
|
|
706
706
|
} else {
|
|
707
|
-
const
|
|
708
|
-
|
|
707
|
+
const h = I / c;
|
|
708
|
+
t.uniforms.uTextureRepeat.value.set(1, h), t.uniforms.uTextureOffset.value.set(0, (1 - h) / 2);
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
711
|
} else
|
|
712
|
-
|
|
713
|
-
if (
|
|
714
|
-
const
|
|
715
|
-
if (
|
|
716
|
-
|
|
717
|
-
for (let
|
|
718
|
-
if (
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
),
|
|
712
|
+
t.uniforms.uTextureRepeat && (t.uniforms.uTextureRepeat.value.set(1, 1), t.uniforms.uTextureOffset.value.set(0, 0));
|
|
713
|
+
if (A.backgroundImage !== void 0) {
|
|
714
|
+
const r = ye(A.backgroundImage);
|
|
715
|
+
if (r) {
|
|
716
|
+
t.uniforms.uGradientCount.value = r.stops.length, t.uniforms.uGradientAngle.value = r.angle;
|
|
717
|
+
for (let g = 0; g < 8; g++)
|
|
718
|
+
if (g < r.stops.length) {
|
|
719
|
+
const n = r.stops[g];
|
|
720
|
+
t.uniforms.uGradientColors.value[g].set(
|
|
721
|
+
n.color.r,
|
|
722
|
+
n.color.g,
|
|
723
|
+
n.color.b,
|
|
724
|
+
n.alpha
|
|
725
|
+
), t.uniforms.uGradientStops.value[g] = n.stop;
|
|
726
726
|
} else
|
|
727
|
-
|
|
727
|
+
t.uniforms.uGradientColors.value[g].set(0, 0, 0, 0), t.uniforms.uGradientStops.value[g] = 1;
|
|
728
728
|
} else
|
|
729
|
-
|
|
729
|
+
t.uniforms.uGradientCount.value = 0;
|
|
730
730
|
}
|
|
731
|
-
for (const
|
|
732
|
-
|
|
731
|
+
for (const r of Object.keys(A))
|
|
732
|
+
r !== "width" && r !== "height" && r !== "borderRadius" && r !== "borderWidth" && r !== "backgroundColor" && r !== "borderColor" && r !== "opacity" && r !== "bgOpacity" && r !== "borderOpacity" && r !== "texture" && r !== "backgroundImage" && r !== "boxShadow" && t.uniforms[r] !== void 0 && (t.uniforms[r].value !== void 0 && t.uniforms[r].value !== null && typeof t.uniforms[r].value.set == "function" ? Array.isArray(A[r]) ? t.uniforms[r].value.set(...A[r]) : A[r] !== void 0 && (A[r].copy ? t.uniforms[r].value.copy(A[r]) : t.uniforms[r].value = A[r]) : t.uniforms[r].value = A[r]);
|
|
733
733
|
}
|
|
734
|
-
function
|
|
735
|
-
var
|
|
736
|
-
if (
|
|
737
|
-
|
|
734
|
+
function ge(t, A, e = 0) {
|
|
735
|
+
var n, a, I, c;
|
|
736
|
+
if (A == null) {
|
|
737
|
+
t.set(0, 0, 0, 0);
|
|
738
738
|
return;
|
|
739
739
|
}
|
|
740
|
-
if (typeof
|
|
741
|
-
|
|
740
|
+
if (typeof A == "number") {
|
|
741
|
+
t.set(A, A, A, A);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
if (Array.isArray(
|
|
745
|
-
|
|
744
|
+
if (Array.isArray(A)) {
|
|
745
|
+
t.set(A[0], A[1], A[2], A[3]);
|
|
746
746
|
return;
|
|
747
747
|
}
|
|
748
|
-
const
|
|
749
|
-
|
|
748
|
+
const s = A.split("/")[0].trim().split(/\s+/), i = hA(s[0], e), o = hA((n = s[1]) != null ? n : s[0], e), r = hA((a = s[2]) != null ? a : s[0], e), g = hA((c = (I = s[3]) != null ? I : s[1]) != null ? c : s[0], e);
|
|
749
|
+
t.set(i, o, r, g);
|
|
750
750
|
}
|
|
751
|
-
const
|
|
752
|
-
create(
|
|
753
|
-
return
|
|
754
|
-
|
|
751
|
+
const K = {
|
|
752
|
+
create(t, A, e, s, i, o = 2, r = null, g) {
|
|
753
|
+
return t === "BOX" ? Re(
|
|
754
|
+
A,
|
|
755
|
+
s,
|
|
755
756
|
i,
|
|
756
757
|
r,
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
758
|
+
g
|
|
759
|
+
) : t === "TEXT" ? new pe(
|
|
760
|
+
e || "",
|
|
761
|
+
A,
|
|
762
|
+
s,
|
|
762
763
|
i,
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
) : new w.MeshBasicMaterial({ visible: !1 });
|
|
764
|
+
o
|
|
765
|
+
) : new E.MeshBasicMaterial({ visible: !1 });
|
|
766
766
|
},
|
|
767
|
-
update(
|
|
768
|
-
|
|
769
|
-
s,
|
|
767
|
+
update(t, A, e, s, i, o, r = 2, g) {
|
|
768
|
+
A === "BOX" ? xe(
|
|
770
769
|
t,
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
770
|
+
e,
|
|
771
|
+
i,
|
|
772
|
+
o,
|
|
773
|
+
g
|
|
774
|
+
) : A === "TEXT" && t.updateText(
|
|
775
|
+
s || "",
|
|
776
|
+
e,
|
|
777
|
+
i,
|
|
778
|
+
o,
|
|
779
|
+
r
|
|
780
780
|
);
|
|
781
781
|
},
|
|
782
|
-
forceUpdateUniforms(
|
|
783
|
-
|
|
782
|
+
forceUpdateUniforms(t, A) {
|
|
783
|
+
YA(t, A);
|
|
784
784
|
}
|
|
785
785
|
};
|
|
786
|
-
class
|
|
787
|
-
constructor(
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
this.onUpdate =
|
|
794
|
-
(
|
|
795
|
-
for (const
|
|
796
|
-
const
|
|
797
|
-
|
|
786
|
+
class Le {
|
|
787
|
+
constructor(A, e = !0) {
|
|
788
|
+
l(this, "observer");
|
|
789
|
+
l(this, "textures", /* @__PURE__ */ new WeakMap());
|
|
790
|
+
l(this, "loadStatus", /* @__PURE__ */ new WeakMap());
|
|
791
|
+
l(this, "elementUrls", /* @__PURE__ */ new WeakMap());
|
|
792
|
+
l(this, "onUpdate");
|
|
793
|
+
this.onUpdate = A, e && (this.observer = new IntersectionObserver(
|
|
794
|
+
(s) => {
|
|
795
|
+
for (const i of s) {
|
|
796
|
+
const o = i.target;
|
|
797
|
+
i.isIntersecting ? this.loadTexture(o) : this.disposeTexture(o);
|
|
798
798
|
}
|
|
799
799
|
},
|
|
800
800
|
{ rootMargin: "300px" }
|
|
801
801
|
));
|
|
802
802
|
}
|
|
803
|
-
register(
|
|
804
|
-
if (
|
|
803
|
+
register(A, e) {
|
|
804
|
+
if (A.nodeType !== Node.ELEMENT_NODE)
|
|
805
805
|
return;
|
|
806
|
-
this.elementUrls.get(
|
|
806
|
+
this.elementUrls.get(A) !== e && (this.elementUrls.set(A, e), this.observer ? (this.observer.unobserve(A), this.observer.observe(A)) : this.loadTexture(A));
|
|
807
807
|
}
|
|
808
|
-
unregister(
|
|
809
|
-
|
|
808
|
+
unregister(A) {
|
|
809
|
+
A.nodeType === Node.ELEMENT_NODE && this.observer && this.observer.unobserve(A), this.disposeTexture(A), this.elementUrls.delete(A), this.loadStatus.delete(A);
|
|
810
810
|
}
|
|
811
|
-
loadTexture(
|
|
812
|
-
return
|
|
813
|
-
if (this.loadStatus.get(
|
|
811
|
+
loadTexture(A) {
|
|
812
|
+
return eA(this, null, function* () {
|
|
813
|
+
if (this.loadStatus.get(A) || this.textures.has(A))
|
|
814
814
|
return;
|
|
815
|
-
const
|
|
816
|
-
if (
|
|
817
|
-
this.loadStatus.set(
|
|
815
|
+
const e = this.elementUrls.get(A);
|
|
816
|
+
if (e) {
|
|
817
|
+
this.loadStatus.set(A, !0);
|
|
818
818
|
try {
|
|
819
|
-
let
|
|
820
|
-
if (
|
|
821
|
-
|
|
822
|
-
const
|
|
823
|
-
|
|
819
|
+
let s;
|
|
820
|
+
if (e.startsWith("data:image/svg+xml"))
|
|
821
|
+
s = yield new Promise((o, r) => {
|
|
822
|
+
const g = new Image();
|
|
823
|
+
g.onload = () => o(g), g.onerror = r, g.src = e;
|
|
824
824
|
});
|
|
825
825
|
else {
|
|
826
|
-
const
|
|
827
|
-
|
|
826
|
+
const r = yield (yield fetch(e)).blob();
|
|
827
|
+
s = yield createImageBitmap(r, { imageOrientation: "flipY" });
|
|
828
828
|
}
|
|
829
|
-
if (this.elementUrls.get(
|
|
830
|
-
"close" in
|
|
829
|
+
if (this.elementUrls.get(A) !== e) {
|
|
830
|
+
"close" in s && s.close();
|
|
831
831
|
return;
|
|
832
832
|
}
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
} catch (
|
|
836
|
-
console.warn("[MirageEngine] Failed to load texture:",
|
|
833
|
+
const i = new E.Texture(s);
|
|
834
|
+
s instanceof HTMLImageElement || (i.flipY = !1), i.colorSpace = E.LinearSRGBColorSpace, i.needsUpdate = !0, this.textures.set(A, i), this.onUpdate(A, i);
|
|
835
|
+
} catch (s) {
|
|
836
|
+
console.warn("[MirageEngine] Failed to load texture:", e, s);
|
|
837
837
|
} finally {
|
|
838
|
-
this.elementUrls.has(
|
|
838
|
+
this.elementUrls.has(A) && this.loadStatus.set(A, !1);
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
841
|
});
|
|
842
842
|
}
|
|
843
|
-
disposeTexture(
|
|
844
|
-
const
|
|
845
|
-
|
|
843
|
+
disposeTexture(A) {
|
|
844
|
+
const e = this.textures.get(A);
|
|
845
|
+
e && (e.dispose(), this.textures.delete(A), this.onUpdate(A, null)), this.loadStatus.set(A, !1);
|
|
846
846
|
}
|
|
847
|
-
get(
|
|
848
|
-
return this.textures.get(
|
|
847
|
+
get(A) {
|
|
848
|
+
return this.textures.get(A);
|
|
849
849
|
}
|
|
850
850
|
disposeAll() {
|
|
851
851
|
this.observer && this.observer.disconnect();
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
-
class
|
|
855
|
-
constructor(e,
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
854
|
+
class Fe {
|
|
855
|
+
constructor(A, e, s, i) {
|
|
856
|
+
l(this, "canvas");
|
|
857
|
+
l(this, "scene");
|
|
858
|
+
l(this, "camera");
|
|
859
|
+
l(this, "renderer");
|
|
860
|
+
l(this, "renderTargets", []);
|
|
861
|
+
l(this, "renderOrder", 0);
|
|
862
|
+
l(this, "qualityFactor", 2);
|
|
863
|
+
l(this, "mode", "overlay");
|
|
864
|
+
l(this, "canvasSize", "viewport");
|
|
865
|
+
l(this, "clipArea", 1);
|
|
866
|
+
l(this, "targetLayer", "base");
|
|
867
|
+
l(this, "overscan", 200);
|
|
868
|
+
l(this, "target");
|
|
869
|
+
l(this, "mountContainer");
|
|
870
|
+
l(this, "registry");
|
|
871
|
+
l(this, "targetRect");
|
|
872
|
+
l(this, "targetPageX", 0);
|
|
873
|
+
l(this, "targetPageY", 0);
|
|
874
|
+
l(this, "size", { width: 0, height: 0 });
|
|
875
|
+
l(this, "currentScrollX", 0);
|
|
876
|
+
l(this, "currentScrollY", 0);
|
|
877
|
+
l(this, "lastTargetLeft", 0);
|
|
878
|
+
l(this, "lastTargetTop", 0);
|
|
879
|
+
l(this, "travelersByLayer", Array.from(
|
|
880
|
+
{ length: H.MAX_LAYERS },
|
|
874
881
|
() => /* @__PURE__ */ new Set()
|
|
875
882
|
));
|
|
876
|
-
|
|
883
|
+
l(this, "textureManager");
|
|
877
884
|
// private meshMap: Map<HTMLElement, THREE.Mesh> = new Map();
|
|
878
|
-
|
|
879
|
-
var
|
|
880
|
-
this.target =
|
|
881
|
-
const
|
|
882
|
-
|
|
883
|
-
}, this.isViewport), this.canvas = document.createElement("canvas"), this.scene = new
|
|
884
|
-
const
|
|
885
|
-
this.camera = new
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
885
|
+
l(this, "fixedMeshes", /* @__PURE__ */ new Set());
|
|
886
|
+
var g, n, a, I, c;
|
|
887
|
+
this.target = A, this.mountContainer = s, this.registry = i, this.mode = (g = e.mode) != null ? g : "overlay", this.canvasSize = (n = e.canvasSize) != null ? n : "viewport", this.clipArea = (a = e.travelerClipArea) != null ? a : 1, this.targetLayer = (I = e.layer) != null ? I : "base", this.textureManager = new Le((h, B) => {
|
|
888
|
+
const C = this.registry.get(h);
|
|
889
|
+
C && C.material instanceof E.ShaderMaterial && K.forceUpdateUniforms(C.material, { texture: B });
|
|
890
|
+
}, this.isViewport), this.qualityFactor = this.getQualityFactor(e.quality), this.canvas = document.createElement("canvas"), this.scene = new E.Scene(), this.targetRect = this.target.getBoundingClientRect(), this.lastTargetLeft = this.targetRect.left, this.lastTargetTop = this.targetRect.top, this.targetPageX = this.targetRect.left + this.getScrollX(), this.targetPageY = this.targetRect.top + this.getScrollY();
|
|
891
|
+
const o = this.isViewport ? window.innerWidth + this.overscan * 2 : this.targetRect.width, r = this.isViewport ? window.innerHeight + this.overscan * 2 : this.targetRect.height;
|
|
892
|
+
this.camera = new E.OrthographicCamera(
|
|
893
|
+
o / -2,
|
|
894
|
+
o / 2,
|
|
895
|
+
r / 2,
|
|
896
|
+
r / -2,
|
|
890
897
|
1,
|
|
891
898
|
1e3
|
|
892
|
-
), this.camera.position.z = 100, this.camera.layers.set(this.getSceneLayer()), this.renderer = new
|
|
899
|
+
), this.camera.position.z = 100, this.camera.layers.set(this.getSceneLayer()), this.renderer = new E.WebGLRenderer({
|
|
893
900
|
canvas: this.canvas,
|
|
894
901
|
alpha: !0,
|
|
895
902
|
antialias: !0
|
|
896
903
|
// [new]
|
|
897
904
|
// premultipliedAlpha: true
|
|
898
|
-
}),
|
|
905
|
+
}), E.ColorManagement.enabled = !1, this.renderer.outputColorSpace = E.LinearSRGBColorSpace, this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.setSize(o, r), this.applyTextQuality((c = e.quality) != null ? c : "medium");
|
|
899
906
|
}
|
|
900
907
|
get isViewport() {
|
|
901
908
|
return this.mode === "overlay" && this.canvasSize === "viewport";
|
|
902
909
|
}
|
|
903
910
|
getSceneLayer() {
|
|
904
|
-
return typeof this.targetLayer == "number" ? this.targetLayer : this.targetLayer === "selected" ?
|
|
911
|
+
return typeof this.targetLayer == "number" ? this.targetLayer : this.targetLayer === "selected" ? L.SELECTED : L.BASE;
|
|
905
912
|
}
|
|
906
913
|
createRenderTarget() {
|
|
907
|
-
for (let
|
|
908
|
-
const
|
|
914
|
+
for (let A = 0; A < H.MAX_LAYERS; A++) {
|
|
915
|
+
const e = this.isViewport ? window.innerWidth + this.overscan * 2 : this.targetRect.width, s = this.isViewport ? window.innerHeight + this.overscan * 2 : this.targetRect.height;
|
|
909
916
|
this.renderTargets.push(
|
|
910
|
-
new
|
|
911
|
-
|
|
912
|
-
|
|
917
|
+
new E.WebGLRenderTarget(
|
|
918
|
+
e * this.qualityFactor,
|
|
919
|
+
s * this.qualityFactor,
|
|
913
920
|
{
|
|
914
|
-
minFilter:
|
|
915
|
-
magFilter:
|
|
916
|
-
format:
|
|
921
|
+
minFilter: E.LinearFilter,
|
|
922
|
+
magFilter: E.LinearFilter,
|
|
923
|
+
format: E.RGBAFormat,
|
|
917
924
|
stencilBuffer: !1,
|
|
918
925
|
depthBuffer: !0
|
|
919
926
|
}
|
|
@@ -921,12 +928,12 @@ class ot {
|
|
|
921
928
|
);
|
|
922
929
|
}
|
|
923
930
|
}
|
|
924
|
-
applyTextQuality(
|
|
925
|
-
if (typeof
|
|
926
|
-
this.qualityFactor = Math.max(0.1,
|
|
931
|
+
applyTextQuality(A) {
|
|
932
|
+
if (typeof A == "number") {
|
|
933
|
+
this.qualityFactor = Math.max(0.1, A);
|
|
927
934
|
return;
|
|
928
935
|
}
|
|
929
|
-
switch (
|
|
936
|
+
switch (A) {
|
|
930
937
|
case "low":
|
|
931
938
|
this.qualityFactor = 1;
|
|
932
939
|
break;
|
|
@@ -941,49 +948,71 @@ class ot {
|
|
|
941
948
|
break;
|
|
942
949
|
}
|
|
943
950
|
}
|
|
951
|
+
getQualityFactor(A) {
|
|
952
|
+
if (typeof A == "number")
|
|
953
|
+
return Math.max(0.1, A);
|
|
954
|
+
switch (A) {
|
|
955
|
+
case "low":
|
|
956
|
+
return 1;
|
|
957
|
+
case "high":
|
|
958
|
+
return 4;
|
|
959
|
+
default:
|
|
960
|
+
return 2;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
updateScroll() {
|
|
964
|
+
const A = this.target.getBoundingClientRect();
|
|
965
|
+
this.currentScrollX += this.lastTargetLeft - A.left, this.currentScrollY += this.lastTargetTop - A.top, this.lastTargetLeft = A.left, this.lastTargetTop = A.top;
|
|
966
|
+
}
|
|
967
|
+
getScrollX() {
|
|
968
|
+
return this.currentScrollX;
|
|
969
|
+
}
|
|
970
|
+
getScrollY() {
|
|
971
|
+
return this.currentScrollY;
|
|
972
|
+
}
|
|
944
973
|
mount() {
|
|
945
974
|
this.mountContainer.prepend(this.canvas), this.canvas.style.pointerEvents = this.mode === "overlay" ? "none" : "auto", this.updateCanvasLayout();
|
|
946
975
|
}
|
|
947
976
|
updateCanvasLayout() {
|
|
948
|
-
const
|
|
949
|
-
this.canvas.style.width = `${
|
|
950
|
-
}
|
|
951
|
-
updateUniforms(
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
977
|
+
const A = this.isViewport ? window.innerWidth + this.overscan * 2 : this.targetRect.width, e = this.isViewport ? window.innerHeight + this.overscan * 2 : this.targetRect.height;
|
|
978
|
+
this.canvas.style.width = `${A}px`, this.canvas.style.height = `${e}px`, this.mode === "duplicate" ? (this.canvas.style.position = "", this.canvas.style.top = "", this.canvas.style.left = "", this.canvas.style.display = "block") : (this.canvas.style.position = this.isViewport ? "fixed" : "absolute", this.canvas.style.top = this.isViewport ? `-${this.overscan}px` : `${this.target.offsetTop}px`, this.canvas.style.left = this.isViewport ? `-${this.overscan}px` : `${this.target.offsetLeft}px`, this.canvas.style.display = "block");
|
|
979
|
+
}
|
|
980
|
+
updateUniforms(A, e) {
|
|
981
|
+
const s = this.registry.get(A);
|
|
982
|
+
s && (s.traverse((i) => {
|
|
983
|
+
i.isMesh && i.material && K.forceUpdateUniforms(
|
|
984
|
+
i.material,
|
|
985
|
+
e
|
|
957
986
|
);
|
|
958
|
-
}),
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
987
|
+
}), s.userData.nativeMesh && s.userData.nativeMesh.traverse((i) => {
|
|
988
|
+
i.isMesh && i.material && K.forceUpdateUniforms(
|
|
989
|
+
i.material,
|
|
990
|
+
e
|
|
962
991
|
);
|
|
963
992
|
}));
|
|
964
993
|
}
|
|
965
994
|
dispose() {
|
|
966
995
|
this.renderer.dispose(), this.canvas.remove(), this.textureManager.disposeAll();
|
|
967
996
|
}
|
|
968
|
-
setSize(
|
|
969
|
-
this.renderer.setSize(
|
|
970
|
-
for (const
|
|
971
|
-
|
|
972
|
-
this.camera.left =
|
|
973
|
-
}
|
|
974
|
-
syncScene(
|
|
975
|
-
const
|
|
976
|
-
|
|
977
|
-
const
|
|
978
|
-
if (
|
|
979
|
-
this.scene.remove(
|
|
980
|
-
for (const
|
|
981
|
-
|
|
982
|
-
this.fixedMeshes.delete(
|
|
983
|
-
(
|
|
984
|
-
) :
|
|
985
|
-
|
|
986
|
-
}), this.registry.remove(
|
|
997
|
+
setSize(A, e) {
|
|
998
|
+
this.renderer.setSize(A, e);
|
|
999
|
+
for (const s of this.renderTargets)
|
|
1000
|
+
s.setSize(A * this.qualityFactor, e * this.qualityFactor);
|
|
1001
|
+
this.camera.left = A / -2, this.camera.right = A / 2, this.camera.top = e / 2, this.camera.bottom = e / -2, this.camera.updateProjectionMatrix();
|
|
1002
|
+
}
|
|
1003
|
+
syncScene(A, e) {
|
|
1004
|
+
const s = this.target.getBoundingClientRect(), i = this.isViewport ? window.innerWidth + this.overscan * 2 : s.width, o = this.isViewport ? window.innerHeight + this.overscan * 2 : s.height, r = this.isViewport ? this.canvas.clientWidth : this.targetRect.width, g = this.isViewport ? this.canvas.clientHeight : this.targetRect.height, n = Math.abs(i - r) > 0.1 || Math.abs(o - g) > 0.1, a = this.mode === "overlay" && (Math.abs(s.top - this.targetRect.top) > 0.1 || Math.abs(s.left - this.targetRect.left) > 0.1);
|
|
1005
|
+
n ? (this.targetRect = s, this.targetPageX = s.left + this.getScrollX(), this.targetPageY = s.top + this.getScrollY(), this.setSize(i, o), this.updateCanvasLayout()) : a ? (this.targetRect = s, this.targetPageX = s.left + this.getScrollX(), this.targetPageY = s.top + this.getScrollY(), this.updateCanvasLayout()) : (this.targetRect = s, this.targetPageX = s.left + this.getScrollX(), this.targetPageY = s.top + this.getScrollY()), this.renderOrder = 0, this.reconcileNode(A), e.size > 0 && e.forEach((I) => {
|
|
1006
|
+
const c = this.registry.get(I);
|
|
1007
|
+
if (c) {
|
|
1008
|
+
this.scene.remove(c);
|
|
1009
|
+
for (const h of this.travelersByLayer)
|
|
1010
|
+
h.delete(c);
|
|
1011
|
+
this.fixedMeshes.delete(c), c.geometry.dispose(), c.userData.nativeMesh && (this.scene.remove(c.userData.nativeMesh), Array.isArray(c.userData.nativeMesh.material) ? c.userData.nativeMesh.material.forEach(
|
|
1012
|
+
(h) => h.dispose()
|
|
1013
|
+
) : c.userData.nativeMesh.material.dispose(), c.userData.nativeMesh.geometry.dispose()), c.traverse((h) => {
|
|
1014
|
+
h instanceof E.Mesh && (h.geometry && h.geometry.dispose(), h.material && (Array.isArray(h.material) ? h.material.forEach((B) => B.dispose()) : h.material.dispose()));
|
|
1015
|
+
}), this.registry.remove(I), this.textureManager.unregister(I);
|
|
987
1016
|
}
|
|
988
1017
|
});
|
|
989
1018
|
}
|
|
@@ -991,800 +1020,975 @@ class ot {
|
|
|
991
1020
|
// => 이 과정에서 scene node에 있는 ele를 넣은 hash => activeElements
|
|
992
1021
|
// => 이후 activeElements를 이용하여 mesh를 정리!!!+ map에서도 삭제
|
|
993
1022
|
// private reconcileNode(node: SceneNode, activeElements: Set<HTMLElement>) {
|
|
994
|
-
reconcileNode(
|
|
995
|
-
var
|
|
996
|
-
let
|
|
997
|
-
const
|
|
998
|
-
if (
|
|
999
|
-
const
|
|
1023
|
+
reconcileNode(A) {
|
|
1024
|
+
var i, o;
|
|
1025
|
+
let e = this.registry.get(A.element);
|
|
1026
|
+
const s = JSON.stringify(A.shaderHooks || null);
|
|
1027
|
+
if (e && e.userData.shaderHash !== s && (this.scene.remove(e), e.geometry.dispose(), e.material instanceof E.Material && e.material.dispose(), this.registry.remove(A.element), e = void 0), !e) {
|
|
1028
|
+
const r = new E.PlaneGeometry(1, 1), g = A.isTraveler ? (i = this.renderTargets[A.captureLayer - 2]) == null ? void 0 : i.texture : this.textureManager.get(A.element), n = K.create(
|
|
1000
1029
|
"BOX",
|
|
1001
|
-
|
|
1030
|
+
A.styles,
|
|
1002
1031
|
"",
|
|
1003
|
-
|
|
1004
|
-
|
|
1032
|
+
A.rect.width,
|
|
1033
|
+
A.rect.height,
|
|
1005
1034
|
this.qualityFactor,
|
|
1006
|
-
|
|
1007
|
-
|
|
1035
|
+
g,
|
|
1036
|
+
A.shaderHooks
|
|
1008
1037
|
);
|
|
1009
|
-
|
|
1038
|
+
e = new E.Mesh(r, n), A.type === "TEXT" && (e.name = "BG_MESH"), this.scene.add(e), this.registry.register(A.element, e), e.userData.baseMaterial = n, e.userData.domElement = A.element, e.userData.shaderHash = s;
|
|
1010
1039
|
}
|
|
1011
|
-
if (
|
|
1012
|
-
for (let
|
|
1013
|
-
|
|
1040
|
+
if (e.userData.clipElements = A.clipElements, e.userData.wasmIndex = A.wasmIndex, (o = A.nativeStyles) != null && o.transform ? e.userData.nativeTransform = A.nativeStyles.transform : e.userData.nativeTransform = void 0, this.updateMeshProperties(e, A), this.updateMeshLayers(e, A), A.isTraveler)
|
|
1041
|
+
for (let r = 0; r < H.MAX_LAYERS; r++)
|
|
1042
|
+
r === A.captureLayer - 2 ? this.travelersByLayer[r].add(e) : this.travelersByLayer[r].delete(e);
|
|
1014
1043
|
else
|
|
1015
|
-
for (const
|
|
1016
|
-
|
|
1017
|
-
if (
|
|
1018
|
-
for (const
|
|
1019
|
-
this.reconcileNode(
|
|
1044
|
+
for (const r of this.travelersByLayer)
|
|
1045
|
+
r.delete(e);
|
|
1046
|
+
if (A.isFixed ? this.fixedMeshes.add(e) : this.fixedMeshes.delete(e), A.styles.imageSrc ? this.textureManager.register(A.element, A.styles.imageSrc) : this.textureManager.unregister(A.element), A.type === "BOX")
|
|
1047
|
+
for (const r of A.children)
|
|
1048
|
+
this.reconcileNode(r);
|
|
1020
1049
|
else
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1050
|
+
A.type === "TEXT" && (this.reconcileTextChild(e, A, !1), e.userData.nativeMesh && A.nativeStyles && this.reconcileTextChild(
|
|
1051
|
+
e.userData.nativeMesh,
|
|
1052
|
+
A,
|
|
1024
1053
|
!0
|
|
1025
1054
|
));
|
|
1026
1055
|
}
|
|
1027
|
-
reconcileTextChild(
|
|
1028
|
-
var
|
|
1029
|
-
const
|
|
1030
|
-
{ text:
|
|
1031
|
-
],
|
|
1032
|
-
if (
|
|
1033
|
-
|
|
1034
|
-
(
|
|
1035
|
-
).forEach((
|
|
1036
|
-
var
|
|
1037
|
-
const
|
|
1038
|
-
(
|
|
1056
|
+
reconcileTextChild(A, e, s) {
|
|
1057
|
+
var a;
|
|
1058
|
+
const i = e.textLines || [
|
|
1059
|
+
{ text: e.textContent || "", rect: e.rect }
|
|
1060
|
+
], o = s ? e.nativeStyles : e.textStyles, r = JSON.stringify(o) + e.textContent + i.map((I) => I.text).join("|"), g = (a = A.userData) == null ? void 0 : a.textChildStyleHash;
|
|
1061
|
+
if (e.dirtyMask & TA || r !== g) {
|
|
1062
|
+
A.children.filter(
|
|
1063
|
+
(C) => C.name.startsWith("TEXT_CHILD")
|
|
1064
|
+
).forEach((C) => {
|
|
1065
|
+
var Q;
|
|
1066
|
+
const w = C;
|
|
1067
|
+
(Q = w.material.map) == null || Q.dispose(), w.geometry.dispose(), A.remove(w);
|
|
1039
1068
|
});
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1069
|
+
const c = e.rect, h = c.x + c.width / 2, B = c.y + c.height / 2;
|
|
1070
|
+
i.forEach((C, w) => {
|
|
1071
|
+
const Q = K.create(
|
|
1043
1072
|
"TEXT",
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1073
|
+
o,
|
|
1074
|
+
C.text,
|
|
1075
|
+
C.rect.width,
|
|
1076
|
+
C.rect.height,
|
|
1048
1077
|
this.qualityFactor
|
|
1049
|
-
), b = new
|
|
1050
|
-
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1078
|
+
), b = new E.PlaneGeometry(1, 1), f = new E.Mesh(b, Q);
|
|
1079
|
+
f.name = `TEXT_CHILD_${w}`;
|
|
1080
|
+
const y = e.rect.width === 0 ? 1 : C.rect.width / e.rect.width, U = e.rect.height === 0 ? 1 : C.rect.height / e.rect.height;
|
|
1081
|
+
f.scale.set(y, U, 1);
|
|
1082
|
+
const S = C.rect.x + C.rect.width / 2, D = C.rect.y + C.rect.height / 2, u = S - h, Y = -(D - B);
|
|
1083
|
+
f.position.set(
|
|
1084
|
+
e.rect.width === 0 ? 0 : u / e.rect.width,
|
|
1085
|
+
e.rect.height === 0 ? 0 : Y / e.rect.height,
|
|
1057
1086
|
5e-3
|
|
1058
|
-
),
|
|
1059
|
-
}),
|
|
1087
|
+
), A.add(f);
|
|
1088
|
+
}), A.userData.textChildStyleHash = r;
|
|
1060
1089
|
}
|
|
1061
|
-
|
|
1062
|
-
if (!
|
|
1090
|
+
A.children.forEach((I) => {
|
|
1091
|
+
if (!I.name.startsWith("TEXT_CHILD"))
|
|
1063
1092
|
return;
|
|
1064
|
-
const
|
|
1065
|
-
if (
|
|
1066
|
-
|
|
1093
|
+
const c = I;
|
|
1094
|
+
if (s && e.nativeLayer !== void 0)
|
|
1095
|
+
c.layers.set(L.HIDDEN), e.visibility & q && c.layers.enable(L.getCaptureLayer(e.nativeLayer));
|
|
1067
1096
|
else {
|
|
1068
|
-
const
|
|
1069
|
-
if (
|
|
1070
|
-
if (!
|
|
1071
|
-
for (let
|
|
1072
|
-
|
|
1097
|
+
const h = e.visibility & q ? L.BASE : L.HIDDEN;
|
|
1098
|
+
if (c.layers.set(h), e.visibility & lA && c.layers.enable(L.SELECTED), e.visibility & q)
|
|
1099
|
+
if (!s && e.nativeLayer !== void 0 && e.nativeStyles !== void 0)
|
|
1100
|
+
for (let B = e.captureLayer; B <= H.MAX_LAYERS + 1; B++)
|
|
1101
|
+
B !== e.nativeLayer && c.layers.enable(L.getCaptureLayer(B));
|
|
1073
1102
|
else
|
|
1074
|
-
for (let
|
|
1075
|
-
|
|
1103
|
+
for (let B = e.captureLayer; B <= H.MAX_LAYERS + 1; B++)
|
|
1104
|
+
c.layers.enable(L.getCaptureLayer(B));
|
|
1076
1105
|
}
|
|
1077
1106
|
});
|
|
1078
1107
|
}
|
|
1079
|
-
updateMeshProperties(
|
|
1080
|
-
var
|
|
1081
|
-
const { rect:
|
|
1082
|
-
|
|
1083
|
-
let
|
|
1084
|
-
|
|
1085
|
-
x:
|
|
1086
|
-
y:
|
|
1087
|
-
width:
|
|
1088
|
-
height:
|
|
1089
|
-
};
|
|
1090
|
-
const
|
|
1108
|
+
updateMeshProperties(A, e) {
|
|
1109
|
+
var f, y, U, S, D;
|
|
1110
|
+
const { rect: s, styles: i } = e, o = this.renderer.getPixelRatio(), r = this.renderer.domElement.width / o, g = this.renderer.domElement.height / o;
|
|
1111
|
+
A.material = A.userData.baseMaterial;
|
|
1112
|
+
let n = ((f = A.material.userData) == null ? void 0 : f.shadowPadding) || 0;
|
|
1113
|
+
A.scale.set(s.width + n * 2, s.height + n * 2, 1), A.userData.domRect = {
|
|
1114
|
+
x: s.x,
|
|
1115
|
+
y: s.y,
|
|
1116
|
+
width: s.width,
|
|
1117
|
+
height: s.height
|
|
1118
|
+
}, A.userData.needsNativeReset = !0;
|
|
1119
|
+
const a = 1e-3;
|
|
1091
1120
|
this.renderOrder++;
|
|
1092
|
-
|
|
1093
|
-
let d, p;
|
|
1121
|
+
let I, c;
|
|
1094
1122
|
if (this.isViewport)
|
|
1095
|
-
|
|
1123
|
+
I = s.x - window.innerWidth / 2 + s.width / 2, c = -s.y + window.innerHeight / 2 - s.height / 2;
|
|
1096
1124
|
else {
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1125
|
+
const u = s.x - this.targetPageX, Y = s.y - this.targetPageY;
|
|
1126
|
+
I = u - r / 2 + s.width / 2, c = -Y + g / 2 - s.height / 2;
|
|
1099
1127
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1128
|
+
A.position.set(
|
|
1129
|
+
I,
|
|
1130
|
+
c,
|
|
1131
|
+
i.zIndex + this.renderOrder * a
|
|
1104
1132
|
);
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
const
|
|
1108
|
-
let
|
|
1109
|
-
if (
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1133
|
+
const h = s.x, B = s.y;
|
|
1134
|
+
A.userData.basePosition = { x: I, y: c }, A.userData.originalBasePosition = { x: I, y: c }, A.userData.baseSize = { width: s.width, height: s.height }, A.userData.baseDOM = { x: h, y: B }, A.userData.isFixed = e.isFixed, A.userData.initialScroll = { x: window.scrollX, y: window.scrollY };
|
|
1135
|
+
const C = e.element.nodeType === Node.TEXT_NODE ? e.element.parentElement : e.element, w = window.getComputedStyle(C);
|
|
1136
|
+
let Q = 0, b = 0;
|
|
1137
|
+
if (w.transform && w.transform !== "none") {
|
|
1138
|
+
const u = new DOMMatrix(w.transform);
|
|
1139
|
+
Q = u.m41, b = u.m42;
|
|
1112
1140
|
}
|
|
1113
|
-
if (
|
|
1114
|
-
|
|
1141
|
+
if (A.userData.baseTransform = { x: Q, y: b }, delete A.userData.originRatioX, delete A.userData.originRatioY, K.update(
|
|
1142
|
+
A.userData.baseMaterial,
|
|
1115
1143
|
"BOX",
|
|
1116
|
-
|
|
1144
|
+
i,
|
|
1117
1145
|
"",
|
|
1118
|
-
|
|
1119
|
-
|
|
1146
|
+
s.width,
|
|
1147
|
+
s.height,
|
|
1120
1148
|
this.qualityFactor,
|
|
1121
|
-
|
|
1122
|
-
),
|
|
1123
|
-
if (!
|
|
1124
|
-
const
|
|
1149
|
+
e.isTraveler ? (y = this.renderTargets[e.captureLayer - 2]) == null ? void 0 : y.texture : this.textureManager.get(e.element)
|
|
1150
|
+
), e.nativeStyles && e.nativeRect) {
|
|
1151
|
+
if (!A.userData.nativeMesh) {
|
|
1152
|
+
const X = K.create(
|
|
1125
1153
|
"BOX",
|
|
1126
|
-
|
|
1154
|
+
e.nativeStyles,
|
|
1127
1155
|
"",
|
|
1128
|
-
|
|
1129
|
-
|
|
1156
|
+
e.nativeRect.width,
|
|
1157
|
+
e.nativeRect.height,
|
|
1130
1158
|
this.qualityFactor,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
),
|
|
1134
|
-
|
|
1159
|
+
e.isTraveler ? (U = this.renderTargets[e.captureLayer - 2]) == null ? void 0 : U.texture : e.nativeStyles.imageSrc && e.nativeStyles.imageSrc !== e.styles.imageSrc ? new E.TextureLoader().load(e.nativeStyles.imageSrc) : this.textureManager.get(e.element),
|
|
1160
|
+
e.shaderHooks
|
|
1161
|
+
), G = new E.Mesh(A.geometry, X);
|
|
1162
|
+
e.type === "TEXT" && (G.name = "BG_MESH"), this.scene.add(G), A.userData.nativeMesh = G;
|
|
1135
1163
|
}
|
|
1136
|
-
const
|
|
1137
|
-
let
|
|
1164
|
+
const u = A.userData.nativeMesh;
|
|
1165
|
+
let Y, gA;
|
|
1138
1166
|
if (this.isViewport)
|
|
1139
|
-
|
|
1167
|
+
Y = e.nativeRect.x - window.innerWidth / 2 + e.nativeRect.width / 2, gA = -e.nativeRect.y + window.innerHeight / 2 - e.nativeRect.height / 2;
|
|
1140
1168
|
else {
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1169
|
+
const X = e.nativeRect.x - this.targetPageX, G = e.nativeRect.y - this.targetPageY;
|
|
1170
|
+
Y = X - r / 2 + e.nativeRect.width / 2, gA = -G + g / 2 - e.nativeRect.height / 2;
|
|
1143
1171
|
}
|
|
1144
|
-
let
|
|
1145
|
-
if (
|
|
1146
|
-
const
|
|
1147
|
-
if (
|
|
1148
|
-
let
|
|
1149
|
-
|
|
1172
|
+
let cA = e.nativeRect.width, F = e.nativeRect.height, M = Y, P = gA;
|
|
1173
|
+
if (e.nativeStyles.transform) {
|
|
1174
|
+
const X = e.nativeStyles.transform, G = X.match(/scale\(([\d.]+%?)\)/);
|
|
1175
|
+
if (G) {
|
|
1176
|
+
let p = parseFloat(G[1]);
|
|
1177
|
+
G[1].includes("%") && (p /= 100), cA *= p, F *= p;
|
|
1150
1178
|
}
|
|
1151
|
-
const
|
|
1152
|
-
if (
|
|
1153
|
-
let
|
|
1154
|
-
|
|
1179
|
+
const $ = X.match(/scaleX\(([\d.]+%?)\)/);
|
|
1180
|
+
if ($) {
|
|
1181
|
+
let p = parseFloat($[1]);
|
|
1182
|
+
$[1].includes("%") && (p /= 100), cA *= p;
|
|
1155
1183
|
}
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1158
|
-
let
|
|
1159
|
-
|
|
1184
|
+
const IA = X.match(/scaleY\(([\d.]+%?)\)/);
|
|
1185
|
+
if (IA) {
|
|
1186
|
+
let p = parseFloat(IA[1]);
|
|
1187
|
+
IA[1].includes("%") && (p /= 100), F *= p;
|
|
1160
1188
|
}
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1163
|
-
const
|
|
1164
|
-
let
|
|
1165
|
-
|
|
1166
|
-
let
|
|
1167
|
-
|
|
1189
|
+
const rA = X.match(/translate\(([^,]+),\s*([^)]+)\)/);
|
|
1190
|
+
if (rA) {
|
|
1191
|
+
const p = rA[1].trim(), z = rA[2].trim();
|
|
1192
|
+
let dA = parseFloat(p);
|
|
1193
|
+
p.includes("%") && (dA = dA / 100 * e.nativeRect.width);
|
|
1194
|
+
let EA = parseFloat(z);
|
|
1195
|
+
z.includes("%") && (EA = EA / 100 * e.nativeRect.height), M += dA, P -= EA;
|
|
1168
1196
|
}
|
|
1169
|
-
const
|
|
1170
|
-
if (
|
|
1171
|
-
const
|
|
1172
|
-
let
|
|
1173
|
-
|
|
1197
|
+
const AA = X.match(/translateX\(([^)]+)\)/);
|
|
1198
|
+
if (AA) {
|
|
1199
|
+
const p = AA[1].trim();
|
|
1200
|
+
let z = parseFloat(p);
|
|
1201
|
+
p.includes("%") && (z = z / 100 * e.nativeRect.width), M += z;
|
|
1174
1202
|
}
|
|
1175
|
-
const
|
|
1176
|
-
if (
|
|
1177
|
-
const
|
|
1178
|
-
let
|
|
1179
|
-
|
|
1203
|
+
const sA = X.match(/translateY\(([^)]+)\)/);
|
|
1204
|
+
if (sA) {
|
|
1205
|
+
const p = sA[1].trim();
|
|
1206
|
+
let z = parseFloat(p);
|
|
1207
|
+
p.includes("%") && (z = z / 100 * e.nativeRect.height), P -= z;
|
|
1180
1208
|
}
|
|
1181
1209
|
}
|
|
1182
|
-
let
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
),
|
|
1188
|
-
|
|
1210
|
+
let BA = ((S = u.material.userData) == null ? void 0 : S.shadowPadding) || 0;
|
|
1211
|
+
u.scale.set(cA + BA * 2, F + BA * 2, 1), u.position.set(
|
|
1212
|
+
M,
|
|
1213
|
+
P,
|
|
1214
|
+
e.nativeStyles.zIndex + this.renderOrder * a
|
|
1215
|
+
), K.update(
|
|
1216
|
+
u.material,
|
|
1189
1217
|
"BOX",
|
|
1190
|
-
|
|
1218
|
+
e.nativeStyles,
|
|
1191
1219
|
"",
|
|
1192
|
-
|
|
1193
|
-
|
|
1220
|
+
e.nativeRect.width,
|
|
1221
|
+
e.nativeRect.height,
|
|
1194
1222
|
this.qualityFactor,
|
|
1195
|
-
|
|
1223
|
+
e.isTraveler ? (D = this.renderTargets[e.captureLayer - 2]) == null ? void 0 : D.texture : u.material.uniforms.uTexture.value || this.textureManager.get(e.element)
|
|
1196
1224
|
);
|
|
1197
1225
|
} else
|
|
1198
|
-
|
|
1199
|
-
}
|
|
1200
|
-
updateMeshLayers(
|
|
1201
|
-
const
|
|
1202
|
-
if (
|
|
1203
|
-
const
|
|
1204
|
-
if (
|
|
1205
|
-
|
|
1206
|
-
for (let
|
|
1207
|
-
|
|
1226
|
+
A.userData.nativeMesh && (this.scene.remove(A.userData.nativeMesh), A.userData.nativeMesh.material instanceof E.Material && A.userData.nativeMesh.material.dispose(), delete A.userData.nativeMesh);
|
|
1227
|
+
}
|
|
1228
|
+
updateMeshLayers(A, e) {
|
|
1229
|
+
const s = e.visibility & q ? L.BASE : L.HIDDEN;
|
|
1230
|
+
if (A.layers.set(s), e.visibility & lA && A.layers.enable(L.SELECTED), A.userData.nativeMesh && e.nativeLayer !== void 0) {
|
|
1231
|
+
const i = A.userData.nativeMesh;
|
|
1232
|
+
if (i.layers.set(L.HIDDEN), e.visibility & q) {
|
|
1233
|
+
i.layers.enable(L.getCaptureLayer(e.nativeLayer));
|
|
1234
|
+
for (let o = e.captureLayer; o <= H.MAX_LAYERS + 1; o++)
|
|
1235
|
+
o !== e.nativeLayer && A.layers.enable(L.getCaptureLayer(o));
|
|
1208
1236
|
}
|
|
1209
|
-
} else if (
|
|
1210
|
-
for (let
|
|
1211
|
-
|
|
1237
|
+
} else if (e.visibility & q)
|
|
1238
|
+
for (let i = e.captureLayer; i <= H.MAX_LAYERS + 1; i++)
|
|
1239
|
+
A.layers.enable(L.getCaptureLayer(i));
|
|
1212
1240
|
}
|
|
1213
|
-
captureRenderTarget(
|
|
1214
|
-
if (
|
|
1241
|
+
captureRenderTarget(A, e, s) {
|
|
1242
|
+
if (A.size === 0 || !s)
|
|
1215
1243
|
return;
|
|
1216
|
-
const
|
|
1217
|
-
this.renderer.getClearColor(
|
|
1218
|
-
const
|
|
1219
|
-
for (const
|
|
1220
|
-
|
|
1221
|
-
const
|
|
1222
|
-
let
|
|
1223
|
-
typeof this.clipArea == "number" ?
|
|
1224
|
-
const
|
|
1225
|
-
this.renderer.setScissor(
|
|
1244
|
+
const i = new E.Color(), o = this.renderer.getClearAlpha();
|
|
1245
|
+
this.renderer.getClearColor(i), this.renderer.setClearColor(0, 0), this.renderer.setRenderTarget(s), this.renderer.clear(), this.renderer.autoClear = !1, this.renderer.setScissorTest(!0), this.camera.layers.set(e);
|
|
1246
|
+
const r = new E.Vector3(), g = this.isViewport ? window.innerWidth + this.overscan * 2 : this.targetRect.width, n = this.isViewport ? window.innerHeight + this.overscan * 2 : this.targetRect.height, a = this.renderer.getPixelRatio();
|
|
1247
|
+
for (const I of A) {
|
|
1248
|
+
r.setFromMatrixPosition(I.matrixWorld), r.project(this.camera);
|
|
1249
|
+
const c = (r.x + 1) / 2 * g, h = (r.y + 1) / 2 * n;
|
|
1250
|
+
let B = 0, C = 1;
|
|
1251
|
+
typeof this.clipArea == "number" ? C = this.clipArea : this.clipArea.endsWith("%") ? C = parseFloat(this.clipArea) / 100 : this.clipArea.endsWith("px") && (B = parseFloat(this.clipArea));
|
|
1252
|
+
const w = I.scale.x * C + 0.5, Q = I.scale.y * C + 0.5, b = c - w / 2, f = h - Q / 2, y = (b * this.qualityFactor - B) / a, U = (f * this.qualityFactor - B) / a, S = (w * this.qualityFactor + B * 2) / a, D = (Q * this.qualityFactor + B * 2) / a;
|
|
1253
|
+
this.renderer.setScissor(y, U, S, D), this.renderer.render(this.scene, this.camera);
|
|
1226
1254
|
}
|
|
1227
|
-
this.renderer.setScissorTest(!1), this.renderer.autoClear = !0, this.renderer.setRenderTarget(null), this.camera.layers.set(this.getSceneLayer()), this.renderer.setClearColor(
|
|
1255
|
+
this.renderer.setScissorTest(!1), this.renderer.autoClear = !0, this.renderer.setRenderTarget(null), this.camera.layers.set(this.getSceneLayer()), this.renderer.setClearColor(i, o);
|
|
1228
1256
|
}
|
|
1229
1257
|
render() {
|
|
1230
|
-
for (let
|
|
1231
|
-
const
|
|
1258
|
+
for (let n = 0; n < H.MAX_LAYERS; n++) {
|
|
1259
|
+
const a = n + 1;
|
|
1232
1260
|
this.captureRenderTarget(
|
|
1233
|
-
this.travelersByLayer[
|
|
1234
|
-
|
|
1235
|
-
this.renderTargets[
|
|
1261
|
+
this.travelersByLayer[n],
|
|
1262
|
+
L.getCaptureLayer(a),
|
|
1263
|
+
this.renderTargets[n]
|
|
1236
1264
|
);
|
|
1237
1265
|
}
|
|
1238
|
-
const
|
|
1239
|
-
if (
|
|
1240
|
-
const
|
|
1241
|
-
(
|
|
1242
|
-
),
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
},
|
|
1246
|
-
|
|
1247
|
-
},
|
|
1266
|
+
const A = this.renderer.getContext(), e = this.renderer.getPixelRatio(), s = this.renderer.domElement.height / e, i = this.renderer.domElement, o = i.getBoundingClientRect().top, r = i.getBoundingClientRect().left, g = (n, a) => {
|
|
1267
|
+
if (a && a.width > 0 && a.height > 0) {
|
|
1268
|
+
const I = Math.floor((a.x - r) * e), c = Math.floor(
|
|
1269
|
+
(s - (a.y - o + a.height)) * e
|
|
1270
|
+
), h = Math.ceil(a.width * e), B = Math.ceil(a.height * e);
|
|
1271
|
+
n.onBeforeRender = () => {
|
|
1272
|
+
A.enable(A.SCISSOR_TEST), A.scissor(I, c, h, B);
|
|
1273
|
+
}, n.onAfterRender = () => {
|
|
1274
|
+
A.disable(A.SCISSOR_TEST);
|
|
1275
|
+
}, n.__hasScissorHook = !0;
|
|
1248
1276
|
} else
|
|
1249
|
-
|
|
1250
|
-
},
|
|
1251
|
-
},
|
|
1277
|
+
n.__hasScissorHook && (n.onBeforeRender = () => {
|
|
1278
|
+
}, n.onAfterRender = () => {
|
|
1279
|
+
}, n.__hasScissorHook = !1);
|
|
1252
1280
|
};
|
|
1253
|
-
this.scene.children.forEach((
|
|
1254
|
-
var
|
|
1255
|
-
const
|
|
1256
|
-
a
|
|
1257
|
-
|
|
1281
|
+
this.scene.children.forEach((n) => {
|
|
1282
|
+
var c;
|
|
1283
|
+
const a = n, I = (c = a.userData) == null ? void 0 : c.scissorRect;
|
|
1284
|
+
g(a, I), a.children.forEach((h) => {
|
|
1285
|
+
h.name.startsWith("TEXT_CHILD") && g(h, I);
|
|
1258
1286
|
});
|
|
1259
1287
|
}), this.renderer.render(this.scene, this.camera);
|
|
1260
1288
|
}
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1289
|
+
saveInitialLocals(A) {
|
|
1290
|
+
this.scene.children.forEach((e) => {
|
|
1291
|
+
const s = e;
|
|
1292
|
+
if (s.userData.wasmIndex !== void 0) {
|
|
1293
|
+
const i = s.userData.wasmIndex * iA;
|
|
1294
|
+
s.userData.initialLocalX = A[i + mA], s.userData.initialLocalY = A[i + pA];
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
syncMeshesByWasm(A) {
|
|
1299
|
+
const e = this.renderer.getPixelRatio(), s = this.renderer.domElement.width / e, i = this.renderer.domElement.height / e;
|
|
1300
|
+
this.scene.children.forEach((o) => {
|
|
1301
|
+
const r = o;
|
|
1302
|
+
if (!r.userData || r.userData.wasmIndex === void 0)
|
|
1267
1303
|
return;
|
|
1268
|
-
const
|
|
1269
|
-
if (!
|
|
1304
|
+
const n = r.userData.wasmIndex * iA, a = A[n + ie], I = A[n + re], c = r.userData.domRect;
|
|
1305
|
+
if (!c)
|
|
1270
1306
|
return;
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
const p = a.userData.clipElements;
|
|
1286
|
-
if (p && p.length > 0) {
|
|
1287
|
-
let b = -1 / 0, E = -1 / 0, A = 1 / 0, C = 1 / 0;
|
|
1288
|
-
for (const y of p) {
|
|
1289
|
-
const S = y.getBoundingClientRect();
|
|
1290
|
-
b = Math.max(b, S.left), E = Math.max(E, S.top), A = Math.min(A, S.right), C = Math.min(C, S.bottom);
|
|
1291
|
-
}
|
|
1292
|
-
a.userData.scissorRect = {
|
|
1293
|
-
x: b,
|
|
1294
|
-
y: E,
|
|
1295
|
-
width: Math.max(0, A - b),
|
|
1296
|
-
height: Math.max(0, C - E)
|
|
1297
|
-
};
|
|
1298
|
-
} else
|
|
1299
|
-
a.userData.scissorRect = void 0;
|
|
1300
|
-
let g, M;
|
|
1301
|
-
if (this.isViewport)
|
|
1302
|
-
g = o.x - window.innerWidth / 2 + o.width / 2, M = -o.y + window.innerHeight / 2 - o.height / 2;
|
|
1307
|
+
const h = this.fixedMeshes.has(r), B = h ? 0 : this.getScrollX(), C = h ? 0 : this.getScrollY();
|
|
1308
|
+
let w, Q;
|
|
1309
|
+
if (this.isViewport) {
|
|
1310
|
+
const f = a - B, y = I - C;
|
|
1311
|
+
w = f - window.innerWidth / 2 + c.width / 2, Q = -y + window.innerHeight / 2 - c.height / 2;
|
|
1312
|
+
} else {
|
|
1313
|
+
const f = a - this.targetPageX, y = I - this.targetPageY;
|
|
1314
|
+
w = f - s / 2 + c.width / 2, Q = -y + i / 2 - c.height / 2;
|
|
1315
|
+
}
|
|
1316
|
+
const b = r.position.z;
|
|
1317
|
+
if (r.position.set(w, Q, b), r.userData.nativeMesh) {
|
|
1318
|
+
const f = r.userData.nativeMesh;
|
|
1319
|
+
if (r.userData.needsNativeReset)
|
|
1320
|
+
r.userData.needsNativeReset = !1;
|
|
1303
1321
|
else {
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
}
|
|
1307
|
-
a.position.setX(g), a.position.setY(M);
|
|
1308
|
-
let m = ((h = a.material.userData) == null ? void 0 : h.shadowPadding) || 0;
|
|
1309
|
-
if (a.scale.set(o.width + m * 2, o.height + m * 2, 1), a.updateMatrixWorld(), a.material instanceof w.ShaderMaterial && W.forceUpdateUniforms(a.material, {
|
|
1310
|
-
width: o.width,
|
|
1311
|
-
height: o.height
|
|
1312
|
-
}), a.userData.nativeMesh) {
|
|
1313
|
-
const b = a.userData.nativeMesh;
|
|
1314
|
-
let E = o.width, A = o.height, C = g, y = M;
|
|
1315
|
-
if (a.userData.nativeTransform) {
|
|
1316
|
-
const z = a.userData.nativeTransform, X = z.match(/scale\(([\d.]+%?)\)/);
|
|
1317
|
-
if (X) {
|
|
1318
|
-
let L = parseFloat(X[1]);
|
|
1319
|
-
X[1].includes("%") && (L /= 100), E *= L, A *= L;
|
|
1320
|
-
}
|
|
1321
|
-
const B = z.match(/scaleX\(([\d.]+%?)\)/);
|
|
1322
|
-
if (B) {
|
|
1323
|
-
let L = parseFloat(B[1]);
|
|
1324
|
-
B[1].includes("%") && (L /= 100), E *= L;
|
|
1325
|
-
}
|
|
1326
|
-
const k = z.match(/scaleY\(([\d.]+%?)\)/);
|
|
1327
|
-
if (k) {
|
|
1328
|
-
let L = parseFloat(k[1]);
|
|
1329
|
-
k[1].includes("%") && (L /= 100), A *= L;
|
|
1330
|
-
}
|
|
1331
|
-
const j = z.match(/translate\(([^,]+),\s*([^)]+)\)/);
|
|
1332
|
-
if (j) {
|
|
1333
|
-
const L = j[1].trim(), _ = j[2].trim();
|
|
1334
|
-
let K = parseFloat(L);
|
|
1335
|
-
L.includes("%") && (K = K / 100 * o.width);
|
|
1336
|
-
let U = parseFloat(_);
|
|
1337
|
-
_.includes("%") && (U = U / 100 * o.height), C += K, y -= U;
|
|
1338
|
-
}
|
|
1339
|
-
const J = z.match(/translateX\(([^)]+)\)/);
|
|
1340
|
-
if (J) {
|
|
1341
|
-
const L = J[1].trim();
|
|
1342
|
-
let _ = parseFloat(L);
|
|
1343
|
-
L.includes("%") && (_ = _ / 100 * o.width), C += _;
|
|
1344
|
-
}
|
|
1345
|
-
const Z = z.match(/translateY\(([^)]+)\)/);
|
|
1346
|
-
if (Z) {
|
|
1347
|
-
const L = Z[1].trim();
|
|
1348
|
-
let _ = parseFloat(L);
|
|
1349
|
-
L.includes("%") && (_ = _ / 100 * o.height), y -= _;
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
let S = ((d = b.material.userData) == null ? void 0 : d.shadowPadding) || 0;
|
|
1353
|
-
b.position.setX(C), b.position.setY(y), b.scale.set(E + S * 2, A + S * 2, 1), b.updateMatrixWorld(), b.material instanceof w.ShaderMaterial && W.forceUpdateUniforms(b.material, {
|
|
1354
|
-
width: E,
|
|
1355
|
-
height: A
|
|
1356
|
-
});
|
|
1322
|
+
const y = w - r.userData.basePosition.x, U = Q - r.userData.basePosition.y;
|
|
1323
|
+
f.position.setX(f.position.x + y), f.position.setY(f.position.y + U);
|
|
1357
1324
|
}
|
|
1358
1325
|
}
|
|
1326
|
+
r.userData.basePosition.x = w, r.userData.basePosition.y = Q;
|
|
1359
1327
|
});
|
|
1360
1328
|
}
|
|
1361
1329
|
}
|
|
1362
|
-
function
|
|
1363
|
-
const
|
|
1364
|
-
let
|
|
1365
|
-
const
|
|
1366
|
-
for (let
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
const
|
|
1370
|
-
if (
|
|
1371
|
-
|
|
1330
|
+
function Te(t) {
|
|
1331
|
+
const A = t.textContent || "", e = [];
|
|
1332
|
+
let s = "", i = null, o = -1;
|
|
1333
|
+
const r = (a, I) => {
|
|
1334
|
+
for (let c = 0; c < a.length; c++) {
|
|
1335
|
+
const h = a[c], B = document.createRange();
|
|
1336
|
+
B.setStart(t, I + c), B.setEnd(t, I + c + 1);
|
|
1337
|
+
const C = B.getBoundingClientRect();
|
|
1338
|
+
if (C.width === 0 && C.height === 0) {
|
|
1339
|
+
s += h;
|
|
1372
1340
|
continue;
|
|
1373
1341
|
}
|
|
1374
|
-
|
|
1375
|
-
text:
|
|
1342
|
+
o === -1 || Math.abs(C.top - o) > C.height / 2 ? (s && i && e.push({
|
|
1343
|
+
text: s,
|
|
1376
1344
|
rect: {
|
|
1377
|
-
left:
|
|
1378
|
-
top:
|
|
1379
|
-
width:
|
|
1380
|
-
height:
|
|
1345
|
+
left: i.left,
|
|
1346
|
+
top: i.top,
|
|
1347
|
+
width: i.right - i.left,
|
|
1348
|
+
height: i.bottom - i.top
|
|
1381
1349
|
}
|
|
1382
|
-
}),
|
|
1383
|
-
left:
|
|
1384
|
-
top:
|
|
1385
|
-
right:
|
|
1386
|
-
bottom:
|
|
1387
|
-
},
|
|
1388
|
-
|
|
1389
|
-
|
|
1350
|
+
}), s = h, i = {
|
|
1351
|
+
left: C.left,
|
|
1352
|
+
top: C.top,
|
|
1353
|
+
right: C.right,
|
|
1354
|
+
bottom: C.bottom
|
|
1355
|
+
}, o = C.top) : (s += h, i && (i.left = Math.min(i.left, C.left), i.top = Math.min(i.top, C.top), i.right = Math.max(i.right, C.right), i.bottom = Math.max(
|
|
1356
|
+
i.bottom,
|
|
1357
|
+
C.bottom
|
|
1390
1358
|
)));
|
|
1391
1359
|
}
|
|
1392
|
-
},
|
|
1393
|
-
let
|
|
1394
|
-
for (const
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
const
|
|
1398
|
-
if (
|
|
1399
|
-
|
|
1360
|
+
}, g = A.match(/[^\s\-]+\-?|\-|\s+/g) || [];
|
|
1361
|
+
let n = 0;
|
|
1362
|
+
for (const a of g) {
|
|
1363
|
+
const I = document.createRange();
|
|
1364
|
+
I.setStart(t, n), I.setEnd(t, n + a.length);
|
|
1365
|
+
const c = I.getClientRects();
|
|
1366
|
+
if (c.length > 1)
|
|
1367
|
+
r(a, n);
|
|
1400
1368
|
else {
|
|
1401
|
-
const
|
|
1402
|
-
if (
|
|
1403
|
-
|
|
1369
|
+
const h = c.length === 1 ? c[0] : I.getBoundingClientRect();
|
|
1370
|
+
if (h.width === 0 && h.height === 0) {
|
|
1371
|
+
s += a, n += a.length;
|
|
1404
1372
|
continue;
|
|
1405
1373
|
}
|
|
1406
|
-
|
|
1407
|
-
text:
|
|
1374
|
+
o === -1 || Math.abs(h.top - o) > h.height / 2 ? (s && i && e.push({
|
|
1375
|
+
text: s,
|
|
1408
1376
|
rect: {
|
|
1409
|
-
left:
|
|
1410
|
-
top:
|
|
1411
|
-
width:
|
|
1412
|
-
height:
|
|
1377
|
+
left: i.left,
|
|
1378
|
+
top: i.top,
|
|
1379
|
+
width: i.right - i.left,
|
|
1380
|
+
height: i.bottom - i.top
|
|
1413
1381
|
}
|
|
1414
|
-
}),
|
|
1415
|
-
left:
|
|
1416
|
-
top:
|
|
1417
|
-
right:
|
|
1418
|
-
bottom:
|
|
1419
|
-
},
|
|
1420
|
-
|
|
1421
|
-
|
|
1382
|
+
}), s = a, i = {
|
|
1383
|
+
left: h.left,
|
|
1384
|
+
top: h.top,
|
|
1385
|
+
right: h.right,
|
|
1386
|
+
bottom: h.bottom
|
|
1387
|
+
}, o = h.top) : (s += a, i && (i.left = Math.min(i.left, h.left), i.top = Math.min(i.top, h.top), i.right = Math.max(i.right, h.right), i.bottom = Math.max(
|
|
1388
|
+
i.bottom,
|
|
1389
|
+
h.bottom
|
|
1422
1390
|
)));
|
|
1423
1391
|
}
|
|
1424
|
-
|
|
1392
|
+
n += a.length;
|
|
1425
1393
|
}
|
|
1426
|
-
return
|
|
1427
|
-
text:
|
|
1394
|
+
return s && i && e.push({
|
|
1395
|
+
text: s,
|
|
1428
1396
|
rect: {
|
|
1429
|
-
left:
|
|
1430
|
-
top:
|
|
1431
|
-
width:
|
|
1432
|
-
height:
|
|
1397
|
+
left: i.left,
|
|
1398
|
+
top: i.top,
|
|
1399
|
+
width: i.right - i.left,
|
|
1400
|
+
height: i.bottom - i.top
|
|
1433
1401
|
}
|
|
1434
|
-
}),
|
|
1435
|
-
(
|
|
1402
|
+
}), e.filter(
|
|
1403
|
+
(a) => a.text.trim().length > 0 && a.rect.width > 0 && a.rect.height > 0
|
|
1436
1404
|
);
|
|
1437
1405
|
}
|
|
1438
|
-
function
|
|
1439
|
-
const
|
|
1440
|
-
let
|
|
1441
|
-
isNaN(
|
|
1442
|
-
let
|
|
1443
|
-
return isNaN(
|
|
1444
|
-
font: `${
|
|
1445
|
-
fontSize:
|
|
1446
|
-
color:
|
|
1447
|
-
textAlign:
|
|
1406
|
+
function ee(t) {
|
|
1407
|
+
const A = parseFloat(t.fontSize);
|
|
1408
|
+
let e = parseFloat(t.lineHeight);
|
|
1409
|
+
isNaN(e) && (e = A * 1.2);
|
|
1410
|
+
let s = parseFloat(t.letterSpacing);
|
|
1411
|
+
return isNaN(s) && (s = 0), {
|
|
1412
|
+
font: `${t.fontStyle} ${t.fontWeight} ${t.fontSize} ${t.fontFamily}`,
|
|
1413
|
+
fontSize: t.fontSize,
|
|
1414
|
+
color: t.color,
|
|
1415
|
+
textAlign: t.textAlign || "start",
|
|
1448
1416
|
textBaseline: "alphabetic",
|
|
1449
|
-
direction:
|
|
1450
|
-
lineHeight:
|
|
1451
|
-
letterSpacing:
|
|
1417
|
+
direction: t.direction || "inherit",
|
|
1418
|
+
lineHeight: e,
|
|
1419
|
+
letterSpacing: s
|
|
1452
1420
|
};
|
|
1453
1421
|
}
|
|
1454
|
-
function
|
|
1455
|
-
var
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1422
|
+
function ce(t, A = nA | fA | fe | TA | SA, e, s = 1, i = 0, o = 2, r, g, n, a, I = -1, c = 0, h = 0, B = !1) {
|
|
1423
|
+
var kA, UA, HA, XA, JA, zA, _A, WA, KA;
|
|
1424
|
+
const C = (kA = a == null ? void 0 : a.scrollX) != null ? kA : window.scrollX, w = (UA = a == null ? void 0 : a.scrollY) != null ? UA : window.scrollY;
|
|
1425
|
+
if (t.nodeType === Node.TEXT_NODE) {
|
|
1426
|
+
const d = t;
|
|
1427
|
+
if (!d.textContent || !d.textContent.trim())
|
|
1459
1428
|
return null;
|
|
1460
|
-
const
|
|
1461
|
-
if (
|
|
1429
|
+
const R = d.textContent.replace(/\s+/g, " ");
|
|
1430
|
+
if (R.length === 0)
|
|
1462
1431
|
return null;
|
|
1463
|
-
const T =
|
|
1432
|
+
const T = Te(d);
|
|
1464
1433
|
if (T.length === 0)
|
|
1465
1434
|
return null;
|
|
1466
|
-
const
|
|
1467
|
-
if (!
|
|
1435
|
+
const _ = d.parentElement, N = _ ? window.getComputedStyle(_) : null;
|
|
1436
|
+
if (!N)
|
|
1468
1437
|
return null;
|
|
1469
|
-
const
|
|
1438
|
+
const x = B || N.position === "fixed", k = Math.min(...T.map((m) => m.rect.left)), O = Math.min(...T.map((m) => m.rect.top)), v = Math.max(...T.map((m) => m.rect.left + m.rect.width)), W = Math.max(...T.map((m) => m.rect.top + m.rect.height)), V = k + (x ? 0 : C), QA = O + (x ? 0 : w);
|
|
1439
|
+
let oA = -1;
|
|
1440
|
+
if (a && a.sharedArray) {
|
|
1441
|
+
oA = a.currentIndex++;
|
|
1442
|
+
const m = oA * iA;
|
|
1443
|
+
a.sharedArray[m + LA] = I, a.sharedArray[m + mA] = V - c, a.sharedArray[m + pA] = QA - h;
|
|
1444
|
+
}
|
|
1470
1445
|
return {
|
|
1471
1446
|
id: Math.random().toString(36).substring(2, 9),
|
|
1472
1447
|
type: "TEXT",
|
|
1473
|
-
element:
|
|
1448
|
+
element: d,
|
|
1474
1449
|
rect: {
|
|
1475
|
-
x:
|
|
1476
|
-
y:
|
|
1477
|
-
width:
|
|
1478
|
-
height:
|
|
1450
|
+
x: k + (x ? 0 : C),
|
|
1451
|
+
y: O + (x ? 0 : w),
|
|
1452
|
+
width: v - k,
|
|
1453
|
+
height: W - O
|
|
1479
1454
|
},
|
|
1480
1455
|
styles: {
|
|
1481
1456
|
backgroundColor: "transparent",
|
|
1482
1457
|
backgroundImage: "",
|
|
1483
|
-
opacity:
|
|
1484
|
-
zIndex: (isNaN(parseInt(
|
|
1458
|
+
opacity: _ && _.dataset[tA.KEY] === tA.VALUES.HIDE ? 1 : parseFloat(N.opacity),
|
|
1459
|
+
zIndex: (isNaN(parseInt(N.zIndex)) ? 0 : parseInt(N.zIndex)) + i,
|
|
1485
1460
|
borderRadius: "0px",
|
|
1486
1461
|
borderColor: "transparent",
|
|
1487
1462
|
borderWidth: "0px",
|
|
1488
1463
|
isTraveler: !1
|
|
1489
1464
|
},
|
|
1490
|
-
textContent:
|
|
1491
|
-
textLines: T.map((
|
|
1492
|
-
text:
|
|
1465
|
+
textContent: R,
|
|
1466
|
+
textLines: T.map((m) => ({
|
|
1467
|
+
text: m.text.trim(),
|
|
1493
1468
|
rect: {
|
|
1494
|
-
x:
|
|
1495
|
-
y:
|
|
1496
|
-
width:
|
|
1497
|
-
height:
|
|
1469
|
+
x: m.rect.left + (x ? 0 : C),
|
|
1470
|
+
y: m.rect.top + (x ? 0 : w),
|
|
1471
|
+
width: m.rect.width,
|
|
1472
|
+
height: m.rect.height
|
|
1498
1473
|
}
|
|
1499
1474
|
})),
|
|
1500
|
-
textStyles:
|
|
1501
|
-
dirtyMask:
|
|
1502
|
-
visibility:
|
|
1475
|
+
textStyles: ee(N),
|
|
1476
|
+
dirtyMask: A,
|
|
1477
|
+
visibility: e,
|
|
1503
1478
|
isTraveler: !1,
|
|
1504
|
-
captureLayer:
|
|
1505
|
-
isFixed:
|
|
1506
|
-
nativeLayer:
|
|
1507
|
-
nativeStyles:
|
|
1479
|
+
captureLayer: s,
|
|
1480
|
+
isFixed: x,
|
|
1481
|
+
nativeLayer: r,
|
|
1482
|
+
nativeStyles: g ? aA(aA({
|
|
1508
1483
|
backgroundColor: "transparent",
|
|
1509
1484
|
backgroundImage: "",
|
|
1510
|
-
opacity:
|
|
1511
|
-
zIndex: (isNaN(parseInt(
|
|
1485
|
+
opacity: _ && _.dataset[tA.KEY] === tA.VALUES.HIDE ? 1 : parseFloat(N.opacity),
|
|
1486
|
+
zIndex: (isNaN(parseInt(N.zIndex)) ? 0 : parseInt(N.zIndex)) + i,
|
|
1512
1487
|
borderRadius: "0px",
|
|
1513
1488
|
borderColor: "transparent",
|
|
1514
1489
|
borderWidth: "0px",
|
|
1515
1490
|
isTraveler: !1
|
|
1516
|
-
},
|
|
1517
|
-
nativeRect:
|
|
1518
|
-
x:
|
|
1519
|
-
y:
|
|
1520
|
-
width:
|
|
1521
|
-
height:
|
|
1491
|
+
}, ee(N)), g) : void 0,
|
|
1492
|
+
nativeRect: g ? {
|
|
1493
|
+
x: k + (x ? 0 : C),
|
|
1494
|
+
y: O + (x ? 0 : w),
|
|
1495
|
+
width: v - k,
|
|
1496
|
+
height: W - O
|
|
1522
1497
|
} : void 0,
|
|
1523
|
-
clipElements:
|
|
1498
|
+
clipElements: n,
|
|
1499
|
+
wasmIndex: oA !== -1 ? oA : void 0,
|
|
1524
1500
|
children: []
|
|
1525
1501
|
};
|
|
1526
1502
|
}
|
|
1527
|
-
if (
|
|
1503
|
+
if (t.nodeType !== Node.ELEMENT_NODE)
|
|
1528
1504
|
return null;
|
|
1529
|
-
const
|
|
1530
|
-
let
|
|
1531
|
-
if (
|
|
1532
|
-
const
|
|
1533
|
-
for (const
|
|
1534
|
-
if (!
|
|
1505
|
+
const Q = t, b = Q.dataset[j.KEY];
|
|
1506
|
+
let f = e, y = e;
|
|
1507
|
+
if (b) {
|
|
1508
|
+
const d = new Set(b.split(/\s+/));
|
|
1509
|
+
for (const R of d)
|
|
1510
|
+
if (!PA.includes(R))
|
|
1535
1511
|
throw new Error(
|
|
1536
|
-
`[MirageEngine] Invalid filter token: '${
|
|
1512
|
+
`[MirageEngine] Invalid filter token: '${R}'. Expected one of: 'include-tree', 'exclude-tree', 'include-self', 'exclude-self', 'end'.`
|
|
1537
1513
|
);
|
|
1538
|
-
if (
|
|
1514
|
+
if (d.has(j.VALUES.END))
|
|
1539
1515
|
return null;
|
|
1540
|
-
if (
|
|
1516
|
+
if (d.has(j.VALUES.INCLUDE_TREE) && d.has(j.VALUES.EXCLUDE_TREE))
|
|
1541
1517
|
throw new Error(
|
|
1542
1518
|
"[MirageEngine] Conflicting filters: 'include-tree' and 'exclude-tree' cannot be used together on the same element."
|
|
1543
1519
|
);
|
|
1544
|
-
if (
|
|
1520
|
+
if (d.has(j.VALUES.INCLUDE_SELF) && d.has(j.VALUES.EXCLUDE_SELF))
|
|
1545
1521
|
throw new Error(
|
|
1546
1522
|
"[MirageEngine] Conflicting filters: 'include-self' and 'exclude-self' cannot be used together on the same element."
|
|
1547
1523
|
);
|
|
1548
|
-
|
|
1524
|
+
d.has(j.VALUES.INCLUDE_TREE) ? f = f | q : d.has(j.VALUES.EXCLUDE_TREE) && (f = f & ~q), y = f, d.has(j.VALUES.INCLUDE_SELF) ? y = y | q : d.has(j.VALUES.EXCLUDE_SELF) && (y = y & ~q);
|
|
1549
1525
|
}
|
|
1550
|
-
const
|
|
1551
|
-
if (
|
|
1552
|
-
const
|
|
1553
|
-
for (const
|
|
1554
|
-
if (!
|
|
1526
|
+
const U = Q.dataset[Z.KEY];
|
|
1527
|
+
if (U) {
|
|
1528
|
+
const d = new Set(U.split(/\s+/));
|
|
1529
|
+
for (const R of d)
|
|
1530
|
+
if (!PA.includes(R))
|
|
1555
1531
|
throw new Error(
|
|
1556
|
-
`[MirageEngine] Invalid select token: '${
|
|
1532
|
+
`[MirageEngine] Invalid select token: '${R}'. Expected one of: 'include-tree', 'exclude-tree', 'include-self', 'exclude-self', 'end'.`
|
|
1557
1533
|
);
|
|
1558
|
-
if (
|
|
1534
|
+
if (d.has(Z.VALUES.END))
|
|
1559
1535
|
return null;
|
|
1560
|
-
if (
|
|
1536
|
+
if (d.has(Z.VALUES.INCLUDE_TREE) && d.has(Z.VALUES.EXCLUDE_TREE))
|
|
1561
1537
|
throw new Error(
|
|
1562
1538
|
"[MirageEngine] Conflicting selects: 'include-tree' and 'exclude-tree' cannot be used together on the same element."
|
|
1563
1539
|
);
|
|
1564
|
-
if (
|
|
1540
|
+
if (d.has(Z.VALUES.INCLUDE_SELF) && d.has(Z.VALUES.EXCLUDE_SELF))
|
|
1565
1541
|
throw new Error(
|
|
1566
1542
|
"[MirageEngine] Conflicting selects: 'include-self' and 'exclude-self' cannot be used together on the same element."
|
|
1567
1543
|
);
|
|
1568
|
-
|
|
1569
|
-
}
|
|
1570
|
-
const
|
|
1571
|
-
let
|
|
1572
|
-
if (
|
|
1573
|
-
let
|
|
1574
|
-
const
|
|
1575
|
-
let
|
|
1576
|
-
if (
|
|
1577
|
-
|
|
1578
|
-
const
|
|
1544
|
+
d.has(Z.VALUES.INCLUDE_TREE) ? f = f | lA : d.has(Z.VALUES.EXCLUDE_TREE) && (f = f & ~lA), y = f, d.has(Z.VALUES.INCLUDE_SELF) ? y = y | lA : d.has(Z.VALUES.EXCLUDE_SELF) && (y = y & ~lA);
|
|
1545
|
+
}
|
|
1546
|
+
const S = Q.dataset[H.KEY];
|
|
1547
|
+
let D = !1, u = g ? aA({}, g) : {}, Y = r;
|
|
1548
|
+
if (S) {
|
|
1549
|
+
let d = 1;
|
|
1550
|
+
const R = S.indexOf("{"), T = S.lastIndexOf("}");
|
|
1551
|
+
let _ = S;
|
|
1552
|
+
if (R !== -1 && T !== -1 && T > R) {
|
|
1553
|
+
_ = S.substring(0, R).trim();
|
|
1554
|
+
const v = S.substring(R, T + 1);
|
|
1579
1555
|
try {
|
|
1580
|
-
|
|
1581
|
-
} catch (
|
|
1556
|
+
u = new Function("return " + v)();
|
|
1557
|
+
} catch (W) {
|
|
1582
1558
|
console.warn(
|
|
1583
|
-
`[MirageEngine] Failed to parse travel styles JSON: ${
|
|
1559
|
+
`[MirageEngine] Failed to parse travel styles JSON: ${v}`
|
|
1584
1560
|
);
|
|
1585
1561
|
}
|
|
1586
1562
|
}
|
|
1587
|
-
const
|
|
1588
|
-
let
|
|
1589
|
-
const
|
|
1590
|
-
if (
|
|
1591
|
-
|
|
1592
|
-
const
|
|
1593
|
-
if (
|
|
1594
|
-
|
|
1563
|
+
const N = _.split(/\s+/);
|
|
1564
|
+
let x = !1;
|
|
1565
|
+
const k = N.indexOf(H.VALUES.TRAVELER);
|
|
1566
|
+
if (k !== -1) {
|
|
1567
|
+
D = !0, x = !0;
|
|
1568
|
+
const v = N[k + 1];
|
|
1569
|
+
if (v && !isNaN(parseInt(v, 10)))
|
|
1570
|
+
d = parseInt(v, 10);
|
|
1595
1571
|
else {
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1572
|
+
const W = N.find((V) => !isNaN(parseInt(V, 10)));
|
|
1573
|
+
W && (d = parseInt(W, 10));
|
|
1598
1574
|
}
|
|
1599
1575
|
}
|
|
1600
|
-
const
|
|
1601
|
-
if (
|
|
1602
|
-
const
|
|
1603
|
-
if (
|
|
1604
|
-
|
|
1605
|
-
else if (!
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1576
|
+
const O = N.indexOf(H.VALUES.NATIVE);
|
|
1577
|
+
if (O !== -1) {
|
|
1578
|
+
const v = N[O + 1];
|
|
1579
|
+
if (v && !isNaN(parseInt(v, 10)))
|
|
1580
|
+
Y = parseInt(v, 10);
|
|
1581
|
+
else if (!D) {
|
|
1582
|
+
const W = N.find((V) => !isNaN(parseInt(V, 10)));
|
|
1583
|
+
W && (Y = parseInt(W, 10));
|
|
1608
1584
|
}
|
|
1609
1585
|
}
|
|
1610
|
-
if (
|
|
1611
|
-
const
|
|
1612
|
-
if (
|
|
1586
|
+
if (x) {
|
|
1587
|
+
const v = d + 1;
|
|
1588
|
+
if (v < s)
|
|
1613
1589
|
throw new Error(
|
|
1614
|
-
`[MirageEngine] Traveler layer (${
|
|
1590
|
+
`[MirageEngine] Traveler layer (${d}) cannot be smaller than inherited capture layer (${s - 1}).`
|
|
1615
1591
|
);
|
|
1616
|
-
|
|
1592
|
+
s = Math.min(v, H.MAX_LAYERS + 1);
|
|
1617
1593
|
}
|
|
1618
1594
|
}
|
|
1619
|
-
const
|
|
1620
|
-
let
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1623
|
-
if (
|
|
1595
|
+
const gA = Q.dataset[ue.KEY];
|
|
1596
|
+
let cA;
|
|
1597
|
+
gA && (cA = JSON.parse(gA));
|
|
1598
|
+
const F = Q.getBoundingClientRect(), M = window.getComputedStyle(Q);
|
|
1599
|
+
if (F.width === 0 || F.height === 0 || M.display === "none")
|
|
1624
1600
|
return null;
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1601
|
+
const P = B || M.position === "fixed", BA = F.left + (P ? 0 : C), X = F.top + (P ? 0 : w);
|
|
1602
|
+
let G = -1;
|
|
1603
|
+
if (a && a.sharedArray) {
|
|
1604
|
+
G = a.currentIndex++;
|
|
1605
|
+
const d = G * iA;
|
|
1606
|
+
a.sharedArray[d + LA] = I, a.sharedArray[d + mA] = BA - c, a.sharedArray[d + pA] = X - h;
|
|
1607
|
+
}
|
|
1608
|
+
let $ = Q.getAttribute("data-mid");
|
|
1609
|
+
$ || ($ = Math.random().toString(36).substring(2, 11), Q.setAttribute("data-mid", $));
|
|
1610
|
+
const IA = parseInt(M.zIndex), rA = (isNaN(IA) ? 0 : IA) + i;
|
|
1611
|
+
let AA, sA;
|
|
1612
|
+
if (Q.tagName === "IMG")
|
|
1613
|
+
AA = Q.src;
|
|
1614
|
+
else if (Q.tagName.toLowerCase() === "svg") {
|
|
1615
|
+
const d = u == null ? void 0 : u.color, R = u == null ? void 0 : u.fill, T = u == null ? void 0 : u.stroke, _ = u == null ? void 0 : u.opacity, N = (x) => {
|
|
1616
|
+
const k = Q.cloneNode(!0), O = (QA, oA) => {
|
|
1617
|
+
const m = window.getComputedStyle(QA), uA = oA, le = m.fill === m.color, he = m.stroke === m.color, bA = (x ? R || (le ? d : void 0) : void 0) || m.fill;
|
|
1618
|
+
bA && bA !== "none" && (uA.style.fill = bA);
|
|
1619
|
+
const NA = (x ? T || (he ? d : void 0) : void 0) || m.stroke;
|
|
1620
|
+
NA && NA !== "none" && (uA.style.stroke = NA), m.strokeWidth && m.strokeWidth !== "0px" && (uA.style.strokeWidth = m.strokeWidth);
|
|
1621
|
+
const OA = (x ? d : void 0) || m.color;
|
|
1622
|
+
OA && (uA.style.color = OA);
|
|
1623
|
+
const MA = (x ? _ : void 0) || m.opacity;
|
|
1624
|
+
MA && MA !== "1" && (uA.style.opacity = MA);
|
|
1625
|
+
for (let yA = 0; yA < QA.children.length; yA++)
|
|
1626
|
+
O(QA.children[yA], oA.children[yA]);
|
|
1627
|
+
};
|
|
1628
|
+
O(Q, k);
|
|
1629
|
+
const v = Q.getBoundingClientRect(), W = window.devicePixelRatio * o;
|
|
1630
|
+
k.hasAttribute("viewBox") || k.setAttribute("viewBox", `0 0 ${v.width} ${v.height}`), k.setAttribute("width", (v.width * W).toString()), k.setAttribute("height", (v.height * W).toString());
|
|
1631
|
+
let V = new XMLSerializer().serializeToString(k);
|
|
1632
|
+
return V.includes("xmlns=") || (V = V.replace(
|
|
1633
|
+
"<svg",
|
|
1634
|
+
'<svg xmlns="http://www.w3.org/2000/svg"'
|
|
1635
|
+
)), `data:image/svg+xml;utf8,${encodeURIComponent(V)}`;
|
|
1643
1636
|
};
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1637
|
+
AA = N(!1), Y !== void 0 && (d || R || T || _) && (sA = N(!0));
|
|
1638
|
+
} else if (M.backgroundImage && M.backgroundImage !== "none") {
|
|
1639
|
+
const d = M.backgroundImage.match(/url\(['"]?(.*?)['"]?\)/);
|
|
1640
|
+
d && (AA = d[1]);
|
|
1641
|
+
}
|
|
1642
|
+
const p = {
|
|
1643
|
+
backgroundColor: M.backgroundColor,
|
|
1644
|
+
backgroundImage: M.backgroundImage,
|
|
1645
|
+
opacity: Q.dataset[tA.KEY] === tA.VALUES.HIDE ? 1 : parseFloat(M.opacity),
|
|
1646
|
+
zIndex: rA,
|
|
1647
|
+
borderRadius: M.borderRadius,
|
|
1648
|
+
borderColor: M.borderColor,
|
|
1649
|
+
borderWidth: M.borderWidth,
|
|
1650
|
+
boxShadow: M.boxShadow,
|
|
1651
|
+
imageSrc: AA,
|
|
1652
|
+
isTraveler: D
|
|
1653
|
+
}, z = p;
|
|
1654
|
+
let dA, EA;
|
|
1655
|
+
const GA = [], Ie = M.overflow === "hidden" ? [...n || [], Q] : n;
|
|
1656
|
+
return Q.tagName.toLowerCase() !== "svg" && Array.from(Q.childNodes).forEach((d) => {
|
|
1657
|
+
const R = d.nodeType === Node.TEXT_NODE ? y : f, T = ce(
|
|
1658
|
+
d,
|
|
1659
|
+
A,
|
|
1660
|
+
R,
|
|
1661
|
+
s,
|
|
1662
|
+
rA,
|
|
1663
|
+
o,
|
|
1664
|
+
d.nodeType === Node.TEXT_NODE ? Y : void 0,
|
|
1665
|
+
d.nodeType === Node.TEXT_NODE && Object.keys(u).length > 0 ? u : void 0,
|
|
1666
|
+
Ie,
|
|
1667
|
+
a,
|
|
1668
|
+
G,
|
|
1669
|
+
BA,
|
|
1676
1670
|
X,
|
|
1677
|
-
|
|
1678
|
-
v.nodeType === Node.TEXT_NODE ? b : void 0,
|
|
1679
|
-
v.nodeType === Node.TEXT_NODE && Object.keys(m).length > 0 ? m : void 0,
|
|
1680
|
-
_
|
|
1671
|
+
P
|
|
1681
1672
|
);
|
|
1682
|
-
T &&
|
|
1673
|
+
T && GA.push(T);
|
|
1683
1674
|
}), {
|
|
1684
|
-
id:
|
|
1675
|
+
id: $,
|
|
1685
1676
|
type: "BOX",
|
|
1686
|
-
element:
|
|
1677
|
+
element: Q,
|
|
1687
1678
|
rect: {
|
|
1688
|
-
x:
|
|
1689
|
-
y:
|
|
1690
|
-
width:
|
|
1691
|
-
height:
|
|
1679
|
+
x: F.left + C,
|
|
1680
|
+
y: F.top + w,
|
|
1681
|
+
width: F.width,
|
|
1682
|
+
height: F.height
|
|
1692
1683
|
},
|
|
1693
|
-
styles:
|
|
1694
|
-
textContent:
|
|
1695
|
-
textStyles:
|
|
1696
|
-
dirtyMask:
|
|
1697
|
-
visibility:
|
|
1698
|
-
isTraveler:
|
|
1699
|
-
captureLayer:
|
|
1700
|
-
nativeLayer:
|
|
1701
|
-
nativeStyles:
|
|
1702
|
-
backgroundColor: (
|
|
1703
|
-
backgroundImage: (
|
|
1704
|
-
opacity: (
|
|
1705
|
-
zIndex:
|
|
1706
|
-
borderRadius: (
|
|
1707
|
-
borderColor: (
|
|
1708
|
-
borderWidth: (
|
|
1709
|
-
boxShadow: (
|
|
1710
|
-
isTraveler:
|
|
1711
|
-
transform:
|
|
1684
|
+
styles: z,
|
|
1685
|
+
textContent: dA,
|
|
1686
|
+
textStyles: EA,
|
|
1687
|
+
dirtyMask: A,
|
|
1688
|
+
visibility: y,
|
|
1689
|
+
isTraveler: D,
|
|
1690
|
+
captureLayer: s,
|
|
1691
|
+
nativeLayer: Y,
|
|
1692
|
+
nativeStyles: Y !== void 0 ? qA(aA({}, p), {
|
|
1693
|
+
backgroundColor: (HA = u.backgroundColor) != null ? HA : p.backgroundColor,
|
|
1694
|
+
backgroundImage: (XA = u.backgroundImage) != null ? XA : p.backgroundImage,
|
|
1695
|
+
opacity: (JA = u.opacity) != null ? JA : p.opacity,
|
|
1696
|
+
zIndex: u.zIndex !== void 0 ? u.zIndex + rA : p.zIndex,
|
|
1697
|
+
borderRadius: (zA = u.borderRadius) != null ? zA : p.borderRadius,
|
|
1698
|
+
borderColor: (_A = u.borderColor) != null ? _A : p.borderColor,
|
|
1699
|
+
borderWidth: (WA = u.borderWidth) != null ? WA : p.borderWidth,
|
|
1700
|
+
boxShadow: (KA = u.boxShadow) != null ? KA : p.boxShadow,
|
|
1701
|
+
isTraveler: p.isTraveler,
|
|
1702
|
+
transform: u.transform,
|
|
1703
|
+
imageSrc: sA != null ? sA : AA
|
|
1712
1704
|
}) : void 0,
|
|
1713
|
-
nativeRect:
|
|
1714
|
-
x:
|
|
1715
|
-
y:
|
|
1716
|
-
width:
|
|
1717
|
-
height:
|
|
1705
|
+
nativeRect: Y !== void 0 ? {
|
|
1706
|
+
x: u.x !== void 0 ? parseFloat(u.x) : F.left + C,
|
|
1707
|
+
y: u.y !== void 0 ? parseFloat(u.y) : F.top + w,
|
|
1708
|
+
width: u.width !== void 0 ? parseFloat(u.width) : F.width,
|
|
1709
|
+
height: u.height !== void 0 ? parseFloat(u.height) : F.height
|
|
1718
1710
|
} : void 0,
|
|
1719
|
-
isFixed:
|
|
1720
|
-
clipElements:
|
|
1721
|
-
|
|
1722
|
-
|
|
1711
|
+
isFixed: P,
|
|
1712
|
+
clipElements: n,
|
|
1713
|
+
wasmIndex: G !== -1 ? G : void 0,
|
|
1714
|
+
children: GA,
|
|
1715
|
+
shaderHooks: cA
|
|
1723
1716
|
};
|
|
1724
1717
|
}
|
|
1725
|
-
function
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1718
|
+
function Ye(t, A, e) {
|
|
1719
|
+
if (A.size === 0)
|
|
1720
|
+
return;
|
|
1721
|
+
const s = /* @__PURE__ */ new Set();
|
|
1722
|
+
A.forEach((i, o) => {
|
|
1723
|
+
var g, n, a, I;
|
|
1724
|
+
const r = t.get(o);
|
|
1725
|
+
if (!(!r || !r.userData.basePosition)) {
|
|
1726
|
+
if (K.forceUpdateUniforms(r.material, {
|
|
1727
|
+
backgroundColor: i.backgroundColor,
|
|
1728
|
+
backgroundImage: i.backgroundImage,
|
|
1729
|
+
boxShadow: i.boxShadow,
|
|
1730
|
+
opacity: i.opacity,
|
|
1731
|
+
borderRadius: (n = i.borderRadius) != null ? n : (g = r.userData.baseStyles) == null ? void 0 : g.borderRadius
|
|
1732
|
+
}), r.userData.nativeMesh && (K.forceUpdateUniforms(r.userData.nativeMesh.material, {
|
|
1733
|
+
backgroundColor: i.backgroundColor,
|
|
1734
|
+
backgroundImage: i.backgroundImage,
|
|
1735
|
+
boxShadow: i.boxShadow,
|
|
1736
|
+
opacity: i.opacity,
|
|
1737
|
+
borderRadius: (I = i.borderRadius) != null ? I : (a = r.userData.baseStyles) == null ? void 0 : a.borderRadius
|
|
1738
|
+
}), i.scaleX !== void 0 || i.scaleY !== void 0)) {
|
|
1739
|
+
const c = r.userData.nativeMesh, h = c.scale.x, B = c.scale.y, C = c.scale.z;
|
|
1740
|
+
c.scale.set(
|
|
1741
|
+
i.scaleX !== void 0 ? i.scaleX * h : h,
|
|
1742
|
+
i.scaleY !== void 0 ? i.scaleY * B : B,
|
|
1743
|
+
i.scaleZ !== void 0 ? i.scaleZ * C : C
|
|
1744
|
+
);
|
|
1745
|
+
}
|
|
1746
|
+
if (i.layoutChanged || i.width !== void 0 || i.height !== void 0) {
|
|
1747
|
+
s.add(o);
|
|
1748
|
+
const c = o.querySelectorAll("*");
|
|
1749
|
+
for (let h = 0; h < c.length; h++) {
|
|
1750
|
+
const B = c[h];
|
|
1751
|
+
t.has(B) && s.add(B);
|
|
1752
|
+
}
|
|
1753
|
+
} else if ((i.x !== void 0 || i.y !== void 0) && e && r.userData.wasmIndex !== void 0) {
|
|
1754
|
+
const c = r.userData.wasmIndex * iA;
|
|
1755
|
+
i.x !== void 0 && r.userData.initialLocalX !== void 0 && (e[c + mA] = r.userData.initialLocalX + i.x), i.y !== void 0 && r.userData.initialLocalY !== void 0 && (e[c + pA] = r.userData.initialLocalY + i.y);
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
}), s.forEach((i) => {
|
|
1759
|
+
var n, a;
|
|
1760
|
+
const o = t.get(i);
|
|
1761
|
+
if (!o)
|
|
1762
|
+
return;
|
|
1763
|
+
const r = i.getBoundingClientRect();
|
|
1764
|
+
o.userData.domRect && (o.userData.domRect.width = r.width, o.userData.domRect.height = r.height);
|
|
1765
|
+
let g = ((n = o.material.userData) == null ? void 0 : n.shadowPadding) || 0;
|
|
1766
|
+
if (o.scale.set(r.width + g * 2, r.height + g * 2, 1), K.forceUpdateUniforms(o.material, {
|
|
1767
|
+
width: r.width,
|
|
1768
|
+
height: r.height
|
|
1769
|
+
}), e && o.userData.wasmIndex !== void 0) {
|
|
1770
|
+
const I = o.userData.wasmIndex * iA, c = r.left + (o.userData.isFixed ? 0 : window.scrollX), h = r.top + (o.userData.isFixed ? 0 : window.scrollY), B = e[I + LA];
|
|
1771
|
+
let C = 0, w = 0;
|
|
1772
|
+
if (B !== -1) {
|
|
1773
|
+
const Q = B * iA;
|
|
1774
|
+
C = e[Q + ie], w = e[Q + re];
|
|
1775
|
+
}
|
|
1776
|
+
e[I + mA] = c - C, e[I + pA] = h - w;
|
|
1777
|
+
}
|
|
1778
|
+
if (o.userData.nativeMesh) {
|
|
1779
|
+
const I = o.userData.nativeMesh;
|
|
1780
|
+
let c = ((a = I.material.userData) == null ? void 0 : a.shadowPadding) || 0;
|
|
1781
|
+
I.scale.set(r.width + c * 2, r.height + c * 2, 1), K.forceUpdateUniforms(I.material, {
|
|
1782
|
+
width: r.width,
|
|
1783
|
+
height: r.height
|
|
1784
|
+
}), o.userData.nativeRect && (o.userData.nativeRect.width = r.width, o.userData.nativeRect.height = r.height);
|
|
1785
|
+
}
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
class FA {
|
|
1789
|
+
__destroy_into_raw() {
|
|
1790
|
+
const A = this.__wbg_ptr;
|
|
1791
|
+
return this.__wbg_ptr = 0, te.unregister(this), A;
|
|
1792
|
+
}
|
|
1793
|
+
free() {
|
|
1794
|
+
const A = this.__destroy_into_raw();
|
|
1795
|
+
J.__wbg_memorymanager_free(A, 0);
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1798
|
+
* @returns {number}
|
|
1799
|
+
*/
|
|
1800
|
+
get_length() {
|
|
1801
|
+
return J.memorymanager_get_length(this.__wbg_ptr) >>> 0;
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* @returns {number}
|
|
1805
|
+
*/
|
|
1806
|
+
get_pointer() {
|
|
1807
|
+
return J.memorymanager_get_pointer(this.__wbg_ptr) >>> 0;
|
|
1808
|
+
}
|
|
1809
|
+
/**
|
|
1810
|
+
* @param {number} capacity
|
|
1811
|
+
*/
|
|
1812
|
+
constructor(A) {
|
|
1813
|
+
const e = J.memorymanager_new(A);
|
|
1814
|
+
return this.__wbg_ptr = e, te.register(this, this.__wbg_ptr, this), this;
|
|
1815
|
+
}
|
|
1816
|
+
/**
|
|
1817
|
+
* @param {number} node_count
|
|
1818
|
+
*/
|
|
1819
|
+
update_physics(A) {
|
|
1820
|
+
J.memorymanager_update_physics(this.__wbg_ptr, A);
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
Symbol.dispose && (FA.prototype[Symbol.dispose] = FA.prototype.free);
|
|
1824
|
+
function Ge() {
|
|
1825
|
+
return {
|
|
1826
|
+
__proto__: null,
|
|
1827
|
+
"./wasm_compute_bg.js": {
|
|
1828
|
+
__proto__: null,
|
|
1829
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(A, e) {
|
|
1830
|
+
throw new Error(ke(A, e));
|
|
1831
|
+
},
|
|
1832
|
+
__wbindgen_init_externref_table: function() {
|
|
1833
|
+
const A = J.__wbindgen_externrefs, e = A.grow(4);
|
|
1834
|
+
A.set(0, void 0), A.set(e + 0, void 0), A.set(e + 1, null), A.set(e + 2, !0), A.set(e + 3, !1);
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
const te = typeof FinalizationRegistry == "undefined" ? { register: () => {
|
|
1840
|
+
}, unregister: () => {
|
|
1841
|
+
} } : new FinalizationRegistry((t) => J.__wbg_memorymanager_free(t, 1));
|
|
1842
|
+
function ke(t, A) {
|
|
1843
|
+
return Xe(t >>> 0, A);
|
|
1844
|
+
}
|
|
1845
|
+
let wA = null;
|
|
1846
|
+
function Ue() {
|
|
1847
|
+
return (wA === null || wA.byteLength === 0) && (wA = new Uint8Array(J.memory.buffer)), wA;
|
|
1848
|
+
}
|
|
1849
|
+
let vA = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
|
|
1850
|
+
vA.decode();
|
|
1851
|
+
const He = 2146435072;
|
|
1852
|
+
let xA = 0;
|
|
1853
|
+
function Xe(t, A) {
|
|
1854
|
+
return xA += A, xA >= He && (vA = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), vA.decode(), xA = A), vA.decode(Ue().subarray(t, t + A));
|
|
1855
|
+
}
|
|
1856
|
+
let J;
|
|
1857
|
+
function Je(t, A) {
|
|
1858
|
+
return J = t.exports, wA = null, J.__wbindgen_start(), J;
|
|
1859
|
+
}
|
|
1860
|
+
function ze(t, A) {
|
|
1861
|
+
return eA(this, null, function* () {
|
|
1862
|
+
if (typeof Response == "function" && t instanceof Response) {
|
|
1863
|
+
if (!t.ok)
|
|
1864
|
+
throw new Error(`failed to fetch Wasm: ${t.status} ${t.statusText} fetching '${t.url}'`);
|
|
1865
|
+
if (typeof WebAssembly.instantiateStreaming == "function")
|
|
1866
|
+
try {
|
|
1867
|
+
return yield WebAssembly.instantiateStreaming(t, A);
|
|
1868
|
+
} catch (i) {
|
|
1869
|
+
if (e(t.type) && t.headers.get("Content-Type") !== "application/wasm")
|
|
1870
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", i);
|
|
1871
|
+
else
|
|
1872
|
+
throw i;
|
|
1873
|
+
}
|
|
1874
|
+
const s = yield t.arrayBuffer();
|
|
1875
|
+
return yield WebAssembly.instantiate(s, A);
|
|
1876
|
+
} else {
|
|
1877
|
+
const s = yield WebAssembly.instantiate(t, A);
|
|
1878
|
+
return s instanceof WebAssembly.Instance ? { instance: s, module: t } : s;
|
|
1879
|
+
}
|
|
1880
|
+
function e(s) {
|
|
1881
|
+
switch (s) {
|
|
1882
|
+
case "basic":
|
|
1883
|
+
case "cors":
|
|
1884
|
+
case "default":
|
|
1885
|
+
return !0;
|
|
1886
|
+
}
|
|
1887
|
+
return !1;
|
|
1888
|
+
}
|
|
1889
|
+
});
|
|
1890
|
+
}
|
|
1891
|
+
function _e(t) {
|
|
1892
|
+
return eA(this, null, function* () {
|
|
1893
|
+
if (J !== void 0)
|
|
1894
|
+
return J;
|
|
1895
|
+
t !== void 0 && (Object.getPrototypeOf(t) === Object.prototype ? { module_or_path: t } = t : console.warn("using deprecated parameters for the initialization function; pass a single object instead")), t === void 0 && (t = new URL("data:application/wasm;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iICRQ0AIAVBfEF4IAcoAgAiAUEDcRsgAUF4cWoiASABIAVLGyIBBEAgAiAKIAH8CgAACyACIQEgChADCyABCwwBCyAFRQRAQQEhAQwCCyAFQQEQJgsiAQ0AIAtBATYCBAwBCyALIAE2AgRBACEMC0EIIQELIAEgC2ogBTYCACALIAw2AgAgCSgCBEEBRgRAIAkoAgggCSgCDBAcAAsgCSgCCCEBIAAgDTYCACAAIAE2AgQgCUEQaiQAC6QEAgl/A30jAEEQayIFJAACQAJAIAAEQCAAQQhrIgYgBigCAEEBaiICNgIAIAJFDQEgACgCAA0CIABBfzYCACAFIAY2AgwgBSAANgIIIAUgAEEEaiIENgIEIAEEQCAEKAIIIQIgBCgCBCIJIQQDQAJAAkACQAJAAkACQAJAAkAgAiADQQFqSwRAIANBAmogAk8NASACIANNDQIgBEEEaioCACEMIARBCGoqAgAhDSAEKgIAIgtDAAAAAGBFBEAgA0EDaiACTw0EIARBDGogDDgCACADQQRqIAJPDQUgBEEQaiANOAIADAkLIAv8AUEFbCIHQQNqIgggAk8NBSAHQQRqIgcgAk8NBiACIANBA2oiCk0EQCAKIAJBjIPAABASAAsgCSAHQQJ0aioCACELIARBDGogDCAJIAhBAnRqKgIAkjgCACADQQRqIgggAkkNByAIIAJBnIPAABASAAsgA0EBaiACQZyCwAAQEgALIANBAmogAkGsgsAAEBIACyADIAJBvILAABASAAsgA0EDaiACQcyCwAAQEgALIANBBGogAkHcgsAAEBIACyAIIAJB7ILAABASAAsgByACQfyCwAAQEgALIARBEGogDSALkjgCAAsgBEEUaiEEIANBBWohAyABQQFrIgENAAsLIAAgACgCAEEBajYCACAGIAYoAgBBAWsiADYCACAARQRAIAVBDGoQEwsgBUEQaiQADwsQKAsACxApAAuNAQICfwF+IwBBIGsiAiQAIAEoAgBBf0YEQCABKAIMIQMgAkEANgIcIAJCgICAgBA3AhQgAkEUakHYhMAAIAMoAgAiAygCACADKAIEEAQaIAIgAigCHCIDNgIQIAIgAikCFCIENwMIIAEgAzYC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MDcwODA5MTAxMTEyMTMxNDE1MTYxNzE4MTkyMDIxMjIyMzI0MjUyNjI3MjgyOTMwMzEzMjMzMzQzNTM2MzczODM5NDA0MTQyNDM0NDQ1NDY0NzQ4NDk1MDUxNTI1MzU0NTU1NjU3NTg1OTYwNjE2MjYzNjQ2NTY2Njc2ODY5NzA3MTcyNzM3NDc1NzY3Nzc4Nzk4MDgxODI4Mzg0ODU4Njg3ODg4OTkwOTE5MjkzOTQ5NTk2OTc5ODk5AEG4icAACwUBAAAABAB8CXByb2R1Y2VycwIIbGFuZ3VhZ2UBBFJ1c3QADHByb2Nlc3NlZC1ieQMFcnVzdGMdMS45OC4xICg0OGEyMjljZWEgMjAyNi0wOS0wMSkGd2FscnVzBjAuMjYuNQx3YXNtLWJpbmRnZW4TMC4yLjEyOCAoMjQ2OTQ2ZmRkKQBrD3RhcmdldF9mZWF0dXJlcwYrD211dGFibGUtZ2xvYmFscysTbm9udHJhcHBpbmctZnB0b2ludCsLYnVsay1tZW1vcnkrCHNpZ24tZXh0Kw9yZWZlcmVuY2UtdHlwZXMrCm11bHRpdmFsdWU=", self.location));
|
|
1896
|
+
const A = Ge();
|
|
1897
|
+
(typeof t == "string" || typeof Request == "function" && t instanceof Request || typeof URL == "function" && t instanceof URL) && (t = fetch(t));
|
|
1898
|
+
const { instance: e, module: s } = yield ze(yield t, A);
|
|
1899
|
+
return Je(e);
|
|
1743
1900
|
});
|
|
1744
1901
|
}
|
|
1745
|
-
class
|
|
1746
|
-
constructor(
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1902
|
+
class We {
|
|
1903
|
+
constructor() {
|
|
1904
|
+
l(this, "memoryManager", null);
|
|
1905
|
+
l(this, "sharedArray", null);
|
|
1906
|
+
l(this, "isInitialized", !1);
|
|
1907
|
+
}
|
|
1908
|
+
/**
|
|
1909
|
+
* Initialize Wasm instance and allocate a 1D Float32Array shared memory
|
|
1910
|
+
* @param capacity The number of Float32 elements to allocate
|
|
1911
|
+
*/
|
|
1912
|
+
initialize(A) {
|
|
1913
|
+
return eA(this, null, function* () {
|
|
1914
|
+
if (!this.isInitialized)
|
|
1915
|
+
try {
|
|
1916
|
+
const e = yield _e();
|
|
1917
|
+
this.memoryManager = new FA(A);
|
|
1918
|
+
const s = this.memoryManager.get_pointer(), i = this.memoryManager.get_length();
|
|
1919
|
+
this.sharedArray = new Float32Array(e.memory.buffer, s, i), this.isInitialized = !0, console.log(`[WasmSynchronizer] Initialized with capacity: ${A} floats (${A * 4} bytes)`);
|
|
1920
|
+
} catch (e) {
|
|
1921
|
+
throw console.error("[WasmSynchronizer] Failed to initialize Wasm:", e), e;
|
|
1922
|
+
}
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
getSharedArray() {
|
|
1926
|
+
if (!this.isInitialized || !this.sharedArray)
|
|
1927
|
+
throw new Error("WasmSynchronizer is not initialized yet. Call initialize() first.");
|
|
1928
|
+
return this.sharedArray;
|
|
1929
|
+
}
|
|
1930
|
+
updatePhysics(A) {
|
|
1931
|
+
this.isInitialized && this.memoryManager && this.memoryManager.update_physics(A);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
class Ke {
|
|
1935
|
+
constructor(A, e, s, i) {
|
|
1936
|
+
l(this, "target");
|
|
1937
|
+
l(this, "renderer");
|
|
1938
|
+
l(this, "registry");
|
|
1939
|
+
l(this, "isTravelEnabled", !1);
|
|
1940
|
+
l(this, "wasmSync");
|
|
1941
|
+
l(this, "lastWasmNodeCount", 0);
|
|
1942
|
+
l(this, "tracker");
|
|
1943
|
+
this.target = A, this.renderer = e, this.registry = s, this.wasmSync = new We(), this.tracker = new oe(A, {
|
|
1944
|
+
resizeDebounce: i.resizeDebounce
|
|
1945
|
+
}), this.tracker.onLayoutChange.add((o, r) => {
|
|
1946
|
+
document.querySelector(`[${H.NAME}~='${H.VALUES.TRAVELER}']`) !== null && !this.isTravelEnabled && (this.isTravelEnabled = !0, this.renderer.createRenderTarget());
|
|
1947
|
+
const n = this.wasmSync.sharedArray;
|
|
1948
|
+
this.renderer.updateScroll();
|
|
1949
|
+
const a = {
|
|
1950
|
+
sharedArray: n || new Float32Array(),
|
|
1951
|
+
currentIndex: 0,
|
|
1952
|
+
scrollX: this.renderer.getScrollX(),
|
|
1953
|
+
scrollY: this.renderer.getScrollY()
|
|
1954
|
+
}, I = ce(
|
|
1757
1955
|
this.target,
|
|
1758
|
-
|
|
1759
|
-
|
|
1956
|
+
o,
|
|
1957
|
+
q,
|
|
1760
1958
|
1,
|
|
1761
1959
|
0,
|
|
1762
|
-
this.renderer.qualityFactor
|
|
1960
|
+
this.renderer.qualityFactor,
|
|
1961
|
+
void 0,
|
|
1962
|
+
void 0,
|
|
1963
|
+
void 0,
|
|
1964
|
+
a
|
|
1763
1965
|
);
|
|
1764
|
-
|
|
1765
|
-
}), this.tracker.onStyleChange.add((
|
|
1766
|
-
|
|
1966
|
+
I && (this.lastWasmNodeCount = a.currentIndex, this.renderer.syncScene(I, r), n && this.renderer.saveInitialLocals(n));
|
|
1967
|
+
}), this.tracker.onStyleChange.add((o) => {
|
|
1968
|
+
Ye(this.registry, o, this.wasmSync.sharedArray || void 0);
|
|
1767
1969
|
}), this.tracker.onRender.add(() => {
|
|
1768
|
-
this.renderer.
|
|
1970
|
+
this.renderer.updateScroll(), this.wasmSync.updatePhysics(this.lastWasmNodeCount), this.wasmSync.sharedArray && this.renderer.syncMeshesByWasm(this.wasmSync.sharedArray), this.renderer.render();
|
|
1769
1971
|
});
|
|
1770
1972
|
}
|
|
1771
1973
|
start() {
|
|
1772
|
-
this
|
|
1974
|
+
return eA(this, null, function* () {
|
|
1975
|
+
yield this.wasmSync.initialize(1e4 * iA), this.tracker.start();
|
|
1976
|
+
});
|
|
1773
1977
|
}
|
|
1774
1978
|
stop() {
|
|
1775
1979
|
this.tracker.stop();
|
|
1776
1980
|
}
|
|
1777
1981
|
}
|
|
1778
|
-
class
|
|
1982
|
+
class Oe {
|
|
1779
1983
|
constructor() {
|
|
1780
|
-
|
|
1984
|
+
l(this, "store");
|
|
1781
1985
|
this.store = /* @__PURE__ */ new WeakMap();
|
|
1782
1986
|
}
|
|
1783
|
-
register(
|
|
1784
|
-
this.store.set(
|
|
1987
|
+
register(A, e) {
|
|
1988
|
+
this.store.set(A, e);
|
|
1785
1989
|
}
|
|
1786
|
-
get(
|
|
1787
|
-
return this.store.get(
|
|
1990
|
+
get(A) {
|
|
1991
|
+
return this.store.get(A);
|
|
1788
1992
|
}
|
|
1789
1993
|
// public register(element: HTMLElement, meshGroup: THREE.Group): void {
|
|
1790
1994
|
// this.store.set(element, meshGroup);
|
|
@@ -1792,41 +1996,43 @@ class ht {
|
|
|
1792
1996
|
// public get(element: HTMLElement): THREE.Group | undefined {
|
|
1793
1997
|
// return this.store.get(element);
|
|
1794
1998
|
// }
|
|
1795
|
-
has(
|
|
1796
|
-
return this.store.has(
|
|
1999
|
+
has(A) {
|
|
2000
|
+
return this.store.has(A);
|
|
1797
2001
|
}
|
|
1798
2002
|
// Optional
|
|
1799
|
-
remove(
|
|
1800
|
-
this.store.delete(
|
|
2003
|
+
remove(A) {
|
|
2004
|
+
this.store.delete(A);
|
|
1801
2005
|
}
|
|
1802
2006
|
}
|
|
1803
|
-
class
|
|
1804
|
-
constructor(
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
var
|
|
1810
|
-
if (this.target =
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1813
|
-
[${
|
|
2007
|
+
class je {
|
|
2008
|
+
constructor(A, e) {
|
|
2009
|
+
l(this, "renderer");
|
|
2010
|
+
l(this, "syncer");
|
|
2011
|
+
l(this, "target");
|
|
2012
|
+
l(this, "registry");
|
|
2013
|
+
var i, o, r;
|
|
2014
|
+
if (this.target = A, this.registry = new Oe(), !document.getElementById("mirage-engine-styles")) {
|
|
2015
|
+
const g = document.createElement("style");
|
|
2016
|
+
g.id = "mirage-engine-styles", g.textContent = `
|
|
2017
|
+
[${tA.NAME}="${tA.VALUES.HIDE}"] {
|
|
1814
2018
|
opacity: 0 !important;
|
|
1815
2019
|
}
|
|
1816
|
-
`, document.head.appendChild(
|
|
2020
|
+
`, document.head.appendChild(g);
|
|
1817
2021
|
}
|
|
1818
|
-
let
|
|
1819
|
-
if (
|
|
2022
|
+
let s;
|
|
2023
|
+
if (e.mode === "duplicate" ? s = (o = (i = e.container) != null ? i : this.target.parentElement) != null ? o : void 0 : s = (r = this.target.parentElement) != null ? r : void 0, !s)
|
|
1820
2024
|
throw new Error("[Mirage] Cannot find a container (parent or option).");
|
|
1821
|
-
this.renderer = new
|
|
2025
|
+
this.renderer = new Fe(
|
|
1822
2026
|
this.target,
|
|
1823
|
-
|
|
1824
|
-
|
|
2027
|
+
e,
|
|
2028
|
+
s,
|
|
1825
2029
|
this.registry
|
|
1826
|
-
), this.renderer.mount(), this.syncer = new
|
|
2030
|
+
), this.renderer.mount(), this.syncer = new Ke(this.target, this.renderer, this.registry, e);
|
|
1827
2031
|
}
|
|
1828
2032
|
start() {
|
|
1829
|
-
this
|
|
2033
|
+
return eA(this, null, function* () {
|
|
2034
|
+
yield this.syncer.start();
|
|
2035
|
+
});
|
|
1830
2036
|
}
|
|
1831
2037
|
stop() {
|
|
1832
2038
|
this.syncer.stop();
|
|
@@ -1837,53 +2043,53 @@ class dt {
|
|
|
1837
2043
|
getTracker() {
|
|
1838
2044
|
return this.syncer.tracker;
|
|
1839
2045
|
}
|
|
1840
|
-
updateUniforms(
|
|
1841
|
-
this.renderer.updateUniforms(
|
|
2046
|
+
updateUniforms(A, e) {
|
|
2047
|
+
this.renderer.updateUniforms(A, e);
|
|
1842
2048
|
}
|
|
1843
2049
|
getCanvas() {
|
|
1844
2050
|
return this.renderer.canvas;
|
|
1845
2051
|
}
|
|
1846
2052
|
test() {
|
|
1847
|
-
const
|
|
2053
|
+
const A = this.registry.get(
|
|
1848
2054
|
document.querySelector("#box2")
|
|
1849
2055
|
);
|
|
1850
|
-
if (!
|
|
2056
|
+
if (!A)
|
|
1851
2057
|
return;
|
|
1852
|
-
const
|
|
2058
|
+
const e = {
|
|
1853
2059
|
ArrowRight: !1,
|
|
1854
2060
|
ArrowLeft: !1,
|
|
1855
2061
|
ArrowUp: !1,
|
|
1856
2062
|
ArrowDown: !1
|
|
1857
2063
|
};
|
|
1858
|
-
window.addEventListener("keydown", (
|
|
1859
|
-
|
|
1860
|
-
}), window.addEventListener("keyup", (
|
|
1861
|
-
|
|
2064
|
+
window.addEventListener("keydown", (o) => {
|
|
2065
|
+
e[o.key] !== void 0 && (e[o.key] = !0);
|
|
2066
|
+
}), window.addEventListener("keyup", (o) => {
|
|
2067
|
+
e[o.key] !== void 0 && (e[o.key] = !1);
|
|
1862
2068
|
});
|
|
1863
|
-
const
|
|
1864
|
-
requestAnimationFrame(
|
|
2069
|
+
const s = 2, i = () => {
|
|
2070
|
+
requestAnimationFrame(i), e.ArrowRight && A.position.setX(A.position.x + s), e.ArrowLeft && A.position.setX(A.position.x - s), e.ArrowUp && A.position.setY(A.position.y + s), e.ArrowDown && A.position.setY(A.position.y - s);
|
|
1865
2071
|
};
|
|
1866
|
-
|
|
2072
|
+
i();
|
|
1867
2073
|
}
|
|
1868
2074
|
}
|
|
1869
|
-
class
|
|
1870
|
-
constructor(
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
this.frontSelector =
|
|
2075
|
+
class qe {
|
|
2076
|
+
constructor(A = {}) {
|
|
2077
|
+
l(this, "frontSelector");
|
|
2078
|
+
l(this, "midLayerElement");
|
|
2079
|
+
l(this, "items", []);
|
|
2080
|
+
l(this, "isInitialized", !1);
|
|
2081
|
+
l(this, "midLayer", null);
|
|
2082
|
+
l(this, "frontLayer", null);
|
|
2083
|
+
l(this, "tracker", null);
|
|
2084
|
+
this.frontSelector = A.frontSelector || ".front", this.midLayerElement = A.midLayerElement || null, this.items = [], this.isInitialized = !1, this.tracker = new oe(document.body, A.trackerConfig || { resizeDebounce: !0 });
|
|
1879
2085
|
}
|
|
1880
2086
|
init() {
|
|
1881
|
-
var
|
|
1882
|
-
this.isInitialized || (this.createLayers(), this.setupMidLayer(), this.hijackFrontElements(), this.setupHooks(), (
|
|
2087
|
+
var A;
|
|
2088
|
+
this.isInitialized || (this.createLayers(), this.setupMidLayer(), this.hijackFrontElements(), this.setupHooks(), (A = this.tracker) == null || A.start(), this.isInitialized = !0, console.log("🥪 sand-telepochi initialized!"));
|
|
1883
2089
|
}
|
|
1884
2090
|
// Allow passing an existing tracker (e.g. from mirage-engine/core)
|
|
1885
|
-
useTracker(
|
|
1886
|
-
this.tracker =
|
|
2091
|
+
useTracker(A) {
|
|
2092
|
+
this.tracker = A, this.setupHooks();
|
|
1887
2093
|
}
|
|
1888
2094
|
createLayers() {
|
|
1889
2095
|
this.midLayer = document.createElement("div"), this.midLayer.id = "sand-layer-mid", Object.assign(this.midLayer.style, {
|
|
@@ -1902,56 +2108,58 @@ class ut {
|
|
|
1902
2108
|
this.midLayerElement && this.midLayer && (this.midLayer.appendChild(this.midLayerElement), this.midLayerElement.style.pointerEvents = "auto");
|
|
1903
2109
|
}
|
|
1904
2110
|
hijackFrontElements() {
|
|
1905
|
-
const
|
|
1906
|
-
this.frontLayer &&
|
|
1907
|
-
var
|
|
1908
|
-
const
|
|
1909
|
-
|
|
1910
|
-
display:
|
|
1911
|
-
width: `${
|
|
1912
|
-
height: `${
|
|
2111
|
+
const A = document.querySelectorAll(this.frontSelector);
|
|
2112
|
+
this.frontLayer && A.forEach((e) => {
|
|
2113
|
+
var r;
|
|
2114
|
+
const s = e.getBoundingClientRect(), i = window.getComputedStyle(e), o = document.createElement("div");
|
|
2115
|
+
o.className = "sand-placeholder", Object.assign(o.style, {
|
|
2116
|
+
display: i.display === "inline" ? "inline-block" : i.display,
|
|
2117
|
+
width: `${s.width}px`,
|
|
2118
|
+
height: `${s.height}px`,
|
|
1913
2119
|
boxSizing: "border-box",
|
|
1914
|
-
marginTop:
|
|
1915
|
-
marginBottom:
|
|
1916
|
-
marginLeft:
|
|
1917
|
-
marginRight:
|
|
2120
|
+
marginTop: i.marginTop,
|
|
2121
|
+
marginBottom: i.marginBottom,
|
|
2122
|
+
marginLeft: i.marginLeft,
|
|
2123
|
+
marginRight: i.marginRight,
|
|
1918
2124
|
visibility: "hidden",
|
|
1919
2125
|
pointerEvents: "none"
|
|
1920
|
-
}), (
|
|
2126
|
+
}), (r = e.parentNode) == null || r.insertBefore(o, e), this.frontLayer.appendChild(e), Object.assign(e.style, {
|
|
1921
2127
|
position: "fixed",
|
|
1922
2128
|
margin: "0",
|
|
1923
2129
|
boxSizing: "border-box",
|
|
1924
|
-
width: `${
|
|
1925
|
-
height: `${
|
|
2130
|
+
width: `${s.width}px`,
|
|
2131
|
+
height: `${s.height}px`,
|
|
1926
2132
|
pointerEvents: "auto"
|
|
1927
|
-
}), this.items.push({ placeholder:
|
|
2133
|
+
}), this.items.push({ placeholder: o, original: e });
|
|
1928
2134
|
});
|
|
1929
2135
|
}
|
|
1930
2136
|
setupHooks() {
|
|
1931
2137
|
this.tracker && this.tracker.onBeforeRender.add(() => {
|
|
1932
|
-
const
|
|
1933
|
-
this.items.forEach(({ original:
|
|
1934
|
-
const
|
|
1935
|
-
|
|
2138
|
+
const A = this.items.map(({ placeholder: e }) => e.getBoundingClientRect());
|
|
2139
|
+
this.items.forEach(({ original: e }, s) => {
|
|
2140
|
+
const i = A[s];
|
|
2141
|
+
e.style.top = `${i.top}px`, e.style.left = `${i.left}px`, e.style.width = `${i.width}px`, e.style.height = `${i.height}px`;
|
|
1936
2142
|
});
|
|
1937
2143
|
});
|
|
1938
2144
|
}
|
|
1939
2145
|
}
|
|
1940
|
-
class
|
|
1941
|
-
constructor(
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
if (!
|
|
2146
|
+
class Ze {
|
|
2147
|
+
constructor(A, e) {
|
|
2148
|
+
l(this, "_engine");
|
|
2149
|
+
l(this, "_sandwich");
|
|
2150
|
+
if (!A)
|
|
1945
2151
|
throw new Error("[Mirage] Target element is required.");
|
|
1946
|
-
if (this._engine = new
|
|
1947
|
-
const
|
|
1948
|
-
this._sandwich = new
|
|
1949
|
-
frontSelector:
|
|
2152
|
+
if (this._engine = new je(A, e), e.sandwich !== !1) {
|
|
2153
|
+
const s = typeof e.sandwich == "object" ? e.sandwich : {};
|
|
2154
|
+
this._sandwich = new qe({
|
|
2155
|
+
frontSelector: s.frontSelector || `[${ZA.NAME}='${ZA.VALUES.FRONT}']`
|
|
1950
2156
|
}), this._sandwich.useTracker(this._engine.getTracker());
|
|
1951
2157
|
}
|
|
1952
2158
|
}
|
|
1953
2159
|
start() {
|
|
1954
|
-
this
|
|
2160
|
+
return eA(this, null, function* () {
|
|
2161
|
+
yield this._engine.start(), this._sandwich && this._sandwich.init();
|
|
2162
|
+
});
|
|
1955
2163
|
}
|
|
1956
2164
|
stop() {
|
|
1957
2165
|
this._engine.stop();
|
|
@@ -1965,13 +2173,13 @@ class gt {
|
|
|
1965
2173
|
getCanvas() {
|
|
1966
2174
|
return this._engine.getCanvas();
|
|
1967
2175
|
}
|
|
1968
|
-
updateUniforms(
|
|
1969
|
-
this._engine.updateUniforms(
|
|
2176
|
+
updateUniforms(A, e) {
|
|
2177
|
+
this._engine.updateUniforms(A, e);
|
|
1970
2178
|
}
|
|
1971
2179
|
test() {
|
|
1972
2180
|
this._engine.test();
|
|
1973
2181
|
}
|
|
1974
2182
|
}
|
|
1975
2183
|
export {
|
|
1976
|
-
|
|
2184
|
+
Ze as Mirage
|
|
1977
2185
|
};
|