modern-canvas 0.24.11 → 0.24.13
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 +749 -821
- package/dist/scene/2d/element/Element2DFill.d.ts +15 -2
- package/dist/scene/2d/element/Element2DForeground.d.ts +6 -36
- package/dist/scene/2d/element/imagePipeline.d.ts +11 -0
- package/dist/scene/2d/element/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/scene/2d/element/bakeImageEffects.d.ts +0 -17
package/dist/index.js
CHANGED
|
@@ -680,7 +680,7 @@ var dt = class e {
|
|
|
680
680
|
//#endregion
|
|
681
681
|
//#region src/core/math/Color.ts
|
|
682
682
|
pe([me]);
|
|
683
|
-
var
|
|
683
|
+
var xt = class {
|
|
684
684
|
get value() {
|
|
685
685
|
return this._value;
|
|
686
686
|
}
|
|
@@ -763,16 +763,16 @@ var E = class {
|
|
|
763
763
|
this.a
|
|
764
764
|
];
|
|
765
765
|
}
|
|
766
|
-
},
|
|
767
|
-
function
|
|
766
|
+
}, St = xe / 180, Ct = 180 / xe;
|
|
767
|
+
function E(e, t, n) {
|
|
768
768
|
return Math.max(t, Math.min(e, n));
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function D(e, t, n) {
|
|
771
771
|
return (1 - n) * e + n * t;
|
|
772
772
|
}
|
|
773
773
|
//#endregion
|
|
774
774
|
//#region src/core/math/ColorMatrix.ts
|
|
775
|
-
var
|
|
775
|
+
var wt = class {
|
|
776
776
|
_array = /* @__PURE__ */ new Float32Array(20);
|
|
777
777
|
constructor() {
|
|
778
778
|
this.identity();
|
|
@@ -902,7 +902,7 @@ var Ct = class {
|
|
|
902
902
|
]);
|
|
903
903
|
}
|
|
904
904
|
invert(e = 1) {
|
|
905
|
-
let t =
|
|
905
|
+
let t = D(1, -1, e), n = D(0, 255, e);
|
|
906
906
|
return this.multiply([
|
|
907
907
|
t,
|
|
908
908
|
0,
|
|
@@ -927,21 +927,21 @@ var Ct = class {
|
|
|
927
927
|
]);
|
|
928
928
|
}
|
|
929
929
|
sepia(e = 1) {
|
|
930
|
-
let t =
|
|
930
|
+
let t = E(e, 0, 1);
|
|
931
931
|
return this.multiply([
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
932
|
+
D(1, .393, t),
|
|
933
|
+
D(0, .7689999, t),
|
|
934
|
+
D(0, .18899999, t),
|
|
935
935
|
0,
|
|
936
936
|
0,
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
937
|
+
D(0, .349, t),
|
|
938
|
+
D(1, .6859999, t),
|
|
939
|
+
D(0, .16799999, t),
|
|
940
940
|
0,
|
|
941
941
|
0,
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
942
|
+
D(0, .272, t),
|
|
943
|
+
D(0, .5339999, t),
|
|
944
|
+
D(1, .13099999, t),
|
|
945
945
|
0,
|
|
946
946
|
0,
|
|
947
947
|
0,
|
|
@@ -976,7 +976,7 @@ var Ct = class {
|
|
|
976
976
|
]);
|
|
977
977
|
}
|
|
978
978
|
grayscale(e = 1) {
|
|
979
|
-
let t =
|
|
979
|
+
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);
|
|
980
980
|
return this.multiply([
|
|
981
981
|
n,
|
|
982
982
|
a,
|
|
@@ -1028,10 +1028,10 @@ var Ct = class {
|
|
|
1028
1028
|
toArray() {
|
|
1029
1029
|
return this._array;
|
|
1030
1030
|
}
|
|
1031
|
-
},
|
|
1031
|
+
}, Tt = class e extends bt {
|
|
1032
1032
|
rotation;
|
|
1033
1033
|
get rotationDegrees() {
|
|
1034
|
-
return this.rotation /
|
|
1034
|
+
return this.rotation / St;
|
|
1035
1035
|
}
|
|
1036
1036
|
constructor(...e) {
|
|
1037
1037
|
let t, n;
|
|
@@ -1041,7 +1041,7 @@ var Ct = class {
|
|
|
1041
1041
|
if (!this.rotation && (!("rotation" in e) || !e.rotation)) return super.overlap(e, t);
|
|
1042
1042
|
{
|
|
1043
1043
|
let t = (e, t) => Math.abs(e.x * t.x + e.y * t.y), n = (e) => {
|
|
1044
|
-
let { width: n, height: r, rotation: i = 0 } = e, a = i /
|
|
1044
|
+
let { width: n, height: r, rotation: i = 0 } = e, a = i / St;
|
|
1045
1045
|
a = -a % 180;
|
|
1046
1046
|
let o = a / 180 * Math.PI, s = {
|
|
1047
1047
|
x: Math.cos(o),
|
|
@@ -1083,7 +1083,7 @@ var Ct = class {
|
|
|
1083
1083
|
clone() {
|
|
1084
1084
|
return new e(this.toJSON());
|
|
1085
1085
|
}
|
|
1086
|
-
},
|
|
1086
|
+
}, Et = class {
|
|
1087
1087
|
_array;
|
|
1088
1088
|
x = 0;
|
|
1089
1089
|
y = 0;
|
|
@@ -1107,12 +1107,12 @@ var Ct = class {
|
|
|
1107
1107
|
};
|
|
1108
1108
|
//#endregion
|
|
1109
1109
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateMetadata.js
|
|
1110
|
-
function
|
|
1110
|
+
function O(e, t) {
|
|
1111
1111
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
1112
1112
|
}
|
|
1113
1113
|
//#endregion
|
|
1114
1114
|
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
|
|
1115
|
-
function
|
|
1115
|
+
function k(e, t, n, r) {
|
|
1116
1116
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
1117
1117
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
1118
1118
|
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);
|
|
@@ -1120,7 +1120,7 @@ function A(e, t, n, r) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
//#endregion
|
|
1122
1122
|
//#region src/core/os/MainLoop.ts
|
|
1123
|
-
var
|
|
1123
|
+
var Dt = class extends T {
|
|
1124
1124
|
_starting = !1;
|
|
1125
1125
|
_nextDeltaTime = 0;
|
|
1126
1126
|
_startedProcess;
|
|
@@ -1150,22 +1150,22 @@ var Et = class extends T {
|
|
|
1150
1150
|
super._destroy(), this.stop();
|
|
1151
1151
|
}
|
|
1152
1152
|
};
|
|
1153
|
-
|
|
1153
|
+
k([_({ fallback: 60 }), O("design:type", Number)], Dt.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Dt.prototype, "speed", void 0);
|
|
1154
1154
|
//#endregion
|
|
1155
1155
|
//#region src/core/renderers/gl/buffer/const.ts
|
|
1156
|
-
var
|
|
1156
|
+
var Ot = /* @__PURE__ */ function(e) {
|
|
1157
1157
|
return e[e.elementArrayBuffer = 34963] = "elementArrayBuffer", e[e.arrayBuffer = 34962] = "arrayBuffer", e[e.uniformBuffer = 35345] = "uniformBuffer", e;
|
|
1158
|
-
}({}),
|
|
1158
|
+
}({}), kt = class {
|
|
1159
1159
|
native;
|
|
1160
|
-
target =
|
|
1160
|
+
target = Ot.arrayBuffer;
|
|
1161
1161
|
byteLength = 0;
|
|
1162
1162
|
dirty = !0;
|
|
1163
1163
|
constructor(e) {
|
|
1164
1164
|
this.native = e;
|
|
1165
1165
|
}
|
|
1166
|
-
},
|
|
1166
|
+
}, A = /* @__PURE__ */ function(e) {
|
|
1167
1167
|
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;
|
|
1168
|
-
}({}),
|
|
1168
|
+
}({}), At = class extends n {
|
|
1169
1169
|
screen = {
|
|
1170
1170
|
x: 0,
|
|
1171
1171
|
y: 0,
|
|
@@ -1184,12 +1184,12 @@ var Dt = /* @__PURE__ */ function(e) {
|
|
|
1184
1184
|
this.view && (this.view.width = Math.floor(e * this.pixelRatio), this.view.height = Math.floor(t * this.pixelRatio)), this.screen.width = e, this.screen.height = t, n && this.view && (this.view.style.width = `${e}px`, this.view.style.height = `${t}px`);
|
|
1185
1185
|
}
|
|
1186
1186
|
};
|
|
1187
|
-
|
|
1187
|
+
k([_({ fallback: Ye }), O("design:type", Number)], At.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], At.prototype, "view", void 0);
|
|
1188
1188
|
//#endregion
|
|
1189
1189
|
//#region src/core/renderers/shared/shader/UniformGroup.ts
|
|
1190
|
-
var
|
|
1190
|
+
var jt = 0, Mt = class {
|
|
1191
1191
|
isUniformGroup = !0;
|
|
1192
|
-
uid = ++
|
|
1192
|
+
uid = ++jt;
|
|
1193
1193
|
uniforms;
|
|
1194
1194
|
ubo;
|
|
1195
1195
|
isStatic;
|
|
@@ -1200,14 +1200,14 @@ var At = 0, jt = class {
|
|
|
1200
1200
|
update() {
|
|
1201
1201
|
this._dirtyId++;
|
|
1202
1202
|
}
|
|
1203
|
-
},
|
|
1204
|
-
function
|
|
1205
|
-
let n =
|
|
1206
|
-
return n === void 0 && (
|
|
1203
|
+
}, Nt = Object.create(null), Pt = Object.create(null);
|
|
1204
|
+
function Ft(e, t) {
|
|
1205
|
+
let n = Pt[e];
|
|
1206
|
+
return n === void 0 && (Nt[t] === void 0 && (Nt[t] = 1), Pt[e] = n = Nt[t]++), n;
|
|
1207
1207
|
}
|
|
1208
1208
|
//#endregion
|
|
1209
1209
|
//#region src/core/renderers/gl/system/GlSystem.ts
|
|
1210
|
-
var
|
|
1210
|
+
var j = class extends e {
|
|
1211
1211
|
get _gl() {
|
|
1212
1212
|
return this._renderer.gl;
|
|
1213
1213
|
}
|
|
@@ -1221,7 +1221,7 @@ var M = class extends e {
|
|
|
1221
1221
|
_setup() {}
|
|
1222
1222
|
flush() {}
|
|
1223
1223
|
reset() {}
|
|
1224
|
-
},
|
|
1224
|
+
}, It = class extends j {
|
|
1225
1225
|
install(e) {
|
|
1226
1226
|
super.install(e), e.buffer = this;
|
|
1227
1227
|
}
|
|
@@ -1231,8 +1231,8 @@ var M = class extends e {
|
|
|
1231
1231
|
return this.glBuffers.get(e.instanceId) || this._createGlBuffer(e);
|
|
1232
1232
|
}
|
|
1233
1233
|
_createGlBuffer(e) {
|
|
1234
|
-
let t = this._gl, n = new
|
|
1235
|
-
return e.usage &
|
|
1234
|
+
let t = this._gl, n = new kt(t.createBuffer()), r = Ot.arrayBuffer;
|
|
1235
|
+
return e.usage & A.index ? r = Ot.elementArrayBuffer : e.usage & A.uniform && (r = Ot.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
|
|
1236
1236
|
switch (e) {
|
|
1237
1237
|
case "usage":
|
|
1238
1238
|
case "data":
|
|
@@ -1255,7 +1255,7 @@ var M = class extends e {
|
|
|
1255
1255
|
n.dirty = !1;
|
|
1256
1256
|
let { _gl: r } = this, { usage: i, data: a } = e;
|
|
1257
1257
|
r.bindBuffer(n.target, n.native);
|
|
1258
|
-
let o = i &
|
|
1258
|
+
let o = i & A.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
|
|
1259
1259
|
if (a) if (n.byteLength >= a.byteLength) {
|
|
1260
1260
|
let e = a.length * a.BYTES_PER_ELEMENT;
|
|
1261
1261
|
r.bufferSubData(n.target, 0, a, 0, e / a.BYTES_PER_ELEMENT);
|
|
@@ -1270,13 +1270,13 @@ var M = class extends e {
|
|
|
1270
1270
|
}
|
|
1271
1271
|
this.buffers.clear(), this.glBuffers.clear();
|
|
1272
1272
|
}
|
|
1273
|
-
},
|
|
1274
|
-
function
|
|
1275
|
-
return
|
|
1273
|
+
}, Lt;
|
|
1274
|
+
function Rt() {
|
|
1275
|
+
return Lt ||= "mediump", Lt;
|
|
1276
1276
|
}
|
|
1277
1277
|
//#endregion
|
|
1278
1278
|
//#region src/core/renderers/gl/shader/preprocessors/addProgramDefines.ts
|
|
1279
|
-
function
|
|
1279
|
+
function zt(e, t, n) {
|
|
1280
1280
|
return t ? e : n ? (e = e.replace("out vec4 finalColor;", ""), `#ifdef GL_ES
|
|
1281
1281
|
#define in varying
|
|
1282
1282
|
#define finalColor gl_FragColor
|
|
@@ -1290,7 +1290,7 @@ ${e}`;
|
|
|
1290
1290
|
}
|
|
1291
1291
|
//#endregion
|
|
1292
1292
|
//#region src/core/renderers/gl/shader/preprocessors/ensurePrecision.ts
|
|
1293
|
-
function
|
|
1293
|
+
function Bt(e, t, n) {
|
|
1294
1294
|
let r = n ? t.maxSupportedFragmentPrecision : t.maxSupportedVertexPrecision;
|
|
1295
1295
|
if (e.substring(0, 9) !== "precision") {
|
|
1296
1296
|
let i = n ? t.requestedFragmentPrecision : t.requestedVertexPrecision;
|
|
@@ -1300,31 +1300,31 @@ function zt(e, t, n) {
|
|
|
1300
1300
|
}
|
|
1301
1301
|
//#endregion
|
|
1302
1302
|
//#region src/core/renderers/gl/shader/preprocessors/insertVersion.ts
|
|
1303
|
-
function
|
|
1303
|
+
function Vt(e, t) {
|
|
1304
1304
|
return t ? `#version 300 es\n${e}` : e;
|
|
1305
1305
|
}
|
|
1306
1306
|
//#endregion
|
|
1307
1307
|
//#region src/core/renderers/gl/shader/preprocessors/setProgramName.ts
|
|
1308
|
-
var
|
|
1309
|
-
function
|
|
1308
|
+
var Ht = {}, Ut = {};
|
|
1309
|
+
function Wt(e, { name: t = "program" }, n = !0) {
|
|
1310
1310
|
t = t.replace(/\s+/g, "-"), t += n ? "-fragment" : "-vertex";
|
|
1311
|
-
let r = n ?
|
|
1311
|
+
let r = n ? Ht : Ut;
|
|
1312
1312
|
return r[t] ? (r[t]++, t += `-${r[t]}`) : r[t] = 1, e.includes("#define SHADER_NAME") ? e : `${`#define SHADER_NAME ${t}`}\n${e}`;
|
|
1313
1313
|
}
|
|
1314
1314
|
//#endregion
|
|
1315
1315
|
//#region src/core/renderers/gl/shader/preprocessors/stripVersion.ts
|
|
1316
|
-
function
|
|
1316
|
+
function Gt(e, t) {
|
|
1317
1317
|
return t ? e.replace("#version 300 es", "") : e;
|
|
1318
1318
|
}
|
|
1319
1319
|
//#endregion
|
|
1320
1320
|
//#region src/core/renderers/gl/shader/GlProgram.ts
|
|
1321
|
-
var
|
|
1322
|
-
stripVersion:
|
|
1323
|
-
ensurePrecision:
|
|
1324
|
-
addProgramDefines:
|
|
1325
|
-
setProgramName:
|
|
1326
|
-
insertVersion:
|
|
1327
|
-
},
|
|
1321
|
+
var Kt = Object.create(null), qt = {
|
|
1322
|
+
stripVersion: Gt,
|
|
1323
|
+
ensurePrecision: Bt,
|
|
1324
|
+
addProgramDefines: zt,
|
|
1325
|
+
setProgramName: Wt,
|
|
1326
|
+
insertVersion: Vt
|
|
1327
|
+
}, Jt = class e {
|
|
1328
1328
|
static defaultOptions = {
|
|
1329
1329
|
preferredVertexPrecision: "highp",
|
|
1330
1330
|
preferredFragmentPrecision: "mediump"
|
|
@@ -1347,25 +1347,25 @@ var Gt = Object.create(null), Kt = {
|
|
|
1347
1347
|
requestedFragmentPrecision: t.preferredFragmentPrecision,
|
|
1348
1348
|
requestedVertexPrecision: t.preferredVertexPrecision,
|
|
1349
1349
|
maxSupportedVertexPrecision: "highp",
|
|
1350
|
-
maxSupportedFragmentPrecision:
|
|
1350
|
+
maxSupportedFragmentPrecision: Rt()
|
|
1351
1351
|
},
|
|
1352
1352
|
setProgramName: { name: t.name },
|
|
1353
1353
|
addProgramDefines: i,
|
|
1354
1354
|
insertVersion: i
|
|
1355
1355
|
};
|
|
1356
|
-
Object.keys(
|
|
1356
|
+
Object.keys(qt).forEach((e) => {
|
|
1357
1357
|
let t = a[e];
|
|
1358
|
-
n =
|
|
1359
|
-
}), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id =
|
|
1358
|
+
n = qt[e](n, t, !0), r = qt[e](r, t, !1);
|
|
1359
|
+
}), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = Ft(`${r}:${n}`, "GlProgram");
|
|
1360
1360
|
}
|
|
1361
1361
|
destroy() {
|
|
1362
|
-
this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete
|
|
1362
|
+
this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete Kt[this._cacheKey];
|
|
1363
1363
|
}
|
|
1364
1364
|
static from(t) {
|
|
1365
1365
|
let n = `${t.vertex}:${t.fragment}`;
|
|
1366
|
-
return
|
|
1366
|
+
return Kt[n] || (Kt[n] = new e(t), Kt[n]._cacheKey = n), Kt[n];
|
|
1367
1367
|
}
|
|
1368
|
-
},
|
|
1368
|
+
}, Yt = {
|
|
1369
1369
|
uint8x2: {
|
|
1370
1370
|
size: 2,
|
|
1371
1371
|
stride: 2,
|
|
@@ -1517,19 +1517,19 @@ var Gt = Object.create(null), Kt = {
|
|
|
1517
1517
|
normalized: !1
|
|
1518
1518
|
}
|
|
1519
1519
|
};
|
|
1520
|
-
function
|
|
1521
|
-
return
|
|
1520
|
+
function Xt(e) {
|
|
1521
|
+
return Yt[e] ?? Yt.float32;
|
|
1522
1522
|
}
|
|
1523
1523
|
//#endregion
|
|
1524
1524
|
//#region src/core/renderers/gl/shader/GlProgramData.ts
|
|
1525
|
-
var
|
|
1525
|
+
var Zt = class {
|
|
1526
1526
|
native;
|
|
1527
1527
|
uniformDirtyGroups = Object.create(null);
|
|
1528
1528
|
uniforms = Object.create(null);
|
|
1529
1529
|
constructor(e) {
|
|
1530
1530
|
this.native = e;
|
|
1531
1531
|
}
|
|
1532
|
-
},
|
|
1532
|
+
}, Qt, $t = {
|
|
1533
1533
|
FLOAT: "float",
|
|
1534
1534
|
FLOAT_VEC2: "vec2",
|
|
1535
1535
|
FLOAT_VEC3: "vec3",
|
|
@@ -1558,7 +1558,7 @@ var Xt = class {
|
|
|
1558
1558
|
SAMPLER_2D_ARRAY: "sampler2DArray",
|
|
1559
1559
|
INT_SAMPLER_2D_ARRAY: "sampler2DArray",
|
|
1560
1560
|
UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
|
|
1561
|
-
},
|
|
1561
|
+
}, en = {
|
|
1562
1562
|
float: "float32",
|
|
1563
1563
|
vec2: "float32x2",
|
|
1564
1564
|
vec3: "float32x3",
|
|
@@ -1576,29 +1576,29 @@ var Xt = class {
|
|
|
1576
1576
|
bvec3: "uint32x3",
|
|
1577
1577
|
bvec4: "uint32x4"
|
|
1578
1578
|
};
|
|
1579
|
-
function
|
|
1580
|
-
if (!
|
|
1581
|
-
let t = Object.keys(
|
|
1582
|
-
|
|
1579
|
+
function tn(e, t) {
|
|
1580
|
+
if (!Qt) {
|
|
1581
|
+
let t = Object.keys($t);
|
|
1582
|
+
Qt = {};
|
|
1583
1583
|
for (let n = 0; n < t.length; ++n) {
|
|
1584
1584
|
let r = t[n];
|
|
1585
|
-
|
|
1585
|
+
Qt[e[r]] = $t[r];
|
|
1586
1586
|
}
|
|
1587
1587
|
}
|
|
1588
|
-
return
|
|
1588
|
+
return Qt[t];
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1591
|
-
return
|
|
1590
|
+
function nn(e, t) {
|
|
1591
|
+
return en[tn(e, t)] || "float32";
|
|
1592
1592
|
}
|
|
1593
1593
|
//#endregion
|
|
1594
1594
|
//#region src/core/renderers/gl/shader/GlShaderSystem.ts
|
|
1595
|
-
var
|
|
1595
|
+
var rn = class extends j {
|
|
1596
1596
|
install(e) {
|
|
1597
1597
|
super.install(e), e.shader = this;
|
|
1598
1598
|
}
|
|
1599
1599
|
glProgramDatas = /* @__PURE__ */ new Map();
|
|
1600
1600
|
currentProgram = null;
|
|
1601
|
-
globalUniforms = new
|
|
1601
|
+
globalUniforms = new Mt({
|
|
1602
1602
|
projectionMatrix: new Float32Array([
|
|
1603
1603
|
1,
|
|
1604
1604
|
0,
|
|
@@ -1639,7 +1639,7 @@ var nn = class extends M {
|
|
|
1639
1639
|
return this.glProgramDatas.get(e.id) || this._createGlProgramData(e);
|
|
1640
1640
|
}
|
|
1641
1641
|
_createGlProgramData(e) {
|
|
1642
|
-
let t = this._gl, n = new
|
|
1642
|
+
let t = this._gl, n = new Zt(t.createProgram());
|
|
1643
1643
|
this.glProgramDatas.set(e.id, n), this.useProgram(e);
|
|
1644
1644
|
let r = this._createGlShader(e.vertex, t.VERTEX_SHADER), i = this._createGlShader(e.fragment, t.FRAGMENT_SHADER);
|
|
1645
1645
|
if (t.attachShader(n.native, r), t.attachShader(n.native, i), t.linkProgram(n.native), !t.getProgramParameter(n.native, t.LINK_STATUS)) throw Error(`Failed to link program: ${t.getProgramInfoLog(n.native)}`);
|
|
@@ -1647,11 +1647,11 @@ var nn = class extends M {
|
|
|
1647
1647
|
for (let e = t.getProgramParameter(n.native, t.ACTIVE_ATTRIBUTES), r = 0; r < e; r++) {
|
|
1648
1648
|
let e = t.getActiveAttrib(n.native, r);
|
|
1649
1649
|
if (!e || e.name.startsWith("gl_")) continue;
|
|
1650
|
-
let i =
|
|
1650
|
+
let i = nn(t, e.type);
|
|
1651
1651
|
a[e.name] = {
|
|
1652
1652
|
location: 0,
|
|
1653
1653
|
format: i,
|
|
1654
|
-
stride:
|
|
1654
|
+
stride: Xt(i).stride,
|
|
1655
1655
|
offset: 0,
|
|
1656
1656
|
instance: !1,
|
|
1657
1657
|
start: 0
|
|
@@ -1668,7 +1668,7 @@ var nn = class extends M {
|
|
|
1668
1668
|
for (let e = t.getProgramParameter(n.native, t.ACTIVE_UNIFORMS), r = 0; r < e; r++) {
|
|
1669
1669
|
let e = t.getActiveUniform(n.native, r);
|
|
1670
1670
|
if (!e) continue;
|
|
1671
|
-
let i = e.name.replace(/\[.*?\]$/, ""), a =
|
|
1671
|
+
let i = e.name.replace(/\[.*?\]$/, ""), a = tn(t, e.type), o = e.size;
|
|
1672
1672
|
c[i] = {
|
|
1673
1673
|
name: i,
|
|
1674
1674
|
index: r,
|
|
@@ -1703,7 +1703,7 @@ var nn = class extends M {
|
|
|
1703
1703
|
let { type: s, isArray: c, name: l } = o;
|
|
1704
1704
|
o.location === void 0 && (o.location = n.getUniformLocation(e.native, l));
|
|
1705
1705
|
let u = o.location;
|
|
1706
|
-
if (
|
|
1706
|
+
if (an(o.value, a)) switch (o.value = on(o.value, a), s) {
|
|
1707
1707
|
case "float":
|
|
1708
1708
|
c ? n.uniform1fv(u, a) : n.uniform1f(u, a);
|
|
1709
1709
|
break;
|
|
@@ -1790,7 +1790,7 @@ var nn = class extends M {
|
|
|
1790
1790
|
super.destroy(), this.bind(null);
|
|
1791
1791
|
}
|
|
1792
1792
|
};
|
|
1793
|
-
function
|
|
1793
|
+
function an(e, t) {
|
|
1794
1794
|
if (typeof t == "object" && t) {
|
|
1795
1795
|
let n = t.length;
|
|
1796
1796
|
if (typeof e != "object" || !e || e.length !== n) return !0;
|
|
@@ -1799,7 +1799,7 @@ function rn(e, t) {
|
|
|
1799
1799
|
}
|
|
1800
1800
|
return e !== t;
|
|
1801
1801
|
}
|
|
1802
|
-
function
|
|
1802
|
+
function on(e, t) {
|
|
1803
1803
|
if (typeof t == "object" && t) {
|
|
1804
1804
|
let n = t.length;
|
|
1805
1805
|
if (typeof e == "object" && e && e.length === n) {
|
|
@@ -1812,10 +1812,10 @@ function an(e, t) {
|
|
|
1812
1812
|
}
|
|
1813
1813
|
//#endregion
|
|
1814
1814
|
//#region src/core/renderers/gl/state/GlBlendMode.ts
|
|
1815
|
-
var
|
|
1815
|
+
var sn = /* @__PURE__ */ function(e) {
|
|
1816
1816
|
return e.normal = "normal", e.add = "add", e.multiply = "multiply", e.screen = "screen", e.none = "none", e.normalNpm = "normalNpm", e.addNpm = "add_npm", e.screenNpm = "screenNpm", e.srcIn = "srcIn", e.srcOut = "srcOut", e.srcAtop = "srcAtop", e.dstOver = "dstOver", e.dstIn = "dstIn", e.dstOut = "dstOut", e.dstAtop = "dstAtop", e.xor = "xor", e.subtract = "subtract", e;
|
|
1817
1817
|
}({});
|
|
1818
|
-
function
|
|
1818
|
+
function cn(e) {
|
|
1819
1819
|
return {
|
|
1820
1820
|
normal: [e.ONE, e.ONE_MINUS_SRC_ALPHA],
|
|
1821
1821
|
add: [e.ONE, e.ONE],
|
|
@@ -1870,7 +1870,7 @@ function sn(e) {
|
|
|
1870
1870
|
}
|
|
1871
1871
|
//#endregion
|
|
1872
1872
|
//#region src/core/renderers/gl/state/GlStateSystem.ts
|
|
1873
|
-
var
|
|
1873
|
+
var ln = class e {
|
|
1874
1874
|
static _properties = [
|
|
1875
1875
|
"blend",
|
|
1876
1876
|
"offsets",
|
|
@@ -1897,14 +1897,14 @@ var cn = class e {
|
|
|
1897
1897
|
let t = new e();
|
|
1898
1898
|
return t.depthTest = !1, t.blend = !0, t;
|
|
1899
1899
|
}
|
|
1900
|
-
_blendMode =
|
|
1900
|
+
_blendMode = sn.normal;
|
|
1901
1901
|
_polygonOffset = 0;
|
|
1902
1902
|
bitmap = 0;
|
|
1903
1903
|
get blendMode() {
|
|
1904
1904
|
return this._blendMode;
|
|
1905
1905
|
}
|
|
1906
1906
|
set blendMode(e) {
|
|
1907
|
-
this.blend = e !==
|
|
1907
|
+
this.blend = e !== sn.none, this._blendMode = e;
|
|
1908
1908
|
}
|
|
1909
1909
|
get polygonOffset() {
|
|
1910
1910
|
return this._polygonOffset;
|
|
@@ -1916,19 +1916,19 @@ var cn = class e {
|
|
|
1916
1916
|
if (e) for (let t in e) this[t] = e[t];
|
|
1917
1917
|
}
|
|
1918
1918
|
};
|
|
1919
|
-
|
|
1920
|
-
var
|
|
1919
|
+
ln._init();
|
|
1920
|
+
var un = class extends j {
|
|
1921
1921
|
install(e) {
|
|
1922
1922
|
super.install(e), e.state = this;
|
|
1923
1923
|
}
|
|
1924
1924
|
_blendEq = !1;
|
|
1925
|
-
_setters =
|
|
1925
|
+
_setters = ln._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
|
|
1926
1926
|
boundStateBitmap = 0;
|
|
1927
1927
|
boundBlendMode;
|
|
1928
1928
|
blendModes;
|
|
1929
|
-
defaultState = new
|
|
1929
|
+
defaultState = new ln({ blend: !0 });
|
|
1930
1930
|
_updateContext(e) {
|
|
1931
|
-
super._updateContext(e), this.blendModes =
|
|
1931
|
+
super._updateContext(e), this.blendModes = cn(e);
|
|
1932
1932
|
}
|
|
1933
1933
|
toggle(e, t) {
|
|
1934
1934
|
this._renderer.gl[t ? "enable" : "disable"](e);
|
|
@@ -1971,14 +1971,14 @@ var ln = class extends M {
|
|
|
1971
1971
|
}
|
|
1972
1972
|
reset() {
|
|
1973
1973
|
super.reset();
|
|
1974
|
-
let e = (1 <<
|
|
1974
|
+
let e = (1 << ln._properties.length) - 1;
|
|
1975
1975
|
this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
|
|
1976
1976
|
}
|
|
1977
|
-
},
|
|
1977
|
+
}, dn = class extends j {
|
|
1978
1978
|
install(e) {
|
|
1979
1979
|
super.install(e), e.batch2D = this;
|
|
1980
1980
|
}
|
|
1981
|
-
_state =
|
|
1981
|
+
_state = ln.for2D();
|
|
1982
1982
|
_batchSize = 4096 * 4;
|
|
1983
1983
|
_batchables = [];
|
|
1984
1984
|
_vertexCount = 0;
|
|
@@ -2000,7 +2000,7 @@ var ln = class extends M {
|
|
|
2000
2000
|
_createShader(e) {
|
|
2001
2001
|
let t = this._renderer, n = {
|
|
2002
2002
|
instanceId: ut(),
|
|
2003
|
-
glProgram: new
|
|
2003
|
+
glProgram: new Jt({
|
|
2004
2004
|
vertex: "precision highp float;\nin vec2 aPosition;\nin vec2 aUv;\nin vec4 aTextureParams;\nin vec4 aModulate;\n\nuniform vec2 size;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\n\nout float vTextureId;\nout float vClipOutsideUv;\nout vec2 vUv;\nout vec4 vModulate;\n\nvec2 roundPixels(vec2 position, vec2 targetSize) {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void) {\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n mat3 modelViewProjectionMatrix = projectionMatrix * viewMatrix * modelMatrix;\n gl_Position = vec4((modelViewProjectionMatrix * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n vTextureId = aTextureParams.x;\n vClipOutsideUv = aTextureParams.y;\n if (aTextureParams.z == 1.) {\n gl_Position.xy = roundPixels(gl_Position.xy, size);\n }\n vUv = aUv;\n vModulate = aModulate;\n}",
|
|
2005
2005
|
fragment: `precision highp float;
|
|
2006
2006
|
in float vTextureId;
|
|
@@ -2030,11 +2030,11 @@ void main(void) {
|
|
|
2030
2030
|
})
|
|
2031
2031
|
}, r = {
|
|
2032
2032
|
instanceId: ut(),
|
|
2033
|
-
usage:
|
|
2033
|
+
usage: A.vertex,
|
|
2034
2034
|
data: /* @__PURE__ */ new Float32Array()
|
|
2035
2035
|
}, i = {
|
|
2036
2036
|
instanceId: ut(),
|
|
2037
|
-
usage:
|
|
2037
|
+
usage: A.index,
|
|
2038
2038
|
data: /* @__PURE__ */ new Uint32Array()
|
|
2039
2039
|
}, a = {
|
|
2040
2040
|
instanceId: ut(),
|
|
@@ -2077,7 +2077,7 @@ void main(void) {
|
|
|
2077
2077
|
let { indices: r, vertices: p, uvs: h = /* @__PURE__ */ new Float32Array(), size: g = {
|
|
2078
2078
|
width: 0,
|
|
2079
2079
|
height: 0
|
|
2080
|
-
}, texture: ee, blendMode: te =
|
|
2080
|
+
}, texture: ee, blendMode: te = sn.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
|
|
2081
2081
|
255,
|
|
2082
2082
|
255,
|
|
2083
2083
|
255,
|
|
@@ -2107,22 +2107,22 @@ void main(void) {
|
|
|
2107
2107
|
}
|
|
2108
2108
|
}
|
|
2109
2109
|
_getBufferData(e) {
|
|
2110
|
-
let t =
|
|
2110
|
+
let t = fn(Math.ceil(e / 8)), n = pn(t), r = t * 8;
|
|
2111
2111
|
this._attributeBuffer.length <= n && (this._attributeBuffer.length = n + 1);
|
|
2112
2112
|
let i = this._attributeBuffer[n];
|
|
2113
2113
|
return i || (this._attributeBuffer[n] = i = /* @__PURE__ */ new ArrayBuffer(r * this._vertexSize * 4)), i;
|
|
2114
2114
|
}
|
|
2115
2115
|
_getIndexBufferData(e) {
|
|
2116
|
-
let t =
|
|
2116
|
+
let t = fn(Math.ceil(e / 12)), n = pn(t), r = t * 12;
|
|
2117
2117
|
this._indexBuffers.length <= n && (this._indexBuffers.length = n + 1);
|
|
2118
2118
|
let i = this._indexBuffers[n];
|
|
2119
2119
|
return i || (this._indexBuffers[n] = i = new Uint32Array(r)), i;
|
|
2120
2120
|
}
|
|
2121
2121
|
};
|
|
2122
|
-
function
|
|
2122
|
+
function fn(e) {
|
|
2123
2123
|
return e += +(e === 0), --e, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e + 1;
|
|
2124
2124
|
}
|
|
2125
|
-
function
|
|
2125
|
+
function pn(e) {
|
|
2126
2126
|
let t = (e > 65535) << 4;
|
|
2127
2127
|
e >>>= t;
|
|
2128
2128
|
let n = (e > 255) << 3;
|
|
@@ -2130,11 +2130,11 @@ function fn(e) {
|
|
|
2130
2130
|
}
|
|
2131
2131
|
//#endregion
|
|
2132
2132
|
//#region src/core/renderers/gl/const.ts
|
|
2133
|
-
var
|
|
2133
|
+
var M = /* @__PURE__ */ function(e) {
|
|
2134
2134
|
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;
|
|
2135
|
-
}({}),
|
|
2135
|
+
}({}), mn = /* @__PURE__ */ function(e) {
|
|
2136
2136
|
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;
|
|
2137
|
-
}({}),
|
|
2137
|
+
}({}), hn = class extends j {
|
|
2138
2138
|
install(e) {
|
|
2139
2139
|
super.install(e), e.mask = this;
|
|
2140
2140
|
}
|
|
@@ -2153,16 +2153,16 @@ var N = /* @__PURE__ */ function(e) {
|
|
|
2153
2153
|
};
|
|
2154
2154
|
this.stack.push(n);
|
|
2155
2155
|
let r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2156
|
-
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(
|
|
2156
|
+
"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;
|
|
2157
2157
|
}
|
|
2158
2158
|
pop(e) {
|
|
2159
2159
|
let t = this.stack.pop();
|
|
2160
2160
|
if (!t || t.source !== e) return;
|
|
2161
2161
|
let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2162
|
-
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(
|
|
2162
|
+
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(mn.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;
|
|
2163
2163
|
}
|
|
2164
|
-
},
|
|
2165
|
-
|
|
2164
|
+
}, gn = [];
|
|
2165
|
+
gn[M.none] = {}, gn[M.disabled] = {}, gn[M.renderingMaskAdd] = {
|
|
2166
2166
|
stencilFront: {
|
|
2167
2167
|
compare: "equal",
|
|
2168
2168
|
passOp: "increment-clamp"
|
|
@@ -2171,7 +2171,7 @@ hn[N.none] = {}, hn[N.disabled] = {}, hn[N.renderingMaskAdd] = {
|
|
|
2171
2171
|
compare: "equal",
|
|
2172
2172
|
passOp: "increment-clamp"
|
|
2173
2173
|
}
|
|
2174
|
-
},
|
|
2174
|
+
}, gn[M.renderingMaskRemove] = {
|
|
2175
2175
|
stencilFront: {
|
|
2176
2176
|
compare: "equal",
|
|
2177
2177
|
passOp: "decrement-clamp"
|
|
@@ -2180,7 +2180,7 @@ hn[N.none] = {}, hn[N.disabled] = {}, hn[N.renderingMaskAdd] = {
|
|
|
2180
2180
|
compare: "equal",
|
|
2181
2181
|
passOp: "decrement-clamp"
|
|
2182
2182
|
}
|
|
2183
|
-
},
|
|
2183
|
+
}, gn[M.maskActive] = {
|
|
2184
2184
|
stencilFront: {
|
|
2185
2185
|
compare: "equal",
|
|
2186
2186
|
passOp: "keep"
|
|
@@ -2189,7 +2189,7 @@ hn[N.none] = {}, hn[N.disabled] = {}, hn[N.renderingMaskAdd] = {
|
|
|
2189
2189
|
compare: "equal",
|
|
2190
2190
|
passOp: "keep"
|
|
2191
2191
|
}
|
|
2192
|
-
},
|
|
2192
|
+
}, gn[M.inverseMaskActive] = {
|
|
2193
2193
|
stencilFront: {
|
|
2194
2194
|
compare: "not-equal",
|
|
2195
2195
|
passOp: "keep"
|
|
@@ -2199,17 +2199,17 @@ hn[N.none] = {}, hn[N.disabled] = {}, hn[N.renderingMaskAdd] = {
|
|
|
2199
2199
|
passOp: "keep"
|
|
2200
2200
|
}
|
|
2201
2201
|
};
|
|
2202
|
-
var
|
|
2202
|
+
var _n = class extends j {
|
|
2203
2203
|
install(e) {
|
|
2204
2204
|
super.install(e), e.stencil = this;
|
|
2205
2205
|
}
|
|
2206
2206
|
_cache = {
|
|
2207
2207
|
enabled: !1,
|
|
2208
|
-
stencilMode:
|
|
2208
|
+
stencilMode: M.none,
|
|
2209
2209
|
refCount: 0
|
|
2210
2210
|
};
|
|
2211
2211
|
current = { [-1]: {
|
|
2212
|
-
stencilMode:
|
|
2212
|
+
stencilMode: M.disabled,
|
|
2213
2213
|
refCount: 0
|
|
2214
2214
|
} };
|
|
2215
2215
|
_passOpMap;
|
|
@@ -2239,20 +2239,20 @@ var gn = class extends M {
|
|
|
2239
2239
|
super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
|
|
2240
2240
|
}
|
|
2241
2241
|
reset() {
|
|
2242
|
-
this._cache.enabled = !1, this._cache.stencilMode =
|
|
2242
|
+
this._cache.enabled = !1, this._cache.stencilMode = M.none, this._cache.refCount = 0;
|
|
2243
2243
|
}
|
|
2244
2244
|
_updateRenderTarget = (e) => {
|
|
2245
2245
|
if (e) {
|
|
2246
2246
|
let t = this.current[e.instanceId];
|
|
2247
2247
|
t ||= this.current[e.instanceId] = {
|
|
2248
|
-
stencilMode:
|
|
2248
|
+
stencilMode: M.disabled,
|
|
2249
2249
|
refCount: 0
|
|
2250
2250
|
}, this.bind(t.stencilMode, t.refCount);
|
|
2251
2251
|
}
|
|
2252
2252
|
};
|
|
2253
2253
|
bind(e, t) {
|
|
2254
|
-
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i =
|
|
2255
|
-
if (n.stencilMode = e, n.refCount = t, e ===
|
|
2254
|
+
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = gn[e], a = this._cache;
|
|
2255
|
+
if (n.stencilMode = e, n.refCount = t, e === M.disabled) {
|
|
2256
2256
|
this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
|
|
2257
2257
|
return;
|
|
2258
2258
|
}
|
|
@@ -2261,7 +2261,7 @@ var gn = class extends M {
|
|
|
2261
2261
|
destroy() {
|
|
2262
2262
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
2263
2263
|
}
|
|
2264
|
-
},
|
|
2264
|
+
}, vn = class extends j {
|
|
2265
2265
|
current = new bt(0, 0, 0, 0);
|
|
2266
2266
|
install(e) {
|
|
2267
2267
|
super.install(e), e.viewport = this;
|
|
@@ -2270,7 +2270,7 @@ var gn = class extends M {
|
|
|
2270
2270
|
let t = this.current, n = Math.floor(e.x), r = Math.floor(e.y), i = Math.floor(e.width), a = Math.floor(e.height);
|
|
2271
2271
|
t.x === n && t.y === r && t.width === i && t.height === a || (this._gl.viewport(n, r, i, a), t.x = n, t.y = r, t.width = i, t.height = a);
|
|
2272
2272
|
}
|
|
2273
|
-
},
|
|
2273
|
+
}, yn = class {
|
|
2274
2274
|
framebuffer;
|
|
2275
2275
|
width = -1;
|
|
2276
2276
|
height = -1;
|
|
@@ -2281,7 +2281,7 @@ var gn = class extends M {
|
|
|
2281
2281
|
constructor(e) {
|
|
2282
2282
|
this.framebuffer = e;
|
|
2283
2283
|
}
|
|
2284
|
-
},
|
|
2284
|
+
}, bn = class extends j {
|
|
2285
2285
|
install(e) {
|
|
2286
2286
|
super.install(e), e.renderTarget = this;
|
|
2287
2287
|
}
|
|
@@ -2291,7 +2291,7 @@ var gn = class extends M {
|
|
|
2291
2291
|
_msaaSamples = [];
|
|
2292
2292
|
_hasMRT = !0;
|
|
2293
2293
|
_writeDepthTexture = !0;
|
|
2294
|
-
projection = new
|
|
2294
|
+
projection = new Et();
|
|
2295
2295
|
_updateContext(e) {
|
|
2296
2296
|
if (super._updateContext(e), this._hasMRT = !0, this._writeDepthTexture = !0, this._renderer.version === 1) {
|
|
2297
2297
|
let t = this._renderer.extensions.drawBuffers, n = this._renderer.extensions.depthTexture;
|
|
@@ -2327,7 +2327,7 @@ var gn = class extends M {
|
|
|
2327
2327
|
return this.glRenderTargets.get(e.instanceId) || this._createGlRenderTarget(e);
|
|
2328
2328
|
}
|
|
2329
2329
|
_createGlRenderTarget(e) {
|
|
2330
|
-
let t = this._gl, n = new
|
|
2330
|
+
let t = this._gl, n = new yn(t.createFramebuffer());
|
|
2331
2331
|
return this.glRenderTargets.set(e.instanceId, n), this.renderTargets.get(e.instanceId) || (this.renderTargets.set(e.instanceId, e), this._update(e, n), "on" in e && (e.on("updateProperty", (t) => {
|
|
2332
2332
|
switch (t) {
|
|
2333
2333
|
case "width":
|
|
@@ -2404,28 +2404,28 @@ var gn = class extends M {
|
|
|
2404
2404
|
reset() {
|
|
2405
2405
|
super.reset(), this._renderer.contextLost || this.glRenderTargets.forEach((e) => this.destroyGpuRenderTarget(e)), this.renderTargets.clear(), this.glRenderTargets.clear(), this.current = null, this._msaaSamples.length = 0;
|
|
2406
2406
|
}
|
|
2407
|
-
},
|
|
2407
|
+
}, xn = /* @__PURE__ */ function(e) {
|
|
2408
2408
|
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;
|
|
2409
|
-
}({}),
|
|
2409
|
+
}({}), Sn = /* @__PURE__ */ function(e) {
|
|
2410
2410
|
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;
|
|
2411
|
-
}({}),
|
|
2411
|
+
}({}), N = /* @__PURE__ */ function(e) {
|
|
2412
2412
|
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;
|
|
2413
|
-
}({}),
|
|
2413
|
+
}({}), Cn = class {
|
|
2414
2414
|
native;
|
|
2415
|
-
target =
|
|
2415
|
+
target = Sn.TEXTURE_2D;
|
|
2416
2416
|
width = -1;
|
|
2417
2417
|
height = -1;
|
|
2418
2418
|
mipmap = !1;
|
|
2419
|
-
type =
|
|
2420
|
-
internalFormat =
|
|
2421
|
-
format =
|
|
2419
|
+
type = N.UNSIGNED_BYTE;
|
|
2420
|
+
internalFormat = xn.RGBA;
|
|
2421
|
+
format = xn.RGBA;
|
|
2422
2422
|
constructor(e) {
|
|
2423
2423
|
this.native = e;
|
|
2424
2424
|
}
|
|
2425
2425
|
};
|
|
2426
2426
|
//#endregion
|
|
2427
2427
|
//#region src/core/renderers/gl/texture/mapFormatToGlFormat.ts
|
|
2428
|
-
function
|
|
2428
|
+
function wn(e) {
|
|
2429
2429
|
return {
|
|
2430
2430
|
r8unorm: e.RED,
|
|
2431
2431
|
r8snorm: e.RED,
|
|
@@ -2473,7 +2473,7 @@ function Cn(e) {
|
|
|
2473
2473
|
}
|
|
2474
2474
|
//#endregion
|
|
2475
2475
|
//#region src/core/renderers/gl/texture/mapFormatToGlInternalFormat.ts
|
|
2476
|
-
function
|
|
2476
|
+
function Tn(e, t) {
|
|
2477
2477
|
let n = {}, r = e.RGBA;
|
|
2478
2478
|
return e instanceof WebGLRenderingContext ? t.srgb && (n = {
|
|
2479
2479
|
"rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
|
|
@@ -2589,7 +2589,7 @@ function wn(e, t) {
|
|
|
2589
2589
|
}
|
|
2590
2590
|
//#endregion
|
|
2591
2591
|
//#region src/core/renderers/gl/texture/mapFormatToGlType.ts
|
|
2592
|
-
function
|
|
2592
|
+
function En(e) {
|
|
2593
2593
|
return {
|
|
2594
2594
|
r8unorm: e.UNSIGNED_BYTE,
|
|
2595
2595
|
r8snorm: e.BYTE,
|
|
@@ -2637,7 +2637,7 @@ function Tn(e) {
|
|
|
2637
2637
|
}
|
|
2638
2638
|
//#endregion
|
|
2639
2639
|
//#region src/core/renderers/gl/texture/updateTextureStyle.ts
|
|
2640
|
-
var
|
|
2640
|
+
var Dn = {
|
|
2641
2641
|
linear: {
|
|
2642
2642
|
linear: 9987,
|
|
2643
2643
|
nearest: 9985
|
|
@@ -2646,10 +2646,10 @@ var En = {
|
|
|
2646
2646
|
linear: 9986,
|
|
2647
2647
|
nearest: 9984
|
|
2648
2648
|
}
|
|
2649
|
-
},
|
|
2649
|
+
}, On = {
|
|
2650
2650
|
linear: 9729,
|
|
2651
2651
|
nearest: 9728
|
|
2652
|
-
},
|
|
2652
|
+
}, kn = {
|
|
2653
2653
|
never: 512,
|
|
2654
2654
|
less: 513,
|
|
2655
2655
|
equal: 514,
|
|
@@ -2658,32 +2658,32 @@ var En = {
|
|
|
2658
2658
|
"not-equal": 517,
|
|
2659
2659
|
"greater-equal": 518,
|
|
2660
2660
|
always: 519
|
|
2661
|
-
},
|
|
2661
|
+
}, An = {
|
|
2662
2662
|
"clamp-to-edge": 33071,
|
|
2663
2663
|
repeat: 10497,
|
|
2664
2664
|
"mirror-repeat": 33648
|
|
2665
2665
|
};
|
|
2666
|
-
function
|
|
2666
|
+
function jn(e, t, n, r, i, a, o, s) {
|
|
2667
2667
|
let { addressModeU: c = "repeat", addressModeV: l = "repeat", addressModeW: u = "repeat", magFilter: d = "linear", minFilter: f = "linear", mipmapFilter: p = "linear", maxAnisotropy: m = 0, compare: h } = e, g = a;
|
|
2668
2668
|
if (!s || c !== "repeat" || l !== "repeat" || u !== "repeat") {
|
|
2669
|
-
let e =
|
|
2669
|
+
let e = An[o ? "clamp-to-edge" : c], n = An[o ? "clamp-to-edge" : l], r = An[o ? "clamp-to-edge" : u];
|
|
2670
2670
|
t[i](g, t.TEXTURE_WRAP_S, e), t[i](g, t.TEXTURE_WRAP_T, n), t.TEXTURE_WRAP_R && t[i](g, t.TEXTURE_WRAP_R, r);
|
|
2671
2671
|
}
|
|
2672
|
-
if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER,
|
|
2672
|
+
if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, On[d]), n) {
|
|
2673
2673
|
if (!s || p !== "linear") {
|
|
2674
|
-
let e =
|
|
2674
|
+
let e = Dn[f][p];
|
|
2675
2675
|
t[i](g, t.TEXTURE_MIN_FILTER, e);
|
|
2676
2676
|
}
|
|
2677
|
-
} else t[i](g, t.TEXTURE_MIN_FILTER,
|
|
2677
|
+
} else t[i](g, t.TEXTURE_MIN_FILTER, On[f]);
|
|
2678
2678
|
if (r && m > 1) {
|
|
2679
2679
|
let e = Math.min(m, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
|
|
2680
2680
|
t[i](g, r.TEXTURE_MAX_ANISOTROPY_EXT, e);
|
|
2681
2681
|
}
|
|
2682
|
-
h && t[i](g, t.TEXTURE_COMPARE_FUNC,
|
|
2682
|
+
h && t[i](g, t.TEXTURE_COMPARE_FUNC, kn[h]);
|
|
2683
2683
|
}
|
|
2684
2684
|
//#endregion
|
|
2685
2685
|
//#region src/core/renderers/gl/texture/uploaders/index.ts
|
|
2686
|
-
var
|
|
2686
|
+
var Mn = {
|
|
2687
2687
|
buffer: {
|
|
2688
2688
|
id: "buffer",
|
|
2689
2689
|
upload: (e, t, n) => {
|
|
@@ -2697,8 +2697,8 @@ var jn = {
|
|
|
2697
2697
|
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;
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
|
-
},
|
|
2701
|
-
uploaders = { ...
|
|
2700
|
+
}, Nn = class extends j {
|
|
2701
|
+
uploaders = { ...Mn };
|
|
2702
2702
|
textures = /* @__PURE__ */ new Map();
|
|
2703
2703
|
glTextures = /* @__PURE__ */ new Map();
|
|
2704
2704
|
_mapFormatToInternalFormat = Object.create(null);
|
|
@@ -2713,14 +2713,14 @@ var jn = {
|
|
|
2713
2713
|
super.install(e), e.texture = this;
|
|
2714
2714
|
}
|
|
2715
2715
|
_updateContext(e) {
|
|
2716
|
-
super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat =
|
|
2716
|
+
super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = Tn(e, this._renderer.extensions), this._mapFormatToType = En(e), this._mapFormatToFormat = wn(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
|
|
2717
2717
|
for (let e = 0; e < this.maxTextureImageUnits; e++) this.unbind(e);
|
|
2718
2718
|
}
|
|
2719
2719
|
getGlTexture(e) {
|
|
2720
2720
|
return this.glTextures.get(e.instanceId) || this._createGlTexture(e);
|
|
2721
2721
|
}
|
|
2722
2722
|
_createGlTexture(e) {
|
|
2723
|
-
let t = this._gl, n = new
|
|
2723
|
+
let t = this._gl, n = new Cn(t.createTexture());
|
|
2724
2724
|
if (t.bindTexture(n.target, n.native), n.type = this._mapFormatToType[e.format], n.internalFormat = this._mapFormatToInternalFormat[e.format], n.format = this._mapFormatToFormat[e.format], this.glTextures.set(e.instanceId, n), e.mipmap && (this._renderer.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
|
|
2725
2725
|
let t = Math.max(e.width, e.height);
|
|
2726
2726
|
e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
|
|
@@ -2780,7 +2780,7 @@ var jn = {
|
|
|
2780
2780
|
}
|
|
2781
2781
|
updateStyle(e, t = !1) {
|
|
2782
2782
|
let n = this._gl;
|
|
2783
|
-
|
|
2783
|
+
jn(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
|
|
2784
2784
|
}
|
|
2785
2785
|
updateGpuTexture(e) {
|
|
2786
2786
|
this.bind(e);
|
|
@@ -2795,50 +2795,50 @@ var jn = {
|
|
|
2795
2795
|
let e = this._gl;
|
|
2796
2796
|
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);
|
|
2797
2797
|
}
|
|
2798
|
-
},
|
|
2799
|
-
uint8x2:
|
|
2800
|
-
uint8x4:
|
|
2801
|
-
sint8x2:
|
|
2802
|
-
sint8x4:
|
|
2803
|
-
unorm8x2:
|
|
2804
|
-
unorm8x4:
|
|
2805
|
-
snorm8x2:
|
|
2806
|
-
snorm8x4:
|
|
2807
|
-
uint16x2:
|
|
2808
|
-
uint16x4:
|
|
2809
|
-
sint16x2:
|
|
2810
|
-
sint16x4:
|
|
2811
|
-
unorm16x2:
|
|
2812
|
-
unorm16x4:
|
|
2813
|
-
snorm16x2:
|
|
2814
|
-
snorm16x4:
|
|
2815
|
-
float16x2:
|
|
2816
|
-
float16x4:
|
|
2817
|
-
float32:
|
|
2818
|
-
float32x2:
|
|
2819
|
-
float32x3:
|
|
2820
|
-
float32x4:
|
|
2821
|
-
uint32:
|
|
2822
|
-
uint32x2:
|
|
2823
|
-
uint32x3:
|
|
2824
|
-
uint32x4:
|
|
2825
|
-
sint32:
|
|
2826
|
-
sint32x2:
|
|
2827
|
-
sint32x3:
|
|
2828
|
-
sint32x4:
|
|
2798
|
+
}, Pn = {
|
|
2799
|
+
uint8x2: N.UNSIGNED_BYTE,
|
|
2800
|
+
uint8x4: N.UNSIGNED_BYTE,
|
|
2801
|
+
sint8x2: N.BYTE,
|
|
2802
|
+
sint8x4: N.BYTE,
|
|
2803
|
+
unorm8x2: N.UNSIGNED_BYTE,
|
|
2804
|
+
unorm8x4: N.UNSIGNED_BYTE,
|
|
2805
|
+
snorm8x2: N.BYTE,
|
|
2806
|
+
snorm8x4: N.BYTE,
|
|
2807
|
+
uint16x2: N.UNSIGNED_SHORT,
|
|
2808
|
+
uint16x4: N.UNSIGNED_SHORT,
|
|
2809
|
+
sint16x2: N.SHORT,
|
|
2810
|
+
sint16x4: N.SHORT,
|
|
2811
|
+
unorm16x2: N.UNSIGNED_SHORT,
|
|
2812
|
+
unorm16x4: N.UNSIGNED_SHORT,
|
|
2813
|
+
snorm16x2: N.SHORT,
|
|
2814
|
+
snorm16x4: N.SHORT,
|
|
2815
|
+
float16x2: N.HALF_FLOAT,
|
|
2816
|
+
float16x4: N.HALF_FLOAT,
|
|
2817
|
+
float32: N.FLOAT,
|
|
2818
|
+
float32x2: N.FLOAT,
|
|
2819
|
+
float32x3: N.FLOAT,
|
|
2820
|
+
float32x4: N.FLOAT,
|
|
2821
|
+
uint32: N.UNSIGNED_INT,
|
|
2822
|
+
uint32x2: N.UNSIGNED_INT,
|
|
2823
|
+
uint32x3: N.UNSIGNED_INT,
|
|
2824
|
+
uint32x4: N.UNSIGNED_INT,
|
|
2825
|
+
sint32: N.INT,
|
|
2826
|
+
sint32x2: N.INT,
|
|
2827
|
+
sint32x3: N.INT,
|
|
2828
|
+
sint32x4: N.INT
|
|
2829
2829
|
};
|
|
2830
|
-
function
|
|
2831
|
-
return
|
|
2830
|
+
function Fn(e) {
|
|
2831
|
+
return Pn[e] ?? Pn.float32;
|
|
2832
2832
|
}
|
|
2833
2833
|
//#endregion
|
|
2834
2834
|
//#region src/core/renderers/gl/geometry/GlGeometrySystem.ts
|
|
2835
|
-
var
|
|
2835
|
+
var In = {
|
|
2836
2836
|
"point-list": 0,
|
|
2837
2837
|
"line-list": 1,
|
|
2838
2838
|
"line-strip": 3,
|
|
2839
2839
|
"triangle-list": 4,
|
|
2840
2840
|
"triangle-strip": 5
|
|
2841
|
-
},
|
|
2841
|
+
}, Ln = class extends j {
|
|
2842
2842
|
_geometryVaoHash = {};
|
|
2843
2843
|
hasInstance = !1;
|
|
2844
2844
|
current = null;
|
|
@@ -2877,11 +2877,11 @@ var Fn = {
|
|
|
2877
2877
|
}
|
|
2878
2878
|
for (let e in r) {
|
|
2879
2879
|
let t = r[e];
|
|
2880
|
-
i[t.buffer.instanceId] +=
|
|
2880
|
+
i[t.buffer.instanceId] += Xt(t.format).stride;
|
|
2881
2881
|
}
|
|
2882
2882
|
for (let e in r) {
|
|
2883
2883
|
let t = r[e];
|
|
2884
|
-
t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] +=
|
|
2884
|
+
t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += Xt(t.format).stride;
|
|
2885
2885
|
}
|
|
2886
2886
|
}
|
|
2887
2887
|
_createVao(e, t) {
|
|
@@ -2916,7 +2916,7 @@ var Fn = {
|
|
|
2916
2916
|
a !== c && (r.bind(s), a = c);
|
|
2917
2917
|
let e = l.location;
|
|
2918
2918
|
n.enableVertexAttribArray(e);
|
|
2919
|
-
let t =
|
|
2919
|
+
let t = Xt(o.format), i = Fn(o.format);
|
|
2920
2920
|
if (l.format?.substring(1, 4) === "int" ? n.vertexAttribIPointer(e, t.size, i, o.stride ?? 0, o.start ?? 0) : n.vertexAttribPointer(e, t.size, i, t.normalized, o.stride ?? 0, o.start ?? 0), o.instance) if (this.hasInstance) {
|
|
2921
2921
|
let t = o.divisor ?? 1;
|
|
2922
2922
|
n.vertexAttribDivisor(e, t);
|
|
@@ -2949,7 +2949,7 @@ var Fn = {
|
|
|
2949
2949
|
let { topology: t, size: n, start: r = 0, instanceCount: i } = e, { gl: a } = this._renderer, o = this.current;
|
|
2950
2950
|
if (!o) return this;
|
|
2951
2951
|
t = t || o.topology || "triangle-list";
|
|
2952
|
-
let s =
|
|
2952
|
+
let s = In[t];
|
|
2953
2953
|
if (i = i || o.instanceCount || 1, o.indexBuffer) {
|
|
2954
2954
|
n ||= o.indexBuffer.data.length;
|
|
2955
2955
|
let e = o.indexBuffer.data.BYTES_PER_ELEMENT, t = e === 2 ? a.UNSIGNED_SHORT : a.UNSIGNED_INT;
|
|
@@ -2970,7 +2970,7 @@ var Fn = {
|
|
|
2970
2970
|
}
|
|
2971
2971
|
this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
|
|
2972
2972
|
}
|
|
2973
|
-
},
|
|
2973
|
+
}, Rn = class extends j {
|
|
2974
2974
|
install(e) {
|
|
2975
2975
|
super.install(e), e.colorMask = this;
|
|
2976
2976
|
}
|
|
@@ -2981,19 +2981,19 @@ var Fn = {
|
|
|
2981
2981
|
};
|
|
2982
2982
|
//#endregion
|
|
2983
2983
|
//#region src/core/renderers/gl/GlScissorSystem.ts
|
|
2984
|
-
function
|
|
2984
|
+
function zn(e, t, n) {
|
|
2985
2985
|
let [r, i, a, o, s, c, l, u, d] = e, f = r * t + o * n + l, p = i * t + s * n + u, m = a * t + c * n + d;
|
|
2986
2986
|
return {
|
|
2987
2987
|
x: f / m,
|
|
2988
2988
|
y: p / m
|
|
2989
2989
|
};
|
|
2990
2990
|
}
|
|
2991
|
-
function
|
|
2991
|
+
function Bn(e, t) {
|
|
2992
2992
|
let { x: n, y: r, width: i, height: a } = t, o = [
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2993
|
+
zn(e, n, r),
|
|
2994
|
+
zn(e, n + i, r),
|
|
2995
|
+
zn(e, n + i, r + a),
|
|
2996
|
+
zn(e, n, r + a)
|
|
2997
2997
|
], s = o.map((e) => e.x), c = o.map((e) => e.y), l = Math.min(...s), u = Math.max(...s), d = Math.min(...c), f = Math.max(...c);
|
|
2998
2998
|
return {
|
|
2999
2999
|
x: l,
|
|
@@ -3002,7 +3002,7 @@ function zn(e, t) {
|
|
|
3002
3002
|
height: f - d
|
|
3003
3003
|
};
|
|
3004
3004
|
}
|
|
3005
|
-
function
|
|
3005
|
+
function Vn(e, t) {
|
|
3006
3006
|
let n = Math.max(e.x, t.x), r = Math.max(e.y, t.y), i = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height);
|
|
3007
3007
|
return {
|
|
3008
3008
|
x: n,
|
|
@@ -3011,7 +3011,7 @@ function Bn(e, t) {
|
|
|
3011
3011
|
height: Math.max(0, a - r)
|
|
3012
3012
|
};
|
|
3013
3013
|
}
|
|
3014
|
-
var
|
|
3014
|
+
var Hn = class extends j {
|
|
3015
3015
|
install(e) {
|
|
3016
3016
|
super.install(e), e.scissor = this;
|
|
3017
3017
|
}
|
|
@@ -3035,7 +3035,7 @@ var Vn = class extends M {
|
|
|
3035
3035
|
y: e.y,
|
|
3036
3036
|
width: e.width,
|
|
3037
3037
|
height: e.height
|
|
3038
|
-
}, i = n ?
|
|
3038
|
+
}, i = n ? Vn(n, r) : r;
|
|
3039
3039
|
t.stack.push(i), this.bind(i);
|
|
3040
3040
|
}
|
|
3041
3041
|
pop() {
|
|
@@ -3046,28 +3046,28 @@ var Vn = class extends M {
|
|
|
3046
3046
|
let t = this._gl;
|
|
3047
3047
|
if (e) {
|
|
3048
3048
|
t.enable(t.SCISSOR_TEST);
|
|
3049
|
-
let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } =
|
|
3049
|
+
let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = Bn(i, e), l = r.current.height / n - (o + c);
|
|
3050
3050
|
t.scissor(a * n, l * n, s * n, c * n);
|
|
3051
3051
|
} else t.disable(t.SCISSOR_TEST);
|
|
3052
3052
|
}
|
|
3053
3053
|
destroy() {
|
|
3054
3054
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
3055
3055
|
}
|
|
3056
|
-
},
|
|
3056
|
+
}, Un = class extends At {
|
|
3057
3057
|
contextLost = !1;
|
|
3058
3058
|
_systems = [
|
|
3059
|
-
new
|
|
3060
|
-
new
|
|
3061
|
-
new
|
|
3062
|
-
new In(),
|
|
3063
|
-
new yn(),
|
|
3064
|
-
new ln(),
|
|
3065
|
-
new mn(),
|
|
3059
|
+
new Nn(),
|
|
3060
|
+
new It(),
|
|
3061
|
+
new rn(),
|
|
3066
3062
|
new Ln(),
|
|
3067
|
-
new
|
|
3068
|
-
new Vn(),
|
|
3063
|
+
new bn(),
|
|
3069
3064
|
new un(),
|
|
3070
|
-
new
|
|
3065
|
+
new hn(),
|
|
3066
|
+
new Rn(),
|
|
3067
|
+
new _n(),
|
|
3068
|
+
new Hn(),
|
|
3069
|
+
new dn(),
|
|
3070
|
+
new vn()
|
|
3071
3071
|
];
|
|
3072
3072
|
bindPoints = /* @__PURE__ */ new Map();
|
|
3073
3073
|
supports = {
|
|
@@ -3161,8 +3161,8 @@ var Vn = class extends M {
|
|
|
3161
3161
|
height: this.screen.height * this.pixelRatio
|
|
3162
3162
|
});
|
|
3163
3163
|
}
|
|
3164
|
-
clear(e =
|
|
3165
|
-
typeof e == "boolean" && (e = e ?
|
|
3164
|
+
clear(e = mn.all) {
|
|
3165
|
+
typeof e == "boolean" && (e = e ? mn.all : mn.none), e && this.gl.clear(e);
|
|
3166
3166
|
}
|
|
3167
3167
|
reset() {
|
|
3168
3168
|
this._systems.forEach((e) => e.reset());
|
|
@@ -3179,7 +3179,7 @@ var Vn = class extends M {
|
|
|
3179
3179
|
for (let e = 0; e < i; e += a) c.set(s.subarray(e, e + a), o - e);
|
|
3180
3180
|
return c;
|
|
3181
3181
|
}
|
|
3182
|
-
},
|
|
3182
|
+
}, Wn = class {}, Gn = class extends Wn {
|
|
3183
3183
|
install(e) {
|
|
3184
3184
|
let t = async (e) => {
|
|
3185
3185
|
let { parseFont: t } = await import("modern-font");
|
|
@@ -3193,15 +3193,15 @@ var Vn = class extends M {
|
|
|
3193
3193
|
e.register(n, t);
|
|
3194
3194
|
}), e.font = this, this;
|
|
3195
3195
|
}
|
|
3196
|
-
},
|
|
3196
|
+
}, Kn = class extends yt {
|
|
3197
3197
|
constructor(e) {
|
|
3198
3198
|
super(), this.setProperties(e);
|
|
3199
3199
|
}
|
|
3200
3200
|
};
|
|
3201
|
-
|
|
3201
|
+
k([_({ fallback: A.index }), O("design:type", A === void 0 ? Object : A)], Kn.prototype, "usage", void 0), k([_({ default: () => /* @__PURE__ */ new Uint32Array() }), O("design:type", Object)], Kn.prototype, "data", void 0);
|
|
3202
3202
|
//#endregion
|
|
3203
3203
|
//#region src/scene/resources/geometries/Geometry.ts
|
|
3204
|
-
var
|
|
3204
|
+
var qn = class extends yt {
|
|
3205
3205
|
constructor(e = {}) {
|
|
3206
3206
|
super(), this.setProperties(e);
|
|
3207
3207
|
}
|
|
@@ -3209,32 +3209,32 @@ var Kn = class extends yt {
|
|
|
3209
3209
|
e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
|
|
3210
3210
|
}
|
|
3211
3211
|
};
|
|
3212
|
-
|
|
3212
|
+
k([_({ fallback: "triangle-list" }), O("design:type", Object)], qn.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof Record > "u" ? Object : Record)], qn.prototype, "attributes", void 0), k([_({ default: () => new Kn() }), O("design:type", Kn === void 0 ? Object : Kn)], qn.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], qn.prototype, "instanceCount", void 0);
|
|
3213
3213
|
//#endregion
|
|
3214
3214
|
//#region src/scene/resources/geometries/VertexBuffer.ts
|
|
3215
|
-
var
|
|
3215
|
+
var P = class extends yt {
|
|
3216
3216
|
constructor(e) {
|
|
3217
3217
|
super(), this.setProperties(e);
|
|
3218
3218
|
}
|
|
3219
3219
|
};
|
|
3220
|
-
|
|
3220
|
+
k([_({ fallback: A.vertex }), O("design:type", A === void 0 ? Object : A)], P.prototype, "usage", void 0), k([_({ default: () => /* @__PURE__ */ new Float32Array() }), O("design:type", Object)], P.prototype, "data", void 0);
|
|
3221
3221
|
//#endregion
|
|
3222
3222
|
//#region src/scene/resources/geometries/VertexAttribute.ts
|
|
3223
|
-
var
|
|
3223
|
+
var F = class extends yt {
|
|
3224
3224
|
constructor(e) {
|
|
3225
3225
|
super(), this.setProperties(e);
|
|
3226
3226
|
}
|
|
3227
3227
|
};
|
|
3228
|
-
|
|
3228
|
+
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);
|
|
3229
3229
|
//#endregion
|
|
3230
3230
|
//#region src/scene/resources/geometries/QuadGeometry.ts
|
|
3231
|
-
var
|
|
3231
|
+
var Jn = class extends qn {
|
|
3232
3232
|
constructor() {
|
|
3233
3233
|
super({
|
|
3234
3234
|
topology: "triangle-strip",
|
|
3235
|
-
attributes: { position: new
|
|
3235
|
+
attributes: { position: new F({
|
|
3236
3236
|
format: "float32x2",
|
|
3237
|
-
buffer: new
|
|
3237
|
+
buffer: new P({ data: new Float32Array([
|
|
3238
3238
|
0,
|
|
3239
3239
|
0,
|
|
3240
3240
|
1,
|
|
@@ -3245,7 +3245,7 @@ var qn = class extends Kn {
|
|
|
3245
3245
|
1
|
|
3246
3246
|
]) })
|
|
3247
3247
|
}) },
|
|
3248
|
-
indexBuffer: new
|
|
3248
|
+
indexBuffer: new Kn({ data: new Uint32Array([
|
|
3249
3249
|
0,
|
|
3250
3250
|
1,
|
|
3251
3251
|
3,
|
|
@@ -3256,7 +3256,7 @@ var qn = class extends Kn {
|
|
|
3256
3256
|
};
|
|
3257
3257
|
//#endregion
|
|
3258
3258
|
//#region src/scene/resources/materials/Material.ts
|
|
3259
|
-
function
|
|
3259
|
+
function Yn() {
|
|
3260
3260
|
return {
|
|
3261
3261
|
projectionMatrix: new Float32Array([
|
|
3262
3262
|
1,
|
|
@@ -3288,13 +3288,13 @@ function Jn() {
|
|
|
3288
3288
|
])
|
|
3289
3289
|
};
|
|
3290
3290
|
}
|
|
3291
|
-
var
|
|
3291
|
+
var I = class extends yt {
|
|
3292
3292
|
static instance = new this();
|
|
3293
3293
|
glProgram;
|
|
3294
3294
|
constructor(e = {}) {
|
|
3295
3295
|
super();
|
|
3296
3296
|
let { uniforms: t, gl: n } = e;
|
|
3297
|
-
t && (this.uniforms = t), this.glProgram = new
|
|
3297
|
+
t && (this.uniforms = t), this.glProgram = new Jt({
|
|
3298
3298
|
vertex: "in vec2 position;\nuniform mat3 projectionMatrix;\nuniform mat3 modelViewMatrix;\nvoid main(void) {\n gl_Position = vec4((projectionMatrix * modelViewMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}",
|
|
3299
3299
|
fragment: "uniform vec4 tint;\nvoid main(void) {\n gl_FragColor = tint;\n}",
|
|
3300
3300
|
...n
|
|
@@ -3307,13 +3307,13 @@ var L = class extends yt {
|
|
|
3307
3307
|
}, e.shader.updateUniforms(this);
|
|
3308
3308
|
}
|
|
3309
3309
|
};
|
|
3310
|
-
|
|
3310
|
+
k([_({ default: Yn }), O("design:type", typeof Record > "u" ? Object : Record)], I.prototype, "uniforms", void 0);
|
|
3311
3311
|
//#endregion
|
|
3312
3312
|
//#region src/scene/resources/materials/EffectMaterial.ts
|
|
3313
|
-
var
|
|
3314
|
-
function
|
|
3313
|
+
var Xn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Zn = /vec(\d)\((.*)\)/;
|
|
3314
|
+
function Qn(e) {
|
|
3315
3315
|
e = e.trim();
|
|
3316
|
-
let t = e.match(
|
|
3316
|
+
let t = e.match(Zn);
|
|
3317
3317
|
if (t) {
|
|
3318
3318
|
let e = Array.from({ length: Number(t[1]) }, () => 0);
|
|
3319
3319
|
return t[2].split(",").forEach((t, n) => {
|
|
@@ -3322,7 +3322,7 @@ function Zn(e) {
|
|
|
3322
3322
|
}
|
|
3323
3323
|
return Number(e);
|
|
3324
3324
|
}
|
|
3325
|
-
var
|
|
3325
|
+
var $n = class e extends I {
|
|
3326
3326
|
static RE = {
|
|
3327
3327
|
getColor: /\sgetColor\s*\(/,
|
|
3328
3328
|
getFromColor: /\sgetFromColor\s*\(/,
|
|
@@ -3358,12 +3358,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3358
3358
|
progress: 0
|
|
3359
3359
|
}
|
|
3360
3360
|
}), this.has = n;
|
|
3361
|
-
let r = t.matchAll(
|
|
3361
|
+
let r = t.matchAll(Xn);
|
|
3362
3362
|
for (let e of r) e[1] && e[2] && e[1].split(",").forEach((t) => {
|
|
3363
|
-
this.uniforms[t.trim()] =
|
|
3363
|
+
this.uniforms[t.trim()] = Qn(e[2]);
|
|
3364
3364
|
});
|
|
3365
3365
|
}
|
|
3366
|
-
},
|
|
3366
|
+
}, er = class extends I {
|
|
3367
3367
|
static _instance;
|
|
3368
3368
|
static get instance() {
|
|
3369
3369
|
return this._instance ??= new this();
|
|
@@ -3407,20 +3407,20 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3407
3407
|
}
|
|
3408
3408
|
});
|
|
3409
3409
|
}
|
|
3410
|
-
},
|
|
3410
|
+
}, L = class extends qn {
|
|
3411
3411
|
static _instance;
|
|
3412
3412
|
static get instance() {
|
|
3413
3413
|
return this._instance ??= new this();
|
|
3414
3414
|
}
|
|
3415
|
-
static draw(e, t =
|
|
3415
|
+
static draw(e, t = er.instance, n) {
|
|
3416
3416
|
this.instance.draw(e, t, n);
|
|
3417
3417
|
}
|
|
3418
3418
|
constructor() {
|
|
3419
3419
|
super({
|
|
3420
3420
|
attributes: {
|
|
3421
|
-
position: new
|
|
3421
|
+
position: new F({
|
|
3422
3422
|
format: "float32x2",
|
|
3423
|
-
buffer: new
|
|
3423
|
+
buffer: new P({ data: new Float32Array([
|
|
3424
3424
|
-1,
|
|
3425
3425
|
-1,
|
|
3426
3426
|
1,
|
|
@@ -3431,9 +3431,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3431
3431
|
1
|
|
3432
3432
|
]) })
|
|
3433
3433
|
}),
|
|
3434
|
-
uv: new
|
|
3434
|
+
uv: new F({
|
|
3435
3435
|
format: "float32x2",
|
|
3436
|
-
buffer: new
|
|
3436
|
+
buffer: new P({ data: new Float32Array([
|
|
3437
3437
|
0,
|
|
3438
3438
|
0,
|
|
3439
3439
|
1,
|
|
@@ -3445,7 +3445,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3445
3445
|
]) })
|
|
3446
3446
|
})
|
|
3447
3447
|
},
|
|
3448
|
-
indexBuffer: new
|
|
3448
|
+
indexBuffer: new Kn({ data: new Uint32Array([
|
|
3449
3449
|
0,
|
|
3450
3450
|
1,
|
|
3451
3451
|
2,
|
|
@@ -3455,27 +3455,27 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3455
3455
|
]) })
|
|
3456
3456
|
});
|
|
3457
3457
|
}
|
|
3458
|
-
},
|
|
3458
|
+
}, tr = class extends qn {
|
|
3459
3459
|
positionBuffer;
|
|
3460
3460
|
uvBuffer;
|
|
3461
3461
|
constructor(e) {
|
|
3462
|
-
let t = new
|
|
3462
|
+
let t = new P({ data: /* @__PURE__ */ new Float32Array() }), n = new P({ data: /* @__PURE__ */ new Float32Array() });
|
|
3463
3463
|
super({
|
|
3464
3464
|
...e,
|
|
3465
3465
|
attributes: {
|
|
3466
|
-
position: new
|
|
3466
|
+
position: new F({
|
|
3467
3467
|
format: "float32x2",
|
|
3468
3468
|
buffer: t
|
|
3469
3469
|
}),
|
|
3470
|
-
uv: new
|
|
3470
|
+
uv: new F({
|
|
3471
3471
|
format: "float32x2",
|
|
3472
3472
|
buffer: n
|
|
3473
3473
|
})
|
|
3474
3474
|
},
|
|
3475
|
-
indexBuffer: new
|
|
3475
|
+
indexBuffer: new Kn({ data: /* @__PURE__ */ new Uint32Array() })
|
|
3476
3476
|
}), this.positionBuffer = t, this.uvBuffer = n;
|
|
3477
3477
|
}
|
|
3478
|
-
},
|
|
3478
|
+
}, R = class extends yt {
|
|
3479
3479
|
get valid() {
|
|
3480
3480
|
return !!(this.width && this.height);
|
|
3481
3481
|
}
|
|
@@ -3489,10 +3489,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3489
3489
|
super._destroy(), this.colorTextures.forEach((e) => e.destroy());
|
|
3490
3490
|
}
|
|
3491
3491
|
};
|
|
3492
|
-
|
|
3492
|
+
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);
|
|
3493
3493
|
//#endregion
|
|
3494
3494
|
//#region src/scene/resources/textures/Texture2D.ts
|
|
3495
|
-
var
|
|
3495
|
+
var z = class extends yt {
|
|
3496
3496
|
static get EMPTY() {
|
|
3497
3497
|
return new this({
|
|
3498
3498
|
width: 1,
|
|
@@ -3603,10 +3603,10 @@ var B = class extends yt {
|
|
|
3603
3603
|
super._destroy(), Pe && this.source instanceof ImageBitmap && this.source.close();
|
|
3604
3604
|
}
|
|
3605
3605
|
};
|
|
3606
|
-
|
|
3606
|
+
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);
|
|
3607
3607
|
//#endregion
|
|
3608
3608
|
//#region src/scene/resources/textures/AnimatedTexture.ts
|
|
3609
|
-
var
|
|
3609
|
+
var nr = class extends yt {
|
|
3610
3610
|
frames;
|
|
3611
3611
|
frameIndex = 0;
|
|
3612
3612
|
get currentFrame() {
|
|
@@ -3616,7 +3616,7 @@ var tr = class extends yt {
|
|
|
3616
3616
|
super();
|
|
3617
3617
|
let t;
|
|
3618
3618
|
if (Array.isArray(e)) t = e;
|
|
3619
|
-
else if (e instanceof
|
|
3619
|
+
else if (e instanceof z) t = [{
|
|
3620
3620
|
texture: e,
|
|
3621
3621
|
duration: 0
|
|
3622
3622
|
}];
|
|
@@ -3631,7 +3631,7 @@ var tr = class extends yt {
|
|
|
3631
3631
|
e.texture.destroy();
|
|
3632
3632
|
});
|
|
3633
3633
|
}
|
|
3634
|
-
},
|
|
3634
|
+
}, rr = class extends z {
|
|
3635
3635
|
constructor(e = {}) {
|
|
3636
3636
|
super({
|
|
3637
3637
|
pixelRatio: 2,
|
|
@@ -3651,14 +3651,14 @@ var tr = class extends yt {
|
|
|
3651
3651
|
}
|
|
3652
3652
|
super._updateProperty(e, t, n);
|
|
3653
3653
|
}
|
|
3654
|
-
},
|
|
3654
|
+
}, ir = class e extends z {
|
|
3655
3655
|
static _cached = /* @__PURE__ */ new Map();
|
|
3656
3656
|
static get(t) {
|
|
3657
|
-
let n = new
|
|
3657
|
+
let n = new xt(t), r = n.toHex(), i = this._cached.get(r);
|
|
3658
3658
|
return i || (i = new e(n), this._cached.set(r, i)), i;
|
|
3659
3659
|
}
|
|
3660
3660
|
constructor(e) {
|
|
3661
|
-
let t = e instanceof
|
|
3661
|
+
let t = e instanceof xt ? e : new xt(e);
|
|
3662
3662
|
super({
|
|
3663
3663
|
width: 1,
|
|
3664
3664
|
height: 1,
|
|
@@ -3672,7 +3672,7 @@ var tr = class extends yt {
|
|
|
3672
3672
|
mipmap: !0
|
|
3673
3673
|
});
|
|
3674
3674
|
}
|
|
3675
|
-
},
|
|
3675
|
+
}, ar = class e extends z {
|
|
3676
3676
|
static test(e) {
|
|
3677
3677
|
return u(e);
|
|
3678
3678
|
}
|
|
@@ -3706,7 +3706,7 @@ var tr = class extends yt {
|
|
|
3706
3706
|
constructor(t, n, r) {
|
|
3707
3707
|
super(e.linearGradient(t, n, r));
|
|
3708
3708
|
}
|
|
3709
|
-
},
|
|
3709
|
+
}, or = class extends z {
|
|
3710
3710
|
constructor(e = {}) {
|
|
3711
3711
|
super({
|
|
3712
3712
|
...e,
|
|
@@ -3716,7 +3716,7 @@ var tr = class extends yt {
|
|
|
3716
3716
|
};
|
|
3717
3717
|
//#endregion
|
|
3718
3718
|
//#region src/scene/resources/textures/VideoTexture.ts
|
|
3719
|
-
function
|
|
3719
|
+
function sr(e) {
|
|
3720
3720
|
return {
|
|
3721
3721
|
autoLoad: !!(e?.autoLoad ?? !0),
|
|
3722
3722
|
autoPlay: !!(e?.autoPlay ?? !1),
|
|
@@ -3727,7 +3727,7 @@ function or(e) {
|
|
|
3727
3727
|
playsinline: !!(e?.playsinline ?? !0)
|
|
3728
3728
|
};
|
|
3729
3729
|
}
|
|
3730
|
-
var
|
|
3730
|
+
var cr = class e extends z {
|
|
3731
3731
|
static mimeTypes = new Map(Object.entries({
|
|
3732
3732
|
ogv: "video/ogg",
|
|
3733
3733
|
mov: "video/quicktime",
|
|
@@ -3789,7 +3789,7 @@ var sr = class e extends B {
|
|
|
3789
3789
|
_reject;
|
|
3790
3790
|
_seekResolves = [];
|
|
3791
3791
|
constructor(t, n) {
|
|
3792
|
-
let r =
|
|
3792
|
+
let r = sr(n);
|
|
3793
3793
|
if (!Ze(t)) {
|
|
3794
3794
|
typeof t == "string" && (t = [t]);
|
|
3795
3795
|
let n = t[0].src || t[0];
|
|
@@ -3882,16 +3882,16 @@ var sr = class e extends B {
|
|
|
3882
3882
|
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());
|
|
3883
3883
|
}
|
|
3884
3884
|
};
|
|
3885
|
-
|
|
3885
|
+
k([_({
|
|
3886
3886
|
internal: !0,
|
|
3887
3887
|
fallback: !0
|
|
3888
|
-
}),
|
|
3888
|
+
}), O("design:type", Boolean)], cr.prototype, "autoUpdate", void 0), k([_({
|
|
3889
3889
|
internal: !0,
|
|
3890
3890
|
fallback: 0
|
|
3891
|
-
}),
|
|
3891
|
+
}), O("design:type", Number)], cr.prototype, "fps", void 0);
|
|
3892
3892
|
//#endregion
|
|
3893
3893
|
//#region src/scene/resources/textures/ViewportTexture.ts
|
|
3894
|
-
var
|
|
3894
|
+
var lr = class extends z {}, ur = class extends v {
|
|
3895
3895
|
fillStyle;
|
|
3896
3896
|
fillRule;
|
|
3897
3897
|
strokeStyle;
|
|
@@ -3905,7 +3905,7 @@ var cr = class extends B {}, lr = class extends v {
|
|
|
3905
3905
|
_draws = [];
|
|
3906
3906
|
_triCache = [];
|
|
3907
3907
|
_parseDrawStyle(e) {
|
|
3908
|
-
return e ? e instanceof
|
|
3908
|
+
return e ? e instanceof z ? { texture: e } : { texture: ir.get(e) } : {};
|
|
3909
3909
|
}
|
|
3910
3910
|
stroke(e) {
|
|
3911
3911
|
if (!this.curves.length) return;
|
|
@@ -4022,7 +4022,7 @@ var cr = class extends B {}, lr = class extends v {
|
|
|
4022
4022
|
destroy() {
|
|
4023
4023
|
this.reset(), this._triCache.length = 0;
|
|
4024
4024
|
}
|
|
4025
|
-
},
|
|
4025
|
+
}, dr = class {
|
|
4026
4026
|
front = [];
|
|
4027
4027
|
default = [];
|
|
4028
4028
|
back = [];
|
|
@@ -4065,7 +4065,7 @@ var cr = class extends B {}, lr = class extends v {
|
|
|
4065
4065
|
toJSON() {
|
|
4066
4066
|
return [...this.default];
|
|
4067
4067
|
}
|
|
4068
|
-
},
|
|
4068
|
+
}, fr = class extends T {
|
|
4069
4069
|
parent;
|
|
4070
4070
|
getPropertyDeclarations() {
|
|
4071
4071
|
super.getPropertyDeclarations();
|
|
@@ -4084,22 +4084,22 @@ var cr = class extends B {}, lr = class extends v {
|
|
|
4084
4084
|
deleteProperty: (e, t) => Reflect.has(e, t) || String(t).startsWith("_") ? Reflect.deleteProperty(e, t) : (e.setProperty(String(t), void 0), !0)
|
|
4085
4085
|
});
|
|
4086
4086
|
}
|
|
4087
|
-
},
|
|
4088
|
-
function
|
|
4089
|
-
let t =
|
|
4090
|
-
return t++,
|
|
4087
|
+
}, pr, mr = {};
|
|
4088
|
+
function hr(e) {
|
|
4089
|
+
let t = mr[e] ?? 0;
|
|
4090
|
+
return t++, mr[e] = t, t;
|
|
4091
4091
|
}
|
|
4092
|
-
var
|
|
4092
|
+
var B = pr = class extends T {
|
|
4093
4093
|
static parse(e, t = "Node") {
|
|
4094
4094
|
if (Array.isArray(e)) return e.map((e) => this.parse(e));
|
|
4095
|
-
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ve.get(n ?? r.inCanvasIs ?? t)) ??
|
|
4095
|
+
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ve.get(n ?? r.inCanvasIs ?? t)) ?? pr)({
|
|
4096
4096
|
...a,
|
|
4097
4097
|
meta: r
|
|
4098
4098
|
});
|
|
4099
4099
|
return i?.forEach((e) => o.appendChild(this.parse(e))), o;
|
|
4100
4100
|
}
|
|
4101
4101
|
_mask;
|
|
4102
|
-
_meta = new
|
|
4102
|
+
_meta = new fr(this);
|
|
4103
4103
|
get meta() {
|
|
4104
4104
|
return this._meta;
|
|
4105
4105
|
}
|
|
@@ -4122,7 +4122,7 @@ var V = fr = class extends T {
|
|
|
4122
4122
|
}).append(t), this.on("treeEnter", this._onTreeEnter).on("treeExit", this._onTreeExit).on("parented", this._onParented).on("unparented", this._onUnparented).on("ready", this._onReady).on("process", this._onProcess), this.updateProcessable(), this.updateRenderable();
|
|
4123
4123
|
}
|
|
4124
4124
|
_defaultName() {
|
|
4125
|
-
return `@${this.is}@${
|
|
4125
|
+
return `@${this.is}@${hr(this.is)}`;
|
|
4126
4126
|
}
|
|
4127
4127
|
setProperties(e) {
|
|
4128
4128
|
if (e) {
|
|
@@ -4189,7 +4189,7 @@ var V = fr = class extends T {
|
|
|
4189
4189
|
}
|
|
4190
4190
|
return this;
|
|
4191
4191
|
}
|
|
4192
|
-
_children = new
|
|
4192
|
+
_children = new dr();
|
|
4193
4193
|
get children() {
|
|
4194
4194
|
return this._children.default;
|
|
4195
4195
|
}
|
|
@@ -4349,7 +4349,7 @@ var V = fr = class extends T {
|
|
|
4349
4349
|
append(...e) {
|
|
4350
4350
|
let t;
|
|
4351
4351
|
t = Array.isArray(e[0]) ? e[0] : e, t.forEach((e) => {
|
|
4352
|
-
e instanceof
|
|
4352
|
+
e instanceof pr ? this.appendChild(e) : this.appendChild(pr.parse(e));
|
|
4353
4353
|
});
|
|
4354
4354
|
}
|
|
4355
4355
|
before(...e) {
|
|
@@ -4452,13 +4452,13 @@ var V = fr = class extends T {
|
|
|
4452
4452
|
});
|
|
4453
4453
|
}
|
|
4454
4454
|
};
|
|
4455
|
-
|
|
4455
|
+
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([_({
|
|
4456
4456
|
internal: !0,
|
|
4457
4457
|
default: !0
|
|
4458
|
-
}),
|
|
4458
|
+
}), O("design:type", Boolean)], B.prototype, "needsRender", void 0), B = pr = k([S("Node"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], B);
|
|
4459
4459
|
//#endregion
|
|
4460
4460
|
//#region src/scene/main/TimelineNode.ts
|
|
4461
|
-
var
|
|
4461
|
+
var V = class extends B {
|
|
4462
4462
|
insideTimeRange = !1;
|
|
4463
4463
|
get _timeline() {
|
|
4464
4464
|
return this._tree?.timeline;
|
|
@@ -4494,7 +4494,7 @@ var H = class extends V {
|
|
|
4494
4494
|
return this._globalStartTime + this._globalDuration;
|
|
4495
4495
|
}
|
|
4496
4496
|
get currentTimeProgress() {
|
|
4497
|
-
return this._duration ?
|
|
4497
|
+
return this._duration ? E(this._currentTime / this._duration, 0, 1) : 0;
|
|
4498
4498
|
}
|
|
4499
4499
|
isInsideTimeRange() {
|
|
4500
4500
|
let e = this._currentTime;
|
|
@@ -4540,18 +4540,18 @@ var H = class extends V {
|
|
|
4540
4540
|
super._process(e), this._updateCurrentTime();
|
|
4541
4541
|
}
|
|
4542
4542
|
};
|
|
4543
|
-
|
|
4543
|
+
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([S("TimelineNode"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
|
|
4544
4544
|
//#endregion
|
|
4545
4545
|
//#region src/scene/main/CanvasItem.ts
|
|
4546
|
-
var
|
|
4547
|
-
function
|
|
4548
|
-
|
|
4546
|
+
var gr = [], _r = 0;
|
|
4547
|
+
function vr() {
|
|
4548
|
+
_r = 0;
|
|
4549
4549
|
}
|
|
4550
|
-
function
|
|
4551
|
-
let i =
|
|
4552
|
-
return i || (i = {},
|
|
4550
|
+
function yr(e, t, n, r) {
|
|
4551
|
+
let i = gr[_r];
|
|
4552
|
+
return i || (i = {}, gr[_r] = i), _r++, Object.assign(i, e), i.roundPixels = t, i.size = n, i.texture = r, i;
|
|
4553
4553
|
}
|
|
4554
|
-
var
|
|
4554
|
+
var br = class extends V {
|
|
4555
4555
|
_blendMode;
|
|
4556
4556
|
_parentGlobalVisible;
|
|
4557
4557
|
_globalVisible;
|
|
@@ -4569,7 +4569,7 @@ var yr = class extends H {
|
|
|
4569
4569
|
255,
|
|
4570
4570
|
255
|
|
4571
4571
|
];
|
|
4572
|
-
context = new
|
|
4572
|
+
context = new ur();
|
|
4573
4573
|
_resetContext = !0;
|
|
4574
4574
|
needsDraw = !0;
|
|
4575
4575
|
needsLayout = !1;
|
|
@@ -4631,7 +4631,7 @@ var yr = class extends H {
|
|
|
4631
4631
|
}
|
|
4632
4632
|
_updateGlobalOpacity() {
|
|
4633
4633
|
this._parentGlobalOpacity = this.getParent()?.opacity;
|
|
4634
|
-
let e =
|
|
4634
|
+
let e = E(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
|
|
4635
4635
|
this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
|
|
4636
4636
|
}
|
|
4637
4637
|
_draw() {
|
|
@@ -4700,7 +4700,7 @@ var yr = class extends H {
|
|
|
4700
4700
|
return;
|
|
4701
4701
|
}
|
|
4702
4702
|
let t = this._tree?.pixelate, n = this._tree?.roundPixels, r = this._batchables;
|
|
4703
|
-
for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof
|
|
4703
|
+
for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof lr && (a = this._handleViewportTexture(i)), e.batch2D.render(yr(i, n, t ? i.size : void 0, a));
|
|
4704
4704
|
super._render(e);
|
|
4705
4705
|
}
|
|
4706
4706
|
_cullsRender() {
|
|
@@ -4710,19 +4710,19 @@ var yr = class extends H {
|
|
|
4710
4710
|
super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
|
|
4711
4711
|
}
|
|
4712
4712
|
};
|
|
4713
|
-
|
|
4713
|
+
k([_(), O("design:type", Object)], br.prototype, "blendMode", void 0), k([_({
|
|
4714
4714
|
internal: !0,
|
|
4715
4715
|
fallback: !0
|
|
4716
|
-
}),
|
|
4716
|
+
}), O("design:type", Boolean)], br.prototype, "visible", void 0), k([_({
|
|
4717
4717
|
internal: !0,
|
|
4718
4718
|
fallback: 1
|
|
4719
|
-
}),
|
|
4719
|
+
}), O("design:type", Number)], br.prototype, "opacity", void 0), br = k([S("CanvasItem"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], br);
|
|
4720
4720
|
//#endregion
|
|
4721
4721
|
//#region src/scene/main/Viewport.ts
|
|
4722
|
-
var
|
|
4722
|
+
var H = class extends B {
|
|
4723
4723
|
canvasTransform = new b();
|
|
4724
4724
|
renderTargetIndex = 0;
|
|
4725
|
-
renderTargets = [new
|
|
4725
|
+
renderTargets = [new R(), new R()];
|
|
4726
4726
|
get valid() {
|
|
4727
4727
|
return !!(this.width && this.height);
|
|
4728
4728
|
}
|
|
@@ -4769,7 +4769,7 @@ var U = class extends V {
|
|
|
4769
4769
|
return !1;
|
|
4770
4770
|
}
|
|
4771
4771
|
activateWithCopy(e, t) {
|
|
4772
|
-
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0),
|
|
4772
|
+
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, er.instance, { sampler: 0 }));
|
|
4773
4773
|
}
|
|
4774
4774
|
renderStart(e, t) {
|
|
4775
4775
|
this.activate(e, t) && e.clear();
|
|
@@ -4794,16 +4794,16 @@ var U = class extends V {
|
|
|
4794
4794
|
super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
|
|
4795
4795
|
}
|
|
4796
4796
|
};
|
|
4797
|
-
|
|
4797
|
+
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([S("Viewport")], H);
|
|
4798
4798
|
//#endregion
|
|
4799
4799
|
//#region src/scene/main/Effect.ts
|
|
4800
|
-
var
|
|
4800
|
+
var U = class extends V {
|
|
4801
4801
|
material;
|
|
4802
4802
|
get _effectMode() {
|
|
4803
4803
|
return this.effectMode ?? "parent";
|
|
4804
4804
|
}
|
|
4805
|
-
viewport1 = new
|
|
4806
|
-
viewport2 = new
|
|
4805
|
+
viewport1 = new H();
|
|
4806
|
+
viewport2 = new H();
|
|
4807
4807
|
_renderId = 0;
|
|
4808
4808
|
_renderViewport;
|
|
4809
4809
|
_previousSibling;
|
|
@@ -4820,7 +4820,7 @@ var W = class extends H {
|
|
|
4820
4820
|
_updateProperty(e, t, n) {
|
|
4821
4821
|
switch (super._updateProperty(e, t, n), e) {
|
|
4822
4822
|
case "glsl": {
|
|
4823
|
-
let e = new
|
|
4823
|
+
let e = new $n(t);
|
|
4824
4824
|
!this.effectMode && e.has.transition && (this.effectMode = "transition"), this.material = e;
|
|
4825
4825
|
break;
|
|
4826
4826
|
}
|
|
@@ -5008,13 +5008,13 @@ var W = class extends H {
|
|
|
5008
5008
|
}
|
|
5009
5009
|
apply(e, t, n) {
|
|
5010
5010
|
this.material && (n?.redraw ? t.redraw(e, () => {
|
|
5011
|
-
|
|
5011
|
+
L.draw(e, this.material, {
|
|
5012
5012
|
from: 0,
|
|
5013
5013
|
to: 1,
|
|
5014
5014
|
progress: this.currentTimeProgress,
|
|
5015
5015
|
ratio: t.width / t.height
|
|
5016
5016
|
});
|
|
5017
|
-
}) :
|
|
5017
|
+
}) : L.draw(e, this.material, {
|
|
5018
5018
|
from: 0,
|
|
5019
5019
|
to: 1,
|
|
5020
5020
|
progress: this.currentTimeProgress,
|
|
@@ -5025,10 +5025,10 @@ var W = class extends H {
|
|
|
5025
5025
|
super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
|
|
5026
5026
|
}
|
|
5027
5027
|
};
|
|
5028
|
-
|
|
5028
|
+
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([S("Effect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], U);
|
|
5029
5029
|
//#endregion
|
|
5030
5030
|
//#region src/scene/main/RenderStack.ts
|
|
5031
|
-
var
|
|
5031
|
+
var xr = class {
|
|
5032
5032
|
currentCall;
|
|
5033
5033
|
calls = [];
|
|
5034
5034
|
createCall(e) {
|
|
@@ -5053,7 +5053,7 @@ var br = class {
|
|
|
5053
5053
|
});
|
|
5054
5054
|
}), this.reset();
|
|
5055
5055
|
}
|
|
5056
|
-
},
|
|
5056
|
+
}, Sr, Cr = Sr = class extends B {
|
|
5057
5057
|
currentTime = 0;
|
|
5058
5058
|
playing = !1;
|
|
5059
5059
|
playbackRate = 1;
|
|
@@ -5074,7 +5074,7 @@ var br = class {
|
|
|
5074
5074
|
}
|
|
5075
5075
|
static from(e, t = !1) {
|
|
5076
5076
|
let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
|
|
5077
|
-
return new
|
|
5077
|
+
return new Sr({
|
|
5078
5078
|
startTime: n,
|
|
5079
5079
|
endTime: r,
|
|
5080
5080
|
loop: t
|
|
@@ -5092,7 +5092,7 @@ var br = class {
|
|
|
5092
5092
|
}
|
|
5093
5093
|
addTime(e) {
|
|
5094
5094
|
let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = t - n, i = this.currentTime + e;
|
|
5095
|
-
return this.loop && r > 0 && i > t && (i = n + (i - n) % r), i =
|
|
5095
|
+
return this.loop && r > 0 && i > t && (i = n + (i - n) % r), i = E(i, n, t), this.currentTime = i, this.emit("updateCurrentTime", i, e), this;
|
|
5096
5096
|
}
|
|
5097
5097
|
play(e) {
|
|
5098
5098
|
return e?.rate !== void 0 && (this._rate = e.rate), e?.loopMode !== void 0 && (this.loopMode = e.loopMode), this._direction = 1, (!Number.isFinite(this.currentTime) || this.currentTime >= this.endTime) && (this.currentTime = Math.min(this.startTime, this.endTime)), this.playing = !0, this.playbackRate = this._rate * this._direction, this;
|
|
@@ -5120,10 +5120,10 @@ var br = class {
|
|
|
5120
5120
|
super._process(e), this.paused || this.addTime(e);
|
|
5121
5121
|
}
|
|
5122
5122
|
};
|
|
5123
|
-
|
|
5123
|
+
k([_({ fallback: 0 }), O("design:type", Number)], Cr.prototype, "startTime", void 0), k([_({ fallback: 2 ** 53 - 1 }), O("design:type", Number)], Cr.prototype, "endTime", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Cr.prototype, "loop", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Cr.prototype, "paused", void 0), Cr = Sr = k([S("Timeline"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Cr);
|
|
5124
5124
|
//#endregion
|
|
5125
5125
|
//#region src/scene/main/Window.ts
|
|
5126
|
-
var
|
|
5126
|
+
var wr = class extends H {
|
|
5127
5127
|
constructor() {
|
|
5128
5128
|
super(), this.renderTargets.forEach((e) => e.isRoot = !0);
|
|
5129
5129
|
}
|
|
@@ -5134,22 +5134,22 @@ var Cr = class extends U {
|
|
|
5134
5134
|
super.flush(e), this.finish(e);
|
|
5135
5135
|
}
|
|
5136
5136
|
};
|
|
5137
|
-
|
|
5137
|
+
wr = k([S("Window", {
|
|
5138
5138
|
processMode: "always",
|
|
5139
5139
|
renderMode: "always"
|
|
5140
|
-
}),
|
|
5140
|
+
}), O("design:paramtypes", [])], wr);
|
|
5141
5141
|
//#endregion
|
|
5142
5142
|
//#region src/scene/main/SceneTree.ts
|
|
5143
|
-
var
|
|
5143
|
+
var Tr = class extends Dt {
|
|
5144
5144
|
input = new _t();
|
|
5145
|
-
renderStack = new
|
|
5146
|
-
root = new
|
|
5147
|
-
timeline = new
|
|
5145
|
+
renderStack = new xr();
|
|
5146
|
+
root = new wr().setTree(this);
|
|
5147
|
+
timeline = new Cr().setTree(this);
|
|
5148
5148
|
nodeMap = /* @__PURE__ */ new Map();
|
|
5149
5149
|
_boundFonts;
|
|
5150
5150
|
_textRemeasureScheduled = !1;
|
|
5151
5151
|
_onFontLoad = () => this._scheduleTextRemeasure();
|
|
5152
|
-
_backgroundColor = new
|
|
5152
|
+
_backgroundColor = new xt();
|
|
5153
5153
|
_previousViewport;
|
|
5154
5154
|
_currentViewport;
|
|
5155
5155
|
getPreviousViewport() {
|
|
@@ -5202,41 +5202,41 @@ var wr = class extends Et {
|
|
|
5202
5202
|
this.renderStack.reset(), this.timeline.emit("process", e), this.emit("processing"), this.root.emit("process", e), this.emit("processed");
|
|
5203
5203
|
}
|
|
5204
5204
|
_render(e) {
|
|
5205
|
-
this.emit("rendering"),
|
|
5205
|
+
this.emit("rendering"), vr(), this.renderStack.render(e), this._renderScreen(e), this.emit("rendered");
|
|
5206
5206
|
}
|
|
5207
5207
|
_renderScreen(e) {
|
|
5208
5208
|
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);
|
|
5209
5209
|
let t = this.root.texture;
|
|
5210
|
-
t.activate(e, 0),
|
|
5210
|
+
t.activate(e, 0), L.draw(e), t.inactivate(e);
|
|
5211
5211
|
}
|
|
5212
5212
|
_destroy() {
|
|
5213
5213
|
super._destroy(), this._bindFonts(void 0), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
|
|
5214
5214
|
}
|
|
5215
5215
|
};
|
|
5216
|
-
|
|
5216
|
+
k([_({ alias: "root.msaa" }), O("design:type", Boolean)], Tr.prototype, "msaa", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Tr.prototype, "pixelate", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Tr.prototype, "roundPixels", void 0), k([_(), O("design:type", Object)], Tr.prototype, "backgroundColor", void 0), k([_({
|
|
5217
5217
|
internal: !0,
|
|
5218
5218
|
fallback: !1
|
|
5219
|
-
}),
|
|
5219
|
+
}), O("design:type", Boolean)], Tr.prototype, "debug", void 0), k([_({
|
|
5220
5220
|
internal: !0,
|
|
5221
5221
|
fallback: !1
|
|
5222
|
-
}),
|
|
5222
|
+
}), O("design:type", Boolean)], Tr.prototype, "processPaused", void 0), k([_({
|
|
5223
5223
|
internal: !0,
|
|
5224
5224
|
default: () => he
|
|
5225
|
-
}),
|
|
5225
|
+
}), O("design:type", Object)], Tr.prototype, "fonts", void 0);
|
|
5226
5226
|
//#endregion
|
|
5227
5227
|
//#region src/scene/main/Transition.ts
|
|
5228
|
-
var
|
|
5228
|
+
var Er = class extends U {
|
|
5229
5229
|
constructor(e, t = []) {
|
|
5230
5230
|
super(), this.setProperties(e).append(t);
|
|
5231
5231
|
}
|
|
5232
5232
|
};
|
|
5233
|
-
|
|
5233
|
+
Er = k([S("Transition", {
|
|
5234
5234
|
effectMode: "transition",
|
|
5235
5235
|
duration: 2e3
|
|
5236
|
-
}),
|
|
5236
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Er);
|
|
5237
5237
|
//#endregion
|
|
5238
5238
|
//#region src/scene/2d/Node2D.ts
|
|
5239
|
-
var
|
|
5239
|
+
var Dr = class extends br {
|
|
5240
5240
|
rotation = 0;
|
|
5241
5241
|
position = new x(0, 0, () => this.updateGlobalTransform());
|
|
5242
5242
|
scale = new x(1, 1, () => this.updateGlobalTransform());
|
|
@@ -5288,10 +5288,10 @@ var Er = class extends yr {
|
|
|
5288
5288
|
super._destroy(), this.position.destroy(), this.scale.destroy(), this.skew.destroy(), this.pivot.destroy(), this.extraTransform.destroy(), this.transform.destroy(), this.globalPosition.destroy(), this.globalScale.destroy(), this.globalSkew.destroy(), this.globalTransform.destroy();
|
|
5289
5289
|
}
|
|
5290
5290
|
};
|
|
5291
|
-
|
|
5291
|
+
Dr = k([S("Node2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Dr);
|
|
5292
5292
|
//#endregion
|
|
5293
5293
|
//#region src/scene/2d/Camera2D.ts
|
|
5294
|
-
var
|
|
5294
|
+
var Or = class extends Dr {
|
|
5295
5295
|
canvasTransform = new b();
|
|
5296
5296
|
_screenOffset = {
|
|
5297
5297
|
x: 0,
|
|
@@ -5332,7 +5332,7 @@ var Dr = class extends Er {
|
|
|
5332
5332
|
return this.setZoom(this._zoom.x + e, this._zoom.y + t);
|
|
5333
5333
|
}
|
|
5334
5334
|
setZoom(e, t = e) {
|
|
5335
|
-
return this._zoom.set(
|
|
5335
|
+
return this._zoom.set(E(e, this._minZoom.x, this._maxZoom.x), E(t, this._minZoom.y, this._maxZoom.y)), this;
|
|
5336
5336
|
}
|
|
5337
5337
|
setZoomAtOrigin(e, t, n) {
|
|
5338
5338
|
let r;
|
|
@@ -5435,19 +5435,19 @@ var Dr = class extends Er {
|
|
|
5435
5435
|
};
|
|
5436
5436
|
}
|
|
5437
5437
|
};
|
|
5438
|
-
|
|
5438
|
+
k([_({
|
|
5439
5439
|
internal: !0,
|
|
5440
5440
|
fallback: !1
|
|
5441
|
-
}),
|
|
5441
|
+
}), O("design:type", Boolean)], Or.prototype, "spaceKey", void 0), k([_({
|
|
5442
5442
|
internal: !0,
|
|
5443
5443
|
fallback: !1
|
|
5444
|
-
}),
|
|
5444
|
+
}), O("design:type", Boolean)], Or.prototype, "grabbing", void 0), Or = k([S("Camera2D", {
|
|
5445
5445
|
processMode: "disabled",
|
|
5446
5446
|
renderMode: "disabled"
|
|
5447
|
-
}),
|
|
5447
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Or);
|
|
5448
5448
|
//#endregion
|
|
5449
5449
|
//#region src/scene/2d/element/connectionRouter.ts
|
|
5450
|
-
function
|
|
5450
|
+
function kr(e, t) {
|
|
5451
5451
|
return Math.abs(e) >= Math.abs(t) ? {
|
|
5452
5452
|
x: Math.sign(e) || 1,
|
|
5453
5453
|
y: 0
|
|
@@ -5456,11 +5456,11 @@ function Or(e, t) {
|
|
|
5456
5456
|
y: Math.sign(t) || 1
|
|
5457
5457
|
};
|
|
5458
5458
|
}
|
|
5459
|
-
function
|
|
5459
|
+
function Ar(e, t, n, r = {}) {
|
|
5460
5460
|
let i = t.point, a = n.point, o = new v();
|
|
5461
5461
|
switch (e) {
|
|
5462
5462
|
case "curved": {
|
|
5463
|
-
let e = t.dir ??
|
|
5463
|
+
let e = t.dir ?? kr(a.x - i.x, a.y - i.y), s = n.dir ?? kr(i.x - a.x, i.y - a.y), c = a.x - i.x, l = a.y - i.y, u = Math.hypot(c, l) || 1, d = c / u, f = l / u, p = Math.max((r.stub ?? 16) * 2, u * .4), m = (e, t, n, r) => Math.max(.1, (1 + e * n + t * r) / 2), h = p * m(e.x, e.y, d, f), g = p * m(s.x, s.y, -d, -f), ee = i.x + e.x * h, te = i.y + e.y * h, ne = a.x + s.x * g, re = a.y + s.y * g;
|
|
5464
5464
|
for (let e = 0; e <= 32; e++) {
|
|
5465
5465
|
let t = e / 32, n = 1 - t, r = n * n * n, s = 3 * n * n * t, c = 3 * n * t * t, l = t * t * t, u = r * i.x + s * ee + c * ne + l * a.x, d = r * i.y + s * te + c * re + l * a.y;
|
|
5466
5466
|
e === 0 ? o.moveTo(u, d) : o.lineTo(u, d);
|
|
@@ -5468,7 +5468,7 @@ function kr(e, t, n, r = {}) {
|
|
|
5468
5468
|
break;
|
|
5469
5469
|
}
|
|
5470
5470
|
case "orthogonal": {
|
|
5471
|
-
let e =
|
|
5471
|
+
let e = Mr(t, n, r);
|
|
5472
5472
|
for (let t = 0; t < e.length; t++) t === 0 ? o.moveTo(e[t].x, e[t].y) : o.lineTo(e[t].x, e[t].y);
|
|
5473
5473
|
break;
|
|
5474
5474
|
}
|
|
@@ -5478,11 +5478,11 @@ function kr(e, t, n, r = {}) {
|
|
|
5478
5478
|
}
|
|
5479
5479
|
return o;
|
|
5480
5480
|
}
|
|
5481
|
-
function
|
|
5482
|
-
return
|
|
5481
|
+
function jr(e) {
|
|
5482
|
+
return kr(e.x, e.y);
|
|
5483
5483
|
}
|
|
5484
|
-
function
|
|
5485
|
-
let r = e.point, i = t.point, a = n.stub ?? 16, o =
|
|
5484
|
+
function Mr(e, t, n) {
|
|
5485
|
+
let r = e.point, i = t.point, a = n.stub ?? 16, o = jr(e.dir ?? kr(i.x - r.x, i.y - r.y)), s = jr(t.dir ?? kr(r.x - i.x, r.y - i.y)), c = {
|
|
5486
5486
|
x: r.x + o.x * a,
|
|
5487
5487
|
y: r.y + o.y * a
|
|
5488
5488
|
}, l = {
|
|
@@ -5494,12 +5494,12 @@ function jr(e, t, n) {
|
|
|
5494
5494
|
x: r.x,
|
|
5495
5495
|
y: r.y
|
|
5496
5496
|
}, c];
|
|
5497
|
-
return d.push(...
|
|
5497
|
+
return d.push(...Pr(c, o, l, s, a, u)), d.push(l, {
|
|
5498
5498
|
x: i.x,
|
|
5499
5499
|
y: i.y
|
|
5500
|
-
}),
|
|
5500
|
+
}), Fr(d);
|
|
5501
5501
|
}
|
|
5502
|
-
function
|
|
5502
|
+
function Nr(e, t, n, r, i) {
|
|
5503
5503
|
let a = Infinity, o = -Infinity, s = t === "y" ? "x" : "y";
|
|
5504
5504
|
for (let e of r) {
|
|
5505
5505
|
let r = e.min[s], i = r + e.size[s];
|
|
@@ -5510,7 +5510,7 @@ function Mr(e, t, n, r, i) {
|
|
|
5510
5510
|
}
|
|
5511
5511
|
return e > a && e < o ? a - i : e;
|
|
5512
5512
|
}
|
|
5513
|
-
function
|
|
5513
|
+
function Pr(e, t, n, r, i, a = []) {
|
|
5514
5514
|
let o = t.y === 0;
|
|
5515
5515
|
if (o === (r.y === 0)) {
|
|
5516
5516
|
if (o) {
|
|
@@ -5525,7 +5525,7 @@ function Nr(e, t, n, r, i, a = []) {
|
|
|
5525
5525
|
}];
|
|
5526
5526
|
}
|
|
5527
5527
|
let o = Math.abs(e.y - n.y) < .001 ? e.y + i : (e.y + n.y) / 2;
|
|
5528
|
-
return o =
|
|
5528
|
+
return o = Nr(o, "y", [Math.min(e.x, n.x), Math.max(e.x, n.x)], a, i), [{
|
|
5529
5529
|
x: e.x,
|
|
5530
5530
|
y: o
|
|
5531
5531
|
}, {
|
|
@@ -5544,7 +5544,7 @@ function Nr(e, t, n, r, i, a = []) {
|
|
|
5544
5544
|
}];
|
|
5545
5545
|
}
|
|
5546
5546
|
let s = Math.abs(e.x - n.x) < .001 ? e.x + i : (e.x + n.x) / 2;
|
|
5547
|
-
return s =
|
|
5547
|
+
return s = Nr(s, "x", [Math.min(e.y, n.y), Math.max(e.y, n.y)], a, i), [{
|
|
5548
5548
|
x: s,
|
|
5549
5549
|
y: e.y
|
|
5550
5550
|
}, {
|
|
@@ -5571,7 +5571,7 @@ function Nr(e, t, n, r, i, a = []) {
|
|
|
5571
5571
|
y: l.y
|
|
5572
5572
|
}];
|
|
5573
5573
|
}
|
|
5574
|
-
function
|
|
5574
|
+
function Fr(e) {
|
|
5575
5575
|
let t = [];
|
|
5576
5576
|
for (let n = 0; n < e.length; n++) {
|
|
5577
5577
|
let r = e[n], i = t[t.length - 1];
|
|
@@ -5581,7 +5581,7 @@ function Pr(e) {
|
|
|
5581
5581
|
}
|
|
5582
5582
|
//#endregion
|
|
5583
5583
|
//#region src/css/parseCssFilter.ts
|
|
5584
|
-
var
|
|
5584
|
+
var Ir = {
|
|
5585
5585
|
brightness: 1,
|
|
5586
5586
|
contrast: 1,
|
|
5587
5587
|
grayscale: 0,
|
|
@@ -5591,12 +5591,12 @@ var Fr = {
|
|
|
5591
5591
|
saturate: 1,
|
|
5592
5592
|
sepia: 0
|
|
5593
5593
|
};
|
|
5594
|
-
function
|
|
5595
|
-
let t = new
|
|
5594
|
+
function Lr(e) {
|
|
5595
|
+
let t = new wt();
|
|
5596
5596
|
if (e === "none") return t;
|
|
5597
5597
|
let n = Ae(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
|
|
5598
|
-
Object.keys(
|
|
5599
|
-
n[e] = n[e] ??
|
|
5598
|
+
Object.keys(Ir).forEach((e) => {
|
|
5599
|
+
n[e] = n[e] ?? Ir[e];
|
|
5600
5600
|
});
|
|
5601
5601
|
for (let e in n) {
|
|
5602
5602
|
let r = n[e];
|
|
@@ -5631,7 +5631,7 @@ function Ir(e) {
|
|
|
5631
5631
|
}
|
|
5632
5632
|
//#endregion
|
|
5633
5633
|
//#region src/css/parseCssTransformOrigin.ts
|
|
5634
|
-
function
|
|
5634
|
+
function Rr(e) {
|
|
5635
5635
|
let [t, n = t] = e.split(" ");
|
|
5636
5636
|
return [t, n].map((e) => {
|
|
5637
5637
|
switch (e = e.trim(), e) {
|
|
@@ -5646,11 +5646,11 @@ function Lr(e) {
|
|
|
5646
5646
|
}
|
|
5647
5647
|
//#endregion
|
|
5648
5648
|
//#region src/scene/effects/ColorAdjustEffect.ts
|
|
5649
|
-
var
|
|
5649
|
+
var zr, W = class extends U {
|
|
5650
5650
|
static {
|
|
5651
|
-
|
|
5651
|
+
zr = this;
|
|
5652
5652
|
}
|
|
5653
|
-
static material = new
|
|
5653
|
+
static material = new I({ gl: {
|
|
5654
5654
|
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}",
|
|
5655
5655
|
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}"
|
|
5656
5656
|
} });
|
|
@@ -5659,7 +5659,7 @@ var Rr, G = class extends W {
|
|
|
5659
5659
|
}
|
|
5660
5660
|
apply(e, t) {
|
|
5661
5661
|
t.redraw(e, () => {
|
|
5662
|
-
|
|
5662
|
+
L.draw(e, zr.material, {
|
|
5663
5663
|
sampler: 0,
|
|
5664
5664
|
saturation: this.saturation,
|
|
5665
5665
|
contrast: this.contrast,
|
|
@@ -5673,18 +5673,18 @@ var Rr, G = class extends W {
|
|
|
5673
5673
|
});
|
|
5674
5674
|
}
|
|
5675
5675
|
};
|
|
5676
|
-
|
|
5676
|
+
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 = zr = k([S("ColorAdjustEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
|
|
5677
5677
|
//#endregion
|
|
5678
5678
|
//#region src/scene/effects/ColorFilterEffect.ts
|
|
5679
|
-
var
|
|
5679
|
+
var Br, Vr = class extends U {
|
|
5680
5680
|
static {
|
|
5681
|
-
|
|
5681
|
+
Br = this;
|
|
5682
5682
|
}
|
|
5683
|
-
static material = new
|
|
5683
|
+
static material = new I({ gl: {
|
|
5684
5684
|
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}",
|
|
5685
5685
|
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}"
|
|
5686
5686
|
} });
|
|
5687
|
-
_colorMatrix = new
|
|
5687
|
+
_colorMatrix = new wt();
|
|
5688
5688
|
constructor(e, t = []) {
|
|
5689
5689
|
super(), this.setProperties(e).append(t);
|
|
5690
5690
|
}
|
|
@@ -5728,25 +5728,25 @@ var zr, Br = class extends W {
|
|
|
5728
5728
|
break;
|
|
5729
5729
|
}
|
|
5730
5730
|
}), t.redraw(e, () => {
|
|
5731
|
-
|
|
5731
|
+
L.draw(e, Br.material, {
|
|
5732
5732
|
sampler: 0,
|
|
5733
5733
|
m: r.toArray()
|
|
5734
5734
|
});
|
|
5735
5735
|
});
|
|
5736
5736
|
}
|
|
5737
5737
|
};
|
|
5738
|
-
|
|
5738
|
+
k([_(), O("design:type", String)], Vr.prototype, "filter", void 0), Vr = Br = k([S("ColorFilterEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Vr);
|
|
5739
5739
|
//#endregion
|
|
5740
5740
|
//#region src/scene/effects/ColorOverlayEffect.ts
|
|
5741
|
-
var
|
|
5741
|
+
var Hr, Ur = 50, Wr = class extends U {
|
|
5742
5742
|
static {
|
|
5743
|
-
|
|
5743
|
+
Hr = this;
|
|
5744
5744
|
}
|
|
5745
|
-
static material = new
|
|
5745
|
+
static material = new I({ gl: {
|
|
5746
5746
|
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}",
|
|
5747
5747
|
fragment: `precision mediump float;
|
|
5748
5748
|
uniform sampler2D sampler;
|
|
5749
|
-
uniform vec4 colors[${
|
|
5749
|
+
uniform vec4 colors[${Ur}];
|
|
5750
5750
|
varying vec2 vUv;
|
|
5751
5751
|
|
|
5752
5752
|
float calcWidth() {
|
|
@@ -5755,7 +5755,7 @@ float calcWidth() {
|
|
|
5755
5755
|
|
|
5756
5756
|
int calcCount() {
|
|
5757
5757
|
int count = 0;
|
|
5758
|
-
for (int i = 0; i < ${
|
|
5758
|
+
for (int i = 0; i < ${Ur}; i++) {
|
|
5759
5759
|
if (colors[i] != vec4(0,0,0,0)){
|
|
5760
5760
|
count++;
|
|
5761
5761
|
}
|
|
@@ -5767,7 +5767,7 @@ vec4 calcColor(float x) {
|
|
|
5767
5767
|
float perUnit = calcWidth() / float(calcCount());
|
|
5768
5768
|
int index = int(x / perUnit);
|
|
5769
5769
|
|
|
5770
|
-
for(int i=0; i<${
|
|
5770
|
+
for(int i=0; i<${Ur}; i++){
|
|
5771
5771
|
if(i==index){
|
|
5772
5772
|
return colors[i];
|
|
5773
5773
|
}
|
|
@@ -5782,7 +5782,7 @@ void main(void) {
|
|
|
5782
5782
|
gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
|
|
5783
5783
|
}`
|
|
5784
5784
|
} });
|
|
5785
|
-
_color = new
|
|
5785
|
+
_color = new xt();
|
|
5786
5786
|
constructor(e, t = []) {
|
|
5787
5787
|
super(), this.setProperties(e).append(t);
|
|
5788
5788
|
}
|
|
@@ -5793,31 +5793,31 @@ void main(void) {
|
|
|
5793
5793
|
let t = this._color.toArray();
|
|
5794
5794
|
return t[3] = this.alpha, t;
|
|
5795
5795
|
});
|
|
5796
|
-
for (; t.length <
|
|
5796
|
+
for (; t.length < Ur;) t.push([
|
|
5797
5797
|
0,
|
|
5798
5798
|
0,
|
|
5799
5799
|
0,
|
|
5800
5800
|
0
|
|
5801
5801
|
]);
|
|
5802
|
-
|
|
5802
|
+
L.draw(e, Hr.material, {
|
|
5803
5803
|
sampler: 0,
|
|
5804
|
-
colors: t.slice(0,
|
|
5804
|
+
colors: t.slice(0, Ur).flatMap((e) => e)
|
|
5805
5805
|
});
|
|
5806
5806
|
});
|
|
5807
5807
|
}
|
|
5808
5808
|
};
|
|
5809
|
-
|
|
5809
|
+
k([_({ default: () => [] }), O("design:type", Array)], Wr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Wr.prototype, "alpha", void 0), Wr = Hr = k([S("ColorOverlayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Wr);
|
|
5810
5810
|
//#endregion
|
|
5811
5811
|
//#region src/scene/effects/ColorRemoveEffect.ts
|
|
5812
|
-
var
|
|
5812
|
+
var Gr, Kr = class extends U {
|
|
5813
5813
|
static {
|
|
5814
|
-
|
|
5814
|
+
Gr = this;
|
|
5815
5815
|
}
|
|
5816
|
-
static material = new
|
|
5816
|
+
static material = new I({ gl: {
|
|
5817
5817
|
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}",
|
|
5818
5818
|
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}"
|
|
5819
5819
|
} });
|
|
5820
|
-
_color = new
|
|
5820
|
+
_color = new xt();
|
|
5821
5821
|
constructor(e, t = []) {
|
|
5822
5822
|
super(), this.setProperties(e).append(t);
|
|
5823
5823
|
}
|
|
@@ -5831,7 +5831,7 @@ var Wr, Gr = class extends W {
|
|
|
5831
5831
|
r.slice(0, 50).forEach((e, t) => {
|
|
5832
5832
|
n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
|
|
5833
5833
|
}), t.redraw(e, () => {
|
|
5834
|
-
|
|
5834
|
+
L.draw(e, Gr.material, {
|
|
5835
5835
|
sampler: 0,
|
|
5836
5836
|
epsilon: this.epsilon,
|
|
5837
5837
|
originalColors: n
|
|
@@ -5839,19 +5839,19 @@ var Wr, Gr = class extends W {
|
|
|
5839
5839
|
});
|
|
5840
5840
|
}
|
|
5841
5841
|
};
|
|
5842
|
-
|
|
5842
|
+
k([_({ default: () => [] }), O("design:type", Array)], Kr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Kr.prototype, "epsilon", void 0), Kr = Gr = k([S("ColorRemoveEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Kr);
|
|
5843
5843
|
//#endregion
|
|
5844
5844
|
//#region src/scene/effects/ColorReplaceEffect.ts
|
|
5845
|
-
var
|
|
5845
|
+
var qr, Jr = 50, Yr = class extends U {
|
|
5846
5846
|
static {
|
|
5847
|
-
|
|
5847
|
+
qr = this;
|
|
5848
5848
|
}
|
|
5849
|
-
static material = new
|
|
5849
|
+
static material = new I({ gl: {
|
|
5850
5850
|
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}",
|
|
5851
5851
|
fragment: `varying vec2 vUv;
|
|
5852
5852
|
uniform sampler2D sampler;
|
|
5853
5853
|
uniform float epsilon;
|
|
5854
|
-
const int MAX_COLORS = ${
|
|
5854
|
+
const int MAX_COLORS = ${Jr};
|
|
5855
5855
|
uniform vec3 originalColors[MAX_COLORS];
|
|
5856
5856
|
uniform vec3 targetColors[MAX_COLORS];
|
|
5857
5857
|
|
|
@@ -5879,7 +5879,7 @@ void main(void) {
|
|
|
5879
5879
|
}
|
|
5880
5880
|
}`
|
|
5881
5881
|
} });
|
|
5882
|
-
_color = new
|
|
5882
|
+
_color = new xt();
|
|
5883
5883
|
constructor(e, t = []) {
|
|
5884
5884
|
super(), this.setProperties(e).append(t);
|
|
5885
5885
|
}
|
|
@@ -5888,8 +5888,8 @@ void main(void) {
|
|
|
5888
5888
|
this._color.value = e[0];
|
|
5889
5889
|
let t = this._color.toArray().slice(0, 3);
|
|
5890
5890
|
return this._color.value = e[1], [t, this._color.toArray().slice(0, 3)];
|
|
5891
|
-
}), r = this.epsilon, i = new Float32Array(
|
|
5892
|
-
for (; n.length <
|
|
5891
|
+
}), r = this.epsilon, i = new Float32Array(Jr * 3), a = new Float32Array(Jr * 3);
|
|
5892
|
+
for (; n.length < Jr;) n.push([[
|
|
5893
5893
|
-1,
|
|
5894
5894
|
0,
|
|
5895
5895
|
0
|
|
@@ -5899,10 +5899,10 @@ void main(void) {
|
|
|
5899
5899
|
0,
|
|
5900
5900
|
1
|
|
5901
5901
|
]]);
|
|
5902
|
-
n.slice(0,
|
|
5902
|
+
n.slice(0, Jr).forEach(([e, t], n) => {
|
|
5903
5903
|
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];
|
|
5904
5904
|
}), t.redraw(e, () => {
|
|
5905
|
-
|
|
5905
|
+
L.draw(e, qr.material, {
|
|
5906
5906
|
sampler: 0,
|
|
5907
5907
|
epsilon: r,
|
|
5908
5908
|
originalColors: i,
|
|
@@ -5911,17 +5911,17 @@ void main(void) {
|
|
|
5911
5911
|
});
|
|
5912
5912
|
}
|
|
5913
5913
|
};
|
|
5914
|
-
|
|
5914
|
+
k([_({ default: () => [] }), O("design:type", Array)], Yr.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], Yr.prototype, "epsilon", void 0), Yr = qr = k([S("ColorReplaceEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Yr);
|
|
5915
5915
|
//#endregion
|
|
5916
5916
|
//#region src/scene/effects/DrawboardEffect.frag?raw
|
|
5917
|
-
var
|
|
5917
|
+
var Xr = "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", Zr, G = class extends U {
|
|
5918
5918
|
static {
|
|
5919
|
-
|
|
5919
|
+
Zr = this;
|
|
5920
5920
|
}
|
|
5921
5921
|
_watermark;
|
|
5922
|
-
static material = new
|
|
5922
|
+
static material = new I({ gl: {
|
|
5923
5923
|
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}",
|
|
5924
|
-
fragment:
|
|
5924
|
+
fragment: Xr
|
|
5925
5925
|
} });
|
|
5926
5926
|
constructor(e, t = []) {
|
|
5927
5927
|
super(), this.setProperties(e).append(t);
|
|
@@ -5970,7 +5970,7 @@ var Yr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5970
5970
|
zoomedOut: this.dotColor ?? a.zoomedOut,
|
|
5971
5971
|
diff: this.dotZoomDiff ?? a.diff
|
|
5972
5972
|
};
|
|
5973
|
-
|
|
5973
|
+
L.draw(e, Zr.material, {
|
|
5974
5974
|
uTexture: 0,
|
|
5975
5975
|
inputSize: [t.width, t.height],
|
|
5976
5976
|
zoom: [n[0], n[4]],
|
|
@@ -5994,20 +5994,20 @@ var Yr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5994
5994
|
});
|
|
5995
5995
|
}
|
|
5996
5996
|
};
|
|
5997
|
-
|
|
5997
|
+
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 = Zr = k([S("DrawboardEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], G);
|
|
5998
5998
|
//#endregion
|
|
5999
5999
|
//#region src/scene/effects/GaussianBlurEffect.ts
|
|
6000
|
-
var
|
|
6000
|
+
var Qr, $r = "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}", ei = class extends U {
|
|
6001
6001
|
static {
|
|
6002
|
-
|
|
6002
|
+
Qr = this;
|
|
6003
6003
|
}
|
|
6004
|
-
static materialX = new
|
|
6004
|
+
static materialX = new I({ gl: {
|
|
6005
6005
|
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}",
|
|
6006
|
-
fragment:
|
|
6006
|
+
fragment: $r
|
|
6007
6007
|
} });
|
|
6008
|
-
static materialY = new
|
|
6008
|
+
static materialY = new I({ gl: {
|
|
6009
6009
|
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}",
|
|
6010
|
-
fragment:
|
|
6010
|
+
fragment: $r
|
|
6011
6011
|
} });
|
|
6012
6012
|
constructor(e, t = []) {
|
|
6013
6013
|
super(), this.setProperties(e).append(t);
|
|
@@ -6015,39 +6015,39 @@ var Zr, Qr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void
|
|
|
6015
6015
|
apply(e, t) {
|
|
6016
6016
|
let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
|
|
6017
6017
|
for (let r = 0; r < i; r++) t.redraw(e, () => {
|
|
6018
|
-
|
|
6018
|
+
L.draw(e, Qr.materialX, {
|
|
6019
6019
|
sampler: 0,
|
|
6020
6020
|
uStrength: n * (this.strength / i)
|
|
6021
6021
|
});
|
|
6022
6022
|
});
|
|
6023
6023
|
for (let n = 0; n < i; n++) t.redraw(e, () => {
|
|
6024
|
-
|
|
6024
|
+
L.draw(e, Qr.materialY, {
|
|
6025
6025
|
sampler: 0,
|
|
6026
6026
|
uStrength: r * (this.strength / i)
|
|
6027
6027
|
});
|
|
6028
6028
|
});
|
|
6029
6029
|
}
|
|
6030
6030
|
};
|
|
6031
|
-
|
|
6031
|
+
k([_({ fallback: 4 }), O("design:type", Number)], ei.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], ei.prototype, "quality", void 0), ei = Qr = k([S("GaussianBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ei);
|
|
6032
6032
|
//#endregion
|
|
6033
6033
|
//#region src/scene/effects/DropShadowEffect.ts
|
|
6034
|
-
var
|
|
6034
|
+
var ti, ni = class extends U {
|
|
6035
6035
|
static {
|
|
6036
|
-
|
|
6036
|
+
ti = this;
|
|
6037
6037
|
}
|
|
6038
|
-
static material = new
|
|
6038
|
+
static material = new I({ gl: {
|
|
6039
6039
|
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}",
|
|
6040
6040
|
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}"
|
|
6041
6041
|
} });
|
|
6042
|
-
blurEffect = new
|
|
6043
|
-
viewport3 = new
|
|
6044
|
-
_color = new
|
|
6042
|
+
blurEffect = new ei();
|
|
6043
|
+
viewport3 = new H();
|
|
6044
|
+
_color = new xt();
|
|
6045
6045
|
constructor(e, t = []) {
|
|
6046
6046
|
super(), this.setProperties(e).append(t);
|
|
6047
6047
|
}
|
|
6048
6048
|
apply(e, t) {
|
|
6049
6049
|
this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
|
|
6050
|
-
this._color.value = this.color,
|
|
6050
|
+
this._color.value = this.color, L.draw(e, ti.material, {
|
|
6051
6051
|
sampler: 0,
|
|
6052
6052
|
uAlpha: this._color.a,
|
|
6053
6053
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -6060,18 +6060,18 @@ var ei, ti = class extends W {
|
|
|
6060
6060
|
]
|
|
6061
6061
|
});
|
|
6062
6062
|
}), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
|
|
6063
|
-
this.viewport3.texture.activate(e, 1),
|
|
6063
|
+
this.viewport3.texture.activate(e, 1), L.draw(e, er.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, er.instance, { sampler: 0 }), e.texture.unbind(1);
|
|
6064
6064
|
});
|
|
6065
6065
|
}
|
|
6066
6066
|
};
|
|
6067
|
-
|
|
6067
|
+
k([_({ fallback: "#000000FF" }), O("design:type", Object)], ni.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ni.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ni.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ni.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], ni.prototype, "shadowOnly", void 0), ni = ti = k([S("DropShadowEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ni);
|
|
6068
6068
|
//#endregion
|
|
6069
6069
|
//#region src/scene/effects/EmbossEffect.ts
|
|
6070
|
-
var
|
|
6070
|
+
var ri, ii = class extends U {
|
|
6071
6071
|
static {
|
|
6072
|
-
|
|
6072
|
+
ri = this;
|
|
6073
6073
|
}
|
|
6074
|
-
static material = new
|
|
6074
|
+
static material = new I({ gl: {
|
|
6075
6075
|
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}",
|
|
6076
6076
|
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}"
|
|
6077
6077
|
} });
|
|
@@ -6080,7 +6080,7 @@ var ni, ri = class extends W {
|
|
|
6080
6080
|
}
|
|
6081
6081
|
apply(e, t) {
|
|
6082
6082
|
t.redraw(e, () => {
|
|
6083
|
-
|
|
6083
|
+
L.draw(e, ri.material, {
|
|
6084
6084
|
sampler: 0,
|
|
6085
6085
|
strength: this.strength,
|
|
6086
6086
|
inputSize: [
|
|
@@ -6093,14 +6093,14 @@ var ni, ri = class extends W {
|
|
|
6093
6093
|
});
|
|
6094
6094
|
}
|
|
6095
6095
|
};
|
|
6096
|
-
|
|
6096
|
+
k([_({ fallback: 5 }), O("design:type", Number)], ii.prototype, "strength", void 0), ii = ri = k([S("EmbossEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ii);
|
|
6097
6097
|
//#endregion
|
|
6098
6098
|
//#region src/scene/effects/GlitchEffect.ts
|
|
6099
|
-
var
|
|
6099
|
+
var ai, K = class extends U {
|
|
6100
6100
|
static {
|
|
6101
|
-
|
|
6101
|
+
ai = this;
|
|
6102
6102
|
}
|
|
6103
|
-
static material = new
|
|
6103
|
+
static material = new I({ gl: {
|
|
6104
6104
|
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}",
|
|
6105
6105
|
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}"
|
|
6106
6106
|
} });
|
|
@@ -6113,7 +6113,7 @@ var ii, q = class extends W {
|
|
|
6113
6113
|
super(), this.setProperties(e).append(t);
|
|
6114
6114
|
let n = w(4, this.sampleSize);
|
|
6115
6115
|
if (!n) throw Error("GlitchEffect requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
6116
|
-
this._canvas = n, this._texture = new
|
|
6116
|
+
this._canvas = n, this._texture = new z(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
|
|
6117
6117
|
}
|
|
6118
6118
|
redraw() {
|
|
6119
6119
|
let e = this.sampleSize, t = this._texture, n = this._canvas.getContext("2d");
|
|
@@ -6130,7 +6130,7 @@ var ii, q = class extends W {
|
|
|
6130
6130
|
this._needsRedraw || (this._needsRedraw = !0, this.redraw());
|
|
6131
6131
|
let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
|
|
6132
6132
|
t.redraw(e, () => {
|
|
6133
|
-
this._texture.activate(e, 1),
|
|
6133
|
+
this._texture.activate(e, 1), L.draw(e, ai.material, {
|
|
6134
6134
|
sampler: 0,
|
|
6135
6135
|
filterClamp: [
|
|
6136
6136
|
0,
|
|
@@ -6159,14 +6159,14 @@ var ii, q = class extends W {
|
|
|
6159
6159
|
});
|
|
6160
6160
|
}
|
|
6161
6161
|
};
|
|
6162
|
-
|
|
6162
|
+
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 = ai = k([S("GlitchEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
|
|
6163
6163
|
//#endregion
|
|
6164
6164
|
//#region src/scene/effects/GodrayEffect.ts
|
|
6165
|
-
var
|
|
6165
|
+
var oi, si = "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 {
|
|
6166
6166
|
static {
|
|
6167
|
-
|
|
6167
|
+
oi = this;
|
|
6168
6168
|
}
|
|
6169
|
-
static material = new
|
|
6169
|
+
static material = new I({ gl: {
|
|
6170
6170
|
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}",
|
|
6171
6171
|
fragment: `precision highp float;
|
|
6172
6172
|
varying vec2 vUv;
|
|
@@ -6179,7 +6179,7 @@ uniform float uTime;
|
|
|
6179
6179
|
uniform vec3 uRay;
|
|
6180
6180
|
uniform vec4 uInputSize;
|
|
6181
6181
|
|
|
6182
|
-
${
|
|
6182
|
+
${si}
|
|
6183
6183
|
|
|
6184
6184
|
void main(void) {
|
|
6185
6185
|
bool uParallel = uParallel > 0.5;
|
|
@@ -6218,7 +6218,7 @@ void main(void) {
|
|
|
6218
6218
|
apply(e, t) {
|
|
6219
6219
|
let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
|
|
6220
6220
|
t.redraw(e, () => {
|
|
6221
|
-
|
|
6221
|
+
L.draw(e, oi.material, {
|
|
6222
6222
|
sampler: 0,
|
|
6223
6223
|
uDimensions: [t.width, t.height],
|
|
6224
6224
|
uParallel: +!!this.parallel,
|
|
@@ -6240,15 +6240,15 @@ void main(void) {
|
|
|
6240
6240
|
});
|
|
6241
6241
|
}
|
|
6242
6242
|
};
|
|
6243
|
-
|
|
6243
|
+
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 = oi = k([S("GodrayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
|
|
6244
6244
|
//#endregion
|
|
6245
6245
|
//#region src/scene/effects/KawaseBlurEffect.ts
|
|
6246
|
-
var
|
|
6246
|
+
var ci = "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}", li = "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}", ui = class extends U {
|
|
6247
6247
|
_kernels = [0];
|
|
6248
6248
|
constructor(e, t = []) {
|
|
6249
|
-
super(), this.material = new
|
|
6249
|
+
super(), this.material = new I({ gl: {
|
|
6250
6250
|
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}",
|
|
6251
|
-
fragment: e?.clamp ?
|
|
6251
|
+
fragment: e?.clamp ? li : ci
|
|
6252
6252
|
} }), this.setProperties(e).append(t), this._generateKernels();
|
|
6253
6253
|
}
|
|
6254
6254
|
_updateProperty(e, t, n) {
|
|
@@ -6272,7 +6272,7 @@ var si = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6272
6272
|
this._kernels.forEach((i) => {
|
|
6273
6273
|
let a = i + .5;
|
|
6274
6274
|
t.redraw(e, () => {
|
|
6275
|
-
|
|
6275
|
+
L.draw(e, this.material, {
|
|
6276
6276
|
sampler: 0,
|
|
6277
6277
|
uOffset: [a * n, a * r],
|
|
6278
6278
|
uInputClamp: [
|
|
@@ -6286,14 +6286,14 @@ var si = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6286
6286
|
});
|
|
6287
6287
|
}
|
|
6288
6288
|
};
|
|
6289
|
-
|
|
6289
|
+
k([_({ fallback: 4 }), O("design:type", Number)], ui.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], ui.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], ui.prototype, "pixelSize", void 0), ui = k([S("KawaseBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ui);
|
|
6290
6290
|
//#endregion
|
|
6291
6291
|
//#region src/scene/effects/MaskEffect.ts
|
|
6292
|
-
var
|
|
6292
|
+
var di, fi = class extends U {
|
|
6293
6293
|
static {
|
|
6294
|
-
|
|
6294
|
+
di = this;
|
|
6295
6295
|
}
|
|
6296
|
-
static material = new
|
|
6296
|
+
static material = new I({ gl: {
|
|
6297
6297
|
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}",
|
|
6298
6298
|
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}"
|
|
6299
6299
|
} });
|
|
@@ -6313,7 +6313,7 @@ var ui, di = class extends W {
|
|
|
6313
6313
|
}
|
|
6314
6314
|
apply(e, t, n) {
|
|
6315
6315
|
this.texture && t.redraw(e, () => {
|
|
6316
|
-
this.texture.activate(e, 1),
|
|
6316
|
+
this.texture.activate(e, 1), L.draw(e, di.material, {
|
|
6317
6317
|
sampler: 0,
|
|
6318
6318
|
mask: 1,
|
|
6319
6319
|
rotation: n.target?.globalRotation ?? 0
|
|
@@ -6321,33 +6321,33 @@ var ui, di = class extends W {
|
|
|
6321
6321
|
});
|
|
6322
6322
|
}
|
|
6323
6323
|
};
|
|
6324
|
-
|
|
6324
|
+
k([_({ fallback: "" }), O("design:type", String)], fi.prototype, "image", void 0), fi = di = k([S("MaskEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], fi);
|
|
6325
6325
|
//#endregion
|
|
6326
6326
|
//#region src/scene/effects/OutlineEffect.ts
|
|
6327
|
-
var
|
|
6327
|
+
var pi, mi = "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 {
|
|
6328
6328
|
static {
|
|
6329
|
-
|
|
6329
|
+
pi = this;
|
|
6330
6330
|
}
|
|
6331
6331
|
static MIN_SAMPLES = 1;
|
|
6332
6332
|
static MAX_SAMPLES = 100;
|
|
6333
6333
|
static getAngleStep(e) {
|
|
6334
|
-
return Number.parseFloat((Math.PI * 2 / Math.max(e *
|
|
6334
|
+
return Number.parseFloat((Math.PI * 2 / Math.max(e * pi.MAX_SAMPLES, pi.MIN_SAMPLES)).toFixed(7));
|
|
6335
6335
|
}
|
|
6336
|
-
_color = new
|
|
6336
|
+
_color = new xt();
|
|
6337
6337
|
constructor(e, t = []) {
|
|
6338
|
-
super(), this.setProperties(e).append(t), this.material = new
|
|
6338
|
+
super(), this.setProperties(e).append(t), this.material = new I({ gl: {
|
|
6339
6339
|
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}",
|
|
6340
|
-
fragment:
|
|
6340
|
+
fragment: mi.replace(/\{ANGLE_STEP\}/, pi.getAngleStep(this.quality).toFixed(7))
|
|
6341
6341
|
} });
|
|
6342
6342
|
}
|
|
6343
6343
|
apply(e, t) {
|
|
6344
6344
|
t.redraw(e, () => {
|
|
6345
|
-
this._color.value = this.color,
|
|
6345
|
+
this._color.value = this.color, L.draw(e, this.material, {
|
|
6346
6346
|
sampler: 0,
|
|
6347
6347
|
uThickness: [this.width / t.width, this.width / t.height],
|
|
6348
6348
|
uColor: this._color.toArray().slice(0, 3),
|
|
6349
6349
|
uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
|
|
6350
|
-
uAngleStep:
|
|
6350
|
+
uAngleStep: pi.getAngleStep(this.quality),
|
|
6351
6351
|
uKnockout: +!!this.knockout,
|
|
6352
6352
|
uInputClamp: [
|
|
6353
6353
|
0,
|
|
@@ -6359,14 +6359,14 @@ var fi, pi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6359
6359
|
});
|
|
6360
6360
|
}
|
|
6361
6361
|
};
|
|
6362
|
-
|
|
6362
|
+
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 = pi = k([S("OutlineEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
|
|
6363
6363
|
//#endregion
|
|
6364
6364
|
//#region src/scene/effects/PixelateEffect.ts
|
|
6365
|
-
var hi, gi = class extends
|
|
6365
|
+
var hi, gi = class extends U {
|
|
6366
6366
|
static {
|
|
6367
6367
|
hi = this;
|
|
6368
6368
|
}
|
|
6369
|
-
static material = new
|
|
6369
|
+
static material = new I({ gl: {
|
|
6370
6370
|
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}",
|
|
6371
6371
|
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}"
|
|
6372
6372
|
} });
|
|
@@ -6380,18 +6380,18 @@ var hi, gi = class extends W {
|
|
|
6380
6380
|
offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
|
|
6381
6381
|
step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
|
|
6382
6382
|
};
|
|
6383
|
-
|
|
6383
|
+
L.draw(e, hi.material, a);
|
|
6384
6384
|
});
|
|
6385
6385
|
}
|
|
6386
6386
|
};
|
|
6387
|
-
|
|
6387
|
+
k([_({ fallback: 10 }), O("design:type", Number)], gi.prototype, "strength", void 0), gi = hi = k([S("PixelateEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], gi);
|
|
6388
6388
|
//#endregion
|
|
6389
6389
|
//#region src/scene/effects/ZoomBlurEffect.ts
|
|
6390
|
-
var _i, vi = class extends
|
|
6390
|
+
var _i, vi = class extends U {
|
|
6391
6391
|
static {
|
|
6392
6392
|
_i = this;
|
|
6393
6393
|
}
|
|
6394
|
-
static material = new
|
|
6394
|
+
static material = new I({ gl: {
|
|
6395
6395
|
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}",
|
|
6396
6396
|
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}"
|
|
6397
6397
|
} });
|
|
@@ -6400,7 +6400,7 @@ var _i, vi = class extends W {
|
|
|
6400
6400
|
}
|
|
6401
6401
|
apply(e, t) {
|
|
6402
6402
|
t.redraw(e, () => {
|
|
6403
|
-
|
|
6403
|
+
L.draw(e, _i.material, {
|
|
6404
6404
|
sampler: 0,
|
|
6405
6405
|
uCenter: [t.width / 2, t.height / 2],
|
|
6406
6406
|
uInnerRadius: this.innerRadius,
|
|
@@ -6416,10 +6416,19 @@ var _i, vi = class extends W {
|
|
|
6416
6416
|
});
|
|
6417
6417
|
}
|
|
6418
6418
|
};
|
|
6419
|
-
|
|
6419
|
+
k([_(), O("design:type", Array)], vi.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], vi.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], vi.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], vi.prototype, "strength", void 0), vi = _i = k([S("ZoomBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], vi);
|
|
6420
|
+
//#endregion
|
|
6421
|
+
//#region src/scene/2d/element/imagePipeline.ts
|
|
6422
|
+
var yi;
|
|
6423
|
+
function bi(e) {
|
|
6424
|
+
yi = e;
|
|
6425
|
+
}
|
|
6426
|
+
function xi() {
|
|
6427
|
+
return yi;
|
|
6428
|
+
}
|
|
6420
6429
|
//#endregion
|
|
6421
6430
|
//#region src/scene/2d/element/utils.ts
|
|
6422
|
-
function
|
|
6431
|
+
function Si(e, t) {
|
|
6423
6432
|
let { x: n, y: r, width: i, height: a } = t, o = !1, s = new b().translate(-n, -r).scale(1 / i, 1 / a);
|
|
6424
6433
|
if (e.cropRect) {
|
|
6425
6434
|
let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
|
|
@@ -6469,21 +6478,55 @@ var Y = class extends T {
|
|
|
6469
6478
|
case "image":
|
|
6470
6479
|
case "linearGradient":
|
|
6471
6480
|
case "radialGradient":
|
|
6481
|
+
case "pipelines":
|
|
6472
6482
|
this._updateTexture();
|
|
6473
6483
|
break;
|
|
6474
6484
|
}
|
|
6475
6485
|
}
|
|
6476
6486
|
async loadTexture() {
|
|
6477
|
-
if (this.linearGradient || this.radialGradient) this.texture = new
|
|
6487
|
+
if (this.linearGradient || this.radialGradient) this.texture = new ar(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
|
|
6478
6488
|
else if (d(this.image)) this.animatedTexture = void 0, this.texture = void 0;
|
|
6479
6489
|
else if (this._parent.tree?.log(`load image ${this.image}`), this.image !== "viewport") {
|
|
6480
6490
|
let e = this.image.split("?")[0].endsWith(".gif"), t = this.image, n = await $.loadBy(t, async () => {
|
|
6481
6491
|
let n = await $.fetch(t).then((e) => e.blob());
|
|
6482
6492
|
return e ||= n.type.startsWith("image/gif") ?? !1, e ? await $.gif.load(n) : await $.texture.load(n);
|
|
6483
6493
|
});
|
|
6484
|
-
e ? this.animatedTexture = n : this.texture = n;
|
|
6494
|
+
e ? this.animatedTexture = n : (this.texture = n, await this._applyPipelines(t));
|
|
6485
6495
|
}
|
|
6486
6496
|
}
|
|
6497
|
+
async _applyPipelines(e) {
|
|
6498
|
+
let t = this.pipelines, n = xi();
|
|
6499
|
+
if (!t?.length || !n) return;
|
|
6500
|
+
let r = await $.loadBy(`${e}#mc-pipeline:${this._pipelineKey(t)}`, async () => {
|
|
6501
|
+
let r = await this._decodePipelineSource(e);
|
|
6502
|
+
if (!r) return;
|
|
6503
|
+
let i = await n(t, r);
|
|
6504
|
+
if (i) return this._pipelineImageToCanvas(i);
|
|
6505
|
+
});
|
|
6506
|
+
r && (this.texture = new z({
|
|
6507
|
+
source: r,
|
|
6508
|
+
width: r.width,
|
|
6509
|
+
height: r.height,
|
|
6510
|
+
uploadMethodId: "image"
|
|
6511
|
+
}));
|
|
6512
|
+
}
|
|
6513
|
+
_pipelineKey(e) {
|
|
6514
|
+
return e.map((e) => `${e.name}:${e.params ? JSON.stringify(e.params) : ""}`).join("|");
|
|
6515
|
+
}
|
|
6516
|
+
async _decodePipelineSource(e) {
|
|
6517
|
+
let t = await $.fetchImageBitmap(e), n = Math.max(1, Math.round(t.width)), r = Math.max(1, Math.round(t.height)), i = w(n, r), a = i?.getContext("2d");
|
|
6518
|
+
if (!(!i || !a)) return a.drawImage(t, 0, 0, n, r), Pe && t instanceof ImageBitmap && t.close(), {
|
|
6519
|
+
data: a.getImageData(0, 0, n, r).data,
|
|
6520
|
+
width: n,
|
|
6521
|
+
height: r
|
|
6522
|
+
};
|
|
6523
|
+
}
|
|
6524
|
+
_pipelineImageToCanvas(e) {
|
|
6525
|
+
let t = Math.max(1, Math.round(e.width)), n = Math.max(1, Math.round(e.height)), r = w(t, n), i = r?.getContext("2d");
|
|
6526
|
+
if (!r || !i) return;
|
|
6527
|
+
let a = i.createImageData(t, n);
|
|
6528
|
+
return a.data.set(e.data), i.putImageData(a, 0, 0), r;
|
|
6529
|
+
}
|
|
6487
6530
|
async _updateTexture() {
|
|
6488
6531
|
await this.loadTexture(), this._parent.requestDraw();
|
|
6489
6532
|
}
|
|
@@ -6495,12 +6538,12 @@ var Y = class extends T {
|
|
|
6495
6538
|
width: e,
|
|
6496
6539
|
height: t
|
|
6497
6540
|
} };
|
|
6498
|
-
if (this.image === "viewport") n.fillStyle = new
|
|
6541
|
+
if (this.image === "viewport") n.fillStyle = new lr();
|
|
6499
6542
|
else {
|
|
6500
6543
|
let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
|
|
6501
6544
|
r = {
|
|
6502
6545
|
...r,
|
|
6503
|
-
...
|
|
6546
|
+
...Si(this, this.tile && i ? {
|
|
6504
6547
|
x: 0,
|
|
6505
6548
|
y: 0,
|
|
6506
6549
|
width: i.sourceWidth,
|
|
@@ -6536,10 +6579,10 @@ var Y = class extends T {
|
|
|
6536
6579
|
this.updateFrameIndex();
|
|
6537
6580
|
}
|
|
6538
6581
|
};
|
|
6539
|
-
|
|
6582
|
+
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), k([_(), O("design:type", Object)], Y.prototype, "pipelines", void 0);
|
|
6540
6583
|
//#endregion
|
|
6541
6584
|
//#region src/scene/2d/element/Element2DBackground.ts
|
|
6542
|
-
var
|
|
6585
|
+
var Ci = class extends Y {
|
|
6543
6586
|
setProperties(e) {
|
|
6544
6587
|
return super._setProperties(d(e) ? void 0 : f(e));
|
|
6545
6588
|
}
|
|
@@ -6551,14 +6594,14 @@ var bi = class extends Y {
|
|
|
6551
6594
|
}
|
|
6552
6595
|
}
|
|
6553
6596
|
};
|
|
6554
|
-
|
|
6597
|
+
k([_(), O("design:type", Object)], Ci.prototype, "fillWithShape", void 0);
|
|
6555
6598
|
//#endregion
|
|
6556
6599
|
//#region src/scene/2d/element/Element2DChart.ts
|
|
6557
|
-
var
|
|
6558
|
-
function
|
|
6559
|
-
return
|
|
6600
|
+
var wi;
|
|
6601
|
+
function Ti() {
|
|
6602
|
+
return wi ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), wi;
|
|
6560
6603
|
}
|
|
6561
|
-
function
|
|
6604
|
+
function Ei(e) {
|
|
6562
6605
|
if (!e) return { show: !1 };
|
|
6563
6606
|
switch (e) {
|
|
6564
6607
|
case "bottom": return {
|
|
@@ -6624,7 +6667,7 @@ var X = class extends T {
|
|
|
6624
6667
|
this._teardown(), this._parent.requestDraw();
|
|
6625
6668
|
return;
|
|
6626
6669
|
}
|
|
6627
|
-
let n = await
|
|
6670
|
+
let n = await Ti();
|
|
6628
6671
|
if (!n) {
|
|
6629
6672
|
console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)"), this._renderPlaceholder(e, t);
|
|
6630
6673
|
return;
|
|
@@ -6649,7 +6692,7 @@ var X = class extends T {
|
|
|
6649
6692
|
}), this._instance.setOption(this._toOption(), !0), !this._texture) {
|
|
6650
6693
|
let e = this._container.querySelector("canvas");
|
|
6651
6694
|
if (!e) return;
|
|
6652
|
-
this._texture = new
|
|
6695
|
+
this._texture = new rr({
|
|
6653
6696
|
source: e,
|
|
6654
6697
|
pixelRatio: 1
|
|
6655
6698
|
});
|
|
@@ -6662,7 +6705,7 @@ var X = class extends T {
|
|
|
6662
6705
|
let n = document.createElement("canvas");
|
|
6663
6706
|
n.width = Math.ceil(e), n.height = Math.ceil(t);
|
|
6664
6707
|
let r = n.getContext("2d");
|
|
6665
|
-
r && (r.fillStyle = "#f3f4f6", r.fillRect(0, 0, e, t), r.strokeStyle = "#d1d5db", r.setLineDash([6, 4]), r.strokeRect(1, 1, e - 2, t - 2), r.fillStyle = "#9ca3af", r.font = "14px sans-serif", r.textAlign = "center", r.textBaseline = "middle", r.fillText("图表需安装 echarts", e / 2, t / 2), this._texture ? this._texture.source = n : this._texture = new
|
|
6708
|
+
r && (r.fillStyle = "#f3f4f6", r.fillRect(0, 0, e, t), r.strokeStyle = "#d1d5db", r.setLineDash([6, 4]), r.strokeRect(1, 1, e - 2, t - 2), r.fillStyle = "#9ca3af", r.font = "14px sans-serif", r.textAlign = "center", r.textBaseline = "middle", r.fillText("图表需安装 echarts", e / 2, t / 2), this._texture ? this._texture.source = n : this._texture = new rr({
|
|
6666
6709
|
source: n,
|
|
6667
6710
|
pixelRatio: 1
|
|
6668
6711
|
}), this._texture.requestUpdate("source"), this._parent.requestDraw());
|
|
@@ -6683,7 +6726,7 @@ var X = class extends T {
|
|
|
6683
6726
|
text: this.title,
|
|
6684
6727
|
left: "center"
|
|
6685
6728
|
} : void 0,
|
|
6686
|
-
legend:
|
|
6729
|
+
legend: Ei(this.legend),
|
|
6687
6730
|
tooltip: {}
|
|
6688
6731
|
};
|
|
6689
6732
|
if (n) {
|
|
@@ -6727,10 +6770,10 @@ var X = class extends T {
|
|
|
6727
6770
|
this._teardown();
|
|
6728
6771
|
}
|
|
6729
6772
|
};
|
|
6730
|
-
|
|
6773
|
+
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);
|
|
6731
6774
|
//#endregion
|
|
6732
6775
|
//#region src/scene/2d/element/Element2DComments.ts
|
|
6733
|
-
var
|
|
6776
|
+
var Di = class extends T {
|
|
6734
6777
|
parent;
|
|
6735
6778
|
constructor(e) {
|
|
6736
6779
|
super(), this.parent = e;
|
|
@@ -6764,7 +6807,7 @@ var wi = class extends T {
|
|
|
6764
6807
|
isValid() {
|
|
6765
6808
|
return Object.values(this._properties).some(Boolean);
|
|
6766
6809
|
}
|
|
6767
|
-
},
|
|
6810
|
+
}, Oi = class extends T {
|
|
6768
6811
|
_parent;
|
|
6769
6812
|
_routeSig;
|
|
6770
6813
|
_routePath;
|
|
@@ -6807,12 +6850,12 @@ var wi = class extends T {
|
|
|
6807
6850
|
let n = t.shape.connectionPoints?.find((t) => t.idx === e.idx);
|
|
6808
6851
|
if (n) {
|
|
6809
6852
|
let e = t.globalTransform.apply(new x(n.x * t.size.x, n.y * t.size.y)), i;
|
|
6810
|
-
return i = n.ang === void 0 ?
|
|
6853
|
+
return i = n.ang === void 0 ? kr(n.x - .5, n.y - .5) : {
|
|
6811
6854
|
x: Math.cos(n.ang),
|
|
6812
6855
|
y: Math.sin(n.ang)
|
|
6813
6856
|
}, {
|
|
6814
6857
|
point: e,
|
|
6815
|
-
dir:
|
|
6858
|
+
dir: ki(i, t.globalRotation),
|
|
6816
6859
|
bbox: r
|
|
6817
6860
|
};
|
|
6818
6861
|
}
|
|
@@ -6835,11 +6878,11 @@ var wi = class extends T {
|
|
|
6835
6878
|
return;
|
|
6836
6879
|
}
|
|
6837
6880
|
let n = (e) => e ? `${e.point.x},${e.point.y},${e.dir?.x ?? ""},${e.dir?.y ?? ""}` : "-", r = `${this.mode}|${n(e)}|${n(t)}`;
|
|
6838
|
-
return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath =
|
|
6881
|
+
return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Ar(this.mode, e ?? t, t ?? e)), this._routePath;
|
|
6839
6882
|
}
|
|
6840
6883
|
};
|
|
6841
|
-
|
|
6842
|
-
function
|
|
6884
|
+
k([_(), O("design:type", Object)], Oi.prototype, "start", void 0), k([_(), O("design:type", Object)], Oi.prototype, "end", void 0), k([_({ fallback: "straight" }), O("design:type", Object)], Oi.prototype, "mode", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Oi.prototype, "labelPosition", void 0);
|
|
6885
|
+
function ki(e, t) {
|
|
6843
6886
|
if (!t) return e;
|
|
6844
6887
|
let n = Math.cos(t), r = Math.sin(t);
|
|
6845
6888
|
return {
|
|
@@ -6848,138 +6891,23 @@ function Ei(e, t) {
|
|
|
6848
6891
|
};
|
|
6849
6892
|
}
|
|
6850
6893
|
//#endregion
|
|
6851
|
-
//#region src/scene/2d/element/bakeImageEffects.ts
|
|
6852
|
-
function Di(e) {
|
|
6853
|
-
return e.getContext("2d");
|
|
6854
|
-
}
|
|
6855
|
-
function Oi(e, t, n, r) {
|
|
6856
|
-
let i = (t?.angle ?? 0) * Math.PI / 180, a = n / 2, o = r / 2, s = (Math.abs(Math.cos(i)) * n + Math.abs(Math.sin(i)) * r) / 2, c = Math.cos(i) * s, l = Math.sin(i) * s, u = e.createLinearGradient(a - c, o - l, a + c, o + l);
|
|
6857
|
-
for (let e of t?.stops ?? []) u.addColorStop(Math.min(1, Math.max(0, e.offset)), e.color);
|
|
6858
|
-
return u;
|
|
6859
|
-
}
|
|
6860
|
-
function ki(e, t, n, r, i) {
|
|
6861
|
-
let a = w(t, n), o = Di(a);
|
|
6862
|
-
return o.drawImage(e, 0, 0, t, n), o.globalCompositeOperation = "source-in", r.linearGradient ? (o.fillStyle = Oi(o, r.linearGradient, t, n), o.fillRect(0, 0, t, n)) : r.image && i[r.image] ? o.drawImage(i[r.image], 0, 0, t, n) : r.color && (o.fillStyle = r.color, o.fillRect(0, 0, t, n)), a;
|
|
6863
|
-
}
|
|
6864
|
-
function Ai(e, t, n, r, i) {
|
|
6865
|
-
let a = w(t, n), o = Di(a), s = Math.max(8, Math.ceil(r) * 2);
|
|
6866
|
-
for (let i = 0; i < s; i++) {
|
|
6867
|
-
let a = i / s * Math.PI * 2;
|
|
6868
|
-
o.drawImage(e, Math.cos(a) * r, Math.sin(a) * r, t, n);
|
|
6869
|
-
}
|
|
6870
|
-
o.globalCompositeOperation = "source-in", o.fillStyle = i, o.fillRect(0, 0, t, n);
|
|
6871
|
-
let c = w(t, n), l = Di(c);
|
|
6872
|
-
return l.drawImage(a, 0, 0), l.drawImage(e, 0, 0, t, n), c;
|
|
6873
|
-
}
|
|
6874
|
-
function ji(e) {
|
|
6875
|
-
let t = 0, n = 0;
|
|
6876
|
-
if (!e) return {
|
|
6877
|
-
x: t,
|
|
6878
|
-
y: n
|
|
6879
|
-
};
|
|
6880
|
-
let r = e.match(/translate\(\s*(-?[\d.]+)[\s,]+(-?[\d.]+)/);
|
|
6881
|
-
r && (t = Number.parseFloat(r[1]), n = Number.parseFloat(r[2]));
|
|
6882
|
-
let i = e.match(/translateX\(\s*(-?[\d.]+)/);
|
|
6883
|
-
i && (t = Number.parseFloat(i[1]));
|
|
6884
|
-
let a = e.match(/translateY\(\s*(-?[\d.]+)/);
|
|
6885
|
-
return a && (n = Number.parseFloat(a[1])), {
|
|
6886
|
-
x: t,
|
|
6887
|
-
y: n
|
|
6888
|
-
};
|
|
6889
|
-
}
|
|
6890
|
-
function Mi(e, t, n, r, i = {}) {
|
|
6891
|
-
let a = Math.max(1, Math.round(n)), o = Math.max(1, Math.round(r)), s = 0;
|
|
6892
|
-
for (let e of t) {
|
|
6893
|
-
e.outline?.width && e.outline.color && (s = Math.max(s, e.outline.width));
|
|
6894
|
-
let t = ji(e.transform);
|
|
6895
|
-
s = Math.max(s, Math.abs(t.x), Math.abs(t.y));
|
|
6896
|
-
}
|
|
6897
|
-
s = Math.min(Math.ceil(s), Math.floor(Math.min(a, o) * .2));
|
|
6898
|
-
let c = e;
|
|
6899
|
-
if (s > 0) {
|
|
6900
|
-
let t = w(a, o);
|
|
6901
|
-
Di(t).drawImage(e, s, s, Math.max(1, a - s * 2), Math.max(1, o - s * 2)), c = t;
|
|
6902
|
-
}
|
|
6903
|
-
let l = w(a, o), u = Di(l);
|
|
6904
|
-
for (let e of t) {
|
|
6905
|
-
let t = c;
|
|
6906
|
-
e.fill && (e.fill.color || e.fill.linearGradient || e.fill.image) && (t = ki(t, a, o, e.fill, i)), e.outline?.width && e.outline.color && (t = Ai(t, a, o, e.outline.width, e.outline.color));
|
|
6907
|
-
let { x: n, y: r } = ji(e.transform);
|
|
6908
|
-
u.save(), u.globalCompositeOperation = "destination-over", e.shadow && (u.shadowColor = e.shadow.color, u.shadowBlur = e.shadow.blur ?? 0, u.shadowOffsetX = e.shadow.offsetX ?? 0, u.shadowOffsetY = e.shadow.offsetY ?? 0), u.drawImage(t, n, r, a, o), u.restore();
|
|
6909
|
-
}
|
|
6910
|
-
return l;
|
|
6911
|
-
}
|
|
6912
|
-
//#endregion
|
|
6913
6894
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
6914
|
-
var
|
|
6915
|
-
_sourceCanvas;
|
|
6916
|
-
_sourceImage;
|
|
6895
|
+
var Ai = class extends Y {
|
|
6917
6896
|
setProperties(e) {
|
|
6918
6897
|
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
6919
6898
|
}
|
|
6920
6899
|
_updateProperty(e, t, n) {
|
|
6921
|
-
|
|
6922
|
-
case "fillWithShape":
|
|
6923
|
-
this._parent.requestDraw();
|
|
6924
|
-
break;
|
|
6925
|
-
case "effects":
|
|
6926
|
-
this._updateTexture();
|
|
6927
|
-
break;
|
|
6928
|
-
}
|
|
6929
|
-
}
|
|
6930
|
-
async loadTexture() {
|
|
6931
|
-
await super.loadTexture(), await this._applyEffects();
|
|
6932
|
-
}
|
|
6933
|
-
async _applyEffects() {
|
|
6934
|
-
if (!this.effects?.length || this.animatedTexture || !this.texture) {
|
|
6935
|
-
this._sourceCanvas = void 0, this._sourceImage = void 0;
|
|
6936
|
-
return;
|
|
6937
|
-
}
|
|
6938
|
-
let e = await this._resolveSourceCanvas();
|
|
6939
|
-
if (!e) return;
|
|
6940
|
-
let t = e.width, n = e.height, r = await this._resolvePatterns(), i = Mi(e, this.effects, t, n, r);
|
|
6941
|
-
this.texture = new B({
|
|
6942
|
-
source: i,
|
|
6943
|
-
width: t,
|
|
6944
|
-
height: n,
|
|
6945
|
-
uploadMethodId: "image"
|
|
6946
|
-
});
|
|
6947
|
-
}
|
|
6948
|
-
async _resolvePatterns() {
|
|
6949
|
-
let e = {};
|
|
6950
|
-
for (let t of this.effects ?? []) {
|
|
6951
|
-
let n = t.fill?.image;
|
|
6952
|
-
if (!n || d(n) || e[n]) continue;
|
|
6953
|
-
let r = await $.loadBy(`${n}#mc-foreground-pattern`, async () => {
|
|
6954
|
-
let e = await $.fetchImageBitmap(n), t = this._snapshot(e);
|
|
6955
|
-
return Pe && e instanceof ImageBitmap && e.close(), t;
|
|
6956
|
-
});
|
|
6957
|
-
r && (e[n] = r);
|
|
6958
|
-
}
|
|
6959
|
-
return e;
|
|
6960
|
-
}
|
|
6961
|
-
async _resolveSourceCanvas() {
|
|
6962
|
-
if (this._sourceImage !== this.image && (this._sourceCanvas = void 0, this._sourceImage = this.image), this._sourceCanvas) return this._sourceCanvas;
|
|
6963
|
-
if (d(this.image) || this.image === "viewport") return;
|
|
6964
|
-
let e = this.image, t = await $.loadBy(`${e}#mc-foreground-source`, async () => {
|
|
6965
|
-
let t = await $.fetchImageBitmap(e), n = this._snapshot(t);
|
|
6966
|
-
return Pe && t instanceof ImageBitmap && t.close(), n;
|
|
6967
|
-
});
|
|
6968
|
-
return this._sourceImage === e && t && (this._sourceCanvas = t), t;
|
|
6969
|
-
}
|
|
6970
|
-
_snapshot(e) {
|
|
6971
|
-
let t = Math.max(1, Math.round(e.width)), n = Math.max(1, Math.round(e.height)), r = w(t, n), i = r?.getContext("2d");
|
|
6972
|
-
if (!(!r || !i)) return i.drawImage(e, 0, 0, t, n), r;
|
|
6900
|
+
super._updateProperty(e, t, n), e === "fillWithShape" && this._parent.requestDraw();
|
|
6973
6901
|
}
|
|
6974
6902
|
};
|
|
6975
|
-
|
|
6903
|
+
k([_(), O("design:type", Object)], Ai.prototype, "fillWithShape", void 0);
|
|
6976
6904
|
//#endregion
|
|
6977
6905
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
6978
|
-
var
|
|
6906
|
+
var ji = {
|
|
6979
6907
|
sm: 4,
|
|
6980
6908
|
md: 6,
|
|
6981
6909
|
lg: 8
|
|
6982
|
-
},
|
|
6910
|
+
}, Mi = class extends Y {
|
|
6983
6911
|
setProperties(e) {
|
|
6984
6912
|
return super._setProperties(d(e) ? void 0 : te(e));
|
|
6985
6913
|
}
|
|
@@ -7001,7 +6929,7 @@ var Pi = {
|
|
|
7001
6929
|
}
|
|
7002
6930
|
draw() {
|
|
7003
6931
|
let { width: e, height: t } = this._parent.size, n = this._parent.context;
|
|
7004
|
-
this.image === "viewport" ? n.strokeStyle = new
|
|
6932
|
+
this.image === "viewport" ? n.strokeStyle = new lr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...Si(this, {
|
|
7005
6933
|
x: 0,
|
|
7006
6934
|
y: 0,
|
|
7007
6935
|
width: e,
|
|
@@ -7024,14 +6952,14 @@ var Pi = {
|
|
|
7024
6952
|
_fillEnd(e, t, n, r, i) {
|
|
7025
6953
|
let a = e.x - t.x, o = e.y - t.y, s = Math.hypot(a, o);
|
|
7026
6954
|
if (s < .001) return;
|
|
7027
|
-
let c =
|
|
6955
|
+
let c = ji[String(n.width ?? n.height ?? "md")] ?? 6, l = r * c, u = r * c * .5, d = a / s, f = o / s, p = e.x - d * l, m = e.y - f * l, h = -f * u, g = d * u, ee = this._parent.context;
|
|
7028
6956
|
ee.fillStyle = i, ee.moveTo(e.x, e.y).lineTo(p + h, m + g).lineTo(p - h, m - g).closePath().fill();
|
|
7029
6957
|
}
|
|
7030
6958
|
};
|
|
7031
|
-
|
|
6959
|
+
k([_(), O("design:type", Object)], Mi.prototype, "color", void 0), k([_(), O("design:type", Object)], Mi.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], Mi.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], Mi.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], Mi.prototype, "lineJoin", void 0), k([_(), O("design:type", Object)], Mi.prototype, "headEnd", void 0), k([_(), O("design:type", Object)], Mi.prototype, "tailEnd", void 0);
|
|
7032
6960
|
//#endregion
|
|
7033
6961
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
7034
|
-
var
|
|
6962
|
+
var Ni = class extends T {
|
|
7035
6963
|
_parent;
|
|
7036
6964
|
constructor(e) {
|
|
7037
6965
|
super(), this._parent = e;
|
|
@@ -7052,13 +6980,13 @@ var Ii = class extends T {
|
|
|
7052
6980
|
}
|
|
7053
6981
|
updateEffect() {
|
|
7054
6982
|
let e = "__$shadow", t = this._parent.getNode(e);
|
|
7055
|
-
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new
|
|
6983
|
+
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new ni({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
7056
6984
|
}
|
|
7057
6985
|
};
|
|
7058
|
-
|
|
6986
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Ni.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], Ni.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Ni.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Ni.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Ni.prototype, "offsetX", void 0);
|
|
7059
6987
|
//#endregion
|
|
7060
6988
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
7061
|
-
var
|
|
6989
|
+
var Pi = class extends T {
|
|
7062
6990
|
_parent;
|
|
7063
6991
|
_path2DSet = new ue();
|
|
7064
6992
|
_localPath;
|
|
@@ -7156,24 +7084,24 @@ var Li = class extends T {
|
|
|
7156
7084
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
7157
7085
|
}
|
|
7158
7086
|
};
|
|
7159
|
-
|
|
7087
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Pi.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Pi.prototype, "preset", void 0), k([_(), O("design:type", Object)], Pi.prototype, "svg", void 0), k([_(), O("design:type", Object)], Pi.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], Pi.prototype, "paths", void 0), k([_(), O("design:type", Object)], Pi.prototype, "connectionPoints", void 0);
|
|
7160
7088
|
//#endregion
|
|
7161
7089
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
7162
|
-
var
|
|
7090
|
+
var Fi = class extends yt {
|
|
7163
7091
|
constructor(e) {
|
|
7164
7092
|
super(), this.setProperties(e);
|
|
7165
7093
|
}
|
|
7166
|
-
},
|
|
7094
|
+
}, Ii = {
|
|
7167
7095
|
...o(),
|
|
7168
7096
|
left: 0,
|
|
7169
7097
|
top: 0,
|
|
7170
7098
|
width: 0,
|
|
7171
7099
|
height: 0
|
|
7172
7100
|
};
|
|
7173
|
-
for (let e in
|
|
7101
|
+
for (let e in Ii) i(Fi, e, { fallback: Ii[e] });
|
|
7174
7102
|
//#endregion
|
|
7175
7103
|
//#region src/scene/2d/element/Element2DTable.ts
|
|
7176
|
-
var
|
|
7104
|
+
var Li = 100, Ri = 40, zi = class extends T {
|
|
7177
7105
|
_parent;
|
|
7178
7106
|
_cellNodes = /* @__PURE__ */ new Map();
|
|
7179
7107
|
_cellSnapshots = /* @__PURE__ */ new Map();
|
|
@@ -7204,10 +7132,10 @@ var Bi = 100, Vi = 40, Hi = class extends T {
|
|
|
7204
7132
|
return !!(this.enabled && this.cells.length);
|
|
7205
7133
|
}
|
|
7206
7134
|
get gridWidth() {
|
|
7207
|
-
return this.columns.reduce((e, t) => e + (t.width ||
|
|
7135
|
+
return this.columns.reduce((e, t) => e + (t.width || Li), 0);
|
|
7208
7136
|
}
|
|
7209
7137
|
get gridHeight() {
|
|
7210
|
-
return this.rows.reduce((e, t) => e + (t.height ||
|
|
7138
|
+
return this.rows.reduce((e, t) => e + (t.height || Ri), 0);
|
|
7211
7139
|
}
|
|
7212
7140
|
update() {
|
|
7213
7141
|
if (this._dirty = !1, !this.isValid()) {
|
|
@@ -7217,9 +7145,9 @@ var Bi = 100, Vi = 40, Hi = class extends T {
|
|
|
7217
7145
|
let { columns: e, rows: t, cells: n } = this, r = e.length, i = t.length;
|
|
7218
7146
|
for (let e of n) r = Math.max(r, e.col + (e.colSpan || 1)), i = Math.max(i, e.row + (e.rowSpan || 1));
|
|
7219
7147
|
let a = [0];
|
|
7220
|
-
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width ||
|
|
7148
|
+
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || Li));
|
|
7221
7149
|
let o = [0];
|
|
7222
|
-
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height ||
|
|
7150
|
+
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || Ri));
|
|
7223
7151
|
this._parent.size.set(a[e.length] ?? 0, o[t.length] ?? 0);
|
|
7224
7152
|
let s = /* @__PURE__ */ new Set();
|
|
7225
7153
|
for (let e of n) {
|
|
@@ -7233,7 +7161,7 @@ var Bi = 100, Vi = 40, Hi = class extends T {
|
|
|
7233
7161
|
}, r = `${JSON.stringify(e)}|${n.left},${n.top},${n.width},${n.height}`;
|
|
7234
7162
|
if (this._cellNodes.has(t) && this._cellSnapshots.get(t) === r) continue;
|
|
7235
7163
|
let i = this._cellNodes.get(t);
|
|
7236
|
-
i || (i =
|
|
7164
|
+
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);
|
|
7237
7165
|
}
|
|
7238
7166
|
for (let [e, t] of this._cellNodes) s.has(e) || (this._parent.removeChild(t), t.destroy(), this._cellNodes.delete(e), this._cellSnapshots.delete(e));
|
|
7239
7167
|
this._parent.requestDraw();
|
|
@@ -7245,7 +7173,7 @@ var Bi = 100, Vi = 40, Hi = class extends T {
|
|
|
7245
7173
|
}, e.background = t.background;
|
|
7246
7174
|
for (let t of [...e.getChildren(!0)]) e.removeChild(t), t.destroy();
|
|
7247
7175
|
t.children?.forEach((t) => {
|
|
7248
|
-
e.appendChild(
|
|
7176
|
+
e.appendChild(B.parse(t, "Element2D"));
|
|
7249
7177
|
});
|
|
7250
7178
|
}
|
|
7251
7179
|
_clearCells() {
|
|
@@ -7256,7 +7184,7 @@ var Bi = 100, Vi = 40, Hi = class extends T {
|
|
|
7256
7184
|
this._clearCells();
|
|
7257
7185
|
}
|
|
7258
7186
|
};
|
|
7259
|
-
|
|
7187
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], zi.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], zi.prototype, "columns", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], zi.prototype, "rows", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], zi.prototype, "cells", void 0);
|
|
7260
7188
|
//#endregion
|
|
7261
7189
|
//#region src/scene/2d/element/Element2DText.ts
|
|
7262
7190
|
var Z = class extends T {
|
|
@@ -7270,7 +7198,7 @@ var Z = class extends T {
|
|
|
7270
7198
|
}
|
|
7271
7199
|
_textContent = "";
|
|
7272
7200
|
_autoDrawMode;
|
|
7273
|
-
_texture = new
|
|
7201
|
+
_texture = new rr({ mipmap: !0 });
|
|
7274
7202
|
_textureMap = /* @__PURE__ */ new Map();
|
|
7275
7203
|
constructor(e) {
|
|
7276
7204
|
super(), this._parent = e, this.base = new _e(), this.base.setPropertyAccessor(this);
|
|
@@ -7342,7 +7270,7 @@ var Z = class extends T {
|
|
|
7342
7270
|
}), this._parent.requestDraw());
|
|
7343
7271
|
}
|
|
7344
7272
|
async _loadTexture(e, t) {
|
|
7345
|
-
return e.linearGradient || e.radialGradient ? new
|
|
7273
|
+
return e.linearGradient || e.radialGradient ? new ar(e.linearGradient ?? e.radialGradient, t.width, t.height) : d(e.image) ? void 0 : (this._parent.tree?.log(`load image ${e.image}`), await $.texture.load(e.image));
|
|
7346
7274
|
}
|
|
7347
7275
|
setContent(e) {
|
|
7348
7276
|
this.content = oe(e);
|
|
@@ -7371,7 +7299,7 @@ var Z = class extends T {
|
|
|
7371
7299
|
if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
|
|
7372
7300
|
let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
7373
7301
|
r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? r.color, e.fill({
|
|
7374
|
-
...
|
|
7302
|
+
...Si(r, o?.box ?? {
|
|
7375
7303
|
x: 0,
|
|
7376
7304
|
y: 0,
|
|
7377
7305
|
width: this._parent.size.width,
|
|
@@ -7383,7 +7311,7 @@ var Z = class extends T {
|
|
|
7383
7311
|
if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
|
|
7384
7312
|
let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
|
|
7385
7313
|
r.enabled !== !1 && (o || r.color) && (r.width === void 0 || r.width) && (e.addPath(n), e.style = { ...n.style }, e.lineWidth = r.width || 1, e.strokeStyle = o?.texture ?? r.color, e.lineCap = r.lineCap, e.lineJoin = r.lineJoin, e.stroke({
|
|
7386
|
-
...
|
|
7314
|
+
...Si(r, o?.box ?? {
|
|
7387
7315
|
x: 0,
|
|
7388
7316
|
y: 0,
|
|
7389
7317
|
width: this._parent.size.width,
|
|
@@ -7413,7 +7341,7 @@ var Z = class extends T {
|
|
|
7413
7341
|
}
|
|
7414
7342
|
process(e) {}
|
|
7415
7343
|
};
|
|
7416
|
-
|
|
7344
|
+
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);
|
|
7417
7345
|
//#endregion
|
|
7418
7346
|
//#region src/scene/2d/element/Flexbox.ts
|
|
7419
7347
|
var Q = {
|
|
@@ -7426,11 +7354,11 @@ var Q = {
|
|
|
7426
7354
|
horizontal: 6,
|
|
7427
7355
|
vertical: 7,
|
|
7428
7356
|
all: 8
|
|
7429
|
-
},
|
|
7357
|
+
}, Bi = {
|
|
7430
7358
|
column: 0,
|
|
7431
7359
|
row: 1,
|
|
7432
7360
|
all: 2
|
|
7433
|
-
},
|
|
7361
|
+
}, Vi = {
|
|
7434
7362
|
auto: 0,
|
|
7435
7363
|
"flex-start": 1,
|
|
7436
7364
|
center: 2,
|
|
@@ -7440,42 +7368,42 @@ var Q = {
|
|
|
7440
7368
|
"space-between": 6,
|
|
7441
7369
|
"space-around": 7,
|
|
7442
7370
|
"space-evenly": 8
|
|
7443
|
-
},
|
|
7371
|
+
}, Hi = {
|
|
7444
7372
|
flex: 0,
|
|
7445
7373
|
none: 1,
|
|
7446
7374
|
contents: 2
|
|
7447
|
-
},
|
|
7375
|
+
}, Ui = {
|
|
7448
7376
|
inherit: 0,
|
|
7449
7377
|
ltr: 1,
|
|
7450
7378
|
rtl: 2
|
|
7451
|
-
},
|
|
7379
|
+
}, Wi = {
|
|
7452
7380
|
column: 0,
|
|
7453
7381
|
"column-reverse": 1,
|
|
7454
7382
|
row: 2,
|
|
7455
7383
|
"row-reverse": 3
|
|
7456
|
-
},
|
|
7384
|
+
}, Gi = {
|
|
7457
7385
|
"no-wrap": 0,
|
|
7458
7386
|
wrap: 1,
|
|
7459
7387
|
"Wrap-reverse": 2
|
|
7460
|
-
},
|
|
7388
|
+
}, Ki = {
|
|
7461
7389
|
"flex-start": 0,
|
|
7462
7390
|
center: 1,
|
|
7463
7391
|
"flex-end": 2,
|
|
7464
7392
|
"space-between": 3,
|
|
7465
7393
|
"space-around": 4,
|
|
7466
7394
|
"space-evenly": 5
|
|
7467
|
-
},
|
|
7395
|
+
}, qi = {
|
|
7468
7396
|
visible: 0,
|
|
7469
7397
|
hidden: 1,
|
|
7470
7398
|
scroll: 2
|
|
7471
|
-
},
|
|
7399
|
+
}, Ji = {
|
|
7472
7400
|
static: 0,
|
|
7473
7401
|
relative: 1,
|
|
7474
7402
|
absolute: 2
|
|
7475
|
-
},
|
|
7403
|
+
}, Yi = {
|
|
7476
7404
|
"border-box": 0,
|
|
7477
7405
|
"content-box": 1
|
|
7478
|
-
},
|
|
7406
|
+
}, Xi = class e {
|
|
7479
7407
|
_parent;
|
|
7480
7408
|
static _yoga;
|
|
7481
7409
|
static async load() {
|
|
@@ -7487,27 +7415,27 @@ var Q = {
|
|
|
7487
7415
|
this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
|
|
7488
7416
|
}
|
|
7489
7417
|
_addChild(e, t) {
|
|
7490
|
-
if (e instanceof
|
|
7418
|
+
if (e instanceof ta && e.flexbox.node && this.node) {
|
|
7491
7419
|
this.node.insertChild(e.flexbox.node, t);
|
|
7492
7420
|
let n = e.style.getProperties();
|
|
7493
7421
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
7494
7422
|
}
|
|
7495
7423
|
}
|
|
7496
7424
|
_removeChild(e, t) {
|
|
7497
|
-
e instanceof
|
|
7425
|
+
e instanceof ta && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
7498
7426
|
}
|
|
7499
7427
|
updateStyleProperty(e, t) {
|
|
7500
7428
|
let n = this.node;
|
|
7501
7429
|
if (n) {
|
|
7502
7430
|
switch (e) {
|
|
7503
7431
|
case "alignContent":
|
|
7504
|
-
n.setAlignContent(t ?
|
|
7432
|
+
n.setAlignContent(t ? Vi[t] ?? Vi["flex-start"] : Vi["flex-start"]);
|
|
7505
7433
|
break;
|
|
7506
7434
|
case "alignItems":
|
|
7507
|
-
n.setAlignItems(t ?
|
|
7435
|
+
n.setAlignItems(t ? Vi[t] ?? Vi["flex-start"] : Vi["flex-start"]);
|
|
7508
7436
|
break;
|
|
7509
7437
|
case "alignSelf":
|
|
7510
|
-
n.setAlignSelf(t ?
|
|
7438
|
+
n.setAlignSelf(t ? Vi[t] ?? Vi["flex-start"] : Vi["flex-start"]);
|
|
7511
7439
|
break;
|
|
7512
7440
|
case "aspectRatio":
|
|
7513
7441
|
n.setAspectRatio(t);
|
|
@@ -7528,10 +7456,10 @@ var Q = {
|
|
|
7528
7456
|
n.setBorder(Q.all, this._parent.style.borderWidth);
|
|
7529
7457
|
break;
|
|
7530
7458
|
case "direction":
|
|
7531
|
-
n.setDirection(t ?
|
|
7459
|
+
n.setDirection(t ? Ui[t] ?? Ui.inherit : Ui.inherit);
|
|
7532
7460
|
break;
|
|
7533
7461
|
case "display":
|
|
7534
|
-
n.setDisplay(t ?
|
|
7462
|
+
n.setDisplay(t ? Hi[t] ?? Hi.flex : Hi.flex);
|
|
7535
7463
|
break;
|
|
7536
7464
|
case "flex":
|
|
7537
7465
|
n.setFlex(t);
|
|
@@ -7540,7 +7468,7 @@ var Q = {
|
|
|
7540
7468
|
n.setFlexBasis(t);
|
|
7541
7469
|
break;
|
|
7542
7470
|
case "flexDirection":
|
|
7543
|
-
n.setFlexDirection(t ?
|
|
7471
|
+
n.setFlexDirection(t ? Wi[t] ?? Wi.row : Wi.row);
|
|
7544
7472
|
break;
|
|
7545
7473
|
case "flexGrow":
|
|
7546
7474
|
n.setFlexGrow(t);
|
|
@@ -7549,16 +7477,16 @@ var Q = {
|
|
|
7549
7477
|
n.setFlexShrink(t);
|
|
7550
7478
|
break;
|
|
7551
7479
|
case "flexWrap":
|
|
7552
|
-
n.setFlexWrap(t ?
|
|
7480
|
+
n.setFlexWrap(t ? Gi[t] ?? Gi.wrap : Gi.wrap);
|
|
7553
7481
|
break;
|
|
7554
7482
|
case "height":
|
|
7555
7483
|
n.setHeight(t);
|
|
7556
7484
|
break;
|
|
7557
7485
|
case "justifyContent":
|
|
7558
|
-
n.setJustifyContent(t ?
|
|
7486
|
+
n.setJustifyContent(t ? Ki[t] ?? Ki["flex-start"] : Ki["flex-start"]);
|
|
7559
7487
|
break;
|
|
7560
7488
|
case "gap":
|
|
7561
|
-
t !== void 0 && n.setGap(
|
|
7489
|
+
t !== void 0 && n.setGap(Bi.all, t);
|
|
7562
7490
|
break;
|
|
7563
7491
|
case "marginTop":
|
|
7564
7492
|
n.setMargin(Q.top, t);
|
|
@@ -7588,7 +7516,7 @@ var Q = {
|
|
|
7588
7516
|
n.setMinWidth(t);
|
|
7589
7517
|
break;
|
|
7590
7518
|
case "overflow":
|
|
7591
|
-
n.setOverflow(t ?
|
|
7519
|
+
n.setOverflow(t ? qi[t] ?? qi.visible : qi.visible);
|
|
7592
7520
|
break;
|
|
7593
7521
|
case "paddingTop":
|
|
7594
7522
|
n.setPadding(Q.top, t);
|
|
@@ -7618,10 +7546,10 @@ var Q = {
|
|
|
7618
7546
|
n.setPosition(Q.right, t);
|
|
7619
7547
|
break;
|
|
7620
7548
|
case "position":
|
|
7621
|
-
n.setPositionType(t ?
|
|
7549
|
+
n.setPositionType(t ? Ji[t] ?? Ji.relative : Ji.relative);
|
|
7622
7550
|
break;
|
|
7623
7551
|
case "boxSizing":
|
|
7624
|
-
n.setBoxSizing(t ?
|
|
7552
|
+
n.setBoxSizing(t ? Yi[t] ?? Yi["content-box"] : Yi["content-box"]);
|
|
7625
7553
|
break;
|
|
7626
7554
|
case "width":
|
|
7627
7555
|
n.setWidth(t);
|
|
@@ -7632,7 +7560,7 @@ var Q = {
|
|
|
7632
7560
|
}
|
|
7633
7561
|
update() {
|
|
7634
7562
|
let e = this._parent, t = this.node;
|
|
7635
|
-
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0,
|
|
7563
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Ui.ltr), t.hasNewLayout())) {
|
|
7636
7564
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
|
|
7637
7565
|
(!Number.isNaN(n) && n !== e.position.x || !Number.isNaN(r) && r !== e.position.y) && e.position.set(n, r), (!Number.isNaN(i) && i !== e.size.x || !Number.isNaN(a) && a !== e.size.y) && e.size.set(i, a), t.markLayoutSeen();
|
|
7638
7566
|
}
|
|
@@ -7640,13 +7568,13 @@ var Q = {
|
|
|
7640
7568
|
destroy() {
|
|
7641
7569
|
this.node?.free(), this.node = void 0;
|
|
7642
7570
|
}
|
|
7643
|
-
},
|
|
7571
|
+
}, Zi = new Set(Object.keys(a())), Qi = new Set(Object.keys(s())), $i = new x(), ea = [
|
|
7644
7572
|
[0, 0],
|
|
7645
7573
|
[1, 0],
|
|
7646
7574
|
[1, 1],
|
|
7647
7575
|
[0, 1]
|
|
7648
|
-
],
|
|
7649
|
-
flexbox = new
|
|
7576
|
+
], ta = class extends Dr {
|
|
7577
|
+
flexbox = new Xi(this);
|
|
7650
7578
|
aabb = new bt();
|
|
7651
7579
|
globalAabb = new bt();
|
|
7652
7580
|
_parentGlobalDisplay;
|
|
@@ -7659,7 +7587,7 @@ var Q = {
|
|
|
7659
7587
|
});
|
|
7660
7588
|
_allowPointerEvents = !0;
|
|
7661
7589
|
_overflowHidden = !1;
|
|
7662
|
-
_style = new
|
|
7590
|
+
_style = new Fi().on("updateProperty", (...e) => {
|
|
7663
7591
|
this.onUpdateStyleProperty(e[0], e[1], e[2]);
|
|
7664
7592
|
});
|
|
7665
7593
|
get style() {
|
|
@@ -7673,14 +7601,14 @@ var Q = {
|
|
|
7673
7601
|
this._endBatch();
|
|
7674
7602
|
}
|
|
7675
7603
|
}
|
|
7676
|
-
_background = new
|
|
7604
|
+
_background = new Ci(this);
|
|
7677
7605
|
get background() {
|
|
7678
7606
|
return this._background;
|
|
7679
7607
|
}
|
|
7680
7608
|
set background(e) {
|
|
7681
7609
|
this._background.resetProperties().setProperties(e);
|
|
7682
7610
|
}
|
|
7683
|
-
_shape = new
|
|
7611
|
+
_shape = new Pi(this);
|
|
7684
7612
|
get shape() {
|
|
7685
7613
|
return this._shape;
|
|
7686
7614
|
}
|
|
@@ -7694,14 +7622,14 @@ var Q = {
|
|
|
7694
7622
|
set fill(e) {
|
|
7695
7623
|
this._fill.resetProperties().setProperties(e);
|
|
7696
7624
|
}
|
|
7697
|
-
_outline = new
|
|
7625
|
+
_outline = new Mi(this);
|
|
7698
7626
|
get outline() {
|
|
7699
7627
|
return this._outline;
|
|
7700
7628
|
}
|
|
7701
7629
|
set outline(e) {
|
|
7702
7630
|
this._outline.resetProperties().setProperties(e);
|
|
7703
7631
|
}
|
|
7704
|
-
_foreground = new
|
|
7632
|
+
_foreground = new Ai(this);
|
|
7705
7633
|
get foreground() {
|
|
7706
7634
|
return this._foreground;
|
|
7707
7635
|
}
|
|
@@ -7715,21 +7643,21 @@ var Q = {
|
|
|
7715
7643
|
set text(e) {
|
|
7716
7644
|
this._text.resetProperties().setProperties(e);
|
|
7717
7645
|
}
|
|
7718
|
-
_shadow = new
|
|
7646
|
+
_shadow = new Ni(this);
|
|
7719
7647
|
get shadow() {
|
|
7720
7648
|
return this._shadow;
|
|
7721
7649
|
}
|
|
7722
7650
|
set shadow(e) {
|
|
7723
7651
|
this._shadow.resetProperties().setProperties(e);
|
|
7724
7652
|
}
|
|
7725
|
-
_connection = new
|
|
7653
|
+
_connection = new Oi(this);
|
|
7726
7654
|
get connection() {
|
|
7727
7655
|
return this._connection;
|
|
7728
7656
|
}
|
|
7729
7657
|
set connection(e) {
|
|
7730
7658
|
this._connection.resetProperties().setProperties(e);
|
|
7731
7659
|
}
|
|
7732
|
-
_table = new
|
|
7660
|
+
_table = new zi(this);
|
|
7733
7661
|
get table() {
|
|
7734
7662
|
return this._table;
|
|
7735
7663
|
}
|
|
@@ -7743,7 +7671,7 @@ var Q = {
|
|
|
7743
7671
|
set chart(e) {
|
|
7744
7672
|
this._chart.resetProperties().setProperties(e);
|
|
7745
7673
|
}
|
|
7746
|
-
_comments = new
|
|
7674
|
+
_comments = new Di(this);
|
|
7747
7675
|
get comments() {
|
|
7748
7676
|
return this._comments;
|
|
7749
7677
|
}
|
|
@@ -7828,7 +7756,7 @@ var Q = {
|
|
|
7828
7756
|
this._updateGlobalDisplay();
|
|
7829
7757
|
break;
|
|
7830
7758
|
case "rotate":
|
|
7831
|
-
this.rotation = (t || 0) *
|
|
7759
|
+
this.rotation = (t || 0) * St, this.updateGlobalTransform();
|
|
7832
7760
|
break;
|
|
7833
7761
|
case "scaleX":
|
|
7834
7762
|
this.scale.x = t, this.text.isValid() && (t ^ n) < 0 && this.requestDraw();
|
|
@@ -7849,7 +7777,7 @@ var Q = {
|
|
|
7849
7777
|
}), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
|
|
7850
7778
|
break;
|
|
7851
7779
|
case "transformOrigin": {
|
|
7852
|
-
let e =
|
|
7780
|
+
let e = Rr(t ?? "");
|
|
7853
7781
|
this.pivot.set(e[0] * this.size.width, e[1] * this.size.height);
|
|
7854
7782
|
break;
|
|
7855
7783
|
}
|
|
@@ -7893,7 +7821,7 @@ var Q = {
|
|
|
7893
7821
|
this.requestDraw();
|
|
7894
7822
|
break;
|
|
7895
7823
|
}
|
|
7896
|
-
if ((
|
|
7824
|
+
if ((Qi.has(e) || Zi.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
|
|
7897
7825
|
else switch (e) {
|
|
7898
7826
|
case "left":
|
|
7899
7827
|
this.position.x = Number(t);
|
|
@@ -7937,10 +7865,10 @@ var Q = {
|
|
|
7937
7865
|
}
|
|
7938
7866
|
_intersectsViewport(e) {
|
|
7939
7867
|
let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
7940
|
-
for (let [e, c] of
|
|
7868
|
+
for (let [e, c] of ea) t.applyAffineInverse({
|
|
7941
7869
|
x: e * n,
|
|
7942
7870
|
y: c * r
|
|
7943
|
-
},
|
|
7871
|
+
}, $i), i = Math.min(i, $i.x), a = Math.max(a, $i.x), o = Math.min(o, $i.y), s = Math.max(s, $i.y);
|
|
7944
7872
|
let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
|
|
7945
7873
|
return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
|
|
7946
7874
|
}
|
|
@@ -7955,13 +7883,13 @@ var Q = {
|
|
|
7955
7883
|
}
|
|
7956
7884
|
_applyColorFilter() {
|
|
7957
7885
|
let e = [this._styleFilter, this._elementFilter].filter(Boolean).join(" ").trim();
|
|
7958
|
-
e ? (this._colorFilterEffect || (this._colorFilterEffect = new
|
|
7886
|
+
e ? (this._colorFilterEffect || (this._colorFilterEffect = new Vr({
|
|
7959
7887
|
name: "styleFilter",
|
|
7960
7888
|
internalMode: "front"
|
|
7961
7889
|
}), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e) : (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender());
|
|
7962
7890
|
}
|
|
7963
7891
|
_updateStyleMaskImage(e) {
|
|
7964
|
-
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new
|
|
7892
|
+
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new fi({
|
|
7965
7893
|
name: "styleMaskImage",
|
|
7966
7894
|
internalMode: "back"
|
|
7967
7895
|
}), this.append(this._maskEffect)), this._maskEffect.image = e);
|
|
@@ -7992,11 +7920,11 @@ var Q = {
|
|
|
7992
7920
|
}
|
|
7993
7921
|
getObb() {
|
|
7994
7922
|
let e = this.pivot, t = this.transform.apply(e).sub(e);
|
|
7995
|
-
return new
|
|
7923
|
+
return new Tt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
|
|
7996
7924
|
}
|
|
7997
7925
|
getGlobalObb() {
|
|
7998
7926
|
let e = this.pivot, t = this.globalTransform.apply(e).sub(e);
|
|
7999
|
-
return new
|
|
7927
|
+
return new Tt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
|
|
8000
7928
|
}
|
|
8001
7929
|
_draw() {
|
|
8002
7930
|
super._draw(), this._background.isValid() && (this._shape.draw(!this._background.fillWithShape), this._background.draw()), this._fill.isValid() && (this._shape.draw(), this._fill.draw()), this._outline.isValid() && (this._shape.draw(), this._outline.draw()), this._foreground.isValid() && (this._shape.draw(!this._foreground.fillWithShape), this._foreground.draw()), this._text.isValid() && this._text.draw(), this._chart.isValid() && this._chart.draw(), this._drawContent();
|
|
@@ -8051,10 +7979,10 @@ var Q = {
|
|
|
8051
7979
|
super._destroy(), this.flexbox.destroy(), this.aabb.destroy(), this.globalAabb.destroy(), this.size.destroy(), this.style.destroy(), this.background.destroy(), this.shape.destroy(), this.fill.destroy(), this.outline.destroy(), this.text.destroy(), this.foreground.destroy(), this.shadow.destroy(), this.connection.destroy(), this.comments.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
|
|
8052
7980
|
}
|
|
8053
7981
|
};
|
|
8054
|
-
|
|
7982
|
+
ta = k([S("Element2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ta);
|
|
8055
7983
|
//#endregion
|
|
8056
7984
|
//#region src/scene/2d/TextureRect2D.ts
|
|
8057
|
-
var
|
|
7985
|
+
var na = class extends ta {
|
|
8058
7986
|
texture;
|
|
8059
7987
|
region;
|
|
8060
7988
|
constructor(e, t = []) {
|
|
@@ -8077,8 +8005,8 @@ var aa = class extends ia {
|
|
|
8077
8005
|
} });
|
|
8078
8006
|
}
|
|
8079
8007
|
}
|
|
8080
|
-
},
|
|
8081
|
-
texture = new
|
|
8008
|
+
}, ra = class extends na {
|
|
8009
|
+
texture = new rr();
|
|
8082
8010
|
animation;
|
|
8083
8011
|
_lastTime = NaN;
|
|
8084
8012
|
constructor(e, t = []) {
|
|
@@ -8108,10 +8036,10 @@ var aa = class extends ia {
|
|
|
8108
8036
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
8109
8037
|
}
|
|
8110
8038
|
};
|
|
8111
|
-
|
|
8039
|
+
k([_({ fallback: "" }), O("design:type", String)], ra.prototype, "src", void 0), ra = k([S("Lottie2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ra);
|
|
8112
8040
|
//#endregion
|
|
8113
8041
|
//#region src/scene/2d/Mesh2D.ts
|
|
8114
|
-
var
|
|
8042
|
+
var ia = class extends ta {
|
|
8115
8043
|
texture;
|
|
8116
8044
|
_vertices = /* @__PURE__ */ new Float32Array();
|
|
8117
8045
|
_uvs = /* @__PURE__ */ new Float32Array();
|
|
@@ -8142,7 +8070,7 @@ var sa = class extends ia {
|
|
|
8142
8070
|
_drawContent() {
|
|
8143
8071
|
this.texture?.isValid() && this._indices.length && this._vertices.length && (this.context.fillStyle = this.texture, this.context.drawMesh(this._vertices, this._uvs, this._indices));
|
|
8144
8072
|
}
|
|
8145
|
-
},
|
|
8073
|
+
}, aa = class extends ta {
|
|
8146
8074
|
constructor(e, t = []) {
|
|
8147
8075
|
super(), this.setProperties(e).append(t);
|
|
8148
8076
|
}
|
|
@@ -8155,20 +8083,20 @@ var sa = class extends ia {
|
|
|
8155
8083
|
}
|
|
8156
8084
|
}
|
|
8157
8085
|
_drawCircle(e, t) {
|
|
8158
|
-
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle =
|
|
8086
|
+
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();
|
|
8159
8087
|
}
|
|
8160
8088
|
_drawEllipse(e, t) {
|
|
8161
|
-
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle =
|
|
8089
|
+
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();
|
|
8162
8090
|
}
|
|
8163
8091
|
_draw() {
|
|
8164
8092
|
let { width: e, height: t } = this.getRect();
|
|
8165
8093
|
this.context.rect(0, 0, e, t), this.context.strokeStyle = "#00FF00", this.context.stroke(), this._drawCircle(0, 0), this._drawCircle(e, t), this._drawCircle(0, t), this._drawEllipse(0, t / 2), this._drawCircle(e, 0), this._drawEllipse(e, t / 2);
|
|
8166
8094
|
}
|
|
8167
8095
|
};
|
|
8168
|
-
|
|
8096
|
+
k([_({ fallback: 6 }), O("design:type", Number)], aa.prototype, "handleSize", void 0);
|
|
8169
8097
|
//#endregion
|
|
8170
8098
|
//#region src/scene/2d/Video2D.ts
|
|
8171
|
-
var
|
|
8099
|
+
var oa = class extends na {
|
|
8172
8100
|
get videoDuration() {
|
|
8173
8101
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
8174
8102
|
}
|
|
@@ -8208,24 +8136,24 @@ var la = class extends aa {
|
|
|
8208
8136
|
}
|
|
8209
8137
|
let n = Math.max(0, this.currentTime % t) / 1e3, r = this._timeline, i = r?.playbackRate ?? 1;
|
|
8210
8138
|
if (r?.playing && i > 0) {
|
|
8211
|
-
e.muted = !0, e.loop = this.loop, e.playbackRate =
|
|
8139
|
+
e.muted = !0, e.loop = this.loop, e.playbackRate = E(i, .0625, 16), e.paused && e.isReady && e.play();
|
|
8212
8140
|
let t = Math.abs(e.currentTime - n);
|
|
8213
|
-
!e.seeking && t > Math.max(.3,
|
|
8141
|
+
!e.seeking && t > Math.max(.3, E(i, 1, 16) * .2) && (e.currentTime = n);
|
|
8214
8142
|
} else e.paused || e.pause(), !e.isPlaying && !e.seeking && e.currentTime !== n && (e.currentTime = n, $.awaitBy(() => e.waitSeek(this._loadAbort?.signal)));
|
|
8215
8143
|
}
|
|
8216
8144
|
_process(e) {
|
|
8217
8145
|
super._process(e), this._updateVideoCurrentTime();
|
|
8218
8146
|
}
|
|
8219
8147
|
};
|
|
8220
|
-
|
|
8148
|
+
k([_({ fallback: "" }), O("design:type", String)], oa.prototype, "src", void 0), oa = k([S("Video2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], oa);
|
|
8221
8149
|
//#endregion
|
|
8222
8150
|
//#region src/scene/animation/Animation.ts
|
|
8223
|
-
function
|
|
8151
|
+
function sa(e) {
|
|
8224
8152
|
if (e == null) return 0;
|
|
8225
8153
|
let t = String(e).trim(), n = Number.parseFloat(t);
|
|
8226
8154
|
return Number.isNaN(n) ? 0 : n / 100;
|
|
8227
8155
|
}
|
|
8228
|
-
function
|
|
8156
|
+
function ca(e, t) {
|
|
8229
8157
|
let n = t * 180 / Math.PI;
|
|
8230
8158
|
if (e == null || e === "auto") return n;
|
|
8231
8159
|
let r = String(e).trim();
|
|
@@ -8234,11 +8162,11 @@ function da(e, t) {
|
|
|
8234
8162
|
let i = Number.parseFloat(r);
|
|
8235
8163
|
return Number.isNaN(i) ? n : i;
|
|
8236
8164
|
}
|
|
8237
|
-
function
|
|
8165
|
+
function la(e) {
|
|
8238
8166
|
let t = e.trim(), n = /^path\((.*)\)$/s.exec(t);
|
|
8239
8167
|
return n && (t = n[1].trim()), t.length >= 2 && (t[0] === "\"" || t[0] === "'") && t[t.length - 1] === t[0] && (t = t.slice(1, -1)), t.trim();
|
|
8240
8168
|
}
|
|
8241
|
-
function
|
|
8169
|
+
function ua(e, t, n, r) {
|
|
8242
8170
|
let i = 1e-6, a = 3 * e - 3 * n + 1, o = 3 * n - 6 * e, s = 3 * e, c = 3 * t - 3 * r + 1, l = 3 * r - 6 * t, u = 3 * t, d = (e) => (3 * a * e + 2 * o) * e + s, f = (e) => ((a * e + o) * e + s) * e, p = (e) => ((c * e + l) * e + u) * e;
|
|
8243
8171
|
function m(e) {
|
|
8244
8172
|
let t = e, n, r;
|
|
@@ -8258,7 +8186,7 @@ function pa(e, t, n, r) {
|
|
|
8258
8186
|
}
|
|
8259
8187
|
return (e) => p(m(e));
|
|
8260
8188
|
}
|
|
8261
|
-
var
|
|
8189
|
+
var da = {
|
|
8262
8190
|
linear: [
|
|
8263
8191
|
0,
|
|
8264
8192
|
0,
|
|
@@ -8325,7 +8253,7 @@ var ma = {
|
|
|
8325
8253
|
.355,
|
|
8326
8254
|
1
|
|
8327
8255
|
]
|
|
8328
|
-
},
|
|
8256
|
+
}, fa = Object.fromEntries(Object.entries(da).map(([e, [t, n, r, i]]) => [e, ua(t, n, r, i)])), pa = class extends V {
|
|
8329
8257
|
_keyframes = [];
|
|
8330
8258
|
_isFirstUpdatePosition = !1;
|
|
8331
8259
|
_cachedProps = new t();
|
|
@@ -8361,7 +8289,7 @@ var ma = {
|
|
|
8361
8289
|
e = [this.getParent()].filter(Boolean);
|
|
8362
8290
|
break;
|
|
8363
8291
|
}
|
|
8364
|
-
return e.filter((e) => e instanceof
|
|
8292
|
+
return e.filter((e) => e instanceof ta);
|
|
8365
8293
|
}
|
|
8366
8294
|
_updateKeyframes() {
|
|
8367
8295
|
this._pathMeasures.clear();
|
|
@@ -8394,7 +8322,7 @@ var ma = {
|
|
|
8394
8322
|
}
|
|
8395
8323
|
let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
|
|
8396
8324
|
e.forEach((e, r) => {
|
|
8397
|
-
let i = t === 1 ? n :
|
|
8325
|
+
let i = t === 1 ? n : E(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
|
|
8398
8326
|
if (!a) return;
|
|
8399
8327
|
let o = this._parseKeyframes(i, a);
|
|
8400
8328
|
o?.length && this._commitStyle(i, e, a, o[0], o[1]);
|
|
@@ -8412,14 +8340,14 @@ var ma = {
|
|
|
8412
8340
|
});
|
|
8413
8341
|
}
|
|
8414
8342
|
_parseEasing(e) {
|
|
8415
|
-
if (!e) return
|
|
8416
|
-
if (e in
|
|
8343
|
+
if (!e) return fa.linear;
|
|
8344
|
+
if (e in fa) return fa[e];
|
|
8417
8345
|
let t = /cubic-bezier\((.+)\)/.exec(e);
|
|
8418
8346
|
if (t) {
|
|
8419
8347
|
let e = t[1].split(",").map((e) => Number(e));
|
|
8420
|
-
if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return
|
|
8348
|
+
if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return ua(e[0], e[1], e[2], e[3]);
|
|
8421
8349
|
}
|
|
8422
|
-
return
|
|
8350
|
+
return fa.linear;
|
|
8423
8351
|
}
|
|
8424
8352
|
_parseKeyframes(e, t) {
|
|
8425
8353
|
let n, r = this._keyframes;
|
|
@@ -8454,7 +8382,7 @@ var ma = {
|
|
|
8454
8382
|
});
|
|
8455
8383
|
}
|
|
8456
8384
|
_commitOffsetPath(e, t, n, r, i, a) {
|
|
8457
|
-
let o =
|
|
8385
|
+
let o = la(t);
|
|
8458
8386
|
if (!o) return;
|
|
8459
8387
|
let s = this._pathMeasures.get(o);
|
|
8460
8388
|
if (!s) {
|
|
@@ -8465,7 +8393,7 @@ var ma = {
|
|
|
8465
8393
|
startY: t.y
|
|
8466
8394
|
}, this._pathMeasures.set(o, s);
|
|
8467
8395
|
}
|
|
8468
|
-
let c = D(
|
|
8396
|
+
let c = E(D(sa(r.offsetDistance ?? i.offsetDistance), sa(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 = ca(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
|
|
8469
8397
|
e.onUpdateStyleProperty("transform", `${m ? `${m} ` : ""}translate(${d}px, ${f}px) rotate(${p}deg)`, void 0);
|
|
8470
8398
|
}
|
|
8471
8399
|
_getDiffValue(e, t, n, r, i) {
|
|
@@ -8486,10 +8414,10 @@ var ma = {
|
|
|
8486
8414
|
let a = Math.max(t[e]?.length ?? 0, n[e]?.length ?? 0), o = t[e], s = n[e];
|
|
8487
8415
|
i += `${e}(${Array.from({ length: a }, (e, t) => {
|
|
8488
8416
|
let n = o?.[t], i = s?.[t], a = n?.normalizedIntValue ?? 0, c = i?.normalizedIntValue ?? 0;
|
|
8489
|
-
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 :
|
|
8417
|
+
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : D(a, c, r);
|
|
8490
8418
|
}).join(", ")}) `;
|
|
8491
8419
|
}), i;
|
|
8492
|
-
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value :
|
|
8420
|
+
} 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);
|
|
8493
8421
|
}
|
|
8494
8422
|
isPlaying() {
|
|
8495
8423
|
return !this.paused && this.isInsideTimeRange();
|
|
@@ -8512,14 +8440,14 @@ var ma = {
|
|
|
8512
8440
|
});
|
|
8513
8441
|
}
|
|
8514
8442
|
};
|
|
8515
|
-
|
|
8443
|
+
k([_({ fallback: "parent" }), O("design:type", Object)], pa.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], pa.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], pa.prototype, "easing", void 0), pa = k([S("Animation", {
|
|
8516
8444
|
renderMode: "disabled",
|
|
8517
8445
|
processSortMode: "parent-before",
|
|
8518
8446
|
duration: 2e3
|
|
8519
|
-
}),
|
|
8447
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], pa);
|
|
8520
8448
|
//#endregion
|
|
8521
8449
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
8522
|
-
var
|
|
8450
|
+
var ma = class t extends e {
|
|
8523
8451
|
static _instance;
|
|
8524
8452
|
static get instance() {
|
|
8525
8453
|
return this._instance ||= new t(), this._instance;
|
|
@@ -8549,7 +8477,7 @@ var _a = class t extends e {
|
|
|
8549
8477
|
togglePause() {
|
|
8550
8478
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
8551
8479
|
}
|
|
8552
|
-
},
|
|
8480
|
+
}, ha = class t extends e {
|
|
8553
8481
|
static PADDING = .1;
|
|
8554
8482
|
_source = null;
|
|
8555
8483
|
_audio = null;
|
|
@@ -8676,7 +8604,7 @@ var _a = class t extends e {
|
|
|
8676
8604
|
let e = this._source;
|
|
8677
8605
|
e && (e.onended = null, e.onplay = null, e.onpause = null, this._stop()), this._source = null, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._end = 0, this._start = 0, this._duration = 0, this._playing = !1, this._pausedReal = !1, this._paused = !1, this._muted = !1, this._audio &&= (this._audio.context.off("refresh", this.refresh), this._audio.context.off("refreshPaused", this.refreshPaused), null);
|
|
8678
8606
|
}
|
|
8679
|
-
},
|
|
8607
|
+
}, ga = class {
|
|
8680
8608
|
parent;
|
|
8681
8609
|
source = new globalThis.Audio();
|
|
8682
8610
|
_src = "";
|
|
@@ -8693,7 +8621,7 @@ var _a = class t extends e {
|
|
|
8693
8621
|
return !!this.source && this.source.readyState === 4;
|
|
8694
8622
|
}
|
|
8695
8623
|
get context() {
|
|
8696
|
-
return
|
|
8624
|
+
return ma.instance;
|
|
8697
8625
|
}
|
|
8698
8626
|
constructor(e) {
|
|
8699
8627
|
this.parent = e;
|
|
@@ -8704,9 +8632,9 @@ var _a = class t extends e {
|
|
|
8704
8632
|
});
|
|
8705
8633
|
}
|
|
8706
8634
|
createSound() {
|
|
8707
|
-
return new
|
|
8635
|
+
return new ha();
|
|
8708
8636
|
}
|
|
8709
|
-
},
|
|
8637
|
+
}, _a = class extends e {
|
|
8710
8638
|
_input;
|
|
8711
8639
|
_output;
|
|
8712
8640
|
_processers = [];
|
|
@@ -8728,7 +8656,7 @@ var _a = class t extends e {
|
|
|
8728
8656
|
get destination() {
|
|
8729
8657
|
return this._input;
|
|
8730
8658
|
}
|
|
8731
|
-
},
|
|
8659
|
+
}, va = class {
|
|
8732
8660
|
destination;
|
|
8733
8661
|
source;
|
|
8734
8662
|
constructor(e, t = null) {
|
|
@@ -8743,21 +8671,21 @@ var _a = class t extends e {
|
|
|
8743
8671
|
};
|
|
8744
8672
|
//#endregion
|
|
8745
8673
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
8746
|
-
function
|
|
8674
|
+
function ya() {
|
|
8747
8675
|
if (He) return new AudioContext();
|
|
8748
8676
|
if (Ue) {
|
|
8749
8677
|
let e = globalThis.webkitAudioContext;
|
|
8750
8678
|
return new e();
|
|
8751
8679
|
} else throw Error("Failed to createAudioContext");
|
|
8752
8680
|
}
|
|
8753
|
-
function
|
|
8681
|
+
function ba(e, t, n) {
|
|
8754
8682
|
if (We) return new OfflineAudioContext(e, t, n);
|
|
8755
8683
|
if (Ge) {
|
|
8756
8684
|
let r = globalThis.webkitOfflineAudioContext;
|
|
8757
8685
|
return new r(e, t, n);
|
|
8758
8686
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
8759
8687
|
}
|
|
8760
|
-
var
|
|
8688
|
+
var xa = class e extends _a {
|
|
8761
8689
|
static _instance;
|
|
8762
8690
|
static get instance() {
|
|
8763
8691
|
return this._instance ||= new e(), this._instance;
|
|
@@ -8798,7 +8726,7 @@ var wa = class e extends ba {
|
|
|
8798
8726
|
_compressor;
|
|
8799
8727
|
_analyser;
|
|
8800
8728
|
constructor() {
|
|
8801
|
-
let e =
|
|
8729
|
+
let e = ya(), t = ba(1, 2, We ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
8802
8730
|
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));
|
|
8803
8731
|
}
|
|
8804
8732
|
_onFocus() {
|
|
@@ -8839,7 +8767,7 @@ var wa = class e extends ba {
|
|
|
8839
8767
|
setParamValue(e, t) {
|
|
8840
8768
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
8841
8769
|
}
|
|
8842
|
-
},
|
|
8770
|
+
}, Sa = class extends e {
|
|
8843
8771
|
_audio = null;
|
|
8844
8772
|
_sourceNode = null;
|
|
8845
8773
|
_gain = null;
|
|
@@ -8972,7 +8900,7 @@ var wa = class e extends ba {
|
|
|
8972
8900
|
destroy() {
|
|
8973
8901
|
super.destroy(), this._stop(), this._gain?.disconnect(), this._gain = null, this._audio?.context.off("refresh", this.refresh), this._audio?.context.off("refreshPaused", this.refreshPaused), this._audio = null, this._processors.forEach((e) => e.disconnect()), this._processors.length = 0, this._end = 0, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._elapsed = 0, this._duration = 0, this._paused = !1, this._muted = !1, this._pausedReal = !1;
|
|
8974
8902
|
}
|
|
8975
|
-
},
|
|
8903
|
+
}, Ca = class extends _a {
|
|
8976
8904
|
parent;
|
|
8977
8905
|
_sourceBuffer;
|
|
8978
8906
|
_sourceNode;
|
|
@@ -8980,7 +8908,7 @@ var wa = class e extends ba {
|
|
|
8980
8908
|
gain;
|
|
8981
8909
|
analyser;
|
|
8982
8910
|
get context() {
|
|
8983
|
-
return
|
|
8911
|
+
return xa.instance;
|
|
8984
8912
|
}
|
|
8985
8913
|
get isPlayable() {
|
|
8986
8914
|
return !!this._sourceNode.buffer;
|
|
@@ -8995,8 +8923,8 @@ var wa = class e extends ba {
|
|
|
8995
8923
|
this._sourceNode.buffer = e;
|
|
8996
8924
|
}
|
|
8997
8925
|
constructor(e) {
|
|
8998
|
-
let t =
|
|
8999
|
-
n.connect(i), i.connect(r), r.connect(
|
|
8926
|
+
let t = xa.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
8927
|
+
n.connect(i), i.connect(r), r.connect(xa.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
|
|
9000
8928
|
}
|
|
9001
8929
|
async load() {
|
|
9002
8930
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -9009,7 +8937,7 @@ var wa = class e extends ba {
|
|
|
9009
8937
|
});
|
|
9010
8938
|
}
|
|
9011
8939
|
_decode(e) {
|
|
9012
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
8940
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : xa.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
9013
8941
|
}
|
|
9014
8942
|
cloneSource() {
|
|
9015
8943
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -9019,15 +8947,15 @@ var wa = class e extends ba {
|
|
|
9019
8947
|
};
|
|
9020
8948
|
}
|
|
9021
8949
|
createSound() {
|
|
9022
|
-
return new
|
|
8950
|
+
return new Sa();
|
|
9023
8951
|
}
|
|
9024
|
-
},
|
|
8952
|
+
}, wa, Ta = class extends V {
|
|
9025
8953
|
static {
|
|
9026
|
-
|
|
8954
|
+
wa = this;
|
|
9027
8955
|
}
|
|
9028
8956
|
static _soundPool = [];
|
|
9029
8957
|
_sounds = [];
|
|
9030
|
-
_platformAudio = Ke ? new
|
|
8958
|
+
_platformAudio = Ke ? new Ca(this) : new ga(this);
|
|
9031
8959
|
get platformAudio() {
|
|
9032
8960
|
return this._platformAudio;
|
|
9033
8961
|
}
|
|
@@ -9120,7 +9048,7 @@ var wa = class e extends ba {
|
|
|
9120
9048
|
this._sounds.length = 0;
|
|
9121
9049
|
}
|
|
9122
9050
|
_createSound() {
|
|
9123
|
-
return
|
|
9051
|
+
return wa._soundPool.length > 0 ? wa._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
9124
9052
|
}
|
|
9125
9053
|
refresh() {
|
|
9126
9054
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -9136,7 +9064,7 @@ var wa = class e extends ba {
|
|
|
9136
9064
|
this._recycleSound(e);
|
|
9137
9065
|
};
|
|
9138
9066
|
_recycleSound(e) {
|
|
9139
|
-
e.destroy(),
|
|
9067
|
+
e.destroy(), wa._soundPool.includes(e) || wa._soundPool.push(e);
|
|
9140
9068
|
}
|
|
9141
9069
|
_prevTime = 0;
|
|
9142
9070
|
_timer = 0;
|
|
@@ -9152,14 +9080,14 @@ var wa = class e extends ba {
|
|
|
9152
9080
|
}, 100);
|
|
9153
9081
|
}
|
|
9154
9082
|
};
|
|
9155
|
-
|
|
9083
|
+
Ta = wa = k([S("Audio"), O("design:paramtypes", [Object])], Ta);
|
|
9156
9084
|
//#endregion
|
|
9157
9085
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
9158
|
-
var
|
|
9086
|
+
var Ea = class extends Dr {}, Da = class extends ta {
|
|
9159
9087
|
_audioBuffer;
|
|
9160
9088
|
_src = (() => {
|
|
9161
9089
|
let e = w();
|
|
9162
|
-
return e ? new
|
|
9090
|
+
return e ? new z({ source: e }) : void 0;
|
|
9163
9091
|
})();
|
|
9164
9092
|
_needsUpdateTexture = !1;
|
|
9165
9093
|
constructor(e = {}) {
|
|
@@ -9179,7 +9107,7 @@ var ka = class extends Er {}, Aa = class extends ia {
|
|
|
9179
9107
|
}
|
|
9180
9108
|
}
|
|
9181
9109
|
async _loadSrc(e) {
|
|
9182
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
9110
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => xa.decode(e)).then((e) => {
|
|
9183
9111
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
9184
9112
|
});
|
|
9185
9113
|
}
|
|
@@ -9214,16 +9142,16 @@ var ka = class extends Er {}, Aa = class extends ia {
|
|
|
9214
9142
|
this.syncTexture(), super._process(e);
|
|
9215
9143
|
}
|
|
9216
9144
|
};
|
|
9217
|
-
|
|
9145
|
+
k([_(), O("design:type", Object)], Da.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], Da.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], Da.prototype, "color", void 0), Da = k([S("AudioWaveform"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Da);
|
|
9218
9146
|
//#endregion
|
|
9219
9147
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
9220
|
-
var
|
|
9148
|
+
var Oa, ka = class extends Er {
|
|
9221
9149
|
static {
|
|
9222
|
-
|
|
9150
|
+
Oa = this;
|
|
9223
9151
|
}
|
|
9224
9152
|
blur = 10;
|
|
9225
9153
|
quality = 10;
|
|
9226
|
-
static material = new
|
|
9154
|
+
static material = new I({ gl: {
|
|
9227
9155
|
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}",
|
|
9228
9156
|
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}"
|
|
9229
9157
|
} });
|
|
@@ -9238,7 +9166,7 @@ var ja, Ma = class extends Tr {
|
|
|
9238
9166
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
9239
9167
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
9240
9168
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
9241
|
-
|
|
9169
|
+
L.draw(e, Oa.material, {
|
|
9242
9170
|
sampler: r,
|
|
9243
9171
|
progress: i,
|
|
9244
9172
|
...t
|
|
@@ -9246,35 +9174,35 @@ var ja, Ma = class extends Tr {
|
|
|
9246
9174
|
});
|
|
9247
9175
|
}
|
|
9248
9176
|
};
|
|
9249
|
-
|
|
9177
|
+
ka = Oa = k([S("KawaseTransition")], ka);
|
|
9250
9178
|
//#endregion
|
|
9251
9179
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
9252
|
-
var
|
|
9180
|
+
var Aa, ja = class extends Er {
|
|
9253
9181
|
static {
|
|
9254
|
-
|
|
9182
|
+
Aa = this;
|
|
9255
9183
|
}
|
|
9256
|
-
static material = new
|
|
9184
|
+
static material = new I({ gl: {
|
|
9257
9185
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
9258
9186
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform float progress;\nuniform sampler2D previous;\nuniform sampler2D next;\n\nfloat easeInOutQuint(float t) {\n return t < 0.5 ? 16.0*t*t*t*t*t : 1.0+16.0*(--t)*t*t*t*t;\n}\n\nvoid main() {\n vec4 src1Color = texture2D(previous, vUv);\n vec4 src2Color = texture2D(next, vUv);\n float mProgress = 1.0 - progress;\n float mixPercent = 0.0;\n if (vUv.x <= mProgress) {\n mixPercent = 1.0;\n }\n gl_FragColor = mix(src2Color, src1Color, mixPercent);\n}"
|
|
9259
9187
|
} });
|
|
9260
9188
|
apply(e) {
|
|
9261
|
-
|
|
9189
|
+
L.draw(e, Aa.material, {
|
|
9262
9190
|
previous: 0,
|
|
9263
9191
|
next: 1,
|
|
9264
9192
|
progress: this.currentTimeProgress
|
|
9265
9193
|
});
|
|
9266
9194
|
}
|
|
9267
9195
|
};
|
|
9268
|
-
|
|
9196
|
+
ja = Aa = k([S("LeftEraseTransition")], ja);
|
|
9269
9197
|
//#endregion
|
|
9270
9198
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
9271
|
-
var
|
|
9199
|
+
var Ma, Na = class extends Er {
|
|
9272
9200
|
static {
|
|
9273
|
-
|
|
9201
|
+
Ma = this;
|
|
9274
9202
|
}
|
|
9275
9203
|
blur = 100;
|
|
9276
9204
|
gradientBlur = 600;
|
|
9277
|
-
static material = new
|
|
9205
|
+
static material = new I({ gl: {
|
|
9278
9206
|
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}",
|
|
9279
9207
|
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}"
|
|
9280
9208
|
} });
|
|
@@ -9282,7 +9210,7 @@ var Fa, Ia = class extends Tr {
|
|
|
9282
9210
|
let n = this.currentTimeProgress, r, i;
|
|
9283
9211
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9284
9212
|
let a = t.width, o = t.height, s = [0, o / 2], c = [600, o / 2], l = [a, o], u = c[0] - s[0], d = c[1] - s[1], f = Math.sqrt(u * u + d * d);
|
|
9285
|
-
|
|
9213
|
+
L.draw(e, Ma.material, {
|
|
9286
9214
|
sampler: r,
|
|
9287
9215
|
progress: i,
|
|
9288
9216
|
blur: this.blur,
|
|
@@ -9291,7 +9219,7 @@ var Fa, Ia = class extends Tr {
|
|
|
9291
9219
|
end: c,
|
|
9292
9220
|
delta: [u / f, d / f],
|
|
9293
9221
|
texSize: l
|
|
9294
|
-
}),
|
|
9222
|
+
}), L.draw(e, Ma.material, {
|
|
9295
9223
|
sampler: r,
|
|
9296
9224
|
progress: i,
|
|
9297
9225
|
blur: this.blur,
|
|
@@ -9303,18 +9231,18 @@ var Fa, Ia = class extends Tr {
|
|
|
9303
9231
|
});
|
|
9304
9232
|
}
|
|
9305
9233
|
};
|
|
9306
|
-
|
|
9234
|
+
Na = Ma = k([S("TiltShiftTransition")], Na);
|
|
9307
9235
|
//#endregion
|
|
9308
9236
|
//#region src/scene/transitions/TwistTransition.ts
|
|
9309
|
-
var
|
|
9237
|
+
var Pa, Fa = class extends Er {
|
|
9310
9238
|
static {
|
|
9311
|
-
|
|
9239
|
+
Pa = this;
|
|
9312
9240
|
}
|
|
9313
9241
|
radius;
|
|
9314
9242
|
angle = 4;
|
|
9315
9243
|
padding = 20;
|
|
9316
9244
|
offset;
|
|
9317
|
-
static material = new
|
|
9245
|
+
static material = new I({ gl: {
|
|
9318
9246
|
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}",
|
|
9319
9247
|
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}"
|
|
9320
9248
|
} });
|
|
@@ -9322,7 +9250,7 @@ var La, Ra = class extends Tr {
|
|
|
9322
9250
|
let n = this.currentTimeProgress, r, i;
|
|
9323
9251
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9324
9252
|
let a = t.width, o = t.height;
|
|
9325
|
-
|
|
9253
|
+
L.draw(e, Pa.material, {
|
|
9326
9254
|
sampler: r,
|
|
9327
9255
|
progress: i,
|
|
9328
9256
|
filterArea: [
|
|
@@ -9338,16 +9266,16 @@ var La, Ra = class extends Tr {
|
|
|
9338
9266
|
});
|
|
9339
9267
|
}
|
|
9340
9268
|
};
|
|
9341
|
-
|
|
9269
|
+
Fa = Pa = k([S("TwistTransition")], Fa);
|
|
9342
9270
|
//#endregion
|
|
9343
9271
|
//#region src/asset/loaders/GifLoader.ts
|
|
9344
|
-
var
|
|
9272
|
+
var Ia = class extends Wn {
|
|
9345
9273
|
install(e) {
|
|
9346
9274
|
let t = async (t) => {
|
|
9347
9275
|
let { decodeFrames: n } = await import("modern-gif");
|
|
9348
|
-
return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new
|
|
9276
|
+
return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new nr(e.map((e) => ({
|
|
9349
9277
|
duration: e.delay,
|
|
9350
|
-
texture: new
|
|
9278
|
+
texture: new or({
|
|
9351
9279
|
source: e.data,
|
|
9352
9280
|
width: e.width,
|
|
9353
9281
|
height: e.height
|
|
@@ -9358,14 +9286,14 @@ var za = class extends Un {
|
|
|
9358
9286
|
e.register(n, t);
|
|
9359
9287
|
}), e.gif = this, this;
|
|
9360
9288
|
}
|
|
9361
|
-
},
|
|
9289
|
+
}, La = class extends Wn {
|
|
9362
9290
|
install(e) {
|
|
9363
9291
|
let t = async (e) => JSON.parse(await e.text());
|
|
9364
9292
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
9365
9293
|
e.register(n, t);
|
|
9366
9294
|
}), e.json = this, this;
|
|
9367
9295
|
}
|
|
9368
|
-
},
|
|
9296
|
+
}, Ra = class extends Wn {
|
|
9369
9297
|
install(e) {
|
|
9370
9298
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
9371
9299
|
container: null,
|
|
@@ -9376,14 +9304,14 @@ var za = class extends Un {
|
|
|
9376
9304
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
9377
9305
|
}), e.lottie = this, this;
|
|
9378
9306
|
}
|
|
9379
|
-
},
|
|
9307
|
+
}, za = class extends Wn {
|
|
9380
9308
|
install(e) {
|
|
9381
9309
|
let t = async (e) => e.text();
|
|
9382
9310
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
9383
9311
|
}
|
|
9384
|
-
},
|
|
9312
|
+
}, Ba = class extends Wn {
|
|
9385
9313
|
install(e) {
|
|
9386
|
-
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new
|
|
9314
|
+
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new z({
|
|
9387
9315
|
source: e,
|
|
9388
9316
|
uploadMethodId: "image",
|
|
9389
9317
|
mipmap: !0,
|
|
@@ -9405,11 +9333,11 @@ var za = class extends Un {
|
|
|
9405
9333
|
e.register(n, t);
|
|
9406
9334
|
}), e.texture = this, this;
|
|
9407
9335
|
}
|
|
9408
|
-
},
|
|
9336
|
+
}, Va = class extends Wn {
|
|
9409
9337
|
install(e) {
|
|
9410
|
-
return this.load = (t) => e.awaitBy(() => new
|
|
9338
|
+
return this.load = (t) => e.awaitBy(() => new cr(t).load()), e.video = this, this;
|
|
9411
9339
|
}
|
|
9412
|
-
},
|
|
9340
|
+
}, Ha = Object.entries({
|
|
9413
9341
|
"font/woff": ["woff"],
|
|
9414
9342
|
"font/ttf": ["ttf"],
|
|
9415
9343
|
"font/otf": ["otf"],
|
|
@@ -9425,31 +9353,31 @@ var za = class extends Un {
|
|
|
9425
9353
|
"image/webp": ["webp"],
|
|
9426
9354
|
"application/json": ["json"]
|
|
9427
9355
|
});
|
|
9428
|
-
function
|
|
9429
|
-
for (let [t, n] of
|
|
9356
|
+
function Ua(e) {
|
|
9357
|
+
for (let [t, n] of Ha) if (n.includes(e)) return t;
|
|
9430
9358
|
}
|
|
9431
|
-
function
|
|
9359
|
+
function Wa(e) {
|
|
9432
9360
|
let t;
|
|
9433
9361
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
9434
9362
|
else if (e.startsWith("http")) {
|
|
9435
9363
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
9436
|
-
n && (t =
|
|
9364
|
+
n && (t = Ua(n));
|
|
9437
9365
|
}
|
|
9438
9366
|
return t;
|
|
9439
9367
|
}
|
|
9440
9368
|
//#endregion
|
|
9441
9369
|
//#region src/asset/Assets.ts
|
|
9442
|
-
var
|
|
9370
|
+
var Ga = "WeakRef" in globalThis, Ka = class extends e {
|
|
9443
9371
|
defaultHandler = (e) => e;
|
|
9444
9372
|
_handlers = /* @__PURE__ */ new Map();
|
|
9445
9373
|
_handleing = /* @__PURE__ */ new Map();
|
|
9446
9374
|
_handled = /* @__PURE__ */ new Map();
|
|
9447
|
-
_gc =
|
|
9375
|
+
_gc = Ga ? new FinalizationRegistry((e) => {
|
|
9448
9376
|
let t = this.get(e);
|
|
9449
9377
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
9450
9378
|
}) : void 0;
|
|
9451
9379
|
constructor() {
|
|
9452
|
-
super(),
|
|
9380
|
+
super(), Ga || C.on(this.gc.bind(this), { sort: 2 });
|
|
9453
9381
|
}
|
|
9454
9382
|
use(e) {
|
|
9455
9383
|
return e.install(this), this;
|
|
@@ -9498,11 +9426,11 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9498
9426
|
}
|
|
9499
9427
|
get(e) {
|
|
9500
9428
|
let t = this._handled.get(e);
|
|
9501
|
-
return
|
|
9429
|
+
return Ga && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
9502
9430
|
}
|
|
9503
9431
|
set(e, t) {
|
|
9504
9432
|
let n = t;
|
|
9505
|
-
|
|
9433
|
+
Ga && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
|
|
9506
9434
|
}
|
|
9507
9435
|
async awaitBy(e) {
|
|
9508
9436
|
let t = e(), n = c();
|
|
@@ -9517,7 +9445,7 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9517
9445
|
return this._handleing.set(e, r), r;
|
|
9518
9446
|
}
|
|
9519
9447
|
async load(e, t) {
|
|
9520
|
-
let n = await this.loadBy(e), r =
|
|
9448
|
+
let n = await this.loadBy(e), r = Wa(e);
|
|
9521
9449
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
9522
9450
|
}
|
|
9523
9451
|
async waitUntilLoad() {
|
|
@@ -9531,14 +9459,14 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9531
9459
|
n && "destroy" in n && n.destroy();
|
|
9532
9460
|
}), this._handled.clear();
|
|
9533
9461
|
}
|
|
9534
|
-
}, $ = new
|
|
9462
|
+
}, $ = new Ka().use(new Gn()).use(new Ia()).use(new La()).use(new Ra()).use(new za()).use(new Ba()).use(new Va()), qa = {
|
|
9535
9463
|
alpha: !0,
|
|
9536
9464
|
stencil: !0,
|
|
9537
9465
|
antialias: !1,
|
|
9538
9466
|
premultipliedAlpha: !0,
|
|
9539
9467
|
preserveDrawingBuffer: !1,
|
|
9540
9468
|
powerPreference: "default"
|
|
9541
|
-
},
|
|
9469
|
+
}, Ja = class extends Tr {
|
|
9542
9470
|
renderer;
|
|
9543
9471
|
get view() {
|
|
9544
9472
|
return this.renderer.view;
|
|
@@ -9570,13 +9498,13 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9570
9498
|
}) : void 0;
|
|
9571
9499
|
constructor(e = {}) {
|
|
9572
9500
|
let { view: t, width: n, height: r, pixelRatio: i = Ye, autoResize: a, data: o } = e;
|
|
9573
|
-
super(), this.renderer = new
|
|
9574
|
-
alpha:
|
|
9575
|
-
stencil:
|
|
9576
|
-
antialias:
|
|
9577
|
-
premultipliedAlpha:
|
|
9578
|
-
preserveDrawingBuffer:
|
|
9579
|
-
powerPreference:
|
|
9501
|
+
super(), this.renderer = new Un(t, {
|
|
9502
|
+
alpha: qa.alpha ?? e.alpha,
|
|
9503
|
+
stencil: qa.stencil ?? e.stencil,
|
|
9504
|
+
antialias: qa.antialias ?? e.antialias,
|
|
9505
|
+
premultipliedAlpha: qa.premultipliedAlpha ?? e.premultipliedAlpha,
|
|
9506
|
+
preserveDrawingBuffer: qa.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
|
|
9507
|
+
powerPreference: qa.powerPreference ?? e.powerPreference
|
|
9580
9508
|
}), this._setupInput(), this.pixelRatio = i, a ? !t && this.renderer.view && (this.renderer.view.style.width = "100%", this.renderer.view.style.height = "100%") : this.resize(n || this.gl.drawingBufferWidth || this.view?.clientWidth || 200, r || this.gl.drawingBufferHeight || this.view?.clientHeight || 200, !t), this.setProperties(e), o && this.root.append(o);
|
|
9581
9509
|
}
|
|
9582
9510
|
_updateProperty(e, t, n) {
|
|
@@ -9695,22 +9623,22 @@ var Ja = "WeakRef" in globalThis, Ya = class extends e {
|
|
|
9695
9623
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
9696
9624
|
}
|
|
9697
9625
|
};
|
|
9698
|
-
|
|
9626
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], Ja.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Ja.prototype, "autoStart", void 0);
|
|
9699
9627
|
//#endregion
|
|
9700
9628
|
//#region src/render.ts
|
|
9701
|
-
var
|
|
9702
|
-
function
|
|
9703
|
-
return
|
|
9629
|
+
var Ya, Xa = [], Za = !1;
|
|
9630
|
+
function Qa() {
|
|
9631
|
+
return Ya ??= new Ja({
|
|
9704
9632
|
pixelRatio: 1,
|
|
9705
9633
|
width: 1,
|
|
9706
9634
|
height: 1,
|
|
9707
9635
|
preserveDrawingBuffer: !0
|
|
9708
9636
|
});
|
|
9709
9637
|
}
|
|
9710
|
-
async function
|
|
9711
|
-
if (!
|
|
9712
|
-
for (
|
|
9713
|
-
let t =
|
|
9638
|
+
async function $a(e = 100) {
|
|
9639
|
+
if (!Za) {
|
|
9640
|
+
for (Za = !0; Xa.length;) {
|
|
9641
|
+
let t = Xa.shift();
|
|
9714
9642
|
if (t) try {
|
|
9715
9643
|
await t();
|
|
9716
9644
|
} catch (e) {
|
|
@@ -9718,11 +9646,11 @@ async function no(e = 100) {
|
|
|
9718
9646
|
}
|
|
9719
9647
|
else await new Promise((t) => setTimeout(t, e));
|
|
9720
9648
|
}
|
|
9721
|
-
|
|
9649
|
+
Za = !1;
|
|
9722
9650
|
}
|
|
9723
9651
|
}
|
|
9724
|
-
async function
|
|
9725
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.max(1, Math.floor(r)), d = Math.max(1, Math.floor(i)), f =
|
|
9652
|
+
async function eo(e) {
|
|
9653
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.max(1, Math.floor(r)), d = Math.max(1, Math.floor(i)), f = Qa();
|
|
9726
9654
|
if (f.resetProperties(), f.setProperties(l), f.debug = t, f.fonts = n, f.timeline.currentTime = 0, f.resizeForExport(u, d), f.root.removeChildren(!0), f.root.append(a), await s?.(f), await f.waitUntilProcessed(), o.length) {
|
|
9727
9655
|
let e = o.length, t = o[e - 1];
|
|
9728
9656
|
for (let n = 0; n < e; n++) {
|
|
@@ -9740,27 +9668,27 @@ async function ro(e) {
|
|
|
9740
9668
|
toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
|
|
9741
9669
|
};
|
|
9742
9670
|
}
|
|
9743
|
-
async function
|
|
9671
|
+
async function to(e) {
|
|
9744
9672
|
return new Promise((t, n) => {
|
|
9745
|
-
|
|
9673
|
+
Xa.push(async () => {
|
|
9746
9674
|
try {
|
|
9747
|
-
t(await
|
|
9675
|
+
t(await eo(e).then((e) => e.toCanvas2D()));
|
|
9748
9676
|
} catch (e) {
|
|
9749
9677
|
n(e);
|
|
9750
9678
|
}
|
|
9751
|
-
}),
|
|
9679
|
+
}), $a();
|
|
9752
9680
|
});
|
|
9753
9681
|
}
|
|
9754
|
-
async function
|
|
9682
|
+
async function no(e) {
|
|
9755
9683
|
return new Promise((t, n) => {
|
|
9756
|
-
|
|
9684
|
+
Xa.push(async () => {
|
|
9757
9685
|
try {
|
|
9758
|
-
t(await
|
|
9686
|
+
t(await eo(e).then((e) => e.pixels));
|
|
9759
9687
|
} catch (e) {
|
|
9760
9688
|
n(e);
|
|
9761
9689
|
}
|
|
9762
|
-
}),
|
|
9690
|
+
}), $a();
|
|
9763
9691
|
});
|
|
9764
9692
|
}
|
|
9765
9693
|
//#endregion
|
|
9766
|
-
export { bt as Aabb2D,
|
|
9694
|
+
export { bt as Aabb2D, nr as AnimatedTexture, pa as Animation, Ka as Assets, Ta as Audio, _a as AudioPipeline, va as AudioProcessor, Ea as AudioSpectrum, Da as AudioWaveform, A as BufferUsage, Or as Camera2D, ur as CanvasContext, br as CanvasItem, rr as CanvasTexture, xt as Color, W as ColorAdjustEffect, Vr as ColorFilterEffect, wt as ColorMatrix, Wr as ColorOverlayEffect, Kr as ColorRemoveEffect, Yr as ColorReplaceEffect, ir as ColorTexture, T as CoreObject, St as DEG_TO_RAD, Ye as DEVICE_PIXEL_RATIO, G as DrawboardEffect, ni as DropShadowEffect, U as Effect, $n as EffectMaterial, ta as Element2D, Ci as Element2DBackground, X as Element2DChart, Di as Element2DComments, Oi as Element2DConnection, Y as Element2DFill, Ai as Element2DForeground, Mi as Element2DOutline, Ni as Element2DShadow, Pi as Element2DShape, Fi as Element2DStyle, zi as Element2DTable, Z as Element2DText, ii as EmbossEffect, Ja as Engine, Xi as Flexbox, Gn as FontLoader, ei as GaussianBlurEffect, qn as Geometry, Ia as GifLoader, dn as GlBatch2DSystem, sn as GlBlendMode, kt as GlBuffer, It as GlBufferSystem, Ot as GlBufferTarget, hn as GlMaskSystem, Jt as GlProgram, yn as GlRenderTarget, bn as GlRenderTargetSystem, rn as GlShaderSystem, ln as GlState, un as GlStateSystem, _n as GlStencilSystem, j as GlSystem, vn as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, ar as GradientTexture, ga as HTMLAudio, ma as HTMLAudioContext, ha as HTMLSound, qe as IN_BROWSER, Je as IN_MAC_OS, Kn as IndexBuffer, _t as Input, dt as InputEvent, La as JsonLoader, ui as KawaseBlurEffect, ka as KawaseTransition, ft as KeyboardInputEvent, ja as LeftEraseTransition, Wn as Loader, ra as Lottie2D, Ra as LottieLoader, Dt as MainLoop, fi as MaskEffect, I as Material, ia as Mesh2D, fr as Meta, pt as MouseInputEvent, B as Node, Dr as Node2D, Tt as Obb2D, J as OutlineEffect, xe as PI, Se as PI_2, gi as PixelateEffect, or as PixelsTexture, mt as PointerInputEvent, Et as Projection2D, Jn as QuadGeometry, L as QuadUvGeometry, Ct as RAD_TO_DEG, vt as RefCounted, R as RenderTarget, At as Renderer, yt 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, Tr as SceneTree, za as TextLoader, z as Texture2D, Ba as TextureLoader, na as TextureRect2D, C as Ticker, Na as TiltShiftTransition, Cr as Timeline, V as TimelineNode, aa as TransformRect2D, Er as Transition, Fa as TwistTransition, Mt as UniformGroup, tr as UvGeometry, er as UvMaterial, F as VertexAttribute, P as VertexBuffer, oa as Video2D, Va as VideoLoader, cr as VideoTexture, H as Viewport, lr as ViewportTexture, Ca as WebAudio, xa as WebAudioContext, Un as WebGLRenderer, Sa as WebSound, ht as WheelInputEvent, wr as Window, vi as ZoomBlurEffect, Vi as alignMap, $ as assets, kr as axisDir, Yi as boxSizingMap, E as clamp, li as clampFrag, w as createHTMLCanvas, Ft as createIdFromString, ye as createNode, ct as crossOrigin, da as cssEasingPresets, ua as cubicBezier, S as customNode, ve as customNodes, qa as defaultOptions, st as determineCrossOrigin, Ui as directionMap, Hi as displayMap, Q as edgeMap, Wi as flexDirectionMap, Gi as flexWrapMap, ci as frag, rt as getCanvasFactory, Oe as getDefaultCssPropertyValue, ot as getGlContextProvider, xi as getImagePipelineResolver, Qa as getRenderEngine, Bi as gutterMap, ut as instanceId, $e as isCanvasElement, Xe as isElementNode, Qe as isImageElement, Ce as isPow2, Ze as isVideoElement, et as isWebgl2, Ki as justifyMap, D as lerp, pn as log2, cn as mapGlBlendModes, fn as nextPow2, be as nextTick, qi as overflowMap, Lr as parseCssFilter, Ae as parseCssFunctions, ke as parseCssProperty, Rr as parseCssTransformOrigin, we as planExportTiles, Ji as positionTypeMap, to as render, no as renderPixels, vr as resetBatchPool, Ar as routeConnection, nt as setCanvasFactory, at as setGlContextProvider, bi as setImagePipelineResolver, gn as stencilModeMap };
|