modern-canvas 0.24.11 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +426 -506
- package/dist/render.d.ts +3 -0
- package/dist/scene/2d/element/Element2DFill.d.ts +15 -2
- package/dist/scene/2d/element/Element2DForeground.d.ts +6 -36
- package/dist/scene/2d/element/imagePipeline.d.ts +10 -0
- package/dist/scene/2d/element/index.d.ts +1 -0
- package/dist/scene/main/SceneTree.d.ts +7 -0
- package/package.json +2 -2
- package/dist/scene/2d/element/bakeImageEffects.d.ts +0 -17
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Observable as e, RawWeakMap as t, Reactivable as n, clearUndef as r, defineProperty as i, getDefaultLayoutStyle as a, getDefaultStyle as o, getDefaultTextStyle as s, idGenerator as c, isColorFillObject as l, isGradient as u, isNone as d, normalizeBackground as f, normalizeChart as p, normalizeComments as m, normalizeConnection as h, normalizeFill as g, normalizeForeground as ee, normalizeOutline as te, normalizeShadow as ne, normalizeShape as re, normalizeTable as ie, normalizeText as ae, normalizeTextContent as oe, parseColor as se, property as _, stringifyFilter as ce } from "modern-idoc";
|
|
2
|
-
import { BoundingBox as le, Path2D as
|
|
3
|
-
import { extend as
|
|
4
|
-
import
|
|
5
|
-
import { fonts as
|
|
6
|
-
import { Character as
|
|
2
|
+
import { BoundingBox as le, Path2D as ue, Path2DSet as de, PathMeasure as v, Transform2D as y, Vector2 as b, svgToDom as fe, svgToPath2DSet as pe } from "modern-path2d";
|
|
3
|
+
import { extend as me } from "colord";
|
|
4
|
+
import he from "colord/plugins/names";
|
|
5
|
+
import { fonts as ge } from "modern-font";
|
|
6
|
+
import { Character as _e, Text as ve } from "modern-text";
|
|
7
7
|
//#region src/core/decorators/customNode.ts
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var ye = /* @__PURE__ */ new Map();
|
|
9
|
+
function x(e, t) {
|
|
10
10
|
return function(n) {
|
|
11
11
|
Object.defineProperty(n.prototype, "is", {
|
|
12
12
|
value: e,
|
|
@@ -14,19 +14,19 @@ function S(e, t) {
|
|
|
14
14
|
configurable: !0
|
|
15
15
|
}), t && Object.keys(t).forEach((e) => {
|
|
16
16
|
i(n, e, { fallback: t[e] });
|
|
17
|
-
}),
|
|
17
|
+
}), ye.set(e, n);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/core/global/createNode.ts
|
|
22
|
-
function
|
|
23
|
-
let n =
|
|
22
|
+
function be(e = "node", t = {}) {
|
|
23
|
+
let n = ye.get(e);
|
|
24
24
|
if (!n) throw Error(`Failed to createNode, tag: ${e}`);
|
|
25
25
|
return new n().setProperties(t);
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/core/global/Ticker.ts
|
|
29
|
-
var
|
|
29
|
+
var S = class {
|
|
30
30
|
static _queue = [];
|
|
31
31
|
static _currentTime = 0;
|
|
32
32
|
static _elapsed = 0;
|
|
@@ -83,12 +83,12 @@ var C = class {
|
|
|
83
83
|
this._queue = t;
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
|
|
86
|
+
S.start();
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/core/global/nextTick.ts
|
|
89
|
-
async function
|
|
89
|
+
async function xe(e) {
|
|
90
90
|
return new Promise((t) => {
|
|
91
|
-
|
|
91
|
+
S.on(() => {
|
|
92
92
|
e?.(), t();
|
|
93
93
|
}, {
|
|
94
94
|
sort: 1,
|
|
@@ -98,11 +98,11 @@ async function be(e) {
|
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/core/shared/utils.ts
|
|
101
|
-
var
|
|
102
|
-
function
|
|
101
|
+
var Se = Math.PI, Ce = Se * 2;
|
|
102
|
+
function we(e) {
|
|
103
103
|
return !(e & e - 1) && !!e;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Te(e, t, n) {
|
|
106
106
|
let r = Math.max(0, Math.floor(e)), i = Math.max(0, Math.floor(t)), a = Math.max(1, Math.floor(n)), o = [];
|
|
107
107
|
if (!r || !i) return o;
|
|
108
108
|
let s = Math.min(r, a), c = Math.min(i, a), l = Math.ceil(r / s), u = Math.ceil(i / c);
|
|
@@ -119,8 +119,8 @@ function we(e, t, n) {
|
|
|
119
119
|
}
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/core/shared/css.ts
|
|
122
|
-
var
|
|
123
|
-
function
|
|
122
|
+
var Ee = /([\w-]+)\((.+?)\)/g, De = /[^,]+/g, Oe = /([-e.\d]+)(.*)/;
|
|
123
|
+
function ke(e) {
|
|
124
124
|
return Array.isArray(e) ? e.map((e) => ({
|
|
125
125
|
name: e.name,
|
|
126
126
|
args: e.args.map((e) => ({
|
|
@@ -132,31 +132,31 @@ function Oe(e) {
|
|
|
132
132
|
normalizedIntValue: e.normalizedDefaultIntValue
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
let r =
|
|
137
|
-
return r.length ? r :
|
|
135
|
+
function Ae(e, t, n = {}) {
|
|
136
|
+
let r = je(t, n);
|
|
137
|
+
return r.length ? r : Ne(e, t, n);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function je(e, t = {}) {
|
|
140
140
|
let n = [], r;
|
|
141
|
-
for (; (r =
|
|
141
|
+
for (; (r = Ee.exec(e)) !== null;) {
|
|
142
142
|
let [, e, i] = r;
|
|
143
143
|
e && n.push({
|
|
144
144
|
name: e,
|
|
145
|
-
args:
|
|
145
|
+
args: Me(e, i, t)
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
return n;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Me(e, t, n = {}) {
|
|
151
151
|
let r = [], i, a = 0;
|
|
152
|
-
for (; (i =
|
|
152
|
+
for (; (i = De.exec(t)) !== null;) r.push(Ne(e, i[0], {
|
|
153
153
|
...n,
|
|
154
154
|
index: a++
|
|
155
155
|
}));
|
|
156
156
|
return r;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(
|
|
158
|
+
function Ne(e, t, n = {}) {
|
|
159
|
+
let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(Oe), s = {
|
|
160
160
|
unit: o?.[2] ?? null,
|
|
161
161
|
value: t,
|
|
162
162
|
intValue: Number(o?.[1]),
|
|
@@ -176,7 +176,7 @@ function Me(e, t, n = {}) {
|
|
|
176
176
|
s.normalizedIntValue = s.intValue / 100;
|
|
177
177
|
break;
|
|
178
178
|
case "rad":
|
|
179
|
-
s.normalizedIntValue = s.intValue /
|
|
179
|
+
s.normalizedIntValue = s.intValue / Ce;
|
|
180
180
|
break;
|
|
181
181
|
case "deg":
|
|
182
182
|
s.normalizedIntValue = s.intValue / 360;
|
|
@@ -199,48 +199,48 @@ function Me(e, t, n = {}) {
|
|
|
199
199
|
}
|
|
200
200
|
//#endregion
|
|
201
201
|
//#region src/core/shared/dom.ts
|
|
202
|
-
var
|
|
203
|
-
function
|
|
202
|
+
var Pe = "WebGL2RenderingContext" in globalThis, Fe = "ImageBitmap" in globalThis, Ie = "ResizeObserver" in globalThis, Le = "PointerEvent" in globalThis, Re = "WheelEvent" in globalThis, ze = "MouseEvent" in globalThis, Be = "ontouchstart" in globalThis, Ve = "onclick" in globalThis, He = "createImageBitmap" in globalThis, Ue = "AudioContext" in globalThis, We = "webkitAudioContext" in globalThis, Ge = "OfflineAudioContext" in globalThis, Ke = "webkitOfflineAudioContext" in globalThis, qe = Ue || We, Je = typeof window < "u", Ye = typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, Xe = globalThis.devicePixelRatio || 1, Ze = (e) => typeof e == "object" && !!e && e.nodeType === 1, Qe = (e) => Ze(e) && e.tagName === "VIDEO", $e = (e) => Ze(e) && e.tagName === "IMG";
|
|
203
|
+
function et(e) {
|
|
204
204
|
return typeof e == "object" && !!e && e.nodeType === 1 && e.tagName === "CANVAS";
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
206
|
+
function tt(e) {
|
|
207
|
+
return Pe && e instanceof globalThis.WebGL2RenderingContext;
|
|
208
208
|
}
|
|
209
|
-
var
|
|
210
|
-
function
|
|
211
|
-
|
|
209
|
+
var nt;
|
|
210
|
+
function rt(e) {
|
|
211
|
+
nt = e;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return
|
|
213
|
+
function it() {
|
|
214
|
+
return nt;
|
|
215
215
|
}
|
|
216
|
-
var
|
|
217
|
-
function
|
|
218
|
-
|
|
216
|
+
var at;
|
|
217
|
+
function ot(e) {
|
|
218
|
+
at = e;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return
|
|
220
|
+
function st() {
|
|
221
|
+
return at;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function C(e, t) {
|
|
224
224
|
let n;
|
|
225
|
-
return
|
|
225
|
+
return nt ? n = nt(e, t) : Je && (n = globalThis.document.createElement("canvas")), n && (e !== void 0 && (n.width = e), t !== void 0 && (n.height = t)), n;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function ct(e, t = globalThis.location) {
|
|
228
228
|
if (e.startsWith("data:") || !t || typeof document > "u") return "";
|
|
229
229
|
let n = new URL(e, document.baseURI);
|
|
230
230
|
return n.hostname !== t.hostname || n.port !== t.port || n.protocol !== t.protocol ? "anonymous" : "";
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
n === null && !t.startsWith("data:") ? e.crossOrigin =
|
|
232
|
+
function lt(e, t, n) {
|
|
233
|
+
n === null && !t.startsWith("data:") ? e.crossOrigin = ct(t) : n !== !1 && (e.crossOrigin = typeof n == "string" ? n : "anonymous");
|
|
234
234
|
}
|
|
235
235
|
//#endregion
|
|
236
236
|
//#region src/core/shared/id.ts
|
|
237
|
-
var
|
|
238
|
-
function
|
|
239
|
-
return ++
|
|
237
|
+
var ut = 0;
|
|
238
|
+
function dt() {
|
|
239
|
+
return ++ut;
|
|
240
240
|
}
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region src/core/input/InputEvent.ts
|
|
243
|
-
var
|
|
243
|
+
var ft = class e {
|
|
244
244
|
cursor;
|
|
245
245
|
bubbles = !1;
|
|
246
246
|
cancelBubble = !1;
|
|
@@ -275,14 +275,14 @@ var dt = class e {
|
|
|
275
275
|
initUIEvent(...e) {
|
|
276
276
|
throw Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
277
277
|
}
|
|
278
|
-
},
|
|
278
|
+
}, pt = class extends ft {
|
|
279
279
|
getModifierState(...e) {
|
|
280
280
|
throw Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
281
281
|
}
|
|
282
282
|
initKeyboardEvent(...e) {
|
|
283
283
|
throw Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
284
284
|
}
|
|
285
|
-
},
|
|
285
|
+
}, mt = class extends ft {
|
|
286
286
|
client = {
|
|
287
287
|
x: 0,
|
|
288
288
|
y: 0
|
|
@@ -365,7 +365,7 @@ var dt = class e {
|
|
|
365
365
|
get globalY() {
|
|
366
366
|
return this.global.y;
|
|
367
367
|
}
|
|
368
|
-
},
|
|
368
|
+
}, ht = class extends mt {
|
|
369
369
|
width = 0;
|
|
370
370
|
height = 0;
|
|
371
371
|
isPrimary = !1;
|
|
@@ -375,20 +375,20 @@ var dt = class e {
|
|
|
375
375
|
getPredictedEvents() {
|
|
376
376
|
throw Error("getPredictedEvents is not supported!");
|
|
377
377
|
}
|
|
378
|
-
},
|
|
378
|
+
}, gt = class extends mt {
|
|
379
379
|
static DOM_DELTA_PIXEL = 0;
|
|
380
380
|
DOM_DELTA_PIXEL = 0;
|
|
381
381
|
static DOM_DELTA_LINE = 1;
|
|
382
382
|
DOM_DELTA_LINE = 1;
|
|
383
383
|
static DOM_DELTA_PAGE = 2;
|
|
384
384
|
DOM_DELTA_PAGE = 2;
|
|
385
|
-
},
|
|
385
|
+
}, _t = {
|
|
386
386
|
touchstart: "pointerdown",
|
|
387
387
|
touchend: "pointerup",
|
|
388
388
|
touchendoutside: "pointerupoutside",
|
|
389
389
|
touchmove: "pointermove",
|
|
390
390
|
touchcancel: "pointercancel"
|
|
391
|
-
},
|
|
391
|
+
}, vt = class extends e {
|
|
392
392
|
event;
|
|
393
393
|
target;
|
|
394
394
|
cursor = "default";
|
|
@@ -406,21 +406,21 @@ var dt = class e {
|
|
|
406
406
|
removeEventListeners() {
|
|
407
407
|
if (!this.setuped || !this.target) return;
|
|
408
408
|
let e = this.target.style;
|
|
409
|
-
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") :
|
|
409
|
+
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : Le && (e.touchAction = ""), Le ? (this.target.removeEventListener("pointerdown", this._onPointerDown), this.target.removeEventListener("pointerleave", this._onPointerOver), this.target.removeEventListener("pointerover", this._onPointerOver), this.target.removeEventListener("pointermove", this._onPointerMove), this.target.removeEventListener("pointerup", this._onPointerUp)) : (this.target.removeEventListener("mousedown", this._onPointerDown), this.target.removeEventListener("mouseout", this._onPointerOver), this.target.removeEventListener("mouseover", this._onPointerOver), this.target.removeEventListener("mousemove", this._onPointerMove), this.target.removeEventListener("mouseup", this._onPointerUp)), Be && (this.target.removeEventListener("touchstart", this._onPointerDown), this.target.removeEventListener("touchmove", this._onPointerMove), this.target.removeEventListener("touchend", this._onPointerUp)), this.target.removeEventListener("wheel", this._onWheel), typeof document < "u" && (document.removeEventListener("keydown", this._onKeyDown), document.removeEventListener("keypress", this._onKeyPress), document.removeEventListener("keyup", this._onKeyUp)), this.target = void 0, this.setuped = !1;
|
|
410
410
|
}
|
|
411
411
|
addEventListeners() {
|
|
412
412
|
if (this.setuped || !this.target) return;
|
|
413
413
|
let e = this.target.style;
|
|
414
|
-
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") :
|
|
414
|
+
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : Le && (e.touchAction = "none")), Le ? (this.target.addEventListener("pointerdown", this._onPointerDown), this.target.addEventListener("pointerleave", this._onPointerOver), this.target.addEventListener("pointerover", this._onPointerOver), this.target.addEventListener("pointermove", this._onPointerMove), this.target.addEventListener("pointerup", this._onPointerUp)) : (this.target.addEventListener("mousedown", this._onPointerDown), this.target.addEventListener("mouseout", this._onPointerOver), this.target.addEventListener("mouseover", this._onPointerOver), this.target.addEventListener("mousemove", this._onPointerMove), this.target.addEventListener("mouseup", this._onPointerUp)), Be && (this.target.addEventListener("touchstart", this._onPointerDown), this.target.addEventListener("touchmove", this._onPointerMove), this.target.addEventListener("touchend", this._onPointerUp)), this.target.addEventListener("wheel", this._onWheel), typeof document < "u" && (document.addEventListener("keydown", this._onKeyDown), document.addEventListener("keypress", this._onKeyPress), document.addEventListener("keyup", this._onKeyUp)), this.setuped = !0;
|
|
415
415
|
}
|
|
416
416
|
normalize(e) {
|
|
417
417
|
let t = [];
|
|
418
|
-
if (
|
|
418
|
+
if (Be && e instanceof globalThis.TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
|
|
419
419
|
let r = e.changedTouches[n];
|
|
420
420
|
r.button === void 0 && (r.button = 0), r.buttons === void 0 && (r.buttons = 1), r.isPrimary === void 0 && (r.isPrimary = e.touches.length === 1 && e.type === "touchstart"), r.width === void 0 && (r.width = r.radiusX || 1), r.height === void 0 && (r.height = r.radiusY || 1), r.tiltX === void 0 && (r.tiltX = 0), r.tiltY === void 0 && (r.tiltY = 0), r.pointerType === void 0 && (r.pointerType = "touch"), r.pointerId === void 0 && (r.pointerId = r.identifier || 0), r.pressure === void 0 && (r.pressure = r.force || .5), r.twist === void 0 && (r.twist = 0), r.tangentialPressure === void 0 && (r.tangentialPressure = 0), r.layerX === void 0 && (r.layerX = r.offsetX = r.clientX), r.layerY === void 0 && (r.layerY = r.offsetY = r.clientY), r.type = e.type, t.push(r);
|
|
421
421
|
}
|
|
422
|
-
else if (
|
|
423
|
-
else if (
|
|
422
|
+
else if (Re && e instanceof globalThis.WheelEvent) t.push(e);
|
|
423
|
+
else if (Le && e instanceof globalThis.PointerEvent) t.push(e);
|
|
424
424
|
else {
|
|
425
425
|
let n = e;
|
|
426
426
|
n.isPrimary === void 0 && (n.isPrimary = !0), n.width === void 0 && (n.width = 1), n.height === void 0 && (n.height = 1), n.tiltX === void 0 && (n.tiltX = 0), n.tiltY === void 0 && (n.tiltY = 0), n.pointerType === void 0 && (n.pointerType = "mouse"), n.pointerId === void 0 && (n.pointerId = 1), n.pressure === void 0 && (n.pressure = .5), n.twist === void 0 && (n.twist = 0), n.tangentialPressure === void 0 && (n.tangentialPressure = 0), t.push(n);
|
|
@@ -428,8 +428,8 @@ var dt = class e {
|
|
|
428
428
|
return t;
|
|
429
429
|
}
|
|
430
430
|
_clonePointerEvent(e) {
|
|
431
|
-
let t = new
|
|
432
|
-
return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type =
|
|
431
|
+
let t = new ht();
|
|
432
|
+
return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type = _t[t.type] || t.type), t;
|
|
433
433
|
}
|
|
434
434
|
_copyInputEvent(e, t) {
|
|
435
435
|
e.nativeEvent = t, e.bubbles = t.bubbles, e.cancelBubble = t.cancelBubble, e.cancelable = t.cancelable, e.composed = t.composed, e.currentTarget = t.currentTarget, e.defaultPrevented = t.defaultPrevented, e.eventPhase = t.eventPhase, e.isTrusted = t.isTrusted, e.returnValue = t.returnValue, e.srcElement = t.srcElement, e.timeStamp = t.timeStamp, e.type = t.type;
|
|
@@ -438,11 +438,11 @@ var dt = class e {
|
|
|
438
438
|
this._copyInputEvent(e, t), e.altKey = t.altKey, e.button = t.button, e.buttons = t.buttons, e.client.x = t.clientX, e.client.y = t.clientY, e.ctrlKey = t.ctrlKey, e.metaKey = t.metaKey, e.movement.x = t.movementX, e.movement.y = t.movementY, e.page.x = t.pageX, e.page.y = t.pageY, e.relatedTarget = null, e.shiftKey = t.shiftKey;
|
|
439
439
|
}
|
|
440
440
|
_cloneWheelEvent(e) {
|
|
441
|
-
let t = new
|
|
441
|
+
let t = new gt();
|
|
442
442
|
return this._copyMouseEvent(t, e), t.wheelDeltaY = e.wheelDeltaY, t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ, t.deltaMode = e.deltaMode, this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t;
|
|
443
443
|
}
|
|
444
444
|
_cloneKeyboardEvent(e) {
|
|
445
|
-
let t = new
|
|
445
|
+
let t = new pt();
|
|
446
446
|
return this._copyInputEvent(t, e), t.altKey = e.altKey, t.charCode = e.charCode, t.code = e.code, t.ctrlKey = e.ctrlKey, t.isComposing = e.isComposing, t.key = e.key, t.keyCode = e.keyCode, t.location = e.location, t.metaKey = e.metaKey, t.repeat = e.repeat, t.shiftKey = e.shiftKey, t;
|
|
447
447
|
}
|
|
448
448
|
setCursor(e = "default") {
|
|
@@ -490,25 +490,25 @@ var dt = class e {
|
|
|
490
490
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
491
491
|
};
|
|
492
492
|
_onPointerDown = (e) => {
|
|
493
|
-
if (
|
|
493
|
+
if (Be && e.pointerType === "touch") return;
|
|
494
494
|
let t = this.normalize(e);
|
|
495
495
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerdown", this.event = this._clonePointerEvent(t[e]));
|
|
496
496
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
497
497
|
};
|
|
498
498
|
_onPointerOver = (e) => {
|
|
499
|
-
if (!this.enableClickEvent ||
|
|
499
|
+
if (!this.enableClickEvent || Be && e.pointerType === "touch") return;
|
|
500
500
|
let t = this.normalize(e);
|
|
501
501
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerover", this.event = this._clonePointerEvent(t[e]));
|
|
502
502
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
503
503
|
};
|
|
504
504
|
_onPointerMove = (e) => {
|
|
505
|
-
if (!this.enableMoveEvent ||
|
|
505
|
+
if (!this.enableMoveEvent || Be && e.pointerType === "touch") return;
|
|
506
506
|
let t = this.normalize(e);
|
|
507
507
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointermove", this.event = this._clonePointerEvent(t[e]));
|
|
508
508
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
509
509
|
};
|
|
510
510
|
_onPointerUp = (e) => {
|
|
511
|
-
if (!this.enableClickEvent ||
|
|
511
|
+
if (!this.enableClickEvent || Be && e.pointerType === "touch") return;
|
|
512
512
|
let t = e.target;
|
|
513
513
|
e.composedPath && e.composedPath().length > 0 && (t = e.composedPath()[0]);
|
|
514
514
|
let n = t === this.target ? "" : "outside", r = this.normalize(e);
|
|
@@ -527,8 +527,8 @@ var dt = class e {
|
|
|
527
527
|
destroy() {
|
|
528
528
|
this.removeEventListeners(), super.destroy();
|
|
529
529
|
}
|
|
530
|
-
},
|
|
531
|
-
instanceId =
|
|
530
|
+
}, w = class extends n {
|
|
531
|
+
instanceId = dt();
|
|
532
532
|
destroyed = !1;
|
|
533
533
|
get json() {
|
|
534
534
|
return this.toJSON();
|
|
@@ -537,7 +537,7 @@ var dt = class e {
|
|
|
537
537
|
this.setProperties(e);
|
|
538
538
|
}
|
|
539
539
|
_nextTick() {
|
|
540
|
-
return
|
|
540
|
+
return xe();
|
|
541
541
|
}
|
|
542
542
|
equal(e) {
|
|
543
543
|
return !!(e && this.instanceId === e.instanceId);
|
|
@@ -546,7 +546,7 @@ var dt = class e {
|
|
|
546
546
|
destroy() {
|
|
547
547
|
this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
|
|
548
548
|
}
|
|
549
|
-
},
|
|
549
|
+
}, yt = class extends w {}, T = class extends yt {}, bt = class e {
|
|
550
550
|
get x() {
|
|
551
551
|
return this.min.x;
|
|
552
552
|
}
|
|
@@ -599,7 +599,7 @@ var dt = class e {
|
|
|
599
599
|
size;
|
|
600
600
|
max;
|
|
601
601
|
constructor(...e) {
|
|
602
|
-
let t = new
|
|
602
|
+
let t = new b(), n = new b();
|
|
603
603
|
switch (e.length) {
|
|
604
604
|
case 0: break;
|
|
605
605
|
case 1: {
|
|
@@ -617,7 +617,7 @@ var dt = class e {
|
|
|
617
617
|
t.set(e[0], e[1]), n.set(Math.max(0, e[2]), Math.max(0, e[3]));
|
|
618
618
|
break;
|
|
619
619
|
}
|
|
620
|
-
this._updateMax = this._updateMax.bind(this), this._updateSize = this._updateSize.bind(this), this.min = new
|
|
620
|
+
this._updateMax = this._updateMax.bind(this), this._updateSize = this._updateSize.bind(this), this.min = new b(t.x, t.y, this._updateMax), this.size = new b(n.x, n.y, this._updateMax), this.max = new b(t.x + n.x, t.y + n.y, this._updateSize);
|
|
621
621
|
}
|
|
622
622
|
_updateSize() {
|
|
623
623
|
return this.size.set(this.max.x - this.min.x, this.max.y - this.min.y), this;
|
|
@@ -644,7 +644,7 @@ var dt = class e {
|
|
|
644
644
|
return this.width * this.height;
|
|
645
645
|
}
|
|
646
646
|
getCenter() {
|
|
647
|
-
return new
|
|
647
|
+
return new b(this.min.x + this.size.x / 2, this.min.y + this.size.y / 2);
|
|
648
648
|
}
|
|
649
649
|
toCssStyle() {
|
|
650
650
|
return {
|
|
@@ -679,7 +679,7 @@ var dt = class e {
|
|
|
679
679
|
};
|
|
680
680
|
//#endregion
|
|
681
681
|
//#region src/core/math/Color.ts
|
|
682
|
-
|
|
682
|
+
me([he]);
|
|
683
683
|
var E = class {
|
|
684
684
|
get value() {
|
|
685
685
|
return this._value;
|
|
@@ -763,7 +763,7 @@ var E = class {
|
|
|
763
763
|
this.a
|
|
764
764
|
];
|
|
765
765
|
}
|
|
766
|
-
}, xt =
|
|
766
|
+
}, xt = Se / 180, St = 180 / Se;
|
|
767
767
|
function D(e, t, n) {
|
|
768
768
|
return Math.max(t, Math.min(e, n));
|
|
769
769
|
}
|
|
@@ -1120,7 +1120,7 @@ function A(e, t, n, r) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
//#endregion
|
|
1122
1122
|
//#region src/core/os/MainLoop.ts
|
|
1123
|
-
var Et = class extends
|
|
1123
|
+
var Et = class extends w {
|
|
1124
1124
|
_starting = !1;
|
|
1125
1125
|
_nextDeltaTime = 0;
|
|
1126
1126
|
_startedProcess;
|
|
@@ -1134,13 +1134,13 @@ var Et = class extends T {
|
|
|
1134
1134
|
super(), this._onTicker = this._onTicker.bind(this), this.setProperties(e);
|
|
1135
1135
|
}
|
|
1136
1136
|
start(e) {
|
|
1137
|
-
this._starting || (this._starting = !0, this._startedProcess && this.off("process", this._startedProcess), this._startedProcess = e, this.on("process", e),
|
|
1137
|
+
this._starting || (this._starting = !0, this._startedProcess && this.off("process", this._startedProcess), this._startedProcess = e, this.on("process", e), S.on(this._onTicker, { sort: 0 }));
|
|
1138
1138
|
}
|
|
1139
1139
|
stop() {
|
|
1140
|
-
this._starting && (this._starting = !1,
|
|
1140
|
+
this._starting && (this._starting = !1, S.off(this._onTicker, { sort: 0 }));
|
|
1141
1141
|
}
|
|
1142
1142
|
_onTicker() {
|
|
1143
|
-
let e =
|
|
1143
|
+
let e = S.elapsed * this.speed;
|
|
1144
1144
|
if ((this._nextDeltaTime -= e) <= 0) {
|
|
1145
1145
|
let t = (this._nextDeltaTime = this.spf) || e;
|
|
1146
1146
|
this.emit("process", t);
|
|
@@ -1184,7 +1184,7 @@ var Dt = /* @__PURE__ */ function(e) {
|
|
|
1184
1184
|
this.view && (this.view.width = Math.floor(e * this.pixelRatio), this.view.height = Math.floor(t * this.pixelRatio)), this.screen.width = e, this.screen.height = t, n && this.view && (this.view.style.width = `${e}px`, this.view.style.height = `${t}px`);
|
|
1185
1185
|
}
|
|
1186
1186
|
};
|
|
1187
|
-
A([_({ fallback:
|
|
1187
|
+
A([_({ fallback: Xe }), k("design:type", Number)], kt.prototype, "pixelRatio", void 0), A([_({ internal: !0 }), k("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], kt.prototype, "view", void 0);
|
|
1188
1188
|
//#endregion
|
|
1189
1189
|
//#region src/core/renderers/shared/shader/UniformGroup.ts
|
|
1190
1190
|
var At = 0, jt = class {
|
|
@@ -1999,7 +1999,7 @@ var ln = class extends M {
|
|
|
1999
1999
|
}
|
|
2000
2000
|
_createShader(e) {
|
|
2001
2001
|
let t = this._renderer, n = {
|
|
2002
|
-
instanceId:
|
|
2002
|
+
instanceId: dt(),
|
|
2003
2003
|
glProgram: new qt({
|
|
2004
2004
|
vertex: "precision highp float;\nin vec2 aPosition;\nin vec2 aUv;\nin vec4 aTextureParams;\nin vec4 aModulate;\n\nuniform vec2 size;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\n\nout float vTextureId;\nout float vClipOutsideUv;\nout vec2 vUv;\nout vec4 vModulate;\n\nvec2 roundPixels(vec2 position, vec2 targetSize) {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void) {\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n mat3 modelViewProjectionMatrix = projectionMatrix * viewMatrix * modelMatrix;\n gl_Position = vec4((modelViewProjectionMatrix * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n vTextureId = aTextureParams.x;\n vClipOutsideUv = aTextureParams.y;\n if (aTextureParams.z == 1.) {\n gl_Position.xy = roundPixels(gl_Position.xy, size);\n }\n vUv = aUv;\n vModulate = aModulate;\n}",
|
|
2005
2005
|
fragment: `precision highp float;
|
|
@@ -2029,15 +2029,15 @@ void main(void) {
|
|
|
2029
2029
|
}`
|
|
2030
2030
|
})
|
|
2031
2031
|
}, r = {
|
|
2032
|
-
instanceId:
|
|
2032
|
+
instanceId: dt(),
|
|
2033
2033
|
usage: j.vertex,
|
|
2034
2034
|
data: /* @__PURE__ */ new Float32Array()
|
|
2035
2035
|
}, i = {
|
|
2036
|
-
instanceId:
|
|
2036
|
+
instanceId: dt(),
|
|
2037
2037
|
usage: j.index,
|
|
2038
2038
|
data: /* @__PURE__ */ new Uint32Array()
|
|
2039
2039
|
}, a = {
|
|
2040
|
-
instanceId:
|
|
2040
|
+
instanceId: dt(),
|
|
2041
2041
|
topology: "triangle-list",
|
|
2042
2042
|
attributes: Object.fromEntries(Object.entries(this._attributes).map(([e, t]) => [e, {
|
|
2043
2043
|
...t,
|
|
@@ -2084,8 +2084,8 @@ void main(void) {
|
|
|
2084
2084
|
255
|
|
2085
2085
|
] } = n[e];
|
|
2086
2086
|
m < e && t.blendMode !== te && (t.size = l - t.start, u.push(t), m = e, t = { id: ++d }, t.textures = i, t.textureLocationMap = f, t.start = l);
|
|
2087
|
-
let { width: ae, height: oe } = g, se = c / this._vertexSize, _ = (ee ? f.get(ee) : 255) ?? 255, ce = +!!re, le = +!!ne,
|
|
2088
|
-
for (let e = p.length, t = 0; t < e; t += 2)
|
|
2087
|
+
let { width: ae, height: oe } = g, se = c / this._vertexSize, _ = (ee ? f.get(ee) : 255) ?? 255, ce = +!!re, le = +!!ne, ue, de, v;
|
|
2088
|
+
for (let e = p.length, t = 0; t < e; t += 2) ue = h[t], de = h[t + 1], ae > 0 && oe > 0 && (ue = Math.ceil(ue * ae) / ae, de = Math.ceil(de * oe) / oe), a[c++] = p[t], a[c++] = p[t + 1], a[c++] = ue, a[c++] = de, v = c * 4, o[v] = _, o[v + 1] = le, o[v + 2] = ce, o[v + 3] = 0, c++, v = c * 4, o[v] = ie[0], o[v + 1] = ie[1], o[v + 2] = ie[2], o[v + 3] = ie[3], c++;
|
|
2089
2089
|
for (let e = r.length, t = 0; t < e; t++) s[l++] = se + r[t];
|
|
2090
2090
|
t.blendMode = te;
|
|
2091
2091
|
}
|
|
@@ -3079,13 +3079,13 @@ var Vn = class extends M {
|
|
|
3079
3079
|
msaa: !0,
|
|
3080
3080
|
nonPowOf2mipmaps: !0
|
|
3081
3081
|
};
|
|
3082
|
-
constructor(e =
|
|
3082
|
+
constructor(e = C(), t) {
|
|
3083
3083
|
if (super(), !e) throw Error("Failed to createHTMLCanvas");
|
|
3084
|
-
|
|
3084
|
+
et(e) ? this._setupContext(e, t) : (this.gl = e, this.version = tt(this.gl) ? 2 : 1), this._setupBindPoints()._setupExtensions()._setupPolyfill()._setupSupports(), this._systems.forEach((e) => e.install(this)), this._systems.forEach((e) => e.emit("updateContext", this.gl)), this._systems.forEach((e) => e.emit("setup"));
|
|
3085
3085
|
}
|
|
3086
3086
|
_setupContext(e, t) {
|
|
3087
3087
|
this.view = e;
|
|
3088
|
-
let n =
|
|
3088
|
+
let n = st()?.(e, t), r = n && tt(n) ? 2 : 1;
|
|
3089
3089
|
if (n || (n = e.getContext("webgl2", t) || e.getContext("experimental-webgl2", t), r = 2), n || (n = e.getContext("webgl", t) || e.getContext("experimental-webgl", t), r = 1), !n) throw Error("Unable to getContext");
|
|
3090
3090
|
return this.gl = n, this.version = r, this._contextLost = this._contextLost.bind(this), this._contextRestored = this._contextRestored.bind(this), typeof e.addEventListener == "function" && (e.addEventListener("webglcontextlost", this._contextLost, !1), e.addEventListener("webglcontextrestored", this._contextRestored, !1)), this;
|
|
3091
3091
|
}
|
|
@@ -3193,7 +3193,7 @@ var Vn = class extends M {
|
|
|
3193
3193
|
e.register(n, t);
|
|
3194
3194
|
}), e.font = this, this;
|
|
3195
3195
|
}
|
|
3196
|
-
}, Gn = class extends
|
|
3196
|
+
}, Gn = class extends T {
|
|
3197
3197
|
constructor(e) {
|
|
3198
3198
|
super(), this.setProperties(e);
|
|
3199
3199
|
}
|
|
@@ -3201,7 +3201,7 @@ var Vn = class extends M {
|
|
|
3201
3201
|
A([_({ fallback: j.index }), k("design:type", j === void 0 ? Object : j)], Gn.prototype, "usage", void 0), A([_({ default: () => /* @__PURE__ */ new Uint32Array() }), k("design:type", Object)], Gn.prototype, "data", void 0);
|
|
3202
3202
|
//#endregion
|
|
3203
3203
|
//#region src/scene/resources/geometries/Geometry.ts
|
|
3204
|
-
var Kn = class extends
|
|
3204
|
+
var Kn = class extends T {
|
|
3205
3205
|
constructor(e = {}) {
|
|
3206
3206
|
super(), this.setProperties(e);
|
|
3207
3207
|
}
|
|
@@ -3212,7 +3212,7 @@ var Kn = class extends yt {
|
|
|
3212
3212
|
A([_({ fallback: "triangle-list" }), k("design:type", Object)], Kn.prototype, "topology", void 0), A([_({ default: () => ({}) }), k("design:type", typeof Record > "u" ? Object : Record)], Kn.prototype, "attributes", void 0), A([_({ default: () => new Gn() }), k("design:type", Gn === void 0 ? Object : Gn)], Kn.prototype, "indexBuffer", void 0), A([_({ fallback: 1 }), k("design:type", Number)], Kn.prototype, "instanceCount", void 0);
|
|
3213
3213
|
//#endregion
|
|
3214
3214
|
//#region src/scene/resources/geometries/VertexBuffer.ts
|
|
3215
|
-
var F = class extends
|
|
3215
|
+
var F = class extends T {
|
|
3216
3216
|
constructor(e) {
|
|
3217
3217
|
super(), this.setProperties(e);
|
|
3218
3218
|
}
|
|
@@ -3220,7 +3220,7 @@ var F = class extends yt {
|
|
|
3220
3220
|
A([_({ fallback: j.vertex }), k("design:type", j === void 0 ? Object : j)], F.prototype, "usage", void 0), A([_({ default: () => /* @__PURE__ */ new Float32Array() }), k("design:type", Object)], F.prototype, "data", void 0);
|
|
3221
3221
|
//#endregion
|
|
3222
3222
|
//#region src/scene/resources/geometries/VertexAttribute.ts
|
|
3223
|
-
var I = class extends
|
|
3223
|
+
var I = class extends T {
|
|
3224
3224
|
constructor(e) {
|
|
3225
3225
|
super(), this.setProperties(e);
|
|
3226
3226
|
}
|
|
@@ -3288,7 +3288,7 @@ function Jn() {
|
|
|
3288
3288
|
])
|
|
3289
3289
|
};
|
|
3290
3290
|
}
|
|
3291
|
-
var L = class extends
|
|
3291
|
+
var L = class extends T {
|
|
3292
3292
|
static instance = new this();
|
|
3293
3293
|
glProgram;
|
|
3294
3294
|
constructor(e = {}) {
|
|
@@ -3475,7 +3475,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3475
3475
|
indexBuffer: new Gn({ data: /* @__PURE__ */ new Uint32Array() })
|
|
3476
3476
|
}), this.positionBuffer = t, this.uvBuffer = n;
|
|
3477
3477
|
}
|
|
3478
|
-
}, z = class extends
|
|
3478
|
+
}, z = class extends T {
|
|
3479
3479
|
get valid() {
|
|
3480
3480
|
return !!(this.width && this.height);
|
|
3481
3481
|
}
|
|
@@ -3492,7 +3492,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3492
3492
|
A([_({ fallback: !1 }), k("design:type", Boolean)], z.prototype, "isRoot", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "x", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "y", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "width", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "height", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "mipLevel", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], z.prototype, "msaa", void 0), A([_({ default: () => [new B()] }), k("design:type", Array)], z.prototype, "colorTextures", void 0);
|
|
3493
3493
|
//#endregion
|
|
3494
3494
|
//#region src/scene/resources/textures/Texture2D.ts
|
|
3495
|
-
var B = class extends
|
|
3495
|
+
var B = class extends T {
|
|
3496
3496
|
static get EMPTY() {
|
|
3497
3497
|
return new this({
|
|
3498
3498
|
width: 1,
|
|
@@ -3583,7 +3583,7 @@ var B = class extends yt {
|
|
|
3583
3583
|
switch (super._updateProperty(e, t, n), e) {
|
|
3584
3584
|
case "width":
|
|
3585
3585
|
case "height":
|
|
3586
|
-
this.isPowerOfTwo =
|
|
3586
|
+
this.isPowerOfTwo = we(this.pixelWidth) && we(this.pixelHeight);
|
|
3587
3587
|
break;
|
|
3588
3588
|
case "source":
|
|
3589
3589
|
this.updateSize();
|
|
@@ -3600,13 +3600,13 @@ var B = class extends yt {
|
|
|
3600
3600
|
e.texture.unbind(this);
|
|
3601
3601
|
}
|
|
3602
3602
|
_destroy() {
|
|
3603
|
-
super._destroy(),
|
|
3603
|
+
super._destroy(), Fe && this.source instanceof ImageBitmap && this.source.close();
|
|
3604
3604
|
}
|
|
3605
3605
|
};
|
|
3606
3606
|
A([_({ fallback: "unknown" }), k("design:type", String)], B.prototype, "uploadMethodId", void 0), A([_({ internal: !0 }), k("design:type", Object)], B.prototype, "source", void 0), A([_({ fallback: 0 }), k("design:type", Number)], B.prototype, "width", void 0), A([_({ fallback: 0 }), k("design:type", Number)], B.prototype, "height", void 0), A([_({ fallback: 1 }), k("design:type", Number)], B.prototype, "pixelRatio", void 0), A([_({ fallback: "bgra8unorm" }), k("design:type", Object)], B.prototype, "format", void 0), A([_({ fallback: "premultiply-alpha-on-upload" }), k("design:type", Object)], B.prototype, "alphaMode", void 0), A([_({ fallback: 1 }), k("design:type", Number)], B.prototype, "mipLevelCount", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], B.prototype, "mipmap", void 0), A([_({ fallback: "clamp-to-edge" }), k("design:type", Object)], B.prototype, "addressModeU", void 0), A([_({ fallback: "clamp-to-edge" }), k("design:type", Object)], B.prototype, "addressModeV", void 0), A([_({ fallback: "clamp-to-edge" }), k("design:type", Object)], B.prototype, "addressModeW", void 0), A([_({ fallback: "linear" }), k("design:type", Object)], B.prototype, "magFilter", void 0), A([_({ fallback: "linear" }), k("design:type", Object)], B.prototype, "minFilter", void 0), A([_({ fallback: "linear" }), k("design:type", Object)], B.prototype, "mipmapFilter", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], B.prototype, "isPowerOfTwo", void 0);
|
|
3607
3607
|
//#endregion
|
|
3608
3608
|
//#region src/scene/resources/textures/AnimatedTexture.ts
|
|
3609
|
-
var tr = class extends
|
|
3609
|
+
var tr = class extends T {
|
|
3610
3610
|
frames;
|
|
3611
3611
|
frameIndex = 0;
|
|
3612
3612
|
get currentFrame() {
|
|
@@ -3636,7 +3636,7 @@ var tr = class extends yt {
|
|
|
3636
3636
|
super({
|
|
3637
3637
|
pixelRatio: 2,
|
|
3638
3638
|
...e,
|
|
3639
|
-
source: e.source ??
|
|
3639
|
+
source: e.source ?? C(),
|
|
3640
3640
|
uploadMethodId: "image"
|
|
3641
3641
|
});
|
|
3642
3642
|
}
|
|
@@ -3679,7 +3679,7 @@ var tr = class extends yt {
|
|
|
3679
3679
|
static linearGradient(e, t, n) {
|
|
3680
3680
|
let r = Number.isFinite(t) && t > 0, i = Number.isFinite(n) && n > 0, a = Number.isFinite(e.angle);
|
|
3681
3681
|
t = r ? t : 1, n = i ? n : 1;
|
|
3682
|
-
let o =
|
|
3682
|
+
let o = C(t, n);
|
|
3683
3683
|
if (!o) throw Error("GradientTexture requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
3684
3684
|
let s = o.getContext("2d");
|
|
3685
3685
|
if (!s) throw Error("Failed to parse linear gradient, get canvas context is null.");
|
|
@@ -3790,12 +3790,12 @@ var sr = class e extends B {
|
|
|
3790
3790
|
_seekResolves = [];
|
|
3791
3791
|
constructor(t, n) {
|
|
3792
3792
|
let r = or(n);
|
|
3793
|
-
if (!
|
|
3793
|
+
if (!Qe(t)) {
|
|
3794
3794
|
typeof t == "string" && (t = [t]);
|
|
3795
3795
|
let n = t[0].src || t[0];
|
|
3796
3796
|
if (typeof document > "u") throw TypeError("VideoTexture requires a DOM <video> element and is not supported in non-browser environments.");
|
|
3797
3797
|
let i = document.createElement("video");
|
|
3798
|
-
r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""),
|
|
3798
|
+
r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""), lt(i, n, r.crossorigin);
|
|
3799
3799
|
for (let n = 0; n < t.length; ++n) {
|
|
3800
3800
|
let { src: r, mime: a } = t[n];
|
|
3801
3801
|
if (r ||= t[n], r.startsWith("data:")) a = r.slice(5, r.indexOf(";"));
|
|
@@ -3858,13 +3858,13 @@ var sr = class e extends B {
|
|
|
3858
3858
|
});
|
|
3859
3859
|
}
|
|
3860
3860
|
_setupAutoUpdate() {
|
|
3861
|
-
this.autoUpdate && this.isPlaying ? !this.fps && this.source.requestVideoFrameCallback ? (this._connected && (
|
|
3861
|
+
this.autoUpdate && this.isPlaying ? !this.fps && this.source.requestVideoFrameCallback ? (this._connected && (S.off(this.requestUpload), this._connected = !1, this._nextTime = 0), this._requestId === void 0 && (this._requestId = this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))) : (this._requestId !== void 0 && (this.source.cancelVideoFrameCallback(this._requestId), this._requestId = void 0), this._connected || (S.on(this.requestUpload), this._connected = !0, this._nextTime = 0)) : (this._requestId !== void 0 && (this.source.cancelVideoFrameCallback(this._requestId), this._requestId = void 0), this._connected && (S.off(this.requestUpload), this._connected = !1, this._nextTime = 0));
|
|
3862
3862
|
}
|
|
3863
3863
|
_videoFrameRequestCallback = () => {
|
|
3864
3864
|
this.requestUpload(), this._requestId = this.source.requestVideoFrameCallback(this._videoFrameRequestCallback);
|
|
3865
3865
|
};
|
|
3866
3866
|
requestUpload = () => {
|
|
3867
|
-
let e = Math.floor(
|
|
3867
|
+
let e = Math.floor(S.elapsed * this.source.playbackRate);
|
|
3868
3868
|
this._nextTime -= e, (!this._spf || this._nextTime <= 0) && (this.requestUpdate("source"), this._nextTime = this._spf || 0);
|
|
3869
3869
|
};
|
|
3870
3870
|
async load() {
|
|
@@ -3891,7 +3891,7 @@ A([_({
|
|
|
3891
3891
|
}), k("design:type", Number)], sr.prototype, "fps", void 0);
|
|
3892
3892
|
//#endregion
|
|
3893
3893
|
//#region src/scene/resources/textures/ViewportTexture.ts
|
|
3894
|
-
var cr = class extends B {}, lr = class extends
|
|
3894
|
+
var cr = class extends B {}, lr = class extends ue {
|
|
3895
3895
|
fillStyle;
|
|
3896
3896
|
fillRule;
|
|
3897
3897
|
strokeStyle;
|
|
@@ -3922,7 +3922,7 @@ var cr = class extends B {}, lr = class extends v {
|
|
|
3922
3922
|
...e,
|
|
3923
3923
|
...this._parseDrawStyle(n),
|
|
3924
3924
|
type: "stroke",
|
|
3925
|
-
path: new
|
|
3925
|
+
path: new ue(this),
|
|
3926
3926
|
transformUv: this.transformUv,
|
|
3927
3927
|
transformVertex: this.transformVertex,
|
|
3928
3928
|
lineStyle: {
|
|
@@ -3961,7 +3961,7 @@ var cr = class extends B {}, lr = class extends v {
|
|
|
3961
3961
|
l(this.style.fill) && (t = this.style.fill.color);
|
|
3962
3962
|
break;
|
|
3963
3963
|
}
|
|
3964
|
-
let n = new
|
|
3964
|
+
let n = new ue(this), r = this.fillRule ?? this.style.fillRule;
|
|
3965
3965
|
r && (n.style.fillRule = r), this._draws.push({
|
|
3966
3966
|
transformUv: this.transformUv,
|
|
3967
3967
|
transformVertex: this.transformVertex,
|
|
@@ -4065,7 +4065,7 @@ var cr = class extends B {}, lr = class extends v {
|
|
|
4065
4065
|
toJSON() {
|
|
4066
4066
|
return [...this.default];
|
|
4067
4067
|
}
|
|
4068
|
-
}, dr = class extends
|
|
4068
|
+
}, dr = class extends w {
|
|
4069
4069
|
parent;
|
|
4070
4070
|
getPropertyDeclarations() {
|
|
4071
4071
|
super.getPropertyDeclarations();
|
|
@@ -4089,10 +4089,10 @@ function mr(e) {
|
|
|
4089
4089
|
let t = pr[e] ?? 0;
|
|
4090
4090
|
return t++, pr[e] = t, t;
|
|
4091
4091
|
}
|
|
4092
|
-
var V = fr = class extends
|
|
4092
|
+
var V = fr = class extends w {
|
|
4093
4093
|
static parse(e, t = "Node") {
|
|
4094
4094
|
if (Array.isArray(e)) return e.map((e) => this.parse(e));
|
|
4095
|
-
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((
|
|
4095
|
+
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ye.get(n ?? r.inCanvasIs ?? t)) ?? fr)({
|
|
4096
4096
|
...a,
|
|
4097
4097
|
meta: r
|
|
4098
4098
|
});
|
|
@@ -4455,7 +4455,7 @@ var V = fr = class extends T {
|
|
|
4455
4455
|
A([_({ default: () => c() }), k("design:type", String)], V.prototype, "id", void 0), A([_({ default: () => c() }), k("design:type", String)], V.prototype, "name", void 0), A([_({ fallback: "inherit" }), k("design:type", Object)], V.prototype, "processMode", void 0), A([_({ fallback: "default" }), k("design:type", Object)], V.prototype, "processSortMode", void 0), A([_({ fallback: "inherit" }), k("design:type", Object)], V.prototype, "renderMode", void 0), A([_({ fallback: "inherit" }), k("design:type", Object)], V.prototype, "inputMode", void 0), A([_({ fallback: "default" }), k("design:type", Object)], V.prototype, "internalMode", void 0), A([_({
|
|
4456
4456
|
internal: !0,
|
|
4457
4457
|
default: !0
|
|
4458
|
-
}), k("design:type", Boolean)], V.prototype, "needsRender", void 0), V = fr = A([
|
|
4458
|
+
}), k("design:type", Boolean)], V.prototype, "needsRender", void 0), V = fr = A([x("Node"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
|
|
4459
4459
|
//#endregion
|
|
4460
4460
|
//#region src/scene/main/TimelineNode.ts
|
|
4461
4461
|
var H = class extends V {
|
|
@@ -4540,7 +4540,7 @@ var H = class extends V {
|
|
|
4540
4540
|
super._process(e), this._updateCurrentTime();
|
|
4541
4541
|
}
|
|
4542
4542
|
};
|
|
4543
|
-
A([_({ fallback: !1 }), k("design:type", Boolean)], H.prototype, "loop", void 0), A([_({ fallback: 0 }), k("design:type", Number)], H.prototype, "delay", void 0), A([_({ fallback: 0 }), k("design:type", Number)], H.prototype, "duration", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], H.prototype, "paused", void 0), H = A([
|
|
4543
|
+
A([_({ fallback: !1 }), k("design:type", Boolean)], H.prototype, "loop", void 0), A([_({ fallback: 0 }), k("design:type", Number)], H.prototype, "delay", void 0), A([_({ fallback: 0 }), k("design:type", Number)], H.prototype, "duration", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], H.prototype, "paused", void 0), H = A([x("TimelineNode"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], H);
|
|
4544
4544
|
//#endregion
|
|
4545
4545
|
//#region src/scene/main/CanvasItem.ts
|
|
4546
4546
|
var hr = [], gr = 0;
|
|
@@ -4683,7 +4683,7 @@ var yr = class extends H {
|
|
|
4683
4683
|
_handleViewportTexture(e) {
|
|
4684
4684
|
let t = this.tree?.getPreviousViewport();
|
|
4685
4685
|
if (t && "getRect" in this) {
|
|
4686
|
-
let { a: n, d: r, tx: i, ty: a } = t.canvasTransform, { vertices: o } = e, s = new
|
|
4686
|
+
let { a: n, d: r, tx: i, ty: a } = t.canvasTransform, { vertices: o } = e, s = new y().scale(1 / t.width * n, -1 / t.height * r).translate(- -i / t.width, 1 + -a / t.height), c = new Float32Array(o.length);
|
|
4687
4687
|
for (let e = o.length, t = 0; t < e; t += 2) {
|
|
4688
4688
|
let { x: e, y: n } = s.apply({
|
|
4689
4689
|
x: o[t],
|
|
@@ -4716,11 +4716,11 @@ A([_(), k("design:type", Object)], yr.prototype, "blendMode", void 0), A([_({
|
|
|
4716
4716
|
}), k("design:type", Boolean)], yr.prototype, "visible", void 0), A([_({
|
|
4717
4717
|
internal: !0,
|
|
4718
4718
|
fallback: 1
|
|
4719
|
-
}), k("design:type", Number)], yr.prototype, "opacity", void 0), yr = A([
|
|
4719
|
+
}), k("design:type", Number)], yr.prototype, "opacity", void 0), yr = A([x("CanvasItem"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], yr);
|
|
4720
4720
|
//#endregion
|
|
4721
4721
|
//#region src/scene/main/Viewport.ts
|
|
4722
4722
|
var U = class extends V {
|
|
4723
|
-
canvasTransform = new
|
|
4723
|
+
canvasTransform = new y();
|
|
4724
4724
|
renderTargetIndex = 0;
|
|
4725
4725
|
renderTargets = [new z(), new z()];
|
|
4726
4726
|
get valid() {
|
|
@@ -4794,7 +4794,7 @@ var U = class extends V {
|
|
|
4794
4794
|
super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
|
|
4795
4795
|
}
|
|
4796
4796
|
};
|
|
4797
|
-
A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "x", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "y", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "width", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "height", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "mipLevel", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], U.prototype, "msaa", void 0), U = A([
|
|
4797
|
+
A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "x", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "y", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "width", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "height", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "mipLevel", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], U.prototype, "msaa", void 0), U = A([x("Viewport")], U);
|
|
4798
4798
|
//#endregion
|
|
4799
4799
|
//#region src/scene/main/Effect.ts
|
|
4800
4800
|
var W = class extends H {
|
|
@@ -5025,7 +5025,7 @@ var W = class extends H {
|
|
|
5025
5025
|
super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
|
|
5026
5026
|
}
|
|
5027
5027
|
};
|
|
5028
|
-
A([_({ internal: !0 }), k("design:type", Object)], W.prototype, "material", void 0), A([_(), k("design:type", Object)], W.prototype, "effectMode", void 0), A([_(), k("design:type", String)], W.prototype, "glsl", void 0), A([_(), k("design:type", String)], W.prototype, "glslSrc", void 0), W = A([
|
|
5028
|
+
A([_({ internal: !0 }), k("design:type", Object)], W.prototype, "material", void 0), A([_(), k("design:type", Object)], W.prototype, "effectMode", void 0), A([_(), k("design:type", String)], W.prototype, "glsl", void 0), A([_(), k("design:type", String)], W.prototype, "glslSrc", void 0), W = A([x("Effect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
|
|
5029
5029
|
//#endregion
|
|
5030
5030
|
//#region src/scene/main/RenderStack.ts
|
|
5031
5031
|
var br = class {
|
|
@@ -5120,7 +5120,7 @@ var br = class {
|
|
|
5120
5120
|
super._process(e), this.paused || this.addTime(e);
|
|
5121
5121
|
}
|
|
5122
5122
|
};
|
|
5123
|
-
A([_({ fallback: 0 }), k("design:type", Number)], Sr.prototype, "startTime", void 0), A([_({ fallback: 2 ** 53 - 1 }), k("design:type", Number)], Sr.prototype, "endTime", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Sr.prototype, "loop", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Sr.prototype, "paused", void 0), Sr = xr = A([
|
|
5123
|
+
A([_({ fallback: 0 }), k("design:type", Number)], Sr.prototype, "startTime", void 0), A([_({ fallback: 2 ** 53 - 1 }), k("design:type", Number)], Sr.prototype, "endTime", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Sr.prototype, "loop", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Sr.prototype, "paused", void 0), Sr = xr = A([x("Timeline"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Sr);
|
|
5124
5124
|
//#endregion
|
|
5125
5125
|
//#region src/scene/main/Window.ts
|
|
5126
5126
|
var Cr = class extends U {
|
|
@@ -5134,17 +5134,18 @@ var Cr = class extends U {
|
|
|
5134
5134
|
super.flush(e), this.finish(e);
|
|
5135
5135
|
}
|
|
5136
5136
|
};
|
|
5137
|
-
Cr = A([
|
|
5137
|
+
Cr = A([x("Window", {
|
|
5138
5138
|
processMode: "always",
|
|
5139
5139
|
renderMode: "always"
|
|
5140
5140
|
}), k("design:paramtypes", [])], Cr);
|
|
5141
5141
|
//#endregion
|
|
5142
5142
|
//#region src/scene/main/SceneTree.ts
|
|
5143
5143
|
var wr = class extends Et {
|
|
5144
|
-
input = new
|
|
5144
|
+
input = new vt();
|
|
5145
5145
|
renderStack = new br();
|
|
5146
5146
|
root = new Cr().setTree(this);
|
|
5147
5147
|
timeline = new Sr().setTree(this);
|
|
5148
|
+
imagePipelineResolver;
|
|
5148
5149
|
nodeMap = /* @__PURE__ */ new Map();
|
|
5149
5150
|
_boundFonts;
|
|
5150
5151
|
_textRemeasureScheduled = !1;
|
|
@@ -5221,7 +5222,7 @@ A([_({ alias: "root.msaa" }), k("design:type", Boolean)], wr.prototype, "msaa",
|
|
|
5221
5222
|
fallback: !1
|
|
5222
5223
|
}), k("design:type", Boolean)], wr.prototype, "processPaused", void 0), A([_({
|
|
5223
5224
|
internal: !0,
|
|
5224
|
-
default: () =>
|
|
5225
|
+
default: () => ge
|
|
5225
5226
|
}), k("design:type", Object)], wr.prototype, "fonts", void 0);
|
|
5226
5227
|
//#endregion
|
|
5227
5228
|
//#region src/scene/main/Transition.ts
|
|
@@ -5230,7 +5231,7 @@ var Tr = class extends W {
|
|
|
5230
5231
|
super(), this.setProperties(e).append(t);
|
|
5231
5232
|
}
|
|
5232
5233
|
};
|
|
5233
|
-
Tr = A([
|
|
5234
|
+
Tr = A([x("Transition", {
|
|
5234
5235
|
effectMode: "transition",
|
|
5235
5236
|
duration: 2e3
|
|
5236
5237
|
}), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Tr);
|
|
@@ -5238,17 +5239,17 @@ Tr = A([S("Transition", {
|
|
|
5238
5239
|
//#region src/scene/2d/Node2D.ts
|
|
5239
5240
|
var Er = class extends yr {
|
|
5240
5241
|
rotation = 0;
|
|
5241
|
-
position = new
|
|
5242
|
-
scale = new
|
|
5243
|
-
skew = new
|
|
5244
|
-
pivot = new
|
|
5245
|
-
extraTransform = new
|
|
5246
|
-
transform = new
|
|
5247
|
-
globalPosition = new
|
|
5242
|
+
position = new b(0, 0, () => this.updateGlobalTransform());
|
|
5243
|
+
scale = new b(1, 1, () => this.updateGlobalTransform());
|
|
5244
|
+
skew = new b(0, 0, () => this.updateGlobalTransform());
|
|
5245
|
+
pivot = new b(0, 0, () => this.updateGlobalTransform());
|
|
5246
|
+
extraTransform = new y();
|
|
5247
|
+
transform = new y();
|
|
5248
|
+
globalPosition = new b();
|
|
5248
5249
|
globalRotation = 0;
|
|
5249
|
-
globalScale = new
|
|
5250
|
-
globalSkew = new
|
|
5251
|
-
globalTransform = new
|
|
5250
|
+
globalScale = new b();
|
|
5251
|
+
globalSkew = new b();
|
|
5252
|
+
globalTransform = new y();
|
|
5252
5253
|
parentTransformDirtyId;
|
|
5253
5254
|
transformDirtyId = 0;
|
|
5254
5255
|
constructor(e, t = []) {
|
|
@@ -5288,30 +5289,30 @@ var Er = class extends yr {
|
|
|
5288
5289
|
super._destroy(), this.position.destroy(), this.scale.destroy(), this.skew.destroy(), this.pivot.destroy(), this.extraTransform.destroy(), this.transform.destroy(), this.globalPosition.destroy(), this.globalScale.destroy(), this.globalSkew.destroy(), this.globalTransform.destroy();
|
|
5289
5290
|
}
|
|
5290
5291
|
};
|
|
5291
|
-
Er = A([
|
|
5292
|
+
Er = A([x("Node2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Er);
|
|
5292
5293
|
//#endregion
|
|
5293
5294
|
//#region src/scene/2d/Camera2D.ts
|
|
5294
5295
|
var Dr = class extends Er {
|
|
5295
|
-
canvasTransform = new
|
|
5296
|
+
canvasTransform = new y();
|
|
5296
5297
|
_screenOffset = {
|
|
5297
5298
|
x: 0,
|
|
5298
5299
|
y: 0
|
|
5299
5300
|
};
|
|
5300
|
-
_zoom = new
|
|
5301
|
+
_zoom = new b(1, 1, () => this._updateTransform());
|
|
5301
5302
|
get zoom() {
|
|
5302
5303
|
return this._zoom;
|
|
5303
5304
|
}
|
|
5304
5305
|
set zoom(e) {
|
|
5305
5306
|
this._zoom.set(e.x, e.y);
|
|
5306
5307
|
}
|
|
5307
|
-
_minZoom = new
|
|
5308
|
+
_minZoom = new b(.02, .02);
|
|
5308
5309
|
get minZoom() {
|
|
5309
5310
|
return this._minZoom;
|
|
5310
5311
|
}
|
|
5311
5312
|
set minZoom(e) {
|
|
5312
5313
|
this._minZoom.set(e.x, e.y);
|
|
5313
5314
|
}
|
|
5314
|
-
_maxZoom = new
|
|
5315
|
+
_maxZoom = new b(256, 256);
|
|
5315
5316
|
get maxZoom() {
|
|
5316
5317
|
return this._maxZoom;
|
|
5317
5318
|
}
|
|
@@ -5405,7 +5406,7 @@ var Dr = class extends Er {
|
|
|
5405
5406
|
});
|
|
5406
5407
|
}
|
|
5407
5408
|
_getZoomByWheel(e, t) {
|
|
5408
|
-
let n = e.ctrlKey &&
|
|
5409
|
+
let n = e.ctrlKey && Ye ? 10 : 1, r = -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * n, i = Math.log(t) + r;
|
|
5409
5410
|
return Math.round(Math.exp(i) * 1e4) / 1e4;
|
|
5410
5411
|
}
|
|
5411
5412
|
_updateTransform() {
|
|
@@ -5441,7 +5442,7 @@ A([_({
|
|
|
5441
5442
|
}), k("design:type", Boolean)], Dr.prototype, "spaceKey", void 0), A([_({
|
|
5442
5443
|
internal: !0,
|
|
5443
5444
|
fallback: !1
|
|
5444
|
-
}), k("design:type", Boolean)], Dr.prototype, "grabbing", void 0), Dr = A([
|
|
5445
|
+
}), k("design:type", Boolean)], Dr.prototype, "grabbing", void 0), Dr = A([x("Camera2D", {
|
|
5445
5446
|
processMode: "disabled",
|
|
5446
5447
|
renderMode: "disabled"
|
|
5447
5448
|
}), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Dr);
|
|
@@ -5457,7 +5458,7 @@ function Or(e, t) {
|
|
|
5457
5458
|
};
|
|
5458
5459
|
}
|
|
5459
5460
|
function kr(e, t, n, r = {}) {
|
|
5460
|
-
let i = t.point, a = n.point, o = new
|
|
5461
|
+
let i = t.point, a = n.point, o = new ue();
|
|
5461
5462
|
switch (e) {
|
|
5462
5463
|
case "curved": {
|
|
5463
5464
|
let e = t.dir ?? Or(a.x - i.x, a.y - i.y), s = n.dir ?? Or(i.x - a.x, i.y - a.y), c = a.x - i.x, l = a.y - i.y, u = Math.hypot(c, l) || 1, d = c / u, f = l / u, p = Math.max((r.stub ?? 16) * 2, u * .4), m = (e, t, n, r) => Math.max(.1, (1 + e * n + t * r) / 2), h = p * m(e.x, e.y, d, f), g = p * m(s.x, s.y, -d, -f), ee = i.x + e.x * h, te = i.y + e.y * h, ne = a.x + s.x * g, re = a.y + s.y * g;
|
|
@@ -5594,7 +5595,7 @@ var Fr = {
|
|
|
5594
5595
|
function Ir(e) {
|
|
5595
5596
|
let t = new Ct();
|
|
5596
5597
|
if (e === "none") return t;
|
|
5597
|
-
let n =
|
|
5598
|
+
let n = je(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
|
|
5598
5599
|
Object.keys(Fr).forEach((e) => {
|
|
5599
5600
|
n[e] = n[e] ?? Fr[e];
|
|
5600
5601
|
});
|
|
@@ -5602,7 +5603,7 @@ function Ir(e) {
|
|
|
5602
5603
|
let r = n[e];
|
|
5603
5604
|
switch (e) {
|
|
5604
5605
|
case "hue-rotate":
|
|
5605
|
-
t.hueRotate(r *
|
|
5606
|
+
t.hueRotate(r * Ce);
|
|
5606
5607
|
break;
|
|
5607
5608
|
case "saturate":
|
|
5608
5609
|
t.saturate(r);
|
|
@@ -5673,7 +5674,7 @@ var Rr, G = class extends W {
|
|
|
5673
5674
|
});
|
|
5674
5675
|
}
|
|
5675
5676
|
};
|
|
5676
|
-
A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "saturation", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "contrast", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "brightness", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "red", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "green", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "blue", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "alpha", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "gamma", void 0), G = Rr = A([
|
|
5677
|
+
A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "saturation", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "contrast", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "brightness", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "red", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "green", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "blue", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "alpha", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "gamma", void 0), G = Rr = A([x("ColorAdjustEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], G);
|
|
5677
5678
|
//#endregion
|
|
5678
5679
|
//#region src/scene/effects/ColorFilterEffect.ts
|
|
5679
5680
|
var zr, Br = class extends W {
|
|
@@ -5697,13 +5698,13 @@ var zr, Br = class extends W {
|
|
|
5697
5698
|
}
|
|
5698
5699
|
apply(e, t) {
|
|
5699
5700
|
if (!this.filter) return;
|
|
5700
|
-
let n =
|
|
5701
|
+
let n = je(this.filter), r = this._colorMatrix.identity();
|
|
5701
5702
|
n.forEach(({ name: e, args: t }) => {
|
|
5702
5703
|
let n = t.map((e) => e.normalizedIntValue);
|
|
5703
5704
|
switch (e) {
|
|
5704
5705
|
case "hue-rotate":
|
|
5705
5706
|
case "hueRotate":
|
|
5706
|
-
r.hueRotate(n[0] *
|
|
5707
|
+
r.hueRotate(n[0] * Ce);
|
|
5707
5708
|
break;
|
|
5708
5709
|
case "saturate":
|
|
5709
5710
|
r.saturate(n[0]);
|
|
@@ -5735,7 +5736,7 @@ var zr, Br = class extends W {
|
|
|
5735
5736
|
});
|
|
5736
5737
|
}
|
|
5737
5738
|
};
|
|
5738
|
-
A([_(), k("design:type", String)], Br.prototype, "filter", void 0), Br = zr = A([
|
|
5739
|
+
A([_(), k("design:type", String)], Br.prototype, "filter", void 0), Br = zr = A([x("ColorFilterEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Br);
|
|
5739
5740
|
//#endregion
|
|
5740
5741
|
//#region src/scene/effects/ColorOverlayEffect.ts
|
|
5741
5742
|
var Vr, Hr = 50, Ur = class extends W {
|
|
@@ -5806,7 +5807,7 @@ void main(void) {
|
|
|
5806
5807
|
});
|
|
5807
5808
|
}
|
|
5808
5809
|
};
|
|
5809
|
-
A([_({ default: () => [] }), k("design:type", Array)], Ur.prototype, "colors", void 0), A([_({ fallback: .5 }), k("design:type", Number)], Ur.prototype, "alpha", void 0), Ur = Vr = A([
|
|
5810
|
+
A([_({ default: () => [] }), k("design:type", Array)], Ur.prototype, "colors", void 0), A([_({ fallback: .5 }), k("design:type", Number)], Ur.prototype, "alpha", void 0), Ur = Vr = A([x("ColorOverlayEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ur);
|
|
5810
5811
|
//#endregion
|
|
5811
5812
|
//#region src/scene/effects/ColorRemoveEffect.ts
|
|
5812
5813
|
var Wr, Gr = class extends W {
|
|
@@ -5839,7 +5840,7 @@ var Wr, Gr = class extends W {
|
|
|
5839
5840
|
});
|
|
5840
5841
|
}
|
|
5841
5842
|
};
|
|
5842
|
-
A([_({ default: () => [] }), k("design:type", Array)], Gr.prototype, "colors", void 0), A([_({ fallback: .5 }), k("design:type", Number)], Gr.prototype, "epsilon", void 0), Gr = Wr = A([
|
|
5843
|
+
A([_({ default: () => [] }), k("design:type", Array)], Gr.prototype, "colors", void 0), A([_({ fallback: .5 }), k("design:type", Number)], Gr.prototype, "epsilon", void 0), Gr = Wr = A([x("ColorRemoveEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Gr);
|
|
5843
5844
|
//#endregion
|
|
5844
5845
|
//#region src/scene/effects/ColorReplaceEffect.ts
|
|
5845
5846
|
var Kr, qr = 50, Jr = class extends W {
|
|
@@ -5911,7 +5912,7 @@ void main(void) {
|
|
|
5911
5912
|
});
|
|
5912
5913
|
}
|
|
5913
5914
|
};
|
|
5914
|
-
A([_({ default: () => [] }), k("design:type", Array)], Jr.prototype, "colors", void 0), A([_({ fallback: .05 }), k("design:type", Number)], Jr.prototype, "epsilon", void 0), Jr = Kr = A([
|
|
5915
|
+
A([_({ default: () => [] }), k("design:type", Array)], Jr.prototype, "colors", void 0), A([_({ fallback: .05 }), k("design:type", Number)], Jr.prototype, "epsilon", void 0), Jr = Kr = A([x("ColorReplaceEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Jr);
|
|
5915
5916
|
//#endregion
|
|
5916
5917
|
//#region src/scene/effects/DrawboardEffect.frag?raw
|
|
5917
5918
|
var Yr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\nconst int CHECKERBOARD_STYLE_DOTS_DARK = 4;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS || checkerboardStyle == CHECKERBOARD_STYLE_DOTS_DARK) {\n // light vs dark dots share this path; the base/dot colours are supplied as\n // uniforms (set per style on the CPU side), so only the values differ.\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Xr, K = class extends W {
|
|
@@ -5994,7 +5995,7 @@ var Yr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5994
5995
|
});
|
|
5995
5996
|
}
|
|
5996
5997
|
};
|
|
5997
|
-
A([_({ fallback: !1 }), k("design:type", Boolean)], K.prototype, "checkerboard", void 0), A([_({ fallback: "grid" }), k("design:type", Object)], K.prototype, "checkerboardStyle", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], K.prototype, "pixelGrid", void 0), A([_(), k("design:type", Number)], K.prototype, "dotBaseColor", void 0), A([_(), k("design:type", Number)], K.prototype, "dotColor", void 0), A([_(), k("design:type", Number)], K.prototype, "dotZoomDiff", void 0), A([_(), k("design:type", String)], K.prototype, "watermark", void 0), A([_({ fallback: 100 }), k("design:type", Number)], K.prototype, "watermarkWidth", void 0), A([_({ fallback: .05 }), k("design:type", Number)], K.prototype, "watermarkAlpha", void 0), A([_({ fallback: .5236 }), k("design:type", Number)], K.prototype, "watermarkRotation", void 0), K = Xr = A([
|
|
5998
|
+
A([_({ fallback: !1 }), k("design:type", Boolean)], K.prototype, "checkerboard", void 0), A([_({ fallback: "grid" }), k("design:type", Object)], K.prototype, "checkerboardStyle", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], K.prototype, "pixelGrid", void 0), A([_(), k("design:type", Number)], K.prototype, "dotBaseColor", void 0), A([_(), k("design:type", Number)], K.prototype, "dotColor", void 0), A([_(), k("design:type", Number)], K.prototype, "dotZoomDiff", void 0), A([_(), k("design:type", String)], K.prototype, "watermark", void 0), A([_({ fallback: 100 }), k("design:type", Number)], K.prototype, "watermarkWidth", void 0), A([_({ fallback: .05 }), k("design:type", Number)], K.prototype, "watermarkAlpha", void 0), A([_({ fallback: .5236 }), k("design:type", Number)], K.prototype, "watermarkRotation", void 0), K = Xr = A([x("DrawboardEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
|
|
5998
5999
|
//#endregion
|
|
5999
6000
|
//#region src/scene/effects/GaussianBlurEffect.ts
|
|
6000
6001
|
var Zr, Qr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", $r = class extends W {
|
|
@@ -6028,7 +6029,7 @@ var Zr, Qr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void
|
|
|
6028
6029
|
});
|
|
6029
6030
|
}
|
|
6030
6031
|
};
|
|
6031
|
-
A([_({ fallback: 4 }), k("design:type", Number)], $r.prototype, "strength", void 0), A([_({ fallback: 3 }), k("design:type", Number)], $r.prototype, "quality", void 0), $r = Zr = A([
|
|
6032
|
+
A([_({ fallback: 4 }), k("design:type", Number)], $r.prototype, "strength", void 0), A([_({ fallback: 3 }), k("design:type", Number)], $r.prototype, "quality", void 0), $r = Zr = A([x("GaussianBlurEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], $r);
|
|
6032
6033
|
//#endregion
|
|
6033
6034
|
//#region src/scene/effects/DropShadowEffect.ts
|
|
6034
6035
|
var ei, ti = class extends W {
|
|
@@ -6064,7 +6065,7 @@ var ei, ti = class extends W {
|
|
|
6064
6065
|
});
|
|
6065
6066
|
}
|
|
6066
6067
|
};
|
|
6067
|
-
A([_({ fallback: "#000000FF" }), k("design:type", Object)], ti.prototype, "color", void 0), A([_({ fallback: 4 }), k("design:type", Number)], ti.prototype, "blur", void 0), A([_({ fallback: 4 }), k("design:type", Number)], ti.prototype, "offsetX", void 0), A([_({ fallback: 4 }), k("design:type", Number)], ti.prototype, "offsetY", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], ti.prototype, "shadowOnly", void 0), ti = ei = A([
|
|
6068
|
+
A([_({ fallback: "#000000FF" }), k("design:type", Object)], ti.prototype, "color", void 0), A([_({ fallback: 4 }), k("design:type", Number)], ti.prototype, "blur", void 0), A([_({ fallback: 4 }), k("design:type", Number)], ti.prototype, "offsetX", void 0), A([_({ fallback: 4 }), k("design:type", Number)], ti.prototype, "offsetY", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], ti.prototype, "shadowOnly", void 0), ti = ei = A([x("DropShadowEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ti);
|
|
6068
6069
|
//#endregion
|
|
6069
6070
|
//#region src/scene/effects/EmbossEffect.ts
|
|
6070
6071
|
var ni, ri = class extends W {
|
|
@@ -6093,7 +6094,7 @@ var ni, ri = class extends W {
|
|
|
6093
6094
|
});
|
|
6094
6095
|
}
|
|
6095
6096
|
};
|
|
6096
|
-
A([_({ fallback: 5 }), k("design:type", Number)], ri.prototype, "strength", void 0), ri = ni = A([
|
|
6097
|
+
A([_({ fallback: 5 }), k("design:type", Number)], ri.prototype, "strength", void 0), ri = ni = A([x("EmbossEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ri);
|
|
6097
6098
|
//#endregion
|
|
6098
6099
|
//#region src/scene/effects/GlitchEffect.ts
|
|
6099
6100
|
var ii, q = class extends W {
|
|
@@ -6111,7 +6112,7 @@ var ii, q = class extends W {
|
|
|
6111
6112
|
_needsRedraw = !1;
|
|
6112
6113
|
constructor(e, t = []) {
|
|
6113
6114
|
super(), this.setProperties(e).append(t);
|
|
6114
|
-
let n =
|
|
6115
|
+
let n = C(4, this.sampleSize);
|
|
6115
6116
|
if (!n) throw Error("GlitchEffect requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
6116
6117
|
this._canvas = n, this._texture = new B(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
|
|
6117
6118
|
}
|
|
@@ -6159,7 +6160,7 @@ var ii, q = class extends W {
|
|
|
6159
6160
|
});
|
|
6160
6161
|
}
|
|
6161
6162
|
};
|
|
6162
|
-
A([_({ fallback: 10 }), k("design:type", Number)], q.prototype, "slices", void 0), A([_({ fallback: 512 }), k("design:type", Number)], q.prototype, "sampleSize", void 0), A([_({ fallback: 100 }), k("design:type", Number)], q.prototype, "offset", void 0), A([_({ fallback: 0 }), k("design:type", Number)], q.prototype, "direction", void 0), A([_({ fallback: 2 }), k("design:type", Number)], q.prototype, "fillMode", void 0), A([_({ fallback: 0 }), k("design:type", Number)], q.prototype, "seed", void 0), A([_({ default: () => [2, 2] }), k("design:type", Array)], q.prototype, "red", void 0), A([_({ default: () => [-10, 4] }), k("design:type", Array)], q.prototype, "green", void 0), A([_({ default: () => [10, -4] }), k("design:type", Array)], q.prototype, "blue", void 0), q = ii = A([
|
|
6163
|
+
A([_({ fallback: 10 }), k("design:type", Number)], q.prototype, "slices", void 0), A([_({ fallback: 512 }), k("design:type", Number)], q.prototype, "sampleSize", void 0), A([_({ fallback: 100 }), k("design:type", Number)], q.prototype, "offset", void 0), A([_({ fallback: 0 }), k("design:type", Number)], q.prototype, "direction", void 0), A([_({ fallback: 2 }), k("design:type", Number)], q.prototype, "fillMode", void 0), A([_({ fallback: 0 }), k("design:type", Number)], q.prototype, "seed", void 0), A([_({ default: () => [2, 2] }), k("design:type", Array)], q.prototype, "red", void 0), A([_({ default: () => [-10, 4] }), k("design:type", Array)], q.prototype, "green", void 0), A([_({ default: () => [10, -4] }), k("design:type", Array)], q.prototype, "blue", void 0), q = ii = A([x("GlitchEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
|
|
6163
6164
|
//#endregion
|
|
6164
6165
|
//#region src/scene/effects/GodrayEffect.ts
|
|
6165
6166
|
var ai, oi = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", J = class extends W {
|
|
@@ -6240,7 +6241,7 @@ void main(void) {
|
|
|
6240
6241
|
});
|
|
6241
6242
|
}
|
|
6242
6243
|
};
|
|
6243
|
-
A([_({ fallback: 0 }), k("design:type", Number)], J.prototype, "time", void 0), A([_({ fallback: 30 }), k("design:type", Number)], J.prototype, "angle", void 0), A([_({ fallback: .5 }), k("design:type", Number)], J.prototype, "gain", void 0), A([_({ fallback: 2.5 }), k("design:type", Number)], J.prototype, "lacunarity", void 0), A([_({ fallback: !0 }), k("design:type", Boolean)], J.prototype, "parallel", void 0), A([_({ default: () => [0, 0] }), k("design:type", Array)], J.prototype, "center", void 0), A([_({ fallback: 1 }), k("design:type", Number)], J.prototype, "alpha", void 0), J = ai = A([
|
|
6244
|
+
A([_({ fallback: 0 }), k("design:type", Number)], J.prototype, "time", void 0), A([_({ fallback: 30 }), k("design:type", Number)], J.prototype, "angle", void 0), A([_({ fallback: .5 }), k("design:type", Number)], J.prototype, "gain", void 0), A([_({ fallback: 2.5 }), k("design:type", Number)], J.prototype, "lacunarity", void 0), A([_({ fallback: !0 }), k("design:type", Boolean)], J.prototype, "parallel", void 0), A([_({ default: () => [0, 0] }), k("design:type", Array)], J.prototype, "center", void 0), A([_({ fallback: 1 }), k("design:type", Number)], J.prototype, "alpha", void 0), J = ai = A([x("GodrayEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
|
|
6244
6245
|
//#endregion
|
|
6245
6246
|
//#region src/scene/effects/KawaseBlurEffect.ts
|
|
6246
6247
|
var si = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", ci = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", li = class extends W {
|
|
@@ -6286,7 +6287,7 @@ var si = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6286
6287
|
});
|
|
6287
6288
|
}
|
|
6288
6289
|
};
|
|
6289
|
-
A([_({ fallback: 4 }), k("design:type", Number)], li.prototype, "strength", void 0), A([_({ fallback: 3 }), k("design:type", Number)], li.prototype, "quality", void 0), A([_({ default: () => [1, 1] }), k("design:type", Array)], li.prototype, "pixelSize", void 0), li = A([
|
|
6290
|
+
A([_({ fallback: 4 }), k("design:type", Number)], li.prototype, "strength", void 0), A([_({ fallback: 3 }), k("design:type", Number)], li.prototype, "quality", void 0), A([_({ default: () => [1, 1] }), k("design:type", Array)], li.prototype, "pixelSize", void 0), li = A([x("KawaseBlurEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], li);
|
|
6290
6291
|
//#endregion
|
|
6291
6292
|
//#region src/scene/effects/MaskEffect.ts
|
|
6292
6293
|
var ui, di = class extends W {
|
|
@@ -6321,7 +6322,7 @@ var ui, di = class extends W {
|
|
|
6321
6322
|
});
|
|
6322
6323
|
}
|
|
6323
6324
|
};
|
|
6324
|
-
A([_({ fallback: "" }), k("design:type", String)], di.prototype, "image", void 0), di = ui = A([
|
|
6325
|
+
A([_({ fallback: "" }), k("design:type", String)], di.prototype, "image", void 0), di = ui = A([x("MaskEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], di);
|
|
6325
6326
|
//#endregion
|
|
6326
6327
|
//#region src/scene/effects/OutlineEffect.ts
|
|
6327
6328
|
var fi, pi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", mi = class extends W {
|
|
@@ -6359,7 +6360,7 @@ var fi, pi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6359
6360
|
});
|
|
6360
6361
|
}
|
|
6361
6362
|
};
|
|
6362
|
-
A([_({ fallback: "#000000ff" }), k("design:type", Object)], mi.prototype, "color", void 0), A([_({ fallback: 1 }), k("design:type", Number)], mi.prototype, "width", void 0), A([_({ fallback: "solid" }), k("design:type", String)], mi.prototype, "style", void 0), A([_(), k("design:type", Object)], mi.prototype, "image", void 0), A([_({ fallback: 1 }), k("design:type", Number)], mi.prototype, "opacity", void 0), A([_({ fallback: .1 }), k("design:type", Number)], mi.prototype, "quality", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], mi.prototype, "knockout", void 0), mi = fi = A([
|
|
6363
|
+
A([_({ fallback: "#000000ff" }), k("design:type", Object)], mi.prototype, "color", void 0), A([_({ fallback: 1 }), k("design:type", Number)], mi.prototype, "width", void 0), A([_({ fallback: "solid" }), k("design:type", String)], mi.prototype, "style", void 0), A([_(), k("design:type", Object)], mi.prototype, "image", void 0), A([_({ fallback: 1 }), k("design:type", Number)], mi.prototype, "opacity", void 0), A([_({ fallback: .1 }), k("design:type", Number)], mi.prototype, "quality", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], mi.prototype, "knockout", void 0), mi = fi = A([x("OutlineEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], mi);
|
|
6363
6364
|
//#endregion
|
|
6364
6365
|
//#region src/scene/effects/PixelateEffect.ts
|
|
6365
6366
|
var hi, gi = class extends W {
|
|
@@ -6384,7 +6385,7 @@ var hi, gi = class extends W {
|
|
|
6384
6385
|
});
|
|
6385
6386
|
}
|
|
6386
6387
|
};
|
|
6387
|
-
A([_({ fallback: 10 }), k("design:type", Number)], gi.prototype, "strength", void 0), gi = hi = A([
|
|
6388
|
+
A([_({ fallback: 10 }), k("design:type", Number)], gi.prototype, "strength", void 0), gi = hi = A([x("PixelateEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], gi);
|
|
6388
6389
|
//#endregion
|
|
6389
6390
|
//#region src/scene/effects/ZoomBlurEffect.ts
|
|
6390
6391
|
var _i, vi = class extends W {
|
|
@@ -6416,11 +6417,11 @@ var _i, vi = class extends W {
|
|
|
6416
6417
|
});
|
|
6417
6418
|
}
|
|
6418
6419
|
};
|
|
6419
|
-
A([_(), k("design:type", Array)], vi.prototype, "center", void 0), A([_({ fallback: 20 }), k("design:type", Number)], vi.prototype, "innerRadius", void 0), A([_({ fallback: -1 }), k("design:type", Number)], vi.prototype, "radius", void 0), A([_({ fallback: .1 }), k("design:type", Number)], vi.prototype, "strength", void 0), vi = _i = A([
|
|
6420
|
+
A([_(), k("design:type", Array)], vi.prototype, "center", void 0), A([_({ fallback: 20 }), k("design:type", Number)], vi.prototype, "innerRadius", void 0), A([_({ fallback: -1 }), k("design:type", Number)], vi.prototype, "radius", void 0), A([_({ fallback: .1 }), k("design:type", Number)], vi.prototype, "strength", void 0), vi = _i = A([x("ZoomBlurEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], vi);
|
|
6420
6421
|
//#endregion
|
|
6421
6422
|
//#region src/scene/2d/element/utils.ts
|
|
6422
6423
|
function yi(e, t) {
|
|
6423
|
-
let { x: n, y: r, width: i, height: a } = t, o = !1, s = new
|
|
6424
|
+
let { x: n, y: r, width: i, height: a } = t, o = !1, s = new y().translate(-n, -r).scale(1 / i, 1 / a);
|
|
6424
6425
|
if (e.cropRect) {
|
|
6425
6426
|
let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
|
|
6426
6427
|
s.scale(1 - (t + r), 1 - (n + i)).translate(t, n), o = !0;
|
|
@@ -6441,7 +6442,7 @@ function yi(e, t) {
|
|
|
6441
6442
|
}
|
|
6442
6443
|
//#endregion
|
|
6443
6444
|
//#region src/scene/2d/element/Element2DFill.ts
|
|
6444
|
-
var Y = class extends
|
|
6445
|
+
var Y = class extends w {
|
|
6445
6446
|
_parent;
|
|
6446
6447
|
texture;
|
|
6447
6448
|
animatedTexture;
|
|
@@ -6469,6 +6470,7 @@ var Y = class extends T {
|
|
|
6469
6470
|
case "image":
|
|
6470
6471
|
case "linearGradient":
|
|
6471
6472
|
case "radialGradient":
|
|
6473
|
+
case "imagePipelines":
|
|
6472
6474
|
this._updateTexture();
|
|
6473
6475
|
break;
|
|
6474
6476
|
}
|
|
@@ -6481,9 +6483,42 @@ var Y = class extends T {
|
|
|
6481
6483
|
let n = await $.fetch(t).then((e) => e.blob());
|
|
6482
6484
|
return e ||= n.type.startsWith("image/gif") ?? !1, e ? await $.gif.load(n) : await $.texture.load(n);
|
|
6483
6485
|
});
|
|
6484
|
-
e ? this.animatedTexture = n : this.texture = n;
|
|
6486
|
+
e ? this.animatedTexture = n : this.imagePipelines?.length && this._parent.tree?.imagePipelineResolver ? (this.texture ||= n, await this._applyImagePipelines(t)) : this.texture = n;
|
|
6485
6487
|
}
|
|
6486
6488
|
}
|
|
6489
|
+
async _applyImagePipelines(e) {
|
|
6490
|
+
let t = this.imagePipelines, n = this._parent.tree?.imagePipelineResolver;
|
|
6491
|
+
if (!t?.length || !n) return;
|
|
6492
|
+
let r = await $.loadBy(`${e}#mc-image-pipeline:${this._imagePipelineKey(t)}`, async () => {
|
|
6493
|
+
let r = await this._decodePipelineSource(e);
|
|
6494
|
+
if (!r) return;
|
|
6495
|
+
let i = await n(t, r);
|
|
6496
|
+
if (i) return this._pipelineImageToCanvas(i);
|
|
6497
|
+
});
|
|
6498
|
+
r && (this.texture = new B({
|
|
6499
|
+
source: r,
|
|
6500
|
+
width: r.width,
|
|
6501
|
+
height: r.height,
|
|
6502
|
+
uploadMethodId: "image"
|
|
6503
|
+
}));
|
|
6504
|
+
}
|
|
6505
|
+
_imagePipelineKey(e) {
|
|
6506
|
+
return e.map((e) => `${e.name}:${e.params ? JSON.stringify(e.params) : ""}`).join("|");
|
|
6507
|
+
}
|
|
6508
|
+
async _decodePipelineSource(e) {
|
|
6509
|
+
let t = await $.fetchImageBitmap(e), n = Math.max(1, Math.round(t.width)), r = Math.max(1, Math.round(t.height)), i = C(n, r), a = i?.getContext("2d");
|
|
6510
|
+
if (!(!i || !a)) return a.drawImage(t, 0, 0, n, r), Fe && t instanceof ImageBitmap && t.close(), {
|
|
6511
|
+
data: a.getImageData(0, 0, n, r).data,
|
|
6512
|
+
width: n,
|
|
6513
|
+
height: r
|
|
6514
|
+
};
|
|
6515
|
+
}
|
|
6516
|
+
_pipelineImageToCanvas(e) {
|
|
6517
|
+
let t = Math.max(1, Math.round(e.width)), n = Math.max(1, Math.round(e.height)), r = C(t, n), i = r?.getContext("2d");
|
|
6518
|
+
if (!r || !i) return;
|
|
6519
|
+
let a = i.createImageData(t, n);
|
|
6520
|
+
return a.data.set(e.data), i.putImageData(a, 0, 0), r;
|
|
6521
|
+
}
|
|
6487
6522
|
async _updateTexture() {
|
|
6488
6523
|
await this.loadTexture(), this._parent.requestDraw();
|
|
6489
6524
|
}
|
|
@@ -6536,7 +6571,7 @@ var Y = class extends T {
|
|
|
6536
6571
|
this.updateFrameIndex();
|
|
6537
6572
|
}
|
|
6538
6573
|
};
|
|
6539
|
-
A([_({ fallback: !0 }), k("design:type", Boolean)], Y.prototype, "enabled", void 0), A([_(), k("design:type", Object)], Y.prototype, "color", void 0), A([_(), k("design:type", Object)], Y.prototype, "image", void 0), A([_(), k("design:type", Object)], Y.prototype, "linearGradient", void 0), A([_(), k("design:type", Object)], Y.prototype, "radialGradient", void 0), A([_(), k("design:type", Object)], Y.prototype, "cropRect", void 0), A([_(), k("design:type", Object)], Y.prototype, "stretchRect", void 0), A([_(), k("design:type", Object)], Y.prototype, "dpi", void 0), A([_(), k("design:type", Object)], Y.prototype, "rotateWithShape", void 0), A([_(), k("design:type", Object)], Y.prototype, "tile", void 0), A([_(), k("design:type", Object)], Y.prototype, "opacity", void 0);
|
|
6574
|
+
A([_({ fallback: !0 }), k("design:type", Boolean)], Y.prototype, "enabled", void 0), A([_(), k("design:type", Object)], Y.prototype, "color", void 0), A([_(), k("design:type", Object)], Y.prototype, "image", void 0), A([_(), k("design:type", Object)], Y.prototype, "linearGradient", void 0), A([_(), k("design:type", Object)], Y.prototype, "radialGradient", void 0), A([_(), k("design:type", Object)], Y.prototype, "cropRect", void 0), A([_(), k("design:type", Object)], Y.prototype, "stretchRect", void 0), A([_(), k("design:type", Object)], Y.prototype, "dpi", void 0), A([_(), k("design:type", Object)], Y.prototype, "rotateWithShape", void 0), A([_(), k("design:type", Object)], Y.prototype, "tile", void 0), A([_(), k("design:type", Object)], Y.prototype, "opacity", void 0), A([_(), k("design:type", Object)], Y.prototype, "imagePipelines", void 0);
|
|
6540
6575
|
//#endregion
|
|
6541
6576
|
//#region src/scene/2d/element/Element2DBackground.ts
|
|
6542
6577
|
var bi = class extends Y {
|
|
@@ -6581,7 +6616,7 @@ function Ci(e) {
|
|
|
6581
6616
|
};
|
|
6582
6617
|
}
|
|
6583
6618
|
}
|
|
6584
|
-
var X = class extends
|
|
6619
|
+
var X = class extends w {
|
|
6585
6620
|
_parent;
|
|
6586
6621
|
_instance;
|
|
6587
6622
|
_container;
|
|
@@ -6672,7 +6707,7 @@ var X = class extends T {
|
|
|
6672
6707
|
if (!e?.isValid()) return;
|
|
6673
6708
|
let { width: t, height: n } = this._parent.size, r = this._parent.context;
|
|
6674
6709
|
this._parent.shape.draw(!0), r.fillStyle = e;
|
|
6675
|
-
let { a: i, c: a, tx: o, b: s, d: c, ty: l } = new
|
|
6710
|
+
let { a: i, c: a, tx: o, b: s, d: c, ty: l } = new y().scale(1 / t, 1 / n), u, d;
|
|
6676
6711
|
r.fill({ transformUv: (e, t) => {
|
|
6677
6712
|
u = e[t], d = e[t + 1], e[t] = i * u + a * d + o, e[t + 1] = s * u + c * d + l;
|
|
6678
6713
|
} });
|
|
@@ -6730,7 +6765,7 @@ var X = class extends T {
|
|
|
6730
6765
|
A([_({ fallback: !0 }), k("design:type", Boolean)], X.prototype, "enabled", void 0), A([_({ fallback: "column" }), k("design:type", Object)], X.prototype, "type", void 0), A([_(), k("design:type", Object)], X.prototype, "grouping", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], X.prototype, "categories", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], X.prototype, "series", void 0), A([_(), k("design:type", Object)], X.prototype, "title", void 0), A([_(), k("design:type", Object)], X.prototype, "legend", void 0), A([_(), k("design:type", Object)], X.prototype, "categoryAxis", void 0), A([_(), k("design:type", Object)], X.prototype, "valueAxis", void 0);
|
|
6731
6766
|
//#endregion
|
|
6732
6767
|
//#region src/scene/2d/element/Element2DComments.ts
|
|
6733
|
-
var wi = class extends
|
|
6768
|
+
var wi = class extends w {
|
|
6734
6769
|
parent;
|
|
6735
6770
|
constructor(e) {
|
|
6736
6771
|
super(), this.parent = e;
|
|
@@ -6764,7 +6799,7 @@ var wi = class extends T {
|
|
|
6764
6799
|
isValid() {
|
|
6765
6800
|
return Object.values(this._properties).some(Boolean);
|
|
6766
6801
|
}
|
|
6767
|
-
}, Ti = class extends
|
|
6802
|
+
}, Ti = class extends w {
|
|
6768
6803
|
_parent;
|
|
6769
6804
|
_routeSig;
|
|
6770
6805
|
_routePath;
|
|
@@ -6806,7 +6841,7 @@ var wi = class extends T {
|
|
|
6806
6841
|
if (e.idx !== void 0) {
|
|
6807
6842
|
let n = t.shape.connectionPoints?.find((t) => t.idx === e.idx);
|
|
6808
6843
|
if (n) {
|
|
6809
|
-
let e = t.globalTransform.apply(new
|
|
6844
|
+
let e = t.globalTransform.apply(new b(n.x * t.size.x, n.y * t.size.y)), i;
|
|
6810
6845
|
return i = n.ang === void 0 ? Or(n.x - .5, n.y - .5) : {
|
|
6811
6846
|
x: Math.cos(n.ang),
|
|
6812
6847
|
y: Math.sin(n.ang)
|
|
@@ -6818,7 +6853,7 @@ var wi = class extends T {
|
|
|
6818
6853
|
}
|
|
6819
6854
|
}
|
|
6820
6855
|
return {
|
|
6821
|
-
point: new
|
|
6856
|
+
point: new b(n.min.x + n.size.x / 2, n.min.y + n.size.y / 2),
|
|
6822
6857
|
bbox: r
|
|
6823
6858
|
};
|
|
6824
6859
|
}
|
|
@@ -6848,138 +6883,23 @@ function Ei(e, t) {
|
|
|
6848
6883
|
};
|
|
6849
6884
|
}
|
|
6850
6885
|
//#endregion
|
|
6851
|
-
//#region src/scene/2d/element/bakeImageEffects.ts
|
|
6852
|
-
function Di(e) {
|
|
6853
|
-
return e.getContext("2d");
|
|
6854
|
-
}
|
|
6855
|
-
function Oi(e, t, n, r) {
|
|
6856
|
-
let i = (t?.angle ?? 0) * Math.PI / 180, a = n / 2, o = r / 2, s = (Math.abs(Math.cos(i)) * n + Math.abs(Math.sin(i)) * r) / 2, c = Math.cos(i) * s, l = Math.sin(i) * s, u = e.createLinearGradient(a - c, o - l, a + c, o + l);
|
|
6857
|
-
for (let e of t?.stops ?? []) u.addColorStop(Math.min(1, Math.max(0, e.offset)), e.color);
|
|
6858
|
-
return u;
|
|
6859
|
-
}
|
|
6860
|
-
function ki(e, t, n, r, i) {
|
|
6861
|
-
let a = w(t, n), o = Di(a);
|
|
6862
|
-
return o.drawImage(e, 0, 0, t, n), o.globalCompositeOperation = "source-in", r.linearGradient ? (o.fillStyle = Oi(o, r.linearGradient, t, n), o.fillRect(0, 0, t, n)) : r.image && i[r.image] ? o.drawImage(i[r.image], 0, 0, t, n) : r.color && (o.fillStyle = r.color, o.fillRect(0, 0, t, n)), a;
|
|
6863
|
-
}
|
|
6864
|
-
function Ai(e, t, n, r, i) {
|
|
6865
|
-
let a = w(t, n), o = Di(a), s = Math.max(8, Math.ceil(r) * 2);
|
|
6866
|
-
for (let i = 0; i < s; i++) {
|
|
6867
|
-
let a = i / s * Math.PI * 2;
|
|
6868
|
-
o.drawImage(e, Math.cos(a) * r, Math.sin(a) * r, t, n);
|
|
6869
|
-
}
|
|
6870
|
-
o.globalCompositeOperation = "source-in", o.fillStyle = i, o.fillRect(0, 0, t, n);
|
|
6871
|
-
let c = w(t, n), l = Di(c);
|
|
6872
|
-
return l.drawImage(a, 0, 0), l.drawImage(e, 0, 0, t, n), c;
|
|
6873
|
-
}
|
|
6874
|
-
function ji(e) {
|
|
6875
|
-
let t = 0, n = 0;
|
|
6876
|
-
if (!e) return {
|
|
6877
|
-
x: t,
|
|
6878
|
-
y: n
|
|
6879
|
-
};
|
|
6880
|
-
let r = e.match(/translate\(\s*(-?[\d.]+)[\s,]+(-?[\d.]+)/);
|
|
6881
|
-
r && (t = Number.parseFloat(r[1]), n = Number.parseFloat(r[2]));
|
|
6882
|
-
let i = e.match(/translateX\(\s*(-?[\d.]+)/);
|
|
6883
|
-
i && (t = Number.parseFloat(i[1]));
|
|
6884
|
-
let a = e.match(/translateY\(\s*(-?[\d.]+)/);
|
|
6885
|
-
return a && (n = Number.parseFloat(a[1])), {
|
|
6886
|
-
x: t,
|
|
6887
|
-
y: n
|
|
6888
|
-
};
|
|
6889
|
-
}
|
|
6890
|
-
function Mi(e, t, n, r, i = {}) {
|
|
6891
|
-
let a = Math.max(1, Math.round(n)), o = Math.max(1, Math.round(r)), s = 0;
|
|
6892
|
-
for (let e of t) {
|
|
6893
|
-
e.outline?.width && e.outline.color && (s = Math.max(s, e.outline.width));
|
|
6894
|
-
let t = ji(e.transform);
|
|
6895
|
-
s = Math.max(s, Math.abs(t.x), Math.abs(t.y));
|
|
6896
|
-
}
|
|
6897
|
-
s = Math.min(Math.ceil(s), Math.floor(Math.min(a, o) * .2));
|
|
6898
|
-
let c = e;
|
|
6899
|
-
if (s > 0) {
|
|
6900
|
-
let t = w(a, o);
|
|
6901
|
-
Di(t).drawImage(e, s, s, Math.max(1, a - s * 2), Math.max(1, o - s * 2)), c = t;
|
|
6902
|
-
}
|
|
6903
|
-
let l = w(a, o), u = Di(l);
|
|
6904
|
-
for (let e of t) {
|
|
6905
|
-
let t = c;
|
|
6906
|
-
e.fill && (e.fill.color || e.fill.linearGradient || e.fill.image) && (t = ki(t, a, o, e.fill, i)), e.outline?.width && e.outline.color && (t = Ai(t, a, o, e.outline.width, e.outline.color));
|
|
6907
|
-
let { x: n, y: r } = ji(e.transform);
|
|
6908
|
-
u.save(), u.globalCompositeOperation = "destination-over", e.shadow && (u.shadowColor = e.shadow.color, u.shadowBlur = e.shadow.blur ?? 0, u.shadowOffsetX = e.shadow.offsetX ?? 0, u.shadowOffsetY = e.shadow.offsetY ?? 0), u.drawImage(t, n, r, a, o), u.restore();
|
|
6909
|
-
}
|
|
6910
|
-
return l;
|
|
6911
|
-
}
|
|
6912
|
-
//#endregion
|
|
6913
6886
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
6914
|
-
var
|
|
6915
|
-
_sourceCanvas;
|
|
6916
|
-
_sourceImage;
|
|
6887
|
+
var Di = class extends Y {
|
|
6917
6888
|
setProperties(e) {
|
|
6918
6889
|
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
6919
6890
|
}
|
|
6920
6891
|
_updateProperty(e, t, n) {
|
|
6921
|
-
|
|
6922
|
-
case "fillWithShape":
|
|
6923
|
-
this._parent.requestDraw();
|
|
6924
|
-
break;
|
|
6925
|
-
case "effects":
|
|
6926
|
-
this._updateTexture();
|
|
6927
|
-
break;
|
|
6928
|
-
}
|
|
6929
|
-
}
|
|
6930
|
-
async loadTexture() {
|
|
6931
|
-
await super.loadTexture(), await this._applyEffects();
|
|
6932
|
-
}
|
|
6933
|
-
async _applyEffects() {
|
|
6934
|
-
if (!this.effects?.length || this.animatedTexture || !this.texture) {
|
|
6935
|
-
this._sourceCanvas = void 0, this._sourceImage = void 0;
|
|
6936
|
-
return;
|
|
6937
|
-
}
|
|
6938
|
-
let e = await this._resolveSourceCanvas();
|
|
6939
|
-
if (!e) return;
|
|
6940
|
-
let t = e.width, n = e.height, r = await this._resolvePatterns(), i = Mi(e, this.effects, t, n, r);
|
|
6941
|
-
this.texture = new B({
|
|
6942
|
-
source: i,
|
|
6943
|
-
width: t,
|
|
6944
|
-
height: n,
|
|
6945
|
-
uploadMethodId: "image"
|
|
6946
|
-
});
|
|
6947
|
-
}
|
|
6948
|
-
async _resolvePatterns() {
|
|
6949
|
-
let e = {};
|
|
6950
|
-
for (let t of this.effects ?? []) {
|
|
6951
|
-
let n = t.fill?.image;
|
|
6952
|
-
if (!n || d(n) || e[n]) continue;
|
|
6953
|
-
let r = await $.loadBy(`${n}#mc-foreground-pattern`, async () => {
|
|
6954
|
-
let e = await $.fetchImageBitmap(n), t = this._snapshot(e);
|
|
6955
|
-
return Pe && e instanceof ImageBitmap && e.close(), t;
|
|
6956
|
-
});
|
|
6957
|
-
r && (e[n] = r);
|
|
6958
|
-
}
|
|
6959
|
-
return e;
|
|
6960
|
-
}
|
|
6961
|
-
async _resolveSourceCanvas() {
|
|
6962
|
-
if (this._sourceImage !== this.image && (this._sourceCanvas = void 0, this._sourceImage = this.image), this._sourceCanvas) return this._sourceCanvas;
|
|
6963
|
-
if (d(this.image) || this.image === "viewport") return;
|
|
6964
|
-
let e = this.image, t = await $.loadBy(`${e}#mc-foreground-source`, async () => {
|
|
6965
|
-
let t = await $.fetchImageBitmap(e), n = this._snapshot(t);
|
|
6966
|
-
return Pe && t instanceof ImageBitmap && t.close(), n;
|
|
6967
|
-
});
|
|
6968
|
-
return this._sourceImage === e && t && (this._sourceCanvas = t), t;
|
|
6969
|
-
}
|
|
6970
|
-
_snapshot(e) {
|
|
6971
|
-
let t = Math.max(1, Math.round(e.width)), n = Math.max(1, Math.round(e.height)), r = w(t, n), i = r?.getContext("2d");
|
|
6972
|
-
if (!(!r || !i)) return i.drawImage(e, 0, 0, t, n), r;
|
|
6892
|
+
super._updateProperty(e, t, n), e === "fillWithShape" && this._parent.requestDraw();
|
|
6973
6893
|
}
|
|
6974
6894
|
};
|
|
6975
|
-
A([_(), k("design:type", Object)],
|
|
6895
|
+
A([_(), k("design:type", Object)], Di.prototype, "fillWithShape", void 0);
|
|
6976
6896
|
//#endregion
|
|
6977
6897
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
6978
|
-
var
|
|
6898
|
+
var Oi = {
|
|
6979
6899
|
sm: 4,
|
|
6980
6900
|
md: 6,
|
|
6981
6901
|
lg: 8
|
|
6982
|
-
},
|
|
6902
|
+
}, ki = class extends Y {
|
|
6983
6903
|
setProperties(e) {
|
|
6984
6904
|
return super._setProperties(d(e) ? void 0 : te(e));
|
|
6985
6905
|
}
|
|
@@ -7024,14 +6944,14 @@ var Pi = {
|
|
|
7024
6944
|
_fillEnd(e, t, n, r, i) {
|
|
7025
6945
|
let a = e.x - t.x, o = e.y - t.y, s = Math.hypot(a, o);
|
|
7026
6946
|
if (s < .001) return;
|
|
7027
|
-
let c =
|
|
6947
|
+
let c = Oi[String(n.width ?? n.height ?? "md")] ?? 6, l = r * c, u = r * c * .5, d = a / s, f = o / s, p = e.x - d * l, m = e.y - f * l, h = -f * u, g = d * u, ee = this._parent.context;
|
|
7028
6948
|
ee.fillStyle = i, ee.moveTo(e.x, e.y).lineTo(p + h, m + g).lineTo(p - h, m - g).closePath().fill();
|
|
7029
6949
|
}
|
|
7030
6950
|
};
|
|
7031
|
-
A([_(), k("design:type", Object)],
|
|
6951
|
+
A([_(), k("design:type", Object)], ki.prototype, "color", void 0), A([_(), k("design:type", Object)], ki.prototype, "width", void 0), A([_({ fallback: "solid" }), k("design:type", Object)], ki.prototype, "style", void 0), A([_({ fallback: "butt" }), k("design:type", Object)], ki.prototype, "lineCap", void 0), A([_({ fallback: "miter" }), k("design:type", Object)], ki.prototype, "lineJoin", void 0), A([_(), k("design:type", Object)], ki.prototype, "headEnd", void 0), A([_(), k("design:type", Object)], ki.prototype, "tailEnd", void 0);
|
|
7032
6952
|
//#endregion
|
|
7033
6953
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
7034
|
-
var
|
|
6954
|
+
var Ai = class extends w {
|
|
7035
6955
|
_parent;
|
|
7036
6956
|
constructor(e) {
|
|
7037
6957
|
super(), this._parent = e;
|
|
@@ -7055,12 +6975,12 @@ var Ii = class extends T {
|
|
|
7055
6975
|
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new ti({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
7056
6976
|
}
|
|
7057
6977
|
};
|
|
7058
|
-
A([_({ fallback: !0 }), k("design:type", Boolean)],
|
|
6978
|
+
A([_({ fallback: !0 }), k("design:type", Boolean)], Ai.prototype, "enabled", void 0), A([_({ fallback: "#000000FF" }), k("design:type", Object)], Ai.prototype, "color", void 0), A([_({ fallback: 0 }), k("design:type", Object)], Ai.prototype, "blur", void 0), A([_({ fallback: 0 }), k("design:type", Object)], Ai.prototype, "offsetY", void 0), A([_({ fallback: 0 }), k("design:type", Object)], Ai.prototype, "offsetX", void 0);
|
|
7059
6979
|
//#endregion
|
|
7060
6980
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
7061
|
-
var
|
|
6981
|
+
var ji = class extends w {
|
|
7062
6982
|
_parent;
|
|
7063
|
-
_path2DSet = new
|
|
6983
|
+
_path2DSet = new de();
|
|
7064
6984
|
_localPath;
|
|
7065
6985
|
_hitPath2DSet;
|
|
7066
6986
|
_hitWidth = 0;
|
|
@@ -7108,8 +7028,8 @@ var Li = class extends T {
|
|
|
7108
7028
|
let { width: e, height: t } = this._parent.size;
|
|
7109
7029
|
if (!(!e || !t)) {
|
|
7110
7030
|
if (!this._hitPath2DSet || this._hitWidth !== e || this._hitHeight !== t) {
|
|
7111
|
-
let n = new
|
|
7112
|
-
this._hitPath2DSet = new
|
|
7031
|
+
let n = new y().scale(e, t);
|
|
7032
|
+
this._hitPath2DSet = new de(this._path2DSet.paths.map((e) => e.clone().applyTransform(n))), this._hitWidth = e, this._hitHeight = t;
|
|
7113
7033
|
}
|
|
7114
7034
|
return this._hitPath2DSet;
|
|
7115
7035
|
}
|
|
@@ -7117,10 +7037,10 @@ var Li = class extends T {
|
|
|
7117
7037
|
_updatePath2DSet() {
|
|
7118
7038
|
let e;
|
|
7119
7039
|
if (this.svg) {
|
|
7120
|
-
let t =
|
|
7121
|
-
this._path2DSet =
|
|
7040
|
+
let t = fe(this.svg);
|
|
7041
|
+
this._path2DSet = pe(t), e = this._path2DSet.viewBox;
|
|
7122
7042
|
} else this._path2DSet.paths.length = 0, this.paths?.forEach((e, t) => {
|
|
7123
|
-
let { data: n, ...r } = e, i = new
|
|
7043
|
+
let { data: n, ...r } = e, i = new ue();
|
|
7124
7044
|
i.style = r, i.addData(n), this._path2DSet.paths[t] = i;
|
|
7125
7045
|
});
|
|
7126
7046
|
if (!e) {
|
|
@@ -7139,7 +7059,7 @@ var Li = class extends T {
|
|
|
7139
7059
|
}
|
|
7140
7060
|
let [t, n, r, i] = e;
|
|
7141
7061
|
this._path2DSet.paths.forEach((e) => {
|
|
7142
|
-
e.applyTransform(new
|
|
7062
|
+
e.applyTransform(new y().translate(-t, -n).scale(1 / r, 1 / i));
|
|
7143
7063
|
}), this._hitPath2DSet = void 0;
|
|
7144
7064
|
}
|
|
7145
7065
|
draw(e = !1) {
|
|
@@ -7147,7 +7067,7 @@ var Li = class extends T {
|
|
|
7147
7067
|
else if (!e && this.isValid()) {
|
|
7148
7068
|
let e = this._parent.context, { width: t, height: n } = this._parent.size;
|
|
7149
7069
|
this._path2DSet.paths.forEach((r) => {
|
|
7150
|
-
r.style?.fillRule && (e.fillRule = r.style.fillRule), e.addPath(r.clone().applyTransform(new
|
|
7070
|
+
r.style?.fillRule && (e.fillRule = r.style.fillRule), e.addPath(r.clone().applyTransform(new y().scale(t, n)));
|
|
7151
7071
|
});
|
|
7152
7072
|
} else this._drawRect();
|
|
7153
7073
|
}
|
|
@@ -7156,24 +7076,24 @@ var Li = class extends T {
|
|
|
7156
7076
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
7157
7077
|
}
|
|
7158
7078
|
};
|
|
7159
|
-
A([_({ fallback: !0 }), k("design:type", Boolean)],
|
|
7079
|
+
A([_({ fallback: !0 }), k("design:type", Boolean)], ji.prototype, "enabled", void 0), A([_(), k("design:type", Object)], ji.prototype, "preset", void 0), A([_(), k("design:type", Object)], ji.prototype, "svg", void 0), A([_(), k("design:type", Object)], ji.prototype, "viewBox", void 0), A([_(), k("design:type", Object)], ji.prototype, "paths", void 0), A([_(), k("design:type", Object)], ji.prototype, "connectionPoints", void 0);
|
|
7160
7080
|
//#endregion
|
|
7161
7081
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
7162
|
-
var
|
|
7082
|
+
var Mi = class extends T {
|
|
7163
7083
|
constructor(e) {
|
|
7164
7084
|
super(), this.setProperties(e);
|
|
7165
7085
|
}
|
|
7166
|
-
},
|
|
7086
|
+
}, Ni = {
|
|
7167
7087
|
...o(),
|
|
7168
7088
|
left: 0,
|
|
7169
7089
|
top: 0,
|
|
7170
7090
|
width: 0,
|
|
7171
7091
|
height: 0
|
|
7172
7092
|
};
|
|
7173
|
-
for (let e in
|
|
7093
|
+
for (let e in Ni) i(Mi, e, { fallback: Ni[e] });
|
|
7174
7094
|
//#endregion
|
|
7175
7095
|
//#region src/scene/2d/element/Element2DTable.ts
|
|
7176
|
-
var
|
|
7096
|
+
var Pi = 100, Fi = 40, Ii = class extends w {
|
|
7177
7097
|
_parent;
|
|
7178
7098
|
_cellNodes = /* @__PURE__ */ new Map();
|
|
7179
7099
|
_cellSnapshots = /* @__PURE__ */ new Map();
|
|
@@ -7204,10 +7124,10 @@ var Bi = 100, Vi = 40, Hi = class extends T {
|
|
|
7204
7124
|
return !!(this.enabled && this.cells.length);
|
|
7205
7125
|
}
|
|
7206
7126
|
get gridWidth() {
|
|
7207
|
-
return this.columns.reduce((e, t) => e + (t.width ||
|
|
7127
|
+
return this.columns.reduce((e, t) => e + (t.width || Pi), 0);
|
|
7208
7128
|
}
|
|
7209
7129
|
get gridHeight() {
|
|
7210
|
-
return this.rows.reduce((e, t) => e + (t.height ||
|
|
7130
|
+
return this.rows.reduce((e, t) => e + (t.height || Fi), 0);
|
|
7211
7131
|
}
|
|
7212
7132
|
update() {
|
|
7213
7133
|
if (this._dirty = !1, !this.isValid()) {
|
|
@@ -7217,9 +7137,9 @@ var Bi = 100, Vi = 40, Hi = class extends T {
|
|
|
7217
7137
|
let { columns: e, rows: t, cells: n } = this, r = e.length, i = t.length;
|
|
7218
7138
|
for (let e of n) r = Math.max(r, e.col + (e.colSpan || 1)), i = Math.max(i, e.row + (e.rowSpan || 1));
|
|
7219
7139
|
let a = [0];
|
|
7220
|
-
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width ||
|
|
7140
|
+
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || Pi));
|
|
7221
7141
|
let o = [0];
|
|
7222
|
-
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height ||
|
|
7142
|
+
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || Fi));
|
|
7223
7143
|
this._parent.size.set(a[e.length] ?? 0, o[t.length] ?? 0);
|
|
7224
7144
|
let s = /* @__PURE__ */ new Set();
|
|
7225
7145
|
for (let e of n) {
|
|
@@ -7256,10 +7176,10 @@ var Bi = 100, Vi = 40, Hi = class extends T {
|
|
|
7256
7176
|
this._clearCells();
|
|
7257
7177
|
}
|
|
7258
7178
|
};
|
|
7259
|
-
A([_({ fallback: !0 }), k("design:type", Boolean)],
|
|
7179
|
+
A([_({ fallback: !0 }), k("design:type", Boolean)], Ii.prototype, "enabled", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Ii.prototype, "columns", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Ii.prototype, "rows", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Ii.prototype, "cells", void 0);
|
|
7260
7180
|
//#endregion
|
|
7261
7181
|
//#region src/scene/2d/element/Element2DText.ts
|
|
7262
|
-
var Z = class extends
|
|
7182
|
+
var Z = class extends w {
|
|
7263
7183
|
_parent;
|
|
7264
7184
|
base;
|
|
7265
7185
|
get textContent() {
|
|
@@ -7273,7 +7193,7 @@ var Z = class extends T {
|
|
|
7273
7193
|
_texture = new nr({ mipmap: !0 });
|
|
7274
7194
|
_textureMap = /* @__PURE__ */ new Map();
|
|
7275
7195
|
constructor(e) {
|
|
7276
|
-
super(), this._parent = e, this.base = new
|
|
7196
|
+
super(), this._parent = e, this.base = new ve(), this.base.setPropertyAccessor(this);
|
|
7277
7197
|
}
|
|
7278
7198
|
setProperties(e) {
|
|
7279
7199
|
return super.setProperties(d(e) ? void 0 : ae(e));
|
|
@@ -7366,7 +7286,7 @@ var Z = class extends T {
|
|
|
7366
7286
|
this.base.pathSets.forEach((n) => {
|
|
7367
7287
|
n.paths.forEach((n) => {
|
|
7368
7288
|
let r = n.getMeta();
|
|
7369
|
-
if (r instanceof
|
|
7289
|
+
if (r instanceof _e) {
|
|
7370
7290
|
let i = r.parent.index, a = r.parent.parent.index;
|
|
7371
7291
|
if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
|
|
7372
7292
|
let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
@@ -7399,7 +7319,7 @@ var Z = class extends T {
|
|
|
7399
7319
|
_textureDraw(e) {
|
|
7400
7320
|
let { left: t = 0, top: n = 0, width: r, height: i } = this.base.boundingBox;
|
|
7401
7321
|
e.fillStyle = this._texture, e.rect(t, n, r, i);
|
|
7402
|
-
let { a, c: o, tx: s, b: c, d: l, ty: u } = new
|
|
7322
|
+
let { a, c: o, tx: s, b: c, d: l, ty: u } = new y().translate(-t, -n).scale(1 / r, 1 / i), d, f;
|
|
7403
7323
|
e.fill({
|
|
7404
7324
|
transformUv: (e, t) => {
|
|
7405
7325
|
d = e[t], f = e[t + 1], e[t] = a * d + o * f + s, e[t + 1] = c * d + l * f + u;
|
|
@@ -7426,11 +7346,11 @@ var Q = {
|
|
|
7426
7346
|
horizontal: 6,
|
|
7427
7347
|
vertical: 7,
|
|
7428
7348
|
all: 8
|
|
7429
|
-
},
|
|
7349
|
+
}, Li = {
|
|
7430
7350
|
column: 0,
|
|
7431
7351
|
row: 1,
|
|
7432
7352
|
all: 2
|
|
7433
|
-
},
|
|
7353
|
+
}, Ri = {
|
|
7434
7354
|
auto: 0,
|
|
7435
7355
|
"flex-start": 1,
|
|
7436
7356
|
center: 2,
|
|
@@ -7440,42 +7360,42 @@ var Q = {
|
|
|
7440
7360
|
"space-between": 6,
|
|
7441
7361
|
"space-around": 7,
|
|
7442
7362
|
"space-evenly": 8
|
|
7443
|
-
},
|
|
7363
|
+
}, zi = {
|
|
7444
7364
|
flex: 0,
|
|
7445
7365
|
none: 1,
|
|
7446
7366
|
contents: 2
|
|
7447
|
-
},
|
|
7367
|
+
}, Bi = {
|
|
7448
7368
|
inherit: 0,
|
|
7449
7369
|
ltr: 1,
|
|
7450
7370
|
rtl: 2
|
|
7451
|
-
},
|
|
7371
|
+
}, Vi = {
|
|
7452
7372
|
column: 0,
|
|
7453
7373
|
"column-reverse": 1,
|
|
7454
7374
|
row: 2,
|
|
7455
7375
|
"row-reverse": 3
|
|
7456
|
-
},
|
|
7376
|
+
}, Hi = {
|
|
7457
7377
|
"no-wrap": 0,
|
|
7458
7378
|
wrap: 1,
|
|
7459
7379
|
"Wrap-reverse": 2
|
|
7460
|
-
},
|
|
7380
|
+
}, Ui = {
|
|
7461
7381
|
"flex-start": 0,
|
|
7462
7382
|
center: 1,
|
|
7463
7383
|
"flex-end": 2,
|
|
7464
7384
|
"space-between": 3,
|
|
7465
7385
|
"space-around": 4,
|
|
7466
7386
|
"space-evenly": 5
|
|
7467
|
-
},
|
|
7387
|
+
}, Wi = {
|
|
7468
7388
|
visible: 0,
|
|
7469
7389
|
hidden: 1,
|
|
7470
7390
|
scroll: 2
|
|
7471
|
-
},
|
|
7391
|
+
}, Gi = {
|
|
7472
7392
|
static: 0,
|
|
7473
7393
|
relative: 1,
|
|
7474
7394
|
absolute: 2
|
|
7475
|
-
},
|
|
7395
|
+
}, Ki = {
|
|
7476
7396
|
"border-box": 0,
|
|
7477
7397
|
"content-box": 1
|
|
7478
|
-
},
|
|
7398
|
+
}, qi = class e {
|
|
7479
7399
|
_parent;
|
|
7480
7400
|
static _yoga;
|
|
7481
7401
|
static async load() {
|
|
@@ -7487,27 +7407,27 @@ var Q = {
|
|
|
7487
7407
|
this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
|
|
7488
7408
|
}
|
|
7489
7409
|
_addChild(e, t) {
|
|
7490
|
-
if (e instanceof
|
|
7410
|
+
if (e instanceof Qi && e.flexbox.node && this.node) {
|
|
7491
7411
|
this.node.insertChild(e.flexbox.node, t);
|
|
7492
7412
|
let n = e.style.getProperties();
|
|
7493
7413
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
7494
7414
|
}
|
|
7495
7415
|
}
|
|
7496
7416
|
_removeChild(e, t) {
|
|
7497
|
-
e instanceof
|
|
7417
|
+
e instanceof Qi && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
7498
7418
|
}
|
|
7499
7419
|
updateStyleProperty(e, t) {
|
|
7500
7420
|
let n = this.node;
|
|
7501
7421
|
if (n) {
|
|
7502
7422
|
switch (e) {
|
|
7503
7423
|
case "alignContent":
|
|
7504
|
-
n.setAlignContent(t ?
|
|
7424
|
+
n.setAlignContent(t ? Ri[t] ?? Ri["flex-start"] : Ri["flex-start"]);
|
|
7505
7425
|
break;
|
|
7506
7426
|
case "alignItems":
|
|
7507
|
-
n.setAlignItems(t ?
|
|
7427
|
+
n.setAlignItems(t ? Ri[t] ?? Ri["flex-start"] : Ri["flex-start"]);
|
|
7508
7428
|
break;
|
|
7509
7429
|
case "alignSelf":
|
|
7510
|
-
n.setAlignSelf(t ?
|
|
7430
|
+
n.setAlignSelf(t ? Ri[t] ?? Ri["flex-start"] : Ri["flex-start"]);
|
|
7511
7431
|
break;
|
|
7512
7432
|
case "aspectRatio":
|
|
7513
7433
|
n.setAspectRatio(t);
|
|
@@ -7528,10 +7448,10 @@ var Q = {
|
|
|
7528
7448
|
n.setBorder(Q.all, this._parent.style.borderWidth);
|
|
7529
7449
|
break;
|
|
7530
7450
|
case "direction":
|
|
7531
|
-
n.setDirection(t ?
|
|
7451
|
+
n.setDirection(t ? Bi[t] ?? Bi.inherit : Bi.inherit);
|
|
7532
7452
|
break;
|
|
7533
7453
|
case "display":
|
|
7534
|
-
n.setDisplay(t ?
|
|
7454
|
+
n.setDisplay(t ? zi[t] ?? zi.flex : zi.flex);
|
|
7535
7455
|
break;
|
|
7536
7456
|
case "flex":
|
|
7537
7457
|
n.setFlex(t);
|
|
@@ -7540,7 +7460,7 @@ var Q = {
|
|
|
7540
7460
|
n.setFlexBasis(t);
|
|
7541
7461
|
break;
|
|
7542
7462
|
case "flexDirection":
|
|
7543
|
-
n.setFlexDirection(t ?
|
|
7463
|
+
n.setFlexDirection(t ? Vi[t] ?? Vi.row : Vi.row);
|
|
7544
7464
|
break;
|
|
7545
7465
|
case "flexGrow":
|
|
7546
7466
|
n.setFlexGrow(t);
|
|
@@ -7549,16 +7469,16 @@ var Q = {
|
|
|
7549
7469
|
n.setFlexShrink(t);
|
|
7550
7470
|
break;
|
|
7551
7471
|
case "flexWrap":
|
|
7552
|
-
n.setFlexWrap(t ?
|
|
7472
|
+
n.setFlexWrap(t ? Hi[t] ?? Hi.wrap : Hi.wrap);
|
|
7553
7473
|
break;
|
|
7554
7474
|
case "height":
|
|
7555
7475
|
n.setHeight(t);
|
|
7556
7476
|
break;
|
|
7557
7477
|
case "justifyContent":
|
|
7558
|
-
n.setJustifyContent(t ?
|
|
7478
|
+
n.setJustifyContent(t ? Ui[t] ?? Ui["flex-start"] : Ui["flex-start"]);
|
|
7559
7479
|
break;
|
|
7560
7480
|
case "gap":
|
|
7561
|
-
t !== void 0 && n.setGap(
|
|
7481
|
+
t !== void 0 && n.setGap(Li.all, t);
|
|
7562
7482
|
break;
|
|
7563
7483
|
case "marginTop":
|
|
7564
7484
|
n.setMargin(Q.top, t);
|
|
@@ -7588,7 +7508,7 @@ var Q = {
|
|
|
7588
7508
|
n.setMinWidth(t);
|
|
7589
7509
|
break;
|
|
7590
7510
|
case "overflow":
|
|
7591
|
-
n.setOverflow(t ?
|
|
7511
|
+
n.setOverflow(t ? Wi[t] ?? Wi.visible : Wi.visible);
|
|
7592
7512
|
break;
|
|
7593
7513
|
case "paddingTop":
|
|
7594
7514
|
n.setPadding(Q.top, t);
|
|
@@ -7618,10 +7538,10 @@ var Q = {
|
|
|
7618
7538
|
n.setPosition(Q.right, t);
|
|
7619
7539
|
break;
|
|
7620
7540
|
case "position":
|
|
7621
|
-
n.setPositionType(t ?
|
|
7541
|
+
n.setPositionType(t ? Gi[t] ?? Gi.relative : Gi.relative);
|
|
7622
7542
|
break;
|
|
7623
7543
|
case "boxSizing":
|
|
7624
|
-
n.setBoxSizing(t ?
|
|
7544
|
+
n.setBoxSizing(t ? Ki[t] ?? Ki["content-box"] : Ki["content-box"]);
|
|
7625
7545
|
break;
|
|
7626
7546
|
case "width":
|
|
7627
7547
|
n.setWidth(t);
|
|
@@ -7632,7 +7552,7 @@ var Q = {
|
|
|
7632
7552
|
}
|
|
7633
7553
|
update() {
|
|
7634
7554
|
let e = this._parent, t = this.node;
|
|
7635
|
-
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0,
|
|
7555
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Bi.ltr), t.hasNewLayout())) {
|
|
7636
7556
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
|
|
7637
7557
|
(!Number.isNaN(n) && n !== e.position.x || !Number.isNaN(r) && r !== e.position.y) && e.position.set(n, r), (!Number.isNaN(i) && i !== e.size.x || !Number.isNaN(a) && a !== e.size.y) && e.size.set(i, a), t.markLayoutSeen();
|
|
7638
7558
|
}
|
|
@@ -7640,13 +7560,13 @@ var Q = {
|
|
|
7640
7560
|
destroy() {
|
|
7641
7561
|
this.node?.free(), this.node = void 0;
|
|
7642
7562
|
}
|
|
7643
|
-
},
|
|
7563
|
+
}, Ji = new Set(Object.keys(a())), Yi = new Set(Object.keys(s())), Xi = new b(), Zi = [
|
|
7644
7564
|
[0, 0],
|
|
7645
7565
|
[1, 0],
|
|
7646
7566
|
[1, 1],
|
|
7647
7567
|
[0, 1]
|
|
7648
|
-
],
|
|
7649
|
-
flexbox = new
|
|
7568
|
+
], Qi = class extends Er {
|
|
7569
|
+
flexbox = new qi(this);
|
|
7650
7570
|
aabb = new bt();
|
|
7651
7571
|
globalAabb = new bt();
|
|
7652
7572
|
_parentGlobalDisplay;
|
|
@@ -7654,12 +7574,12 @@ var Q = {
|
|
|
7654
7574
|
get globalDisplay() {
|
|
7655
7575
|
return this._globalDisplay;
|
|
7656
7576
|
}
|
|
7657
|
-
size = new
|
|
7577
|
+
size = new b(0, 0, () => {
|
|
7658
7578
|
this.onUpdateStyleProperty("transformOrigin", this.style.transformOrigin, void 0), this.onUpdateStyleProperty("transform", this.style.transform, void 0), this.updateGlobalTransform(), this.requestDraw();
|
|
7659
7579
|
});
|
|
7660
7580
|
_allowPointerEvents = !0;
|
|
7661
7581
|
_overflowHidden = !1;
|
|
7662
|
-
_style = new
|
|
7582
|
+
_style = new Mi().on("updateProperty", (...e) => {
|
|
7663
7583
|
this.onUpdateStyleProperty(e[0], e[1], e[2]);
|
|
7664
7584
|
});
|
|
7665
7585
|
get style() {
|
|
@@ -7680,7 +7600,7 @@ var Q = {
|
|
|
7680
7600
|
set background(e) {
|
|
7681
7601
|
this._background.resetProperties().setProperties(e);
|
|
7682
7602
|
}
|
|
7683
|
-
_shape = new
|
|
7603
|
+
_shape = new ji(this);
|
|
7684
7604
|
get shape() {
|
|
7685
7605
|
return this._shape;
|
|
7686
7606
|
}
|
|
@@ -7694,14 +7614,14 @@ var Q = {
|
|
|
7694
7614
|
set fill(e) {
|
|
7695
7615
|
this._fill.resetProperties().setProperties(e);
|
|
7696
7616
|
}
|
|
7697
|
-
_outline = new
|
|
7617
|
+
_outline = new ki(this);
|
|
7698
7618
|
get outline() {
|
|
7699
7619
|
return this._outline;
|
|
7700
7620
|
}
|
|
7701
7621
|
set outline(e) {
|
|
7702
7622
|
this._outline.resetProperties().setProperties(e);
|
|
7703
7623
|
}
|
|
7704
|
-
_foreground = new
|
|
7624
|
+
_foreground = new Di(this);
|
|
7705
7625
|
get foreground() {
|
|
7706
7626
|
return this._foreground;
|
|
7707
7627
|
}
|
|
@@ -7715,7 +7635,7 @@ var Q = {
|
|
|
7715
7635
|
set text(e) {
|
|
7716
7636
|
this._text.resetProperties().setProperties(e);
|
|
7717
7637
|
}
|
|
7718
|
-
_shadow = new
|
|
7638
|
+
_shadow = new Ai(this);
|
|
7719
7639
|
get shadow() {
|
|
7720
7640
|
return this._shadow;
|
|
7721
7641
|
}
|
|
@@ -7729,7 +7649,7 @@ var Q = {
|
|
|
7729
7649
|
set connection(e) {
|
|
7730
7650
|
this._connection.resetProperties().setProperties(e);
|
|
7731
7651
|
}
|
|
7732
|
-
_table = new
|
|
7652
|
+
_table = new Ii(this);
|
|
7733
7653
|
get table() {
|
|
7734
7654
|
return this._table;
|
|
7735
7655
|
}
|
|
@@ -7893,7 +7813,7 @@ var Q = {
|
|
|
7893
7813
|
this.requestDraw();
|
|
7894
7814
|
break;
|
|
7895
7815
|
}
|
|
7896
|
-
if ((
|
|
7816
|
+
if ((Yi.has(e) || Ji.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
|
|
7897
7817
|
else switch (e) {
|
|
7898
7818
|
case "left":
|
|
7899
7819
|
this.position.x = Number(t);
|
|
@@ -7923,7 +7843,7 @@ var Q = {
|
|
|
7923
7843
|
this._lastRoutePath = e;
|
|
7924
7844
|
let t = e.getBoundingBox(), n = Math.max(t.width, 1), r = Math.max(t.height, 1);
|
|
7925
7845
|
this.position.x = t.x, this.position.y = t.y, this.size.width = n, this.size.height = r, this.updateGlobalTransform();
|
|
7926
|
-
let i = e.clone().applyTransform(new
|
|
7846
|
+
let i = e.clone().applyTransform(new y().translate(-t.x, -t.y));
|
|
7927
7847
|
this._shape.setLocalPath(i);
|
|
7928
7848
|
}
|
|
7929
7849
|
_renderCulled = !1;
|
|
@@ -7937,10 +7857,10 @@ var Q = {
|
|
|
7937
7857
|
}
|
|
7938
7858
|
_intersectsViewport(e) {
|
|
7939
7859
|
let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
7940
|
-
for (let [e, c] of
|
|
7860
|
+
for (let [e, c] of Zi) t.applyAffineInverse({
|
|
7941
7861
|
x: e * n,
|
|
7942
7862
|
y: c * r
|
|
7943
|
-
},
|
|
7863
|
+
}, Xi), i = Math.min(i, Xi.x), a = Math.max(a, Xi.x), o = Math.min(o, Xi.y), s = Math.max(s, Xi.y);
|
|
7944
7864
|
let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
|
|
7945
7865
|
return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
|
|
7946
7866
|
}
|
|
@@ -8051,10 +7971,10 @@ var Q = {
|
|
|
8051
7971
|
super._destroy(), this.flexbox.destroy(), this.aabb.destroy(), this.globalAabb.destroy(), this.size.destroy(), this.style.destroy(), this.background.destroy(), this.shape.destroy(), this.fill.destroy(), this.outline.destroy(), this.text.destroy(), this.foreground.destroy(), this.shadow.destroy(), this.connection.destroy(), this.comments.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
|
|
8052
7972
|
}
|
|
8053
7973
|
};
|
|
8054
|
-
|
|
7974
|
+
Qi = A([x("Element2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Qi);
|
|
8055
7975
|
//#endregion
|
|
8056
7976
|
//#region src/scene/2d/TextureRect2D.ts
|
|
8057
|
-
var
|
|
7977
|
+
var $i = class extends Qi {
|
|
8058
7978
|
texture;
|
|
8059
7979
|
region;
|
|
8060
7980
|
constructor(e, t = []) {
|
|
@@ -8064,9 +7984,9 @@ var aa = class extends ia {
|
|
|
8064
7984
|
let e = this.region;
|
|
8065
7985
|
if (e && this.texture) {
|
|
8066
7986
|
let t = this.texture.width || 1, n = this.texture.height || 1;
|
|
8067
|
-
return new
|
|
7987
|
+
return new y(e.width / (this.size.x * t), 0, 0, e.height / (this.size.y * n), e.x / t, e.y / n);
|
|
8068
7988
|
}
|
|
8069
|
-
return new
|
|
7989
|
+
return new y().scale(1 / this.size.x, 1 / this.size.y);
|
|
8070
7990
|
}
|
|
8071
7991
|
_drawContent() {
|
|
8072
7992
|
if (this.texture?.isValid()) {
|
|
@@ -8077,7 +7997,7 @@ var aa = class extends ia {
|
|
|
8077
7997
|
} });
|
|
8078
7998
|
}
|
|
8079
7999
|
}
|
|
8080
|
-
},
|
|
8000
|
+
}, ea = class extends $i {
|
|
8081
8001
|
texture = new nr();
|
|
8082
8002
|
animation;
|
|
8083
8003
|
_lastTime = NaN;
|
|
@@ -8108,10 +8028,10 @@ var aa = class extends ia {
|
|
|
8108
8028
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
8109
8029
|
}
|
|
8110
8030
|
};
|
|
8111
|
-
A([_({ fallback: "" }), k("design:type", String)],
|
|
8031
|
+
A([_({ fallback: "" }), k("design:type", String)], ea.prototype, "src", void 0), ea = A([x("Lottie2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ea);
|
|
8112
8032
|
//#endregion
|
|
8113
8033
|
//#region src/scene/2d/Mesh2D.ts
|
|
8114
|
-
var
|
|
8034
|
+
var ta = class extends Qi {
|
|
8115
8035
|
texture;
|
|
8116
8036
|
_vertices = /* @__PURE__ */ new Float32Array();
|
|
8117
8037
|
_uvs = /* @__PURE__ */ new Float32Array();
|
|
@@ -8142,7 +8062,7 @@ var sa = class extends ia {
|
|
|
8142
8062
|
_drawContent() {
|
|
8143
8063
|
this.texture?.isValid() && this._indices.length && this._vertices.length && (this.context.fillStyle = this.texture, this.context.drawMesh(this._vertices, this._uvs, this._indices));
|
|
8144
8064
|
}
|
|
8145
|
-
},
|
|
8065
|
+
}, na = class extends Qi {
|
|
8146
8066
|
constructor(e, t = []) {
|
|
8147
8067
|
super(), this.setProperties(e).append(t);
|
|
8148
8068
|
}
|
|
@@ -8165,10 +8085,10 @@ var sa = class extends ia {
|
|
|
8165
8085
|
this.context.rect(0, 0, e, t), this.context.strokeStyle = "#00FF00", this.context.stroke(), this._drawCircle(0, 0), this._drawCircle(e, t), this._drawCircle(0, t), this._drawEllipse(0, t / 2), this._drawCircle(e, 0), this._drawEllipse(e, t / 2);
|
|
8166
8086
|
}
|
|
8167
8087
|
};
|
|
8168
|
-
A([_({ fallback: 6 }), k("design:type", Number)],
|
|
8088
|
+
A([_({ fallback: 6 }), k("design:type", Number)], na.prototype, "handleSize", void 0);
|
|
8169
8089
|
//#endregion
|
|
8170
8090
|
//#region src/scene/2d/Video2D.ts
|
|
8171
|
-
var
|
|
8091
|
+
var ra = class extends $i {
|
|
8172
8092
|
get videoDuration() {
|
|
8173
8093
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
8174
8094
|
}
|
|
@@ -8217,15 +8137,15 @@ var la = class extends aa {
|
|
|
8217
8137
|
super._process(e), this._updateVideoCurrentTime();
|
|
8218
8138
|
}
|
|
8219
8139
|
};
|
|
8220
|
-
A([_({ fallback: "" }), k("design:type", String)],
|
|
8140
|
+
A([_({ fallback: "" }), k("design:type", String)], ra.prototype, "src", void 0), ra = A([x("Video2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ra);
|
|
8221
8141
|
//#endregion
|
|
8222
8142
|
//#region src/scene/animation/Animation.ts
|
|
8223
|
-
function
|
|
8143
|
+
function ia(e) {
|
|
8224
8144
|
if (e == null) return 0;
|
|
8225
8145
|
let t = String(e).trim(), n = Number.parseFloat(t);
|
|
8226
8146
|
return Number.isNaN(n) ? 0 : n / 100;
|
|
8227
8147
|
}
|
|
8228
|
-
function
|
|
8148
|
+
function aa(e, t) {
|
|
8229
8149
|
let n = t * 180 / Math.PI;
|
|
8230
8150
|
if (e == null || e === "auto") return n;
|
|
8231
8151
|
let r = String(e).trim();
|
|
@@ -8234,11 +8154,11 @@ function da(e, t) {
|
|
|
8234
8154
|
let i = Number.parseFloat(r);
|
|
8235
8155
|
return Number.isNaN(i) ? n : i;
|
|
8236
8156
|
}
|
|
8237
|
-
function
|
|
8157
|
+
function oa(e) {
|
|
8238
8158
|
let t = e.trim(), n = /^path\((.*)\)$/s.exec(t);
|
|
8239
8159
|
return n && (t = n[1].trim()), t.length >= 2 && (t[0] === "\"" || t[0] === "'") && t[t.length - 1] === t[0] && (t = t.slice(1, -1)), t.trim();
|
|
8240
8160
|
}
|
|
8241
|
-
function
|
|
8161
|
+
function sa(e, t, n, r) {
|
|
8242
8162
|
let i = 1e-6, a = 3 * e - 3 * n + 1, o = 3 * n - 6 * e, s = 3 * e, c = 3 * t - 3 * r + 1, l = 3 * r - 6 * t, u = 3 * t, d = (e) => (3 * a * e + 2 * o) * e + s, f = (e) => ((a * e + o) * e + s) * e, p = (e) => ((c * e + l) * e + u) * e;
|
|
8243
8163
|
function m(e) {
|
|
8244
8164
|
let t = e, n, r;
|
|
@@ -8258,7 +8178,7 @@ function pa(e, t, n, r) {
|
|
|
8258
8178
|
}
|
|
8259
8179
|
return (e) => p(m(e));
|
|
8260
8180
|
}
|
|
8261
|
-
var
|
|
8181
|
+
var ca = {
|
|
8262
8182
|
linear: [
|
|
8263
8183
|
0,
|
|
8264
8184
|
0,
|
|
@@ -8325,7 +8245,7 @@ var ma = {
|
|
|
8325
8245
|
.355,
|
|
8326
8246
|
1
|
|
8327
8247
|
]
|
|
8328
|
-
},
|
|
8248
|
+
}, la = Object.fromEntries(Object.entries(ca).map(([e, [t, n, r, i]]) => [e, sa(t, n, r, i)])), ua = class extends H {
|
|
8329
8249
|
_keyframes = [];
|
|
8330
8250
|
_isFirstUpdatePosition = !1;
|
|
8331
8251
|
_cachedProps = new t();
|
|
@@ -8361,7 +8281,7 @@ var ma = {
|
|
|
8361
8281
|
e = [this.getParent()].filter(Boolean);
|
|
8362
8282
|
break;
|
|
8363
8283
|
}
|
|
8364
|
-
return e.filter((e) => e instanceof
|
|
8284
|
+
return e.filter((e) => e instanceof Qi);
|
|
8365
8285
|
}
|
|
8366
8286
|
_updateKeyframes() {
|
|
8367
8287
|
this._pathMeasures.clear();
|
|
@@ -8412,14 +8332,14 @@ var ma = {
|
|
|
8412
8332
|
});
|
|
8413
8333
|
}
|
|
8414
8334
|
_parseEasing(e) {
|
|
8415
|
-
if (!e) return
|
|
8416
|
-
if (e in
|
|
8335
|
+
if (!e) return la.linear;
|
|
8336
|
+
if (e in la) return la[e];
|
|
8417
8337
|
let t = /cubic-bezier\((.+)\)/.exec(e);
|
|
8418
8338
|
if (t) {
|
|
8419
8339
|
let e = t[1].split(",").map((e) => Number(e));
|
|
8420
|
-
if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return
|
|
8340
|
+
if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return sa(e[0], e[1], e[2], e[3]);
|
|
8421
8341
|
}
|
|
8422
|
-
return
|
|
8342
|
+
return la.linear;
|
|
8423
8343
|
}
|
|
8424
8344
|
_parseKeyframes(e, t) {
|
|
8425
8345
|
let n, r = this._keyframes;
|
|
@@ -8454,26 +8374,26 @@ var ma = {
|
|
|
8454
8374
|
});
|
|
8455
8375
|
}
|
|
8456
8376
|
_commitOffsetPath(e, t, n, r, i, a) {
|
|
8457
|
-
let o =
|
|
8377
|
+
let o = oa(t);
|
|
8458
8378
|
if (!o) return;
|
|
8459
8379
|
let s = this._pathMeasures.get(o);
|
|
8460
8380
|
if (!s) {
|
|
8461
|
-
let e = new
|
|
8381
|
+
let e = new v(new ue(o)), t = e.getPosTanAtProgress(0).position;
|
|
8462
8382
|
s = {
|
|
8463
8383
|
measure: e,
|
|
8464
8384
|
startX: t.x,
|
|
8465
8385
|
startY: t.y
|
|
8466
8386
|
}, this._pathMeasures.set(o, s);
|
|
8467
8387
|
}
|
|
8468
|
-
let c = D(O(
|
|
8388
|
+
let c = D(O(ia(r.offsetDistance ?? i.offsetDistance), ia(i.offsetDistance ?? r.offsetDistance), a), 0, 1), { position: l, angle: u } = s.measure.getPosTanAtProgress(c), d = l.x - s.startX, f = l.y - s.startY, p = aa(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
|
|
8469
8389
|
e.onUpdateStyleProperty("transform", `${m ? `${m} ` : ""}translate(${d}px, ${f}px) rotate(${p}deg)`, void 0);
|
|
8470
8390
|
}
|
|
8471
8391
|
_getDiffValue(e, t, n, r, i) {
|
|
8472
8392
|
let a, o;
|
|
8473
|
-
if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a =
|
|
8474
|
-
else if (n !== void 0) o =
|
|
8393
|
+
if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a = Ae(e, String(t), i), o = ke(a);
|
|
8394
|
+
else if (n !== void 0) o = Ae(e, String(n), i), a = ke(o);
|
|
8475
8395
|
else return;
|
|
8476
|
-
else a =
|
|
8396
|
+
else a = Ae(e, String(t), i), o = Ae(e, String(n), i);
|
|
8477
8397
|
if (Array.isArray(a) && Array.isArray(o)) {
|
|
8478
8398
|
let e = /* @__PURE__ */ new Set(), t = {}, n = {};
|
|
8479
8399
|
a.forEach(({ name: n, args: r }) => {
|
|
@@ -8512,14 +8432,14 @@ var ma = {
|
|
|
8512
8432
|
});
|
|
8513
8433
|
}
|
|
8514
8434
|
};
|
|
8515
|
-
A([_({ fallback: "parent" }), k("design:type", Object)],
|
|
8435
|
+
A([_({ fallback: "parent" }), k("design:type", Object)], ua.prototype, "effectMode", void 0), A([_({ default: () => [] }), k("design:type", Array)], ua.prototype, "keyframes", void 0), A([_(), k("design:type", Object)], ua.prototype, "easing", void 0), ua = A([x("Animation", {
|
|
8516
8436
|
renderMode: "disabled",
|
|
8517
8437
|
processSortMode: "parent-before",
|
|
8518
8438
|
duration: 2e3
|
|
8519
|
-
}), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])],
|
|
8439
|
+
}), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ua);
|
|
8520
8440
|
//#endregion
|
|
8521
8441
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
8522
|
-
var
|
|
8442
|
+
var da = class t extends e {
|
|
8523
8443
|
static _instance;
|
|
8524
8444
|
static get instance() {
|
|
8525
8445
|
return this._instance ||= new t(), this._instance;
|
|
@@ -8549,7 +8469,7 @@ var _a = class t extends e {
|
|
|
8549
8469
|
togglePause() {
|
|
8550
8470
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
8551
8471
|
}
|
|
8552
|
-
},
|
|
8472
|
+
}, fa = class t extends e {
|
|
8553
8473
|
static PADDING = .1;
|
|
8554
8474
|
_source = null;
|
|
8555
8475
|
_audio = null;
|
|
@@ -8662,21 +8582,21 @@ var _a = class t extends e {
|
|
|
8662
8582
|
if (!this._source) return;
|
|
8663
8583
|
let { start: n = 0, end: r = 0 } = e;
|
|
8664
8584
|
r && console.assert(r > n, "End time is before start time"), e.playbackRate !== void 0 && (this._playbackRate = e.playbackRate), e.volume !== void 0 && (this._volume = e.volume), e.loop !== void 0 && (this._loop = e.loop), e.muted !== void 0 && (this._muted = e.muted), this.refresh(), this.loop && r !== null && (console.warn("Looping not support when specifying an \"end\" time"), this.loop = !1), this._start = n, this._end = r || this._duration, this._start = Math.max(0, this._start - t.PADDING), this._end = Math.min(this._end + t.PADDING, this._duration), this._source.onloadedmetadata = () => {
|
|
8665
|
-
this._source && (this._source.currentTime = n, this._source.onloadedmetadata = null, this.emit("progress", n, this._duration),
|
|
8585
|
+
this._source && (this._source.currentTime = n, this._source.onloadedmetadata = null, this.emit("progress", n, this._duration), S.on(this._onUpdate));
|
|
8666
8586
|
}, this._source.onended = this._onComplete.bind(this), this._source.play(), this.emit("start");
|
|
8667
8587
|
}
|
|
8668
8588
|
_onUpdate = () => {
|
|
8669
8589
|
this._source && (this.emit("progress", this.progress, this._duration), this._source.currentTime >= this._end && !this._source.loop && this._onComplete());
|
|
8670
8590
|
};
|
|
8671
8591
|
_onComplete() {
|
|
8672
|
-
|
|
8592
|
+
S.off(this._onUpdate), this._stop(), this.emit("progress", 1, this._duration), this.emit("end", this);
|
|
8673
8593
|
}
|
|
8674
8594
|
destroy() {
|
|
8675
|
-
|
|
8595
|
+
S.off(this._onUpdate), super.destroy();
|
|
8676
8596
|
let e = this._source;
|
|
8677
8597
|
e && (e.onended = null, e.onplay = null, e.onpause = null, this._stop()), this._source = null, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._end = 0, this._start = 0, this._duration = 0, this._playing = !1, this._pausedReal = !1, this._paused = !1, this._muted = !1, this._audio &&= (this._audio.context.off("refresh", this.refresh), this._audio.context.off("refreshPaused", this.refreshPaused), null);
|
|
8678
8598
|
}
|
|
8679
|
-
},
|
|
8599
|
+
}, pa = class {
|
|
8680
8600
|
parent;
|
|
8681
8601
|
source = new globalThis.Audio();
|
|
8682
8602
|
_src = "";
|
|
@@ -8693,7 +8613,7 @@ var _a = class t extends e {
|
|
|
8693
8613
|
return !!this.source && this.source.readyState === 4;
|
|
8694
8614
|
}
|
|
8695
8615
|
get context() {
|
|
8696
|
-
return
|
|
8616
|
+
return da.instance;
|
|
8697
8617
|
}
|
|
8698
8618
|
constructor(e) {
|
|
8699
8619
|
this.parent = e;
|
|
@@ -8704,9 +8624,9 @@ var _a = class t extends e {
|
|
|
8704
8624
|
});
|
|
8705
8625
|
}
|
|
8706
8626
|
createSound() {
|
|
8707
|
-
return new
|
|
8627
|
+
return new fa();
|
|
8708
8628
|
}
|
|
8709
|
-
},
|
|
8629
|
+
}, ma = class extends e {
|
|
8710
8630
|
_input;
|
|
8711
8631
|
_output;
|
|
8712
8632
|
_processers = [];
|
|
@@ -8728,7 +8648,7 @@ var _a = class t extends e {
|
|
|
8728
8648
|
get destination() {
|
|
8729
8649
|
return this._input;
|
|
8730
8650
|
}
|
|
8731
|
-
},
|
|
8651
|
+
}, ha = class {
|
|
8732
8652
|
destination;
|
|
8733
8653
|
source;
|
|
8734
8654
|
constructor(e, t = null) {
|
|
@@ -8743,21 +8663,21 @@ var _a = class t extends e {
|
|
|
8743
8663
|
};
|
|
8744
8664
|
//#endregion
|
|
8745
8665
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
8746
|
-
function
|
|
8747
|
-
if (
|
|
8748
|
-
if (
|
|
8666
|
+
function ga() {
|
|
8667
|
+
if (Ue) return new AudioContext();
|
|
8668
|
+
if (We) {
|
|
8749
8669
|
let e = globalThis.webkitAudioContext;
|
|
8750
8670
|
return new e();
|
|
8751
8671
|
} else throw Error("Failed to createAudioContext");
|
|
8752
8672
|
}
|
|
8753
|
-
function
|
|
8754
|
-
if (
|
|
8755
|
-
if (
|
|
8673
|
+
function _a(e, t, n) {
|
|
8674
|
+
if (Ge) return new OfflineAudioContext(e, t, n);
|
|
8675
|
+
if (Ke) {
|
|
8756
8676
|
let r = globalThis.webkitOfflineAudioContext;
|
|
8757
8677
|
return new r(e, t, n);
|
|
8758
8678
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
8759
8679
|
}
|
|
8760
|
-
var
|
|
8680
|
+
var va = class e extends ma {
|
|
8761
8681
|
static _instance;
|
|
8762
8682
|
static get instance() {
|
|
8763
8683
|
return this._instance ||= new e(), this._instance;
|
|
@@ -8798,8 +8718,8 @@ var wa = class e extends ba {
|
|
|
8798
8718
|
_compressor;
|
|
8799
8719
|
_analyser;
|
|
8800
8720
|
constructor() {
|
|
8801
|
-
let e =
|
|
8802
|
-
r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (
|
|
8721
|
+
let e = ga(), t = _a(1, 2, Ge ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
8722
|
+
r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (Be || Ve), Je && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
|
|
8803
8723
|
}
|
|
8804
8724
|
_onFocus() {
|
|
8805
8725
|
if (!this.autoPause) return;
|
|
@@ -8839,7 +8759,7 @@ var wa = class e extends ba {
|
|
|
8839
8759
|
setParamValue(e, t) {
|
|
8840
8760
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
8841
8761
|
}
|
|
8842
|
-
},
|
|
8762
|
+
}, ya = class extends e {
|
|
8843
8763
|
_audio = null;
|
|
8844
8764
|
_sourceNode = null;
|
|
8845
8765
|
_gain = null;
|
|
@@ -8967,12 +8887,12 @@ var wa = class e extends ba {
|
|
|
8967
8887
|
};
|
|
8968
8888
|
_updateListener = () => this._update();
|
|
8969
8889
|
_enableTicker(e) {
|
|
8970
|
-
|
|
8890
|
+
S.off(this._updateListener), e && S.on(this._updateListener);
|
|
8971
8891
|
}
|
|
8972
8892
|
destroy() {
|
|
8973
8893
|
super.destroy(), this._stop(), this._gain?.disconnect(), this._gain = null, this._audio?.context.off("refresh", this.refresh), this._audio?.context.off("refreshPaused", this.refreshPaused), this._audio = null, this._processors.forEach((e) => e.disconnect()), this._processors.length = 0, this._end = 0, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._elapsed = 0, this._duration = 0, this._paused = !1, this._muted = !1, this._pausedReal = !1;
|
|
8974
8894
|
}
|
|
8975
|
-
},
|
|
8895
|
+
}, ba = class extends ma {
|
|
8976
8896
|
parent;
|
|
8977
8897
|
_sourceBuffer;
|
|
8978
8898
|
_sourceNode;
|
|
@@ -8980,7 +8900,7 @@ var wa = class e extends ba {
|
|
|
8980
8900
|
gain;
|
|
8981
8901
|
analyser;
|
|
8982
8902
|
get context() {
|
|
8983
|
-
return
|
|
8903
|
+
return va.instance;
|
|
8984
8904
|
}
|
|
8985
8905
|
get isPlayable() {
|
|
8986
8906
|
return !!this._sourceNode.buffer;
|
|
@@ -8995,8 +8915,8 @@ var wa = class e extends ba {
|
|
|
8995
8915
|
this._sourceNode.buffer = e;
|
|
8996
8916
|
}
|
|
8997
8917
|
constructor(e) {
|
|
8998
|
-
let t =
|
|
8999
|
-
n.connect(i), i.connect(r), r.connect(
|
|
8918
|
+
let t = va.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
8919
|
+
n.connect(i), i.connect(r), r.connect(va.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
|
|
9000
8920
|
}
|
|
9001
8921
|
async load() {
|
|
9002
8922
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -9009,7 +8929,7 @@ var wa = class e extends ba {
|
|
|
9009
8929
|
});
|
|
9010
8930
|
}
|
|
9011
8931
|
_decode(e) {
|
|
9012
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
8932
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : va.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
9013
8933
|
}
|
|
9014
8934
|
cloneSource() {
|
|
9015
8935
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -9019,15 +8939,15 @@ var wa = class e extends ba {
|
|
|
9019
8939
|
};
|
|
9020
8940
|
}
|
|
9021
8941
|
createSound() {
|
|
9022
|
-
return new
|
|
8942
|
+
return new ya();
|
|
9023
8943
|
}
|
|
9024
|
-
},
|
|
8944
|
+
}, xa, Sa = class extends H {
|
|
9025
8945
|
static {
|
|
9026
|
-
|
|
8946
|
+
xa = this;
|
|
9027
8947
|
}
|
|
9028
8948
|
static _soundPool = [];
|
|
9029
8949
|
_sounds = [];
|
|
9030
|
-
_platformAudio =
|
|
8950
|
+
_platformAudio = qe ? new ba(this) : new pa(this);
|
|
9031
8951
|
get platformAudio() {
|
|
9032
8952
|
return this._platformAudio;
|
|
9033
8953
|
}
|
|
@@ -9120,7 +9040,7 @@ var wa = class e extends ba {
|
|
|
9120
9040
|
this._sounds.length = 0;
|
|
9121
9041
|
}
|
|
9122
9042
|
_createSound() {
|
|
9123
|
-
return
|
|
9043
|
+
return xa._soundPool.length > 0 ? xa._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
9124
9044
|
}
|
|
9125
9045
|
refresh() {
|
|
9126
9046
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -9136,7 +9056,7 @@ var wa = class e extends ba {
|
|
|
9136
9056
|
this._recycleSound(e);
|
|
9137
9057
|
};
|
|
9138
9058
|
_recycleSound(e) {
|
|
9139
|
-
e.destroy(),
|
|
9059
|
+
e.destroy(), xa._soundPool.includes(e) || xa._soundPool.push(e);
|
|
9140
9060
|
}
|
|
9141
9061
|
_prevTime = 0;
|
|
9142
9062
|
_timer = 0;
|
|
@@ -9152,13 +9072,13 @@ var wa = class e extends ba {
|
|
|
9152
9072
|
}, 100);
|
|
9153
9073
|
}
|
|
9154
9074
|
};
|
|
9155
|
-
|
|
9075
|
+
Sa = xa = A([x("Audio"), k("design:paramtypes", [Object])], Sa);
|
|
9156
9076
|
//#endregion
|
|
9157
9077
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
9158
|
-
var
|
|
9078
|
+
var Ca = class extends Er {}, wa = class extends Qi {
|
|
9159
9079
|
_audioBuffer;
|
|
9160
9080
|
_src = (() => {
|
|
9161
|
-
let e =
|
|
9081
|
+
let e = C();
|
|
9162
9082
|
return e ? new B({ source: e }) : void 0;
|
|
9163
9083
|
})();
|
|
9164
9084
|
_needsUpdateTexture = !1;
|
|
@@ -9179,7 +9099,7 @@ var ka = class extends Er {}, Aa = class extends ia {
|
|
|
9179
9099
|
}
|
|
9180
9100
|
}
|
|
9181
9101
|
async _loadSrc(e) {
|
|
9182
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
9102
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => va.decode(e)).then((e) => {
|
|
9183
9103
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
9184
9104
|
});
|
|
9185
9105
|
}
|
|
@@ -9214,12 +9134,12 @@ var ka = class extends Er {}, Aa = class extends ia {
|
|
|
9214
9134
|
this.syncTexture(), super._process(e);
|
|
9215
9135
|
}
|
|
9216
9136
|
};
|
|
9217
|
-
A([_(), k("design:type", Object)],
|
|
9137
|
+
A([_(), k("design:type", Object)], wa.prototype, "src", void 0), A([_({ fallback: 0 }), k("design:type", Number)], wa.prototype, "gap", void 0), A([_({ fallback: "#000000" }), k("design:type", String)], wa.prototype, "color", void 0), wa = A([x("AudioWaveform"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], wa);
|
|
9218
9138
|
//#endregion
|
|
9219
9139
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
9220
|
-
var
|
|
9140
|
+
var Ta, Ea = class extends Tr {
|
|
9221
9141
|
static {
|
|
9222
|
-
|
|
9142
|
+
Ta = this;
|
|
9223
9143
|
}
|
|
9224
9144
|
blur = 10;
|
|
9225
9145
|
quality = 10;
|
|
@@ -9238,7 +9158,7 @@ var ja, Ma = class extends Tr {
|
|
|
9238
9158
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
9239
9159
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
9240
9160
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
9241
|
-
R.draw(e,
|
|
9161
|
+
R.draw(e, Ta.material, {
|
|
9242
9162
|
sampler: r,
|
|
9243
9163
|
progress: i,
|
|
9244
9164
|
...t
|
|
@@ -9246,31 +9166,31 @@ var ja, Ma = class extends Tr {
|
|
|
9246
9166
|
});
|
|
9247
9167
|
}
|
|
9248
9168
|
};
|
|
9249
|
-
|
|
9169
|
+
Ea = Ta = A([x("KawaseTransition")], Ea);
|
|
9250
9170
|
//#endregion
|
|
9251
9171
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
9252
|
-
var
|
|
9172
|
+
var Da, Oa = class extends Tr {
|
|
9253
9173
|
static {
|
|
9254
|
-
|
|
9174
|
+
Da = this;
|
|
9255
9175
|
}
|
|
9256
9176
|
static material = new L({ gl: {
|
|
9257
9177
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
9258
9178
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform float progress;\nuniform sampler2D previous;\nuniform sampler2D next;\n\nfloat easeInOutQuint(float t) {\n return t < 0.5 ? 16.0*t*t*t*t*t : 1.0+16.0*(--t)*t*t*t*t;\n}\n\nvoid main() {\n vec4 src1Color = texture2D(previous, vUv);\n vec4 src2Color = texture2D(next, vUv);\n float mProgress = 1.0 - progress;\n float mixPercent = 0.0;\n if (vUv.x <= mProgress) {\n mixPercent = 1.0;\n }\n gl_FragColor = mix(src2Color, src1Color, mixPercent);\n}"
|
|
9259
9179
|
} });
|
|
9260
9180
|
apply(e) {
|
|
9261
|
-
R.draw(e,
|
|
9181
|
+
R.draw(e, Da.material, {
|
|
9262
9182
|
previous: 0,
|
|
9263
9183
|
next: 1,
|
|
9264
9184
|
progress: this.currentTimeProgress
|
|
9265
9185
|
});
|
|
9266
9186
|
}
|
|
9267
9187
|
};
|
|
9268
|
-
|
|
9188
|
+
Oa = Da = A([x("LeftEraseTransition")], Oa);
|
|
9269
9189
|
//#endregion
|
|
9270
9190
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
9271
|
-
var
|
|
9191
|
+
var ka, Aa = class extends Tr {
|
|
9272
9192
|
static {
|
|
9273
|
-
|
|
9193
|
+
ka = this;
|
|
9274
9194
|
}
|
|
9275
9195
|
blur = 100;
|
|
9276
9196
|
gradientBlur = 600;
|
|
@@ -9282,7 +9202,7 @@ var Fa, Ia = class extends Tr {
|
|
|
9282
9202
|
let n = this.currentTimeProgress, r, i;
|
|
9283
9203
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9284
9204
|
let a = t.width, o = t.height, s = [0, o / 2], c = [600, o / 2], l = [a, o], u = c[0] - s[0], d = c[1] - s[1], f = Math.sqrt(u * u + d * d);
|
|
9285
|
-
R.draw(e,
|
|
9205
|
+
R.draw(e, ka.material, {
|
|
9286
9206
|
sampler: r,
|
|
9287
9207
|
progress: i,
|
|
9288
9208
|
blur: this.blur,
|
|
@@ -9291,7 +9211,7 @@ var Fa, Ia = class extends Tr {
|
|
|
9291
9211
|
end: c,
|
|
9292
9212
|
delta: [u / f, d / f],
|
|
9293
9213
|
texSize: l
|
|
9294
|
-
}), R.draw(e,
|
|
9214
|
+
}), R.draw(e, ka.material, {
|
|
9295
9215
|
sampler: r,
|
|
9296
9216
|
progress: i,
|
|
9297
9217
|
blur: this.blur,
|
|
@@ -9303,12 +9223,12 @@ var Fa, Ia = class extends Tr {
|
|
|
9303
9223
|
});
|
|
9304
9224
|
}
|
|
9305
9225
|
};
|
|
9306
|
-
|
|
9226
|
+
Aa = ka = A([x("TiltShiftTransition")], Aa);
|
|
9307
9227
|
//#endregion
|
|
9308
9228
|
//#region src/scene/transitions/TwistTransition.ts
|
|
9309
|
-
var
|
|
9229
|
+
var ja, Ma = class extends Tr {
|
|
9310
9230
|
static {
|
|
9311
|
-
|
|
9231
|
+
ja = this;
|
|
9312
9232
|
}
|
|
9313
9233
|
radius;
|
|
9314
9234
|
angle = 4;
|
|
@@ -9322,7 +9242,7 @@ var La, Ra = class extends Tr {
|
|
|
9322
9242
|
let n = this.currentTimeProgress, r, i;
|
|
9323
9243
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9324
9244
|
let a = t.width, o = t.height;
|
|
9325
|
-
R.draw(e,
|
|
9245
|
+
R.draw(e, ja.material, {
|
|
9326
9246
|
sampler: r,
|
|
9327
9247
|
progress: i,
|
|
9328
9248
|
filterArea: [
|
|
@@ -9338,10 +9258,10 @@ var La, Ra = class extends Tr {
|
|
|
9338
9258
|
});
|
|
9339
9259
|
}
|
|
9340
9260
|
};
|
|
9341
|
-
|
|
9261
|
+
Ma = ja = A([x("TwistTransition")], Ma);
|
|
9342
9262
|
//#endregion
|
|
9343
9263
|
//#region src/asset/loaders/GifLoader.ts
|
|
9344
|
-
var
|
|
9264
|
+
var Na = class extends Un {
|
|
9345
9265
|
install(e) {
|
|
9346
9266
|
let t = async (t) => {
|
|
9347
9267
|
let { decodeFrames: n } = await import("modern-gif");
|
|
@@ -9358,14 +9278,14 @@ var za = class extends Un {
|
|
|
9358
9278
|
e.register(n, t);
|
|
9359
9279
|
}), e.gif = this, this;
|
|
9360
9280
|
}
|
|
9361
|
-
},
|
|
9281
|
+
}, Pa = class extends Un {
|
|
9362
9282
|
install(e) {
|
|
9363
9283
|
let t = async (e) => JSON.parse(await e.text());
|
|
9364
9284
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
9365
9285
|
e.register(n, t);
|
|
9366
9286
|
}), e.json = this, this;
|
|
9367
9287
|
}
|
|
9368
|
-
},
|
|
9288
|
+
}, Fa = class extends Un {
|
|
9369
9289
|
install(e) {
|
|
9370
9290
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
9371
9291
|
container: null,
|
|
@@ -9376,12 +9296,12 @@ var za = class extends Un {
|
|
|
9376
9296
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
9377
9297
|
}), e.lottie = this, this;
|
|
9378
9298
|
}
|
|
9379
|
-
},
|
|
9299
|
+
}, Ia = class extends Un {
|
|
9380
9300
|
install(e) {
|
|
9381
9301
|
let t = async (e) => e.text();
|
|
9382
9302
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
9383
9303
|
}
|
|
9384
|
-
},
|
|
9304
|
+
}, La = class extends Un {
|
|
9385
9305
|
install(e) {
|
|
9386
9306
|
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new B({
|
|
9387
9307
|
source: e,
|
|
@@ -9405,11 +9325,11 @@ var za = class extends Un {
|
|
|
9405
9325
|
e.register(n, t);
|
|
9406
9326
|
}), e.texture = this, this;
|
|
9407
9327
|
}
|
|
9408
|
-
},
|
|
9328
|
+
}, Ra = class extends Un {
|
|
9409
9329
|
install(e) {
|
|
9410
9330
|
return this.load = (t) => e.awaitBy(() => new sr(t).load()), e.video = this, this;
|
|
9411
9331
|
}
|
|
9412
|
-
},
|
|
9332
|
+
}, za = Object.entries({
|
|
9413
9333
|
"font/woff": ["woff"],
|
|
9414
9334
|
"font/ttf": ["ttf"],
|
|
9415
9335
|
"font/otf": ["otf"],
|
|
@@ -9425,31 +9345,31 @@ var za = class extends Un {
|
|
|
9425
9345
|
"image/webp": ["webp"],
|
|
9426
9346
|
"application/json": ["json"]
|
|
9427
9347
|
});
|
|
9428
|
-
function
|
|
9429
|
-
for (let [t, n] of
|
|
9348
|
+
function Ba(e) {
|
|
9349
|
+
for (let [t, n] of za) if (n.includes(e)) return t;
|
|
9430
9350
|
}
|
|
9431
|
-
function
|
|
9351
|
+
function Va(e) {
|
|
9432
9352
|
let t;
|
|
9433
9353
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
9434
9354
|
else if (e.startsWith("http")) {
|
|
9435
9355
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
9436
|
-
n && (t =
|
|
9356
|
+
n && (t = Ba(n));
|
|
9437
9357
|
}
|
|
9438
9358
|
return t;
|
|
9439
9359
|
}
|
|
9440
9360
|
//#endregion
|
|
9441
9361
|
//#region src/asset/Assets.ts
|
|
9442
|
-
var
|
|
9362
|
+
var Ha = "WeakRef" in globalThis, Ua = class extends e {
|
|
9443
9363
|
defaultHandler = (e) => e;
|
|
9444
9364
|
_handlers = /* @__PURE__ */ new Map();
|
|
9445
9365
|
_handleing = /* @__PURE__ */ new Map();
|
|
9446
9366
|
_handled = /* @__PURE__ */ new Map();
|
|
9447
|
-
_gc =
|
|
9367
|
+
_gc = Ha ? new FinalizationRegistry((e) => {
|
|
9448
9368
|
let t = this.get(e);
|
|
9449
9369
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
9450
9370
|
}) : void 0;
|
|
9451
9371
|
constructor() {
|
|
9452
|
-
super(),
|
|
9372
|
+
super(), Ha || S.on(this.gc.bind(this), { sort: 2 });
|
|
9453
9373
|
}
|
|
9454
9374
|
use(e) {
|
|
9455
9375
|
return e.install(this), this;
|
|
@@ -9489,7 +9409,7 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9489
9409
|
}).then((e) => {
|
|
9490
9410
|
if (e.complete && e.naturalWidth && e.naturalHeight) return createImageBitmap(e, t);
|
|
9491
9411
|
{
|
|
9492
|
-
let e =
|
|
9412
|
+
let e = C(1, 1);
|
|
9493
9413
|
if (!e) throw Error("createImageBitmap fallback requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
9494
9414
|
return createImageBitmap(e);
|
|
9495
9415
|
}
|
|
@@ -9498,11 +9418,11 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9498
9418
|
}
|
|
9499
9419
|
get(e) {
|
|
9500
9420
|
let t = this._handled.get(e);
|
|
9501
|
-
return
|
|
9421
|
+
return Ha && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
9502
9422
|
}
|
|
9503
9423
|
set(e, t) {
|
|
9504
9424
|
let n = t;
|
|
9505
|
-
|
|
9425
|
+
Ha && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
|
|
9506
9426
|
}
|
|
9507
9427
|
async awaitBy(e) {
|
|
9508
9428
|
let t = e(), n = c();
|
|
@@ -9517,7 +9437,7 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9517
9437
|
return this._handleing.set(e, r), r;
|
|
9518
9438
|
}
|
|
9519
9439
|
async load(e, t) {
|
|
9520
|
-
let n = await this.loadBy(e), r =
|
|
9440
|
+
let n = await this.loadBy(e), r = Va(e);
|
|
9521
9441
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
9522
9442
|
}
|
|
9523
9443
|
async waitUntilLoad() {
|
|
@@ -9531,14 +9451,14 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9531
9451
|
n && "destroy" in n && n.destroy();
|
|
9532
9452
|
}), this._handled.clear();
|
|
9533
9453
|
}
|
|
9534
|
-
}, $ = new
|
|
9454
|
+
}, $ = new Ua().use(new Wn()).use(new Na()).use(new Pa()).use(new Fa()).use(new Ia()).use(new La()).use(new Ra()), Wa = {
|
|
9535
9455
|
alpha: !0,
|
|
9536
9456
|
stencil: !0,
|
|
9537
9457
|
antialias: !1,
|
|
9538
9458
|
premultipliedAlpha: !0,
|
|
9539
9459
|
preserveDrawingBuffer: !1,
|
|
9540
9460
|
powerPreference: "default"
|
|
9541
|
-
},
|
|
9461
|
+
}, Ga = class extends wr {
|
|
9542
9462
|
renderer;
|
|
9543
9463
|
get view() {
|
|
9544
9464
|
return this.renderer.view;
|
|
@@ -9561,7 +9481,7 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9561
9481
|
set pixelRatio(e) {
|
|
9562
9482
|
this.renderer.pixelRatio = e, this.resize(this.width, this.height);
|
|
9563
9483
|
}
|
|
9564
|
-
_resizeObserver =
|
|
9484
|
+
_resizeObserver = Ie ? new ResizeObserver((e) => {
|
|
9565
9485
|
let t = e[0];
|
|
9566
9486
|
if (t.target === this.view) {
|
|
9567
9487
|
let { inlineSize: e, blockSize: n } = Array.isArray(t.contentBoxSize) ? t.contentBoxSize[0] : t.contentBoxSize;
|
|
@@ -9569,14 +9489,14 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9569
9489
|
}
|
|
9570
9490
|
}) : void 0;
|
|
9571
9491
|
constructor(e = {}) {
|
|
9572
|
-
let { view: t, width: n, height: r, pixelRatio: i =
|
|
9492
|
+
let { view: t, width: n, height: r, pixelRatio: i = Xe, autoResize: a, data: o } = e;
|
|
9573
9493
|
super(), this.renderer = new Hn(t, {
|
|
9574
|
-
alpha:
|
|
9575
|
-
stencil:
|
|
9576
|
-
antialias:
|
|
9577
|
-
premultipliedAlpha:
|
|
9578
|
-
preserveDrawingBuffer:
|
|
9579
|
-
powerPreference:
|
|
9494
|
+
alpha: Wa.alpha ?? e.alpha,
|
|
9495
|
+
stencil: Wa.stencil ?? e.stencil,
|
|
9496
|
+
antialias: Wa.antialias ?? e.antialias,
|
|
9497
|
+
premultipliedAlpha: Wa.premultipliedAlpha ?? e.premultipliedAlpha,
|
|
9498
|
+
preserveDrawingBuffer: Wa.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
|
|
9499
|
+
powerPreference: Wa.powerPreference ?? e.powerPreference
|
|
9580
9500
|
}), this._setupInput(), this.pixelRatio = i, a ? !t && this.renderer.view && (this.renderer.view.style.width = "100%", this.renderer.view.style.height = "100%") : this.resize(n || this.gl.drawingBufferWidth || this.view?.clientWidth || 200, r || this.gl.drawingBufferHeight || this.view?.clientHeight || 200, !t), this.setProperties(e), o && this.root.append(o);
|
|
9581
9501
|
}
|
|
9582
9502
|
_updateProperty(e, t, n) {
|
|
@@ -9609,7 +9529,7 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9609
9529
|
return this._exportWidth = 0, this._exportHeight = 0, this.renderer.resize(e, t, n), this.root.width = e, this.root.height = t, this.render(), this;
|
|
9610
9530
|
}
|
|
9611
9531
|
nextTick() {
|
|
9612
|
-
return
|
|
9532
|
+
return xe();
|
|
9613
9533
|
}
|
|
9614
9534
|
async waitUntilLoad() {
|
|
9615
9535
|
await $.waitUntilLoad(), await this.nextTick();
|
|
@@ -9667,7 +9587,7 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9667
9587
|
}
|
|
9668
9588
|
toPixels() {
|
|
9669
9589
|
if (!this.needsChunkReadPixels()) return this.render(), this.renderer.toPixels();
|
|
9670
|
-
let e = this.pixelRatio || 1, t = this.exportWidth, n = this.exportHeight, r = this._exportTileLimit(), i =
|
|
9590
|
+
let e = this.pixelRatio || 1, t = this.exportWidth, n = this.exportHeight, r = this._exportTileLimit(), i = Te(t, n, r), a = Math.floor(t * e), o = Math.floor(n * e), s = a * 4, c = new Uint8ClampedArray(a * o * 4), l = this.root.canvasTransform.clone(), u = Math.min(t, r), d = Math.min(n, r);
|
|
9671
9591
|
this._resizeSilently(u, d);
|
|
9672
9592
|
for (let t of i) {
|
|
9673
9593
|
this.root.canvasTransform.copyFrom(l.clone().translate(-t.x, -t.y)), this.render();
|
|
@@ -9684,9 +9604,9 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9684
9604
|
return new ImageData(this.toPixels(), this.exportWidth, this.exportHeight);
|
|
9685
9605
|
}
|
|
9686
9606
|
toCanvas2D(e = this.toImageData()) {
|
|
9687
|
-
let t =
|
|
9607
|
+
let t = C(e.width, e.height), n = t?.getContext("2d");
|
|
9688
9608
|
t && n && (n.fillStyle = "rgba(0, 0, 0, 0)", n.clearRect(0, 0, t.width, t.height), n.putImageData(e, 0, 0));
|
|
9689
|
-
let r =
|
|
9609
|
+
let r = C(e.width, e.height);
|
|
9690
9610
|
if (!r) throw Error("toCanvas2D requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
9691
9611
|
let i = r.getContext("2d");
|
|
9692
9612
|
return i && t && (i.fillStyle = "rgba(0, 0, 0, 0)", i.clearRect(0, 0, r.width, r.height), i.drawImage(t, 0, 0, t.width, t.height, 0, 0, r.width, r.height)), r;
|
|
@@ -9695,22 +9615,22 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9695
9615
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
9696
9616
|
}
|
|
9697
9617
|
};
|
|
9698
|
-
A([_({ fallback: !1 }), k("design:type", Boolean)],
|
|
9618
|
+
A([_({ fallback: !1 }), k("design:type", Boolean)], Ga.prototype, "autoResize", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Ga.prototype, "autoStart", void 0);
|
|
9699
9619
|
//#endregion
|
|
9700
9620
|
//#region src/render.ts
|
|
9701
|
-
var
|
|
9702
|
-
function
|
|
9703
|
-
return
|
|
9621
|
+
var Ka, qa = [], Ja = !1;
|
|
9622
|
+
function Ya() {
|
|
9623
|
+
return Ka ??= new Ga({
|
|
9704
9624
|
pixelRatio: 1,
|
|
9705
9625
|
width: 1,
|
|
9706
9626
|
height: 1,
|
|
9707
9627
|
preserveDrawingBuffer: !0
|
|
9708
9628
|
});
|
|
9709
9629
|
}
|
|
9710
|
-
async function
|
|
9711
|
-
if (!
|
|
9712
|
-
for (
|
|
9713
|
-
let t =
|
|
9630
|
+
async function Xa(e = 100) {
|
|
9631
|
+
if (!Ja) {
|
|
9632
|
+
for (Ja = !0; qa.length;) {
|
|
9633
|
+
let t = qa.shift();
|
|
9714
9634
|
if (t) try {
|
|
9715
9635
|
await t();
|
|
9716
9636
|
} catch (e) {
|
|
@@ -9718,49 +9638,49 @@ async function no(e = 100) {
|
|
|
9718
9638
|
}
|
|
9719
9639
|
else await new Promise((t) => setTimeout(t, e));
|
|
9720
9640
|
}
|
|
9721
|
-
|
|
9641
|
+
Ja = !1;
|
|
9722
9642
|
}
|
|
9723
9643
|
}
|
|
9724
|
-
async function
|
|
9725
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [],
|
|
9726
|
-
if (
|
|
9644
|
+
async function Za(e) {
|
|
9645
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], imagePipelineResolver: s, onBefore: c, onKeyframe: l, ...u } = e, d = Math.max(1, Math.floor(r)), f = Math.max(1, Math.floor(i)), p = Ya();
|
|
9646
|
+
if (p.resetProperties(), p.setProperties(u), p.debug = t, p.fonts = n, p.timeline.currentTime = 0, p.resizeForExport(d, f), p.imagePipelineResolver = s, p.root.removeChildren(!0), p.root.append(a), await c?.(p), await p.waitUntilProcessed(), o.length) {
|
|
9727
9647
|
let e = o.length, t = o[e - 1];
|
|
9728
9648
|
for (let n = 0; n < e; n++) {
|
|
9729
9649
|
let e = o[n], r = (o[n + 1] || e) - e;
|
|
9730
|
-
|
|
9650
|
+
p.timeline.currentTime = e, await p.waitUntilProcessed(), await l?.(p.toPixels(), {
|
|
9731
9651
|
currentTime: e,
|
|
9732
9652
|
duration: r,
|
|
9733
9653
|
progress: t === 0 ? 1 : e / t
|
|
9734
9654
|
});
|
|
9735
9655
|
}
|
|
9736
9656
|
}
|
|
9737
|
-
let
|
|
9657
|
+
let m = p.toPixels();
|
|
9738
9658
|
return {
|
|
9739
|
-
pixels:
|
|
9740
|
-
toCanvas2D: () =>
|
|
9659
|
+
pixels: m,
|
|
9660
|
+
toCanvas2D: () => p.toCanvas2D(new ImageData(m, d, f))
|
|
9741
9661
|
};
|
|
9742
9662
|
}
|
|
9743
|
-
async function
|
|
9663
|
+
async function Qa(e) {
|
|
9744
9664
|
return new Promise((t, n) => {
|
|
9745
|
-
|
|
9665
|
+
qa.push(async () => {
|
|
9746
9666
|
try {
|
|
9747
|
-
t(await
|
|
9667
|
+
t(await Za(e).then((e) => e.toCanvas2D()));
|
|
9748
9668
|
} catch (e) {
|
|
9749
9669
|
n(e);
|
|
9750
9670
|
}
|
|
9751
|
-
}),
|
|
9671
|
+
}), Xa();
|
|
9752
9672
|
});
|
|
9753
9673
|
}
|
|
9754
|
-
async function
|
|
9674
|
+
async function $a(e) {
|
|
9755
9675
|
return new Promise((t, n) => {
|
|
9756
|
-
|
|
9676
|
+
qa.push(async () => {
|
|
9757
9677
|
try {
|
|
9758
|
-
t(await
|
|
9678
|
+
t(await Za(e).then((e) => e.pixels));
|
|
9759
9679
|
} catch (e) {
|
|
9760
9680
|
n(e);
|
|
9761
9681
|
}
|
|
9762
|
-
}),
|
|
9682
|
+
}), Xa();
|
|
9763
9683
|
});
|
|
9764
9684
|
}
|
|
9765
9685
|
//#endregion
|
|
9766
|
-
export { bt as Aabb2D, tr as AnimatedTexture,
|
|
9686
|
+
export { bt as Aabb2D, tr as AnimatedTexture, ua as Animation, Ua as Assets, Sa as Audio, ma as AudioPipeline, ha as AudioProcessor, Ca as AudioSpectrum, wa as AudioWaveform, j as BufferUsage, Dr as Camera2D, lr as CanvasContext, yr as CanvasItem, nr as CanvasTexture, E as Color, G as ColorAdjustEffect, Br as ColorFilterEffect, Ct as ColorMatrix, Ur as ColorOverlayEffect, Gr as ColorRemoveEffect, Jr as ColorReplaceEffect, rr as ColorTexture, w as CoreObject, xt as DEG_TO_RAD, Xe as DEVICE_PIXEL_RATIO, K as DrawboardEffect, ti as DropShadowEffect, W as Effect, Qn as EffectMaterial, Qi as Element2D, bi as Element2DBackground, X as Element2DChart, wi as Element2DComments, Ti as Element2DConnection, Y as Element2DFill, Di as Element2DForeground, ki as Element2DOutline, Ai as Element2DShadow, ji as Element2DShape, Mi as Element2DStyle, Ii as Element2DTable, Z as Element2DText, ri as EmbossEffect, Ga as Engine, qi as Flexbox, Wn as FontLoader, $r as GaussianBlurEffect, Kn as Geometry, Na as GifLoader, un as GlBatch2DSystem, on as GlBlendMode, Ot as GlBuffer, Ft as GlBufferSystem, Dt as GlBufferTarget, mn as GlMaskSystem, qt as GlProgram, vn as GlRenderTarget, yn as GlRenderTargetSystem, nn as GlShaderSystem, cn as GlState, ln as GlStateSystem, gn as GlStencilSystem, M as GlSystem, _n as GlViewportSystem, q as GlitchEffect, J as GodrayEffect, ir as GradientTexture, pa as HTMLAudio, da as HTMLAudioContext, fa as HTMLSound, Je as IN_BROWSER, Ye as IN_MAC_OS, Gn as IndexBuffer, vt as Input, ft as InputEvent, Pa as JsonLoader, li as KawaseBlurEffect, Ea as KawaseTransition, pt as KeyboardInputEvent, Oa as LeftEraseTransition, Un as Loader, ea as Lottie2D, Fa as LottieLoader, Et as MainLoop, di as MaskEffect, L as Material, ta as Mesh2D, dr as Meta, mt as MouseInputEvent, V as Node, Er as Node2D, wt as Obb2D, mi as OutlineEffect, Se as PI, Ce as PI_2, gi as PixelateEffect, ar as PixelsTexture, ht as PointerInputEvent, Tt as Projection2D, qn as QuadGeometry, R as QuadUvGeometry, St as RAD_TO_DEG, yt as RefCounted, z as RenderTarget, kt as Renderer, T as Resource, Ue as SUPPORTS_AUDIO_CONTEXT, Ve as SUPPORTS_CLICK_EVENTS, He as SUPPORTS_CREATE_IMAGE_BITMAP, Fe as SUPPORTS_IMAGE_BITMAP, ze as SUPPORTS_MOUSE_EVENTS, Ge as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Le as SUPPORTS_POINTER_EVENTS, Ie as SUPPORTS_RESIZE_OBSERVER, Be as SUPPORTS_TOUCH_EVENTS, Pe as SUPPORTS_WEBGL2, We as SUPPORTS_WEBKIT_AUDIO_CONTEXT, Ke as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, qe as SUPPORTS_WEB_AUDIO, Re as SUPPORTS_WHEEL_EVENTS, wr as SceneTree, Ia as TextLoader, B as Texture2D, La as TextureLoader, $i as TextureRect2D, S as Ticker, Aa as TiltShiftTransition, Sr as Timeline, H as TimelineNode, na as TransformRect2D, Tr as Transition, Ma as TwistTransition, jt as UniformGroup, er as UvGeometry, $n as UvMaterial, I as VertexAttribute, F as VertexBuffer, ra as Video2D, Ra as VideoLoader, sr as VideoTexture, U as Viewport, cr as ViewportTexture, ba as WebAudio, va as WebAudioContext, Hn as WebGLRenderer, ya as WebSound, gt as WheelInputEvent, Cr as Window, vi as ZoomBlurEffect, Ri as alignMap, $ as assets, Or as axisDir, Ki as boxSizingMap, D as clamp, ci as clampFrag, C as createHTMLCanvas, Pt as createIdFromString, be as createNode, lt as crossOrigin, ca as cssEasingPresets, sa as cubicBezier, x as customNode, ye as customNodes, Wa as defaultOptions, ct as determineCrossOrigin, Bi as directionMap, zi as displayMap, Q as edgeMap, Vi as flexDirectionMap, Hi as flexWrapMap, si as frag, it as getCanvasFactory, ke as getDefaultCssPropertyValue, st as getGlContextProvider, Ya as getRenderEngine, Li as gutterMap, dt as instanceId, et as isCanvasElement, Ze as isElementNode, $e as isImageElement, we as isPow2, Qe as isVideoElement, tt as isWebgl2, Ui as justifyMap, O as lerp, fn as log2, sn as mapGlBlendModes, dn as nextPow2, xe as nextTick, Wi as overflowMap, Ir as parseCssFilter, je as parseCssFunctions, Ae as parseCssProperty, Lr as parseCssTransformOrigin, Te as planExportTiles, Gi as positionTypeMap, Qa as render, $a as renderPixels, _r as resetBatchPool, kr as routeConnection, rt as setCanvasFactory, ot as setGlContextProvider, hn as stencilModeMap };
|