modern-canvas 0.23.8 → 0.23.10
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 +598 -549
- package/dist/scene/animation/Animation.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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, normalizeConnection as m, normalizeFill as h, normalizeForeground as g, normalizeOutline as ee, normalizeShadow as te, normalizeShape as ne, normalizeTable as re, normalizeText as ie, normalizeTextContent as ae, parseColor as oe, property as _, stringifyFilter as se } from "modern-idoc";
|
|
2
|
-
import { BoundingBox as ce, Path2D as le, Path2DSet as ue, Transform2D as v, Vector2 as y, svgToDom as
|
|
3
|
-
import { extend as
|
|
4
|
-
import
|
|
5
|
-
import { fonts as
|
|
6
|
-
import { Character as
|
|
2
|
+
import { BoundingBox as ce, Path2D as le, Path2DSet as ue, PathMeasure as de, Transform2D as v, Vector2 as y, 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
|
|
8
|
+
var ye = /* @__PURE__ */ new Map();
|
|
9
9
|
function b(e, t) {
|
|
10
10
|
return function(n) {
|
|
11
11
|
Object.defineProperty(n.prototype, "is", {
|
|
@@ -14,13 +14,13 @@ function b(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
|
}
|
|
@@ -86,7 +86,7 @@ var x = class {
|
|
|
86
86
|
x.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
|
x.on(() => {
|
|
92
92
|
e?.(), t();
|
|
@@ -98,14 +98,14 @@ 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
105
|
//#endregion
|
|
106
106
|
//#region src/core/shared/css.ts
|
|
107
|
-
var
|
|
108
|
-
function
|
|
107
|
+
var Te = /([\w-]+)\((.+?)\)/g, Ee = /[^,]+/g, De = /([-e.\d]+)(.*)/;
|
|
108
|
+
function Oe(e) {
|
|
109
109
|
return Array.isArray(e) ? e.map((e) => ({
|
|
110
110
|
name: e.name,
|
|
111
111
|
args: e.args.map((e) => ({
|
|
@@ -117,31 +117,31 @@ function De(e) {
|
|
|
117
117
|
normalizedIntValue: e.normalizedDefaultIntValue
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
let r =
|
|
122
|
-
return r.length ? r :
|
|
120
|
+
function ke(e, t, n = {}) {
|
|
121
|
+
let r = Ae(t, n);
|
|
122
|
+
return r.length ? r : Me(e, t, n);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Ae(e, t = {}) {
|
|
125
125
|
let n = [], r;
|
|
126
|
-
for (; (r =
|
|
126
|
+
for (; (r = Te.exec(e)) !== null;) {
|
|
127
127
|
let [, e, i] = r;
|
|
128
128
|
e && n.push({
|
|
129
129
|
name: e,
|
|
130
|
-
args:
|
|
130
|
+
args: je(e, i, t)
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
return n;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function je(e, t, n = {}) {
|
|
136
136
|
let r = [], i, a = 0;
|
|
137
|
-
for (; (i =
|
|
137
|
+
for (; (i = Ee.exec(t)) !== null;) r.push(Me(e, i[0], {
|
|
138
138
|
...n,
|
|
139
139
|
index: a++
|
|
140
140
|
}));
|
|
141
141
|
return r;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(
|
|
143
|
+
function Me(e, t, n = {}) {
|
|
144
|
+
let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(De), s = {
|
|
145
145
|
unit: o?.[2] ?? null,
|
|
146
146
|
value: t,
|
|
147
147
|
intValue: Number(o?.[1]),
|
|
@@ -161,7 +161,7 @@ function je(e, t, n = {}) {
|
|
|
161
161
|
s.normalizedIntValue = s.intValue / 100;
|
|
162
162
|
break;
|
|
163
163
|
case "rad":
|
|
164
|
-
s.normalizedIntValue = s.intValue /
|
|
164
|
+
s.normalizedIntValue = s.intValue / Ce;
|
|
165
165
|
break;
|
|
166
166
|
case "deg":
|
|
167
167
|
s.normalizedIntValue = s.intValue / 360;
|
|
@@ -184,48 +184,48 @@ function je(e, t, n = {}) {
|
|
|
184
184
|
}
|
|
185
185
|
//#endregion
|
|
186
186
|
//#region src/core/shared/dom.ts
|
|
187
|
-
var
|
|
188
|
-
function
|
|
187
|
+
var Ne = "WebGL2RenderingContext" in globalThis, Pe = "ImageBitmap" in globalThis, Fe = "ResizeObserver" in globalThis, Ie = "PointerEvent" in globalThis, Le = "WheelEvent" in globalThis, Re = "MouseEvent" in globalThis, ze = "ontouchstart" in globalThis, Be = "onclick" in globalThis, Ve = "createImageBitmap" in globalThis, He = "AudioContext" in globalThis, Ue = "webkitAudioContext" in globalThis, We = "OfflineAudioContext" in globalThis, Ge = "webkitOfflineAudioContext" in globalThis, Ke = He || Ue, qe = typeof window < "u", Je = typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, Ye = globalThis.devicePixelRatio || 1, Xe = (e) => typeof e == "object" && !!e && e.nodeType === 1, Ze = (e) => Xe(e) && e.tagName === "VIDEO", Qe = (e) => Xe(e) && e.tagName === "IMG";
|
|
188
|
+
function $e(e) {
|
|
189
189
|
return typeof e == "object" && !!e && e.nodeType === 1 && e.tagName === "CANVAS";
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
return
|
|
191
|
+
function et(e) {
|
|
192
|
+
return Ne && e instanceof globalThis.WebGL2RenderingContext;
|
|
193
193
|
}
|
|
194
|
-
var
|
|
195
|
-
function
|
|
196
|
-
|
|
194
|
+
var tt;
|
|
195
|
+
function nt(e) {
|
|
196
|
+
tt = e;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
return
|
|
198
|
+
function rt() {
|
|
199
|
+
return tt;
|
|
200
200
|
}
|
|
201
|
-
var
|
|
202
|
-
function
|
|
203
|
-
|
|
201
|
+
var it;
|
|
202
|
+
function at(e) {
|
|
203
|
+
it = e;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
205
|
+
function ot() {
|
|
206
|
+
return it;
|
|
207
207
|
}
|
|
208
208
|
function S(e, t) {
|
|
209
209
|
let n;
|
|
210
|
-
return
|
|
210
|
+
return tt ? n = tt(e, t) : qe && (n = globalThis.document.createElement("canvas")), n && (e !== void 0 && (n.width = e), t !== void 0 && (n.height = t)), n;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function st(e, t = globalThis.location) {
|
|
213
213
|
if (e.startsWith("data:") || !t || typeof document > "u") return "";
|
|
214
214
|
let n = new URL(e, document.baseURI);
|
|
215
215
|
return n.hostname !== t.hostname || n.port !== t.port || n.protocol !== t.protocol ? "anonymous" : "";
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
n === null && !t.startsWith("data:") ? e.crossOrigin =
|
|
217
|
+
function ct(e, t, n) {
|
|
218
|
+
n === null && !t.startsWith("data:") ? e.crossOrigin = st(t) : n !== !1 && (e.crossOrigin = typeof n == "string" ? n : "anonymous");
|
|
219
219
|
}
|
|
220
220
|
//#endregion
|
|
221
221
|
//#region src/core/shared/id.ts
|
|
222
|
-
var
|
|
223
|
-
function
|
|
224
|
-
return ++
|
|
222
|
+
var lt = 0;
|
|
223
|
+
function ut() {
|
|
224
|
+
return ++lt;
|
|
225
225
|
}
|
|
226
226
|
//#endregion
|
|
227
227
|
//#region src/core/input/InputEvent.ts
|
|
228
|
-
var
|
|
228
|
+
var dt = class e {
|
|
229
229
|
cursor;
|
|
230
230
|
bubbles = !1;
|
|
231
231
|
cancelBubble = !1;
|
|
@@ -260,14 +260,14 @@ var ut = class e {
|
|
|
260
260
|
initUIEvent(...e) {
|
|
261
261
|
throw Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
262
262
|
}
|
|
263
|
-
},
|
|
263
|
+
}, ft = class extends dt {
|
|
264
264
|
getModifierState(...e) {
|
|
265
265
|
throw Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
266
266
|
}
|
|
267
267
|
initKeyboardEvent(...e) {
|
|
268
268
|
throw Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
269
269
|
}
|
|
270
|
-
},
|
|
270
|
+
}, pt = class extends dt {
|
|
271
271
|
client = {
|
|
272
272
|
x: 0,
|
|
273
273
|
y: 0
|
|
@@ -350,7 +350,7 @@ var ut = class e {
|
|
|
350
350
|
get globalY() {
|
|
351
351
|
return this.global.y;
|
|
352
352
|
}
|
|
353
|
-
},
|
|
353
|
+
}, mt = class extends pt {
|
|
354
354
|
width = 0;
|
|
355
355
|
height = 0;
|
|
356
356
|
isPrimary = !1;
|
|
@@ -360,20 +360,20 @@ var ut = class e {
|
|
|
360
360
|
getPredictedEvents() {
|
|
361
361
|
throw Error("getPredictedEvents is not supported!");
|
|
362
362
|
}
|
|
363
|
-
},
|
|
363
|
+
}, ht = class extends pt {
|
|
364
364
|
static DOM_DELTA_PIXEL = 0;
|
|
365
365
|
DOM_DELTA_PIXEL = 0;
|
|
366
366
|
static DOM_DELTA_LINE = 1;
|
|
367
367
|
DOM_DELTA_LINE = 1;
|
|
368
368
|
static DOM_DELTA_PAGE = 2;
|
|
369
369
|
DOM_DELTA_PAGE = 2;
|
|
370
|
-
},
|
|
370
|
+
}, gt = {
|
|
371
371
|
touchstart: "pointerdown",
|
|
372
372
|
touchend: "pointerup",
|
|
373
373
|
touchendoutside: "pointerupoutside",
|
|
374
374
|
touchmove: "pointermove",
|
|
375
375
|
touchcancel: "pointercancel"
|
|
376
|
-
},
|
|
376
|
+
}, _t = class extends e {
|
|
377
377
|
event;
|
|
378
378
|
target;
|
|
379
379
|
cursor = "default";
|
|
@@ -391,21 +391,21 @@ var ut = class e {
|
|
|
391
391
|
removeEventListeners() {
|
|
392
392
|
if (!this.setuped || !this.target) return;
|
|
393
393
|
let e = this.target.style;
|
|
394
|
-
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") :
|
|
394
|
+
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : Ie && (e.touchAction = ""), Ie ? (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)), ze && (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;
|
|
395
395
|
}
|
|
396
396
|
addEventListeners() {
|
|
397
397
|
if (this.setuped || !this.target) return;
|
|
398
398
|
let e = this.target.style;
|
|
399
|
-
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") :
|
|
399
|
+
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : Ie && (e.touchAction = "none")), Ie ? (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)), ze && (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;
|
|
400
400
|
}
|
|
401
401
|
normalize(e) {
|
|
402
402
|
let t = [];
|
|
403
|
-
if (
|
|
403
|
+
if (ze && e instanceof globalThis.TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
|
|
404
404
|
let r = e.changedTouches[n];
|
|
405
405
|
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);
|
|
406
406
|
}
|
|
407
|
-
else if (
|
|
408
|
-
else if (
|
|
407
|
+
else if (Le && e instanceof globalThis.WheelEvent) t.push(e);
|
|
408
|
+
else if (Ie && e instanceof globalThis.PointerEvent) t.push(e);
|
|
409
409
|
else {
|
|
410
410
|
let n = e;
|
|
411
411
|
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);
|
|
@@ -413,8 +413,8 @@ var ut = class e {
|
|
|
413
413
|
return t;
|
|
414
414
|
}
|
|
415
415
|
_clonePointerEvent(e) {
|
|
416
|
-
let t = new
|
|
417
|
-
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 =
|
|
416
|
+
let t = new mt();
|
|
417
|
+
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 = gt[t.type] || t.type), t;
|
|
418
418
|
}
|
|
419
419
|
_copyInputEvent(e, t) {
|
|
420
420
|
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;
|
|
@@ -423,11 +423,11 @@ var ut = class e {
|
|
|
423
423
|
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;
|
|
424
424
|
}
|
|
425
425
|
_cloneWheelEvent(e) {
|
|
426
|
-
let t = new
|
|
426
|
+
let t = new ht();
|
|
427
427
|
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;
|
|
428
428
|
}
|
|
429
429
|
_cloneKeyboardEvent(e) {
|
|
430
|
-
let t = new
|
|
430
|
+
let t = new ft();
|
|
431
431
|
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;
|
|
432
432
|
}
|
|
433
433
|
setCursor(e = "default") {
|
|
@@ -475,25 +475,25 @@ var ut = class e {
|
|
|
475
475
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
476
476
|
};
|
|
477
477
|
_onPointerDown = (e) => {
|
|
478
|
-
if (
|
|
478
|
+
if (ze && e.pointerType === "touch") return;
|
|
479
479
|
let t = this.normalize(e);
|
|
480
480
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerdown", this.event = this._clonePointerEvent(t[e]));
|
|
481
481
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
482
482
|
};
|
|
483
483
|
_onPointerOver = (e) => {
|
|
484
|
-
if (!this.enableClickEvent ||
|
|
484
|
+
if (!this.enableClickEvent || ze && e.pointerType === "touch") return;
|
|
485
485
|
let t = this.normalize(e);
|
|
486
486
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerover", this.event = this._clonePointerEvent(t[e]));
|
|
487
487
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
488
488
|
};
|
|
489
489
|
_onPointerMove = (e) => {
|
|
490
|
-
if (!this.enableMoveEvent ||
|
|
490
|
+
if (!this.enableMoveEvent || ze && e.pointerType === "touch") return;
|
|
491
491
|
let t = this.normalize(e);
|
|
492
492
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointermove", this.event = this._clonePointerEvent(t[e]));
|
|
493
493
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
494
494
|
};
|
|
495
495
|
_onPointerUp = (e) => {
|
|
496
|
-
if (!this.enableClickEvent ||
|
|
496
|
+
if (!this.enableClickEvent || ze && e.pointerType === "touch") return;
|
|
497
497
|
let t = e.target;
|
|
498
498
|
e.composedPath && e.composedPath().length > 0 && (t = e.composedPath()[0]);
|
|
499
499
|
let n = t === this.target ? "" : "outside", r = this.normalize(e);
|
|
@@ -513,7 +513,7 @@ var ut = class e {
|
|
|
513
513
|
this.removeEventListeners(), super.destroy();
|
|
514
514
|
}
|
|
515
515
|
}, C = class extends n {
|
|
516
|
-
instanceId =
|
|
516
|
+
instanceId = ut();
|
|
517
517
|
destroyed = !1;
|
|
518
518
|
get json() {
|
|
519
519
|
return this.toJSON();
|
|
@@ -522,7 +522,7 @@ var ut = class e {
|
|
|
522
522
|
this.setProperties(e);
|
|
523
523
|
}
|
|
524
524
|
_nextTick() {
|
|
525
|
-
return
|
|
525
|
+
return xe();
|
|
526
526
|
}
|
|
527
527
|
equal(e) {
|
|
528
528
|
return !!(e && this.instanceId === e.instanceId);
|
|
@@ -531,7 +531,7 @@ var ut = class e {
|
|
|
531
531
|
destroy() {
|
|
532
532
|
this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
|
|
533
533
|
}
|
|
534
|
-
},
|
|
534
|
+
}, vt = class extends C {}, w = class extends vt {}, yt = class e {
|
|
535
535
|
get x() {
|
|
536
536
|
return this.min.x;
|
|
537
537
|
}
|
|
@@ -664,7 +664,7 @@ var ut = class e {
|
|
|
664
664
|
};
|
|
665
665
|
//#endregion
|
|
666
666
|
//#region src/core/math/Color.ts
|
|
667
|
-
|
|
667
|
+
me([he]);
|
|
668
668
|
var T = class {
|
|
669
669
|
get value() {
|
|
670
670
|
return this._value;
|
|
@@ -748,11 +748,11 @@ var T = class {
|
|
|
748
748
|
this.a
|
|
749
749
|
];
|
|
750
750
|
}
|
|
751
|
-
},
|
|
752
|
-
function
|
|
751
|
+
}, bt = Se / 180, xt = 180 / Se;
|
|
752
|
+
function E(e, t, n) {
|
|
753
753
|
return Math.max(t, Math.min(e, n));
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function D(e, t, n) {
|
|
756
756
|
return (1 - n) * e + n * t;
|
|
757
757
|
}
|
|
758
758
|
//#endregion
|
|
@@ -887,7 +887,7 @@ var St = class {
|
|
|
887
887
|
]);
|
|
888
888
|
}
|
|
889
889
|
invert(e = 1) {
|
|
890
|
-
let t =
|
|
890
|
+
let t = D(1, -1, e), n = D(0, 255, e);
|
|
891
891
|
return this.multiply([
|
|
892
892
|
t,
|
|
893
893
|
0,
|
|
@@ -912,21 +912,21 @@ var St = class {
|
|
|
912
912
|
]);
|
|
913
913
|
}
|
|
914
914
|
sepia(e = 1) {
|
|
915
|
-
let t =
|
|
915
|
+
let t = E(e, 0, 1);
|
|
916
916
|
return this.multiply([
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
917
|
+
D(1, .393, t),
|
|
918
|
+
D(0, .7689999, t),
|
|
919
|
+
D(0, .18899999, t),
|
|
920
920
|
0,
|
|
921
921
|
0,
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
922
|
+
D(0, .349, t),
|
|
923
|
+
D(1, .6859999, t),
|
|
924
|
+
D(0, .16799999, t),
|
|
925
925
|
0,
|
|
926
926
|
0,
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
927
|
+
D(0, .272, t),
|
|
928
|
+
D(0, .5339999, t),
|
|
929
|
+
D(1, .13099999, t),
|
|
930
930
|
0,
|
|
931
931
|
0,
|
|
932
932
|
0,
|
|
@@ -961,7 +961,7 @@ var St = class {
|
|
|
961
961
|
]);
|
|
962
962
|
}
|
|
963
963
|
grayscale(e = 1) {
|
|
964
|
-
let t =
|
|
964
|
+
let t = E(e, 0, 1), n = D(1, .3, t), r = D(0, .3, t), i = D(1, .59, t), a = D(0, .59, t), o = D(1, .11, t), s = D(0, .11, t);
|
|
965
965
|
return this.multiply([
|
|
966
966
|
n,
|
|
967
967
|
a,
|
|
@@ -1013,10 +1013,10 @@ var St = class {
|
|
|
1013
1013
|
toArray() {
|
|
1014
1014
|
return this._array;
|
|
1015
1015
|
}
|
|
1016
|
-
}, Ct = class e extends
|
|
1016
|
+
}, Ct = class e extends yt {
|
|
1017
1017
|
rotation;
|
|
1018
1018
|
get rotationDegrees() {
|
|
1019
|
-
return this.rotation /
|
|
1019
|
+
return this.rotation / bt;
|
|
1020
1020
|
}
|
|
1021
1021
|
constructor(...e) {
|
|
1022
1022
|
let t, n;
|
|
@@ -1026,7 +1026,7 @@ var St = class {
|
|
|
1026
1026
|
if (!this.rotation && (!("rotation" in e) || !e.rotation)) return super.overlap(e, t);
|
|
1027
1027
|
{
|
|
1028
1028
|
let t = (e, t) => Math.abs(e.x * t.x + e.y * t.y), n = (e) => {
|
|
1029
|
-
let { width: n, height: r, rotation: i = 0 } = e, a = i /
|
|
1029
|
+
let { width: n, height: r, rotation: i = 0 } = e, a = i / bt;
|
|
1030
1030
|
a = -a % 180;
|
|
1031
1031
|
let o = a / 180 * Math.PI, s = {
|
|
1032
1032
|
x: Math.cos(o),
|
|
@@ -1092,12 +1092,12 @@ var St = class {
|
|
|
1092
1092
|
};
|
|
1093
1093
|
//#endregion
|
|
1094
1094
|
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateMetadata.js
|
|
1095
|
-
function
|
|
1095
|
+
function O(e, t) {
|
|
1096
1096
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
1097
1097
|
}
|
|
1098
1098
|
//#endregion
|
|
1099
1099
|
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
|
|
1100
|
-
function
|
|
1100
|
+
function k(e, t, n, r) {
|
|
1101
1101
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
1102
1102
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
1103
1103
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
@@ -1135,7 +1135,7 @@ var Tt = class extends C {
|
|
|
1135
1135
|
super._destroy(), this.stop();
|
|
1136
1136
|
}
|
|
1137
1137
|
};
|
|
1138
|
-
|
|
1138
|
+
k([_({ fallback: 60 }), O("design:type", Number)], Tt.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Tt.prototype, "speed", void 0);
|
|
1139
1139
|
//#endregion
|
|
1140
1140
|
//#region src/core/renderers/gl/buffer/const.ts
|
|
1141
1141
|
var Et = /* @__PURE__ */ function(e) {
|
|
@@ -1148,7 +1148,7 @@ var Et = /* @__PURE__ */ function(e) {
|
|
|
1148
1148
|
constructor(e) {
|
|
1149
1149
|
this.native = e;
|
|
1150
1150
|
}
|
|
1151
|
-
},
|
|
1151
|
+
}, A = /* @__PURE__ */ function(e) {
|
|
1152
1152
|
return e[e.mapRead = 1] = "mapRead", e[e.mapWrite = 2] = "mapWrite", e[e.copySrc = 4] = "copySrc", e[e.copyDst = 8] = "copyDst", e[e.index = 16] = "index", e[e.vertex = 32] = "vertex", e[e.uniform = 64] = "uniform", e[e.storage = 128] = "storage", e[e.indirect = 256] = "indirect", e[e.queryResolve = 512] = "queryResolve", e[e.static = 1024] = "static", e;
|
|
1153
1153
|
}({}), Ot = class extends n {
|
|
1154
1154
|
screen = {
|
|
@@ -1169,7 +1169,7 @@ var Et = /* @__PURE__ */ function(e) {
|
|
|
1169
1169
|
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`);
|
|
1170
1170
|
}
|
|
1171
1171
|
};
|
|
1172
|
-
|
|
1172
|
+
k([_({ fallback: Ye }), O("design:type", Number)], Ot.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], Ot.prototype, "view", void 0);
|
|
1173
1173
|
//#endregion
|
|
1174
1174
|
//#region src/core/renderers/shared/shader/UniformGroup.ts
|
|
1175
1175
|
var kt = 0, At = class {
|
|
@@ -1192,7 +1192,7 @@ function Nt(e, t) {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
//#endregion
|
|
1194
1194
|
//#region src/core/renderers/gl/system/GlSystem.ts
|
|
1195
|
-
var
|
|
1195
|
+
var j = class extends e {
|
|
1196
1196
|
get _gl() {
|
|
1197
1197
|
return this._renderer.gl;
|
|
1198
1198
|
}
|
|
@@ -1206,7 +1206,7 @@ var A = class extends e {
|
|
|
1206
1206
|
_setup() {}
|
|
1207
1207
|
flush() {}
|
|
1208
1208
|
reset() {}
|
|
1209
|
-
}, Pt = class extends
|
|
1209
|
+
}, Pt = class extends j {
|
|
1210
1210
|
install(e) {
|
|
1211
1211
|
super.install(e), e.buffer = this;
|
|
1212
1212
|
}
|
|
@@ -1217,7 +1217,7 @@ var A = class extends e {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
_createGlBuffer(e) {
|
|
1219
1219
|
let t = this._gl, n = new Dt(t.createBuffer()), r = Et.arrayBuffer;
|
|
1220
|
-
return e.usage &
|
|
1220
|
+
return e.usage & A.index ? r = Et.elementArrayBuffer : e.usage & A.uniform && (r = Et.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
|
|
1221
1221
|
switch (e) {
|
|
1222
1222
|
case "usage":
|
|
1223
1223
|
case "data":
|
|
@@ -1240,7 +1240,7 @@ var A = class extends e {
|
|
|
1240
1240
|
n.dirty = !1;
|
|
1241
1241
|
let { _gl: r } = this, { usage: i, data: a } = e;
|
|
1242
1242
|
r.bindBuffer(n.target, n.native);
|
|
1243
|
-
let o = i &
|
|
1243
|
+
let o = i & A.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
|
|
1244
1244
|
if (a) if (n.byteLength >= a.byteLength) {
|
|
1245
1245
|
let e = a.length * a.BYTES_PER_ELEMENT;
|
|
1246
1246
|
r.bufferSubData(n.target, 0, a, 0, e / a.BYTES_PER_ELEMENT);
|
|
@@ -1576,7 +1576,7 @@ function en(e, t) {
|
|
|
1576
1576
|
}
|
|
1577
1577
|
//#endregion
|
|
1578
1578
|
//#region src/core/renderers/gl/shader/GlShaderSystem.ts
|
|
1579
|
-
var tn = class extends
|
|
1579
|
+
var tn = class extends j {
|
|
1580
1580
|
install(e) {
|
|
1581
1581
|
super.install(e), e.shader = this;
|
|
1582
1582
|
}
|
|
@@ -1901,7 +1901,7 @@ var sn = class e {
|
|
|
1901
1901
|
}
|
|
1902
1902
|
};
|
|
1903
1903
|
sn._init();
|
|
1904
|
-
var cn = class extends
|
|
1904
|
+
var cn = class extends j {
|
|
1905
1905
|
install(e) {
|
|
1906
1906
|
super.install(e), e.state = this;
|
|
1907
1907
|
}
|
|
@@ -1958,7 +1958,7 @@ var cn = class extends A {
|
|
|
1958
1958
|
let e = (1 << sn._properties.length) - 1;
|
|
1959
1959
|
this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
|
|
1960
1960
|
}
|
|
1961
|
-
}, ln = class extends
|
|
1961
|
+
}, ln = class extends j {
|
|
1962
1962
|
install(e) {
|
|
1963
1963
|
super.install(e), e.batch2D = this;
|
|
1964
1964
|
}
|
|
@@ -1983,7 +1983,7 @@ var cn = class extends A {
|
|
|
1983
1983
|
}
|
|
1984
1984
|
_createShader(e) {
|
|
1985
1985
|
let t = this._renderer, n = {
|
|
1986
|
-
instanceId:
|
|
1986
|
+
instanceId: ut(),
|
|
1987
1987
|
glProgram: new Kt({
|
|
1988
1988
|
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}",
|
|
1989
1989
|
fragment: `precision highp float;
|
|
@@ -2013,15 +2013,15 @@ void main(void) {
|
|
|
2013
2013
|
}`
|
|
2014
2014
|
})
|
|
2015
2015
|
}, r = {
|
|
2016
|
-
instanceId:
|
|
2017
|
-
usage:
|
|
2016
|
+
instanceId: ut(),
|
|
2017
|
+
usage: A.vertex,
|
|
2018
2018
|
data: new Float32Array()
|
|
2019
2019
|
}, i = {
|
|
2020
|
-
instanceId:
|
|
2021
|
-
usage:
|
|
2020
|
+
instanceId: ut(),
|
|
2021
|
+
usage: A.index,
|
|
2022
2022
|
data: new Uint32Array()
|
|
2023
2023
|
}, a = {
|
|
2024
|
-
instanceId:
|
|
2024
|
+
instanceId: ut(),
|
|
2025
2025
|
topology: "triangle-list",
|
|
2026
2026
|
attributes: Object.fromEntries(Object.entries(this._attributes).map(([e, t]) => [e, {
|
|
2027
2027
|
...t,
|
|
@@ -2068,8 +2068,8 @@ void main(void) {
|
|
|
2068
2068
|
255
|
|
2069
2069
|
] } = n[e];
|
|
2070
2070
|
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);
|
|
2071
|
-
let { width: ae, height: oe } = g, _ = c / this._vertexSize, se = (ee ? f.get(ee) : 255) ?? 255, ce = +!!re, le = +!!ne, ue,
|
|
2072
|
-
for (let e = p.length, t = 0; t < e; t += 2) ue = h[t],
|
|
2071
|
+
let { width: ae, height: oe } = g, _ = c / this._vertexSize, se = (ee ? f.get(ee) : 255) ?? 255, ce = +!!re, le = +!!ne, ue, de, v;
|
|
2072
|
+
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] = se, 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++;
|
|
2073
2073
|
for (let e = r.length, t = 0; t < e; t++) s[l++] = _ + r[t];
|
|
2074
2074
|
t.blendMode = te;
|
|
2075
2075
|
}
|
|
@@ -2114,11 +2114,11 @@ function dn(e) {
|
|
|
2114
2114
|
}
|
|
2115
2115
|
//#endregion
|
|
2116
2116
|
//#region src/core/renderers/gl/const.ts
|
|
2117
|
-
var
|
|
2117
|
+
var M = /* @__PURE__ */ function(e) {
|
|
2118
2118
|
return e[e.disabled = 0] = "disabled", e[e.renderingMaskAdd = 1] = "renderingMaskAdd", e[e.maskActive = 2] = "maskActive", e[e.inverseMaskActive = 3] = "inverseMaskActive", e[e.renderingMaskRemove = 4] = "renderingMaskRemove", e[e.none = 5] = "none", e;
|
|
2119
2119
|
}({}), fn = /* @__PURE__ */ function(e) {
|
|
2120
2120
|
return e[e.none = 0] = "none", e[e.color = 16384] = "color", e[e.stencil = 1024] = "stencil", e[e.depth = 256] = "depth", e[e.colorDepth = 16640] = "colorDepth", e[e.colorStencil = 17408] = "colorStencil", e[e.depthStencil = 1280] = "depthStencil", e[e.all = 17664] = "all", e;
|
|
2121
|
-
}({}), pn = class extends
|
|
2121
|
+
}({}), pn = class extends j {
|
|
2122
2122
|
install(e) {
|
|
2123
2123
|
super.install(e), e.mask = this;
|
|
2124
2124
|
}
|
|
@@ -2137,16 +2137,16 @@ var j = /* @__PURE__ */ function(e) {
|
|
|
2137
2137
|
};
|
|
2138
2138
|
this.stack.push(n);
|
|
2139
2139
|
let r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2140
|
-
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(
|
|
2140
|
+
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(M.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2141
2141
|
}
|
|
2142
2142
|
pop(e) {
|
|
2143
2143
|
let t = this.stack.pop();
|
|
2144
2144
|
if (!t || t.source !== e) return;
|
|
2145
2145
|
let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2146
|
-
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(fn.stencil), this._renderer.stencil.bind(
|
|
2146
|
+
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(fn.stencil), this._renderer.stencil.bind(M.disabled, i)) : this._renderer.stencil.bind(M.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2147
2147
|
}
|
|
2148
2148
|
}, mn = [];
|
|
2149
|
-
mn[
|
|
2149
|
+
mn[M.none] = {}, mn[M.disabled] = {}, mn[M.renderingMaskAdd] = {
|
|
2150
2150
|
stencilFront: {
|
|
2151
2151
|
compare: "equal",
|
|
2152
2152
|
passOp: "increment-clamp"
|
|
@@ -2155,7 +2155,7 @@ mn[j.none] = {}, mn[j.disabled] = {}, mn[j.renderingMaskAdd] = {
|
|
|
2155
2155
|
compare: "equal",
|
|
2156
2156
|
passOp: "increment-clamp"
|
|
2157
2157
|
}
|
|
2158
|
-
}, mn[
|
|
2158
|
+
}, mn[M.renderingMaskRemove] = {
|
|
2159
2159
|
stencilFront: {
|
|
2160
2160
|
compare: "equal",
|
|
2161
2161
|
passOp: "decrement-clamp"
|
|
@@ -2164,7 +2164,7 @@ mn[j.none] = {}, mn[j.disabled] = {}, mn[j.renderingMaskAdd] = {
|
|
|
2164
2164
|
compare: "equal",
|
|
2165
2165
|
passOp: "decrement-clamp"
|
|
2166
2166
|
}
|
|
2167
|
-
}, mn[
|
|
2167
|
+
}, mn[M.maskActive] = {
|
|
2168
2168
|
stencilFront: {
|
|
2169
2169
|
compare: "equal",
|
|
2170
2170
|
passOp: "keep"
|
|
@@ -2173,7 +2173,7 @@ mn[j.none] = {}, mn[j.disabled] = {}, mn[j.renderingMaskAdd] = {
|
|
|
2173
2173
|
compare: "equal",
|
|
2174
2174
|
passOp: "keep"
|
|
2175
2175
|
}
|
|
2176
|
-
}, mn[
|
|
2176
|
+
}, mn[M.inverseMaskActive] = {
|
|
2177
2177
|
stencilFront: {
|
|
2178
2178
|
compare: "not-equal",
|
|
2179
2179
|
passOp: "keep"
|
|
@@ -2183,17 +2183,17 @@ mn[j.none] = {}, mn[j.disabled] = {}, mn[j.renderingMaskAdd] = {
|
|
|
2183
2183
|
passOp: "keep"
|
|
2184
2184
|
}
|
|
2185
2185
|
};
|
|
2186
|
-
var hn = class extends
|
|
2186
|
+
var hn = class extends j {
|
|
2187
2187
|
install(e) {
|
|
2188
2188
|
super.install(e), e.stencil = this;
|
|
2189
2189
|
}
|
|
2190
2190
|
_cache = {
|
|
2191
2191
|
enabled: !1,
|
|
2192
|
-
stencilMode:
|
|
2192
|
+
stencilMode: M.none,
|
|
2193
2193
|
refCount: 0
|
|
2194
2194
|
};
|
|
2195
2195
|
current = { [-1]: {
|
|
2196
|
-
stencilMode:
|
|
2196
|
+
stencilMode: M.disabled,
|
|
2197
2197
|
refCount: 0
|
|
2198
2198
|
} };
|
|
2199
2199
|
_passOpMap;
|
|
@@ -2223,20 +2223,20 @@ var hn = class extends A {
|
|
|
2223
2223
|
super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
|
|
2224
2224
|
}
|
|
2225
2225
|
reset() {
|
|
2226
|
-
this._cache.enabled = !1, this._cache.stencilMode =
|
|
2226
|
+
this._cache.enabled = !1, this._cache.stencilMode = M.none, this._cache.refCount = 0;
|
|
2227
2227
|
}
|
|
2228
2228
|
_updateRenderTarget = (e) => {
|
|
2229
2229
|
if (e) {
|
|
2230
2230
|
let t = this.current[e.instanceId];
|
|
2231
2231
|
t ||= this.current[e.instanceId] = {
|
|
2232
|
-
stencilMode:
|
|
2232
|
+
stencilMode: M.disabled,
|
|
2233
2233
|
refCount: 0
|
|
2234
2234
|
}, this.bind(t.stencilMode, t.refCount);
|
|
2235
2235
|
}
|
|
2236
2236
|
};
|
|
2237
2237
|
bind(e, t) {
|
|
2238
2238
|
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = mn[e], a = this._cache;
|
|
2239
|
-
if (n.stencilMode = e, n.refCount = t, e ===
|
|
2239
|
+
if (n.stencilMode = e, n.refCount = t, e === M.disabled) {
|
|
2240
2240
|
this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
|
|
2241
2241
|
return;
|
|
2242
2242
|
}
|
|
@@ -2245,8 +2245,8 @@ var hn = class extends A {
|
|
|
2245
2245
|
destroy() {
|
|
2246
2246
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
2247
2247
|
}
|
|
2248
|
-
}, gn = class extends
|
|
2249
|
-
current = new
|
|
2248
|
+
}, gn = class extends j {
|
|
2249
|
+
current = new yt(0, 0, 0, 0);
|
|
2250
2250
|
install(e) {
|
|
2251
2251
|
super.install(e), e.viewport = this;
|
|
2252
2252
|
}
|
|
@@ -2265,7 +2265,7 @@ var hn = class extends A {
|
|
|
2265
2265
|
constructor(e) {
|
|
2266
2266
|
this.framebuffer = e;
|
|
2267
2267
|
}
|
|
2268
|
-
}, vn = class extends
|
|
2268
|
+
}, vn = class extends j {
|
|
2269
2269
|
install(e) {
|
|
2270
2270
|
super.install(e), e.renderTarget = this;
|
|
2271
2271
|
}
|
|
@@ -2392,7 +2392,7 @@ var hn = class extends A {
|
|
|
2392
2392
|
return e[e.RGBA = 6408] = "RGBA", e[e.RGB = 6407] = "RGB", e[e.RG = 33319] = "RG", e[e.RED = 6403] = "RED", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.ALPHA = 6406] = "ALPHA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e;
|
|
2393
2393
|
}({}), bn = /* @__PURE__ */ function(e) {
|
|
2394
2394
|
return e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e;
|
|
2395
|
-
}({}),
|
|
2395
|
+
}({}), N = /* @__PURE__ */ function(e) {
|
|
2396
2396
|
return e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.BYTE = 5120] = "BYTE", e[e.SHORT = 5122] = "SHORT", e[e.INT = 5124] = "INT", e[e.FLOAT = 5126] = "FLOAT", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.HALF_FLOAT = 36193] = "HALF_FLOAT", e;
|
|
2397
2397
|
}({}), xn = class {
|
|
2398
2398
|
native;
|
|
@@ -2400,7 +2400,7 @@ var hn = class extends A {
|
|
|
2400
2400
|
width = -1;
|
|
2401
2401
|
height = -1;
|
|
2402
2402
|
mipmap = !1;
|
|
2403
|
-
type =
|
|
2403
|
+
type = N.UNSIGNED_BYTE;
|
|
2404
2404
|
internalFormat = yn.RGBA;
|
|
2405
2405
|
format = yn.RGBA;
|
|
2406
2406
|
constructor(e) {
|
|
@@ -2681,7 +2681,7 @@ var An = {
|
|
|
2681
2681
|
c < o || l < s ? ((i !== o || a !== s) && n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, null), r === 2 ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, c, l, t.format, t.type, e.source) : n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source)) : i === o && a === s ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source) : r === 2 ? n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, e.source) : n.texImage2D(t.target, 0, t.internalFormat, t.format, t.type, e.source), t.width = o, t.height = s;
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
|
-
}, jn = class extends
|
|
2684
|
+
}, jn = class extends j {
|
|
2685
2685
|
uploaders = { ...An };
|
|
2686
2686
|
textures = /* @__PURE__ */ new Map();
|
|
2687
2687
|
glTextures = /* @__PURE__ */ new Map();
|
|
@@ -2780,36 +2780,36 @@ var An = {
|
|
|
2780
2780
|
this._renderer.contextLost || this.glTextures.forEach((t) => e.deleteTexture(t.native)), this.textures.clear(), this.glTextures.clear(), this._location = 0, this.current.length = 0, this._premultiplyAlpha = !1, this._renderer.contextLost || e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
|
|
2781
2781
|
}
|
|
2782
2782
|
}, Mn = {
|
|
2783
|
-
uint8x2:
|
|
2784
|
-
uint8x4:
|
|
2785
|
-
sint8x2:
|
|
2786
|
-
sint8x4:
|
|
2787
|
-
unorm8x2:
|
|
2788
|
-
unorm8x4:
|
|
2789
|
-
snorm8x2:
|
|
2790
|
-
snorm8x4:
|
|
2791
|
-
uint16x2:
|
|
2792
|
-
uint16x4:
|
|
2793
|
-
sint16x2:
|
|
2794
|
-
sint16x4:
|
|
2795
|
-
unorm16x2:
|
|
2796
|
-
unorm16x4:
|
|
2797
|
-
snorm16x2:
|
|
2798
|
-
snorm16x4:
|
|
2799
|
-
float16x2:
|
|
2800
|
-
float16x4:
|
|
2801
|
-
float32:
|
|
2802
|
-
float32x2:
|
|
2803
|
-
float32x3:
|
|
2804
|
-
float32x4:
|
|
2805
|
-
uint32:
|
|
2806
|
-
uint32x2:
|
|
2807
|
-
uint32x3:
|
|
2808
|
-
uint32x4:
|
|
2809
|
-
sint32:
|
|
2810
|
-
sint32x2:
|
|
2811
|
-
sint32x3:
|
|
2812
|
-
sint32x4:
|
|
2783
|
+
uint8x2: N.UNSIGNED_BYTE,
|
|
2784
|
+
uint8x4: N.UNSIGNED_BYTE,
|
|
2785
|
+
sint8x2: N.BYTE,
|
|
2786
|
+
sint8x4: N.BYTE,
|
|
2787
|
+
unorm8x2: N.UNSIGNED_BYTE,
|
|
2788
|
+
unorm8x4: N.UNSIGNED_BYTE,
|
|
2789
|
+
snorm8x2: N.BYTE,
|
|
2790
|
+
snorm8x4: N.BYTE,
|
|
2791
|
+
uint16x2: N.UNSIGNED_SHORT,
|
|
2792
|
+
uint16x4: N.UNSIGNED_SHORT,
|
|
2793
|
+
sint16x2: N.SHORT,
|
|
2794
|
+
sint16x4: N.SHORT,
|
|
2795
|
+
unorm16x2: N.UNSIGNED_SHORT,
|
|
2796
|
+
unorm16x4: N.UNSIGNED_SHORT,
|
|
2797
|
+
snorm16x2: N.SHORT,
|
|
2798
|
+
snorm16x4: N.SHORT,
|
|
2799
|
+
float16x2: N.HALF_FLOAT,
|
|
2800
|
+
float16x4: N.HALF_FLOAT,
|
|
2801
|
+
float32: N.FLOAT,
|
|
2802
|
+
float32x2: N.FLOAT,
|
|
2803
|
+
float32x3: N.FLOAT,
|
|
2804
|
+
float32x4: N.FLOAT,
|
|
2805
|
+
uint32: N.UNSIGNED_INT,
|
|
2806
|
+
uint32x2: N.UNSIGNED_INT,
|
|
2807
|
+
uint32x3: N.UNSIGNED_INT,
|
|
2808
|
+
uint32x4: N.UNSIGNED_INT,
|
|
2809
|
+
sint32: N.INT,
|
|
2810
|
+
sint32x2: N.INT,
|
|
2811
|
+
sint32x3: N.INT,
|
|
2812
|
+
sint32x4: N.INT
|
|
2813
2813
|
};
|
|
2814
2814
|
function Nn(e) {
|
|
2815
2815
|
return Mn[e] ?? Mn.float32;
|
|
@@ -2822,7 +2822,7 @@ var Pn = {
|
|
|
2822
2822
|
"line-strip": 3,
|
|
2823
2823
|
"triangle-list": 4,
|
|
2824
2824
|
"triangle-strip": 5
|
|
2825
|
-
}, Fn = class extends
|
|
2825
|
+
}, Fn = class extends j {
|
|
2826
2826
|
_geometryVaoHash = {};
|
|
2827
2827
|
hasInstance = !1;
|
|
2828
2828
|
current = null;
|
|
@@ -2954,7 +2954,7 @@ var Pn = {
|
|
|
2954
2954
|
}
|
|
2955
2955
|
this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
|
|
2956
2956
|
}
|
|
2957
|
-
}, In = class extends
|
|
2957
|
+
}, In = class extends j {
|
|
2958
2958
|
install(e) {
|
|
2959
2959
|
super.install(e), e.colorMask = this;
|
|
2960
2960
|
}
|
|
@@ -2986,7 +2986,7 @@ function Rn(e, t) {
|
|
|
2986
2986
|
height: f - d
|
|
2987
2987
|
};
|
|
2988
2988
|
}
|
|
2989
|
-
var zn = class extends
|
|
2989
|
+
var zn = class extends j {
|
|
2990
2990
|
install(e) {
|
|
2991
2991
|
super.install(e), e.scissor = this;
|
|
2992
2992
|
}
|
|
@@ -3048,11 +3048,11 @@ var zn = class extends A {
|
|
|
3048
3048
|
};
|
|
3049
3049
|
constructor(e = S(), t) {
|
|
3050
3050
|
if (super(), !e) throw Error("Failed to createHTMLCanvas");
|
|
3051
|
-
|
|
3051
|
+
$e(e) ? this._setupContext(e, t) : (this.gl = e, this.version = et(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"));
|
|
3052
3052
|
}
|
|
3053
3053
|
_setupContext(e, t) {
|
|
3054
3054
|
this.view = e;
|
|
3055
|
-
let n =
|
|
3055
|
+
let n = ot()?.(e, t), r = n && et(n) ? 2 : 1;
|
|
3056
3056
|
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");
|
|
3057
3057
|
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;
|
|
3058
3058
|
}
|
|
@@ -3165,7 +3165,7 @@ var zn = class extends A {
|
|
|
3165
3165
|
super(), this.setProperties(e);
|
|
3166
3166
|
}
|
|
3167
3167
|
};
|
|
3168
|
-
|
|
3168
|
+
k([_({ fallback: A.index }), O("design:type", A === void 0 ? Object : A)], Un.prototype, "usage", void 0), k([_({ default: () => new Uint32Array() }), O("design:type", Object)], Un.prototype, "data", void 0);
|
|
3169
3169
|
//#endregion
|
|
3170
3170
|
//#region src/scene/resources/geometries/Geometry.ts
|
|
3171
3171
|
var Wn = class extends w {
|
|
@@ -3176,32 +3176,32 @@ var Wn = class extends w {
|
|
|
3176
3176
|
e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
|
|
3177
3177
|
}
|
|
3178
3178
|
};
|
|
3179
|
-
|
|
3179
|
+
k([_({ fallback: "triangle-list" }), O("design:type", Object)], Wn.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof Record > "u" ? Object : Record)], Wn.prototype, "attributes", void 0), k([_({ default: () => new Un() }), O("design:type", Un === void 0 ? Object : Un)], Wn.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Wn.prototype, "instanceCount", void 0);
|
|
3180
3180
|
//#endregion
|
|
3181
3181
|
//#region src/scene/resources/geometries/VertexBuffer.ts
|
|
3182
|
-
var
|
|
3182
|
+
var P = class extends w {
|
|
3183
3183
|
constructor(e) {
|
|
3184
3184
|
super(), this.setProperties(e);
|
|
3185
3185
|
}
|
|
3186
3186
|
};
|
|
3187
|
-
|
|
3187
|
+
k([_({ fallback: A.vertex }), O("design:type", A === void 0 ? Object : A)], P.prototype, "usage", void 0), k([_({ default: () => new Float32Array() }), O("design:type", Object)], P.prototype, "data", void 0);
|
|
3188
3188
|
//#endregion
|
|
3189
3189
|
//#region src/scene/resources/geometries/VertexAttribute.ts
|
|
3190
|
-
var
|
|
3190
|
+
var F = class extends w {
|
|
3191
3191
|
constructor(e) {
|
|
3192
3192
|
super(), this.setProperties(e);
|
|
3193
3193
|
}
|
|
3194
3194
|
};
|
|
3195
|
-
|
|
3195
|
+
k([_({ default: () => new P() }), O("design:type", P === void 0 ? Object : P)], F.prototype, "buffer", void 0), k([_({ fallback: "float32" }), O("design:type", Object)], F.prototype, "format", void 0), k([_(), O("design:type", Boolean)], F.prototype, "instance", void 0), k([_(), O("design:type", Number)], F.prototype, "stride", void 0), k([_(), O("design:type", Number)], F.prototype, "offset", void 0), k([_(), O("design:type", Number)], F.prototype, "start", void 0), k([_(), O("design:type", Number)], F.prototype, "divisor", void 0);
|
|
3196
3196
|
//#endregion
|
|
3197
3197
|
//#region src/scene/resources/geometries/QuadGeometry.ts
|
|
3198
3198
|
var Gn = class extends Wn {
|
|
3199
3199
|
constructor() {
|
|
3200
3200
|
super({
|
|
3201
3201
|
topology: "triangle-strip",
|
|
3202
|
-
attributes: { position: new
|
|
3202
|
+
attributes: { position: new F({
|
|
3203
3203
|
format: "float32x2",
|
|
3204
|
-
buffer: new
|
|
3204
|
+
buffer: new P({ data: new Float32Array([
|
|
3205
3205
|
0,
|
|
3206
3206
|
0,
|
|
3207
3207
|
1,
|
|
@@ -3255,7 +3255,7 @@ function Kn() {
|
|
|
3255
3255
|
])
|
|
3256
3256
|
};
|
|
3257
3257
|
}
|
|
3258
|
-
var
|
|
3258
|
+
var I = class extends w {
|
|
3259
3259
|
static instance = new this();
|
|
3260
3260
|
glProgram;
|
|
3261
3261
|
constructor(e = {}) {
|
|
@@ -3274,7 +3274,7 @@ var F = class extends w {
|
|
|
3274
3274
|
}, e.shader.updateUniforms(this);
|
|
3275
3275
|
}
|
|
3276
3276
|
};
|
|
3277
|
-
|
|
3277
|
+
k([_({ default: Kn }), O("design:type", typeof Record > "u" ? Object : Record)], I.prototype, "uniforms", void 0);
|
|
3278
3278
|
//#endregion
|
|
3279
3279
|
//#region src/scene/resources/materials/EffectMaterial.ts
|
|
3280
3280
|
var qn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Jn = /vec(\d)\((.*)\)/;
|
|
@@ -3289,7 +3289,7 @@ function Yn(e) {
|
|
|
3289
3289
|
}
|
|
3290
3290
|
return Number(e);
|
|
3291
3291
|
}
|
|
3292
|
-
var Xn = class e extends
|
|
3292
|
+
var Xn = class e extends I {
|
|
3293
3293
|
static RE = {
|
|
3294
3294
|
getColor: /\sgetColor\s*\(/,
|
|
3295
3295
|
getFromColor: /\sgetFromColor\s*\(/,
|
|
@@ -3330,7 +3330,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3330
3330
|
this.uniforms[t.trim()] = Yn(e[2]);
|
|
3331
3331
|
});
|
|
3332
3332
|
}
|
|
3333
|
-
}, Zn = class extends
|
|
3333
|
+
}, Zn = class extends I {
|
|
3334
3334
|
static _instance;
|
|
3335
3335
|
static get instance() {
|
|
3336
3336
|
return this._instance ??= new this();
|
|
@@ -3374,7 +3374,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3374
3374
|
}
|
|
3375
3375
|
});
|
|
3376
3376
|
}
|
|
3377
|
-
},
|
|
3377
|
+
}, L = class extends Wn {
|
|
3378
3378
|
static _instance;
|
|
3379
3379
|
static get instance() {
|
|
3380
3380
|
return this._instance ??= new this();
|
|
@@ -3385,9 +3385,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3385
3385
|
constructor() {
|
|
3386
3386
|
super({
|
|
3387
3387
|
attributes: {
|
|
3388
|
-
position: new
|
|
3388
|
+
position: new F({
|
|
3389
3389
|
format: "float32x2",
|
|
3390
|
-
buffer: new
|
|
3390
|
+
buffer: new P({ data: new Float32Array([
|
|
3391
3391
|
-1,
|
|
3392
3392
|
-1,
|
|
3393
3393
|
1,
|
|
@@ -3398,9 +3398,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3398
3398
|
1
|
|
3399
3399
|
]) })
|
|
3400
3400
|
}),
|
|
3401
|
-
uv: new
|
|
3401
|
+
uv: new F({
|
|
3402
3402
|
format: "float32x2",
|
|
3403
|
-
buffer: new
|
|
3403
|
+
buffer: new P({ data: new Float32Array([
|
|
3404
3404
|
0,
|
|
3405
3405
|
0,
|
|
3406
3406
|
1,
|
|
@@ -3426,15 +3426,15 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3426
3426
|
positionBuffer;
|
|
3427
3427
|
uvBuffer;
|
|
3428
3428
|
constructor(e) {
|
|
3429
|
-
let t = new
|
|
3429
|
+
let t = new P({ data: new Float32Array() }), n = new P({ data: new Float32Array() });
|
|
3430
3430
|
super({
|
|
3431
3431
|
...e,
|
|
3432
3432
|
attributes: {
|
|
3433
|
-
position: new
|
|
3433
|
+
position: new F({
|
|
3434
3434
|
format: "float32x2",
|
|
3435
3435
|
buffer: t
|
|
3436
3436
|
}),
|
|
3437
|
-
uv: new
|
|
3437
|
+
uv: new F({
|
|
3438
3438
|
format: "float32x2",
|
|
3439
3439
|
buffer: n
|
|
3440
3440
|
})
|
|
@@ -3442,7 +3442,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3442
3442
|
indexBuffer: new Un({ data: new Uint32Array() })
|
|
3443
3443
|
}), this.positionBuffer = t, this.uvBuffer = n;
|
|
3444
3444
|
}
|
|
3445
|
-
},
|
|
3445
|
+
}, R = class extends w {
|
|
3446
3446
|
get valid() {
|
|
3447
3447
|
return !!(this.width && this.height);
|
|
3448
3448
|
}
|
|
@@ -3456,10 +3456,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3456
3456
|
super._destroy(), this.colorTextures.forEach((e) => e.destroy());
|
|
3457
3457
|
}
|
|
3458
3458
|
};
|
|
3459
|
-
|
|
3459
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "isRoot", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "msaa", void 0), k([_({ default: () => [new z()] }), O("design:type", Array)], R.prototype, "colorTextures", void 0);
|
|
3460
3460
|
//#endregion
|
|
3461
3461
|
//#region src/scene/resources/textures/Texture2D.ts
|
|
3462
|
-
var
|
|
3462
|
+
var z = class extends w {
|
|
3463
3463
|
static get EMPTY() {
|
|
3464
3464
|
return new this({
|
|
3465
3465
|
width: 1,
|
|
@@ -3550,7 +3550,7 @@ var R = class extends w {
|
|
|
3550
3550
|
switch (super._updateProperty(e, t, n), e) {
|
|
3551
3551
|
case "width":
|
|
3552
3552
|
case "height":
|
|
3553
|
-
this.isPowerOfTwo =
|
|
3553
|
+
this.isPowerOfTwo = we(this.pixelWidth) && we(this.pixelHeight);
|
|
3554
3554
|
break;
|
|
3555
3555
|
case "source":
|
|
3556
3556
|
this.updateSize();
|
|
@@ -3567,10 +3567,10 @@ var R = class extends w {
|
|
|
3567
3567
|
e.texture.unbind(this);
|
|
3568
3568
|
}
|
|
3569
3569
|
_destroy() {
|
|
3570
|
-
super._destroy(),
|
|
3570
|
+
super._destroy(), Pe && this.source instanceof ImageBitmap && this.source.close();
|
|
3571
3571
|
}
|
|
3572
3572
|
};
|
|
3573
|
-
|
|
3573
|
+
k([_({ fallback: "unknown" }), O("design:type", String)], z.prototype, "uploadMethodId", void 0), k([_({ internal: !0 }), O("design:type", Object)], z.prototype, "source", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "height", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "pixelRatio", void 0), k([_({ fallback: "bgra8unorm" }), O("design:type", Object)], z.prototype, "format", void 0), k([_({ fallback: "premultiply-alpha-on-upload" }), O("design:type", Object)], z.prototype, "alphaMode", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "mipLevelCount", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "mipmap", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeU", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeV", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeW", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "magFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "minFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "mipmapFilter", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "isPowerOfTwo", void 0);
|
|
3574
3574
|
//#endregion
|
|
3575
3575
|
//#region src/scene/resources/textures/AnimatedTexture.ts
|
|
3576
3576
|
var $n = class extends w {
|
|
@@ -3583,7 +3583,7 @@ var $n = class extends w {
|
|
|
3583
3583
|
super();
|
|
3584
3584
|
let t;
|
|
3585
3585
|
if (Array.isArray(e)) t = e;
|
|
3586
|
-
else if (e instanceof
|
|
3586
|
+
else if (e instanceof z) t = [{
|
|
3587
3587
|
texture: e,
|
|
3588
3588
|
duration: 0
|
|
3589
3589
|
}];
|
|
@@ -3598,7 +3598,7 @@ var $n = class extends w {
|
|
|
3598
3598
|
e.texture.destroy();
|
|
3599
3599
|
});
|
|
3600
3600
|
}
|
|
3601
|
-
}, er = class extends
|
|
3601
|
+
}, er = class extends z {
|
|
3602
3602
|
constructor(e = {}) {
|
|
3603
3603
|
super({
|
|
3604
3604
|
pixelRatio: 2,
|
|
@@ -3618,7 +3618,7 @@ var $n = class extends w {
|
|
|
3618
3618
|
}
|
|
3619
3619
|
super._updateProperty(e, t, n);
|
|
3620
3620
|
}
|
|
3621
|
-
}, tr = class e extends
|
|
3621
|
+
}, tr = class e extends z {
|
|
3622
3622
|
static _cached = /* @__PURE__ */ new Map();
|
|
3623
3623
|
static get(t) {
|
|
3624
3624
|
let n = new T(t), r = n.toHex(), i = this._cached.get(r);
|
|
@@ -3639,7 +3639,7 @@ var $n = class extends w {
|
|
|
3639
3639
|
mipmap: !0
|
|
3640
3640
|
});
|
|
3641
3641
|
}
|
|
3642
|
-
}, nr = class e extends
|
|
3642
|
+
}, nr = class e extends z {
|
|
3643
3643
|
static test(e) {
|
|
3644
3644
|
return u(e);
|
|
3645
3645
|
}
|
|
@@ -3673,7 +3673,7 @@ var $n = class extends w {
|
|
|
3673
3673
|
constructor(t, n, r) {
|
|
3674
3674
|
super(e.linearGradient(t, n, r));
|
|
3675
3675
|
}
|
|
3676
|
-
}, rr = class extends
|
|
3676
|
+
}, rr = class extends z {
|
|
3677
3677
|
constructor(e = {}) {
|
|
3678
3678
|
super({
|
|
3679
3679
|
...e,
|
|
@@ -3694,7 +3694,7 @@ function ir(e) {
|
|
|
3694
3694
|
playsinline: !!(e?.playsinline ?? !0)
|
|
3695
3695
|
};
|
|
3696
3696
|
}
|
|
3697
|
-
var ar = class e extends
|
|
3697
|
+
var ar = class e extends z {
|
|
3698
3698
|
static mimeTypes = new Map(Object.entries({
|
|
3699
3699
|
ogv: "video/ogg",
|
|
3700
3700
|
mov: "video/quicktime",
|
|
@@ -3729,12 +3729,12 @@ var ar = class e extends R {
|
|
|
3729
3729
|
_seekResolves = [];
|
|
3730
3730
|
constructor(t, n) {
|
|
3731
3731
|
let r = ir(n);
|
|
3732
|
-
if (!
|
|
3732
|
+
if (!Ze(t)) {
|
|
3733
3733
|
typeof t == "string" && (t = [t]);
|
|
3734
3734
|
let n = t[0].src || t[0];
|
|
3735
3735
|
if (typeof document > "u") throw TypeError("VideoTexture requires a DOM <video> element and is not supported in non-browser environments.");
|
|
3736
3736
|
let i = document.createElement("video");
|
|
3737
|
-
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", ""),
|
|
3737
|
+
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", ""), ct(i, n, r.crossorigin);
|
|
3738
3738
|
for (let n = 0; n < t.length; ++n) {
|
|
3739
3739
|
let { src: r, mime: a } = t[n];
|
|
3740
3740
|
if (r ||= t[n], r.startsWith("data:")) a = r.slice(5, r.indexOf(";"));
|
|
@@ -3821,16 +3821,16 @@ var ar = class e extends R {
|
|
|
3821
3821
|
e && (e.removeEventListener("play", this._onPlayStart), e.removeEventListener("pause", this._onPlayStop), e.removeEventListener("seeked", this._onSeeked), e.removeEventListener("canplay", this._onCanPlay), e.removeEventListener("canplaythrough", this._onCanPlay), e.removeEventListener("error", this._onError, !0), e.pause(), e.src = "", e.load());
|
|
3822
3822
|
}
|
|
3823
3823
|
};
|
|
3824
|
-
|
|
3824
|
+
k([_({
|
|
3825
3825
|
internal: !0,
|
|
3826
3826
|
fallback: !0
|
|
3827
|
-
}),
|
|
3827
|
+
}), O("design:type", Boolean)], ar.prototype, "autoUpdate", void 0), k([_({
|
|
3828
3828
|
internal: !0,
|
|
3829
3829
|
fallback: 0
|
|
3830
|
-
}),
|
|
3830
|
+
}), O("design:type", Number)], ar.prototype, "fps", void 0);
|
|
3831
3831
|
//#endregion
|
|
3832
3832
|
//#region src/scene/resources/textures/ViewportTexture.ts
|
|
3833
|
-
var or = class extends
|
|
3833
|
+
var or = class extends z {}, sr = class extends le {
|
|
3834
3834
|
fillStyle;
|
|
3835
3835
|
fillRule;
|
|
3836
3836
|
strokeStyle;
|
|
@@ -3844,7 +3844,7 @@ var or = class extends R {}, sr = class extends le {
|
|
|
3844
3844
|
_draws = [];
|
|
3845
3845
|
_triCache = [];
|
|
3846
3846
|
_parseDrawStyle(e) {
|
|
3847
|
-
return e ? e instanceof
|
|
3847
|
+
return e ? e instanceof z ? { texture: e } : { texture: tr.get(e) } : {};
|
|
3848
3848
|
}
|
|
3849
3849
|
stroke(e) {
|
|
3850
3850
|
if (!this.curves.length) return;
|
|
@@ -4008,10 +4008,10 @@ function fr(e) {
|
|
|
4008
4008
|
let t = dr[e] ?? 0;
|
|
4009
4009
|
return t++, dr[e] = t, t;
|
|
4010
4010
|
}
|
|
4011
|
-
var
|
|
4011
|
+
var B = ur = class extends C {
|
|
4012
4012
|
static parse(e, t = "Node") {
|
|
4013
4013
|
if (Array.isArray(e)) return e.map((e) => this.parse(e));
|
|
4014
|
-
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((
|
|
4014
|
+
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ye.get(n ?? r.inCanvasIs ?? t)) ?? ur)({
|
|
4015
4015
|
...a,
|
|
4016
4016
|
meta: r
|
|
4017
4017
|
});
|
|
@@ -4371,13 +4371,13 @@ var z = ur = class extends C {
|
|
|
4371
4371
|
});
|
|
4372
4372
|
}
|
|
4373
4373
|
};
|
|
4374
|
-
|
|
4374
|
+
k([_({ default: () => c() }), O("design:type", String)], B.prototype, "id", void 0), k([_({ default: () => c() }), O("design:type", String)], B.prototype, "name", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "processMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "processSortMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "renderMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "inputMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "internalMode", void 0), k([_({
|
|
4375
4375
|
internal: !0,
|
|
4376
4376
|
default: !0
|
|
4377
|
-
}),
|
|
4377
|
+
}), O("design:type", Boolean)], B.prototype, "needsRender", void 0), B = ur = k([b("Node"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], B);
|
|
4378
4378
|
//#endregion
|
|
4379
4379
|
//#region src/scene/main/TimelineNode.ts
|
|
4380
|
-
var
|
|
4380
|
+
var V = class extends B {
|
|
4381
4381
|
insideTimeRange = !1;
|
|
4382
4382
|
get _timeline() {
|
|
4383
4383
|
return this._tree?.timeline;
|
|
@@ -4408,7 +4408,7 @@ var B = class extends z {
|
|
|
4408
4408
|
return this._globalStartTime + this._globalDuration;
|
|
4409
4409
|
}
|
|
4410
4410
|
get currentTimeProgress() {
|
|
4411
|
-
return this._duration ?
|
|
4411
|
+
return this._duration ? E(this._currentTime / this._duration, 0, 1) : 0;
|
|
4412
4412
|
}
|
|
4413
4413
|
isInsideTimeRange() {
|
|
4414
4414
|
let e = this._currentTime;
|
|
@@ -4448,7 +4448,7 @@ var B = class extends z {
|
|
|
4448
4448
|
super._process(e), this._updateCurrentTime();
|
|
4449
4449
|
}
|
|
4450
4450
|
};
|
|
4451
|
-
|
|
4451
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "loop", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "delay", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "duration", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "paused", void 0), V = k([b("TimelineNode"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
|
|
4452
4452
|
//#endregion
|
|
4453
4453
|
//#region src/scene/main/CanvasItem.ts
|
|
4454
4454
|
var pr = [], mr = 0;
|
|
@@ -4459,7 +4459,7 @@ function gr(e, t, n, r) {
|
|
|
4459
4459
|
let i = pr[mr];
|
|
4460
4460
|
return i || (i = {}, pr[mr] = i), mr++, Object.assign(i, e), i.roundPixels = t, i.size = n, i.texture = r, i;
|
|
4461
4461
|
}
|
|
4462
|
-
var _r = class extends
|
|
4462
|
+
var _r = class extends V {
|
|
4463
4463
|
_blendMode;
|
|
4464
4464
|
_parentGlobalVisible;
|
|
4465
4465
|
_globalVisible;
|
|
@@ -4539,7 +4539,7 @@ var _r = class extends B {
|
|
|
4539
4539
|
}
|
|
4540
4540
|
_updateGlobalOpacity() {
|
|
4541
4541
|
this._parentGlobalOpacity = this.getParent()?.opacity;
|
|
4542
|
-
let e =
|
|
4542
|
+
let e = E(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
|
|
4543
4543
|
this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
|
|
4544
4544
|
}
|
|
4545
4545
|
_draw() {
|
|
@@ -4617,19 +4617,19 @@ var _r = class extends B {
|
|
|
4617
4617
|
super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
|
|
4618
4618
|
}
|
|
4619
4619
|
};
|
|
4620
|
-
|
|
4620
|
+
k([_(), O("design:type", Object)], _r.prototype, "blendMode", void 0), k([_({
|
|
4621
4621
|
internal: !0,
|
|
4622
4622
|
fallback: !0
|
|
4623
|
-
}),
|
|
4623
|
+
}), O("design:type", Boolean)], _r.prototype, "visible", void 0), k([_({
|
|
4624
4624
|
internal: !0,
|
|
4625
4625
|
fallback: 1
|
|
4626
|
-
}),
|
|
4626
|
+
}), O("design:type", Number)], _r.prototype, "opacity", void 0), _r = k([b("CanvasItem"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], _r);
|
|
4627
4627
|
//#endregion
|
|
4628
4628
|
//#region src/scene/main/Viewport.ts
|
|
4629
|
-
var
|
|
4629
|
+
var H = class extends B {
|
|
4630
4630
|
canvasTransform = new v();
|
|
4631
4631
|
renderTargetIndex = 0;
|
|
4632
|
-
renderTargets = [new
|
|
4632
|
+
renderTargets = [new R(), new R()];
|
|
4633
4633
|
get valid() {
|
|
4634
4634
|
return !!(this.width && this.height);
|
|
4635
4635
|
}
|
|
@@ -4676,7 +4676,7 @@ var V = class extends z {
|
|
|
4676
4676
|
return !1;
|
|
4677
4677
|
}
|
|
4678
4678
|
activateWithCopy(e, t) {
|
|
4679
|
-
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0),
|
|
4679
|
+
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, Zn.instance, { sampler: 0 }));
|
|
4680
4680
|
}
|
|
4681
4681
|
renderStart(e, t) {
|
|
4682
4682
|
this.activate(e, t) && e.clear();
|
|
@@ -4689,7 +4689,7 @@ var V = class extends z {
|
|
|
4689
4689
|
this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
|
|
4690
4690
|
}
|
|
4691
4691
|
getRect() {
|
|
4692
|
-
return new
|
|
4692
|
+
return new yt(this.x, this.y, this.width, this.height);
|
|
4693
4693
|
}
|
|
4694
4694
|
toCanvasGlobal(e, t) {
|
|
4695
4695
|
return this.canvasTransform.applyAffineInverse(e, t);
|
|
@@ -4701,16 +4701,16 @@ var V = class extends z {
|
|
|
4701
4701
|
super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
|
|
4702
4702
|
}
|
|
4703
4703
|
};
|
|
4704
|
-
|
|
4704
|
+
k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "msaa", void 0), H = k([b("Viewport")], H);
|
|
4705
4705
|
//#endregion
|
|
4706
4706
|
//#region src/scene/main/Effect.ts
|
|
4707
|
-
var
|
|
4707
|
+
var U = class extends V {
|
|
4708
4708
|
material;
|
|
4709
4709
|
get _effectMode() {
|
|
4710
4710
|
return this.effectMode ?? "parent";
|
|
4711
4711
|
}
|
|
4712
|
-
viewport1 = new
|
|
4713
|
-
viewport2 = new
|
|
4712
|
+
viewport1 = new H();
|
|
4713
|
+
viewport2 = new H();
|
|
4714
4714
|
_renderId = 0;
|
|
4715
4715
|
_renderViewport;
|
|
4716
4716
|
_previousSibling;
|
|
@@ -4762,7 +4762,7 @@ var H = class extends B {
|
|
|
4762
4762
|
}
|
|
4763
4763
|
}
|
|
4764
4764
|
getRect() {
|
|
4765
|
-
return new
|
|
4765
|
+
return new yt(this._rect);
|
|
4766
4766
|
}
|
|
4767
4767
|
_processParent() {
|
|
4768
4768
|
let e = this._tree?.renderStack;
|
|
@@ -4915,13 +4915,13 @@ var H = class extends B {
|
|
|
4915
4915
|
}
|
|
4916
4916
|
apply(e, t, n) {
|
|
4917
4917
|
this.material && (n?.redraw ? t.redraw(e, () => {
|
|
4918
|
-
|
|
4918
|
+
L.draw(e, this.material, {
|
|
4919
4919
|
from: 0,
|
|
4920
4920
|
to: 1,
|
|
4921
4921
|
progress: this.currentTimeProgress,
|
|
4922
4922
|
ratio: t.width / t.height
|
|
4923
4923
|
});
|
|
4924
|
-
}) :
|
|
4924
|
+
}) : L.draw(e, this.material, {
|
|
4925
4925
|
from: 0,
|
|
4926
4926
|
to: 1,
|
|
4927
4927
|
progress: this.currentTimeProgress,
|
|
@@ -4932,7 +4932,7 @@ var H = class extends B {
|
|
|
4932
4932
|
super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
|
|
4933
4933
|
}
|
|
4934
4934
|
};
|
|
4935
|
-
|
|
4935
|
+
k([_({ internal: !0 }), O("design:type", Object)], U.prototype, "material", void 0), k([_(), O("design:type", Object)], U.prototype, "effectMode", void 0), k([_(), O("design:type", String)], U.prototype, "glsl", void 0), k([_(), O("design:type", String)], U.prototype, "glslSrc", void 0), U = k([b("Effect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], U);
|
|
4936
4936
|
//#endregion
|
|
4937
4937
|
//#region src/scene/main/RenderStack.ts
|
|
4938
4938
|
var vr = class {
|
|
@@ -4957,7 +4957,7 @@ var vr = class {
|
|
|
4957
4957
|
});
|
|
4958
4958
|
}), this.calls = [];
|
|
4959
4959
|
}
|
|
4960
|
-
}, yr, br = yr = class extends
|
|
4960
|
+
}, yr, br = yr = class extends B {
|
|
4961
4961
|
currentTime = 0;
|
|
4962
4962
|
static from(e, t = !1) {
|
|
4963
4963
|
let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
|
|
@@ -4979,16 +4979,16 @@ var vr = class {
|
|
|
4979
4979
|
}
|
|
4980
4980
|
addTime(e) {
|
|
4981
4981
|
let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = this.currentTime;
|
|
4982
|
-
return r += e, this.loop && r > t && (r = n + r % t), r =
|
|
4982
|
+
return r += e, this.loop && r > t && (r = n + r % t), r = E(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
|
|
4983
4983
|
}
|
|
4984
4984
|
_process(e) {
|
|
4985
4985
|
super._process(e), this.paused || this.addTime(e);
|
|
4986
4986
|
}
|
|
4987
4987
|
};
|
|
4988
|
-
|
|
4988
|
+
k([_({ fallback: 0 }), O("design:type", Number)], br.prototype, "startTime", void 0), k([_({ fallback: 2 ** 53 - 1 }), O("design:type", Number)], br.prototype, "endTime", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], br.prototype, "loop", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], br.prototype, "paused", void 0), br = yr = k([b("Timeline"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], br);
|
|
4989
4989
|
//#endregion
|
|
4990
4990
|
//#region src/scene/main/Window.ts
|
|
4991
|
-
var xr = class extends
|
|
4991
|
+
var xr = class extends H {
|
|
4992
4992
|
constructor() {
|
|
4993
4993
|
super(), this.renderTargets.forEach((e) => e.isRoot = !0);
|
|
4994
4994
|
}
|
|
@@ -4999,14 +4999,14 @@ var xr = class extends V {
|
|
|
4999
4999
|
super.flush(e), this.finish(e);
|
|
5000
5000
|
}
|
|
5001
5001
|
};
|
|
5002
|
-
xr =
|
|
5002
|
+
xr = k([b("Window", {
|
|
5003
5003
|
processMode: "always",
|
|
5004
5004
|
renderMode: "always"
|
|
5005
|
-
}),
|
|
5005
|
+
}), O("design:paramtypes", [])], xr);
|
|
5006
5006
|
//#endregion
|
|
5007
5007
|
//#region src/scene/main/SceneTree.ts
|
|
5008
5008
|
var Sr = class extends Tt {
|
|
5009
|
-
input = new
|
|
5009
|
+
input = new _t();
|
|
5010
5010
|
renderStack = new vr();
|
|
5011
5011
|
root = new xr().setTree(this);
|
|
5012
5012
|
timeline = new br().setTree(this);
|
|
@@ -5055,33 +5055,33 @@ var Sr = class extends Tt {
|
|
|
5055
5055
|
_renderScreen(e) {
|
|
5056
5056
|
this.root.finish(e), e.state.reset(), e.renderTarget.unbind(), this.backgroundColor && e.gl.clearColor(...this._backgroundColor.toArray()), e.clear(), this.backgroundColor && e.gl.clearColor(0, 0, 0, 0);
|
|
5057
5057
|
let t = this.root.texture;
|
|
5058
|
-
t.activate(e, 0),
|
|
5058
|
+
t.activate(e, 0), L.draw(e), t.inactivate(e);
|
|
5059
5059
|
}
|
|
5060
5060
|
_destroy() {
|
|
5061
5061
|
super._destroy(), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
|
|
5062
5062
|
}
|
|
5063
5063
|
};
|
|
5064
|
-
|
|
5064
|
+
k([_({ alias: "root.msaa" }), O("design:type", Boolean)], Sr.prototype, "msaa", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Sr.prototype, "pixelate", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Sr.prototype, "roundPixels", void 0), k([_(), O("design:type", Object)], Sr.prototype, "backgroundColor", void 0), k([_({
|
|
5065
5065
|
internal: !0,
|
|
5066
5066
|
fallback: !1
|
|
5067
|
-
}),
|
|
5067
|
+
}), O("design:type", Boolean)], Sr.prototype, "debug", void 0), k([_({
|
|
5068
5068
|
internal: !0,
|
|
5069
5069
|
fallback: !1
|
|
5070
|
-
}),
|
|
5070
|
+
}), O("design:type", Boolean)], Sr.prototype, "processPaused", void 0), k([_({
|
|
5071
5071
|
internal: !0,
|
|
5072
|
-
default: () =>
|
|
5073
|
-
}),
|
|
5072
|
+
default: () => ge
|
|
5073
|
+
}), O("design:type", Object)], Sr.prototype, "fonts", void 0);
|
|
5074
5074
|
//#endregion
|
|
5075
5075
|
//#region src/scene/main/Transition.ts
|
|
5076
|
-
var Cr = class extends
|
|
5076
|
+
var Cr = class extends U {
|
|
5077
5077
|
constructor(e, t = []) {
|
|
5078
5078
|
super(), this.setProperties(e).append(t);
|
|
5079
5079
|
}
|
|
5080
5080
|
};
|
|
5081
|
-
Cr =
|
|
5081
|
+
Cr = k([b("Transition", {
|
|
5082
5082
|
effectMode: "transition",
|
|
5083
5083
|
duration: 2e3
|
|
5084
|
-
}),
|
|
5084
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Cr);
|
|
5085
5085
|
//#endregion
|
|
5086
5086
|
//#region src/scene/2d/Node2D.ts
|
|
5087
5087
|
var wr = class extends _r {
|
|
@@ -5136,7 +5136,7 @@ var wr = class extends _r {
|
|
|
5136
5136
|
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();
|
|
5137
5137
|
}
|
|
5138
5138
|
};
|
|
5139
|
-
wr =
|
|
5139
|
+
wr = k([b("Node2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], wr);
|
|
5140
5140
|
//#endregion
|
|
5141
5141
|
//#region src/scene/2d/Camera2D.ts
|
|
5142
5142
|
var Tr = class extends wr {
|
|
@@ -5180,7 +5180,7 @@ var Tr = class extends wr {
|
|
|
5180
5180
|
return this.setZoom(this._zoom.x + e, this._zoom.y + t);
|
|
5181
5181
|
}
|
|
5182
5182
|
setZoom(e, t = e) {
|
|
5183
|
-
return this._zoom.set(
|
|
5183
|
+
return this._zoom.set(E(e, this._minZoom.x, this._maxZoom.x), E(t, this._minZoom.y, this._maxZoom.y)), this;
|
|
5184
5184
|
}
|
|
5185
5185
|
setZoomAtOrigin(e, t, n) {
|
|
5186
5186
|
let r;
|
|
@@ -5253,7 +5253,7 @@ var Tr = class extends wr {
|
|
|
5253
5253
|
});
|
|
5254
5254
|
}
|
|
5255
5255
|
_getZoomByWheel(e, t) {
|
|
5256
|
-
let n = e.ctrlKey &&
|
|
5256
|
+
let n = e.ctrlKey && Je ? 10 : 1, r = -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * n, i = Math.log(t) + r;
|
|
5257
5257
|
return Math.round(Math.exp(i) * 1e4) / 1e4;
|
|
5258
5258
|
}
|
|
5259
5259
|
_updateTransform() {
|
|
@@ -5283,16 +5283,16 @@ var Tr = class extends wr {
|
|
|
5283
5283
|
};
|
|
5284
5284
|
}
|
|
5285
5285
|
};
|
|
5286
|
-
|
|
5286
|
+
k([_({
|
|
5287
5287
|
internal: !0,
|
|
5288
5288
|
fallback: !1
|
|
5289
|
-
}),
|
|
5289
|
+
}), O("design:type", Boolean)], Tr.prototype, "spaceKey", void 0), k([_({
|
|
5290
5290
|
internal: !0,
|
|
5291
5291
|
fallback: !1
|
|
5292
|
-
}),
|
|
5292
|
+
}), O("design:type", Boolean)], Tr.prototype, "grabbing", void 0), Tr = k([b("Camera2D", {
|
|
5293
5293
|
processMode: "disabled",
|
|
5294
5294
|
renderMode: "disabled"
|
|
5295
|
-
}),
|
|
5295
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Tr);
|
|
5296
5296
|
//#endregion
|
|
5297
5297
|
//#region src/scene/2d/element/connectionRouter.ts
|
|
5298
5298
|
function Er(e, t) {
|
|
@@ -5442,7 +5442,7 @@ var Nr = {
|
|
|
5442
5442
|
function Pr(e) {
|
|
5443
5443
|
let t = new St();
|
|
5444
5444
|
if (e === "none") return t;
|
|
5445
|
-
let n =
|
|
5445
|
+
let n = Ae(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
|
|
5446
5446
|
Object.keys(Nr).forEach((e) => {
|
|
5447
5447
|
n[e] = n[e] ?? Nr[e];
|
|
5448
5448
|
});
|
|
@@ -5450,7 +5450,7 @@ function Pr(e) {
|
|
|
5450
5450
|
let r = n[e];
|
|
5451
5451
|
switch (e) {
|
|
5452
5452
|
case "hue-rotate":
|
|
5453
|
-
t.hueRotate(r *
|
|
5453
|
+
t.hueRotate(r * Ce);
|
|
5454
5454
|
break;
|
|
5455
5455
|
case "saturate":
|
|
5456
5456
|
t.saturate(r);
|
|
@@ -5494,11 +5494,11 @@ function Fr(e) {
|
|
|
5494
5494
|
}
|
|
5495
5495
|
//#endregion
|
|
5496
5496
|
//#region src/scene/effects/ColorAdjustEffect.ts
|
|
5497
|
-
var Ir,
|
|
5497
|
+
var Ir, W = class extends U {
|
|
5498
5498
|
static {
|
|
5499
5499
|
Ir = this;
|
|
5500
5500
|
}
|
|
5501
|
-
static material = new
|
|
5501
|
+
static material = new I({ gl: {
|
|
5502
5502
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5503
5503
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n c.rgb *= c.a;\n }\n gl_FragColor = c * alpha;\n}"
|
|
5504
5504
|
} });
|
|
@@ -5507,7 +5507,7 @@ var Ir, U = class extends H {
|
|
|
5507
5507
|
}
|
|
5508
5508
|
apply(e, t) {
|
|
5509
5509
|
t.redraw(e, () => {
|
|
5510
|
-
|
|
5510
|
+
L.draw(e, Ir.material, {
|
|
5511
5511
|
sampler: 0,
|
|
5512
5512
|
saturation: this.saturation,
|
|
5513
5513
|
contrast: this.contrast,
|
|
@@ -5521,14 +5521,14 @@ var Ir, U = class extends H {
|
|
|
5521
5521
|
});
|
|
5522
5522
|
}
|
|
5523
5523
|
};
|
|
5524
|
-
|
|
5524
|
+
k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "saturation", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "contrast", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "brightness", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "red", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "green", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "blue", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "alpha", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "gamma", void 0), W = Ir = k([b("ColorAdjustEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
|
|
5525
5525
|
//#endregion
|
|
5526
5526
|
//#region src/scene/effects/ColorFilterEffect.ts
|
|
5527
|
-
var Lr, Rr = class extends
|
|
5527
|
+
var Lr, Rr = class extends U {
|
|
5528
5528
|
static {
|
|
5529
5529
|
Lr = this;
|
|
5530
5530
|
}
|
|
5531
|
-
static material = new
|
|
5531
|
+
static material = new I({ gl: {
|
|
5532
5532
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5533
5533
|
fragment: "in vec2 vUv;\nuniform sampler2D sampler;\nuniform float m[20];\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n gl_FragColor = vec4(\n m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4] / 255.0,\n m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9] / 255.0,\n m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14] / 255.0,\n m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19] / 255.0\n );\n}"
|
|
5534
5534
|
} });
|
|
@@ -5545,13 +5545,13 @@ var Lr, Rr = class extends H {
|
|
|
5545
5545
|
}
|
|
5546
5546
|
apply(e, t) {
|
|
5547
5547
|
if (!this.filter) return;
|
|
5548
|
-
let n =
|
|
5548
|
+
let n = Ae(this.filter), r = this._colorMatrix.identity();
|
|
5549
5549
|
n.forEach(({ name: e, args: t }) => {
|
|
5550
5550
|
let n = t.map((e) => e.normalizedIntValue);
|
|
5551
5551
|
switch (e) {
|
|
5552
5552
|
case "hue-rotate":
|
|
5553
5553
|
case "hueRotate":
|
|
5554
|
-
r.hueRotate(n[0] *
|
|
5554
|
+
r.hueRotate(n[0] * Ce);
|
|
5555
5555
|
break;
|
|
5556
5556
|
case "saturate":
|
|
5557
5557
|
r.saturate(n[0]);
|
|
@@ -5576,21 +5576,21 @@ var Lr, Rr = class extends H {
|
|
|
5576
5576
|
break;
|
|
5577
5577
|
}
|
|
5578
5578
|
}), t.redraw(e, () => {
|
|
5579
|
-
|
|
5579
|
+
L.draw(e, Lr.material, {
|
|
5580
5580
|
sampler: 0,
|
|
5581
5581
|
m: r.toArray()
|
|
5582
5582
|
});
|
|
5583
5583
|
});
|
|
5584
5584
|
}
|
|
5585
5585
|
};
|
|
5586
|
-
|
|
5586
|
+
k([_(), O("design:type", String)], Rr.prototype, "filter", void 0), Rr = Lr = k([b("ColorFilterEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Rr);
|
|
5587
5587
|
//#endregion
|
|
5588
5588
|
//#region src/scene/effects/ColorOverlayEffect.ts
|
|
5589
|
-
var zr, Br = 50, Vr = class extends
|
|
5589
|
+
var zr, Br = 50, Vr = class extends U {
|
|
5590
5590
|
static {
|
|
5591
5591
|
zr = this;
|
|
5592
5592
|
}
|
|
5593
|
-
static material = new
|
|
5593
|
+
static material = new I({ gl: {
|
|
5594
5594
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5595
5595
|
fragment: `precision mediump float;
|
|
5596
5596
|
uniform sampler2D sampler;
|
|
@@ -5647,21 +5647,21 @@ void main(void) {
|
|
|
5647
5647
|
0,
|
|
5648
5648
|
0
|
|
5649
5649
|
]);
|
|
5650
|
-
|
|
5650
|
+
L.draw(e, zr.material, {
|
|
5651
5651
|
sampler: 0,
|
|
5652
5652
|
colors: t.slice(0, Br).flatMap((e) => e)
|
|
5653
5653
|
});
|
|
5654
5654
|
});
|
|
5655
5655
|
}
|
|
5656
5656
|
};
|
|
5657
|
-
|
|
5657
|
+
k([_({ default: () => [] }), O("design:type", Array)], Vr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Vr.prototype, "alpha", void 0), Vr = zr = k([b("ColorOverlayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Vr);
|
|
5658
5658
|
//#endregion
|
|
5659
5659
|
//#region src/scene/effects/ColorRemoveEffect.ts
|
|
5660
|
-
var Hr, Ur = class extends
|
|
5660
|
+
var Hr, Ur = class extends U {
|
|
5661
5661
|
static {
|
|
5662
5662
|
Hr = this;
|
|
5663
5663
|
}
|
|
5664
|
-
static material = new
|
|
5664
|
+
static material = new I({ gl: {
|
|
5665
5665
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5666
5666
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float epsilon;\nconst int MAX_COLORS = 50;\nuniform vec3 originalColors[MAX_COLORS];\n\nvoid main(void) {\n vec4 color = texture2D(sampler, vUv);\n\n for (int i = 0; i < MAX_COLORS; i++) {\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0) {\n break;\n }\n vec3 colorDiff = origColor - color.rgb;\n if (length(colorDiff) < epsilon) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n }\n\n gl_FragColor = color;\n}"
|
|
5667
5667
|
} });
|
|
@@ -5679,7 +5679,7 @@ var Hr, Ur = class extends H {
|
|
|
5679
5679
|
r.slice(0, 50).forEach((e, t) => {
|
|
5680
5680
|
n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
|
|
5681
5681
|
}), t.redraw(e, () => {
|
|
5682
|
-
|
|
5682
|
+
L.draw(e, Hr.material, {
|
|
5683
5683
|
sampler: 0,
|
|
5684
5684
|
epsilon: this.epsilon,
|
|
5685
5685
|
originalColors: n
|
|
@@ -5687,14 +5687,14 @@ var Hr, Ur = class extends H {
|
|
|
5687
5687
|
});
|
|
5688
5688
|
}
|
|
5689
5689
|
};
|
|
5690
|
-
|
|
5690
|
+
k([_({ default: () => [] }), O("design:type", Array)], Ur.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Ur.prototype, "epsilon", void 0), Ur = Hr = k([b("ColorRemoveEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ur);
|
|
5691
5691
|
//#endregion
|
|
5692
5692
|
//#region src/scene/effects/ColorReplaceEffect.ts
|
|
5693
|
-
var Wr, Gr = 50, Kr = class extends
|
|
5693
|
+
var Wr, Gr = 50, Kr = class extends U {
|
|
5694
5694
|
static {
|
|
5695
5695
|
Wr = this;
|
|
5696
5696
|
}
|
|
5697
|
-
static material = new
|
|
5697
|
+
static material = new I({ gl: {
|
|
5698
5698
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5699
5699
|
fragment: `varying vec2 vUv;
|
|
5700
5700
|
uniform sampler2D sampler;
|
|
@@ -5750,7 +5750,7 @@ void main(void) {
|
|
|
5750
5750
|
n.slice(0, Gr).forEach(([e, t], n) => {
|
|
5751
5751
|
i[n * 3] = e[0], i[n * 3 + 1] = e[1], i[n * 3 + 2] = e[2], a[n * 3] = t[0], a[n * 3 + 1] = t[1], a[n * 3 + 2] = t[2];
|
|
5752
5752
|
}), t.redraw(e, () => {
|
|
5753
|
-
|
|
5753
|
+
L.draw(e, Wr.material, {
|
|
5754
5754
|
sampler: 0,
|
|
5755
5755
|
epsilon: r,
|
|
5756
5756
|
originalColors: i,
|
|
@@ -5759,15 +5759,15 @@ void main(void) {
|
|
|
5759
5759
|
});
|
|
5760
5760
|
}
|
|
5761
5761
|
};
|
|
5762
|
-
|
|
5762
|
+
k([_({ default: () => [] }), O("design:type", Array)], Kr.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], Kr.prototype, "epsilon", void 0), Kr = Wr = k([b("ColorReplaceEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Kr);
|
|
5763
5763
|
//#endregion
|
|
5764
5764
|
//#region src/scene/effects/DrawboardEffect.frag?raw
|
|
5765
|
-
var qr = "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", Jr,
|
|
5765
|
+
var qr = "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", Jr, G = class extends U {
|
|
5766
5766
|
static {
|
|
5767
5767
|
Jr = this;
|
|
5768
5768
|
}
|
|
5769
5769
|
_watermark;
|
|
5770
|
-
static material = new
|
|
5770
|
+
static material = new I({ gl: {
|
|
5771
5771
|
vertex: "attribute vec2 position;\nin vec2 uv;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5772
5772
|
fragment: qr
|
|
5773
5773
|
} });
|
|
@@ -5818,7 +5818,7 @@ var qr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5818
5818
|
zoomedOut: this.dotColor ?? a.zoomedOut,
|
|
5819
5819
|
diff: this.dotZoomDiff ?? a.diff
|
|
5820
5820
|
};
|
|
5821
|
-
|
|
5821
|
+
L.draw(e, Jr.material, {
|
|
5822
5822
|
uTexture: 0,
|
|
5823
5823
|
inputSize: [t.width, t.height],
|
|
5824
5824
|
zoom: [n[0], n[4]],
|
|
@@ -5842,18 +5842,18 @@ var qr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5842
5842
|
});
|
|
5843
5843
|
}
|
|
5844
5844
|
};
|
|
5845
|
-
|
|
5845
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "checkerboard", void 0), k([_({ fallback: "grid" }), O("design:type", Object)], G.prototype, "checkerboardStyle", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "pixelGrid", void 0), k([_(), O("design:type", Number)], G.prototype, "dotBaseColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotZoomDiff", void 0), k([_(), O("design:type", String)], G.prototype, "watermark", void 0), k([_({ fallback: 100 }), O("design:type", Number)], G.prototype, "watermarkWidth", void 0), k([_({ fallback: .05 }), O("design:type", Number)], G.prototype, "watermarkAlpha", void 0), k([_({ fallback: .5236 }), O("design:type", Number)], G.prototype, "watermarkRotation", void 0), G = Jr = k([b("DrawboardEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], G);
|
|
5846
5846
|
//#endregion
|
|
5847
5847
|
//#region src/scene/effects/GaussianBlurEffect.ts
|
|
5848
|
-
var Yr, Xr = "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}", Zr = class extends
|
|
5848
|
+
var Yr, Xr = "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}", Zr = class extends U {
|
|
5849
5849
|
static {
|
|
5850
5850
|
Yr = this;
|
|
5851
5851
|
}
|
|
5852
|
-
static materialX = new
|
|
5852
|
+
static materialX = new I({ gl: {
|
|
5853
5853
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);\n vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);\n vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);\n vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);\n vUv[4] = uv + vec2(0.0 * uStrength, 0.0);\n vUv[5] = uv + vec2(1.0 * uStrength, 0.0);\n vUv[6] = uv + vec2(2.0 * uStrength, 0.0);\n vUv[7] = uv + vec2(3.0 * uStrength, 0.0);\n vUv[8] = uv + vec2(4.0 * uStrength, 0.0);\n}",
|
|
5854
5854
|
fragment: Xr
|
|
5855
5855
|
} });
|
|
5856
|
-
static materialY = new
|
|
5856
|
+
static materialY = new I({ gl: {
|
|
5857
5857
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(0.0, -4.0 * uStrength);\n vUv[1] = uv + vec2(0.0, -3.0 * uStrength);\n vUv[2] = uv + vec2(0.0, -2.0 * uStrength);\n vUv[3] = uv + vec2(0.0, -1.0 * uStrength);\n vUv[4] = uv + vec2(0.0, 0.0 * uStrength);\n vUv[5] = uv + vec2(0.0, 1.0 * uStrength);\n vUv[6] = uv + vec2(0.0, 2.0 * uStrength);\n vUv[7] = uv + vec2(0.0, 3.0 * uStrength);\n vUv[8] = uv + vec2(0.0, 4.0 * uStrength);\n}",
|
|
5858
5858
|
fragment: Xr
|
|
5859
5859
|
} });
|
|
@@ -5863,39 +5863,39 @@ var Yr, Xr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void
|
|
|
5863
5863
|
apply(e, t) {
|
|
5864
5864
|
let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
|
|
5865
5865
|
for (let r = 0; r < i; r++) t.redraw(e, () => {
|
|
5866
|
-
|
|
5866
|
+
L.draw(e, Yr.materialX, {
|
|
5867
5867
|
sampler: 0,
|
|
5868
5868
|
uStrength: n * (this.strength / i)
|
|
5869
5869
|
});
|
|
5870
5870
|
});
|
|
5871
5871
|
for (let n = 0; n < i; n++) t.redraw(e, () => {
|
|
5872
|
-
|
|
5872
|
+
L.draw(e, Yr.materialY, {
|
|
5873
5873
|
sampler: 0,
|
|
5874
5874
|
uStrength: r * (this.strength / i)
|
|
5875
5875
|
});
|
|
5876
5876
|
});
|
|
5877
5877
|
}
|
|
5878
5878
|
};
|
|
5879
|
-
|
|
5879
|
+
k([_({ fallback: 4 }), O("design:type", Number)], Zr.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], Zr.prototype, "quality", void 0), Zr = Yr = k([b("GaussianBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Zr);
|
|
5880
5880
|
//#endregion
|
|
5881
5881
|
//#region src/scene/effects/DropShadowEffect.ts
|
|
5882
|
-
var Qr, $r = class extends
|
|
5882
|
+
var Qr, $r = class extends U {
|
|
5883
5883
|
static {
|
|
5884
5884
|
Qr = this;
|
|
5885
5885
|
}
|
|
5886
|
-
static material = new
|
|
5886
|
+
static material = new I({ gl: {
|
|
5887
5887
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5888
5888
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float uAlpha;\nuniform vec3 uColor;\nuniform vec2 uOffset;\nuniform vec4 uInputSize;\n\nvoid main(void) {\n vec4 sample = texture2D(sampler, vUv + uOffset * uInputSize.zw);\n sample.rgb = uColor.rgb * sample.a;\n sample *= uAlpha;\n gl_FragColor = sample;\n}"
|
|
5889
5889
|
} });
|
|
5890
5890
|
blurEffect = new Zr();
|
|
5891
|
-
viewport3 = new
|
|
5891
|
+
viewport3 = new H();
|
|
5892
5892
|
_color = new T();
|
|
5893
5893
|
constructor(e, t = []) {
|
|
5894
5894
|
super(), this.setProperties(e).append(t);
|
|
5895
5895
|
}
|
|
5896
5896
|
apply(e, t) {
|
|
5897
5897
|
this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
|
|
5898
|
-
this._color.value = this.color,
|
|
5898
|
+
this._color.value = this.color, L.draw(e, Qr.material, {
|
|
5899
5899
|
sampler: 0,
|
|
5900
5900
|
uAlpha: this._color.a,
|
|
5901
5901
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -5908,18 +5908,18 @@ var Qr, $r = class extends H {
|
|
|
5908
5908
|
]
|
|
5909
5909
|
});
|
|
5910
5910
|
}), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
|
|
5911
|
-
this.viewport3.texture.activate(e, 1),
|
|
5911
|
+
this.viewport3.texture.activate(e, 1), L.draw(e, Zn.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, Zn.instance, { sampler: 0 }), e.texture.unbind(1);
|
|
5912
5912
|
});
|
|
5913
5913
|
}
|
|
5914
5914
|
};
|
|
5915
|
-
|
|
5915
|
+
k([_({ fallback: "#000000FF" }), O("design:type", Object)], $r.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], $r.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], $r.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], $r.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], $r.prototype, "shadowOnly", void 0), $r = Qr = k([b("DropShadowEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], $r);
|
|
5916
5916
|
//#endregion
|
|
5917
5917
|
//#region src/scene/effects/EmbossEffect.ts
|
|
5918
|
-
var ei, ti = class extends
|
|
5918
|
+
var ei, ti = class extends U {
|
|
5919
5919
|
static {
|
|
5920
5920
|
ei = this;
|
|
5921
5921
|
}
|
|
5922
|
-
static material = new
|
|
5922
|
+
static material = new I({ gl: {
|
|
5923
5923
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5924
5924
|
fragment: "precision mediump float;\nuniform sampler2D sampler;\nuniform vec4 inputSize;\nuniform float strength;\nvarying vec2 vUv;\n\nvoid main(void) {\n vec2 onePixel = inputSize.zw;\n vec4 color;\n color.rgb = vec3(0.5);\n color -= texture2D(sampler, vUv - onePixel) * strength;\n color += texture2D(sampler, vUv + onePixel) * strength;\n color.rgb = vec3((color.r + color.g + color.b) / 3.0);\n float alpha = texture2D(sampler, vUv).a;\n gl_FragColor = vec4(color.rgb * alpha, alpha);\n}"
|
|
5925
5925
|
} });
|
|
@@ -5928,7 +5928,7 @@ var ei, ti = class extends H {
|
|
|
5928
5928
|
}
|
|
5929
5929
|
apply(e, t) {
|
|
5930
5930
|
t.redraw(e, () => {
|
|
5931
|
-
|
|
5931
|
+
L.draw(e, ei.material, {
|
|
5932
5932
|
sampler: 0,
|
|
5933
5933
|
strength: this.strength,
|
|
5934
5934
|
inputSize: [
|
|
@@ -5941,14 +5941,14 @@ var ei, ti = class extends H {
|
|
|
5941
5941
|
});
|
|
5942
5942
|
}
|
|
5943
5943
|
};
|
|
5944
|
-
|
|
5944
|
+
k([_({ fallback: 5 }), O("design:type", Number)], ti.prototype, "strength", void 0), ti = ei = k([b("EmbossEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ti);
|
|
5945
5945
|
//#endregion
|
|
5946
5946
|
//#region src/scene/effects/GlitchEffect.ts
|
|
5947
|
-
var ni,
|
|
5947
|
+
var ni, K = class extends U {
|
|
5948
5948
|
static {
|
|
5949
5949
|
ni = this;
|
|
5950
5950
|
}
|
|
5951
|
-
static material = new
|
|
5951
|
+
static material = new I({ gl: {
|
|
5952
5952
|
vertex: "in vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5953
5953
|
fragment: "\nin vec2 vUv;\nuniform sampler2D sampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void) {\n vec2 coord = (vUv * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vUv + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if (coord.x > filterClamp.z) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if (coord.x < filterClamp.x) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if (coord.y > filterClamp.w) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if (coord.y < filterClamp.y) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture(sampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture(sampler, coord).a;\n}"
|
|
5954
5954
|
} });
|
|
@@ -5961,7 +5961,7 @@ var ni, G = class extends H {
|
|
|
5961
5961
|
super(), this.setProperties(e).append(t);
|
|
5962
5962
|
let n = S(4, this.sampleSize);
|
|
5963
5963
|
if (!n) throw Error("GlitchEffect requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
5964
|
-
this._canvas = n, this._texture = new
|
|
5964
|
+
this._canvas = n, this._texture = new z(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
|
|
5965
5965
|
}
|
|
5966
5966
|
redraw() {
|
|
5967
5967
|
let e = this.sampleSize, t = this._texture, n = this._canvas.getContext("2d");
|
|
@@ -5978,7 +5978,7 @@ var ni, G = class extends H {
|
|
|
5978
5978
|
this._needsRedraw || (this._needsRedraw = !0, this.redraw());
|
|
5979
5979
|
let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
|
|
5980
5980
|
t.redraw(e, () => {
|
|
5981
|
-
this._texture.activate(e, 1),
|
|
5981
|
+
this._texture.activate(e, 1), L.draw(e, ni.material, {
|
|
5982
5982
|
sampler: 0,
|
|
5983
5983
|
filterClamp: [
|
|
5984
5984
|
0,
|
|
@@ -6007,14 +6007,14 @@ var ni, G = class extends H {
|
|
|
6007
6007
|
});
|
|
6008
6008
|
}
|
|
6009
6009
|
};
|
|
6010
|
-
|
|
6010
|
+
k([_({ fallback: 10 }), O("design:type", Number)], K.prototype, "slices", void 0), k([_({ fallback: 512 }), O("design:type", Number)], K.prototype, "sampleSize", void 0), k([_({ fallback: 100 }), O("design:type", Number)], K.prototype, "offset", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "direction", void 0), k([_({ fallback: 2 }), O("design:type", Number)], K.prototype, "fillMode", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "seed", void 0), k([_({ default: () => [2, 2] }), O("design:type", Array)], K.prototype, "red", void 0), k([_({ default: () => [-10, 4] }), O("design:type", Array)], K.prototype, "green", void 0), k([_({ default: () => [10, -4] }), O("design:type", Array)], K.prototype, "blue", void 0), K = ni = k([b("GlitchEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
|
|
6011
6011
|
//#endregion
|
|
6012
6012
|
//#region src/scene/effects/GodrayEffect.ts
|
|
6013
|
-
var ri, ii = "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}",
|
|
6013
|
+
var ri, ii = "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}", q = class extends U {
|
|
6014
6014
|
static {
|
|
6015
6015
|
ri = this;
|
|
6016
6016
|
}
|
|
6017
|
-
static material = new
|
|
6017
|
+
static material = new I({ gl: {
|
|
6018
6018
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6019
6019
|
fragment: `precision highp float;
|
|
6020
6020
|
varying vec2 vUv;
|
|
@@ -6066,7 +6066,7 @@ void main(void) {
|
|
|
6066
6066
|
apply(e, t) {
|
|
6067
6067
|
let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
|
|
6068
6068
|
t.redraw(e, () => {
|
|
6069
|
-
|
|
6069
|
+
L.draw(e, ri.material, {
|
|
6070
6070
|
sampler: 0,
|
|
6071
6071
|
uDimensions: [t.width, t.height],
|
|
6072
6072
|
uParallel: +!!this.parallel,
|
|
@@ -6088,13 +6088,13 @@ void main(void) {
|
|
|
6088
6088
|
});
|
|
6089
6089
|
}
|
|
6090
6090
|
};
|
|
6091
|
-
|
|
6091
|
+
k([_({ fallback: 0 }), O("design:type", Number)], q.prototype, "time", void 0), k([_({ fallback: 30 }), O("design:type", Number)], q.prototype, "angle", void 0), k([_({ fallback: .5 }), O("design:type", Number)], q.prototype, "gain", void 0), k([_({ fallback: 2.5 }), O("design:type", Number)], q.prototype, "lacunarity", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], q.prototype, "parallel", void 0), k([_({ default: () => [0, 0] }), O("design:type", Array)], q.prototype, "center", void 0), k([_({ fallback: 1 }), O("design:type", Number)], q.prototype, "alpha", void 0), q = ri = k([b("GodrayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
|
|
6092
6092
|
//#endregion
|
|
6093
6093
|
//#region src/scene/effects/KawaseBlurEffect.ts
|
|
6094
|
-
var ai = "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}", oi = "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}", si = class extends
|
|
6094
|
+
var ai = "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}", oi = "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}", si = class extends U {
|
|
6095
6095
|
_kernels = [0];
|
|
6096
6096
|
constructor(e, t = []) {
|
|
6097
|
-
super(), this.material = new
|
|
6097
|
+
super(), this.material = new I({ gl: {
|
|
6098
6098
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6099
6099
|
fragment: e?.clamp ? oi : ai
|
|
6100
6100
|
} }), this.setProperties(e).append(t), this._generateKernels();
|
|
@@ -6120,7 +6120,7 @@ var ai = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6120
6120
|
this._kernels.forEach((i) => {
|
|
6121
6121
|
let a = i + .5;
|
|
6122
6122
|
t.redraw(e, () => {
|
|
6123
|
-
|
|
6123
|
+
L.draw(e, this.material, {
|
|
6124
6124
|
sampler: 0,
|
|
6125
6125
|
uOffset: [a * n, a * r],
|
|
6126
6126
|
uInputClamp: [
|
|
@@ -6134,14 +6134,14 @@ var ai = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6134
6134
|
});
|
|
6135
6135
|
}
|
|
6136
6136
|
};
|
|
6137
|
-
|
|
6137
|
+
k([_({ fallback: 4 }), O("design:type", Number)], si.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], si.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], si.prototype, "pixelSize", void 0), si = k([b("KawaseBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], si);
|
|
6138
6138
|
//#endregion
|
|
6139
6139
|
//#region src/scene/effects/MaskEffect.ts
|
|
6140
|
-
var ci, li = class extends
|
|
6140
|
+
var ci, li = class extends U {
|
|
6141
6141
|
static {
|
|
6142
6142
|
ci = this;
|
|
6143
6143
|
}
|
|
6144
|
-
static material = new
|
|
6144
|
+
static material = new I({ gl: {
|
|
6145
6145
|
vertex: "attribute vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6146
6146
|
fragment: "in vec2 vUv;\n\nuniform sampler2D sampler;\nuniform sampler2D mask;\nuniform float rotation;\n\nvec2 rotateUV(vec2 uv, float angle) {\n uv -= 0.5;\n float cosAngle = cos(angle);\n float sinAngle = sin(angle);\n mat2 rotationMatrix = mat2(\n cosAngle, -sinAngle,\n sinAngle, cosAngle\n );\n uv = rotationMatrix * uv;\n uv += 0.5;\n return uv;\n}\n\nvoid main(void) {\n vec4 color = texture(sampler, vUv);\n vec4 maskColor = texture(mask, rotateUV(vUv, rotation));\n gl_FragColor = mix(vec4(0.), color, maskColor.a);\n}"
|
|
6147
6147
|
} });
|
|
@@ -6161,7 +6161,7 @@ var ci, li = class extends H {
|
|
|
6161
6161
|
}
|
|
6162
6162
|
apply(e, t, n) {
|
|
6163
6163
|
this.texture && t.redraw(e, () => {
|
|
6164
|
-
this.texture.activate(e, 1),
|
|
6164
|
+
this.texture.activate(e, 1), L.draw(e, ci.material, {
|
|
6165
6165
|
sampler: 0,
|
|
6166
6166
|
mask: 1,
|
|
6167
6167
|
rotation: n.target?.globalRotation ?? 0
|
|
@@ -6169,10 +6169,10 @@ var ci, li = class extends H {
|
|
|
6169
6169
|
});
|
|
6170
6170
|
}
|
|
6171
6171
|
};
|
|
6172
|
-
|
|
6172
|
+
k([_({ fallback: "" }), O("design:type", String)], li.prototype, "image", void 0), li = ci = k([b("MaskEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], li);
|
|
6173
6173
|
//#endregion
|
|
6174
6174
|
//#region src/scene/effects/OutlineEffect.ts
|
|
6175
|
-
var ui, di = "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}",
|
|
6175
|
+
var ui, di = "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}", J = class extends U {
|
|
6176
6176
|
static {
|
|
6177
6177
|
ui = this;
|
|
6178
6178
|
}
|
|
@@ -6183,14 +6183,14 @@ var ui, di = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6183
6183
|
}
|
|
6184
6184
|
_color = new T();
|
|
6185
6185
|
constructor(e, t = []) {
|
|
6186
|
-
super(), this.setProperties(e).append(t), this.material = new
|
|
6186
|
+
super(), this.setProperties(e).append(t), this.material = new I({ gl: {
|
|
6187
6187
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6188
6188
|
fragment: di.replace(/\{ANGLE_STEP\}/, ui.getAngleStep(this.quality).toFixed(7))
|
|
6189
6189
|
} });
|
|
6190
6190
|
}
|
|
6191
6191
|
apply(e, t) {
|
|
6192
6192
|
t.redraw(e, () => {
|
|
6193
|
-
this._color.value = this.color,
|
|
6193
|
+
this._color.value = this.color, L.draw(e, this.material, {
|
|
6194
6194
|
sampler: 0,
|
|
6195
6195
|
uThickness: [this.width / t.width, this.width / t.height],
|
|
6196
6196
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -6207,14 +6207,14 @@ var ui, di = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6207
6207
|
});
|
|
6208
6208
|
}
|
|
6209
6209
|
};
|
|
6210
|
-
|
|
6210
|
+
k([_({ fallback: "#000000ff" }), O("design:type", Object)], J.prototype, "color", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", String)], J.prototype, "style", void 0), k([_(), O("design:type", Object)], J.prototype, "image", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "opacity", void 0), k([_({ fallback: .1 }), O("design:type", Number)], J.prototype, "quality", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], J.prototype, "knockout", void 0), J = ui = k([b("OutlineEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
|
|
6211
6211
|
//#endregion
|
|
6212
6212
|
//#region src/scene/effects/PixelateEffect.ts
|
|
6213
|
-
var fi, pi = class extends
|
|
6213
|
+
var fi, pi = class extends U {
|
|
6214
6214
|
static {
|
|
6215
6215
|
fi = this;
|
|
6216
6216
|
}
|
|
6217
|
-
static material = new
|
|
6217
|
+
static material = new I({ gl: {
|
|
6218
6218
|
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}",
|
|
6219
6219
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform vec2 step;\n\nvoid main(void) {\n vec2 uv = vUv;\n uv = floor((uv - offset) / step) * step + offset + step / 2.0;\n gl_FragColor = texture2D(sampler, uv);\n}"
|
|
6220
6220
|
} });
|
|
@@ -6228,18 +6228,18 @@ var fi, pi = class extends H {
|
|
|
6228
6228
|
offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
|
|
6229
6229
|
step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
|
|
6230
6230
|
};
|
|
6231
|
-
|
|
6231
|
+
L.draw(e, fi.material, a);
|
|
6232
6232
|
});
|
|
6233
6233
|
}
|
|
6234
6234
|
};
|
|
6235
|
-
|
|
6235
|
+
k([_({ fallback: 10 }), O("design:type", Number)], pi.prototype, "strength", void 0), pi = fi = k([b("PixelateEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], pi);
|
|
6236
6236
|
//#endregion
|
|
6237
6237
|
//#region src/scene/effects/ZoomBlurEffect.ts
|
|
6238
|
-
var mi, hi = class extends
|
|
6238
|
+
var mi, hi = class extends U {
|
|
6239
6239
|
static {
|
|
6240
6240
|
mi = this;
|
|
6241
6241
|
}
|
|
6242
|
-
static material = new
|
|
6242
|
+
static material = new I({ gl: {
|
|
6243
6243
|
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}",
|
|
6244
6244
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec4 uInputSize;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n float minGradient = uInnerRadius * 0.3;\n float innerRadius1 = (uInnerRadius + minGradient * 0.5) / uInputSize.x;\n\n float gradient = uRadius * 0.3;\n float radius1 = (uRadius - gradient * 0.5) / uInputSize.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / uInputSize.xy - vUv);\n float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x));\n\n float strength1 = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius1) {\n delta = innerRadius1 - dist;\n gap = minGradient;\n } else if (radius1 >= 0.0 && dist > radius1) { // radius1 < 0 means it's infinity\n delta = dist - radius1;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / uInputSize.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength1 *= delta;\n if (countLimit < 1.0) {\n gl_FragColor = texture2D(sampler, vUv);\n return;\n }\n }\n\n float offset = rand(vUv, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength1;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vUv + dir * percent;\n color += texture2D(sampler, p) * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n\n gl_FragColor = color;\n}"
|
|
6245
6245
|
} });
|
|
@@ -6248,7 +6248,7 @@ var mi, hi = class extends H {
|
|
|
6248
6248
|
}
|
|
6249
6249
|
apply(e, t) {
|
|
6250
6250
|
t.redraw(e, () => {
|
|
6251
|
-
|
|
6251
|
+
L.draw(e, mi.material, {
|
|
6252
6252
|
sampler: 0,
|
|
6253
6253
|
uCenter: [t.width / 2, t.height / 2],
|
|
6254
6254
|
uInnerRadius: this.innerRadius,
|
|
@@ -6264,7 +6264,7 @@ var mi, hi = class extends H {
|
|
|
6264
6264
|
});
|
|
6265
6265
|
}
|
|
6266
6266
|
};
|
|
6267
|
-
|
|
6267
|
+
k([_(), O("design:type", Array)], hi.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], hi.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], hi.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], hi.prototype, "strength", void 0), hi = mi = k([b("ZoomBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], hi);
|
|
6268
6268
|
//#endregion
|
|
6269
6269
|
//#region src/scene/2d/element/utils.ts
|
|
6270
6270
|
function gi(e, t) {
|
|
@@ -6289,7 +6289,7 @@ function gi(e, t) {
|
|
|
6289
6289
|
}
|
|
6290
6290
|
//#endregion
|
|
6291
6291
|
//#region src/scene/2d/element/Element2DFill.ts
|
|
6292
|
-
var
|
|
6292
|
+
var Y = class extends C {
|
|
6293
6293
|
_parent;
|
|
6294
6294
|
texture;
|
|
6295
6295
|
animatedTexture;
|
|
@@ -6384,10 +6384,10 @@ var J = class extends C {
|
|
|
6384
6384
|
this.updateFrameIndex();
|
|
6385
6385
|
}
|
|
6386
6386
|
};
|
|
6387
|
-
|
|
6387
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Y.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Y.prototype, "color", void 0), k([_(), O("design:type", Object)], Y.prototype, "image", void 0), k([_(), O("design:type", Object)], Y.prototype, "linearGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "radialGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "cropRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "stretchRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "dpi", void 0), k([_(), O("design:type", Object)], Y.prototype, "rotateWithShape", void 0), k([_(), O("design:type", Object)], Y.prototype, "tile", void 0), k([_(), O("design:type", Object)], Y.prototype, "opacity", void 0);
|
|
6388
6388
|
//#endregion
|
|
6389
6389
|
//#region src/scene/2d/element/Element2DBackground.ts
|
|
6390
|
-
var _i = class extends
|
|
6390
|
+
var _i = class extends Y {
|
|
6391
6391
|
setProperties(e) {
|
|
6392
6392
|
return super._setProperties(d(e) ? void 0 : f(e));
|
|
6393
6393
|
}
|
|
@@ -6399,7 +6399,7 @@ var _i = class extends J {
|
|
|
6399
6399
|
}
|
|
6400
6400
|
}
|
|
6401
6401
|
};
|
|
6402
|
-
|
|
6402
|
+
k([_(), O("design:type", Object)], _i.prototype, "fillWithShape", void 0);
|
|
6403
6403
|
//#endregion
|
|
6404
6404
|
//#region src/scene/2d/element/Element2DChart.ts
|
|
6405
6405
|
var vi;
|
|
@@ -6429,7 +6429,7 @@ function bi(e) {
|
|
|
6429
6429
|
};
|
|
6430
6430
|
}
|
|
6431
6431
|
}
|
|
6432
|
-
var
|
|
6432
|
+
var X = class extends C {
|
|
6433
6433
|
_parent;
|
|
6434
6434
|
_instance;
|
|
6435
6435
|
_container;
|
|
@@ -6565,7 +6565,7 @@ var Y = class extends C {
|
|
|
6565
6565
|
this._teardown();
|
|
6566
6566
|
}
|
|
6567
6567
|
};
|
|
6568
|
-
|
|
6568
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], X.prototype, "enabled", void 0), k([_({ fallback: "column" }), O("design:type", Object)], X.prototype, "type", void 0), k([_(), O("design:type", Object)], X.prototype, "grouping", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "categories", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "series", void 0), k([_(), O("design:type", Object)], X.prototype, "title", void 0), k([_(), O("design:type", Object)], X.prototype, "legend", void 0), k([_(), O("design:type", Object)], X.prototype, "categoryAxis", void 0), k([_(), O("design:type", Object)], X.prototype, "valueAxis", void 0);
|
|
6569
6569
|
//#endregion
|
|
6570
6570
|
//#region src/scene/2d/element/Element2DConnection.ts
|
|
6571
6571
|
var xi = class extends C {
|
|
@@ -6642,7 +6642,7 @@ var xi = class extends C {
|
|
|
6642
6642
|
return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Dr(this.mode, e ?? t, t ?? e)), this._routePath;
|
|
6643
6643
|
}
|
|
6644
6644
|
};
|
|
6645
|
-
|
|
6645
|
+
k([_(), O("design:type", Object)], xi.prototype, "start", void 0), k([_(), O("design:type", Object)], xi.prototype, "end", void 0), k([_({ fallback: "straight" }), O("design:type", Object)], xi.prototype, "mode", void 0), k([_({ fallback: .5 }), O("design:type", Number)], xi.prototype, "labelPosition", void 0);
|
|
6646
6646
|
function Si(e, t) {
|
|
6647
6647
|
if (!t) return e;
|
|
6648
6648
|
let n = Math.cos(t), r = Math.sin(t);
|
|
@@ -6692,18 +6692,30 @@ function Di(e) {
|
|
|
6692
6692
|
};
|
|
6693
6693
|
}
|
|
6694
6694
|
function Oi(e, t, n, r, i = {}) {
|
|
6695
|
-
let a = Math.max(1, Math.round(n)), o = Math.max(1, Math.round(r)), s =
|
|
6696
|
-
for (let
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6695
|
+
let a = Math.max(1, Math.round(n)), o = Math.max(1, Math.round(r)), s = 0;
|
|
6696
|
+
for (let e of t) {
|
|
6697
|
+
e.outline?.width && e.outline.color && (s = Math.max(s, e.outline.width));
|
|
6698
|
+
let t = Di(e.transform);
|
|
6699
|
+
s = Math.max(s, Math.abs(t.x), Math.abs(t.y));
|
|
6700
|
+
}
|
|
6701
|
+
s = Math.min(Math.ceil(s), Math.floor(Math.min(a, o) * .2));
|
|
6702
|
+
let c = e;
|
|
6703
|
+
if (s > 0) {
|
|
6704
|
+
let t = S(a, o);
|
|
6705
|
+
Ci(t).drawImage(e, s, s, Math.max(1, a - s * 2), Math.max(1, o - s * 2)), c = t;
|
|
6706
|
+
}
|
|
6707
|
+
let l = S(a, o), u = Ci(l);
|
|
6708
|
+
for (let e of t) {
|
|
6709
|
+
let t = c;
|
|
6710
|
+
e.fill && (e.fill.color || e.fill.linearGradient || e.fill.image) && (t = Ti(t, a, o, e.fill, i)), e.outline?.width && e.outline.color && (t = Ei(t, a, o, e.outline.width, e.outline.color));
|
|
6711
|
+
let { x: n, y: r } = Di(e.transform);
|
|
6712
|
+
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();
|
|
6713
|
+
}
|
|
6714
|
+
return l;
|
|
6703
6715
|
}
|
|
6704
6716
|
//#endregion
|
|
6705
6717
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
6706
|
-
var ki = class extends
|
|
6718
|
+
var ki = class extends Y {
|
|
6707
6719
|
_sourceCanvas;
|
|
6708
6720
|
_sourceImage;
|
|
6709
6721
|
setProperties(e) {
|
|
@@ -6730,7 +6742,7 @@ var ki = class extends J {
|
|
|
6730
6742
|
let e = await this._resolveSourceCanvas();
|
|
6731
6743
|
if (!e) return;
|
|
6732
6744
|
let t = e.width, n = e.height, r = await this._resolvePatterns(), i = Oi(e, this.effects, t, n, r);
|
|
6733
|
-
this.texture = new
|
|
6745
|
+
this.texture = new z({
|
|
6734
6746
|
source: i,
|
|
6735
6747
|
width: t,
|
|
6736
6748
|
height: n,
|
|
@@ -6744,7 +6756,7 @@ var ki = class extends J {
|
|
|
6744
6756
|
if (!n || d(n) || e[n]) continue;
|
|
6745
6757
|
let r = await $.loadBy(`${n}#mc-foreground-pattern`, async () => {
|
|
6746
6758
|
let e = await $.fetchImageBitmap(n), t = this._snapshot(e);
|
|
6747
|
-
return
|
|
6759
|
+
return Pe && e instanceof ImageBitmap && e.close(), t;
|
|
6748
6760
|
});
|
|
6749
6761
|
r && (e[n] = r);
|
|
6750
6762
|
}
|
|
@@ -6755,7 +6767,7 @@ var ki = class extends J {
|
|
|
6755
6767
|
if (d(this.image) || this.image === "viewport") return;
|
|
6756
6768
|
let e = this.image, t = await $.loadBy(`${e}#mc-foreground-source`, async () => {
|
|
6757
6769
|
let t = await $.fetchImageBitmap(e), n = this._snapshot(t);
|
|
6758
|
-
return
|
|
6770
|
+
return Pe && t instanceof ImageBitmap && t.close(), n;
|
|
6759
6771
|
});
|
|
6760
6772
|
return this._sourceImage === e && t && (this._sourceCanvas = t), t;
|
|
6761
6773
|
}
|
|
@@ -6764,14 +6776,14 @@ var ki = class extends J {
|
|
|
6764
6776
|
if (!(!r || !i)) return i.drawImage(e, 0, 0, t, n), r;
|
|
6765
6777
|
}
|
|
6766
6778
|
};
|
|
6767
|
-
|
|
6779
|
+
k([_(), O("design:type", Object)], ki.prototype, "fillWithShape", void 0), k([_(), O("design:type", Array)], ki.prototype, "effects", void 0);
|
|
6768
6780
|
//#endregion
|
|
6769
6781
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
6770
6782
|
var Ai = {
|
|
6771
6783
|
sm: 4,
|
|
6772
6784
|
md: 6,
|
|
6773
6785
|
lg: 8
|
|
6774
|
-
}, ji = class extends
|
|
6786
|
+
}, ji = class extends Y {
|
|
6775
6787
|
setProperties(e) {
|
|
6776
6788
|
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
6777
6789
|
}
|
|
@@ -6820,7 +6832,7 @@ var Ai = {
|
|
|
6820
6832
|
ee.fillStyle = i, ee.moveTo(e.x, e.y).lineTo(p + h, m + g).lineTo(p - h, m - g).closePath().fill();
|
|
6821
6833
|
}
|
|
6822
6834
|
};
|
|
6823
|
-
|
|
6835
|
+
k([_(), O("design:type", Object)], ji.prototype, "color", void 0), k([_(), O("design:type", Object)], ji.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], ji.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], ji.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], ji.prototype, "lineJoin", void 0), k([_(), O("design:type", Object)], ji.prototype, "headEnd", void 0), k([_(), O("design:type", Object)], ji.prototype, "tailEnd", void 0);
|
|
6824
6836
|
//#endregion
|
|
6825
6837
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
6826
6838
|
var Mi = class extends C {
|
|
@@ -6847,7 +6859,7 @@ var Mi = class extends C {
|
|
|
6847
6859
|
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new $r({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
6848
6860
|
}
|
|
6849
6861
|
};
|
|
6850
|
-
|
|
6862
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Mi.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], Mi.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Mi.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Mi.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Mi.prototype, "offsetX", void 0);
|
|
6851
6863
|
//#endregion
|
|
6852
6864
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
6853
6865
|
var Ni = class extends C {
|
|
@@ -6909,8 +6921,8 @@ var Ni = class extends C {
|
|
|
6909
6921
|
_updatePath2DSet() {
|
|
6910
6922
|
let e;
|
|
6911
6923
|
if (this.svg) {
|
|
6912
|
-
let t =
|
|
6913
|
-
this._path2DSet =
|
|
6924
|
+
let t = fe(this.svg);
|
|
6925
|
+
this._path2DSet = pe(t), e = this._path2DSet.viewBox;
|
|
6914
6926
|
} else this._path2DSet.paths.length = 0, this.paths?.forEach((e, t) => {
|
|
6915
6927
|
let { data: n, ...r } = e, i = new le();
|
|
6916
6928
|
i.style = r, i.addData(n), this._path2DSet.paths[t] = i;
|
|
@@ -6948,7 +6960,7 @@ var Ni = class extends C {
|
|
|
6948
6960
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
6949
6961
|
}
|
|
6950
6962
|
};
|
|
6951
|
-
|
|
6963
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Ni.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Ni.prototype, "preset", void 0), k([_(), O("design:type", Object)], Ni.prototype, "svg", void 0), k([_(), O("design:type", Object)], Ni.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], Ni.prototype, "paths", void 0), k([_(), O("design:type", Object)], Ni.prototype, "connectionPoints", void 0);
|
|
6952
6964
|
//#endregion
|
|
6953
6965
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
6954
6966
|
var Pi = class extends w {
|
|
@@ -7025,7 +7037,7 @@ var Ii = 100, Li = 40, Ri = class extends C {
|
|
|
7025
7037
|
}, r = `${JSON.stringify(e)}|${n.left},${n.top},${n.width},${n.height}`;
|
|
7026
7038
|
if (this._cellNodes.has(t) && this._cellSnapshots.get(t) === r) continue;
|
|
7027
7039
|
let i = this._cellNodes.get(t);
|
|
7028
|
-
i || (i =
|
|
7040
|
+
i || (i = B.parse({ is: "Element2D" }, "Element2D"), this._parent.appendChild(i, "back"), this._cellNodes.set(t, i)), this._applyCell(i, e, n), this._cellSnapshots.set(t, r);
|
|
7029
7041
|
}
|
|
7030
7042
|
for (let [e, t] of this._cellNodes) s.has(e) || (this._parent.removeChild(t), t.destroy(), this._cellNodes.delete(e), this._cellSnapshots.delete(e));
|
|
7031
7043
|
this._parent.requestDraw();
|
|
@@ -7037,7 +7049,7 @@ var Ii = 100, Li = 40, Ri = class extends C {
|
|
|
7037
7049
|
}, e.background = t.background;
|
|
7038
7050
|
for (let t of [...e.getChildren(!0)]) e.removeChild(t), t.destroy();
|
|
7039
7051
|
t.children?.forEach((t) => {
|
|
7040
|
-
e.appendChild(
|
|
7052
|
+
e.appendChild(B.parse(t, "Element2D"));
|
|
7041
7053
|
});
|
|
7042
7054
|
}
|
|
7043
7055
|
_clearCells() {
|
|
@@ -7048,10 +7060,10 @@ var Ii = 100, Li = 40, Ri = class extends C {
|
|
|
7048
7060
|
this._clearCells();
|
|
7049
7061
|
}
|
|
7050
7062
|
};
|
|
7051
|
-
|
|
7063
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Ri.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Ri.prototype, "columns", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Ri.prototype, "rows", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Ri.prototype, "cells", void 0);
|
|
7052
7064
|
//#endregion
|
|
7053
7065
|
//#region src/scene/2d/element/Element2DText.ts
|
|
7054
|
-
var
|
|
7066
|
+
var Z = class extends C {
|
|
7055
7067
|
_parent;
|
|
7056
7068
|
base;
|
|
7057
7069
|
get textContent() {
|
|
@@ -7065,7 +7077,7 @@ var X = class extends C {
|
|
|
7065
7077
|
_texture = new er({ mipmap: !0 });
|
|
7066
7078
|
_textureMap = /* @__PURE__ */ new Map();
|
|
7067
7079
|
constructor(e) {
|
|
7068
|
-
super(), this._parent = e, this.base = new
|
|
7080
|
+
super(), this._parent = e, this.base = new ve(), this.base.setPropertyAccessor(this);
|
|
7069
7081
|
}
|
|
7070
7082
|
setProperties(e) {
|
|
7071
7083
|
return super.setProperties(d(e) ? void 0 : ie(e));
|
|
@@ -7158,7 +7170,7 @@ var X = class extends C {
|
|
|
7158
7170
|
this.base.pathSets.forEach((n) => {
|
|
7159
7171
|
n.paths.forEach((n) => {
|
|
7160
7172
|
let r = n.getMeta();
|
|
7161
|
-
if (r instanceof
|
|
7173
|
+
if (r instanceof _e) {
|
|
7162
7174
|
let i = r.parent.index, a = r.parent.parent.index;
|
|
7163
7175
|
if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
|
|
7164
7176
|
let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
@@ -7205,10 +7217,10 @@ var X = class extends C {
|
|
|
7205
7217
|
}
|
|
7206
7218
|
process(e) {}
|
|
7207
7219
|
};
|
|
7208
|
-
|
|
7220
|
+
k([_({ fallback: !0 }), O("design:type", Object)], Z.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Z.prototype, "content", void 0), k([_({ alias: "_parent.style.json" }), O("design:type", Object)], Z.prototype, "style", void 0), k([_(), O("design:type", Object)], Z.prototype, "effects", void 0), k([_(), O("design:type", Object)], Z.prototype, "fill", void 0), k([_(), O("design:type", Object)], Z.prototype, "outline", void 0), k([_(), O("design:type", Object)], Z.prototype, "deformation", void 0), k([_({ alias: "base.measureDom" }), O("design:type", typeof HTMLElement > "u" ? Object : HTMLElement)], Z.prototype, "measureDom", void 0), k([_({ alias: "base.fonts" }), O("design:type", Object)], Z.prototype, "fonts", void 0), k([_({ fallback: "auto" }), O("design:type", Object)], Z.prototype, "drawMode", void 0);
|
|
7209
7221
|
//#endregion
|
|
7210
7222
|
//#region src/scene/2d/element/Flexbox.ts
|
|
7211
|
-
var
|
|
7223
|
+
var Q = {
|
|
7212
7224
|
left: 0,
|
|
7213
7225
|
top: 1,
|
|
7214
7226
|
right: 2,
|
|
@@ -7222,7 +7234,7 @@ var Z = {
|
|
|
7222
7234
|
column: 0,
|
|
7223
7235
|
row: 1,
|
|
7224
7236
|
all: 2
|
|
7225
|
-
},
|
|
7237
|
+
}, Bi = {
|
|
7226
7238
|
auto: 0,
|
|
7227
7239
|
"flex-start": 1,
|
|
7228
7240
|
center: 2,
|
|
@@ -7232,42 +7244,42 @@ var Z = {
|
|
|
7232
7244
|
"space-between": 6,
|
|
7233
7245
|
"space-around": 7,
|
|
7234
7246
|
"space-evenly": 8
|
|
7235
|
-
},
|
|
7247
|
+
}, Vi = {
|
|
7236
7248
|
flex: 0,
|
|
7237
7249
|
none: 1,
|
|
7238
7250
|
contents: 2
|
|
7239
|
-
},
|
|
7251
|
+
}, Hi = {
|
|
7240
7252
|
inherit: 0,
|
|
7241
7253
|
ltr: 1,
|
|
7242
7254
|
rtl: 2
|
|
7243
|
-
},
|
|
7255
|
+
}, Ui = {
|
|
7244
7256
|
column: 0,
|
|
7245
7257
|
"column-reverse": 1,
|
|
7246
7258
|
row: 2,
|
|
7247
7259
|
"row-reverse": 3
|
|
7248
|
-
},
|
|
7260
|
+
}, Wi = {
|
|
7249
7261
|
"no-wrap": 0,
|
|
7250
7262
|
wrap: 1,
|
|
7251
7263
|
"Wrap-reverse": 2
|
|
7252
|
-
},
|
|
7264
|
+
}, Gi = {
|
|
7253
7265
|
"flex-start": 0,
|
|
7254
7266
|
center: 1,
|
|
7255
7267
|
"flex-end": 2,
|
|
7256
7268
|
"space-between": 3,
|
|
7257
7269
|
"space-around": 4,
|
|
7258
7270
|
"space-evenly": 5
|
|
7259
|
-
},
|
|
7271
|
+
}, Ki = {
|
|
7260
7272
|
visible: 0,
|
|
7261
7273
|
hidden: 1,
|
|
7262
7274
|
scroll: 2
|
|
7263
|
-
},
|
|
7275
|
+
}, qi = {
|
|
7264
7276
|
static: 0,
|
|
7265
7277
|
relative: 1,
|
|
7266
7278
|
absolute: 2
|
|
7267
|
-
},
|
|
7279
|
+
}, Ji = {
|
|
7268
7280
|
"border-box": 0,
|
|
7269
7281
|
"content-box": 1
|
|
7270
|
-
},
|
|
7282
|
+
}, Yi = class e {
|
|
7271
7283
|
_parent;
|
|
7272
7284
|
static _yoga;
|
|
7273
7285
|
static async load() {
|
|
@@ -7279,51 +7291,51 @@ var Z = {
|
|
|
7279
7291
|
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);
|
|
7280
7292
|
}
|
|
7281
7293
|
_addChild(e, t) {
|
|
7282
|
-
if (e instanceof
|
|
7294
|
+
if (e instanceof ea && e.flexbox.node && this.node) {
|
|
7283
7295
|
this.node.insertChild(e.flexbox.node, t);
|
|
7284
7296
|
let n = e.style.getProperties();
|
|
7285
7297
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
7286
7298
|
}
|
|
7287
7299
|
}
|
|
7288
7300
|
_removeChild(e, t) {
|
|
7289
|
-
e instanceof
|
|
7301
|
+
e instanceof ea && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
7290
7302
|
}
|
|
7291
7303
|
updateStyleProperty(e, t) {
|
|
7292
7304
|
let n = this.node;
|
|
7293
7305
|
if (n) {
|
|
7294
7306
|
switch (e) {
|
|
7295
7307
|
case "alignContent":
|
|
7296
|
-
n.setAlignContent(t ?
|
|
7308
|
+
n.setAlignContent(t ? Bi[t] ?? Bi["flex-start"] : Bi["flex-start"]);
|
|
7297
7309
|
break;
|
|
7298
7310
|
case "alignItems":
|
|
7299
|
-
n.setAlignItems(t ?
|
|
7311
|
+
n.setAlignItems(t ? Bi[t] ?? Bi["flex-start"] : Bi["flex-start"]);
|
|
7300
7312
|
break;
|
|
7301
7313
|
case "alignSelf":
|
|
7302
|
-
n.setAlignSelf(t ?
|
|
7314
|
+
n.setAlignSelf(t ? Bi[t] ?? Bi["flex-start"] : Bi["flex-start"]);
|
|
7303
7315
|
break;
|
|
7304
7316
|
case "aspectRatio":
|
|
7305
7317
|
n.setAspectRatio(t);
|
|
7306
7318
|
break;
|
|
7307
7319
|
case "borderTop":
|
|
7308
|
-
n.setBorder(
|
|
7320
|
+
n.setBorder(Q.top, this._parent.style.borderWidth);
|
|
7309
7321
|
break;
|
|
7310
7322
|
case "borderBottom":
|
|
7311
|
-
n.setBorder(
|
|
7323
|
+
n.setBorder(Q.bottom, this._parent.style.borderWidth);
|
|
7312
7324
|
break;
|
|
7313
7325
|
case "borderLeft":
|
|
7314
|
-
n.setBorder(
|
|
7326
|
+
n.setBorder(Q.left, this._parent.style.borderWidth);
|
|
7315
7327
|
break;
|
|
7316
7328
|
case "borderRight":
|
|
7317
|
-
n.setBorder(
|
|
7329
|
+
n.setBorder(Q.right, this._parent.style.borderWidth);
|
|
7318
7330
|
break;
|
|
7319
7331
|
case "border":
|
|
7320
|
-
n.setBorder(
|
|
7332
|
+
n.setBorder(Q.all, this._parent.style.borderWidth);
|
|
7321
7333
|
break;
|
|
7322
7334
|
case "direction":
|
|
7323
|
-
n.setDirection(t ?
|
|
7335
|
+
n.setDirection(t ? Hi[t] ?? Hi.inherit : Hi.inherit);
|
|
7324
7336
|
break;
|
|
7325
7337
|
case "display":
|
|
7326
|
-
n.setDisplay(t ?
|
|
7338
|
+
n.setDisplay(t ? Vi[t] ?? Vi.flex : Vi.flex);
|
|
7327
7339
|
break;
|
|
7328
7340
|
case "flex":
|
|
7329
7341
|
n.setFlex(t);
|
|
@@ -7332,7 +7344,7 @@ var Z = {
|
|
|
7332
7344
|
n.setFlexBasis(t);
|
|
7333
7345
|
break;
|
|
7334
7346
|
case "flexDirection":
|
|
7335
|
-
n.setFlexDirection(t ?
|
|
7347
|
+
n.setFlexDirection(t ? Ui[t] ?? Ui.row : Ui.row);
|
|
7336
7348
|
break;
|
|
7337
7349
|
case "flexGrow":
|
|
7338
7350
|
n.setFlexGrow(t);
|
|
@@ -7341,31 +7353,31 @@ var Z = {
|
|
|
7341
7353
|
n.setFlexShrink(t);
|
|
7342
7354
|
break;
|
|
7343
7355
|
case "flexWrap":
|
|
7344
|
-
n.setFlexWrap(t ?
|
|
7356
|
+
n.setFlexWrap(t ? Wi[t] ?? Wi.wrap : Wi.wrap);
|
|
7345
7357
|
break;
|
|
7346
7358
|
case "height":
|
|
7347
7359
|
n.setHeight(t);
|
|
7348
7360
|
break;
|
|
7349
7361
|
case "justifyContent":
|
|
7350
|
-
n.setJustifyContent(t ?
|
|
7362
|
+
n.setJustifyContent(t ? Gi[t] ?? Gi["flex-start"] : Gi["flex-start"]);
|
|
7351
7363
|
break;
|
|
7352
7364
|
case "gap":
|
|
7353
7365
|
t !== void 0 && n.setGap(zi.all, t);
|
|
7354
7366
|
break;
|
|
7355
7367
|
case "marginTop":
|
|
7356
|
-
n.setMargin(
|
|
7368
|
+
n.setMargin(Q.top, t);
|
|
7357
7369
|
break;
|
|
7358
7370
|
case "marginBottom":
|
|
7359
|
-
n.setMargin(
|
|
7371
|
+
n.setMargin(Q.bottom, t);
|
|
7360
7372
|
break;
|
|
7361
7373
|
case "marginLeft":
|
|
7362
|
-
n.setMargin(
|
|
7374
|
+
n.setMargin(Q.left, t);
|
|
7363
7375
|
break;
|
|
7364
7376
|
case "marginRight":
|
|
7365
|
-
n.setMargin(
|
|
7377
|
+
n.setMargin(Q.right, t);
|
|
7366
7378
|
break;
|
|
7367
7379
|
case "margin":
|
|
7368
|
-
n.setMargin(
|
|
7380
|
+
n.setMargin(Q.all, t);
|
|
7369
7381
|
break;
|
|
7370
7382
|
case "maxHeight":
|
|
7371
7383
|
n.setMaxHeight(t);
|
|
@@ -7380,40 +7392,40 @@ var Z = {
|
|
|
7380
7392
|
n.setMinWidth(t);
|
|
7381
7393
|
break;
|
|
7382
7394
|
case "overflow":
|
|
7383
|
-
n.setOverflow(t ?
|
|
7395
|
+
n.setOverflow(t ? Ki[t] ?? Ki.visible : Ki.visible);
|
|
7384
7396
|
break;
|
|
7385
7397
|
case "paddingTop":
|
|
7386
|
-
n.setPadding(
|
|
7398
|
+
n.setPadding(Q.top, t);
|
|
7387
7399
|
break;
|
|
7388
7400
|
case "paddingBottom":
|
|
7389
|
-
n.setPadding(
|
|
7401
|
+
n.setPadding(Q.bottom, t);
|
|
7390
7402
|
break;
|
|
7391
7403
|
case "paddingLeft":
|
|
7392
|
-
n.setPadding(
|
|
7404
|
+
n.setPadding(Q.left, t);
|
|
7393
7405
|
break;
|
|
7394
7406
|
case "paddingRight":
|
|
7395
|
-
n.setPadding(
|
|
7407
|
+
n.setPadding(Q.right, t);
|
|
7396
7408
|
break;
|
|
7397
7409
|
case "padding":
|
|
7398
|
-
n.setPadding(
|
|
7410
|
+
n.setPadding(Q.all, t);
|
|
7399
7411
|
break;
|
|
7400
7412
|
case "top":
|
|
7401
|
-
n.setPosition(
|
|
7413
|
+
n.setPosition(Q.top, t);
|
|
7402
7414
|
break;
|
|
7403
7415
|
case "bottom":
|
|
7404
|
-
n.setPosition(
|
|
7416
|
+
n.setPosition(Q.bottom, t);
|
|
7405
7417
|
break;
|
|
7406
7418
|
case "left":
|
|
7407
|
-
n.setPosition(
|
|
7419
|
+
n.setPosition(Q.left, t);
|
|
7408
7420
|
break;
|
|
7409
7421
|
case "right":
|
|
7410
|
-
n.setPosition(
|
|
7422
|
+
n.setPosition(Q.right, t);
|
|
7411
7423
|
break;
|
|
7412
7424
|
case "position":
|
|
7413
|
-
n.setPositionType(t ?
|
|
7425
|
+
n.setPositionType(t ? qi[t] ?? qi.relative : qi.relative);
|
|
7414
7426
|
break;
|
|
7415
7427
|
case "boxSizing":
|
|
7416
|
-
n.setBoxSizing(t ?
|
|
7428
|
+
n.setBoxSizing(t ? Ji[t] ?? Ji["content-box"] : Ji["content-box"]);
|
|
7417
7429
|
break;
|
|
7418
7430
|
case "width":
|
|
7419
7431
|
n.setWidth(t);
|
|
@@ -7424,7 +7436,7 @@ var Z = {
|
|
|
7424
7436
|
}
|
|
7425
7437
|
update() {
|
|
7426
7438
|
let e = this._parent, t = this.node;
|
|
7427
|
-
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0,
|
|
7439
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Hi.ltr), t.hasNewLayout())) {
|
|
7428
7440
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
|
|
7429
7441
|
(!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();
|
|
7430
7442
|
}
|
|
@@ -7432,15 +7444,15 @@ var Z = {
|
|
|
7432
7444
|
destroy() {
|
|
7433
7445
|
this.node?.free(), this.node = void 0;
|
|
7434
7446
|
}
|
|
7435
|
-
},
|
|
7447
|
+
}, Xi = new Set(Object.keys(a())), Zi = new Set(Object.keys(s())), Qi = new y(), $i = [
|
|
7436
7448
|
[0, 0],
|
|
7437
7449
|
[1, 0],
|
|
7438
7450
|
[1, 1],
|
|
7439
7451
|
[0, 1]
|
|
7440
|
-
],
|
|
7441
|
-
flexbox = new
|
|
7442
|
-
aabb = new
|
|
7443
|
-
globalAabb = new
|
|
7452
|
+
], ea = class extends wr {
|
|
7453
|
+
flexbox = new Yi(this);
|
|
7454
|
+
aabb = new yt();
|
|
7455
|
+
globalAabb = new yt();
|
|
7444
7456
|
_parentGlobalDisplay;
|
|
7445
7457
|
_globalDisplay;
|
|
7446
7458
|
get globalDisplay() {
|
|
@@ -7479,7 +7491,7 @@ var Z = {
|
|
|
7479
7491
|
set shape(e) {
|
|
7480
7492
|
this._shape.resetProperties().setProperties(e);
|
|
7481
7493
|
}
|
|
7482
|
-
_fill = new
|
|
7494
|
+
_fill = new Y(this);
|
|
7483
7495
|
get fill() {
|
|
7484
7496
|
return this._fill;
|
|
7485
7497
|
}
|
|
@@ -7500,7 +7512,7 @@ var Z = {
|
|
|
7500
7512
|
set foreground(e) {
|
|
7501
7513
|
this._foreground.resetProperties().setProperties(e);
|
|
7502
7514
|
}
|
|
7503
|
-
_text = new
|
|
7515
|
+
_text = new Z(this);
|
|
7504
7516
|
get text() {
|
|
7505
7517
|
return this._text;
|
|
7506
7518
|
}
|
|
@@ -7528,7 +7540,7 @@ var Z = {
|
|
|
7528
7540
|
set table(e) {
|
|
7529
7541
|
this._table.resetProperties().setProperties(e);
|
|
7530
7542
|
}
|
|
7531
|
-
_chart = new
|
|
7543
|
+
_chart = new X(this);
|
|
7532
7544
|
get chart() {
|
|
7533
7545
|
return this._chart;
|
|
7534
7546
|
}
|
|
@@ -7613,7 +7625,7 @@ var Z = {
|
|
|
7613
7625
|
this._updateGlobalDisplay();
|
|
7614
7626
|
break;
|
|
7615
7627
|
case "rotate":
|
|
7616
|
-
this.rotation = (t || 0) *
|
|
7628
|
+
this.rotation = (t || 0) * bt, this.updateGlobalTransform();
|
|
7617
7629
|
break;
|
|
7618
7630
|
case "scaleX":
|
|
7619
7631
|
this.scale.x = t, this.text.isValid() && (t ^ n) < 0 && this.requestDraw();
|
|
@@ -7678,7 +7690,7 @@ var Z = {
|
|
|
7678
7690
|
this.requestDraw();
|
|
7679
7691
|
break;
|
|
7680
7692
|
}
|
|
7681
|
-
if ((
|
|
7693
|
+
if ((Zi.has(e) || Xi.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
|
|
7682
7694
|
else switch (e) {
|
|
7683
7695
|
case "left":
|
|
7684
7696
|
this.position.x = Number(t);
|
|
@@ -7718,10 +7730,10 @@ var Z = {
|
|
|
7718
7730
|
}
|
|
7719
7731
|
_intersectsViewport(e) {
|
|
7720
7732
|
let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
7721
|
-
for (let [e, c] of
|
|
7733
|
+
for (let [e, c] of $i) t.applyAffineInverse({
|
|
7722
7734
|
x: e * n,
|
|
7723
7735
|
y: c * r
|
|
7724
|
-
},
|
|
7736
|
+
}, Qi), i = Math.min(i, Qi.x), a = Math.max(a, Qi.x), o = Math.min(o, Qi.y), s = Math.max(s, Qi.y);
|
|
7725
7737
|
let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
|
|
7726
7738
|
return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
|
|
7727
7739
|
}
|
|
@@ -7831,10 +7843,10 @@ var Z = {
|
|
|
7831
7843
|
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._colorFilterEffect = void 0, this._maskEffect = void 0;
|
|
7832
7844
|
}
|
|
7833
7845
|
};
|
|
7834
|
-
|
|
7846
|
+
ea = k([b("Element2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ea);
|
|
7835
7847
|
//#endregion
|
|
7836
7848
|
//#region src/scene/2d/TextureRect2D.ts
|
|
7837
|
-
var
|
|
7849
|
+
var ta = class extends ea {
|
|
7838
7850
|
texture;
|
|
7839
7851
|
constructor(e, t = []) {
|
|
7840
7852
|
super(), this.setProperties(e).append(t);
|
|
@@ -7848,7 +7860,7 @@ var ea = class extends $i {
|
|
|
7848
7860
|
} });
|
|
7849
7861
|
}
|
|
7850
7862
|
}
|
|
7851
|
-
},
|
|
7863
|
+
}, na = class extends ta {
|
|
7852
7864
|
texture = new er();
|
|
7853
7865
|
animation;
|
|
7854
7866
|
_lastTime = NaN;
|
|
@@ -7879,10 +7891,10 @@ var ea = class extends $i {
|
|
|
7879
7891
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
7880
7892
|
}
|
|
7881
7893
|
};
|
|
7882
|
-
|
|
7894
|
+
k([_({ fallback: "" }), O("design:type", String)], na.prototype, "src", void 0), na = k([b("Lottie2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], na);
|
|
7883
7895
|
//#endregion
|
|
7884
7896
|
//#region src/scene/2d/TransformRect2D.ts
|
|
7885
|
-
var
|
|
7897
|
+
var ra = class extends ea {
|
|
7886
7898
|
constructor(e, t = []) {
|
|
7887
7899
|
super(), this.setProperties(e).append(t);
|
|
7888
7900
|
}
|
|
@@ -7895,20 +7907,20 @@ var na = class extends $i {
|
|
|
7895
7907
|
}
|
|
7896
7908
|
}
|
|
7897
7909
|
_drawCircle(e, t) {
|
|
7898
|
-
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle =
|
|
7910
|
+
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = z.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
|
|
7899
7911
|
}
|
|
7900
7912
|
_drawEllipse(e, t) {
|
|
7901
|
-
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle =
|
|
7913
|
+
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = z.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
|
|
7902
7914
|
}
|
|
7903
7915
|
_draw() {
|
|
7904
7916
|
let { width: e, height: t } = this.getRect();
|
|
7905
7917
|
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);
|
|
7906
7918
|
}
|
|
7907
7919
|
};
|
|
7908
|
-
|
|
7920
|
+
k([_({ fallback: 6 }), O("design:type", Number)], ra.prototype, "handleSize", void 0);
|
|
7909
7921
|
//#endregion
|
|
7910
7922
|
//#region src/scene/2d/Video2D.ts
|
|
7911
|
-
var
|
|
7923
|
+
var ia = class extends ta {
|
|
7912
7924
|
get videoDuration() {
|
|
7913
7925
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
7914
7926
|
}
|
|
@@ -7948,11 +7960,29 @@ var ra = class extends ea {
|
|
|
7948
7960
|
super._process(e), this._updateVideoCurrentTime();
|
|
7949
7961
|
}
|
|
7950
7962
|
};
|
|
7951
|
-
|
|
7963
|
+
k([_({ fallback: "" }), O("design:type", String)], ia.prototype, "src", void 0), ia = k([b("Video2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ia);
|
|
7952
7964
|
//#endregion
|
|
7953
7965
|
//#region src/scene/animation/Animation.ts
|
|
7954
|
-
|
|
7955
|
-
|
|
7966
|
+
function aa(e) {
|
|
7967
|
+
if (e == null) return 0;
|
|
7968
|
+
let t = String(e).trim(), n = Number.parseFloat(t);
|
|
7969
|
+
return Number.isNaN(n) ? 0 : n / 100;
|
|
7970
|
+
}
|
|
7971
|
+
function oa(e, t) {
|
|
7972
|
+
let n = t * 180 / Math.PI;
|
|
7973
|
+
if (e == null || e === "auto") return n;
|
|
7974
|
+
let r = String(e).trim();
|
|
7975
|
+
if (r === "reverse") return n + 180;
|
|
7976
|
+
if (r.startsWith("auto")) return n + (Number.parseFloat(r.slice(4)) || 0);
|
|
7977
|
+
let i = Number.parseFloat(r);
|
|
7978
|
+
return Number.isNaN(i) ? n : i;
|
|
7979
|
+
}
|
|
7980
|
+
function sa(e) {
|
|
7981
|
+
let t = e.trim(), n = /^path\((.*)\)$/s.exec(t);
|
|
7982
|
+
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();
|
|
7983
|
+
}
|
|
7984
|
+
var ca = (e) => e, la = pa(.25, .1, .25, 1), ua = pa(.42, 0, 1, 1), da = pa(0, 0, .58, 1), fa = pa(.42, 0, .58, 1);
|
|
7985
|
+
function pa(e, t, n, r) {
|
|
7956
7986
|
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;
|
|
7957
7987
|
function m(e) {
|
|
7958
7988
|
let t = e, n, r;
|
|
@@ -7972,17 +8002,18 @@ function la(e, t, n, r) {
|
|
|
7972
8002
|
}
|
|
7973
8003
|
return (e) => p(m(e));
|
|
7974
8004
|
}
|
|
7975
|
-
var
|
|
7976
|
-
linear:
|
|
7977
|
-
ease:
|
|
7978
|
-
easeIn:
|
|
7979
|
-
easeOut:
|
|
7980
|
-
easeInOut:
|
|
7981
|
-
},
|
|
8005
|
+
var ma = {
|
|
8006
|
+
linear: ca,
|
|
8007
|
+
ease: la,
|
|
8008
|
+
easeIn: ua,
|
|
8009
|
+
easeOut: da,
|
|
8010
|
+
easeInOut: fa
|
|
8011
|
+
}, ha = class extends V {
|
|
7982
8012
|
_keyframes = [];
|
|
7983
8013
|
_isFirstUpdatePosition = !1;
|
|
7984
8014
|
_cachedProps = new t();
|
|
7985
8015
|
_stoped = !1;
|
|
8016
|
+
_pathMeasures = /* @__PURE__ */ new Map();
|
|
7986
8017
|
constructor(e, t = []) {
|
|
7987
8018
|
super(), this.setProperties(e).append(t);
|
|
7988
8019
|
}
|
|
@@ -8013,9 +8044,10 @@ var ua = {
|
|
|
8013
8044
|
e = [this.getParent()].filter(Boolean);
|
|
8014
8045
|
break;
|
|
8015
8046
|
}
|
|
8016
|
-
return e.filter((e) => e instanceof
|
|
8047
|
+
return e.filter((e) => e instanceof ea);
|
|
8017
8048
|
}
|
|
8018
8049
|
_updateKeyframes() {
|
|
8050
|
+
this._pathMeasures.clear();
|
|
8019
8051
|
let e = [], t = this.keyframes;
|
|
8020
8052
|
for (let n = t.length, r = 0; r < n; r++) {
|
|
8021
8053
|
let { offset: i = r === 0 ? 0 : r / (n - 1), easing: a = "linear", ...o } = t[r];
|
|
@@ -8045,26 +8077,28 @@ var ua = {
|
|
|
8045
8077
|
}
|
|
8046
8078
|
let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
|
|
8047
8079
|
e.forEach((e, r) => {
|
|
8048
|
-
let i = t === 1 ? n :
|
|
8080
|
+
let i = t === 1 ? n : E(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
|
|
8049
8081
|
if (!a) return;
|
|
8050
8082
|
let o = this._parseKeyframes(i, a);
|
|
8051
8083
|
o?.length && this._commitStyle(i, e, a, o[0], o[1]);
|
|
8052
8084
|
});
|
|
8053
8085
|
}
|
|
8054
8086
|
_updateCachedProps() {
|
|
8055
|
-
this.cancel()
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8087
|
+
this.cancel();
|
|
8088
|
+
let e = this._keyframes.some((e) => "offsetPath" in e.props);
|
|
8089
|
+
this._getTargets().forEach((t) => {
|
|
8090
|
+
let n = /* @__PURE__ */ new Map(), r = this._keyframes;
|
|
8091
|
+
for (let e = r.length, i = 0; i < e; i++) Object.keys(r[i].props).forEach((e) => {
|
|
8092
|
+
n.set(e, t.style[e]);
|
|
8059
8093
|
});
|
|
8060
|
-
this._cachedProps.set(
|
|
8094
|
+
e && n.set("transform", t.style.transform), this._cachedProps.set(t, n);
|
|
8061
8095
|
});
|
|
8062
8096
|
}
|
|
8063
8097
|
_parseEasing(e) {
|
|
8064
|
-
if (!e) return
|
|
8065
|
-
if (e in
|
|
8098
|
+
if (!e) return ma.linear;
|
|
8099
|
+
if (e in ma) return ma[e];
|
|
8066
8100
|
let t = e.replace(/cubic-bezier\((.+)\)/, "$1").split(",").map((e) => Number(e));
|
|
8067
|
-
return
|
|
8101
|
+
return pa(t[0], t[1], t[2], t[3]);
|
|
8068
8102
|
}
|
|
8069
8103
|
_parseKeyframes(e, t) {
|
|
8070
8104
|
let n, r = this._keyframes;
|
|
@@ -8093,17 +8127,32 @@ var ua = {
|
|
|
8093
8127
|
width: t.size.x,
|
|
8094
8128
|
height: t.size.y,
|
|
8095
8129
|
fontSize: t.style.fontSize
|
|
8096
|
-
};
|
|
8097
|
-
n.forEach((e, n) => {
|
|
8098
|
-
t.onUpdateStyleProperty(n, this._getDiffValue(n, s[n], l[n], d, f), void 0);
|
|
8130
|
+
}, p = l.offsetPath ?? s.offsetPath, m = p != null;
|
|
8131
|
+
m && this._commitOffsetPath(t, String(p), n, s, l, d), n.forEach((e, n) => {
|
|
8132
|
+
n === "offsetPath" || n === "offsetDistance" || n === "offsetRotate" || m && n === "transform" || t.onUpdateStyleProperty(n, this._getDiffValue(n, s[n], l[n], d, f), void 0);
|
|
8099
8133
|
});
|
|
8100
8134
|
}
|
|
8135
|
+
_commitOffsetPath(e, t, n, r, i, a) {
|
|
8136
|
+
let o = sa(t);
|
|
8137
|
+
if (!o) return;
|
|
8138
|
+
let s = this._pathMeasures.get(o);
|
|
8139
|
+
if (!s) {
|
|
8140
|
+
let e = new de(new le(o)), t = e.getPosTanAtProgress(0).position;
|
|
8141
|
+
s = {
|
|
8142
|
+
measure: e,
|
|
8143
|
+
startX: t.x,
|
|
8144
|
+
startY: t.y
|
|
8145
|
+
}, this._pathMeasures.set(o, s);
|
|
8146
|
+
}
|
|
8147
|
+
let c = E(D(aa(r.offsetDistance ?? i.offsetDistance), aa(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 = oa(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
|
|
8148
|
+
e.onUpdateStyleProperty("transform", `${m ? `${m} ` : ""}translate(${d}px, ${f}px) rotate(${p}deg)`, void 0);
|
|
8149
|
+
}
|
|
8101
8150
|
_getDiffValue(e, t, n, r, i) {
|
|
8102
8151
|
let a, o;
|
|
8103
|
-
if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a =
|
|
8104
|
-
else if (n !== void 0) o =
|
|
8152
|
+
if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a = ke(e, String(t), i), o = Oe(a);
|
|
8153
|
+
else if (n !== void 0) o = ke(e, String(n), i), a = Oe(o);
|
|
8105
8154
|
else return;
|
|
8106
|
-
else a =
|
|
8155
|
+
else a = ke(e, String(t), i), o = ke(e, String(n), i);
|
|
8107
8156
|
if (Array.isArray(a) && Array.isArray(o)) {
|
|
8108
8157
|
let e = /* @__PURE__ */ new Set(), t = {}, n = {};
|
|
8109
8158
|
a.forEach(({ name: n, args: r }) => {
|
|
@@ -8116,10 +8165,10 @@ var ua = {
|
|
|
8116
8165
|
let a = Math.max(t[e]?.length ?? 0, n[e]?.length ?? 0), o = t[e], s = n[e];
|
|
8117
8166
|
i += `${e}(${Array.from({ length: a }, (e, t) => {
|
|
8118
8167
|
let n = o?.[t], i = s?.[t], a = n?.normalizedIntValue ?? 0, c = i?.normalizedIntValue ?? 0;
|
|
8119
|
-
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 :
|
|
8168
|
+
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : D(a, c, r);
|
|
8120
8169
|
}).join(", ")}) `;
|
|
8121
8170
|
}), i;
|
|
8122
|
-
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value :
|
|
8171
|
+
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : D(a.normalizedIntValue, o.normalizedIntValue, r);
|
|
8123
8172
|
}
|
|
8124
8173
|
isPlaying() {
|
|
8125
8174
|
return !this.paused && this.isInsideTimeRange();
|
|
@@ -8142,14 +8191,14 @@ var ua = {
|
|
|
8142
8191
|
});
|
|
8143
8192
|
}
|
|
8144
8193
|
};
|
|
8145
|
-
|
|
8194
|
+
k([_({ fallback: "parent" }), O("design:type", Object)], ha.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], ha.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], ha.prototype, "easing", void 0), ha = k([b("Animation", {
|
|
8146
8195
|
renderMode: "disabled",
|
|
8147
8196
|
processSortMode: "parent-before",
|
|
8148
8197
|
duration: 2e3
|
|
8149
|
-
}),
|
|
8198
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ha);
|
|
8150
8199
|
//#endregion
|
|
8151
8200
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
8152
|
-
var
|
|
8201
|
+
var ga = class t extends e {
|
|
8153
8202
|
static _instance;
|
|
8154
8203
|
static get instance() {
|
|
8155
8204
|
return this._instance ||= new t(), this._instance;
|
|
@@ -8179,7 +8228,7 @@ var fa = class t extends e {
|
|
|
8179
8228
|
togglePause() {
|
|
8180
8229
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
8181
8230
|
}
|
|
8182
|
-
},
|
|
8231
|
+
}, _a = class t extends e {
|
|
8183
8232
|
static PADDING = .1;
|
|
8184
8233
|
_source = null;
|
|
8185
8234
|
_audio = null;
|
|
@@ -8306,7 +8355,7 @@ var fa = class t extends e {
|
|
|
8306
8355
|
let e = this._source;
|
|
8307
8356
|
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);
|
|
8308
8357
|
}
|
|
8309
|
-
},
|
|
8358
|
+
}, va = class {
|
|
8310
8359
|
parent;
|
|
8311
8360
|
source = new globalThis.Audio();
|
|
8312
8361
|
_src = "";
|
|
@@ -8323,7 +8372,7 @@ var fa = class t extends e {
|
|
|
8323
8372
|
return !!this.source && this.source.readyState === 4;
|
|
8324
8373
|
}
|
|
8325
8374
|
get context() {
|
|
8326
|
-
return
|
|
8375
|
+
return ga.instance;
|
|
8327
8376
|
}
|
|
8328
8377
|
constructor(e) {
|
|
8329
8378
|
this.parent = e;
|
|
@@ -8334,9 +8383,9 @@ var fa = class t extends e {
|
|
|
8334
8383
|
});
|
|
8335
8384
|
}
|
|
8336
8385
|
createSound() {
|
|
8337
|
-
return new
|
|
8386
|
+
return new _a();
|
|
8338
8387
|
}
|
|
8339
|
-
},
|
|
8388
|
+
}, ya = class extends e {
|
|
8340
8389
|
_input;
|
|
8341
8390
|
_output;
|
|
8342
8391
|
_processers = [];
|
|
@@ -8358,7 +8407,7 @@ var fa = class t extends e {
|
|
|
8358
8407
|
get destination() {
|
|
8359
8408
|
return this._input;
|
|
8360
8409
|
}
|
|
8361
|
-
},
|
|
8410
|
+
}, ba = class {
|
|
8362
8411
|
destination;
|
|
8363
8412
|
source;
|
|
8364
8413
|
constructor(e, t = null) {
|
|
@@ -8373,21 +8422,21 @@ var fa = class t extends e {
|
|
|
8373
8422
|
};
|
|
8374
8423
|
//#endregion
|
|
8375
8424
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
8376
|
-
function
|
|
8377
|
-
if (
|
|
8378
|
-
if (
|
|
8425
|
+
function xa() {
|
|
8426
|
+
if (He) return new AudioContext();
|
|
8427
|
+
if (Ue) {
|
|
8379
8428
|
let e = globalThis.webkitAudioContext;
|
|
8380
8429
|
return new e();
|
|
8381
8430
|
} else throw Error("Failed to createAudioContext");
|
|
8382
8431
|
}
|
|
8383
|
-
function
|
|
8384
|
-
if (
|
|
8385
|
-
if (
|
|
8432
|
+
function Sa(e, t, n) {
|
|
8433
|
+
if (We) return new OfflineAudioContext(e, t, n);
|
|
8434
|
+
if (Ge) {
|
|
8386
8435
|
let r = globalThis.webkitOfflineAudioContext;
|
|
8387
8436
|
return new r(e, t, n);
|
|
8388
8437
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
8389
8438
|
}
|
|
8390
|
-
var
|
|
8439
|
+
var Ca = class e extends ya {
|
|
8391
8440
|
static _instance;
|
|
8392
8441
|
static get instance() {
|
|
8393
8442
|
return this._instance ||= new e(), this._instance;
|
|
@@ -8428,8 +8477,8 @@ var ya = class e extends ha {
|
|
|
8428
8477
|
_compressor;
|
|
8429
8478
|
_analyser;
|
|
8430
8479
|
constructor() {
|
|
8431
|
-
let e =
|
|
8432
|
-
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" && (
|
|
8480
|
+
let e = xa(), t = Sa(1, 2, We ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
8481
|
+
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" && (ze || Be), qe && (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));
|
|
8433
8482
|
}
|
|
8434
8483
|
_onFocus() {
|
|
8435
8484
|
if (!this.autoPause) return;
|
|
@@ -8469,7 +8518,7 @@ var ya = class e extends ha {
|
|
|
8469
8518
|
setParamValue(e, t) {
|
|
8470
8519
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
8471
8520
|
}
|
|
8472
|
-
},
|
|
8521
|
+
}, wa = class extends e {
|
|
8473
8522
|
_audio = null;
|
|
8474
8523
|
_sourceNode = null;
|
|
8475
8524
|
_gain = null;
|
|
@@ -8602,7 +8651,7 @@ var ya = class e extends ha {
|
|
|
8602
8651
|
destroy() {
|
|
8603
8652
|
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;
|
|
8604
8653
|
}
|
|
8605
|
-
},
|
|
8654
|
+
}, Ta = class extends ya {
|
|
8606
8655
|
parent;
|
|
8607
8656
|
_sourceBuffer;
|
|
8608
8657
|
_sourceNode;
|
|
@@ -8610,7 +8659,7 @@ var ya = class e extends ha {
|
|
|
8610
8659
|
gain;
|
|
8611
8660
|
analyser;
|
|
8612
8661
|
get context() {
|
|
8613
|
-
return
|
|
8662
|
+
return Ca.instance;
|
|
8614
8663
|
}
|
|
8615
8664
|
get isPlayable() {
|
|
8616
8665
|
return !!this._sourceNode.buffer;
|
|
@@ -8625,8 +8674,8 @@ var ya = class e extends ha {
|
|
|
8625
8674
|
this._sourceNode.buffer = e;
|
|
8626
8675
|
}
|
|
8627
8676
|
constructor(e) {
|
|
8628
|
-
let t =
|
|
8629
|
-
n.connect(i), i.connect(r), r.connect(
|
|
8677
|
+
let t = Ca.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
8678
|
+
n.connect(i), i.connect(r), r.connect(Ca.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
|
|
8630
8679
|
}
|
|
8631
8680
|
async load() {
|
|
8632
8681
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -8639,7 +8688,7 @@ var ya = class e extends ha {
|
|
|
8639
8688
|
});
|
|
8640
8689
|
}
|
|
8641
8690
|
_decode(e) {
|
|
8642
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
8691
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : Ca.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
8643
8692
|
}
|
|
8644
8693
|
cloneSource() {
|
|
8645
8694
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -8649,15 +8698,15 @@ var ya = class e extends ha {
|
|
|
8649
8698
|
};
|
|
8650
8699
|
}
|
|
8651
8700
|
createSound() {
|
|
8652
|
-
return new
|
|
8701
|
+
return new wa();
|
|
8653
8702
|
}
|
|
8654
|
-
},
|
|
8703
|
+
}, Ea, Da = class extends V {
|
|
8655
8704
|
static {
|
|
8656
|
-
|
|
8705
|
+
Ea = this;
|
|
8657
8706
|
}
|
|
8658
8707
|
static _soundPool = [];
|
|
8659
8708
|
_sounds = [];
|
|
8660
|
-
_platformAudio =
|
|
8709
|
+
_platformAudio = Ke ? new Ta(this) : new va(this);
|
|
8661
8710
|
get platformAudio() {
|
|
8662
8711
|
return this._platformAudio;
|
|
8663
8712
|
}
|
|
@@ -8750,7 +8799,7 @@ var ya = class e extends ha {
|
|
|
8750
8799
|
this._sounds.length = 0;
|
|
8751
8800
|
}
|
|
8752
8801
|
_createSound() {
|
|
8753
|
-
return
|
|
8802
|
+
return Ea._soundPool.length > 0 ? Ea._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
8754
8803
|
}
|
|
8755
8804
|
refresh() {
|
|
8756
8805
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -8766,7 +8815,7 @@ var ya = class e extends ha {
|
|
|
8766
8815
|
this._recycleSound(e);
|
|
8767
8816
|
};
|
|
8768
8817
|
_recycleSound(e) {
|
|
8769
|
-
e.destroy(),
|
|
8818
|
+
e.destroy(), Ea._soundPool.includes(e) || Ea._soundPool.push(e);
|
|
8770
8819
|
}
|
|
8771
8820
|
_prevTime = 0;
|
|
8772
8821
|
_timer = 0;
|
|
@@ -8782,14 +8831,14 @@ var ya = class e extends ha {
|
|
|
8782
8831
|
}, 100);
|
|
8783
8832
|
}
|
|
8784
8833
|
};
|
|
8785
|
-
|
|
8834
|
+
Da = Ea = k([b("Audio"), O("design:paramtypes", [Object])], Da);
|
|
8786
8835
|
//#endregion
|
|
8787
8836
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
8788
|
-
var
|
|
8837
|
+
var Oa = class extends wr {}, ka = class extends ea {
|
|
8789
8838
|
_audioBuffer;
|
|
8790
8839
|
_src = (() => {
|
|
8791
8840
|
let e = S();
|
|
8792
|
-
return e ? new
|
|
8841
|
+
return e ? new z({ source: e }) : void 0;
|
|
8793
8842
|
})();
|
|
8794
8843
|
_needsUpdateTexture = !1;
|
|
8795
8844
|
constructor(e = {}) {
|
|
@@ -8809,7 +8858,7 @@ var wa = class extends wr {}, Ta = class extends $i {
|
|
|
8809
8858
|
}
|
|
8810
8859
|
}
|
|
8811
8860
|
async _loadSrc(e) {
|
|
8812
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
8861
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Ca.decode(e)).then((e) => {
|
|
8813
8862
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
8814
8863
|
});
|
|
8815
8864
|
}
|
|
@@ -8844,16 +8893,16 @@ var wa = class extends wr {}, Ta = class extends $i {
|
|
|
8844
8893
|
this.syncTexture(), super._process(e);
|
|
8845
8894
|
}
|
|
8846
8895
|
};
|
|
8847
|
-
|
|
8896
|
+
k([_(), O("design:type", Object)], ka.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], ka.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], ka.prototype, "color", void 0), ka = k([b("AudioWaveform"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], ka);
|
|
8848
8897
|
//#endregion
|
|
8849
8898
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
8850
|
-
var
|
|
8899
|
+
var Aa, ja = class extends Cr {
|
|
8851
8900
|
static {
|
|
8852
|
-
|
|
8901
|
+
Aa = this;
|
|
8853
8902
|
}
|
|
8854
8903
|
blur = 10;
|
|
8855
8904
|
quality = 10;
|
|
8856
|
-
static material = new
|
|
8905
|
+
static material = new I({ gl: {
|
|
8857
8906
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
8858
8907
|
fragment: "precision highp float;\nin vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform float progress;\n\nvoid main(void) {\n vec2 offset1 = vec2(offset.x - progress * offset.x, offset.y - progress * offset.y);\n vec4 color = vec4(0.0);\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y - offset1.y));\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y - offset1.y));\n color *= 0.25;\n gl_FragColor = color;\n}"
|
|
8859
8908
|
} });
|
|
@@ -8868,7 +8917,7 @@ var Ea, Da = class extends Cr {
|
|
|
8868
8917
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
8869
8918
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
8870
8919
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
8871
|
-
|
|
8920
|
+
L.draw(e, Aa.material, {
|
|
8872
8921
|
sampler: r,
|
|
8873
8922
|
progress: i,
|
|
8874
8923
|
...t
|
|
@@ -8876,35 +8925,35 @@ var Ea, Da = class extends Cr {
|
|
|
8876
8925
|
});
|
|
8877
8926
|
}
|
|
8878
8927
|
};
|
|
8879
|
-
|
|
8928
|
+
ja = Aa = k([b("KawaseTransition")], ja);
|
|
8880
8929
|
//#endregion
|
|
8881
8930
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
8882
|
-
var
|
|
8931
|
+
var Ma, Na = class extends Cr {
|
|
8883
8932
|
static {
|
|
8884
|
-
|
|
8933
|
+
Ma = this;
|
|
8885
8934
|
}
|
|
8886
|
-
static material = new
|
|
8935
|
+
static material = new I({ gl: {
|
|
8887
8936
|
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}",
|
|
8888
8937
|
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}"
|
|
8889
8938
|
} });
|
|
8890
8939
|
apply(e) {
|
|
8891
|
-
|
|
8940
|
+
L.draw(e, Ma.material, {
|
|
8892
8941
|
previous: 0,
|
|
8893
8942
|
next: 1,
|
|
8894
8943
|
progress: this.currentTimeProgress
|
|
8895
8944
|
});
|
|
8896
8945
|
}
|
|
8897
8946
|
};
|
|
8898
|
-
|
|
8947
|
+
Na = Ma = k([b("LeftEraseTransition")], Na);
|
|
8899
8948
|
//#endregion
|
|
8900
8949
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
8901
|
-
var
|
|
8950
|
+
var Pa, Fa = class extends Cr {
|
|
8902
8951
|
static {
|
|
8903
|
-
|
|
8952
|
+
Pa = this;
|
|
8904
8953
|
}
|
|
8905
8954
|
blur = 100;
|
|
8906
8955
|
gradientBlur = 600;
|
|
8907
|
-
static material = new
|
|
8956
|
+
static material = new I({ gl: {
|
|
8908
8957
|
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}",
|
|
8909
8958
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\nuniform float progress;\n\nfloat random(vec3 scale, float seed) {\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void) {\n float blur1 = blur - progress * blur;\n float gradientBlur1 = progress * gradientBlur;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vUv * texSize - start, normal)) / gradientBlur1) * blur1;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample1 = texture2D(sampler, vUv + delta / texSize * percent * radius);\n sample1.rgb *= sample1.a;\n color += sample1 * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}"
|
|
8910
8959
|
} });
|
|
@@ -8912,7 +8961,7 @@ var Aa, ja = class extends Cr {
|
|
|
8912
8961
|
let n = this.currentTimeProgress, r, i;
|
|
8913
8962
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8914
8963
|
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);
|
|
8915
|
-
|
|
8964
|
+
L.draw(e, Pa.material, {
|
|
8916
8965
|
sampler: r,
|
|
8917
8966
|
progress: i,
|
|
8918
8967
|
blur: this.blur,
|
|
@@ -8921,7 +8970,7 @@ var Aa, ja = class extends Cr {
|
|
|
8921
8970
|
end: c,
|
|
8922
8971
|
delta: [u / f, d / f],
|
|
8923
8972
|
texSize: l
|
|
8924
|
-
}),
|
|
8973
|
+
}), L.draw(e, Pa.material, {
|
|
8925
8974
|
sampler: r,
|
|
8926
8975
|
progress: i,
|
|
8927
8976
|
blur: this.blur,
|
|
@@ -8933,18 +8982,18 @@ var Aa, ja = class extends Cr {
|
|
|
8933
8982
|
});
|
|
8934
8983
|
}
|
|
8935
8984
|
};
|
|
8936
|
-
|
|
8985
|
+
Fa = Pa = k([b("TiltShiftTransition")], Fa);
|
|
8937
8986
|
//#endregion
|
|
8938
8987
|
//#region src/scene/transitions/TwistTransition.ts
|
|
8939
|
-
var
|
|
8988
|
+
var Ia, La = class extends Cr {
|
|
8940
8989
|
static {
|
|
8941
|
-
|
|
8990
|
+
Ia = this;
|
|
8942
8991
|
}
|
|
8943
8992
|
radius;
|
|
8944
8993
|
angle = 4;
|
|
8945
8994
|
padding = 20;
|
|
8946
8995
|
offset;
|
|
8947
|
-
static material = new
|
|
8996
|
+
static material = new I({ gl: {
|
|
8948
8997
|
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}",
|
|
8949
8998
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\nuniform float progress;\n\nvec2 mapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord *= filterArea.xy;\n return coord;\n}\n\nvec2 unmapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n return coord;\n}\n\nvec2 twist(vec2 coord, float radius) {\n coord -= offset;\n float dist = length(coord);\n if (dist < radius) {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n coord += offset;\n return coord;\n}\n\nvoid main(void) {\n vec2 coord = mapCoord(vUv);\n coord = twist(coord, radius - (progress * radius));\n coord = unmapCoord(coord);\n gl_FragColor = texture2D(sampler, coord);\n}"
|
|
8950
8999
|
} });
|
|
@@ -8952,7 +9001,7 @@ var Ma, Na = class extends Cr {
|
|
|
8952
9001
|
let n = this.currentTimeProgress, r, i;
|
|
8953
9002
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8954
9003
|
let a = t.width, o = t.height;
|
|
8955
|
-
|
|
9004
|
+
L.draw(e, Ia.material, {
|
|
8956
9005
|
sampler: r,
|
|
8957
9006
|
progress: i,
|
|
8958
9007
|
filterArea: [
|
|
@@ -8968,10 +9017,10 @@ var Ma, Na = class extends Cr {
|
|
|
8968
9017
|
});
|
|
8969
9018
|
}
|
|
8970
9019
|
};
|
|
8971
|
-
|
|
9020
|
+
La = Ia = k([b("TwistTransition")], La);
|
|
8972
9021
|
//#endregion
|
|
8973
9022
|
//#region src/asset/loaders/GifLoader.ts
|
|
8974
|
-
var
|
|
9023
|
+
var Ra = class extends Vn {
|
|
8975
9024
|
install(e) {
|
|
8976
9025
|
let t = async (t) => {
|
|
8977
9026
|
let { decodeFrames: n } = await import("modern-gif");
|
|
@@ -8988,14 +9037,14 @@ var Pa = class extends Vn {
|
|
|
8988
9037
|
e.register(n, t);
|
|
8989
9038
|
}), e.gif = this, this;
|
|
8990
9039
|
}
|
|
8991
|
-
},
|
|
9040
|
+
}, za = class extends Vn {
|
|
8992
9041
|
install(e) {
|
|
8993
9042
|
let t = async (e) => JSON.parse(await e.text());
|
|
8994
9043
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
8995
9044
|
e.register(n, t);
|
|
8996
9045
|
}), e.json = this, this;
|
|
8997
9046
|
}
|
|
8998
|
-
},
|
|
9047
|
+
}, Ba = class extends Vn {
|
|
8999
9048
|
install(e) {
|
|
9000
9049
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
9001
9050
|
container: null,
|
|
@@ -9006,14 +9055,14 @@ var Pa = class extends Vn {
|
|
|
9006
9055
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
9007
9056
|
}), e.lottie = this, this;
|
|
9008
9057
|
}
|
|
9009
|
-
},
|
|
9058
|
+
}, Va = class extends Vn {
|
|
9010
9059
|
install(e) {
|
|
9011
9060
|
let t = async (e) => e.text();
|
|
9012
9061
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
9013
9062
|
}
|
|
9014
|
-
},
|
|
9063
|
+
}, Ha = class extends Vn {
|
|
9015
9064
|
install(e) {
|
|
9016
|
-
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new
|
|
9065
|
+
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new z({
|
|
9017
9066
|
source: e,
|
|
9018
9067
|
uploadMethodId: "image",
|
|
9019
9068
|
mipmap: !0,
|
|
@@ -9035,11 +9084,11 @@ var Pa = class extends Vn {
|
|
|
9035
9084
|
e.register(n, t);
|
|
9036
9085
|
}), e.texture = this, this;
|
|
9037
9086
|
}
|
|
9038
|
-
},
|
|
9087
|
+
}, Ua = class extends Vn {
|
|
9039
9088
|
install(e) {
|
|
9040
9089
|
return this.load = (t) => e.awaitBy(() => new ar(t).load()), e.video = this, this;
|
|
9041
9090
|
}
|
|
9042
|
-
},
|
|
9091
|
+
}, Wa = Object.entries({
|
|
9043
9092
|
"font/woff": ["woff"],
|
|
9044
9093
|
"font/ttf": ["ttf"],
|
|
9045
9094
|
"font/otf": ["otf"],
|
|
@@ -9055,31 +9104,31 @@ var Pa = class extends Vn {
|
|
|
9055
9104
|
"image/webp": ["webp"],
|
|
9056
9105
|
"application/json": ["json"]
|
|
9057
9106
|
});
|
|
9058
|
-
function
|
|
9059
|
-
for (let [t, n] of
|
|
9107
|
+
function Ga(e) {
|
|
9108
|
+
for (let [t, n] of Wa) if (n.includes(e)) return t;
|
|
9060
9109
|
}
|
|
9061
|
-
function
|
|
9110
|
+
function Ka(e) {
|
|
9062
9111
|
let t;
|
|
9063
9112
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
9064
9113
|
else if (e.startsWith("http")) {
|
|
9065
9114
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
9066
|
-
n && (t =
|
|
9115
|
+
n && (t = Ga(n));
|
|
9067
9116
|
}
|
|
9068
9117
|
return t;
|
|
9069
9118
|
}
|
|
9070
9119
|
//#endregion
|
|
9071
9120
|
//#region src/asset/Assets.ts
|
|
9072
|
-
var
|
|
9121
|
+
var qa = "WeakRef" in globalThis, Ja = class extends e {
|
|
9073
9122
|
defaultHandler = (e) => e;
|
|
9074
9123
|
_handlers = /* @__PURE__ */ new Map();
|
|
9075
9124
|
_handleing = /* @__PURE__ */ new Map();
|
|
9076
9125
|
_handled = /* @__PURE__ */ new Map();
|
|
9077
|
-
_gc =
|
|
9126
|
+
_gc = qa ? new FinalizationRegistry((e) => {
|
|
9078
9127
|
let t = this.get(e);
|
|
9079
9128
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
9080
9129
|
}) : void 0;
|
|
9081
9130
|
constructor() {
|
|
9082
|
-
super(),
|
|
9131
|
+
super(), qa || x.on(this.gc.bind(this), { sort: 2 });
|
|
9083
9132
|
}
|
|
9084
9133
|
use(e) {
|
|
9085
9134
|
return e.install(this), this;
|
|
@@ -9128,11 +9177,11 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9128
9177
|
}
|
|
9129
9178
|
get(e) {
|
|
9130
9179
|
let t = this._handled.get(e);
|
|
9131
|
-
return
|
|
9180
|
+
return qa && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
9132
9181
|
}
|
|
9133
9182
|
set(e, t) {
|
|
9134
9183
|
let n = t;
|
|
9135
|
-
|
|
9184
|
+
qa && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
|
|
9136
9185
|
}
|
|
9137
9186
|
async awaitBy(e) {
|
|
9138
9187
|
let t = e(), n = c();
|
|
@@ -9147,7 +9196,7 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9147
9196
|
return this._handleing.set(e, r), r;
|
|
9148
9197
|
}
|
|
9149
9198
|
async load(e, t) {
|
|
9150
|
-
let n = await this.loadBy(e), r =
|
|
9199
|
+
let n = await this.loadBy(e), r = Ka(e);
|
|
9151
9200
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
9152
9201
|
}
|
|
9153
9202
|
async waitUntilLoad() {
|
|
@@ -9161,14 +9210,14 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9161
9210
|
n && "destroy" in n && n.destroy();
|
|
9162
9211
|
}), this._handled.clear();
|
|
9163
9212
|
}
|
|
9164
|
-
}, $ = new
|
|
9213
|
+
}, $ = new Ja().use(new Hn()).use(new Ra()).use(new za()).use(new Ba()).use(new Va()).use(new Ha()).use(new Ua()), Ya = {
|
|
9165
9214
|
alpha: !0,
|
|
9166
9215
|
stencil: !0,
|
|
9167
9216
|
antialias: !1,
|
|
9168
9217
|
premultipliedAlpha: !0,
|
|
9169
9218
|
preserveDrawingBuffer: !1,
|
|
9170
9219
|
powerPreference: "default"
|
|
9171
|
-
},
|
|
9220
|
+
}, Xa = class extends Sr {
|
|
9172
9221
|
renderer;
|
|
9173
9222
|
get view() {
|
|
9174
9223
|
return this.renderer.view;
|
|
@@ -9191,7 +9240,7 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9191
9240
|
set pixelRatio(e) {
|
|
9192
9241
|
this.renderer.pixelRatio = e, this.resize(this.width, this.height);
|
|
9193
9242
|
}
|
|
9194
|
-
_resizeObserver =
|
|
9243
|
+
_resizeObserver = Fe ? new ResizeObserver((e) => {
|
|
9195
9244
|
let t = e[0];
|
|
9196
9245
|
if (t.target === this.view) {
|
|
9197
9246
|
let { inlineSize: e, blockSize: n } = Array.isArray(t.contentBoxSize) ? t.contentBoxSize[0] : t.contentBoxSize;
|
|
@@ -9199,14 +9248,14 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9199
9248
|
}
|
|
9200
9249
|
}) : void 0;
|
|
9201
9250
|
constructor(e = {}) {
|
|
9202
|
-
let { view: t, width: n, height: r, pixelRatio: i =
|
|
9251
|
+
let { view: t, width: n, height: r, pixelRatio: i = Ye, autoResize: a, data: o } = e;
|
|
9203
9252
|
super(), this.renderer = new Bn(t, {
|
|
9204
|
-
alpha:
|
|
9205
|
-
stencil:
|
|
9206
|
-
antialias:
|
|
9207
|
-
premultipliedAlpha:
|
|
9208
|
-
preserveDrawingBuffer:
|
|
9209
|
-
powerPreference:
|
|
9253
|
+
alpha: Ya.alpha ?? e.alpha,
|
|
9254
|
+
stencil: Ya.stencil ?? e.stencil,
|
|
9255
|
+
antialias: Ya.antialias ?? e.antialias,
|
|
9256
|
+
premultipliedAlpha: Ya.premultipliedAlpha ?? e.premultipliedAlpha,
|
|
9257
|
+
preserveDrawingBuffer: Ya.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
|
|
9258
|
+
powerPreference: Ya.powerPreference ?? e.powerPreference
|
|
9210
9259
|
}), 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);
|
|
9211
9260
|
}
|
|
9212
9261
|
_updateProperty(e, t, n) {
|
|
@@ -9239,7 +9288,7 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9239
9288
|
return this.renderer.resize(e, t, n), this.root.width = e, this.root.height = t, this.render(), this;
|
|
9240
9289
|
}
|
|
9241
9290
|
nextTick() {
|
|
9242
|
-
return
|
|
9291
|
+
return xe();
|
|
9243
9292
|
}
|
|
9244
9293
|
async waitUntilLoad() {
|
|
9245
9294
|
await $.waitUntilLoad(), await this.nextTick();
|
|
@@ -9289,22 +9338,22 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9289
9338
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
9290
9339
|
}
|
|
9291
9340
|
};
|
|
9292
|
-
|
|
9341
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], Xa.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Xa.prototype, "autoStart", void 0);
|
|
9293
9342
|
//#endregion
|
|
9294
9343
|
//#region src/render.ts
|
|
9295
|
-
var
|
|
9296
|
-
function
|
|
9297
|
-
return
|
|
9344
|
+
var Za, Qa = [], $a = !1;
|
|
9345
|
+
function eo() {
|
|
9346
|
+
return Za ??= new Xa({
|
|
9298
9347
|
pixelRatio: 1,
|
|
9299
9348
|
width: 1,
|
|
9300
9349
|
height: 1,
|
|
9301
9350
|
preserveDrawingBuffer: !0
|
|
9302
9351
|
});
|
|
9303
9352
|
}
|
|
9304
|
-
async function
|
|
9305
|
-
if (
|
|
9306
|
-
for (
|
|
9307
|
-
let t =
|
|
9353
|
+
async function to(e = 100) {
|
|
9354
|
+
if (!$a) {
|
|
9355
|
+
for ($a = !0; Qa.length;) {
|
|
9356
|
+
let t = Qa.shift();
|
|
9308
9357
|
if (t) try {
|
|
9309
9358
|
await t();
|
|
9310
9359
|
} catch (e) {
|
|
@@ -9312,11 +9361,11 @@ async function Za(e = 100) {
|
|
|
9312
9361
|
}
|
|
9313
9362
|
else await new Promise((t) => setTimeout(t, e));
|
|
9314
9363
|
}
|
|
9315
|
-
|
|
9364
|
+
$a = !1;
|
|
9316
9365
|
}
|
|
9317
9366
|
}
|
|
9318
|
-
async function
|
|
9319
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f =
|
|
9367
|
+
async function no(e) {
|
|
9368
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = eo();
|
|
9320
9369
|
if (f.resetProperties(), f.setProperties(l), f.debug = t, f.fonts = n, f.timeline.currentTime = 0, f.resize(u, d, !0), f.root.removeChildren(!0), f.root.append(a), await s?.(f), await f.waitAndRender(), o.length) {
|
|
9321
9370
|
let e = o.length, t = o[e - 1];
|
|
9322
9371
|
for (let n = 0; n < e; n++) {
|
|
@@ -9334,15 +9383,15 @@ async function Qa(e) {
|
|
|
9334
9383
|
toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
|
|
9335
9384
|
};
|
|
9336
9385
|
}
|
|
9337
|
-
async function
|
|
9386
|
+
async function ro(e) {
|
|
9338
9387
|
return new Promise((t) => {
|
|
9339
|
-
|
|
9388
|
+
Qa.push(async () => t(await no(e).then((e) => e.toCanvas2D()))), to();
|
|
9340
9389
|
});
|
|
9341
9390
|
}
|
|
9342
|
-
async function
|
|
9391
|
+
async function io(e) {
|
|
9343
9392
|
return new Promise((t) => {
|
|
9344
|
-
|
|
9393
|
+
Qa.push(async () => t(await no(e).then((e) => e.pixels))), to();
|
|
9345
9394
|
});
|
|
9346
9395
|
}
|
|
9347
9396
|
//#endregion
|
|
9348
|
-
export {
|
|
9397
|
+
export { yt as Aabb2D, $n as AnimatedTexture, ha as Animation, Ja as Assets, Da as Audio, ya as AudioPipeline, ba as AudioProcessor, Oa as AudioSpectrum, ka as AudioWaveform, A as BufferUsage, Tr as Camera2D, sr as CanvasContext, _r as CanvasItem, er as CanvasTexture, T as Color, W as ColorAdjustEffect, Rr as ColorFilterEffect, St as ColorMatrix, Vr as ColorOverlayEffect, Ur as ColorRemoveEffect, Kr as ColorReplaceEffect, tr as ColorTexture, C as CoreObject, bt as DEG_TO_RAD, Ye as DEVICE_PIXEL_RATIO, G as DrawboardEffect, $r as DropShadowEffect, U as Effect, Xn as EffectMaterial, ea as Element2D, _i as Element2DBackground, X as Element2DChart, xi as Element2DConnection, Y as Element2DFill, ki as Element2DForeground, ji as Element2DOutline, Mi as Element2DShadow, Ni as Element2DShape, Pi as Element2DStyle, Ri as Element2DTable, Z as Element2DText, ti as EmbossEffect, Xa as Engine, Yi as Flexbox, Hn as FontLoader, Zr as GaussianBlurEffect, Wn as Geometry, Ra as GifLoader, ln as GlBatch2DSystem, an as GlBlendMode, Dt as GlBuffer, Pt as GlBufferSystem, Et as GlBufferTarget, pn as GlMaskSystem, Kt as GlProgram, _n as GlRenderTarget, vn as GlRenderTargetSystem, tn as GlShaderSystem, sn as GlState, cn as GlStateSystem, hn as GlStencilSystem, j as GlSystem, gn as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, nr as GradientTexture, va as HTMLAudio, ga as HTMLAudioContext, _a as HTMLSound, qe as IN_BROWSER, Je as IN_MAC_OS, Un as IndexBuffer, _t as Input, dt as InputEvent, za as JsonLoader, si as KawaseBlurEffect, ja as KawaseTransition, ft as KeyboardInputEvent, Na as LeftEraseTransition, Vn as Loader, na as Lottie2D, Ba as LottieLoader, Tt as MainLoop, li as MaskEffect, I as Material, lr as Meta, pt as MouseInputEvent, B as Node, wr as Node2D, Ct as Obb2D, J as OutlineEffect, Se as PI, Ce as PI_2, pi as PixelateEffect, rr as PixelsTexture, mt as PointerInputEvent, wt as Projection2D, Gn as QuadGeometry, L as QuadUvGeometry, xt as RAD_TO_DEG, vt as RefCounted, R as RenderTarget, Ot as Renderer, w as Resource, He as SUPPORTS_AUDIO_CONTEXT, Be as SUPPORTS_CLICK_EVENTS, Ve as SUPPORTS_CREATE_IMAGE_BITMAP, Pe as SUPPORTS_IMAGE_BITMAP, Re as SUPPORTS_MOUSE_EVENTS, We as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Ie as SUPPORTS_POINTER_EVENTS, Fe as SUPPORTS_RESIZE_OBSERVER, ze as SUPPORTS_TOUCH_EVENTS, Ne as SUPPORTS_WEBGL2, Ue as SUPPORTS_WEBKIT_AUDIO_CONTEXT, Ge as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ke as SUPPORTS_WEB_AUDIO, Le as SUPPORTS_WHEEL_EVENTS, Sr as SceneTree, Va as TextLoader, z as Texture2D, Ha as TextureLoader, ta as TextureRect2D, x as Ticker, Fa as TiltShiftTransition, br as Timeline, V as TimelineNode, ra as TransformRect2D, Cr as Transition, La as TwistTransition, At as UniformGroup, Qn as UvGeometry, Zn as UvMaterial, F as VertexAttribute, P as VertexBuffer, ia as Video2D, Ua as VideoLoader, ar as VideoTexture, H as Viewport, or as ViewportTexture, Ta as WebAudio, Ca as WebAudioContext, Bn as WebGLRenderer, wa as WebSound, ht as WheelInputEvent, xr as Window, hi as ZoomBlurEffect, Bi as alignMap, $ as assets, Er as axisDir, Ji as boxSizingMap, E as clamp, oi as clampFrag, S as createHTMLCanvas, Nt as createIdFromString, be as createNode, ct as crossOrigin, pa as cubicBezier, b as customNode, ye as customNodes, Ya as defaultOptions, st as determineCrossOrigin, Hi as directionMap, Vi as displayMap, la as ease, ua as easeIn, fa as easeInOut, da as easeOut, Q as edgeMap, Ui as flexDirectionMap, Wi as flexWrapMap, ai as frag, rt as getCanvasFactory, Oe as getDefaultCssPropertyValue, ot as getGlContextProvider, eo as getRenderEngine, zi as gutterMap, ut as instanceId, $e as isCanvasElement, Xe as isElementNode, Qe as isImageElement, we as isPow2, Ze as isVideoElement, et as isWebgl2, Gi as justifyMap, D as lerp, ca as linear, dn as log2, on as mapGlBlendModes, un as nextPow2, xe as nextTick, Ki as overflowMap, Pr as parseCssFilter, Ae as parseCssFunctions, ke as parseCssProperty, Fr as parseCssTransformOrigin, qi as positionTypeMap, ro as render, io as renderPixels, hr as resetBatchPool, Dr as routeConnection, nt as setCanvasFactory, at as setGlContextProvider, mn as stencilModeMap, ma as timingFunctions };
|