@visactor/vtable-plugins 1.18.0 → 1.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vtable-plugins.js +25 -21
- package/dist/vtable-plugins.min.js +1 -1
- package/package.json +6 -6
package/dist/vtable-plugins.js
CHANGED
|
@@ -2316,6 +2316,11 @@
|
|
|
2316
2316
|
return this.context.tryUpdateLength();
|
|
2317
2317
|
}
|
|
2318
2318
|
};
|
|
2319
|
+
class StepClosed extends Step$1 {
|
|
2320
|
+
lineEnd() {
|
|
2321
|
+
this.context.closePath();
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2319
2324
|
function genStepSegments(points, t) {
|
|
2320
2325
|
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2321
2326
|
const {
|
|
@@ -2329,6 +2334,16 @@
|
|
|
2329
2334
|
function genStepTypeSegments(path, points) {
|
|
2330
2335
|
return genCurveSegments(path, points);
|
|
2331
2336
|
}
|
|
2337
|
+
function genStepClosedSegments(points, t) {
|
|
2338
|
+
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2339
|
+
const {
|
|
2340
|
+
direction: direction,
|
|
2341
|
+
startPoint: startPoint
|
|
2342
|
+
} = params;
|
|
2343
|
+
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
2344
|
+
const segContext = new SegContext("step", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? Direction.ROW : Direction.COLUMN);
|
|
2345
|
+
return genStepTypeSegments(new StepClosed(segContext, t, startPoint), points), segContext;
|
|
2346
|
+
}
|
|
2332
2347
|
|
|
2333
2348
|
class LinearClosed extends Linear {
|
|
2334
2349
|
lineEnd() {
|
|
@@ -2558,6 +2573,8 @@
|
|
|
2558
2573
|
return genMonotoneYSegments(points, params);
|
|
2559
2574
|
case "step":
|
|
2560
2575
|
return genStepSegments(points, .5, params);
|
|
2576
|
+
case "stepClosed":
|
|
2577
|
+
return genStepClosedSegments(points, .5, params);
|
|
2561
2578
|
case "stepBefore":
|
|
2562
2579
|
return genStepSegments(points, 0, params);
|
|
2563
2580
|
case "stepAfter":
|
|
@@ -4987,7 +5004,7 @@
|
|
|
4987
5004
|
}
|
|
4988
5005
|
var rect = new RectSymbol();
|
|
4989
5006
|
|
|
4990
|
-
const tempBounds
|
|
5007
|
+
const tempBounds = new AABBBounds();
|
|
4991
5008
|
class CustomSymbolClass {
|
|
4992
5009
|
constructor(type, path) {
|
|
4993
5010
|
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
@@ -5016,7 +5033,7 @@
|
|
|
5016
5033
|
let {
|
|
5017
5034
|
path: path
|
|
5018
5035
|
} = _ref;
|
|
5019
|
-
tempBounds
|
|
5036
|
+
tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size, tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
|
|
5020
5037
|
});
|
|
5021
5038
|
}
|
|
5022
5039
|
this.path.bounds && (bounds.x1 = this.path.bounds.x1 * size, bounds.y1 = this.path.bounds.y1 * size, bounds.x2 = this.path.bounds.x2 * size, bounds.y2 = this.path.bounds.y2 * size);
|
|
@@ -5299,8 +5316,8 @@
|
|
|
5299
5316
|
const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);
|
|
5300
5317
|
|
|
5301
5318
|
const _tempBounds = new AABBBounds(),
|
|
5302
|
-
tempMatrix = new Matrix()
|
|
5303
|
-
|
|
5319
|
+
tempMatrix = new Matrix();
|
|
5320
|
+
new AABBBounds();
|
|
5304
5321
|
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
5305
5322
|
const tempConstantXYKey = ["x", "y"],
|
|
5306
5323
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
@@ -5819,25 +5836,12 @@
|
|
|
5819
5836
|
needUpdateLayout() {
|
|
5820
5837
|
return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
|
|
5821
5838
|
}
|
|
5822
|
-
getAnchor(anchor, params) {
|
|
5839
|
+
getAnchor(anchor, params, resetScale) {
|
|
5823
5840
|
const _anchor = [0, 0],
|
|
5824
5841
|
getBounds = () => {
|
|
5825
5842
|
if (params.b) return params.b;
|
|
5826
|
-
const
|
|
5827
|
-
|
|
5828
|
-
scaleY: scaleY,
|
|
5829
|
-
angle: angle,
|
|
5830
|
-
scaleCenter: scaleCenter
|
|
5831
|
-
} = this.attribute;
|
|
5832
|
-
return tempBounds.copy(this._AABBBounds), this.setAttributes({
|
|
5833
|
-
angle: 0,
|
|
5834
|
-
scaleCenter: null
|
|
5835
|
-
}), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
|
|
5836
|
-
scaleX: scaleX,
|
|
5837
|
-
scaleY: scaleY,
|
|
5838
|
-
angle: angle,
|
|
5839
|
-
scaleCenter: scaleCenter
|
|
5840
|
-
}), params.b;
|
|
5843
|
+
const graphic = this.clone();
|
|
5844
|
+
return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1, graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
|
|
5841
5845
|
};
|
|
5842
5846
|
if ("string" == typeof anchor[0]) {
|
|
5843
5847
|
const ratio = parseFloat(anchor[0]) / 100,
|
|
@@ -5866,7 +5870,7 @@
|
|
|
5866
5870
|
const params = {};
|
|
5867
5871
|
if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
|
|
5868
5872
|
const m = this._transMatrix;
|
|
5869
|
-
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
5873
|
+
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
5870
5874
|
x: _anchor[0],
|
|
5871
5875
|
y: _anchor[1]
|
|
5872
5876
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vtable")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VTable=t.VTable||{},t.VTable.plugins={}),t.VTable)}(this,(function(t,e){"use strict";function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var s,n=i(e);function o(t){return Math.floor(t)===t}class r{static GenAutoIncrementId(){return r.auto_increment_id++}}function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}r.auto_increment_id=0,function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(s||(s={}));var h={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,s,o,r){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new n(s,o||t,r),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function r(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,o=s.length,r=new Array(o);n<o;n++)r[n]=s[n].fn;return r},a.prototype.listenerCount=function(t){var e=i?i+t:t,s=this._events[e];return s?s.fn?1:s.length:0},a.prototype.emit=function(t,e,s,n,o,r){var a=i?i+t:t;if(!this._events[a])return!1;var h,l,d=this._events[a],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(t,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,e),!0;case 3:return d.fn.call(d.context,e,s),!0;case 4:return d.fn.call(d.context,e,s,n),!0;case 5:return d.fn.call(d.context,e,s,n,o),!0;case 6:return d.fn.call(d.context,e,s,n,o,r),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];d.fn.apply(d.context,h)}else{var c,p=d.length;for(l=0;l<p;l++)switch(d[l].once&&this.removeListener(t,d[l].fn,void 0,!0),u){case 1:d[l].fn.call(d[l].context);break;case 2:d[l].fn.call(d[l].context,e);break;case 3:d[l].fn.call(d[l].context,e,s);break;case 4:d[l].fn.call(d[l].context,e,s,n);break;default:if(!h)for(c=1,h=new Array(u-1);c<u;c++)h[c-1]=arguments[c];d[l].fn.apply(d[l].context,h)}}return!0},a.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,s,n){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return r(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||n&&!a.once||s&&a.context!==s||r(this,o);else{for(var h=0,l=[],d=a.length;h<d;h++)(a[h].fn!==e||n&&!a[h].once||s&&a[h].context!==s)&&l.push(a[h]);l.length?this._events[o]=1===l.length?l[0]:l:r(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&r(this,e)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(h);var l=a(h.exports);var d=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var u=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||d(t,"Boolean")};var c=t=>"function"==typeof t;var p=t=>null==t;var g=t=>null!=t;var f=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var m=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||d(t,"String")};var _=t=>Array.isArray?Array.isArray(t):d(t,"Array");var y=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||d(t,"Number")};var b=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var A=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);const w=Object.prototype.hasOwnProperty;var v=(t,e)=>null!=t&&w.call(t,e);const x="undefined"!=typeof console;function C(t,e,i){const s=[e].concat([].slice.call(i));x&&console[t].apply(console,s)}var T;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(T||(T={}));class E{static getInstance(t,e){return E._instance&&y(t)?E._instance.level(t):E._instance||(E._instance=new E(t,e)),E._instance}static setInstance(t){return E._instance=t}static setInstanceLevel(t){E._instance?E._instance.level(t):E._instance=new E(t)}static clearInstance(){E._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=T.Info}canLogDebug(){return this._level>=T.Debug}canLogError(){return this._level>=T.Error}canLogWarn(){return this._level>=T.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];return this._level>=T.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):C(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=T.Warn&&C(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=T.Info&&C(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=T.Debug&&C(this._method||"log","DEBUG",e),this}}E._instance=null;var L=function(t,e,i){return t<e?e:t>i?i:t};const S=Math.PI,P=S/2,M=2*S,O=2*Math.PI,R=Math.abs,B=Math.atan2,I=Math.cos,D=Math.max,F=Math.min,N=Math.sin,k=Math.sqrt,U=Math.pow;class H{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=s}clone(){return new H(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return y(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return y(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class G{static distancePP(t,e){return k(U(t.x-e.x,2)+U(t.y-e.y,2))}static distanceNN(t,e,i,s){return k(U(t-i,2)+U(e-s,2))}static distancePN(t,e,i){return k(U(e-t.x,2)+U(i-t.y,2))}static pointAtPP(t,e,i){return new H((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function z(t){return t*(Math.PI/180)}var j;function Y(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function X(t,e){let{x:i,y:s}=t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-n.x)*Math.cos(e)-(s-n.y)*Math.sin(e)+n.x,y:(i-n.x)*Math.sin(e)+(s-n.y)*Math.cos(e)+n.y}}function $(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function V(t,e){const i=e?z(t.angle):t.angle,s=$(t);return[X({x:t.x1,y:t.y1},i,s),X({x:t.x2,y:t.y1},i,s),X({x:t.x2,y:t.y2},i,s),X({x:t.x1,y:t.y2},i,s)]}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(j||(j={}));class W{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new W(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=s,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),s<e?(this.y2=e,this.y1=s):(this.y1=e,this.y2=s),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return _(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const s=this.rotatedPoints(t,e,i);return this.clear().add(s[0],s[1]).add(s[2],s[3]).add(s[4],s[5]).add(s[6],s[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const n=this.scalePoints(t,e,i,s);return this.clear().add(n[0],n[1]).add(n[2],n[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return function(t,e,i){const{x1:s,y1:n,x2:o,y2:r}=e;i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f)):(t.clear(),t.add(i.a*s+i.c*n+i.e,i.b*s+i.d*n+i.f),t.add(i.a*o+i.c*n+i.e,i.b*o+i.d*n+i.f),t.add(i.a*o+i.c*r+i.e,i.b*o+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f))}(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:s,y1:n,x2:o,y2:r}=this,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,d=i-e*h-i*a;return[a*s-h*n+l,h*s+a*n+d,a*s-h*r+l,h*s+a*r+d,a*o-h*n+l,h*o+a*n+d,a*o-h*r+l,h*o+a*r+d]}scalePoints(t,e,i,s){const{x1:n,y1:o,x2:r,y2:a}=this;return[t*n+(1-t)*i,e*o+(1-e)*s,t*r+(1-t)*i,e*a+(1-e)*s]}}class q extends W{}class K extends W{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var i;super(t),t&&(this.angle=null!==(i=t.angle)&&void 0!==i?i:e)}intersects(t){return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=V(t,i),n=V(e,i),o=(t,e)=>[e.x-t.x,e.y-t.y],r=o($(t),$(e)),a=o(s[0],s[1]),h=o(s[1],s[2]),l=o(n[0],n[1]),d=o(n[1],n[2]),u=i?z(t.angle):t.angle;let c=i?z(90-t.angle):t.angle+P;const p=i?z(e.angle):e.angle;let g=i?z(90-e.angle):e.angle+P;c>O&&(c-=O),g>O&&(g-=O);const f=(t,e,i,s)=>{const n=[Math.cos(e),Math.sin(e)];return t+(Y(n,i)+Y(n,s))/2>Y(n,r)};return f((t.x2-t.x1)/2,u,l,d)&&f((t.y2-t.y1)/2,c,l,d)&&f((e.x2-e.x1)/2,p,a,h)&&f((e.y2-e.y1)/2,g,a,h)}(this,t)}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,i,s),this.angle=n,this}clone(){return new K(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[X({x:this.x1,y:this.y1},this.angle,t),X({x:this.x2,y:this.y1},this.angle,t),X({x:this.x1,y:this.y2},this.angle,t),X({x:this.x2,y:this.y2},this.angle,t)]}}class Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=o}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,s,n,o){return!(this.e!==n||this.f!==o||this.a!==t||this.d!==s||this.b!==e||this.c!==i)}setValue(t,e,i,s,n,o){return this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=o,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,s=this.d,n=this.e,o=this.f,r=new Z,a=t*s-e*i;return r.a=s/a,r.b=-e/a,r.c=-i/a,r.d=t/a,r.e=(i*o-s*n)/a,r.f=-(t*o-e*n)/a,r}rotate(t){const e=Math.cos(t),i=Math.sin(t),s=this.a*e+this.c*i,n=this.b*e+this.d*i,o=this.a*-i+this.c*e,r=this.b*-i+this.d*e;return this.a=s,this.b=n,this.c=o,this.d=r,this}rotateByCenter(t,e,i){const s=Math.cos(t),n=Math.sin(t),o=(1-s)*e+n*i,r=(1-s)*i-n*e,a=s*this.a-n*this.b,h=n*this.a+s*this.b,l=s*this.c-n*this.d,d=n*this.c+s*this.d,u=s*this.e-n*this.f+o,c=n*this.e+s*this.f+r;return this.a=a,this.b=h,this.c=l,this.d=d,this.e=u,this.f=c,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,s,n,o){return this.multiply(t,e,i,s,n,o),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:s,e:n,f:o}=this;return this.a=e,this.b=t,this.c=s,this.d=i,this.e=o,this.f=n,this}multiply(t,e,i,s,n,o){const r=this.a,a=this.b,h=this.c,l=this.d,d=r*t+h*e,u=a*t+l*e,c=r*i+h*s,p=a*i+l*s,g=r*n+h*o+this.e,f=a*n+l*o+this.f;return this.a=d,this.b=u,this.c=c,this.d=p,this.e=g,this.f=f,this}interpolate(t,e){const i=new Z;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:s,c:n,d:o,e:r,f:a}=this,h=i*o-s*n,l=o/h,d=-s/h,u=-n/h,c=i/h,p=(n*a-o*r)/h,g=-(i*a-s*r)/h,{x:f,y:m}=t;e.x=f*l+m*u+p,e.y=f*d+m*c+g}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Z(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,s=this.d,n=t*s-e*i,o={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const r=Math.sqrt(t*t+e*e);o.rotateDeg=e>0?Math.acos(t/r):-Math.acos(t/r),o.scaleX=r,o.scaleY=n/r,o.skewX=(t*i+e*s)/n,o.skewY=0}else if(0!==i||0!==s){const r=Math.sqrt(i*i+s*s);o.rotateDeg=Math.PI/2-(s>0?Math.acos(-i/r):-Math.acos(i/r)),o.scaleX=n/r,o.scaleY=r,o.skewX=0,o.skewY=(t*i+e*s)/n}return o.rotateDeg=180*o.rotateDeg/Math.PI,o}}function Q(t,e,i){e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,n=s*(1-Math.abs(t/60%2-1)),o=i-s/2;let r=0,a=0,h=0;return 0<=t&&t<60?(r=s,a=n,h=0):60<=t&&t<120?(r=n,a=s,h=0):120<=t&&t<180?(r=0,a=s,h=n):180<=t&&t<240?(r=0,a=n,h=s):240<=t&&t<300?(r=n,a=0,h=s):300<=t&&t<360&&(r=s,a=0,h=n),r=Math.round(255*(r+o)),a=Math.round(255*(a+o)),h=Math.round(255*(h+o)),{r:r,g:a,b:h}}function J(t,e,i){t/=255,e/=255,i/=255;const s=Math.min(t,e,i),n=Math.max(t,e,i),o=n-s;let r=0,a=0,h=0;return r=0===o?0:n===t?(e-i)/o%6:n===e?(i-t)/o+2:(t-e)/o+4,r=Math.round(60*r),r<0&&(r+=360),h=(n+s)/2,a=0===o?0:o/(1-Math.abs(2*h-1)),a=+(100*a).toFixed(1),h=+(100*h).toFixed(1),{h:r,s:a,l:h}}const tt=/^#([0-9a-f]{3,8})$/,et={transparent:4294967040},it={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function st(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function nt(t){return y(t)?new lt(t>>16,t>>8&255,255&t,1):_(t)?new lt(t[0],t[1],t[2]):new lt(255,255,255)}function ot(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function rt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const at=(t,e)=>{const i=tt.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new lt((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?nt(t):8===e?new lt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class ht{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new ht(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new ht(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof ht?t:new ht(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3();case"wcag":return i.getLuminanceWCAG()}}static parseColorString(t){if(g(et[t]))return function(t){return y(t)?new lt(t>>>24,t>>>16&255,t>>>8&255,255&t):_(t)?new lt(t[0],t[1],t[2],t[3]):new lt(255,255,255,1)}(et[t]);if(g(it[t]))return nt(it[t]);const e=`${t}`.trim().toLowerCase(),i=at(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new lt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Q(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new lt(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=ht.parseColorString(t);this.color=e||new lt(255,255,255)}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t))),this}add(t){const{r:e,g:i,b:s}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,s+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const s=this.color.opacity,n=J(this.color.r,this.color.g,this.color.b),o=Q(p(t)?n.h:L(t,0,360),p(e)?n.s:e>=0&&e<=1?100*e:e,p(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new lt(o.r,o.g,o.b,s),this}setRGB(t,e,i){return!p(t)&&(this.color.r=t),!p(e)&&(this.color.g=e),!p(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=at(e,!0);return null!=i?i:this}setColorName(t){const e=it[t.toLowerCase()];return void 0!==e&&this.setHex(e),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,i=this.color.b/255;let s,n,o;return s=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),n=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),o=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*n+.0722*o}clone(){return new ht(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=ot(t.color.r),this.color.g=ot(t.color.g),this.color.b=ot(t.color.b),this}copyLinearToSRGB(t){return this.color.r=rt(t.color.r),this.color.g=rt(t.color.g),this.color.b=rt(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class lt{constructor(t,e,i,s){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),g(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}formatHex(){return`#${st(this.r)+st(this.g)+st(this.b)+(1===this.opacity?"":st(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:s}=J(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${s}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const dt=M-1e-8;class ut{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,o){if(Math.abs(n-s)>dt)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let r,a,h,l,d=1/0,u=-1/0,c=1/0,p=-1/0;function g(t){h=i*Math.cos(t),l=i*Math.sin(t),h<d&&(d=h),h>u&&(u=h),l<c&&(c=l),l>p&&(p=l)}if(g(s),g(n),n!==s)if((s%=M)<0&&(s+=M),(n%=M)<0&&(n+=M),n<s&&(o=!o,r=s,s=n,n=r),o)for(n-=M,r=s-s%P,a=0;a<4&&r>n;++a,r-=P)g(r);else for(r=s-s%P+P,a=0;a<4&&r<n;++a,r+=P)g(r);this.bounds.add(t+d,e+c),this.bounds.add(t+u,e+p)}arcTo(t,e,i,s,n){this.bounds.add(t,e)}bezierCurveTo(t,e,i,s,n,o){this.bounds.add(t,e),this.bounds.add(i,s),this.bounds.add(n,o)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,s){this.bounds.add(t,e),this.bounds.add(i,s)}rect(t,e,i,s){this.bounds.add(t,e),this.bounds.add(t+i,e+s)}clear(){this.bounds.clear()}release(){}}class ct{constructor(){this._curves=[],this.bounds=new q}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const pt=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,gt={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},ft=0,mt=1,_t=2,yt=3,bt=4,At=5,wt=6,vt=7,xt=8;let Ct,Tt,Et,Lt,St,Pt;var Mt,Ot,Rt,Bt,It,Dt,Ft,Nt,kt;function Ut(t){const e=t[0],i=t[1],s=t[2],n=t[3],o=t[4],r=t[5],a=t[6],h=t[7],l=h*o,d=-a*r,u=a*o,c=h*r,p=Math.cos(s),g=Math.sin(s),f=Math.cos(n),m=Math.sin(n),_=.5*(n-s),y=Math.sin(.5*_),b=8/3*y*y/Math.sin(_),A=e+p-b*g,w=i+g+b*p,v=e+f,x=i+m,C=v+b*m,T=x-b*f;return[l*A+d*w,u*A+c*w,l*C+d*T,u*C+c*T,l*v+d*x,u*v+c*x]}function Ht(t,e,i,s){const n=function(t,e,i,s,n,o,r,a,h){const l=z(r),d=Math.sin(l),u=Math.cos(l),c=u*(a-t)*.5+d*(h-e)*.5,p=u*(h-e)*.5-d*(a-t)*.5;let g=c*c/((i=Math.abs(i))*i)+p*p/((s=Math.abs(s))*s);g>1&&(g=Math.sqrt(g),i*=g,s*=g);const f=u/i,m=d/i,_=-d/s,y=u/s,b=f*a+m*h,A=_*a+y*h,w=f*t+m*e,v=_*t+y*e;let x=1/((w-b)*(w-b)+(v-A)*(v-A))-.25;x<0&&(x=0);let C=Math.sqrt(x);o===n&&(C=-C);const T=.5*(b+w)-C*(v-A),E=.5*(A+v)+C*(w-b),L=Math.atan2(A-E,b-T);let S=Math.atan2(v-E,w-T)-L;S<0&&1===o?S+=M:S>0&&0===o&&(S-=M);const O=Math.ceil(Math.abs(S/(P+.001))),R=[];for(let t=0;t<O;++t){const e=L+t*S/O,n=L+(t+1)*S/O;R[t]=[T,E,e,n,i,s,d,u]}return R}(s[5],s[6],s[0],s[1],s[3],s[4],s[2],e,i);for(let e=0;e<n.length;++e){const i=Ut(n[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(Mt||(Mt={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(Ot||(Ot={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(Rt||(Rt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Bt||(Bt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(It||(It={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Dt||(Dt={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Ft||(Ft={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Nt||(Nt={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(kt||(kt={}));const Gt=[(t,e,i,s,n,o,r)=>e.arc(t[1]*n+i,t[2]*o+s,t[3]*(n+o)/2,t[4],t[5],t[6],r),(t,e,i,s,n,o,r)=>e.arcTo(t[1]*n+i,t[2]*o+s,t[3]*n+i,t[4]*o+s,t[5]*(n+o)/2,r),(t,e,i,s,n,o,r)=>e.bezierCurveTo(t[1]*n+i,t[2]*o+s,t[3]*n+i,t[4]*o+s,t[5]*n+i,t[6]*o+s,r),(t,e,i,s)=>e.closePath(),(t,e,i,s,n,o)=>e.ellipse(t[1]*n+i,t[2]*o+s,t[3]*n,t[4]*o,t[5],t[6],t[7],t[8]),(t,e,i,s,n,o,r)=>e.lineTo(t[1]*n+i,t[2]*o+s,r),(t,e,i,s,n,o,r)=>e.moveTo(t[1]*n+i,t[2]*o+s,r),(t,e,i,s,n,o,r)=>e.quadraticCurveTo(t[1]*n+i,t[2]*o+s,t[3]*n+i,t[4]*o+s,r),(t,e,i,s,n,o,r)=>e.rect(t[1]*n+i,t[2]*o+s,t[3]*n,t[4]*o,r)];function zt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,r=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const h=t[a];Gt[h[0]](h,e,i,s,n,o,r)}}class jt{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Yt(t,e){let i=0;const s=t.length;for(let n=0;n<s;n++){const o=t[n],r=e[n],a=t[(n+1)%s],h=e[(n+1)%s];i+=G.distanceNN(o,r,a,h)}return i/2}function Xt(t,e,i,s,n){const o=1-n;return o*o*o*t+3*e*n*o*o+3*i*n*n*o+s*n*n*n}function $t(t,e,i,s,n){const o=Xt(t.x,e.x,i.x,s.x,n),r=Xt(t.y,e.y,i.y,s.y,n);return new H(o,r)}function Vt(t,e,i,s){const n=1-s;return n*n*t+2*n*s*e+s*s*i}function Wt(t,e,i,s){const n=Vt(t.x,e.x,i.x,s),o=Vt(t.y,e.y,i.y,s);return new H(n,o)}class qt extends jt{constructor(t,e,i){super(),this.type=Nt.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return Wt(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,Yt([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===Ft.ROW?R(this.p0.x-this.p2.x):t===Ft.COLUMN?R(this.p0.y-this.p2.y):0}getAngleAt(t){const e=D(t-.01,0),i=F(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return B(n.y-s.y,n.x-s.x)}draw(t,e,i,s,n,o){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),o>=1)t.quadraticCurveTo(this.p1.x*s+e,this.p1.y*n+i,this.p2.x*s+e,this.p2.y*n+i);else if(o>0){const[r]=function(t,e){const{p0:i,p1:s,p2:n}=t,o=Wt(i,s,n,e),r=G.pointAtPP(i,s,e),a=G.pointAtPP(s,n,e);return[new qt(i,r,o),new qt(o,a,n)]}(this,o);t.quadraticCurveTo(r.p1.x*s+e,r.p1.y*n+i,r.p2.x*s+e,r.p2.y*n+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class Kt extends jt{constructor(t,e,i,s){super(),this.type=Nt.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=s}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return $t(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,s=this.p3,Yt([t.x,e.x,i.x,s.x],[t.y,e.y,i.y,s.y])):60;var t,e,i,s}calcProjLength(t){return t===Ft.ROW?R(this.p0.x-this.p3.x):t===Ft.COLUMN?R(this.p0.y-this.p3.y):0}getAngleAt(t){const e=D(t-.01,0),i=F(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return B(n.y-s.y,n.x-s.x)}draw(t,e,i,s,n,o){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),o>=1)t.bezierCurveTo(this.p1.x*s+e,this.p1.y*n+i,this.p2.x*s+e,this.p2.y*n+i,this.p3.x*s+e,this.p3.y*n+i);else if(o>0){const[r]=function(t,e){const{p0:i,p1:s,p2:n,p3:o}=t,r=$t(i,s,n,o,e),a=G.pointAtPP(i,s,e),h=G.pointAtPP(s,n,e),l=G.pointAtPP(n,o,e),d=G.pointAtPP(a,h,e),u=G.pointAtPP(h,l,e);return[new Kt(i,a,d,r),new Kt(r,u,l,o)]}(this,o);t.bezierCurveTo(r.p1.x*s+e,r.p1.y*n+i,r.p2.x*s+e,r.p2.y*n+i,r.p3.x*s+e,r.p3.y*n+i)}}includeX(t){const e=F(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=D(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=F(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(D(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class Zt extends jt{constructor(t,e){super(),this.type=Nt.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return G.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=B(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?G.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Ft.ROW?R(this.p0.x-this.p1.x):t===Ft.COLUMN?R(this.p0.y-this.p1.y):0}draw(t,e,i,s,n,o){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),o>=1)t.lineTo(this.p1.x*s+e,this.p1.y*n+i);else if(o>0){const r=this.getPointAt(o);t.lineTo(r.x*s+e,r.y*n+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const s=(t-e.x)/(i.x-e.x);return e.y+s*(i.y-e.y)}return 1/0}}class Qt{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,s,n,o,r,a){const h=new Kt(new H(this._lastX,this._lastY),new H(t,e),new H(i,s),new H(n,o));h.originP1=this._lastOriginP,h.originP2=a,h.defined=r,this.curves.push(h),this._lastX=n,this._lastY=o,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,s){const n=this.addLinearCurve(t,e,i,this._lastOriginP,s);this.curves.push(n),this._lastX=t,this._lastY=e,this._lastOriginP=s}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,s){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,s,n){const o=new Zt(new H(this._lastX,this._lastY),new H(t,e));return o.originP1=s,o.originP2=n,o.defined=i,o}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Ft.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],s=null!==(e=i.p3)&&void 0!==e?e:i.p1;return R(t.p0.y-s.y)}if(t===Ft.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],s=null!==(i=e.p3)&&void 0!==i?i:e.p1;return R(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Jt extends Qt{bezierCurveTo(t,e,i,s,n,o,r,a){return super.bezierCurveTo(e,t,s,i,o,n,r,a)}lineTo(t,e,i,s){return super.lineTo(e,t,i,s)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function te(t,e){let i=!1;for(let s=0,n=e.length;s<=n;s++)s>=n===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[s])}function ee(t,e,i){const s=null!=e?e:R(i[i.length-1].x-i[0].x)>R(i[i.length-1].y-i[0].y)?Ft.ROW:Ft.COLUMN;return"monotoneY"===t?new Jt(t,s):new Qt(t,s)}class ie{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function se(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=ee("linear",i,t);return function(t,e){te(t,e)}(new ie(n,s),t),n}function ne(t,e,i,s,n){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,s,t.lastPoint1)}class oe{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&ne(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:ne(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function re(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return se(t,e);const n=ee("basis",i,t);return function(t,e){te(t,e)}(new oe(n,s),t),n}function ae(t){return t<0?-1:1}function he(t,e,i){const s=t._x1-t._x0,n=e-t._x1,o=(t._y1-t._y0)/(s||Number(n<0&&-0)),r=(i-t._y1)/(n||Number(s<0&&-0)),a=(o*n+r*s)/(s+n);return(ae(o)+ae(r))*Math.min(Math.abs(o),Math.abs(r),.5*Math.abs(a))||0}function le(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function de(t,e,i,s,n){const o=t._x0,r=t._y0,a=t._x1,h=t._y1,l=(a-o)/3;t.context.bezierCurveTo(o+l,r+l*e,a-l,h-l*i,a,h,s,t.lastPoint1)}class ue{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:de(this,this._t0,le(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,s=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,s,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,s,t);break;case 1:this._point=2;break;case 2:this._point=3,de(this,le(this,e=he(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:de(this,this._t0,e=he(this,i,s),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=s,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class ce extends ue{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function pe(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return se(t,e);const n=ee("monotoneX",i,t);return function(t,e){te(t,e)}(new ue(n,s),t),n}function ge(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return se(t,e);const n=ee("monotoneY",i,t);return function(t,e){te(t,e)}(new ce(n,s),t),n}let fe=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const s=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(s,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(s,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(s,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function me(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const o=new Qt("step",null!=s?s:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Ft.ROW:Ft.COLUMN);return function(t,e){te(t,e)}(new fe(o,e,n),t),o}class _e extends ie{lineEnd(){this.context.closePath()}}function ye(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=ee("linear",i,t);return function(t,e){te(t,e)}(new _e(n,s),t),n}function be(t,e,i,s,n){let o=t._x1,r=t._y1,a=t._x2,h=t._y2;if(t._l01_a>1e-12){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);o=(o*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,r=(r*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>1e-12){const s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,n=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*s+t._x1*t._l23_2a-e*t._l12_2a)/n,h=(h*s+t._y1*t._l23_2a-i*t._l12_2a)/n}t.context.bezierCurveTo(o,r,a,h,t._x2,t._y2,s,t.lastPoint1)}function Ae(t,e){return function(i,s){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:o,startPoint:r}=n;if(i.length<2-Number(!!r))return null;if(i.length<3-Number(!!r))return se(i,n);const a=ee(t,o,i);return te(new e(a,s,r),i),a}}const we=Ae("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:be(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const ve=Ae("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:be(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class xe{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new Zt(new H(this._lastX,this._lastY),new H(t,e))}quadraticCurveTo(t,e,i,s){const n=new qt(new H(this._lastX,this._lastY),new H(t,e),new H(i,s));this.path.addCurve(n),this._lastX=i,this._lastY=s}bezierCurveTo(t,e,i,s,n,o){const r=new Kt(new H(this._lastX,this._lastY),new H(t,e),new H(i,s),new H(n,o));this.path.addCurve(r),this._lastX=n,this._lastY=o}arcTo(t,e,i,s,n){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,s,n,o,r,a){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,s){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,s,n,o){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}class Ce extends ct{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ut(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([wt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([At,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([vt,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,o){return this.commandList.push([_t,t,e,i,s,n,o]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,n,o),this}arcTo(t,e,i,s,n){return this.commandList.push([mt,t,e,i,s,n]),this._ctx&&this._ctx.arcTo(t,e,i,s,n),this}ellipse(t,e,i,s,n,o,r,a){return this.commandList.push([bt,t,e,i,s,n,o,r,a]),this._ctx&&this._ctx.ellipse(t,e,i,s,n,o,r,a),this}rect(t,e,i,s){return this.commandList.push([xt,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,n,o){return this.commandList.push([ft,t,e,i,s,n,o]),this._ctx&&this._ctx.arc(t,e,i,s,n,o),this}closePath(){return this.commandList.push([yt]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new xe(this);zt(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[wt]=t=>`M${t[1]} ${t[2]}`,t[At]=t=>`L${t[1]} ${t[2]}`,t[vt]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[_t]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[ft]=t=>{const e=[];((t,e,i,s,n,o,r)=>{const a=Math.abs(i-e),h=a>.5*Math.PI?Math.ceil(2*a/Math.PI):1,l=(i-e)/h;for(let i=0;i<h;i++){const a=e+l*i,h=e+l*(i+1),d=4*Math.tan(Math.abs(l)/4)/3,u=h<a?-1:1,c=Math.cos(a),p=Math.sin(a),g=Math.cos(h),f=Math.sin(h),m=c*o+s,_=p*r+n,y=g*o+s,b=f*r+n,A=o*d*u,w=r*d*u;t.push(m-A*p,_+w*c,y+A*f,b-w*g,y,b)}})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[xt]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[yt]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,s,n){this.clear();const o=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,s;const n=[];for(let t=0,o=e.length;t<o;t++)if(Ct=e[t],Tt=Ct.slice(1),Et=Ct[0],i=[Et],s=Tt.match(pt),null!==s){for(let t=0,e=s.length;t<e;t++)Lt=s[t],St=parseFloat(Lt),Number.isNaN(St)||i.push(St);if(Pt=gt[Et],i.length-1>Pt){let t,e=Et;for(let s=1,o=i.length;s<o;s+=Pt){t=[e];for(let e=s,n=s+Pt;e<n;e++)t.push(i[e]);n.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else n.push(i)}else n.push(i);return n}(t);return this._runCommandStrList(o,e,i,s,n),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:s}=t.attribute;if(!e)return;const n=function(t,e,i){var s,n;switch(e){case"linear":default:return se(t,i);case"basis":return re(t,i);case"monotoneX":return pe(t,i);case"monotoneY":return ge(t,i);case"step":return me(t,.5,i);case"stepBefore":return me(t,0,i);case"stepAfter":return me(t,1,i);case"catmullRom":return we(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return ve(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return ye(t,i)}}(e,i);"x"===s?this.direction=Ft.ROW:"y"===s?this.direction=Ft.COLUMN:"auto"===s&&(this.direction=n.direction),this._curves=n.curves}fromCustomPath2D(t,e,i,s,n){return this.clear(),this._runCommandList(t.commandList,e,i,s,n),this._updateBounds(),this}transform(t,e,i,s){const n=this.commandList;if(!this.transformCbList){const t=[];t[wt]=this.moveToTransform,t[At]=this.lineToTransform,t[vt]=this.quadraticCurveToTransform,t[_t]=this.bezierCurveToTransform,t[mt]=this.arcToTransform,t[bt]=this.ellipseTransform,t[xt]=this.rectTransform,t[ft]=this.arcTransform,t[yt]=this.closePathTransform,this.transformCbList=t}n.forEach((n=>{this.transformCbList[n[0]](n,t,e,i,s)})),this._updateBounds()}moveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*s+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*(s+n)/2}ellipseTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}rectTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}arcTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*(s+n)/2}closePathTransform(){}_runCommandStrList(t){let e,i,s,n,o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,d=null,u=0,c=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(e=t[f],1===h&&1===l||(e=Ee(e,h,l)),e[0]){case"l":u+=e[1],c+=e[2],this.lineTo(u+r,c+a);break;case"L":u=e[1],c=e[2],this.lineTo(u+r,c+a);break;case"h":u+=e[1],this.lineTo(u+r,c+a);break;case"H":u=e[1],this.lineTo(u+r,c+a);break;case"v":c+=e[1],this.lineTo(u+r,c+a);break;case"V":c=e[1],this.lineTo(u+r,c+a);break;case"m":u+=e[1],c+=e[2],this.moveTo(u+r,c+a);break;case"M":u=e[1],c=e[2],this.moveTo(u+r,c+a);break;case"c":i=u+e[5],s=c+e[6],p=u+e[3],g=c+e[4],this.bezierCurveTo(u+e[1]+r,c+e[2]+a,p+r,g+a,i+r,s+a),u=i,c=s;break;case"C":u=e[5],c=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+r,e[2]+a,p+r,g+a,u+r,c+a);break;case"s":i=u+e[3],s=c+e[4],null===d[0].match(/[CcSs]/)?(p=u,g=c):(p=2*u-p,g=2*c-g),n=u+e[1],o=c+e[2],this.bezierCurveTo(p+r,g+a,n+r,o+a,i+r,s+a),p=n,g=o,u=i,c=s;break;case"S":i=e[3],s=e[4],null===d[0].match(/[CcSs]/)?(p=u,g=c):(p=2*u-p,g=2*c-g),n=e[1],o=e[2],this.bezierCurveTo(p+r,g+a,n+r,o+a,i+r,s+a),p=n,g=o,u=i,c=s;break;case"q":i=u+e[3],s=c+e[4],p=u+e[1],g=c+e[2],this.quadraticCurveTo(p+r,g+a,i+r,s+a),u=i,c=s;break;case"Q":i=e[3],s=e[4],this.quadraticCurveTo(e[1]+r,e[2]+a,i+r,s+a),u=i,c=s,p=e[1],g=e[2];break;case"t":i=u+e[1],s=c+e[2],null===d[0].match(/[QqTt]/)?(p=u,g=c):"t"===d[0]?(p=2*u-n,g=2*c-o):"q"===d[0]&&(p=2*u-p,g=2*c-g),n=p,o=g,this.quadraticCurveTo(p+r,g+a,i+r,s+a),u=i,c=s,p=u+e[1],g=c+e[2];break;case"T":i=e[1],s=e[2],p=2*u-p,g=2*c-g,this.quadraticCurveTo(p+r,g+a,i+r,s+a),u=i,c=s;break;case"a":Ht(this,u+r,c+a,[e[1],e[2],e[3],e[4],e[5],e[6]+u+r,e[7]+c+a]),u+=e[6],c+=e[7];break;case"A":Ht(this,u+r,c+a,[e[1],e[2],e[3],e[4],e[5],e[6]+r,e[7]+a]),u=e[6],c=e[7];break;case"z":case"Z":this.closePath()}d=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==s||1!==n)for(let o=0,r=t.length;o<r;++o){const r=t[o].slice();switch(r[0]){case At:this.lineToTransform(r,e,i,s,n);break;case wt:this.moveToTransform(r,e,i,s,n);break;case _t:this.bezierCurveToTransform(r,e,i,s,n);break;case vt:this.quadraticCurveToTransform(r,e,i,s,n);break;case ft:this.arcToTransform(r,e,i,s,n);break;case bt:this.ellipseTransform(r,e,i,s,n);break;case xt:this.rectTransform(r,e,i,s,n);break;case mt:this.arcToTransform(r,e,i,s,n);break;case yt:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),zt(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Ft.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return R(t.p0.y-e.p1.y)}if(this.direction===Ft.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return R(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let s=0;s<this._curves.length;s++){e=this._curves[s];const n=e.getLength(this.direction);if(i+n>=t)break;i+=n}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}drawWithClipRange(t,e,i,s,n){this.tryBuildCurves();const o=this.getLength()*n;let r=0;for(let n=0;n<this._curves.length;n++){const a=this._curves[n],h=a.getLength(this.direction);if(!(r+h<=o)){const n=1-(r+h-o)/h;a.draw(t,i,s,e,e,n);break}a.draw(t,i,s,e,e,1),r+=h}}}const Te=["l",0,0,0,0,0,0,0];function Ee(t,e,i){const s=Te[0]=t[0];if("a"===s||"A"===s)Te[1]=e*t[1],Te[2]=i*t[2],Te[3]=t[3],Te[4]=t[4],Te[5]=t[5],Te[6]=e*t[6],Te[7]=i*t[7];else if("h"===s||"H"===s)Te[1]=e*t[1];else if("v"===s||"V"===s)Te[1]=i*t[1];else for(let s=1,n=t.length;s<n;++s)Te[s]=(s%2==1?e:i)*t[s];return Te}const Le={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new Z},Se={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Pe=Object.assign({outerBorder:Object.assign(Object.assign({},Se),{distance:0}),innerBorder:Object.assign(Object.assign({},Se),{distance:0})},Se),Me={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:s.fontBounding,keepCenterInLine:!1},Oe=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Pe),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Re={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Be=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null},{_debug_bounds:!1}),Oe),Le),Ie=Object.assign(Object.assign({},Be),{startAngle:0,endAngle:O,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),De=Object.assign(Object.assign(Object.assign({},Be),Re),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Fe=Object.assign(Object.assign({},Be),{radius:1,startAngle:0,endAngle:O}),Ne=Object.assign(Object.assign({},Be),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),ke=Object.assign(Object.assign({},Be),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Ue=Object.assign(Object.assign(Object.assign({},Be),Re),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),He=Object.assign(Object.assign({},Be),{path:new Ce,fillStrokeOrder:1,clipRange:1,customPath:()=>{E.getInstance().warn("空函数")}}),Ge=Object.assign(Object.assign({},Be),{points:[],cornerRadius:0,closePath:!0}),ze=Object.assign(Object.assign({},Be),{width:100,height:100,spikes:5,thickness:.5}),je=Object.assign(Object.assign({},Be),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},Be),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Ye=Object.assign(Object.assign({},Be),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),Xe=Object.assign(Object.assign(Object.assign({},Be),Me),{strokeBoundsBuffer:0,keepDirIn3d:!0}),$e=Object.assign(Object.assign(Object.assign({},Be),Me),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Ve=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Be),{fill:!0,cornerRadius:0,cornerType:"round"}),We=Object.assign(Object.assign({},Ve),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});const qe=new class{},Ke={arc:Ie,area:De,circle:Fe,line:Ue,path:He,symbol:Ye,text:Xe,rect:je,polygon:Ge,star:ze,richtext:$e,richtextIcon:We,image:Ve,group:Ne,glyph:ke},Ze=Object.keys(Ke);function Qe(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Je={arc:Object.assign({},Ke.arc),area:Object.assign({},Ke.area),circle:Object.assign({},Ke.circle),line:Object.assign({},Ke.line),path:Object.assign({},Ke.path),symbol:Object.assign({},Ke.symbol),text:Object.assign({},Ke.text),rect:Object.assign({},Ke.rect),polygon:Object.assign({},Ke.polygon),star:Object.assign({},Ke.star),richtext:Object.assign({},Ke.richtext),richtextIcon:Object.assign({},Ke.richtextIcon),image:Object.assign({},Ke.image),group:Object.assign({},Ke.group),glyph:Object.assign({},Ke.glyph)};const ti=new class{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Ze.forEach((t=>{this._defaultTheme[t]=Object.create(Je[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||i)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,E.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Ze.forEach((s=>{const n=Object.create(Je[s]);t&&t[s]&&Qe(n,t[s]),i[s]&&Qe(n,i[s]),e[s]&&Qe(n,e[s]),this.combinedTheme[s]=n})),e.common&&Ze.forEach((t=>{Qe(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}};function ei(t,e){return t.glyphHost?ei(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):ti.getTheme()}return null}(t)||t.attachedThemeGraphic&&ei(t.attachedThemeGraphic)||ti.getTheme()}var ii=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{h(s.next(t))}catch(t){o(t)}}function a(t){try{h(s.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}h((s=s.apply(t,e||[])).next())}))};class si extends l{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=r.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ii(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&E.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const s=this.insertInto(t,0);return this._ignoreWarn=!1,s}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,s)=>!(e===this||!t(e,s)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.find(t,!0);if(s)return i=s,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,s)=>{e!==this&&t(e,s)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.findAll(t,!0);s.length&&(i=i.concat(s))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const s=u(i,!0)&&i||f(i)&&i.capture,n=f(i)&&i.once,o=c(e)?void 0:e;return t=s?`${t}capture`:t,e=c(e)?e:e.handleEvent,n?super.once(t,e,o):super.on(t,e,o),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const s=u(i,!0)&&i||f(i)&&i.capture,n=c(e)?void 0:e;t=s?`${t}capture`:t,e=c(e)?e:e.handleEvent;const o=f(i)&&i.once;return super.off(t,e,n,o),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return f(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class ni{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=ni.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&c(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&c(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class oi extends ni{constructor(t,e){super(),this.type=t,this.detail=e}}const ri={dispatchEvent(t){var e;if(!(t instanceof ni))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new oi(t,e))}};class ai{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-ai.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*ai.bounceIn(2*t):.5*ai.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const s=e/O*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*O/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const s=e/O*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*O/e)+1}}static getElasticInOut(t,e){return function(i){const s=e/O*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*O/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*O/e)*.5+1}}static registerFunc(t,e){ai[t]=e}}function hi(t,e){const i=1/e;let s=1;for(;t>i;)t-=i,s*=-1;const n=s*t/i;return n>0?n:1+n}ai.quadIn=ai.getPowIn(2),ai.quadOut=ai.getPowOut(2),ai.quadInOut=ai.getPowInOut(2),ai.cubicIn=ai.getPowIn(3),ai.cubicOut=ai.getPowOut(3),ai.cubicInOut=ai.getPowInOut(3),ai.quartIn=ai.getPowIn(4),ai.quartOut=ai.getPowOut(4),ai.quartInOut=ai.getPowInOut(4),ai.quintIn=ai.getPowIn(5),ai.quintOut=ai.getPowOut(5),ai.quintInOut=ai.getPowInOut(5),ai.backIn=ai.getBackIn(1.7),ai.backOut=ai.getBackOut(1.7),ai.backInOut=ai.getBackInOut(1.7),ai.elasticIn=ai.getElasticIn(1,.3),ai.elasticOut=ai.getElasticOut(1,.3),ai.elasticInOut=ai.getElasticInOut(1,.3*1.5),ai.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),ai.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},ai.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)ai[`flicker${t}`]=e=>hi(e,t);for(let t=2;t<10;t++)ai[`aIn${t}`]=e=>t*e*e+(1-t)*e;const li=new class{constructor(){this.id=r.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Bt.END?this.removeAnimate(e):e.status===Bt.RUNNING||e.status===Bt.INITIAL?(this.animateCount++,e.advance(t)):e.status===Bt.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}};class di{constructor(t,e,i,s,n){this.from=t,this.to=e,this.duration=i,this.easing=s,this.params=n,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class ui extends di{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class ci{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:li,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e||li,this.status=Bt.INITIAL,this.tailAnimate=new pi(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=i}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=D(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){ci.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ci.mode;t&&e&It.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Rt.ANIMATE_PLAY})}runCb(t){const e=new ui((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,o){const r=ci.interpolateMap.get(t)||ci.interpolateMap.get("");return!!r&&r(t,e,i,s,n,o)}pause(){this.status===Bt.RUNNING&&(this.status=Bt.PAUSED)}resume(){this.status===Bt.PAUSED&&(this.status=Bt.RUNNING)}to(t,e,i,s){if(this.tailAnimate.to(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,s){if(this.tailAnimate.from(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new pi(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Bt.INITIAL&&(this.status=Bt.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Bt.RUNNING&&(this.status=Bt.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const s=this.rawPosition,n=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const o=t>=n;if(o&&(t=n),t===s)return o;for(let s=0;s<this.subAnimates.length&&(e=this.subAnimates[s],!(i+e.totalDuration>=t));s++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),o}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=Bt.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}ci.mode=It.NORMAL,ci.interpolateMap=new Map;class pi{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new gi(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,s="string"==typeof i?ai[i]:i,n=this._addStep(e,null,s);return n.type=Dt.customAnimate,this._appendProps(t.getEndProps(),n,!1),this._appendCustomAnimate(t,n),this}to(t,e,i,s){(null==e||e<0)&&(e=0);const n="string"==typeof i?ai[i]:i,o=this._addStep(e,null,n);return o.type=Dt.to,this._appendProps(t,o,!!s&&s.tempProps),o.propKeys||(o.propKeys=Object.keys(o.props)),s&&s.noPreventAttrs||this.target.animates&&this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(o.propKeys)})),this}from(t,e,i,s){this.to(t,0,i,s);const n={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{n[t]=this.getLastPropByName(t,this.stepTail)})),this.to(n,e,i,s),this.stepTail.type=Dt.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=Dt.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const s=new gi(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(s),this.stepTail=s,s}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let s=e.prev;const n=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));s.prev;)s.props&&(s.propKeys||(s.propKeys=Object.keys(s.props)),s.propKeys.forEach((t=>{void 0===n[t]&&(n[t]=s.props[t])}))),e.propKeys=Object.keys(e.props),s=s.prev;const o=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),e.propKeys.forEach((t=>{if(void 0===o[t]){const e=this.animate.getStartProps();o[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,s=this.loop,n=this.rawPosition;let o,r,a=!1;const h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0&&(a=!0,i<0))return a;if(o=Math.floor(t/i),r=t-o*i,a=t>=s*i+i,a&&(r=i,o=s,t=r*o+i),t===n)return a;const l=!this.reversed!=!(this.bounce&&o%2);return l&&(r=i-r),this._deltaPosition=r-this.position,this.position=r,this.rawPosition=t+h,this.updatePosition(a,l),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const s=this.position,n=this.duration;if(this.target&&i){let o=i.next;for(;o&&o.position<=s;)i=o,o=i.next;let r=t?0===n?1:s/n:(s-i.position)/i.duration;i.easing&&(r=i.easing(r)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,r,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,r)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return E.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class gi{constructor(t,e,i,s){this.duration=e,this.position=t,this.props=i,this.easing=s}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const fi=200,mi="cubicOut";var _i;!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(_i||(_i={}));const yi=[0,0,0,0];var bi;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(bi||(bi={}));class Ai{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bi.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===bi.Color1){const e=Ai.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=ht.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];Ai.store1[t]=e,Ai.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const s=Ai.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=ht.parseColorString(t);return n&&(Ai.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],Ai.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===bi.Color1){if(Ai.store1[t])return;Ai.store1[t]=i,Ai.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Ai.store255[t])return;Ai.store255[t]=i,Ai.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function wi(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&y(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function vi(t,e,i,s,n){return Array.isArray(t)&&!y(t[0])||Array.isArray(e)&&!y(e[0])?new Array(4).fill(0).map(((n,o)=>xi(_(t)?t[o]:t,_(e)?e[o]:e,i,s))):xi(t,e,i,s,n)}function xi(t,e,i,s,n){if(!t||!e)return t&&wi(t)||e&&wi(e)||!1;let o,r,a=!1,h=!1;if(Array.isArray(t)?o=t:"string"==typeof t?o=Ai.Get(t,bi.Color255):a=!0,Array.isArray(e)?r=e:"string"==typeof e?r=Ai.Get(e,bi.Color255):h=!0,a!==h){const o=a?t:e,r=a?e:t,h=Object.assign(Object.assign({},o),{stops:o.stops.map((t=>Object.assign(Object.assign({},t),{color:wi(r)})))});return a?vi(o,h,i,s,n):vi(h,o,i,s,n)}if(a){if(t.gradient===e.gradient){const s=t,n=e,o=s.stops,r=n.stops;if(o.length!==r.length)return!1;if("linear"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Ei(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("radial"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Ei(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("conical"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Ei(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i)}return!1}return n&&n(o,r),wi(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(o,r,i),s)}Ai.store255={},Ai.store1={};const Ci=[0,0,0,0],Ti=[0,0,0,0];function Ei(t,e,i){return Ai.Get(t,bi.Color255,Ci),Ai.Get(e,bi.Color255,Ti),`rgba(${Math.round(Ci[0]+(Ti[0]-Ci[0])*i)},${Math.round(Ci[1]+(Ti[1]-Ci[1])*i)},${Math.round(Ci[2]+(Ti[2]-Ci[2])*i)},${Ci[3]+(Ti[3]-Ci[3])*i})`}class Li{static GetImage(t,e){var i;const s=Li.cache.get(t);s?"fail"===s.loadState?qe.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):Li.loadImage(t,e)}static GetSvg(t,e){var i;let s=Li.cache.get(t);s?"fail"===s.loadState?qe.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):(s={type:"image",loadState:"init"},Li.cache.set(t,s),s.dataPromise=qe.global.loadSvg(t),s.dataPromise?(s.waitingMark=[e],s.dataPromise.then((e=>{var i;s.loadState=(null==e?void 0:e.data)?"success":"fail",s.data=null==e?void 0:e.data,null===(i=s.waitingMark)||void 0===i||i.map(((i,n)=>{(null==e?void 0:e.data)?(s.loadState="success",s.data=e.data,i.imageLoadSuccess(t,e.data)):(s.loadState="fail",i.imageLoadFail(t))})),s.waitingMark&&(s.waitingMark=[])}))):(s.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Li.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Li.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=qe.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=qe.global.loadBlob(t):"json"===e&&(i.dataPromise=qe.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Li.isLoading&&Li.toLoadAueue.length){Li.isLoading=!0;const t=Li.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(Li.cache.set(i,n),n.dataPromise=qe.global.loadImage(i),n.dataPromise){n.waitingMark=s;const t=n.dataPromise.then((t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map(((e,s)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))})),n.waitingMark&&(n.waitingMark=[])}));e.push(t)}else n.loadState="fail",s.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Li.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Li.loading()})).catch((t=>{Li.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Li.loading()}))}}),0)}static loadImage(t,e){const i=Si(t,Li.toLoadAueue);if(-1!==i)return Li.toLoadAueue[i].marks.push(e),void Li.loading();Li.toLoadAueue.push({url:t,marks:[e]}),Li.loading()}static improveImageLoading(t){const e=Si(t,Li.toLoadAueue);if(-1!==e){const t=Li.toLoadAueue.splice(e,1);Li.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Si(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Li.cache=new Map,Li.isLoading=!1,Li.toLoadAueue=[],Li.onLoadSuccessCb=[];class Pi{bounds(t,e){if(y(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}}function Mi(t,e,i,s,n){return n?t.arc(i,s,e,0,M,!1,n):t.arc(i,s,e,0,M),!1}var Oi=new class extends Pi{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,s,n){return Mi(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,o){return Mi(t,this.parseSize(e)/2+n,i,s,o)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}};var Ri=new class extends Pi{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,s,n){return function(t,e,i,s,n){return t.moveTo(-3*e+i,-e+s,n),t.lineTo(-e+i,-e+s,n),t.lineTo(-e+i,-3*e+s,n),t.lineTo(e+i,-3*e+s,n),t.lineTo(e+i,-e+s,n),t.lineTo(3*e+i,-e+s,n),t.lineTo(3*e+i,e+s,n),t.lineTo(e+i,e+s,n),t.lineTo(e+i,3*e+s,n),t.lineTo(-e+i,3*e+s,n),t.lineTo(-e+i,e+s,n),t.lineTo(-3*e+i,e+s,n),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n)}drawOffset(t,e,i,s,n,o){return function(t,e,i,s,n,o){return t.moveTo(-3*e+i-n,-e+s-n,o),t.lineTo(-e+i-n,-e+s-n,o),t.lineTo(-e+i-n,-3*e+s-n,o),t.lineTo(e+i+n,-3*e+s-n,o),t.lineTo(e+i+n,-e+s-n,o),t.lineTo(3*e+i+n,-e+s-n,o),t.lineTo(3*e+i+n,e+s+n,o),t.lineTo(e+i+n,e+s+n,o),t.lineTo(e+i+n,3*e+s+n,o),t.lineTo(-e+i-n,3*e+s+n,o),t.lineTo(-e+i-n,e+s+n,o),t.lineTo(-3*e+i-n,e+s+n,o),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n,o)}};function Bi(t,e,i,s,n){return t.moveTo(i,s-e,n),t.lineTo(e+i,s,n),t.lineTo(i,s+e,n),t.lineTo(i-e,s,n),t.closePath(),!0}var Ii=new class extends Pi{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,s,n){return Bi(t,this.parseSize(e)/2,i,s,n)}drawFitDir(t,e,i,s,n){return Bi(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,o){return Bi(t,this.parseSize(e)/2+n,i,s,o)}};function Di(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}var Fi=new class extends Pi{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return Di(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Di(t,this.parseSize(e)/2+n,i,s)}};function Ni(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*n,e+s+n),t.lineTo(i-e-2*n,e+s+n),t.lineTo(i,s-e-2*n),t.closePath(),!0}class ki extends Pi{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,s){return Ni(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ni(t,this.parseSize(e)/2,i,s,n)}}var Ui=new ki;var Hi=new class extends ki{constructor(){super(...arguments),this.type="triangle"}};const Gi=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),zi=Math.sin(M/10)*Gi,ji=-Math.cos(M/10)*Gi;function Yi(t,e,i,s){const n=zi*e,o=ji*e;t.moveTo(i,-e+s),t.lineTo(n+i,o+s);for(let r=1;r<5;++r){const a=M*r/5,h=Math.cos(a),l=Math.sin(a);t.lineTo(l*e+i,-h*e+s),t.lineTo(h*n-l*o+i,l*n+h*o+s)}return t.closePath(),!0}var Xi=new class extends Pi{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,s){return Yi(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Yi(t,this.parseSize(e)/2+n,i,s)}};const $i=k(3);function Vi(t,e,i,s){const n=e,o=n/$i,r=o/5,a=e;return t.moveTo(0+i,-n+s),t.lineTo(o/2+i,s),t.lineTo(r/2+i,s),t.lineTo(r/2+i,a+s),t.lineTo(-r/2+i,a+s),t.lineTo(-r/2+i,s),t.lineTo(-o/2+i,s),t.closePath(),!0}var Wi=new class extends Pi{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,s){return Vi(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Vi(t,this.parseSize(e)/2+n,i,s)}};function qi(t,e,i,s){const n=2*e;return t.moveTo(i,-e+s),t.lineTo(n/3/2+i,e+s),t.lineTo(-n/3/2+i,e+s),t.closePath(),!0}var Ki=new class extends Pi{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return qi(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return qi(t,this.parseSize(e)/2+n,i,s)}};function Zi(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}var Qi=new class extends Pi{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return Zi(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Zi(t,this.parseSize(e)/2+n,i,s)}};const Ji=-.5,ts=k(3)/2,es=1/k(12);function is(t,e,i,s){const n=e/2,o=e*es,r=n,a=e*es+e,h=-r,l=a;return t.moveTo(n+i,o+s),t.lineTo(r+i,a+s),t.lineTo(h+i,l+s),t.lineTo(Ji*n-ts*o+i,ts*n+Ji*o+s),t.lineTo(Ji*r-ts*a+i,ts*r+Ji*a+s),t.lineTo(Ji*h-ts*l+i,ts*h+Ji*l+s),t.lineTo(Ji*n+ts*o+i,Ji*o-ts*n+s),t.lineTo(Ji*r+ts*a+i,Ji*a-ts*r+s),t.lineTo(Ji*h+ts*l+i,Ji*l-ts*h+s),t.closePath(),!1}var ss=new class extends Pi{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,s){return is(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return is(t,this.parseSize(e)/2+n,i,s)}};function ns(t,e,i,s,n){return t.moveTo(-e+i-2*n,s),t.lineTo(e+i+n,e+s+2*n),t.lineTo(e+i+n,s-e-2*n),t.closePath(),!0}var os=new class extends Pi{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,s){return ns(t,this.parseSize(e)/2,i,s,0)}drawOffset(t,e,i,s,n){return ns(t,this.parseSize(e)/2,i,s,n)}};function rs(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-n,e+s+2*n),t.lineTo(e+i+2*n,s),t.lineTo(i-e-n,s-e-2*n),t.closePath(),!0}var as=new class extends Pi{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,s){return rs(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return rs(t,this.parseSize(e)/2,i,s,n)}};function hs(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*n,s-e-n),t.lineTo(i+e+2*n,s-e-n),t.lineTo(i,s+e+2*n),t.closePath(),!0}var ls=new class extends Pi{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,s){return hs(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return hs(t,this.parseSize(e)/2,i,s,n)}};const ds=k(3);function us(t,e,i,s){const n=e*ds;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}var cs=new class extends Pi{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return us(t,this.parseSize(e)/2/ds,i,s)}drawOffset(t,e,i,s,n){return us(t,this.parseSize(e)/2/ds+n,i,s)}};function ps(t,e,i,s){const n=2*e;return t.moveTo(e+i,s-n),t.lineTo(i-e,s),t.lineTo(e+i,n+s),!0}var gs=new class extends Pi{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,s){return ps(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return ps(t,this.parseSize(e)/4+n,i,s)}};function fs(t,e,i,s){const n=2*e;return t.moveTo(i-e,s-n),t.lineTo(i+e,s),t.lineTo(i-e,n+s),!0}var ms=new class extends Pi{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,s){return fs(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return fs(t,this.parseSize(e)/4+n,i,s)}};function _s(t,e,i,s){const n=2*e;return t.moveTo(i-n,s+e),t.lineTo(i,s-e),t.lineTo(i+n,s+e),!0}var ys=new class extends Pi{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,s){return _s(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return _s(t,this.parseSize(e)/4+n,i,s)}};function bs(t,e,i,s){const n=2*e;return t.moveTo(i-n,s-e),t.lineTo(i,s+e),t.lineTo(i+n,s-e),!0}var As=new class extends Pi{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,s){return bs(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return bs(t,this.parseSize(e)/4+n,i,s)}};function ws(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}var vs=new class extends Pi{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return ws(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,o){return ws(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function xs(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}var Cs=new class extends Pi{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return xs(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,o){return xs(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function Ts(t,e,i,s,n){return t.moveTo(i-e,s-e),t.lineTo(i+e,s+e),t.moveTo(i+e,s-e),t.lineTo(i-e,s+e),!0}var Es=new class extends Pi{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,s,n){return Ts(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,o){return Ts(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function Ls(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function Ss(t,e,i,s){const n=e,o=e/2;return t.rect(i-n/2,s-o/2,n,o),!1}var Ps=new class extends Pi{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,s){return y(e)?Ss(t,e,i,s):Ls(t,e,i,s)}drawWithClipRange(t,e,i,s,n,o,r){y(e)&&(e=[e,e/2]);const a=2*(e[0]+e[1])*n,h=[{x:i+e[0]/2,y:s-e[1]/2},{x:i+e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s-e[1]/2}];let l=0,d=h[3];t.moveTo(d.x,d.y);for(let e=0;e<h.length;e++){const i=h[e],s=Math.sqrt((i.x-d.x)*(i.x-d.x)+(i.y-d.y)*(i.y-d.y));if(l+s>a){const e=(i.x-d.x)*(a-l)/s,n=(i.y-d.y)*(a-l)/s;t.lineTo(d.x+e,d.y+n);break}t.lineTo(i.x,i.y),d=i,l+=s}return!1}drawOffset(t,e,i,s,n){return y(e)?Ss(t,e+2*n,i,s):Ls(t,[e[0]+2*n,e[1]+2*n],i,s)}};const Ms=new q;class Os{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,_(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,n,o,r){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),zt(n.path.commandList,t,i,s,e,e),r&&r(n.path,n.attribute)})),!1):(zt(this.path.commandList,t,i,s,e+n,e+n),!1)}draw(t,e,i,s,n,o){return e=this.parseSize(e),this.drawOffset(t,e,i,s,0,n,o)}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,s,n,o,r){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((o=>{o.path.drawWithClipRange(t,e,i,s,n),r&&r(o.path,o.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,s,n),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:s}=i;Ms.x1=s.bounds.x1*t,Ms.y1=s.bounds.y1*t,Ms.x2=s.bounds.x2*t,Ms.y2=s.bounds.y2*t,e.union(Ms)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const Rs={};[Oi,Ri,Ii,Fi,cs,Hi,Xi,Wi,Ki,Qi,ss,os,as,Ui,ls,gs,ms,ys,As,Ps,vs,Cs,Es].forEach((t=>{Rs[t.type]=t}));const Bs={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class Is{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function Ds(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function Fs(t,e,i){const s=function(t,e){let i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",n="";for(let o=e;o<t.length;o++){let e=t[o];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===s[0]){if(!s[1])return{data:n,index:o};if(t[o+1]===s[1])return{data:n,index:o}}else"\t"===e&&(e=" ");n+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!s)return;let n=s.data;const o=s.index,r=n.search(/\s/);let a=n,h=!0;-1!==r&&(a=n.substr(0,r).replace(/\s\s*$/,""),n=n.substr(r+1));const l=a;if(i){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),h=a!==s.data.substr(t+1))}return{tagName:a,tagExp:n,closeIndex:o,attrExpPresent:h,rawTagName:l}}const Ns=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class ks{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const s=e.tagname;"string"==typeof s?(e.tagname=s,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const s={};if(!t)return;const n=function(t,e){const i=[];let s=e.exec(t);for(;s;){const n=[];n.startIndex=e.lastIndex-s[0].length;const o=s.length;for(let t=0;t<o;t++)n.push(s[t]);i.push(n),s=e.exec(t)}return i}(t,Ns),o=n.length;for(let t=0;t<o;t++){const e=n[t][1],i=n[t][4];e&&(s[e]=void 0===i||(isNaN(i)?i:Number(i)))}return s}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Is("!xml");let i=e,s="",n="";for(let o=0;o<t.length;o++)if("<"===t[o])if("/"===t[o+1]){const e=Ds(t,">",o,"Closing Tag is not closed."),r=n.lastIndexOf(".");n=n.substring(0,r),i=this.tagsNodeStack.pop(),i&&i.child&&s&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=s),s="",o=e}else if("?"===t[o+1])o=Fs(t,o,!1,"?>").closeIndex+1;else if("!--"===t.substr(o+1,3))o=Ds(t,"--\x3e",o+4,"Comment is not closed.");else{const r=Fs(t,o,!1);let a=r.tagName,h=r.tagExp;const l=r.attrExpPresent,d=r.closeIndex;if(a!==e.tagname&&(n+=n?"."+a:a),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),n=n.substr(0,n.length-1),h=a):h=h.substr(0,h.length-1);const t=new Is(a);a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,n,a)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{const t=new Is(a);this.tagsNodeStack.push(i),a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,n,a)),this.addChild(i,t,n),i=t}s="",o=d}else s+=t[o];return e.child}}function Us(t,e){return Hs(t)}function Hs(t,e){const i={};for(let e=0;e<t.length;e++){const n=t[e],o=Gs(n);if(void 0!==o&&n[o]){const t=Hs(n[o]);s=t,Object.keys(s).length,n[":@"]&&zs(t,n[":@"]),void 0!==i[o]&&i.hasOwnProperty(o)?(Array.isArray(i[o])||(i[o]=[i[o]]),i[o].push(t)):i[o]=t}}var s;return i}function Gs(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function zs(t,e,i){if(e){const i=Object.keys(e),s=i.length;for(let n=0;n<s;n++){const s=i[n];t[s]=e[s]}}}class js{constructor(t){this.options=Object.assign({},js.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Us(new ks(this.options).parseXml(t),this.options)}}js.defaultOptions={};let Ys=0;function Xs(){return Ys++}var $s;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}($s||($s={}));const Vs=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Vs.set(t,!0)));const Ws=new Map;[""].forEach((t=>Ws.set(t,!0))),Xs(),Xs(),Xs(),Xs(),Xs(),Xs(),Xs(),Xs(),Xs(),Xs(),Xs();const qs=Xs();Xs(),Xs(),Xs(),Xs(),Xs();const Ks={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},Zs=Object.keys(Ks),Qs=new q,Js=new Z,tn=new q,en=["lineWidth","scaleX","scaleY","angle","anchor","visible"],sn=["x","y"],nn=["scaleX","scaleY"],on=["angle"],rn=new H;class an extends si{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const s=e[i];Object.defineProperty(an.prototype,s,Object.getOwnPropertyDescriptor(t,s))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new q,this._updateTag=Mt.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,s;const{dx:n=t.dx,dy:o=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;rn.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),rn.y=o+(null!==(s=t.scrollY)&&void 0!==s?s:0)}else rn.x=n,rn.y=o;return rn}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;qe.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return qe.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new K),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=Rs[t];if(e)return e;if(e=an.userSymbolMap[t],e)return e;if(!0===((i=t=Bs[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new js,{svg:i}=e.parse(t);if(!i)return null;const s=_(i.path)?i.path:[i.path];Qs.clear();const n=[];s.forEach((t=>{const e=(new Ce).fromString(t.d),i={};Zs.forEach((e=>{t[e]&&(i[Ks[e]]=t[e])})),n.push({path:e,attribute:i}),Qs.union(e.bounds)}));const o=Qs.width(),r=Qs.height(),a=1/D(o,r);n.forEach((t=>t.path.transform(0,0,a,a)));const h=new Os(t,n,!0);return an.userSymbolMap[t]=h,h}var i;const s=(new Ce).fromString(t),n=s.bounds.width(),o=s.bounds.height(),r=1/D(n,o);s.transform(0,0,r,r);const a=new Os(t,s);return an.userSymbolMap[t]=a,a}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,s=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:n=e.boundsPadding}=i,o=(r=n)?_(r)?0===r.length?0:1===r.length?r[0]:2===r.length?(yi[0]=r[0],yi[2]=r[0],yi[1]=r[1],yi[3]=r[1],yi):r:r:0;var r;return o&&s.expand(o),this.clearUpdateBoundTag(),s}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new ut(t);return zt(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new Z),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&Mt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&qe.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&Mt.UPDATE_BOUNDS)&&qe.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&Mt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&Mt.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&Mt.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&Mt.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=Mt.CLEAR_SHAPE}containsPoint(t,e,i,s){if(!s)return!1;if(i===Ot.GLOBAL){const i=new H(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return s.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const s=Object.keys(t);for(let e=0;e<s.length;e++){const i=s[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(s)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,s){var n;const o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);o?this._setAttributes(o,i,s):p(null===(n=this.normalAttrs)||void 0===n?void 0:n[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en;for(let i=0;i<e.length;i++){const s=e[i];if(-1!==t.indexOf(s))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Rt.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=Mt.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,s;if(0===t&&0===e)return this;const n={type:Rt.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,sn,n);o&&(t=o.x,e=o.y,delete o.x,delete o.y,this._setAttributes(o));const r=this.attribute,a=r.postMatrix;return a?qe.transformUtil.fromMatrix(a,a).translate(t,e):(r.x=(null!==(i=r.x)&&void 0!==i?i:Le.x)+t,r.y=(null!==(s=r.y)&&void 0!==s?s:Le.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const s={type:Rt.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,sn,s);return n?(this._setAttributes(n,!1,s),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this)}scale(t,e,i){var s,n;if(1===t&&1===e)return this;const o={type:Rt.SCALE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,nn,o);r&&(t=r.scaleX,e=r.scaleY,delete r.scaleX,delete r.scaleY,this._setAttributes(r));const a=this.attribute;if(i){let{postMatrix:s}=this.attribute;s||(s=new Z,a.postMatrix=s),qe.transformUtil.fromMatrix(s,s).scale(t,e,i)}else a.scaleX=(null!==(s=a.scaleX)&&void 0!==s?s:Le.scaleX)*t,a.scaleY=(null!==(n=a.scaleY)&&void 0!==n?n:Le.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const s={type:Rt.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,nn,s);return n?(this._setAttributes(n,!1,s),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this)}rotate(t,e){var i;if(0===t)return this;const s={type:Rt.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,on,s);n&&(delete n.angle,this._setAttributes(n,!1,s));const o=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Z,o.postMatrix=i),qe.transformUtil.fromMatrix(i,i).rotate(t,e)}else o.angle=(null!==(i=o.angle)&&void 0!==i?i:Le.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Rt.ROTATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,on,i);return s?(this._setAttributes(s,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){var e;this.animates||(this.animates=new Map);const i=new ci(null==t?void 0:t.id,null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(i.bind(this),t){const{onStart:e,onFrame:s,onEnd:n,onRemove:o}=t;null!=e&&i.onStart(e),null!=s&&i.onFrame(s),null!=n&&i.onEnd(n),null!=o&&i.onRemove(o),i.interpolateFunc=t.interpolate}return this.animates.set(i.id,i),i.onRemove((()=>{i.stop(),this.animates.delete(i.id)})),i}onAttributeUpdate(t){t&&t.skipUpdateCallback||(qe.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!p(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,s){var n,o,r,a;if(i){const i=Object.keys(t),h=this.getNoWorkAnimateAttr(),l={};let d;i.forEach((e=>{h[e]?(d||(d={}),d[e]=t[e]):l[e]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const u=this.animate({slience:!0});u.stateNames=e,u.to(l,null!==(o=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==o?o:fi,null!==(a=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.easing)&&void 0!==a?a:mi),d&&this.setAttributes(d,!1,{type:Rt.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Rt.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const s=i.getEndProps();v(s,t)&&(e=s[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const i=_(t)?e=>!t.includes(e):e=>e!==t,s=this.currentStates.filter(i);s.length!==this.currentStates.length&&this.useStates(s,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var s;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&(null===(s=this.currentStates)||void 0===s?void 0:s.length)?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const s={};t.forEach((e=>{var i;const n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(s,n)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}addUpdateBoundTag(){this._updateTag|=Mt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=Mt.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=Mt.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&Mt.UPDATE_SHAPE_AND_BOUNDS)===Mt.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=Mt.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Mt.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Mt.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=Mt.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=Mt.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=Mt.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=Mt.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&Mt.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],s=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:s,scaleCenter:n}=this.attribute;return tn.copy(this._AABBBounds),this.setAttributes({angle:0,scaleCenter:null}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(tn),this.setAttributes({scaleX:t,scaleY:i,angle:s,scaleCenter:n}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,n=s();i[0]=n.x1+(n.x2-n.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,n=s();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Le.x,y:e=Le.y,scaleX:i=Le.scaleX,scaleY:s=Le.scaleY,angle:n=Le.angle,scaleCenter:o,anchor:r,postMatrix:a}=this.attribute;let h=[0,0];const l={};if(r&&n&&(h=this.getAnchor(r,l)),!o||1===i&&1===s)!function(t,e,i,s,n,o,r,a){const h=e.a,l=e.b,d=e.c,u=e.d,c=e.e,p=e.f,g=I(r),f=N(r);let m,_;a?(m=a[0],_=a[1]):(m=i,_=s);const y=m-i,b=_-s,A=h*g+d*f,w=l*g+u*f,v=d*g-h*f,x=u*g-l*f;t.a=n*A,t.b=n*w,t.c=o*v,t.d=o*x,t.e=c+h*m+d*_-A*y-v*b,t.f=p+l*m+u*_-w*y-x*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,r&&h);else{const r=this._transMatrix;r.reset(),r.translate(h[0],h[1]),r.rotate(n),r.translate(-h[0],-h[1]),r.translate(t,e),h=this.getAnchor(o,l),qe.transformUtil.fromMatrix(r,r).scale(i,s,{x:h[0],y:h[1]})}const d=this.getOffsetXY(Le);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,a){const t=Js.setValue(a.a,a.b,a.c,a.d,a.e,a.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline===li&&t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),qe.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Rt.ANIMATE_END})}onStep(t,e,i,s,n){const o={};if(i.customAnimate)i.customAnimate.update(n,s,o);else{const r=i.props,a=i.parsedProps,h=i.propKeys;this.stepInterpolate(t,e,o,i,s,n,r,void 0,a,h)}this.setAttributes(o,!1,{type:Rt.ANIMATE_UPDATE,animationState:{ratio:s,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,s,n,o,r,a,h,l){l||(l=Object.keys(r),s.propKeys=l),o?s.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=r[t])})):l.forEach((o=>{var l;if(!e.validAttr(o))return;const d=r[o],u=null!==(l=a&&a[o])&&void 0!==l?l:t.getLastPropByName(o,s);if(null==d||null==u||d===u)return void(i[o]=d);let c;c=e.interpolateFunc&&e.interpolateFunc(o,n,u,d,i),c||(c=e.customInterpolate(o,n,u,d,this,i),c||this.defaultInterpolate(d,u,o,i,h,n)||this._interpolate(o,n,u,d,i))})),s.parsedProps=h}defaultInterpolate(t,e,i,s,n,o){if(Number.isFinite(t)&&Number.isFinite(e))return s[i]=e+(t-e)*o,!0;if("fill"===i){n||(n={});const r=n.fillColorArray,a=vi(e,null!=r?r:t,o,!1,((t,e)=>{n.fillColorArray=e}));return a&&(s[i]=a),!0}if("stroke"===i){n||(n={});const r=n.strokeColorArray,a=vi(e,null!=r?r:t,o,!1,((t,e)=>{n.strokeColorArray=e}));return a&&(s[i]=a),!0}if("shadowColor"===i){n||(n={});const r=n.shadowColorArray,a=vi(e,null!=r?r:t,o,!0,((t,e)=>{n.shadowColorArray=e}));return a&&(s[i]=a),!0}if(Array.isArray(t)&&t.length===e.length){const n=[];let r=!0;for(let i=0;i<t.length;i++){const s=e[i],a=s+(t[i]-s)*o;if(!Number.isFinite(a)){r=!1;break}n.push(a)}r&&(s[i]=n)}return!1}_interpolate(t,e,i,s,n){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:qe.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return m(t,!0)?this.pathProxy=(new Ce).fromString(t):this.pathProxy=new Ce,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(i,s),"string"==typeof t?(s.state="loading",t.startsWith("<svg")?(Li.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(b(t)||t.includes("/")||A(t))&&(Li.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):f(t)?(s.state="success",s.data=t,this.backgroundImg=this.backgroundImg||e):s.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const s=this.resources.get(t);s&&(s.state="success",s.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),qe.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new oi(t,e);n.bubbles=!1,n.manager=null===(s=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===s?void 0:s.manager,this.dispatchEvent(n)}}}an.userSymbolMap={},an.mixin(ri);const hn=["width","x1","y1","height","cornerRadius",...en];class ln extends an{constructor(t){super(t),this.type="rect",this.numberType=qs}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return ei(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:o,x:r,y:a}=t;e=null!=e?e:n-r,s=null!=s?s:o-a,(isFinite(e)||isFinite(s)||isFinite(r)||isFinite(a))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=qe.graphicService.updateTempAABBBounds(i);return((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:o=t.distance,lineWidth:r=t.lineWidth}=s;i.expand(o+(n+r)/2)}})(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,qe.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,hn)}needUpdateTag(t){return super.needUpdateTag(t,hn)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:s,height:n}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=p(t.width)?t.x1-t.x:t.width,i=p(t.height)?t.y1-t.y:t.height,s=0,n=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:s,y:n,width:e,height:i}})(t),o=new Ce;return o.moveTo(e,i),o.rect(e,i,s,n),o}clone(){return new ln(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ln.NOWORK_ANIMATE_ATTR}}function dn(t){return new ln(t)}function un(t,e){var i,s,n,o,r,a,h,l;return!t&&!e||!(!t||!e)&&(null===(i=t.start)||void 0===i?void 0:i.col)===(null===(s=e.start)||void 0===s?void 0:s.col)&&(null===(n=t.start)||void 0===n?void 0:n.row)===(null===(o=e.start)||void 0===o?void 0:o.row)&&(null===(r=t.end)||void 0===r?void 0:r.col)===(null===(a=e.end)||void 0===a?void 0:a.col)&&(null===(h=t.end)||void 0===h?void 0:h.row)===(null===(l=e.end)||void 0===l?void 0:l.row)}ln.NOWORK_ANIMATE_ATTR={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};const cn="undefined"==typeof window||void 0===window.window;function pn(t,e,i){return t.start.col<=e&&e<=t.end.col&&t.start.row<=i&&i<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=i&&i<=t.start.row||t.end.col<=e&&e<=t.start.col&&t.start.row<=i&&i<=t.end.row||t.start.col<=e&&e<=t.end.col&&t.end.row<=i&&i<=t.start.row}!function(){if(cn)return{IE:!1,Edge:!1,Chrome:!1,Firefox:!1,Safari:!1};const t=window.navigator.userAgent.toLowerCase();/(msie|trident)/.exec(t),t.indexOf("edge"),t.indexOf("chrome")>-1&&t.indexOf("edge"),t.indexOf("firefox"),t.indexOf("safari")>-1&&t.indexOf("edge")}();function gn(t,e){return void 0===t&&void 0===e||void 0!==t&&void 0!==e&&(t.start.col===e.start.col&&t.start.row===e.start.row&&t.end.col===e.end.col&&t.end.row===e.end.row)}function fn(t,e){return void 0===t&&void 0===e||void 0!==t&&void 0!==e&&(t.start.col===e.start.col&&t.start.row===e.start.row&&t.end.col===e.end.col&&t.end.row===e.end.row)}function mn(t){return Math.floor(t)===t}t.AddRowColumnPlugin=class{id="add-row-column";runTime=[n.TABLE_EVENT_TYPE.MOUSEENTER_CELL,n.TABLE_EVENT_TYPE.MOUSELEAVE_CELL,n.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE];pluginOptions;table;hoverCell;hideAllTimeoutId_addColumn;hideAllTimeoutId_addRow;leftDotForAddColumn;rightDotForAddColumn;addIconForAddColumn;addLineForAddColumn;topDotForAddRow;bottomDotForAddRow;addIconForAddRow;addLineForAddRow;constructor(t={addColumnEnable:!0,addRowEnable:!0}){this.pluginOptions=t,this.pluginOptions.addColumnEnable=this.pluginOptions.addColumnEnable??!0,this.pluginOptions.addRowEnable=this.pluginOptions.addRowEnable??!0,this.pluginOptions.addColumnEnable&&(this.initAddColumnDomElement(),this.bindEventForAddColumn()),this.pluginOptions.addRowEnable&&(this.initAddRowDomElement(),this.bindEventForAddRow())}run(...t){const e=t[0],i=t[1],s=t[2];if(this.table=s,i===n.TABLE_EVENT_TYPE.MOUSEENTER_CELL){clearTimeout(this.hideAllTimeoutId_addColumn),clearTimeout(this.hideAllTimeoutId_addRow);const t=s.canvas.getBoundingClientRect(),i=s.getCellAtRelativePosition(e.event.clientX-t.left,e.event.clientY-t.top);this.hoverCell=i;const n=s.getCellRelativeRect(i.col,i.row);if(this.pluginOptions.addColumnEnable){const e=s.isSeriesNumber(i.col,0);this.showDotForAddColumn(t.top-6,n.left+t.left,n.right+t.left,!e)}if(this.pluginOptions.addRowEnable){const e=s.isHeader(i.col,i.row);this.showDotForAddRow(n.top+t.top,t.left-6,n.bottom+t.top,!e,!e)}}else i===n.TABLE_EVENT_TYPE.MOUSELEAVE_CELL||i===n.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE&&(this.pluginOptions.addColumnEnable&&this.delayHideAllForAddColumn(),this.pluginOptions.addRowEnable&&this.delayHideAllForAddRow())}initAddColumnDomElement(){this.leftDotForAddColumn=document.createElement("div"),this.leftDotForAddColumn.style.width="6px",this.leftDotForAddColumn.style.height="6px",this.leftDotForAddColumn.style.backgroundColor="#4A90E2",this.leftDotForAddColumn.style.position="absolute",this.leftDotForAddColumn.style.cursor="pointer",this.leftDotForAddColumn.style.zIndex="1000",this.leftDotForAddColumn.style.borderRadius="50%",this.leftDotForAddColumn.style.border="1px solid white",this.leftDotForAddColumn.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.leftDotForAddColumn),this.rightDotForAddColumn=document.createElement("div"),this.rightDotForAddColumn.style.width="6px",this.rightDotForAddColumn.style.height="6px",this.rightDotForAddColumn.style.backgroundColor="#4A90E2",this.rightDotForAddColumn.style.position="absolute",this.rightDotForAddColumn.style.cursor="pointer",this.rightDotForAddColumn.style.zIndex="1000",this.rightDotForAddColumn.style.borderRadius="50%",this.rightDotForAddColumn.style.border="1px solid white",this.rightDotForAddColumn.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.rightDotForAddColumn),this.addIconForAddColumn=document.createElement("div"),this.addIconForAddColumn.style.width="18px",this.addIconForAddColumn.style.height="18px",this.addIconForAddColumn.style.backgroundColor="#4A90E2",this.addIconForAddColumn.style.position="absolute",this.addIconForAddColumn.style.zIndex="1001",this.addIconForAddColumn.style.display="none",this.addIconForAddColumn.style.borderRadius="50%",this.addIconForAddColumn.style.boxShadow="0 2px 5px rgba(0,0,0,0.2)",this.addIconForAddColumn.style.display="flex",this.addIconForAddColumn.style.justifyContent="center",this.addIconForAddColumn.style.alignItems="center",this.addIconForAddColumn.style.border="1px solid white",document.body.appendChild(this.addIconForAddColumn);const t=document.createElement("div");t.textContent="+",t.style.color="white",t.style.fontSize="18px",t.style.fontWeight="bold",t.style.lineHeight="15px",t.style.userSelect="none",t.style.cursor="pointer",t.style.verticalAlign="top",t.style.textAlign="center",this.addIconForAddColumn.appendChild(t),this.addLineForAddColumn=document.createElement("div"),this.addLineForAddColumn.style.width="2px",this.addLineForAddColumn.style.height="10px",this.addLineForAddColumn.style.backgroundColor="#4A90E2",this.addLineForAddColumn.style.position="absolute",this.addLineForAddColumn.style.zIndex="1001",this.addLineForAddColumn.style.display="none",document.body.appendChild(this.addLineForAddColumn)}bindEventForAddColumn(){this.leftDotForAddColumn.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addColumn),this.addIconForAddColumn.style.display="block";const t=this.leftDotForAddColumn.offsetWidth,e=this.leftDotForAddColumn.offsetHeight;this.showAddIconForAddColumn(this.leftDotForAddColumn.offsetLeft+t/2,this.leftDotForAddColumn.offsetTop+e/2,!0),this.showSplitLineForAddColumn(this.leftDotForAddColumn.offsetLeft+t/2-1,this.leftDotForAddColumn.offsetTop+e/2+2,this.table.getDrawRange().height)})),this.rightDotForAddColumn.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addColumn),this.addIconForAddColumn.style.display="block";const t=this.rightDotForAddColumn.offsetWidth,e=this.rightDotForAddColumn.offsetHeight;this.showAddIconForAddColumn(this.rightDotForAddColumn.offsetLeft+t/2,this.rightDotForAddColumn.offsetTop+e/2,!1),this.showSplitLineForAddColumn(this.rightDotForAddColumn.offsetLeft+t/2-1,this.rightDotForAddColumn.offsetTop+e/2+2,this.table.getDrawRange().height)})),this.addIconForAddColumn.addEventListener("mouseleave",(()=>{this.addIconForAddColumn.style.display="none",this.addLineForAddColumn.style.display="none",this.delayHideAllForAddColumn()})),this.addIconForAddColumn.addEventListener("click",(t=>{const e="left"===this.addIconForAddColumn.dataset.addIconType,i=this.table.options.columns,s=this.hoverCell.col,n=e?s:s+1;this.pluginOptions.addColumnCallback?this.pluginOptions.addColumnCallback(n):(i.splice(n,0,{field:"",title:`New Column ${s}`,width:100}),this.table.updateColumns(i)),this.delayHideAllForAddColumn(0)}))}showDotForAddColumn(t,e,i,s=!0,n=!0){const o=this.leftDotForAddColumn.offsetWidth,r=this.leftDotForAddColumn.offsetHeight;this.leftDotForAddColumn.style.left=e-o/2+"px",this.leftDotForAddColumn.style.top=t-r/2+"px",this.rightDotForAddColumn.style.left=i-o/2+"px",this.rightDotForAddColumn.style.top=t-r/2+"px",this.leftDotForAddColumn.style.display=s?"block":"none",this.rightDotForAddColumn.style.display=n?"block":"none"}showAddIconForAddColumn(t,e,i){const s=this.addIconForAddColumn.offsetWidth,n=this.addIconForAddColumn.offsetHeight,o=this.leftDotForAddColumn.offsetHeight;this.addIconForAddColumn.style.left=t-s/2+"px",this.addIconForAddColumn.style.top=e-n/2-o/2+"px",this.addIconForAddColumn.dataset.addIconType=i?"left":"right"}showSplitLineForAddColumn(t,e,i){this.addLineForAddColumn.style.left=`${t}px`,this.addLineForAddColumn.style.top=`${e}px`,this.addLineForAddColumn.style.height=`${i}px`,this.addLineForAddColumn.style.display="block"}delayHideAllForAddColumn(t=1e3){this.hideAllTimeoutId_addColumn=setTimeout((()=>{this.addIconForAddColumn.style.display="none",this.addLineForAddColumn.style.display="none",this.leftDotForAddColumn.style.display="none",this.rightDotForAddColumn.style.display="none"}),t)}initAddRowDomElement(){this.topDotForAddRow=document.createElement("div"),this.topDotForAddRow.style.width="6px",this.topDotForAddRow.style.height="6px",this.topDotForAddRow.style.backgroundColor="#4A90E2",this.topDotForAddRow.style.position="absolute",this.topDotForAddRow.style.cursor="pointer",this.topDotForAddRow.style.zIndex="1000",this.topDotForAddRow.style.borderRadius="50%",this.topDotForAddRow.style.border="1px solid white",this.topDotForAddRow.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.topDotForAddRow),this.bottomDotForAddRow=document.createElement("div"),this.bottomDotForAddRow.style.width="6px",this.bottomDotForAddRow.style.height="6px",this.bottomDotForAddRow.style.backgroundColor="#4A90E2",this.bottomDotForAddRow.style.position="absolute",this.bottomDotForAddRow.style.cursor="pointer",this.bottomDotForAddRow.style.zIndex="1000",this.bottomDotForAddRow.style.borderRadius="50%",this.bottomDotForAddRow.style.border="1px solid white",this.bottomDotForAddRow.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.bottomDotForAddRow),this.addIconForAddRow=document.createElement("div"),this.addIconForAddRow.style.width="18px",this.addIconForAddRow.style.height="18px",this.addIconForAddRow.style.backgroundColor="#4A90E2",this.addIconForAddRow.style.position="absolute",this.addIconForAddRow.style.zIndex="1001",this.addIconForAddRow.style.display="none",this.addIconForAddRow.style.borderRadius="50%",this.addIconForAddRow.style.boxShadow="0 2px 5px rgba(0,0,0,0.2)",this.addIconForAddRow.style.display="flex",this.addIconForAddRow.style.justifyContent="center",this.addIconForAddRow.style.alignItems="center",this.addIconForAddRow.style.border="1px solid white",document.body.appendChild(this.addIconForAddRow);const t=document.createElement("div");t.textContent="+",t.style.color="white",t.style.fontSize="18px",t.style.fontWeight="bold",t.style.lineHeight="15px",t.style.userSelect="none",t.style.cursor="pointer",t.style.verticalAlign="top",t.style.textAlign="center",this.addIconForAddRow.appendChild(t),this.addLineForAddRow=document.createElement("div"),this.addLineForAddRow.style.width="10px",this.addLineForAddRow.style.height="2px",this.addLineForAddRow.style.backgroundColor="#4A90E2",this.addLineForAddRow.style.position="absolute",this.addLineForAddRow.style.zIndex="1001",this.addLineForAddRow.style.display="none",document.body.appendChild(this.addLineForAddRow)}bindEventForAddRow(){this.topDotForAddRow.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addRow),this.addIconForAddRow.style.display="block";const t=this.topDotForAddRow.offsetWidth,e=this.topDotForAddRow.offsetHeight;this.showAddIconForAddRow(this.topDotForAddRow.offsetLeft+t/2,this.topDotForAddRow.offsetTop+e/2,!0),this.showSplitLineForAddRow(this.topDotForAddRow.offsetLeft+t+2,this.topDotForAddRow.offsetTop+e/2-1,this.table.getDrawRange().width)})),this.bottomDotForAddRow.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addRow),this.addIconForAddRow.style.display="block";const t=this.bottomDotForAddRow.offsetWidth,e=this.bottomDotForAddRow.offsetHeight;this.showAddIconForAddRow(this.bottomDotForAddRow.offsetLeft+t/2,this.bottomDotForAddRow.offsetTop+e/2,!1),this.showSplitLineForAddRow(this.bottomDotForAddRow.offsetLeft+t+2,this.bottomDotForAddRow.offsetTop+e/2-1,this.table.getDrawRange().height)})),this.addIconForAddRow.addEventListener("mouseleave",(()=>{this.addIconForAddRow.style.display="none",this.addLineForAddRow.style.display="none",this.delayHideAllForAddRow()})),this.addIconForAddRow.addEventListener("click",(t=>{const e="top"===this.addIconForAddRow.dataset.addIconType,i=this.hoverCell.row,s=e?i:i+1;if(this.pluginOptions.addRowCallback)this.pluginOptions.addRowCallback(s);else{const t=this.table.getRecordIndexByCell(0,s);this.table.addRecord({},t)}this.delayHideAllForAddRow(0)}))}showDotForAddRow(t,e,i,s=!0,n=!0){const o=this.topDotForAddRow.offsetWidth,r=this.topDotForAddRow.offsetHeight;this.topDotForAddRow.style.left=e-o/2+"px",this.topDotForAddRow.style.top=t-r/2+"px",this.bottomDotForAddRow.style.left=e-o/2+"px",this.bottomDotForAddRow.style.top=i-r/2+"px",this.topDotForAddRow.style.display=s?"block":"none",this.bottomDotForAddRow.style.display=n?"block":"none"}showAddIconForAddRow(t,e,i){const s=this.addIconForAddRow.offsetWidth,n=this.addIconForAddRow.offsetHeight,o=this.topDotForAddRow.offsetWidth;this.addIconForAddRow.style.left=t-s/2-o/2+"px",this.addIconForAddRow.style.top=e-n/2+"px",this.addIconForAddRow.dataset.addIconType=i?"top":"bottom"}showSplitLineForAddRow(t,e,i){this.addLineForAddRow.style.left=`${t}px`,this.addLineForAddRow.style.top=`${e}px`,this.addLineForAddRow.style.width=`${i}px`,this.addLineForAddRow.style.display="block"}delayHideAllForAddRow(t=1e3){this.hideAllTimeoutId_addRow=setTimeout((()=>{this.addIconForAddRow.style.display="none",this.addLineForAddRow.style.display="none",this.topDotForAddRow.style.display="none",this.bottomDotForAddRow.style.display="none"}),t)}release(){this.leftDotForAddColumn.remove(),this.rightDotForAddColumn.remove(),this.addIconForAddColumn.remove(),this.addLineForAddColumn.remove(),this.topDotForAddRow.remove(),this.bottomDotForAddRow.remove(),this.addIconForAddRow.remove(),this.addLineForAddRow.remove()}},t.CarouselAnimationPlugin=class{table;rowCount;colCount;animationDuration;animationDelay;animationEasing;replaceScrollAction;playing;row;col;willUpdateRow=!1;willUpdateCol=!1;customDistRowFunction;customDistColFunction;constructor(t,e){this.table=t,this.rowCount=e?.rowCount??void 0,this.colCount=e?.colCount??void 0,this.animationDuration=e?.animationDuration??500,this.animationDelay=e?.animationDelay??1e3,this.animationEasing=e?.animationEasing??"linear",this.replaceScrollAction=e?.replaceScrollAction??!1,this.customDistColFunction=e.customDistColFunction,this.customDistRowFunction=e.customDistRowFunction,this.reset(),this.init()}init(){this.replaceScrollAction&&(this.table.disableScroll(),this.table.scenegraph.stage.addEventListener("wheel",this.onScrollEnd.bind(this)))}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}onScrollEnd(t){this.rowCount?(t.deltaY>0?(this.row+=this.rowCount,this.row=Math.min(this.row,this.table.rowCount-this.table.frozenRowCount)):t.deltaY<0&&(this.row-=this.rowCount,this.row=Math.max(this.row,this.table.frozenRowCount)),this.table.scrollToRow(this.row,{duration:this.animationDuration,easing:this.animationEasing})):this.colCount&&(t.deltaX>0?(this.col+=this.colCount,this.col=Math.min(this.col,this.table.colCount-this.table.frozenColCount)):t.deltaX<0&&(this.col-=this.colCount,this.col=Math.max(this.col,this.table.frozenColCount)),this.table.scrollToCol(this.col,{duration:this.animationDuration,easing:this.animationEasing}))}play(){this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistRowFunction&&this.customDistRowFunction(this.row,this.table);e?(this.row=e.distRow,t=e.animation??!0):o(this.row)&&this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):o(this.row)||this.table.scenegraph.proxy.screenTopRow===Math.floor(this.row)?this.row+=this.rowCount:(this.row=this.table.frozenRowCount,t=!1),this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout((()=>{this.willUpdateRow=!1,this.updateRow()}),this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistColFunction&&this.customDistColFunction(this.col,this.table);e?(this.col=e.distCol,t=e.animation??!0):o(this.col)&&this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):o(this.col)||this.table.scenegraph.proxy.screenLeftCol===Math.floor(this.col)?this.col+=this.colCount:(this.col=this.table.frozenColCount,t=!1),this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout((()=>{this.willUpdateCol=!1,this.updateCol()}),this.animationDuration+this.animationDelay)}},t.ColumnSeriesPlugin=class{id="column-series";runTime=[n.TABLE_EVENT_TYPE.BEFORE_INIT,n.TABLE_EVENT_TYPE.BEFORE_KEYDOWN];pluginOptions;table;columns=[];constructor(t){this.pluginOptions=Object.assign({columnCount:100,autoExtendColumn:!0},t)}run(...t){if(t[1]===n.TABLE_EVENT_TYPE.BEFORE_INIT){const e=t[0],i=t[2];this.table=i;const s=e.options;this.columns=this.generateColumns(this.pluginOptions.columnCount),s.columns=this.columns}else if(t[1]===n.TABLE_EVENT_TYPE.BEFORE_KEYDOWN){"ArrowRight"===t[0].event.key&&this.pluginOptions.autoExtendColumn&&this.table.stateManager.select.cellPos.col===this.table.colCount-1&&this.table.addColumn(this.generateColumn(this.table.colCount-1))}}generateColumns(t){const e=[];for(let i=0;i<t;i++)e.push(this.generateColumn(i));return e}generateColumn(t){return{title:this.pluginOptions.generateColumnTitle?this.pluginOptions.generateColumnTitle(t):this.generateColumnField(t)}}generateColumnField(t){if(t<26)return String.fromCharCode(65+t);const e=[];for(t++;t>0;)t--,e.unshift(String.fromCharCode(65+t%26)),t=Math.floor(t/26);return e.join("")}resetColumnCount(t){this.pluginOptions.columnCount=t,this.columns=this.generateColumns(t),this.table.updateColumns(this.columns)}},t.ExcelEditCellKeyboardPlugin=class{id="excel-edit-cell-keyboard";runTime=[n.TABLE_EVENT_TYPE.INITIALIZED];table;pluginOptions;constructor(t){this.pluginOptions=t,this.bindEvent()}run(...t){const e=t[2];this.table=e}bindEvent(){document.addEventListener("keydown",this.handleKeyDown.bind(this),!0)}handleKeyDown(t){if(this.table.editorManager)if("keydown"===this.table.editorManager.beginTriggerEditCellMode){if(this.table.editorManager.editingEditor&&this.isExcelShortcutKey(t)){const{col:e,row:i}=this.table.editorManager.editCell;this.table.editorManager.completeEdit(),this.table.getElement().focus(),t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key?this.table.selectCell(e,i+1):"Tab"===t.key?this.table.selectCell(e+1,i):"ArrowLeft"===t.key?this.table.selectCell(e-1,i):"ArrowRight"===t.key?this.table.selectCell(e+1,i):"ArrowDown"===t.key?this.table.selectCell(e,i+1):"ArrowUp"===t.key&&this.table.selectCell(e,i-1),t.stopPropagation(),t.preventDefault())}}else{const{col:e,row:i}=this.table.stateManager.select.cellPos;if(!this.table.editorManager.editingEditor||"Enter"!==t.key&&"Tab"!==t.key){if("Delete"===t.key){const e=this.table.getSelectedCellInfos();e?.length>0&&function(t,e){for(let i=0;i<t.length;i++)for(let s=0;s<t[i].length;s++)e.changeCellValue(t[i][s].col,t[i][s].row,"")}(e,this.table),t.stopPropagation(),t.preventDefault()}}else this.table.editorManager.completeEdit(),this.table.getElement().focus(),"Enter"===t.key?this.table.selectCell(e,i+1):"Tab"===t.key&&this.table.selectCell(e+1,i),t.stopPropagation(),t.preventDefault()}}isExcelShortcutKey(t){return"Enter"===t.key||"Tab"===t.key||"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowDown"===t.key||"ArrowUp"===t.key}release(){document.removeEventListener("keydown",this.handleKeyDown,!0)}},t.FocusHighlightPlugin=class{id="focus-highlight";name="Focus Highlight";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED,e.TABLE_EVENT_TYPE.SELECTED_CELL,e.TABLE_EVENT_TYPE.SELECTED_CLEAR];table;range;pluginOptions;constructor(t={fill:"#000",opacity:.5,highlightRange:void 0}){this.pluginOptions=Object.assign({fill:"#000",opacity:.5},t)}run(...t){if(this.table||(this.table=t[2]),t[1]===e.TABLE_EVENT_TYPE.INITIALIZED)this.pluginOptions.highlightRange&&this.setFocusHighlightRange(this.pluginOptions.highlightRange);else if(t[1]===e.TABLE_EVENT_TYPE.SELECTED_CELL){const t=this.table.stateManager.select.cellPos;if(this.table.isHeader(t.col,t.row))this.setFocusHighlightRange(void 0);else{const t=this.table.stateManager.select.ranges,e=0,i=this.table.colCount-1,s=Math.min(t[0].start.row,t[0].end.row),n=Math.max(t[0].start.row,t[0].end.row);this.setFocusHighlightRange({start:{col:e,row:s},end:{col:i,row:n}})}}else t[1]===e.TABLE_EVENT_TYPE.SELECTED_CLEAR&&this.setFocusHighlightRange(void 0)}setFocusHighlightRange(t){let e;t&&"start"in t&&"end"in t?e=t:t&&(e={start:t,end:t}),un(this.range,e)||(this.range=e,t?this.updateCellGroupShadow():this.deleteAllCellGroupShadow(),this.table.scenegraph.updateNextFrame())}deleteAllCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup)}updateCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup,this.range)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.range,this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup,this.range)}updateCellGroupShadowInContainer(t,e){let i;e&&"start"in e&&"end"in e?i=e:e&&(i={start:e,end:e}),t.forEachChildrenSkipChild((t=>{const e=t;"column"===e.role&&e.forEachChildrenSkipChild((t=>{const e=t;if("cell"!==e.role)return;e.attachShadow(e.shadowRoot);const s=e.shadowRoot;if(i){if(pn(i,e.col,e.row))s.removeAllChild();else if(!s.firstChild){const t=dn({x:0,y:0,width:e.attribute.width,height:e.attribute.height,fill:this.pluginOptions.fill,opacity:this.pluginOptions.opacity});t.name="shadow-rect",s.appendChild(t)}}else s.removeAllChild()}))}))}},t.HeaderHighlightPlugin=class{table;options;colHeaderRange;rowHeaderRange;constructor(t,e){this.table=t,this.options=e,this.registerStyle(),this.bindEvent()}registerStyle(){this.table.registerCustomCellStyle("col-highlight",{bgColor:this.options?.colHighlightBGColor??"#82b2f5",color:this.options?.colHighlightColor??"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:this.options?.rowHighlightBGColor??"#82b2f5",color:this.options?.rowHighlightColor??"#FFF"})}bindEvent(){this.table.on("selected_cell",(()=>{this.updateHighlight()})),this.table.on("selected_clear",(()=>{this.clearHighlight()})),this.table.on("mousemove_table",(()=>{this.table.stateManager.select.selecting&&this.updateHighlight()}))}clearHighlight(){this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0,!0),this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0,!0),this.colHeaderRange=void 0,this.rowHeaderRange=void 0}updateHighlight(){if(!1===this.options?.colHighlight&&!1===this.options?.rowHighlight)return;const t=this.table.getSelectedCellRanges();if(0===t.length)return void this.clearHighlight();const e=t[0],i=[e.start.row,e.end.row];i.sort(((t,e)=>t-e));const s=[e.start.col,e.end.col];let n,o;s.sort(((t,e)=>t-e)),this.table.isPivotTable()?(n={start:{col:s[0],row:0},end:{col:s[1],row:this.table.columnHeaderLevelCount-1}},o={start:{col:0,row:i[0]},end:{col:this.table.rowHeaderLevelCount-1,row:i[1]}}):this.table.internalProps.transpose?o={start:{col:0,row:i[0]},end:{col:this.table.rowHeaderLevelCount-1,row:i[1]}}:(n={start:{col:s[0],row:0},end:{col:s[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(o={start:{col:0,row:i[0]},end:{col:0,row:i[1]}})),!1===this.options?.colHighlight||gn(this.colHeaderRange,n)||(this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),n&&this.table.arrangeCustomCellStyle({range:n},"col-highlight"),this.colHeaderRange=n),!1===this.options?.rowHighlight||gn(this.rowHeaderRange,o)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),o&&this.table.arrangeCustomCellStyle({range:o},"row-highlight"),this.rowHeaderRange=o)}},t.HighlightHeaderWhenSelectCellPlugin=class{id="highlight-header-when-select-cell";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED,e.TABLE_EVENT_TYPE.SELECTED_CLEAR,e.TABLE_EVENT_TYPE.SELECTED_CELL,e.TABLE_EVENT_TYPE.MOUSEMOVE_TABLE];table;pluginOptions;colHeaderRanges=[];rowHeaderRanges=[];constructor(t){this.pluginOptions=t}run(...t){const i=t[1],s=t[2];this.table=s,i===e.TABLE_EVENT_TYPE.SELECTED_CLEAR?this.clearHighlight():i===e.TABLE_EVENT_TYPE.SELECTED_CELL||i===e.TABLE_EVENT_TYPE.MOUSEMOVE_TABLE?this.updateHighlight():i===e.TABLE_EVENT_TYPE.INITIALIZED&&this.registerStyle()}registerStyle(){this.table.registerCustomCellStyle("col-highlight",{bgColor:this.pluginOptions?.colHighlightBGColor??"#82b2f5",color:this.pluginOptions?.colHighlightColor??"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:this.pluginOptions?.rowHighlightBGColor??"#82b2f5",color:this.pluginOptions?.rowHighlightColor??"yellow"})}clearHighlight(){this.colHeaderRanges&&this.colHeaderRanges.forEach((t=>{this.table.arrangeCustomCellStyle({range:t},void 0)})),this.rowHeaderRanges&&this.rowHeaderRanges.forEach((t=>{this.table.arrangeCustomCellStyle({range:t},void 0)})),this.colHeaderRanges=[],this.rowHeaderRanges=[]}updateHighlight(){if(!1===this.pluginOptions?.colHighlight&&!1===this.pluginOptions?.rowHighlight)return;const t=this.table.getSelectedCellRanges();t.length<2&&this.clearHighlight();for(let e=0;e<t.length;e++){const i=t[e],s=[i.start.row,i.end.row];s.sort(((t,e)=>t-e));const n=[i.start.col,i.end.col];let o,r;n.sort(((t,e)=>t-e)),this.table.isPivotTable()?(o={start:{col:n[0],row:0},end:{col:n[1],row:this.table.columnHeaderLevelCount-1}},r={start:{col:0,row:s[0]},end:{col:this.table.rowHeaderLevelCount-1,row:s[1]}}):this.table.internalProps.transpose?r={start:{col:0,row:s[0]},end:{col:this.table.rowHeaderLevelCount-1,row:s[1]}}:(o={start:{col:n[0],row:0},end:{col:n[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(r={start:{col:0,row:s[0]},end:{col:0,row:s[1]}})),!1===this.pluginOptions?.colHighlight||this.colHeaderRanges.find((t=>fn(t,o)))||(o&&this.table.arrangeCustomCellStyle({range:o},"col-highlight"),this.colHeaderRanges.push(o)),!1===this.pluginOptions?.rowHighlight||this.rowHeaderRanges.find((t=>fn(t,r)))||(r&&this.table.arrangeCustomCellStyle({range:r},"row-highlight"),this.rowHeaderRanges.push(r))}}release(){this.rowHeaderRanges=[],this.colHeaderRanges=[]}},t.InvertHighlightPlugin=class{table;range;_fill;_opacity;constructor(t,e){this.table=t,this._fill=e?.fill??"#000",this._opacity=e?.opacity??.5}setInvertHighlightRange(t){un(this.range,t)||(this.range=t,t?this.updateCellGroupShadow():this.deleteAllCellGroupShadow(),this.table.scenegraph.updateNextFrame())}deleteAllCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup)}updateCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup,this.range)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.range,this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup,this.range)}updateCellGroupShadowInContainer(t,e){t.forEachChildrenSkipChild((t=>{const i=t;"column"===i.role&&i.forEachChildrenSkipChild((t=>{const i=t;if("cell"!==i.role)return;i.attachShadow(i.shadowRoot);const s=i.shadowRoot;if(e){if(pn(e,i.col,i.row))s.removeAllChild();else if(!s.firstChild){const t=dn({x:0,y:0,width:i.attribute.width,height:i.attribute.height,fill:this._fill,opacity:this._opacity});t.name="shadow-rect",s.appendChild(t)}}else s.removeAllChild()}))}))}},t.RowSeriesPlugin=class{id="row-series";runTime=[e.TABLE_EVENT_TYPE.BEFORE_INIT,e.TABLE_EVENT_TYPE.BEFORE_KEYDOWN];pluginOptions;table;constructor(t){this.pluginOptions=Object.assign({rowCount:100,autoExtendRow:!0},t)}run(...t){if(t[1]===e.TABLE_EVENT_TYPE.BEFORE_INIT){const e=t[0],i=t[2];this.table=i;const s=e.options,n=s.records??[];for(let t=n.length;t<this.pluginOptions.rowCount;t++)n.push(this.pluginOptions.fillRowRecord?this.pluginOptions.fillRowRecord(t):{});s.records=n,this.pluginOptions.rowSeriesNumber?(s.rowSeriesNumber=this.pluginOptions.rowSeriesNumber,this.pluginOptions.rowSeriesNumber.width||(s.rowSeriesNumber.width="auto")):s.rowSeriesNumber||(s.rowSeriesNumber={width:"auto"})}else if(t[1]===e.TABLE_EVENT_TYPE.BEFORE_KEYDOWN){"ArrowDown"===t[0].event.key&&this.pluginOptions.autoExtendRow&&this.table.stateManager.select.cellPos.row===this.table.rowCount-1&&this.table.addRecord(this.pluginOptions.fillRowRecord?this.pluginOptions.fillRowRecord(this.table.rowCount-this.table.columnHeaderLevelCount):{})}}},t.TableCarouselAnimationPlugin=class{id="table-carousel-animation";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED];table;rowCount;colCount;animationDuration;animationDelay;animationEasing;playing;row;col;willUpdateRow=!1;willUpdateCol=!1;autoPlay;autoPlayDelay;customDistRowFunction;customDistColFunction;constructor(t={}){this.rowCount=t?.rowCount??void 0,this.colCount=t?.colCount??void 0,this.animationDuration=t?.animationDuration??500,this.animationDelay=t?.animationDelay??1e3,this.animationEasing=t?.animationEasing??"linear",this.autoPlay=t?.autoPlay??!1,this.autoPlayDelay=t?.autoPlayDelay??0,this.customDistColFunction=t.customDistColFunction,this.customDistRowFunction=t.customDistRowFunction}run(...t){this.table||(this.table=t[2]),this.reset(),this.autoPlay&&setTimeout((()=>{this.play()}),this.autoPlayDelay)}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}play(){if(!this.table)throw new Error("table is not initialized");this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistRowFunction&&this.customDistRowFunction(this.row,this.table);e?(this.row=e.distRow,t=e.animation??!0):mn(this.row)&&this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):mn(this.row)||this.table.scenegraph.proxy.screenTopRow===Math.floor(this.row)?this.row+=this.rowCount:(this.row=this.table.frozenRowCount,t=!1),this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout((()=>{this.willUpdateRow=!1,this.updateRow()}),this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistColFunction&&this.customDistColFunction(this.col,this.table);e?(this.col=e.distCol,t=e.animation??!0):mn(this.col)&&this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):mn(this.col)||this.table.scenegraph.proxy.screenLeftCol===Math.floor(this.col)?this.col+=this.colCount:(this.col=this.table.frozenColCount,t=!1),this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout((()=>{this.willUpdateCol=!1,this.updateCol()}),this.animationDuration+this.animationDelay)}release(){}}}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vtable")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VTable=t.VTable||{},t.VTable.plugins={}),t.VTable)}(this,(function(t,e){"use strict";function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var s,n=i(e);function o(t){return Math.floor(t)===t}class r{static GenAutoIncrementId(){return r.auto_increment_id++}}function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}r.auto_increment_id=0,function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(s||(s={}));var h={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,s,o,r){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new n(s,o||t,r),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function r(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,o=s.length,r=new Array(o);n<o;n++)r[n]=s[n].fn;return r},a.prototype.listenerCount=function(t){var e=i?i+t:t,s=this._events[e];return s?s.fn?1:s.length:0},a.prototype.emit=function(t,e,s,n,o,r){var a=i?i+t:t;if(!this._events[a])return!1;var h,l,d=this._events[a],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(t,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,e),!0;case 3:return d.fn.call(d.context,e,s),!0;case 4:return d.fn.call(d.context,e,s,n),!0;case 5:return d.fn.call(d.context,e,s,n,o),!0;case 6:return d.fn.call(d.context,e,s,n,o,r),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];d.fn.apply(d.context,h)}else{var c,p=d.length;for(l=0;l<p;l++)switch(d[l].once&&this.removeListener(t,d[l].fn,void 0,!0),u){case 1:d[l].fn.call(d[l].context);break;case 2:d[l].fn.call(d[l].context,e);break;case 3:d[l].fn.call(d[l].context,e,s);break;case 4:d[l].fn.call(d[l].context,e,s,n);break;default:if(!h)for(c=1,h=new Array(u-1);c<u;c++)h[c-1]=arguments[c];d[l].fn.apply(d[l].context,h)}}return!0},a.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,s,n){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return r(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||n&&!a.once||s&&a.context!==s||r(this,o);else{for(var h=0,l=[],d=a.length;h<d;h++)(a[h].fn!==e||n&&!a[h].once||s&&a[h].context!==s)&&l.push(a[h]);l.length?this._events[o]=1===l.length?l[0]:l:r(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&r(this,e)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(h);var l=a(h.exports);var d=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var u=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||d(t,"Boolean")};var c=t=>"function"==typeof t;var p=t=>null==t;var g=t=>null!=t;var f=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var m=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||d(t,"String")};var _=t=>Array.isArray?Array.isArray(t):d(t,"Array");var y=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||d(t,"Number")};var b=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var A=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);const w=Object.prototype.hasOwnProperty;var v=(t,e)=>null!=t&&w.call(t,e);const x="undefined"!=typeof console;function C(t,e,i){const s=[e].concat([].slice.call(i));x&&console[t].apply(console,s)}var T;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(T||(T={}));class E{static getInstance(t,e){return E._instance&&y(t)?E._instance.level(t):E._instance||(E._instance=new E(t,e)),E._instance}static setInstance(t){return E._instance=t}static setInstanceLevel(t){E._instance?E._instance.level(t):E._instance=new E(t)}static clearInstance(){E._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=T.Info}canLogDebug(){return this._level>=T.Debug}canLogError(){return this._level>=T.Error}canLogWarn(){return this._level>=T.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];return this._level>=T.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):C(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=T.Warn&&C(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=T.Info&&C(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=T.Debug&&C(this._method||"log","DEBUG",e),this}}E._instance=null;var L=function(t,e,i){return t<e?e:t>i?i:t};const S=Math.PI,P=S/2,M=2*S,O=2*Math.PI,R=Math.abs,B=Math.atan2,I=Math.cos,D=Math.max,F=Math.min,N=Math.sin,k=Math.sqrt,U=Math.pow;class H{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=s}clone(){return new H(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return y(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return y(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class G{static distancePP(t,e){return k(U(t.x-e.x,2)+U(t.y-e.y,2))}static distanceNN(t,e,i,s){return k(U(t-i,2)+U(e-s,2))}static distancePN(t,e,i){return k(U(e-t.x,2)+U(i-t.y,2))}static pointAtPP(t,e,i){return new H((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function z(t){return t*(Math.PI/180)}var j;function Y(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function X(t,e){let{x:i,y:s}=t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-n.x)*Math.cos(e)-(s-n.y)*Math.sin(e)+n.x,y:(i-n.x)*Math.sin(e)+(s-n.y)*Math.cos(e)+n.y}}function $(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function V(t,e){const i=e?z(t.angle):t.angle,s=$(t);return[X({x:t.x1,y:t.y1},i,s),X({x:t.x2,y:t.y1},i,s),X({x:t.x2,y:t.y2},i,s),X({x:t.x1,y:t.y2},i,s)]}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(j||(j={}));class W{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new W(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=s,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),s<e?(this.y2=e,this.y1=s):(this.y1=e,this.y2=s),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return _(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const s=this.rotatedPoints(t,e,i);return this.clear().add(s[0],s[1]).add(s[2],s[3]).add(s[4],s[5]).add(s[6],s[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const n=this.scalePoints(t,e,i,s);return this.clear().add(n[0],n[1]).add(n[2],n[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return function(t,e,i){const{x1:s,y1:n,x2:o,y2:r}=e;i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f)):(t.clear(),t.add(i.a*s+i.c*n+i.e,i.b*s+i.d*n+i.f),t.add(i.a*o+i.c*n+i.e,i.b*o+i.d*n+i.f),t.add(i.a*o+i.c*r+i.e,i.b*o+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f))}(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:s,y1:n,x2:o,y2:r}=this,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,d=i-e*h-i*a;return[a*s-h*n+l,h*s+a*n+d,a*s-h*r+l,h*s+a*r+d,a*o-h*n+l,h*o+a*n+d,a*o-h*r+l,h*o+a*r+d]}scalePoints(t,e,i,s){const{x1:n,y1:o,x2:r,y2:a}=this;return[t*n+(1-t)*i,e*o+(1-e)*s,t*r+(1-t)*i,e*a+(1-e)*s]}}class q extends W{}class K extends W{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var i;super(t),t&&(this.angle=null!==(i=t.angle)&&void 0!==i?i:e)}intersects(t){return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=V(t,i),n=V(e,i),o=(t,e)=>[e.x-t.x,e.y-t.y],r=o($(t),$(e)),a=o(s[0],s[1]),h=o(s[1],s[2]),l=o(n[0],n[1]),d=o(n[1],n[2]),u=i?z(t.angle):t.angle;let c=i?z(90-t.angle):t.angle+P;const p=i?z(e.angle):e.angle;let g=i?z(90-e.angle):e.angle+P;c>O&&(c-=O),g>O&&(g-=O);const f=(t,e,i,s)=>{const n=[Math.cos(e),Math.sin(e)];return t+(Y(n,i)+Y(n,s))/2>Y(n,r)};return f((t.x2-t.x1)/2,u,l,d)&&f((t.y2-t.y1)/2,c,l,d)&&f((e.x2-e.x1)/2,p,a,h)&&f((e.y2-e.y1)/2,g,a,h)}(this,t)}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,i,s),this.angle=n,this}clone(){return new K(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[X({x:this.x1,y:this.y1},this.angle,t),X({x:this.x2,y:this.y1},this.angle,t),X({x:this.x1,y:this.y2},this.angle,t),X({x:this.x2,y:this.y2},this.angle,t)]}}class Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=o}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,s,n,o){return!(this.e!==n||this.f!==o||this.a!==t||this.d!==s||this.b!==e||this.c!==i)}setValue(t,e,i,s,n,o){return this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=o,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,s=this.d,n=this.e,o=this.f,r=new Z,a=t*s-e*i;return r.a=s/a,r.b=-e/a,r.c=-i/a,r.d=t/a,r.e=(i*o-s*n)/a,r.f=-(t*o-e*n)/a,r}rotate(t){const e=Math.cos(t),i=Math.sin(t),s=this.a*e+this.c*i,n=this.b*e+this.d*i,o=this.a*-i+this.c*e,r=this.b*-i+this.d*e;return this.a=s,this.b=n,this.c=o,this.d=r,this}rotateByCenter(t,e,i){const s=Math.cos(t),n=Math.sin(t),o=(1-s)*e+n*i,r=(1-s)*i-n*e,a=s*this.a-n*this.b,h=n*this.a+s*this.b,l=s*this.c-n*this.d,d=n*this.c+s*this.d,u=s*this.e-n*this.f+o,c=n*this.e+s*this.f+r;return this.a=a,this.b=h,this.c=l,this.d=d,this.e=u,this.f=c,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,s,n,o){return this.multiply(t,e,i,s,n,o),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:s,e:n,f:o}=this;return this.a=e,this.b=t,this.c=s,this.d=i,this.e=o,this.f=n,this}multiply(t,e,i,s,n,o){const r=this.a,a=this.b,h=this.c,l=this.d,d=r*t+h*e,u=a*t+l*e,c=r*i+h*s,p=a*i+l*s,g=r*n+h*o+this.e,f=a*n+l*o+this.f;return this.a=d,this.b=u,this.c=c,this.d=p,this.e=g,this.f=f,this}interpolate(t,e){const i=new Z;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:s,c:n,d:o,e:r,f:a}=this,h=i*o-s*n,l=o/h,d=-s/h,u=-n/h,c=i/h,p=(n*a-o*r)/h,g=-(i*a-s*r)/h,{x:f,y:m}=t;e.x=f*l+m*u+p,e.y=f*d+m*c+g}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Z(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,s=this.d,n=t*s-e*i,o={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const r=Math.sqrt(t*t+e*e);o.rotateDeg=e>0?Math.acos(t/r):-Math.acos(t/r),o.scaleX=r,o.scaleY=n/r,o.skewX=(t*i+e*s)/n,o.skewY=0}else if(0!==i||0!==s){const r=Math.sqrt(i*i+s*s);o.rotateDeg=Math.PI/2-(s>0?Math.acos(-i/r):-Math.acos(i/r)),o.scaleX=n/r,o.scaleY=r,o.skewX=0,o.skewY=(t*i+e*s)/n}return o.rotateDeg=180*o.rotateDeg/Math.PI,o}}function Q(t,e,i){e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,n=s*(1-Math.abs(t/60%2-1)),o=i-s/2;let r=0,a=0,h=0;return 0<=t&&t<60?(r=s,a=n,h=0):60<=t&&t<120?(r=n,a=s,h=0):120<=t&&t<180?(r=0,a=s,h=n):180<=t&&t<240?(r=0,a=n,h=s):240<=t&&t<300?(r=n,a=0,h=s):300<=t&&t<360&&(r=s,a=0,h=n),r=Math.round(255*(r+o)),a=Math.round(255*(a+o)),h=Math.round(255*(h+o)),{r:r,g:a,b:h}}function J(t,e,i){t/=255,e/=255,i/=255;const s=Math.min(t,e,i),n=Math.max(t,e,i),o=n-s;let r=0,a=0,h=0;return r=0===o?0:n===t?(e-i)/o%6:n===e?(i-t)/o+2:(t-e)/o+4,r=Math.round(60*r),r<0&&(r+=360),h=(n+s)/2,a=0===o?0:o/(1-Math.abs(2*h-1)),a=+(100*a).toFixed(1),h=+(100*h).toFixed(1),{h:r,s:a,l:h}}const tt=/^#([0-9a-f]{3,8})$/,et={transparent:4294967040},it={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function st(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function nt(t){return y(t)?new lt(t>>16,t>>8&255,255&t,1):_(t)?new lt(t[0],t[1],t[2]):new lt(255,255,255)}function ot(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function rt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const at=(t,e)=>{const i=tt.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new lt((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?nt(t):8===e?new lt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class ht{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new ht(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new ht(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof ht?t:new ht(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3();case"wcag":return i.getLuminanceWCAG()}}static parseColorString(t){if(g(et[t]))return function(t){return y(t)?new lt(t>>>24,t>>>16&255,t>>>8&255,255&t):_(t)?new lt(t[0],t[1],t[2],t[3]):new lt(255,255,255,1)}(et[t]);if(g(it[t]))return nt(it[t]);const e=`${t}`.trim().toLowerCase(),i=at(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new lt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Q(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new lt(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=ht.parseColorString(t);this.color=e||new lt(255,255,255)}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t))),this}add(t){const{r:e,g:i,b:s}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,s+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const s=this.color.opacity,n=J(this.color.r,this.color.g,this.color.b),o=Q(p(t)?n.h:L(t,0,360),p(e)?n.s:e>=0&&e<=1?100*e:e,p(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new lt(o.r,o.g,o.b,s),this}setRGB(t,e,i){return!p(t)&&(this.color.r=t),!p(e)&&(this.color.g=e),!p(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=at(e,!0);return null!=i?i:this}setColorName(t){const e=it[t.toLowerCase()];return void 0!==e&&this.setHex(e),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,i=this.color.b/255;let s,n,o;return s=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),n=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),o=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*n+.0722*o}clone(){return new ht(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=ot(t.color.r),this.color.g=ot(t.color.g),this.color.b=ot(t.color.b),this}copyLinearToSRGB(t){return this.color.r=rt(t.color.r),this.color.g=rt(t.color.g),this.color.b=rt(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class lt{constructor(t,e,i,s){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),g(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}formatHex(){return`#${st(this.r)+st(this.g)+st(this.b)+(1===this.opacity?"":st(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:s}=J(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${s}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const dt=M-1e-8;class ut{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,o){if(Math.abs(n-s)>dt)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let r,a,h,l,d=1/0,u=-1/0,c=1/0,p=-1/0;function g(t){h=i*Math.cos(t),l=i*Math.sin(t),h<d&&(d=h),h>u&&(u=h),l<c&&(c=l),l>p&&(p=l)}if(g(s),g(n),n!==s)if((s%=M)<0&&(s+=M),(n%=M)<0&&(n+=M),n<s&&(o=!o,r=s,s=n,n=r),o)for(n-=M,r=s-s%P,a=0;a<4&&r>n;++a,r-=P)g(r);else for(r=s-s%P+P,a=0;a<4&&r<n;++a,r+=P)g(r);this.bounds.add(t+d,e+c),this.bounds.add(t+u,e+p)}arcTo(t,e,i,s,n){this.bounds.add(t,e)}bezierCurveTo(t,e,i,s,n,o){this.bounds.add(t,e),this.bounds.add(i,s),this.bounds.add(n,o)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,s){this.bounds.add(t,e),this.bounds.add(i,s)}rect(t,e,i,s){this.bounds.add(t,e),this.bounds.add(t+i,e+s)}clear(){this.bounds.clear()}release(){}}class ct{constructor(){this._curves=[],this.bounds=new q}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const pt=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,gt={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},ft=0,mt=1,_t=2,yt=3,bt=4,At=5,wt=6,vt=7,xt=8;let Ct,Tt,Et,Lt,St,Pt;var Mt,Ot,Rt,Bt,It,Dt,Ft,Nt,kt;function Ut(t){const e=t[0],i=t[1],s=t[2],n=t[3],o=t[4],r=t[5],a=t[6],h=t[7],l=h*o,d=-a*r,u=a*o,c=h*r,p=Math.cos(s),g=Math.sin(s),f=Math.cos(n),m=Math.sin(n),_=.5*(n-s),y=Math.sin(.5*_),b=8/3*y*y/Math.sin(_),A=e+p-b*g,w=i+g+b*p,v=e+f,x=i+m,C=v+b*m,T=x-b*f;return[l*A+d*w,u*A+c*w,l*C+d*T,u*C+c*T,l*v+d*x,u*v+c*x]}function Ht(t,e,i,s){const n=function(t,e,i,s,n,o,r,a,h){const l=z(r),d=Math.sin(l),u=Math.cos(l),c=u*(a-t)*.5+d*(h-e)*.5,p=u*(h-e)*.5-d*(a-t)*.5;let g=c*c/((i=Math.abs(i))*i)+p*p/((s=Math.abs(s))*s);g>1&&(g=Math.sqrt(g),i*=g,s*=g);const f=u/i,m=d/i,_=-d/s,y=u/s,b=f*a+m*h,A=_*a+y*h,w=f*t+m*e,v=_*t+y*e;let x=1/((w-b)*(w-b)+(v-A)*(v-A))-.25;x<0&&(x=0);let C=Math.sqrt(x);o===n&&(C=-C);const T=.5*(b+w)-C*(v-A),E=.5*(A+v)+C*(w-b),L=Math.atan2(A-E,b-T);let S=Math.atan2(v-E,w-T)-L;S<0&&1===o?S+=M:S>0&&0===o&&(S-=M);const O=Math.ceil(Math.abs(S/(P+.001))),R=[];for(let t=0;t<O;++t){const e=L+t*S/O,n=L+(t+1)*S/O;R[t]=[T,E,e,n,i,s,d,u]}return R}(s[5],s[6],s[0],s[1],s[3],s[4],s[2],e,i);for(let e=0;e<n.length;++e){const i=Ut(n[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(Mt||(Mt={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(Ot||(Ot={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(Rt||(Rt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Bt||(Bt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(It||(It={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Dt||(Dt={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Ft||(Ft={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Nt||(Nt={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(kt||(kt={}));const Gt=[(t,e,i,s,n,o,r)=>e.arc(t[1]*n+i,t[2]*o+s,t[3]*(n+o)/2,t[4],t[5],t[6],r),(t,e,i,s,n,o,r)=>e.arcTo(t[1]*n+i,t[2]*o+s,t[3]*n+i,t[4]*o+s,t[5]*(n+o)/2,r),(t,e,i,s,n,o,r)=>e.bezierCurveTo(t[1]*n+i,t[2]*o+s,t[3]*n+i,t[4]*o+s,t[5]*n+i,t[6]*o+s,r),(t,e,i,s)=>e.closePath(),(t,e,i,s,n,o)=>e.ellipse(t[1]*n+i,t[2]*o+s,t[3]*n,t[4]*o,t[5],t[6],t[7],t[8]),(t,e,i,s,n,o,r)=>e.lineTo(t[1]*n+i,t[2]*o+s,r),(t,e,i,s,n,o,r)=>e.moveTo(t[1]*n+i,t[2]*o+s,r),(t,e,i,s,n,o,r)=>e.quadraticCurveTo(t[1]*n+i,t[2]*o+s,t[3]*n+i,t[4]*o+s,r),(t,e,i,s,n,o,r)=>e.rect(t[1]*n+i,t[2]*o+s,t[3]*n,t[4]*o,r)];function zt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,r=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const h=t[a];Gt[h[0]](h,e,i,s,n,o,r)}}class jt{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Yt(t,e){let i=0;const s=t.length;for(let n=0;n<s;n++){const o=t[n],r=e[n],a=t[(n+1)%s],h=e[(n+1)%s];i+=G.distanceNN(o,r,a,h)}return i/2}function Xt(t,e,i,s,n){const o=1-n;return o*o*o*t+3*e*n*o*o+3*i*n*n*o+s*n*n*n}function $t(t,e,i,s,n){const o=Xt(t.x,e.x,i.x,s.x,n),r=Xt(t.y,e.y,i.y,s.y,n);return new H(o,r)}function Vt(t,e,i,s){const n=1-s;return n*n*t+2*n*s*e+s*s*i}function Wt(t,e,i,s){const n=Vt(t.x,e.x,i.x,s),o=Vt(t.y,e.y,i.y,s);return new H(n,o)}class qt extends jt{constructor(t,e,i){super(),this.type=Nt.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return Wt(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,Yt([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===Ft.ROW?R(this.p0.x-this.p2.x):t===Ft.COLUMN?R(this.p0.y-this.p2.y):0}getAngleAt(t){const e=D(t-.01,0),i=F(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return B(n.y-s.y,n.x-s.x)}draw(t,e,i,s,n,o){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),o>=1)t.quadraticCurveTo(this.p1.x*s+e,this.p1.y*n+i,this.p2.x*s+e,this.p2.y*n+i);else if(o>0){const[r]=function(t,e){const{p0:i,p1:s,p2:n}=t,o=Wt(i,s,n,e),r=G.pointAtPP(i,s,e),a=G.pointAtPP(s,n,e);return[new qt(i,r,o),new qt(o,a,n)]}(this,o);t.quadraticCurveTo(r.p1.x*s+e,r.p1.y*n+i,r.p2.x*s+e,r.p2.y*n+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class Kt extends jt{constructor(t,e,i,s){super(),this.type=Nt.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=s}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return $t(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,s=this.p3,Yt([t.x,e.x,i.x,s.x],[t.y,e.y,i.y,s.y])):60;var t,e,i,s}calcProjLength(t){return t===Ft.ROW?R(this.p0.x-this.p3.x):t===Ft.COLUMN?R(this.p0.y-this.p3.y):0}getAngleAt(t){const e=D(t-.01,0),i=F(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return B(n.y-s.y,n.x-s.x)}draw(t,e,i,s,n,o){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),o>=1)t.bezierCurveTo(this.p1.x*s+e,this.p1.y*n+i,this.p2.x*s+e,this.p2.y*n+i,this.p3.x*s+e,this.p3.y*n+i);else if(o>0){const[r]=function(t,e){const{p0:i,p1:s,p2:n,p3:o}=t,r=$t(i,s,n,o,e),a=G.pointAtPP(i,s,e),h=G.pointAtPP(s,n,e),l=G.pointAtPP(n,o,e),d=G.pointAtPP(a,h,e),u=G.pointAtPP(h,l,e);return[new Kt(i,a,d,r),new Kt(r,u,l,o)]}(this,o);t.bezierCurveTo(r.p1.x*s+e,r.p1.y*n+i,r.p2.x*s+e,r.p2.y*n+i,r.p3.x*s+e,r.p3.y*n+i)}}includeX(t){const e=F(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=D(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=F(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(D(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class Zt extends jt{constructor(t,e){super(),this.type=Nt.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return G.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=B(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?G.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Ft.ROW?R(this.p0.x-this.p1.x):t===Ft.COLUMN?R(this.p0.y-this.p1.y):0}draw(t,e,i,s,n,o){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),o>=1)t.lineTo(this.p1.x*s+e,this.p1.y*n+i);else if(o>0){const r=this.getPointAt(o);t.lineTo(r.x*s+e,r.y*n+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const s=(t-e.x)/(i.x-e.x);return e.y+s*(i.y-e.y)}return 1/0}}class Qt{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,s,n,o,r,a){const h=new Kt(new H(this._lastX,this._lastY),new H(t,e),new H(i,s),new H(n,o));h.originP1=this._lastOriginP,h.originP2=a,h.defined=r,this.curves.push(h),this._lastX=n,this._lastY=o,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,s){const n=this.addLinearCurve(t,e,i,this._lastOriginP,s);this.curves.push(n),this._lastX=t,this._lastY=e,this._lastOriginP=s}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,s){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,s,n){const o=new Zt(new H(this._lastX,this._lastY),new H(t,e));return o.originP1=s,o.originP2=n,o.defined=i,o}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Ft.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],s=null!==(e=i.p3)&&void 0!==e?e:i.p1;return R(t.p0.y-s.y)}if(t===Ft.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],s=null!==(i=e.p3)&&void 0!==i?i:e.p1;return R(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Jt extends Qt{bezierCurveTo(t,e,i,s,n,o,r,a){return super.bezierCurveTo(e,t,s,i,o,n,r,a)}lineTo(t,e,i,s){return super.lineTo(e,t,i,s)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function te(t,e){let i=!1;for(let s=0,n=e.length;s<=n;s++)s>=n===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[s])}function ee(t,e,i){const s=null!=e?e:R(i[i.length-1].x-i[0].x)>R(i[i.length-1].y-i[0].y)?Ft.ROW:Ft.COLUMN;return"monotoneY"===t?new Jt(t,s):new Qt(t,s)}class ie{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function se(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=ee("linear",i,t);return function(t,e){te(t,e)}(new ie(n,s),t),n}function ne(t,e,i,s,n){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,s,t.lastPoint1)}class oe{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&ne(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:ne(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function re(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return se(t,e);const n=ee("basis",i,t);return function(t,e){te(t,e)}(new oe(n,s),t),n}function ae(t){return t<0?-1:1}function he(t,e,i){const s=t._x1-t._x0,n=e-t._x1,o=(t._y1-t._y0)/(s||Number(n<0&&-0)),r=(i-t._y1)/(n||Number(s<0&&-0)),a=(o*n+r*s)/(s+n);return(ae(o)+ae(r))*Math.min(Math.abs(o),Math.abs(r),.5*Math.abs(a))||0}function le(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function de(t,e,i,s,n){const o=t._x0,r=t._y0,a=t._x1,h=t._y1,l=(a-o)/3;t.context.bezierCurveTo(o+l,r+l*e,a-l,h-l*i,a,h,s,t.lastPoint1)}class ue{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:de(this,this._t0,le(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,s=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,s,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,s,t);break;case 1:this._point=2;break;case 2:this._point=3,de(this,le(this,e=he(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:de(this,this._t0,e=he(this,i,s),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=s,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class ce extends ue{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function pe(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return se(t,e);const n=ee("monotoneX",i,t);return function(t,e){te(t,e)}(new ue(n,s),t),n}function ge(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return se(t,e);const n=ee("monotoneY",i,t);return function(t,e){te(t,e)}(new ce(n,s),t),n}let fe=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const s=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(s,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(s,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(s,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};class me extends fe{lineEnd(){this.context.closePath()}}function _e(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const o=new Qt("step",null!=s?s:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Ft.ROW:Ft.COLUMN);return ye(new fe(o,e,n),t),o}function ye(t,e){return te(t,e)}class be extends ie{lineEnd(){this.context.closePath()}}function Ae(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=ee("linear",i,t);return function(t,e){te(t,e)}(new be(n,s),t),n}function we(t,e,i,s,n){let o=t._x1,r=t._y1,a=t._x2,h=t._y2;if(t._l01_a>1e-12){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);o=(o*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,r=(r*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>1e-12){const s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,n=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*s+t._x1*t._l23_2a-e*t._l12_2a)/n,h=(h*s+t._y1*t._l23_2a-i*t._l12_2a)/n}t.context.bezierCurveTo(o,r,a,h,t._x2,t._y2,s,t.lastPoint1)}function ve(t,e){return function(i,s){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:o,startPoint:r}=n;if(i.length<2-Number(!!r))return null;if(i.length<3-Number(!!r))return se(i,n);const a=ee(t,o,i);return te(new e(a,s,r),i),a}}const xe=ve("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:we(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Ce=ve("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:we(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class Te{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new Zt(new H(this._lastX,this._lastY),new H(t,e))}quadraticCurveTo(t,e,i,s){const n=new qt(new H(this._lastX,this._lastY),new H(t,e),new H(i,s));this.path.addCurve(n),this._lastX=i,this._lastY=s}bezierCurveTo(t,e,i,s,n,o){const r=new Kt(new H(this._lastX,this._lastY),new H(t,e),new H(i,s),new H(n,o));this.path.addCurve(r),this._lastX=n,this._lastY=o}arcTo(t,e,i,s,n){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,s,n,o,r,a){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,s){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,s,n,o){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function Ee(t,e,i){var s,n;switch(e){case"linear":default:return se(t,i);case"basis":return re(t,i);case"monotoneX":return pe(t,i);case"monotoneY":return ge(t,i);case"step":return _e(t,.5,i);case"stepClosed":return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const o=new Qt("step",null!=s?s:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Ft.ROW:Ft.COLUMN);return ye(new me(o,e,n),t),o}(t,.5,i);case"stepBefore":return _e(t,0,i);case"stepAfter":return _e(t,1,i);case"catmullRom":return xe(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return Ce(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return Ae(t,i)}}class Le extends ct{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ut(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([wt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([At,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([vt,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,o){return this.commandList.push([_t,t,e,i,s,n,o]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,n,o),this}arcTo(t,e,i,s,n){return this.commandList.push([mt,t,e,i,s,n]),this._ctx&&this._ctx.arcTo(t,e,i,s,n),this}ellipse(t,e,i,s,n,o,r,a){return this.commandList.push([bt,t,e,i,s,n,o,r,a]),this._ctx&&this._ctx.ellipse(t,e,i,s,n,o,r,a),this}rect(t,e,i,s){return this.commandList.push([xt,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,n,o){return this.commandList.push([ft,t,e,i,s,n,o]),this._ctx&&this._ctx.arc(t,e,i,s,n,o),this}closePath(){return this.commandList.push([yt]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new Te(this);zt(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[wt]=t=>`M${t[1]} ${t[2]}`,t[At]=t=>`L${t[1]} ${t[2]}`,t[vt]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[_t]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[ft]=t=>{const e=[];((t,e,i,s,n,o,r)=>{const a=Math.abs(i-e),h=a>.5*Math.PI?Math.ceil(2*a/Math.PI):1,l=(i-e)/h;for(let i=0;i<h;i++){const a=e+l*i,h=e+l*(i+1),d=4*Math.tan(Math.abs(l)/4)/3,u=h<a?-1:1,c=Math.cos(a),p=Math.sin(a),g=Math.cos(h),f=Math.sin(h),m=c*o+s,_=p*r+n,y=g*o+s,b=f*r+n,A=o*d*u,w=r*d*u;t.push(m-A*p,_+w*c,y+A*f,b-w*g,y,b)}})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[xt]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[yt]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,s,n){this.clear();const o=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,s;const n=[];for(let t=0,o=e.length;t<o;t++)if(Ct=e[t],Tt=Ct.slice(1),Et=Ct[0],i=[Et],s=Tt.match(pt),null!==s){for(let t=0,e=s.length;t<e;t++)Lt=s[t],St=parseFloat(Lt),Number.isNaN(St)||i.push(St);if(Pt=gt[Et],i.length-1>Pt){let t,e=Et;for(let s=1,o=i.length;s<o;s+=Pt){t=[e];for(let e=s,n=s+Pt;e<n;e++)t.push(i[e]);n.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else n.push(i)}else n.push(i);return n}(t);return this._runCommandStrList(o,e,i,s,n),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:s}=t.attribute;if(!e)return;const n=Ee(e,i);"x"===s?this.direction=Ft.ROW:"y"===s?this.direction=Ft.COLUMN:"auto"===s&&(this.direction=n.direction),this._curves=n.curves}fromCustomPath2D(t,e,i,s,n){return this.clear(),this._runCommandList(t.commandList,e,i,s,n),this._updateBounds(),this}transform(t,e,i,s){const n=this.commandList;if(!this.transformCbList){const t=[];t[wt]=this.moveToTransform,t[At]=this.lineToTransform,t[vt]=this.quadraticCurveToTransform,t[_t]=this.bezierCurveToTransform,t[mt]=this.arcToTransform,t[bt]=this.ellipseTransform,t[xt]=this.rectTransform,t[ft]=this.arcTransform,t[yt]=this.closePathTransform,this.transformCbList=t}n.forEach((n=>{this.transformCbList[n[0]](n,t,e,i,s)})),this._updateBounds()}moveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*s+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*(s+n)/2}ellipseTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}rectTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}arcTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*(s+n)/2}closePathTransform(){}_runCommandStrList(t){let e,i,s,n,o,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,d=null,u=0,c=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(e=t[f],1===h&&1===l||(e=Pe(e,h,l)),e[0]){case"l":u+=e[1],c+=e[2],this.lineTo(u+r,c+a);break;case"L":u=e[1],c=e[2],this.lineTo(u+r,c+a);break;case"h":u+=e[1],this.lineTo(u+r,c+a);break;case"H":u=e[1],this.lineTo(u+r,c+a);break;case"v":c+=e[1],this.lineTo(u+r,c+a);break;case"V":c=e[1],this.lineTo(u+r,c+a);break;case"m":u+=e[1],c+=e[2],this.moveTo(u+r,c+a);break;case"M":u=e[1],c=e[2],this.moveTo(u+r,c+a);break;case"c":i=u+e[5],s=c+e[6],p=u+e[3],g=c+e[4],this.bezierCurveTo(u+e[1]+r,c+e[2]+a,p+r,g+a,i+r,s+a),u=i,c=s;break;case"C":u=e[5],c=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+r,e[2]+a,p+r,g+a,u+r,c+a);break;case"s":i=u+e[3],s=c+e[4],null===d[0].match(/[CcSs]/)?(p=u,g=c):(p=2*u-p,g=2*c-g),n=u+e[1],o=c+e[2],this.bezierCurveTo(p+r,g+a,n+r,o+a,i+r,s+a),p=n,g=o,u=i,c=s;break;case"S":i=e[3],s=e[4],null===d[0].match(/[CcSs]/)?(p=u,g=c):(p=2*u-p,g=2*c-g),n=e[1],o=e[2],this.bezierCurveTo(p+r,g+a,n+r,o+a,i+r,s+a),p=n,g=o,u=i,c=s;break;case"q":i=u+e[3],s=c+e[4],p=u+e[1],g=c+e[2],this.quadraticCurveTo(p+r,g+a,i+r,s+a),u=i,c=s;break;case"Q":i=e[3],s=e[4],this.quadraticCurveTo(e[1]+r,e[2]+a,i+r,s+a),u=i,c=s,p=e[1],g=e[2];break;case"t":i=u+e[1],s=c+e[2],null===d[0].match(/[QqTt]/)?(p=u,g=c):"t"===d[0]?(p=2*u-n,g=2*c-o):"q"===d[0]&&(p=2*u-p,g=2*c-g),n=p,o=g,this.quadraticCurveTo(p+r,g+a,i+r,s+a),u=i,c=s,p=u+e[1],g=c+e[2];break;case"T":i=e[1],s=e[2],p=2*u-p,g=2*c-g,this.quadraticCurveTo(p+r,g+a,i+r,s+a),u=i,c=s;break;case"a":Ht(this,u+r,c+a,[e[1],e[2],e[3],e[4],e[5],e[6]+u+r,e[7]+c+a]),u+=e[6],c+=e[7];break;case"A":Ht(this,u+r,c+a,[e[1],e[2],e[3],e[4],e[5],e[6]+r,e[7]+a]),u=e[6],c=e[7];break;case"z":case"Z":this.closePath()}d=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==s||1!==n)for(let o=0,r=t.length;o<r;++o){const r=t[o].slice();switch(r[0]){case At:this.lineToTransform(r,e,i,s,n);break;case wt:this.moveToTransform(r,e,i,s,n);break;case _t:this.bezierCurveToTransform(r,e,i,s,n);break;case vt:this.quadraticCurveToTransform(r,e,i,s,n);break;case ft:this.arcToTransform(r,e,i,s,n);break;case bt:this.ellipseTransform(r,e,i,s,n);break;case xt:this.rectTransform(r,e,i,s,n);break;case mt:this.arcToTransform(r,e,i,s,n);break;case yt:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),zt(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Ft.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return R(t.p0.y-e.p1.y)}if(this.direction===Ft.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return R(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let s=0;s<this._curves.length;s++){e=this._curves[s];const n=e.getLength(this.direction);if(i+n>=t)break;i+=n}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}drawWithClipRange(t,e,i,s,n){this.tryBuildCurves();const o=this.getLength()*n;let r=0;for(let n=0;n<this._curves.length;n++){const a=this._curves[n],h=a.getLength(this.direction);if(!(r+h<=o)){const n=1-(r+h-o)/h;a.draw(t,i,s,e,e,n);break}a.draw(t,i,s,e,e,1),r+=h}}}const Se=["l",0,0,0,0,0,0,0];function Pe(t,e,i){const s=Se[0]=t[0];if("a"===s||"A"===s)Se[1]=e*t[1],Se[2]=i*t[2],Se[3]=t[3],Se[4]=t[4],Se[5]=t[5],Se[6]=e*t[6],Se[7]=i*t[7];else if("h"===s||"H"===s)Se[1]=e*t[1];else if("v"===s||"V"===s)Se[1]=i*t[1];else for(let s=1,n=t.length;s<n;++s)Se[s]=(s%2==1?e:i)*t[s];return Se}const Me={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new Z},Oe={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Re=Object.assign({outerBorder:Object.assign(Object.assign({},Oe),{distance:0}),innerBorder:Object.assign(Object.assign({},Oe),{distance:0})},Oe),Be={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:s.fontBounding,keepCenterInLine:!1},Ie=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Re),{alignSelf:"auto"}),{pickStrokeBuffer:0}),De={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Fe=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null},{_debug_bounds:!1}),Ie),Me),Ne=Object.assign(Object.assign({},Fe),{startAngle:0,endAngle:O,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),ke=Object.assign(Object.assign(Object.assign({},Fe),De),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Ue=Object.assign(Object.assign({},Fe),{radius:1,startAngle:0,endAngle:O}),He=Object.assign(Object.assign({},Fe),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),Ge=Object.assign(Object.assign({},Fe),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),ze=Object.assign(Object.assign(Object.assign({},Fe),De),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),je=Object.assign(Object.assign({},Fe),{path:new Le,fillStrokeOrder:1,clipRange:1,customPath:()=>{E.getInstance().warn("空函数")}}),Ye=Object.assign(Object.assign({},Fe),{points:[],cornerRadius:0,closePath:!0}),Xe=Object.assign(Object.assign({},Fe),{width:100,height:100,spikes:5,thickness:.5}),$e=Object.assign(Object.assign({},Fe),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},Fe),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Ve=Object.assign(Object.assign({},Fe),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),We=Object.assign(Object.assign(Object.assign({},Fe),Be),{strokeBoundsBuffer:0,keepDirIn3d:!0}),qe=Object.assign(Object.assign(Object.assign({},Fe),Be),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Ke=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Fe),{fill:!0,cornerRadius:0,cornerType:"round"}),Ze=Object.assign(Object.assign({},Ke),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});const Qe=new class{},Je={arc:Ne,area:ke,circle:Ue,line:ze,path:je,symbol:Ve,text:We,rect:$e,polygon:Ye,star:Xe,richtext:qe,richtextIcon:Ze,image:Ke,group:He,glyph:Ge},ti=Object.keys(Je);function ei(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const ii={arc:Object.assign({},Je.arc),area:Object.assign({},Je.area),circle:Object.assign({},Je.circle),line:Object.assign({},Je.line),path:Object.assign({},Je.path),symbol:Object.assign({},Je.symbol),text:Object.assign({},Je.text),rect:Object.assign({},Je.rect),polygon:Object.assign({},Je.polygon),star:Object.assign({},Je.star),richtext:Object.assign({},Je.richtext),richtextIcon:Object.assign({},Je.richtextIcon),image:Object.assign({},Je.image),group:Object.assign({},Je.group),glyph:Object.assign({},Je.glyph)};const si=new class{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},ti.forEach((t=>{this._defaultTheme[t]=Object.create(ii[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||i)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,E.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;ti.forEach((s=>{const n=Object.create(ii[s]);t&&t[s]&&ei(n,t[s]),i[s]&&ei(n,i[s]),e[s]&&ei(n,e[s]),this.combinedTheme[s]=n})),e.common&&ti.forEach((t=>{ei(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}};function ni(t,e){return t.glyphHost?ni(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):si.getTheme()}return null}(t)||t.attachedThemeGraphic&&ni(t.attachedThemeGraphic)||si.getTheme()}var oi=function(t,e,i,s){return new(i||(i=Promise))((function(n,o){function r(t){try{h(s.next(t))}catch(t){o(t)}}function a(t){try{h(s.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,a)}h((s=s.apply(t,e||[])).next())}))};class ri extends l{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=r.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return oi(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&E.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const s=this.insertInto(t,0);return this._ignoreWarn=!1,s}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,s)=>!(e===this||!t(e,s)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.find(t,!0);if(s)return i=s,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,s)=>{e!==this&&t(e,s)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.findAll(t,!0);s.length&&(i=i.concat(s))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const s=u(i,!0)&&i||f(i)&&i.capture,n=f(i)&&i.once,o=c(e)?void 0:e;return t=s?`${t}capture`:t,e=c(e)?e:e.handleEvent,n?super.once(t,e,o):super.on(t,e,o),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const s=u(i,!0)&&i||f(i)&&i.capture,n=c(e)?void 0:e;t=s?`${t}capture`:t,e=c(e)?e:e.handleEvent;const o=f(i)&&i.once;return super.off(t,e,n,o),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return f(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class ai{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=ai.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&c(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&c(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class hi extends ai{constructor(t,e){super(),this.type=t,this.detail=e}}const li={dispatchEvent(t){var e;if(!(t instanceof ai))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new hi(t,e))}};class di{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-di.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*di.bounceIn(2*t):.5*di.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const s=e/O*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*O/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const s=e/O*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*O/e)+1}}static getElasticInOut(t,e){return function(i){const s=e/O*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*O/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*O/e)*.5+1}}static registerFunc(t,e){di[t]=e}}function ui(t,e){const i=1/e;let s=1;for(;t>i;)t-=i,s*=-1;const n=s*t/i;return n>0?n:1+n}di.quadIn=di.getPowIn(2),di.quadOut=di.getPowOut(2),di.quadInOut=di.getPowInOut(2),di.cubicIn=di.getPowIn(3),di.cubicOut=di.getPowOut(3),di.cubicInOut=di.getPowInOut(3),di.quartIn=di.getPowIn(4),di.quartOut=di.getPowOut(4),di.quartInOut=di.getPowInOut(4),di.quintIn=di.getPowIn(5),di.quintOut=di.getPowOut(5),di.quintInOut=di.getPowInOut(5),di.backIn=di.getBackIn(1.7),di.backOut=di.getBackOut(1.7),di.backInOut=di.getBackInOut(1.7),di.elasticIn=di.getElasticIn(1,.3),di.elasticOut=di.getElasticOut(1,.3),di.elasticInOut=di.getElasticInOut(1,.3*1.5),di.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),di.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},di.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)di[`flicker${t}`]=e=>ui(e,t);for(let t=2;t<10;t++)di[`aIn${t}`]=e=>t*e*e+(1-t)*e;const ci=new class{constructor(){this.id=r.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Bt.END?this.removeAnimate(e):e.status===Bt.RUNNING||e.status===Bt.INITIAL?(this.animateCount++,e.advance(t)):e.status===Bt.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}};class pi{constructor(t,e,i,s,n){this.from=t,this.to=e,this.duration=i,this.easing=s,this.params=n,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class gi extends pi{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class fi{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ci,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e||ci,this.status=Bt.INITIAL,this.tailAnimate=new mi(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=i}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=D(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){fi.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fi.mode;t&&e&It.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Rt.ANIMATE_PLAY})}runCb(t){const e=new gi((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,o){const r=fi.interpolateMap.get(t)||fi.interpolateMap.get("");return!!r&&r(t,e,i,s,n,o)}pause(){this.status===Bt.RUNNING&&(this.status=Bt.PAUSED)}resume(){this.status===Bt.PAUSED&&(this.status=Bt.RUNNING)}to(t,e,i,s){if(this.tailAnimate.to(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,s){if(this.tailAnimate.from(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new mi(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Bt.INITIAL&&(this.status=Bt.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Bt.RUNNING&&(this.status=Bt.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const s=this.rawPosition,n=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const o=t>=n;if(o&&(t=n),t===s)return o;for(let s=0;s<this.subAnimates.length&&(e=this.subAnimates[s],!(i+e.totalDuration>=t));s++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),o}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=Bt.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}fi.mode=It.NORMAL,fi.interpolateMap=new Map;class mi{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new _i(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,s="string"==typeof i?di[i]:i,n=this._addStep(e,null,s);return n.type=Dt.customAnimate,this._appendProps(t.getEndProps(),n,!1),this._appendCustomAnimate(t,n),this}to(t,e,i,s){(null==e||e<0)&&(e=0);const n="string"==typeof i?di[i]:i,o=this._addStep(e,null,n);return o.type=Dt.to,this._appendProps(t,o,!!s&&s.tempProps),o.propKeys||(o.propKeys=Object.keys(o.props)),s&&s.noPreventAttrs||this.target.animates&&this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(o.propKeys)})),this}from(t,e,i,s){this.to(t,0,i,s);const n={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{n[t]=this.getLastPropByName(t,this.stepTail)})),this.to(n,e,i,s),this.stepTail.type=Dt.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=Dt.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const s=new _i(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(s),this.stepTail=s,s}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let s=e.prev;const n=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));s.prev;)s.props&&(s.propKeys||(s.propKeys=Object.keys(s.props)),s.propKeys.forEach((t=>{void 0===n[t]&&(n[t]=s.props[t])}))),e.propKeys=Object.keys(e.props),s=s.prev;const o=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),e.propKeys.forEach((t=>{if(void 0===o[t]){const e=this.animate.getStartProps();o[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,s=this.loop,n=this.rawPosition;let o,r,a=!1;const h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0&&(a=!0,i<0))return a;if(o=Math.floor(t/i),r=t-o*i,a=t>=s*i+i,a&&(r=i,o=s,t=r*o+i),t===n)return a;const l=!this.reversed!=!(this.bounce&&o%2);return l&&(r=i-r),this._deltaPosition=r-this.position,this.position=r,this.rawPosition=t+h,this.updatePosition(a,l),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const s=this.position,n=this.duration;if(this.target&&i){let o=i.next;for(;o&&o.position<=s;)i=o,o=i.next;let r=t?0===n?1:s/n:(s-i.position)/i.duration;i.easing&&(r=i.easing(r)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,r,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,r)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return E.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class _i{constructor(t,e,i,s){this.duration=e,this.position=t,this.props=i,this.easing=s}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const yi=200,bi="cubicOut";var Ai;!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(Ai||(Ai={}));const wi=[0,0,0,0];var vi;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(vi||(vi={}));class xi{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vi.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===vi.Color1){const e=xi.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=ht.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];xi.store1[t]=e,xi.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const s=xi.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=ht.parseColorString(t);return n&&(xi.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],xi.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===vi.Color1){if(xi.store1[t])return;xi.store1[t]=i,xi.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(xi.store255[t])return;xi.store255[t]=i,xi.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Ci(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&y(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Ti(t,e,i,s,n){return Array.isArray(t)&&!y(t[0])||Array.isArray(e)&&!y(e[0])?new Array(4).fill(0).map(((n,o)=>Ei(_(t)?t[o]:t,_(e)?e[o]:e,i,s))):Ei(t,e,i,s,n)}function Ei(t,e,i,s,n){if(!t||!e)return t&&Ci(t)||e&&Ci(e)||!1;let o,r,a=!1,h=!1;if(Array.isArray(t)?o=t:"string"==typeof t?o=xi.Get(t,vi.Color255):a=!0,Array.isArray(e)?r=e:"string"==typeof e?r=xi.Get(e,vi.Color255):h=!0,a!==h){const o=a?t:e,r=a?e:t,h=Object.assign(Object.assign({},o),{stops:o.stops.map((t=>Object.assign(Object.assign({},t),{color:Ci(r)})))});return a?Ti(o,h,i,s,n):Ti(h,o,i,s,n)}if(a){if(t.gradient===e.gradient){const s=t,n=e,o=s.stops,r=n.stops;if(o.length!==r.length)return!1;if("linear"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Pi(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("radial"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Pi(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("conical"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Pi(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i)}return!1}return n&&n(o,r),Ci(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(o,r,i),s)}xi.store255={},xi.store1={};const Li=[0,0,0,0],Si=[0,0,0,0];function Pi(t,e,i){return xi.Get(t,vi.Color255,Li),xi.Get(e,vi.Color255,Si),`rgba(${Math.round(Li[0]+(Si[0]-Li[0])*i)},${Math.round(Li[1]+(Si[1]-Li[1])*i)},${Math.round(Li[2]+(Si[2]-Li[2])*i)},${Li[3]+(Si[3]-Li[3])*i})`}class Mi{static GetImage(t,e){var i;const s=Mi.cache.get(t);s?"fail"===s.loadState?Qe.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):Mi.loadImage(t,e)}static GetSvg(t,e){var i;let s=Mi.cache.get(t);s?"fail"===s.loadState?Qe.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):(s={type:"image",loadState:"init"},Mi.cache.set(t,s),s.dataPromise=Qe.global.loadSvg(t),s.dataPromise?(s.waitingMark=[e],s.dataPromise.then((e=>{var i;s.loadState=(null==e?void 0:e.data)?"success":"fail",s.data=null==e?void 0:e.data,null===(i=s.waitingMark)||void 0===i||i.map(((i,n)=>{(null==e?void 0:e.data)?(s.loadState="success",s.data=e.data,i.imageLoadSuccess(t,e.data)):(s.loadState="fail",i.imageLoadFail(t))})),s.waitingMark&&(s.waitingMark=[])}))):(s.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Mi.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Mi.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Qe.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Qe.global.loadBlob(t):"json"===e&&(i.dataPromise=Qe.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Mi.isLoading&&Mi.toLoadAueue.length){Mi.isLoading=!0;const t=Mi.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(Mi.cache.set(i,n),n.dataPromise=Qe.global.loadImage(i),n.dataPromise){n.waitingMark=s;const t=n.dataPromise.then((t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map(((e,s)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))})),n.waitingMark&&(n.waitingMark=[])}));e.push(t)}else n.loadState="fail",s.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Mi.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Mi.loading()})).catch((t=>{Mi.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Mi.loading()}))}}),0)}static loadImage(t,e){const i=Oi(t,Mi.toLoadAueue);if(-1!==i)return Mi.toLoadAueue[i].marks.push(e),void Mi.loading();Mi.toLoadAueue.push({url:t,marks:[e]}),Mi.loading()}static improveImageLoading(t){const e=Oi(t,Mi.toLoadAueue);if(-1!==e){const t=Mi.toLoadAueue.splice(e,1);Mi.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Oi(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Mi.cache=new Map,Mi.isLoading=!1,Mi.toLoadAueue=[],Mi.onLoadSuccessCb=[];class Ri{bounds(t,e){if(y(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}}function Bi(t,e,i,s,n){return n?t.arc(i,s,e,0,M,!1,n):t.arc(i,s,e,0,M),!1}var Ii=new class extends Ri{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,s,n){return Bi(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,o){return Bi(t,this.parseSize(e)/2+n,i,s,o)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}};var Di=new class extends Ri{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,s,n){return function(t,e,i,s,n){return t.moveTo(-3*e+i,-e+s,n),t.lineTo(-e+i,-e+s,n),t.lineTo(-e+i,-3*e+s,n),t.lineTo(e+i,-3*e+s,n),t.lineTo(e+i,-e+s,n),t.lineTo(3*e+i,-e+s,n),t.lineTo(3*e+i,e+s,n),t.lineTo(e+i,e+s,n),t.lineTo(e+i,3*e+s,n),t.lineTo(-e+i,3*e+s,n),t.lineTo(-e+i,e+s,n),t.lineTo(-3*e+i,e+s,n),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n)}drawOffset(t,e,i,s,n,o){return function(t,e,i,s,n,o){return t.moveTo(-3*e+i-n,-e+s-n,o),t.lineTo(-e+i-n,-e+s-n,o),t.lineTo(-e+i-n,-3*e+s-n,o),t.lineTo(e+i+n,-3*e+s-n,o),t.lineTo(e+i+n,-e+s-n,o),t.lineTo(3*e+i+n,-e+s-n,o),t.lineTo(3*e+i+n,e+s+n,o),t.lineTo(e+i+n,e+s+n,o),t.lineTo(e+i+n,3*e+s+n,o),t.lineTo(-e+i-n,3*e+s+n,o),t.lineTo(-e+i-n,e+s+n,o),t.lineTo(-3*e+i-n,e+s+n,o),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n,o)}};function Fi(t,e,i,s,n){return t.moveTo(i,s-e,n),t.lineTo(e+i,s,n),t.lineTo(i,s+e,n),t.lineTo(i-e,s,n),t.closePath(),!0}var Ni=new class extends Ri{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,s,n){return Fi(t,this.parseSize(e)/2,i,s,n)}drawFitDir(t,e,i,s,n){return Fi(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,o){return Fi(t,this.parseSize(e)/2+n,i,s,o)}};function ki(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}var Ui=new class extends Ri{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return ki(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return ki(t,this.parseSize(e)/2+n,i,s)}};function Hi(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*n,e+s+n),t.lineTo(i-e-2*n,e+s+n),t.lineTo(i,s-e-2*n),t.closePath(),!0}class Gi extends Ri{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,s){return Hi(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Hi(t,this.parseSize(e)/2,i,s,n)}}var zi=new Gi;var ji=new class extends Gi{constructor(){super(...arguments),this.type="triangle"}};const Yi=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Xi=Math.sin(M/10)*Yi,$i=-Math.cos(M/10)*Yi;function Vi(t,e,i,s){const n=Xi*e,o=$i*e;t.moveTo(i,-e+s),t.lineTo(n+i,o+s);for(let r=1;r<5;++r){const a=M*r/5,h=Math.cos(a),l=Math.sin(a);t.lineTo(l*e+i,-h*e+s),t.lineTo(h*n-l*o+i,l*n+h*o+s)}return t.closePath(),!0}var Wi=new class extends Ri{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,s){return Vi(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Vi(t,this.parseSize(e)/2+n,i,s)}};const qi=k(3);function Ki(t,e,i,s){const n=e,o=n/qi,r=o/5,a=e;return t.moveTo(0+i,-n+s),t.lineTo(o/2+i,s),t.lineTo(r/2+i,s),t.lineTo(r/2+i,a+s),t.lineTo(-r/2+i,a+s),t.lineTo(-r/2+i,s),t.lineTo(-o/2+i,s),t.closePath(),!0}var Zi=new class extends Ri{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,s){return Ki(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ki(t,this.parseSize(e)/2+n,i,s)}};function Qi(t,e,i,s){const n=2*e;return t.moveTo(i,-e+s),t.lineTo(n/3/2+i,e+s),t.lineTo(-n/3/2+i,e+s),t.closePath(),!0}var Ji=new class extends Ri{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return Qi(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Qi(t,this.parseSize(e)/2+n,i,s)}};function ts(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}var es=new class extends Ri{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return ts(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return ts(t,this.parseSize(e)/2+n,i,s)}};const is=-.5,ss=k(3)/2,ns=1/k(12);function os(t,e,i,s){const n=e/2,o=e*ns,r=n,a=e*ns+e,h=-r,l=a;return t.moveTo(n+i,o+s),t.lineTo(r+i,a+s),t.lineTo(h+i,l+s),t.lineTo(is*n-ss*o+i,ss*n+is*o+s),t.lineTo(is*r-ss*a+i,ss*r+is*a+s),t.lineTo(is*h-ss*l+i,ss*h+is*l+s),t.lineTo(is*n+ss*o+i,is*o-ss*n+s),t.lineTo(is*r+ss*a+i,is*a-ss*r+s),t.lineTo(is*h+ss*l+i,is*l-ss*h+s),t.closePath(),!1}var rs=new class extends Ri{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,s){return os(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return os(t,this.parseSize(e)/2+n,i,s)}};function as(t,e,i,s,n){return t.moveTo(-e+i-2*n,s),t.lineTo(e+i+n,e+s+2*n),t.lineTo(e+i+n,s-e-2*n),t.closePath(),!0}var hs=new class extends Ri{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,s){return as(t,this.parseSize(e)/2,i,s,0)}drawOffset(t,e,i,s,n){return as(t,this.parseSize(e)/2,i,s,n)}};function ls(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-n,e+s+2*n),t.lineTo(e+i+2*n,s),t.lineTo(i-e-n,s-e-2*n),t.closePath(),!0}var ds=new class extends Ri{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,s){return ls(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return ls(t,this.parseSize(e)/2,i,s,n)}};function us(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*n,s-e-n),t.lineTo(i+e+2*n,s-e-n),t.lineTo(i,s+e+2*n),t.closePath(),!0}var cs=new class extends Ri{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,s){return us(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return us(t,this.parseSize(e)/2,i,s,n)}};const ps=k(3);function gs(t,e,i,s){const n=e*ps;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}var fs=new class extends Ri{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return gs(t,this.parseSize(e)/2/ps,i,s)}drawOffset(t,e,i,s,n){return gs(t,this.parseSize(e)/2/ps+n,i,s)}};function ms(t,e,i,s){const n=2*e;return t.moveTo(e+i,s-n),t.lineTo(i-e,s),t.lineTo(e+i,n+s),!0}var _s=new class extends Ri{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,s){return ms(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return ms(t,this.parseSize(e)/4+n,i,s)}};function ys(t,e,i,s){const n=2*e;return t.moveTo(i-e,s-n),t.lineTo(i+e,s),t.lineTo(i-e,n+s),!0}var bs=new class extends Ri{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,s){return ys(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return ys(t,this.parseSize(e)/4+n,i,s)}};function As(t,e,i,s){const n=2*e;return t.moveTo(i-n,s+e),t.lineTo(i,s-e),t.lineTo(i+n,s+e),!0}var ws=new class extends Ri{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,s){return As(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return As(t,this.parseSize(e)/4+n,i,s)}};function vs(t,e,i,s){const n=2*e;return t.moveTo(i-n,s-e),t.lineTo(i,s+e),t.lineTo(i+n,s-e),!0}var xs=new class extends Ri{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,s){return vs(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return vs(t,this.parseSize(e)/4+n,i,s)}};function Cs(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}var Ts=new class extends Ri{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return Cs(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,o){return Cs(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function Es(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}var Ls=new class extends Ri{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return Es(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,o){return Es(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function Ss(t,e,i,s,n){return t.moveTo(i-e,s-e),t.lineTo(i+e,s+e),t.moveTo(i+e,s-e),t.lineTo(i-e,s+e),!0}var Ps=new class extends Ri{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,s,n){return Ss(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,o){return Ss(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function Ms(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function Os(t,e,i,s){const n=e,o=e/2;return t.rect(i-n/2,s-o/2,n,o),!1}var Rs=new class extends Ri{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,s){return y(e)?Os(t,e,i,s):Ms(t,e,i,s)}drawWithClipRange(t,e,i,s,n,o,r){y(e)&&(e=[e,e/2]);const a=2*(e[0]+e[1])*n,h=[{x:i+e[0]/2,y:s-e[1]/2},{x:i+e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s-e[1]/2}];let l=0,d=h[3];t.moveTo(d.x,d.y);for(let e=0;e<h.length;e++){const i=h[e],s=Math.sqrt((i.x-d.x)*(i.x-d.x)+(i.y-d.y)*(i.y-d.y));if(l+s>a){const e=(i.x-d.x)*(a-l)/s,n=(i.y-d.y)*(a-l)/s;t.lineTo(d.x+e,d.y+n);break}t.lineTo(i.x,i.y),d=i,l+=s}return!1}drawOffset(t,e,i,s,n){return y(e)?Os(t,e+2*n,i,s):Ms(t,[e[0]+2*n,e[1]+2*n],i,s)}};const Bs=new q;class Is{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,_(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,n,o,r){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),zt(n.path.commandList,t,i,s,e,e),r&&r(n.path,n.attribute)})),!1):(zt(this.path.commandList,t,i,s,e+n,e+n),!1)}draw(t,e,i,s,n,o){return e=this.parseSize(e),this.drawOffset(t,e,i,s,0,n,o)}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,s,n,o,r){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((o=>{o.path.drawWithClipRange(t,e,i,s,n),r&&r(o.path,o.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,s,n),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:s}=i;Bs.x1=s.bounds.x1*t,Bs.y1=s.bounds.y1*t,Bs.x2=s.bounds.x2*t,Bs.y2=s.bounds.y2*t,e.union(Bs)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const Ds={};[Ii,Di,Ni,Ui,fs,ji,Wi,Zi,Ji,es,rs,hs,ds,zi,cs,_s,bs,ws,xs,Rs,Ts,Ls,Ps].forEach((t=>{Ds[t.type]=t}));const Fs={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class Ns{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function ks(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function Us(t,e,i){const s=function(t,e){let i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",n="";for(let o=e;o<t.length;o++){let e=t[o];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===s[0]){if(!s[1])return{data:n,index:o};if(t[o+1]===s[1])return{data:n,index:o}}else"\t"===e&&(e=" ");n+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!s)return;let n=s.data;const o=s.index,r=n.search(/\s/);let a=n,h=!0;-1!==r&&(a=n.substr(0,r).replace(/\s\s*$/,""),n=n.substr(r+1));const l=a;if(i){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),h=a!==s.data.substr(t+1))}return{tagName:a,tagExp:n,closeIndex:o,attrExpPresent:h,rawTagName:l}}const Hs=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Gs{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const s=e.tagname;"string"==typeof s?(e.tagname=s,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const s={};if(!t)return;const n=function(t,e){const i=[];let s=e.exec(t);for(;s;){const n=[];n.startIndex=e.lastIndex-s[0].length;const o=s.length;for(let t=0;t<o;t++)n.push(s[t]);i.push(n),s=e.exec(t)}return i}(t,Hs),o=n.length;for(let t=0;t<o;t++){const e=n[t][1],i=n[t][4];e&&(s[e]=void 0===i||(isNaN(i)?i:Number(i)))}return s}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Ns("!xml");let i=e,s="",n="";for(let o=0;o<t.length;o++)if("<"===t[o])if("/"===t[o+1]){const e=ks(t,">",o,"Closing Tag is not closed."),r=n.lastIndexOf(".");n=n.substring(0,r),i=this.tagsNodeStack.pop(),i&&i.child&&s&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=s),s="",o=e}else if("?"===t[o+1])o=Us(t,o,!1,"?>").closeIndex+1;else if("!--"===t.substr(o+1,3))o=ks(t,"--\x3e",o+4,"Comment is not closed.");else{const r=Us(t,o,!1);let a=r.tagName,h=r.tagExp;const l=r.attrExpPresent,d=r.closeIndex;if(a!==e.tagname&&(n+=n?"."+a:a),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),n=n.substr(0,n.length-1),h=a):h=h.substr(0,h.length-1);const t=new Ns(a);a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,n,a)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{const t=new Ns(a);this.tagsNodeStack.push(i),a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,n,a)),this.addChild(i,t,n),i=t}s="",o=d}else s+=t[o];return e.child}}function zs(t,e){return js(t)}function js(t,e){const i={};for(let e=0;e<t.length;e++){const n=t[e],o=Ys(n);if(void 0!==o&&n[o]){const t=js(n[o]);s=t,Object.keys(s).length,n[":@"]&&Xs(t,n[":@"]),void 0!==i[o]&&i.hasOwnProperty(o)?(Array.isArray(i[o])||(i[o]=[i[o]]),i[o].push(t)):i[o]=t}}var s;return i}function Ys(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Xs(t,e,i){if(e){const i=Object.keys(e),s=i.length;for(let n=0;n<s;n++){const s=i[n];t[s]=e[s]}}}class $s{constructor(t){this.options=Object.assign({},$s.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return zs(new Gs(this.options).parseXml(t),this.options)}}$s.defaultOptions={};let Vs=0;function Ws(){return Vs++}var qs;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(qs||(qs={}));const Ks=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Ks.set(t,!0)));const Zs=new Map;[""].forEach((t=>Zs.set(t,!0))),Ws(),Ws(),Ws(),Ws(),Ws(),Ws(),Ws(),Ws(),Ws(),Ws(),Ws();const Qs=Ws();Ws(),Ws(),Ws(),Ws(),Ws();const Js={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},tn=Object.keys(Js),en=new q,sn=new Z;new q;const nn=["lineWidth","scaleX","scaleY","angle","anchor","visible"],on=["x","y"],rn=["scaleX","scaleY"],an=["angle"],hn=new H;class ln extends ri{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const s=e[i];Object.defineProperty(ln.prototype,s,Object.getOwnPropertyDescriptor(t,s))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new q,this._updateTag=Mt.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,s;const{dx:n=t.dx,dy:o=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;hn.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),hn.y=o+(null!==(s=t.scrollY)&&void 0!==s?s:0)}else hn.x=n,hn.y=o;return hn}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Qe.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return Qe.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new K),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=Ds[t];if(e)return e;if(e=ln.userSymbolMap[t],e)return e;if(!0===((i=t=Fs[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new $s,{svg:i}=e.parse(t);if(!i)return null;const s=_(i.path)?i.path:[i.path];en.clear();const n=[];s.forEach((t=>{const e=(new Le).fromString(t.d),i={};tn.forEach((e=>{t[e]&&(i[Js[e]]=t[e])})),n.push({path:e,attribute:i}),en.union(e.bounds)}));const o=en.width(),r=en.height(),a=1/D(o,r);n.forEach((t=>t.path.transform(0,0,a,a)));const h=new Is(t,n,!0);return ln.userSymbolMap[t]=h,h}var i;const s=(new Le).fromString(t),n=s.bounds.width(),o=s.bounds.height(),r=1/D(n,o);s.transform(0,0,r,r);const a=new Is(t,s);return ln.userSymbolMap[t]=a,a}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,s=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:n=e.boundsPadding}=i,o=(r=n)?_(r)?0===r.length?0:1===r.length?r[0]:2===r.length?(wi[0]=r[0],wi[2]=r[0],wi[1]=r[1],wi[3]=r[1],wi):r:r:0;var r;return o&&s.expand(o),this.clearUpdateBoundTag(),s}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new ut(t);return zt(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new Z),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&Mt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&Qe.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&Mt.UPDATE_BOUNDS)&&Qe.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&Mt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&Mt.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&Mt.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&Mt.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=Mt.CLEAR_SHAPE}containsPoint(t,e,i,s){if(!s)return!1;if(i===Ot.GLOBAL){const i=new H(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return s.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const s=Object.keys(t);for(let e=0;e<s.length;e++){const i=s[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(s)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,s){var n;const o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);o?this._setAttributes(o,i,s):p(null===(n=this.normalAttrs)||void 0===n?void 0:n[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nn;for(let i=0;i<e.length;i++){const s=e[i];if(-1!==t.indexOf(s))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nn;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Rt.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=Mt.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,s;if(0===t&&0===e)return this;const n={type:Rt.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,on,n);o&&(t=o.x,e=o.y,delete o.x,delete o.y,this._setAttributes(o));const r=this.attribute,a=r.postMatrix;return a?Qe.transformUtil.fromMatrix(a,a).translate(t,e):(r.x=(null!==(i=r.x)&&void 0!==i?i:Me.x)+t,r.y=(null!==(s=r.y)&&void 0!==s?s:Me.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const s={type:Rt.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,on,s);return n?(this._setAttributes(n,!1,s),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this)}scale(t,e,i){var s,n;if(1===t&&1===e)return this;const o={type:Rt.SCALE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,rn,o);r&&(t=r.scaleX,e=r.scaleY,delete r.scaleX,delete r.scaleY,this._setAttributes(r));const a=this.attribute;if(i){let{postMatrix:s}=this.attribute;s||(s=new Z,a.postMatrix=s),Qe.transformUtil.fromMatrix(s,s).scale(t,e,i)}else a.scaleX=(null!==(s=a.scaleX)&&void 0!==s?s:Me.scaleX)*t,a.scaleY=(null!==(n=a.scaleY)&&void 0!==n?n:Me.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const s={type:Rt.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,rn,s);return n?(this._setAttributes(n,!1,s),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this)}rotate(t,e){var i;if(0===t)return this;const s={type:Rt.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,an,s);n&&(delete n.angle,this._setAttributes(n,!1,s));const o=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Z,o.postMatrix=i),Qe.transformUtil.fromMatrix(i,i).rotate(t,e)}else o.angle=(null!==(i=o.angle)&&void 0!==i?i:Me.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Rt.ROTATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,an,i);return s?(this._setAttributes(s,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){var e;this.animates||(this.animates=new Map);const i=new fi(null==t?void 0:t.id,null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(i.bind(this),t){const{onStart:e,onFrame:s,onEnd:n,onRemove:o}=t;null!=e&&i.onStart(e),null!=s&&i.onFrame(s),null!=n&&i.onEnd(n),null!=o&&i.onRemove(o),i.interpolateFunc=t.interpolate}return this.animates.set(i.id,i),i.onRemove((()=>{i.stop(),this.animates.delete(i.id)})),i}onAttributeUpdate(t){t&&t.skipUpdateCallback||(Qe.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!p(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,s){var n,o,r,a;if(i){const i=Object.keys(t),h=this.getNoWorkAnimateAttr(),l={};let d;i.forEach((e=>{h[e]?(d||(d={}),d[e]=t[e]):l[e]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const u=this.animate({slience:!0});u.stateNames=e,u.to(l,null!==(o=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==o?o:yi,null!==(a=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.easing)&&void 0!==a?a:bi),d&&this.setAttributes(d,!1,{type:Rt.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Rt.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const s=i.getEndProps();v(s,t)&&(e=s[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const i=_(t)?e=>!t.includes(e):e=>e!==t,s=this.currentStates.filter(i);s.length!==this.currentStates.length&&this.useStates(s,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var s;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&(null===(s=this.currentStates)||void 0===s?void 0:s.length)?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const s={};t.forEach((e=>{var i;const n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(s,n)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}addUpdateBoundTag(){this._updateTag|=Mt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=Mt.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=Mt.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&Mt.UPDATE_SHAPE_AND_BOUNDS)===Mt.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=Mt.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Mt.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Mt.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=Mt.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=Mt.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=Mt.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=Mt.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&Mt.UPDATE_LAYOUT)}getAnchor(t,e,i){const s=[0,0],n=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,i=n();s[0]=i.x1+(i.x2-i.x1)*e}else s[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=n();s[1]=i.y1+(i.y2-i.y1)*e}else s[1]=t[1];return s}doUpdateLocalMatrix(){const{x:t=Me.x,y:e=Me.y,scaleX:i=Me.scaleX,scaleY:s=Me.scaleY,angle:n=Me.angle,scaleCenter:o,anchor:r,postMatrix:a}=this.attribute;let h=[0,0];const l={};if(r&&n&&(h=this.getAnchor(r,l)),!o||1===i&&1===s)!function(t,e,i,s,n,o,r,a){const h=e.a,l=e.b,d=e.c,u=e.d,c=e.e,p=e.f,g=I(r),f=N(r);let m,_;a?(m=a[0],_=a[1]):(m=i,_=s);const y=m-i,b=_-s,A=h*g+d*f,w=l*g+u*f,v=d*g-h*f,x=u*g-l*f;t.a=n*A,t.b=n*w,t.c=o*v,t.d=o*x,t.e=c+h*m+d*_-A*y-v*b,t.f=p+l*m+u*_-w*y-x*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,r&&h);else{const r=this._transMatrix;r.reset(),r.translate(h[0],h[1]),r.rotate(n),r.translate(-h[0],-h[1]),r.translate(t,e),h=this.getAnchor(o,l,!0),Qe.transformUtil.fromMatrix(r,r).scale(i,s,{x:h[0],y:h[1]})}const d=this.getOffsetXY(Me);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,a){const t=sn.setValue(a.a,a.b,a.c,a.d,a.e,a.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline===ci&&t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Qe.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Rt.ANIMATE_END})}onStep(t,e,i,s,n){const o={};if(i.customAnimate)i.customAnimate.update(n,s,o);else{const r=i.props,a=i.parsedProps,h=i.propKeys;this.stepInterpolate(t,e,o,i,s,n,r,void 0,a,h)}this.setAttributes(o,!1,{type:Rt.ANIMATE_UPDATE,animationState:{ratio:s,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,s,n,o,r,a,h,l){l||(l=Object.keys(r),s.propKeys=l),o?s.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=r[t])})):l.forEach((o=>{var l;if(!e.validAttr(o))return;const d=r[o],u=null!==(l=a&&a[o])&&void 0!==l?l:t.getLastPropByName(o,s);if(null==d||null==u||d===u)return void(i[o]=d);let c;c=e.interpolateFunc&&e.interpolateFunc(o,n,u,d,i),c||(c=e.customInterpolate(o,n,u,d,this,i),c||this.defaultInterpolate(d,u,o,i,h,n)||this._interpolate(o,n,u,d,i))})),s.parsedProps=h}defaultInterpolate(t,e,i,s,n,o){if(Number.isFinite(t)&&Number.isFinite(e))return s[i]=e+(t-e)*o,!0;if("fill"===i){n||(n={});const r=n.fillColorArray,a=Ti(e,null!=r?r:t,o,!1,((t,e)=>{n.fillColorArray=e}));return a&&(s[i]=a),!0}if("stroke"===i){n||(n={});const r=n.strokeColorArray,a=Ti(e,null!=r?r:t,o,!1,((t,e)=>{n.strokeColorArray=e}));return a&&(s[i]=a),!0}if("shadowColor"===i){n||(n={});const r=n.shadowColorArray,a=Ti(e,null!=r?r:t,o,!0,((t,e)=>{n.shadowColorArray=e}));return a&&(s[i]=a),!0}if(Array.isArray(t)&&t.length===e.length){const n=[];let r=!0;for(let i=0;i<t.length;i++){const s=e[i],a=s+(t[i]-s)*o;if(!Number.isFinite(a)){r=!1;break}n.push(a)}r&&(s[i]=n)}return!1}_interpolate(t,e,i,s,n){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Qe.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return m(t,!0)?this.pathProxy=(new Le).fromString(t):this.pathProxy=new Le,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(i,s),"string"==typeof t?(s.state="loading",t.startsWith("<svg")?(Mi.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(b(t)||t.includes("/")||A(t))&&(Mi.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):f(t)?(s.state="success",s.data=t,this.backgroundImg=this.backgroundImg||e):s.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const s=this.resources.get(t);s&&(s.state="success",s.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),Qe.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new hi(t,e);n.bubbles=!1,n.manager=null===(s=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===s?void 0:s.manager,this.dispatchEvent(n)}}}ln.userSymbolMap={},ln.mixin(li);const dn=["width","x1","y1","height","cornerRadius",...nn];class un extends ln{constructor(t){super(t),this.type="rect",this.numberType=Qs}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return ni(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:o,x:r,y:a}=t;e=null!=e?e:n-r,s=null!=s?s:o-a,(isFinite(e)||isFinite(s)||isFinite(r)||isFinite(a))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=Qe.graphicService.updateTempAABBBounds(i);return((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:o=t.distance,lineWidth:r=t.lineWidth}=s;i.expand(o+(n+r)/2)}})(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Qe.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,dn)}needUpdateTag(t){return super.needUpdateTag(t,dn)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:s,height:n}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=p(t.width)?t.x1-t.x:t.width,i=p(t.height)?t.y1-t.y:t.height,s=0,n=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:s,y:n,width:e,height:i}})(t),o=new Le;return o.moveTo(e,i),o.rect(e,i,s,n),o}clone(){return new un(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return un.NOWORK_ANIMATE_ATTR}}function cn(t){return new un(t)}function pn(t,e){var i,s,n,o,r,a,h,l;return!t&&!e||!(!t||!e)&&(null===(i=t.start)||void 0===i?void 0:i.col)===(null===(s=e.start)||void 0===s?void 0:s.col)&&(null===(n=t.start)||void 0===n?void 0:n.row)===(null===(o=e.start)||void 0===o?void 0:o.row)&&(null===(r=t.end)||void 0===r?void 0:r.col)===(null===(a=e.end)||void 0===a?void 0:a.col)&&(null===(h=t.end)||void 0===h?void 0:h.row)===(null===(l=e.end)||void 0===l?void 0:l.row)}un.NOWORK_ANIMATE_ATTR={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};const gn="undefined"==typeof window||void 0===window.window;function fn(t,e,i){return t.start.col<=e&&e<=t.end.col&&t.start.row<=i&&i<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=i&&i<=t.start.row||t.end.col<=e&&e<=t.start.col&&t.start.row<=i&&i<=t.end.row||t.start.col<=e&&e<=t.end.col&&t.end.row<=i&&i<=t.start.row}!function(){if(gn)return{IE:!1,Edge:!1,Chrome:!1,Firefox:!1,Safari:!1};const t=window.navigator.userAgent.toLowerCase();/(msie|trident)/.exec(t),t.indexOf("edge"),t.indexOf("chrome")>-1&&t.indexOf("edge"),t.indexOf("firefox"),t.indexOf("safari")>-1&&t.indexOf("edge")}();function mn(t,e){return void 0===t&&void 0===e||void 0!==t&&void 0!==e&&(t.start.col===e.start.col&&t.start.row===e.start.row&&t.end.col===e.end.col&&t.end.row===e.end.row)}function _n(t,e){return void 0===t&&void 0===e||void 0!==t&&void 0!==e&&(t.start.col===e.start.col&&t.start.row===e.start.row&&t.end.col===e.end.col&&t.end.row===e.end.row)}function yn(t){return Math.floor(t)===t}t.AddRowColumnPlugin=class{id="add-row-column";runTime=[n.TABLE_EVENT_TYPE.MOUSEENTER_CELL,n.TABLE_EVENT_TYPE.MOUSELEAVE_CELL,n.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE];pluginOptions;table;hoverCell;hideAllTimeoutId_addColumn;hideAllTimeoutId_addRow;leftDotForAddColumn;rightDotForAddColumn;addIconForAddColumn;addLineForAddColumn;topDotForAddRow;bottomDotForAddRow;addIconForAddRow;addLineForAddRow;constructor(t={addColumnEnable:!0,addRowEnable:!0}){this.pluginOptions=t,this.pluginOptions.addColumnEnable=this.pluginOptions.addColumnEnable??!0,this.pluginOptions.addRowEnable=this.pluginOptions.addRowEnable??!0,this.pluginOptions.addColumnEnable&&(this.initAddColumnDomElement(),this.bindEventForAddColumn()),this.pluginOptions.addRowEnable&&(this.initAddRowDomElement(),this.bindEventForAddRow())}run(...t){const e=t[0],i=t[1],s=t[2];if(this.table=s,i===n.TABLE_EVENT_TYPE.MOUSEENTER_CELL){clearTimeout(this.hideAllTimeoutId_addColumn),clearTimeout(this.hideAllTimeoutId_addRow);const t=s.canvas.getBoundingClientRect(),i=s.getCellAtRelativePosition(e.event.clientX-t.left,e.event.clientY-t.top);this.hoverCell=i;const n=s.getCellRelativeRect(i.col,i.row);if(this.pluginOptions.addColumnEnable){const e=s.isSeriesNumber(i.col,0);this.showDotForAddColumn(t.top-6,n.left+t.left,n.right+t.left,!e)}if(this.pluginOptions.addRowEnable){const e=s.isHeader(i.col,i.row);this.showDotForAddRow(n.top+t.top,t.left-6,n.bottom+t.top,!e,!e)}}else i===n.TABLE_EVENT_TYPE.MOUSELEAVE_CELL||i===n.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE&&(this.pluginOptions.addColumnEnable&&this.delayHideAllForAddColumn(),this.pluginOptions.addRowEnable&&this.delayHideAllForAddRow())}initAddColumnDomElement(){this.leftDotForAddColumn=document.createElement("div"),this.leftDotForAddColumn.style.width="6px",this.leftDotForAddColumn.style.height="6px",this.leftDotForAddColumn.style.backgroundColor="#4A90E2",this.leftDotForAddColumn.style.position="absolute",this.leftDotForAddColumn.style.cursor="pointer",this.leftDotForAddColumn.style.zIndex="1000",this.leftDotForAddColumn.style.borderRadius="50%",this.leftDotForAddColumn.style.border="1px solid white",this.leftDotForAddColumn.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.leftDotForAddColumn),this.rightDotForAddColumn=document.createElement("div"),this.rightDotForAddColumn.style.width="6px",this.rightDotForAddColumn.style.height="6px",this.rightDotForAddColumn.style.backgroundColor="#4A90E2",this.rightDotForAddColumn.style.position="absolute",this.rightDotForAddColumn.style.cursor="pointer",this.rightDotForAddColumn.style.zIndex="1000",this.rightDotForAddColumn.style.borderRadius="50%",this.rightDotForAddColumn.style.border="1px solid white",this.rightDotForAddColumn.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.rightDotForAddColumn),this.addIconForAddColumn=document.createElement("div"),this.addIconForAddColumn.style.width="18px",this.addIconForAddColumn.style.height="18px",this.addIconForAddColumn.style.backgroundColor="#4A90E2",this.addIconForAddColumn.style.position="absolute",this.addIconForAddColumn.style.zIndex="1001",this.addIconForAddColumn.style.display="none",this.addIconForAddColumn.style.borderRadius="50%",this.addIconForAddColumn.style.boxShadow="0 2px 5px rgba(0,0,0,0.2)",this.addIconForAddColumn.style.display="flex",this.addIconForAddColumn.style.justifyContent="center",this.addIconForAddColumn.style.alignItems="center",this.addIconForAddColumn.style.border="1px solid white",document.body.appendChild(this.addIconForAddColumn);const t=document.createElement("div");t.textContent="+",t.style.color="white",t.style.fontSize="18px",t.style.fontWeight="bold",t.style.lineHeight="15px",t.style.userSelect="none",t.style.cursor="pointer",t.style.verticalAlign="top",t.style.textAlign="center",this.addIconForAddColumn.appendChild(t),this.addLineForAddColumn=document.createElement("div"),this.addLineForAddColumn.style.width="2px",this.addLineForAddColumn.style.height="10px",this.addLineForAddColumn.style.backgroundColor="#4A90E2",this.addLineForAddColumn.style.position="absolute",this.addLineForAddColumn.style.zIndex="1001",this.addLineForAddColumn.style.display="none",document.body.appendChild(this.addLineForAddColumn)}bindEventForAddColumn(){this.leftDotForAddColumn.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addColumn),this.addIconForAddColumn.style.display="block";const t=this.leftDotForAddColumn.offsetWidth,e=this.leftDotForAddColumn.offsetHeight;this.showAddIconForAddColumn(this.leftDotForAddColumn.offsetLeft+t/2,this.leftDotForAddColumn.offsetTop+e/2,!0),this.showSplitLineForAddColumn(this.leftDotForAddColumn.offsetLeft+t/2-1,this.leftDotForAddColumn.offsetTop+e/2+2,this.table.getDrawRange().height)})),this.rightDotForAddColumn.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addColumn),this.addIconForAddColumn.style.display="block";const t=this.rightDotForAddColumn.offsetWidth,e=this.rightDotForAddColumn.offsetHeight;this.showAddIconForAddColumn(this.rightDotForAddColumn.offsetLeft+t/2,this.rightDotForAddColumn.offsetTop+e/2,!1),this.showSplitLineForAddColumn(this.rightDotForAddColumn.offsetLeft+t/2-1,this.rightDotForAddColumn.offsetTop+e/2+2,this.table.getDrawRange().height)})),this.addIconForAddColumn.addEventListener("mouseleave",(()=>{this.addIconForAddColumn.style.display="none",this.addLineForAddColumn.style.display="none",this.delayHideAllForAddColumn()})),this.addIconForAddColumn.addEventListener("click",(t=>{const e="left"===this.addIconForAddColumn.dataset.addIconType,i=this.table.options.columns,s=this.hoverCell.col,n=e?s:s+1;this.pluginOptions.addColumnCallback?this.pluginOptions.addColumnCallback(n):(i.splice(n,0,{field:"",title:`New Column ${s}`,width:100}),this.table.updateColumns(i)),this.delayHideAllForAddColumn(0)}))}showDotForAddColumn(t,e,i,s=!0,n=!0){const o=this.leftDotForAddColumn.offsetWidth,r=this.leftDotForAddColumn.offsetHeight;this.leftDotForAddColumn.style.left=e-o/2+"px",this.leftDotForAddColumn.style.top=t-r/2+"px",this.rightDotForAddColumn.style.left=i-o/2+"px",this.rightDotForAddColumn.style.top=t-r/2+"px",this.leftDotForAddColumn.style.display=s?"block":"none",this.rightDotForAddColumn.style.display=n?"block":"none"}showAddIconForAddColumn(t,e,i){const s=this.addIconForAddColumn.offsetWidth,n=this.addIconForAddColumn.offsetHeight,o=this.leftDotForAddColumn.offsetHeight;this.addIconForAddColumn.style.left=t-s/2+"px",this.addIconForAddColumn.style.top=e-n/2-o/2+"px",this.addIconForAddColumn.dataset.addIconType=i?"left":"right"}showSplitLineForAddColumn(t,e,i){this.addLineForAddColumn.style.left=`${t}px`,this.addLineForAddColumn.style.top=`${e}px`,this.addLineForAddColumn.style.height=`${i}px`,this.addLineForAddColumn.style.display="block"}delayHideAllForAddColumn(t=1e3){this.hideAllTimeoutId_addColumn=setTimeout((()=>{this.addIconForAddColumn.style.display="none",this.addLineForAddColumn.style.display="none",this.leftDotForAddColumn.style.display="none",this.rightDotForAddColumn.style.display="none"}),t)}initAddRowDomElement(){this.topDotForAddRow=document.createElement("div"),this.topDotForAddRow.style.width="6px",this.topDotForAddRow.style.height="6px",this.topDotForAddRow.style.backgroundColor="#4A90E2",this.topDotForAddRow.style.position="absolute",this.topDotForAddRow.style.cursor="pointer",this.topDotForAddRow.style.zIndex="1000",this.topDotForAddRow.style.borderRadius="50%",this.topDotForAddRow.style.border="1px solid white",this.topDotForAddRow.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.topDotForAddRow),this.bottomDotForAddRow=document.createElement("div"),this.bottomDotForAddRow.style.width="6px",this.bottomDotForAddRow.style.height="6px",this.bottomDotForAddRow.style.backgroundColor="#4A90E2",this.bottomDotForAddRow.style.position="absolute",this.bottomDotForAddRow.style.cursor="pointer",this.bottomDotForAddRow.style.zIndex="1000",this.bottomDotForAddRow.style.borderRadius="50%",this.bottomDotForAddRow.style.border="1px solid white",this.bottomDotForAddRow.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.bottomDotForAddRow),this.addIconForAddRow=document.createElement("div"),this.addIconForAddRow.style.width="18px",this.addIconForAddRow.style.height="18px",this.addIconForAddRow.style.backgroundColor="#4A90E2",this.addIconForAddRow.style.position="absolute",this.addIconForAddRow.style.zIndex="1001",this.addIconForAddRow.style.display="none",this.addIconForAddRow.style.borderRadius="50%",this.addIconForAddRow.style.boxShadow="0 2px 5px rgba(0,0,0,0.2)",this.addIconForAddRow.style.display="flex",this.addIconForAddRow.style.justifyContent="center",this.addIconForAddRow.style.alignItems="center",this.addIconForAddRow.style.border="1px solid white",document.body.appendChild(this.addIconForAddRow);const t=document.createElement("div");t.textContent="+",t.style.color="white",t.style.fontSize="18px",t.style.fontWeight="bold",t.style.lineHeight="15px",t.style.userSelect="none",t.style.cursor="pointer",t.style.verticalAlign="top",t.style.textAlign="center",this.addIconForAddRow.appendChild(t),this.addLineForAddRow=document.createElement("div"),this.addLineForAddRow.style.width="10px",this.addLineForAddRow.style.height="2px",this.addLineForAddRow.style.backgroundColor="#4A90E2",this.addLineForAddRow.style.position="absolute",this.addLineForAddRow.style.zIndex="1001",this.addLineForAddRow.style.display="none",document.body.appendChild(this.addLineForAddRow)}bindEventForAddRow(){this.topDotForAddRow.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addRow),this.addIconForAddRow.style.display="block";const t=this.topDotForAddRow.offsetWidth,e=this.topDotForAddRow.offsetHeight;this.showAddIconForAddRow(this.topDotForAddRow.offsetLeft+t/2,this.topDotForAddRow.offsetTop+e/2,!0),this.showSplitLineForAddRow(this.topDotForAddRow.offsetLeft+t+2,this.topDotForAddRow.offsetTop+e/2-1,this.table.getDrawRange().width)})),this.bottomDotForAddRow.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addRow),this.addIconForAddRow.style.display="block";const t=this.bottomDotForAddRow.offsetWidth,e=this.bottomDotForAddRow.offsetHeight;this.showAddIconForAddRow(this.bottomDotForAddRow.offsetLeft+t/2,this.bottomDotForAddRow.offsetTop+e/2,!1),this.showSplitLineForAddRow(this.bottomDotForAddRow.offsetLeft+t+2,this.bottomDotForAddRow.offsetTop+e/2-1,this.table.getDrawRange().height)})),this.addIconForAddRow.addEventListener("mouseleave",(()=>{this.addIconForAddRow.style.display="none",this.addLineForAddRow.style.display="none",this.delayHideAllForAddRow()})),this.addIconForAddRow.addEventListener("click",(t=>{const e="top"===this.addIconForAddRow.dataset.addIconType,i=this.hoverCell.row,s=e?i:i+1;if(this.pluginOptions.addRowCallback)this.pluginOptions.addRowCallback(s);else{const t=this.table.getRecordIndexByCell(0,s);this.table.addRecord({},t)}this.delayHideAllForAddRow(0)}))}showDotForAddRow(t,e,i,s=!0,n=!0){const o=this.topDotForAddRow.offsetWidth,r=this.topDotForAddRow.offsetHeight;this.topDotForAddRow.style.left=e-o/2+"px",this.topDotForAddRow.style.top=t-r/2+"px",this.bottomDotForAddRow.style.left=e-o/2+"px",this.bottomDotForAddRow.style.top=i-r/2+"px",this.topDotForAddRow.style.display=s?"block":"none",this.bottomDotForAddRow.style.display=n?"block":"none"}showAddIconForAddRow(t,e,i){const s=this.addIconForAddRow.offsetWidth,n=this.addIconForAddRow.offsetHeight,o=this.topDotForAddRow.offsetWidth;this.addIconForAddRow.style.left=t-s/2-o/2+"px",this.addIconForAddRow.style.top=e-n/2+"px",this.addIconForAddRow.dataset.addIconType=i?"top":"bottom"}showSplitLineForAddRow(t,e,i){this.addLineForAddRow.style.left=`${t}px`,this.addLineForAddRow.style.top=`${e}px`,this.addLineForAddRow.style.width=`${i}px`,this.addLineForAddRow.style.display="block"}delayHideAllForAddRow(t=1e3){this.hideAllTimeoutId_addRow=setTimeout((()=>{this.addIconForAddRow.style.display="none",this.addLineForAddRow.style.display="none",this.topDotForAddRow.style.display="none",this.bottomDotForAddRow.style.display="none"}),t)}release(){this.leftDotForAddColumn.remove(),this.rightDotForAddColumn.remove(),this.addIconForAddColumn.remove(),this.addLineForAddColumn.remove(),this.topDotForAddRow.remove(),this.bottomDotForAddRow.remove(),this.addIconForAddRow.remove(),this.addLineForAddRow.remove()}},t.CarouselAnimationPlugin=class{table;rowCount;colCount;animationDuration;animationDelay;animationEasing;replaceScrollAction;playing;row;col;willUpdateRow=!1;willUpdateCol=!1;customDistRowFunction;customDistColFunction;constructor(t,e){this.table=t,this.rowCount=e?.rowCount??void 0,this.colCount=e?.colCount??void 0,this.animationDuration=e?.animationDuration??500,this.animationDelay=e?.animationDelay??1e3,this.animationEasing=e?.animationEasing??"linear",this.replaceScrollAction=e?.replaceScrollAction??!1,this.customDistColFunction=e.customDistColFunction,this.customDistRowFunction=e.customDistRowFunction,this.reset(),this.init()}init(){this.replaceScrollAction&&(this.table.disableScroll(),this.table.scenegraph.stage.addEventListener("wheel",this.onScrollEnd.bind(this)))}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}onScrollEnd(t){this.rowCount?(t.deltaY>0?(this.row+=this.rowCount,this.row=Math.min(this.row,this.table.rowCount-this.table.frozenRowCount)):t.deltaY<0&&(this.row-=this.rowCount,this.row=Math.max(this.row,this.table.frozenRowCount)),this.table.scrollToRow(this.row,{duration:this.animationDuration,easing:this.animationEasing})):this.colCount&&(t.deltaX>0?(this.col+=this.colCount,this.col=Math.min(this.col,this.table.colCount-this.table.frozenColCount)):t.deltaX<0&&(this.col-=this.colCount,this.col=Math.max(this.col,this.table.frozenColCount)),this.table.scrollToCol(this.col,{duration:this.animationDuration,easing:this.animationEasing}))}play(){this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistRowFunction&&this.customDistRowFunction(this.row,this.table);e?(this.row=e.distRow,t=e.animation??!0):o(this.row)&&this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):o(this.row)||this.table.scenegraph.proxy.screenTopRow===Math.floor(this.row)?this.row+=this.rowCount:(this.row=this.table.frozenRowCount,t=!1),this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout((()=>{this.willUpdateRow=!1,this.updateRow()}),this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistColFunction&&this.customDistColFunction(this.col,this.table);e?(this.col=e.distCol,t=e.animation??!0):o(this.col)&&this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):o(this.col)||this.table.scenegraph.proxy.screenLeftCol===Math.floor(this.col)?this.col+=this.colCount:(this.col=this.table.frozenColCount,t=!1),this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout((()=>{this.willUpdateCol=!1,this.updateCol()}),this.animationDuration+this.animationDelay)}},t.ColumnSeriesPlugin=class{id="column-series";runTime=[n.TABLE_EVENT_TYPE.BEFORE_INIT,n.TABLE_EVENT_TYPE.BEFORE_KEYDOWN];pluginOptions;table;columns=[];constructor(t){this.pluginOptions=Object.assign({columnCount:100,autoExtendColumn:!0},t)}run(...t){if(t[1]===n.TABLE_EVENT_TYPE.BEFORE_INIT){const e=t[0],i=t[2];this.table=i;const s=e.options;this.columns=this.generateColumns(this.pluginOptions.columnCount),s.columns=this.columns}else if(t[1]===n.TABLE_EVENT_TYPE.BEFORE_KEYDOWN){"ArrowRight"===t[0].event.key&&this.pluginOptions.autoExtendColumn&&this.table.stateManager.select.cellPos.col===this.table.colCount-1&&this.table.addColumn(this.generateColumn(this.table.colCount-1))}}generateColumns(t){const e=[];for(let i=0;i<t;i++)e.push(this.generateColumn(i));return e}generateColumn(t){return{title:this.pluginOptions.generateColumnTitle?this.pluginOptions.generateColumnTitle(t):this.generateColumnField(t)}}generateColumnField(t){if(t<26)return String.fromCharCode(65+t);const e=[];for(t++;t>0;)t--,e.unshift(String.fromCharCode(65+t%26)),t=Math.floor(t/26);return e.join("")}resetColumnCount(t){this.pluginOptions.columnCount=t,this.columns=this.generateColumns(t),this.table.updateColumns(this.columns)}},t.ExcelEditCellKeyboardPlugin=class{id="excel-edit-cell-keyboard";runTime=[n.TABLE_EVENT_TYPE.INITIALIZED];table;pluginOptions;constructor(t){this.pluginOptions=t,this.bindEvent()}run(...t){const e=t[2];this.table=e}bindEvent(){document.addEventListener("keydown",this.handleKeyDown.bind(this),!0)}handleKeyDown(t){if(this.table.editorManager)if("keydown"===this.table.editorManager.beginTriggerEditCellMode){if(this.table.editorManager.editingEditor&&this.isExcelShortcutKey(t)){const{col:e,row:i}=this.table.editorManager.editCell;this.table.editorManager.completeEdit(),this.table.getElement().focus(),t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key?this.table.selectCell(e,i+1):"Tab"===t.key?this.table.selectCell(e+1,i):"ArrowLeft"===t.key?this.table.selectCell(e-1,i):"ArrowRight"===t.key?this.table.selectCell(e+1,i):"ArrowDown"===t.key?this.table.selectCell(e,i+1):"ArrowUp"===t.key&&this.table.selectCell(e,i-1),t.stopPropagation(),t.preventDefault())}}else{const{col:e,row:i}=this.table.stateManager.select.cellPos;if(!this.table.editorManager.editingEditor||"Enter"!==t.key&&"Tab"!==t.key){if("Delete"===t.key){const e=this.table.getSelectedCellInfos();e?.length>0&&function(t,e){for(let i=0;i<t.length;i++)for(let s=0;s<t[i].length;s++)e.changeCellValue(t[i][s].col,t[i][s].row,"")}(e,this.table),t.stopPropagation(),t.preventDefault()}}else this.table.editorManager.completeEdit(),this.table.getElement().focus(),"Enter"===t.key?this.table.selectCell(e,i+1):"Tab"===t.key&&this.table.selectCell(e+1,i),t.stopPropagation(),t.preventDefault()}}isExcelShortcutKey(t){return"Enter"===t.key||"Tab"===t.key||"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowDown"===t.key||"ArrowUp"===t.key}release(){document.removeEventListener("keydown",this.handleKeyDown,!0)}},t.FocusHighlightPlugin=class{id="focus-highlight";name="Focus Highlight";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED,e.TABLE_EVENT_TYPE.SELECTED_CELL,e.TABLE_EVENT_TYPE.SELECTED_CLEAR];table;range;pluginOptions;constructor(t={fill:"#000",opacity:.5,highlightRange:void 0}){this.pluginOptions=Object.assign({fill:"#000",opacity:.5},t)}run(...t){if(this.table||(this.table=t[2]),t[1]===e.TABLE_EVENT_TYPE.INITIALIZED)this.pluginOptions.highlightRange&&this.setFocusHighlightRange(this.pluginOptions.highlightRange);else if(t[1]===e.TABLE_EVENT_TYPE.SELECTED_CELL){const t=this.table.stateManager.select.cellPos;if(this.table.isHeader(t.col,t.row))this.setFocusHighlightRange(void 0);else{const t=this.table.stateManager.select.ranges,e=0,i=this.table.colCount-1,s=Math.min(t[0].start.row,t[0].end.row),n=Math.max(t[0].start.row,t[0].end.row);this.setFocusHighlightRange({start:{col:e,row:s},end:{col:i,row:n}})}}else t[1]===e.TABLE_EVENT_TYPE.SELECTED_CLEAR&&this.setFocusHighlightRange(void 0)}setFocusHighlightRange(t){let e;t&&"start"in t&&"end"in t?e=t:t&&(e={start:t,end:t}),pn(this.range,e)||(this.range=e,t?this.updateCellGroupShadow():this.deleteAllCellGroupShadow(),this.table.scenegraph.updateNextFrame())}deleteAllCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup)}updateCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup,this.range)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.range,this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup,this.range)}updateCellGroupShadowInContainer(t,e){let i;e&&"start"in e&&"end"in e?i=e:e&&(i={start:e,end:e}),t.forEachChildrenSkipChild((t=>{const e=t;"column"===e.role&&e.forEachChildrenSkipChild((t=>{const e=t;if("cell"!==e.role)return;e.attachShadow(e.shadowRoot);const s=e.shadowRoot;if(i){if(fn(i,e.col,e.row))s.removeAllChild();else if(!s.firstChild){const t=cn({x:0,y:0,width:e.attribute.width,height:e.attribute.height,fill:this.pluginOptions.fill,opacity:this.pluginOptions.opacity});t.name="shadow-rect",s.appendChild(t)}}else s.removeAllChild()}))}))}},t.HeaderHighlightPlugin=class{table;options;colHeaderRange;rowHeaderRange;constructor(t,e){this.table=t,this.options=e,this.registerStyle(),this.bindEvent()}registerStyle(){this.table.registerCustomCellStyle("col-highlight",{bgColor:this.options?.colHighlightBGColor??"#82b2f5",color:this.options?.colHighlightColor??"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:this.options?.rowHighlightBGColor??"#82b2f5",color:this.options?.rowHighlightColor??"#FFF"})}bindEvent(){this.table.on("selected_cell",(()=>{this.updateHighlight()})),this.table.on("selected_clear",(()=>{this.clearHighlight()})),this.table.on("mousemove_table",(()=>{this.table.stateManager.select.selecting&&this.updateHighlight()}))}clearHighlight(){this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0,!0),this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0,!0),this.colHeaderRange=void 0,this.rowHeaderRange=void 0}updateHighlight(){if(!1===this.options?.colHighlight&&!1===this.options?.rowHighlight)return;const t=this.table.getSelectedCellRanges();if(0===t.length)return void this.clearHighlight();const e=t[0],i=[e.start.row,e.end.row];i.sort(((t,e)=>t-e));const s=[e.start.col,e.end.col];let n,o;s.sort(((t,e)=>t-e)),this.table.isPivotTable()?(n={start:{col:s[0],row:0},end:{col:s[1],row:this.table.columnHeaderLevelCount-1}},o={start:{col:0,row:i[0]},end:{col:this.table.rowHeaderLevelCount-1,row:i[1]}}):this.table.internalProps.transpose?o={start:{col:0,row:i[0]},end:{col:this.table.rowHeaderLevelCount-1,row:i[1]}}:(n={start:{col:s[0],row:0},end:{col:s[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(o={start:{col:0,row:i[0]},end:{col:0,row:i[1]}})),!1===this.options?.colHighlight||mn(this.colHeaderRange,n)||(this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),n&&this.table.arrangeCustomCellStyle({range:n},"col-highlight"),this.colHeaderRange=n),!1===this.options?.rowHighlight||mn(this.rowHeaderRange,o)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),o&&this.table.arrangeCustomCellStyle({range:o},"row-highlight"),this.rowHeaderRange=o)}},t.HighlightHeaderWhenSelectCellPlugin=class{id="highlight-header-when-select-cell";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED,e.TABLE_EVENT_TYPE.SELECTED_CLEAR,e.TABLE_EVENT_TYPE.SELECTED_CELL,e.TABLE_EVENT_TYPE.MOUSEMOVE_TABLE];table;pluginOptions;colHeaderRanges=[];rowHeaderRanges=[];constructor(t){this.pluginOptions=t}run(...t){const i=t[1],s=t[2];this.table=s,i===e.TABLE_EVENT_TYPE.SELECTED_CLEAR?this.clearHighlight():i===e.TABLE_EVENT_TYPE.SELECTED_CELL||i===e.TABLE_EVENT_TYPE.MOUSEMOVE_TABLE?this.updateHighlight():i===e.TABLE_EVENT_TYPE.INITIALIZED&&this.registerStyle()}registerStyle(){this.table.registerCustomCellStyle("col-highlight",{bgColor:this.pluginOptions?.colHighlightBGColor??"#82b2f5",color:this.pluginOptions?.colHighlightColor??"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:this.pluginOptions?.rowHighlightBGColor??"#82b2f5",color:this.pluginOptions?.rowHighlightColor??"yellow"})}clearHighlight(){this.colHeaderRanges&&this.colHeaderRanges.forEach((t=>{this.table.arrangeCustomCellStyle({range:t},void 0)})),this.rowHeaderRanges&&this.rowHeaderRanges.forEach((t=>{this.table.arrangeCustomCellStyle({range:t},void 0)})),this.colHeaderRanges=[],this.rowHeaderRanges=[]}updateHighlight(){if(!1===this.pluginOptions?.colHighlight&&!1===this.pluginOptions?.rowHighlight)return;const t=this.table.getSelectedCellRanges();t.length<2&&this.clearHighlight();for(let e=0;e<t.length;e++){const i=t[e],s=[i.start.row,i.end.row];s.sort(((t,e)=>t-e));const n=[i.start.col,i.end.col];let o,r;n.sort(((t,e)=>t-e)),this.table.isPivotTable()?(o={start:{col:n[0],row:0},end:{col:n[1],row:this.table.columnHeaderLevelCount-1}},r={start:{col:0,row:s[0]},end:{col:this.table.rowHeaderLevelCount-1,row:s[1]}}):this.table.internalProps.transpose?r={start:{col:0,row:s[0]},end:{col:this.table.rowHeaderLevelCount-1,row:s[1]}}:(o={start:{col:n[0],row:0},end:{col:n[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(r={start:{col:0,row:s[0]},end:{col:0,row:s[1]}})),!1===this.pluginOptions?.colHighlight||this.colHeaderRanges.find((t=>_n(t,o)))||(o&&this.table.arrangeCustomCellStyle({range:o},"col-highlight"),this.colHeaderRanges.push(o)),!1===this.pluginOptions?.rowHighlight||this.rowHeaderRanges.find((t=>_n(t,r)))||(r&&this.table.arrangeCustomCellStyle({range:r},"row-highlight"),this.rowHeaderRanges.push(r))}}release(){this.rowHeaderRanges=[],this.colHeaderRanges=[]}},t.InvertHighlightPlugin=class{table;range;_fill;_opacity;constructor(t,e){this.table=t,this._fill=e?.fill??"#000",this._opacity=e?.opacity??.5}setInvertHighlightRange(t){pn(this.range,t)||(this.range=t,t?this.updateCellGroupShadow():this.deleteAllCellGroupShadow(),this.table.scenegraph.updateNextFrame())}deleteAllCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup)}updateCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup,this.range)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.range,this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup,this.range)}updateCellGroupShadowInContainer(t,e){t.forEachChildrenSkipChild((t=>{const i=t;"column"===i.role&&i.forEachChildrenSkipChild((t=>{const i=t;if("cell"!==i.role)return;i.attachShadow(i.shadowRoot);const s=i.shadowRoot;if(e){if(fn(e,i.col,i.row))s.removeAllChild();else if(!s.firstChild){const t=cn({x:0,y:0,width:i.attribute.width,height:i.attribute.height,fill:this._fill,opacity:this._opacity});t.name="shadow-rect",s.appendChild(t)}}else s.removeAllChild()}))}))}},t.RowSeriesPlugin=class{id="row-series";runTime=[e.TABLE_EVENT_TYPE.BEFORE_INIT,e.TABLE_EVENT_TYPE.BEFORE_KEYDOWN];pluginOptions;table;constructor(t){this.pluginOptions=Object.assign({rowCount:100,autoExtendRow:!0},t)}run(...t){if(t[1]===e.TABLE_EVENT_TYPE.BEFORE_INIT){const e=t[0],i=t[2];this.table=i;const s=e.options,n=s.records??[];for(let t=n.length;t<this.pluginOptions.rowCount;t++)n.push(this.pluginOptions.fillRowRecord?this.pluginOptions.fillRowRecord(t):{});s.records=n,this.pluginOptions.rowSeriesNumber?(s.rowSeriesNumber=this.pluginOptions.rowSeriesNumber,this.pluginOptions.rowSeriesNumber.width||(s.rowSeriesNumber.width="auto")):s.rowSeriesNumber||(s.rowSeriesNumber={width:"auto"})}else if(t[1]===e.TABLE_EVENT_TYPE.BEFORE_KEYDOWN){"ArrowDown"===t[0].event.key&&this.pluginOptions.autoExtendRow&&this.table.stateManager.select.cellPos.row===this.table.rowCount-1&&this.table.addRecord(this.pluginOptions.fillRowRecord?this.pluginOptions.fillRowRecord(this.table.rowCount-this.table.columnHeaderLevelCount):{})}}},t.TableCarouselAnimationPlugin=class{id="table-carousel-animation";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED];table;rowCount;colCount;animationDuration;animationDelay;animationEasing;playing;row;col;willUpdateRow=!1;willUpdateCol=!1;autoPlay;autoPlayDelay;customDistRowFunction;customDistColFunction;constructor(t={}){this.rowCount=t?.rowCount??void 0,this.colCount=t?.colCount??void 0,this.animationDuration=t?.animationDuration??500,this.animationDelay=t?.animationDelay??1e3,this.animationEasing=t?.animationEasing??"linear",this.autoPlay=t?.autoPlay??!1,this.autoPlayDelay=t?.autoPlayDelay??0,this.customDistColFunction=t.customDistColFunction,this.customDistRowFunction=t.customDistRowFunction}run(...t){this.table||(this.table=t[2]),this.reset(),this.autoPlay&&setTimeout((()=>{this.play()}),this.autoPlayDelay)}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}play(){if(!this.table)throw new Error("table is not initialized");this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistRowFunction&&this.customDistRowFunction(this.row,this.table);e?(this.row=e.distRow,t=e.animation??!0):yn(this.row)&&this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):yn(this.row)||this.table.scenegraph.proxy.screenTopRow===Math.floor(this.row)?this.row+=this.rowCount:(this.row=this.table.frozenRowCount,t=!1),this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout((()=>{this.willUpdateRow=!1,this.updateRow()}),this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistColFunction&&this.customDistColFunction(this.col,this.table);e?(this.col=e.distCol,t=e.animation??!0):yn(this.col)&&this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):yn(this.col)||this.table.scenegraph.proxy.screenLeftCol===Math.floor(this.col)?this.col+=this.colCount:(this.col=this.table.frozenColCount,t=!1),this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout((()=>{this.willUpdateCol=!1,this.updateCol()}),this.animationDuration+this.animationDelay)}release(){}}}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vtable-plugins",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.1",
|
|
4
4
|
"description": "The search util of VTable",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "VisActor",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@visactor/vutils": "~0.19.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@visactor/vtable": "1.18.
|
|
36
|
+
"@visactor/vtable": "1.18.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@visactor/vchart": "1.13.3-alpha.2",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"axios": "^1.4.0",
|
|
78
78
|
"@types/react-is": "^17.0.3",
|
|
79
79
|
"rollup-plugin-node-resolve": "5.2.0",
|
|
80
|
-
"@visactor/vtable": "1.18.
|
|
81
|
-
"@visactor/vtable-editors": "1.18.
|
|
80
|
+
"@visactor/vtable": "1.18.1",
|
|
81
|
+
"@visactor/vtable-editors": "1.18.1",
|
|
82
82
|
"@internal/eslint-config": "0.0.1",
|
|
83
|
-
"@internal/
|
|
84
|
-
"@internal/
|
|
83
|
+
"@internal/bundler": "0.0.1",
|
|
84
|
+
"@internal/ts-config": "0.0.1"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"demo": "vite ./demo",
|