Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antv/g-plugin-canvas-renderer

Package Overview
Dependencies
Maintainers
59
Versions
263
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-plugin-canvas-renderer - npm Package Compare versions

Comparing version 1.7.3 to 1.7.4

5

dist/CanvasRendererPlugin.d.ts

@@ -36,3 +36,6 @@ import type { RenderingPlugin, RenderingService } from '@antv/g';

private tmpMat4;
private tmpVec3;
private vec3a;
private vec3b;
private vec3c;
private vec3d;
apply(renderingService: RenderingService): void;

@@ -39,0 +42,0 @@ private clearRect;

167

dist/index.esm.js

@@ -1,2 +0,2 @@

import { Syringe, inject, singleton, isNil, Shape, isPattern, GradientType, isString, UnitType, CanvasConfig, DefaultCamera, Camera, ContextService, RenderingContext, DisplayObjectPool, RBushRoot, RBush, RenderingPluginContribution, ElementEvent, AABB, CustomEvent, CanvasEvent, Module, AbstractRendererPlugin } from '@antv/g';
import { Syringe, inject, singleton, isNil, Shape, isPattern, GradientType, isString, CanvasConfig, DefaultCamera, Camera, ContextService, RenderingContext, DisplayObjectPool, RBushRoot, RBush, RenderingPluginContribution, ElementEvent, AABB, CustomEvent, CanvasEvent, Module, AbstractRendererPlugin } from '@antv/g';
import { __decorate, __metadata } from 'tslib';

@@ -750,28 +750,28 @@ import { PathGeneratorFactory } from '@antv/g-plugin-canvas-path-generator';

var StyleRendererFactory = Syringe.defineToken('StyleRendererFactory');
var CircleRendererContribution = Syringe.defineToken('CircleRenderer', {
var StyleRendererFactory = Syringe.defineToken('');
var CircleRendererContribution = Syringe.defineToken('', {
multiple: false
});
var EllipseRendererContribution = Syringe.defineToken('EllipseRenderer', {
var EllipseRendererContribution = Syringe.defineToken('', {
multiple: false
});
var RectRendererContribution = Syringe.defineToken('RectRenderer', {
var RectRendererContribution = Syringe.defineToken('', {
multiple: false
});
var LineRendererContribution = Syringe.defineToken('LineRenderer', {
var LineRendererContribution = Syringe.defineToken('', {
multiple: false
});
var PolylineRendererContribution = Syringe.defineToken('PolylineRenderer', {
var PolylineRendererContribution = Syringe.defineToken('', {
multiple: false
});
var PolygonRendererContribution = Syringe.defineToken('PolygonRenderer', {
var PolygonRendererContribution = Syringe.defineToken('', {
multiple: false
});
var PathRendererContribution = Syringe.defineToken('PathRenderer', {
var PathRendererContribution = Syringe.defineToken('', {
multiple: false
});
var TextRendererContribution = Syringe.defineToken('TextRenderer', {
var TextRendererContribution = Syringe.defineToken('', {
multiple: false
});
var ImageRendererContribution = Syringe.defineToken('ImageRenderer', {
var ImageRendererContribution = Syringe.defineToken('', {
multiple: false

@@ -802,12 +802,12 @@ });

var hasFill = !isNil(fill) && !fill.isNone;
var hasStroke = !isNil(stroke) && !stroke.isNone && lineWidth && lineWidth.value > 0;
var hasStroke = !isNil(stroke) && !stroke.isNone && lineWidth > 0;
var isFillTransparent = fill.alpha === 0;
var hasFilter = !isNil(filter);
var hasShadow = !isNil(shadowColor) && (shadowBlur === null || shadowBlur === void 0 ? void 0 : shadowBlur.value) > 0;
var hasFilter = !!(filter && filter.length);
var hasShadow = !isNil(shadowColor) && shadowBlur > 0;
var nodeName = object.nodeName;
var isInnerShadow = (shadowType === null || shadowType === void 0 ? void 0 : shadowType.value) === 'inner';
var isInnerShadow = shadowType === 'inner';
var shouldDrawShadowWithStroke = hasStroke && hasShadow && (nodeName === Shape.PATH || nodeName === Shape.LINE || nodeName === Shape.POLYLINE || isFillTransparent || isInnerShadow);
if (hasFill) {
context.globalAlpha = opacity.value * fillOpacity.value;
context.globalAlpha = opacity * fillOpacity;

@@ -826,15 +826,15 @@ if (!shouldDrawShadowWithStroke) {

if (hasStroke) {
context.globalAlpha = opacity.value * strokeOpacity.value;
context.lineWidth = lineWidth.value;
context.globalAlpha = opacity * strokeOpacity;
context.lineWidth = lineWidth;
if (!isNil(miterLimit)) {
context.miterLimit = miterLimit.value;
context.miterLimit = miterLimit;
}
if (!isNil(lineCap)) {
context.lineCap = lineCap.value;
context.lineCap = lineCap;
}
if (!isNil(lineJoin)) {
context.lineJoin = lineJoin.value;
context.lineJoin = lineJoin;
}

@@ -955,3 +955,3 @@

if (!isNil(filter)) {
if (filter && filter.length) {
// use raw filter string

@@ -963,5 +963,5 @@ context.filter = object.style.filter;

context.shadowColor = shadowColor.toString();
context.shadowBlur = shadowBlur && shadowBlur.value || 0;
context.shadowOffsetX = shadowOffsetX && shadowOffsetX.value || 0;
context.shadowOffsetY = shadowOffsetY && shadowOffsetY.value || 0;
context.shadowBlur = shadowBlur || 0;
context.shadowOffsetX = shadowOffsetX || 0;
context.shadowOffsetY = shadowOffsetY || 0;
}

@@ -984,4 +984,4 @@ }

var image;
var iw = width.value;
var ih = height.value;
var iw = width;
var ih = height;

@@ -998,3 +998,3 @@ if (isString(img)) {

if (image) {
var hasShadow = !isNil(shadowColor) && (shadowBlur === null || shadowBlur === void 0 ? void 0 : shadowBlur.value) > 0;
var hasShadow = !isNil(shadowColor) && shadowBlur > 0;
setShadowAndFilter(object, context, hasShadow); // node-canvas will throw the following err:

@@ -1046,9 +1046,9 @@ // Error: Image given has not completed loading

context.font = font;
context.lineWidth = lineWidth.value;
context.textAlign = textAlign.value;
context.textBaseline = textBaseline.value;
context.lineJoin = lineJoin.value;
context.lineWidth = lineWidth;
context.textAlign = textAlign;
context.textBaseline = textBaseline;
context.lineJoin = lineJoin;
if (!isNil(miterLimit)) {
context.miterLimit = miterLimit.value;
context.miterLimit = miterLimit;
}

@@ -1058,7 +1058,7 @@

if (textBaseline.value === 'middle') {
if (textBaseline === 'middle') {
linePositionY = -height / 2 - lineHeight / 2;
} else if (textBaseline.value === 'bottom' || textBaseline.value === 'alphabetic' || textBaseline.value === 'ideographic') {
} else if (textBaseline === 'bottom' || textBaseline === 'alphabetic' || textBaseline === 'ideographic') {
linePositionY = -height;
} else if (textBaseline.value === 'top' || textBaseline.value === 'hanging') {
} else if (textBaseline === 'top' || textBaseline === 'hanging') {
linePositionY = -lineHeight;

@@ -1068,26 +1068,18 @@ } // account for dx & dy

var offsetX = 0;
if (dx && dx.unit === UnitType.kPixels) {
offsetX += dx.value;
}
if (dy && dy.unit === UnitType.kPixels) {
linePositionY += dy.value;
}
var hasShadow = !isNil(shadowColor) && (shadowBlur === null || shadowBlur === void 0 ? void 0 : shadowBlur.value) > 0;
var offsetX = dx || 0;
linePositionY += dy || 0;
var hasShadow = !isNil(shadowColor) && shadowBlur > 0;
setShadowAndFilter(object, context, hasShadow); // draw lines line by line
for (var i = 0; i < lines.length; i++) {
var linePositionX = lineWidth.value / 2 + offsetX;
var linePositionX = lineWidth / 2 + offsetX;
linePositionY += lineHeight; // no need to re-position X, cause we already set text align
// @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign
if (!isNil(stroke) && !stroke.isNone && lineWidth && lineWidth.value) {
this.drawLetterSpacing(context, lines[i], lineMetrics[i], textAlign.value, linePositionX, linePositionY, letterSpacing.value, fillOpacity.value, strokeOpacity.value, opacity.value, true);
if (!isNil(stroke) && !stroke.isNone && lineWidth) {
this.drawLetterSpacing(context, lines[i], lineMetrics[i], textAlign, linePositionX, linePositionY, letterSpacing, fillOpacity, strokeOpacity, opacity, true);
}
if (!isNil(fill)) {
this.drawLetterSpacing(context, lines[i], lineMetrics[i], textAlign.value, linePositionX, linePositionY, letterSpacing.value, fillOpacity.value, strokeOpacity.value, opacity.value);
this.drawLetterSpacing(context, lines[i], lineMetrics[i], textAlign, linePositionX, linePositionY, letterSpacing, fillOpacity, strokeOpacity, opacity);
}

@@ -1282,3 +1274,3 @@ }

var CanvasRendererPluginOptions = Syringe.defineToken('CanvasRendererPluginOptions');
var CanvasRendererPluginOptions = Syringe.defineToken('');

@@ -1314,3 +1306,6 @@ var _class;

this.tmpMat4 = create();
this.tmpVec3 = create$1();
this.vec3a = create$1();
this.vec3b = create$1();
this.vec3c = create$1();
this.vec3d = create$1();
}

@@ -1414,10 +1409,9 @@

_this.saveDirtyAABB(object);
} // should account for z-index
}
var sorted = object.sortable.sorted || object.childNodes; // should account for z-index
if (object.sortable.sorted && object.sortable.sorted.length) {
object.sortable.sorted.forEach(function (child) {
renderByZIndex(child);
});
}
sorted.forEach(function (child) {
renderByZIndex(child);
});
}; // render at the end of frame

@@ -1459,8 +1453,14 @@

height = dirtyRect.height;
var tl = transformMat4(_this.tmpVec3, fromValues(x, y, 0), _this.vpMatrix);
var br = transformMat4(create$1(), fromValues(x + width, y + height, 0), _this.vpMatrix);
var ix = Math.floor(tl[0]);
var iy = Math.floor(tl[1]);
var iwidth = Math.ceil(br[0] - tl[0]);
var iheight = Math.ceil(br[1] - tl[1]);
var tl = transformMat4(_this.vec3a, fromValues(x, y, 0), _this.vpMatrix);
var tr = transformMat4(_this.vec3b, fromValues(x + width, y, 0), _this.vpMatrix);
var bl = transformMat4(_this.vec3c, fromValues(x, y + height, 0), _this.vpMatrix);
var br = transformMat4(_this.vec3d, fromValues(x + width, y + height, 0), _this.vpMatrix);
var minx = Math.min(tl[0], tr[0], br[0], bl[0]);
var miny = Math.min(tl[1], tr[1], br[1], bl[1]);
var maxx = Math.max(tl[0], tr[0], br[0], bl[0]);
var maxy = Math.max(tl[1], tr[1], br[1], bl[1]);
var ix = Math.floor(minx);
var iy = Math.floor(miny);
var iwidth = Math.ceil(maxx - minx);
var iheight = Math.ceil(maxy - miny);
context.save();

@@ -1481,3 +1481,8 @@

canvas.dispatchEvent(new CustomEvent(CanvasEvent.DIRTY_RECTANGLE, {
dirtyRect: dirtyRect
dirtyRect: {
x: ix,
y: iy,
width: iwidth,
height: iheight
}
}));

@@ -1708,6 +1713,4 @@ } // search objects intersect with dirty rectangle

if (lineDash && Array.isArray(lineDash)) {
context.setLineDash(lineDash.map(function (segment) {
return segment.value;
}));
if (lineDash) {
context.setLineDash(lineDash);
} // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/lineDashOffset

@@ -1717,7 +1720,7 @@

if (!isNil(lineDashOffset)) {
context.lineDashOffset = lineDashOffset.value;
context.lineDashOffset = lineDashOffset;
}
if (!isNil(opacity)) {
context.globalAlpha *= opacity.value;
context.globalAlpha *= opacity;
}

@@ -1741,4 +1744,4 @@

var anchorX = anchor && anchor[0].value || 0;
var anchorY = anchor && anchor[1].value || 0;
var anchorX = anchor && anchor[0] || 0;
var anchorY = anchor && anchor[1] || 0;

@@ -1756,6 +1759,6 @@ if (anchorX !== 0 || anchorY !== 0) {

copy(this.tmpMat4, object.getLocalTransform());
this.tmpVec3[0] = tx;
this.tmpVec3[1] = ty;
this.tmpVec3[2] = 0;
translate(this.tmpMat4, this.tmpMat4, this.tmpVec3);
this.vec3a[0] = tx;
this.vec3a[1] = ty;
this.vec3a[2] = 0;
translate(this.tmpMat4, this.tmpMat4, this.vec3a);
multiply(this.tmpMat4, matrix, this.tmpMat4);

@@ -1766,6 +1769,6 @@ multiply(this.tmpMat4, this.vpMatrix, this.tmpMat4);

copy(this.tmpMat4, object.getWorldTransform());
this.tmpVec3[0] = tx;
this.tmpVec3[1] = ty;
this.tmpVec3[2] = 0;
translate(this.tmpMat4, this.tmpMat4, this.tmpVec3);
this.vec3a[0] = tx;
this.vec3a[1] = ty;
this.vec3a[2] = 0;
translate(this.tmpMat4, this.tmpMat4, this.vec3a);
multiply(this.tmpMat4, this.vpMatrix, this.tmpMat4);

@@ -1772,0 +1775,0 @@ } // @see https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Transformations

@@ -754,28 +754,28 @@ 'use strict';

var StyleRendererFactory = g.Syringe.defineToken('StyleRendererFactory');
var CircleRendererContribution = g.Syringe.defineToken('CircleRenderer', {
var StyleRendererFactory = g.Syringe.defineToken('');
var CircleRendererContribution = g.Syringe.defineToken('', {
multiple: false
});
var EllipseRendererContribution = g.Syringe.defineToken('EllipseRenderer', {
var EllipseRendererContribution = g.Syringe.defineToken('', {
multiple: false
});
var RectRendererContribution = g.Syringe.defineToken('RectRenderer', {
var RectRendererContribution = g.Syringe.defineToken('', {
multiple: false
});
var LineRendererContribution = g.Syringe.defineToken('LineRenderer', {
var LineRendererContribution = g.Syringe.defineToken('', {
multiple: false
});
var PolylineRendererContribution = g.Syringe.defineToken('PolylineRenderer', {
var PolylineRendererContribution = g.Syringe.defineToken('', {
multiple: false
});
var PolygonRendererContribution = g.Syringe.defineToken('PolygonRenderer', {
var PolygonRendererContribution = g.Syringe.defineToken('', {
multiple: false
});
var PathRendererContribution = g.Syringe.defineToken('PathRenderer', {
var PathRendererContribution = g.Syringe.defineToken('', {
multiple: false
});
var TextRendererContribution = g.Syringe.defineToken('TextRenderer', {
var TextRendererContribution = g.Syringe.defineToken('', {
multiple: false
});
var ImageRendererContribution = g.Syringe.defineToken('ImageRenderer', {
var ImageRendererContribution = g.Syringe.defineToken('', {
multiple: false

@@ -806,12 +806,12 @@ });

var hasFill = !g.isNil(fill) && !fill.isNone;
var hasStroke = !g.isNil(stroke) && !stroke.isNone && lineWidth && lineWidth.value > 0;
var hasStroke = !g.isNil(stroke) && !stroke.isNone && lineWidth > 0;
var isFillTransparent = fill.alpha === 0;
var hasFilter = !g.isNil(filter);
var hasShadow = !g.isNil(shadowColor) && (shadowBlur === null || shadowBlur === void 0 ? void 0 : shadowBlur.value) > 0;
var hasFilter = !!(filter && filter.length);
var hasShadow = !g.isNil(shadowColor) && shadowBlur > 0;
var nodeName = object.nodeName;
var isInnerShadow = (shadowType === null || shadowType === void 0 ? void 0 : shadowType.value) === 'inner';
var isInnerShadow = shadowType === 'inner';
var shouldDrawShadowWithStroke = hasStroke && hasShadow && (nodeName === g.Shape.PATH || nodeName === g.Shape.LINE || nodeName === g.Shape.POLYLINE || isFillTransparent || isInnerShadow);
if (hasFill) {
context.globalAlpha = opacity.value * fillOpacity.value;
context.globalAlpha = opacity * fillOpacity;

@@ -830,15 +830,15 @@ if (!shouldDrawShadowWithStroke) {

if (hasStroke) {
context.globalAlpha = opacity.value * strokeOpacity.value;
context.lineWidth = lineWidth.value;
context.globalAlpha = opacity * strokeOpacity;
context.lineWidth = lineWidth;
if (!g.isNil(miterLimit)) {
context.miterLimit = miterLimit.value;
context.miterLimit = miterLimit;
}
if (!g.isNil(lineCap)) {
context.lineCap = lineCap.value;
context.lineCap = lineCap;
}
if (!g.isNil(lineJoin)) {
context.lineJoin = lineJoin.value;
context.lineJoin = lineJoin;
}

@@ -959,3 +959,3 @@

if (!g.isNil(filter)) {
if (filter && filter.length) {
// use raw filter string

@@ -967,5 +967,5 @@ context.filter = object.style.filter;

context.shadowColor = shadowColor.toString();
context.shadowBlur = shadowBlur && shadowBlur.value || 0;
context.shadowOffsetX = shadowOffsetX && shadowOffsetX.value || 0;
context.shadowOffsetY = shadowOffsetY && shadowOffsetY.value || 0;
context.shadowBlur = shadowBlur || 0;
context.shadowOffsetX = shadowOffsetX || 0;
context.shadowOffsetY = shadowOffsetY || 0;
}

@@ -988,4 +988,4 @@ }

var image;
var iw = width.value;
var ih = height.value;
var iw = width;
var ih = height;

@@ -1002,3 +1002,3 @@ if (g.isString(img)) {

if (image) {
var hasShadow = !g.isNil(shadowColor) && (shadowBlur === null || shadowBlur === void 0 ? void 0 : shadowBlur.value) > 0;
var hasShadow = !g.isNil(shadowColor) && shadowBlur > 0;
setShadowAndFilter(object, context, hasShadow); // node-canvas will throw the following err:

@@ -1050,9 +1050,9 @@ // Error: Image given has not completed loading

context.font = font;
context.lineWidth = lineWidth.value;
context.textAlign = textAlign.value;
context.textBaseline = textBaseline.value;
context.lineJoin = lineJoin.value;
context.lineWidth = lineWidth;
context.textAlign = textAlign;
context.textBaseline = textBaseline;
context.lineJoin = lineJoin;
if (!g.isNil(miterLimit)) {
context.miterLimit = miterLimit.value;
context.miterLimit = miterLimit;
}

@@ -1062,7 +1062,7 @@

if (textBaseline.value === 'middle') {
if (textBaseline === 'middle') {
linePositionY = -height / 2 - lineHeight / 2;
} else if (textBaseline.value === 'bottom' || textBaseline.value === 'alphabetic' || textBaseline.value === 'ideographic') {
} else if (textBaseline === 'bottom' || textBaseline === 'alphabetic' || textBaseline === 'ideographic') {
linePositionY = -height;
} else if (textBaseline.value === 'top' || textBaseline.value === 'hanging') {
} else if (textBaseline === 'top' || textBaseline === 'hanging') {
linePositionY = -lineHeight;

@@ -1072,26 +1072,18 @@ } // account for dx & dy

var offsetX = 0;
if (dx && dx.unit === g.UnitType.kPixels) {
offsetX += dx.value;
}
if (dy && dy.unit === g.UnitType.kPixels) {
linePositionY += dy.value;
}
var hasShadow = !g.isNil(shadowColor) && (shadowBlur === null || shadowBlur === void 0 ? void 0 : shadowBlur.value) > 0;
var offsetX = dx || 0;
linePositionY += dy || 0;
var hasShadow = !g.isNil(shadowColor) && shadowBlur > 0;
setShadowAndFilter(object, context, hasShadow); // draw lines line by line
for (var i = 0; i < lines.length; i++) {
var linePositionX = lineWidth.value / 2 + offsetX;
var linePositionX = lineWidth / 2 + offsetX;
linePositionY += lineHeight; // no need to re-position X, cause we already set text align
// @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign
if (!g.isNil(stroke) && !stroke.isNone && lineWidth && lineWidth.value) {
this.drawLetterSpacing(context, lines[i], lineMetrics[i], textAlign.value, linePositionX, linePositionY, letterSpacing.value, fillOpacity.value, strokeOpacity.value, opacity.value, true);
if (!g.isNil(stroke) && !stroke.isNone && lineWidth) {
this.drawLetterSpacing(context, lines[i], lineMetrics[i], textAlign, linePositionX, linePositionY, letterSpacing, fillOpacity, strokeOpacity, opacity, true);
}
if (!g.isNil(fill)) {
this.drawLetterSpacing(context, lines[i], lineMetrics[i], textAlign.value, linePositionX, linePositionY, letterSpacing.value, fillOpacity.value, strokeOpacity.value, opacity.value);
this.drawLetterSpacing(context, lines[i], lineMetrics[i], textAlign, linePositionX, linePositionY, letterSpacing, fillOpacity, strokeOpacity, opacity);
}

@@ -1286,3 +1278,3 @@ }

var CanvasRendererPluginOptions = g.Syringe.defineToken('CanvasRendererPluginOptions');
var CanvasRendererPluginOptions = g.Syringe.defineToken('');

@@ -1318,3 +1310,6 @@ var _class;

this.tmpMat4 = create();
this.tmpVec3 = create$1();
this.vec3a = create$1();
this.vec3b = create$1();
this.vec3c = create$1();
this.vec3d = create$1();
}

@@ -1418,10 +1413,9 @@

_this.saveDirtyAABB(object);
} // should account for z-index
}
var sorted = object.sortable.sorted || object.childNodes; // should account for z-index
if (object.sortable.sorted && object.sortable.sorted.length) {
object.sortable.sorted.forEach(function (child) {
renderByZIndex(child);
});
}
sorted.forEach(function (child) {
renderByZIndex(child);
});
}; // render at the end of frame

@@ -1463,8 +1457,14 @@

height = dirtyRect.height;
var tl = transformMat4(_this.tmpVec3, fromValues(x, y, 0), _this.vpMatrix);
var br = transformMat4(create$1(), fromValues(x + width, y + height, 0), _this.vpMatrix);
var ix = Math.floor(tl[0]);
var iy = Math.floor(tl[1]);
var iwidth = Math.ceil(br[0] - tl[0]);
var iheight = Math.ceil(br[1] - tl[1]);
var tl = transformMat4(_this.vec3a, fromValues(x, y, 0), _this.vpMatrix);
var tr = transformMat4(_this.vec3b, fromValues(x + width, y, 0), _this.vpMatrix);
var bl = transformMat4(_this.vec3c, fromValues(x, y + height, 0), _this.vpMatrix);
var br = transformMat4(_this.vec3d, fromValues(x + width, y + height, 0), _this.vpMatrix);
var minx = Math.min(tl[0], tr[0], br[0], bl[0]);
var miny = Math.min(tl[1], tr[1], br[1], bl[1]);
var maxx = Math.max(tl[0], tr[0], br[0], bl[0]);
var maxy = Math.max(tl[1], tr[1], br[1], bl[1]);
var ix = Math.floor(minx);
var iy = Math.floor(miny);
var iwidth = Math.ceil(maxx - minx);
var iheight = Math.ceil(maxy - miny);
context.save();

@@ -1485,3 +1485,8 @@

canvas.dispatchEvent(new g.CustomEvent(g.CanvasEvent.DIRTY_RECTANGLE, {
dirtyRect: dirtyRect
dirtyRect: {
x: ix,
y: iy,
width: iwidth,
height: iheight
}
}));

@@ -1712,6 +1717,4 @@ } // search objects intersect with dirty rectangle

if (lineDash && Array.isArray(lineDash)) {
context.setLineDash(lineDash.map(function (segment) {
return segment.value;
}));
if (lineDash) {
context.setLineDash(lineDash);
} // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/lineDashOffset

@@ -1721,7 +1724,7 @@

if (!g.isNil(lineDashOffset)) {
context.lineDashOffset = lineDashOffset.value;
context.lineDashOffset = lineDashOffset;
}
if (!g.isNil(opacity)) {
context.globalAlpha *= opacity.value;
context.globalAlpha *= opacity;
}

@@ -1745,4 +1748,4 @@

var anchorX = anchor && anchor[0].value || 0;
var anchorY = anchor && anchor[1].value || 0;
var anchorX = anchor && anchor[0] || 0;
var anchorY = anchor && anchor[1] || 0;

@@ -1760,6 +1763,6 @@ if (anchorX !== 0 || anchorY !== 0) {

copy(this.tmpMat4, object.getLocalTransform());
this.tmpVec3[0] = tx;
this.tmpVec3[1] = ty;
this.tmpVec3[2] = 0;
translate(this.tmpMat4, this.tmpMat4, this.tmpVec3);
this.vec3a[0] = tx;
this.vec3a[1] = ty;
this.vec3a[2] = 0;
translate(this.tmpMat4, this.tmpMat4, this.vec3a);
multiply(this.tmpMat4, matrix, this.tmpMat4);

@@ -1770,6 +1773,6 @@ multiply(this.tmpMat4, this.vpMatrix, this.tmpMat4);

copy(this.tmpMat4, object.getWorldTransform());
this.tmpVec3[0] = tx;
this.tmpVec3[1] = ty;
this.tmpVec3[2] = 0;
translate(this.tmpMat4, this.tmpMat4, this.tmpVec3);
this.vec3a[0] = tx;
this.vec3a[1] = ty;
this.vec3a[2] = 0;
translate(this.tmpMat4, this.tmpMat4, this.vec3a);
multiply(this.tmpMat4, this.vpMatrix, this.tmpMat4);

@@ -1776,0 +1779,0 @@ } // @see https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Transformations

@@ -1,5 +0,5 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@antv/g")):"function"==typeof define&&define.amd?define(["exports","@antv/g"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).G=e.G||{},e.G.CanvasRenderer={}),e.window.G)}(this,(function(e,t){"use strict";function r(){
!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.CanvasRenderer={}),t.window.G)}(this,(function(t,e){"use strict";function r(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
r=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=Object.create((t&&t.prototype instanceof d?t:d).prototype),o=new C(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return O()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var l=b(a,r);if(l){if(l===h)continue;return l}}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 c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,o),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var h={};function d(){}function f(){}function p(){}var v={};c(v,o,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(S([])));g&&g!==t&&n.call(g,o)&&(v=g);var m=p.prototype=d.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(i,o,a,l){var c=u(e[i],e,o);if("throw"!==c.type){var s=c.arg,h=s.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(h).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,l)}))}l(c.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=p,c(m,"constructor",p),c(p,"constructor",f),f.displayName=c(p,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,l,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},w(x.prototype),c(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new x(s(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(m),c(m,l,"Generator"),c(m,o,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=S,C.prototype={constructor:C,reset:function(e){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(R),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(l){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===e||"continue"===e)&&t>=o.tryLoc&&o.finallyLoc>=t&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;R(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function n(e,t,r,n,i,o,a){try{var l=e[o](a),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,i)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var a=e.apply(t,r);function l(e){n(a,i,o,l,c,"next",e)}function c(e){n(a,i,o,l,c,"throw",e)}l(void 0)}))}}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function c(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}var u=t.Syringe.defineToken("PathGeneratorFactory"),h=t.Syringe.defineToken("PathGenerator");function d(e,t){var r=t.r;e.arc(r.value,r.value,r.value,0,2*Math.PI,!1)}function f(e,t){var r=t.rx.value,n=t.ry.value;if(e.ellipse)e.ellipse(r,n,r,n,0,0,2*Math.PI,!1);else{var i=r>n?r:n,o=r>n?1:r/n,a=r>n?n/r:1;e.save(),e.scale(o,a),e.arc(0,0,i,0,2*Math.PI)}}function p(e,r){var n,i,o=r.x1,a=r.y1,l=r.x2,c=r.y2,s=r.defX,u=void 0===s?0:s,h=r.defY,d=void 0===h?0:h,f=r.markerStart,p=r.markerEnd,v=r.markerStartOffset,y=r.markerEndOffset,g=0,m=0,w=0,x=0,b=0;f&&f instanceof t.DisplayObject&&v&&(n=l.value-o.value,i=c.value-a.value,b=Math.atan2(i,n),g=Math.cos(b)*((null==v?void 0:v.value)||0),m=Math.sin(b)*((null==v?void 0:v.value)||0)),p&&p instanceof t.DisplayObject&&y&&(n=o.value-l.value,i=a.value-c.value,b=Math.atan2(i,n),w=Math.cos(b)*((null==y?void 0:y.value)||0),x=Math.sin(b)*((null==y?void 0:y.value)||0)),e.moveTo(o.value-u+g,a.value-d+m),e.lineTo(l.value-u+w,c.value-d+x)}function v(e,r){var n=r.defX,i=void 0===n?0:n,o=r.defY,a=void 0===o?0:o,l=r.markerStart,c=r.markerEnd,s=r.markerStartOffset,u=r.markerEndOffset,h=r.path,d=h.zCommandIndexes,f=[].concat(h.curve);d.forEach((function(e,t){f.splice(e+t,1,["Z"])}));var p,v,y="Z"===f[f.length-1][0],g=0,m=0,w=0,x=0,b=0;if(l&&l instanceof t.DisplayObject&&s){var E=l.parentNode.getStartTangent(),R=E[0],C=E[1];p=R[0]-C[0],v=R[1]-C[1],b=Math.atan2(v,p),g=Math.cos(b)*((null==s?void 0:s.value)||0),m=Math.sin(b)*((null==s?void 0:s.value)||0)}if(c&&c instanceof t.DisplayObject&&u){var S=c.parentNode.getEndTangent(),O=S[0],P=S[1];p=O[0]-P[0],v=O[1]-P[1],b=Math.atan2(v,p),w=Math.cos(b)*((null==u?void 0:u.value)||0),x=Math.sin(b)*((null==u?void 0:u.value)||0)}for(var M=0;f.length>M;M++){var k=f[M];switch(k[0]){case"M":e.moveTo(k[1]-i+g,k[2]-a+m);break;case"C":e.bezierCurveTo(k[1]-i,k[2]-a,k[3]-i,k[4]-a,k[5]-i+(M===f.length-(y?2:1)?w:0),k[6]-a+(M===f.length-(y?2:1)?x:0));break;case"Z":e.closePath()}}}function y(e,r){var n,i,o=r.defX,a=void 0===o?0:o,l=r.defY,c=void 0===l?0:l,s=r.markerStart,u=r.markerEnd,h=r.markerStartOffset,d=r.markerEndOffset,f=r.points.points,p=f.length,v=f[0][0]-a,y=f[0][1]-c,g=f[p-1][0]-a,m=f[p-1][1]-c,w=0,x=0,b=0,E=0,R=0;s&&s instanceof t.DisplayObject&&h&&(n=f[1][0]-f[0][0],i=f[1][1]-f[0][1],R=Math.atan2(i,n),w=Math.cos(R)*((null==h?void 0:h.value)||0),x=Math.sin(R)*((null==h?void 0:h.value)||0)),u&&u instanceof t.DisplayObject&&d&&(n=f[p-1][0]-f[0][0],i=f[p-1][1]-f[0][1],R=Math.atan2(i,n),b=Math.cos(R)*((null==d?void 0:d.value)||0),E=Math.sin(R)*((null==d?void 0:d.value)||0)),e.moveTo(v+(w||b),y+(x||E));for(var C=1;p-1>C;C++){var S=f[C];e.lineTo(S[0]-a,S[1]-c)}e.lineTo(g,m)}function g(e,r){var n,i,o=r.defX,a=void 0===o?0:o,l=r.defY,c=void 0===l?0:l,s=r.markerStart,u=r.markerEnd,h=r.markerStartOffset,d=r.markerEndOffset,f=r.points.points,p=f.length,v=f[0][0]-a,y=f[0][1]-c,g=f[p-1][0]-a,m=f[p-1][1]-c,w=0,x=0,b=0,E=0,R=0;s&&s instanceof t.DisplayObject&&h&&(n=f[1][0]-f[0][0],i=f[1][1]-f[0][1],R=Math.atan2(i,n),w=Math.cos(R)*((null==h?void 0:h.value)||0),x=Math.sin(R)*((null==h?void 0:h.value)||0)),u&&u instanceof t.DisplayObject&&d&&(n=f[p-2][0]-f[p-1][0],i=f[p-2][1]-f[p-1][1],R=Math.atan2(i,n),b=Math.cos(R)*((null==d?void 0:d.value)||0),E=Math.sin(R)*((null==d?void 0:d.value)||0)),e.moveTo(v+w,y+x);for(var C=1;p-1>C;C++){var S=f[C];e.lineTo(S[0]-a,S[1]-c)}e.lineTo(g+b,m+E)}function m(e,r){var n=r.radius,i=r.width,o=r.height,a=i.value,l=o.value;if(n&&n.some((function(e){return 0!==e.value}))){var c=i.value>0?1:-1,s=o.value>0?1:-1,u=c+s===0,h=n.map((function(e){return t.clamp(e.value,0,Math.min(Math.abs(a)/2,Math.abs(l)/2))})),d=h[0],f=h[1],p=h[2],v=h[3];e.moveTo(c*d,0),e.lineTo(a-c*f,0),0!==f&&e.arc(a-c*f,s*f,f,-s*Math.PI/2,c>0?0:Math.PI,u),e.lineTo(a,l-s*p),0!==p&&e.arc(a-c*p,l-s*p,p,c>0?0:Math.PI,s>0?Math.PI/2:1.5*Math.PI,u),e.lineTo(c*v,l),0!==v&&e.arc(c*v,l-s*v,v,s>0?Math.PI/2:-Math.PI/2,c>0?Math.PI:0,u),e.lineTo(0,s*d),0!==d&&e.arc(c*d,s*d,d,c>0?Math.PI:0,s>0?1.5*Math.PI:Math.PI/2,u)}else e.rect(0,0,a,l)}t.Module((function(e){e({token:{token:h,named:t.Shape.CIRCLE},useValue:d}),e({token:{token:h,named:t.Shape.ELLIPSE},useValue:f}),e({token:{token:h,named:t.Shape.RECT},useValue:m}),e({token:{token:h,named:t.Shape.LINE},useValue:p}),e({token:{token:h,named:t.Shape.POLYLINE},useValue:g}),e({token:{token:h,named:t.Shape.POLYGON},useValue:y}),e({token:{token:h,named:t.Shape.PATH},useValue:v}),e({token:u,useFactory:function(e){return function(t){return e.container.isBoundNamed(h,t)?e.container.getNamed(h,t):null}}})}));var w="undefined"!=typeof Float32Array?Float32Array:Array;function x(){var e=new w(16);return w!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function b(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function E(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],l=t[4],c=t[5],s=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],v=t[12],y=t[13],g=t[14],m=t[15],w=r[0],x=r[1],b=r[2],E=r[3];return e[0]=w*n+x*l+b*h+E*v,e[1]=w*i+x*c+b*d+E*y,e[2]=w*o+x*s+b*f+E*g,e[3]=w*a+x*u+b*p+E*m,e[4]=(w=r[4])*n+(x=r[5])*l+(b=r[6])*h+(E=r[7])*v,e[5]=w*i+x*c+b*d+E*y,e[6]=w*o+x*s+b*f+E*g,e[7]=w*a+x*u+b*p+E*m,e[8]=(w=r[8])*n+(x=r[9])*l+(b=r[10])*h+(E=r[11])*v,e[9]=w*i+x*c+b*d+E*y,e[10]=w*o+x*s+b*f+E*g,e[11]=w*a+x*u+b*p+E*m,e[12]=(w=r[12])*n+(x=r[13])*l+(b=r[14])*h+(E=r[15])*v,e[13]=w*i+x*c+b*d+E*y,e[14]=w*o+x*s+b*f+E*g,e[15]=w*a+x*u+b*p+E*m,e}function R(e,t,r){var n,i,o,a,l,c,s,u,h,d,f,p,v=r[0],y=r[1],g=r[2];return t===e?(e[12]=t[0]*v+t[4]*y+t[8]*g+t[12],e[13]=t[1]*v+t[5]*y+t[9]*g+t[13],e[14]=t[2]*v+t[6]*y+t[10]*g+t[14],e[15]=t[3]*v+t[7]*y+t[11]*g+t[15]):(i=t[1],o=t[2],a=t[3],l=t[4],c=t[5],s=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=n=t[0],e[1]=i,e[2]=o,e[3]=a,e[4]=l,e[5]=c,e[6]=s,e[7]=u,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=n*v+l*y+h*g+t[12],e[13]=i*v+c*y+d*g+t[13],e[14]=o*v+s*y+f*g+t[14],e[15]=a*v+u*y+p*g+t[15]),e}function C(){var e=new w(3);return w!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function S(e,t,r){var n=new w(3);return n[0]=e,n[1]=t,n[2]=r,n}function O(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/(a=a||1),e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});P=C();var P,M=t.Syringe.defineToken("StyleRendererFactory"),k=t.Syringe.defineToken("CircleRenderer",{multiple:!1}),L=t.Syringe.defineToken("EllipseRenderer",{multiple:!1}),T=t.Syringe.defineToken("RectRenderer",{multiple:!1}),A=t.Syringe.defineToken("LineRenderer",{multiple:!1}),N=t.Syringe.defineToken("PolylineRenderer",{multiple:!1}),j=t.Syringe.defineToken("PolygonRenderer",{multiple:!1}),B=t.Syringe.defineToken("PathRenderer",{multiple:!1}),I=t.Syringe.defineToken("TextRenderer",{multiple:!1}),G=t.Syringe.defineToken("ImageRenderer",{multiple:!1});function F(){
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=Object.create((e&&e.prototype instanceof f?e:f).prototype),o=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return R()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===u)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 s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,o),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var u={};function f(){}function d(){}function p(){}var v={};s(v,o,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(O([])));g&&g!==e&&n.call(g,o)&&(v=g);var m=p.prototype=f.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,c){var s=l(t[i],t,o);if("throw"!==s.type){var h=s.arg,u=h.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(u).then((function(t){h.value=t,a(h)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}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 u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,u;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,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 r=-1,i=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 i.next=i}}return{next:R}}function R(){return{value:void 0,done:!0}}return d.prototype=p,s(m,"constructor",p),s(p,"constructor",d),d.displayName=s(p,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(x.prototype),s(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new x(h(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),s(m,c,"Generator"),s(m,o,(function(){return this})),s(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,S.prototype={constructor:S,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(C),!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 i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,u):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),u},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),C(r),u}},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 i=n.arg;C(r)}return i}}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),u}},t}function n(t,e,r,n,i,o,a){try{var c=t[o](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,i)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function c(t){n(a,i,o,c,s,"next",t)}function s(t){n(a,i,o,c,s,"throw",t)}c(void 0)}))}}function o(){return o=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},o.apply(this,arguments)}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,c(t,e)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function s(t,e,r,n){var i,o=arguments.length,a=3>o?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--)(i=t[c])&&(a=(3>o?i(a):o>3?i(e,r,a):i(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a}function h(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}var l=e.Syringe.defineToken(""),u=e.Syringe.defineToken("");function f(t,e){var r=e.r;t.arc(r,r,r,0,2*Math.PI,!1)}function d(t,e){var r=e.rx,n=e.ry;if(t.ellipse)t.ellipse(r,n,r,n,0,0,2*Math.PI,!1);else{var i=r>n?r:n,o=r>n?1:r/n,a=r>n?n/r:1;t.save(),t.scale(o,a),t.arc(0,0,i,0,2*Math.PI)}}function p(t,r){var n,i,o=r.x1,a=r.y1,c=r.x2,s=r.y2,h=r.defX,l=void 0===h?0:h,u=r.defY,f=void 0===u?0:u,d=r.markerStart,p=r.markerEnd,v=r.markerStartOffset,y=r.markerEndOffset,g=0,m=0,w=0,x=0,b=0;d&&d instanceof e.DisplayObject&&v&&(n=c-o,i=s-a,b=Math.atan2(i,n),g=Math.cos(b)*(v||0),m=Math.sin(b)*(v||0)),p&&p instanceof e.DisplayObject&&y&&(n=o-c,i=a-s,b=Math.atan2(i,n),w=Math.cos(b)*(y||0),x=Math.sin(b)*(y||0)),t.moveTo(o-l+g,a-f+m),t.lineTo(c-l+w,s-f+x)}function v(t,r){var n=r.defX,i=void 0===n?0:n,o=r.defY,a=void 0===o?0:o,c=r.markerStart,s=r.markerEnd,h=r.markerStartOffset,l=r.markerEndOffset,u=r.path,f=u.zCommandIndexes,d=[].concat(u.curve);f.forEach((function(t,e){d.splice(t+e,1,["Z"])}));var p,v,y=d.length&&"Z"===d[d.length-1][0],g=0,m=0,w=0,x=0,b=0;if(c&&c instanceof e.DisplayObject&&h){var E=c.parentNode.getStartTangent(),C=E[0],S=E[1];p=C[0]-S[0],v=C[1]-S[1],b=Math.atan2(v,p),g=Math.cos(b)*(h||0),m=Math.sin(b)*(h||0)}if(s&&s instanceof e.DisplayObject&&l){var O=s.parentNode.getEndTangent(),R=O[0],M=O[1];p=R[0]-M[0],v=R[1]-M[1],b=Math.atan2(v,p),w=Math.cos(b)*(l||0),x=Math.sin(b)*(l||0)}for(var P=0;d.length>P;P++){var L=d[P];switch(L[0]){case"M":t.moveTo(L[1]-i+g,L[2]-a+m);break;case"C":t.bezierCurveTo(L[1]-i,L[2]-a,L[3]-i,L[4]-a,L[5]-i+(P===d.length-(y?2:1)?w:0),L[6]-a+(P===d.length-(y?2:1)?x:0));break;case"Z":t.closePath()}}}function y(t,r){var n,i,o=r.defX,a=void 0===o?0:o,c=r.defY,s=void 0===c?0:c,h=r.markerStart,l=r.markerEnd,u=r.markerStartOffset,f=r.markerEndOffset,d=r.points.points,p=d.length,v=d[0][0]-a,y=d[0][1]-s,g=d[p-1][0]-a,m=d[p-1][1]-s,w=0,x=0,b=0,E=0,C=0;h&&h instanceof e.DisplayObject&&u&&(n=d[1][0]-d[0][0],i=d[1][1]-d[0][1],C=Math.atan2(i,n),w=Math.cos(C)*(u||0),x=Math.sin(C)*(u||0)),l&&l instanceof e.DisplayObject&&f&&(n=d[p-1][0]-d[0][0],i=d[p-1][1]-d[0][1],C=Math.atan2(i,n),b=Math.cos(C)*(f||0),E=Math.sin(C)*(f||0)),t.moveTo(v+(w||b),y+(x||E));for(var S=1;p-1>S;S++){var O=d[S];t.lineTo(O[0]-a,O[1]-s)}t.lineTo(g,m)}function g(t,r){var n,i,o=r.defX,a=void 0===o?0:o,c=r.defY,s=void 0===c?0:c,h=r.markerStart,l=r.markerEnd,u=r.markerStartOffset,f=r.markerEndOffset,d=r.points.points,p=d.length,v=d[0][0]-a,y=d[0][1]-s,g=d[p-1][0]-a,m=d[p-1][1]-s,w=0,x=0,b=0,E=0,C=0;h&&h instanceof e.DisplayObject&&u&&(n=d[1][0]-d[0][0],i=d[1][1]-d[0][1],C=Math.atan2(i,n),w=Math.cos(C)*(u||0),x=Math.sin(C)*(u||0)),l&&l instanceof e.DisplayObject&&f&&(n=d[p-2][0]-d[p-1][0],i=d[p-2][1]-d[p-1][1],C=Math.atan2(i,n),b=Math.cos(C)*(f||0),E=Math.sin(C)*(f||0)),t.moveTo(v+w,y+x);for(var S=1;p-1>S;S++){var O=d[S];t.lineTo(O[0]-a,O[1]-s)}t.lineTo(g+b,m+E)}function m(t,r){var n=r.radius,i=r.width,o=r.height,a=i,c=o;if(n&&n.some((function(t){return 0!==t}))){var s=i>0?1:-1,h=o>0?1:-1,l=s+h===0,u=n.map((function(t){return e.clamp(t,0,Math.min(Math.abs(a)/2,Math.abs(c)/2))})),f=u[0],d=u[1],p=u[2],v=u[3];t.moveTo(s*f,0),t.lineTo(a-s*d,0),0!==d&&t.arc(a-s*d,h*d,d,-h*Math.PI/2,s>0?0:Math.PI,l),t.lineTo(a,c-h*p),0!==p&&t.arc(a-s*p,c-h*p,p,s>0?0:Math.PI,h>0?Math.PI/2:1.5*Math.PI,l),t.lineTo(s*v,c),0!==v&&t.arc(s*v,c-h*v,v,h>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,l),t.lineTo(0,h*f),0!==f&&t.arc(s*f,h*f,f,s>0?Math.PI:0,h>0?1.5*Math.PI:Math.PI/2,l)}else t.rect(0,0,a,c)}e.Module((function(t){t({token:{token:u,named:e.Shape.CIRCLE},useValue:f}),t({token:{token:u,named:e.Shape.ELLIPSE},useValue:d}),t({token:{token:u,named:e.Shape.RECT},useValue:m}),t({token:{token:u,named:e.Shape.LINE},useValue:p}),t({token:{token:u,named:e.Shape.POLYLINE},useValue:g}),t({token:{token:u,named:e.Shape.POLYGON},useValue:y}),t({token:{token:u,named:e.Shape.PATH},useValue:v}),t({token:l,useFactory:function(t){return function(e){return t.container.isBoundNamed(u,e)?t.container.getNamed(u,e):null}}})}));var w="undefined"!=typeof Float32Array?Float32Array:Array;function x(){var t=new w(16);return w!=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 b(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 E(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],c=e[4],s=e[5],h=e[6],l=e[7],u=e[8],f=e[9],d=e[10],p=e[11],v=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*u+E*v,t[1]=w*i+x*s+b*f+E*y,t[2]=w*o+x*h+b*d+E*g,t[3]=w*a+x*l+b*p+E*m,t[4]=(w=r[4])*n+(x=r[5])*c+(b=r[6])*u+(E=r[7])*v,t[5]=w*i+x*s+b*f+E*y,t[6]=w*o+x*h+b*d+E*g,t[7]=w*a+x*l+b*p+E*m,t[8]=(w=r[8])*n+(x=r[9])*c+(b=r[10])*u+(E=r[11])*v,t[9]=w*i+x*s+b*f+E*y,t[10]=w*o+x*h+b*d+E*g,t[11]=w*a+x*l+b*p+E*m,t[12]=(w=r[12])*n+(x=r[13])*c+(b=r[14])*u+(E=r[15])*v,t[13]=w*i+x*s+b*f+E*y,t[14]=w*o+x*h+b*d+E*g,t[15]=w*a+x*l+b*p+E*m,t}function C(t,e,r){var n,i,o,a,c,s,h,l,u,f,d,p,v=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(i=e[1],o=e[2],a=e[3],c=e[4],s=e[5],h=e[6],l=e[7],u=e[8],f=e[9],d=e[10],p=e[11],t[0]=n=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=c,t[5]=s,t[6]=h,t[7]=l,t[8]=u,t[9]=f,t[10]=d,t[11]=p,t[12]=n*v+c*y+u*g+e[12],t[13]=i*v+s*y+f*g+e[13],t[14]=o*v+h*y+d*g+e[14],t[15]=a*v+l*y+p*g+e[15]),t}function S(){var t=new w(3);return w!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function O(t,e,r){var n=new w(3);return n[0]=t,n[1]=e,n[2]=r,n}function R(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+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)});M=S();var M,P=e.Syringe.defineToken(""),L=e.Syringe.defineToken("",{multiple:!1}),k=e.Syringe.defineToken("",{multiple:!1}),T=e.Syringe.defineToken("",{multiple:!1}),A=e.Syringe.defineToken("",{multiple:!1}),N=e.Syringe.defineToken("",{multiple:!1}),j=e.Syringe.defineToken("",{multiple:!1}),B=e.Syringe.defineToken("",{multiple:!1}),I=e.Syringe.defineToken("",{multiple:!1}),G=e.Syringe.defineToken("",{multiple:!1});function F(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
F=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=Object.create((t&&t.prototype instanceof h?t:h).prototype),o=new R(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return S()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var l=x(a,r);if(l){if(l===u)continue;return l}}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 c=s(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,o),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function h(){}function d(){}function f(){}var p={};l(p,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==t&&r.call(y,i)&&(p=y);var g=f.prototype=h.prototype=Object.create(p);function m(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function n(i,o,a,l){var c=s(e[i],e,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(h).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,l)}))}l(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function x(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=s(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,u;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function C(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return d.prototype=f,l(g,"constructor",f),l(f,"constructor",d),d.displayName=l(f,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},m(w.prototype),l(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new w(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(g),l(g,a,"Generator"),l(g,i,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=C,R.prototype={constructor:R,reset:function(e){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),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(this.prev>=o.tryLoc){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(o.catchLoc>this.prev)return n(o.catchLoc,!0);if(o.finallyLoc>this.prev)return n(o.finallyLoc)}else if(l){if(o.catchLoc>this.prev)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(this.prev>=i.tryLoc&&r.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===e||"continue"===e)&&t>=o.tryLoc&&o.finallyLoc>=t&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function D(e,t,r,n,i,o,a){try{var l=e[o](a),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,i)}function _(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){D(o,n,i,a,l,"next",e)}function l(e){D(o,n,i,a,l,"throw",e)}a(void 0)}))}}var V,Y,U=function(){function e(){this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=void 0}var r=e.prototype;return r.getImageSync=function(e,t){return this.imageCache[e]?t&&t():this.getOrCreateImage(e).then((function(){t&&t()})),this.imageCache[e]},r.getOrCreateImage=function(e){var r=this;if(this.imageCache[e])return Promise.resolve(this.imageCache[e]);var n=this.canvasConfig.createImage;return new Promise((function(i,o){var a;n?a=n(e):t.isBrowser&&(a=new window.Image),a&&(a.onload=function(){i(a)},a.onerror=function(e){o(e)},a.crossOrigin="Anonymous",a.src=e,r.imageCache[e]=a)}))},r.getOrCreatePatternSync=function(e,r,n){var i=this.generatePatternKey(e);if(i&&this.patternCache[i])return this.patternCache[i];var o,a=e.image,l=e.repetition,c=(o=t.isString(a)?this.getImageSync(a,n):a)&&r.createPattern(o,l);return i&&c&&(this.patternCache[i]=c),c},r.getOrCreateGradient=function(e,r){var n=this.generateGradientKey(e),i=e.type,o=e.steps,a=e.width,l=e.height,c=e.cx,s=e.cy;if(this.gradientCache[n])return this.gradientCache[n];var u=null;if(i===t.GradientType.LinearGradient){var h=t.computeLinearGradient(a,l,e.angle);u=r.createLinearGradient(h.x1,h.y1,h.x2,h.y2)}else if(i===t.GradientType.RadialGradient){var d=t.computeRadialGradient(a,l,c,s),f=d.x,p=d.y;u=r.createRadialGradient(f,p,0,f,p,d.r)}return u&&(o.forEach((function(e){var t;null===(t=u)||void 0===t||t.addColorStop(e[0],e[1])})),this.gradientCache[n]=u),this.gradientCache[n]},r.generateGradientKey=function(e){return"gradient-"+e.type+"-"+(e.angle||0)+"-"+(e.cx||0)+"-"+(e.cy||0)+"-"+e.width+"-"+e.height+"-"+e.steps.map((function(e){return e.join("")})).join("-")},r.generatePatternKey=function(e){var r=e.image,n=e.repetition;if(t.isString(r))return"pattern-"+r+"-"+n},e}();c([t.inject(t.CanvasConfig),s("design:type",Object)],U.prototype,"canvasConfig",void 0),U=c([t.singleton()],U);var X=(V=function(){function e(){this.imagePool=void 0,this.renderingContext=void 0}return e.prototype.apply=function(e){var r=this,n=function(n){var i=n.target;if(i.nodeName===t.Shape.IMAGE){var o=i.attributes.img;t.isString(o)&&r.imagePool.getImageSync(o,(function(){i.renderable.dirty=!0,e.dirtify()}))}},i=function(n){var i=n.target,o=n.newValue;i.nodeName===t.Shape.IMAGE&&"img"===n.attrName&&t.isString(o)&&r.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,e.dirtify()}))};e.hooks.init.tapPromise(Y.tag,_(F().mark((function e(){return F().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(t.ElementEvent.ATTR_MODIFIED,i);case 2:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(Y.tag,(function(){r.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(t.ElementEvent.ATTR_MODIFIED,i)}))},e}(),V.tag="LoadImage",Y=V);c([t.inject(U),s("design:type",U)],X.prototype,"imagePool",void 0),c([t.inject(t.RenderingContext),s("design:type",Object)],X.prototype,"renderingContext",void 0),X=Y=c([t.singleton({contrib:t.RenderingPluginContribution})],X);t.Module((function(e){e(U),e(X)}));var W=function(){function e(){this.imagePool=void 0}var r=e.prototype;return r.render=function(e,r,n,i){var o=r.fill,a=r.opacity,l=r.fillOpacity,c=r.stroke,s=r.strokeOpacity,u=r.lineWidth,h=r.lineCap,d=r.lineJoin,f=r.shadowType,p=r.shadowColor,v=r.shadowBlur,y=r.filter,g=r.miterLimit,m=!t.isNil(o)&&!o.isNone,w=!t.isNil(c)&&!c.isNone&&u&&u.value>0,x=0===o.alpha,b=!t.isNil(y),E=!t.isNil(p)&&(null==v?void 0:v.value)>0,R=n.nodeName,C="inner"===(null==f?void 0:f.value),S=w&&E&&(R===t.Shape.PATH||R===t.Shape.LINE||R===t.Shape.POLYLINE||x||C);m&&(e.globalAlpha=a.value*l.value,S||Q(n,e,E),this.fill(e,n,o,i),S||this.clearShadowAndFilter(e,b,E)),w&&(e.globalAlpha=a.value*s.value,e.lineWidth=u.value,t.isNil(g)||(e.miterLimit=g.value),t.isNil(h)||(e.lineCap=h.value),t.isNil(d)||(e.lineJoin=d.value),S&&(C&&(e.globalCompositeOperation="source-atop"),Q(n,e,!0),C&&(this.stroke(e,n,c,i),e.globalCompositeOperation="source-over",this.clearShadowAndFilter(e,b,!0))),this.stroke(e,n,c,i))},r.clearShadowAndFilter=function(e,r,n){if(n&&(e.shadowColor="transparent",e.shadowBlur=0),r){var i=e.filter;!t.isNil(i)&&i.indexOf("drop-shadow")>-1&&(e.filter=i.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},r.fill=function(e,r,n,i){var o=this;Array.isArray(n)?n.forEach((function(t){e.fillStyle=o.getColor(t,r,e),e.fill()})):(t.isPattern(n)&&(e.fillStyle=this.getPattern(n,r,e,i)),e.fill())},r.stroke=function(e,r,n,i){var o=this;Array.isArray(n)?n.forEach((function(t){e.strokeStyle=o.getColor(t,r,e),e.stroke()})):(t.isPattern(n)&&(e.strokeStyle=this.getPattern(n,r,e,i)),e.stroke())},r.getPattern=function(e,t,r,n){return this.imagePool.getOrCreatePatternSync(e,r,(function(){t.renderable.dirty=!0,n.dirtify()}))},r.getColor=function(e,r,n){var i;if(e.type===t.GradientType.LinearGradient||e.type===t.GradientType.RadialGradient){var a=r.getGeometryBounds();i=this.imagePool.getOrCreateGradient(o({type:e.type},e.value,{width:a&&2*a.halfExtents[0]||1,height:a&&2*a.halfExtents[1]||1}),n)}return i},e}();function Q(e,r,n){var i=e.parsedStyle,o=i.shadowColor,a=i.shadowBlur,l=i.shadowOffsetX,c=i.shadowOffsetY;t.isNil(i.filter)||(r.filter=e.style.filter),n&&(r.shadowColor=o.toString(),r.shadowBlur=a&&a.value||0,r.shadowOffsetX=l&&l.value||0,r.shadowOffsetY=c&&c.value||0)}c([t.inject(U),s("design:type",U)],W.prototype,"imagePool",void 0),W=c([t.singleton()],W),e.ImageRenderer=function(){function e(){this.imagePool=void 0}return e.prototype.render=function(e,r,n){var i,o=r.img,a=r.shadowColor,l=r.shadowBlur,c=r.width.value,s=r.height.value;if(t.isString(o)?i=this.imagePool.getImageSync(o):(c||(c=o.width),s||(s=o.height),i=o),i){Q(n,e,!t.isNil(a)&&(null==l?void 0:l.value)>0);try{e.drawImage(i,0,0,c,s)}catch(e){}}},e}(),c([t.inject(U),s("design:type",U)],e.ImageRenderer.prototype,"imagePool",void 0),e.ImageRenderer=c([t.singleton({token:G})],e.ImageRenderer),e.TextRenderer=function(){function e(){}var r=e.prototype;return r.render=function(e,r,n){var i=r.lineWidth,o=r.textAlign,a=r.textBaseline,l=r.lineJoin,c=r.miterLimit,s=r.letterSpacing,u=r.stroke,h=r.fill,d=r.fillOpacity,f=r.strokeOpacity,p=r.opacity,v=r.metrics,y=r.dx,g=r.dy,m=r.shadowColor,w=r.shadowBlur,x=v.lines,b=v.height,E=v.lineHeight,R=v.lineMetrics;e.font=v.font,e.lineWidth=i.value,e.textAlign=o.value,e.textBaseline=a.value,e.lineJoin=l.value,t.isNil(c)||(e.miterLimit=c.value);var C=0;"middle"===a.value?C=-b/2-E/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?C=-b:"top"!==a.value&&"hanging"!==a.value||(C=-E);var S=0;y&&y.unit===t.UnitType.kPixels&&(S+=y.value),g&&g.unit===t.UnitType.kPixels&&(C+=g.value),Q(n,e,!t.isNil(m)&&(null==w?void 0:w.value)>0);for(var O=0;x.length>O;O++){var P=i.value/2+S;C+=E,!t.isNil(u)&&!u.isNone&&i&&i.value&&this.drawLetterSpacing(e,x[O],R[O],o.value,P,C,s.value,d.value,f.value,p.value,!0),t.isNil(h)||this.drawLetterSpacing(e,x[O],R[O],o.value,P,C,s.value,d.value,f.value,p.value)}},r.drawLetterSpacing=function(e,t,r,n,i,o,a,l,c,s,u){if(void 0===u&&(u=!1),0!==a){var h=e.textAlign;e.textAlign="left";var d=i;"center"===n?d=i-r.width/2:"right"!==n&&"end"!==n||(d=i-r.width);for(var f=Array.from(t),p=e.measureText(t).width,v=0,y=0;f.length>y;++y){var g=f[y];u?this.strokeText(e,g,d,o,c):this.fillText(e,g,d,o,l,s),d+=p-(v=e.measureText(t.substring(y+1)).width)+a,p=v}e.textAlign=h}else u?this.strokeText(e,t,i,o,c):this.fillText(e,t,i,o,l,s)},r.fillText=function(e,r,n,i,o,a){var l,c=!t.isNil(o)&&1!==o;c&&(l=e.globalAlpha,e.globalAlpha=o*a),e.fillText(r,n,i),c&&(e.globalAlpha=l)},r.strokeText=function(e,r,n,i,o){var a,l=!t.isNil(o)&&1!==o;l&&(a=e.globalAlpha,e.globalAlpha=o),e.strokeText(r,n,i),l&&(e.globalAlpha=a)},e}(),e.TextRenderer=c([t.singleton({token:I})],e.TextRenderer),e.RectRenderer=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t}(W),e.RectRenderer=c([t.singleton({token:T})],e.RectRenderer),e.CircleRenderer=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t}(W),e.CircleRenderer=c([t.singleton({token:k})],e.CircleRenderer),e.EllipseRenderer=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t}(W),e.EllipseRenderer=c([t.singleton({token:L})],e.EllipseRenderer),e.LineRenderer=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t}(W),e.LineRenderer=c([t.singleton({token:A})],e.LineRenderer),e.PolylineRenderer=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t}(W),e.PolylineRenderer=c([t.singleton({token:N})],e.PolylineRenderer),e.PolygonRenderer=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t}(W),e.PolygonRenderer=c([t.singleton({token:j})],e.PolygonRenderer),e.PathRenderer=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t}(W),e.PathRenderer=c([t.singleton({token:B})],e.PathRenderer);var H,J,K=t.Syringe.defineToken("CanvasRendererPluginOptions"),Z=(H=function(){function e(){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=x(),this.dprMatrix=x(),this.tmpMat4=x(),this.tmpVec3=C()}var n=e.prototype;return n.apply=function(e){var n=this,o=this.renderingContext.root.ownerDocument.defaultView,a=function(e){var t=e.target.rBushNode;t.aabb&&n.removedRBushNodeAABBs.push(t.aabb)},l=function(e){var t=e.target.rBushNode;t.aabb&&n.removedRBushNodeAABBs.push(t.aabb)};e.hooks.init.tapPromise(J.tag,i(r().mark((function e(){var i,o,c,s,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.addEventListener(t.ElementEvent.CULLED,l),i=n.contextService.getDPR(),c=(o=n.canvasConfig).width,s=o.height,u=n.contextService.getContext(),n.clearRect(u,0,0,c*i,s*i),r=n.dprMatrix,h=S(i,i,1),r[0]=h[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=h[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=h[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1;case 7:case"end":return e.stop()}var r,h}),e)})))),e.hooks.destroy.tap(J.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.removeEventListener(t.ElementEvent.CULLED,l)})),e.hooks.beginFrame.tap(J.tag,(function(){var t=n.contextService.getContext(),r=n.contextService.getDPR(),i=n.canvasConfig,o=i.width,a=i.height,l=n.canvasRendererPluginOptions,c=l.dirtyObjectNumThreshold,s=l.dirtyObjectRatioThreshold,u=e.getStats(),h=u.rendered,d=h/u.total;n.clearFullScreen=e.disableDirtyRectangleRendering()||h>c&&d>s,t&&(t.resetTransform(),n.clearFullScreen&&n.clearRect(t,0,0,o*r,a*r))}));var c=function t(r){r.isVisible()&&!r.isCulled()&&(n.renderDisplayObject(r,e),n.saveDirtyAABB(r)),r.sortable.sorted&&r.sortable.sorted.length&&r.sortable.sorted.forEach((function(e){t(e)}))};e.hooks.endFrame.tap(J.tag,(function(){var r=n.contextService.getContext();if(E(n.vpMatrix,n.dprMatrix,n.camera.getOrthoMatrix()),n.clearFullScreen)c(n.renderingContext.root);else{var i=n.safeMergeAABB.apply(n,[n.mergeDirtyAABBs(n.renderQueue)].concat(n.removedRBushNodeAABBs.map((function(e){var r=e.minX,n=e.minY,i=e.maxX,o=e.maxY,a=new t.AABB;return a.setMinMax(S(r,n,0),S(i,o,0)),a}))));if(n.removedRBushNodeAABBs=[],t.AABB.isEmpty(i))return void(n.renderQueue=[]);var a=n.convertAABB2Rect(i),l=a.x,s=a.y,u=a.width,h=a.height,d=O(n.tmpVec3,S(l,s,0),n.vpMatrix),f=O(C(),S(l+u,s+h,0),n.vpMatrix),p=Math.floor(d[0]),v=Math.floor(d[1]),y=Math.ceil(f[0]-d[0]),g=Math.ceil(f[1]-d[1]);r.save(),n.clearRect(r,p,v,y,g),r.beginPath(),r.rect(p,v,y,g),r.clip(),r.setTransform(n.vpMatrix[0],n.vpMatrix[1],n.vpMatrix[4],n.vpMatrix[5],n.vpMatrix[12],n.vpMatrix[13]),n.canvasConfig.renderer.getConfig().enableDirtyRectangleRenderingDebug&&o.dispatchEvent(new t.CustomEvent(t.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:a})),n.searchDirtyObjects(i).sort((function(e,t){return e.sortable.renderOrder-t.sortable.renderOrder})).forEach((function(t){t&&t.isVisible()&&!t.isCulled()&&n.renderDisplayObject(t,e)})),r.restore(),n.renderQueue.forEach((function(e){n.saveDirtyAABB(e)})),n.renderQueue=[]}n.restoreStack.forEach((function(){r.restore()})),n.restoreStack=[]})),e.hooks.render.tap(J.tag,(function(e){n.clearFullScreen||n.renderQueue.push(e)}))},n.clearRect=function(e,t,r,n,i){e.clearRect(t,r,n,i);var o=this.canvasConfig.background;o&&(e.fillStyle=o,e.fillRect(t,r,n,i))},n.renderDisplayObject=function(e,r){var n=this.contextService.getContext(),i=e.nodeName,o=this.restoreStack[this.restoreStack.length-1];!o||e.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINS||(n.restore(),this.restoreStack.pop()),void 0===this.styleRendererFactoryCache[i]&&(this.styleRendererFactoryCache[i]=this.styleRendererFactory(i));var a=this.styleRendererFactoryCache[i];void 0===this.pathGeneratorFactoryCache[i]&&(this.pathGeneratorFactoryCache[i]=this.pathGeneratorFactory(i));var l=this.pathGeneratorFactoryCache[i],c=e.parsedStyle.clipPath;if(c){this.applyWorldTransform(n,c,e.getWorldTransform()),void 0===this.pathGeneratorFactoryCache[c.nodeName]&&(this.pathGeneratorFactoryCache[c.nodeName]=this.pathGeneratorFactory(c.nodeName));var s=this.pathGeneratorFactoryCache[c.nodeName];s&&(n.save(),this.restoreStack.push(e),n.beginPath(),s(n,c.parsedStyle),n.closePath(),n.clip())}a&&(this.applyWorldTransform(n,e),n.save(),this.applyAttributesToContext(n,e)),l&&(n.beginPath(),l(n,e.parsedStyle),e.nodeName!==t.Shape.LINE&&e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&n.closePath()),a&&(a.render(n,e.parsedStyle,e,r),n.restore()),e.renderable.dirty=!1},n.convertAABB2Rect=function(e){var t=e.getMin(),r=e.getMax(),n=Math.floor(t[0]),i=Math.floor(t[1]);return{x:n,y:i,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-i}},n.mergeDirtyAABBs=function(e){var r=new t.AABB;return e.forEach((function(e){var t=e.getRenderBounds();r.add(t);var n=e.renderable.dirtyRenderBounds;n&&r.add(n)})),r},n.searchDirtyObjects=function(e){var t=this,r=e.getMin(),n=r[0],i=r[1],o=e.getMax();return this.rBush.search({minX:n,minY:i,maxX:o[0],maxY:o[1]}).map((function(e){return t.displayObjectPool.getByEntity(e.id)}))},n.saveDirtyAABB=function(e){var r=e.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new t.AABB);var n=e.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},n.applyAttributesToContext=function(e,r){var n=r.parsedStyle,i=n.stroke,o=n.fill,a=n.opacity,l=n.lineDash,c=n.lineDashOffset;l&&Array.isArray(l)&&e.setLineDash(l.map((function(e){return e.value}))),t.isNil(c)||(e.lineDashOffset=c.value),t.isNil(a)||(e.globalAlpha*=a.value),t.isNil(i)||Array.isArray(i)||i.isNone||(e.strokeStyle=r.attributes.stroke),t.isNil(o)||Array.isArray(o)||o.isNone||(e.fillStyle=r.attributes.fill)},n.applyWorldTransform=function(e,t,r){var n=0,i=0,o=(t.parsedStyle||{}).anchor,a=o&&o[0].value||0,l=o&&o[1].value||0;if(0!==a||0!==l){var c=t.getGeometryBounds();n=-a*(c&&2*c.halfExtents[0]||0),i=-l*(c&&2*c.halfExtents[1]||0)}r?(b(this.tmpMat4,t.getLocalTransform()),this.tmpVec3[0]=n,this.tmpVec3[1]=i,this.tmpVec3[2]=0,R(this.tmpMat4,this.tmpMat4,this.tmpVec3),E(this.tmpMat4,r,this.tmpMat4),E(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(b(this.tmpMat4,t.getWorldTransform()),this.tmpVec3[0]=n,this.tmpVec3[1]=i,this.tmpVec3[2]=0,R(this.tmpMat4,this.tmpMat4,this.tmpVec3),E(this.tmpMat4,this.vpMatrix,this.tmpMat4)),e.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},n.safeMergeAABB=function(){for(var e=new t.AABB,r=arguments.length,n=new Array(r),i=0;r>i;i++)n[i]=arguments[i];return n.forEach((function(t){e.add(t)})),e},e}(),H.tag="CanvasRenderer",J=H);c([t.inject(t.CanvasConfig),s("design:type",Object)],Z.prototype,"canvasConfig",void 0),c([t.inject(t.DefaultCamera),s("design:type",t.Camera)],Z.prototype,"camera",void 0),c([t.inject(t.ContextService),s("design:type",Object)],Z.prototype,"contextService",void 0),c([t.inject(t.RenderingContext),s("design:type",Object)],Z.prototype,"renderingContext",void 0),c([t.inject(u),s("design:type",Function)],Z.prototype,"pathGeneratorFactory",void 0),c([t.inject(M),s("design:type",Function)],Z.prototype,"styleRendererFactory",void 0),c([t.inject(t.DisplayObjectPool),s("design:type",t.DisplayObjectPool)],Z.prototype,"displayObjectPool",void 0),c([t.inject(K),s("design:type",Object)],Z.prototype,"canvasRendererPluginOptions",void 0),c([t.inject(t.RBushRoot),s("design:type",t.RBush)],Z.prototype,"rBush",void 0),Z=J=c([t.singleton({contrib:t.RenderingPluginContribution})],Z);var q=t.Module((function(r){var n;r(e.CircleRenderer),r(e.EllipseRenderer),r(e.RectRenderer),r(e.ImageRenderer),r(e.TextRenderer),r(e.LineRenderer),r(e.PolylineRenderer),r(e.PolygonRenderer),r(e.PathRenderer);var i=((n={})[t.Shape.CIRCLE]=k,n[t.Shape.ELLIPSE]=L,n[t.Shape.RECT]=T,n[t.Shape.IMAGE]=G,n[t.Shape.TEXT]=I,n[t.Shape.LINE]=A,n[t.Shape.POLYLINE]=N,n[t.Shape.POLYGON]=j,n[t.Shape.PATH]=B,n);r({token:M,useFactory:function(e){return function(t){var r=i[t];return r&&e.container.isBound(r)?e.container.get(r):null}}}),r(Z)})),z=function(e){function t(t){var r;return void 0===t&&(t={}),(r=e.call(this)||this).options=void 0,r.name="canvas-renderer",r.options=t,r}a(t,e);var r=t.prototype;return r.init=function(){this.container.register(K,{useValue:o({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options)}),this.container.load(q,!0)},r.destroy=function(){this.container.unload(q),this.container.remove(K)},t}(t.AbstractRendererPlugin);e.CircleRendererContribution=k,e.EllipseRendererContribution=L,e.ImageRendererContribution=G,e.LineRendererContribution=A,e.PathRendererContribution=B,e.Plugin=z,e.PolygonRendererContribution=j,e.PolylineRendererContribution=N,e.RectRendererContribution=T,e.StyleRendererFactory=M,e.TextRendererContribution=I,Object.defineProperty(e,"__esModule",{value:!0})}));
F=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=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 s(t,e,r,n){var i=Object.create((e&&e.prototype instanceof u?e:u).prototype),o=new C(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return O()}for(r.method=i,r.arg=o;;){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 s=h(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,o),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function u(){}function f(){}function d(){}var p={};c(p,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(S([])));y&&y!==e&&r.call(y,i)&&(p=y);var g=d.prototype=u.prototype=Object.create(p);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(i,o,a,c){var s=h(t[i],t,o);if("throw"!==s.type){var l=s.arg,u=l.value;return u&&"object"==typeof u&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(u).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}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=h(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(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 C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function S(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 n=-1,o=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 o.next=o}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=d,c(g,"constructor",d),c(d,"constructor",f),f.displayName=c(d,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,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,o,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new w(s(e,r,n,i),o);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,i,(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=S,C.prototype={constructor:C,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 i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(this.prev>=o.tryLoc){var c=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(c&&s){if(o.catchLoc>this.prev)return n(o.catchLoc,!0);if(o.finallyLoc>this.prev)return n(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(this.prev>=i.tryLoc&&r.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.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 i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function D(t,e,r,n,i,o,a){try{var c=t[o](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,i)}function _(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){D(o,n,i,a,c,"next",t)}function c(t){D(o,n,i,a,c,"throw",t)}a(void 0)}))}}var Y,V,X=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(i,o){var a;n?a=n(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){i(a)},a.onerror=function(t){o(t)},a.crossOrigin="Anonymous",a.src=t,r.imageCache[t]=a)}))},r.getOrCreatePatternSync=function(t,r,n){var i=this.generatePatternKey(t);if(i&&this.patternCache[i])return this.patternCache[i];var o,a=t.image,c=t.repetition,s=(o=e.isString(a)?this.getImageSync(a,n):a)&&r.createPattern(o,c);return i&&s&&(this.patternCache[i]=s),s},r.getOrCreateGradient=function(t,r){var n=this.generateGradientKey(t),i=t.type,o=t.steps,a=t.width,c=t.height,s=t.cx,h=t.cy;if(this.gradientCache[n])return this.gradientCache[n];var l=null;if(i===e.GradientType.LinearGradient){var u=e.computeLinearGradient(a,c,t.angle);l=r.createLinearGradient(u.x1,u.y1,u.x2,u.y2)}else if(i===e.GradientType.RadialGradient){var f=e.computeRadialGradient(a,c,s,h),d=f.x,p=f.y;l=r.createRadialGradient(d,p,0,d,p,f.r)}return l&&(o.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}();s([e.inject(e.CanvasConfig),h("design:type",Object)],X.prototype,"canvasConfig",void 0),X=s([e.singleton()],X);var U=(Y=function(){function t(){this.imagePool=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var r=this,n=function(n){var i=n.target;if(i.nodeName===e.Shape.IMAGE){var o=i.attributes.img;e.isString(o)&&r.imagePool.getImageSync(o,(function(){i.renderable.dirty=!0,t.dirtify()}))}},i=function(n){var i=n.target,o=n.newValue;i.nodeName===e.Shape.IMAGE&&"img"===n.attrName&&e.isString(o)&&r.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(V.tag,_(F().mark((function t(){return F().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,i);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(V.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,i)}))},t}(),Y.tag="LoadImage",V=Y);s([e.inject(X),h("design:type",X)],U.prototype,"imagePool",void 0),s([e.inject(e.RenderingContext),h("design:type",Object)],U.prototype,"renderingContext",void 0),U=V=s([e.singleton({contrib:e.RenderingPluginContribution})],U);e.Module((function(t){t(X),t(U)}));var W=function(){function t(){this.imagePool=void 0}var r=t.prototype;return r.render=function(t,r,n,i){var o=r.fill,a=r.opacity,c=r.fillOpacity,s=r.stroke,h=r.strokeOpacity,l=r.lineWidth,u=r.lineCap,f=r.lineJoin,d=r.shadowType,p=r.shadowColor,v=r.shadowBlur,y=r.filter,g=r.miterLimit,m=!e.isNil(o)&&!o.isNone,w=!e.isNil(s)&&!s.isNone&&l>0,x=0===o.alpha,b=!(!y||!y.length),E=!e.isNil(p)&&v>0,C=n.nodeName,S="inner"===d,O=w&&E&&(C===e.Shape.PATH||C===e.Shape.LINE||C===e.Shape.POLYLINE||x||S);m&&(t.globalAlpha=a*c,O||Q(n,t,E),this.fill(t,n,o,i),O||this.clearShadowAndFilter(t,b,E)),w&&(t.globalAlpha=a*h,t.lineWidth=l,e.isNil(g)||(t.miterLimit=g),e.isNil(u)||(t.lineCap=u),e.isNil(f)||(t.lineJoin=f),O&&(S&&(t.globalCompositeOperation="source-atop"),Q(n,t,!0),S&&(this.stroke(t,n,s,i),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,b,!0))),this.stroke(t,n,s,i))},r.clearShadowAndFilter=function(t,r,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),r){var i=t.filter;!e.isNil(i)&&i.indexOf("drop-shadow")>-1&&(t.filter=i.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},r.fill=function(t,r,n,i){var o=this;Array.isArray(n)?n.forEach((function(e){t.fillStyle=o.getColor(e,r,t),t.fill()})):(e.isPattern(n)&&(t.fillStyle=this.getPattern(n,r,t,i)),t.fill())},r.stroke=function(t,r,n,i){var o=this;Array.isArray(n)?n.forEach((function(e){t.strokeStyle=o.getColor(e,r,t),t.stroke()})):(e.isPattern(n)&&(t.strokeStyle=this.getPattern(n,r,t,i)),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 i;if(t.type===e.GradientType.LinearGradient||t.type===e.GradientType.RadialGradient){var a=r.getGeometryBounds();i=this.imagePool.getOrCreateGradient(o({type:t.type},t.value,{width:a&&2*a.halfExtents[0]||1,height:a&&2*a.halfExtents[1]||1}),n)}return i},t}();function Q(t,e,r){var n=t.parsedStyle,i=n.filter,o=n.shadowColor,a=n.shadowBlur,c=n.shadowOffsetX,s=n.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),r&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=c||0,e.shadowOffsetY=s||0)}s([e.inject(X),h("design:type",X)],W.prototype,"imagePool",void 0),W=s([e.singleton()],W),t.ImageRenderer=function(){function t(){this.imagePool=void 0}return t.prototype.render=function(t,r,n){var i,o=r.img,a=r.shadowColor,c=r.shadowBlur,s=r.width,h=r.height;if(e.isString(o)?i=this.imagePool.getImageSync(o):(s||(s=o.width),h||(h=o.height),i=o),i){Q(n,t,!e.isNil(a)&&c>0);try{t.drawImage(i,0,0,s,h)}catch(t){}}},t}(),s([e.inject(X),h("design:type",X)],t.ImageRenderer.prototype,"imagePool",void 0),t.ImageRenderer=s([e.singleton({token:G})],t.ImageRenderer),t.TextRenderer=function(){function t(){}var r=t.prototype;return r.render=function(t,r,n){var i=r.lineWidth,o=r.textAlign,a=r.textBaseline,c=r.lineJoin,s=r.miterLimit,h=r.letterSpacing,l=r.stroke,u=r.fill,f=r.fillOpacity,d=r.strokeOpacity,p=r.opacity,v=r.metrics,y=r.dx,g=r.dy,m=r.shadowColor,w=r.shadowBlur,x=v.lines,b=v.height,E=v.lineHeight,C=v.lineMetrics;t.font=v.font,t.lineWidth=i,t.textAlign=o,t.textBaseline=a,t.lineJoin=c,e.isNil(s)||(t.miterLimit=s);var S=0;"middle"===a?S=-b/2-E/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?S=-b:"top"!==a&&"hanging"!==a||(S=-E);var O=y||0;S+=g||0,Q(n,t,!e.isNil(m)&&w>0);for(var R=0;x.length>R;R++){var M=i/2+O;S+=E,e.isNil(l)||l.isNone||!i||this.drawLetterSpacing(t,x[R],C[R],o,M,S,h,f,d,p,!0),e.isNil(u)||this.drawLetterSpacing(t,x[R],C[R],o,M,S,h,f,d,p)}},r.drawLetterSpacing=function(t,e,r,n,i,o,a,c,s,h,l){if(void 0===l&&(l=!1),0!==a){var u=t.textAlign;t.textAlign="left";var f=i;"center"===n?f=i-r.width/2:"right"!==n&&"end"!==n||(f=i-r.width);for(var d=Array.from(e),p=t.measureText(e).width,v=0,y=0;d.length>y;++y){var g=d[y];l?this.strokeText(t,g,f,o,s):this.fillText(t,g,f,o,c,h),f+=p-(v=t.measureText(e.substring(y+1)).width)+a,p=v}t.textAlign=u}else l?this.strokeText(t,e,i,o,s):this.fillText(t,e,i,o,c,h)},r.fillText=function(t,r,n,i,o,a){var c,s=!e.isNil(o)&&1!==o;s&&(c=t.globalAlpha,t.globalAlpha=o*a),t.fillText(r,n,i),s&&(t.globalAlpha=c)},r.strokeText=function(t,r,n,i,o){var a,c=!e.isNil(o)&&1!==o;c&&(a=t.globalAlpha,t.globalAlpha=o),t.strokeText(r,n,i),c&&(t.globalAlpha=a)},t}(),t.TextRenderer=s([e.singleton({token:I})],t.TextRenderer),t.RectRenderer=function(t){function e(){return t.apply(this,arguments)||this}return a(e,t),e}(W),t.RectRenderer=s([e.singleton({token:T})],t.RectRenderer),t.CircleRenderer=function(t){function e(){return t.apply(this,arguments)||this}return a(e,t),e}(W),t.CircleRenderer=s([e.singleton({token:L})],t.CircleRenderer),t.EllipseRenderer=function(t){function e(){return t.apply(this,arguments)||this}return a(e,t),e}(W),t.EllipseRenderer=s([e.singleton({token:k})],t.EllipseRenderer),t.LineRenderer=function(t){function e(){return t.apply(this,arguments)||this}return a(e,t),e}(W),t.LineRenderer=s([e.singleton({token:A})],t.LineRenderer),t.PolylineRenderer=function(t){function e(){return t.apply(this,arguments)||this}return a(e,t),e}(W),t.PolylineRenderer=s([e.singleton({token:N})],t.PolylineRenderer),t.PolygonRenderer=function(t){function e(){return t.apply(this,arguments)||this}return a(e,t),e}(W),t.PolygonRenderer=s([e.singleton({token:j})],t.PolygonRenderer),t.PathRenderer=function(t){function e(){return t.apply(this,arguments)||this}return a(e,t),e}(W),t.PathRenderer=s([e.singleton({token:B})],t.PathRenderer);var H,J,K=e.Syringe.defineToken(""),Z=(H=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=x(),this.dprMatrix=x(),this.tmpMat4=x(),this.vec3a=S(),this.vec3b=S(),this.vec3c=S(),this.vec3d=S()}var n=t.prototype;return n.apply=function(t){var n=this,o=this.renderingContext.root.ownerDocument.defaultView,a=function(t){var e=t.target.rBushNode;e.aabb&&n.removedRBushNodeAABBs.push(e.aabb)},c=function(t){var e=t.target.rBushNode;e.aabb&&n.removedRBushNodeAABBs.push(e.aabb)};t.hooks.init.tapPromise(J.tag,i(r().mark((function t(){var i,o,s,h,l;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,a),n.renderingContext.root.addEventListener(e.ElementEvent.CULLED,c),i=n.contextService.getDPR(),s=(o=n.canvasConfig).width,h=o.height,l=n.contextService.getContext(),n.clearRect(l,0,0,s*i,h*i),r=n.dprMatrix,u=O(i,i,1),r[0]=u[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=u[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1;case 7:case"end":return t.stop()}var r,u}),t)})))),t.hooks.destroy.tap(J.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,a),n.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,c)})),t.hooks.beginFrame.tap(J.tag,(function(){var e=n.contextService.getContext(),r=n.contextService.getDPR(),i=n.canvasConfig,o=i.width,a=i.height,c=n.canvasRendererPluginOptions,s=c.dirtyObjectNumThreshold,h=c.dirtyObjectRatioThreshold,l=t.getStats(),u=l.rendered,f=u/l.total;n.clearFullScreen=t.disableDirtyRectangleRendering()||u>s&&f>h,e&&(e.resetTransform(),n.clearFullScreen&&n.clearRect(e,0,0,o*r,a*r))}));var s=function e(r){r.isVisible()&&!r.isCulled()&&(n.renderDisplayObject(r,t),n.saveDirtyAABB(r)),(r.sortable.sorted||r.childNodes).forEach((function(t){e(t)}))};t.hooks.endFrame.tap(J.tag,(function(){var r=n.contextService.getContext();if(E(n.vpMatrix,n.dprMatrix,n.camera.getOrthoMatrix()),n.clearFullScreen)s(n.renderingContext.root);else{var i=n.safeMergeAABB.apply(n,[n.mergeDirtyAABBs(n.renderQueue)].concat(n.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,i=t.maxX,o=t.maxY,a=new e.AABB;return a.setMinMax(O(r,n,0),O(i,o,0)),a}))));if(n.removedRBushNodeAABBs=[],e.AABB.isEmpty(i))return void(n.renderQueue=[]);var a=n.convertAABB2Rect(i),c=a.x,h=a.y,l=a.width,u=a.height,f=R(n.vec3a,O(c,h,0),n.vpMatrix),d=R(n.vec3b,O(c+l,h,0),n.vpMatrix),p=R(n.vec3c,O(c,h+u,0),n.vpMatrix),v=R(n.vec3d,O(c+l,h+u,0),n.vpMatrix),y=Math.min(f[0],d[0],v[0],p[0]),g=Math.min(f[1],d[1],v[1],p[1]),m=Math.max(f[0],d[0],v[0],p[0]),w=Math.max(f[1],d[1],v[1],p[1]),x=Math.floor(y),b=Math.floor(g),C=Math.ceil(m-y),S=Math.ceil(w-g);r.save(),n.clearRect(r,x,b,C,S),r.beginPath(),r.rect(x,b,C,S),r.clip(),r.setTransform(n.vpMatrix[0],n.vpMatrix[1],n.vpMatrix[4],n.vpMatrix[5],n.vpMatrix[12],n.vpMatrix[13]),n.canvasConfig.renderer.getConfig().enableDirtyRectangleRenderingDebug&&o.dispatchEvent(new e.CustomEvent(e.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:{x:x,y:b,width:C,height:S}})),n.searchDirtyObjects(i).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&n.renderDisplayObject(e,t)})),r.restore(),n.renderQueue.forEach((function(t){n.saveDirtyAABB(t)})),n.renderQueue=[]}n.restoreStack.forEach((function(){r.restore()})),n.restoreStack=[]})),t.hooks.render.tap(J.tag,(function(t){n.clearFullScreen||n.renderQueue.push(t)}))},n.clearRect=function(t,e,r,n,i){t.clearRect(e,r,n,i);var o=this.canvasConfig.background;o&&(t.fillStyle=o,t.fillRect(e,r,n,i))},n.renderDisplayObject=function(t,r){var n=this.contextService.getContext(),i=t.nodeName,o=this.restoreStack[this.restoreStack.length-1];!o||t.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINS||(n.restore(),this.restoreStack.pop()),void 0===this.styleRendererFactoryCache[i]&&(this.styleRendererFactoryCache[i]=this.styleRendererFactory(i));var a=this.styleRendererFactoryCache[i];void 0===this.pathGeneratorFactoryCache[i]&&(this.pathGeneratorFactoryCache[i]=this.pathGeneratorFactory(i));var c=this.pathGeneratorFactoryCache[i],s=t.parsedStyle.clipPath;if(s){this.applyWorldTransform(n,s,t.getWorldTransform()),void 0===this.pathGeneratorFactoryCache[s.nodeName]&&(this.pathGeneratorFactoryCache[s.nodeName]=this.pathGeneratorFactory(s.nodeName));var h=this.pathGeneratorFactoryCache[s.nodeName];h&&(n.save(),this.restoreStack.push(t),n.beginPath(),h(n,s.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},n.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),i=Math.floor(e[1]);return{x:n,y:i,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-i}},n.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},n.searchDirtyObjects=function(t){var e=this,r=t.getMin(),n=r[0],i=r[1],o=t.getMax();return this.rBush.search({minX:n,minY:i,maxX:o[0],maxY:o[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},n.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)},n.applyAttributesToContext=function(t,r){var n=r.parsedStyle,i=n.stroke,o=n.fill,a=n.opacity,c=n.lineDash,s=n.lineDashOffset;c&&t.setLineDash(c),e.isNil(s)||(t.lineDashOffset=s),e.isNil(a)||(t.globalAlpha*=a),e.isNil(i)||Array.isArray(i)||i.isNone||(t.strokeStyle=r.attributes.stroke),e.isNil(o)||Array.isArray(o)||o.isNone||(t.fillStyle=r.attributes.fill)},n.applyWorldTransform=function(t,e,r){var n=0,i=0,o=(e.parsedStyle||{}).anchor,a=o&&o[0]||0,c=o&&o[1]||0;if(0!==a||0!==c){var s=e.getGeometryBounds();n=-a*(s&&2*s.halfExtents[0]||0),i=-c*(s&&2*s.halfExtents[1]||0)}r?(b(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=n,this.vec3a[1]=i,this.vec3a[2]=0,C(this.tmpMat4,this.tmpMat4,this.vec3a),E(this.tmpMat4,r,this.tmpMat4),E(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(b(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=n,this.vec3a[1]=i,this.vec3a[2]=0,C(this.tmpMat4,this.tmpMat4,this.vec3a),E(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])},n.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=new Array(r),i=0;r>i;i++)n[i]=arguments[i];return n.forEach((function(e){t.add(e)})),t},t}(),H.tag="CanvasRenderer",J=H);s([e.inject(e.CanvasConfig),h("design:type",Object)],Z.prototype,"canvasConfig",void 0),s([e.inject(e.DefaultCamera),h("design:type",e.Camera)],Z.prototype,"camera",void 0),s([e.inject(e.ContextService),h("design:type",Object)],Z.prototype,"contextService",void 0),s([e.inject(e.RenderingContext),h("design:type",Object)],Z.prototype,"renderingContext",void 0),s([e.inject(l),h("design:type",Function)],Z.prototype,"pathGeneratorFactory",void 0),s([e.inject(P),h("design:type",Function)],Z.prototype,"styleRendererFactory",void 0),s([e.inject(e.DisplayObjectPool),h("design:type",e.DisplayObjectPool)],Z.prototype,"displayObjectPool",void 0),s([e.inject(K),h("design:type",Object)],Z.prototype,"canvasRendererPluginOptions",void 0),s([e.inject(e.RBushRoot),h("design:type",e.RBush)],Z.prototype,"rBush",void 0),Z=J=s([e.singleton({contrib:e.RenderingPluginContribution})],Z);var q=e.Module((function(r){var n;r(t.CircleRenderer),r(t.EllipseRenderer),r(t.RectRenderer),r(t.ImageRenderer),r(t.TextRenderer),r(t.LineRenderer),r(t.PolylineRenderer),r(t.PolygonRenderer),r(t.PathRenderer);var i=((n={})[e.Shape.CIRCLE]=L,n[e.Shape.ELLIPSE]=k,n[e.Shape.RECT]=T,n[e.Shape.IMAGE]=G,n[e.Shape.TEXT]=I,n[e.Shape.LINE]=A,n[e.Shape.POLYLINE]=N,n[e.Shape.POLYGON]=j,n[e.Shape.PATH]=B,n);r({token:P,useFactory:function(t){return function(e){var r=i[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),r(Z)})),z=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}a(e,t);var r=e.prototype;return r.init=function(){this.container.register(K,{useValue:o({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options)}),this.container.load(q,!0)},r.destroy=function(){this.container.unload(q),this.container.remove(K)},e}(e.AbstractRendererPlugin);t.CircleRendererContribution=L,t.EllipseRendererContribution=k,t.ImageRendererContribution=G,t.LineRendererContribution=A,t.PathRendererContribution=B,t.Plugin=z,t.PolygonRendererContribution=j,t.PolylineRendererContribution=N,t.RectRendererContribution=T,t.StyleRendererFactory=P,t.TextRendererContribution=I,Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -1,2 +0,2 @@

import { DisplayObject, ParsedImageStyleProps } from '@antv/g';
import type { DisplayObject, ParsedImageStyleProps } from '@antv/g';
import type { StyleRenderer } from './interfaces';

@@ -3,0 +3,0 @@ export declare class ImageRenderer implements StyleRenderer {

{
"name": "@antv/g-plugin-canvas-renderer",
"version": "1.7.3",
"version": "1.7.4",
"description": "A G plugin of renderer implementation with Canvas2D API",

@@ -30,5 +30,5 @@ "keywords": [

"dependencies": {
"@antv/g-math": "^1.7.0",
"@antv/g-plugin-canvas-path-generator": "^1.1.0",
"@antv/g-plugin-image-loader": "^1.1.1",
"@antv/g-math": "^1.7.1",
"@antv/g-plugin-canvas-path-generator": "^1.1.1",
"@antv/g-plugin-image-loader": "^1.1.2",
"tslib": "^2.3.1"

@@ -45,3 +45,3 @@ },

},
"gitHead": "1f4a67789c9185b1deb2ea85d657f3c6f17475d0"
"gitHead": "f450c50c66b1c5e57bfa9e76d231d0cbbb3643c0"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc