@leafer-draw/worker 2.2.11 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/worker.js +58 -22
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +62 -23
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t,e;function s(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o}function i(t,e,s,i){return new(s||(s=Promise))(function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}h((i=i.apply(t,e||[])).next())})}!function(t){t[t.none=1]="none",t[t.free=2]="free",t[t.mirrorAngle=3]="mirrorAngle",t[t.mirror=4]="mirror"}(t||(t={})),"function"==typeof SuppressedError&&SuppressedError,function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(e||(e={}));const r={};function n(t){return void 0===t}function o(t){return null==t}function a(t){return"string"==typeof t}const{isFinite:h}=Number;function l(t){return"number"==typeof t}const d=/^-?\d+(?:\.\d+)?$/;function c(t){return"string"==typeof t&&d.test(t)?+t:t}const{isArray:u}=Array;function _(t){return t&&"object"==typeof t}function p(t){return _(t)&&!u(t)}function g(t){return"{}"===JSON.stringify(t)}const f={default:(t,e)=>(y(e,t),y(t,e),t),assign(t,e,s){let i;Object.keys(e).forEach(r=>{var n,o;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(n=t[r])||void 0===n?void 0:n.constructor)===Object)return y(t[r],e[r],s&&s[r]);s&&r in s?(null===(o=s[r])||void 0===o?void 0:o.constructor)===Object&&y(t[r]={},e[r],s[r]):t[r]=e[r]})},copyAttrs:(t,e,s)=>(s.forEach(s=>{n(e[s])||(t[s]=e[s])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,i=t.length;s<i;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:y}=f;class m{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __usePathBox(){return this.__pathInputed}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(!n(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let s;for(let i in this)"_"!==i[0]&&(s=e?e[i]:void 0,t[i]=n(s)?this[i]:s);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!n(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!n(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const s={};if(t)if(u(t))for(let e of t)s[e]=this.__getInput(e);else for(let e in t)s[e]=this.__getInput(e);else{let t,e,{__input:i}=this;s.tag=this.__leaf.tag;for(let r in this)if("_"!==r[0]&&(t=this["_"+r],!n(t))){if("path"===r&&!this.__pathInputed)continue;e=i?i[r]:void 0,s[r]=n(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:i,d:r,e:n,f:o}=this.__leaf.__localMatrix;s.matrix={a:t,b:e,c:i,d:r,e:n,f:o}}return s}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null,this.__complexData&&this.__complexData.destroy()}}const x={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CANVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=w;return e[t]?e[t]++:(e[t]=1,0)}},w=x;let v,b,k;const{max:S}=Math,B=[0,0,0,0],C={zero:[...B],tempFour:B,set:(t,e,s,i,r)=>(void 0===s&&(s=i=r=e),t[0]=e,t[1]=s,t[2]=i,t[3]=r,t),setTemp:(t,e,s,i)=>R(B,t,e,s,i),toTempAB(t,e,s){k=s?l(t)?e:t:[],l(t)?(v=T(t),b=e):l(e)?(v=t,b=T(e)):(v=t,b=e),4!==v.length&&(v=P(v)),4!==b.length&&(b=P(b))},get(t,e){let s;if(!l(t))switch(t.length){case 4:s=n(e)?t:[...t];break;case 2:s=[t[0],t[1],t[0],t[1]];break;case 3:s=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(s||(s=[t,t,t,t]),!n(e))for(let t=0;t<4;t++)s[t]>e&&(s[t]=e);return s},max:(t,e,s)=>l(t)&&l(e)?S(t,e):(O(t,e,s),R(k,S(v[0],b[0]),S(v[1],b[1]),S(v[2],b[2]),S(v[3],b[3]))),add:(t,e,s)=>l(t)&&l(e)?t+e:(O(t,e,s),R(k,v[0]+b[0],v[1]+b[1],v[2]+b[2],v[3]+b[3])),swapAndScale(t,e,s,i){if(l(t))return e===s?t*e:[t*s,t*e];const r=i?t:[],[n,o,a,h]=4===t.length?t:P(t);return R(r,a*s,h*e,n*s,o*e)}},{set:R,get:P,setTemp:T,toTempAB:O}=C,{round:L,pow:E,max:A,floor:I,PI:M}=Math,W={},D={within:(t,e,s)=>(_(e)&&(s=e.max,e=e.min),!n(e)&&t<e&&(t=e),!n(s)&&t>s&&(t=s),t),fourNumber:C.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),D.float(t)),getGapRotation(t,e,s=0){let i=t+s;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-s},float(t,e){const s=n(e)?1e12:E(10,e);return-0===(t=L(t*s)/s)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,s,i){if(i||(i={}),e){const t=(l(e)?e:e.width||0)/s.width,r=(l(e)?e:e.height||0)/s.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&D.assignScale(i,t);return i},getScaleFixedData(t,e,s,i,r){let{scaleX:n,scaleY:o}=t;if((i||e)&&(n<0&&(n=-n),o<0&&(o=-o)),e)if(!0===e)n=o=s?1:1/n;else{let t;l(e)?t=e:"zoom-in"===e&&(t=1),t&&(n=o=n>t||o>t?s?1:1/n:s?1:1/t)}return W.scaleX=n,W.scaleY=o,W},assignScale(t,e){l(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>A(I(t),e)/t,randInt:F,randColor:t=>`rgba(${F(255)},${F(255)},${F(255)},${t||1})`};function F(t){return Math.round(Math.random()*t)}const z=M/180,N=2*M,Y=M/2;function X(){return{x:0,y:0}}function U(){return{x:0,y:0,width:0,height:0}}function j(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:V,cos:G,acos:q,sqrt:H}=Math,{float:Q}=D,J={};function $(){return Object.assign(Object.assign(Object.assign({},{a:1,b:0,c:0,d:1,e:0,f:0}),{x:0,y:0,width:0,height:0}),{scaleX:1,scaleY:1,rotation:0,skewX:0,skewY:0})}const Z={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:$(),tempMatrix:{},set(t,e=1,s=0,i=0,r=1,n=0,o=0){t.a=e,t.b=s,t.c=i,t.d=r,t.e=n,t.f=o},get:j,getWorld:$,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,s){t.e+=e,t.f+=s},translateInner(t,e,s,i){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,i&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},pixelScale(t,e,s){s||(s=t),s.a=t.a*e,s.b=t.b*e,s.c=t.c*e,s.d=t.d*e,s.e=t.e*e,s.f=t.f*e},scaleOfOuter(t,e,s,i){K.toInnerPoint(t,e,J),K.scaleOfInner(t,J,s,i)},scaleOfInner(t,e,s,i=s){K.translateInner(t,e.x,e.y),K.scale(t,s,i),K.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:i,c:r,d:n}=t,o=G(e*=z),a=V(e);t.a=s*o-i*a,t.b=s*a+i*o,t.c=r*o-n*a,t.d=r*a+n*o},rotateOfOuter(t,e,s){K.toInnerPoint(t,e,J),K.rotateOfInner(t,J,s)},rotateOfInner(t,e,s){K.translateInner(t,e.x,e.y),K.rotate(t,s),K.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:i,b:r,c:n,d:o}=t;s&&(s*=z,t.a=i+n*s,t.b=r+o*s),e&&(e*=z,t.c=n+i*e,t.d=o+r*e)},skewOfOuter(t,e,s,i){K.toInnerPoint(t,e,J),K.skewOfInner(t,J,s,i)},skewOfInner(t,e,s,i=0){K.translateInner(t,e.x,e.y),K.skew(t,s,i),K.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:i,c:r,d:n,e:o,f:a}=t;t.a=e.a*s+e.b*r,t.b=e.a*i+e.b*n,t.c=e.c*s+e.d*r,t.d=e.c*i+e.d*n,t.e=e.e*s+e.f*r+o,t.f=e.e*i+e.f*n+a},multiplyParent(t,e,s,i,r){const{e:o,f:a}=t;if(s||(s=t),n(i)&&(i=1!==t.a||t.b||t.c||1!==t.d),i){const{a:i,b:n,c:o,d:a}=t;s.a=i*e.a+n*e.c,s.b=i*e.b+n*e.d,s.c=o*e.a+a*e.c,s.d=o*e.b+a*e.d,r&&(s.scaleX=e.scaleX*r.scaleX,s.scaleY=e.scaleY*r.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,r&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=o*e.a+a*e.c+e.e,s.f=o*e.b+a*e.d+e.f},divide(t,e){K.multiply(t,K.tempInvert(e))},divideParent(t,e){K.multiplyParent(t,K.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=K;return K.copy(e,t),K.invert(e),e},invert(t){const{a:e,b:s,c:i,d:r,e:n,f:o}=t;if(s||i){const a=1/(e*r-s*i);t.a=r*a,t.b=-s*a,t.c=-i*a,t.d=e*a,t.e=-(n*r-o*i)*a,t.f=-(o*e-n*s)*a}else if(1===e&&1===r)t.e=-n,t.f=-o;else{const s=1/(e*r);t.a=r*s,t.d=e*s,t.e=-n*r*s,t.f=-o*e*s}},toOuterPoint(t,e,s,i){const{x:r,y:n}=e;s||(s=e),s.x=r*t.a+n*t.c,s.y=r*t.b+n*t.d,i||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,i){const{a:r,b:n,c:o,d:a}=t,h=1/(r*a-n*o),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*o)*h,s.y=(d*r-l*n)*h,!i){const{e:e,f:i}=t;s.x-=(e*a-i*o)*h,s.y-=(i*r-e*n)*h}},setLayout(t,e,s,i,r){const{x:o,y:a,scaleX:h,scaleY:l}=e;if(n(r)&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:s,skewX:i,skewY:r}=e,n=s*z,o=G(n),a=V(n);if(i||r){const e=i*z,s=r*z;t.a=(o+s*-a)*h,t.b=(a+s*o)*h,t.c=(e*o-a)*l,t.d=(o+e*a)*l}else t.a=o*h,t.b=a*h,t.c=-a*l,t.d=o*l}else t.a=h,t.b=0,t.c=0,t.d=l;t.e=o,t.f=a,(s=s||i)&&K.translateInner(t,-s.x,-s.y,!i)},getLayout(t,e,s,i){const{a:r,b:n,c:o,d:a,e:h,f:l}=t;let d,c,u,_,p,g=h,f=l;if(n||o){const t=r*a-n*o;if(o&&!i){d=H(r*r+n*n),c=t/d;const e=r/d;u=n>0?q(e):-q(e)}else{c=H(o*o+a*a),d=t/c;const e=o/c;u=Y-(a>0?q(-e):-q(e))}const e=Q(G(u)),s=V(u);d=Q(d),c=Q(c),_=e?Q((o/c+s)/e/z,9):0,p=e?Q((n/d-s)/e/z,9):0,u=Q(u/z)}else d=r,c=a,u=_=p=0;return(e=s||e)&&(g+=e.x*r+e.y*o,f+=e.x*n+e.y*a,s||(g-=e.x,f-=e.y)),{x:g,y:f,scaleX:d,scaleY:c,rotation:u,skewX:_,skewY:p}},withScale(t,e,s=e){const i=t;if(!e||!s){const{a:i,b:r,c:n,d:o}=t;r||n?s=(i*o-r*n)/(e=H(i*i+r*r)):(e=i,s=o)}return i.scaleX=e,i.scaleY=s,i},reset(t){K.set(t)}},K=Z,{float:tt}=D,{toInnerPoint:et,toOuterPoint:st}=Z,{sin:it,cos:rt,abs:nt,sqrt:ot,atan2:at,min:ht,round:lt}=Math,dt={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,s){t.radiusX=e,t.radiusY=n(s)?e:s},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,s){t.x=e,t.y=s},round(t,e){t.x=e?lt(t.x-.5)+.5:lt(t.x),t.y=e?lt(t.y-.5)+.5:lt(t.y)},move(t,e,s){_(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=s)},scale(t,e,s=e){t.x&&(t.x*=e),t.y&&(t.y*=s)},scaleOf(t,e,s,i=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(i-1)},rotate(t,e,s,i=1,r=1){s||(s=ct.defaultPoint);const n=rt(e*=z),o=it(e),a=(t.x-s.x)/i,h=(t.y-s.y)/r;t.x=s.x+(a*n-h*o)*i,t.y=s.y+(a*o+h*n)*r},tempToInnerOf(t,e){const{tempPoint:s}=ct;return _t(s,t),et(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=ct;return _t(s,t),st(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=ct;return _t(s,t),ct.toInnerRadiusPointOf(t,e,s),s},copyRadiusPoint:(t,e,s,i)=>(_t(t,e),pt(t,s,i),t),toInnerRadiusPointOf(t,e,s){s||(s=t),et(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){et(e,t,s)},toOuterOf(t,e,s){st(e,t,s)},toVertical(t,e,s,i){const r=e*z;t.x+=-Math.sin(r)*s,t.y+=Math.cos(r)*s},getCenter:(t,e)=>({x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}),getCenterX:(t,e)=>t+(e-t)/2,getCenterY:(t,e)=>t+(e-t)/2,getDistance:(t,e)=>ut(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,i){const r=nt(s-t),n=nt(i-e);return ot(r*r+n*n)},getMinDistanceFrom:(t,e,s,i,r,n)=>ht(ut(t,e,s,i),ut(s,i,r,n)),getAngle:(t,e,s,i)=>gt(t,e,s,i)/z,getRotation:(t,e,s,i)=>(i||(i=e),ct.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,i.x,i.y)/z),getRadianFrom(t,e,s,i,r,o,a,h){n(a)&&(a=s,h=i);const l=t-s,d=e-i,c=r-a,u=o-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e,s=1,i=1)=>at((e.y-t.y)/i,(e.x-t.x)/s),getDistancePoint(t,e,s,i,r){const n=gt(t,e);return r&&(t=e),i||(e={}),e.x=t.x+rt(n)*s,e.y=t.y+it(n)*s,e},toNumberPoints(t){let e=t;return _(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},isSame:(t,e,s)=>s?t.x===e.x&&t.y===e.y:tt(t.x)===tt(e.x)&&tt(t.y)===tt(e.y),reset(t){t.x=t.y=0}},ct=dt,{getDistanceFrom:ut,copy:_t,setRadius:pt,getAtan2:gt}=ct;class ft{constructor(t,e){this.set(t,e)}set(t,e){return _(t)?dt.copy(this,t):dt.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new ft(this)}move(t,e){return dt.move(this,t,e),this}scale(t,e){return dt.scale(this,t,e),this}scaleOf(t,e,s){return dt.scaleOf(this,t,e,s),this}rotate(t,e,s,i){return dt.rotate(this,t,e,s,i),this}rotateOf(t,e,s,i){return dt.rotate(this,e,t,s,i),this}getRotation(t,e,s){return dt.getRotation(this,t,e,s)}toInnerOf(t,e){return dt.toInnerOf(this,t,e),this}toOuterOf(t,e){return dt.toOuterOf(this,t,e),this}getCenter(t){return new ft(dt.getCenter(this,t))}getDistance(t){return dt.getDistance(this,t)}getDistancePoint(t,e,s,i){return new ft(dt.getDistancePoint(this,t,e,s,i))}getAngle(t,e,s){return dt.getAngle(this,t,e,s)}getAtan2(t,e,s){return dt.getAtan2(this,t,e,s)}isSame(t,e){return dt.isSame(this,t,e)}reset(){return dt.reset(this),this}}const yt=new ft;class mt{constructor(t,e,s,i,r,n){this.set(t,e,s,i,r,n)}set(t,e,s,i,r,n){return _(t)?Z.copy(this,t):Z.set(this,t,e,s,i,r,n),this}setWith(t){return Z.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:s,d:i,e:r,f:n}=this;return{a:t,b:e,c:s,d:i,e:r,f:n}}clone(){return new mt(this)}translate(t,e){return Z.translate(this,t,e),this}translateInner(t,e){return Z.translateInner(this,t,e),this}scale(t,e){return Z.scale(this,t,e),this}scaleWith(t,e){return Z.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return Z.pixelScale(this,t),this}scaleOfOuter(t,e,s){return Z.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return Z.scaleOfInner(this,t,e,s),this}rotate(t){return Z.rotate(this,t),this}rotateOfOuter(t,e){return Z.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return Z.rotateOfInner(this,t,e),this}skew(t,e){return Z.skew(this,t,e),this}skewOfOuter(t,e,s){return Z.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return Z.skewOfInner(this,t,e,s),this}multiply(t){return Z.multiply(this,t),this}multiplyParent(t){return Z.multiplyParent(this,t),this}divide(t){return Z.divide(this,t),this}divideParent(t){return Z.divideParent(this,t),this}invert(){return Z.invert(this),this}invertWith(){return Z.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){Z.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){Z.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return Z.setLayout(this,t,e,s),this}getLayout(t,e,s){return Z.getLayout(this,t,e,s)}withScale(t,e){return Z.withScale(this,t,e)}reset(){return Z.reset(this),this}}const xt=new mt,wt={tempPointBounds:{},setPoint(t,e,s){t.minX=t.maxX=e,t.minY=t.maxY=s},addPoint(t,e,s){t.minX=e<t.minX?e:t.minX,t.minY=s<t.minY?s:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=s>t.maxY?s:t.maxY},addBounds(t,e,s,i,r){vt(t,e,s),vt(t,e+i,s+r)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}},{addPoint:vt}=wt;var bt,kt;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(bt||(bt={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center",t[t["top-left"]=0]="top-left",t[t["top-right"]=2]="top-right",t[t["bottom-right"]=4]="bottom-right",t[t["bottom-left"]=6]="bottom-left"}(kt||(kt={}));const St=[{x:0,y:0},{x:.5,y:0},{x:1,y:0},{x:1,y:.5},{x:1,y:1},{x:.5,y:1},{x:0,y:1},{x:0,y:.5},{x:.5,y:.5}];St.forEach(t=>t.type="percent");const Bt={directionData:St,tempPoint:{},get:Ct,toPoint(t,e,s,i,r,n){const o=Ct(t);s.x=o.x,s.y=o.y,"percent"===o.type&&(s.x*=e.width,s.y*=e.height,r&&(n||(s.x-=r.x,s.y-=r.y),o.x&&(s.x-=1===o.x?r.width:.5===o.x?o.x*r.width:0),o.y&&(s.y-=1===o.y?r.height:.5===o.y?o.y*r.height:0))),i||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s,i=!0)=>(s||(s={}),Bt.toPoint(t,e,s,i),s)};function Ct(t){return a(t)?St[kt[t]]:t}const{toPoint:Rt}=Bt,Pt={toPoint(t,e,s,i,r,n){Rt(t,s,i,r,e,n)}},{tempPointBounds:Tt,setPoint:Ot,addPoint:Lt,toBounds:Et}=wt,{toOuterPoint:At}=Z,{float:It,fourNumber:Mt}=D,{floor:Wt,ceil:Dt}=Math;let Ft,zt,Nt,Yt;const Xt={},Ut={},jt={},Vt={tempBounds:jt,set(t,e=0,s=0,i=0,r=0){t.x=e,t.y=s,t.width=i,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,i,r){const{x:n,y:o,width:a,height:h}=e;if(u(s)){const e=Mt(s);i?Gt.set(t,n+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):Gt.set(t,n-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else i&&(s=-s),Gt.set(t,n-s,o-s,a+2*s,h+2*s);r&&("width"===r?(t.y=o,t.height=h):(t.x=n,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,s){t.x+=e,t.y+=s},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,s)=>(t=Object.assign({},t),Gt.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Ht(e,t):e=t,s||(s=t),e.offsetX=Gt.maxX(s),e.offsetY=Gt.maxY(s),Gt.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,i){i||dt.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,i=s){dt.scaleOf(t,e,s,i),t.width*=s,t.height*=i},tempToOuterOf:(t,e)=>(Gt.copy(jt,t),Gt.toOuterOf(jt,e),jt),getOuterOf:(t,e)=>(t=Object.assign({},t),Gt.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:i,d:r,e:n,f:o}=e;i>0?(s.width=t.width*i,s.x=n+t.x*i):(s.width=t.width*-i,s.x=n+t.x*i-s.width),r>0?(s.height=t.height*r,s.y=o+t.y*r):(s.height=t.height*-r,s.y=o+t.y*r-s.height)}else Xt.x=t.x,Xt.y=t.y,At(e,Xt,Ut),Ot(Tt,Ut.x,Ut.y),Xt.x=t.x+t.width,At(e,Xt,Ut),Lt(Tt,Ut.x,Ut.y),Xt.y=t.y+t.height,At(e,Xt,Ut),Lt(Tt,Ut.x,Ut.y),Xt.x=t.x,At(e,Xt,Ut),Lt(Tt,Ut.x,Ut.y),Et(Tt,s)},toInnerOf(t,e,s){s||(s=t),Gt.move(s,-e.e,-e.f),Gt.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const i=Math.min(s,Gt.getFitScale(t,e));return new mt(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,s){const i=t.width/e.width,r=t.height/e.height;return s?Math.max(i,r):Math.min(i,r)},put(t,e,s="center",i=1,r=!0,n){n||(n=e),a(i)&&(i=Gt.getFitScale(t,e,"cover"===i)),jt.width=r?e.width*=i:e.width*i,jt.height=r?e.height*=i:e.height*i,Pt.toPoint(s,jt,t,n,!0,!0)},getSpread(t,e,s){const i={};return Gt.copyAndSpread(i,t,e,!1,s),i},spread(t,e,s){Gt.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){Gt.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=Wt(t.x),t.y=Wt(t.y),t.width=e>t.x?Dt(t.width+e-t.x):Dt(t.width),t.height=s>t.y?Dt(t.height+s-t.y):Dt(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=It(t.x,e),t.y=It(t.y,e),t.width=It(t.width,e),t.height=It(t.height,e)},add(t,e,s){Ft=t.x+t.width,zt=t.y+t.height,Nt=e.x,Yt=e.y,s||(Nt+=e.width,Yt+=e.height),Ft=Ft>Nt?Ft:Nt,zt=zt>Yt?zt:Yt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=Ft-t.x,t.height=zt-t.y},addList(t,e){Gt.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){Gt.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){Gt.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,i=!1){let r,n=!0;for(let o=0,a=e.length;o<a;o++)r=s?s(e[o],o):e[o],r&&(r.width||r.height)&&(n?(n=!1,i||Ht(t,r)):qt(t,r));n&&Gt.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Ot(Tt,t.x,t.y):Lt(Tt,t.x,t.y)),Et(Tt,t)},setPoint(t,e){Gt.set(t,e.x,e.y)},addPoint(t,e){qt(t,e,!0)},getPoints(t){const{x:e,y:s,width:i,height:r}=t;return[{x:e,y:s},{x:e+i,y:s},{x:e+i,y:s+r},{x:e,y:s+r}]},getPoint:(t,e,s=!1,i)=>Bt.getPoint(e,t,i,s),hitRadiusPoint:(t,e,s)=>(s&&(e=dt.tempToInnerRadiusPointOf(e,s)),e.x>=t.x-e.radiusX&&e.x<=t.x+t.width+e.radiusX&&e.y>=t.y-e.radiusY&&e.y<=t.y+t.height+e.radiusY),hitPoint:(t,e,s)=>(s&&(e=dt.tempToInnerOf(e,s)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,s)=>(s&&(e=Gt.tempToOuterOf(e,s)),!(t.y+t.height<e.y||e.y+e.height<t.y||t.x+t.width<e.x||e.x+e.width<t.x)),includes:(t,e,s)=>(s&&(e=Gt.tempToOuterOf(e,s)),t.x<=e.x&&t.y<=e.y&&t.x+t.width>=e.x+e.width&&t.y+t.height>=e.y+e.height),getIntersectData(t,e,s){if(s&&(e=Gt.tempToOuterOf(e,s)),!Gt.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:n,height:o}=e;return Ft=i+n,zt=r+o,Nt=t.x+t.width,Yt=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,Ft=Ft<Nt?Ft:Nt,zt=zt<Yt?zt:Yt,n=Ft-i,o=zt-r,{x:i,y:r,width:n,height:o}},intersect(t,e,s){Gt.copy(t,Gt.getIntersectData(t,e,s))},isSame:(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEmpty:t=>0===t.x&&0===t.y&&0===t.width&&0===t.height,hasSize:t=>t.width&&t.height,reset(t){Gt.set(t)}},Gt=Vt,{add:qt,copy:Ht}=Gt;class Qt{get minX(){return Vt.minX(this)}get minY(){return Vt.minY(this)}get maxX(){return Vt.maxX(this)}get maxY(){return Vt.maxY(this)}constructor(t,e,s,i){this.set(t,e,s,i)}set(t,e,s,i){return _(t)?Vt.copy(this,t):Vt.set(this,t,e,s,i),this}get(){const{x:t,y:e,width:s,height:i}=this;return{x:t,y:e,width:s,height:i}}clone(){return new Qt(this)}move(t,e){return Vt.move(this,t,e),this}scale(t,e,s){return Vt.scale(this,t,e,s),this}scaleOf(t,e,s){return Vt.scaleOf(this,t,e,s),this}toOuterOf(t,e){return Vt.toOuterOf(this,t,e),this}toInnerOf(t,e){return Vt.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Vt.getFitMatrix(this,t,e)}put(t,e,s){Vt.put(this,t,e,s)}spread(t,e){return Vt.spread(this,t,e),this}shrink(t,e){return Vt.shrink(this,t,e),this}ceil(){return Vt.ceil(this),this}unsign(){return Vt.unsign(this),this}float(t){return Vt.float(this,t),this}add(t){return Vt.add(this,t),this}addList(t){return Vt.setList(this,t,!0),this}setList(t){return Vt.setList(this,t),this}addListWithFn(t,e){return Vt.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Vt.setListWithFn(this,t,e),this}setPoint(t){return Vt.setPoint(this,t),this}setPoints(t){return Vt.setPoints(this,t),this}addPoint(t){return Vt.addPoint(this,t),this}getPoints(){return Vt.getPoints(this)}getPoint(t,e,s){return Vt.getPoint(this,t,e,s)}hitPoint(t,e){return Vt.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Vt.hitRadiusPoint(this,t,e)}hit(t,e){return Vt.hit(this,t,e)}includes(t,e){return Vt.includes(this,t,e)}intersect(t,e){return Vt.intersect(this,t,e),this}getIntersect(t,e){return new Qt(Vt.getIntersectData(this,t,e))}isSame(t){return Vt.isSame(this,t)}isEmpty(){return Vt.isEmpty(this)}reset(){Vt.reset(this)}}const Jt=new Qt;class $t{constructor(t,e,s,i,r,n){_(t)?this.copy(t):this.set(t,e,s,i,r,n)}set(t=0,e=0,s=0,i=0,r=0,n=0){this.top=t,this.right=e,this.bottom=s,this.left=i,this.width=r,this.height=n}copy(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=t;this.set(e,s,i,r,n,o)}getBoundsFrom(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=this;return new Qt(r,e,n||t.width-r-s,o||t.height-e-i)}}const Zt={number:(t,e)=>_(t)?"percent"===t.type?t.value*e:t.value:t},Kt={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{floor:te,max:ee}=Math,se={toURL(t,e){let s=encodeURIComponent(t);return"text"===e?s="data:text/plain;charset=utf-8,"+s:"svg"===e&&(s="data:image/svg+xml,"+s),s},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",isLarge:(t,e,s,i)=>t.width*t.height*(e?e*s:1)>(i||ie.maxCacheSize),isSuperLarge:(t,e,s)=>ie.isLarge(t,e,s,ie.maxPatternSize),getRealURL(t){const{prefix:e,suffix:s}=ie;return!s||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+s),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,s,i,r,n,o,a,h,l){const d=ee(te(e+(i||0)),1),c=ee(te(s+(r||0)),1);let u,_,p;l&&(p=Zt.number(l.offset,"x"===l.type?e:s))&&("x"===l.type?u=!0:_=!0);const g=se.origin.createCanvas(_?2*d:d,u?2*c:c),f=g.getContext("2d");if(a&&(f.globalAlpha=a),f.imageSmoothingEnabled=!1!==o,ie.canUse(t)){if(n){const i=e/n.width,r=s/n.height;f.setTransform(i,0,0,r,-n.x*i,-n.y*r),f.drawImage(t,0,0,t.width,t.height)}else f.drawImage(t,0,0,e,s);p&&(f.drawImage(g,0,0,d,c,u?p-d:d,u?c:p-c,d,c),f.drawImage(g,0,0,d,c,u?p:d,u?c:p,d,c))}return g},canUse:t=>t&&t.width&&!t.__closed,setPatternTransform(t,e,s){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}s&&f.stintSet(s,"transform",e)}}},{image:ie}=se,{randColor:re}=D;class ne{constructor(t){this.repeatMap={},this.name=t}static get(t){return new ne(t)}static set filter(t){this.filterList=oe(t)}static set exclude(t){this.excludeList=oe(t)}static drawRepaint(t,e){const s=re();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const i="hit"===ne.showBounds,r=t.__nowWorld,n=re();i&&(e.setWorld(r),t.__drawHitPath(e),e.fillStyle=n.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(n,2),i?e.stroke():e.strokeWorld(r,n)}log(...t){if(ae.enable){if(ae.filterList.length&&ae.filterList.every(t=>t!==this.name))return;if(ae.excludeList.length&&ae.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){ae.enable&&this.warn(...t)}warn(...t){ae.showWarn&&console.warn(this.name,...t)}repeat(t,...e){this.repeatMap[t]||(this.warn("repeat:"+t,...e),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(e){console.error(this.name,...t,e)}}}function oe(t){return t?a(t)&&(t=[t]):t=[],t}ne.filterList=[],ne.excludeList=[],ne.showWarn=!0;const ae=ne,he=ne.get("RunTime"),le={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const s=x.create(x.RUNTIME);return de.currentId=de.idMap[s]=e?performance.now():Date.now(),de.currentName=de.nameMap[s]=t,de.nameToIdMap[t]=s,s},end(t,e){const s=de.idMap[t],i=de.nameMap[t],r=e?(performance.now()-s)/1e3:Date.now()-s;de.idMap[t]=de.nameMap[t]=de.nameToIdMap[i]=void 0,he.log(i,r,"ms")},endOfName(t,e){const s=de.nameToIdMap[t];n(s)||de.end(s,e)}},de=le,ce=[],ue={list:{},add(t,...e){this.list[t]=!0,ce.push(...e)},has(t,e){const s=this.list[t];return!s&&e&&this.need(t),s},need(t){console.error("please install and import plugin: "+(t.includes("-x")?"":"@leafer-in/")+t)}};setTimeout(()=>ce.forEach(t=>ue.has(t,!0)));const _e={editor:t=>ue.need("editor")},pe=ne.get("UICreator"),ge={list:{},register(t){const{__tag:e}=t.prototype;fe[e]&&pe.repeat(e),fe[e]=t},get(t,e,s,i,r,o){if(!fe[t])return void pe.warn("not register "+t);const a=new fe[t](e);return n(s)||(a.x=s,i&&(a.y=i),r&&(a.width=r),o&&(a.height=o)),a}},{list:fe}=ge,ye=ne.get("EventCreator"),me={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],a(e)&&(xe[e]&&ye.repeat(e),xe[e]=t)})},changeName(t,e){const s=xe[t];if(s){const i=Object.keys(s).find(e=>s[e]===t);i&&(s[i]=e,xe[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new xe[t](...e)},{nameList:xe}=me;class we{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:s}=this;for(let i=0,r=s.length;i<r;i++)if(e=s[i],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const i=_e.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,i=this.list.length;s<i;s++)t=this.list[s],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}}function ve(t){return(e,s)=>{t||(t=s);const i={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===s&&(i.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,s,i)}}const be=[];function ke(){return(t,e)=>{be.push(e)}}const Se=[];let Be=class{set blendMode(t){"normal"===t&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||Se)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;be.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,i,r,n){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,i,r,n){_(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,i,r,n)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,i){}strokeRect(t,e,s,i){}clearRect(t,e,s,i){}drawImage(t,e,s,i,r,n,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,n+=t,a-=t}if(s<0){const t=-s/r*h;r+=s,s=0,o+=t,h-=t}this.context.drawImage(t,e,s,i,r,n,o,a,h);break;case 5:this.context.drawImage(t,e,s,i,r);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,i,r,n){}quadraticCurveTo(t,e,s,i){}closePath(){}arc(t,e,s,i,r,n){}arcTo(t,e,s,i,r){}ellipse(t,e,s,i,r,n,o,a){}rect(t,e,s,i){}roundRect(t,e,s,i,r){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,i){}createPattern(t,e){}createRadialGradient(t,e,s,i,r,n){}fillText(t,e,s,i){}measureText(t){}strokeText(t,e,s,i){}destroy(){this.context=null}};s([ve("imageSmoothingEnabled")],Be.prototype,"smooth",void 0),s([ve("imageSmoothingQuality")],Be.prototype,"smoothLevel",void 0),s([ve("globalAlpha")],Be.prototype,"opacity",void 0),s([ve()],Be.prototype,"fillStyle",void 0),s([ve()],Be.prototype,"strokeStyle",void 0),s([ve("lineWidth")],Be.prototype,"strokeWidth",void 0),s([ve("lineCap")],Be.prototype,"strokeCap",void 0),s([ve("lineJoin")],Be.prototype,"strokeJoin",void 0),s([ve("lineDashOffset")],Be.prototype,"dashOffset",void 0),s([ve()],Be.prototype,"miterLimit",void 0),s([ve()],Be.prototype,"shadowBlur",void 0),s([ve()],Be.prototype,"shadowColor",void 0),s([ve()],Be.prototype,"shadowOffsetX",void 0),s([ve()],Be.prototype,"shadowOffsetY",void 0),s([ve()],Be.prototype,"filter",void 0),s([ve()],Be.prototype,"font",void 0),s([ve()],Be.prototype,"fontKerning",void 0),s([ve()],Be.prototype,"fontStretch",void 0),s([ve()],Be.prototype,"fontVariantCaps",void 0),s([ve()],Be.prototype,"textAlign",void 0),s([ve()],Be.prototype,"textBaseline",void 0),s([ve()],Be.prototype,"textRendering",void 0),s([ve()],Be.prototype,"wordSpacing",void 0),s([ve()],Be.prototype,"letterSpacing",void 0),s([ve()],Be.prototype,"direction",void 0),s([ke()],Be.prototype,"setTransform",null),s([ke()],Be.prototype,"resetTransform",null),s([ke()],Be.prototype,"getTransform",null),s([ke()],Be.prototype,"save",null),s([ke()],Be.prototype,"restore",null),s([ke()],Be.prototype,"translate",null),s([ke()],Be.prototype,"scale",null),s([ke()],Be.prototype,"rotate",null),s([ke()],Be.prototype,"fill",null),s([ke()],Be.prototype,"stroke",null),s([ke()],Be.prototype,"clip",null),s([ke()],Be.prototype,"fillRect",null),s([ke()],Be.prototype,"strokeRect",null),s([ke()],Be.prototype,"clearRect",null),s([ke()],Be.prototype,"beginPath",null),s([ke()],Be.prototype,"moveTo",null),s([ke()],Be.prototype,"lineTo",null),s([ke()],Be.prototype,"bezierCurveTo",null),s([ke()],Be.prototype,"quadraticCurveTo",null),s([ke()],Be.prototype,"closePath",null),s([ke()],Be.prototype,"arc",null),s([ke()],Be.prototype,"arcTo",null),s([ke()],Be.prototype,"ellipse",null),s([ke()],Be.prototype,"rect",null),s([ke()],Be.prototype,"roundRect",null),s([ke()],Be.prototype,"createConicGradient",null),s([ke()],Be.prototype,"createLinearGradient",null),s([ke()],Be.prototype,"createPattern",null),s([ke()],Be.prototype,"createRadialGradient",null),s([ke()],Be.prototype,"fillText",null),s([ke()],Be.prototype,"measureText",null),s([ke()],Be.prototype,"strokeText",null);const{copy:Ce,multiplyParent:Re,pixelScale:Pe}=Z,{round:Te}=Math,Oe=new Qt,Le=new Qt,Ee={width:1,height:1,pixelRatio:1},Ae=["width","height","pixelRatio"];class Ie extends Be{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,e){super(),this.size={},this.worldTransform={},t||(t=Ee),this.manager=e,this.innerId=x.create(x.CANVAS);const{width:s,height:i,pixelRatio:r}=t;this.autoLayout=!s||!i,this.size.pixelRatio=r||se.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&e&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;f.copyAttrs(i,t,Ae),Ae.forEach(t=>i[t]||(i[t]=1)),this.bounds=new Qt(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&s&&(this.clearWorld(s.bounds),this.copyWorld(s),s.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s,pixelSnap:i}=this,r=this.worldTransform;e&&Re(t,e,r),Pe(t,s,r),i&&!t.ignorePixelSnap&&(t.half&&t.half*s%2?(r.e=Te(r.e-.5)+.5,r.f=Te(r.f-.5)+.5):(r.e=Te(r.e),r.f=Te(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,s,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,e){let{strokeCap:s,strokeJoin:i,dashPattern:r,dashOffset:o,miterLimit:a}=t;e&&(e.strokeCap&&(s=e.strokeCap),e.strokeJoin&&(i=e.strokeJoin),n(e.dashPattern)||(r=e.dashPattern),n(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=s,this.strokeJoin=i,this.dashPattern=r,this.dashOffset=o,this.miterLimit=a}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,s=1){return!0}setWorldShadow(t,e,s,i){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=s*r,this.shadowColor=i||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,i,r){i&&(this.blendMode=i),e?(this.setTempPixelBounds(e,r),s?(this.setTempPixelBounds2(s,r),s=Le):s=Oe,this.drawImage(t.view,Oe.x,Oe.y,Oe.width,Oe.height,s.x,s.y,s.width,s.height)):this.drawImage(t.view,0,0),i&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,i,r){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Vt.tempToOuterOf(s,e),i,r),this.restore()):(i&&(this.blendMode=i),this.setTempPixelBounds(e,r),this.drawImage(t.view,Oe.x,Oe.y,Oe.width,Oe.height,s.x,s.y,s.width,s.height),i&&(this.blendMode="source-over"))}copyWorldByReset(t,e,s,i,r,n){this.resetTransform(),this.copyWorld(t,e,s,i,n),r||this.useWorldTransform()}useGrayscaleAlpha(t){if(this.setTempPixelBounds(t,!0,!0),!Oe.width||!Oe.height)return;let e,s;const{context:i}=this,r=i.getImageData(Oe.x,Oe.y,Oe.width,Oe.height),{data:n}=r;for(let t=0,i=n.length;t<i;t+=4)s=.299*n[t]+.587*n[t+1]+.114*n[t+2],(e=n[t+3])&&(n[t+3]=255===e?s:e*(s/255));i.putImageData(r,Oe.x,Oe.y)}useMask(t,e,s){this.copyWorld(t,e,s,"destination-in")}useEraser(t,e,s){this.copyWorld(t,e,s,"destination-out")}fillWorld(t,e,s,i){s&&(this.blendMode=s),this.fillStyle=e,this.setTempPixelBounds(t,i),this.fillRect(Oe.x,Oe.y,Oe.width,Oe.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s,i){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempPixelBounds(t,i),this.strokeRect(Oe.x,Oe.y,Oe.width,Oe.height),s&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Oe.x,Oe.y,Oe.width,Oe.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Oe.x,Oe.y,Oe.width,Oe.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,s){this.copyToPixelBounds(Oe,t,e,s)}setTempPixelBounds2(t,e,s){this.copyToPixelBounds(Le,t,e,s)}copyToPixelBounds(t,e,s,i){t.set(e),i&&t.intersect(this.bounds),t.scale(this.pixelRatio),s&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:s,pixelSnap:i}=this,r=this.manager?this.manager.get(s):_e.canvas(Object.assign({},s));return r.save(),t&&(Ce(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==i&&(r.pixelSnap=i),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}}const Me={creator:{},parse(t,e){},convertToCanvasData(t,e){}},We={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},De=Object.assign({M:1,m:10,L:2,l:20,H:3,h:30,V:4,v:40,C:5,c:50,S:6,s:60,Q:7,q:70,T:8,t:80,A:9,a:90,Z:11,z:11,R:12},We),Fe={M:3,m:3,L:3,l:3,H:2,h:2,V:2,v:2,C:7,c:7,S:5,s:5,Q:5,q:5,T:3,t:3,A:8,a:8,Z:1,z:1,N:5,D:9,X:6,G:9,F:5,O:7,P:4,U:6},ze={m:10,l:20,H:3,h:30,V:4,v:40,c:50,S:6,s:60,q:70,T:8,t:80,A:9,a:90},Ne=Object.assign(Object.assign({},ze),We),Ye=De,Xe={};for(let t in Ye)Xe[Ye[t]]=t;const Ue={};for(let t in Ye)Ue[Ye[t]]=Fe[t];const je={drawRoundRect(t,e,s,i,r,n){const o=D.fourNumber(n,Math.min(i/2,r/2)),a=e+i,h=s+r;o[0]?t.moveTo(e+o[0],s):t.moveTo(e,s),o[1]?t.arcTo(a,s,a,h,o[1]):t.lineTo(a,s),o[2]?t.arcTo(a,h,e,h,o[2]):t.lineTo(a,h),o[3]?t.arcTo(e,h,e,s,o[3]):t.lineTo(e,h),o[0]?t.arcTo(e,s,a,s,o[0]):t.lineTo(e,s)}},{sin:Ve,cos:Ge,hypot:qe,atan2:He,ceil:Qe,abs:Je,PI:$e,sqrt:Ze,pow:Ke}=Math,{setPoint:ts,addPoint:es}=wt,{set:ss,toNumberPoints:is}=dt,{M:rs,L:ns,C:os,Q:as,Z:hs}=De,ls={},ds={points(t,e,s,i){let r=is(e);if(t.push(rs,r[0],r[1]),s&&r.length>5){let e,n,o,a,h,l,d,c,u,_,p,g,f,y,m,x=r.length;const w=!0===s?.5:s;i&&(r=[r[x-2],r[x-1],...r,r[0],r[1],r[2],r[3]],x=r.length);for(let s=2;s<x-2;s+=2)e=r[s-2],n=r[s-1],o=r[s],a=r[s+1],h=r[s+2],l=r[s+3],p=o-e,g=a-n,f=Ze(Ke(p,2)+Ke(g,2)),y=Ze(Ke(h-o,2)+Ke(l-a,2)),(f||y)&&(m=f+y,f=w*f/m,y=w*y/m,h-=e,l-=n,d=o-f*h,c=a-f*l,2===s?i||t.push(as,d,c,o,a):(p||g)&&t.push(os,u,_,d,c,o,a),u=o+y*h,_=a+y*l);i||t.push(as,u,_,r[x-2],r[x-1])}else for(let e=2,s=r.length;e<s;e+=2)t.push(ns,r[e],r[e+1]);i&&t.push(hs)},rect(t,e,s,i,r){Me.creator.path=t,Me.creator.moveTo(e,s).lineTo(e+i,s).lineTo(e+i,s+r).lineTo(e,s+r).lineTo(e,s)},roundRect(t,e,s,i,r,n){Me.creator.path=[],je.drawRoundRect(Me.creator,e,s,i,r,n),t.push(...Me.convertToCanvasData(Me.creator.path,!0))},arcTo(t,e,s,i,r,n,o,a,h,l,d){const c=i-e,u=r-s,_=n-i,p=o-r;let g=He(u,c),f=He(p,_);const y=qe(c,u),m=qe(_,p);let x=f-g;if(x<0&&(x+=N),y<1e-12||m<1e-12||x<1e-12||Je(x-$e)<1e-12)return t&&t.push(ns,i,r),h&&(ts(h,e,s),es(h,i,r)),d&&ss(d,e,s),void(l&&ss(l,i,r));const w=c*p-_*u<0,v=w?-1:1,b=a/Ge(x/2),k=i+b*Ge(g+x/2+Y*v),S=r+b*Ve(g+x/2+Y*v);return g-=Y*v,f-=Y*v,_s(t,k,S,a,a,0,g/z,f/z,w,h,l,d)},arc:(t,e,s,i,r,n,o,a,h,l)=>_s(t,e,s,i,i,0,r,n,o,a,h,l),ellipse(t,e,s,i,r,n,o,a,h,l,d,c){const u=n*z,_=Ve(u),p=Ge(u);let g=o*z,f=a*z;g>$e&&(g-=N),f<0&&(f+=N);let y=f-g;if(y<0?y+=N:y>N&&(y-=N),h){360===Je(a-o)?y=-N:y-=N}const m=Qe(Je(y/Y)),x=y/m,w=Ve(x/4),v=8/3*w*w/Ve(x/2);f=g+x;let b,k,S,B,C,R,P,T,O=Ge(g),L=Ve(g),E=S=p*i*O-_*r*L,A=B=_*i*O+p*r*L,I=e+S,M=s+B;t&&t.push(t.length?ns:rs,I,M),l&&ts(l,I,M),c&&ss(c,I,M);for(let n=0;n<m;n++)b=Ge(f),k=Ve(f),S=p*i*b-_*r*k,B=_*i*b+p*r*k,C=e+E-v*(p*i*L+_*r*O),R=s+A-v*(_*i*L-p*r*O),P=e+S+v*(p*i*k+_*r*b),T=s+B+v*(_*i*k-p*r*b),t&&t.push(os,C,R,P,T,e+S,s+B),l&&us(e+E,s+A,C,R,P,T,e+S,s+B,l,!0),E=S,A=B,O=b,L=k,g=f,f+=x;d&&ss(d,e+S,s+B)},quadraticCurveTo(t,e,s,i,r,n,o){t.push(os,(e+2*i)/3,(s+2*r)/3,(n+2*i)/3,(o+2*r)/3,n,o)},toTwoPointBoundsByQuadraticCurve(t,e,s,i,r,n,o,a){us(t,e,(t+2*s)/3,(e+2*i)/3,(r+2*s)/3,(n+2*i)/3,r,n,o,a)},toTwoPointBounds(t,e,s,i,r,n,o,a,h,l){const d=[];let c,u,_,p,g,f,y,m,x=t,w=s,v=r,b=o;for(let t=0;t<2;++t)if(1==t&&(x=e,w=i,v=n,b=a),c=-3*x+9*w-9*v+3*b,u=6*x-12*w+6*v,_=3*w-3*x,Math.abs(c)<1e-12){if(Math.abs(u)<1e-12)continue;p=-_/u,0<p&&p<1&&d.push(p)}else y=u*u-4*_*c,m=Math.sqrt(y),y<0||(g=(-u+m)/(2*c),0<g&&g<1&&d.push(g),f=(-u-m)/(2*c),0<f&&f<1&&d.push(f));l?es(h,t,e):ts(h,t,e),es(h,o,a);for(let l=0,c=d.length;l<c;l++)cs(d[l],t,e,s,i,r,n,o,a,ls),es(h,ls.x,ls.y)},getPointAndSet(t,e,s,i,r,n,o,a,h,l){const d=1-t,c=d*d*d,u=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=c*e+u*i+_*n+p*a,l.y=c*s+u*r+_*o+p*h},getPoint(t,e,s,i,r,n,o,a,h){const l={};return cs(t,e,s,i,r,n,o,a,h,l),l},getDerivative(t,e,s,i,r){const n=1-t;return 3*n*n*(s-e)+6*n*t*(i-s)+3*t*t*(r-i)},cut(t,e,s,i,r,n,o,a,h){if(t<=0)return{left:null,right:[i,r,n,o,a,h]};if(t>=1)return{left:[i,r,n,o,a,h],right:null};const l=1-t,d=e*l+i*t,c=s*l+r*t,u=i*l+n*t,_=r*l+o*t,p=n*l+a*t,g=o*l+h*t,f=d*l+u*t,y=c*l+_*t,m=u*l+p*t,x=_*l+g*t;return{left:[d,c,f,y,f*l+m*t,y*l+x*t],right:[m,x,p,g,a,h]}}},{getPointAndSet:cs,toTwoPointBounds:us,ellipse:_s}=ds,{sin:ps,cos:gs,sqrt:fs,atan2:ys}=Math,{ellipse:ms}=ds,xs={ellipticalArc(t,e,s,i,r,n,o,a,h,l,d){const c=(h-e)/2,u=(l-s)/2,_=n*z,p=ps(_),g=gs(_),f=-g*c-p*u,y=-g*u+p*c,m=i*i,x=r*r,w=y*y,v=f*f,b=m*x-m*w-x*v;let k=0;if(b<0){const t=fs(1-b/(m*x));i*=t,r*=t}else k=(o===a?-1:1)*fs(b/(m*w+x*v));const S=k*i*y/r,B=-k*r*f/i,C=ys((y-B)/r,(f-S)/i),R=ys((-y-B)/r,(-f-S)/i);let P=R-C;0===a&&P>0?P-=N:1===a&&P<0&&(P+=N);const T=e+c+g*S-p*B,O=s+u+p*S+g*B,L=P<0?1:0;d||se.ellipseToCurve?ms(t,T,O,i,r,n,C/z,R/z,L):i!==r||n?t.push(De.G,T,O,i,r,n,C/z,R/z,L):t.push(De.O,T,O,i,C/z,R/z,L)}},ws={toCommand:t=>[],toNode:(t,e)=>[]},{M:vs,m:bs,L:ks,l:Ss,H:Bs,h:Cs,V:Rs,v:Ps,C:Ts,c:Os,S:Ls,s:Es,Q:As,q:Is,T:Ms,t:Ws,A:Ds,a:Fs,Z:zs,z:Ns,N:Ys,D:Xs,X:Us,G:js,F:Vs,O:Gs,P:qs,U:Hs}=De,{rect:Qs,roundRect:Js,arcTo:$s,arc:Zs,ellipse:Ks,quadraticCurveTo:ti}=ds,{ellipticalArc:ei}=xs,si=ne.get("PathConvert"),ii={},ri={current:{dot:0},stringify(t,e){let s,i,r,n=0,o=t.length,a="";for(;n<o;){i=t[n],s=Ue[i],a+=i===r?" ":Xe[i];for(let i=1;i<s;i++)a+=D.float(t[n+i],e),i===s-1||(a+=" ");r=i,n+=s}return a},parse(t,e){let s,i,r,n="";const o=[],a=e?Ne:ze;for(let e=0,h=t.length;e<h;e++)i=t[e],Kt[i]?("."===i&&(ni.dot&&(oi(o,n),n=""),ni.dot++),"0"===n&&"."!==i&&(oi(o,n),n=""),n+=i):De[i]?(n&&(oi(o,n),n=""),ni.name=De[i],ni.length=Fe[i],ni.index=0,oi(o,ni.name),"m"===i?ni.name=De.l:"M"===i&&(ni.name=De.L),!s&&a[i]&&(s=!0)):"-"===i||"+"===i?"e"===r||"E"===r?n+=i:(n&&oi(o,n),n=i):n&&(oi(o,n),n=""),r=i;return n&&oi(o,n),s?ri.toCanvasData(o,e):o},toCanvasData(t,e){let s,i,r,n,o,a=0,h=0,l=0,d=0,c=0,u=0,_=0,p=t.length;const g=[];for(;_<p;){switch(r=t[_],r){case bs:t[_+1]+=a,t[_+2]+=h;case vs:a=c=t[_+1],h=u=t[_+2],g.push(vs,a,h),_+=3;break;case Cs:t[_+1]+=a;case Bs:a=t[_+1],g.push(ks,a,h),_+=2;break;case Ps:t[_+1]+=h;case Rs:h=t[_+1],g.push(ks,a,h),_+=2;break;case Ss:t[_+1]+=a,t[_+2]+=h;case ks:a=t[_+1],h=t[_+2],g.push(ks,a,h),_+=3;break;case Es:t[_+1]+=a,t[_+2]+=h,t[_+3]+=a,t[_+4]+=h,r=Ls;case Ls:o=n===Ts||n===Ls,l=o?2*a-s:a,d=o?2*h-i:h,s=t[_+1],i=t[_+2],a=t[_+3],h=t[_+4],g.push(Ts,l,d,s,i,a,h),_+=5;break;case Os:t[_+1]+=a,t[_+2]+=h,t[_+3]+=a,t[_+4]+=h,t[_+5]+=a,t[_+6]+=h,r=Ts;case Ts:s=t[_+3],i=t[_+4],a=t[_+5],h=t[_+6],g.push(Ts,t[_+1],t[_+2],s,i,a,h),_+=7;break;case Ws:t[_+1]+=a,t[_+2]+=h,r=Ms;case Ms:o=n===As||n===Ms,s=o?2*a-s:a,i=o?2*h-i:h,e?ti(g,a,h,s,i,t[_+1],t[_+2]):g.push(As,s,i,t[_+1],t[_+2]),a=t[_+1],h=t[_+2],_+=3;break;case Is:t[_+1]+=a,t[_+2]+=h,t[_+3]+=a,t[_+4]+=h,r=As;case As:s=t[_+1],i=t[_+2],e?ti(g,a,h,s,i,t[_+3],t[_+4]):g.push(As,s,i,t[_+3],t[_+4]),a=t[_+3],h=t[_+4],_+=5;break;case Fs:t[_+6]+=a,t[_+7]+=h;case Ds:ei(g,a,h,t[_+1],t[_+2],t[_+3],t[_+4],t[_+5],t[_+6],t[_+7],e),a=t[_+6],h=t[_+7],_+=8;break;case Ns:case zs:g.push(zs),a=c,h=u,_++;break;case Ys:a=t[_+1],h=t[_+2],e?Qs(g,a,h,t[_+3],t[_+4]):ai(g,t,_,5),_+=5;break;case Xs:a=t[_+1],h=t[_+2],e?Js(g,a,h,t[_+3],t[_+4],[t[_+5],t[_+6],t[_+7],t[_+8]]):ai(g,t,_,9),_+=9;break;case Us:a=t[_+1],h=t[_+2],e?Js(g,a,h,t[_+3],t[_+4],t[_+5]):ai(g,t,_,6),_+=6;break;case js:Ks(e?g:ai(g,t,_,9),t[_+1],t[_+2],t[_+3],t[_+4],t[_+5],t[_+6],t[_+7],t[_+8],null,ii),a=ii.x,h=ii.y,_+=9;break;case Vs:e?Ks(g,t[_+1],t[_+2],t[_+3],t[_+4],0,0,360,!1):ai(g,t,_,5),a=t[_+1]+t[_+3],h=t[_+2],_+=5;break;case Gs:Zs(e?g:ai(g,t,_,7),t[_+1],t[_+2],t[_+3],t[_+4],t[_+5],t[_+6],null,ii),a=ii.x,h=ii.y,_+=7;break;case qs:e?Zs(g,t[_+1],t[_+2],t[_+3],0,360,!1):ai(g,t,_,4),a=t[_+1]+t[_+3],h=t[_+2],_+=4;break;case Hs:$s(e?g:ai(g,t,_,6),a,h,t[_+1],t[_+2],t[_+3],t[_+4],t[_+5],null,ii),a=ii.x,h=ii.y,_+=6;break;default:return si.error(`command: ${r} [index:${_}]`,t),g}n=r}return g},objectToCanvasData(t){if(t[0].name.length>1)return ws.toCommand(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(vs,t.x,t.y);break;case"L":e.push(ks,t.x,t.y);break;case"C":e.push(Ts,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(As,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(zs)}}),e}},copyData(t,e,s,i){for(let r=s,n=s+i;r<n;r++)t.push(e[r])},pushData(t,e){ni.index===ni.length&&(ni.index=1,t.push(ni.name)),t.push(Number(e)),ni.index++,ni.dot=0}},{current:ni,pushData:oi,copyData:ai}=ri,{M:hi,L:li,C:di,Q:ci,Z:ui,N:_i,D:pi,X:gi,G:fi,F:yi,O:mi,P:xi,U:wi}=De,{getMinDistanceFrom:vi,getRadianFrom:bi}=dt,{tan:ki,min:Si,abs:Bi}=Math,Ci={},Ri=ne.get("PointsCurve"),Pi={pointsCurveList:{},beginPath(t){t.length=0},moveTo(t,e,s){t.push(hi,e,s)},lineTo(t,e,s){t.push(li,e,s)},bezierCurveTo(t,e,s,i,r,n,o){t.push(di,e,s,i,r,n,o)},quadraticCurveTo(t,e,s,i,r){t.push(ci,e,s,i,r)},closePath(t){t.push(ui)},rect(t,e,s,i,r){t.push(_i,e,s,i,r)},roundRect(t,e,s,i,r,n){if(l(n))t.push(gi,e,s,i,r,n);else{const o=D.fourNumber(n);o?t.push(pi,e,s,i,r,...o):t.push(_i,e,s,i,r)}},ellipse(t,e,s,i,r,n,a,h,l){if(i===r)return Oi(t,e,s,i,a,h,l);o(n)?t.push(yi,e,s,i,r):(o(a)&&(a=0),o(h)&&(h=360),t.push(fi,e,s,i,r,n,a,h,l?1:0))},arc(t,e,s,i,r,n,a){o(r)?t.push(xi,e,s,i):(o(r)&&(r=0),o(n)&&(n=360),t.push(mi,e,s,i,r,n,a?1:0))},arcTo(t,e,s,i,r,o,a,h,l){if(!n(a)){const t=vi(a,h,e,s,i,r)/(l?1:2);o=Si(o,Si(t,t*Bi(ki(bi(a,h,e,s,i,r)/2))))}t.push(wi,e,s,i,r,o)},drawEllipse(t,e,s,i,r,n,a,h,l){ds.ellipse(null,e,s,i,r,o(n)?0:n,o(a)?0:a,o(h)?360:h,l,null,null,Ci),t.push(hi,Ci.x,Ci.y),Ti(t,e,s,i,r,n,a,h,l)},drawArc(t,e,s,i,r,n,a){ds.arc(null,e,s,i,o(r)?0:r,o(n)?360:n,a,null,null,Ci),t.push(hi,Ci.x,Ci.y),Oi(t,e,s,i,r,n,a)},drawPoints(t,e,s,i,r){let n="Q";_(s)&&(n=s.type,s=s.value),Li[n]||(Ri.warn("not found:",n),n="Q"),Li[n](t,e,s,i,r)}},{ellipse:Ti,arc:Oi,pointsCurveList:Li}=Pi;function Ei(t,e){Li[t]&&Ri.repeat(t),Li[t]=e}Ei("Q",ds.points);const{moveTo:Ai,lineTo:Ii,quadraticCurveTo:Mi,bezierCurveTo:Wi,closePath:Di,beginPath:Fi,rect:zi,roundRect:Ni,ellipse:Yi,arc:Xi,arcTo:Ui,drawEllipse:ji,drawArc:Vi,drawPoints:Gi}=Pi;class qi{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?a(t)?Me.parse(t):t:[],this}beginPath(){return Fi(this.__path),this.paint(),this}moveTo(t,e){return Ai(this.__path,t,e),this.paint(),this}lineTo(t,e){return Ii(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,i,r,n){return Wi(this.__path,t,e,s,i,r,n),this.paint(),this}quadraticCurveTo(t,e,s,i){return Mi(this.__path,t,e,s,i),this.paint(),this}closePath(){return Di(this.__path),this.paint(),this}rect(t,e,s,i){return zi(this.__path,t,e,s,i),this.paint(),this}roundRect(t,e,s,i,r){return Ni(this.__path,t,e,s,i,r),this.paint(),this}ellipse(t,e,s,i,r,n,o,a){return Yi(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}arc(t,e,s,i,r,n){return Xi(this.__path,t,e,s,i,r,n),this.paint(),this}arcTo(t,e,s,i,r){return Ui(this.__path,t,e,s,i,r),this.paint(),this}drawEllipse(t,e,s,i,r,n,o,a){return ji(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}drawArc(t,e,s,i,r,n){return Vi(this.__path,t,e,s,i,r,n),this.paint(),this}drawPoints(t,e,s){return Gi(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:Hi,L:Qi,C:Ji,Q:$i,Z:Zi,N:Ki,D:tr,X:er,G:sr,F:ir,O:rr,P:nr,U:or}=De,ar=ne.get("PathDrawer"),hr={drawPathByData(t,e){if(!e)return;let s,i=0,r=e.length;for(;i<r;)switch(s=e[i],s){case Hi:t.moveTo(e[i+1],e[i+2]),i+=3;break;case Qi:t.lineTo(e[i+1],e[i+2]),i+=3;break;case Ji:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case $i:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Zi:t.closePath(),i+=1;break;case Ki:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case tr:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],[e[i+5],e[i+6],e[i+7],e[i+8]]),i+=9;break;case er:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case sr:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*z,e[i+6]*z,e[i+7]*z,e[i+8]),i+=9;break;case ir:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,N,!1),i+=5;break;case rr:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*z,e[i+5]*z,e[i+6]),i+=7;break;case nr:t.arc(e[i+1],e[i+2],e[i+3],0,N,!1),i+=4;break;case or:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void ar.error(`command: ${s} [index:${i}]`,e)}},drawPathByPoints(t,e,s){}},{M:lr,L:dr,C:cr,Q:ur,Z:_r,N:pr,D:gr,X:fr,G:yr,F:mr,O:xr,P:wr,U:vr}=De,{toTwoPointBounds:br,toTwoPointBoundsByQuadraticCurve:kr,arcTo:Sr,arc:Br,ellipse:Cr}=ds,{addPointBounds:Rr,copy:Pr,addPoint:Tr,setPoint:Or,addBounds:Lr,toBounds:Er}=wt,Ar=ne.get("PathBounds");let Ir,Mr,Wr;const Dr={},Fr={},zr={},Nr={toBounds(t,e){Nr.toTwoPointBounds(t,Fr),Er(Fr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Or(e,0,0);let s,i,r,n,o,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(o=t[a],0===a&&(o===_r||o===cr||o===ur?Or(e,h,l):Or(e,t[a+1],t[a+2])),o){case lr:case dr:h=t[a+1],l=t[a+2],Tr(e,h,l),a+=3;break;case cr:r=t[a+5],n=t[a+6],br(h,l,t[a+1],t[a+2],t[a+3],t[a+4],r,n,Dr),Rr(e,Dr),h=r,l=n,a+=7;break;case ur:s=t[a+1],i=t[a+2],r=t[a+3],n=t[a+4],kr(h,l,s,i,r,n,Dr),Rr(e,Dr),h=r,l=n,a+=5;break;case _r:a+=1;break;case pr:h=t[a+1],l=t[a+2],Lr(e,h,l,t[a+3],t[a+4]),a+=5;break;case gr:case fr:h=t[a+1],l=t[a+2],Lr(e,h,l,t[a+3],t[a+4]),a+=o===gr?9:6;break;case yr:Cr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],Dr,zr),0===a?Pr(e,Dr):Rr(e,Dr),h=zr.x,l=zr.y,a+=9;break;case mr:h=t[a+1],l=t[a+2],Mr=t[a+3],Wr=t[a+4],Lr(e,h-Mr,l-Wr,2*Mr,2*Wr),h+=Mr,a+=5;break;case xr:Br(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Dr,zr),0===a?Pr(e,Dr):Rr(e,Dr),h=zr.x,l=zr.y,a+=7;break;case wr:h=t[a+1],l=t[a+2],Ir=t[a+3],Lr(e,h-Ir,l-Ir,2*Ir,2*Ir),h+=Ir,a+=4;break;case vr:Sr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Dr,zr),0===a?Pr(e,Dr):Rr(e,Dr),h=zr.x,l=zr.y,a+=6;break;default:return void Ar.error(`command: ${o} [index:${a}]`,t)}}},{M:Yr,L:Xr,Z:Ur}=De,{getCenterX:jr,getCenterY:Vr}=dt,{arcTo:Gr}=Pi,qr={smooth(t,e,s){let i,r,n,o,a,h,l=0,d=0,c=0,_=0,p=0,g=0,f=0,y=0,m=0;u(e)&&(e=e[0]||0);const x=t.length,w=9===x,v=[];for(;l<x;){switch(i=t[l],i){case Yr:h=v.length,h&&r!==Ur&&(v[o]=_,v[a]=p),_=y=t[l+1],p=m=t[l+2],l+=3,t[l]===Xr?(g=t[l+1],f=t[l+2],w?v.push(Yr,_,p):v.push(Yr,jr(_,g),Vr(p,f))):v.push(Yr,_,p),o=h+1,a=h+2;break;case Xr:switch(d=t[l+1],c=t[l+2],l+=3,t[l]){case Xr:Gr(v,d,c,t[l+1],t[l+2],e,y,m,w);break;case Ur:Gr(v,d,c,_,p,e,y,m,w);break;default:v.push(Xr,d,c)}y=d,m=c;break;case Ur:r!==Ur&&(Gr(v,_,p,g,f,e,y,m,w),v.push(Ur)),l+=1;break;default:n=Ue[i];for(let e=0;e<n;e++)v.push(t[l+e]);l+=n}r=i}return i!==Ur&&(v[o]=_,v[a]=p),v}};function Hr(t){return new qi(t)}const Qr=Hr();Me.creator=Hr(),Me.parse=ri.parse,Me.convertToCanvasData=ri.toCanvasData;const{drawRoundRect:Jr}=je;function $r(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,i,r){Jr(this,t,e,s,i,r)})}(t)}const Zr={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mimeType:(t,e="image")=>!t||t.startsWith(e)?t:("jpg"===t&&(t="jpeg"),e+"/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=Kr.fileType(t);return["jpg","jpeg"].some(t=>t===e)},getExportOptions(t){switch(typeof t){case"object":return t;case"number":return{quality:t};case"boolean":return{blob:t};default:return{}}}},Kr=Zr;Kr.mineType=Kr.mimeType,Kr.alphaPixelTypes.forEach(t=>Kr.upperCaseTypeMap[t]=t.toUpperCase());const tn=ne.get("TaskProcessor");class en{constructor(t){this.parallel=!0,this.time=1,this.id=x.create(x.TASK),this.task=t}run(){return i(this,void 0,void 0,function*(){try{if(this.isComplete||this.runing)return;if(this.runing=!0,this.canUse&&!this.canUse())return this.cancel();this.task&&(yield this.task())}catch(t){tn.error(t)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}}class sn{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(e=s)):e+=this.list[i].time;return this.isComplete?1:s/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&f.assign(this.config,t),this.empty()}add(t,e,s){let i,r,o,a;const h=new en(t);return h.parent=this,l(e)?a=e:e&&(r=e.parallel,i=e.start,o=e.time,a=e.delay,s||(s=e.canUse)),o&&(h.time=o),!1===r&&(h.parallel=!1),s&&(h.canUse=s),n(a)?this.push(h,i):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(h,i))},a)),this.isComplete=!1,h}push(t,e){this.list.push(t),!1===e||this.timer||(this.timer=setTimeout(()=>this.start()))}empty(){this.index=0,this.parallelSuccessNumber=0,this.list=[],this.parallelList=[],this.delayNumber=0}start(){this.running||(this.running=!0,this.isComplete=!1,this.run())}pause(){clearTimeout(this.timer),this.timer=null,this.running=!1}resume(){this.start()}skip(){this.index++,this.resume()}stop(){this.isComplete=!0,this.list.forEach(t=>{t.isComplete||t.run()}),this.pause(),this.empty()}run(){this.running&&(this.setParallelList(),this.parallelList.length>1?this.runParallelTasks():this.remain?this.runTask():this.onComplete())}runTask(){const t=this.list[this.index];t?t.run().then(()=>{this.onTask(t),this.index++,t.isCancel?this.runTask():this.nextTask()}).catch(t=>{this.onError(t)}):this.timer=setTimeout(()=>this.nextTask())}runParallelTasks(){this.parallelList.forEach(t=>this.runParallelTask(t))}runParallelTask(t){t.run().then(()=>{this.onTask(t),this.fillParallelTask()}).catch(t=>{this.onParallelError(t)})}nextTask(){this.total===this.finishedIndex?this.onComplete():this.timer=setTimeout(()=>this.run())}setParallelList(){let t;const{config:e,list:s,index:i}=this;this.parallelList=[],this.parallelSuccessNumber=0;let r=i+e.parallel;if(r>s.length&&(r=s.length),e.parallel>1)for(let e=i;e<r&&(t=s[e],t.parallel);e++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const s=e.length,i=this.finishedIndex+s;if(e.length){if(!this.running)return;i<this.total&&(t=this.list[i],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach(t=>{t.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}}const rn=ne.get("Resource"),nn={tasker:new sn,queue:new sn({parallel:1}),map:{},get isComplete(){return on.tasker.isComplete},set(t,e){on.map[t]&&rn.repeat(t),on.map[t]=e},get:t=>on.map[t],remove(t){const e=on.map[t];e&&(e.destroy&&e.destroy(),delete on.map[t])},loadImage(t,e){return new Promise((s,i)=>{const r=this.setImage(t,t,e);r.load(()=>s(r),t=>i(t))})},setImage(t,e,s){let i;return a(e)?i={url:e}:e.url||(i={url:t,view:e}),i&&(s&&(i.format=s),e=_e.image(i)),on.set(t,e),e},loadFilm(t,e){},loadVideo(t,e){},destroy(){on.map={}}},on=nn,an={maxRecycled:10,recycledList:[],patternTasker:nn.queue,get(t,e){let s=nn.get(t.url);return s||nn.set(t.url,s=_e[e||"image"](t)),s.use++,s},recycle(t){t.parent&&(t=t.parent),t.use--,setTimeout(()=>{t.use||(se.image.isLarge(t)?t.url&&nn.remove(t.url):(t.clearLevels(),hn.recycledList.push(t)))})},recyclePaint(t){hn.recycle(t.image)},clearRecycled(t){const e=hn.recycledList;(e.length>hn.maxRecycled||t)&&(e.forEach(e=>(!e.use||t)&&e.url&&nn.remove(e.url)),e.length=0)},clearLevels(){},hasAlphaPixel:t=>Zr.alphaPixelTypes.some(e=>hn.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+Zr.mimeType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+Zr.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){this.clearRecycled(!0)}},hn=an,{IMAGE:ln,create:dn}=x;class cn{get tag(){return"Image"}get url(){return this.config.url}get crossOrigin(){const{crossOrigin:t}=this.config;return n(t)?se.image.crossOrigin:t}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=dn(ln),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}an.isFormat("svg",t)&&(this.isSVG=!0),an.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e,s){return this.loading||(this.loading=!0,nn.tasker.add(()=>i(this,void 0,void 0,function*(){return yield se.origin["load"+this.tag](this.getLoadUrl(s),this.crossOrigin,this).then(t=>{s&&this.setThumbView(t),this.setView(t)}).catch(t=>{this.error=t,this.onComplete(!1)})}))),this.waitComplete.push(t,e),this.waitComplete.length-2}unload(t,e){const s=this.waitComplete;if(e){const e=s[t+1];e&&e({type:"stop"})}s[t]=s[t+1]=void 0}setView(t){this.ready=!0,this.width||(this.width=t.width,this.height=t.height,this.view=t),this.onComplete(!0)}onComplete(t){let e;this.waitComplete.forEach((s,i)=>{e=i%2,s&&(t?e||s(this):e&&s(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,s,i,r,n,o,a){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let s in t)if(t[s]!==arguments[s]){e=null;break}if(e)return e}const h=se.image.resize(this.view,t,e,r,n,void 0,o,s,i,a);return this.cache=this.use>1?{data:h,params:arguments}:null,h}getPattern(t,e,s,i){const r=se.canvas.createPattern(t,e);return se.image.setPatternTransform(r,s,i),r}render(t,e,s,i,r,n,o,a,h){t.drawImage(this.view,e,s,i,r)}getLoadUrl(t){return this.url}setThumbView(t){}getThumbSize(t){}getMinLevel(){}getLevelData(t,e,s){}clearLevels(t){}destroyFilter(){}destroy(){this.clearLevels(),this.destroyFilter();const{view:t}=this;t&&t.close&&t.close(),this.config={url:""},this.cache=this.view=null,this.waitComplete.length=0}}class un extends cn{get tag(){return"Film"}}class _n extends cn{get tag(){return"Video"}}function pn(t,e,s,i){i||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function gn(t,e){return Object.getOwnPropertyDescriptor(t,e)}function fn(t,e){const s="_"+t;return{get(){const t=this[s];return null==t?e:t},set(t){this[s]=t}}}function yn(t,e){return(s,i)=>xn(s,i,t,e&&e(i))}function mn(t){return t}function xn(t,e,s,i){const r={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};pn(t,e,Object.assign(r,i||{})),Zn(t,e,s)}function wn(t){return yn(t)}function vn(t,e){return yn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function bn(t,e){return yn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function kn(t){return yn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),Pn(this))}}))}function Sn(t,e){return yn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function Bn(t,e){return yn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function Cn(t,e){return yn(t,t=>({set(s){this.__setAttr(t,s,e)&&Pn(this)}}))}function Rn(t){return yn(t,t=>({set(e){this.__setAttr(t,e)&&(Pn(this),this.__.__removeNaturalSize())}}))}function Pn(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function Tn(t){return yn(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),Pn(this)}}))}const On=Cn;function Ln(t,e){return yn(t,t=>({set(s){this.__setAttr(t,s)&&(En(this),e&&(this.__.__useStroke=!0))}}))}function En(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&Pn(t)}const An=Ln;function In(t){return yn(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Mn(t){return yn(t,t=>({set(e){this.__setAttr(t,e)&&Wn(this)}}))}function Wn(t){t.__layout.surfaceChanged||t.__layout.surfaceChange()}function Dn(t){return yn(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;f.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip)}}}))}function Fn(t){return yn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&Nn(this)}}))}function zn(t){return yn(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>Yn(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");Yn(this,t,e,s),this.mask&&Nn(this)}}))}function Nn(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function Yn(t,e,s,i){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==s||Pn(t))}function Xn(t){t.__layout.childrenSortChange(),t.__.flow&&t.__layout.boxChange()}function Un(t){return yn(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParentChange(Xn)}}))}function jn(t){t.__updateMask()}function Vn(t,e){return yn(t,t=>({set(s){this.__setAttr(t,s)&&(this.__layout.boxChanged||this.__layout.boxChange(),e?this.__updateMask():this.waitParentChange(jn))}}))}function Gn(t){t.__updateEraser()}function qn(t){return yn(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParentChange(Gn)}}))}function Hn(t){return yn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,this.leafer&&this.leafer.updateCursor())}}))}function Qn(t){return yn(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function Jn(t){return(e,s)=>{pn(e,"__DataProcessor",{get:()=>t})}}function $n(t){return(e,s)=>{pn(e,"__LayoutProcessor",{get:()=>t})}}function Zn(t,e,s){const i=t.__DataProcessor.prototype,r="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=fn(e,s);if(n(s))a.get=function(){return this[r]};else if("function"==typeof s)a.get=function(){const t=this[r];return null==t?s(this.__leaf):t};else if(_(s)){const t=g(s);a.get=function(){const e=this[r];return null==e?this[r]=t?{}:f.clone(s):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[r];if(null==t){const t=this,e=t.__naturalWidth,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&i.children.length?i.boxBounds.width:s}return t}:"height"===e&&(a.get=function(){const t=this[r];if(null==t){const t=this,e=t.__naturalHeight,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&i.children.length?i.boxBounds.height:s}return t});let l,d=i;for(;!l&&d;)l=gn(d,e),d=d.__proto__;l&&l.set&&(a.set=l.set),i[o]&&(a.set=i[o],delete i[o]),pn(i,e,a)}const Kn=new ne("rewrite"),to=[],eo=["destroy","constructor"];function so(t){return(e,s)=>{to.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function io(){return t=>{ro()}}function ro(t){to.length&&(to.forEach(e=>{t&&Kn.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),to.length=0)}function no(t,e){return s=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach(i=>{if(!(eo.includes(i)||e&&e.includes(i)))if(t.prototype){const e=gn(t.prototype,i);e&&Object.defineProperty(s.prototype,i,e)}else s.prototype[i]=t[i]})}}function oo(){return t=>{ge.register(t)}}function ao(){return t=>{me.register(t)}}setTimeout(()=>ro(!0));const{copy:ho,toInnerPoint:lo,toOuterPoint:co,scaleOfOuter:uo,rotateOfOuter:_o,skewOfOuter:po,multiplyParent:go,divideParent:fo,getLayout:yo}=Z,mo={},{round:xo}=Math,wo={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),ko(t,e,s),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)bo(i[t],e,s)}},updateMatrix(t,e,s){const i=t.__layout;e?s&&(i.waitAutoLayout=!0,t.__hasAutoLayout&&(i.matrixChanged=!1)):i.waitAutoLayout&&(i.waitAutoLayout=!1),i.matrixChanged&&t.__updateLocalMatrix(),i.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t,e){const s=t.__layout;s.boundsChanged&&t.__updateLocalBounds(),e&&(s.resized=void 0),s.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)So(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&So(t),t.__updateChange(),e.surfaceChanged&&(t.__hasComplex&&vo.updateComplex(t),e.surfaceChanged=!1)},updateAllChange(t){if(Co(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Bo(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},draggable:t=>(t.draggable||t.editable)&&t.hitSelf&&!t.locked,copyCanvasByWorld(t,e,s,i,r,n){i||(i=t.__nowWorld),t.__worldFlipped||se.fullImageShadow?e.copyWorldByReset(s,i,t.__nowWorld,r,n):e.copyWorldToInner(s,i,t.__layout.renderBounds,r)},clip(t,e,s){t.__worldOpacity&&(e.setWorld(t.__nowWorld=t.__getNowWorld(s)),t.__drawRenderPath(e),e.clipUI(t))},renderComplex(t,e,s){},updateComplex(t){},checkComplex(t){},moveWorld(t,e,s=0,i,r){const n=_(e)?Object.assign({},e):{x:e,y:s};i?co(t.localTransform,n,n,!0):t.parent&&lo(t.parent.scrollWorldTransform,n,n,!0),vo.moveLocal(t,n.x,n.y,r)},moveLocal(t,e,s=0,i){_(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=xo(e),s=xo(s)),i?t.animate({x:e,y:s},i):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,i,r,n,o){vo.zoomOfLocal(t,Ro(t,e),s,i,r,n,o)},zoomOfLocal(t,e,s,i=s,r,n,o){const a=t.__localMatrix;if(l(i)||(i&&(n=i),i=s),ho(mo,a),uo(mo,e,s,i),vo.hasHighPosition(t))vo.setTransform(t,mo,r,n,o);else{const e=t.x+mo.e-a.e,h=t.y+mo.f-a.f;n&&!r?t.animate({x:e,y:h,scaleX:t.scaleX*s,scaleY:t.scaleY*i},n):(t.x=e,t.y=h,t.scaleResize(s,i,!0!==r,o))}},rotateOfWorld(t,e,s,i){vo.rotateOfLocal(t,Ro(t,e),s,i)},rotateOfLocal(t,e,s,i){const r=t.__localMatrix;ho(mo,r),_o(mo,e,s),vo.hasHighPosition(t)?vo.setTransform(t,mo,!1,i):t.set({x:t.x+mo.e-r.e,y:t.y+mo.f-r.f,rotation:D.formatRotation(t.rotation+s)},i)},skewOfWorld(t,e,s,i,r,n){vo.skewOfLocal(t,Ro(t,e),s,i,r,n)},skewOfLocal(t,e,s,i=0,r,n){ho(mo,t.__localMatrix),po(mo,e,s,i),vo.setTransform(t,mo,r,n)},transformWorld(t,e,s,i,r){ho(mo,t.worldTransform),go(mo,e),t.parent&&fo(mo,t.parent.scrollWorldTransform),vo.setTransform(t,mo,s,i,r)},transform(t,e,s,i,r){ho(mo,t.localTransform),go(mo,e),vo.setTransform(t,mo,s,i,r)},setTransform(t,e,s,i,r){const n=t.__,o=n.origin&&vo.getInnerOrigin(t,n.origin),a=yo(e,o,n.around&&vo.getInnerOrigin(t,n.around));if(vo.hasOffset(t)&&(a.x-=n.offsetX,a.y-=n.offsetY),s){const e=a.scaleX/t.scaleX,s=a.scaleY/t.scaleY;if(delete a.scaleX,delete a.scaleY,o){Vt.scale(t.boxBounds,Math.abs(e),Math.abs(s));const i=vo.getInnerOrigin(t,n.origin);dt.move(a,o.x-i.x,o.y-i.y)}t.set(a),t.scaleResize(e,s,!1,r)}else t.set(a,i)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return uo(s,vo.getLocalOrigin(t,"center"),-1*i,1*i),s},getLocalOrigin:(t,e)=>dt.tempToOuterOf(vo.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return Bt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(ho(mo,t.worldTransform),fo(mo,e.scrollWorldTransform),s?mo:Object.assign({},mo)),updateScaleFixedWorld(t){},updateOuterBounds(t){},cacheId(t){},drop(t,e,s,i){t.setTransform(vo.getRelativeWorld(t,e,!0),i),e.add(t,s)},hasHighPosition:t=>t.origin||t.around||vo.hasOffset(t),hasOffset:t=>t.offsetX||t.offsetY,hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},animateMove(t,e,s=.3,i){if(e.x||e.y){if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const r=e.x*s,n=e.y*s;e.x-=r,e.y-=n,t.move(r,n),se.requestRender(()=>vo.animateMove(t,e,s,i))}i&&i()}}},vo=wo,{updateAllMatrix:bo,updateMatrix:ko,updateAllWorldOpacity:So,updateAllChange:Bo,updateChange:Co}=vo;function Ro(t,e){return t.updateLayout(),t.parent?dt.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const Po={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds(t){const{__:e,__layout:s}=t;return e.eraser||0===e.visible?null:s.localOuterBounds||s.localRenderBounds},maskLocalBoxBounds:(t,e)=>Oo(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>Oo(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds(t,e){const{__layout:s}=t;return Oo(t,e)&&(s.localOuterBounds||s.localRenderBounds)},excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};let To;function Oo(t,e){return e||(To=0),t.__.mask&&(To=1),To<0?null:(To&&(To=-1),!0)}const{updateBounds:Lo}=wo,Eo={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:s}=t;for(let i=0,r=s.length;i<r;i++)(t=s[i]).isBranch&&(t.__tempNumber=1,e.add(t),Ao(t,e))}},pushAllParent(t,e){const{keys:s}=e;if(s)for(;t.parent&&n(s[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let s=e.length;const{children:i}=t;for(let t=0,s=i.length;t<s;t++)i[t].isBranch&&e.push(i[t]);for(let t=s,i=e.length;t<i;t++)Io(e[t],e)},updateBounds(t,e){const s=[t];Io(t,s),Mo(s,e)},updateBoundsByBranchStack(t,e){let s,i;for(let r=t.length-1;r>-1;r--){s=t[r],i=s.children;for(let t=0,e=i.length;t<e;t++)Lo(i[t]);e&&e===s||Lo(s)}},move(t,e,s){let i;const{children:r}=t;for(let n=0,o=r.length;n<o;n++)i=(t=r[n]).__world,i.e+=e,i.f+=s,i.x+=e,i.y+=s,t.isBranch&&Wo(t,e,s)},scale(t,e,s,i,r,n,o){let a;const{children:h}=t,l=i-1,d=r-1;for(let c=0,u=h.length;c<u;c++)a=(t=h[c]).__world,a.a*=i,a.d*=r,(a.b||a.c)&&(a.b*=i,a.c*=r),a.e===a.x&&a.f===a.y?(a.x=a.e+=(a.e-n)*l+e,a.y=a.f+=(a.f-o)*d+s):(a.e+=(a.e-n)*l+e,a.f+=(a.f-o)*d+s,a.x+=(a.x-n)*l+e,a.y+=(a.y-o)*d+s),a.width*=i,a.height*=r,a.scaleX*=i,a.scaleY*=r,t.isBranch&&Do(t,e,s,i,r,n,o)}},{pushAllChildBranch:Ao,pushAllBranchStack:Io,updateBoundsByBranchStack:Mo,move:Wo,scale:Do}=Eo,Fo={run(t){if(t&&t.length){const e=t.length;for(let s=0;s<e;s++)t[s]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:zo,updateBounds:No}=wo,{toOuterOf:Yo,getPoints:Xo,copy:Uo}=Vt,jo="_localContentBounds",Vo="_worldContentBounds",Go="_worldBoxBounds",qo="_worldStrokeBounds";class Ho{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return Yo(this.contentBounds,this.leaf.__localMatrix,this[jo]||(this[jo]={})),this[jo]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return Yo(this.contentBounds,this.leaf.__world,this[Vo]||(this[Vo]={})),this[Vo]}get worldBoxBounds(){return Yo(this.boxBounds,this.leaf.__world,this[Go]||(this[Go]={})),this[Go]}get worldStrokeBounds(){return Yo(this.strokeBounds,this.leaf.__world,this[qo]||(this[qo]={})),this[qo]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:e}=t;if(t.isApp)return No(t);if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=t;for(;e.parent&&!e.parent.leafer;)e=e.parent;const s=e;if(s.__fullLayouting)return;s.__fullLayouting=!0,se.layout(s),delete s.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return Z.defaultMatrix;case"page":t=e.zoomLayer;default:return zo(e,t)}}getBounds(t,e="world"){switch(this.update(),e){case"world":return this.getWorldBounds(t);case"local":return this.getLocalBounds(t);case"inner":return this.getInnerBounds(t);case"page":e=this.leaf.zoomLayer;default:return new Qt(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",s){const{leaf:i}=this;let r,n,o,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),n=i.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=i.__;o={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},r=i.getLocalPointByInner(a);break;case"inner":r=a,n=Z.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),n=zo(i,e,!0)}if(o||(o=Z.getLayout(n)),Uo(o,a),dt.copy(o,r),s){const{scaleX:t,scaleY:e}=o,s=Math.abs(t),i=Math.abs(e);1===s&&1===i||(o.scaleX/=s,o.scaleY/=i,o.width*=s,o.height*=i)}return o}getLayoutPoints(t,e="world"){const{leaf:s}=this,i=Xo(this.getInnerBounds(t));let r;switch(e){case"world":r=null;break;case"local":r=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:r=e}return n(r)||i.forEach(t=>s.innerToWorld(t,null,!1,r)),i}shrinkContent(){const{x:t,y:e,width:s,height:i}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:i}}spreadStroke(){const{x:t,y:e,width:s,height:i}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:i},this._localStrokeBounds={x:t,y:e,width:s,height:i},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:i}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:i},this._localRenderBounds={x:t,y:e,width:s,height:i}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class Qo{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&se.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&se.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&se.event.stop(this.origin)}}class Jo extends Qo{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}Jo.ADD="child.add",Jo.REMOVE="child.remove",Jo.CREATED="created",Jo.MOUNTED="mounted",Jo.UNMOUNTED="unmounted",Jo.DESTROY="destroy";const $o="property.scroll";class Zo extends Qo{constructor(t,e,s,i,r){super(t,e),this.attrName=s,this.oldValue=i,this.newValue=r}}Zo.CHANGE="property.change",Zo.LEAFER_CHANGE="property.leafer_change",Zo.SCROLL=$o;const Ko={scrollX:$o,scrollY:$o};class ta extends Qo{constructor(t,e){super(t),Object.assign(this,e)}}ta.LOAD="image.load",ta.LOADED="image.loaded",ta.ERROR="image.error";class ea extends Qo{static checkHas(t,e,s){"on"===s?e===na?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(sa)||t.hasEvent(ia)||t.hasEvent(ra),t.__hasWorldEvent=t.hasEvent(na))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(sa,t),"inner"===e&&t.emit(ia,t)),t.emit(ra,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(na,t)}}ea.RESIZE="bounds.resize",ea.INNER="bounds.inner",ea.LOCAL="bounds.local",ea.WORLD="bounds.world";const{RESIZE:sa,INNER:ia,LOCAL:ra,WORLD:na}=ea,oa={};[sa,ia,ra,na].forEach(t=>oa[t]=1);class aa extends Qo{get bigger(){if(!this.old)return!0;const{width:t,height:e}=this.old;return this.width>=t&&this.height>=e}get smaller(){return!this.bigger}get samePixelRatio(){return!this.old||this.pixelRatio===this.old.pixelRatio}constructor(t,e){_(t)?(super(aa.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!n(this.resizingKeys[t.innerId])}}aa.RESIZE="resize";class ha extends Qo{constructor(t,e){super(t),this.data=e}}ha.REQUEST="watch.request",ha.DATA="watch.data";class la extends Qo{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}la.REQUEST="layout.request",la.START="layout.start",la.BEFORE="layout.before",la.LAYOUT="layout",la.AFTER="layout.after",la.AGAIN="layout.again",la.END="layout.end";class da extends Qo{constructor(t,e,s,i){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=i)}}da.REQUEST="render.request",da.CHILD_START="render.child_start",da.CHILD_END="render.child_end",da.START="render.start",da.BEFORE="render.before",da.RENDER="render",da.AFTER="render.after",da.AGAIN="render.again",da.END="render.end",da.NEXT="render.next";class ca extends Qo{}ca.START="leafer.start",ca.BEFORE_READY="leafer.before_ready",ca.READY="leafer.ready",ca.AFTER_READY="leafer.after_ready",ca.VIEW_READY="leafer.view_ready",ca.VIEW_COMPLETED="leafer.view_completed",ca.STOP="leafer.stop",ca.RESTART="leafer.restart",ca.END="leafer.end",ca.UPDATE_MODE="leafer.update_mode",ca.TRANSFORM="leafer.transform",ca.MOVE="leafer.move",ca.SCALE="leafer.scale",ca.ROTATE="leafer.rotate",ca.SKEW="leafer.skew";const{MOVE:ua,SCALE:_a,ROTATE:pa,SKEW:ga}=ca,fa={x:ua,y:ua,scaleX:_a,scaleY:_a,rotation:pa,skewX:ga,skewY:ga},ya={};class ma{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(u(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)u(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let i,r,n;s&&("once"===s?r=!0:"boolean"==typeof s?i=s:(i=s.capture,r=s.once));const o=xa(this,i,!0),h=a(t)?t.split(" "):t,l=r?{listener:e,once:r}:{listener:e};h.forEach(t=>{t&&(n=o[t],n?-1===n.findIndex(t=>t.listener===e)&&n.push(l):o[t]=[l],oa[t]&&ea.checkHas(this,t,"on"))})}off(t,e,s){if(t){const i=a(t)?t.split(" "):t;if(e){let t,r,n;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const o=xa(this,t);i.forEach(t=>{t&&(r=o[t],r&&(n=r.findIndex(t=>t.listener===e),n>-1&&r.splice(n,1),r.length||delete o[t],oa[t]&&ea.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;i.forEach(s=>{t&&delete t[s],e&&delete e[s]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,s,i){return e?this.on(t,s?e=e.bind(s):e,i):u(t)&&t.forEach(t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3])),{type:t,current:this,listener:e,options:i}}off_(t){if(!t)return;const e=u(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):u(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,s,i){if(!e)return u(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));_(s)?e=e.bind(s):i=s,this.on(t,e,{once:!0,capture:i})}emit(t,e,s){!e&&me.has(t)&&(e=me.get(t,{type:t,target:this,current:this}));const i=xa(this,s)[t];if(i){let r;for(let n=0,o=i.length;n<o&&!((r=i[n])&&(r.listener(e),r.once&&(this.off(t,r.listener,s),n--,o--),e&&e.isStopNow));n++);}this.syncEventer&&this.syncEventer.emitEvent(e,s)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:s,__captureMap:i}=this,r=s&&s[t],o=i&&i[t];return!!(n(e)?r||o:e?o:r)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function xa(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:ya)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:ya)}}const{on:wa,on_:va,off:ba,off_:ka,once:Sa,emit:Ba,emitEvent:Ca,hasEvent:Ra,destroy:Pa}=ma.prototype,Ta={on:wa,on_:va,off:ba,off_:ka,once:Sa,emit:Ba,emitEvent:Ca,hasEvent:Ra,destroyEventer:Pa},Oa=ne.get("setAttr"),La={__setAttr(t,e,s){if(this.leaferIsCreated){const i=this.__.__getInput(t);if(!s||h(e)||n(e)||(Oa.warn(this.innerName,t,e),e=void 0),_(e)||i!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new Zo(Zo.LEAFER_CHANGE,this,t,i,e));const s=fa[t];s&&(this.emitEvent(new ca(s,this)),this.emitEvent(new ca(ca.TRANSFORM,this)))}this.emitPropertyEvent(Zo.CHANGE,t,i,e);const s=Ko[t];return s&&this.emitPropertyEvent(s,t,i,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,s,i){const{leafer:r}=this;if(r.config.trackChanges||r.zoomLayer===this){const n=new Zo(t,this,e,s,i);this.isLeafer||this.hasEvent(t)&&this.emitEvent(n),r.emitEvent(n)}else r.watcher.add(this)},__realSetAttr(t,e){const s=this.__;s[t]=e,this.__proxyData&&this.setProxyAttr(t,e),s.normalStyle&&(this.lockNormalStyle||n(s.normalStyle[t])||(s.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:Ea,multiplyParent:Aa,translateInner:Ia,defaultWorld:Ma}=Z,{toPoint:Wa,tempPoint:Da}=Bt,Fa={__updateWorldMatrix(){const{parent:t,__layout:e,__world:s,__scrollWorld:i,__:r}=this;Aa(this.__local||e,t?t.__scrollWorld||t.__world:Ma,s,!!e.affectScaleOrRotation,r),i&&Ia(Object.assign(i,s),r.scrollX,r.scrollY),e.scaleFixed&&wo.updateScaleFixedWorld(this)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(Ea(e,s,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=s.x+s.offsetX,e.f=s.y+s.offsetY,(s.around||s.origin)&&(Wa(s.around||s.origin,t.boxBounds,Da),Ia(e,-Da.x,-Da.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:za,updateAllMatrix:Na}=wo,{updateBounds:Ya}=Eo,{toOuterOf:Xa,copyAndSpread:Ua,copy:ja}=Vt,{toBounds:Va}=Nr,Ga={__updateWorldBounds(){const{__layout:t,__world:e}=this;Xa(t.renderBounds,e,e),this.__hasComplex&&wo.checkComplex(this),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&ea.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&ea.emitWorld(this)},__updateLocalBounds(){const t=this.__layout,e=this.__;t.boxChanged&&(e.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&!t.strokeChanged&&(t.strokeChanged=!!t.boxChanged||2),t.renderSpread&&!t.renderChanged&&(t.renderChanged=!!t.boxChanged||2),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(2===t.strokeChanged?this.__updateLocalStrokeBounds():(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.resized="inner",(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0)),t.strokeChanged=void 0,this.parent&&this.parent.__layout.strokeChange()),t.renderChanged&&(2===t.renderChanged?this.__updateLocalRenderBounds():(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel()),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.outerScale&&wo.updateOuterBounds(this),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),Xa(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Xa(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Xa(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const s=this.__layout.boxBounds,i=this.__;i.__usePathBox?Va(i.path,s):(s.x=0,s.y=0,s.width=i.width,s.height=i.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.childrenSortChanged&&this.__updateSortChildren(),this.__layout.boxChanged&&this.__updateFlowLayout(),Na(this),Ya(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(Na(this),Ya(this,this))):za(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;Ua(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:s}=e;l(s)&&s<=0?ja(e.renderBounds,e.strokeBounds):Ua(e.renderBounds,e.boxBounds,s)}},qa={__render(t,e){if(e.shape)return this.__renderShape(t,e);if((!e.cellList||e.cellList.has(this))&&this.__worldOpacity){const s=this.__;if(s.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.ignoreOpacity?1:e.dimOpacity&&!s.dimskip?s.opacity*e.dimOpacity:s.opacity,this.__.__single){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!0,!0);this.__draw(i,e,t),wo.copyCanvasByWorld(this,t,i,this.__nowWorld,s.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);ne.showBounds&&ne.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){wo.clip(this,t,e)},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Ha}=Po,{hasSize:Qa}=Vt,Ja={__updateChange(){this.__layout.childrenSortChanged&&this.__updateSortChildren(),this.__.__checkSingle()},__render(t,e){const s=this.__nowWorld=this.__getNowWorld(e);if(this.__worldOpacity&&Qa(s)){const i=this.__;if(i.__useDim){if(i.bright&&!e.topRendering)return e.topList.add(this);i.dim?e.dimOpacity=!0===i.dim?.2:i.dim:i.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(i.__single&&!this.isBranchLeaf){if("path"===i.eraser)return this.__renderEraser(t,e);const r=t.getSameCanvas(!1,!0);this.__renderBranch(r,e),t.opacity=e.ignoreOpacity?1:e.dimOpacity?i.opacity*e.dimOpacity:i.opacity,t.copyWorldByReset(r,s,s,i.__blendMode,!0),r.recycle(s)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{let s;const{children:i}=this;for(let r=0,n=i.length;r<n;r++)s=i[r],Ha(s,e)||(s.__hasComplex?wo.renderComplex(s,t,e):s.__render(t,e));0===this.__hasMask&&this.__rerenderMask(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Ha(s[i],e)||s[i].__clip(t,e)}}},{LEAF:$a,create:Za}=x,{stintSet:Ka}=f,{toInnerPoint:th,toOuterPoint:eh,multiplyParent:sh}=Z,{toOuterOf:ih}=Vt,{copy:rh,move:nh}=dt,{getScaleFixedData:oh}=D,{moveLocal:ah,zoomOfLocal:hh,rotateOfLocal:lh,skewOfLocal:dh,moveWorld:ch,zoomOfWorld:uh,rotateOfWorld:_h,skewOfWorld:ph,transform:gh,transformWorld:fh,setTransform:yh,getFlipTransform:mh,getLocalOrigin:xh,getRelativeWorld:wh,drop:vh}=wo;let bh=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return m}get __LayoutProcessor(){return Ho}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isFrame(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get scrollWorldTransform(){return this.updateLayout(),this.__scrollWorld||this.__world}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.updateLayout(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=Za($a),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(Jo.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParentChange(t){this.__parentChange||(this.__parentChange=[]),this.__parentChange.includes(t)||this.__parentChange.push(t),this.parent&&t(this.parent,this)}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(Jo.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(Jo.MOUNTED,t,"once")}nextRender(t,e,s){this.leafer?this.leafer.nextRender(t,e,s):this.waitLeafer(()=>this.leafer.nextRender(t,e,s))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(Jo.MOUNTED),t.cacheId&&wo.cacheId(this)):this.__emitLifeEvent(Jo.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,i=e.length;s<i;s++)e[s].__bindLeafer(t)}}__bindFrame(t){if(this.isFrame&&null!==t&&(t=this),this.frame=t,this.isBranch){const{children:e}=this;for(let s=0,i=e.length;s<i;s++)e[s].__bindFrame(t)}}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}scaleResize(t,e=t,s,i){this.scaleX*=t,this.scaleY*=e}updateLayout(){this.__layout.update()}forceUpdate(t){let e;if(t&&"bounds"!==t?"surface"===t?(Wn(this),e=!0):"stroke"===t&&(En(this),e=!0):(Pn(this),e=!0),e){const{leafer:t}=this;return t&&t.watcher&&t.watcher.__onAttrChange({target:this})}const s=this.__.__getInput(t);this.__[t]=n(s)?null:void 0,this[t]=s}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateEraser(){this.__hasEraser=this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:s}=this.__layout;t.clearRect(s.x,s.y,s.width,s.height),t.restore()}__updateMask(){const t=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity);this.__hasMask=this.__.maskskip?t&&0:t}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,s=this.__world;return sh(s,t.matrix,e,void 0,s),ih(this.__layout.renderBounds,e,e),Ka(e,"half",s.half),Ka(e,"ignorePixelSnap",s.ignorePixelSnap),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e,s=!0){return oh(an.patternLocked?this.__world:this.__nowWorld||this.__world,e,s,t)}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,s){return this.__layout.getLayoutBounds(t,e,s)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,s){const i=e?wh(this,e):this.worldTransform,r=s?t:{};return ih(t,i,r),r}worldToLocal(t,e,s,i){this.parent?this.parent.worldToInner(t,e,s,i):e&&rh(e,t)}localToWorld(t,e,s,i){this.parent?this.parent.innerToWorld(t,e,s,i):e&&rh(e,t)}worldToInner(t,e,s,i){i&&(i.innerToWorld(t,e,s),t=e||t),th(this.worldTransform,t,e,s)}innerToWorld(t,e,s,i){eh(this.worldTransform,t,e,s),i&&i.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,i){const r=this.getInnerPoint(t,e,s,i);return s?r:this.getBoxPointByInner(r,null,null,!0)}getBoxPointByInner(t,e,s,i){const r=i?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return nh(r,-n,-o),r}getInnerPoint(t,e,s,i){const r=i?t:{};return this.worldToInner(t,r,s,e),r}getInnerPointByBox(t,e,s,i){const r=i?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return nh(r,n,o),r}getInnerPointByLocal(t,e,s,i){return this.getInnerPoint(t,this.parent,s,i)}getLocalPoint(t,e,s,i){const r=i?t:{};return this.worldToLocal(t,r,s,e),r}getLocalPointByInner(t,e,s,i){return this.getWorldPoint(t,this.parent,s,i)}getPagePoint(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,i)}getWorldPoint(t,e,s,i){const r=i?t:{};return this.innerToWorld(t,r,s,e),r}getWorldPointByBox(t,e,s,i){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,i),e,s,!0)}getWorldPointByLocal(t,e,s,i){const r=i?t:{};return this.localToWorld(t,r,s,e),r}getWorldPointByPage(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,i)}setTransform(t,e,s,i){yh(this,t,e,s,i)}transform(t,e,s,i){gh(this,t,e,s,i)}move(t,e,s){ah(this,t,e,s)}moveInner(t,e,s){ch(this,t,e,!0,s)}scaleOf(t,e,s,i,r,n){hh(this,xh(this,t),e,s,i,r,n)}rotateOf(t,e,s){lh(this,xh(this,t),e,s)}skewOf(t,e,s,i,r){dh(this,xh(this,t),e,s,i,r)}transformWorld(t,e,s,i){fh(this,t,e,s,i)}moveWorld(t,e,s){ch(this,t,e,!1,s)}scaleOfWorld(t,e,s,i,r,n){uh(this,t,e,s,i,r,n)}rotateOfWorld(t,e){_h(this,t,e)}skewOfWorld(t,e,s,i,r){ph(this,t,e,s,i,r)}flip(t,e){gh(this,mh(this,t),!1,e)}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){vh(this,t,e,s)}static changeAttr(t,e,s){s?this.addAttr(t,e,s):Zn(this.prototype,t,e)}static addAttr(t,e,s,i){s||(s=Cn),s(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new Jo(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(Jo.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};bh=s([no(La),no(Fa),no(Ga),no(Ta),no(qa)],bh);const{setListWithFn:kh}=Vt,{sort:Sh}=Eo,{localBoxBounds:Bh,localStrokeBounds:Ch,localRenderBounds:Rh,maskLocalBoxBounds:Ph,maskLocalStrokeBounds:Th,maskLocalRenderBounds:Oh}=Po,Lh=new ne("Branch");let Eh=class extends bh{__updateStrokeSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){let t;const{children:e}=this;for(let s=0,i=e.length;s<i;s++)if(t=e[s].__layout,t.renderSpread||t.localOuterBounds)return 1;return 0}__updateBoxBounds(t,e){kh(e||this.__layout.boxBounds,this.children,this.__hasMask?Ph:Bh)}__updateStrokeBounds(t){kh(t||this.__layout.strokeBounds,this.children,this.__hasMask?Th:Ch)}__updateRenderBounds(t){kh(t||this.__layout.renderBounds,this.children,this.__hasMask?Oh:Rh)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,i=e.length;s<i;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(Sh),this.__layout.affectChildrenSort=t}this.__layout.childrenSortChanged=!1}add(t,e){if(t===this||t.destroyed)return Lh.warn("add self or destroyed");const s=n(e);if(!t.__){if(u(t))return t.forEach(t=>{this.add(t,e),s||e++});if(!(t=ge.get(t.tag,t)))return}t.parent&&t.parent.remove(t),t.parent=this,s?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const i=t.__layout;i.boxChanged||i.boxChange(),i.matrixChanged||i.matrixChange(),t.__parentChange&&t.__parentChange.forEach(e=>e(this,t)),t.__bubbleMap&&t.__emitLifeEvent(Jo.ADD),this.isFrame&&t.__bindFrame(this),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Jo.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",()=>this.__remove(t,e)):this.__remove(t,e):this.find(t).forEach(t=>this.remove(t,e)):n(t)&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach(e=>{this.__realRemoveChild(e),t&&e.destroy()}))}clear(){this.removeAll(!0)}__remove(t,e){const s=this.children.indexOf(t);s>-1&&(this.children.splice(s,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(Jo.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Jo.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear())),this.isFrame&&t.__bindFrame(null)}__emitChildEvent(t,e){const{leafer:s}=this;if(s.config.trackChanges||s.zoomLayer===this){const i=new Jo(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(i),s.emitEvent(i)}else s.watcher.addChild(e,this,t)}};Eh=s([no(Ja)],Eh);class Ah{get length(){return this.list.length}constructor(t){this.reset(),t&&(u(t)?this.addList(t):this.add(t))}has(t){return t&&!n(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return n(e)?-1:e}add(t){const{list:e,keys:s}=this;n(s[t.innerId])&&(e.push(t),s[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:s}=this;if(n(s[t.innerId])){const{list:i}=this;for(let t=e,r=i.length;t<r;t++)s[i[t].innerId]++;0===e?i.unshift(t):(e>i.length&&(e=i.length),i.splice(e,0,t)),s[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let s;for(let i=0,r=e.length;i<r;i++)n(s)?e[i].innerId===t.innerId&&(s=i,delete this.keys[t.innerId]):this.keys[e[i].innerId]=i-1;n(s)||e.splice(s,1)}sort(t){const{list:e}=this;t?e.sort((t,e)=>e.__level-t.__level):e.sort((t,e)=>t.__level-e.__level)}forEach(t){this.list.forEach(t)}clone(){const t=new Ah;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};const{list:t,keys:e}=this;for(let s=0,i=t.length;s<i;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class Ih{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(u(t)?this.addList(t):this.add(t))}has(t){return!n(this.keys[t.innerId])}without(t){return n(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:s}=this;e[t.innerId]||(e[t.innerId]=1,s[t.__level]?s[t.__level].push(t):(s[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(s=>{e=this.levelMap[s];for(let s=0,i=e.length;s<i;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const Mh="2.2.11";class Wh extends Ie{get allowBackgroundColor(){return!0}init(){this.__createView(),this.__createContext(),this.resize(this.config)}__createView(){this.view=se.origin.createCanvas(1,1)}updateViewSize(){const{width:t,height:e,pixelRatio:s}=this;this.view.width=Math.ceil(t*s),this.view.height=Math.ceil(e*s),this.clientBounds=this.bounds}}function Dh(t,e){se.origin={createCanvas:(t,e)=>new OffscreenCanvas(t,e),canvasToDataURL:(t,e,s)=>new Promise((i,r)=>{t.convertToBlob({type:Zr.mimeType(e),quality:s}).then(t=>{var e=new FileReader;e.onload=t=>i(t.target.result),e.onerror=t=>r(t),e.readAsDataURL(t)}).catch(t=>{r(t)})}),canvasToBolb:(t,e,s)=>t.convertToBlob({type:Zr.mimeType(e),quality:s}),canvasSaveAs:(t,e,s)=>new Promise(t=>t()),download(t,e){},loadImage:(t,e,s)=>new Promise((e,s)=>{let i=new XMLHttpRequest;i.open("GET",se.image.getRealURL(t),!0),i.responseType="blob",i.onload=()=>{createImageBitmap(i.response).then(t=>{e(t)}).catch(t=>{s(t)})},i.onerror=t=>s(t),i.send()}),loadContent(t){return i(this,arguments,void 0,function*(t,e="text"){const s=yield fetch(t);if(!s.ok)throw new Error(`${s.status}`);return yield s[e]()})}},se.canvas=_e.canvas(),se.conicGradientSupport=!!se.canvas.context.createConicGradient}$r(OffscreenCanvasRenderingContext2D.prototype),$r(Path2D.prototype),Object.assign(_e,{canvas:(t,e)=>new Wh(t,e),image:t=>new cn(t)}),se.name="web",se.isWorker=!0,se.backgrounder=!0,se.requestRender=function(t){requestAnimationFrame(t)},pn(se,"devicePixelRatio",{get:()=>1});const{userAgent:Fh}=navigator;Fh.indexOf("Firefox")>-1?(se.conicGradientRotate90=!0,se.intWheelDeltaY=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&(se.fullImageShadow=!0),Fh.indexOf("Windows")>-1?(se.os="Windows",se.intWheelDeltaY=!0):Fh.indexOf("Mac")>-1?se.os="Mac":Fh.indexOf("Linux")>-1&&(se.os="Linux");class zh{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove&&this.config.usePartLayout){const t=new Ah;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.changed=0,this.config={},this.__updatedList=new Ah,this.target=t,e&&(this.config=f.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed<100&&(this.changed++,this.running&&this.target.emit(da.REQUEST))}__onAttrChange(t){this.add(t.target)}add(t){this.config.usePartLayout&&this.__updatedList.add(t),this.update()}addChild(t,e,s){this.config.usePartLayout&&(s===Jo.ADD?(this.hasAdd=!0,this.__pushChild(t)):(this.hasRemove=!0,this.__updatedList.add(e))),this.update()}__onChildEvent(t){this.addChild(t.child,t.parent,t.type)}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new ha(ha.DATA,{updatedList:this.updatedList})),this.__updatedList=new Ah,this.totalTimes++,this.hasVisible=this.hasRemove=this.hasAdd=!1,this.changed=0}__listenEvents(){this.__eventIds=[this.target.on_([[Zo.CHANGE,this.__onAttrChange,this],[[Jo.ADD,Jo.REMOVE],this.__onChildEvent,this],[ha.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:Nh,updateBounds:Yh,updateChange:Xh}=wo,{pushAllChildBranch:Uh,pushAllParent:jh}=Eo,Vh={updateMatrix(t,e){let s,i,r=0;const{list:n}=t;for(;r<n.length;)s=n[r],i=s.__layout,e.without(s)&&!i.proxyZoom&&(i.matrixChanged?(Nh(s,!0),s.isBranch&&Uh(s,e),Gh(s,e)):i.boundsChanged&&(s.isBranch&&(s.__tempNumber=0),Gh(s,e))),r++},updateBounds(t){let e,s,i,r,n=0;const{levels:o,levelMap:a}=t;for(t.sort(!0);n<o.length;){e=o[n],s=a[e];for(let t=0,e=s.length;t<e;t++){if(i=s[t],i.isBranch&&i.__tempNumber){r=i.children;for(let t=0,e=r.length;t<e;t++)r[t].isBranch||Yh(r[t])}Yh(i)}n++}},updateChange(t){t.list.forEach(Xh)},push:Gh};function Gh(t,e){e.add(t),jh(t,e)}const{worldBounds:qh}=Po;class Hh{constructor(t){this.updatedBounds=new Qt,this.beforeBounds=new Qt,this.afterBounds=new Qt,u(t)&&(t=new Ah(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,qh)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,qh),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:Qh,updateAllChange:Jh}=wo,$h=ne.get("Layouter");class Zh{constructor(t,e){this.totalTimes=0,this.config={usePartLayout:!0},this.__levelList=new Ih,this.target=t,e&&(this.config=f.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(la.START),this.layoutOnce(),t.emitEvent(new la(la.END,this.layoutedBlocks,this.times))}catch(t){$h.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?$h.warn("layouting"):this.times>3?$h.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(ha.REQUEST),this.totalTimes>1&&this.config.usePartLayout?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=le.start("PartLayout"),{target:s,__updatedList:i}=this,{BEFORE:r,LAYOUT:n,AFTER:o}=la,a=this.getBlocks(i);a.forEach(t=>t.setBefore()),s.emitEvent(new la(r,a,this.times)),this.extraBlock=null,i.sort(),Vh.updateMatrix(i,this.__levelList),Vh.updateBounds(this.__levelList),Vh.updateChange(i),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),s.emitEvent(new la(n,a,this.times)),s.emitEvent(new la(o,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,le.end(e)}fullLayout(){const t=le.start("FullLayout"),{target:e}=this,{BEFORE:s,LAYOUT:i,AFTER:r}=la,n=this.getBlocks(new Ah(e));e.emitEvent(new la(s,n,this.times)),Zh.fullLayout(e),n.forEach(t=>{t.setAfter()}),e.emitEvent(new la(i,n,this.times)),e.emitEvent(new la(r,n,this.times)),this.addBlocks(n),le.end(t)}static fullLayout(t){Qh(t,!0),t.isBranch?Eo.updateBounds(t):wo.updateBounds(t),Jh(t)}addExtra(t,e){if(!this.__updatedList.has(t)){const{updatedList:s,beforeBounds:i}=this.extraBlock||(this.extraBlock=new Hh([]));if(s.length?i.add(t.__world):i.set(t.__world),s.add(t),e){const e=this.__levelList;Vh.push(t,e),e.sort(!0)}}}createBlock(t){return new Hh(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[la.REQUEST,this.layout,this],[la.AGAIN,this.layoutAgain,this],[ha.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const Kh=ne.get("Renderer");class tl{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,s){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,ceilPartPixel:!0,maxFPS:120},this.frames=[],this.target=t,this.canvas=e,s&&(this.config=f.default(s,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.requestTime||this.__requestRender()}requestLayout(){this.target.emit(la.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(da.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(da.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(da.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Qt,Kh.log(e.innerName,"---\x3e");try{this.emitRender(da.START),this.renderOnce(t),this.emitRender(da.END,this.totalBounds),an.clearRecycled()}catch(t){this.rendering=!1,Kh.error(t)}Kh.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return Kh.warn("rendering");if(this.times>3)return Kh.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Qt,this.renderOptions={},t)this.emitRender(da.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(da.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(da.RENDER,this.renderBounds,this.renderOptions),this.emitRender(da.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach(e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(t){const e=le.start("PartRender"),{canvas:s}=this,i=t.getIntersect(s.bounds),r=new Qt(i);s.save(),i.spread(tl.clipSpread).ceil();const{ceilPartPixel:n}=this.config;s.clipWorld(i,n),s.clearWorld(i,n),this.__render(i,r),s.restore(),le.end(e)}fullRender(){const t=le.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),le.end(t)}__render(t,e){const{canvas:s,target:i}=this,r=t.includes(i.__world),n=r?{includes:r}:{bounds:t,includes:r};this.needFill&&s.fillWorld(t,this.config.fill),ne.showRepaint&&ne.drawRepaint(s,t),this.config.useCellRender&&(n.cellList=this.getCellList()),se.render(i,s,n),this.renderBounds=e=e||t,this.renderOptions=n,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),s.updateRender(e)}getCellList(){}addBlock(t,e){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Qt;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);this.requestTime=this.frameTime||Date.now();const e=()=>{const t=1e3/((this.frameTime=Date.now())-this.requestTime),{maxFPS:s}=this.config;if(s&&t>s)return se.requestRender(e);const{frames:i}=this;i.length>30&&i.shift(),i.push(t),this.FPS=Math.round(i.reduce((t,e)=>t+e,0)/i.length),this.requestTime=0,this.checkRender()};se.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:s}=t.old;if(!new Qt(0,0,e,s).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Qt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;const{updatedList:s}=t;s&&s.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||Kh.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds,s)})}emitRender(t,e,s){this.target.emitEvent(new da(t,this.times,e,s))}__listenEvents(){this.__eventIds=[this.target.on_([[da.REQUEST,this.update,this],[la.END,this.__onLayoutEnd,this],[da.AGAIN,this.renderAgain,this],[aa.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}}function el(t){return yn(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0);const s=this.__layout;s.renderChanged||s.renderChange(),s.surfaceChange()}}))}function sl(t){return yn(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function il(){return(t,e)=>{const s="_"+e;pn(t,e,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}function rl(t){return(e,s)=>{pn(e,s,fn(s,t))}}tl.clipSpread=10,Object.assign(_e,{watcher:(t,e)=>new zh(t,e),layouter:(t,e)=>new Zh(t,e),renderer:(t,e,s)=>new tl(t,e,s),selector:(t,e)=>{},interaction:(t,e,s,i)=>{}}),se.layout=Zh.fullLayout,se.render=function(t,e,s){const i=Object.assign(Object.assign({},s),{topRendering:!0});s.topList=new Ah,t.__render(e,s),s.topList.length&&s.topList.forEach(t=>t.__render(e,i))};const nl={},ol={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},al=Zt,hl={},ll={},dl={},cl={},ul={},_l={apply(){ue.need("filter")}},pl={},gl={setStyleName:()=>ue.need("state"),set:()=>ue.need("state")},fl={list:{},register(t,e){fl.list[t]=e},get:t=>fl.list[t]},{parse:yl,objectToCanvasData:ml}=ri,{stintSet:xl}=f,{hasTransparent:wl}=ol,vl={originPaint:{}},bl=ne.get("UIData");class kl extends m{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this,e=t.__hasStrokeSides||t.strokeWidth;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,e):e}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return null==this._width}get __autoHeight(){return null==this._height}get __autoSide(){return null==this._width||null==this._height}get __autoSize(){return null==this._width&&null==this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,bl.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,bl.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),a(t)||!t?(xl(this,"__isTransparentFill",wl(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):_(t)&&this.__setPaint("fill",t)}setStroke(t){a(t)||!t?(xl(this,"__isTransparentStroke",wl(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):_(t)&&this.__setPaint("stroke",t)}setPath(t){const e=a(t);e||t&&_(t[0])?(this.__setInput("path",t),this._path=e?yl(t,this.__useArrow):ml(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Sl(this,"shadow",t)}setInnerShadow(t){Sl(this,"innerShadow",t)}setFilter(t){Sl(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&ll.compute("fill",this.__leaf),e&&ll.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeScaleFixed:s}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),n(t.strokeScaleFixed)||(s=t.strokeScaleFixed)),s){const{scaleX:t}=this.__leaf.getRenderScaleData(!0,s,!1);if(1!==t)return e*t}return e}__checkComplex(){const t=this;xl(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)}__setPaint(t,e){this.__setInput(t,e);const s=this.__leaf.__layout;s.boxChanged||s.boxChange(),u(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=vl)):(this.__isStrokes=!0,this._stroke||(this._stroke=vl))}__removePaint(t,e){e&&this.__removeInput(t),dl.recycleImage(t,this),"fill"===t?(xl(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(xl(this,"__isAlphaPixelStroke",void 0),xl(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function Sl(t,e,s){t.__setInput(e,s),u(s)?(s.some(t=>!1===t.visible)&&(s=s.filter(t=>!1!==t.visible)),s.length||(s=void 0)):s=s&&!1!==s.visible?[s]:void 0,t["_"+e]=s}class Bl extends kl{}class Cl extends Bl{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class Rl extends Bl{__getInputData(t,e){const s=super.__getInputData(t,e);return Ae.forEach(t=>delete s[t]),s}}class Pl extends Cl{}class Tl extends kl{get __usePathBox(){return this.points||this.__pathInputed}}class Ol extends kl{get __boxStroke(){return!this.__pathInputed}}class Ll extends kl{get __boxStroke(){return!this.__pathInputed}}class El extends kl{get __usePathBox(){return this.points||this.__pathInputed}}class Al extends kl{}class Il extends kl{get __pathInputed(){return 2}}class Ml extends Bl{}const Wl={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class Dl extends kl{get __useNaturalRatio(){return!1}setFontWeight(t){a(t)?(this.__setInput("fontWeight",t),t=Wl[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,s=e.__box;if(t){const{boxStyle:i}=this;if(s)for(let t in i)s[t]=void 0;else s=e.__box=ge.get("Rect",0);const r=e.__layout,n=s.__layout;i||(s.parent=e,s.__world=e.__world,n.boxBounds=r.boxBounds),s.set(t),n.strokeChanged&&r.strokeChange()}else s&&(e.__box=s.parent=null,s.destroy());this._boxStyle=t}__getInputData(t,e){const s=super.__getInputData(t,e);return s.textEditing&&delete s.textEditing,s}}class Fl extends Ol{get __urlType(){return"image"}setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:this.__urlType,mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return t.url&&delete t.fill,t}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url&&delete s.fill,s}}class zl extends Ol{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url=this.__leaf.canvas.toDataURL("image/png"),s}}const{max:Nl,add:Yl}=C,Xl={__updateStrokeSpread(){let t=0,e=0;const s=this.__,{strokeAlign:i,__maxStrokeWidth:r}=s,n=this.__box;if((s.stroke||"all"===s.hitStroke)&&r&&"inside"!==i&&(e=t="center"===i?r/2:r,!s.__boxStroke||s.__useArrow)){const e=s.__isLinePath?0:("miter"===s.strokeJoin?10:1)*t,i="none"===s.strokeCap?0:r;t+=Math.max(e,i)}return s.__useArrow&&(t+=5*r),n&&(t=Nl(t,n.__layout.strokeSpread=n.__updateStrokeSpread()),e=Math.max(e,n.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:i,backgroundBlur:r,filter:n,renderSpread:o}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=ul.getShadowRenderSpread(this,e)),i&&(t=Nl(t,i)),n&&(t=Yl(t,_l.getSpread(n))),o&&(t=Yl(t,o)),a&&(t=Yl(t,a));let l=t;return s&&(l=Nl(l,ul.getInnerShadowSpread(this,s))),r&&(l=Nl(l,r)),this.__layout.renderShapeSpread=l,h?Nl(h.__updateRenderSpread(),t):t}},{stintSet:Ul}=f,jl={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Ul(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Ul(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:s,stroke:i}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;Ul(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!ul.isTransformShadow(e[0])&&!(e[0].blendMode&&"pass-through"!==e[0].blendMode)&&s&&!t.__isTransparentFill&&!(u(s)&&s.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),t.__checkComplex()},__drawFast(t,e){Vl(this,t,e)},__draw(t,e,s){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:n,__drawAfterFill:o,__fillAfterStroke:a,__isFastShadow:h}=i;if(this.__drawRenderPath(t),i.__useEffect&&!h){const h=ll.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=i;l&&ul.shadow(this,t,h),a&&(i.__isStrokes?ll.strokes(n,this,t,e):ll.stroke(n,this,t,e)),r&&(i.__isFills?ll.fills(r,this,t,e):ll.fill(r,this,t,e)),o&&this.__drawAfterFill(t,e),d&&ul.innerShadow(this,t,h),n&&!a&&(i.__isStrokes?ll.strokes(n,this,t,e):ll.stroke(n,this,t,e)),c&&_l.apply(c,this,this.__nowWorld,t,s,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(i.__isStrokes?ll.strokes(n,this,t,e):ll.stroke(n,this,t,e)),h){const e=i.shadow[0],{scaleX:s,scaleY:r}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*s,e.y*r,e.blur*s,ol.string(e.color))}r&&(i.__isFills?ll.fills(r,this,t,e):ll.fill(r,this,t,e)),h&&t.restore(),o&&this.__drawAfterFill(t,e),n&&!a&&(i.__isStrokes?ll.strokes(n,this,t,e):ll.stroke(n,this,t,e))}}else i.__pathForRender?Vl(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const s=this.__,{fill:i,stroke:r}=s;i&&!e.ignoreFill&&(s.__isAlphaPixelFill?ll.fills(i,this,t,e):ll.fill("#000000",this,t,e)),s.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(s.__isAlphaPixelStroke?ll.strokes(r,this,t,e):ll.stroke("#000000",this,t,e))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function Vl(t,e,s){const{fill:i,stroke:r,__drawAfterFill:n,__fillAfterStroke:o}=t.__;t.__drawRenderPath(e),o&&ll.stroke(r,t,e,s),i&&ll.fill(i,t,e,s),n&&t.__drawAfterFill(e,s),r&&!o&&ll.stroke(r,t,e,s)}const Gl={__drawFast(t,e){let{x:s,y:i,width:r,height:n}=this.__layout.boxBounds;const{fill:o,stroke:a,__drawAfterFill:h}=this.__;if(o&&(t.fillStyle=o,t.fillRect(s,i,r,n)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:o,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(o){case"center":t.strokeRect(0,0,r,n);break;case"inside":r-=h,n-=h,r<0||n<0?(t.save(),this.__clip(t,e),t.strokeRect(s+l,i+l,r,n),t.restore()):t.strokeRect(s+l,i+l,r,n);break;case"outside":t.strokeRect(s-l,i-l,r+h,n+h)}}}};var ql;let Hl=ql=class extends bh{get app(){return this.leafer&&this.leafer.app}set strokeWidthFixed(t){this.strokeScaleFixed=t}get strokeWidthFixed(){return this.strokeScaleFixed}set scale(t){D.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return Qr.set(this.path=t||[]),t||this.__drawPathByBox(Qr),Qr}set(t,e){t&&Object.assign(this,t)}get(t){return a(t)?this.__.__getInput(t):this.__.__getInputData(t)}find(t,e){return ue.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return ue.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let s=e?this.__.__pathForRender:this.__.path;return s||(Qr.set(s=[]),this.__drawPathByBox(Qr,"box",!e)),t?ri.toCanvasData(s,!0):s}getPathString(t,e,s){return ri.stringify(this.getPath(t,e),s)}asPath(t,e){this.path=this.getPath(t,e)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||pl.running?t.__computePaint():t.__needComputePaint=!0}}__updatePath(){}__updateRenderPath(t){const e=this.__;e.path?(e.__pathForRender=e.cornerRadius||e.path.radius?qr.smooth(e.path,e.cornerRadius,e.cornerSmoothing):e.path,e.__useArrow&&hl.addArrows(this,t)):e.__pathForRender&&(e.__pathForRender=void 0)}__drawRenderPath(t){const e=this.__;t.beginPath(),e.__useArrow&&hl.updateArrow(this),this.__drawPathByData(t,e.__pathForRender)}__drawPath(t){const e=this.__;t.beginPath(),e.__usePointsMode?hr.drawPathByPoints(t,e.points,e.closed):this.__drawPathByData(t,e.path,!0)}__drawPathByData(t,e,s){e?hr.drawPathByData(t,e):this.__drawPathByBox(t,"box",s)}__drawPathByBox(t,e="box",s){const{x:i,y:r,width:n,height:o}=this.__layout[e+"Bounds"];if(this.__.cornerRadius&&!s){const{cornerRadius:e}=this.__;t.roundRect(i,r,n,o,l(e)?[e]:e)}else t.rect(i,r,n,o);t.closePath()}drawImagePlaceholder(t,e,s){ll.fill(this.__.placeholderColor,this,e,s)}animate(t,e,s,i){return this.set(t),ue.need("animate")}killAnimate(t,e){}export(t,e){return ue.need("export")}syncExport(t,e){return ue.need("export")}clone(t){const e=f.clone(this.toJSON());return t&&Object.assign(e,t),ql.one(e)}static one(t,e,s,i,r){return ge.get(t.tag||this.prototype.__tag,t,e,s,i,r)}static registerUI(){oo()(this)}static registerData(t){Jn(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.__.__willDestroy=!0,this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};s([Jn(kl)],Hl.prototype,"__",void 0),s([il()],Hl.prototype,"zoomLayer",void 0),s([wn("")],Hl.prototype,"id",void 0),s([wn("")],Hl.prototype,"name",void 0),s([wn("")],Hl.prototype,"className",void 0),s([Mn("pass-through")],Hl.prototype,"blendMode",void 0),s([Fn(1)],Hl.prototype,"opacity",void 0),s([zn(!0)],Hl.prototype,"visible",void 0),s([Mn(!1)],Hl.prototype,"locked",void 0),s([Dn(!1)],Hl.prototype,"dim",void 0),s([Dn(!1)],Hl.prototype,"dimskip",void 0),s([Un(0)],Hl.prototype,"zIndex",void 0),s([Vn(!1)],Hl.prototype,"mask",void 0),s([qn(!1)],Hl.prototype,"eraser",void 0),s([vn(0,!0)],Hl.prototype,"x",void 0),s([vn(0,!0)],Hl.prototype,"y",void 0),s([Cn(100,!0)],Hl.prototype,"width",void 0),s([Cn(100,!0)],Hl.prototype,"height",void 0),s([Sn(1,!0)],Hl.prototype,"scaleX",void 0),s([Sn(1,!0)],Hl.prototype,"scaleY",void 0),s([Bn(0,!0)],Hl.prototype,"rotation",void 0),s([Bn(0,!0)],Hl.prototype,"skewX",void 0),s([Bn(0,!0)],Hl.prototype,"skewY",void 0),s([vn(0,!0)],Hl.prototype,"offsetX",void 0),s([vn(0,!0)],Hl.prototype,"offsetY",void 0),s([bn(0,!0)],Hl.prototype,"scrollX",void 0),s([bn(0,!0)],Hl.prototype,"scrollY",void 0),s([kn()],Hl.prototype,"origin",void 0),s([kn()],Hl.prototype,"around",void 0),s([wn(!1)],Hl.prototype,"lazy",void 0),s([Rn(1)],Hl.prototype,"pixelRatio",void 0),s([In(0)],Hl.prototype,"renderSpread",void 0),s([Tn()],Hl.prototype,"path",void 0),s([On()],Hl.prototype,"windingRule",void 0),s([On(!0)],Hl.prototype,"closed",void 0),s([Cn(0)],Hl.prototype,"padding",void 0),s([Cn(!1)],Hl.prototype,"lockRatio",void 0),s([Cn()],Hl.prototype,"widthRange",void 0),s([Cn()],Hl.prototype,"heightRange",void 0),s([wn(!1)],Hl.prototype,"draggable",void 0),s([wn()],Hl.prototype,"dragBounds",void 0),s([wn("auto")],Hl.prototype,"dragBoundsType",void 0),s([wn(!1)],Hl.prototype,"editable",void 0),s([Hn(!0)],Hl.prototype,"hittable",void 0),s([Hn()],Hl.prototype,"hitThrough",void 0),s([Hn("path")],Hl.prototype,"hitFill",void 0),s([An("path")],Hl.prototype,"hitStroke",void 0),s([Hn(!1)],Hl.prototype,"hitBox",void 0),s([Hn(!0)],Hl.prototype,"hitChildren",void 0),s([Hn(!0)],Hl.prototype,"hitSelf",void 0),s([Hn()],Hl.prototype,"hitRadius",void 0),s([Qn("")],Hl.prototype,"cursor",void 0),s([Mn()],Hl.prototype,"fill",void 0),s([An(void 0,!0)],Hl.prototype,"stroke",void 0),s([An("inside")],Hl.prototype,"strokeAlign",void 0),s([An(1,!0)],Hl.prototype,"strokeWidth",void 0),s([An(!1)],Hl.prototype,"strokeScaleFixed",void 0),s([An("none")],Hl.prototype,"strokeCap",void 0),s([An("miter")],Hl.prototype,"strokeJoin",void 0),s([An()],Hl.prototype,"dashPattern",void 0),s([An(0)],Hl.prototype,"dashOffset",void 0),s([An(10)],Hl.prototype,"miterLimit",void 0),s([On(0)],Hl.prototype,"cornerRadius",void 0),s([On()],Hl.prototype,"cornerSmoothing",void 0),s([el()],Hl.prototype,"shadow",void 0),s([el()],Hl.prototype,"innerShadow",void 0),s([el()],Hl.prototype,"blur",void 0),s([el()],Hl.prototype,"backgroundBlur",void 0),s([el()],Hl.prototype,"grayscale",void 0),s([el()],Hl.prototype,"filter",void 0),s([Mn()],Hl.prototype,"placeholderColor",void 0),s([wn(100)],Hl.prototype,"placeholderDelay",void 0),s([wn({})],Hl.prototype,"data",void 0),Hl=ql=s([no(Xl),no(jl),io()],Hl);let Ql=class extends Hl{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:s}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),s.forEach(t=>this.add(t)),t.children=s}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);if(!this.childlessJSON){const s=e.children=[];this.children.forEach(e=>e.skipJSON||s.push(e.toJSON(t)))}return e}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}};var Jl;s([Jn(Bl)],Ql.prototype,"__",void 0),s([Cn(0)],Ql.prototype,"width",void 0),s([Cn(0)],Ql.prototype,"height",void 0),Ql=s([no(Eh),oo()],Ql);const $l=ne.get("Leafer");let Zl=Jl=class extends Ql{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&nn.isComplete}get layoutLocked(){return!this.layouter.running}get view(){return this.canvas&&this.canvas.view}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,trackChanges:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),Jl.list.add(this)}init(t,e){if(this.canvas)return;let s;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),s=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,f.assign(i,t));const r=this.canvas=_e.canvas(i);this.__controllers.push(this.renderer=_e.renderer(this,r,i),this.watcher=_e.watcher(this,i),this.layouter=_e.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),e||(this.selector=_e.selector(this),this.interaction=_e.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=_e.hitCanvasManager()),this.canvasManager=new we,s=i.start),this.hittable=i.hittable,this.fill=i.fill,this.canvasManager.add(r),this.__listenEvents(),s&&(this.__startTimer=setTimeout(this.start.bind(this))),Fo.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(ca.RESTART):this.emitLeafer(ca.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(ca.STOP))}unlockLayout(t=!0){this.layouter.start(),t&&this.updateLayout()}lockLayout(t=!0){t&&this.updateLayout(),this.layouter.stop()}resize(t){const e=f.copyAttrs({},t,Ae);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:s}=this;s&&(s.addBlock(t?new Qt(t):this.canvas.bounds),this.viewReady&&(e?s.render():s.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const s=f.copyAttrs({},this.canvas,Ae);e.resize(t),this.updateLazyBounds(),this.__onResize(new aa(t,s))}__onResize(t){this.emitEvent(t),f.copyAttrs(this.__,t,Ae),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new $t(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Ae.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t?(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):"mode"===t&&this.emit(ca.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Ae.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:s,canvas:i}=this,r=f.copyAttrs({},i,Ae);r[t]=s[t]=e,s.width&&s.height?i.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(r)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(ca.BEFORE_READY),this.emitLeafer(ca.READY),this.emitLeafer(ca.AFTER_READY),Fo.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(ca.VIEW_READY),Fo.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:s}=this.config;if(t){let{width:i,height:r,pixelRatio:n}=this;const o="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,o.x+o.width)),s||(r=Math.max(1,o.y+o.height)),this.__doResize({width:i,height:r,pixelRatio:n})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){Fo.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(ca.VIEW_COMPLETED),Fo.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,s){e&&(t=t.bind(e));const i=this.__nextRenderWait;if(s){for(let e=0;e<i.length;e++)if(i[e]===t){i.splice(e,1);break}}else i.push(t);this.requestRender()}zoom(t,e,s,i){return ue.need("view")}getValidMove(t,e,s){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:s}=this.clientBounds;return{x:e+t.x,y:s+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new ca(t,this))}__listenEvents(){const t=le.start("FirstCreate "+this.innerName);this.once([[ca.START,()=>le.end(t)],[la.START,this.updateLazyBounds,this],[da.START,this.__onCreated,this],[da.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[ha.DATA,this.__onWatchData,this],[la.END,this.__onLayoutEnd,this],[da.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){Jl.list.remove(this);try{this.stop(),this.emitLeafer(ca.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{an.clearRecycled()},100)}catch(t){$l.error(t)}}};t?e():setTimeout(e)}};Zl.list=new Ah,s([Jn(Rl)],Zl.prototype,"__",void 0),s([Cn()],Zl.prototype,"pixelRatio",void 0),s([wn("normal")],Zl.prototype,"mode",void 0),Zl=Jl=s([oo()],Zl);let Kl=class extends Hl{get __tag(){return"Rect"}};s([Jn(Ol)],Kl.prototype,"__",void 0),Kl=s([no(Gl),io(),oo()],Kl);const{add:td,includes:ed,scroll:sd}=Vt,id=Kl.prototype,rd=Ql.prototype;let nd=class extends Ql{get __tag(){return"Box"}get isBranchLeaf(){return!0}get __useSelfBox(){return this.pathInputed}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.__useSelfBox){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const s=this.__,i=this.__layout,{renderBounds:r,boxBounds:n}=i,{overflow:o}=s,a=i.childrenRenderBounds||(i.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=o&&o.includes("scroll"))&&(td(a,n),sd(a,s)),this.__updateRectRenderBounds(),t=!ed(n,a),t&&"show"===o&&td(r,a)}else this.__updateRectRenderBounds();f.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};s([Jn(Cl)],nd.prototype,"__",void 0),s([Cn(100)],nd.prototype,"width",void 0),s([Cn(100)],nd.prototype,"height",void 0),s([wn(!1)],nd.prototype,"resizeChildren",void 0),s([In("show")],nd.prototype,"overflow",void 0),s([so(id.__updateStrokeSpread)],nd.prototype,"__updateStrokeSpread",null),s([so(id.__updateRenderSpread)],nd.prototype,"__updateRectRenderSpread",null),s([so(id.__updateBoxBounds)],nd.prototype,"__updateRectBoxBounds",null),s([so(id.__updateStrokeBounds)],nd.prototype,"__updateStrokeBounds",null),s([so(id.__updateRenderBounds)],nd.prototype,"__updateRectRenderBounds",null),s([so(id.__updateChange)],nd.prototype,"__updateRectChange",null),s([so(id.__render)],nd.prototype,"__renderRect",null),s([so(rd.__render)],nd.prototype,"__renderGroup",null),nd=s([io(),oo()],nd);let od=class extends nd{get __tag(){return"Frame"}get isFrame(){return!0}};s([Jn(Pl)],od.prototype,"__",void 0),s([Mn("#FFFFFF")],od.prototype,"fill",void 0),s([In("hide")],od.prototype,"overflow",void 0),od=s([oo()],od);const{moveTo:ad,closePath:hd,ellipse:ld}=Pi,{tempPoint:dd,set:cd,rotate:ud}=dt,{abs:_d}=Math,pd={};let gd=class extends Hl{get __tag(){return"Ellipse"}__updatePath(){const t=this.__,{width:e,height:s,innerRadius:i,startAngle:r,endAngle:n,closed:o}=t,a=e/2,h=s/2,l=t.path=[];let d,c,u;if((r||n)&&(c=!0),c&&(u=360===_d(n-r)),i){const t=i<1||o,e=a*i,s=h*i;c?(ld(l,a,h,a,h,0,r,n),t?(u&&(hd(l),cd(dd,a+e,h),cd(pd,a,h),ud(dd,n,pd,a,h),ad(l,dd.x,dd.y)),ld(l,a,h,e,s,0,n,r,!0)):u||(d=!0)):(ld(l,a,h,a,h),t&&(hd(l),ad(l,a+e,h),ld(l,a,h,e,s,0,360,0,!0)))}else c?(u||(o||(d=!0),d||ad(l,a,h)),ld(l,a,h,a,h,0,r,n)):ld(l,a,h,a,h);d||hd(l),(se.ellipseToCurve||t.__useArrow||t.cornerRadius)&&(t.path=this.getPath(!0))}};s([Jn(Ll)],gd.prototype,"__",void 0),s([On(0)],gd.prototype,"innerRadius",void 0),s([On(0)],gd.prototype,"startAngle",void 0),s([On(0)],gd.prototype,"endAngle",void 0),gd=s([oo()],gd);const{sin:fd,cos:yd,PI:md}=Math,{moveTo:xd,lineTo:wd,closePath:vd,drawPoints:bd}=Pi;let kd=class extends Hl{get __tag(){return"Polygon"}get isPointsMode(){return this.points&&!this.pathInputed}__updatePath(){const t=this.__,e=t.path=[];if(t.points)bd(e,t.points,t.curve,t.closed,t);else{const{width:s,height:i,sides:r,startAngle:n}=t,o=s/2,a=i/2;let h,l=0;n?(l=n*z,xd(e,o+o*fd(l),a-a*yd(l))):xd(e,o,0);for(let t=1;t<r;t++)h=2*t*md/r+l,wd(e,o+o*fd(h),a-a*yd(h));vd(e)}}};s([Jn(El)],kd.prototype,"__",void 0),s([On(3)],kd.prototype,"sides",void 0),s([On(0)],kd.prototype,"startAngle",void 0),s([On()],kd.prototype,"points",void 0),s([On(0)],kd.prototype,"curve",void 0),kd=s([io(),oo()],kd);const{sin:Sd,cos:Bd,PI:Cd}=Math,{moveTo:Rd,lineTo:Pd,closePath:Td}=Pi;let Od=class extends Hl{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:s,innerRadius:i,startAngle:r}=this.__,n=t/2,o=e/2,a=this.__.path=[];let h,l=0;r?(l=r*z,Rd(a,n+n*Sd(l),o-o*Bd(l))):Rd(a,n,0);for(let t=1;t<2*s;t++)h=t*Cd/s+l,Pd(a,n+(t%2==0?n:n*i)*Sd(h),o-(t%2==0?o:o*i)*Bd(h));Td(a)}};s([Jn(Al)],Od.prototype,"__",void 0),s([On(5)],Od.prototype,"corners",void 0),s([On(.382)],Od.prototype,"innerRadius",void 0),s([On(0)],Od.prototype,"startAngle",void 0),Od=s([oo()],Od);const{moveTo:Ld,lineTo:Ed,drawPoints:Ad}=Pi,{rotate:Id,getAngle:Md,getDistance:Wd,defaultPoint:Dd}=dt;let Fd=class extends Hl{get __tag(){return"Line"}get isPointsMode(){return this.points&&!this.pathInputed}get toPoint(){const{width:t,rotation:e}=this.__,s={x:0,y:0};return t&&(s.x=t),e&&Id(s,e),s}set toPoint(t){this.width=Wd(Dd,t),this.rotation=Md(Dd,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?Ad(e,t.points,t.curve,t.closed,t):(Ld(e,0,0),Ed(e,this.width,0))}};s([Jn(Tl)],Fd.prototype,"__",void 0),s([Ln("center")],Fd.prototype,"strokeAlign",void 0),s([Cn(0)],Fd.prototype,"height",void 0),s([On()],Fd.prototype,"points",void 0),s([On(0)],Fd.prototype,"curve",void 0),s([On(!1)],Fd.prototype,"closed",void 0),Fd=s([oo()],Fd);let zd=class extends Kl{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return u(t)&&t[0].image}};s([Jn(Fl)],zd.prototype,"__",void 0),s([Cn("")],zd.prototype,"url",void 0),zd=s([oo()],zd);const Nd=zd;let Yd=class extends Kl{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=_e.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new cn({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new ta(ta.LOADED,{image:t}))})}draw(t,e,s,i){const r=new mt(t.worldTransform).invert(),n=new mt;e&&n.translate(e.x,e.y),s&&(l(s)?n.scale(s):n.scale(s.x,s.y)),i&&n.rotate(i),r.multiplyParent(n),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:s,height:i}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,s,i)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:s}=this.__;t.resize(this.__,s),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};s([Jn(zl)],Yd.prototype,"__",void 0),s([sl(100)],Yd.prototype,"width",void 0),s([sl(100)],Yd.prototype,"height",void 0),s([sl(1)],Yd.prototype,"pixelRatio",void 0),s([sl(!0)],Yd.prototype,"smooth",void 0),s([wn(!1)],Yd.prototype,"safeResize",void 0),s([sl()],Yd.prototype,"contextSettings",void 0),Yd=s([oo()],Yd);const{copyAndSpread:Xd,includes:Ud,setList:jd}=Vt,{stintSet:Vd}=f;let Gd=class extends Hl{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:s,wordSpacing:i,fontFamily:r,fontSize:n,fontWeight:o,italic:a,textCase:h,textOverflow:l,padding:d,width:c,height:u}=t;t.__lineHeight=al.number(e,n),t.__letterSpacing=al.number(s,n),t.__wordSpacing=al.number(i,n),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*n)/2,t.__font=`${a?"italic ":""}${"small-caps"===h?"small-caps ":""}${"normal"!==o?o+" ":""}${n||12}px ${r||"caption"}`,Vd(t,"__padding",d&&D.fourNumber(d)),Vd(t,"__clipText","show"!==l&&!t.__autoSize),Vd(t,"__isCharMode",c||u||t.__letterSpacing||t.__wordSpacing||t.motionText||"none"!==h),t.__textDrawData=nl.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:s,italic:i,padding:r,__autoWidth:n,__autoHeight:o}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<s&&(e.renderChanged=!0),n||o){if(h.x=n?a.x:0,h.y=o?a.y:0,h.width=n?a.width:t.width,h.height=o?a.height:t.height,r){const[e,s,i,r]=t.__padding;n&&(h.x-=r,h.width+=s+r),o&&(h.y-=e,h.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(h.width+=.16*s),f.stintSet(this,"isOverflow",!Ud(h,a)&&!t.motionText),this.isOverflow?(jd(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__updateRenderSpread(){let t=super.__updateRenderSpread();t||(t=this.isOverflow?1:0);const{__lineHeight:e,fontSize:s}=this.__;return e<s&&(t=C.max(t,(s-e)/2)),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;Xd(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__updateChange(){super.__updateChange();const t=this.__box;t&&(t.__onUpdateSize(),t.__updateChange())}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,s){const i=this.__box;i&&(i.__nowWorld=this.__nowWorld,i.__draw(t,e,s)),this.textEditing&&!e.exporting||super.__draw(t,e,s)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};s([Jn(Dl)],Gd.prototype,"__",void 0),s([Cn(0)],Gd.prototype,"width",void 0),s([Cn(0)],Gd.prototype,"height",void 0),s([Mn()],Gd.prototype,"boxStyle",void 0),s([wn(!1)],Gd.prototype,"resizeFontSize",void 0),s([Mn("#000000")],Gd.prototype,"fill",void 0),s([Ln("outside")],Gd.prototype,"strokeAlign",void 0),s([Hn("all")],Gd.prototype,"hitFill",void 0),s([Cn("")],Gd.prototype,"text",void 0),s([Cn("")],Gd.prototype,"placeholder",void 0),s([Cn("caption")],Gd.prototype,"fontFamily",void 0),s([Cn(12)],Gd.prototype,"fontSize",void 0),s([Cn("normal")],Gd.prototype,"fontWeight",void 0),s([Cn(!1)],Gd.prototype,"italic",void 0),s([Cn("none")],Gd.prototype,"textCase",void 0),s([Cn("none")],Gd.prototype,"textDecoration",void 0),s([Cn(0)],Gd.prototype,"letterSpacing",void 0),s([Cn(0)],Gd.prototype,"wordSpacing",void 0),s([Cn({type:"percent",value:1.5})],Gd.prototype,"lineHeight",void 0),s([Cn(0)],Gd.prototype,"paraIndent",void 0),s([Cn(0)],Gd.prototype,"paraSpacing",void 0),s([Cn("x")],Gd.prototype,"writingMode",void 0),s([Cn("left")],Gd.prototype,"textAlign",void 0),s([Cn("top")],Gd.prototype,"verticalAlign",void 0),s([Cn(!0)],Gd.prototype,"autoSizeAlign",void 0),s([Cn("normal")],Gd.prototype,"textWrap",void 0),s([Cn("show")],Gd.prototype,"textOverflow",void 0),s([Mn(!1)],Gd.prototype,"textEditing",void 0),Gd=s([oo()],Gd);let qd=class extends Hl{get __tag(){return"Path"}};s([Jn(Il)],qd.prototype,"__",void 0),s([Ln("center")],qd.prototype,"strokeAlign",void 0),qd=s([oo()],qd);let Hd=class extends Ql{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new qd(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}paint(){const{pathElement:t}=this;t.__layout.boxChanged||t.forceUpdate("path")}};function Qd(t,e,s,i){t.__.__font?ll.fillText(t,e,s,i):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function Jd(t,e,s,i,r){const n=s.__;_(t)?ll.drawStrokesStyle(t,e,!1,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),i.stroke()),n.__useArrow&&ll.strokeArrow(t,s,i,r)}function $d(t,e,s,i,r){const n=s.__;_(t)?ll.drawStrokesStyle(t,e,!0,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),ll.drawTextStroke(s,i,r))}function Zd(t,e,s,i,r){const n=i.getSameCanvas(!0,!0);n.font=s.__.__font,$d(t,2,s,n,r),n.blendMode="outside"===e?"destination-out":"destination-in",ll.fillText(s,n,r),n.blendMode="normal",wo.copyCanvasByWorld(s,i,n),n.recycle(s.__nowWorld)}s([Jn(Ml)],Hd.prototype,"__",void 0),s([(t,e)=>{pn(t,e,{get(){return this.__path}})}],Hd.prototype,"path",void 0),Hd=s([no(qi,["set","path","paint"]),oo()],Hd);const{getSpread:Kd,copyAndSpread:tc,toOuterOf:ec,getOuterOf:sc,getByMove:ic,move:rc,getIntersectData:nc}=Vt,oc={};let ac;const{stintSet:hc}=f,{hasTransparent:lc}=ol;function dc(t,e,s){if(!_(e)||!1===e.visible||0===e.opacity)return;let i;const{boxBounds:r}=s.__layout,{type:o}=e;switch(o){case"image":case"film":case"video":if(!e.url)return;i=dl.image(s,t,e,r,!ac||!ac[e.url]),"image"!==o&&dl[o](i);break;case"linear":i=cl.linearGradient(e,r);break;case"radial":i=cl.radialGradient(e,r);break;case"angular":i=cl.conicGradient(e,r);break;case"solid":const{color:a,opacity:h}=e;i={type:o,style:ol.string(a,h)};break;default:n(e.r)||(i={type:"solid",style:ol.string(e)})}if(i&&(i.originPaint=e,a(i.style)&&lc(i.style)&&(i.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;i.strokeStyle=e.style}return i}const cc={compute:function(t,e){const s=e.__,i=[];let r,n,o,a=s.__input[t];u(a)||(a=[a]),ac=dl.recycleImage(t,s);for(let s,r=0,n=a.length;r<n;r++)(s=dc(t,a[r],e))&&(i.push(s),s.strokeStyle&&(o||(o=1),s.strokeStyle.strokeWidth&&(o=Math.max(o,s.strokeStyle.strokeWidth))));i.length?(s["_"+t]=i,i.every(t=>t.isTransparent)&&(i.some(t=>t.image)&&(r=!0),n=!0),"fill"===t?(hc(s,"__isAlphaPixelFill",r),hc(s,"__isTransparentFill",n)):(hc(s,"__isAlphaPixelStroke",r),hc(s,"__isTransparentStroke",n),hc(s,"__hasMultiStrokeStyle",o))):(s.__removePaint(t,!1),s["_"+t]="")},fill:function(t,e,s,i){s.fillStyle=t,Qd(e,s,i)},fills:function(t,e,s,i){let r,n,o;for(let a=0,h=t.length;a<h;a++){if(r=t[a],n=r.originPaint,r.image){if(o?o++:o=1,dl.checkImage(r,!e.__.__font,e,s,i))continue;if(!r.style){1===o&&r.image.isPlacehold&&e.drawImagePlaceholder(r,s,i);continue}}if(s.fillStyle=r.style,r.transform||n.scaleFixed){if(s.save(),r.transform&&s.transform(r.transform),n.scaleFixed){const{scaleX:t,scaleY:i}=e.getRenderScaleData(!0,n.scaleFixed,!1);1!==t&&s.scale(t,i)}n.blendMode&&(s.blendMode=n.blendMode),Qd(e,s,i,!0),s.restore()}else n.blendMode?(s.saveBlendMode(n.blendMode),Qd(e,s,i),s.restoreBlendMode()):Qd(e,s,i)}},fillPathOrText:Qd,fillText:function(t,e,s,i){const r=t.__;let n;if(r.__isPlacehold&&r.placeholderColor&&(e.fillStyle=r.placeholderColor),i&&(n=e,(e=e.getSameCanvas(!0,!0)).font=t.__.__font,e.fillStyle="#000"),t.motionText)ll.fillMotionText(t,e,s);else{let t;const{rows:s,decorationY:i}=r.__textDrawData;for(let i=0,r=s.length;i<r;i++)t=s[i],t.text?e.fillText(t.text,t.x,t.y):t.data&&t.data.forEach(s=>{e.fillText(s.char,s.x,t.y)});if(i){const{decorationColor:t,decorationHeight:n}=r.__textDrawData;t&&(e.fillStyle=t),s.forEach(t=>i.forEach(s=>e.fillRect(t.x,t.y+s,t.width,n)))}}i&&(e.beginPath(),t.__drawPathByBox(e,"render"),e.fillStyle=n.fillStyle,e.setTransform(n.getTransform()),e.blendMode="source-in",e.fill(),n.copyWorldByReset(e,t.__nowWorld),e.recycle(t.__nowWorld))},stroke:function(t,e,s,i){const r=e.__;if(r.__strokeWidth)if(r.__font)ll.strokeText(t,e,s,i);else if(r.__pathForStroke)ll.fillStroke(t,e,s,i);else switch(r.strokeAlign){case"center":Jd(t,1,e,s,i);break;case"inside":!function(t,e,s,i){s.save(),s.clipUI(e),Jd(t,2,e,s,i),s.restore()}(t,e,s,i);break;case"outside":!function(t,e,s,i){const r=e.__;if(r.__fillAfterStroke)Jd(t,2,e,s,i);else{const{renderBounds:n}=e.__layout,o=s.getSameCanvas(!0,!0);e.__drawRenderPath(o),Jd(t,2,e,o,i),o.clipUI(r),o.clearWorld(n),wo.copyCanvasByWorld(e,s,o),o.recycle(e.__nowWorld)}}(t,e,s,i)}},strokes:function(t,e,s,i){ll.stroke(t,e,s,i)},strokeText:function(t,e,s,i){switch(e.__.strokeAlign){case"center":$d(t,1,e,s,i);break;case"inside":Zd(t,"inside",e,s,i);break;case"outside":e.__.__fillAfterStroke?$d(t,2,e,s,i):Zd(t,"outside",e,s,i)}},drawTextStroke:function(t,e,s){let i,r=t.__.__textDrawData;const{rows:n,decorationY:o}=r;for(let t=0,s=n.length;t<s;t++)i=n[t],i.text?e.strokeText(i.text,i.x,i.y):i.data&&i.data.forEach(t=>{e.strokeText(t.char,t.x,i.y)});if(o){const{decorationHeight:t}=r;n.forEach(s=>o.forEach(i=>e.strokeRect(s.x,s.y+i,s.width,t)))}},drawStrokesStyle:function(t,e,s,i,r,n){let o;const a=i.__,{__hasMultiStrokeStyle:h}=a;h||r.setStroke(void 0,a.__strokeWidth*e,a);for(let l=0,d=t.length;l<d;l++)if(o=t[l],(!o.image||!dl.checkImage(o,!1,i,r,n))&&o.style){if(h){const{strokeStyle:t}=o;t?r.setStroke(o.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(o.style,a.__strokeWidth*e,a)}else r.strokeStyle=o.style;o.originPaint.blendMode?(r.saveBlendMode(o.originPaint.blendMode),s?ll.drawTextStroke(i,r,n):r.stroke(),r.restoreBlendMode()):s?ll.drawTextStroke(i,r,n):r.stroke()}},shape:function(t,e,s){const i=e.getSameCanvas(),r=e.bounds,n=t.__nowWorld,o=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,d,c,u,_;ec(o.strokeSpread?(tc(oc,o.boxBounds,o.strokeSpread),oc):o.boxBounds,n,a);let{scaleX:p,scaleY:g}=t.getRenderScaleData(!0);if(r.includes(a))_=i,h=u=a,l=n;else{let i;if(se.fullImageShadow)i=a;else{const t=o.renderShapeSpread?Kd(r,C.swapAndScale(o.renderShapeSpread,p,g)):r;i=nc(t,a)}c=r.getFitMatrix(i);let{a:f,d:y}=c;c.a<1&&(_=e.getSameCanvas(),t.__renderShape(_,s),p*=f,g*=y),u=sc(a,c),h=ic(u,-c.e,-c.f),l=sc(n,c),rc(l,-c.e,-c.f);const m=s.matrix;m?(d=new mt(c),d.multiply(m),f*=m.scaleX,y*=m.scaleY):d=c,d.withScale(f,y),s=Object.assign(Object.assign({},s),{matrix:d})}return t.__renderShape(i,s),{canvas:i,matrix:d,fitMatrix:c,bounds:h,renderBounds:l,worldCanvas:_,shapeBounds:u,scaleX:p,scaleY:g}}};let uc,_c=new Qt;const{isSame:pc}=Vt;function gc(t,e,s,i,r,n){let o=!0;const a=t.__;if("fill"!==e||a.__naturalWidth||(a.__naturalWidth=i.width/a.pixelRatio,a.__naturalHeight=i.height/a.pixelRatio,a.__autoSide&&(t.forceUpdate(),wo.updateBounds(t,!0),t.__layout.boundsChanged=!0,t.__proxyData&&(t.setProxyAttr("width",a.width),t.setProxyAttr("height",a.height)),o=!1)),"brush"===s.mode&&dl.brush(t,e,r),!r.data){dl.createData(r,i,s,n);const{transform:t}=r.data,{opacity:e}=s,o=(t&&!t.onlyScale||a.path||a.cornerRadius)&&!r.brush;(o||e&&e<1||s.blendMode)&&(r.complex=!o||2)}return s.filter&&dl.applyFilter(r,i,s.filter,t),o}function fc(t,e){xc(t,ta.LOAD,e)}function yc(t,e){xc(t,ta.LOADED,e)}function mc(t,e,s){e.error=s,t.forceUpdate("surface"),xc(t,ta.ERROR,e)}function xc(t,e,s){t.hasEvent(e)&&t.emitEvent(new ta(e,s))}function wc(t,e){const{leafer:s}=t;s&&s.viewReady&&(s.renderer.ignore=e)}const{get:vc,translate:bc}=Z,kc=new Qt,Sc={},Bc={};function Cc(t,e,s,i){const r=a(t)||i?(i?s-i*e:s%e)/((i||Math.floor(s/e))-1):t;return"auto"===t&&r<0?0:r}let Rc={},Pc={a:1,b:0,c:0,d:1,e:0,f:0};const{get:Tc,set:Oc,rotateOfOuter:Lc,translate:Ec,scaleOfOuter:Ac,multiplyParent:Ic,scale:Mc,rotate:Wc,skew:Dc}=Z;function Fc(t,e,s,i,r,n,o,a){o&&Wc(t,o),a&&Dc(t,a.x,a.y),r&&Mc(t,r,n),Ec(t,e.x+s,e.y+i)}const{get:zc,scale:Nc,copy:Yc}=Z,{getFloorScale:Xc}=D,{abs:Uc}=Math;const jc={image:function(t,e,s,i,r){let n,o;const a=an.get(s,s.type);return uc&&s===uc.paint&&pc(i,uc.boxBounds)?n=uc.leafPaint:(n={type:s.type,image:a},a.hasAlphaPixel&&(n.isTransparent=!0),uc=a.use>1?{leafPaint:n,paint:s,boxBounds:_c.set(i)}:null),(r||a.loading)&&(o={image:a,attrName:e,attrValue:s}),a.ready?(gc(t,e,s,a,n,i),r&&(fc(t,o),yc(t,o))):a.error?r&&mc(t,o,a.error):(r&&(wc(t,!0),fc(t,o)),n.loadId=a.load(()=>{wc(t,!1),t.destroyed||(gc(t,e,s,a,n,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),yc(t,o)),n.loadId=void 0},e=>{wc(t,!1),mc(t,o,e),n.loadId=void 0},s.lod&&a.getThumbSize(s.lod)),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),n},checkImage:function(t,e,s,i,r){const{scaleX:n,scaleY:o}=dl.getImageRenderScaleData(t,s,i,r),a=t.film?t.nowIndex:n+"-"+o,{image:h,brush:l,data:d,originPaint:c}=t,{exporting:u,snapshot:_}=r;if(!d||t.patternId===a&&!u||_){if(!l||!t.style)return!1}else if(e&&(d.repeat?e=!1:c.changeful||t.film||"miniapp"===se.name||u||(e=se.image.isLarge(h,n,o)||h.width*n>8096||h.height*o>8096)),e)s.__.__isFastShadow&&(i.fillStyle=t.style||"#000",i.fill());else if(!t.style||c.sync||u?dl.createPattern(t,s,i,r):dl.createPatternTask(t,s,i,r),!l||!t.style)return!1;return dl.drawImage(t,n,o,s,i,r),!0},drawImage:function(t,e,s,i,r,n){const{data:o,image:a,brush:h,complex:l}=t;let{width:d,height:c}=a,u=h||a;if(l){const{blendMode:n,opacity:a}=t.originPaint,{transform:h}=o;r.save(),2===l&&r.clipUI(i),n&&(r.blendMode=n),a&&(r.opacity*=a),h&&r.transform(h),u.render(r,0,0,d,c,i,t,e,s),r.restore()}else o.scaleX&&(d*=o.scaleX,c*=o.scaleY),u.render(r,0,0,d,c,i,t,e,s)},getImageRenderScaleData:function(t,e,s,i){const r=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:n}=t;if(t.brush&&dl.addBrushScale(r,t,e),s){const{pixelRatio:t}=s;r.scaleX*=t,r.scaleY*=t}return n&&n.scaleX&&(r.scaleX*=Math.abs(n.scaleX),r.scaleY*=Math.abs(n.scaleY)),r},recycleImage:function(t,e){const s=e["_"+t];if(u(s)){let i,r,n,o,a;const h=e.__leaf;for(let l=0,d=s.length;l<d;l++)i=s[l],r=i.image,a=r&&r.url,a&&(n||(n={}),n[a]=!0,an.recyclePaint(i),i.brush&&dl.recycleBrush(i,h),e.__willDestroy&&r.parent&&dl.recycleFilter(r,h),r.loading&&(o||(o=e.__input&&e.__input[t]||[],u(o)||(o=[o])),r.unload(s[l].loadId,!o.some(t=>t.url===a))));return n}return null},createPatternTask:function(t,e,s,r){t.patternTask||(t.patternTask=an.patternTasker.add(()=>i(this,void 0,void 0,function*(){dl.createPattern(t,e,s,r),e.forceUpdate("surface")}),0,()=>(t.patternTask=null,s.bounds.hit(e.__nowWorld))))},createPattern:function(t,e,s,i){let{scaleX:r,scaleY:n}=dl.getImageRenderScaleData(t,e,s,i),o=t.film?t.nowIndex:r+"-"+n;if(t.patternId!==o&&!e.destroyed&&(!se.image.isLarge(t.image,r,n)||t.data.repeat)){const{image:a,brush:h,data:l}=t,{transform:d,gap:c}=l,u=dl.getPatternFixScale(t,r,n);let _,p,g,{width:f,height:y}=a,{opacity:m}=t.originPaint;(h||1===m)&&(m=void 0),u&&(r*=u,n*=u),f*=r,y*=n,c&&!h&&(p=c.x*r/Uc(l.scaleX||1),g=c.y*n/Uc(l.scaleY||1)),(d||1!==r||1!==n)&&(r*=Xc(f+(p||0)),n*=Xc(y+(g||0)),_=zc(),d&&Yc(_,d),Nc(_,1/r,1/n));const x=a.getCanvas(f,y,m,void 0,p,g,e.leafer&&e.leafer.config.smooth,l.interlace);h?(t.style=x,dl.cacheBrush(t,e,s,i)):t.style=a.getPattern(x,l.repeat||se.origin.noRepeat||"no-repeat",_,t),t.patternId=o}},getPatternFixScale:function(t,e,s){const{image:i}=t;let r,n=se.image.maxPatternSize,o=i.width*i.height;return i.isSVG?e>1&&(r=Math.ceil(e)/e):n>o&&(n=o),(o*=e*s)>n&&(r=Math.sqrt(n/o)),r},createData:function(t,e,s,i){t.data=dl.getPatternData(s,i,e)},getPatternData:function(t,e,s){t.padding&&(e=kc.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:i,height:r}=s,{mode:n,align:o,offset:h,scale:d,size:c,rotation:u,skew:p,clipSize:g,repeat:f,gap:y,interlace:m}=t,x=e.width===i&&e.height===r,w={mode:n},v="center"!==o&&(u||0)%180==90;let b,k;switch(Vt.set(Bc,0,0,v?r:i,v?i:r),n&&"cover"!==n&&"fit"!==n?((d||c)&&(D.getScaleData(d,c,s,Sc),b=Sc.scaleX,k=Sc.scaleY),(o||y||f)&&(b&&Vt.scale(Bc,b,k,!0),o&&Pt.toPoint(o,Bc,e,Bc,!0,!0))):x&&!u||(b=k=Vt.getFitScale(e,Bc,"fit"!==n),Vt.put(e,s,o,b,!1,Bc),Vt.scale(Bc,b,k,!0)),h&&dt.move(Bc,h),n){case"stretch":x?b&&(b=k=void 0):(b=e.width/i,k=e.height/r,dl.stretchMode(w,e,b,k));break;case"normal":case"clip":if(Bc.x||Bc.y||b||g||u||p){let t,s;g&&(t=e.width/g.width,s=e.height/g.height),dl.clipMode(w,e,Bc.x,Bc.y,b,k,u,p,t,s),t&&(b=b?b*t:t,k=k?k*s:s)}break;case"repeat":(!x||b||u||p)&&dl.repeatMode(w,e,i,r,Bc.x,Bc.y,b,k,u,p,o,t.freeTransform);case"brush":f||(w.repeat="repeat");const s=_(f);(y||s)&&(w.gap=function(t,e,s,i,r){let n,o;_(t)?(n=t.x,o=t.y):n=o=t;return{x:Cc(n,s,r.width,e&&e.x),y:Cc(o,i,r.height,e&&e.y)}}(y,s&&f,Bc.width,Bc.height,e));break;default:b&&dl.fillOrFitMode(w,e,Bc.x,Bc.y,b,k,u)}return w.transform||"brush"===n||(e.x||e.y)&&bc(w.transform=vc(),e.x,e.y),b&&(w.scaleX=b,w.scaleY=k),f&&(w.repeat=a(f)?"x"===f?"repeat-x":"repeat-y":"repeat"),m&&(w.interlace=l(m)||"percent"===m.type?{type:"x",offset:m}:m),w},stretchMode:function(t,e,s,i){const r=Tc(),{x:n,y:o}=e;n||o?Ec(r,n,o):s>0&&i>0&&(r.onlyScale=!0),Mc(r,s,i),t.transform=r},fillOrFitMode:function(t,e,s,i,r,n,o){const a=Tc();Ec(a,e.x+s,e.y+i),Mc(a,r,n),o&&Lc(a,{x:e.x+e.width/2,y:e.y+e.height/2},o),t.transform=a},clipMode:function(t,e,s,i,r,n,o,a,h,l){const d=Tc();Fc(d,e,s,i,r,n,o,a),h&&(o||a?(Oc(Pc),Ac(Pc,e,h,l),Ic(d,Pc)):Ac(d,e,h,l)),t.transform=d},repeatMode:function(t,e,s,i,r,n,o,a,h,l,d,c){const u=Tc();if(c)Fc(u,e,r,n,o,a,h,l);else{if(h)if("center"===d)Lc(u,{x:s/2,y:i/2},h);else switch(Wc(u,h),h){case 90:Ec(u,i,0);break;case 180:Ec(u,s,i);break;case 270:Ec(u,0,s)}Rc.x=e.x+r,Rc.y=e.y+n,Ec(u,Rc.x,Rc.y),o&&Ac(u,Rc,o,a)}t.transform=u}},{toPoint:Vc}=Bt,{hasTransparent:Gc}=ol,qc={},Hc={};function Qc(t,e,s,i){if(s){let r,n,o,h;for(let t=0,l=s.length;t<l;t++)r=s[t],a(r)?(o=t/(l-1),n=ol.string(r,i)):(o=r.offset,n=ol.string(r.color,i)),e.addColorStop(o,n),!h&&Gc(n)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:Jc,getDistance:$c}=dt,{get:Zc,rotateOfOuter:Kc,scaleOfOuter:tu}=Z,{toPoint:eu}=Bt,su={},iu={};function ru(t,e,s,i,r){let n;const{width:o,height:a}=t;if(o!==a||i){const t=Jc(e,s);n=Zc(),r?(tu(n,e,o/a*(i||1),1),Kc(n,e,t+90)):(tu(n,e,1,o/a*(i||1)),Kc(n,e,t))}return n}const{getDistance:nu}=dt,{toPoint:ou}=Bt,au={},hu={};const lu={linearGradient:function(t,e){let{from:s,to:i,type:r,opacity:n}=t;Vc(s||"top",e,qc),Vc(i||"bottom",e,Hc);const o=se.canvas.createLinearGradient(qc.x,qc.y,Hc.x,Hc.y),a={type:r,style:o};return Qc(a,o,t.stops,n),a},radialGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,stretch:o}=t;eu(s||"center",e,su),eu(i||"bottom",e,iu);const a=se.canvas.createRadialGradient(su.x,su.y,0,su.x,su.y,$c(su,iu)),h={type:r,style:a};Qc(h,a,t.stops,n);const l=ru(e,su,iu,o,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,rotation:o,stretch:a}=t;ou(s||"center",e,au),ou(i||"bottom",e,hu);const h=se.conicGradientSupport?se.canvas.createConicGradient(o?o*z:0,au.x,au.y):se.canvas.createRadialGradient(au.x,au.y,0,au.x,au.y,nu(au,hu)),l={type:r,style:h};Qc(l,h,t.stops,n);const d=ru(e,au,hu,a||1,se.conicGradientRotate90);return d&&(l.transform=d),l},getTransform:ru},{copy:du,move:cu,toOffsetOutBounds:uu}=Vt,{max:_u,abs:pu}=Math,gu={},fu=new mt,yu={};function mu(t,e){let s,i,r,n,o=0,a=0,h=0,l=0;return e.forEach(t=>{s=t.x||0,i=t.y||0,n=1.5*(t.blur||0),r=pu(t.spread||0),o=_u(o,r+n-i),a=_u(a,r+n+s),h=_u(h,r+n+i),l=_u(l,r+n-s)}),o===a&&a===h&&h===l?o:[o,a,h,l]}function xu(t,e,s){const{shapeBounds:i}=s;let r,n;se.fullImageShadow?(du(gu,t.bounds),cu(gu,e.x-i.x,e.y-i.y),r=t.bounds,n=gu):(r=i,n=e),t.copyWorld(s.canvas,r,n)}const{toOffsetOutBounds:wu}=Vt,vu={};const bu=mu;const ku={shadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{shadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;uu(h,yu,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.setWorldShadow(yu.offsetX+(o.x||0)*c*f,yu.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f,ol.string(o.color)),r=ul.getShadowTransform(t,_,s,o,yu,f),r&&_.setTransform(r),xu(_,yu,s),r&&_.resetTransform(),i=l,o.box&&(_.restore(),_.save(),a&&(_.copyWorld(_,l,n,"copy"),i=n),a?_.copyWorld(a,n,n,"destination-out"):_.copyWorld(s.canvas,d,h,"destination-out")),wo.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<p&&_.clearWorld(i)}),_.recycle(i)},innerShadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{innerShadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;wu(h,vu,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.save(),_.setWorldShadow(vu.offsetX+(o.x||0)*c*f,vu.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f),r=ul.getShadowTransform(t,_,s,o,vu,f,!0),r&&_.setTransform(r),xu(_,vu,s),_.restore(),a?(_.copyWorld(_,l,n,"copy"),_.copyWorld(a,n,n,"source-out"),i=n):(_.copyWorld(s.canvas,d,h,"source-out"),i=l),_.fillWorld(i,ol.string(o.color),"source-in"),wo.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<p&&_.clearWorld(i)}),_.recycle(i)},blur:function(t,e,s){const{blur:i}=t.__;s.setWorldBlur(i*t.__nowWorld.a),s.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),s.filter="none"},backgroundBlur:function(t,e,s){},getShadowRenderSpread:mu,getShadowTransform:function(t,e,s,i,r,n,o){if(i.spread){const s=2*i.spread*n*(o?-1:1),{width:a,height:h}=t.__layout.strokeBounds;return fu.set().scaleOfOuter({x:(r.x+r.width/2)*e.pixelRatio,y:(r.y+r.height/2)*e.pixelRatio},1+s/a,1+s/h),fu}},isTransformShadow(t){},getInnerShadowSpread:bu},{excludeRenderBounds:Su}=Po;let Bu;function Cu(t,e,s,i,r,n,o,a){switch(e){case"grayscale":Bu||(Bu=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,s,i,r,n){const o=t.__nowWorld;s.resetTransform(),s.opacity=1,s.useMask(i,o),n&&i.recycle(o);Pu(t,e,s,1,r,n)}(t,s,i,r,o,a);break;case"opacity-path":Pu(t,s,i,n,o,a);break;case"path":a&&s.restore()}}function Ru(t){return t.getSameCanvas(!1,!0)}function Pu(t,e,s,i,r,n){const o=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(s,o,void 0,r),n?s.recycle(o):s.clearWorld(o)}Ql.prototype.__renderMask=function(t,e){let s,i,r,n,o,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(s=h[l],a=s.__.mask,a){o&&(Cu(this,o,t,r,i,n,void 0,!0),i=r=null),"clipping"!==a&&"clipping-path"!==a||Su(s,e)||s.__render(t,e),n=s.__.opacity,Bu=!1,"path"===a||"clipping-path"===a?(n<1?(o="opacity-path",r||(r=Ru(t))):(o="path",t.save()),s.__clip(r||t,e)):(o="grayscale"===a?"grayscale":"alpha",i||(i=Ru(t)),r||(r=Ru(t)),s.__render(i,e));continue}const d=1===n&&s.__.__blendMode;d&&Cu(this,o,t,r,i,n,void 0,!1),Su(s,e)||s.__render(r||t,e),d&&Cu(this,o,t,r,i,n,d,!1)}Cu(this,o,t,r,i,n,void 0,!0)};const Tu=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",Ou=Tu+"_#~&*+\\=|≮≯≈≠=…",Lu=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[4352,4607],[12352,12447],[12448,12543],[12544,12591],[12592,12687],[12688,12703],[12704,12735],[12784,12799],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map(([t,e])=>`[\\u{${t.toString(16)}}-\\u{${e.toString(16)}}]`).join("|"),"u");function Eu(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const Au=Eu("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),Iu=Eu("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),Mu=Eu(Tu),Wu=Eu(Ou),Du=Eu("- —/~|┆·");var Fu;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(Fu||(Fu={}));const{Letter:zu,Single:Nu,Before:Yu,After:Xu,Symbol:Uu,Break:ju}=Fu;function Vu(t){return Au[t]?zu:Du[t]?ju:Iu[t]?Yu:Mu[t]?Xu:Wu[t]?Uu:Lu.test(t)?Nu:zu}const Gu={trimRight(t){const{words:e}=t;let s,i=0,r=e.length;for(let n=r-1;n>-1&&(s=e[n].data[0]," "===s.char);n--)i++,t.width-=s.width;i&&e.splice(r-i,i)}};function qu(t,e,s){switch(e){case"title":return s?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:Hu}=Gu,{Letter:Qu,Single:Ju,Before:$u,After:Zu,Symbol:Ku,Break:t_}=Fu;let e_,s_,i_,r_,n_,o_,a_,h_,l_,d_,c_,u_,__,p_,g_,f_,y_,m_=[];function x_(t,e){l_&&!h_&&(h_=l_),e_.data.push({char:t,width:e}),i_+=e}function w_(t){t&&(r_+=t,e_.addWidth=t),r_+=i_,e_.width=i_,s_.words.push(e_),e_={data:[]},i_=0}function v_(){p_&&(g_.paraNumber++,s_.paraStart=!0,p_=!1),l_&&(s_.startCharSize=h_,s_.endCharSize=l_,h_=0),s_.width=r_,f_.width?Hu(s_):y_&&b_(),m_.push(s_),s_={words:[]},r_=0}function b_(){r_>(g_.maxWidth||0)&&(g_.maxWidth=r_)}const{top:k_,right:S_,bottom:B_,left:C_}=bt;function R_(t,e,s){const{bounds:i,rows:r}=t;i[e]+=s;for(let t=0;t<r.length;t++)r[t][e]+=s}const P_={getDrawData:function(t,e){a(t)||(t=String(t));let s=0,i=0,r=e.__getInput("width")||0,n=e.__getInput("height")||0;const{__padding:o}=e;e.motionText&&(r=n=0),o&&(r?(s=o[C_],r-=o[S_]+o[C_],!r&&(r=.01)):e.autoSizeAlign||(s=o[C_]),n?(i=o[k_],n-=o[k_]+o[B_],!n&&(n=.01)):e.autoSizeAlign||(i=o[k_]));const h={bounds:{x:s,y:i,width:r,height:n},rows:[],paraNumber:0,font:se.canvas.font=e.__font};return function(t,e,s){g_=t,m_=t.rows,f_=t.bounds,y_=!f_.width&&!s.autoSizeAlign;const{paraIndent:i,textCase:r}=s,{canvas:n}=se,{width:o}=f_;if(s.__isCharMode){const t="none"!==s.textWrap,a="break"===s.textWrap,h=s.__letterSpacing,l=s.__wordSpacing;p_=!0,c_=null,h_=a_=l_=i_=r_=0,e_={data:[]},s_={words:[]};for(let s=0,d=(e=[...e]).length;s<d;s++)o_=e[s],"\n"===o_?(i_&&w_(),s_.paraEnd=!0,v_(),p_=!0):(d_=Vu(o_),d_===Qu&&"none"!==r&&(o_=qu(o_,r,!i_)),a_=n.measureText(o_).width,h&&(h<0&&(l_=a_),a_+=h),u_=d_===Ju&&(c_===Ju||c_===Qu)||c_===Ju&&d_!==Zu,__=!(d_!==$u&&d_!==Ju||c_!==Ku&&c_!==Zu),n_=p_&&i?o-i:o,t&&o&&r_+i_+a_>n_&&(a?(i_&&w_(),r_&&v_()):(__||(__=d_===Qu&&c_==Zu),u_||__||d_===t_||d_===$u||d_===Ju||i_+a_>n_?(i_&&w_(),r_&&v_()):r_&&v_()))," "===o_&&!0!==p_&&r_+i_===0||(d_===t_?(" "===o_&&i_&&w_(l),x_(o_,a_),w_()):u_||__?(i_&&w_(l),x_(o_,a_)):x_(o_,a_)),c_=d_);i_&&w_(),r_&&v_(),m_.length>0&&(m_[m_.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{g_.paraNumber++,r_=n.measureText(t).width,m_.push({x:i||0,text:t,width:r_,paraStart:!0}),y_&&b_()})}(h,t,e),o&&function(t,e,s,i,r){if(!i&&s.autoSizeAlign)switch(s.textAlign){case"left":R_(e,"x",t[C_]);break;case"right":R_(e,"x",-t[S_])}if(!r&&s.autoSizeAlign)switch(s.verticalAlign){case"top":R_(e,"y",t[k_]);break;case"bottom":R_(e,"y",-t[B_])}}(o,h,e,r,n),function(t,e){const{rows:s,bounds:i}=t,r=s.length,{__lineHeight:n,__baseLine:o,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:g,height:f}=i,y=n*r+(c?c*(t.paraNumber-1):0),m=o;if(h&&y>f)y=Math.max(e.__autoHeight?y:f,n),r>1&&(t.overflow=r);else if(f||u)switch(d){case"middle":p+=(f-y)/2;break;case"bottom":p+=f-y}m+=p;let x,w,v,b=g||u?g:t.maxWidth;for(let o=0,d=r;o<d;o++){if(x=s[o],x.x=_,x.width<g||x.width>g&&!h)switch(l){case"center":x.x+=(b-x.width)/2;break;case"right":x.x+=b-x.width}x.paraStart&&c&&o>0&&(m+=c),x.y=m,m+=n,t.overflow>o&&m>y&&(x.isOverflow=!0,t.overflow=o+1),w=x.x,v=x.width,a<0&&(x.width<0?(v=-x.width+e.fontSize+a,w-=v,v+=e.fontSize):v-=a),w<i.x&&(i.x=w),v>i.width&&(i.width=v),h&&g&&g<v&&(x.isOverflow=!0,t.overflow||(t.overflow=s.length))}i.y=p,i.height=y}(h,e),e.__isCharMode&&function(t,e,s){const{rows:i}=t,{textAlign:r,paraIndent:n}=e,o=e.__letterSpacing||e.motionText,a=e.__wordSpacing,h=s&&r.includes("both"),l=h||s&&r.includes("justify"),d=l&&r.includes("letter");let c,u,_,p,g,f,y,m,x,w;i.forEach(t=>{t.words&&(g=n&&t.paraStart?n:0,m=t.words.length,l&&(w=!t.paraEnd||h,u=s-t.width-g,d?p=u/(t.words.reduce((t,e)=>t+e.data.length,0)-1):_=m>1?u/(m-1):0),f=o||t.isOverflow||d?0:_||a?1:2,t.isOverflow&&!o&&(t.textMode=!0),2===f?(t.x+=g,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=g,c=t.x,t.data=[],t.words.forEach((e,s)=>{1===f?(y={char:"",x:c},c=function(t,e,s){return t.forEach(t=>{s.char+=t.char,e+=t.width}),e}(e.data,c,y),(t.isOverflow||" "!==y.char)&&t.data.push(y)):c=function(t,e,s,i,r){return t.forEach(t=>{(i||" "!==t.char)&&(t.x=e,s.push(t)),e+=t.width,r&&(e+=r)}),e}(e.data,c,t.data,t.isOverflow,w&&p),e.addWidth&&(c+=e.addWidth),w&&(x=s===m-1,_?x||(c+=_,t.width+=_):p&&(t.width+=p*(e.data.length-(x?1:0))))})),t.words=null)})}(h,e,r),h.overflow&&function(t,e,s,i){const{rows:r,overflow:n}=t;let{textOverflow:o}=e;if(n&&r.splice(n),i&&o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const h=o?se.canvas.measureText(o).width:0,l=s+i-h;("none"===e.textWrap?r:[r[n-1]]).forEach(e=>{if(e.isOverflow&&e.data){let s=e.data.length-1;for(let i=s;i>-1&&(t=e.data[i],a=t.x+t.width,!(i===s&&a<l));i--){if(a<l&&" "!==t.char||!i){e.data.splice(i+1),e.width-=t.width;break}e.width-=t.width}e.width+=h,e.data.push({char:o,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(h,e,s,r),"none"!==e.textDecoration&&function(t,e){let s,i=0;const{fontSize:r,textDecoration:n}=e;switch(t.decorationHeight=r/11,_(n)?(s=n.type,n.color&&(t.decorationColor=ol.string(n.color)),n.offset&&(i=Math.min(.3*r,Math.max(n.offset,.15*-r)))):s=n,s){case"under":t.decorationY=[.15*r+i];break;case"delete":t.decorationY=[.35*-r];break;case"under-delete":t.decorationY=[.15*r+i,.35*-r]}}(h,e),h}};const T_={string:function(t,e){if(!t)return"#000";const s=l(e)&&e<1;if(a(t)){if(!s||!ol.object)return t;t=ol.object(t)}let i=n(t.a)?1:t.a;s&&(i*=e);const r=t.r+","+t.g+","+t.b;return 1===i?"rgb("+r+")":"rgba("+r+","+i+")"}};Object.assign(nl,P_),Object.assign(ol,T_),Object.assign(ll,cc),Object.assign(dl,jc),Object.assign(cl,lu),Object.assign(ul,ku),Dh();export{Pt as AlignHelper,e as Answer,Bt as AroundHelper,$t as AutoBounds,ds as BezierHelper,Qt as Bounds,ea as BoundsEvent,Vt as BoundsHelper,nd as Box,Cl as BoxData,Eh as Branch,Eo as BranchHelper,Ja as BranchRender,Yd as Canvas,zl as CanvasData,we as CanvasManager,Jo as ChildEvent,ol as ColorConvert,_e as Creator,f as DataHelper,ne as Debug,bt as Direction4,kt as Direction9,ul as Effect,gd as Ellipse,Ll as EllipseData,xs as EllipseHelper,Qo as Event,me as EventCreator,ma as Eventer,pl as Export,Zr as FileHelper,_l as Filter,C as FourNumberHelper,od as Frame,Pl as FrameData,Ql as Group,Bl as GroupData,zd as Image,Fl as ImageData,ta as ImageEvent,an as ImageManager,x as IncrementId,la as LayoutEvent,Zh as Layouter,Vh as LayouterHelper,bh as Leaf,Ga as LeafBounds,Po as LeafBoundsHelper,m as LeafData,La as LeafDataProxy,Ta as LeafEventer,wo as LeafHelper,Ho as LeafLayout,Ih as LeafLevelList,Ah as LeafList,Fa as LeafMatrix,qa as LeafRender,Zl as Leafer,Wh as LeaferCanvas,Ie as LeaferCanvasBase,Rl as LeaferData,ca as LeaferEvent,un as LeaferFilm,cn as LeaferImage,_n as LeaferVideo,Fd as Line,Tl as LineData,D as MathHelper,mt as Matrix,Z as MatrixHelper,Nd as MyImage,ze as NeedConvertToCanvasCommandMap,z as OneRadian,N as PI2,Y as PI_2,ll as Paint,cl as PaintGradient,dl as PaintImage,qd as Path,hl as PathArrow,Nr as PathBounds,Pi as PathCommandDataHelper,De as PathCommandMap,ws as PathCommandNodeHelper,ri as PathConvert,qr as PathCorner,qi as PathCreator,Il as PathData,hr as PathDrawer,Me as PathHelper,t as PathNodeHandleType,Ue as PathNumberCommandLengthMap,Xe as PathNumberCommandMap,Hd as Pen,Ml as PenData,se as Platform,ue as Plugin,ft as Point,dt as PointHelper,kd as Polygon,El as PolygonData,Zo as PropertyEvent,Kl as Rect,Ol as RectData,je as RectHelper,Gl as RectRender,da as RenderEvent,tl as Renderer,aa as ResizeEvent,nn as Resource,le as Run,Od as Star,Al as StarData,gl as State,Kt as StringNumberMap,en as TaskItem,sn as TaskProcessor,Gd as Text,nl as TextConvert,Dl as TextData,fl as Transition,wt as TwoPointBoundsHelper,Hl as UI,Xl as UIBounds,ge as UICreator,kl as UIData,jl as UIRender,al as UnitConvert,Zt as UnitConvertHelper,Fo as WaitHelper,ha as WatchEvent,zh as Watcher,In as affectRenderBoundsType,Ln as affectStrokeBoundsType,mn as attr,kn as autoLayoutType,Cn as boundsType,$r as canvasPatch,Ae as canvasSizeAttrs,rl as createAttr,fn as createDescriptor,Qn as cursorType,Jn as dataProcessor,wn as dataType,yn as decorateLeafAttr,Zn as defineDataProcessor,pn as defineKey,xn as defineLeafAttr,Dn as dimType,Pn as doBoundsType,En as doStrokeType,Wn as doSurfaceType,el as effectType,r as emptyData,qn as eraserType,Ko as extraPropertyEventMap,U as getBoundsData,gn as getDescriptor,j as getMatrixData,X as getPointData,Hn as hitType,u as isArray,p as isData,g as isEmptyData,h as isFinite,o as isNull,l as isNumber,_ as isObject,a as isString,n as isUndefined,$n as layoutProcessor,fa as leaferTransformAttrMap,Vn as maskType,Rn as naturalBoundsType,Fn as opacityType,Hr as path,Tn as pathInputType,On as pathType,Qr as pen,vn as positionType,Ei as registerPointsCurve,oo as registerUI,ao as registerUIEvent,sl as resizeType,so as rewrite,io as rewriteAble,Bn as rotationType,Sn as scaleType,bn as scrollType,Un as sortType,An as strokeType,Mn as surfaceType,Jt as tempBounds,xt as tempMatrix,yt as tempPoint,c as tryToNumber,Dh as useCanvas,no as useModule,Mh as version,zn as visibleType,il as zoomLayerType};
|
|
1
|
+
var t,e;function s(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o}function i(t,e,s,i){return new(s||(s=Promise))(function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}h((i=i.apply(t,e||[])).next())})}!function(t){t[t.none=1]="none",t[t.free=2]="free",t[t.mirrorAngle=3]="mirrorAngle",t[t.mirror=4]="mirror"}(t||(t={})),"function"==typeof SuppressedError&&SuppressedError,function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(e||(e={}));const r={};function n(t){return void 0===t}function o(t){return null==t}function a(t){return"string"==typeof t}const{isFinite:h}=Number;function l(t){return"number"==typeof t}const d=/^-?\d+(?:\.\d+)?$/;function c(t){return"string"==typeof t&&d.test(t)?+t:t}const{isArray:u}=Array;function _(t){return t&&"object"==typeof t}function p(t){return _(t)&&!u(t)}function g(t){return"{}"===JSON.stringify(t)}const f={default:(t,e)=>(y(e,t),y(t,e),t),assign(t,e,s){let i;Object.keys(e).forEach(r=>{var n,o;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(n=t[r])||void 0===n?void 0:n.constructor)===Object)return y(t[r],e[r],s&&s[r]);s&&r in s?(null===(o=s[r])||void 0===o?void 0:o.constructor)===Object&&y(t[r]={},e[r],s[r]):t[r]=e[r]})},copyAttrs:(t,e,s)=>(s.forEach(s=>{n(e[s])||(t[s]=e[s])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,i=t.length;s<i;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:y}=f;class m{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __usePathBox(){return this.__pathInputed}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(!n(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let s;for(let i in this)"_"!==i[0]&&(s=e?e[i]:void 0,t[i]=n(s)?this[i]:s);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!n(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!n(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const s={};if(t)if(u(t))for(let e of t)s[e]=this.__getInput(e);else for(let e in t)s[e]=this.__getInput(e);else{let t,e,{__input:i}=this;s.tag=this.__leaf.tag;for(let r in this)if("_"!==r[0]&&(t=this["_"+r],!n(t))){if("path"===r&&!this.__pathInputed)continue;e=i?i[r]:void 0,s[r]=n(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:i,d:r,e:n,f:o}=this.__leaf.__localMatrix;s.matrix={a:t,b:e,c:i,d:r,e:n,f:o}}return s}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null,this.__complexData&&this.__complexData.destroy()}}const x={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CANVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=w;return e[t]?e[t]++:(e[t]=1,0)}},w=x;let v,b,k;const{max:S}=Math,B=[0,0,0,0],C={zero:[...B],tempFour:B,set:(t,e,s,i,r)=>(void 0===s&&(s=i=r=e),t[0]=e,t[1]=s,t[2]=i,t[3]=r,t),setTemp:(t,e,s,i)=>R(B,t,e,s,i),toTempAB(t,e,s){k=s?l(t)?e:t:[],l(t)?(v=T(t),b=e):l(e)?(v=t,b=T(e)):(v=t,b=e),4!==v.length&&(v=P(v)),4!==b.length&&(b=P(b))},get(t,e){let s;if(!l(t))switch(t.length){case 4:s=n(e)?t:[...t];break;case 2:s=[t[0],t[1],t[0],t[1]];break;case 3:s=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(s||(s=[t,t,t,t]),!n(e))for(let t=0;t<4;t++)s[t]>e&&(s[t]=e);return s},max:(t,e,s)=>l(t)&&l(e)?S(t,e):(L(t,e,s),R(k,S(v[0],b[0]),S(v[1],b[1]),S(v[2],b[2]),S(v[3],b[3]))),add:(t,e,s)=>l(t)&&l(e)?t+e:(L(t,e,s),R(k,v[0]+b[0],v[1]+b[1],v[2]+b[2],v[3]+b[3])),swapAndScale(t,e,s,i){if(l(t))return e===s?t*e:[t*s,t*e];const r=i?t:[],[n,o,a,h]=4===t.length?t:P(t);return R(r,a*s,h*e,n*s,o*e)}},{set:R,get:P,setTemp:T,toTempAB:L}=C,{round:O,pow:E,max:A,floor:I,PI:M}=Math,W={},D={within:(t,e,s)=>(_(e)&&(s=e.max,e=e.min),!n(e)&&t<e&&(t=e),!n(s)&&t>s&&(t=s),t),fourNumber:C.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),D.float(t)),getGapRotation(t,e,s=0){let i=t+s;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-s},float(t,e){const s=n(e)?1e12:E(10,e);return-0===(t=O(t*s)/s)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,s,i){if(i||(i={}),e){const t=(l(e)?e:e.width||0)/s.width,r=(l(e)?e:e.height||0)/s.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&D.assignScale(i,t);return i},getScaleFixedData(t,e,s,i,r){let{scaleX:n,scaleY:o}=t;if((i||e)&&(n<0&&(n=-n),o<0&&(o=-o)),e)if(!0===e)n=o=s?1:1/n;else{let t;l(e)?t=e:"zoom-in"===e&&(t=1),t&&(n=o=n>t||o>t?s?1:1/n:s?1:1/t)}return W.scaleX=n,W.scaleY=o,W},assignScale(t,e){l(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>A(I(t),e)/t,randInt:F,randColor:t=>`rgba(${F(255)},${F(255)},${F(255)},${t||1})`};function F(t){return Math.round(Math.random()*t)}const z=M/180,N=2*M,Y=M/2;function X(){return{x:0,y:0}}function U(){return{x:0,y:0,width:0,height:0}}function j(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:V,cos:G,acos:q,sqrt:H}=Math,{float:Q}=D,J={};function $(){return Object.assign(Object.assign(Object.assign({},{a:1,b:0,c:0,d:1,e:0,f:0}),{x:0,y:0,width:0,height:0}),{scaleX:1,scaleY:1,rotation:0,skewX:0,skewY:0})}const Z={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:$(),tempMatrix:{},set(t,e=1,s=0,i=0,r=1,n=0,o=0){t.a=e,t.b=s,t.c=i,t.d=r,t.e=n,t.f=o},get:j,getWorld:$,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,s){t.e+=e,t.f+=s},translateInner(t,e,s,i){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,i&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},pixelScale(t,e,s){s||(s=t),s.a=t.a*e,s.b=t.b*e,s.c=t.c*e,s.d=t.d*e,s.e=t.e*e,s.f=t.f*e},scaleOfOuter(t,e,s,i){K.toInnerPoint(t,e,J),K.scaleOfInner(t,J,s,i)},scaleOfInner(t,e,s,i=s){K.translateInner(t,e.x,e.y),K.scale(t,s,i),K.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:i,c:r,d:n}=t,o=G(e*=z),a=V(e);t.a=s*o-i*a,t.b=s*a+i*o,t.c=r*o-n*a,t.d=r*a+n*o},rotateOfOuter(t,e,s){K.toInnerPoint(t,e,J),K.rotateOfInner(t,J,s)},rotateOfInner(t,e,s){K.translateInner(t,e.x,e.y),K.rotate(t,s),K.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:i,b:r,c:n,d:o}=t;s&&(s*=z,t.a=i+n*s,t.b=r+o*s),e&&(e*=z,t.c=n+i*e,t.d=o+r*e)},skewOfOuter(t,e,s,i){K.toInnerPoint(t,e,J),K.skewOfInner(t,J,s,i)},skewOfInner(t,e,s,i=0){K.translateInner(t,e.x,e.y),K.skew(t,s,i),K.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:i,c:r,d:n,e:o,f:a}=t;t.a=e.a*s+e.b*r,t.b=e.a*i+e.b*n,t.c=e.c*s+e.d*r,t.d=e.c*i+e.d*n,t.e=e.e*s+e.f*r+o,t.f=e.e*i+e.f*n+a},multiplyParent(t,e,s,i,r){const{e:o,f:a}=t;if(s||(s=t),n(i)&&(i=1!==t.a||t.b||t.c||1!==t.d),i){const{a:i,b:n,c:o,d:a}=t;s.a=i*e.a+n*e.c,s.b=i*e.b+n*e.d,s.c=o*e.a+a*e.c,s.d=o*e.b+a*e.d,r&&(s.scaleX=e.scaleX*r.scaleX,s.scaleY=e.scaleY*r.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,r&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=o*e.a+a*e.c+e.e,s.f=o*e.b+a*e.d+e.f},divide(t,e){K.multiply(t,K.tempInvert(e))},divideParent(t,e){K.multiplyParent(t,K.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=K;return K.copy(e,t),K.invert(e),e},invert(t){const{a:e,b:s,c:i,d:r,e:n,f:o}=t;if(s||i){const a=1/(e*r-s*i);t.a=r*a,t.b=-s*a,t.c=-i*a,t.d=e*a,t.e=-(n*r-o*i)*a,t.f=-(o*e-n*s)*a}else if(1===e&&1===r)t.e=-n,t.f=-o;else{const s=1/(e*r);t.a=r*s,t.d=e*s,t.e=-n*r*s,t.f=-o*e*s}},toOuterPoint(t,e,s,i){const{x:r,y:n}=e;s||(s=e),s.x=r*t.a+n*t.c,s.y=r*t.b+n*t.d,i||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,i){const{a:r,b:n,c:o,d:a}=t,h=1/(r*a-n*o),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*o)*h,s.y=(d*r-l*n)*h,!i){const{e:e,f:i}=t;s.x-=(e*a-i*o)*h,s.y-=(i*r-e*n)*h}},setLayout(t,e,s,i,r){const{x:o,y:a,scaleX:h,scaleY:l}=e;if(n(r)&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:s,skewX:i,skewY:r}=e,n=s*z,o=G(n),a=V(n);if(i||r){const e=i*z,s=r*z;t.a=(o+s*-a)*h,t.b=(a+s*o)*h,t.c=(e*o-a)*l,t.d=(o+e*a)*l}else t.a=o*h,t.b=a*h,t.c=-a*l,t.d=o*l}else t.a=h,t.b=0,t.c=0,t.d=l;t.e=o,t.f=a,(s=s||i)&&K.translateInner(t,-s.x,-s.y,!i)},getLayout(t,e,s,i){const{a:r,b:n,c:o,d:a,e:h,f:l}=t;let d,c,u,_,p,g=h,f=l;if(n||o){const t=r*a-n*o;if(o&&!i){d=H(r*r+n*n),c=t/d;const e=r/d;u=n>0?q(e):-q(e)}else{c=H(o*o+a*a),d=t/c;const e=o/c;u=Y-(a>0?q(-e):-q(e))}const e=Q(G(u)),s=V(u);d=Q(d),c=Q(c),_=e?Q((o/c+s)/e/z,9):0,p=e?Q((n/d-s)/e/z,9):0,u=Q(u/z)}else d=r,c=a,u=_=p=0;return(e=s||e)&&(g+=e.x*r+e.y*o,f+=e.x*n+e.y*a,s||(g-=e.x,f-=e.y)),{x:g,y:f,scaleX:d,scaleY:c,rotation:u,skewX:_,skewY:p}},withScale(t,e,s=e){const i=t;if(!e||!s){const{a:i,b:r,c:n,d:o}=t;r||n?s=(i*o-r*n)/(e=H(i*i+r*r)):(e=i,s=o)}return i.scaleX=e,i.scaleY=s,i},reset(t){K.set(t)}},K=Z,{float:tt}=D,{toInnerPoint:et,toOuterPoint:st}=Z,{sin:it,cos:rt,abs:nt,sqrt:ot,atan2:at,min:ht,round:lt}=Math,dt={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,s){t.radiusX=e,t.radiusY=n(s)?e:s},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,s){t.x=e,t.y=s},round(t,e){t.x=e?lt(t.x-.5)+.5:lt(t.x),t.y=e?lt(t.y-.5)+.5:lt(t.y)},move(t,e,s){_(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=s)},scale(t,e,s=e){t.x&&(t.x*=e),t.y&&(t.y*=s)},scaleOf(t,e,s,i=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(i-1)},rotate(t,e,s,i=1,r=1){s||(s=ct.defaultPoint);const n=rt(e*=z),o=it(e),a=(t.x-s.x)/i,h=(t.y-s.y)/r;t.x=s.x+(a*n-h*o)*i,t.y=s.y+(a*o+h*n)*r},tempToInnerOf(t,e){const{tempPoint:s}=ct;return _t(s,t),et(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=ct;return _t(s,t),st(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=ct;return _t(s,t),ct.toInnerRadiusPointOf(t,e,s),s},copyRadiusPoint:(t,e,s,i)=>(_t(t,e),pt(t,s,i),t),toInnerRadiusPointOf(t,e,s){s||(s=t),et(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){et(e,t,s)},toOuterOf(t,e,s){st(e,t,s)},toVertical(t,e,s,i){const r=e*z;t.x+=-Math.sin(r)*s,t.y+=Math.cos(r)*s},getCenter:(t,e)=>({x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}),getCenterX:(t,e)=>t+(e-t)/2,getCenterY:(t,e)=>t+(e-t)/2,getDistance:(t,e)=>ut(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,i){const r=nt(s-t),n=nt(i-e);return ot(r*r+n*n)},getMinDistanceFrom:(t,e,s,i,r,n)=>ht(ut(t,e,s,i),ut(s,i,r,n)),getAngle:(t,e,s,i)=>gt(t,e,s,i)/z,getRotation:(t,e,s,i)=>(i||(i=e),ct.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,i.x,i.y)/z),getRadianFrom(t,e,s,i,r,o,a,h){n(a)&&(a=s,h=i);const l=t-s,d=e-i,c=r-a,u=o-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e,s=1,i=1)=>at((e.y-t.y)/i,(e.x-t.x)/s),getDistancePoint(t,e,s,i,r){const n=gt(t,e);return r&&(t=e),i||(e={}),e.x=t.x+rt(n)*s,e.y=t.y+it(n)*s,e},toNumberPoints(t){let e=t;return _(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},isSame:(t,e,s)=>s?t.x===e.x&&t.y===e.y:tt(t.x)===tt(e.x)&&tt(t.y)===tt(e.y),reset(t){t.x=t.y=0}},ct=dt,{getDistanceFrom:ut,copy:_t,setRadius:pt,getAtan2:gt}=ct;class ft{constructor(t,e){this.set(t,e)}set(t,e){return _(t)?dt.copy(this,t):dt.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new ft(this)}move(t,e){return dt.move(this,t,e),this}scale(t,e){return dt.scale(this,t,e),this}scaleOf(t,e,s){return dt.scaleOf(this,t,e,s),this}rotate(t,e,s,i){return dt.rotate(this,t,e,s,i),this}rotateOf(t,e,s,i){return dt.rotate(this,e,t,s,i),this}getRotation(t,e,s){return dt.getRotation(this,t,e,s)}toInnerOf(t,e){return dt.toInnerOf(this,t,e),this}toOuterOf(t,e){return dt.toOuterOf(this,t,e),this}getCenter(t){return new ft(dt.getCenter(this,t))}getDistance(t){return dt.getDistance(this,t)}getDistancePoint(t,e,s,i){return new ft(dt.getDistancePoint(this,t,e,s,i))}getAngle(t,e,s){return dt.getAngle(this,t,e,s)}getAtan2(t,e,s){return dt.getAtan2(this,t,e,s)}isSame(t,e){return dt.isSame(this,t,e)}reset(){return dt.reset(this),this}}const yt=new ft;class mt{constructor(t,e,s,i,r,n){this.set(t,e,s,i,r,n)}set(t,e,s,i,r,n){return _(t)?Z.copy(this,t):Z.set(this,t,e,s,i,r,n),this}setWith(t){return Z.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:s,d:i,e:r,f:n}=this;return{a:t,b:e,c:s,d:i,e:r,f:n}}clone(){return new mt(this)}translate(t,e){return Z.translate(this,t,e),this}translateInner(t,e){return Z.translateInner(this,t,e),this}scale(t,e){return Z.scale(this,t,e),this}scaleWith(t,e){return Z.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return Z.pixelScale(this,t),this}scaleOfOuter(t,e,s){return Z.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return Z.scaleOfInner(this,t,e,s),this}rotate(t){return Z.rotate(this,t),this}rotateOfOuter(t,e){return Z.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return Z.rotateOfInner(this,t,e),this}skew(t,e){return Z.skew(this,t,e),this}skewOfOuter(t,e,s){return Z.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return Z.skewOfInner(this,t,e,s),this}multiply(t){return Z.multiply(this,t),this}multiplyParent(t){return Z.multiplyParent(this,t),this}divide(t){return Z.divide(this,t),this}divideParent(t){return Z.divideParent(this,t),this}invert(){return Z.invert(this),this}invertWith(){return Z.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){Z.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){Z.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return Z.setLayout(this,t,e,s),this}getLayout(t,e,s){return Z.getLayout(this,t,e,s)}withScale(t,e){return Z.withScale(this,t,e)}reset(){return Z.reset(this),this}}const xt=new mt,wt={tempPointBounds:{},setPoint(t,e,s){t.minX=t.maxX=e,t.minY=t.maxY=s},addPoint(t,e,s){t.minX=e<t.minX?e:t.minX,t.minY=s<t.minY?s:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=s>t.maxY?s:t.maxY},addBounds(t,e,s,i,r){vt(t,e,s),vt(t,e+i,s+r)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}},{addPoint:vt}=wt;var bt,kt;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(bt||(bt={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center",t[t["top-left"]=0]="top-left",t[t["top-right"]=2]="top-right",t[t["bottom-right"]=4]="bottom-right",t[t["bottom-left"]=6]="bottom-left"}(kt||(kt={}));const St=[{x:0,y:0},{x:.5,y:0},{x:1,y:0},{x:1,y:.5},{x:1,y:1},{x:.5,y:1},{x:0,y:1},{x:0,y:.5},{x:.5,y:.5}];St.forEach(t=>t.type="percent");const Bt={directionData:St,tempPoint:{},get:Ct,toPoint(t,e,s,i,r,n){const o=Ct(t);s.x=o.x,s.y=o.y,"percent"===o.type&&(s.x*=e.width,s.y*=e.height,r&&(n||(s.x-=r.x,s.y-=r.y),o.x&&(s.x-=1===o.x?r.width:.5===o.x?o.x*r.width:0),o.y&&(s.y-=1===o.y?r.height:.5===o.y?o.y*r.height:0))),i||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s,i=!0)=>(s||(s={}),Bt.toPoint(t,e,s,i),s)};function Ct(t){return a(t)?St[kt[t]]:t}const{toPoint:Rt}=Bt,Pt={toPoint(t,e,s,i,r,n){Rt(t,s,i,r,e,n)}},{tempPointBounds:Tt,setPoint:Lt,addPoint:Ot,toBounds:Et}=wt,{toOuterPoint:At}=Z,{float:It,fourNumber:Mt}=D,{floor:Wt,ceil:Dt}=Math;let Ft,zt,Nt,Yt;const Xt={},Ut={},jt={},Vt={tempBounds:jt,set(t,e=0,s=0,i=0,r=0){t.x=e,t.y=s,t.width=i,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,i,r){const{x:n,y:o,width:a,height:h}=e;if(u(s)){const e=Mt(s);i?Gt.set(t,n+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):Gt.set(t,n-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else i&&(s=-s),Gt.set(t,n-s,o-s,a+2*s,h+2*s);r&&("width"===r?(t.y=o,t.height=h):(t.x=n,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,s){t.x+=e,t.y+=s},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,s)=>(t=Object.assign({},t),Gt.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Ht(e,t):e=t,s||(s=t),e.offsetX=Gt.maxX(s),e.offsetY=Gt.maxY(s),Gt.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,i){i||dt.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,i=s){dt.scaleOf(t,e,s,i),t.width*=s,t.height*=i},tempToOuterOf:(t,e)=>(Gt.copy(jt,t),Gt.toOuterOf(jt,e),jt),getOuterOf:(t,e)=>(t=Object.assign({},t),Gt.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:i,d:r,e:n,f:o}=e;i>0?(s.width=t.width*i,s.x=n+t.x*i):(s.width=t.width*-i,s.x=n+t.x*i-s.width),r>0?(s.height=t.height*r,s.y=o+t.y*r):(s.height=t.height*-r,s.y=o+t.y*r-s.height)}else Xt.x=t.x,Xt.y=t.y,At(e,Xt,Ut),Lt(Tt,Ut.x,Ut.y),Xt.x=t.x+t.width,At(e,Xt,Ut),Ot(Tt,Ut.x,Ut.y),Xt.y=t.y+t.height,At(e,Xt,Ut),Ot(Tt,Ut.x,Ut.y),Xt.x=t.x,At(e,Xt,Ut),Ot(Tt,Ut.x,Ut.y),Et(Tt,s)},toInnerOf(t,e,s){s||(s=t),Gt.move(s,-e.e,-e.f),Gt.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const i=Math.min(s,Gt.getFitScale(t,e));return new mt(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,s){const i=t.width/e.width,r=t.height/e.height;return s?Math.max(i,r):Math.min(i,r)},put(t,e,s="center",i=1,r=!0,n){n||(n=e),a(i)&&(i=Gt.getFitScale(t,e,"cover"===i)),jt.width=r?e.width*=i:e.width*i,jt.height=r?e.height*=i:e.height*i,Pt.toPoint(s,jt,t,n,!0,!0)},getSpread(t,e,s){const i={};return Gt.copyAndSpread(i,t,e,!1,s),i},spread(t,e,s){Gt.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){Gt.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=Wt(t.x),t.y=Wt(t.y),t.width=e>t.x?Dt(t.width+e-t.x):Dt(t.width),t.height=s>t.y?Dt(t.height+s-t.y):Dt(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=It(t.x,e),t.y=It(t.y,e),t.width=It(t.width,e),t.height=It(t.height,e)},add(t,e,s){Ft=t.x+t.width,zt=t.y+t.height,Nt=e.x,Yt=e.y,s||(Nt+=e.width,Yt+=e.height),Ft=Ft>Nt?Ft:Nt,zt=zt>Yt?zt:Yt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=Ft-t.x,t.height=zt-t.y},addList(t,e){Gt.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){Gt.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){Gt.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,i=!1){let r,n=!0;for(let o=0,a=e.length;o<a;o++)r=s?s(e[o],o):e[o],r&&(r.width||r.height)&&(n?(n=!1,i||Ht(t,r)):qt(t,r));n&&Gt.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Lt(Tt,t.x,t.y):Ot(Tt,t.x,t.y)),Et(Tt,t)},setPoint(t,e){Gt.set(t,e.x,e.y)},addPoint(t,e){qt(t,e,!0)},getPoints(t){const{x:e,y:s,width:i,height:r}=t;return[{x:e,y:s},{x:e+i,y:s},{x:e+i,y:s+r},{x:e,y:s+r}]},getPoint:(t,e,s=!1,i)=>Bt.getPoint(e,t,i,s),hitRadiusPoint:(t,e,s)=>(s&&(e=dt.tempToInnerRadiusPointOf(e,s)),e.x>=t.x-e.radiusX&&e.x<=t.x+t.width+e.radiusX&&e.y>=t.y-e.radiusY&&e.y<=t.y+t.height+e.radiusY),hitPoint:(t,e,s)=>(s&&(e=dt.tempToInnerOf(e,s)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,s)=>(s&&(e=Gt.tempToOuterOf(e,s)),!(t.y+t.height<e.y||e.y+e.height<t.y||t.x+t.width<e.x||e.x+e.width<t.x)),includes:(t,e,s)=>(s&&(e=Gt.tempToOuterOf(e,s)),t.x<=e.x&&t.y<=e.y&&t.x+t.width>=e.x+e.width&&t.y+t.height>=e.y+e.height),getIntersectData(t,e,s){if(s&&(e=Gt.tempToOuterOf(e,s)),!Gt.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:n,height:o}=e;return Ft=i+n,zt=r+o,Nt=t.x+t.width,Yt=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,Ft=Ft<Nt?Ft:Nt,zt=zt<Yt?zt:Yt,n=Ft-i,o=zt-r,{x:i,y:r,width:n,height:o}},intersect(t,e,s){Gt.copy(t,Gt.getIntersectData(t,e,s))},isSame:(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEmpty:t=>0===t.x&&0===t.y&&0===t.width&&0===t.height,hasSize:t=>t.width&&t.height,reset(t){Gt.set(t)}},Gt=Vt,{add:qt,copy:Ht}=Gt;class Qt{get minX(){return Vt.minX(this)}get minY(){return Vt.minY(this)}get maxX(){return Vt.maxX(this)}get maxY(){return Vt.maxY(this)}constructor(t,e,s,i){this.set(t,e,s,i)}set(t,e,s,i){return _(t)?Vt.copy(this,t):Vt.set(this,t,e,s,i),this}get(){const{x:t,y:e,width:s,height:i}=this;return{x:t,y:e,width:s,height:i}}clone(){return new Qt(this)}move(t,e){return Vt.move(this,t,e),this}scale(t,e,s){return Vt.scale(this,t,e,s),this}scaleOf(t,e,s){return Vt.scaleOf(this,t,e,s),this}toOuterOf(t,e){return Vt.toOuterOf(this,t,e),this}toInnerOf(t,e){return Vt.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Vt.getFitMatrix(this,t,e)}put(t,e,s){Vt.put(this,t,e,s)}spread(t,e){return Vt.spread(this,t,e),this}shrink(t,e){return Vt.shrink(this,t,e),this}ceil(){return Vt.ceil(this),this}unsign(){return Vt.unsign(this),this}float(t){return Vt.float(this,t),this}add(t){return Vt.add(this,t),this}addList(t){return Vt.setList(this,t,!0),this}setList(t){return Vt.setList(this,t),this}addListWithFn(t,e){return Vt.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Vt.setListWithFn(this,t,e),this}setPoint(t){return Vt.setPoint(this,t),this}setPoints(t){return Vt.setPoints(this,t),this}addPoint(t){return Vt.addPoint(this,t),this}getPoints(){return Vt.getPoints(this)}getPoint(t,e,s){return Vt.getPoint(this,t,e,s)}hitPoint(t,e){return Vt.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Vt.hitRadiusPoint(this,t,e)}hit(t,e){return Vt.hit(this,t,e)}includes(t,e){return Vt.includes(this,t,e)}intersect(t,e){return Vt.intersect(this,t,e),this}getIntersect(t,e){return new Qt(Vt.getIntersectData(this,t,e))}isSame(t){return Vt.isSame(this,t)}isEmpty(){return Vt.isEmpty(this)}reset(){Vt.reset(this)}}const Jt=new Qt;class $t{constructor(t,e,s,i,r,n){_(t)?this.copy(t):this.set(t,e,s,i,r,n)}set(t=0,e=0,s=0,i=0,r=0,n=0){this.top=t,this.right=e,this.bottom=s,this.left=i,this.width=r,this.height=n}copy(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=t;this.set(e,s,i,r,n,o)}getBoundsFrom(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=this;return new Qt(r,e,n||t.width-r-s,o||t.height-e-i)}}const Zt={number:(t,e)=>_(t)?"percent"===t.type?t.value*e:t.value:t},Kt={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{floor:te,max:ee}=Math,se={toURL(t,e){let s=encodeURIComponent(t);return"text"===e?s="data:text/plain;charset=utf-8,"+s:"svg"===e&&(s="data:image/svg+xml,"+s),s},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",isLarge:(t,e,s,i)=>t.width*t.height*(e?e*s:1)>(i||ie.maxCacheSize),isSuperLarge:(t,e,s)=>ie.isLarge(t,e,s,ie.maxPatternSize),getRealURL(t){const{prefix:e,suffix:s}=ie;return!s||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+s),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,s,i,r,n,o,a,h,l){const d=ee(te(e+(i||0)),1),c=ee(te(s+(r||0)),1);let u,_,p;l&&(p=Zt.number(l.offset,"x"===l.type?e:s))&&("x"===l.type?u=!0:_=!0);const g=se.origin.createCanvas(_?2*d:d,u?2*c:c),f=g.getContext("2d");if(a&&(f.globalAlpha=a),f.imageSmoothingEnabled=!1!==o,ie.canUse(t)){if(n){const i=e/n.width,r=s/n.height;f.setTransform(i,0,0,r,-n.x*i,-n.y*r),f.drawImage(t,0,0,t.width,t.height)}else f.drawImage(t,0,0,e,s);p&&(f.drawImage(g,0,0,d,c,u?p-d:d,u?c:p-c,d,c),f.drawImage(g,0,0,d,c,u?p:d,u?c:p,d,c))}return g},canUse:t=>t&&t.width&&!t.__closed,setPatternTransform(t,e,s){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}s&&f.stintSet(s,"transform",e)}}},{image:ie}=se,{randColor:re}=D;class ne{constructor(t){this.repeatMap={},this.name=t}static get(t){return new ne(t)}static set filter(t){this.filterList=oe(t)}static set exclude(t){this.excludeList=oe(t)}static drawRepaint(t,e){const s=re();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const i="hit"===ne.showBounds,r=t.__nowWorld,n=re();i&&(e.setWorld(r),t.__drawHitPath(e),e.fillStyle=n.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(n,2),i?e.stroke():e.strokeWorld(r,n)}log(...t){if(ae.enable){if(ae.filterList.length&&ae.filterList.every(t=>t!==this.name))return;if(ae.excludeList.length&&ae.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){ae.enable&&this.warn(...t)}warn(...t){ae.showWarn&&console.warn(this.name,...t)}repeat(t,...e){this.repeatMap[t]||(this.warn("repeat:"+t,...e),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(e){console.error(this.name,...t,e)}}}function oe(t){return t?a(t)&&(t=[t]):t=[],t}ne.filterList=[],ne.excludeList=[],ne.showWarn=!0;const ae=ne,he=ne.get("RunTime"),le={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const s=x.create(x.RUNTIME);return de.currentId=de.idMap[s]=e?performance.now():Date.now(),de.currentName=de.nameMap[s]=t,de.nameToIdMap[t]=s,s},end(t,e){const s=de.idMap[t],i=de.nameMap[t],r=e?(performance.now()-s)/1e3:Date.now()-s;de.idMap[t]=de.nameMap[t]=de.nameToIdMap[i]=void 0,he.log(i,r,"ms")},endOfName(t,e){const s=de.nameToIdMap[t];n(s)||de.end(s,e)}},de=le,ce=[],ue={list:{},add(t,...e){this.list[t]=!0,ce.push(...e)},has(t,e){const s=this.list[t];return!s&&e&&this.need(t),s},need(t){console.error("please install and import plugin: "+(t.includes("-x")?"":"@leafer-in/")+t)}};setTimeout(()=>ce.forEach(t=>ue.has(t,!0)));const _e={editor:t=>ue.need("editor")},pe=ne.get("UICreator"),ge={list:{},register(t){const{__tag:e}=t.prototype;fe[e]&&pe.repeat(e),fe[e]=t},get(t,e,s,i,r,o){if(!fe[t])return void pe.warn("not register "+t);const a=new fe[t](e);return n(s)||(a.x=s,i&&(a.y=i),r&&(a.width=r),o&&(a.height=o)),a}},{list:fe}=ge,ye=ne.get("EventCreator"),me={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],a(e)&&(xe[e]&&ye.repeat(e),xe[e]=t)})},changeName(t,e){const s=xe[t];if(s){const i=Object.keys(s).find(e=>s[e]===t);i&&(s[i]=e,xe[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new xe[t](...e)},{nameList:xe}=me;class we{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:s}=this;for(let i=0,r=s.length;i<r;i++)if(e=s[i],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const i=_e.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,i=this.list.length;s<i;s++)t=this.list[s],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}}function ve(t){return(e,s)=>{t||(t=s);const i={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===s&&(i.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,s,i)}}const be=[];function ke(){return(t,e)=>{be.push(e)}}const Se=[];let Be=class{set blendMode(t){"normal"===t&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||Se)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;be.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,i,r,n){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,i,r,n){_(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,i,r,n)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,i){}strokeRect(t,e,s,i){}clearRect(t,e,s,i){}drawImage(t,e,s,i,r,n,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,n+=t,a-=t}if(s<0){const t=-s/r*h;r+=s,s=0,o+=t,h-=t}this.context.drawImage(t,e,s,i,r,n,o,a,h);break;case 5:this.context.drawImage(t,e,s,i,r);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,i,r,n){}quadraticCurveTo(t,e,s,i){}closePath(){}arc(t,e,s,i,r,n){}arcTo(t,e,s,i,r){}ellipse(t,e,s,i,r,n,o,a){}rect(t,e,s,i){}roundRect(t,e,s,i,r){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,i){}createPattern(t,e){}createRadialGradient(t,e,s,i,r,n){}fillText(t,e,s,i){}measureText(t){}strokeText(t,e,s,i){}destroy(){this.context=null}};s([ve("imageSmoothingEnabled")],Be.prototype,"smooth",void 0),s([ve("imageSmoothingQuality")],Be.prototype,"smoothLevel",void 0),s([ve("globalAlpha")],Be.prototype,"opacity",void 0),s([ve()],Be.prototype,"fillStyle",void 0),s([ve()],Be.prototype,"strokeStyle",void 0),s([ve("lineWidth")],Be.prototype,"strokeWidth",void 0),s([ve("lineCap")],Be.prototype,"strokeCap",void 0),s([ve("lineJoin")],Be.prototype,"strokeJoin",void 0),s([ve("lineDashOffset")],Be.prototype,"dashOffset",void 0),s([ve()],Be.prototype,"miterLimit",void 0),s([ve()],Be.prototype,"shadowBlur",void 0),s([ve()],Be.prototype,"shadowColor",void 0),s([ve()],Be.prototype,"shadowOffsetX",void 0),s([ve()],Be.prototype,"shadowOffsetY",void 0),s([ve()],Be.prototype,"filter",void 0),s([ve()],Be.prototype,"font",void 0),s([ve()],Be.prototype,"fontKerning",void 0),s([ve()],Be.prototype,"fontStretch",void 0),s([ve()],Be.prototype,"fontVariantCaps",void 0),s([ve()],Be.prototype,"textAlign",void 0),s([ve()],Be.prototype,"textBaseline",void 0),s([ve()],Be.prototype,"textRendering",void 0),s([ve()],Be.prototype,"wordSpacing",void 0),s([ve()],Be.prototype,"letterSpacing",void 0),s([ve()],Be.prototype,"direction",void 0),s([ke()],Be.prototype,"setTransform",null),s([ke()],Be.prototype,"resetTransform",null),s([ke()],Be.prototype,"getTransform",null),s([ke()],Be.prototype,"save",null),s([ke()],Be.prototype,"restore",null),s([ke()],Be.prototype,"translate",null),s([ke()],Be.prototype,"scale",null),s([ke()],Be.prototype,"rotate",null),s([ke()],Be.prototype,"fill",null),s([ke()],Be.prototype,"stroke",null),s([ke()],Be.prototype,"clip",null),s([ke()],Be.prototype,"fillRect",null),s([ke()],Be.prototype,"strokeRect",null),s([ke()],Be.prototype,"clearRect",null),s([ke()],Be.prototype,"beginPath",null),s([ke()],Be.prototype,"moveTo",null),s([ke()],Be.prototype,"lineTo",null),s([ke()],Be.prototype,"bezierCurveTo",null),s([ke()],Be.prototype,"quadraticCurveTo",null),s([ke()],Be.prototype,"closePath",null),s([ke()],Be.prototype,"arc",null),s([ke()],Be.prototype,"arcTo",null),s([ke()],Be.prototype,"ellipse",null),s([ke()],Be.prototype,"rect",null),s([ke()],Be.prototype,"roundRect",null),s([ke()],Be.prototype,"createConicGradient",null),s([ke()],Be.prototype,"createLinearGradient",null),s([ke()],Be.prototype,"createPattern",null),s([ke()],Be.prototype,"createRadialGradient",null),s([ke()],Be.prototype,"fillText",null),s([ke()],Be.prototype,"measureText",null),s([ke()],Be.prototype,"strokeText",null);const{copy:Ce,multiplyParent:Re,pixelScale:Pe}=Z,{round:Te}=Math,Le=new Qt,Oe=new Qt,Ee={width:1,height:1,pixelRatio:1},Ae=["width","height","pixelRatio"];class Ie extends Be{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,e){super(),this.size={},this.worldTransform={},t||(t=Ee),this.manager=e,this.innerId=x.create(x.CANVAS);const{width:s,height:i,pixelRatio:r}=t;this.autoLayout=!s||!i,this.size.pixelRatio=r||se.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&e&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;f.copyAttrs(i,t,Ae),Ae.forEach(t=>i[t]||(i[t]=1)),this.bounds=new Qt(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&s&&(this.clearWorld(s.bounds),this.copyWorld(s),s.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s,pixelSnap:i}=this,r=this.worldTransform;e&&Re(t,e,r),Pe(t,s,r),i&&!t.ignorePixelSnap&&(t.half&&t.half*s%2?(r.e=Te(r.e-.5)+.5,r.f=Te(r.f-.5)+.5):(r.e=Te(r.e),r.f=Te(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,s,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,e){let{strokeCap:s,strokeJoin:i,dashPattern:r,dashOffset:o,miterLimit:a}=t;e&&(e.strokeCap&&(s=e.strokeCap),e.strokeJoin&&(i=e.strokeJoin),n(e.dashPattern)||(r=e.dashPattern),n(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=s,this.strokeJoin=i,this.dashPattern=r,this.dashOffset=o,this.miterLimit=a}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,s=1){return!0}setWorldShadow(t,e,s,i){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=s*r,this.shadowColor=i||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,i,r){i&&(this.blendMode=i),e?(this.setTempPixelBounds(e,r),s?(this.setTempPixelBounds2(s,r),s=Oe):s=Le,this.drawImage(t.view,Le.x,Le.y,Le.width,Le.height,s.x,s.y,s.width,s.height)):this.drawImage(t.view,0,0),i&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,i,r){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Vt.tempToOuterOf(s,e),i,r),this.restore()):(i&&(this.blendMode=i),this.setTempPixelBounds(e,r),this.drawImage(t.view,Le.x,Le.y,Le.width,Le.height,s.x,s.y,s.width,s.height),i&&(this.blendMode="source-over"))}copyWorldByReset(t,e,s,i,r,n){this.resetTransform(),this.copyWorld(t,e,s,i,n),r||this.useWorldTransform()}useGrayscaleAlpha(t){if(this.setTempPixelBounds(t,!0,!0),!Le.width||!Le.height)return;let e,s;const{context:i}=this,r=i.getImageData(Le.x,Le.y,Le.width,Le.height),{data:n}=r;for(let t=0,i=n.length;t<i;t+=4)s=.299*n[t]+.587*n[t+1]+.114*n[t+2],(e=n[t+3])&&(n[t+3]=255===e?s:e*(s/255));i.putImageData(r,Le.x,Le.y)}useMask(t,e,s){this.copyWorld(t,e,s,"destination-in")}useEraser(t,e,s){this.copyWorld(t,e,s,"destination-out")}fillWorld(t,e,s,i){s&&(this.blendMode=s),this.fillStyle=e,this.setTempPixelBounds(t,i),this.fillRect(Le.x,Le.y,Le.width,Le.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s,i){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempPixelBounds(t,i),this.strokeRect(Le.x,Le.y,Le.width,Le.height),s&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Le.x,Le.y,Le.width,Le.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Le.x,Le.y,Le.width,Le.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,s){this.copyToPixelBounds(Le,t,e,s)}setTempPixelBounds2(t,e,s){this.copyToPixelBounds(Oe,t,e,s)}copyToPixelBounds(t,e,s,i){t.set(e),i&&t.intersect(this.bounds),t.scale(this.pixelRatio),s&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:s,pixelSnap:i}=this,r=this.manager?this.manager.get(s):_e.canvas(Object.assign({},s));return r.save(),t&&(Ce(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==i&&(r.pixelSnap=i),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}}const Me={creator:{},parse(t,e){},convertToCanvasData(t,e){}},We={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},De=Object.assign({M:1,m:10,L:2,l:20,H:3,h:30,V:4,v:40,C:5,c:50,S:6,s:60,Q:7,q:70,T:8,t:80,A:9,a:90,Z:11,z:11,R:12},We),Fe={M:3,m:3,L:3,l:3,H:2,h:2,V:2,v:2,C:7,c:7,S:5,s:5,Q:5,q:5,T:3,t:3,A:8,a:8,Z:1,z:1,N:5,D:9,X:6,G:9,F:5,O:7,P:4,U:6},ze={m:10,l:20,H:3,h:30,V:4,v:40,c:50,S:6,s:60,q:70,T:8,t:80,A:9,a:90},Ne=Object.assign(Object.assign({},ze),We),Ye=De,Xe={};for(let t in Ye)Xe[Ye[t]]=t;const Ue={};for(let t in Ye)Ue[Ye[t]]=Fe[t];const je={drawRoundRect(t,e,s,i,r,n){const o=D.fourNumber(n,Math.min(i/2,r/2)),a=e+i,h=s+r;o[0]?t.moveTo(e+o[0],s):t.moveTo(e,s),o[1]?t.arcTo(a,s,a,h,o[1]):t.lineTo(a,s),o[2]?t.arcTo(a,h,e,h,o[2]):t.lineTo(a,h),o[3]?t.arcTo(e,h,e,s,o[3]):t.lineTo(e,h),o[0]?t.arcTo(e,s,a,s,o[0]):t.lineTo(e,s)}},{sin:Ve,cos:Ge,hypot:qe,atan2:He,ceil:Qe,abs:Je,PI:$e,sqrt:Ze,pow:Ke}=Math,{setPoint:ts,addPoint:es}=wt,{set:ss,toNumberPoints:is}=dt,{M:rs,L:ns,C:os,Q:as,Z:hs}=De,ls={},ds={points(t,e,s,i){let r=is(e);if(t.push(rs,r[0],r[1]),s&&r.length>5){let e,n,o,a,h,l,d,c,u,_,p,g,f,y,m,x=r.length;const w=!0===s?.5:s;i&&(r=[r[x-2],r[x-1],...r,r[0],r[1],r[2],r[3]],x=r.length);for(let s=2;s<x-2;s+=2)e=r[s-2],n=r[s-1],o=r[s],a=r[s+1],h=r[s+2],l=r[s+3],p=o-e,g=a-n,f=Ze(Ke(p,2)+Ke(g,2)),y=Ze(Ke(h-o,2)+Ke(l-a,2)),(f||y)&&(m=f+y,f=w*f/m,y=w*y/m,h-=e,l-=n,d=o-f*h,c=a-f*l,2===s?i||t.push(as,d,c,o,a):(p||g)&&t.push(os,u,_,d,c,o,a),u=o+y*h,_=a+y*l);i||t.push(as,u,_,r[x-2],r[x-1])}else for(let e=2,s=r.length;e<s;e+=2)t.push(ns,r[e],r[e+1]);i&&t.push(hs)},rect(t,e,s,i,r){Me.creator.path=t,Me.creator.moveTo(e,s).lineTo(e+i,s).lineTo(e+i,s+r).lineTo(e,s+r).lineTo(e,s)},roundRect(t,e,s,i,r,n){Me.creator.path=[],je.drawRoundRect(Me.creator,e,s,i,r,n),t.push(...Me.convertToCanvasData(Me.creator.path,!0))},arcTo(t,e,s,i,r,n,o,a,h,l,d){const c=i-e,u=r-s,_=n-i,p=o-r;let g=He(u,c),f=He(p,_);const y=qe(c,u),m=qe(_,p);let x=f-g;if(x<0&&(x+=N),y<1e-12||m<1e-12||x<1e-12||Je(x-$e)<1e-12)return t&&t.push(ns,i,r),h&&(ts(h,e,s),es(h,i,r)),d&&ss(d,e,s),void(l&&ss(l,i,r));const w=c*p-_*u<0,v=w?-1:1,b=a/Ge(x/2),k=i+b*Ge(g+x/2+Y*v),S=r+b*Ve(g+x/2+Y*v);return g-=Y*v,f-=Y*v,_s(t,k,S,a,a,0,g/z,f/z,w,h,l,d)},arc:(t,e,s,i,r,n,o,a,h,l)=>_s(t,e,s,i,i,0,r,n,o,a,h,l),ellipse(t,e,s,i,r,n,o,a,h,l,d,c){const u=n*z,_=Ve(u),p=Ge(u);let g=o*z,f=a*z;g>$e&&(g-=N),f<0&&(f+=N);let y=f-g;if(y<0?y+=N:y>N&&(y-=N),h){360===Je(a-o)?y=-N:y-=N}const m=Qe(Je(y/Y)),x=y/m,w=Ve(x/4),v=8/3*w*w/Ve(x/2);f=g+x;let b,k,S,B,C,R,P,T,L=Ge(g),O=Ve(g),E=S=p*i*L-_*r*O,A=B=_*i*L+p*r*O,I=e+S,M=s+B;t&&t.push(t.length?ns:rs,I,M),l&&ts(l,I,M),c&&ss(c,I,M);for(let n=0;n<m;n++)b=Ge(f),k=Ve(f),S=p*i*b-_*r*k,B=_*i*b+p*r*k,C=e+E-v*(p*i*O+_*r*L),R=s+A-v*(_*i*O-p*r*L),P=e+S+v*(p*i*k+_*r*b),T=s+B+v*(_*i*k-p*r*b),t&&t.push(os,C,R,P,T,e+S,s+B),l&&us(e+E,s+A,C,R,P,T,e+S,s+B,l,!0),E=S,A=B,L=b,O=k,g=f,f+=x;d&&ss(d,e+S,s+B)},quadraticCurveTo(t,e,s,i,r,n,o){t.push(os,(e+2*i)/3,(s+2*r)/3,(n+2*i)/3,(o+2*r)/3,n,o)},toTwoPointBoundsByQuadraticCurve(t,e,s,i,r,n,o,a){us(t,e,(t+2*s)/3,(e+2*i)/3,(r+2*s)/3,(n+2*i)/3,r,n,o,a)},toTwoPointBounds(t,e,s,i,r,n,o,a,h,l){const d=[];let c,u,_,p,g,f,y,m,x=t,w=s,v=r,b=o;for(let t=0;t<2;++t)if(1==t&&(x=e,w=i,v=n,b=a),c=-3*x+9*w-9*v+3*b,u=6*x-12*w+6*v,_=3*w-3*x,Math.abs(c)<1e-12){if(Math.abs(u)<1e-12)continue;p=-_/u,0<p&&p<1&&d.push(p)}else y=u*u-4*_*c,m=Math.sqrt(y),y<0||(g=(-u+m)/(2*c),0<g&&g<1&&d.push(g),f=(-u-m)/(2*c),0<f&&f<1&&d.push(f));l?es(h,t,e):ts(h,t,e),es(h,o,a);for(let l=0,c=d.length;l<c;l++)cs(d[l],t,e,s,i,r,n,o,a,ls),es(h,ls.x,ls.y)},getPointAndSet(t,e,s,i,r,n,o,a,h,l){const d=1-t,c=d*d*d,u=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=c*e+u*i+_*n+p*a,l.y=c*s+u*r+_*o+p*h},getPoint(t,e,s,i,r,n,o,a,h){const l={};return cs(t,e,s,i,r,n,o,a,h,l),l},getDerivative(t,e,s,i,r){const n=1-t;return 3*n*n*(s-e)+6*n*t*(i-s)+3*t*t*(r-i)},cut(t,e,s,i,r,n,o,a,h){if(t<=0)return{left:null,right:[i,r,n,o,a,h]};if(t>=1)return{left:[i,r,n,o,a,h],right:null};const l=1-t,d=e*l+i*t,c=s*l+r*t,u=i*l+n*t,_=r*l+o*t,p=n*l+a*t,g=o*l+h*t,f=d*l+u*t,y=c*l+_*t,m=u*l+p*t,x=_*l+g*t;return{left:[d,c,f,y,f*l+m*t,y*l+x*t],right:[m,x,p,g,a,h]}}},{getPointAndSet:cs,toTwoPointBounds:us,ellipse:_s}=ds,{sin:ps,cos:gs,sqrt:fs,atan2:ys}=Math,{ellipse:ms}=ds,xs={ellipticalArc(t,e,s,i,r,n,o,a,h,l,d){const c=(h-e)/2,u=(l-s)/2,_=n*z,p=ps(_),g=gs(_),f=-g*c-p*u,y=-g*u+p*c,m=i*i,x=r*r,w=y*y,v=f*f,b=m*x-m*w-x*v;let k=0;if(b<0){const t=fs(1-b/(m*x));i*=t,r*=t}else k=(o===a?-1:1)*fs(b/(m*w+x*v));const S=k*i*y/r,B=-k*r*f/i,C=ys((y-B)/r,(f-S)/i),R=ys((-y-B)/r,(-f-S)/i);let P=R-C;0===a&&P>0?P-=N:1===a&&P<0&&(P+=N);const T=e+c+g*S-p*B,L=s+u+p*S+g*B,O=P<0?1:0;d||se.ellipseToCurve?ms(t,T,L,i,r,n,C/z,R/z,O):i!==r||n?t.push(De.G,T,L,i,r,n,C/z,R/z,O):t.push(De.O,T,L,i,C/z,R/z,O)}},ws={toCommand:t=>[],toNode:(t,e)=>[]},{M:vs,m:bs,L:ks,l:Ss,H:Bs,h:Cs,V:Rs,v:Ps,C:Ts,c:Ls,S:Os,s:Es,Q:As,q:Is,T:Ms,t:Ws,A:Ds,a:Fs,Z:zs,z:Ns,N:Ys,D:Xs,X:Us,G:js,F:Vs,O:Gs,P:qs,U:Hs}=De,{rect:Qs,roundRect:Js,arcTo:$s,arc:Zs,ellipse:Ks,quadraticCurveTo:ti}=ds,{ellipticalArc:ei}=xs,si=ne.get("PathConvert"),ii={},ri={current:{dot:0},stringify(t,e){let s,i,r,n=0,o=t.length,a="";for(;n<o;){i=t[n],s=Ue[i],a+=i===r?" ":Xe[i];for(let i=1;i<s;i++)a+=D.float(t[n+i],e),i===s-1||(a+=" ");r=i,n+=s}return a},parse(t,e){let s,i,r,n="";const o=[],a=e?Ne:ze;for(let e=0,h=t.length;e<h;e++)i=t[e],Kt[i]?("."===i&&(ni.dot&&(oi(o,n),n=""),ni.dot++),"0"===n&&"."!==i&&(oi(o,n),n=""),n+=i):De[i]?(n&&(oi(o,n),n=""),ni.name=De[i],ni.length=Fe[i],ni.index=0,oi(o,ni.name),"m"===i?ni.name=De.l:"M"===i&&(ni.name=De.L),!s&&a[i]&&(s=!0)):"-"===i||"+"===i?"e"===r||"E"===r?n+=i:(n&&oi(o,n),n=i):n&&(oi(o,n),n=""),r=i;return n&&oi(o,n),s?ri.toCanvasData(o,e):o},toCanvasData(t,e){let s,i,r,n,o,a=0,h=0,l=0,d=0,c=0,u=0,_=0,p=t.length;const g=[];for(;_<p;){switch(r=t[_],r){case bs:t[_+1]+=a,t[_+2]+=h;case vs:a=c=t[_+1],h=u=t[_+2],g.push(vs,a,h),_+=3;break;case Cs:t[_+1]+=a;case Bs:a=t[_+1],g.push(ks,a,h),_+=2;break;case Ps:t[_+1]+=h;case Rs:h=t[_+1],g.push(ks,a,h),_+=2;break;case Ss:t[_+1]+=a,t[_+2]+=h;case ks:a=t[_+1],h=t[_+2],g.push(ks,a,h),_+=3;break;case Es:t[_+1]+=a,t[_+2]+=h,t[_+3]+=a,t[_+4]+=h,r=Os;case Os:o=n===Ts||n===Os,l=o?2*a-s:a,d=o?2*h-i:h,s=t[_+1],i=t[_+2],a=t[_+3],h=t[_+4],g.push(Ts,l,d,s,i,a,h),_+=5;break;case Ls:t[_+1]+=a,t[_+2]+=h,t[_+3]+=a,t[_+4]+=h,t[_+5]+=a,t[_+6]+=h,r=Ts;case Ts:s=t[_+3],i=t[_+4],a=t[_+5],h=t[_+6],g.push(Ts,t[_+1],t[_+2],s,i,a,h),_+=7;break;case Ws:t[_+1]+=a,t[_+2]+=h,r=Ms;case Ms:o=n===As||n===Ms,s=o?2*a-s:a,i=o?2*h-i:h,e?ti(g,a,h,s,i,t[_+1],t[_+2]):g.push(As,s,i,t[_+1],t[_+2]),a=t[_+1],h=t[_+2],_+=3;break;case Is:t[_+1]+=a,t[_+2]+=h,t[_+3]+=a,t[_+4]+=h,r=As;case As:s=t[_+1],i=t[_+2],e?ti(g,a,h,s,i,t[_+3],t[_+4]):g.push(As,s,i,t[_+3],t[_+4]),a=t[_+3],h=t[_+4],_+=5;break;case Fs:t[_+6]+=a,t[_+7]+=h;case Ds:ei(g,a,h,t[_+1],t[_+2],t[_+3],t[_+4],t[_+5],t[_+6],t[_+7],e),a=t[_+6],h=t[_+7],_+=8;break;case Ns:case zs:g.push(zs),a=c,h=u,_++;break;case Ys:a=t[_+1],h=t[_+2],e?Qs(g,a,h,t[_+3],t[_+4]):ai(g,t,_,5),_+=5;break;case Xs:a=t[_+1],h=t[_+2],e?Js(g,a,h,t[_+3],t[_+4],[t[_+5],t[_+6],t[_+7],t[_+8]]):ai(g,t,_,9),_+=9;break;case Us:a=t[_+1],h=t[_+2],e?Js(g,a,h,t[_+3],t[_+4],t[_+5]):ai(g,t,_,6),_+=6;break;case js:Ks(e?g:ai(g,t,_,9),t[_+1],t[_+2],t[_+3],t[_+4],t[_+5],t[_+6],t[_+7],t[_+8],null,ii),a=ii.x,h=ii.y,_+=9;break;case Vs:e?Ks(g,t[_+1],t[_+2],t[_+3],t[_+4],0,0,360,!1):ai(g,t,_,5),a=t[_+1]+t[_+3],h=t[_+2],_+=5;break;case Gs:Zs(e?g:ai(g,t,_,7),t[_+1],t[_+2],t[_+3],t[_+4],t[_+5],t[_+6],null,ii),a=ii.x,h=ii.y,_+=7;break;case qs:e?Zs(g,t[_+1],t[_+2],t[_+3],0,360,!1):ai(g,t,_,4),a=t[_+1]+t[_+3],h=t[_+2],_+=4;break;case Hs:$s(e?g:ai(g,t,_,6),a,h,t[_+1],t[_+2],t[_+3],t[_+4],t[_+5],null,ii),a=ii.x,h=ii.y,_+=6;break;default:return si.error(`command: ${r} [index:${_}]`,t),g}n=r}return g},objectToCanvasData(t){if(t[0].name.length>1)return ws.toCommand(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(vs,t.x,t.y);break;case"L":e.push(ks,t.x,t.y);break;case"C":e.push(Ts,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(As,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(zs)}}),e}},copyData(t,e,s,i){for(let r=s,n=s+i;r<n;r++)t.push(e[r])},pushData(t,e){ni.index===ni.length&&(ni.index=1,t.push(ni.name)),t.push(Number(e)),ni.index++,ni.dot=0}},{current:ni,pushData:oi,copyData:ai}=ri,{M:hi,L:li,C:di,Q:ci,Z:ui,N:_i,D:pi,X:gi,G:fi,F:yi,O:mi,P:xi,U:wi}=De,{getMinDistanceFrom:vi,getRadianFrom:bi}=dt,{tan:ki,min:Si,abs:Bi}=Math,Ci={},Ri=ne.get("PointsCurve"),Pi={pointsCurveList:{},beginPath(t){t.length=0},moveTo(t,e,s){t.push(hi,e,s)},lineTo(t,e,s){t.push(li,e,s)},bezierCurveTo(t,e,s,i,r,n,o){t.push(di,e,s,i,r,n,o)},quadraticCurveTo(t,e,s,i,r){t.push(ci,e,s,i,r)},closePath(t){t.push(ui)},rect(t,e,s,i,r){t.push(_i,e,s,i,r)},roundRect(t,e,s,i,r,n){if(l(n))t.push(gi,e,s,i,r,n);else{const o=D.fourNumber(n);o?t.push(pi,e,s,i,r,...o):t.push(_i,e,s,i,r)}},ellipse(t,e,s,i,r,n,a,h,l){if(i===r)return Li(t,e,s,i,a,h,l);o(n)?t.push(yi,e,s,i,r):(o(a)&&(a=0),o(h)&&(h=360),t.push(fi,e,s,i,r,n,a,h,l?1:0))},arc(t,e,s,i,r,n,a){o(r)?t.push(xi,e,s,i):(o(r)&&(r=0),o(n)&&(n=360),t.push(mi,e,s,i,r,n,a?1:0))},arcTo(t,e,s,i,r,o,a,h,l){if(!n(a)){const t=vi(a,h,e,s,i,r)/(l?1:2);o=Si(o,Si(t,t*Bi(ki(bi(a,h,e,s,i,r)/2))))}t.push(wi,e,s,i,r,o)},drawEllipse(t,e,s,i,r,n,a,h,l){ds.ellipse(null,e,s,i,r,o(n)?0:n,o(a)?0:a,o(h)?360:h,l,null,null,Ci),t.push(hi,Ci.x,Ci.y),Ti(t,e,s,i,r,n,a,h,l)},drawArc(t,e,s,i,r,n,a){ds.arc(null,e,s,i,o(r)?0:r,o(n)?360:n,a,null,null,Ci),t.push(hi,Ci.x,Ci.y),Li(t,e,s,i,r,n,a)},drawPoints(t,e,s,i,r){let n="Q";_(s)&&(n=s.type,s=s.value),Oi[n]||(Ri.warn("not found:",n),n="Q"),Oi[n](t,e,s,i,r)}},{ellipse:Ti,arc:Li,pointsCurveList:Oi}=Pi;function Ei(t,e){Oi[t]&&Ri.repeat(t),Oi[t]=e}Ei("Q",ds.points);const{moveTo:Ai,lineTo:Ii,quadraticCurveTo:Mi,bezierCurveTo:Wi,closePath:Di,beginPath:Fi,rect:zi,roundRect:Ni,ellipse:Yi,arc:Xi,arcTo:Ui,drawEllipse:ji,drawArc:Vi,drawPoints:Gi}=Pi;class qi{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?a(t)?Me.parse(t):t:[],this}beginPath(){return Fi(this.__path),this.paint(),this}moveTo(t,e){return Ai(this.__path,t,e),this.paint(),this}lineTo(t,e){return Ii(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,i,r,n){return Wi(this.__path,t,e,s,i,r,n),this.paint(),this}quadraticCurveTo(t,e,s,i){return Mi(this.__path,t,e,s,i),this.paint(),this}closePath(){return Di(this.__path),this.paint(),this}rect(t,e,s,i){return zi(this.__path,t,e,s,i),this.paint(),this}roundRect(t,e,s,i,r){return Ni(this.__path,t,e,s,i,r),this.paint(),this}ellipse(t,e,s,i,r,n,o,a){return Yi(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}arc(t,e,s,i,r,n){return Xi(this.__path,t,e,s,i,r,n),this.paint(),this}arcTo(t,e,s,i,r){return Ui(this.__path,t,e,s,i,r),this.paint(),this}drawEllipse(t,e,s,i,r,n,o,a){return ji(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}drawArc(t,e,s,i,r,n){return Vi(this.__path,t,e,s,i,r,n),this.paint(),this}drawPoints(t,e,s){return Gi(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:Hi,L:Qi,C:Ji,Q:$i,Z:Zi,N:Ki,D:tr,X:er,G:sr,F:ir,O:rr,P:nr,U:or}=De,ar=ne.get("PathDrawer"),hr={drawPathByData(t,e){if(!e)return;let s,i=0,r=e.length;for(;i<r;)switch(s=e[i],s){case Hi:t.moveTo(e[i+1],e[i+2]),i+=3;break;case Qi:t.lineTo(e[i+1],e[i+2]),i+=3;break;case Ji:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case $i:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Zi:t.closePath(),i+=1;break;case Ki:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case tr:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],[e[i+5],e[i+6],e[i+7],e[i+8]]),i+=9;break;case er:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case sr:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*z,e[i+6]*z,e[i+7]*z,e[i+8]),i+=9;break;case ir:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,N,!1),i+=5;break;case rr:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*z,e[i+5]*z,e[i+6]),i+=7;break;case nr:t.arc(e[i+1],e[i+2],e[i+3],0,N,!1),i+=4;break;case or:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void ar.error(`command: ${s} [index:${i}]`,e)}},drawPathByPoints(t,e,s){}},{M:lr,L:dr,C:cr,Q:ur,Z:_r,N:pr,D:gr,X:fr,G:yr,F:mr,O:xr,P:wr,U:vr}=De,{toTwoPointBounds:br,toTwoPointBoundsByQuadraticCurve:kr,arcTo:Sr,arc:Br,ellipse:Cr}=ds,{addPointBounds:Rr,copy:Pr,addPoint:Tr,setPoint:Lr,addBounds:Or,toBounds:Er}=wt,Ar=ne.get("PathBounds");let Ir,Mr,Wr;const Dr={},Fr={},zr={},Nr={toBounds(t,e){Nr.toTwoPointBounds(t,Fr),Er(Fr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Lr(e,0,0);let s,i,r,n,o,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(o=t[a],0===a&&(o===_r||o===cr||o===ur?Lr(e,h,l):Lr(e,t[a+1],t[a+2])),o){case lr:case dr:h=t[a+1],l=t[a+2],Tr(e,h,l),a+=3;break;case cr:r=t[a+5],n=t[a+6],br(h,l,t[a+1],t[a+2],t[a+3],t[a+4],r,n,Dr),Rr(e,Dr),h=r,l=n,a+=7;break;case ur:s=t[a+1],i=t[a+2],r=t[a+3],n=t[a+4],kr(h,l,s,i,r,n,Dr),Rr(e,Dr),h=r,l=n,a+=5;break;case _r:a+=1;break;case pr:h=t[a+1],l=t[a+2],Or(e,h,l,t[a+3],t[a+4]),a+=5;break;case gr:case fr:h=t[a+1],l=t[a+2],Or(e,h,l,t[a+3],t[a+4]),a+=o===gr?9:6;break;case yr:Cr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],Dr,zr),0===a?Pr(e,Dr):Rr(e,Dr),h=zr.x,l=zr.y,a+=9;break;case mr:h=t[a+1],l=t[a+2],Mr=t[a+3],Wr=t[a+4],Or(e,h-Mr,l-Wr,2*Mr,2*Wr),h+=Mr,a+=5;break;case xr:Br(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Dr,zr),0===a?Pr(e,Dr):Rr(e,Dr),h=zr.x,l=zr.y,a+=7;break;case wr:h=t[a+1],l=t[a+2],Ir=t[a+3],Or(e,h-Ir,l-Ir,2*Ir,2*Ir),h+=Ir,a+=4;break;case vr:Sr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Dr,zr),0===a?Pr(e,Dr):Rr(e,Dr),h=zr.x,l=zr.y,a+=6;break;default:return void Ar.error(`command: ${o} [index:${a}]`,t)}}},{M:Yr,L:Xr,Z:Ur}=De,{getCenterX:jr,getCenterY:Vr}=dt,{arcTo:Gr}=Pi,{float:qr}=D,Hr={smooth(t,e,s){let i,r,n,o,a,h,l=0,d=0,c=0,_=0,p=0,g=0,f=0,y=0,m=0;u(e)&&(e=e[0]||0);const x=t.length,w=9===x,v=[];for(;l<x;){switch(i=t[l],i){case Yr:h=v.length,h&&r!==Ur&&(v[o]=_,v[a]=p),_=y=t[l+1],p=m=t[l+2],l+=3,t[l]===Xr?(g=t[l+1],f=t[l+2],w?v.push(Yr,_,p):v.push(Yr,jr(_,g),Vr(p,f))):v.push(Yr,_,p),o=h+1,a=h+2;break;case Xr:switch(d=t[l+1],c=t[l+2],l+=3,t[l]){case Xr:Gr(v,d,c,t[l+1],t[l+2],e,y,m,w);break;case Ur:qr(d)===qr(_)&&qr(c)===qr(p)?(d=y,c=m):Gr(v,d,c,_,p,e,y,m,w);break;default:v.push(Xr,d,c)}y=d,m=c;break;case Ur:r!==Ur&&(Gr(v,_,p,g,f,e,y,m,w),v.push(Ur)),l+=1;break;default:n=Ue[i];for(let e=0;e<n;e++)v.push(t[l+e]);l+=n}r=i}return i!==Ur&&(v[o]=_,v[a]=p),v}};function Qr(t){return new qi(t)}const Jr=Qr();Me.creator=Qr(),Me.parse=ri.parse,Me.convertToCanvasData=ri.toCanvasData;const{drawRoundRect:$r}=je;function Zr(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,i,r){$r(this,t,e,s,i,r)})}(t)}const Kr={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mimeType:(t,e="image")=>!t||t.startsWith(e)?t:("jpg"===t&&(t="jpeg"),e+"/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=tn.fileType(t);return["jpg","jpeg"].some(t=>t===e)},getExportOptions(t){switch(typeof t){case"object":return t;case"number":return{quality:t};case"boolean":return{blob:t};default:return{}}}},tn=Kr;tn.mineType=tn.mimeType,tn.alphaPixelTypes.forEach(t=>tn.upperCaseTypeMap[t]=t.toUpperCase());const en=ne.get("TaskProcessor");class sn{constructor(t){this.parallel=!0,this.time=1,this.id=x.create(x.TASK),this.task=t}run(){return i(this,void 0,void 0,function*(){try{if(this.isComplete||this.runing)return;if(this.runing=!0,this.canUse&&!this.canUse())return this.cancel();this.task&&(yield this.task())}catch(t){en.error(t)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}}class rn{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(e=s)):e+=this.list[i].time;return this.isComplete?1:s/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&f.assign(this.config,t),this.empty()}add(t,e,s){let i,r,o,a;const h=new sn(t);return h.parent=this,l(e)?a=e:e&&(r=e.parallel,i=e.start,o=e.time,a=e.delay,s||(s=e.canUse)),o&&(h.time=o),!1===r&&(h.parallel=!1),s&&(h.canUse=s),n(a)?this.push(h,i):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(h,i))},a)),this.isComplete=!1,h}push(t,e){this.list.push(t),!1===e||this.timer||(this.timer=setTimeout(()=>this.start()))}empty(){this.index=0,this.parallelSuccessNumber=0,this.list=[],this.parallelList=[],this.delayNumber=0}start(){this.running||(this.running=!0,this.isComplete=!1,this.run())}pause(){clearTimeout(this.timer),this.timer=null,this.running=!1}resume(){this.start()}skip(){this.index++,this.resume()}stop(){this.isComplete=!0,this.list.forEach(t=>{t.isComplete||t.run()}),this.pause(),this.empty()}run(){this.running&&(this.setParallelList(),this.parallelList.length>1?this.runParallelTasks():this.remain?this.runTask():this.onComplete())}runTask(){const t=this.list[this.index];t?t.run().then(()=>{this.onTask(t),this.index++,t.isCancel?this.runTask():this.nextTask()}).catch(t=>{this.onError(t)}):this.timer=setTimeout(()=>this.nextTask())}runParallelTasks(){this.parallelList.forEach(t=>this.runParallelTask(t))}runParallelTask(t){t.run().then(()=>{this.onTask(t),this.fillParallelTask()}).catch(t=>{this.onParallelError(t)})}nextTask(){this.total===this.finishedIndex?this.onComplete():this.timer=setTimeout(()=>this.run())}setParallelList(){let t;const{config:e,list:s,index:i}=this;this.parallelList=[],this.parallelSuccessNumber=0;let r=i+e.parallel;if(r>s.length&&(r=s.length),e.parallel>1)for(let e=i;e<r&&(t=s[e],t.parallel);e++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const s=e.length,i=this.finishedIndex+s;if(e.length){if(!this.running)return;i<this.total&&(t=this.list[i],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach(t=>{t.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}}const nn=ne.get("Resource"),on={tasker:new rn,queue:new rn({parallel:1}),map:{},get isComplete(){return an.tasker.isComplete},set(t,e){an.map[t]&&nn.repeat(t),an.map[t]=e},get:t=>an.map[t],remove(t){const e=an.map[t];e&&(e.destroy&&e.destroy(),delete an.map[t])},loadImage(t,e){return new Promise((s,i)=>{const r=this.setImage(t,t,e);r.load(()=>s(r),t=>i(t))})},setImage(t,e,s){let i;return a(e)?i={url:e}:e.url||(i={url:t,view:e}),i&&(s&&(i.format=s),e=_e.image(i)),an.set(t,e),e},loadFilm(t,e){},loadVideo(t,e){},destroy(){an.map={}}},an=on,hn={maxRecycled:10,recycledList:[],patternTasker:on.queue,get(t,e){let s=on.get(t.url);return s||on.set(t.url,s=_e[e||"image"](t)),s.use++,s},recycle(t){t.parent&&(t=t.parent),t.use--,setTimeout(()=>{t.use||(se.image.isLarge(t)?t.url&&on.remove(t.url):(t.clearLevels(),ln.recycledList.push(t)))})},recyclePaint(t){ln.recycle(t.image)},clearRecycled(t){const e=ln.recycledList;(e.length>ln.maxRecycled||t)&&(e.forEach(e=>(!e.use||t)&&e.url&&on.remove(e.url)),e.length=0)},clearLevels(){},hasAlphaPixel:t=>Kr.alphaPixelTypes.some(e=>ln.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+Kr.mimeType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+Kr.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){this.clearRecycled(!0)}},ln=hn,{IMAGE:dn,create:cn}=x;class un{get tag(){return"Image"}get url(){return this.config.url}get crossOrigin(){const{crossOrigin:t}=this.config;return n(t)?se.image.crossOrigin:t}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=cn(dn),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}hn.isFormat("svg",t)&&(this.isSVG=!0),hn.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e,s){return this.loading||(this.loading=!0,on.tasker.add(()=>i(this,void 0,void 0,function*(){return yield se.origin["load"+this.tag](this.getLoadUrl(s),this.crossOrigin,this).then(t=>{s&&this.setThumbView(t),this.setView(t)}).catch(t=>{this.error=t,this.onComplete(!1)})}))),this.waitComplete.push(t,e),this.waitComplete.length-2}unload(t,e){const s=this.waitComplete;if(e){const e=s[t+1];e&&e({type:"stop"})}s[t]=s[t+1]=void 0}setView(t){this.ready=!0,this.width||(this.width=t.width,this.height=t.height,this.view=t),this.onComplete(!0)}onComplete(t){let e;this.waitComplete.forEach((s,i)=>{e=i%2,s&&(t?e||s(this):e&&s(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,s,i,r,n,o,a){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let s in t)if(t[s]!==arguments[s]){e=null;break}if(e)return e}const h=se.image.resize(this.view,t,e,r,n,void 0,o,s,i,a);return this.cache=this.use>1?{data:h,params:arguments}:null,h}getPattern(t,e,s,i){const r=se.canvas.createPattern(t,e);return se.image.setPatternTransform(r,s,i),r}render(t,e,s,i,r,n,o,a,h){t.drawImage(this.view,e,s,i,r)}getLoadUrl(t){return this.url}setThumbView(t){}getThumbSize(t){}getMinLevel(){}getLevelData(t,e,s){}clearLevels(t){}destroyFilter(){}destroy(){this.clearLevels(),this.destroyFilter();const{view:t}=this;t&&t.close&&t.close(),this.config={url:""},this.cache=this.view=null,this.waitComplete.length=0}}class _n extends un{get tag(){return"Film"}}class pn extends un{get tag(){return"Video"}}function gn(t,e,s,i){i||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function fn(t,e){return Object.getOwnPropertyDescriptor(t,e)}function yn(t,e){const s="_"+t;return{get(){const t=this[s];return null==t?e:t},set(t){this[s]=t}}}function mn(t,e){return(s,i)=>wn(s,i,t,e&&e(i))}function xn(t){return t}function wn(t,e,s,i){const r={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};gn(t,e,Object.assign(r,i||{})),Kn(t,e,s)}function vn(t){return mn(t)}function bn(t,e){return mn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function kn(t,e){return mn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function Sn(t){return mn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),Tn(this))}}))}function Bn(t,e){return mn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function Cn(t,e){return mn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function Rn(t,e){return mn(t,t=>({set(s){this.__setAttr(t,s,e)&&Tn(this)}}))}function Pn(t){return mn(t,t=>({set(e){this.__setAttr(t,e)&&(Tn(this),this.__.__removeNaturalSize())}}))}function Tn(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function Ln(t){return mn(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),Tn(this)}}))}const On=Rn;function En(t,e){return mn(t,t=>({set(s){this.__setAttr(t,s)&&(An(this),e&&(this.__.__useStroke=!0))}}))}function An(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&Tn(t)}const In=En;function Mn(t){return mn(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Wn(t){return mn(t,t=>({set(e){this.__setAttr(t,e)&&Dn(this)}}))}function Dn(t){t.__layout.surfaceChanged||t.__layout.surfaceChange()}function Fn(t){return mn(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;f.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip)}}}))}function zn(t){return mn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&Yn(this)}}))}function Nn(t){return mn(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>Xn(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");Xn(this,t,e,s),this.mask&&Yn(this)}}))}function Yn(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function Xn(t,e,s,i){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==s||Tn(t))}function Un(t){t.__layout.childrenSortChange(),t.__.flow&&t.__layout.boxChange()}function jn(t){return mn(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParentChange(Un)}}))}function Vn(t){t.__updateMask()}function Gn(t,e){return mn(t,t=>({set(s){this.__setAttr(t,s)&&(this.__layout.boxChanged||this.__layout.boxChange(),e?this.__updateMask():this.waitParentChange(Vn))}}))}function qn(t){t.__updateEraser()}function Hn(t){return mn(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParentChange(qn)}}))}function Qn(t){return mn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,this.leafer&&this.leafer.updateCursor())}}))}function Jn(t){return mn(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function $n(t){return(e,s)=>{gn(e,"__DataProcessor",{get:()=>t})}}function Zn(t){return(e,s)=>{gn(e,"__LayoutProcessor",{get:()=>t})}}function Kn(t,e,s){const i=t.__DataProcessor.prototype,r="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=yn(e,s);if(n(s))a.get=function(){return this[r]};else if("function"==typeof s)a.get=function(){const t=this[r];return null==t?s(this.__leaf):t};else if(_(s)){const t=g(s);a.get=function(){const e=this[r];return null==e?this[r]=t?{}:f.clone(s):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[r];if(null==t){const t=this,e=t.__naturalWidth,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&i.children.length?i.boxBounds.width:s}return t}:"height"===e&&(a.get=function(){const t=this[r];if(null==t){const t=this,e=t.__naturalHeight,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&i.children.length?i.boxBounds.height:s}return t});let l,d=i;for(;!l&&d;)l=fn(d,e),d=d.__proto__;l&&l.set&&(a.set=l.set),i[o]&&(a.set=i[o],delete i[o]),gn(i,e,a)}const to=new ne("rewrite"),eo=[],so=["destroy","constructor"];function io(t){return(e,s)=>{eo.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function ro(){return t=>{no()}}function no(t){eo.length&&(eo.forEach(e=>{t&&to.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),eo.length=0)}function oo(t,e){return s=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach(i=>{if(!(so.includes(i)||e&&e.includes(i)))if(t.prototype){const e=fn(t.prototype,i);e&&Object.defineProperty(s.prototype,i,e)}else s.prototype[i]=t[i]})}}function ao(){return t=>{ge.register(t)}}function ho(){return t=>{me.register(t)}}setTimeout(()=>no(!0));const{copy:lo,toInnerPoint:co,toOuterPoint:uo,scaleOfOuter:_o,rotateOfOuter:po,skewOfOuter:go,multiplyParent:fo,divideParent:yo,getLayout:mo}=Z,xo={},{round:wo}=Math,vo={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),Bo(t,e,s),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)So(i[t],e,s)}},updateMatrix(t,e,s){const i=t.__layout;e?s&&(i.waitAutoLayout=!0,t.__hasAutoLayout&&(i.matrixChanged=!1)):i.waitAutoLayout&&(i.waitAutoLayout=!1),i.matrixChanged&&t.__updateLocalMatrix(),i.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t,e){const s=t.__layout;s.boundsChanged&&t.__updateLocalBounds(),e&&(s.resized=void 0),s.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Co(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&Co(t),t.__updateChange(),e.surfaceChanged&&(t.__hasComplex&&ko.updateComplex(t),e.surfaceChanged=!1)},updateAllChange(t){if(Po(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Ro(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},draggable:t=>(t.draggable||t.editable)&&t.hitSelf&&!t.locked,copyCanvasByWorld(t,e,s,i,r,n){i||(i=t.__nowWorld),t.__worldFlipped||se.fullImageShadow?e.copyWorldByReset(s,i,t.__nowWorld,r,n):e.copyWorldToInner(s,i,t.__layout.renderBounds,r)},clip(t,e,s){t.__worldOpacity&&(e.setWorld(t.__nowWorld=t.__getNowWorld(s)),t.__drawRenderPath(e),e.clipUI(t))},renderComplex(t,e,s){},updateComplex(t){},checkComplex(t){},moveWorld(t,e,s=0,i,r){const n=_(e)?Object.assign({},e):{x:e,y:s};i?uo(t.localTransform,n,n,!0):t.parent&&co(t.parent.scrollWorldTransform,n,n,!0),ko.moveLocal(t,n.x,n.y,r)},moveLocal(t,e,s=0,i){_(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=wo(e),s=wo(s)),i?t.animate({x:e,y:s},i):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,i,r,n,o){ko.zoomOfLocal(t,To(t,e),s,i,r,n,o)},zoomOfLocal(t,e,s,i=s,r,n,o){const a=t.__localMatrix;if(l(i)||(i&&(n=i),i=s),lo(xo,a),_o(xo,e,s,i),ko.hasHighPosition(t))ko.setTransform(t,xo,r,n,o);else{const e=t.x+xo.e-a.e,h=t.y+xo.f-a.f;n&&!r?t.animate({x:e,y:h,scaleX:t.scaleX*s,scaleY:t.scaleY*i},n):(t.x=e,t.y=h,t.scaleResize(s,i,!0!==r,o))}},rotateOfWorld(t,e,s,i){ko.rotateOfLocal(t,To(t,e),s,i)},rotateOfLocal(t,e,s,i){const r=t.__localMatrix;lo(xo,r),po(xo,e,s),ko.hasHighPosition(t)?ko.setTransform(t,xo,!1,i):t.set({x:t.x+xo.e-r.e,y:t.y+xo.f-r.f,rotation:D.formatRotation(t.rotation+s)},i)},skewOfWorld(t,e,s,i,r,n){ko.skewOfLocal(t,To(t,e),s,i,r,n)},skewOfLocal(t,e,s,i=0,r,n){lo(xo,t.__localMatrix),go(xo,e,s,i),ko.setTransform(t,xo,r,n)},transformWorld(t,e,s,i,r){lo(xo,t.worldTransform),fo(xo,e),t.parent&&yo(xo,t.parent.scrollWorldTransform),ko.setTransform(t,xo,s,i,r)},transform(t,e,s,i,r){lo(xo,t.localTransform),fo(xo,e),ko.setTransform(t,xo,s,i,r)},setTransform(t,e,s,i,r){const n=t.__,o=n.origin&&ko.getInnerOrigin(t,n.origin),a=mo(e,o,n.around&&ko.getInnerOrigin(t,n.around));if(ko.hasOffset(t)&&(a.x-=n.offsetX,a.y-=n.offsetY),s){const e=a.scaleX/t.scaleX,s=a.scaleY/t.scaleY;if(delete a.scaleX,delete a.scaleY,o){Vt.scale(t.boxBounds,Math.abs(e),Math.abs(s));const i=ko.getInnerOrigin(t,n.origin);dt.move(a,o.x-i.x,o.y-i.y)}t.set(a),t.scaleResize(e,s,!1,r)}else t.set(a,i)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return _o(s,ko.getLocalOrigin(t,"center"),-1*i,1*i),s},getLocalOrigin:(t,e)=>dt.tempToOuterOf(ko.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return Bt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(lo(xo,t.worldTransform),yo(xo,e.scrollWorldTransform),s?xo:Object.assign({},xo)),updateScaleFixedWorld(t){},updateOuterBounds(t){},cacheId(t){},drop(t,e,s,i){t.setTransform(ko.getRelativeWorld(t,e,!0),i),e.add(t,s)},hasHighPosition:t=>t.origin||t.around||ko.hasOffset(t),hasOffset:t=>t.offsetX||t.offsetY,hasParent(t,e,s){if(!e)return!1;for(;t;){if(e===t)return!0;if(s&&t.__level===s)return;t=t.parent}},animateMove(t,e,s=.3,i){if(e.x||e.y){if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const r=e.x*s,n=e.y*s;e.x-=r,e.y-=n,t.move(r,n),se.requestRender(()=>ko.animateMove(t,e,s,i))}i&&i()}}};function bo(t){return t&&t.config.trackChanges}const ko=vo,{updateAllMatrix:So,updateMatrix:Bo,updateAllWorldOpacity:Co,updateAllChange:Ro,updateChange:Po}=ko;function To(t,e){return t.updateLayout(),t.parent?dt.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const Lo={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds(t){const{__:e,__layout:s}=t;return e.eraser||0===e.visible?null:s.localOuterBounds||s.localRenderBounds},maskLocalBoxBounds:(t,e)=>Eo(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>Eo(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds(t,e){const{__layout:s}=t;return Eo(t,e)&&(s.localOuterBounds||s.localRenderBounds)},excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};let Oo;function Eo(t,e){return e||(Oo=0),t.__.mask&&(Oo=1),Oo<0?null:(Oo&&(Oo=-1),!0)}const{updateBounds:Ao}=vo,Io={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,zIndex(t,e,s){const{children:i}=t,r=i[s-1],n=i[s];r&&n?(e.zIndex<r.zIndex||e.zIndex>n.zIndex)&&(e.zIndex=(r.zIndex+n.zIndex)/2):r?e.zIndex<r.zIndex&&(e.zIndex=r.zIndex+1):n&&e.zIndex>n.zIndex&&(e.zIndex=n.zIndex-1)},pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:s}=t;for(let i=0,r=s.length;i<r;i++)(t=s[i]).isBranch&&(t.__tempNumber=1,e.add(t),Mo(t,e))}},pushAllParent(t,e){const{keys:s}=e;if(s)for(;t.parent&&n(s[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let s=e.length;const{children:i}=t;for(let t=0,s=i.length;t<s;t++)i[t].isBranch&&e.push(i[t]);for(let t=s,i=e.length;t<i;t++)Wo(e[t],e)},updateBounds(t,e){const s=[t];Wo(t,s),Do(s,e)},updateBoundsByBranchStack(t,e){let s,i;for(let r=t.length-1;r>-1;r--){s=t[r],i=s.children;for(let t=0,e=i.length;t<e;t++)Ao(i[t]);e&&e===s||Ao(s)}},move(t,e,s){let i;const{children:r}=t;for(let n=0,o=r.length;n<o;n++)i=(t=r[n]).__world,i.e+=e,i.f+=s,i.x+=e,i.y+=s,t.isBranch&&Fo(t,e,s)},scale(t,e,s,i,r,n,o){let a;const{children:h}=t,l=i-1,d=r-1;for(let c=0,u=h.length;c<u;c++)a=(t=h[c]).__world,a.a*=i,a.d*=r,(a.b||a.c)&&(a.b*=i,a.c*=r),a.e===a.x&&a.f===a.y?(a.x=a.e+=(a.e-n)*l+e,a.y=a.f+=(a.f-o)*d+s):(a.e+=(a.e-n)*l+e,a.f+=(a.f-o)*d+s,a.x+=(a.x-n)*l+e,a.y+=(a.y-o)*d+s),a.width*=i,a.height*=r,a.scaleX*=i,a.scaleY*=r,t.isBranch&&zo(t,e,s,i,r,n,o)}},{pushAllChildBranch:Mo,pushAllBranchStack:Wo,updateBoundsByBranchStack:Do,move:Fo,scale:zo}=Io,No={run(t){if(t&&t.length){const e=t.length;for(let s=0;s<e;s++)t[s]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:Yo,updateBounds:Xo}=vo,{toOuterOf:Uo,getPoints:jo,copy:Vo}=Vt,Go="_localContentBounds",qo="_worldContentBounds",Ho="_worldBoxBounds",Qo="_worldStrokeBounds";class Jo{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return Uo(this.contentBounds,this.leaf.__localMatrix,this[Go]||(this[Go]={})),this[Go]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return Uo(this.contentBounds,this.leaf.__world,this[qo]||(this[qo]={})),this[qo]}get worldBoxBounds(){return Uo(this.boxBounds,this.leaf.__world,this[Ho]||(this[Ho]={})),this[Ho]}get worldStrokeBounds(){return Uo(this.strokeBounds,this.leaf.__world,this[Qo]||(this[Qo]={})),this[Qo]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:e}=t;if(t.isApp)return Xo(t);if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=t;for(;e.parent&&!e.parent.leafer;)e=e.parent;const s=e;if(s.__fullLayouting)return;s.__fullLayouting=!0,se.layout(s),delete s.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return Z.defaultMatrix;case"page":t=e.zoomLayer;default:return Yo(e,t)}}getBounds(t,e="world"){switch(this.update(),e){case"world":return this.getWorldBounds(t);case"local":return this.getLocalBounds(t);case"inner":return this.getInnerBounds(t);case"page":e=this.leaf.zoomLayer;default:return new Qt(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",s){const{leaf:i}=this;let r,n,o,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),n=i.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=i.__;o={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},r=i.getLocalPointByInner(a);break;case"inner":r=a,n=Z.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),n=Yo(i,e,!0)}if(o||(o=Z.getLayout(n)),Vo(o,a),dt.copy(o,r),s){const{scaleX:t,scaleY:e}=o,s=Math.abs(t),i=Math.abs(e);1===s&&1===i||(o.scaleX/=s,o.scaleY/=i,o.width*=s,o.height*=i)}return o}getLayoutPoints(t,e="world"){const{leaf:s}=this,i=jo(this.getInnerBounds(t));let r;switch(e){case"world":r=null;break;case"local":r=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:r=e}return n(r)||i.forEach(t=>s.innerToWorld(t,null,!1,r)),i}shrinkContent(){const{x:t,y:e,width:s,height:i}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:i}}spreadStroke(){const{x:t,y:e,width:s,height:i}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:i},this._localStrokeBounds={x:t,y:e,width:s,height:i},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:i}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:i},this._localRenderBounds={x:t,y:e,width:s,height:i}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class $o{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&se.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&se.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&se.event.stop(this.origin)}}class Zo extends $o{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}Zo.ADD="child.add",Zo.REMOVE="child.remove",Zo.CREATED="created",Zo.MOUNTED="mounted",Zo.UNMOUNTED="unmounted",Zo.DESTROY="destroy";const Ko="property.scroll";class ta extends $o{constructor(t,e,s,i,r){super(t,e),this.attrName=s,this.oldValue=i,this.newValue=r}}ta.CHANGE="property.change",ta.LEAFER_CHANGE="property.leafer_change",ta.SCROLL=Ko;const ea={scrollX:Ko,scrollY:Ko};class sa extends $o{constructor(t,e){super(t),Object.assign(this,e)}}sa.LOAD="image.load",sa.LOADED="image.loaded",sa.ERROR="image.error";class ia extends $o{static checkHas(t,e,s){"on"===s?e===aa?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(ra)||t.hasEvent(na)||t.hasEvent(oa),t.__hasWorldEvent=t.hasEvent(aa))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(ra,t),"inner"===e&&t.emit(na,t)),t.emit(oa,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(aa,t)}}ia.RESIZE="bounds.resize",ia.INNER="bounds.inner",ia.LOCAL="bounds.local",ia.WORLD="bounds.world";const{RESIZE:ra,INNER:na,LOCAL:oa,WORLD:aa}=ia,ha={};[ra,na,oa,aa].forEach(t=>ha[t]=1);class la extends $o{get bigger(){if(!this.old)return!0;const{width:t,height:e}=this.old;return this.width>=t&&this.height>=e}get smaller(){return!this.bigger}get samePixelRatio(){return!this.old||this.pixelRatio===this.old.pixelRatio}constructor(t,e){_(t)?(super(la.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!n(this.resizingKeys[t.innerId])}}la.RESIZE="resize";class da extends $o{constructor(t,e){super(t),this.data=e}}da.REQUEST="watch.request",da.DATA="watch.data";class ca extends $o{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}ca.REQUEST="layout.request",ca.START="layout.start",ca.BEFORE="layout.before",ca.LAYOUT="layout",ca.AFTER="layout.after",ca.AGAIN="layout.again",ca.END="layout.end";class ua extends $o{constructor(t,e,s,i){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=i)}}ua.REQUEST="render.request",ua.CHILD_START="render.child_start",ua.CHILD_END="render.child_end",ua.START="render.start",ua.BEFORE="render.before",ua.RENDER="render",ua.AFTER="render.after",ua.AGAIN="render.again",ua.END="render.end",ua.NEXT="render.next";class _a extends $o{}_a.START="leafer.start",_a.BEFORE_READY="leafer.before_ready",_a.READY="leafer.ready",_a.AFTER_READY="leafer.after_ready",_a.VIEW_READY="leafer.view_ready",_a.VIEW_COMPLETED="leafer.view_completed",_a.STOP="leafer.stop",_a.RESTART="leafer.restart",_a.END="leafer.end",_a.UPDATE_MODE="leafer.update_mode",_a.TRANSFORM="leafer.transform",_a.MOVE="leafer.move",_a.SCALE="leafer.scale",_a.ROTATE="leafer.rotate",_a.SKEW="leafer.skew";const{MOVE:pa,SCALE:ga,ROTATE:fa,SKEW:ya}=_a,ma={x:pa,y:pa,scaleX:ga,scaleY:ga,rotation:fa,skewX:ya,skewY:ya},xa={};class wa{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(u(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)u(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let i,r,n;s&&("once"===s?r=!0:"boolean"==typeof s?i=s:(i=s.capture,r=s.once));const o=va(this,i,!0),h=a(t)?t.split(" "):t,l=r?{listener:e,once:r}:{listener:e};h.forEach(t=>{t&&(n=o[t],n?-1===n.findIndex(t=>t.listener===e)&&n.push(l):o[t]=[l],ha[t]&&ia.checkHas(this,t,"on"))})}off(t,e,s){if(t){const i=a(t)?t.split(" "):t;if(e){let t,r,n;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const o=va(this,t);i.forEach(t=>{t&&(r=o[t],r&&(n=r.findIndex(t=>t.listener===e),n>-1&&r.splice(n,1),r.length||delete o[t],ha[t]&&ia.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;i.forEach(s=>{t&&delete t[s],e&&delete e[s]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,s,i){return e?this.on(t,s?e=e.bind(s):e,i):u(t)&&t.forEach(t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3])),{type:t,current:this,listener:e,options:i}}off_(t){if(!t)return;const e=u(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):u(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,s,i){if(!e)return u(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));_(s)?e=e.bind(s):i=s,this.on(t,e,{once:!0,capture:i})}emit(t,e,s){!e&&me.has(t)&&(e=me.get(t,{type:t,target:this,current:this}));const i=va(this,s)[t];if(i){let r;for(let n=0,o=i.length;n<o&&!((r=i[n])&&(r.listener(e),r.once&&(this.off(t,r.listener,s),n--,o--),e&&e.isStopNow));n++);}this.syncEventer&&this.syncEventer.emitEvent(e,s)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:s,__captureMap:i}=this,r=s&&s[t],o=i&&i[t];return!!(n(e)?r||o:e?o:r)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function va(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:xa)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:xa)}}const{on:ba,on_:ka,off:Sa,off_:Ba,once:Ca,emit:Ra,emitEvent:Pa,hasEvent:Ta,destroy:La}=wa.prototype,Oa={on:ba,on_:ka,off:Sa,off_:Ba,once:Ca,emit:Ra,emitEvent:Pa,hasEvent:Ta,destroyEventer:La},Ea=ne.get("setAttr"),Aa={__setAttr(t,e,s){if(this.leaferIsCreated){const i=this.__.__getInput(t);if(!s||h(e)||n(e)||(Ea.warn(this.innerName,t,e),e=void 0),_(e)||i!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new ta(ta.LEAFER_CHANGE,this,t,i,e));const s=ma[t];s&&(this.emitEvent(new _a(s,this)),this.emitEvent(new _a(_a.TRANSFORM,this)))}this.emitPropertyEvent(ta.CHANGE,t,i,e);const s=ea[t];return s&&this.emitPropertyEvent(s,t,i,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,s,i){const{leafer:r}=this;if(bo(r)||r.zoomLayer===this){const n=new ta(t,this,e,s,i);this.isLeafer||this.hasEvent(t)&&this.emitEvent(n),r.emitEvent(n)}else r.watcher.add(this)},__realSetAttr(t,e){const s=this.__;s[t]=e,this.__proxyData&&this.setProxyAttr(t,e),s.normalStyle&&(this.lockNormalStyle||n(s.normalStyle[t])||(s.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:Ia,multiplyParent:Ma,translateInner:Wa,defaultWorld:Da}=Z,{toPoint:Fa,tempPoint:za}=Bt,Na={__updateWorldMatrix(){const{parent:t,__layout:e,__world:s,__scrollWorld:i,__:r}=this;Ma(this.__local||e,t?t.__scrollWorld||t.__world:Da,s,!!e.affectScaleOrRotation,r),i&&Wa(Object.assign(i,s),r.scrollX,r.scrollY),e.scaleFixed&&vo.updateScaleFixedWorld(this)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(Ia(e,s,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=s.x+s.offsetX,e.f=s.y+s.offsetY,(s.around||s.origin)&&(Fa(s.around||s.origin,t.boxBounds,za),Wa(e,-za.x,-za.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:Ya,updateAllMatrix:Xa}=vo,{updateBounds:Ua}=Io,{toOuterOf:ja,copyAndSpread:Va,copy:Ga}=Vt,{toBounds:qa}=Nr,Ha={__updateWorldBounds(){const{__layout:t,__world:e}=this;ja(t.renderBounds,e,e),this.__hasComplex&&vo.checkComplex(this),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&ia.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&ia.emitWorld(this)},__updateLocalBounds(){const t=this.__layout,e=this.__;t.boxChanged&&(e.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&!t.strokeChanged&&(t.strokeChanged=!!t.boxChanged||2),t.renderSpread&&!t.renderChanged&&(t.renderChanged=!!t.boxChanged||2),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(2===t.strokeChanged?this.__updateLocalStrokeBounds():(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.resized="inner",(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0)),t.strokeChanged=void 0,this.parent&&this.parent.__layout.strokeChange()),t.renderChanged&&(2===t.renderChanged?this.__updateLocalRenderBounds():(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel()),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.outerScale&&vo.updateOuterBounds(this),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),ja(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){ja(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){ja(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const s=this.__layout.boxBounds,i=this.__;i.__usePathBox?qa(i.path,s):(s.x=0,s.y=0,s.width=i.width,s.height=i.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.childrenSortChanged&&this.__updateSortChildren(),this.__layout.boxChanged&&this.__updateFlowLayout(),Xa(this),Ua(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(Xa(this),Ua(this,this))):Ya(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;Va(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:s}=e;l(s)&&s<=0?Ga(e.renderBounds,e.strokeBounds):Va(e.renderBounds,e.boxBounds,s)}},Qa={__render(t,e){if(e.shape)return this.__renderShape(t,e);if((!e.cellList||e.cellList.has(this))&&this.__worldOpacity){const s=this.__;if(s.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.ignoreOpacity?1:e.dimOpacity&&!s.dimskip?s.opacity*e.dimOpacity:s.opacity,this.__.__single){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!0,!0);this.__draw(i,e,t),vo.copyCanvasByWorld(this,t,i,this.__nowWorld,s.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);ne.showBounds&&ne.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){vo.clip(this,t,e)},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Ja}=Lo,{hasSize:$a}=Vt,Za={__updateChange(){this.__layout.childrenSortChanged&&this.__updateSortChildren(),this.__.__checkSingle()},__render(t,e){const s=this.__nowWorld=this.__getNowWorld(e);if(this.__worldOpacity&&$a(s)){const i=this.__;if(i.__useDim){if(i.bright&&!e.topRendering)return e.topList.add(this);i.dim?e.dimOpacity=!0===i.dim?.2:i.dim:i.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(i.__single&&!this.isBranchLeaf){if("path"===i.eraser)return this.__renderEraser(t,e);const r=t.getSameCanvas(!1,!0);this.__renderBranch(r,e),t.opacity=e.ignoreOpacity?1:e.dimOpacity?i.opacity*e.dimOpacity:i.opacity,t.copyWorldByReset(r,s,s,i.__blendMode,!0),r.recycle(s)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{let s;const{children:i}=this;for(let r=0,n=i.length;r<n;r++)s=i[r],Ja(s,e)||(s.__hasComplex?vo.renderComplex(s,t,e):s.__render(t,e));0===this.__hasMask&&this.__rerenderMask(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Ja(s[i],e)||s[i].__clip(t,e)}}},{LEAF:Ka,create:th}=x,{stintSet:eh}=f,{toInnerPoint:sh,toOuterPoint:ih,multiplyParent:rh}=Z,{toOuterOf:nh}=Vt,{copy:oh,move:ah}=dt,{getScaleFixedData:hh}=D,{moveLocal:lh,zoomOfLocal:dh,rotateOfLocal:ch,skewOfLocal:uh,moveWorld:_h,zoomOfWorld:ph,rotateOfWorld:gh,skewOfWorld:fh,transform:yh,transformWorld:mh,setTransform:xh,getFlipTransform:wh,getLocalOrigin:vh,getRelativeWorld:bh,drop:kh}=vo;let Sh=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return m}get __LayoutProcessor(){return Jo}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isFrame(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get scrollWorldTransform(){return this.updateLayout(),this.__scrollWorld||this.__world}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.updateLayout(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=th(Ka),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(Zo.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParentChange(t){this.__parentChange||(this.__parentChange=[]),this.__parentChange.includes(t)||this.__parentChange.push(t),this.parent&&t(this.parent,this)}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(Zo.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(Zo.MOUNTED,t,"once")}nextRender(t,e,s){this.leafer?this.leafer.nextRender(t,e,s):this.waitLeafer(()=>this.leafer.nextRender(t,e,s))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(Zo.MOUNTED),t.cacheId&&vo.cacheId(this)):this.__emitLifeEvent(Zo.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,i=e.length;s<i;s++)e[s].__bindLeafer(t)}}__bindFrame(t){if(this.frame=t,this.isBranch){const{children:e}=this;for(let s=0,i=e.length;s<i;s++)e[s].__bindFrame(t)}}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}scaleResize(t,e=t,s,i){this.scaleX*=t,this.scaleY*=e}updateLayout(){this.__layout.update()}forceUpdate(t){let e;if(this.__hasComplex&&vo.updateComplex(this),t&&"bounds"!==t?"surface"===t?(Dn(this),e=!0):"stroke"===t&&(An(this),e=!0):(Tn(this),e=!0),e){const{leafer:t}=this;return t&&t.watcher&&t.watcher.__onAttrChange({target:this})}const s=this.__.__getInput(t);this.__[t]=n(s)?null:void 0,this[t]=s}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateEraser(){this.__hasEraser=this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:s}=this.__layout;t.clearRect(s.x,s.y,s.width,s.height),t.restore()}__updateMask(){const t=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity);this.__hasMask=this.__.maskskip?t&&0:t}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,s=this.__world;return rh(s,t.matrix,e,void 0,s),nh(this.__layout.renderBounds,e,e),eh(e,"half",s.half),eh(e,"ignorePixelSnap",s.ignorePixelSnap),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e,s=!0){return hh(hn.patternLocked?this.__world:this.__nowWorld||this.__world,e,s,t)}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,s){return this.__layout.getLayoutBounds(t,e,s)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,s){const i=e?bh(this,e):this.worldTransform,r=s?t:{};return nh(t,i,r),r}worldToLocal(t,e,s,i){this.parent?this.parent.worldToInner(t,e,s,i):e&&oh(e,t)}localToWorld(t,e,s,i){this.parent?this.parent.innerToWorld(t,e,s,i):e&&oh(e,t)}worldToInner(t,e,s,i){i&&(i.innerToWorld(t,e,s),t=e||t),sh(this.worldTransform,t,e,s)}innerToWorld(t,e,s,i){ih(this.worldTransform,t,e,s),i&&i.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,i){const r=this.getInnerPoint(t,e,s,i);return s?r:this.getBoxPointByInner(r,null,null,!0)}getBoxPointByInner(t,e,s,i){const r=i?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return ah(r,-n,-o),r}getInnerPoint(t,e,s,i){const r=i?t:{};return this.worldToInner(t,r,s,e),r}getInnerPointByBox(t,e,s,i){const r=i?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return ah(r,n,o),r}getInnerPointByLocal(t,e,s,i){return this.getInnerPoint(t,this.parent,s,i)}getLocalPoint(t,e,s,i){const r=i?t:{};return this.worldToLocal(t,r,s,e),r}getLocalPointByInner(t,e,s,i){return this.getWorldPoint(t,this.parent,s,i)}getPagePoint(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,i)}getWorldPoint(t,e,s,i){const r=i?t:{};return this.innerToWorld(t,r,s,e),r}getWorldPointByBox(t,e,s,i){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,i),e,s,!0)}getWorldPointByLocal(t,e,s,i){const r=i?t:{};return this.localToWorld(t,r,s,e),r}getWorldPointByPage(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,i)}setTransform(t,e,s,i){xh(this,t,e,s,i)}transform(t,e,s,i){yh(this,t,e,s,i)}move(t,e,s){lh(this,t,e,s)}moveInner(t,e,s){_h(this,t,e,!0,s)}scaleOf(t,e,s,i,r,n){dh(this,vh(this,t),e,s,i,r,n)}rotateOf(t,e,s){ch(this,vh(this,t),e,s)}skewOf(t,e,s,i,r){uh(this,vh(this,t),e,s,i,r)}transformWorld(t,e,s,i){mh(this,t,e,s,i)}moveWorld(t,e,s){_h(this,t,e,!1,s)}scaleOfWorld(t,e,s,i,r,n){ph(this,t,e,s,i,r,n)}rotateOfWorld(t,e){gh(this,t,e)}skewOfWorld(t,e,s,i,r){fh(this,t,e,s,i,r)}flip(t,e){yh(this,wh(this,t),!1,e)}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){kh(this,t,e,s)}static changeAttr(t,e,s){s?this.addAttr(t,e,s):Kn(this.prototype,t,e)}static addAttr(t,e,s,i){s||(s=Rn),s(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new Zo(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(Zo.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};Sh=s([oo(Aa),oo(Na),oo(Ha),oo(Oa),oo(Qa)],Sh);const{setListWithFn:Bh}=Vt,{sort:Ch}=Io,{localBoxBounds:Rh,localStrokeBounds:Ph,localRenderBounds:Th,maskLocalBoxBounds:Lh,maskLocalStrokeBounds:Oh,maskLocalRenderBounds:Eh}=Lo,Ah=new ne("Branch");let Ih=class extends Sh{__updateStrokeSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){let t;const{children:e}=this;for(let s=0,i=e.length;s<i;s++)if(t=e[s].__layout,t.renderSpread||t.localOuterBounds)return 1;return 0}__updateBoxBounds(t,e){Bh(e||this.__layout.boxBounds,this.children,this.__hasMask?Lh:Rh)}__updateStrokeBounds(t){Bh(t||this.__layout.strokeBounds,this.children,this.__hasMask?Oh:Ph)}__updateRenderBounds(t){Bh(t||this.__layout.renderBounds,this.children,this.__hasMask?Eh:Th)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,i=e.length;s<i;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(Ch),this.__layout.affectChildrenSort=t}this.__layout.childrenSortChanged=!1}add(t,e){if(t===this||t.destroyed)return Ah.warn("add self or destroyed");const s=n(e);if(!t.__){if(u(t))return t.forEach(t=>{this.add(t,e),s||e++});if(!(t=ge.get(t.tag,t)))return}t.parent&&t.parent.remove(t),t.parent=this,s?this.children.push(t):(Io.zIndex(this,t,e),this.children.splice(e,0,t)),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const i=t.__layout;i.boxChanged||i.boxChange(),i.matrixChanged||i.matrixChange(),t.__parentChange&&t.__parentChange.forEach(e=>e(this,t)),t.__bubbleMap&&t.__emitLifeEvent(Zo.ADD),this.frame&&t.__bindFrame(this.frame),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Zo.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",()=>this.__remove(t,e)):this.__remove(t,e):this.find(t).forEach(t=>this.remove(t,e)):n(t)&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach(e=>{this.__realRemoveChild(e),t&&e.destroy()}))}clear(){this.removeAll(!0)}__remove(t,e){const s=this.children.indexOf(t);s>-1&&(this.children.splice(s,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(Zo.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Zo.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear())),t.frame&&!t.isFrame&&t.__bindFrame(null)}__emitChildEvent(t,e){const{leafer:s}=this;if(bo(s)||s.zoomLayer===this){const i=new Zo(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(i),s.emitEvent(i)}else s.watcher.addChild(e,this,t)}};Ih=s([oo(Za)],Ih);class Mh{get length(){return this.list.length}constructor(t){this.reset(),t&&(u(t)?this.addList(t):this.add(t))}has(t){return t&&!n(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return n(e)?-1:e}add(t){const{list:e,keys:s}=this;n(s[t.innerId])&&(e.push(t),s[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:s}=this;if(n(s[t.innerId])){const{list:i}=this;for(let t=e,r=i.length;t<r;t++)s[i[t].innerId]++;0===e?i.unshift(t):(e>i.length&&(e=i.length),i.splice(e,0,t)),s[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let s;for(let i=0,r=e.length;i<r;i++)n(s)?e[i].innerId===t.innerId&&(s=i,delete this.keys[t.innerId]):this.keys[e[i].innerId]=i-1;n(s)||e.splice(s,1)}sort(t){const{list:e}=this;t?e.sort((t,e)=>e.__level-t.__level):e.sort((t,e)=>t.__level-e.__level)}forEach(t){this.list.forEach(t)}clone(){const t=new Mh;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};const{list:t,keys:e}=this;for(let s=0,i=t.length;s<i;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class Wh{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(u(t)?this.addList(t):this.add(t))}has(t){return!n(this.keys[t.innerId])}without(t){return n(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:s}=this;e[t.innerId]||(e[t.innerId]=1,s[t.__level]?s[t.__level].push(t):(s[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(s=>{e=this.levelMap[s];for(let s=0,i=e.length;s<i;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const Dh="2.3.1";if("undefined"!=typeof globalThis){const t=globalThis.Leafer||(globalThis.Leafer={});t.version=Dh,t.Plugin=ue}class Fh extends Ie{get allowBackgroundColor(){return!0}init(){this.__createView(),this.__createContext(),this.resize(this.config)}__createView(){this.view=se.origin.createCanvas(1,1)}updateViewSize(){const{width:t,height:e,pixelRatio:s}=this;this.view.width=Math.ceil(t*s),this.view.height=Math.ceil(e*s),this.clientBounds=this.bounds}}function zh(t,e){se.origin={createCanvas:(t,e)=>new OffscreenCanvas(t,e),canvasToDataURL:(t,e,s)=>new Promise((i,r)=>{t.convertToBlob({type:Kr.mimeType(e),quality:s}).then(t=>{var e=new FileReader;e.onload=t=>i(t.target.result),e.onerror=t=>r(t),e.readAsDataURL(t)}).catch(t=>{r(t)})}),canvasToBolb:(t,e,s)=>t.convertToBlob({type:Kr.mimeType(e),quality:s}),canvasSaveAs:(t,e,s)=>new Promise(t=>t()),download(t,e){},loadImage:(t,e,s)=>new Promise((e,s)=>{let i=new XMLHttpRequest;i.open("GET",se.image.getRealURL(t),!0),i.responseType="blob",i.onload=()=>{createImageBitmap(i.response).then(t=>{e(t)}).catch(t=>{s(t)})},i.onerror=t=>s(t),i.send()}),loadContent(t){return i(this,arguments,void 0,function*(t,e="text"){const s=yield fetch(t);if(!s.ok)throw new Error(`${s.status}`);return yield s[e]()})}},se.canvas=_e.canvas(),se.conicGradientSupport=!!se.canvas.context.createConicGradient}Zr(OffscreenCanvasRenderingContext2D.prototype),Zr(Path2D.prototype),Object.assign(_e,{canvas:(t,e)=>new Fh(t,e),image:t=>new un(t)}),se.name="web",se.isWorker=!0,se.backgrounder=!0,se.requestRender=function(t){requestAnimationFrame(t)},gn(se,"devicePixelRatio",{get:()=>1});const{userAgent:Nh}=navigator;Nh.indexOf("Firefox")>-1?(se.conicGradientRotate90=!0,se.intWheelDeltaY=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&(se.fullImageShadow=!0),Nh.indexOf("Windows")>-1?(se.os="Windows",se.intWheelDeltaY=!0):Nh.indexOf("Mac")>-1?se.os="Mac":Nh.indexOf("Linux")>-1&&(se.os="Linux");class Yh{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove&&this.config.usePartLayout){const t=new Mh;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.changed=0,this.config={},this.__updatedList=new Mh,this.target=t,e&&(this.config=f.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed<100&&(this.changed++,this.running&&this.target.emit(ua.REQUEST))}__onAttrChange(t){this.add(t.target)}add(t){this.config.usePartLayout&&this.__updatedList.add(t),this.update()}addChild(t,e,s){this.config.usePartLayout&&(s===Zo.ADD?(this.hasAdd=!0,this.__pushChild(t)):(this.hasRemove=!0,this.__updatedList.add(e))),this.update()}__onChildEvent(t){this.addChild(t.child,t.parent,t.type)}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new da(da.DATA,{updatedList:this.updatedList})),this.__updatedList=new Mh,this.totalTimes++,this.hasVisible=this.hasRemove=this.hasAdd=!1,this.changed=0}__listenEvents(){this.__eventIds=[this.target.on_([[ta.CHANGE,this.__onAttrChange,this],[[Zo.ADD,Zo.REMOVE],this.__onChildEvent,this],[da.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:Xh,updateBounds:Uh,updateChange:jh}=vo,{pushAllChildBranch:Vh,pushAllParent:Gh}=Io,qh={updateMatrix(t,e){let s,i,r=0;const{list:n}=t;for(;r<n.length;)s=n[r],i=s.__layout,e.without(s)&&!i.proxyZoom&&(i.matrixChanged?(Xh(s,!0),s.isBranch&&Vh(s,e),Hh(s,e)):i.boundsChanged&&(s.isBranch&&(s.__tempNumber=0),Hh(s,e))),r++},updateBounds(t){let e,s,i,r,n=0;const{levels:o,levelMap:a}=t;for(t.sort(!0);n<o.length;){e=o[n],s=a[e];for(let t=0,e=s.length;t<e;t++){if(i=s[t],i.isBranch&&i.__tempNumber){r=i.children;for(let t=0,e=r.length;t<e;t++)r[t].isBranch||Uh(r[t])}Uh(i)}n++}},updateChange(t){t.list.forEach(jh)},push:Hh};function Hh(t,e){e.add(t),Gh(t,e)}const{worldBounds:Qh}=Lo;class Jh{constructor(t){this.updatedBounds=new Qt,this.beforeBounds=new Qt,this.afterBounds=new Qt,u(t)&&(t=new Mh(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,Qh)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,Qh),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:$h,updateAllChange:Zh}=vo,Kh=ne.get("Layouter");class tl{constructor(t,e){this.totalTimes=0,this.config={usePartLayout:!0},this.__levelList=new Wh,this.target=t,e&&(this.config=f.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(ca.START),this.layoutOnce(),t.emitEvent(new ca(ca.END,this.layoutedBlocks,this.times))}catch(t){Kh.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?Kh.warn("layouting"):this.times>3?Kh.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(da.REQUEST),this.totalTimes>1&&this.config.usePartLayout?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=le.start("PartLayout"),{target:s,__updatedList:i}=this,{BEFORE:r,LAYOUT:n,AFTER:o}=ca,a=this.getBlocks(i);a.forEach(t=>t.setBefore()),s.emitEvent(new ca(r,a,this.times)),this.extraBlock=null,i.sort(),qh.updateMatrix(i,this.__levelList),qh.updateBounds(this.__levelList),qh.updateChange(i),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),s.emitEvent(new ca(n,a,this.times)),s.emitEvent(new ca(o,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,le.end(e)}fullLayout(){const t=le.start("FullLayout"),{target:e}=this,{BEFORE:s,LAYOUT:i,AFTER:r}=ca,n=this.getBlocks(new Mh(e));e.emitEvent(new ca(s,n,this.times)),tl.fullLayout(e),n.forEach(t=>{t.setAfter()}),e.emitEvent(new ca(i,n,this.times)),e.emitEvent(new ca(r,n,this.times)),this.addBlocks(n),le.end(t)}static fullLayout(t){$h(t,!0),t.isBranch?Io.updateBounds(t):vo.updateBounds(t),Zh(t)}addExtra(t,e){if(!this.__updatedList.has(t)){const{updatedList:s,beforeBounds:i}=this.extraBlock||(this.extraBlock=new Jh([]));if(s.length?i.add(t.__world):i.set(t.__world),s.add(t),e){const e=this.__levelList;qh.push(t,e),e.sort(!0)}}}createBlock(t){return new Jh(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[ca.REQUEST,this.layout,this],[ca.AGAIN,this.layoutAgain,this],[da.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const el=ne.get("Renderer");class sl{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,s){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,ceilPartPixel:!0,maxFPS:120},this.frames=[],this.target=t,this.canvas=e,s&&(this.config=f.default(s,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.requestTime||this.__requestRender()}requestLayout(){this.target.emit(ca.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(ua.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(ua.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(ua.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Qt,el.log(e.innerName,"---\x3e");try{this.emitRender(ua.START),this.renderOnce(t),this.emitRender(ua.END,this.totalBounds),hn.clearRecycled()}catch(t){this.rendering=!1,el.error(t)}el.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return el.warn("rendering");if(this.times>3)return el.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Qt,this.renderOptions={},t)this.emitRender(ua.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(ua.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(ua.RENDER,this.renderBounds,this.renderOptions),this.emitRender(ua.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach(e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(t){const e=le.start("PartRender"),{canvas:s}=this,i=t.getIntersect(s.bounds),r=new Qt(i);s.save(),i.spread(sl.clipSpread).ceil();const{ceilPartPixel:n}=this.config;s.clipWorld(i,n),s.clearWorld(i,n),this.__render(i,r),s.restore(),le.end(e)}fullRender(){const t=le.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),le.end(t)}__render(t,e){const{canvas:s,target:i}=this,r=t.includes(i.__world),n=r?{includes:r}:{bounds:t,includes:r};this.needFill&&s.fillWorld(t,this.config.fill),ne.showRepaint&&ne.drawRepaint(s,t),this.config.useCellRender&&(n.cellList=this.getCellList()),se.render(i,s,n),this.renderBounds=e=e||t,this.renderOptions=n,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),s.updateRender(e)}getCellList(){}addBlock(t,e){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Qt;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);this.requestTime=this.frameTime||Date.now();const e=()=>{const t=1e3/((this.frameTime=Date.now())-this.requestTime),{maxFPS:s}=this.config;if(s&&t>s)return se.requestRender(e);const{frames:i}=this;i.length>30&&i.shift(),i.push(t),this.FPS=Math.round(i.reduce((t,e)=>t+e,0)/i.length),this.requestTime=0,this.checkRender()};se.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:s}=t.old;if(!new Qt(0,0,e,s).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Qt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;const{updatedList:s}=t;s&&s.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||el.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds,s)})}emitRender(t,e,s){this.target.emitEvent(new ua(t,this.times,e,s))}__listenEvents(){this.__eventIds=[this.target.on_([[ua.REQUEST,this.update,this],[ca.END,this.__onLayoutEnd,this],[ua.AGAIN,this.renderAgain,this],[la.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}}function il(t){return mn(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0);const s=this.__layout;s.renderChanged||s.renderChange(),s.surfaceChange()}}))}function rl(t){return mn(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function nl(){return(t,e)=>{const s="_"+e;gn(t,e,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}function ol(){return(t,e)=>{gn(t,e,{set(t){},get(){return this}})}}function al(t){return(e,s)=>{gn(e,s,yn(s,t))}}sl.clipSpread=10,Object.assign(_e,{watcher:(t,e)=>new Yh(t,e),layouter:(t,e)=>new tl(t,e),renderer:(t,e,s)=>new sl(t,e,s),selector:(t,e)=>{},interaction:(t,e,s,i)=>{}}),se.layout=tl.fullLayout,se.render=function(t,e,s){const i=Object.assign(Object.assign({},s),{topRendering:!0});s.topList=new Mh,t.__render(e,s),s.topList.length&&s.topList.forEach(t=>t.__render(e,i))};const hl={},ll={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},dl=Zt,cl={},ul={},_l={},pl={},gl={},fl={apply(){ue.need("filter")}},yl={},ml={setStyleName:()=>ue.need("state"),set:()=>ue.need("state")},xl={list:{},register(t,e){xl.list[t]=e},get:t=>xl.list[t]},{parse:wl,objectToCanvasData:vl}=ri,{stintSet:bl}=f,{hasTransparent:kl}=ll,Sl={originPaint:{}},Bl=ne.get("UIData");class Cl extends m{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this,e=t.__hasStrokeSides||t.strokeWidth;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,e):e}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return null==this._width}get __autoHeight(){return null==this._height}get __autoSide(){return null==this._width||null==this._height}get __autoSize(){return null==this._width&&null==this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,Bl.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Bl.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),a(t)||!t?(bl(this,"__isTransparentFill",kl(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):_(t)&&this.__setPaint("fill",t)}setStroke(t){a(t)||!t?(bl(this,"__isTransparentStroke",kl(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):_(t)&&this.__setPaint("stroke",t)}setPath(t){const e=a(t);e||t&&_(t[0])?(this.__setInput("path",t),this._path=e?wl(t,this.__useArrow):vl(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Rl(this,"shadow",t)}setInnerShadow(t){Rl(this,"innerShadow",t)}setFilter(t){Rl(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&ul.compute("fill",this.__leaf),e&&ul.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeScaleFixed:s}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),n(t.strokeScaleFixed)||(s=t.strokeScaleFixed)),s){const{scaleX:t}=this.__leaf.getRenderScaleData(!0,s,!1);if(1!==t)return e*t}return e}__checkComplex(){const t=this;bl(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)}__setPaint(t,e){this.__setInput(t,e);const s=this.__leaf.__layout;s.boxChanged||s.boxChange(),u(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=Sl)):(this.__isStrokes=!0,this._stroke||(this._stroke=Sl))}__removePaint(t,e){e&&this.__removeInput(t),_l.recycleImage(t,this),"fill"===t?(bl(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(bl(this,"__isAlphaPixelStroke",void 0),bl(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function Rl(t,e,s){t.__setInput(e,s),u(s)?(s.some(t=>!1===t.visible)&&(s=s.filter(t=>!1!==t.visible)),s.length||(s=void 0)):s=s&&!1!==s.visible?[s]:void 0,t["_"+e]=s}class Pl extends Cl{}class Tl extends Pl{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class Ll extends Pl{__getInputData(t,e){const s=super.__getInputData(t,e);return Ae.forEach(t=>delete s[t]),s}}class Ol extends Tl{}class El extends Cl{get __usePathBox(){return this.points||this.__pathInputed}}class Al extends Cl{get __boxStroke(){return!this.__pathInputed}}class Il extends Cl{get __boxStroke(){return!this.__pathInputed}}class Ml extends Cl{get __usePathBox(){return this.points||this.__pathInputed}}class Wl extends Cl{}class Dl extends Cl{get __pathInputed(){return 2}}class Fl extends Pl{}const zl={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class Nl extends Cl{get __useNaturalRatio(){return!1}setFontWeight(t){a(t)?(this.__setInput("fontWeight",t),t=zl[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,s=e.__box;if(t){const{boxStyle:i}=this;if(s)for(let t in i)s[t]=void 0;else s=e.__box=ge.get("Rect",0);const r=e.__layout,n=s.__layout;i||(s.parent=e,s.__world=e.__world,n.boxBounds=r.boxBounds),s.set(t),n.strokeChanged&&r.strokeChange()}else s&&(e.__box=s.parent=null,s.destroy());this._boxStyle=t}__getInputData(t,e){const s=super.__getInputData(t,e);return s.textEditing&&delete s.textEditing,s}}class Yl extends Al{get __urlType(){return"image"}setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:this.__urlType,mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return t.url&&delete t.fill,t}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url&&delete s.fill,s}}class Xl extends Al{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url=this.__leaf.canvas.toDataURL("image/png"),s}}const{max:Ul,add:jl}=C,Vl={__updateStrokeSpread(){let t=0,e=0;const s=this.__,{strokeAlign:i,__maxStrokeWidth:r}=s,n=this.__box;if((s.stroke||"all"===s.hitStroke)&&r&&"inside"!==i&&(e=t="center"===i?r/2:r,!s.__boxStroke||s.__useArrow)){const e=s.__isLinePath?0:("miter"===s.strokeJoin?10:1)*t,i="none"===s.strokeCap?0:r;t+=Math.max(e,i)}return s.__useArrow&&(t+=5*r),n&&(t=Ul(t,n.__layout.strokeSpread=n.__updateStrokeSpread()),e=Math.max(e,n.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:i,backgroundBlur:r,filter:n,renderSpread:o}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=gl.getShadowRenderSpread(this,e)),i&&(t=Ul(t,i)),n&&(t=jl(t,fl.getSpread(n))),o&&(t=jl(t,o)),a&&(t=jl(t,a));let l=t;return s&&(l=Ul(l,gl.getInnerShadowSpread(this,s))),r&&(l=Ul(l,r)),this.__layout.renderShapeSpread=l,h?Ul(h.__updateRenderSpread(),t):t}},{stintSet:Gl}=f,ql={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Gl(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Gl(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:s,stroke:i}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;Gl(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!gl.isTransformShadow(e[0])&&!(e[0].blendMode&&"pass-through"!==e[0].blendMode)&&s&&!t.__isTransparentFill&&!(u(s)&&s.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),t.__checkComplex()},__drawFast(t,e){Hl(this,t,e)},__draw(t,e,s){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:n,__drawAfterFill:o,__fillAfterStroke:a,__isFastShadow:h}=i;if(this.__drawRenderPath(t),i.__useEffect&&!h){const h=ul.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=i;l&&gl.shadow(this,t,h),a&&(i.__isStrokes?ul.strokes(n,this,t,e):ul.stroke(n,this,t,e)),r&&(i.__isFills?ul.fills(r,this,t,e):ul.fill(r,this,t,e)),o&&this.__drawAfterFill(t,e),d&&gl.innerShadow(this,t,h),n&&!a&&(i.__isStrokes?ul.strokes(n,this,t,e):ul.stroke(n,this,t,e)),c&&fl.apply(c,this,this.__nowWorld,t,s,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(i.__isStrokes?ul.strokes(n,this,t,e):ul.stroke(n,this,t,e)),h){const e=i.shadow[0],{scaleX:s,scaleY:r}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*s,e.y*r,e.blur*s,ll.string(e.color))}r&&(i.__isFills?ul.fills(r,this,t,e):ul.fill(r,this,t,e)),h&&t.restore(),o&&this.__drawAfterFill(t,e),n&&!a&&(i.__isStrokes?ul.strokes(n,this,t,e):ul.stroke(n,this,t,e))}}else i.__pathForRender?Hl(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const s=this.__,{fill:i,stroke:r}=s;i&&!e.ignoreFill&&(s.__isAlphaPixelFill?ul.fills(i,this,t,e):ul.fill("#000000",this,t,e)),s.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(s.__isAlphaPixelStroke?ul.strokes(r,this,t,e):ul.stroke("#000000",this,t,e))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function Hl(t,e,s){const{fill:i,stroke:r,__drawAfterFill:n,__fillAfterStroke:o}=t.__;t.__drawRenderPath(e),o&&ul.stroke(r,t,e,s),i&&ul.fill(i,t,e,s),n&&t.__drawAfterFill(e,s),r&&!o&&ul.stroke(r,t,e,s)}const Ql={__drawFast(t,e){let{x:s,y:i,width:r,height:n}=this.__layout.boxBounds;const{fill:o,stroke:a,__drawAfterFill:h}=this.__;if(o&&(t.fillStyle=o,t.fillRect(s,i,r,n)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:o,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(o){case"center":t.strokeRect(0,0,r,n);break;case"inside":r-=h,n-=h,r<0||n<0?(t.save(),this.__clip(t,e),t.strokeRect(s+l,i+l,r,n),t.restore()):t.strokeRect(s+l,i+l,r,n);break;case"outside":t.strokeRect(s-l,i-l,r+h,n+h)}}}};var Jl;let $l=Jl=class extends Sh{get app(){return this.leafer&&this.leafer.app}set strokeWidthFixed(t){this.strokeScaleFixed=t}get strokeWidthFixed(){return this.strokeScaleFixed}set scale(t){D.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return Jr.set(this.path=t||[]),t||this.__drawPathByBox(Jr),Jr}set(t,e){t&&Object.assign(this,t)}get(t){return a(t)?this.__.__getInput(t):this.__.__getInputData(t)}find(t,e){return ue.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return ue.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let s=e?this.__.__pathForRender:this.__.path;return s||(Jr.set(s=[]),this.__drawPathByBox(Jr,"box",!e)),t?ri.toCanvasData(s,!0):s}getPathString(t,e,s){return ri.stringify(this.getPath(t,e),s)}asPath(t,e){this.path=this.getPath(t,e)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||yl.running?t.__computePaint():t.__needComputePaint=!0}}__updatePath(){}__updateRenderPath(t){const e=this.__;e.path?(e.__pathForRender=e.cornerRadius||e.path.radius?Hr.smooth(e.path,e.cornerRadius,e.cornerSmoothing):e.path,e.__useArrow&&cl.addArrows(this,t)):e.__pathForRender&&(e.__pathForRender=void 0)}__drawRenderPath(t){const e=this.__;t.beginPath(),e.__useArrow&&cl.updateArrow(this),this.__drawPathByData(t,e.__pathForRender)}__drawPath(t){const e=this.__;t.beginPath(),e.__usePointsMode?hr.drawPathByPoints(t,e.points,e.closed):this.__drawPathByData(t,e.path,!0)}__drawPathByData(t,e,s){e?hr.drawPathByData(t,e):this.__drawPathByBox(t,"box",s)}__drawPathByBox(t,e="box",s){const{x:i,y:r,width:n,height:o}=this.__layout[e+"Bounds"];if(this.__.cornerRadius&&!s){const{cornerRadius:e}=this.__;t.roundRect(i,r,n,o,l(e)?[e]:e)}else t.rect(i,r,n,o);t.closePath()}drawImagePlaceholder(t,e,s){ul.fill(this.__.placeholderColor,this,e,s)}animate(t,e,s,i){return this.set(t),ue.need("animate")}killAnimate(t,e){}export(t,e){return ue.need("export")}syncExport(t,e){return ue.need("export")}clone(t){const e=f.clone(this.toJSON());return t&&Object.assign(e,t),Jl.one(e)}static one(t,e,s,i,r){return ge.get(t.tag||this.prototype.__tag,t,e,s,i,r)}static registerUI(){ao()(this)}static registerData(t){$n(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.__.__willDestroy=!0,this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};s([$n(Cl)],$l.prototype,"__",void 0),s([nl()],$l.prototype,"zoomLayer",void 0),s([vn("")],$l.prototype,"id",void 0),s([vn("")],$l.prototype,"name",void 0),s([vn("")],$l.prototype,"className",void 0),s([Wn("pass-through")],$l.prototype,"blendMode",void 0),s([zn(1)],$l.prototype,"opacity",void 0),s([Nn(!0)],$l.prototype,"visible",void 0),s([Wn(!1)],$l.prototype,"locked",void 0),s([Fn(!1)],$l.prototype,"dim",void 0),s([Fn(!1)],$l.prototype,"dimskip",void 0),s([jn(0)],$l.prototype,"zIndex",void 0),s([Gn(!1)],$l.prototype,"mask",void 0),s([Hn(!1)],$l.prototype,"eraser",void 0),s([bn(0,!0)],$l.prototype,"x",void 0),s([bn(0,!0)],$l.prototype,"y",void 0),s([Rn(100,!0)],$l.prototype,"width",void 0),s([Rn(100,!0)],$l.prototype,"height",void 0),s([Bn(1,!0)],$l.prototype,"scaleX",void 0),s([Bn(1,!0)],$l.prototype,"scaleY",void 0),s([Cn(0,!0)],$l.prototype,"rotation",void 0),s([Cn(0,!0)],$l.prototype,"skewX",void 0),s([Cn(0,!0)],$l.prototype,"skewY",void 0),s([bn(0,!0)],$l.prototype,"offsetX",void 0),s([bn(0,!0)],$l.prototype,"offsetY",void 0),s([kn(0,!0)],$l.prototype,"scrollX",void 0),s([kn(0,!0)],$l.prototype,"scrollY",void 0),s([Sn()],$l.prototype,"origin",void 0),s([Sn()],$l.prototype,"around",void 0),s([vn(!1)],$l.prototype,"lazy",void 0),s([Pn(1)],$l.prototype,"pixelRatio",void 0),s([Mn(0)],$l.prototype,"renderSpread",void 0),s([Ln()],$l.prototype,"path",void 0),s([On()],$l.prototype,"windingRule",void 0),s([On(!0)],$l.prototype,"closed",void 0),s([Rn(0)],$l.prototype,"padding",void 0),s([Rn(!1)],$l.prototype,"lockRatio",void 0),s([Rn()],$l.prototype,"widthRange",void 0),s([Rn()],$l.prototype,"heightRange",void 0),s([vn(!1)],$l.prototype,"draggable",void 0),s([vn()],$l.prototype,"dragBounds",void 0),s([vn("auto")],$l.prototype,"dragBoundsType",void 0),s([vn(!1)],$l.prototype,"editable",void 0),s([Qn(!0)],$l.prototype,"hittable",void 0),s([Qn()],$l.prototype,"hitThrough",void 0),s([Qn("path")],$l.prototype,"hitFill",void 0),s([In("path")],$l.prototype,"hitStroke",void 0),s([Qn(!1)],$l.prototype,"hitBox",void 0),s([Qn(!0)],$l.prototype,"hitChildren",void 0),s([Qn(!0)],$l.prototype,"hitSelf",void 0),s([Qn()],$l.prototype,"hitRadius",void 0),s([Jn("")],$l.prototype,"cursor",void 0),s([Wn()],$l.prototype,"fill",void 0),s([In(void 0,!0)],$l.prototype,"stroke",void 0),s([In("inside")],$l.prototype,"strokeAlign",void 0),s([In(1,!0)],$l.prototype,"strokeWidth",void 0),s([In(!1)],$l.prototype,"strokeScaleFixed",void 0),s([In("none")],$l.prototype,"strokeCap",void 0),s([In("miter")],$l.prototype,"strokeJoin",void 0),s([In()],$l.prototype,"dashPattern",void 0),s([In(0)],$l.prototype,"dashOffset",void 0),s([In(10)],$l.prototype,"miterLimit",void 0),s([On(0)],$l.prototype,"cornerRadius",void 0),s([On()],$l.prototype,"cornerSmoothing",void 0),s([il()],$l.prototype,"shadow",void 0),s([il()],$l.prototype,"innerShadow",void 0),s([il()],$l.prototype,"blur",void 0),s([il()],$l.prototype,"backgroundBlur",void 0),s([il()],$l.prototype,"grayscale",void 0),s([il()],$l.prototype,"filter",void 0),s([Wn()],$l.prototype,"placeholderColor",void 0),s([vn(100)],$l.prototype,"placeholderDelay",void 0),s([vn({})],$l.prototype,"data",void 0),$l=Jl=s([oo(Vl),oo(ql),ro()],$l);let Zl=class extends $l{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:s}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),s.forEach(t=>this.add(t)),t.children=s}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);if(!this.childlessJSON){const s=e.children=[];this.children.forEach(e=>e.skipJSON||s.push(e.toJSON(t)))}return e}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}};var Kl;s([$n(Pl)],Zl.prototype,"__",void 0),s([Rn(0)],Zl.prototype,"width",void 0),s([Rn(0)],Zl.prototype,"height",void 0),Zl=s([oo(Ih),ao()],Zl);const td=ne.get("Leafer");let ed=Kl=class extends Zl{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&on.isComplete}get layoutLocked(){return!this.layouter.running}get view(){return this.canvas&&this.canvas.view}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,trackChanges:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),Kl.list.add(this)}init(t,e){if(this.canvas)return;let s;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),s=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,f.assign(i,t));const r=this.canvas=_e.canvas(i);this.__controllers.push(this.renderer=_e.renderer(this,r,i),this.watcher=_e.watcher(this,i),this.layouter=_e.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),e||(this.selector=_e.selector(this),this.interaction=_e.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=_e.hitCanvasManager()),this.canvasManager=new we,s=i.start),this.hittable=i.hittable,this.fill=i.fill,this.canvasManager.add(r),this.__listenEvents(),s&&(this.__startTimer=setTimeout(this.start.bind(this))),No.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(_a.RESTART):this.emitLeafer(_a.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(_a.STOP))}unlockLayout(t=!0){this.layouter.start(),t&&this.updateLayout()}lockLayout(t=!0){t&&this.updateLayout(),this.layouter.stop()}resize(t){const e=f.copyAttrs({},t,Ae);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:s}=this;s&&(s.addBlock(t?new Qt(t):this.canvas.bounds),this.viewReady&&(e?s.render():s.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const s=f.copyAttrs({},this.canvas,Ae);e.resize(t),this.updateLazyBounds(),this.__onResize(new la(t,s))}__onResize(t){this.emitEvent(t),f.copyAttrs(this.__,t,Ae),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new $t(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Ae.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t?(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):"mode"===t&&this.emit(_a.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Ae.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:s,canvas:i}=this,r=f.copyAttrs({},i,Ae);r[t]=s[t]=e,s.width&&s.height?i.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(r)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(_a.BEFORE_READY),this.emitLeafer(_a.READY),this.emitLeafer(_a.AFTER_READY),No.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(_a.VIEW_READY),No.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:s}=this.config;if(t){let{width:i,height:r,pixelRatio:n}=this;const o="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,o.x+o.width)),s||(r=Math.max(1,o.y+o.height)),this.__doResize({width:i,height:r,pixelRatio:n})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){No.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(_a.VIEW_COMPLETED),No.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,s){e&&(t=t.bind(e));const i=this.__nextRenderWait;if(s){for(let e=0;e<i.length;e++)if(i[e]===t){i.splice(e,1);break}}else i.push(t);this.requestRender()}zoom(t,e,s,i){return ue.need("view")}getValidMove(t,e,s){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:s}=this.clientBounds;return{x:e+t.x,y:s+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new _a(t,this))}__listenEvents(){const t=le.start("FirstCreate "+this.innerName);this.once([[_a.START,()=>le.end(t)],[ca.START,this.updateLazyBounds,this],[ua.START,this.__onCreated,this],[ua.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[da.DATA,this.__onWatchData,this],[ca.END,this.__onLayoutEnd,this],[ua.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){Kl.list.remove(this);try{this.stop(),this.emitLeafer(_a.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{hn.clearRecycled()},100)}catch(t){td.error(t)}}};t?e():setTimeout(e)}};ed.list=new Mh,s([$n(Ll)],ed.prototype,"__",void 0),s([Rn()],ed.prototype,"pixelRatio",void 0),s([vn("normal")],ed.prototype,"mode",void 0),ed=Kl=s([ao()],ed);let sd=class extends $l{get __tag(){return"Rect"}};s([$n(Al)],sd.prototype,"__",void 0),sd=s([oo(Ql),ro(),ao()],sd);const{add:id,includes:rd,scroll:nd}=Vt,od=sd.prototype,ad=Zl.prototype;let hd=class extends Zl{get __tag(){return"Box"}get isBranchLeaf(){return!0}get __useSelfBox(){return this.pathInputed}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.__useSelfBox){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const s=this.__,i=this.__layout,{renderBounds:r,boxBounds:n}=i,{overflow:o}=s,a=i.childrenRenderBounds||(i.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=o&&o.includes("scroll"))&&(id(a,n),nd(a,s)),this.__updateRectRenderBounds(),t=!rd(n,a),t&&"show"===o&&id(r,a)}else this.__updateRectRenderBounds();f.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};s([$n(Tl)],hd.prototype,"__",void 0),s([Rn(100)],hd.prototype,"width",void 0),s([Rn(100)],hd.prototype,"height",void 0),s([vn(!1)],hd.prototype,"resizeChildren",void 0),s([Mn("show")],hd.prototype,"overflow",void 0),s([io(od.__updateStrokeSpread)],hd.prototype,"__updateStrokeSpread",null),s([io(od.__updateRenderSpread)],hd.prototype,"__updateRectRenderSpread",null),s([io(od.__updateBoxBounds)],hd.prototype,"__updateRectBoxBounds",null),s([io(od.__updateStrokeBounds)],hd.prototype,"__updateStrokeBounds",null),s([io(od.__updateRenderBounds)],hd.prototype,"__updateRectRenderBounds",null),s([io(od.__updateChange)],hd.prototype,"__updateRectChange",null),s([io(od.__render)],hd.prototype,"__renderRect",null),s([io(ad.__render)],hd.prototype,"__renderGroup",null),hd=s([ro(),ao()],hd);let ld=class extends hd{get __tag(){return"Frame"}get isFrame(){return!0}};s([ol()],ld.prototype,"frame",void 0),s([$n(Ol)],ld.prototype,"__",void 0),s([Wn("#FFFFFF")],ld.prototype,"fill",void 0),s([Mn("hide")],ld.prototype,"overflow",void 0),ld=s([ao()],ld);const{moveTo:dd,closePath:cd,ellipse:ud}=Pi,{tempPoint:_d,set:pd,rotate:gd}=dt,{abs:fd}=Math,yd={};let md=class extends $l{get __tag(){return"Ellipse"}__updatePath(){const t=this.__,{width:e,height:s,innerRadius:i,startAngle:r,endAngle:n,closed:o}=t,a=e/2,h=s/2,l=t.path=[];let d,c,u;if((r||n)&&(c=!0),c&&(u=360===fd(n-r)),i){const t=i<1||o,e=a*i,s=h*i;c?(ud(l,a,h,a,h,0,r,n),t?(u&&(cd(l),pd(_d,a+e,h),pd(yd,a,h),gd(_d,n,yd,a,h),dd(l,_d.x,_d.y)),ud(l,a,h,e,s,0,n,r,!0)):u||(d=!0)):(ud(l,a,h,a,h),t&&(cd(l),dd(l,a+e,h),ud(l,a,h,e,s,0,360,0,!0)))}else c?(u||(o||(d=!0),d||dd(l,a,h)),ud(l,a,h,a,h,0,r,n)):ud(l,a,h,a,h);d||cd(l),(se.ellipseToCurve||t.__useArrow||t.cornerRadius)&&(t.path=this.getPath(!0))}};s([$n(Il)],md.prototype,"__",void 0),s([On(0)],md.prototype,"innerRadius",void 0),s([On(0)],md.prototype,"startAngle",void 0),s([On(0)],md.prototype,"endAngle",void 0),md=s([ao()],md);const{sin:xd,cos:wd,PI:vd}=Math,{moveTo:bd,lineTo:kd,closePath:Sd,drawPoints:Bd}=Pi;let Cd=class extends $l{get __tag(){return"Polygon"}get isPointsMode(){return this.points&&!this.pathInputed}__updatePath(){const t=this.__,e=t.path=[];if(t.points)Bd(e,t.points,t.curve,t.closed,t);else{const{width:s,height:i,sides:r,startAngle:n}=t,o=s/2,a=i/2;let h,l=0;n?(l=n*z,bd(e,o+o*xd(l),a-a*wd(l))):bd(e,o,0);for(let t=1;t<r;t++)h=2*t*vd/r+l,kd(e,o+o*xd(h),a-a*wd(h));Sd(e)}}};s([$n(Ml)],Cd.prototype,"__",void 0),s([On(3)],Cd.prototype,"sides",void 0),s([On(0)],Cd.prototype,"startAngle",void 0),s([On()],Cd.prototype,"points",void 0),s([On(0)],Cd.prototype,"curve",void 0),Cd=s([ro(),ao()],Cd);const{sin:Rd,cos:Pd,PI:Td}=Math,{moveTo:Ld,lineTo:Od,closePath:Ed}=Pi;let Ad=class extends $l{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:s,innerRadius:i,startAngle:r}=this.__,n=t/2,o=e/2,a=this.__.path=[];let h,l=0;r?(l=r*z,Ld(a,n+n*Rd(l),o-o*Pd(l))):Ld(a,n,0);for(let t=1;t<2*s;t++)h=t*Td/s+l,Od(a,n+(t%2==0?n:n*i)*Rd(h),o-(t%2==0?o:o*i)*Pd(h));Ed(a)}};s([$n(Wl)],Ad.prototype,"__",void 0),s([On(5)],Ad.prototype,"corners",void 0),s([On(.382)],Ad.prototype,"innerRadius",void 0),s([On(0)],Ad.prototype,"startAngle",void 0),Ad=s([ao()],Ad);const{moveTo:Id,lineTo:Md,drawPoints:Wd}=Pi,{rotate:Dd,getAngle:Fd,getDistance:zd,defaultPoint:Nd}=dt;let Yd=class extends $l{get __tag(){return"Line"}get isPointsMode(){return this.points&&!this.pathInputed}get toPoint(){const{width:t,rotation:e}=this.__,s={x:0,y:0};return t&&(s.x=t),e&&Dd(s,e),s}set toPoint(t){this.width=zd(Nd,t),this.rotation=Fd(Nd,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?Wd(e,t.points,t.curve,t.closed,t):(Id(e,0,0),Md(e,this.width,0))}};s([$n(El)],Yd.prototype,"__",void 0),s([En("center")],Yd.prototype,"strokeAlign",void 0),s([Rn(0)],Yd.prototype,"height",void 0),s([On()],Yd.prototype,"points",void 0),s([On(0)],Yd.prototype,"curve",void 0),s([On(!1)],Yd.prototype,"closed",void 0),Yd=s([ao()],Yd);let Xd=class extends sd{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return u(t)&&t[0].image}};s([$n(Yl)],Xd.prototype,"__",void 0),s([Rn("")],Xd.prototype,"url",void 0),Xd=s([ao()],Xd);const Ud=Xd;let jd=class extends sd{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=_e.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new un({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new sa(sa.LOADED,{image:t}))})}draw(t,e,s,i){const r=new mt(t.worldTransform).invert(),n=new mt;e&&n.translate(e.x,e.y),s&&(l(s)?n.scale(s):n.scale(s.x,s.y)),i&&n.rotate(i),r.multiplyParent(n),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:s,height:i}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,s,i)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:s}=this.__;t.resize(this.__,s),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};s([$n(Xl)],jd.prototype,"__",void 0),s([rl(100)],jd.prototype,"width",void 0),s([rl(100)],jd.prototype,"height",void 0),s([rl(1)],jd.prototype,"pixelRatio",void 0),s([rl(!0)],jd.prototype,"smooth",void 0),s([vn(!1)],jd.prototype,"safeResize",void 0),s([rl()],jd.prototype,"contextSettings",void 0),jd=s([ao()],jd);const{copyAndSpread:Vd,includes:Gd,setList:qd}=Vt,{stintSet:Hd}=f;let Qd=class extends $l{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:s,wordSpacing:i,fontFamily:r,fontSize:n,fontWeight:o,italic:a,textCase:h,textOverflow:l,padding:d,width:c,height:u}=t;t.__lineHeight=dl.number(e,n),t.__letterSpacing=dl.number(s,n),t.__wordSpacing=dl.number(i,n),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*n)/2,t.__font=`${a?"italic ":""}${"small-caps"===h?"small-caps ":""}${"normal"!==o?o+" ":""}${n||12}px ${r||"caption"}`,Hd(t,"__padding",d&&D.fourNumber(d)),Hd(t,"__clipText","show"!==l&&!t.__autoSize),Hd(t,"__isCharMode",c||u||t.__letterSpacing||t.__wordSpacing||t.motionText||"none"!==h),t.__textDrawData=hl.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:s,italic:i,padding:r,__autoWidth:n,__autoHeight:o}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<s&&(e.renderChanged=!0),n||o){if(h.x=n?a.x:0,h.y=o?a.y:0,h.width=n?a.width:t.width,h.height=o?a.height:t.height,r){const[e,s,i,r]=t.__padding;n&&(h.x-=r,h.width+=s+r),o&&(h.y-=e,h.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(h.width+=.16*s),f.stintSet(this,"isOverflow",!Gd(h,a)&&!t.motionText),this.isOverflow?(qd(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__updateRenderSpread(){let t=super.__updateRenderSpread();t||(t=this.isOverflow?1:0);const{__lineHeight:e,fontSize:s}=this.__;return e<s&&(t=C.max(t,(s-e)/2)),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;Vd(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__updateChange(){super.__updateChange();const t=this.__box;t&&(t.__onUpdateSize(),t.__updateChange())}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,s){const i=this.__box;i&&(i.__nowWorld=this.__nowWorld,i.__draw(t,e,s)),this.textEditing&&!e.exporting||super.__draw(t,e,s)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};s([$n(Nl)],Qd.prototype,"__",void 0),s([Rn(0)],Qd.prototype,"width",void 0),s([Rn(0)],Qd.prototype,"height",void 0),s([Wn()],Qd.prototype,"boxStyle",void 0),s([vn(!1)],Qd.prototype,"resizeFontSize",void 0),s([Wn("#000000")],Qd.prototype,"fill",void 0),s([En("outside")],Qd.prototype,"strokeAlign",void 0),s([Qn("all")],Qd.prototype,"hitFill",void 0),s([Rn("")],Qd.prototype,"text",void 0),s([Rn("")],Qd.prototype,"placeholder",void 0),s([Rn("caption")],Qd.prototype,"fontFamily",void 0),s([Rn(12)],Qd.prototype,"fontSize",void 0),s([Rn("normal")],Qd.prototype,"fontWeight",void 0),s([Rn(!1)],Qd.prototype,"italic",void 0),s([Rn("none")],Qd.prototype,"textCase",void 0),s([Rn("none")],Qd.prototype,"textDecoration",void 0),s([Rn(0)],Qd.prototype,"letterSpacing",void 0),s([Rn(0)],Qd.prototype,"wordSpacing",void 0),s([Rn({type:"percent",value:1.5})],Qd.prototype,"lineHeight",void 0),s([Rn(0)],Qd.prototype,"paraIndent",void 0),s([Rn(0)],Qd.prototype,"paraSpacing",void 0),s([Rn("x")],Qd.prototype,"writingMode",void 0),s([Rn("left")],Qd.prototype,"textAlign",void 0),s([Rn("top")],Qd.prototype,"verticalAlign",void 0),s([Rn(!0)],Qd.prototype,"autoSizeAlign",void 0),s([Rn("normal")],Qd.prototype,"textWrap",void 0),s([Rn("show")],Qd.prototype,"textOverflow",void 0),s([Wn(!1)],Qd.prototype,"textEditing",void 0),Qd=s([ao()],Qd);let Jd=class extends $l{get __tag(){return"Path"}};s([$n(Dl)],Jd.prototype,"__",void 0),s([En("center")],Jd.prototype,"strokeAlign",void 0),Jd=s([ao()],Jd);let $d=class extends Zl{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new Jd(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}paint(){const{pathElement:t}=this;t.__layout.boxChanged||t.forceUpdate("path")}};function Zd(t,e,s,i){t.__.__font?ul.fillText(t,e,s,i):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function Kd(t,e,s,i,r){const n=s.__;_(t)?ul.drawStrokesStyle(t,e,!1,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),i.stroke()),n.__useArrow&&ul.strokeArrow(t,s,i,r)}function tc(t,e,s,i,r){const n=s.__;_(t)?ul.drawStrokesStyle(t,e,!0,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),ul.drawTextStroke(s,i,r))}function ec(t,e,s,i,r){const n=i.getSameCanvas(!0,!0);n.font=s.__.__font,tc(t,2,s,n,r),n.blendMode="outside"===e?"destination-out":"destination-in",ul.fillText(s,n,r),n.blendMode="normal",vo.copyCanvasByWorld(s,i,n),n.recycle(s.__nowWorld)}s([$n(Fl)],$d.prototype,"__",void 0),s([(t,e)=>{gn(t,e,{get(){return this.__path}})}],$d.prototype,"path",void 0),$d=s([oo(qi,["set","path","paint"]),ao()],$d);const{getSpread:sc,copyAndSpread:ic,toOuterOf:rc,getOuterOf:nc,getByMove:oc,move:ac,getIntersectData:hc}=Vt,lc={};let dc;const{stintSet:cc}=f,{hasTransparent:uc}=ll;function _c(t,e,s){if(!_(e)||!1===e.visible||0===e.opacity)return;let i;const{boxBounds:r}=s.__layout,{type:o}=e;switch(o){case"image":case"film":case"video":if(!e.url)return;i=_l.image(s,t,e,r,!dc||!dc[e.url]),"image"!==o&&_l[o](i);break;case"linear":i=pl.linearGradient(e,r);break;case"radial":i=pl.radialGradient(e,r);break;case"angular":i=pl.conicGradient(e,r);break;case"solid":const{color:a,opacity:h}=e;i={type:o,style:ll.string(a,h)};break;default:n(e.r)||(i={type:"solid",style:ll.string(e)})}if(i&&(i.originPaint=e,a(i.style)&&uc(i.style)&&(i.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;i.strokeStyle=e.style}return i}const pc={compute:function(t,e){const s=e.__,i=[];let r,n,o,a=s.__input[t];u(a)||(a=[a]),dc=_l.recycleImage(t,s);for(let s,r=0,n=a.length;r<n;r++)(s=_c(t,a[r],e))&&(i.push(s),s.strokeStyle&&(o||(o=1),s.strokeStyle.strokeWidth&&(o=Math.max(o,s.strokeStyle.strokeWidth))));i.length?(s["_"+t]=i,i.every(t=>t.isTransparent)&&(i.some(t=>t.image)&&(r=!0),n=!0),"fill"===t?(cc(s,"__isAlphaPixelFill",r),cc(s,"__isTransparentFill",n)):(cc(s,"__isAlphaPixelStroke",r),cc(s,"__isTransparentStroke",n),cc(s,"__hasMultiStrokeStyle",o))):(s.__removePaint(t,!1),s["_"+t]="")},fill:function(t,e,s,i){s.fillStyle=t,Zd(e,s,i)},fills:function(t,e,s,i){let r,n,o;for(let a=0,h=t.length;a<h;a++){if(r=t[a],n=r.originPaint,r.image){if(o?o++:o=1,_l.checkImage(r,!e.__.__font,e,s,i))continue;if(!r.style){1===o&&r.image.isPlacehold&&e.drawImagePlaceholder(r,s,i);continue}}if(s.fillStyle=r.style,r.transform||n.scaleFixed){if(s.save(),r.transform&&s.transform(r.transform),n.scaleFixed){const{scaleX:t,scaleY:i}=e.getRenderScaleData(!0,n.scaleFixed,!1);1!==t&&s.scale(t,i)}n.blendMode&&(s.blendMode=n.blendMode),Zd(e,s,i,!0),s.restore()}else n.blendMode?(s.saveBlendMode(n.blendMode),Zd(e,s,i),s.restoreBlendMode()):Zd(e,s,i)}},fillPathOrText:Zd,fillText:function(t,e,s,i){const r=t.__;let n;if(r.__isPlacehold&&r.placeholderColor&&(e.fillStyle=r.placeholderColor),i&&(n=e,(e=e.getSameCanvas(!0,!0)).font=t.__.__font,e.fillStyle="#000"),t.motionText)ul.fillMotionText(t,e,s);else{let t;const{rows:s,decorationY:i}=r.__textDrawData;for(let i=0,r=s.length;i<r;i++)t=s[i],t.text?e.fillText(t.text,t.x,t.y):t.data&&t.data.forEach(s=>{e.fillText(s.char,s.x,t.y)});if(i){const{decorationColor:t,decorationHeight:n}=r.__textDrawData;t&&(e.fillStyle=t),s.forEach(t=>i.forEach(s=>e.fillRect(t.x,t.y+s,t.width,n)))}}i&&(e.beginPath(),t.__drawPathByBox(e,"render"),e.fillStyle=n.fillStyle,e.setTransform(n.getTransform()),e.blendMode="source-in",e.fill(),n.copyWorldByReset(e,t.__nowWorld),e.recycle(t.__nowWorld))},stroke:function(t,e,s,i){const r=e.__;if(r.__strokeWidth)if(r.__font)ul.strokeText(t,e,s,i);else if(r.__pathForStroke)ul.fillStroke(t,e,s,i);else switch(r.strokeAlign){case"center":Kd(t,1,e,s,i);break;case"inside":!function(t,e,s,i){s.save(),s.clipUI(e),Kd(t,2,e,s,i),s.restore()}(t,e,s,i);break;case"outside":!function(t,e,s,i){const r=e.__;if(r.__fillAfterStroke)Kd(t,2,e,s,i);else{const{renderBounds:n}=e.__layout,o=s.getSameCanvas(!0,!0);e.__drawRenderPath(o),Kd(t,2,e,o,i),o.clipUI(r),o.clearWorld(n),vo.copyCanvasByWorld(e,s,o),o.recycle(e.__nowWorld)}}(t,e,s,i)}},strokes:function(t,e,s,i){ul.stroke(t,e,s,i)},strokeText:function(t,e,s,i){switch(e.__.strokeAlign){case"center":tc(t,1,e,s,i);break;case"inside":ec(t,"inside",e,s,i);break;case"outside":e.__.__fillAfterStroke?tc(t,2,e,s,i):ec(t,"outside",e,s,i)}},drawTextStroke:function(t,e,s){let i,r=t.__.__textDrawData;const{rows:n,decorationY:o}=r;for(let t=0,s=n.length;t<s;t++)i=n[t],i.text?e.strokeText(i.text,i.x,i.y):i.data&&i.data.forEach(t=>{e.strokeText(t.char,t.x,i.y)});if(o){const{decorationHeight:t}=r;n.forEach(s=>o.forEach(i=>e.strokeRect(s.x,s.y+i,s.width,t)))}},drawStrokesStyle:function(t,e,s,i,r,n){let o;const a=i.__,{__hasMultiStrokeStyle:h}=a;h||r.setStroke(void 0,a.__strokeWidth*e,a);for(let l=0,d=t.length;l<d;l++)if(o=t[l],(!o.image||!_l.checkImage(o,!1,i,r,n))&&o.style){if(h){const{strokeStyle:t}=o;t?r.setStroke(o.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(o.style,a.__strokeWidth*e,a)}else r.strokeStyle=o.style;o.originPaint.blendMode?(r.saveBlendMode(o.originPaint.blendMode),s?ul.drawTextStroke(i,r,n):r.stroke(),r.restoreBlendMode()):s?ul.drawTextStroke(i,r,n):r.stroke()}},shape:function(t,e,s){const i=e.getSameCanvas(),r=e.bounds,n=t.__nowWorld,o=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,d,c,u,_;rc(o.strokeSpread?(ic(lc,o.boxBounds,o.strokeSpread),lc):o.boxBounds,n,a);let{scaleX:p,scaleY:g}=t.getRenderScaleData(!0);if(r.includes(a))_=i,h=u=a,l=n;else{let i;if(se.fullImageShadow)i=a;else{const t=o.renderShapeSpread?sc(r,C.swapAndScale(o.renderShapeSpread,p,g)):r;i=hc(t,a)}c=r.getFitMatrix(i);let{a:f,d:y}=c;c.a<1&&(_=e.getSameCanvas(),t.__renderShape(_,s),p*=f,g*=y),u=nc(a,c),h=oc(u,-c.e,-c.f),l=nc(n,c),ac(l,-c.e,-c.f);const m=s.matrix;m?(d=new mt(c),d.multiply(m),f*=m.scaleX,y*=m.scaleY):d=c,d.withScale(f,y),s=Object.assign(Object.assign({},s),{matrix:d})}return t.__renderShape(i,s),{canvas:i,matrix:d,fitMatrix:c,bounds:h,renderBounds:l,worldCanvas:_,shapeBounds:u,scaleX:p,scaleY:g}}};let gc,fc=new Qt;const{isSame:yc}=Vt;function mc(t,e,s,i,r,n){let o=!0;const a=t.__;if("fill"!==e||a.__naturalWidth||(a.__naturalWidth=i.width/a.pixelRatio,a.__naturalHeight=i.height/a.pixelRatio,a.__autoSide&&(t.forceUpdate(),vo.updateBounds(t,!0),t.__layout.boundsChanged=!0,t.__proxyData&&(t.setProxyAttr("width",a.width),t.setProxyAttr("height",a.height)),o=!1)),"brush"===s.mode&&_l.brush(t,e,r),!r.data){_l.createData(r,i,s,n);const{transform:t}=r.data,{opacity:e}=s,o=(t&&!t.onlyScale||a.path||a.cornerRadius)&&!r.brush;(o||e&&e<1||s.blendMode)&&(r.complex=!o||2)}return s.filter&&_l.applyFilter(r,i,s.filter,t),o}function xc(t,e){bc(t,sa.LOAD,e)}function wc(t,e){bc(t,sa.LOADED,e)}function vc(t,e,s){e.error=s,t.forceUpdate("surface"),bc(t,sa.ERROR,e)}function bc(t,e,s){t.hasEvent(e)&&t.emitEvent(new sa(e,s))}function kc(t,e){const{leafer:s}=t;s&&s.viewReady&&(s.renderer.ignore=e)}const{get:Sc,translate:Bc}=Z,Cc=new Qt,Rc={},Pc={};function Tc(t,e,s,i){const r=a(t)||i?(i?s-i*e:s%e)/((i||Math.floor(s/e))-1):t;return"auto"===t&&r<0?0:r}let Lc={},Oc={a:1,b:0,c:0,d:1,e:0,f:0};const{get:Ec,set:Ac,rotateOfOuter:Ic,translate:Mc,scaleOfOuter:Wc,multiplyParent:Dc,scale:Fc,rotate:zc,skew:Nc}=Z;function Yc(t,e,s,i,r,n,o,a){o&&zc(t,o),a&&Nc(t,a.x,a.y),r&&Fc(t,r,n),Mc(t,e.x+s,e.y+i)}const{get:Xc,scale:Uc,copy:jc}=Z,{getFloorScale:Vc}=D,{abs:Gc}=Math;const qc={image:function(t,e,s,i,r){let n,o;const a=hn.get(s,s.type);return gc&&s===gc.paint&&yc(i,gc.boxBounds)?n=gc.leafPaint:(n={type:s.type,image:a},a.hasAlphaPixel&&(n.isTransparent=!0),gc=a.use>1?{leafPaint:n,paint:s,boxBounds:fc.set(i)}:null),(r||a.loading)&&(o={image:a,attrName:e,attrValue:s}),a.ready?(mc(t,e,s,a,n,i),r&&(xc(t,o),wc(t,o))):a.error?r&&vc(t,o,a.error):(r&&(kc(t,!0),xc(t,o)),n.loadId=a.load(()=>{kc(t,!1),t.destroyed||(mc(t,e,s,a,n,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),wc(t,o)),n.loadId=void 0},e=>{kc(t,!1),vc(t,o,e),n.loadId=void 0},s.lod&&a.getThumbSize(s.lod)),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),n},checkImage:function(t,e,s,i,r){const{scaleX:n,scaleY:o}=_l.getImageRenderScaleData(t,s,i,r),a=t.film?t.nowIndex:n+"-"+o,{image:h,brush:l,data:d,originPaint:c}=t,{exporting:u,snapshot:_}=r;if(!d||t.patternId===a&&!u||_){if(!l||!t.style)return!1}else if(e&&(d.repeat?e=!1:c.changeful||t.film||"miniapp"===se.name||u||(e=se.image.isLarge(h,n,o)||h.width*n>8096||h.height*o>8096)),e)s.__.__isFastShadow&&(i.fillStyle=t.style||"#000",i.fill());else if(!t.style||c.sync||u?_l.createPattern(t,s,i,r):_l.createPatternTask(t,s,i,r),!l||!t.style)return!1;return _l.drawImage(t,n,o,s,i,r),!0},drawImage:function(t,e,s,i,r,n){const{data:o,image:a,brush:h,complex:l}=t;let{width:d,height:c}=a,u=h||a;if(l){const{blendMode:n,opacity:a}=t.originPaint,{transform:h}=o;r.save(),2===l&&r.clipUI(i),n&&(r.blendMode=n),a&&(r.opacity*=a),h&&r.transform(h),u.render(r,0,0,d,c,i,t,e,s),r.restore()}else o.scaleX&&(d*=o.scaleX,c*=o.scaleY),u.render(r,0,0,d,c,i,t,e,s)},getImageRenderScaleData:function(t,e,s,i){const r=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:n}=t;if(t.brush&&_l.addBrushScale(r,t,e),s){const{pixelRatio:t}=s;r.scaleX*=t,r.scaleY*=t}return n&&n.scaleX&&(r.scaleX*=Math.abs(n.scaleX),r.scaleY*=Math.abs(n.scaleY)),r},recycleImage:function(t,e){const s=e["_"+t];if(u(s)){let i,r,n,o,a;const h=e.__leaf;for(let l=0,d=s.length;l<d;l++)i=s[l],r=i.image,a=r&&r.url,a&&(n||(n={}),n[a]=!0,hn.recyclePaint(i),i.brush&&_l.recycleBrush(i,h),e.__willDestroy&&r.parent&&_l.recycleFilter(r,h),r.loading&&(o||(o=e.__input&&e.__input[t]||[],u(o)||(o=[o])),r.unload(s[l].loadId,!o.some(t=>t.url===a))));return n}return null},createPatternTask:function(t,e,s,r){t.patternTask||(t.patternTask=hn.patternTasker.add(()=>i(this,void 0,void 0,function*(){_l.createPattern(t,e,s,r),e.forceUpdate("surface")}),0,()=>(t.patternTask=null,s.bounds.hit(e.__nowWorld))))},createPattern:function(t,e,s,i){let{scaleX:r,scaleY:n}=_l.getImageRenderScaleData(t,e,s,i),o=t.film?t.nowIndex:r+"-"+n;if(t.patternId!==o&&!e.destroyed&&(!se.image.isLarge(t.image,r,n)||t.data.repeat)){const{image:a,brush:h,data:l}=t,{transform:d,gap:c}=l,u=_l.getPatternFixScale(t,r,n);let _,p,g,{width:f,height:y}=a,{opacity:m}=t.originPaint;(h||1===m)&&(m=void 0),u&&(r*=u,n*=u),f*=r,y*=n,c&&!h&&(p=c.x*r/Gc(l.scaleX||1),g=c.y*n/Gc(l.scaleY||1)),(d||1!==r||1!==n)&&(r*=Vc(f+(p||0)),n*=Vc(y+(g||0)),_=Xc(),d&&jc(_,d),Uc(_,1/r,1/n));const x=a.getCanvas(f,y,m,void 0,p,g,e.leafer&&e.leafer.config.smooth,l.interlace);h?(t.style=x,_l.cacheBrush(t,e,s,i)):t.style=a.getPattern(x,l.repeat||se.origin.noRepeat||"no-repeat",_,t),t.patternId=o}},getPatternFixScale:function(t,e,s){const{image:i}=t;let r,n=se.image.maxPatternSize,o=i.width*i.height;return i.isSVG?e>1&&(r=Math.ceil(e)/e):n>o&&(n=o),(o*=e*s)>n&&(r=Math.sqrt(n/o)),r},createData:function(t,e,s,i){t.data=_l.getPatternData(s,i,e)},getPatternData:function(t,e,s){t.padding&&(e=Cc.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:i,height:r}=s,{mode:n,align:o,offset:h,scale:d,size:c,rotation:u,skew:p,clipSize:g,repeat:f,gap:y,interlace:m}=t,x=e.width===i&&e.height===r,w={mode:n},v="center"!==o&&(u||0)%180==90;let b,k;switch(Vt.set(Pc,0,0,v?r:i,v?i:r),n&&"cover"!==n&&"fit"!==n?((d||c)&&(D.getScaleData(d,c,s,Rc),b=Rc.scaleX,k=Rc.scaleY),(o||y||f)&&(b&&Vt.scale(Pc,b,k,!0),o&&Pt.toPoint(o,Pc,e,Pc,!0,!0))):x&&!u||(b=k=Vt.getFitScale(e,Pc,"fit"!==n),Vt.put(e,s,o,b,!1,Pc),Vt.scale(Pc,b,k,!0)),h&&dt.move(Pc,h),n){case"stretch":x?b&&(b=k=void 0):(b=e.width/i,k=e.height/r,_l.stretchMode(w,e,b,k));break;case"normal":case"clip":if(Pc.x||Pc.y||b||g||u||p){let t,s;g&&(t=e.width/g.width,s=e.height/g.height),_l.clipMode(w,e,Pc.x,Pc.y,b,k,u,p,t,s),t&&(b=b?b*t:t,k=k?k*s:s)}break;case"repeat":(!x||b||u||p)&&_l.repeatMode(w,e,i,r,Pc.x,Pc.y,b,k,u,p,o,t.freeTransform);case"brush":f||(w.repeat="repeat");const s=_(f);(y||s)&&(w.gap=function(t,e,s,i,r){let n,o;_(t)?(n=t.x,o=t.y):n=o=t;return{x:Tc(n,s,r.width,e&&e.x),y:Tc(o,i,r.height,e&&e.y)}}(y,s&&f,Pc.width,Pc.height,e));break;default:b&&_l.fillOrFitMode(w,e,Pc.x,Pc.y,b,k,u)}return w.transform||"brush"===n||(e.x||e.y)&&Bc(w.transform=Sc(),e.x,e.y),b&&(w.scaleX=b,w.scaleY=k),f&&(w.repeat=a(f)?"x"===f?"repeat-x":"repeat-y":"repeat"),m&&(w.interlace=l(m)||"percent"===m.type?{type:"x",offset:m}:m),w},stretchMode:function(t,e,s,i){const r=Ec(),{x:n,y:o}=e;n||o?Mc(r,n,o):s>0&&i>0&&(r.onlyScale=!0),Fc(r,s,i),t.transform=r},fillOrFitMode:function(t,e,s,i,r,n,o){const a=Ec();Mc(a,e.x+s,e.y+i),Fc(a,r,n),o&&Ic(a,{x:e.x+e.width/2,y:e.y+e.height/2},o),t.transform=a},clipMode:function(t,e,s,i,r,n,o,a,h,l){const d=Ec();Yc(d,e,s,i,r,n,o,a),h&&(o||a?(Ac(Oc),Wc(Oc,e,h,l),Dc(d,Oc)):Wc(d,e,h,l)),t.transform=d},repeatMode:function(t,e,s,i,r,n,o,a,h,l,d,c){const u=Ec();if(c)Yc(u,e,r,n,o,a,h,l);else{if(h)if("center"===d)Ic(u,{x:s/2,y:i/2},h);else switch(zc(u,h),h){case 90:Mc(u,i,0);break;case 180:Mc(u,s,i);break;case 270:Mc(u,0,s)}Lc.x=e.x+r,Lc.y=e.y+n,Mc(u,Lc.x,Lc.y),o&&Wc(u,Lc,o,a)}t.transform=u}},{toPoint:Hc}=Bt,{hasTransparent:Qc}=ll,Jc={},$c={};function Zc(t,e,s,i){if(s){let r,n,o,h;for(let t=0,l=s.length;t<l;t++)r=s[t],a(r)?(o=t/(l-1),n=ll.string(r,i)):(o=r.offset,n=ll.string(r.color,i)),e.addColorStop(o,n),!h&&Qc(n)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:Kc,getDistance:tu}=dt,{get:eu,rotateOfOuter:su,scaleOfOuter:iu}=Z,{toPoint:ru}=Bt,nu={},ou={};function au(t,e,s,i,r){let n;const{width:o,height:a}=t;if(o!==a||i){const t=Kc(e,s);n=eu(),r?(iu(n,e,o/a*(i||1),1),su(n,e,t+90)):(iu(n,e,1,o/a*(i||1)),su(n,e,t))}return n}const{getDistance:hu}=dt,{toPoint:lu}=Bt,du={},cu={};const uu={linearGradient:function(t,e){let{from:s,to:i,type:r,opacity:n}=t;Hc(s||"top",e,Jc),Hc(i||"bottom",e,$c);const o=se.canvas.createLinearGradient(Jc.x,Jc.y,$c.x,$c.y),a={type:r,style:o};return Zc(a,o,t.stops,n),a},radialGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,stretch:o}=t;ru(s||"center",e,nu),ru(i||"bottom",e,ou);const a=se.canvas.createRadialGradient(nu.x,nu.y,0,nu.x,nu.y,tu(nu,ou)),h={type:r,style:a};Zc(h,a,t.stops,n);const l=au(e,nu,ou,o,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,rotation:o,stretch:a}=t;lu(s||"center",e,du),lu(i||"bottom",e,cu);const h=se.conicGradientSupport?se.canvas.createConicGradient(o?o*z:0,du.x,du.y):se.canvas.createRadialGradient(du.x,du.y,0,du.x,du.y,hu(du,cu)),l={type:r,style:h};Zc(l,h,t.stops,n);const d=au(e,du,cu,a||1,se.conicGradientRotate90);return d&&(l.transform=d),l},getTransform:au},{copy:_u,move:pu,toOffsetOutBounds:gu}=Vt,{max:fu,abs:yu}=Math,mu={},xu=new mt,wu={};function vu(t,e){let s,i,r,n,o=0,a=0,h=0,l=0;return e.forEach(t=>{s=t.x||0,i=t.y||0,n=1.5*(t.blur||0),r=yu(t.spread||0),o=fu(o,r+n-i),a=fu(a,r+n+s),h=fu(h,r+n+i),l=fu(l,r+n-s)}),o===a&&a===h&&h===l?o:[o,a,h,l]}function bu(t,e,s){const{shapeBounds:i}=s;let r,n;se.fullImageShadow?(_u(mu,t.bounds),pu(mu,e.x-i.x,e.y-i.y),r=t.bounds,n=mu):(r=i,n=e),t.copyWorld(s.canvas,r,n)}const{toOffsetOutBounds:ku}=Vt,Su={};const Bu=vu;const Cu={shadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{shadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;gu(h,wu,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.setWorldShadow(wu.offsetX+(o.x||0)*c*f,wu.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f,ll.string(o.color)),r=gl.getShadowTransform(t,_,s,o,wu,f),r&&_.setTransform(r),bu(_,wu,s),r&&_.resetTransform(),i=l,o.box&&(_.restore(),_.save(),a&&(_.copyWorld(_,l,n,"copy"),i=n),a?_.copyWorld(a,n,n,"destination-out"):_.copyWorld(s.canvas,d,h,"destination-out")),vo.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<p&&_.clearWorld(i)}),_.recycle(i)},innerShadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{innerShadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;ku(h,Su,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.save(),_.setWorldShadow(Su.offsetX+(o.x||0)*c*f,Su.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f),r=gl.getShadowTransform(t,_,s,o,Su,f,!0),r&&_.setTransform(r),bu(_,Su,s),_.restore(),a?(_.copyWorld(_,l,n,"copy"),_.copyWorld(a,n,n,"source-out"),i=n):(_.copyWorld(s.canvas,d,h,"source-out"),i=l),_.fillWorld(i,ll.string(o.color),"source-in"),vo.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<p&&_.clearWorld(i)}),_.recycle(i)},blur:function(t,e,s){const{blur:i}=t.__;s.setWorldBlur(i*t.__nowWorld.a),s.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),s.filter="none"},backgroundBlur:function(t,e,s){},getShadowRenderSpread:vu,getShadowTransform:function(t,e,s,i,r,n,o){if(i.spread){const s=2*i.spread*n*(o?-1:1),{width:a,height:h}=t.__layout.strokeBounds;return xu.set().scaleOfOuter({x:(r.x+r.width/2)*e.pixelRatio,y:(r.y+r.height/2)*e.pixelRatio},1+s/a,1+s/h),xu}},isTransformShadow(t){},getInnerShadowSpread:Bu},{excludeRenderBounds:Ru}=Lo;let Pu;function Tu(t,e,s,i,r,n,o,a){switch(e){case"grayscale":Pu||(Pu=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,s,i,r,n){const o=t.__nowWorld;s.resetTransform(),s.opacity=1,s.useMask(i,o),n&&i.recycle(o);Ou(t,e,s,1,r,n)}(t,s,i,r,o,a);break;case"opacity-path":Ou(t,s,i,n,o,a);break;case"path":a&&s.restore()}}function Lu(t){return t.getSameCanvas(!1,!0)}function Ou(t,e,s,i,r,n){const o=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(s,o,void 0,r),n?s.recycle(o):s.clearWorld(o)}Zl.prototype.__renderMask=function(t,e){let s,i,r,n,o,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(s=h[l],a=s.__.mask,a){o&&(Tu(this,o,t,r,i,n,void 0,!0),i=r=null),"clipping"!==a&&"clipping-path"!==a||Ru(s,e)||s.__render(t,e),n=s.__.opacity,Pu=!1,"path"===a||"clipping-path"===a?(n<1?(o="opacity-path",r||(r=Lu(t))):(o="path",t.save()),s.__clip(r||t,e)):(o="grayscale"===a?"grayscale":"alpha",i||(i=Lu(t)),r||(r=Lu(t)),s.__render(i,e));continue}const d=1===n&&s.__.__blendMode;d&&Tu(this,o,t,r,i,n,void 0,!1),Ru(s,e)||s.__render(r||t,e),d&&Tu(this,o,t,r,i,n,d,!1)}Tu(this,o,t,r,i,n,void 0,!0)};const Eu=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",Au=Eu+"_#~&*+\\=|≮≯≈≠=…",Iu=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[4352,4607],[12352,12447],[12448,12543],[12544,12591],[12592,12687],[12688,12703],[12704,12735],[12784,12799],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map(([t,e])=>`[\\u{${t.toString(16)}}-\\u{${e.toString(16)}}]`).join("|"),"u");function Mu(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const Wu=Mu("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),Du=Mu("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),Fu=Mu(Eu),zu=Mu(Au),Nu=Mu("- —/~|┆·");var Yu;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(Yu||(Yu={}));const{Letter:Xu,Single:Uu,Before:ju,After:Vu,Symbol:Gu,Break:qu}=Yu;function Hu(t){return Wu[t]?Xu:Nu[t]?qu:Du[t]?ju:Fu[t]?Vu:zu[t]?Gu:Iu.test(t)?Uu:Xu}const Qu={trimRight(t){const{words:e}=t;let s,i=0,r=e.length;for(let n=r-1;n>-1&&(s=e[n].data[0]," "===s.char);n--)i++,t.width-=s.width;i&&e.splice(r-i,i)}};function Ju(t,e,s){switch(e){case"title":return s?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:$u}=Qu,{Letter:Zu,Single:Ku,Before:t_,After:e_,Symbol:s_,Break:i_}=Yu;let r_,n_,o_,a_,h_,l_,d_,c_,u_,__,p_,g_,f_,y_,m_,x_,w_,v_=[];function b_(t,e){u_&&!c_&&(c_=u_),r_.data.push({char:t,width:e}),o_+=e}function k_(t){t&&(a_+=t,r_.addWidth=t),a_+=o_,r_.width=o_,n_.words.push(r_),r_={data:[]},o_=0}function S_(){y_&&(m_.paraNumber++,n_.paraStart=!0,y_=!1),u_&&(n_.startCharSize=c_,n_.endCharSize=u_,c_=0),n_.width=a_,x_.width?$u(n_):w_&&B_(),v_.push(n_),n_={words:[]},a_=0}function B_(){a_>(m_.maxWidth||0)&&(m_.maxWidth=a_)}const{top:C_,right:R_,bottom:P_,left:T_}=bt;function L_(t,e,s){const{bounds:i,rows:r}=t;i[e]+=s;for(let t=0;t<r.length;t++)r[t][e]+=s}const O_={getDrawData:function(t,e){a(t)||(t=String(t));let s=0,i=0,r=e.__getInput("width")||0,n=e.__getInput("height")||0;const{__padding:o}=e;e.motionText&&(r=n=0),o&&(r?(s=o[T_],r-=o[R_]+o[T_],!r&&(r=.01)):e.autoSizeAlign||(s=o[T_]),n?(i=o[C_],n-=o[C_]+o[P_],!n&&(n=.01)):e.autoSizeAlign||(i=o[C_]));const h={bounds:{x:s,y:i,width:r,height:n},rows:[],paraNumber:0,font:se.canvas.font=e.__font};return function(t,e,s){m_=t,v_=t.rows,x_=t.bounds,w_=!x_.width&&!s.autoSizeAlign;const{paraIndent:i,textCase:r}=s,{canvas:n}=se,{width:o}=x_;if(s.__isCharMode){const t="none"!==s.textWrap,a="break"===s.textWrap,h=s.__letterSpacing,l=s.__wordSpacing;y_=!0,p_=null,c_=d_=u_=o_=a_=0,r_={data:[]},n_={words:[]};for(let s=0,d=(e=[...e]).length;s<d;s++)l_=e[s],"\n"===l_?(o_&&k_(),n_.paraEnd=!0,S_(),y_=!0):(__=Hu(l_),__===Zu&&"none"!==r&&(l_=Ju(l_,r,!o_)),d_=n.measureText(l_).width,h&&(h<0&&(u_=d_),d_+=h),g_=__===Ku&&(p_===Ku||p_===Zu)||p_===Ku&&__!==e_,f_=!(__!==t_&&__!==Ku||p_!==s_&&p_!==e_),h_=y_&&i?o-i:o,t&&o&&a_+o_+d_>h_&&(a?(o_&&k_(),a_&&S_()):(f_||(f_=__===Zu&&p_==e_),g_||f_||__===i_||__===t_||__===Ku||o_+d_>h_?(o_&&k_(),a_&&S_()):a_&&S_()))," "===l_&&!0!==y_&&a_+o_===0||(__===i_?(" "===l_&&o_&&k_(l),b_(l_,d_),k_()):g_||f_?(o_&&k_(l),b_(l_,d_)):b_(l_,d_)),p_=__);o_&&k_(),a_&&S_(),v_.length>0&&(v_[v_.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{m_.paraNumber++,a_=n.measureText(t).width,v_.push({x:i||0,text:t,width:a_,paraStart:!0}),w_&&B_()})}(h,t,e),o&&function(t,e,s,i,r){if(!i&&s.autoSizeAlign)switch(s.textAlign){case"left":L_(e,"x",t[T_]);break;case"right":L_(e,"x",-t[R_])}if(!r&&s.autoSizeAlign)switch(s.verticalAlign){case"top":L_(e,"y",t[C_]);break;case"bottom":L_(e,"y",-t[P_])}}(o,h,e,r,n),function(t,e){const{rows:s,bounds:i}=t,r=s.length,{__lineHeight:n,__baseLine:o,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:g,height:f}=i,y=n*r+(c?c*(t.paraNumber-1):0),m=o;if(h&&y>f)y=Math.max(e.__autoHeight?y:f,n),r>1&&(t.overflow=r);else if(f||u)switch(d){case"middle":p+=(f-y)/2;break;case"bottom":p+=f-y}m+=p;let x,w,v,b=g||u?g:t.maxWidth;for(let o=0,d=r;o<d;o++){if(x=s[o],x.x=_,x.width<g||x.width>g&&!h)switch(l){case"center":x.x+=(b-x.width)/2;break;case"right":x.x+=b-x.width}x.paraStart&&c&&o>0&&(m+=c),x.y=m,m+=n,t.overflow>o&&m>y&&(x.isOverflow=!0,t.overflow=o+1),w=x.x,v=x.width,a<0&&(x.width<0?(v=-x.width+e.fontSize+a,w-=v,v+=e.fontSize):v-=a),w<i.x&&(i.x=w),v>i.width&&(i.width=v),h&&g&&g<v&&(x.isOverflow=!0,t.overflow||(t.overflow=s.length))}i.y=p,i.height=y}(h,e),e.__isCharMode&&function(t,e,s){const{rows:i}=t,{textAlign:r,paraIndent:n}=e,o=e.__letterSpacing||e.motionText,a=e.__wordSpacing,h=s&&r.includes("both"),l=h||s&&r.includes("justify"),d=l&&r.includes("letter");let c,u,_,p,g,f,y,m,x,w;i.forEach(t=>{t.words&&(g=n&&t.paraStart?n:0,m=t.words.length,l&&(w=!t.paraEnd||h,u=s-t.width-g,d?p=u/(t.words.reduce((t,e)=>t+e.data.length,0)-1):_=m>1?u/(m-1):0),f=o||t.isOverflow||d?0:_||a?1:2,t.isOverflow&&!o&&(t.textMode=!0),2===f?(t.x+=g,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=g,c=t.x,t.data=[],t.words.forEach((e,s)=>{1===f?(y={char:"",x:c},c=function(t,e,s){return t.forEach(t=>{s.char+=t.char,e+=t.width}),e}(e.data,c,y),(t.isOverflow||" "!==y.char)&&t.data.push(y)):c=function(t,e,s,i,r){return t.forEach(t=>{(i||" "!==t.char)&&(t.x=e,s.push(t)),e+=t.width,r&&(e+=r)}),e}(e.data,c,t.data,t.isOverflow,w&&p),e.addWidth&&(c+=e.addWidth),w&&(x=s===m-1,_?x||(c+=_,t.width+=_):p&&(t.width+=p*(e.data.length-(x?1:0))))})),t.words=null)})}(h,e,r),h.overflow&&function(t,e,s,i){const{rows:r,overflow:n}=t;let{textOverflow:o}=e;if(n&&r.splice(n),i&&o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const h=o?se.canvas.measureText(o).width:0,l=s+i-h;("none"===e.textWrap?r:[r[n-1]]).forEach(e=>{if(e.isOverflow&&e.data){let s=e.data.length-1;for(let i=s;i>-1&&(t=e.data[i],a=t.x+t.width,!(i===s&&a<l));i--){if(a<l&&" "!==t.char||!i){e.data.splice(i+1),e.width-=t.width;break}e.width-=t.width}e.width+=h,e.data.push({char:o,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(h,e,s,r),"none"!==e.textDecoration&&function(t,e){let s,i=0;const{fontSize:r,textDecoration:n}=e;switch(t.decorationHeight=r/11,_(n)?(s=n.type,n.color&&(t.decorationColor=ll.string(n.color)),n.offset&&(i=Math.min(.3*r,Math.max(n.offset,.15*-r)))):s=n,s){case"under":t.decorationY=[.15*r+i];break;case"delete":t.decorationY=[.35*-r];break;case"under-delete":t.decorationY=[.15*r+i,.35*-r]}}(h,e),h}};const E_={string:function(t,e){if(!t)return"#000";const s=l(e)&&e<1;if(a(t)){if(!s||!ll.object)return t;t=ll.object(t)}let i=n(t.a)?1:t.a;s&&(i*=e);const r=t.r+","+t.g+","+t.b;return 1===i?"rgb("+r+")":"rgba("+r+","+i+")"}};Object.assign(hl,O_),Object.assign(ll,E_),Object.assign(ul,pc),Object.assign(_l,qc),Object.assign(pl,uu),Object.assign(gl,Cu),zh();export{Pt as AlignHelper,e as Answer,Bt as AroundHelper,$t as AutoBounds,ds as BezierHelper,Qt as Bounds,ia as BoundsEvent,Vt as BoundsHelper,hd as Box,Tl as BoxData,Ih as Branch,Io as BranchHelper,Za as BranchRender,jd as Canvas,Xl as CanvasData,we as CanvasManager,Zo as ChildEvent,ll as ColorConvert,_e as Creator,f as DataHelper,ne as Debug,bt as Direction4,kt as Direction9,gl as Effect,md as Ellipse,Il as EllipseData,xs as EllipseHelper,$o as Event,me as EventCreator,wa as Eventer,yl as Export,Kr as FileHelper,fl as Filter,C as FourNumberHelper,ld as Frame,Ol as FrameData,Zl as Group,Pl as GroupData,Xd as Image,Yl as ImageData,sa as ImageEvent,hn as ImageManager,x as IncrementId,ca as LayoutEvent,tl as Layouter,qh as LayouterHelper,Sh as Leaf,Ha as LeafBounds,Lo as LeafBoundsHelper,m as LeafData,Aa as LeafDataProxy,Oa as LeafEventer,vo as LeafHelper,Jo as LeafLayout,Wh as LeafLevelList,Mh as LeafList,Na as LeafMatrix,Qa as LeafRender,ed as Leafer,Fh as LeaferCanvas,Ie as LeaferCanvasBase,Ll as LeaferData,_a as LeaferEvent,_n as LeaferFilm,un as LeaferImage,pn as LeaferVideo,Yd as Line,El as LineData,D as MathHelper,mt as Matrix,Z as MatrixHelper,Ud as MyImage,ze as NeedConvertToCanvasCommandMap,z as OneRadian,N as PI2,Y as PI_2,ul as Paint,pl as PaintGradient,_l as PaintImage,Jd as Path,cl as PathArrow,Nr as PathBounds,Pi as PathCommandDataHelper,De as PathCommandMap,ws as PathCommandNodeHelper,ri as PathConvert,Hr as PathCorner,qi as PathCreator,Dl as PathData,hr as PathDrawer,Me as PathHelper,t as PathNodeHandleType,Ue as PathNumberCommandLengthMap,Xe as PathNumberCommandMap,$d as Pen,Fl as PenData,se as Platform,ue as Plugin,ft as Point,dt as PointHelper,Cd as Polygon,Ml as PolygonData,ta as PropertyEvent,sd as Rect,Al as RectData,je as RectHelper,Ql as RectRender,ua as RenderEvent,sl as Renderer,la as ResizeEvent,on as Resource,le as Run,Ad as Star,Wl as StarData,ml as State,Kt as StringNumberMap,sn as TaskItem,rn as TaskProcessor,Qd as Text,hl as TextConvert,Nl as TextData,xl as Transition,wt as TwoPointBoundsHelper,$l as UI,Vl as UIBounds,ge as UICreator,Cl as UIData,ql as UIRender,dl as UnitConvert,Zt as UnitConvertHelper,No as WaitHelper,da as WatchEvent,Yh as Watcher,Mn as affectRenderBoundsType,En as affectStrokeBoundsType,xn as attr,Sn as autoLayoutType,Rn as boundsType,Zr as canvasPatch,Ae as canvasSizeAttrs,al as createAttr,yn as createDescriptor,Jn as cursorType,$n as dataProcessor,vn as dataType,mn as decorateLeafAttr,Kn as defineDataProcessor,gn as defineKey,wn as defineLeafAttr,Fn as dimType,Tn as doBoundsType,An as doStrokeType,Dn as doSurfaceType,il as effectType,r as emptyData,Hn as eraserType,ea as extraPropertyEventMap,ol as frameType,U as getBoundsData,fn as getDescriptor,j as getMatrixData,X as getPointData,Qn as hitType,u as isArray,p as isData,g as isEmptyData,h as isFinite,o as isNull,l as isNumber,_ as isObject,a as isString,bo as isTrackChanges,n as isUndefined,Zn as layoutProcessor,ma as leaferTransformAttrMap,Gn as maskType,Pn as naturalBoundsType,zn as opacityType,Qr as path,Ln as pathInputType,On as pathType,Jr as pen,bn as positionType,Ei as registerPointsCurve,ao as registerUI,ho as registerUIEvent,rl as resizeType,io as rewrite,ro as rewriteAble,Cn as rotationType,Bn as scaleType,kn as scrollType,jn as sortType,In as strokeType,Wn as surfaceType,Jt as tempBounds,xt as tempMatrix,yt as tempPoint,c as tryToNumber,zh as useCanvas,oo as useModule,Dh as version,Nn as visibleType,nl as zoomLayerType};
|
|
2
2
|
//# sourceMappingURL=worker.module.min.js.map
|