@antv/g-canvas 1.7.2 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -2461,7 +2461,7 @@
2461
2461
  return inLine(x1.value, y1.value, x2.value, y2.value, ((lineWidth === null || lineWidth === void 0 ? void 0 : lineWidth.value) || 0) + ((increasedLineWidthForHitTesting === null || increasedLineWidthForHitTesting === void 0 ? void 0 : increasedLineWidthForHitTesting.value) || 0), position.x + x, position.y + y);
2462
2462
  }
2463
2463
 
2464
- function isPointInStroke(segments, lineWidth, px, py, length, x, y) {
2464
+ function isPointInStroke(segments, lineWidth, px, py, length) {
2465
2465
  var isHit = false;
2466
2466
 
2467
2467
  for (var i = 0; i < segments.length; i++) {
@@ -2476,19 +2476,6 @@
2476
2476
  case 'Z':
2477
2477
  isHit = inLine(prePoint[0], prePoint[1], currentPoint[0], currentPoint[1], lineWidth, px, py);
2478
2478
  break;
2479
- // case 'Q':
2480
- // const qDistance = QuadUtil.pointDistance(
2481
- // prePoint[0],
2482
- // prePoint[1],
2483
- // params[1],
2484
- // params[2],
2485
- // params[3],
2486
- // params[4],
2487
- // px,
2488
- // py,
2489
- // );
2490
- // isHit = qDistance <= lineWidth / 2;
2491
- // break;
2492
2479
 
2493
2480
  case 'C':
2494
2481
  var cDistance = cubic.pointDistance(prePoint[0], // 上一段结束位置, 即 C 的起始点
@@ -2528,11 +2515,7 @@
2528
2515
  var isClipPath = !!(clipPathTargets === null || clipPathTargets === void 0 ? void 0 : clipPathTargets.length);
2529
2516
  var isHit = false;
2530
2517
 
2531
- if (hasStroke || isClipPath) {
2532
- isHit = isPointInStroke(segments, ((lineWidth === null || lineWidth === void 0 ? void 0 : lineWidth.value) || 0) + ((increasedLineWidthForHitTesting === null || increasedLineWidthForHitTesting === void 0 ? void 0 : increasedLineWidthForHitTesting.value) || 0), position.x + x, position.y + y, totalLength);
2533
- }
2534
-
2535
- if (!isHit && (hasFill || isClipPath)) {
2518
+ if (hasFill || isClipPath) {
2536
2519
  if (hasArc) {
2537
2520
  // 存在曲线时,暂时使用 canvas 的 api 计算,后续可以进行多边形切割
2538
2521
  isHit = isPointInPath(displayObject, position);
@@ -2540,7 +2523,33 @@
2540
2523
  // 提取出来的多边形包含闭合的和非闭合的,在这里统一按照多边形处理
2541
2524
  isHit = inPolygons(polygons, position.x + x, position.y + y) || inPolygons(polylines, position.x + x, position.y + y);
2542
2525
  }
2543
- }
2526
+
2527
+ return isHit;
2528
+ } else if (hasStroke || isClipPath) {
2529
+ isHit = isPointInStroke(segments, ((lineWidth === null || lineWidth === void 0 ? void 0 : lineWidth.value) || 0) + ((increasedLineWidthForHitTesting === null || increasedLineWidthForHitTesting === void 0 ? void 0 : increasedLineWidthForHitTesting.value) || 0), position.x + x, position.y + y, totalLength);
2530
+ } // if (hasStroke || isClipPath) {
2531
+ // isHit = isPointInStroke(
2532
+ // segments,
2533
+ // (lineWidth?.value || 0) + (increasedLineWidthForHitTesting?.value || 0),
2534
+ // position.x + x,
2535
+ // position.y + y,
2536
+ // totalLength,
2537
+ // x,
2538
+ // y,
2539
+ // );
2540
+ // }
2541
+ // if (!isHit && (hasFill || isClipPath)) {
2542
+ // if (hasArc) {
2543
+ // // 存在曲线时,暂时使用 canvas 的 api 计算,后续可以进行多边形切割
2544
+ // isHit = isPointInPath(displayObject, position);
2545
+ // } else {
2546
+ // // 提取出来的多边形包含闭合的和非闭合的,在这里统一按照多边形处理
2547
+ // isHit =
2548
+ // inPolygons(polygons, position.x + x, position.y + y) ||
2549
+ // inPolygons(polylines, position.x + x, position.y + y);
2550
+ // }
2551
+ // }
2552
+
2544
2553
 
2545
2554
  return isHit;
2546
2555
  }
@@ -4212,6 +4221,192 @@
4212
4221
  multiple: false
4213
4222
  });
4214
4223
 
4224
+ var DefaultRenderer = /*#__PURE__*/function () {
4225
+ function DefaultRenderer() {
4226
+ this.imagePool = void 0;
4227
+ }
4228
+
4229
+ var _proto = DefaultRenderer.prototype;
4230
+
4231
+ _proto.render = function render(context, parsedStyle, object, renderingService) {
4232
+ var fill = parsedStyle.fill,
4233
+ opacity = parsedStyle.opacity,
4234
+ fillOpacity = parsedStyle.fillOpacity,
4235
+ stroke = parsedStyle.stroke,
4236
+ strokeOpacity = parsedStyle.strokeOpacity,
4237
+ lineWidth = parsedStyle.lineWidth,
4238
+ lineCap = parsedStyle.lineCap,
4239
+ lineJoin = parsedStyle.lineJoin,
4240
+ shadowType = parsedStyle.shadowType,
4241
+ shadowColor = parsedStyle.shadowColor,
4242
+ shadowBlur = parsedStyle.shadowBlur,
4243
+ filter = parsedStyle.filter,
4244
+ miterLimit = parsedStyle.miterLimit;
4245
+ var hasFill = !g.isNil(fill) && !fill.isNone;
4246
+ var hasStroke = !g.isNil(stroke) && !stroke.isNone && lineWidth && lineWidth.value > 0;
4247
+ var isFillTransparent = fill.alpha === 0;
4248
+ var hasFilter = !g.isNil(filter);
4249
+ var hasShadow = !g.isNil(shadowColor) && (shadowBlur === null || shadowBlur === void 0 ? void 0 : shadowBlur.value) > 0;
4250
+ var nodeName = object.nodeName;
4251
+ var isInnerShadow = (shadowType === null || shadowType === void 0 ? void 0 : shadowType.value) === 'inner';
4252
+ var shouldDrawShadowWithStroke = hasStroke && hasShadow && (nodeName === g.Shape.PATH || nodeName === g.Shape.LINE || nodeName === g.Shape.POLYLINE || isFillTransparent || isInnerShadow);
4253
+
4254
+ if (hasFill) {
4255
+ context.globalAlpha = opacity.value * fillOpacity.value;
4256
+
4257
+ if (!shouldDrawShadowWithStroke) {
4258
+ setShadowAndFilter(object, context, hasShadow);
4259
+ }
4260
+
4261
+ this.fill(context, object, fill, renderingService);
4262
+
4263
+ if (!shouldDrawShadowWithStroke) {
4264
+ this.clearShadowAndFilter(context, hasFilter, hasShadow);
4265
+ }
4266
+ }
4267
+
4268
+ if (hasStroke) {
4269
+ context.globalAlpha = opacity.value * strokeOpacity.value;
4270
+ context.lineWidth = lineWidth.value;
4271
+
4272
+ if (!g.isNil(miterLimit)) {
4273
+ context.miterLimit = miterLimit.value;
4274
+ }
4275
+
4276
+ if (!g.isNil(lineCap)) {
4277
+ context.lineCap = lineCap.value;
4278
+ }
4279
+
4280
+ if (!g.isNil(lineJoin)) {
4281
+ context.lineJoin = lineJoin.value;
4282
+ }
4283
+
4284
+ if (shouldDrawShadowWithStroke) {
4285
+ if (isInnerShadow) {
4286
+ context.globalCompositeOperation = 'source-atop';
4287
+ }
4288
+
4289
+ setShadowAndFilter(object, context, true);
4290
+
4291
+ if (isInnerShadow) {
4292
+ this.stroke(context, object, stroke, renderingService);
4293
+ context.globalCompositeOperation = 'source-over';
4294
+ this.clearShadowAndFilter(context, hasFilter, true);
4295
+ }
4296
+ }
4297
+
4298
+ this.stroke(context, object, stroke, renderingService);
4299
+ }
4300
+ };
4301
+
4302
+ _proto.clearShadowAndFilter = function clearShadowAndFilter(context, hasFilter, hasShadow) {
4303
+ if (hasShadow) {
4304
+ context.shadowColor = 'transparent';
4305
+ context.shadowBlur = 0;
4306
+ }
4307
+
4308
+ if (hasFilter) {
4309
+ // save drop-shadow filter
4310
+ var oldFilter = context.filter;
4311
+
4312
+ if (!g.isNil(oldFilter) && oldFilter.indexOf('drop-shadow') > -1) {
4313
+ context.filter = oldFilter.replace(/drop-shadow\([^)]*\)/, '').trim() || 'none';
4314
+ }
4315
+ }
4316
+ };
4317
+
4318
+ _proto.fill = function fill(context, object, _fill, renderingService) {
4319
+ var _this = this;
4320
+
4321
+ if (Array.isArray(_fill)) {
4322
+ _fill.forEach(function (gradient) {
4323
+ context.fillStyle = _this.getColor(gradient, object, context);
4324
+ context.fill();
4325
+ });
4326
+ } else {
4327
+ if (g.isPattern(_fill)) {
4328
+ context.fillStyle = this.getPattern(_fill, object, context, renderingService);
4329
+ }
4330
+
4331
+ context.fill();
4332
+ }
4333
+ };
4334
+
4335
+ _proto.stroke = function stroke(context, object, _stroke, renderingService) {
4336
+ var _this2 = this;
4337
+
4338
+ if (Array.isArray(_stroke)) {
4339
+ _stroke.forEach(function (gradient) {
4340
+ context.strokeStyle = _this2.getColor(gradient, object, context);
4341
+ context.stroke();
4342
+ });
4343
+ } else {
4344
+ if (g.isPattern(_stroke)) {
4345
+ context.strokeStyle = this.getPattern(_stroke, object, context, renderingService);
4346
+ }
4347
+
4348
+ context.stroke();
4349
+ }
4350
+ };
4351
+
4352
+ _proto.getPattern = function getPattern(pattern, object, context, renderingService) {
4353
+ var canvasPattern = this.imagePool.getOrCreatePatternSync(pattern, context, function () {
4354
+ // set dirty rectangle flag
4355
+ object.renderable.dirty = true;
4356
+ renderingService.dirtify();
4357
+ });
4358
+ return canvasPattern;
4359
+ };
4360
+
4361
+ _proto.getColor = function getColor(parsedColor, object, context) {
4362
+ var color;
4363
+
4364
+ if (parsedColor.type === g.GradientType.LinearGradient || parsedColor.type === g.GradientType.RadialGradient) {
4365
+ var bounds = object.getGeometryBounds();
4366
+ var width = bounds && bounds.halfExtents[0] * 2 || 1;
4367
+ var height = bounds && bounds.halfExtents[1] * 2 || 1;
4368
+ color = this.imagePool.getOrCreateGradient(_extends({
4369
+ type: parsedColor.type
4370
+ }, parsedColor.value, {
4371
+ width: width,
4372
+ height: height
4373
+ }), context);
4374
+ }
4375
+
4376
+ return color;
4377
+ };
4378
+
4379
+ return DefaultRenderer;
4380
+ }();
4381
+
4382
+ __decorate([g.inject(ImagePool), __metadata("design:type", ImagePool)], DefaultRenderer.prototype, "imagePool", void 0);
4383
+
4384
+ DefaultRenderer = __decorate([g.singleton()], DefaultRenderer);
4385
+ /**
4386
+ * apply before fill and stroke but only once
4387
+ */
4388
+
4389
+ function setShadowAndFilter(object, context, hasShadow) {
4390
+ var _object$parsedStyle = object.parsedStyle,
4391
+ filter = _object$parsedStyle.filter,
4392
+ shadowColor = _object$parsedStyle.shadowColor,
4393
+ shadowBlur = _object$parsedStyle.shadowBlur,
4394
+ shadowOffsetX = _object$parsedStyle.shadowOffsetX,
4395
+ shadowOffsetY = _object$parsedStyle.shadowOffsetY;
4396
+
4397
+ if (!g.isNil(filter)) {
4398
+ // use raw filter string
4399
+ context.filter = object.style.filter;
4400
+ }
4401
+
4402
+ if (hasShadow) {
4403
+ context.shadowColor = shadowColor.toString();
4404
+ context.shadowBlur = shadowBlur && shadowBlur.value || 0;
4405
+ context.shadowOffsetX = shadowOffsetX && shadowOffsetX.value || 0;
4406
+ context.shadowOffsetY = shadowOffsetY && shadowOffsetY.value || 0;
4407
+ }
4408
+ }
4409
+
4215
4410
  var ImageRenderer = /*#__PURE__*/function () {
4216
4411
  function ImageRenderer() {
4217
4412
  this.imagePool = void 0;
@@ -4219,10 +4414,12 @@
4219
4414
 
4220
4415
  var _proto = ImageRenderer.prototype;
4221
4416
 
4222
- _proto.render = function render(context, parsedStyle) {
4417
+ _proto.render = function render(context, parsedStyle, object) {
4223
4418
  var width = parsedStyle.width,
4224
4419
  height = parsedStyle.height,
4225
- img = parsedStyle.img;
4420
+ img = parsedStyle.img,
4421
+ shadowColor = parsedStyle.shadowColor,
4422
+ shadowBlur = parsedStyle.shadowBlur;
4226
4423
  var image;
4227
4424
  var iw = width.value;
4228
4425
  var ih = height.value;
@@ -4237,8 +4434,10 @@
4237
4434
  }
4238
4435
 
4239
4436
  if (image) {
4240
- // node-canvas will throw the following err:
4437
+ var hasShadow = !g.isNil(shadowColor) && (shadowBlur === null || shadowBlur === void 0 ? void 0 : shadowBlur.value) > 0;
4438
+ setShadowAndFilter(object, context, hasShadow); // node-canvas will throw the following err:
4241
4439
  // Error: Image given has not completed loading
4440
+
4242
4441
  try {
4243
4442
  context.drawImage(image, 0, 0, iw, ih);
4244
4443
  } catch (e) {}
@@ -4273,7 +4472,9 @@
4273
4472
  opacity = parsedStyle.opacity,
4274
4473
  metrics = parsedStyle.metrics,
4275
4474
  dx = parsedStyle.dx,
4276
- dy = parsedStyle.dy;
4475
+ dy = parsedStyle.dy,
4476
+ shadowColor = parsedStyle.shadowColor,
4477
+ shadowBlur = parsedStyle.shadowBlur;
4277
4478
  var font = metrics.font,
4278
4479
  lines = metrics.lines,
4279
4480
  height = metrics.height,
@@ -4308,8 +4509,10 @@
4308
4509
 
4309
4510
  if (dy && dy.unit === g.UnitType.kPixels) {
4310
4511
  linePositionY += dy.value;
4311
- } // draw lines line by line
4512
+ }
4312
4513
 
4514
+ var hasShadow = !g.isNil(shadowColor) && (shadowBlur === null || shadowBlur === void 0 ? void 0 : shadowBlur.value) > 0;
4515
+ setShadowAndFilter(object, context, hasShadow); // draw lines line by line
4313
4516
 
4314
4517
  for (var i = 0; i < lines.length; i++) {
4315
4518
  var linePositionX = lineWidth.value / 2 + offsetX;
@@ -4413,193 +4616,6 @@
4413
4616
  token: TextRendererContribution
4414
4617
  })], TextRenderer);
4415
4618
 
4416
- var DefaultRenderer = /*#__PURE__*/function () {
4417
- function DefaultRenderer() {
4418
- this.imagePool = void 0;
4419
- }
4420
-
4421
- var _proto = DefaultRenderer.prototype;
4422
-
4423
- _proto.render = function render(context, parsedStyle, object, renderingService) {
4424
- var fill = parsedStyle.fill,
4425
- opacity = parsedStyle.opacity,
4426
- fillOpacity = parsedStyle.fillOpacity,
4427
- stroke = parsedStyle.stroke,
4428
- strokeOpacity = parsedStyle.strokeOpacity,
4429
- lineWidth = parsedStyle.lineWidth,
4430
- lineCap = parsedStyle.lineCap,
4431
- lineJoin = parsedStyle.lineJoin,
4432
- shadowType = parsedStyle.shadowType,
4433
- shadowColor = parsedStyle.shadowColor,
4434
- shadowBlur = parsedStyle.shadowBlur,
4435
- filter = parsedStyle.filter,
4436
- miterLimit = parsedStyle.miterLimit;
4437
- var hasFill = !g.isNil(fill) && !fill.isNone;
4438
- var hasStroke = !g.isNil(stroke) && !stroke.isNone && lineWidth && lineWidth.value > 0;
4439
- var isFillTransparent = fill.alpha === 0;
4440
- var hasFilter = !g.isNil(filter);
4441
- var hasShadow = !g.isNil(shadowColor) && (shadowBlur === null || shadowBlur === void 0 ? void 0 : shadowBlur.value) > 0;
4442
- var nodeName = object.nodeName;
4443
- var isInnerShadow = (shadowType === null || shadowType === void 0 ? void 0 : shadowType.value) === 'inner';
4444
- var shouldDrawShadowWithStroke = hasStroke && hasShadow && (nodeName === g.Shape.PATH || nodeName === g.Shape.LINE || nodeName === g.Shape.POLYLINE || isFillTransparent || isInnerShadow);
4445
-
4446
- if (hasFill) {
4447
- context.globalAlpha = opacity.value * fillOpacity.value;
4448
-
4449
- if (!shouldDrawShadowWithStroke) {
4450
- this.setShadowAndFilter(object, context, hasShadow);
4451
- }
4452
-
4453
- this.fill(context, object, fill, renderingService);
4454
-
4455
- if (!shouldDrawShadowWithStroke) {
4456
- this.clearShadowAndFilter(context, hasFilter, hasShadow);
4457
- }
4458
- }
4459
-
4460
- if (hasStroke) {
4461
- context.globalAlpha = opacity.value * strokeOpacity.value;
4462
- context.lineWidth = lineWidth.value;
4463
-
4464
- if (!g.isNil(miterLimit)) {
4465
- context.miterLimit = miterLimit.value;
4466
- }
4467
-
4468
- if (!g.isNil(lineCap)) {
4469
- context.lineCap = lineCap.value;
4470
- }
4471
-
4472
- if (!g.isNil(lineJoin)) {
4473
- context.lineJoin = lineJoin.value;
4474
- }
4475
-
4476
- if (shouldDrawShadowWithStroke) {
4477
- if (isInnerShadow) {
4478
- context.globalCompositeOperation = 'source-atop';
4479
- }
4480
-
4481
- this.setShadowAndFilter(object, context, true);
4482
-
4483
- if (isInnerShadow) {
4484
- this.stroke(context, object, stroke, renderingService);
4485
- context.globalCompositeOperation = 'source-over';
4486
- this.clearShadowAndFilter(context, hasFilter, true);
4487
- }
4488
- }
4489
-
4490
- this.stroke(context, object, stroke, renderingService);
4491
- }
4492
- };
4493
-
4494
- _proto.clearShadowAndFilter = function clearShadowAndFilter(context, hasFilter, hasShadow) {
4495
- if (hasShadow) {
4496
- context.shadowColor = 'transparent';
4497
- context.shadowBlur = 0;
4498
- }
4499
-
4500
- if (hasFilter) {
4501
- // save drop-shadow filter
4502
- var oldFilter = context.filter;
4503
-
4504
- if (!g.isNil(oldFilter) && oldFilter.indexOf('drop-shadow') > -1) {
4505
- context.filter = oldFilter.replace(/drop-shadow\([^)]*\)/, '').trim() || 'none';
4506
- }
4507
- }
4508
- }
4509
- /**
4510
- * apply before fill and stroke but only once
4511
- */
4512
- ;
4513
-
4514
- _proto.setShadowAndFilter = function setShadowAndFilter(object, context, hasShadow) {
4515
- var _object$parsedStyle = object.parsedStyle,
4516
- filter = _object$parsedStyle.filter,
4517
- shadowColor = _object$parsedStyle.shadowColor,
4518
- shadowBlur = _object$parsedStyle.shadowBlur,
4519
- shadowOffsetX = _object$parsedStyle.shadowOffsetX,
4520
- shadowOffsetY = _object$parsedStyle.shadowOffsetY;
4521
-
4522
- if (!g.isNil(filter)) {
4523
- // use raw filter string
4524
- context.filter = object.style.filter;
4525
- }
4526
-
4527
- if (hasShadow) {
4528
- context.shadowColor = shadowColor.toString();
4529
- context.shadowBlur = shadowBlur && shadowBlur.value || 0;
4530
- context.shadowOffsetX = shadowOffsetX && shadowOffsetX.value || 0;
4531
- context.shadowOffsetY = shadowOffsetY && shadowOffsetY.value || 0;
4532
- }
4533
- };
4534
-
4535
- _proto.fill = function fill(context, object, _fill, renderingService) {
4536
- var _this = this;
4537
-
4538
- if (Array.isArray(_fill)) {
4539
- _fill.forEach(function (gradient) {
4540
- context.fillStyle = _this.getColor(gradient, object, context);
4541
- context.fill();
4542
- });
4543
- } else {
4544
- if (g.isPattern(_fill)) {
4545
- context.fillStyle = this.getPattern(_fill, object, context, renderingService);
4546
- }
4547
-
4548
- context.fill();
4549
- }
4550
- };
4551
-
4552
- _proto.stroke = function stroke(context, object, _stroke, renderingService) {
4553
- var _this2 = this;
4554
-
4555
- if (Array.isArray(_stroke)) {
4556
- _stroke.forEach(function (gradient) {
4557
- context.strokeStyle = _this2.getColor(gradient, object, context);
4558
- context.stroke();
4559
- });
4560
- } else {
4561
- if (g.isPattern(_stroke)) {
4562
- context.strokeStyle = this.getPattern(_stroke, object, context, renderingService);
4563
- }
4564
-
4565
- context.stroke();
4566
- }
4567
- };
4568
-
4569
- _proto.getPattern = function getPattern(pattern, object, context, renderingService) {
4570
- var canvasPattern = this.imagePool.getOrCreatePatternSync(pattern, context, function () {
4571
- // set dirty rectangle flag
4572
- object.renderable.dirty = true;
4573
- renderingService.dirtify();
4574
- });
4575
- return canvasPattern;
4576
- };
4577
-
4578
- _proto.getColor = function getColor(parsedColor, object, context) {
4579
- var color;
4580
-
4581
- if (parsedColor.type === g.GradientType.LinearGradient || parsedColor.type === g.GradientType.RadialGradient) {
4582
- var bounds = object.getGeometryBounds();
4583
- var width = bounds && bounds.halfExtents[0] * 2 || 1;
4584
- var height = bounds && bounds.halfExtents[1] * 2 || 1;
4585
- color = this.imagePool.getOrCreateGradient(_extends({
4586
- type: parsedColor.type
4587
- }, parsedColor.value, {
4588
- width: width,
4589
- height: height
4590
- }), context);
4591
- }
4592
-
4593
- return color;
4594
- };
4595
-
4596
- return DefaultRenderer;
4597
- }();
4598
-
4599
- __decorate([g.inject(ImagePool), __metadata("design:type", ImagePool)], DefaultRenderer.prototype, "imagePool", void 0);
4600
-
4601
- DefaultRenderer = __decorate([g.singleton()], DefaultRenderer);
4602
-
4603
4619
  var RectRenderer = /*#__PURE__*/function (_DefaultRenderer) {
4604
4620
  _inheritsLoose$4(RectRenderer, _DefaultRenderer);
4605
4621
 
@@ -1,13 +1,13 @@
1
1
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g")):"function"==typeof define&&define.amd?define(["exports","@antv/g"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.Canvas2D={}),t.window.G)}(this,(function(t,e){"use strict";function r(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3
- r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new P(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function f(){}function v(){}function d(){}var p={};u(p,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(O([])));g&&g!==e&&n.call(g,i)&&(p=g);var m=d.prototype=f.prototype=Object.create(p);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,h=s.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return v.prototype=d,u(m,"constructor",d),u(d,"constructor",v),v.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(x.prototype),u(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),u(m,c,"Generator"),u(m,i,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(this.prev>=i.tryLoc){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return r(i.catchLoc,!0);if(i.finallyLoc>this.prev)return r(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(this.prev>=o.tryLoc&&n.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,a(t,e)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}var u=e.Syringe.defineToken("PathGeneratorFactory"),s=e.Syringe.defineToken("PathGenerator");function l(t,e){var r=e.r;t.arc(r.value,r.value,r.value,0,2*Math.PI,!1)}function h(t,e){var r=e.rx.value,n=e.ry.value;if(t.ellipse)t.ellipse(r,n,r,n,0,0,2*Math.PI,!1);else{var o=r>n?r:n,i=r>n?1:r/n,a=r>n?n/r:1;t.save(),t.scale(i,a),t.arc(0,0,o,0,2*Math.PI)}}function f(t,r){var n,o,i=r.x1,a=r.y1,c=r.x2,u=r.y2,s=r.defX,l=void 0===s?0:s,h=r.defY,f=void 0===h?0:h,v=r.markerStart,d=r.markerEnd,p=r.markerStartOffset,y=r.markerEndOffset,g=0,m=0,w=0,x=0,b=0;v&&v instanceof e.DisplayObject&&p&&(n=c.value-i.value,o=u.value-a.value,b=Math.atan2(o,n),g=Math.cos(b)*((null==p?void 0:p.value)||0),m=Math.sin(b)*((null==p?void 0:p.value)||0)),d&&d instanceof e.DisplayObject&&y&&(n=i.value-c.value,o=a.value-u.value,b=Math.atan2(o,n),w=Math.cos(b)*((null==y?void 0:y.value)||0),x=Math.sin(b)*((null==y?void 0:y.value)||0)),t.moveTo(i.value-l+g,a.value-f+m),t.lineTo(c.value-l+w,u.value-f+x)}function v(t,r){var n=r.defX,o=void 0===n?0:n,i=r.defY,a=void 0===i?0:i,c=r.markerStart,u=r.markerEnd,s=r.markerStartOffset,l=r.markerEndOffset,h=r.path,f=h.zCommandIndexes,v=[].concat(h.curve);f.forEach((function(t,e){v.splice(t+e,1,["Z"])}));var d,p,y="Z"===v[v.length-1][0],g=0,m=0,w=0,x=0,b=0;if(c&&c instanceof e.DisplayObject&&s){var E=c.parentNode.getStartTangent(),L=E[0],P=E[1];d=L[0]-P[0],p=L[1]-P[1],b=Math.atan2(p,d),g=Math.cos(b)*((null==s?void 0:s.value)||0),m=Math.sin(b)*((null==s?void 0:s.value)||0)}if(u&&u instanceof e.DisplayObject&&l){var O=u.parentNode.getEndTangent(),S=O[0],k=O[1];d=S[0]-k[0],p=S[1]-k[1],b=Math.atan2(p,d),w=Math.cos(b)*((null==l?void 0:l.value)||0),x=Math.sin(b)*((null==l?void 0:l.value)||0)}for(var C=0;v.length>C;C++){var M=v[C];switch(M[0]){case"M":t.moveTo(M[1]-o+g,M[2]-a+m);break;case"C":t.bezierCurveTo(M[1]-o,M[2]-a,M[3]-o,M[4]-a,M[5]-o+(C===v.length-(y?2:1)?w:0),M[6]-a+(C===v.length-(y?2:1)?x:0));break;case"Z":t.closePath()}}}function d(t,r){var n,o,i=r.defX,a=void 0===i?0:i,c=r.defY,u=void 0===c?0:c,s=r.markerStart,l=r.markerEnd,h=r.markerStartOffset,f=r.markerEndOffset,v=r.points.points,d=v.length,p=v[0][0]-a,y=v[0][1]-u,g=v[d-1][0]-a,m=v[d-1][1]-u,w=0,x=0,b=0,E=0,L=0;s&&s instanceof e.DisplayObject&&h&&(n=v[1][0]-v[0][0],o=v[1][1]-v[0][1],L=Math.atan2(o,n),w=Math.cos(L)*((null==h?void 0:h.value)||0),x=Math.sin(L)*((null==h?void 0:h.value)||0)),l&&l instanceof e.DisplayObject&&f&&(n=v[d-1][0]-v[0][0],o=v[d-1][1]-v[0][1],L=Math.atan2(o,n),b=Math.cos(L)*((null==f?void 0:f.value)||0),E=Math.sin(L)*((null==f?void 0:f.value)||0)),t.moveTo(p+(w||b),y+(x||E));for(var P=1;d-1>P;P++){var O=v[P];t.lineTo(O[0]-a,O[1]-u)}t.lineTo(g,m)}function p(t,r){var n,o,i=r.defX,a=void 0===i?0:i,c=r.defY,u=void 0===c?0:c,s=r.markerStart,l=r.markerEnd,h=r.markerStartOffset,f=r.markerEndOffset,v=r.points.points,d=v.length,p=v[0][0]-a,y=v[0][1]-u,g=v[d-1][0]-a,m=v[d-1][1]-u,w=0,x=0,b=0,E=0,L=0;s&&s instanceof e.DisplayObject&&h&&(n=v[1][0]-v[0][0],o=v[1][1]-v[0][1],L=Math.atan2(o,n),w=Math.cos(L)*((null==h?void 0:h.value)||0),x=Math.sin(L)*((null==h?void 0:h.value)||0)),l&&l instanceof e.DisplayObject&&f&&(n=v[d-2][0]-v[d-1][0],o=v[d-2][1]-v[d-1][1],L=Math.atan2(o,n),b=Math.cos(L)*((null==f?void 0:f.value)||0),E=Math.sin(L)*((null==f?void 0:f.value)||0)),t.moveTo(p+w,y+x);for(var P=1;d-1>P;P++){var O=v[P];t.lineTo(O[0]-a,O[1]-u)}t.lineTo(g+b,m+E)}function y(t,r){var n=r.radius,o=r.width,i=r.height,a=o.value,c=i.value;if(n&&n.some((function(t){return 0!==t.value}))){var u=o.value>0?1:-1,s=i.value>0?1:-1,l=u+s===0,h=n.map((function(t){return e.clamp(t.value,0,Math.min(Math.abs(a)/2,Math.abs(c)/2))})),f=h[0],v=h[1],d=h[2],p=h[3];t.moveTo(u*f,0),t.lineTo(a-u*v,0),0!==v&&t.arc(a-u*v,s*v,v,-s*Math.PI/2,u>0?0:Math.PI,l),t.lineTo(a,c-s*d),0!==d&&t.arc(a-u*d,c-s*d,d,u>0?0:Math.PI,s>0?Math.PI/2:1.5*Math.PI,l),t.lineTo(u*p,c),0!==p&&t.arc(u*p,c-s*p,p,s>0?Math.PI/2:-Math.PI/2,u>0?Math.PI:0,l),t.lineTo(0,s*f),0!==f&&t.arc(u*f,s*f,f,u>0?Math.PI:0,s>0?1.5*Math.PI:Math.PI/2,l)}else t.rect(0,0,a,c)}var g=e.Module((function(t){t({token:{token:s,named:e.Shape.CIRCLE},useValue:l}),t({token:{token:s,named:e.Shape.ELLIPSE},useValue:h}),t({token:{token:s,named:e.Shape.RECT},useValue:y}),t({token:{token:s,named:e.Shape.LINE},useValue:f}),t({token:{token:s,named:e.Shape.POLYLINE},useValue:p}),t({token:{token:s,named:e.Shape.POLYGON},useValue:d}),t({token:{token:s,named:e.Shape.PATH},useValue:v}),t({token:u,useFactory:function(t){return function(e){return t.container.isBoundNamed(s,e)?t.container.getNamed(s,e):null}}})})),m=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-path-generator",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,c(e,r);var o=n.prototype;return o.init=function(){this.container.load(g,!0)},o.destroy=function(){this.container.unload(g)},n}(e.AbstractRendererPlugin),w=Object.freeze({__proto__:null,PathGenerator:s,PathGeneratorFactory:u,Plugin:m});function x(t,e,r,n){var o,i=arguments.length,a=3>i?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(3>i?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function b(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function E(){
3
+ r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new P(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function f(){}function v(){}function d(){}var p={};u(p,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(O([])));g&&g!==e&&n.call(g,i)&&(p=g);var m=d.prototype=f.prototype=Object.create(p);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,h=s.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return v.prototype=d,u(m,"constructor",d),u(d,"constructor",v),v.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(x.prototype),u(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),u(m,c,"Generator"),u(m,i,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(this.prev>=i.tryLoc){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return r(i.catchLoc,!0);if(i.finallyLoc>this.prev)return r(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(this.prev>=o.tryLoc&&n.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,a(t,e)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}var u=e.Syringe.defineToken("PathGeneratorFactory"),s=e.Syringe.defineToken("PathGenerator");function l(t,e){var r=e.r;t.arc(r.value,r.value,r.value,0,2*Math.PI,!1)}function h(t,e){var r=e.rx.value,n=e.ry.value;if(t.ellipse)t.ellipse(r,n,r,n,0,0,2*Math.PI,!1);else{var o=r>n?r:n,i=r>n?1:r/n,a=r>n?n/r:1;t.save(),t.scale(i,a),t.arc(0,0,o,0,2*Math.PI)}}function f(t,r){var n,o,i=r.x1,a=r.y1,c=r.x2,u=r.y2,s=r.defX,l=void 0===s?0:s,h=r.defY,f=void 0===h?0:h,v=r.markerStart,d=r.markerEnd,p=r.markerStartOffset,y=r.markerEndOffset,g=0,m=0,w=0,x=0,b=0;v&&v instanceof e.DisplayObject&&p&&(n=c.value-i.value,o=u.value-a.value,b=Math.atan2(o,n),g=Math.cos(b)*((null==p?void 0:p.value)||0),m=Math.sin(b)*((null==p?void 0:p.value)||0)),d&&d instanceof e.DisplayObject&&y&&(n=i.value-c.value,o=a.value-u.value,b=Math.atan2(o,n),w=Math.cos(b)*((null==y?void 0:y.value)||0),x=Math.sin(b)*((null==y?void 0:y.value)||0)),t.moveTo(i.value-l+g,a.value-f+m),t.lineTo(c.value-l+w,u.value-f+x)}function v(t,r){var n=r.defX,o=void 0===n?0:n,i=r.defY,a=void 0===i?0:i,c=r.markerStart,u=r.markerEnd,s=r.markerStartOffset,l=r.markerEndOffset,h=r.path,f=h.zCommandIndexes,v=[].concat(h.curve);f.forEach((function(t,e){v.splice(t+e,1,["Z"])}));var d,p,y="Z"===v[v.length-1][0],g=0,m=0,w=0,x=0,b=0;if(c&&c instanceof e.DisplayObject&&s){var E=c.parentNode.getStartTangent(),L=E[0],P=E[1];d=L[0]-P[0],p=L[1]-P[1],b=Math.atan2(p,d),g=Math.cos(b)*((null==s?void 0:s.value)||0),m=Math.sin(b)*((null==s?void 0:s.value)||0)}if(u&&u instanceof e.DisplayObject&&l){var O=u.parentNode.getEndTangent(),k=O[0],S=O[1];d=k[0]-S[0],p=k[1]-S[1],b=Math.atan2(p,d),w=Math.cos(b)*((null==l?void 0:l.value)||0),x=Math.sin(b)*((null==l?void 0:l.value)||0)}for(var C=0;v.length>C;C++){var M=v[C];switch(M[0]){case"M":t.moveTo(M[1]-o+g,M[2]-a+m);break;case"C":t.bezierCurveTo(M[1]-o,M[2]-a,M[3]-o,M[4]-a,M[5]-o+(C===v.length-(y?2:1)?w:0),M[6]-a+(C===v.length-(y?2:1)?x:0));break;case"Z":t.closePath()}}}function d(t,r){var n,o,i=r.defX,a=void 0===i?0:i,c=r.defY,u=void 0===c?0:c,s=r.markerStart,l=r.markerEnd,h=r.markerStartOffset,f=r.markerEndOffset,v=r.points.points,d=v.length,p=v[0][0]-a,y=v[0][1]-u,g=v[d-1][0]-a,m=v[d-1][1]-u,w=0,x=0,b=0,E=0,L=0;s&&s instanceof e.DisplayObject&&h&&(n=v[1][0]-v[0][0],o=v[1][1]-v[0][1],L=Math.atan2(o,n),w=Math.cos(L)*((null==h?void 0:h.value)||0),x=Math.sin(L)*((null==h?void 0:h.value)||0)),l&&l instanceof e.DisplayObject&&f&&(n=v[d-1][0]-v[0][0],o=v[d-1][1]-v[0][1],L=Math.atan2(o,n),b=Math.cos(L)*((null==f?void 0:f.value)||0),E=Math.sin(L)*((null==f?void 0:f.value)||0)),t.moveTo(p+(w||b),y+(x||E));for(var P=1;d-1>P;P++){var O=v[P];t.lineTo(O[0]-a,O[1]-u)}t.lineTo(g,m)}function p(t,r){var n,o,i=r.defX,a=void 0===i?0:i,c=r.defY,u=void 0===c?0:c,s=r.markerStart,l=r.markerEnd,h=r.markerStartOffset,f=r.markerEndOffset,v=r.points.points,d=v.length,p=v[0][0]-a,y=v[0][1]-u,g=v[d-1][0]-a,m=v[d-1][1]-u,w=0,x=0,b=0,E=0,L=0;s&&s instanceof e.DisplayObject&&h&&(n=v[1][0]-v[0][0],o=v[1][1]-v[0][1],L=Math.atan2(o,n),w=Math.cos(L)*((null==h?void 0:h.value)||0),x=Math.sin(L)*((null==h?void 0:h.value)||0)),l&&l instanceof e.DisplayObject&&f&&(n=v[d-2][0]-v[d-1][0],o=v[d-2][1]-v[d-1][1],L=Math.atan2(o,n),b=Math.cos(L)*((null==f?void 0:f.value)||0),E=Math.sin(L)*((null==f?void 0:f.value)||0)),t.moveTo(p+w,y+x);for(var P=1;d-1>P;P++){var O=v[P];t.lineTo(O[0]-a,O[1]-u)}t.lineTo(g+b,m+E)}function y(t,r){var n=r.radius,o=r.width,i=r.height,a=o.value,c=i.value;if(n&&n.some((function(t){return 0!==t.value}))){var u=o.value>0?1:-1,s=i.value>0?1:-1,l=u+s===0,h=n.map((function(t){return e.clamp(t.value,0,Math.min(Math.abs(a)/2,Math.abs(c)/2))})),f=h[0],v=h[1],d=h[2],p=h[3];t.moveTo(u*f,0),t.lineTo(a-u*v,0),0!==v&&t.arc(a-u*v,s*v,v,-s*Math.PI/2,u>0?0:Math.PI,l),t.lineTo(a,c-s*d),0!==d&&t.arc(a-u*d,c-s*d,d,u>0?0:Math.PI,s>0?Math.PI/2:1.5*Math.PI,l),t.lineTo(u*p,c),0!==p&&t.arc(u*p,c-s*p,p,s>0?Math.PI/2:-Math.PI/2,u>0?Math.PI:0,l),t.lineTo(0,s*f),0!==f&&t.arc(u*f,s*f,f,u>0?Math.PI:0,s>0?1.5*Math.PI:Math.PI/2,l)}else t.rect(0,0,a,c)}var g=e.Module((function(t){t({token:{token:s,named:e.Shape.CIRCLE},useValue:l}),t({token:{token:s,named:e.Shape.ELLIPSE},useValue:h}),t({token:{token:s,named:e.Shape.RECT},useValue:y}),t({token:{token:s,named:e.Shape.LINE},useValue:f}),t({token:{token:s,named:e.Shape.POLYLINE},useValue:p}),t({token:{token:s,named:e.Shape.POLYGON},useValue:d}),t({token:{token:s,named:e.Shape.PATH},useValue:v}),t({token:u,useFactory:function(t){return function(e){return t.container.isBoundNamed(s,e)?t.container.getNamed(s,e):null}}})})),m=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-path-generator",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,c(e,r);var o=n.prototype;return o.init=function(){this.container.load(g,!0)},o.destroy=function(){this.container.unload(g)},n}(e.AbstractRendererPlugin),w=Object.freeze({__proto__:null,PathGenerator:s,PathGeneratorFactory:u,Plugin:m});function x(t,e,r,n){var o,i=arguments.length,a=3>i?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(3>i?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function b(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function E(){
4
4
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
5
- E=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new P(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function L(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function P(t,e){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},P(t,e)}var O="undefined"!=typeof Float32Array?Float32Array:Array;function S(){var t=new O(16);return O!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function k(){var t=new O(3);return O!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function C(t,e,r){var n=new O(3);return n[0]=t,n[1]=e,n[2]=r,n}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var M;M=k();!function(){var t,e=(t=new O(2),O!=Float32Array&&(t[0]=0,t[1]=0),t)}();var T,j,N=e.Syringe.defineToken("PointInPathPicker"),_=(T=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.pointInPathPickerFactory=void 0,this.isHit=function(r,n,o){var i,a,c,u,s,l,h,f,v,d,p,y,g,m,w,x,b,E,L,P,O,M,T,j,N,_,A,R,I,G,F,B=t.pointInPathPickerFactory(r.nodeName);if(B){var D=(i=S(),(F=(L=(c=(a=o)[0])*(f=a[5])-(u=a[1])*(h=a[4]))*(G=(g=a[10])*(E=a[15])-(m=a[11])*(b=a[14]))-(P=c*(v=a[6])-(s=a[2])*h)*(I=(y=a[9])*E-m*(x=a[13]))+(O=c*(d=a[7])-(l=a[3])*h)*(R=y*b-g*x)+(M=u*v-s*f)*(A=(p=a[8])*E-m*(w=a[12]))-(T=u*d-l*f)*(_=p*b-g*w)+(j=s*d-l*v)*(N=p*x-y*w))?(i[0]=(f*G-v*I+d*R)*(F=1/F),i[1]=(s*I-u*G-l*R)*F,i[2]=(x*j-b*T+E*M)*F,i[3]=(g*T-y*j-m*M)*F,i[4]=(v*A-h*G-d*_)*F,i[5]=(c*G-s*A+l*_)*F,i[6]=(b*O-w*j-E*P)*F,i[7]=(p*j-g*O+m*P)*F,i[8]=(h*I-f*A+d*N)*F,i[9]=(u*A-c*I-l*N)*F,i[10]=(w*T-x*O+E*L)*F,i[11]=(y*O-p*T-m*L)*F,i[12]=(f*_-h*R-v*N)*F,i[13]=(c*R-u*_+s*N)*F,i[14]=(x*P-w*M-b*L)*F,i[15]=(p*M-y*P+g*L)*F,i):null),Y=function(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}(k(),C(n[0],n[1],0),D),W=r.getGeometryBounds().halfExtents,$=r.parsedStyle.anchor;if(Y[0]+=($&&$[0].value||0)*W[0]*2,Y[1]+=($&&$[1].value||0)*W[1]*2,B(r,new e.Point(Y[0],Y[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,r){var n=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas);void 0===t.pathGeneratorFactoryCache[e.nodeName]&&(t.pathGeneratorFactoryCache[e.nodeName]=t.pathGeneratorFactory(e.nodeName));var o=t.pathGeneratorFactoryCache[e.nodeName];return o&&(n.beginPath(),o(n,e.parsedStyle),n.closePath()),n.isPointInPath(r.x,r.y)}}var r=t.prototype;return r.apply=function(t){var e=this;t.hooks.pick.tapPromise(j.tag,function(){var t,r=(t=E().mark((function t(r){var n,o,i,a,c,u,s,l,h,f,v,d,p;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.topmost,i=C((o=r.position).x,o.y,0),a=e.rBush.search({minX:i[0],minY:i[1],maxX:i[0],maxY:i[1]}),c=a.map((function(t){return t.id})),u=[],a.forEach((function(t){var r=e.displayObjectPool.getByEntity(t.id);if(r.isVisible()&&!r.isCulled()&&r.isInteractive()){if(r.parentNode&&-1===c.indexOf(r.parentNode.entity))return;u.push(r)}})),u.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),s=[],l=0,h=u;case 9:if(l>=h.length){t.next=37;break}if(v=(f=h[l]).getWorldTransform(),!e.isHit(f,i,v)){t.next=34;break}if(!(d=e.findClosestClipPath(f))){t.next=28;break}if(p=d.style.clipPath,y=S(),g=d===f?v:d.getWorldTransform(),m=p.getLocalTransform(),w=void 0,x=void 0,b=void 0,E=void 0,L=void 0,P=void 0,O=void 0,k=void 0,M=void 0,T=void 0,j=void 0,N=void 0,_=void 0,A=void 0,R=void 0,I=void 0,G=void 0,F=void 0,B=void 0,D=void 0,x=g[1],b=g[2],E=g[3],P=g[5],O=g[6],k=g[7],T=g[9],j=g[10],N=g[11],A=g[13],R=g[14],I=g[15],y[0]=(G=m[0])*(w=g[0])+(F=m[1])*(L=g[4])+(B=m[2])*(M=g[8])+(D=m[3])*(_=g[12]),y[1]=G*x+F*P+B*T+D*A,y[2]=G*b+F*O+B*j+D*R,y[3]=G*E+F*k+B*N+D*I,y[4]=(G=m[4])*w+(F=m[5])*L+(B=m[6])*M+(D=m[7])*_,y[5]=G*x+F*P+B*T+D*A,y[6]=G*b+F*O+B*j+D*R,y[7]=G*E+F*k+B*N+D*I,y[8]=(G=m[8])*w+(F=m[9])*L+(B=m[10])*M+(D=m[11])*_,y[9]=G*x+F*P+B*T+D*A,y[10]=G*b+F*O+B*j+D*R,y[11]=G*E+F*k+B*N+D*I,y[12]=(G=m[12])*w+(F=m[13])*L+(B=m[14])*M+(D=m[15])*_,y[13]=G*x+F*P+B*T+D*A,y[14]=G*b+F*O+B*j+D*R,y[15]=G*E+F*k+B*N+D*I,!e.isHit(p,i,v=y)){t.next=26;break}if(!n){t.next=25;break}return r.picked=[f],t.abrupt("return",r);case 25:s.push(f);case 26:t.next=34;break;case 28:if(!n){t.next=33;break}return r.picked=[f],t.abrupt("return",r);case 33:s.push(f);case 34:l++,t.next=9;break;case 37:return r.picked=s,t.abrupt("return",r);case 39:case"end":return t.stop()}var y,g,m,w,x,b,E,L,P,O,k,M,T,j,N,_,A,R,I,G,F,B,D}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){L(i,n,o,a,c,"next",t)}function c(t){L(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return r.apply(this,arguments)}}())},r.findClosestClipPath=function(t){var e=t;do{var r;if(null===(r=e.style)||void 0===r?void 0:r.clipPath)return e;e=e.parentElement}while(null!==e);return null},t}(),T.tag="CanvasPicker",j=T);function A(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function R(t,e){return.001>Math.abs(t-e)}function I(t,e){var r=Math.min.apply(Math,t),n=Math.min.apply(Math,e);return{x:r,y:n,width:Math.max.apply(Math,t)-r,height:Math.max.apply(Math,e)-n}}x([e.inject(e.DisplayObjectPool),b("design:type",e.DisplayObjectPool)],_.prototype,"displayObjectPool",void 0),x([e.inject(e.CanvasConfig),b("design:type",Object)],_.prototype,"canvasConfig",void 0),x([e.inject(e.OffscreenCanvasCreator),b("design:type",e.OffscreenCanvasCreator)],_.prototype,"offscreenCanvas",void 0),x([e.inject(e.RBushRoot),b("design:type",e.RBush)],_.prototype,"rBush",void 0),x([e.inject(u),b("design:type",Function)],_.prototype,"pathGeneratorFactory",void 0),x([e.inject(N),b("design:type",Function)],_.prototype,"pointInPathPickerFactory",void 0),_=j=x([e.singleton({contrib:e.RenderingPluginContribution})],_);var G=function(t,e,r,n,o){return{x:(1-o)*t+o*r,y:(1-o)*e+o*n}},F=function(t,e,r,n,o,i){var a=[r-t,n-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((o-t)*(o-t)+(i-e)*(i-e));var c=[-a[1],a[0]];return function(t,e){var r=e[0],n=e[1],o=r*r+n*n;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([o-t,i-e],c))};function B(t,e,r,n,o){var i=1-o;return i*i*i*t+3*e*o*i*i+3*r*o*o*i+n*o*o*o}function D(t,e,r,n,o){var i=1-o;return 3*(i*i*(e-t)+2*i*o*(r-e)+o*o*(n-r))}function Y(t,e,r,n){var o,i,a,c=-3*t+9*e-9*r+3*n,u=6*t-12*e+6*r,s=3*e-3*t,l=[];if(R(c,0))R(u,0)||0>(o=-s/u)||o>1||l.push(o);else{var h=u*u-4*c*s;R(h,0)?l.push(-u/(2*c)):h>0&&(i=(-u-(a=Math.sqrt(h)))/(2*c),0>(o=(-u+a)/(2*c))||o>1||l.push(o),0>i||i>1||l.push(i))}return l}function W(t,e,r,n,o,i,a,c,u){var s=B(t,r,o,a,u),l=B(e,n,i,c,u),h=G(t,e,r,n,u),f=G(r,n,o,i,u),v=G(o,i,a,c,u),d=G(h.x,h.y,f.x,f.y,u),p=G(f.x,f.y,v.x,v.y,u);return[[t,e,h.x,h.y,d.x,d.y,s,l],[s,l,p.x,p.y,v.x,v.y,a,c]]}function $(t,e,r,n,o,i,a,c,u){if(0===u)return function(t,e){for(var r=0,n=t.length,o=0;n>o;o++)r+=A(t[o],e[o],t[(o+1)%n],e[(o+1)%n]);return r/2}([t,r,o,a],[e,n,i,c]);var s=W(t,e,r,n,o,i,a,c,.5),l=[].concat(s[0],[u-1]),h=[].concat(s[1],[u-1]);return $.apply(void 0,l)+$.apply(void 0,h)}var H={extrema:Y,box:function(t,e,r,n,o,i,a,c){for(var u=[t,a],s=[e,c],l=Y(t,r,o,a),h=Y(e,n,i,c),f=0;l.length>f;f++)u.push(B(t,r,o,a,l[f]));for(var v=0;h.length>v;v++)s.push(B(e,n,i,c,h[v]));return I(u,s)},length:function(t,e,r,n,o,i,a,c){return $(t,e,r,n,o,i,a,c,3)},nearestPoint:function(t,e,r,n,o,i,a,c,u,s,l){return function(t,e,r,n,o,i){var a=-1,c=1/0,u=[r,n],s=20;i&&i>200&&(s=i/10);for(var l=1/s,h=l/10,f=0;s>=f;f++){var v=f*l,d=[o.apply(void 0,t.concat([v])),o.apply(void 0,e.concat([v]))],p=A(u[0],u[1],d[0],d[1]);c>p&&(a=v,c=p)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&h>=1e-4;g++){var m=a-h,w=a+h,x=[o.apply(void 0,t.concat([m])),o.apply(void 0,e.concat([m]))],b=A(u[0],u[1],x[0],x[1]);if(m>=0&&c>b)a=m,c=b;else{var E=[o.apply(void 0,t.concat([w])),o.apply(void 0,e.concat([w]))],L=A(u[0],u[1],E[0],E[1]);1>=w&&c>L?(a=w,c=L):h*=.5}}return{x:o.apply(void 0,t.concat([a])),y:o.apply(void 0,e.concat([a]))}}([t,r,o,a],[e,n,i,c],u,s,B,l)},pointDistance:function(t,e,r,n,o,i,a,c,u,s,l){var h=this.nearestPoint(t,e,r,n,o,i,a,c,u,s,l);return A(h.x,h.y,u,s)},interpolationAt:B,pointAt:function(t,e,r,n,o,i,a,c,u){return{x:B(t,r,o,a,u),y:B(e,n,i,c,u)}},divide:function(t,e,r,n,o,i,a,c,u){return W(t,e,r,n,o,i,a,c,u)},tangentAngle:function(t,e,r,n,o,i,a,c,u){var s=D(t,r,o,a,u),l=D(e,n,i,c,u);return(Math.atan2(l,s)+2*Math.PI)%(2*Math.PI)}};function U(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function V(t,e,r,n,o,i){return!(t>o||o>t+r||e>i||i>e+n)}function X(t,e,r,n,o,i,a,c){var u=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(n>u||u>o)return!1;var s={x:t+r*Math.cos(u),y:e+r*Math.sin(u)};return U(s.x,s.y,a,c)<=i/2}function z(t,e,r,n,o,i,a){var c=Math.min(t,r),u=Math.max(t,r),s=Math.min(e,n),l=Math.max(e,n),h=o/2;return!(c-h>i||i>u+h||s-h>a||a>l+h)&&F(t,e,r,n,i,a)<=o/2}function q(t,e,r,n,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(z(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,r,n))return!0}if(o){var c=t[0],u=t[i-1];if(z(c[0],c[1],u[0],u[1],e,r,n))return!0}return!1}function Q(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function Z(t,e,r){return!((r[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(r[1]-t[1])||Math.min(t[0],e[0])>r[0]||r[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>r[1]||r[1]>Math.max(t[1],e[1]))}function J(t,e,r){var n=!1,o=t.length;if(2>=o)return!1;for(var i=0;o>i;i++){var a=t[i],c=t[(i+1)%o];if(Z(a,c,[e,r]))return!0;Q(a[1]-r)>0!=Q(c[1]-r)>0&&0>Q(e-(r-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(n=!n)}return n}function K(t,e,r){for(var n=!1,o=0;t.length>o;o++){if(n=J(t[o],e,r))break}return n}function tt(t,e){var r=t.parsedStyle,n=r.fill,o=r.stroke,i=r.lineWidth,a=r.increasedLineWidthForHitTesting,c=r.clipPathTargets,u=r.r.value,s=(((null==i?void 0:i.value)||0)+((null==a?void 0:a.value)||0))/2,l=U(u,u,e.x,e.y),h=n&&!n.isNone,f=o&&!o.isNone;return h&&f||!!(null==c?void 0:c.length)?u+s>=l:h?u>=l:!!f&&(l>=u-s&&u+s>=l)}function et(t,e,r,n){return t/(r*r)+e/(n*n)}function rt(t,e){var r=e.x,n=e.y,o=t.parsedStyle,i=o.fill,a=o.stroke,c=o.lineWidth,u=o.increasedLineWidthForHitTesting,s=o.clipPathTargets,l=i&&!i.isNone,h=a&&!a.isNone,f=o.rx.value,v=o.ry.value,d=(((null==c?void 0:c.value)||0)+((null==u?void 0:u.value)||0))/2,p=(r-f)*(r-f),y=(n-v)*(n-v);return l&&h||!!(null==s?void 0:s.length)?1>=et(p,y,f+d,v+d):l?1>=et(p,y,f,v):!!h&&(et(p,y,f-d,v-d)>=1&&1>=et(p,y,f+d,v+d))}function nt(t,e){var r=t.parsedStyle,n=r.lineWidth,o=r.increasedLineWidthForHitTesting,i=r.defX,a=r.defY;return z(r.x1.value,r.y1.value,r.x2.value,r.y2.value,((null==n?void 0:n.value)||0)+((null==o?void 0:o.value)||0),e.x+(void 0===i?0:i),e.y+(void 0===a?0:a))}function ot(t,e,r){var n=t.parsedStyle,o=n.lineWidth,i=n.increasedLineWidthForHitTesting,a=n.stroke,c=n.fill,u=n.defX,s=void 0===u?0:u,l=n.defY,h=void 0===l?0:l,f=n.clipPathTargets,v=n.path,d=c&&!c.isNone,p=v.hasArc,y=v.polylines,g=v.polygons,m=!!(null==f?void 0:f.length),w=!1;return(a&&!a.isNone||m)&&(w=function(t,e,r,n,o,i,a){for(var c=!1,u=0;t.length>u;u++){var s=t[u],l=s.currentPoint,h=s.params,f=s.prePoint;switch(s.command){case"L":case"Z":c=z(f[0],f[1],l[0],l[1],e,r,n);break;case"C":c=e/2>=H.pointDistance(f[0],f[1],h[1],h[2],h[3],h[4],h[5],h[6],r,n,o)}if(c)break}return c}(v.segments,((null==o?void 0:o.value)||0)+((null==i?void 0:i.value)||0),e.x+s,e.y+h,v.totalLength)),w||!d&&!m||(w=p?r(t,e):K(g,e.x+s,e.y+h)||K(y,e.x+s,e.y+h)),w}function it(t,e){var r=t.parsedStyle,n=r.stroke,o=r.fill,i=r.lineWidth,a=r.increasedLineWidthForHitTesting,c=r.points,u=r.defX,s=void 0===u?0:u,l=r.defY,h=void 0===l?0:l,f=r.clipPathTargets,v=!!(null==f?void 0:f.length),d=o&&!o.isNone,p=!1;return(n&&!n.isNone||v)&&(p=q(c.points,((null==i?void 0:i.value)||0)+((null==a?void 0:a.value)||0),e.x+s,e.y+h,!0)),p||!d&&!v||(p=J(c.points,e.x+s,e.y+h)),p}function at(t,e){var r=t.parsedStyle,n=r.stroke,o=r.lineWidth,i=r.increasedLineWidthForHitTesting,a=r.defX,c=r.defY,u=r.clipPathTargets;return!((!n||n.isNone)&&!(null==u?void 0:u.length)||!o)&&q(r.points.points,((null==o?void 0:o.value)||0)+((null==i?void 0:i.value)||0),e.x+(void 0===a?0:a),e.y+(void 0===c?0:c),!1)}function ct(t,r,n){var o=t.parsedStyle,i=o.radius,a=o.fill,c=o.stroke,u=o.lineWidth,s=o.increasedLineWidthForHitTesting,l=o.width,h=o.height,f=o.clipPathTargets,v=!!(null==f?void 0:f.length),d=a&&!a.isNone,p=c&&!c.isNone,y=i&&i.some((function(t){return 0!==t.value})),g=l.unit,m=h.unit,w=0,x=0;g!==e.UnitType.kNumber&&g!==e.UnitType.kPixels||(w=l.value),m!==e.UnitType.kNumber&&m!==e.UnitType.kPixels||(x=h.value);var b=((null==u?void 0:u.value)||0)+((null==s?void 0:s.value)||0);if(y){var E=!1;return(p||v)&&(E=function(t,e,r,n,o,i,a,c){var u=o[0],s=o[1],l=o[2],h=o[3];return z(t+u,e,t+r-s,e,i,a,c)||z(t+r,e+s,t+r,e+n-l,i,a,c)||z(t+r-l,e+n,t+h,e+n,i,a,c)||z(t,e+n-h,t,e+u,i,a,c)||X(t+r-s,e+s,s,1.5*Math.PI,2*Math.PI,i,a,c)||X(t+r-l,e+n-l,l,0,.5*Math.PI,i,a,c)||X(t+h,e+n-h,h,.5*Math.PI,Math.PI,i,a,c)||X(t+u,e+u,u,Math.PI,1.5*Math.PI,i,a,c)}(0,0,w,x,i.map((function(t){return e.clamp(t.value,0,Math.min(Math.abs(w)/2,Math.abs(x)/2))})),b,r.x,r.y)),E||!d&&!v||(E=n(t,r)),E}var L=b/2;return d&&p||v?V(0-L,0-L,w+L,x+L,r.x,r.y):d?V(0,0,w,x,r.x,r.y):!!p&&function(t,e,r,n,o,i,a){var c=o/2;return V(t-c,e-c,r,o,i,a)||V(t+r-c,e-c,o,n,i,a)||V(t+c,e+n-c,r,o,i,a)||V(t-c,e+c,o,n,i,a)}(0,0,w,x,b,r.x,r.y)}var ut=e.Module((function(t){t({token:N,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?tt:t===e.Shape.ELLIPSE?rt:t===e.Shape.RECT?ct:t===e.Shape.LINE?nt:t===e.Shape.POLYLINE?at:t===e.Shape.POLYGON?it:t===e.Shape.PATH?ot:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(_)})),st=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-picker",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,P(e,r);var o=n.prototype;return o.init=function(){this.container.load(ut,!0)},o.destroy=function(){this.container.unload(ut)},n}(e.AbstractRendererPlugin),lt=Object.freeze({__proto__:null,Plugin:st});function ht(){
5
+ E=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new P(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function L(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function P(t,e){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},P(t,e)}var O="undefined"!=typeof Float32Array?Float32Array:Array;function k(){var t=new O(16);return O!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function S(){var t=new O(3);return O!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function C(t,e,r){var n=new O(3);return n[0]=t,n[1]=e,n[2]=r,n}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var M;M=S();!function(){var t,e=(t=new O(2),O!=Float32Array&&(t[0]=0,t[1]=0),t)}();var T,j,N=e.Syringe.defineToken("PointInPathPicker"),_=(T=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.pointInPathPickerFactory=void 0,this.isHit=function(r,n,o){var i,a,c,u,s,l,h,f,v,d,p,y,g,m,w,x,b,E,L,P,O,M,T,j,N,_,A,R,I,G,F,B=t.pointInPathPickerFactory(r.nodeName);if(B){var D=(i=k(),(F=(L=(c=(a=o)[0])*(f=a[5])-(u=a[1])*(h=a[4]))*(G=(g=a[10])*(E=a[15])-(m=a[11])*(b=a[14]))-(P=c*(v=a[6])-(s=a[2])*h)*(I=(y=a[9])*E-m*(x=a[13]))+(O=c*(d=a[7])-(l=a[3])*h)*(R=y*b-g*x)+(M=u*v-s*f)*(A=(p=a[8])*E-m*(w=a[12]))-(T=u*d-l*f)*(_=p*b-g*w)+(j=s*d-l*v)*(N=p*x-y*w))?(i[0]=(f*G-v*I+d*R)*(F=1/F),i[1]=(s*I-u*G-l*R)*F,i[2]=(x*j-b*T+E*M)*F,i[3]=(g*T-y*j-m*M)*F,i[4]=(v*A-h*G-d*_)*F,i[5]=(c*G-s*A+l*_)*F,i[6]=(b*O-w*j-E*P)*F,i[7]=(p*j-g*O+m*P)*F,i[8]=(h*I-f*A+d*N)*F,i[9]=(u*A-c*I-l*N)*F,i[10]=(w*T-x*O+E*L)*F,i[11]=(y*O-p*T-m*L)*F,i[12]=(f*_-h*R-v*N)*F,i[13]=(c*R-u*_+s*N)*F,i[14]=(x*P-w*M-b*L)*F,i[15]=(p*M-y*P+g*L)*F,i):null),Y=function(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}(S(),C(n[0],n[1],0),D),W=r.getGeometryBounds().halfExtents,$=r.parsedStyle.anchor;if(Y[0]+=($&&$[0].value||0)*W[0]*2,Y[1]+=($&&$[1].value||0)*W[1]*2,B(r,new e.Point(Y[0],Y[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,r){var n=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas);void 0===t.pathGeneratorFactoryCache[e.nodeName]&&(t.pathGeneratorFactoryCache[e.nodeName]=t.pathGeneratorFactory(e.nodeName));var o=t.pathGeneratorFactoryCache[e.nodeName];return o&&(n.beginPath(),o(n,e.parsedStyle),n.closePath()),n.isPointInPath(r.x,r.y)}}var r=t.prototype;return r.apply=function(t){var e=this;t.hooks.pick.tapPromise(j.tag,function(){var t,r=(t=E().mark((function t(r){var n,o,i,a,c,u,s,l,h,f,v,d,p;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.topmost,i=C((o=r.position).x,o.y,0),a=e.rBush.search({minX:i[0],minY:i[1],maxX:i[0],maxY:i[1]}),c=a.map((function(t){return t.id})),u=[],a.forEach((function(t){var r=e.displayObjectPool.getByEntity(t.id);if(r.isVisible()&&!r.isCulled()&&r.isInteractive()){if(r.parentNode&&-1===c.indexOf(r.parentNode.entity))return;u.push(r)}})),u.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),s=[],l=0,h=u;case 9:if(l>=h.length){t.next=37;break}if(v=(f=h[l]).getWorldTransform(),!e.isHit(f,i,v)){t.next=34;break}if(!(d=e.findClosestClipPath(f))){t.next=28;break}if(p=d.style.clipPath,y=k(),g=d===f?v:d.getWorldTransform(),m=p.getLocalTransform(),w=void 0,x=void 0,b=void 0,E=void 0,L=void 0,P=void 0,O=void 0,S=void 0,M=void 0,T=void 0,j=void 0,N=void 0,_=void 0,A=void 0,R=void 0,I=void 0,G=void 0,F=void 0,B=void 0,D=void 0,x=g[1],b=g[2],E=g[3],P=g[5],O=g[6],S=g[7],T=g[9],j=g[10],N=g[11],A=g[13],R=g[14],I=g[15],y[0]=(G=m[0])*(w=g[0])+(F=m[1])*(L=g[4])+(B=m[2])*(M=g[8])+(D=m[3])*(_=g[12]),y[1]=G*x+F*P+B*T+D*A,y[2]=G*b+F*O+B*j+D*R,y[3]=G*E+F*S+B*N+D*I,y[4]=(G=m[4])*w+(F=m[5])*L+(B=m[6])*M+(D=m[7])*_,y[5]=G*x+F*P+B*T+D*A,y[6]=G*b+F*O+B*j+D*R,y[7]=G*E+F*S+B*N+D*I,y[8]=(G=m[8])*w+(F=m[9])*L+(B=m[10])*M+(D=m[11])*_,y[9]=G*x+F*P+B*T+D*A,y[10]=G*b+F*O+B*j+D*R,y[11]=G*E+F*S+B*N+D*I,y[12]=(G=m[12])*w+(F=m[13])*L+(B=m[14])*M+(D=m[15])*_,y[13]=G*x+F*P+B*T+D*A,y[14]=G*b+F*O+B*j+D*R,y[15]=G*E+F*S+B*N+D*I,!e.isHit(p,i,v=y)){t.next=26;break}if(!n){t.next=25;break}return r.picked=[f],t.abrupt("return",r);case 25:s.push(f);case 26:t.next=34;break;case 28:if(!n){t.next=33;break}return r.picked=[f],t.abrupt("return",r);case 33:s.push(f);case 34:l++,t.next=9;break;case 37:return r.picked=s,t.abrupt("return",r);case 39:case"end":return t.stop()}var y,g,m,w,x,b,E,L,P,O,S,M,T,j,N,_,A,R,I,G,F,B,D}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){L(i,n,o,a,c,"next",t)}function c(t){L(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return r.apply(this,arguments)}}())},r.findClosestClipPath=function(t){var e=t;do{var r;if(null===(r=e.style)||void 0===r?void 0:r.clipPath)return e;e=e.parentElement}while(null!==e);return null},t}(),T.tag="CanvasPicker",j=T);function A(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function R(t,e){return.001>Math.abs(t-e)}function I(t,e){var r=Math.min.apply(Math,t),n=Math.min.apply(Math,e);return{x:r,y:n,width:Math.max.apply(Math,t)-r,height:Math.max.apply(Math,e)-n}}x([e.inject(e.DisplayObjectPool),b("design:type",e.DisplayObjectPool)],_.prototype,"displayObjectPool",void 0),x([e.inject(e.CanvasConfig),b("design:type",Object)],_.prototype,"canvasConfig",void 0),x([e.inject(e.OffscreenCanvasCreator),b("design:type",e.OffscreenCanvasCreator)],_.prototype,"offscreenCanvas",void 0),x([e.inject(e.RBushRoot),b("design:type",e.RBush)],_.prototype,"rBush",void 0),x([e.inject(u),b("design:type",Function)],_.prototype,"pathGeneratorFactory",void 0),x([e.inject(N),b("design:type",Function)],_.prototype,"pointInPathPickerFactory",void 0),_=j=x([e.singleton({contrib:e.RenderingPluginContribution})],_);var G=function(t,e,r,n,o){return{x:(1-o)*t+o*r,y:(1-o)*e+o*n}},F=function(t,e,r,n,o,i){var a=[r-t,n-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((o-t)*(o-t)+(i-e)*(i-e));var c=[-a[1],a[0]];return function(t,e){var r=e[0],n=e[1],o=r*r+n*n;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([o-t,i-e],c))};function B(t,e,r,n,o){var i=1-o;return i*i*i*t+3*e*o*i*i+3*r*o*o*i+n*o*o*o}function D(t,e,r,n,o){var i=1-o;return 3*(i*i*(e-t)+2*i*o*(r-e)+o*o*(n-r))}function Y(t,e,r,n){var o,i,a,c=-3*t+9*e-9*r+3*n,u=6*t-12*e+6*r,s=3*e-3*t,l=[];if(R(c,0))R(u,0)||0>(o=-s/u)||o>1||l.push(o);else{var h=u*u-4*c*s;R(h,0)?l.push(-u/(2*c)):h>0&&(i=(-u-(a=Math.sqrt(h)))/(2*c),0>(o=(-u+a)/(2*c))||o>1||l.push(o),0>i||i>1||l.push(i))}return l}function W(t,e,r,n,o,i,a,c,u){var s=B(t,r,o,a,u),l=B(e,n,i,c,u),h=G(t,e,r,n,u),f=G(r,n,o,i,u),v=G(o,i,a,c,u),d=G(h.x,h.y,f.x,f.y,u),p=G(f.x,f.y,v.x,v.y,u);return[[t,e,h.x,h.y,d.x,d.y,s,l],[s,l,p.x,p.y,v.x,v.y,a,c]]}function $(t,e,r,n,o,i,a,c,u){if(0===u)return function(t,e){for(var r=0,n=t.length,o=0;n>o;o++)r+=A(t[o],e[o],t[(o+1)%n],e[(o+1)%n]);return r/2}([t,r,o,a],[e,n,i,c]);var s=W(t,e,r,n,o,i,a,c,.5),l=[].concat(s[0],[u-1]),h=[].concat(s[1],[u-1]);return $.apply(void 0,l)+$.apply(void 0,h)}var H={extrema:Y,box:function(t,e,r,n,o,i,a,c){for(var u=[t,a],s=[e,c],l=Y(t,r,o,a),h=Y(e,n,i,c),f=0;l.length>f;f++)u.push(B(t,r,o,a,l[f]));for(var v=0;h.length>v;v++)s.push(B(e,n,i,c,h[v]));return I(u,s)},length:function(t,e,r,n,o,i,a,c){return $(t,e,r,n,o,i,a,c,3)},nearestPoint:function(t,e,r,n,o,i,a,c,u,s,l){return function(t,e,r,n,o,i){var a=-1,c=1/0,u=[r,n],s=20;i&&i>200&&(s=i/10);for(var l=1/s,h=l/10,f=0;s>=f;f++){var v=f*l,d=[o.apply(void 0,t.concat([v])),o.apply(void 0,e.concat([v]))],p=A(u[0],u[1],d[0],d[1]);c>p&&(a=v,c=p)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&h>=1e-4;g++){var m=a-h,w=a+h,x=[o.apply(void 0,t.concat([m])),o.apply(void 0,e.concat([m]))],b=A(u[0],u[1],x[0],x[1]);if(m>=0&&c>b)a=m,c=b;else{var E=[o.apply(void 0,t.concat([w])),o.apply(void 0,e.concat([w]))],L=A(u[0],u[1],E[0],E[1]);1>=w&&c>L?(a=w,c=L):h*=.5}}return{x:o.apply(void 0,t.concat([a])),y:o.apply(void 0,e.concat([a]))}}([t,r,o,a],[e,n,i,c],u,s,B,l)},pointDistance:function(t,e,r,n,o,i,a,c,u,s,l){var h=this.nearestPoint(t,e,r,n,o,i,a,c,u,s,l);return A(h.x,h.y,u,s)},interpolationAt:B,pointAt:function(t,e,r,n,o,i,a,c,u){return{x:B(t,r,o,a,u),y:B(e,n,i,c,u)}},divide:function(t,e,r,n,o,i,a,c,u){return W(t,e,r,n,o,i,a,c,u)},tangentAngle:function(t,e,r,n,o,i,a,c,u){var s=D(t,r,o,a,u),l=D(e,n,i,c,u);return(Math.atan2(l,s)+2*Math.PI)%(2*Math.PI)}};function U(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function V(t,e,r,n,o,i){return!(t>o||o>t+r||e>i||i>e+n)}function X(t,e,r,n,o,i,a,c){var u=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(n>u||u>o)return!1;var s={x:t+r*Math.cos(u),y:e+r*Math.sin(u)};return U(s.x,s.y,a,c)<=i/2}function z(t,e,r,n,o,i,a){var c=Math.min(t,r),u=Math.max(t,r),s=Math.min(e,n),l=Math.max(e,n),h=o/2;return!(c-h>i||i>u+h||s-h>a||a>l+h)&&F(t,e,r,n,i,a)<=o/2}function q(t,e,r,n,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(z(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,r,n))return!0}if(o){var c=t[0],u=t[i-1];if(z(c[0],c[1],u[0],u[1],e,r,n))return!0}return!1}function Q(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function Z(t,e,r){return!((r[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(r[1]-t[1])||Math.min(t[0],e[0])>r[0]||r[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>r[1]||r[1]>Math.max(t[1],e[1]))}function J(t,e,r){var n=!1,o=t.length;if(2>=o)return!1;for(var i=0;o>i;i++){var a=t[i],c=t[(i+1)%o];if(Z(a,c,[e,r]))return!0;Q(a[1]-r)>0!=Q(c[1]-r)>0&&0>Q(e-(r-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(n=!n)}return n}function K(t,e,r){for(var n=!1,o=0;t.length>o;o++){if(n=J(t[o],e,r))break}return n}function tt(t,e){var r=t.parsedStyle,n=r.fill,o=r.stroke,i=r.lineWidth,a=r.increasedLineWidthForHitTesting,c=r.clipPathTargets,u=r.r.value,s=(((null==i?void 0:i.value)||0)+((null==a?void 0:a.value)||0))/2,l=U(u,u,e.x,e.y),h=n&&!n.isNone,f=o&&!o.isNone;return h&&f||!!(null==c?void 0:c.length)?u+s>=l:h?u>=l:!!f&&(l>=u-s&&u+s>=l)}function et(t,e,r,n){return t/(r*r)+e/(n*n)}function rt(t,e){var r=e.x,n=e.y,o=t.parsedStyle,i=o.fill,a=o.stroke,c=o.lineWidth,u=o.increasedLineWidthForHitTesting,s=o.clipPathTargets,l=i&&!i.isNone,h=a&&!a.isNone,f=o.rx.value,v=o.ry.value,d=(((null==c?void 0:c.value)||0)+((null==u?void 0:u.value)||0))/2,p=(r-f)*(r-f),y=(n-v)*(n-v);return l&&h||!!(null==s?void 0:s.length)?1>=et(p,y,f+d,v+d):l?1>=et(p,y,f,v):!!h&&(et(p,y,f-d,v-d)>=1&&1>=et(p,y,f+d,v+d))}function nt(t,e){var r=t.parsedStyle,n=r.lineWidth,o=r.increasedLineWidthForHitTesting,i=r.defX,a=r.defY;return z(r.x1.value,r.y1.value,r.x2.value,r.y2.value,((null==n?void 0:n.value)||0)+((null==o?void 0:o.value)||0),e.x+(void 0===i?0:i),e.y+(void 0===a?0:a))}function ot(t,e,r){var n=t.parsedStyle,o=n.lineWidth,i=n.increasedLineWidthForHitTesting,a=n.stroke,c=n.fill,u=n.defX,s=void 0===u?0:u,l=n.defY,h=void 0===l?0:l,f=n.clipPathTargets,v=n.path,d=a&&!a.isNone,p=v.segments,y=v.polylines,g=v.polygons,m=v.totalLength,w=!!(null==f?void 0:f.length),x=!1;return c&&!c.isNone||w?x=v.hasArc?r(t,e):K(g,e.x+s,e.y+h)||K(y,e.x+s,e.y+h):((d||w)&&(x=function(t,e,r,n,o){for(var i=!1,a=0;t.length>a;a++){var c=t[a],u=c.currentPoint,s=c.params,l=c.prePoint;switch(c.command){case"L":case"Z":i=z(l[0],l[1],u[0],u[1],e,r,n);break;case"C":i=e/2>=H.pointDistance(l[0],l[1],s[1],s[2],s[3],s[4],s[5],s[6],r,n,o)}if(i)break}return i}(p,((null==o?void 0:o.value)||0)+((null==i?void 0:i.value)||0),e.x+s,e.y+h,m)),x)}function it(t,e){var r=t.parsedStyle,n=r.stroke,o=r.fill,i=r.lineWidth,a=r.increasedLineWidthForHitTesting,c=r.points,u=r.defX,s=void 0===u?0:u,l=r.defY,h=void 0===l?0:l,f=r.clipPathTargets,v=!!(null==f?void 0:f.length),d=o&&!o.isNone,p=!1;return(n&&!n.isNone||v)&&(p=q(c.points,((null==i?void 0:i.value)||0)+((null==a?void 0:a.value)||0),e.x+s,e.y+h,!0)),p||!d&&!v||(p=J(c.points,e.x+s,e.y+h)),p}function at(t,e){var r=t.parsedStyle,n=r.stroke,o=r.lineWidth,i=r.increasedLineWidthForHitTesting,a=r.defX,c=r.defY,u=r.clipPathTargets;return!((!n||n.isNone)&&!(null==u?void 0:u.length)||!o)&&q(r.points.points,((null==o?void 0:o.value)||0)+((null==i?void 0:i.value)||0),e.x+(void 0===a?0:a),e.y+(void 0===c?0:c),!1)}function ct(t,r,n){var o=t.parsedStyle,i=o.radius,a=o.fill,c=o.stroke,u=o.lineWidth,s=o.increasedLineWidthForHitTesting,l=o.width,h=o.height,f=o.clipPathTargets,v=!!(null==f?void 0:f.length),d=a&&!a.isNone,p=c&&!c.isNone,y=i&&i.some((function(t){return 0!==t.value})),g=l.unit,m=h.unit,w=0,x=0;g!==e.UnitType.kNumber&&g!==e.UnitType.kPixels||(w=l.value),m!==e.UnitType.kNumber&&m!==e.UnitType.kPixels||(x=h.value);var b=((null==u?void 0:u.value)||0)+((null==s?void 0:s.value)||0);if(y){var E=!1;return(p||v)&&(E=function(t,e,r,n,o,i,a,c){var u=o[0],s=o[1],l=o[2],h=o[3];return z(t+u,e,t+r-s,e,i,a,c)||z(t+r,e+s,t+r,e+n-l,i,a,c)||z(t+r-l,e+n,t+h,e+n,i,a,c)||z(t,e+n-h,t,e+u,i,a,c)||X(t+r-s,e+s,s,1.5*Math.PI,2*Math.PI,i,a,c)||X(t+r-l,e+n-l,l,0,.5*Math.PI,i,a,c)||X(t+h,e+n-h,h,.5*Math.PI,Math.PI,i,a,c)||X(t+u,e+u,u,Math.PI,1.5*Math.PI,i,a,c)}(0,0,w,x,i.map((function(t){return e.clamp(t.value,0,Math.min(Math.abs(w)/2,Math.abs(x)/2))})),b,r.x,r.y)),E||!d&&!v||(E=n(t,r)),E}var L=b/2;return d&&p||v?V(0-L,0-L,w+L,x+L,r.x,r.y):d?V(0,0,w,x,r.x,r.y):!!p&&function(t,e,r,n,o,i,a){var c=o/2;return V(t-c,e-c,r,o,i,a)||V(t+r-c,e-c,o,n,i,a)||V(t+c,e+n-c,r,o,i,a)||V(t-c,e+c,o,n,i,a)}(0,0,w,x,b,r.x,r.y)}var ut=e.Module((function(t){t({token:N,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?tt:t===e.Shape.ELLIPSE?rt:t===e.Shape.RECT?ct:t===e.Shape.LINE?nt:t===e.Shape.POLYLINE?at:t===e.Shape.POLYGON?it:t===e.Shape.PATH?ot:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(_)})),st=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-picker",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,P(e,r);var o=n.prototype;return o.init=function(){this.container.load(ut,!0)},o.destroy=function(){this.container.unload(ut)},n}(e.AbstractRendererPlugin),lt=Object.freeze({__proto__:null,Plugin:st});function ht(){
6
6
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
7
7
  ht=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function vt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))}}function dt(t,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dt(t,e)}var pt,yt,gt=function(){function t(){this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=void 0}var r=t.prototype;return r.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},r.getOrCreateImage=function(t){var r=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(o,i){var a;n?a=n(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){o(a)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=t,r.imageCache[t]=a)}))},r.getOrCreatePatternSync=function(t,r,n){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var i,a=t.image,c=t.repetition,u=(i=e.isString(a)?this.getImageSync(a,n):a)&&r.createPattern(i,c);return o&&u&&(this.patternCache[o]=u),u},r.getOrCreateGradient=function(t,r){var n=this.generateGradientKey(t),o=t.type,i=t.steps,a=t.width,c=t.height,u=t.cx,s=t.cy;if(this.gradientCache[n])return this.gradientCache[n];var l=null;if(o===e.GradientType.LinearGradient){var h=e.computeLinearGradient(a,c,t.angle);l=r.createLinearGradient(h.x1,h.y1,h.x2,h.y2)}else if(o===e.GradientType.RadialGradient){var f=e.computeRadialGradient(a,c,u,s),v=f.x,d=f.y;l=r.createRadialGradient(v,d,0,v,d,f.r)}return l&&(i.forEach((function(t){var e;null===(e=l)||void 0===e||e.addColorStop(t[0],t[1])})),this.gradientCache[n]=l),this.gradientCache[n]},r.generateGradientKey=function(t){return"gradient-"+t.type+"-"+(t.angle||0)+"-"+(t.cx||0)+"-"+(t.cy||0)+"-"+t.width+"-"+t.height+"-"+t.steps.map((function(t){return t.join("")})).join("-")},r.generatePatternKey=function(t){var r=t.image,n=t.repetition;if(e.isString(r))return"pattern-"+r+"-"+n},t}();x([e.inject(e.CanvasConfig),b("design:type",Object)],gt.prototype,"canvasConfig",void 0),gt=x([e.singleton()],gt);var mt=(pt=function(){function t(){this.imagePool=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var r=this,n=function(n){var o=n.target;if(o.nodeName===e.Shape.IMAGE){var i=o.attributes.img;e.isString(i)&&r.imagePool.getImageSync(i,(function(){o.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var o=n.target,i=n.newValue;o.nodeName===e.Shape.IMAGE&&"img"===n.attrName&&e.isString(i)&&r.imagePool.getOrCreateImage(i).then((function(){o.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(yt.tag,vt(ht().mark((function t(){return ht().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,o);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(yt.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))},t}(),pt.tag="LoadImage",yt=pt);x([e.inject(gt),b("design:type",gt)],mt.prototype,"imagePool",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],mt.prototype,"renderingContext",void 0),mt=yt=x([e.singleton({contrib:e.RenderingPluginContribution})],mt);var wt=e.Module((function(t){t(gt),t(mt)})),xt=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="image-loader",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,dt(e,r);var o=n.prototype;return o.init=function(){this.container.load(wt,!0)},o.destroy=function(){this.container.unload(wt)},n}(e.AbstractRendererPlugin),bt=Object.freeze({__proto__:null,get ImagePool(){return gt},Plugin:xt});function Et(){
8
8
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
9
- Et=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function Lt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Pt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Lt(i,n,o,a,c,"next",t)}function c(t){Lt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Ot(){return Ot=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ot.apply(this,arguments)}function St(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,kt(t,e)}function kt(t,e){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kt(t,e)}var Ct="undefined"!=typeof Float32Array?Float32Array:Array;function Mt(){var t=new Ct(16);return Ct!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Tt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function jt(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],c=e[4],u=e[5],s=e[6],l=e[7],h=e[8],f=e[9],v=e[10],d=e[11],p=e[12],y=e[13],g=e[14],m=e[15],w=r[0],x=r[1],b=r[2],E=r[3];return t[0]=w*n+x*c+b*h+E*p,t[1]=w*o+x*u+b*f+E*y,t[2]=w*i+x*s+b*v+E*g,t[3]=w*a+x*l+b*d+E*m,t[4]=(w=r[4])*n+(x=r[5])*c+(b=r[6])*h+(E=r[7])*p,t[5]=w*o+x*u+b*f+E*y,t[6]=w*i+x*s+b*v+E*g,t[7]=w*a+x*l+b*d+E*m,t[8]=(w=r[8])*n+(x=r[9])*c+(b=r[10])*h+(E=r[11])*p,t[9]=w*o+x*u+b*f+E*y,t[10]=w*i+x*s+b*v+E*g,t[11]=w*a+x*l+b*d+E*m,t[12]=(w=r[12])*n+(x=r[13])*c+(b=r[14])*h+(E=r[15])*p,t[13]=w*o+x*u+b*f+E*y,t[14]=w*i+x*s+b*v+E*g,t[15]=w*a+x*l+b*d+E*m,t}function Nt(t,e,r){var n,o,i,a,c,u,s,l,h,f,v,d,p=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*p+e[4]*y+e[8]*g+e[12],t[13]=e[1]*p+e[5]*y+e[9]*g+e[13],t[14]=e[2]*p+e[6]*y+e[10]*g+e[14],t[15]=e[3]*p+e[7]*y+e[11]*g+e[15]):(o=e[1],i=e[2],a=e[3],c=e[4],u=e[5],s=e[6],l=e[7],h=e[8],f=e[9],v=e[10],d=e[11],t[0]=n=e[0],t[1]=o,t[2]=i,t[3]=a,t[4]=c,t[5]=u,t[6]=s,t[7]=l,t[8]=h,t[9]=f,t[10]=v,t[11]=d,t[12]=n*p+c*y+h*g+e[12],t[13]=o*p+u*y+f*g+e[13],t[14]=i*p+s*y+v*g+e[14],t[15]=a*p+l*y+d*g+e[15]),t}function _t(){var t=new Ct(3);return Ct!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function At(t,e,r){var n=new Ct(3);return n[0]=t,n[1]=e,n[2]=r,n}function Rt(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});!function(){var t=_t()}();var It=e.Syringe.defineToken("StyleRendererFactory"),Gt=e.Syringe.defineToken("CircleRenderer",{multiple:!1}),Ft=e.Syringe.defineToken("EllipseRenderer",{multiple:!1}),Bt=e.Syringe.defineToken("RectRenderer",{multiple:!1}),Dt=e.Syringe.defineToken("LineRenderer",{multiple:!1}),Yt=e.Syringe.defineToken("PolylineRenderer",{multiple:!1}),Wt=e.Syringe.defineToken("PolygonRenderer",{multiple:!1}),$t=e.Syringe.defineToken("PathRenderer",{multiple:!1}),Ht=e.Syringe.defineToken("TextRenderer",{multiple:!1}),Ut=e.Syringe.defineToken("ImageRenderer",{multiple:!1}),Vt=function(){function t(){this.imagePool=void 0}return t.prototype.render=function(t,r){var n,o=r.img,i=r.width.value,a=r.height.value;if(e.isString(o)?n=this.imagePool.getImageSync(o):(i||(i=o.width),a||(a=o.height),n=o),n)try{t.drawImage(n,0,0,i,a)}catch(t){}},t}();x([e.inject(gt),b("design:type",gt)],Vt.prototype,"imagePool",void 0),Vt=x([e.singleton({token:Ut})],Vt);var Xt=function(){function t(){}var r=t.prototype;return r.render=function(t,r,n){var o=r.lineWidth,i=r.textAlign,a=r.textBaseline,c=r.lineJoin,u=r.miterLimit,s=r.letterSpacing,l=r.stroke,h=r.fill,f=r.fillOpacity,v=r.strokeOpacity,d=r.opacity,p=r.metrics,y=r.dx,g=r.dy,m=p.lines,w=p.height,x=p.lineHeight,b=p.lineMetrics;t.font=p.font,t.lineWidth=o.value,t.textAlign=i.value,t.textBaseline=a.value,t.lineJoin=c.value,e.isNil(u)||(t.miterLimit=u.value);var E=0;"middle"===a.value?E=-w/2-x/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?E=-w:"top"!==a.value&&"hanging"!==a.value||(E=-x);var L=0;y&&y.unit===e.UnitType.kPixels&&(L+=y.value),g&&g.unit===e.UnitType.kPixels&&(E+=g.value);for(var P=0;m.length>P;P++){var O=o.value/2+L;E+=x,!e.isNil(l)&&!l.isNone&&o&&o.value&&this.drawLetterSpacing(t,m[P],b[P],i.value,O,E,s.value,f.value,v.value,d.value,!0),e.isNil(h)||this.drawLetterSpacing(t,m[P],b[P],i.value,O,E,s.value,f.value,v.value,d.value)}},r.drawLetterSpacing=function(t,e,r,n,o,i,a,c,u,s,l){if(void 0===l&&(l=!1),0!==a){var h=t.textAlign;t.textAlign="left";var f=o;"center"===n?f=o-r.width/2:"right"!==n&&"end"!==n||(f=o-r.width);for(var v=Array.from(e),d=t.measureText(e).width,p=0,y=0;v.length>y;++y){var g=v[y];l?this.strokeText(t,g,f,i,u):this.fillText(t,g,f,i,c,s),f+=d-(p=t.measureText(e.substring(y+1)).width)+a,d=p}t.textAlign=h}else l?this.strokeText(t,e,o,i,u):this.fillText(t,e,o,i,c,s)},r.fillText=function(t,r,n,o,i,a){var c,u=!e.isNil(i)&&1!==i;u&&(c=t.globalAlpha,t.globalAlpha=i*a),t.fillText(r,n,o),u&&(t.globalAlpha=c)},r.strokeText=function(t,r,n,o,i){var a,c=!e.isNil(i)&&1!==i;c&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(r,n,o),c&&(t.globalAlpha=a)},t}();Xt=x([e.singleton({token:Ht})],Xt);var zt=function(){function t(){this.imagePool=void 0}var r=t.prototype;return r.render=function(t,r,n,o){var i=r.fill,a=r.opacity,c=r.fillOpacity,u=r.stroke,s=r.strokeOpacity,l=r.lineWidth,h=r.lineCap,f=r.lineJoin,v=r.shadowType,d=r.shadowColor,p=r.shadowBlur,y=r.filter,g=r.miterLimit,m=!e.isNil(i)&&!i.isNone,w=!e.isNil(u)&&!u.isNone&&l&&l.value>0,x=0===i.alpha,b=!e.isNil(y),E=!e.isNil(d)&&(null==p?void 0:p.value)>0,L=n.nodeName,P="inner"===(null==v?void 0:v.value),O=w&&E&&(L===e.Shape.PATH||L===e.Shape.LINE||L===e.Shape.POLYLINE||x||P);m&&(t.globalAlpha=a.value*c.value,O||this.setShadowAndFilter(n,t,E),this.fill(t,n,i,o),O||this.clearShadowAndFilter(t,b,E)),w&&(t.globalAlpha=a.value*s.value,t.lineWidth=l.value,e.isNil(g)||(t.miterLimit=g.value),e.isNil(h)||(t.lineCap=h.value),e.isNil(f)||(t.lineJoin=f.value),O&&(P&&(t.globalCompositeOperation="source-atop"),this.setShadowAndFilter(n,t,!0),P&&(this.stroke(t,n,u,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,b,!0))),this.stroke(t,n,u,o))},r.clearShadowAndFilter=function(t,r,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),r){var o=t.filter;!e.isNil(o)&&o.indexOf("drop-shadow")>-1&&(t.filter=o.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},r.setShadowAndFilter=function(t,r,n){var o=t.parsedStyle,i=o.shadowColor,a=o.shadowBlur,c=o.shadowOffsetX,u=o.shadowOffsetY;e.isNil(o.filter)||(r.filter=t.style.filter),n&&(r.shadowColor=i.toString(),r.shadowBlur=a&&a.value||0,r.shadowOffsetX=c&&c.value||0,r.shadowOffsetY=u&&u.value||0)},r.fill=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.fillStyle=i.getColor(e,r,t),t.fill()})):(e.isPattern(n)&&(t.fillStyle=this.getPattern(n,r,t,o)),t.fill())},r.stroke=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.strokeStyle=i.getColor(e,r,t),t.stroke()})):(e.isPattern(n)&&(t.strokeStyle=this.getPattern(n,r,t,o)),t.stroke())},r.getPattern=function(t,e,r,n){return this.imagePool.getOrCreatePatternSync(t,r,(function(){e.renderable.dirty=!0,n.dirtify()}))},r.getColor=function(t,r,n){var o;if(t.type===e.GradientType.LinearGradient||t.type===e.GradientType.RadialGradient){var i=r.getGeometryBounds();o=this.imagePool.getOrCreateGradient(Ot({type:t.type},t.value,{width:i&&2*i.halfExtents[0]||1,height:i&&2*i.halfExtents[1]||1}),n)}return o},t}();x([e.inject(gt),b("design:type",gt)],zt.prototype,"imagePool",void 0);var qt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(zt=x([e.singleton()],zt));qt=x([e.singleton({token:Bt})],qt);var Qt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(zt);Qt=x([e.singleton({token:Gt})],Qt);var Zt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(zt);Zt=x([e.singleton({token:Ft})],Zt);var Jt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(zt);Jt=x([e.singleton({token:Dt})],Jt);var Kt=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(zt);Kt=x([e.singleton({token:Yt})],Kt);var te=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(zt);te=x([e.singleton({token:Wt})],te);var ee=function(t){function e(){return t.apply(this,arguments)||this}return St(e,t),e}(zt);ee=x([e.singleton({token:$t})],ee);var re,ne,oe=e.Syringe.defineToken("CanvasRendererPluginOptions"),ie=(re=function(){function t(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.styleRendererFactory=void 0,this.styleRendererFactoryCache={},this.displayObjectPool=void 0,this.canvasRendererPluginOptions=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Mt(),this.dprMatrix=Mt(),this.tmpMat4=Mt(),this.tmpVec3=_t()}var r=t.prototype;return r.apply=function(t){var r=this,n=this.renderingContext.root.ownerDocument.defaultView,o=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},i=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};t.hooks.init.tapPromise(ne.tag,Pt(Et().mark((function t(){var n,a,c,u,s;return Et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.CULLED,i),n=r.contextService.getDPR(),c=(a=r.canvasConfig).width,u=a.height,s=r.contextService.getContext(),r.clearRect(s,0,0,c*n,u*n),l=r.dprMatrix,h=At(n,n,1),l[0]=h[0],l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=h[1],l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=h[2],l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1;case 7:case"end":return t.stop()}var l,h}),t)})))),t.hooks.destroy.tap(ne.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,i)})),t.hooks.beginFrame.tap(ne.tag,(function(){var e=r.contextService.getContext(),n=r.contextService.getDPR(),o=r.canvasConfig,i=o.width,a=o.height,c=r.canvasRendererPluginOptions,u=c.dirtyObjectNumThreshold,s=c.dirtyObjectRatioThreshold,l=t.getStats(),h=l.rendered,f=h/l.total;r.clearFullScreen=t.disableDirtyRectangleRendering()||h>u&&f>s,e&&(e.resetTransform(),r.clearFullScreen&&r.clearRect(e,0,0,i*n,a*n))}));var a=function e(n){n.isVisible()&&!n.isCulled()&&(r.renderDisplayObject(n,t),r.saveDirtyAABB(n)),n.sortable.sorted&&n.sortable.sorted.length&&n.sortable.sorted.forEach((function(t){e(t)}))};t.hooks.endFrame.tap(ne.tag,(function(){var o=r.contextService.getContext();if(jt(r.vpMatrix,r.dprMatrix,r.camera.getOrthoMatrix()),r.clearFullScreen)a(r.renderingContext.root);else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(r.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,o=t.maxX,i=t.maxY,a=new e.AABB;return a.setMinMax(At(r,n,0),At(o,i,0)),a}))));if(r.removedRBushNodeAABBs=[],e.AABB.isEmpty(i))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(i),u=c.x,s=c.y,l=c.width,h=c.height,f=Rt(r.tmpVec3,At(u,s,0),r.vpMatrix),v=Rt(_t(),At(u+l,s+h,0),r.vpMatrix),d=Math.floor(f[0]),p=Math.floor(f[1]),y=Math.ceil(v[0]-f[0]),g=Math.ceil(v[1]-f[1]);o.save(),r.clearRect(o,d,p,y,g),o.beginPath(),o.rect(d,p,y,g),o.clip(),o.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),r.canvasConfig.renderer.getConfig().enableDirtyRectangleRenderingDebug&&n.dispatchEvent(new e.CustomEvent(e.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:c})),r.searchDirtyObjects(i).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t)})),o.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){o.restore()})),r.restoreStack=[]})),t.hooks.render.tap(ne.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},r.clearRect=function(t,e,r,n,o){t.clearRect(e,r,n,o);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(e,r,n,o))},r.renderDisplayObject=function(t,r){var n=this.contextService.getContext(),o=t.nodeName,i=this.restoreStack[this.restoreStack.length-1];!i||t.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINS||(n.restore(),this.restoreStack.pop()),void 0===this.styleRendererFactoryCache[o]&&(this.styleRendererFactoryCache[o]=this.styleRendererFactory(o));var a=this.styleRendererFactoryCache[o];void 0===this.pathGeneratorFactoryCache[o]&&(this.pathGeneratorFactoryCache[o]=this.pathGeneratorFactory(o));var c=this.pathGeneratorFactoryCache[o],u=t.parsedStyle.clipPath;if(u){this.applyWorldTransform(n,u,t.getWorldTransform()),void 0===this.pathGeneratorFactoryCache[u.nodeName]&&(this.pathGeneratorFactoryCache[u.nodeName]=this.pathGeneratorFactory(u.nodeName));var s=this.pathGeneratorFactoryCache[u.nodeName];s&&(n.save(),this.restoreStack.push(t),n.beginPath(),s(n,u.parsedStyle),n.closePath(),n.clip())}a&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),c&&(n.beginPath(),c(n,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&n.closePath()),a&&(a.render(n,t.parsedStyle,t,r),n.restore()),t.renderable.dirty=!1},r.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),o=Math.floor(e[1]);return{x:n,y:o,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-o}},r.mergeDirtyAABBs=function(t){var r=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();r.add(e);var n=t.renderable.dirtyRenderBounds;n&&r.add(n)})),r},r.searchDirtyObjects=function(t){var e=this,r=t.getMin(),n=r[0],o=r[1],i=t.getMax();return this.rBush.search({minX:n,minY:o,maxX:i[0],maxY:i[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},r.saveDirtyAABB=function(t){var r=t.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new e.AABB);var n=t.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},r.applyAttributesToContext=function(t,r){var n=r.parsedStyle,o=n.stroke,i=n.fill,a=n.opacity,c=n.lineDash,u=n.lineDashOffset;c&&Array.isArray(c)&&t.setLineDash(c.map((function(t){return t.value}))),e.isNil(u)||(t.lineDashOffset=u.value),e.isNil(a)||(t.globalAlpha*=a.value),e.isNil(o)||Array.isArray(o)||o.isNone||(t.strokeStyle=r.attributes.stroke),e.isNil(i)||Array.isArray(i)||i.isNone||(t.fillStyle=r.attributes.fill)},r.applyWorldTransform=function(t,e,r){var n=0,o=0,i=(e.parsedStyle||{}).anchor,a=i&&i[0].value||0,c=i&&i[1].value||0;if(0!==a||0!==c){var u=e.getGeometryBounds();n=-a*(u&&2*u.halfExtents[0]||0),o=-c*(u&&2*u.halfExtents[1]||0)}r?(Tt(this.tmpMat4,e.getLocalTransform()),this.tmpVec3[0]=n,this.tmpVec3[1]=o,this.tmpVec3[2]=0,Nt(this.tmpMat4,this.tmpMat4,this.tmpVec3),jt(this.tmpMat4,r,this.tmpMat4),jt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(Tt(this.tmpMat4,e.getWorldTransform()),this.tmpVec3[0]=n,this.tmpVec3[1]=o,this.tmpVec3[2]=0,Nt(this.tmpMat4,this.tmpMat4,this.tmpVec3),jt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},r.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return n.forEach((function(e){t.add(e)})),t},t}(),re.tag="CanvasRenderer",ne=re);x([e.inject(e.CanvasConfig),b("design:type",Object)],ie.prototype,"canvasConfig",void 0),x([e.inject(e.DefaultCamera),b("design:type",e.Camera)],ie.prototype,"camera",void 0),x([e.inject(e.ContextService),b("design:type",Object)],ie.prototype,"contextService",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],ie.prototype,"renderingContext",void 0),x([e.inject(u),b("design:type",Function)],ie.prototype,"pathGeneratorFactory",void 0),x([e.inject(It),b("design:type",Function)],ie.prototype,"styleRendererFactory",void 0),x([e.inject(e.DisplayObjectPool),b("design:type",e.DisplayObjectPool)],ie.prototype,"displayObjectPool",void 0),x([e.inject(oe),b("design:type",Object)],ie.prototype,"canvasRendererPluginOptions",void 0),x([e.inject(e.RBushRoot),b("design:type",e.RBush)],ie.prototype,"rBush",void 0),ie=ne=x([e.singleton({contrib:e.RenderingPluginContribution})],ie);var ae,ce,ue=e.Module((function(t){var r;t(Qt),t(Zt),t(qt),t(Vt),t(Xt),t(Jt),t(Kt),t(te),t(ee);var n=((r={})[e.Shape.CIRCLE]=Gt,r[e.Shape.ELLIPSE]=Ft,r[e.Shape.RECT]=Bt,r[e.Shape.IMAGE]=Ut,r[e.Shape.TEXT]=Ht,r[e.Shape.LINE]=Dt,r[e.Shape.POLYLINE]=Yt,r[e.Shape.POLYGON]=Wt,r[e.Shape.PATH]=$t,r);t({token:It,useFactory:function(t){return function(e){var r=n[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),t(ie)})),se=function(t){function e(e){var r;return void 0===e&&(e={}),(r=t.call(this)||this).options=void 0,r.name="canvas-renderer",r.options=e,r}St(e,t);var r=e.prototype;return r.init=function(){this.container.register(oe,{useValue:Ot({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options)}),this.container.load(ue,!0)},r.destroy=function(){this.container.unload(ue),this.container.remove(oe)},e}(e.AbstractRendererPlugin),le=Object.freeze({__proto__:null,get CircleRenderer(){return Qt},CircleRendererContribution:Gt,get EllipseRenderer(){return Zt},EllipseRendererContribution:Ft,get ImageRenderer(){return Vt},ImageRendererContribution:Ut,get LineRenderer(){return Jt},LineRendererContribution:Dt,get PathRenderer(){return ee},PathRendererContribution:$t,Plugin:se,get PolygonRenderer(){return te},PolygonRendererContribution:Wt,get PolylineRenderer(){return Kt},PolylineRendererContribution:Yt,get RectRenderer(){return qt},RectRendererContribution:Bt,StyleRendererFactory:It,get TextRenderer(){return Xt},TextRendererContribution:Ht});function he(){
9
+ Et=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function Lt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Pt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Lt(i,n,o,a,c,"next",t)}function c(t){Lt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Ot(){return Ot=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ot.apply(this,arguments)}function kt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,St(t,e)}function St(t,e){return St=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},St(t,e)}var Ct="undefined"!=typeof Float32Array?Float32Array:Array;function Mt(){var t=new Ct(16);return Ct!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Tt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function jt(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],c=e[4],u=e[5],s=e[6],l=e[7],h=e[8],f=e[9],v=e[10],d=e[11],p=e[12],y=e[13],g=e[14],m=e[15],w=r[0],x=r[1],b=r[2],E=r[3];return t[0]=w*n+x*c+b*h+E*p,t[1]=w*o+x*u+b*f+E*y,t[2]=w*i+x*s+b*v+E*g,t[3]=w*a+x*l+b*d+E*m,t[4]=(w=r[4])*n+(x=r[5])*c+(b=r[6])*h+(E=r[7])*p,t[5]=w*o+x*u+b*f+E*y,t[6]=w*i+x*s+b*v+E*g,t[7]=w*a+x*l+b*d+E*m,t[8]=(w=r[8])*n+(x=r[9])*c+(b=r[10])*h+(E=r[11])*p,t[9]=w*o+x*u+b*f+E*y,t[10]=w*i+x*s+b*v+E*g,t[11]=w*a+x*l+b*d+E*m,t[12]=(w=r[12])*n+(x=r[13])*c+(b=r[14])*h+(E=r[15])*p,t[13]=w*o+x*u+b*f+E*y,t[14]=w*i+x*s+b*v+E*g,t[15]=w*a+x*l+b*d+E*m,t}function Nt(t,e,r){var n,o,i,a,c,u,s,l,h,f,v,d,p=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*p+e[4]*y+e[8]*g+e[12],t[13]=e[1]*p+e[5]*y+e[9]*g+e[13],t[14]=e[2]*p+e[6]*y+e[10]*g+e[14],t[15]=e[3]*p+e[7]*y+e[11]*g+e[15]):(o=e[1],i=e[2],a=e[3],c=e[4],u=e[5],s=e[6],l=e[7],h=e[8],f=e[9],v=e[10],d=e[11],t[0]=n=e[0],t[1]=o,t[2]=i,t[3]=a,t[4]=c,t[5]=u,t[6]=s,t[7]=l,t[8]=h,t[9]=f,t[10]=v,t[11]=d,t[12]=n*p+c*y+h*g+e[12],t[13]=o*p+u*y+f*g+e[13],t[14]=i*p+s*y+v*g+e[14],t[15]=a*p+l*y+d*g+e[15]),t}function _t(){var t=new Ct(3);return Ct!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function At(t,e,r){var n=new Ct(3);return n[0]=t,n[1]=e,n[2]=r,n}function Rt(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});!function(){var t=_t()}();var It=e.Syringe.defineToken("StyleRendererFactory"),Gt=e.Syringe.defineToken("CircleRenderer",{multiple:!1}),Ft=e.Syringe.defineToken("EllipseRenderer",{multiple:!1}),Bt=e.Syringe.defineToken("RectRenderer",{multiple:!1}),Dt=e.Syringe.defineToken("LineRenderer",{multiple:!1}),Yt=e.Syringe.defineToken("PolylineRenderer",{multiple:!1}),Wt=e.Syringe.defineToken("PolygonRenderer",{multiple:!1}),$t=e.Syringe.defineToken("PathRenderer",{multiple:!1}),Ht=e.Syringe.defineToken("TextRenderer",{multiple:!1}),Ut=e.Syringe.defineToken("ImageRenderer",{multiple:!1}),Vt=function(){function t(){this.imagePool=void 0}var r=t.prototype;return r.render=function(t,r,n,o){var i=r.fill,a=r.opacity,c=r.fillOpacity,u=r.stroke,s=r.strokeOpacity,l=r.lineWidth,h=r.lineCap,f=r.lineJoin,v=r.shadowType,d=r.shadowColor,p=r.shadowBlur,y=r.filter,g=r.miterLimit,m=!e.isNil(i)&&!i.isNone,w=!e.isNil(u)&&!u.isNone&&l&&l.value>0,x=0===i.alpha,b=!e.isNil(y),E=!e.isNil(d)&&(null==p?void 0:p.value)>0,L=n.nodeName,P="inner"===(null==v?void 0:v.value),O=w&&E&&(L===e.Shape.PATH||L===e.Shape.LINE||L===e.Shape.POLYLINE||x||P);m&&(t.globalAlpha=a.value*c.value,O||Xt(n,t,E),this.fill(t,n,i,o),O||this.clearShadowAndFilter(t,b,E)),w&&(t.globalAlpha=a.value*s.value,t.lineWidth=l.value,e.isNil(g)||(t.miterLimit=g.value),e.isNil(h)||(t.lineCap=h.value),e.isNil(f)||(t.lineJoin=f.value),O&&(P&&(t.globalCompositeOperation="source-atop"),Xt(n,t,!0),P&&(this.stroke(t,n,u,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,b,!0))),this.stroke(t,n,u,o))},r.clearShadowAndFilter=function(t,r,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),r){var o=t.filter;!e.isNil(o)&&o.indexOf("drop-shadow")>-1&&(t.filter=o.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},r.fill=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.fillStyle=i.getColor(e,r,t),t.fill()})):(e.isPattern(n)&&(t.fillStyle=this.getPattern(n,r,t,o)),t.fill())},r.stroke=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.strokeStyle=i.getColor(e,r,t),t.stroke()})):(e.isPattern(n)&&(t.strokeStyle=this.getPattern(n,r,t,o)),t.stroke())},r.getPattern=function(t,e,r,n){return this.imagePool.getOrCreatePatternSync(t,r,(function(){e.renderable.dirty=!0,n.dirtify()}))},r.getColor=function(t,r,n){var o;if(t.type===e.GradientType.LinearGradient||t.type===e.GradientType.RadialGradient){var i=r.getGeometryBounds();o=this.imagePool.getOrCreateGradient(Ot({type:t.type},t.value,{width:i&&2*i.halfExtents[0]||1,height:i&&2*i.halfExtents[1]||1}),n)}return o},t}();function Xt(t,r,n){var o=t.parsedStyle,i=o.shadowColor,a=o.shadowBlur,c=o.shadowOffsetX,u=o.shadowOffsetY;e.isNil(o.filter)||(r.filter=t.style.filter),n&&(r.shadowColor=i.toString(),r.shadowBlur=a&&a.value||0,r.shadowOffsetX=c&&c.value||0,r.shadowOffsetY=u&&u.value||0)}x([e.inject(gt),b("design:type",gt)],Vt.prototype,"imagePool",void 0),Vt=x([e.singleton()],Vt);var zt=function(){function t(){this.imagePool=void 0}return t.prototype.render=function(t,r,n){var o,i=r.img,a=r.shadowColor,c=r.shadowBlur,u=r.width.value,s=r.height.value;if(e.isString(i)?o=this.imagePool.getImageSync(i):(u||(u=i.width),s||(s=i.height),o=i),o){Xt(n,t,!e.isNil(a)&&(null==c?void 0:c.value)>0);try{t.drawImage(o,0,0,u,s)}catch(t){}}},t}();x([e.inject(gt),b("design:type",gt)],zt.prototype,"imagePool",void 0),zt=x([e.singleton({token:Ut})],zt);var qt=function(){function t(){}var r=t.prototype;return r.render=function(t,r,n){var o=r.lineWidth,i=r.textAlign,a=r.textBaseline,c=r.lineJoin,u=r.miterLimit,s=r.letterSpacing,l=r.stroke,h=r.fill,f=r.fillOpacity,v=r.strokeOpacity,d=r.opacity,p=r.metrics,y=r.dx,g=r.dy,m=r.shadowColor,w=r.shadowBlur,x=p.lines,b=p.height,E=p.lineHeight,L=p.lineMetrics;t.font=p.font,t.lineWidth=o.value,t.textAlign=i.value,t.textBaseline=a.value,t.lineJoin=c.value,e.isNil(u)||(t.miterLimit=u.value);var P=0;"middle"===a.value?P=-b/2-E/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?P=-b:"top"!==a.value&&"hanging"!==a.value||(P=-E);var O=0;y&&y.unit===e.UnitType.kPixels&&(O+=y.value),g&&g.unit===e.UnitType.kPixels&&(P+=g.value),Xt(n,t,!e.isNil(m)&&(null==w?void 0:w.value)>0);for(var k=0;x.length>k;k++){var S=o.value/2+O;P+=E,!e.isNil(l)&&!l.isNone&&o&&o.value&&this.drawLetterSpacing(t,x[k],L[k],i.value,S,P,s.value,f.value,v.value,d.value,!0),e.isNil(h)||this.drawLetterSpacing(t,x[k],L[k],i.value,S,P,s.value,f.value,v.value,d.value)}},r.drawLetterSpacing=function(t,e,r,n,o,i,a,c,u,s,l){if(void 0===l&&(l=!1),0!==a){var h=t.textAlign;t.textAlign="left";var f=o;"center"===n?f=o-r.width/2:"right"!==n&&"end"!==n||(f=o-r.width);for(var v=Array.from(e),d=t.measureText(e).width,p=0,y=0;v.length>y;++y){var g=v[y];l?this.strokeText(t,g,f,i,u):this.fillText(t,g,f,i,c,s),f+=d-(p=t.measureText(e.substring(y+1)).width)+a,d=p}t.textAlign=h}else l?this.strokeText(t,e,o,i,u):this.fillText(t,e,o,i,c,s)},r.fillText=function(t,r,n,o,i,a){var c,u=!e.isNil(i)&&1!==i;u&&(c=t.globalAlpha,t.globalAlpha=i*a),t.fillText(r,n,o),u&&(t.globalAlpha=c)},r.strokeText=function(t,r,n,o,i){var a,c=!e.isNil(i)&&1!==i;c&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(r,n,o),c&&(t.globalAlpha=a)},t}();qt=x([e.singleton({token:Ht})],qt);var Qt=function(t){function e(){return t.apply(this,arguments)||this}return kt(e,t),e}(Vt);Qt=x([e.singleton({token:Bt})],Qt);var Zt=function(t){function e(){return t.apply(this,arguments)||this}return kt(e,t),e}(Vt);Zt=x([e.singleton({token:Gt})],Zt);var Jt=function(t){function e(){return t.apply(this,arguments)||this}return kt(e,t),e}(Vt);Jt=x([e.singleton({token:Ft})],Jt);var Kt=function(t){function e(){return t.apply(this,arguments)||this}return kt(e,t),e}(Vt);Kt=x([e.singleton({token:Dt})],Kt);var te=function(t){function e(){return t.apply(this,arguments)||this}return kt(e,t),e}(Vt);te=x([e.singleton({token:Yt})],te);var ee=function(t){function e(){return t.apply(this,arguments)||this}return kt(e,t),e}(Vt);ee=x([e.singleton({token:Wt})],ee);var re=function(t){function e(){return t.apply(this,arguments)||this}return kt(e,t),e}(Vt);re=x([e.singleton({token:$t})],re);var ne,oe,ie=e.Syringe.defineToken("CanvasRendererPluginOptions"),ae=(ne=function(){function t(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.styleRendererFactory=void 0,this.styleRendererFactoryCache={},this.displayObjectPool=void 0,this.canvasRendererPluginOptions=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Mt(),this.dprMatrix=Mt(),this.tmpMat4=Mt(),this.tmpVec3=_t()}var r=t.prototype;return r.apply=function(t){var r=this,n=this.renderingContext.root.ownerDocument.defaultView,o=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},i=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};t.hooks.init.tapPromise(oe.tag,Pt(Et().mark((function t(){var n,a,c,u,s;return Et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.CULLED,i),n=r.contextService.getDPR(),c=(a=r.canvasConfig).width,u=a.height,s=r.contextService.getContext(),r.clearRect(s,0,0,c*n,u*n),l=r.dprMatrix,h=At(n,n,1),l[0]=h[0],l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=h[1],l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=h[2],l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1;case 7:case"end":return t.stop()}var l,h}),t)})))),t.hooks.destroy.tap(oe.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,i)})),t.hooks.beginFrame.tap(oe.tag,(function(){var e=r.contextService.getContext(),n=r.contextService.getDPR(),o=r.canvasConfig,i=o.width,a=o.height,c=r.canvasRendererPluginOptions,u=c.dirtyObjectNumThreshold,s=c.dirtyObjectRatioThreshold,l=t.getStats(),h=l.rendered,f=h/l.total;r.clearFullScreen=t.disableDirtyRectangleRendering()||h>u&&f>s,e&&(e.resetTransform(),r.clearFullScreen&&r.clearRect(e,0,0,i*n,a*n))}));var a=function e(n){n.isVisible()&&!n.isCulled()&&(r.renderDisplayObject(n,t),r.saveDirtyAABB(n)),n.sortable.sorted&&n.sortable.sorted.length&&n.sortable.sorted.forEach((function(t){e(t)}))};t.hooks.endFrame.tap(oe.tag,(function(){var o=r.contextService.getContext();if(jt(r.vpMatrix,r.dprMatrix,r.camera.getOrthoMatrix()),r.clearFullScreen)a(r.renderingContext.root);else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(r.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,o=t.maxX,i=t.maxY,a=new e.AABB;return a.setMinMax(At(r,n,0),At(o,i,0)),a}))));if(r.removedRBushNodeAABBs=[],e.AABB.isEmpty(i))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(i),u=c.x,s=c.y,l=c.width,h=c.height,f=Rt(r.tmpVec3,At(u,s,0),r.vpMatrix),v=Rt(_t(),At(u+l,s+h,0),r.vpMatrix),d=Math.floor(f[0]),p=Math.floor(f[1]),y=Math.ceil(v[0]-f[0]),g=Math.ceil(v[1]-f[1]);o.save(),r.clearRect(o,d,p,y,g),o.beginPath(),o.rect(d,p,y,g),o.clip(),o.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),r.canvasConfig.renderer.getConfig().enableDirtyRectangleRenderingDebug&&n.dispatchEvent(new e.CustomEvent(e.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:c})),r.searchDirtyObjects(i).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t)})),o.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){o.restore()})),r.restoreStack=[]})),t.hooks.render.tap(oe.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},r.clearRect=function(t,e,r,n,o){t.clearRect(e,r,n,o);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(e,r,n,o))},r.renderDisplayObject=function(t,r){var n=this.contextService.getContext(),o=t.nodeName,i=this.restoreStack[this.restoreStack.length-1];!i||t.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINS||(n.restore(),this.restoreStack.pop()),void 0===this.styleRendererFactoryCache[o]&&(this.styleRendererFactoryCache[o]=this.styleRendererFactory(o));var a=this.styleRendererFactoryCache[o];void 0===this.pathGeneratorFactoryCache[o]&&(this.pathGeneratorFactoryCache[o]=this.pathGeneratorFactory(o));var c=this.pathGeneratorFactoryCache[o],u=t.parsedStyle.clipPath;if(u){this.applyWorldTransform(n,u,t.getWorldTransform()),void 0===this.pathGeneratorFactoryCache[u.nodeName]&&(this.pathGeneratorFactoryCache[u.nodeName]=this.pathGeneratorFactory(u.nodeName));var s=this.pathGeneratorFactoryCache[u.nodeName];s&&(n.save(),this.restoreStack.push(t),n.beginPath(),s(n,u.parsedStyle),n.closePath(),n.clip())}a&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),c&&(n.beginPath(),c(n,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&n.closePath()),a&&(a.render(n,t.parsedStyle,t,r),n.restore()),t.renderable.dirty=!1},r.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),o=Math.floor(e[1]);return{x:n,y:o,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-o}},r.mergeDirtyAABBs=function(t){var r=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();r.add(e);var n=t.renderable.dirtyRenderBounds;n&&r.add(n)})),r},r.searchDirtyObjects=function(t){var e=this,r=t.getMin(),n=r[0],o=r[1],i=t.getMax();return this.rBush.search({minX:n,minY:o,maxX:i[0],maxY:i[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},r.saveDirtyAABB=function(t){var r=t.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new e.AABB);var n=t.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},r.applyAttributesToContext=function(t,r){var n=r.parsedStyle,o=n.stroke,i=n.fill,a=n.opacity,c=n.lineDash,u=n.lineDashOffset;c&&Array.isArray(c)&&t.setLineDash(c.map((function(t){return t.value}))),e.isNil(u)||(t.lineDashOffset=u.value),e.isNil(a)||(t.globalAlpha*=a.value),e.isNil(o)||Array.isArray(o)||o.isNone||(t.strokeStyle=r.attributes.stroke),e.isNil(i)||Array.isArray(i)||i.isNone||(t.fillStyle=r.attributes.fill)},r.applyWorldTransform=function(t,e,r){var n=0,o=0,i=(e.parsedStyle||{}).anchor,a=i&&i[0].value||0,c=i&&i[1].value||0;if(0!==a||0!==c){var u=e.getGeometryBounds();n=-a*(u&&2*u.halfExtents[0]||0),o=-c*(u&&2*u.halfExtents[1]||0)}r?(Tt(this.tmpMat4,e.getLocalTransform()),this.tmpVec3[0]=n,this.tmpVec3[1]=o,this.tmpVec3[2]=0,Nt(this.tmpMat4,this.tmpMat4,this.tmpVec3),jt(this.tmpMat4,r,this.tmpMat4),jt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(Tt(this.tmpMat4,e.getWorldTransform()),this.tmpVec3[0]=n,this.tmpVec3[1]=o,this.tmpVec3[2]=0,Nt(this.tmpMat4,this.tmpMat4,this.tmpVec3),jt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},r.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return n.forEach((function(e){t.add(e)})),t},t}(),ne.tag="CanvasRenderer",oe=ne);x([e.inject(e.CanvasConfig),b("design:type",Object)],ae.prototype,"canvasConfig",void 0),x([e.inject(e.DefaultCamera),b("design:type",e.Camera)],ae.prototype,"camera",void 0),x([e.inject(e.ContextService),b("design:type",Object)],ae.prototype,"contextService",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],ae.prototype,"renderingContext",void 0),x([e.inject(u),b("design:type",Function)],ae.prototype,"pathGeneratorFactory",void 0),x([e.inject(It),b("design:type",Function)],ae.prototype,"styleRendererFactory",void 0),x([e.inject(e.DisplayObjectPool),b("design:type",e.DisplayObjectPool)],ae.prototype,"displayObjectPool",void 0),x([e.inject(ie),b("design:type",Object)],ae.prototype,"canvasRendererPluginOptions",void 0),x([e.inject(e.RBushRoot),b("design:type",e.RBush)],ae.prototype,"rBush",void 0),ae=oe=x([e.singleton({contrib:e.RenderingPluginContribution})],ae);var ce,ue,se=e.Module((function(t){var r;t(Zt),t(Jt),t(Qt),t(zt),t(qt),t(Kt),t(te),t(ee),t(re);var n=((r={})[e.Shape.CIRCLE]=Gt,r[e.Shape.ELLIPSE]=Ft,r[e.Shape.RECT]=Bt,r[e.Shape.IMAGE]=Ut,r[e.Shape.TEXT]=Ht,r[e.Shape.LINE]=Dt,r[e.Shape.POLYLINE]=Yt,r[e.Shape.POLYGON]=Wt,r[e.Shape.PATH]=$t,r);t({token:It,useFactory:function(t){return function(e){var r=n[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),t(ae)})),le=function(t){function e(e){var r;return void 0===e&&(e={}),(r=t.call(this)||this).options=void 0,r.name="canvas-renderer",r.options=e,r}kt(e,t);var r=e.prototype;return r.init=function(){this.container.register(ie,{useValue:Ot({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options)}),this.container.load(se,!0)},r.destroy=function(){this.container.unload(se),this.container.remove(ie)},e}(e.AbstractRendererPlugin),he=Object.freeze({__proto__:null,get CircleRenderer(){return Zt},CircleRendererContribution:Gt,get EllipseRenderer(){return Jt},EllipseRendererContribution:Ft,get ImageRenderer(){return zt},ImageRendererContribution:Ut,get LineRenderer(){return Kt},LineRendererContribution:Dt,get PathRenderer(){return re},PathRendererContribution:$t,Plugin:le,get PolygonRenderer(){return ee},PolygonRendererContribution:Wt,get PolylineRenderer(){return te},PolylineRendererContribution:Yt,get RectRenderer(){return Qt},RectRendererContribution:Bt,StyleRendererFactory:It,get TextRenderer(){return qt},TextRendererContribution:Ht});function fe(){
10
10
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
11
- he=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function fe(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function ve(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){fe(i,n,o,a,c,"next",t)}function c(t){fe(i,n,o,a,c,"throw",t)}a(void 0)}))}}function de(t,e){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},de(t,e)}var pe=(ae=function(){function t(){this.contextService=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var e=this,r=this.renderingContext.root.ownerDocument.defaultView,n=function(e){t.hooks.pointerMove.call(e)},o=function(e){t.hooks.pointerUp.call(e)},i=function(e){t.hooks.pointerDown.call(e)},a=function(e){t.hooks.pointerOver.call(e)},c=function(e){t.hooks.pointerOut.call(e)},u=function(e){t.hooks.pointerCancel.call(e)},s=function(e){t.hooks.pointerWheel.call(e)},l=function(t){globalThis.document.addEventListener("pointermove",n,!0),t.addEventListener("pointerdown",i,!0),t.addEventListener("pointerleave",c,!0),t.addEventListener("pointerover",a,!0),globalThis.addEventListener("pointerup",o,!0)},h=function(t){t.addEventListener("touchstart",i,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",n,!0),t.addEventListener("touchcancel",u,!0)},f=function(t){globalThis.document.addEventListener("mousemove",n,!0),t.addEventListener("mousedown",i,!0),t.addEventListener("mouseout",c,!0),t.addEventListener("mouseover",a,!0),globalThis.addEventListener("mouseup",o,!0)};t.hooks.init.tapPromise(ce.tag,ve(he().mark((function t(){var n;return he().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.contextService.getDomElement(),globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):r.supportsPointerEvents&&(n.style.touchAction="none"),r.supportsPointerEvents?l(n):f(n),r.supportsTouchEvents&&h(n),n.addEventListener("wheel",s,{passive:!0,capture:!0});case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(ce.tag,(function(){var t=e.contextService.getDomElement();globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):r.supportsPointerEvents&&(t.style.touchAction=""),r.supportsPointerEvents?function(t){globalThis.document.removeEventListener("pointermove",n,!0),t.removeEventListener("pointerdown",i,!0),t.removeEventListener("pointerleave",c,!0),t.removeEventListener("pointerover",a,!0),globalThis.removeEventListener("pointerup",o,!0)}(t):function(t){globalThis.document.removeEventListener("mousemove",n,!0),t.removeEventListener("mousedown",i,!0),t.removeEventListener("mouseout",c,!0),t.removeEventListener("mouseover",a,!0),globalThis.removeEventListener("mouseup",o,!0)}(t),r.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",i,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",n,!0),t.removeEventListener("touchcancel",u,!0)}(t),t.removeEventListener("wheel",s,!0)}))},t}(),ae.tag="DOMInteraction",ce=ae);x([e.inject(e.ContextService),b("design:type",Object)],pe.prototype,"contextService",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],pe.prototype,"renderingContext",void 0),pe=ce=x([e.singleton({contrib:e.RenderingPluginContribution})],pe);var ye,ge,me=e.Module((function(t){t(pe)})),we=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="dom-interaction",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,de(e,r);var o=n.prototype;return o.init=function(){this.container.load(me,!0)},o.destroy=function(){this.container.unload(me)},n}(e.AbstractRendererPlugin),xe=Object.freeze({__proto__:null,Plugin:we});function be(){
11
+ fe=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function ve(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function de(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ve(i,n,o,a,c,"next",t)}function c(t){ve(i,n,o,a,c,"throw",t)}a(void 0)}))}}function pe(t,e){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pe(t,e)}var ye=(ce=function(){function t(){this.contextService=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var e=this,r=this.renderingContext.root.ownerDocument.defaultView,n=function(e){t.hooks.pointerMove.call(e)},o=function(e){t.hooks.pointerUp.call(e)},i=function(e){t.hooks.pointerDown.call(e)},a=function(e){t.hooks.pointerOver.call(e)},c=function(e){t.hooks.pointerOut.call(e)},u=function(e){t.hooks.pointerCancel.call(e)},s=function(e){t.hooks.pointerWheel.call(e)},l=function(t){globalThis.document.addEventListener("pointermove",n,!0),t.addEventListener("pointerdown",i,!0),t.addEventListener("pointerleave",c,!0),t.addEventListener("pointerover",a,!0),globalThis.addEventListener("pointerup",o,!0)},h=function(t){t.addEventListener("touchstart",i,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",n,!0),t.addEventListener("touchcancel",u,!0)},f=function(t){globalThis.document.addEventListener("mousemove",n,!0),t.addEventListener("mousedown",i,!0),t.addEventListener("mouseout",c,!0),t.addEventListener("mouseover",a,!0),globalThis.addEventListener("mouseup",o,!0)};t.hooks.init.tapPromise(ue.tag,de(fe().mark((function t(){var n;return fe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.contextService.getDomElement(),globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):r.supportsPointerEvents&&(n.style.touchAction="none"),r.supportsPointerEvents?l(n):f(n),r.supportsTouchEvents&&h(n),n.addEventListener("wheel",s,{passive:!0,capture:!0});case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(ue.tag,(function(){var t=e.contextService.getDomElement();globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):r.supportsPointerEvents&&(t.style.touchAction=""),r.supportsPointerEvents?function(t){globalThis.document.removeEventListener("pointermove",n,!0),t.removeEventListener("pointerdown",i,!0),t.removeEventListener("pointerleave",c,!0),t.removeEventListener("pointerover",a,!0),globalThis.removeEventListener("pointerup",o,!0)}(t):function(t){globalThis.document.removeEventListener("mousemove",n,!0),t.removeEventListener("mousedown",i,!0),t.removeEventListener("mouseout",c,!0),t.removeEventListener("mouseover",a,!0),globalThis.removeEventListener("mouseup",o,!0)}(t),r.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",i,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",n,!0),t.removeEventListener("touchcancel",u,!0)}(t),t.removeEventListener("wheel",s,!0)}))},t}(),ce.tag="DOMInteraction",ue=ce);x([e.inject(e.ContextService),b("design:type",Object)],ye.prototype,"contextService",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],ye.prototype,"renderingContext",void 0),ye=ue=x([e.singleton({contrib:e.RenderingPluginContribution})],ye);var ge,me,we=e.Module((function(t){t(ye)})),xe=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="dom-interaction",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,pe(e,r);var o=n.prototype;return o.init=function(){this.container.load(we,!0)},o.destroy=function(){this.container.unload(we)},n}(e.AbstractRendererPlugin),be=Object.freeze({__proto__:null,Plugin:xe});function Ee(){
12
12
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
13
- be=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function Ee(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Le(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ee(i,n,o,a,c,"next",t)}function c(t){Ee(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Pe(t,e){return Pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pe(t,e)}var Oe=(ye=function(){function t(){this.contextService=void 0,this.renderingContext=void 0,this.canvasConfig=void 0,this.$camera=void 0}var r=t.prototype;return r.apply=function(t){var r=this,n=function(t,e){var r=t.getWorldTransform();e.style.transform="matrix("+[r[0],r[1],r[4],r[5],r[12],r[13]].join(",")+")"},o=function(t){var o=t.target;if(o.nodeName===e.Shape.HTML){var i=r.getOrCreateEl(o),a=o.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){i.style[t]=a[t]})),Object.keys(o.attributes).forEach((function(t){r.updateAttribute(t,o)})),n(o,i)}},i=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var o=r.getId(n),i=r.contextService.getDomElement().parentNode;if(i){var a=i.querySelector("#"+o);a&&i.removeChild(a)}}},a=function(t){var n=t.target;n.nodeName===e.Shape.HTML&&r.updateAttribute(t.attrName,n)},c=function(t){var o=t.target;if(o.nodeName===e.Shape.HTML){var i=r.getOrCreateEl(o);n(o,i)}};t.hooks.init.tapPromise(ge.tag,Le(be().mark((function t(){return be().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,i),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,a),r.renderingContext.root.addEventListener(e.ElementEvent.BOUNDS_CHANGED,c);case 4:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(ge.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,i),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,a),r.renderingContext.root.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,c)}))},r.getId=function(t){return t.id||"g-html-"+t.entity},r.getOrCreateEl=function(t){var e=this.canvasConfig.document,r=this.getId(t),n=this.contextService.getDomElement().parentNode;if(n){var o=n.querySelector("#"+r);if(!o){o=(e||document).createElement("div"),t.parsedStyle.$el=o,o.id=r,t.name&&o.setAttribute("name",t.name),t.className&&(o.className=t.className),n.appendChild(o),o.style.position="absolute",o.style.left="0",o.style.top="0",o.style["will-change"]="transform";var i=t.getWorldTransform();o.style.transform="matrix("+[i[0],i[1],i[4],i[5],i[12],i[13]].join(",")+")"}return o}return null},r.updateAttribute=function(t,r){var n=this.getOrCreateEl(r);switch(t){case"innerHTML":var o=r.parsedStyle.innerHTML;e.isString(o)?n.innerHTML=o:(n.innerHTML="",n.appendChild(o));break;case"transformOrigin":var i=r.parsedStyle.transformOrigin;n.style["transform-origin"]=i[0].value+" "+i[1].value;break;case"width":var a=r.computedStyleMap().get("width");n.style.width=a.toString();break;case"height":var c=r.computedStyleMap().get("height");n.style.height=c.toString();break;case"zIndex":n.style["z-index"]=""+r.parsedStyle.zIndex.value;break;case"visibility":n.style.visibility=r.parsedStyle.visibility.value;break;case"pointerEvents":n.style.pointerEvents=r.parsedStyle.pointerEvents.value;break;case"opacity":n.style.opacity=""+r.parsedStyle.opacity.value;break;case"fill":var u=r.parsedStyle.fill,s="";u instanceof e.CSSRGB?s=u.isNone?"transparent":r.getAttribute("fill"):Array.isArray(u)?s=r.getAttribute("fill"):e.isPattern(u),n.style.background=s;break;case"stroke":var l=r.parsedStyle.stroke,h="";l instanceof e.CSSRGB?h=l.isNone?"transparent":r.getAttribute("stroke"):Array.isArray(l)?h=r.getAttribute("stroke"):e.isPattern(l),n.style["border-color"]=h,n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]=(r.parsedStyle.lineWidth.value||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=r.parsedStyle.filter}},t}(),ye.tag="HTMLRendering",ge=ye);x([e.inject(e.ContextService),b("design:type",Object)],Oe.prototype,"contextService",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],Oe.prototype,"renderingContext",void 0),x([e.inject(e.CanvasConfig),b("design:type",Object)],Oe.prototype,"canvasConfig",void 0),Oe=ge=x([e.singleton({contrib:e.RenderingPluginContribution})],Oe);var Se=e.Module((function(t){t(Oe)})),ke=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="html-renderer",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,Pe(e,r);var o=n.prototype;return o.init=function(){this.container.load(Se,!0)},o.destroy=function(){this.container.unload(Se)},n}(e.AbstractRendererPlugin),Ce=Object.freeze({__proto__:null,Plugin:ke}),Me=function(){function t(){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}var n=t.prototype;return n.init=function(){var t=o(r().mark((function t(){var n,o,i,a,c,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=(n=this.canvasConfig).container,a=n.devicePixelRatio,(i=n.canvas)?(this.$canvas=i,o&&i.parentElement!==o&&o.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container):o&&(this.$container=e.isString(o)?document.getElementById(o):o,this.$container&&(c=document.createElement("canvas"),this.$container.appendChild(c),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=c)),this.context=this.$canvas.getContext("2d"),u=1>(u=a||e.isBrowser&&window.devicePixelRatio||1)?1:Math.ceil(u),this.dpr=u,this.resize(this.canvasConfig.width,this.canvasConfig.height);case 7:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getContext=function(){return this.context},n.getDomElement=function(){return this.$canvas},n.getDPR=function(){return this.dpr},n.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},n.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},n.resize=function(t,r){this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*r,e.setDOMSize(this.$canvas,t,r))},n.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},n.toDataURL=function(){var t=o(r().mark((function t(e){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===e&&(e={}),t.abrupt("return",this.context.canvas.toDataURL((n=e).type,n.encoderOptions));case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}();x([e.inject(e.CanvasConfig),b("design:type",Object)],Me.prototype,"canvasConfig",void 0),Me=x([e.singleton({token:e.ContextService})],Me);var Te=e.Module((function(t){t(Me)})),je=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-context-register",e}i(e,t);var r=e.prototype;return r.init=function(){this.container.load(Te,!0)},r.destroy=function(){this.container.unload(Te)},e}(e.AbstractRendererPlugin),Ne=function(t){function e(e){var r;return(r=t.call(this,e)||this).registerPlugin(new je),r.registerPlugin(new xt),r.registerPlugin(new m),r.registerPlugin(new se),r.registerPlugin(new we),r.registerPlugin(new st),r.registerPlugin(new ke),r}return i(e,t),e}(e.AbstractRenderer);t.CanvasPathGenerator=w,t.CanvasPicker=lt,t.CanvasRenderer=le,t.DomInteraction=xe,t.HTMLRenderer=Ce,t.ImageLoader=bt,t.Renderer=Ne,Object.defineProperty(t,"__esModule",{value:!0})}));
13
+ Ee=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function Le(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Pe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Le(i,n,o,a,c,"next",t)}function c(t){Le(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Oe(t,e){return Oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oe(t,e)}var ke=(ge=function(){function t(){this.contextService=void 0,this.renderingContext=void 0,this.canvasConfig=void 0,this.$camera=void 0}var r=t.prototype;return r.apply=function(t){var r=this,n=function(t,e){var r=t.getWorldTransform();e.style.transform="matrix("+[r[0],r[1],r[4],r[5],r[12],r[13]].join(",")+")"},o=function(t){var o=t.target;if(o.nodeName===e.Shape.HTML){var i=r.getOrCreateEl(o),a=o.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){i.style[t]=a[t]})),Object.keys(o.attributes).forEach((function(t){r.updateAttribute(t,o)})),n(o,i)}},i=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var o=r.getId(n),i=r.contextService.getDomElement().parentNode;if(i){var a=i.querySelector("#"+o);a&&i.removeChild(a)}}},a=function(t){var n=t.target;n.nodeName===e.Shape.HTML&&r.updateAttribute(t.attrName,n)},c=function(t){var o=t.target;if(o.nodeName===e.Shape.HTML){var i=r.getOrCreateEl(o);n(o,i)}};t.hooks.init.tapPromise(me.tag,Pe(Ee().mark((function t(){return Ee().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,i),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,a),r.renderingContext.root.addEventListener(e.ElementEvent.BOUNDS_CHANGED,c);case 4:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(me.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,i),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,a),r.renderingContext.root.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,c)}))},r.getId=function(t){return t.id||"g-html-"+t.entity},r.getOrCreateEl=function(t){var e=this.canvasConfig.document,r=this.getId(t),n=this.contextService.getDomElement().parentNode;if(n){var o=n.querySelector("#"+r);if(!o){o=(e||document).createElement("div"),t.parsedStyle.$el=o,o.id=r,t.name&&o.setAttribute("name",t.name),t.className&&(o.className=t.className),n.appendChild(o),o.style.position="absolute",o.style.left="0",o.style.top="0",o.style["will-change"]="transform";var i=t.getWorldTransform();o.style.transform="matrix("+[i[0],i[1],i[4],i[5],i[12],i[13]].join(",")+")"}return o}return null},r.updateAttribute=function(t,r){var n=this.getOrCreateEl(r);switch(t){case"innerHTML":var o=r.parsedStyle.innerHTML;e.isString(o)?n.innerHTML=o:(n.innerHTML="",n.appendChild(o));break;case"transformOrigin":var i=r.parsedStyle.transformOrigin;n.style["transform-origin"]=i[0].value+" "+i[1].value;break;case"width":var a=r.computedStyleMap().get("width");n.style.width=a.toString();break;case"height":var c=r.computedStyleMap().get("height");n.style.height=c.toString();break;case"zIndex":n.style["z-index"]=""+r.parsedStyle.zIndex.value;break;case"visibility":n.style.visibility=r.parsedStyle.visibility.value;break;case"pointerEvents":n.style.pointerEvents=r.parsedStyle.pointerEvents.value;break;case"opacity":n.style.opacity=""+r.parsedStyle.opacity.value;break;case"fill":var u=r.parsedStyle.fill,s="";u instanceof e.CSSRGB?s=u.isNone?"transparent":r.getAttribute("fill"):Array.isArray(u)?s=r.getAttribute("fill"):e.isPattern(u),n.style.background=s;break;case"stroke":var l=r.parsedStyle.stroke,h="";l instanceof e.CSSRGB?h=l.isNone?"transparent":r.getAttribute("stroke"):Array.isArray(l)?h=r.getAttribute("stroke"):e.isPattern(l),n.style["border-color"]=h,n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]=(r.parsedStyle.lineWidth.value||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=r.parsedStyle.filter}},t}(),ge.tag="HTMLRendering",me=ge);x([e.inject(e.ContextService),b("design:type",Object)],ke.prototype,"contextService",void 0),x([e.inject(e.RenderingContext),b("design:type",Object)],ke.prototype,"renderingContext",void 0),x([e.inject(e.CanvasConfig),b("design:type",Object)],ke.prototype,"canvasConfig",void 0),ke=me=x([e.singleton({contrib:e.RenderingPluginContribution})],ke);var Se=e.Module((function(t){t(ke)})),Ce=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="html-renderer",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,Oe(e,r);var o=n.prototype;return o.init=function(){this.container.load(Se,!0)},o.destroy=function(){this.container.unload(Se)},n}(e.AbstractRendererPlugin),Me=Object.freeze({__proto__:null,Plugin:Ce}),Te=function(){function t(){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}var n=t.prototype;return n.init=function(){var t=o(r().mark((function t(){var n,o,i,a,c,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=(n=this.canvasConfig).container,a=n.devicePixelRatio,(i=n.canvas)?(this.$canvas=i,o&&i.parentElement!==o&&o.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container):o&&(this.$container=e.isString(o)?document.getElementById(o):o,this.$container&&(c=document.createElement("canvas"),this.$container.appendChild(c),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=c)),this.context=this.$canvas.getContext("2d"),u=1>(u=a||e.isBrowser&&window.devicePixelRatio||1)?1:Math.ceil(u),this.dpr=u,this.resize(this.canvasConfig.width,this.canvasConfig.height);case 7:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getContext=function(){return this.context},n.getDomElement=function(){return this.$canvas},n.getDPR=function(){return this.dpr},n.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},n.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},n.resize=function(t,r){this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*r,e.setDOMSize(this.$canvas,t,r))},n.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},n.toDataURL=function(){var t=o(r().mark((function t(e){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===e&&(e={}),t.abrupt("return",this.context.canvas.toDataURL((n=e).type,n.encoderOptions));case 3:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}();x([e.inject(e.CanvasConfig),b("design:type",Object)],Te.prototype,"canvasConfig",void 0),Te=x([e.singleton({token:e.ContextService})],Te);var je=e.Module((function(t){t(Te)})),Ne=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-context-register",e}i(e,t);var r=e.prototype;return r.init=function(){this.container.load(je,!0)},r.destroy=function(){this.container.unload(je)},e}(e.AbstractRendererPlugin),_e=function(t){function e(e){var r;return(r=t.call(this,e)||this).registerPlugin(new Ne),r.registerPlugin(new xt),r.registerPlugin(new m),r.registerPlugin(new le),r.registerPlugin(new xe),r.registerPlugin(new st),r.registerPlugin(new Ce),r}return i(e,t),e}(e.AbstractRenderer);t.CanvasPathGenerator=w,t.CanvasPicker=lt,t.CanvasRenderer=he,t.DomInteraction=be,t.HTMLRenderer=Me,t.ImageLoader=bt,t.Renderer=_e,Object.defineProperty(t,"__esModule",{value:!0})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g-canvas",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "A renderer implemented by Canvas 2D API",
5
5
  "keywords": [
6
6
  "antv",
@@ -31,8 +31,8 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@antv/g-plugin-canvas-path-generator": "^1.1.0",
34
- "@antv/g-plugin-canvas-picker": "^1.7.1",
35
- "@antv/g-plugin-canvas-renderer": "^1.7.2",
34
+ "@antv/g-plugin-canvas-picker": "^1.7.2",
35
+ "@antv/g-plugin-canvas-renderer": "^1.7.3",
36
36
  "@antv/g-plugin-dom-interaction": "^1.7.0",
37
37
  "@antv/g-plugin-html-renderer": "^1.7.0",
38
38
  "@antv/g-plugin-image-loader": "^1.1.1",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "4222974301960b6002ea7527d88f3b4d5547ad51"
51
+ "gitHead": "1f4a67789c9185b1deb2ea85d657f3c6f17475d0"
52
52
  }