leafer-game 2.0.2 → 2.0.3

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.
@@ -1,2 +1,2 @@
1
- var t,e;function i(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o}function s(t,e,i,s){return new(i||(i=Promise))(function(n,r){function o(t){try{h(s.next(t))}catch(t){r(t)}}function a(t){try{h(s.throw(t))}catch(t){r(t)}}function h(t){t.done?n(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(o,a)}h((s=s.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 n={};function r(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,i){let s;Object.keys(e).forEach(n=>{var r,o;if(s=e[n],(null==s?void 0:s.constructor)===Object&&(null===(r=t[n])||void 0===r?void 0:r.constructor)===Object)return y(t[n],e[n],i&&i[n]);i&&n in i?(null===(o=i[n])||void 0===o?void 0:o.constructor)===Object&&y(t[n]={},e[n],i[n]):t[n]=e[n]})},copyAttrs:(t,e,i)=>(i.forEach(i=>{r(e[i])||(t[i]=e[i])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let i=0,s=t.length;i<s;i++)e[t[i]]=!0;return e},stintSet(t,e,i){i||(i=void 0),t[e]!==i&&(t[e]=i)}},{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(!r(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let i;for(let s in this)"_"!==s[0]&&(i=e?e[s]:void 0,t[s]=r(i)?this[s]:i);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!r(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!r(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const i={};if(t)if(u(t))for(let e of t)i[e]=this.__getInput(e);else for(let e in t)i[e]=this.__getInput(e);else{let t,e,{__input:s}=this;i.tag=this.__leaf.tag;for(let n in this)if("_"!==n[0]&&(t=this["_"+n],!r(t))){if("path"===n&&!this.__pathInputed)continue;e=s?s[n]:void 0,i[n]=r(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:s,d:n,e:r,f:o}=this.__leaf.__localMatrix;i.matrix={a:t,b:e,c:s,d:n,e:r,f:o}}return i}__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}}const v={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=w;return e[t]?e[t]++:(e[t]=1,0)}},w=v;let x,b,S;const{max:k}=Math,B=[0,0,0,0],P={zero:[...B],tempFour:B,set:(t,e,i,s,n)=>(void 0===i&&(i=s=n=e),t[0]=e,t[1]=i,t[2]=s,t[3]=n,t),setTemp:(t,e,i,s)=>T(B,t,e,i,s),toTempAB(t,e,i){S=i?l(t)?e:t:[],l(t)?(x=R(t),b=e):l(e)?(x=t,b=R(e)):(x=t,b=e),4!==x.length&&(x=E(x)),4!==b.length&&(b=E(b))},get(t,e){let i;if(!l(t))switch(t.length){case 4:i=r(e)?t:[...t];break;case 2:i=[t[0],t[1],t[0],t[1]];break;case 3:i=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(i||(i=[t,t,t,t]),!r(e))for(let t=0;t<4;t++)i[t]>e&&(i[t]=e);return i},max:(t,e,i)=>l(t)&&l(e)?k(t,e):(C(t,e,i),T(S,k(x[0],b[0]),k(x[1],b[1]),k(x[2],b[2]),k(x[3],b[3]))),add:(t,e,i)=>l(t)&&l(e)?t+e:(C(t,e,i),T(S,x[0]+b[0],x[1]+b[1],x[2]+b[2],x[3]+b[3])),swapAndScale(t,e,i,s){if(l(t))return e===i?t*e:[t*i,t*e];const n=s?t:[],[r,o,a,h]=4===t.length?t:E(t);return T(n,a*i,h*e,r*i,o*e)}},{set:T,get:E,setTemp:R,toTempAB:C}=P,{round:L,pow:O,max:A,floor:D,PI:M}=Math,F={within:(t,e,i)=>(_(e)&&(i=e.max,e=e.min),!r(e)&&t<e&&(t=e),!r(i)&&t>i&&(t=i),t),fourNumber:P.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),F.float(t)),getGapRotation(t,e,i=0){let s=t+i;if(e>1){const t=Math.abs(s%e);(t<1||t>e-1)&&(s=Math.round(s/e)*e)}return s-i},float(t,e){const i=r(e)?1e12:O(10,e);return-0===(t=L(t*i)/i)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,i,s){if(s||(s={}),e){const t=(l(e)?e:e.width||0)/i.width,n=(l(e)?e:e.height||0)/i.height;s.scaleX=t||n||1,s.scaleY=n||t||1}else t&&F.assignScale(s,t);return s},assignScale(t,e){l(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>A(D(t),e)/t,randInt:I,randColor:t=>`rgba(${I(255)},${I(255)},${I(255)},${t||1})`};function I(t){return Math.round(Math.random()*t)}const W=M/180,N=2*M,z=M/2;function Y(){return{x:0,y:0}}function X(){return{x:0,y:0,width:0,height:0}}function U(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:j,cos:H,acos:V,sqrt:q}=Math,{float:G}=F,K={};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 J={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:$(),tempMatrix:{},set(t,e=1,i=0,s=0,n=1,r=0,o=0){t.a=e,t.b=i,t.c=s,t.d=n,t.e=r,t.f=o},get:U,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,i){t.e+=e,t.f+=i},translateInner(t,e,i,s){t.e+=t.a*e+t.c*i,t.f+=t.b*e+t.d*i,s&&(t.e-=e,t.f-=i)},scale(t,e,i=e){t.a*=e,t.b*=e,t.c*=i,t.d*=i},pixelScale(t,e,i){i||(i=t),i.a=t.a*e,i.b=t.b*e,i.c=t.c*e,i.d=t.d*e,i.e=t.e*e,i.f=t.f*e},scaleOfOuter(t,e,i,s){Q.toInnerPoint(t,e,K),Q.scaleOfInner(t,K,i,s)},scaleOfInner(t,e,i,s=i){Q.translateInner(t,e.x,e.y),Q.scale(t,i,s),Q.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:i,b:s,c:n,d:r}=t,o=H(e*=W),a=j(e);t.a=i*o-s*a,t.b=i*a+s*o,t.c=n*o-r*a,t.d=n*a+r*o},rotateOfOuter(t,e,i){Q.toInnerPoint(t,e,K),Q.rotateOfInner(t,K,i)},rotateOfInner(t,e,i){Q.translateInner(t,e.x,e.y),Q.rotate(t,i),Q.translateInner(t,-e.x,-e.y)},skew(t,e,i){const{a:s,b:n,c:r,d:o}=t;i&&(i*=W,t.a=s+r*i,t.b=n+o*i),e&&(e*=W,t.c=r+s*e,t.d=o+n*e)},skewOfOuter(t,e,i,s){Q.toInnerPoint(t,e,K),Q.skewOfInner(t,K,i,s)},skewOfInner(t,e,i,s=0){Q.translateInner(t,e.x,e.y),Q.skew(t,i,s),Q.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:i,b:s,c:n,d:r,e:o,f:a}=t;t.a=e.a*i+e.b*n,t.b=e.a*s+e.b*r,t.c=e.c*i+e.d*n,t.d=e.c*s+e.d*r,t.e=e.e*i+e.f*n+o,t.f=e.e*s+e.f*r+a},multiplyParent(t,e,i,s,n){const{e:o,f:a}=t;if(i||(i=t),r(s)&&(s=1!==t.a||t.b||t.c||1!==t.d),s){const{a:s,b:r,c:o,d:a}=t;i.a=s*e.a+r*e.c,i.b=s*e.b+r*e.d,i.c=o*e.a+a*e.c,i.d=o*e.b+a*e.d,n&&(i.scaleX=e.scaleX*n.scaleX,i.scaleY=e.scaleY*n.scaleY)}else i.a=e.a,i.b=e.b,i.c=e.c,i.d=e.d,n&&(i.scaleX=e.scaleX,i.scaleY=e.scaleY);i.e=o*e.a+a*e.c+e.e,i.f=o*e.b+a*e.d+e.f},divide(t,e){Q.multiply(t,Q.tempInvert(e))},divideParent(t,e){Q.multiplyParent(t,Q.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=Q;return Q.copy(e,t),Q.invert(e),e},invert(t){const{a:e,b:i,c:s,d:n,e:r,f:o}=t;if(i||s){const a=1/(e*n-i*s);t.a=n*a,t.b=-i*a,t.c=-s*a,t.d=e*a,t.e=-(r*n-o*s)*a,t.f=-(o*e-r*i)*a}else if(1===e&&1===n)t.e=-r,t.f=-o;else{const i=1/(e*n);t.a=n*i,t.d=e*i,t.e=-r*n*i,t.f=-o*e*i}},toOuterPoint(t,e,i,s){const{x:n,y:r}=e;i||(i=e),i.x=n*t.a+r*t.c,i.y=n*t.b+r*t.d,s||(i.x+=t.e,i.y+=t.f)},toInnerPoint(t,e,i,s){const{a:n,b:r,c:o,d:a}=t,h=1/(n*a-r*o),{x:l,y:d}=e;if(i||(i=e),i.x=(l*a-d*o)*h,i.y=(d*n-l*r)*h,!s){const{e:e,f:s}=t;i.x-=(e*a-s*o)*h,i.y-=(s*n-e*r)*h}},setLayout(t,e,i,s,n){const{x:o,y:a,scaleX:h,scaleY:l}=e;if(r(n)&&(n=e.rotation||e.skewX||e.skewY),n){const{rotation:i,skewX:s,skewY:n}=e,r=i*W,o=H(r),a=j(r);if(s||n){const e=s*W,i=n*W;t.a=(o+i*-a)*h,t.b=(a+i*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,(i=i||s)&&Q.translateInner(t,-i.x,-i.y,!s)},getLayout(t,e,i,s){const{a:n,b:r,c:o,d:a,e:h,f:l}=t;let d,c,u,_,p,g=h,f=l;if(r||o){const t=n*a-r*o;if(o&&!s){d=q(n*n+r*r),c=t/d;const e=n/d;u=r>0?V(e):-V(e)}else{c=q(o*o+a*a),d=t/c;const e=o/c;u=z-(a>0?V(-e):-V(e))}const e=G(H(u)),i=j(u);d=G(d),c=G(c),_=e?G((o/c+i)/e/W,9):0,p=e?G((r/d-i)/e/W,9):0,u=G(u/W)}else d=n,c=a,u=_=p=0;return(e=i||e)&&(g+=e.x*n+e.y*o,f+=e.x*r+e.y*a,i||(g-=e.x,f-=e.y)),{x:g,y:f,scaleX:d,scaleY:c,rotation:u,skewX:_,skewY:p}},withScale(t,e,i=e){const s=t;if(!e||!i){const{a:s,b:n,c:r,d:o}=t;n||r?i=(s*o-n*r)/(e=q(s*s+n*n)):(e=s,i=o)}return s.scaleX=e,s.scaleY=i,s},reset(t){Q.set(t)}},Q=J,{float:Z}=F,{toInnerPoint:tt,toOuterPoint:et}=J,{sin:it,cos:st,abs:nt,sqrt:rt,atan2:ot,min:at,round:ht}=Math,lt={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,i=0){t.x=e,t.y=i},setRadius(t,e,i){t.radiusX=e,t.radiusY=r(i)?e:i},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,i){t.x=e,t.y=i},round(t,e){t.x=e?ht(t.x-.5)+.5:ht(t.x),t.y=e?ht(t.y-.5)+.5:ht(t.y)},move(t,e,i){_(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=i)},scale(t,e,i=e){t.x&&(t.x*=e),t.y&&(t.y*=i)},scaleOf(t,e,i,s=i){t.x+=(t.x-e.x)*(i-1),t.y+=(t.y-e.y)*(s-1)},rotate(t,e,i){i||(i=dt.defaultPoint);const s=st(e*=W),n=it(e),r=t.x-i.x,o=t.y-i.y;t.x=i.x+r*s-o*n,t.y=i.y+r*n+o*s},tempToInnerOf(t,e){const{tempPoint:i}=dt;return ut(i,t),tt(e,i,i),i},tempToOuterOf(t,e){const{tempPoint:i}=dt;return ut(i,t),et(e,i,i),i},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:i}=dt;return ut(i,t),dt.toInnerRadiusPointOf(t,e,i),i},copyRadiusPoint:(t,e,i,s)=>(ut(t,e),_t(t,i,s),t),toInnerRadiusPointOf(t,e,i){i||(i=t),tt(e,t,i),i.radiusX=Math.abs(t.radiusX/e.scaleX),i.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,i){tt(e,t,i)},toOuterOf(t,e,i){et(e,t,i)},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)=>ct(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,i,s){const n=nt(i-t),r=nt(s-e);return rt(n*n+r*r)},getMinDistanceFrom:(t,e,i,s,n,r)=>at(ct(t,e,i,s),ct(i,s,n,r)),getAngle:(t,e)=>pt(t,e)/W,getRotation:(t,e,i,s)=>(s||(s=e),dt.getRadianFrom(t.x,t.y,e.x,e.y,i.x,i.y,s.x,s.y)/W),getRadianFrom(t,e,i,s,n,o,a,h){r(a)&&(a=i,h=s);const l=t-i,d=e-s,c=n-a,u=o-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e)=>ot(e.y-t.y,e.x-t.x),getDistancePoint(t,e,i,s,n){const r=pt(t,e);return n&&(t=e),s||(e={}),e.x=t.x+st(r)*i,e.y=t.y+it(r)*i,e},toNumberPoints(t){let e=t;return _(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},isSame:(t,e)=>Z(t.x)===Z(e.x)&&Z(t.y)===Z(e.y),reset(t){dt.reset(t)}},dt=lt,{getDistanceFrom:ct,copy:ut,setRadius:_t,getAtan2:pt}=dt;class gt{constructor(t,e){this.set(t,e)}set(t,e){return _(t)?lt.copy(this,t):lt.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new gt(this)}move(t,e){return lt.move(this,t,e),this}scale(t,e){return lt.scale(this,t,e),this}scaleOf(t,e,i){return lt.scaleOf(this,t,e,i),this}rotate(t,e){return lt.rotate(this,t,e),this}rotateOf(t,e){return lt.rotate(this,e,t),this}getRotation(t,e,i){return lt.getRotation(this,t,e,i)}toInnerOf(t,e){return lt.toInnerOf(this,t,e),this}toOuterOf(t,e){return lt.toOuterOf(this,t,e),this}getCenter(t){return new gt(lt.getCenter(this,t))}getDistance(t){return lt.getDistance(this,t)}getDistancePoint(t,e,i,s){return new gt(lt.getDistancePoint(this,t,e,i,s))}getAngle(t){return lt.getAngle(this,t)}getAtan2(t){return lt.getAtan2(this,t)}isSame(t){return lt.isSame(this,t)}reset(){return lt.reset(this),this}}const ft=new gt;class yt{constructor(t,e,i,s,n,r){this.set(t,e,i,s,n,r)}set(t,e,i,s,n,r){return _(t)?J.copy(this,t):J.set(this,t,e,i,s,n,r),this}setWith(t){return J.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:i,d:s,e:n,f:r}=this;return{a:t,b:e,c:i,d:s,e:n,f:r}}clone(){return new yt(this)}translate(t,e){return J.translate(this,t,e),this}translateInner(t,e){return J.translateInner(this,t,e),this}scale(t,e){return J.scale(this,t,e),this}scaleWith(t,e){return J.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return J.pixelScale(this,t),this}scaleOfOuter(t,e,i){return J.scaleOfOuter(this,t,e,i),this}scaleOfInner(t,e,i){return J.scaleOfInner(this,t,e,i),this}rotate(t){return J.rotate(this,t),this}rotateOfOuter(t,e){return J.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return J.rotateOfInner(this,t,e),this}skew(t,e){return J.skew(this,t,e),this}skewOfOuter(t,e,i){return J.skewOfOuter(this,t,e,i),this}skewOfInner(t,e,i){return J.skewOfInner(this,t,e,i),this}multiply(t){return J.multiply(this,t),this}multiplyParent(t){return J.multiplyParent(this,t),this}divide(t){return J.divide(this,t),this}divideParent(t){return J.divideParent(this,t),this}invert(){return J.invert(this),this}invertWith(){return J.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,i){J.toOuterPoint(this,t,e,i)}toInnerPoint(t,e,i){J.toInnerPoint(this,t,e,i)}setLayout(t,e,i){return J.setLayout(this,t,e,i),this}getLayout(t,e,i){return J.getLayout(this,t,e,i)}withScale(t,e){return J.withScale(this,t,e)}reset(){J.reset(this)}}const mt=new yt,vt={tempPointBounds:{},setPoint(t,e,i){t.minX=t.maxX=e,t.minY=t.maxY=i},addPoint(t,e,i){t.minX=e<t.minX?e:t.minX,t.minY=i<t.minY?i:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=i>t.maxY?i:t.maxY},addBounds(t,e,i,s,n){wt(t,e,i),wt(t,e+s,i+n)},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:wt}=vt;var xt,bt;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(xt||(xt={})),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"}(bt||(bt={}));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 kt={directionData:St,tempPoint:{},get:Bt,toPoint(t,e,i,s,n,r){const o=Bt(t);i.x=o.x,i.y=o.y,"percent"===o.type&&(i.x*=e.width,i.y*=e.height,n&&(r||(i.x-=n.x,i.y-=n.y),o.x&&(i.x-=1===o.x?n.width:.5===o.x?o.x*n.width:0),o.y&&(i.y-=1===o.y?n.height:.5===o.y?o.y*n.height:0))),s||(i.x+=e.x,i.y+=e.y)},getPoint:(t,e,i)=>(i||(i={}),kt.toPoint(t,e,i,!0),i)};function Bt(t){return a(t)?St[bt[t]]:t}const{toPoint:Pt}=kt,Tt={toPoint(t,e,i,s,n,r){Pt(t,i,s,n,e,r)}},{tempPointBounds:Et,setPoint:Rt,addPoint:Ct,toBounds:Lt}=vt,{toOuterPoint:Ot}=J,{float:At,fourNumber:Dt}=F,{floor:Mt,ceil:Ft}=Math;let It,Wt,Nt,zt;const Yt={},Xt={},Ut={},jt={tempBounds:Ut,set(t,e=0,i=0,s=0,n=0){t.x=e,t.y=i,t.width=s,t.height=n},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,i,s,n){const{x:r,y:o,width:a,height:h}=e;if(u(i)){const e=Dt(i);s?Ht.set(t,r+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):Ht.set(t,r-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else s&&(i=-i),Ht.set(t,r-i,o-i,a+2*i,h+2*i);n&&("width"===n?(t.y=o,t.height=h):(t.x=r,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,i){t.x+=e,t.y+=i},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,i)=>(t=Object.assign({},t),Ht.move(t,e,i),t),toOffsetOutBounds(t,e,i){e?qt(e,t):e=t,i||(i=t),e.offsetX=Ht.maxX(i),e.offsetY=Ht.maxY(i),Ht.move(e,-e.offsetX,-e.offsetY)},scale(t,e,i=e,s){s||lt.scale(t,e,i),t.width*=e,t.height*=i},scaleOf(t,e,i,s=i){lt.scaleOf(t,e,i,s),t.width*=i,t.height*=s},tempToOuterOf:(t,e)=>(Ht.copy(Ut,t),Ht.toOuterOf(Ut,e),Ut),getOuterOf:(t,e)=>(t=Object.assign({},t),Ht.toOuterOf(t,e),t),toOuterOf(t,e,i){if(i||(i=t),0===e.b&&0===e.c){const{a:s,d:n,e:r,f:o}=e;s>0?(i.width=t.width*s,i.x=r+t.x*s):(i.width=t.width*-s,i.x=r+t.x*s-i.width),n>0?(i.height=t.height*n,i.y=o+t.y*n):(i.height=t.height*-n,i.y=o+t.y*n-i.height)}else Yt.x=t.x,Yt.y=t.y,Ot(e,Yt,Xt),Rt(Et,Xt.x,Xt.y),Yt.x=t.x+t.width,Ot(e,Yt,Xt),Ct(Et,Xt.x,Xt.y),Yt.y=t.y+t.height,Ot(e,Yt,Xt),Ct(Et,Xt.x,Xt.y),Yt.x=t.x,Ot(e,Yt,Xt),Ct(Et,Xt.x,Xt.y),Lt(Et,i)},toInnerOf(t,e,i){i||(i=t),Ht.move(i,-e.e,-e.f),Ht.scale(i,1/e.a,1/e.d)},getFitMatrix(t,e,i=1){const s=Math.min(i,Ht.getFitScale(t,e));return new yt(s,0,0,s,-e.x*s,-e.y*s)},getFitScale(t,e,i){const s=t.width/e.width,n=t.height/e.height;return i?Math.max(s,n):Math.min(s,n)},put(t,e,i="center",s=1,n=!0,r){r||(r=e),a(s)&&(s=Ht.getFitScale(t,e,"cover"===s)),Ut.width=n?e.width*=s:e.width*s,Ut.height=n?e.height*=s:e.height*s,Tt.toPoint(i,Ut,t,r,!0,!0)},getSpread(t,e,i){const s={};return Ht.copyAndSpread(s,t,e,!1,i),s},spread(t,e,i){Ht.copyAndSpread(t,t,e,!1,i)},shrink(t,e,i){Ht.copyAndSpread(t,t,e,!0,i)},ceil(t){const{x:e,y:i}=t;t.x=Mt(t.x),t.y=Mt(t.y),t.width=e>t.x?Ft(t.width+e-t.x):Ft(t.width),t.height=i>t.y?Ft(t.height+i-t.y):Ft(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=At(t.x,e),t.y=At(t.y,e),t.width=At(t.width,e),t.height=At(t.height,e)},add(t,e,i){It=t.x+t.width,Wt=t.y+t.height,Nt=e.x,zt=e.y,i||(Nt+=e.width,zt+=e.height),It=It>Nt?It:Nt,Wt=Wt>zt?Wt:zt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=It-t.x,t.height=Wt-t.y},addList(t,e){Ht.setListWithFn(t,e,void 0,!0)},setList(t,e,i=!1){Ht.setListWithFn(t,e,void 0,i)},addListWithFn(t,e,i){Ht.setListWithFn(t,e,i,!0)},setListWithFn(t,e,i,s=!1){let n,r=!0;for(let o=0,a=e.length;o<a;o++)n=i?i(e[o],o):e[o],n&&(n.width||n.height)&&(r?(r=!1,s||qt(t,n)):Vt(t,n));r&&Ht.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Rt(Et,t.x,t.y):Ct(Et,t.x,t.y)),Lt(Et,t)},setPoint(t,e){Ht.set(t,e.x,e.y)},addPoint(t,e){Vt(t,e,!0)},getPoints(t){const{x:e,y:i,width:s,height:n}=t;return[{x:e,y:i},{x:e+s,y:i},{x:e+s,y:i+n},{x:e,y:i+n}]},hitRadiusPoint:(t,e,i)=>(i&&(e=lt.tempToInnerRadiusPointOf(e,i)),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,i)=>(i&&(e=lt.tempToInnerOf(e,i)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,i)=>(i&&(e=Ht.tempToOuterOf(e,i)),!(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,i)=>(i&&(e=Ht.tempToOuterOf(e,i)),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,i){if(i&&(e=Ht.tempToOuterOf(e,i)),!Ht.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:s,y:n,width:r,height:o}=e;return It=s+r,Wt=n+o,Nt=t.x+t.width,zt=t.y+t.height,s=s>t.x?s:t.x,n=n>t.y?n:t.y,It=It<Nt?It:Nt,Wt=Wt<zt?Wt:zt,r=It-s,o=Wt-n,{x:s,y:n,width:r,height:o}},intersect(t,e,i){Ht.copy(t,Ht.getIntersectData(t,e,i))},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){Ht.set(t)}},Ht=jt,{add:Vt,copy:qt}=Ht;class Gt{get minX(){return jt.minX(this)}get minY(){return jt.minY(this)}get maxX(){return jt.maxX(this)}get maxY(){return jt.maxY(this)}constructor(t,e,i,s){this.set(t,e,i,s)}set(t,e,i,s){return _(t)?jt.copy(this,t):jt.set(this,t,e,i,s),this}get(){const{x:t,y:e,width:i,height:s}=this;return{x:t,y:e,width:i,height:s}}clone(){return new Gt(this)}move(t,e){return jt.move(this,t,e),this}scale(t,e,i){return jt.scale(this,t,e,i),this}scaleOf(t,e,i){return jt.scaleOf(this,t,e,i),this}toOuterOf(t,e){return jt.toOuterOf(this,t,e),this}toInnerOf(t,e){return jt.toInnerOf(this,t,e),this}getFitMatrix(t,e){return jt.getFitMatrix(this,t,e)}put(t,e,i){jt.put(this,t,e,i)}spread(t,e){return jt.spread(this,t,e),this}shrink(t,e){return jt.shrink(this,t,e),this}ceil(){return jt.ceil(this),this}unsign(){return jt.unsign(this),this}float(t){return jt.float(this,t),this}add(t){return jt.add(this,t),this}addList(t){return jt.setList(this,t,!0),this}setList(t){return jt.setList(this,t),this}addListWithFn(t,e){return jt.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return jt.setListWithFn(this,t,e),this}setPoint(t){return jt.setPoint(this,t),this}setPoints(t){return jt.setPoints(this,t),this}addPoint(t){return jt.addPoint(this,t),this}getPoints(){return jt.getPoints(this)}hitPoint(t,e){return jt.hitPoint(this,t,e)}hitRadiusPoint(t,e){return jt.hitRadiusPoint(this,t,e)}hit(t,e){return jt.hit(this,t,e)}includes(t,e){return jt.includes(this,t,e)}intersect(t,e){return jt.intersect(this,t,e),this}getIntersect(t,e){return new Gt(jt.getIntersectData(this,t,e))}isSame(t){return jt.isSame(this,t)}isEmpty(){return jt.isEmpty(this)}reset(){jt.reset(this)}}const Kt=new Gt;class $t{constructor(t,e,i,s,n,r){_(t)?this.copy(t):this.set(t,e,i,s,n,r)}set(t=0,e=0,i=0,s=0,n=0,r=0){this.top=t,this.right=e,this.bottom=i,this.left=s,this.width=n,this.height=r}copy(t){const{top:e,right:i,bottom:s,left:n,width:r,height:o}=t;this.set(e,i,s,n,r,o)}getBoundsFrom(t){const{top:e,right:i,bottom:s,left:n,width:r,height:o}=this;return new Gt(n,e,r||t.width-n-i,o||t.height-e-s)}}const Jt={number:(t,e)=>_(t)?"percent"===t.type?t.value*e:t.value:t},Qt={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:Zt,max:te}=Math,ee={toURL(t,e){let i=encodeURIComponent(t);return"text"===e?i="data:text/plain;charset=utf-8,"+i:"svg"===e&&(i="data:image/svg+xml,"+i),i},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",isLarge:(t,e,i,s)=>t.width*t.height*(e?e*i:1)>(s||ie.maxCacheSize),isSuperLarge:(t,e,i)=>ie.isLarge(t,e,i,ie.maxPatternSize),getRealURL(t){const{prefix:e,suffix:i}=ie;return!i||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+i),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,i,s,n,r,o,a,h,l){const d=te(Zt(e+(s||0)),1),c=te(Zt(i+(n||0)),1);let u,_,p;l&&(p=Jt.number(l.offset,"x"===l.type?e:i))&&("x"===l.type?u=!0:_=!0);const g=ee.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(r){const s=e/r.width,n=i/r.height;f.setTransform(s,0,0,n,-r.x*s,-r.y*n),f.drawImage(t,0,0,t.width,t.height)}else f.drawImage(t,0,0,e,i);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,i){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}i&&f.stintSet(i,"transform",e)}}},{image:ie}=ee,{randColor:se}=F;class ne{constructor(t){this.repeatMap={},this.name=t}static get(t){return new ne(t)}static set filter(t){this.filterList=re(t)}static set exclude(t){this.excludeList=re(t)}static drawRepaint(t,e){const i=se();t.fillWorld(e,i.replace("1)",".1)")),t.strokeWorld(e,i)}static drawBounds(t,e,i){const s="hit"===ne.showBounds,n=t.__nowWorld,r=se();s&&(e.setWorld(n),t.__drawHitPath(e),e.fillStyle=r.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(r,2),s?e.stroke():e.strokeWorld(n,r)}log(...t){if(oe.enable){if(oe.filterList.length&&oe.filterList.every(t=>t!==this.name))return;if(oe.excludeList.length&&oe.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){oe.enable&&this.warn(...t)}warn(...t){oe.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 re(t){return t?a(t)&&(t=[t]):t=[],t}ne.filterList=[],ne.excludeList=[],ne.showWarn=!0;const oe=ne,ae=ne.get("RunTime"),he={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const i=v.create(v.RUNTIME);return le.currentId=le.idMap[i]=e?performance.now():Date.now(),le.currentName=le.nameMap[i]=t,le.nameToIdMap[t]=i,i},end(t,e){const i=le.idMap[t],s=le.nameMap[t],n=e?(performance.now()-i)/1e3:Date.now()-i;le.idMap[t]=le.nameMap[t]=le.nameToIdMap[s]=void 0,ae.log(s,n,"ms")},endOfName(t,e){const i=le.nameToIdMap[t];r(i)||le.end(i,e)}},le=he,de=[],ce={list:{},add(t,...e){this.list[t]=!0,de.push(...e)},has(t,e){const i=this.list[t];return!i&&e&&this.need(t),i},need(t){console.error("please install and import plugin: "+(t.includes("-x")?"":"@leafer-in/")+t)}};setTimeout(()=>de.forEach(t=>ce.has(t,!0)));const ue={editor:t=>ce.need("editor")},_e=ne.get("UICreator"),pe={list:{},register(t){const{__tag:e}=t.prototype;ge[e]&&_e.repeat(e),ge[e]=t},get(t,e,i,s,n,o){if(!ge[t])return void _e.warn("not register "+t);const a=new ge[t](e);return r(i)||(a.x=i,s&&(a.y=s),n&&(a.width=n),o&&(a.height=o)),a}},{list:ge}=pe,fe=ne.get("EventCreator"),ye={nameList:{},register(t){let e;Object.keys(t).forEach(i=>{e=t[i],a(e)&&(me[e]&&fe.repeat(e),me[e]=t)})},changeName(t,e){const i=me[t];if(i){const s=Object.keys(i).find(e=>i[e]===t);s&&(i[s]=e,me[e]=i)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new me[t](...e)},{nameList:me}=ye;class ve{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:i}=this;for(let s=0,n=i.length;s<n;s++)if(e=i[s],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const s=ue.canvas(t);return this.add(s),s}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let i=0,s=this.list.length;i<s;i++)t=this.list[i],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 we(t){return(e,i)=>{t||(t=i);const s={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===i&&(s.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,i,s)}}const xe=[];function be(){return(t,e)=>{xe.push(e)}}const Se=[];let ke=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;xe.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,i,s,n,r){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,i,s,n,r){_(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,i,s,n,r)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,i,s){}strokeRect(t,e,i,s){}clearRect(t,e,i,s){}drawImage(t,e,i,s,n,r,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/s*a;s+=e,e=0,r+=t,a-=t}if(i<0){const t=-i/n*h;n+=i,i=0,o+=t,h-=t}this.context.drawImage(t,e,i,s,n,r,o,a,h);break;case 5:this.context.drawImage(t,e,i,s,n);break;case 3:this.context.drawImage(t,e,i)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,i,s,n,r){}quadraticCurveTo(t,e,i,s){}closePath(){}arc(t,e,i,s,n,r){}arcTo(t,e,i,s,n){}ellipse(t,e,i,s,n,r,o,a){}rect(t,e,i,s){}roundRect(t,e,i,s,n){}createConicGradient(t,e,i){}createLinearGradient(t,e,i,s){}createPattern(t,e){}createRadialGradient(t,e,i,s,n,r){}fillText(t,e,i,s){}measureText(t){}strokeText(t,e,i,s){}destroy(){this.context=null}};i([we("imageSmoothingEnabled")],ke.prototype,"smooth",void 0),i([we("imageSmoothingQuality")],ke.prototype,"smoothLevel",void 0),i([we("globalAlpha")],ke.prototype,"opacity",void 0),i([we()],ke.prototype,"fillStyle",void 0),i([we()],ke.prototype,"strokeStyle",void 0),i([we("lineWidth")],ke.prototype,"strokeWidth",void 0),i([we("lineCap")],ke.prototype,"strokeCap",void 0),i([we("lineJoin")],ke.prototype,"strokeJoin",void 0),i([we("lineDashOffset")],ke.prototype,"dashOffset",void 0),i([we()],ke.prototype,"miterLimit",void 0),i([we()],ke.prototype,"shadowBlur",void 0),i([we()],ke.prototype,"shadowColor",void 0),i([we()],ke.prototype,"shadowOffsetX",void 0),i([we()],ke.prototype,"shadowOffsetY",void 0),i([we()],ke.prototype,"filter",void 0),i([we()],ke.prototype,"font",void 0),i([we()],ke.prototype,"fontKerning",void 0),i([we()],ke.prototype,"fontStretch",void 0),i([we()],ke.prototype,"fontVariantCaps",void 0),i([we()],ke.prototype,"textAlign",void 0),i([we()],ke.prototype,"textBaseline",void 0),i([we()],ke.prototype,"textRendering",void 0),i([we()],ke.prototype,"wordSpacing",void 0),i([we()],ke.prototype,"letterSpacing",void 0),i([we()],ke.prototype,"direction",void 0),i([be()],ke.prototype,"setTransform",null),i([be()],ke.prototype,"resetTransform",null),i([be()],ke.prototype,"getTransform",null),i([be()],ke.prototype,"save",null),i([be()],ke.prototype,"restore",null),i([be()],ke.prototype,"translate",null),i([be()],ke.prototype,"scale",null),i([be()],ke.prototype,"rotate",null),i([be()],ke.prototype,"fill",null),i([be()],ke.prototype,"stroke",null),i([be()],ke.prototype,"clip",null),i([be()],ke.prototype,"fillRect",null),i([be()],ke.prototype,"strokeRect",null),i([be()],ke.prototype,"clearRect",null),i([be()],ke.prototype,"beginPath",null),i([be()],ke.prototype,"moveTo",null),i([be()],ke.prototype,"lineTo",null),i([be()],ke.prototype,"bezierCurveTo",null),i([be()],ke.prototype,"quadraticCurveTo",null),i([be()],ke.prototype,"closePath",null),i([be()],ke.prototype,"arc",null),i([be()],ke.prototype,"arcTo",null),i([be()],ke.prototype,"ellipse",null),i([be()],ke.prototype,"rect",null),i([be()],ke.prototype,"roundRect",null),i([be()],ke.prototype,"createConicGradient",null),i([be()],ke.prototype,"createLinearGradient",null),i([be()],ke.prototype,"createPattern",null),i([be()],ke.prototype,"createRadialGradient",null),i([be()],ke.prototype,"fillText",null),i([be()],ke.prototype,"measureText",null),i([be()],ke.prototype,"strokeText",null);const{copy:Be,multiplyParent:Pe,pixelScale:Te}=J,{round:Ee}=Math,Re=new Gt,Ce=new Gt,Le={width:1,height:1,pixelRatio:1},Oe=["width","height","pixelRatio"];class Ae extends ke{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=Le),this.manager=e,this.innerId=v.create(v.CNAVAS);const{width:i,height:s,pixelRatio:n}=t;this.autoLayout=!i||!s,this.size.pixelRatio=n||ee.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 i;this.context&&!this.unreal&&e&&this.width&&(i=this.getSameCanvas(),i.copyWorld(this));const s=this.size;f.copyAttrs(s,t,Oe),Oe.forEach(t=>s[t]||(s[t]=1)),this.bounds=new Gt(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&i&&(this.clearWorld(i.bounds),this.copyWorld(i),i.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:i,pixelSnap:s}=this,n=this.worldTransform;e&&Pe(t,e,n),Te(t,i,n),s&&!t.ignorePixelSnap&&(t.half&&t.half*i%2?(n.e=Ee(n.e-.5)+.5,n.f=Ee(n.f-.5)+.5):(n.e=Ee(n.e),n.f=Ee(n.f))),this.setTransform(n.a,n.b,n.c,n.d,n.e,n.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,i,s){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),i&&this.setStrokeOptions(i,s)}setStrokeOptions(t,e){let{strokeCap:i,strokeJoin:s,dashPattern:n,dashOffset:o,miterLimit:a}=t;e&&(e.strokeCap&&(i=e.strokeCap),e.strokeJoin&&(s=e.strokeJoin),r(e.dashPattern)||(n=e.dashPattern),r(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=i,this.strokeJoin=s,this.dashPattern=n,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,i=1){return!0}setWorldShadow(t,e,i,s){const{pixelRatio:n}=this;this.shadowOffsetX=t*n,this.shadowOffsetY=e*n,this.shadowBlur=i*n,this.shadowColor=s||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,i,s,n){s&&(this.blendMode=s),e?(this.setTempPixelBounds(e,n),i?(this.setTempPixelBounds2(i,n),i=Ce):i=Re,this.drawImage(t.view,Re.x,Re.y,Re.width,Re.height,i.x,i.y,i.width,i.height)):this.drawImage(t.view,0,0),s&&(this.blendMode="source-over")}copyWorldToInner(t,e,i,s,n){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,jt.tempToOuterOf(i,e),s,n),this.restore()):(s&&(this.blendMode=s),this.setTempPixelBounds(e,n),this.drawImage(t.view,Re.x,Re.y,Re.width,Re.height,i.x,i.y,i.width,i.height),s&&(this.blendMode="source-over"))}copyWorldByReset(t,e,i,s,n,r){this.resetTransform(),this.copyWorld(t,e,i,s,r),n||this.useWorldTransform()}useGrayscaleAlpha(t){let e,i;this.setTempPixelBounds(t,!0,!0);const{context:s}=this,n=s.getImageData(Re.x,Re.y,Re.width,Re.height),{data:r}=n;for(let t=0,s=r.length;t<s;t+=4)i=.299*r[t]+.587*r[t+1]+.114*r[t+2],(e=r[t+3])&&(r[t+3]=255===e?i:e*(i/255));s.putImageData(n,Re.x,Re.y)}useMask(t,e,i){this.copyWorld(t,e,i,"destination-in")}useEraser(t,e,i){this.copyWorld(t,e,i,"destination-out")}fillWorld(t,e,i,s){i&&(this.blendMode=i),this.fillStyle=e,this.setTempPixelBounds(t,s),this.fillRect(Re.x,Re.y,Re.width,Re.height),i&&(this.blendMode="source-over")}strokeWorld(t,e,i,s){i&&(this.blendMode=i),this.strokeStyle=e,this.setTempPixelBounds(t,s),this.strokeRect(Re.x,Re.y,Re.width,Re.height),i&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Re.x,Re.y,Re.width,Re.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Re.x,Re.y,Re.width,Re.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,i){this.copyToPixelBounds(Re,t,e,i)}setTempPixelBounds2(t,e,i){this.copyToPixelBounds(Ce,t,e,i)}copyToPixelBounds(t,e,i,s){t.set(e),s&&t.intersect(this.bounds),t.scale(this.pixelRatio),i&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:i,pixelSnap:s}=this,n=this.manager?this.manager.get(i):ue.canvas(Object.assign({},i));return n.save(),t&&(Be(n.worldTransform,this.worldTransform),n.useWorldTransform()),e&&(n.smooth=this.smooth),n.pixelSnap!==s&&(n.pixelSnap=s),n}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 De={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Me={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Fe=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},Me),Ie={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},We={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({},We),Me),ze=Fe,Ye={};for(let t in ze)Ye[ze[t]]=t;const Xe={};for(let t in ze)Xe[ze[t]]=Ie[t];const Ue={drawRoundRect(t,e,i,s,n,r){const o=F.fourNumber(r,Math.min(s/2,n/2)),a=e+s,h=i+n;o[0]?t.moveTo(e+o[0],i):t.moveTo(e,i),o[1]?t.arcTo(a,i,a,h,o[1]):t.lineTo(a,i),o[2]?t.arcTo(a,h,e,h,o[2]):t.lineTo(a,h),o[3]?t.arcTo(e,h,e,i,o[3]):t.lineTo(e,h),o[0]?t.arcTo(e,i,a,i,o[0]):t.lineTo(e,i)}},{sin:je,cos:He,hypot:Ve,atan2:qe,ceil:Ge,abs:Ke,PI:$e,sqrt:Je,pow:Qe}=Math,{setPoint:Ze,addPoint:ti}=vt,{set:ei,toNumberPoints:ii}=lt,{M:si,L:ni,C:ri,Q:oi,Z:ai}=Fe,hi={},li={points(t,e,i,s){let n=ii(e);if(t.push(si,n[0],n[1]),i&&n.length>5){let e,r,o,a,h,l,d,c,u,_,p,g,f,y,m,v=n.length;const w=!0===i?.5:i;s&&(n=[n[v-2],n[v-1],...n,n[0],n[1],n[2],n[3]],v=n.length);for(let i=2;i<v-2;i+=2)e=n[i-2],r=n[i-1],o=n[i],a=n[i+1],h=n[i+2],l=n[i+3],p=o-e,g=a-r,f=Je(Qe(p,2)+Qe(g,2)),y=Je(Qe(h-o,2)+Qe(l-a,2)),(f||y)&&(m=f+y,f=w*f/m,y=w*y/m,h-=e,l-=r,d=o-f*h,c=a-f*l,2===i?s||t.push(oi,d,c,o,a):(p||g)&&t.push(ri,u,_,d,c,o,a),u=o+y*h,_=a+y*l);s||t.push(oi,u,_,n[v-2],n[v-1])}else for(let e=2,i=n.length;e<i;e+=2)t.push(ni,n[e],n[e+1]);s&&t.push(ai)},rect(t,e,i,s,n){De.creator.path=t,De.creator.moveTo(e,i).lineTo(e+s,i).lineTo(e+s,i+n).lineTo(e,i+n).lineTo(e,i)},roundRect(t,e,i,s,n,r){De.creator.path=[],Ue.drawRoundRect(De.creator,e,i,s,n,r),t.push(...De.convertToCanvasData(De.creator.path,!0))},arcTo(t,e,i,s,n,r,o,a,h,l,d){const c=s-e,u=n-i,_=r-s,p=o-n;let g=qe(u,c),f=qe(p,_);const y=Ve(c,u),m=Ve(_,p);let v=f-g;if(v<0&&(v+=N),y<1e-12||m<1e-12||v<1e-12||Ke(v-$e)<1e-12)return t&&t.push(ni,s,n),h&&(Ze(h,e,i),ti(h,s,n)),d&&ei(d,e,i),void(l&&ei(l,s,n));const w=c*p-_*u<0,x=w?-1:1,b=a/He(v/2),S=s+b*He(g+v/2+z*x),k=n+b*je(g+v/2+z*x);return g-=z*x,f-=z*x,ui(t,S,k,a,a,0,g/W,f/W,w,h,l,d)},arc:(t,e,i,s,n,r,o,a,h,l)=>ui(t,e,i,s,s,0,n,r,o,a,h,l),ellipse(t,e,i,s,n,r,o,a,h,l,d,c){const u=r*W,_=je(u),p=He(u);let g=o*W,f=a*W;g>$e&&(g-=N),f<0&&(f+=N);let y=f-g;y<0?y+=N:y>N&&(y-=N),h&&(y-=N);const m=Ge(Ke(y/z)),v=y/m,w=je(v/4),x=8/3*w*w/je(v/2);f=g+v;let b,S,k,B,P,T,E,R,C=He(g),L=je(g),O=k=p*s*C-_*n*L,A=B=_*s*C+p*n*L,D=e+k,M=i+B;t&&t.push(t.length?ni:si,D,M),l&&Ze(l,D,M),c&&ei(c,D,M);for(let r=0;r<m;r++)b=He(f),S=je(f),k=p*s*b-_*n*S,B=_*s*b+p*n*S,P=e+O-x*(p*s*L+_*n*C),T=i+A-x*(_*s*L-p*n*C),E=e+k+x*(p*s*S+_*n*b),R=i+B+x*(_*s*S-p*n*b),t&&t.push(ri,P,T,E,R,e+k,i+B),l&&ci(e+O,i+A,P,T,E,R,e+k,i+B,l,!0),O=k,A=B,C=b,L=S,g=f,f+=v;d&&ei(d,e+k,i+B)},quadraticCurveTo(t,e,i,s,n,r,o){t.push(ri,(e+2*s)/3,(i+2*n)/3,(r+2*s)/3,(o+2*n)/3,r,o)},toTwoPointBoundsByQuadraticCurve(t,e,i,s,n,r,o,a){ci(t,e,(t+2*i)/3,(e+2*s)/3,(n+2*i)/3,(r+2*s)/3,n,r,o,a)},toTwoPointBounds(t,e,i,s,n,r,o,a,h,l){const d=[];let c,u,_,p,g,f,y,m,v=t,w=i,x=n,b=o;for(let t=0;t<2;++t)if(1==t&&(v=e,w=s,x=r,b=a),c=-3*v+9*w-9*x+3*b,u=6*v-12*w+6*x,_=3*w-3*v,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?ti(h,t,e):Ze(h,t,e),ti(h,o,a);for(let l=0,c=d.length;l<c;l++)di(d[l],t,e,i,s,n,r,o,a,hi),ti(h,hi.x,hi.y)},getPointAndSet(t,e,i,s,n,r,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*s+_*r+p*a,l.y=c*i+u*n+_*o+p*h},getPoint(t,e,i,s,n,r,o,a,h){const l={};return di(t,e,i,s,n,r,o,a,h,l),l},getDerivative(t,e,i,s,n){const r=1-t;return 3*r*r*(i-e)+6*r*t*(s-i)+3*t*t*(n-s)}},{getPointAndSet:di,toTwoPointBounds:ci,ellipse:ui}=li,{sin:_i,cos:pi,sqrt:gi,atan2:fi}=Math,{ellipse:yi}=li,mi={ellipticalArc(t,e,i,s,n,r,o,a,h,l,d){const c=(h-e)/2,u=(l-i)/2,_=r*W,p=_i(_),g=pi(_),f=-g*c-p*u,y=-g*u+p*c,m=s*s,v=n*n,w=y*y,x=f*f,b=m*v-m*w-v*x;let S=0;if(b<0){const t=gi(1-b/(m*v));s*=t,n*=t}else S=(o===a?-1:1)*gi(b/(m*w+v*x));const k=S*s*y/n,B=-S*n*f/s,P=fi((y-B)/n,(f-k)/s),T=fi((-y-B)/n,(-f-k)/s);let E=T-P;0===a&&E>0?E-=N:1===a&&E<0&&(E+=N);const R=e+c+g*k-p*B,C=i+u+p*k+g*B,L=E<0?1:0;d||ee.ellipseToCurve?yi(t,R,C,s,n,r,P/W,T/W,L):s!==n||r?t.push(Fe.G,R,C,s,n,r,P/W,T/W,L):t.push(Fe.O,R,C,s,P/W,T/W,L)}},vi={toCommand:t=>[],toNode:t=>[]},{M:wi,m:xi,L:bi,l:Si,H:ki,h:Bi,V:Pi,v:Ti,C:Ei,c:Ri,S:Ci,s:Li,Q:Oi,q:Ai,T:Di,t:Mi,A:Fi,a:Ii,Z:Wi,z:Ni,N:zi,D:Yi,X:Xi,G:Ui,F:ji,O:Hi,P:Vi,U:qi}=Fe,{rect:Gi,roundRect:Ki,arcTo:$i,arc:Ji,ellipse:Qi,quadraticCurveTo:Zi}=li,{ellipticalArc:ts}=mi,es=ne.get("PathConvert"),is={},ss={current:{dot:0},stringify(t,e){let i,s,n,r=0,o=t.length,a="";for(;r<o;){s=t[r],i=Xe[s],a+=s===n?" ":Ye[s];for(let s=1;s<i;s++)a+=F.float(t[r+s],e),s===i-1||(a+=" ");n=s,r+=i}return a},parse(t,e){let i,s,n,r="";const o=[],a=e?Ne:We;for(let e=0,h=t.length;e<h;e++)s=t[e],Qt[s]?("."===s&&(ns.dot&&(rs(o,r),r=""),ns.dot++),"0"===r&&"."!==s&&(rs(o,r),r=""),r+=s):Fe[s]?(r&&(rs(o,r),r=""),ns.name=Fe[s],ns.length=Ie[s],ns.index=0,rs(o,ns.name),!i&&a[s]&&(i=!0)):"-"===s||"+"===s?"e"===n||"E"===n?r+=s:(r&&rs(o,r),r=s):r&&(rs(o,r),r=""),n=s;return r&&rs(o,r),i?ss.toCanvasData(o,e):o},toCanvasData(t,e){let i,s,n,r,o,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(n=t[c],n){case xi:t[c+1]+=a,t[c+2]+=h;case wi:a=t[c+1],h=t[c+2],_.push(wi,a,h),c+=3;break;case Bi:t[c+1]+=a;case ki:a=t[c+1],_.push(bi,a,h),c+=2;break;case Ti:t[c+1]+=h;case Pi:h=t[c+1],_.push(bi,a,h),c+=2;break;case Si:t[c+1]+=a,t[c+2]+=h;case bi:a=t[c+1],h=t[c+2],_.push(bi,a,h),c+=3;break;case Li:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,n=Ci;case Ci:o=r===Ei||r===Ci,l=o?2*a-i:t[c+1],d=o?2*h-s:t[c+2],i=t[c+1],s=t[c+2],a=t[c+3],h=t[c+4],_.push(Ei,l,d,i,s,a,h),c+=5;break;case Ri:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,t[c+5]+=a,t[c+6]+=h,n=Ei;case Ei:i=t[c+3],s=t[c+4],a=t[c+5],h=t[c+6],_.push(Ei,t[c+1],t[c+2],i,s,a,h),c+=7;break;case Mi:t[c+1]+=a,t[c+2]+=h,n=Di;case Di:o=r===Oi||r===Di,i=o?2*a-i:t[c+1],s=o?2*h-s:t[c+2],e?Zi(_,a,h,i,s,t[c+1],t[c+2]):_.push(Oi,i,s,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case Ai:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,n=Oi;case Oi:i=t[c+1],s=t[c+2],e?Zi(_,a,h,i,s,t[c+3],t[c+4]):_.push(Oi,i,s,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case Ii:t[c+6]+=a,t[c+7]+=h;case Fi:ts(_,a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],e),a=t[c+6],h=t[c+7],c+=8;break;case Ni:case Wi:_.push(Wi),c++;break;case zi:a=t[c+1],h=t[c+2],e?Gi(_,a,h,t[c+3],t[c+4]):os(_,t,c,5),c+=5;break;case Yi:a=t[c+1],h=t[c+2],e?Ki(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):os(_,t,c,9),c+=9;break;case Xi:a=t[c+1],h=t[c+2],e?Ki(_,a,h,t[c+3],t[c+4],t[c+5]):os(_,t,c,6),c+=6;break;case Ui:Qi(e?_:os(_,t,c,9),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],t[c+8],null,is),a=is.x,h=is.y,c+=9;break;case ji:e?Qi(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):os(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case Hi:Ji(e?_:os(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,is),a=is.x,h=is.y,c+=7;break;case Vi:e?Ji(_,t[c+1],t[c+2],t[c+3],0,360,!1):os(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case qi:$i(e?_:os(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,is),a=is.x,h=is.y,c+=6;break;default:return es.error(`command: ${n} [index:${c}]`,t),_}r=n}return _},objectToCanvasData(t){if(t[0].name.length>1)return vi.toCommand(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(wi,t.x,t.y);break;case"L":e.push(bi,t.x,t.y);break;case"C":e.push(Ei,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Oi,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(Wi)}}),e}},copyData(t,e,i,s){for(let n=i,r=i+s;n<r;n++)t.push(e[n])},pushData(t,e){ns.index===ns.length&&(ns.index=1,t.push(ns.name)),t.push(Number(e)),ns.index++,ns.dot=0}},{current:ns,pushData:rs,copyData:os}=ss,{M:as,L:hs,C:ls,Q:ds,Z:cs,N:us,D:_s,X:ps,G:gs,F:fs,O:ys,P:ms,U:vs}=Fe,{getMinDistanceFrom:ws,getRadianFrom:xs}=lt,{tan:bs,min:Ss,abs:ks}=Math,Bs={},Ps={beginPath(t){t.length=0},moveTo(t,e,i){t.push(as,e,i)},lineTo(t,e,i){t.push(hs,e,i)},bezierCurveTo(t,e,i,s,n,r,o){t.push(ls,e,i,s,n,r,o)},quadraticCurveTo(t,e,i,s,n){t.push(ds,e,i,s,n)},closePath(t){t.push(cs)},rect(t,e,i,s,n){t.push(us,e,i,s,n)},roundRect(t,e,i,s,n,r){if(l(r))t.push(ps,e,i,s,n,r);else{const o=F.fourNumber(r);o?t.push(_s,e,i,s,n,...o):t.push(us,e,i,s,n)}},ellipse(t,e,i,s,n,r,a,h,l){if(s===n)return Es(t,e,i,s,a,h,l);o(r)?t.push(fs,e,i,s,n):(o(a)&&(a=0),o(h)&&(h=360),t.push(gs,e,i,s,n,r,a,h,l?1:0))},arc(t,e,i,s,n,r,a){o(n)?t.push(ms,e,i,s):(o(n)&&(n=0),o(r)&&(r=360),t.push(ys,e,i,s,n,r,a?1:0))},arcTo(t,e,i,s,n,o,a,h,l){if(!r(a)){const t=ws(a,h,e,i,s,n)/(l?1:2);o=Ss(o,Ss(t,t*ks(bs(xs(a,h,e,i,s,n)/2))))}t.push(vs,e,i,s,n,o)},drawEllipse(t,e,i,s,n,r,a,h,l){li.ellipse(null,e,i,s,n,o(r)?0:r,o(a)?0:a,o(h)?360:h,l,null,null,Bs),t.push(as,Bs.x,Bs.y),Ts(t,e,i,s,n,r,a,h,l)},drawArc(t,e,i,s,n,r,a){li.arc(null,e,i,s,o(n)?0:n,o(r)?360:r,a,null,null,Bs),t.push(as,Bs.x,Bs.y),Es(t,e,i,s,n,r,a)},drawPoints(t,e,i,s){li.points(t,e,i,s)}},{ellipse:Ts,arc:Es}=Ps,{moveTo:Rs,lineTo:Cs,quadraticCurveTo:Ls,bezierCurveTo:Os,closePath:As,beginPath:Ds,rect:Ms,roundRect:Fs,ellipse:Is,arc:Ws,arcTo:Ns,drawEllipse:zs,drawArc:Ys,drawPoints:Xs}=Ps;class Us{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?a(t)?De.parse(t):t:[],this}beginPath(){return Ds(this.__path),this.paint(),this}moveTo(t,e){return Rs(this.__path,t,e),this.paint(),this}lineTo(t,e){return Cs(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,i,s,n,r){return Os(this.__path,t,e,i,s,n,r),this.paint(),this}quadraticCurveTo(t,e,i,s){return Ls(this.__path,t,e,i,s),this.paint(),this}closePath(){return As(this.__path),this.paint(),this}rect(t,e,i,s){return Ms(this.__path,t,e,i,s),this.paint(),this}roundRect(t,e,i,s,n){return Fs(this.__path,t,e,i,s,n),this.paint(),this}ellipse(t,e,i,s,n,r,o,a){return Is(this.__path,t,e,i,s,n,r,o,a),this.paint(),this}arc(t,e,i,s,n,r){return Ws(this.__path,t,e,i,s,n,r),this.paint(),this}arcTo(t,e,i,s,n){return Ns(this.__path,t,e,i,s,n),this.paint(),this}drawEllipse(t,e,i,s,n,r,o,a){return zs(this.__path,t,e,i,s,n,r,o,a),this.paint(),this}drawArc(t,e,i,s,n,r){return Ys(this.__path,t,e,i,s,n,r),this.paint(),this}drawPoints(t,e,i){return Xs(this.__path,t,e,i),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:js,L:Hs,C:Vs,Q:qs,Z:Gs,N:Ks,D:$s,X:Js,G:Qs,F:Zs,O:tn,P:en,U:sn}=Fe,nn=ne.get("PathDrawer"),rn={drawPathByData(t,e){if(!e)return;let i,s=0,n=e.length;for(;s<n;)switch(i=e[s],i){case js:t.moveTo(e[s+1],e[s+2]),s+=3;break;case Hs:t.lineTo(e[s+1],e[s+2]),s+=3;break;case Vs:t.bezierCurveTo(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5],e[s+6]),s+=7;break;case qs:t.quadraticCurveTo(e[s+1],e[s+2],e[s+3],e[s+4]),s+=5;break;case Gs:t.closePath(),s+=1;break;case Ks:t.rect(e[s+1],e[s+2],e[s+3],e[s+4]),s+=5;break;case $s:t.roundRect(e[s+1],e[s+2],e[s+3],e[s+4],[e[s+5],e[s+6],e[s+7],e[s+8]]),s+=9;break;case Js:t.roundRect(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]),s+=6;break;case Qs:t.ellipse(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]*W,e[s+6]*W,e[s+7]*W,e[s+8]),s+=9;break;case Zs:t.ellipse(e[s+1],e[s+2],e[s+3],e[s+4],0,0,N,!1),s+=5;break;case tn:t.arc(e[s+1],e[s+2],e[s+3],e[s+4]*W,e[s+5]*W,e[s+6]),s+=7;break;case en:t.arc(e[s+1],e[s+2],e[s+3],0,N,!1),s+=4;break;case sn:t.arcTo(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]),s+=6;break;default:return void nn.error(`command: ${i} [index:${s}]`,e)}}},{M:on,L:an,C:hn,Q:ln,Z:dn,N:cn,D:un,X:_n,G:pn,F:gn,O:fn,P:yn,U:mn}=Fe,{toTwoPointBounds:vn,toTwoPointBoundsByQuadraticCurve:wn,arcTo:xn,arc:bn,ellipse:Sn}=li,{addPointBounds:kn,copy:Bn,addPoint:Pn,setPoint:Tn,addBounds:En,toBounds:Rn}=vt,Cn=ne.get("PathBounds");let Ln,On,An;const Dn={},Mn={},Fn={},In={toBounds(t,e){In.toTwoPointBounds(t,Mn),Rn(Mn,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Tn(e,0,0);let i,s,n,r,o,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(o=t[a],0===a&&(o===dn||o===hn||o===ln?Tn(e,h,l):Tn(e,t[a+1],t[a+2])),o){case on:case an:h=t[a+1],l=t[a+2],Pn(e,h,l),a+=3;break;case hn:n=t[a+5],r=t[a+6],vn(h,l,t[a+1],t[a+2],t[a+3],t[a+4],n,r,Dn),kn(e,Dn),h=n,l=r,a+=7;break;case ln:i=t[a+1],s=t[a+2],n=t[a+3],r=t[a+4],wn(h,l,i,s,n,r,Dn),kn(e,Dn),h=n,l=r,a+=5;break;case dn:a+=1;break;case cn:h=t[a+1],l=t[a+2],En(e,h,l,t[a+3],t[a+4]),a+=5;break;case un:case _n:h=t[a+1],l=t[a+2],En(e,h,l,t[a+3],t[a+4]),a+=o===un?9:6;break;case pn:Sn(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],Dn,Fn),0===a?Bn(e,Dn):kn(e,Dn),h=Fn.x,l=Fn.y,a+=9;break;case gn:h=t[a+1],l=t[a+2],On=t[a+3],An=t[a+4],En(e,h-On,l-An,2*On,2*An),h+=On,a+=5;break;case fn:bn(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Dn,Fn),0===a?Bn(e,Dn):kn(e,Dn),h=Fn.x,l=Fn.y,a+=7;break;case yn:h=t[a+1],l=t[a+2],Ln=t[a+3],En(e,h-Ln,l-Ln,2*Ln,2*Ln),h+=Ln,a+=4;break;case mn:xn(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Dn,Fn),0===a?Bn(e,Dn):kn(e,Dn),h=Fn.x,l=Fn.y,a+=6;break;default:return void Cn.error(`command: ${o} [index:${a}]`,t)}}},{M:Wn,L:Nn,Z:zn}=Fe,{getCenterX:Yn,getCenterY:Xn}=lt,{arcTo:Un}=Ps,jn={smooth(t,e,i){let s,n,r,o=0,a=0,h=0,l=0,d=0,c=0,_=0,p=0,g=0;u(e)&&(e=e[0]||0);const f=t.length,y=9===f,m=[];for(;o<f;){switch(s=t[o],s){case Wn:l=p=t[o+1],d=g=t[o+2],o+=3,t[o]===Nn?(c=t[o+1],_=t[o+2],y?m.push(Wn,l,d):m.push(Wn,Yn(l,c),Xn(d,_))):m.push(Wn,l,d);break;case Nn:switch(a=t[o+1],h=t[o+2],o+=3,t[o]){case Nn:Un(m,a,h,t[o+1],t[o+2],e,p,g,y);break;case zn:Un(m,a,h,l,d,e,p,g,y);break;default:m.push(Nn,a,h)}p=a,g=h;break;case zn:n!==zn&&(Un(m,l,d,c,_,e,p,g,y),m.push(zn)),o+=1;break;default:r=Xe[s];for(let e=0;e<r;e++)m.push(t[o+e]);o+=r}n=s}return s!==zn&&(m[1]=l,m[2]=d),m}};function Hn(t){return new Us(t)}const Vn=Hn();De.creator=Hn(),De.parse=ss.parse,De.convertToCanvasData=ss.toCanvasData;const{drawRoundRect:qn}=Ue;function Gn(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,i,s,n){qn(this,t,e,i,s,n)})}(t)}const Kn={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=$n.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{}}}},$n=Kn;$n.mineType=$n.mimeType,$n.alphaPixelTypes.forEach(t=>$n.upperCaseTypeMap[t]=t.toUpperCase());const Jn=ne.get("TaskProcessor");class Qn{constructor(t){this.parallel=!0,this.time=1,this.id=v.create(v.TASK),this.task=t}run(){return s(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){Jn.error(t)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}}class Zn{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,i=0;for(let s=0;s<t;s++)s<=this.finishedIndex?(i+=this.list[s].time,s===this.finishedIndex&&(e=i)):e+=this.list[s].time;return this.isComplete?1:i/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,i){let s,n,o,a;const h=new Qn(t);return h.parent=this,l(e)?a=e:e&&(n=e.parallel,s=e.start,o=e.time,a=e.delay,i||(i=e.canUse)),o&&(h.time=o),!1===n&&(h.parallel=!1),i&&(h.canUse=i),r(a)?this.push(h,s):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(h,s))},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:i,index:s}=this;this.parallelList=[],this.parallelSuccessNumber=0;let n=s+e.parallel;if(n>i.length&&(n=i.length),e.parallel>1)for(let e=s;e<n&&(t=i[e],t.parallel);e++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const i=e.length,s=this.finishedIndex+i;if(e.length){if(!this.running)return;s<this.total&&(t=this.list[s],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 tr=ne.get("Resource"),er={tasker:new Zn,queue:new Zn({parallel:1}),map:{},get isComplete(){return ir.tasker.isComplete},set(t,e){ir.map[t]&&tr.repeat(t),ir.map[t]=e},get:t=>ir.map[t],remove(t){const e=ir.map[t];e&&(e.destroy&&e.destroy(),delete ir.map[t])},loadImage(t,e){return new Promise((i,s)=>{const n=this.setImage(t,t,e);n.load(()=>i(n),t=>s(t))})},setImage(t,e,i){let s;return a(e)?s={url:e}:e.url||(s={url:t,view:e}),s&&(i&&(s.format=i),e=ue.image(s)),ir.set(t,e),e},loadFilm(t,e){},loadVideo(t,e){},destroy(){ir.map={}}},ir=er,sr={maxRecycled:10,recycledList:[],patternTasker:er.queue,get(t,e){let i=er.get(t.url);return i||er.set(t.url,i="film"===e?ue.film(t):ue.image(t)),i.use++,i},recycle(t){t.use--,setTimeout(()=>{t.use||(ee.image.isLarge(t)?t.url&&er.remove(t.url):(t.clearLevels(),nr.recycledList.push(t)))})},recyclePaint(t){nr.recycle(t.image)},clearRecycled(t){const e=nr.recycledList;(e.length>nr.maxRecycled||t)&&(e.forEach(e=>(!e.use||t)&&e.url&&er.remove(e.url)),e.length=0)},clearLevels(){},hasAlphaPixel:t=>Kn.alphaPixelTypes.some(e=>nr.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:i}=e;if(i.startsWith("data:")){if(i.startsWith("data:"+Kn.mimeType(t)))return!0}else{if(i.includes("."+t)||i.includes("."+Kn.upperCaseTypeMap[t]))return!0;if("png"===t&&!i.includes("."))return!0}return!1},destroy(){this.clearRecycled(!0)}},nr=sr,{IMAGE:rr,create:or}=v;class ar{get tag(){return"Image"}get url(){return this.config.url}get crossOrigin(){const{crossOrigin:t}=this.config;return r(t)?ee.image.crossOrigin:t}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=or(rr),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}sr.isFormat("svg",t)&&(this.isSVG=!0),sr.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e,i){return this.loading||(this.loading=!0,er.tasker.add(()=>s(this,void 0,void 0,function*(){return yield ee.origin["load"+this.tag](this.getLoadUrl(i),this.crossOrigin,this).then(t=>{i&&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 i=this.waitComplete;if(e){const e=i[t+1];e&&e({type:"stop"})}i[t]=i[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((i,s)=>{e=s%2,i&&(t?e||i(this):e&&i(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,i,s,n,r,o,a){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let i in t)if(t[i]!==arguments[i]){e=null;break}if(e)return e}const h=ee.image.resize(this.view,t,e,n,r,void 0,o,i,s,a);return this.cache=this.use>1?{data:h,params:arguments}:null,h}getPattern(t,e,i,s){const n=ee.canvas.createPattern(t,e);return ee.image.setPatternTransform(n,i,s),n}render(t,e,i,s,n,r,o,a,h){t.drawImage(this.view,e,i,s,n)}getLoadUrl(t){return this.url}setThumbView(t){}getThumbSize(t){}getMinLevel(){}getLevelData(t,e,i){}clearLevels(t){}destroy(){this.clearLevels();const{view:t}=this;t&&t.close&&t.close(),this.config={url:""},this.cache=this.view=null,this.waitComplete.length=0}}class hr extends ar{get tag(){return"Film"}}class lr extends ar{get tag(){return"Video"}}function dr(t,e,i,s){s||(i.configurable=i.enumerable=!0),Object.defineProperty(t,e,i)}function cr(t,e){return Object.getOwnPropertyDescriptor(t,e)}function ur(t,e){const i="_"+t;return{get(){const t=this[i];return null==t?e:t},set(t){this[i]=t}}}function _r(t,e){return(i,s)=>gr(i,s,t,e&&e(s))}function pr(t){return t}function gr(t,e,i,s){const n={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};dr(t,e,Object.assign(n,s||{})),jr(t,e,i)}function fr(t){return _r(t)}function yr(t,e){return _r(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function mr(t,e){return _r(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function vr(t){return _r(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),kr(this))}}))}function wr(t,e){return _r(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function xr(t,e){return _r(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function br(t,e){return _r(t,t=>({set(i){this.__setAttr(t,i,e)&&kr(this)}}))}function Sr(t){return _r(t,t=>({set(e){this.__setAttr(t,e)&&(kr(this),this.__.__removeNaturalSize())}}))}function kr(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function Br(t){return _r(t,t=>({set(e){const i=this.__;2!==i.__pathInputed&&(i.__pathInputed=e?1:0),e||(i.__pathForRender=void 0),this.__setAttr(t,e),kr(this)}}))}const Pr=br;function Tr(t,e){return _r(t,t=>({set(i){this.__setAttr(t,i)&&(Er(this),e&&(this.__.__useStroke=!0))}}))}function Er(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&kr(t)}const Rr=Tr;function Cr(t){return _r(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Lr(t){return _r(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function Or(t){return _r(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;f.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip),this.__layout.surfaceChange()}}}))}function Ar(t){return _r(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&Mr(this)}}))}function Dr(t){return _r(t,t=>({set(e){const i=this.visible;if(!0===i&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>Fr(this,t,e,i))}else 0===i&&!0===e&&this.animation&&this.__runAnimation("in");Fr(this,t,e,i),this.mask&&Mr(this)}}))}function Mr(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function Fr(t,e,i,s){t.__setAttr(e,i)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==s&&0!==i||kr(t))}function Ir(t){return _r(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChange(),this.waitParent(()=>{this.parent.__layout.childrenSortChange()}))}}))}function Wr(t){return _r(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function Nr(t){return _r(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function zr(t){return _r(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===ne.showBounds&&this.__layout.surfaceChange(),this.leafer&&this.leafer.updateCursor())}}))}function Yr(t){return _r(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function Xr(t){return(e,i)=>{dr(e,"__DataProcessor",{get:()=>t})}}function Ur(t){return(e,i)=>{dr(e,"__LayoutProcessor",{get:()=>t})}}function jr(t,e,i){const s=t.__DataProcessor.prototype,n="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=ur(e,i);if(r(i))a.get=function(){return this[n]};else if("function"==typeof i)a.get=function(){const t=this[n];return null==t?i(this.__leaf):t};else if(_(i)){const t=g(i);a.get=function(){const e=this[n];return null==e?this[n]=t?{}:f.clone(i):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalWidth,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&s.children.length?s.boxBounds.width:i}return t}:"height"===e&&(a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalHeight,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&s.children.length?s.boxBounds.height:i}return t});let l,d=s;for(;!l&&d;)l=cr(d,e),d=d.__proto__;l&&l.set&&(a.set=l.set),s[o]&&(a.set=s[o],delete s[o]),dr(s,e,a)}const Hr=new ne("rewrite"),Vr=[],qr=["destroy","constructor"];function Gr(t){return(e,i)=>{Vr.push({name:e.constructor.name+"."+i,run:()=>{e[i]=t}})}}function Kr(){return t=>{$r()}}function $r(t){Vr.length&&(Vr.forEach(e=>{t&&Hr.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),Vr.length=0)}function Jr(t,e){return i=>{var s;(t.prototype?(s=t.prototype,Object.getOwnPropertyNames(s)):Object.keys(t)).forEach(s=>{if(!(qr.includes(s)||e&&e.includes(s)))if(t.prototype){cr(t.prototype,s).writable&&(i.prototype[s]=t.prototype[s])}else i.prototype[s]=t[s]})}}function Qr(){return t=>{pe.register(t)}}function Zr(){return t=>{ye.register(t)}}setTimeout(()=>$r(!0));const{copy:to,toInnerPoint:eo,toOuterPoint:io,scaleOfOuter:so,rotateOfOuter:no,skewOfOuter:ro,multiplyParent:oo,divideParent:ao,getLayout:ho}=J,lo={},{round:co}=Math,uo={updateAllMatrix(t,e,i){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(i=!0),go(t,e,i),t.isBranch){const{children:s}=t;for(let t=0,n=s.length;t<n;t++)po(s[t],e,i)}},updateMatrix(t,e,i){const s=t.__layout;e?i&&(s.waitAutoLayout=!0,t.__hasAutoLayout&&(s.matrixChanged=!1)):s.waitAutoLayout&&(s.waitAutoLayout=!1),s.matrixChanged&&t.__updateLocalMatrix(),s.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)fo(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&fo(t),t.__updateChange()},updateAllChange(t){if(mo(t),t.isBranch){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)yo(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,i,s,n,r){s||(s=t.__nowWorld),t.__worldFlipped||ee.fullImageShadow?e.copyWorldByReset(i,s,t.__nowWorld,n,r):e.copyWorldToInner(i,s,t.__layout.renderBounds,n)},moveWorld(t,e,i=0,s,n){const r=_(e)?Object.assign({},e):{x:e,y:i};s?io(t.localTransform,r,r,!0):t.parent&&eo(t.parent.scrollWorldTransform,r,r,!0),_o.moveLocal(t,r.x,r.y,n)},moveLocal(t,e,i=0,s){_(e)&&(i=e.y,e=e.x),e+=t.x,i+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=co(e),i=co(i)),s?t.animate({x:e,y:i},s):(t.x=e,t.y=i)},zoomOfWorld(t,e,i,s,n,r){_o.zoomOfLocal(t,vo(t,e),i,s,n,r)},zoomOfLocal(t,e,i,s=i,n,r){const o=t.__localMatrix;if(l(s)||(s&&(r=s),s=i),to(lo,o),so(lo,e,i,s),_o.hasHighPosition(t))_o.setTransform(t,lo,n,r);else{const e=t.x+lo.e-o.e,a=t.y+lo.f-o.f;r&&!n?t.animate({x:e,y:a,scaleX:t.scaleX*i,scaleY:t.scaleY*s},r):(t.x=e,t.y=a,t.scaleResize(i,s,!0!==n))}},rotateOfWorld(t,e,i,s){_o.rotateOfLocal(t,vo(t,e),i,s)},rotateOfLocal(t,e,i,s){const n=t.__localMatrix;to(lo,n),no(lo,e,i),_o.hasHighPosition(t)?_o.setTransform(t,lo,!1,s):t.set({x:t.x+lo.e-n.e,y:t.y+lo.f-n.f,rotation:F.formatRotation(t.rotation+i)},s)},skewOfWorld(t,e,i,s,n,r){_o.skewOfLocal(t,vo(t,e),i,s,n,r)},skewOfLocal(t,e,i,s=0,n,r){to(lo,t.__localMatrix),ro(lo,e,i,s),_o.setTransform(t,lo,n,r)},transformWorld(t,e,i,s){to(lo,t.worldTransform),oo(lo,e),t.parent&&ao(lo,t.parent.scrollWorldTransform),_o.setTransform(t,lo,i,s)},transform(t,e,i,s){to(lo,t.localTransform),oo(lo,e),_o.setTransform(t,lo,i,s)},setTransform(t,e,i,s){const n=t.__,r=n.origin&&_o.getInnerOrigin(t,n.origin),o=ho(e,r,n.around&&_o.getInnerOrigin(t,n.around));if(_o.hasOffset(t)&&(o.x-=n.offsetX,o.y-=n.offsetY),i){const e=o.scaleX/t.scaleX,i=o.scaleY/t.scaleY;if(delete o.scaleX,delete o.scaleY,r){jt.scale(t.boxBounds,Math.abs(e),Math.abs(i));const s=_o.getInnerOrigin(t,n.origin);lt.move(o,r.x-s.x,r.y-s.y)}t.set(o),t.scaleResize(e,i,!1)}else t.set(o,s)},getFlipTransform(t,e){const i={a:1,b:0,c:0,d:1,e:0,f:0},s="x"===e?1:-1;return so(i,_o.getLocalOrigin(t,"center"),-1*s,1*s),i},getLocalOrigin:(t,e)=>lt.tempToOuterOf(_o.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const i={};return kt.toPoint(e,t.boxBounds,i),i},getRelativeWorld:(t,e,i)=>(to(lo,t.worldTransform),ao(lo,e.scrollWorldTransform),i?lo:Object.assign({},lo)),drop(t,e,i,s){t.setTransform(_o.getRelativeWorld(t,e,!0),s),e.add(t,i)},hasHighPosition:t=>t.origin||t.around||_o.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,i=.3){if(e.x||e.y)if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const s=e.x*i,n=e.y*i;e.x-=s,e.y-=n,t.move(s,n),ee.requestRender(()=>_o.animateMove(t,e,i))}}},_o=uo,{updateAllMatrix:po,updateMatrix:go,updateAllWorldOpacity:fo,updateAllChange:yo,updateChange:mo}=_o;function vo(t,e){return t.updateLayout(),t.parent?lt.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const wo={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=>t.__.eraser||0===t.__.visible?null:t.__layout.localRenderBounds,maskLocalBoxBounds:(t,e)=>bo(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>bo(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds:(t,e)=>bo(t,e)&&t.__layout.localRenderBounds,excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};let xo;function bo(t,e){return e||(xo=0),t.__.mask&&(xo=1),xo<0?null:(xo&&(xo=-1),!0)}const{updateBounds:So}=uo,ko={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:i}=t;for(let s=0,n=i.length;s<n;s++)(t=i[s]).isBranch&&(t.__tempNumber=1,e.add(t),Bo(t,e))}},pushAllParent(t,e){const{keys:i}=e;if(i)for(;t.parent&&r(i[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 i=e.length;const{children:s}=t;for(let t=0,i=s.length;t<i;t++)s[t].isBranch&&e.push(s[t]);for(let t=i,s=e.length;t<s;t++)Po(e[t],e)},updateBounds(t,e){const i=[t];Po(t,i),To(i,e)},updateBoundsByBranchStack(t,e){let i,s;for(let n=t.length-1;n>-1;n--){i=t[n],s=i.children;for(let t=0,e=s.length;t<e;t++)So(s[t]);e&&e===i||So(i)}},move(t,e,i){let s;const{children:n}=t;for(let r=0,o=n.length;r<o;r++)s=(t=n[r]).__world,s.e+=e,s.f+=i,s.x+=e,s.y+=i,t.isBranch&&Eo(t,e,i)},scale(t,e,i,s,n,r,o){let a;const{children:h}=t,l=s-1,d=n-1;for(let c=0,u=h.length;c<u;c++)a=(t=h[c]).__world,a.a*=s,a.d*=n,(a.b||a.c)&&(a.b*=s,a.c*=n),a.e===a.x&&a.f===a.y?(a.x=a.e+=(a.e-r)*l+e,a.y=a.f+=(a.f-o)*d+i):(a.e+=(a.e-r)*l+e,a.f+=(a.f-o)*d+i,a.x+=(a.x-r)*l+e,a.y+=(a.y-o)*d+i),a.width*=s,a.height*=n,a.scaleX*=s,a.scaleY*=n,t.isBranch&&Ro(t,e,i,s,n,r,o)}},{pushAllChildBranch:Bo,pushAllBranchStack:Po,updateBoundsByBranchStack:To,move:Eo,scale:Ro}=ko,Co={run(t){if(t&&t.length){const e=t.length;for(let i=0;i<e;i++)t[i]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:Lo,updateBounds:Oo}=uo,{toOuterOf:Ao,getPoints:Do,copy:Mo}=jt,Fo="_localContentBounds",Io="_worldContentBounds",Wo="_worldBoxBounds",No="_worldStrokeBounds";class zo{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 Ao(this.contentBounds,this.leaf.__localMatrix,this[Fo]||(this[Fo]={})),this[Fo]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return Ao(this.contentBounds,this.leaf.__world,this[Io]||(this[Io]={})),this[Io]}get worldBoxBounds(){return Ao(this.boxBounds,this.leaf.__world,this[Wo]||(this[Wo]={})),this[Wo]}get worldStrokeBounds(){return Ao(this.strokeBounds,this.leaf.__world,this[No]||(this[No]={})),this[No]}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 Oo(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 i=e;if(i.__fullLayouting)return;i.__fullLayouting=!0,ee.layout(i),delete i.__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 J.defaultMatrix;case"page":t=e.zoomLayer;default:return Lo(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 Gt(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",i){const{leaf:s}=this;let n,r,o,a=this.getInnerBounds(t);switch(e){case"world":n=s.getWorldPoint(a),r=s.__world;break;case"local":const{scaleX:t,scaleY:i,rotation:h,skewX:l,skewY:d}=s.__;o={scaleX:t,scaleY:i,rotation:h,skewX:l,skewY:d},n=s.getLocalPointByInner(a);break;case"inner":n=a,r=J.defaultMatrix;break;case"page":e=s.zoomLayer;default:n=s.getWorldPoint(a,e),r=Lo(s,e,!0)}if(o||(o=J.getLayout(r)),Mo(o,a),lt.copy(o,n),i){const{scaleX:t,scaleY:e}=o,i=Math.abs(t),s=Math.abs(e);1===i&&1===s||(o.scaleX/=i,o.scaleY/=s,o.width*=i,o.height*=s)}return o}getLayoutPoints(t,e="world"){const{leaf:i}=this,s=Do(this.getInnerBounds(t));let n;switch(e){case"world":n=null;break;case"local":n=i.parent;break;case"inner":break;case"page":e=i.zoomLayer;default:n=e}return r(n)||s.forEach(t=>i.innerToWorld(t,null,!1,n)),s}shrinkContent(){const{x:t,y:e,width:i,height:s}=this.boxBounds;this._contentBounds={x:t,y:e,width:i,height:s}}spreadStroke(){const{x:t,y:e,width:i,height:s}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:i,height:s},this._localStrokeBounds={x:t,y:e,width:i,height:s},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:i,height:s}=this.renderBounds;this._renderBounds={x:t,y:e,width:i,height:s},this._localRenderBounds={x:t,y:e,width:i,height:s}}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}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,this.surfaceChanged||this.surfaceChange()}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class Yo{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&ee.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&ee.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&ee.event.stop(this.origin)}}class Xo extends Yo{constructor(t,e,i){super(t,e),this.parent=i,this.child=e}}Xo.ADD="child.add",Xo.REMOVE="child.remove",Xo.CREATED="created",Xo.MOUNTED="mounted",Xo.UNMOUNTED="unmounted",Xo.DESTROY="destroy";const Uo="property.scroll";class jo extends Yo{constructor(t,e,i,s,n){super(t,e),this.attrName=i,this.oldValue=s,this.newValue=n}}jo.CHANGE="property.change",jo.LEAFER_CHANGE="property.leafer_change",jo.SCROLL=Uo;const Ho={scrollX:Uo,scrollY:Uo};class Vo extends Yo{constructor(t,e){super(t),Object.assign(this,e)}}Vo.LOAD="image.load",Vo.LOADED="image.loaded",Vo.ERROR="image.error";class qo extends Yo{static checkHas(t,e,i){"on"===i?e===Jo?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Go)||t.hasEvent(Ko)||t.hasEvent($o),t.__hasWorldEvent=t.hasEvent(Jo))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Go,t),"inner"===e&&t.emit(Ko,t)),t.emit($o,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Jo,this)}}qo.RESIZE="bounds.resize",qo.INNER="bounds.inner",qo.LOCAL="bounds.local",qo.WORLD="bounds.world";const{RESIZE:Go,INNER:Ko,LOCAL:$o,WORLD:Jo}=qo,Qo={};[Go,Ko,$o,Jo].forEach(t=>Qo[t]=1);class Zo extends Yo{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(Zo.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!r(this.resizingKeys[t.innerId])}}Zo.RESIZE="resize";class ta extends Yo{constructor(t,e){super(t),this.data=e}}ta.REQUEST="watch.request",ta.DATA="watch.data";class ea extends Yo{constructor(t,e,i){super(t),e&&(this.data=e,this.times=i)}}ea.REQUEST="layout.request",ea.START="layout.start",ea.BEFORE="layout.before",ea.LAYOUT="layout",ea.AFTER="layout.after",ea.AGAIN="layout.again",ea.END="layout.end";class ia extends Yo{constructor(t,e,i,s){super(t),e&&(this.times=e),i&&(this.renderBounds=i,this.renderOptions=s)}}ia.REQUEST="render.request",ia.CHILD_START="render.child_start",ia.CHILD_END="render.child_end",ia.START="render.start",ia.BEFORE="render.before",ia.RENDER="render",ia.AFTER="render.after",ia.AGAIN="render.again",ia.END="render.end",ia.NEXT="render.next";class sa extends Yo{}sa.START="leafer.start",sa.BEFORE_READY="leafer.before_ready",sa.READY="leafer.ready",sa.AFTER_READY="leafer.after_ready",sa.VIEW_READY="leafer.view_ready",sa.VIEW_COMPLETED="leafer.view_completed",sa.STOP="leafer.stop",sa.RESTART="leafer.restart",sa.END="leafer.end",sa.UPDATE_MODE="leafer.update_mode",sa.TRANSFORM="leafer.transform",sa.MOVE="leafer.move",sa.SCALE="leafer.scale",sa.ROTATE="leafer.rotate",sa.SKEW="leafer.skew";const{MOVE:na,SCALE:ra,ROTATE:oa,SKEW:aa}=sa,ha={x:na,y:na,scaleX:ra,scaleY:ra,rotation:oa,skewX:aa,skewY:aa},la={};class da{set event(t){this.on(t)}on(t,e,i){if(!e){let e;if(u(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let i in t)u(e=t[i])?this.on(i,e[0],e[1]):this.on(i,e);return}let s,n,r;i&&("once"===i?n=!0:"boolean"==typeof i?s=i:(s=i.capture,n=i.once));const o=ca(this,s,!0),h=a(t)?t.split(" "):t,l=n?{listener:e,once:n}:{listener:e};h.forEach(t=>{t&&(r=o[t],r?-1===r.findIndex(t=>t.listener===e)&&r.push(l):o[t]=[l],Qo[t]&&qo.checkHas(this,t,"on"))})}off(t,e,i){if(t){const s=a(t)?t.split(" "):t;if(e){let t,n,r;i&&(t="boolean"==typeof i?i:"once"!==i&&i.capture);const o=ca(this,t);s.forEach(t=>{t&&(n=o[t],n&&(r=n.findIndex(t=>t.listener===e),r>-1&&n.splice(r,1),n.length||delete o[t],Qo[t]&&qo.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;s.forEach(i=>{t&&delete t[i],e&&delete e[i]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,i,s){return e?this.on(t,i?e=e.bind(i):e,s):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:s}}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,i,s){if(!e)return u(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));_(i)?e=e.bind(i):s=i,this.on(t,e,{once:!0,capture:s})}emit(t,e,i){!e&&ye.has(t)&&(e=ye.get(t,{type:t,target:this,current:this}));const s=ca(this,i)[t];if(s){let n;for(let r=0,o=s.length;r<o&&!((n=s[r])&&(n.listener(e),n.once&&(this.off(t,n.listener,i),r--,o--),e&&e.isStopNow));r++);}this.syncEventer&&this.syncEventer.emitEvent(e,i)}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:i,__captureMap:s}=this,n=i&&i[t],o=s&&s[t];return!!(r(e)?n||o:e?o:n)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function ca(t,e,i){if(e){const{__captureMap:e}=t;return e||(i?t.__captureMap={}:la)}{const{__bubbleMap:e}=t;return e||(i?t.__bubbleMap={}:la)}}const{on:ua,on_:_a,off:pa,off_:ga,once:fa,emit:ya,emitEvent:ma,hasEvent:va,destroy:wa}=da.prototype,xa={on:ua,on_:_a,off:pa,off_:ga,once:fa,emit:ya,emitEvent:ma,hasEvent:va,destroyEventer:wa},ba=ne.get("setAttr"),Sa={__setAttr(t,e,i){if(this.leaferIsCreated){const s=this.__.__getInput(t);if(!i||h(e)||r(e)||(ba.warn(this.innerName,t,e),e=void 0),_(e)||s!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new jo(jo.LEAFER_CHANGE,this,t,s,e));const i=ha[t];i&&(this.emitEvent(new sa(i,this)),this.emitEvent(new sa(sa.TRANSFORM,this)))}this.emitPropertyEvent(jo.CHANGE,t,s,e);const i=Ho[t];return i&&this.emitPropertyEvent(i,t,s,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,i,s){const n=new jo(t,this,e,i,s);this.isLeafer||this.hasEvent(t)&&this.emitEvent(n),this.leafer.emitEvent(n)},__realSetAttr(t,e){const i=this.__;i[t]=e,this.__proxyData&&this.setProxyAttr(t,e),i.normalStyle&&(this.lockNormalStyle||r(i.normalStyle[t])||(i.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:ka,multiplyParent:Ba,translateInner:Pa,defaultWorld:Ta}=J,{toPoint:Ea,tempPoint:Ra}=kt,Ca={__updateWorldMatrix(){const{parent:t,__layout:e,__world:i,__scrollWorld:s,__:n}=this;Ba(this.__local||e,t?t.__scrollWorld||t.__world:Ta,i,!!e.affectScaleOrRotation,n),s&&Pa(Object.assign(s,i),n.scrollX,n.scrollY)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,i=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(ka(e,i,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=i.x+i.offsetX,e.f=i.y+i.offsetY,(i.around||i.origin)&&(Ea(i.around||i.origin,t.boxBounds,Ra),Pa(e,-Ra.x,-Ra.y,!i.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:La,updateAllMatrix:Oa}=uo,{updateBounds:Aa}=ko,{toOuterOf:Da,copyAndSpread:Ma,copy:Fa}=jt,{toBounds:Ia}=In,Wa={__updateWorldBounds(){const{__layout:t,__world:e}=this;Da(t.renderBounds,e,e),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&qo.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&qo.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(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.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),Da(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Da(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Da(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const i=this.__layout.boxBounds,s=this.__;s.__usePathBox?Ia(s.path,i):(i.x=0,i.y=0,i.width=s.width,i.height=s.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),Oa(this),Aa(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(Oa(this),Aa(this,this))):La(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;Ma(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:i}=e;l(i)&&i<=0?Fa(e.renderBounds,e.strokeBounds):Ma(e.renderBounds,e.boxBounds,i)}},Na={__render(t,e){if(e.shape)return this.__renderShape(t,e);if((!e.cellList||e.cellList.has(this))&&this.__worldOpacity){const i=this.__;if(i.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.dimOpacity&&!i.dimskip?i.opacity*e.dimOpacity:i.opacity,this.__.__single){if("path"===i.eraser)return this.__renderEraser(t,e);const s=t.getSameCanvas(!0,!0);this.__draw(s,e,t),uo.copyCanvasByWorld(this,t,s,this.__nowWorld,i.__blendMode,!0),s.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){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:za}=wo,{hasSize:Ya}=jt,Xa={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){const i=this.__nowWorld=this.__getNowWorld(e);if(this.__worldOpacity&&Ya(i)){const s=this.__;if(s.__useDim)if(s.dim)e.dimOpacity=!0===s.dim?.2:s.dim;else{if(s.bright&&!e.topRendering)return e.topList.add(this);s.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const n=t.getSameCanvas(!1,!0);this.__renderBranch(n,e),t.opacity=e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(n,i,i,s.__blendMode,!0),n.recycle(i)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{let i;const{children:s}=this;for(let n=0,r=s.length;n<r;n++)i=s[n],za(i,e)||(i.__.complex?i.__renderComplex(t,e):i.__render(t,e))}},__clip(t,e){if(this.__worldOpacity){const{children:i}=this;for(let s=0,n=i.length;s<n;s++)za(i[s],e)||i[s].__clip(t,e)}}},Ua={},{LEAF:ja,create:Ha}=v,{stintSet:Va}=f,{toInnerPoint:qa,toOuterPoint:Ga,multiplyParent:Ka}=J,{toOuterOf:$a}=jt,{copy:Ja,move:Qa}=lt,{moveLocal:Za,zoomOfLocal:th,rotateOfLocal:eh,skewOfLocal:ih,moveWorld:sh,zoomOfWorld:nh,rotateOfWorld:rh,skewOfWorld:oh,transform:ah,transformWorld:hh,setTransform:lh,getFlipTransform:dh,getLocalOrigin:ch,getRelativeWorld:uh,drop:_h}=uo;let ph=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 zo}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){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=Ha(ja),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(Xo.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()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(Xo.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(Xo.MOUNTED,t,"once")}nextRender(t,e,i){this.leafer?this.leafer.nextRender(t,e,i):this.waitLeafer(()=>this.leafer.nextRender(t,e,i))}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(Xo.MOUNTED)):this.__emitLifeEvent(Xo.UNMOUNTED),this.isBranch){const{children:e}=this;for(let i=0,s=e.length;i<s;i++)e[i].__bindLeafer(t)}}set(t,e){}get(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))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){r(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=r(e)?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(t,e){}__updateContentBounds(){}__updateStrokeBounds(t){}__updateRenderBounds(t){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:i}=this.__layout;t.clearRect(i.x,i.y,i.width,i.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity)}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,i=this.__world;return Ka(i,t.matrix,e,void 0,i),$a(this.__layout.renderBounds,e,e),Va(e,"half",i.half),Va(e,"ignorePixelSnap",i.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){let{scaleX:i,scaleY:s}=sr.patternLocked?this.__world:this.__nowWorld;return t&&(i<0&&(i=-i),s<0&&(s=-s)),(!0===e||"zoom-in"===e&&i>1&&s>1)&&(i=s=1),Ua.scaleX=i,Ua.scaleY=s,Ua}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,i){return this.__layout.getLayoutBounds(t,e,i)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,i){const s=e?uh(this,e):this.worldTransform,n=i?t:{};return $a(t,s,n),n}worldToLocal(t,e,i,s){this.parent?this.parent.worldToInner(t,e,i,s):e&&Ja(e,t)}localToWorld(t,e,i,s){this.parent?this.parent.innerToWorld(t,e,i,s):e&&Ja(e,t)}worldToInner(t,e,i,s){s&&(s.innerToWorld(t,e,i),t=e||t),qa(this.scrollWorldTransform,t,e,i)}innerToWorld(t,e,i,s){Ga(this.scrollWorldTransform,t,e,i),s&&s.worldToInner(e||t,null,i)}getBoxPoint(t,e,i,s){return this.getBoxPointByInner(this.getInnerPoint(t,e,i,s),null,null,!0)}getBoxPointByInner(t,e,i,s){const n=s?t:Object.assign({},t),{x:r,y:o}=this.boxBounds;return Qa(n,-r,-o),n}getInnerPoint(t,e,i,s){const n=s?t:{};return this.worldToInner(t,n,i,e),n}getInnerPointByBox(t,e,i,s){const n=s?t:Object.assign({},t),{x:r,y:o}=this.boxBounds;return Qa(n,r,o),n}getInnerPointByLocal(t,e,i,s){return this.getInnerPoint(t,this.parent,i,s)}getLocalPoint(t,e,i,s){const n=s?t:{};return this.worldToLocal(t,n,i,e),n}getLocalPointByInner(t,e,i,s){return this.getWorldPoint(t,this.parent,i,s)}getPagePoint(t,e,i,s){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,i,s)}getWorldPoint(t,e,i,s){const n=s?t:{};return this.innerToWorld(t,n,i,e),n}getWorldPointByBox(t,e,i,s){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,s),e,i,!0)}getWorldPointByLocal(t,e,i,s){const n=s?t:{};return this.localToWorld(t,n,i,e),n}getWorldPointByPage(t,e,i,s){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,i,s)}setTransform(t,e,i){lh(this,t,e,i)}transform(t,e,i){ah(this,t,e,i)}move(t,e,i){Za(this,t,e,i)}moveInner(t,e,i){sh(this,t,e,!0,i)}scaleOf(t,e,i,s,n){th(this,ch(this,t),e,i,s,n)}rotateOf(t,e,i){eh(this,ch(this,t),e,i)}skewOf(t,e,i,s,n){ih(this,ch(this,t),e,i,s,n)}transformWorld(t,e,i){hh(this,t,e,i)}moveWorld(t,e,i){sh(this,t,e,!1,i)}scaleOfWorld(t,e,i,s,n){nh(this,t,e,i,s,n)}rotateOfWorld(t,e){rh(this,t,e)}skewOfWorld(t,e,i,s,n){oh(this,t,e,i,s,n)}flip(t,e){ah(this,dh(this,t),!1,e)}scaleResize(t,e=t,i){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}hit(t,e){return!0}__hitWorld(t,e){return!0}__hit(t,e){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__renderComplex(t,e){}__drawFast(t,e){}__draw(t,e,i){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}getMotionPathData(){return ce.need("path")}getMotionPoint(t){return ce.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,i){_h(this,t,e,i)}on(t,e,i){}off(t,e,i){}on_(t,e,i,s){}off_(t){}once(t,e,i,s){}emit(t,e,i){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,i){i?this.addAttr(t,e,i):jr(this.prototype,t,e)}static addAttr(t,e,i,s){i||(i=br),i(e,s)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new Xo(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(Xo.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};ph=i([Jr(Sa),Jr(Ca),Jr(Wa),Jr(xa),Jr(Na)],ph);const{setListWithFn:gh}=jt,{sort:fh}=ko,{localBoxBounds:yh,localStrokeBounds:mh,localRenderBounds:vh,maskLocalBoxBounds:wh,maskLocalStrokeBounds:xh,maskLocalRenderBounds:bh}=wo,Sh=new ne("Branch");let kh=class extends ph{__updateStrokeSpread(){const{children:t}=this;for(let e=0,i=t.length;e<i;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){const{children:t}=this;for(let e=0,i=t.length;e<i;e++)if(t[e].__layout.renderSpread)return 1;return 0}__updateBoxBounds(t,e){gh(e||this.__layout.boxBounds,this.children,this.__hasMask?wh:yh)}__updateStrokeBounds(t){gh(t||this.__layout.strokeBounds,this.children,this.__hasMask?xh:mh)}__updateRenderBounds(t){gh(t||this.__layout.renderBounds,this.children,this.__hasMask?bh:vh)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let i=0,s=e.length;i<s;i++)e[i].__tempNumber=i,e[i].__.zIndex&&(t=!0);e.sort(fh),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return Sh.warn("add self or destroyed");const i=r(e);if(!t.__){if(u(t))return t.forEach(t=>{this.add(t,e),i||e++});if(!(t=pe.get(t.tag,t)))return}t.parent&&t.parent.remove(t),t.parent=this,i?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const s=t.__layout;s.boxChanged||s.boxChange(),s.matrixChanged||s.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(Xo.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Xo.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)):r(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 i=this.children.indexOf(t);i>-1&&(this.children.splice(i,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(Xo.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Xo.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const i=new Xo(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(i),this.leafer.emitEvent(i)}};kh=i([Jr(Xa)],kh);class Bh{get length(){return this.list.length}constructor(t){this.reset(),t&&(u(t)?this.addList(t):this.add(t))}has(t){return t&&!r(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return r(e)?-1:e}add(t){const{list:e,keys:i}=this;r(i[t.innerId])&&(e.push(t),i[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:i}=this;if(r(i[t.innerId])){const{list:s}=this;for(let t=e,n=s.length;t<n;t++)i[s[t].innerId]++;0===e?s.unshift(t):(e>s.length&&(e=s.length),s.splice(e,0,t)),i[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let i;for(let s=0,n=e.length;s<n;s++)r(i)?e[s].innerId===t.innerId&&(i=s,delete this.keys[t.innerId]):this.keys[e[s].innerId]=s-1;r(i)||e.splice(i,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 Bh;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};const{list:t,keys:e}=this;for(let i=0,s=t.length;i<s;i++)e[t[i].innerId]=i}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class Ph{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(u(t)?this.addList(t):this.add(t))}has(t){return!r(this.keys[t.innerId])}without(t){return r(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:i}=this;e[t.innerId]||(e[t.innerId]=1,i[t.__level]?i[t.__level].push(t):(i[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(i=>{e=this.levelMap[i];for(let i=0,s=e.length;i<s;i++)t(e[i])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const Th="2.0.2",Eh=ne.get("LeaferCanvas");class Rh extends Ae{set zIndex(t){const{style:e}=this.view;e.zIndex=t,this.setAbsolute(this.view)}set childIndex(t){const{view:e,parentView:i}=this;if(e&&i){const s=i.children[t];s?(this.setAbsolute(s),i.insertBefore(e,s)):i.appendChild(s)}}init(){const{config:t}=this,e=t.view||t.canvas;e?this.__createViewFrom(e):this.__createView();const{style:i}=this.view;if(i.display||(i.display="block"),this.parentView=this.view.parentElement,this.parentView){const t=this.parentView.style;t.webkitUserSelect=t.userSelect="none",this.view.classList.add("leafer-canvas-view")}ee.syncDomFont&&!this.parentView&&(i.display="none",document.body&&document.body.appendChild(this.view)),this.__createContext(),this.autoLayout||this.resize(t)}set backgroundColor(t){this.view.style.backgroundColor=t}get backgroundColor(){return this.view.style.backgroundColor}set hittable(t){this.view.style.pointerEvents=t?"auto":"none"}get hittable(){return"none"!==this.view.style.pointerEvents}__createView(){this.view=document.createElement("canvas")}__createViewFrom(t){let e=a(t)?document.getElementById(t):t;if(e)if(e instanceof HTMLCanvasElement)this.view=e;else{let t=e;if(e===window||e===document){const e=document.createElement("div"),{style:i}=e;i.position="absolute",i.top=i.bottom=i.left=i.right="0px",document.body.appendChild(e),t=e}this.__createView();const i=this.view;t.hasChildNodes()&&(this.setAbsolute(i),t.style.position||(t.style.position="relative")),t.appendChild(i)}else Eh.error(`no id: ${t}`),this.__createView()}setAbsolute(t){const{style:e}=t;e.position="absolute",e.top=e.left="0px"}updateViewSize(){const{width:t,height:e,pixelRatio:i}=this,{style:s}=this.view;s.width=t+"px",s.height=e+"px",this.unreal||(this.view.width=Math.ceil(t*i),this.view.height=Math.ceil(e*i))}updateClientBounds(){this.view.parentElement&&(this.clientBounds=this.view.getBoundingClientRect())}startAutoLayout(t,e){if(this.resizeListener=e,t){if(this.autoBounds=t,this.resizeObserver)return;try{this.resizeObserver=new ResizeObserver(t=>{this.updateClientBounds();for(const e of t)this.checkAutoBounds(e.contentRect)});const t=this.parentView;t?(this.resizeObserver.observe(t),this.checkAutoBounds(t.getBoundingClientRect())):(this.checkAutoBounds(this.view),Eh.warn("no parent"))}catch(t){this.imitateResizeObserver()}this.stopListenPixelRatio()}else this.listenPixelRatio(),this.unreal&&this.updateViewSize()}imitateResizeObserver(){this.autoLayout&&(this.parentView&&this.checkAutoBounds(this.parentView.getBoundingClientRect()),ee.requestRender(this.imitateResizeObserver.bind(this)))}listenPixelRatio(){this.windowListener||window.addEventListener("resize",this.windowListener=()=>{const t=ee.devicePixelRatio;if(!this.config.pixelRatio&&this.pixelRatio!==t){const{width:e,height:i}=this;this.emitResize({width:e,height:i,pixelRatio:t})}})}stopListenPixelRatio(){this.windowListener&&(window.removeEventListener("resize",this.windowListener),this.windowListener=null)}checkAutoBounds(t){const e=this.view,{x:i,y:s,width:n,height:r}=this.autoBounds.getBoundsFrom(t),o={width:n,height:r,pixelRatio:this.config.pixelRatio?this.pixelRatio:ee.devicePixelRatio};if(!this.isSameSize(o)){const{style:t}=e;t.marginLeft=i+"px",t.marginTop=s+"px",this.emitResize(o)}}stopAutoLayout(){this.autoLayout=!1,this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeListener=this.resizeObserver=null}emitResize(t){const e={};f.copyAttrs(e,this,Oe),this.resize(t),this.resizeListener&&!r(this.width)&&this.resizeListener(new Zo(t,e))}unrealCanvas(){if(!this.unreal&&this.parentView){let t=this.view;t&&t.remove(),t=this.view=document.createElement("div"),this.parentView.appendChild(this.view),t.classList.add("leafer-app-view"),this.unreal=!0}}destroy(){const{view:t}=this;t&&(this.stopAutoLayout(),this.stopListenPixelRatio(),t.parentElement&&t.remove(),super.destroy())}}function Ch(t,e){ee.origin={createCanvas(t,e){const i=document.createElement("canvas");return i.width=t,i.height=e,i},canvasToDataURL:(t,e,i)=>{const s=Kn.mimeType(e),n=t.toDataURL(s,i);return"image/bmp"===s?n.replace("image/png;","image/bmp;"):n},canvasToBolb:(t,e,i)=>new Promise(s=>t.toBlob(s,Kn.mimeType(e),i)),canvasSaveAs:(t,e,i)=>{const s=t.toDataURL(Kn.mimeType(Kn.fileType(e)),i);return ee.origin.download(s,e)},download(t,e){return s(this,void 0,void 0,function*(){let i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i)})},loadImage:(t,e,i)=>new Promise((i,s)=>{const n=new ee.origin.Image;e&&(n.setAttribute("crossOrigin",e),n.crossOrigin=e),n.onload=()=>{i(n)},n.onerror=t=>{s(t)},n.src=ee.image.getRealURL(t)}),loadContent(t){return s(this,arguments,void 0,function*(t,e="text"){const i=yield fetch(t);if(!i.ok)throw new Error(`${i.status}`);return yield i[e]()})},Image:Image,PointerEvent:PointerEvent,DragEvent:DragEvent},ee.event={stopDefault(t){t.preventDefault()},stopNow(t){t.stopImmediatePropagation()},stop(t){t.stopPropagation()}},ee.canvas=ue.canvas(),ee.conicGradientSupport=!!ee.canvas.context.createConicGradient}Gn(CanvasRenderingContext2D.prototype),Gn(Path2D.prototype),Object.assign(ue,{canvas:(t,e)=>new Rh(t,e),image:t=>new ar(t)}),ee.name="web",ee.isMobile="ontouchstart"in window,ee.requestRender=function(t){window.requestAnimationFrame(t)},dr(ee,"devicePixelRatio",{get:()=>devicePixelRatio});const{userAgent:Lh}=navigator;Lh.indexOf("Firefox")>-1?(ee.conicGradientRotate90=!0,ee.intWheelDeltaY=!0,ee.syncDomFont=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&(ee.fullImageShadow=!0),Lh.indexOf("Windows")>-1?(ee.os="Windows",ee.intWheelDeltaY=!0):Lh.indexOf("Mac")>-1?ee.os="Mac":Lh.indexOf("Linux")>-1&&(ee.os="Linux");class Oh{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove&&this.config.usePartLayout){const t=new Bh;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new Bh,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=!0,this.running&&this.target.emit(ia.REQUEST)}__onAttrChange(t){this.config.usePartLayout&&this.__updatedList.add(t.target),this.update()}__onChildEvent(t){this.config.usePartLayout&&(t.type===Xo.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent))),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new ta(ta.DATA,{updatedList:this.updatedList})),this.__updatedList=new Bh,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[jo.CHANGE,this.__onAttrChange,this],[[Xo.ADD,Xo.REMOVE],this.__onChildEvent,this],[ta.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:Ah,updateBounds:Dh,updateChange:Mh}=uo,{pushAllChildBranch:Fh,pushAllParent:Ih}=ko;const{worldBounds:Wh}=wo;class Nh{constructor(t){this.updatedBounds=new Gt,this.beforeBounds=new Gt,this.afterBounds=new Gt,u(t)&&(t=new Bh(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,Wh)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,Wh),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:zh,updateAllChange:Yh}=uo,Xh=ne.get("Layouter");class Uh{constructor(t,e){this.totalTimes=0,this.config={usePartLayout:!0},this.__levelList=new Ph,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(ea.START),this.layoutOnce(),t.emitEvent(new ea(ea.END,this.layoutedBlocks,this.times))}catch(t){Xh.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?Xh.warn("layouting"):this.times>3?Xh.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(ta.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=he.start("PartLayout"),{target:i,__updatedList:s}=this,{BEFORE:n,LAYOUT:r,AFTER:o}=ea,a=this.getBlocks(s);a.forEach(t=>t.setBefore()),i.emitEvent(new ea(n,a,this.times)),this.extraBlock=null,s.sort(),function(t,e){let i;t.list.forEach(t=>{i=t.__layout,e.without(t)&&!i.proxyZoom&&(i.matrixChanged?(Ah(t,!0),e.add(t),t.isBranch&&Fh(t,e),Ih(t,e)):i.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),Ih(t,e)))})}(s,this.__levelList),function(t){let e,i,s;t.sort(!0),t.levels.forEach(n=>{e=t.levelMap[n];for(let t=0,n=e.length;t<n;t++){if(i=e[t],i.isBranch&&i.__tempNumber){s=i.children;for(let t=0,e=s.length;t<e;t++)s[t].isBranch||Dh(s[t])}Dh(i)}})}(this.__levelList),function(t){t.list.forEach(Mh)}(s),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),i.emitEvent(new ea(r,a,this.times)),i.emitEvent(new ea(o,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,he.end(e)}fullLayout(){const t=he.start("FullLayout"),{target:e}=this,{BEFORE:i,LAYOUT:s,AFTER:n}=ea,r=this.getBlocks(new Bh(e));e.emitEvent(new ea(i,r,this.times)),Uh.fullLayout(e),r.forEach(t=>{t.setAfter()}),e.emitEvent(new ea(s,r,this.times)),e.emitEvent(new ea(n,r,this.times)),this.addBlocks(r),he.end(t)}static fullLayout(t){zh(t,!0),t.isBranch?ko.updateBounds(t):uo.updateBounds(t),Yh(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:i}=this.extraBlock||(this.extraBlock=new Nh([]));e.length?i.add(t.__world):i.set(t.__world),e.add(t)}}createBlock(t){return new Nh(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_([[ea.REQUEST,this.layout,this],[ea.AGAIN,this.layoutAgain,this],[ta.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const jh=ne.get("Renderer");class Hh{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,i){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,i&&(this.config=f.default(i,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(ea.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(ia.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(ia.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(ia.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Gt,jh.log(e.innerName,"---\x3e");try{this.emitRender(ia.START),this.renderOnce(t),this.emitRender(ia.END,this.totalBounds),sr.clearRecycled()}catch(t){this.rendering=!1,jh.error(t)}jh.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return jh.warn("rendering");if(this.times>3)return jh.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Gt,this.renderOptions={},t)this.emitRender(ia.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(ia.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(ia.RENDER,this.renderBounds,this.renderOptions),this.emitRender(ia.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=he.start("PartRender"),{canvas:i}=this,s=t.getIntersect(i.bounds),n=new Gt(s);i.save(),s.spread(Hh.clipSpread).ceil();const{ceilPartPixel:r}=this.config;i.clipWorld(s,r),i.clearWorld(s,r),this.__render(s,n),i.restore(),he.end(e)}fullRender(){const t=he.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),he.end(t)}__render(t,e){const{canvas:i,target:s}=this,n=t.includes(s.__world),r=n?{includes:n}:{bounds:t,includes:n};this.needFill&&i.fillWorld(t,this.config.fill),ne.showRepaint&&ne.drawRepaint(i,t),this.config.useCellRender&&(r.cellList=this.getCellList()),ee.render(s,i,r),this.renderBounds=e=e||t,this.renderOptions=r,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),i.updateRender(e)}getCellList(){}addBlock(t,e){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Gt;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:i}=this.config;if(i&&t>i)return ee.requestRender(e);const{frames:s}=this;s.length>30&&s.shift(),s.push(t),this.FPS=Math.round(s.reduce((t,e)=>t+e,0)/s.length),this.requestTime=0,this.checkRender()};ee.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:i}=t.old;if(!new Gt(0,0,e,i).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Gt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;const{updatedList:i}=t;i&&i.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||jh.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds,i)})}emitRender(t,e,i){this.target.emitEvent(new ia(t,this.times,e,i))}__listenEvents(){this.__eventIds=[this.target.on_([[ia.REQUEST,this.update,this],[ea.END,this.__onLayoutEnd,this],[ia.AGAIN,this.renderAgain,this],[Zo.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}}Hh.clipSpread=10;const Vh={},{copyRadiusPoint:qh}=lt,{hitRadiusPoint:Gh}=jt;class Kh{constructor(t,e){this.target=t,this.selector=e}getByPoint(t,e,i){e||(e=0),i||(i={});const s=i.through||!1,n=i.ignoreHittable||!1,r=i.target||this.target;this.exclude=i.exclude||null,this.point={x:t.x,y:t.y,radiusX:e,radiusY:e},this.findList=new Bh(i.findList),i.findList||this.hitBranch(r.isBranchLeaf?{children:[r]}:r);const{list:o}=this.findList,a=this.getBestMatchLeaf(o,i.bottomList,n,!!i.findList),h=n?this.getPath(a):this.getHitablePath(a);return this.clear(),s?{path:h,target:a,throughPath:o.length?this.getThroughPath(o):h}:{path:h,target:a}}hitPoint(t,e,i){return!!this.getByPoint(t,e,i).target}getBestMatchLeaf(t,e,i,s){const n=this.findList=new Bh;if(t.length){let e;const{x:s,y:r}=this.point,o={x:s,y:r,radiusX:0,radiusY:0};for(let s=0,r=t.length;s<r;s++)if(e=t[s],(i||uo.worldHittable(e))&&(this.hitChild(e,o),n.length)){if(e.isBranchLeaf&&t.some(t=>t!==e&&uo.hasParent(t,e))){n.reset();break}return n.list[0]}}if(e)for(let t=0,i=e.length;t<i;t++)if(this.hitChild(e[t].target,this.point,e[t].proxy),n.length)return n.list[0];return s?null:i?t[0]:t.find(t=>uo.worldHittable(t))}getPath(t){const e=new Bh,i=[],{target:s}=this;for(;t&&(t.syncEventer&&i.push(t.syncEventer),e.add(t),(t=t.parent)!==s););return i.length&&i.forEach(t=>{for(;t&&(t.__.hittable&&e.add(t),(t=t.parent)!==s););}),s&&e.add(s),e}getHitablePath(t){const e=this.getPath(t&&t.hittable?t:null);let i,s=new Bh;for(let t=e.list.length-1;t>-1&&(i=e.list[t],i.__.hittable)&&(s.addAt(i,0),i.__.hitChildren&&(!i.isLeafer||"draw"!==i.mode));t--);return s}getThroughPath(t){const e=new Bh,i=[];for(let e=t.length-1;e>-1;e--)i.push(this.getPath(t[e]));let s,n,r;for(let t=0,o=i.length;t<o;t++){s=i[t],n=i[t+1];for(let t=0,i=s.length;t<i&&(r=s.list[t],!n||!n.has(r));t++)e.add(r)}return e}hitBranch(t){this.eachFind(t.children,t.__onlyHitMask)}eachFind(t,e){let i,s,n;const{point:r}=this;for(let o=t.length-1;o>-1;o--)if(i=t[o],n=i.__,n.visible&&(!e||n.mask))if(s=Gh(i.__world,n.hitRadius?qh(Vh,r,n.hitRadius):r),i.isBranch){if(s||i.__ignoreHitWorld){if(i.isBranchLeaf&&n.__clipAfterFill&&!i.__hitWorld(r,!0))continue;i.topChildren&&this.eachFind(i.topChildren,!1),this.eachFind(i.children,i.__onlyHitMask),i.isBranchLeaf&&this.hitChild(i,r)}}else s&&this.hitChild(i,r)}hitChild(t,e,i){if((!this.exclude||!this.exclude.has(t))&&t.__hitWorld(e)){const{parent:s}=t;if(s&&s.__hasMask&&!t.__.mask){let i,n=[];const{children:r}=s;for(let s=0,o=r.length;s<o;s++)if(i=r[s],i.__.mask&&n.push(i),i===t){if(n&&!n.every(t=>t.__hitWorld(e)))return;break}}this.findList.add(i||t)}}clear(){this.point=null,this.findList=null,this.exclude=null}destroy(){this.clear()}}class $h{constructor(t,e){this.config={},e&&(this.config=f.default(e,this.config)),this.picker=new Kh(this.target=t,this),this.finder=ue.finder&&ue.finder()}getByPoint(t,e,i){const{target:s,picker:n}=this;return ee.backgrounder&&s&&s.updateLayout(),n.getByPoint(t,e,i)}hitPoint(t,e,i){return this.picker.hitPoint(t,e,i)}getBy(t,e,i,s){return this.finder?this.finder.getBy(t,e,i,s):ce.need("find")}destroy(){this.picker.destroy(),this.finder&&this.finder.destroy()}}function Jh(t){return _r(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Qh(t){return _r(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function Zh(){return(t,e)=>{const i="_"+e;dr(t,e,{set(t){this.isLeafer&&(this[i]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[i]||this:this.leafer&&this.leafer.zoomLayer}})}}function tl(t){return(e,i)=>{dr(e,i,ur(i,t))}}Object.assign(ue,{watcher:(t,e)=>new Oh(t,e),layouter:(t,e)=>new Uh(t,e),renderer:(t,e,i)=>new Hh(t,e,i),selector:(t,e)=>new $h(t,e)}),ee.layout=Uh.fullLayout,ee.render=function(t,e,i){const s=Object.assign(Object.assign({},i),{topRendering:!0});i.topList=new Bh,t.__render(e,i),i.topList.length&&i.topList.forEach(t=>t.__render(e,s))};const el={},il={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}},sl=Jt,nl={},rl={},ol={},al={},hl={},ll={apply(){ce.need("filter")}},dl={},cl={setStyleName:()=>ce.need("state"),set:()=>ce.need("state")},ul={list:{},register(t,e){ul.list[t]=e},get:t=>ul.list[t]},{parse:_l,objectToCanvasData:pl}=ss,{stintSet:gl}=f,{hasTransparent:fl}=il,yl={originPaint:{}},ml=ne.get("UIData");class vl 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;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}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,ml.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,ml.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),a(t)||!t?(gl(this,"__isTransparentFill",fl(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):_(t)&&this.__setPaint("fill",t)}setStroke(t){a(t)||!t?(gl(this,"__isTransparentStroke",fl(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?_l(t):pl(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){wl(this,"shadow",t)}setInnerShadow(t){wl(this,"innerShadow",t)}setFilter(t){wl(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&rl.compute("fill",this.__leaf),e&&rl.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),r(t.strokeWidthFixed)||(i=t.strokeWidthFixed)),i){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const i=this.__leaf.__layout;i.boxChanged||i.boxChange(),u(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=yl)):(this.__isStrokes=!0,this._stroke||(this._stroke=yl))}__removePaint(t,e){e&&this.__removeInput(t),ol.recycleImage(t,this),"fill"===t?(gl(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(gl(this,"__isAlphaPixelStroke",void 0),gl(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function wl(t,e,i){t.__setInput(e,i),u(i)?(i.some(t=>!1===t.visible)&&(i=i.filter(t=>!1!==t.visible)),i.length||(i=void 0)):i=i&&!1!==i.visible?[i]:void 0,t["_"+e]=i}class xl extends vl{}class bl extends xl{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 Sl extends xl{__getInputData(t,e){const i=super.__getInputData(t,e);return Oe.forEach(t=>delete i[t]),i}}class kl extends bl{}class Bl extends vl{get __usePathBox(){return this.points||this.__pathInputed}}class Pl extends vl{get __boxStroke(){return!this.__pathInputed}}class Tl extends vl{get __boxStroke(){return!this.__pathInputed}}class El extends Bl{}class Rl extends vl{}class Cl extends vl{get __pathInputed(){return 2}}class Ll extends xl{}const Ol={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class Al extends vl{get __useNaturalRatio(){return!1}setFontWeight(t){a(t)?(this.__setInput("fontWeight",t),t=Ol[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,i=e.__box;if(t){const{boxStyle:s}=this;if(i)for(let t in s)i[t]=void 0;else i=e.__box=pe.get("Rect",0);const n=e.__layout,r=i.__layout;s||(i.parent=e,i.__world=e.__world,r.boxBounds=n.boxBounds),i.set(t),r.strokeChanged&&n.strokeChange()}else i&&(e.__box=i.parent=null,i.destroy());this._boxStyle=t}__getInputData(t,e){const i=super.__getInputData(t,e);return i.textEditing&&delete i.textEditing,i}}class Dl extends Pl{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 i=super.__getInputData(t,e);return i.url&&delete i.fill,i}}class Ml extends Pl{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const i=super.__getInputData(t,e);return i.url=this.__leaf.canvas.toDataURL("image/png"),i}}const{max:Fl,add:Il}=P,Wl={__updateStrokeSpread(){let t=0,e=0;const i=this.__,{strokeAlign:s,__maxStrokeWidth:n}=i,r=this.__box;if((i.stroke||"all"===i.hitStroke)&&n&&"inside"!==s&&(e=t="center"===s?n/2:n,!i.__boxStroke)){const e=i.__isLinePath?0:10*t,s="none"===i.strokeCap?0:n;t+=Math.max(e,s)}return i.__useArrow&&(t+=5*n),r&&(t=Fl(t,r.__layout.strokeSpread=r.__updateStrokeSpread()),e=Math.max(e,r.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:s,backgroundBlur:n,filter:r,renderSpread:o}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=hl.getShadowRenderSpread(this,e)),s&&(t=Fl(t,s)),r&&(t=Il(t,ll.getSpread(r))),o&&(t=Il(t,o)),a&&(t=Il(t,a));let l=t;return i&&(l=Fl(l,hl.getInnerShadowSpread(this,i))),n&&(l=Fl(l,n)),this.__layout.renderShapeSpread=l,h?Fl(h.__updateRenderSpread(),t):t}},{stintSet:Nl}=f,zl={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Nl(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Nl(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:i,stroke:s}=t,n=t.innerShadow||t.blur||t.backgroundBlur||t.filter;Nl(t,"__isFastShadow",e&&!n&&e.length<2&&!e[0].spread&&!hl.isTransformShadow(e[0])&&i&&!t.__isTransparentFill&&!(u(i)&&i.length>1)&&(this.useFastShadow||!s||s&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!n)}t.__checkSingle(),Nl(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){Yl(this,t,e)},__draw(t,e,i){const s=this.__;if(s.__complex){s.__needComputePaint&&s.__computePaint();const{fill:n,stroke:r,__drawAfterFill:o,__fillAfterStroke:a,__isFastShadow:h}=s;if(this.__drawRenderPath(t),s.__useEffect&&!h){const h=rl.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=s;l&&hl.shadow(this,t,h),a&&(s.__isStrokes?rl.strokes(r,this,t,e):rl.stroke(r,this,t,e)),n&&(s.__isFills?rl.fills(n,this,t,e):rl.fill(n,this,t,e)),o&&this.__drawAfterFill(t,e),d&&hl.innerShadow(this,t,h),r&&!a&&(s.__isStrokes?rl.strokes(r,this,t,e):rl.stroke(r,this,t,e)),c&&ll.apply(c,this,this.__nowWorld,t,i,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(s.__isStrokes?rl.strokes(r,this,t,e):rl.stroke(r,this,t,e)),h){const e=s.shadow[0],{scaleX:i,scaleY:n}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*n,e.blur*i,il.string(e.color))}n&&(s.__isFills?rl.fills(n,this,t,e):rl.fill(n,this,t,e)),h&&t.restore(),o&&this.__drawAfterFill(t,e),r&&!a&&(s.__isStrokes?rl.strokes(r,this,t,e):rl.stroke(r,this,t,e))}}else s.__pathForRender?Yl(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const i=this.__,{fill:s,stroke:n}=i;s&&!e.ignoreFill&&(i.__isAlphaPixelFill?rl.fills(s,this,t,e):rl.fill("#000000",this,t,e)),i.__isCanvas&&this.__drawAfterFill(t,e),n&&!e.ignoreStroke&&(i.__isAlphaPixelStroke?rl.strokes(n,this,t,e):rl.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 Yl(t,e,i){const{fill:s,stroke:n,__drawAfterFill:r,__fillAfterStroke:o}=t.__;t.__drawRenderPath(e),o&&rl.stroke(n,t,e,i),s&&rl.fill(s,t,e,i),r&&t.__drawAfterFill(e,i),n&&!o&&rl.stroke(n,t,e,i)}const Xl={__drawFast(t,e){let{x:i,y:s,width:n,height:r}=this.__layout.boxBounds;const{fill:o,stroke:a,__drawAfterFill:h}=this.__;if(o&&(t.fillStyle=o,t.fillRect(i,s,n,r)),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,n,r);break;case"inside":n-=h,r-=h,n<0||r<0?(t.save(),this.__clip(t,e),t.strokeRect(i+l,s+l,n,r),t.restore()):t.strokeRect(i+l,s+l,n,r);break;case"outside":t.strokeRect(i-l,s-l,n+h,r+h)}}}};var Ul;let jl=Ul=class extends ph{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){F.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 Vn.set(this.path=t||[]),t||this.__drawPathByBox(Vn),Vn}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return a(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return ce.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return ce.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let i=e?this.__.__pathForRender:this.__.path;return i||(Vn.set(i=[]),this.__drawPathByBox(Vn,!e)),t?ss.toCanvasData(i,!0):i}getPathString(t,e,i){return ss.stringify(this.getPath(t,e),i)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||dl.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?jn.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&nl.addArrows(this)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path,!0)}__drawPathByData(t,e,i){e?rn.drawPathByData(t,e):this.__drawPathByBox(t,i)}__drawPathByBox(t,e){const{x:i,y:s,width:n,height:r}=this.__layout.boxBounds;if(this.__.cornerRadius&&!e){const{cornerRadius:e}=this.__;t.roundRect(i,s,n,r,l(e)?[e]:e)}else t.rect(i,s,n,r);t.closePath()}drawImagePlaceholder(t,e,i){rl.fill(this.__.placeholderColor,this,e,i)}animate(t,e,i,s){return this.set(t),ce.need("animate")}killAnimate(t,e){}export(t,e){return ce.need("export")}syncExport(t,e){return ce.need("export")}clone(t){const e=f.clone(this.toJSON());return t&&Object.assign(e,t),Ul.one(e)}static one(t,e,i,s,n){return pe.get(t.tag||this.prototype.__tag,t,e,i,s,n)}static registerUI(){Qr()(this)}static registerData(t){Xr(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};i([Xr(vl)],jl.prototype,"__",void 0),i([Zh()],jl.prototype,"zoomLayer",void 0),i([fr("")],jl.prototype,"id",void 0),i([fr("")],jl.prototype,"name",void 0),i([fr("")],jl.prototype,"className",void 0),i([Lr("pass-through")],jl.prototype,"blendMode",void 0),i([Ar(1)],jl.prototype,"opacity",void 0),i([Dr(!0)],jl.prototype,"visible",void 0),i([Lr(!1)],jl.prototype,"locked",void 0),i([Or(!1)],jl.prototype,"dim",void 0),i([Or(!1)],jl.prototype,"dimskip",void 0),i([Ir(0)],jl.prototype,"zIndex",void 0),i([Wr(!1)],jl.prototype,"mask",void 0),i([Nr(!1)],jl.prototype,"eraser",void 0),i([yr(0,!0)],jl.prototype,"x",void 0),i([yr(0,!0)],jl.prototype,"y",void 0),i([br(100,!0)],jl.prototype,"width",void 0),i([br(100,!0)],jl.prototype,"height",void 0),i([wr(1,!0)],jl.prototype,"scaleX",void 0),i([wr(1,!0)],jl.prototype,"scaleY",void 0),i([xr(0,!0)],jl.prototype,"rotation",void 0),i([xr(0,!0)],jl.prototype,"skewX",void 0),i([xr(0,!0)],jl.prototype,"skewY",void 0),i([yr(0,!0)],jl.prototype,"offsetX",void 0),i([yr(0,!0)],jl.prototype,"offsetY",void 0),i([mr(0,!0)],jl.prototype,"scrollX",void 0),i([mr(0,!0)],jl.prototype,"scrollY",void 0),i([vr()],jl.prototype,"origin",void 0),i([vr()],jl.prototype,"around",void 0),i([fr(!1)],jl.prototype,"lazy",void 0),i([Sr(1)],jl.prototype,"pixelRatio",void 0),i([Cr(0)],jl.prototype,"renderSpread",void 0),i([Br()],jl.prototype,"path",void 0),i([Pr()],jl.prototype,"windingRule",void 0),i([Pr(!0)],jl.prototype,"closed",void 0),i([br(0)],jl.prototype,"padding",void 0),i([br(!1)],jl.prototype,"lockRatio",void 0),i([br()],jl.prototype,"widthRange",void 0),i([br()],jl.prototype,"heightRange",void 0),i([fr(!1)],jl.prototype,"draggable",void 0),i([fr()],jl.prototype,"dragBounds",void 0),i([fr("auto")],jl.prototype,"dragBoundsType",void 0),i([fr(!1)],jl.prototype,"editable",void 0),i([zr(!0)],jl.prototype,"hittable",void 0),i([zr("path")],jl.prototype,"hitFill",void 0),i([Rr("path")],jl.prototype,"hitStroke",void 0),i([zr(!1)],jl.prototype,"hitBox",void 0),i([zr(!0)],jl.prototype,"hitChildren",void 0),i([zr(!0)],jl.prototype,"hitSelf",void 0),i([zr()],jl.prototype,"hitRadius",void 0),i([Yr("")],jl.prototype,"cursor",void 0),i([Lr()],jl.prototype,"fill",void 0),i([Rr(void 0,!0)],jl.prototype,"stroke",void 0),i([Rr("inside")],jl.prototype,"strokeAlign",void 0),i([Rr(1,!0)],jl.prototype,"strokeWidth",void 0),i([Rr(!1)],jl.prototype,"strokeWidthFixed",void 0),i([Rr("none")],jl.prototype,"strokeCap",void 0),i([Rr("miter")],jl.prototype,"strokeJoin",void 0),i([Rr()],jl.prototype,"dashPattern",void 0),i([Rr(0)],jl.prototype,"dashOffset",void 0),i([Rr(10)],jl.prototype,"miterLimit",void 0),i([Pr(0)],jl.prototype,"cornerRadius",void 0),i([Pr()],jl.prototype,"cornerSmoothing",void 0),i([Jh()],jl.prototype,"shadow",void 0),i([Jh()],jl.prototype,"innerShadow",void 0),i([Jh()],jl.prototype,"blur",void 0),i([Jh()],jl.prototype,"backgroundBlur",void 0),i([Jh()],jl.prototype,"grayscale",void 0),i([Jh()],jl.prototype,"filter",void 0),i([Lr()],jl.prototype,"placeholderColor",void 0),i([fr(100)],jl.prototype,"placeholderDelay",void 0),i([fr({})],jl.prototype,"data",void 0),i([Gr(ph.prototype.reset)],jl.prototype,"reset",null),jl=Ul=i([Jr(Wl),Jr(zl),Kr()],jl);let Hl=class extends jl{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:i}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),i.forEach(t=>this.add(t)),t.children=i}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);if(!this.childlessJSON){const i=e.children=[];this.children.forEach(e=>e.skipJSON||i.push(e.toJSON(t)))}return e}pick(t,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))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};var Vl;i([Xr(xl)],Hl.prototype,"__",void 0),i([br(0)],Hl.prototype,"width",void 0),i([br(0)],Hl.prototype,"height",void 0),Hl=i([Jr(kh),Qr()],Hl);const ql=ne.get("Leafer");let Gl=Vl=class extends Hl{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&er.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,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),Vl.list.add(this)}init(t,e){if(this.canvas)return;let i;const{config:s}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),i=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,f.assign(s,t));const n=this.canvas=ue.canvas(s);this.__controllers.push(this.renderer=ue.renderer(this,n,s),this.watcher=ue.watcher(this,s),this.layouter=ue.layouter(this,s)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),e||(this.selector=ue.selector(this),this.interaction=ue.interaction(this,n,this.selector,s),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=ue.hitCanvasManager()),this.canvasManager=new ve,i=s.start),this.hittable=s.hittable,this.fill=s.fill,this.canvasManager.add(n),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),Co.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(sa.RESTART):this.emitLeafer(sa.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(sa.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,Oe);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:i}=this;i&&(i.addBlock(t?new Gt(t):this.canvas.bounds),this.viewReady&&(e?i.render():i.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 i=f.copyAttrs({},this.canvas,Oe);e.resize(t),this.updateLazyBounds(),this.__onResize(new Zo(t,i))}__onResize(t){this.emitEvent(t),f.copyAttrs(this.__,t,Oe),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&&(Oe.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(sa.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Oe.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:i,canvas:s}=this,n=f.copyAttrs({},s,Oe);n[t]=i[t]=e,i.width&&i.height?s.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(n)}__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(sa.BEFORE_READY),this.emitLeafer(sa.READY),this.emitLeafer(sa.AFTER_READY),Co.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(sa.VIEW_READY),Co.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:i}=this.config;if(t){let{width:s,height:n,pixelRatio:r}=this;const o="box"===t?this.worldBoxBounds:this.__world;e||(s=Math.max(1,o.x+o.width)),i||(n=Math.max(1,o.y+o.height)),this.__doResize({width:s,height:n,pixelRatio:r})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){Co.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(sa.VIEW_COMPLETED),Co.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,i){e&&(t=t.bind(e));const s=this.__nextRenderWait;if(i){for(let e=0;e<s.length;e++)if(s[e]===t){s.splice(e,1);break}}else s.push(t);this.requestRender()}zoom(t,e,i,s){return ce.need("view")}getValidMove(t,e,i){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:i}=this.clientBounds;return{x:e+t.x,y:i+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new sa(t,this))}__listenEvents(){const t=he.start("FirstCreate "+this.innerName);this.once([[sa.START,()=>he.end(t)],[ea.START,this.updateLazyBounds,this],[ia.START,this.__onCreated,this],[ia.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[ta.DATA,this.__onWatchData,this],[ea.END,this.__onLayoutEnd,this],[ia.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){Vl.list.remove(this);try{this.stop(),this.emitLeafer(sa.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(()=>{sr.clearRecycled()},100)}catch(t){ql.error(t)}}};t?e():setTimeout(e)}};Gl.list=new Bh,i([Xr(Sl)],Gl.prototype,"__",void 0),i([br()],Gl.prototype,"pixelRatio",void 0),i([fr("normal")],Gl.prototype,"mode",void 0),Gl=Vl=i([Qr()],Gl);let Kl=class extends jl{get __tag(){return"Rect"}};i([Xr(Pl)],Kl.prototype,"__",void 0),Kl=i([Jr(Xl),Kr(),Qr()],Kl);const{add:$l,includes:Jl,scroll:Ql}=jt,Zl=Kl.prototype,td=Hl.prototype;let ed=class extends Hl{get __tag(){return"Box"}get isBranchLeaf(){return!0}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.pathInputed){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 i=this.__,s=this.__layout,{renderBounds:n,boxBounds:r}=s,{overflow:o}=i,a=s.childrenRenderBounds||(s.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=o&&o.includes("scroll"))&&($l(a,r),Ql(a,i)),this.__updateRectRenderBounds(),t=!Jl(r,a),t&&"show"===o&&$l(n,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))}};i([Xr(bl)],ed.prototype,"__",void 0),i([br(100)],ed.prototype,"width",void 0),i([br(100)],ed.prototype,"height",void 0),i([fr(!1)],ed.prototype,"resizeChildren",void 0),i([Cr("show")],ed.prototype,"overflow",void 0),i([Gr(Zl.__updateStrokeSpread)],ed.prototype,"__updateStrokeSpread",null),i([Gr(Zl.__updateRenderSpread)],ed.prototype,"__updateRectRenderSpread",null),i([Gr(Zl.__updateBoxBounds)],ed.prototype,"__updateRectBoxBounds",null),i([Gr(Zl.__updateStrokeBounds)],ed.prototype,"__updateStrokeBounds",null),i([Gr(Zl.__updateRenderBounds)],ed.prototype,"__updateRectRenderBounds",null),i([Gr(Zl.__updateChange)],ed.prototype,"__updateRectChange",null),i([Gr(Zl.__render)],ed.prototype,"__renderRect",null),i([Gr(td.__render)],ed.prototype,"__renderGroup",null),ed=i([Kr(),Qr()],ed);let id=class extends ed{get __tag(){return"Frame"}get isFrame(){return!0}};i([Xr(kl)],id.prototype,"__",void 0),i([Lr("#FFFFFF")],id.prototype,"fill",void 0),i([Cr("hide")],id.prototype,"overflow",void 0),id=i([Qr()],id);const{moveTo:sd,closePath:nd,ellipse:rd}=Ps;let od=class extends jl{get __tag(){return"Ellipse"}__updatePath(){const{width:t,height:e,innerRadius:i,startAngle:s,endAngle:n}=this.__,r=t/2,o=e/2,a=this.__.path=[];let h;i?s||n?(i<1?rd(a,r,o,r*i,o*i,0,s,n,!1):h=!0,rd(a,r,o,r,o,0,n,s,!0)):(i<1&&(rd(a,r,o,r*i,o*i),sd(a,t,o)),rd(a,r,o,r,o,0,360,0,!0)):s||n?(sd(a,r,o),rd(a,r,o,r,o,0,s,n,!1)):rd(a,r,o,r,o),h||nd(a),ee.ellipseToCurve&&(this.__.path=this.getPath(!0))}};i([Xr(Tl)],od.prototype,"__",void 0),i([Pr(0)],od.prototype,"innerRadius",void 0),i([Pr(0)],od.prototype,"startAngle",void 0),i([Pr(0)],od.prototype,"endAngle",void 0),od=i([Qr()],od);const{sin:ad,cos:hd,PI:ld}=Math,{moveTo:dd,lineTo:cd,closePath:ud,drawPoints:_d}=Ps;let pd=class extends jl{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)_d(e,t.points,t.curve,!0);else{const{width:i,height:s,sides:n}=t,r=i/2,o=s/2;dd(e,r,0);for(let t=1;t<n;t++)cd(e,r+r*ad(2*t*ld/n),o-o*hd(2*t*ld/n));ud(e)}}};i([Xr(El)],pd.prototype,"__",void 0),i([Pr(3)],pd.prototype,"sides",void 0),i([Pr()],pd.prototype,"points",void 0),i([Pr(0)],pd.prototype,"curve",void 0),pd=i([Kr(),Qr()],pd);const{sin:gd,cos:fd,PI:yd}=Math,{moveTo:md,lineTo:vd,closePath:wd}=Ps;let xd=class extends jl{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:i,innerRadius:s}=this.__,n=t/2,r=e/2,o=this.__.path=[];md(o,n,0);for(let t=1;t<2*i;t++)vd(o,n+(t%2==0?n:n*s)*gd(t*yd/i),r-(t%2==0?r:r*s)*fd(t*yd/i));wd(o)}};i([Xr(Rl)],xd.prototype,"__",void 0),i([Pr(5)],xd.prototype,"corners",void 0),i([Pr(.382)],xd.prototype,"innerRadius",void 0),xd=i([Qr()],xd);const{moveTo:bd,lineTo:Sd,drawPoints:kd}=Ps,{rotate:Bd,getAngle:Pd,getDistance:Td,defaultPoint:Ed}=lt;let Rd=class extends jl{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i={x:0,y:0};return t&&(i.x=t),e&&Bd(i,e),i}set toPoint(t){this.width=Td(Ed,t),this.rotation=Pd(Ed,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?kd(e,t.points,t.curve,t.closed):(bd(e,0,0),Sd(e,this.width,0))}};i([Xr(Bl)],Rd.prototype,"__",void 0),i([Tr("center")],Rd.prototype,"strokeAlign",void 0),i([br(0)],Rd.prototype,"height",void 0),i([Pr()],Rd.prototype,"points",void 0),i([Pr(0)],Rd.prototype,"curve",void 0),i([Pr(!1)],Rd.prototype,"closed",void 0),Rd=i([Qr()],Rd);let Cd=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}};i([Xr(Dl)],Cd.prototype,"__",void 0),i([br("")],Cd.prototype,"url",void 0),Cd=i([Qr()],Cd);const Ld=Cd;let Od=class extends Kl{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=ue.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new ar({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new Vo(Vo.LOADED,{image:t}))})}draw(t,e,i,s){const n=new yt(t.worldTransform).invert(),r=new yt;e&&r.translate(e.x,e.y),i&&(l(i)?r.scale(i):r.scale(i.x,i.y)),s&&r.rotate(s),n.multiplyParent(r),t.__render(this.canvas,{matrix:n.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:i,height:s}=this.__,{view:n}=this.canvas;t.drawImage(n,0,0,n.width,n.height,0,0,i,s)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:i}=this.__;t.resize(this.__,i),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};i([Xr(Ml)],Od.prototype,"__",void 0),i([Qh(100)],Od.prototype,"width",void 0),i([Qh(100)],Od.prototype,"height",void 0),i([Qh(1)],Od.prototype,"pixelRatio",void 0),i([Qh(!0)],Od.prototype,"smooth",void 0),i([fr(!1)],Od.prototype,"safeResize",void 0),i([Qh()],Od.prototype,"contextSettings",void 0),Od=i([Qr()],Od);const{copyAndSpread:Ad,includes:Dd,spread:Md,setList:Fd}=jt,{stintSet:Id}=f;let Wd=class extends jl{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:i,fontFamily:s,fontSize:n,fontWeight:r,italic:o,textCase:a,textOverflow:h,padding:l,width:d,height:c}=t;t.__lineHeight=sl.number(e,n),t.__letterSpacing=sl.number(i,n),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*n)/2,t.__font=`${o?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==r?r+" ":""}${n||12}px ${s||"caption"}`,Id(t,"__padding",l&&F.fourNumber(l)),Id(t,"__clipText","show"!==h&&!t.__autoSize),Id(t,"__isCharMode",d||c||t.__letterSpacing||"none"!==a),t.__textDrawData=el.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:i,italic:s,padding:n,__autoWidth:r,__autoHeight:o}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<i&&Md(a,i/2),r||o){if(h.x=r?a.x:0,h.y=o?a.y:0,h.width=r?a.width:t.width,h.height=o?a.height:t.height,n){const[e,i,s,n]=t.__padding;r&&(h.x-=n,h.width+=i+n),o&&(h.y-=e,h.height+=s+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();s&&(h.width+=.16*i),f.stintSet(this,"isOverflow",!Dd(h,a)),this.isOverflow?(Fd(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;Ad(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,i){const s=this.__box;s&&(s.__nowWorld=this.__nowWorld,s.__draw(t,e,i)),this.textEditing&&!e.exporting||super.__draw(t,e,i)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};i([Xr(Al)],Wd.prototype,"__",void 0),i([br(0)],Wd.prototype,"width",void 0),i([br(0)],Wd.prototype,"height",void 0),i([Lr()],Wd.prototype,"boxStyle",void 0),i([fr(!1)],Wd.prototype,"resizeFontSize",void 0),i([Lr("#000000")],Wd.prototype,"fill",void 0),i([Tr("outside")],Wd.prototype,"strokeAlign",void 0),i([zr("all")],Wd.prototype,"hitFill",void 0),i([br("")],Wd.prototype,"text",void 0),i([br("")],Wd.prototype,"placeholder",void 0),i([br("caption")],Wd.prototype,"fontFamily",void 0),i([br(12)],Wd.prototype,"fontSize",void 0),i([br("normal")],Wd.prototype,"fontWeight",void 0),i([br(!1)],Wd.prototype,"italic",void 0),i([br("none")],Wd.prototype,"textCase",void 0),i([br("none")],Wd.prototype,"textDecoration",void 0),i([br(0)],Wd.prototype,"letterSpacing",void 0),i([br({type:"percent",value:1.5})],Wd.prototype,"lineHeight",void 0),i([br(0)],Wd.prototype,"paraIndent",void 0),i([br(0)],Wd.prototype,"paraSpacing",void 0),i([br("x")],Wd.prototype,"writingMode",void 0),i([br("left")],Wd.prototype,"textAlign",void 0),i([br("top")],Wd.prototype,"verticalAlign",void 0),i([br(!0)],Wd.prototype,"autoSizeAlign",void 0),i([br("normal")],Wd.prototype,"textWrap",void 0),i([br("show")],Wd.prototype,"textOverflow",void 0),i([Lr(!1)],Wd.prototype,"textEditing",void 0),Wd=i([Qr()],Wd);let Nd=class extends jl{get __tag(){return"Path"}};i([Xr(Cl)],Nd.prototype,"__",void 0),i([Tr("center")],Nd.prototype,"strokeAlign",void 0),Nd=i([Qr()],Nd);let zd=class extends Hl{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new Nd(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,i,s,n,r){return this}quadraticCurveTo(t,e,i,s){return this}closePath(){return this}rect(t,e,i,s){return this}roundRect(t,e,i,s,n){return this}ellipse(t,e,i,s,n,r,o,a){return this}arc(t,e,i,s,n,r){return this}arcTo(t,e,i,s,n){return this}drawEllipse(t,e,i,s,n,r,o,a){return this}drawArc(t,e,i,s,n,r){return this}drawPoints(t,e,i){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}};i([Xr(Ll)],zd.prototype,"__",void 0),i([(t,e)=>{dr(t,e,{get(){return this.__path}})}],zd.prototype,"path",void 0),zd=i([Jr(Us,["set","path","paint"]),Qr()],zd);let Yd=class extends Gl{get __tag(){return"App"}get isApp(){return!0}constructor(t,e){super(t,e)}init(t,e){if(super.init(t,e),t){const{ground:e,tree:i,sky:s,editor:n}=t;e&&(this.ground=this.addLeafer(e)),(i||n)&&(this.tree=this.addLeafer(i||{type:t.type||"design"})),(s||n)&&(this.sky=this.addLeafer(s)),n&&ue.editor(n,this)}}__setApp(){const{canvas:t}=this,{realCanvas:e,view:i}=this.config;e||i===this.canvas.view||!t.parentView?this.realCanvas=!0:t.unrealCanvas(),this.leafer=this,this.watcher.disable(),this.layouter.disable()}__updateLocalBounds(){this.forEach(t=>t.updateLayout()),super.__updateLocalBounds()}start(){super.start(),this.forEach(t=>t.start())}stop(){this.forEach(t=>t.stop()),super.stop()}unlockLayout(){super.unlockLayout(),this.forEach(t=>t.unlockLayout())}lockLayout(){super.lockLayout(),this.forEach(t=>t.lockLayout())}forceRender(t,e){this.forEach(i=>i.forceRender(t,e))}addLeafer(t){const e=new Gl(t);return this.add(e),e}add(t,e){if(!t.view){if(this.realCanvas&&!this.canvas.bounds)return void setTimeout(()=>this.add(t,e),10);t.init(this.__getChildConfig(t.userConfig),this)}super.add(t,e),r(e)||(t.canvas.childIndex=e),this.__listenChildEvents(t)}forEach(t){this.children.forEach(t)}__onCreated(){this.created=this.children.every(t=>t.created)}__onReady(){this.children.every(t=>t.ready)&&super.__onReady()}__onViewReady(){this.children.every(t=>t.viewReady)&&super.__onViewReady()}__onChildRenderEnd(t){this.renderer.addBlock(t.renderBounds),this.viewReady&&this.renderer.update()}__render(t,e){t.context&&this.forEach(i=>e.matrix?i.__render(t,e):t.copyWorld(i.canvas,e.bounds))}__onResize(t){this.forEach(e=>e.resize(t)),super.__onResize(t)}updateLayout(){this.forEach(t=>t.updateLayout())}__getChildConfig(t){const e=Object.assign({},this.config);return e.hittable=e.realCanvas=void 0,t&&f.assign(e,t),this.autoLayout&&f.copyAttrs(e,this,Oe),e.view=this.realCanvas?void 0:this.view,e.fill=void 0,e}__listenChildEvents(t){t.once([[ea.END,this.__onReady,this],[ia.START,this.__onCreated,this],[ia.END,this.__onViewReady,this]]),this.realCanvas&&this.__eventIds.push(t.on_(ia.END,this.__onChildRenderEnd,this))}};Yd=i([Qr()],Yd);const Xd={},Ud={isHoldSpaceKey:()=>Ud.isHold("Space"),isHold:t=>Xd[t],isHoldKeys:(t,e)=>e?t(e):void 0,setDownCode(t){Xd[t]||(Xd[t]=!0)},setUpCode(t){Xd[t]=!1}},jd={LEFT:1,RIGHT:2,MIDDLE:4,defaultLeft(t){t.buttons||(t.buttons=1)},left:t=>1===t.buttons,right:t=>2===t.buttons,middle:t=>4===t.buttons};class Hd extends Yo{get spaceKey(){return Ud.isHoldSpaceKey()}get left(){return jd.left(this)}get right(){return jd.right(this)}get middle(){return jd.middle(this)}constructor(t){super(t.type),this.bubbles=!0,Object.assign(this,t)}isHoldKeys(t){return Ud.isHoldKeys(t,this)}getBoxPoint(t){return(t||this.current).getBoxPoint(this)}getInnerPoint(t){return(t||this.current).getInnerPoint(this)}getLocalPoint(t){return(t||this.current).getLocalPoint(this)}getPagePoint(){return this.current.getPagePoint(this)}getInner(t){return this.getInnerPoint(t)}getLocal(t){return this.getLocalPoint(t)}getPage(){return this.getPagePoint()}static changeName(t,e){ye.changeName(t,e)}}const{min:Vd,max:qd,abs:Gd}=Math,{float:Kd,sign:$d}=F,{minX:Jd,maxX:Qd,minY:Zd,maxY:tc}=jt,ec=new Gt,ic=new Gt,sc={limitMove(t,e){const{dragBounds:i,dragBoundsType:s}=t;i&&nc.getValidMove(t.__localBoxBounds,nc.getDragBounds(t),s,e,!0),nc.axisMove(t,e)},limitScaleOf(t,e,i,s){const{dragBounds:n,dragBoundsType:r}=t;n&&nc.getValidScaleOf(t.__localBoxBounds,nc.getDragBounds(t),r,t.getLocalPointByInner(t.getInnerPointByBox(e)),i,s,!0)},axisMove(t,e){const{draggable:i}=t;"x"===i&&(e.y=0),"y"===i&&(e.x=0)},getDragBounds(t){const{dragBounds:e}=t;return"parent"===e?t.parent.boxBounds:e},isInnerMode:(t,e,i,s)=>"inner"===i||"auto"===i&&t[s]>e[s],getValidMove(t,e,i,s,n){const r=t.x+s.x,o=t.y+s.y,a=r+t.width,h=o+t.height,l=e.x+e.width,d=e.y+e.height;return n||(s=Object.assign({},s)),nc.isInnerMode(t,e,i,"width")?r>e.x?s.x+=e.x-r:a<l&&(s.x+=l-a):r<e.x?s.x+=e.x-r:a>l&&(s.x+=l-a),nc.isInnerMode(t,e,i,"height")?o>e.y?s.y+=e.y-o:h<d&&(s.y+=d-h):o<e.y?s.y+=e.y-o:h>d&&(s.y+=d-h),s.x=Kd(s.x),s.y=Kd(s.y),s},getValidScaleOf(t,e,i,s,n,r,o){o||(n=Object.assign({},n)),ic.set(e),ec.set(t).scaleOf(s,n.x,n.y);const a=(s.x-t.x)/t.width,l=1-a,d=(s.y-t.y)/t.height,c=1-d;let u,_,p,g,f=1,y=1;return nc.isInnerMode(t,e,i,"width")?(n.x<0&&ec.scaleOf(s,f=1/n.x,1),p=Kd(ec.minX-ic.minX),g=Kd(ic.maxX-ec.maxX),u=a&&p>0?1+p/(a*ec.width):1,_=l&&g>0?1+g/(l*ec.width):1,f*=qd(u,_)):(n.x<0&&((Kd(Jd(t)-Jd(e))<=0||Kd(Qd(e)-Qd(t))<=0)&&ec.scaleOf(s,f=1/n.x,1),ec.unsign()),p=Kd(ic.minX-ec.minX),g=Kd(ec.maxX-ic.maxX),u=a&&p>0?1-p/(a*ec.width):1,_=l&&g>0?1-g/(l*ec.width):1,f*=Vd(u,_)),nc.isInnerMode(t,e,i,"height")?(n.y<0&&ec.scaleOf(s,1,y=1/n.y),p=Kd(ec.minY-ic.minY),g=Kd(ic.maxY-ec.maxY),u=d&&p>0?1+p/(d*ec.height):1,_=c&&g>0?1+g/(c*ec.height):1,y*=qd(u,_),r&&(u=qd(Gd(f),Gd(y)),f=$d(f)*u,y=$d(y)*u)):(n.y<0&&((Kd(Zd(t)-Zd(e))<=0||Kd(tc(e)-tc(t))<=0)&&ec.scaleOf(s,1,y=1/n.y),ec.unsign()),p=Kd(ic.minY-ec.minY),g=Kd(ec.maxY-ic.maxY),u=d&&p>0?1-p/(d*ec.height):1,_=c&&g>0?1-g/(c*ec.height):1,y*=Vd(u,_)),n.x*=h(f)?f:1,n.y*=h(y)?y:1,n}},nc=sc;let rc=class extends Hd{};rc.POINTER="pointer",rc.BEFORE_DOWN="pointer.before_down",rc.BEFORE_MOVE="pointer.before_move",rc.BEFORE_UP="pointer.before_up",rc.DOWN="pointer.down",rc.MOVE="pointer.move",rc.UP="pointer.up",rc.OVER="pointer.over",rc.OUT="pointer.out",rc.ENTER="pointer.enter",rc.LEAVE="pointer.leave",rc.TAP="tap",rc.DOUBLE_TAP="double_tap",rc.CLICK="click",rc.DOUBLE_CLICK="double_click",rc.LONG_PRESS="long_press",rc.LONG_TAP="long_tap",rc.MENU="pointer.menu",rc.MENU_TAP="pointer.menu_tap",rc=i([Zr()],rc);const oc=rc,ac={};let hc=class extends rc{static setList(t){this.list=t instanceof Bh?t:new Bh(t)}static setData(t){this.data=t}static getValidMove(t,e,i,s=!0){const n=t.getLocalPoint(i,null,!0);return lt.move(n,e.x-t.x,e.y-t.y),s&&this.limitMove(t,n),sc.axisMove(t,n),n}static limitMove(t,e){sc.limitMove(t,e)}getPageMove(t){return this.assignMove(t),this.current.getPagePoint(ac,null,!0)}getInnerMove(t,e){return t||(t=this.current),this.assignMove(e),t.getInnerPoint(ac,null,!0)}getLocalMove(t,e){return t||(t=this.current),this.assignMove(e),t.getLocalPoint(ac,null,!0)}getPageTotal(){return this.getPageMove(!0)}getInnerTotal(t){return this.getInnerMove(t,!0)}getLocalTotal(t){return this.getLocalMove(t,!0)}getPageBounds(){const t=this.getPageTotal(),e=this.getPagePoint(),i={};return jt.set(i,e.x-t.x,e.y-t.y,t.x,t.y),jt.unsign(i),i}assignMove(t){ac.x=t?this.totalX:this.moveX,ac.y=t?this.totalY:this.moveY}};hc.BEFORE_DRAG="drag.before_drag",hc.START="drag.start",hc.DRAG="drag",hc.END="drag.end",hc.OVER="drag.over",hc.OUT="drag.out",hc.ENTER="drag.enter",hc.LEAVE="drag.leave",hc=i([Zr()],hc);const lc=hc;let dc=class extends rc{static setList(t){hc.setList(t)}static setData(t){hc.setData(t)}};dc.DROP="drop",dc=i([Zr()],dc);let cc=class extends hc{};cc.BEFORE_MOVE="move.before_move",cc.START="move.start",cc.MOVE="move",cc.DRAG_ANIMATE="move.drag_animate",cc.END="move.end",cc.PULL_DOWN="move.pull_down",cc.REACH_BOTTOM="move.reach_bottom",cc=i([Zr()],cc);let uc=class extends Hd{};uc=i([Zr()],uc);const _c=uc;let pc=class extends rc{};pc.BEFORE_ROTATE="rotate.before_rotate",pc.START="rotate.start",pc.ROTATE="rotate",pc.END="rotate.end",pc=i([Zr()],pc);let gc=class extends hc{};gc.SWIPE="swipe",gc.LEFT="swipe.left",gc.RIGHT="swipe.right",gc.UP="swipe.up",gc.DOWN="swipe.down",gc=i([Zr()],gc);let fc=class extends rc{};fc.BEFORE_ZOOM="zoom.before_zoom",fc.START="zoom.start",fc.ZOOM="zoom",fc.END="zoom.end",fc=i([Zr()],fc);let yc=class extends Hd{};yc.BEFORE_DOWN="key.before_down",yc.BEFORE_UP="key.before_up",yc.DOWN="key.down",yc.HOLD="key.hold",yc.UP="key.up",yc=i([Zr()],yc);const mc={getDragEventData:(t,e,i)=>Object.assign(Object.assign({},i),{x:i.x,y:i.y,moveX:i.x-e.x,moveY:i.y-e.y,totalX:i.x-t.x,totalY:i.y-t.y}),getDropEventData:(t,e,i)=>Object.assign(Object.assign({},t),{list:e,data:i}),getSwipeDirection:t=>t<-45&&t>-135?gc.UP:t>45&&t<135?gc.DOWN:t<=45&&t>=-45?gc.RIGHT:gc.LEFT,getSwipeEventData:(t,e,i)=>Object.assign(Object.assign({},i),{moveX:e.moveX,moveY:e.moveY,totalX:i.x-t.x,totalY:i.y-t.y,type:vc.getSwipeDirection(lt.getAngle(t,i))}),getBase(t){const e=1===t.button?4:t.button;return{altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,time:Date.now(),buttons:r(t.buttons)?1:0===t.buttons?e:t.buttons,origin:t}},pathHasEventType(t,e){const{list:i}=t;for(let t=0,s=i.length;t<s;t++)if(i[t].hasEvent(e))return!0;return!1},filterPathByEventType(t,e){const i=new Bh,{list:s}=t;for(let t=0,n=s.length;t<n;t++)s[t].hasEvent(e)&&i.add(s[t]);return i},pathCanDrag:t=>t&&t.list.some(t=>uo.draggable(t)||!t.isLeafer&&t.hasEvent(hc.DRAG)),pathHasOutside:t=>t&&t.list.some(t=>t.isOutside)},vc=mc,wc=new Bh,{getDragEventData:xc,getDropEventData:bc,getSwipeEventData:Sc}=mc;class kc{constructor(t){this.dragDataList=[],this.interaction=t}setDragData(t){this.animateWait&&this.dragEndReal(),this.downData=this.interaction.downData,this.dragData=xc(t,t,t),this.canAnimate=this.canDragOut=!0}getList(t,e){const{proxy:i}=this.interaction.selector,s=i&&i.list.length,n=hc.list||this.draggableList||wc;return this.dragging&&(s?t?wc:new Bh(e?[...i.list,...i.dragHoverExclude]:i.list):n)}checkDrag(t,e){const{interaction:i}=this;if(this.moving&&t.buttons<1)return this.canAnimate=!1,void i.pointerCancel();!this.moving&&e&&(this.moving=i.canMove(this.downData)||i.isHoldRightKey||i.isMobileDragEmpty)&&(this.dragData.moveType="drag",i.emit(cc.START,this.dragData)),this.moving||this.dragStart(t,e),this.drag(t)}dragStart(t,e){this.dragging||(this.dragging=e&&jd.left(t),this.dragging&&(this.interaction.emit(hc.START,this.dragData),this.getDraggableList(this.dragData.path),this.setDragStartPoints(this.realDraggableList=this.getList(!0))))}setDragStartPoints(t){this.dragStartPoints={},t.forEach(t=>this.dragStartPoints[t.innerId]={x:t.x,y:t.y})}getDraggableList(t){let e;for(let i=0,s=t.length;i<s;i++)if(e=t.list[i],uo.draggable(e)){this.draggableList=new Bh(e);break}}drag(t){const{interaction:e,dragData:i,downData:s}=this,{path:n,throughPath:r}=s;this.dragData=xc(s,i,t),r&&(this.dragData.throughPath=r),this.dragData.path=n,this.dragDataList.push(this.dragData),this.moving?(t.moving=!0,this.dragData.moveType="drag",e.emit(cc.BEFORE_MOVE,this.dragData),e.emit(cc.MOVE,this.dragData)):this.dragging&&(t.dragging=!0,this.dragReal(),e.emit(hc.BEFORE_DRAG,this.dragData),e.emit(hc.DRAG,this.dragData))}dragReal(t){const{interaction:e}=this,{running:i}=e,s=this.realDraggableList;if(s.length&&i){const{totalX:i,totalY:n}=this.dragData,{dragLimitAnimate:r}=e.p,o=!r||!!t;s.forEach(e=>{if(e.draggable){const s=a(e.draggable),h=hc.getValidMove(e,this.dragStartPoints[e.innerId],{x:i,y:n},o||s);r&&!s&&t?uo.animateMove(e,h,l(r)?r:.3):e.move(h)}})}}dragOverOrOut(t){const{interaction:e}=this,{dragOverPath:i}=this,{path:s}=t;this.dragOverPath=s,i?s.indexAt(0)!==i.indexAt(0)&&(e.emit(hc.OUT,t,i),e.emit(hc.OVER,t,s)):e.emit(hc.OVER,t,s)}dragEnterOrLeave(t){const{interaction:e}=this,{dragEnterPath:i}=this,{path:s}=t;e.emit(hc.LEAVE,t,i,s),e.emit(hc.ENTER,t,s,i),this.dragEnterPath=s}dragEnd(t){(this.dragging||this.moving)&&(this.checkDragEndAnimate(t)||this.dragEndReal(t))}dragEndReal(t){const{interaction:e,downData:i,dragData:s}=this;t||(t=s);const{path:n,throughPath:r}=i,o=xc(i,t,t);if(r&&(o.throughPath=r),o.path=n,this.moving&&(this.moving=!1,o.moveType="drag",e.emit(cc.END,o)),this.dragging){const n=this.getList();this.dragging=!1,e.p.dragLimitAnimate&&this.dragReal(!0),e.emit(hc.END,o),this.swipe(t,i,s,o),this.drop(t,n,this.dragEnterPath)}this.autoMoveCancel(),this.dragReset(),this.animate(null,"off")}swipe(t,e,i,s){const{interaction:n}=this;if(lt.getDistance(e,t)>n.config.pointer.swipeDistance){const t=Sc(e,i,s);this.interaction.emit(t.type,t)}}drop(t,e,i){const s=bc(t,e,hc.data);s.path=i,this.interaction.emit(dc.DROP,s),this.interaction.emit(hc.LEAVE,t,i)}dragReset(){hc.list=hc.data=this.draggableList=this.dragData=this.downData=this.dragOverPath=this.dragEnterPath=null,this.dragDataList=[]}checkDragEndAnimate(t,e){return!1}animate(t,e){}stopAnimate(){}checkDragOut(t){}autoMoveOnDragOut(t){}autoMoveCancel(){}destroy(){this.dragReset()}}const Bc=ne.get("emit");const Pc=["move","zoom","rotate","key"];function Tc(t,e,i,s,n){if(Pc.some(t=>e.startsWith(t))&&t.__.hitChildren&&!Rc(t,n)){let r;for(let o=0,a=t.children.length;o<a;o++)r=t.children[o],!i.path.has(r)&&r.__.hittable&&Ec(r,e,i,s,n)}}function Ec(t,e,i,s,n){if(t.destroyed)return!1;if(t.__.hitSelf&&!Rc(t,n)&&(cl.updateEventStyle&&!s&&cl.updateEventStyle(t,e),t.hasEvent(e,s))){i.phase=s?1:t===i.target?2:3;const n=ye.get(e,i);if(t.emitEvent(n,s),n.isStop)return!0}return!1}function Rc(t,e){return e&&e.has(t)}const Cc={wheel:{zoomSpeed:.5,moveSpeed:.5,rotateSpeed:.5,delta:{x:20,y:8}},pointer:{type:"pointer",snap:!0,hitRadius:5,tapTime:120,longPressTime:800,transformTime:500,hover:!0,dragHover:!0,dragDistance:2,swipeDistance:20},touch:{preventDefault:"auto"},multiTouch:{},move:{autoDistance:2},zoom:{},cursor:!0,keyEvent:!0},{pathHasEventType:Lc,pathCanDrag:Oc,pathHasOutside:Ac}=mc;class Dc{get dragging(){return this.dragger.dragging}get transforming(){return this.transformer.transforming}get moveMode(){return!0===this.m.drag||this.isHoldSpaceKey||this.isHoldMiddleKey||this.isHoldRightKey&&this.dragger.moving||this.isDragEmpty}get canHover(){return this.p.hover&&!this.config.mobile}get isDragEmpty(){return this.m.dragEmpty&&this.isRootPath(this.hoverData)&&(!this.downData||this.isRootPath(this.downData))}get isMobileDragEmpty(){return this.m.dragEmpty&&!this.canHover&&this.downData&&this.isTreePath(this.downData)}get isHoldMiddleKey(){return this.m.holdMiddleKey&&this.downData&&jd.middle(this.downData)}get isHoldRightKey(){return this.m.holdRightKey&&this.downData&&jd.right(this.downData)}get isHoldSpaceKey(){return this.m.holdSpaceKey&&Ud.isHoldSpaceKey()}get m(){return this.config.move}get p(){return this.config.pointer}get hitRadius(){return this.p.hitRadius}constructor(t,e,i,s){this.config=f.clone(Cc),this.tapCount=0,this.downKeyMap={},this.target=t,this.canvas=e,this.selector=i,this.defaultPath=new Bh(t),this.createTransformer(),this.dragger=new kc(this),s&&(this.config=f.default(s,this.config)),this.__listenEvents()}start(){this.running=!0}stop(){this.running=!1}receive(t){}pointerDown(t,e){t||(t=this.hoverData),t&&(jd.defaultLeft(t),this.updateDownData(t),this.checkPath(t,e),this.downTime=Date.now(),this.emit(rc.BEFORE_DOWN,t),t.path.needUpdate&&this.updateDownData(t),this.emit(rc.DOWN,t),jd.left(t)&&(this.tapWait(),this.longPressWait(t)),this.waitRightTap=jd.right(t),this.dragger.setDragData(t),this.isHoldRightKey||this.updateCursor(t))}pointerMove(t){if(t||(t=this.hoverData),!t)return;const{downData:e}=this;e&&jd.defaultLeft(t);(this.canvas.bounds.hitPoint(t)||e)&&(this.pointerMoveReal(t),e&&this.dragger.checkDragOut(t))}pointerMoveReal(t){if(this.emit(rc.BEFORE_MOVE,t,this.defaultPath),this.downData){const e=lt.getDistance(this.downData,t)>this.p.dragDistance;e&&(this.pointerWaitCancel(),this.waitRightTap=!1),this.dragger.checkDrag(t,e)}this.dragger.moving||(this.updateHoverData(t),this.checkPath(t),this.emit(rc.MOVE,t),this.pointerHover(t),this.dragging&&(this.dragger.dragOverOrOut(t),this.dragger.dragEnterOrLeave(t))),this.updateCursor(this.downData||t)}pointerUp(t){const{downData:e}=this;if(t||(t=e),!e)return;jd.defaultLeft(t),t.multiTouch=e.multiTouch,this.findPath(t);const i=Object.assign(Object.assign({},t),{path:t.path.clone()});t.path.addList(e.path.list),this.checkPath(t),this.downData=null,this.emit(rc.BEFORE_UP,t),this.emit(rc.UP,t),this.touchLeave(t),t.isCancel||(this.tap(t),this.menuTap(t)),this.dragger.dragEnd(t),this.updateCursor(i)}pointerCancel(){const t=Object.assign({},this.dragger.dragData);t.isCancel=!0,this.pointerUp(t)}menu(t){this.findPath(t),this.emit(rc.MENU,t),this.waitMenuTap=!0,!this.downData&&this.waitRightTap&&this.menuTap(t)}menuTap(t){this.waitRightTap&&this.waitMenuTap&&(this.emit(rc.MENU_TAP,t),this.waitRightTap=this.waitMenuTap=!1)}createTransformer(){}move(t){}zoom(t){}rotate(t){}transformEnd(){}wheel(t){}multiTouch(t,e){}keyDown(t){if(!this.config.keyEvent)return;this.emit(yc.BEFORE_DOWN,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]||(this.downKeyMap[e]=!0,Ud.setDownCode(e),this.emit(yc.HOLD,t,this.defaultPath),this.moveMode&&(this.cancelHover(),this.updateCursor())),this.emit(yc.DOWN,t,this.defaultPath)}keyUp(t){if(!this.config.keyEvent)return;this.emit(yc.BEFORE_UP,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]=!1,Ud.setUpCode(e),this.emit(yc.UP,t,this.defaultPath),"grab"===this.cursor&&this.updateCursor()}pointerHover(t){!this.canHover||this.dragging&&!this.p.dragHover||(t.path||(t.path=new Bh),this.pointerOverOrOut(t),this.pointerEnterOrLeave(t))}pointerOverOrOut(t){const{path:e}=t,{overPath:i}=this;this.overPath=e,i?e.indexAt(0)!==i.indexAt(0)&&(this.emit(rc.OUT,t,i),this.emit(rc.OVER,t,e)):this.emit(rc.OVER,t,e)}pointerEnterOrLeave(t){let{path:e}=t;this.downData&&!this.moveMode&&(e=e.clone(),this.downData.path.forEach(t=>e.add(t)));const{enterPath:i}=this;this.enterPath=e,this.emit(rc.LEAVE,t,i,e),this.emit(rc.ENTER,t,e,i)}touchLeave(t){"touch"===t.pointerType&&this.enterPath&&(this.emit(rc.LEAVE,t),this.dragger.dragging&&this.emit(dc.LEAVE,t))}tap(t){const{pointer:e}=this.config,i=this.longTap(t);if(!e.tapMore&&i)return;if(!this.waitTap)return;e.tapMore&&this.emitTap(t);const s=Date.now()-this.downTime,n=[rc.DOUBLE_TAP,rc.DOUBLE_CLICK].some(e=>Lc(t.path,e));s<e.tapTime+50&&n?(this.tapCount++,2===this.tapCount?(this.tapWaitCancel(),this.emitDoubleTap(t)):(clearTimeout(this.tapTimer),this.tapTimer=setTimeout(()=>{e.tapMore||(this.tapWaitCancel(),this.emitTap(t))},e.tapTime))):e.tapMore||(this.tapWaitCancel(),this.emitTap(t))}findPath(t,e){const{hitRadius:i,through:s}=this.p,{bottomList:n,target:r}=this;ee.backgrounder||t.origin||r&&r.updateLayout();const o=this.selector.getByPoint(t,i,Object.assign({bottomList:n,name:t.type},e||{through:s}));return o.throughPath&&(t.throughPath=o.throughPath),t.path=o.path,o.path}isRootPath(t){return t&&t.path.list[0].isLeafer}isTreePath(t){const e=this.target.app;return!(!e||!e.isApp)&&(e.editor&&!t.path.has(e.editor)&&t.path.has(e.tree)&&!t.target.syncEventer)}checkPath(t,e){(e||this.moveMode&&!Ac(t.path))&&(t.path=this.defaultPath)}canMove(t){return t&&(this.moveMode||"auto"===this.m.drag&&!Oc(t.path))&&!Ac(t.path)}isDrag(t){return this.dragger.getList().has(t)}isPress(t){return this.downData&&this.downData.path.has(t)}isHover(t){return this.enterPath&&this.enterPath.has(t)}isFocus(t){return this.focusData===t}cancelHover(){const{hoverData:t}=this;t&&(t.path=this.defaultPath,this.pointerHover(t))}stopDragAnimate(){this.dragger.stopAnimate()}updateDownData(t,e,i){const{downData:s}=this;!t&&s&&(t=s),t&&(this.findPath(t,e),i&&s&&t.path.addList(s.path.list),this.downData=t)}updateHoverData(t){t||(t=this.hoverData),t&&(this.findPath(t,{exclude:this.dragger.getList(!1,!0),name:rc.MOVE}),this.hoverData=t)}updateCursor(t){if(!this.config.cursor||!this.canHover)return;if(t||(this.updateHoverData(),t=this.downData||this.hoverData),this.dragger.moving)return this.setCursor("grabbing");if(this.canMove(t))return this.setCursor(this.downData?"grabbing":"grab");if(!t)return;let e,i;const{path:s}=t;for(let t=0,n=s.length;t<n&&(e=s.list[t],i=e.syncEventer&&e.syncEventer.cursor||e.cursor,!i);t++);this.setCursor(i)}setCursor(t){this.cursor=t}getLocal(t,e){const i=this.canvas.getClientBounds(e),s={x:t.clientX-i.x,y:t.clientY-i.y},{bounds:n}=this.canvas;return s.x*=n.width/i.width,s.y*=n.height/i.height,this.p.snap&&lt.round(s),s}emitTap(t){this.emit(rc.TAP,t),this.emit(rc.CLICK,t)}emitDoubleTap(t){this.emit(rc.DOUBLE_TAP,t),this.emit(rc.DOUBLE_CLICK,t)}pointerWaitCancel(){this.tapWaitCancel(),this.longPressWaitCancel()}tapWait(){clearTimeout(this.tapTimer),this.waitTap=!0}tapWaitCancel(){this.waitTap&&(clearTimeout(this.tapTimer),this.waitTap=!1,this.tapCount=0)}longPressWait(t){clearTimeout(this.longPressTimer),this.longPressTimer=setTimeout(()=>{this.longPressed=!0,this.emit(rc.LONG_PRESS,t)},this.p.longPressTime)}longTap(t){let e;return this.longPressed&&(this.emit(rc.LONG_TAP,t),(Lc(t.path,rc.LONG_TAP)||Lc(t.path,rc.LONG_PRESS))&&(e=!0)),this.longPressWaitCancel(),e}longPressWaitCancel(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressed=!1)}__onResize(){const{dragOut:t}=this.m;this.shrinkCanvasBounds=new Gt(this.canvas.bounds),this.shrinkCanvasBounds.spread(-(l(t)?t:2))}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(Zo.RESIZE,this.__onResize,this)],t.once(sa.READY,()=>this.__onResize())}__removeListenEvents(){this.target.off_(this.__eventIds),this.__eventIds.length=0}emit(t,e,i,s){this.running&&function(t,e,i,s){if(!i&&!e.path)return;let n;e.type=t,i?e=Object.assign(Object.assign({},e),{path:i}):i=e.path,e.target=i.indexAt(0);try{for(let r=i.length-1;r>-1;r--){if(n=i.list[r],Ec(n,t,e,!0,s))return;n.isApp&&Tc(n,t,e,!0,s)}for(let r=0,o=i.length;r<o;r++)if(n=i.list[r],n.isApp&&Tc(n,t,e,!1,s),Ec(n,t,e,!1,s))return}catch(t){Bc.error(t)}}(t,e,i,s)}destroy(){this.__eventIds.length&&(this.stop(),this.__removeListenEvents(),this.dragger.destroy(),this.transformer&&this.transformer.destroy(),this.downData=this.overPath=this.enterPath=null)}}class Mc{static set(t,e){this.custom[t]=e}static get(t){return this.custom[t]}}Mc.custom={};class Fc extends ve{constructor(){super(...arguments),this.maxTotal=1e3,this.pathList=new Bh,this.pixelList=new Bh}getPixelType(t,e){return this.__autoClear(),this.pixelList.add(t),ue.hitCanvas(e)}getPathType(t){return this.__autoClear(),this.pathList.add(t),ue.hitCanvas()}clearImageType(){this.__clearLeafList(this.pixelList)}clearPathType(){this.__clearLeafList(this.pathList)}__clearLeafList(t){t.length&&(t.forEach(t=>{t.__hitCanvas&&(t.__hitCanvas.destroy(),t.__hitCanvas=null)}),t.reset())}__autoClear(){this.pathList.length+this.pixelList.length>this.maxTotal&&this.clear()}clear(){this.clearPathType(),this.clearImageType()}}ee.getSelector=function(t){return t.leafer?t.leafer.selector:ee.selector||(ee.selector=ue.selector())};const{toInnerRadiusPointOf:Ic,copyRadiusPoint:Wc}=lt,{hitRadiusPoint:Nc,hitPoint:zc}=jt,Yc={},Xc={},Uc=ph.prototype;Uc.hit=function(t,e=0){this.updateLayout(),Wc(Xc,t,e);const i=this.__world;return!!(e?Nc(i,Xc):zc(i,Xc))&&(this.isBranch?ee.getSelector(this).hitPoint(Object.assign({},Xc),e,{target:this}):this.__hitWorld(Xc))},Uc.__hitWorld=function(t,e){const i=this.__;if(!i.hitSelf)return!1;const s=this.__world,n=this.__layout,r=s.width<10&&s.height<10;if(i.hitRadius&&(Wc(Yc,t,i.hitRadius),t=Yc),Ic(t,s,Yc),i.hitBox||r){if(jt.hitRadiusPoint(n.boxBounds,Yc))return!0;if(r)return!1}return!n.hitCanvasChanged&&this.__hitCanvas||(this.__updateHitCanvas(),n.boundsChanged||(n.hitCanvasChanged=!1)),this.__hit(Yc,e)},Uc.__hitFill=function(t){const e=this.__hitCanvas;return e&&e.hitFill(t,this.__.windingRule)},Uc.__hitStroke=function(t,e){const i=this.__hitCanvas;return i&&i.hitStroke(t,e)},Uc.__hitPixel=function(t){const e=this.__hitCanvas;return e&&e.hitPixel(t,this.__layout.renderBounds,e.hitScale)},Uc.__drawHitPath=function(t){t&&this.__drawRenderPath(t)};const jc=new yt,Hc=jl.prototype;Hc.__updateHitCanvas=function(){this.__box&&this.__box.__updateHitCanvas();const{hitCanvasManager:t}=this.leafer||this.parent&&this.parent.leafer||{};if(!t)return;const e=this.__,i=(e.__isAlphaPixelFill||e.__isCanvas)&&"pixel"===e.hitFill,s=e.__isAlphaPixelStroke&&"pixel"===e.hitStroke,n=i||s;this.__hitCanvas||(this.__hitCanvas=n?t.getPixelType(this,{contextSettings:{willReadFrequently:!0}}):t.getPathType(this));const r=this.__hitCanvas;if(n){const{renderBounds:t}=this.__layout,n=ee.image.hitCanvasSize,o=r.hitScale=Kt.set(0,0,n,n).getFitMatrix(t).a,{x:a,y:h,width:l,height:d}=Kt.set(t).scale(o);r.resize({width:l,height:d,pixelRatio:1}),r.clear(),sr.patternLocked=!0,this.__renderShape(r,{matrix:jc.setWith(this.__world).scaleWith(1/o).invertWith().translate(-a,-h),snapshot:!0,ignoreFill:!i,ignoreStroke:!s}),sr.patternLocked=!1,r.resetTransform(),e.__isHitPixel=!0}else e.__isHitPixel&&(e.__isHitPixel=!1);this.__drawHitPath(r),r.setStrokeOptions(e)},Hc.__hit=function(t,e){if(this.__box&&this.__box.__hit(t))return!0;const i=this.__;if(i.__isHitPixel&&this.__hitPixel(t))return!0;const{hitFill:s}=i,n=(i.fill||i.__isCanvas)&&("path"===s||"pixel"===s&&!(i.__isAlphaPixelFill||i.__isCanvas))||"all"===s||e;if(n&&this.__hitFill(t))return!0;const{hitStroke:r,__maxStrokeWidth:o}=i,a=i.stroke&&("path"===r||"pixel"===r&&!i.__isAlphaPixelStroke)||"all"===r;if(!n&&!a)return!1;const h=2*t.radiusX;let l=h;if(a)switch(i.strokeAlign){case"inside":if(l+=2*o,!n&&this.__hitFill(t)&&this.__hitStroke(t,l))return!0;l=h;break;case"center":l+=o;break;case"outside":if(l+=2*o,!n){if(!this.__hitFill(t)&&this.__hitStroke(t,l))return!0;l=h}}return!!l&&this.__hitStroke(t,l)};const Vc=jl.prototype,qc=Kl.prototype,Gc=ed.prototype;qc.__updateHitCanvas=Gc.__updateHitCanvas=function(){this.stroke||this.cornerRadius||(this.fill||this.__.__isCanvas)&&"pixel"===this.hitFill||"all"===this.hitStroke?Vc.__updateHitCanvas.call(this):this.__hitCanvas&&(this.__hitCanvas=null)},qc.__hitFill=Gc.__hitFill=function(t){return this.__hitCanvas?Vc.__hitFill.call(this,t):jt.hitRadiusPoint(this.__layout.boxBounds,t)},Wd.prototype.__drawHitPath=function(t){const{__lineHeight:e,fontSize:i,__baseLine:s,__letterSpacing:n,__textDrawData:r}=this.__;t.beginPath(),n<0?this.__drawPathByBox(t):r.rows.forEach(n=>t.rect(n.x,n.y-s,n.width,e<i?i:e))},Hl.prototype.pick=function(t,e){return e||(e=n),this.updateLayout(),ee.getSelector(this).getByPoint(t,e.hitRadius||0,Object.assign(Object.assign({},e),{target:this}))};const Kc=Ae.prototype;Kc.hitFill=function(t,e){return e?this.context.isPointInPath(t.x,t.y,e):this.context.isPointInPath(t.x,t.y)},Kc.hitStroke=function(t,e){return this.strokeWidth=e,this.context.isPointInStroke(t.x,t.y)},Kc.hitPixel=function(t,e,i=1){let{x:s,y:n,radiusX:r,radiusY:o}=t;e&&(s-=e.x,n-=e.y),Kt.set(s-r,n-o,2*r,2*o).scale(i).ceil();const{data:a}=this.context.getImageData(Kt.x,Kt.y,Kt.width||1,Kt.height||1);for(let t=0,e=a.length;t<e;t+=4)if(a[t+3]>0)return!0;return a[3]>0};const $c={convert(t,e){const i=mc.getBase(t),{x:s,y:n}=e,r=Object.assign(Object.assign({},i),{x:s,y:n,width:t.width,height:t.height,pointerType:t.pointerType,pressure:t.pressure});return"pen"===r.pointerType&&(r.tangentialPressure=t.tangentialPressure,r.tiltX=t.tiltX,r.tiltY=t.tiltY,r.twist=t.twist),r},convertMouse(t,e){const i=mc.getBase(t),{x:s,y:n}=e;return Object.assign(Object.assign({},i),{x:s,y:n,width:1,height:1,pointerType:"mouse",pressure:.5})},convertTouch(t,e){const i=$c.getTouch(t),s=mc.getBase(t),{x:n,y:r}=e;return Object.assign(Object.assign({},s),{x:n,y:r,width:1,height:1,pointerType:"touch",multiTouch:t.touches.length>1,pressure:i.force})},getTouch:t=>t.targetTouches[0]||t.changedTouches[0]},Jc={convert(t){const e=mc.getBase(t);return Object.assign(Object.assign({},e),{code:t.code,key:t.key})}},{pathCanDrag:Qc}=mc;class Zc extends Dc{get notPointer(){const{p:t}=this;return"pointer"!==t.type||t.touch||this.useMultiTouch}get notTouch(){const{p:t}=this;return"mouse"===t.type||this.usePointer}get notMouse(){return this.usePointer||this.useTouch}__listenEvents(){super.__listenEvents();const t=this.view=this.canvas.view;this.viewEvents={pointerdown:this.onPointerDown,mousedown:this.onMouseDown,touchstart:this.onTouchStart,pointerleave:this.onPointerLeave,contextmenu:this.onContextMenu,wheel:this.onWheel,gesturestart:this.onGesturestart,gesturechange:this.onGesturechange,gestureend:this.onGestureend},this.windowEvents={pointermove:this.onPointerMove,pointerup:this.onPointerUp,pointercancel:this.onPointerCancel,mousemove:this.onMouseMove,mouseup:this.onMouseUp,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchCancel,keydown:this.onKeyDown,keyup:this.onKeyUp,scroll:this.onScroll};const{viewEvents:e,windowEvents:i}=this;for(let i in e)e[i]=e[i].bind(this),t.addEventListener(i,e[i]);for(let t in i)i[t]=i[t].bind(this),window.addEventListener(t,i[t])}__removeListenEvents(){super.__removeListenEvents();const{viewEvents:t,windowEvents:e}=this;for(let e in t)this.view.removeEventListener(e,t[e]),this.viewEvents={};for(let t in e)window.removeEventListener(t,e[t]),this.windowEvents={}}getTouches(t){const e=[];for(let i=0,s=t.length;i<s;i++)e.push(t[i]);return e}preventDefaultPointer(t){const{pointer:e}=this.config;e.preventDefault&&t.preventDefault()}preventDefaultWheel(t){const{wheel:e}=this.config;e.preventDefault&&t.preventDefault()}preventWindowPointer(t){return!this.downData&&t.target!==this.view}onKeyDown(t){this.keyDown(Jc.convert(t))}onKeyUp(t){this.keyUp(Jc.convert(t))}onContextMenu(t){this.config.pointer.preventDefaultMenu&&t.preventDefault(),this.menu($c.convert(t,this.getLocal(t)))}onScroll(){this.canvas.updateClientBounds()}onPointerDown(t){this.preventDefaultPointer(t),this.notPointer||(this.usePointer||(this.usePointer=!0),this.pointerDown($c.convert(t,this.getLocal(t))))}onPointerMove(t,e){if(this.notPointer||this.preventWindowPointer(t))return;this.usePointer||(this.usePointer=!0);const i=$c.convert(t,this.getLocal(t,!0));e?this.pointerHover(i):this.pointerMove(i)}onPointerLeave(t){this.onPointerMove(t,!0)}onPointerUp(t){this.downData&&this.preventDefaultPointer(t),this.notPointer||this.preventWindowPointer(t)||this.pointerUp($c.convert(t,this.getLocal(t)))}onPointerCancel(){this.useMultiTouch||this.pointerCancel()}onMouseDown(t){this.preventDefaultPointer(t),this.notMouse||this.pointerDown($c.convertMouse(t,this.getLocal(t)))}onMouseMove(t){this.notMouse||this.preventWindowPointer(t)||this.pointerMove($c.convertMouse(t,this.getLocal(t,!0)))}onMouseUp(t){this.downData&&this.preventDefaultPointer(t),this.notMouse||this.preventWindowPointer(t)||this.pointerUp($c.convertMouse(t,this.getLocal(t)))}onMouseCancel(){this.notMouse||this.pointerCancel()}onTouchStart(t){const e=$c.getTouch(t),i=this.getLocal(e,!0),{preventDefault:s}=this.config.touch;(!0===s||"auto"===s&&Qc(this.findPath(i)))&&t.preventDefault(),this.multiTouchStart(t),this.notTouch||(this.touchTimer&&(window.clearTimeout(this.touchTimer),this.touchTimer=0),this.useTouch=!0,this.pointerDown($c.convertTouch(t,i)))}onTouchMove(t){if(this.multiTouchMove(t),this.notTouch||this.preventWindowPointer(t))return;const e=$c.getTouch(t);this.pointerMove($c.convertTouch(t,this.getLocal(e)))}onTouchEnd(t){if(this.multiTouchEnd(),this.notTouch||this.preventWindowPointer(t))return;this.touchTimer&&clearTimeout(this.touchTimer),this.touchTimer=setTimeout(()=>{this.useTouch=!1},500);const e=$c.getTouch(t);this.pointerUp($c.convertTouch(t,this.getLocal(e)))}onTouchCancel(){this.notTouch||this.pointerCancel()}multiTouchStart(t){this.useMultiTouch=t.touches.length>1,this.touches=this.useMultiTouch?this.getTouches(t.touches):void 0,this.useMultiTouch&&this.pointerCancel()}multiTouchMove(t){if(this.useMultiTouch&&t.touches.length>1){const e=this.getTouches(t.touches),i=this.getKeepTouchList(this.touches,e);i.length>1&&(this.multiTouch(mc.getBase(t),i),this.touches=e)}}multiTouchEnd(){this.touches=null,this.useMultiTouch=!1,this.transformEnd()}getKeepTouchList(t,e){let i;const s=[];return t.forEach(t=>{i=e.find(e=>e.identifier===t.identifier),i&&s.push({from:this.getLocal(t),to:this.getLocal(i)})}),s}getLocalTouchs(t){return t.map(t=>this.getLocal(t))}onWheel(t){this.preventDefaultWheel(t),this.wheel(Object.assign(Object.assign(Object.assign({},mc.getBase(t)),this.getLocal(t)),{deltaX:t.deltaX,deltaY:t.deltaY}))}onGesturestart(t){this.useMultiTouch||(this.preventDefaultWheel(t),this.lastGestureScale=1,this.lastGestureRotation=0)}onGesturechange(t){if(this.useMultiTouch)return;this.preventDefaultWheel(t);const e=mc.getBase(t);Object.assign(e,this.getLocal(t));const i=t.scale/this.lastGestureScale,s=(t.rotation-this.lastGestureRotation)/Math.PI*180*(F.within(this.config.wheel.rotateSpeed,0,1)/4+.1);this.zoom(Object.assign(Object.assign({},e),{scale:i*i})),this.rotate(Object.assign(Object.assign({},e),{rotation:s})),this.lastGestureScale=t.scale,this.lastGestureRotation=t.rotation}onGestureend(t){this.useMultiTouch||(this.preventDefaultWheel(t),this.transformEnd())}setCursor(t){super.setCursor(t);const e=[];this.eachCursor(t,e),_(e[e.length-1])&&e.push("default"),this.canvas.view.style.cursor=e.map(t=>_(t)?`url(${t.url}) ${t.x||0} ${t.y||0}`:t).join(",")}eachCursor(t,e,i=0){if(i++,u(t))t.forEach(t=>this.eachCursor(t,e,i));else{const s=a(t)&&Mc.get(t);s&&i<2?this.eachCursor(s,e,i):e.push(t)}}destroy(){this.view&&(super.destroy(),this.view=null,this.touches=null)}}function tu(t,e,i){t.__.__font?rl.fillText(t,e,i):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function eu(t,e,i,s,n){const r=i.__;_(t)?rl.drawStrokesStyle(t,e,!1,i,s,n):(s.setStroke(t,r.__strokeWidth*e,r),s.stroke()),r.__useArrow&&rl.strokeArrow(t,i,s,n)}function iu(t,e,i,s,n){const r=i.__;_(t)?rl.drawStrokesStyle(t,e,!0,i,s,n):(s.setStroke(t,r.__strokeWidth*e,r),rl.drawTextStroke(i,s,n))}function su(t,e,i,s,n){const r=s.getSameCanvas(!0,!0);r.font=i.__.__font,iu(t,2,i,r,n),r.blendMode="outside"===e?"destination-out":"destination-in",rl.fillText(i,r,n),r.blendMode="normal",uo.copyCanvasByWorld(i,s,r),r.recycle(i.__nowWorld)}const{getSpread:nu,copyAndSpread:ru,toOuterOf:ou,getOuterOf:au,getByMove:hu,move:lu,getIntersectData:du}=jt,cu={};let uu;const{stintSet:_u}=f,{hasTransparent:pu}=il;function gu(t,e,i){if(!_(e)||!1===e.visible||0===e.opacity)return;let s;const{boxBounds:n}=i.__layout,{type:o}=e;switch(o){case"image":case"film":case"video":if(!e.url)return;s=ol.image(i,t,e,n,!uu||!uu[e.url]),"image"!==o&&ol[o](s);break;case"linear":s=al.linearGradient(e,n);break;case"radial":s=al.radialGradient(e,n);break;case"angular":s=al.conicGradient(e,n);break;case"solid":const{color:a,opacity:h}=e;s={type:o,style:il.string(a,h)};break;default:r(e.r)||(s={type:"solid",style:il.string(e)})}if(s&&(s.originPaint=e,a(s.style)&&pu(s.style)&&(s.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;s.strokeStyle=e.style}return s}const fu={compute:function(t,e){const i=e.__,s=[];let n,r,o,a=i.__input[t];u(a)||(a=[a]),uu=ol.recycleImage(t,i);for(let i,n=0,r=a.length;n<r;n++)(i=gu(t,a[n],e))&&(s.push(i),i.strokeStyle&&(o||(o=1),i.strokeStyle.strokeWidth&&(o=Math.max(o,i.strokeStyle.strokeWidth))));i["_"+t]=s.length?s:void 0,s.length?(s.every(t=>t.isTransparent)&&(s.some(t=>t.image)&&(n=!0),r=!0),"fill"===t?(_u(i,"__isAlphaPixelFill",n),_u(i,"__isTransparentFill",r)):(_u(i,"__isAlphaPixelStroke",n),_u(i,"__isTransparentStroke",r),_u(i,"__hasMultiStrokeStyle",o))):i.__removePaint(t,!1)},fill:function(t,e,i,s){i.fillStyle=t,tu(e,i,s)},fills:function(t,e,i,s){let n,r,o;for(let a=0,h=t.length;a<h;a++){if(n=t[a],r=n.originPaint,n.image){if(o?o++:o=1,ol.checkImage(n,!e.__.__font,e,i,s))continue;if(!n.style){1===o&&n.image.isPlacehold&&e.drawImagePlaceholder(n,i,s);continue}}if(i.fillStyle=n.style,n.transform||r.scaleFixed){if(i.save(),n.transform&&i.transform(n.transform),r.scaleFixed){const{scaleX:t,scaleY:s}=e.getRenderScaleData(!0);(!0===r.scaleFixed||"zoom-in"===r.scaleFixed&&t>1&&s>1)&&i.scale(1/t,1/s)}r.blendMode&&(i.blendMode=r.blendMode),tu(e,i,s),i.restore()}else r.blendMode?(i.saveBlendMode(r.blendMode),tu(e,i,s),i.restoreBlendMode()):tu(e,i,s)}},fillPathOrText:tu,fillText:function(t,e,i){const s=t.__,{rows:n,decorationY:r}=s.__textDrawData;let o;s.__isPlacehold&&s.placeholderColor&&(e.fillStyle=s.placeholderColor);for(let t=0,i=n.length;t<i;t++)o=n[t],o.text?e.fillText(o.text,o.x,o.y):o.data&&o.data.forEach(t=>{e.fillText(t.char,t.x,o.y)});if(r){const{decorationColor:t,decorationHeight:i}=s.__textDrawData;t&&(e.fillStyle=t),n.forEach(t=>r.forEach(s=>e.fillRect(t.x,t.y+s,t.width,i)))}},stroke:function(t,e,i,s){const n=e.__;if(n.__strokeWidth)if(n.__font)rl.strokeText(t,e,i,s);else switch(n.strokeAlign){case"center":eu(t,1,e,i,s);break;case"inside":!function(t,e,i,s){i.save(),i.clipUI(e),eu(t,2,e,i,s),i.restore()}(t,e,i,s);break;case"outside":!function(t,e,i,s){const n=e.__;if(n.__fillAfterStroke)eu(t,2,e,i,s);else{const{renderBounds:r}=e.__layout,o=i.getSameCanvas(!0,!0);e.__drawRenderPath(o),eu(t,2,e,o,s),o.clipUI(n),o.clearWorld(r),uo.copyCanvasByWorld(e,i,o),o.recycle(e.__nowWorld)}}(t,e,i,s)}},strokes:function(t,e,i,s){rl.stroke(t,e,i,s)},strokeText:function(t,e,i,s){switch(e.__.strokeAlign){case"center":iu(t,1,e,i,s);break;case"inside":su(t,"inside",e,i,s);break;case"outside":e.__.__fillAfterStroke?iu(t,2,e,i,s):su(t,"outside",e,i,s)}},drawTextStroke:function(t,e,i){let s,n=t.__.__textDrawData;const{rows:r,decorationY:o}=n;for(let t=0,i=r.length;t<i;t++)s=r[t],s.text?e.strokeText(s.text,s.x,s.y):s.data&&s.data.forEach(t=>{e.strokeText(t.char,t.x,s.y)});if(o){const{decorationHeight:t}=n;r.forEach(i=>o.forEach(s=>e.strokeRect(i.x,i.y+s,i.width,t)))}},drawStrokesStyle:function(t,e,i,s,n,r){let o;const a=s.__,{__hasMultiStrokeStyle:h}=a;h||n.setStroke(void 0,a.__strokeWidth*e,a);for(let l=0,d=t.length;l<d;l++)if(o=t[l],(!o.image||!ol.checkImage(o,!1,s,n,r))&&o.style){if(h){const{strokeStyle:t}=o;t?n.setStroke(o.style,a.__getRealStrokeWidth(t)*e,a,t):n.setStroke(o.style,a.__strokeWidth*e,a)}else n.strokeStyle=o.style;o.originPaint.blendMode?(n.saveBlendMode(o.originPaint.blendMode),i?rl.drawTextStroke(s,n,r):n.stroke(),n.restoreBlendMode()):i?rl.drawTextStroke(s,n,r):n.stroke()}},shape:function(t,e,i){const s=e.getSameCanvas(),n=e.bounds,r=t.__nowWorld,o=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,d,c,u,_;ou(o.strokeSpread?(ru(cu,o.boxBounds,o.strokeSpread),cu):o.boxBounds,r,a);let{scaleX:p,scaleY:g}=t.getRenderScaleData(!0);if(n.includes(a))_=s,h=u=a,l=r;else{let s;if(ee.fullImageShadow)s=a;else{const t=o.renderShapeSpread?nu(n,P.swapAndScale(o.renderShapeSpread,p,g)):n;s=du(t,a)}c=n.getFitMatrix(s);let{a:f,d:y}=c;c.a<1&&(_=e.getSameCanvas(),t.__renderShape(_,i),p*=f,g*=y),u=au(a,c),h=hu(u,-c.e,-c.f),l=au(r,c),lu(l,-c.e,-c.f);const m=i.matrix;m?(d=new yt(c),d.multiply(m),f*=m.scaleX,y*=m.scaleY):d=c,d.withScale(f,y),i=Object.assign(Object.assign({},i),{matrix:d})}return t.__renderShape(s,i),{canvas:s,matrix:d,fitMatrix:c,bounds:h,renderBounds:l,worldCanvas:_,shapeBounds:u,scaleX:p,scaleY:g}}};let yu,mu=new Gt;const{isSame:vu}=jt;function wu(t,e,i,s,n,r){const o=t.__;if("fill"===e&&!o.__naturalWidth&&(o.__naturalWidth=s.width/o.pixelRatio,o.__naturalHeight=s.height/o.pixelRatio,o.__autoSide))return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",o.width),t.setProxyAttr("height",o.height)),!1;if(!n.data){ol.createData(n,s,i,r);const{transform:t}=n.data,{opacity:e,blendMode:a}=i,h=t&&!t.onlyScale||o.path||o.cornerRadius;(h||e&&e<1||a)&&(n.complex=!h||2)}return!0}function xu(t,e){ku(t,Vo.LOAD,e)}function bu(t,e){ku(t,Vo.LOADED,e)}function Su(t,e,i){e.error=i,t.forceUpdate("surface"),ku(t,Vo.ERROR,e)}function ku(t,e,i){t.hasEvent(e)&&t.emitEvent(new Vo(e,i))}function Bu(t,e){const{leafer:i}=t;i&&i.viewReady&&(i.renderer.ignore=e)}const{get:Pu,translate:Tu}=J,Eu=new Gt,Ru={},Cu={};function Lu(t,e,i,s){const n=a(t)||s?(s?i-s*e:i%e)/((s||Math.floor(i/e))-1):t;return"auto"===t&&n<0?0:n}let Ou={},Au={a:1,b:0,c:0,d:1,e:0,f:0};const{get:Du,set:Mu,rotateOfOuter:Fu,translate:Iu,scaleOfOuter:Wu,multiplyParent:Nu,scale:zu,rotate:Yu,skew:Xu}=J;function Uu(t,e,i,s,n,r,o,a){o&&Yu(t,o),a&&Xu(t,a.x,a.y),n&&zu(t,n,r),Iu(t,e.x+i,e.y+s)}const{get:ju,scale:Hu,copy:Vu}=J,{getFloorScale:qu}=F,{abs:Gu}=Math;const Ku={image:function(t,e,i,s,n){let r,o;const a=sr.get(i,i.type);return yu&&i===yu.paint&&vu(s,yu.boxBounds)?r=yu.leafPaint:(r={type:i.type,image:a},a.hasAlphaPixel&&(r.isTransparent=!0),yu=a.use>1?{leafPaint:r,paint:i,boxBounds:mu.set(s)}:null),(n||a.loading)&&(o={image:a,attrName:e,attrValue:i}),a.ready?(wu(t,e,i,a,r,s),n&&(xu(t,o),bu(t,o))):a.error?n&&Su(t,o,a.error):(n&&(Bu(t,!0),xu(t,o)),r.loadId=a.load(()=>{Bu(t,!1),t.destroyed||(wu(t,e,i,a,r,s)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),bu(t,o)),r.loadId=void 0},e=>{Bu(t,!1),Su(t,o,e),r.loadId=void 0},i.lod&&a.getThumbSize(i.lod)),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),r},checkImage:function(t,e,i,s,n){const{scaleX:r,scaleY:o}=ol.getImageRenderScaleData(t,i,s,n),a=t.film?t.nowIndex:r+"-"+o,{image:h,data:l,originPaint:d}=t,{exporting:c,snapshot:u}=n;return!(!l||t.patternId===a&&!c||u)&&(e&&(l.repeat?e=!1:d.changeful||t.film||"miniapp"===ee.name&&Zo.isResizing(i)||c||(e=ee.image.isLarge(h,r,o)||h.width*r>8096||h.height*o>8096)),e?(i.__.__isFastShadow&&(s.fillStyle=t.style||"#000",s.fill()),ol.drawImage(t,r,o,i,s,n),!0):(!t.style||d.sync||c?ol.createPattern(t,i,s,n):ol.createPatternTask(t,i,s,n),!1))},drawImage:function(t,e,i,s,n,r){const{data:o,image:a,complex:h}=t;let{width:l,height:d}=a;if(h){const{blendMode:r,opacity:c}=t.originPaint,{transform:u}=o;n.save(),2===h&&n.clipUI(s),r&&(n.blendMode=r),c&&(n.opacity*=c),u&&n.transform(u),a.render(n,0,0,l,d,s,t,e,i),n.restore()}else o.scaleX&&(l*=o.scaleX,d*=o.scaleY),a.render(n,0,0,l,d,s,t,e,i)},getImageRenderScaleData:function(t,e,i,s){const n=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:r}=t;if(i){const{pixelRatio:t}=i;n.scaleX*=t,n.scaleY*=t}return r&&r.scaleX&&(n.scaleX*=Math.abs(r.scaleX),n.scaleY*=Math.abs(r.scaleY)),n},recycleImage:function(t,e){const i=e["_"+t];if(u(i)){let s,n,r,o,a;for(let h=0,l=i.length;h<l;h++)s=i[h],n=s.image,a=n&&n.url,a&&(r||(r={}),r[a]=!0,sr.recyclePaint(s),n.loading&&(o||(o=e.__input&&e.__input[t]||[],u(o)||(o=[o])),n.unload(i[h].loadId,!o.some(t=>t.url===a))));return r}return null},createPatternTask:function(t,e,i,n){t.patternTask||(t.patternTask=sr.patternTasker.add(()=>s(this,void 0,void 0,function*(){ol.createPattern(t,e,i,n),e.forceUpdate("surface")}),0,()=>(t.patternTask=null,i.bounds.hit(e.__nowWorld))))},createPattern:function(t,e,i,s){let{scaleX:n,scaleY:r}=ol.getImageRenderScaleData(t,e,i,s),o=t.film?t.nowIndex:n+"-"+r;if(t.patternId!==o&&!e.destroyed&&(!ee.image.isLarge(t.image,n,r)||t.data.repeat)){const{image:i,data:s}=t,{opacity:a,filters:h}=t.originPaint,{transform:l,gap:d}=s,c=ol.getPatternFixScale(t,n,r);let u,_,p,{width:g,height:f}=i;c&&(n*=c,r*=c),g*=n,f*=r,d&&(_=d.x*n/Gu(s.scaleX||1),p=d.y*r/Gu(s.scaleY||1)),(l||1!==n||1!==r)&&(n*=qu(g+(_||0)),r*=qu(f+(p||0)),u=ju(),l&&Vu(u,l),Hu(u,1/n,1/r));const y=i.getCanvas(g,f,a,h,_,p,e.leafer&&e.leafer.config.smooth,s.interlace),m=i.getPattern(y,s.repeat||ee.origin.noRepeat||"no-repeat",u,t);t.style=m,t.patternId=o}},getPatternFixScale:function(t,e,i){const{image:s}=t;let n,r=ee.image.maxPatternSize,o=s.width*s.height;return s.isSVG?e>1&&(n=Math.ceil(e)/e):r>o&&(r=o),(o*=e*i)>r&&(n=Math.sqrt(r/o)),n},createData:function(t,e,i,s){t.data=ol.getPatternData(i,s,e)},getPatternData:function(t,e,i){t.padding&&(e=Eu.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:s,height:n}=i,{mode:r,align:o,offset:h,scale:d,size:c,rotation:u,skew:p,clipSize:g,repeat:f,gap:y,interlace:m}=t,v=e.width===s&&e.height===n,w={mode:r},x="center"!==o&&(u||0)%180==90;let b,S;switch(jt.set(Cu,0,0,x?n:s,x?s:n),r&&"cover"!==r&&"fit"!==r?((d||c)&&(F.getScaleData(d,c,i,Ru),b=Ru.scaleX,S=Ru.scaleY),(o||y||f)&&(b&&jt.scale(Cu,b,S,!0),o&&Tt.toPoint(o,Cu,e,Cu,!0,!0))):v&&!u||(b=S=jt.getFitScale(e,Cu,"fit"!==r),jt.put(e,i,o,b,!1,Cu),jt.scale(Cu,b,S,!0)),h&&lt.move(Cu,h),r){case"stretch":v?b&&(b=S=void 0):(b=e.width/s,S=e.height/n,ol.stretchMode(w,e,b,S));break;case"normal":case"clip":if(Cu.x||Cu.y||b||g||u||p){let t,i;g&&(t=e.width/g.width,i=e.height/g.height),ol.clipMode(w,e,Cu.x,Cu.y,b,S,u,p,t,i),t&&(b=b?b*t:t,S=S?S*i:i)}break;case"repeat":(!v||b||u||p)&&ol.repeatMode(w,e,s,n,Cu.x,Cu.y,b,S,u,p,o,t.freeTransform),f||(w.repeat="repeat");const i=_(f);(y||i)&&(w.gap=function(t,e,i,s,n){let r,o;_(t)?(r=t.x,o=t.y):r=o=t;return{x:Lu(r,i,n.width,e&&e.x),y:Lu(o,s,n.height,e&&e.y)}}(y,i&&f,Cu.width,Cu.height,e));break;default:b&&ol.fillOrFitMode(w,e,Cu.x,Cu.y,b,S,u)}return w.transform||(e.x||e.y)&&Tu(w.transform=Pu(),e.x,e.y),b&&(w.scaleX=b,w.scaleY=S),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,i,s){const n=Du(),{x:r,y:o}=e;r||o?Iu(n,r,o):i>0&&s>0&&(n.onlyScale=!0),zu(n,i,s),t.transform=n},fillOrFitMode:function(t,e,i,s,n,r,o){const a=Du();Iu(a,e.x+i,e.y+s),zu(a,n,r),o&&Fu(a,{x:e.x+e.width/2,y:e.y+e.height/2},o),t.transform=a},clipMode:function(t,e,i,s,n,r,o,a,h,l){const d=Du();Uu(d,e,i,s,n,r,o,a),h&&(o||a?(Mu(Au),Wu(Au,e,h,l),Nu(d,Au)):Wu(d,e,h,l)),t.transform=d},repeatMode:function(t,e,i,s,n,r,o,a,h,l,d,c){const u=Du();if(c)Uu(u,e,n,r,o,a,h,l);else{if(h)if("center"===d)Fu(u,{x:i/2,y:s/2},h);else switch(Yu(u,h),h){case 90:Iu(u,s,0);break;case 180:Iu(u,i,s);break;case 270:Iu(u,0,i)}Ou.x=e.x+n,Ou.y=e.y+r,Iu(u,Ou.x,Ou.y),o&&Wu(u,Ou,o,a)}t.transform=u}},{toPoint:$u}=kt,{hasTransparent:Ju}=il,Qu={},Zu={};function t_(t,e,i,s){if(i){let n,r,o,h;for(let t=0,l=i.length;t<l;t++)n=i[t],a(n)?(o=t/(l-1),r=il.string(n,s)):(o=n.offset,r=il.string(n.color,s)),e.addColorStop(o,r),!h&&Ju(r)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:e_,getDistance:i_}=lt,{get:s_,rotateOfOuter:n_,scaleOfOuter:r_}=J,{toPoint:o_}=kt,a_={},h_={};function l_(t,e,i,s,n){let r;const{width:o,height:a}=t;if(o!==a||s){const t=e_(e,i);r=s_(),n?(r_(r,e,o/a*(s||1),1),n_(r,e,t+90)):(r_(r,e,1,o/a*(s||1)),n_(r,e,t))}return r}const{getDistance:d_}=lt,{toPoint:c_}=kt,u_={},__={};const p_={linearGradient:function(t,e){let{from:i,to:s,type:n,opacity:r}=t;$u(i||"top",e,Qu),$u(s||"bottom",e,Zu);const o=ee.canvas.createLinearGradient(Qu.x,Qu.y,Zu.x,Zu.y),a={type:n,style:o};return t_(a,o,t.stops,r),a},radialGradient:function(t,e){let{from:i,to:s,type:n,opacity:r,stretch:o}=t;o_(i||"center",e,a_),o_(s||"bottom",e,h_);const a=ee.canvas.createRadialGradient(a_.x,a_.y,0,a_.x,a_.y,i_(a_,h_)),h={type:n,style:a};t_(h,a,t.stops,r);const l=l_(e,a_,h_,o,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:i,to:s,type:n,opacity:r,stretch:o}=t;c_(i||"center",e,u_),c_(s||"bottom",e,__);const a=ee.conicGradientSupport?ee.canvas.createConicGradient(0,u_.x,u_.y):ee.canvas.createRadialGradient(u_.x,u_.y,0,u_.x,u_.y,d_(u_,__)),h={type:n,style:a};t_(h,a,t.stops,r);const l=l_(e,u_,__,o||1,ee.conicGradientRotate90);return l&&(h.transform=l),h},getTransform:l_},{copy:g_,move:f_,toOffsetOutBounds:y_}=jt,{max:m_,abs:v_}=Math,w_={},x_=new yt,b_={};function S_(t,e){let i,s,n,r,o=0,a=0,h=0,l=0;return e.forEach(t=>{i=t.x||0,s=t.y||0,r=1.5*(t.blur||0),n=v_(t.spread||0),o=m_(o,n+r-s),a=m_(a,n+r+i),h=m_(h,n+r+s),l=m_(l,n+r-i)}),o===a&&a===h&&h===l?o:[o,a,h,l]}function k_(t,e,i){const{shapeBounds:s}=i;let n,r;ee.fullImageShadow?(g_(w_,t.bounds),f_(w_,e.x-s.x,e.y-s.y),n=t.bounds,r=w_):(n=s,r=e),t.copyWorld(i.canvas,n,r)}const{toOffsetOutBounds:B_}=jt,P_={};const T_=S_;const E_={shadow:function(t,e,i){let s,n;const{__nowWorld:r}=t,{shadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=i,_=e.getSameCanvas(),p=o.length-1;y_(h,b_,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(r.scaleX);t>1&&(f=1/t)}_.setWorldShadow(b_.offsetX+(o.x||0)*c*f,b_.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f,il.string(o.color)),n=hl.getShadowTransform(t,_,i,o,b_,f),n&&_.setTransform(n),k_(_,b_,i),n&&_.resetTransform(),s=l,o.box&&(_.restore(),_.save(),a&&(_.copyWorld(_,l,r,"copy"),s=r),a?_.copyWorld(a,r,r,"destination-out"):_.copyWorld(i.canvas,d,h,"destination-out")),uo.copyCanvasByWorld(t,e,_,s,o.blendMode),p&&g<p&&_.clearWorld(s)}),_.recycle(s)},innerShadow:function(t,e,i){let s,n;const{__nowWorld:r}=t,{innerShadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=i,_=e.getSameCanvas(),p=o.length-1;B_(h,P_,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(r.scaleX);t>1&&(f=1/t)}_.save(),_.setWorldShadow(P_.offsetX+(o.x||0)*c*f,P_.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f),n=hl.getShadowTransform(t,_,i,o,P_,f,!0),n&&_.setTransform(n),k_(_,P_,i),_.restore(),a?(_.copyWorld(_,l,r,"copy"),_.copyWorld(a,r,r,"source-out"),s=r):(_.copyWorld(i.canvas,d,h,"source-out"),s=l),_.fillWorld(s,il.string(o.color),"source-in"),uo.copyCanvasByWorld(t,e,_,s,o.blendMode),p&&g<p&&_.clearWorld(s)}),_.recycle(s)},blur:function(t,e,i){const{blur:s}=t.__;i.setWorldBlur(s*t.__nowWorld.a),i.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),i.filter="none"},backgroundBlur:function(t,e,i){},getShadowRenderSpread:S_,getShadowTransform:function(t,e,i,s,n,r,o){if(s.spread){const i=2*s.spread*r*(o?-1:1),{width:a,height:h}=t.__layout.strokeBounds;return x_.set().scaleOfOuter({x:(n.x+n.width/2)*e.pixelRatio,y:(n.y+n.height/2)*e.pixelRatio},1+i/a,1+i/h),x_}},isTransformShadow(t){},getInnerShadowSpread:T_},{excludeRenderBounds:R_}=wo;let C_;function L_(t,e,i,s,n,r,o,a){switch(e){case"grayscale":C_||(C_=!0,n.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,i,s,n,r){const o=t.__nowWorld;i.resetTransform(),i.opacity=1,i.useMask(s,o),r&&s.recycle(o);A_(t,e,i,1,n,r)}(t,i,s,n,o,a);break;case"opacity-path":A_(t,i,s,r,o,a);break;case"path":a&&i.restore()}}function O_(t){return t.getSameCanvas(!1,!0)}function A_(t,e,i,s,n,r){const o=t.__nowWorld;e.resetTransform(),e.opacity=s,e.copyWorld(i,o,void 0,n),r?i.recycle(o):i.clearWorld(o)}Hl.prototype.__renderMask=function(t,e){let i,s,n,r,o,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(i=h[l],a=i.__.mask,a){o&&(L_(this,o,t,n,s,r,void 0,!0),s=n=null),"clipping"!==a&&"clipping-path"!==a||R_(i,e)||i.__render(t,e),r=i.__.opacity,C_=!1,"path"===a||"clipping-path"===a?(r<1?(o="opacity-path",n||(n=O_(t))):(o="path",t.save()),i.__clip(n||t,e)):(o="grayscale"===a?"grayscale":"alpha",s||(s=O_(t)),n||(n=O_(t)),i.__render(s,e));continue}const d=1===r&&i.__.__blendMode;d&&L_(this,o,t,n,s,r,void 0,!1),R_(i,e)||i.__render(n||t,e),d&&L_(this,o,t,n,s,r,d,!1)}L_(this,o,t,n,s,r,void 0,!0)};const D_=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",M_=D_+"_#~&*+\\=|≮≯≈≠=…",F_=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],[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("|"));function I_(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const W_=I_("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),N_=I_("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),z_=I_(D_),Y_=I_(M_),X_=I_("- —/~|┆·");var U_;!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"}(U_||(U_={}));const{Letter:j_,Single:H_,Before:V_,After:q_,Symbol:G_,Break:K_}=U_;function $_(t){return W_[t]?j_:X_[t]?K_:N_[t]?V_:z_[t]?q_:Y_[t]?G_:F_.test(t)?H_:j_}const J_={trimRight(t){const{words:e}=t;let i,s=0,n=e.length;for(let r=n-1;r>-1&&(i=e[r].data[0]," "===i.char);r--)s++,t.width-=i.width;s&&e.splice(n-s,s)}};function Q_(t,e,i){switch(e){case"title":return i?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:Z_}=J_,{Letter:tp,Single:ep,Before:ip,After:sp,Symbol:np,Break:rp}=U_;let op,ap,hp,lp,dp,cp,up,_p,pp,gp,fp,yp,mp,vp,wp,xp,bp,Sp=[];function kp(t,e){pp&&!_p&&(_p=pp),op.data.push({char:t,width:e}),hp+=e}function Bp(){lp+=hp,op.width=hp,ap.words.push(op),op={data:[]},hp=0}function Pp(){vp&&(wp.paraNumber++,ap.paraStart=!0,vp=!1),pp&&(ap.startCharSize=_p,ap.endCharSize=pp,_p=0),ap.width=lp,xp.width?Z_(ap):bp&&Tp(),Sp.push(ap),ap={words:[]},lp=0}function Tp(){lp>(wp.maxWidth||0)&&(wp.maxWidth=lp)}const{top:Ep,right:Rp,bottom:Cp,left:Lp}=xt;function Op(t,e,i){const{bounds:s,rows:n}=t;s[e]+=i;for(let t=0;t<n.length;t++)n[t][e]+=i}const Ap={getDrawData:function(t,e){a(t)||(t=String(t));let i=0,s=0,n=e.__getInput("width")||0,r=e.__getInput("height")||0;const{__padding:o}=e;o&&(n?(i=o[Lp],n-=o[Rp]+o[Lp],!n&&(n=.01)):e.autoSizeAlign||(i=o[Lp]),r?(s=o[Ep],r-=o[Ep]+o[Cp],!r&&(r=.01)):e.autoSizeAlign||(s=o[Ep]));const h={bounds:{x:i,y:s,width:n,height:r},rows:[],paraNumber:0,font:ee.canvas.font=e.__font};return function(t,e,i){wp=t,Sp=t.rows,xp=t.bounds,bp=!xp.width&&!i.autoSizeAlign;const{__letterSpacing:s,paraIndent:n,textCase:r}=i,{canvas:o}=ee,{width:a}=xp;if(i.__isCharMode){const t="none"!==i.textWrap,h="break"===i.textWrap;vp=!0,fp=null,_p=up=pp=hp=lp=0,op={data:[]},ap={words:[]},s&&(e=[...e]);for(let i=0,l=e.length;i<l;i++)cp=e[i],"\n"===cp?(hp&&Bp(),ap.paraEnd=!0,Pp(),vp=!0):(gp=$_(cp),gp===tp&&"none"!==r&&(cp=Q_(cp,r,!hp)),up=o.measureText(cp).width,s&&(s<0&&(pp=up),up+=s),yp=gp===ep&&(fp===ep||fp===tp)||fp===ep&&gp!==sp,mp=!(gp!==ip&&gp!==ep||fp!==np&&fp!==sp),dp=vp&&n?a-n:a,t&&a&&lp+hp+up>dp&&(h?(hp&&Bp(),lp&&Pp()):(mp||(mp=gp===tp&&fp==sp),yp||mp||gp===rp||gp===ip||gp===ep||hp+up>dp?(hp&&Bp(),lp&&Pp()):lp&&Pp()))," "===cp&&!0!==vp&&lp+hp===0||(gp===rp?(" "===cp&&hp&&Bp(),kp(cp,up),Bp()):yp||mp?(hp&&Bp(),kp(cp,up)):kp(cp,up)),fp=gp);hp&&Bp(),lp&&Pp(),Sp.length>0&&(Sp[Sp.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{wp.paraNumber++,lp=o.measureText(t).width,Sp.push({x:n||0,text:t,width:lp,paraStart:!0}),bp&&Tp()})}(h,t,e),o&&function(t,e,i,s,n){if(!s&&i.autoSizeAlign)switch(i.textAlign){case"left":Op(e,"x",t[Lp]);break;case"right":Op(e,"x",-t[Rp])}if(!n&&i.autoSizeAlign)switch(i.verticalAlign){case"top":Op(e,"y",t[Ep]);break;case"bottom":Op(e,"y",-t[Cp])}}(o,h,e,n,r),function(t,e){const{rows:i,bounds:s}=t,n=i.length,{__lineHeight:r,__baseLine:o,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:g,height:f}=s,y=r*n+(c?c*(t.paraNumber-1):0),m=o;if(h&&y>f)y=Math.max(e.__autoHeight?y:f,r),n>1&&(t.overflow=n);else if(f||u)switch(d){case"middle":p+=(f-y)/2;break;case"bottom":p+=f-y}m+=p;let v,w,x,b=g||u?g:t.maxWidth;for(let o=0,d=n;o<d;o++){if(v=i[o],v.x=_,v.width<g||v.width>g&&!h)switch(l){case"center":v.x+=(b-v.width)/2;break;case"right":v.x+=b-v.width}v.paraStart&&c&&o>0&&(m+=c),v.y=m,m+=r,t.overflow>o&&m>y&&(v.isOverflow=!0,t.overflow=o+1),w=v.x,x=v.width,a<0&&(v.width<0?(x=-v.width+e.fontSize+a,w-=x,x+=e.fontSize):x-=a),w<s.x&&(s.x=w),x>s.width&&(s.width=x),h&&g&&g<x&&(v.isOverflow=!0,t.overflow||(t.overflow=i.length))}s.y=p,s.height=y}(h,e),e.__isCharMode&&function(t,e,i){const{rows:s}=t,{textAlign:n,paraIndent:r,__letterSpacing:o}=e,a=i&&n.includes("both"),h=a||i&&n.includes("justify"),l=h&&n.includes("letter");let d,c,u,_,p,g,f,y,m,v;s.forEach(t=>{t.words&&(p=r&&t.paraStart?r:0,y=t.words.length,h&&(v=!t.paraEnd||a,c=i-t.width-p,l?_=c/(t.words.reduce((t,e)=>t+e.data.length,0)-1):u=y>1?c/(y-1):0),g=o||t.isOverflow||l?0:u?1:2,t.isOverflow&&!o&&(t.textMode=!0),2===g?(t.x+=p,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=p,d=t.x,t.data=[],t.words.forEach((e,i)=>{1===g?(f={char:"",x:d},d=function(t,e,i){return t.forEach(t=>{i.char+=t.char,e+=t.width}),e}(e.data,d,f),(t.isOverflow||" "!==f.char)&&t.data.push(f)):d=function(t,e,i,s,n){return t.forEach(t=>{(s||" "!==t.char)&&(t.x=e,i.push(t)),e+=t.width,n&&(e+=n)}),e}(e.data,d,t.data,t.isOverflow,v&&_),v&&(m=i===y-1,u?m||(d+=u,t.width+=u):_&&(t.width+=_*(e.data.length-(m?1:0))))})),t.words=null)})}(h,e,n),h.overflow&&function(t,e,i,s){const{rows:n,overflow:r}=t;let{textOverflow:o}=e;if(r&&n.splice(r),s&&o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const h=o?ee.canvas.measureText(o).width:0,l=i+s-h;("none"===e.textWrap?n:[n[r-1]]).forEach(e=>{if(e.isOverflow&&e.data){let i=e.data.length-1;for(let s=i;s>-1&&(t=e.data[s],a=t.x+t.width,!(s===i&&a<l));s--){if(a<l&&" "!==t.char||!s){e.data.splice(s+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,i,n),"none"!==e.textDecoration&&function(t,e){let i,s=0;const{fontSize:n,textDecoration:r}=e;switch(t.decorationHeight=n/11,_(r)?(i=r.type,r.color&&(t.decorationColor=il.string(r.color)),r.offset&&(s=Math.min(.3*n,Math.max(r.offset,.15*-n)))):i=r,i){case"under":t.decorationY=[.15*n+s];break;case"delete":t.decorationY=[.35*-n];break;case"under-delete":t.decorationY=[.15*n+s,.35*-n]}}(h,e),h}};const Dp={string:function(t,e){if(!t)return"#000";const i=l(e)&&e<1;if(a(t)){if(!i||!il.object)return t;t=il.object(t)}let s=r(t.a)?1:t.a;i&&(s*=e);const n=t.r+","+t.g+","+t.b;return 1===s?"rgb("+n+")":"rgba("+n+","+s+")"}};Object.assign(el,Ap),Object.assign(il,Dp),Object.assign(rl,fu),Object.assign(ol,Ku),Object.assign(al,p_),Object.assign(hl,E_),Object.assign(ue,{interaction:(t,e,i,s)=>new Zc(t,e,i,s),hitCanvas:(t,e)=>new Rh(t,e),hitCanvasManager:()=>new Fc}),Ch();class Mp extends vl{get __drawAfterFill(){return!0}setRobot(t){this._robot=t,this.__leaf.__updateRobot()}setAction(t){this._action=t,this.__leaf.__updateAction()}}let Fp=class extends jl{get __tag(){return"Robot"}get nowFrame(){return this.robotFrames&&this.robotFrames[this.now]}constructor(t){super(t)}togglePlay(){this.running?this.pause():this.play()}play(){this.running=!0}pause(){this.running=!1}stop(){this.pause()}__updateRobot(){const{robot:t}=this;if(this.robotFrames=[],!t)return;let e=0;u(t)?t.forEach(t=>this.__loadRobot(t,e,e+=t.total||1)):this.__loadRobot(t,0,t.total)}__updateAction(){const t=this.actions[this.action];if(this.stop(),this.__timer&&clearTimeout(this.__timer),!r(t))if(l(t))this.now=t;else if(_(t)){const e=u(t),i=e?t:t.keyframes;this.__action=e?void 0:t;const{length:s}=i;if(s>1){const t=this.now=i[0],e=i[i.length-1];this.play(),this.__runAction(t,e)}else s&&(this.now=i[0])}}__loadRobot(t,e,i){for(let t=e;t<i;t++)this.robotFrames.push(void 0);const s=sr.get(t);s.ready?this.__createFrames(s,t,e,i):s.load(()=>this.__createFrames(s,t,e,i))}__createFrames(t,e,i,s){const{offset:n,size:r,total:o}=e,{width:a,height:h}=r&&(l(r)?{width:r,height:r}:r)||(o>1?this:t);let d=n?n.x:0,c=n?n.y:0;for(let e=i;e<s;e++)this.robotFrames[e]={view:t.view,x:d,y:c,width:a,height:h},d+a>=t.width?(d=0,c+=h):d+=a;this.__updateRobotBounds(),this.forceRender(),this.emitEvent(new Vo(Vo.LOADED,{image:t}))}__runAction(t,e){let{FPS:i,loop:s,__action:n}=this;n&&(n.FPS&&(i=n.FPS),r(n.loop)||(s=n.loop)),this.__timer=setTimeout(()=>{if(this.running){if(this.now===e){if(!s)return this.stop();this.now=t}else this.now++;this.__updateRobotBounds()}this.__runAction(t,e)},1e3/i)}__updateRobotBounds(){const{nowFrame:t}=this;if(t){const e=this.__,i=t.width/e.pixelRatio,s=t.height/e.pixelRatio;e.width===i&&e.height===s||this.forceUpdate("width"),e.__naturalWidth=i,e.__naturalHeight=s}}__drawContent(t,e){const{nowFrame:i}=this,{width:s,height:n}=this.__;i&&t.drawImage(i.view,i.x,i.y,i.width,i.height,0,0,s,n)}destroy(){this.robotFrames&&(this.robotFrames=null),super.destroy()}};function Ip(t,e){return _r(t,t=>({set(i){this.__setAttr(t,i),this.leaferIsReady?e?cl.setStyleName(this,e,i):cl.set(this,i):this.__layout.stateStyleChanged=!0}}))}function Wp(t){return _r(t,t=>({set(e){this.__setAttr(t,e),this.__layout.stateStyleChanged=!0}}))}function Np(t,e){if(e&&!0!==e)return e;if(!t.button){let{parent:e}=t;for(let t=0;t<2;t++)if(e){if(e.button)return e;e=e.parent}}return null}function zp(t,e){_(e)||(e=void 0),Up(t,e,"in")}function Yp(t,e){const{normalStyle:i}=t;_(e)||(e=void 0),i&&(e||(e=i),Up(t,e,"out"))}i([Xr(Mp)],Fp.prototype,"__",void 0),i([br()],Fp.prototype,"robot",void 0),i([fr()],Fp.prototype,"actions",void 0),i([fr("")],Fp.prototype,"action",void 0),i([Lr(0)],Fp.prototype,"now",void 0),i([fr(12)],Fp.prototype,"FPS",void 0),i([fr(!0)],Fp.prototype,"loop",void 0),Fp=i([Qr()],Fp),ce.add("robot");const Xp={};function Up(t,e,i){const{normalStyle:s}=t;e||(e=Xp),e.scale&&(F.assignScale(e,e.scale),delete e.scale),e!==Xp&&cl.canAnimate||(i=null);let n=!!i&&function(t,e,i){let s="in"===t?"transition":"transitionOut";"out"===t&&o(i[s])&&o(e[s])&&(s="transition");return o(e[s])?i[s]:e[s]}(i,e,t);const r=n?function(t,e){const i=Vp(e,t),s=t.animate();s&&Vp(i,t,s.fromStyle);return i}(t,e):void 0;cl.canAnimate&&jp(t)&&t.killAnimate("transition"),s&&t.set(s,"temp");const a=jp(t);if(a){const{animation:s}=a;if(s){const r=t.animate(s,void 0,"animation",!0);Object.assign(a,r.endingStyle),"in"!==i||e.animation!==s?r.kill():n=!1,delete a.animation}t.normalStyle=Hp(a,t),t.set(a,"temp")}else t.normalStyle=void 0;if(n){const e=Hp(r,t);t.set(r,"temp"),t.animate([r,e],n,"transition",!0)}t.__layout.stateStyleChanged=!1}function jp(t){let e;const i={},s=Np(t),n=s?t.state||s.state:t.state,r=n&&t.states[n];r&&cl.isState(n,t,s)&&(e=qp(i,r));const o=i.selectedStyle||t.selectedStyle;o&&cl.isSelected(t,s)&&(e=qp(i,o));const a=i.placeholderStyle||t.placeholderStyle;if(a&&cl.isPlacehold(t,s)&&(e=qp(i,a)),cl.isDisabled(t,s)){const s=i.disabledStyle||t.disabledStyle;s&&(e=qp(i,s))}else{const n=i.focusStyle||t.focusStyle;n&&cl.isFocus(t,s)&&(e=qp(i,n));const r=i.hoverStyle||t.hoverStyle;r&&cl.isHover(t,s)&&(e=qp(i,r));const o=i.pressStyle||t.pressStyle;o&&cl.isPress(t,s)&&(e=qp(i,o))}return e?i:void 0}function Hp(t,e,i,s){const n=i?t:{},r=i||t;for(let t in r)s&&cl.animateExcludes[t]||(n[t]=e[t]);return n}function Vp(t,e,i){return Hp(t,e,i,!0)}function qp(t,e){return Object.assign(t,e),!0}function Gp(t,e){const i=t[e];i&&zp(t,i),t.button&&$p(t.children,e)}function Kp(t,e,i){i||(i=t.states[e]),zp(t,i),t.button&&$p(t.children,null,e)}function $p(t,e,i){if(!t)return;let s,n;for(let o=0,a=t.length;o<a;o++){if(s=t[o],e){switch(n=!0,e){case"hoverStyle":cl.isHover(s)&&(n=!1);break;case"pressStyle":cl.isPress(s)&&(n=!1);break;case"focusStyle":cl.isFocus(s)&&(n=!1)}n&&Gp(s,e)}else r(i)||Kp(s,i);s.isBranch&&$p(s.children,e,i)}}function Jp(t,e){const i=t[e];i&&Yp(t,i),t.button&&Zp(t.children,e)}function Qp(t,e,i){Yp(t,i),t.button&&Zp(t.children,null,e)}function Zp(t,e,i){if(!t)return;let s;for(let n=0,o=t.length;n<o;n++)s=t[n],e?Jp(s,e):r(i)||Qp(s,i),s.isBranch&&Zp(s.children,e,i)}function tg(t,e,i){let s;const n=e.leafer?e.leafer.interaction:null;if(n&&(s=n[t](e),!s&&i)){const r=Np(e,i);r&&(s=n[t](r))}return s}function eg(t,e,i){let s=e[t];if(!s&&i){const n=Np(e,i);n&&(s=n[t])}return s}ce.add("state"),cl.animateExcludes={animation:1,animationOut:1,transition:1,transitionOut:1,states:1,state:1,placeholder:1,normalStyle:1,hoverStyle:1,pressStyle:1,focusStyle:1,selectedStyle:1,disabledStyle:1,placeholderStyle:1},cl.isState=function(t,e,i){return function(t,e,i){let s=e.states[t];if(!s&&i){const n=Np(e,i);n&&(s=n.states[t])}return!!s}(t,e,i)},cl.isSelected=function(t,e){return eg("selected",t,e)},cl.isDisabled=function(t,e){return eg("disabled",t,e)},cl.isFocus=function(t,e){return tg("isFocus",t,e)},cl.isHover=function(t,e){return tg("isHover",t,e)},cl.isPress=function(t,e){return tg("isPress",t,e)},cl.isPlacehold=function(t,e){return t.__.__isPlacehold},cl.isDrag=function(t,e){return tg("isDrag",t,e)},cl.setStyleName=function(t,e,i){i?Kp(t,e,t[e]):Qp(t,e,t[e])},cl.set=function(t,e){const i=t.states[e];i?Kp(t,e,i):Qp(t,e,i)},cl.getStyle=jp,cl.updateStyle=Up,cl.updateEventStyle=function(t,e){switch(e){case rc.ENTER:Gp(t,"hoverStyle");break;case rc.LEAVE:Jp(t,"hoverStyle");break;case rc.DOWN:Gp(t,"pressStyle");break;case rc.UP:Jp(t,"pressStyle")}};const ig=jl.prototype;jl.addAttr("selected",!1,Ip,"selectedStyle"),jl.addAttr("disabled",!1,Ip,"disabledStyle"),jl.addAttr("states",{},Wp),jl.addAttr("state","",Ip),jl.addAttr("normalStyle",void 0,fr),jl.addAttr("hoverStyle",void 0,Wp),jl.addAttr("pressStyle",void 0,Wp),jl.addAttr("focusStyle",void 0,Wp),jl.addAttr("selectedStyle",void 0,Wp),jl.addAttr("disabledStyle",void 0,Wp),jl.addAttr("placeholderStyle",void 0,Wp),jl.addAttr("button",!1,fr),ig.set=function(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))},ig.focus=function(t=!0){this.waitLeafer(()=>{let{focusData:e}=this.app.interaction;t?(e&&e.focus(!1),e=this):e=null,this.app.interaction.focusData=e,t?Gp(this,"focusStyle"):Jp(this,"focusStyle")})},ig.updateState=function(){cl.updateStyle(this,void 0,"in")};const sg=Wd.prototype,ng="text";dr(sg,ng,Object.assign(Object.assign({},cr(sg,ng)),{set(t){const e=this,i=e.text;e.__setAttr(ng,t)&&(kr(e),e.placeholderStyle&&e.placeholder&&(""===i||""===t)&&(e.__layout.stateStyleChanged=!0))}}));const{cos:rg,sin:og,pow:ag,sqrt:hg,abs:lg,ceil:dg,floor:cg,round:ug,PI:_g}=Math,pg=5*_g,gg=1.70158,fg=2.5949095,yg=7.5625,mg=2.75;function vg(t){return e=>ag(e,t)}function wg(t){return e=>1-ag(1-e,t)}function xg(t){return e=>e<.5?.5*ag(2*e,t):1-.5*ag(2-2*e,t)}function bg(t){return t<1/mg?yg*t*t:t<2/mg?yg*(t-=1.5/mg)*t+.75:t<2.5/mg?yg*(t-=2.25/mg)*t+.9375:yg*(t-=2.625/mg)*t+.984375}function Sg(t,e,i,s){const n={};return r=>{const o=~~(1e4*r),a=n[o];if(a)return a;let h,l,d,c=r;for(let e=0;e<8&&(h=1-c,d=kg(c,t,i)-r,l=3*h*h*t+6*h*c*(i-t)+3*c*c*(1-i),!(lg(l)<1e-6));e++)c-=d/l;return n[o]=kg(c,e,s)}}function kg(t,e,i){const s=1-t;return 3*s*s*t*e+3*s*t*t*i+t*t*t}const Bg={get(t){const{list:e}=Bg;return a(t)?e[t||"ease"]:_(t)?e[t.name].apply(e,u(t.value)?t.value:[t.value]):e.ease},register(t,e){Bg.list[t]=e},list:{linear:t=>t,ease:Sg(.25,.1,.25,1),"ease-in":Sg(.42,0,1,1),"ease-out":Sg(0,0,.58,1),"ease-in-out":Sg(.42,0,.58,1),"sine-in":t=>1-rg(t*_g*.5),"sine-out":t=>og(t*_g*.5),"sine-in-out":t=>.5*(1-rg(t*_g)),"quad-in":vg(2),"quad-out":wg(2),"quad-in-out":xg(2),"cubic-in":vg(3),"cubic-out":wg(3),"cubic-in-out":xg(3),"quart-in":vg(4),"quart-out":wg(4),"quart-in-out":xg(4),"quint-in":vg(5),"quint-out":wg(5),"quint-in-out":xg(5),"expo-in":t=>t?ag(2,10*t-10):0,"expo-out":t=>1===t?1:1-ag(2,10*-t),"expo-in-out":t=>0===t||1===t?t:t<.5?.5*ag(2,2*t*10-10):.5*(2-ag(2,10-2*t*10)),"circ-in":t=>1-hg(1-ag(t,2)),"circ-out":t=>hg(1-ag(t-1,2)),"circ-in-out":t=>t<.5?.5*(1-hg(1-ag(2*t,2))):.5*(hg(1-ag(2-2*t,2))+1),"back-in":t=>((gg+1)*t-gg)*t*t,"back-out":t=>(t-=1)*t*((gg+1)*t+gg)+1,"back-in-out":t=>t<.5?(t*=2)*t*((fg+1)*t-fg)*.5:.5*((t=2*t-2)*t*((fg+1)*t+fg)+2),"elastic-in":t=>0===t||1===t?t:-ag(2,10*(t-1))*og((t-1.1)*pg),"elastic-out":t=>0===t||1===t?t:ag(2,-10*t)*og((t-.1)*pg)+1,"elastic-in-out":t=>0===t||1===t?t:t<.5?-ag(2,10*((t*=2)-1))*og((t-1.1)*pg)*.5:ag(2,10*(1-(t*=2)))*og((t-1.1)*pg)*.5+1,"bounce-in":t=>1-bg(1-t),"bounce-out":bg,"bounce-in-out":t=>t<.5?.5*(1-bg(1-2*t)):.5*(1+bg(2*t-1)),"cubic-bezier":Sg,steps:function(t,e="floor"){return i=>("floor"===e?cg(i*t):"ceil"===e?dg(i*t):ug(i*t))/t}}};function Pg(t){return(e,i)=>{Object.defineProperty(e,i,{get(){const e=this.config&&this.config[i];return void 0===e?t:e},set(t){this.config||(this.config={}),this.config[i]=t}})}}class Tg{}Tg.CREATED="created",Tg.PLAY="play",Tg.PAUSE="pause",Tg.STOP="stop",Tg.SEEK="seek",Tg.UPDATE="update",Tg.COMPLETED="completed";let Eg=class extends da{get endingStyle(){return"from"===this.realEnding?this.fromStyle:this.toStyle}get started(){return!!this.requestAnimateTime}get completed(){return this.time>=this.duration&&!this.started}get frame(){return this.frames[this.nowIndex]}get frameTotalTime(){return this.frame.totalTime||this.frame.duration||0}get nowReverse(){return(this.mainReverse?1:0)+(this.frameReverse?1:0)==1}get realEnding(){let t;const{ending:e,reverse:i,swing:s,loop:n}=this;return"from"===e?t=0:"to"===e?t=1:(t=i?0:1,s&&n&&l(n)&&(t+=n-1)),t%2?"to":"from"}constructor(t,e,i,s){super(),this.nowIndex=0,this.playedTotalTime=0,e&&(e.keyframes?(i=e,e=e.keyframes):e.style&&(i=e,e=e.style)),this.init(t,e,i,s)}init(t,e,i,s){switch(this.target=t,(s||this.isTemp)&&(this.isTemp=s),typeof i){case"number":this.config={duration:i};break;case"string":this.config={easing:i};break;case"object":this.config=i,i.event&&(this.event=i.event)}this.keyframes=u(e)?e:e?[e]:[];const{easing:n,attrs:r}=this;this.easingFn=Bg.get(n),(r||this.attrsMap)&&(this.attrsMap=r?r.reduce((t,e)=>(t[e]=!0,t),{}):void 0),this.frames=[],this.create(),this.autoplay&&this.frames.length&&(this.timer=setTimeout(()=>{this.timer=0,this.play()},0))}emitType(t){this.emit(t,this),this.parent&&this.parent.onChildEvent(t,this)}play(){this.destroyed||(this.running=!0,this.started?this.timer||this.startRequestAnimate():(this.clearTimer(),this.start()),this.emitType(Tg.PLAY))}pause(){this.destroyed||(this.running=!1,this.clearTimer(),this.emitType(Tg.PAUSE))}stop(){this.destroyed||(this.complete(),this.emitType(Tg.STOP))}seek(t,e){if(this.destroyed)return;const{delay:i}=this;let s;_(t)&&(t=sl.number(t,this.duration+(e?i:0))),e&&(t-=i),t&&(t/=this.speed),t<0&&(s=-t,t=0),(!this.started||t<this.time||!t)&&this.start(!0),this.time=t,s||this.animate(0,!0),this.clearTimer(()=>{s?this.timer=setTimeout(()=>{this.timer=0,this.begin()},1e3*s):this.startRequestAnimate()}),this.emitType(Tg.SEEK)}kill(t=!0,e){this.killStyle=e,this.destroy(t)}create(){const{target:t,frames:e,keyframes:i,config:s}=this,{length:n}=i,o=!(n>1)||this.join;let a,h,d,c,u,_=0,p=0;n>1&&(this.fromStyle={},this.toStyle={});for(let s=0;s<n;s++){if(h=i[s],c=h.style||h,a||(a=o?t:c),d={style:c,beforeStyle:{}},u=1,h.style){const{duration:t,autoDuration:e,delay:i,autoDelay:s,easing:n,swing:r,loop:o}=h;r&&(d.swing=l(r)?r:2,u=2*d.swing-1),o&&(d.loop=u=l(o)?o:2),t?(d.duration=t,_+=t*u,i&&(d.totalTime=t+i)):e&&(d.autoDuration=e,p+=e*u),i?(d.delay=i,_+=i*u):s&&(d.autoDelay=s,p+=s*u),n&&(d.easingFn=Bg.get(n))}if(!d.autoDuration&&r(d.duration)&&(n>1?s>0||o?p+=u:d.duration=0:d.duration=this.duration),n>1)this.setBefore(d,c,a);else{for(let e in c)d.beforeStyle[e]=t[e];this.fromStyle=d.beforeStyle,this.toStyle=d.style}a=c,e.push(d)}p?((this.duration<=_||!s||!s.duration)&&this.changeDuration(_+.2*p),this.allocateTime((this.duration-_)/p)):_&&this.changeDuration(_),this.emitType(Tg.CREATED)}changeDuration(t){const{config:e}=this;this.config=e?Object.assign(Object.assign({},e),{duration:t}):{duration:t}}setBefore(t,e,i){const{fromStyle:s,toStyle:n,target:o}=this;for(let a in e)r(s[a])&&(s[a]=n[a]=e===i?i[a]:o[a]),t.beforeStyle[a]=r(i[a])?n[a]:i[a],n[a]=e[a]}allocateTime(t){let e,{frames:i}=this,{length:s}=i;for(let n=0;n<s;n++)e=i[n],r(e.duration)&&(e.duration=e.autoDuration?t*e.autoDuration:t),e.totalTime||(e.autoDelay&&(e.delay=e.autoDelay*t),e.delay&&(e.totalTime=e.duration+e.delay))}startRequestAnimate(){this.requestAnimateTime=Date.now(),this.requestAnimatePageTime=0,this.waitRequestRender||this.requestAnimate()}requestAnimate(){this.waitRequestRender=!0,ee.requestRender(this.animate.bind(this))}animate(t,e){if(!e){if(this.waitRequestRender=!1,!this.running)return;let e;e=t&&this.requestAnimatePageTime?t-this.requestAnimatePageTime:Date.now()-this.requestAnimateTime,this.time+=e/1e3,this.requestAnimatePageTime=t,this.requestAnimateTime=Date.now()}const{duration:i}=this,s=this.time*this.speed;if(s<i){for(;s-this.playedTotalTime>this.frameTotalTime;)this.transition(1),this.mainReverse?this.reverseNextFrame():this.nextFrame();const t=this.nowReverse?0:this.frame.delay||0,e=s-this.playedTotalTime-t,i=this.frame.duration;if(e>i)this.transition(1);else if(e>=0){const t=i?e/i:1;this.transition(this.frame.easingFn?this.frame.easingFn(t):this.easingFn(t))}}else this.end();if(!e)if(s<i)this.requestAnimate();else{const{loop:t,loopDelay:e,swing:i}=this;if((!1!==t||i)&&(this.looped?this.looped++:this.looped=1,this.needLoop(this.looped,t,i)))return i&&(this.mainReverse=!this.mainReverse),void(e?this.timer=setTimeout(()=>{this.timer=0,this.begin()},e/this.speed*1e3):this.begin());this.complete()}}start(t){this.requestAnimateTime=1;const{reverse:e,jump:i}=this;if((e||this.mainReverse)&&(this.mainReverse=e),this.looped&&(this.looped=0),t)this.begin(!0);else{const{delay:t}=this;t?(i&&this.begin(!0),this.timer=setTimeout(()=>{this.timer=0,this.begin()},t/this.speed*1e3)):this.begin()}}begin(t){this.playedTotalTime=this.time=0,this.mainReverse?this.setTo():this.setFrom(),t||this.startRequestAnimate()}end(){this.mainReverse?this.setFrom():this.setTo()}complete(){this.requestAnimateTime=0,this.running=!1;const{endingStyle:t,killStyle:e}=this,i=e?{}:t;if(e)for(let s in t)s in e||(i[s]=t[s]);this.setStyle(i),this.clearTimer(),this.emitType(Tg.COMPLETED)}setFrom(){this.nowIndex=0,this.setStyle(this.fromStyle)}setTo(){this.nowIndex=this.frames.length-1,this.setStyle(this.toStyle)}nextFrame(){if(this.needLoopFrame())return this.increaseTime();this.nowIndex+1>=this.frames.length||(this.increaseTime(),this.nowIndex++)}reverseNextFrame(){if(this.needLoopFrame())return this.increaseTime();this.nowIndex-1<0||(this.increaseTime(),this.nowIndex--)}transition(t){const{style:e,beforeStyle:i}=this.frame,s=this.nowReverse?e:i,n=this.nowReverse?i:e;if(0===t)this.setStyle(s);else if(1===t)this.setStyle(n);else{const{attrsMap:i,target:r}=this;let{betweenStyle:o}=this.frame;o||(o=this.frame.betweenStyle={}),ul.setBetweenStyle(o,s,n,e,t,r,i),this.setStyle(o)}this.emitType(Tg.UPDATE)}setStyle(t){const{target:e}=this;e&&t&&(this.style=t,e.__?e.set(t,!!this.isTemp&&"temp"):Object.assign(e,t))}increaseTime(){this.playedTotalTime+=this.frameTotalTime}needLoop(t,e,i){return!(this.needStopLoop(t,e)||this.needStopLoop(t,i,!0))}needStopLoop(t,e,i){return l(e)&&(!e||t>=(i?2*e-1:e))}needLoopFrame(){const{loop:t,swing:e}=this.frame;if(t||e){if(this.frameLooped?this.frameLooped++:this.frameLooped=1,e&&(this.frameReverse=!this.frameReverse),this.needLoop(this.frameLooped,t,e))return!0;this.frameLooped=this.frameReverse=void 0}return!1}clearTimer(t){this.timer&&(clearTimeout(this.timer),this.timer=0,t&&t())}destroy(t){this.destroyed||(super.destroy(),t&&!this.completed?this.stop():this.pause(),this.target=this.parent=this.config=this.frames=this.fromStyle=this.toStyle=this.style=this.killStyle=null,this.destroyed=!0)}};i([Pg("ease")],Eg.prototype,"easing",void 0),i([Pg(0)],Eg.prototype,"delay",void 0),i([Pg(.2)],Eg.prototype,"duration",void 0),i([Pg("auto")],Eg.prototype,"ending",void 0),i([Pg(!1)],Eg.prototype,"reverse",void 0),i([Pg(!1)],Eg.prototype,"swing",void 0),i([Pg(!1)],Eg.prototype,"loop",void 0),i([Pg(0)],Eg.prototype,"loopDelay",void 0),i([Pg(1)],Eg.prototype,"speed",void 0),i([Pg(!0)],Eg.prototype,"autoplay",void 0),i([Pg()],Eg.prototype,"join",void 0),i([Pg()],Eg.prototype,"jump",void 0),i([Pg()],Eg.prototype,"attrs",void 0),Eg=i([Jr(xa)],Eg);let Rg=class extends Eg{get completed(){return this.list.every(t=>t.completed)}get endingStyle(){return this._endingStyle}constructor(t,e,i){super(t,null),this.list=[],this.updateList(e,i)}updateList(t,e){this.fromStyle={},this.toStyle={},this._endingStyle={},t||(t=this.list.filter(t=>{const{completed:e}=t;return e&&t.destroy(),!e})),this.list=t.map(t=>{const i=t.target?t:new Eg(this.target,t,e);return i.parent=this,Object.assign(this.fromStyle,i.fromStyle),Object.assign(this.toStyle,i.toStyle),Object.assign(this._endingStyle,i.endingStyle),i})}play(){this.each(t=>t.play()),this.emitType(Tg.PLAY)}pause(){this.each(t=>t.pause()),this.emitType(Tg.PAUSE)}stop(){this.each(t=>t.stop()),this.emitType(Tg.STOP)}seek(t,e){this.each(i=>i.seek(t,e)),this.emitType(Tg.SEEK)}kill(t,e){this.each(i=>i.kill(t,e)),this.destroy()}onChildEvent(t,e){switch(t){case Tg.COMPLETED:this.completed&&this.emitType(t);break;case Tg.UPDATE:this.emitType(t)}}each(t){this.list.forEach(t)}destroy(t){const{list:e}=this;e.length&&(this.each(e=>e.destroy(t)),e.length=0)}};Rg=i([Jr(xa)],Rg);const Cg={transparent:"FFF0",aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"0FF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"0",blanchedalmond:"FFEBCD",blue:"00F",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",cornsilk:"FFF8DC",crimson:"DC143C",cyan:"0FF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9",darkgreen:"006400",darkgrey:"A9",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkslategrey:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"69",dimgrey:"69",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",forestgreen:"228B22",fuchsia:"F0F",gainsboro:"DC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"80",green:"008000",greenyellow:"ADFF2F",grey:"80",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgray:"D3",lightgreen:"90EE90",lightgrey:"D3",lightpink:"FFB6C1",lightsalmon:"FFA07A",lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"789",lightslategrey:"789",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"00FF00",limegreen:"32CD32",linen:"FAF0E6",magenta:"FF00FF",maroon:"800000",mediumaquamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370DB",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"6B8E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",rebeccapurple:"639",red:"F00",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",slategrey:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"F",whitesmoke:"F5",yellow:"FF0",yellowgreen:"9ACD32"},Lg=/^rgb\((\d+),\s*(\d+),\s*(\d+)/i,Og=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d*\.?\d+)/i,Ag=/^hsl\((\d+),\s*(\d+)%\s*,\s*(\d+)%/i,Dg=/^hsla\((\d+),\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d*\.?\d+)/i,Mg=parseInt,Fg=parseFloat,{round:Ig}=Math;let Wg={},Ng=0;function zg(t){let e,i,s,n=1;switch(t.length){case 9:e=Mg(t.slice(1,3),16),i=Mg(t.slice(3,5),16),s=Mg(t.slice(5,7),16),n=Mg(t.slice(7,9),16)/255;break;case 7:e=Mg(t.slice(1,3),16),i=Mg(t.slice(3,5),16),s=Mg(t.slice(5,7),16);break;case 5:e=Mg(t[1]+t[1],16),i=Mg(t[2]+t[2],16),s=Mg(t[3]+t[3],16),n=Mg(t[4]+t[4],16)/255;break;case 4:e=Mg(t[1]+t[1],16),i=Mg(t[2]+t[2],16),s=Mg(t[3]+t[3],16);break;case 3:e=i=s=Mg(t[1]+t[2],16);break;case 2:e=i=s=Mg(t[1]+t[1],16)}return{r:e,g:i,b:s,a:n}}const Yg=1/6,Xg=.5,Ug=2/3,jg=1/3;function Hg(t,e,i){return i<0?i++:i>1&&i--,i<Yg?t+6*(e-t)*i:i<Xg?e:i<Ug?t+(e-t)*(Ug-i)*6:t}function Vg(t,e,i,s=1){let n,r,o;if(t/=360,i/=100,0===(e/=100))n=r=o=i;else{let s=i<.5?i*(1+e):i+e-i*e,a=2*i-s;n=Hg(a,s,t+jg),r=Hg(a,s,t),o=Hg(a,s,t-jg)}return{r:Ig(255*n),g:Ig(255*r),b:Ig(255*o),a:s}}ce.add("color"),il.object=function(t,e){let i,s=!r(e)&&e<1;if(a(t)){const e=Wg[t];if(e)i=Object.assign({},e);else{switch(t[0]){case"#":i=zg(t);break;case"R":case"r":"("===t[4]&&Og.test(t)?i=function(t){const e=Og.exec(t);return{r:Mg(e[1]),g:Mg(e[2]),b:Mg(e[3]),a:Fg(e[4])}}(t):"("===t[3]&&Lg.test(t)&&(i=function(t){const e=Lg.exec(t);return{r:Mg(e[1]),g:Mg(e[2]),b:Mg(e[3]),a:1}}(t));break;case"H":case"h":"("===t[4]&&Dg.test(t)?i=function(t){const e=Dg.exec(t);return Vg(Fg(e[1]),Fg(e[2]),Fg(e[3]),Fg(e[4]))}(t):"("===t[3]&&Ag.test(t)&&(i=function(t){const e=Ag.exec(t);return Vg(Fg(e[1]),Fg(e[2]),Fg(e[3]),1)}(t))}if(!i){const e=Cg[t.toLowerCase()];e&&(i=zg("#"+e))}i&&(Ng++,Ng>1e4&&(Wg={},Ng=0),Wg[t]=Object.assign({},i))}}else _(t)&&(r(t.a)&&(t.a=1),s&&(t=Object.assign({},t)),i=t);return i||(i={r:255,g:255,b:255,a:1}),s&&(i.a*=e),i};const{round:qg}=Math,{fourNumber:Gg}=F,Kg={fill:tf,stroke:tf,cornerRadius:(t,e,i)=>l(t)&&l(e)?Qg(t,e,i):(t=Gg(t),e=Gg(e),t.map((t,s)=>Qg(t,e[s],i))),text(t,e,i){if(a(t)&&a(e)){const s=t.length,n=e.length,r=Qg(s,n,i,1);return s<n?e.substring(0,r):t.substring(0,r)}return l(t)||l(e)?F.float(Qg(t,e,i),Math.max(Jg(t),Jg(e))):e},boxStyle(t,e,i,s){t||(t={}),e||(e={});const n=Object.assign(Object.assign({},t),e);return ul.setBetweenStyle(n,t,e,n,i,s),n},shadow:ef,innerShadow:ef},$g={value:function(t,e,i){const s=l(t),n=l(e);return s&&n?t+(e-t)*i:n||s?Qg(t,e,i):t},number:Qg,color:Zg,setBetweenStyle:function(t,e,i,s,n,r,o){let a,h,l;const{list:d,value:c}=ul;for(let u in s)o&&!o[u]||(a=e[u],h=i[u],l=d[u]||c,a!==h&&(t[u]=l(a,h,n,r)))}};function Jg(t){const e=String(t).split(".")[1];return e?e.length:0}function Qg(t,e,i,s){t||(t=0),e||(e=0);const n=t+(e-t)*i;return s?qg(n):n}function Zg(t,e,i){t=il.object(t),e=il.object(e);const s=Qg(t.r,e.r,i,1)+","+Qg(t.g,e.g,i,1)+","+Qg(t.b,e.b,i,1),n=Qg(t.a,e.a,i);return 1===n?"rgb("+s+")":"rgba("+s+","+n+")"}function tf(t,e,i){return a(t)&&a(e)?Zg(t,e,i):e}function ef(t,e,i){return u(t)||u(e)?e:(e=e||{},{x:Qg((t=t||{}).x,e.x,i),y:Qg(t.y,e.y,i),blur:Qg(t.blur,e.blur,i),spread:Qg(t.spread,e.spread,i),color:Zg(t.color||"#FFFFFF00",e.color||"#FFFFFF00",i),visible:e.visible,blendMode:e.blendMode,box:e.box||t.box})}ce.add("animate","color"),cl.canAnimate=!0,Object.assign(ul.list,Kg),Object.assign(ul,$g);const sf=jl.prototype;jl.addAttr("animation",void 0,function(t){return _r(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&(this.killAnimate("animation"),e&&this.animate(e,void 0,"animation"))}}))}),jl.addAttr("animationOut",void 0,fr),jl.addAttr("transition",!0,fr),jl.addAttr("transitionOut",void 0,fr),sf.set=function(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))},sf.animate=function(t,e,i,s){if(r(t))return this.__animate;let n=u(t)&&!e&&i?new Rg(this,t,s):new Eg(this,t,e,s);this.killAnimate(i,n.toStyle);const o=this.__animate;return o&&(n instanceof Rg?n.list.unshift(o):n=new Rg(this,[o,n])),this.__animate=n},sf.killAnimate=function(t,e){const i=this.__animate;if(i){let t=!1;if(e&&!i.completed){i instanceof Rg&&i.updateList();const{toStyle:s}=i;for(let i in e)if(i in s){t=!0;break}}else t=!0;t&&(i.kill(!0,e),this.__animate=null)}},sf.__runAnimation=function(t,e){this.animate("in"===t?this.animation:this.animationOut,void 0,"animation"),e&&this.__animate.on(Tg.COMPLETED,e)};const nf=[.1488743389,.4333953941,.6794095682,.8650633666,.9739065285],rf=[.2955242247,.2692667193,.2190863625,.1494513491,.0666713443],{sqrt:of}=Math,{getDerivative:af}=li,hf={getDistance(t,e,i,s,n,r,o,a,h=1){let l,d,c,u,_,p,g=0,f=h/2;for(let h=0;h<nf.length;h++)l=f*(1+nf[h]),d=f*(1-nf[h]),c=af(l,t,i,n,o),u=af(l,e,s,r,a),_=af(d,t,i,n,o),p=af(d,e,s,r,a),g+=rf[h]*(of(c*c+u*u)+of(_*_+p*p));return g*f},getRotation(t,e,i,s,n,r,o,a,h){const l=af(t,e,s,r,a),d=af(t,i,n,o,h);return Math.atan2(d,l)/W},getT(t,e,i,s,n,r,o,a,h,l,d=1){let c=0,u=1,_=t/e,p=d/e/3;if(_>=1)return 1;if(_<=0)return 0;for(;u-c>p;)lf(i,s,n,r,o,a,h,l,_)<t?c=_:u=_,_=(c+u)/2;return _},cut(t,e,i,s,n,r,o,a,h,l){const d=1-e,c=d*i+e*n,u=d*s+e*r,_=d*n+e*o,p=d*r+e*a,g=d*c+e*_,f=d*u+e*p,y=d*g+e*(d*_+e*(d*o+e*h)),m=d*f+e*(d*p+e*(d*a+e*l));t.push(Fe.C,c,u,g,f,y,m)}},{getDistance:lf}=hf,{M:df,L:cf,C:uf,Z:_f}=Fe,{float:pf}=F,gf={},ff={},yf={transform(t,e){let i,s=0;const n=t.length;for(;s<n;)switch(i=t[s],i){case df:case cf:yf.transformPoints(t,e,s,1),s+=3;break;case uf:yf.transformPoints(t,e,s,3),s+=7;break;case _f:s+=1}},transformPoints(t,e,i,s){for(let n=i+1,r=n+2*s;n<r;n+=2)gf.x=t[n],gf.y=t[n+1],J.toOuterPoint(e,gf),t[n]=gf.x,t[n+1]=gf.y},getMotionPathData(t){let e,i,s,n,r=0,o=[],a=0,h=0,l=0;const d=t.length;for(;a<d;){switch(n=t[a],n){case df:case cf:i=t[a+1],s=t[a+2],e=n===cf&&a>0?lt.getDistanceFrom(h,l,i,s):0,h=i,l=s,a+=3;break;case uf:i=t[a+5],s=t[a+6],e=hf.getDistance(h,l,t[a+1],t[a+2],t[a+3],t[a+4],i,s),h=i,l=s,a+=7;break;case _f:a+=1;default:e=0}o.push(e),r+=e}return{total:r,segments:o,data:t}},getDistancePoint(t,e,i){const{segments:s,data:n}=t;e=sl.number(e,t.total);let r,o,a,h,l,d,c,u,_,p=0,g={},f=0,y=0,m=0,v=0;const w=n.length;for(;f<w;){switch(h=n[f],h){case df:case cf:if(o=n[f+1],a=n[f+2],r=s[y],p+r>=e||!t.total)return f||(m=o,v=a),ff.x=m,ff.y=v,g.x=o,g.y=a,lt.getDistancePoint(ff,g,e-p,!0),g.rotation=lt.getAngle(ff,g),g;m=o,v=a,f+=3;break;case uf:if(o=n[f+5],a=n[f+6],r=s[y],p+r>=e)return l=n[f+1],d=n[f+2],c=n[f+3],u=n[f+4],_=hf.getT(e-p,r,m,v,l,d,c,u,o,a,i),li.getPointAndSet(_,m,v,l,d,c,u,o,a,g),g.rotation=hf.getRotation(_,m,v,l,d,c,u,o,a),g;m=o,v=a,f+=7;break;case _f:f+=1;default:r=0}y++,p+=r}return g},getDistancePath(t,e,i){const{segments:s,data:n}=t,r=[];e=sl.number(e,t.total);let o,a,h,l,d,c,u,_,p,g,f=0,y={},m=0,v=0,w=0,x=0;const b=n.length;for(;m<b;){switch(d=n[m],d){case df:case cf:if(h=n[m+1],l=n[m+2],o=s[v],f+o>e||!t.total)return m||(w=h,x=l),ff.x=w,ff.y=x,y.x=h,y.y=l,a=pf(e-f),a&&(lt.getDistancePoint(ff,y,a,!0),r.push(d,y.x,y.y)),r;w=h,x=l,m+=3,r.push(d,w,x);break;case uf:if(c=n[m+1],u=n[m+2],_=n[m+3],p=n[m+4],h=n[m+5],l=n[m+6],o=s[v],f+o>e)return a=pf(e-f),a&&(g=hf.getT(a,o,w,x,c,u,_,p,h,l,i),hf.cut(r,g,w,x,c,u,_,p,h,l)),r;w=h,x=l,m+=7,r.push(d,c,u,_,p,h,l);break;case _f:m+=1,r.push(d);default:o=0}v++,f+=o}return r}};function mf(t){return _r(t,t=>({set(e){this.__setAttr(t,e),this.__hasMotionPath=this.motionPath||!o(this.motion),this.__layout.matrixChanged||this.__layout.matrixChange()}}))}ce.add("motion-path"),ul.register("motion",function(t,e,i,s){return _(t)&&(t=sl.number(t,s.getMotionTotal())),_(e)&&(e=sl.number(e,s.getMotionTotal())),ul.number(t||0,e||0,i)}),ul.register("motionRotation",function(t,e,i){return ul.number(t,e,i)});const vf=jl.prototype,{updateMatrix:wf,updateAllMatrix:xf}=uo,{updateBounds:bf}=ko;function Sf(t){const{motion:e,leaferIsCreated:i}=t;if(!o(e)){if(i&&(t.leafer.created=!1),t.motionPath){const i=Bf(t);i.total&&(t.__.__pathForRender=yf.getDistancePath(i,e,t.motionPrecision))}else t.set(t.getMotionPoint(e)),t.__hasAutoLayout||(t.isBranch?(xf(t),bf(t,t)):wf(t));i&&(t.leafer.created=!0)}}function kf(t){const{parent:e}=t;if(!t.motionPath&&e){const{children:t}=e;for(let e=0;e<t.length;e++)if(t[e].motionPath)return t[e]}return t}function Bf(t){const e=t.__;return e.__pathForMotion?e.__pathForMotion:e.__pathForMotion=yf.getMotionPathData(t.getPath(!0,!0))}jl.addAttr("motionPath",void 0,mf),jl.addAttr("motionPrecision",1,mf),jl.addAttr("motion",void 0,mf),jl.addAttr("motionRotation",!0,mf),vf.getMotionPathData=function(){return Bf(kf(this))},vf.getMotionPoint=function(t){const e=kf(this),i=Bf(e);if(!i.total)return{};const s=yf.getDistancePoint(i,t,e.motionPrecision);J.toOuterPoint(e.localTransform,s);const{motionRotation:n}=this;return!1===n?delete s.rotation:l(n)&&(s.rotation+=n),s},vf.getMotionTotal=function(){return this.getMotionPathData().total},vf.__updateMotionPath=function(){const t=this.__;if(this.__layout.resized&&t.__pathForMotion&&(t.__pathForMotion=void 0),this.motionPath){let t;const{children:e}=this.parent;for(let i=0;i<e.length;i++)t=e[i],o(t.motion)||t.__layout.matrixChanged||(t!==this&&t.__extraUpdate(),Sf(t))}else Sf(this)};const{Yes:Pf,NoAndSkip:Tf,YesAndSkip:Ef}=e,Rf={},Cf={},Lf={};class Of{constructor(t){this.innerIdMap={},this.idMap={},this.methods={id:(t,e)=>t.id===e?(this.target&&(this.idMap[e]=t),1):0,innerId:(t,e)=>t.innerId===e?(this.target&&(this.innerIdMap[e]=t),1):0,className:(t,e)=>t.className===e?1:0,tag:(t,e)=>t.__tag===e?1:0,tags:(t,e)=>e[t.__tag]?1:0},(this.target=t)&&this.__listenEvents()}getBy(t,e,i,s){switch(typeof t){case"number":const n=this.getByInnerId(t,e);return i?n:n?[n]:[];case"string":switch(t[0]){case"#":Rf.id=t.substring(1),t=Rf;break;case".":Cf.className=t.substring(1),t=Cf;break;default:Lf.tag=t,t=Lf}case"object":if(r(t.id)){if(t.tag){const{tag:s}=t,n=u(s);return this.getByMethod(n?this.methods.tags:this.methods.tag,e,i,n?f.toMap(s):s)}return this.getByMethod(this.methods.className,e,i,t.className)}{const s=this.getById(t.id,e);return i?s:s?[s]:[]}case"function":return this.getByMethod(t,e,i,s)}}getByInnerId(t,e){const i=this.innerIdMap[t];return i||(this.eachFind(this.toChildren(e),this.methods.innerId,null,t),this.findLeaf)}getById(t,e){const i=this.idMap[t];return i&&uo.hasParent(i,e||this.target)?i:(this.eachFind(this.toChildren(e),this.methods.id,null,t),this.findLeaf)}getByClassName(t,e){return this.getByMethod(this.methods.className,e,!1,t)}getByTag(t,e){return this.getByMethod(this.methods.tag,e,!1,t)}getByMethod(t,e,i,s){const n=i?null:[];return this.eachFind(this.toChildren(e),t,n,s),n||this.findLeaf}eachFind(t,e,i,s){let n,r;for(let o=0,a=t.length;o<a;o++){if(n=t[o],r=e(n,s),"boolean"==typeof r&&(r=r?1:0),r===Pf||r===Ef){if(!i)return void(this.findLeaf=n);i.push(n)}n.isBranch&&r<Tf&&this.eachFind(n.children,e,i,s)}}toChildren(t){return this.findLeaf=null,[t||this.target]}__onRemoveChild(t){const{id:e,innerId:i}=t.child;this.idMap[e]&&delete this.idMap[e],this.innerIdMap[i]&&delete this.innerIdMap[i]}__checkIdChange(t){if("id"===t.attrName){const e=t.oldValue;this.idMap[e]&&delete this.idMap[e]}}__listenEvents(){this.__eventIds=[this.target.on_(Xo.REMOVE,this.__onRemoveChild,this),this.target.on_(jo.CHANGE,this.__checkIdChange,this)]}__removeListenEvents(){this.target.off_(this.__eventIds),this.__eventIds.length=0}destroy(){const{__eventIds:t}=this;t&&t.length&&(this.__removeListenEvents(),this.innerIdMap={},this.idMap={}),this.findLeaf=null}}const Af=jl.prototype;function Df(t){return t.leafer?t.leafer.selector:ee.selector||(ee.selector=ue.selector())}Af.find=function(t,e){return Df(this).getBy(t,this,!1,e)},Af.findOne=function(t,e){return Df(this).getBy(t,this,!0,e)},ce.add("find"),ue.finder=function(t){return new Of(t)};export{Tt as AlignHelper,Eg as Animate,Bg as AnimateEasing,Tg as AnimateEvent,Rg as AnimateList,e as Answer,Yd as App,kt as AroundHelper,$t as AutoBounds,li as BezierHelper,Gt as Bounds,qo as BoundsEvent,jt as BoundsHelper,ed as Box,bl as BoxData,kh as Branch,ko as BranchHelper,Xa as BranchRender,Od as Canvas,Ml as CanvasData,ve as CanvasManager,Xo as ChildEvent,il as ColorConvert,ue as Creator,Mc as Cursor,f as DataHelper,ne as Debug,xt as Direction4,bt as Direction9,sc as DragBoundsHelper,hc as DragEvent,kc as Dragger,dc as DropEvent,hl as Effect,od as Ellipse,Tl as EllipseData,mi as EllipseHelper,Yo as Event,ye as EventCreator,da as Eventer,dl as Export,Kn as FileHelper,ll as Filter,Of as Finder,P as FourNumberHelper,id as Frame,kl as FrameData,Hl as Group,xl as GroupData,hf as HighBezierHelper,yf as HighCurveHelper,Fc as HitCanvasManager,Cd as Image,Dl as ImageData,Vo as ImageEvent,sr as ImageManager,v as IncrementId,Zc as Interaction,Dc as InteractionBase,mc as InteractionHelper,yc as KeyEvent,Ud as Keyboard,ea as LayoutEvent,Uh as Layouter,ph as Leaf,Wa as LeafBounds,wo as LeafBoundsHelper,m as LeafData,Sa as LeafDataProxy,xa as LeafEventer,uo as LeafHelper,zo as LeafLayout,Ph as LeafLevelList,Bh as LeafList,Ca as LeafMatrix,Na as LeafRender,Gl as Leafer,Rh as LeaferCanvas,Ae as LeaferCanvasBase,Sl as LeaferData,sa as LeaferEvent,hr as LeaferFilm,ar as LeaferImage,lr as LeaferVideo,Rd as Line,Bl as LineData,F as MathHelper,yt as Matrix,J as MatrixHelper,cc as MoveEvent,lc as MyDragEvent,Ld as MyImage,oc as MyPointerEvent,_c as MyTouchEvent,We as NeedConvertToCanvasCommandMap,W as OneRadian,N as PI2,z as PI_2,rl as Paint,al as PaintGradient,ol as PaintImage,Nd as Path,nl as PathArrow,In as PathBounds,Ps as PathCommandDataHelper,Fe as PathCommandMap,vi as PathCommandNodeHelper,ss as PathConvert,jn as PathCorner,Us as PathCreator,Cl as PathData,rn as PathDrawer,De as PathHelper,t as PathNodeHandleType,Xe as PathNumberCommandLengthMap,Ye as PathNumberCommandMap,zd as Pen,Ll as PenData,Kh as Picker,ee as Platform,ce as Plugin,gt as Point,lt as PointHelper,jd as PointerButton,rc as PointerEvent,pd as Polygon,El as PolygonData,jo as PropertyEvent,Kl as Rect,Pl as RectData,Ue as RectHelper,Xl as RectRender,ia as RenderEvent,Hh as Renderer,Zo as ResizeEvent,er as Resource,Fp as Robot,Mp as RobotData,pc as RotateEvent,he as Run,$h as Selector,xd as Star,Rl as StarData,cl as State,Qt as StringNumberMap,gc as SwipeEvent,Qn as TaskItem,Zn as TaskProcessor,Wd as Text,el as TextConvert,Al as TextData,uc as TouchEvent,ul as Transition,vt as TwoPointBoundsHelper,jl as UI,Wl as UIBounds,pe as UICreator,vl as UIData,Hd as UIEvent,zl as UIRender,sl as UnitConvert,Jt as UnitConvertHelper,Co as WaitHelper,ta as WatchEvent,Oh as Watcher,fc as ZoomEvent,Cr as affectRenderBoundsType,Tr as affectStrokeBoundsType,pr as attr,vr as autoLayoutType,br as boundsType,Gn as canvasPatch,Oe as canvasSizeAttrs,tl as createAttr,ur as createDescriptor,Yr as cursorType,Xr as dataProcessor,fr as dataType,_r as decorateLeafAttr,jr as defineDataProcessor,dr as defineKey,gr as defineLeafAttr,Or as dimType,kr as doBoundsType,Er as doStrokeType,Jh as effectType,n as emptyData,Nr as eraserType,Ho as extraPropertyEventMap,X as getBoundsData,cr as getDescriptor,U as getMatrixData,Y as getPointData,zr 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,r as isUndefined,Ur as layoutProcessor,ha as leaferTransformAttrMap,Wr as maskType,mf as motionPathType,Sr as naturalBoundsType,Ar as opacityType,Hn as path,Br as pathInputType,Pr as pathType,Vn as pen,yr as positionType,Qr as registerUI,Zr as registerUIEvent,Qh as resizeType,Gr as rewrite,Kr as rewriteAble,xr as rotationType,wr as scaleType,mr as scrollType,Ir as sortType,Wp as stateStyleType,Ip as stateType,Rr as strokeType,Lr as surfaceType,Kt as tempBounds,mt as tempMatrix,ft as tempPoint,c as tryToNumber,Ch as useCanvas,Jr as useModule,Th as version,Dr as visibleType,Zh as zoomLayerType};
1
+ var t,e;function i(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o}function s(t,e,i,s){return new(i||(i=Promise))(function(n,r){function o(t){try{h(s.next(t))}catch(t){r(t)}}function a(t){try{h(s.throw(t))}catch(t){r(t)}}function h(t){t.done?n(t.value):function(t){return t instanceof i?t:new i(function(e){e(t)})}(t.value).then(o,a)}h((s=s.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 n={};function r(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,i){let s;Object.keys(e).forEach(n=>{var r,o;if(s=e[n],(null==s?void 0:s.constructor)===Object&&(null===(r=t[n])||void 0===r?void 0:r.constructor)===Object)return y(t[n],e[n],i&&i[n]);i&&n in i?(null===(o=i[n])||void 0===o?void 0:o.constructor)===Object&&y(t[n]={},e[n],i[n]):t[n]=e[n]})},copyAttrs:(t,e,i)=>(i.forEach(i=>{r(e[i])||(t[i]=e[i])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let i=0,s=t.length;i<s;i++)e[t[i]]=!0;return e},stintSet(t,e,i){i||(i=void 0),t[e]!==i&&(t[e]=i)}},{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(!r(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let i;for(let s in this)"_"!==s[0]&&(i=e?e[s]:void 0,t[s]=r(i)?this[s]:i);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!r(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!r(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const i={};if(t)if(u(t))for(let e of t)i[e]=this.__getInput(e);else for(let e in t)i[e]=this.__getInput(e);else{let t,e,{__input:s}=this;i.tag=this.__leaf.tag;for(let n in this)if("_"!==n[0]&&(t=this["_"+n],!r(t))){if("path"===n&&!this.__pathInputed)continue;e=s?s[n]:void 0,i[n]=r(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:s,d:n,e:r,f:o}=this.__leaf.__localMatrix;i.matrix={a:t,b:e,c:s,d:n,e:r,f:o}}return i}__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 v={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=w;return e[t]?e[t]++:(e[t]=1,0)}},w=v;let x,b,S;const{max:k}=Math,B=[0,0,0,0],P={zero:[...B],tempFour:B,set:(t,e,i,s,n)=>(void 0===i&&(i=s=n=e),t[0]=e,t[1]=i,t[2]=s,t[3]=n,t),setTemp:(t,e,i,s)=>T(B,t,e,i,s),toTempAB(t,e,i){S=i?l(t)?e:t:[],l(t)?(x=C(t),b=e):l(e)?(x=t,b=C(e)):(x=t,b=e),4!==x.length&&(x=E(x)),4!==b.length&&(b=E(b))},get(t,e){let i;if(!l(t))switch(t.length){case 4:i=r(e)?t:[...t];break;case 2:i=[t[0],t[1],t[0],t[1]];break;case 3:i=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(i||(i=[t,t,t,t]),!r(e))for(let t=0;t<4;t++)i[t]>e&&(i[t]=e);return i},max:(t,e,i)=>l(t)&&l(e)?k(t,e):(R(t,e,i),T(S,k(x[0],b[0]),k(x[1],b[1]),k(x[2],b[2]),k(x[3],b[3]))),add:(t,e,i)=>l(t)&&l(e)?t+e:(R(t,e,i),T(S,x[0]+b[0],x[1]+b[1],x[2]+b[2],x[3]+b[3])),swapAndScale(t,e,i,s){if(l(t))return e===i?t*e:[t*i,t*e];const n=s?t:[],[r,o,a,h]=4===t.length?t:E(t);return T(n,a*i,h*e,r*i,o*e)}},{set:T,get:E,setTemp:C,toTempAB:R}=P,{round:L,pow:O,max:A,floor:D,PI:M}=Math,F={},I={within:(t,e,i)=>(_(e)&&(i=e.max,e=e.min),!r(e)&&t<e&&(t=e),!r(i)&&t>i&&(t=i),t),fourNumber:P.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),I.float(t)),getGapRotation(t,e,i=0){let s=t+i;if(e>1){const t=Math.abs(s%e);(t<1||t>e-1)&&(s=Math.round(s/e)*e)}return s-i},float(t,e){const i=r(e)?1e12:O(10,e);return-0===(t=L(t*i)/i)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,i,s){if(s||(s={}),e){const t=(l(e)?e:e.width||0)/i.width,n=(l(e)?e:e.height||0)/i.height;s.scaleX=t||n||1,s.scaleY=n||t||1}else t&&I.assignScale(s,t);return s},getScaleFixedData(t,e,i,s,n){let{scaleX:r,scaleY:o}=t;if((s||e)&&(r<0&&(r=-r),o<0&&(o=-o)),e)if(!0===e)r=o=i?1:1/r;else{let t;l(e)?t=e:"zoom-in"===e&&(t=1),t&&(r=o=r>t||o>t?i?1:1/r:i?1:1/t)}return F.scaleX=r,F.scaleY=o,F},assignScale(t,e){l(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>A(D(t),e)/t,randInt:W,randColor:t=>`rgba(${W(255)},${W(255)},${W(255)},${t||1})`};function W(t){return Math.round(Math.random()*t)}const N=M/180,z=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:H,cos:V,acos:q,sqrt:G}=Math,{float:K}=I,$={};function J(){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 Q={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:J(),tempMatrix:{},set(t,e=1,i=0,s=0,n=1,r=0,o=0){t.a=e,t.b=i,t.c=s,t.d=n,t.e=r,t.f=o},get:j,getWorld:J,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,i){t.e+=e,t.f+=i},translateInner(t,e,i,s){t.e+=t.a*e+t.c*i,t.f+=t.b*e+t.d*i,s&&(t.e-=e,t.f-=i)},scale(t,e,i=e){t.a*=e,t.b*=e,t.c*=i,t.d*=i},pixelScale(t,e,i){i||(i=t),i.a=t.a*e,i.b=t.b*e,i.c=t.c*e,i.d=t.d*e,i.e=t.e*e,i.f=t.f*e},scaleOfOuter(t,e,i,s){Z.toInnerPoint(t,e,$),Z.scaleOfInner(t,$,i,s)},scaleOfInner(t,e,i,s=i){Z.translateInner(t,e.x,e.y),Z.scale(t,i,s),Z.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:i,b:s,c:n,d:r}=t,o=V(e*=N),a=H(e);t.a=i*o-s*a,t.b=i*a+s*o,t.c=n*o-r*a,t.d=n*a+r*o},rotateOfOuter(t,e,i){Z.toInnerPoint(t,e,$),Z.rotateOfInner(t,$,i)},rotateOfInner(t,e,i){Z.translateInner(t,e.x,e.y),Z.rotate(t,i),Z.translateInner(t,-e.x,-e.y)},skew(t,e,i){const{a:s,b:n,c:r,d:o}=t;i&&(i*=N,t.a=s+r*i,t.b=n+o*i),e&&(e*=N,t.c=r+s*e,t.d=o+n*e)},skewOfOuter(t,e,i,s){Z.toInnerPoint(t,e,$),Z.skewOfInner(t,$,i,s)},skewOfInner(t,e,i,s=0){Z.translateInner(t,e.x,e.y),Z.skew(t,i,s),Z.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:i,b:s,c:n,d:r,e:o,f:a}=t;t.a=e.a*i+e.b*n,t.b=e.a*s+e.b*r,t.c=e.c*i+e.d*n,t.d=e.c*s+e.d*r,t.e=e.e*i+e.f*n+o,t.f=e.e*s+e.f*r+a},multiplyParent(t,e,i,s,n){const{e:o,f:a}=t;if(i||(i=t),r(s)&&(s=1!==t.a||t.b||t.c||1!==t.d),s){const{a:s,b:r,c:o,d:a}=t;i.a=s*e.a+r*e.c,i.b=s*e.b+r*e.d,i.c=o*e.a+a*e.c,i.d=o*e.b+a*e.d,n&&(i.scaleX=e.scaleX*n.scaleX,i.scaleY=e.scaleY*n.scaleY)}else i.a=e.a,i.b=e.b,i.c=e.c,i.d=e.d,n&&(i.scaleX=e.scaleX,i.scaleY=e.scaleY);i.e=o*e.a+a*e.c+e.e,i.f=o*e.b+a*e.d+e.f},divide(t,e){Z.multiply(t,Z.tempInvert(e))},divideParent(t,e){Z.multiplyParent(t,Z.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=Z;return Z.copy(e,t),Z.invert(e),e},invert(t){const{a:e,b:i,c:s,d:n,e:r,f:o}=t;if(i||s){const a=1/(e*n-i*s);t.a=n*a,t.b=-i*a,t.c=-s*a,t.d=e*a,t.e=-(r*n-o*s)*a,t.f=-(o*e-r*i)*a}else if(1===e&&1===n)t.e=-r,t.f=-o;else{const i=1/(e*n);t.a=n*i,t.d=e*i,t.e=-r*n*i,t.f=-o*e*i}},toOuterPoint(t,e,i,s){const{x:n,y:r}=e;i||(i=e),i.x=n*t.a+r*t.c,i.y=n*t.b+r*t.d,s||(i.x+=t.e,i.y+=t.f)},toInnerPoint(t,e,i,s){const{a:n,b:r,c:o,d:a}=t,h=1/(n*a-r*o),{x:l,y:d}=e;if(i||(i=e),i.x=(l*a-d*o)*h,i.y=(d*n-l*r)*h,!s){const{e:e,f:s}=t;i.x-=(e*a-s*o)*h,i.y-=(s*n-e*r)*h}},setLayout(t,e,i,s,n){const{x:o,y:a,scaleX:h,scaleY:l}=e;if(r(n)&&(n=e.rotation||e.skewX||e.skewY),n){const{rotation:i,skewX:s,skewY:n}=e,r=i*N,o=V(r),a=H(r);if(s||n){const e=s*N,i=n*N;t.a=(o+i*-a)*h,t.b=(a+i*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,(i=i||s)&&Z.translateInner(t,-i.x,-i.y,!s)},getLayout(t,e,i,s){const{a:n,b:r,c:o,d:a,e:h,f:l}=t;let d,c,u,_,p,g=h,f=l;if(r||o){const t=n*a-r*o;if(o&&!s){d=G(n*n+r*r),c=t/d;const e=n/d;u=r>0?q(e):-q(e)}else{c=G(o*o+a*a),d=t/c;const e=o/c;u=Y-(a>0?q(-e):-q(e))}const e=K(V(u)),i=H(u);d=K(d),c=K(c),_=e?K((o/c+i)/e/N,9):0,p=e?K((r/d-i)/e/N,9):0,u=K(u/N)}else d=n,c=a,u=_=p=0;return(e=i||e)&&(g+=e.x*n+e.y*o,f+=e.x*r+e.y*a,i||(g-=e.x,f-=e.y)),{x:g,y:f,scaleX:d,scaleY:c,rotation:u,skewX:_,skewY:p}},withScale(t,e,i=e){const s=t;if(!e||!i){const{a:s,b:n,c:r,d:o}=t;n||r?i=(s*o-n*r)/(e=G(s*s+n*n)):(e=s,i=o)}return s.scaleX=e,s.scaleY=i,s},reset(t){Z.set(t)}},Z=Q,{float:tt}=I,{toInnerPoint:et,toOuterPoint:it}=Q,{sin:st,cos:nt,abs:rt,sqrt:ot,atan2:at,min:ht,round:lt}=Math,dt={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,i=0){t.x=e,t.y=i},setRadius(t,e,i){t.radiusX=e,t.radiusY=r(i)?e:i},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,i){t.x=e,t.y=i},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,i){_(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=i)},scale(t,e,i=e){t.x&&(t.x*=e),t.y&&(t.y*=i)},scaleOf(t,e,i,s=i){t.x+=(t.x-e.x)*(i-1),t.y+=(t.y-e.y)*(s-1)},rotate(t,e,i){i||(i=ct.defaultPoint);const s=nt(e*=N),n=st(e),r=t.x-i.x,o=t.y-i.y;t.x=i.x+r*s-o*n,t.y=i.y+r*n+o*s},tempToInnerOf(t,e){const{tempPoint:i}=ct;return _t(i,t),et(e,i,i),i},tempToOuterOf(t,e){const{tempPoint:i}=ct;return _t(i,t),it(e,i,i),i},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:i}=ct;return _t(i,t),ct.toInnerRadiusPointOf(t,e,i),i},copyRadiusPoint:(t,e,i,s)=>(_t(t,e),pt(t,i,s),t),toInnerRadiusPointOf(t,e,i){i||(i=t),et(e,t,i),i.radiusX=Math.abs(t.radiusX/e.scaleX),i.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,i){et(e,t,i)},toOuterOf(t,e,i){it(e,t,i)},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,i,s){const n=rt(i-t),r=rt(s-e);return ot(n*n+r*r)},getMinDistanceFrom:(t,e,i,s,n,r)=>ht(ut(t,e,i,s),ut(i,s,n,r)),getAngle:(t,e)=>gt(t,e)/N,getRotation:(t,e,i,s)=>(s||(s=e),ct.getRadianFrom(t.x,t.y,e.x,e.y,i.x,i.y,s.x,s.y)/N),getRadianFrom(t,e,i,s,n,o,a,h){r(a)&&(a=i,h=s);const l=t-i,d=e-s,c=n-a,u=o-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e)=>at(e.y-t.y,e.x-t.x),getDistancePoint(t,e,i,s,n){const r=gt(t,e);return n&&(t=e),s||(e={}),e.x=t.x+nt(r)*i,e.y=t.y+st(r)*i,e},toNumberPoints(t){let e=t;return _(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},isSame:(t,e,i)=>i?t.x===e.x&&t.y===e.y:tt(t.x)===tt(e.x)&&tt(t.y)===tt(e.y),reset(t){ct.reset(t)}},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,i){return dt.scaleOf(this,t,e,i),this}rotate(t,e){return dt.rotate(this,t,e),this}rotateOf(t,e){return dt.rotate(this,e,t),this}getRotation(t,e,i){return dt.getRotation(this,t,e,i)}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,i,s){return new ft(dt.getDistancePoint(this,t,e,i,s))}getAngle(t){return dt.getAngle(this,t)}getAtan2(t){return dt.getAtan2(this,t)}isSame(t,e){return dt.isSame(this,t,e)}reset(){return dt.reset(this),this}}const yt=new ft;class mt{constructor(t,e,i,s,n,r){this.set(t,e,i,s,n,r)}set(t,e,i,s,n,r){return _(t)?Q.copy(this,t):Q.set(this,t,e,i,s,n,r),this}setWith(t){return Q.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:i,d:s,e:n,f:r}=this;return{a:t,b:e,c:i,d:s,e:n,f:r}}clone(){return new mt(this)}translate(t,e){return Q.translate(this,t,e),this}translateInner(t,e){return Q.translateInner(this,t,e),this}scale(t,e){return Q.scale(this,t,e),this}scaleWith(t,e){return Q.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return Q.pixelScale(this,t),this}scaleOfOuter(t,e,i){return Q.scaleOfOuter(this,t,e,i),this}scaleOfInner(t,e,i){return Q.scaleOfInner(this,t,e,i),this}rotate(t){return Q.rotate(this,t),this}rotateOfOuter(t,e){return Q.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return Q.rotateOfInner(this,t,e),this}skew(t,e){return Q.skew(this,t,e),this}skewOfOuter(t,e,i){return Q.skewOfOuter(this,t,e,i),this}skewOfInner(t,e,i){return Q.skewOfInner(this,t,e,i),this}multiply(t){return Q.multiply(this,t),this}multiplyParent(t){return Q.multiplyParent(this,t),this}divide(t){return Q.divide(this,t),this}divideParent(t){return Q.divideParent(this,t),this}invert(){return Q.invert(this),this}invertWith(){return Q.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,i){Q.toOuterPoint(this,t,e,i)}toInnerPoint(t,e,i){Q.toInnerPoint(this,t,e,i)}setLayout(t,e,i){return Q.setLayout(this,t,e,i),this}getLayout(t,e,i){return Q.getLayout(this,t,e,i)}withScale(t,e){return Q.withScale(this,t,e)}reset(){Q.reset(this)}}const vt=new mt,wt={tempPointBounds:{},setPoint(t,e,i){t.minX=t.maxX=e,t.minY=t.maxY=i},addPoint(t,e,i){t.minX=e<t.minX?e:t.minX,t.minY=i<t.minY?i:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=i>t.maxY?i:t.maxY},addBounds(t,e,i,s,n){xt(t,e,i),xt(t,e+s,i+n)},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:xt}=wt;var bt,St;!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"}(St||(St={}));const kt=[{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}];kt.forEach(t=>t.type="percent");const Bt={directionData:kt,tempPoint:{},get:Pt,toPoint(t,e,i,s,n,r){const o=Pt(t);i.x=o.x,i.y=o.y,"percent"===o.type&&(i.x*=e.width,i.y*=e.height,n&&(r||(i.x-=n.x,i.y-=n.y),o.x&&(i.x-=1===o.x?n.width:.5===o.x?o.x*n.width:0),o.y&&(i.y-=1===o.y?n.height:.5===o.y?o.y*n.height:0))),s||(i.x+=e.x,i.y+=e.y)},getPoint:(t,e,i,s=!0)=>(i||(i={}),Bt.toPoint(t,e,i,s),i)};function Pt(t){return a(t)?kt[St[t]]:t}const{toPoint:Tt}=Bt,Et={toPoint(t,e,i,s,n,r){Tt(t,i,s,n,e,r)}},{tempPointBounds:Ct,setPoint:Rt,addPoint:Lt,toBounds:Ot}=wt,{toOuterPoint:At}=Q,{float:Dt,fourNumber:Mt}=I,{floor:Ft,ceil:It}=Math;let Wt,Nt,zt,Yt;const Xt={},Ut={},jt={},Ht={tempBounds:jt,set(t,e=0,i=0,s=0,n=0){t.x=e,t.y=i,t.width=s,t.height=n},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,i,s,n){const{x:r,y:o,width:a,height:h}=e;if(u(i)){const e=Mt(i);s?Vt.set(t,r+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):Vt.set(t,r-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else s&&(i=-i),Vt.set(t,r-i,o-i,a+2*i,h+2*i);n&&("width"===n?(t.y=o,t.height=h):(t.x=r,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,i){t.x+=e,t.y+=i},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,i)=>(t=Object.assign({},t),Vt.move(t,e,i),t),toOffsetOutBounds(t,e,i){e?Gt(e,t):e=t,i||(i=t),e.offsetX=Vt.maxX(i),e.offsetY=Vt.maxY(i),Vt.move(e,-e.offsetX,-e.offsetY)},scale(t,e,i=e,s){s||dt.scale(t,e,i),t.width*=e,t.height*=i},scaleOf(t,e,i,s=i){dt.scaleOf(t,e,i,s),t.width*=i,t.height*=s},tempToOuterOf:(t,e)=>(Vt.copy(jt,t),Vt.toOuterOf(jt,e),jt),getOuterOf:(t,e)=>(t=Object.assign({},t),Vt.toOuterOf(t,e),t),toOuterOf(t,e,i){if(i||(i=t),0===e.b&&0===e.c){const{a:s,d:n,e:r,f:o}=e;s>0?(i.width=t.width*s,i.x=r+t.x*s):(i.width=t.width*-s,i.x=r+t.x*s-i.width),n>0?(i.height=t.height*n,i.y=o+t.y*n):(i.height=t.height*-n,i.y=o+t.y*n-i.height)}else Xt.x=t.x,Xt.y=t.y,At(e,Xt,Ut),Rt(Ct,Ut.x,Ut.y),Xt.x=t.x+t.width,At(e,Xt,Ut),Lt(Ct,Ut.x,Ut.y),Xt.y=t.y+t.height,At(e,Xt,Ut),Lt(Ct,Ut.x,Ut.y),Xt.x=t.x,At(e,Xt,Ut),Lt(Ct,Ut.x,Ut.y),Ot(Ct,i)},toInnerOf(t,e,i){i||(i=t),Vt.move(i,-e.e,-e.f),Vt.scale(i,1/e.a,1/e.d)},getFitMatrix(t,e,i=1){const s=Math.min(i,Vt.getFitScale(t,e));return new mt(s,0,0,s,-e.x*s,-e.y*s)},getFitScale(t,e,i){const s=t.width/e.width,n=t.height/e.height;return i?Math.max(s,n):Math.min(s,n)},put(t,e,i="center",s=1,n=!0,r){r||(r=e),a(s)&&(s=Vt.getFitScale(t,e,"cover"===s)),jt.width=n?e.width*=s:e.width*s,jt.height=n?e.height*=s:e.height*s,Et.toPoint(i,jt,t,r,!0,!0)},getSpread(t,e,i){const s={};return Vt.copyAndSpread(s,t,e,!1,i),s},spread(t,e,i){Vt.copyAndSpread(t,t,e,!1,i)},shrink(t,e,i){Vt.copyAndSpread(t,t,e,!0,i)},ceil(t){const{x:e,y:i}=t;t.x=Ft(t.x),t.y=Ft(t.y),t.width=e>t.x?It(t.width+e-t.x):It(t.width),t.height=i>t.y?It(t.height+i-t.y):It(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=Dt(t.x,e),t.y=Dt(t.y,e),t.width=Dt(t.width,e),t.height=Dt(t.height,e)},add(t,e,i){Wt=t.x+t.width,Nt=t.y+t.height,zt=e.x,Yt=e.y,i||(zt+=e.width,Yt+=e.height),Wt=Wt>zt?Wt:zt,Nt=Nt>Yt?Nt:Yt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=Wt-t.x,t.height=Nt-t.y},addList(t,e){Vt.setListWithFn(t,e,void 0,!0)},setList(t,e,i=!1){Vt.setListWithFn(t,e,void 0,i)},addListWithFn(t,e,i){Vt.setListWithFn(t,e,i,!0)},setListWithFn(t,e,i,s=!1){let n,r=!0;for(let o=0,a=e.length;o<a;o++)n=i?i(e[o],o):e[o],n&&(n.width||n.height)&&(r?(r=!1,s||Gt(t,n)):qt(t,n));r&&Vt.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Rt(Ct,t.x,t.y):Lt(Ct,t.x,t.y)),Ot(Ct,t)},setPoint(t,e){Vt.set(t,e.x,e.y)},addPoint(t,e){qt(t,e,!0)},getPoints(t){const{x:e,y:i,width:s,height:n}=t;return[{x:e,y:i},{x:e+s,y:i},{x:e+s,y:i+n},{x:e,y:i+n}]},getPoint:(t,e,i=!1,s)=>Bt.getPoint(e,t,s,i),hitRadiusPoint:(t,e,i)=>(i&&(e=dt.tempToInnerRadiusPointOf(e,i)),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,i)=>(i&&(e=dt.tempToInnerOf(e,i)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,i)=>(i&&(e=Vt.tempToOuterOf(e,i)),!(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,i)=>(i&&(e=Vt.tempToOuterOf(e,i)),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,i){if(i&&(e=Vt.tempToOuterOf(e,i)),!Vt.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:s,y:n,width:r,height:o}=e;return Wt=s+r,Nt=n+o,zt=t.x+t.width,Yt=t.y+t.height,s=s>t.x?s:t.x,n=n>t.y?n:t.y,Wt=Wt<zt?Wt:zt,Nt=Nt<Yt?Nt:Yt,r=Wt-s,o=Nt-n,{x:s,y:n,width:r,height:o}},intersect(t,e,i){Vt.copy(t,Vt.getIntersectData(t,e,i))},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){Vt.set(t)}},Vt=Ht,{add:qt,copy:Gt}=Vt;class Kt{get minX(){return Ht.minX(this)}get minY(){return Ht.minY(this)}get maxX(){return Ht.maxX(this)}get maxY(){return Ht.maxY(this)}constructor(t,e,i,s){this.set(t,e,i,s)}set(t,e,i,s){return _(t)?Ht.copy(this,t):Ht.set(this,t,e,i,s),this}get(){const{x:t,y:e,width:i,height:s}=this;return{x:t,y:e,width:i,height:s}}clone(){return new Kt(this)}move(t,e){return Ht.move(this,t,e),this}scale(t,e,i){return Ht.scale(this,t,e,i),this}scaleOf(t,e,i){return Ht.scaleOf(this,t,e,i),this}toOuterOf(t,e){return Ht.toOuterOf(this,t,e),this}toInnerOf(t,e){return Ht.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Ht.getFitMatrix(this,t,e)}put(t,e,i){Ht.put(this,t,e,i)}spread(t,e){return Ht.spread(this,t,e),this}shrink(t,e){return Ht.shrink(this,t,e),this}ceil(){return Ht.ceil(this),this}unsign(){return Ht.unsign(this),this}float(t){return Ht.float(this,t),this}add(t){return Ht.add(this,t),this}addList(t){return Ht.setList(this,t,!0),this}setList(t){return Ht.setList(this,t),this}addListWithFn(t,e){return Ht.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Ht.setListWithFn(this,t,e),this}setPoint(t){return Ht.setPoint(this,t),this}setPoints(t){return Ht.setPoints(this,t),this}addPoint(t){return Ht.addPoint(this,t),this}getPoints(){return Ht.getPoints(this)}getPoint(t,e,i){return Ht.getPoint(this,t,e,i)}hitPoint(t,e){return Ht.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Ht.hitRadiusPoint(this,t,e)}hit(t,e){return Ht.hit(this,t,e)}includes(t,e){return Ht.includes(this,t,e)}intersect(t,e){return Ht.intersect(this,t,e),this}getIntersect(t,e){return new Kt(Ht.getIntersectData(this,t,e))}isSame(t){return Ht.isSame(this,t)}isEmpty(){return Ht.isEmpty(this)}reset(){Ht.reset(this)}}const $t=new Kt;class Jt{constructor(t,e,i,s,n,r){_(t)?this.copy(t):this.set(t,e,i,s,n,r)}set(t=0,e=0,i=0,s=0,n=0,r=0){this.top=t,this.right=e,this.bottom=i,this.left=s,this.width=n,this.height=r}copy(t){const{top:e,right:i,bottom:s,left:n,width:r,height:o}=t;this.set(e,i,s,n,r,o)}getBoundsFrom(t){const{top:e,right:i,bottom:s,left:n,width:r,height:o}=this;return new Kt(n,e,r||t.width-n-i,o||t.height-e-s)}}const Qt={number:(t,e)=>_(t)?"percent"===t.type?t.value*e:t.value:t},Zt={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,ie={toURL(t,e){let i=encodeURIComponent(t);return"text"===e?i="data:text/plain;charset=utf-8,"+i:"svg"===e&&(i="data:image/svg+xml,"+i),i},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",isLarge:(t,e,i,s)=>t.width*t.height*(e?e*i:1)>(s||se.maxCacheSize),isSuperLarge:(t,e,i)=>se.isLarge(t,e,i,se.maxPatternSize),getRealURL(t){const{prefix:e,suffix:i}=se;return!i||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+i),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,i,s,n,r,o,a,h,l){const d=ee(te(e+(s||0)),1),c=ee(te(i+(n||0)),1);let u,_,p;l&&(p=Qt.number(l.offset,"x"===l.type?e:i))&&("x"===l.type?u=!0:_=!0);const g=ie.origin.createCanvas(_?2*d:d,u?2*c:c),f=g.getContext("2d");if(a&&(f.globalAlpha=a),f.imageSmoothingEnabled=!1!==o,se.canUse(t)){if(r){const s=e/r.width,n=i/r.height;f.setTransform(s,0,0,n,-r.x*s,-r.y*n),f.drawImage(t,0,0,t.width,t.height)}else f.drawImage(t,0,0,e,i);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,i){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}i&&f.stintSet(i,"transform",e)}}},{image:se}=ie,{randColor:ne}=I;class re{constructor(t){this.repeatMap={},this.name=t}static get(t){return new re(t)}static set filter(t){this.filterList=oe(t)}static set exclude(t){this.excludeList=oe(t)}static drawRepaint(t,e){const i=ne();t.fillWorld(e,i.replace("1)",".1)")),t.strokeWorld(e,i)}static drawBounds(t,e,i){const s="hit"===re.showBounds,n=t.__nowWorld,r=ne();s&&(e.setWorld(n),t.__drawHitPath(e),e.fillStyle=r.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(r,2),s?e.stroke():e.strokeWorld(n,r)}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}re.filterList=[],re.excludeList=[],re.showWarn=!0;const ae=re,he=re.get("RunTime"),le={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const i=v.create(v.RUNTIME);return de.currentId=de.idMap[i]=e?performance.now():Date.now(),de.currentName=de.nameMap[i]=t,de.nameToIdMap[t]=i,i},end(t,e){const i=de.idMap[t],s=de.nameMap[t],n=e?(performance.now()-i)/1e3:Date.now()-i;de.idMap[t]=de.nameMap[t]=de.nameToIdMap[s]=void 0,he.log(s,n,"ms")},endOfName(t,e){const i=de.nameToIdMap[t];r(i)||de.end(i,e)}},de=le,ce=[],ue={list:{},add(t,...e){this.list[t]=!0,ce.push(...e)},has(t,e){const i=this.list[t];return!i&&e&&this.need(t),i},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=re.get("UICreator"),ge={list:{},register(t){const{__tag:e}=t.prototype;fe[e]&&pe.repeat(e),fe[e]=t},get(t,e,i,s,n,o){if(!fe[t])return void pe.warn("not register "+t);const a=new fe[t](e);return r(i)||(a.x=i,s&&(a.y=s),n&&(a.width=n),o&&(a.height=o)),a}},{list:fe}=ge,ye=re.get("EventCreator"),me={nameList:{},register(t){let e;Object.keys(t).forEach(i=>{e=t[i],a(e)&&(ve[e]&&ye.repeat(e),ve[e]=t)})},changeName(t,e){const i=ve[t];if(i){const s=Object.keys(i).find(e=>i[e]===t);s&&(i[s]=e,ve[e]=i)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new ve[t](...e)},{nameList:ve}=me;class we{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:i}=this;for(let s=0,n=i.length;s<n;s++)if(e=i[s],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const s=_e.canvas(t);return this.add(s),s}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let i=0,s=this.list.length;i<s;i++)t=this.list[i],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 xe(t){return(e,i)=>{t||(t=i);const s={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===i&&(s.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,i,s)}}const be=[];function Se(){return(t,e)=>{be.push(e)}}const ke=[];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||ke)}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,i,s,n,r){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,i,s,n,r){_(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,i,s,n,r)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,i,s){}strokeRect(t,e,i,s){}clearRect(t,e,i,s){}drawImage(t,e,i,s,n,r,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/s*a;s+=e,e=0,r+=t,a-=t}if(i<0){const t=-i/n*h;n+=i,i=0,o+=t,h-=t}this.context.drawImage(t,e,i,s,n,r,o,a,h);break;case 5:this.context.drawImage(t,e,i,s,n);break;case 3:this.context.drawImage(t,e,i)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,i,s,n,r){}quadraticCurveTo(t,e,i,s){}closePath(){}arc(t,e,i,s,n,r){}arcTo(t,e,i,s,n){}ellipse(t,e,i,s,n,r,o,a){}rect(t,e,i,s){}roundRect(t,e,i,s,n){}createConicGradient(t,e,i){}createLinearGradient(t,e,i,s){}createPattern(t,e){}createRadialGradient(t,e,i,s,n,r){}fillText(t,e,i,s){}measureText(t){}strokeText(t,e,i,s){}destroy(){this.context=null}};i([xe("imageSmoothingEnabled")],Be.prototype,"smooth",void 0),i([xe("imageSmoothingQuality")],Be.prototype,"smoothLevel",void 0),i([xe("globalAlpha")],Be.prototype,"opacity",void 0),i([xe()],Be.prototype,"fillStyle",void 0),i([xe()],Be.prototype,"strokeStyle",void 0),i([xe("lineWidth")],Be.prototype,"strokeWidth",void 0),i([xe("lineCap")],Be.prototype,"strokeCap",void 0),i([xe("lineJoin")],Be.prototype,"strokeJoin",void 0),i([xe("lineDashOffset")],Be.prototype,"dashOffset",void 0),i([xe()],Be.prototype,"miterLimit",void 0),i([xe()],Be.prototype,"shadowBlur",void 0),i([xe()],Be.prototype,"shadowColor",void 0),i([xe()],Be.prototype,"shadowOffsetX",void 0),i([xe()],Be.prototype,"shadowOffsetY",void 0),i([xe()],Be.prototype,"filter",void 0),i([xe()],Be.prototype,"font",void 0),i([xe()],Be.prototype,"fontKerning",void 0),i([xe()],Be.prototype,"fontStretch",void 0),i([xe()],Be.prototype,"fontVariantCaps",void 0),i([xe()],Be.prototype,"textAlign",void 0),i([xe()],Be.prototype,"textBaseline",void 0),i([xe()],Be.prototype,"textRendering",void 0),i([xe()],Be.prototype,"wordSpacing",void 0),i([xe()],Be.prototype,"letterSpacing",void 0),i([xe()],Be.prototype,"direction",void 0),i([Se()],Be.prototype,"setTransform",null),i([Se()],Be.prototype,"resetTransform",null),i([Se()],Be.prototype,"getTransform",null),i([Se()],Be.prototype,"save",null),i([Se()],Be.prototype,"restore",null),i([Se()],Be.prototype,"translate",null),i([Se()],Be.prototype,"scale",null),i([Se()],Be.prototype,"rotate",null),i([Se()],Be.prototype,"fill",null),i([Se()],Be.prototype,"stroke",null),i([Se()],Be.prototype,"clip",null),i([Se()],Be.prototype,"fillRect",null),i([Se()],Be.prototype,"strokeRect",null),i([Se()],Be.prototype,"clearRect",null),i([Se()],Be.prototype,"beginPath",null),i([Se()],Be.prototype,"moveTo",null),i([Se()],Be.prototype,"lineTo",null),i([Se()],Be.prototype,"bezierCurveTo",null),i([Se()],Be.prototype,"quadraticCurveTo",null),i([Se()],Be.prototype,"closePath",null),i([Se()],Be.prototype,"arc",null),i([Se()],Be.prototype,"arcTo",null),i([Se()],Be.prototype,"ellipse",null),i([Se()],Be.prototype,"rect",null),i([Se()],Be.prototype,"roundRect",null),i([Se()],Be.prototype,"createConicGradient",null),i([Se()],Be.prototype,"createLinearGradient",null),i([Se()],Be.prototype,"createPattern",null),i([Se()],Be.prototype,"createRadialGradient",null),i([Se()],Be.prototype,"fillText",null),i([Se()],Be.prototype,"measureText",null),i([Se()],Be.prototype,"strokeText",null);const{copy:Pe,multiplyParent:Te,pixelScale:Ee}=Q,{round:Ce}=Math,Re=new Kt,Le=new Kt,Oe={width:1,height:1,pixelRatio:1},Ae=["width","height","pixelRatio"];class De 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=Oe),this.manager=e,this.innerId=v.create(v.CNAVAS);const{width:i,height:s,pixelRatio:n}=t;this.autoLayout=!i||!s,this.size.pixelRatio=n||ie.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 i;this.context&&!this.unreal&&e&&this.width&&(i=this.getSameCanvas(),i.copyWorld(this));const s=this.size;f.copyAttrs(s,t,Ae),Ae.forEach(t=>s[t]||(s[t]=1)),this.bounds=new Kt(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&i&&(this.clearWorld(i.bounds),this.copyWorld(i),i.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:i,pixelSnap:s}=this,n=this.worldTransform;e&&Te(t,e,n),Ee(t,i,n),s&&!t.ignorePixelSnap&&(t.half&&t.half*i%2?(n.e=Ce(n.e-.5)+.5,n.f=Ce(n.f-.5)+.5):(n.e=Ce(n.e),n.f=Ce(n.f))),this.setTransform(n.a,n.b,n.c,n.d,n.e,n.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,i,s){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),i&&this.setStrokeOptions(i,s)}setStrokeOptions(t,e){let{strokeCap:i,strokeJoin:s,dashPattern:n,dashOffset:o,miterLimit:a}=t;e&&(e.strokeCap&&(i=e.strokeCap),e.strokeJoin&&(s=e.strokeJoin),r(e.dashPattern)||(n=e.dashPattern),r(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=i,this.strokeJoin=s,this.dashPattern=n,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,i=1){return!0}setWorldShadow(t,e,i,s){const{pixelRatio:n}=this;this.shadowOffsetX=t*n,this.shadowOffsetY=e*n,this.shadowBlur=i*n,this.shadowColor=s||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,i,s,n){s&&(this.blendMode=s),e?(this.setTempPixelBounds(e,n),i?(this.setTempPixelBounds2(i,n),i=Le):i=Re,this.drawImage(t.view,Re.x,Re.y,Re.width,Re.height,i.x,i.y,i.width,i.height)):this.drawImage(t.view,0,0),s&&(this.blendMode="source-over")}copyWorldToInner(t,e,i,s,n){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Ht.tempToOuterOf(i,e),s,n),this.restore()):(s&&(this.blendMode=s),this.setTempPixelBounds(e,n),this.drawImage(t.view,Re.x,Re.y,Re.width,Re.height,i.x,i.y,i.width,i.height),s&&(this.blendMode="source-over"))}copyWorldByReset(t,e,i,s,n,r){this.resetTransform(),this.copyWorld(t,e,i,s,r),n||this.useWorldTransform()}useGrayscaleAlpha(t){let e,i;this.setTempPixelBounds(t,!0,!0);const{context:s}=this,n=s.getImageData(Re.x,Re.y,Re.width,Re.height),{data:r}=n;for(let t=0,s=r.length;t<s;t+=4)i=.299*r[t]+.587*r[t+1]+.114*r[t+2],(e=r[t+3])&&(r[t+3]=255===e?i:e*(i/255));s.putImageData(n,Re.x,Re.y)}useMask(t,e,i){this.copyWorld(t,e,i,"destination-in")}useEraser(t,e,i){this.copyWorld(t,e,i,"destination-out")}fillWorld(t,e,i,s){i&&(this.blendMode=i),this.fillStyle=e,this.setTempPixelBounds(t,s),this.fillRect(Re.x,Re.y,Re.width,Re.height),i&&(this.blendMode="source-over")}strokeWorld(t,e,i,s){i&&(this.blendMode=i),this.strokeStyle=e,this.setTempPixelBounds(t,s),this.strokeRect(Re.x,Re.y,Re.width,Re.height),i&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Re.x,Re.y,Re.width,Re.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Re.x,Re.y,Re.width,Re.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,i){this.copyToPixelBounds(Re,t,e,i)}setTempPixelBounds2(t,e,i){this.copyToPixelBounds(Le,t,e,i)}copyToPixelBounds(t,e,i,s){t.set(e),s&&t.intersect(this.bounds),t.scale(this.pixelRatio),i&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:i,pixelSnap:s}=this,n=this.manager?this.manager.get(i):_e.canvas(Object.assign({},i));return n.save(),t&&(Pe(n.worldTransform,this.worldTransform),n.useWorldTransform()),e&&(n.smooth=this.smooth),n.pixelSnap!==s&&(n.pixelSnap=s),n}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){}},Fe={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Ie=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},Fe),We={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},Ne={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},ze=Object.assign(Object.assign({},Ne),Fe),Ye=Ie,Xe={};for(let t in Ye)Xe[Ye[t]]=t;const Ue={};for(let t in Ye)Ue[Ye[t]]=We[t];const je={drawRoundRect(t,e,i,s,n,r){const o=I.fourNumber(r,Math.min(s/2,n/2)),a=e+s,h=i+n;o[0]?t.moveTo(e+o[0],i):t.moveTo(e,i),o[1]?t.arcTo(a,i,a,h,o[1]):t.lineTo(a,i),o[2]?t.arcTo(a,h,e,h,o[2]):t.lineTo(a,h),o[3]?t.arcTo(e,h,e,i,o[3]):t.lineTo(e,h),o[0]?t.arcTo(e,i,a,i,o[0]):t.lineTo(e,i)}},{sin:He,cos:Ve,hypot:qe,atan2:Ge,ceil:Ke,abs:$e,PI:Je,sqrt:Qe,pow:Ze}=Math,{setPoint:ti,addPoint:ei}=wt,{set:ii,toNumberPoints:si}=dt,{M:ni,L:ri,C:oi,Q:ai,Z:hi}=Ie,li={},di={points(t,e,i,s){let n=si(e);if(t.push(ni,n[0],n[1]),i&&n.length>5){let e,r,o,a,h,l,d,c,u,_,p,g,f,y,m,v=n.length;const w=!0===i?.5:i;s&&(n=[n[v-2],n[v-1],...n,n[0],n[1],n[2],n[3]],v=n.length);for(let i=2;i<v-2;i+=2)e=n[i-2],r=n[i-1],o=n[i],a=n[i+1],h=n[i+2],l=n[i+3],p=o-e,g=a-r,f=Qe(Ze(p,2)+Ze(g,2)),y=Qe(Ze(h-o,2)+Ze(l-a,2)),(f||y)&&(m=f+y,f=w*f/m,y=w*y/m,h-=e,l-=r,d=o-f*h,c=a-f*l,2===i?s||t.push(ai,d,c,o,a):(p||g)&&t.push(oi,u,_,d,c,o,a),u=o+y*h,_=a+y*l);s||t.push(ai,u,_,n[v-2],n[v-1])}else for(let e=2,i=n.length;e<i;e+=2)t.push(ri,n[e],n[e+1]);s&&t.push(hi)},rect(t,e,i,s,n){Me.creator.path=t,Me.creator.moveTo(e,i).lineTo(e+s,i).lineTo(e+s,i+n).lineTo(e,i+n).lineTo(e,i)},roundRect(t,e,i,s,n,r){Me.creator.path=[],je.drawRoundRect(Me.creator,e,i,s,n,r),t.push(...Me.convertToCanvasData(Me.creator.path,!0))},arcTo(t,e,i,s,n,r,o,a,h,l,d){const c=s-e,u=n-i,_=r-s,p=o-n;let g=Ge(u,c),f=Ge(p,_);const y=qe(c,u),m=qe(_,p);let v=f-g;if(v<0&&(v+=z),y<1e-12||m<1e-12||v<1e-12||$e(v-Je)<1e-12)return t&&t.push(ri,s,n),h&&(ti(h,e,i),ei(h,s,n)),d&&ii(d,e,i),void(l&&ii(l,s,n));const w=c*p-_*u<0,x=w?-1:1,b=a/Ve(v/2),S=s+b*Ve(g+v/2+Y*x),k=n+b*He(g+v/2+Y*x);return g-=Y*x,f-=Y*x,_i(t,S,k,a,a,0,g/N,f/N,w,h,l,d)},arc:(t,e,i,s,n,r,o,a,h,l)=>_i(t,e,i,s,s,0,n,r,o,a,h,l),ellipse(t,e,i,s,n,r,o,a,h,l,d,c){const u=r*N,_=He(u),p=Ve(u);let g=o*N,f=a*N;g>Je&&(g-=z),f<0&&(f+=z);let y=f-g;y<0?y+=z:y>z&&(y-=z),h&&(y-=z);const m=Ke($e(y/Y)),v=y/m,w=He(v/4),x=8/3*w*w/He(v/2);f=g+v;let b,S,k,B,P,T,E,C,R=Ve(g),L=He(g),O=k=p*s*R-_*n*L,A=B=_*s*R+p*n*L,D=e+k,M=i+B;t&&t.push(t.length?ri:ni,D,M),l&&ti(l,D,M),c&&ii(c,D,M);for(let r=0;r<m;r++)b=Ve(f),S=He(f),k=p*s*b-_*n*S,B=_*s*b+p*n*S,P=e+O-x*(p*s*L+_*n*R),T=i+A-x*(_*s*L-p*n*R),E=e+k+x*(p*s*S+_*n*b),C=i+B+x*(_*s*S-p*n*b),t&&t.push(oi,P,T,E,C,e+k,i+B),l&&ui(e+O,i+A,P,T,E,C,e+k,i+B,l,!0),O=k,A=B,R=b,L=S,g=f,f+=v;d&&ii(d,e+k,i+B)},quadraticCurveTo(t,e,i,s,n,r,o){t.push(oi,(e+2*s)/3,(i+2*n)/3,(r+2*s)/3,(o+2*n)/3,r,o)},toTwoPointBoundsByQuadraticCurve(t,e,i,s,n,r,o,a){ui(t,e,(t+2*i)/3,(e+2*s)/3,(n+2*i)/3,(r+2*s)/3,n,r,o,a)},toTwoPointBounds(t,e,i,s,n,r,o,a,h,l){const d=[];let c,u,_,p,g,f,y,m,v=t,w=i,x=n,b=o;for(let t=0;t<2;++t)if(1==t&&(v=e,w=s,x=r,b=a),c=-3*v+9*w-9*x+3*b,u=6*v-12*w+6*x,_=3*w-3*v,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?ei(h,t,e):ti(h,t,e),ei(h,o,a);for(let l=0,c=d.length;l<c;l++)ci(d[l],t,e,i,s,n,r,o,a,li),ei(h,li.x,li.y)},getPointAndSet(t,e,i,s,n,r,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*s+_*r+p*a,l.y=c*i+u*n+_*o+p*h},getPoint(t,e,i,s,n,r,o,a,h){const l={};return ci(t,e,i,s,n,r,o,a,h,l),l},getDerivative(t,e,i,s,n){const r=1-t;return 3*r*r*(i-e)+6*r*t*(s-i)+3*t*t*(n-s)}},{getPointAndSet:ci,toTwoPointBounds:ui,ellipse:_i}=di,{sin:pi,cos:gi,sqrt:fi,atan2:yi}=Math,{ellipse:mi}=di,vi={ellipticalArc(t,e,i,s,n,r,o,a,h,l,d){const c=(h-e)/2,u=(l-i)/2,_=r*N,p=pi(_),g=gi(_),f=-g*c-p*u,y=-g*u+p*c,m=s*s,v=n*n,w=y*y,x=f*f,b=m*v-m*w-v*x;let S=0;if(b<0){const t=fi(1-b/(m*v));s*=t,n*=t}else S=(o===a?-1:1)*fi(b/(m*w+v*x));const k=S*s*y/n,B=-S*n*f/s,P=yi((y-B)/n,(f-k)/s),T=yi((-y-B)/n,(-f-k)/s);let E=T-P;0===a&&E>0?E-=z:1===a&&E<0&&(E+=z);const C=e+c+g*k-p*B,R=i+u+p*k+g*B,L=E<0?1:0;d||ie.ellipseToCurve?mi(t,C,R,s,n,r,P/N,T/N,L):s!==n||r?t.push(Ie.G,C,R,s,n,r,P/N,T/N,L):t.push(Ie.O,C,R,s,P/N,T/N,L)}},wi={toCommand:t=>[],toNode:t=>[]},{M:xi,m:bi,L:Si,l:ki,H:Bi,h:Pi,V:Ti,v:Ei,C:Ci,c:Ri,S:Li,s:Oi,Q:Ai,q:Di,T:Mi,t:Fi,A:Ii,a:Wi,Z:Ni,z:zi,N:Yi,D:Xi,X:Ui,G:ji,F:Hi,O:Vi,P:qi,U:Gi}=Ie,{rect:Ki,roundRect:$i,arcTo:Ji,arc:Qi,ellipse:Zi,quadraticCurveTo:ts}=di,{ellipticalArc:es}=vi,is=re.get("PathConvert"),ss={},ns={current:{dot:0},stringify(t,e){let i,s,n,r=0,o=t.length,a="";for(;r<o;){s=t[r],i=Ue[s],a+=s===n?" ":Xe[s];for(let s=1;s<i;s++)a+=I.float(t[r+s],e),s===i-1||(a+=" ");n=s,r+=i}return a},parse(t,e){let i,s,n,r="";const o=[],a=e?ze:Ne;for(let e=0,h=t.length;e<h;e++)s=t[e],Zt[s]?("."===s&&(rs.dot&&(os(o,r),r=""),rs.dot++),"0"===r&&"."!==s&&(os(o,r),r=""),r+=s):Ie[s]?(r&&(os(o,r),r=""),rs.name=Ie[s],rs.length=We[s],rs.index=0,os(o,rs.name),!i&&a[s]&&(i=!0)):"-"===s||"+"===s?"e"===n||"E"===n?r+=s:(r&&os(o,r),r=s):r&&(os(o,r),r=""),n=s;return r&&os(o,r),i?ns.toCanvasData(o,e):o},toCanvasData(t,e){let i,s,n,r,o,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(n=t[c],n){case bi:t[c+1]+=a,t[c+2]+=h;case xi:a=t[c+1],h=t[c+2],_.push(xi,a,h),c+=3;break;case Pi:t[c+1]+=a;case Bi:a=t[c+1],_.push(Si,a,h),c+=2;break;case Ei:t[c+1]+=h;case Ti:h=t[c+1],_.push(Si,a,h),c+=2;break;case ki:t[c+1]+=a,t[c+2]+=h;case Si:a=t[c+1],h=t[c+2],_.push(Si,a,h),c+=3;break;case Oi:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,n=Li;case Li:o=r===Ci||r===Li,l=o?2*a-i:t[c+1],d=o?2*h-s:t[c+2],i=t[c+1],s=t[c+2],a=t[c+3],h=t[c+4],_.push(Ci,l,d,i,s,a,h),c+=5;break;case Ri:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,t[c+5]+=a,t[c+6]+=h,n=Ci;case Ci:i=t[c+3],s=t[c+4],a=t[c+5],h=t[c+6],_.push(Ci,t[c+1],t[c+2],i,s,a,h),c+=7;break;case Fi:t[c+1]+=a,t[c+2]+=h,n=Mi;case Mi:o=r===Ai||r===Mi,i=o?2*a-i:t[c+1],s=o?2*h-s:t[c+2],e?ts(_,a,h,i,s,t[c+1],t[c+2]):_.push(Ai,i,s,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case Di:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,n=Ai;case Ai:i=t[c+1],s=t[c+2],e?ts(_,a,h,i,s,t[c+3],t[c+4]):_.push(Ai,i,s,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case Wi:t[c+6]+=a,t[c+7]+=h;case Ii:es(_,a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],e),a=t[c+6],h=t[c+7],c+=8;break;case zi:case Ni:_.push(Ni),c++;break;case Yi:a=t[c+1],h=t[c+2],e?Ki(_,a,h,t[c+3],t[c+4]):as(_,t,c,5),c+=5;break;case Xi:a=t[c+1],h=t[c+2],e?$i(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):as(_,t,c,9),c+=9;break;case Ui:a=t[c+1],h=t[c+2],e?$i(_,a,h,t[c+3],t[c+4],t[c+5]):as(_,t,c,6),c+=6;break;case ji:Zi(e?_:as(_,t,c,9),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],t[c+8],null,ss),a=ss.x,h=ss.y,c+=9;break;case Hi:e?Zi(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):as(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case Vi:Qi(e?_:as(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,ss),a=ss.x,h=ss.y,c+=7;break;case qi:e?Qi(_,t[c+1],t[c+2],t[c+3],0,360,!1):as(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case Gi:Ji(e?_:as(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,ss),a=ss.x,h=ss.y,c+=6;break;default:return is.error(`command: ${n} [index:${c}]`,t),_}r=n}return _},objectToCanvasData(t){if(t[0].name.length>1)return wi.toCommand(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(xi,t.x,t.y);break;case"L":e.push(Si,t.x,t.y);break;case"C":e.push(Ci,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Ai,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(Ni)}}),e}},copyData(t,e,i,s){for(let n=i,r=i+s;n<r;n++)t.push(e[n])},pushData(t,e){rs.index===rs.length&&(rs.index=1,t.push(rs.name)),t.push(Number(e)),rs.index++,rs.dot=0}},{current:rs,pushData:os,copyData:as}=ns,{M:hs,L:ls,C:ds,Q:cs,Z:us,N:_s,D:ps,X:gs,G:fs,F:ys,O:ms,P:vs,U:ws}=Ie,{getMinDistanceFrom:xs,getRadianFrom:bs}=dt,{tan:Ss,min:ks,abs:Bs}=Math,Ps={},Ts={beginPath(t){t.length=0},moveTo(t,e,i){t.push(hs,e,i)},lineTo(t,e,i){t.push(ls,e,i)},bezierCurveTo(t,e,i,s,n,r,o){t.push(ds,e,i,s,n,r,o)},quadraticCurveTo(t,e,i,s,n){t.push(cs,e,i,s,n)},closePath(t){t.push(us)},rect(t,e,i,s,n){t.push(_s,e,i,s,n)},roundRect(t,e,i,s,n,r){if(l(r))t.push(gs,e,i,s,n,r);else{const o=I.fourNumber(r);o?t.push(ps,e,i,s,n,...o):t.push(_s,e,i,s,n)}},ellipse(t,e,i,s,n,r,a,h,l){if(s===n)return Cs(t,e,i,s,a,h,l);o(r)?t.push(ys,e,i,s,n):(o(a)&&(a=0),o(h)&&(h=360),t.push(fs,e,i,s,n,r,a,h,l?1:0))},arc(t,e,i,s,n,r,a){o(n)?t.push(vs,e,i,s):(o(n)&&(n=0),o(r)&&(r=360),t.push(ms,e,i,s,n,r,a?1:0))},arcTo(t,e,i,s,n,o,a,h,l){if(!r(a)){const t=xs(a,h,e,i,s,n)/(l?1:2);o=ks(o,ks(t,t*Bs(Ss(bs(a,h,e,i,s,n)/2))))}t.push(ws,e,i,s,n,o)},drawEllipse(t,e,i,s,n,r,a,h,l){di.ellipse(null,e,i,s,n,o(r)?0:r,o(a)?0:a,o(h)?360:h,l,null,null,Ps),t.push(hs,Ps.x,Ps.y),Es(t,e,i,s,n,r,a,h,l)},drawArc(t,e,i,s,n,r,a){di.arc(null,e,i,s,o(n)?0:n,o(r)?360:r,a,null,null,Ps),t.push(hs,Ps.x,Ps.y),Cs(t,e,i,s,n,r,a)},drawPoints(t,e,i,s){di.points(t,e,i,s)}},{ellipse:Es,arc:Cs}=Ts,{moveTo:Rs,lineTo:Ls,quadraticCurveTo:Os,bezierCurveTo:As,closePath:Ds,beginPath:Ms,rect:Fs,roundRect:Is,ellipse:Ws,arc:Ns,arcTo:zs,drawEllipse:Ys,drawArc:Xs,drawPoints:Us}=Ts;class js{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 Ms(this.__path),this.paint(),this}moveTo(t,e){return Rs(this.__path,t,e),this.paint(),this}lineTo(t,e){return Ls(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,i,s,n,r){return As(this.__path,t,e,i,s,n,r),this.paint(),this}quadraticCurveTo(t,e,i,s){return Os(this.__path,t,e,i,s),this.paint(),this}closePath(){return Ds(this.__path),this.paint(),this}rect(t,e,i,s){return Fs(this.__path,t,e,i,s),this.paint(),this}roundRect(t,e,i,s,n){return Is(this.__path,t,e,i,s,n),this.paint(),this}ellipse(t,e,i,s,n,r,o,a){return Ws(this.__path,t,e,i,s,n,r,o,a),this.paint(),this}arc(t,e,i,s,n,r){return Ns(this.__path,t,e,i,s,n,r),this.paint(),this}arcTo(t,e,i,s,n){return zs(this.__path,t,e,i,s,n),this.paint(),this}drawEllipse(t,e,i,s,n,r,o,a){return Ys(this.__path,t,e,i,s,n,r,o,a),this.paint(),this}drawArc(t,e,i,s,n,r){return Xs(this.__path,t,e,i,s,n,r),this.paint(),this}drawPoints(t,e,i){return Us(this.__path,t,e,i),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:Hs,L:Vs,C:qs,Q:Gs,Z:Ks,N:$s,D:Js,X:Qs,G:Zs,F:tn,O:en,P:sn,U:nn}=Ie,rn=re.get("PathDrawer"),on={drawPathByData(t,e){if(!e)return;let i,s=0,n=e.length;for(;s<n;)switch(i=e[s],i){case Hs:t.moveTo(e[s+1],e[s+2]),s+=3;break;case Vs:t.lineTo(e[s+1],e[s+2]),s+=3;break;case qs:t.bezierCurveTo(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5],e[s+6]),s+=7;break;case Gs:t.quadraticCurveTo(e[s+1],e[s+2],e[s+3],e[s+4]),s+=5;break;case Ks:t.closePath(),s+=1;break;case $s:t.rect(e[s+1],e[s+2],e[s+3],e[s+4]),s+=5;break;case Js:t.roundRect(e[s+1],e[s+2],e[s+3],e[s+4],[e[s+5],e[s+6],e[s+7],e[s+8]]),s+=9;break;case Qs:t.roundRect(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]),s+=6;break;case Zs:t.ellipse(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]*N,e[s+6]*N,e[s+7]*N,e[s+8]),s+=9;break;case tn:t.ellipse(e[s+1],e[s+2],e[s+3],e[s+4],0,0,z,!1),s+=5;break;case en:t.arc(e[s+1],e[s+2],e[s+3],e[s+4]*N,e[s+5]*N,e[s+6]),s+=7;break;case sn:t.arc(e[s+1],e[s+2],e[s+3],0,z,!1),s+=4;break;case nn:t.arcTo(e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]),s+=6;break;default:return void rn.error(`command: ${i} [index:${s}]`,e)}}},{M:an,L:hn,C:ln,Q:dn,Z:cn,N:un,D:_n,X:pn,G:gn,F:fn,O:yn,P:mn,U:vn}=Ie,{toTwoPointBounds:wn,toTwoPointBoundsByQuadraticCurve:xn,arcTo:bn,arc:Sn,ellipse:kn}=di,{addPointBounds:Bn,copy:Pn,addPoint:Tn,setPoint:En,addBounds:Cn,toBounds:Rn}=wt,Ln=re.get("PathBounds");let On,An,Dn;const Mn={},Fn={},In={},Wn={toBounds(t,e){Wn.toTwoPointBounds(t,Fn),Rn(Fn,e)},toTwoPointBounds(t,e){if(!t||!t.length)return En(e,0,0);let i,s,n,r,o,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(o=t[a],0===a&&(o===cn||o===ln||o===dn?En(e,h,l):En(e,t[a+1],t[a+2])),o){case an:case hn:h=t[a+1],l=t[a+2],Tn(e,h,l),a+=3;break;case ln:n=t[a+5],r=t[a+6],wn(h,l,t[a+1],t[a+2],t[a+3],t[a+4],n,r,Mn),Bn(e,Mn),h=n,l=r,a+=7;break;case dn:i=t[a+1],s=t[a+2],n=t[a+3],r=t[a+4],xn(h,l,i,s,n,r,Mn),Bn(e,Mn),h=n,l=r,a+=5;break;case cn:a+=1;break;case un:h=t[a+1],l=t[a+2],Cn(e,h,l,t[a+3],t[a+4]),a+=5;break;case _n:case pn:h=t[a+1],l=t[a+2],Cn(e,h,l,t[a+3],t[a+4]),a+=o===_n?9:6;break;case gn:kn(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],Mn,In),0===a?Pn(e,Mn):Bn(e,Mn),h=In.x,l=In.y,a+=9;break;case fn:h=t[a+1],l=t[a+2],An=t[a+3],Dn=t[a+4],Cn(e,h-An,l-Dn,2*An,2*Dn),h+=An,a+=5;break;case yn:Sn(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Mn,In),0===a?Pn(e,Mn):Bn(e,Mn),h=In.x,l=In.y,a+=7;break;case mn:h=t[a+1],l=t[a+2],On=t[a+3],Cn(e,h-On,l-On,2*On,2*On),h+=On,a+=4;break;case vn:bn(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Mn,In),0===a?Pn(e,Mn):Bn(e,Mn),h=In.x,l=In.y,a+=6;break;default:return void Ln.error(`command: ${o} [index:${a}]`,t)}}},{M:Nn,L:zn,Z:Yn}=Ie,{getCenterX:Xn,getCenterY:Un}=dt,{arcTo:jn}=Ts,Hn={smooth(t,e,i){let s,n,r,o=0,a=0,h=0,l=0,d=0,c=0,_=0,p=0,g=0;u(e)&&(e=e[0]||0);const f=t.length,y=9===f,m=[];for(;o<f;){switch(s=t[o],s){case Nn:l=p=t[o+1],d=g=t[o+2],o+=3,t[o]===zn?(c=t[o+1],_=t[o+2],y?m.push(Nn,l,d):m.push(Nn,Xn(l,c),Un(d,_))):m.push(Nn,l,d);break;case zn:switch(a=t[o+1],h=t[o+2],o+=3,t[o]){case zn:jn(m,a,h,t[o+1],t[o+2],e,p,g,y);break;case Yn:jn(m,a,h,l,d,e,p,g,y);break;default:m.push(zn,a,h)}p=a,g=h;break;case Yn:n!==Yn&&(jn(m,l,d,c,_,e,p,g,y),m.push(Yn)),o+=1;break;default:r=Ue[s];for(let e=0;e<r;e++)m.push(t[o+e]);o+=r}n=s}return s!==Yn&&(m[1]=l,m[2]=d),m}};function Vn(t){return new js(t)}const qn=Vn();Me.creator=Vn(),Me.parse=ns.parse,Me.convertToCanvasData=ns.toCanvasData;const{drawRoundRect:Gn}=je;function Kn(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,i,s,n){Gn(this,t,e,i,s,n)})}(t)}const $n={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=Jn.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{}}}},Jn=$n;Jn.mineType=Jn.mimeType,Jn.alphaPixelTypes.forEach(t=>Jn.upperCaseTypeMap[t]=t.toUpperCase());const Qn=re.get("TaskProcessor");class Zn{constructor(t){this.parallel=!0,this.time=1,this.id=v.create(v.TASK),this.task=t}run(){return s(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){Qn.error(t)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}}class tr{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,i=0;for(let s=0;s<t;s++)s<=this.finishedIndex?(i+=this.list[s].time,s===this.finishedIndex&&(e=i)):e+=this.list[s].time;return this.isComplete?1:i/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,i){let s,n,o,a;const h=new Zn(t);return h.parent=this,l(e)?a=e:e&&(n=e.parallel,s=e.start,o=e.time,a=e.delay,i||(i=e.canUse)),o&&(h.time=o),!1===n&&(h.parallel=!1),i&&(h.canUse=i),r(a)?this.push(h,s):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(h,s))},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:i,index:s}=this;this.parallelList=[],this.parallelSuccessNumber=0;let n=s+e.parallel;if(n>i.length&&(n=i.length),e.parallel>1)for(let e=s;e<n&&(t=i[e],t.parallel);e++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const i=e.length,s=this.finishedIndex+i;if(e.length){if(!this.running)return;s<this.total&&(t=this.list[s],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 er=re.get("Resource"),ir={tasker:new tr,queue:new tr({parallel:1}),map:{},get isComplete(){return sr.tasker.isComplete},set(t,e){sr.map[t]&&er.repeat(t),sr.map[t]=e},get:t=>sr.map[t],remove(t){const e=sr.map[t];e&&(e.destroy&&e.destroy(),delete sr.map[t])},loadImage(t,e){return new Promise((i,s)=>{const n=this.setImage(t,t,e);n.load(()=>i(n),t=>s(t))})},setImage(t,e,i){let s;return a(e)?s={url:e}:e.url||(s={url:t,view:e}),s&&(i&&(s.format=i),e=_e.image(s)),sr.set(t,e),e},loadFilm(t,e){},loadVideo(t,e){},destroy(){sr.map={}}},sr=ir,nr={maxRecycled:10,recycledList:[],patternTasker:ir.queue,get(t,e){let i=ir.get(t.url);return i||ir.set(t.url,i="film"===e?_e.film(t):_e.image(t)),i.use++,i},recycle(t){t.parent&&(t=t.parent),t.use--,setTimeout(()=>{t.use||(ie.image.isLarge(t)?t.url&&ir.remove(t.url):(t.clearLevels(),rr.recycledList.push(t)))})},recyclePaint(t){rr.recycle(t.image)},clearRecycled(t){const e=rr.recycledList;(e.length>rr.maxRecycled||t)&&(e.forEach(e=>(!e.use||t)&&e.url&&ir.remove(e.url)),e.length=0)},clearLevels(){},hasAlphaPixel:t=>$n.alphaPixelTypes.some(e=>rr.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:i}=e;if(i.startsWith("data:")){if(i.startsWith("data:"+$n.mimeType(t)))return!0}else{if(i.includes("."+t)||i.includes("."+$n.upperCaseTypeMap[t]))return!0;if("png"===t&&!i.includes("."))return!0}return!1},destroy(){this.clearRecycled(!0)}},rr=nr,{IMAGE:or,create:ar}=v;class hr{get tag(){return"Image"}get url(){return this.config.url}get crossOrigin(){const{crossOrigin:t}=this.config;return r(t)?ie.image.crossOrigin:t}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=ar(or),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}nr.isFormat("svg",t)&&(this.isSVG=!0),nr.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e,i){return this.loading||(this.loading=!0,ir.tasker.add(()=>s(this,void 0,void 0,function*(){return yield ie.origin["load"+this.tag](this.getLoadUrl(i),this.crossOrigin,this).then(t=>{i&&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 i=this.waitComplete;if(e){const e=i[t+1];e&&e({type:"stop"})}i[t]=i[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((i,s)=>{e=s%2,i&&(t?e||i(this):e&&i(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,i,s,n,r,o,a){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let i in t)if(t[i]!==arguments[i]){e=null;break}if(e)return e}const h=ie.image.resize(this.view,t,e,n,r,void 0,o,i,s,a);return this.cache=this.use>1?{data:h,params:arguments}:null,h}getPattern(t,e,i,s){const n=ie.canvas.createPattern(t,e);return ie.image.setPatternTransform(n,i,s),n}render(t,e,i,s,n,r,o,a,h){t.drawImage(this.view,e,i,s,n)}getLoadUrl(t){return this.url}setThumbView(t){}getThumbSize(t){}getMinLevel(){}getLevelData(t,e,i){}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 lr extends hr{get tag(){return"Film"}}class dr extends hr{get tag(){return"Video"}}function cr(t,e,i,s){s||(i.configurable=i.enumerable=!0),Object.defineProperty(t,e,i)}function ur(t,e){return Object.getOwnPropertyDescriptor(t,e)}function _r(t,e){const i="_"+t;return{get(){const t=this[i];return null==t?e:t},set(t){this[i]=t}}}function pr(t,e){return(i,s)=>fr(i,s,t,e&&e(s))}function gr(t){return t}function fr(t,e,i,s){const n={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};cr(t,e,Object.assign(n,s||{})),Hr(t,e,i)}function yr(t){return pr(t)}function mr(t,e){return pr(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function vr(t,e){return pr(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function wr(t){return pr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),Br(this))}}))}function xr(t,e){return pr(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function br(t,e){return pr(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function Sr(t,e){return pr(t,t=>({set(i){this.__setAttr(t,i,e)&&Br(this)}}))}function kr(t){return pr(t,t=>({set(e){this.__setAttr(t,e)&&(Br(this),this.__.__removeNaturalSize())}}))}function Br(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function Pr(t){return pr(t,t=>({set(e){const i=this.__;2!==i.__pathInputed&&(i.__pathInputed=e?1:0),e||(i.__pathForRender=void 0),this.__setAttr(t,e),Br(this)}}))}const Tr=Sr;function Er(t,e){return pr(t,t=>({set(i){this.__setAttr(t,i)&&(Cr(this),e&&(this.__.__useStroke=!0))}}))}function Cr(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&Br(t)}const Rr=Er;function Lr(t){return pr(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Or(t){return pr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function Ar(t){return pr(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;f.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip)}}}))}function Dr(t){return pr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&Fr(this)}}))}function Mr(t){return pr(t,t=>({set(e){const i=this.visible;if(!0===i&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>Ir(this,t,e,i))}else 0===i&&!0===e&&this.animation&&this.__runAnimation("in");Ir(this,t,e,i),this.mask&&Fr(this)}}))}function Fr(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function Ir(t,e,i,s){t.__setAttr(e,i)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==s&&0!==i||Br(t))}function Wr(t){return pr(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__layout.childrenSortChange()})}}))}function Nr(t){return pr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function zr(t){return pr(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function Yr(t){return pr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,this.leafer&&this.leafer.updateCursor())}}))}function Xr(t){return pr(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function Ur(t){return(e,i)=>{cr(e,"__DataProcessor",{get:()=>t})}}function jr(t){return(e,i)=>{cr(e,"__LayoutProcessor",{get:()=>t})}}function Hr(t,e,i){const s=t.__DataProcessor.prototype,n="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=_r(e,i);if(r(i))a.get=function(){return this[n]};else if("function"==typeof i)a.get=function(){const t=this[n];return null==t?i(this.__leaf):t};else if(_(i)){const t=g(i);a.get=function(){const e=this[n];return null==e?this[n]=t?{}:f.clone(i):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalWidth,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&s.children.length?s.boxBounds.width:i}return t}:"height"===e&&(a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalHeight,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&s.children.length?s.boxBounds.height:i}return t});let l,d=s;for(;!l&&d;)l=ur(d,e),d=d.__proto__;l&&l.set&&(a.set=l.set),s[o]&&(a.set=s[o],delete s[o]),cr(s,e,a)}const Vr=new re("rewrite"),qr=[],Gr=["destroy","constructor"];function Kr(t){return(e,i)=>{qr.push({name:e.constructor.name+"."+i,run:()=>{e[i]=t}})}}function $r(){return t=>{Jr()}}function Jr(t){qr.length&&(qr.forEach(e=>{t&&Vr.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),qr.length=0)}function Qr(t,e){return i=>{var s;(t.prototype?(s=t.prototype,Object.getOwnPropertyNames(s)):Object.keys(t)).forEach(s=>{if(!(Gr.includes(s)||e&&e.includes(s)))if(t.prototype){ur(t.prototype,s).writable&&(i.prototype[s]=t.prototype[s])}else i.prototype[s]=t[s]})}}function Zr(){return t=>{ge.register(t)}}function to(){return t=>{me.register(t)}}setTimeout(()=>Jr(!0));const{copy:eo,toInnerPoint:io,toOuterPoint:so,scaleOfOuter:no,rotateOfOuter:ro,skewOfOuter:oo,multiplyParent:ao,divideParent:ho,getLayout:lo}=Q,co={},{round:uo}=Math,_o={updateAllMatrix(t,e,i){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(i=!0),fo(t,e,i),t.isBranch){const{children:s}=t;for(let t=0,n=s.length;t<n;t++)go(s[t],e,i)}},updateMatrix(t,e,i){const s=t.__layout;e?i&&(s.waitAutoLayout=!0,t.__hasAutoLayout&&(s.matrixChanged=!1)):s.waitAutoLayout&&(s.waitAutoLayout=!1),s.matrixChanged&&t.__updateLocalMatrix(),s.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)yo(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&yo(t),t.__updateChange(),e.surfaceChanged&&(t.__hasComplex&&po.updateComplex(t),e.surfaceChanged=!1)},updateAllChange(t){if(vo(t),t.isBranch){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)mo(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,i,s,n,r){s||(s=t.__nowWorld),t.__worldFlipped||ie.fullImageShadow?e.copyWorldByReset(i,s,t.__nowWorld,n,r):e.copyWorldToInner(i,s,t.__layout.renderBounds,n)},renderComplex(t,e,i){},updateComplex(t){},checkComplex(t){},moveWorld(t,e,i=0,s,n){const r=_(e)?Object.assign({},e):{x:e,y:i};s?so(t.localTransform,r,r,!0):t.parent&&io(t.parent.scrollWorldTransform,r,r,!0),po.moveLocal(t,r.x,r.y,n)},moveLocal(t,e,i=0,s){_(e)&&(i=e.y,e=e.x),e+=t.x,i+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=uo(e),i=uo(i)),s?t.animate({x:e,y:i},s):(t.x=e,t.y=i)},zoomOfWorld(t,e,i,s,n,r){po.zoomOfLocal(t,wo(t,e),i,s,n,r)},zoomOfLocal(t,e,i,s=i,n,r){const o=t.__localMatrix;if(l(s)||(s&&(r=s),s=i),eo(co,o),no(co,e,i,s),po.hasHighPosition(t))po.setTransform(t,co,n,r);else{const e=t.x+co.e-o.e,a=t.y+co.f-o.f;r&&!n?t.animate({x:e,y:a,scaleX:t.scaleX*i,scaleY:t.scaleY*s},r):(t.x=e,t.y=a,t.scaleResize(i,s,!0!==n))}},rotateOfWorld(t,e,i,s){po.rotateOfLocal(t,wo(t,e),i,s)},rotateOfLocal(t,e,i,s){const n=t.__localMatrix;eo(co,n),ro(co,e,i),po.hasHighPosition(t)?po.setTransform(t,co,!1,s):t.set({x:t.x+co.e-n.e,y:t.y+co.f-n.f,rotation:I.formatRotation(t.rotation+i)},s)},skewOfWorld(t,e,i,s,n,r){po.skewOfLocal(t,wo(t,e),i,s,n,r)},skewOfLocal(t,e,i,s=0,n,r){eo(co,t.__localMatrix),oo(co,e,i,s),po.setTransform(t,co,n,r)},transformWorld(t,e,i,s){eo(co,t.worldTransform),ao(co,e),t.parent&&ho(co,t.parent.scrollWorldTransform),po.setTransform(t,co,i,s)},transform(t,e,i,s){eo(co,t.localTransform),ao(co,e),po.setTransform(t,co,i,s)},setTransform(t,e,i,s){const n=t.__,r=n.origin&&po.getInnerOrigin(t,n.origin),o=lo(e,r,n.around&&po.getInnerOrigin(t,n.around));if(po.hasOffset(t)&&(o.x-=n.offsetX,o.y-=n.offsetY),i){const e=o.scaleX/t.scaleX,i=o.scaleY/t.scaleY;if(delete o.scaleX,delete o.scaleY,r){Ht.scale(t.boxBounds,Math.abs(e),Math.abs(i));const s=po.getInnerOrigin(t,n.origin);dt.move(o,r.x-s.x,r.y-s.y)}t.set(o),t.scaleResize(e,i,!1)}else t.set(o,s)},getFlipTransform(t,e){const i={a:1,b:0,c:0,d:1,e:0,f:0},s="x"===e?1:-1;return no(i,po.getLocalOrigin(t,"center"),-1*s,1*s),i},getLocalOrigin:(t,e)=>dt.tempToOuterOf(po.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const i={};return Bt.toPoint(e,t.boxBounds,i),i},getRelativeWorld:(t,e,i)=>(eo(co,t.worldTransform),ho(co,e.scrollWorldTransform),i?co:Object.assign({},co)),updateScaleFixedWorld(t){},updateOuterBounds(t){},cacheId(t){},drop(t,e,i,s){t.setTransform(po.getRelativeWorld(t,e,!0),s),e.add(t,i)},hasHighPosition:t=>t.origin||t.around||po.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,i=.3){if(e.x||e.y)if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const s=e.x*i,n=e.y*i;e.x-=s,e.y-=n,t.move(s,n),ie.requestRender(()=>po.animateMove(t,e,i))}}},po=_o,{updateAllMatrix:go,updateMatrix:fo,updateAllWorldOpacity:yo,updateAllChange:mo,updateChange:vo}=po;function wo(t,e){return t.updateLayout(),t.parent?dt.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const xo={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:i}=t;return e.eraser||0===e.visible?null:i.localOuterBounds||i.localRenderBounds},maskLocalBoxBounds:(t,e)=>So(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>So(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds(t,e){const{__layout:i}=t;return So(t,e)&&(i.localOuterBounds||i.localRenderBounds)},excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};let bo;function So(t,e){return e||(bo=0),t.__.mask&&(bo=1),bo<0?null:(bo&&(bo=-1),!0)}const{updateBounds:ko}=_o,Bo={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:i}=t;for(let s=0,n=i.length;s<n;s++)(t=i[s]).isBranch&&(t.__tempNumber=1,e.add(t),Po(t,e))}},pushAllParent(t,e){const{keys:i}=e;if(i)for(;t.parent&&r(i[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 i=e.length;const{children:s}=t;for(let t=0,i=s.length;t<i;t++)s[t].isBranch&&e.push(s[t]);for(let t=i,s=e.length;t<s;t++)To(e[t],e)},updateBounds(t,e){const i=[t];To(t,i),Eo(i,e)},updateBoundsByBranchStack(t,e){let i,s;for(let n=t.length-1;n>-1;n--){i=t[n],s=i.children;for(let t=0,e=s.length;t<e;t++)ko(s[t]);e&&e===i||ko(i)}},move(t,e,i){let s;const{children:n}=t;for(let r=0,o=n.length;r<o;r++)s=(t=n[r]).__world,s.e+=e,s.f+=i,s.x+=e,s.y+=i,t.isBranch&&Co(t,e,i)},scale(t,e,i,s,n,r,o){let a;const{children:h}=t,l=s-1,d=n-1;for(let c=0,u=h.length;c<u;c++)a=(t=h[c]).__world,a.a*=s,a.d*=n,(a.b||a.c)&&(a.b*=s,a.c*=n),a.e===a.x&&a.f===a.y?(a.x=a.e+=(a.e-r)*l+e,a.y=a.f+=(a.f-o)*d+i):(a.e+=(a.e-r)*l+e,a.f+=(a.f-o)*d+i,a.x+=(a.x-r)*l+e,a.y+=(a.y-o)*d+i),a.width*=s,a.height*=n,a.scaleX*=s,a.scaleY*=n,t.isBranch&&Ro(t,e,i,s,n,r,o)}},{pushAllChildBranch:Po,pushAllBranchStack:To,updateBoundsByBranchStack:Eo,move:Co,scale:Ro}=Bo,Lo={run(t){if(t&&t.length){const e=t.length;for(let i=0;i<e;i++)t[i]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:Oo,updateBounds:Ao}=_o,{toOuterOf:Do,getPoints:Mo,copy:Fo}=Ht,Io="_localContentBounds",Wo="_worldContentBounds",No="_worldBoxBounds",zo="_worldStrokeBounds";class Yo{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 Do(this.contentBounds,this.leaf.__localMatrix,this[Io]||(this[Io]={})),this[Io]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return Do(this.contentBounds,this.leaf.__world,this[Wo]||(this[Wo]={})),this[Wo]}get worldBoxBounds(){return Do(this.boxBounds,this.leaf.__world,this[No]||(this[No]={})),this[No]}get worldStrokeBounds(){return Do(this.strokeBounds,this.leaf.__world,this[zo]||(this[zo]={})),this[zo]}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 Ao(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 i=e;if(i.__fullLayouting)return;i.__fullLayouting=!0,ie.layout(i),delete i.__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 Q.defaultMatrix;case"page":t=e.zoomLayer;default:return Oo(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 Kt(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",i){const{leaf:s}=this;let n,r,o,a=this.getInnerBounds(t);switch(e){case"world":n=s.getWorldPoint(a),r=s.__world;break;case"local":const{scaleX:t,scaleY:i,rotation:h,skewX:l,skewY:d}=s.__;o={scaleX:t,scaleY:i,rotation:h,skewX:l,skewY:d},n=s.getLocalPointByInner(a);break;case"inner":n=a,r=Q.defaultMatrix;break;case"page":e=s.zoomLayer;default:n=s.getWorldPoint(a,e),r=Oo(s,e,!0)}if(o||(o=Q.getLayout(r)),Fo(o,a),dt.copy(o,n),i){const{scaleX:t,scaleY:e}=o,i=Math.abs(t),s=Math.abs(e);1===i&&1===s||(o.scaleX/=i,o.scaleY/=s,o.width*=i,o.height*=s)}return o}getLayoutPoints(t,e="world"){const{leaf:i}=this,s=Mo(this.getInnerBounds(t));let n;switch(e){case"world":n=null;break;case"local":n=i.parent;break;case"inner":break;case"page":e=i.zoomLayer;default:n=e}return r(n)||s.forEach(t=>i.innerToWorld(t,null,!1,n)),s}shrinkContent(){const{x:t,y:e,width:i,height:s}=this.boxBounds;this._contentBounds={x:t,y:e,width:i,height:s}}spreadStroke(){const{x:t,y:e,width:i,height:s}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:i,height:s},this._localStrokeBounds={x:t,y:e,width:i,height:s},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:i,height:s}=this.renderBounds;this._renderBounds={x:t,y:e,width:i,height:s},this._localRenderBounds={x:t,y:e,width:i,height:s}}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}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 Xo{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&ie.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&ie.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&ie.event.stop(this.origin)}}class Uo extends Xo{constructor(t,e,i){super(t,e),this.parent=i,this.child=e}}Uo.ADD="child.add",Uo.REMOVE="child.remove",Uo.CREATED="created",Uo.MOUNTED="mounted",Uo.UNMOUNTED="unmounted",Uo.DESTROY="destroy";const jo="property.scroll";class Ho extends Xo{constructor(t,e,i,s,n){super(t,e),this.attrName=i,this.oldValue=s,this.newValue=n}}Ho.CHANGE="property.change",Ho.LEAFER_CHANGE="property.leafer_change",Ho.SCROLL=jo;const Vo={scrollX:jo,scrollY:jo};class qo extends Xo{constructor(t,e){super(t),Object.assign(this,e)}}qo.LOAD="image.load",qo.LOADED="image.loaded",qo.ERROR="image.error";class Go extends Xo{static checkHas(t,e,i){"on"===i?e===Qo?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Ko)||t.hasEvent($o)||t.hasEvent(Jo),t.__hasWorldEvent=t.hasEvent(Qo))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Ko,t),"inner"===e&&t.emit($o,t)),t.emit(Jo,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Qo,this)}}Go.RESIZE="bounds.resize",Go.INNER="bounds.inner",Go.LOCAL="bounds.local",Go.WORLD="bounds.world";const{RESIZE:Ko,INNER:$o,LOCAL:Jo,WORLD:Qo}=Go,Zo={};[Ko,$o,Jo,Qo].forEach(t=>Zo[t]=1);class ta extends Xo{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(ta.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!r(this.resizingKeys[t.innerId])}}ta.RESIZE="resize";class ea extends Xo{constructor(t,e){super(t),this.data=e}}ea.REQUEST="watch.request",ea.DATA="watch.data";class ia extends Xo{constructor(t,e,i){super(t),e&&(this.data=e,this.times=i)}}ia.REQUEST="layout.request",ia.START="layout.start",ia.BEFORE="layout.before",ia.LAYOUT="layout",ia.AFTER="layout.after",ia.AGAIN="layout.again",ia.END="layout.end";class sa extends Xo{constructor(t,e,i,s){super(t),e&&(this.times=e),i&&(this.renderBounds=i,this.renderOptions=s)}}sa.REQUEST="render.request",sa.CHILD_START="render.child_start",sa.CHILD_END="render.child_end",sa.START="render.start",sa.BEFORE="render.before",sa.RENDER="render",sa.AFTER="render.after",sa.AGAIN="render.again",sa.END="render.end",sa.NEXT="render.next";class na extends Xo{}na.START="leafer.start",na.BEFORE_READY="leafer.before_ready",na.READY="leafer.ready",na.AFTER_READY="leafer.after_ready",na.VIEW_READY="leafer.view_ready",na.VIEW_COMPLETED="leafer.view_completed",na.STOP="leafer.stop",na.RESTART="leafer.restart",na.END="leafer.end",na.UPDATE_MODE="leafer.update_mode",na.TRANSFORM="leafer.transform",na.MOVE="leafer.move",na.SCALE="leafer.scale",na.ROTATE="leafer.rotate",na.SKEW="leafer.skew";const{MOVE:ra,SCALE:oa,ROTATE:aa,SKEW:ha}=na,la={x:ra,y:ra,scaleX:oa,scaleY:oa,rotation:aa,skewX:ha,skewY:ha},da={};class ca{set event(t){this.on(t)}on(t,e,i){if(!e){let e;if(u(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let i in t)u(e=t[i])?this.on(i,e[0],e[1]):this.on(i,e);return}let s,n,r;i&&("once"===i?n=!0:"boolean"==typeof i?s=i:(s=i.capture,n=i.once));const o=ua(this,s,!0),h=a(t)?t.split(" "):t,l=n?{listener:e,once:n}:{listener:e};h.forEach(t=>{t&&(r=o[t],r?-1===r.findIndex(t=>t.listener===e)&&r.push(l):o[t]=[l],Zo[t]&&Go.checkHas(this,t,"on"))})}off(t,e,i){if(t){const s=a(t)?t.split(" "):t;if(e){let t,n,r;i&&(t="boolean"==typeof i?i:"once"!==i&&i.capture);const o=ua(this,t);s.forEach(t=>{t&&(n=o[t],n&&(r=n.findIndex(t=>t.listener===e),r>-1&&n.splice(r,1),n.length||delete o[t],Zo[t]&&Go.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;s.forEach(i=>{t&&delete t[i],e&&delete e[i]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,i,s){return e?this.on(t,i?e=e.bind(i):e,s):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:s}}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,i,s){if(!e)return u(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));_(i)?e=e.bind(i):s=i,this.on(t,e,{once:!0,capture:s})}emit(t,e,i){!e&&me.has(t)&&(e=me.get(t,{type:t,target:this,current:this}));const s=ua(this,i)[t];if(s){let n;for(let r=0,o=s.length;r<o&&!((n=s[r])&&(n.listener(e),n.once&&(this.off(t,n.listener,i),r--,o--),e&&e.isStopNow));r++);}this.syncEventer&&this.syncEventer.emitEvent(e,i)}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:i,__captureMap:s}=this,n=i&&i[t],o=s&&s[t];return!!(r(e)?n||o:e?o:n)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function ua(t,e,i){if(e){const{__captureMap:e}=t;return e||(i?t.__captureMap={}:da)}{const{__bubbleMap:e}=t;return e||(i?t.__bubbleMap={}:da)}}const{on:_a,on_:pa,off:ga,off_:fa,once:ya,emit:ma,emitEvent:va,hasEvent:wa,destroy:xa}=ca.prototype,ba={on:_a,on_:pa,off:ga,off_:fa,once:ya,emit:ma,emitEvent:va,hasEvent:wa,destroyEventer:xa},Sa=re.get("setAttr"),ka={__setAttr(t,e,i){if(this.leaferIsCreated){const s=this.__.__getInput(t);if(!i||h(e)||r(e)||(Sa.warn(this.innerName,t,e),e=void 0),_(e)||s!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new Ho(Ho.LEAFER_CHANGE,this,t,s,e));const i=la[t];i&&(this.emitEvent(new na(i,this)),this.emitEvent(new na(na.TRANSFORM,this)))}this.emitPropertyEvent(Ho.CHANGE,t,s,e);const i=Vo[t];return i&&this.emitPropertyEvent(i,t,s,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,i,s){const n=new Ho(t,this,e,i,s);this.isLeafer||this.hasEvent(t)&&this.emitEvent(n),this.leafer.emitEvent(n)},__realSetAttr(t,e){const i=this.__;i[t]=e,this.__proxyData&&this.setProxyAttr(t,e),i.normalStyle&&(this.lockNormalStyle||r(i.normalStyle[t])||(i.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:Ba,multiplyParent:Pa,translateInner:Ta,defaultWorld:Ea}=Q,{toPoint:Ca,tempPoint:Ra}=Bt,La={__updateWorldMatrix(){const{parent:t,__layout:e,__world:i,__scrollWorld:s,__:n}=this;Pa(this.__local||e,t?t.__scrollWorld||t.__world:Ea,i,!!e.affectScaleOrRotation,n),s&&Ta(Object.assign(s,i),n.scrollX,n.scrollY),e.scaleFixed&&_o.updateScaleFixedWorld(this)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,i=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(Ba(e,i,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=i.x+i.offsetX,e.f=i.y+i.offsetY,(i.around||i.origin)&&(Ca(i.around||i.origin,t.boxBounds,Ra),Ta(e,-Ra.x,-Ra.y,!i.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:Oa,updateAllMatrix:Aa}=_o,{updateBounds:Da}=Bo,{toOuterOf:Ma,copyAndSpread:Fa,copy:Ia}=Ht,{toBounds:Wa}=Wn,Na={__updateWorldBounds(){const{__layout:t,__world:e}=this;Ma(t.renderBounds,e,e),this.__hasComplex&&_o.checkComplex(this),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&Go.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&Go.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(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&&_o.updateOuterBounds(this),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),Ma(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Ma(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Ma(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const i=this.__layout.boxBounds,s=this.__;s.__usePathBox?Wa(s.path,i):(i.x=0,i.y=0,i.width=s.width,i.height=s.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),Aa(this),Da(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(Aa(this),Da(this,this))):Oa(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;Fa(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:i}=e;l(i)&&i<=0?Ia(e.renderBounds,e.strokeBounds):Fa(e.renderBounds,e.boxBounds,i)}},za={__render(t,e){if(e.shape)return this.__renderShape(t,e);if((!e.cellList||e.cellList.has(this))&&this.__worldOpacity){const i=this.__;if(i.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.ignoreOpacity?1:e.dimOpacity&&!i.dimskip?i.opacity*e.dimOpacity:i.opacity,this.__.__single){if("path"===i.eraser)return this.__renderEraser(t,e);const s=t.getSameCanvas(!0,!0);this.__draw(s,e,t),_o.copyCanvasByWorld(this,t,s,this.__nowWorld,i.__blendMode,!0),s.recycle(this.__nowWorld)}else this.__draw(t,e);re.showBounds&&re.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Ya}=xo,{hasSize:Xa}=Ht,Ua={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){const i=this.__nowWorld=this.__getNowWorld(e);if(this.__worldOpacity&&Xa(i)){const s=this.__;if(s.__useDim)if(s.dim)e.dimOpacity=!0===s.dim?.2:s.dim;else{if(s.bright&&!e.topRendering)return e.topList.add(this);s.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const n=t.getSameCanvas(!1,!0);this.__renderBranch(n,e),t.opacity=e.ignoreOpacity?1:e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(n,i,i,s.__blendMode,!0),n.recycle(i)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{let i;const{children:s}=this;for(let n=0,r=s.length;n<r;n++)i=s[n],Ya(i,e)||(i.__hasComplex?_o.renderComplex(i,t,e):i.__render(t,e))}},__clip(t,e){if(this.__worldOpacity){const{children:i}=this;for(let s=0,n=i.length;s<n;s++)Ya(i[s],e)||i[s].__clip(t,e)}}},{LEAF:ja,create:Ha}=v,{stintSet:Va}=f,{toInnerPoint:qa,toOuterPoint:Ga,multiplyParent:Ka}=Q,{toOuterOf:$a}=Ht,{copy:Ja,move:Qa}=dt,{getScaleFixedData:Za}=I,{moveLocal:th,zoomOfLocal:eh,rotateOfLocal:ih,skewOfLocal:sh,moveWorld:nh,zoomOfWorld:rh,rotateOfWorld:oh,skewOfWorld:ah,transform:hh,transformWorld:lh,setTransform:dh,getFlipTransform:ch,getLocalOrigin:uh,getRelativeWorld:_h,drop:ph}=_o;let gh=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 Yo}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){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=Ha(ja),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(Uo.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()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(Uo.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(Uo.MOUNTED,t,"once")}nextRender(t,e,i){this.leafer?this.leafer.nextRender(t,e,i):this.waitLeafer(()=>this.leafer.nextRender(t,e,i))}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(Uo.MOUNTED),t.cacheId&&_o.cacheId(this)):this.__emitLifeEvent(Uo.UNMOUNTED),this.isBranch){const{children:e}=this;for(let i=0,s=e.length;i<s;i++)e[i].__bindLeafer(t)}}set(t,e){}get(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))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){r(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=r(e)?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(t,e){}__updateContentBounds(){}__updateStrokeBounds(t){}__updateRenderBounds(t){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:i}=this.__layout;t.clearRect(i.x,i.y,i.width,i.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity)}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,i=this.__world;return Ka(i,t.matrix,e,void 0,i),$a(this.__layout.renderBounds,e,e),Va(e,"half",i.half),Va(e,"ignorePixelSnap",i.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,i=!0){return Za(nr.patternLocked?this.__world:this.__nowWorld||this.__world,e,i,t)}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,i){return this.__layout.getLayoutBounds(t,e,i)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,i){const s=e?_h(this,e):this.worldTransform,n=i?t:{};return $a(t,s,n),n}worldToLocal(t,e,i,s){this.parent?this.parent.worldToInner(t,e,i,s):e&&Ja(e,t)}localToWorld(t,e,i,s){this.parent?this.parent.innerToWorld(t,e,i,s):e&&Ja(e,t)}worldToInner(t,e,i,s){s&&(s.innerToWorld(t,e,i),t=e||t),qa(this.scrollWorldTransform,t,e,i)}innerToWorld(t,e,i,s){Ga(this.scrollWorldTransform,t,e,i),s&&s.worldToInner(e||t,null,i)}getBoxPoint(t,e,i,s){return this.getBoxPointByInner(this.getInnerPoint(t,e,i,s),null,null,!0)}getBoxPointByInner(t,e,i,s){const n=s?t:Object.assign({},t),{x:r,y:o}=this.boxBounds;return Qa(n,-r,-o),n}getInnerPoint(t,e,i,s){const n=s?t:{};return this.worldToInner(t,n,i,e),n}getInnerPointByBox(t,e,i,s){const n=s?t:Object.assign({},t),{x:r,y:o}=this.boxBounds;return Qa(n,r,o),n}getInnerPointByLocal(t,e,i,s){return this.getInnerPoint(t,this.parent,i,s)}getLocalPoint(t,e,i,s){const n=s?t:{};return this.worldToLocal(t,n,i,e),n}getLocalPointByInner(t,e,i,s){return this.getWorldPoint(t,this.parent,i,s)}getPagePoint(t,e,i,s){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,i,s)}getWorldPoint(t,e,i,s){const n=s?t:{};return this.innerToWorld(t,n,i,e),n}getWorldPointByBox(t,e,i,s){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,s),e,i,!0)}getWorldPointByLocal(t,e,i,s){const n=s?t:{};return this.localToWorld(t,n,i,e),n}getWorldPointByPage(t,e,i,s){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,i,s)}setTransform(t,e,i){dh(this,t,e,i)}transform(t,e,i){hh(this,t,e,i)}move(t,e,i){th(this,t,e,i)}moveInner(t,e,i){nh(this,t,e,!0,i)}scaleOf(t,e,i,s,n){eh(this,uh(this,t),e,i,s,n)}rotateOf(t,e,i){ih(this,uh(this,t),e,i)}skewOf(t,e,i,s,n){sh(this,uh(this,t),e,i,s,n)}transformWorld(t,e,i){lh(this,t,e,i)}moveWorld(t,e,i){nh(this,t,e,!1,i)}scaleOfWorld(t,e,i,s,n){rh(this,t,e,i,s,n)}rotateOfWorld(t,e){oh(this,t,e)}skewOfWorld(t,e,i,s,n){ah(this,t,e,i,s,n)}flip(t,e){hh(this,ch(this,t),!1,e)}scaleResize(t,e=t,i){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}hit(t,e){return!0}__hitWorld(t,e){return!0}__hit(t,e){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e,i){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(t){}getMotionPathData(){return ue.need("path")}getMotionPoint(t){return ue.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,i){ph(this,t,e,i)}on(t,e,i){}off(t,e,i){}on_(t,e,i,s){}off_(t){}once(t,e,i,s){}emit(t,e,i){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,i){i?this.addAttr(t,e,i):Hr(this.prototype,t,e)}static addAttr(t,e,i,s){i||(i=Sr),i(e,s)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new Uo(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(Uo.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};gh=i([Qr(ka),Qr(La),Qr(Na),Qr(ba),Qr(za)],gh);const{setListWithFn:fh}=Ht,{sort:yh}=Bo,{localBoxBounds:mh,localStrokeBounds:vh,localRenderBounds:wh,maskLocalBoxBounds:xh,maskLocalStrokeBounds:bh,maskLocalRenderBounds:Sh}=xo,kh=new re("Branch");let Bh=class extends gh{__updateStrokeSpread(){const{children:t}=this;for(let e=0,i=t.length;e<i;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){let t;const{children:e}=this;for(let i=0,s=e.length;i<s;i++)if(t=e[i].__layout,t.renderSpread||t.localOuterBounds)return 1;return 0}__updateBoxBounds(t,e){fh(e||this.__layout.boxBounds,this.children,this.__hasMask?xh:mh)}__updateStrokeBounds(t){fh(t||this.__layout.strokeBounds,this.children,this.__hasMask?bh:vh)}__updateRenderBounds(t){fh(t||this.__layout.renderBounds,this.children,this.__hasMask?Sh:wh)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let i=0,s=e.length;i<s;i++)e[i].__tempNumber=i,e[i].__.zIndex&&(t=!0);e.sort(yh),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return kh.warn("add self or destroyed");const i=r(e);if(!t.__){if(u(t))return t.forEach(t=>{this.add(t,e),i||e++});if(!(t=ge.get(t.tag,t)))return}t.parent&&t.parent.remove(t),t.parent=this,i?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const s=t.__layout;s.boxChanged||s.boxChange(),s.matrixChanged||s.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(Uo.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Uo.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)):r(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 i=this.children.indexOf(t);i>-1&&(this.children.splice(i,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(Uo.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Uo.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const i=new Uo(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(i),this.leafer.emitEvent(i)}};Bh=i([Qr(Ua)],Bh);class Ph{get length(){return this.list.length}constructor(t){this.reset(),t&&(u(t)?this.addList(t):this.add(t))}has(t){return t&&!r(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return r(e)?-1:e}add(t){const{list:e,keys:i}=this;r(i[t.innerId])&&(e.push(t),i[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:i}=this;if(r(i[t.innerId])){const{list:s}=this;for(let t=e,n=s.length;t<n;t++)i[s[t].innerId]++;0===e?s.unshift(t):(e>s.length&&(e=s.length),s.splice(e,0,t)),i[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let i;for(let s=0,n=e.length;s<n;s++)r(i)?e[s].innerId===t.innerId&&(i=s,delete this.keys[t.innerId]):this.keys[e[s].innerId]=s-1;r(i)||e.splice(i,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 Ph;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};const{list:t,keys:e}=this;for(let i=0,s=t.length;i<s;i++)e[t[i].innerId]=i}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class Th{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(u(t)?this.addList(t):this.add(t))}has(t){return!r(this.keys[t.innerId])}without(t){return r(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:i}=this;e[t.innerId]||(e[t.innerId]=1,i[t.__level]?i[t.__level].push(t):(i[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(i=>{e=this.levelMap[i];for(let i=0,s=e.length;i<s;i++)t(e[i])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const Eh="2.0.3",Ch=re.get("LeaferCanvas");class Rh extends De{set zIndex(t){const{style:e}=this.view;e.zIndex=t,this.setAbsolute(this.view)}set childIndex(t){const{view:e,parentView:i}=this;if(e&&i){const s=i.children[t];s?(this.setAbsolute(s),i.insertBefore(e,s)):i.appendChild(s)}}init(){const{config:t}=this,e=t.view||t.canvas;e?this.__createViewFrom(e):this.__createView();const{style:i}=this.view;if(i.display||(i.display="block"),this.parentView=this.view.parentElement,this.parentView){const t=this.parentView.style;t.webkitUserSelect=t.userSelect="none",this.view.classList.add("leafer-canvas-view")}ie.syncDomFont&&!this.parentView&&(i.display="none",document.body&&document.body.appendChild(this.view)),this.__createContext(),this.autoLayout||this.resize(t)}set backgroundColor(t){this.view.style.backgroundColor=t}get backgroundColor(){return this.view.style.backgroundColor}set hittable(t){this.view.style.pointerEvents=t?"auto":"none"}get hittable(){return"none"!==this.view.style.pointerEvents}__createView(){this.view=document.createElement("canvas")}__createViewFrom(t){let e=a(t)?document.getElementById(t):t;if(e)if(e instanceof HTMLCanvasElement)this.view=e;else{let t=e;if(e===window||e===document){const e=document.createElement("div"),{style:i}=e;i.position="absolute",i.top=i.bottom=i.left=i.right="0px",document.body.appendChild(e),t=e}this.__createView();const i=this.view;t.hasChildNodes()&&(this.setAbsolute(i),t.style.position||(t.style.position="relative")),t.appendChild(i)}else Ch.error(`no id: ${t}`),this.__createView()}setAbsolute(t){const{style:e}=t;e.position="absolute",e.top=e.left="0px"}updateViewSize(){const{width:t,height:e,pixelRatio:i}=this,{style:s}=this.view;s.width=t+"px",s.height=e+"px",this.unreal||(this.view.width=Math.ceil(t*i),this.view.height=Math.ceil(e*i))}updateClientBounds(){this.view.parentElement&&(this.clientBounds=this.view.getBoundingClientRect())}startAutoLayout(t,e){if(this.resizeListener=e,t){if(this.autoBounds=t,this.resizeObserver)return;try{this.resizeObserver=new ResizeObserver(t=>{this.updateClientBounds();for(const e of t)this.checkAutoBounds(e.contentRect)});const t=this.parentView;t?(this.resizeObserver.observe(t),this.checkAutoBounds(t.getBoundingClientRect())):(this.checkAutoBounds(this.view),Ch.warn("no parent"))}catch(t){this.imitateResizeObserver()}this.stopListenPixelRatio()}else this.listenPixelRatio(),this.unreal&&this.updateViewSize()}imitateResizeObserver(){this.autoLayout&&(this.parentView&&this.checkAutoBounds(this.parentView.getBoundingClientRect()),ie.requestRender(this.imitateResizeObserver.bind(this)))}listenPixelRatio(){this.windowListener||window.addEventListener("resize",this.windowListener=()=>{const t=ie.devicePixelRatio;if(!this.config.pixelRatio&&this.pixelRatio!==t){const{width:e,height:i}=this;this.emitResize({width:e,height:i,pixelRatio:t})}})}stopListenPixelRatio(){this.windowListener&&(window.removeEventListener("resize",this.windowListener),this.windowListener=null)}checkAutoBounds(t){const e=this.view,{x:i,y:s,width:n,height:r}=this.autoBounds.getBoundsFrom(t),o={width:n,height:r,pixelRatio:this.config.pixelRatio?this.pixelRatio:ie.devicePixelRatio};if(!this.isSameSize(o)){const{style:t}=e;t.marginLeft=i+"px",t.marginTop=s+"px",this.emitResize(o)}}stopAutoLayout(){this.autoLayout=!1,this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeListener=this.resizeObserver=null}emitResize(t){const e={};f.copyAttrs(e,this,Ae),this.resize(t),this.resizeListener&&!r(this.width)&&this.resizeListener(new ta(t,e))}unrealCanvas(){if(!this.unreal&&this.parentView){let t=this.view;t&&t.remove(),t=this.view=document.createElement("div"),this.parentView.appendChild(this.view),t.classList.add("leafer-app-view"),this.unreal=!0}}destroy(){const{view:t}=this;t&&(this.stopAutoLayout(),this.stopListenPixelRatio(),t.parentElement&&t.remove(),super.destroy())}}function Lh(t,e){ie.origin={createCanvas(t,e){const i=document.createElement("canvas");return i.width=t,i.height=e,i},canvasToDataURL:(t,e,i)=>{const s=$n.mimeType(e),n=t.toDataURL(s,i);return"image/bmp"===s?n.replace("image/png;","image/bmp;"):n},canvasToBolb:(t,e,i)=>new Promise(s=>t.toBlob(s,$n.mimeType(e),i)),canvasSaveAs:(t,e,i)=>{const s=t.toDataURL($n.mimeType($n.fileType(e)),i);return ie.origin.download(s,e)},download(t,e){return s(this,void 0,void 0,function*(){let i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i)})},loadImage:(t,e,i)=>new Promise((i,s)=>{const n=new ie.origin.Image;e&&(n.setAttribute("crossOrigin",e),n.crossOrigin=e),n.onload=()=>{i(n)},n.onerror=t=>{s(t)},n.src=ie.image.getRealURL(t)}),loadContent(t){return s(this,arguments,void 0,function*(t,e="text"){const i=yield fetch(t);if(!i.ok)throw new Error(`${i.status}`);return yield i[e]()})},Image:Image,PointerEvent:PointerEvent,DragEvent:DragEvent},ie.event={stopDefault(t){t.preventDefault()},stopNow(t){t.stopImmediatePropagation()},stop(t){t.stopPropagation()}},ie.canvas=_e.canvas(),ie.conicGradientSupport=!!ie.canvas.context.createConicGradient}Kn(CanvasRenderingContext2D.prototype),Kn(Path2D.prototype),Object.assign(_e,{canvas:(t,e)=>new Rh(t,e),image:t=>new hr(t)}),ie.name="web",ie.isMobile="ontouchstart"in window,ie.requestRender=function(t){window.requestAnimationFrame(t)},cr(ie,"devicePixelRatio",{get:()=>devicePixelRatio});const{userAgent:Oh}=navigator;Oh.indexOf("Firefox")>-1?(ie.conicGradientRotate90=!0,ie.intWheelDeltaY=!0,ie.syncDomFont=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&(ie.fullImageShadow=!0),Oh.indexOf("Windows")>-1?(ie.os="Windows",ie.intWheelDeltaY=!0):Oh.indexOf("Mac")>-1?ie.os="Mac":Oh.indexOf("Linux")>-1&&(ie.os="Linux");class Ah{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove&&this.config.usePartLayout){const t=new Ph;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new Ph,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=!0,this.running&&this.target.emit(sa.REQUEST)}__onAttrChange(t){this.config.usePartLayout&&this.__updatedList.add(t.target),this.update()}__onChildEvent(t){this.config.usePartLayout&&(t.type===Uo.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent))),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new ea(ea.DATA,{updatedList:this.updatedList})),this.__updatedList=new Ph,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[Ho.CHANGE,this.__onAttrChange,this],[[Uo.ADD,Uo.REMOVE],this.__onChildEvent,this],[ea.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:Dh,updateBounds:Mh,updateChange:Fh}=_o,{pushAllChildBranch:Ih,pushAllParent:Wh}=Bo;const{worldBounds:Nh}=xo;class zh{constructor(t){this.updatedBounds=new Kt,this.beforeBounds=new Kt,this.afterBounds=new Kt,u(t)&&(t=new Ph(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,Nh)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,Nh),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:Yh,updateAllChange:Xh}=_o,Uh=re.get("Layouter");class jh{constructor(t,e){this.totalTimes=0,this.config={usePartLayout:!0},this.__levelList=new Th,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(ia.START),this.layoutOnce(),t.emitEvent(new ia(ia.END,this.layoutedBlocks,this.times))}catch(t){Uh.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?Uh.warn("layouting"):this.times>3?Uh.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(ea.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:i,__updatedList:s}=this,{BEFORE:n,LAYOUT:r,AFTER:o}=ia,a=this.getBlocks(s);a.forEach(t=>t.setBefore()),i.emitEvent(new ia(n,a,this.times)),this.extraBlock=null,s.sort(),function(t,e){let i;t.list.forEach(t=>{i=t.__layout,e.without(t)&&!i.proxyZoom&&(i.matrixChanged?(Dh(t,!0),e.add(t),t.isBranch&&Ih(t,e),Wh(t,e)):i.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),Wh(t,e)))})}(s,this.__levelList),function(t){let e,i,s;t.sort(!0),t.levels.forEach(n=>{e=t.levelMap[n];for(let t=0,n=e.length;t<n;t++){if(i=e[t],i.isBranch&&i.__tempNumber){s=i.children;for(let t=0,e=s.length;t<e;t++)s[t].isBranch||Mh(s[t])}Mh(i)}})}(this.__levelList),function(t){t.list.forEach(Fh)}(s),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),i.emitEvent(new ia(r,a,this.times)),i.emitEvent(new ia(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:i,LAYOUT:s,AFTER:n}=ia,r=this.getBlocks(new Ph(e));e.emitEvent(new ia(i,r,this.times)),jh.fullLayout(e),r.forEach(t=>{t.setAfter()}),e.emitEvent(new ia(s,r,this.times)),e.emitEvent(new ia(n,r,this.times)),this.addBlocks(r),le.end(t)}static fullLayout(t){Yh(t,!0),t.isBranch?Bo.updateBounds(t):_o.updateBounds(t),Xh(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:i}=this.extraBlock||(this.extraBlock=new zh([]));e.length?i.add(t.__world):i.set(t.__world),e.add(t)}}createBlock(t){return new zh(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_([[ia.REQUEST,this.layout,this],[ia.AGAIN,this.layoutAgain,this],[ea.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const Hh=re.get("Renderer");class Vh{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,i){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,i&&(this.config=f.default(i,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(ia.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(sa.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(sa.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(sa.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Kt,Hh.log(e.innerName,"---\x3e");try{this.emitRender(sa.START),this.renderOnce(t),this.emitRender(sa.END,this.totalBounds),nr.clearRecycled()}catch(t){this.rendering=!1,Hh.error(t)}Hh.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return Hh.warn("rendering");if(this.times>3)return Hh.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Kt,this.renderOptions={},t)this.emitRender(sa.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(sa.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(sa.RENDER,this.renderBounds,this.renderOptions),this.emitRender(sa.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:i}=this,s=t.getIntersect(i.bounds),n=new Kt(s);i.save(),s.spread(Vh.clipSpread).ceil();const{ceilPartPixel:r}=this.config;i.clipWorld(s,r),i.clearWorld(s,r),this.__render(s,n),i.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:i,target:s}=this,n=t.includes(s.__world),r=n?{includes:n}:{bounds:t,includes:n};this.needFill&&i.fillWorld(t,this.config.fill),re.showRepaint&&re.drawRepaint(i,t),this.config.useCellRender&&(r.cellList=this.getCellList()),ie.render(s,i,r),this.renderBounds=e=e||t,this.renderOptions=r,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),i.updateRender(e)}getCellList(){}addBlock(t,e){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Kt;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:i}=this.config;if(i&&t>i)return ie.requestRender(e);const{frames:s}=this;s.length>30&&s.shift(),s.push(t),this.FPS=Math.round(s.reduce((t,e)=>t+e,0)/s.length),this.requestTime=0,this.checkRender()};ie.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:i}=t.old;if(!new Kt(0,0,e,i).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Kt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;const{updatedList:i}=t;i&&i.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||Hh.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds,i)})}emitRender(t,e,i){this.target.emitEvent(new sa(t,this.times,e,i))}__listenEvents(){this.__eventIds=[this.target.on_([[sa.REQUEST,this.update,this],[ia.END,this.__onLayoutEnd,this],[sa.AGAIN,this.renderAgain,this],[ta.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}}Vh.clipSpread=10;const qh={},{copyRadiusPoint:Gh}=dt,{hitRadiusPoint:Kh}=Ht;class $h{constructor(t,e){this.target=t,this.selector=e}getByPoint(t,e,i){e||(e=0),i||(i={});const s=i.through||!1,n=i.ignoreHittable||!1,r=i.target||this.target;this.exclude=i.exclude||null,this.point={x:t.x,y:t.y,radiusX:e,radiusY:e},this.findList=new Ph(i.findList),i.findList||this.hitBranch(r.isBranchLeaf?{children:[r]}:r);const{list:o}=this.findList,a=this.getBestMatchLeaf(o,i.bottomList,n,!!i.findList),h=n?this.getPath(a):this.getHitablePath(a);return this.clear(),s?{path:h,target:a,throughPath:o.length?this.getThroughPath(o):h}:{path:h,target:a}}hitPoint(t,e,i){return!!this.getByPoint(t,e,i).target}getBestMatchLeaf(t,e,i,s){const n=this.findList=new Ph;if(t.length){let e;const{x:s,y:r}=this.point,o={x:s,y:r,radiusX:0,radiusY:0};for(let s=0,r=t.length;s<r;s++)if(e=t[s],(i||_o.worldHittable(e))&&(this.hitChild(e,o),n.length)){if(e.isBranchLeaf&&t.some(t=>t!==e&&_o.hasParent(t,e))){n.reset();break}return n.list[0]}}if(e)for(let t=0,i=e.length;t<i;t++)if(this.hitChild(e[t].target,this.point,e[t].proxy),n.length)return n.list[0];return s?null:i?t[0]:t.find(t=>_o.worldHittable(t))}getPath(t){const e=new Ph,i=[],{target:s}=this;for(;t&&(t.syncEventer&&i.push(t.syncEventer),e.add(t),(t=t.parent)!==s););return i.length&&i.forEach(t=>{for(;t&&(t.__.hittable&&e.add(t),(t=t.parent)!==s););}),s&&e.add(s),e}getHitablePath(t){const e=this.getPath(t&&t.hittable?t:null);let i,s=new Ph;for(let t=e.list.length-1;t>-1&&(i=e.list[t],i.__.hittable)&&(s.addAt(i,0),i.__.hitChildren&&(!i.isLeafer||"draw"!==i.mode));t--);return s}getThroughPath(t){const e=new Ph,i=[];for(let e=t.length-1;e>-1;e--)i.push(this.getPath(t[e]));let s,n,r;for(let t=0,o=i.length;t<o;t++){s=i[t],n=i[t+1];for(let t=0,i=s.length;t<i&&(r=s.list[t],!n||!n.has(r));t++)e.add(r)}return e}hitBranch(t){this.eachFind(t.children,t.__onlyHitMask)}eachFind(t,e){let i,s,n;const{point:r}=this;for(let o=t.length-1;o>-1;o--)if(i=t[o],n=i.__,n.visible&&(!e||n.mask))if(s=Kh(i.__world,n.hitRadius?Gh(qh,r,n.hitRadius):r),i.isBranch){if(s||i.__ignoreHitWorld){if(i.isBranchLeaf&&n.__clipAfterFill&&!i.__hitWorld(r,!0))continue;i.topChildren&&this.eachFind(i.topChildren,!1),this.eachFind(i.children,i.__onlyHitMask),i.isBranchLeaf&&this.hitChild(i,r)}}else s&&this.hitChild(i,r)}hitChild(t,e,i){if((!this.exclude||!this.exclude.has(t))&&t.__hitWorld(e)){const{parent:s}=t;if(s&&s.__hasMask&&!t.__.mask){let i,n=[];const{children:r}=s;for(let s=0,o=r.length;s<o;s++)if(i=r[s],i.__.mask&&n.push(i),i===t){if(n&&!n.every(t=>t.__hitWorld(e)))return;break}}this.findList.add(i||t)}}clear(){this.point=null,this.findList=null,this.exclude=null}destroy(){this.clear()}}class Jh{constructor(t,e){this.config={},e&&(this.config=f.default(e,this.config)),this.picker=new $h(this.target=t,this),this.finder=_e.finder&&_e.finder(t,this.config)}getByPoint(t,e,i){const{target:s,picker:n}=this;return ie.backgrounder&&s&&s.updateLayout(),n.getByPoint(t,e,i)}hitPoint(t,e,i){return this.picker.hitPoint(t,e,i)}getBy(t,e,i,s){return this.finder?this.finder.getBy(t,e,i,s):ue.need("find")}destroy(){this.picker.destroy(),this.finder&&this.finder.destroy()}}function Qh(t){return pr(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0);const i=this.__layout;i.renderChanged||i.renderChange(),i.surfaceChange()}}))}function Zh(t){return pr(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function tl(){return(t,e)=>{const i="_"+e;cr(t,e,{set(t){this.isLeafer&&(this[i]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[i]||this:this.leafer&&this.leafer.zoomLayer}})}}function el(t){return(e,i)=>{cr(e,i,_r(i,t))}}Object.assign(_e,{watcher:(t,e)=>new Ah(t,e),layouter:(t,e)=>new jh(t,e),renderer:(t,e,i)=>new Vh(t,e,i),selector:(t,e)=>new Jh(t,e)}),ie.layout=jh.fullLayout,ie.render=function(t,e,i){const s=Object.assign(Object.assign({},i),{topRendering:!0});i.topList=new Ph,t.__render(e,i),i.topList.length&&i.topList.forEach(t=>t.__render(e,s))};const il={},sl={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}},nl=Qt,rl={},ol={},al={},hl={},ll={},dl={apply(){ue.need("filter")}},cl={},ul={setStyleName:()=>ue.need("state"),set:()=>ue.need("state")},_l={list:{},register(t,e){_l.list[t]=e},get:t=>_l.list[t]},{parse:pl,objectToCanvasData:gl}=ns,{stintSet:fl}=f,{hasTransparent:yl}=sl,ml={originPaint:{}},vl=re.get("UIData");class wl 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;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}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,vl.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,vl.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),a(t)||!t?(fl(this,"__isTransparentFill",yl(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):_(t)&&this.__setPaint("fill",t)}setStroke(t){a(t)||!t?(fl(this,"__isTransparentStroke",yl(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?pl(t):gl(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){xl(this,"shadow",t)}setInnerShadow(t){xl(this,"innerShadow",t)}setFilter(t){xl(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&ol.compute("fill",this.__leaf),e&&ol.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeScaleFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),r(t.strokeScaleFixed)||(i=t.strokeScaleFixed)),i){const{scaleX:t}=this.__leaf.getRenderScaleData(!0,i,!1);if(1!==t)return e*t}return e}__setPaint(t,e){this.__setInput(t,e);const i=this.__leaf.__layout;i.boxChanged||i.boxChange(),u(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=ml)):(this.__isStrokes=!0,this._stroke||(this._stroke=ml))}__removePaint(t,e){e&&this.__removeInput(t),al.recycleImage(t,this),"fill"===t?(fl(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(fl(this,"__isAlphaPixelStroke",void 0),fl(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function xl(t,e,i){t.__setInput(e,i),u(i)?(i.some(t=>!1===t.visible)&&(i=i.filter(t=>!1!==t.visible)),i.length||(i=void 0)):i=i&&!1!==i.visible?[i]:void 0,t["_"+e]=i}class bl extends wl{}class Sl 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 kl extends bl{__getInputData(t,e){const i=super.__getInputData(t,e);return Ae.forEach(t=>delete i[t]),i}}class Bl extends Sl{}class Pl extends wl{get __usePathBox(){return this.points||this.__pathInputed}}class Tl extends wl{get __boxStroke(){return!this.__pathInputed}}class El extends wl{get __boxStroke(){return!this.__pathInputed}}class Cl extends Pl{}class Rl extends wl{}class Ll extends wl{get __pathInputed(){return 2}}class Ol extends bl{}const Al={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class Dl extends wl{get __useNaturalRatio(){return!1}setFontWeight(t){a(t)?(this.__setInput("fontWeight",t),t=Al[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,i=e.__box;if(t){const{boxStyle:s}=this;if(i)for(let t in s)i[t]=void 0;else i=e.__box=ge.get("Rect",0);const n=e.__layout,r=i.__layout;s||(i.parent=e,i.__world=e.__world,r.boxBounds=n.boxBounds),i.set(t),r.strokeChanged&&n.strokeChange()}else i&&(e.__box=i.parent=null,i.destroy());this._boxStyle=t}__getInputData(t,e){const i=super.__getInputData(t,e);return i.textEditing&&delete i.textEditing,i}}class Ml extends Tl{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 i=super.__getInputData(t,e);return i.url&&delete i.fill,i}}class Fl extends Tl{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const i=super.__getInputData(t,e);return i.url=this.__leaf.canvas.toDataURL("image/png"),i}}const{max:Il,add:Wl}=P,Nl={__updateStrokeSpread(){let t=0,e=0;const i=this.__,{strokeAlign:s,__maxStrokeWidth:n}=i,r=this.__box;if((i.stroke||"all"===i.hitStroke)&&n&&"inside"!==s&&(e=t="center"===s?n/2:n,!i.__boxStroke||i.__useArrow)){const e=i.__isLinePath?0:10*t,s="none"===i.strokeCap?0:n;t+=Math.max(e,s)}return i.__useArrow&&(t+=5*n),r&&(t=Il(t,r.__layout.strokeSpread=r.__updateStrokeSpread()),e=Math.max(e,r.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:s,backgroundBlur:n,filter:r,renderSpread:o}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=ll.getShadowRenderSpread(this,e)),s&&(t=Il(t,s)),r&&(t=Wl(t,dl.getSpread(r))),o&&(t=Wl(t,o)),a&&(t=Wl(t,a));let l=t;return i&&(l=Il(l,ll.getInnerShadowSpread(this,i))),n&&(l=Il(l,n)),this.__layout.renderShapeSpread=l,h?Il(h.__updateRenderSpread(),t):t}},{stintSet:zl}=f,Yl={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);zl(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),zl(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:i,stroke:s}=t,n=t.innerShadow||t.blur||t.backgroundBlur||t.filter;zl(t,"__isFastShadow",e&&!n&&e.length<2&&!e[0].spread&&!ll.isTransformShadow(e[0])&&i&&!t.__isTransparentFill&&!(u(i)&&i.length>1)&&(this.useFastShadow||!s||s&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!n)}t.__checkSingle(),zl(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){Xl(this,t,e)},__draw(t,e,i){const s=this.__;if(s.__complex){s.__needComputePaint&&s.__computePaint();const{fill:n,stroke:r,__drawAfterFill:o,__fillAfterStroke:a,__isFastShadow:h}=s;if(this.__drawRenderPath(t),s.__useEffect&&!h){const h=ol.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=s;l&&ll.shadow(this,t,h),a&&(s.__isStrokes?ol.strokes(r,this,t,e):ol.stroke(r,this,t,e)),n&&(s.__isFills?ol.fills(n,this,t,e):ol.fill(n,this,t,e)),o&&this.__drawAfterFill(t,e),d&&ll.innerShadow(this,t,h),r&&!a&&(s.__isStrokes?ol.strokes(r,this,t,e):ol.stroke(r,this,t,e)),c&&dl.apply(c,this,this.__nowWorld,t,i,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(s.__isStrokes?ol.strokes(r,this,t,e):ol.stroke(r,this,t,e)),h){const e=s.shadow[0],{scaleX:i,scaleY:n}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*n,e.blur*i,sl.string(e.color))}n&&(s.__isFills?ol.fills(n,this,t,e):ol.fill(n,this,t,e)),h&&t.restore(),o&&this.__drawAfterFill(t,e),r&&!a&&(s.__isStrokes?ol.strokes(r,this,t,e):ol.stroke(r,this,t,e))}}else s.__pathForRender?Xl(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const i=this.__,{fill:s,stroke:n}=i;s&&!e.ignoreFill&&(i.__isAlphaPixelFill?ol.fills(s,this,t,e):ol.fill("#000000",this,t,e)),i.__isCanvas&&this.__drawAfterFill(t,e),n&&!e.ignoreStroke&&(i.__isAlphaPixelStroke?ol.strokes(n,this,t,e):ol.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 Xl(t,e,i){const{fill:s,stroke:n,__drawAfterFill:r,__fillAfterStroke:o}=t.__;t.__drawRenderPath(e),o&&ol.stroke(n,t,e,i),s&&ol.fill(s,t,e,i),r&&t.__drawAfterFill(e,i),n&&!o&&ol.stroke(n,t,e,i)}const Ul={__drawFast(t,e){let{x:i,y:s,width:n,height:r}=this.__layout.boxBounds;const{fill:o,stroke:a,__drawAfterFill:h}=this.__;if(o&&(t.fillStyle=o,t.fillRect(i,s,n,r)),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,n,r);break;case"inside":n-=h,r-=h,n<0||r<0?(t.save(),this.__clip(t,e),t.strokeRect(i+l,s+l,n,r),t.restore()):t.strokeRect(i+l,s+l,n,r);break;case"outside":t.strokeRect(i-l,s-l,n+h,r+h)}}}};var jl;let Hl=jl=class extends gh{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set strokeWidthFixed(t){this.strokeScaleFixed=t}get strokeWidthFixed(){return this.strokeScaleFixed}set scale(t){I.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 qn.set(this.path=t||[]),t||this.__drawPathByBox(qn),qn}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return a(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}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 i=e?this.__.__pathForRender:this.__.path;return i||(qn.set(i=[]),this.__drawPathByBox(qn,!e)),t?ns.toCanvasData(i,!0):i}getPathString(t,e,i){return ns.stringify(this.getPath(t,e),i)}asPath(t,e){this.path=this.getPath(t,e)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||cl.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(t){const e=this.__;e.path?(e.__pathForRender=e.cornerRadius?Hn.smooth(e.path,e.cornerRadius,e.cornerSmoothing):e.path,e.__useArrow&&rl.addArrows(this,t)):e.__pathForRender&&(e.__pathForRender=void 0)}__drawRenderPath(t){const e=this.__;t.beginPath(),e.__useArrow&&rl.updateArrow(this),this.__drawPathByData(t,e.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path,!0)}__drawPathByData(t,e,i){e?on.drawPathByData(t,e):this.__drawPathByBox(t,i)}__drawPathByBox(t,e){const{x:i,y:s,width:n,height:r}=this.__layout.boxBounds;if(this.__.cornerRadius&&!e){const{cornerRadius:e}=this.__;t.roundRect(i,s,n,r,l(e)?[e]:e)}else t.rect(i,s,n,r);t.closePath()}drawImagePlaceholder(t,e,i){ol.fill(this.__.placeholderColor,this,e,i)}animate(t,e,i,s){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,i,s,n){return ge.get(t.tag||this.prototype.__tag,t,e,i,s,n)}static registerUI(){Zr()(this)}static registerData(t){Ur(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()}};i([Ur(wl)],Hl.prototype,"__",void 0),i([tl()],Hl.prototype,"zoomLayer",void 0),i([yr("")],Hl.prototype,"id",void 0),i([yr("")],Hl.prototype,"name",void 0),i([yr("")],Hl.prototype,"className",void 0),i([Or("pass-through")],Hl.prototype,"blendMode",void 0),i([Dr(1)],Hl.prototype,"opacity",void 0),i([Mr(!0)],Hl.prototype,"visible",void 0),i([Or(!1)],Hl.prototype,"locked",void 0),i([Ar(!1)],Hl.prototype,"dim",void 0),i([Ar(!1)],Hl.prototype,"dimskip",void 0),i([Wr(0)],Hl.prototype,"zIndex",void 0),i([Nr(!1)],Hl.prototype,"mask",void 0),i([zr(!1)],Hl.prototype,"eraser",void 0),i([mr(0,!0)],Hl.prototype,"x",void 0),i([mr(0,!0)],Hl.prototype,"y",void 0),i([Sr(100,!0)],Hl.prototype,"width",void 0),i([Sr(100,!0)],Hl.prototype,"height",void 0),i([xr(1,!0)],Hl.prototype,"scaleX",void 0),i([xr(1,!0)],Hl.prototype,"scaleY",void 0),i([br(0,!0)],Hl.prototype,"rotation",void 0),i([br(0,!0)],Hl.prototype,"skewX",void 0),i([br(0,!0)],Hl.prototype,"skewY",void 0),i([mr(0,!0)],Hl.prototype,"offsetX",void 0),i([mr(0,!0)],Hl.prototype,"offsetY",void 0),i([vr(0,!0)],Hl.prototype,"scrollX",void 0),i([vr(0,!0)],Hl.prototype,"scrollY",void 0),i([wr()],Hl.prototype,"origin",void 0),i([wr()],Hl.prototype,"around",void 0),i([yr(!1)],Hl.prototype,"lazy",void 0),i([kr(1)],Hl.prototype,"pixelRatio",void 0),i([Lr(0)],Hl.prototype,"renderSpread",void 0),i([Pr()],Hl.prototype,"path",void 0),i([Tr()],Hl.prototype,"windingRule",void 0),i([Tr(!0)],Hl.prototype,"closed",void 0),i([Sr(0)],Hl.prototype,"padding",void 0),i([Sr(!1)],Hl.prototype,"lockRatio",void 0),i([Sr()],Hl.prototype,"widthRange",void 0),i([Sr()],Hl.prototype,"heightRange",void 0),i([yr(!1)],Hl.prototype,"draggable",void 0),i([yr()],Hl.prototype,"dragBounds",void 0),i([yr("auto")],Hl.prototype,"dragBoundsType",void 0),i([yr(!1)],Hl.prototype,"editable",void 0),i([Yr(!0)],Hl.prototype,"hittable",void 0),i([Yr("path")],Hl.prototype,"hitFill",void 0),i([Rr("path")],Hl.prototype,"hitStroke",void 0),i([Yr(!1)],Hl.prototype,"hitBox",void 0),i([Yr(!0)],Hl.prototype,"hitChildren",void 0),i([Yr(!0)],Hl.prototype,"hitSelf",void 0),i([Yr()],Hl.prototype,"hitRadius",void 0),i([Xr("")],Hl.prototype,"cursor",void 0),i([Or()],Hl.prototype,"fill",void 0),i([Rr(void 0,!0)],Hl.prototype,"stroke",void 0),i([Rr("inside")],Hl.prototype,"strokeAlign",void 0),i([Rr(1,!0)],Hl.prototype,"strokeWidth",void 0),i([Rr(!1)],Hl.prototype,"strokeScaleFixed",void 0),i([Rr("none")],Hl.prototype,"strokeCap",void 0),i([Rr("miter")],Hl.prototype,"strokeJoin",void 0),i([Rr()],Hl.prototype,"dashPattern",void 0),i([Rr(0)],Hl.prototype,"dashOffset",void 0),i([Rr(10)],Hl.prototype,"miterLimit",void 0),i([Tr(0)],Hl.prototype,"cornerRadius",void 0),i([Tr()],Hl.prototype,"cornerSmoothing",void 0),i([Qh()],Hl.prototype,"shadow",void 0),i([Qh()],Hl.prototype,"innerShadow",void 0),i([Qh()],Hl.prototype,"blur",void 0),i([Qh()],Hl.prototype,"backgroundBlur",void 0),i([Qh()],Hl.prototype,"grayscale",void 0),i([Qh()],Hl.prototype,"filter",void 0),i([Or()],Hl.prototype,"placeholderColor",void 0),i([yr(100)],Hl.prototype,"placeholderDelay",void 0),i([yr({})],Hl.prototype,"data",void 0),i([Kr(gh.prototype.reset)],Hl.prototype,"reset",null),Hl=jl=i([Qr(Nl),Qr(Yl),$r()],Hl);let Vl=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:i}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),i.forEach(t=>this.add(t)),t.children=i}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);if(!this.childlessJSON){const i=e.children=[];this.children.forEach(e=>e.skipJSON||i.push(e.toJSON(t)))}return e}pick(t,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))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};var ql;i([Ur(bl)],Vl.prototype,"__",void 0),i([Sr(0)],Vl.prototype,"width",void 0),i([Sr(0)],Vl.prototype,"height",void 0),Vl=i([Qr(Bh),Zr()],Vl);const Gl=re.get("Leafer");let Kl=ql=class extends Vl{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&ir.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,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),ql.list.add(this)}init(t,e){if(this.canvas)return;let i;const{config:s}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),i=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,f.assign(s,t));const n=this.canvas=_e.canvas(s);this.__controllers.push(this.renderer=_e.renderer(this,n,s),this.watcher=_e.watcher(this,s),this.layouter=_e.layouter(this,s)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),e||(this.selector=_e.selector(this),this.interaction=_e.interaction(this,n,this.selector,s),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=_e.hitCanvasManager()),this.canvasManager=new we,i=s.start),this.hittable=s.hittable,this.fill=s.fill,this.canvasManager.add(n),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),Lo.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(na.RESTART):this.emitLeafer(na.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(na.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:i}=this;i&&(i.addBlock(t?new Kt(t):this.canvas.bounds),this.viewReady&&(e?i.render():i.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 i=f.copyAttrs({},this.canvas,Ae);e.resize(t),this.updateLazyBounds(),this.__onResize(new ta(t,i))}__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 Jt(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(na.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:i,canvas:s}=this,n=f.copyAttrs({},s,Ae);n[t]=i[t]=e,i.width&&i.height?s.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(n)}__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(na.BEFORE_READY),this.emitLeafer(na.READY),this.emitLeafer(na.AFTER_READY),Lo.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(na.VIEW_READY),Lo.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:i}=this.config;if(t){let{width:s,height:n,pixelRatio:r}=this;const o="box"===t?this.worldBoxBounds:this.__world;e||(s=Math.max(1,o.x+o.width)),i||(n=Math.max(1,o.y+o.height)),this.__doResize({width:s,height:n,pixelRatio:r})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){Lo.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(na.VIEW_COMPLETED),Lo.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,i){e&&(t=t.bind(e));const s=this.__nextRenderWait;if(i){for(let e=0;e<s.length;e++)if(s[e]===t){s.splice(e,1);break}}else s.push(t);this.requestRender()}zoom(t,e,i,s){return ue.need("view")}getValidMove(t,e,i){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:i}=this.clientBounds;return{x:e+t.x,y:i+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new na(t,this))}__listenEvents(){const t=le.start("FirstCreate "+this.innerName);this.once([[na.START,()=>le.end(t)],[ia.START,this.updateLazyBounds,this],[sa.START,this.__onCreated,this],[sa.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[ea.DATA,this.__onWatchData,this],[ia.END,this.__onLayoutEnd,this],[sa.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){ql.list.remove(this);try{this.stop(),this.emitLeafer(na.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(()=>{nr.clearRecycled()},100)}catch(t){Gl.error(t)}}};t?e():setTimeout(e)}};Kl.list=new Ph,i([Ur(kl)],Kl.prototype,"__",void 0),i([Sr()],Kl.prototype,"pixelRatio",void 0),i([yr("normal")],Kl.prototype,"mode",void 0),Kl=ql=i([Zr()],Kl);let $l=class extends Hl{get __tag(){return"Rect"}};i([Ur(Tl)],$l.prototype,"__",void 0),$l=i([Qr(Ul),$r(),Zr()],$l);const{add:Jl,includes:Ql,scroll:Zl}=Ht,td=$l.prototype,ed=Vl.prototype;let id=class extends Vl{get __tag(){return"Box"}get isBranchLeaf(){return!0}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.pathInputed){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 i=this.__,s=this.__layout,{renderBounds:n,boxBounds:r}=s,{overflow:o}=i,a=s.childrenRenderBounds||(s.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=o&&o.includes("scroll"))&&(Jl(a,r),Zl(a,i)),this.__updateRectRenderBounds(),t=!Ql(r,a),t&&"show"===o&&Jl(n,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))}};i([Ur(Sl)],id.prototype,"__",void 0),i([Sr(100)],id.prototype,"width",void 0),i([Sr(100)],id.prototype,"height",void 0),i([yr(!1)],id.prototype,"resizeChildren",void 0),i([Lr("show")],id.prototype,"overflow",void 0),i([Kr(td.__updateStrokeSpread)],id.prototype,"__updateStrokeSpread",null),i([Kr(td.__updateRenderSpread)],id.prototype,"__updateRectRenderSpread",null),i([Kr(td.__updateBoxBounds)],id.prototype,"__updateRectBoxBounds",null),i([Kr(td.__updateStrokeBounds)],id.prototype,"__updateStrokeBounds",null),i([Kr(td.__updateRenderBounds)],id.prototype,"__updateRectRenderBounds",null),i([Kr(td.__updateChange)],id.prototype,"__updateRectChange",null),i([Kr(td.__render)],id.prototype,"__renderRect",null),i([Kr(ed.__render)],id.prototype,"__renderGroup",null),id=i([$r(),Zr()],id);let sd=class extends id{get __tag(){return"Frame"}get isFrame(){return!0}};i([Ur(Bl)],sd.prototype,"__",void 0),i([Or("#FFFFFF")],sd.prototype,"fill",void 0),i([Lr("hide")],sd.prototype,"overflow",void 0),sd=i([Zr()],sd);const{moveTo:nd,closePath:rd,ellipse:od}=Ts;let ad=class extends Hl{get __tag(){return"Ellipse"}__updatePath(){const t=this.__,{width:e,height:i,innerRadius:s,startAngle:n,endAngle:r}=t,o=e/2,a=i/2,h=t.path=[];let l;s?n||r?(s<1?od(h,o,a,o*s,a*s,0,n,r,!1):l=!0,od(h,o,a,o,a,0,r,n,!0)):(s<1&&(od(h,o,a,o*s,a*s),nd(h,e,a)),od(h,o,a,o,a,0,360,0,!0)):n||r?(nd(h,o,a),od(h,o,a,o,a,0,n,r,!1)):od(h,o,a,o,a),l||rd(h),(ie.ellipseToCurve||t.__useArrow)&&(t.path=this.getPath(!0))}};i([Ur(El)],ad.prototype,"__",void 0),i([Tr(0)],ad.prototype,"innerRadius",void 0),i([Tr(0)],ad.prototype,"startAngle",void 0),i([Tr(0)],ad.prototype,"endAngle",void 0),ad=i([Zr()],ad);const{sin:hd,cos:ld,PI:dd}=Math,{moveTo:cd,lineTo:ud,closePath:_d,drawPoints:pd}=Ts;let gd=class extends Hl{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)pd(e,t.points,t.curve,!0);else{const{width:i,height:s,sides:n}=t,r=i/2,o=s/2;cd(e,r,0);for(let t=1;t<n;t++)ud(e,r+r*hd(2*t*dd/n),o-o*ld(2*t*dd/n));_d(e)}}};i([Ur(Cl)],gd.prototype,"__",void 0),i([Tr(3)],gd.prototype,"sides",void 0),i([Tr()],gd.prototype,"points",void 0),i([Tr(0)],gd.prototype,"curve",void 0),gd=i([$r(),Zr()],gd);const{sin:fd,cos:yd,PI:md}=Math,{moveTo:vd,lineTo:wd,closePath:xd}=Ts;let bd=class extends Hl{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:i,innerRadius:s}=this.__,n=t/2,r=e/2,o=this.__.path=[];vd(o,n,0);for(let t=1;t<2*i;t++)wd(o,n+(t%2==0?n:n*s)*fd(t*md/i),r-(t%2==0?r:r*s)*yd(t*md/i));xd(o)}};i([Ur(Rl)],bd.prototype,"__",void 0),i([Tr(5)],bd.prototype,"corners",void 0),i([Tr(.382)],bd.prototype,"innerRadius",void 0),bd=i([Zr()],bd);const{moveTo:Sd,lineTo:kd,drawPoints:Bd}=Ts,{rotate:Pd,getAngle:Td,getDistance:Ed,defaultPoint:Cd}=dt;let Rd=class extends Hl{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i={x:0,y:0};return t&&(i.x=t),e&&Pd(i,e),i}set toPoint(t){this.width=Ed(Cd,t),this.rotation=Td(Cd,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?Bd(e,t.points,t.curve,t.closed):(Sd(e,0,0),kd(e,this.width,0))}};i([Ur(Pl)],Rd.prototype,"__",void 0),i([Er("center")],Rd.prototype,"strokeAlign",void 0),i([Sr(0)],Rd.prototype,"height",void 0),i([Tr()],Rd.prototype,"points",void 0),i([Tr(0)],Rd.prototype,"curve",void 0),i([Tr(!1)],Rd.prototype,"closed",void 0),Rd=i([Zr()],Rd);let Ld=class extends $l{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}};i([Ur(Ml)],Ld.prototype,"__",void 0),i([Sr("")],Ld.prototype,"url",void 0),Ld=i([Zr()],Ld);const Od=Ld;let Ad=class extends $l{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 hr({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new qo(qo.LOADED,{image:t}))})}draw(t,e,i,s){const n=new mt(t.worldTransform).invert(),r=new mt;e&&r.translate(e.x,e.y),i&&(l(i)?r.scale(i):r.scale(i.x,i.y)),s&&r.rotate(s),n.multiplyParent(r),t.__render(this.canvas,{matrix:n.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:i,height:s}=this.__,{view:n}=this.canvas;t.drawImage(n,0,0,n.width,n.height,0,0,i,s)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:i}=this.__;t.resize(this.__,i),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};i([Ur(Fl)],Ad.prototype,"__",void 0),i([Zh(100)],Ad.prototype,"width",void 0),i([Zh(100)],Ad.prototype,"height",void 0),i([Zh(1)],Ad.prototype,"pixelRatio",void 0),i([Zh(!0)],Ad.prototype,"smooth",void 0),i([yr(!1)],Ad.prototype,"safeResize",void 0),i([Zh()],Ad.prototype,"contextSettings",void 0),Ad=i([Zr()],Ad);const{copyAndSpread:Dd,includes:Md,spread:Fd,setList:Id}=Ht,{stintSet:Wd}=f;let Nd=class extends Hl{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:i,fontFamily:s,fontSize:n,fontWeight:r,italic:o,textCase:a,textOverflow:h,padding:l,width:d,height:c}=t;t.__lineHeight=nl.number(e,n),t.__letterSpacing=nl.number(i,n),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*n)/2,t.__font=`${o?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==r?r+" ":""}${n||12}px ${s||"caption"}`,Wd(t,"__padding",l&&I.fourNumber(l)),Wd(t,"__clipText","show"!==h&&!t.__autoSize),Wd(t,"__isCharMode",d||c||t.__letterSpacing||"none"!==a),t.__textDrawData=il.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:i,italic:s,padding:n,__autoWidth:r,__autoHeight:o}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<i&&Fd(a,i/2),r||o){if(h.x=r?a.x:0,h.y=o?a.y:0,h.width=r?a.width:t.width,h.height=o?a.height:t.height,n){const[e,i,s,n]=t.__padding;r&&(h.x-=n,h.width+=i+n),o&&(h.y-=e,h.height+=s+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();s&&(h.width+=.16*i),f.stintSet(this,"isOverflow",!Md(h,a)),this.isOverflow?(Id(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;Dd(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,i){const s=this.__box;s&&(s.__nowWorld=this.__nowWorld,s.__draw(t,e,i)),this.textEditing&&!e.exporting||super.__draw(t,e,i)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};i([Ur(Dl)],Nd.prototype,"__",void 0),i([Sr(0)],Nd.prototype,"width",void 0),i([Sr(0)],Nd.prototype,"height",void 0),i([Or()],Nd.prototype,"boxStyle",void 0),i([yr(!1)],Nd.prototype,"resizeFontSize",void 0),i([Or("#000000")],Nd.prototype,"fill",void 0),i([Er("outside")],Nd.prototype,"strokeAlign",void 0),i([Yr("all")],Nd.prototype,"hitFill",void 0),i([Sr("")],Nd.prototype,"text",void 0),i([Sr("")],Nd.prototype,"placeholder",void 0),i([Sr("caption")],Nd.prototype,"fontFamily",void 0),i([Sr(12)],Nd.prototype,"fontSize",void 0),i([Sr("normal")],Nd.prototype,"fontWeight",void 0),i([Sr(!1)],Nd.prototype,"italic",void 0),i([Sr("none")],Nd.prototype,"textCase",void 0),i([Sr("none")],Nd.prototype,"textDecoration",void 0),i([Sr(0)],Nd.prototype,"letterSpacing",void 0),i([Sr({type:"percent",value:1.5})],Nd.prototype,"lineHeight",void 0),i([Sr(0)],Nd.prototype,"paraIndent",void 0),i([Sr(0)],Nd.prototype,"paraSpacing",void 0),i([Sr("x")],Nd.prototype,"writingMode",void 0),i([Sr("left")],Nd.prototype,"textAlign",void 0),i([Sr("top")],Nd.prototype,"verticalAlign",void 0),i([Sr(!0)],Nd.prototype,"autoSizeAlign",void 0),i([Sr("normal")],Nd.prototype,"textWrap",void 0),i([Sr("show")],Nd.prototype,"textOverflow",void 0),i([Or(!1)],Nd.prototype,"textEditing",void 0),Nd=i([Zr()],Nd);let zd=class extends Hl{get __tag(){return"Path"}};i([Ur(Ll)],zd.prototype,"__",void 0),i([Er("center")],zd.prototype,"strokeAlign",void 0),zd=i([Zr()],zd);let Yd=class extends Vl{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new zd(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,i,s,n,r){return this}quadraticCurveTo(t,e,i,s){return this}closePath(){return this}rect(t,e,i,s){return this}roundRect(t,e,i,s,n){return this}ellipse(t,e,i,s,n,r,o,a){return this}arc(t,e,i,s,n,r){return this}arcTo(t,e,i,s,n){return this}drawEllipse(t,e,i,s,n,r,o,a){return this}drawArc(t,e,i,s,n,r){return this}drawPoints(t,e,i){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}};i([Ur(Ol)],Yd.prototype,"__",void 0),i([(t,e)=>{cr(t,e,{get(){return this.__path}})}],Yd.prototype,"path",void 0),Yd=i([Qr(js,["set","path","paint"]),Zr()],Yd);let Xd=class extends Kl{get __tag(){return"App"}get isApp(){return!0}constructor(t,e){super(t,e)}init(t,e){if(super.init(t,e),t){const{ground:e,tree:i,sky:s,editor:n}=t;e&&(this.ground=this.addLeafer(e)),(i||n)&&(this.tree=this.addLeafer(i||{type:t.type||"design"})),(s||n)&&(this.sky=this.addLeafer(s)),n&&_e.editor(n,this)}}__setApp(){const{canvas:t}=this,{realCanvas:e,view:i}=this.config;e||i===this.canvas.view||!t.parentView?this.realCanvas=!0:t.unrealCanvas(),this.leafer=this,this.watcher.disable(),this.layouter.disable()}__updateLocalBounds(){this.forEach(t=>t.updateLayout()),super.__updateLocalBounds()}start(){super.start(),this.forEach(t=>t.start())}stop(){this.forEach(t=>t.stop()),super.stop()}unlockLayout(){super.unlockLayout(),this.forEach(t=>t.unlockLayout())}lockLayout(){super.lockLayout(),this.forEach(t=>t.lockLayout())}forceRender(t,e){this.forEach(i=>i.forceRender(t,e))}addLeafer(t){const e=new Kl(t);return this.add(e),e}add(t,e){if(!t.view){if(this.realCanvas&&!this.canvas.bounds)return void setTimeout(()=>this.add(t,e),10);t.init(this.__getChildConfig(t.userConfig),this)}super.add(t,e),r(e)||(t.canvas.childIndex=e),this.__listenChildEvents(t)}forEach(t){this.children.forEach(t)}__onCreated(){this.created=this.children.every(t=>t.created)}__onReady(){this.children.every(t=>t.ready)&&super.__onReady()}__onViewReady(){this.children.every(t=>t.viewReady)&&super.__onViewReady()}__onChildRenderEnd(t){this.renderer.addBlock(t.renderBounds),this.viewReady&&this.renderer.update()}__render(t,e){t.context&&this.forEach(i=>e.matrix?i.__render(t,e):t.copyWorld(i.canvas,e.bounds,void 0,void 0,!0))}__onResize(t){this.forEach(e=>e.resize(t)),super.__onResize(t)}updateLayout(){this.forEach(t=>t.updateLayout())}__getChildConfig(t){const e=Object.assign({},this.config);return e.hittable=e.realCanvas=void 0,t&&f.assign(e,t),this.autoLayout&&f.copyAttrs(e,this,Ae),e.view=this.realCanvas?void 0:this.view,e.fill=void 0,e}__listenChildEvents(t){t.once([[ia.END,this.__onReady,this],[sa.START,this.__onCreated,this],[sa.END,this.__onViewReady,this]]),this.realCanvas&&this.__eventIds.push(t.on_(sa.END,this.__onChildRenderEnd,this))}};Xd=i([Zr()],Xd);const Ud={},jd={isHoldSpaceKey:()=>jd.isHold("Space"),isHold:t=>Ud[t],isHoldKeys:(t,e)=>e?t(e):void 0,setDownCode(t){Ud[t]||(Ud[t]=!0)},setUpCode(t){Ud[t]=!1}},Hd={LEFT:1,RIGHT:2,MIDDLE:4,defaultLeft(t){t.buttons||(t.buttons=1)},left:t=>1===t.buttons,right:t=>2===t.buttons,middle:t=>4===t.buttons};class Vd extends Xo{get spaceKey(){return jd.isHoldSpaceKey()}get left(){return Hd.left(this)}get right(){return Hd.right(this)}get middle(){return Hd.middle(this)}constructor(t){super(t.type),this.bubbles=!0,Object.assign(this,t)}isHoldKeys(t){return jd.isHoldKeys(t,this)}getBoxPoint(t){return(t||this.current).getBoxPoint(this)}getInnerPoint(t){return(t||this.current).getInnerPoint(this)}getLocalPoint(t){return(t||this.current).getLocalPoint(this)}getPagePoint(){return this.current.getPagePoint(this)}getInner(t){return this.getInnerPoint(t)}getLocal(t){return this.getLocalPoint(t)}getPage(){return this.getPagePoint()}static changeName(t,e){me.changeName(t,e)}}const{min:qd,max:Gd,abs:Kd}=Math,{float:$d,sign:Jd}=I,{minX:Qd,maxX:Zd,minY:tc,maxY:ec}=Ht,ic=new Kt,sc=new Kt,nc={limitMove(t,e){const{dragBounds:i,dragBoundsType:s}=t;i&&rc.getValidMove(t.__localBoxBounds,rc.getDragBounds(t),s,e,!0),rc.axisMove(t,e)},limitScaleOf(t,e,i,s){const{dragBounds:n,dragBoundsType:r}=t;n&&rc.getValidScaleOf(t.__localBoxBounds,rc.getDragBounds(t),r,t.getLocalPointByInner(t.getInnerPointByBox(e)),i,s,!0)},axisMove(t,e){const{draggable:i}=t;"x"===i&&(e.y=0),"y"===i&&(e.x=0)},getDragBounds(t){const{dragBounds:e}=t;return"parent"===e?t.parent.boxBounds:e},isInnerMode:(t,e,i,s)=>"inner"===i||"auto"===i&&t[s]>e[s],getValidMove(t,e,i,s,n){const r=t.x+s.x,o=t.y+s.y,a=r+t.width,h=o+t.height,l=e.x+e.width,d=e.y+e.height;return n||(s=Object.assign({},s)),rc.isInnerMode(t,e,i,"width")?r>e.x?s.x+=e.x-r:a<l&&(s.x+=l-a):r<e.x?s.x+=e.x-r:a>l&&(s.x+=l-a),rc.isInnerMode(t,e,i,"height")?o>e.y?s.y+=e.y-o:h<d&&(s.y+=d-h):o<e.y?s.y+=e.y-o:h>d&&(s.y+=d-h),s.x=$d(s.x),s.y=$d(s.y),s},getValidScaleOf(t,e,i,s,n,r,o){o||(n=Object.assign({},n)),sc.set(e),ic.set(t).scaleOf(s,n.x,n.y);const a=(s.x-t.x)/t.width,l=1-a,d=(s.y-t.y)/t.height,c=1-d;let u,_,p,g,f=1,y=1;return rc.isInnerMode(t,e,i,"width")?(n.x<0&&ic.scaleOf(s,f=1/n.x,1),p=$d(ic.minX-sc.minX),g=$d(sc.maxX-ic.maxX),u=a&&p>0?1+p/(a*ic.width):1,_=l&&g>0?1+g/(l*ic.width):1,f*=Gd(u,_)):(n.x<0&&(($d(Qd(t)-Qd(e))<=0||$d(Zd(e)-Zd(t))<=0)&&ic.scaleOf(s,f=1/n.x,1),ic.unsign()),p=$d(sc.minX-ic.minX),g=$d(ic.maxX-sc.maxX),u=a&&p>0?1-p/(a*ic.width):1,_=l&&g>0?1-g/(l*ic.width):1,f*=qd(u,_)),rc.isInnerMode(t,e,i,"height")?(n.y<0&&ic.scaleOf(s,1,y=1/n.y),p=$d(ic.minY-sc.minY),g=$d(sc.maxY-ic.maxY),u=d&&p>0?1+p/(d*ic.height):1,_=c&&g>0?1+g/(c*ic.height):1,y*=Gd(u,_),r&&(u=Gd(Kd(f),Kd(y)),f=Jd(f)*u,y=Jd(y)*u)):(n.y<0&&(($d(tc(t)-tc(e))<=0||$d(ec(e)-ec(t))<=0)&&ic.scaleOf(s,1,y=1/n.y),ic.unsign()),p=$d(sc.minY-ic.minY),g=$d(ic.maxY-sc.maxY),u=d&&p>0?1-p/(d*ic.height):1,_=c&&g>0?1-g/(c*ic.height):1,y*=qd(u,_)),n.x*=h(f)?f:1,n.y*=h(y)?y:1,n}},rc=nc;let oc=class extends Vd{};oc.POINTER="pointer",oc.BEFORE_DOWN="pointer.before_down",oc.BEFORE_MOVE="pointer.before_move",oc.BEFORE_UP="pointer.before_up",oc.DOWN="pointer.down",oc.MOVE="pointer.move",oc.UP="pointer.up",oc.OVER="pointer.over",oc.OUT="pointer.out",oc.ENTER="pointer.enter",oc.LEAVE="pointer.leave",oc.TAP="tap",oc.DOUBLE_TAP="double_tap",oc.CLICK="click",oc.DOUBLE_CLICK="double_click",oc.LONG_PRESS="long_press",oc.LONG_TAP="long_tap",oc.MENU="pointer.menu",oc.MENU_TAP="pointer.menu_tap",oc=i([to()],oc);const ac=oc,hc={};let lc=class extends oc{static setList(t){this.list=t instanceof Ph?t:new Ph(t)}static setData(t){this.data=t}static getValidMove(t,e,i,s=!0){const n=t.getLocalPoint(i,null,!0);return dt.move(n,e.x-t.x,e.y-t.y),s&&this.limitMove(t,n),nc.axisMove(t,n),n}static limitMove(t,e){nc.limitMove(t,e)}getPageMove(t){return this.assignMove(t),this.current.getPagePoint(hc,null,!0)}getInnerMove(t,e){return t||(t=this.current),this.assignMove(e),t.getInnerPoint(hc,null,!0)}getLocalMove(t,e){return t||(t=this.current),this.assignMove(e),t.getLocalPoint(hc,null,!0)}getPageTotal(){return this.getPageMove(!0)}getInnerTotal(t){return this.getInnerMove(t,!0)}getLocalTotal(t){return this.getLocalMove(t,!0)}getPageBounds(){const t=this.getPageTotal(),e=this.getPagePoint(),i={};return Ht.set(i,e.x-t.x,e.y-t.y,t.x,t.y),Ht.unsign(i),i}assignMove(t){hc.x=t?this.totalX:this.moveX,hc.y=t?this.totalY:this.moveY}};lc.BEFORE_DRAG="drag.before_drag",lc.START="drag.start",lc.DRAG="drag",lc.END="drag.end",lc.OVER="drag.over",lc.OUT="drag.out",lc.ENTER="drag.enter",lc.LEAVE="drag.leave",lc=i([to()],lc);const dc=lc;let cc=class extends oc{static setList(t){lc.setList(t)}static setData(t){lc.setData(t)}};cc.DROP="drop",cc=i([to()],cc);let uc=class extends lc{};uc.BEFORE_MOVE="move.before_move",uc.START="move.start",uc.MOVE="move",uc.DRAG_ANIMATE="move.drag_animate",uc.END="move.end",uc.PULL_DOWN="move.pull_down",uc.REACH_BOTTOM="move.reach_bottom",uc=i([to()],uc);let _c=class extends Vd{};_c=i([to()],_c);const pc=_c;let gc=class extends oc{};gc.BEFORE_ROTATE="rotate.before_rotate",gc.START="rotate.start",gc.ROTATE="rotate",gc.END="rotate.end",gc=i([to()],gc);let fc=class extends lc{};fc.SWIPE="swipe",fc.LEFT="swipe.left",fc.RIGHT="swipe.right",fc.UP="swipe.up",fc.DOWN="swipe.down",fc=i([to()],fc);let yc=class extends oc{};yc.BEFORE_ZOOM="zoom.before_zoom",yc.START="zoom.start",yc.ZOOM="zoom",yc.END="zoom.end",yc=i([to()],yc);let mc=class extends Vd{};mc.BEFORE_DOWN="key.before_down",mc.BEFORE_UP="key.before_up",mc.DOWN="key.down",mc.HOLD="key.hold",mc.UP="key.up",mc=i([to()],mc);const vc={getDragEventData:(t,e,i)=>Object.assign(Object.assign({},i),{x:i.x,y:i.y,moveX:i.x-e.x,moveY:i.y-e.y,totalX:i.x-t.x,totalY:i.y-t.y}),getDropEventData:(t,e,i)=>Object.assign(Object.assign({},t),{list:e,data:i}),getSwipeDirection:t=>t<-45&&t>-135?fc.UP:t>45&&t<135?fc.DOWN:t<=45&&t>=-45?fc.RIGHT:fc.LEFT,getSwipeEventData:(t,e,i)=>Object.assign(Object.assign({},i),{moveX:e.moveX,moveY:e.moveY,totalX:i.x-t.x,totalY:i.y-t.y,type:wc.getSwipeDirection(dt.getAngle(t,i))}),getBase(t){const e=1===t.button?4:t.button;return{altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,time:Date.now(),buttons:r(t.buttons)?1:0===t.buttons?e:t.buttons,origin:t}},pathHasEventType(t,e){const{list:i}=t;for(let t=0,s=i.length;t<s;t++)if(i[t].hasEvent(e))return!0;return!1},filterPathByEventType(t,e){const i=new Ph,{list:s}=t;for(let t=0,n=s.length;t<n;t++)s[t].hasEvent(e)&&i.add(s[t]);return i},pathCanDrag:t=>t&&t.list.some(t=>_o.draggable(t)||!t.isLeafer&&t.hasEvent(lc.DRAG)),pathHasOutside:t=>t&&t.list.some(t=>t.isOutside)},wc=vc,xc=new Ph,{getDragEventData:bc,getDropEventData:Sc,getSwipeEventData:kc}=vc;class Bc{constructor(t){this.dragDataList=[],this.interaction=t}setDragData(t){this.animateWait&&this.dragEndReal(),this.downData=this.interaction.downData,this.dragData=bc(t,t,t),this.canAnimate=this.canDragOut=!0}getList(t,e){const{proxy:i}=this.interaction.selector,s=i&&i.list.length,n=lc.list||this.draggableList||xc;return this.dragging&&(s?t?xc:new Ph(e?[...i.list,...i.dragHoverExclude]:i.list):n)}checkDrag(t,e){const{interaction:i}=this;if(this.moving&&t.buttons<1)return this.canAnimate=!1,void i.pointerCancel();!this.moving&&e&&(this.moving=i.canMove(this.downData)||i.isHoldRightKey||i.isMobileDragEmpty)&&(this.dragData.moveType="drag",i.emit(uc.START,this.dragData)),this.moving||this.dragStart(t,e),this.drag(t)}dragStart(t,e){this.dragging||(this.dragging=e&&Hd.left(t),this.dragging&&(this.interaction.emit(lc.START,this.dragData),this.getDraggableList(this.dragData.path),this.setDragStartPoints(this.realDraggableList=this.getList(!0))))}setDragStartPoints(t){this.dragStartPoints={},t.forEach(t=>this.dragStartPoints[t.innerId]={x:t.x,y:t.y})}getDraggableList(t){let e;for(let i=0,s=t.length;i<s;i++)if(e=t.list[i],_o.draggable(e)){this.draggableList=new Ph(e);break}}drag(t){const{interaction:e,dragData:i,downData:s}=this,{path:n,throughPath:r}=s;this.dragData=bc(s,i,t),r&&(this.dragData.throughPath=r),this.dragData.path=n,this.dragDataList.push(this.dragData),this.moving?(t.moving=!0,this.dragData.moveType="drag",e.emit(uc.BEFORE_MOVE,this.dragData),e.emit(uc.MOVE,this.dragData)):this.dragging&&(t.dragging=!0,this.dragReal(),e.emit(lc.BEFORE_DRAG,this.dragData),e.emit(lc.DRAG,this.dragData))}dragReal(t){const{interaction:e}=this,{running:i}=e,s=this.realDraggableList;if(s.length&&i){const{totalX:i,totalY:n}=this.dragData,{dragLimitAnimate:r}=e.p,o=!r||!!t;s.forEach(e=>{if(e.draggable){const s=a(e.draggable),h=lc.getValidMove(e,this.dragStartPoints[e.innerId],{x:i,y:n},o||s);r&&!s&&t?_o.animateMove(e,h,l(r)?r:.3):e.move(h)}})}}dragOverOrOut(t){const{interaction:e}=this,{dragOverPath:i}=this,{path:s}=t;this.dragOverPath=s,i?s.indexAt(0)!==i.indexAt(0)&&(e.emit(lc.OUT,t,i),e.emit(lc.OVER,t,s)):e.emit(lc.OVER,t,s)}dragEnterOrLeave(t){const{interaction:e}=this,{dragEnterPath:i}=this,{path:s}=t;e.emit(lc.LEAVE,t,i,s),e.emit(lc.ENTER,t,s,i),this.dragEnterPath=s}dragEnd(t){(this.dragging||this.moving)&&(this.checkDragEndAnimate(t)||this.dragEndReal(t))}dragEndReal(t){const{interaction:e,downData:i,dragData:s}=this;t||(t=s);const{path:n,throughPath:r}=i,o=bc(i,t,t);if(r&&(o.throughPath=r),o.path=n,this.moving&&(this.moving=!1,o.moveType="drag",e.emit(uc.END,o)),this.dragging){const n=this.getList();this.dragging=!1,e.p.dragLimitAnimate&&this.dragReal(!0),e.emit(lc.END,o),this.swipe(t,i,s,o),this.drop(t,n,this.dragEnterPath)}this.autoMoveCancel(),this.dragReset(),this.animate(null,"off")}swipe(t,e,i,s){const{interaction:n}=this;if(dt.getDistance(e,t)>n.config.pointer.swipeDistance){const t=kc(e,i,s);this.interaction.emit(t.type,t)}}drop(t,e,i){const s=Sc(t,e,lc.data);s.path=i,this.interaction.emit(cc.DROP,s),this.interaction.emit(lc.LEAVE,t,i)}dragReset(){lc.list=lc.data=this.draggableList=this.dragData=this.downData=this.dragOverPath=this.dragEnterPath=null,this.dragDataList=[]}checkDragEndAnimate(t,e){return!1}animate(t,e){}stopAnimate(){}checkDragOut(t){}autoMoveOnDragOut(t){}autoMoveCancel(){}destroy(){this.dragReset()}}const Pc=re.get("emit");const Tc=["move","zoom","rotate","key"];function Ec(t,e,i,s,n){if(Tc.some(t=>e.startsWith(t))&&t.__.hitChildren&&!Rc(t,n)){let r;for(let o=0,a=t.children.length;o<a;o++)r=t.children[o],!i.path.has(r)&&r.__.hittable&&Cc(r,e,i,s,n)}}function Cc(t,e,i,s,n){if(t.destroyed)return!1;if(t.__.hitSelf&&!Rc(t,n)&&(ul.updateEventStyle&&!s&&ul.updateEventStyle(t,e),t.hasEvent(e,s))){i.phase=s?1:t===i.target?2:3;const n=me.get(e,i);if(t.emitEvent(n,s),n.isStop)return!0}return!1}function Rc(t,e){return e&&e.has(t)}const Lc={wheel:{zoomSpeed:.5,moveSpeed:.5,rotateSpeed:.5,delta:{x:20,y:8}},pointer:{type:"pointer",snap:!0,hitRadius:5,tapTime:120,longPressTime:800,transformTime:500,hover:!0,dragHover:!0,dragDistance:2,swipeDistance:20},touch:{preventDefault:"auto"},multiTouch:{},move:{autoDistance:2},zoom:{},cursor:!0,keyEvent:!0},{pathHasEventType:Oc,pathCanDrag:Ac,pathHasOutside:Dc}=vc;class Mc{get dragging(){return this.dragger.dragging}get transforming(){return this.transformer.transforming}get moveMode(){return!0===this.m.drag||this.isHoldSpaceKey||this.isHoldMiddleKey||this.isHoldRightKey&&this.dragger.moving||this.isDragEmpty}get canHover(){return this.p.hover&&!this.config.mobile}get isDragEmpty(){return this.m.dragEmpty&&this.isRootPath(this.hoverData)&&(!this.downData||this.isRootPath(this.downData))}get isMobileDragEmpty(){return this.m.dragEmpty&&!this.canHover&&this.downData&&this.isTreePath(this.downData)}get isHoldMiddleKey(){return this.m.holdMiddleKey&&this.downData&&Hd.middle(this.downData)}get isHoldRightKey(){return this.m.holdRightKey&&this.downData&&Hd.right(this.downData)}get isHoldSpaceKey(){return this.m.holdSpaceKey&&jd.isHoldSpaceKey()}get m(){return this.config.move}get p(){return this.config.pointer}get hitRadius(){return this.p.hitRadius}constructor(t,e,i,s){this.config=f.clone(Lc),this.tapCount=0,this.downKeyMap={},this.target=t,this.canvas=e,this.selector=i,this.defaultPath=new Ph(t),this.createTransformer(),this.dragger=new Bc(this),s&&(this.config=f.default(s,this.config)),this.__listenEvents()}start(){this.running=!0}stop(){this.running=!1}receive(t){}pointerDown(t,e){t||(t=this.hoverData),t&&(Hd.defaultLeft(t),this.updateDownData(t),this.checkPath(t,e),this.downTime=Date.now(),this.emit(oc.BEFORE_DOWN,t),t.path.needUpdate&&this.updateDownData(t),this.emit(oc.DOWN,t),Hd.left(t)&&(this.tapWait(),this.longPressWait(t)),this.waitRightTap=Hd.right(t),this.dragger.setDragData(t),this.isHoldRightKey||this.updateCursor(t))}pointerMove(t){if(t||(t=this.hoverData),!t)return;const{downData:e}=this;e&&Hd.defaultLeft(t);(this.canvas.bounds.hitPoint(t)||e)&&(this.pointerMoveReal(t),e&&this.dragger.checkDragOut(t))}pointerMoveReal(t){if(this.emit(oc.BEFORE_MOVE,t,this.defaultPath),this.downData){const e=dt.getDistance(this.downData,t)>this.p.dragDistance;e&&(this.pointerWaitCancel(),this.waitRightTap=!1),this.dragger.checkDrag(t,e)}this.dragger.moving||(this.updateHoverData(t),this.checkPath(t),this.emit(oc.MOVE,t),this.pointerHover(t),this.dragging&&(this.dragger.dragOverOrOut(t),this.dragger.dragEnterOrLeave(t))),this.updateCursor(this.downData||t)}pointerUp(t){const{downData:e}=this;if(t||(t=e),!e)return;Hd.defaultLeft(t),t.multiTouch=e.multiTouch,this.findPath(t);const i=Object.assign(Object.assign({},t),{path:t.path.clone()});t.path.addList(e.path.list),this.checkPath(t),this.downData=null,this.emit(oc.BEFORE_UP,t),this.emit(oc.UP,t),this.touchLeave(t),t.isCancel||(this.tap(t),this.menuTap(t)),this.dragger.dragEnd(t),this.updateCursor(i)}pointerCancel(){const t=Object.assign({},this.dragger.dragData);t.isCancel=!0,this.pointerUp(t)}menu(t){this.findPath(t),this.emit(oc.MENU,t),this.waitMenuTap=!0,!this.downData&&this.waitRightTap&&this.menuTap(t)}menuTap(t){this.waitRightTap&&this.waitMenuTap&&(this.emit(oc.MENU_TAP,t),this.waitRightTap=this.waitMenuTap=!1)}createTransformer(){}move(t){}zoom(t){}rotate(t){}transformEnd(){}wheel(t){}multiTouch(t,e){}keyDown(t){if(!this.config.keyEvent)return;this.emit(mc.BEFORE_DOWN,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]||(this.downKeyMap[e]=!0,jd.setDownCode(e),this.emit(mc.HOLD,t,this.defaultPath),this.moveMode&&(this.cancelHover(),this.updateCursor())),this.emit(mc.DOWN,t,this.defaultPath)}keyUp(t){if(!this.config.keyEvent)return;this.emit(mc.BEFORE_UP,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]=!1,jd.setUpCode(e),this.emit(mc.UP,t,this.defaultPath),"grab"===this.cursor&&this.updateCursor()}pointerHover(t){!this.canHover||this.dragging&&!this.p.dragHover||(t.path||(t.path=new Ph),this.pointerOverOrOut(t),this.pointerEnterOrLeave(t))}pointerOverOrOut(t){const{path:e}=t,{overPath:i}=this;this.overPath=e,i?e.indexAt(0)!==i.indexAt(0)&&(this.emit(oc.OUT,t,i),this.emit(oc.OVER,t,e)):this.emit(oc.OVER,t,e)}pointerEnterOrLeave(t){let{path:e}=t;this.downData&&!this.moveMode&&(e=e.clone(),this.downData.path.forEach(t=>e.add(t)));const{enterPath:i}=this;this.enterPath=e,this.emit(oc.LEAVE,t,i,e),this.emit(oc.ENTER,t,e,i)}touchLeave(t){"touch"===t.pointerType&&this.enterPath&&(this.emit(oc.LEAVE,t),this.dragger.dragging&&this.emit(cc.LEAVE,t))}tap(t){const{pointer:e}=this.config,i=this.longTap(t);if(!e.tapMore&&i)return;if(!this.waitTap)return;e.tapMore&&this.emitTap(t);const s=Date.now()-this.downTime,n=[oc.DOUBLE_TAP,oc.DOUBLE_CLICK].some(e=>Oc(t.path,e));s<e.tapTime+50&&n?(this.tapCount++,2===this.tapCount?(this.tapWaitCancel(),this.emitDoubleTap(t)):(clearTimeout(this.tapTimer),this.tapTimer=setTimeout(()=>{e.tapMore||(this.tapWaitCancel(),this.emitTap(t))},e.tapTime))):e.tapMore||(this.tapWaitCancel(),this.emitTap(t))}findPath(t,e){const{hitRadius:i,through:s}=this.p,{bottomList:n,target:r}=this;ie.backgrounder||t.origin||r&&r.updateLayout();const o=this.selector.getByPoint(t,i,Object.assign({bottomList:n,name:t.type},e||{through:s}));return o.throughPath&&(t.throughPath=o.throughPath),t.path=o.path,o.path}isRootPath(t){return t&&t.path.list[0].isLeafer}isTreePath(t){const e=this.target.app;return!(!e||!e.isApp)&&(e.editor&&!t.path.has(e.editor)&&t.path.has(e.tree)&&!t.target.syncEventer)}checkPath(t,e){(e||this.moveMode&&!Dc(t.path))&&(t.path=this.defaultPath)}canMove(t){return t&&(this.moveMode||"auto"===this.m.drag&&!Ac(t.path))&&!Dc(t.path)}isDrag(t){return this.dragger.getList().has(t)}isPress(t){return this.downData&&this.downData.path.has(t)}isHover(t){return this.enterPath&&this.enterPath.has(t)}isFocus(t){return this.focusData===t}cancelHover(){const{hoverData:t}=this;t&&(t.path=this.defaultPath,this.pointerHover(t))}stopDragAnimate(){this.dragger.stopAnimate()}updateDownData(t,e,i){const{downData:s}=this;!t&&s&&(t=s),t&&(this.findPath(t,e),i&&s&&t.path.addList(s.path.list),this.downData=t)}updateHoverData(t){t||(t=this.hoverData),t&&(this.findPath(t,{exclude:this.dragger.getList(!1,!0),name:oc.MOVE}),this.hoverData=t)}updateCursor(t){if(!this.config.cursor||!this.canHover)return;if(t||(this.updateHoverData(),t=this.downData||this.hoverData),this.dragger.moving)return this.setCursor("grabbing");if(this.canMove(t))return this.setCursor(this.downData?"grabbing":"grab");if(!t)return;let e,i;const{path:s}=t;for(let t=0,n=s.length;t<n&&(e=s.list[t],i=e.syncEventer&&e.syncEventer.cursor||e.cursor,!i);t++);this.setCursor(i)}setCursor(t){this.cursor=t}getLocal(t,e){const i=this.canvas.getClientBounds(e),s={x:t.clientX-i.x,y:t.clientY-i.y},{bounds:n}=this.canvas;return s.x*=n.width/i.width,s.y*=n.height/i.height,this.p.snap&&dt.round(s),s}emitTap(t){this.emit(oc.TAP,t),this.emit(oc.CLICK,t)}emitDoubleTap(t){this.emit(oc.DOUBLE_TAP,t),this.emit(oc.DOUBLE_CLICK,t)}pointerWaitCancel(){this.tapWaitCancel(),this.longPressWaitCancel()}tapWait(){clearTimeout(this.tapTimer),this.waitTap=!0}tapWaitCancel(){this.waitTap&&(clearTimeout(this.tapTimer),this.waitTap=!1,this.tapCount=0)}longPressWait(t){clearTimeout(this.longPressTimer),this.longPressTimer=setTimeout(()=>{this.longPressed=!0,this.emit(oc.LONG_PRESS,t)},this.p.longPressTime)}longTap(t){let e;return this.longPressed&&(this.emit(oc.LONG_TAP,t),(Oc(t.path,oc.LONG_TAP)||Oc(t.path,oc.LONG_PRESS))&&(e=!0)),this.longPressWaitCancel(),e}longPressWaitCancel(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressed=!1)}__onResize(){const{dragOut:t}=this.m;this.shrinkCanvasBounds=new Kt(this.canvas.bounds),this.shrinkCanvasBounds.spread(-(l(t)?t:2))}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(ta.RESIZE,this.__onResize,this)],t.once(na.READY,()=>this.__onResize())}__removeListenEvents(){this.target.off_(this.__eventIds),this.__eventIds.length=0}emit(t,e,i,s){this.running&&function(t,e,i,s){if(!i&&!e.path)return;let n;e.type=t,i?e=Object.assign(Object.assign({},e),{path:i}):i=e.path,e.target=i.indexAt(0);try{for(let r=i.length-1;r>-1;r--){if(n=i.list[r],Cc(n,t,e,!0,s))return;n.isApp&&Ec(n,t,e,!0,s)}for(let r=0,o=i.length;r<o;r++)if(n=i.list[r],n.isApp&&Ec(n,t,e,!1,s),Cc(n,t,e,!1,s))return}catch(t){Pc.error(t)}}(t,e,i,s)}destroy(){this.__eventIds.length&&(this.stop(),this.__removeListenEvents(),this.dragger.destroy(),this.transformer&&this.transformer.destroy(),this.downData=this.overPath=this.enterPath=null)}}class Fc{static set(t,e){this.custom[t]=e}static get(t){return this.custom[t]}}Fc.custom={};class Ic extends we{constructor(){super(...arguments),this.maxTotal=1e3,this.pathList=new Ph,this.pixelList=new Ph}getPixelType(t,e){return this.__autoClear(),this.pixelList.add(t),_e.hitCanvas(e)}getPathType(t){return this.__autoClear(),this.pathList.add(t),_e.hitCanvas()}clearImageType(){this.__clearLeafList(this.pixelList)}clearPathType(){this.__clearLeafList(this.pathList)}__clearLeafList(t){t.length&&(t.forEach(t=>{t.__hitCanvas&&(t.__hitCanvas.destroy(),t.__hitCanvas=null)}),t.reset())}__autoClear(){this.pathList.length+this.pixelList.length>this.maxTotal&&this.clear()}clear(){this.clearPathType(),this.clearImageType()}}ie.getSelector=function(t){return t.leafer?t.leafer.selector:ie.selector||(ie.selector=_e.selector())};const{toInnerRadiusPointOf:Wc,copyRadiusPoint:Nc}=dt,{hitRadiusPoint:zc,hitPoint:Yc}=Ht,Xc={},Uc={},jc=gh.prototype;jc.hit=function(t,e=0){this.updateLayout(),Nc(Uc,t,e);const i=this.__world;return!!(e?zc(i,Uc):Yc(i,Uc))&&(this.isBranch?ie.getSelector(this).hitPoint(Object.assign({},Uc),e,{target:this}):this.__hitWorld(Uc))},jc.__hitWorld=function(t,e){const i=this.__;if(!i.hitSelf)return!1;const s=this.__world,n=this.__layout,r=s.width<10&&s.height<10;if(i.hitRadius&&(Nc(Xc,t,i.hitRadius),t=Xc),Wc(t,s,Xc),i.hitBox||r){if(Ht.hitRadiusPoint(n.boxBounds,Xc))return!0;if(r)return!1}return!n.hitCanvasChanged&&this.__hitCanvas||(this.__updateHitCanvas(),n.boundsChanged||(n.hitCanvasChanged=!1)),this.__hit(Xc,e)},jc.__hitFill=function(t){const e=this.__hitCanvas;return e&&e.hitFill(t,this.__.windingRule)},jc.__hitStroke=function(t,e){const i=this.__hitCanvas;return i&&i.hitStroke(t,e)},jc.__hitPixel=function(t){const e=this.__hitCanvas;return e&&e.hitPixel(t,this.__layout.renderBounds,e.hitScale)},jc.__drawHitPath=function(t){t&&this.__drawRenderPath(t)};const Hc=new mt,Vc=Hl.prototype;Vc.__updateHitCanvas=function(){this.__box&&this.__box.__updateHitCanvas();const{hitCanvasManager:t}=this.leafer||this.parent&&this.parent.leafer||{};if(!t)return;const e=this.__,i=(e.__isAlphaPixelFill||e.__isCanvas)&&"pixel"===e.hitFill,s=e.__isAlphaPixelStroke&&"pixel"===e.hitStroke,n=i||s;this.__hitCanvas||(this.__hitCanvas=n?t.getPixelType(this,{contextSettings:{willReadFrequently:!0}}):t.getPathType(this));const r=this.__hitCanvas;if(n){const{renderBounds:t}=this.__layout,n=ie.image.hitCanvasSize,o=r.hitScale=$t.set(0,0,n,n).getFitMatrix(t).a,{x:a,y:h,width:l,height:d}=$t.set(t).scale(o);r.resize({width:l,height:d,pixelRatio:1}),r.clear(),nr.patternLocked=!0,this.__renderShape(r,{matrix:Hc.setWith(this.__world).scaleWith(1/o).invertWith().translate(-a,-h),snapshot:!0,ignoreFill:!i,ignoreStroke:!s}),nr.patternLocked=!1,r.resetTransform(),e.__isHitPixel=!0}else e.__isHitPixel&&(e.__isHitPixel=!1);this.__drawHitPath(r),r.setStrokeOptions(e)},Vc.__hit=function(t,e){if(this.__box&&this.__box.__hit(t))return!0;const i=this.__;if(i.__isHitPixel&&this.__hitPixel(t))return!0;const{hitFill:s}=i,n=(i.fill||i.__isCanvas)&&("path"===s||"pixel"===s&&!(i.__isAlphaPixelFill||i.__isCanvas))||"all"===s||e;if(n&&this.__hitFill(t))return!0;const{hitStroke:r,__maxStrokeWidth:o}=i,a=i.stroke&&("path"===r||"pixel"===r&&!i.__isAlphaPixelStroke)||"all"===r;if(!n&&!a)return!1;const h=2*t.radiusX;let l=h;if(a)switch(i.strokeAlign){case"inside":if(l+=2*o,!n&&this.__hitFill(t)&&this.__hitStroke(t,l))return!0;l=h;break;case"center":l+=o;break;case"outside":if(l+=2*o,!n){if(!this.__hitFill(t)&&this.__hitStroke(t,l))return!0;l=h}}return!!l&&this.__hitStroke(t,l)};const qc=Hl.prototype,Gc=$l.prototype,Kc=id.prototype;Gc.__updateHitCanvas=Kc.__updateHitCanvas=function(){this.stroke||this.cornerRadius||(this.fill||this.__.__isCanvas)&&"pixel"===this.hitFill||"all"===this.hitStroke?qc.__updateHitCanvas.call(this):this.__hitCanvas&&(this.__hitCanvas=null)},Gc.__hitFill=Kc.__hitFill=function(t){return this.__hitCanvas?qc.__hitFill.call(this,t):Ht.hitRadiusPoint(this.__layout.boxBounds,t)},Nd.prototype.__drawHitPath=function(t){const{__lineHeight:e,fontSize:i,__baseLine:s,__letterSpacing:n,__textDrawData:r}=this.__;t.beginPath(),n<0?this.__drawPathByBox(t):r.rows.forEach(n=>t.rect(n.x,n.y-s,n.width,e<i?i:e))},Vl.prototype.pick=function(t,e){return e||(e=n),this.updateLayout(),ie.getSelector(this).getByPoint(t,e.hitRadius||0,Object.assign(Object.assign({},e),{target:this}))};const $c=De.prototype;$c.hitFill=function(t,e){return e?this.context.isPointInPath(t.x,t.y,e):this.context.isPointInPath(t.x,t.y)},$c.hitStroke=function(t,e){return this.strokeWidth=e,this.context.isPointInStroke(t.x,t.y)},$c.hitPixel=function(t,e,i=1){let{x:s,y:n,radiusX:r,radiusY:o}=t;e&&(s-=e.x,n-=e.y),$t.set(s-r,n-o,2*r,2*o).scale(i).ceil();const{data:a}=this.context.getImageData($t.x,$t.y,$t.width||1,$t.height||1);for(let t=0,e=a.length;t<e;t+=4)if(a[t+3]>0)return!0;return a[3]>0};const Jc={convert(t,e){const i=vc.getBase(t),{x:s,y:n}=e,r=Object.assign(Object.assign({},i),{x:s,y:n,width:t.width,height:t.height,pointerType:t.pointerType,pressure:t.pressure});return"pen"===r.pointerType&&(r.tangentialPressure=t.tangentialPressure,r.tiltX=t.tiltX,r.tiltY=t.tiltY,r.twist=t.twist),r},convertMouse(t,e){const i=vc.getBase(t),{x:s,y:n}=e;return Object.assign(Object.assign({},i),{x:s,y:n,width:1,height:1,pointerType:"mouse",pressure:.5})},convertTouch(t,e){const i=Jc.getTouch(t),s=vc.getBase(t),{x:n,y:r}=e;return Object.assign(Object.assign({},s),{x:n,y:r,width:1,height:1,pointerType:"touch",multiTouch:t.touches.length>1,pressure:i.force})},getTouch:t=>t.targetTouches[0]||t.changedTouches[0]},Qc={convert(t){const e=vc.getBase(t);return Object.assign(Object.assign({},e),{code:t.code,key:t.key})}},{pathCanDrag:Zc}=vc;class tu extends Mc{get notPointer(){const{p:t}=this;return"pointer"!==t.type||t.touch||this.useMultiTouch}get notTouch(){const{p:t}=this;return"mouse"===t.type||this.usePointer}get notMouse(){return this.usePointer||this.useTouch}__listenEvents(){super.__listenEvents();const t=this.view=this.canvas.view;this.viewEvents={pointerdown:this.onPointerDown,mousedown:this.onMouseDown,touchstart:this.onTouchStart,pointerleave:this.onPointerLeave,contextmenu:this.onContextMenu,wheel:this.onWheel,gesturestart:this.onGesturestart,gesturechange:this.onGesturechange,gestureend:this.onGestureend},this.windowEvents={pointermove:this.onPointerMove,pointerup:this.onPointerUp,pointercancel:this.onPointerCancel,mousemove:this.onMouseMove,mouseup:this.onMouseUp,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchCancel,keydown:this.onKeyDown,keyup:this.onKeyUp,scroll:this.onScroll};const{viewEvents:e,windowEvents:i}=this;for(let i in e)e[i]=e[i].bind(this),t.addEventListener(i,e[i]);for(let t in i)i[t]=i[t].bind(this),window.addEventListener(t,i[t])}__removeListenEvents(){super.__removeListenEvents();const{viewEvents:t,windowEvents:e}=this;for(let e in t)this.view.removeEventListener(e,t[e]),this.viewEvents={};for(let t in e)window.removeEventListener(t,e[t]),this.windowEvents={}}getTouches(t){const e=[];for(let i=0,s=t.length;i<s;i++)e.push(t[i]);return e}preventDefaultPointer(t){const{pointer:e}=this.config;e.preventDefault&&t.preventDefault()}preventDefaultWheel(t){const{wheel:e}=this.config;e.preventDefault&&t.preventDefault()}preventWindowPointer(t){return!this.downData&&t.target!==this.view}onKeyDown(t){this.keyDown(Qc.convert(t))}onKeyUp(t){this.keyUp(Qc.convert(t))}onContextMenu(t){this.config.pointer.preventDefaultMenu&&t.preventDefault(),this.menu(Jc.convert(t,this.getLocal(t)))}onScroll(){this.canvas.updateClientBounds()}onPointerDown(t){this.preventDefaultPointer(t),this.notPointer||(this.usePointer||(this.usePointer=!0),this.pointerDown(Jc.convert(t,this.getLocal(t))))}onPointerMove(t,e){if(this.notPointer||this.preventWindowPointer(t))return;this.usePointer||(this.usePointer=!0);const i=Jc.convert(t,this.getLocal(t,!0));e?this.pointerHover(i):this.pointerMove(i)}onPointerLeave(t){this.onPointerMove(t,!0)}onPointerUp(t){this.downData&&this.preventDefaultPointer(t),this.notPointer||this.preventWindowPointer(t)||this.pointerUp(Jc.convert(t,this.getLocal(t)))}onPointerCancel(){this.useMultiTouch||this.pointerCancel()}onMouseDown(t){this.preventDefaultPointer(t),this.notMouse||this.pointerDown(Jc.convertMouse(t,this.getLocal(t)))}onMouseMove(t){this.notMouse||this.preventWindowPointer(t)||this.pointerMove(Jc.convertMouse(t,this.getLocal(t,!0)))}onMouseUp(t){this.downData&&this.preventDefaultPointer(t),this.notMouse||this.preventWindowPointer(t)||this.pointerUp(Jc.convertMouse(t,this.getLocal(t)))}onMouseCancel(){this.notMouse||this.pointerCancel()}onTouchStart(t){const e=Jc.getTouch(t),i=this.getLocal(e,!0),{preventDefault:s}=this.config.touch;(!0===s||"auto"===s&&Zc(this.findPath(i)))&&t.preventDefault(),this.multiTouchStart(t),this.notTouch||(this.touchTimer&&(window.clearTimeout(this.touchTimer),this.touchTimer=0),this.useTouch=!0,this.pointerDown(Jc.convertTouch(t,i)))}onTouchMove(t){if(this.multiTouchMove(t),this.notTouch||this.preventWindowPointer(t))return;const e=Jc.getTouch(t);this.pointerMove(Jc.convertTouch(t,this.getLocal(e)))}onTouchEnd(t){if(this.multiTouchEnd(),this.notTouch||this.preventWindowPointer(t))return;this.touchTimer&&clearTimeout(this.touchTimer),this.touchTimer=setTimeout(()=>{this.useTouch=!1},500);const e=Jc.getTouch(t);this.pointerUp(Jc.convertTouch(t,this.getLocal(e)))}onTouchCancel(){this.notTouch||this.pointerCancel()}multiTouchStart(t){this.useMultiTouch=t.touches.length>1,this.touches=this.useMultiTouch?this.getTouches(t.touches):void 0,this.useMultiTouch&&this.pointerCancel()}multiTouchMove(t){if(this.useMultiTouch&&t.touches.length>1){const e=this.getTouches(t.touches),i=this.getKeepTouchList(this.touches,e);i.length>1&&(this.multiTouch(vc.getBase(t),i),this.touches=e)}}multiTouchEnd(){this.touches=null,this.useMultiTouch=!1,this.transformEnd()}getKeepTouchList(t,e){let i;const s=[];return t.forEach(t=>{i=e.find(e=>e.identifier===t.identifier),i&&s.push({from:this.getLocal(t),to:this.getLocal(i)})}),s}getLocalTouchs(t){return t.map(t=>this.getLocal(t))}onWheel(t){this.preventDefaultWheel(t),this.wheel(Object.assign(Object.assign(Object.assign({},vc.getBase(t)),this.getLocal(t)),{deltaX:t.deltaX,deltaY:t.deltaY}))}onGesturestart(t){this.useMultiTouch||(this.preventDefaultWheel(t),this.lastGestureScale=1,this.lastGestureRotation=0)}onGesturechange(t){if(this.useMultiTouch)return;this.preventDefaultWheel(t);const e=vc.getBase(t);Object.assign(e,this.getLocal(t));const i=t.scale/this.lastGestureScale,s=(t.rotation-this.lastGestureRotation)/Math.PI*180*(I.within(this.config.wheel.rotateSpeed,0,1)/4+.1);this.zoom(Object.assign(Object.assign({},e),{scale:i*i})),this.rotate(Object.assign(Object.assign({},e),{rotation:s})),this.lastGestureScale=t.scale,this.lastGestureRotation=t.rotation}onGestureend(t){this.useMultiTouch||(this.preventDefaultWheel(t),this.transformEnd())}setCursor(t){super.setCursor(t);const e=[];this.eachCursor(t,e),_(e[e.length-1])&&e.push("default"),this.canvas.view.style.cursor=e.map(t=>_(t)?`url(${t.url}) ${t.x||0} ${t.y||0}`:t).join(",")}eachCursor(t,e,i=0){if(i++,u(t))t.forEach(t=>this.eachCursor(t,e,i));else{const s=a(t)&&Fc.get(t);s&&i<2?this.eachCursor(s,e,i):e.push(t)}}destroy(){this.view&&(super.destroy(),this.view=null,this.touches=null)}}function eu(t,e,i){t.__.__font?ol.fillText(t,e,i):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function iu(t,e,i,s,n){const r=i.__;_(t)?ol.drawStrokesStyle(t,e,!1,i,s,n):(s.setStroke(t,r.__strokeWidth*e,r),s.stroke()),r.__useArrow&&ol.strokeArrow(t,i,s,n)}function su(t,e,i,s,n){const r=i.__;_(t)?ol.drawStrokesStyle(t,e,!0,i,s,n):(s.setStroke(t,r.__strokeWidth*e,r),ol.drawTextStroke(i,s,n))}function nu(t,e,i,s,n){const r=s.getSameCanvas(!0,!0);r.font=i.__.__font,su(t,2,i,r,n),r.blendMode="outside"===e?"destination-out":"destination-in",ol.fillText(i,r,n),r.blendMode="normal",_o.copyCanvasByWorld(i,s,r),r.recycle(i.__nowWorld)}const{getSpread:ru,copyAndSpread:ou,toOuterOf:au,getOuterOf:hu,getByMove:lu,move:du,getIntersectData:cu}=Ht,uu={};let _u;const{stintSet:pu}=f,{hasTransparent:gu}=sl;function fu(t,e,i){if(!_(e)||!1===e.visible||0===e.opacity)return;let s;const{boxBounds:n}=i.__layout,{type:o}=e;switch(o){case"image":case"film":case"video":if(!e.url)return;s=al.image(i,t,e,n,!_u||!_u[e.url]),"image"!==o&&al[o](s);break;case"linear":s=hl.linearGradient(e,n);break;case"radial":s=hl.radialGradient(e,n);break;case"angular":s=hl.conicGradient(e,n);break;case"solid":const{color:a,opacity:h}=e;s={type:o,style:sl.string(a,h)};break;default:r(e.r)||(s={type:"solid",style:sl.string(e)})}if(s&&(s.originPaint=e,a(s.style)&&gu(s.style)&&(s.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;s.strokeStyle=e.style}return s}const yu={compute:function(t,e){const i=e.__,s=[];let n,r,o,a=i.__input[t];u(a)||(a=[a]),_u=al.recycleImage(t,i);for(let i,n=0,r=a.length;n<r;n++)(i=fu(t,a[n],e))&&(s.push(i),i.strokeStyle&&(o||(o=1),i.strokeStyle.strokeWidth&&(o=Math.max(o,i.strokeStyle.strokeWidth))));i["_"+t]=s.length?s:void 0,s.length?(s.every(t=>t.isTransparent)&&(s.some(t=>t.image)&&(n=!0),r=!0),"fill"===t?(pu(i,"__isAlphaPixelFill",n),pu(i,"__isTransparentFill",r)):(pu(i,"__isAlphaPixelStroke",n),pu(i,"__isTransparentStroke",r),pu(i,"__hasMultiStrokeStyle",o))):i.__removePaint(t,!1)},fill:function(t,e,i,s){i.fillStyle=t,eu(e,i,s)},fills:function(t,e,i,s){let n,r,o;for(let a=0,h=t.length;a<h;a++){if(n=t[a],r=n.originPaint,n.image){if(o?o++:o=1,al.checkImage(n,!e.__.__font,e,i,s))continue;if(!n.style){1===o&&n.image.isPlacehold&&e.drawImagePlaceholder(n,i,s);continue}}if(i.fillStyle=n.style,n.transform||r.scaleFixed){if(i.save(),n.transform&&i.transform(n.transform),r.scaleFixed){const{scaleX:t,scaleY:s}=e.getRenderScaleData(!0,r.scaleFixed,!1);1!==t&&i.scale(t,s)}r.blendMode&&(i.blendMode=r.blendMode),eu(e,i,s),i.restore()}else r.blendMode?(i.saveBlendMode(r.blendMode),eu(e,i,s),i.restoreBlendMode()):eu(e,i,s)}},fillPathOrText:eu,fillText:function(t,e,i){const s=t.__,{rows:n,decorationY:r}=s.__textDrawData;let o;s.__isPlacehold&&s.placeholderColor&&(e.fillStyle=s.placeholderColor);for(let t=0,i=n.length;t<i;t++)o=n[t],o.text?e.fillText(o.text,o.x,o.y):o.data&&o.data.forEach(t=>{e.fillText(t.char,t.x,o.y)});if(r){const{decorationColor:t,decorationHeight:i}=s.__textDrawData;t&&(e.fillStyle=t),n.forEach(t=>r.forEach(s=>e.fillRect(t.x,t.y+s,t.width,i)))}},stroke:function(t,e,i,s){const n=e.__;if(n.__strokeWidth)if(n.__font)ol.strokeText(t,e,i,s);else switch(n.strokeAlign){case"center":iu(t,1,e,i,s);break;case"inside":!function(t,e,i,s){i.save(),i.clipUI(e),iu(t,2,e,i,s),i.restore()}(t,e,i,s);break;case"outside":!function(t,e,i,s){const n=e.__;if(n.__fillAfterStroke)iu(t,2,e,i,s);else{const{renderBounds:r}=e.__layout,o=i.getSameCanvas(!0,!0);e.__drawRenderPath(o),iu(t,2,e,o,s),o.clipUI(n),o.clearWorld(r),_o.copyCanvasByWorld(e,i,o),o.recycle(e.__nowWorld)}}(t,e,i,s)}},strokes:function(t,e,i,s){ol.stroke(t,e,i,s)},strokeText:function(t,e,i,s){switch(e.__.strokeAlign){case"center":su(t,1,e,i,s);break;case"inside":nu(t,"inside",e,i,s);break;case"outside":e.__.__fillAfterStroke?su(t,2,e,i,s):nu(t,"outside",e,i,s)}},drawTextStroke:function(t,e,i){let s,n=t.__.__textDrawData;const{rows:r,decorationY:o}=n;for(let t=0,i=r.length;t<i;t++)s=r[t],s.text?e.strokeText(s.text,s.x,s.y):s.data&&s.data.forEach(t=>{e.strokeText(t.char,t.x,s.y)});if(o){const{decorationHeight:t}=n;r.forEach(i=>o.forEach(s=>e.strokeRect(i.x,i.y+s,i.width,t)))}},drawStrokesStyle:function(t,e,i,s,n,r){let o;const a=s.__,{__hasMultiStrokeStyle:h}=a;h||n.setStroke(void 0,a.__strokeWidth*e,a);for(let l=0,d=t.length;l<d;l++)if(o=t[l],(!o.image||!al.checkImage(o,!1,s,n,r))&&o.style){if(h){const{strokeStyle:t}=o;t?n.setStroke(o.style,a.__getRealStrokeWidth(t)*e,a,t):n.setStroke(o.style,a.__strokeWidth*e,a)}else n.strokeStyle=o.style;o.originPaint.blendMode?(n.saveBlendMode(o.originPaint.blendMode),i?ol.drawTextStroke(s,n,r):n.stroke(),n.restoreBlendMode()):i?ol.drawTextStroke(s,n,r):n.stroke()}},shape:function(t,e,i){const s=e.getSameCanvas(),n=e.bounds,r=t.__nowWorld,o=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,d,c,u,_;au(o.strokeSpread?(ou(uu,o.boxBounds,o.strokeSpread),uu):o.boxBounds,r,a);let{scaleX:p,scaleY:g}=t.getRenderScaleData(!0);if(n.includes(a))_=s,h=u=a,l=r;else{let s;if(ie.fullImageShadow)s=a;else{const t=o.renderShapeSpread?ru(n,P.swapAndScale(o.renderShapeSpread,p,g)):n;s=cu(t,a)}c=n.getFitMatrix(s);let{a:f,d:y}=c;c.a<1&&(_=e.getSameCanvas(),t.__renderShape(_,i),p*=f,g*=y),u=hu(a,c),h=lu(u,-c.e,-c.f),l=hu(r,c),du(l,-c.e,-c.f);const m=i.matrix;m?(d=new mt(c),d.multiply(m),f*=m.scaleX,y*=m.scaleY):d=c,d.withScale(f,y),i=Object.assign(Object.assign({},i),{matrix:d})}return t.__renderShape(s,i),{canvas:s,matrix:d,fitMatrix:c,bounds:h,renderBounds:l,worldCanvas:_,shapeBounds:u,scaleX:p,scaleY:g}}};let mu,vu=new Kt;const{isSame:wu}=Ht;function xu(t,e,i,s,n,r){const o=t.__;if("fill"===e&&!o.__naturalWidth&&(o.__naturalWidth=s.width/o.pixelRatio,o.__naturalHeight=s.height/o.pixelRatio,o.__autoSide))return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",o.width),t.setProxyAttr("height",o.height)),!1;if(!n.data){al.createData(n,s,i,r);const{transform:t}=n.data,{opacity:e,blendMode:a}=i,h=t&&!t.onlyScale||o.path||o.cornerRadius;(h||e&&e<1||a)&&(n.complex=!h||2)}return i.filter&&al.applyFilter(n,s,i.filter,t),!0}function bu(t,e){Bu(t,qo.LOAD,e)}function Su(t,e){Bu(t,qo.LOADED,e)}function ku(t,e,i){e.error=i,t.forceUpdate("surface"),Bu(t,qo.ERROR,e)}function Bu(t,e,i){t.hasEvent(e)&&t.emitEvent(new qo(e,i))}function Pu(t,e){const{leafer:i}=t;i&&i.viewReady&&(i.renderer.ignore=e)}const{get:Tu,translate:Eu}=Q,Cu=new Kt,Ru={},Lu={};function Ou(t,e,i,s){const n=a(t)||s?(s?i-s*e:i%e)/((s||Math.floor(i/e))-1):t;return"auto"===t&&n<0?0:n}let Au={},Du={a:1,b:0,c:0,d:1,e:0,f:0};const{get:Mu,set:Fu,rotateOfOuter:Iu,translate:Wu,scaleOfOuter:Nu,multiplyParent:zu,scale:Yu,rotate:Xu,skew:Uu}=Q;function ju(t,e,i,s,n,r,o,a){o&&Xu(t,o),a&&Uu(t,a.x,a.y),n&&Yu(t,n,r),Wu(t,e.x+i,e.y+s)}const{get:Hu,scale:Vu,copy:qu}=Q,{getFloorScale:Gu}=I,{abs:Ku}=Math;const $u={image:function(t,e,i,s,n){let r,o;const a=nr.get(i,i.type);return mu&&i===mu.paint&&wu(s,mu.boxBounds)?r=mu.leafPaint:(r={type:i.type,image:a},a.hasAlphaPixel&&(r.isTransparent=!0),mu=a.use>1?{leafPaint:r,paint:i,boxBounds:vu.set(s)}:null),(n||a.loading)&&(o={image:a,attrName:e,attrValue:i}),a.ready?(xu(t,e,i,a,r,s),n&&(bu(t,o),Su(t,o))):a.error?n&&ku(t,o,a.error):(n&&(Pu(t,!0),bu(t,o)),r.loadId=a.load(()=>{Pu(t,!1),t.destroyed||(xu(t,e,i,a,r,s)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),Su(t,o)),r.loadId=void 0},e=>{Pu(t,!1),ku(t,o,e),r.loadId=void 0},i.lod&&a.getThumbSize(i.lod)),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),r},checkImage:function(t,e,i,s,n){const{scaleX:r,scaleY:o}=al.getImageRenderScaleData(t,i,s,n),a=t.film?t.nowIndex:r+"-"+o,{image:h,data:l,originPaint:d}=t,{exporting:c,snapshot:u}=n;return!(!l||t.patternId===a&&!c||u)&&(e&&(l.repeat?e=!1:d.changeful||t.film||"miniapp"===ie.name&&ta.isResizing(i)||c||(e=ie.image.isLarge(h,r,o)||h.width*r>8096||h.height*o>8096)),e?(i.__.__isFastShadow&&(s.fillStyle=t.style||"#000",s.fill()),al.drawImage(t,r,o,i,s,n),!0):(!t.style||d.sync||c?al.createPattern(t,i,s,n):al.createPatternTask(t,i,s,n),!1))},drawImage:function(t,e,i,s,n,r){const{data:o,image:a,complex:h}=t;let{width:l,height:d}=a;if(h){const{blendMode:r,opacity:c}=t.originPaint,{transform:u}=o;n.save(),2===h&&n.clipUI(s),r&&(n.blendMode=r),c&&(n.opacity*=c),u&&n.transform(u),a.render(n,0,0,l,d,s,t,e,i),n.restore()}else o.scaleX&&(l*=o.scaleX,d*=o.scaleY),a.render(n,0,0,l,d,s,t,e,i)},getImageRenderScaleData:function(t,e,i,s){const n=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:r}=t;if(i){const{pixelRatio:t}=i;n.scaleX*=t,n.scaleY*=t}return r&&r.scaleX&&(n.scaleX*=Math.abs(r.scaleX),n.scaleY*=Math.abs(r.scaleY)),n},recycleImage:function(t,e){const i=e["_"+t];if(u(i)){let s,n,r,o,a;for(let h=0,l=i.length;h<l;h++)s=i[h],n=s.image,a=n&&n.url,a&&(r||(r={}),r[a]=!0,nr.recyclePaint(s),e.__willDestroy&&n.parent&&al.recycleFilter(n,e.__leaf),n.loading&&(o||(o=e.__input&&e.__input[t]||[],u(o)||(o=[o])),n.unload(i[h].loadId,!o.some(t=>t.url===a))));return r}return null},createPatternTask:function(t,e,i,n){t.patternTask||(t.patternTask=nr.patternTasker.add(()=>s(this,void 0,void 0,function*(){al.createPattern(t,e,i,n),e.forceUpdate("surface")}),0,()=>(t.patternTask=null,i.bounds.hit(e.__nowWorld))))},createPattern:function(t,e,i,s){let{scaleX:n,scaleY:r}=al.getImageRenderScaleData(t,e,i,s),o=t.film?t.nowIndex:n+"-"+r;if(t.patternId!==o&&!e.destroyed&&(!ie.image.isLarge(t.image,n,r)||t.data.repeat)){const{image:i,data:s}=t,{opacity:a}=t.originPaint,{transform:h,gap:l}=s,d=al.getPatternFixScale(t,n,r);let c,u,_,{width:p,height:g}=i;d&&(n*=d,r*=d),p*=n,g*=r,l&&(u=l.x*n/Ku(s.scaleX||1),_=l.y*r/Ku(s.scaleY||1)),(h||1!==n||1!==r)&&(n*=Gu(p+(u||0)),r*=Gu(g+(_||0)),c=Hu(),h&&qu(c,h),Vu(c,1/n,1/r));const f=i.getCanvas(p,g,a,void 0,u,_,e.leafer&&e.leafer.config.smooth,s.interlace),y=i.getPattern(f,s.repeat||ie.origin.noRepeat||"no-repeat",c,t);t.style=y,t.patternId=o}},getPatternFixScale:function(t,e,i){const{image:s}=t;let n,r=ie.image.maxPatternSize,o=s.width*s.height;return s.isSVG?e>1&&(n=Math.ceil(e)/e):r>o&&(r=o),(o*=e*i)>r&&(n=Math.sqrt(r/o)),n},createData:function(t,e,i,s){t.data=al.getPatternData(i,s,e)},getPatternData:function(t,e,i){t.padding&&(e=Cu.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:s,height:n}=i,{mode:r,align:o,offset:h,scale:d,size:c,rotation:u,skew:p,clipSize:g,repeat:f,gap:y,interlace:m}=t,v=e.width===s&&e.height===n,w={mode:r},x="center"!==o&&(u||0)%180==90;let b,S;switch(Ht.set(Lu,0,0,x?n:s,x?s:n),r&&"cover"!==r&&"fit"!==r?((d||c)&&(I.getScaleData(d,c,i,Ru),b=Ru.scaleX,S=Ru.scaleY),(o||y||f)&&(b&&Ht.scale(Lu,b,S,!0),o&&Et.toPoint(o,Lu,e,Lu,!0,!0))):v&&!u||(b=S=Ht.getFitScale(e,Lu,"fit"!==r),Ht.put(e,i,o,b,!1,Lu),Ht.scale(Lu,b,S,!0)),h&&dt.move(Lu,h),r){case"stretch":v?b&&(b=S=void 0):(b=e.width/s,S=e.height/n,al.stretchMode(w,e,b,S));break;case"normal":case"clip":if(Lu.x||Lu.y||b||g||u||p){let t,i;g&&(t=e.width/g.width,i=e.height/g.height),al.clipMode(w,e,Lu.x,Lu.y,b,S,u,p,t,i),t&&(b=b?b*t:t,S=S?S*i:i)}break;case"repeat":(!v||b||u||p)&&al.repeatMode(w,e,s,n,Lu.x,Lu.y,b,S,u,p,o,t.freeTransform),f||(w.repeat="repeat");const i=_(f);(y||i)&&(w.gap=function(t,e,i,s,n){let r,o;_(t)?(r=t.x,o=t.y):r=o=t;return{x:Ou(r,i,n.width,e&&e.x),y:Ou(o,s,n.height,e&&e.y)}}(y,i&&f,Lu.width,Lu.height,e));break;default:b&&al.fillOrFitMode(w,e,Lu.x,Lu.y,b,S,u)}return w.transform||(e.x||e.y)&&Eu(w.transform=Tu(),e.x,e.y),b&&(w.scaleX=b,w.scaleY=S),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,i,s){const n=Mu(),{x:r,y:o}=e;r||o?Wu(n,r,o):i>0&&s>0&&(n.onlyScale=!0),Yu(n,i,s),t.transform=n},fillOrFitMode:function(t,e,i,s,n,r,o){const a=Mu();Wu(a,e.x+i,e.y+s),Yu(a,n,r),o&&Iu(a,{x:e.x+e.width/2,y:e.y+e.height/2},o),t.transform=a},clipMode:function(t,e,i,s,n,r,o,a,h,l){const d=Mu();ju(d,e,i,s,n,r,o,a),h&&(o||a?(Fu(Du),Nu(Du,e,h,l),zu(d,Du)):Nu(d,e,h,l)),t.transform=d},repeatMode:function(t,e,i,s,n,r,o,a,h,l,d,c){const u=Mu();if(c)ju(u,e,n,r,o,a,h,l);else{if(h)if("center"===d)Iu(u,{x:i/2,y:s/2},h);else switch(Xu(u,h),h){case 90:Wu(u,s,0);break;case 180:Wu(u,i,s);break;case 270:Wu(u,0,i)}Au.x=e.x+n,Au.y=e.y+r,Wu(u,Au.x,Au.y),o&&Nu(u,Au,o,a)}t.transform=u}},{toPoint:Ju}=Bt,{hasTransparent:Qu}=sl,Zu={},t_={};function e_(t,e,i,s){if(i){let n,r,o,h;for(let t=0,l=i.length;t<l;t++)n=i[t],a(n)?(o=t/(l-1),r=sl.string(n,s)):(o=n.offset,r=sl.string(n.color,s)),e.addColorStop(o,r),!h&&Qu(r)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:i_,getDistance:s_}=dt,{get:n_,rotateOfOuter:r_,scaleOfOuter:o_}=Q,{toPoint:a_}=Bt,h_={},l_={};function d_(t,e,i,s,n){let r;const{width:o,height:a}=t;if(o!==a||s){const t=i_(e,i);r=n_(),n?(o_(r,e,o/a*(s||1),1),r_(r,e,t+90)):(o_(r,e,1,o/a*(s||1)),r_(r,e,t))}return r}const{getDistance:c_}=dt,{toPoint:u_}=Bt,__={},p_={};const g_={linearGradient:function(t,e){let{from:i,to:s,type:n,opacity:r}=t;Ju(i||"top",e,Zu),Ju(s||"bottom",e,t_);const o=ie.canvas.createLinearGradient(Zu.x,Zu.y,t_.x,t_.y),a={type:n,style:o};return e_(a,o,t.stops,r),a},radialGradient:function(t,e){let{from:i,to:s,type:n,opacity:r,stretch:o}=t;a_(i||"center",e,h_),a_(s||"bottom",e,l_);const a=ie.canvas.createRadialGradient(h_.x,h_.y,0,h_.x,h_.y,s_(h_,l_)),h={type:n,style:a};e_(h,a,t.stops,r);const l=d_(e,h_,l_,o,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:i,to:s,type:n,opacity:r,stretch:o}=t;u_(i||"center",e,__),u_(s||"bottom",e,p_);const a=ie.conicGradientSupport?ie.canvas.createConicGradient(0,__.x,__.y):ie.canvas.createRadialGradient(__.x,__.y,0,__.x,__.y,c_(__,p_)),h={type:n,style:a};e_(h,a,t.stops,r);const l=d_(e,__,p_,o||1,ie.conicGradientRotate90);return l&&(h.transform=l),h},getTransform:d_},{copy:f_,move:y_,toOffsetOutBounds:m_}=Ht,{max:v_,abs:w_}=Math,x_={},b_=new mt,S_={};function k_(t,e){let i,s,n,r,o=0,a=0,h=0,l=0;return e.forEach(t=>{i=t.x||0,s=t.y||0,r=1.5*(t.blur||0),n=w_(t.spread||0),o=v_(o,n+r-s),a=v_(a,n+r+i),h=v_(h,n+r+s),l=v_(l,n+r-i)}),o===a&&a===h&&h===l?o:[o,a,h,l]}function B_(t,e,i){const{shapeBounds:s}=i;let n,r;ie.fullImageShadow?(f_(x_,t.bounds),y_(x_,e.x-s.x,e.y-s.y),n=t.bounds,r=x_):(n=s,r=e),t.copyWorld(i.canvas,n,r)}const{toOffsetOutBounds:P_}=Ht,T_={};const E_=k_;const C_={shadow:function(t,e,i){let s,n;const{__nowWorld:r}=t,{shadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=i,_=e.getSameCanvas(),p=o.length-1;m_(h,S_,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(r.scaleX);t>1&&(f=1/t)}_.setWorldShadow(S_.offsetX+(o.x||0)*c*f,S_.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f,sl.string(o.color)),n=ll.getShadowTransform(t,_,i,o,S_,f),n&&_.setTransform(n),B_(_,S_,i),n&&_.resetTransform(),s=l,o.box&&(_.restore(),_.save(),a&&(_.copyWorld(_,l,r,"copy"),s=r),a?_.copyWorld(a,r,r,"destination-out"):_.copyWorld(i.canvas,d,h,"destination-out")),_o.copyCanvasByWorld(t,e,_,s,o.blendMode),p&&g<p&&_.clearWorld(s)}),_.recycle(s)},innerShadow:function(t,e,i){let s,n;const{__nowWorld:r}=t,{innerShadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=i,_=e.getSameCanvas(),p=o.length-1;P_(h,T_,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(r.scaleX);t>1&&(f=1/t)}_.save(),_.setWorldShadow(T_.offsetX+(o.x||0)*c*f,T_.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f),n=ll.getShadowTransform(t,_,i,o,T_,f,!0),n&&_.setTransform(n),B_(_,T_,i),_.restore(),a?(_.copyWorld(_,l,r,"copy"),_.copyWorld(a,r,r,"source-out"),s=r):(_.copyWorld(i.canvas,d,h,"source-out"),s=l),_.fillWorld(s,sl.string(o.color),"source-in"),_o.copyCanvasByWorld(t,e,_,s,o.blendMode),p&&g<p&&_.clearWorld(s)}),_.recycle(s)},blur:function(t,e,i){const{blur:s}=t.__;i.setWorldBlur(s*t.__nowWorld.a),i.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),i.filter="none"},backgroundBlur:function(t,e,i){},getShadowRenderSpread:k_,getShadowTransform:function(t,e,i,s,n,r,o){if(s.spread){const i=2*s.spread*r*(o?-1:1),{width:a,height:h}=t.__layout.strokeBounds;return b_.set().scaleOfOuter({x:(n.x+n.width/2)*e.pixelRatio,y:(n.y+n.height/2)*e.pixelRatio},1+i/a,1+i/h),b_}},isTransformShadow(t){},getInnerShadowSpread:E_},{excludeRenderBounds:R_}=xo;let L_;function O_(t,e,i,s,n,r,o,a){switch(e){case"grayscale":L_||(L_=!0,n.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,i,s,n,r){const o=t.__nowWorld;i.resetTransform(),i.opacity=1,i.useMask(s,o),r&&s.recycle(o);D_(t,e,i,1,n,r)}(t,i,s,n,o,a);break;case"opacity-path":D_(t,i,s,r,o,a);break;case"path":a&&i.restore()}}function A_(t){return t.getSameCanvas(!1,!0)}function D_(t,e,i,s,n,r){const o=t.__nowWorld;e.resetTransform(),e.opacity=s,e.copyWorld(i,o,void 0,n),r?i.recycle(o):i.clearWorld(o)}Vl.prototype.__renderMask=function(t,e){let i,s,n,r,o,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(i=h[l],a=i.__.mask,a){o&&(O_(this,o,t,n,s,r,void 0,!0),s=n=null),"clipping"!==a&&"clipping-path"!==a||R_(i,e)||i.__render(t,e),r=i.__.opacity,L_=!1,"path"===a||"clipping-path"===a?(r<1?(o="opacity-path",n||(n=A_(t))):(o="path",t.save()),i.__clip(n||t,e)):(o="grayscale"===a?"grayscale":"alpha",s||(s=A_(t)),n||(n=A_(t)),i.__render(s,e));continue}const d=1===r&&i.__.__blendMode;d&&O_(this,o,t,n,s,r,void 0,!1),R_(i,e)||i.__render(n||t,e),d&&O_(this,o,t,n,s,r,d,!1)}O_(this,o,t,n,s,r,void 0,!0)};const M_=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",F_=M_+"_#~&*+\\=|≮≯≈≠=…",I_=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],[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("|"));function W_(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const N_=W_("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),z_=W_("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),Y_=W_(M_),X_=W_(F_),U_=W_("- —/~|┆·");var j_;!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"}(j_||(j_={}));const{Letter:H_,Single:V_,Before:q_,After:G_,Symbol:K_,Break:$_}=j_;function J_(t){return N_[t]?H_:U_[t]?$_:z_[t]?q_:Y_[t]?G_:X_[t]?K_:I_.test(t)?V_:H_}const Q_={trimRight(t){const{words:e}=t;let i,s=0,n=e.length;for(let r=n-1;r>-1&&(i=e[r].data[0]," "===i.char);r--)s++,t.width-=i.width;s&&e.splice(n-s,s)}};function Z_(t,e,i){switch(e){case"title":return i?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:tp}=Q_,{Letter:ep,Single:ip,Before:sp,After:np,Symbol:rp,Break:op}=j_;let ap,hp,lp,dp,cp,up,_p,pp,gp,fp,yp,mp,vp,wp,xp,bp,Sp,kp=[];function Bp(t,e){gp&&!pp&&(pp=gp),ap.data.push({char:t,width:e}),lp+=e}function Pp(){dp+=lp,ap.width=lp,hp.words.push(ap),ap={data:[]},lp=0}function Tp(){wp&&(xp.paraNumber++,hp.paraStart=!0,wp=!1),gp&&(hp.startCharSize=pp,hp.endCharSize=gp,pp=0),hp.width=dp,bp.width?tp(hp):Sp&&Ep(),kp.push(hp),hp={words:[]},dp=0}function Ep(){dp>(xp.maxWidth||0)&&(xp.maxWidth=dp)}const{top:Cp,right:Rp,bottom:Lp,left:Op}=bt;function Ap(t,e,i){const{bounds:s,rows:n}=t;s[e]+=i;for(let t=0;t<n.length;t++)n[t][e]+=i}const Dp={getDrawData:function(t,e){a(t)||(t=String(t));let i=0,s=0,n=e.__getInput("width")||0,r=e.__getInput("height")||0;const{__padding:o}=e;o&&(n?(i=o[Op],n-=o[Rp]+o[Op],!n&&(n=.01)):e.autoSizeAlign||(i=o[Op]),r?(s=o[Cp],r-=o[Cp]+o[Lp],!r&&(r=.01)):e.autoSizeAlign||(s=o[Cp]));const h={bounds:{x:i,y:s,width:n,height:r},rows:[],paraNumber:0,font:ie.canvas.font=e.__font};return function(t,e,i){xp=t,kp=t.rows,bp=t.bounds,Sp=!bp.width&&!i.autoSizeAlign;const{__letterSpacing:s,paraIndent:n,textCase:r}=i,{canvas:o}=ie,{width:a}=bp;if(i.__isCharMode){const t="none"!==i.textWrap,h="break"===i.textWrap;wp=!0,yp=null,pp=_p=gp=lp=dp=0,ap={data:[]},hp={words:[]},s&&(e=[...e]);for(let i=0,l=e.length;i<l;i++)up=e[i],"\n"===up?(lp&&Pp(),hp.paraEnd=!0,Tp(),wp=!0):(fp=J_(up),fp===ep&&"none"!==r&&(up=Z_(up,r,!lp)),_p=o.measureText(up).width,s&&(s<0&&(gp=_p),_p+=s),mp=fp===ip&&(yp===ip||yp===ep)||yp===ip&&fp!==np,vp=!(fp!==sp&&fp!==ip||yp!==rp&&yp!==np),cp=wp&&n?a-n:a,t&&a&&dp+lp+_p>cp&&(h?(lp&&Pp(),dp&&Tp()):(vp||(vp=fp===ep&&yp==np),mp||vp||fp===op||fp===sp||fp===ip||lp+_p>cp?(lp&&Pp(),dp&&Tp()):dp&&Tp()))," "===up&&!0!==wp&&dp+lp===0||(fp===op?(" "===up&&lp&&Pp(),Bp(up,_p),Pp()):mp||vp?(lp&&Pp(),Bp(up,_p)):Bp(up,_p)),yp=fp);lp&&Pp(),dp&&Tp(),kp.length>0&&(kp[kp.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{xp.paraNumber++,dp=o.measureText(t).width,kp.push({x:n||0,text:t,width:dp,paraStart:!0}),Sp&&Ep()})}(h,t,e),o&&function(t,e,i,s,n){if(!s&&i.autoSizeAlign)switch(i.textAlign){case"left":Ap(e,"x",t[Op]);break;case"right":Ap(e,"x",-t[Rp])}if(!n&&i.autoSizeAlign)switch(i.verticalAlign){case"top":Ap(e,"y",t[Cp]);break;case"bottom":Ap(e,"y",-t[Lp])}}(o,h,e,n,r),function(t,e){const{rows:i,bounds:s}=t,n=i.length,{__lineHeight:r,__baseLine:o,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:g,height:f}=s,y=r*n+(c?c*(t.paraNumber-1):0),m=o;if(h&&y>f)y=Math.max(e.__autoHeight?y:f,r),n>1&&(t.overflow=n);else if(f||u)switch(d){case"middle":p+=(f-y)/2;break;case"bottom":p+=f-y}m+=p;let v,w,x,b=g||u?g:t.maxWidth;for(let o=0,d=n;o<d;o++){if(v=i[o],v.x=_,v.width<g||v.width>g&&!h)switch(l){case"center":v.x+=(b-v.width)/2;break;case"right":v.x+=b-v.width}v.paraStart&&c&&o>0&&(m+=c),v.y=m,m+=r,t.overflow>o&&m>y&&(v.isOverflow=!0,t.overflow=o+1),w=v.x,x=v.width,a<0&&(v.width<0?(x=-v.width+e.fontSize+a,w-=x,x+=e.fontSize):x-=a),w<s.x&&(s.x=w),x>s.width&&(s.width=x),h&&g&&g<x&&(v.isOverflow=!0,t.overflow||(t.overflow=i.length))}s.y=p,s.height=y}(h,e),e.__isCharMode&&function(t,e,i){const{rows:s}=t,{textAlign:n,paraIndent:r,__letterSpacing:o}=e,a=i&&n.includes("both"),h=a||i&&n.includes("justify"),l=h&&n.includes("letter");let d,c,u,_,p,g,f,y,m,v;s.forEach(t=>{t.words&&(p=r&&t.paraStart?r:0,y=t.words.length,h&&(v=!t.paraEnd||a,c=i-t.width-p,l?_=c/(t.words.reduce((t,e)=>t+e.data.length,0)-1):u=y>1?c/(y-1):0),g=o||t.isOverflow||l?0:u?1:2,t.isOverflow&&!o&&(t.textMode=!0),2===g?(t.x+=p,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=p,d=t.x,t.data=[],t.words.forEach((e,i)=>{1===g?(f={char:"",x:d},d=function(t,e,i){return t.forEach(t=>{i.char+=t.char,e+=t.width}),e}(e.data,d,f),(t.isOverflow||" "!==f.char)&&t.data.push(f)):d=function(t,e,i,s,n){return t.forEach(t=>{(s||" "!==t.char)&&(t.x=e,i.push(t)),e+=t.width,n&&(e+=n)}),e}(e.data,d,t.data,t.isOverflow,v&&_),v&&(m=i===y-1,u?m||(d+=u,t.width+=u):_&&(t.width+=_*(e.data.length-(m?1:0))))})),t.words=null)})}(h,e,n),h.overflow&&function(t,e,i,s){const{rows:n,overflow:r}=t;let{textOverflow:o}=e;if(r&&n.splice(r),s&&o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const h=o?ie.canvas.measureText(o).width:0,l=i+s-h;("none"===e.textWrap?n:[n[r-1]]).forEach(e=>{if(e.isOverflow&&e.data){let i=e.data.length-1;for(let s=i;s>-1&&(t=e.data[s],a=t.x+t.width,!(s===i&&a<l));s--){if(a<l&&" "!==t.char||!s){e.data.splice(s+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,i,n),"none"!==e.textDecoration&&function(t,e){let i,s=0;const{fontSize:n,textDecoration:r}=e;switch(t.decorationHeight=n/11,_(r)?(i=r.type,r.color&&(t.decorationColor=sl.string(r.color)),r.offset&&(s=Math.min(.3*n,Math.max(r.offset,.15*-n)))):i=r,i){case"under":t.decorationY=[.15*n+s];break;case"delete":t.decorationY=[.35*-n];break;case"under-delete":t.decorationY=[.15*n+s,.35*-n]}}(h,e),h}};const Mp={string:function(t,e){if(!t)return"#000";const i=l(e)&&e<1;if(a(t)){if(!i||!sl.object)return t;t=sl.object(t)}let s=r(t.a)?1:t.a;i&&(s*=e);const n=t.r+","+t.g+","+t.b;return 1===s?"rgb("+n+")":"rgba("+n+","+s+")"}};Object.assign(il,Dp),Object.assign(sl,Mp),Object.assign(ol,yu),Object.assign(al,$u),Object.assign(hl,g_),Object.assign(ll,C_),Object.assign(_e,{interaction:(t,e,i,s)=>new tu(t,e,i,s),hitCanvas:(t,e)=>new Rh(t,e),hitCanvasManager:()=>new Ic}),Lh();class Fp extends wl{get __drawAfterFill(){return!0}setRobot(t){this._robot=t,this.__leaf.__updateRobot()}setAction(t){this._action=t,this.__leaf.__updateAction()}}let Ip=class extends Hl{get __tag(){return"Robot"}get nowFrame(){return this.robotFrames&&this.robotFrames[this.now]}constructor(t){super(t)}togglePlay(){this.running?this.pause():this.play()}play(){this.running=!0}pause(){this.running=!1}stop(){this.pause()}__updateRobot(){const{robot:t}=this;if(this.robotFrames=[],!t)return;let e=0;u(t)?t.forEach(t=>this.__loadRobot(t,e,e+=t.total||1)):this.__loadRobot(t,0,t.total)}__updateAction(){const t=this.actions[this.action];if(this.stop(),this.__timer&&clearTimeout(this.__timer),!r(t))if(l(t))this.now=t;else if(_(t)){const e=u(t),i=e?t:t.keyframes;this.__action=e?void 0:t;const{length:s}=i;if(s>1){const t=this.now=i[0],e=i[i.length-1];this.play(),this.__runAction(t,e)}else s&&(this.now=i[0])}}__loadRobot(t,e,i){for(let t=e;t<i;t++)this.robotFrames.push(void 0);const s=nr.get(t);s.ready?this.__createFrames(s,t,e,i):s.load(()=>this.__createFrames(s,t,e,i))}__createFrames(t,e,i,s){const{offset:n,size:r,total:o}=e,{width:a,height:h}=r&&(l(r)?{width:r,height:r}:r)||(o>1?this:t);let d=n?n.x:0,c=n?n.y:0;for(let e=i;e<s;e++)this.robotFrames[e]={view:t.view,x:d,y:c,width:a,height:h},d+a>=t.width?(d=0,c+=h):d+=a;this.__updateRobotBounds(),this.forceRender(),this.emitEvent(new qo(qo.LOADED,{image:t}))}__runAction(t,e){let{FPS:i,loop:s,__action:n}=this;n&&(n.FPS&&(i=n.FPS),r(n.loop)||(s=n.loop)),this.__timer=setTimeout(()=>{if(this.running){if(this.now===e){if(!s)return this.stop();this.now=t}else this.now++;this.__updateRobotBounds()}this.__runAction(t,e)},1e3/i)}__updateRobotBounds(){const{nowFrame:t}=this;if(t){const e=this.__,i=t.width/e.pixelRatio,s=t.height/e.pixelRatio;e.width===i&&e.height===s||this.forceUpdate("width"),e.__naturalWidth=i,e.__naturalHeight=s}}__drawContent(t,e){const{nowFrame:i}=this,{width:s,height:n}=this.__;i&&t.drawImage(i.view,i.x,i.y,i.width,i.height,0,0,s,n)}destroy(){this.robotFrames&&(this.robotFrames=null),super.destroy()}};function Wp(t,e){return pr(t,t=>({set(i){this.__setAttr(t,i),this.leaferIsReady?e?ul.setStyleName(this,e,i):ul.set(this,i):this.__layout.stateStyleChanged=!0}}))}function Np(t){return pr(t,t=>({set(e){this.__setAttr(t,e),this.__layout.stateStyleChanged=!0}}))}function zp(t,e){if(e&&!0!==e)return e;if(!t.button){let{parent:e}=t;for(let t=0;t<2;t++)if(e){if(e.button)return e;e=e.parent}}return null}function Yp(t,e){_(e)||(e=void 0),jp(t,e,"in")}function Xp(t,e){const{normalStyle:i}=t;_(e)||(e=void 0),i&&(e||(e=i),jp(t,e,"out"))}i([Ur(Fp)],Ip.prototype,"__",void 0),i([Sr()],Ip.prototype,"robot",void 0),i([yr()],Ip.prototype,"actions",void 0),i([yr("")],Ip.prototype,"action",void 0),i([Or(0)],Ip.prototype,"now",void 0),i([yr(12)],Ip.prototype,"FPS",void 0),i([yr(!0)],Ip.prototype,"loop",void 0),Ip=i([Zr()],Ip),ue.add("robot");const Up={};function jp(t,e,i){const{normalStyle:s}=t;e||(e=Up),e.scale&&(I.assignScale(e,e.scale),delete e.scale),e!==Up&&ul.canAnimate||(i=null);let n=!!i&&function(t,e,i){let s="in"===t?"transition":"transitionOut";"out"===t&&o(i[s])&&o(e[s])&&(s="transition");return o(e[s])?i[s]:e[s]}(i,e,t);const r=n?function(t,e){const i=qp(e,t),s=t.animate();s&&qp(i,t,s.fromStyle);return i}(t,e):void 0;ul.canAnimate&&Hp(t)&&t.killAnimate("transition"),s&&t.set(s,"temp");const a=Hp(t);if(a){const{animation:s}=a;if(s){const r=t.animate(s,void 0,"animation",!0);Object.assign(a,r.endingStyle),"in"!==i||e.animation!==s?r.kill():n=!1,delete a.animation}t.normalStyle=Vp(a,t),t.set(a,"temp")}else t.normalStyle=void 0;if(n){const e=Vp(r,t);t.set(r,"temp"),t.animate([r,e],n,"transition",!0)}t.__layout.stateStyleChanged=!1}function Hp(t){let e;const i={},s=zp(t),n=s?t.state||s.state:t.state,r=n&&t.states[n];r&&ul.isState(n,t,s)&&(e=Gp(i,r));const o=i.selectedStyle||t.selectedStyle;o&&ul.isSelected(t,s)&&(e=Gp(i,o));const a=i.placeholderStyle||t.placeholderStyle;if(a&&ul.isPlacehold(t,s)&&(e=Gp(i,a)),ul.isDisabled(t,s)){const s=i.disabledStyle||t.disabledStyle;s&&(e=Gp(i,s))}else{const n=i.focusStyle||t.focusStyle;n&&ul.isFocus(t,s)&&(e=Gp(i,n));const r=i.hoverStyle||t.hoverStyle;r&&ul.isHover(t,s)&&(e=Gp(i,r));const o=i.pressStyle||t.pressStyle;o&&ul.isPress(t,s)&&(e=Gp(i,o))}return e?i:void 0}function Vp(t,e,i,s){const n=i?t:{},r=i||t;for(let t in r)s&&ul.animateExcludes[t]||(n[t]=e[t]);return n}function qp(t,e,i){return Vp(t,e,i,!0)}function Gp(t,e){return Object.assign(t,e),!0}function Kp(t,e){const i=t[e];i&&Yp(t,i),t.button&&Jp(t.children,e)}function $p(t,e,i){i||(i=t.states[e]),Yp(t,i),t.button&&Jp(t.children,null,e)}function Jp(t,e,i){if(!t)return;let s,n;for(let o=0,a=t.length;o<a;o++){if(s=t[o],e){switch(n=!0,e){case"hoverStyle":ul.isHover(s)&&(n=!1);break;case"pressStyle":ul.isPress(s)&&(n=!1);break;case"focusStyle":ul.isFocus(s)&&(n=!1)}n&&Kp(s,e)}else r(i)||$p(s,i);s.isBranch&&Jp(s.children,e,i)}}function Qp(t,e){const i=t[e];i&&Xp(t,i),t.button&&tg(t.children,e)}function Zp(t,e,i){Xp(t,i),t.button&&tg(t.children,null,e)}function tg(t,e,i){if(!t)return;let s;for(let n=0,o=t.length;n<o;n++)s=t[n],e?Qp(s,e):r(i)||Zp(s,i),s.isBranch&&tg(s.children,e,i)}function eg(t,e,i){let s;const n=e.leafer?e.leafer.interaction:null;if(n&&(s=n[t](e),!s&&i)){const r=zp(e,i);r&&(s=n[t](r))}return s}function ig(t,e,i){let s=e[t];if(!s&&i){const n=zp(e,i);n&&(s=n[t])}return s}ue.add("state"),ul.animateExcludes={animation:1,animationOut:1,transition:1,transitionOut:1,states:1,state:1,placeholder:1,normalStyle:1,hoverStyle:1,pressStyle:1,focusStyle:1,selectedStyle:1,disabledStyle:1,placeholderStyle:1},ul.isState=function(t,e,i){return function(t,e,i){let s=e.states[t];if(!s&&i){const n=zp(e,i);n&&(s=n.states[t])}return!!s}(t,e,i)},ul.isSelected=function(t,e){return ig("selected",t,e)},ul.isDisabled=function(t,e){return ig("disabled",t,e)},ul.isFocus=function(t,e){return eg("isFocus",t,e)},ul.isHover=function(t,e){return eg("isHover",t,e)},ul.isPress=function(t,e){return eg("isPress",t,e)},ul.isPlacehold=function(t,e){return t.__.__isPlacehold},ul.isDrag=function(t,e){return eg("isDrag",t,e)},ul.setStyleName=function(t,e,i){i?$p(t,e,t[e]):Zp(t,e,t[e])},ul.set=function(t,e){const i=t.states[e];i?$p(t,e,i):Zp(t,e,i)},ul.getStyle=Hp,ul.updateStyle=jp,ul.updateEventStyle=function(t,e){switch(e){case oc.ENTER:Kp(t,"hoverStyle");break;case oc.LEAVE:Qp(t,"hoverStyle");break;case oc.DOWN:Kp(t,"pressStyle");break;case oc.UP:Qp(t,"pressStyle")}};const sg=Hl.prototype;Hl.addAttr("selected",!1,Wp,"selectedStyle"),Hl.addAttr("disabled",!1,Wp,"disabledStyle"),Hl.addAttr("states",{},Np),Hl.addAttr("state","",Wp),Hl.addAttr("normalStyle",void 0,yr),Hl.addAttr("hoverStyle",void 0,Np),Hl.addAttr("pressStyle",void 0,Np),Hl.addAttr("focusStyle",void 0,Np),Hl.addAttr("selectedStyle",void 0,Np),Hl.addAttr("disabledStyle",void 0,Np),Hl.addAttr("placeholderStyle",void 0,Np),Hl.addAttr("button",!1,yr),sg.set=function(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))},sg.focus=function(t=!0){this.waitLeafer(()=>{let{focusData:e}=this.app.interaction;t?(e&&e.focus(!1),e=this):e=null,this.app.interaction.focusData=e,t?Kp(this,"focusStyle"):Qp(this,"focusStyle")})},sg.updateState=function(){ul.updateStyle(this,void 0,"in")};const ng=Nd.prototype,rg="text";cr(ng,rg,Object.assign(Object.assign({},ur(ng,rg)),{set(t){const e=this,i=e.text;e.__setAttr(rg,t)&&(Br(e),e.placeholderStyle&&e.placeholder&&(""===i||""===t)&&(e.__layout.stateStyleChanged=!0))}}));const{cos:og,sin:ag,pow:hg,sqrt:lg,abs:dg,ceil:cg,floor:ug,round:_g,PI:pg}=Math,gg=5*pg,fg=1.70158,yg=2.5949095,mg=7.5625,vg=2.75;function wg(t){return e=>hg(e,t)}function xg(t){return e=>1-hg(1-e,t)}function bg(t){return e=>e<.5?.5*hg(2*e,t):1-.5*hg(2-2*e,t)}function Sg(t){return t<1/vg?mg*t*t:t<2/vg?mg*(t-=1.5/vg)*t+.75:t<2.5/vg?mg*(t-=2.25/vg)*t+.9375:mg*(t-=2.625/vg)*t+.984375}function kg(t,e,i,s){const n={};return r=>{const o=~~(1e4*r),a=n[o];if(a)return a;let h,l,d,c=r;for(let e=0;e<8&&(h=1-c,d=Bg(c,t,i)-r,l=3*h*h*t+6*h*c*(i-t)+3*c*c*(1-i),!(dg(l)<1e-6));e++)c-=d/l;return n[o]=Bg(c,e,s)}}function Bg(t,e,i){const s=1-t;return 3*s*s*t*e+3*s*t*t*i+t*t*t}const Pg={get(t){const{list:e}=Pg;return a(t)?e[t||"ease"]:_(t)?e[t.name].apply(e,u(t.value)?t.value:[t.value]):e.ease},register(t,e){Pg.list[t]=e},list:{linear:t=>t,ease:kg(.25,.1,.25,1),"ease-in":kg(.42,0,1,1),"ease-out":kg(0,0,.58,1),"ease-in-out":kg(.42,0,.58,1),"sine-in":t=>1-og(t*pg*.5),"sine-out":t=>ag(t*pg*.5),"sine-in-out":t=>.5*(1-og(t*pg)),"quad-in":wg(2),"quad-out":xg(2),"quad-in-out":bg(2),"cubic-in":wg(3),"cubic-out":xg(3),"cubic-in-out":bg(3),"quart-in":wg(4),"quart-out":xg(4),"quart-in-out":bg(4),"quint-in":wg(5),"quint-out":xg(5),"quint-in-out":bg(5),"expo-in":t=>t?hg(2,10*t-10):0,"expo-out":t=>1===t?1:1-hg(2,10*-t),"expo-in-out":t=>0===t||1===t?t:t<.5?.5*hg(2,2*t*10-10):.5*(2-hg(2,10-2*t*10)),"circ-in":t=>1-lg(1-hg(t,2)),"circ-out":t=>lg(1-hg(t-1,2)),"circ-in-out":t=>t<.5?.5*(1-lg(1-hg(2*t,2))):.5*(lg(1-hg(2-2*t,2))+1),"back-in":t=>((fg+1)*t-fg)*t*t,"back-out":t=>(t-=1)*t*((fg+1)*t+fg)+1,"back-in-out":t=>t<.5?(t*=2)*t*((yg+1)*t-yg)*.5:.5*((t=2*t-2)*t*((yg+1)*t+yg)+2),"elastic-in":t=>0===t||1===t?t:-hg(2,10*(t-1))*ag((t-1.1)*gg),"elastic-out":t=>0===t||1===t?t:hg(2,-10*t)*ag((t-.1)*gg)+1,"elastic-in-out":t=>0===t||1===t?t:t<.5?-hg(2,10*((t*=2)-1))*ag((t-1.1)*gg)*.5:hg(2,10*(1-(t*=2)))*ag((t-1.1)*gg)*.5+1,"bounce-in":t=>1-Sg(1-t),"bounce-out":Sg,"bounce-in-out":t=>t<.5?.5*(1-Sg(1-2*t)):.5*(1+Sg(2*t-1)),"cubic-bezier":kg,steps:function(t,e="floor"){return i=>("floor"===e?ug(i*t):"ceil"===e?cg(i*t):_g(i*t))/t}}};function Tg(t){return(e,i)=>{Object.defineProperty(e,i,{get(){const e=this.config&&this.config[i];return void 0===e?t:e},set(t){this.config||(this.config={}),this.config[i]=t}})}}class Eg{}Eg.CREATED="created",Eg.PLAY="play",Eg.PAUSE="pause",Eg.STOP="stop",Eg.SEEK="seek",Eg.UPDATE="update",Eg.COMPLETED="completed";let Cg=class extends ca{get endingStyle(){return"from"===this.realEnding?this.fromStyle:this.toStyle}get started(){return!!this.requestAnimateTime}get completed(){return this.time>=this.duration&&!this.started}get frame(){return this.frames[this.nowIndex]}get frameTotalTime(){return this.frame.totalTime||this.frame.duration||0}get nowReverse(){return(this.mainReverse?1:0)+(this.frameReverse?1:0)==1}get realEnding(){let t;const{ending:e,reverse:i,swing:s,loop:n}=this;return"from"===e?t=0:"to"===e?t=1:(t=i?0:1,s&&n&&l(n)&&(t+=n-1)),t%2?"to":"from"}constructor(t,e,i,s){super(),this.nowIndex=0,this.playedTotalTime=0,e&&(e.keyframes?(i=e,e=e.keyframes):e.style&&(i=e,e=e.style)),this.init(t,e,i,s)}init(t,e,i,s){switch(this.target=t,(s||this.isTemp)&&(this.isTemp=s),typeof i){case"number":this.config={duration:i};break;case"string":this.config={easing:i};break;case"object":this.config=i,i.event&&(this.event=i.event)}this.keyframes=u(e)?e:e?[e]:[];const{easing:n,attrs:r}=this;this.easingFn=Pg.get(n),(r||this.attrsMap)&&(this.attrsMap=r?r.reduce((t,e)=>(t[e]=!0,t),{}):void 0),this.frames=[],this.create(),this.autoplay&&this.frames.length&&(this.timer=setTimeout(()=>{this.timer=0,this.play()},0))}emitType(t){this.emit(t,this),this.parent&&this.parent.onChildEvent(t,this)}play(){this.destroyed||(this.running=!0,this.started?this.timer||this.startRequestAnimate():(this.clearTimer(),this.start()),this.emitType(Eg.PLAY))}pause(){this.destroyed||(this.running=!1,this.clearTimer(),this.emitType(Eg.PAUSE))}stop(){this.destroyed||(this.complete(),this.emitType(Eg.STOP))}seek(t,e){if(this.destroyed)return;const{delay:i}=this;let s;_(t)&&(t=nl.number(t,this.duration+(e?i:0))),e&&(t-=i),t&&(t/=this.speed),t<0&&(s=-t,t=0),(!this.started||t<this.time||!t)&&this.start(!0),this.time=t,s||this.animate(0,!0),this.clearTimer(()=>{s?this.timer=setTimeout(()=>{this.timer=0,this.begin()},1e3*s):this.startRequestAnimate()}),this.emitType(Eg.SEEK)}kill(t=!0,e){this.killStyle=e,this.destroy(t)}create(){const{target:t,frames:e,keyframes:i,config:s}=this,{length:n}=i,o=!(n>1)||this.join;let a,h,d,c,u,_=0,p=0;n>1&&(this.fromStyle={},this.toStyle={});for(let s=0;s<n;s++){if(h=i[s],c=h.style||h,a||(a=o?t:c),d={style:c,beforeStyle:{}},u=1,h.style){const{duration:t,autoDuration:e,delay:i,autoDelay:s,easing:n,swing:r,loop:o}=h;r&&(d.swing=l(r)?r:2,u=2*d.swing-1),o&&(d.loop=u=l(o)?o:2),t?(d.duration=t,_+=t*u,i&&(d.totalTime=t+i)):e&&(d.autoDuration=e,p+=e*u),i?(d.delay=i,_+=i*u):s&&(d.autoDelay=s,p+=s*u),n&&(d.easingFn=Pg.get(n))}if(!d.autoDuration&&r(d.duration)&&(n>1?s>0||o?p+=u:d.duration=0:d.duration=this.duration),n>1)this.setBefore(d,c,a);else{for(let e in c)d.beforeStyle[e]=t[e];this.fromStyle=d.beforeStyle,this.toStyle=d.style}a=c,e.push(d)}p?((this.duration<=_||!s||!s.duration)&&this.changeDuration(_+.2*p),this.allocateTime((this.duration-_)/p)):_&&this.changeDuration(_),this.emitType(Eg.CREATED)}changeDuration(t){const{config:e}=this;this.config=e?Object.assign(Object.assign({},e),{duration:t}):{duration:t}}setBefore(t,e,i){const{fromStyle:s,toStyle:n,target:o}=this;for(let a in e)r(s[a])&&(s[a]=n[a]=e===i?i[a]:o[a]),t.beforeStyle[a]=r(i[a])?n[a]:i[a],n[a]=e[a]}allocateTime(t){let e,{frames:i}=this,{length:s}=i;for(let n=0;n<s;n++)e=i[n],r(e.duration)&&(e.duration=e.autoDuration?t*e.autoDuration:t),e.totalTime||(e.autoDelay&&(e.delay=e.autoDelay*t),e.delay&&(e.totalTime=e.duration+e.delay))}startRequestAnimate(){this.requestAnimateTime=Date.now(),this.requestAnimatePageTime=0,this.waitRequestRender||this.requestAnimate()}requestAnimate(){this.waitRequestRender=!0,ie.requestRender(this.animate.bind(this))}animate(t,e){if(!e){if(this.waitRequestRender=!1,!this.running)return;let e;e=t&&this.requestAnimatePageTime?t-this.requestAnimatePageTime:Date.now()-this.requestAnimateTime,this.time+=e/1e3,this.requestAnimatePageTime=t,this.requestAnimateTime=Date.now()}const{duration:i}=this,s=this.time*this.speed;if(s<i){for(;s-this.playedTotalTime>this.frameTotalTime;)this.transition(1),this.mainReverse?this.reverseNextFrame():this.nextFrame();const t=this.nowReverse?0:this.frame.delay||0,e=s-this.playedTotalTime-t,i=this.frame.duration;if(e>i)this.transition(1);else if(e>=0){const t=i?e/i:1;this.transition(this.frame.easingFn?this.frame.easingFn(t):this.easingFn(t))}}else this.end();if(!e)if(s<i)this.requestAnimate();else{const{loop:t,loopDelay:e,swing:i}=this;if((!1!==t||i)&&(this.looped?this.looped++:this.looped=1,this.needLoop(this.looped,t,i)))return i&&(this.mainReverse=!this.mainReverse),void(e?this.timer=setTimeout(()=>{this.timer=0,this.begin()},e/this.speed*1e3):this.begin());this.complete()}}start(t){this.requestAnimateTime=1;const{reverse:e,jump:i}=this;if((e||this.mainReverse)&&(this.mainReverse=e),this.looped&&(this.looped=0),t)this.begin(!0);else{const{delay:t}=this;t?(i&&this.begin(!0),this.timer=setTimeout(()=>{this.timer=0,this.begin()},t/this.speed*1e3)):this.begin()}}begin(t){this.playedTotalTime=this.time=0,this.mainReverse?this.setTo():this.setFrom(),t||this.startRequestAnimate()}end(){this.mainReverse?this.setFrom():this.setTo()}complete(){this.requestAnimateTime=0,this.running=!1;const{endingStyle:t,killStyle:e}=this,i=e?{}:t;if(e)for(let s in t)s in e||(i[s]=t[s]);this.setStyle(i),this.clearTimer(),this.emitType(Eg.COMPLETED)}setFrom(){this.nowIndex=0,this.setStyle(this.fromStyle)}setTo(){this.nowIndex=this.frames.length-1,this.setStyle(this.toStyle)}nextFrame(){if(this.needLoopFrame())return this.increaseTime();this.nowIndex+1>=this.frames.length||(this.increaseTime(),this.nowIndex++)}reverseNextFrame(){if(this.needLoopFrame())return this.increaseTime();this.nowIndex-1<0||(this.increaseTime(),this.nowIndex--)}transition(t){const{style:e,beforeStyle:i}=this.frame,s=this.nowReverse?e:i,n=this.nowReverse?i:e;if(0===t)this.setStyle(s);else if(1===t)this.setStyle(n);else{const{attrsMap:i,target:r}=this;let{betweenStyle:o}=this.frame;o||(o=this.frame.betweenStyle={}),_l.setBetweenStyle(o,s,n,e,t,r,i),this.setStyle(o)}this.emitType(Eg.UPDATE)}setStyle(t){const{target:e}=this;e&&t&&(this.style=t,e.__?e.set(t,!!this.isTemp&&"temp"):Object.assign(e,t))}increaseTime(){this.playedTotalTime+=this.frameTotalTime}needLoop(t,e,i){return!(this.needStopLoop(t,e)||this.needStopLoop(t,i,!0))}needStopLoop(t,e,i){return l(e)&&(!e||t>=(i?2*e-1:e))}needLoopFrame(){const{loop:t,swing:e}=this.frame;if(t||e){if(this.frameLooped?this.frameLooped++:this.frameLooped=1,e&&(this.frameReverse=!this.frameReverse),this.needLoop(this.frameLooped,t,e))return!0;this.frameLooped=this.frameReverse=void 0}return!1}clearTimer(t){this.timer&&(clearTimeout(this.timer),this.timer=0,t&&t())}destroy(t){this.destroyed||(super.destroy(),t&&!this.completed?this.stop():this.pause(),this.target=this.parent=this.config=this.frames=this.fromStyle=this.toStyle=this.style=this.killStyle=null,this.destroyed=!0)}};i([Tg("ease")],Cg.prototype,"easing",void 0),i([Tg(0)],Cg.prototype,"delay",void 0),i([Tg(.2)],Cg.prototype,"duration",void 0),i([Tg("auto")],Cg.prototype,"ending",void 0),i([Tg(!1)],Cg.prototype,"reverse",void 0),i([Tg(!1)],Cg.prototype,"swing",void 0),i([Tg(!1)],Cg.prototype,"loop",void 0),i([Tg(0)],Cg.prototype,"loopDelay",void 0),i([Tg(1)],Cg.prototype,"speed",void 0),i([Tg(!0)],Cg.prototype,"autoplay",void 0),i([Tg()],Cg.prototype,"join",void 0),i([Tg()],Cg.prototype,"jump",void 0),i([Tg()],Cg.prototype,"attrs",void 0),Cg=i([Qr(ba)],Cg);let Rg=class extends Cg{get completed(){return this.list.every(t=>t.completed)}get endingStyle(){return this._endingStyle}constructor(t,e,i){super(t,null),this.list=[],this.updateList(e,i)}updateList(t,e){this.fromStyle={},this.toStyle={},this._endingStyle={},t||(t=this.list.filter(t=>{const{completed:e}=t;return e&&t.destroy(),!e})),this.list=t.map(t=>{const i=t.target?t:new Cg(this.target,t,e);return i.parent=this,Object.assign(this.fromStyle,i.fromStyle),Object.assign(this.toStyle,i.toStyle),Object.assign(this._endingStyle,i.endingStyle),i})}play(){this.each(t=>t.play()),this.emitType(Eg.PLAY)}pause(){this.each(t=>t.pause()),this.emitType(Eg.PAUSE)}stop(){this.each(t=>t.stop()),this.emitType(Eg.STOP)}seek(t,e){this.each(i=>i.seek(t,e)),this.emitType(Eg.SEEK)}kill(t,e){this.each(i=>i.kill(t,e)),this.destroy()}onChildEvent(t,e){switch(t){case Eg.COMPLETED:this.completed&&this.emitType(t);break;case Eg.UPDATE:this.emitType(t)}}each(t){this.list.forEach(t)}destroy(t){const{list:e}=this;e.length&&(this.each(e=>e.destroy(t)),e.length=0)}};Rg=i([Qr(ba)],Rg);const Lg={transparent:"FFF0",aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"0FF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"0",blanchedalmond:"FFEBCD",blue:"00F",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",cornsilk:"FFF8DC",crimson:"DC143C",cyan:"0FF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9",darkgreen:"006400",darkgrey:"A9",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkslategrey:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"69",dimgrey:"69",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",forestgreen:"228B22",fuchsia:"F0F",gainsboro:"DC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"80",green:"008000",greenyellow:"ADFF2F",grey:"80",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgray:"D3",lightgreen:"90EE90",lightgrey:"D3",lightpink:"FFB6C1",lightsalmon:"FFA07A",lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"789",lightslategrey:"789",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"00FF00",limegreen:"32CD32",linen:"FAF0E6",magenta:"FF00FF",maroon:"800000",mediumaquamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370DB",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"6B8E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",rebeccapurple:"639",red:"F00",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",slategrey:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"F",whitesmoke:"F5",yellow:"FF0",yellowgreen:"9ACD32"},Og=/^rgb\((\d+),\s*(\d+),\s*(\d+)/i,Ag=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d*\.?\d+)/i,Dg=/^hsl\((\d+),\s*(\d+)%\s*,\s*(\d+)%/i,Mg=/^hsla\((\d+),\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d*\.?\d+)/i,Fg=parseInt,Ig=parseFloat,{round:Wg}=Math;let Ng={},zg=0;function Yg(t){let e,i,s,n=1;switch(t.length){case 9:e=Fg(t.slice(1,3),16),i=Fg(t.slice(3,5),16),s=Fg(t.slice(5,7),16),n=Fg(t.slice(7,9),16)/255;break;case 7:e=Fg(t.slice(1,3),16),i=Fg(t.slice(3,5),16),s=Fg(t.slice(5,7),16);break;case 5:e=Fg(t[1]+t[1],16),i=Fg(t[2]+t[2],16),s=Fg(t[3]+t[3],16),n=Fg(t[4]+t[4],16)/255;break;case 4:e=Fg(t[1]+t[1],16),i=Fg(t[2]+t[2],16),s=Fg(t[3]+t[3],16);break;case 3:e=i=s=Fg(t[1]+t[2],16);break;case 2:e=i=s=Fg(t[1]+t[1],16)}return{r:e,g:i,b:s,a:n}}const Xg=1/6,Ug=.5,jg=2/3,Hg=1/3;function Vg(t,e,i){return i<0?i++:i>1&&i--,i<Xg?t+6*(e-t)*i:i<Ug?e:i<jg?t+(e-t)*(jg-i)*6:t}function qg(t,e,i,s=1){let n,r,o;if(t/=360,i/=100,0===(e/=100))n=r=o=i;else{let s=i<.5?i*(1+e):i+e-i*e,a=2*i-s;n=Vg(a,s,t+Hg),r=Vg(a,s,t),o=Vg(a,s,t-Hg)}return{r:Wg(255*n),g:Wg(255*r),b:Wg(255*o),a:s}}ue.add("color"),sl.object=function(t,e){let i,s=!r(e)&&e<1;if(a(t)){const e=Ng[t];if(e)i=Object.assign({},e);else{switch(t[0]){case"#":i=Yg(t);break;case"R":case"r":"("===t[4]&&Ag.test(t)?i=function(t){const e=Ag.exec(t);return{r:Fg(e[1]),g:Fg(e[2]),b:Fg(e[3]),a:Ig(e[4])}}(t):"("===t[3]&&Og.test(t)&&(i=function(t){const e=Og.exec(t);return{r:Fg(e[1]),g:Fg(e[2]),b:Fg(e[3]),a:1}}(t));break;case"H":case"h":"("===t[4]&&Mg.test(t)?i=function(t){const e=Mg.exec(t);return qg(Ig(e[1]),Ig(e[2]),Ig(e[3]),Ig(e[4]))}(t):"("===t[3]&&Dg.test(t)&&(i=function(t){const e=Dg.exec(t);return qg(Ig(e[1]),Ig(e[2]),Ig(e[3]),1)}(t))}if(!i){const e=Lg[t.toLowerCase()];e&&(i=Yg("#"+e))}i&&(zg++,zg>1e4&&(Ng={},zg=0),Ng[t]=Object.assign({},i))}}else _(t)&&(r(t.a)&&(t.a=1),s&&(t=Object.assign({},t)),i=t);return i||(i={r:255,g:255,b:255,a:1}),s&&(i.a*=e),i};const{round:Gg}=Math,{fourNumber:Kg}=I,$g={fill:ef,stroke:ef,cornerRadius:(t,e,i)=>l(t)&&l(e)?Zg(t,e,i):(t=Kg(t),e=Kg(e),t.map((t,s)=>Zg(t,e[s],i))),text(t,e,i){if(a(t)&&a(e)){const s=t.length,n=e.length,r=Zg(s,n,i,1);return s<n?e.substring(0,r):t.substring(0,r)}return l(t)||l(e)?I.float(Zg(t,e,i),Math.max(Qg(t),Qg(e))):e},boxStyle(t,e,i,s){t||(t={}),e||(e={});const n=Object.assign(Object.assign({},t),e);return _l.setBetweenStyle(n,t,e,n,i,s),n},shadow:sf,innerShadow:sf},Jg={value:function(t,e,i){const s=l(t),n=l(e);return s&&n?t+(e-t)*i:n||s?Zg(t,e,i):t},number:Zg,color:tf,setBetweenStyle:function(t,e,i,s,n,r,o){let a,h,l;const{list:d,value:c}=_l;for(let u in s)o&&!o[u]||(a=e[u],h=i[u],l=d[u]||c,a!==h&&(t[u]=l(a,h,n,r)))}};function Qg(t){const e=String(t).split(".")[1];return e?e.length:0}function Zg(t,e,i,s){t||(t=0),e||(e=0);const n=t+(e-t)*i;return s?Gg(n):n}function tf(t,e,i){t=sl.object(t),e=sl.object(e);const s=Zg(t.r,e.r,i,1)+","+Zg(t.g,e.g,i,1)+","+Zg(t.b,e.b,i,1),n=Zg(t.a,e.a,i);return 1===n?"rgb("+s+")":"rgba("+s+","+n+")"}function ef(t,e,i){return a(t)&&a(e)?tf(t,e,i):e}function sf(t,e,i){return u(t)||u(e)?e:(e=e||{},{x:Zg((t=t||{}).x,e.x,i),y:Zg(t.y,e.y,i),blur:Zg(t.blur,e.blur,i),spread:Zg(t.spread,e.spread,i),color:tf(t.color||"#FFFFFF00",e.color||"#FFFFFF00",i),visible:e.visible,blendMode:e.blendMode,box:e.box||t.box})}ue.add("animate","color"),ul.canAnimate=!0,Object.assign(_l.list,$g),Object.assign(_l,Jg);const nf=Hl.prototype;Hl.addAttr("animation",void 0,function(t){return pr(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&(this.killAnimate("animation"),e&&this.animate(e,void 0,"animation"))}}))}),Hl.addAttr("animationOut",void 0,yr),Hl.addAttr("transition",!0,yr),Hl.addAttr("transitionOut",void 0,yr),nf.set=function(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))},nf.animate=function(t,e,i,s){if(r(t))return this.__animate;let n=u(t)&&!e&&i?new Rg(this,t,s):new Cg(this,t,e,s);this.killAnimate(i,n.toStyle);const o=this.__animate;return o&&(n instanceof Rg?n.list.unshift(o):n=new Rg(this,[o,n])),this.__animate=n},nf.killAnimate=function(t,e){const i=this.__animate;if(i){let t=!1;if(e&&!i.completed){i instanceof Rg&&i.updateList();const{toStyle:s}=i;for(let i in e)if(i in s){t=!0;break}}else t=!0;t&&(i.kill(!0,e),this.__animate=null)}},nf.__runAnimation=function(t,e){this.animate("in"===t?this.animation:this.animationOut,void 0,"animation"),e&&this.__animate.on(Eg.COMPLETED,e)};const rf=[.1488743389,.4333953941,.6794095682,.8650633666,.9739065285],of=[.2955242247,.2692667193,.2190863625,.1494513491,.0666713443],{sqrt:af}=Math,{getDerivative:hf}=di,lf={getDistance(t,e,i,s,n,r,o,a,h=1){let l,d,c,u,_,p,g=0,f=h/2;for(let h=0;h<rf.length;h++)l=f*(1+rf[h]),d=f*(1-rf[h]),c=hf(l,t,i,n,o),u=hf(l,e,s,r,a),_=hf(d,t,i,n,o),p=hf(d,e,s,r,a),g+=of[h]*(af(c*c+u*u)+af(_*_+p*p));return g*f},getRotation(t,e,i,s,n,r,o,a,h){const l=hf(t,e,s,r,a),d=hf(t,i,n,o,h);return Math.atan2(d,l)/N},getT(t,e,i,s,n,r,o,a,h,l,d=1){let c=0,u=1,_=t/e,p=d/e/3;if(_>=1)return 1;if(_<=0)return 0;for(;u-c>p;)df(i,s,n,r,o,a,h,l,_)<t?c=_:u=_,_=(c+u)/2;return _},cut(t,e,i,s,n,r,o,a,h,l){const d=1-e,c=d*i+e*n,u=d*s+e*r,_=d*n+e*o,p=d*r+e*a,g=d*c+e*_,f=d*u+e*p,y=d*g+e*(d*_+e*(d*o+e*h)),m=d*f+e*(d*p+e*(d*a+e*l));t.push(Ie.C,c,u,g,f,y,m)}},{getDistance:df}=lf,{M:cf,L:uf,C:_f,Z:pf}=Ie,{float:gf}=I,ff={},yf={},mf={transform(t,e){let i,s=0;const n=t.length;for(;s<n;)switch(i=t[s],i){case cf:case uf:mf.transformPoints(t,e,s,1),s+=3;break;case _f:mf.transformPoints(t,e,s,3),s+=7;break;case pf:s+=1}},transformPoints(t,e,i,s){for(let n=i+1,r=n+2*s;n<r;n+=2)ff.x=t[n],ff.y=t[n+1],Q.toOuterPoint(e,ff),t[n]=ff.x,t[n+1]=ff.y},getMotionPathData(t){let e,i,s,n,r=0,o=[],a=0,h=0,l=0;const d=t.length;for(;a<d;){switch(n=t[a],n){case cf:case uf:i=t[a+1],s=t[a+2],e=n===uf&&a>0?dt.getDistanceFrom(h,l,i,s):0,h=i,l=s,a+=3;break;case _f:i=t[a+5],s=t[a+6],e=lf.getDistance(h,l,t[a+1],t[a+2],t[a+3],t[a+4],i,s),h=i,l=s,a+=7;break;case pf:a+=1;default:e=0}o.push(e),r+=e}return{total:r,segments:o,data:t}},getDistancePoint(t,e,i){const{segments:s,data:n}=t;e=nl.number(e,t.total);let r,o,a,h,l,d,c,u,_,p=0,g={},f=0,y=0,m=0,v=0;const w=n.length;for(;f<w;){switch(h=n[f],h){case cf:case uf:if(o=n[f+1],a=n[f+2],r=s[y],p+r>=e||!t.total)return f||(m=o,v=a),yf.x=m,yf.y=v,g.x=o,g.y=a,dt.getDistancePoint(yf,g,e-p,!0),g.rotation=dt.getAngle(yf,g),g;m=o,v=a,f+=3;break;case _f:if(o=n[f+5],a=n[f+6],r=s[y],p+r>=e)return l=n[f+1],d=n[f+2],c=n[f+3],u=n[f+4],_=lf.getT(e-p,r,m,v,l,d,c,u,o,a,i),di.getPointAndSet(_,m,v,l,d,c,u,o,a,g),g.rotation=lf.getRotation(_,m,v,l,d,c,u,o,a),g;m=o,v=a,f+=7;break;case pf:f+=1;default:r=0}y++,p+=r}return g},getDistancePath(t,e,i){const{segments:s,data:n}=t,r=[];e=nl.number(e,t.total);let o,a,h,l,d,c,u,_,p,g,f=0,y={},m=0,v=0,w=0,x=0;const b=n.length;for(;m<b;){switch(d=n[m],d){case cf:case uf:if(h=n[m+1],l=n[m+2],o=s[v],f+o>e||!t.total)return m||(w=h,x=l),yf.x=w,yf.y=x,y.x=h,y.y=l,a=gf(e-f),a&&(dt.getDistancePoint(yf,y,a,!0),r.push(d,y.x,y.y)),r;w=h,x=l,m+=3,r.push(d,w,x);break;case _f:if(c=n[m+1],u=n[m+2],_=n[m+3],p=n[m+4],h=n[m+5],l=n[m+6],o=s[v],f+o>e)return a=gf(e-f),a&&(g=lf.getT(a,o,w,x,c,u,_,p,h,l,i),lf.cut(r,g,w,x,c,u,_,p,h,l)),r;w=h,x=l,m+=7,r.push(d,c,u,_,p,h,l);break;case pf:m+=1,r.push(d);default:o=0}v++,f+=o}return r}};function vf(t){return pr(t,t=>({set(e){this.__setAttr(t,e),this.__hasMotionPath=this.motionPath||!o(this.motion),this.__layout.matrixChanged||this.__layout.matrixChange()}}))}ue.add("motion-path"),_l.register("motion",function(t,e,i,s){return _(t)&&(t=nl.number(t,s.getMotionTotal())),_(e)&&(e=nl.number(e,s.getMotionTotal())),_l.number(t||0,e||0,i)}),_l.register("motionRotation",function(t,e,i){return _l.number(t,e,i)});const wf=Hl.prototype,{updateMatrix:xf,updateAllMatrix:bf}=_o,{updateBounds:Sf}=Bo;function kf(t){const{motion:e,leaferIsCreated:i}=t;if(!o(e)){if(i&&(t.leafer.created=!1),t.motionPath){const i=Pf(t);i.total&&(t.__.__pathForRender=mf.getDistancePath(i,e,t.motionPrecision))}else t.set(t.getMotionPoint(e)),t.__hasAutoLayout||(t.isBranch?(bf(t),Sf(t,t)):xf(t));i&&(t.leafer.created=!0)}}function Bf(t){const{parent:e}=t;if(!t.motionPath&&e){const{children:t}=e;for(let e=0;e<t.length;e++)if(t[e].motionPath)return t[e]}return t}function Pf(t){const e=t.__;return e.__pathForMotion?e.__pathForMotion:e.__pathForMotion=mf.getMotionPathData(t.getPath(!0,!0))}Hl.addAttr("motionPath",void 0,vf),Hl.addAttr("motionPrecision",1,vf),Hl.addAttr("motion",void 0,vf),Hl.addAttr("motionRotation",!0,vf),wf.getMotionPathData=function(){return Pf(Bf(this))},wf.getMotionPoint=function(t){const e=Bf(this),i=Pf(e);if(!i.total)return{};const s=mf.getDistancePoint(i,t,e.motionPrecision);Q.toOuterPoint(e.localTransform,s);const{motionRotation:n}=this;return!1===n?delete s.rotation:l(n)&&(s.rotation+=n),s},wf.getMotionTotal=function(){return this.getMotionPathData().total},wf.__updateMotionPath=function(){const t=this.__;if(this.__layout.resized&&t.__pathForMotion&&(t.__pathForMotion=void 0),this.motionPath){let t;const{children:e}=this.parent;for(let i=0;i<e.length;i++)t=e[i],o(t.motion)||t.__layout.matrixChanged||(t!==this&&t.__extraUpdate(),kf(t))}else kf(this)};const{Yes:Tf,NoAndSkip:Ef,YesAndSkip:Cf}=e,Rf={},Lf={},Of={};class Af{constructor(t,e){this.methods={id:(t,e)=>t.id===e?(this.target&&(this.idMap[e]=t),1):0,innerId:(t,e)=>t.innerId===e?(this.target&&(this.innerIdMap[e]=t),1):0,className:(t,e)=>t.className===e?1:0,tag:(t,e)=>t.__tag===e?1:0,tags:(t,e)=>e[t.__tag]?1:0},this.idMap={},this.innerIdMap={};const i=t&&t.app;i&&(i.idMap?this.idMap=i.idMap:i.idMap=this.idMap,i.innerIdMap?this.innerIdMap=i.innerIdMap:i.innerIdMap=this.innerIdMap),(this.target=t)&&this.__listenEvents()}getBy(t,e,i,s){switch(typeof t){case"number":const n=this.getByInnerId(t,e);return i?n:n?[n]:[];case"string":switch(t[0]){case"#":Rf.id=t.substring(1),t=Rf;break;case".":Lf.className=t.substring(1),t=Lf;break;default:Of.tag=t,t=Of}case"object":if(r(t.id)){if(t.tag){const{tag:s}=t,n=u(s);return this.getByMethod(n?this.methods.tags:this.methods.tag,e,i,n?f.toMap(s):s)}return this.getByMethod(this.methods.className,e,i,t.className)}{const s=this.getById(t.id,e);return i?s:s?[s]:[]}case"function":return this.getByMethod(t,e,i,s)}}getByInnerId(t,e){const i=this.innerIdMap[t];return i||(this.eachFind(this.toChildren(e),this.methods.innerId,null,t),this.findLeaf)}getById(t,e){const i=this.idMap[t];return i&&_o.hasParent(i,e||this.target)?i:(this.eachFind(this.toChildren(e),this.methods.id,null,t),this.findLeaf)}getByClassName(t,e){return this.getByMethod(this.methods.className,e,!1,t)}getByTag(t,e){return this.getByMethod(this.methods.tag,e,!1,t)}getByMethod(t,e,i,s){const n=i?null:[];return this.eachFind(this.toChildren(e),t,n,s),n||this.findLeaf}eachFind(t,e,i,s){let n,r;for(let o=0,a=t.length;o<a;o++){if(n=t[o],r=e(n,s),"boolean"==typeof r&&(r=r?1:0),r===Tf||r===Cf){if(!i)return void(this.findLeaf=n);i.push(n)}n.isBranch&&r<Ef&&this.eachFind(n.children,e,i,s)}}toChildren(t){return this.findLeaf=null,[t||this.target]}__onRemoveChild(t){const{id:e,innerId:i}=t.child;this.idMap[e]&&delete this.idMap[e],this.innerIdMap[i]&&delete this.innerIdMap[i]}__checkIdChange(t){if("id"===t.attrName){const e=t.oldValue;this.idMap[e]&&delete this.idMap[e]}}__listenEvents(){this.__eventIds=[this.target.on_(Uo.REMOVE,this.__onRemoveChild,this),this.target.on_(Ho.CHANGE,this.__checkIdChange,this)]}__removeListenEvents(){this.target.off_(this.__eventIds),this.__eventIds.length=0}destroy(){const{__eventIds:t}=this;t&&t.length&&(this.__removeListenEvents(),this.innerIdMap={},this.idMap={}),this.findLeaf=null}}const Df=Hl.prototype;function Mf(t){return t.leafer?t.leafer.selector:ie.selector||(ie.selector=_e.selector())}Df.find=function(t,e){return Mf(this).getBy(t,this,!1,e)},Df.findOne=function(t,e){return Mf(this).getBy(t,this,!0,e)},ue.add("find"),_e.finder=function(t,e){return new Af(t,e)},_o.cacheId=function(t){const{leafer:e,id:i}=t;i&&(e.app.idMap[i]=t),e.cacheInnerId&&(e.app.innerIdMap[t.innerId]=t)};export{Et as AlignHelper,Cg as Animate,Pg as AnimateEasing,Eg as AnimateEvent,Rg as AnimateList,e as Answer,Xd as App,Bt as AroundHelper,Jt as AutoBounds,di as BezierHelper,Kt as Bounds,Go as BoundsEvent,Ht as BoundsHelper,id as Box,Sl as BoxData,Bh as Branch,Bo as BranchHelper,Ua as BranchRender,Ad as Canvas,Fl as CanvasData,we as CanvasManager,Uo as ChildEvent,sl as ColorConvert,_e as Creator,Fc as Cursor,f as DataHelper,re as Debug,bt as Direction4,St as Direction9,nc as DragBoundsHelper,lc as DragEvent,Bc as Dragger,cc as DropEvent,ll as Effect,ad as Ellipse,El as EllipseData,vi as EllipseHelper,Xo as Event,me as EventCreator,ca as Eventer,cl as Export,$n as FileHelper,dl as Filter,Af as Finder,P as FourNumberHelper,sd as Frame,Bl as FrameData,Vl as Group,bl as GroupData,lf as HighBezierHelper,mf as HighCurveHelper,Ic as HitCanvasManager,Ld as Image,Ml as ImageData,qo as ImageEvent,nr as ImageManager,v as IncrementId,tu as Interaction,Mc as InteractionBase,vc as InteractionHelper,mc as KeyEvent,jd as Keyboard,ia as LayoutEvent,jh as Layouter,gh as Leaf,Na as LeafBounds,xo as LeafBoundsHelper,m as LeafData,ka as LeafDataProxy,ba as LeafEventer,_o as LeafHelper,Yo as LeafLayout,Th as LeafLevelList,Ph as LeafList,La as LeafMatrix,za as LeafRender,Kl as Leafer,Rh as LeaferCanvas,De as LeaferCanvasBase,kl as LeaferData,na as LeaferEvent,lr as LeaferFilm,hr as LeaferImage,dr as LeaferVideo,Rd as Line,Pl as LineData,I as MathHelper,mt as Matrix,Q as MatrixHelper,uc as MoveEvent,dc as MyDragEvent,Od as MyImage,ac as MyPointerEvent,pc as MyTouchEvent,Ne as NeedConvertToCanvasCommandMap,N as OneRadian,z as PI2,Y as PI_2,ol as Paint,hl as PaintGradient,al as PaintImage,zd as Path,rl as PathArrow,Wn as PathBounds,Ts as PathCommandDataHelper,Ie as PathCommandMap,wi as PathCommandNodeHelper,ns as PathConvert,Hn as PathCorner,js as PathCreator,Ll as PathData,on as PathDrawer,Me as PathHelper,t as PathNodeHandleType,Ue as PathNumberCommandLengthMap,Xe as PathNumberCommandMap,Yd as Pen,Ol as PenData,$h as Picker,ie as Platform,ue as Plugin,ft as Point,dt as PointHelper,Hd as PointerButton,oc as PointerEvent,gd as Polygon,Cl as PolygonData,Ho as PropertyEvent,$l as Rect,Tl as RectData,je as RectHelper,Ul as RectRender,sa as RenderEvent,Vh as Renderer,ta as ResizeEvent,ir as Resource,Ip as Robot,Fp as RobotData,gc as RotateEvent,le as Run,Jh as Selector,bd as Star,Rl as StarData,ul as State,Zt as StringNumberMap,fc as SwipeEvent,Zn as TaskItem,tr as TaskProcessor,Nd as Text,il as TextConvert,Dl as TextData,_c as TouchEvent,_l as Transition,wt as TwoPointBoundsHelper,Hl as UI,Nl as UIBounds,ge as UICreator,wl as UIData,Vd as UIEvent,Yl as UIRender,nl as UnitConvert,Qt as UnitConvertHelper,Lo as WaitHelper,ea as WatchEvent,Ah as Watcher,yc as ZoomEvent,Lr as affectRenderBoundsType,Er as affectStrokeBoundsType,gr as attr,wr as autoLayoutType,Sr as boundsType,Kn as canvasPatch,Ae as canvasSizeAttrs,el as createAttr,_r as createDescriptor,Xr as cursorType,Ur as dataProcessor,yr as dataType,pr as decorateLeafAttr,Hr as defineDataProcessor,cr as defineKey,fr as defineLeafAttr,Ar as dimType,Br as doBoundsType,Cr as doStrokeType,Qh as effectType,n as emptyData,zr as eraserType,Vo as extraPropertyEventMap,U as getBoundsData,ur as getDescriptor,j as getMatrixData,X as getPointData,Yr 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,r as isUndefined,jr as layoutProcessor,la as leaferTransformAttrMap,Nr as maskType,vf as motionPathType,kr as naturalBoundsType,Dr as opacityType,Vn as path,Pr as pathInputType,Tr as pathType,qn as pen,mr as positionType,Zr as registerUI,to as registerUIEvent,Zh as resizeType,Kr as rewrite,$r as rewriteAble,br as rotationType,xr as scaleType,vr as scrollType,Wr as sortType,Np as stateStyleType,Wp as stateType,Rr as strokeType,Or as surfaceType,$t as tempBounds,vt as tempMatrix,yt as tempPoint,c as tryToNumber,Lh as useCanvas,Qr as useModule,Eh as version,Mr as visibleType,tl as zoomLayerType};
2
2
  //# sourceMappingURL=web.module.min.js.map