@visactor/vrender-components 1.0.45 → 1.0.46-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/cjs/axis/base.js +1 -1
  2. package/cjs/axis/circle.js +1 -1
  3. package/cjs/axis/config.js +1 -1
  4. package/cjs/axis/constant.js +1 -1
  5. package/cjs/axis/index.js +1 -1
  6. package/cjs/axis/line.js +1 -1
  7. package/cjs/axis/register.js +1 -1
  8. package/cjs/axis/type.js +1 -1
  9. package/cjs/axis/util.js +1 -1
  10. package/cjs/brush/config.js +2 -1
  11. package/cjs/core/type.js +1 -2
  12. package/cjs/crosshair/rect.js +2 -1
  13. package/cjs/data-zoom/index.js +1 -1
  14. package/cjs/data-zoom/interaction.js +1 -1
  15. package/cjs/data-zoom/register.js +1 -1
  16. package/cjs/data-zoom/renderer.js +1 -1
  17. package/cjs/data-zoom/type.js +1 -1
  18. package/cjs/data-zoom/utils.js +1 -1
  19. package/cjs/index.d.ts +1 -1
  20. package/cjs/index.js +1 -1
  21. package/cjs/index.js.map +1 -1
  22. package/cjs/indicator/config.js +2 -1
  23. package/cjs/indicator/index.js +1 -2
  24. package/cjs/label/base.js +1 -1
  25. package/cjs/label/data-label-register.js +1 -1
  26. package/cjs/label/dataLabel.js +1 -1
  27. package/cjs/label/index.js +1 -1
  28. package/cjs/label/line.js +1 -1
  29. package/cjs/label/polygon.js +1 -1
  30. package/cjs/label/rect.js +1 -1
  31. package/cjs/label/register.js +1 -1
  32. package/cjs/label/symbol.js +1 -1
  33. package/cjs/label/type.js +1 -2
  34. package/cjs/label/util.js +1 -1
  35. package/cjs/label-item/index.js +1 -1
  36. package/cjs/label-item/label-item.js +1 -1
  37. package/cjs/label-item/register.js +1 -1
  38. package/cjs/label-item/type.js +1 -1
  39. package/dist/index.es.js +446 -507
  40. package/es/axis/base.js +1 -1
  41. package/es/axis/circle.js +1 -1
  42. package/es/axis/config.js +1 -1
  43. package/es/axis/constant.js +1 -1
  44. package/es/axis/index.js +1 -1
  45. package/es/axis/line.js +1 -1
  46. package/es/axis/register.js +1 -1
  47. package/es/axis/type.js +1 -1
  48. package/es/axis/util.js +1 -1
  49. package/es/brush/config.js +2 -1
  50. package/es/core/type.js +1 -2
  51. package/es/crosshair/rect.js +2 -1
  52. package/es/data-zoom/index.js +1 -1
  53. package/es/data-zoom/interaction.js +1 -1
  54. package/es/data-zoom/register.js +1 -1
  55. package/es/data-zoom/renderer.js +1 -1
  56. package/es/data-zoom/type.js +1 -1
  57. package/es/data-zoom/utils.js +1 -1
  58. package/es/index.d.ts +1 -1
  59. package/es/index.js +1 -1
  60. package/es/index.js.map +1 -1
  61. package/es/indicator/config.js +2 -1
  62. package/es/indicator/index.js +1 -2
  63. package/es/label/base.js +1 -1
  64. package/es/label/data-label-register.js +1 -1
  65. package/es/label/dataLabel.js +1 -1
  66. package/es/label/index.js +1 -1
  67. package/es/label/line.js +1 -1
  68. package/es/label/polygon.js +1 -1
  69. package/es/label/rect.js +1 -1
  70. package/es/label/register.js +1 -1
  71. package/es/label/symbol.js +1 -1
  72. package/es/label/type.js +1 -2
  73. package/es/label/util.js +1 -1
  74. package/es/label-item/index.js +1 -1
  75. package/es/label-item/label-item.js +1 -1
  76. package/es/label-item/register.js +1 -1
  77. package/es/label-item/type.js +1 -1
  78. package/package.json +7 -7
package/dist/index.es.js CHANGED
@@ -499,14 +499,20 @@ class ContributionProviderCache {
499
499
  }
500
500
  }
501
501
  function bindContributionProvider(bind, id) {
502
- bind(ContributionProvider).toDynamicValue(({
503
- container: container
504
- }) => new ContributionProviderCache(id, container)).inSingletonScope().whenTargetNamed(id);
502
+ bind(ContributionProvider).toDynamicValue(_ref => {
503
+ let {
504
+ container: container
505
+ } = _ref;
506
+ return new ContributionProviderCache(id, container);
507
+ }).inSingletonScope().whenTargetNamed(id);
505
508
  }
506
509
  function bindContributionProviderNoSingletonScope(bind, id) {
507
- bind(ContributionProvider).toDynamicValue(({
508
- container: container
509
- }) => new ContributionProviderCache(id, container)).whenTargetNamed(id);
510
+ bind(ContributionProvider).toDynamicValue(_ref2 => {
511
+ let {
512
+ container: container
513
+ } = _ref2;
514
+ return new ContributionProviderCache(id, container);
515
+ }).whenTargetNamed(id);
510
516
  }
511
517
  class ContributionStore {
512
518
  static getStore(id) {
@@ -576,7 +582,10 @@ class Hook {
576
582
  }
577
583
 
578
584
  class SyncHook extends Hook {
579
- call(...args) {
585
+ call() {
586
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
587
+ args[_key] = arguments[_key];
588
+ }
580
589
  this.taps.map(t => t.fn).forEach(cb => cb(...args));
581
590
  }
582
591
  }
@@ -891,13 +900,16 @@ let DefaultGlobal = class extends EventListenerManager {
891
900
  updateDom(dom, params) {
892
901
  return this._env || this.setEnv("browser"), this.envContribution.updateDom(dom, params);
893
902
  }
894
- getElementTop(dom, baseWindow = !1) {
903
+ getElementTop(dom) {
904
+ let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
895
905
  return this._env || this.setEnv("browser"), this.envContribution.getElementTop(dom, baseWindow);
896
906
  }
897
- getElementLeft(dom, baseWindow = !1) {
907
+ getElementLeft(dom) {
908
+ let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
898
909
  return this._env || this.setEnv("browser"), this.envContribution.getElementLeft(dom, baseWindow);
899
910
  }
900
- getElementTopLeft(dom, baseWindow = !1) {
911
+ getElementTopLeft(dom) {
912
+ let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
901
913
  return this._env || this.setEnv("browser"), this.envContribution.getElementTopLeft(dom, baseWindow);
902
914
  }
903
915
  isMacOS() {
@@ -982,7 +994,7 @@ class BoundsContext {
982
994
  clear() {
983
995
  this.bounds.clear();
984
996
  }
985
- release(...params) {}
997
+ release() {}
986
998
  }
987
999
 
988
1000
  class CurvePath {
@@ -1157,7 +1169,8 @@ function drawArc(context, x, y, coords) {
1157
1169
  context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);
1158
1170
  }
1159
1171
  }
1160
- const addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, counterclockwise = !1) => {
1172
+ const addArcToBezierPath = function (bezierPath, startAngle, endAngle, cx, cy, rx, ry) {
1173
+ let counterclockwise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : !1;
1161
1174
  const PI2 = 2 * Math.PI,
1162
1175
  sAngle = (startAngle % PI2 + PI2) % PI2;
1163
1176
  let deltaAngle,
@@ -1185,7 +1198,12 @@ const addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, co
1185
1198
  };
1186
1199
 
1187
1200
  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)];
1188
- function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z) {
1201
+ function renderCommandList(commandList, context) {
1202
+ let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1203
+ let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
1204
+ let sx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
1205
+ let sy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
1206
+ let z = arguments.length > 6 ? arguments[6] : undefined;
1189
1207
  for (let i = 0; i < commandList.length; i++) {
1190
1208
  const command = commandList[i];
1191
1209
  commandFuncs[command[0]](command, context, x, y, sx, sy, z);
@@ -1426,7 +1444,7 @@ class ReflectSegContext extends SegContext {
1426
1444
  }
1427
1445
  }
1428
1446
 
1429
- function genCurveSegments(path, points, step = 1) {
1447
+ function genCurveSegments(path, points) {
1430
1448
  let defined0 = !1;
1431
1449
  for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
1432
1450
  }
@@ -1469,7 +1487,8 @@ class Linear {
1469
1487
  return this.context.tryUpdateLength();
1470
1488
  }
1471
1489
  }
1472
- function genLinearSegments(points, params = {}) {
1490
+ function genLinearSegments(points) {
1491
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1473
1492
  const {
1474
1493
  direction: direction,
1475
1494
  startPoint: startPoint
@@ -1479,7 +1498,7 @@ function genLinearSegments(points, params = {}) {
1479
1498
  return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
1480
1499
  }
1481
1500
  function genLinearTypeSegments(path, points) {
1482
- return genCurveSegments(path, points, 1);
1501
+ return genCurveSegments(path, points);
1483
1502
  }
1484
1503
 
1485
1504
  function point$3(curveClass, x, y, defined, p) {
@@ -1522,9 +1541,10 @@ class Basis {
1522
1541
  }
1523
1542
  }
1524
1543
  function genBasisTypeSegments(path, points) {
1525
- return genCurveSegments(path, points, 2);
1544
+ return genCurveSegments(path, points);
1526
1545
  }
1527
- function genBasisSegments(points, params = {}) {
1546
+ function genBasisSegments(points) {
1547
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1528
1548
  const {
1529
1549
  direction: direction,
1530
1550
  startPoint: startPoint
@@ -1617,9 +1637,10 @@ class MonotoneY extends MonotoneX {
1617
1637
  }
1618
1638
  }
1619
1639
  function genMonotoneXTypeSegments(path, points) {
1620
- return genCurveSegments(path, points, 2);
1640
+ return genCurveSegments(path, points);
1621
1641
  }
1622
- function genMonotoneXSegments(points, params = {}) {
1642
+ function genMonotoneXSegments(points) {
1643
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1623
1644
  const {
1624
1645
  direction: direction,
1625
1646
  startPoint: startPoint
@@ -1630,9 +1651,10 @@ function genMonotoneXSegments(points, params = {}) {
1630
1651
  return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
1631
1652
  }
1632
1653
  function genMonotoneYTypeSegments(path, points) {
1633
- return genCurveSegments(path, points, 2);
1654
+ return genCurveSegments(path, points);
1634
1655
  }
1635
- function genMonotoneYSegments(points, params = {}) {
1656
+ function genMonotoneYSegments(points) {
1657
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1636
1658
  const {
1637
1659
  direction: direction,
1638
1660
  startPoint: startPoint
@@ -1644,7 +1666,9 @@ function genMonotoneYSegments(points, params = {}) {
1644
1666
  }
1645
1667
 
1646
1668
  let Step$1 = class Step {
1647
- constructor(context, t = .5, startPoint) {
1669
+ constructor(context) {
1670
+ let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
1671
+ let startPoint = arguments.length > 2 ? arguments[2] : undefined;
1648
1672
  this.context = context, this._t = t, this.startPoint = startPoint;
1649
1673
  }
1650
1674
  areaStart() {
@@ -1685,7 +1709,8 @@ class StepClosed extends Step$1 {
1685
1709
  this.context.closePath();
1686
1710
  }
1687
1711
  }
1688
- function genStepSegments(points, t, params = {}) {
1712
+ function genStepSegments(points, t) {
1713
+ let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1689
1714
  const {
1690
1715
  direction: direction,
1691
1716
  startPoint: startPoint
@@ -1695,9 +1720,10 @@ function genStepSegments(points, t, params = {}) {
1695
1720
  return genStepTypeSegments(new Step$1(segContext, t, startPoint), points), segContext;
1696
1721
  }
1697
1722
  function genStepTypeSegments(path, points) {
1698
- return genCurveSegments(path, points, 1);
1723
+ return genCurveSegments(path, points);
1699
1724
  }
1700
- function genStepClosedSegments(points, t, params = {}) {
1725
+ function genStepClosedSegments(points, t) {
1726
+ let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1701
1727
  const {
1702
1728
  direction: direction,
1703
1729
  startPoint: startPoint
@@ -1712,7 +1738,8 @@ class LinearClosed extends Linear {
1712
1738
  this.context.closePath();
1713
1739
  }
1714
1740
  }
1715
- function genLinearClosedSegments(points, params = {}) {
1741
+ function genLinearClosedSegments(points) {
1742
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1716
1743
  const {
1717
1744
  direction: direction,
1718
1745
  startPoint: startPoint
@@ -1722,7 +1749,7 @@ function genLinearClosedSegments(points, params = {}) {
1722
1749
  return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
1723
1750
  }
1724
1751
  function genLinearClosedTypeSegments(path, points) {
1725
- return genCurveSegments(path, points, 1);
1752
+ return genCurveSegments(path, points);
1726
1753
  }
1727
1754
 
1728
1755
  function point$1(curveClass, x, y, defined, p) {
@@ -1743,7 +1770,9 @@ function point$1(curveClass, x, y, defined, p) {
1743
1770
  curveClass.context.bezierCurveTo(x1, y1, x2, y2, curveClass._x2, curveClass._y2, defined, curveClass.lastPoint1);
1744
1771
  }
1745
1772
  class CatmullRom {
1746
- constructor(context, alpha = .5, startPoint) {
1773
+ constructor(context) {
1774
+ let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
1775
+ let startPoint = arguments.length > 2 ? arguments[2] : undefined;
1747
1776
  this.context = context, this.startPoint = startPoint, this._alpha = alpha;
1748
1777
  }
1749
1778
  areaStart() {
@@ -1797,7 +1826,8 @@ class CatmullRom {
1797
1826
  }
1798
1827
  }
1799
1828
  function commonGenCatmullRomSegments(type, cons) {
1800
- return function (points, alpha, params = {}) {
1829
+ return function (points, alpha) {
1830
+ let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1801
1831
  const {
1802
1832
  direction: direction,
1803
1833
  startPoint: startPoint
@@ -1806,13 +1836,15 @@ function commonGenCatmullRomSegments(type, cons) {
1806
1836
  if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
1807
1837
  const segContext = genSegContext(type, direction, points),
1808
1838
  gatmullRom = new cons(segContext, alpha, startPoint);
1809
- return genCurveSegments(gatmullRom, points, 2), segContext;
1839
+ return genCurveSegments(gatmullRom, points), segContext;
1810
1840
  };
1811
1841
  }
1812
1842
  const genCatmullRomSegments = commonGenCatmullRomSegments("catmullRom", CatmullRom);
1813
1843
 
1814
1844
  class CatmullRomClosed {
1815
- constructor(context, alpha = .5, startPoint) {
1845
+ constructor(context) {
1846
+ let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
1847
+ let startPoint = arguments.length > 2 ? arguments[2] : undefined;
1816
1848
  this.context = context, this.startPoint = startPoint, this._alpha = alpha;
1817
1849
  }
1818
1850
  areaStart() {
@@ -2122,7 +2154,11 @@ class CustomPath2D extends CurvePath {
2122
2154
  cmd[1] = cmd[1] * sx + x, cmd[2] = cmd[2] * sy + y, cmd[3] = cmd[3] * (sx + sy) / 2;
2123
2155
  }
2124
2156
  closePathTransform() {}
2125
- _runCommandStrList(commandStrList, l = 0, t = 0, sX = 1, sY = 1) {
2157
+ _runCommandStrList(commandStrList) {
2158
+ let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2159
+ let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2160
+ let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
2161
+ let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
2126
2162
  let current,
2127
2163
  tempX,
2128
2164
  tempY,
@@ -2196,7 +2232,11 @@ class CustomPath2D extends CurvePath {
2196
2232
  previous = current;
2197
2233
  }
2198
2234
  }
2199
- _runCommandList(commandList, l = 0, t = 0, sX = 1, sY = 1) {
2235
+ _runCommandList(commandList) {
2236
+ let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2237
+ let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2238
+ let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
2239
+ let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
2200
2240
  if (0 !== l || 0 !== t || 1 !== sX || 1 !== sY) for (let i = 0, len = commandList.length; i < len; ++i) {
2201
2241
  const current = commandList[i].slice();
2202
2242
  switch (current[0]) {
@@ -2408,7 +2448,6 @@ const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
2408
2448
  backgroundScale: 1,
2409
2449
  backgroundOffsetX: 0,
2410
2450
  backgroundOffsetY: 0,
2411
- backgroundPosition: "top-left",
2412
2451
  blur: 0,
2413
2452
  filter: "",
2414
2453
  cursor: null,
@@ -2581,16 +2620,11 @@ const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, D
2581
2620
  const DefaultImageAttribute = Object.assign(Object.assign({
2582
2621
  repeatX: "no-repeat",
2583
2622
  repeatY: "no-repeat",
2584
- imageMode: void 0,
2585
2623
  image: "",
2586
2624
  width: 0,
2587
2625
  height: 0,
2588
2626
  maxWidth: 500,
2589
- maxHeight: 500,
2590
- imagePosition: "top-left",
2591
- imageScale: 1,
2592
- imageOffsetX: 0,
2593
- imageOffsetY: 0
2627
+ maxHeight: 500
2594
2628
  }, DefaultAttribute), {
2595
2629
  fill: !0,
2596
2630
  cornerRadius: 0,
@@ -2874,7 +2908,9 @@ function getScaledStroke(context, width, dpr) {
2874
2908
  scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);
2875
2909
  return scaleX + scaleY === 0 ? 0 : (strokeWidth = strokeWidth / Math.abs(scaleX + scaleY) * 2 * dpr, strokeWidth);
2876
2910
  }
2877
- function createColor(context, c, params, offsetX = 0, offsetY = 0) {
2911
+ function createColor(context, c, params) {
2912
+ let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
2913
+ let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
2878
2914
  var _a, _b, _c, _d;
2879
2915
  if (!c || !0 === c) return "black";
2880
2916
  let result, color;
@@ -3013,7 +3049,8 @@ function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter)
3013
3049
  }
3014
3050
  return needTestLetter && (index = testLetter(desc, index)), index;
3015
3051
  }
3016
- function testLetter(string, index, negativeWrongMatch = !1) {
3052
+ function testLetter(string, index) {
3053
+ let negativeWrongMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
3017
3054
  let i = index;
3018
3055
  for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return negativeWrongMatch ? testLetter2(string, index) : index;
3019
3056
  return i;
@@ -3023,7 +3060,8 @@ function testLetter2(string, index) {
3023
3060
  for (; regLetter.test(string[i + 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i++, i >= string.length) return i;
3024
3061
  return i + 1;
3025
3062
  }
3026
- function measureTextCanvas(text, character, mode = "actual") {
3063
+ function measureTextCanvas(text, character) {
3064
+ let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
3027
3065
  var _a;
3028
3066
  if ("" === text) return {
3029
3067
  ascent: 0,
@@ -3096,9 +3134,10 @@ let ATextMeasure = class {
3096
3134
  }
3097
3135
  return metrics;
3098
3136
  }
3099
- estimate(text, {
3100
- fontSize = DefaultTextAttribute.fontSize
3101
- }) {
3137
+ estimate(text, _ref) {
3138
+ let {
3139
+ fontSize = DefaultTextAttribute.fontSize
3140
+ } = _ref;
3102
3141
  let eCharLen = 0,
3103
3142
  cCharLen = 0;
3104
3143
  for (let i = 0; i < text.length; i++) text.charCodeAt(i) < 128 ? eCharLen++ : cCharLen++;
@@ -3409,7 +3448,8 @@ let ATextMeasure = class {
3409
3448
  });
3410
3449
  });
3411
3450
  }
3412
- clipTextWithSuffix(text, options, width, suffix, wordBreak, position, forceSuffix = !1) {
3451
+ clipTextWithSuffix(text, options, width, suffix, wordBreak, position) {
3452
+ let forceSuffix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
3413
3453
  if ("" === suffix) return this.clipText(text, options, width, wordBreak);
3414
3454
  if (0 === text.length) return {
3415
3455
  str: "",
@@ -3855,7 +3895,7 @@ class DefaultCanvasAllocate {
3855
3895
  get length() {
3856
3896
  return this.pools.length;
3857
3897
  }
3858
- release(...params) {
3898
+ release() {
3859
3899
  this.pools = [];
3860
3900
  }
3861
3901
  }
@@ -4055,7 +4095,8 @@ let DefaultGraphicUtil = class {
4055
4095
  bindTextMeasure(tm) {
4056
4096
  this._textMeasure && "DefaultTextMeasureContribution" !== tm.id || (this._textMeasure = tm), this._textMeasureMap.has(tm.id) || this._textMeasureMap.set(tm.id, tm);
4057
4097
  }
4058
- measureText(text, tc, method = "native") {
4098
+ measureText(text, tc) {
4099
+ let method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "native";
4059
4100
  var _a;
4060
4101
  this.configure(this.global, this.global.env);
4061
4102
  const m = this.global.measureTextMethod;
@@ -4238,7 +4279,8 @@ class Theme {
4238
4279
  for (; group.parent;) if ((group = group.parent).theme) return group;
4239
4280
  return null;
4240
4281
  }
4241
- applyTheme(group, pt, force = !1) {
4282
+ applyTheme(group, pt) {
4283
+ let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
4242
4284
  if (this.dirty) {
4243
4285
  const parentGroup = this.getParentWithTheme(group);
4244
4286
  if (parentGroup) {
@@ -4337,7 +4379,8 @@ class Node extends EventEmitter {
4337
4379
  constructor() {
4338
4380
  super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
4339
4381
  }
4340
- forEachChildren(cb, reverse = !1) {
4382
+ forEachChildren(cb) {
4383
+ let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
4341
4384
  if (reverse) {
4342
4385
  let child = this._lastChild,
4343
4386
  i = 0;
@@ -4354,7 +4397,8 @@ class Node extends EventEmitter {
4354
4397
  }
4355
4398
  }
4356
4399
  }
4357
- forEachChildrenAsync(cb, reverse = !1) {
4400
+ forEachChildrenAsync(cb) {
4401
+ let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
4358
4402
  return __awaiter$3(this, void 0, void 0, function* () {
4359
4403
  if (reverse) {
4360
4404
  let child = this._lastChild,
@@ -4378,12 +4422,13 @@ class Node extends EventEmitter {
4378
4422
  forEach(cb) {
4379
4423
  return this.forEachChildren(cb);
4380
4424
  }
4381
- appendChild(node, highPerformance = !0) {
4425
+ appendChild(node) {
4426
+ let highPerformance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
4382
4427
  if (this._uid === node._uid) return null;
4383
4428
  if (!highPerformance && node.isAncestorsOf(this)) throw new Error("【Node::appendChild】不能将父辈元素append为子元素");
4384
4429
  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;
4385
4430
  }
4386
- appendChildArrHighPerformance(nodes, replace = !1) {
4431
+ appendChildArrHighPerformance(nodes) {
4387
4432
  return console.error("暂不支持该函数"), nodes;
4388
4433
  }
4389
4434
  insertBefore(newNode, referenceNode) {
@@ -4451,7 +4496,8 @@ class Node extends EventEmitter {
4451
4496
  replaceChild(newChild, oldChild) {
4452
4497
  throw new Error("暂不支持");
4453
4498
  }
4454
- find(callback, deep = !1) {
4499
+ find(callback) {
4500
+ let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
4455
4501
  let target = null;
4456
4502
  return this.forEachChildren((node, index) => !(node === this || !callback(node, index)) && (target = node, !0)), deep && this.forEachChildren(child => {
4457
4503
  if (child.isContainer) {
@@ -4461,7 +4507,8 @@ class Node extends EventEmitter {
4461
4507
  return !1;
4462
4508
  }), target;
4463
4509
  }
4464
- findAll(callback, deep = !1) {
4510
+ findAll(callback) {
4511
+ let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
4465
4512
  let nodes = [];
4466
4513
  return this.forEachChildren((node, index) => {
4467
4514
  node !== this && callback(node, index) && nodes.push(node);
@@ -4490,7 +4537,8 @@ class Node extends EventEmitter {
4490
4537
  getElementsByType(type) {
4491
4538
  return this.findAll(node => node.type === type, !0);
4492
4539
  }
4493
- getChildByName(name, deep = !1) {
4540
+ getChildByName(name) {
4541
+ let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
4494
4542
  return this.find(node => node.name === name, deep);
4495
4543
  }
4496
4544
  getChildAt(idx) {
@@ -4609,7 +4657,10 @@ class Node extends EventEmitter {
4609
4657
  removeAllListeners() {
4610
4658
  return this.removeAllEventListeners();
4611
4659
  }
4612
- dispatchEvent(event, ...args) {
4660
+ dispatchEvent(event) {
4661
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4662
+ args[_key - 1] = arguments[_key];
4663
+ }
4613
4664
  return super.emit(event.type, event, ...args), !event.defaultPrevented;
4614
4665
  }
4615
4666
  emit(event, data) {
@@ -5004,7 +5055,8 @@ class SquareSymbol extends BaseSymbol {
5004
5055
  }
5005
5056
  var square$1 = new SquareSymbol();
5006
5057
 
5007
- function trianglUpOffset(ctx, r, x, y, offset = 0) {
5058
+ function trianglUpOffset(ctx, r, x, y) {
5059
+ let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
5008
5060
  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;
5009
5061
  }
5010
5062
  class TriangleUpSymbol extends BaseSymbol {
@@ -5150,7 +5202,8 @@ class TriangleLeftSymbol extends BaseSymbol {
5150
5202
  }
5151
5203
  var triangleLeft = new TriangleLeftSymbol();
5152
5204
 
5153
- function trianglRightOffset(ctx, r, x, y, offset = 0) {
5205
+ function trianglRightOffset(ctx, r, x, y) {
5206
+ let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
5154
5207
  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;
5155
5208
  }
5156
5209
  class TriangleRightSymbol extends BaseSymbol {
@@ -5166,7 +5219,8 @@ class TriangleRightSymbol extends BaseSymbol {
5166
5219
  }
5167
5220
  var triangleRight = new TriangleRightSymbol();
5168
5221
 
5169
- function trianglDownOffset(ctx, r, x, y, offset = 0) {
5222
+ function trianglDownOffset(ctx, r, x, y) {
5223
+ let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
5170
5224
  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;
5171
5225
  }
5172
5226
  class TriangleDownSymbol extends BaseSymbol {
@@ -5383,7 +5437,8 @@ var rect = new RectSymbol();
5383
5437
 
5384
5438
  const tempBounds = new AABBBounds();
5385
5439
  class CustomSymbolClass {
5386
- constructor(type, path, isSvg = !1) {
5440
+ constructor(type, path) {
5441
+ let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
5387
5442
  this.pathStr = "", this.type = type, isArray(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
5388
5443
  }
5389
5444
  drawOffset(ctx, size, x, y, offset, z, cb) {
@@ -5405,9 +5460,10 @@ class CustomSymbolClass {
5405
5460
  bounds(size, bounds) {
5406
5461
  if (size = this.parseSize(size), this.isSvg) {
5407
5462
  if (!this.svgCache) return;
5408
- return bounds.clear(), void this.svgCache.forEach(({
5409
- path: path
5410
- }) => {
5463
+ return bounds.clear(), void this.svgCache.forEach(_ref => {
5464
+ let {
5465
+ path: path
5466
+ } = _ref;
5411
5467
  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);
5412
5468
  });
5413
5469
  }
@@ -5463,7 +5519,8 @@ function findClosingIndex(xmlData, str, i, errMsg) {
5463
5519
  if (-1 === closingIndex) throw new Error(errMsg);
5464
5520
  return closingIndex + str.length - 1;
5465
5521
  }
5466
- function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
5522
+ function tagExpWithClosingIndex(xmlData, i) {
5523
+ let closingChar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ">";
5467
5524
  let attrBoundary,
5468
5525
  tagExp = "";
5469
5526
  for (let index = i; index < xmlData.length; index++) {
@@ -5481,7 +5538,8 @@ function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
5481
5538
  tagExp += ch;
5482
5539
  }
5483
5540
  }
5484
- function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
5541
+ function readTagExp(xmlData, i, removeNSPrefix) {
5542
+ let closingChar = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ">";
5485
5543
  const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
5486
5544
  if (!result) return;
5487
5545
  let tagExp = result.data;
@@ -5643,7 +5701,8 @@ undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator)
5643
5701
  step((generator = generator.apply(thisArg, _arguments || [])).next());
5644
5702
  });
5645
5703
  };
5646
- function boundStroke(bounds, halfW, miter, pad = 0) {
5704
+ function boundStroke(bounds, halfW, miter) {
5705
+ let pad = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
5647
5706
  return bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0))), bounds;
5648
5707
  }
5649
5708
  function miterAdjustment(miter, strokeWidth) {
@@ -5828,7 +5887,7 @@ class DefaultMatrixAllocate {
5828
5887
  get length() {
5829
5888
  return this.pools.length;
5830
5889
  }
5831
- release(...params) {
5890
+ release() {
5832
5891
  this.pools = [];
5833
5892
  }
5834
5893
  }
@@ -5856,7 +5915,7 @@ class DefaultMat4Allocate {
5856
5915
  get length() {
5857
5916
  return this.pools.length;
5858
5917
  }
5859
- release(...params) {
5918
+ release() {
5860
5919
  this.pools = [];
5861
5920
  }
5862
5921
  }
@@ -5891,7 +5950,8 @@ let EmptyContext2d = class {
5891
5950
  getContext() {
5892
5951
  throw new Error("不支持getContext");
5893
5952
  }
5894
- setTransformForCurrent(force = !1) {
5953
+ setTransformForCurrent() {
5954
+ let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
5895
5955
  !force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix = this.cloneMatrix(this.matrix));
5896
5956
  }
5897
5957
  get currentMatrix() {
@@ -5912,7 +5972,8 @@ let EmptyContext2d = class {
5912
5972
  highPerformanceRestore() {
5913
5973
  this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
5914
5974
  }
5915
- rotate(rad, setTransform = !0) {
5975
+ rotate(rad) {
5976
+ let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
5916
5977
  this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
5917
5978
  }
5918
5979
  save() {
@@ -5923,41 +5984,55 @@ let EmptyContext2d = class {
5923
5984
  const matrix = this.cloneMatrix(this.matrix);
5924
5985
  this.stack.push(matrix);
5925
5986
  }
5926
- scale(sx, sy, setTransform = !0) {
5987
+ scale(sx, sy) {
5988
+ let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
5927
5989
  this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
5928
5990
  }
5929
- setScale(sx, sy, setTransform = !0) {
5991
+ setScale(sx, sy) {
5992
+ let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
5930
5993
  this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
5931
5994
  }
5932
- scalePoint(sx, sy, px, py, setTransform = !0) {
5995
+ scalePoint(sx, sy, px, py) {
5996
+ let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
5933
5997
  this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
5934
5998
  }
5935
- setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
5999
+ setTransform(a, b, c, d, e, f) {
6000
+ let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
6001
+ let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
5936
6002
  this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
5937
6003
  }
5938
- setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
6004
+ setTransformFromMatrix(matrix) {
6005
+ let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
6006
+ let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
5939
6007
  this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
5940
6008
  }
5941
- resetTransform(setTransform = !0, dpr = this.dpr) {
6009
+ resetTransform() {
6010
+ let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
6011
+ let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
5942
6012
  this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
5943
6013
  }
5944
- transform(a, b, c, d, e, f, setTransform = !0) {
6014
+ transform(a, b, c, d, e, f) {
6015
+ let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
5945
6016
  this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
5946
6017
  }
5947
6018
  transformFromMatrix(matrix, setTransform) {
5948
6019
  this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
5949
6020
  }
5950
- translate(x, y, setTransform = !0) {
6021
+ translate(x, y) {
6022
+ let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
5951
6023
  this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
5952
6024
  }
5953
- rotateDegrees(deg, setTransform = !0) {
6025
+ rotateDegrees(deg) {
6026
+ let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
5954
6027
  const rad = deg * Math.PI / 180;
5955
6028
  this.rotate(rad, setTransform);
5956
6029
  }
5957
- rotateAbout(rad, x, y, setTransform = !0) {
6030
+ rotateAbout(rad, x, y) {
6031
+ let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
5958
6032
  this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
5959
6033
  }
5960
- rotateDegreesAbout(deg, x, y, setTransform = !0) {
6034
+ rotateDegreesAbout(deg, x, y) {
6035
+ let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
5961
6036
  this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
5962
6037
  }
5963
6038
  beginPath() {
@@ -6051,16 +6126,19 @@ let EmptyContext2d = class {
6051
6126
  setTextStyleWithoutAlignBaseline(params, defaultParams) {}
6052
6127
  setTextStyle(params, defaultParams) {}
6053
6128
  draw() {}
6054
- clearMatrix(setTransform = !0, dpr = this.dpr) {
6129
+ clearMatrix() {
6130
+ let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
6131
+ let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
6055
6132
  this.setTransformFromMatrix(initMatrix, setTransform, dpr);
6056
6133
  }
6057
6134
  setClearMatrix(a, b, c, d, e, f) {
6058
6135
  this._clearMatrix.setValue(a, b, c, d, e, f);
6059
6136
  }
6060
- onlyTranslate(dpr = this.dpr) {
6137
+ onlyTranslate() {
6138
+ let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
6061
6139
  return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
6062
6140
  }
6063
- release(...params) {
6141
+ release() {
6064
6142
  this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
6065
6143
  }
6066
6144
  };
@@ -6071,7 +6149,9 @@ var ColorType;
6071
6149
  ColorType[ColorType.Color255 = 0] = "Color255", ColorType[ColorType.Color1 = 1] = "Color1";
6072
6150
  }(ColorType || (ColorType = {}));
6073
6151
  class ColorStore {
6074
- static Get(str, size = ColorType.Color1, arr = [0, 0, 0, 1]) {
6152
+ static Get(str) {
6153
+ let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ColorType.Color1;
6154
+ let arr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0, 1];
6075
6155
  if (size === ColorType.Color1) {
6076
6156
  const color = ColorStore.store1[str];
6077
6157
  if (color) return arr[0] = color[0], arr[1] = color[1], arr[2] = color[2], arr[3] = color[3], arr;
@@ -6099,7 +6179,8 @@ class ColorStore {
6099
6179
  }
6100
6180
  ColorStore.store255 = {}, ColorStore.store1 = {};
6101
6181
 
6102
- function colorArrayToString(color, alphaChannel = !1) {
6182
+ function colorArrayToString(color) {
6183
+ let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6103
6184
  return Array.isArray(color) && isNumber(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;
6104
6185
  }
6105
6186
  function interpolateColor(from, to, ratio, alphaChannel, cb) {
@@ -6229,6 +6310,7 @@ const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "ancho
6229
6310
  const tempConstantXYKey = ["x", "y"],
6230
6311
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
6231
6312
  tempConstantAngleKey = ["angle"],
6313
+ builtinTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave"]),
6232
6314
  point = new Point();
6233
6315
  const NOWORK_ANIMATE_ATTR = {
6234
6316
  strokeSeg: 1,
@@ -6283,9 +6365,10 @@ class Graphic extends Node {
6283
6365
  get globalTransMatrix() {
6284
6366
  return this.tryUpdateGlobalTransMatrix(!0);
6285
6367
  }
6286
- constructor(params = {}) {
6368
+ constructor() {
6369
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6287
6370
  var _a;
6288
- super(), this._AABBBounds = new AABBBounds(), this._updateTag = 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);
6371
+ super(), this._AABBBounds = new AABBBounds(), this._updateTag = 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), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
6289
6372
  }
6290
6373
  getGraphicService() {
6291
6374
  var _a, _b;
@@ -6303,7 +6386,8 @@ class Graphic extends Node {
6303
6386
  set2dMode() {
6304
6387
  this.in3dMode = !1;
6305
6388
  }
6306
- getOffsetXY(attr, includeScroll = !1) {
6389
+ getOffsetXY(attr) {
6390
+ let includeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6307
6391
  var _a, _b;
6308
6392
  const {
6309
6393
  dx = attr.dx,
@@ -6414,7 +6498,7 @@ class Graphic extends Node {
6414
6498
  const b = this.AABBBounds;
6415
6499
  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;
6416
6500
  }
6417
- tryUpdateGlobalTransMatrix(clearTag = !0) {
6501
+ tryUpdateGlobalTransMatrix() {
6418
6502
  if (this._globalTransMatrix) {
6419
6503
  if (this.parent) {
6420
6504
  const m = this.parent.globalTransMatrix;
@@ -6426,7 +6510,8 @@ class Graphic extends Node {
6426
6510
  shouldUpdateGlobalMatrix() {
6427
6511
  return !0;
6428
6512
  }
6429
- tryUpdateLocalTransMatrix(clearTag = !0) {
6513
+ tryUpdateLocalTransMatrix() {
6514
+ let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
6430
6515
  return this._transMatrix || (this._transMatrix = new Matrix()), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(), clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
6431
6516
  }
6432
6517
  shouldUpdateAABBBounds() {
@@ -6466,17 +6551,24 @@ class Graphic extends Node {
6466
6551
  setWidthHeightWithoutTransform(aabbBounds) {
6467
6552
  this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
6468
6553
  }
6469
- setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
6554
+ setAttributesAndPreventAnimate(params) {
6555
+ let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6556
+ let context = arguments.length > 2 ? arguments[2] : undefined;
6557
+ let ignorePriority = arguments.length > 3 ? arguments[3] : undefined;
6470
6558
  this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
6471
6559
  (animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach(key => {
6472
6560
  animate.preventAttr(key);
6473
6561
  });
6474
6562
  });
6475
6563
  }
6476
- setAttributes(params, forceUpdateTag = !1, context) {
6477
- params && ((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));
6564
+ setAttributes(params) {
6565
+ let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6566
+ let context = arguments.length > 2 ? arguments[2] : undefined;
6567
+ params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
6478
6568
  }
6479
- _setAttributes(params, forceUpdateTag = !1, context) {
6569
+ _setAttributes(params) {
6570
+ let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6571
+ let context = arguments.length > 2 ? arguments[2] : undefined;
6480
6572
  const keys = Object.keys(params);
6481
6573
  for (let i = 0; i < keys.length; i++) {
6482
6574
  const key = keys[i];
@@ -6489,16 +6581,18 @@ class Graphic extends Node {
6489
6581
  const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
6490
6582
  [key]: value
6491
6583
  }, this.attribute, key, context);
6492
- params ? this._setAttributes(params, forceUpdateTag, context) : isNil(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);
6584
+ params ? this._setAttributes(params, forceUpdateTag, context) : isNil(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) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
6493
6585
  }
6494
- needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
6586
+ needUpdateTags(keys) {
6587
+ let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
6495
6588
  for (let i = 0; i < k.length; i++) {
6496
6589
  const attrKey = k[i];
6497
6590
  if (-1 !== keys.indexOf(attrKey)) return !0;
6498
6591
  }
6499
6592
  return !1;
6500
6593
  }
6501
- needUpdateTag(key, k = GRAPHIC_UPDATE_TAG_KEY) {
6594
+ needUpdateTag(key) {
6595
+ let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
6502
6596
  for (let i = 0; i < k.length; i++) {
6503
6597
  if (key === k[i]) return !0;
6504
6598
  }
@@ -6508,7 +6602,7 @@ class Graphic extends Node {
6508
6602
  const context = {
6509
6603
  type: AttributeUpdateType.INIT
6510
6604
  };
6511
- params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
6605
+ params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), isExternalTexture(params.texture) ? this.loadImage(params.texture, !1) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
6512
6606
  }
6513
6607
  translate(x, y) {
6514
6608
  var _a, _b;
@@ -6654,7 +6748,8 @@ class Graphic extends Node {
6654
6748
  newNormalAttrs[key] = this.getNormalAttribute(key);
6655
6749
  }), this.normalAttrs = newNormalAttrs;
6656
6750
  }
6657
- stopStateAnimates(type = "end") {
6751
+ stopStateAnimates() {
6752
+ let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "end";
6658
6753
  this.animates && this.animates.forEach(animate => {
6659
6754
  animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
6660
6755
  });
@@ -6819,7 +6914,8 @@ class Graphic extends Node {
6819
6914
  var _a;
6820
6915
  return null !== (_a = this.attribute[name]) && void 0 !== _a ? _a : this.getDefaultAttribute(name);
6821
6916
  }
6822
- onSetStage(cb, immediate = !1) {
6917
+ onSetStage(cb) {
6918
+ let immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6823
6919
  this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
6824
6920
  }
6825
6921
  attachShadow(shadowRoot) {
@@ -6840,9 +6936,9 @@ class Graphic extends Node {
6840
6936
  createPathProxy(path) {
6841
6937
  return isString(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
6842
6938
  }
6843
- loadImage(image, background = !1) {
6844
- if (background && (null == image ? void 0 : image.background) && (image = image.background), background && (!image || backgroundNotImage(image))) return void (this.backgroundImg = !1);
6845
- if (!image) return;
6939
+ loadImage(image) {
6940
+ let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6941
+ if (!image || background && backgroundNotImage(image)) return;
6846
6942
  const url = image;
6847
6943
  this.resources || (this.resources = new Map());
6848
6944
  const cache = {
@@ -6871,7 +6967,8 @@ class Graphic extends Node {
6871
6967
  animate.stop();
6872
6968
  });
6873
6969
  }
6874
- stopAnimates(stopChildren = !1) {
6970
+ stopAnimates() {
6971
+ let stopChildren = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
6875
6972
  this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren(c => {
6876
6973
  c.stopAnimates(stopChildren);
6877
6974
  });
@@ -6897,7 +6994,10 @@ class Graphic extends Node {
6897
6994
  }
6898
6995
  }
6899
6996
  function backgroundNotImage(image) {
6900
- return "string" == typeof image ? !(image.startsWith("<svg") || isValidUrl(image) || image.includes("/") || isBase64(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
6997
+ return !(!image.fill && !image.stroke);
6998
+ }
6999
+ function isExternalTexture(texture) {
7000
+ return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl(texture) || texture.includes("/") || isBase64(texture)) : isObject(texture));
6901
7001
  }
6902
7002
  Graphic.userSymbolMap = {}, Graphic.mixin(EventTarget);
6903
7003
 
@@ -7019,7 +7119,8 @@ class Group extends Graphic {
7019
7119
  _updateChildToStage(child) {
7020
7120
  return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(), child;
7021
7121
  }
7022
- appendChild(node, addStage = !0) {
7122
+ appendChild(node) {
7123
+ let addStage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
7023
7124
  const data = super.appendChild(node);
7024
7125
  return addStage && this.stage && data && data.setStage(this.stage, this.layer), this.addUpdateBoundTag(), data;
7025
7126
  }
@@ -7036,7 +7137,8 @@ class Group extends Graphic {
7036
7137
  const data = super.removeChild(child);
7037
7138
  return this.getGraphicService().onRemove(child), child.stage = null, this.addUpdateBoundTag(), data;
7038
7139
  }
7039
- removeAllChild(deep = !1) {
7140
+ removeAllChild() {
7141
+ let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
7040
7142
  this.forEachChildren(child => {
7041
7143
  this.getGraphicService().onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
7042
7144
  }), super.removeAllChild(), this.addUpdateBoundTag();
@@ -7056,7 +7158,8 @@ class Group extends Graphic {
7056
7158
  g.isContainer && g.addUpdateGlobalPositionTag();
7057
7159
  });
7058
7160
  }
7059
- tryUpdateGlobalTransMatrix(clearTag = !0) {
7161
+ tryUpdateGlobalTransMatrix() {
7162
+ let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
7060
7163
  if (this.shouldUpdateGlobalMatrix()) {
7061
7164
  if (this._globalTransMatrix) {
7062
7165
  if (this.parent) {
@@ -7130,7 +7233,8 @@ class Layer extends Group {
7130
7233
  zIndex: null !== (_a = params.zIndex) && void 0 !== _a ? _a : 0
7131
7234
  }), this.layer = this, this.subLayers = new Map(), this.theme = new Theme(), this.background = "rgba(0, 0, 0, 0)", this.afterDrawCbs = [];
7132
7235
  }
7133
- combineSubLayer(removeIncrementalKey = !0) {
7236
+ combineSubLayer() {
7237
+ let removeIncrementalKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
7134
7238
  const subLayers = Array.from(this.subLayers.values()).sort((a, b) => a.zIndex - b.zIndex);
7135
7239
  this.layerHandler.merge(subLayers.map(l => (l.layer.subLayers.size && l.layer.combineSubLayer(removeIncrementalKey), l.layer.getNativeHandler()))), removeIncrementalKey && subLayers.forEach(l => {
7136
7240
  l.group && (l.group.incremental = 0);
@@ -7239,9 +7343,10 @@ let DefaultLayerService = DefaultLayerService_1 = class {
7239
7343
  let layerHandler;
7240
7344
  return layerHandler = "static" === layerMode ? container.get(StaticLayerHandlerContribution) : "dynamic" === layerMode ? container.get(DynamicLayerHandlerContribution) : container.get(VirtualLayerHandlerContribution), layerHandler;
7241
7345
  }
7242
- createLayer(stage, options = {
7243
- main: !1
7244
- }) {
7346
+ createLayer(stage) {
7347
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
7348
+ main: !1
7349
+ };
7245
7350
  var _a;
7246
7351
  this.tryInit();
7247
7352
  let layerMode = this.getRecommendedLayerType(options.layerMode);
@@ -7482,7 +7587,8 @@ const InteractiveSubRenderContribution = Symbol.for("InteractiveSubRenderContrib
7482
7587
  function textDrawOffsetX(textAlign, width) {
7483
7588
  return "end" === textAlign || "right" === textAlign ? -width : "center" === textAlign ? -width / 2 : 0;
7484
7589
  }
7485
- function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
7590
+ function textLayoutOffsetY(baseline, lineHeight, fontSize) {
7591
+ let buf = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
7486
7592
  return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight), -(lineHeight - fontSize) / 2 - .79 * fontSize);
7487
7593
  }
7488
7594
 
@@ -7696,9 +7802,10 @@ const updateBoundsOfCommonOuterBorder = (attribute, theme, aabbBounds) => {
7696
7802
 
7697
7803
  const CIRCLE_UPDATE_TAG_KEY = ["radius", "startAngle", "endAngle", ...GRAPHIC_UPDATE_TAG_KEY];
7698
7804
  class Circle extends Graphic {
7699
- constructor(params = {
7700
- radius: 1
7701
- }) {
7805
+ constructor() {
7806
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
7807
+ radius: 1
7808
+ };
7702
7809
  super(params), this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
7703
7810
  }
7704
7811
  isValid() {
@@ -7780,7 +7887,10 @@ class CanvasTextLayout {
7780
7887
  } else bbox.yOffset = -bbox.height;
7781
7888
  return bbox;
7782
7889
  }
7783
- GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = "", wordBreak, params) {
7890
+ GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
7891
+ let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
7892
+ let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
7893
+ let params = arguments.length > 6 ? arguments[6] : undefined;
7784
7894
  const {
7785
7895
  lineWidth: lineWidth,
7786
7896
  suffixPosition = "end",
@@ -7903,10 +8013,11 @@ class Text extends Graphic {
7903
8013
  get isMultiLine() {
7904
8014
  return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
7905
8015
  }
7906
- constructor(params = {
7907
- text: "",
7908
- fontSize: 16
7909
- }) {
8016
+ constructor() {
8017
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
8018
+ text: "",
8019
+ fontSize: 16
8020
+ };
7910
8021
  super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE, this.cache = {};
7911
8022
  }
7912
8023
  isValid() {
@@ -8238,10 +8349,12 @@ class Text extends Graphic {
8238
8349
  var _a;
8239
8350
  return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
8240
8351
  }
8241
- needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
8352
+ needUpdateTags(keys) {
8353
+ let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
8242
8354
  return super.needUpdateTags(keys, k);
8243
8355
  }
8244
- needUpdateTag(key, k = TEXT_UPDATE_TAG_KEY) {
8356
+ needUpdateTag(key) {
8357
+ let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
8245
8358
  return super.needUpdateTag(key, k);
8246
8359
  }
8247
8360
  _interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
@@ -8444,15 +8557,19 @@ const updateBoundsOfSymbolOuterBorder = (attribute, symbolTheme, aabbBounds) =>
8444
8557
 
8445
8558
  const SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
8446
8559
  let Symbol$1 = class Symbol extends Graphic {
8447
- constructor(params = {
8448
- symbolType: "circle"
8449
- }) {
8560
+ constructor() {
8561
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
8562
+ symbolType: "circle"
8563
+ };
8450
8564
  super(params), this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
8451
8565
  }
8452
8566
  getParsedPath() {
8453
8567
  return this.shouldUpdateShape() && (this._parsedPath = this.doUpdateParsedPath(), this.clearUpdateShapeTag()), this._parsedPath;
8454
8568
  }
8455
- getParsedPath2D(x = 0, y = 0, size = 1) {
8569
+ getParsedPath2D() {
8570
+ let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
8571
+ let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
8572
+ let size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
8456
8573
  let path = null;
8457
8574
  try {
8458
8575
  path = new Path2D();
@@ -8539,7 +8656,8 @@ function createSymbol(attributes) {
8539
8656
 
8540
8657
  const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
8541
8658
  let Line$1 = class Line extends Graphic {
8542
- constructor(params = {}) {
8659
+ constructor() {
8660
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8543
8661
  super(params), this.type = "line", this.numberType = LINE_NUMBER_TYPE;
8544
8662
  }
8545
8663
  isValid() {
@@ -8991,7 +9109,7 @@ function seperateParagraph(paragraph, index) {
8991
9109
  return [new Paragraph(text1, paragraph.newLine, paragraph.character, paragraph.ascentDescentMode), new Paragraph(text2, !0, paragraph.character, paragraph.ascentDescentMode)];
8992
9110
  }
8993
9111
 
8994
- const IMAGE_UPDATE_TAG_KEY = ["width", "height", "image", "imageMode", "imagePosition", "imageScale", "imageOffsetX", "imageOffsetY", ...GRAPHIC_UPDATE_TAG_KEY];
9112
+ const IMAGE_UPDATE_TAG_KEY = ["width", "height", "image", ...GRAPHIC_UPDATE_TAG_KEY];
8995
9113
  class Image extends Graphic {
8996
9114
  constructor(params) {
8997
9115
  super(params), this.type = "image", this.numberType = IMAGE_NUMBER_TYPE, this.loadImage(this.attribute.image);
@@ -9096,7 +9214,6 @@ class Image extends Graphic {
9096
9214
  }
9097
9215
  Image.NOWORK_ANIMATE_ATTR = Object.assign({
9098
9216
  image: 1,
9099
- imageMode: 1,
9100
9217
  repeatX: 1,
9101
9218
  repeatY: 1
9102
9219
  }, NOWORK_ANIMATE_ATTR);
@@ -9278,7 +9395,8 @@ class Wrapper {
9278
9395
  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);
9279
9396
  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;
9280
9397
  }
9281
- deal(paragraph, singleLine = !1) {
9398
+ deal(paragraph) {
9399
+ let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
9282
9400
  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 || this.newLine) && ("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)));
9283
9401
  }
9284
9402
  cut(paragraph, singleLine) {
@@ -10134,12 +10252,11 @@ class DefaultBaseBackgroundRenderContribution {
10134
10252
  backgroundScale = graphicAttribute.backgroundScale,
10135
10253
  backgroundOffsetX = graphicAttribute.backgroundOffsetX,
10136
10254
  backgroundOffsetY = graphicAttribute.backgroundOffsetY,
10137
- backgroundClip = graphicAttribute.backgroundClip,
10138
- backgroundPosition = graphicAttribute.backgroundPosition
10255
+ backgroundClip = graphicAttribute.backgroundClip
10139
10256
  } = graphic.attribute;
10140
10257
  if (background) if (graphic.backgroundImg && graphic.resources) {
10141
- const res = graphic.resources.get(getBackgroundImage(background));
10142
- if (!res || "success" !== res.state || !res.data) return;
10258
+ const res = graphic.resources.get(background);
10259
+ if ("success" !== res.state || !res.data) return;
10143
10260
  if (context.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
10144
10261
  const groupAttribute = getTheme(graphic.parent).group,
10145
10262
  {
@@ -10156,160 +10273,59 @@ class DefaultBaseBackgroundRenderContribution {
10156
10273
  backgroundKeepAspectRatio: backgroundKeepAspectRatio,
10157
10274
  backgroundScale: backgroundScale,
10158
10275
  backgroundOffsetX: backgroundOffsetX,
10159
- backgroundOffsetY: backgroundOffsetY,
10160
- backgroundPosition: backgroundPosition
10276
+ backgroundOffsetY: backgroundOffsetY
10161
10277
  }), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
10162
10278
  } else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity * opacity, context.fillStyle = background, context.fill(), context.highPerformanceRestore();
10163
10279
  }
10164
10280
  doDrawImage(context, data, b, params) {
10165
- drawBackgroundImage(context, data, b, params);
10166
- }
10167
- }
10168
- const defaultBaseBackgroundRenderContribution = new DefaultBaseBackgroundRenderContribution();
10169
- const verticalPositionKeywords = new Set(["top", "center", "bottom"]);
10170
- function getBackgroundImage(background) {
10171
- var _a;
10172
- return null !== (_a = null == background ? void 0 : background.background) && void 0 !== _a ? _a : background;
10173
- }
10174
- function resolveBackgroundSizing({
10175
- backgroundFit: backgroundFit,
10176
- backgroundKeepAspectRatio: backgroundKeepAspectRatio
10177
- }) {
10178
- return backgroundFit ? backgroundKeepAspectRatio ? "cover" : "fill" : "auto";
10179
- }
10180
- const NO_REPEAT_SIZING_MAP = {
10181
- "no-repeat-cover": "cover",
10182
- "no-repeat-contain": "contain",
10183
- "no-repeat-fill": "fill",
10184
- "no-repeat-auto": "auto"
10185
- };
10186
- function resolveBackgroundDrawMode({
10187
- backgroundMode: backgroundMode,
10188
- backgroundFit: backgroundFit,
10189
- backgroundKeepAspectRatio: backgroundKeepAspectRatio
10190
- }) {
10191
- const sizing = NO_REPEAT_SIZING_MAP[backgroundMode];
10192
- return sizing ? {
10193
- backgroundRepeatMode: "no-repeat",
10194
- backgroundSizing: sizing
10195
- } : {
10196
- backgroundRepeatMode: backgroundMode,
10197
- backgroundSizing: resolveBackgroundSizing({
10198
- backgroundFit: backgroundFit,
10199
- backgroundKeepAspectRatio: backgroundKeepAspectRatio
10200
- })
10201
- };
10202
- }
10203
- function isPercentageValue(value) {
10204
- return /^-?\d+(\.\d+)?%$/.test(value);
10205
- }
10206
- function parsePositionToken(value, remainSpace, startKeyword, centerKeyword, endKeyword) {
10207
- if ("number" == typeof value && Number.isFinite(value)) return value;
10208
- const normalizedValue = `${null != value ? value : ""}`.trim().toLowerCase();
10209
- if (!normalizedValue || normalizedValue === startKeyword) return 0;
10210
- if (normalizedValue === centerKeyword) return remainSpace / 2;
10211
- if (normalizedValue === endKeyword) return remainSpace;
10212
- if (isPercentageValue(normalizedValue)) return remainSpace * parseFloat(normalizedValue) / 100;
10213
- const parsedValue = Number(normalizedValue);
10214
- return Number.isFinite(parsedValue) ? parsedValue : 0;
10215
- }
10216
- function normalizeBackgroundPosition(position) {
10217
- var _a, _b;
10218
- if (Array.isArray(position)) return [null !== (_a = position[0]) && void 0 !== _a ? _a : "left", null !== (_b = position[1]) && void 0 !== _b ? _b : "top"];
10219
- const tokens = `${null != position ? position : "top-left"}`.trim().toLowerCase().replace(/-/g, " ").split(/\s+/).filter(Boolean);
10220
- if (0 === tokens.length) return ["left", "top"];
10221
- if (1 === tokens.length) {
10222
- const token = tokens[0];
10223
- return "center" === token ? ["center", "center"] : verticalPositionKeywords.has(token) ? ["center", token] : [token, "center"];
10224
- }
10225
- let horizontal, vertical;
10226
- const genericTokens = [];
10227
- for (let i = 0; i < 2; i++) {
10228
- const token = tokens[i];
10229
- "left" !== token && "right" !== token ? "top" !== token && "bottom" !== token ? genericTokens.push(token) : vertical = token : horizontal = token;
10230
- }
10231
- return null == horizontal && genericTokens.length && (horizontal = genericTokens.shift()), null == vertical && genericTokens.length && (vertical = genericTokens.shift()), [null != horizontal ? horizontal : "left", null != vertical ? vertical : "top"];
10232
- }
10233
- function resolveBackgroundPosition(position, remainWidth, remainHeight) {
10234
- const [horizontalPosition, verticalPosition] = normalizeBackgroundPosition(position);
10235
- return {
10236
- x: parsePositionToken(horizontalPosition, remainWidth, "left", "center", "right"),
10237
- y: parsePositionToken(verticalPosition, remainHeight, "top", "center", "bottom")
10238
- };
10239
- }
10240
- function pickRenderableDimension(...values) {
10241
- for (const value of values) if ("number" == typeof value && Number.isFinite(value) && value > 0) return value;
10242
- return null;
10243
- }
10244
- function resolveRenderableImageSize(data) {
10245
- if (!data) return null;
10246
- const width = pickRenderableDimension(data.naturalWidth, data.videoWidth, data.width),
10247
- height = pickRenderableDimension(data.naturalHeight, data.videoHeight, data.height);
10248
- return null == width || null == height ? null : {
10249
- width: width,
10250
- height: height
10251
- };
10252
- }
10253
- function drawBackgroundImage(context, data, b, params) {
10254
- var _a, _b;
10255
- const {
10256
- backgroundMode: backgroundMode,
10257
- backgroundFit: backgroundFit,
10258
- backgroundKeepAspectRatio: backgroundKeepAspectRatio,
10259
- backgroundScale = 1,
10260
- backgroundOffsetX = 0,
10261
- backgroundOffsetY = 0,
10262
- backgroundPosition = "top-left"
10263
- } = params,
10264
- targetW = b.width(),
10265
- targetH = b.height(),
10266
- sourceSize = resolveRenderableImageSize(data),
10267
- {
10268
- backgroundRepeatMode: backgroundRepeatMode,
10269
- backgroundSizing: resolvedBackgroundSizing
10270
- } = resolveBackgroundDrawMode({
10271
- backgroundMode: backgroundMode,
10272
- backgroundFit: backgroundFit,
10273
- backgroundKeepAspectRatio: backgroundKeepAspectRatio
10274
- });
10275
- let w = targetW,
10276
- h = targetH;
10277
- if (targetW <= 0 || targetH <= 0) return;
10278
- if ("no-repeat" === backgroundRepeatMode) {
10279
- let drawWidth = null !== (_a = null == sourceSize ? void 0 : sourceSize.width) && void 0 !== _a ? _a : targetW,
10280
- drawHeight = null !== (_b = null == sourceSize ? void 0 : sourceSize.height) && void 0 !== _b ? _b : targetH;
10281
- if ("cover" !== resolvedBackgroundSizing && "contain" !== resolvedBackgroundSizing || !sourceSize) "fill" === resolvedBackgroundSizing && (drawWidth = targetW, drawHeight = targetH);else {
10282
- const scale = "cover" === resolvedBackgroundSizing ? Math.max(targetW / sourceSize.width, targetH / sourceSize.height) : Math.min(targetW / sourceSize.width, targetH / sourceSize.height);
10283
- drawWidth = sourceSize.width * scale, drawHeight = sourceSize.height * scale;
10284
- }
10285
- drawWidth *= backgroundScale, drawHeight *= backgroundScale;
10286
10281
  const {
10287
- x: x,
10288
- y: y
10289
- } = resolveBackgroundPosition(backgroundPosition, targetW - drawWidth, targetH - drawHeight);
10290
- return void context.drawImage(data, b.x1 + x + backgroundOffsetX, b.y1 + y + backgroundOffsetY, drawWidth, drawHeight);
10291
- }
10292
- if (backgroundFit && "repeat" !== backgroundRepeatMode && sourceSize) {
10293
- const resW = sourceSize.width,
10294
- resH = sourceSize.height;
10295
- if ("repeat-x" === backgroundRepeatMode) {
10296
- w = resW * (targetH / resH), h = targetH;
10297
- } else if ("repeat-y" === backgroundRepeatMode) {
10298
- h = resH * (targetW / resW), w = targetW;
10299
- }
10300
- const dpr = context.dpr,
10301
- canvas = canvasAllocate.allocate({
10302
- width: w,
10303
- height: h,
10304
- dpr: dpr
10305
- }),
10306
- ctx = canvas.getContext("2d");
10307
- ctx && (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, w, h), ctx.drawImage(data, 0, 0, w, h), data = canvas.nativeCanvas), canvasAllocate.free(canvas);
10282
+ backgroundMode: backgroundMode,
10283
+ backgroundFit: backgroundFit,
10284
+ backgroundKeepAspectRatio: backgroundKeepAspectRatio,
10285
+ backgroundScale = 1,
10286
+ backgroundOffsetX = 0,
10287
+ backgroundOffsetY = 0
10288
+ } = params,
10289
+ targetW = b.width(),
10290
+ targetH = b.height();
10291
+ let w = targetW,
10292
+ h = targetH;
10293
+ if ("no-repeat" === backgroundMode) {
10294
+ if (backgroundFit) {
10295
+ if (backgroundKeepAspectRatio) {
10296
+ const maxScale = Math.max(targetW / data.width, targetH / data.height);
10297
+ context.drawImage(data, b.x1 + backgroundOffsetX, b.y1 + backgroundOffsetY, data.width * maxScale * backgroundScale, data.height * maxScale * backgroundScale);
10298
+ } else context.drawImage(data, b.x1, b.y1, b.width(), b.height());
10299
+ } else {
10300
+ const resW = data.width * backgroundScale,
10301
+ resH = data.height * backgroundScale;
10302
+ context.drawImage(data, b.x1 + backgroundOffsetX, b.y1 + backgroundOffsetY, resW, resH);
10303
+ }
10304
+ } else {
10305
+ if (backgroundFit && "repeat" !== backgroundMode && (data.width || data.height)) {
10306
+ const resW = data.width,
10307
+ resH = data.height;
10308
+ if ("repeat-x" === backgroundMode) {
10309
+ w = resW * (targetH / resH), h = targetH;
10310
+ } else if ("repeat-y" === backgroundMode) {
10311
+ h = resH * (targetW / resW), w = targetW;
10312
+ }
10313
+ const dpr = context.dpr,
10314
+ canvas = canvasAllocate.allocate({
10315
+ width: w,
10316
+ height: h,
10317
+ dpr: dpr
10318
+ }),
10319
+ ctx = canvas.getContext("2d");
10320
+ ctx && (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, w, h), ctx.drawImage(data, 0, 0, w, h), data = canvas.nativeCanvas), canvasAllocate.free(canvas);
10321
+ }
10322
+ const dpr = context.dpr,
10323
+ pattern = context.createPattern(data, backgroundMode);
10324
+ pattern.setTransform && pattern.setTransform(new DOMMatrix([1 / dpr, 0, 0, 1 / dpr, 0, 0])), context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, targetW, targetH), context.translate(-b.x1, -b.y1);
10325
+ }
10308
10326
  }
10309
- const dpr = context.dpr,
10310
- pattern = context.createPattern(data, backgroundRepeatMode);
10311
- pattern.setTransform && pattern.setTransform(new DOMMatrix([1 / dpr, 0, 0, 1 / dpr, 0, 0])), context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, targetW, targetH), context.translate(-b.x1, -b.y1);
10312
10327
  }
10328
+ const defaultBaseBackgroundRenderContribution = new DefaultBaseBackgroundRenderContribution();
10313
10329
  let DefaultBaseInteractiveRenderContribution = class {
10314
10330
  constructor(subRenderContribitions) {
10315
10331
  this.subRenderContribitions = subRenderContribitions, this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
@@ -10473,33 +10489,37 @@ class DefaultBaseTextureRenderContribution {
10473
10489
  textureRatio = graphicAttribute.textureRatio,
10474
10490
  textureOptions = null
10475
10491
  } = graphic.attribute;
10476
- let pattern = this.textureMap.get(texture);
10477
- if (!pattern) switch (texture) {
10478
- case "circle":
10479
- pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
10480
- break;
10481
- case "diamond":
10482
- pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
10483
- break;
10484
- case "rect":
10485
- pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
10486
- break;
10487
- case "vertical-line":
10488
- pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
10489
- break;
10490
- case "horizontal-line":
10491
- pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
10492
- break;
10493
- case "bias-lr":
10494
- pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
10495
- break;
10496
- case "bias-rl":
10497
- pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
10498
- break;
10499
- case "grid":
10500
- pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
10492
+ let pattern = null;
10493
+ const patternKey = this.getPatternCacheKey(texture, textureSize, texturePadding, textureColor, context.dpr);
10494
+ if (null !== patternKey && (pattern = this.textureMap.get(patternKey)), !pattern) {
10495
+ if ("string" == typeof texture) switch (texture) {
10496
+ case "circle":
10497
+ pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
10498
+ break;
10499
+ case "diamond":
10500
+ pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
10501
+ break;
10502
+ case "rect":
10503
+ pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
10504
+ break;
10505
+ case "vertical-line":
10506
+ pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
10507
+ break;
10508
+ case "horizontal-line":
10509
+ pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
10510
+ break;
10511
+ case "bias-lr":
10512
+ pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
10513
+ break;
10514
+ case "bias-rl":
10515
+ pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
10516
+ break;
10517
+ case "grid":
10518
+ pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
10519
+ }
10520
+ pattern || (pattern = this.createResourcePattern(texture, graphic, context)), pattern && null !== patternKey && this.textureMap.set(patternKey, pattern);
10501
10521
  }
10502
- if (textureOptions && textureOptions.dynamicTexture) {
10522
+ if ("string" == typeof texture && textureOptions && textureOptions.dynamicTexture) {
10503
10523
  const {
10504
10524
  gridConfig = {},
10505
10525
  useNewCanvas: useNewCanvas
@@ -10555,6 +10575,17 @@ class DefaultBaseTextureRenderContribution {
10555
10575
  }), x + b.x1 - x, y + b.y1 - y), context.restore();
10556
10576
  }
10557
10577
  }
10578
+ getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr) {
10579
+ return "string" != typeof texture ? texture : "wave" === texture ? null : `${texture}-${textureSize}-${texturePadding}-${textureColor}-${dpr}`;
10580
+ }
10581
+ createResourcePattern(texture, graphic, context) {
10582
+ var _a;
10583
+ const resource = null === (_a = graphic.resources) || void 0 === _a ? void 0 : _a.get(texture),
10584
+ data = "success" === (null == resource ? void 0 : resource.state) ? resource.data : "object" == typeof texture ? texture : null;
10585
+ if (!data) return null;
10586
+ const pattern = context.createPattern(data, "repeat");
10587
+ return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), pattern;
10588
+ }
10558
10589
  }
10559
10590
  const defaultBaseTextureRenderContribution = new DefaultBaseTextureRenderContribution();
10560
10591
 
@@ -10666,38 +10697,35 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
10666
10697
  drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
10667
10698
  const {
10668
10699
  background: background,
10669
- backgroundOpacity = graphicAttribute.backgroundOpacity,
10670
- opacity = graphicAttribute.opacity,
10671
10700
  backgroundMode = graphicAttribute.backgroundMode,
10672
10701
  backgroundFit = graphicAttribute.backgroundFit,
10673
10702
  backgroundKeepAspectRatio = graphicAttribute.backgroundKeepAspectRatio,
10674
10703
  backgroundScale = graphicAttribute.backgroundScale,
10675
10704
  backgroundOffsetX = graphicAttribute.backgroundOffsetX,
10676
- backgroundOffsetY = graphicAttribute.backgroundOffsetY,
10677
- backgroundClip = graphicAttribute.backgroundClip,
10678
- backgroundPosition = graphicAttribute.backgroundPosition
10705
+ backgroundOffsetY = graphicAttribute.backgroundOffsetY
10679
10706
  } = graphic.attribute;
10680
10707
  if (background) if (graphic.backgroundImg && graphic.resources) {
10681
- const res = graphic.resources.get(getBackgroundImage(background));
10682
- if (!res || "success" !== res.state || !res.data) return;
10708
+ const res = graphic.resources.get(background);
10709
+ if ("success" !== res.state || !res.data) return;
10683
10710
  context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0);
10684
10711
  const b = graphic.AABBBounds;
10685
- context.globalAlpha = backgroundOpacity * opacity, backgroundClip && context.clip(), this.doDrawImage(context, res.data, b, {
10712
+ this.doDrawImage(context, res.data, b, {
10686
10713
  backgroundMode: backgroundMode,
10687
10714
  backgroundFit: backgroundFit,
10688
10715
  backgroundKeepAspectRatio: backgroundKeepAspectRatio,
10689
10716
  backgroundScale: backgroundScale,
10690
10717
  backgroundOffsetX: backgroundOffsetX,
10691
- backgroundOffsetY: backgroundOffsetY,
10692
- backgroundPosition: backgroundPosition
10718
+ backgroundOffsetY: backgroundOffsetY
10693
10719
  }), context.highPerformanceRestore(), context.setTransformForCurrent();
10694
- } else context.highPerformanceSave(), context.globalAlpha = backgroundOpacity * opacity, context.fillStyle = background, context.fill(), context.highPerformanceRestore();
10720
+ } else context.highPerformanceSave(), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
10695
10721
  }
10696
10722
  }
10697
10723
  const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
10698
10724
 
10699
10725
  const halfPi = pi / 2;
10700
- function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner = !0, edgeCb) {
10726
+ function createRectPath(path, x, y, width, height, rectCornerRadius) {
10727
+ let roundCorner = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
10728
+ let edgeCb = arguments.length > 7 ? arguments[7] : undefined;
10701
10729
  let cornerRadius;
10702
10730
  if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
10703
10731
  const cornerRadiusArr = rectCornerRadius;
@@ -11038,7 +11066,8 @@ class BaseRender {
11038
11066
  doStroke: doStroke
11039
11067
  };
11040
11068
  }
11041
- transform(graphic, graphicAttribute, context, use3dMatrixIn3dMode = !1) {
11069
+ transform(graphic, graphicAttribute, context) {
11070
+ let use3dMatrixIn3dMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
11042
11071
  const {
11043
11072
  x = graphicAttribute.x,
11044
11073
  y = graphicAttribute.y,
@@ -12161,7 +12190,7 @@ class DefaultBoundsAllocate {
12161
12190
  get length() {
12162
12191
  return this.pools.length;
12163
12192
  }
12164
- release(...params) {
12193
+ release() {
12165
12194
  this.pools = [];
12166
12195
  }
12167
12196
  }
@@ -12174,17 +12203,9 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
12174
12203
  drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
12175
12204
  var _a, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12176
12205
  const {
12177
- backgroundOpacity = graphicAttribute.backgroundOpacity,
12178
- opacity = graphicAttribute.opacity,
12179
12206
  backgroundMode = graphicAttribute.backgroundMode,
12180
12207
  backgroundFit = graphicAttribute.backgroundFit,
12181
- backgroundKeepAspectRatio = graphicAttribute.backgroundKeepAspectRatio,
12182
- backgroundScale = graphicAttribute.backgroundScale,
12183
- backgroundOffsetX = graphicAttribute.backgroundOffsetX,
12184
- backgroundOffsetY = graphicAttribute.backgroundOffsetY,
12185
- backgroundPosition = graphicAttribute.backgroundPosition,
12186
- backgroundClip = graphicAttribute.backgroundClip,
12187
- backgroundCornerRadius = graphicAttribute.backgroundCornerRadius
12208
+ backgroundKeepAspectRatio = graphicAttribute.backgroundKeepAspectRatio
12188
12209
  } = graphic.attribute;
12189
12210
  let matrix,
12190
12211
  {
@@ -12196,18 +12217,18 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
12196
12217
  };
12197
12218
  let b;
12198
12219
  "richtext" === graphic.type && (matrix = context.currentMatrix.clone(), context.restore(), context.save(), context.setTransformForCurrent());
12199
- const backgroundConfig = isObject(background) && background.background ? background : null,
12220
+ const shouldReCalBounds = isObject(background) && background.background,
12200
12221
  onlyTranslate = graphic.transMatrix.onlyTranslate();
12201
- if (backgroundConfig) {
12222
+ if (shouldReCalBounds) {
12202
12223
  const _b = graphic.AABBBounds,
12203
- x = (null !== (_a = backgroundConfig.x) && void 0 !== _a ? _a : _b.x1) + (null !== (_c = backgroundConfig.dx) && void 0 !== _c ? _c : 0),
12204
- y = (null !== (_d = backgroundConfig.y) && void 0 !== _d ? _d : _b.y1) + (null !== (_e = backgroundConfig.dy) && void 0 !== _e ? _e : 0),
12205
- w = null !== (_f = backgroundConfig.width) && void 0 !== _f ? _f : _b.width(),
12206
- h = null !== (_g = backgroundConfig.height) && void 0 !== _g ? _g : _b.height();
12207
- if (b = boundsAllocate.allocate(x, y, x + w, y + h), background = backgroundConfig.background, !onlyTranslate) {
12224
+ x = (null !== (_a = background.x) && void 0 !== _a ? _a : _b.x1) + (null !== (_c = background.dx) && void 0 !== _c ? _c : 0),
12225
+ y = (null !== (_d = background.y) && void 0 !== _d ? _d : _b.y1) + (null !== (_e = background.dy) && void 0 !== _e ? _e : 0),
12226
+ w = null !== (_f = background.width) && void 0 !== _f ? _f : _b.width(),
12227
+ h = null !== (_g = background.height) && void 0 !== _g ? _g : _b.height();
12228
+ if (b = boundsAllocate.allocate(x, y, x + w, y + h), background = background.background, !onlyTranslate) {
12208
12229
  const w = b.width(),
12209
12230
  h = b.height();
12210
- b.set((null !== (_h = backgroundConfig.x) && void 0 !== _h ? _h : 0) + (null !== (_j = backgroundConfig.dx) && void 0 !== _j ? _j : 0), (null !== (_k = backgroundConfig.y) && void 0 !== _k ? _k : 0) + (null !== (_l = backgroundConfig.dy) && void 0 !== _l ? _l : 0), w, h);
12231
+ b.set((null !== (_h = background.x) && void 0 !== _h ? _h : 0) + (null !== (_j = background.dx) && void 0 !== _j ? _j : 0), (null !== (_k = background.y) && void 0 !== _k ? _k : 0) + (null !== (_l = background.dy) && void 0 !== _l ? _l : 0), w, h);
12211
12232
  }
12212
12233
  } else b = graphic.AABBBounds, onlyTranslate || (b = getTextBounds(Object.assign(Object.assign({}, graphic.attribute), {
12213
12234
  angle: 0,
@@ -12220,18 +12241,20 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
12220
12241
  })).clone());
12221
12242
  if (graphic.backgroundImg && graphic.resources) {
12222
12243
  const res = graphic.resources.get(background);
12223
- if (!res || "success" !== res.state || !res.data) return void restore();
12224
- context.highPerformanceSave(), onlyTranslate && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.globalAlpha = backgroundOpacity * opacity, backgroundClip && (context.beginPath(), backgroundCornerRadius ? createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0) : context.rect(b.x1, b.y1, b.width(), b.height()), context.clip()), this.doDrawImage(context, res.data, b, {
12244
+ if ("success" !== res.state || !res.data) return void restore();
12245
+ context.highPerformanceSave(), onlyTranslate && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, {
12225
12246
  backgroundMode: backgroundMode,
12226
12247
  backgroundFit: backgroundFit,
12227
- backgroundKeepAspectRatio: backgroundKeepAspectRatio,
12228
- backgroundScale: backgroundScale,
12229
- backgroundOffsetX: backgroundOffsetX,
12230
- backgroundOffsetY: backgroundOffsetY,
12231
- backgroundPosition: backgroundPosition
12248
+ backgroundKeepAspectRatio: backgroundKeepAspectRatio
12232
12249
  }), context.highPerformanceRestore(), context.setTransformForCurrent();
12233
- } else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity * opacity, context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
12234
- backgroundConfig && boundsAllocate.free(b), restore();
12250
+ } else {
12251
+ const {
12252
+ backgroundCornerRadius: backgroundCornerRadius,
12253
+ backgroundOpacity = 1
12254
+ } = graphic.attribute;
12255
+ context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity, context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
12256
+ }
12257
+ shouldReCalBounds && boundsAllocate.free(b), restore();
12235
12258
  }
12236
12259
  }
12237
12260
  const defaultTextBackgroundRenderContribution = new DefaultTextBackgroundRenderContribution();
@@ -12393,7 +12416,8 @@ function drawPolygon(path, points, x, y) {
12393
12416
  for (let i = 1; i < points.length; i++) path.lineTo(points[i].x + x, points[i].y + y);
12394
12417
  }
12395
12418
  }
12396
- function drawRoundedPolygon(path, points, x, y, cornerRadius, closePath = !0) {
12419
+ function drawRoundedPolygon(path, points, x, y, cornerRadius) {
12420
+ let closePath = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
12397
12421
  var _a;
12398
12422
  if (points.length < 3) return void drawPolygon(path, points, x, y);
12399
12423
  let startI = 0,
@@ -12658,92 +12682,6 @@ var __decorate$w = undefined && undefined.__decorate || function (decorators, ta
12658
12682
  };
12659
12683
  };
12660
12684
  const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
12661
- function resolveImageMode({
12662
- repeatX = "no-repeat",
12663
- repeatY = "no-repeat",
12664
- imageMode: imageMode
12665
- }) {
12666
- const repeatMode = resolveImageRepeatMode(repeatX, repeatY);
12667
- return {
12668
- repeatMode: repeatMode,
12669
- sizingMode: "no-repeat" === repeatMode && null != imageMode ? imageMode : "fill"
12670
- };
12671
- }
12672
- const IMAGE_MODE_TO_BACKGROUND_MODE = {
12673
- cover: "no-repeat-cover",
12674
- contain: "no-repeat-contain",
12675
- fill: "no-repeat-fill",
12676
- auto: "no-repeat-auto"
12677
- };
12678
- function resolveBackgroundParamsByImageSizing(sizingMode) {
12679
- return {
12680
- backgroundMode: IMAGE_MODE_TO_BACKGROUND_MODE[sizingMode],
12681
- backgroundFit: !1,
12682
- backgroundKeepAspectRatio: !1
12683
- };
12684
- }
12685
- function resolveImageRepeatMode(repeatX, repeatY) {
12686
- let repeat = 0;
12687
- return "repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat ? repeatStr[repeat] : "no-repeat";
12688
- }
12689
- function shouldClipImageByLayout({
12690
- repeatX = "no-repeat",
12691
- repeatY = "no-repeat",
12692
- imageMode: imageMode,
12693
- imageScale = 1,
12694
- imageOffsetX = 0,
12695
- imageOffsetY = 0,
12696
- imagePosition = "top-left"
12697
- }) {
12698
- const {
12699
- repeatMode: repeatMode,
12700
- sizingMode: sizingMode
12701
- } = resolveImageMode({
12702
- repeatX: repeatX,
12703
- repeatY: repeatY,
12704
- imageMode: imageMode
12705
- });
12706
- return "no-repeat" === repeatMode && ("cover" === sizingMode || "auto" === sizingMode || 1 !== imageScale || 0 !== imageOffsetX || 0 !== imageOffsetY);
12707
- }
12708
- function drawImageWithLayout(context, data, x, y, width, height, {
12709
- repeatX = "no-repeat",
12710
- repeatY = "no-repeat",
12711
- imageMode: imageMode,
12712
- imageScale = 1,
12713
- imageOffsetX = 0,
12714
- imageOffsetY = 0,
12715
- imagePosition = "top-left"
12716
- }) {
12717
- const {
12718
- repeatMode: repeatMode,
12719
- sizingMode: sizingMode
12720
- } = resolveImageMode({
12721
- repeatX: repeatX,
12722
- repeatY: repeatY,
12723
- imageMode: imageMode
12724
- }),
12725
- imageBackgroundParams = "no-repeat" === repeatMode ? resolveBackgroundParamsByImageSizing(sizingMode) : {
12726
- backgroundMode: repeatMode,
12727
- backgroundFit: !1,
12728
- backgroundKeepAspectRatio: !1
12729
- };
12730
- drawBackgroundImage(context, data, {
12731
- x1: x,
12732
- y1: y,
12733
- x2: x + width,
12734
- y2: y + height,
12735
- width: () => width,
12736
- height: () => height
12737
- }, {
12738
- backgroundMode: imageBackgroundParams.backgroundMode,
12739
- backgroundFit: imageBackgroundParams.backgroundFit,
12740
- backgroundKeepAspectRatio: imageBackgroundParams.backgroundKeepAspectRatio,
12741
- backgroundScale: imageScale,
12742
- backgroundOffsetX: imageOffsetX,
12743
- backgroundOffsetY: imageOffsetY,
12744
- backgroundPosition: imagePosition
12745
- });
12746
- }
12747
12685
  let DefaultCanvasImageRender = class extends BaseRender {
12748
12686
  constructor(graphicRenderContributions) {
12749
12687
  super(), this.graphicRenderContributions = graphicRenderContributions, this.numberType = IMAGE_NUMBER_TYPE, this.builtinContributions = [defaultImageRenderContribution, defaultImageBackgroundRenderContribution], this.init(graphicRenderContributions);
@@ -12758,11 +12696,6 @@ let DefaultCanvasImageRender = class extends BaseRender {
12758
12696
  cornerRadius = imageAttribute.cornerRadius,
12759
12697
  fillStrokeOrder = imageAttribute.fillStrokeOrder,
12760
12698
  cornerType = imageAttribute.cornerType,
12761
- imageMode = imageAttribute.imageMode,
12762
- imageScale = imageAttribute.imageScale,
12763
- imageOffsetX = imageAttribute.imageOffsetX,
12764
- imageOffsetY = imageAttribute.imageOffsetY,
12765
- imagePosition = imageAttribute.imagePosition,
12766
12699
  image: url
12767
12700
  } = image.attribute,
12768
12701
  data = this.valid(image, imageAttribute, fillCb);
@@ -12779,33 +12712,22 @@ let DefaultCanvasImageRender = class extends BaseRender {
12779
12712
  const width = image.width,
12780
12713
  height = image.height;
12781
12714
  context.beginPath();
12782
- let needCornerClip = !1;
12783
- 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? context.rect(x, y, width, height) : (createRectPath(context, x, y, width, height, cornerRadius, "bevel" !== cornerType), needCornerClip = !0), context.setShadowBlendStyle && context.setShadowBlendStyle(image, image.attribute, imageAttribute);
12715
+ let needRestore = !1;
12716
+ 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? context.rect(x, y, width, height) : (createRectPath(context, x, y, width, height, cornerRadius, "bevel" !== cornerType), needRestore = !0), context.setShadowBlendStyle && context.setShadowBlendStyle(image, image.attribute, imageAttribute);
12784
12717
  const _runFill = () => {
12785
- doFill && (fillCb ? fillCb(context, image.attribute, imageAttribute) : fVisible && (context.setCommonStyle(image, image.attribute, x, y, imageAttribute), drawImageWithLayout(context, res.data, x, y, width, height, {
12786
- repeatX: repeatX,
12787
- repeatY: repeatY,
12788
- imageMode: imageMode,
12789
- imageScale: imageScale,
12790
- imageOffsetX: imageOffsetX,
12791
- imageOffsetY: imageOffsetY,
12792
- imagePosition: imagePosition
12793
- })));
12718
+ if (doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
12719
+ context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
12720
+ let repeat = 0;
12721
+ if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
12722
+ const pattern = context.createPattern(res.data, repeatStr[repeat]);
12723
+ context.fillStyle = pattern, context.translate(x, y, !0), context.fillRect(0, 0, width, height), context.translate(-x, -y, !0);
12724
+ } else context.drawImage(res.data, x, y, width, height);
12725
+ }
12794
12726
  },
12795
12727
  _runStroke = () => {
12796
12728
  doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke()));
12797
- },
12798
- needLayoutClip = shouldClipImageByLayout({
12799
- repeatX: repeatX,
12800
- repeatY: repeatY,
12801
- imageMode: imageMode,
12802
- imageScale: imageScale,
12803
- imageOffsetX: imageOffsetX,
12804
- imageOffsetY: imageOffsetY,
12805
- imagePosition: imagePosition
12806
- }),
12807
- needClip = needCornerClip || needLayoutClip;
12808
- fillStrokeOrder ? (_runStroke(), needClip && (context.save(), context.clip()), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), _runFill(), needClip && context.restore()) : (needClip && (context.save(), context.clip()), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), _runFill(), needClip && context.restore(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
12729
+ };
12730
+ fillStrokeOrder ? (_runStroke(), needRestore && (context.save(), context.clip()), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), _runFill(), needRestore && context.restore()) : (needRestore && (context.save(), context.clip()), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), _runFill(), needRestore && context.restore(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
12809
12731
  }
12810
12732
  draw(image, renderService, drawContext) {
12811
12733
  const {
@@ -13252,7 +13174,7 @@ let DefaultPluginService = class {
13252
13174
  unRegister(plugin) {
13253
13175
  "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);
13254
13176
  }
13255
- release(...params) {
13177
+ release() {
13256
13178
  this.onStartupFinishedPlugin.forEach(plugin => {
13257
13179
  plugin.deactivate(this);
13258
13180
  }), this.onStartupFinishedPlugin = [], this.onRegisterPlugin.forEach(plugin => {
@@ -13399,7 +13321,9 @@ function parseChildMap(graphic, defaultZIndex, reverse) {
13399
13321
  zIdxArray: zIdxArray
13400
13322
  };
13401
13323
  }
13402
- function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
13324
+ function foreach(graphic, defaultZIndex, cb) {
13325
+ let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
13326
+ let sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
13403
13327
  let needSort = !1;
13404
13328
  if (sort3d) needSort = !0;else {
13405
13329
  let lastZIndex;
@@ -13430,12 +13354,14 @@ function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
13430
13354
  }
13431
13355
  } else graphic.forEachChildren(cb, reverse);
13432
13356
  }
13433
- function foreachAsync(graphic, defaultZIndex, cb, reverse = !1) {
13357
+ function foreachAsync(graphic, defaultZIndex, cb) {
13358
+ let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
13434
13359
  return __awaiter$2(this, void 0, void 0, function* () {
13435
13360
  yield graphic.forEachChildrenAsync(cb, reverse);
13436
13361
  });
13437
13362
  }
13438
- function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
13363
+ function findNextGraphic(graphic, id, defaultZIndex) {
13364
+ let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
13439
13365
  let needSort = !1;
13440
13366
  graphic.forEachChildren((item, i) => {
13441
13367
  const {
@@ -13660,7 +13586,7 @@ let DefaultDrawContribution = class {
13660
13586
  return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
13661
13587
  }
13662
13588
  clearScreen(renderService, context, drawContext) {
13663
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
13589
+ var _a, _b, _c;
13664
13590
  const {
13665
13591
  clear: clear,
13666
13592
  viewBox: viewBox
@@ -13670,20 +13596,9 @@ let DefaultDrawContribution = class {
13670
13596
  if (clear) {
13671
13597
  context.clearRect(0, 0, width, height), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearRect.call(renderService.drawParams);
13672
13598
  const stage = null === (_b = renderService.drawParams) || void 0 === _b ? void 0 : _b.stage;
13673
- if (stage && (context.globalAlpha = (null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1) * (null !== (_d = stage.attribute.backgroundOpacity) && void 0 !== _d ? _d : 1)), stage && stage.backgroundImg && stage.resources) {
13674
- const res = stage.resources.get(getBackgroundImage(clear));
13675
- if (res && "success" === res.state && res.data) {
13676
- const backgroundBounds = boundsAllocate.allocate(0, 0, 0 + width, 0 + height);
13677
- drawBackgroundImage(context, res.data, backgroundBounds, {
13678
- backgroundMode: null !== (_e = stage.attribute.backgroundMode) && void 0 !== _e ? _e : DefaultAttribute.backgroundMode,
13679
- backgroundFit: null !== (_f = stage.attribute.backgroundFit) && void 0 !== _f ? _f : DefaultAttribute.backgroundFit,
13680
- backgroundKeepAspectRatio: null !== (_g = stage.attribute.backgroundKeepAspectRatio) && void 0 !== _g ? _g : DefaultAttribute.backgroundKeepAspectRatio,
13681
- backgroundScale: null !== (_h = stage.attribute.backgroundScale) && void 0 !== _h ? _h : DefaultAttribute.backgroundScale,
13682
- backgroundOffsetX: null !== (_j = stage.attribute.backgroundOffsetX) && void 0 !== _j ? _j : DefaultAttribute.backgroundOffsetX,
13683
- backgroundOffsetY: null !== (_k = stage.attribute.backgroundOffsetY) && void 0 !== _k ? _k : DefaultAttribute.backgroundOffsetY,
13684
- backgroundPosition: null !== (_l = stage.attribute.backgroundPosition) && void 0 !== _l ? _l : DefaultAttribute.backgroundPosition
13685
- }), boundsAllocate.free(backgroundBounds);
13686
- }
13599
+ if (stage && (context.globalAlpha = null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1), stage && stage.backgroundImg && stage.resources) {
13600
+ const res = stage.resources.get(clear);
13601
+ res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
13687
13602
  } else context.fillStyle = createColor(context, clear, {
13688
13603
  AABBBounds: {
13689
13604
  x1: 0,
@@ -19078,7 +18993,8 @@ class Step {
19078
18993
  getLastProps() {
19079
18994
  return this.prev ? this.prev.props || {} : this.animate.getStartProps();
19080
18995
  }
19081
- setDuration(duration, updateDownstream = !0) {
18996
+ setDuration(duration) {
18997
+ let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
19082
18998
  this.duration = duration, updateDownstream && this.updateDownstreamStartTimes();
19083
18999
  }
19084
19000
  getDuration() {
@@ -19099,7 +19015,8 @@ class Step {
19099
19015
  } else interpolateUpdateStore[key] ? funcs.push(interpolateUpdateStore[key]) : funcs.push(commonInterpolateUpdate);
19100
19016
  }), this.interpolateUpdateFunctions = funcs;
19101
19017
  }
19102
- setStartTime(time, updateDownstream = !0) {
19018
+ setStartTime(time) {
19019
+ let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
19103
19020
  this._startTime = time, updateDownstream && this.updateDownstreamStartTimes();
19104
19021
  }
19105
19022
  getStartTime() {
@@ -19225,7 +19142,8 @@ class DefaultTimeline extends EventEmitter {
19225
19142
  animate.release();
19226
19143
  }), this.head = null, this.tail = null, this.animateMap.clear(), this._animateCount = 0, this._totalDuration = 0;
19227
19144
  }
19228
- removeAnimate(animate, release = !0) {
19145
+ removeAnimate(animate) {
19146
+ let release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
19229
19147
  const node = this.animateMap.get(animate);
19230
19148
  node && (release && (animate._onRemove && animate._onRemove.forEach(cb => cb()), animate.release()), node.prev ? node.prev.next = node.next : this.head = node.next, node.next ? node.next.prev = node.prev : this.tail = node.prev, this.animateMap.delete(animate), this._animateCount--, animate.getStartTime() + animate.getDuration() >= this._totalDuration && this.recalculateTotalDuration());
19231
19149
  }
@@ -19263,7 +19181,10 @@ const defaultTimeline = new DefaultTimeline();
19263
19181
  defaultTimeline.isGlobal = !0;
19264
19182
 
19265
19183
  class Animate {
19266
- constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
19184
+ constructor() {
19185
+ let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
19186
+ let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
19187
+ let slience = arguments.length > 2 ? arguments[2] : undefined;
19267
19188
  this.id = id, this.status = AnimateStatus.INITIAL, this._timeline = timeline, timeline.addAnimate(this), this.slience = slience, this._startTime = 0, this._duration = 0, this._totalDuration = 0, this._loopCount = 0, this._currentLoop = 0, this._bounce = !1, this._firstStep = null, this._lastStep = null, this._startProps = {}, this._endProps = {}, this._preventAttrs = new Set(), this.currentTime = 0, this.interpolateUpdateFunction = null, this.priority = 0;
19268
19189
  }
19269
19190
  getStartProps() {
@@ -19286,7 +19207,9 @@ class Animate {
19286
19207
  this.stop(), this.target.animates.delete(this.id);
19287
19208
  }), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
19288
19209
  }
19289
- to(props, duration = 300, easing = "linear") {
19210
+ to(props) {
19211
+ let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
19212
+ let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
19290
19213
  const step = new Step(AnimateStepType.to, props, duration, easing);
19291
19214
  return step.bind(this.target, this), this.updateStepAfterAppend(step), this;
19292
19215
  }
@@ -19316,7 +19239,9 @@ class Animate {
19316
19239
  this._endProps[key] = currentStep.props[key];
19317
19240
  }), currentStep = currentStep.next;
19318
19241
  }
19319
- from(props, duration = 300, easing = "linear") {
19242
+ from(props) {
19243
+ let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
19244
+ let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
19320
19245
  const step = new Step(AnimateStepType.from, props, duration, easing);
19321
19246
  return this._firstStep ? (this._lastStep.append(step), this._lastStep = step) : (this._firstStep = step, this._lastStep = step), this.updateDuration(), this;
19322
19247
  }
@@ -19516,10 +19441,12 @@ class DefaultTicker extends EventEmitter {
19516
19441
  getTimelines() {
19517
19442
  return this.timelines;
19518
19443
  }
19519
- initHandler(force = !1) {
19444
+ initHandler() {
19445
+ let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
19520
19446
  this.setupTickHandler(force);
19521
19447
  }
19522
- setupTickHandler(force = !1) {
19448
+ setupTickHandler() {
19449
+ let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
19523
19450
  if (!force && this.tickerHandler) return !0;
19524
19451
  const handler = new RAFTickHandler();
19525
19452
  return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
@@ -19561,7 +19488,8 @@ class DefaultTicker extends EventEmitter {
19561
19488
  }
19562
19489
  return !1;
19563
19490
  }
19564
- start(force = !1) {
19491
+ start() {
19492
+ let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
19565
19493
  if (this.status === STATUS$1.RUNNING) return !1;
19566
19494
  if (!this.tickerHandler) return !1;
19567
19495
  if (!force) {
@@ -19692,7 +19620,6 @@ function getCustomType(custom) {
19692
19620
  if (custom.prototype.constructor === custom) {
19693
19621
  const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype");
19694
19622
  if (descriptor && !descriptor.writable) return 1;
19695
- if (Object.getOwnPropertyNames(custom.prototype).length > 1) return 1;
19696
19623
  }
19697
19624
  return 2;
19698
19625
  }
@@ -19952,17 +19879,22 @@ class AnimateExecutor {
19952
19879
  var _a, _b;
19953
19880
  return void 0 === value ? defaultValue : "function" == typeof value && graphic ? value(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : value;
19954
19881
  }
19955
- executeItem(params, graphic, index = 0, count = 1) {
19882
+ executeItem(params, graphic) {
19883
+ let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
19884
+ let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
19956
19885
  return Array.isArray(params) ? params.map(param => this._executeItem(param, graphic, index, count)).filter(Boolean) : [this._executeItem(params, graphic, index, count)].filter(Boolean);
19957
19886
  }
19958
- _executeItem(params, graphic, index = 0, count = 1) {
19887
+ _executeItem(params, graphic) {
19888
+ let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
19889
+ let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
19959
19890
  if (!graphic) return null;
19960
19891
  const isTimeline = ("timeSlices" in params);
19961
19892
  let animate = null;
19962
19893
  const parsedParams = this.parseParams(params, isTimeline);
19963
19894
  return animate = isTimeline ? this.executeTimelineItem(parsedParams, graphic, index, count) : this.executeTypeConfigItem(parsedParams, graphic, index, count), animate && this._trackAnimation(animate), animate;
19964
19895
  }
19965
- stop(type, callEnd = !0) {
19896
+ stop(type) {
19897
+ let callEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
19966
19898
  for (; this._animates.length > 0;) {
19967
19899
  const animate = this._animates.pop();
19968
19900
  !1 === callEnd && (animate.status = AnimateStatus.END), null == animate || animate.stop(type);
@@ -20119,7 +20051,8 @@ class GraphicStateExtension {
20119
20051
  applyUnhighlightState(animationConfig, callback) {
20120
20052
  return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
20121
20053
  }
20122
- stopAnimationState(state, type, deep = !1) {
20054
+ stopAnimationState(state, type) {
20055
+ let deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
20123
20056
  return this._getAnimationStateManager(this).stopState(state, type), deep && this.isContainer && this.forEachChildren(child => {
20124
20057
  child.stopAnimationState(state, type, deep);
20125
20058
  }), this;
@@ -20128,7 +20061,8 @@ class GraphicStateExtension {
20128
20061
  const stateManager = this._animationStateManager;
20129
20062
  return stateManager && stateManager.clearState(), this;
20130
20063
  }
20131
- reApplyAnimationState(state, deep = !1) {
20064
+ reApplyAnimationState(state) {
20065
+ let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
20132
20066
  const stateManager = this._animationStateManager;
20133
20067
  return stateManager && stateManager.reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
20134
20068
  child.reApplyAnimationState(state, deep);
@@ -20140,7 +20074,8 @@ class GraphicStateExtension {
20140
20074
  }
20141
20075
 
20142
20076
  class AnimateExtension {
20143
- getAttributes(final = !1) {
20077
+ getAttributes() {
20078
+ let final = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
20144
20079
  return final && this.finalAttribute ? this.finalAttribute : this.attribute;
20145
20080
  }
20146
20081
  animate(params) {
@@ -20182,20 +20117,24 @@ class AnimateExtension {
20182
20117
  getFinalAttribute() {
20183
20118
  return this.finalAttribute;
20184
20119
  }
20185
- getGraphicAttribute(key, prev = !1) {
20120
+ getGraphicAttribute(key) {
20121
+ let prev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
20186
20122
  return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
20187
20123
  }
20188
- pauseAnimation(deep = !1) {
20124
+ pauseAnimation() {
20125
+ let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
20189
20126
  this.animates && this.animates.forEach(animate => animate.pause()), deep && this.isContainer && this.forEachChildren(child => {
20190
20127
  child.pauseAnimation(deep);
20191
20128
  });
20192
20129
  }
20193
- resumeAnimation(deep = !1) {
20130
+ resumeAnimation() {
20131
+ let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
20194
20132
  this.animates && this.animates.forEach(animate => animate.resume()), deep && this.isContainer && this.forEachChildren(child => {
20195
20133
  child.resumeAnimation(deep);
20196
20134
  });
20197
20135
  }
20198
- stopAnimation(deep = !1) {
20136
+ stopAnimation() {
20137
+ let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
20199
20138
  this.animates && this.animates.forEach(animate => animate.stop()), deep && this.isContainer && this.forEachChildren(child => {
20200
20139
  child.stopAnimation(deep);
20201
20140
  });
@@ -35091,6 +35030,6 @@ TableSeriesNumber.defaultAttributes = {
35091
35030
  select: true
35092
35031
  };
35093
35032
 
35094
- const version = "1.0.45";
35033
+ const version = "1.0.46-alpha.0";
35095
35034
 
35096
35035
  export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IDataZoomEvent, IDataZoomInteractiveEvent, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SeriesNumberCellStateValue, SeriesNumberEvent, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, TableSeriesNumber, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };