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

@visactor/vrender-kits

Package Overview
Dependencies
Maintainers
15
Versions
491
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@visactor/vrender-kits - npm Package Compare versions

Comparing version 0.10.3 to 0.11.0-alpha.1

3

cjs/canvas/contributions/canvas-module.d.ts

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

import type { Container } from 'inversify';
export default function load(container: Container): void;

@@ -1,20 +0,1 @@

"use strict";
var __importDefault = this && this.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : {
default: mod
};
};
Object.defineProperty(exports, "__esModule", {
value: !0
});
const modules_1 = __importDefault(require("./node/modules"));
function load(container) {
container.load(modules_1.default);
}
exports.default = load;
//# sourceMappingURL=canvas-module.js.map
//# sourceMappingURL=canvas-module.js.map

@@ -1,47 +0,1 @@

import type { Canvas } from 'canvas';
import type { EnvType, CanvasConfigType, ICanvas, IContext2d } from '@visactor/vrender';
export declare class NodeCanvas implements ICanvas {
static env: EnvType;
private _id;
private _displayWidth;
private _displayHeight;
private _pixelWidth;
private _pixelHeight;
private _nativeCanvas;
private _context;
private _visiable;
private controled;
private _dpr;
get id(): number | string;
get x(): number;
get y(): number;
get nativeCanvas(): Canvas;
get width(): number;
set width(width: number);
get displayWidth(): number;
get displayHeight(): number;
get height(): number;
set height(height: number);
getContext(str?: string): IContext2d;
get visiable(): boolean;
set visiable(visiable: boolean);
get dpr(): number;
set dpr(dpr: number);
constructor(params: CanvasConfigType);
applyPosition(): void;
getNativeCanvas(): Canvas;
resetStyle(params: Partial<CanvasConfigType>): void;
hide(): void;
show(): void;
resize(width: number, height: number): void;
toDataURL(): string;
toDataURL(mimeType: 'image/png'): string;
toDataURL(mimeType: 'image/jpeg', quality: number): string;
readPixels(x: number, y: number, w: number, h: number): ImageData | Promise<ImageData>;
convertToBlob(options?: {
type?: string | undefined;
quality?: number | undefined;
} | undefined): Promise<Blob>;
transferToImageBitmap(): ImageBitmap;
release(...params: any): void;
}

@@ -1,105 +0,1 @@

"use strict";
var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
}, __metadata = this && this.__metadata || function(k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.NodeCanvas = void 0;
const inversify_1 = require("inversify"), context_1 = require("./context"), DefaultConfig = {
WIDTH: 500,
HEIGHT: 500,
DPR: 1
};
let NodeCanvas = class {
get id() {
return this._id;
}
get x() {
return 0;
}
get y() {
return 0;
}
get nativeCanvas() {
return this._nativeCanvas;
}
get width() {
return this._pixelWidth;
}
set width(width) {
this._pixelWidth = width, this._displayWidth = width / (this._dpr || 1);
}
get displayWidth() {
return this._pixelWidth / this._dpr;
}
get displayHeight() {
return this._pixelHeight / this._dpr;
}
get height() {
return this._pixelHeight;
}
set height(height) {
this._pixelHeight = height, this._displayHeight = height / (this._dpr || 1);
}
getContext(str) {
return this._context;
}
get visiable() {
return this._visiable;
}
set visiable(visiable) {
this._visiable = visiable, visiable ? this.show() : this.hide();
}
get dpr() {
return this._dpr;
}
set dpr(dpr) {
this._dpr = dpr, this.resize(this.width, this.height);
}
constructor(params) {
const {nativeCanvas: nativeCanvas, width: width = DefaultConfig.WIDTH, height: height = DefaultConfig.HEIGHT, canvasControled: canvasControled = !0, dpr: dpr = DefaultConfig.DPR} = params;
this._visiable = !1 !== params.visiable, this.controled = canvasControled, this._pixelWidth = width * dpr,
this._pixelHeight = height * dpr, this._displayWidth = width, this._displayHeight = height,
this._nativeCanvas = nativeCanvas, this._context = new context_1.NodeContext2d(this, params.dpr),
this._id = nativeCanvas.id, this._dpr = dpr;
}
applyPosition() {}
getNativeCanvas() {
return this._nativeCanvas;
}
resetStyle(params) {}
hide() {}
show() {}
resize(width, height) {
this._pixelWidth = width * this._dpr, this._pixelHeight = height * this._dpr, this._displayWidth = width,
this._displayHeight = height, this._nativeCanvas && (this._nativeCanvas.width = this._pixelWidth,
this._nativeCanvas.height = this._pixelHeight);
}
toDataURL(mimeType, quality) {
return "";
}
readPixels(x, y, w, h) {
return this._context.getImageData(x, y, w, h);
}
convertToBlob(options) {
throw new Error("暂未实现");
}
transferToImageBitmap() {
throw new Error("暂未实现");
}
release(...params) {
throw new Error("暂不支持release");
}
};
NodeCanvas.env = "node", NodeCanvas = __decorate([ (0, inversify_1.injectable)(), __metadata("design:paramtypes", [ Object ]) ], NodeCanvas),
exports.NodeCanvas = NodeCanvas;
//# sourceMappingURL=canvas.js.map
//# sourceMappingURL=canvas.js.map

@@ -1,7 +0,1 @@

import type { EnvType, ICanvas, IContext2d } from '@visactor/vrender';
import { BrowserContext2d } from '@visactor/vrender';
export declare class NodeContext2d extends BrowserContext2d implements IContext2d {
static env: EnvType;
constructor(canvas: ICanvas, dpr: number);
release(...params: any): void;
}

@@ -1,30 +0,1 @@

"use strict";
var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
}, __metadata = this && this.__metadata || function(k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.NodeContext2d = void 0;
const vutils_1 = require("@visactor/vutils"), inversify_1 = require("inversify"), vrender_1 = require("@visactor/vrender"), initMatrix = new vutils_1.Matrix(1, 0, 0, 1, 0, 0);
let NodeContext2d = class extends vrender_1.BrowserContext2d {
constructor(canvas, dpr) {
super(canvas, dpr);
const context = canvas.nativeCanvas.getContext("2d");
if (!context) throw new Error("发生错误,获取2d上下文失败");
this.nativeContext = context, this.canvas = canvas, this.matrix = new vutils_1.Matrix(1, 0, 0, 1, 0, 0),
this.stack = [], this.dpr = null != dpr ? dpr : 1;
}
release(...params) {}
};
NodeContext2d.env = "node", NodeContext2d = __decorate([ (0, inversify_1.injectable)(), __metadata("design:paramtypes", [ Object, Number ]) ], NodeContext2d),
exports.NodeContext2d = NodeContext2d;
//# sourceMappingURL=context.js.map
//# sourceMappingURL=context.js.map

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

export * from './canvas';
export * from './context';

@@ -1,21 +0,1 @@

"use strict";
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
void 0 === k2 && (k2 = k);
var desc = Object.getOwnPropertyDescriptor(m, k);
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
enumerable: !0,
get: function() {
return m[k];
}
}), Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
void 0 === k2 && (k2 = k), o[k2] = m[k];
}), __exportStar = this && this.__exportStar || function(m, exports) {
for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", {
value: !0
}), __exportStar(require("./canvas"), exports), __exportStar(require("./context"), exports);
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map

@@ -1,3 +0,1 @@

import { ContainerModule } from 'inversify';
declare const _default: ContainerModule;
export default _default;

@@ -1,13 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
});
const inversify_1 = require("inversify"), vrender_1 = require("@visactor/vrender"), canvas_1 = require("./canvas"), context_1 = require("./context");
exports.default = new inversify_1.ContainerModule((bind => {
bind(vrender_1.CanvasFactory).toDynamicValue((() => params => new canvas_1.NodeCanvas(params))).whenTargetNamed(context_1.NodeContext2d.env),
bind(vrender_1.Context2dFactory).toDynamicValue((() => params => new context_1.NodeContext2d(params, params.dpr))).whenTargetNamed(context_1.NodeContext2d.env);
}));
//# sourceMappingURL=modules.js.map
//# sourceMappingURL=modules.js.map

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

export {};

@@ -1,6 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
});
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map

@@ -1,3 +0,1 @@

import { ContainerModule } from 'inversify';
declare const _default: ContainerModule;
export default _default;

@@ -1,12 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
});
const inversify_1 = require("inversify"), vrender_1 = require("@visactor/vrender"), node_contribution_1 = require("./node-contribution");
exports.default = new inversify_1.ContainerModule((bind => {
bind(node_contribution_1.NodeEnvContribution).toSelf().inSingletonScope(), bind(vrender_1.EnvContribution).toService(node_contribution_1.NodeEnvContribution);
}));
//# sourceMappingURL=module.js.map
//# sourceMappingURL=module.js.map

@@ -1,47 +0,1 @@

import type { createCanvas, createImageData, loadImage, Canvas } from 'canvas';
import * as NodePkg from 'canvas';
import type { EnvType, IEnvContribution, IGlobal, ICreateCanvasParams } from '@visactor/vrender';
import { BaseEnvContribution } from '@visactor/vrender';
type NodePkg = {
createCanvas: typeof createCanvas;
createImageData: typeof createImageData;
loadImage: typeof loadImage;
};
export declare class NodeEnvContribution extends BaseEnvContribution implements IEnvContribution {
type: EnvType;
pkg: NodePkg;
_lastTime: number;
supportEvent: boolean;
configure(service: IGlobal, pkg?: NodePkg): void;
loadJson(url: string): Promise<{
loadState: 'success' | 'fail';
data: Record<string, unknown> | null;
}>;
loadArrayBuffer(url: string): Promise<{
loadState: 'success' | 'fail';
data: ArrayBuffer | null;
}>;
loadImage(url: string): Promise<{
loadState: 'success' | 'fail';
data: HTMLImageElement | null;
}>;
loadSvg(svgStr: string): Promise<{
loadState: 'success' | 'fail';
data: HTMLImageElement | null;
}>;
createCanvas(params: any): Canvas;
releaseCanvas(canvas: Canvas | any): void;
getDevicePixelRatio(): number;
getRequestAnimationFrame(): (callback: FrameRequestCallback) => number;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions | undefined): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
getElementById(str: string): HTMLElement | null;
getRootElement(): HTMLElement | null;
dispatchEvent(event: any): boolean;
getCancelAnimationFrame(): (h: number) => void;
release(...params: any): void;
createOffscreenCanvas(params: ICreateCanvasParams): void;
}
export {};

@@ -1,118 +0,1 @@

"use strict";
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
void 0 === k2 && (k2 = k);
var desc = Object.getOwnPropertyDescriptor(m, k);
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
enumerable: !0,
get: function() {
return m[k];
}
}), Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
void 0 === k2 && (k2 = k), o[k2] = m[k];
}), __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", {
enumerable: !0,
value: v
});
} : function(o, v) {
o.default = v;
}), __decorate = this && this.__decorate || function(decorators, target, key, desc) {
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
}, __importStar = this && this.__importStar || function(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);
return __setModuleDefault(result, mod), result;
}, __importDefault = this && this.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : {
default: mod
};
};
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.NodeEnvContribution = void 0;
const inversify_1 = require("inversify"), NodePkg = __importStar(require("canvas")), resvg_js_1 = require("@resvg/resvg-js"), vrender_1 = require("@visactor/vrender"), node_fetch_1 = __importDefault(require("node-fetch"));
let last = 0;
function nodeRequestAnimationFrame(callback) {
const now = Date.now(), timeLeft = Math.max(0, 16 - (now - last)), id = setTimeout((function() {
callback(now + timeLeft);
}), timeLeft);
return last = now + timeLeft, id;
}
let NodeEnvContribution = class extends vrender_1.BaseEnvContribution {
constructor() {
super(...arguments), this.type = "node", this._lastTime = 0, this.supportEvent = !1;
}
configure(service, pkg = NodePkg) {
service.env === this.type && (service.setActiveEnvContribution(this), this.pkg = pkg);
}
loadJson(url) {
const jsonPromise = (0, node_fetch_1.default)(url).then((data => data.json()));
return jsonPromise.then((json => ({
data: json,
state: "success"
}))).catch((() => ({
data: null,
state: "fail"
}))), jsonPromise;
}
loadArrayBuffer(url) {
return (0, node_fetch_1.default)(url).then((data => data.arrayBuffer())).then((arrayBuffer => ({
data: arrayBuffer,
loadState: "success"
}))).catch((() => ({
data: null,
loadState: "fail"
})));
}
loadImage(url) {
const {loadImage: loadImage} = this.pkg;
return loadImage ? loadImage(url).then((image => ({
loadState: image ? "success" : "fail",
data: image
}))).catch((() => ({
loadState: "fail",
data: null
}))) : Promise.reject(new Error("node-canvas loadImage could not be found!"));
}
loadSvg(svgStr) {
if (!resvg_js_1.Resvg) return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));
const pngData = new resvg_js_1.Resvg(svgStr).render().asPng();
return this.loadImage(pngData);
}
createCanvas(params) {
return this.pkg.createCanvas(params.width, params.height);
}
releaseCanvas(canvas) {}
getDevicePixelRatio() {
return 0;
}
getRequestAnimationFrame() {
return nodeRequestAnimationFrame;
}
addEventListener(type, listener, options) {}
removeEventListener(type, listener, options) {}
getElementById(str) {
return null;
}
getRootElement() {
return null;
}
dispatchEvent(event) {}
getCancelAnimationFrame() {}
release(...params) {}
createOffscreenCanvas(params) {}
};
NodeEnvContribution = __decorate([ (0, inversify_1.injectable)() ], NodeEnvContribution),
exports.NodeEnvContribution = NodeEnvContribution;
//# sourceMappingURL=node-contribution.js.map
//# sourceMappingURL=node-contribution.js.map
import 'reflect-metadata';
import _canvasModuleLoader from './canvas/contributions/canvas-module';
export declare const roughModule: import("inversify").ContainerModule;
export declare const canvasModuleLoader: typeof _canvasModuleLoader;
export { nodeLoader } from './node-bind';

@@ -11,16 +11,6 @@ "use strict";

value: !0
}), exports.nodeLoader = exports.canvasModuleLoader = exports.roughModule = void 0,
require("reflect-metadata");
}), exports.roughModule = void 0, require("reflect-metadata");
const module_1 = __importDefault(require("./render/contributions/rough/module")), canvas_module_1 = __importDefault(require("./canvas/contributions/canvas-module"));
const module_1 = __importDefault(require("./render/contributions/rough/module"));
exports.roughModule = module_1.default, exports.canvasModuleLoader = canvas_module_1.default;
var node_bind_1 = require("./node-bind");
Object.defineProperty(exports, "nodeLoader", {
enumerable: !0,
get: function() {
return node_bind_1.nodeLoader;
}
});
exports.roughModule = module_1.default;
import 'reflect-metadata';
import _canvasModuleLoader from './canvas/contributions/canvas-module';
export declare const roughModule: import("inversify").ContainerModule;
export declare const canvasModuleLoader: typeof _canvasModuleLoader;

@@ -11,7 +11,7 @@ "use strict";

value: !0
}), exports.canvasModuleLoader = exports.roughModule = void 0, require("reflect-metadata");
}), exports.roughModule = void 0, require("reflect-metadata");
const module_1 = __importDefault(require("./render/contributions/rough/module")), canvas_module_1 = __importDefault(require("./canvas/contributions/canvas-module"));
const module_1 = __importDefault(require("./render/contributions/rough/module"));
exports.roughModule = module_1.default, exports.canvasModuleLoader = canvas_module_1.default;
exports.roughModule = module_1.default;
//# sourceMappingURL=index.js.map

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

import type { Container } from 'inversify';
export declare function nodeLoader(container: Container): void;

@@ -1,20 +0,1 @@

"use strict";
var __importDefault = this && this.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : {
default: mod
};
};
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.nodeLoader = void 0;
const module_1 = __importDefault(require("./env/contributions/module")), modules_1 = __importDefault(require("./window/contributions/modules")), modules_2 = __importDefault(require("./canvas/contributions/node/modules"));
function nodeLoader(container) {
container.load(module_1.default), container.load(modules_1.default), container.load(modules_2.default);
}
exports.nodeLoader = nodeLoader;
//# sourceMappingURL=node-bind.js.map
//# sourceMappingURL=node-bind.js.map

@@ -1,3 +0,1 @@

import { ContainerModule } from 'inversify';
declare const _default: ContainerModule;
export default _default;

@@ -1,13 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
});
const inversify_1 = require("inversify"), vrender_1 = require("@visactor/vrender"), node_contribution_1 = require("./node-contribution");
exports.default = new inversify_1.ContainerModule((bind => {
bind(node_contribution_1.NodeWindowHandlerContribution).toSelf().inSingletonScope(),
bind(vrender_1.WindowHandlerContribution).toService(node_contribution_1.NodeWindowHandlerContribution);
}));
//# sourceMappingURL=modules.js.map
//# sourceMappingURL=modules.js.map

@@ -1,38 +0,1 @@

import type { EnvType, IGlobal, IWindowHandlerContribution, IWindowParams, IContext2d, ICanvas, IDomRectLike } from '@visactor/vrender';
import { BaseWindowHandlerContribution } from '@visactor/vrender';
import type { IBoundsLike } from '@visactor/vutils';
export declare class NodeWindowHandlerContribution extends BaseWindowHandlerContribution implements IWindowHandlerContribution {
private readonly global;
type: EnvType;
canvas: ICanvas;
get container(): HTMLElement | null;
constructor(global: IGlobal);
getTitle(): string;
getWH(): {
width: number;
height: number;
};
getXY(): {
x: number;
y: number;
};
createWindow(params: IWindowParams): void;
private createWindowByConfig;
private createWindowByCanvas;
releaseWindow(): void;
resizeWindow(width: number, height: number): void;
setDpr(dpr: number): void;
getContext(): IContext2d;
getNativeHandler(): ICanvas;
getDpr(): number;
getImageBuffer(type?: string): any;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
dispatchEvent(event: any): boolean;
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
getStyle(): CSSStyleDeclaration | Record<string, any>;
setStyle(style: CSSStyleDeclaration | Record<string, any>): void;
getBoundingClientRect(): IDomRectLike;
clearViewBox(vb: IBoundsLike, color?: string): void;
}

@@ -1,109 +0,1 @@

"use strict";
var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
}, __metadata = this && this.__metadata || function(k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
}, __param = this && this.__param || function(paramIndex, decorator) {
return function(target, key) {
decorator(target, key, paramIndex);
};
};
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.NodeWindowHandlerContribution = void 0;
const inversify_1 = require("inversify"), vrender_1 = require("@visactor/vrender"), canvas_1 = require("../../canvas/contributions/node/canvas");
let NodeWindowHandlerContribution = class extends vrender_1.BaseWindowHandlerContribution {
get container() {
return null;
}
constructor(global) {
super(), this.global = global, this.type = "node";
}
getTitle() {
return "";
}
getWH() {
return {
width: this.canvas.displayWidth,
height: this.canvas.displayHeight
};
}
getXY() {
return {
x: 0,
y: 0
};
}
createWindow(params) {
params.canvas ? this.createWindowByCanvas(params) : this.createWindowByConfig(params);
}
createWindowByConfig(params) {
const nativeCanvas = this.global.createCanvas({
width: params.width,
height: params.height
}), options = {
width: params.width,
height: params.height,
dpr: params.dpr,
nativeCanvas: nativeCanvas,
id: vrender_1.Generator.GenAutoIncrementId().toString(),
canvasControled: !0
};
this.canvas = new canvas_1.NodeCanvas(options);
}
createWindowByCanvas(params) {
const canvas = params.canvas;
let width = params.width, height = params.height;
null != width && null != height && params.canvasControled || (width = canvas.width,
height = canvas.height), this.canvas = new canvas_1.NodeCanvas({
width: width,
height: height,
dpr: 1,
nativeCanvas: canvas,
canvasControled: params.canvasControled
});
}
releaseWindow() {
this.canvas.release();
}
resizeWindow(width, height) {
this.canvas.resize(width, height);
}
setDpr(dpr) {
this.canvas.dpr = dpr;
}
getContext() {
return this.canvas.getContext();
}
getNativeHandler() {
return this.canvas;
}
getDpr() {
return this.canvas.dpr;
}
getImageBuffer(type = "image/png") {
return this.canvas.nativeCanvas.toBuffer(type);
}
addEventListener(type, listener, options) {}
dispatchEvent(event) {
return !0;
}
removeEventListener(type, listener, options) {}
getStyle() {}
setStyle(style) {}
getBoundingClientRect() {
return null;
}
clearViewBox(vb, color) {}
};
NodeWindowHandlerContribution = __decorate([ (0, inversify_1.injectable)(), __param(0, (0,
inversify_1.inject)(vrender_1.Global)), __metadata("design:paramtypes", [ Object ]) ], NodeWindowHandlerContribution),
exports.NodeWindowHandlerContribution = NodeWindowHandlerContribution;
//# sourceMappingURL=node-contribution.js.map
//# sourceMappingURL=node-contribution.js.map

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("reflect-metadata"),require("@visactor/vrender"),require("inversify"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","reflect-metadata","@visactor/vrender","inversify","@visactor/vutils"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).VRender=e.VRender||{},e.VRender.Kits={}),null,e.vrender,e.inversify,e.vutils)}(this,(function(e,t,a,r,i){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,n=void 0,"symbol"==typeof(n=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var r=a.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"))?n:String(n)),r)}var i,n}function l(e,t,a){return t&&o(e.prototype,t),a&&o(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function c(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=u(e);if(t){var i=u(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return c(this,a)}}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,i,n,s,o=[],l=!0,h=!1;try{if(n=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;l=!1}else for(;!(l=(r=n.call(a)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){h=!0,i=e}finally{try{if(!l&&null!=a.return&&(s=a.return(),Object(s)!==s))return}finally{if(h)throw i}}return o}}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return y(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function m(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=g(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,s=!0,o=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return s=e.done,e},e:function(e){o=!0,n=e},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw n}}}}function b(e,t,a,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,a):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,a,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(o=(s<3?i(o):s>3?i(t,a,o):i(t,a))||o);return s>3&&o&&Object.defineProperty(t,a,o),o}function k(e,t){return function(a,r){t(a,r,e)}}function M(e,t){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function S(e,t,a){if(e&&e.length){var r=d(t,2),i=r[0],n=r[1],s=Math.PI/180*a,o=Math.cos(s),l=Math.sin(s);e.forEach((function(e){var t=d(e,2),a=t[0],r=t[1];e[0]=(a-i)*o-(r-n)*l+i,e[1]=(a-i)*l+(r-n)*o+n}))}}function x(e){var t=e[0],a=e[1];return Math.sqrt(Math.pow(t[0]-a[0],2)+Math.pow(t[1]-a[1],2))}function w(e,t){var a=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var i=[0,0];if(a){var n,s=m(e);try{for(s.s();!(n=s.n()).done;){S(n.value,i,a)}}catch(e){s.e(e)}finally{s.f()}}var o=function(e,t){var a,r=[],i=m(e);try{for(i.s();!(a=i.n()).done;){var n=v(a.value);n[0].join(",")!==n[n.length-1].join(",")&&n.push([n[0][0],n[0][1]]),n.length>2&&r.push(n)}}catch(e){i.e(e)}finally{i.f()}var s=[];t=Math.max(t,.1);for(var o=[],l=0,h=r;l<h.length;l++)for(var u=h[l],f=0;f<u.length-1;f++){var c=u[f],p=u[f+1];if(c[1]!==p[1]){var d=Math.min(c[1],p[1]);o.push({ymin:d,ymax:Math.max(c[1],p[1]),x:d===c[1]?c[0]:p[0],islope:(p[0]-c[0])/(p[1]-c[1])})}}if(o.sort((function(e,t){return e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)})),!o.length)return s;for(var g=[],y=o[0].ymin;g.length||o.length;){if(o.length){for(var b=-1,k=0;k<o.length&&!(o[k].ymin>y);k++)b=k;o.splice(0,b+1).forEach((function(e){g.push({s:y,edge:e})}))}if(g=g.filter((function(e){return!(e.edge.ymax<=y)})),g.sort((function(e,t){return e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)})),g.length>1)for(var M=0;M<g.length;M+=2){var S=M+1;if(S>=g.length)break;var x=g[M].edge,w=g[S].edge;s.push([[Math.round(x.x),y],[Math.round(w.x),y]])}y+=t,g.forEach((function(e){e.edge.x=e.edge.x+t*e.edge.islope}))}return s}(e,r);if(a){var l,h=m(e);try{for(h.s();!(l=h.n()).done;){S(l.value,i,-a)}}catch(e){h.e(e)}finally{h.f()}!function(e,t,a){var r=[];e.forEach((function(e){return r.push.apply(r,v(e))})),S(r,t,a)}(o,i,-a)}return o}var O=function(){function e(t){s(this,e),this.helper=t}return l(e,[{key:"fillPolygons",value:function(e,t){return this._fillPolygons(e,t)}},{key:"_fillPolygons",value:function(e,t){var a=w(e,t);return{type:"fillSketch",ops:this.renderLines(a,t)}}},{key:"renderLines",value:function(e,t){var a,r=[],i=m(e);try{for(i.s();!(a=i.n()).done;){var n=a.value;r.push.apply(r,v(this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],t)))}}catch(e){i.e(e)}finally{i.f()}return r}}]),e}(),P=function(e){h(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return l(a,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap;a<0&&(a=4*t.strokeWidth),a=Math.max(a,.1);var r,i=w(e,Object.assign({},t,{hachureGap:a})),n=Math.PI/180*t.hachureAngle,s=[],o=.5*a*Math.cos(n),l=.5*a*Math.sin(n),h=m(i);try{for(h.s();!(r=h.n()).done;){var u=d(r.value,2),f=u[0],c=u[1];x([f,c])&&s.push([[f[0]-o,f[1]+l],v(c)],[[f[0]+o,f[1]-l],v(c)])}}catch(e){h.e(e)}finally{h.f()}return{type:"fillSketch",ops:this.renderLines(s,t)}}}]),a}(O),D=function(e){h(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return l(a,[{key:"fillPolygons",value:function(e,t){var a=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return a.ops=a.ops.concat(i.ops),a}}]),a}(O),R=function(){function e(t){s(this,e),this.helper=t}return l(e,[{key:"fillPolygons",value:function(e,t){var a=w(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(a,t)}},{key:"dotsOnLines",value:function(e,t){var a=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var i=t.fillWeight;i<0&&(i=t.strokeWidth/2);var n,s=r/4,o=m(e);try{for(o.s();!(n=o.n()).done;)for(var l=n.value,h=x(l),u=h/r,f=Math.ceil(u)-1,c=h-f*r,p=(l[0][0]+l[1][0])/2-r/4,d=Math.min(l[0][1],l[1][1]),g=0;g<f;g++){var y=d+c+g*r,b=p-s+2*Math.random()*s,k=y-s+2*Math.random()*s,M=this.helper.ellipse(b,k,i,i,t);a.push.apply(a,v(M.ops))}}catch(e){o.e(e)}finally{o.f()}return{type:"fillSketch",ops:a}}}]),e}(),C=function(){function e(t){s(this,e),this.helper=t}return l(e,[{key:"fillPolygons",value:function(e,t){var a=w(e,t);return{type:"fillSketch",ops:this.dashedLine(a,t)}}},{key:"dashedLine",value:function(e,t){var a=this,r=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,i=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,n=[];return e.forEach((function(e){var s=x(e),o=Math.floor(s/(r+i)),l=(s+i-o*(r+i))/2,h=e[0],u=e[1];h[0]>u[0]&&(h=e[1],u=e[0]);for(var f=Math.atan((u[1]-h[1])/(u[0]-h[0])),c=0;c<o;c++){var p=c*(r+i),d=p+r,g=[h[0]+p*Math.cos(f)+l*Math.cos(f),h[1]+p*Math.sin(f)+l*Math.sin(f)],y=[h[0]+d*Math.cos(f)+l*Math.cos(f),h[1]+d*Math.sin(f)+l*Math.sin(f)];n.push.apply(n,v(a.helper.doubleLineOps(g[0],g[1],y[0],y[1],t)))}})),n}}]),e}(),T=function(){function e(t){s(this,e),this.helper=t}return l(e,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?a:t.zigzagOffset,i=w(e,t=Object.assign({},t,{hachureGap:a+r}));return{type:"fillSketch",ops:this.zigzagLines(i,r,t)}}},{key:"zigzagLines",value:function(e,t,a){var r=this,i=[];return e.forEach((function(e){var n=x(e),s=Math.round(n/(2*t)),o=e[0],l=e[1];o[0]>l[0]&&(o=e[1],l=e[0]);for(var h=Math.atan((l[1]-o[1])/(l[0]-o[0])),u=0;u<s;u++){var f=2*u*t,c=2*(u+1)*t,p=Math.sqrt(2*Math.pow(t,2)),d=[o[0]+f*Math.cos(h),o[1]+f*Math.sin(h)],g=[o[0]+c*Math.cos(h),o[1]+c*Math.sin(h)],y=[d[0]+p*Math.cos(h+Math.PI/4),d[1]+p*Math.sin(h+Math.PI/4)];i.push.apply(i,v(r.helper.doubleLineOps(d[0],d[1],y[0],y[1],a)).concat(v(r.helper.doubleLineOps(y[0],y[1],g[0],g[1],a))))}})),i}}]),e}(),_={},L=function(){function e(t){s(this,e),this.seed=t}return l(e,[{key:"next",value:function(){return this.seed?(Math.pow(2,31)-1&(this.seed=Math.imul(48271,this.seed)))/Math.pow(2,31):Math.random()}}]),e}(),W={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function z(e,t){return e.type===t}function G(e){for(var t=[],a=function(e){for(var t=new Array;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:"".concat(parseFloat(RegExp.$1))},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e),r="BOD",i=0,n=a[i];!z(n,2);){var s=0,o=[];if("BOD"===r){if("M"!==n.text&&"m"!==n.text)return G("M0,0"+e);i++,s=W[n.text],r=n.text}else z(n,1)?s=W[r]:(i++,s=W[n.text],r=n.text);if(!(i+s<a.length))throw new Error("Path data ended short");for(var l=i;l<i+s;l++){var h=a[l];if(!z(h,1))throw new Error("Param not a number: "+r+","+h.text);o[o.length]=+h.text}if("number"!=typeof W[r])throw new Error("Bad segment: "+r);var u={key:r,data:o};t.push(u),n=a[i+=s],"M"===r&&(r="L"),"m"===r&&(r="l")}return t}function F(e){var t,a,r,i,n=0,s=0,o=0,l=0,h=[],u=m(e);try{for(u.s();!(i=u.n()).done;){var f=i.value,c=f.key,p=f.data;switch(c){case"M":h.push({key:"M",data:v(p)}),t=d(p,2),n=t[0],s=t[1],o=(a=d(p,2))[0],l=a[1];break;case"m":n+=p[0],s+=p[1],h.push({key:"M",data:[n,s]}),o=n,l=s;break;case"L":h.push({key:"L",data:v(p)}),r=d(p,2),n=r[0],s=r[1];break;case"l":n+=p[0],s+=p[1],h.push({key:"L",data:[n,s]});break;case"C":h.push({key:"C",data:v(p)}),n=p[4],s=p[5];break;case"c":var g=p.map((function(e,t){return t%2?e+s:e+n}));h.push({key:"C",data:g}),n=g[4],s=g[5];break;case"Q":h.push({key:"Q",data:v(p)}),n=p[2],s=p[3];break;case"q":var y=p.map((function(e,t){return t%2?e+s:e+n}));h.push({key:"Q",data:y}),n=y[2],s=y[3];break;case"A":h.push({key:"A",data:v(p)}),n=p[5],s=p[6];break;case"a":n+=p[5],s+=p[6],h.push({key:"A",data:[p[0],p[1],p[2],p[3],p[4],n,s]});break;case"H":h.push({key:"H",data:v(p)}),n=p[0];break;case"h":n+=p[0],h.push({key:"H",data:[n]});break;case"V":h.push({key:"V",data:v(p)}),s=p[0];break;case"v":s+=p[0],h.push({key:"V",data:[s]});break;case"S":h.push({key:"S",data:v(p)}),n=p[2],s=p[3];break;case"s":var b=p.map((function(e,t){return t%2?e+s:e+n}));h.push({key:"S",data:b}),n=b[2],s=b[3];break;case"T":h.push({key:"T",data:v(p)}),n=p[0],s=p[1];break;case"t":n+=p[0],s+=p[1],h.push({key:"T",data:[n,s]});break;case"Z":case"z":h.push({key:"Z",data:[]}),n=o,s=l}}}catch(e){u.e(e)}finally{u.f()}return h}function j(e){var t,a,r,i,n=[],s="",o=0,l=0,h=0,u=0,f=0,c=0,p=m(e);try{for(p.s();!(i=p.n()).done;){var g=i.value,y=g.key,b=g.data;switch(y){case"M":n.push({key:"M",data:v(b)}),o=(t=d(b,2))[0],l=t[1],h=(a=d(b,2))[0],u=a[1];break;case"C":n.push({key:"C",data:v(b)}),o=b[4],l=b[5],f=b[2],c=b[3];break;case"L":n.push({key:"L",data:v(b)}),o=(r=d(b,2))[0],l=r[1];break;case"H":o=b[0],n.push({key:"L",data:[o,l]});break;case"V":l=b[0],n.push({key:"L",data:[o,l]});break;case"S":var k=0,M=0;"C"===s||"S"===s?(k=o+(o-f),M=l+(l-c)):(k=o,M=l),n.push({key:"C",data:[k,M].concat(v(b))}),f=b[0],c=b[1],o=b[2],l=b[3];break;case"T":var S=d(b,2),x=S[0],w=S[1],O=0,P=0;"Q"===s||"T"===s?(O=o+(o-f),P=l+(l-c)):(O=o,P=l);var D=o+2*(O-o)/3,R=l+2*(P-l)/3,C=x+2*(O-x)/3,T=w+2*(P-w)/3;n.push({key:"C",data:[D,R,C,T,x,w]}),f=O,c=P,o=x,l=w;break;case"Q":var _=d(b,4),L=_[0],W=_[1],z=_[2],G=_[3],F=o+2*(L-o)/3,j=l+2*(W-l)/3,A=z+2*(L-z)/3,E=G+2*(W-G)/3;n.push({key:"C",data:[F,j,A,E,z,G]}),f=L,c=W,o=z,l=G;break;case"A":var V=Math.abs(b[0]),H=Math.abs(b[1]),q=b[2],B=b[3],N=b[4],Y=b[5],Z=b[6];0===V||0===H?(n.push({key:"C",data:[o,l,Y,Z,Y,Z]}),o=Y,l=Z):o===Y&&l===Z||(I(o,l,Y,Z,V,H,q,B,N).forEach((function(e){n.push({key:"C",data:e})})),o=Y,l=Z);break;case"Z":n.push({key:"Z",data:[]}),o=h,l=u}s=y}}catch(e){p.e(e)}finally{p.f()}return n}function A(e,t,a){return[e*Math.cos(a)-t*Math.sin(a),e*Math.sin(a)+t*Math.cos(a)]}function I(e,t,a,r,i,n,s,o,l,h){var u,f=(u=s,Math.PI*u/180),c=[],p=0,v=0,g=0,y=0;if(h){var m=d(h,4);p=m[0],v=m[1],g=m[2],y=m[3]}else{var b,k;e=(b=d(A(e,t,-f),2))[0],t=b[1];var M=(e-(a=(k=d(A(a,r,-f),2))[0]))/2,S=(t-(r=k[1]))/2,x=M*M/(i*i)+S*S/(n*n);x>1&&(i*=x=Math.sqrt(x),n*=x);var w=i*i,O=n*n,P=w*O-w*S*S-O*M*M,D=w*S*S+O*M*M,R=(o===l?-1:1)*Math.sqrt(Math.abs(P/D));g=R*i*S/n+(e+a)/2,y=R*-n*M/i+(t+r)/2,p=Math.asin(parseFloat(((t-y)/n).toFixed(9))),v=Math.asin(parseFloat(((r-y)/n).toFixed(9))),e<g&&(p=Math.PI-p),a<g&&(v=Math.PI-v),p<0&&(p=2*Math.PI+p),v<0&&(v=2*Math.PI+v),l&&p>v&&(p-=2*Math.PI),!l&&v>p&&(v-=2*Math.PI)}var C=v-p;if(Math.abs(C)>120*Math.PI/180){var T=v,_=a,L=r;v=l&&v>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,c=I(a=g+i*Math.cos(v),r=y+n*Math.sin(v),_,L,i,n,s,0,l,[v,T,g,y])}C=v-p;var W=Math.cos(p),z=Math.sin(p),G=Math.cos(v),F=Math.sin(v),j=Math.tan(C/4),E=4/3*i*j,V=4/3*n*j,H=[e,t],q=[e+E*z,t-V*W],B=[a+E*F,r-V*G],N=[a,r];if(q[0]=2*H[0]-q[0],q[1]=2*H[1]-q[1],h)return[q,B,N].concat(c);c=[q,B,N].concat(c);for(var Y=[],Z=0;Z<c.length;Z+=3){var Q=A(c[Z][0],c[Z][1],f),U=A(c[Z+1][0],c[Z+1][1],f),$=A(c[Z+2][0],c[Z+2][1],f);Y.push([Q[0],Q[1],U[0],U[1],$[0],$[1]])}return Y}var E={randOffset:function(e,t){return $(e,t)},randOffsetWithRange:function(e,t,a){return U(e,t,a)},ellipse:function(e,t,a,r,i){return B(e,t,i,q(a,r,i)).opset},doubleLineOps:function(e,t,a,r,i){return X(e,t,a,r,i,!0)}};function V(e,t,a,r,i){return{type:"path",ops:X(e,t,a,r,i)}}function H(e,t,a){var r=(e||[]).length;if(r>2){for(var i=[],n=0;n<r-1;n++)i.push.apply(i,v(X(e[n][0],e[n][1],e[n+1][0],e[n+1][1],a)));return t&&i.push.apply(i,v(X(e[r-1][0],e[r-1][1],e[0][0],e[0][1],a))),{type:"path",ops:i}}return 2===r?V(e[0][0],e[0][1],e[1][0],e[1][1],a):{type:"path",ops:[]}}function q(e,t,a){var r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(a.curveStepCount,a.curveStepCount/Math.sqrt(200)*r)),n=2*Math.PI/i,s=Math.abs(e/2),o=Math.abs(t/2),l=1-a.curveFitting;return{increment:n,rx:s+=$(s*l,a),ry:o+=$(o*l,a)}}function B(e,t,a,r){var i=d(te(r.increment,e,t,r.rx,r.ry,1,r.increment*U(.1,U(.4,1,a),a),a),2),n=i[0],s=i[1],o=ee(n,null,a);if(!a.disableMultiStroke&&0!==a.roughness){var l=ee(d(te(r.increment,e,t,r.rx,r.ry,1.5,0,a),1)[0],null,a);o=o.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function N(e,t,a,r,i,n,s,o,l){var h=e,u=t,f=Math.abs(a/2),c=Math.abs(r/2);f+=$(.01*f,l),c+=$(.01*c,l);for(var p=i,d=n;p<0;)p+=2*Math.PI,d+=2*Math.PI;d-p>2*Math.PI&&(p=0,d=2*Math.PI);var g=2*Math.PI/l.curveStepCount,y=Math.min(g/2,(d-p)/2),m=ae(y,h,u,f,c,p,d,1,l);if(!l.disableMultiStroke){var b=ae(y,h,u,f,c,p,d,1.5,l);m.push.apply(m,v(b))}return s&&(o?m.push.apply(m,v(X(h,u,h+f*Math.cos(p),u+c*Math.sin(p),l)).concat(v(X(h,u,h+f*Math.cos(d),u+c*Math.sin(d),l)))):m.push({op:"lineTo",data:[h,u]},{op:"lineTo",data:[h+f*Math.cos(p),u+c*Math.sin(p)]})),{type:"path",ops:m}}function Y(e,t){var a,r=[],i=m(e);try{for(i.s();!(a=i.n()).done;){var n=a.value;if(n.length){var s=t.maxRandomnessOffset||0,o=n.length;if(o>2){r.push({op:"move",data:[n[0][0]+$(s,t),n[0][1]+$(s,t)]});for(var l=1;l<o;l++)r.push({op:"lineTo",data:[n[l][0]+$(s,t),n[l][1]+$(s,t)]})}}}}catch(e){i.e(e)}finally{i.f()}return{type:"fillPath",ops:r}}function Z(e,t){return function(e,t){var a=e.fillStyle||"hachure";if(!_[a])switch(a){case"zigzag":_[a]||(_[a]=new P(t));break;case"cross-hatch":_[a]||(_[a]=new D(t));break;case"dots":_[a]||(_[a]=new R(t));break;case"dashed":_[a]||(_[a]=new C(t));break;case"zigzag-line":_[a]||(_[a]=new T(t));break;default:_[a="hachure"]||(_[a]=new O(t))}return _[a]}(t,E).fillPolygons(e,t)}function Q(e){return e.randomizer||(e.randomizer=new L(e.seed||0)),e.randomizer.next()}function U(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return a.roughness*r*(Q(a)*(t-e)+e)}function $(e,t){return U(-e,e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function X(e,t,a,r,i){var n=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?i.disableMultiStrokeFill:i.disableMultiStroke,s=K(e,t,a,r,i,!0,!1);if(n)return s;var o=K(e,t,a,r,i,!0,!0);return s.concat(o)}function K(e,t,a,r,i,n,s){var o,l=Math.pow(e-a,2)+Math.pow(t-r,2),h=Math.sqrt(l);o=h<200?1:h>500?.4:-.0016668*h+1.233334;var u=i.maxRandomnessOffset||0;u*u*100>l&&(u=h/10);var f=u/2,c=.2+.2*Q(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,d=i.bowing*i.maxRandomnessOffset*(e-a)/200;p=$(p,i,o),d=$(d,i,o);var v=[],g=function(){return $(f,i,o)},y=function(){return $(u,i,o)},m=i.preserveVertices;return n&&(s?v.push({op:"move",data:[e+(m?0:g()),t+(m?0:g())]}):v.push({op:"move",data:[e+(m?0:$(u,i,o)),t+(m?0:$(u,i,o))]})),s?v.push({op:"bcurveTo",data:[p+e+(a-e)*c+g(),d+t+(r-t)*c+g(),p+e+2*(a-e)*c+g(),d+t+2*(r-t)*c+g(),a+(m?0:g()),r+(m?0:g())]}):v.push({op:"bcurveTo",data:[p+e+(a-e)*c+y(),d+t+(r-t)*c+y(),p+e+2*(a-e)*c+y(),d+t+2*(r-t)*c+y(),a+(m?0:y()),r+(m?0:y())]}),v}function J(e,t,a){var r=[];r.push([e[0][0]+$(t,a),e[0][1]+$(t,a)]),r.push([e[0][0]+$(t,a),e[0][1]+$(t,a)]);for(var i=1;i<e.length;i++)r.push([e[i][0]+$(t,a),e[i][1]+$(t,a)]),i===e.length-1&&r.push([e[i][0]+$(t,a),e[i][1]+$(t,a)]);return ee(r,null,a)}function ee(e,t,a){var r=e.length,i=[];if(r>3){var n=[],s=1-a.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(var o=1;o+2<r;o++){var l=e[o];n[0]=[l[0],l[1]],n[1]=[l[0]+(s*e[o+1][0]-s*e[o-1][0])/6,l[1]+(s*e[o+1][1]-s*e[o-1][1])/6],n[2]=[e[o+1][0]+(s*e[o][0]-s*e[o+2][0])/6,e[o+1][1]+(s*e[o][1]-s*e[o+2][1])/6],n[3]=[e[o+1][0],e[o+1][1]],i.push({op:"bcurveTo",data:[n[1][0],n[1][1],n[2][0],n[2][1],n[3][0],n[3][1]]})}if(t&&2===t.length){var h=a.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+$(h,a),t[1]+$(h,a)]})}}else 3===r?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&i.push.apply(i,v(X(e[0][0],e[0][1],e[1][0],e[1][1],a)));return i}function te(e,t,a,r,i,n,s,o){var l=[],h=[];if(0===o.roughness){e/=4,h.push([t+r*Math.cos(-e),a+i*Math.sin(-e)]);for(var u=0;u<=2*Math.PI;u+=e){var f=[t+r*Math.cos(u),a+i*Math.sin(u)];l.push(f),h.push(f)}h.push([t+r*Math.cos(0),a+i*Math.sin(0)]),h.push([t+r*Math.cos(e),a+i*Math.sin(e)])}else{var c=$(.5,o)-Math.PI/2;h.push([$(n,o)+t+.9*r*Math.cos(c-e),$(n,o)+a+.9*i*Math.sin(c-e)]);for(var p=2*Math.PI+c-.01,d=c;d<p;d+=e){var v=[$(n,o)+t+r*Math.cos(d),$(n,o)+a+i*Math.sin(d)];l.push(v),h.push(v)}h.push([$(n,o)+t+r*Math.cos(c+2*Math.PI+.5*s),$(n,o)+a+i*Math.sin(c+2*Math.PI+.5*s)]),h.push([$(n,o)+t+.98*r*Math.cos(c+s),$(n,o)+a+.98*i*Math.sin(c+s)]),h.push([$(n,o)+t+.9*r*Math.cos(c+.5*s),$(n,o)+a+.9*i*Math.sin(c+.5*s)])}return[h,l]}function ae(e,t,a,r,i,n,s,o,l){var h=n+$(.1,l),u=[];u.push([$(o,l)+t+.9*r*Math.cos(h-e),$(o,l)+a+.9*i*Math.sin(h-e)]);for(var f=h;f<=s;f+=e)u.push([$(o,l)+t+r*Math.cos(f),$(o,l)+a+i*Math.sin(f)]);return u.push([t+r*Math.cos(s),a+i*Math.sin(s)]),u.push([t+r*Math.cos(s),a+i*Math.sin(s)]),ee(u,null,l)}function re(e){return v(e)}function ie(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function ne(e,t,a){var r=ie(t,a);if(0===r)return ie(e,t);var i=((e[0]-t[0])*(a[0]-t[0])+(e[1]-t[1])*(a[1]-t[1]))/r;return ie(e,se(t,a,i=Math.max(0,Math.min(1,i))))}function se(e,t,a){return[e[0]+(t[0]-e[0])*a,e[1]+(t[1]-e[1])*a]}function oe(e,t,a,r){var i,n,s=r||[];if(function(e,t){var a=e[t+0],r=e[t+1],i=e[t+2],n=e[t+3],s=3*r[0]-2*a[0]-n[0];s*=s;var o=3*r[1]-2*a[1]-n[1];o*=o;var l=3*i[0]-2*n[0]-a[0];l*=l;var h=3*i[1]-2*n[1]-a[1];return s<l&&(s=l),o<(h*=h)&&(o=h),s+o}(e,t)<a){var o=e[t+0];s.length?(i=s[s.length-1],n=o,Math.sqrt(ie(i,n))>1&&s.push(o)):s.push(o),s.push(e[t+3])}else{var l=.5,h=e[t+0],u=e[t+1],f=e[t+2],c=e[t+3],p=se(h,u,l),d=se(u,f,l),v=se(f,c,l),g=se(p,d,l),y=se(d,v,l),m=se(g,y,l);oe([h,p,g,m],0,a,s),oe([m,y,v,c],0,a,s)}return s}function le(e,t){return he(e,0,e.length,t)}function he(e,t,a,r,i){for(var n=i||[],s=e[t],o=e[a-1],l=0,h=1,u=t+1;u<a-1;++u){var f=ne(e[u],s,o);f>l&&(l=f,h=u)}return Math.sqrt(l)>r?(he(e,t,h+1,r,n),he(e,h,a,r,n)):(n.length||n.push(s),n.push(o)),n}function ue(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,a=arguments.length>2?arguments[2]:void 0,r=[],i=(e.length-1)/3,n=0;n<i;n++)oe(e,3*n,t,r);return a&&a>0?he(r,0,r.length,a):r}var fe="none",ce=function(){function e(t){s(this,e),this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}return l(e,[{key:"_o",value:function(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}},{key:"_d",value:function(e,t,a){return{shape:e,sets:t||[],options:a||this.defaultOptions}}},{key:"line",value:function(e,t,a,r,i){var n=this._o(i);return this._d("line",[V(e,t,a,r,n)],n)}},{key:"rectangle",value:function(e,t,a,r,i){var n=this._o(i),s=[],o=function(e,t,a,r,i){return function(e,t){return H(e,!0,t)}([[e,t],[e+a,t],[e+a,t+r],[e,t+r]],i)}(e,t,a,r,n);if(n.fill){var l=[[e,t],[e+a,t],[e+a,t+r],[e,t+r]];"solid"===n.fillStyle?s.push(Y([l],n)):s.push(Z([l],n))}return n.stroke!==fe&&s.push(o),this._d("rectangle",s,n)}},{key:"ellipse",value:function(e,t,a,r,i){var n=this._o(i),s=[],o=q(a,r,n),l=B(e,t,n,o);if(n.fill)if("solid"===n.fillStyle){var h=B(e,t,n,o).opset;h.type="fillPath",s.push(h)}else s.push(Z([l.estimatedPoints],n));return n.stroke!==fe&&s.push(l.opset),this._d("ellipse",s,n)}},{key:"circle",value:function(e,t,a,r){var i=this.ellipse(e,t,a,a,r);return i.shape="circle",i}},{key:"linearPath",value:function(e,t){var a=this._o(t);return this._d("linearPath",[H(e,!1,a)],a)}},{key:"arc",value:function(e,t,a,r,i,n){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this._o(o),h=[],u=N(e,t,a,r,i,n,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){var f=Object.assign({},l);f.disableMultiStroke=!0;var c=N(e,t,a,r,i,n,!0,!1,f);c.type="fillPath",h.push(c)}else h.push(function(e,t,a,r,i,n,s){var o=e,l=t,h=Math.abs(a/2),u=Math.abs(r/2);h+=$(.01*h,s),u+=$(.01*u,s);for(var f=i,c=n;f<0;)f+=2*Math.PI,c+=2*Math.PI;c-f>2*Math.PI&&(f=0,c=2*Math.PI);for(var p=(c-f)/s.curveStepCount,d=[],v=f;v<=c;v+=p)d.push([o+h*Math.cos(v),l+u*Math.sin(v)]);return d.push([o+h*Math.cos(c),l+u*Math.sin(c)]),d.push([o,l]),Z([d],s)}(e,t,a,r,i,n,l));return l.stroke!==fe&&h.push(u),this._d("arc",h,l)}},{key:"curve",value:function(e,t){var a=this._o(t),r=[],i=function(e,t){var a=J(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){var r=J(e,1.5*(1+.22*t.roughness),function(e){var t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}(t));a=a.concat(r)}return{type:"path",ops:a}}(e,a);if(a.fill&&a.fill!==fe&&e.length>=3){var n=ue(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.length;if(a<3)throw new Error("A curve must have at least three points.");var r=[];if(3===a)r.push(re(e[0]),re(e[1]),re(e[2]),re(e[2]));else{var i=[];i.push(e[0],e[0]);for(var n=1;n<e.length;n++)i.push(e[n]),n===e.length-1&&i.push(e[n]);var s=[],o=1-t;r.push(re(i[0]));for(var l=1;l+2<i.length;l++){var h=i[l];s[0]=[h[0],h[1]],s[1]=[h[0]+(o*i[l+1][0]-o*i[l-1][0])/6,h[1]+(o*i[l+1][1]-o*i[l-1][1])/6],s[2]=[i[l+1][0]+(o*i[l][0]-o*i[l+2][0])/6,i[l+1][1]+(o*i[l][1]-o*i[l+2][1])/6],s[3]=[i[l+1][0],i[l+1][1]],r.push(s[1],s[2],s[3])}}return r}(e),10,(1+a.roughness)/2);"solid"===a.fillStyle?r.push(Y([n],a)):r.push(Z([n],a))}return a.stroke!==fe&&r.push(i),this._d("curve",r,a)}},{key:"polygon",value:function(e,t){var a=this._o(t),r=[],i=H(e,!0,a);return a.fill&&("solid"===a.fillStyle?r.push(Y([e],a)):r.push(Z([e],a))),a.stroke!==fe&&r.push(i),this._d("polygon",r,a)}},{key:"path",value:function(e,t){var a=this._o(t),r=[];if(!e)return this._d("path",r,a);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");var i=a.fill&&"transparent"!==a.fill&&a.fill!==fe,n=a.stroke!==fe,s=!!(a.simplification&&a.simplification<1),o=function(e,t,a){var r,i=j(F(G(e))),n=[],s=[],o=[0,0],l=[],h=function(){var e;l.length>=4&&(e=s).push.apply(e,v(ue(l,1))),l=[]},u=function(){h(),s.length&&(n.push(s),s=[])},f=m(i);try{for(f.s();!(r=f.n()).done;){var c=r.value,p=c.key,d=c.data;switch(p){case"M":u(),o=[d[0],d[1]],s.push(o);break;case"L":h(),s.push([d[0],d[1]]);break;case"C":if(!l.length){var g=s.length?s[s.length-1]:o;l.push([g[0],g[1]])}l.push([d[0],d[1]]),l.push([d[2],d[3]]),l.push([d[4],d[5]]);break;case"Z":h(),s.push([o[0],o[1]])}}}catch(e){f.e(e)}finally{f.f()}if(u(),!a)return n;for(var y=[],b=0,k=n;b<k.length;b++){var M=le(k[b],a);M.length&&y.push(M)}return y}(e,0,s?4-4*a.simplification:(1+a.roughness)/2);return i&&("solid"===a.fillStyle?r.push(Y(o,a)):r.push(Z(o,a))),n&&(s?o.forEach((function(e){r.push(H(e,!1,a))})):r.push(function(e,t){var a,r=j(F(G(e))),i=[],n=[0,0],s=[0,0],o=m(r);try{var l=function(){var e=a.value,r=e.key,o=e.data;switch(r){case"M":var l=1*(t.maxRandomnessOffset||0),h=t.preserveVertices;i.push({op:"move",data:o.map((function(e){return e+(h?0:$(l,t))}))}),s=[o[0],o[1]],n=[o[0],o[1]];break;case"L":i.push.apply(i,v(X(s[0],s[1],o[0],o[1],t))),s=[o[0],o[1]];break;case"C":var u=d(o,6),f=u[0],c=u[1],p=u[2],g=u[3],y=u[4],m=u[5];i.push.apply(i,v(function(e,t,a,r,i,n,s,o){for(var l=[],h=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3],u=[0,0],f=o.disableMultiStroke?1:2,c=o.preserveVertices,p=0;p<f;p++)0===p?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(c?0:$(h[0],o)),s[1]+(c?0:$(h[0],o))]}),u=c?[i,n]:[i+$(h[p],o),n+$(h[p],o)],l.push({op:"bcurveTo",data:[e+$(h[p],o),t+$(h[p],o),a+$(h[p],o),r+$(h[p],o),u[0],u[1]]});return l}(f,c,p,g,y,m,s,t))),s=[y,m];break;case"Z":i.push.apply(i,v(X(s[0],s[1],n[0],n[1],t))),s=[n[0],n[1]]}};for(o.s();!(a=o.n()).done;)l()}catch(e){o.e(e)}finally{o.f()}return{type:"path",ops:i}}(e,a))),this._d("path",r,a)}},{key:"opsToPath",value:function(e,t){var a,r="",i=m(e.ops);try{for(i.s();!(a=i.n()).done;){var n=a.value,s="number"==typeof t&&t>=0?n.data.map((function(e){return+e.toFixed(t)})):n.data;switch(n.op){case"move":r+="M".concat(s[0]," ").concat(s[1]," ");break;case"bcurveTo":r+="C".concat(s[0]," ").concat(s[1],", ").concat(s[2]," ").concat(s[3],", ").concat(s[4]," ").concat(s[5]," ");break;case"lineTo":r+="L".concat(s[0]," ").concat(s[1]," ")}}}catch(e){i.e(e)}finally{i.f()}return r.trim()}},{key:"toPaths",value:function(e){var t,a=e.sets||[],r=e.options||this.defaultOptions,i=[],n=m(a);try{for(n.s();!(t=n.n()).done;){var s=t.value,o=null;switch(s.type){case"path":o={d:this.opsToPath(s),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:fe};break;case"fillPath":o={d:this.opsToPath(s),stroke:fe,strokeWidth:0,fill:r.fill||fe};break;case"fillSketch":o=this.fillSketch(s,r)}o&&i.push(o)}}catch(e){n.e(e)}finally{n.f()}return i}},{key:"fillSketch",value:function(e,t){var a=t.fillWeight;return a<0&&(a=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||fe,strokeWidth:a,fill:fe}}}],[{key:"newSeed",value:function(){return Math.floor(Math.random()*Math.pow(2,31))}}]),e}(),pe=function(){function e(t,a){s(this,e),this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ce(a)}return l(e,[{key:"draw",value:function(e){var t,a=e.sets||[],r=e.options||this.getDefaultOptions(),i=this.ctx,n=e.options.fixedDecimalPlaceDigits,s=m(a);try{for(s.s();!(t=s.n()).done;){var o=t.value;switch(o.type){case"path":i.save(),i.strokeStyle="none"===r.stroke?"transparent":r.stroke,i.lineWidth=r.strokeWidth,r.strokeLineDash&&i.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(i.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(i,o,n),i.restore();break;case"fillPath":i.save(),i.fillStyle=r.fill||"";var l="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(i,o,n,l),i.restore();break;case"fillSketch":this.fillSketch(i,o,r)}}}catch(e){s.e(e)}finally{s.f()}}},{key:"fillSketch",value:function(e,t,a){var r=a.fillWeight;r<0&&(r=a.strokeWidth/2),e.save(),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),e.strokeStyle=a.fill||"",e.lineWidth=r,this._drawToContext(e,t,a.fixedDecimalPlaceDigits),e.restore()}},{key:"_drawToContext",value:function(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";e.beginPath();var i,n=m(t.ops);try{for(n.s();!(i=n.n()).done;){var s=i.value,o="number"==typeof a&&a>=0?s.data.map((function(e){return+e.toFixed(a)})):s.data;switch(s.op){case"move":e.moveTo(o[0],o[1]);break;case"bcurveTo":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":e.lineTo(o[0],o[1])}}}catch(e){n.e(e)}finally{n.f()}"fillPath"===t.type?e.fill(r):e.stroke()}},{key:"generator",get:function(){return this.gen}},{key:"getDefaultOptions",value:function(){return this.gen.defaultOptions}},{key:"line",value:function(e,t,a,r,i){var n=this.gen.line(e,t,a,r,i);return this.draw(n),n}},{key:"rectangle",value:function(e,t,a,r,i){var n=this.gen.rectangle(e,t,a,r,i);return this.draw(n),n}},{key:"ellipse",value:function(e,t,a,r,i){var n=this.gen.ellipse(e,t,a,r,i);return this.draw(n),n}},{key:"circle",value:function(e,t,a,r){var i=this.gen.circle(e,t,a,r);return this.draw(i),i}},{key:"linearPath",value:function(e,t){var a=this.gen.linearPath(e,t);return this.draw(a),a}},{key:"polygon",value:function(e,t){var a=this.gen.polygon(e,t);return this.draw(a),a}},{key:"arc",value:function(e,t,a,r,i,n){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this.gen.arc(e,t,a,r,i,n,s,o);return this.draw(l),l}},{key:"curve",value:function(e,t){var a=this.gen.curve(e,t);return this.draw(a),a}},{key:"path",value:function(e,t){var a=this.gen.path(e,t);return this.draw(a),a}}]),e}(),de=function(e,t){return new pe(e,t)};const ve={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};let ge=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="arc",this.numberType=a.ARC_NUMBER_TYPE}draw(e,t,r,i){const{context:n}=r;if(!n)return;const s=n.canvas.nativeCanvas,o=de(s);n.highPerformanceSave();const l=a.getTheme(e).arc;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,n.setTransformForCurrent()}else h=0,u=0,n.transformFromMatrix(e.transMatrix,!0);const f=new a.CustomPath2D,{fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth,outerRadius:v=l.outerRadius,innerRadius:g=l.innerRadius,maxRandomnessOffset:y=ve.maxRandomnessOffset,roughness:m=ve.roughness,bowing:b=ve.bowing,curveFitting:k=ve.curveFitting,curveTightness:M=ve.curveTightness,curveStepCount:S=ve.curveStepCount,fillStyle:x=ve.fillStyle,fillWeight:w=ve.fillWeight,hachureAngle:O=ve.hachureAngle,hachureGap:P=ve.hachureGap,simplification:D=ve.simplification,dashOffset:R=ve.dashOffset,dashGap:C=ve.dashGap,zigzagOffset:T=ve.zigzagOffset,seed:_=ve.seed,fillLineDash:L=ve.fillLineDash,fillLineDashOffset:W=ve.fillLineDashOffset,disableMultiStroke:z=ve.disableMultiStroke,disableMultiStrokeFill:G=ve.disableMultiStrokeFill,preserveVertices:F=ve.preserveVertices,fixedDecimalPlaceDigits:j=ve.fixedDecimalPlaceDigits}=e.attribute;a.drawArcPath(e,f,h,u,v,g),o.path(f.toString(),{fill:c||void 0,stroke:p||void 0,strokeWidth:d,maxRandomnessOffset:y,roughness:m,bowing:b,curveFitting:k,curveTightness:M,curveStepCount:S,fillStyle:x,fillWeight:w,hachureAngle:O,hachureGap:P,simplification:D,dashOffset:R,dashGap:C,zigzagOffset:T,seed:_,fillLineDash:L,fillLineDashOffset:W,disableMultiStroke:z,disableMultiStrokeFill:G,preserveVertices:F,fixedDecimalPlaceDigits:j}),n.highPerformanceRestore()}drawShape(e,t,a,r,i,n,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,i,n,s,o)}};ge=b([r.injectable(),k(0,r.inject(a.DefaultCanvasArcRender)),M("design:paramtypes",[Object])],ge);let ye=class extends a.DefaultCanvasAreaRender{style="rough";drawSegmentItem(e,t,r,i,n,s,o,l,h,u,f,c){if(c)return super.drawSegmentItem(e,t,r,i,n,s,o,l,h,u,f,c);e.highPerformanceSave();const p=e.canvas.nativeCanvas,d=de(p,{}),v=new a.CustomPath2D;a.drawAreaSegments(v,t,o,{offsetX:l,offsetY:h});const{maxRandomnessOffset:g=ve.maxRandomnessOffset,roughness:y=ve.roughness,bowing:m=ve.bowing,curveFitting:b=ve.curveFitting,curveTightness:k=ve.curveTightness,curveStepCount:M=ve.curveStepCount,fillStyle:S=ve.fillStyle,fillWeight:x=ve.fillWeight,hachureAngle:w=ve.hachureAngle,hachureGap:O=ve.hachureGap,simplification:P=ve.simplification,dashOffset:D=ve.dashOffset,dashGap:R=ve.dashGap,zigzagOffset:C=ve.zigzagOffset,seed:T=ve.seed,fillLineDash:_=ve.fillLineDash,fillLineDashOffset:L=ve.fillLineDashOffset,disableMultiStroke:W=ve.disableMultiStroke,disableMultiStrokeFill:z=ve.disableMultiStrokeFill,preserveVertices:G=ve.preserveVertices,fixedDecimalPlaceDigits:F=ve.fixedDecimalPlaceDigits}=n;let{fill:j,stroke:A,lineWidth:I}=n;return Array.isArray(s)?s.forEach((e=>{j=j??e.fill,A=A??e.stroke,I=I??e.lineWidth})):(j=j??s.fill,A=A??s.stroke,I=I??s.lineWidth),d.path(v.toString(),{fill:r?j:void 0,strokeWidth:I,maxRandomnessOffset:g,roughness:y,bowing:m,curveFitting:b,curveTightness:k,curveStepCount:M,fillStyle:S,fillWeight:x,hachureAngle:w,hachureGap:O,simplification:P,dashOffset:D,dashGap:R,zigzagOffset:C,seed:T,fillLineDash:_,fillLineDashOffset:L,disableMultiStroke:W,disableMultiStrokeFill:z,preserveVertices:G,fixedDecimalPlaceDigits:F}),e.highPerformanceRestore(),!1}};ye=b([r.injectable()],ye);let me=class{canvasRenderer;style="rough";constructor(e){this.canvasRenderer=e,this.type="circle",this.numberType=a.CIRCLE_NUMBER_TYPE}draw(e,t,r,i){const{context:n}=r;if(!n)return;const s=n.canvas.nativeCanvas,o=de(s,{}),l=a.getTheme(e).circle;let{x:h=l.x,y:u=l.y}=e.attribute;e.transMatrix.onlyTranslate()?n.onlyTranslate()||n.clearMatrix():(h=0,u=0,n.transformFromMatrix(e.transMatrix,!0));const{radius:f=l.radius,fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth}=e.attribute;o.circle(h,u,f,{fill:c||void 0,stroke:p||void 0,strokeWidth:d,fillStyle:"zigzag",roughness:.5})}drawShape(e,t,a,r,i,n,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,i,n,s,o)}};me=b([r.injectable(),k(0,r.inject(a.DefaultCanvasCircleRender)),M("design:paramtypes",[Object])],me);let be=class extends a.DefaultCanvasLineRender{style="rough";drawSegmentItem(e,t,r,i,n,s,o,l,h,u,f,c,p,d,v){if(d||v)return super.drawSegmentItem(e,t,r,i,n,s,o,l,h,u,f,c,p,d,v);e.highPerformanceSave();const g=e.canvas.nativeCanvas,y=de(g,{}),m=new a.CustomPath2D;a.drawSegments(e.camera?e:e.nativeContext,t,h,u,{offsetX:f,offsetY:c});const{maxRandomnessOffset:b=ve.maxRandomnessOffset,roughness:k=ve.roughness,bowing:M=ve.bowing,curveFitting:S=ve.curveFitting,curveTightness:x=ve.curveTightness,curveStepCount:w=ve.curveStepCount,fillStyle:O=ve.fillStyle,fillWeight:P=ve.fillWeight,hachureAngle:D=ve.hachureAngle,hachureGap:R=ve.hachureGap,simplification:C=ve.simplification,dashOffset:T=ve.dashOffset,dashGap:_=ve.dashGap,zigzagOffset:L=ve.zigzagOffset,seed:W=ve.seed,fillLineDash:z=ve.fillLineDash,fillLineDashOffset:G=ve.fillLineDashOffset,disableMultiStroke:F=ve.disableMultiStroke,disableMultiStrokeFill:j=ve.disableMultiStrokeFill,preserveVertices:A=ve.preserveVertices,fixedDecimalPlaceDigits:I=ve.fixedDecimalPlaceDigits}=o;let{fill:E,stroke:V,lineWidth:H}=o;return Array.isArray(l)?l.forEach((e=>{E=E??e.fill,V=V??e.stroke,H=H??e.lineWidth})):(E=E??l.fill,V=V??l.stroke,H=H??l.lineWidth),y.path(m.toString(),{fill:r?E:void 0,stroke:i?V:void 0,strokeWidth:H,maxRandomnessOffset:b,roughness:k,bowing:M,curveFitting:S,curveTightness:x,curveStepCount:w,fillStyle:O,fillWeight:P,hachureAngle:D,hachureGap:R,simplification:C,dashOffset:T,dashGap:_,zigzagOffset:L,seed:W,fillLineDash:z,fillLineDashOffset:G,disableMultiStroke:F,disableMultiStrokeFill:j,preserveVertices:A,fixedDecimalPlaceDigits:I}),e.highPerformanceRestore(),!1}};be=b([r.injectable()],be);let ke=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="path",this.numberType=a.PATH_NUMBER_TYPE}draw(e,t,r,i){const{context:n}=r;if(!n)return;const s=n.canvas.nativeCanvas,o=de(s,{});n.highPerformanceSave();const l=a.getTheme(e).path;n.transformFromMatrix(e.transMatrix,!0);const{fill:h=l.fill,stroke:u=l.stroke,lineWidth:f=l.lineWidth,path:c=l.path,maxRandomnessOffset:p=ve.maxRandomnessOffset,roughness:d=ve.roughness,bowing:v=ve.bowing,curveFitting:g=ve.curveFitting,curveTightness:y=ve.curveTightness,curveStepCount:m=ve.curveStepCount,fillStyle:b=ve.fillStyle,fillWeight:k=ve.fillWeight,hachureAngle:M=ve.hachureAngle,hachureGap:S=ve.hachureGap,simplification:x=ve.simplification,dashOffset:w=ve.dashOffset,dashGap:O=ve.dashGap,zigzagOffset:P=ve.zigzagOffset,seed:D=ve.seed,fillLineDash:R=ve.fillLineDash,fillLineDashOffset:C=ve.fillLineDashOffset,disableMultiStroke:T=ve.disableMultiStroke,disableMultiStrokeFill:_=ve.disableMultiStrokeFill,preserveVertices:L=ve.preserveVertices,fixedDecimalPlaceDigits:W=ve.fixedDecimalPlaceDigits}=e.attribute;"string"==typeof c&&o.path(c,{fill:h||void 0,stroke:u||void 0,strokeWidth:f,maxRandomnessOffset:p,roughness:d,bowing:v,curveFitting:g,curveTightness:y,curveStepCount:m,fillStyle:b,fillWeight:k,hachureAngle:M,hachureGap:S,simplification:x,dashOffset:w,dashGap:O,zigzagOffset:P,seed:D,fillLineDash:R,fillLineDashOffset:C,disableMultiStroke:T,disableMultiStrokeFill:_,preserveVertices:L,fixedDecimalPlaceDigits:W}),n.highPerformanceRestore()}drawShape(e,t,a,r,i,n,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,i,n,s,o)}};ke=b([r.injectable(),k(0,r.inject(a.DefaultCanvasPathRender)),M("design:paramtypes",[Object])],ke);let Me=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="rect",this.numberType=a.RECT_NUMBER_TYPE}draw(e,t,r,i){const{context:n}=r;if(!n)return;const s=n.canvas.nativeCanvas,o=de(s);n.highPerformanceSave();const l=a.getTheme(e).rect;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,n.setTransformForCurrent()}else h=0,u=0,n.transformFromMatrix(e.transMatrix,!0);const{fill:f=l.fill,stroke:c=l.stroke,fillColor:p=l.fill,strokeColor:d=l.stroke,width:v=l.width,height:g=l.height,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=ve.maxRandomnessOffset,roughness:b=ve.roughness,bowing:k=ve.bowing,curveFitting:M=ve.curveFitting,curveTightness:S=ve.curveTightness,curveStepCount:x=ve.curveStepCount,fillStyle:w=ve.fillStyle,fillWeight:O=ve.fillWeight,hachureAngle:P=ve.hachureAngle,hachureGap:D=ve.hachureGap,simplification:R=ve.simplification,dashOffset:C=ve.dashOffset,dashGap:T=ve.dashGap,zigzagOffset:_=ve.zigzagOffset,seed:L=ve.seed,fillLineDash:W=ve.fillLineDash,fillLineDashOffset:z=ve.fillLineDashOffset,disableMultiStroke:G=ve.disableMultiStroke,disableMultiStrokeFill:F=ve.disableMultiStrokeFill,preserveVertices:j=ve.preserveVertices,fixedDecimalPlaceDigits:A=ve.fixedDecimalPlaceDigits}=e.attribute;o.rectangle(h,u,v,g,{fill:f?p:void 0,stroke:c?d:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:w,fillWeight:O,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:C,dashGap:T,zigzagOffset:_,seed:L,fillLineDash:W,fillLineDashOffset:z,disableMultiStroke:G,disableMultiStrokeFill:F,preserveVertices:j,fixedDecimalPlaceDigits:A}),n.highPerformanceRestore()}drawShape(e,t,a,r,i,n,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,i,n,s,o)}};Me=b([r.injectable(),k(0,r.inject(a.DefaultCanvasRectRender)),M("design:paramtypes",[Object])],Me);let Se=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="symbol",this.numberType=a.SYMBOL_NUMBER_TYPE}draw(e,t,r,i){const{context:n}=r;if(!n)return;const s=n.canvas.nativeCanvas,o=de(s);n.highPerformanceSave();const l=a.getTheme(e).symbol;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,n.setTransformForCurrent()}else h=0,u=0,n.transformFromMatrix(e.transMatrix,!0);const f=e.getParsedPath();if(!f)return;const{fill:c=l.fill,stroke:p=l.stroke,fillColor:d=l.fill,strokeColor:v=l.stroke,size:g=l.size,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=ve.maxRandomnessOffset,roughness:b=ve.roughness,bowing:k=ve.bowing,curveFitting:M=ve.curveFitting,curveTightness:S=ve.curveTightness,curveStepCount:x=ve.curveStepCount,fillStyle:w=ve.fillStyle,fillWeight:O=ve.fillWeight,hachureAngle:P=ve.hachureAngle,hachureGap:D=ve.hachureGap,simplification:R=ve.simplification,dashOffset:C=ve.dashOffset,dashGap:T=ve.dashGap,zigzagOffset:_=ve.zigzagOffset,seed:L=ve.seed,fillLineDash:W=ve.fillLineDash,fillLineDashOffset:z=ve.fillLineDashOffset,disableMultiStroke:G=ve.disableMultiStroke,disableMultiStrokeFill:F=ve.disableMultiStrokeFill,preserveVertices:j=ve.preserveVertices,fixedDecimalPlaceDigits:A=ve.fixedDecimalPlaceDigits}=e.attribute,I=new a.CustomPath2D;f.draw(I,g,h,u)&&I.closePath(),o.path(I.toString(),{fill:c?d:void 0,stroke:p?v:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:w,fillWeight:O,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:C,dashGap:T,zigzagOffset:_,seed:L,fillLineDash:W,fillLineDashOffset:z,disableMultiStroke:G,disableMultiStrokeFill:F,preserveVertices:j,fixedDecimalPlaceDigits:A}),n.highPerformanceRestore()}drawShape(e,t,a,r,i,n,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,i,n,s,o)}};Se=b([r.injectable(),k(0,r.inject(a.DefaultCanvasSymbolRender)),M("design:paramtypes",[Object])],Se);var xe=new r.ContainerModule(((e,t,r,i)=>{e(me).toSelf().inSingletonScope(),e(a.GraphicRender).to(me),e(Me).toSelf().inSingletonScope(),e(a.GraphicRender).to(Me),e(ke).toSelf().inSingletonScope(),e(a.GraphicRender).to(ke),e(Se).toSelf().inSingletonScope(),e(a.GraphicRender).to(Se),e(be).toSelf().inSingletonScope(),e(a.GraphicRender).to(be),e(ye).toSelf().inSingletonScope(),e(a.GraphicRender).to(ye),e(ge).toSelf().inSingletonScope(),e(a.GraphicRender).to(ge)}));new i.Matrix(1,0,0,1,0,0);let we=class extends a.BrowserContext2d{static env="node";constructor(e,t){super(e,t);const a=e.nativeCanvas.getContext("2d");if(!a)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=a,this.canvas=e,this.matrix=new i.Matrix(1,0,0,1,0,0),this.stack=[],this.dpr=t??1}release(...e){}};we=b([r.injectable(),M("design:paramtypes",[Object,Number])],we);const Oe={WIDTH:500,HEIGHT:500,DPR:1};let Pe=class{static env="node";_id;_displayWidth;_displayHeight;_pixelWidth;_pixelHeight;_nativeCanvas;_context;_visiable;controled;_dpr;get id(){return this._id}get x(){return 0}get y(){return 0}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(e){this._pixelWidth=e,this._displayWidth=e/(this._dpr||1)}get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get height(){return this._pixelHeight}set height(e){this._pixelHeight=e,this._displayHeight=e/(this._dpr||1)}getContext(e){return this._context}get visiable(){return this._visiable}set visiable(e){this._visiable=e,e?this.show():this.hide()}get dpr(){return this._dpr}set dpr(e){this._dpr=e,this.resize(this.width,this.height)}constructor(e){const{nativeCanvas:t,width:a=Oe.WIDTH,height:r=Oe.HEIGHT,canvasControled:i=!0,dpr:n=Oe.DPR}=e;this._visiable=!1!==e.visiable,this.controled=i,this._pixelWidth=a*n,this._pixelHeight=r*n,this._displayWidth=a,this._displayHeight=r,this._nativeCanvas=t,this._context=new we(this,e.dpr),this._id=t.id,this._dpr=n}applyPosition(){}getNativeCanvas(){return this._nativeCanvas}resetStyle(e){}hide(){}show(){}resize(e,t){this._pixelWidth=e*this._dpr,this._pixelHeight=t*this._dpr,this._displayWidth=e,this._displayHeight=t,this._nativeCanvas&&(this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight)}toDataURL(e,t){return""}readPixels(e,t,a,r){return this._context.getImageData(e,t,a,r)}convertToBlob(e){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...e){throw new Error("暂不支持release")}};Pe=b([r.injectable(),M("design:paramtypes",[Object])],Pe);var De=new r.ContainerModule((e=>{e(a.CanvasFactory).toDynamicValue((()=>e=>new Pe(e))).whenTargetNamed(we.env),e(a.Context2dFactory).toDynamicValue((()=>e=>new we(e,e.dpr))).whenTargetNamed(we.env)}));const Re=xe,Ce=function(e){e.load(De)};e.canvasModuleLoader=Ce,e.roughModule=Re}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("reflect-metadata"),require("@visactor/vrender"),require("inversify")):"function"==typeof define&&define.amd?define(["exports","reflect-metadata","@visactor/vrender","inversify"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).VRender=e.VRender||{},e.VRender.Kits={}),null,e.vrender,e.inversify)}(this,(function(e,t,a,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(n=r.key,i=void 0,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var r=a.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(n,"string"))?i:String(i)),r)}var n,i}function o(e,t,a){return t&&s(e.prototype,t),a&&s(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function f(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=h(e);if(t){var n=h(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return f(this,a)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,n,i,s,o=[],l=!0,h=!1;try{if(i=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;l=!1}else for(;!(l=(r=i.call(a)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){h=!0,n=e}finally{try{if(!l&&null!=a.return&&(s=a.return(),Object(s)!==s))return}finally{if(h)throw n}}return o}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return g(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function y(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=v(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw i}}}}function m(e,t,a,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,a):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,a,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(o=(s<3?i(o):s>3?i(t,a,o):i(t,a))||o);return s>3&&o&&Object.defineProperty(t,a,o),o}function b(e,t){return function(a,r){t(a,r,e)}}function k(e,t){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function M(e,t,a){if(e&&e.length){var r=p(t,2),n=r[0],i=r[1],s=Math.PI/180*a,o=Math.cos(s),l=Math.sin(s);e.forEach((function(e){var t=p(e,2),a=t[0],r=t[1];e[0]=(a-n)*o-(r-i)*l+n,e[1]=(a-n)*l+(r-i)*o+i}))}}function S(e){var t=e[0],a=e[1];return Math.sqrt(Math.pow(t[0]-a[0],2)+Math.pow(t[1]-a[1],2))}function x(e,t){var a=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var n=[0,0];if(a){var i,s=y(e);try{for(s.s();!(i=s.n()).done;){M(i.value,n,a)}}catch(e){s.e(e)}finally{s.f()}}var o=function(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=d(a.value);i[0].join(",")!==i[i.length-1].join(",")&&i.push([i[0][0],i[0][1]]),i.length>2&&r.push(i)}}catch(e){n.e(e)}finally{n.f()}var s=[];t=Math.max(t,.1);for(var o=[],l=0,h=r;l<h.length;l++)for(var u=h[l],f=0;f<u.length-1;f++){var c=u[f],p=u[f+1];if(c[1]!==p[1]){var v=Math.min(c[1],p[1]);o.push({ymin:v,ymax:Math.max(c[1],p[1]),x:v===c[1]?c[0]:p[0],islope:(p[0]-c[0])/(p[1]-c[1])})}}if(o.sort((function(e,t){return e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)})),!o.length)return s;for(var g=[],m=o[0].ymin;g.length||o.length;){if(o.length){for(var b=-1,k=0;k<o.length&&!(o[k].ymin>m);k++)b=k;o.splice(0,b+1).forEach((function(e){g.push({s:m,edge:e})}))}if(g=g.filter((function(e){return!(e.edge.ymax<=m)})),g.sort((function(e,t){return e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)})),g.length>1)for(var M=0;M<g.length;M+=2){var S=M+1;if(S>=g.length)break;var x=g[M].edge,O=g[S].edge;s.push([[Math.round(x.x),m],[Math.round(O.x),m]])}m+=t,g.forEach((function(e){e.edge.x=e.edge.x+t*e.edge.islope}))}return s}(e,r);if(a){var l,h=y(e);try{for(h.s();!(l=h.n()).done;){M(l.value,n,-a)}}catch(e){h.e(e)}finally{h.f()}!function(e,t,a){var r=[];e.forEach((function(e){return r.push.apply(r,d(e))})),M(r,t,a)}(o,n,-a)}return o}var O=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){return this._fillPolygons(e,t)}},{key:"_fillPolygons",value:function(e,t){var a=x(e,t);return{type:"fillSketch",ops:this.renderLines(a,t)}}},{key:"renderLines",value:function(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=a.value;r.push.apply(r,d(this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],t)))}}catch(e){n.e(e)}finally{n.f()}return r}}]),e}(),w=function(e){l(a,e);var t=c(a);function a(){return i(this,a),t.apply(this,arguments)}return o(a,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap;a<0&&(a=4*t.strokeWidth),a=Math.max(a,.1);var r,n=x(e,Object.assign({},t,{hachureGap:a})),i=Math.PI/180*t.hachureAngle,s=[],o=.5*a*Math.cos(i),l=.5*a*Math.sin(i),h=y(n);try{for(h.s();!(r=h.n()).done;){var u=p(r.value,2),f=u[0],c=u[1];S([f,c])&&s.push([[f[0]-o,f[1]+l],d(c)],[[f[0]+o,f[1]-l],d(c)])}}catch(e){h.e(e)}finally{h.f()}return{type:"fillSketch",ops:this.renderLines(s,t)}}}]),a}(O),P=function(e){l(a,e);var t=c(a);function a(){return i(this,a),t.apply(this,arguments)}return o(a,[{key:"fillPolygons",value:function(e,t){var a=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),n=this._fillPolygons(e,r);return a.ops=a.ops.concat(n.ops),a}}]),a}(O),D=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=x(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(a,t)}},{key:"dotsOnLines",value:function(e,t){var a=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var n=t.fillWeight;n<0&&(n=t.strokeWidth/2);var i,s=r/4,o=y(e);try{for(o.s();!(i=o.n()).done;)for(var l=i.value,h=S(l),u=h/r,f=Math.ceil(u)-1,c=h-f*r,p=(l[0][0]+l[1][0])/2-r/4,v=Math.min(l[0][1],l[1][1]),g=0;g<f;g++){var m=v+c+g*r,b=p-s+2*Math.random()*s,k=m-s+2*Math.random()*s,M=this.helper.ellipse(b,k,n,n,t);a.push.apply(a,d(M.ops))}}catch(e){o.e(e)}finally{o.f()}return{type:"fillSketch",ops:a}}}]),e}(),R=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=x(e,t);return{type:"fillSketch",ops:this.dashedLine(a,t)}}},{key:"dashedLine",value:function(e,t){var a=this,r=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,n=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((function(e){var s=S(e),o=Math.floor(s/(r+n)),l=(s+n-o*(r+n))/2,h=e[0],u=e[1];h[0]>u[0]&&(h=e[1],u=e[0]);for(var f=Math.atan((u[1]-h[1])/(u[0]-h[0])),c=0;c<o;c++){var p=c*(r+n),v=p+r,g=[h[0]+p*Math.cos(f)+l*Math.cos(f),h[1]+p*Math.sin(f)+l*Math.sin(f)],y=[h[0]+v*Math.cos(f)+l*Math.cos(f),h[1]+v*Math.sin(f)+l*Math.sin(f)];i.push.apply(i,d(a.helper.doubleLineOps(g[0],g[1],y[0],y[1],t)))}})),i}}]),e}(),T=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?a:t.zigzagOffset,n=x(e,t=Object.assign({},t,{hachureGap:a+r}));return{type:"fillSketch",ops:this.zigzagLines(n,r,t)}}},{key:"zigzagLines",value:function(e,t,a){var r=this,n=[];return e.forEach((function(e){var i=S(e),s=Math.round(i/(2*t)),o=e[0],l=e[1];o[0]>l[0]&&(o=e[1],l=e[0]);for(var h=Math.atan((l[1]-o[1])/(l[0]-o[0])),u=0;u<s;u++){var f=2*u*t,c=2*(u+1)*t,p=Math.sqrt(2*Math.pow(t,2)),v=[o[0]+f*Math.cos(h),o[1]+f*Math.sin(h)],g=[o[0]+c*Math.cos(h),o[1]+c*Math.sin(h)],y=[v[0]+p*Math.cos(h+Math.PI/4),v[1]+p*Math.sin(h+Math.PI/4)];n.push.apply(n,d(r.helper.doubleLineOps(v[0],v[1],y[0],y[1],a)).concat(d(r.helper.doubleLineOps(y[0],y[1],g[0],g[1],a))))}})),n}}]),e}(),C={},L=function(){function e(t){i(this,e),this.seed=t}return o(e,[{key:"next",value:function(){return this.seed?(Math.pow(2,31)-1&(this.seed=Math.imul(48271,this.seed)))/Math.pow(2,31):Math.random()}}]),e}(),z={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function W(e,t){return e.type===t}function G(e){for(var t=[],a=function(e){for(var t=new Array;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:"".concat(parseFloat(RegExp.$1))},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e),r="BOD",n=0,i=a[n];!W(i,2);){var s=0,o=[];if("BOD"===r){if("M"!==i.text&&"m"!==i.text)return G("M0,0"+e);n++,s=z[i.text],r=i.text}else W(i,1)?s=z[r]:(n++,s=z[i.text],r=i.text);if(!(n+s<a.length))throw new Error("Path data ended short");for(var l=n;l<n+s;l++){var h=a[l];if(!W(h,1))throw new Error("Param not a number: "+r+","+h.text);o[o.length]=+h.text}if("number"!=typeof z[r])throw new Error("Bad segment: "+r);var u={key:r,data:o};t.push(u),i=a[n+=s],"M"===r&&(r="L"),"m"===r&&(r="l")}return t}function F(e){var t,a,r,n,i=0,s=0,o=0,l=0,h=[],u=y(e);try{for(u.s();!(n=u.n()).done;){var f=n.value,c=f.key,v=f.data;switch(c){case"M":h.push({key:"M",data:d(v)}),t=p(v,2),i=t[0],s=t[1],o=(a=p(v,2))[0],l=a[1];break;case"m":i+=v[0],s+=v[1],h.push({key:"M",data:[i,s]}),o=i,l=s;break;case"L":h.push({key:"L",data:d(v)}),r=p(v,2),i=r[0],s=r[1];break;case"l":i+=v[0],s+=v[1],h.push({key:"L",data:[i,s]});break;case"C":h.push({key:"C",data:d(v)}),i=v[4],s=v[5];break;case"c":var g=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"C",data:g}),i=g[4],s=g[5];break;case"Q":h.push({key:"Q",data:d(v)}),i=v[2],s=v[3];break;case"q":var m=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"Q",data:m}),i=m[2],s=m[3];break;case"A":h.push({key:"A",data:d(v)}),i=v[5],s=v[6];break;case"a":i+=v[5],s+=v[6],h.push({key:"A",data:[v[0],v[1],v[2],v[3],v[4],i,s]});break;case"H":h.push({key:"H",data:d(v)}),i=v[0];break;case"h":i+=v[0],h.push({key:"H",data:[i]});break;case"V":h.push({key:"V",data:d(v)}),s=v[0];break;case"v":s+=v[0],h.push({key:"V",data:[s]});break;case"S":h.push({key:"S",data:d(v)}),i=v[2],s=v[3];break;case"s":var b=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"S",data:b}),i=b[2],s=b[3];break;case"T":h.push({key:"T",data:d(v)}),i=v[0],s=v[1];break;case"t":i+=v[0],s+=v[1],h.push({key:"T",data:[i,s]});break;case"Z":case"z":h.push({key:"Z",data:[]}),i=o,s=l}}}catch(e){u.e(e)}finally{u.f()}return h}function A(e){var t,a,r,n,i=[],s="",o=0,l=0,h=0,u=0,f=0,c=0,v=y(e);try{for(v.s();!(n=v.n()).done;){var g=n.value,m=g.key,b=g.data;switch(m){case"M":i.push({key:"M",data:d(b)}),o=(t=p(b,2))[0],l=t[1],h=(a=p(b,2))[0],u=a[1];break;case"C":i.push({key:"C",data:d(b)}),o=b[4],l=b[5],f=b[2],c=b[3];break;case"L":i.push({key:"L",data:d(b)}),o=(r=p(b,2))[0],l=r[1];break;case"H":o=b[0],i.push({key:"L",data:[o,l]});break;case"V":l=b[0],i.push({key:"L",data:[o,l]});break;case"S":var k=0,M=0;"C"===s||"S"===s?(k=o+(o-f),M=l+(l-c)):(k=o,M=l),i.push({key:"C",data:[k,M].concat(d(b))}),f=b[0],c=b[1],o=b[2],l=b[3];break;case"T":var S=p(b,2),x=S[0],O=S[1],w=0,P=0;"Q"===s||"T"===s?(w=o+(o-f),P=l+(l-c)):(w=o,P=l);var D=o+2*(w-o)/3,R=l+2*(P-l)/3,T=x+2*(w-x)/3,C=O+2*(P-O)/3;i.push({key:"C",data:[D,R,T,C,x,O]}),f=w,c=P,o=x,l=O;break;case"Q":var L=p(b,4),z=L[0],W=L[1],G=L[2],F=L[3],A=o+2*(z-o)/3,j=l+2*(W-l)/3,I=G+2*(z-G)/3,E=F+2*(W-F)/3;i.push({key:"C",data:[A,j,I,E,G,F]}),f=z,c=W,o=G,l=F;break;case"A":var V=Math.abs(b[0]),q=Math.abs(b[1]),B=b[2],Y=b[3],Z=b[4],H=b[5],Q=b[6];0===V||0===q?(i.push({key:"C",data:[o,l,H,Q,H,Q]}),o=H,l=Q):o===H&&l===Q||(_(o,l,H,Q,V,q,B,Y,Z).forEach((function(e){i.push({key:"C",data:e})})),o=H,l=Q);break;case"Z":i.push({key:"Z",data:[]}),o=h,l=u}s=m}}catch(e){v.e(e)}finally{v.f()}return i}function j(e,t,a){return[e*Math.cos(a)-t*Math.sin(a),e*Math.sin(a)+t*Math.cos(a)]}function _(e,t,a,r,n,i,s,o,l,h){var u,f=(u=s,Math.PI*u/180),c=[],d=0,v=0,g=0,y=0;if(h){var m=p(h,4);d=m[0],v=m[1],g=m[2],y=m[3]}else{var b,k;e=(b=p(j(e,t,-f),2))[0],t=b[1];var M=(e-(a=(k=p(j(a,r,-f),2))[0]))/2,S=(t-(r=k[1]))/2,x=M*M/(n*n)+S*S/(i*i);x>1&&(n*=x=Math.sqrt(x),i*=x);var O=n*n,w=i*i,P=O*w-O*S*S-w*M*M,D=O*S*S+w*M*M,R=(o===l?-1:1)*Math.sqrt(Math.abs(P/D));g=R*n*S/i+(e+a)/2,y=R*-i*M/n+(t+r)/2,d=Math.asin(parseFloat(((t-y)/i).toFixed(9))),v=Math.asin(parseFloat(((r-y)/i).toFixed(9))),e<g&&(d=Math.PI-d),a<g&&(v=Math.PI-v),d<0&&(d=2*Math.PI+d),v<0&&(v=2*Math.PI+v),l&&d>v&&(d-=2*Math.PI),!l&&v>d&&(v-=2*Math.PI)}var T=v-d;if(Math.abs(T)>120*Math.PI/180){var C=v,L=a,z=r;v=l&&v>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,c=_(a=g+n*Math.cos(v),r=y+i*Math.sin(v),L,z,n,i,s,0,l,[v,C,g,y])}T=v-d;var W=Math.cos(d),G=Math.sin(d),F=Math.cos(v),A=Math.sin(v),I=Math.tan(T/4),E=4/3*n*I,V=4/3*i*I,q=[e,t],B=[e+E*G,t-V*W],Y=[a+E*A,r-V*F],Z=[a,r];if(B[0]=2*q[0]-B[0],B[1]=2*q[1]-B[1],h)return[B,Y,Z].concat(c);c=[B,Y,Z].concat(c);for(var H=[],Q=0;Q<c.length;Q+=3){var N=j(c[Q][0],c[Q][1],f),U=j(c[Q+1][0],c[Q+1][1],f),$=j(c[Q+2][0],c[Q+2][1],f);H.push([N[0],N[1],U[0],U[1],$[0],$[1]])}return H}var I={randOffset:function(e,t){return U(e,t)},randOffsetWithRange:function(e,t,a){return N(e,t,a)},ellipse:function(e,t,a,r,n){return B(e,t,n,q(a,r,n)).opset},doubleLineOps:function(e,t,a,r,n){return $(e,t,a,r,n,!0)}};function E(e,t,a,r,n){return{type:"path",ops:$(e,t,a,r,n)}}function V(e,t,a){var r=(e||[]).length;if(r>2){for(var n=[],i=0;i<r-1;i++)n.push.apply(n,d($(e[i][0],e[i][1],e[i+1][0],e[i+1][1],a)));return t&&n.push.apply(n,d($(e[r-1][0],e[r-1][1],e[0][0],e[0][1],a))),{type:"path",ops:n}}return 2===r?E(e[0][0],e[0][1],e[1][0],e[1][1],a):{type:"path",ops:[]}}function q(e,t,a){var r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),n=Math.ceil(Math.max(a.curveStepCount,a.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/n,s=Math.abs(e/2),o=Math.abs(t/2),l=1-a.curveFitting;return{increment:i,rx:s+=U(s*l,a),ry:o+=U(o*l,a)}}function B(e,t,a,r){var n=p(ee(r.increment,e,t,r.rx,r.ry,1,r.increment*N(.1,N(.4,1,a),a),a),2),i=n[0],s=n[1],o=J(i,null,a);if(!a.disableMultiStroke&&0!==a.roughness){var l=J(p(ee(r.increment,e,t,r.rx,r.ry,1.5,0,a),1)[0],null,a);o=o.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function Y(e,t,a,r,n,i,s,o,l){var h=e,u=t,f=Math.abs(a/2),c=Math.abs(r/2);f+=U(.01*f,l),c+=U(.01*c,l);for(var p=n,v=i;p<0;)p+=2*Math.PI,v+=2*Math.PI;v-p>2*Math.PI&&(p=0,v=2*Math.PI);var g=2*Math.PI/l.curveStepCount,y=Math.min(g/2,(v-p)/2),m=te(y,h,u,f,c,p,v,1,l);if(!l.disableMultiStroke){var b=te(y,h,u,f,c,p,v,1.5,l);m.push.apply(m,d(b))}return s&&(o?m.push.apply(m,d($(h,u,h+f*Math.cos(p),u+c*Math.sin(p),l)).concat(d($(h,u,h+f*Math.cos(v),u+c*Math.sin(v),l)))):m.push({op:"lineTo",data:[h,u]},{op:"lineTo",data:[h+f*Math.cos(p),u+c*Math.sin(p)]})),{type:"path",ops:m}}function Z(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=a.value;if(i.length){var s=t.maxRandomnessOffset||0,o=i.length;if(o>2){r.push({op:"move",data:[i[0][0]+U(s,t),i[0][1]+U(s,t)]});for(var l=1;l<o;l++)r.push({op:"lineTo",data:[i[l][0]+U(s,t),i[l][1]+U(s,t)]})}}}}catch(e){n.e(e)}finally{n.f()}return{type:"fillPath",ops:r}}function H(e,t){return function(e,t){var a=e.fillStyle||"hachure";if(!C[a])switch(a){case"zigzag":C[a]||(C[a]=new w(t));break;case"cross-hatch":C[a]||(C[a]=new P(t));break;case"dots":C[a]||(C[a]=new D(t));break;case"dashed":C[a]||(C[a]=new R(t));break;case"zigzag-line":C[a]||(C[a]=new T(t));break;default:C[a="hachure"]||(C[a]=new O(t))}return C[a]}(t,I).fillPolygons(e,t)}function Q(e){return e.randomizer||(e.randomizer=new L(e.seed||0)),e.randomizer.next()}function N(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return a.roughness*r*(Q(a)*(t-e)+e)}function U(e,t){return N(-e,e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function $(e,t,a,r,n){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?n.disableMultiStrokeFill:n.disableMultiStroke,s=X(e,t,a,r,n,!0,!1);if(i)return s;var o=X(e,t,a,r,n,!0,!0);return s.concat(o)}function X(e,t,a,r,n,i,s){var o,l=Math.pow(e-a,2)+Math.pow(t-r,2),h=Math.sqrt(l);o=h<200?1:h>500?.4:-.0016668*h+1.233334;var u=n.maxRandomnessOffset||0;u*u*100>l&&(u=h/10);var f=u/2,c=.2+.2*Q(n),p=n.bowing*n.maxRandomnessOffset*(r-t)/200,d=n.bowing*n.maxRandomnessOffset*(e-a)/200;p=U(p,n,o),d=U(d,n,o);var v=[],g=function(){return U(f,n,o)},y=function(){return U(u,n,o)},m=n.preserveVertices;return i&&(s?v.push({op:"move",data:[e+(m?0:g()),t+(m?0:g())]}):v.push({op:"move",data:[e+(m?0:U(u,n,o)),t+(m?0:U(u,n,o))]})),s?v.push({op:"bcurveTo",data:[p+e+(a-e)*c+g(),d+t+(r-t)*c+g(),p+e+2*(a-e)*c+g(),d+t+2*(r-t)*c+g(),a+(m?0:g()),r+(m?0:g())]}):v.push({op:"bcurveTo",data:[p+e+(a-e)*c+y(),d+t+(r-t)*c+y(),p+e+2*(a-e)*c+y(),d+t+2*(r-t)*c+y(),a+(m?0:y()),r+(m?0:y())]}),v}function K(e,t,a){var r=[];r.push([e[0][0]+U(t,a),e[0][1]+U(t,a)]),r.push([e[0][0]+U(t,a),e[0][1]+U(t,a)]);for(var n=1;n<e.length;n++)r.push([e[n][0]+U(t,a),e[n][1]+U(t,a)]),n===e.length-1&&r.push([e[n][0]+U(t,a),e[n][1]+U(t,a)]);return J(r,null,a)}function J(e,t,a){var r=e.length,n=[];if(r>3){var i=[],s=1-a.curveTightness;n.push({op:"move",data:[e[1][0],e[1][1]]});for(var o=1;o+2<r;o++){var l=e[o];i[0]=[l[0],l[1]],i[1]=[l[0]+(s*e[o+1][0]-s*e[o-1][0])/6,l[1]+(s*e[o+1][1]-s*e[o-1][1])/6],i[2]=[e[o+1][0]+(s*e[o][0]-s*e[o+2][0])/6,e[o+1][1]+(s*e[o][1]-s*e[o+2][1])/6],i[3]=[e[o+1][0],e[o+1][1]],n.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}if(t&&2===t.length){var h=a.maxRandomnessOffset;n.push({op:"lineTo",data:[t[0]+U(h,a),t[1]+U(h,a)]})}}else 3===r?(n.push({op:"move",data:[e[1][0],e[1][1]]}),n.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&n.push.apply(n,d($(e[0][0],e[0][1],e[1][0],e[1][1],a)));return n}function ee(e,t,a,r,n,i,s,o){var l=[],h=[];if(0===o.roughness){e/=4,h.push([t+r*Math.cos(-e),a+n*Math.sin(-e)]);for(var u=0;u<=2*Math.PI;u+=e){var f=[t+r*Math.cos(u),a+n*Math.sin(u)];l.push(f),h.push(f)}h.push([t+r*Math.cos(0),a+n*Math.sin(0)]),h.push([t+r*Math.cos(e),a+n*Math.sin(e)])}else{var c=U(.5,o)-Math.PI/2;h.push([U(i,o)+t+.9*r*Math.cos(c-e),U(i,o)+a+.9*n*Math.sin(c-e)]);for(var p=2*Math.PI+c-.01,d=c;d<p;d+=e){var v=[U(i,o)+t+r*Math.cos(d),U(i,o)+a+n*Math.sin(d)];l.push(v),h.push(v)}h.push([U(i,o)+t+r*Math.cos(c+2*Math.PI+.5*s),U(i,o)+a+n*Math.sin(c+2*Math.PI+.5*s)]),h.push([U(i,o)+t+.98*r*Math.cos(c+s),U(i,o)+a+.98*n*Math.sin(c+s)]),h.push([U(i,o)+t+.9*r*Math.cos(c+.5*s),U(i,o)+a+.9*n*Math.sin(c+.5*s)])}return[h,l]}function te(e,t,a,r,n,i,s,o,l){var h=i+U(.1,l),u=[];u.push([U(o,l)+t+.9*r*Math.cos(h-e),U(o,l)+a+.9*n*Math.sin(h-e)]);for(var f=h;f<=s;f+=e)u.push([U(o,l)+t+r*Math.cos(f),U(o,l)+a+n*Math.sin(f)]);return u.push([t+r*Math.cos(s),a+n*Math.sin(s)]),u.push([t+r*Math.cos(s),a+n*Math.sin(s)]),J(u,null,l)}function ae(e){return d(e)}function re(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function ne(e,t,a){var r=re(t,a);if(0===r)return re(e,t);var n=((e[0]-t[0])*(a[0]-t[0])+(e[1]-t[1])*(a[1]-t[1]))/r;return re(e,ie(t,a,n=Math.max(0,Math.min(1,n))))}function ie(e,t,a){return[e[0]+(t[0]-e[0])*a,e[1]+(t[1]-e[1])*a]}function se(e,t,a,r){var n,i,s=r||[];if(function(e,t){var a=e[t+0],r=e[t+1],n=e[t+2],i=e[t+3],s=3*r[0]-2*a[0]-i[0];s*=s;var o=3*r[1]-2*a[1]-i[1];o*=o;var l=3*n[0]-2*i[0]-a[0];l*=l;var h=3*n[1]-2*i[1]-a[1];return s<l&&(s=l),o<(h*=h)&&(o=h),s+o}(e,t)<a){var o=e[t+0];s.length?(n=s[s.length-1],i=o,Math.sqrt(re(n,i))>1&&s.push(o)):s.push(o),s.push(e[t+3])}else{var l=.5,h=e[t+0],u=e[t+1],f=e[t+2],c=e[t+3],p=ie(h,u,l),d=ie(u,f,l),v=ie(f,c,l),g=ie(p,d,l),y=ie(d,v,l),m=ie(g,y,l);se([h,p,g,m],0,a,s),se([m,y,v,c],0,a,s)}return s}function oe(e,t){return le(e,0,e.length,t)}function le(e,t,a,r,n){for(var i=n||[],s=e[t],o=e[a-1],l=0,h=1,u=t+1;u<a-1;++u){var f=ne(e[u],s,o);f>l&&(l=f,h=u)}return Math.sqrt(l)>r?(le(e,t,h+1,r,i),le(e,h,a,r,i)):(i.length||i.push(s),i.push(o)),i}function he(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,a=arguments.length>2?arguments[2]:void 0,r=[],n=(e.length-1)/3,i=0;i<n;i++)se(e,3*i,t,r);return a&&a>0?le(r,0,r.length,a):r}var ue="none",fe=function(){function e(t){i(this,e),this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}return o(e,[{key:"_o",value:function(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}},{key:"_d",value:function(e,t,a){return{shape:e,sets:t||[],options:a||this.defaultOptions}}},{key:"line",value:function(e,t,a,r,n){var i=this._o(n);return this._d("line",[E(e,t,a,r,i)],i)}},{key:"rectangle",value:function(e,t,a,r,n){var i=this._o(n),s=[],o=function(e,t,a,r,n){return function(e,t){return V(e,!0,t)}([[e,t],[e+a,t],[e+a,t+r],[e,t+r]],n)}(e,t,a,r,i);if(i.fill){var l=[[e,t],[e+a,t],[e+a,t+r],[e,t+r]];"solid"===i.fillStyle?s.push(Z([l],i)):s.push(H([l],i))}return i.stroke!==ue&&s.push(o),this._d("rectangle",s,i)}},{key:"ellipse",value:function(e,t,a,r,n){var i=this._o(n),s=[],o=q(a,r,i),l=B(e,t,i,o);if(i.fill)if("solid"===i.fillStyle){var h=B(e,t,i,o).opset;h.type="fillPath",s.push(h)}else s.push(H([l.estimatedPoints],i));return i.stroke!==ue&&s.push(l.opset),this._d("ellipse",s,i)}},{key:"circle",value:function(e,t,a,r){var n=this.ellipse(e,t,a,a,r);return n.shape="circle",n}},{key:"linearPath",value:function(e,t){var a=this._o(t);return this._d("linearPath",[V(e,!1,a)],a)}},{key:"arc",value:function(e,t,a,r,n,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this._o(o),h=[],u=Y(e,t,a,r,n,i,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){var f=Object.assign({},l);f.disableMultiStroke=!0;var c=Y(e,t,a,r,n,i,!0,!1,f);c.type="fillPath",h.push(c)}else h.push(function(e,t,a,r,n,i,s){var o=e,l=t,h=Math.abs(a/2),u=Math.abs(r/2);h+=U(.01*h,s),u+=U(.01*u,s);for(var f=n,c=i;f<0;)f+=2*Math.PI,c+=2*Math.PI;c-f>2*Math.PI&&(f=0,c=2*Math.PI);for(var p=(c-f)/s.curveStepCount,d=[],v=f;v<=c;v+=p)d.push([o+h*Math.cos(v),l+u*Math.sin(v)]);return d.push([o+h*Math.cos(c),l+u*Math.sin(c)]),d.push([o,l]),H([d],s)}(e,t,a,r,n,i,l));return l.stroke!==ue&&h.push(u),this._d("arc",h,l)}},{key:"curve",value:function(e,t){var a=this._o(t),r=[],n=function(e,t){var a=K(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){var r=K(e,1.5*(1+.22*t.roughness),function(e){var t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}(t));a=a.concat(r)}return{type:"path",ops:a}}(e,a);if(a.fill&&a.fill!==ue&&e.length>=3){var i=he(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.length;if(a<3)throw new Error("A curve must have at least three points.");var r=[];if(3===a)r.push(ae(e[0]),ae(e[1]),ae(e[2]),ae(e[2]));else{var n=[];n.push(e[0],e[0]);for(var i=1;i<e.length;i++)n.push(e[i]),i===e.length-1&&n.push(e[i]);var s=[],o=1-t;r.push(ae(n[0]));for(var l=1;l+2<n.length;l++){var h=n[l];s[0]=[h[0],h[1]],s[1]=[h[0]+(o*n[l+1][0]-o*n[l-1][0])/6,h[1]+(o*n[l+1][1]-o*n[l-1][1])/6],s[2]=[n[l+1][0]+(o*n[l][0]-o*n[l+2][0])/6,n[l+1][1]+(o*n[l][1]-o*n[l+2][1])/6],s[3]=[n[l+1][0],n[l+1][1]],r.push(s[1],s[2],s[3])}}return r}(e),10,(1+a.roughness)/2);"solid"===a.fillStyle?r.push(Z([i],a)):r.push(H([i],a))}return a.stroke!==ue&&r.push(n),this._d("curve",r,a)}},{key:"polygon",value:function(e,t){var a=this._o(t),r=[],n=V(e,!0,a);return a.fill&&("solid"===a.fillStyle?r.push(Z([e],a)):r.push(H([e],a))),a.stroke!==ue&&r.push(n),this._d("polygon",r,a)}},{key:"path",value:function(e,t){var a=this._o(t),r=[];if(!e)return this._d("path",r,a);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");var n=a.fill&&"transparent"!==a.fill&&a.fill!==ue,i=a.stroke!==ue,s=!!(a.simplification&&a.simplification<1),o=function(e,t,a){var r,n=A(F(G(e))),i=[],s=[],o=[0,0],l=[],h=function(){var e;l.length>=4&&(e=s).push.apply(e,d(he(l,1))),l=[]},u=function(){h(),s.length&&(i.push(s),s=[])},f=y(n);try{for(f.s();!(r=f.n()).done;){var c=r.value,p=c.key,v=c.data;switch(p){case"M":u(),o=[v[0],v[1]],s.push(o);break;case"L":h(),s.push([v[0],v[1]]);break;case"C":if(!l.length){var g=s.length?s[s.length-1]:o;l.push([g[0],g[1]])}l.push([v[0],v[1]]),l.push([v[2],v[3]]),l.push([v[4],v[5]]);break;case"Z":h(),s.push([o[0],o[1]])}}}catch(e){f.e(e)}finally{f.f()}if(u(),!a)return i;for(var m=[],b=0,k=i;b<k.length;b++){var M=oe(k[b],a);M.length&&m.push(M)}return m}(e,0,s?4-4*a.simplification:(1+a.roughness)/2);return n&&("solid"===a.fillStyle?r.push(Z(o,a)):r.push(H(o,a))),i&&(s?o.forEach((function(e){r.push(V(e,!1,a))})):r.push(function(e,t){var a,r=A(F(G(e))),n=[],i=[0,0],s=[0,0],o=y(r);try{var l=function(){var e=a.value,r=e.key,o=e.data;switch(r){case"M":var l=1*(t.maxRandomnessOffset||0),h=t.preserveVertices;n.push({op:"move",data:o.map((function(e){return e+(h?0:U(l,t))}))}),s=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push.apply(n,d($(s[0],s[1],o[0],o[1],t))),s=[o[0],o[1]];break;case"C":var u=p(o,6),f=u[0],c=u[1],v=u[2],g=u[3],y=u[4],m=u[5];n.push.apply(n,d(function(e,t,a,r,n,i,s,o){for(var l=[],h=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3],u=[0,0],f=o.disableMultiStroke?1:2,c=o.preserveVertices,p=0;p<f;p++)0===p?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(c?0:U(h[0],o)),s[1]+(c?0:U(h[0],o))]}),u=c?[n,i]:[n+U(h[p],o),i+U(h[p],o)],l.push({op:"bcurveTo",data:[e+U(h[p],o),t+U(h[p],o),a+U(h[p],o),r+U(h[p],o),u[0],u[1]]});return l}(f,c,v,g,y,m,s,t))),s=[y,m];break;case"Z":n.push.apply(n,d($(s[0],s[1],i[0],i[1],t))),s=[i[0],i[1]]}};for(o.s();!(a=o.n()).done;)l()}catch(e){o.e(e)}finally{o.f()}return{type:"path",ops:n}}(e,a))),this._d("path",r,a)}},{key:"opsToPath",value:function(e,t){var a,r="",n=y(e.ops);try{for(n.s();!(a=n.n()).done;){var i=a.value,s="number"==typeof t&&t>=0?i.data.map((function(e){return+e.toFixed(t)})):i.data;switch(i.op){case"move":r+="M".concat(s[0]," ").concat(s[1]," ");break;case"bcurveTo":r+="C".concat(s[0]," ").concat(s[1],", ").concat(s[2]," ").concat(s[3],", ").concat(s[4]," ").concat(s[5]," ");break;case"lineTo":r+="L".concat(s[0]," ").concat(s[1]," ")}}}catch(e){n.e(e)}finally{n.f()}return r.trim()}},{key:"toPaths",value:function(e){var t,a=e.sets||[],r=e.options||this.defaultOptions,n=[],i=y(a);try{for(i.s();!(t=i.n()).done;){var s=t.value,o=null;switch(s.type){case"path":o={d:this.opsToPath(s),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:ue};break;case"fillPath":o={d:this.opsToPath(s),stroke:ue,strokeWidth:0,fill:r.fill||ue};break;case"fillSketch":o=this.fillSketch(s,r)}o&&n.push(o)}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"fillSketch",value:function(e,t){var a=t.fillWeight;return a<0&&(a=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||ue,strokeWidth:a,fill:ue}}}],[{key:"newSeed",value:function(){return Math.floor(Math.random()*Math.pow(2,31))}}]),e}(),ce=function(){function e(t,a){i(this,e),this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new fe(a)}return o(e,[{key:"draw",value:function(e){var t,a=e.sets||[],r=e.options||this.getDefaultOptions(),n=this.ctx,i=e.options.fixedDecimalPlaceDigits,s=y(a);try{for(s.s();!(t=s.n()).done;){var o=t.value;switch(o.type){case"path":n.save(),n.strokeStyle="none"===r.stroke?"transparent":r.stroke,n.lineWidth=r.strokeWidth,r.strokeLineDash&&n.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(n.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(n,o,i),n.restore();break;case"fillPath":n.save(),n.fillStyle=r.fill||"";var l="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(n,o,i,l),n.restore();break;case"fillSketch":this.fillSketch(n,o,r)}}}catch(e){s.e(e)}finally{s.f()}}},{key:"fillSketch",value:function(e,t,a){var r=a.fillWeight;r<0&&(r=a.strokeWidth/2),e.save(),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),e.strokeStyle=a.fill||"",e.lineWidth=r,this._drawToContext(e,t,a.fixedDecimalPlaceDigits),e.restore()}},{key:"_drawToContext",value:function(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";e.beginPath();var n,i=y(t.ops);try{for(i.s();!(n=i.n()).done;){var s=n.value,o="number"==typeof a&&a>=0?s.data.map((function(e){return+e.toFixed(a)})):s.data;switch(s.op){case"move":e.moveTo(o[0],o[1]);break;case"bcurveTo":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":e.lineTo(o[0],o[1])}}}catch(e){i.e(e)}finally{i.f()}"fillPath"===t.type?e.fill(r):e.stroke()}},{key:"generator",get:function(){return this.gen}},{key:"getDefaultOptions",value:function(){return this.gen.defaultOptions}},{key:"line",value:function(e,t,a,r,n){var i=this.gen.line(e,t,a,r,n);return this.draw(i),i}},{key:"rectangle",value:function(e,t,a,r,n){var i=this.gen.rectangle(e,t,a,r,n);return this.draw(i),i}},{key:"ellipse",value:function(e,t,a,r,n){var i=this.gen.ellipse(e,t,a,r,n);return this.draw(i),i}},{key:"circle",value:function(e,t,a,r){var n=this.gen.circle(e,t,a,r);return this.draw(n),n}},{key:"linearPath",value:function(e,t){var a=this.gen.linearPath(e,t);return this.draw(a),a}},{key:"polygon",value:function(e,t){var a=this.gen.polygon(e,t);return this.draw(a),a}},{key:"arc",value:function(e,t,a,r,n,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this.gen.arc(e,t,a,r,n,i,s,o);return this.draw(l),l}},{key:"curve",value:function(e,t){var a=this.gen.curve(e,t);return this.draw(a),a}},{key:"path",value:function(e,t){var a=this.gen.path(e,t);return this.draw(a),a}}]),e}(),pe=function(e,t){return new ce(e,t)};const de={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};let ve=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="arc",this.numberType=a.ARC_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).arc;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const f=new a.CustomPath2D,{fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth,outerRadius:v=l.outerRadius,innerRadius:g=l.innerRadius,maxRandomnessOffset:y=de.maxRandomnessOffset,roughness:m=de.roughness,bowing:b=de.bowing,curveFitting:k=de.curveFitting,curveTightness:M=de.curveTightness,curveStepCount:S=de.curveStepCount,fillStyle:x=de.fillStyle,fillWeight:O=de.fillWeight,hachureAngle:w=de.hachureAngle,hachureGap:P=de.hachureGap,simplification:D=de.simplification,dashOffset:R=de.dashOffset,dashGap:T=de.dashGap,zigzagOffset:C=de.zigzagOffset,seed:L=de.seed,fillLineDash:z=de.fillLineDash,fillLineDashOffset:W=de.fillLineDashOffset,disableMultiStroke:G=de.disableMultiStroke,disableMultiStrokeFill:F=de.disableMultiStrokeFill,preserveVertices:A=de.preserveVertices,fixedDecimalPlaceDigits:j=de.fixedDecimalPlaceDigits}=e.attribute;a.drawArcPath(e,f,h,u,v,g),o.path(f.toString(),{fill:c||void 0,stroke:p||void 0,strokeWidth:d,maxRandomnessOffset:y,roughness:m,bowing:b,curveFitting:k,curveTightness:M,curveStepCount:S,fillStyle:x,fillWeight:O,hachureAngle:w,hachureGap:P,simplification:D,dashOffset:R,dashGap:T,zigzagOffset:C,seed:L,fillLineDash:z,fillLineDashOffset:W,disableMultiStroke:G,disableMultiStrokeFill:F,preserveVertices:A,fixedDecimalPlaceDigits:j}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ve=m([r.injectable(),b(0,r.inject(a.DefaultCanvasArcRender)),k("design:paramtypes",[Object])],ve);let ge=class extends a.DefaultCanvasAreaRender{style="rough";drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c){if(c)return super.drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c);e.highPerformanceSave();const p=e.canvas.nativeCanvas,d=pe(p,{}),v=new a.CustomPath2D;a.drawAreaSegments(v,t,o,{offsetX:l,offsetY:h});const{maxRandomnessOffset:g=de.maxRandomnessOffset,roughness:y=de.roughness,bowing:m=de.bowing,curveFitting:b=de.curveFitting,curveTightness:k=de.curveTightness,curveStepCount:M=de.curveStepCount,fillStyle:S=de.fillStyle,fillWeight:x=de.fillWeight,hachureAngle:O=de.hachureAngle,hachureGap:w=de.hachureGap,simplification:P=de.simplification,dashOffset:D=de.dashOffset,dashGap:R=de.dashGap,zigzagOffset:T=de.zigzagOffset,seed:C=de.seed,fillLineDash:L=de.fillLineDash,fillLineDashOffset:z=de.fillLineDashOffset,disableMultiStroke:W=de.disableMultiStroke,disableMultiStrokeFill:G=de.disableMultiStrokeFill,preserveVertices:F=de.preserveVertices,fixedDecimalPlaceDigits:A=de.fixedDecimalPlaceDigits}=i;let{fill:j,stroke:_,lineWidth:I}=i;return Array.isArray(s)?s.forEach((e=>{j=j??e.fill,_=_??e.stroke,I=I??e.lineWidth})):(j=j??s.fill,_=_??s.stroke,I=I??s.lineWidth),d.path(v.toString(),{fill:r?j:void 0,strokeWidth:I,maxRandomnessOffset:g,roughness:y,bowing:m,curveFitting:b,curveTightness:k,curveStepCount:M,fillStyle:S,fillWeight:x,hachureAngle:O,hachureGap:w,simplification:P,dashOffset:D,dashGap:R,zigzagOffset:T,seed:C,fillLineDash:L,fillLineDashOffset:z,disableMultiStroke:W,disableMultiStrokeFill:G,preserveVertices:F,fixedDecimalPlaceDigits:A}),e.highPerformanceRestore(),!1}};ge=m([r.injectable()],ge);let ye=class{canvasRenderer;style="rough";constructor(e){this.canvasRenderer=e,this.type="circle",this.numberType=a.CIRCLE_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s,{}),l=a.getTheme(e).circle;let{x:h=l.x,y:u=l.y}=e.attribute;e.transMatrix.onlyTranslate()?i.onlyTranslate()||i.clearMatrix():(h=0,u=0,i.transformFromMatrix(e.transMatrix,!0));const{radius:f=l.radius,fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth}=e.attribute;o.circle(h,u,f,{fill:c||void 0,stroke:p||void 0,strokeWidth:d,fillStyle:"zigzag",roughness:.5})}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ye=m([r.injectable(),b(0,r.inject(a.DefaultCanvasCircleRender)),k("design:paramtypes",[Object])],ye);let me=class extends a.DefaultCanvasLineRender{style="rough";drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c,p,d,v){if(d||v)return super.drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c,p,d,v);e.highPerformanceSave();const g=e.canvas.nativeCanvas,y=pe(g,{}),m=new a.CustomPath2D;a.drawSegments(e.camera?e:e.nativeContext,t,h,u,{offsetX:f,offsetY:c});const{maxRandomnessOffset:b=de.maxRandomnessOffset,roughness:k=de.roughness,bowing:M=de.bowing,curveFitting:S=de.curveFitting,curveTightness:x=de.curveTightness,curveStepCount:O=de.curveStepCount,fillStyle:w=de.fillStyle,fillWeight:P=de.fillWeight,hachureAngle:D=de.hachureAngle,hachureGap:R=de.hachureGap,simplification:T=de.simplification,dashOffset:C=de.dashOffset,dashGap:L=de.dashGap,zigzagOffset:z=de.zigzagOffset,seed:W=de.seed,fillLineDash:G=de.fillLineDash,fillLineDashOffset:F=de.fillLineDashOffset,disableMultiStroke:A=de.disableMultiStroke,disableMultiStrokeFill:j=de.disableMultiStrokeFill,preserveVertices:_=de.preserveVertices,fixedDecimalPlaceDigits:I=de.fixedDecimalPlaceDigits}=o;let{fill:E,stroke:V,lineWidth:q}=o;return Array.isArray(l)?l.forEach((e=>{E=E??e.fill,V=V??e.stroke,q=q??e.lineWidth})):(E=E??l.fill,V=V??l.stroke,q=q??l.lineWidth),y.path(m.toString(),{fill:r?E:void 0,stroke:n?V:void 0,strokeWidth:q,maxRandomnessOffset:b,roughness:k,bowing:M,curveFitting:S,curveTightness:x,curveStepCount:O,fillStyle:w,fillWeight:P,hachureAngle:D,hachureGap:R,simplification:T,dashOffset:C,dashGap:L,zigzagOffset:z,seed:W,fillLineDash:G,fillLineDashOffset:F,disableMultiStroke:A,disableMultiStrokeFill:j,preserveVertices:_,fixedDecimalPlaceDigits:I}),e.highPerformanceRestore(),!1}};me=m([r.injectable()],me);let be=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="path",this.numberType=a.PATH_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s,{});i.highPerformanceSave();const l=a.getTheme(e).path;i.transformFromMatrix(e.transMatrix,!0);const{fill:h=l.fill,stroke:u=l.stroke,lineWidth:f=l.lineWidth,path:c=l.path,maxRandomnessOffset:p=de.maxRandomnessOffset,roughness:d=de.roughness,bowing:v=de.bowing,curveFitting:g=de.curveFitting,curveTightness:y=de.curveTightness,curveStepCount:m=de.curveStepCount,fillStyle:b=de.fillStyle,fillWeight:k=de.fillWeight,hachureAngle:M=de.hachureAngle,hachureGap:S=de.hachureGap,simplification:x=de.simplification,dashOffset:O=de.dashOffset,dashGap:w=de.dashGap,zigzagOffset:P=de.zigzagOffset,seed:D=de.seed,fillLineDash:R=de.fillLineDash,fillLineDashOffset:T=de.fillLineDashOffset,disableMultiStroke:C=de.disableMultiStroke,disableMultiStrokeFill:L=de.disableMultiStrokeFill,preserveVertices:z=de.preserveVertices,fixedDecimalPlaceDigits:W=de.fixedDecimalPlaceDigits}=e.attribute;"string"==typeof c&&o.path(c,{fill:h||void 0,stroke:u||void 0,strokeWidth:f,maxRandomnessOffset:p,roughness:d,bowing:v,curveFitting:g,curveTightness:y,curveStepCount:m,fillStyle:b,fillWeight:k,hachureAngle:M,hachureGap:S,simplification:x,dashOffset:O,dashGap:w,zigzagOffset:P,seed:D,fillLineDash:R,fillLineDashOffset:T,disableMultiStroke:C,disableMultiStrokeFill:L,preserveVertices:z,fixedDecimalPlaceDigits:W}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};be=m([r.injectable(),b(0,r.inject(a.DefaultCanvasPathRender)),k("design:paramtypes",[Object])],be);let ke=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="rect",this.numberType=a.RECT_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).rect;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const{fill:f=l.fill,stroke:c=l.stroke,fillColor:p=l.fill,strokeColor:d=l.stroke,width:v=l.width,height:g=l.height,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=de.maxRandomnessOffset,roughness:b=de.roughness,bowing:k=de.bowing,curveFitting:M=de.curveFitting,curveTightness:S=de.curveTightness,curveStepCount:x=de.curveStepCount,fillStyle:O=de.fillStyle,fillWeight:w=de.fillWeight,hachureAngle:P=de.hachureAngle,hachureGap:D=de.hachureGap,simplification:R=de.simplification,dashOffset:T=de.dashOffset,dashGap:C=de.dashGap,zigzagOffset:L=de.zigzagOffset,seed:z=de.seed,fillLineDash:W=de.fillLineDash,fillLineDashOffset:G=de.fillLineDashOffset,disableMultiStroke:F=de.disableMultiStroke,disableMultiStrokeFill:A=de.disableMultiStrokeFill,preserveVertices:j=de.preserveVertices,fixedDecimalPlaceDigits:_=de.fixedDecimalPlaceDigits}=e.attribute;o.rectangle(h,u,v,g,{fill:f?p:void 0,stroke:c?d:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:O,fillWeight:w,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:T,dashGap:C,zigzagOffset:L,seed:z,fillLineDash:W,fillLineDashOffset:G,disableMultiStroke:F,disableMultiStrokeFill:A,preserveVertices:j,fixedDecimalPlaceDigits:_}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ke=m([r.injectable(),b(0,r.inject(a.DefaultCanvasRectRender)),k("design:paramtypes",[Object])],ke);let Me=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="symbol",this.numberType=a.SYMBOL_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).symbol;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const f=e.getParsedPath();if(!f)return;const{fill:c=l.fill,stroke:p=l.stroke,fillColor:d=l.fill,strokeColor:v=l.stroke,size:g=l.size,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=de.maxRandomnessOffset,roughness:b=de.roughness,bowing:k=de.bowing,curveFitting:M=de.curveFitting,curveTightness:S=de.curveTightness,curveStepCount:x=de.curveStepCount,fillStyle:O=de.fillStyle,fillWeight:w=de.fillWeight,hachureAngle:P=de.hachureAngle,hachureGap:D=de.hachureGap,simplification:R=de.simplification,dashOffset:T=de.dashOffset,dashGap:C=de.dashGap,zigzagOffset:L=de.zigzagOffset,seed:z=de.seed,fillLineDash:W=de.fillLineDash,fillLineDashOffset:G=de.fillLineDashOffset,disableMultiStroke:F=de.disableMultiStroke,disableMultiStrokeFill:A=de.disableMultiStrokeFill,preserveVertices:j=de.preserveVertices,fixedDecimalPlaceDigits:_=de.fixedDecimalPlaceDigits}=e.attribute,I=new a.CustomPath2D;f.draw(I,g,h,u)&&I.closePath(),o.path(I.toString(),{fill:c?d:void 0,stroke:p?v:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:O,fillWeight:w,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:T,dashGap:C,zigzagOffset:L,seed:z,fillLineDash:W,fillLineDashOffset:G,disableMultiStroke:F,disableMultiStrokeFill:A,preserveVertices:j,fixedDecimalPlaceDigits:_}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};Me=m([r.injectable(),b(0,r.inject(a.DefaultCanvasSymbolRender)),k("design:paramtypes",[Object])],Me);const Se=new r.ContainerModule(((e,t,r,n)=>{e(ye).toSelf().inSingletonScope(),e(a.GraphicRender).to(ye),e(ke).toSelf().inSingletonScope(),e(a.GraphicRender).to(ke),e(be).toSelf().inSingletonScope(),e(a.GraphicRender).to(be),e(Me).toSelf().inSingletonScope(),e(a.GraphicRender).to(Me),e(me).toSelf().inSingletonScope(),e(a.GraphicRender).to(me),e(ge).toSelf().inSingletonScope(),e(a.GraphicRender).to(ge),e(ve).toSelf().inSingletonScope(),e(a.GraphicRender).to(ve)}));e.roughModule=Se}));

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("reflect-metadata"),require("@visactor/vrender"),require("inversify"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","reflect-metadata","@visactor/vrender","inversify","@visactor/vutils"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).VRender=e.VRender||{},e.VRender.Kits={}),null,e.vrender,e.inversify,e.vutils)}(this,(function(e,t,a,r,i){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,n=void 0,"symbol"==typeof(n=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var r=a.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"))?n:String(n)),r)}var i,n}function l(e,t,a){return t&&o(e.prototype,t),a&&o(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function c(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=u(e);if(t){var i=u(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return c(this,a)}}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,i,n,s,o=[],l=!0,h=!1;try{if(n=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;l=!1}else for(;!(l=(r=n.call(a)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){h=!0,i=e}finally{try{if(!l&&null!=a.return&&(s=a.return(),Object(s)!==s))return}finally{if(h)throw i}}return o}}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return y(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function m(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=g(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,s=!0,o=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return s=e.done,e},e:function(e){o=!0,n=e},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw n}}}}function b(e,t,a,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,a):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,a,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(o=(s<3?i(o):s>3?i(t,a,o):i(t,a))||o);return s>3&&o&&Object.defineProperty(t,a,o),o}function k(e,t){return function(a,r){t(a,r,e)}}function M(e,t){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function S(e,t,a){if(e&&e.length){var r=d(t,2),i=r[0],n=r[1],s=Math.PI/180*a,o=Math.cos(s),l=Math.sin(s);e.forEach((function(e){var t=d(e,2),a=t[0],r=t[1];e[0]=(a-i)*o-(r-n)*l+i,e[1]=(a-i)*l+(r-n)*o+n}))}}function x(e){var t=e[0],a=e[1];return Math.sqrt(Math.pow(t[0]-a[0],2)+Math.pow(t[1]-a[1],2))}function w(e,t){var a=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var i=[0,0];if(a){var n,s=m(e);try{for(s.s();!(n=s.n()).done;){S(n.value,i,a)}}catch(e){s.e(e)}finally{s.f()}}var o=function(e,t){var a,r=[],i=m(e);try{for(i.s();!(a=i.n()).done;){var n=v(a.value);n[0].join(",")!==n[n.length-1].join(",")&&n.push([n[0][0],n[0][1]]),n.length>2&&r.push(n)}}catch(e){i.e(e)}finally{i.f()}var s=[];t=Math.max(t,.1);for(var o=[],l=0,h=r;l<h.length;l++)for(var u=h[l],f=0;f<u.length-1;f++){var c=u[f],p=u[f+1];if(c[1]!==p[1]){var d=Math.min(c[1],p[1]);o.push({ymin:d,ymax:Math.max(c[1],p[1]),x:d===c[1]?c[0]:p[0],islope:(p[0]-c[0])/(p[1]-c[1])})}}if(o.sort((function(e,t){return e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)})),!o.length)return s;for(var g=[],y=o[0].ymin;g.length||o.length;){if(o.length){for(var b=-1,k=0;k<o.length&&!(o[k].ymin>y);k++)b=k;o.splice(0,b+1).forEach((function(e){g.push({s:y,edge:e})}))}if(g=g.filter((function(e){return!(e.edge.ymax<=y)})),g.sort((function(e,t){return e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)})),g.length>1)for(var M=0;M<g.length;M+=2){var S=M+1;if(S>=g.length)break;var x=g[M].edge,w=g[S].edge;s.push([[Math.round(x.x),y],[Math.round(w.x),y]])}y+=t,g.forEach((function(e){e.edge.x=e.edge.x+t*e.edge.islope}))}return s}(e,r);if(a){var l,h=m(e);try{for(h.s();!(l=h.n()).done;){S(l.value,i,-a)}}catch(e){h.e(e)}finally{h.f()}!function(e,t,a){var r=[];e.forEach((function(e){return r.push.apply(r,v(e))})),S(r,t,a)}(o,i,-a)}return o}var O=function(){function e(t){s(this,e),this.helper=t}return l(e,[{key:"fillPolygons",value:function(e,t){return this._fillPolygons(e,t)}},{key:"_fillPolygons",value:function(e,t){var a=w(e,t);return{type:"fillSketch",ops:this.renderLines(a,t)}}},{key:"renderLines",value:function(e,t){var a,r=[],i=m(e);try{for(i.s();!(a=i.n()).done;){var n=a.value;r.push.apply(r,v(this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],t)))}}catch(e){i.e(e)}finally{i.f()}return r}}]),e}(),P=function(e){h(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return l(a,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap;a<0&&(a=4*t.strokeWidth),a=Math.max(a,.1);var r,i=w(e,Object.assign({},t,{hachureGap:a})),n=Math.PI/180*t.hachureAngle,s=[],o=.5*a*Math.cos(n),l=.5*a*Math.sin(n),h=m(i);try{for(h.s();!(r=h.n()).done;){var u=d(r.value,2),f=u[0],c=u[1];x([f,c])&&s.push([[f[0]-o,f[1]+l],v(c)],[[f[0]+o,f[1]-l],v(c)])}}catch(e){h.e(e)}finally{h.f()}return{type:"fillSketch",ops:this.renderLines(s,t)}}}]),a}(O),D=function(e){h(a,e);var t=p(a);function a(){return s(this,a),t.apply(this,arguments)}return l(a,[{key:"fillPolygons",value:function(e,t){var a=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return a.ops=a.ops.concat(i.ops),a}}]),a}(O),R=function(){function e(t){s(this,e),this.helper=t}return l(e,[{key:"fillPolygons",value:function(e,t){var a=w(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(a,t)}},{key:"dotsOnLines",value:function(e,t){var a=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var i=t.fillWeight;i<0&&(i=t.strokeWidth/2);var n,s=r/4,o=m(e);try{for(o.s();!(n=o.n()).done;)for(var l=n.value,h=x(l),u=h/r,f=Math.ceil(u)-1,c=h-f*r,p=(l[0][0]+l[1][0])/2-r/4,d=Math.min(l[0][1],l[1][1]),g=0;g<f;g++){var y=d+c+g*r,b=p-s+2*Math.random()*s,k=y-s+2*Math.random()*s,M=this.helper.ellipse(b,k,i,i,t);a.push.apply(a,v(M.ops))}}catch(e){o.e(e)}finally{o.f()}return{type:"fillSketch",ops:a}}}]),e}(),C=function(){function e(t){s(this,e),this.helper=t}return l(e,[{key:"fillPolygons",value:function(e,t){var a=w(e,t);return{type:"fillSketch",ops:this.dashedLine(a,t)}}},{key:"dashedLine",value:function(e,t){var a=this,r=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,i=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,n=[];return e.forEach((function(e){var s=x(e),o=Math.floor(s/(r+i)),l=(s+i-o*(r+i))/2,h=e[0],u=e[1];h[0]>u[0]&&(h=e[1],u=e[0]);for(var f=Math.atan((u[1]-h[1])/(u[0]-h[0])),c=0;c<o;c++){var p=c*(r+i),d=p+r,g=[h[0]+p*Math.cos(f)+l*Math.cos(f),h[1]+p*Math.sin(f)+l*Math.sin(f)],y=[h[0]+d*Math.cos(f)+l*Math.cos(f),h[1]+d*Math.sin(f)+l*Math.sin(f)];n.push.apply(n,v(a.helper.doubleLineOps(g[0],g[1],y[0],y[1],t)))}})),n}}]),e}(),T=function(){function e(t){s(this,e),this.helper=t}return l(e,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?a:t.zigzagOffset,i=w(e,t=Object.assign({},t,{hachureGap:a+r}));return{type:"fillSketch",ops:this.zigzagLines(i,r,t)}}},{key:"zigzagLines",value:function(e,t,a){var r=this,i=[];return e.forEach((function(e){var n=x(e),s=Math.round(n/(2*t)),o=e[0],l=e[1];o[0]>l[0]&&(o=e[1],l=e[0]);for(var h=Math.atan((l[1]-o[1])/(l[0]-o[0])),u=0;u<s;u++){var f=2*u*t,c=2*(u+1)*t,p=Math.sqrt(2*Math.pow(t,2)),d=[o[0]+f*Math.cos(h),o[1]+f*Math.sin(h)],g=[o[0]+c*Math.cos(h),o[1]+c*Math.sin(h)],y=[d[0]+p*Math.cos(h+Math.PI/4),d[1]+p*Math.sin(h+Math.PI/4)];i.push.apply(i,v(r.helper.doubleLineOps(d[0],d[1],y[0],y[1],a)).concat(v(r.helper.doubleLineOps(y[0],y[1],g[0],g[1],a))))}})),i}}]),e}(),_={},L=function(){function e(t){s(this,e),this.seed=t}return l(e,[{key:"next",value:function(){return this.seed?(Math.pow(2,31)-1&(this.seed=Math.imul(48271,this.seed)))/Math.pow(2,31):Math.random()}}]),e}(),W={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function z(e,t){return e.type===t}function G(e){for(var t=[],a=function(e){for(var t=new Array;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:"".concat(parseFloat(RegExp.$1))},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e),r="BOD",i=0,n=a[i];!z(n,2);){var s=0,o=[];if("BOD"===r){if("M"!==n.text&&"m"!==n.text)return G("M0,0"+e);i++,s=W[n.text],r=n.text}else z(n,1)?s=W[r]:(i++,s=W[n.text],r=n.text);if(!(i+s<a.length))throw new Error("Path data ended short");for(var l=i;l<i+s;l++){var h=a[l];if(!z(h,1))throw new Error("Param not a number: "+r+","+h.text);o[o.length]=+h.text}if("number"!=typeof W[r])throw new Error("Bad segment: "+r);var u={key:r,data:o};t.push(u),n=a[i+=s],"M"===r&&(r="L"),"m"===r&&(r="l")}return t}function F(e){var t,a,r,i,n=0,s=0,o=0,l=0,h=[],u=m(e);try{for(u.s();!(i=u.n()).done;){var f=i.value,c=f.key,p=f.data;switch(c){case"M":h.push({key:"M",data:v(p)}),t=d(p,2),n=t[0],s=t[1],o=(a=d(p,2))[0],l=a[1];break;case"m":n+=p[0],s+=p[1],h.push({key:"M",data:[n,s]}),o=n,l=s;break;case"L":h.push({key:"L",data:v(p)}),r=d(p,2),n=r[0],s=r[1];break;case"l":n+=p[0],s+=p[1],h.push({key:"L",data:[n,s]});break;case"C":h.push({key:"C",data:v(p)}),n=p[4],s=p[5];break;case"c":var g=p.map((function(e,t){return t%2?e+s:e+n}));h.push({key:"C",data:g}),n=g[4],s=g[5];break;case"Q":h.push({key:"Q",data:v(p)}),n=p[2],s=p[3];break;case"q":var y=p.map((function(e,t){return t%2?e+s:e+n}));h.push({key:"Q",data:y}),n=y[2],s=y[3];break;case"A":h.push({key:"A",data:v(p)}),n=p[5],s=p[6];break;case"a":n+=p[5],s+=p[6],h.push({key:"A",data:[p[0],p[1],p[2],p[3],p[4],n,s]});break;case"H":h.push({key:"H",data:v(p)}),n=p[0];break;case"h":n+=p[0],h.push({key:"H",data:[n]});break;case"V":h.push({key:"V",data:v(p)}),s=p[0];break;case"v":s+=p[0],h.push({key:"V",data:[s]});break;case"S":h.push({key:"S",data:v(p)}),n=p[2],s=p[3];break;case"s":var b=p.map((function(e,t){return t%2?e+s:e+n}));h.push({key:"S",data:b}),n=b[2],s=b[3];break;case"T":h.push({key:"T",data:v(p)}),n=p[0],s=p[1];break;case"t":n+=p[0],s+=p[1],h.push({key:"T",data:[n,s]});break;case"Z":case"z":h.push({key:"Z",data:[]}),n=o,s=l}}}catch(e){u.e(e)}finally{u.f()}return h}function j(e){var t,a,r,i,n=[],s="",o=0,l=0,h=0,u=0,f=0,c=0,p=m(e);try{for(p.s();!(i=p.n()).done;){var g=i.value,y=g.key,b=g.data;switch(y){case"M":n.push({key:"M",data:v(b)}),o=(t=d(b,2))[0],l=t[1],h=(a=d(b,2))[0],u=a[1];break;case"C":n.push({key:"C",data:v(b)}),o=b[4],l=b[5],f=b[2],c=b[3];break;case"L":n.push({key:"L",data:v(b)}),o=(r=d(b,2))[0],l=r[1];break;case"H":o=b[0],n.push({key:"L",data:[o,l]});break;case"V":l=b[0],n.push({key:"L",data:[o,l]});break;case"S":var k=0,M=0;"C"===s||"S"===s?(k=o+(o-f),M=l+(l-c)):(k=o,M=l),n.push({key:"C",data:[k,M].concat(v(b))}),f=b[0],c=b[1],o=b[2],l=b[3];break;case"T":var S=d(b,2),x=S[0],w=S[1],O=0,P=0;"Q"===s||"T"===s?(O=o+(o-f),P=l+(l-c)):(O=o,P=l);var D=o+2*(O-o)/3,R=l+2*(P-l)/3,C=x+2*(O-x)/3,T=w+2*(P-w)/3;n.push({key:"C",data:[D,R,C,T,x,w]}),f=O,c=P,o=x,l=w;break;case"Q":var _=d(b,4),L=_[0],W=_[1],z=_[2],G=_[3],F=o+2*(L-o)/3,j=l+2*(W-l)/3,A=z+2*(L-z)/3,E=G+2*(W-G)/3;n.push({key:"C",data:[F,j,A,E,z,G]}),f=L,c=W,o=z,l=G;break;case"A":var V=Math.abs(b[0]),H=Math.abs(b[1]),q=b[2],B=b[3],N=b[4],Y=b[5],Z=b[6];0===V||0===H?(n.push({key:"C",data:[o,l,Y,Z,Y,Z]}),o=Y,l=Z):o===Y&&l===Z||(I(o,l,Y,Z,V,H,q,B,N).forEach((function(e){n.push({key:"C",data:e})})),o=Y,l=Z);break;case"Z":n.push({key:"Z",data:[]}),o=h,l=u}s=y}}catch(e){p.e(e)}finally{p.f()}return n}function A(e,t,a){return[e*Math.cos(a)-t*Math.sin(a),e*Math.sin(a)+t*Math.cos(a)]}function I(e,t,a,r,i,n,s,o,l,h){var u,f=(u=s,Math.PI*u/180),c=[],p=0,v=0,g=0,y=0;if(h){var m=d(h,4);p=m[0],v=m[1],g=m[2],y=m[3]}else{var b,k;e=(b=d(A(e,t,-f),2))[0],t=b[1];var M=(e-(a=(k=d(A(a,r,-f),2))[0]))/2,S=(t-(r=k[1]))/2,x=M*M/(i*i)+S*S/(n*n);x>1&&(i*=x=Math.sqrt(x),n*=x);var w=i*i,O=n*n,P=w*O-w*S*S-O*M*M,D=w*S*S+O*M*M,R=(o===l?-1:1)*Math.sqrt(Math.abs(P/D));g=R*i*S/n+(e+a)/2,y=R*-n*M/i+(t+r)/2,p=Math.asin(parseFloat(((t-y)/n).toFixed(9))),v=Math.asin(parseFloat(((r-y)/n).toFixed(9))),e<g&&(p=Math.PI-p),a<g&&(v=Math.PI-v),p<0&&(p=2*Math.PI+p),v<0&&(v=2*Math.PI+v),l&&p>v&&(p-=2*Math.PI),!l&&v>p&&(v-=2*Math.PI)}var C=v-p;if(Math.abs(C)>120*Math.PI/180){var T=v,_=a,L=r;v=l&&v>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,c=I(a=g+i*Math.cos(v),r=y+n*Math.sin(v),_,L,i,n,s,0,l,[v,T,g,y])}C=v-p;var W=Math.cos(p),z=Math.sin(p),G=Math.cos(v),F=Math.sin(v),j=Math.tan(C/4),E=4/3*i*j,V=4/3*n*j,H=[e,t],q=[e+E*z,t-V*W],B=[a+E*F,r-V*G],N=[a,r];if(q[0]=2*H[0]-q[0],q[1]=2*H[1]-q[1],h)return[q,B,N].concat(c);c=[q,B,N].concat(c);for(var Y=[],Z=0;Z<c.length;Z+=3){var Q=A(c[Z][0],c[Z][1],f),U=A(c[Z+1][0],c[Z+1][1],f),$=A(c[Z+2][0],c[Z+2][1],f);Y.push([Q[0],Q[1],U[0],U[1],$[0],$[1]])}return Y}var E={randOffset:function(e,t){return $(e,t)},randOffsetWithRange:function(e,t,a){return U(e,t,a)},ellipse:function(e,t,a,r,i){return B(e,t,i,q(a,r,i)).opset},doubleLineOps:function(e,t,a,r,i){return X(e,t,a,r,i,!0)}};function V(e,t,a,r,i){return{type:"path",ops:X(e,t,a,r,i)}}function H(e,t,a){var r=(e||[]).length;if(r>2){for(var i=[],n=0;n<r-1;n++)i.push.apply(i,v(X(e[n][0],e[n][1],e[n+1][0],e[n+1][1],a)));return t&&i.push.apply(i,v(X(e[r-1][0],e[r-1][1],e[0][0],e[0][1],a))),{type:"path",ops:i}}return 2===r?V(e[0][0],e[0][1],e[1][0],e[1][1],a):{type:"path",ops:[]}}function q(e,t,a){var r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(a.curveStepCount,a.curveStepCount/Math.sqrt(200)*r)),n=2*Math.PI/i,s=Math.abs(e/2),o=Math.abs(t/2),l=1-a.curveFitting;return{increment:n,rx:s+=$(s*l,a),ry:o+=$(o*l,a)}}function B(e,t,a,r){var i=d(te(r.increment,e,t,r.rx,r.ry,1,r.increment*U(.1,U(.4,1,a),a),a),2),n=i[0],s=i[1],o=ee(n,null,a);if(!a.disableMultiStroke&&0!==a.roughness){var l=ee(d(te(r.increment,e,t,r.rx,r.ry,1.5,0,a),1)[0],null,a);o=o.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function N(e,t,a,r,i,n,s,o,l){var h=e,u=t,f=Math.abs(a/2),c=Math.abs(r/2);f+=$(.01*f,l),c+=$(.01*c,l);for(var p=i,d=n;p<0;)p+=2*Math.PI,d+=2*Math.PI;d-p>2*Math.PI&&(p=0,d=2*Math.PI);var g=2*Math.PI/l.curveStepCount,y=Math.min(g/2,(d-p)/2),m=ae(y,h,u,f,c,p,d,1,l);if(!l.disableMultiStroke){var b=ae(y,h,u,f,c,p,d,1.5,l);m.push.apply(m,v(b))}return s&&(o?m.push.apply(m,v(X(h,u,h+f*Math.cos(p),u+c*Math.sin(p),l)).concat(v(X(h,u,h+f*Math.cos(d),u+c*Math.sin(d),l)))):m.push({op:"lineTo",data:[h,u]},{op:"lineTo",data:[h+f*Math.cos(p),u+c*Math.sin(p)]})),{type:"path",ops:m}}function Y(e,t){var a,r=[],i=m(e);try{for(i.s();!(a=i.n()).done;){var n=a.value;if(n.length){var s=t.maxRandomnessOffset||0,o=n.length;if(o>2){r.push({op:"move",data:[n[0][0]+$(s,t),n[0][1]+$(s,t)]});for(var l=1;l<o;l++)r.push({op:"lineTo",data:[n[l][0]+$(s,t),n[l][1]+$(s,t)]})}}}}catch(e){i.e(e)}finally{i.f()}return{type:"fillPath",ops:r}}function Z(e,t){return function(e,t){var a=e.fillStyle||"hachure";if(!_[a])switch(a){case"zigzag":_[a]||(_[a]=new P(t));break;case"cross-hatch":_[a]||(_[a]=new D(t));break;case"dots":_[a]||(_[a]=new R(t));break;case"dashed":_[a]||(_[a]=new C(t));break;case"zigzag-line":_[a]||(_[a]=new T(t));break;default:_[a="hachure"]||(_[a]=new O(t))}return _[a]}(t,E).fillPolygons(e,t)}function Q(e){return e.randomizer||(e.randomizer=new L(e.seed||0)),e.randomizer.next()}function U(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return a.roughness*r*(Q(a)*(t-e)+e)}function $(e,t){return U(-e,e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function X(e,t,a,r,i){var n=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?i.disableMultiStrokeFill:i.disableMultiStroke,s=K(e,t,a,r,i,!0,!1);if(n)return s;var o=K(e,t,a,r,i,!0,!0);return s.concat(o)}function K(e,t,a,r,i,n,s){var o,l=Math.pow(e-a,2)+Math.pow(t-r,2),h=Math.sqrt(l);o=h<200?1:h>500?.4:-.0016668*h+1.233334;var u=i.maxRandomnessOffset||0;u*u*100>l&&(u=h/10);var f=u/2,c=.2+.2*Q(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,d=i.bowing*i.maxRandomnessOffset*(e-a)/200;p=$(p,i,o),d=$(d,i,o);var v=[],g=function(){return $(f,i,o)},y=function(){return $(u,i,o)},m=i.preserveVertices;return n&&(s?v.push({op:"move",data:[e+(m?0:g()),t+(m?0:g())]}):v.push({op:"move",data:[e+(m?0:$(u,i,o)),t+(m?0:$(u,i,o))]})),s?v.push({op:"bcurveTo",data:[p+e+(a-e)*c+g(),d+t+(r-t)*c+g(),p+e+2*(a-e)*c+g(),d+t+2*(r-t)*c+g(),a+(m?0:g()),r+(m?0:g())]}):v.push({op:"bcurveTo",data:[p+e+(a-e)*c+y(),d+t+(r-t)*c+y(),p+e+2*(a-e)*c+y(),d+t+2*(r-t)*c+y(),a+(m?0:y()),r+(m?0:y())]}),v}function J(e,t,a){var r=[];r.push([e[0][0]+$(t,a),e[0][1]+$(t,a)]),r.push([e[0][0]+$(t,a),e[0][1]+$(t,a)]);for(var i=1;i<e.length;i++)r.push([e[i][0]+$(t,a),e[i][1]+$(t,a)]),i===e.length-1&&r.push([e[i][0]+$(t,a),e[i][1]+$(t,a)]);return ee(r,null,a)}function ee(e,t,a){var r=e.length,i=[];if(r>3){var n=[],s=1-a.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(var o=1;o+2<r;o++){var l=e[o];n[0]=[l[0],l[1]],n[1]=[l[0]+(s*e[o+1][0]-s*e[o-1][0])/6,l[1]+(s*e[o+1][1]-s*e[o-1][1])/6],n[2]=[e[o+1][0]+(s*e[o][0]-s*e[o+2][0])/6,e[o+1][1]+(s*e[o][1]-s*e[o+2][1])/6],n[3]=[e[o+1][0],e[o+1][1]],i.push({op:"bcurveTo",data:[n[1][0],n[1][1],n[2][0],n[2][1],n[3][0],n[3][1]]})}if(t&&2===t.length){var h=a.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+$(h,a),t[1]+$(h,a)]})}}else 3===r?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&i.push.apply(i,v(X(e[0][0],e[0][1],e[1][0],e[1][1],a)));return i}function te(e,t,a,r,i,n,s,o){var l=[],h=[];if(0===o.roughness){e/=4,h.push([t+r*Math.cos(-e),a+i*Math.sin(-e)]);for(var u=0;u<=2*Math.PI;u+=e){var f=[t+r*Math.cos(u),a+i*Math.sin(u)];l.push(f),h.push(f)}h.push([t+r*Math.cos(0),a+i*Math.sin(0)]),h.push([t+r*Math.cos(e),a+i*Math.sin(e)])}else{var c=$(.5,o)-Math.PI/2;h.push([$(n,o)+t+.9*r*Math.cos(c-e),$(n,o)+a+.9*i*Math.sin(c-e)]);for(var p=2*Math.PI+c-.01,d=c;d<p;d+=e){var v=[$(n,o)+t+r*Math.cos(d),$(n,o)+a+i*Math.sin(d)];l.push(v),h.push(v)}h.push([$(n,o)+t+r*Math.cos(c+2*Math.PI+.5*s),$(n,o)+a+i*Math.sin(c+2*Math.PI+.5*s)]),h.push([$(n,o)+t+.98*r*Math.cos(c+s),$(n,o)+a+.98*i*Math.sin(c+s)]),h.push([$(n,o)+t+.9*r*Math.cos(c+.5*s),$(n,o)+a+.9*i*Math.sin(c+.5*s)])}return[h,l]}function ae(e,t,a,r,i,n,s,o,l){var h=n+$(.1,l),u=[];u.push([$(o,l)+t+.9*r*Math.cos(h-e),$(o,l)+a+.9*i*Math.sin(h-e)]);for(var f=h;f<=s;f+=e)u.push([$(o,l)+t+r*Math.cos(f),$(o,l)+a+i*Math.sin(f)]);return u.push([t+r*Math.cos(s),a+i*Math.sin(s)]),u.push([t+r*Math.cos(s),a+i*Math.sin(s)]),ee(u,null,l)}function re(e){return v(e)}function ie(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function ne(e,t,a){var r=ie(t,a);if(0===r)return ie(e,t);var i=((e[0]-t[0])*(a[0]-t[0])+(e[1]-t[1])*(a[1]-t[1]))/r;return ie(e,se(t,a,i=Math.max(0,Math.min(1,i))))}function se(e,t,a){return[e[0]+(t[0]-e[0])*a,e[1]+(t[1]-e[1])*a]}function oe(e,t,a,r){var i,n,s=r||[];if(function(e,t){var a=e[t+0],r=e[t+1],i=e[t+2],n=e[t+3],s=3*r[0]-2*a[0]-n[0];s*=s;var o=3*r[1]-2*a[1]-n[1];o*=o;var l=3*i[0]-2*n[0]-a[0];l*=l;var h=3*i[1]-2*n[1]-a[1];return s<l&&(s=l),o<(h*=h)&&(o=h),s+o}(e,t)<a){var o=e[t+0];s.length?(i=s[s.length-1],n=o,Math.sqrt(ie(i,n))>1&&s.push(o)):s.push(o),s.push(e[t+3])}else{var l=.5,h=e[t+0],u=e[t+1],f=e[t+2],c=e[t+3],p=se(h,u,l),d=se(u,f,l),v=se(f,c,l),g=se(p,d,l),y=se(d,v,l),m=se(g,y,l);oe([h,p,g,m],0,a,s),oe([m,y,v,c],0,a,s)}return s}function le(e,t){return he(e,0,e.length,t)}function he(e,t,a,r,i){for(var n=i||[],s=e[t],o=e[a-1],l=0,h=1,u=t+1;u<a-1;++u){var f=ne(e[u],s,o);f>l&&(l=f,h=u)}return Math.sqrt(l)>r?(he(e,t,h+1,r,n),he(e,h,a,r,n)):(n.length||n.push(s),n.push(o)),n}function ue(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,a=arguments.length>2?arguments[2]:void 0,r=[],i=(e.length-1)/3,n=0;n<i;n++)oe(e,3*n,t,r);return a&&a>0?he(r,0,r.length,a):r}var fe="none",ce=function(){function e(t){s(this,e),this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}return l(e,[{key:"_o",value:function(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}},{key:"_d",value:function(e,t,a){return{shape:e,sets:t||[],options:a||this.defaultOptions}}},{key:"line",value:function(e,t,a,r,i){var n=this._o(i);return this._d("line",[V(e,t,a,r,n)],n)}},{key:"rectangle",value:function(e,t,a,r,i){var n=this._o(i),s=[],o=function(e,t,a,r,i){return function(e,t){return H(e,!0,t)}([[e,t],[e+a,t],[e+a,t+r],[e,t+r]],i)}(e,t,a,r,n);if(n.fill){var l=[[e,t],[e+a,t],[e+a,t+r],[e,t+r]];"solid"===n.fillStyle?s.push(Y([l],n)):s.push(Z([l],n))}return n.stroke!==fe&&s.push(o),this._d("rectangle",s,n)}},{key:"ellipse",value:function(e,t,a,r,i){var n=this._o(i),s=[],o=q(a,r,n),l=B(e,t,n,o);if(n.fill)if("solid"===n.fillStyle){var h=B(e,t,n,o).opset;h.type="fillPath",s.push(h)}else s.push(Z([l.estimatedPoints],n));return n.stroke!==fe&&s.push(l.opset),this._d("ellipse",s,n)}},{key:"circle",value:function(e,t,a,r){var i=this.ellipse(e,t,a,a,r);return i.shape="circle",i}},{key:"linearPath",value:function(e,t){var a=this._o(t);return this._d("linearPath",[H(e,!1,a)],a)}},{key:"arc",value:function(e,t,a,r,i,n){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this._o(o),h=[],u=N(e,t,a,r,i,n,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){var f=Object.assign({},l);f.disableMultiStroke=!0;var c=N(e,t,a,r,i,n,!0,!1,f);c.type="fillPath",h.push(c)}else h.push(function(e,t,a,r,i,n,s){var o=e,l=t,h=Math.abs(a/2),u=Math.abs(r/2);h+=$(.01*h,s),u+=$(.01*u,s);for(var f=i,c=n;f<0;)f+=2*Math.PI,c+=2*Math.PI;c-f>2*Math.PI&&(f=0,c=2*Math.PI);for(var p=(c-f)/s.curveStepCount,d=[],v=f;v<=c;v+=p)d.push([o+h*Math.cos(v),l+u*Math.sin(v)]);return d.push([o+h*Math.cos(c),l+u*Math.sin(c)]),d.push([o,l]),Z([d],s)}(e,t,a,r,i,n,l));return l.stroke!==fe&&h.push(u),this._d("arc",h,l)}},{key:"curve",value:function(e,t){var a=this._o(t),r=[],i=function(e,t){var a=J(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){var r=J(e,1.5*(1+.22*t.roughness),function(e){var t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}(t));a=a.concat(r)}return{type:"path",ops:a}}(e,a);if(a.fill&&a.fill!==fe&&e.length>=3){var n=ue(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.length;if(a<3)throw new Error("A curve must have at least three points.");var r=[];if(3===a)r.push(re(e[0]),re(e[1]),re(e[2]),re(e[2]));else{var i=[];i.push(e[0],e[0]);for(var n=1;n<e.length;n++)i.push(e[n]),n===e.length-1&&i.push(e[n]);var s=[],o=1-t;r.push(re(i[0]));for(var l=1;l+2<i.length;l++){var h=i[l];s[0]=[h[0],h[1]],s[1]=[h[0]+(o*i[l+1][0]-o*i[l-1][0])/6,h[1]+(o*i[l+1][1]-o*i[l-1][1])/6],s[2]=[i[l+1][0]+(o*i[l][0]-o*i[l+2][0])/6,i[l+1][1]+(o*i[l][1]-o*i[l+2][1])/6],s[3]=[i[l+1][0],i[l+1][1]],r.push(s[1],s[2],s[3])}}return r}(e),10,(1+a.roughness)/2);"solid"===a.fillStyle?r.push(Y([n],a)):r.push(Z([n],a))}return a.stroke!==fe&&r.push(i),this._d("curve",r,a)}},{key:"polygon",value:function(e,t){var a=this._o(t),r=[],i=H(e,!0,a);return a.fill&&("solid"===a.fillStyle?r.push(Y([e],a)):r.push(Z([e],a))),a.stroke!==fe&&r.push(i),this._d("polygon",r,a)}},{key:"path",value:function(e,t){var a=this._o(t),r=[];if(!e)return this._d("path",r,a);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");var i=a.fill&&"transparent"!==a.fill&&a.fill!==fe,n=a.stroke!==fe,s=!!(a.simplification&&a.simplification<1),o=function(e,t,a){var r,i=j(F(G(e))),n=[],s=[],o=[0,0],l=[],h=function(){var e;l.length>=4&&(e=s).push.apply(e,v(ue(l,1))),l=[]},u=function(){h(),s.length&&(n.push(s),s=[])},f=m(i);try{for(f.s();!(r=f.n()).done;){var c=r.value,p=c.key,d=c.data;switch(p){case"M":u(),o=[d[0],d[1]],s.push(o);break;case"L":h(),s.push([d[0],d[1]]);break;case"C":if(!l.length){var g=s.length?s[s.length-1]:o;l.push([g[0],g[1]])}l.push([d[0],d[1]]),l.push([d[2],d[3]]),l.push([d[4],d[5]]);break;case"Z":h(),s.push([o[0],o[1]])}}}catch(e){f.e(e)}finally{f.f()}if(u(),!a)return n;for(var y=[],b=0,k=n;b<k.length;b++){var M=le(k[b],a);M.length&&y.push(M)}return y}(e,0,s?4-4*a.simplification:(1+a.roughness)/2);return i&&("solid"===a.fillStyle?r.push(Y(o,a)):r.push(Z(o,a))),n&&(s?o.forEach((function(e){r.push(H(e,!1,a))})):r.push(function(e,t){var a,r=j(F(G(e))),i=[],n=[0,0],s=[0,0],o=m(r);try{var l=function(){var e=a.value,r=e.key,o=e.data;switch(r){case"M":var l=1*(t.maxRandomnessOffset||0),h=t.preserveVertices;i.push({op:"move",data:o.map((function(e){return e+(h?0:$(l,t))}))}),s=[o[0],o[1]],n=[o[0],o[1]];break;case"L":i.push.apply(i,v(X(s[0],s[1],o[0],o[1],t))),s=[o[0],o[1]];break;case"C":var u=d(o,6),f=u[0],c=u[1],p=u[2],g=u[3],y=u[4],m=u[5];i.push.apply(i,v(function(e,t,a,r,i,n,s,o){for(var l=[],h=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3],u=[0,0],f=o.disableMultiStroke?1:2,c=o.preserveVertices,p=0;p<f;p++)0===p?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(c?0:$(h[0],o)),s[1]+(c?0:$(h[0],o))]}),u=c?[i,n]:[i+$(h[p],o),n+$(h[p],o)],l.push({op:"bcurveTo",data:[e+$(h[p],o),t+$(h[p],o),a+$(h[p],o),r+$(h[p],o),u[0],u[1]]});return l}(f,c,p,g,y,m,s,t))),s=[y,m];break;case"Z":i.push.apply(i,v(X(s[0],s[1],n[0],n[1],t))),s=[n[0],n[1]]}};for(o.s();!(a=o.n()).done;)l()}catch(e){o.e(e)}finally{o.f()}return{type:"path",ops:i}}(e,a))),this._d("path",r,a)}},{key:"opsToPath",value:function(e,t){var a,r="",i=m(e.ops);try{for(i.s();!(a=i.n()).done;){var n=a.value,s="number"==typeof t&&t>=0?n.data.map((function(e){return+e.toFixed(t)})):n.data;switch(n.op){case"move":r+="M".concat(s[0]," ").concat(s[1]," ");break;case"bcurveTo":r+="C".concat(s[0]," ").concat(s[1],", ").concat(s[2]," ").concat(s[3],", ").concat(s[4]," ").concat(s[5]," ");break;case"lineTo":r+="L".concat(s[0]," ").concat(s[1]," ")}}}catch(e){i.e(e)}finally{i.f()}return r.trim()}},{key:"toPaths",value:function(e){var t,a=e.sets||[],r=e.options||this.defaultOptions,i=[],n=m(a);try{for(n.s();!(t=n.n()).done;){var s=t.value,o=null;switch(s.type){case"path":o={d:this.opsToPath(s),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:fe};break;case"fillPath":o={d:this.opsToPath(s),stroke:fe,strokeWidth:0,fill:r.fill||fe};break;case"fillSketch":o=this.fillSketch(s,r)}o&&i.push(o)}}catch(e){n.e(e)}finally{n.f()}return i}},{key:"fillSketch",value:function(e,t){var a=t.fillWeight;return a<0&&(a=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||fe,strokeWidth:a,fill:fe}}}],[{key:"newSeed",value:function(){return Math.floor(Math.random()*Math.pow(2,31))}}]),e}(),pe=function(){function e(t,a){s(this,e),this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ce(a)}return l(e,[{key:"draw",value:function(e){var t,a=e.sets||[],r=e.options||this.getDefaultOptions(),i=this.ctx,n=e.options.fixedDecimalPlaceDigits,s=m(a);try{for(s.s();!(t=s.n()).done;){var o=t.value;switch(o.type){case"path":i.save(),i.strokeStyle="none"===r.stroke?"transparent":r.stroke,i.lineWidth=r.strokeWidth,r.strokeLineDash&&i.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(i.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(i,o,n),i.restore();break;case"fillPath":i.save(),i.fillStyle=r.fill||"";var l="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(i,o,n,l),i.restore();break;case"fillSketch":this.fillSketch(i,o,r)}}}catch(e){s.e(e)}finally{s.f()}}},{key:"fillSketch",value:function(e,t,a){var r=a.fillWeight;r<0&&(r=a.strokeWidth/2),e.save(),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),e.strokeStyle=a.fill||"",e.lineWidth=r,this._drawToContext(e,t,a.fixedDecimalPlaceDigits),e.restore()}},{key:"_drawToContext",value:function(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";e.beginPath();var i,n=m(t.ops);try{for(n.s();!(i=n.n()).done;){var s=i.value,o="number"==typeof a&&a>=0?s.data.map((function(e){return+e.toFixed(a)})):s.data;switch(s.op){case"move":e.moveTo(o[0],o[1]);break;case"bcurveTo":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":e.lineTo(o[0],o[1])}}}catch(e){n.e(e)}finally{n.f()}"fillPath"===t.type?e.fill(r):e.stroke()}},{key:"generator",get:function(){return this.gen}},{key:"getDefaultOptions",value:function(){return this.gen.defaultOptions}},{key:"line",value:function(e,t,a,r,i){var n=this.gen.line(e,t,a,r,i);return this.draw(n),n}},{key:"rectangle",value:function(e,t,a,r,i){var n=this.gen.rectangle(e,t,a,r,i);return this.draw(n),n}},{key:"ellipse",value:function(e,t,a,r,i){var n=this.gen.ellipse(e,t,a,r,i);return this.draw(n),n}},{key:"circle",value:function(e,t,a,r){var i=this.gen.circle(e,t,a,r);return this.draw(i),i}},{key:"linearPath",value:function(e,t){var a=this.gen.linearPath(e,t);return this.draw(a),a}},{key:"polygon",value:function(e,t){var a=this.gen.polygon(e,t);return this.draw(a),a}},{key:"arc",value:function(e,t,a,r,i,n){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this.gen.arc(e,t,a,r,i,n,s,o);return this.draw(l),l}},{key:"curve",value:function(e,t){var a=this.gen.curve(e,t);return this.draw(a),a}},{key:"path",value:function(e,t){var a=this.gen.path(e,t);return this.draw(a),a}}]),e}(),de=function(e,t){return new pe(e,t)};const ve={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};let ge=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="arc",this.numberType=a.ARC_NUMBER_TYPE}draw(e,t,r,i){const{context:n}=r;if(!n)return;const s=n.canvas.nativeCanvas,o=de(s);n.highPerformanceSave();const l=a.getTheme(e).arc;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,n.setTransformForCurrent()}else h=0,u=0,n.transformFromMatrix(e.transMatrix,!0);const f=new a.CustomPath2D,{fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth,outerRadius:v=l.outerRadius,innerRadius:g=l.innerRadius,maxRandomnessOffset:y=ve.maxRandomnessOffset,roughness:m=ve.roughness,bowing:b=ve.bowing,curveFitting:k=ve.curveFitting,curveTightness:M=ve.curveTightness,curveStepCount:S=ve.curveStepCount,fillStyle:x=ve.fillStyle,fillWeight:w=ve.fillWeight,hachureAngle:O=ve.hachureAngle,hachureGap:P=ve.hachureGap,simplification:D=ve.simplification,dashOffset:R=ve.dashOffset,dashGap:C=ve.dashGap,zigzagOffset:T=ve.zigzagOffset,seed:_=ve.seed,fillLineDash:L=ve.fillLineDash,fillLineDashOffset:W=ve.fillLineDashOffset,disableMultiStroke:z=ve.disableMultiStroke,disableMultiStrokeFill:G=ve.disableMultiStrokeFill,preserveVertices:F=ve.preserveVertices,fixedDecimalPlaceDigits:j=ve.fixedDecimalPlaceDigits}=e.attribute;a.drawArcPath(e,f,h,u,v,g),o.path(f.toString(),{fill:c||void 0,stroke:p||void 0,strokeWidth:d,maxRandomnessOffset:y,roughness:m,bowing:b,curveFitting:k,curveTightness:M,curveStepCount:S,fillStyle:x,fillWeight:w,hachureAngle:O,hachureGap:P,simplification:D,dashOffset:R,dashGap:C,zigzagOffset:T,seed:_,fillLineDash:L,fillLineDashOffset:W,disableMultiStroke:z,disableMultiStrokeFill:G,preserveVertices:F,fixedDecimalPlaceDigits:j}),n.highPerformanceRestore()}drawShape(e,t,a,r,i,n,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,i,n,s,o)}};ge=b([r.injectable(),k(0,r.inject(a.DefaultCanvasArcRender)),M("design:paramtypes",[Object])],ge);let ye=class extends a.DefaultCanvasAreaRender{style="rough";drawSegmentItem(e,t,r,i,n,s,o,l,h,u,f,c){if(c)return super.drawSegmentItem(e,t,r,i,n,s,o,l,h,u,f,c);e.highPerformanceSave();const p=e.canvas.nativeCanvas,d=de(p,{}),v=new a.CustomPath2D;a.drawAreaSegments(v,t,o,{offsetX:l,offsetY:h});const{maxRandomnessOffset:g=ve.maxRandomnessOffset,roughness:y=ve.roughness,bowing:m=ve.bowing,curveFitting:b=ve.curveFitting,curveTightness:k=ve.curveTightness,curveStepCount:M=ve.curveStepCount,fillStyle:S=ve.fillStyle,fillWeight:x=ve.fillWeight,hachureAngle:w=ve.hachureAngle,hachureGap:O=ve.hachureGap,simplification:P=ve.simplification,dashOffset:D=ve.dashOffset,dashGap:R=ve.dashGap,zigzagOffset:C=ve.zigzagOffset,seed:T=ve.seed,fillLineDash:_=ve.fillLineDash,fillLineDashOffset:L=ve.fillLineDashOffset,disableMultiStroke:W=ve.disableMultiStroke,disableMultiStrokeFill:z=ve.disableMultiStrokeFill,preserveVertices:G=ve.preserveVertices,fixedDecimalPlaceDigits:F=ve.fixedDecimalPlaceDigits}=n;let{fill:j,stroke:A,lineWidth:I}=n;return Array.isArray(s)?s.forEach((e=>{j=j??e.fill,A=A??e.stroke,I=I??e.lineWidth})):(j=j??s.fill,A=A??s.stroke,I=I??s.lineWidth),d.path(v.toString(),{fill:r?j:void 0,strokeWidth:I,maxRandomnessOffset:g,roughness:y,bowing:m,curveFitting:b,curveTightness:k,curveStepCount:M,fillStyle:S,fillWeight:x,hachureAngle:w,hachureGap:O,simplification:P,dashOffset:D,dashGap:R,zigzagOffset:C,seed:T,fillLineDash:_,fillLineDashOffset:L,disableMultiStroke:W,disableMultiStrokeFill:z,preserveVertices:G,fixedDecimalPlaceDigits:F}),e.highPerformanceRestore(),!1}};ye=b([r.injectable()],ye);let me=class{canvasRenderer;style="rough";constructor(e){this.canvasRenderer=e,this.type="circle",this.numberType=a.CIRCLE_NUMBER_TYPE}draw(e,t,r,i){const{context:n}=r;if(!n)return;const s=n.canvas.nativeCanvas,o=de(s,{}),l=a.getTheme(e).circle;let{x:h=l.x,y:u=l.y}=e.attribute;e.transMatrix.onlyTranslate()?n.onlyTranslate()||n.clearMatrix():(h=0,u=0,n.transformFromMatrix(e.transMatrix,!0));const{radius:f=l.radius,fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth}=e.attribute;o.circle(h,u,f,{fill:c||void 0,stroke:p||void 0,strokeWidth:d,fillStyle:"zigzag",roughness:.5})}drawShape(e,t,a,r,i,n,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,i,n,s,o)}};me=b([r.injectable(),k(0,r.inject(a.DefaultCanvasCircleRender)),M("design:paramtypes",[Object])],me);let be=class extends a.DefaultCanvasLineRender{style="rough";drawSegmentItem(e,t,r,i,n,s,o,l,h,u,f,c,p,d,v){if(d||v)return super.drawSegmentItem(e,t,r,i,n,s,o,l,h,u,f,c,p,d,v);e.highPerformanceSave();const g=e.canvas.nativeCanvas,y=de(g,{}),m=new a.CustomPath2D;a.drawSegments(e.camera?e:e.nativeContext,t,h,u,{offsetX:f,offsetY:c});const{maxRandomnessOffset:b=ve.maxRandomnessOffset,roughness:k=ve.roughness,bowing:M=ve.bowing,curveFitting:S=ve.curveFitting,curveTightness:x=ve.curveTightness,curveStepCount:w=ve.curveStepCount,fillStyle:O=ve.fillStyle,fillWeight:P=ve.fillWeight,hachureAngle:D=ve.hachureAngle,hachureGap:R=ve.hachureGap,simplification:C=ve.simplification,dashOffset:T=ve.dashOffset,dashGap:_=ve.dashGap,zigzagOffset:L=ve.zigzagOffset,seed:W=ve.seed,fillLineDash:z=ve.fillLineDash,fillLineDashOffset:G=ve.fillLineDashOffset,disableMultiStroke:F=ve.disableMultiStroke,disableMultiStrokeFill:j=ve.disableMultiStrokeFill,preserveVertices:A=ve.preserveVertices,fixedDecimalPlaceDigits:I=ve.fixedDecimalPlaceDigits}=o;let{fill:E,stroke:V,lineWidth:H}=o;return Array.isArray(l)?l.forEach((e=>{E=E??e.fill,V=V??e.stroke,H=H??e.lineWidth})):(E=E??l.fill,V=V??l.stroke,H=H??l.lineWidth),y.path(m.toString(),{fill:r?E:void 0,stroke:i?V:void 0,strokeWidth:H,maxRandomnessOffset:b,roughness:k,bowing:M,curveFitting:S,curveTightness:x,curveStepCount:w,fillStyle:O,fillWeight:P,hachureAngle:D,hachureGap:R,simplification:C,dashOffset:T,dashGap:_,zigzagOffset:L,seed:W,fillLineDash:z,fillLineDashOffset:G,disableMultiStroke:F,disableMultiStrokeFill:j,preserveVertices:A,fixedDecimalPlaceDigits:I}),e.highPerformanceRestore(),!1}};be=b([r.injectable()],be);let ke=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="path",this.numberType=a.PATH_NUMBER_TYPE}draw(e,t,r,i){const{context:n}=r;if(!n)return;const s=n.canvas.nativeCanvas,o=de(s,{});n.highPerformanceSave();const l=a.getTheme(e).path;n.transformFromMatrix(e.transMatrix,!0);const{fill:h=l.fill,stroke:u=l.stroke,lineWidth:f=l.lineWidth,path:c=l.path,maxRandomnessOffset:p=ve.maxRandomnessOffset,roughness:d=ve.roughness,bowing:v=ve.bowing,curveFitting:g=ve.curveFitting,curveTightness:y=ve.curveTightness,curveStepCount:m=ve.curveStepCount,fillStyle:b=ve.fillStyle,fillWeight:k=ve.fillWeight,hachureAngle:M=ve.hachureAngle,hachureGap:S=ve.hachureGap,simplification:x=ve.simplification,dashOffset:w=ve.dashOffset,dashGap:O=ve.dashGap,zigzagOffset:P=ve.zigzagOffset,seed:D=ve.seed,fillLineDash:R=ve.fillLineDash,fillLineDashOffset:C=ve.fillLineDashOffset,disableMultiStroke:T=ve.disableMultiStroke,disableMultiStrokeFill:_=ve.disableMultiStrokeFill,preserveVertices:L=ve.preserveVertices,fixedDecimalPlaceDigits:W=ve.fixedDecimalPlaceDigits}=e.attribute;"string"==typeof c&&o.path(c,{fill:h||void 0,stroke:u||void 0,strokeWidth:f,maxRandomnessOffset:p,roughness:d,bowing:v,curveFitting:g,curveTightness:y,curveStepCount:m,fillStyle:b,fillWeight:k,hachureAngle:M,hachureGap:S,simplification:x,dashOffset:w,dashGap:O,zigzagOffset:P,seed:D,fillLineDash:R,fillLineDashOffset:C,disableMultiStroke:T,disableMultiStrokeFill:_,preserveVertices:L,fixedDecimalPlaceDigits:W}),n.highPerformanceRestore()}drawShape(e,t,a,r,i,n,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,i,n,s,o)}};ke=b([r.injectable(),k(0,r.inject(a.DefaultCanvasPathRender)),M("design:paramtypes",[Object])],ke);let Me=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="rect",this.numberType=a.RECT_NUMBER_TYPE}draw(e,t,r,i){const{context:n}=r;if(!n)return;const s=n.canvas.nativeCanvas,o=de(s);n.highPerformanceSave();const l=a.getTheme(e).rect;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,n.setTransformForCurrent()}else h=0,u=0,n.transformFromMatrix(e.transMatrix,!0);const{fill:f=l.fill,stroke:c=l.stroke,fillColor:p=l.fill,strokeColor:d=l.stroke,width:v=l.width,height:g=l.height,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=ve.maxRandomnessOffset,roughness:b=ve.roughness,bowing:k=ve.bowing,curveFitting:M=ve.curveFitting,curveTightness:S=ve.curveTightness,curveStepCount:x=ve.curveStepCount,fillStyle:w=ve.fillStyle,fillWeight:O=ve.fillWeight,hachureAngle:P=ve.hachureAngle,hachureGap:D=ve.hachureGap,simplification:R=ve.simplification,dashOffset:C=ve.dashOffset,dashGap:T=ve.dashGap,zigzagOffset:_=ve.zigzagOffset,seed:L=ve.seed,fillLineDash:W=ve.fillLineDash,fillLineDashOffset:z=ve.fillLineDashOffset,disableMultiStroke:G=ve.disableMultiStroke,disableMultiStrokeFill:F=ve.disableMultiStrokeFill,preserveVertices:j=ve.preserveVertices,fixedDecimalPlaceDigits:A=ve.fixedDecimalPlaceDigits}=e.attribute;o.rectangle(h,u,v,g,{fill:f?p:void 0,stroke:c?d:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:w,fillWeight:O,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:C,dashGap:T,zigzagOffset:_,seed:L,fillLineDash:W,fillLineDashOffset:z,disableMultiStroke:G,disableMultiStrokeFill:F,preserveVertices:j,fixedDecimalPlaceDigits:A}),n.highPerformanceRestore()}drawShape(e,t,a,r,i,n,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,i,n,s,o)}};Me=b([r.injectable(),k(0,r.inject(a.DefaultCanvasRectRender)),M("design:paramtypes",[Object])],Me);let Se=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="symbol",this.numberType=a.SYMBOL_NUMBER_TYPE}draw(e,t,r,i){const{context:n}=r;if(!n)return;const s=n.canvas.nativeCanvas,o=de(s);n.highPerformanceSave();const l=a.getTheme(e).symbol;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,n.setTransformForCurrent()}else h=0,u=0,n.transformFromMatrix(e.transMatrix,!0);const f=e.getParsedPath();if(!f)return;const{fill:c=l.fill,stroke:p=l.stroke,fillColor:d=l.fill,strokeColor:v=l.stroke,size:g=l.size,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=ve.maxRandomnessOffset,roughness:b=ve.roughness,bowing:k=ve.bowing,curveFitting:M=ve.curveFitting,curveTightness:S=ve.curveTightness,curveStepCount:x=ve.curveStepCount,fillStyle:w=ve.fillStyle,fillWeight:O=ve.fillWeight,hachureAngle:P=ve.hachureAngle,hachureGap:D=ve.hachureGap,simplification:R=ve.simplification,dashOffset:C=ve.dashOffset,dashGap:T=ve.dashGap,zigzagOffset:_=ve.zigzagOffset,seed:L=ve.seed,fillLineDash:W=ve.fillLineDash,fillLineDashOffset:z=ve.fillLineDashOffset,disableMultiStroke:G=ve.disableMultiStroke,disableMultiStrokeFill:F=ve.disableMultiStrokeFill,preserveVertices:j=ve.preserveVertices,fixedDecimalPlaceDigits:A=ve.fixedDecimalPlaceDigits}=e.attribute,I=new a.CustomPath2D;f.draw(I,g,h,u)&&I.closePath(),o.path(I.toString(),{fill:c?d:void 0,stroke:p?v:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:w,fillWeight:O,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:C,dashGap:T,zigzagOffset:_,seed:L,fillLineDash:W,fillLineDashOffset:z,disableMultiStroke:G,disableMultiStrokeFill:F,preserveVertices:j,fixedDecimalPlaceDigits:A}),n.highPerformanceRestore()}drawShape(e,t,a,r,i,n,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,i,n,s,o)}};Se=b([r.injectable(),k(0,r.inject(a.DefaultCanvasSymbolRender)),M("design:paramtypes",[Object])],Se);var xe=new r.ContainerModule(((e,t,r,i)=>{e(me).toSelf().inSingletonScope(),e(a.GraphicRender).to(me),e(Me).toSelf().inSingletonScope(),e(a.GraphicRender).to(Me),e(ke).toSelf().inSingletonScope(),e(a.GraphicRender).to(ke),e(Se).toSelf().inSingletonScope(),e(a.GraphicRender).to(Se),e(be).toSelf().inSingletonScope(),e(a.GraphicRender).to(be),e(ye).toSelf().inSingletonScope(),e(a.GraphicRender).to(ye),e(ge).toSelf().inSingletonScope(),e(a.GraphicRender).to(ge)}));new i.Matrix(1,0,0,1,0,0);let we=class extends a.BrowserContext2d{static env="node";constructor(e,t){super(e,t);const a=e.nativeCanvas.getContext("2d");if(!a)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=a,this.canvas=e,this.matrix=new i.Matrix(1,0,0,1,0,0),this.stack=[],this.dpr=t??1}release(...e){}};we=b([r.injectable(),M("design:paramtypes",[Object,Number])],we);const Oe={WIDTH:500,HEIGHT:500,DPR:1};let Pe=class{static env="node";_id;_displayWidth;_displayHeight;_pixelWidth;_pixelHeight;_nativeCanvas;_context;_visiable;controled;_dpr;get id(){return this._id}get x(){return 0}get y(){return 0}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(e){this._pixelWidth=e,this._displayWidth=e/(this._dpr||1)}get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get height(){return this._pixelHeight}set height(e){this._pixelHeight=e,this._displayHeight=e/(this._dpr||1)}getContext(e){return this._context}get visiable(){return this._visiable}set visiable(e){this._visiable=e,e?this.show():this.hide()}get dpr(){return this._dpr}set dpr(e){this._dpr=e,this.resize(this.width,this.height)}constructor(e){const{nativeCanvas:t,width:a=Oe.WIDTH,height:r=Oe.HEIGHT,canvasControled:i=!0,dpr:n=Oe.DPR}=e;this._visiable=!1!==e.visiable,this.controled=i,this._pixelWidth=a*n,this._pixelHeight=r*n,this._displayWidth=a,this._displayHeight=r,this._nativeCanvas=t,this._context=new we(this,e.dpr),this._id=t.id,this._dpr=n}applyPosition(){}getNativeCanvas(){return this._nativeCanvas}resetStyle(e){}hide(){}show(){}resize(e,t){this._pixelWidth=e*this._dpr,this._pixelHeight=t*this._dpr,this._displayWidth=e,this._displayHeight=t,this._nativeCanvas&&(this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight)}toDataURL(e,t){return""}readPixels(e,t,a,r){return this._context.getImageData(e,t,a,r)}convertToBlob(e){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...e){throw new Error("暂不支持release")}};Pe=b([r.injectable(),M("design:paramtypes",[Object])],Pe);var De=new r.ContainerModule((e=>{e(a.CanvasFactory).toDynamicValue((()=>e=>new Pe(e))).whenTargetNamed(we.env),e(a.Context2dFactory).toDynamicValue((()=>e=>new we(e,e.dpr))).whenTargetNamed(we.env)}));const Re=xe,Ce=function(e){e.load(De)};e.canvasModuleLoader=Ce,e.roughModule=Re}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("reflect-metadata"),require("@visactor/vrender"),require("inversify")):"function"==typeof define&&define.amd?define(["exports","reflect-metadata","@visactor/vrender","inversify"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).VRender=e.VRender||{},e.VRender.Kits={}),null,e.vrender,e.inversify)}(this,(function(e,t,a,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(n=r.key,i=void 0,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var r=a.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(n,"string"))?i:String(i)),r)}var n,i}function o(e,t,a){return t&&s(e.prototype,t),a&&s(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function f(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=h(e);if(t){var n=h(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return f(this,a)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,n,i,s,o=[],l=!0,h=!1;try{if(i=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;l=!1}else for(;!(l=(r=i.call(a)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){h=!0,n=e}finally{try{if(!l&&null!=a.return&&(s=a.return(),Object(s)!==s))return}finally{if(h)throw n}}return o}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return g(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function y(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=v(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw i}}}}function m(e,t,a,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,a):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,a,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(o=(s<3?i(o):s>3?i(t,a,o):i(t,a))||o);return s>3&&o&&Object.defineProperty(t,a,o),o}function b(e,t){return function(a,r){t(a,r,e)}}function k(e,t){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function M(e,t,a){if(e&&e.length){var r=p(t,2),n=r[0],i=r[1],s=Math.PI/180*a,o=Math.cos(s),l=Math.sin(s);e.forEach((function(e){var t=p(e,2),a=t[0],r=t[1];e[0]=(a-n)*o-(r-i)*l+n,e[1]=(a-n)*l+(r-i)*o+i}))}}function S(e){var t=e[0],a=e[1];return Math.sqrt(Math.pow(t[0]-a[0],2)+Math.pow(t[1]-a[1],2))}function x(e,t){var a=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var n=[0,0];if(a){var i,s=y(e);try{for(s.s();!(i=s.n()).done;){M(i.value,n,a)}}catch(e){s.e(e)}finally{s.f()}}var o=function(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=d(a.value);i[0].join(",")!==i[i.length-1].join(",")&&i.push([i[0][0],i[0][1]]),i.length>2&&r.push(i)}}catch(e){n.e(e)}finally{n.f()}var s=[];t=Math.max(t,.1);for(var o=[],l=0,h=r;l<h.length;l++)for(var u=h[l],f=0;f<u.length-1;f++){var c=u[f],p=u[f+1];if(c[1]!==p[1]){var v=Math.min(c[1],p[1]);o.push({ymin:v,ymax:Math.max(c[1],p[1]),x:v===c[1]?c[0]:p[0],islope:(p[0]-c[0])/(p[1]-c[1])})}}if(o.sort((function(e,t){return e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)})),!o.length)return s;for(var g=[],m=o[0].ymin;g.length||o.length;){if(o.length){for(var b=-1,k=0;k<o.length&&!(o[k].ymin>m);k++)b=k;o.splice(0,b+1).forEach((function(e){g.push({s:m,edge:e})}))}if(g=g.filter((function(e){return!(e.edge.ymax<=m)})),g.sort((function(e,t){return e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)})),g.length>1)for(var M=0;M<g.length;M+=2){var S=M+1;if(S>=g.length)break;var x=g[M].edge,O=g[S].edge;s.push([[Math.round(x.x),m],[Math.round(O.x),m]])}m+=t,g.forEach((function(e){e.edge.x=e.edge.x+t*e.edge.islope}))}return s}(e,r);if(a){var l,h=y(e);try{for(h.s();!(l=h.n()).done;){M(l.value,n,-a)}}catch(e){h.e(e)}finally{h.f()}!function(e,t,a){var r=[];e.forEach((function(e){return r.push.apply(r,d(e))})),M(r,t,a)}(o,n,-a)}return o}var O=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){return this._fillPolygons(e,t)}},{key:"_fillPolygons",value:function(e,t){var a=x(e,t);return{type:"fillSketch",ops:this.renderLines(a,t)}}},{key:"renderLines",value:function(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=a.value;r.push.apply(r,d(this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],t)))}}catch(e){n.e(e)}finally{n.f()}return r}}]),e}(),w=function(e){l(a,e);var t=c(a);function a(){return i(this,a),t.apply(this,arguments)}return o(a,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap;a<0&&(a=4*t.strokeWidth),a=Math.max(a,.1);var r,n=x(e,Object.assign({},t,{hachureGap:a})),i=Math.PI/180*t.hachureAngle,s=[],o=.5*a*Math.cos(i),l=.5*a*Math.sin(i),h=y(n);try{for(h.s();!(r=h.n()).done;){var u=p(r.value,2),f=u[0],c=u[1];S([f,c])&&s.push([[f[0]-o,f[1]+l],d(c)],[[f[0]+o,f[1]-l],d(c)])}}catch(e){h.e(e)}finally{h.f()}return{type:"fillSketch",ops:this.renderLines(s,t)}}}]),a}(O),P=function(e){l(a,e);var t=c(a);function a(){return i(this,a),t.apply(this,arguments)}return o(a,[{key:"fillPolygons",value:function(e,t){var a=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),n=this._fillPolygons(e,r);return a.ops=a.ops.concat(n.ops),a}}]),a}(O),D=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=x(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(a,t)}},{key:"dotsOnLines",value:function(e,t){var a=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);var n=t.fillWeight;n<0&&(n=t.strokeWidth/2);var i,s=r/4,o=y(e);try{for(o.s();!(i=o.n()).done;)for(var l=i.value,h=S(l),u=h/r,f=Math.ceil(u)-1,c=h-f*r,p=(l[0][0]+l[1][0])/2-r/4,v=Math.min(l[0][1],l[1][1]),g=0;g<f;g++){var m=v+c+g*r,b=p-s+2*Math.random()*s,k=m-s+2*Math.random()*s,M=this.helper.ellipse(b,k,n,n,t);a.push.apply(a,d(M.ops))}}catch(e){o.e(e)}finally{o.f()}return{type:"fillSketch",ops:a}}}]),e}(),R=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=x(e,t);return{type:"fillSketch",ops:this.dashedLine(a,t)}}},{key:"dashedLine",value:function(e,t){var a=this,r=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,n=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((function(e){var s=S(e),o=Math.floor(s/(r+n)),l=(s+n-o*(r+n))/2,h=e[0],u=e[1];h[0]>u[0]&&(h=e[1],u=e[0]);for(var f=Math.atan((u[1]-h[1])/(u[0]-h[0])),c=0;c<o;c++){var p=c*(r+n),v=p+r,g=[h[0]+p*Math.cos(f)+l*Math.cos(f),h[1]+p*Math.sin(f)+l*Math.sin(f)],y=[h[0]+v*Math.cos(f)+l*Math.cos(f),h[1]+v*Math.sin(f)+l*Math.sin(f)];i.push.apply(i,d(a.helper.doubleLineOps(g[0],g[1],y[0],y[1],t)))}})),i}}]),e}(),T=function(){function e(t){i(this,e),this.helper=t}return o(e,[{key:"fillPolygons",value:function(e,t){var a=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?a:t.zigzagOffset,n=x(e,t=Object.assign({},t,{hachureGap:a+r}));return{type:"fillSketch",ops:this.zigzagLines(n,r,t)}}},{key:"zigzagLines",value:function(e,t,a){var r=this,n=[];return e.forEach((function(e){var i=S(e),s=Math.round(i/(2*t)),o=e[0],l=e[1];o[0]>l[0]&&(o=e[1],l=e[0]);for(var h=Math.atan((l[1]-o[1])/(l[0]-o[0])),u=0;u<s;u++){var f=2*u*t,c=2*(u+1)*t,p=Math.sqrt(2*Math.pow(t,2)),v=[o[0]+f*Math.cos(h),o[1]+f*Math.sin(h)],g=[o[0]+c*Math.cos(h),o[1]+c*Math.sin(h)],y=[v[0]+p*Math.cos(h+Math.PI/4),v[1]+p*Math.sin(h+Math.PI/4)];n.push.apply(n,d(r.helper.doubleLineOps(v[0],v[1],y[0],y[1],a)).concat(d(r.helper.doubleLineOps(y[0],y[1],g[0],g[1],a))))}})),n}}]),e}(),C={},L=function(){function e(t){i(this,e),this.seed=t}return o(e,[{key:"next",value:function(){return this.seed?(Math.pow(2,31)-1&(this.seed=Math.imul(48271,this.seed)))/Math.pow(2,31):Math.random()}}]),e}(),z={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function W(e,t){return e.type===t}function G(e){for(var t=[],a=function(e){for(var t=new Array;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:"".concat(parseFloat(RegExp.$1))},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e),r="BOD",n=0,i=a[n];!W(i,2);){var s=0,o=[];if("BOD"===r){if("M"!==i.text&&"m"!==i.text)return G("M0,0"+e);n++,s=z[i.text],r=i.text}else W(i,1)?s=z[r]:(n++,s=z[i.text],r=i.text);if(!(n+s<a.length))throw new Error("Path data ended short");for(var l=n;l<n+s;l++){var h=a[l];if(!W(h,1))throw new Error("Param not a number: "+r+","+h.text);o[o.length]=+h.text}if("number"!=typeof z[r])throw new Error("Bad segment: "+r);var u={key:r,data:o};t.push(u),i=a[n+=s],"M"===r&&(r="L"),"m"===r&&(r="l")}return t}function F(e){var t,a,r,n,i=0,s=0,o=0,l=0,h=[],u=y(e);try{for(u.s();!(n=u.n()).done;){var f=n.value,c=f.key,v=f.data;switch(c){case"M":h.push({key:"M",data:d(v)}),t=p(v,2),i=t[0],s=t[1],o=(a=p(v,2))[0],l=a[1];break;case"m":i+=v[0],s+=v[1],h.push({key:"M",data:[i,s]}),o=i,l=s;break;case"L":h.push({key:"L",data:d(v)}),r=p(v,2),i=r[0],s=r[1];break;case"l":i+=v[0],s+=v[1],h.push({key:"L",data:[i,s]});break;case"C":h.push({key:"C",data:d(v)}),i=v[4],s=v[5];break;case"c":var g=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"C",data:g}),i=g[4],s=g[5];break;case"Q":h.push({key:"Q",data:d(v)}),i=v[2],s=v[3];break;case"q":var m=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"Q",data:m}),i=m[2],s=m[3];break;case"A":h.push({key:"A",data:d(v)}),i=v[5],s=v[6];break;case"a":i+=v[5],s+=v[6],h.push({key:"A",data:[v[0],v[1],v[2],v[3],v[4],i,s]});break;case"H":h.push({key:"H",data:d(v)}),i=v[0];break;case"h":i+=v[0],h.push({key:"H",data:[i]});break;case"V":h.push({key:"V",data:d(v)}),s=v[0];break;case"v":s+=v[0],h.push({key:"V",data:[s]});break;case"S":h.push({key:"S",data:d(v)}),i=v[2],s=v[3];break;case"s":var b=v.map((function(e,t){return t%2?e+s:e+i}));h.push({key:"S",data:b}),i=b[2],s=b[3];break;case"T":h.push({key:"T",data:d(v)}),i=v[0],s=v[1];break;case"t":i+=v[0],s+=v[1],h.push({key:"T",data:[i,s]});break;case"Z":case"z":h.push({key:"Z",data:[]}),i=o,s=l}}}catch(e){u.e(e)}finally{u.f()}return h}function A(e){var t,a,r,n,i=[],s="",o=0,l=0,h=0,u=0,f=0,c=0,v=y(e);try{for(v.s();!(n=v.n()).done;){var g=n.value,m=g.key,b=g.data;switch(m){case"M":i.push({key:"M",data:d(b)}),o=(t=p(b,2))[0],l=t[1],h=(a=p(b,2))[0],u=a[1];break;case"C":i.push({key:"C",data:d(b)}),o=b[4],l=b[5],f=b[2],c=b[3];break;case"L":i.push({key:"L",data:d(b)}),o=(r=p(b,2))[0],l=r[1];break;case"H":o=b[0],i.push({key:"L",data:[o,l]});break;case"V":l=b[0],i.push({key:"L",data:[o,l]});break;case"S":var k=0,M=0;"C"===s||"S"===s?(k=o+(o-f),M=l+(l-c)):(k=o,M=l),i.push({key:"C",data:[k,M].concat(d(b))}),f=b[0],c=b[1],o=b[2],l=b[3];break;case"T":var S=p(b,2),x=S[0],O=S[1],w=0,P=0;"Q"===s||"T"===s?(w=o+(o-f),P=l+(l-c)):(w=o,P=l);var D=o+2*(w-o)/3,R=l+2*(P-l)/3,T=x+2*(w-x)/3,C=O+2*(P-O)/3;i.push({key:"C",data:[D,R,T,C,x,O]}),f=w,c=P,o=x,l=O;break;case"Q":var L=p(b,4),z=L[0],W=L[1],G=L[2],F=L[3],A=o+2*(z-o)/3,j=l+2*(W-l)/3,I=G+2*(z-G)/3,E=F+2*(W-F)/3;i.push({key:"C",data:[A,j,I,E,G,F]}),f=z,c=W,o=G,l=F;break;case"A":var V=Math.abs(b[0]),q=Math.abs(b[1]),B=b[2],Y=b[3],Z=b[4],H=b[5],Q=b[6];0===V||0===q?(i.push({key:"C",data:[o,l,H,Q,H,Q]}),o=H,l=Q):o===H&&l===Q||(_(o,l,H,Q,V,q,B,Y,Z).forEach((function(e){i.push({key:"C",data:e})})),o=H,l=Q);break;case"Z":i.push({key:"Z",data:[]}),o=h,l=u}s=m}}catch(e){v.e(e)}finally{v.f()}return i}function j(e,t,a){return[e*Math.cos(a)-t*Math.sin(a),e*Math.sin(a)+t*Math.cos(a)]}function _(e,t,a,r,n,i,s,o,l,h){var u,f=(u=s,Math.PI*u/180),c=[],d=0,v=0,g=0,y=0;if(h){var m=p(h,4);d=m[0],v=m[1],g=m[2],y=m[3]}else{var b,k;e=(b=p(j(e,t,-f),2))[0],t=b[1];var M=(e-(a=(k=p(j(a,r,-f),2))[0]))/2,S=(t-(r=k[1]))/2,x=M*M/(n*n)+S*S/(i*i);x>1&&(n*=x=Math.sqrt(x),i*=x);var O=n*n,w=i*i,P=O*w-O*S*S-w*M*M,D=O*S*S+w*M*M,R=(o===l?-1:1)*Math.sqrt(Math.abs(P/D));g=R*n*S/i+(e+a)/2,y=R*-i*M/n+(t+r)/2,d=Math.asin(parseFloat(((t-y)/i).toFixed(9))),v=Math.asin(parseFloat(((r-y)/i).toFixed(9))),e<g&&(d=Math.PI-d),a<g&&(v=Math.PI-v),d<0&&(d=2*Math.PI+d),v<0&&(v=2*Math.PI+v),l&&d>v&&(d-=2*Math.PI),!l&&v>d&&(v-=2*Math.PI)}var T=v-d;if(Math.abs(T)>120*Math.PI/180){var C=v,L=a,z=r;v=l&&v>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,c=_(a=g+n*Math.cos(v),r=y+i*Math.sin(v),L,z,n,i,s,0,l,[v,C,g,y])}T=v-d;var W=Math.cos(d),G=Math.sin(d),F=Math.cos(v),A=Math.sin(v),I=Math.tan(T/4),E=4/3*n*I,V=4/3*i*I,q=[e,t],B=[e+E*G,t-V*W],Y=[a+E*A,r-V*F],Z=[a,r];if(B[0]=2*q[0]-B[0],B[1]=2*q[1]-B[1],h)return[B,Y,Z].concat(c);c=[B,Y,Z].concat(c);for(var H=[],Q=0;Q<c.length;Q+=3){var N=j(c[Q][0],c[Q][1],f),U=j(c[Q+1][0],c[Q+1][1],f),$=j(c[Q+2][0],c[Q+2][1],f);H.push([N[0],N[1],U[0],U[1],$[0],$[1]])}return H}var I={randOffset:function(e,t){return U(e,t)},randOffsetWithRange:function(e,t,a){return N(e,t,a)},ellipse:function(e,t,a,r,n){return B(e,t,n,q(a,r,n)).opset},doubleLineOps:function(e,t,a,r,n){return $(e,t,a,r,n,!0)}};function E(e,t,a,r,n){return{type:"path",ops:$(e,t,a,r,n)}}function V(e,t,a){var r=(e||[]).length;if(r>2){for(var n=[],i=0;i<r-1;i++)n.push.apply(n,d($(e[i][0],e[i][1],e[i+1][0],e[i+1][1],a)));return t&&n.push.apply(n,d($(e[r-1][0],e[r-1][1],e[0][0],e[0][1],a))),{type:"path",ops:n}}return 2===r?E(e[0][0],e[0][1],e[1][0],e[1][1],a):{type:"path",ops:[]}}function q(e,t,a){var r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),n=Math.ceil(Math.max(a.curveStepCount,a.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/n,s=Math.abs(e/2),o=Math.abs(t/2),l=1-a.curveFitting;return{increment:i,rx:s+=U(s*l,a),ry:o+=U(o*l,a)}}function B(e,t,a,r){var n=p(ee(r.increment,e,t,r.rx,r.ry,1,r.increment*N(.1,N(.4,1,a),a),a),2),i=n[0],s=n[1],o=J(i,null,a);if(!a.disableMultiStroke&&0!==a.roughness){var l=J(p(ee(r.increment,e,t,r.rx,r.ry,1.5,0,a),1)[0],null,a);o=o.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function Y(e,t,a,r,n,i,s,o,l){var h=e,u=t,f=Math.abs(a/2),c=Math.abs(r/2);f+=U(.01*f,l),c+=U(.01*c,l);for(var p=n,v=i;p<0;)p+=2*Math.PI,v+=2*Math.PI;v-p>2*Math.PI&&(p=0,v=2*Math.PI);var g=2*Math.PI/l.curveStepCount,y=Math.min(g/2,(v-p)/2),m=te(y,h,u,f,c,p,v,1,l);if(!l.disableMultiStroke){var b=te(y,h,u,f,c,p,v,1.5,l);m.push.apply(m,d(b))}return s&&(o?m.push.apply(m,d($(h,u,h+f*Math.cos(p),u+c*Math.sin(p),l)).concat(d($(h,u,h+f*Math.cos(v),u+c*Math.sin(v),l)))):m.push({op:"lineTo",data:[h,u]},{op:"lineTo",data:[h+f*Math.cos(p),u+c*Math.sin(p)]})),{type:"path",ops:m}}function Z(e,t){var a,r=[],n=y(e);try{for(n.s();!(a=n.n()).done;){var i=a.value;if(i.length){var s=t.maxRandomnessOffset||0,o=i.length;if(o>2){r.push({op:"move",data:[i[0][0]+U(s,t),i[0][1]+U(s,t)]});for(var l=1;l<o;l++)r.push({op:"lineTo",data:[i[l][0]+U(s,t),i[l][1]+U(s,t)]})}}}}catch(e){n.e(e)}finally{n.f()}return{type:"fillPath",ops:r}}function H(e,t){return function(e,t){var a=e.fillStyle||"hachure";if(!C[a])switch(a){case"zigzag":C[a]||(C[a]=new w(t));break;case"cross-hatch":C[a]||(C[a]=new P(t));break;case"dots":C[a]||(C[a]=new D(t));break;case"dashed":C[a]||(C[a]=new R(t));break;case"zigzag-line":C[a]||(C[a]=new T(t));break;default:C[a="hachure"]||(C[a]=new O(t))}return C[a]}(t,I).fillPolygons(e,t)}function Q(e){return e.randomizer||(e.randomizer=new L(e.seed||0)),e.randomizer.next()}function N(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return a.roughness*r*(Q(a)*(t-e)+e)}function U(e,t){return N(-e,e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function $(e,t,a,r,n){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?n.disableMultiStrokeFill:n.disableMultiStroke,s=X(e,t,a,r,n,!0,!1);if(i)return s;var o=X(e,t,a,r,n,!0,!0);return s.concat(o)}function X(e,t,a,r,n,i,s){var o,l=Math.pow(e-a,2)+Math.pow(t-r,2),h=Math.sqrt(l);o=h<200?1:h>500?.4:-.0016668*h+1.233334;var u=n.maxRandomnessOffset||0;u*u*100>l&&(u=h/10);var f=u/2,c=.2+.2*Q(n),p=n.bowing*n.maxRandomnessOffset*(r-t)/200,d=n.bowing*n.maxRandomnessOffset*(e-a)/200;p=U(p,n,o),d=U(d,n,o);var v=[],g=function(){return U(f,n,o)},y=function(){return U(u,n,o)},m=n.preserveVertices;return i&&(s?v.push({op:"move",data:[e+(m?0:g()),t+(m?0:g())]}):v.push({op:"move",data:[e+(m?0:U(u,n,o)),t+(m?0:U(u,n,o))]})),s?v.push({op:"bcurveTo",data:[p+e+(a-e)*c+g(),d+t+(r-t)*c+g(),p+e+2*(a-e)*c+g(),d+t+2*(r-t)*c+g(),a+(m?0:g()),r+(m?0:g())]}):v.push({op:"bcurveTo",data:[p+e+(a-e)*c+y(),d+t+(r-t)*c+y(),p+e+2*(a-e)*c+y(),d+t+2*(r-t)*c+y(),a+(m?0:y()),r+(m?0:y())]}),v}function K(e,t,a){var r=[];r.push([e[0][0]+U(t,a),e[0][1]+U(t,a)]),r.push([e[0][0]+U(t,a),e[0][1]+U(t,a)]);for(var n=1;n<e.length;n++)r.push([e[n][0]+U(t,a),e[n][1]+U(t,a)]),n===e.length-1&&r.push([e[n][0]+U(t,a),e[n][1]+U(t,a)]);return J(r,null,a)}function J(e,t,a){var r=e.length,n=[];if(r>3){var i=[],s=1-a.curveTightness;n.push({op:"move",data:[e[1][0],e[1][1]]});for(var o=1;o+2<r;o++){var l=e[o];i[0]=[l[0],l[1]],i[1]=[l[0]+(s*e[o+1][0]-s*e[o-1][0])/6,l[1]+(s*e[o+1][1]-s*e[o-1][1])/6],i[2]=[e[o+1][0]+(s*e[o][0]-s*e[o+2][0])/6,e[o+1][1]+(s*e[o][1]-s*e[o+2][1])/6],i[3]=[e[o+1][0],e[o+1][1]],n.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}if(t&&2===t.length){var h=a.maxRandomnessOffset;n.push({op:"lineTo",data:[t[0]+U(h,a),t[1]+U(h,a)]})}}else 3===r?(n.push({op:"move",data:[e[1][0],e[1][1]]}),n.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&n.push.apply(n,d($(e[0][0],e[0][1],e[1][0],e[1][1],a)));return n}function ee(e,t,a,r,n,i,s,o){var l=[],h=[];if(0===o.roughness){e/=4,h.push([t+r*Math.cos(-e),a+n*Math.sin(-e)]);for(var u=0;u<=2*Math.PI;u+=e){var f=[t+r*Math.cos(u),a+n*Math.sin(u)];l.push(f),h.push(f)}h.push([t+r*Math.cos(0),a+n*Math.sin(0)]),h.push([t+r*Math.cos(e),a+n*Math.sin(e)])}else{var c=U(.5,o)-Math.PI/2;h.push([U(i,o)+t+.9*r*Math.cos(c-e),U(i,o)+a+.9*n*Math.sin(c-e)]);for(var p=2*Math.PI+c-.01,d=c;d<p;d+=e){var v=[U(i,o)+t+r*Math.cos(d),U(i,o)+a+n*Math.sin(d)];l.push(v),h.push(v)}h.push([U(i,o)+t+r*Math.cos(c+2*Math.PI+.5*s),U(i,o)+a+n*Math.sin(c+2*Math.PI+.5*s)]),h.push([U(i,o)+t+.98*r*Math.cos(c+s),U(i,o)+a+.98*n*Math.sin(c+s)]),h.push([U(i,o)+t+.9*r*Math.cos(c+.5*s),U(i,o)+a+.9*n*Math.sin(c+.5*s)])}return[h,l]}function te(e,t,a,r,n,i,s,o,l){var h=i+U(.1,l),u=[];u.push([U(o,l)+t+.9*r*Math.cos(h-e),U(o,l)+a+.9*n*Math.sin(h-e)]);for(var f=h;f<=s;f+=e)u.push([U(o,l)+t+r*Math.cos(f),U(o,l)+a+n*Math.sin(f)]);return u.push([t+r*Math.cos(s),a+n*Math.sin(s)]),u.push([t+r*Math.cos(s),a+n*Math.sin(s)]),J(u,null,l)}function ae(e){return d(e)}function re(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function ne(e,t,a){var r=re(t,a);if(0===r)return re(e,t);var n=((e[0]-t[0])*(a[0]-t[0])+(e[1]-t[1])*(a[1]-t[1]))/r;return re(e,ie(t,a,n=Math.max(0,Math.min(1,n))))}function ie(e,t,a){return[e[0]+(t[0]-e[0])*a,e[1]+(t[1]-e[1])*a]}function se(e,t,a,r){var n,i,s=r||[];if(function(e,t){var a=e[t+0],r=e[t+1],n=e[t+2],i=e[t+3],s=3*r[0]-2*a[0]-i[0];s*=s;var o=3*r[1]-2*a[1]-i[1];o*=o;var l=3*n[0]-2*i[0]-a[0];l*=l;var h=3*n[1]-2*i[1]-a[1];return s<l&&(s=l),o<(h*=h)&&(o=h),s+o}(e,t)<a){var o=e[t+0];s.length?(n=s[s.length-1],i=o,Math.sqrt(re(n,i))>1&&s.push(o)):s.push(o),s.push(e[t+3])}else{var l=.5,h=e[t+0],u=e[t+1],f=e[t+2],c=e[t+3],p=ie(h,u,l),d=ie(u,f,l),v=ie(f,c,l),g=ie(p,d,l),y=ie(d,v,l),m=ie(g,y,l);se([h,p,g,m],0,a,s),se([m,y,v,c],0,a,s)}return s}function oe(e,t){return le(e,0,e.length,t)}function le(e,t,a,r,n){for(var i=n||[],s=e[t],o=e[a-1],l=0,h=1,u=t+1;u<a-1;++u){var f=ne(e[u],s,o);f>l&&(l=f,h=u)}return Math.sqrt(l)>r?(le(e,t,h+1,r,i),le(e,h,a,r,i)):(i.length||i.push(s),i.push(o)),i}function he(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,a=arguments.length>2?arguments[2]:void 0,r=[],n=(e.length-1)/3,i=0;i<n;i++)se(e,3*i,t,r);return a&&a>0?le(r,0,r.length,a):r}var ue="none",fe=function(){function e(t){i(this,e),this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}return o(e,[{key:"_o",value:function(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}},{key:"_d",value:function(e,t,a){return{shape:e,sets:t||[],options:a||this.defaultOptions}}},{key:"line",value:function(e,t,a,r,n){var i=this._o(n);return this._d("line",[E(e,t,a,r,i)],i)}},{key:"rectangle",value:function(e,t,a,r,n){var i=this._o(n),s=[],o=function(e,t,a,r,n){return function(e,t){return V(e,!0,t)}([[e,t],[e+a,t],[e+a,t+r],[e,t+r]],n)}(e,t,a,r,i);if(i.fill){var l=[[e,t],[e+a,t],[e+a,t+r],[e,t+r]];"solid"===i.fillStyle?s.push(Z([l],i)):s.push(H([l],i))}return i.stroke!==ue&&s.push(o),this._d("rectangle",s,i)}},{key:"ellipse",value:function(e,t,a,r,n){var i=this._o(n),s=[],o=q(a,r,i),l=B(e,t,i,o);if(i.fill)if("solid"===i.fillStyle){var h=B(e,t,i,o).opset;h.type="fillPath",s.push(h)}else s.push(H([l.estimatedPoints],i));return i.stroke!==ue&&s.push(l.opset),this._d("ellipse",s,i)}},{key:"circle",value:function(e,t,a,r){var n=this.ellipse(e,t,a,a,r);return n.shape="circle",n}},{key:"linearPath",value:function(e,t){var a=this._o(t);return this._d("linearPath",[V(e,!1,a)],a)}},{key:"arc",value:function(e,t,a,r,n,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this._o(o),h=[],u=Y(e,t,a,r,n,i,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){var f=Object.assign({},l);f.disableMultiStroke=!0;var c=Y(e,t,a,r,n,i,!0,!1,f);c.type="fillPath",h.push(c)}else h.push(function(e,t,a,r,n,i,s){var o=e,l=t,h=Math.abs(a/2),u=Math.abs(r/2);h+=U(.01*h,s),u+=U(.01*u,s);for(var f=n,c=i;f<0;)f+=2*Math.PI,c+=2*Math.PI;c-f>2*Math.PI&&(f=0,c=2*Math.PI);for(var p=(c-f)/s.curveStepCount,d=[],v=f;v<=c;v+=p)d.push([o+h*Math.cos(v),l+u*Math.sin(v)]);return d.push([o+h*Math.cos(c),l+u*Math.sin(c)]),d.push([o,l]),H([d],s)}(e,t,a,r,n,i,l));return l.stroke!==ue&&h.push(u),this._d("arc",h,l)}},{key:"curve",value:function(e,t){var a=this._o(t),r=[],n=function(e,t){var a=K(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){var r=K(e,1.5*(1+.22*t.roughness),function(e){var t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}(t));a=a.concat(r)}return{type:"path",ops:a}}(e,a);if(a.fill&&a.fill!==ue&&e.length>=3){var i=he(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.length;if(a<3)throw new Error("A curve must have at least three points.");var r=[];if(3===a)r.push(ae(e[0]),ae(e[1]),ae(e[2]),ae(e[2]));else{var n=[];n.push(e[0],e[0]);for(var i=1;i<e.length;i++)n.push(e[i]),i===e.length-1&&n.push(e[i]);var s=[],o=1-t;r.push(ae(n[0]));for(var l=1;l+2<n.length;l++){var h=n[l];s[0]=[h[0],h[1]],s[1]=[h[0]+(o*n[l+1][0]-o*n[l-1][0])/6,h[1]+(o*n[l+1][1]-o*n[l-1][1])/6],s[2]=[n[l+1][0]+(o*n[l][0]-o*n[l+2][0])/6,n[l+1][1]+(o*n[l][1]-o*n[l+2][1])/6],s[3]=[n[l+1][0],n[l+1][1]],r.push(s[1],s[2],s[3])}}return r}(e),10,(1+a.roughness)/2);"solid"===a.fillStyle?r.push(Z([i],a)):r.push(H([i],a))}return a.stroke!==ue&&r.push(n),this._d("curve",r,a)}},{key:"polygon",value:function(e,t){var a=this._o(t),r=[],n=V(e,!0,a);return a.fill&&("solid"===a.fillStyle?r.push(Z([e],a)):r.push(H([e],a))),a.stroke!==ue&&r.push(n),this._d("polygon",r,a)}},{key:"path",value:function(e,t){var a=this._o(t),r=[];if(!e)return this._d("path",r,a);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");var n=a.fill&&"transparent"!==a.fill&&a.fill!==ue,i=a.stroke!==ue,s=!!(a.simplification&&a.simplification<1),o=function(e,t,a){var r,n=A(F(G(e))),i=[],s=[],o=[0,0],l=[],h=function(){var e;l.length>=4&&(e=s).push.apply(e,d(he(l,1))),l=[]},u=function(){h(),s.length&&(i.push(s),s=[])},f=y(n);try{for(f.s();!(r=f.n()).done;){var c=r.value,p=c.key,v=c.data;switch(p){case"M":u(),o=[v[0],v[1]],s.push(o);break;case"L":h(),s.push([v[0],v[1]]);break;case"C":if(!l.length){var g=s.length?s[s.length-1]:o;l.push([g[0],g[1]])}l.push([v[0],v[1]]),l.push([v[2],v[3]]),l.push([v[4],v[5]]);break;case"Z":h(),s.push([o[0],o[1]])}}}catch(e){f.e(e)}finally{f.f()}if(u(),!a)return i;for(var m=[],b=0,k=i;b<k.length;b++){var M=oe(k[b],a);M.length&&m.push(M)}return m}(e,0,s?4-4*a.simplification:(1+a.roughness)/2);return n&&("solid"===a.fillStyle?r.push(Z(o,a)):r.push(H(o,a))),i&&(s?o.forEach((function(e){r.push(V(e,!1,a))})):r.push(function(e,t){var a,r=A(F(G(e))),n=[],i=[0,0],s=[0,0],o=y(r);try{var l=function(){var e=a.value,r=e.key,o=e.data;switch(r){case"M":var l=1*(t.maxRandomnessOffset||0),h=t.preserveVertices;n.push({op:"move",data:o.map((function(e){return e+(h?0:U(l,t))}))}),s=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push.apply(n,d($(s[0],s[1],o[0],o[1],t))),s=[o[0],o[1]];break;case"C":var u=p(o,6),f=u[0],c=u[1],v=u[2],g=u[3],y=u[4],m=u[5];n.push.apply(n,d(function(e,t,a,r,n,i,s,o){for(var l=[],h=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3],u=[0,0],f=o.disableMultiStroke?1:2,c=o.preserveVertices,p=0;p<f;p++)0===p?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(c?0:U(h[0],o)),s[1]+(c?0:U(h[0],o))]}),u=c?[n,i]:[n+U(h[p],o),i+U(h[p],o)],l.push({op:"bcurveTo",data:[e+U(h[p],o),t+U(h[p],o),a+U(h[p],o),r+U(h[p],o),u[0],u[1]]});return l}(f,c,v,g,y,m,s,t))),s=[y,m];break;case"Z":n.push.apply(n,d($(s[0],s[1],i[0],i[1],t))),s=[i[0],i[1]]}};for(o.s();!(a=o.n()).done;)l()}catch(e){o.e(e)}finally{o.f()}return{type:"path",ops:n}}(e,a))),this._d("path",r,a)}},{key:"opsToPath",value:function(e,t){var a,r="",n=y(e.ops);try{for(n.s();!(a=n.n()).done;){var i=a.value,s="number"==typeof t&&t>=0?i.data.map((function(e){return+e.toFixed(t)})):i.data;switch(i.op){case"move":r+="M".concat(s[0]," ").concat(s[1]," ");break;case"bcurveTo":r+="C".concat(s[0]," ").concat(s[1],", ").concat(s[2]," ").concat(s[3],", ").concat(s[4]," ").concat(s[5]," ");break;case"lineTo":r+="L".concat(s[0]," ").concat(s[1]," ")}}}catch(e){n.e(e)}finally{n.f()}return r.trim()}},{key:"toPaths",value:function(e){var t,a=e.sets||[],r=e.options||this.defaultOptions,n=[],i=y(a);try{for(i.s();!(t=i.n()).done;){var s=t.value,o=null;switch(s.type){case"path":o={d:this.opsToPath(s),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:ue};break;case"fillPath":o={d:this.opsToPath(s),stroke:ue,strokeWidth:0,fill:r.fill||ue};break;case"fillSketch":o=this.fillSketch(s,r)}o&&n.push(o)}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"fillSketch",value:function(e,t){var a=t.fillWeight;return a<0&&(a=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||ue,strokeWidth:a,fill:ue}}}],[{key:"newSeed",value:function(){return Math.floor(Math.random()*Math.pow(2,31))}}]),e}(),ce=function(){function e(t,a){i(this,e),this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new fe(a)}return o(e,[{key:"draw",value:function(e){var t,a=e.sets||[],r=e.options||this.getDefaultOptions(),n=this.ctx,i=e.options.fixedDecimalPlaceDigits,s=y(a);try{for(s.s();!(t=s.n()).done;){var o=t.value;switch(o.type){case"path":n.save(),n.strokeStyle="none"===r.stroke?"transparent":r.stroke,n.lineWidth=r.strokeWidth,r.strokeLineDash&&n.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(n.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(n,o,i),n.restore();break;case"fillPath":n.save(),n.fillStyle=r.fill||"";var l="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(n,o,i,l),n.restore();break;case"fillSketch":this.fillSketch(n,o,r)}}}catch(e){s.e(e)}finally{s.f()}}},{key:"fillSketch",value:function(e,t,a){var r=a.fillWeight;r<0&&(r=a.strokeWidth/2),e.save(),a.fillLineDash&&e.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(e.lineDashOffset=a.fillLineDashOffset),e.strokeStyle=a.fill||"",e.lineWidth=r,this._drawToContext(e,t,a.fixedDecimalPlaceDigits),e.restore()}},{key:"_drawToContext",value:function(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";e.beginPath();var n,i=y(t.ops);try{for(i.s();!(n=i.n()).done;){var s=n.value,o="number"==typeof a&&a>=0?s.data.map((function(e){return+e.toFixed(a)})):s.data;switch(s.op){case"move":e.moveTo(o[0],o[1]);break;case"bcurveTo":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":e.lineTo(o[0],o[1])}}}catch(e){i.e(e)}finally{i.f()}"fillPath"===t.type?e.fill(r):e.stroke()}},{key:"generator",get:function(){return this.gen}},{key:"getDefaultOptions",value:function(){return this.gen.defaultOptions}},{key:"line",value:function(e,t,a,r,n){var i=this.gen.line(e,t,a,r,n);return this.draw(i),i}},{key:"rectangle",value:function(e,t,a,r,n){var i=this.gen.rectangle(e,t,a,r,n);return this.draw(i),i}},{key:"ellipse",value:function(e,t,a,r,n){var i=this.gen.ellipse(e,t,a,r,n);return this.draw(i),i}},{key:"circle",value:function(e,t,a,r){var n=this.gen.circle(e,t,a,r);return this.draw(n),n}},{key:"linearPath",value:function(e,t){var a=this.gen.linearPath(e,t);return this.draw(a),a}},{key:"polygon",value:function(e,t){var a=this.gen.polygon(e,t);return this.draw(a),a}},{key:"arc",value:function(e,t,a,r,n,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0,l=this.gen.arc(e,t,a,r,n,i,s,o);return this.draw(l),l}},{key:"curve",value:function(e,t){var a=this.gen.curve(e,t);return this.draw(a),a}},{key:"path",value:function(e,t){var a=this.gen.path(e,t);return this.draw(a),a}}]),e}(),pe=function(e,t){return new ce(e,t)};const de={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};let ve=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="arc",this.numberType=a.ARC_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).arc;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const f=new a.CustomPath2D,{fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth,outerRadius:v=l.outerRadius,innerRadius:g=l.innerRadius,maxRandomnessOffset:y=de.maxRandomnessOffset,roughness:m=de.roughness,bowing:b=de.bowing,curveFitting:k=de.curveFitting,curveTightness:M=de.curveTightness,curveStepCount:S=de.curveStepCount,fillStyle:x=de.fillStyle,fillWeight:O=de.fillWeight,hachureAngle:w=de.hachureAngle,hachureGap:P=de.hachureGap,simplification:D=de.simplification,dashOffset:R=de.dashOffset,dashGap:T=de.dashGap,zigzagOffset:C=de.zigzagOffset,seed:L=de.seed,fillLineDash:z=de.fillLineDash,fillLineDashOffset:W=de.fillLineDashOffset,disableMultiStroke:G=de.disableMultiStroke,disableMultiStrokeFill:F=de.disableMultiStrokeFill,preserveVertices:A=de.preserveVertices,fixedDecimalPlaceDigits:j=de.fixedDecimalPlaceDigits}=e.attribute;a.drawArcPath(e,f,h,u,v,g),o.path(f.toString(),{fill:c||void 0,stroke:p||void 0,strokeWidth:d,maxRandomnessOffset:y,roughness:m,bowing:b,curveFitting:k,curveTightness:M,curveStepCount:S,fillStyle:x,fillWeight:O,hachureAngle:w,hachureGap:P,simplification:D,dashOffset:R,dashGap:T,zigzagOffset:C,seed:L,fillLineDash:z,fillLineDashOffset:W,disableMultiStroke:G,disableMultiStrokeFill:F,preserveVertices:A,fixedDecimalPlaceDigits:j}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ve=m([r.injectable(),b(0,r.inject(a.DefaultCanvasArcRender)),k("design:paramtypes",[Object])],ve);let ge=class extends a.DefaultCanvasAreaRender{style="rough";drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c){if(c)return super.drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c);e.highPerformanceSave();const p=e.canvas.nativeCanvas,d=pe(p,{}),v=new a.CustomPath2D;a.drawAreaSegments(v,t,o,{offsetX:l,offsetY:h});const{maxRandomnessOffset:g=de.maxRandomnessOffset,roughness:y=de.roughness,bowing:m=de.bowing,curveFitting:b=de.curveFitting,curveTightness:k=de.curveTightness,curveStepCount:M=de.curveStepCount,fillStyle:S=de.fillStyle,fillWeight:x=de.fillWeight,hachureAngle:O=de.hachureAngle,hachureGap:w=de.hachureGap,simplification:P=de.simplification,dashOffset:D=de.dashOffset,dashGap:R=de.dashGap,zigzagOffset:T=de.zigzagOffset,seed:C=de.seed,fillLineDash:L=de.fillLineDash,fillLineDashOffset:z=de.fillLineDashOffset,disableMultiStroke:W=de.disableMultiStroke,disableMultiStrokeFill:G=de.disableMultiStrokeFill,preserveVertices:F=de.preserveVertices,fixedDecimalPlaceDigits:A=de.fixedDecimalPlaceDigits}=i;let{fill:j,stroke:_,lineWidth:I}=i;return Array.isArray(s)?s.forEach((e=>{j=j??e.fill,_=_??e.stroke,I=I??e.lineWidth})):(j=j??s.fill,_=_??s.stroke,I=I??s.lineWidth),d.path(v.toString(),{fill:r?j:void 0,strokeWidth:I,maxRandomnessOffset:g,roughness:y,bowing:m,curveFitting:b,curveTightness:k,curveStepCount:M,fillStyle:S,fillWeight:x,hachureAngle:O,hachureGap:w,simplification:P,dashOffset:D,dashGap:R,zigzagOffset:T,seed:C,fillLineDash:L,fillLineDashOffset:z,disableMultiStroke:W,disableMultiStrokeFill:G,preserveVertices:F,fixedDecimalPlaceDigits:A}),e.highPerformanceRestore(),!1}};ge=m([r.injectable()],ge);let ye=class{canvasRenderer;style="rough";constructor(e){this.canvasRenderer=e,this.type="circle",this.numberType=a.CIRCLE_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s,{}),l=a.getTheme(e).circle;let{x:h=l.x,y:u=l.y}=e.attribute;e.transMatrix.onlyTranslate()?i.onlyTranslate()||i.clearMatrix():(h=0,u=0,i.transformFromMatrix(e.transMatrix,!0));const{radius:f=l.radius,fill:c=l.fill,stroke:p=l.stroke,lineWidth:d=l.lineWidth}=e.attribute;o.circle(h,u,f,{fill:c||void 0,stroke:p||void 0,strokeWidth:d,fillStyle:"zigzag",roughness:.5})}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ye=m([r.injectable(),b(0,r.inject(a.DefaultCanvasCircleRender)),k("design:paramtypes",[Object])],ye);let me=class extends a.DefaultCanvasLineRender{style="rough";drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c,p,d,v){if(d||v)return super.drawSegmentItem(e,t,r,n,i,s,o,l,h,u,f,c,p,d,v);e.highPerformanceSave();const g=e.canvas.nativeCanvas,y=pe(g,{}),m=new a.CustomPath2D;a.drawSegments(e.camera?e:e.nativeContext,t,h,u,{offsetX:f,offsetY:c});const{maxRandomnessOffset:b=de.maxRandomnessOffset,roughness:k=de.roughness,bowing:M=de.bowing,curveFitting:S=de.curveFitting,curveTightness:x=de.curveTightness,curveStepCount:O=de.curveStepCount,fillStyle:w=de.fillStyle,fillWeight:P=de.fillWeight,hachureAngle:D=de.hachureAngle,hachureGap:R=de.hachureGap,simplification:T=de.simplification,dashOffset:C=de.dashOffset,dashGap:L=de.dashGap,zigzagOffset:z=de.zigzagOffset,seed:W=de.seed,fillLineDash:G=de.fillLineDash,fillLineDashOffset:F=de.fillLineDashOffset,disableMultiStroke:A=de.disableMultiStroke,disableMultiStrokeFill:j=de.disableMultiStrokeFill,preserveVertices:_=de.preserveVertices,fixedDecimalPlaceDigits:I=de.fixedDecimalPlaceDigits}=o;let{fill:E,stroke:V,lineWidth:q}=o;return Array.isArray(l)?l.forEach((e=>{E=E??e.fill,V=V??e.stroke,q=q??e.lineWidth})):(E=E??l.fill,V=V??l.stroke,q=q??l.lineWidth),y.path(m.toString(),{fill:r?E:void 0,stroke:n?V:void 0,strokeWidth:q,maxRandomnessOffset:b,roughness:k,bowing:M,curveFitting:S,curveTightness:x,curveStepCount:O,fillStyle:w,fillWeight:P,hachureAngle:D,hachureGap:R,simplification:T,dashOffset:C,dashGap:L,zigzagOffset:z,seed:W,fillLineDash:G,fillLineDashOffset:F,disableMultiStroke:A,disableMultiStrokeFill:j,preserveVertices:_,fixedDecimalPlaceDigits:I}),e.highPerformanceRestore(),!1}};me=m([r.injectable()],me);let be=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="path",this.numberType=a.PATH_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s,{});i.highPerformanceSave();const l=a.getTheme(e).path;i.transformFromMatrix(e.transMatrix,!0);const{fill:h=l.fill,stroke:u=l.stroke,lineWidth:f=l.lineWidth,path:c=l.path,maxRandomnessOffset:p=de.maxRandomnessOffset,roughness:d=de.roughness,bowing:v=de.bowing,curveFitting:g=de.curveFitting,curveTightness:y=de.curveTightness,curveStepCount:m=de.curveStepCount,fillStyle:b=de.fillStyle,fillWeight:k=de.fillWeight,hachureAngle:M=de.hachureAngle,hachureGap:S=de.hachureGap,simplification:x=de.simplification,dashOffset:O=de.dashOffset,dashGap:w=de.dashGap,zigzagOffset:P=de.zigzagOffset,seed:D=de.seed,fillLineDash:R=de.fillLineDash,fillLineDashOffset:T=de.fillLineDashOffset,disableMultiStroke:C=de.disableMultiStroke,disableMultiStrokeFill:L=de.disableMultiStrokeFill,preserveVertices:z=de.preserveVertices,fixedDecimalPlaceDigits:W=de.fixedDecimalPlaceDigits}=e.attribute;"string"==typeof c&&o.path(c,{fill:h||void 0,stroke:u||void 0,strokeWidth:f,maxRandomnessOffset:p,roughness:d,bowing:v,curveFitting:g,curveTightness:y,curveStepCount:m,fillStyle:b,fillWeight:k,hachureAngle:M,hachureGap:S,simplification:x,dashOffset:O,dashGap:w,zigzagOffset:P,seed:D,fillLineDash:R,fillLineDashOffset:T,disableMultiStroke:C,disableMultiStrokeFill:L,preserveVertices:z,fixedDecimalPlaceDigits:W}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};be=m([r.injectable(),b(0,r.inject(a.DefaultCanvasPathRender)),k("design:paramtypes",[Object])],be);let ke=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="rect",this.numberType=a.RECT_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).rect;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const{fill:f=l.fill,stroke:c=l.stroke,fillColor:p=l.fill,strokeColor:d=l.stroke,width:v=l.width,height:g=l.height,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=de.maxRandomnessOffset,roughness:b=de.roughness,bowing:k=de.bowing,curveFitting:M=de.curveFitting,curveTightness:S=de.curveTightness,curveStepCount:x=de.curveStepCount,fillStyle:O=de.fillStyle,fillWeight:w=de.fillWeight,hachureAngle:P=de.hachureAngle,hachureGap:D=de.hachureGap,simplification:R=de.simplification,dashOffset:T=de.dashOffset,dashGap:C=de.dashGap,zigzagOffset:L=de.zigzagOffset,seed:z=de.seed,fillLineDash:W=de.fillLineDash,fillLineDashOffset:G=de.fillLineDashOffset,disableMultiStroke:F=de.disableMultiStroke,disableMultiStrokeFill:A=de.disableMultiStrokeFill,preserveVertices:j=de.preserveVertices,fixedDecimalPlaceDigits:_=de.fixedDecimalPlaceDigits}=e.attribute;o.rectangle(h,u,v,g,{fill:f?p:void 0,stroke:c?d:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:O,fillWeight:w,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:T,dashGap:C,zigzagOffset:L,seed:z,fillLineDash:W,fillLineDashOffset:G,disableMultiStroke:F,disableMultiStrokeFill:A,preserveVertices:j,fixedDecimalPlaceDigits:_}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};ke=m([r.injectable(),b(0,r.inject(a.DefaultCanvasRectRender)),k("design:paramtypes",[Object])],ke);let Me=class{canvasRenderer;type;numberType;style="rough";constructor(e){this.canvasRenderer=e,this.type="symbol",this.numberType=a.SYMBOL_NUMBER_TYPE}draw(e,t,r,n){const{context:i}=r;if(!i)return;const s=i.canvas.nativeCanvas,o=pe(s);i.highPerformanceSave();const l=a.getTheme(e).symbol;let{x:h=l.x,y:u=l.y}=e.attribute;if(e.transMatrix.onlyTranslate()){const{dx:t=l.dx,dy:a=l.dy}=e.attribute;h+=t,u+=a,i.setTransformForCurrent()}else h=0,u=0,i.transformFromMatrix(e.transMatrix,!0);const f=e.getParsedPath();if(!f)return;const{fill:c=l.fill,stroke:p=l.stroke,fillColor:d=l.fill,strokeColor:v=l.stroke,size:g=l.size,lineWidth:y=l.lineWidth,maxRandomnessOffset:m=de.maxRandomnessOffset,roughness:b=de.roughness,bowing:k=de.bowing,curveFitting:M=de.curveFitting,curveTightness:S=de.curveTightness,curveStepCount:x=de.curveStepCount,fillStyle:O=de.fillStyle,fillWeight:w=de.fillWeight,hachureAngle:P=de.hachureAngle,hachureGap:D=de.hachureGap,simplification:R=de.simplification,dashOffset:T=de.dashOffset,dashGap:C=de.dashGap,zigzagOffset:L=de.zigzagOffset,seed:z=de.seed,fillLineDash:W=de.fillLineDash,fillLineDashOffset:G=de.fillLineDashOffset,disableMultiStroke:F=de.disableMultiStroke,disableMultiStrokeFill:A=de.disableMultiStrokeFill,preserveVertices:j=de.preserveVertices,fixedDecimalPlaceDigits:_=de.fixedDecimalPlaceDigits}=e.attribute,I=new a.CustomPath2D;f.draw(I,g,h,u)&&I.closePath(),o.path(I.toString(),{fill:c?d:void 0,stroke:p?v:void 0,strokeWidth:y,maxRandomnessOffset:m,roughness:b,bowing:k,curveFitting:M,curveTightness:S,curveStepCount:x,fillStyle:O,fillWeight:w,hachureAngle:P,hachureGap:D,simplification:R,dashOffset:T,dashGap:C,zigzagOffset:L,seed:z,fillLineDash:W,fillLineDashOffset:G,disableMultiStroke:F,disableMultiStrokeFill:A,preserveVertices:j,fixedDecimalPlaceDigits:_}),i.highPerformanceRestore()}drawShape(e,t,a,r,n,i,s,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(e,t,a,r,n,i,s,o)}};Me=m([r.injectable(),b(0,r.inject(a.DefaultCanvasSymbolRender)),k("design:paramtypes",[Object])],Me);const Se=new r.ContainerModule(((e,t,r,n)=>{e(ye).toSelf().inSingletonScope(),e(a.GraphicRender).to(ye),e(ke).toSelf().inSingletonScope(),e(a.GraphicRender).to(ke),e(be).toSelf().inSingletonScope(),e(a.GraphicRender).to(be),e(Me).toSelf().inSingletonScope(),e(a.GraphicRender).to(Me),e(me).toSelf().inSingletonScope(),e(a.GraphicRender).to(me),e(ge).toSelf().inSingletonScope(),e(a.GraphicRender).to(ge),e(ve).toSelf().inSingletonScope(),e(a.GraphicRender).to(ve)}));e.roughModule=Se}));

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

import type { Container } from 'inversify';
export default function load(container: Container): void;

@@ -1,6 +0,1 @@

import nodeModule from "./node/modules";
export default function load(container) {
container.load(nodeModule);
}
//# sourceMappingURL=canvas-module.js.map
//# sourceMappingURL=canvas-module.js.map

@@ -1,47 +0,1 @@

import type { Canvas } from 'canvas';
import type { EnvType, CanvasConfigType, ICanvas, IContext2d } from '@visactor/vrender';
export declare class NodeCanvas implements ICanvas {
static env: EnvType;
private _id;
private _displayWidth;
private _displayHeight;
private _pixelWidth;
private _pixelHeight;
private _nativeCanvas;
private _context;
private _visiable;
private controled;
private _dpr;
get id(): number | string;
get x(): number;
get y(): number;
get nativeCanvas(): Canvas;
get width(): number;
set width(width: number);
get displayWidth(): number;
get displayHeight(): number;
get height(): number;
set height(height: number);
getContext(str?: string): IContext2d;
get visiable(): boolean;
set visiable(visiable: boolean);
get dpr(): number;
set dpr(dpr: number);
constructor(params: CanvasConfigType);
applyPosition(): void;
getNativeCanvas(): Canvas;
resetStyle(params: Partial<CanvasConfigType>): void;
hide(): void;
show(): void;
resize(width: number, height: number): void;
toDataURL(): string;
toDataURL(mimeType: 'image/png'): string;
toDataURL(mimeType: 'image/jpeg', quality: number): string;
readPixels(x: number, y: number, w: number, h: number): ImageData | Promise<ImageData>;
convertToBlob(options?: {
type?: string | undefined;
quality?: number | undefined;
} | undefined): Promise<Blob>;
transferToImageBitmap(): ImageBitmap;
release(...params: any): void;
}

@@ -1,104 +0,1 @@

var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
}, __metadata = this && this.__metadata || function(k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
};
import { injectable } from "inversify";
import { NodeContext2d } from "./context";
const DefaultConfig = {
WIDTH: 500,
HEIGHT: 500,
DPR: 1
};
let NodeCanvas = class {
get id() {
return this._id;
}
get x() {
return 0;
}
get y() {
return 0;
}
get nativeCanvas() {
return this._nativeCanvas;
}
get width() {
return this._pixelWidth;
}
set width(width) {
this._pixelWidth = width, this._displayWidth = width / (this._dpr || 1);
}
get displayWidth() {
return this._pixelWidth / this._dpr;
}
get displayHeight() {
return this._pixelHeight / this._dpr;
}
get height() {
return this._pixelHeight;
}
set height(height) {
this._pixelHeight = height, this._displayHeight = height / (this._dpr || 1);
}
getContext(str) {
return this._context;
}
get visiable() {
return this._visiable;
}
set visiable(visiable) {
this._visiable = visiable, visiable ? this.show() : this.hide();
}
get dpr() {
return this._dpr;
}
set dpr(dpr) {
this._dpr = dpr, this.resize(this.width, this.height);
}
constructor(params) {
const {nativeCanvas: nativeCanvas, width: width = DefaultConfig.WIDTH, height: height = DefaultConfig.HEIGHT, canvasControled: canvasControled = !0, dpr: dpr = DefaultConfig.DPR} = params;
this._visiable = !1 !== params.visiable, this.controled = canvasControled, this._pixelWidth = width * dpr,
this._pixelHeight = height * dpr, this._displayWidth = width, this._displayHeight = height,
this._nativeCanvas = nativeCanvas, this._context = new NodeContext2d(this, params.dpr),
this._id = nativeCanvas.id, this._dpr = dpr;
}
applyPosition() {}
getNativeCanvas() {
return this._nativeCanvas;
}
resetStyle(params) {}
hide() {}
show() {}
resize(width, height) {
this._pixelWidth = width * this._dpr, this._pixelHeight = height * this._dpr, this._displayWidth = width,
this._displayHeight = height, this._nativeCanvas && (this._nativeCanvas.width = this._pixelWidth,
this._nativeCanvas.height = this._pixelHeight);
}
toDataURL(mimeType, quality) {
return "";
}
readPixels(x, y, w, h) {
return this._context.getImageData(x, y, w, h);
}
convertToBlob(options) {
throw new Error("暂未实现");
}
transferToImageBitmap() {
throw new Error("暂未实现");
}
release(...params) {
throw new Error("暂不支持release");
}
};
NodeCanvas.env = "node", NodeCanvas = __decorate([ injectable(), __metadata("design:paramtypes", [ Object ]) ], NodeCanvas);
export { NodeCanvas };
//# sourceMappingURL=canvas.js.map
//# sourceMappingURL=canvas.js.map

@@ -1,7 +0,1 @@

import type { EnvType, ICanvas, IContext2d } from '@visactor/vrender';
import { BrowserContext2d } from '@visactor/vrender';
export declare class NodeContext2d extends BrowserContext2d implements IContext2d {
static env: EnvType;
constructor(canvas: ICanvas, dpr: number);
release(...params: any): void;
}

@@ -1,31 +0,1 @@

var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
}, __metadata = this && this.__metadata || function(k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
};
import { Matrix } from "@visactor/vutils";
import { injectable } from "inversify";
import { BrowserContext2d } from "@visactor/vrender";
const initMatrix = new Matrix(1, 0, 0, 1, 0, 0);
let NodeContext2d = class extends BrowserContext2d {
constructor(canvas, dpr) {
super(canvas, dpr);
const context = canvas.nativeCanvas.getContext("2d");
if (!context) throw new Error("发生错误,获取2d上下文失败");
this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0),
this.stack = [], this.dpr = null != dpr ? dpr : 1;
}
release(...params) {}
};
NodeContext2d.env = "node", NodeContext2d = __decorate([ injectable(), __metadata("design:paramtypes", [ Object, Number ]) ], NodeContext2d);
export { NodeContext2d };
//# sourceMappingURL=context.js.map
//# sourceMappingURL=context.js.map

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

export * from './canvas';
export * from './context';

@@ -1,4 +0,1 @@

export * from "./canvas";
export * from "./context";
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map

@@ -1,3 +0,1 @@

import { ContainerModule } from 'inversify';
declare const _default: ContainerModule;
export default _default;

@@ -1,13 +0,1 @@

import { ContainerModule } from "inversify";
import { CanvasFactory, Context2dFactory } from "@visactor/vrender";
import { NodeCanvas } from "./canvas";
import { NodeContext2d } from "./context";
export default new ContainerModule((bind => {
bind(CanvasFactory).toDynamicValue((() => params => new NodeCanvas(params))).whenTargetNamed(NodeContext2d.env),
bind(Context2dFactory).toDynamicValue((() => params => new NodeContext2d(params, params.dpr))).whenTargetNamed(NodeContext2d.env);
}));
//# sourceMappingURL=modules.js.map
//# sourceMappingURL=modules.js.map

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

export {};

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

export { };
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map

@@ -1,3 +0,1 @@

import { ContainerModule } from 'inversify';
declare const _default: ContainerModule;
export default _default;

@@ -1,10 +0,1 @@

import { ContainerModule } from "inversify";
import { EnvContribution } from "@visactor/vrender";
import { NodeEnvContribution } from "./node-contribution";
export default new ContainerModule((bind => {
bind(NodeEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(NodeEnvContribution);
}));
//# sourceMappingURL=module.js.map
//# sourceMappingURL=module.js.map

@@ -1,47 +0,1 @@

import type { createCanvas, createImageData, loadImage, Canvas } from 'canvas';
import * as NodePkg from 'canvas';
import type { EnvType, IEnvContribution, IGlobal, ICreateCanvasParams } from '@visactor/vrender';
import { BaseEnvContribution } from '@visactor/vrender';
type NodePkg = {
createCanvas: typeof createCanvas;
createImageData: typeof createImageData;
loadImage: typeof loadImage;
};
export declare class NodeEnvContribution extends BaseEnvContribution implements IEnvContribution {
type: EnvType;
pkg: NodePkg;
_lastTime: number;
supportEvent: boolean;
configure(service: IGlobal, pkg?: NodePkg): void;
loadJson(url: string): Promise<{
loadState: 'success' | 'fail';
data: Record<string, unknown> | null;
}>;
loadArrayBuffer(url: string): Promise<{
loadState: 'success' | 'fail';
data: ArrayBuffer | null;
}>;
loadImage(url: string): Promise<{
loadState: 'success' | 'fail';
data: HTMLImageElement | null;
}>;
loadSvg(svgStr: string): Promise<{
loadState: 'success' | 'fail';
data: HTMLImageElement | null;
}>;
createCanvas(params: any): Canvas;
releaseCanvas(canvas: Canvas | any): void;
getDevicePixelRatio(): number;
getRequestAnimationFrame(): (callback: FrameRequestCallback) => number;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions | undefined): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
getElementById(str: string): HTMLElement | null;
getRootElement(): HTMLElement | null;
dispatchEvent(event: any): boolean;
getCancelAnimationFrame(): (h: number) => void;
release(...params: any): void;
createOffscreenCanvas(params: ICreateCanvasParams): void;
}
export {};

@@ -1,94 +0,1 @@

var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { injectable } from "inversify";
import * as NodePkg from "canvas";
import { Resvg } from "@resvg/resvg-js";
import { BaseEnvContribution } from "@visactor/vrender";
import fetch from "node-fetch";
let last = 0;
function nodeRequestAnimationFrame(callback) {
const now = Date.now(), timeLeft = Math.max(0, 16 - (now - last)), id = setTimeout((function() {
callback(now + timeLeft);
}), timeLeft);
return last = now + timeLeft, id;
}
let NodeEnvContribution = class extends BaseEnvContribution {
constructor() {
super(...arguments), this.type = "node", this._lastTime = 0, this.supportEvent = !1;
}
configure(service, pkg = NodePkg) {
service.env === this.type && (service.setActiveEnvContribution(this), this.pkg = pkg);
}
loadJson(url) {
const jsonPromise = fetch(url).then((data => data.json()));
return jsonPromise.then((json => ({
data: json,
state: "success"
}))).catch((() => ({
data: null,
state: "fail"
}))), jsonPromise;
}
loadArrayBuffer(url) {
return fetch(url).then((data => data.arrayBuffer())).then((arrayBuffer => ({
data: arrayBuffer,
loadState: "success"
}))).catch((() => ({
data: null,
loadState: "fail"
})));
}
loadImage(url) {
const {loadImage: loadImage} = this.pkg;
return loadImage ? loadImage(url).then((image => ({
loadState: image ? "success" : "fail",
data: image
}))).catch((() => ({
loadState: "fail",
data: null
}))) : Promise.reject(new Error("node-canvas loadImage could not be found!"));
}
loadSvg(svgStr) {
if (!Resvg) return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));
const pngData = new Resvg(svgStr).render().asPng();
return this.loadImage(pngData);
}
createCanvas(params) {
return this.pkg.createCanvas(params.width, params.height);
}
releaseCanvas(canvas) {}
getDevicePixelRatio() {
return 0;
}
getRequestAnimationFrame() {
return nodeRequestAnimationFrame;
}
addEventListener(type, listener, options) {}
removeEventListener(type, listener, options) {}
getElementById(str) {
return null;
}
getRootElement() {
return null;
}
dispatchEvent(event) {}
getCancelAnimationFrame() {}
release(...params) {}
createOffscreenCanvas(params) {}
};
NodeEnvContribution = __decorate([ injectable() ], NodeEnvContribution);
export { NodeEnvContribution };
//# sourceMappingURL=node-contribution.js.map
//# sourceMappingURL=node-contribution.js.map
import 'reflect-metadata';
import _canvasModuleLoader from './canvas/contributions/canvas-module';
export declare const roughModule: import("inversify").ContainerModule;
export declare const canvasModuleLoader: typeof _canvasModuleLoader;
export { nodeLoader } from './node-bind';

@@ -5,8 +5,2 @@ import "reflect-metadata";

import _canvasModuleLoader from "./canvas/contributions/canvas-module";
export const roughModule = _roughModule;
export const canvasModuleLoader = _canvasModuleLoader;
export { nodeLoader } from "./node-bind";
export const roughModule = _roughModule;
import 'reflect-metadata';
import _canvasModuleLoader from './canvas/contributions/canvas-module';
export declare const roughModule: import("inversify").ContainerModule;
export declare const canvasModuleLoader: typeof _canvasModuleLoader;

@@ -5,7 +5,3 @@ import "reflect-metadata";

import _canvasModuleLoader from "./canvas/contributions/canvas-module";
export const roughModule = _roughModule;
export const canvasModuleLoader = _canvasModuleLoader;
//# sourceMappingURL=index.js.map

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

import type { Container } from 'inversify';
export declare function nodeLoader(container: Container): void;

@@ -1,10 +0,1 @@

import nodeEnv from "./env/contributions/module";
import nodeWindow from "./window/contributions/modules";
import nodeCanvas from "./canvas/contributions/node/modules";
export function nodeLoader(container) {
container.load(nodeEnv), container.load(nodeWindow), container.load(nodeCanvas);
}
//# sourceMappingURL=node-bind.js.map
//# sourceMappingURL=node-bind.js.map

@@ -1,3 +0,1 @@

import { ContainerModule } from 'inversify';
declare const _default: ContainerModule;
export default _default;

@@ -1,10 +0,1 @@

import { ContainerModule } from "inversify";
import { WindowHandlerContribution } from "@visactor/vrender";
import { NodeWindowHandlerContribution } from "./node-contribution";
export default new ContainerModule((bind => {
bind(NodeWindowHandlerContribution).toSelf().inSingletonScope(), bind(WindowHandlerContribution).toService(NodeWindowHandlerContribution);
}));
//# sourceMappingURL=modules.js.map
//# sourceMappingURL=modules.js.map

@@ -1,38 +0,1 @@

import type { EnvType, IGlobal, IWindowHandlerContribution, IWindowParams, IContext2d, ICanvas, IDomRectLike } from '@visactor/vrender';
import { BaseWindowHandlerContribution } from '@visactor/vrender';
import type { IBoundsLike } from '@visactor/vutils';
export declare class NodeWindowHandlerContribution extends BaseWindowHandlerContribution implements IWindowHandlerContribution {
private readonly global;
type: EnvType;
canvas: ICanvas;
get container(): HTMLElement | null;
constructor(global: IGlobal);
getTitle(): string;
getWH(): {
width: number;
height: number;
};
getXY(): {
x: number;
y: number;
};
createWindow(params: IWindowParams): void;
private createWindowByConfig;
private createWindowByCanvas;
releaseWindow(): void;
resizeWindow(width: number, height: number): void;
setDpr(dpr: number): void;
getContext(): IContext2d;
getNativeHandler(): ICanvas;
getDpr(): number;
getImageBuffer(type?: string): any;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
dispatchEvent(event: any): boolean;
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
getStyle(): CSSStyleDeclaration | Record<string, any>;
setStyle(style: CSSStyleDeclaration | Record<string, any>): void;
getBoundingClientRect(): IDomRectLike;
clearViewBox(vb: IBoundsLike, color?: string): void;
}

@@ -1,107 +0,1 @@

var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r;
}, __metadata = this && this.__metadata || function(k, v) {
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
}, __param = this && this.__param || function(paramIndex, decorator) {
return function(target, key) {
decorator(target, key, paramIndex);
};
};
import { inject, injectable } from "inversify";
import { Generator, Global, BaseWindowHandlerContribution } from "@visactor/vrender";
import { NodeCanvas } from "../../canvas/contributions/node/canvas";
let NodeWindowHandlerContribution = class extends BaseWindowHandlerContribution {
get container() {
return null;
}
constructor(global) {
super(), this.global = global, this.type = "node";
}
getTitle() {
return "";
}
getWH() {
return {
width: this.canvas.displayWidth,
height: this.canvas.displayHeight
};
}
getXY() {
return {
x: 0,
y: 0
};
}
createWindow(params) {
params.canvas ? this.createWindowByCanvas(params) : this.createWindowByConfig(params);
}
createWindowByConfig(params) {
const nativeCanvas = this.global.createCanvas({
width: params.width,
height: params.height
}), options = {
width: params.width,
height: params.height,
dpr: params.dpr,
nativeCanvas: nativeCanvas,
id: Generator.GenAutoIncrementId().toString(),
canvasControled: !0
};
this.canvas = new NodeCanvas(options);
}
createWindowByCanvas(params) {
const canvas = params.canvas;
let width = params.width, height = params.height;
null != width && null != height && params.canvasControled || (width = canvas.width,
height = canvas.height), this.canvas = new NodeCanvas({
width: width,
height: height,
dpr: 1,
nativeCanvas: canvas,
canvasControled: params.canvasControled
});
}
releaseWindow() {
this.canvas.release();
}
resizeWindow(width, height) {
this.canvas.resize(width, height);
}
setDpr(dpr) {
this.canvas.dpr = dpr;
}
getContext() {
return this.canvas.getContext();
}
getNativeHandler() {
return this.canvas;
}
getDpr() {
return this.canvas.dpr;
}
getImageBuffer(type = "image/png") {
return this.canvas.nativeCanvas.toBuffer(type);
}
addEventListener(type, listener, options) {}
dispatchEvent(event) {
return !0;
}
removeEventListener(type, listener, options) {}
getStyle() {}
setStyle(style) {}
getBoundingClientRect() {
return null;
}
clearViewBox(vb, color) {}
};
NodeWindowHandlerContribution = __decorate([ injectable(), __param(0, inject(Global)), __metadata("design:paramtypes", [ Object ]) ], NodeWindowHandlerContribution);
export { NodeWindowHandlerContribution };
//# sourceMappingURL=node-contribution.js.map
//# sourceMappingURL=node-contribution.js.map
{
"name": "@visactor/vrender-kits",
"version": "0.10.3",
"version": "0.11.0-alpha.1",
"description": "",

@@ -15,4 +15,4 @@ "sideEffects": false,

"dependencies": {
"@visactor/vrender": "0.10.3",
"@visactor/vutils": "0.9.0-alpha.2",
"@visactor/vrender": "0.11.0-alpha.1",
"@visactor/vutils": "~0.9.2-alpha.5",
"@resvg/resvg-js": "2.4.1",

@@ -19,0 +19,0 @@ "canvas": "2.11.2",

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

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

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

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

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

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