@visactor/vtable-plugins 1.17.1-alpha.9 → 1.17.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.
@@ -1304,6 +1304,8 @@
1304
1304
  return color.getLuminance2();
1305
1305
  case "lum3":
1306
1306
  return color.getLuminance3();
1307
+ case "wcag":
1308
+ return color.getLuminanceWCAG();
1307
1309
  }
1308
1310
  }
1309
1311
  static parseColorString(value) {
@@ -1405,6 +1407,14 @@
1405
1407
  getLuminance3() {
1406
1408
  return (.299 * this.color.r + .587 * this.color.g + .114 * this.color.b) / 255;
1407
1409
  }
1410
+ getLuminanceWCAG() {
1411
+ const RsRGB = this.color.r / 255,
1412
+ GsRGB = this.color.g / 255,
1413
+ BsRGB = this.color.b / 255;
1414
+ let R, G, B;
1415
+ R = RsRGB <= .03928 ? RsRGB / 12.92 : Math.pow((RsRGB + .055) / 1.055, 2.4), G = GsRGB <= .03928 ? GsRGB / 12.92 : Math.pow((GsRGB + .055) / 1.055, 2.4), B = BsRGB <= .03928 ? BsRGB / 12.92 : Math.pow((BsRGB + .055) / 1.055, 2.4);
1416
+ return .2126 * R + .7152 * G + .0722 * B;
1417
+ }
1408
1418
  clone() {
1409
1419
  return new Color(this.color.toString());
1410
1420
  }
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VTable=t.VTable||{},t.VTable.plugins={}))}(this,(function(t){"use strict";function e(t){return Math.floor(t)===t}class i{static GenAutoIncrementId(){return i.auto_increment_id++}}var s;function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}i.auto_increment_id=0,function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(s||(s={}));var r={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 r(t,e,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.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},o.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,r=s.length,a=new Array(r);n<r;n++)a[n]=s[n].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,s=this._events[e];return s?s.fn?1:s.length:0},o.prototype.emit=function(t,e,s,n,r,a){var o=i?i+t:t;if(!this._events[o])return!1;var h,l,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,s),!0;case 4:return c.fn.call(c.context,e,s,n),!0;case 5:return c.fn.call(c.context,e,s,n,r),!0;case 6:return c.fn.call(c.context,e,s,n,r,a),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,s);break;case 4:c[l].fn.call(c[l].context,e,s,n);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,s,n){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||n&&!o.once||s&&o.context!==s||a(this,r);else{for(var h=0,l=[],c=o.length;h<c;h++)(o[h].fn!==e||n&&!o[h].once||s&&o[h].context!==s)&&l.push(o[h]);l.length?this._events[r]=1===l.length?l[0]:l:a(this,r)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(r);var a=n(r.exports);var o=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var h=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||o(t,"Boolean")};var l=t=>"function"==typeof t;var c=t=>null==t;var u=t=>null!=t;var d=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var p=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||o(t,"String")};var g=t=>Array.isArray?Array.isArray(t):o(t,"Array");var f=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||o(t,"Number")};var _=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var m=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 b=Object.prototype.hasOwnProperty;var y=(t,e)=>null!=t&&b.call(t,e);const v="undefined"!=typeof console;function A(t,e,i){const s=[e].concat([].slice.call(i));v&&console[t].apply(console,s)}var x;!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"}(x||(x={}));class T{static getInstance(t,e){return T._instance&&f(t)?T._instance.level(t):T._instance||(T._instance=new T(t,e)),T._instance}static setInstance(t){return T._instance=t}static setInstanceLevel(t){T._instance?T._instance.level(t):T._instance=new T(t)}static clearInstance(){T._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x.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>=x.Info}canLogDebug(){return this._level>=x.Debug}canLogError(){return this._level>=x.Error}canLogWarn(){return this._level>=x.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>=x.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):A(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>=x.Warn&&A(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>=x.Info&&A(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>=x.Debug&&A(this._method||"log","DEBUG",e),this}}T._instance=null;var w=function(t,e,i){return t<e?e:t>i?i:t};const C=Math.PI,B=C/2,M=2*C,S=2*Math.PI,P=Math.abs,E=Math.atan2,L=Math.cos,O=Math.max,U=Math.min,N=Math.sin,I=Math.sqrt,k=Math.pow;class R{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 R(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 f(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return f(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 D{static distancePP(t,e){return I(k(t.x-e.x,2)+k(t.y-e.y,2))}static distanceNN(t,e,i,s){return I(k(t-i,2)+k(e-s,2))}static distancePN(t,e,i){return I(k(e-t.x,2)+k(i-t.y,2))}static pointAtPP(t,e,i){return new R((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function G(t){return t*(Math.PI/180)}var H;function j(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function F(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 X(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Y(t,e){const i=e?G(t.angle):t.angle,s=X(t);return[F({x:t.x1,y:t.y1},i,s),F({x:t.x2,y:t.y1},i,s),F({x:t.x2,y:t.y2},i,s),F({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"}(H||(H={}));class ${constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new $(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 g(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:r,y2:a}=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*r+i.c*n+i.e,i.b*r+i.d*n+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f),t.add(i.a*s+i.c*a+i.e,i.b*s+i.d*a+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:r,y2:a}=this,o=Math.cos(t),h=Math.sin(t),l=e-e*o+i*h,c=i-e*h-i*o;return[o*s-h*n+l,h*s+o*n+c,o*s-h*a+l,h*s+o*a+c,o*r-h*n+l,h*r+o*n+c,o*r-h*a+l,h*r+o*a+c]}scalePoints(t,e,i,s){const{x1:n,y1:r,x2:a,y2:o}=this;return[t*n+(1-t)*i,e*r+(1-e)*s,t*a+(1-t)*i,e*o+(1-e)*s]}}class z extends ${}class q extends ${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=Y(t,i),n=Y(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],a=r(X(t),X(e)),o=r(s[0],s[1]),h=r(s[1],s[2]),l=r(n[0],n[1]),c=r(n[1],n[2]),u=i?G(t.angle):t.angle;let d=i?G(90-t.angle):t.angle+B;const p=i?G(e.angle):e.angle;let g=i?G(90-e.angle):e.angle+B;d>S&&(d-=S),g>S&&(g-=S);const f=(t,e,i,s)=>{const n=[Math.cos(e),Math.sin(e)];return t+(j(n,i)+j(n,s))/2>j(n,a)};return f((t.x2-t.x1)/2,u,l,c)&&f((t.y2-t.y1)/2,d,l,c)&&f((e.x2-e.x1)/2,p,o,h)&&f((e.y2-e.y1)/2,g,o,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 q(this)}}class W{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,r=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=r}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,r){return!(this.e!==n||this.f!==r||this.a!==t||this.d!==s||this.b!==e||this.c!==i)}setValue(t,e,i,s,n,r){return this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=r,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,r=this.f,a=new W,o=t*s-e*i;return a.a=s/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-s*n)/o,a.f=-(t*r-e*n)/o,a}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,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=s,this.b=n,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const s=Math.cos(t),n=Math.sin(t),r=(1-s)*e+n*i,a=(1-s)*i-n*e,o=s*this.a-n*this.b,h=n*this.a+s*this.b,l=s*this.c-n*this.d,c=n*this.c+s*this.d,u=s*this.e-n*this.f+r,d=n*this.e+s*this.f+a;return this.a=o,this.b=h,this.c=l,this.d=c,this.e=u,this.f=d,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,r){return this.multiply(t,e,i,s,n,r),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:r}=this;return this.a=e,this.b=t,this.c=s,this.d=i,this.e=r,this.f=n,this}multiply(t,e,i,s,n,r){const a=this.a,o=this.b,h=this.c,l=this.d,c=a*t+h*e,u=o*t+l*e,d=a*i+h*s,p=o*i+l*s,g=a*n+h*r+this.e,f=o*n+l*r+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=g,this.f=f,this}interpolate(t,e){const i=new W;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:r,e:a,f:o}=this,h=i*r-s*n,l=r/h,c=-s/h,u=-n/h,d=i/h,p=(n*o-r*a)/h,g=-(i*o-s*a)/h,{x:f,y:_}=t;e.x=f*l+_*u+p,e.y=f*c+_*d+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 W(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,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=n/a,r.skewX=(t*i+e*s)/n,r.skewY=0}else if(0!==i||0!==s){const a=Math.sqrt(i*i+s*s);r.rotateDeg=Math.PI/2-(s>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=n/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*s)/n}return r.rotateDeg=180*r.rotateDeg/Math.PI,r}}function V(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)),r=i-s/2;let a=0,o=0,h=0;return 0<=t&&t<60?(a=s,o=n,h=0):60<=t&&t<120?(a=n,o=s,h=0):120<=t&&t<180?(a=0,o=s,h=n):180<=t&&t<240?(a=0,o=n,h=s):240<=t&&t<300?(a=n,o=0,h=s):300<=t&&t<360&&(a=s,o=0,h=n),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),h=Math.round(255*(h+r)),{r:a,g:o,b:h}}function K(t,e,i){t/=255,e/=255,i/=255;const s=Math.min(t,e,i),n=Math.max(t,e,i),r=n-s;let a=0,o=0,h=0;return a=0===r?0:n===t?(e-i)/r%6:n===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),h=(n+s)/2,o=0===r?0:r/(1-Math.abs(2*h-1)),o=+(100*o).toFixed(1),h=+(100*h).toFixed(1),{h:a,s:o,l:h}}const Z=/^#([0-9a-f]{3,8})$/,Q={transparent:4294967040},J={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 tt(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function et(t){return f(t)?new at(t>>16,t>>8&255,255&t,1):g(t)?new at(t[0],t[1],t[2]):new at(255,255,255)}function it(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function st(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const nt=(t,e)=>{const i=Z.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new at((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?et(t):8===e?new at(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class rt{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new rt(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new rt(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof rt?t:new rt(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()}}static parseColorString(t){if(u(Q[t]))return function(t){return f(t)?new at(t>>>24,t>>>16&255,t>>>8&255,255&t):g(t)?new at(t[0],t[1],t[2],t[3]):new at(255,255,255,1)}(Q[t]);if(u(J[t]))return et(J[t]);const e=`${t}`.trim().toLowerCase(),i=nt(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 at(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=V(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new at(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=rt.parseColorString(t);this.color=e||new at(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=K(this.color.r,this.color.g,this.color.b),r=V(c(t)?n.h:w(t,0,360),c(e)?n.s:e>=0&&e<=1?100*e:e,c(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new at(r.r,r.g,r.b,s),this}setRGB(t,e,i){return!c(t)&&(this.color.r=t),!c(e)&&(this.color.g=e),!c(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=nt(e,!0);return null!=i?i:this}setColorName(t){const e=J[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}clone(){return new rt(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=it(t.color.r),this.color.g=it(t.color.g),this.color.b=it(t.color.b),this}copyLinearToSRGB(t){return this.color.r=st(t.color.r),this.color.g=st(t.color.g),this.color.b=st(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class at{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)),u(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}formatHex(){return`#${tt(this.r)+tt(this.g)+tt(this.b)+(1===this.opacity?"":tt(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}=K(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${s}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const ot=M-1e-8;class ht{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,r){if(Math.abs(n-s)>ot)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,h,l,c=1/0,u=-1/0,d=1/0,p=-1/0;function g(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>u&&(u=h),l<d&&(d=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&&(r=!r,a=s,s=n,n=a),r)for(n-=M,a=s-s%B,o=0;o<4&&a>n;++o,a-=B)g(a);else for(a=s-s%B+B,o=0;o<4&&a<n;++o,a+=B)g(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,s,n){this.bounds.add(t,e)}bezierCurveTo(t,e,i,s,n,r){this.bounds.add(t,e),this.bounds.add(i,s),this.bounds.add(n,r)}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 lt{constructor(){this.curves=[],this.bounds=new z}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const ct=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ut={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},dt=0,pt=1,gt=2,ft=3,_t=4,mt=5,bt=6,yt=7,vt=8;let At,xt,Tt,wt,Ct,Bt;var Mt,St,Pt,Et,Lt,Ot,Ut,Nt,It;function kt(t){const e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=h*r,c=-o*a,u=o*r,d=h*a,p=Math.cos(s),g=Math.sin(s),f=Math.cos(n),_=Math.sin(n),m=.5*(n-s),b=Math.sin(.5*m),y=8/3*b*b/Math.sin(m),v=e+p-y*g,A=i+g+y*p,x=e+f,T=i+_,w=x+y*_,C=T-y*f;return[l*v+c*A,u*v+d*A,l*w+c*C,u*w+d*C,l*x+c*T,u*x+d*T]}function Rt(t,e,i,s){const n=function(t,e,i,s,n,r,a,o,h){const l=G(a),c=Math.sin(l),u=Math.cos(l),d=u*(o-t)*.5+c*(h-e)*.5,p=u*(h-e)*.5-c*(o-t)*.5;let g=d*d/((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,_=c/i,m=-c/s,b=u/s,y=f*o+_*h,v=m*o+b*h,A=f*t+_*e,x=m*t+b*e;let T=1/((A-y)*(A-y)+(x-v)*(x-v))-.25;T<0&&(T=0);let w=Math.sqrt(T);r===n&&(w=-w);const C=.5*(y+A)-w*(x-v),S=.5*(v+x)+w*(A-y),P=Math.atan2(v-S,y-C);let E=Math.atan2(x-S,A-C)-P;E<0&&1===r?E+=M:E>0&&0===r&&(E-=M);const L=Math.ceil(Math.abs(E/(B+.001))),O=[];for(let t=0;t<L;++t){const e=P+t*E/L,n=P+(t+1)*E/L;O[t]=[C,S,e,n,i,s,c,u]}return O}(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=kt(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"}(St||(St={})),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"}(Pt||(Pt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Et||(Et={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Lt||(Lt={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Ot||(Ot={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Ut||(Ut={})),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"}(It||(It={}));const Dt=[(t,e,i,s,n,r,a)=>e.arc(t[1]*n+i,t[2]*r+s,t[3]*(n+r)/2,t[4],t[5],t[6],a),(t,e,i,s,n,r,a)=>e.arcTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*(n+r)/2,a),(t,e,i,s,n,r,a)=>e.bezierCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*n+i,t[6]*r+s,a),(t,e,i,s)=>e.closePath(),(t,e,i,s,n,r)=>e.ellipse(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,s,n,r,a)=>e.lineTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.moveTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.quadraticCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,a),(t,e,i,s,n,r,a)=>e.rect(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,a)];function Gt(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,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const h=t[o];Dt[h[0]](h,e,i,s,n,r,a)}}class Ht{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function jt(t,e,i,s,n){return function(t,e){let i=0;const s=t.length;for(let n=0;n<s;n++){const r=t[n],a=e[n],o=t[(n+1)%s],h=e[(n+1)%s];i+=D.distanceNN(r,a,o,h)}return i/2}([t.x,e.x,i.x,s.x],[t.y,e.y,i.y,s.y])}function Ft(t,e,i,s,n){const r=1-n;return r*r*r*t+3*e*n*r*r+3*i*n*n*r+s*n*n*n}class Xt extends Ht{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 function(t,e,i,s,n){const r=Ft(t.x,e.x,i.x,s.x,n),a=Ft(t.y,e.y,i.y,s.y,n);return new R(r,a)}(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?jt(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Ut.ROW?P(this.p0.x-this.p3.x):t===Ut.COLUMN?P(this.p0.y-this.p3.y):0}getAngleAt(t){const e=O(t-.01,0),i=U(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return E(n.y-s.y,n.x-s.x)}}class Yt extends Ht{constructor(t,e){super(),this.type=Nt.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return D.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=E(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()?D.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Ut.ROW?P(this.p0.x-this.p1.x):t===Ut.COLUMN?P(this.p0.y-this.p1.y):0}}class $t{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,r,a,o){const h=new Xt(new R(this._lastX,this._lastY),new R(t,e),new R(i,s),new R(n,r));h.originP1=this._lastOriginP,h.originP2=o,h.defined=a,this.curves.push(h),this._lastX=n,this._lastY=r,this._lastOriginP=o}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 r=new Yt(new R(this._lastX,this._lastY),new R(t,e));return r.originP1=s,r.originP2=n,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Ut.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 P(t.p0.y-s.y)}if(t===Ut.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 P(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class zt extends $t{bezierCurveTo(t,e,i,s,n,r,a,o){return super.bezierCurveTo(e,t,s,i,r,n,a,o)}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 qt(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 Wt(t,e,i){const s=null!=e?e:P(i[i.length-1].x-i[0].x)>P(i[i.length-1].y-i[0].y)?Ut.ROW:Ut.COLUMN;return"monotoneY"===t?new zt(t,s):new $t(t,s)}class Vt{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 Kt(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=Wt("linear",i,t);return function(t,e){qt(t,e)}(new Vt(n,s),t),n}function Zt(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 Qt{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&&Zt(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:Zt(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 Jt(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 Kt(t,e);const n=Wt("basis",i,t);return function(t,e){qt(t,e)}(new Qt(n,s),t),n}function te(t){return t<0?-1:1}function ee(t,e,i){const s=t._x1-t._x0,n=e-t._x1,r=(t._y1-t._y0)/(s||Number(n<0&&-0)),a=(i-t._y1)/(n||Number(s<0&&-0)),o=(r*n+a*s)/(s+n);return(te(r)+te(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function ie(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function se(t,e,i,s,n){const r=t._x0,a=t._y0,o=t._x1,h=t._y1,l=(o-r)/3;t.context.bezierCurveTo(r+l,a+l*e,o-l,h-l*i,o,h,s,t.lastPoint1)}class ne{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:se(this,this._t0,ie(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,se(this,ie(this,e=ee(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:se(this,this._t0,e=ee(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 re extends ne{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}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;if(t.length<3-Number(!!s))return Kt(t,e);const n=Wt("monotoneX",i,t);return function(t,e){qt(t,e)}(new ne(n,s),t),n}function oe(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 Kt(t,e);const n=Wt("monotoneY",i,t);return function(t,e){qt(t,e)}(new re(n,s),t),n}let he=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;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 le(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 r=new $t("step",null!=s?s:P(t[t.length-1].x-t[0].x)>P(t[t.length-1].y-t[0].y)?Ut.ROW:Ut.COLUMN);return function(t,e){qt(t,e)}(new he(r,e,n),t),r}class ce extends Vt{lineEnd(){this.context.closePath()}}function ue(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=Wt("linear",i,t);return function(t,e){qt(t,e)}(new ce(n,s),t),n}function de(t,e,i,s,n){let r=t._x1,a=t._y1,o=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);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*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);o=(o*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(r,a,o,h,t._x2,t._y2,s,t.lastPoint1)}function pe(t,e){return function(i,s){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Kt(i,n);const o=Wt(t,r,i);return qt(new e(o,s,a),i),o}}const ge=pe("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:de(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 fe=pe("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:de(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 _e extends lt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ht(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([bt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([mt,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([yt,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,r){return this.commandList.push([gt,t,e,i,s,n,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,n,r),this}arcTo(t,e,i,s,n){return this.commandList.push([pt,t,e,i,s,n]),this._ctx&&this._ctx.arcTo(t,e,i,s,n),this}ellipse(t,e,i,s,n,r,a,o){return this.commandList.push([_t,t,e,i,s,n,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,s,n,r,a,o),this}rect(t,e,i,s){return this.commandList.push([vt,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,n,r){return this.commandList.push([dt,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([ft]),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()}toString(){if(!this.toStringCbList){const t=[];t[bt]=t=>`M${t[1]} ${t[2]}`,t[mt]=t=>`L${t[1]} ${t[2]}`,t[yt]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[gt]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[dt]=t=>{const e=[];((t,e,i,s,n,r,a)=>{const o=Math.abs(i-e),h=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,l=(i-e)/h;for(let i=0;i<h;i++){const o=e+l*i,h=e+l*(i+1),c=4*Math.tan(Math.abs(l)/4)/3,u=h<o?-1:1,d=Math.cos(o),p=Math.sin(o),g=Math.cos(h),f=Math.sin(h),_=d*r+s,m=p*a+n,b=g*r+s,y=f*a+n,v=r*c*u,A=a*c*u;t.push(_-v*p,m+A*d,b+v*f,y-A*g,b,y)}})(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[vt]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ft]=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 r=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,r=e.length;t<r;t++)if(At=e[t],xt=At.slice(1),Tt=At[0],i=[Tt],s=xt.match(ct),null!==s){for(let t=0,e=s.length;t<e;t++)wt=s[t],Ct=parseFloat(wt),Number.isNaN(Ct)||i.push(Ct);if(Bt=ut[Tt],i.length-1>Bt){let t,e=Tt;for(let s=1,r=i.length;s<r;s+=Bt){t=[e];for(let e=s,n=s+Bt;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(r,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 Kt(t,i);case"basis":return Jt(t,i);case"monotoneX":return ae(t,i);case"monotoneY":return oe(t,i);case"step":return le(t,.5,i);case"stepBefore":return le(t,0,i);case"stepAfter":return le(t,1,i);case"catmullRom":return ge(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return fe(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return ue(t,i)}}(e,i);"x"===s?this.direction=Ut.ROW:"y"===s?this.direction=Ut.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[bt]=this.moveToTransform,t[mt]=this.lineToTransform,t[yt]=this.quadraticCurveToTransform,t[gt]=this.bezierCurveToTransform,t[pt]=this.arcToTransform,t[_t]=this.ellipseTransform,t[vt]=this.rectTransform,t[dt]=this.arcTransform,t[ft]=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,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=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,c=null,u=0,d=0,p=0,g=0;for(let f=0,_=t.length;f<_;++f){switch(e=t[f],1===h&&1===l||(e=be(e,h,l)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+a,d+o);break;case"L":u=e[1],d=e[2],this.lineTo(u+a,d+o);break;case"h":u+=e[1],this.lineTo(u+a,d+o);break;case"H":u=e[1],this.lineTo(u+a,d+o);break;case"v":d+=e[1],this.lineTo(u+a,d+o);break;case"V":d=e[1],this.lineTo(u+a,d+o);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+a,d+o);break;case"M":u=e[1],d=e[2],this.moveTo(u+a,d+o);break;case"c":i=u+e[5],s=d+e[6],p=u+e[3],g=d+e[4],this.bezierCurveTo(u+e[1]+a,d+e[2]+o,p+a,g+o,i+a,s+o),u=i,d=s;break;case"C":u=e[5],d=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,g+o,u+a,d+o);break;case"s":i=u+e[3],s=d+e[4],p=2*u-p,g=2*d-g,this.bezierCurveTo(p+a,g+o,u+e[1]+a,d+e[2]+o,i+a,s+o),p=u+e[1],g=d+e[2],u=i,d=s;break;case"S":i=e[3],s=e[4],p=2*u-p,g=2*d-g,this.bezierCurveTo(p+a,g+o,e[1]+a,e[2]+o,i+a,s+o),u=i,d=s,p=e[1],g=e[2];break;case"q":i=u+e[3],s=d+e[4],p=u+e[1],g=d+e[2],this.quadraticCurveTo(p+a,g+o,i+a,s+o),u=i,d=s;break;case"Q":i=e[3],s=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,s+o),u=i,d=s,p=e[1],g=e[2];break;case"t":i=u+e[1],s=d+e[2],null===c[0].match(/[QqTt]/)?(p=u,g=d):"t"===c[0]?(p=2*u-n,g=2*d-r):"q"===c[0]&&(p=2*u-p,g=2*d-g),n=p,r=g,this.quadraticCurveTo(p+a,g+o,i+a,s+o),u=i,d=s,p=u+e[1],g=d+e[2];break;case"T":i=e[1],s=e[2],p=2*u-p,g=2*d-g,this.quadraticCurveTo(p+a,g+o,i+a,s+o),u=i,d=s;break;case"a":Rt(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+u+a,e[7]+d+o]),u+=e[6],d+=e[7];break;case"A":Rt(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=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 r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case mt:this.lineToTransform(a,e,i,s,n);break;case bt:this.moveToTransform(a,e,i,s,n);break;case gt:this.bezierCurveToTransform(a,e,i,s,n);break;case yt:this.quadraticCurveToTransform(a,e,i,s,n);break;case dt:this.arcToTransform(a,e,i,s,n);break;case _t:this.ellipseTransform(a,e,i,s,n);break;case vt:this.rectTransform(a,e,i,s,n);break;case pt:this.arcToTransform(a,e,i,s,n);break;case ft:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Gt(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Ut.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return P(t.p0.y-e.p1.y)}if(this.direction===Ut.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return P(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),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)}}}const me=["l",0,0,0,0,0,0,0];function be(t,e,i){const s=me[0]=t[0];if("a"===s||"A"===s)me[1]=e*t[1],me[2]=i*t[2],me[3]=t[3],me[4]=t[4],me[5]=t[5],me[6]=e*t[6],me[7]=i*t[7];else if("h"===s||"H"===s)me[1]=e*t[1];else if("v"===s||"V"===s)me[1]=i*t[1];else for(let s=1,n=t.length;s<n;++s)me[s]=(s%2==1?e:i)*t[s];return me}const ye={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 W},ve={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Ae=Object.assign({outerBorder:Object.assign(Object.assign({},ve),{distance:0}),innerBorder:Object.assign(Object.assign({},ve),{distance:0})},ve),xe={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},Te=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Ae),{alignSelf:"auto"}),{pickStrokeBuffer:0}),we={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Ce=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},{_debug_bounds:!1}),Te),ye),Be=Object.assign(Object.assign({},Ce),{startAngle:0,endAngle:S,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Me=Object.assign(Object.assign(Object.assign({},Ce),we),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Se=Object.assign(Object.assign({},Ce),{radius:1,startAngle:0,endAngle:S}),Pe=Object.assign(Object.assign({},Ce),{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}),Ee=Object.assign(Object.assign({},Ce),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Le=Object.assign(Object.assign(Object.assign({},Ce),we),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Oe=Object.assign(Object.assign({},Ce),{path:new _e,fillStrokeOrder:1,customPath:()=>{T.getInstance().warn("空函数")}}),Ue=Object.assign(Object.assign({},Ce),{points:[],cornerRadius:0,closePath:!0}),Ne=Object.assign(Object.assign({},Ce),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},Ce),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const Ie=Object.assign(Object.assign({},Ce),{symbolType:"circle",size:10,keepDirIn3d:!0}),ke=Object.assign(Object.assign(Object.assign({},Ce),xe),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Re=Object.assign(Object.assign(Object.assign({},Ce),xe),{editable:!1,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}),De=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Ce),{fill:!0,cornerRadius:0}),Ge=Object.assign(Object.assign({},De),{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 He=new class{},je={arc:Be,area:Me,circle:Se,line:Le,path:Oe,symbol:Ie,text:ke,rect:Ne,polygon:Ue,richtext:Re,richtextIcon:Ge,image:De,group:Pe,glyph:Ee},Fe=Object.keys(je);function Xe(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Ye={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),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 $e=new class{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Fe.forEach((t=>{this._defaultTheme[t]=Object.create(Ye[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,T.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Fe.forEach((s=>{const n=Object.create(Ye[s]);t&&t[s]&&Xe(n,t[s]),i[s]&&Xe(n,i[s]),e[s]&&Xe(n,e[s]),this.combinedTheme[s]=n})),e.common&&Fe.forEach((t=>{Xe(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 ze(t,e){return t.glyphHost?ze(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)):$e.getTheme()}return null}(t)||t.attachedThemeGraphic&&ze(t.attachedThemeGraphic)||$e.getTheme()}var qe=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{h(s.next(t))}catch(t){r(t)}}function o(t){try{h(s.throw(t))}catch(t){r(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(a,o)}h((s=s.apply(t,e||[])).next())}))};class We extends a{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=i.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 qe(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&&T.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=h(i,!0)&&i||d(i)&&i.capture,n=d(i)&&i.once,r=l(e)?void 0:e;return t=s?`${t}capture`:t,e=l(e)?e:e.handleEvent,n?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const s=h(i,!0)&&i||d(i)&&i.capture,n=l(e)?void 0:e;t=s?`${t}capture`:t,e=l(e)?e:e.handleEvent;const r=d(i)&&i.once;return super.off(t,e,n,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return d(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 Ve{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=Ve.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=this.pickParams.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&&l(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&&l(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Ke extends Ve{constructor(t,e){super(),this.type=t,this.detail=e}}const Ze={dispatchEvent(t){var e;if(!(t instanceof Ve))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 Ke(t,e))}};class Qe{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-Qe.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Qe.bounceIn(2*t):.5*Qe.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const s=e/S*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*S/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const s=e/S*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*S/e)+1}}static getElasticInOut(t,e){return function(i){const s=e/S*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*S/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*S/e)*.5+1}}}Qe.quadIn=Qe.getPowIn(2),Qe.quadOut=Qe.getPowOut(2),Qe.quadInOut=Qe.getPowInOut(2),Qe.cubicIn=Qe.getPowIn(3),Qe.cubicOut=Qe.getPowOut(3),Qe.cubicInOut=Qe.getPowInOut(3),Qe.quartIn=Qe.getPowIn(4),Qe.quartOut=Qe.getPowOut(4),Qe.quartInOut=Qe.getPowInOut(4),Qe.quintIn=Qe.getPowIn(5),Qe.quintOut=Qe.getPowOut(5),Qe.quintInOut=Qe.getPowInOut(5),Qe.backIn=Qe.getBackIn(1.7),Qe.backOut=Qe.getBackOut(1.7),Qe.backInOut=Qe.getBackInOut(1.7),Qe.elasticIn=Qe.getElasticIn(1,.3),Qe.elasticOut=Qe.getElasticOut(1,.3),Qe.elasticInOut=Qe.getElasticInOut(1,.3*1.5);const Je=new class{constructor(){this.id=i.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===Et.END?this.removeAnimate(e):e.status===Et.RUNNING||e.status===Et.INITIAL?(this.animateCount++,e.advance(t)):e.status===Et.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 ti{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 ei extends ti{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class ii{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Je,s=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e,this.status=Et.INITIAL,this.tailAnimate=new si(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=s}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=O(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){ii.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]:ii.mode;t&&e&Lt.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Pt.ANIMATE_PLAY})}runCb(t){const e=new ei((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,r){const a=ii.interpolateMap.get(t)||ii.interpolateMap.get("");return!!a&&a(t,e,i,s,n,r)}pause(){this.status===Et.RUNNING&&(this.status=Et.PAUSED)}resume(){this.status===Et.PAUSED&&(this.status=Et.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 si(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===Et.INITIAL&&(this.status=Et.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Et.RUNNING&&(this.status=Et.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 r=t>=n;if(r&&(t=n),t===s)return r;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),r}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=Et.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()}}ii.mode=Lt.NORMAL,ii.interpolateMap=new Map;class si{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 ni(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?Qe[i]:i,n=this._addStep(e,null,s);return n.type=Ot.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?Qe[i]:i,r=this._addStep(e,null,n);return r.type=Ot.to,this._appendProps(t,r,!!s&&s.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),s&&s.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.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=Ot.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=Ot.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 ni(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 r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[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 r,a,o=!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&&(o=!0,i<0))return o;if(r=Math.floor(t/i),a=t-r*i,o=t>=s*i+i,o&&(a=i,r=s,t=a*r+i),t===n)return o;const l=!this.reversed!=!(this.bounce&&r%2);return l&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+h,this.updatePosition(o,l),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const s=this.position,n=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=s;)i=r,r=i.next;let a=t?0===n?1:s/n:(s-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}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 T.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 ni{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 ri=200,ai="cubicOut";var oi;!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"}(oi||(oi={}));const hi=[0,0,0,0];var li;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(li||(li={}));class ci{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:li.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===li.Color1){const e=ci.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=rt.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];ci.store1[t]=e,ci.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=ci.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=rt.parseColorString(t);return n&&(ci.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],ci.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===li.Color1){if(ci.store1[t])return;ci.store1[t]=i,ci.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(ci.store255[t])return;ci.store255[t]=i,ci.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function ui(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&f(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 di(t,e,i,s,n){return Array.isArray(t)&&!f(t[0])||Array.isArray(e)&&!f(e[0])?new Array(4).fill(0).map(((n,r)=>pi(g(t)?t[r]:t,g(e)?e[r]:e,i,s))):pi(t,e,i,s,n)}function pi(t,e,i,s,n){if(!t||!e)return t&&ui(t)||e&&ui(e)||!1;let r,a,o=!1,h=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=ci.Get(t,li.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=ci.Get(e,li.Color255):h=!0,o!==h){const r=o?t:e,a=o?e:t,h=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:ui(a)})))});return o?di(r,h,i,s,n):di(h,r,i,s,n)}if(o){if(t.gradient===e.gradient){const s=t,n=e,r=s.stops,a=n.stops;if(r.length!==a.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:_i(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:_i(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:_i(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(r,a),ui(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]}(r,a,i),s)}ci.store255={},ci.store1={};const gi=[0,0,0,0],fi=[0,0,0,0];function _i(t,e,i){return ci.Get(t,li.Color255,gi),ci.Get(e,li.Color255,fi),`rgba(${Math.round(gi[0]+(fi[0]-gi[0])*i)},${Math.round(gi[1]+(fi[1]-gi[1])*i)},${Math.round(gi[2]+(fi[2]-gi[2])*i)},${gi[3]+(fi[3]-gi[3])*i})`}class mi{static GetImage(t,e){var i;const s=mi.cache.get(t);s?"fail"===s.loadState?He.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?He.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=He.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=He.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=He.global.loadBlob(t):"json"===e&&(i.dataPromise=He.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=He.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=bi(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=bi(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 bi(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=[];const yi=new W,vi=new z,Ai=["lineWidth","scaleX","scaleY","angle","anchor","visible"],xi=["x","y"],Ti=["scaleX","scaleY"],wi=["angle"],Ci=new R;class Bi extends We{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const s=e[i];Object.defineProperty(Bi.prototype,s,Object.getOwnPropertyDescriptor(t,s))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}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 z,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:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Ci.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),Ci.y=r+(null!==(s=t.scrollY)&&void 0!==s?s:0)}else Ci.x=n,Ci.y=r;return Ci}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;He.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return He.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new q),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}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,r=(a=n)?g(a)?0===a.length?0:1===a.length?a[0]:2===a.length?(hi[0]=a[0],hi[2]=a[0],hi[1]=a[1],hi[3]=a[1],hi):a:a:0;var a;return r&&s.expand(r),this.clearUpdateBoundTag(),s}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new ht(t);return Gt(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 W),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&Mt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&He.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&Mt.UPDATE_BOUNDS)&&He.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===St.GLOBAL){const i=new R(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return s.containsPoint(this,{x:t,y:e})}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 r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);r?this._setAttributes(r,i,s):c(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]:Ai;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]:Ai;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Pt.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:Pt.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,xi,n);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const a=this.attribute,o=a.postMatrix;return o?He.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:ye.x)+t,a.y=(null!==(s=a.y)&&void 0!==s?s:ye.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:Pt.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,xi,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 r={type:Pt.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,Ti,r);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(i){let{postMatrix:s}=this.attribute;s||(s=new W,o.postMatrix=s),He.transformUtil.fromMatrix(s,s).scale(t,e,i)}else o.scaleX=(null!==(s=o.scaleX)&&void 0!==s?s:ye.scaleX)*t,o.scaleY=(null!==(n=o.scaleY)&&void 0!==n?n:ye.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const s={type:Pt.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Ti,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:Pt.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,wi,s);n&&(delete n.angle,this._setAttributes(n,!1,s));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new W,r.postMatrix=i),He.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:ye.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:Pt.ROTATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,wi,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){this.animates||(this.animates=new Map);const e=new ii(null==t?void 0:t.id,this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(e.bind(this),t){const{onStart:i,onFrame:s,onEnd:n,onRemove:r}=t;null!=i&&e.onStart(i),null!=s&&e.onFrame(s),null!=n&&e.onEnd(n),null!=r&&e.onRemove(r),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(He.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!c(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,r,a,o;if(i){const i=Object.keys(t),h=this.getNoWorkAnimateAttr(),l={};let c;i.forEach((e=>{h[e]?(c||(c={}),c[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!==(r=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==r?r:ri,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:ai),c&&this.setAttributes(c,!1,{type:Pt.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Pt.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();y(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?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,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}=this.attribute;return vi.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(vi),this.setAttributes({scaleX:t,scaleY:i,angle:s}),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=ye.x,y:e=ye.y,scaleX:i=ye.scaleX,scaleY:s=ye.scaleY,angle:n=ye.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let h=[0,0];const l={};if(a&&(h=this.getAnchor(a,l)),!r||1===i&&1===s)!function(t,e,i,s,n,r,a,o){const h=e.a,l=e.b,c=e.c,u=e.d,d=e.e,p=e.f,g=L(a),f=N(a);let _,m;o?(_=o[0],m=o[1]):(_=i,m=s);const b=_-i,y=m-s,v=h*g+c*f,A=l*g+u*f,x=c*g-h*f,T=u*g-l*f;t.a=n*v,t.b=n*A,t.c=r*x,t.d=r*T,t.e=d+h*_+c*m-v*b-x*y,t.f=p+l*_+u*m-A*b-T*y}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,a&&h);else{const a=this._transMatrix;a.reset(),a.translate(h[0],h[1]),a.rotate(n),a.translate(-h[0],-h[1]),a.translate(t,e),h=this.getAnchor(r,l),He.transformUtil.fromMatrix(a,a).scale(i,s,{x:h[0],y:h[1]})}const c=this.getOffsetXY(ye);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=yi.setValue(o.a,o.b,o.c,o.d,o.e,o.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.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),He.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Pt.ANIMATE_END})}onStep(t,e,i,s,n){const r={};if(i.customAnimate)i.customAnimate.update(n,s,r);else{const a=i.props,o=i.parsedProps,h=i.propKeys;this.stepInterpolate(t,e,r,i,s,n,a,void 0,o,h)}this.setAttributes(r,!1,{type:Pt.ANIMATE_UPDATE,animationState:{ratio:s,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,s,n,r,a,o,h,l){l||(l=Object.keys(a),s.propKeys=l),r?s.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):l.forEach((r=>{var l;if(!e.validAttr(r))return;const c=a[r],u=null!==(l=o&&o[r])&&void 0!==l?l:t.getLastPropByName(r,s);if(null==c||null==u||c===u)return void(i[r]=c);let d;d=e.interpolateFunc&&e.interpolateFunc(r,n,u,c,i),d||(d=e.customInterpolate(r,n,u,c,this,i),d||this.defaultInterpolate(c,u,r,i,h,n)||this._interpolate(r,n,u,c,i))})),s.parsedProps=h}defaultInterpolate(t,e,i,s,n,r){if(Number.isFinite(t))return s[i]=e+(t-e)*r,!0;if("fill"===i){n||(n={});const a=n.fillColorArray,o=di(e,null!=a?a:t,r,!1,((t,e)=>{n.fillColorArray=e}));return o&&(s[i]=o),!0}if("stroke"===i){n||(n={});const a=n.strokeColorArray,o=di(e,null!=a?a:t,r,!1,((t,e)=>{n.strokeColorArray=e}));return o&&(s[i]=o),!0}if("shadowColor"===i){n||(n={});const a=n.shadowColorArray,o=di(e,null!=a?a:t,r,!0,((t,e)=>{n.shadowColorArray=e}));return o&&(s[i]=o),!0}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:He.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),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 p(t,!0)?this.pathProxy=(new _e).fromString(t):this.pathProxy=new _e,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):(_(t)||t.includes("/")||m(t))&&(mi.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):d(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",He.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new Ke(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)}}}Bi.mixin(Ze);let Mi=0;function Si(){return Mi++}var Pi;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Pi||(Pi={}));const Ei=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Ei.set(t,!0)));const Li=new Map;[""].forEach((t=>Li.set(t,!0))),Si(),Si(),Si(),Si(),Si(),Si(),Si(),Si(),Si(),Si(),Si();const Oi=Si();Si(),Si(),Si(),Si();const Ui=["width","x1","y1","height","cornerRadius",...Ai];class Ni extends Bi{constructor(t){super(t),this.type="rect",this.numberType=Oi}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return ze(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:r,x:a,y:o}=t;e=null!=e?e:n-a,s=null!=s?s:r-o,(isFinite(e)||isFinite(s)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=He.graphicService.updateTempAABBBounds(i);return((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=s;i.expand(r+(n+a)/2)}})(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),He.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,Ui)}needUpdateTag(t){return super.needUpdateTag(t,Ui)}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=c(t.width)?t.x1-t.x:t.width,i=c(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),r=new _e;return r.moveTo(e,i),r.rect(e,i,s,n),r}clone(){return new Ni(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ni.NOWORK_ANIMATE_ATTR}}Ni.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 Ii="undefined"==typeof window||void 0===window.window;!function(){if(Ii)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 ki(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)}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 i=this.customDistRowFunction&&this.customDistRowFunction(this.row,this.table);i?(this.row=i.distRow,t=i.animation??!0):e(this.row)&&this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):e(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 i=this.customDistColFunction&&this.customDistColFunction(this.col,this.table);i?(this.col=i.distCol,t=i.animation??!0):e(this.col)&&this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):e(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.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,r;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}},r={start:{col:0,row:i[0]},end:{col:this.table.rowHeaderLevelCount-1,row:i[1]}}):this.table.internalProps.transpose?r={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&&(r={start:{col:0,row:i[0]},end:{col:0,row:i[1]}})),!1===this.options?.colHighlight||ki(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||ki(this.rowHeaderRange,r)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),r&&this.table.arrangeCustomCellStyle({range:r},"row-highlight"),this.rowHeaderRange=r)}},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){var e,i;(e=this.range,i=t,!e&&!i||e&&i&&e.start.col===i.start.col&&e.start.row===i.start.row&&e.end.col===i.end.col&&e.end.row===i.end.row)||(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(function(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}(e,i.col,i.row))s.removeAllChild();else if(!s.firstChild){const t=(n={x:0,y:0,width:i.attribute.width,height:i.attribute.height,fill:this._fill,opacity:this._opacity},new Ni(n));t.name="shadow-rect",s.appendChild(t)}}else s.removeAllChild();var n}))}))}}}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VTable=t.VTable||{},t.VTable.plugins={}))}(this,(function(t){"use strict";function e(t){return Math.floor(t)===t}class i{static GenAutoIncrementId(){return i.auto_increment_id++}}var s;function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}i.auto_increment_id=0,function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(s||(s={}));var r={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 r(t,e,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.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},o.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,r=s.length,a=new Array(r);n<r;n++)a[n]=s[n].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,s=this._events[e];return s?s.fn?1:s.length:0},o.prototype.emit=function(t,e,s,n,r,a){var o=i?i+t:t;if(!this._events[o])return!1;var h,l,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,s),!0;case 4:return c.fn.call(c.context,e,s,n),!0;case 5:return c.fn.call(c.context,e,s,n,r),!0;case 6:return c.fn.call(c.context,e,s,n,r,a),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,s);break;case 4:c[l].fn.call(c[l].context,e,s,n);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,s,n){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||n&&!o.once||s&&o.context!==s||a(this,r);else{for(var h=0,l=[],c=o.length;h<c;h++)(o[h].fn!==e||n&&!o[h].once||s&&o[h].context!==s)&&l.push(o[h]);l.length?this._events[r]=1===l.length?l[0]:l:a(this,r)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(r);var a=n(r.exports);var o=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var h=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||o(t,"Boolean")};var l=t=>"function"==typeof t;var c=t=>null==t;var u=t=>null!=t;var d=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var p=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||o(t,"String")};var g=t=>Array.isArray?Array.isArray(t):o(t,"Array");var f=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||o(t,"Number")};var _=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var m=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 b=Object.prototype.hasOwnProperty;var y=(t,e)=>null!=t&&b.call(t,e);const v="undefined"!=typeof console;function A(t,e,i){const s=[e].concat([].slice.call(i));v&&console[t].apply(console,s)}var x;!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"}(x||(x={}));class T{static getInstance(t,e){return T._instance&&f(t)?T._instance.level(t):T._instance||(T._instance=new T(t,e)),T._instance}static setInstance(t){return T._instance=t}static setInstanceLevel(t){T._instance?T._instance.level(t):T._instance=new T(t)}static clearInstance(){T._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x.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>=x.Info}canLogDebug(){return this._level>=x.Debug}canLogError(){return this._level>=x.Error}canLogWarn(){return this._level>=x.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>=x.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):A(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>=x.Warn&&A(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>=x.Info&&A(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>=x.Debug&&A(this._method||"log","DEBUG",e),this}}T._instance=null;var w=function(t,e,i){return t<e?e:t>i?i:t};const C=Math.PI,B=C/2,M=2*C,S=2*Math.PI,P=Math.abs,E=Math.atan2,L=Math.cos,O=Math.max,U=Math.min,N=Math.sin,I=Math.sqrt,k=Math.pow;class R{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 R(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 f(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return f(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 D{static distancePP(t,e){return I(k(t.x-e.x,2)+k(t.y-e.y,2))}static distanceNN(t,e,i,s){return I(k(t-i,2)+k(e-s,2))}static distancePN(t,e,i){return I(k(e-t.x,2)+k(i-t.y,2))}static pointAtPP(t,e,i){return new R((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function G(t){return t*(Math.PI/180)}var H;function j(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function F(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 X(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Y(t,e){const i=e?G(t.angle):t.angle,s=X(t);return[F({x:t.x1,y:t.y1},i,s),F({x:t.x2,y:t.y1},i,s),F({x:t.x2,y:t.y2},i,s),F({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"}(H||(H={}));class ${constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new $(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 g(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:r,y2:a}=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*r+i.c*n+i.e,i.b*r+i.d*n+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f),t.add(i.a*s+i.c*a+i.e,i.b*s+i.d*a+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:r,y2:a}=this,o=Math.cos(t),h=Math.sin(t),l=e-e*o+i*h,c=i-e*h-i*o;return[o*s-h*n+l,h*s+o*n+c,o*s-h*a+l,h*s+o*a+c,o*r-h*n+l,h*r+o*n+c,o*r-h*a+l,h*r+o*a+c]}scalePoints(t,e,i,s){const{x1:n,y1:r,x2:a,y2:o}=this;return[t*n+(1-t)*i,e*r+(1-e)*s,t*a+(1-t)*i,e*o+(1-e)*s]}}class z extends ${}class q extends ${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=Y(t,i),n=Y(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],a=r(X(t),X(e)),o=r(s[0],s[1]),h=r(s[1],s[2]),l=r(n[0],n[1]),c=r(n[1],n[2]),u=i?G(t.angle):t.angle;let d=i?G(90-t.angle):t.angle+B;const p=i?G(e.angle):e.angle;let g=i?G(90-e.angle):e.angle+B;d>S&&(d-=S),g>S&&(g-=S);const f=(t,e,i,s)=>{const n=[Math.cos(e),Math.sin(e)];return t+(j(n,i)+j(n,s))/2>j(n,a)};return f((t.x2-t.x1)/2,u,l,c)&&f((t.y2-t.y1)/2,d,l,c)&&f((e.x2-e.x1)/2,p,o,h)&&f((e.y2-e.y1)/2,g,o,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 q(this)}}class W{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,r=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=r}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,r){return!(this.e!==n||this.f!==r||this.a!==t||this.d!==s||this.b!==e||this.c!==i)}setValue(t,e,i,s,n,r){return this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=r,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,r=this.f,a=new W,o=t*s-e*i;return a.a=s/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-s*n)/o,a.f=-(t*r-e*n)/o,a}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,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=s,this.b=n,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const s=Math.cos(t),n=Math.sin(t),r=(1-s)*e+n*i,a=(1-s)*i-n*e,o=s*this.a-n*this.b,h=n*this.a+s*this.b,l=s*this.c-n*this.d,c=n*this.c+s*this.d,u=s*this.e-n*this.f+r,d=n*this.e+s*this.f+a;return this.a=o,this.b=h,this.c=l,this.d=c,this.e=u,this.f=d,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,r){return this.multiply(t,e,i,s,n,r),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:r}=this;return this.a=e,this.b=t,this.c=s,this.d=i,this.e=r,this.f=n,this}multiply(t,e,i,s,n,r){const a=this.a,o=this.b,h=this.c,l=this.d,c=a*t+h*e,u=o*t+l*e,d=a*i+h*s,p=o*i+l*s,g=a*n+h*r+this.e,f=o*n+l*r+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=g,this.f=f,this}interpolate(t,e){const i=new W;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:r,e:a,f:o}=this,h=i*r-s*n,l=r/h,c=-s/h,u=-n/h,d=i/h,p=(n*o-r*a)/h,g=-(i*o-s*a)/h,{x:f,y:_}=t;e.x=f*l+_*u+p,e.y=f*c+_*d+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 W(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,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=n/a,r.skewX=(t*i+e*s)/n,r.skewY=0}else if(0!==i||0!==s){const a=Math.sqrt(i*i+s*s);r.rotateDeg=Math.PI/2-(s>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=n/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*s)/n}return r.rotateDeg=180*r.rotateDeg/Math.PI,r}}function V(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)),r=i-s/2;let a=0,o=0,h=0;return 0<=t&&t<60?(a=s,o=n,h=0):60<=t&&t<120?(a=n,o=s,h=0):120<=t&&t<180?(a=0,o=s,h=n):180<=t&&t<240?(a=0,o=n,h=s):240<=t&&t<300?(a=n,o=0,h=s):300<=t&&t<360&&(a=s,o=0,h=n),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),h=Math.round(255*(h+r)),{r:a,g:o,b:h}}function K(t,e,i){t/=255,e/=255,i/=255;const s=Math.min(t,e,i),n=Math.max(t,e,i),r=n-s;let a=0,o=0,h=0;return a=0===r?0:n===t?(e-i)/r%6:n===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),h=(n+s)/2,o=0===r?0:r/(1-Math.abs(2*h-1)),o=+(100*o).toFixed(1),h=+(100*h).toFixed(1),{h:a,s:o,l:h}}const Z=/^#([0-9a-f]{3,8})$/,Q={transparent:4294967040},J={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 tt(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function et(t){return f(t)?new at(t>>16,t>>8&255,255&t,1):g(t)?new at(t[0],t[1],t[2]):new at(255,255,255)}function it(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function st(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const nt=(t,e)=>{const i=Z.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new at((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?et(t):8===e?new at(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class rt{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new rt(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new rt(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof rt?t:new rt(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(u(Q[t]))return function(t){return f(t)?new at(t>>>24,t>>>16&255,t>>>8&255,255&t):g(t)?new at(t[0],t[1],t[2],t[3]):new at(255,255,255,1)}(Q[t]);if(u(J[t]))return et(J[t]);const e=`${t}`.trim().toLowerCase(),i=nt(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 at(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=V(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new at(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=rt.parseColorString(t);this.color=e||new at(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=K(this.color.r,this.color.g,this.color.b),r=V(c(t)?n.h:w(t,0,360),c(e)?n.s:e>=0&&e<=1?100*e:e,c(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new at(r.r,r.g,r.b,s),this}setRGB(t,e,i){return!c(t)&&(this.color.r=t),!c(e)&&(this.color.g=e),!c(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=nt(e,!0);return null!=i?i:this}setColorName(t){const e=J[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,r;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),r=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*n+.0722*r}clone(){return new rt(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=it(t.color.r),this.color.g=it(t.color.g),this.color.b=it(t.color.b),this}copyLinearToSRGB(t){return this.color.r=st(t.color.r),this.color.g=st(t.color.g),this.color.b=st(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class at{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)),u(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}formatHex(){return`#${tt(this.r)+tt(this.g)+tt(this.b)+(1===this.opacity?"":tt(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}=K(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${s}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const ot=M-1e-8;class ht{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,r){if(Math.abs(n-s)>ot)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,h,l,c=1/0,u=-1/0,d=1/0,p=-1/0;function g(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>u&&(u=h),l<d&&(d=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&&(r=!r,a=s,s=n,n=a),r)for(n-=M,a=s-s%B,o=0;o<4&&a>n;++o,a-=B)g(a);else for(a=s-s%B+B,o=0;o<4&&a<n;++o,a+=B)g(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,s,n){this.bounds.add(t,e)}bezierCurveTo(t,e,i,s,n,r){this.bounds.add(t,e),this.bounds.add(i,s),this.bounds.add(n,r)}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 lt{constructor(){this.curves=[],this.bounds=new z}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const ct=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ut={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},dt=0,pt=1,gt=2,ft=3,_t=4,mt=5,bt=6,yt=7,vt=8;let At,xt,Tt,wt,Ct,Bt;var Mt,St,Pt,Et,Lt,Ot,Ut,Nt,It;function kt(t){const e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=h*r,c=-o*a,u=o*r,d=h*a,p=Math.cos(s),g=Math.sin(s),f=Math.cos(n),_=Math.sin(n),m=.5*(n-s),b=Math.sin(.5*m),y=8/3*b*b/Math.sin(m),v=e+p-y*g,A=i+g+y*p,x=e+f,T=i+_,w=x+y*_,C=T-y*f;return[l*v+c*A,u*v+d*A,l*w+c*C,u*w+d*C,l*x+c*T,u*x+d*T]}function Rt(t,e,i,s){const n=function(t,e,i,s,n,r,a,o,h){const l=G(a),c=Math.sin(l),u=Math.cos(l),d=u*(o-t)*.5+c*(h-e)*.5,p=u*(h-e)*.5-c*(o-t)*.5;let g=d*d/((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,_=c/i,m=-c/s,b=u/s,y=f*o+_*h,v=m*o+b*h,A=f*t+_*e,x=m*t+b*e;let T=1/((A-y)*(A-y)+(x-v)*(x-v))-.25;T<0&&(T=0);let w=Math.sqrt(T);r===n&&(w=-w);const C=.5*(y+A)-w*(x-v),S=.5*(v+x)+w*(A-y),P=Math.atan2(v-S,y-C);let E=Math.atan2(x-S,A-C)-P;E<0&&1===r?E+=M:E>0&&0===r&&(E-=M);const L=Math.ceil(Math.abs(E/(B+.001))),O=[];for(let t=0;t<L;++t){const e=P+t*E/L,n=P+(t+1)*E/L;O[t]=[C,S,e,n,i,s,c,u]}return O}(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=kt(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"}(St||(St={})),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"}(Pt||(Pt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Et||(Et={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Lt||(Lt={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Ot||(Ot={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Ut||(Ut={})),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"}(It||(It={}));const Dt=[(t,e,i,s,n,r,a)=>e.arc(t[1]*n+i,t[2]*r+s,t[3]*(n+r)/2,t[4],t[5],t[6],a),(t,e,i,s,n,r,a)=>e.arcTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*(n+r)/2,a),(t,e,i,s,n,r,a)=>e.bezierCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*n+i,t[6]*r+s,a),(t,e,i,s)=>e.closePath(),(t,e,i,s,n,r)=>e.ellipse(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,s,n,r,a)=>e.lineTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.moveTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.quadraticCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,a),(t,e,i,s,n,r,a)=>e.rect(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,a)];function Gt(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,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const h=t[o];Dt[h[0]](h,e,i,s,n,r,a)}}class Ht{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function jt(t,e,i,s,n){return function(t,e){let i=0;const s=t.length;for(let n=0;n<s;n++){const r=t[n],a=e[n],o=t[(n+1)%s],h=e[(n+1)%s];i+=D.distanceNN(r,a,o,h)}return i/2}([t.x,e.x,i.x,s.x],[t.y,e.y,i.y,s.y])}function Ft(t,e,i,s,n){const r=1-n;return r*r*r*t+3*e*n*r*r+3*i*n*n*r+s*n*n*n}class Xt extends Ht{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 function(t,e,i,s,n){const r=Ft(t.x,e.x,i.x,s.x,n),a=Ft(t.y,e.y,i.y,s.y,n);return new R(r,a)}(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?jt(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Ut.ROW?P(this.p0.x-this.p3.x):t===Ut.COLUMN?P(this.p0.y-this.p3.y):0}getAngleAt(t){const e=O(t-.01,0),i=U(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return E(n.y-s.y,n.x-s.x)}}class Yt extends Ht{constructor(t,e){super(),this.type=Nt.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return D.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=E(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()?D.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Ut.ROW?P(this.p0.x-this.p1.x):t===Ut.COLUMN?P(this.p0.y-this.p1.y):0}}class $t{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,r,a,o){const h=new Xt(new R(this._lastX,this._lastY),new R(t,e),new R(i,s),new R(n,r));h.originP1=this._lastOriginP,h.originP2=o,h.defined=a,this.curves.push(h),this._lastX=n,this._lastY=r,this._lastOriginP=o}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 r=new Yt(new R(this._lastX,this._lastY),new R(t,e));return r.originP1=s,r.originP2=n,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Ut.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 P(t.p0.y-s.y)}if(t===Ut.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 P(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class zt extends $t{bezierCurveTo(t,e,i,s,n,r,a,o){return super.bezierCurveTo(e,t,s,i,r,n,a,o)}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 qt(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 Wt(t,e,i){const s=null!=e?e:P(i[i.length-1].x-i[0].x)>P(i[i.length-1].y-i[0].y)?Ut.ROW:Ut.COLUMN;return"monotoneY"===t?new zt(t,s):new $t(t,s)}class Vt{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 Kt(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=Wt("linear",i,t);return function(t,e){qt(t,e)}(new Vt(n,s),t),n}function Zt(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 Qt{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&&Zt(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:Zt(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 Jt(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 Kt(t,e);const n=Wt("basis",i,t);return function(t,e){qt(t,e)}(new Qt(n,s),t),n}function te(t){return t<0?-1:1}function ee(t,e,i){const s=t._x1-t._x0,n=e-t._x1,r=(t._y1-t._y0)/(s||Number(n<0&&-0)),a=(i-t._y1)/(n||Number(s<0&&-0)),o=(r*n+a*s)/(s+n);return(te(r)+te(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function ie(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function se(t,e,i,s,n){const r=t._x0,a=t._y0,o=t._x1,h=t._y1,l=(o-r)/3;t.context.bezierCurveTo(r+l,a+l*e,o-l,h-l*i,o,h,s,t.lastPoint1)}class ne{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:se(this,this._t0,ie(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,se(this,ie(this,e=ee(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:se(this,this._t0,e=ee(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 re extends ne{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}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;if(t.length<3-Number(!!s))return Kt(t,e);const n=Wt("monotoneX",i,t);return function(t,e){qt(t,e)}(new ne(n,s),t),n}function oe(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 Kt(t,e);const n=Wt("monotoneY",i,t);return function(t,e){qt(t,e)}(new re(n,s),t),n}let he=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;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 le(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 r=new $t("step",null!=s?s:P(t[t.length-1].x-t[0].x)>P(t[t.length-1].y-t[0].y)?Ut.ROW:Ut.COLUMN);return function(t,e){qt(t,e)}(new he(r,e,n),t),r}class ce extends Vt{lineEnd(){this.context.closePath()}}function ue(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=Wt("linear",i,t);return function(t,e){qt(t,e)}(new ce(n,s),t),n}function de(t,e,i,s,n){let r=t._x1,a=t._y1,o=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);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*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);o=(o*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(r,a,o,h,t._x2,t._y2,s,t.lastPoint1)}function pe(t,e){return function(i,s){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Kt(i,n);const o=Wt(t,r,i);return qt(new e(o,s,a),i),o}}const ge=pe("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:de(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 fe=pe("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:de(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 _e extends lt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ht(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([bt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([mt,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([yt,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,r){return this.commandList.push([gt,t,e,i,s,n,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,n,r),this}arcTo(t,e,i,s,n){return this.commandList.push([pt,t,e,i,s,n]),this._ctx&&this._ctx.arcTo(t,e,i,s,n),this}ellipse(t,e,i,s,n,r,a,o){return this.commandList.push([_t,t,e,i,s,n,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,s,n,r,a,o),this}rect(t,e,i,s){return this.commandList.push([vt,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,n,r){return this.commandList.push([dt,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([ft]),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()}toString(){if(!this.toStringCbList){const t=[];t[bt]=t=>`M${t[1]} ${t[2]}`,t[mt]=t=>`L${t[1]} ${t[2]}`,t[yt]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[gt]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[dt]=t=>{const e=[];((t,e,i,s,n,r,a)=>{const o=Math.abs(i-e),h=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,l=(i-e)/h;for(let i=0;i<h;i++){const o=e+l*i,h=e+l*(i+1),c=4*Math.tan(Math.abs(l)/4)/3,u=h<o?-1:1,d=Math.cos(o),p=Math.sin(o),g=Math.cos(h),f=Math.sin(h),_=d*r+s,m=p*a+n,b=g*r+s,y=f*a+n,v=r*c*u,A=a*c*u;t.push(_-v*p,m+A*d,b+v*f,y-A*g,b,y)}})(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[vt]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ft]=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 r=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,r=e.length;t<r;t++)if(At=e[t],xt=At.slice(1),Tt=At[0],i=[Tt],s=xt.match(ct),null!==s){for(let t=0,e=s.length;t<e;t++)wt=s[t],Ct=parseFloat(wt),Number.isNaN(Ct)||i.push(Ct);if(Bt=ut[Tt],i.length-1>Bt){let t,e=Tt;for(let s=1,r=i.length;s<r;s+=Bt){t=[e];for(let e=s,n=s+Bt;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(r,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 Kt(t,i);case"basis":return Jt(t,i);case"monotoneX":return ae(t,i);case"monotoneY":return oe(t,i);case"step":return le(t,.5,i);case"stepBefore":return le(t,0,i);case"stepAfter":return le(t,1,i);case"catmullRom":return ge(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return fe(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return ue(t,i)}}(e,i);"x"===s?this.direction=Ut.ROW:"y"===s?this.direction=Ut.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[bt]=this.moveToTransform,t[mt]=this.lineToTransform,t[yt]=this.quadraticCurveToTransform,t[gt]=this.bezierCurveToTransform,t[pt]=this.arcToTransform,t[_t]=this.ellipseTransform,t[vt]=this.rectTransform,t[dt]=this.arcTransform,t[ft]=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,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=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,c=null,u=0,d=0,p=0,g=0;for(let f=0,_=t.length;f<_;++f){switch(e=t[f],1===h&&1===l||(e=be(e,h,l)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+a,d+o);break;case"L":u=e[1],d=e[2],this.lineTo(u+a,d+o);break;case"h":u+=e[1],this.lineTo(u+a,d+o);break;case"H":u=e[1],this.lineTo(u+a,d+o);break;case"v":d+=e[1],this.lineTo(u+a,d+o);break;case"V":d=e[1],this.lineTo(u+a,d+o);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+a,d+o);break;case"M":u=e[1],d=e[2],this.moveTo(u+a,d+o);break;case"c":i=u+e[5],s=d+e[6],p=u+e[3],g=d+e[4],this.bezierCurveTo(u+e[1]+a,d+e[2]+o,p+a,g+o,i+a,s+o),u=i,d=s;break;case"C":u=e[5],d=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,g+o,u+a,d+o);break;case"s":i=u+e[3],s=d+e[4],p=2*u-p,g=2*d-g,this.bezierCurveTo(p+a,g+o,u+e[1]+a,d+e[2]+o,i+a,s+o),p=u+e[1],g=d+e[2],u=i,d=s;break;case"S":i=e[3],s=e[4],p=2*u-p,g=2*d-g,this.bezierCurveTo(p+a,g+o,e[1]+a,e[2]+o,i+a,s+o),u=i,d=s,p=e[1],g=e[2];break;case"q":i=u+e[3],s=d+e[4],p=u+e[1],g=d+e[2],this.quadraticCurveTo(p+a,g+o,i+a,s+o),u=i,d=s;break;case"Q":i=e[3],s=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,s+o),u=i,d=s,p=e[1],g=e[2];break;case"t":i=u+e[1],s=d+e[2],null===c[0].match(/[QqTt]/)?(p=u,g=d):"t"===c[0]?(p=2*u-n,g=2*d-r):"q"===c[0]&&(p=2*u-p,g=2*d-g),n=p,r=g,this.quadraticCurveTo(p+a,g+o,i+a,s+o),u=i,d=s,p=u+e[1],g=d+e[2];break;case"T":i=e[1],s=e[2],p=2*u-p,g=2*d-g,this.quadraticCurveTo(p+a,g+o,i+a,s+o),u=i,d=s;break;case"a":Rt(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+u+a,e[7]+d+o]),u+=e[6],d+=e[7];break;case"A":Rt(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=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 r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case mt:this.lineToTransform(a,e,i,s,n);break;case bt:this.moveToTransform(a,e,i,s,n);break;case gt:this.bezierCurveToTransform(a,e,i,s,n);break;case yt:this.quadraticCurveToTransform(a,e,i,s,n);break;case dt:this.arcToTransform(a,e,i,s,n);break;case _t:this.ellipseTransform(a,e,i,s,n);break;case vt:this.rectTransform(a,e,i,s,n);break;case pt:this.arcToTransform(a,e,i,s,n);break;case ft:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Gt(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Ut.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return P(t.p0.y-e.p1.y)}if(this.direction===Ut.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return P(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),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)}}}const me=["l",0,0,0,0,0,0,0];function be(t,e,i){const s=me[0]=t[0];if("a"===s||"A"===s)me[1]=e*t[1],me[2]=i*t[2],me[3]=t[3],me[4]=t[4],me[5]=t[5],me[6]=e*t[6],me[7]=i*t[7];else if("h"===s||"H"===s)me[1]=e*t[1];else if("v"===s||"V"===s)me[1]=i*t[1];else for(let s=1,n=t.length;s<n;++s)me[s]=(s%2==1?e:i)*t[s];return me}const ye={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 W},ve={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Ae=Object.assign({outerBorder:Object.assign(Object.assign({},ve),{distance:0}),innerBorder:Object.assign(Object.assign({},ve),{distance:0})},ve),xe={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},Te=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Ae),{alignSelf:"auto"}),{pickStrokeBuffer:0}),we={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Ce=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},{_debug_bounds:!1}),Te),ye),Be=Object.assign(Object.assign({},Ce),{startAngle:0,endAngle:S,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Me=Object.assign(Object.assign(Object.assign({},Ce),we),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Se=Object.assign(Object.assign({},Ce),{radius:1,startAngle:0,endAngle:S}),Pe=Object.assign(Object.assign({},Ce),{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}),Ee=Object.assign(Object.assign({},Ce),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Le=Object.assign(Object.assign(Object.assign({},Ce),we),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Oe=Object.assign(Object.assign({},Ce),{path:new _e,fillStrokeOrder:1,customPath:()=>{T.getInstance().warn("空函数")}}),Ue=Object.assign(Object.assign({},Ce),{points:[],cornerRadius:0,closePath:!0}),Ne=Object.assign(Object.assign({},Ce),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},Ce),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const Ie=Object.assign(Object.assign({},Ce),{symbolType:"circle",size:10,keepDirIn3d:!0}),ke=Object.assign(Object.assign(Object.assign({},Ce),xe),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Re=Object.assign(Object.assign(Object.assign({},Ce),xe),{editable:!1,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}),De=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Ce),{fill:!0,cornerRadius:0}),Ge=Object.assign(Object.assign({},De),{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 He=new class{},je={arc:Be,area:Me,circle:Se,line:Le,path:Oe,symbol:Ie,text:ke,rect:Ne,polygon:Ue,richtext:Re,richtextIcon:Ge,image:De,group:Pe,glyph:Ee},Fe=Object.keys(je);function Xe(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Ye={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),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 $e=new class{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Fe.forEach((t=>{this._defaultTheme[t]=Object.create(Ye[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,T.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Fe.forEach((s=>{const n=Object.create(Ye[s]);t&&t[s]&&Xe(n,t[s]),i[s]&&Xe(n,i[s]),e[s]&&Xe(n,e[s]),this.combinedTheme[s]=n})),e.common&&Fe.forEach((t=>{Xe(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 ze(t,e){return t.glyphHost?ze(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)):$e.getTheme()}return null}(t)||t.attachedThemeGraphic&&ze(t.attachedThemeGraphic)||$e.getTheme()}var qe=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{h(s.next(t))}catch(t){r(t)}}function o(t){try{h(s.throw(t))}catch(t){r(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(a,o)}h((s=s.apply(t,e||[])).next())}))};class We extends a{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=i.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 qe(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&&T.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=h(i,!0)&&i||d(i)&&i.capture,n=d(i)&&i.once,r=l(e)?void 0:e;return t=s?`${t}capture`:t,e=l(e)?e:e.handleEvent,n?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const s=h(i,!0)&&i||d(i)&&i.capture,n=l(e)?void 0:e;t=s?`${t}capture`:t,e=l(e)?e:e.handleEvent;const r=d(i)&&i.once;return super.off(t,e,n,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return d(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 Ve{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=Ve.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=this.pickParams.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&&l(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&&l(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Ke extends Ve{constructor(t,e){super(),this.type=t,this.detail=e}}const Ze={dispatchEvent(t){var e;if(!(t instanceof Ve))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 Ke(t,e))}};class Qe{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-Qe.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Qe.bounceIn(2*t):.5*Qe.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const s=e/S*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*S/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const s=e/S*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*S/e)+1}}static getElasticInOut(t,e){return function(i){const s=e/S*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*S/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*S/e)*.5+1}}}Qe.quadIn=Qe.getPowIn(2),Qe.quadOut=Qe.getPowOut(2),Qe.quadInOut=Qe.getPowInOut(2),Qe.cubicIn=Qe.getPowIn(3),Qe.cubicOut=Qe.getPowOut(3),Qe.cubicInOut=Qe.getPowInOut(3),Qe.quartIn=Qe.getPowIn(4),Qe.quartOut=Qe.getPowOut(4),Qe.quartInOut=Qe.getPowInOut(4),Qe.quintIn=Qe.getPowIn(5),Qe.quintOut=Qe.getPowOut(5),Qe.quintInOut=Qe.getPowInOut(5),Qe.backIn=Qe.getBackIn(1.7),Qe.backOut=Qe.getBackOut(1.7),Qe.backInOut=Qe.getBackInOut(1.7),Qe.elasticIn=Qe.getElasticIn(1,.3),Qe.elasticOut=Qe.getElasticOut(1,.3),Qe.elasticInOut=Qe.getElasticInOut(1,.3*1.5);const Je=new class{constructor(){this.id=i.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===Et.END?this.removeAnimate(e):e.status===Et.RUNNING||e.status===Et.INITIAL?(this.animateCount++,e.advance(t)):e.status===Et.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 ti{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 ei extends ti{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class ii{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Je,s=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e,this.status=Et.INITIAL,this.tailAnimate=new si(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=s}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=O(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){ii.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]:ii.mode;t&&e&Lt.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Pt.ANIMATE_PLAY})}runCb(t){const e=new ei((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,r){const a=ii.interpolateMap.get(t)||ii.interpolateMap.get("");return!!a&&a(t,e,i,s,n,r)}pause(){this.status===Et.RUNNING&&(this.status=Et.PAUSED)}resume(){this.status===Et.PAUSED&&(this.status=Et.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 si(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===Et.INITIAL&&(this.status=Et.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Et.RUNNING&&(this.status=Et.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 r=t>=n;if(r&&(t=n),t===s)return r;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),r}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=Et.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()}}ii.mode=Lt.NORMAL,ii.interpolateMap=new Map;class si{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 ni(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?Qe[i]:i,n=this._addStep(e,null,s);return n.type=Ot.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?Qe[i]:i,r=this._addStep(e,null,n);return r.type=Ot.to,this._appendProps(t,r,!!s&&s.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),s&&s.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.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=Ot.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=Ot.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 ni(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 r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[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 r,a,o=!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&&(o=!0,i<0))return o;if(r=Math.floor(t/i),a=t-r*i,o=t>=s*i+i,o&&(a=i,r=s,t=a*r+i),t===n)return o;const l=!this.reversed!=!(this.bounce&&r%2);return l&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+h,this.updatePosition(o,l),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const s=this.position,n=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=s;)i=r,r=i.next;let a=t?0===n?1:s/n:(s-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}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 T.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 ni{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 ri=200,ai="cubicOut";var oi;!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"}(oi||(oi={}));const hi=[0,0,0,0];var li;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(li||(li={}));class ci{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:li.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===li.Color1){const e=ci.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=rt.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];ci.store1[t]=e,ci.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=ci.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=rt.parseColorString(t);return n&&(ci.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],ci.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===li.Color1){if(ci.store1[t])return;ci.store1[t]=i,ci.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(ci.store255[t])return;ci.store255[t]=i,ci.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function ui(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&f(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 di(t,e,i,s,n){return Array.isArray(t)&&!f(t[0])||Array.isArray(e)&&!f(e[0])?new Array(4).fill(0).map(((n,r)=>pi(g(t)?t[r]:t,g(e)?e[r]:e,i,s))):pi(t,e,i,s,n)}function pi(t,e,i,s,n){if(!t||!e)return t&&ui(t)||e&&ui(e)||!1;let r,a,o=!1,h=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=ci.Get(t,li.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=ci.Get(e,li.Color255):h=!0,o!==h){const r=o?t:e,a=o?e:t,h=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:ui(a)})))});return o?di(r,h,i,s,n):di(h,r,i,s,n)}if(o){if(t.gradient===e.gradient){const s=t,n=e,r=s.stops,a=n.stops;if(r.length!==a.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:_i(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:_i(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:_i(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(r,a),ui(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]}(r,a,i),s)}ci.store255={},ci.store1={};const gi=[0,0,0,0],fi=[0,0,0,0];function _i(t,e,i){return ci.Get(t,li.Color255,gi),ci.Get(e,li.Color255,fi),`rgba(${Math.round(gi[0]+(fi[0]-gi[0])*i)},${Math.round(gi[1]+(fi[1]-gi[1])*i)},${Math.round(gi[2]+(fi[2]-gi[2])*i)},${gi[3]+(fi[3]-gi[3])*i})`}class mi{static GetImage(t,e){var i;const s=mi.cache.get(t);s?"fail"===s.loadState?He.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?He.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=He.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=He.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=He.global.loadBlob(t):"json"===e&&(i.dataPromise=He.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=He.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=bi(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=bi(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 bi(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=[];const yi=new W,vi=new z,Ai=["lineWidth","scaleX","scaleY","angle","anchor","visible"],xi=["x","y"],Ti=["scaleX","scaleY"],wi=["angle"],Ci=new R;class Bi extends We{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const s=e[i];Object.defineProperty(Bi.prototype,s,Object.getOwnPropertyDescriptor(t,s))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}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 z,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:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Ci.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),Ci.y=r+(null!==(s=t.scrollY)&&void 0!==s?s:0)}else Ci.x=n,Ci.y=r;return Ci}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;He.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return He.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new q),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}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,r=(a=n)?g(a)?0===a.length?0:1===a.length?a[0]:2===a.length?(hi[0]=a[0],hi[2]=a[0],hi[1]=a[1],hi[3]=a[1],hi):a:a:0;var a;return r&&s.expand(r),this.clearUpdateBoundTag(),s}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new ht(t);return Gt(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 W),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&Mt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&He.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&Mt.UPDATE_BOUNDS)&&He.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===St.GLOBAL){const i=new R(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return s.containsPoint(this,{x:t,y:e})}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 r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);r?this._setAttributes(r,i,s):c(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]:Ai;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]:Ai;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Pt.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:Pt.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,xi,n);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const a=this.attribute,o=a.postMatrix;return o?He.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:ye.x)+t,a.y=(null!==(s=a.y)&&void 0!==s?s:ye.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:Pt.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,xi,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 r={type:Pt.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,Ti,r);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(i){let{postMatrix:s}=this.attribute;s||(s=new W,o.postMatrix=s),He.transformUtil.fromMatrix(s,s).scale(t,e,i)}else o.scaleX=(null!==(s=o.scaleX)&&void 0!==s?s:ye.scaleX)*t,o.scaleY=(null!==(n=o.scaleY)&&void 0!==n?n:ye.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const s={type:Pt.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Ti,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:Pt.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,wi,s);n&&(delete n.angle,this._setAttributes(n,!1,s));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new W,r.postMatrix=i),He.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:ye.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:Pt.ROTATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,wi,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){this.animates||(this.animates=new Map);const e=new ii(null==t?void 0:t.id,this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(e.bind(this),t){const{onStart:i,onFrame:s,onEnd:n,onRemove:r}=t;null!=i&&e.onStart(i),null!=s&&e.onFrame(s),null!=n&&e.onEnd(n),null!=r&&e.onRemove(r),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(He.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!c(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,r,a,o;if(i){const i=Object.keys(t),h=this.getNoWorkAnimateAttr(),l={};let c;i.forEach((e=>{h[e]?(c||(c={}),c[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!==(r=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==r?r:ri,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:ai),c&&this.setAttributes(c,!1,{type:Pt.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Pt.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();y(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?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,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}=this.attribute;return vi.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(vi),this.setAttributes({scaleX:t,scaleY:i,angle:s}),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=ye.x,y:e=ye.y,scaleX:i=ye.scaleX,scaleY:s=ye.scaleY,angle:n=ye.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let h=[0,0];const l={};if(a&&(h=this.getAnchor(a,l)),!r||1===i&&1===s)!function(t,e,i,s,n,r,a,o){const h=e.a,l=e.b,c=e.c,u=e.d,d=e.e,p=e.f,g=L(a),f=N(a);let _,m;o?(_=o[0],m=o[1]):(_=i,m=s);const b=_-i,y=m-s,v=h*g+c*f,A=l*g+u*f,x=c*g-h*f,T=u*g-l*f;t.a=n*v,t.b=n*A,t.c=r*x,t.d=r*T,t.e=d+h*_+c*m-v*b-x*y,t.f=p+l*_+u*m-A*b-T*y}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,a&&h);else{const a=this._transMatrix;a.reset(),a.translate(h[0],h[1]),a.rotate(n),a.translate(-h[0],-h[1]),a.translate(t,e),h=this.getAnchor(r,l),He.transformUtil.fromMatrix(a,a).scale(i,s,{x:h[0],y:h[1]})}const c=this.getOffsetXY(ye);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=yi.setValue(o.a,o.b,o.c,o.d,o.e,o.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.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),He.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Pt.ANIMATE_END})}onStep(t,e,i,s,n){const r={};if(i.customAnimate)i.customAnimate.update(n,s,r);else{const a=i.props,o=i.parsedProps,h=i.propKeys;this.stepInterpolate(t,e,r,i,s,n,a,void 0,o,h)}this.setAttributes(r,!1,{type:Pt.ANIMATE_UPDATE,animationState:{ratio:s,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,s,n,r,a,o,h,l){l||(l=Object.keys(a),s.propKeys=l),r?s.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):l.forEach((r=>{var l;if(!e.validAttr(r))return;const c=a[r],u=null!==(l=o&&o[r])&&void 0!==l?l:t.getLastPropByName(r,s);if(null==c||null==u||c===u)return void(i[r]=c);let d;d=e.interpolateFunc&&e.interpolateFunc(r,n,u,c,i),d||(d=e.customInterpolate(r,n,u,c,this,i),d||this.defaultInterpolate(c,u,r,i,h,n)||this._interpolate(r,n,u,c,i))})),s.parsedProps=h}defaultInterpolate(t,e,i,s,n,r){if(Number.isFinite(t))return s[i]=e+(t-e)*r,!0;if("fill"===i){n||(n={});const a=n.fillColorArray,o=di(e,null!=a?a:t,r,!1,((t,e)=>{n.fillColorArray=e}));return o&&(s[i]=o),!0}if("stroke"===i){n||(n={});const a=n.strokeColorArray,o=di(e,null!=a?a:t,r,!1,((t,e)=>{n.strokeColorArray=e}));return o&&(s[i]=o),!0}if("shadowColor"===i){n||(n={});const a=n.shadowColorArray,o=di(e,null!=a?a:t,r,!0,((t,e)=>{n.shadowColorArray=e}));return o&&(s[i]=o),!0}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:He.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),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 p(t,!0)?this.pathProxy=(new _e).fromString(t):this.pathProxy=new _e,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):(_(t)||t.includes("/")||m(t))&&(mi.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):d(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",He.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new Ke(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)}}}Bi.mixin(Ze);let Mi=0;function Si(){return Mi++}var Pi;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Pi||(Pi={}));const Ei=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Ei.set(t,!0)));const Li=new Map;[""].forEach((t=>Li.set(t,!0))),Si(),Si(),Si(),Si(),Si(),Si(),Si(),Si(),Si(),Si(),Si();const Oi=Si();Si(),Si(),Si(),Si();const Ui=["width","x1","y1","height","cornerRadius",...Ai];class Ni extends Bi{constructor(t){super(t),this.type="rect",this.numberType=Oi}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return ze(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:r,x:a,y:o}=t;e=null!=e?e:n-a,s=null!=s?s:r-o,(isFinite(e)||isFinite(s)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=He.graphicService.updateTempAABBBounds(i);return((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=s;i.expand(r+(n+a)/2)}})(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),He.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,Ui)}needUpdateTag(t){return super.needUpdateTag(t,Ui)}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=c(t.width)?t.x1-t.x:t.width,i=c(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),r=new _e;return r.moveTo(e,i),r.rect(e,i,s,n),r}clone(){return new Ni(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ni.NOWORK_ANIMATE_ATTR}}Ni.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 Ii="undefined"==typeof window||void 0===window.window;!function(){if(Ii)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 ki(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)}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 i=this.customDistRowFunction&&this.customDistRowFunction(this.row,this.table);i?(this.row=i.distRow,t=i.animation??!0):e(this.row)&&this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):e(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 i=this.customDistColFunction&&this.customDistColFunction(this.col,this.table);i?(this.col=i.distCol,t=i.animation??!0):e(this.col)&&this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):e(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.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,r;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}},r={start:{col:0,row:i[0]},end:{col:this.table.rowHeaderLevelCount-1,row:i[1]}}):this.table.internalProps.transpose?r={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&&(r={start:{col:0,row:i[0]},end:{col:0,row:i[1]}})),!1===this.options?.colHighlight||ki(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||ki(this.rowHeaderRange,r)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),r&&this.table.arrangeCustomCellStyle({range:r},"row-highlight"),this.rowHeaderRange=r)}},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){var e,i;(e=this.range,i=t,!e&&!i||e&&i&&e.start.col===i.start.col&&e.start.row===i.start.row&&e.end.col===i.end.col&&e.end.row===i.end.row)||(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(function(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}(e,i.col,i.row))s.removeAllChild();else if(!s.firstChild){const t=(n={x:0,y:0,width:i.attribute.width,height:i.attribute.height,fill:this._fill,opacity:this._opacity},new Ni(n));t.name="shadow-rect",s.appendChild(t)}}else s.removeAllChild();var n}))}))}}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vtable-plugins",
3
- "version": "1.17.1-alpha.9",
3
+ "version": "1.17.1",
4
4
  "description": "The search util of VTable",
5
5
  "author": {
6
6
  "name": "VisActor",
@@ -33,11 +33,9 @@
33
33
  "@visactor/vutils": "~0.19.1"
34
34
  },
35
35
  "peerDependencies": {
36
- "@visactor/vtable": "1.17.1-alpha.9"
36
+ "@visactor/vtable": "1.17.1"
37
37
  },
38
38
  "devDependencies": {
39
- "@visactor/vtable": "1.17.1-alpha.9",
40
- "@visactor/vtable-editors": "1.17.1-alpha.9",
41
39
  "@visactor/vchart": "1.13.3-alpha.2",
42
40
  "@rushstack/eslint-patch": "~1.1.4",
43
41
  "react": "^18.0.0",
@@ -80,8 +78,10 @@
80
78
  "@types/react-is": "^17.0.3",
81
79
  "rollup-plugin-node-resolve": "5.2.0",
82
80
  "@internal/bundler": "0.0.1",
81
+ "@visactor/vtable": "1.17.1",
83
82
  "@internal/eslint-config": "0.0.1",
84
- "@internal/ts-config": "0.0.1"
83
+ "@internal/ts-config": "0.0.1",
84
+ "@visactor/vtable-editors": "1.17.1"
85
85
  },
86
86
  "scripts": {
87
87
  "start": "vite ./demo",