@mlightcad/common 1.3.1 → 1.3.2
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/common.js +67 -67
- package/dist/common.umd.cjs +1 -1
- package/lib/AcCmTaskScheduler.js +3 -3
- package/lib/AcCmTaskScheduler.js.map +1 -1
- package/package.json +1 -1
package/dist/common.js
CHANGED
|
@@ -569,8 +569,8 @@ class B {
|
|
|
569
569
|
* @returns The current instance for chaining
|
|
570
570
|
*/
|
|
571
571
|
setRGB(e, t, s) {
|
|
572
|
-
const o = Math.max(0, Math.min(255, Math.round(e))), i = Math.max(0, Math.min(255, Math.round(t))),
|
|
573
|
-
return this._value = o << 16 | i << 8 |
|
|
572
|
+
const o = Math.max(0, Math.min(255, Math.round(e))), i = Math.max(0, Math.min(255, Math.round(t))), l = Math.max(0, Math.min(255, Math.round(s)));
|
|
573
|
+
return this._value = o << 16 | i << 8 | l, this._colorMethod = n.ByColor, this;
|
|
574
574
|
}
|
|
575
575
|
/**
|
|
576
576
|
* Sets the RGB color by a single packed number (0xRRGGBB).
|
|
@@ -597,19 +597,19 @@ class B {
|
|
|
597
597
|
if (!e) return this;
|
|
598
598
|
const t = e.trim().toLowerCase();
|
|
599
599
|
if (t.startsWith("#")) {
|
|
600
|
-
let i = 0,
|
|
600
|
+
let i = 0, l = 0, c = 0;
|
|
601
601
|
if (t.length === 7)
|
|
602
|
-
i = parseInt(t.substr(1, 2), 16),
|
|
602
|
+
i = parseInt(t.substr(1, 2), 16), l = parseInt(t.substr(3, 2), 16), c = parseInt(t.substr(5, 2), 16);
|
|
603
603
|
else if (t.length === 4)
|
|
604
|
-
i = parseInt(t[1] + t[1], 16),
|
|
604
|
+
i = parseInt(t[1] + t[1], 16), l = parseInt(t[2] + t[2], 16), c = parseInt(t[3] + t[3], 16);
|
|
605
605
|
else
|
|
606
606
|
return console.warn("Invalid hex color:", e), this;
|
|
607
|
-
return this.setRGB(i,
|
|
607
|
+
return this.setRGB(i, l, c);
|
|
608
608
|
}
|
|
609
609
|
const s = t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
|
|
610
610
|
if (s) {
|
|
611
|
-
const i = parseInt(s[1], 10),
|
|
612
|
-
return this.setRGB(i,
|
|
611
|
+
const i = parseInt(s[1], 10), l = parseInt(s[2], 10), c = parseInt(s[3], 10);
|
|
612
|
+
return this.setRGB(i, l, c);
|
|
613
613
|
}
|
|
614
614
|
const o = b.getColorByName(e);
|
|
615
615
|
return o !== void 0 ? this.setRGBValue(o) : (console.warn("Unknown CSS color string:", e), this);
|
|
@@ -797,8 +797,8 @@ class B {
|
|
|
797
797
|
if (/^byblock$/i.test(t))
|
|
798
798
|
return new B(n.ByBlock);
|
|
799
799
|
if (/^\d{1,3},\d{1,3},\d{1,3}$/i.test(t)) {
|
|
800
|
-
const [o, i,
|
|
801
|
-
return c.setRGB(o, i,
|
|
800
|
+
const [o, i, l] = t.split(",").map(Number), c = new B(n.ByColor);
|
|
801
|
+
return c.setRGB(o, i, l), c;
|
|
802
802
|
}
|
|
803
803
|
if (/^\d+$/.test(t)) {
|
|
804
804
|
const o = parseInt(t, 10);
|
|
@@ -1026,7 +1026,7 @@ class ie {
|
|
|
1026
1026
|
if (s !== void 0) {
|
|
1027
1027
|
e.target = this;
|
|
1028
1028
|
const o = s.slice(0);
|
|
1029
|
-
for (let i = 0,
|
|
1029
|
+
for (let i = 0, l = o.length; i < l; i++)
|
|
1030
1030
|
o[i].call(this, e);
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
@@ -1095,7 +1095,7 @@ function Z(r, e) {
|
|
|
1095
1095
|
function J(r) {
|
|
1096
1096
|
return r == null ? !0 : Array.isArray(r) || typeof r == "string" ? r.length === 0 : r instanceof Map || r instanceof Set ? r.size === 0 : typeof r == "object" ? Object.keys(r).length === 0 : !1;
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function k(r, e) {
|
|
1099
1099
|
if (r === e)
|
|
1100
1100
|
return !0;
|
|
1101
1101
|
if (r == null || e == null)
|
|
@@ -1110,7 +1110,7 @@ function M(r, e) {
|
|
|
1110
1110
|
if (r.length !== e.length)
|
|
1111
1111
|
return !1;
|
|
1112
1112
|
for (let o = 0; o < r.length; o++)
|
|
1113
|
-
if (!
|
|
1113
|
+
if (!k(r[o], e[o]))
|
|
1114
1114
|
return !1;
|
|
1115
1115
|
return !0;
|
|
1116
1116
|
}
|
|
@@ -1121,7 +1121,7 @@ function M(r, e) {
|
|
|
1121
1121
|
if (!Object.prototype.hasOwnProperty.call(
|
|
1122
1122
|
e,
|
|
1123
1123
|
o
|
|
1124
|
-
) || !
|
|
1124
|
+
) || !k(
|
|
1125
1125
|
r[o],
|
|
1126
1126
|
e[o]
|
|
1127
1127
|
))
|
|
@@ -1144,16 +1144,16 @@ var q = { exports: {} };
|
|
|
1144
1144
|
"info",
|
|
1145
1145
|
"warn",
|
|
1146
1146
|
"error"
|
|
1147
|
-
], i = {},
|
|
1147
|
+
], i = {}, l = null;
|
|
1148
1148
|
function c(h, d) {
|
|
1149
|
-
var
|
|
1150
|
-
if (typeof
|
|
1151
|
-
return
|
|
1149
|
+
var a = h[d];
|
|
1150
|
+
if (typeof a.bind == "function")
|
|
1151
|
+
return a.bind(h);
|
|
1152
1152
|
try {
|
|
1153
|
-
return Function.prototype.bind.call(
|
|
1153
|
+
return Function.prototype.bind.call(a, h);
|
|
1154
1154
|
} catch {
|
|
1155
1155
|
return function() {
|
|
1156
|
-
return Function.prototype.apply.apply(
|
|
1156
|
+
return Function.prototype.apply.apply(a, [h, arguments]);
|
|
1157
1157
|
};
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
@@ -1165,8 +1165,8 @@ var q = { exports: {} };
|
|
|
1165
1165
|
}
|
|
1166
1166
|
function _() {
|
|
1167
1167
|
for (var h = this.getLevel(), d = 0; d < o.length; d++) {
|
|
1168
|
-
var
|
|
1169
|
-
this[
|
|
1168
|
+
var a = o[d];
|
|
1169
|
+
this[a] = d < h ? e : this.methodFactory(a, h, this.name);
|
|
1170
1170
|
}
|
|
1171
1171
|
if (this.log = this.debug, typeof console === t && h < this.levels.SILENT)
|
|
1172
1172
|
return "No console available for logging";
|
|
@@ -1176,11 +1176,11 @@ var q = { exports: {} };
|
|
|
1176
1176
|
typeof console !== t && (_.call(this), this[h].apply(this, arguments));
|
|
1177
1177
|
};
|
|
1178
1178
|
}
|
|
1179
|
-
function f(h, d,
|
|
1179
|
+
function f(h, d, a) {
|
|
1180
1180
|
return m(h) || x.apply(this, arguments);
|
|
1181
1181
|
}
|
|
1182
1182
|
function S(h, d) {
|
|
1183
|
-
var
|
|
1183
|
+
var a = this, E, R, w, p = "loglevel";
|
|
1184
1184
|
typeof h == "string" ? p += ":" + h : typeof h == "symbol" && (p = void 0);
|
|
1185
1185
|
function z(u) {
|
|
1186
1186
|
var g = (o[u] || "silent").toUpperCase();
|
|
@@ -1211,7 +1211,7 @@ var q = { exports: {} };
|
|
|
1211
1211
|
)[1]);
|
|
1212
1212
|
} catch {
|
|
1213
1213
|
}
|
|
1214
|
-
return
|
|
1214
|
+
return a.levels[u] === void 0 && (u = void 0), u;
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
1217
|
function H() {
|
|
@@ -1228,54 +1228,54 @@ var q = { exports: {} };
|
|
|
1228
1228
|
}
|
|
1229
1229
|
function L(u) {
|
|
1230
1230
|
var g = u;
|
|
1231
|
-
if (typeof g == "string" &&
|
|
1231
|
+
if (typeof g == "string" && a.levels[g.toUpperCase()] !== void 0 && (g = a.levels[g.toUpperCase()]), typeof g == "number" && g >= 0 && g <= a.levels.SILENT)
|
|
1232
1232
|
return g;
|
|
1233
1233
|
throw new TypeError("log.setLevel() called with invalid level: " + u);
|
|
1234
1234
|
}
|
|
1235
|
-
|
|
1235
|
+
a.name = h, a.levels = {
|
|
1236
1236
|
TRACE: 0,
|
|
1237
1237
|
DEBUG: 1,
|
|
1238
1238
|
INFO: 2,
|
|
1239
1239
|
WARN: 3,
|
|
1240
1240
|
ERROR: 4,
|
|
1241
1241
|
SILENT: 5
|
|
1242
|
-
},
|
|
1242
|
+
}, a.methodFactory = d || f, a.getLevel = function() {
|
|
1243
1243
|
return w ?? R ?? E;
|
|
1244
|
-
},
|
|
1245
|
-
return w = L(u), g !== !1 && z(w), _.call(
|
|
1246
|
-
},
|
|
1247
|
-
R = L(u), P() ||
|
|
1248
|
-
},
|
|
1249
|
-
w = null, H(), _.call(
|
|
1250
|
-
},
|
|
1251
|
-
|
|
1252
|
-
},
|
|
1253
|
-
|
|
1254
|
-
},
|
|
1255
|
-
if (
|
|
1244
|
+
}, a.setLevel = function(u, g) {
|
|
1245
|
+
return w = L(u), g !== !1 && z(w), _.call(a);
|
|
1246
|
+
}, a.setDefaultLevel = function(u) {
|
|
1247
|
+
R = L(u), P() || a.setLevel(u, !1);
|
|
1248
|
+
}, a.resetLevel = function() {
|
|
1249
|
+
w = null, H(), _.call(a);
|
|
1250
|
+
}, a.enableAll = function(u) {
|
|
1251
|
+
a.setLevel(a.levels.TRACE, u);
|
|
1252
|
+
}, a.disableAll = function(u) {
|
|
1253
|
+
a.setLevel(a.levels.SILENT, u);
|
|
1254
|
+
}, a.rebuild = function() {
|
|
1255
|
+
if (l !== a && (E = L(l.getLevel())), _.call(a), l === a)
|
|
1256
1256
|
for (var u in i)
|
|
1257
1257
|
i[u].rebuild();
|
|
1258
1258
|
}, E = L(
|
|
1259
|
-
|
|
1259
|
+
l ? l.getLevel() : "WARN"
|
|
1260
1260
|
);
|
|
1261
1261
|
var T = P();
|
|
1262
|
-
T != null && (w = L(T)), _.call(
|
|
1262
|
+
T != null && (w = L(T)), _.call(a);
|
|
1263
1263
|
}
|
|
1264
|
-
|
|
1264
|
+
l = new S(), l.getLogger = function(d) {
|
|
1265
1265
|
if (typeof d != "symbol" && typeof d != "string" || d === "")
|
|
1266
1266
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
1267
|
-
var
|
|
1268
|
-
return
|
|
1267
|
+
var a = i[d];
|
|
1268
|
+
return a || (a = i[d] = new S(
|
|
1269
1269
|
d,
|
|
1270
|
-
|
|
1271
|
-
)),
|
|
1270
|
+
l.methodFactory
|
|
1271
|
+
)), a;
|
|
1272
1272
|
};
|
|
1273
1273
|
var j = typeof window !== t ? window.log : void 0;
|
|
1274
|
-
return
|
|
1275
|
-
return typeof window !== t && window.log ===
|
|
1276
|
-
},
|
|
1274
|
+
return l.noConflict = function() {
|
|
1275
|
+
return typeof window !== t && window.log === l && (window.log = j), l;
|
|
1276
|
+
}, l.getLoggers = function() {
|
|
1277
1277
|
return i;
|
|
1278
|
-
},
|
|
1278
|
+
}, l.default = l, l;
|
|
1279
1279
|
});
|
|
1280
1280
|
})(q);
|
|
1281
1281
|
var $ = q.exports;
|
|
@@ -1339,12 +1339,12 @@ class V {
|
|
|
1339
1339
|
if (e == null) return this;
|
|
1340
1340
|
let o;
|
|
1341
1341
|
typeof e == "object" ? (o = e, s = t) : (o = {}, o[e] = t), s || (s = {});
|
|
1342
|
-
const i = s.unset,
|
|
1342
|
+
const i = s.unset, l = s.silent, c = [], I = this._changing;
|
|
1343
1343
|
this._changing = !0, I || (this._previousAttributes = C(this.attributes), this.changed = {});
|
|
1344
1344
|
const m = this.attributes, _ = this.changed, x = this._previousAttributes;
|
|
1345
1345
|
for (const f in o)
|
|
1346
|
-
t = o[f],
|
|
1347
|
-
if (!
|
|
1346
|
+
t = o[f], k(m[f], t) || c.push(f), k(x[f], t) ? delete _[f] : _[f] = t, i ? delete m[f] : m[f] = t;
|
|
1347
|
+
if (!l) {
|
|
1348
1348
|
c.length && (this._pending = s);
|
|
1349
1349
|
for (let f = 0; f < c.length; f++)
|
|
1350
1350
|
this.events.attrChanged.dispatch({
|
|
@@ -1355,7 +1355,7 @@ class V {
|
|
|
1355
1355
|
});
|
|
1356
1356
|
}
|
|
1357
1357
|
if (I) return this;
|
|
1358
|
-
if (!
|
|
1358
|
+
if (!l)
|
|
1359
1359
|
for (; this._pending; )
|
|
1360
1360
|
s = this._pending, this._pending = !1, this.events.modelChanged.dispatch({
|
|
1361
1361
|
object: this,
|
|
@@ -1385,7 +1385,7 @@ class V {
|
|
|
1385
1385
|
const t = this._changing ? this._previousAttributes : this.attributes, s = {};
|
|
1386
1386
|
for (const o in e) {
|
|
1387
1387
|
const i = e[o];
|
|
1388
|
-
|
|
1388
|
+
k(t[o], i) || (s[o] = i);
|
|
1389
1389
|
}
|
|
1390
1390
|
return s;
|
|
1391
1391
|
}
|
|
@@ -1409,7 +1409,7 @@ class V {
|
|
|
1409
1409
|
return new V(e);
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
|
-
class
|
|
1412
|
+
class M {
|
|
1413
1413
|
/**
|
|
1414
1414
|
* Private constructor to enforce singleton pattern.
|
|
1415
1415
|
*/
|
|
@@ -1421,7 +1421,7 @@ class k {
|
|
|
1421
1421
|
* @returns The shared AcCmPerformanceCollector instance.
|
|
1422
1422
|
*/
|
|
1423
1423
|
static getInstance() {
|
|
1424
|
-
return
|
|
1424
|
+
return M.instance || (M.instance = new M()), M.instance;
|
|
1425
1425
|
}
|
|
1426
1426
|
/**
|
|
1427
1427
|
* Adds or replaces a performance entry by name.
|
|
@@ -1493,8 +1493,8 @@ class he {
|
|
|
1493
1493
|
*/
|
|
1494
1494
|
static formatBytes(e, t = 2) {
|
|
1495
1495
|
if (e === 0) return "0 B";
|
|
1496
|
-
const s = 1024, o = Math.max(0, t), i = ["B", "KB", "MB", "GB", "TB"],
|
|
1497
|
-
return `${parseFloat(c.toFixed(o))} ${i[
|
|
1496
|
+
const s = 1024, o = Math.max(0, t), i = ["B", "KB", "MB", "GB", "TB"], l = Math.floor(Math.log(e) / Math.log(s)), c = e / Math.pow(s, l);
|
|
1497
|
+
return `${parseFloat(c.toFixed(o))} ${i[l]}`;
|
|
1498
1498
|
}
|
|
1499
1499
|
}
|
|
1500
1500
|
var y = /* @__PURE__ */ ((r) => (r[r.ByLayer = 0] = "ByLayer", r[r.ByBlock = 1] = "ByBlock", r[r.ByAlpha = 2] = "ByAlpha", r[r.ErrorValue = 3] = "ErrorValue", r))(y || {});
|
|
@@ -1821,12 +1821,12 @@ class ce {
|
|
|
1821
1821
|
const i = this.tasks[o];
|
|
1822
1822
|
try {
|
|
1823
1823
|
s = await this.scheduleTask(async () => {
|
|
1824
|
-
const
|
|
1825
|
-
return this.onProgress((o + 1) / t, i),
|
|
1824
|
+
const l = await i.run(s);
|
|
1825
|
+
return this.onProgress((o + 1) / t, i), l;
|
|
1826
1826
|
});
|
|
1827
|
-
} catch (
|
|
1828
|
-
if (this.onError({ error:
|
|
1829
|
-
|
|
1827
|
+
} catch (l) {
|
|
1828
|
+
if (this.onError({ error: l, taskIndex: o, task: i }))
|
|
1829
|
+
return Promise.reject(l);
|
|
1830
1830
|
}
|
|
1831
1831
|
}
|
|
1832
1832
|
this.onComplete(s);
|
|
@@ -1999,7 +1999,7 @@ export {
|
|
|
1999
1999
|
de as AcCmLoader,
|
|
2000
2000
|
re as AcCmLoadingManager,
|
|
2001
2001
|
V as AcCmObject,
|
|
2002
|
-
|
|
2002
|
+
M as AcCmPerformanceCollector,
|
|
2003
2003
|
ue as AcCmTask,
|
|
2004
2004
|
ce as AcCmTaskScheduler,
|
|
2005
2005
|
v as AcCmTransparency,
|
|
@@ -2012,7 +2012,7 @@ export {
|
|
|
2012
2012
|
Y as defaults,
|
|
2013
2013
|
Z as has,
|
|
2014
2014
|
J as isEmpty,
|
|
2015
|
-
|
|
2015
|
+
k as isEqual,
|
|
2016
2016
|
O as log,
|
|
2017
2017
|
ae as setLogLevel
|
|
2018
2018
|
};
|
package/dist/common.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(h,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(h=typeof globalThis<"u"?globalThis:h||self,E(h.common={}))})(this,function(h){"use strict";function E(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in r)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var o=(r=>(r[r.ByColor=1]="ByColor",r[r.ByACI=2]="ByACI",r[r.ByLayer=3]="ByLayer",r[r.ByBlock=4]="ByBlock",r[r.None=0]="None",r))(o||{});const G={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},S=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];class w{static getColorByIndex(e){return S[e]}static getIndexByColor(e){const t=S.length-1;for(let n=1;n<t;++n)if(S[n]===e)return n}static getColorByName(e){return G[e.toLowerCase()]}static getNameByColor(e){for(const[t,n]of Object.entries(G))if(n===e)return t}static getNameByIndex(e){const t=this.getColorByIndex(e);return this.getNameByColor(t)}}class _{constructor(e=o.ByLayer,t){this._colorMethod=e,this._colorMethod==o.ByColor&&t==null?this._value=16777215:this._colorMethod==o.ByACI?t==null?this._value=8:t===0?this._colorMethod=o.ByBlock:t===256?this._colorMethod=o.ByLayer:this._value=Math.max(0,Math.min(t,256)):this._value=t}get colorMethod(){return this._colorMethod}set colorMethod(e){this._colorMethod=e}get red(){const e=this.RGB;return e!=null?e>>16&255:void 0}get green(){const e=this.RGB;return e!=null?e>>8&255:void 0}get blue(){const e=this.RGB;return e!=null?e&255:void 0}get RGB(){switch(this._colorMethod){case o.ByColor:case o.ByBlock:case o.ByLayer:return this._value;case o.ByACI:return this._value?w.getColorByIndex(this._value):this._value;default:return}}setRGB(e,t,n){const s=Math.max(0,Math.min(255,Math.round(e))),i=Math.max(0,Math.min(255,Math.round(t))),a=Math.max(0,Math.min(255,Math.round(n)));return this._value=s<<16|i<<8|a,this._colorMethod=o.ByColor,this}setRGBValue(e){return e==null||!Number.isFinite(e)?(console.warn("Invalid RGB value:",e),this):(this._value=e&16777215,this._colorMethod=o.ByColor,this)}setRGBFromCss(e){if(!e)return this;const t=e.trim().toLowerCase();if(t.startsWith("#")){let i=0,a=0,d=0;if(t.length===7)i=parseInt(t.substr(1,2),16),a=parseInt(t.substr(3,2),16),d=parseInt(t.substr(5,2),16);else if(t.length===4)i=parseInt(t[1]+t[1],16),a=parseInt(t[2]+t[2],16),d=parseInt(t[3]+t[3],16);else return console.warn("Invalid hex color:",e),this;return this.setRGB(i,a,d)}const n=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(n){const i=parseInt(n[1],10),a=parseInt(n[2],10),d=parseInt(n[3],10);return this.setRGB(i,a,d)}const s=w.getColorByName(e);return s!==void 0?this.setRGBValue(s):(console.warn("Unknown CSS color string:",e),this)}setScalar(e){return this.setRGB(e,e,e)}get hexColor(){const e=this.RGB;return e==null?void 0:"0x"+e.toString(16).padStart(6,"0").toUpperCase()}get cssColor(){const e=this.RGB;if(e!=null)return`rgb(${e>>16&255},${e>>8&255},${e&255})`}get colorIndex(){return this._colorMethod===o.ByACI?this._value:this._colorMethod===o.ByLayer?256:this._colorMethod===o.ByBlock?0:void 0}set colorIndex(e){if(e==null)return;const t=Math.max(0,Math.min(256,Math.round(e)));t===0?(this._colorMethod=o.ByBlock,this._value=void 0):t===256?(this._colorMethod=o.ByLayer,this._value=void 0):(this._colorMethod=o.ByACI,this._value=t)}get isByColor(){return this._colorMethod===o.ByColor}get isByACI(){return this._colorMethod===o.ByACI}get isByLayer(){return this._colorMethod===o.ByLayer}setByLayer(e){return this._colorMethod=o.ByLayer,e==null?this._value=256:this._value=e,this}get isByBlock(){return this._colorMethod===o.ByBlock}setByBlock(e){return this._colorMethod=o.ByBlock,e==null?this._value=0:this._value=e,this}get colorName(){switch(this._colorMethod){case o.ByLayer:return"ByLayer";case o.ByBlock:return"ByBlock";case o.ByColor:return this._value?w.getNameByColor(this._value):"";case o.ByACI:return this._value?w.getNameByIndex(this._value):"";default:return}}set colorName(e){if(!e)return;const t=w.getColorByName(e);t!==void 0?(this._value=t,this._colorMethod=o.ByColor):console.warn("Unknown color name:",e)}clone(){const e=new _;return e._colorMethod=this._colorMethod,e._value=this._value,e}copy(e){return this._colorMethod=e._colorMethod,this._value=e._value,this}equals(e){return this._colorMethod===e._colorMethod&&this._value===e._value}toString(){switch(this._colorMethod){case o.ByLayer:return"ByLayer";case o.ByBlock:return"ByBlock";case o.ByACI:return this._value!==void 0?String(this._value):"";case o.ByColor:return this._value?`${this.red},${this.green},${this.blue}`:"";default:return""}}static fromString(e){if(!e)return;const t=e.trim();if(/^bylayer$/i.test(t))return new _(o.ByLayer);if(/^byblock$/i.test(t))return new _(o.ByBlock);if(/^\d{1,3},\d{1,3},\d{1,3}$/i.test(t)){const[s,i,a]=t.split(",").map(Number),d=new _(o.ByColor);return d.setRGB(s,i,a),d}if(/^\d+$/.test(t)){const s=parseInt(t,10);return new _(o.ByACI,s)}const n=w.getColorByName(t);if(n!=null)return new _(o.ByColor,n);console.warn("Unknown color name:",e)}}class J{constructor(e=o.ByColor,t=0){this._colorMethod=e,this._value=t}get colorMethd(){return this._colorMethod}get red(){return this._value>>16&255}set red(e){this._colorMethod=o.ByColor,this._value=this._value&65535|(e&255)<<16}get green(){return this._value>>8&255}set green(e){this._colorMethod=o.ByColor,this._value=this._value&16711935|(e&255)<<8}get blue(){return this._value&255}set blue(e){this._colorMethod=o.ByColor,this._value=this._value&16776960|e&255}setRGB(e,t,n){this._colorMethod=o.ByColor,this._value=(e&255)<<16|(t&255)<<8|n&255}get colorIndex(){return this._value}set colorIndex(e){this._colorMethod=o.ByACI,this._value=e}get layerIndex(){return this._value}set layerIndex(e){this._colorMethod=o.ByLayer,this._value=e}isByColor(){return this._colorMethod===o.ByColor}isByLayer(){return this._colorMethod===o.ByLayer}isByBlock(){return this._colorMethod===o.ByBlock}isByACI(){return this._colorMethod===o.ByACI}isNone(){return this._colorMethod===o.None}get rawValue(){return this._value}set rawValue(e){this._value=e}}const X={get ILLEGAL_PARAMETERS(){return new ReferenceError("Illegal Parameters")},get ZERO_DIVISION(){return new Error("Zero division")},get UNRESOLVED_BOUNDARY_CONFLICT(){return new Error("Unresolved boundary conflict in boolean operation")},get INFINITE_LOOP(){return new Error("Infinite loop")},get CANNOT_INVOKE_ABSTRACT_METHOD(){return new Error("Abstract method cannot be invoked")},get OPERATION_IS_NOT_SUPPORTED(){return new Error("Operation is not supported")},get NOT_IMPLEMENTED(){return new Error("Not implemented yet")}};class Q{constructor(){this._listeners={}}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let i=0,a=s.length;i<a;i++)s[i].call(this,e)}}}class T{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}removeEventListener(e){this.listeners=this.listeners.filter(t=>t!==e)}replaceEventListener(e){this.removeEventListener(e),this.addEventListener(e)}dispatch(e,...t){for(const n of this.listeners)n.call(null,e,...t)}}function C(r){return r===null||typeof r!="object"?r:Array.isArray(r)?[...r]:{...r}}function P(r){if(r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r))return r.map(P);const e={};for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=P(r[t]));return e}function q(r,...e){for(const t of e)if(t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&r[n]===void 0&&(r[n]=t[n]);return r}function F(r,e){return r!=null&&Object.prototype.hasOwnProperty.call(r,e)}function j(r){return r==null?!0:Array.isArray(r)||typeof r=="string"?r.length===0:r instanceof Map||r instanceof Set?r.size===0:typeof r=="object"?Object.keys(r).length===0:!1}function b(r,e){if(r===e)return!0;if(r==null||e==null)return r===e;if(typeof r!=typeof e)return!1;if(typeof r!="object")return r===e;if(Array.isArray(r)!==Array.isArray(e))return!1;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(let s=0;s<r.length;s++)if(!b(r[s],e[s]))return!1;return!0}const t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;for(const s of t)if(!Object.prototype.hasOwnProperty.call(e,s)||!b(r[s],e[s]))return!1;return!0}var ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function te(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $={exports:{}};(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(ee,function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},a=null;function d(u,g){var l=u[g];if(typeof l.bind=="function")return l.bind(u);try{return Function.prototype.bind.call(l,u)}catch{return function(){return Function.prototype.apply.apply(l,[u,arguments])}}}function O(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function M(u){return u==="debug"&&(u="log"),typeof console===t?!1:u==="trace"&&n?O:console[u]!==void 0?d(console,u):console.log!==void 0?d(console,"log"):e}function B(){for(var u=this.getLevel(),g=0;g<s.length;g++){var l=s[g];this[l]=g<u?e:this.methodFactory(l,u,this.name)}if(this.log=this.debug,typeof console===t&&u<this.levels.SILENT)return"No console available for logging"}function x(u){return function(){typeof console!==t&&(B.call(this),this[u].apply(this,arguments))}}function p(u,g,l){return M(u)||x.apply(this,arguments)}function K(u,g){var l=this,R,D,k,m="loglevel";typeof u=="string"?m+=":"+u:typeof u=="symbol"&&(m=void 0);function ue(c){var f=(s[c]||"silent").toUpperCase();if(!(typeof window===t||!m)){try{window.localStorage[m]=f;return}catch{}try{window.document.cookie=encodeURIComponent(m)+"="+f+";"}catch{}}}function W(){var c;if(!(typeof window===t||!m)){try{c=window.localStorage[m]}catch{}if(typeof c===t)try{var f=window.document.cookie,N=encodeURIComponent(m),Z=f.indexOf(N+"=");Z!==-1&&(c=/^([^;]+)/.exec(f.slice(Z+N.length+1))[1])}catch{}return l.levels[c]===void 0&&(c=void 0),c}}function ce(){if(!(typeof window===t||!m)){try{window.localStorage.removeItem(m)}catch{}try{window.document.cookie=encodeURIComponent(m)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function A(c){var f=c;if(typeof f=="string"&&l.levels[f.toUpperCase()]!==void 0&&(f=l.levels[f.toUpperCase()]),typeof f=="number"&&f>=0&&f<=l.levels.SILENT)return f;throw new TypeError("log.setLevel() called with invalid level: "+c)}l.name=u,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=g||p,l.getLevel=function(){return k??D??R},l.setLevel=function(c,f){return k=A(c),f!==!1&&ue(k),B.call(l)},l.setDefaultLevel=function(c){D=A(c),W()||l.setLevel(c,!1)},l.resetLevel=function(){k=null,ce(),B.call(l)},l.enableAll=function(c){l.setLevel(l.levels.TRACE,c)},l.disableAll=function(c){l.setLevel(l.levels.SILENT,c)},l.rebuild=function(){if(a!==l&&(R=A(a.getLevel())),B.call(l),a===l)for(var c in i)i[c].rebuild()},R=A(a?a.getLevel():"WARN");var Y=W();Y!=null&&(k=A(Y)),B.call(l)}a=new K,a.getLogger=function(g){if(typeof g!="symbol"&&typeof g!="string"||g==="")throw new TypeError("You must supply a name when creating a logger.");var l=i[g];return l||(l=i[g]=new K(g,a.methodFactory)),l};var he=typeof window!==t?window.log:void 0;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=he),a},a.getLoggers=function(){return i},a.default=a,a})})($);var V=$.exports;const re=E({__proto__:null,default:te(V)},[V]),ne=!0,I=re;I.setLevel("debug");const se=r=>{try{I.setLevel(r)}catch(e){I.setLevel("error"),I.error(e)}};class U{constructor(e,t){this.events={attrChanged:new T,modelChanged:new T},this._changing=!1,this._previousAttributes={},this._pending=!1;const n=e||{};t&&q(n,t),this.attributes=n,this.changed={}}get(e){return this.attributes[e]}set(e,t,n){if(e==null)return this;let s;typeof e=="object"?(s=e,n=t):(s={},s[e]=t),n||(n={});const i=n.unset,a=n.silent,d=[],O=this._changing;this._changing=!0,O||(this._previousAttributes=C(this.attributes),this.changed={});const M=this.attributes,B=this.changed,x=this._previousAttributes;for(const p in s)t=s[p],b(M[p],t)||d.push(p),b(x[p],t)?delete B[p]:B[p]=t,i?delete M[p]:M[p]=t;if(!a){d.length&&(this._pending=n);for(let p=0;p<d.length;p++)this.events.attrChanged.dispatch({object:this,attrName:d[p],attrValue:M[d[p]],options:n})}if(O)return this;if(!a)for(;this._pending;)n=this._pending,this._pending=!1,this.events.modelChanged.dispatch({object:this,options:n});return this._pending=!1,this._changing=!1,this}has(e){return this.get(e)!=null}hasChanged(e){return e==null?!j(this.changed):F(this.changed,e)}changedAttributes(e){if(!e)return this.hasChanged()?C(this.changed):{};const t=this._changing?this._previousAttributes:this.attributes,n={};for(const s in e){const i=e[s];b(t[s],i)||(n[s]=i)}return n}previous(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]}previousAttributes(){return C(this._previousAttributes)}clone(){const e=C(this.attributes);return new U(e)}}class L{constructor(){this.entries=new Map}static getInstance(){return L.instance||(L.instance=new L),L.instance}collect(e){this.entries.set(e.name,e)}printAll(){for(const[e,t]of this.entries)console.log(`${e}:`),console.log(t.format())}clear(){this.entries.clear()}getAll(){return Array.from(this.entries.values())}getEntry(e){return this.entries.get(e)}remove(e){return this.entries.delete(e)}}class oe{static formatBytes(e,t=2){if(e===0)return"0 B";const n=1024,s=Math.max(0,t),i=["B","KB","MB","GB","TB"],a=Math.floor(Math.log(e)/Math.log(n)),d=e/Math.pow(n,a);return`${parseFloat(d.toFixed(s))} ${i[a]}`}}var y=(r=>(r[r.ByLayer=0]="ByLayer",r[r.ByBlock=1]="ByBlock",r[r.ByAlpha=2]="ByAlpha",r[r.ErrorValue=3]="ErrorValue",r))(y||{});class v{constructor(e){e!==void 0?(this._method=y.ByAlpha,this._alpha=v.clampAlpha(e)):(this._method=y.ByLayer,this._alpha=255)}get method(){return this._method}set method(e){this._method=e}get alpha(){return this._alpha}set alpha(e){this._alpha=v.clampAlpha(e),this._method=y.ByAlpha}get percentage(){if(this._method===y.ByAlpha)return Math.round((1-this._alpha/255)*100)}set percentage(e){const t=Math.max(0,Math.min(100,e)),n=Math.round(255*(1-t/100));this.alpha=n}static clampAlpha(e){return Math.max(0,Math.min(255,Math.floor(e)))}get isByAlpha(){return this._method===y.ByAlpha}get isByBlock(){return this._method===y.ByBlock}get isByLayer(){return this._method===y.ByLayer}get isClear(){return this.isByAlpha&&this._alpha===0}get isSolid(){return this.isByAlpha&&this._alpha===255}get isInvalid(){return this._method===y.ErrorValue}serialize(){return this._method<<24|this._alpha}clone(){const e=new v;return e._method=this._method,e._alpha=this._alpha,e}equals(e){return this._method===e._method&&this._alpha===e._alpha}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this._alpha.toString()}static fromString(e){const t=e.trim();if(/^bylayer$/i.test(t)){const i=new v;return i._method=y.ByLayer,i}if(/^byblock$/i.test(t)){const i=new v;return i._method=y.ByBlock,i}const n=Number(t);if(Number.isInteger(n)&&n>=0&&n<=255)return new v(n);const s=new v;return s._method=y.ErrorValue,s}static deserialize(e){const t=e>>>24&255,n=e&255,s=Object.values(y)[t]??y.ErrorValue,i=new v;return i._method=s,i._alpha=v.clampAlpha(n),i}}class ie{constructor(e){this.name=e}run(e){throw new Error("run() must be implemented by subclass")}}class le{constructor(){this.tasks=[],this.onProgress=()=>{},this.onComplete=()=>{},this.onError=()=>!1}scheduleTask(e){return new Promise((t,n)=>{const s=()=>{Promise.resolve(e()).then(t).catch(n)};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(s):setTimeout(s,0)})}addTask(e){this.tasks.push(e)}setProgressCallback(e){this.onProgress=e}setCompleteCallback(e){this.onComplete=e}setErrorCallback(e){this.onError=e}async run(e){const t=this.tasks.length;let n=e;for(let s=0;s<t;s++){const i=this.tasks[s];try{n=await this.scheduleTask(async()=>{const a=await i.run(n);return this.onProgress((s+1)/t,i),a})}catch(a){if(this.onError({error:a,taskIndex:s,task:i}))break}}this.onComplete(n)}}class z{constructor(e,t,n){this.isLoading=!1,this.itemsLoaded=0,this.itemsTotal=0,this.urlModifier=void 0,this.handlers=[],this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n}itemStart(e){this.itemsTotal++,this.isLoading===!1&&this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,n=this.handlers.length;t<n;t+=2){const s=this.handlers[t],i=this.handlers[t+1];if(s.global&&(s.lastIndex=0),s.test(e))return i}return null}}const H=new z;class ae{constructor(e){this.manager=e!==void 0?e:H,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}loadAsync(e,t){return new Promise((n,s)=>{this.load(e,n,t,s)})}parse(e){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}h.AcCmColor=_,h.AcCmColorMethod=o,h.AcCmColorUtil=w,h.AcCmEntityColor=J,h.AcCmErrors=X,h.AcCmEventDispatcher=Q,h.AcCmEventManager=T,h.AcCmLoader=ae,h.AcCmLoadingManager=z,h.AcCmObject=U,h.AcCmPerformanceCollector=L,h.AcCmTask=ie,h.AcCmTaskScheduler=le,h.AcCmTransparency=v,h.AcCmTransparencyMethod=y,h.AcTrStringUtil=oe,h.DEBUG_MODE=ne,h.DefaultLoadingManager=H,h.clone=C,h.deepClone=P,h.defaults=q,h.has=F,h.isEmpty=j,h.isEqual=b,h.log=I,h.setLogLevel=se,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(h,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(h=typeof globalThis<"u"?globalThis:h||self,E(h.common={}))})(this,function(h){"use strict";function E(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in r)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var o=(r=>(r[r.ByColor=1]="ByColor",r[r.ByACI=2]="ByACI",r[r.ByLayer=3]="ByLayer",r[r.ByBlock=4]="ByBlock",r[r.None=0]="None",r))(o||{});const G={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},S=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];class w{static getColorByIndex(e){return S[e]}static getIndexByColor(e){const t=S.length-1;for(let n=1;n<t;++n)if(S[n]===e)return n}static getColorByName(e){return G[e.toLowerCase()]}static getNameByColor(e){for(const[t,n]of Object.entries(G))if(n===e)return t}static getNameByIndex(e){const t=this.getColorByIndex(e);return this.getNameByColor(t)}}class _{constructor(e=o.ByLayer,t){this._colorMethod=e,this._colorMethod==o.ByColor&&t==null?this._value=16777215:this._colorMethod==o.ByACI?t==null?this._value=8:t===0?this._colorMethod=o.ByBlock:t===256?this._colorMethod=o.ByLayer:this._value=Math.max(0,Math.min(t,256)):this._value=t}get colorMethod(){return this._colorMethod}set colorMethod(e){this._colorMethod=e}get red(){const e=this.RGB;return e!=null?e>>16&255:void 0}get green(){const e=this.RGB;return e!=null?e>>8&255:void 0}get blue(){const e=this.RGB;return e!=null?e&255:void 0}get RGB(){switch(this._colorMethod){case o.ByColor:case o.ByBlock:case o.ByLayer:return this._value;case o.ByACI:return this._value?w.getColorByIndex(this._value):this._value;default:return}}setRGB(e,t,n){const s=Math.max(0,Math.min(255,Math.round(e))),i=Math.max(0,Math.min(255,Math.round(t))),l=Math.max(0,Math.min(255,Math.round(n)));return this._value=s<<16|i<<8|l,this._colorMethod=o.ByColor,this}setRGBValue(e){return e==null||!Number.isFinite(e)?(console.warn("Invalid RGB value:",e),this):(this._value=e&16777215,this._colorMethod=o.ByColor,this)}setRGBFromCss(e){if(!e)return this;const t=e.trim().toLowerCase();if(t.startsWith("#")){let i=0,l=0,d=0;if(t.length===7)i=parseInt(t.substr(1,2),16),l=parseInt(t.substr(3,2),16),d=parseInt(t.substr(5,2),16);else if(t.length===4)i=parseInt(t[1]+t[1],16),l=parseInt(t[2]+t[2],16),d=parseInt(t[3]+t[3],16);else return console.warn("Invalid hex color:",e),this;return this.setRGB(i,l,d)}const n=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(n){const i=parseInt(n[1],10),l=parseInt(n[2],10),d=parseInt(n[3],10);return this.setRGB(i,l,d)}const s=w.getColorByName(e);return s!==void 0?this.setRGBValue(s):(console.warn("Unknown CSS color string:",e),this)}setScalar(e){return this.setRGB(e,e,e)}get hexColor(){const e=this.RGB;return e==null?void 0:"0x"+e.toString(16).padStart(6,"0").toUpperCase()}get cssColor(){const e=this.RGB;if(e!=null)return`rgb(${e>>16&255},${e>>8&255},${e&255})`}get colorIndex(){return this._colorMethod===o.ByACI?this._value:this._colorMethod===o.ByLayer?256:this._colorMethod===o.ByBlock?0:void 0}set colorIndex(e){if(e==null)return;const t=Math.max(0,Math.min(256,Math.round(e)));t===0?(this._colorMethod=o.ByBlock,this._value=void 0):t===256?(this._colorMethod=o.ByLayer,this._value=void 0):(this._colorMethod=o.ByACI,this._value=t)}get isByColor(){return this._colorMethod===o.ByColor}get isByACI(){return this._colorMethod===o.ByACI}get isByLayer(){return this._colorMethod===o.ByLayer}setByLayer(e){return this._colorMethod=o.ByLayer,e==null?this._value=256:this._value=e,this}get isByBlock(){return this._colorMethod===o.ByBlock}setByBlock(e){return this._colorMethod=o.ByBlock,e==null?this._value=0:this._value=e,this}get colorName(){switch(this._colorMethod){case o.ByLayer:return"ByLayer";case o.ByBlock:return"ByBlock";case o.ByColor:return this._value?w.getNameByColor(this._value):"";case o.ByACI:return this._value?w.getNameByIndex(this._value):"";default:return}}set colorName(e){if(!e)return;const t=w.getColorByName(e);t!==void 0?(this._value=t,this._colorMethod=o.ByColor):console.warn("Unknown color name:",e)}clone(){const e=new _;return e._colorMethod=this._colorMethod,e._value=this._value,e}copy(e){return this._colorMethod=e._colorMethod,this._value=e._value,this}equals(e){return this._colorMethod===e._colorMethod&&this._value===e._value}toString(){switch(this._colorMethod){case o.ByLayer:return"ByLayer";case o.ByBlock:return"ByBlock";case o.ByACI:return this._value!==void 0?String(this._value):"";case o.ByColor:return this._value?`${this.red},${this.green},${this.blue}`:"";default:return""}}static fromString(e){if(!e)return;const t=e.trim();if(/^bylayer$/i.test(t))return new _(o.ByLayer);if(/^byblock$/i.test(t))return new _(o.ByBlock);if(/^\d{1,3},\d{1,3},\d{1,3}$/i.test(t)){const[s,i,l]=t.split(",").map(Number),d=new _(o.ByColor);return d.setRGB(s,i,l),d}if(/^\d+$/.test(t)){const s=parseInt(t,10);return new _(o.ByACI,s)}const n=w.getColorByName(t);if(n!=null)return new _(o.ByColor,n);console.warn("Unknown color name:",e)}}class J{constructor(e=o.ByColor,t=0){this._colorMethod=e,this._value=t}get colorMethd(){return this._colorMethod}get red(){return this._value>>16&255}set red(e){this._colorMethod=o.ByColor,this._value=this._value&65535|(e&255)<<16}get green(){return this._value>>8&255}set green(e){this._colorMethod=o.ByColor,this._value=this._value&16711935|(e&255)<<8}get blue(){return this._value&255}set blue(e){this._colorMethod=o.ByColor,this._value=this._value&16776960|e&255}setRGB(e,t,n){this._colorMethod=o.ByColor,this._value=(e&255)<<16|(t&255)<<8|n&255}get colorIndex(){return this._value}set colorIndex(e){this._colorMethod=o.ByACI,this._value=e}get layerIndex(){return this._value}set layerIndex(e){this._colorMethod=o.ByLayer,this._value=e}isByColor(){return this._colorMethod===o.ByColor}isByLayer(){return this._colorMethod===o.ByLayer}isByBlock(){return this._colorMethod===o.ByBlock}isByACI(){return this._colorMethod===o.ByACI}isNone(){return this._colorMethod===o.None}get rawValue(){return this._value}set rawValue(e){this._value=e}}const X={get ILLEGAL_PARAMETERS(){return new ReferenceError("Illegal Parameters")},get ZERO_DIVISION(){return new Error("Zero division")},get UNRESOLVED_BOUNDARY_CONFLICT(){return new Error("Unresolved boundary conflict in boolean operation")},get INFINITE_LOOP(){return new Error("Infinite loop")},get CANNOT_INVOKE_ABSTRACT_METHOD(){return new Error("Abstract method cannot be invoked")},get OPERATION_IS_NOT_SUPPORTED(){return new Error("Operation is not supported")},get NOT_IMPLEMENTED(){return new Error("Not implemented yet")}};class Q{constructor(){this._listeners={}}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let i=0,l=s.length;i<l;i++)s[i].call(this,e)}}}class T{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}removeEventListener(e){this.listeners=this.listeners.filter(t=>t!==e)}replaceEventListener(e){this.removeEventListener(e),this.addEventListener(e)}dispatch(e,...t){for(const n of this.listeners)n.call(null,e,...t)}}function C(r){return r===null||typeof r!="object"?r:Array.isArray(r)?[...r]:{...r}}function P(r){if(r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r))return r.map(P);const e={};for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=P(r[t]));return e}function j(r,...e){for(const t of e)if(t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&r[n]===void 0&&(r[n]=t[n]);return r}function q(r,e){return r!=null&&Object.prototype.hasOwnProperty.call(r,e)}function F(r){return r==null?!0:Array.isArray(r)||typeof r=="string"?r.length===0:r instanceof Map||r instanceof Set?r.size===0:typeof r=="object"?Object.keys(r).length===0:!1}function b(r,e){if(r===e)return!0;if(r==null||e==null)return r===e;if(typeof r!=typeof e)return!1;if(typeof r!="object")return r===e;if(Array.isArray(r)!==Array.isArray(e))return!1;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(let s=0;s<r.length;s++)if(!b(r[s],e[s]))return!1;return!0}const t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;for(const s of t)if(!Object.prototype.hasOwnProperty.call(e,s)||!b(r[s],e[s]))return!1;return!0}var ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function te(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $={exports:{}};(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(ee,function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},l=null;function d(u,g){var a=u[g];if(typeof a.bind=="function")return a.bind(u);try{return Function.prototype.bind.call(a,u)}catch{return function(){return Function.prototype.apply.apply(a,[u,arguments])}}}function O(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function M(u){return u==="debug"&&(u="log"),typeof console===t?!1:u==="trace"&&n?O:console[u]!==void 0?d(console,u):console.log!==void 0?d(console,"log"):e}function B(){for(var u=this.getLevel(),g=0;g<s.length;g++){var a=s[g];this[a]=g<u?e:this.methodFactory(a,u,this.name)}if(this.log=this.debug,typeof console===t&&u<this.levels.SILENT)return"No console available for logging"}function x(u){return function(){typeof console!==t&&(B.call(this),this[u].apply(this,arguments))}}function p(u,g,a){return M(u)||x.apply(this,arguments)}function K(u,g){var a=this,R,D,k,m="loglevel";typeof u=="string"?m+=":"+u:typeof u=="symbol"&&(m=void 0);function ue(c){var f=(s[c]||"silent").toUpperCase();if(!(typeof window===t||!m)){try{window.localStorage[m]=f;return}catch{}try{window.document.cookie=encodeURIComponent(m)+"="+f+";"}catch{}}}function W(){var c;if(!(typeof window===t||!m)){try{c=window.localStorage[m]}catch{}if(typeof c===t)try{var f=window.document.cookie,N=encodeURIComponent(m),Z=f.indexOf(N+"=");Z!==-1&&(c=/^([^;]+)/.exec(f.slice(Z+N.length+1))[1])}catch{}return a.levels[c]===void 0&&(c=void 0),c}}function ce(){if(!(typeof window===t||!m)){try{window.localStorage.removeItem(m)}catch{}try{window.document.cookie=encodeURIComponent(m)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function A(c){var f=c;if(typeof f=="string"&&a.levels[f.toUpperCase()]!==void 0&&(f=a.levels[f.toUpperCase()]),typeof f=="number"&&f>=0&&f<=a.levels.SILENT)return f;throw new TypeError("log.setLevel() called with invalid level: "+c)}a.name=u,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=g||p,a.getLevel=function(){return k??D??R},a.setLevel=function(c,f){return k=A(c),f!==!1&&ue(k),B.call(a)},a.setDefaultLevel=function(c){D=A(c),W()||a.setLevel(c,!1)},a.resetLevel=function(){k=null,ce(),B.call(a)},a.enableAll=function(c){a.setLevel(a.levels.TRACE,c)},a.disableAll=function(c){a.setLevel(a.levels.SILENT,c)},a.rebuild=function(){if(l!==a&&(R=A(l.getLevel())),B.call(a),l===a)for(var c in i)i[c].rebuild()},R=A(l?l.getLevel():"WARN");var Y=W();Y!=null&&(k=A(Y)),B.call(a)}l=new K,l.getLogger=function(g){if(typeof g!="symbol"&&typeof g!="string"||g==="")throw new TypeError("You must supply a name when creating a logger.");var a=i[g];return a||(a=i[g]=new K(g,l.methodFactory)),a};var he=typeof window!==t?window.log:void 0;return l.noConflict=function(){return typeof window!==t&&window.log===l&&(window.log=he),l},l.getLoggers=function(){return i},l.default=l,l})})($);var V=$.exports;const re=E({__proto__:null,default:te(V)},[V]),ne=!0,I=re;I.setLevel("debug");const se=r=>{try{I.setLevel(r)}catch(e){I.setLevel("error"),I.error(e)}};class U{constructor(e,t){this.events={attrChanged:new T,modelChanged:new T},this._changing=!1,this._previousAttributes={},this._pending=!1;const n=e||{};t&&j(n,t),this.attributes=n,this.changed={}}get(e){return this.attributes[e]}set(e,t,n){if(e==null)return this;let s;typeof e=="object"?(s=e,n=t):(s={},s[e]=t),n||(n={});const i=n.unset,l=n.silent,d=[],O=this._changing;this._changing=!0,O||(this._previousAttributes=C(this.attributes),this.changed={});const M=this.attributes,B=this.changed,x=this._previousAttributes;for(const p in s)t=s[p],b(M[p],t)||d.push(p),b(x[p],t)?delete B[p]:B[p]=t,i?delete M[p]:M[p]=t;if(!l){d.length&&(this._pending=n);for(let p=0;p<d.length;p++)this.events.attrChanged.dispatch({object:this,attrName:d[p],attrValue:M[d[p]],options:n})}if(O)return this;if(!l)for(;this._pending;)n=this._pending,this._pending=!1,this.events.modelChanged.dispatch({object:this,options:n});return this._pending=!1,this._changing=!1,this}has(e){return this.get(e)!=null}hasChanged(e){return e==null?!F(this.changed):q(this.changed,e)}changedAttributes(e){if(!e)return this.hasChanged()?C(this.changed):{};const t=this._changing?this._previousAttributes:this.attributes,n={};for(const s in e){const i=e[s];b(t[s],i)||(n[s]=i)}return n}previous(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]}previousAttributes(){return C(this._previousAttributes)}clone(){const e=C(this.attributes);return new U(e)}}class L{constructor(){this.entries=new Map}static getInstance(){return L.instance||(L.instance=new L),L.instance}collect(e){this.entries.set(e.name,e)}printAll(){for(const[e,t]of this.entries)console.log(`${e}:`),console.log(t.format())}clear(){this.entries.clear()}getAll(){return Array.from(this.entries.values())}getEntry(e){return this.entries.get(e)}remove(e){return this.entries.delete(e)}}class oe{static formatBytes(e,t=2){if(e===0)return"0 B";const n=1024,s=Math.max(0,t),i=["B","KB","MB","GB","TB"],l=Math.floor(Math.log(e)/Math.log(n)),d=e/Math.pow(n,l);return`${parseFloat(d.toFixed(s))} ${i[l]}`}}var y=(r=>(r[r.ByLayer=0]="ByLayer",r[r.ByBlock=1]="ByBlock",r[r.ByAlpha=2]="ByAlpha",r[r.ErrorValue=3]="ErrorValue",r))(y||{});class v{constructor(e){e!==void 0?(this._method=y.ByAlpha,this._alpha=v.clampAlpha(e)):(this._method=y.ByLayer,this._alpha=255)}get method(){return this._method}set method(e){this._method=e}get alpha(){return this._alpha}set alpha(e){this._alpha=v.clampAlpha(e),this._method=y.ByAlpha}get percentage(){if(this._method===y.ByAlpha)return Math.round((1-this._alpha/255)*100)}set percentage(e){const t=Math.max(0,Math.min(100,e)),n=Math.round(255*(1-t/100));this.alpha=n}static clampAlpha(e){return Math.max(0,Math.min(255,Math.floor(e)))}get isByAlpha(){return this._method===y.ByAlpha}get isByBlock(){return this._method===y.ByBlock}get isByLayer(){return this._method===y.ByLayer}get isClear(){return this.isByAlpha&&this._alpha===0}get isSolid(){return this.isByAlpha&&this._alpha===255}get isInvalid(){return this._method===y.ErrorValue}serialize(){return this._method<<24|this._alpha}clone(){const e=new v;return e._method=this._method,e._alpha=this._alpha,e}equals(e){return this._method===e._method&&this._alpha===e._alpha}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this._alpha.toString()}static fromString(e){const t=e.trim();if(/^bylayer$/i.test(t)){const i=new v;return i._method=y.ByLayer,i}if(/^byblock$/i.test(t)){const i=new v;return i._method=y.ByBlock,i}const n=Number(t);if(Number.isInteger(n)&&n>=0&&n<=255)return new v(n);const s=new v;return s._method=y.ErrorValue,s}static deserialize(e){const t=e>>>24&255,n=e&255,s=Object.values(y)[t]??y.ErrorValue,i=new v;return i._method=s,i._alpha=v.clampAlpha(n),i}}class ie{constructor(e){this.name=e}run(e){throw new Error("run() must be implemented by subclass")}}class le{constructor(){this.tasks=[],this.onProgress=()=>{},this.onComplete=()=>{},this.onError=()=>!1}scheduleTask(e){return new Promise((t,n)=>{const s=()=>{Promise.resolve(e()).then(t).catch(n)};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(s):setTimeout(s,0)})}addTask(e){this.tasks.push(e)}setProgressCallback(e){this.onProgress=e}setCompleteCallback(e){this.onComplete=e}setErrorCallback(e){this.onError=e}async run(e){const t=this.tasks.length;let n=e;for(let s=0;s<t;s++){const i=this.tasks[s];try{n=await this.scheduleTask(async()=>{const l=await i.run(n);return this.onProgress((s+1)/t,i),l})}catch(l){if(this.onError({error:l,taskIndex:s,task:i}))return Promise.reject(l)}}this.onComplete(n)}}class z{constructor(e,t,n){this.isLoading=!1,this.itemsLoaded=0,this.itemsTotal=0,this.urlModifier=void 0,this.handlers=[],this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n}itemStart(e){this.itemsTotal++,this.isLoading===!1&&this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,n=this.handlers.length;t<n;t+=2){const s=this.handlers[t],i=this.handlers[t+1];if(s.global&&(s.lastIndex=0),s.test(e))return i}return null}}const H=new z;class ae{constructor(e){this.manager=e!==void 0?e:H,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}loadAsync(e,t){return new Promise((n,s)=>{this.load(e,n,t,s)})}parse(e){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}h.AcCmColor=_,h.AcCmColorMethod=o,h.AcCmColorUtil=w,h.AcCmEntityColor=J,h.AcCmErrors=X,h.AcCmEventDispatcher=Q,h.AcCmEventManager=T,h.AcCmLoader=ae,h.AcCmLoadingManager=z,h.AcCmObject=U,h.AcCmPerformanceCollector=L,h.AcCmTask=ie,h.AcCmTaskScheduler=le,h.AcCmTransparency=v,h.AcCmTransparencyMethod=y,h.AcTrStringUtil=oe,h.DEBUG_MODE=ne,h.DefaultLoadingManager=H,h.clone=C,h.deepClone=P,h.defaults=j,h.has=q,h.isEmpty=F,h.isEqual=b,h.log=I,h.setLogLevel=se,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|
package/lib/AcCmTaskScheduler.js
CHANGED
|
@@ -222,7 +222,7 @@ var AcCmTaskScheduler = /** @class */ (function () {
|
|
|
222
222
|
error_1 = _b.sent();
|
|
223
223
|
shouldInterrupt = this_1.onError({ error: error_1, taskIndex: i, task: task });
|
|
224
224
|
if (shouldInterrupt) {
|
|
225
|
-
return [2 /*return*/,
|
|
225
|
+
return [2 /*return*/, { value: Promise.reject(error_1) }];
|
|
226
226
|
}
|
|
227
227
|
return [3 /*break*/, 4];
|
|
228
228
|
case 4: return [2 /*return*/];
|
|
@@ -237,8 +237,8 @@ var AcCmTaskScheduler = /** @class */ (function () {
|
|
|
237
237
|
return [5 /*yield**/, _loop_1(i)];
|
|
238
238
|
case 2:
|
|
239
239
|
state_1 = _a.sent();
|
|
240
|
-
if (state_1 === "
|
|
241
|
-
return [
|
|
240
|
+
if (typeof state_1 === "object")
|
|
241
|
+
return [2 /*return*/, state_1.value];
|
|
242
242
|
_a.label = 3;
|
|
243
243
|
case 3:
|
|
244
244
|
i++;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcCmTaskScheduler.js","sourceRoot":"","sources":["../src/AcCmTaskScheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAME;;;;OAIG;IACH,kBAAY,IAAY;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED;;;;;;;;;OASG;IACH,sBAAG,GAAH,UAAI,MAAW;QACb,MAAM,IAAI,K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