@visactor/vrender 0.21.12-alpha.2 → 0.21.12-alpha.4

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 CHANGED
@@ -496,20 +496,14 @@
496
496
  }
497
497
  }
498
498
  function bindContributionProvider(bind, id) {
499
- bind(ContributionProvider).toDynamicValue(_ref => {
500
- let {
501
- container: container
502
- } = _ref;
503
- return new ContributionProviderCache(id, container);
504
- }).inSingletonScope().whenTargetNamed(id);
499
+ bind(ContributionProvider).toDynamicValue(({
500
+ container: container
501
+ }) => new ContributionProviderCache(id, container)).inSingletonScope().whenTargetNamed(id);
505
502
  }
506
503
  function bindContributionProviderNoSingletonScope(bind, id) {
507
- bind(ContributionProvider).toDynamicValue(_ref2 => {
508
- let {
509
- container: container
510
- } = _ref2;
511
- return new ContributionProviderCache(id, container);
512
- }).whenTargetNamed(id);
504
+ bind(ContributionProvider).toDynamicValue(({
505
+ container: container
506
+ }) => new ContributionProviderCache(id, container)).whenTargetNamed(id);
513
507
  }
514
508
 
515
509
  class Hook {
@@ -565,10 +559,7 @@
565
559
  }
566
560
 
567
561
  class SyncHook extends Hook {
568
- call() {
569
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
570
- args[_key] = arguments[_key];
571
- }
562
+ call(...args) {
572
563
  this.taps.map(t => t.fn).forEach(cb => cb(...args));
573
564
  }
574
565
  }
@@ -770,16 +761,13 @@
770
761
  updateDom(dom, params) {
771
762
  return this._env || this.setEnv("browser"), this.envContribution.updateDom(dom, params);
772
763
  }
773
- getElementTop(dom) {
774
- let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
764
+ getElementTop(dom, baseWindow = !1) {
775
765
  return this._env || this.setEnv("browser"), this.envContribution.getElementTop(dom, baseWindow);
776
766
  }
777
- getElementLeft(dom) {
778
- let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
767
+ getElementLeft(dom, baseWindow = !1) {
779
768
  return this._env || this.setEnv("browser"), this.envContribution.getElementLeft(dom, baseWindow);
780
769
  }
781
- getElementTopLeft(dom) {
782
- let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
770
+ getElementTopLeft(dom, baseWindow = !1) {
783
771
  return this._env || this.setEnv("browser"), this.envContribution.getElementTopLeft(dom, baseWindow);
784
772
  }
785
773
  };
@@ -1116,10 +1104,7 @@
1116
1104
  const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
1117
1105
  var isType$1 = isType;
1118
1106
 
1119
- const isBoolean = function (value) {
1120
- let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
1121
- return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
1122
- };
1107
+ const isBoolean = (value, fuzzy = !1) => fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
1123
1108
  var isBoolean$1 = isBoolean;
1124
1109
 
1125
1110
  const isFunction = value => "function" == typeof value;
@@ -1152,8 +1137,7 @@
1152
1137
  const isUndefined = value => void 0 === value;
1153
1138
  var isUndefined$1 = isUndefined;
1154
1139
 
1155
- const isString = function (value) {
1156
- let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
1140
+ const isString = (value, fuzzy = !1) => {
1157
1141
  const type = typeof value;
1158
1142
  return fuzzy ? "string" === type : "string" === type || isType$1(value, "String");
1159
1143
  };
@@ -1167,8 +1151,7 @@
1167
1151
  };
1168
1152
  var isArrayLike$1 = isArrayLike;
1169
1153
 
1170
- const isNumber = function (value) {
1171
- let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
1154
+ const isNumber = (value, fuzzy = !1) => {
1172
1155
  const type = typeof value;
1173
1156
  return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
1174
1157
  };
@@ -1187,9 +1170,7 @@
1187
1170
  has = (object, key) => null != object && hasOwnProperty.call(object, key);
1188
1171
  var has$1 = has;
1189
1172
 
1190
- function baseMerge(target, source) {
1191
- let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
1192
- let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
1173
+ function baseMerge(target, source, shallowArray = !1, skipTargetArray = !1) {
1193
1174
  if (source) {
1194
1175
  if (target === source) return;
1195
1176
  if (isValid$1(source) && "object" == typeof source) {
@@ -1207,9 +1188,7 @@
1207
1188
  }
1208
1189
  }
1209
1190
  }
1210
- function baseMergeDeep(target, source, key) {
1211
- let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
1212
- let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
1191
+ function baseMergeDeep(target, source, key, shallowArray = !1, skipTargetArray = !1) {
1213
1192
  const objValue = target[key],
1214
1193
  srcValue = source[key];
1215
1194
  let newValue = source[key],
@@ -1230,11 +1209,11 @@
1230
1209
  function eq(value, other) {
1231
1210
  return value === other || Number.isNaN(value) && Number.isNaN(other);
1232
1211
  }
1233
- function merge(target) {
1212
+ function merge(target, ...sources) {
1234
1213
  let sourceIndex = -1;
1235
- const length = arguments.length <= 1 ? 0 : arguments.length - 1;
1214
+ const length = sources.length;
1236
1215
  for (; ++sourceIndex < length;) {
1237
- baseMerge(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
1216
+ baseMerge(target, sources[sourceIndex], !0);
1238
1217
  }
1239
1218
  return target;
1240
1219
  }
@@ -1268,9 +1247,7 @@
1268
1247
  static clearInstance() {
1269
1248
  Logger._instance = null;
1270
1249
  }
1271
- constructor() {
1272
- let level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LoggerLevel.None;
1273
- let method = arguments.length > 1 ? arguments[1] : undefined;
1250
+ constructor(level = LoggerLevel.None, method) {
1274
1251
  this._onErrorHandler = [], this._level = level, this._method = method;
1275
1252
  }
1276
1253
  addErrorHandler(handler) {
@@ -1280,10 +1257,7 @@
1280
1257
  const index = this._onErrorHandler.findIndex(h => h === handler);
1281
1258
  index < 0 || this._onErrorHandler.splice(index, 1);
1282
1259
  }
1283
- callErrorHandler() {
1284
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1285
- args[_key] = arguments[_key];
1286
- }
1260
+ callErrorHandler(...args) {
1287
1261
  this._onErrorHandler.forEach(h => h(...args));
1288
1262
  }
1289
1263
  canLogInfo() {
@@ -1301,29 +1275,17 @@
1301
1275
  level(levelValue) {
1302
1276
  return arguments.length ? (this._level = +levelValue, this) : this._level;
1303
1277
  }
1304
- error() {
1278
+ error(...args) {
1305
1279
  var _a;
1306
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1307
- args[_key2] = arguments[_key2];
1308
- }
1309
1280
  return this._level >= LoggerLevel.Error && (this._onErrorHandler.length ? this.callErrorHandler(...args) : log(null !== (_a = this._method) && void 0 !== _a ? _a : "error", "ERROR", args)), this;
1310
1281
  }
1311
- warn() {
1312
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1313
- args[_key3] = arguments[_key3];
1314
- }
1282
+ warn(...args) {
1315
1283
  return this._level >= LoggerLevel.Warn && log(this._method || "warn", "WARN", args), this;
1316
1284
  }
1317
- info() {
1318
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1319
- args[_key4] = arguments[_key4];
1320
- }
1285
+ info(...args) {
1321
1286
  return this._level >= LoggerLevel.Info && log(this._method || "log", "INFO", args), this;
1322
1287
  }
1323
- debug() {
1324
- for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
1325
- args[_key5] = arguments[_key5];
1326
- }
1288
+ debug(...args) {
1327
1289
  return this._level >= LoggerLevel.Debug && log(this._method || "log", "DEBUG", args), this;
1328
1290
  }
1329
1291
  }
@@ -1331,9 +1293,7 @@
1331
1293
 
1332
1294
  const DEFAULT_ABSOLUTE_TOLERATE = 1e-10,
1333
1295
  DEFAULT_RELATIVE_TOLERATE = 1e-10;
1334
- function isNumberClose(a, b) {
1335
- let relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_RELATIVE_TOLERATE;
1336
- let absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_ABSOLUTE_TOLERATE;
1296
+ function isNumberClose(a, b, relTol = DEFAULT_RELATIVE_TOLERATE, absTol = DEFAULT_ABSOLUTE_TOLERATE) {
1337
1297
  const abs = absTol,
1338
1298
  rel = relTol * Math.max(a, b);
1339
1299
  return Math.abs(a - b) <= Math.max(abs, rel);
@@ -1384,11 +1344,7 @@
1384
1344
  }
1385
1345
 
1386
1346
  class Point {
1387
- constructor() {
1388
- let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1389
- let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1390
- let x1 = arguments.length > 2 ? arguments[2] : undefined;
1391
- let y1 = arguments.length > 3 ? arguments[3] : undefined;
1347
+ constructor(x = 0, y = 0, x1, y1) {
1392
1348
  this.x = 0, this.y = 0, this.x = x, this.y = y, this.x1 = x1, this.y1 = y1;
1393
1349
  }
1394
1350
  clone() {
@@ -1434,8 +1390,7 @@
1434
1390
  function radianToDegree(radian) {
1435
1391
  return 180 * radian / Math.PI;
1436
1392
  }
1437
- const clampRadian = function () {
1438
- let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1393
+ const clampRadian = (angle = 0) => {
1439
1394
  if (angle < 0) for (; angle < -tau;) angle += tau;else if (angle > 0) for (; angle > tau;) angle -= tau;
1440
1395
  return angle;
1441
1396
  };
@@ -1533,15 +1488,13 @@
1533
1488
  function getProjectionRadius(checkAxis, axis) {
1534
1489
  return Math.abs(axis[0] * checkAxis[0] + axis[1] * checkAxis[1]);
1535
1490
  }
1536
- function rotatePoint(_ref, rad) {
1537
- let {
1538
- x: x,
1539
- y: y
1540
- } = _ref;
1541
- let origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
1542
- x: 0,
1543
- y: 0
1544
- };
1491
+ function rotatePoint({
1492
+ x: x,
1493
+ y: y
1494
+ }, rad, origin = {
1495
+ x: 0,
1496
+ y: 0
1497
+ }) {
1545
1498
  return {
1546
1499
  x: (x - origin.x) * Math.cos(rad) - (y - origin.y) * Math.sin(rad) + origin.x,
1547
1500
  y: (x - origin.x) * Math.sin(rad) + (y - origin.y) * Math.cos(rad) + origin.y
@@ -1570,8 +1523,7 @@
1570
1523
  y: box.y2
1571
1524
  }, deg, cp)];
1572
1525
  }
1573
- function isRotateAABBIntersect(box1, box2) {
1574
- let isDeg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
1526
+ function isRotateAABBIntersect(box1, box2, isDeg = !1) {
1575
1527
  const rect1 = toRect(box1, isDeg),
1576
1528
  rect2 = toRect(box2, isDeg),
1577
1529
  vector = (start, end) => [end.x - start.x, end.y - start.y],
@@ -1609,9 +1561,7 @@
1609
1561
  return 55296 <= x && x <= 56319 && 56320 <= y && y <= 57343 && (x &= 1023, y &= 1023, codePoint = x << 10 | y, codePoint += 65536), 12288 === codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : 8361 === codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 === codePoint || 175 === codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : 161 === codePoint || 164 === codePoint || 167 <= codePoint && codePoint <= 168 || 170 === codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 === codePoint || 208 === codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 === codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 === codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 === codePoint || 254 === codePoint || 257 === codePoint || 273 === codePoint || 275 === codePoint || 283 === codePoint || 294 <= codePoint && codePoint <= 295 || 299 === codePoint || 305 <= codePoint && codePoint <= 307 || 312 === codePoint || 319 <= codePoint && codePoint <= 322 || 324 === codePoint || 328 <= codePoint && codePoint <= 331 || 333 === codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 === codePoint || 462 === codePoint || 464 === codePoint || 466 === codePoint || 468 === codePoint || 470 === codePoint || 472 === codePoint || 474 === codePoint || 476 === codePoint || 593 === codePoint || 609 === codePoint || 708 === codePoint || 711 === codePoint || 713 <= codePoint && codePoint <= 715 || 717 === codePoint || 720 === codePoint || 728 <= codePoint && codePoint <= 731 || 733 === codePoint || 735 === codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 === codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 === codePoint || 8208 === codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 === codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 === codePoint || 8251 === codePoint || 8254 === codePoint || 8308 === codePoint || 8319 === codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 === codePoint || 8451 === codePoint || 8453 === codePoint || 8457 === codePoint || 8467 === codePoint || 8470 === codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 === codePoint || 8491 === codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 === codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 === codePoint || 8660 === codePoint || 8679 === codePoint || 8704 === codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 === codePoint || 8719 === codePoint || 8721 === codePoint || 8725 === codePoint || 8730 === codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 === codePoint || 8741 === codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 === codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 === codePoint || 8780 === codePoint || 8786 === codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 === codePoint || 8857 === codePoint || 8869 === codePoint || 8895 === codePoint || 8978 === codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 === codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 === codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 === codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 === codePoint || 9758 === codePoint || 9792 === codePoint || 9794 === codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 === codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 === codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 === codePoint || 10071 === codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 === codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109 ? "A" : "N";
1610
1562
  };
1611
1563
 
1612
- function getContextFont(text) {
1613
- let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1614
- let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
1564
+ function getContextFont(text, defaultAttr = {}, fontSizeScale) {
1615
1565
  fontSizeScale || (fontSizeScale = 1);
1616
1566
  const {
1617
1567
  fontStyle = defaultAttr.fontStyle,
@@ -1906,49 +1856,29 @@
1906
1856
  equals(b) {
1907
1857
  return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
1908
1858
  }
1909
- setValue() {
1910
- let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1911
- let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1912
- let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1913
- let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
1859
+ setValue(x1 = 0, y1 = 0, x2 = 0, y2 = 0) {
1914
1860
  return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
1915
1861
  }
1916
- set() {
1917
- let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1918
- let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1919
- let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1920
- let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
1862
+ set(x1 = 0, y1 = 0, x2 = 0, y2 = 0) {
1921
1863
  return x2 < x1 ? (this.x2 = x1, this.x1 = x2) : (this.x1 = x1, this.x2 = x2), y2 < y1 ? (this.y2 = y1, this.y1 = y2) : (this.y1 = y1, this.y2 = y2), this;
1922
1864
  }
1923
- add() {
1924
- let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1925
- let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1865
+ add(x = 0, y = 0) {
1926
1866
  return x < this.x1 && (this.x1 = x), y < this.y1 && (this.y1 = y), x > this.x2 && (this.x2 = x), y > this.y2 && (this.y2 = y), this;
1927
1867
  }
1928
- expand() {
1929
- let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1868
+ expand(d = 0) {
1930
1869
  return isArray$1(d) ? (this.y1 -= d[0], this.x2 += d[1], this.y2 += d[2], this.x1 -= d[3]) : (this.x1 -= d, this.y1 -= d, this.x2 += d, this.y2 += d), this;
1931
1870
  }
1932
1871
  round() {
1933
1872
  return this.x1 = Math.floor(this.x1), this.y1 = Math.floor(this.y1), this.x2 = Math.ceil(this.x2), this.y2 = Math.ceil(this.y2), this;
1934
1873
  }
1935
- translate() {
1936
- let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1937
- let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1874
+ translate(dx = 0, dy = 0) {
1938
1875
  return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
1939
1876
  }
1940
- rotate() {
1941
- let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1942
- let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1943
- let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1877
+ rotate(angle = 0, x = 0, y = 0) {
1944
1878
  const p = this.rotatedPoints(angle, x, y);
1945
1879
  return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
1946
1880
  }
1947
- scale() {
1948
- let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1949
- let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1950
- let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1951
- let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
1881
+ scale(sx = 0, sy = 0, x = 0, y = 0) {
1952
1882
  const p = this.scalePoints(sx, sy, x, y);
1953
1883
  return this.clear().add(p[0], p[1]).add(p[2], p[3]);
1954
1884
  }
@@ -1967,9 +1897,7 @@
1967
1897
  intersects(b) {
1968
1898
  return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
1969
1899
  }
1970
- contains() {
1971
- let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1972
- let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1900
+ contains(x = 0, y = 0) {
1973
1901
  return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
1974
1902
  }
1975
1903
  containsPoint(p) {
@@ -1981,12 +1909,10 @@
1981
1909
  height() {
1982
1910
  return this.empty() ? 0 : this.y2 - this.y1;
1983
1911
  }
1984
- scaleX() {
1985
- let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1912
+ scaleX(s = 0) {
1986
1913
  return this.x1 *= s, this.x2 *= s, this;
1987
1914
  }
1988
- scaleY() {
1989
- let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1915
+ scaleY(s = 0) {
1990
1916
  return this.y1 *= s, this.y2 *= s, this;
1991
1917
  }
1992
1918
  transformWithMatrix(matrix) {
@@ -2020,35 +1946,42 @@
2020
1946
  }
2021
1947
  class AABBBounds extends Bounds {}
2022
1948
  class OBBBounds extends Bounds {
2023
- constructor(bounds) {
2024
- let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1949
+ constructor(bounds, angle = 0) {
2025
1950
  var _a;
2026
1951
  super(bounds), bounds && (this.angle = null !== (_a = bounds.angle) && void 0 !== _a ? _a : angle);
2027
1952
  }
2028
1953
  intersects(b) {
2029
1954
  return isRotateAABBIntersect(this, b);
2030
1955
  }
2031
- setValue() {
2032
- let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
2033
- let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2034
- let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2035
- let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
2036
- let angle = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
1956
+ setValue(x1 = 0, y1 = 0, x2 = 0, y2 = 0, angle = 0) {
2037
1957
  return super.setValue(x1, y1, x2, y2), this.angle = angle, this;
2038
1958
  }
2039
1959
  clone() {
2040
1960
  return new OBBBounds(this);
2041
1961
  }
1962
+ getRotatedCorners() {
1963
+ const originPoint = {
1964
+ x: (this.x1 + this.x2) / 2,
1965
+ y: (this.y1 + this.y2) / 2
1966
+ };
1967
+ return [rotatePoint({
1968
+ x: this.x1,
1969
+ y: this.y1
1970
+ }, this.angle, originPoint), rotatePoint({
1971
+ x: this.x2,
1972
+ y: this.y1
1973
+ }, this.angle, originPoint), rotatePoint({
1974
+ x: this.x1,
1975
+ y: this.y2
1976
+ }, this.angle, originPoint), rotatePoint({
1977
+ x: this.x2,
1978
+ y: this.y2
1979
+ }, this.angle, originPoint)];
1980
+ }
2042
1981
  }
2043
1982
 
2044
1983
  class Matrix {
2045
- constructor() {
2046
- let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
2047
- let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2048
- let c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2049
- let d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
2050
- let e = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
2051
- let f = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
1984
+ constructor(a = 1, b = 0, c = 0, d = 1, e = 0, f = 0) {
2052
1985
  this.a = a, this.b = b, this.c = c, this.d = d, this.e = e, this.f = f;
2053
1986
  }
2054
1987
  equalToMatrix(m2) {
@@ -2158,8 +2091,7 @@
2158
2091
  } = source;
2159
2092
  target.x = x * nextA + y * nextC + nextE, target.y = x * nextB + y * nextD + nextF;
2160
2093
  }
2161
- onlyTranslate() {
2162
- let scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
2094
+ onlyTranslate(scale = 1) {
2163
2095
  return this.a === scale && 0 === this.b && 0 === this.c && this.d === scale;
2164
2096
  }
2165
2097
  clone() {
@@ -2466,16 +2398,13 @@
2466
2398
  }
2467
2399
  };
2468
2400
  class Color {
2469
- static Brighter(source) {
2470
- let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
2401
+ static Brighter(source, b = 1) {
2471
2402
  return 1 === b ? source : new Color(source).brighter(b).toRGBA();
2472
2403
  }
2473
- static SetOpacity(source) {
2474
- let o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
2404
+ static SetOpacity(source, o = 1) {
2475
2405
  return 1 === o ? source : new Color(source).setOpacity(o).toRGBA();
2476
2406
  }
2477
- static getColorBrightness(source) {
2478
- let model = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "hsl";
2407
+ static getColorBrightness(source, model = "hsl") {
2479
2408
  const color = source instanceof Color ? source : new Color(source);
2480
2409
  switch (model) {
2481
2410
  case "hsv":
@@ -2489,6 +2418,8 @@
2489
2418
  return color.getLuminance2();
2490
2419
  case "lum3":
2491
2420
  return color.getLuminance3();
2421
+ case "wcag":
2422
+ return color.getLuminanceWCAG();
2492
2423
  }
2493
2424
  }
2494
2425
  static parseColorString(value) {
@@ -2577,8 +2508,7 @@
2577
2508
  setScalar(scalar) {
2578
2509
  return this.color.r = scalar, this.color.g = scalar, this.color.b = scalar, this;
2579
2510
  }
2580
- setOpacity() {
2581
- let o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
2511
+ setOpacity(o = 1) {
2582
2512
  return this.color.opacity = o, this;
2583
2513
  }
2584
2514
  getLuminance() {
@@ -2590,15 +2520,21 @@
2590
2520
  getLuminance3() {
2591
2521
  return (.299 * this.color.r + .587 * this.color.g + .114 * this.color.b) / 255;
2592
2522
  }
2523
+ getLuminanceWCAG() {
2524
+ const RsRGB = this.color.r / 255,
2525
+ GsRGB = this.color.g / 255,
2526
+ BsRGB = this.color.b / 255;
2527
+ let R, G, B;
2528
+ R = RsRGB <= .03928 ? RsRGB / 12.92 : Math.pow((RsRGB + .055) / 1.055, 2.4), G = GsRGB <= .03928 ? GsRGB / 12.92 : Math.pow((GsRGB + .055) / 1.055, 2.4), B = BsRGB <= .03928 ? BsRGB / 12.92 : Math.pow((BsRGB + .055) / 1.055, 2.4);
2529
+ return .2126 * R + .7152 * G + .0722 * B;
2530
+ }
2593
2531
  clone() {
2594
2532
  return new Color(this.color.toString());
2595
2533
  }
2596
- copyGammaToLinear(color) {
2597
- let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
2534
+ copyGammaToLinear(color, gammaFactor = 2) {
2598
2535
  return this.color.r = Math.pow(color.color.r, gammaFactor), this.color.g = Math.pow(color.color.g, gammaFactor), this.color.b = Math.pow(color.color.b, gammaFactor), this;
2599
2536
  }
2600
- copyLinearToGamma(color) {
2601
- let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
2537
+ copyLinearToGamma(color, gammaFactor = 2) {
2602
2538
  const safeInverse = gammaFactor > 0 ? 1 / gammaFactor : 1;
2603
2539
  return this.color.r = Math.pow(color.color.r, safeInverse), this.color.g = Math.pow(color.color.g, safeInverse), this.color.b = Math.pow(color.color.b, safeInverse), this;
2604
2540
  }
@@ -2646,8 +2582,7 @@
2646
2582
  }
2647
2583
  }
2648
2584
 
2649
- const styleStringToObject = function () {
2650
- let styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
2585
+ const styleStringToObject = (styleStr = "") => {
2651
2586
  const res = {};
2652
2587
  return styleStr.split(";").forEach(item => {
2653
2588
  if (item) {
@@ -2711,7 +2646,7 @@
2711
2646
  clear() {
2712
2647
  this.bounds.clear();
2713
2648
  }
2714
- release() {}
2649
+ release(...params) {}
2715
2650
  }
2716
2651
 
2717
2652
  class CurvePath {
@@ -2919,12 +2854,7 @@
2919
2854
  };
2920
2855
 
2921
2856
  const commandFuncs = [(command, context, x, y, sx, sy, z) => context.arc(command[1] * sx + x, command[2] * sy + y, command[3] * (sx + sy) / 2, command[4], command[5], command[6], z), (command, context, x, y, sx, sy, z) => context.arcTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * (sx + sy) / 2, z), (command, context, x, y, sx, sy, z) => context.bezierCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * sx + x, command[6] * sy + y, z), (command, context, x, y) => context.closePath(), (command, context, x, y, sx, sy) => context.ellipse(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, command[5], command[6], command[7], command[8]), (command, context, x, y, sx, sy, z) => context.lineTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.moveTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.quadraticCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, z), (command, context, x, y, sx, sy, z) => context.rect(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, z)];
2922
- function renderCommandList(commandList, context) {
2923
- let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2924
- let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
2925
- let sx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
2926
- let sy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
2927
- let z = arguments.length > 6 ? arguments[6] : undefined;
2857
+ function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z) {
2928
2858
  for (let i = 0; i < commandList.length; i++) {
2929
2859
  const command = commandList[i];
2930
2860
  commandFuncs[command[0]](command, context, x, y, sx, sy, z);
@@ -3118,7 +3048,7 @@
3118
3048
  }
3119
3049
  }
3120
3050
 
3121
- function genCurveSegments(path, points) {
3051
+ function genCurveSegments(path, points, step = 1) {
3122
3052
  let defined0 = !1;
3123
3053
  for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
3124
3054
  }
@@ -3161,8 +3091,7 @@
3161
3091
  return this.context.tryUpdateLength();
3162
3092
  }
3163
3093
  }
3164
- function genLinearSegments(points) {
3165
- let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3094
+ function genLinearSegments(points, params = {}) {
3166
3095
  const {
3167
3096
  direction: direction,
3168
3097
  startPoint: startPoint
@@ -3172,7 +3101,7 @@
3172
3101
  return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
3173
3102
  }
3174
3103
  function genLinearTypeSegments(path, points) {
3175
- return genCurveSegments(path, points);
3104
+ return genCurveSegments(path, points, 1);
3176
3105
  }
3177
3106
 
3178
3107
  function point$3(curveClass, x, y, defined, p) {
@@ -3215,10 +3144,9 @@
3215
3144
  }
3216
3145
  }
3217
3146
  function genBasisTypeSegments(path, points) {
3218
- return genCurveSegments(path, points);
3147
+ return genCurveSegments(path, points, 2);
3219
3148
  }
3220
- function genBasisSegments(points) {
3221
- let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3149
+ function genBasisSegments(points, params = {}) {
3222
3150
  const {
3223
3151
  direction: direction,
3224
3152
  startPoint: startPoint
@@ -3311,10 +3239,9 @@
3311
3239
  }
3312
3240
  }
3313
3241
  function genMonotoneXTypeSegments(path, points) {
3314
- return genCurveSegments(path, points);
3242
+ return genCurveSegments(path, points, 2);
3315
3243
  }
3316
- function genMonotoneXSegments(points) {
3317
- let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3244
+ function genMonotoneXSegments(points, params = {}) {
3318
3245
  const {
3319
3246
  direction: direction,
3320
3247
  startPoint: startPoint
@@ -3325,10 +3252,9 @@
3325
3252
  return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
3326
3253
  }
3327
3254
  function genMonotoneYTypeSegments(path, points) {
3328
- return genCurveSegments(path, points);
3255
+ return genCurveSegments(path, points, 2);
3329
3256
  }
3330
- function genMonotoneYSegments(points) {
3331
- let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3257
+ function genMonotoneYSegments(points, params = {}) {
3332
3258
  const {
3333
3259
  direction: direction,
3334
3260
  startPoint: startPoint
@@ -3340,9 +3266,7 @@
3340
3266
  }
3341
3267
 
3342
3268
  let Step$1 = class Step {
3343
- constructor(context) {
3344
- let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
3345
- let startPoint = arguments.length > 2 ? arguments[2] : undefined;
3269
+ constructor(context, t = .5, startPoint) {
3346
3270
  this.context = context, this._t = t, this.startPoint = startPoint;
3347
3271
  }
3348
3272
  areaStart() {
@@ -3378,8 +3302,7 @@
3378
3302
  return this.context.tryUpdateLength();
3379
3303
  }
3380
3304
  };
3381
- function genStepSegments(points, t) {
3382
- let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3305
+ function genStepSegments(points, t, params = {}) {
3383
3306
  const {
3384
3307
  direction: direction,
3385
3308
  startPoint: startPoint
@@ -3389,7 +3312,7 @@
3389
3312
  return genStepTypeSegments(new Step$1(segContext, t, startPoint), points), segContext;
3390
3313
  }
3391
3314
  function genStepTypeSegments(path, points) {
3392
- return genCurveSegments(path, points);
3315
+ return genCurveSegments(path, points, 1);
3393
3316
  }
3394
3317
 
3395
3318
  class LinearClosed extends Linear {
@@ -3397,8 +3320,7 @@
3397
3320
  this.context.closePath();
3398
3321
  }
3399
3322
  }
3400
- function genLinearClosedSegments(points) {
3401
- let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3323
+ function genLinearClosedSegments(points, params = {}) {
3402
3324
  const {
3403
3325
  direction: direction,
3404
3326
  startPoint: startPoint
@@ -3408,7 +3330,7 @@
3408
3330
  return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
3409
3331
  }
3410
3332
  function genLinearClosedTypeSegments(path, points) {
3411
- return genCurveSegments(path, points);
3333
+ return genCurveSegments(path, points, 1);
3412
3334
  }
3413
3335
 
3414
3336
  function point$1(curveClass, x, y, defined, p) {
@@ -3429,9 +3351,7 @@
3429
3351
  curveClass.context.bezierCurveTo(x1, y1, x2, y2, curveClass._x2, curveClass._y2, defined, curveClass.lastPoint1);
3430
3352
  }
3431
3353
  class CatmullRom {
3432
- constructor(context) {
3433
- let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
3434
- let startPoint = arguments.length > 2 ? arguments[2] : undefined;
3354
+ constructor(context, alpha = .5, startPoint) {
3435
3355
  this.context = context, this.startPoint = startPoint, this._alpha = alpha;
3436
3356
  }
3437
3357
  areaStart() {
@@ -3485,8 +3405,7 @@
3485
3405
  }
3486
3406
  }
3487
3407
  function commonGenCatmullRomSegments(type, cons) {
3488
- return function (points, alpha) {
3489
- let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3408
+ return function (points, alpha, params = {}) {
3490
3409
  const {
3491
3410
  direction: direction,
3492
3411
  startPoint: startPoint
@@ -3495,15 +3414,13 @@
3495
3414
  if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
3496
3415
  const segContext = genSegContext(type, direction, points),
3497
3416
  gatmullRom = new cons(segContext, alpha, startPoint);
3498
- return genCurveSegments(gatmullRom, points), segContext;
3417
+ return genCurveSegments(gatmullRom, points, 2), segContext;
3499
3418
  };
3500
3419
  }
3501
3420
  const genCatmullRomSegments = commonGenCatmullRomSegments("catmullRom", CatmullRom);
3502
3421
 
3503
3422
  class CatmullRomClosed {
3504
- constructor(context) {
3505
- let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
3506
- let startPoint = arguments.length > 2 ? arguments[2] : undefined;
3423
+ constructor(context, alpha = .5, startPoint) {
3507
3424
  this.context = context, this.startPoint = startPoint, this._alpha = alpha;
3508
3425
  }
3509
3426
  areaStart() {
@@ -3745,11 +3662,7 @@
3745
3662
  cmd[1] = cmd[1] * sx + x, cmd[2] = cmd[2] * sy + y, cmd[3] = cmd[3] * (sx + sy) / 2;
3746
3663
  }
3747
3664
  closePathTransform() {}
3748
- _runCommandStrList(commandStrList) {
3749
- let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3750
- let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
3751
- let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
3752
- let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
3665
+ _runCommandStrList(commandStrList, l = 0, t = 0, sX = 1, sY = 1) {
3753
3666
  let current,
3754
3667
  tempX,
3755
3668
  tempY,
@@ -3823,11 +3736,7 @@
3823
3736
  previous = current;
3824
3737
  }
3825
3738
  }
3826
- _runCommandList(commandList) {
3827
- let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3828
- let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
3829
- let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
3830
- let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
3739
+ _runCommandList(commandList, l = 0, t = 0, sX = 1, sY = 1) {
3831
3740
  if (0 !== l || 0 !== t || 1 !== sX || 1 !== sY) for (let i = 0, len = commandList.length; i < len; ++i) {
3832
3741
  const current = commandList[i].slice();
3833
3742
  switch (current[0]) {
@@ -4437,9 +4346,7 @@
4437
4346
  scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);
4438
4347
  return scaleX + scaleY === 0 ? 0 : (strokeWidth = strokeWidth / Math.abs(scaleX + scaleY) * 2 * dpr, strokeWidth);
4439
4348
  }
4440
- function createColor(context, c, params) {
4441
- let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
4442
- let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
4349
+ function createColor(context, c, params, offsetX = 0, offsetY = 0) {
4443
4350
  if (!c || !0 === c) return "black";
4444
4351
  let result, color;
4445
4352
  if (isArray$1(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
@@ -4575,8 +4482,7 @@
4575
4482
  }
4576
4483
  return needTestLetter && (index = testLetter(desc, index)), index;
4577
4484
  }
4578
- function testLetter(string, index) {
4579
- let negativeWrongMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
4485
+ function testLetter(string, index, negativeWrongMatch = !1) {
4580
4486
  let i = index;
4581
4487
  for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return negativeWrongMatch ? testLetter2(string, index) : index;
4582
4488
  return i;
@@ -4645,10 +4551,9 @@
4645
4551
  }
4646
4552
  return metrics;
4647
4553
  }
4648
- estimate(text, _ref) {
4649
- let {
4650
- fontSize = DefaultTextAttribute.fontSize
4651
- } = _ref;
4554
+ estimate(text, {
4555
+ fontSize = DefaultTextAttribute.fontSize
4556
+ }) {
4652
4557
  let eCharLen = 0,
4653
4558
  cCharLen = 0;
4654
4559
  for (let i = 0; i < text.length; i++) text.charCodeAt(i) < 128 ? eCharLen++ : cCharLen++;
@@ -4959,8 +4864,7 @@
4959
4864
  });
4960
4865
  });
4961
4866
  }
4962
- clipTextWithSuffix(text, options, width, suffix, wordBreak, position) {
4963
- let forceSuffix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
4867
+ clipTextWithSuffix(text, options, width, suffix, wordBreak, position, forceSuffix = !1) {
4964
4868
  if ("" === suffix) return this.clipText(text, options, width, wordBreak);
4965
4869
  if (0 === text.length) return {
4966
4870
  str: "",
@@ -5408,7 +5312,7 @@
5408
5312
  get length() {
5409
5313
  return this.pools.length;
5410
5314
  }
5411
- release() {
5315
+ release(...params) {
5412
5316
  this.pools = [];
5413
5317
  }
5414
5318
  }
@@ -5604,8 +5508,7 @@
5604
5508
  bindTextMeasure(tm) {
5605
5509
  this._textMeasure = tm;
5606
5510
  }
5607
- measureText(text, tc) {
5608
- let method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "native";
5511
+ measureText(text, tc, method = "native") {
5609
5512
  var _a;
5610
5513
  this.configure(this.global, this.global.env);
5611
5514
  const m = this.global.measureTextMethod;
@@ -5786,8 +5689,7 @@
5786
5689
  for (; group.parent;) if ((group = group.parent).theme) return group;
5787
5690
  return null;
5788
5691
  }
5789
- applyTheme(group, pt) {
5790
- let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
5692
+ applyTheme(group, pt, force = !1) {
5791
5693
  if (this.dirty) {
5792
5694
  const parentGroup = this.getParentWithTheme(group);
5793
5695
  if (parentGroup) {
@@ -5886,8 +5788,7 @@
5886
5788
  constructor() {
5887
5789
  super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
5888
5790
  }
5889
- forEachChildren(cb) {
5890
- let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
5791
+ forEachChildren(cb, reverse = !1) {
5891
5792
  if (reverse) {
5892
5793
  let child = this._lastChild,
5893
5794
  i = 0;
@@ -5904,8 +5805,7 @@
5904
5805
  }
5905
5806
  }
5906
5807
  }
5907
- forEachChildrenAsync(cb) {
5908
- let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
5808
+ forEachChildrenAsync(cb, reverse = !1) {
5909
5809
  return __awaiter$7(this, void 0, void 0, function* () {
5910
5810
  if (reverse) {
5911
5811
  let child = this._lastChild,
@@ -5929,13 +5829,12 @@
5929
5829
  forEach(cb) {
5930
5830
  return this.forEachChildren(cb);
5931
5831
  }
5932
- appendChild(node) {
5933
- let highPerformance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
5832
+ appendChild(node, highPerformance = !0) {
5934
5833
  if (this._uid === node._uid) return null;
5935
5834
  if (!highPerformance && node.isAncestorsOf(this)) throw new Error("【Node::appendChild】不能将父辈元素append为子元素");
5936
5835
  return node.parent && node.parent.removeChild(node), node.parent = this, this._lastChild ? (this._lastChild._next = node, node._prev = this._lastChild, this._lastChild = node) : (this._firstChild = this._lastChild = node, node._prev = node._next = null), this._idMap || (this._idMap = new Map()), this._idMap.set(node._uid, node), this.setCount(node.count), this._structEdit = !0, node;
5937
5836
  }
5938
- appendChildArrHighPerformance(nodes) {
5837
+ appendChildArrHighPerformance(nodes, replace = !1) {
5939
5838
  return console.error("暂不支持该函数"), nodes;
5940
5839
  }
5941
5840
  insertBefore(newNode, referenceNode) {
@@ -6003,8 +5902,7 @@
6003
5902
  replaceChild(newChild, oldChild) {
6004
5903
  throw new Error("暂不支持");
6005
5904
  }
6006
- find(callback) {
6007
- let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
5905
+ find(callback, deep = !1) {
6008
5906
  let target = null;
6009
5907
  return this.forEachChildren((node, index) => !(node === this || !callback(node, index)) && (target = node, !0)), deep && this.forEachChildren(child => {
6010
5908
  if (child.isContainer) {
@@ -6014,8 +5912,7 @@
6014
5912
  return !1;
6015
5913
  }), target;
6016
5914
  }
6017
- findAll(callback) {
6018
- let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
5915
+ findAll(callback, deep = !1) {
6019
5916
  let nodes = [];
6020
5917
  return this.forEachChildren((node, index) => {
6021
5918
  node !== this && callback(node, index) && nodes.push(node);
@@ -6044,8 +5941,7 @@
6044
5941
  getElementsByType(type) {
6045
5942
  return this.findAll(node => node.type === type, !0);
6046
5943
  }
6047
- getChildByName(name) {
6048
- let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
5944
+ getChildByName(name, deep = !1) {
6049
5945
  return this.find(node => node.name === name, deep);
6050
5946
  }
6051
5947
  getChildAt(idx) {
@@ -6164,10 +6060,7 @@
6164
6060
  removeAllListeners() {
6165
6061
  return this.removeAllEventListeners();
6166
6062
  }
6167
- dispatchEvent(event) {
6168
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
6169
- args[_key - 1] = arguments[_key];
6170
- }
6063
+ dispatchEvent(event, ...args) {
6171
6064
  return super.emit(event.type, event, ...args), !event.defaultPrevented;
6172
6065
  }
6173
6066
  emit(event, data) {
@@ -6866,8 +6759,7 @@
6866
6759
  get mode() {
6867
6760
  return this._mode;
6868
6761
  }
6869
- constructor() {
6870
- let timelines = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6762
+ constructor(timelines = []) {
6871
6763
  super(), this.handleTick = (handler, params) => {
6872
6764
  const {
6873
6765
  once = !1
@@ -6960,8 +6852,7 @@
6960
6852
  }
6961
6853
  return !1;
6962
6854
  }
6963
- start() {
6964
- let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
6855
+ start(force = !1) {
6965
6856
  if (this.status === STATUS$1.RUNNING) return !1;
6966
6857
  if (!this.tickerHandler) return !1;
6967
6858
  if (!force) {
@@ -7158,8 +7049,7 @@
7158
7049
  for (; animate;) animate.release(), animate = animate.nextAnimate;
7159
7050
  this.animateHead = null, this.animateTail = null, this.animateCount = 0;
7160
7051
  }
7161
- removeAnimate(animate) {
7162
- let release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
7052
+ removeAnimate(animate, release = !0) {
7163
7053
  animate._onRemove && animate._onRemove.forEach(cb => cb()), animate === this.animateHead ? (this.animateHead = animate.nextAnimate, animate === this.animateTail ? this.animateTail = null : this.animateHead.prevAnimate = null) : animate === this.animateTail ? (this.animateTail = animate.prevAnimate, this.animateTail.nextAnimate = null) : (animate.prevAnimate.nextAnimate = animate.nextAnimate, animate.nextAnimate.prevAnimate = animate.prevAnimate), release && animate.release();
7164
7054
  }
7165
7055
  }
@@ -7208,10 +7098,7 @@
7208
7098
  }
7209
7099
  }
7210
7100
  class Animate {
7211
- constructor() {
7212
- let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
7213
- let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
7214
- let slience = arguments.length > 2 ? arguments[2] : undefined;
7101
+ constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
7215
7102
  this.id = id, this.timeline = timeline || defaultTimeline, this.status = exports.AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
7216
7103
  }
7217
7104
  setTimeline(timeline) {
@@ -7246,8 +7133,7 @@
7246
7133
  }
7247
7134
  return 1 === this.subAnimates.length && this.tailAnimate.totalDuration === customAnimate.duration && this.trySetAttribute(customAnimate.getFromProps(), customAnimate.mode), this;
7248
7135
  }
7249
- trySetAttribute(attr) {
7250
- let mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Animate.mode;
7136
+ trySetAttribute(attr, mode = Animate.mode) {
7251
7137
  attr && mode & exports.AnimateMode.SET_ATTR_IMMEDIATELY && this.target.setAttributes && this.target.setAttributes(attr, !1, {
7252
7138
  type: exports.AttributeUpdateType.ANIMATE_PLAY
7253
7139
  });
@@ -7658,8 +7544,7 @@
7658
7544
  return attr[key];
7659
7545
  }
7660
7546
  class RafBasedSTO {
7661
- constructor() {
7662
- let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : RafBasedSTO.TimeOut;
7547
+ constructor(timeout = RafBasedSTO.TimeOut) {
7663
7548
  this.durations = [], this.timeout = timeout, this.lastDate = 0, this.durationsListThreshold = 30;
7664
7549
  }
7665
7550
  call(cb) {
@@ -8090,8 +7975,7 @@
8090
7975
  var _a, _b;
8091
7976
  super(from, to, duration, easing, params), this.newPointAnimateType = null !== (_a = null == params ? void 0 : params.newPointAnimateType) && void 0 !== _a ? _a : "grow", this.clipRangeByDimension = null !== (_b = null == params ? void 0 : params.clipRangeByDimension) && void 0 !== _b ? _b : "x";
8092
7977
  }
8093
- getPoints(attribute) {
8094
- let cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
7978
+ getPoints(attribute, cache = !1) {
8095
7979
  if (attribute.points) return attribute.points;
8096
7980
  if (attribute.segments) {
8097
7981
  const points = [];
@@ -9064,9 +8948,7 @@
9064
8948
  ColorType[ColorType.Color255 = 0] = "Color255", ColorType[ColorType.Color1 = 1] = "Color1";
9065
8949
  }(exports.ColorType || (exports.ColorType = {}));
9066
8950
  class ColorStore {
9067
- static Get(str) {
9068
- let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : exports.ColorType.Color1;
9069
- let arr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0, 1];
8951
+ static Get(str, size = exports.ColorType.Color1, arr = [0, 0, 0, 1]) {
9070
8952
  if (size === exports.ColorType.Color1) {
9071
8953
  const color = ColorStore.store1[str];
9072
8954
  if (color) return arr[0] = color[0], arr[1] = color[1], arr[2] = color[2], arr[3] = color[3], arr;
@@ -9094,8 +8976,7 @@
9094
8976
  }
9095
8977
  ColorStore.store255 = {}, ColorStore.store1 = {};
9096
8978
 
9097
- function colorArrayToString(color) {
9098
- let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
8979
+ function colorArrayToString(color, alphaChannel = !1) {
9099
8980
  return Array.isArray(color) && isNumber$1(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
9100
8981
  }
9101
8982
  function interpolateColor(from, to, ratio, alphaChannel, cb) {
@@ -9686,8 +9567,7 @@
9686
9567
  get globalTransMatrix() {
9687
9568
  return this.tryUpdateGlobalTransMatrix(!0);
9688
9569
  }
9689
- constructor() {
9690
- let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9570
+ constructor(params = {}) {
9691
9571
  var _a;
9692
9572
  super(), this._AABBBounds = new AABBBounds(), this._updateTag = exports.UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
9693
9573
  }
@@ -9700,8 +9580,7 @@
9700
9580
  set2dMode() {
9701
9581
  this.in3dMode = !1;
9702
9582
  }
9703
- getOffsetXY(attr) {
9704
- let includeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
9583
+ getOffsetXY(attr, includeScroll = !1) {
9705
9584
  var _a, _b;
9706
9585
  const {
9707
9586
  dx = attr.dx,
@@ -9759,7 +9638,7 @@
9759
9638
  const b = this.AABBBounds;
9760
9639
  return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this._globalAABBBounds.empty() || this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
9761
9640
  }
9762
- tryUpdateGlobalTransMatrix() {
9641
+ tryUpdateGlobalTransMatrix(clearTag = !0) {
9763
9642
  if (this._globalTransMatrix) {
9764
9643
  if (this.parent) {
9765
9644
  const m = this.parent.globalTransMatrix;
@@ -9771,8 +9650,7 @@
9771
9650
  shouldUpdateGlobalMatrix() {
9772
9651
  return !0;
9773
9652
  }
9774
- tryUpdateLocalTransMatrix() {
9775
- let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
9653
+ tryUpdateLocalTransMatrix(clearTag = !0) {
9776
9654
  return this._transMatrix || (this._transMatrix = new Matrix()), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(), clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
9777
9655
  }
9778
9656
  shouldUpdateAABBBounds() {
@@ -9809,14 +9687,10 @@
9809
9687
  y: y
9810
9688
  });
9811
9689
  }
9812
- setAttributes(params) {
9813
- let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
9814
- let context = arguments.length > 2 ? arguments[2] : undefined;
9690
+ setAttributes(params, forceUpdateTag = !1, context) {
9815
9691
  (params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context);
9816
9692
  }
9817
- _setAttributes(params) {
9818
- let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
9819
- let context = arguments.length > 2 ? arguments[2] : undefined;
9693
+ _setAttributes(params, forceUpdateTag = !1, context) {
9820
9694
  const keys = Object.keys(params);
9821
9695
  for (let i = 0; i < keys.length; i++) {
9822
9696
  const key = keys[i];
@@ -9831,16 +9705,14 @@
9831
9705
  }, this.attribute, key, context);
9832
9706
  params ? this._setAttributes(params, forceUpdateTag, context) : isNil$1(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "shadowGraphic" === key && this.setShadowGraphic(value);
9833
9707
  }
9834
- needUpdateTags(keys) {
9835
- let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
9708
+ needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
9836
9709
  for (let i = 0; i < k.length; i++) {
9837
9710
  const attrKey = k[i];
9838
9711
  if (-1 !== keys.indexOf(attrKey)) return !0;
9839
9712
  }
9840
9713
  return !1;
9841
9714
  }
9842
- needUpdateTag(key) {
9843
- let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
9715
+ needUpdateTag(key, k = GRAPHIC_UPDATE_TAG_KEY) {
9844
9716
  for (let i = 0; i < k.length; i++) {
9845
9717
  if (key === k[i]) return !0;
9846
9718
  }
@@ -10003,8 +9875,7 @@
10003
9875
  newNormalAttrs[key] = this.getNormalAttribute(key);
10004
9876
  }), this.normalAttrs = newNormalAttrs;
10005
9877
  }
10006
- stopStateAnimates() {
10007
- let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "end";
9878
+ stopStateAnimates(type = "end") {
10008
9879
  this.animates && this.animates.forEach(animate => {
10009
9880
  animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
10010
9881
  });
@@ -10243,8 +10114,7 @@
10243
10114
  var _a;
10244
10115
  return null !== (_a = this.attribute[name]) && void 0 !== _a ? _a : this.getDefaultAttribute(name);
10245
10116
  }
10246
- onSetStage(cb) {
10247
- let immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
10117
+ onSetStage(cb, immediate = !1) {
10248
10118
  this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
10249
10119
  }
10250
10120
  attachShadow(shadowRoot) {
@@ -10265,8 +10135,7 @@
10265
10135
  createPathProxy(path) {
10266
10136
  return isString$1(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
10267
10137
  }
10268
- loadImage(image) {
10269
- let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
10138
+ loadImage(image, background = !1) {
10270
10139
  if (!image || background && backgroundNotImage(image)) return;
10271
10140
  const url = image;
10272
10141
  this.resources || (this.resources = new Map());
@@ -10296,8 +10165,7 @@
10296
10165
  animate.stop();
10297
10166
  });
10298
10167
  }
10299
- stopAnimates() {
10300
- let stopChildren = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
10168
+ stopAnimates(stopChildren = !1) {
10301
10169
  this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren(c => {
10302
10170
  c.stopAnimates(stopChildren);
10303
10171
  });
@@ -10354,8 +10222,7 @@
10354
10222
  if (-1 === closingIndex) throw new Error(errMsg);
10355
10223
  return closingIndex + str.length - 1;
10356
10224
  }
10357
- function tagExpWithClosingIndex(xmlData, i) {
10358
- let closingChar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ">";
10225
+ function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
10359
10226
  let attrBoundary,
10360
10227
  tagExp = "";
10361
10228
  for (let index = i; index < xmlData.length; index++) {
@@ -10373,8 +10240,7 @@
10373
10240
  tagExp += ch;
10374
10241
  }
10375
10242
  }
10376
- function readTagExp(xmlData, i, removeNSPrefix) {
10377
- let closingChar = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ">";
10243
+ function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
10378
10244
  const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
10379
10245
  if (!result) return;
10380
10246
  let tagExp = result.data;
@@ -10561,8 +10427,7 @@
10561
10427
  }), yield Promise.all(promiseList);
10562
10428
  });
10563
10429
  }
10564
- function boundStroke(bounds, halfW, miter) {
10565
- let pad = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
10430
+ function boundStroke(bounds, halfW, miter, pad = 0) {
10566
10431
  return bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0))), bounds;
10567
10432
  }
10568
10433
  function miterAdjustment(miter, strokeWidth) {
@@ -10811,8 +10676,7 @@
10811
10676
  _updateChildToStage(child) {
10812
10677
  return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(), child;
10813
10678
  }
10814
- appendChild(node) {
10815
- let addStage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
10679
+ appendChild(node, addStage = !0) {
10816
10680
  const data = super.appendChild(node);
10817
10681
  return addStage && this.stage && data && data.setStage(this.stage, this.layer), this.addUpdateBoundTag(), data;
10818
10682
  }
@@ -10829,8 +10693,7 @@
10829
10693
  const data = super.removeChild(child);
10830
10694
  return child.stage = null, application.graphicService.onRemove(child), this.addUpdateBoundTag(), data;
10831
10695
  }
10832
- removeAllChild() {
10833
- let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
10696
+ removeAllChild(deep = !1) {
10834
10697
  this.forEachChildren(child => {
10835
10698
  application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
10836
10699
  }), super.removeAllChild(), this.addUpdateBoundTag();
@@ -10850,8 +10713,7 @@
10850
10713
  g.isContainer && g.addUpdateGlobalPositionTag();
10851
10714
  });
10852
10715
  }
10853
- tryUpdateGlobalTransMatrix() {
10854
- let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
10716
+ tryUpdateGlobalTransMatrix(clearTag = !0) {
10855
10717
  if (this.shouldUpdateGlobalMatrix()) {
10856
10718
  if (this._globalTransMatrix) {
10857
10719
  if (this.parent) {
@@ -10920,8 +10782,7 @@
10920
10782
  zIndex: null !== (_a = params.zIndex) && void 0 !== _a ? _a : 0
10921
10783
  }), this.layer = this, this.subLayers = new Map(), this.theme = new Theme(), this.background = "rgba(0, 0, 0, 0)", this.afterDrawCbs = [];
10922
10784
  }
10923
- combineSubLayer() {
10924
- let removeIncrementalKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
10785
+ combineSubLayer(removeIncrementalKey = !0) {
10925
10786
  const subLayers = Array.from(this.subLayers.values()).sort((a, b) => a.zIndex - b.zIndex);
10926
10787
  this.layerHandler.merge(subLayers.map(l => (l.layer.subLayers.size && l.layer.combineSubLayer(removeIncrementalKey), l.layer.getNativeHandler()))), removeIncrementalKey && subLayers.forEach(l => {
10927
10788
  l.group && (l.group.incremental = 0);
@@ -11030,10 +10891,9 @@
11030
10891
  let layerHandler;
11031
10892
  return layerHandler = "static" === layerMode ? container.get(StaticLayerHandlerContribution) : "dynamic" === layerMode ? container.get(DynamicLayerHandlerContribution) : container.get(VirtualLayerHandlerContribution), layerHandler;
11032
10893
  }
11033
- createLayer(stage) {
11034
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
11035
- main: !1
11036
- };
10894
+ createLayer(stage, options = {
10895
+ main: !1
10896
+ }) {
11037
10897
  var _a;
11038
10898
  this.tryInit();
11039
10899
  let layerMode = this.getRecommendedLayerType(options.layerMode);
@@ -11304,9 +11164,7 @@
11304
11164
  static getInstance() {
11305
11165
  return ColorInterpolate._instance || (ColorInterpolate._instance = new ColorInterpolate()), ColorInterpolate._instance;
11306
11166
  }
11307
- constructor() {
11308
- let stops = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
11309
- let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
11167
+ constructor(stops = [], precision = 100) {
11310
11168
  super(), this.cacheParams = {
11311
11169
  CLEAN_THRESHOLD: 100,
11312
11170
  L_TIME: 1e3
@@ -11324,9 +11182,7 @@
11324
11182
  const rgba = this.rgbaSet.slice(4 * offset, 4 * offset + 4);
11325
11183
  return `rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, ${rgba[3] / 255})`;
11326
11184
  }
11327
- GetOrCreate(x, y, w, h) {
11328
- let stops = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
11329
- let precision = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 100;
11185
+ GetOrCreate(x, y, w, h, stops = [], precision = 100) {
11330
11186
  let str = `${x}${y}${w}${h}`;
11331
11187
  stops.forEach(item => str += item.join()), str += precision;
11332
11188
  let colorInter = this.dataMap.get(str);
@@ -11429,8 +11285,7 @@
11429
11285
  function textDrawOffsetX(textAlign, width) {
11430
11286
  return "end" === textAlign || "right" === textAlign ? -width : "center" === textAlign ? -width / 2 : 0;
11431
11287
  }
11432
- function textLayoutOffsetY(baseline, lineHeight, fontSize) {
11433
- let buf = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
11288
+ function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
11434
11289
  return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight), -(lineHeight - fontSize) / 2 - .79 * fontSize);
11435
11290
  }
11436
11291
  function textAttributesToStyle(attrs) {
@@ -11600,7 +11455,7 @@
11600
11455
  get length() {
11601
11456
  return this.pools.length;
11602
11457
  }
11603
- release() {
11458
+ release(...params) {
11604
11459
  this.pools = [];
11605
11460
  }
11606
11461
  }
@@ -11628,7 +11483,7 @@
11628
11483
  get length() {
11629
11484
  return this.pools.length;
11630
11485
  }
11631
- release() {
11486
+ release(...params) {
11632
11487
  this.pools = [];
11633
11488
  }
11634
11489
  }
@@ -11907,8 +11762,7 @@
11907
11762
  doStroke: doStroke
11908
11763
  };
11909
11764
  }
11910
- transform(graphic, graphicAttribute, context) {
11911
- let use3dMatrixIn3dMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
11765
+ transform(graphic, graphicAttribute, context, use3dMatrixIn3dMode = !1) {
11912
11766
  const {
11913
11767
  x = graphicAttribute.x,
11914
11768
  y = graphicAttribute.y,
@@ -13592,7 +13446,7 @@
13592
13446
  get length() {
13593
13447
  return this.pools.length;
13594
13448
  }
13595
- release() {
13449
+ release(...params) {
13596
13450
  this.pools = [];
13597
13451
  }
13598
13452
  }
@@ -13842,8 +13696,7 @@
13842
13696
  path.moveTo(points[0].x + x, points[0].y + y);
13843
13697
  for (let i = 1; i < points.length; i++) path.lineTo(points[i].x + x, points[i].y + y);
13844
13698
  }
13845
- function drawRoundedPolygon(path, points, x, y, cornerRadius) {
13846
- let closePath = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
13699
+ function drawRoundedPolygon(path, points, x, y, cornerRadius, closePath = !0) {
13847
13700
  var _a;
13848
13701
  if (points.length < 3) return void drawPolygon(path, points, x, y);
13849
13702
  let startI = 0,
@@ -14431,10 +14284,9 @@
14431
14284
 
14432
14285
  const CIRCLE_UPDATE_TAG_KEY = ["radius", "startAngle", "endAngle", ...GRAPHIC_UPDATE_TAG_KEY];
14433
14286
  class Circle extends Graphic {
14434
- constructor() {
14435
- let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
14436
- radius: 1
14437
- };
14287
+ constructor(params = {
14288
+ radius: 1
14289
+ }) {
14438
14290
  super(params), this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
14439
14291
  }
14440
14292
  isValid() {
@@ -14515,10 +14367,7 @@
14515
14367
  } else bbox.yOffset = -bbox.height;
14516
14368
  return bbox;
14517
14369
  }
14518
- GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
14519
- let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
14520
- let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
14521
- let params = arguments.length > 6 ? arguments[6] : undefined;
14370
+ GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = "", wordBreak, params) {
14522
14371
  const {
14523
14372
  lineWidth: lineWidth,
14524
14373
  suffixPosition = "end",
@@ -14641,11 +14490,10 @@
14641
14490
  get isMultiLine() {
14642
14491
  return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
14643
14492
  }
14644
- constructor() {
14645
- let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
14646
- text: "",
14647
- fontSize: 16
14648
- };
14493
+ constructor(params = {
14494
+ text: "",
14495
+ fontSize: 16
14496
+ }) {
14649
14497
  super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE, this.cache = {};
14650
14498
  }
14651
14499
  isValid() {
@@ -14977,12 +14825,10 @@
14977
14825
  var _a;
14978
14826
  return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
14979
14827
  }
14980
- needUpdateTags(keys) {
14981
- let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
14828
+ needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
14982
14829
  return super.needUpdateTags(keys, k);
14983
14830
  }
14984
- needUpdateTag(key) {
14985
- let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
14831
+ needUpdateTag(key, k = TEXT_UPDATE_TAG_KEY) {
14986
14832
  return super.needUpdateTag(key, k);
14987
14833
  }
14988
14834
  clone() {
@@ -15250,8 +15096,7 @@
15250
15096
  }
15251
15097
  var square$1 = new SquareSymbol();
15252
15098
 
15253
- function trianglUpOffset(ctx, r, x, y) {
15254
- let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
15099
+ function trianglUpOffset(ctx, r, x, y, offset = 0) {
15255
15100
  return ctx.moveTo(x + r + 2 * offset, r + y + offset), ctx.lineTo(x - r - 2 * offset, r + y + offset), ctx.lineTo(x, y - r - 2 * offset), ctx.closePath(), !0;
15256
15101
  }
15257
15102
  class TriangleUpSymbol extends BaseSymbol {
@@ -15397,8 +15242,7 @@
15397
15242
  }
15398
15243
  var triangleLeft = new TriangleLeftSymbol();
15399
15244
 
15400
- function trianglRightOffset(ctx, r, x, y) {
15401
- let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
15245
+ function trianglRightOffset(ctx, r, x, y, offset = 0) {
15402
15246
  return ctx.moveTo(x - r - offset, r + y + 2 * offset), ctx.lineTo(r + x + 2 * offset, y), ctx.lineTo(x - r - offset, y - r - 2 * offset), ctx.closePath(), !0;
15403
15247
  }
15404
15248
  class TriangleRightSymbol extends BaseSymbol {
@@ -15414,8 +15258,7 @@
15414
15258
  }
15415
15259
  var triangleRight = new TriangleRightSymbol();
15416
15260
 
15417
- function trianglDownOffset(ctx, r, x, y) {
15418
- let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
15261
+ function trianglDownOffset(ctx, r, x, y, offset = 0) {
15419
15262
  return ctx.moveTo(x - r - 2 * offset, y - r - offset), ctx.lineTo(x + r + 2 * offset, y - r - offset), ctx.lineTo(x, y + r + 2 * offset), ctx.closePath(), !0;
15420
15263
  }
15421
15264
  class TriangleDownSymbol extends BaseSymbol {
@@ -15600,8 +15443,7 @@
15600
15443
 
15601
15444
  const tempBounds = new AABBBounds();
15602
15445
  class CustomSymbolClass {
15603
- constructor(type, path) {
15604
- let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
15446
+ constructor(type, path, isSvg = !1) {
15605
15447
  this.pathStr = "", this.type = type, isArray$1(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
15606
15448
  }
15607
15449
  drawOffset(ctx, size, x, y, offset, z, cb) {
@@ -15618,10 +15460,9 @@
15618
15460
  bounds(size, bounds) {
15619
15461
  if (size = this.parseSize(size), this.isSvg) {
15620
15462
  if (!this.svgCache) return;
15621
- return bounds.clear(), void this.svgCache.forEach(_ref => {
15622
- let {
15623
- path: path
15624
- } = _ref;
15463
+ return bounds.clear(), void this.svgCache.forEach(({
15464
+ path: path
15465
+ }) => {
15625
15466
  tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size, tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
15626
15467
  });
15627
15468
  }
@@ -15661,10 +15502,9 @@
15661
15502
  const _tempBounds$1 = new AABBBounds(),
15662
15503
  SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
15663
15504
  let Symbol$1 = class Symbol extends Graphic {
15664
- constructor() {
15665
- let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
15666
- symbolType: "circle"
15667
- };
15505
+ constructor(params = {
15506
+ symbolType: "circle"
15507
+ }) {
15668
15508
  super(params), this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
15669
15509
  }
15670
15510
  getParsedPath() {
@@ -15777,8 +15617,7 @@
15777
15617
 
15778
15618
  const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
15779
15619
  let Line$1 = class Line extends Graphic {
15780
- constructor() {
15781
- let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15620
+ constructor(params = {}) {
15782
15621
  super(params), this.type = "line", this.numberType = LINE_NUMBER_TYPE;
15783
15622
  }
15784
15623
  isValid() {
@@ -16015,9 +15854,7 @@
16015
15854
  g.addUpdateShapeAndBoundsTag(), g.addUpdatePositionTag();
16016
15855
  });
16017
15856
  }
16018
- setAttributes(params) {
16019
- let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
16020
- let context = arguments.length > 2 ? arguments[2] : undefined;
15857
+ setAttributes(params, forceUpdateTag = !1, context) {
16021
15858
  super.setAttributes(params, forceUpdateTag, context), this.subGraphic.forEach(g => {
16022
15859
  g.addUpdateShapeAndBoundsTag(), g.addUpdatePositionTag();
16023
15860
  });
@@ -16585,8 +16422,7 @@
16585
16422
  line = new Line(this.frame.left, this[this.directionKey.width], this.y + maxAscent, maxAscent, maxDescent, this.lineBuffer, this.direction, "horizontal" === this.direction ? this.frame.isWidthMax : this.frame.isHeightMax);
16586
16423
  this.frame.lines.push(line), this.frame.actualHeight += line.height, this.y += line.height, this.lineBuffer.length = 0, this.lineWidth = this.maxAscent = this.maxDescent = this.maxAscentForBlank = this.maxDescentForBlank = 0;
16587
16424
  }
16588
- deal(paragraph) {
16589
- let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
16425
+ deal(paragraph, singleLine = !1) {
16590
16426
  paragraph instanceof RichTextIcon ? "horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : 0 === this.lineBuffer.length ? (this.store(paragraph), this.send()) : (this.send(), this.deal(paragraph)) : "number" != typeof this.width || this.width < 0 || (paragraph.newLine && this.send(), 0 !== paragraph.text.length && ("horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : this.lineWidth === this[this.directionKey.width] ? (this.send(), this.deal(paragraph)) : this.cut(paragraph, singleLine)));
16591
16427
  }
16592
16428
  cut(paragraph, singleLine) {
@@ -17464,8 +17300,7 @@
17464
17300
  addUpdateShapeAndBoundsTag() {
17465
17301
  super.addUpdateShapeAndBoundsTag(), this.shadowHost && this.shadowHost.addUpdateBoundTag();
17466
17302
  }
17467
- tryUpdateGlobalTransMatrix() {
17468
- let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
17303
+ tryUpdateGlobalTransMatrix(clearTag = !0) {
17469
17304
  if (this.shouldUpdateGlobalMatrix()) {
17470
17305
  const m = this.transMatrix;
17471
17306
  this._globalTransMatrix ? this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f) : this._globalTransMatrix = m.clone(), this.doUpdateGlobalMatrix(), clearTag && this.clearUpdateGlobalPositionTag();
@@ -17618,7 +17453,7 @@
17618
17453
  unRegister(plugin) {
17619
17454
  "onStartupFinished" === plugin.activeEvent ? this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1) : "onRegister" === plugin.activeEvent && this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1), plugin.deactivate(this);
17620
17455
  }
17621
- release() {
17456
+ release(...params) {
17622
17457
  this.onStartupFinishedPlugin.forEach(plugin => {
17623
17458
  plugin.deactivate(this);
17624
17459
  }), this.onStartupFinishedPlugin = [], this.onRegisterPlugin.forEach(plugin => {
@@ -17765,9 +17600,7 @@
17765
17600
  zIdxArray: zIdxArray
17766
17601
  };
17767
17602
  }
17768
- function foreach(graphic, defaultZIndex, cb) {
17769
- let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
17770
- let sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
17603
+ function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
17771
17604
  let needSort = !1;
17772
17605
  if (sort3d) needSort = !0;else {
17773
17606
  let lastZIndex;
@@ -17798,14 +17631,12 @@
17798
17631
  }
17799
17632
  } else graphic.forEachChildren(cb, reverse);
17800
17633
  }
17801
- function foreachAsync(graphic, defaultZIndex, cb) {
17802
- let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
17634
+ function foreachAsync(graphic, defaultZIndex, cb, reverse = !1) {
17803
17635
  return __awaiter$5(this, void 0, void 0, function* () {
17804
17636
  yield graphic.forEachChildrenAsync(cb, reverse);
17805
17637
  });
17806
17638
  }
17807
- function findNextGraphic(graphic, id, defaultZIndex) {
17808
- let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
17639
+ function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
17809
17640
  let needSort = !1;
17810
17641
  graphic.forEachChildren((item, i) => {
17811
17642
  const {
@@ -18541,8 +18372,7 @@
18541
18372
  get eventSystem() {
18542
18373
  return this._eventSystem;
18543
18374
  }
18544
- constructor() {
18545
- let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18375
+ constructor(params = {}) {
18546
18376
  var _a;
18547
18377
  super({}), this.tickedBeforeRender = !0, this._onVisibleChange = visible => {
18548
18378
  if (!(this._skipRender < 0)) if (visible) {
@@ -18577,8 +18407,7 @@
18577
18407
  background: this._background
18578
18408
  }), this.ticker.on("afterTick", this.afterTickCb);
18579
18409
  }
18580
- pauseRender() {
18581
- let sr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
18410
+ pauseRender(sr = -1) {
18582
18411
  this._skipRender = sr;
18583
18412
  }
18584
18413
  resumeRender() {
@@ -18600,8 +18429,7 @@
18600
18429
  optmize(params) {
18601
18430
  this.optmizeRender(params.skipRenderWithOutRange), this.params.optimize = params;
18602
18431
  }
18603
- optmizeRender() {
18604
- let skipRenderWithOutRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
18432
+ optmizeRender(skipRenderWithOutRange = !1) {
18605
18433
  skipRenderWithOutRange && (this._skipRender = this._skipRender < 0 ? this._skipRender : this.window.isVisible() ? 0 : 1, this.window.onVisibleChange(this._onVisibleChange));
18606
18434
  }
18607
18435
  getTimeline() {
@@ -18855,18 +18683,15 @@
18855
18683
  renderStyle: this.renderStyle
18856
18684
  }, params)));
18857
18685
  }
18858
- resizeWindow(w, h) {
18859
- let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
18686
+ resizeWindow(w, h, rerender = !0) {
18860
18687
  this.window.resize(w, h), rerender && this.render();
18861
18688
  }
18862
- resize(w, h) {
18863
- let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
18689
+ resize(w, h, rerender = !0) {
18864
18690
  "released" !== this.releaseStatus && (this.window.hasSubView() || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.window.resize(w, h), this.forEachChildren(c => {
18865
18691
  c.resize(w, h);
18866
18692
  }), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render());
18867
18693
  }
18868
- resizeView(w, h) {
18869
- let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
18694
+ resizeView(w, h, rerender = !0) {
18870
18695
  "released" !== this.releaseStatus && (this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.forEachChildren(c => {
18871
18696
  c.resizeView(w, h);
18872
18697
  }), this.camera && (this.camera.params = Object.assign(Object.assign({}, this.camera.params), {
@@ -18880,8 +18705,7 @@
18880
18705
  c.resizeView(this.viewBox.width(), this.viewBox.height());
18881
18706
  }), isRerender && this.render();
18882
18707
  }
18883
- setDpr(dpr) {
18884
- let rerender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
18708
+ setDpr(dpr, rerender = !0) {
18885
18709
  this.forEachChildren(c => {
18886
18710
  c.setDpr(dpr);
18887
18711
  }), rerender && this.render();
@@ -18931,8 +18755,7 @@
18931
18755
  });
18932
18756
  });
18933
18757
  }
18934
- renderToNewWindow() {
18935
- let viewBox = arguments.length > 1 ? arguments[1] : undefined;
18758
+ renderToNewWindow(fullImage = !0, viewBox) {
18936
18759
  if ("released" === this.releaseStatus) return;
18937
18760
  const window = container.get(VWindow),
18938
18761
  x1 = viewBox ? -viewBox.x1 : 0,
@@ -18956,9 +18779,7 @@
18956
18779
  title: ""
18957
18780
  }), this.renderTo(window), window;
18958
18781
  }
18959
- toCanvas() {
18960
- let fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
18961
- let viewBox = arguments.length > 1 ? arguments[1] : undefined;
18782
+ toCanvas(fullImage = !0, viewBox) {
18962
18783
  if ("released" === this.releaseStatus) return;
18963
18784
  const c = this.renderToNewWindow(fullImage, viewBox).getNativeHandler();
18964
18785
  return c.nativeCanvas ? c.nativeCanvas : null;
@@ -19016,8 +18837,7 @@
19016
18837
  getContext() {
19017
18838
  throw new Error("不支持getContext");
19018
18839
  }
19019
- setTransformForCurrent() {
19020
- let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
18840
+ setTransformForCurrent(force = !1) {
19021
18841
  !force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix = this.cloneMatrix(this.matrix));
19022
18842
  }
19023
18843
  get currentMatrix() {
@@ -19035,8 +18855,7 @@
19035
18855
  highPerformanceRestore() {
19036
18856
  this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
19037
18857
  }
19038
- rotate(rad) {
19039
- let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
18858
+ rotate(rad, setTransform = !0) {
19040
18859
  this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
19041
18860
  }
19042
18861
  save() {
@@ -19047,55 +18866,41 @@
19047
18866
  const matrix = this.cloneMatrix(this.matrix);
19048
18867
  this.stack.push(matrix);
19049
18868
  }
19050
- scale(sx, sy) {
19051
- let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
18869
+ scale(sx, sy, setTransform = !0) {
19052
18870
  this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
19053
18871
  }
19054
- setScale(sx, sy) {
19055
- let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
18872
+ setScale(sx, sy, setTransform = !0) {
19056
18873
  this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
19057
18874
  }
19058
- scalePoint(sx, sy, px, py) {
19059
- let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
18875
+ scalePoint(sx, sy, px, py, setTransform = !0) {
19060
18876
  this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
19061
18877
  }
19062
- setTransform(a, b, c, d, e, f) {
19063
- let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
19064
- let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
18878
+ setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
19065
18879
  this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
19066
18880
  }
19067
- setTransformFromMatrix(matrix) {
19068
- let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
19069
- let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
18881
+ setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
19070
18882
  this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
19071
18883
  }
19072
- resetTransform() {
19073
- let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
19074
- let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
18884
+ resetTransform(setTransform = !0, dpr = this.dpr) {
19075
18885
  this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
19076
18886
  }
19077
- transform(a, b, c, d, e, f) {
19078
- let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
18887
+ transform(a, b, c, d, e, f, setTransform = !0) {
19079
18888
  this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
19080
18889
  }
19081
18890
  transformFromMatrix(matrix, setTransform) {
19082
18891
  this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
19083
18892
  }
19084
- translate(x, y) {
19085
- let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
18893
+ translate(x, y, setTransform = !0) {
19086
18894
  this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
19087
18895
  }
19088
- rotateDegrees(deg) {
19089
- let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
18896
+ rotateDegrees(deg, setTransform = !0) {
19090
18897
  const rad = deg * Math.PI / 180;
19091
18898
  this.rotate(rad, setTransform);
19092
18899
  }
19093
- rotateAbout(rad, x, y) {
19094
- let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
18900
+ rotateAbout(rad, x, y, setTransform = !0) {
19095
18901
  this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
19096
18902
  }
19097
- rotateDegreesAbout(deg, x, y) {
19098
- let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
18903
+ rotateDegreesAbout(deg, x, y, setTransform = !0) {
19099
18904
  this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
19100
18905
  }
19101
18906
  beginPath() {
@@ -19189,19 +18994,16 @@
19189
18994
  setTextStyleWithoutAlignBaseline(params, defaultParams) {}
19190
18995
  setTextStyle(params, defaultParams) {}
19191
18996
  draw() {}
19192
- clearMatrix() {
19193
- let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
19194
- let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
18997
+ clearMatrix(setTransform = !0, dpr = this.dpr) {
19195
18998
  this.setTransformFromMatrix(initMatrix, setTransform, dpr);
19196
18999
  }
19197
19000
  setClearMatrix(a, b, c, d, e, f) {
19198
19001
  this._clearMatrix.setValue(a, b, c, d, e, f);
19199
19002
  }
19200
- onlyTranslate() {
19201
- let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
19003
+ onlyTranslate(dpr = this.dpr) {
19202
19004
  return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
19203
19005
  }
19204
- release() {
19006
+ release(...params) {
19205
19007
  this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
19206
19008
  }
19207
19009
  };
@@ -19298,7 +19100,7 @@
19298
19100
  transferToImageBitmap() {
19299
19101
  throw new Error("暂未实现");
19300
19102
  }
19301
- release() {
19103
+ release(...params) {
19302
19104
  this.controled && this._nativeCanvas.parentElement && this._nativeCanvas.parentElement.removeChild(this._nativeCanvas);
19303
19105
  }
19304
19106
  }
@@ -19337,7 +19139,7 @@
19337
19139
  });
19338
19140
  };
19339
19141
  exports.BaseEnvContribution = class BaseEnvContribution {
19340
- configure(service) {
19142
+ configure(service, ...p) {
19341
19143
  service.env === this.type && service.setActiveEnvContribution(this);
19342
19144
  }
19343
19145
  getNativeAABBBounds(dom) {
@@ -19434,7 +19236,7 @@
19434
19236
  configure(window, global) {
19435
19237
  global.env === this.type && window.setWindowHandler(this);
19436
19238
  }
19437
- release() {
19239
+ release(...params) {
19438
19240
  this.releaseWindow();
19439
19241
  }
19440
19242
  isVisible(bbox) {
@@ -19463,8 +19265,7 @@
19463
19265
  exports.BaseWindowHandlerContribution = __decorate$1d([injectable(), __metadata$X("design:paramtypes", [])], exports.BaseWindowHandlerContribution);
19464
19266
 
19465
19267
  class DirectionalLight {
19466
- constructor(dir, color) {
19467
- let ambient = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .8;
19268
+ constructor(dir, color, ambient = .8) {
19468
19269
  this.dir = dir, this.color = color, this.colorRgb = ColorStore.Get(color, exports.ColorType.Color1), this.ambient = ambient;
19469
19270
  const length = sqrt(dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2]);
19470
19271
  this.formatedDir = [dir[0] / length, dir[1] / length, dir[2] / length];
@@ -20186,7 +19987,7 @@
20186
19987
  get length() {
20187
19988
  return this.pools.length;
20188
19989
  }
20189
- release() {
19990
+ release(...params) {
20190
19991
  this.pools = [];
20191
19992
  }
20192
19993
  }
@@ -21153,8 +20954,7 @@
21153
20954
  tryLayoutChildren(graphic) {
21154
20955
  graphic.firstChild && this.tryLayout(graphic.firstChild);
21155
20956
  }
21156
- tryLayout(graphic) {
21157
- let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
20957
+ tryLayout(graphic, force = !0) {
21158
20958
  if (this.pause) return;
21159
20959
  const p = graphic.parent;
21160
20960
  if (!(force || p && graphic.needUpdateLayout())) return;
@@ -21219,11 +21019,10 @@
21219
21019
  if (mainLen > main.len && "wrap" === flexWrap) {
21220
21020
  let tempMainL = 0,
21221
21021
  tempCrossL = 0;
21222
- mianLenArray.forEach((_ref, i) => {
21223
- let {
21224
- mainLen: mainLen,
21225
- crossLen: crossLen
21226
- } = _ref;
21022
+ mianLenArray.forEach(({
21023
+ mainLen: mainLen,
21024
+ crossLen: crossLen
21025
+ }, i) => {
21227
21026
  tempMainL + mainLen > main.len ? 0 === tempMainL ? (mainList.push({
21228
21027
  idx: i,
21229
21028
  mainLen: tempMainL + mainLen,
@@ -22196,16 +21995,13 @@
22196
21995
  function T(t) {
22197
21996
  return t.randomizer || (t.randomizer = new l(t.seed || 0)), t.randomizer.next();
22198
21997
  }
22199
- function D(t, e, s) {
22200
- let n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
21998
+ function D(t, e, s, n = 1) {
22201
21999
  return s.roughness * n * (T(s) * (e - t) + t);
22202
22000
  }
22203
- function A(t, e) {
22204
- let s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
22001
+ function A(t, e, s = 1) {
22205
22002
  return D(-t, t, e, s);
22206
22003
  }
22207
- function I(t, e, s, n, a) {
22208
- let o = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !1;
22004
+ function I(t, e, s, n, a, o = !1) {
22209
22005
  const h = o ? a.disableMultiStrokeFill : a.disableMultiStroke,
22210
22006
  r = C(t, e, s, n, a, !0, !1);
22211
22007
  if (h) return r;
@@ -22396,9 +22192,7 @@
22396
22192
  }
22397
22193
  return Math.sqrt(i) > n ? (Z(t, e, c + 1, n, o), Z(t, c, s, n, o)) : (o.length || o.push(h), o.push(r)), o;
22398
22194
  }
22399
- function Q(t) {
22400
- let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .15;
22401
- let s = arguments.length > 2 ? arguments[2] : undefined;
22195
+ function Q(t, e = .15, s) {
22402
22196
  const n = [],
22403
22197
  a = (t.length - 1) / 3;
22404
22198
  for (let s = 0; s < a; s++) {
@@ -22477,9 +22271,7 @@
22477
22271
  const s = this._o(e);
22478
22272
  return this._d("linearPath", [m$2(t, !1, s)], s);
22479
22273
  }
22480
- arc(t, e, s, n, a, o) {
22481
- let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
22482
- let r = arguments.length > 7 ? arguments[7] : undefined;
22274
+ arc(t, e, s, n, a, o, h = !1, r) {
22483
22275
  const i = this._o(r),
22484
22276
  c = [],
22485
22277
  l = O(t, e, s, n, a, o, h, !0, i);
@@ -22510,8 +22302,7 @@
22510
22302
  n = [],
22511
22303
  a = x(t, s);
22512
22304
  if (s.fill && s.fill !== H && t.length >= 3) {
22513
- const e = Q(function (t) {
22514
- let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
22305
+ const e = Q(function (t, e = 0) {
22515
22306
  const s = t.length;
22516
22307
  if (s < 3) throw new Error("A curve must have at least three points.");
22517
22308
  const n = [];
@@ -22711,8 +22502,7 @@
22711
22502
  let n = s.fillWeight;
22712
22503
  n < 0 && (n = s.strokeWidth / 2), t.save(), s.fillLineDash && t.setLineDash(s.fillLineDash), s.fillLineDashOffset && (t.lineDashOffset = s.fillLineDashOffset), t.strokeStyle = s.fill || "", t.lineWidth = n, this._drawToContext(t, e, s.fixedDecimalPlaceDigits), t.restore();
22713
22504
  }
22714
- _drawToContext(t, e, s) {
22715
- let n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "nonzero";
22505
+ _drawToContext(t, e, s, n = "nonzero") {
22716
22506
  t.beginPath();
22717
22507
  for (const n of e.ops) {
22718
22508
  const e = "number" == typeof s && s >= 0 ? n.data.map(t => +t.toFixed(s)) : n.data;
@@ -22759,9 +22549,7 @@
22759
22549
  const s = this.gen.polygon(t, e);
22760
22550
  return this.draw(s), s;
22761
22551
  }
22762
- arc(t, e, s, n, a, o) {
22763
- let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
22764
- let r = arguments.length > 7 ? arguments[7] : undefined;
22552
+ arc(t, e, s, n, a, o, h = !1, r) {
22765
22553
  const i = this.gen.arc(t, e, s, n, a, o, h, r);
22766
22554
  return this.draw(i), i;
22767
22555
  }
@@ -22840,9 +22628,7 @@
22840
22628
  const s = this.gen.polygon(t, e);
22841
22629
  return this.draw(s);
22842
22630
  }
22843
- arc(t, e, s, n, a, o) {
22844
- let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
22845
- let r = arguments.length > 7 ? arguments[7] : undefined;
22631
+ arc(t, e, s, n, a, o, h = !1, r) {
22846
22632
  const i = this.gen.arc(t, e, s, n, a, o, h, r);
22847
22633
  return this.draw(i);
22848
22634
  }
@@ -23647,7 +23433,7 @@
23647
23433
  if (isArray$1(list)) return list.forEach(i => flatten(i, out));
23648
23434
  out.push(list);
23649
23435
  }
23650
- function jsx(type, config) {
23436
+ function jsx(type, config, ...children) {
23651
23437
  const _a = config || {},
23652
23438
  {
23653
23439
  key: key,
@@ -23662,9 +23448,6 @@
23662
23448
  let c = type;
23663
23449
  isString$1(type) && (c = graphicCreator[type]);
23664
23450
  const childrenList = [];
23665
- for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
23666
- children[_key - 2] = arguments[_key];
23667
- }
23668
23451
  children.length && flatten(1 === children.length ? children[0] : children, childrenList);
23669
23452
  const g = "Group" === c.name ? new c(attribute) : c(config);
23670
23453
  if (parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), name && (g.name = name), isArray$1(animation)) {
@@ -23809,8 +23592,7 @@
23809
23592
  };
23810
23593
  };
23811
23594
  class Gesture extends EventEmitter {
23812
- constructor(element) {
23813
- let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23595
+ constructor(element, config = {}) {
23814
23596
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
23815
23597
  super(), this.cachedEvents = [], this.startPoints = [], this.processEvent = {}, this.throttleTimer = 0, this.emitThrottles = [], this.lastTapTarget = null, this.onStart = ev => {
23816
23598
  this.cachedEvents = [], this.startPoints = [], this.reset(), this.startTime = clock.now();
@@ -24155,8 +23937,7 @@
24155
23937
  getContext() {
24156
23938
  return this.nativeContext;
24157
23939
  }
24158
- setTransformForCurrent() {
24159
- let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
23940
+ setTransformForCurrent(force = !1) {
24160
23941
  !force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix.setValue(this.matrix.a, this.matrix.b, this.matrix.c, this.matrix.d, this.matrix.e, this.matrix.f), this.nativeContext.setTransform(this.matrix.a, this.matrix.b, this.matrix.c, this.matrix.d, this.matrix.e, this.matrix.f));
24161
23942
  }
24162
23943
  get currentMatrix() {
@@ -24174,8 +23955,7 @@
24174
23955
  highPerformanceRestore() {
24175
23956
  this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
24176
23957
  }
24177
- rotate(rad) {
24178
- let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
23958
+ rotate(rad, setTransform = !0) {
24179
23959
  this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
24180
23960
  }
24181
23961
  save() {
@@ -24186,55 +23966,41 @@
24186
23966
  const matrix = this.cloneMatrix(this.matrix);
24187
23967
  this.stack.push(matrix);
24188
23968
  }
24189
- scale(sx, sy) {
24190
- let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
23969
+ scale(sx, sy, setTransform = !0) {
24191
23970
  this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
24192
23971
  }
24193
- setScale(sx, sy) {
24194
- let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
23972
+ setScale(sx, sy, setTransform = !0) {
24195
23973
  this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
24196
23974
  }
24197
- scalePoint(sx, sy, px, py) {
24198
- let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
23975
+ scalePoint(sx, sy, px, py, setTransform = !0) {
24199
23976
  this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
24200
23977
  }
24201
- setTransform(a, b, c, d, e, f) {
24202
- let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
24203
- let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
23978
+ setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
24204
23979
  this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
24205
23980
  }
24206
- setTransformFromMatrix(matrix) {
24207
- let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
24208
- let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
23981
+ setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
24209
23982
  this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
24210
23983
  }
24211
- resetTransform() {
24212
- let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
24213
- let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
23984
+ resetTransform(setTransform = !0, dpr = this.dpr) {
24214
23985
  this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
24215
23986
  }
24216
- transform(a, b, c, d, e, f) {
24217
- let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
23987
+ transform(a, b, c, d, e, f, setTransform = !0) {
24218
23988
  this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
24219
23989
  }
24220
23990
  transformFromMatrix(matrix, setTransform) {
24221
23991
  this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
24222
23992
  }
24223
- translate(x, y) {
24224
- let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
23993
+ translate(x, y, setTransform = !0) {
24225
23994
  this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
24226
23995
  }
24227
- rotateDegrees(deg) {
24228
- let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
23996
+ rotateDegrees(deg, setTransform = !0) {
24229
23997
  const rad = deg * Math.PI / 180;
24230
23998
  this.rotate(rad, setTransform);
24231
23999
  }
24232
- rotateAbout(rad, x, y) {
24233
- let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
24000
+ rotateAbout(rad, x, y, setTransform = !0) {
24234
24001
  this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
24235
24002
  }
24236
- rotateDegreesAbout(deg, x, y) {
24237
- let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
24003
+ rotateDegreesAbout(deg, x, y, setTransform = !0) {
24238
24004
  this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
24239
24005
  }
24240
24006
  beginPath() {
@@ -24370,8 +24136,7 @@
24370
24136
  isPointInStroke(x, y) {
24371
24137
  return this.nativeContext.isPointInStroke(x, y);
24372
24138
  }
24373
- measureText(text) {
24374
- let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
24139
+ measureText(text, method = application.global.measureTextMethod) {
24375
24140
  var _a, _b;
24376
24141
  if (!method || "native" === method) return this.nativeContext.measureText(text);
24377
24142
  this.mathTextMeasure || (this.mathTextMeasure = application.graphicUtil.createTextMeasureInstance({}, {}, () => this.canvas.nativeCanvas));
@@ -24504,19 +24269,16 @@
24504
24269
  this.fontFamily = fontFamily, this.fontSize = fontSize, _context.textAlign = null !== (_a = params.textAlign) && void 0 !== _a ? _a : defaultParams.textAlign, _context.textBaseline = null !== (_b = params.textBaseline) && void 0 !== _b ? _b : defaultParams.textBaseline;
24505
24270
  }
24506
24271
  draw() {}
24507
- clearMatrix() {
24508
- let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
24509
- let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
24272
+ clearMatrix(setTransform = !0, dpr = this.dpr) {
24510
24273
  this.setTransformFromMatrix(this._clearMatrix, setTransform, dpr);
24511
24274
  }
24512
24275
  setClearMatrix(a, b, c, d, e, f) {
24513
24276
  this._clearMatrix.setValue(a, b, c, d, e, f);
24514
24277
  }
24515
- onlyTranslate() {
24516
- let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
24278
+ onlyTranslate(dpr = this.dpr) {
24517
24279
  return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
24518
24280
  }
24519
- release() {
24281
+ release(...params) {
24520
24282
  this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
24521
24283
  }
24522
24284
  };
@@ -24923,8 +24685,7 @@
24923
24685
  this.dom = dom;
24924
24686
  }
24925
24687
  }
24926
- function createImageElement$1(src) {
24927
- let isSvg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
24688
+ function createImageElement$1(src, isSvg = !1) {
24928
24689
  const img = document.createElement("img");
24929
24690
  if (application.global.isImageAnonymous && (img.crossOrigin = "anonymous"), isSvg) {
24930
24691
  const data = new Blob([src], {
@@ -25071,7 +24832,7 @@
25071
24832
  getDocument() {
25072
24833
  return document;
25073
24834
  }
25074
- release() {}
24835
+ release(...params) {}
25075
24836
  getElementTop(element, baseWindow) {
25076
24837
  let actualTop = element.offsetTop,
25077
24838
  current = element.offsetParent;
@@ -25114,8 +24875,7 @@
25114
24875
  browserEnvModule.isBrowserBound || (browserEnvModule.isBrowserBound = !0, bind(exports.BrowserEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(exports.BrowserEnvContribution));
25115
24876
  });
25116
24877
  browserEnvModule.isBrowserBound = !1;
25117
- function loadBrowserEnv(container) {
25118
- let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
24878
+ function loadBrowserEnv(container, loadPicker = !0) {
25119
24879
  loadBrowserEnv.__loaded || (loadBrowserEnv.__loaded = !0, container.load(browserEnvModule), container.load(browserCanvasModule), container.load(browserWindowModule), loadPicker && loadCanvasPicker(container));
25120
24880
  }
25121
24881
  loadBrowserEnv.__loaded = !1;
@@ -25187,7 +24947,7 @@
25187
24947
  init() {
25188
24948
  this._context = new FeishuContext2d(this, this._dpr);
25189
24949
  }
25190
- release() {}
24950
+ release(...params) {}
25191
24951
  };
25192
24952
  FeishuCanvas.env = "feishu", FeishuCanvas = __decorate$T([injectable(), __metadata$J("design:paramtypes", [Object])], FeishuCanvas);
25193
24953
 
@@ -25949,7 +25709,7 @@
25949
25709
  getDocument() {
25950
25710
  return null;
25951
25711
  }
25952
- release() {}
25712
+ release(...params) {}
25953
25713
  mapToCanvasPoint(event) {
25954
25714
  var _a;
25955
25715
  return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
@@ -25961,8 +25721,7 @@
25961
25721
  feishuEnvModule.isFeishuBound || (feishuEnvModule.isFeishuBound = !0, bind(FeishuEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(FeishuEnvContribution));
25962
25722
  });
25963
25723
  feishuEnvModule.isFeishuBound = !1;
25964
- function loadFeishuEnv(container) {
25965
- let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
25724
+ function loadFeishuEnv(container, loadPicker = !0) {
25966
25725
  loadFeishuEnv.__loaded || (loadFeishuEnv.__loaded = !0, container.load(feishuEnvModule), container.load(feishuCanvasModule), container.load(feishuWindowModule), loadPicker && loadMathPicker(container));
25967
25726
  }
25968
25727
  loadFeishuEnv.__loaded = !1;
@@ -26013,8 +25772,7 @@
26013
25772
  _context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
26014
25773
  }
26015
25774
  }
26016
- measureText(text) {
26017
- let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
25775
+ measureText(text, method = application.global.measureTextMethod) {
26018
25776
  this.setTransform(1, 0, 0, 1, 0, 0, !0, application.global.devicePixelRatio);
26019
25777
  return {
26020
25778
  width: super.measureText(text, method).width,
@@ -26059,7 +25817,7 @@
26059
25817
  this._pixelWidth = width * this._dpr, this._pixelHeight = height * this._dpr, this._displayWidth = width, this._displayHeight = height, this._nativeCanvas.width = this._pixelWidth, this._nativeCanvas.height = this._pixelHeight, this._nativeCanvas.nativeCanvas && (this._nativeCanvas.nativeCanvas.width = this._pixelWidth, this._nativeCanvas.nativeCanvas.height = this._pixelHeight);
26060
25818
  this._context.dpr = this._dpr;
26061
25819
  }
26062
- release() {}
25820
+ release(...params) {}
26063
25821
  };
26064
25822
  LynxCanvas.env = "lynx", LynxCanvas = __decorate$D([injectable(), __metadata$w("design:paramtypes", [Object])], LynxCanvas);
26065
25823
 
@@ -26249,8 +26007,7 @@
26249
26007
  canvasMap.set(id, canvas), freeCanvasList.push(canvas);
26250
26008
  }
26251
26009
  }
26252
- function createImageElement(src) {
26253
- let isSvg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
26010
+ function createImageElement(src, isSvg = !1) {
26254
26011
  if (isSvg) return Promise.reject();
26255
26012
  const img = lynx.createImage(src);
26256
26013
  return new Promise((resolve, reject) => {
@@ -26333,7 +26090,7 @@
26333
26090
  getDocument() {
26334
26091
  return null;
26335
26092
  }
26336
- release() {}
26093
+ release(...params) {}
26337
26094
  };
26338
26095
  LynxEnvContribution = __decorate$B([injectable(), __metadata$u("design:paramtypes", [])], LynxEnvContribution);
26339
26096
 
@@ -26341,8 +26098,7 @@
26341
26098
  lynxEnvModule.isLynxBound || (lynxEnvModule.isLynxBound = !0, bind(LynxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(LynxEnvContribution));
26342
26099
  });
26343
26100
  lynxEnvModule.isLynxBound = !1;
26344
- function loadLynxEnv(container) {
26345
- let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
26101
+ function loadLynxEnv(container, loadPicker = !0) {
26346
26102
  loadLynxEnv.__loaded || (loadLynxEnv.__loaded = !0, container.load(lynxEnvModule), container.load(lynxCanvasModule), container.load(lynxWindowModule), loadPicker && loadMathPicker(container));
26347
26103
  }
26348
26104
  loadLynxEnv.__loaded = !1;
@@ -26367,7 +26123,7 @@
26367
26123
  if (!context) throw new Error("发生错误,获取2d上下文失败");
26368
26124
  this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = null != dpr ? dpr : 1;
26369
26125
  }
26370
- release() {}
26126
+ release(...params) {}
26371
26127
  };
26372
26128
  NodeContext2d.env = "node", NodeContext2d = __decorate$A([injectable(), __metadata$t("design:paramtypes", [Object, Number])], NodeContext2d);
26373
26129
 
@@ -26388,7 +26144,7 @@
26388
26144
  init() {
26389
26145
  this._context = new NodeContext2d(this, this._dpr), this.nativeCanvas.width = this._pixelWidth, this.nativeCanvas.height = this._pixelHeight;
26390
26146
  }
26391
- release() {
26147
+ release(...params) {
26392
26148
  this._nativeCanvas.release && isFunction$1(this._nativeCanvas.release) && this._nativeCanvas.release();
26393
26149
  }
26394
26150
  };
@@ -26481,8 +26237,7 @@
26481
26237
  getDpr() {
26482
26238
  return this.canvas.dpr;
26483
26239
  }
26484
- getImageBuffer() {
26485
- let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "image/png";
26240
+ getImageBuffer(type = "image/png") {
26486
26241
  return this.canvas.nativeCanvas.toBuffer(type);
26487
26242
  }
26488
26243
  addEventListener(type, listener, options) {}
@@ -26585,7 +26340,7 @@
26585
26340
  return null;
26586
26341
  }
26587
26342
  dispatchEvent(event) {}
26588
- release() {}
26343
+ release(...params) {}
26589
26344
  createOffscreenCanvas(params) {}
26590
26345
  };
26591
26346
  NodeEnvContribution = __decorate$x([injectable()], NodeEnvContribution);
@@ -26594,7 +26349,7 @@
26594
26349
  nodeEnvModule.isNodeBound || (nodeEnvModule.isNodeBound = !0, bind(NodeEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(NodeEnvContribution));
26595
26350
  });
26596
26351
  nodeEnvModule.isNodeBound = !1;
26597
- function loadNodeEnv(container) {
26352
+ function loadNodeEnv(container, loadPicker = !0) {
26598
26353
  loadNodeEnv.__loaded || (loadNodeEnv.__loaded = !0, container.load(nodeEnvModule), container.load(nodeCanvasModule), container.load(nodeWindowModule));
26599
26354
  }
26600
26355
  loadNodeEnv.__loaded = !1;
@@ -26709,7 +26464,7 @@
26709
26464
  init() {
26710
26465
  this._context = new TaroContext2d(this, this._dpr);
26711
26466
  }
26712
- release() {}
26467
+ release(...params) {}
26713
26468
  };
26714
26469
  TaroCanvas.env = "taro", TaroCanvas = __decorate$v([injectable(), __metadata$q("design:paramtypes", [Object])], TaroCanvas);
26715
26470
 
@@ -26978,7 +26733,7 @@
26978
26733
  getDocument() {
26979
26734
  return null;
26980
26735
  }
26981
- release() {}
26736
+ release(...params) {}
26982
26737
  };
26983
26738
  TaroEnvContribution = __decorate$t([injectable(), __metadata$o("design:paramtypes", [])], TaroEnvContribution);
26984
26739
 
@@ -26986,8 +26741,7 @@
26986
26741
  taroEnvModule.isTaroBound || (taroEnvModule.isTaroBound = !0, bind(TaroEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(TaroEnvContribution));
26987
26742
  });
26988
26743
  taroEnvModule.isTaroBound = !1;
26989
- function loadTaroEnv(container) {
26990
- let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
26744
+ function loadTaroEnv(container, loadPicker = !0) {
26991
26745
  loadTaroEnv.__loaded || (loadTaroEnv.__loaded = !0, container.load(taroEnvModule), container.load(taroCanvasModule), container.load(taroWindowModule), loadPicker && loadMathPicker(container));
26992
26746
  }
26993
26747
  loadTaroEnv.__loaded = !1;
@@ -27027,7 +26781,7 @@
27027
26781
  init() {
27028
26782
  this._context = new WxContext2d(this, this._dpr);
27029
26783
  }
27030
- release() {}
26784
+ release(...params) {}
27031
26785
  };
27032
26786
  WxCanvas.env = "wx", WxCanvas = __decorate$r([injectable(), __metadata$n("design:paramtypes", [Object])], WxCanvas);
27033
26787
 
@@ -27300,7 +27054,7 @@
27300
27054
  getDocument() {
27301
27055
  return null;
27302
27056
  }
27303
- release() {}
27057
+ release(...params) {}
27304
27058
  mapToCanvasPoint(event) {
27305
27059
  var _a;
27306
27060
  return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
@@ -27312,8 +27066,7 @@
27312
27066
  wxEnvModule._isWxBound || (wxEnvModule._isWxBound = !0, bind(WxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(WxEnvContribution));
27313
27067
  });
27314
27068
  wxEnvModule._isWxBound = !1;
27315
- function loadWxEnv(container) {
27316
- let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
27069
+ function loadWxEnv(container, loadPicker = !0) {
27317
27070
  loadWxEnv.__loaded || (loadWxEnv.__loaded = !0, container.load(wxEnvModule), container.load(wxCanvasModule), container.load(wxWindowModule), loadPicker && loadMathPicker(container));
27318
27071
  }
27319
27072
  loadWxEnv.__loaded = !1;
@@ -27325,7 +27078,7 @@
27325
27078
  loadAllModule(container);
27326
27079
  }
27327
27080
  function loadAllModule(container) {
27328
- loadAllModule.__loaded || (loadAllModule.__loaded = !0, loadBrowserEnv(container, !1), loadFeishuEnv(container, !1), loadLynxEnv(container, !1), loadNodeEnv(container), loadTaroEnv(container, !1), loadWxEnv(container, !1), loadCanvasPicker(container), vglobal.hooks.onSetEnv.tap("loadMathPicker", (lastEnv, env) => {
27081
+ loadAllModule.__loaded || (loadAllModule.__loaded = !0, loadBrowserEnv(container, !1), loadFeishuEnv(container, !1), loadLynxEnv(container, !1), loadNodeEnv(container, !1), loadTaroEnv(container, !1), loadWxEnv(container, !1), loadCanvasPicker(container), vglobal.hooks.onSetEnv.tap("loadMathPicker", (lastEnv, env) => {
27329
27082
  "browser" !== env && loadMathPicker(container);
27330
27083
  }));
27331
27084
  }
@@ -27361,7 +27114,7 @@
27361
27114
  init() {
27362
27115
  this._context = new TTContext2d(this, this._dpr);
27363
27116
  }
27364
- release() {}
27117
+ release(...params) {}
27365
27118
  };
27366
27119
  TTCanvas.env = "tt", TTCanvas = __decorate$n([injectable(), __metadata$k("design:paramtypes", [Object])], TTCanvas);
27367
27120
 
@@ -27629,7 +27382,7 @@
27629
27382
  getDocument() {
27630
27383
  return null;
27631
27384
  }
27632
- release() {}
27385
+ release(...params) {}
27633
27386
  mapToCanvasPoint(event) {
27634
27387
  var _a;
27635
27388
  return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
@@ -27641,8 +27394,7 @@
27641
27394
  ttEnvModule.isTTBound || (ttEnvModule.isTTBound = !0, bind(TTEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(TTEnvContribution));
27642
27395
  });
27643
27396
  ttEnvModule.isTTBound = !1;
27644
- function loadTTEnv(container) {
27645
- let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
27397
+ function loadTTEnv(container, loadPicker = !0) {
27646
27398
  loadTTEnv.__loaded || (loadTTEnv.__loaded = !0, container.load(ttEnvModule), container.load(ttCanvasModule), container.load(ttWindowModule), loadPicker && loadMathPicker(container));
27647
27399
  }
27648
27400
  loadTTEnv.__loaded = !1;
@@ -27693,8 +27445,7 @@
27693
27445
  _context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
27694
27446
  }
27695
27447
  }
27696
- measureText(text) {
27697
- let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
27448
+ measureText(text, method = application.global.measureTextMethod) {
27698
27449
  this.setTransform(1, 0, 0, 1, 0, 0, !0, application.global.devicePixelRatio);
27699
27450
  return super.measureText(text, method);
27700
27451
  }
@@ -27754,7 +27505,7 @@
27754
27505
  this._context = new HarmonyContext2d(this, this._dpr);
27755
27506
  }
27756
27507
  resize(width, height) {}
27757
- release() {}
27508
+ release(...params) {}
27758
27509
  };
27759
27510
  HarmonyCanvas.env = "harmony", HarmonyCanvas = __decorate$j([injectable(), __metadata$h("design:paramtypes", [Object])], HarmonyCanvas);
27760
27511
 
@@ -27998,7 +27749,7 @@
27998
27749
  getDocument() {
27999
27750
  return null;
28000
27751
  }
28001
- release() {}
27752
+ release(...params) {}
28002
27753
  };
28003
27754
  HarmonyEnvContribution = __decorate$h([injectable(), __metadata$f("design:paramtypes", [])], HarmonyEnvContribution);
28004
27755
 
@@ -28006,8 +27757,7 @@
28006
27757
  harmonyEnvModule.isHarmonyBound || (harmonyEnvModule.isHarmonyBound = !0, bind(HarmonyEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(HarmonyEnvContribution));
28007
27758
  });
28008
27759
  harmonyEnvModule.isHarmonyBound = !1;
28009
- function loadHarmonyEnv(container) {
28010
- let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
27760
+ function loadHarmonyEnv(container, loadPicker = !0) {
28011
27761
  loadHarmonyEnv.__loaded || (loadHarmonyEnv.__loaded = !0, container.load(harmonyEnvModule), container.load(harmonyCanvasModule), container.load(harmonyWindowModule), loadPicker && loadMathPicker(container));
28012
27762
  }
28013
27763
  loadHarmonyEnv.__loaded = !1;
@@ -29406,7 +29156,7 @@
29406
29156
 
29407
29157
  const roughModule = _roughModule;
29408
29158
 
29409
- const version = "0.21.12-alpha.2";
29159
+ const version = "0.21.12-alpha.4";
29410
29160
  preLoadAllModule();
29411
29161
  if (isBrowserEnv()) {
29412
29162
  loadBrowserEnv(container);