treease-cli 1.0.0

Command-line interface for querying, transforming, and previewing structured documents with Treease
Documentation
1
var e;(function(e){e[e.No=0]=`No`,e[e.Yes=1]=`Yes`,e[e.NoAndSkip=2]=`NoAndSkip`,e[e.YesAndSkip=3]=`YesAndSkip`})(e||={});var t={};function n(e){return e===void 0}function r(e){return e==null}function i(e){return typeof e==`string`}var{isFinite:a}=Number;function o(e){return typeof e==`number`}var s=/^-?\d+(?:\.\d+)?$/;function c(e){return typeof e==`string`&&s.test(e)?+e:e}var{isArray:l}=Array;function u(e){return e&&typeof e==`object`}function d(e){return u(e)&&!l(e)}function f(e){return JSON.stringify(e)===`{}`}var p={default:(e,t)=>(m(t,e),m(e,t),e),assign(e,t,n){let r;Object.keys(t).forEach(i=>{if(r=t[i],r?.constructor===Object&&e[i]?.constructor===Object)return m(e[i],t[i],n&&n[i]);n&&i in n?n[i]?.constructor===Object&&m(e[i]={},t[i],n[i]):e[i]=t[i]})},copyAttrs:(e,t,r)=>(r.forEach(r=>{n(t[r])||(e[r]=t[r])}),e),clone:e=>JSON.parse(JSON.stringify(e)),toMap(e){let t={};for(let n=0,r=e.length;n<r;n++)t[e[n]]=!0;return t},stintSet(e,t,n){n||=void 0,e[t]!==n&&(e[t]=n)}},{assign:m}=p,h=class{get __useNaturalRatio(){return!0}get __isLinePath(){let{path:e}=this;return e&&e.length===6&&e[0]===1}get __usePathBox(){return this.__pathInputed}get __blendMode(){if(this.eraser&&this.eraser!==`path`)return`destination-out`;let{blendMode:e}=this;return e===`pass-through`?null:e}constructor(e){this.__leaf=e}__get(e){if(this.__input){let t=this.__input[e];if(!n(t))return t}return this[e]}__getData(){let e={tag:this.__leaf.tag},{__input:t}=this,r;for(let i in this)i[0]!==`_`&&(r=t?t[i]:void 0,e[i]=n(r)?this[i]:r);return e}__setInput(e,t){this.__input||={},this.__input[e]=t}__getInput(e){if(this.__input){let t=this.__input[e];if(!n(t))return t}if(e!==`path`||this.__pathInputed)return this[`_`+e]}__removeInput(e){this.__input&&!n(this.__input[e])&&(this.__input[e]=void 0)}__getInputData(e,t){let r={};if(e)if(l(e))for(let t of e)r[t]=this.__getInput(t);else for(let t in e)r[t]=this.__getInput(t);else{let e,t,{__input:i}=this;r.tag=this.__leaf.tag;for(let a in this)if(a[0]!==`_`&&(e=this[`_`+a],!n(e))){if(a===`path`&&!this.__pathInputed)continue;t=i?i[a]:void 0,r[a]=n(t)?e:t}}if(t&&t.matrix){let{a:e,b:t,c:n,d:i,e:a,f:o}=this.__leaf.__localMatrix;r.matrix={a:e,b:t,c:n,d:i,e:a,f:o}}return r}__setMiddle(e,t){this.__middle||={},this.__middle[e]=t}__getMiddle(e){return this.__middle&&this.__middle[e]}__checkSingle(){let e=this;if(e.blendMode===`pass-through`){let t=this.__leaf;e.opacity<1&&(t.isBranch||e.__hasMultiPaint)||t.__hasEraser||e.eraser||e.filter?e.__single=!0:e.__single&&=!1}else e.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null,this.__complexData&&this.__complexData.destroy()}},g={RUNTIME:`runtime`,LEAF:`leaf`,TASK:`task`,CNAVAS:`canvas`,IMAGE:`image`,types:{},create(e){let{types:t}=_;return t[e]?t[e]++:(t[e]=1,0)}},_=g,v,y,b,{max:x}=Math,S=[0,0,0,0],C={zero:[...S],tempFour:S,set:(e,t,n,r,i)=>(n===void 0&&(n=r=i=t),e[0]=t,e[1]=n,e[2]=r,e[3]=i,e),setTemp:(e,t,n,r)=>w(S,e,t,n,r),toTempAB(e,t,n){b=n?o(e)?t:e:[],o(e)?(v=te(e),y=t):o(t)?(v=e,y=te(t)):(v=e,y=t),v.length!==4&&(v=ee(v)),y.length!==4&&(y=ee(y))},get(e,t){let r;if(!o(e))switch(e.length){case 4:r=n(t)?e:[...e];break;case 2:r=[e[0],e[1],e[0],e[1]];break;case 3:r=[e[0],e[1],e[2],e[1]];break;case 1:e=e[0];break;default:e=0}if(r||=[e,e,e,e],!n(t))for(let e=0;e<4;e++)r[e]>t&&(r[e]=t);return r},max:(e,t,n)=>o(e)&&o(t)?x(e,t):(ne(e,t,n),w(b,x(v[0],y[0]),x(v[1],y[1]),x(v[2],y[2]),x(v[3],y[3]))),add:(e,t,n)=>o(e)&&o(t)?e+t:(ne(e,t,n),w(b,v[0]+y[0],v[1]+y[1],v[2]+y[2],v[3]+y[3])),swapAndScale(e,t,n,r){if(o(e))return t===n?e*t:[e*n,e*t];let i=r?e:[],[a,s,c,l]=e.length===4?e:ee(e);return w(i,c*n,l*t,a*n,s*t)}},{set:w,get:ee,setTemp:te,toTempAB:ne}=C,{round:re,pow:ie,max:ae,floor:oe,PI:se}=Math,ce={},T={within:(e,t,r)=>(u(t)&&(r=t.max,t=t.min),!n(t)&&e<t&&(e=t),!n(r)&&e>r&&(e=r),e),fourNumber:C.get,formatRotation:(e,t)=>(e%=360,t?e<0&&(e+=360):(e>180&&(e-=360),e<-180&&(e+=360)),T.float(e)),getGapRotation(e,t,n=0){let r=e+n;if(t>1){let e=Math.abs(r%t);(e<1||e>t-1)&&(r=Math.round(r/t)*t)}return r-n},float(e,t){let r=n(t)?0xe8d4a51000:ie(10,t);return(e=re(e*r)/r)===-0?0:e},sign:e=>e<0?-1:1,getScaleData(e,t,n,r){if(r||={},t){let e=(o(t)?t:t.width||0)/n.width,i=(o(t)?t:t.height||0)/n.height;r.scaleX=e||i||1,r.scaleY=i||e||1}else e&&T.assignScale(r,e);return r},getScaleFixedData(e,t,n,r,i){let{scaleX:a,scaleY:s}=e;if((r||t)&&(a<0&&(a=-a),s<0&&(s=-s)),t)if(!0===t)a=s=n?1:1/a;else{let e;o(t)?e=t:t===`zoom-in`&&(e=1),e&&(a=s=a>e||s>e?n?1:1/a:n?1:1/e)}return ce.scaleX=a,ce.scaleY=s,ce},assignScale(e,t){o(t)?e.scaleX=e.scaleY=t:(e.scaleX=t.x,e.scaleY=t.y)},getFloorScale:(e,t=1)=>ae(oe(e),t)/e,randInt:le,randColor:e=>`rgba(${le(255)},${le(255)},${le(255)},${e||1})`};function le(e){return Math.round(Math.random()*e)}var E=se/180,ue=2*se,de=se/2;function fe(){return{x:0,y:0}}function pe(){return{x:0,y:0,width:0,height:0}}function me(){return{a:1,b:0,c:0,d:1,e:0,f:0}}var{sin:he,cos:ge,acos:_e,sqrt:ve}=Math,{float:ye}=T,be={};function xe(){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})}var D={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:xe(),tempMatrix:{},set(e,t=1,n=0,r=0,i=1,a=0,o=0){e.a=t,e.b=n,e.c=r,e.d=i,e.e=a,e.f=o},get:me,getWorld:xe,copy(e,t){e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f},translate(e,t,n){e.e+=t,e.f+=n},translateInner(e,t,n,r){e.e+=e.a*t+e.c*n,e.f+=e.b*t+e.d*n,r&&(e.e-=t,e.f-=n)},scale(e,t,n=t){e.a*=t,e.b*=t,e.c*=n,e.d*=n},pixelScale(e,t,n){n||=e,n.a=e.a*t,n.b=e.b*t,n.c=e.c*t,n.d=e.d*t,n.e=e.e*t,n.f=e.f*t},scaleOfOuter(e,t,n,r){O.toInnerPoint(e,t,be),O.scaleOfInner(e,be,n,r)},scaleOfInner(e,t,n,r=n){O.translateInner(e,t.x,t.y),O.scale(e,n,r),O.translateInner(e,-t.x,-t.y)},rotate(e,t){let{a:n,b:r,c:i,d:a}=e,o=ge(t*=E),s=he(t);e.a=n*o-r*s,e.b=n*s+r*o,e.c=i*o-a*s,e.d=i*s+a*o},rotateOfOuter(e,t,n){O.toInnerPoint(e,t,be),O.rotateOfInner(e,be,n)},rotateOfInner(e,t,n){O.translateInner(e,t.x,t.y),O.rotate(e,n),O.translateInner(e,-t.x,-t.y)},skew(e,t,n){let{a:r,b:i,c:a,d:o}=e;n&&(n*=E,e.a=r+a*n,e.b=i+o*n),t&&(t*=E,e.c=a+r*t,e.d=o+i*t)},skewOfOuter(e,t,n,r){O.toInnerPoint(e,t,be),O.skewOfInner(e,be,n,r)},skewOfInner(e,t,n,r=0){O.translateInner(e,t.x,t.y),O.skew(e,n,r),O.translateInner(e,-t.x,-t.y)},multiply(e,t){let{a:n,b:r,c:i,d:a,e:o,f:s}=e;e.a=t.a*n+t.b*i,e.b=t.a*r+t.b*a,e.c=t.c*n+t.d*i,e.d=t.c*r+t.d*a,e.e=t.e*n+t.f*i+o,e.f=t.e*r+t.f*a+s},multiplyParent(e,t,r,i,a){let{e:o,f:s}=e;if(r||=e,n(i)&&(i=e.a!==1||e.b||e.c||e.d!==1),i){let{a:n,b:i,c:o,d:s}=e;r.a=n*t.a+i*t.c,r.b=n*t.b+i*t.d,r.c=o*t.a+s*t.c,r.d=o*t.b+s*t.d,a&&(r.scaleX=t.scaleX*a.scaleX,r.scaleY=t.scaleY*a.scaleY)}else r.a=t.a,r.b=t.b,r.c=t.c,r.d=t.d,a&&(r.scaleX=t.scaleX,r.scaleY=t.scaleY);r.e=o*t.a+s*t.c+t.e,r.f=o*t.b+s*t.d+t.f},divide(e,t){O.multiply(e,O.tempInvert(t))},divideParent(e,t){O.multiplyParent(e,O.tempInvert(t))},tempInvert(e){let{tempMatrix:t}=O;return O.copy(t,e),O.invert(t),t},invert(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e;if(n||r){let s=1/(t*i-n*r);e.a=i*s,e.b=-n*s,e.c=-r*s,e.d=t*s,e.e=-(a*i-o*r)*s,e.f=-(o*t-a*n)*s}else if(t===1&&i===1)e.e=-a,e.f=-o;else{let n=1/(t*i);e.a=i*n,e.d=t*n,e.e=-a*i*n,e.f=-o*t*n}},toOuterPoint(e,t,n,r){let{x:i,y:a}=t;n||=t,n.x=i*e.a+a*e.c,n.y=i*e.b+a*e.d,r||(n.x+=e.e,n.y+=e.f)},toInnerPoint(e,t,n,r){let{a:i,b:a,c:o,d:s}=e,c=1/(i*s-a*o),{x:l,y:u}=t;if(n||=t,n.x=(l*s-u*o)*c,n.y=(u*i-l*a)*c,!r){let{e:t,f:r}=e;n.x-=(t*s-r*o)*c,n.y-=(r*i-t*a)*c}},setLayout(e,t,r,i,a){let{x:o,y:s,scaleX:c,scaleY:l}=t;if(n(a)&&(a=t.rotation||t.skewX||t.skewY),a){let{rotation:n,skewX:r,skewY:i}=t,a=n*E,o=ge(a),s=he(a);if(r||i){let t=r*E,n=i*E;e.a=(o+n*-s)*c,e.b=(s+n*o)*c,e.c=(t*o-s)*l,e.d=(o+t*s)*l}else e.a=o*c,e.b=s*c,e.c=-s*l,e.d=o*l}else e.a=c,e.b=0,e.c=0,e.d=l;e.e=o,e.f=s,(r||=i)&&O.translateInner(e,-r.x,-r.y,!i)},getLayout(e,t,n,r){let{a:i,b:a,c:o,d:s,e:c,f:l}=e,u,d,f,p,m,h=c,g=l;if(a||o){let e=i*s-a*o;if(o&&!r){u=ve(i*i+a*a),d=e/u;let t=i/u;f=a>0?_e(t):-_e(t)}else{d=ve(o*o+s*s),u=e/d;let t=o/d;f=de-(s>0?_e(-t):-_e(t))}let t=ye(ge(f)),n=he(f);u=ye(u),d=ye(d),p=t?ye((o/d+n)/t/E,9):0,m=t?ye((a/u-n)/t/E,9):0,f=ye(f/E)}else u=i,d=s,f=p=m=0;return(t=n||t)&&(h+=t.x*i+t.y*o,g+=t.x*a+t.y*s,n||(h-=t.x,g-=t.y)),{x:h,y:g,scaleX:u,scaleY:d,rotation:f,skewX:p,skewY:m}},withScale(e,t,n=t){let r=e;if(!t||!n){let{a:r,b:i,c:a,d:o}=e;i||a?n=(r*o-i*a)/(t=ve(r*r+i*i)):(t=r,n=o)}return r.scaleX=t,r.scaleY=n,r},reset(e){O.set(e)}},O=D,{float:Se}=T,{toInnerPoint:Ce,toOuterPoint:we}=D,{sin:Te,cos:Ee,abs:De,sqrt:Oe,atan2:ke,min:Ae,round:je}=Math,k={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(e,t=0,n=0){e.x=t,e.y=n},setRadius(e,t,r){e.radiusX=t,e.radiusY=n(r)?t:r},copy(e,t){e.x=t.x,e.y=t.y},copyFrom(e,t,n){e.x=t,e.y=n},round(e,t){e.x=t?je(e.x-.5)+.5:je(e.x),e.y=t?je(e.y-.5)+.5:je(e.y)},move(e,t,n){u(t)?(e.x+=t.x,e.y+=t.y):(e.x+=t,e.y+=n)},scale(e,t,n=t){e.x&&(e.x*=t),e.y&&(e.y*=n)},scaleOf(e,t,n,r=n){e.x+=(e.x-t.x)*(n-1),e.y+=(e.y-t.y)*(r-1)},rotate(e,t,n){n||=Me.defaultPoint;let r=Ee(t*=E),i=Te(t),a=e.x-n.x,o=e.y-n.y;e.x=n.x+a*r-o*i,e.y=n.y+a*i+o*r},tempToInnerOf(e,t){let{tempPoint:n}=Me;return Pe(n,e),Ce(t,n,n),n},tempToOuterOf(e,t){let{tempPoint:n}=Me;return Pe(n,e),we(t,n,n),n},tempToInnerRadiusPointOf(e,t){let{tempRadiusPoint:n}=Me;return Pe(n,e),Me.toInnerRadiusPointOf(e,t,n),n},copyRadiusPoint:(e,t,n,r)=>(Pe(e,t),Fe(e,n,r),e),toInnerRadiusPointOf(e,t,n){n||=e,Ce(t,e,n),n.radiusX=Math.abs(e.radiusX/t.scaleX),n.radiusY=Math.abs(e.radiusY/t.scaleY)},toInnerOf(e,t,n){Ce(t,e,n)},toOuterOf(e,t,n){we(t,e,n)},getCenter:(e,t)=>({x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}),getCenterX:(e,t)=>e+(t-e)/2,getCenterY:(e,t)=>e+(t-e)/2,getDistance:(e,t)=>Ne(e.x,e.y,t.x,t.y),getDistanceFrom(e,t,n,r){let i=De(n-e),a=De(r-t);return Oe(i*i+a*a)},getMinDistanceFrom:(e,t,n,r,i,a)=>Ae(Ne(e,t,n,r),Ne(n,r,i,a)),getAngle:(e,t)=>Ie(e,t)/E,getRotation:(e,t,n,r)=>(r||=t,Me.getRadianFrom(e.x,e.y,t.x,t.y,n.x,n.y,r.x,r.y)/E),getRadianFrom(e,t,r,i,a,o,s,c){n(s)&&(s=r,c=i);let l=e-r,u=t-i,d=a-s,f=o-c;return Math.atan2(l*f-u*d,l*d+u*f)},getAtan2:(e,t)=>ke(t.y-e.y,t.x-e.x),getDistancePoint(e,t,n,r,i){let a=Ie(e,t);return i&&(e=t),r||(t={}),t.x=e.x+Ee(a)*n,t.y=e.y+Te(a)*n,t},toNumberPoints(e){let t=e;return u(e[0])&&(t=[],e.forEach(e=>t.push(e.x,e.y))),t},isSame:(e,t,n)=>n?e.x===t.x&&e.y===t.y:Se(e.x)===Se(t.x)&&Se(e.y)===Se(t.y),reset(e){Me.reset(e)}},Me=k,{getDistanceFrom:Ne,copy:Pe,setRadius:Fe,getAtan2:Ie}=Me,Le=class e{constructor(e,t){this.set(e,t)}set(e,t){return u(e)?k.copy(this,e):k.set(this,e,t),this}get(){let{x:e,y:t}=this;return{x:e,y:t}}clone(){return new e(this)}move(e,t){return k.move(this,e,t),this}scale(e,t){return k.scale(this,e,t),this}scaleOf(e,t,n){return k.scaleOf(this,e,t,n),this}rotate(e,t){return k.rotate(this,e,t),this}rotateOf(e,t){return k.rotate(this,t,e),this}getRotation(e,t,n){return k.getRotation(this,e,t,n)}toInnerOf(e,t){return k.toInnerOf(this,e,t),this}toOuterOf(e,t){return k.toOuterOf(this,e,t),this}getCenter(t){return new e(k.getCenter(this,t))}getDistance(e){return k.getDistance(this,e)}getDistancePoint(t,n,r,i){return new e(k.getDistancePoint(this,t,n,r,i))}getAngle(e){return k.getAngle(this,e)}getAtan2(e){return k.getAtan2(this,e)}isSame(e,t){return k.isSame(this,e,t)}reset(){return k.reset(this),this}},Re=new Le,ze=class e{constructor(e,t,n,r,i,a){this.set(e,t,n,r,i,a)}set(e,t,n,r,i,a){return u(e)?D.copy(this,e):D.set(this,e,t,n,r,i,a),this}setWith(e){return D.copy(this,e),this.scaleX=e.scaleX,this.scaleY=e.scaleY,this}get(){let{a:e,b:t,c:n,d:r,e:i,f:a}=this;return{a:e,b:t,c:n,d:r,e:i,f:a}}clone(){return new e(this)}translate(e,t){return D.translate(this,e,t),this}translateInner(e,t){return D.translateInner(this,e,t),this}scale(e,t){return D.scale(this,e,t),this}scaleWith(e,t){return D.scale(this,e,t),this.scaleX*=e,this.scaleY*=t||e,this}pixelScale(e){return D.pixelScale(this,e),this}scaleOfOuter(e,t,n){return D.scaleOfOuter(this,e,t,n),this}scaleOfInner(e,t,n){return D.scaleOfInner(this,e,t,n),this}rotate(e){return D.rotate(this,e),this}rotateOfOuter(e,t){return D.rotateOfOuter(this,e,t),this}rotateOfInner(e,t){return D.rotateOfInner(this,e,t),this}skew(e,t){return D.skew(this,e,t),this}skewOfOuter(e,t,n){return D.skewOfOuter(this,e,t,n),this}skewOfInner(e,t,n){return D.skewOfInner(this,e,t,n),this}multiply(e){return D.multiply(this,e),this}multiplyParent(e){return D.multiplyParent(this,e),this}divide(e){return D.divide(this,e),this}divideParent(e){return D.divideParent(this,e),this}invert(){return D.invert(this),this}invertWith(){return D.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(e,t,n){D.toOuterPoint(this,e,t,n)}toInnerPoint(e,t,n){D.toInnerPoint(this,e,t,n)}setLayout(e,t,n){return D.setLayout(this,e,t,n),this}getLayout(e,t,n){return D.getLayout(this,e,t,n)}withScale(e,t){return D.withScale(this,e,t)}reset(){D.reset(this)}},Be=new ze,Ve={tempPointBounds:{},setPoint(e,t,n){e.minX=e.maxX=t,e.minY=e.maxY=n},addPoint(e,t,n){e.minX=t<e.minX?t:e.minX,e.minY=n<e.minY?n:e.minY,e.maxX=t>e.maxX?t:e.maxX,e.maxY=n>e.maxY?n:e.maxY},addBounds(e,t,n,r,i){He(e,t,n),He(e,t+r,n+i)},copy(e,t){e.minX=t.minX,e.minY=t.minY,e.maxX=t.maxX,e.maxY=t.maxY},addPointBounds(e,t){e.minX=t.minX<e.minX?t.minX:e.minX,e.minY=t.minY<e.minY?t.minY:e.minY,e.maxX=t.maxX>e.maxX?t.maxX:e.maxX,e.maxY=t.maxY>e.maxY?t.maxY:e.maxY},toBounds(e,t){t.x=e.minX,t.y=e.minY,t.width=e.maxX-e.minX,t.height=e.maxY-e.minY}},{addPoint:He}=Ve,Ue,We;(function(e){e[e.top=0]=`top`,e[e.right=1]=`right`,e[e.bottom=2]=`bottom`,e[e.left=3]=`left`})(Ue||={}),function(e){e[e.topLeft=0]=`topLeft`,e[e.top=1]=`top`,e[e.topRight=2]=`topRight`,e[e.right=3]=`right`,e[e.bottomRight=4]=`bottomRight`,e[e.bottom=5]=`bottom`,e[e.bottomLeft=6]=`bottomLeft`,e[e.left=7]=`left`,e[e.center=8]=`center`,e[e[`top-left`]=0]=`top-left`,e[e[`top-right`]=2]=`top-right`,e[e[`bottom-right`]=4]=`bottom-right`,e[e[`bottom-left`]=6]=`bottom-left`}(We||={});var Ge=[{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}];Ge.forEach(e=>e.type=`percent`);var Ke={directionData:Ge,tempPoint:{},get:qe,toPoint(e,t,n,r,i,a){let o=qe(e);n.x=o.x,n.y=o.y,o.type===`percent`&&(n.x*=t.width,n.y*=t.height,i&&(a||(n.x-=i.x,n.y-=i.y),o.x&&(n.x-=o.x===1?i.width:o.x===.5?o.x*i.width:0),o.y&&(n.y-=o.y===1?i.height:o.y===.5?o.y*i.height:0))),r||(n.x+=t.x,n.y+=t.y)},getPoint:(e,t,n,r=!0)=>(n||={},Ke.toPoint(e,t,n,r),n)};function qe(e){return i(e)?Ge[We[e]]:e}var{toPoint:Je}=Ke,Ye={toPoint(e,t,n,r,i,a){Je(e,n,r,i,t,a)}},{tempPointBounds:Xe,setPoint:Ze,addPoint:Qe,toBounds:$e}=Ve,{toOuterPoint:et}=D,{float:tt,fourNumber:nt}=T,{floor:rt,ceil:it}=Math,at,ot,st,ct,lt={},ut={},dt={},A={tempBounds:dt,set(e,t=0,n=0,r=0,i=0){e.x=t,e.y=n,e.width=r,e.height=i},copy(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},copyAndSpread(e,t,n,r,i){let{x:a,y:o,width:s,height:c}=t;if(l(n)){let t=nt(n);r?j.set(e,a+t[3],o+t[0],s-t[1]-t[3],c-t[2]-t[0]):j.set(e,a-t[3],o-t[0],s+t[1]+t[3],c+t[2]+t[0])}else r&&(n=-n),j.set(e,a-n,o-n,s+2*n,c+2*n);i&&(i===`width`?(e.y=o,e.height=c):(e.x=a,e.width=s))},minX:e=>e.width>0?e.x:e.x+e.width,minY:e=>e.height>0?e.y:e.y+e.height,maxX:e=>e.width>0?e.x+e.width:e.x,maxY:e=>e.height>0?e.y+e.height:e.y,move(e,t,n){e.x+=t,e.y+=n},scroll(e,t){e.x+=t.scrollX,e.y+=t.scrollY},getByMove:(e,t,n)=>(e=Object.assign({},e),j.move(e,t,n),e),toOffsetOutBounds(e,t,n){t?pt(t,e):t=e,n||=e,t.offsetX=j.maxX(n),t.offsetY=j.maxY(n),j.move(t,-t.offsetX,-t.offsetY)},scale(e,t,n=t,r){r||k.scale(e,t,n),e.width*=t,e.height*=n},scaleOf(e,t,n,r=n){k.scaleOf(e,t,n,r),e.width*=n,e.height*=r},tempToOuterOf:(e,t)=>(j.copy(dt,e),j.toOuterOf(dt,t),dt),getOuterOf:(e,t)=>(e=Object.assign({},e),j.toOuterOf(e,t),e),toOuterOf(e,t,n){if(n||=e,t.b===0&&t.c===0){let{a:r,d:i,e:a,f:o}=t;r>0?(n.width=e.width*r,n.x=a+e.x*r):(n.width=e.width*-r,n.x=a+e.x*r-n.width),i>0?(n.height=e.height*i,n.y=o+e.y*i):(n.height=e.height*-i,n.y=o+e.y*i-n.height)}else lt.x=e.x,lt.y=e.y,et(t,lt,ut),Ze(Xe,ut.x,ut.y),lt.x=e.x+e.width,et(t,lt,ut),Qe(Xe,ut.x,ut.y),lt.y=e.y+e.height,et(t,lt,ut),Qe(Xe,ut.x,ut.y),lt.x=e.x,et(t,lt,ut),Qe(Xe,ut.x,ut.y),$e(Xe,n)},toInnerOf(e,t,n){n||=e,j.move(n,-t.e,-t.f),j.scale(n,1/t.a,1/t.d)},getFitMatrix(e,t,n=1){let r=Math.min(n,j.getFitScale(e,t));return new ze(r,0,0,r,-t.x*r,-t.y*r)},getFitScale(e,t,n){let r=e.width/t.width,i=e.height/t.height;return n?Math.max(r,i):Math.min(r,i)},put(e,t,n=`center`,r=1,a=!0,o){o||=t,i(r)&&(r=j.getFitScale(e,t,r===`cover`)),dt.width=a?t.width*=r:t.width*r,dt.height=a?t.height*=r:t.height*r,Ye.toPoint(n,dt,e,o,!0,!0)},getSpread(e,t,n){let r={};return j.copyAndSpread(r,e,t,!1,n),r},spread(e,t,n){j.copyAndSpread(e,e,t,!1,n)},shrink(e,t,n){j.copyAndSpread(e,e,t,!0,n)},ceil(e){let{x:t,y:n}=e;e.x=rt(e.x),e.y=rt(e.y),e.width=t>e.x?it(e.width+t-e.x):it(e.width),e.height=n>e.y?it(e.height+n-e.y):it(e.height)},unsign(e){e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height)},float(e,t){e.x=tt(e.x,t),e.y=tt(e.y,t),e.width=tt(e.width,t),e.height=tt(e.height,t)},add(e,t,n){at=e.x+e.width,ot=e.y+e.height,st=t.x,ct=t.y,n||(st+=t.width,ct+=t.height),at=at>st?at:st,ot=ot>ct?ot:ct,e.x=e.x<t.x?e.x:t.x,e.y=e.y<t.y?e.y:t.y,e.width=at-e.x,e.height=ot-e.y},addList(e,t){j.setListWithFn(e,t,void 0,!0)},setList(e,t,n=!1){j.setListWithFn(e,t,void 0,n)},addListWithFn(e,t,n){j.setListWithFn(e,t,n,!0)},setListWithFn(e,t,n,r=!1){let i,a=!0;for(let o=0,s=t.length;o<s;o++)i=n?n(t[o],o):t[o],i&&(i.width||i.height)&&(a?(a=!1,r||pt(e,i)):ft(e,i));a&&j.reset(e)},setPoints(e,t){t.forEach((e,t)=>t===0?Ze(Xe,e.x,e.y):Qe(Xe,e.x,e.y)),$e(Xe,e)},setPoint(e,t){j.set(e,t.x,t.y)},addPoint(e,t){ft(e,t,!0)},getPoints(e){let{x:t,y:n,width:r,height:i}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+i},{x:t,y:n+i}]},getPoint:(e,t,n=!1,r)=>Ke.getPoint(t,e,r,n),hitRadiusPoint:(e,t,n)=>(n&&(t=k.tempToInnerRadiusPointOf(t,n)),t.x>=e.x-t.radiusX&&t.x<=e.x+e.width+t.radiusX&&t.y>=e.y-t.radiusY&&t.y<=e.y+e.height+t.radiusY),hitPoint:(e,t,n)=>(n&&(t=k.tempToInnerOf(t,n)),t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height),hit:(e,t,n)=>(n&&(t=j.tempToOuterOf(t,n)),!(e.y+e.height<t.y||t.y+t.height<e.y||e.x+e.width<t.x||t.x+t.width<e.x)),includes:(e,t,n)=>(n&&(t=j.tempToOuterOf(t,n)),e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height),getIntersectData(e,t,n){if(n&&(t=j.tempToOuterOf(t,n)),!j.hit(e,t))return{x:0,y:0,width:0,height:0};let{x:r,y:i,width:a,height:o}=t;return at=r+a,ot=i+o,st=e.x+e.width,ct=e.y+e.height,r=r>e.x?r:e.x,i=i>e.y?i:e.y,at=at<st?at:st,ot=ot<ct?ot:ct,a=at-r,o=ot-i,{x:r,y:i,width:a,height:o}},intersect(e,t,n){j.copy(e,j.getIntersectData(e,t,n))},isSame:(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,isEmpty:e=>e.x===0&&e.y===0&&e.width===0&&e.height===0,hasSize:e=>e.width&&e.height,reset(e){j.set(e)}},j=A,{add:ft,copy:pt}=j,mt=class e{get minX(){return A.minX(this)}get minY(){return A.minY(this)}get maxX(){return A.maxX(this)}get maxY(){return A.maxY(this)}constructor(e,t,n,r){this.set(e,t,n,r)}set(e,t,n,r){return u(e)?A.copy(this,e):A.set(this,e,t,n,r),this}get(){let{x:e,y:t,width:n,height:r}=this;return{x:e,y:t,width:n,height:r}}clone(){return new e(this)}move(e,t){return A.move(this,e,t),this}scale(e,t,n){return A.scale(this,e,t,n),this}scaleOf(e,t,n){return A.scaleOf(this,e,t,n),this}toOuterOf(e,t){return A.toOuterOf(this,e,t),this}toInnerOf(e,t){return A.toInnerOf(this,e,t),this}getFitMatrix(e,t){return A.getFitMatrix(this,e,t)}put(e,t,n){A.put(this,e,t,n)}spread(e,t){return A.spread(this,e,t),this}shrink(e,t){return A.shrink(this,e,t),this}ceil(){return A.ceil(this),this}unsign(){return A.unsign(this),this}float(e){return A.float(this,e),this}add(e){return A.add(this,e),this}addList(e){return A.setList(this,e,!0),this}setList(e){return A.setList(this,e),this}addListWithFn(e,t){return A.setListWithFn(this,e,t,!0),this}setListWithFn(e,t){return A.setListWithFn(this,e,t),this}setPoint(e){return A.setPoint(this,e),this}setPoints(e){return A.setPoints(this,e),this}addPoint(e){return A.addPoint(this,e),this}getPoints(){return A.getPoints(this)}getPoint(e,t,n){return A.getPoint(this,e,t,n)}hitPoint(e,t){return A.hitPoint(this,e,t)}hitRadiusPoint(e,t){return A.hitRadiusPoint(this,e,t)}hit(e,t){return A.hit(this,e,t)}includes(e,t){return A.includes(this,e,t)}intersect(e,t){return A.intersect(this,e,t),this}getIntersect(t,n){return new e(A.getIntersectData(this,t,n))}isSame(e){return A.isSame(this,e)}isEmpty(){return A.isEmpty(this)}reset(){A.reset(this)}},ht=new mt,gt=class{constructor(e,t,n,r,i,a){u(e)?this.copy(e):this.set(e,t,n,r,i,a)}set(e=0,t=0,n=0,r=0,i=0,a=0){this.top=e,this.right=t,this.bottom=n,this.left=r,this.width=i,this.height=a}copy(e){let{top:t,right:n,bottom:r,left:i,width:a,height:o}=e;this.set(t,n,r,i,a,o)}getBoundsFrom(e){let{top:t,right:n,bottom:r,left:i,width:a,height:o}=this;return new mt(i,t,a||e.width-i-n,o||e.height-t-r)}},_t={number:(e,t)=>u(e)?e.type===`percent`?e.value*t:e.value:e},vt={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:yt,max:bt}=Math,M={toURL(e,t){let n=encodeURIComponent(e);return t===`text`?n=`data:text/plain;charset=utf-8,`+n:t===`svg`&&(n=`data:image/svg+xml,`+n),n},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:`anonymous`,isLarge:(e,t,n,r)=>e.width*e.height*(t?t*n:1)>(r||xt.maxCacheSize),isSuperLarge:(e,t,n)=>xt.isLarge(e,t,n,xt.maxPatternSize),getRealURL(e){let{prefix:t,suffix:n}=xt;return!n||e.startsWith(`data:`)||e.startsWith(`blob:`)||(e+=(e.includes(`?`)?`&`:`?`)+n),t&&e[0]===`/`&&(e=t+e),e},resize(e,t,n,r,i,a,o,s,c,l){let u=bt(yt(t+(r||0)),1),d=bt(yt(n+(i||0)),1),f,p,m;l&&(m=_t.number(l.offset,l.type===`x`?t:n))&&(l.type===`x`?f=!0:p=!0);let h=M.origin.createCanvas(p?2*u:u,f?2*d:d),g=h.getContext(`2d`);if(s&&(g.globalAlpha=s),g.imageSmoothingEnabled=!1!==o,xt.canUse(e)){if(a){let r=t/a.width,i=n/a.height;g.setTransform(r,0,0,i,-a.x*r,-a.y*i),g.drawImage(e,0,0,e.width,e.height)}else g.drawImage(e,0,0,t,n);m&&(g.drawImage(h,0,0,u,d,f?m-u:u,f?d:m-d,u,d),g.drawImage(h,0,0,u,d,f?m:u,f?d:m,u,d))}return h},canUse:e=>e&&e.width&&!e.__closed,setPatternTransform(e,t,n){try{t&&e.setTransform&&(e.setTransform(t),t=void 0)}catch{}n&&p.stintSet(n,`transform`,t)}}},{image:xt}=M,{randColor:St}=T,N=class e{constructor(e){this.repeatMap={},this.name=e}static get(t){return new e(t)}static set filter(e){this.filterList=Ct(e)}static set exclude(e){this.excludeList=Ct(e)}static drawRepaint(e,t){let n=St();e.fillWorld(t,n.replace(`1)`,`.1)`)),e.strokeWorld(t,n)}static drawBounds(t,n,r){let i=e.showBounds===`hit`,a=t.__nowWorld,o=St();i&&(n.setWorld(a),t.__drawHitPath(n),n.fillStyle=o.replace(`1)`,`.2)`),n.fill()),n.resetTransform(),n.setStroke(o,2),i?n.stroke():n.strokeWorld(a,o)}log(...e){if(wt.enable){if(wt.filterList.length&&wt.filterList.every(e=>e!==this.name)||wt.excludeList.length&&wt.excludeList.some(e=>e===this.name))return;console.log(`%c`+this.name,`color:#21ae62`,...e)}}tip(...e){wt.enable&&this.warn(...e)}warn(...e){wt.showWarn&&console.warn(this.name,...e)}repeat(e,...t){this.repeatMap[e]||(this.warn(`repeat:`+e,...t),this.repeatMap[e]=!0)}error(...e){try{throw Error()}catch(t){console.error(this.name,...e,t)}}};function Ct(e){return e?i(e)&&(e=[e]):e=[],e}N.filterList=[],N.excludeList=[],N.showWarn=!0;var wt=N,Tt=N.get(`RunTime`),Et={currentId:0,currentName:``,idMap:{},nameMap:{},nameToIdMap:{},start(e,t){let n=g.create(g.RUNTIME);return Dt.currentId=Dt.idMap[n]=t?performance.now():Date.now(),Dt.currentName=Dt.nameMap[n]=e,Dt.nameToIdMap[e]=n,n},end(e,t){let n=Dt.idMap[e],r=Dt.nameMap[e],i=t?(performance.now()-n)/1e3:Date.now()-n;Dt.idMap[e]=Dt.nameMap[e]=Dt.nameToIdMap[r]=void 0,Tt.log(r,i,`ms`)},endOfName(e,t){let r=Dt.nameToIdMap[e];n(r)||Dt.end(r,t)}},Dt=Et,Ot=[],kt={list:{},add(e,...t){this.list[e]=!0,Ot.push(...t)},has(e,t){let n=this.list[e];return!n&&t&&this.need(e),n},need(e){console.error(`please install and import plugin: `+(e.includes(`-x`)?``:`@leafer-in/`)+e)}};setTimeout(()=>Ot.forEach(e=>kt.has(e,!0)));var At={editor:e=>kt.need(`editor`)},jt=N.get(`UICreator`),Mt={list:{},register(e){let{__tag:t}=e.prototype;Nt[t]&&jt.repeat(t),Nt[t]=e},get(e,t,r,i,a,o){if(!Nt[e])return void jt.warn(`not register `+e);let s=new Nt[e](t);return n(r)||(s.x=r,i&&(s.y=i),a&&(s.width=a),o&&(s.height=o)),s}},{list:Nt}=Mt,Pt=N.get(`EventCreator`),Ft={nameList:{},register(e){let t;Object.keys(e).forEach(n=>{t=e[n],i(t)&&(It[t]&&Pt.repeat(t),It[t]=e)})},changeName(e,t){let n=It[e];if(n){let r=Object.keys(n).find(t=>n[t]===e);r&&(n[r]=t,It[t]=n)}},has(e){return!!this.nameList[e]},get:(e,...t)=>new It[e](...t)},{nameList:It}=Ft,Lt=class{constructor(){this.list=[]}add(e){e.manager=this,this.list.push(e)}get(e){let t,{list:n}=this;for(let r=0,i=n.length;r<i;r++)if(t=n[r],t.recycled&&t.isSameSize(e))return t.recycled=!1,t.manager||=this,t;let r=At.canvas(e);return this.add(r),r}recycle(e){e.recycled=!0}clearRecycled(){let e,t=[];for(let n=0,r=this.list.length;n<r;n++)e=this.list[n],e.recycled?e.destroy():t.push(e);this.list=t}clear(){this.list.forEach(e=>{e.destroy()}),this.list.length=0}destroy(){this.clear()}};function P(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o}function Rt(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})}function F(e){return(t,n)=>{e||=n;let r={get(){return this.context[e]},set(t){this.context[e]=t}};n===`strokeCap`&&(r.set=function(t){this.context[e]=t===`none`?`butt`:t}),Object.defineProperty(t,n,r)}}var zt=[];function I(){return(e,t)=>{zt.push(t)}}var Bt=[],L=class{set blendMode(e){e===`normal`&&(e=`source-over`),this.context.globalCompositeOperation=e}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(e){this.context.setLineDash(e||Bt)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let e;zt.forEach(t=>{e=this.context[t],e&&(this[t]=e.bind(this.context))}),this.textBaseline=`alphabetic`}setTransform(e,t,n,r,i,a){}resetTransform(){}getTransform(){}save(){}restore(){}transform(e,t,n,r,i,a){u(e)?this.context.transform(e.a,e.b,e.c,e.d,e.e,e.f):this.context.transform(e,t,n,r,i,a)}translate(e,t){}scale(e,t){}rotate(e){}fill(e,t){}stroke(e){}clip(e,t){}fillRect(e,t,n,r){}strokeRect(e,t,n,r){}clearRect(e,t,n,r){}drawImage(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 9:if(t<0){let e=-t/r*s;r+=t,t=0,a+=e,s-=e}if(n<0){let e=-n/i*c;i+=n,n=0,o+=e,c-=e}this.context.drawImage(e,t,n,r,i,a,o,s,c);break;case 5:this.context.drawImage(e,t,n,r,i);break;case 3:this.context.drawImage(e,t,n)}}beginPath(){}moveTo(e,t){}lineTo(e,t){}bezierCurveTo(e,t,n,r,i,a){}quadraticCurveTo(e,t,n,r){}closePath(){}arc(e,t,n,r,i,a){}arcTo(e,t,n,r,i){}ellipse(e,t,n,r,i,a,o,s){}rect(e,t,n,r){}roundRect(e,t,n,r,i){}createConicGradient(e,t,n){}createLinearGradient(e,t,n,r){}createPattern(e,t){}createRadialGradient(e,t,n,r,i,a){}fillText(e,t,n,r){}measureText(e){}strokeText(e,t,n,r){}destroy(){this.context=null}};P([F(`imageSmoothingEnabled`)],L.prototype,`smooth`,void 0),P([F(`imageSmoothingQuality`)],L.prototype,`smoothLevel`,void 0),P([F(`globalAlpha`)],L.prototype,`opacity`,void 0),P([F()],L.prototype,`fillStyle`,void 0),P([F()],L.prototype,`strokeStyle`,void 0),P([F(`lineWidth`)],L.prototype,`strokeWidth`,void 0),P([F(`lineCap`)],L.prototype,`strokeCap`,void 0),P([F(`lineJoin`)],L.prototype,`strokeJoin`,void 0),P([F(`lineDashOffset`)],L.prototype,`dashOffset`,void 0),P([F()],L.prototype,`miterLimit`,void 0),P([F()],L.prototype,`shadowBlur`,void 0),P([F()],L.prototype,`shadowColor`,void 0),P([F()],L.prototype,`shadowOffsetX`,void 0),P([F()],L.prototype,`shadowOffsetY`,void 0),P([F()],L.prototype,`filter`,void 0),P([F()],L.prototype,`font`,void 0),P([F()],L.prototype,`fontKerning`,void 0),P([F()],L.prototype,`fontStretch`,void 0),P([F()],L.prototype,`fontVariantCaps`,void 0),P([F()],L.prototype,`textAlign`,void 0),P([F()],L.prototype,`textBaseline`,void 0),P([F()],L.prototype,`textRendering`,void 0),P([F()],L.prototype,`wordSpacing`,void 0),P([F()],L.prototype,`letterSpacing`,void 0),P([F()],L.prototype,`direction`,void 0),P([I()],L.prototype,`setTransform`,null),P([I()],L.prototype,`resetTransform`,null),P([I()],L.prototype,`getTransform`,null),P([I()],L.prototype,`save`,null),P([I()],L.prototype,`restore`,null),P([I()],L.prototype,`translate`,null),P([I()],L.prototype,`scale`,null),P([I()],L.prototype,`rotate`,null),P([I()],L.prototype,`fill`,null),P([I()],L.prototype,`stroke`,null),P([I()],L.prototype,`clip`,null),P([I()],L.prototype,`fillRect`,null),P([I()],L.prototype,`strokeRect`,null),P([I()],L.prototype,`clearRect`,null),P([I()],L.prototype,`beginPath`,null),P([I()],L.prototype,`moveTo`,null),P([I()],L.prototype,`lineTo`,null),P([I()],L.prototype,`bezierCurveTo`,null),P([I()],L.prototype,`quadraticCurveTo`,null),P([I()],L.prototype,`closePath`,null),P([I()],L.prototype,`arc`,null),P([I()],L.prototype,`arcTo`,null),P([I()],L.prototype,`ellipse`,null),P([I()],L.prototype,`rect`,null),P([I()],L.prototype,`roundRect`,null),P([I()],L.prototype,`createConicGradient`,null),P([I()],L.prototype,`createLinearGradient`,null),P([I()],L.prototype,`createPattern`,null),P([I()],L.prototype,`createRadialGradient`,null),P([I()],L.prototype,`fillText`,null),P([I()],L.prototype,`measureText`,null),P([I()],L.prototype,`strokeText`,null);var{copy:Vt,multiplyParent:Ht,pixelScale:Ut}=D,{round:Wt}=Math,R=new mt,Gt=new mt,Kt={width:1,height:1,pixelRatio:1},qt=[`width`,`height`,`pixelRatio`],Jt=class extends L{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(e){this.config.pixelSnap=e}get allowBackgroundColor(){return this.view&&this.parentView}constructor(e,t){super(),this.size={},this.worldTransform={},e||=Kt,this.manager=t,this.innerId=g.create(g.CNAVAS);let{width:n,height:r,pixelRatio:i}=e;this.autoLayout=!n||!r,this.size.pixelRatio=i||M.devicePixelRatio,this.config=e,this.init()}init(){}__createContext(){let{view:e}=this,{contextSettings:t}=this.config;this.context=t?e.getContext(`2d`,t):e.getContext(`2d`),this.__bindContext()}export(e,t){}toBlob(e,t){}toDataURL(e,t){}saveAs(e,t){}resize(e,t=!0){if(this.isSameSize(e))return;let n;this.context&&!this.unreal&&t&&this.width&&(n=this.getSameCanvas(),n.copyWorld(this));let r=this.size;p.copyAttrs(r,e,qt),qt.forEach(e=>r[e]||(r[e]=1)),this.bounds=new mt(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&n&&(this.clearWorld(n.bounds),this.copyWorld(n),n.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(e){return e&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(e,t){}stopAutoLayout(){}setCursor(e){}setWorld(e,t){let{pixelRatio:n,pixelSnap:r}=this,i=this.worldTransform;t&&Ht(e,t,i),Ut(e,n,i),r&&!e.ignorePixelSnap&&(e.half&&e.half*n%2?(i.e=Wt(i.e-.5)+.5,i.f=Wt(i.f-.5)+.5):(i.e=Wt(i.e),i.f=Wt(i.f))),this.setTransform(i.a,i.b,i.c,i.d,i.e,i.f)}useWorldTransform(e){e&&(this.worldTransform=e);let t=this.worldTransform;t&&this.setTransform(t.a,t.b,t.c,t.d,t.e,t.f)}setStroke(e,t,n,r){t&&(this.strokeWidth=t),e&&(this.strokeStyle=e),n&&this.setStrokeOptions(n,r)}setStrokeOptions(e,t){let{strokeCap:r,strokeJoin:i,dashPattern:a,dashOffset:o,miterLimit:s}=e;t&&(t.strokeCap&&(r=t.strokeCap),t.strokeJoin&&(i=t.strokeJoin),n(t.dashPattern)||(a=t.dashPattern),n(t.dashOffset)||(o=t.dashOffset),t.miterLimit&&(s=t.miterLimit)),this.strokeCap=r,this.strokeJoin=i,this.dashPattern=a,this.dashOffset=o,this.miterLimit=s}saveBlendMode(e){this.savedBlendMode=this.blendMode,this.blendMode=e}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(e,t){return!0}hitStroke(e,t){return!0}hitPixel(e,t,n=1){return!0}setWorldShadow(e,t,n,r){let{pixelRatio:i}=this;this.shadowOffsetX=e*i,this.shadowOffsetY=t*i,this.shadowBlur=n*i,this.shadowColor=r||`black`}setWorldBlur(e){let{pixelRatio:t}=this;this.filter=`blur(${e*t}px)`}copyWorld(e,t,n,r,i){r&&(this.blendMode=r),t?(this.setTempPixelBounds(t,i),n?(this.setTempPixelBounds2(n,i),n=Gt):n=R,this.drawImage(e.view,R.x,R.y,R.width,R.height,n.x,n.y,n.width,n.height)):this.drawImage(e.view,0,0),r&&(this.blendMode=`source-over`)}copyWorldToInner(e,t,n,r,i){t.b||t.c?(this.save(),this.resetTransform(),this.copyWorld(e,t,A.tempToOuterOf(n,t),r,i),this.restore()):(r&&(this.blendMode=r),this.setTempPixelBounds(t,i),this.drawImage(e.view,R.x,R.y,R.width,R.height,n.x,n.y,n.width,n.height),r&&(this.blendMode=`source-over`))}copyWorldByReset(e,t,n,r,i,a){this.resetTransform(),this.copyWorld(e,t,n,r,a),i||this.useWorldTransform()}useGrayscaleAlpha(e){let t,n;this.setTempPixelBounds(e,!0,!0);let{context:r}=this,i=r.getImageData(R.x,R.y,R.width,R.height),{data:a}=i;for(let e=0,r=a.length;e<r;e+=4)n=.299*a[e]+.587*a[e+1]+.114*a[e+2],(t=a[e+3])&&(a[e+3]=t===255?n:n/255*t);r.putImageData(i,R.x,R.y)}useMask(e,t,n){this.copyWorld(e,t,n,`destination-in`)}useEraser(e,t,n){this.copyWorld(e,t,n,`destination-out`)}fillWorld(e,t,n,r){n&&(this.blendMode=n),this.fillStyle=t,this.setTempPixelBounds(e,r),this.fillRect(R.x,R.y,R.width,R.height),n&&(this.blendMode=`source-over`)}strokeWorld(e,t,n,r){n&&(this.blendMode=n),this.strokeStyle=t,this.setTempPixelBounds(e,r),this.strokeRect(R.x,R.y,R.width,R.height),n&&(this.blendMode=`source-over`)}clipWorld(e,t=!0){this.beginPath(),this.setTempPixelBounds(e,t),this.rect(R.x,R.y,R.width,R.height),this.clip()}clipUI(e){e.windingRule?this.clip(e.windingRule):this.clip()}clearWorld(e,t=!0){this.setTempPixelBounds(e,t),this.clearRect(R.x,R.y,R.width,R.height)}clear(){let{pixelRatio:e}=this;this.clearRect(0,0,this.width*e+2,this.height*e+2)}setTempPixelBounds(e,t,n){this.copyToPixelBounds(R,e,t,n)}setTempPixelBounds2(e,t,n){this.copyToPixelBounds(Gt,e,t,n)}copyToPixelBounds(e,t,n,r){e.set(t),r&&e.intersect(this.bounds),e.scale(this.pixelRatio),n&&e.ceil()}isSameSize(e){return this.width===e.width&&this.height===e.height&&(!e.pixelRatio||this.pixelRatio===e.pixelRatio)}getSameCanvas(e,t){let{size:n,pixelSnap:r}=this,i=this.manager?this.manager.get(n):At.canvas(Object.assign({},n));return i.save(),e&&(Vt(i.worldTransform,this.worldTransform),i.useWorldTransform()),t&&(i.smooth=this.smooth),i.pixelSnap!==r&&(i.pixelSnap=r),i}recycle(e){this.recycled||(this.restore(),e?this.clearWorld(e):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(e){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}},Yt={creator:{},parse(e,t){},convertToCanvasData(e,t){}},Xt={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Zt=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},Xt),Qt={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},$t={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},en=Object.assign(Object.assign({},$t),Xt),tn=Zt,nn={};for(let e in tn)nn[tn[e]]=e;var rn={};for(let e in tn)rn[tn[e]]=Qt[e];var an={drawRoundRect(e,t,n,r,i,a){let o=T.fourNumber(a,Math.min(r/2,i/2)),s=t+r,c=n+i;o[0]?e.moveTo(t+o[0],n):e.moveTo(t,n),o[1]?e.arcTo(s,n,s,c,o[1]):e.lineTo(s,n),o[2]?e.arcTo(s,c,t,c,o[2]):e.lineTo(s,c),o[3]?e.arcTo(t,c,t,n,o[3]):e.lineTo(t,c),o[0]?e.arcTo(t,n,s,n,o[0]):e.lineTo(t,n)}},{sin:on,cos:sn,hypot:cn,atan2:ln,ceil:un,abs:dn,PI:fn,sqrt:pn,pow:mn}=Math,{setPoint:hn,addPoint:gn}=Ve,{set:_n,toNumberPoints:vn}=k,{M:yn,L:bn,C:xn,Q:Sn,Z:Cn}=Zt,wn={},Tn={points(e,t,n,r){let i=vn(t);if(e.push(yn,i[0],i[1]),n&&i.length>5){let t,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y=i.length,b=!0===n?.5:n;r&&(i=[i[y-2],i[y-1],...i,i[0],i[1],i[2],i[3]],y=i.length);for(let n=2;n<y-2;n+=2)t=i[n-2],a=i[n-1],o=i[n],s=i[n+1],c=i[n+2],l=i[n+3],m=o-t,h=s-a,g=pn(mn(m,2)+mn(h,2)),_=pn(mn(c-o,2)+mn(l-s,2)),(g||_)&&(v=g+_,g=b*g/v,_=b*_/v,c-=t,l-=a,u=o-g*c,d=s-g*l,n===2?r||e.push(Sn,u,d,o,s):(m||h)&&e.push(xn,f,p,u,d,o,s),f=o+_*c,p=s+_*l);r||e.push(Sn,f,p,i[y-2],i[y-1])}else for(let t=2,n=i.length;t<n;t+=2)e.push(bn,i[t],i[t+1]);r&&e.push(Cn)},rect(e,t,n,r,i){Yt.creator.path=e,Yt.creator.moveTo(t,n).lineTo(t+r,n).lineTo(t+r,n+i).lineTo(t,n+i).lineTo(t,n)},roundRect(e,t,n,r,i,a){Yt.creator.path=[],an.drawRoundRect(Yt.creator,t,n,r,i,a),e.push(...Yt.convertToCanvasData(Yt.creator.path,!0))},arcTo(e,t,n,r,i,a,o,s,c,l,u){let d=r-t,f=i-n,p=a-r,m=o-i,h=ln(f,d),g=ln(m,p),_=cn(d,f),v=cn(p,m),y=g-h;if(y<0&&(y+=ue),_<1e-12||v<1e-12||y<1e-12||dn(y-fn)<1e-12)return e&&e.push(bn,r,i),c&&(hn(c,t,n),gn(c,r,i)),u&&_n(u,t,n),void(l&&_n(l,r,i));let b=d*m-p*f<0,x=b?-1:1,S=s/sn(y/2),C=r+S*sn(h+y/2+de*x),w=i+S*on(h+y/2+de*x);return h-=de*x,g-=de*x,On(e,C,w,s,s,0,h/E,g/E,b,c,l,u)},arc:(e,t,n,r,i,a,o,s,c,l)=>On(e,t,n,r,r,0,i,a,o,s,c,l),ellipse(e,t,n,r,i,a,o,s,c,l,u,d){let f=a*E,p=on(f),m=sn(f),h=o*E,g=s*E;h>fn&&(h-=ue),g<0&&(g+=ue);let _=g-h;_<0?_+=ue:_>ue&&(_-=ue),c&&(_-=ue);let v=un(dn(_/de)),y=_/v,b=on(y/4),x=8/3*b*b/on(y/2);g=h+y;let S,C,w,ee,te,ne,re,ie,ae=sn(h),oe=on(h),se=w=m*r*ae-p*i*oe,ce=ee=p*r*ae+m*i*oe,T=t+w,le=n+ee;e&&e.push(e.length?bn:yn,T,le),l&&hn(l,T,le),d&&_n(d,T,le);for(let a=0;a<v;a++)S=sn(g),C=on(g),w=m*r*S-p*i*C,ee=p*r*S+m*i*C,te=t+se-x*(m*r*oe+p*i*ae),ne=n+ce-x*(p*r*oe-m*i*ae),re=t+w+x*(m*r*C+p*i*S),ie=n+ee+x*(p*r*C-m*i*S),e&&e.push(xn,te,ne,re,ie,t+w,n+ee),l&&Dn(t+se,n+ce,te,ne,re,ie,t+w,n+ee,l,!0),se=w,ce=ee,ae=S,oe=C,h=g,g+=y;u&&_n(u,t+w,n+ee)},quadraticCurveTo(e,t,n,r,i,a,o){e.push(xn,(t+2*r)/3,(n+2*i)/3,(a+2*r)/3,(o+2*i)/3,a,o)},toTwoPointBoundsByQuadraticCurve(e,t,n,r,i,a,o,s){Dn(e,t,(e+2*n)/3,(t+2*r)/3,(i+2*n)/3,(a+2*r)/3,i,a,o,s)},toTwoPointBounds(e,t,n,r,i,a,o,s,c,l){let u=[],d,f,p,m,h,g,_,v,y=e,b=n,x=i,S=o;for(let e=0;e<2;++e)if(e==1&&(y=t,b=r,x=a,S=s),d=-3*y+9*b-9*x+3*S,f=6*y-12*b+6*x,p=3*b-3*y,Math.abs(d)<1e-12){if(Math.abs(f)<1e-12)continue;m=-p/f,0<m&&m<1&&u.push(m)}else _=f*f-4*p*d,v=Math.sqrt(_),_<0||(h=(-f+v)/(2*d),0<h&&h<1&&u.push(h),g=(-f-v)/(2*d),0<g&&g<1&&u.push(g));l?gn(c,e,t):hn(c,e,t),gn(c,o,s);for(let l=0,d=u.length;l<d;l++)En(u[l],e,t,n,r,i,a,o,s,wn),gn(c,wn.x,wn.y)},getPointAndSet(e,t,n,r,i,a,o,s,c,l){let u=1-e,d=u*u*u,f=3*u*u*e,p=3*u*e*e,m=e*e*e;l.x=d*t+f*r+p*a+m*s,l.y=d*n+f*i+p*o+m*c},getPoint(e,t,n,r,i,a,o,s,c){let l={};return En(e,t,n,r,i,a,o,s,c,l),l},getDerivative(e,t,n,r,i){let a=1-e;return 3*a*a*(n-t)+6*a*e*(r-n)+3*e*e*(i-r)},cut(e,t,n,r,i,a,o,s,c){if(e<=0)return{left:null,right:[r,i,a,o,s,c]};if(e>=1)return{left:[r,i,a,o,s,c],right:null};let l=1-e,u=t*l+r*e,d=n*l+i*e,f=r*l+a*e,p=i*l+o*e,m=a*l+s*e,h=o*l+c*e,g=u*l+f*e,_=d*l+p*e,v=f*l+m*e,y=p*l+h*e;return{left:[u,d,g,_,g*l+v*e,_*l+y*e],right:[v,y,m,h,s,c]}}},{getPointAndSet:En,toTwoPointBounds:Dn,ellipse:On}=Tn,{sin:kn,cos:An,sqrt:jn,atan2:Mn}=Math,{ellipse:Nn}=Tn,Pn={ellipticalArc(e,t,n,r,i,a,o,s,c,l,u){let d=(c-t)/2,f=(l-n)/2,p=a*E,m=kn(p),h=An(p),g=-h*d-m*f,_=-h*f+m*d,v=r*r,y=i*i,b=_*_,x=g*g,S=v*y-v*b-y*x,C=0;if(S<0){let e=jn(1-S/(v*y));r*=e,i*=e}else C=(o===s?-1:1)*jn(S/(v*b+y*x));let w=C*r*_/i,ee=-C*i*g/r,te=Mn((_-ee)/i,(g-w)/r),ne=Mn((-_-ee)/i,(-g-w)/r),re=ne-te;s===0&&re>0?re-=ue:s===1&&re<0&&(re+=ue);let ie=t+d+h*w-m*ee,ae=n+f+m*w+h*ee,oe=+(re<0);u||M.ellipseToCurve?Nn(e,ie,ae,r,i,a,te/E,ne/E,oe):r!==i||a?e.push(Zt.G,ie,ae,r,i,a,te/E,ne/E,oe):e.push(Zt.O,ie,ae,r,te/E,ne/E,oe)}},Fn={toCommand:e=>[],toNode:e=>[]},{M:In,m:Ln,L:Rn,l:zn,H:Bn,h:Vn,V:Hn,v:Un,C:Wn,c:Gn,S:Kn,s:qn,Q:Jn,q:Yn,T:Xn,t:Zn,A:Qn,a:$n,Z:er,z:tr,N:nr,D:rr,X:ir,G:ar,F:or,O:sr,P:cr,U:lr}=Zt,{rect:ur,roundRect:dr,arcTo:fr,arc:pr,ellipse:mr,quadraticCurveTo:hr}=Tn,{ellipticalArc:gr}=Pn,_r=N.get(`PathConvert`),vr={},yr={current:{dot:0},stringify(e,t){let n,r,i,a=0,o=e.length,s=``;for(;a<o;){r=e[a],n=rn[r],s+=r===i?` `:nn[r];for(let r=1;r<n;r++)s+=T.float(e[a+r],t),r===n-1||(s+=` `);i=r,a+=n}return s},parse(e,t){let n,r,i,a=``,o=[],s=t?en:$t;for(let t=0,c=e.length;t<c;t++)r=e[t],vt[r]?(r===`.`&&(br.dot&&(xr(o,a),a=``),br.dot++),a===`0`&&r!==`.`&&(xr(o,a),a=``),a+=r):Zt[r]?(a&&=(xr(o,a),``),br.name=Zt[r],br.length=Qt[r],br.index=0,xr(o,br.name),r===`m`?br.name=Zt.l:r===`M`?br.name=Zt.L:!n&&s[r]&&(n=!0)):r===`-`||r===`+`?i===`e`||i===`E`?a+=r:(a&&xr(o,a),a=r):a&&=(xr(o,a),``),i=r;return a&&xr(o,a),n?yr.toCanvasData(o,t):o},toCanvasData(e,t){let n,r,i,a,o,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=e.length,h=[];for(;p<m;){switch(i=e[p],i){case Ln:e[p+1]+=s,e[p+2]+=c;case In:s=d=e[p+1],c=f=e[p+2],h.push(In,s,c),p+=3;break;case Vn:e[p+1]+=s;case Bn:s=e[p+1],h.push(Rn,s,c),p+=2;break;case Un:e[p+1]+=c;case Hn:c=e[p+1],h.push(Rn,s,c),p+=2;break;case zn:e[p+1]+=s,e[p+2]+=c;case Rn:s=e[p+1],c=e[p+2],h.push(Rn,s,c),p+=3;break;case qn:e[p+1]+=s,e[p+2]+=c,e[p+3]+=s,e[p+4]+=c,i=Kn;case Kn:o=a===Wn||a===Kn,l=o?2*s-n:e[p+1],u=o?2*c-r:e[p+2],n=e[p+1],r=e[p+2],s=e[p+3],c=e[p+4],h.push(Wn,l,u,n,r,s,c),p+=5;break;case Gn:e[p+1]+=s,e[p+2]+=c,e[p+3]+=s,e[p+4]+=c,e[p+5]+=s,e[p+6]+=c,i=Wn;case Wn:n=e[p+3],r=e[p+4],s=e[p+5],c=e[p+6],h.push(Wn,e[p+1],e[p+2],n,r,s,c),p+=7;break;case Zn:e[p+1]+=s,e[p+2]+=c,i=Xn;case Xn:o=a===Jn||a===Xn,n=o?2*s-n:e[p+1],r=o?2*c-r:e[p+2],t?hr(h,s,c,n,r,e[p+1],e[p+2]):h.push(Jn,n,r,e[p+1],e[p+2]),s=e[p+1],c=e[p+2],p+=3;break;case Yn:e[p+1]+=s,e[p+2]+=c,e[p+3]+=s,e[p+4]+=c,i=Jn;case Jn:n=e[p+1],r=e[p+2],t?hr(h,s,c,n,r,e[p+3],e[p+4]):h.push(Jn,n,r,e[p+3],e[p+4]),s=e[p+3],c=e[p+4],p+=5;break;case $n:e[p+6]+=s,e[p+7]+=c;case Qn:gr(h,s,c,e[p+1],e[p+2],e[p+3],e[p+4],e[p+5],e[p+6],e[p+7],t),s=e[p+6],c=e[p+7],p+=8;break;case tr:case er:h.push(er),s=d,c=f,p++;break;case nr:s=e[p+1],c=e[p+2],t?ur(h,s,c,e[p+3],e[p+4]):Sr(h,e,p,5),p+=5;break;case rr:s=e[p+1],c=e[p+2],t?dr(h,s,c,e[p+3],e[p+4],[e[p+5],e[p+6],e[p+7],e[p+8]]):Sr(h,e,p,9),p+=9;break;case ir:s=e[p+1],c=e[p+2],t?dr(h,s,c,e[p+3],e[p+4],e[p+5]):Sr(h,e,p,6),p+=6;break;case ar:mr(t?h:Sr(h,e,p,9),e[p+1],e[p+2],e[p+3],e[p+4],e[p+5],e[p+6],e[p+7],e[p+8],null,vr),s=vr.x,c=vr.y,p+=9;break;case or:t?mr(h,e[p+1],e[p+2],e[p+3],e[p+4],0,0,360,!1):Sr(h,e,p,5),s=e[p+1]+e[p+3],c=e[p+2],p+=5;break;case sr:pr(t?h:Sr(h,e,p,7),e[p+1],e[p+2],e[p+3],e[p+4],e[p+5],e[p+6],null,vr),s=vr.x,c=vr.y,p+=7;break;case cr:t?pr(h,e[p+1],e[p+2],e[p+3],0,360,!1):Sr(h,e,p,4),s=e[p+1]+e[p+3],c=e[p+2],p+=4;break;case lr:fr(t?h:Sr(h,e,p,6),s,c,e[p+1],e[p+2],e[p+3],e[p+4],e[p+5],null,vr),s=vr.x,c=vr.y,p+=6;break;default:return _r.error(`command: ${i} [index:${p}]`,e),h}a=i}return h},objectToCanvasData(e){if(e[0].name.length>1)return Fn.toCommand(e);{let t=[];return e.forEach(e=>{switch(e.name){case`M`:t.push(In,e.x,e.y);break;case`L`:t.push(Rn,e.x,e.y);break;case`C`:t.push(Wn,e.x1,e.y1,e.x2,e.y2,e.x,e.y);break;case`Q`:t.push(Jn,e.x1,e.y1,e.x,e.y);break;case`Z`:t.push(er)}}),t}},copyData(e,t,n,r){for(let i=n,a=n+r;i<a;i++)e.push(t[i])},pushData(e,t){br.index===br.length&&(br.index=1,e.push(br.name)),e.push(Number(t)),br.index++,br.dot=0}},{current:br,pushData:xr,copyData:Sr}=yr,{M:Cr,L:wr,C:Tr,Q:Er,Z:Dr,N:Or,D:kr,X:Ar,G:jr,F:Mr,O:Nr,P:Pr,U:Fr}=Zt,{getMinDistanceFrom:Ir,getRadianFrom:Lr}=k,{tan:Rr,min:zr,abs:Br}=Math,Vr={},Hr={beginPath(e){e.length=0},moveTo(e,t,n){e.push(Cr,t,n)},lineTo(e,t,n){e.push(wr,t,n)},bezierCurveTo(e,t,n,r,i,a,o){e.push(Tr,t,n,r,i,a,o)},quadraticCurveTo(e,t,n,r,i){e.push(Er,t,n,r,i)},closePath(e){e.push(Dr)},rect(e,t,n,r,i){e.push(Or,t,n,r,i)},roundRect(e,t,n,r,i,a){if(o(a))e.push(Ar,t,n,r,i,a);else{let o=T.fourNumber(a);o?e.push(kr,t,n,r,i,...o):e.push(Or,t,n,r,i)}},ellipse(e,t,n,i,a,o,s,c,l){if(i===a)return Wr(e,t,n,i,s,c,l);r(o)?e.push(Mr,t,n,i,a):(r(s)&&(s=0),r(c)&&(c=360),e.push(jr,t,n,i,a,o,s,c,+!!l))},arc(e,t,n,i,a,o,s){r(a)?e.push(Pr,t,n,i):(r(a)&&(a=0),r(o)&&(o=360),e.push(Nr,t,n,i,a,o,+!!s))},arcTo(e,t,r,i,a,o,s,c,l){if(!n(s)){let e=Ir(s,c,t,r,i,a)/(l?1:2);o=zr(o,zr(e,e*Br(Rr(Lr(s,c,t,r,i,a)/2))))}e.push(Fr,t,r,i,a,o)},drawEllipse(e,t,n,i,a,o,s,c,l){Tn.ellipse(null,t,n,i,a,r(o)?0:o,r(s)?0:s,r(c)?360:c,l,null,null,Vr),e.push(Cr,Vr.x,Vr.y),Ur(e,t,n,i,a,o,s,c,l)},drawArc(e,t,n,i,a,o,s){Tn.arc(null,t,n,i,r(a)?0:a,r(o)?360:o,s,null,null,Vr),e.push(Cr,Vr.x,Vr.y),Wr(e,t,n,i,a,o,s)},drawPoints(e,t,n,r){Tn.points(e,t,n,r)}},{ellipse:Ur,arc:Wr}=Hr,{moveTo:Gr,lineTo:Kr,quadraticCurveTo:qr,bezierCurveTo:Jr,closePath:Yr,beginPath:Xr,rect:Zr,roundRect:Qr,ellipse:$r,arc:ei,arcTo:ti,drawEllipse:ni,drawArc:ri,drawPoints:ii}=Hr,ai=class{set path(e){this.__path=e}get path(){return this.__path}constructor(e){this.set(e)}set(e){return this.__path=e?i(e)?Yt.parse(e):e:[],this}beginPath(){return Xr(this.__path),this.paint(),this}moveTo(e,t){return Gr(this.__path,e,t),this.paint(),this}lineTo(e,t){return Kr(this.__path,e,t),this.paint(),this}bezierCurveTo(e,t,n,r,i,a){return Jr(this.__path,e,t,n,r,i,a),this.paint(),this}quadraticCurveTo(e,t,n,r){return qr(this.__path,e,t,n,r),this.paint(),this}closePath(){return Yr(this.__path),this.paint(),this}rect(e,t,n,r){return Zr(this.__path,e,t,n,r),this.paint(),this}roundRect(e,t,n,r,i){return Qr(this.__path,e,t,n,r,i),this.paint(),this}ellipse(e,t,n,r,i,a,o,s){return $r(this.__path,e,t,n,r,i,a,o,s),this.paint(),this}arc(e,t,n,r,i,a){return ei(this.__path,e,t,n,r,i,a),this.paint(),this}arcTo(e,t,n,r,i){return ti(this.__path,e,t,n,r,i),this.paint(),this}drawEllipse(e,t,n,r,i,a,o,s){return ni(this.__path,e,t,n,r,i,a,o,s),this.paint(),this}drawArc(e,t,n,r,i,a){return ri(this.__path,e,t,n,r,i,a),this.paint(),this}drawPoints(e,t,n){return ii(this.__path,e,t,n),this.paint(),this}clearPath(){return this.beginPath()}paint(){}},{M:oi,L:si,C:ci,Q:li,Z:ui,N:di,D:fi,X:pi,G:mi,F:hi,O:gi,P:_i,U:vi}=Zt,yi=N.get(`PathDrawer`),bi={drawPathByData(e,t){if(!t)return;let n,r=0,i=t.length;for(;r<i;)switch(n=t[r],n){case oi:e.moveTo(t[r+1],t[r+2]),r+=3;break;case si:e.lineTo(t[r+1],t[r+2]),r+=3;break;case ci:e.bezierCurveTo(t[r+1],t[r+2],t[r+3],t[r+4],t[r+5],t[r+6]),r+=7;break;case li:e.quadraticCurveTo(t[r+1],t[r+2],t[r+3],t[r+4]),r+=5;break;case ui:e.closePath(),r+=1;break;case di:e.rect(t[r+1],t[r+2],t[r+3],t[r+4]),r+=5;break;case fi:e.roundRect(t[r+1],t[r+2],t[r+3],t[r+4],[t[r+5],t[r+6],t[r+7],t[r+8]]),r+=9;break;case pi:e.roundRect(t[r+1],t[r+2],t[r+3],t[r+4],t[r+5]),r+=6;break;case mi:e.ellipse(t[r+1],t[r+2],t[r+3],t[r+4],t[r+5]*E,t[r+6]*E,t[r+7]*E,t[r+8]),r+=9;break;case hi:e.ellipse(t[r+1],t[r+2],t[r+3],t[r+4],0,0,ue,!1),r+=5;break;case gi:e.arc(t[r+1],t[r+2],t[r+3],t[r+4]*E,t[r+5]*E,t[r+6]),r+=7;break;case _i:e.arc(t[r+1],t[r+2],t[r+3],0,ue,!1),r+=4;break;case vi:e.arcTo(t[r+1],t[r+2],t[r+3],t[r+4],t[r+5]),r+=6;break;default:yi.error(`command: ${n} [index:${r}]`,t);return}}},{M:xi,L:Si,C:Ci,Q:wi,Z:Ti,N:Ei,D:Di,X:Oi,G:ki,F:Ai,O:ji,P:Mi,U:Ni}=Zt,{toTwoPointBounds:Pi,toTwoPointBoundsByQuadraticCurve:Fi,arcTo:Ii,arc:Li,ellipse:Ri}=Tn,{addPointBounds:zi,copy:Bi,addPoint:Vi,setPoint:Hi,addBounds:Ui,toBounds:Wi}=Ve,Gi=N.get(`PathBounds`),Ki,qi,Ji,Yi={},Xi={},Zi={},Qi={toBounds(e,t){Qi.toTwoPointBounds(e,Xi),Wi(Xi,t)},toTwoPointBounds(e,t){if(!e||!e.length)return Hi(t,0,0);let n,r,i,a,o,s=0,c=0,l=0,u=e.length;for(;s<u;)switch(o=e[s],s===0&&(o===Ti||o===Ci||o===wi?Hi(t,c,l):Hi(t,e[s+1],e[s+2])),o){case xi:case Si:c=e[s+1],l=e[s+2],Vi(t,c,l),s+=3;break;case Ci:i=e[s+5],a=e[s+6],Pi(c,l,e[s+1],e[s+2],e[s+3],e[s+4],i,a,Yi),zi(t,Yi),c=i,l=a,s+=7;break;case wi:n=e[s+1],r=e[s+2],i=e[s+3],a=e[s+4],Fi(c,l,n,r,i,a,Yi),zi(t,Yi),c=i,l=a,s+=5;break;case Ti:s+=1;break;case Ei:c=e[s+1],l=e[s+2],Ui(t,c,l,e[s+3],e[s+4]),s+=5;break;case Di:case Oi:c=e[s+1],l=e[s+2],Ui(t,c,l,e[s+3],e[s+4]),s+=o===Di?9:6;break;case ki:Ri(null,e[s+1],e[s+2],e[s+3],e[s+4],e[s+5],e[s+6],e[s+7],e[s+8],Yi,Zi),s===0?Bi(t,Yi):zi(t,Yi),c=Zi.x,l=Zi.y,s+=9;break;case Ai:c=e[s+1],l=e[s+2],qi=e[s+3],Ji=e[s+4],Ui(t,c-qi,l-Ji,2*qi,2*Ji),c+=qi,s+=5;break;case ji:Li(null,e[s+1],e[s+2],e[s+3],e[s+4],e[s+5],e[s+6],Yi,Zi),s===0?Bi(t,Yi):zi(t,Yi),c=Zi.x,l=Zi.y,s+=7;break;case Mi:c=e[s+1],l=e[s+2],Ki=e[s+3],Ui(t,c-Ki,l-Ki,2*Ki,2*Ki),c+=Ki,s+=4;break;case Ni:Ii(null,c,l,e[s+1],e[s+2],e[s+3],e[s+4],e[s+5],Yi,Zi),s===0?Bi(t,Yi):zi(t,Yi),c=Zi.x,l=Zi.y,s+=6;break;default:Gi.error(`command: ${o} [index:${s}]`,e);return}}},{M:$i,L:ea,Z:ta}=Zt,{getCenterX:na,getCenterY:ra}=k,{arcTo:ia}=Hr,aa={smooth(e,t,n){let r,i,a,o=0,s=0,c=0,u=0,d=0,f=0,p=0,m=0,h=0;l(t)&&(t=t[0]||0);let g=e.length,_=g===9,v=[];for(;o<g;){switch(r=e[o],r){case $i:u=m=e[o+1],d=h=e[o+2],o+=3,e[o]===ea?(f=e[o+1],p=e[o+2],_?v.push($i,u,d):v.push($i,na(u,f),ra(d,p))):v.push($i,u,d);break;case ea:switch(s=e[o+1],c=e[o+2],o+=3,e[o]){case ea:ia(v,s,c,e[o+1],e[o+2],t,m,h,_);break;case ta:ia(v,s,c,u,d,t,m,h,_);break;default:v.push(ea,s,c)}m=s,h=c;break;case ta:i!==ta&&(ia(v,u,d,f,p,t,m,h,_),v.push(ta)),o+=1;break;default:a=rn[r];for(let t=0;t<a;t++)v.push(e[o+t]);o+=a}i=r}return r!==ta&&(v[1]=u,v[2]=d),v}};function oa(e){return new ai(e)}var sa=oa();Yt.creator=oa(),Yt.parse=yr.parse,Yt.convertToCanvasData=yr.toCanvasData;var{drawRoundRect:ca}=an;function la(e){(function(e){e&&!e.roundRect&&(e.roundRect=function(e,t,n,r,i){ca(this,e,t,n,r,i)})})(e)}var ua={alphaPixelTypes:[`png`,`webp`,`svg`],upperCaseTypeMap:{},mimeType:(e,t=`image`)=>!e||e.startsWith(t)?e:(e===`jpg`&&(e=`jpeg`),t+`/`+e),fileType(e){let t=e.split(`.`);return t[t.length-1]},isOpaqueImage(e){let t=da.fileType(e);return[`jpg`,`jpeg`].some(e=>e===t)},getExportOptions(e){switch(typeof e){case`object`:return e;case`number`:return{quality:e};case`boolean`:return{blob:e};default:return{}}}},da=ua;da.mineType=da.mimeType,da.alphaPixelTypes.forEach(e=>da.upperCaseTypeMap[e]=e.toUpperCase());var fa=N.get(`TaskProcessor`),pa=class{constructor(e){this.parallel=!0,this.time=1,this.id=g.create(g.TASK),this.task=e}run(){return Rt(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(e){fa.error(e)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}},ma=class{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(){let{total:e}=this,t=0,n=0;for(let r=0;r<e;r++)r<=this.finishedIndex?(n+=this.list[r].time,r===this.finishedIndex&&(t=n)):t+=this.list[r].time;return this.isComplete?1:n/t}constructor(e){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,e&&p.assign(this.config,e),this.empty()}add(e,t,r){let i,a,s,c,l=new pa(e);return l.parent=this,o(t)?c=t:t&&(a=t.parallel,i=t.start,s=t.time,c=t.delay,r||=t.canUse),s&&(l.time=s),!1===a&&(l.parallel=!1),r&&(l.canUse=r),n(c)?this.push(l,i):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(l,i))},c)),this.isComplete=!1,l}push(e,t){this.list.push(e),!1===t||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(e=>{e.isComplete||e.run()}),this.pause(),this.empty()}run(){this.running&&(this.setParallelList(),this.parallelList.length>1?this.runParallelTasks():this.remain?this.runTask():this.onComplete())}runTask(){let e=this.list[this.index];e?e.run().then(()=>{this.onTask(e),this.index++,e.isCancel?this.runTask():this.nextTask()}).catch(e=>{this.onError(e)}):this.timer=setTimeout(()=>this.nextTask())}runParallelTasks(){this.parallelList.forEach(e=>this.runParallelTask(e))}runParallelTask(e){e.run().then(()=>{this.onTask(e),this.fillParallelTask()}).catch(e=>{this.onParallelError(e)})}nextTask(){this.total===this.finishedIndex?this.onComplete():this.timer=setTimeout(()=>this.run())}setParallelList(){let e,{config:t,list:n,index:r}=this;this.parallelList=[],this.parallelSuccessNumber=0;let i=r+t.parallel;if(i>n.length&&(i=n.length),t.parallel>1)for(let t=r;t<i&&(e=n[t],e.parallel);t++)this.parallelList.push(e)}fillParallelTask(){let e,t=this.parallelList;this.parallelSuccessNumber++,t.pop();let n=t.length,r=this.finishedIndex+n;if(t.length){if(!this.running)return;r<this.total&&(e=this.list[r],e&&e.parallel&&(t.push(e),this.runParallelTask(e)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(e){e.complete(),this.config.onTask&&this.config.onTask()}onParallelError(e){this.parallelList.forEach(e=>{e.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(e)}onError(e){this.pause(),this.config.onError&&this.config.onError(e)}destroy(){this.stop()}},ha=N.get(`Resource`),ga={tasker:new ma,queue:new ma({parallel:1}),map:{},get isComplete(){return _a.tasker.isComplete},set(e,t){_a.map[e]&&ha.repeat(e),_a.map[e]=t},get:e=>_a.map[e],remove(e){let t=_a.map[e];t&&(t.destroy&&t.destroy(),delete _a.map[e])},loadImage(e,t){return new Promise((n,r)=>{let i=this.setImage(e,e,t);i.load(()=>n(i),e=>r(e))})},setImage(e,t,n){let r;return i(t)?r={url:t}:t.url||(r={url:e,view:t}),r&&(n&&(r.format=n),t=At.image(r)),_a.set(e,t),t},loadFilm(e,t){},loadVideo(e,t){},destroy(){_a.map={}}},_a=ga,va={maxRecycled:10,recycledList:[],patternTasker:ga.queue,get(e,t){let n=ga.get(e.url);return n||ga.set(e.url,n=t===`film`?At.film(e):At.image(e)),n.use++,n},recycle(e){e.parent&&(e=e.parent),e.use--,setTimeout(()=>{e.use||(M.image.isLarge(e)?e.url&&ga.remove(e.url):(e.clearLevels(),ya.recycledList.push(e)))})},recyclePaint(e){ya.recycle(e.image)},clearRecycled(e){let t=ya.recycledList;(t.length>ya.maxRecycled||e)&&(t.forEach(t=>(!t.use||e)&&t.url&&ga.remove(t.url)),t.length=0)},clearLevels(){},hasAlphaPixel:e=>ua.alphaPixelTypes.some(t=>ya.isFormat(t,e)),isFormat(e,t){if(t.format)return t.format===e;let{url:n}=t;if(n.startsWith(`data:`)){if(n.startsWith(`data:`+ua.mimeType(e)))return!0}else if(n.includes(`.`+e)||n.includes(`.`+ua.upperCaseTypeMap[e])||e===`png`&&!n.includes(`.`))return!0;return!1},destroy(){this.clearRecycled(!0)}},ya=va,{IMAGE:ba,create:xa}=g,Sa=class{get tag(){return`Image`}get url(){return this.config.url}get crossOrigin(){let{crossOrigin:e}=this.config;return n(e)?M.image.crossOrigin:e}get completed(){return this.ready||!!this.error}constructor(e){if(this.use=0,this.waitComplete=[],this.innerId=xa(ba),this.config=e||={url:``},e.view){let{view:t}=e;this.setView(t.config?t.view:t)}va.isFormat(`svg`,e)&&(this.isSVG=!0),va.hasAlphaPixel(e)&&(this.hasAlphaPixel=!0)}load(e,t,n){return this.loading||(this.loading=!0,ga.tasker.add(()=>Rt(this,void 0,void 0,function*(){return yield M.origin[`load`+this.tag](this.getLoadUrl(n),this.crossOrigin,this).then(e=>{n&&this.setThumbView(e),this.setView(e)}).catch(e=>{this.error=e,this.onComplete(!1)})}))),this.waitComplete.push(e,t),this.waitComplete.length-2}unload(e,t){let n=this.waitComplete;if(t){let t=n[e+1];t&&t({type:`stop`})}n[e]=n[e+1]=void 0}setView(e){this.ready=!0,this.width||(this.width=e.width,this.height=e.height,this.view=e),this.onComplete(!0)}onComplete(e){let t;this.waitComplete.forEach((n,r)=>{t=r%2,n&&(e?t||n(this):t&&n(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(e){return this.view}getCanvas(e,t,n,r,i,a,o,s){if(e||=this.width,t||=this.height,this.cache){let{params:e,data:t}=this.cache;for(let n in e)if(e[n]!==arguments[n]){t=null;break}if(t)return t}let c=M.image.resize(this.view,e,t,i,a,void 0,o,n,r,s);return this.cache=this.use>1?{data:c,params:arguments}:null,c}getPattern(e,t,n,r){let i=M.canvas.createPattern(e,t);return M.image.setPatternTransform(i,n,r),i}render(e,t,n,r,i,a,o,s,c){e.drawImage(this.view,t,n,r,i)}getLoadUrl(e){return this.url}setThumbView(e){}getThumbSize(e){}getMinLevel(){}getLevelData(e,t,n){}clearLevels(e){}destroyFilter(){}destroy(){this.clearLevels(),this.destroyFilter();let{view:e}=this;e&&e.close&&e.close(),this.config={url:``},this.cache=this.view=null,this.waitComplete.length=0}},Ca=class extends Sa{get tag(){return`Film`}},wa=class extends Sa{get tag(){return`Video`}};function Ta(e,t,n,r){r||(n.configurable=n.enumerable=!0),Object.defineProperty(e,t,n)}function Ea(e,t){return Object.getOwnPropertyDescriptor(e,t)}function Da(e,t){let n=`_`+e;return{get(){return this[n]??t},set(e){this[n]=e}}}function z(e,t){return(n,r)=>ka(n,r,e,t&&t(r))}function Oa(e){return e}function ka(e,t,n,r){Ta(e,t,Object.assign({get(){return this.__getAttr(t)},set(e){this.__setAttr(t,e)}},r||{})),eo(e,t,n)}function B(e){return z(e)}function Aa(e,t){return z(e,e=>({set(n){this.__setAttr(e,n,t)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function ja(e,t){return z(e,e=>({set(n){this.__setAttr(e,n,t)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||={})}}))}function Ma(e){return z(e,e=>({set(t){this.__setAttr(e,t)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),Ia(this))}}))}function Na(e,t){return z(e,e=>({set(n){this.__setAttr(e,n,t)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function Pa(e,t){return z(e,e=>({set(n){this.__setAttr(e,n,t)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function V(e,t){return z(e,e=>({set(n){this.__setAttr(e,n,t)&&Ia(this)}}))}function Fa(e){return z(e,e=>({set(t){this.__setAttr(e,t)&&(Ia(this),this.__.__removeNaturalSize())}}))}function Ia(e){e.__layout.boxChanged||e.__layout.boxChange(),e.__hasAutoLayout&&(e.__layout.matrixChanged||e.__layout.matrixChange())}function La(e){return z(e,e=>({set(t){let n=this.__;n.__pathInputed!==2&&(n.__pathInputed=+!!t),t||(n.__pathForRender=void 0),this.__setAttr(e,t),Ia(this)}}))}var H=V;function Ra(e,t){return z(e,e=>({set(n){this.__setAttr(e,n)&&(za(this),t&&(this.__.__useStroke=!0))}}))}function za(e){e.__layout.strokeChanged||e.__layout.strokeChange(),e.__.__useArrow&&Ia(e)}var Ba=Ra;function Va(e){return z(e,e=>({set(t){this.__setAttr(e,t),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Ha(e){return z(e,e=>({set(t){this.__setAttr(e,t)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function Ua(e){return z(e,e=>({set(t){if(this.__setAttr(e,t)){let e=this.__;p.stintSet(e,`__useDim`,e.dim||e.bright||e.dimskip)}}}))}function Wa(e){return z(e,e=>({set(t){this.__setAttr(e,t)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&Ka(this)}}))}function Ga(e){return z(e,e=>({set(t){let n=this.visible;if(!0===n&&t===0){if(this.animationOut)return this.__runAnimation(`out`,()=>qa(this,e,t,n))}else n===0&&!0===t&&this.animation&&this.__runAnimation(`in`);qa(this,e,t,n),this.mask&&Ka(this)}}))}function Ka(e){let{parent:t}=e;if(t){let{__hasMask:e}=t;t.__updateMask(),e!==t.__hasMask&&t.forceUpdate()}}function qa(e,t,n,r){e.__setAttr(t,n)&&(e.__layout.opacityChanged||e.__layout.opacityChange(),r!==0&&n!==0||Ia(e))}function Ja(e){return z(e,e=>({set(t){this.__setAttr(e,t)&&this.waitParent(()=>{this.parent.__layout.childrenSortChange()})}}))}function Ya(e){return z(e,e=>({set(t){this.__setAttr(e,t)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(t)}))}}))}function Xa(e){return z(e,e=>({set(t){this.__setAttr(e,t)&&this.waitParent(()=>{this.parent.__updateEraser(t)})}}))}function Za(e){return z(e,e=>({set(t){this.__setAttr(e,t)&&(this.__layout.hitCanvasChanged=!0,this.leafer&&this.leafer.updateCursor())}}))}function Qa(e){return z(e,e=>({set(t){this.__setAttr(e,t),this.leafer&&this.leafer.updateCursor()}}))}function U(e){return(t,n)=>{Ta(t,`__DataProcessor`,{get:()=>e})}}function $a(e){return(t,n)=>{Ta(t,`__LayoutProcessor`,{get:()=>e})}}function eo(e,t,r){let i=e.__DataProcessor.prototype,a=`_`+t,o=function(e){return`set`+e.charAt(0).toUpperCase()+e.slice(1)}(t),s=Da(t,r);if(n(r))s.get=function(){return this[a]};else if(typeof r==`function`)s.get=function(){return this[a]??r(this.__leaf)};else if(u(r)){let e=f(r);s.get=function(){return this[a]??(this[a]=e?{}:p.clone(r))}}let c=e.isBranchLeaf;t===`width`?s.get=function(){let e=this[a];if(e==null){let e=this,t=e.__naturalWidth,n=e.__leaf;return!r||n.pathInputed?n.boxBounds.width:t?e._height&&e.__useNaturalRatio?e._height*t/e.__naturalHeight:t:c&&n.children.length?n.boxBounds.width:r}return e}:t===`height`&&(s.get=function(){let e=this[a];if(e==null){let e=this,t=e.__naturalHeight,n=e.__leaf;return!r||n.pathInputed?n.boxBounds.height:t?e._width&&e.__useNaturalRatio?e._width*t/e.__naturalWidth:t:c&&n.children.length?n.boxBounds.height:r}return e});let l,d=i;for(;!l&&d;)l=Ea(d,t),d=d.__proto__;l&&l.set&&(s.set=l.set),i[o]&&(s.set=i[o],delete i[o]),Ta(i,t,s)}var to=new N(`rewrite`),no=[],ro=[`destroy`,`constructor`];function io(e){return(t,n)=>{no.push({name:t.constructor.name+`.`+n,run:()=>{t[n]=e}})}}function ao(){return e=>{oo()}}function oo(e){no.length&&=(no.forEach(t=>{e&&to.error(t.name,`需在Class上装饰@rewriteAble()`),t.run()}),0)}function so(e,t){return n=>{var r;(e.prototype?(r=e.prototype,Object.getOwnPropertyNames(r)):Object.keys(e)).forEach(r=>{ro.includes(r)||t&&t.includes(r)||(e.prototype?Ea(e.prototype,r).writable&&(n.prototype[r]=e.prototype[r]):n.prototype[r]=e[r])})}}function W(){return e=>{Mt.register(e)}}function co(){return e=>{Ft.register(e)}}setTimeout(()=>oo(!0));var{copy:lo,toInnerPoint:uo,toOuterPoint:fo,scaleOfOuter:po,rotateOfOuter:mo,skewOfOuter:ho,multiplyParent:go,divideParent:_o,getLayout:vo}=D,G={},{round:yo}=Math,bo={updateAllMatrix(e,t,n){if(t&&e.__hasAutoLayout&&e.__layout.matrixChanged&&(n=!0),So(e,t,n),e.isBranch){let{children:r}=e;for(let e=0,i=r.length;e<i;e++)xo(r[e],t,n)}},updateMatrix(e,t,n){let r=e.__layout;t?n&&(r.waitAutoLayout=!0,e.__hasAutoLayout&&(r.matrixChanged=!1)):r.waitAutoLayout&&=!1,r.matrixChanged&&e.__updateLocalMatrix(),r.waitAutoLayout||e.__updateWorldMatrix()},updateBounds(e){let t=e.__layout;t.boundsChanged&&e.__updateLocalBounds(),t.waitAutoLayout||e.__updateWorldBounds()},updateAllWorldOpacity(e){if(e.__updateWorldOpacity(),e.isBranch){let{children:t}=e;for(let e=0,n=t.length;e<n;e++)Co(t[e])}},updateChange(e){let t=e.__layout;t.stateStyleChanged&&e.updateState(),t.opacityChanged&&Co(e),e.__updateChange(),t.surfaceChanged&&=(e.__hasComplex&&K.updateComplex(e),!1)},updateAllChange(e){if(To(e),e.isBranch){let{children:t}=e;for(let e=0,n=t.length;e<n;e++)wo(t[e])}},worldHittable(e){for(;e;){if(!e.__.hittable)return!1;e=e.parent}return!0},draggable:e=>(e.draggable||e.editable)&&e.hitSelf&&!e.locked,copyCanvasByWorld(e,t,n,r,i,a){r||=e.__nowWorld,e.__worldFlipped||M.fullImageShadow?t.copyWorldByReset(n,r,e.__nowWorld,i,a):t.copyWorldToInner(n,r,e.__layout.renderBounds,i)},renderComplex(e,t,n){},updateComplex(e){},checkComplex(e){},moveWorld(e,t,n=0,r,i){let a=u(t)?Object.assign({},t):{x:t,y:n};r?fo(e.localTransform,a,a,!0):e.parent&&uo(e.parent.scrollWorldTransform,a,a,!0),K.moveLocal(e,a.x,a.y,i)},moveLocal(e,t,n=0,r){u(t)&&(n=t.y,t=t.x),t+=e.x,n+=e.y,e.leafer&&e.leafer.config.pointSnap&&(t=yo(t),n=yo(n)),r?e.animate({x:t,y:n},r):(e.x=t,e.y=n)},zoomOfWorld(e,t,n,r,i,a){K.zoomOfLocal(e,Eo(e,t),n,r,i,a)},zoomOfLocal(e,t,n,r=n,i,a){let s=e.__localMatrix;if(o(r)||(r&&(a=r),r=n),lo(G,s),po(G,t,n,r),K.hasHighPosition(e))K.setTransform(e,G,i,a);else{let t=e.x+G.e-s.e,o=e.y+G.f-s.f;a&&!i?e.animate({x:t,y:o,scaleX:e.scaleX*n,scaleY:e.scaleY*r},a):(e.x=t,e.y=o,e.scaleResize(n,r,!0!==i))}},rotateOfWorld(e,t,n,r){K.rotateOfLocal(e,Eo(e,t),n,r)},rotateOfLocal(e,t,n,r){let i=e.__localMatrix;lo(G,i),mo(G,t,n),K.hasHighPosition(e)?K.setTransform(e,G,!1,r):e.set({x:e.x+G.e-i.e,y:e.y+G.f-i.f,rotation:T.formatRotation(e.rotation+n)},r)},skewOfWorld(e,t,n,r,i,a){K.skewOfLocal(e,Eo(e,t),n,r,i,a)},skewOfLocal(e,t,n,r=0,i,a){lo(G,e.__localMatrix),ho(G,t,n,r),K.setTransform(e,G,i,a)},transformWorld(e,t,n,r){lo(G,e.worldTransform),go(G,t),e.parent&&_o(G,e.parent.scrollWorldTransform),K.setTransform(e,G,n,r)},transform(e,t,n,r){lo(G,e.localTransform),go(G,t),K.setTransform(e,G,n,r)},setTransform(e,t,n,r){let i=e.__,a=i.origin&&K.getInnerOrigin(e,i.origin),o=vo(t,a,i.around&&K.getInnerOrigin(e,i.around));if(K.hasOffset(e)&&(o.x-=i.offsetX,o.y-=i.offsetY),n){let t=o.scaleX/e.scaleX,n=o.scaleY/e.scaleY;if(delete o.scaleX,delete o.scaleY,a){A.scale(e.boxBounds,Math.abs(t),Math.abs(n));let r=K.getInnerOrigin(e,i.origin);k.move(o,a.x-r.x,a.y-r.y)}e.set(o),e.scaleResize(t,n,!1)}else e.set(o,r)},getFlipTransform(e,t){let n={a:1,b:0,c:0,d:1,e:0,f:0},r=t===`x`?1:-1;return po(n,K.getLocalOrigin(e,`center`),-1*r,1*r),n},getLocalOrigin:(e,t)=>k.tempToOuterOf(K.getInnerOrigin(e,t),e.localTransform),getInnerOrigin(e,t){let n={};return Ke.toPoint(t,e.boxBounds,n),n},getRelativeWorld:(e,t,n)=>(lo(G,e.worldTransform),_o(G,t.scrollWorldTransform),n?G:Object.assign({},G)),updateScaleFixedWorld(e){},updateOuterBounds(e){},cacheId(e){},drop(e,t,n,r){e.setTransform(K.getRelativeWorld(e,t,!0),r),t.add(e,n)},hasHighPosition:e=>e.origin||e.around||K.hasOffset(e),hasOffset:e=>e.offsetX||e.offsetY,hasParent(e,t){if(!t)return!1;for(;e;){if(t===e)return!0;e=e.parent}},animateMove(e,t,n=.3){if(t.x||t.y)if(Math.abs(t.x)<1&&Math.abs(t.y)<1)e.move(t);else{let r=t.x*n,i=t.y*n;t.x-=r,t.y-=i,e.move(r,i),M.requestRender(()=>K.animateMove(e,t,n))}}},K=bo,{updateAllMatrix:xo,updateMatrix:So,updateAllWorldOpacity:Co,updateAllChange:wo,updateChange:To}=K;function Eo(e,t){return e.updateLayout(),e.parent?k.tempToInnerOf(t,e.parent.scrollWorldTransform):t}var Do={worldBounds:e=>e.__world,localBoxBounds:e=>e.__.eraser||e.__.visible===0?null:e.__local||e.__layout,localStrokeBounds:e=>e.__.eraser||e.__.visible===0?null:e.__layout.localStrokeBounds,localRenderBounds(e){let{__:t,__layout:n}=e;return t.eraser||t.visible===0?null:n.localOuterBounds||n.localRenderBounds},maskLocalBoxBounds:(e,t)=>ko(e,t)&&e.__localBoxBounds,maskLocalStrokeBounds:(e,t)=>ko(e,t)&&e.__layout.localStrokeBounds,maskLocalRenderBounds(e,t){let{__layout:n}=e;return ko(e,t)&&(n.localOuterBounds||n.localRenderBounds)},excludeRenderBounds:(e,t)=>!(!t.bounds||t.bounds.hit(e.__world,t.matrix))||!(!t.hideBounds||!t.hideBounds.includes(e.__world,t.matrix))},Oo;function ko(e,t){return t||(Oo=0),e.__.mask&&(Oo=1),Oo<0?null:(Oo&&=-1,!0)}var{updateBounds:Ao}=bo,jo={sort:(e,t)=>e.__.zIndex===t.__.zIndex?e.__tempNumber-t.__tempNumber:e.__.zIndex-t.__.zIndex,pushAllChildBranch(e,t){if(e.__tempNumber=1,e.__.__childBranchNumber){let{children:n}=e;for(let r=0,i=n.length;r<i;r++)(e=n[r]).isBranch&&(e.__tempNumber=1,t.add(e),Mo(e,t))}},pushAllParent(e,t){let{keys:r}=t;if(r)for(;e.parent&&n(r[e.parent.innerId]);)t.add(e.parent),e=e.parent;else for(;e.parent;)t.add(e.parent),e=e.parent},pushAllBranchStack(e,t){let n=t.length,{children:r}=e;for(let e=0,n=r.length;e<n;e++)r[e].isBranch&&t.push(r[e]);for(let e=n,r=t.length;e<r;e++)No(t[e],t)},updateBounds(e,t){let n=[e];No(e,n),Po(n,t)},updateBoundsByBranchStack(e,t){let n,r;for(let i=e.length-1;i>-1;i--){n=e[i],r=n.children;for(let e=0,t=r.length;e<t;e++)Ao(r[e]);t&&t===n||Ao(n)}},move(e,t,n){let r,{children:i}=e;for(let a=0,o=i.length;a<o;a++)r=(e=i[a]).__world,r.e+=t,r.f+=n,r.x+=t,r.y+=n,e.isBranch&&Fo(e,t,n)},scale(e,t,n,r,i,a,o){let s,{children:c}=e,l=r-1,u=i-1;for(let d=0,f=c.length;d<f;d++)s=(e=c[d]).__world,s.a*=r,s.d*=i,(s.b||s.c)&&(s.b*=r,s.c*=i),s.e===s.x&&s.f===s.y?(s.x=s.e+=(s.e-a)*l+t,s.y=s.f+=(s.f-o)*u+n):(s.e+=(s.e-a)*l+t,s.f+=(s.f-o)*u+n,s.x+=(s.x-a)*l+t,s.y+=(s.y-o)*u+n),s.width*=r,s.height*=i,s.scaleX*=r,s.scaleY*=i,e.isBranch&&Io(e,t,n,r,i,a,o)}},{pushAllChildBranch:Mo,pushAllBranchStack:No,updateBoundsByBranchStack:Po,move:Fo,scale:Io}=jo,Lo={run(e){if(e&&e.length){let t=e.length;for(let n=0;n<t;n++)e[n]();e.length===t?e.length=0:e.splice(0,t)}}},{getRelativeWorld:Ro,updateBounds:zo}=bo,{toOuterOf:Bo,getPoints:Vo,copy:Ho}=A,Uo=`_localContentBounds`,Wo=`_worldContentBounds`,Go=`_worldBoxBounds`,Ko=`_worldStrokeBounds`,qo=class{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(e){this._contentBounds=e}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(e){this._renderBounds=e}get localContentBounds(){return Bo(this.contentBounds,this.leaf.__localMatrix,this[Uo]||(this[Uo]={})),this[Uo]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return Bo(this.contentBounds,this.leaf.__world,this[Wo]||(this[Wo]={})),this[Wo]}get worldBoxBounds(){return Bo(this.boxBounds,this.leaf.__world,this[Go]||(this[Go]={})),this[Go]}get worldStrokeBounds(){return Bo(this.strokeBounds,this.leaf.__world,this[Ko]||(this[Ko]={})),this[Ko]}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(e){this.leaf=e,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),e.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){let e=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||=e,this._localRenderBounds||=e}update(){let{leaf:e}=this,{leafer:t}=e;if(e.isApp)return zo(e);if(t)t.ready?t.watcher.changed&&t.layouter.layout():t.start();else{let t=e;for(;t.parent&&!t.parent.leafer;)t=t.parent;let n=t;if(n.__fullLayouting)return;n.__fullLayouting=!0,M.layout(n),delete n.__fullLayouting}}getTransform(e=`world`){this.update();let{leaf:t}=this;switch(e){case`world`:return t.__world;case`local`:return t.__localMatrix;case`inner`:return D.defaultMatrix;case`page`:e=t.zoomLayer;default:return Ro(t,e)}}getBounds(e,t=`world`){switch(this.update(),t){case`world`:return this.getWorldBounds(e);case`local`:return this.getLocalBounds(e);case`inner`:return this.getInnerBounds(e);case`page`:t=this.leaf.zoomLayer;default:return new mt(this.getInnerBounds(e)).toOuterOf(this.getTransform(t))}}getInnerBounds(e=`box`){switch(e){case`render`:return this.renderBounds;case`content`:if(this.contentBounds)return this.contentBounds;case`box`:return this.boxBounds;case`stroke`:return this.strokeBounds}}getLocalBounds(e=`box`){switch(e){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(e=`box`){switch(e){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(e,t=`world`,n){let{leaf:r}=this,i,a,o,s=this.getInnerBounds(e);switch(t){case`world`:i=r.getWorldPoint(s),a=r.__world;break;case`local`:let{scaleX:e,scaleY:n,rotation:c,skewX:l,skewY:u}=r.__;o={scaleX:e,scaleY:n,rotation:c,skewX:l,skewY:u},i=r.getLocalPointByInner(s);break;case`inner`:i=s,a=D.defaultMatrix;break;case`page`:t=r.zoomLayer;default:i=r.getWorldPoint(s,t),a=Ro(r,t,!0)}if(o||=D.getLayout(a),Ho(o,s),k.copy(o,i),n){let{scaleX:e,scaleY:t}=o,n=Math.abs(e),r=Math.abs(t);n===1&&r===1||(o.scaleX/=n,o.scaleY/=r,o.width*=n,o.height*=r)}return o}getLayoutPoints(e,t=`world`){let{leaf:r}=this,i=Vo(this.getInnerBounds(e)),a;switch(t){case`world`:a=null;break;case`local`:a=r.parent;break;case`inner`:break;case`page`:t=r.zoomLayer;default:a=t}return n(a)||i.forEach(e=>r.innerToWorld(e,null,!1,a)),i}shrinkContent(){let{x:e,y:t,width:n,height:r}=this.boxBounds;this._contentBounds={x:e,y:t,width:n,height:r}}spreadStroke(){let{x:e,y:t,width:n,height:r}=this.strokeBounds;this._strokeBounds={x:e,y:t,width:n,height:r},this._localStrokeBounds={x:e,y:t,width:n,height:r},this.renderSpread||this.spreadRenderCancel()}spreadRender(){let{x:e,y:t,width:n,height:r}=this.renderBounds;this._renderBounds={x:e,y:t,width:n,height:r},this._localRenderBounds={x:e,y:t,width:n,height:r}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){let e=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,e&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged?this.boundsChanged||=!0:this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||=1,this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,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||=!0:this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate(`surface`))}destroy(){}},Jo=class{constructor(e,t){this.bubbles=!1,this.type=e,t&&(this.target=t)}stopDefault(){this.isStopDefault=!0,this.origin&&M.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&M.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&M.event.stop(this.origin)}},q=class extends Jo{constructor(e,t,n){super(e,t),this.parent=n,this.child=t}};q.ADD=`child.add`,q.REMOVE=`child.remove`,q.CREATED=`created`,q.MOUNTED=`mounted`,q.UNMOUNTED=`unmounted`,q.DESTROY=`destroy`;var Yo=`property.scroll`,Xo=class extends Jo{constructor(e,t,n,r,i){super(e,t),this.attrName=n,this.oldValue=r,this.newValue=i}};Xo.CHANGE=`property.change`,Xo.LEAFER_CHANGE=`property.leafer_change`,Xo.SCROLL=Yo;var Zo={scrollX:Yo,scrollY:Yo},Qo=class extends Jo{constructor(e,t){super(e),Object.assign(this,t)}};Qo.LOAD=`image.load`,Qo.LOADED=`image.loaded`,Qo.ERROR=`image.error`;var $o=class extends Jo{static checkHas(e,t,n){n===`on`?t===rs?e.__hasWorldEvent=!0:e.__hasLocalEvent=!0:(e.__hasLocalEvent=e.hasEvent(es)||e.hasEvent(ts)||e.hasEvent(ns),e.__hasWorldEvent=e.hasEvent(rs))}static emitLocal(e){if(e.leaferIsReady){let{resized:t}=e.__layout;t!==`local`&&(e.emit(es,e),t===`inner`&&e.emit(ts,e)),e.emit(ns,e)}}static emitWorld(e){e.leaferIsReady&&e.emit(rs,e)}};$o.RESIZE=`bounds.resize`,$o.INNER=`bounds.inner`,$o.LOCAL=`bounds.local`,$o.WORLD=`bounds.world`;var{RESIZE:es,INNER:ts,LOCAL:ns,WORLD:rs}=$o,is={};[es,ts,ns,rs].forEach(e=>is[e]=1);var as=class e extends Jo{get bigger(){if(!this.old)return!0;let{width:e,height:t}=this.old;return this.width>=e&&this.height>=t}get smaller(){return!this.bigger}get samePixelRatio(){return!this.old||this.pixelRatio===this.old.pixelRatio}constructor(t,n){u(t)?(super(e.RESIZE),Object.assign(this,t)):super(t),this.old=n}static isResizing(e){return this.resizingKeys&&!n(this.resizingKeys[e.innerId])}};as.RESIZE=`resize`;var os=class extends Jo{constructor(e,t){super(e),this.data=t}};os.REQUEST=`watch.request`,os.DATA=`watch.data`;var ss=class extends Jo{constructor(e,t,n){super(e),t&&(this.data=t,this.times=n)}};ss.REQUEST=`layout.request`,ss.START=`layout.start`,ss.BEFORE=`layout.before`,ss.LAYOUT=`layout`,ss.AFTER=`layout.after`,ss.AGAIN=`layout.again`,ss.END=`layout.end`;var cs=class extends Jo{constructor(e,t,n,r){super(e),t&&(this.times=t),n&&(this.renderBounds=n,this.renderOptions=r)}};cs.REQUEST=`render.request`,cs.CHILD_START=`render.child_start`,cs.CHILD_END=`render.child_end`,cs.START=`render.start`,cs.BEFORE=`render.before`,cs.RENDER=`render`,cs.AFTER=`render.after`,cs.AGAIN=`render.again`,cs.END=`render.end`,cs.NEXT=`render.next`;var J=class extends Jo{};J.START=`leafer.start`,J.BEFORE_READY=`leafer.before_ready`,J.READY=`leafer.ready`,J.AFTER_READY=`leafer.after_ready`,J.VIEW_READY=`leafer.view_ready`,J.VIEW_COMPLETED=`leafer.view_completed`,J.STOP=`leafer.stop`,J.RESTART=`leafer.restart`,J.END=`leafer.end`,J.UPDATE_MODE=`leafer.update_mode`,J.TRANSFORM=`leafer.transform`,J.MOVE=`leafer.move`,J.SCALE=`leafer.scale`,J.ROTATE=`leafer.rotate`,J.SKEW=`leafer.skew`;var{MOVE:ls,SCALE:us,ROTATE:ds,SKEW:fs}=J,ps={x:ls,y:ls,scaleX:us,scaleY:us,rotation:ds,skewX:fs,skewY:fs},ms={},hs=class{set event(e){this.on(e)}on(e,t,n){if(!t){let t;if(l(e))e.forEach(e=>this.on(e[0],e[1],e[2]));else for(let n in e)l(t=e[n])?this.on(n,t[0],t[1]):this.on(n,t);return}let r,a,o;n&&(n===`once`?a=!0:typeof n==`boolean`?r=n:(r=n.capture,a=n.once));let s=gs(this,r,!0),c=i(e)?e.split(` `):e,u=a?{listener:t,once:a}:{listener:t};c.forEach(e=>{e&&(o=s[e],o?o.findIndex(e=>e.listener===t)===-1&&o.push(u):s[e]=[u],is[e]&&$o.checkHas(this,e,`on`))})}off(e,t,n){if(e){let r=i(e)?e.split(` `):e;if(t){let e,i,a;n&&(e=typeof n==`boolean`?n:n!==`once`&&n.capture);let o=gs(this,e);r.forEach(e=>{e&&(i=o[e],i&&(a=i.findIndex(e=>e.listener===t),a>-1&&i.splice(a,1),i.length||delete o[e],is[e]&&$o.checkHas(this,e,`off`)))})}else{let{__bubbleMap:e,__captureMap:t}=this;r.forEach(n=>{e&&delete e[n],t&&delete t[n]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(e,t,n,r){return t?this.on(e,n?t=t.bind(n):t,r):l(e)&&e.forEach(e=>this.on(e[0],e[2]?e[1]=e[1].bind(e[2]):e[1],e[3])),{type:e,current:this,listener:t,options:r}}off_(e){if(!e)return;let t=l(e)?e:[e];t.forEach(e=>{e&&(e.listener?e.current.off(e.type,e.listener,e.options):l(e.type)&&e.type.forEach(t=>e.current.off(t[0],t[1],t[3])))}),t.length=0}once(e,t,n,r){if(!t)return l(e)&&e.forEach(e=>this.once(e[0],e[1],e[2],e[3]));u(n)?t=t.bind(n):r=n,this.on(e,t,{once:!0,capture:r})}emit(e,t,n){!t&&Ft.has(e)&&(t=Ft.get(e,{type:e,target:this,current:this}));let r=gs(this,n)[e];if(r){let i;for(let a=0,o=r.length;a<o&&!((i=r[a])&&(i.listener(t),i.once&&(this.off(e,i.listener,n),a--,o--),t&&t.isStopNow));a++);}this.syncEventer&&this.syncEventer.emitEvent(t,n)}emitEvent(e,t){e.current=this,this.emit(e.type,e,t)}hasEvent(e,t){if(this.syncEventer&&this.syncEventer.hasEvent(e,t))return!0;let{__bubbleMap:r,__captureMap:i}=this,a=r&&r[e],o=i&&i[e];return!!(n(t)?a||o:t?o:a)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}};function gs(e,t,n){if(t){let{__captureMap:t}=e;return t||(n?e.__captureMap={}:ms)}{let{__bubbleMap:t}=e;return t||(n?e.__bubbleMap={}:ms)}}var{on:_s,on_:vs,off:ys,off_:bs,once:xs,emit:Ss,emitEvent:Cs,hasEvent:ws,destroy:Ts}=hs.prototype,Es={on:_s,on_:vs,off:ys,off_:bs,once:xs,emit:Ss,emitEvent:Cs,hasEvent:ws,destroyEventer:Ts},Ds=N.get(`setAttr`),Os={__setAttr(e,t,r){if(this.leaferIsCreated){let i=this.__.__getInput(e);if(!r||a(t)||n(t)||(Ds.warn(this.innerName,e,t),t=void 0),u(t)||i!==t){if(this.__realSetAttr(e,t),this.isLeafer){this.emitEvent(new Xo(Xo.LEAFER_CHANGE,this,e,i,t));let n=ps[e];n&&(this.emitEvent(new J(n,this)),this.emitEvent(new J(J.TRANSFORM,this)))}this.emitPropertyEvent(Xo.CHANGE,e,i,t);let n=Zo[e];return n&&this.emitPropertyEvent(n,e,i,t),!0}return!1}return this.__realSetAttr(e,t),!0},emitPropertyEvent(e,t,n,r){let i=new Xo(e,this,t,n,r);this.isLeafer||this.hasEvent(e)&&this.emitEvent(i),this.leafer.emitEvent(i)},__realSetAttr(e,t){let r=this.__;r[e]=t,this.__proxyData&&this.setProxyAttr(e,t),r.normalStyle&&(this.lockNormalStyle||n(r.normalStyle[e])||(r.normalStyle[e]=t))},__getAttr(e){return this.__proxyData?this.getProxyAttr(e):this.__.__get(e)}},{setLayout:ks,multiplyParent:As,translateInner:js,defaultWorld:Ms}=D,{toPoint:Ns,tempPoint:Ps}=Ke,Fs={__updateWorldMatrix(){let{parent:e,__layout:t,__world:n,__scrollWorld:r,__:i}=this;As(this.__local||t,e?e.__scrollWorld||e.__world:Ms,n,!!t.affectScaleOrRotation,i),r&&js(Object.assign(r,n),i.scrollX,i.scrollY),t.scaleFixed&&bo.updateScaleFixedWorld(this)},__updateLocalMatrix(){if(this.__local){let e=this.__layout,t=this.__local,n=this.__;e.affectScaleOrRotation&&(e.scaleChanged&&(e.resized||=`scale`)||e.rotationChanged)&&(ks(t,n,null,null,e.affectRotation),e.scaleChanged=e.rotationChanged=void 0),t.e=n.x+n.offsetX,t.f=n.y+n.offsetY,(n.around||n.origin)&&(Ns(n.around||n.origin,e.boxBounds,Ps),js(t,-Ps.x,-Ps.y,!n.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:Is,updateAllMatrix:Ls}=bo,{updateBounds:Rs}=jo,{toOuterOf:zs,copyAndSpread:Bs,copy:Vs}=A,{toBounds:Hs}=Qi,Us={__updateWorldBounds(){let{__layout:e,__world:t}=this;zs(e.renderBounds,t,t),this.__hasComplex&&bo.checkComplex(this),e.resized&&=(e.resized===`inner`&&this.__onUpdateSize(),this.__hasLocalEvent&&$o.emitLocal(this),void 0),this.__hasWorldEvent&&$o.emitWorld(this)},__updateLocalBounds(){let e=this.__layout,t=this.__;e.boxChanged&&(t.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),e.resized=`inner`),e.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),e.localBoxChanged=void 0,e.strokeSpread&&!e.strokeChanged&&(e.strokeChanged=!!e.boxChanged||2),e.renderSpread&&!e.renderChanged&&(e.renderChanged=!!e.boxChanged||2),this.parent&&this.parent.__layout.boxChange()),e.boxChanged=void 0,e.strokeChanged&&(e.strokeChanged===2?this.__updateLocalStrokeBounds():(e.strokeSpread=this.__updateStrokeSpread(),e.strokeSpread?(e.strokeBounds===e.boxBounds&&e.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):e.spreadStrokeCancel(),e.resized=`inner`,(e.renderSpread||e.strokeSpread!==e.strokeBoxSpread)&&(e.renderChanged=!0)),e.strokeChanged=void 0,this.parent&&this.parent.__layout.strokeChange()),e.renderChanged&&(e.renderChanged===2?this.__updateLocalRenderBounds():(e.renderSpread=this.__updateRenderSpread(),e.renderSpread?(e.renderBounds!==e.boxBounds&&e.renderBounds!==e.strokeBounds||e.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):e.spreadRenderCancel()),e.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),e.outerScale&&bo.updateOuterBounds(this),e.resized||=`local`,e.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),zs(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){zs(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){zs(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(e,t){let n=this.__layout.boxBounds,r=this.__;r.__usePathBox?Hs(r.path,n):(n.x=0,n.y=0,n.width=r.width,n.height=r.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),Ls(this),Rs(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(Ls(this),Rs(this,this))):Is(this)},__updateNaturalSize(){let{__:e,__layout:t}=this;e.__naturalWidth=t.boxBounds.width,e.__naturalHeight=t.boxBounds.height},__updateStrokeBounds(e){let t=this.__layout;Bs(t.strokeBounds,t.boxBounds,t.strokeBoxSpread)},__updateRenderBounds(e){let t=this.__layout,{renderSpread:n}=t;o(n)&&n<=0?Vs(t.renderBounds,t.strokeBounds):Bs(t.renderBounds,t.boxBounds,n)}},Ws={__render(e,t){if(t.shape)return this.__renderShape(e,t);if((!t.cellList||t.cellList.has(this))&&this.__worldOpacity){let n=this.__;if(n.bright&&!t.topRendering)return t.topList.add(this);if(e.setWorld(this.__nowWorld=this.__getNowWorld(t)),e.opacity=t.ignoreOpacity?1:t.dimOpacity&&!n.dimskip?n.opacity*t.dimOpacity:n.opacity,this.__.__single){if(n.eraser===`path`)return this.__renderEraser(e,t);let r=e.getSameCanvas(!0,!0);this.__draw(r,t,e),bo.copyCanvasByWorld(this,e,r,this.__nowWorld,n.__blendMode,!0),r.recycle(this.__nowWorld)}else this.__draw(e,t);N.showBounds&&N.drawBounds(this,e,t)}},__renderShape(e,t){this.__worldOpacity&&(e.setWorld(this.__nowWorld=this.__getNowWorld(t)),this.__drawShape(e,t))},__clip(e,t){this.__worldOpacity&&(e.setWorld(this.__nowWorld=this.__getNowWorld(t)),this.__drawRenderPath(e),e.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:Gs}=Do,{hasSize:Ks}=A,qs={__updateChange(){let{__layout:e}=this;e.childrenSortChanged&&=(this.__updateSortChildren(),!1),this.__.__checkSingle()},__render(e,t){let n=this.__nowWorld=this.__getNowWorld(t);if(this.__worldOpacity&&Ks(n)){let r=this.__;if(r.__useDim)if(r.dim)t.dimOpacity=!0===r.dim?.2:r.dim;else{if(r.bright&&!t.topRendering)return t.topList.add(this);r.dimskip&&t.dimOpacity&&(t.dimOpacity=0)}if(r.__single&&!this.isBranchLeaf){if(r.eraser===`path`)return this.__renderEraser(e,t);let i=e.getSameCanvas(!1,!0);this.__renderBranch(i,t),e.opacity=t.ignoreOpacity?1:t.dimOpacity?r.opacity*t.dimOpacity:r.opacity,e.copyWorldByReset(i,n,n,r.__blendMode,!0),i.recycle(n)}else this.__renderBranch(e,t)}},__renderBranch(e,t){if(this.__hasMask)this.__renderMask(e,t);else{let n,{children:r}=this;for(let i=0,a=r.length;i<a;i++)n=r[i],Gs(n,t)||(n.__hasComplex?bo.renderComplex(n,e,t):n.__render(e,t))}},__clip(e,t){if(this.__worldOpacity){let{children:n}=this;for(let r=0,i=n.length;r<i;r++)Gs(n[r],t)||n[r].__clip(e,t)}}},{LEAF:Js,create:Ys}=g,{stintSet:Xs}=p,{toInnerPoint:Zs,toOuterPoint:Qs,multiplyParent:$s}=D,{toOuterOf:ec}=A,{copy:tc,move:nc}=k,{getScaleFixedData:rc}=T,{moveLocal:ic,zoomOfLocal:ac,rotateOfLocal:oc,skewOfLocal:sc,moveWorld:cc,zoomOfWorld:lc,rotateOfWorld:uc,skewOfWorld:dc,transform:fc,transformWorld:pc,setTransform:mc,getFlipTransform:hc,getLocalOrigin:gc,getRelativeWorld:_c,drop:vc}=bo,yc=class{get tag(){return this.__tag}set tag(e){}get __tag(){return`Leaf`}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return h}get __LayoutProcessor(){return qo}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(e){this.on(e)}constructor(e){this.innerId=Ys(Js),this.reset(e),this.__bubbleMap&&this.__emitLifeEvent(q.CREATED)}reset(e){this.leafer&&this.leafer.forceRender(this.__world),e!==0&&(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},e!==null&&(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(),e&&(e.__&&(e=e.toJSON()),e.children?this.set(e):Object.assign(this,e))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(e,t){t&&(e=e.bind(t)),this.parent?e():this.on(q.ADD,e,`once`)}waitLeafer(e,t){t&&(e=e.bind(t)),this.leafer?e():this.on(q.MOUNTED,e,`once`)}nextRender(e,t,n){this.leafer?this.leafer.nextRender(e,t,n):this.waitLeafer(()=>this.leafer.nextRender(e,t,n))}removeNextRender(e){this.nextRender(e,null,`off`)}__bindLeafer(e){if(this.isLeafer&&e!==null&&(e=this),this.leafer&&!e&&this.leafer.leafs--,this.leafer=e,e?(e.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation(`in`),this.__bubbleMap&&this.__emitLifeEvent(q.MOUNTED),e.cacheId&&bo.cacheId(this)):this.__emitLifeEvent(q.UNMOUNTED),this.isBranch){let{children:t}=this;for(let n=0,r=t.length;n<r;n++)t[n].__bindLeafer(e)}}set(e,t){}get(e){}setAttr(e,t){this[e]=t}getAttr(e){return this[e]}getComputedAttr(e){return this.__[e]}toJSON(e){return e&&this.__layout.update(),this.__.__getInputData(null,e)}toString(e){return JSON.stringify(this.toJSON(e))}toSVG(){}__SVG(e){}toHTML(){}__setAttr(e,t){return!0}__getAttr(e){}setProxyAttr(e,t){}getProxyAttr(e){}find(e,t){}findTag(e){}findOne(e,t){}findId(e){}focus(e){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(e){n(e)?e=`width`:e===`surface`&&(e=`blendMode`);let t=this.__.__getInput(e);this.__[e]=n(t)?null:void 0,this[e]=t}forceRender(e,t){this.forceUpdate(`surface`)}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(e,t){}__updateContentBounds(){}__updateStrokeBounds(e){}__updateRenderBounds(e){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(e){this.__hasEraser=!!e||this.children.some(e=>e.__.eraser)}__renderEraser(e,t){e.save(),this.__clip(e,t);let{renderBounds:n}=this.__layout;e.clearRect(n.x,n.y,n.width,n.height),e.restore()}__updateMask(e){this.__hasMask=this.children.some(e=>e.__.mask&&e.__.visible&&e.__.opacity)}__renderMask(e,t){}__getNowWorld(e){if(e.matrix){this.__cameraWorld||={};let t=this.__cameraWorld,n=this.__world;return $s(n,e.matrix,t,void 0,n),ec(this.__layout.renderBounds,t,t),Xs(t,`half`,n.half),Xs(t,`ignorePixelSnap`,n.ignorePixelSnap),t}return this.__world}getClampRenderScale(){let{scaleX:e}=this.__nowWorld||this.__world;return e<0&&(e=-e),e>1?e:1}getRenderScaleData(e,t,n=!0){return rc(va.patternLocked?this.__world:this.__nowWorld||this.__world,t,n,e)}getTransform(e){return this.__layout.getTransform(e||`local`)}getBounds(e,t){return this.__layout.getBounds(e,t)}getLayoutBounds(e,t,n){return this.__layout.getLayoutBounds(e,t,n)}getLayoutPoints(e,t){return this.__layout.getLayoutPoints(e,t)}getWorldBounds(e,t,n){let r=t?_c(this,t):this.worldTransform,i=n?e:{};return ec(e,r,i),i}worldToLocal(e,t,n,r){this.parent?this.parent.worldToInner(e,t,n,r):t&&tc(t,e)}localToWorld(e,t,n,r){this.parent?this.parent.innerToWorld(e,t,n,r):t&&tc(t,e)}worldToInner(e,t,n,r){r&&(r.innerToWorld(e,t,n),e=t||e),Zs(this.worldTransform,e,t,n)}innerToWorld(e,t,n,r){Qs(this.worldTransform,e,t,n),r&&r.worldToInner(t||e,null,n)}getBoxPoint(e,t,n,r){let i=this.getInnerPoint(e,t,n,r);return n?i:this.getBoxPointByInner(i,null,null,!0)}getBoxPointByInner(e,t,n,r){let i=r?e:Object.assign({},e),{x:a,y:o}=this.boxBounds;return nc(i,-a,-o),i}getInnerPoint(e,t,n,r){let i=r?e:{};return this.worldToInner(e,i,n,t),i}getInnerPointByBox(e,t,n,r){let i=r?e:Object.assign({},e),{x:a,y:o}=this.boxBounds;return nc(i,a,o),i}getInnerPointByLocal(e,t,n,r){return this.getInnerPoint(e,this.parent,n,r)}getLocalPoint(e,t,n,r){let i=r?e:{};return this.worldToLocal(e,i,n,t),i}getLocalPointByInner(e,t,n,r){return this.getWorldPoint(e,this.parent,n,r)}getPagePoint(e,t,n,r){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(e,t,n,r)}getWorldPoint(e,t,n,r){let i=r?e:{};return this.innerToWorld(e,i,n,t),i}getWorldPointByBox(e,t,n,r){return this.getWorldPoint(this.getInnerPointByBox(e,null,null,r),t,n,!0)}getWorldPointByLocal(e,t,n,r){let i=r?e:{};return this.localToWorld(e,i,n,t),i}getWorldPointByPage(e,t,n,r){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(e,t,n,r)}setTransform(e,t,n){mc(this,e,t,n)}transform(e,t,n){fc(this,e,t,n)}move(e,t,n){ic(this,e,t,n)}moveInner(e,t,n){cc(this,e,t,!0,n)}scaleOf(e,t,n,r,i){ac(this,gc(this,e),t,n,r,i)}rotateOf(e,t,n){oc(this,gc(this,e),t,n)}skewOf(e,t,n,r,i){sc(this,gc(this,e),t,n,r,i)}transformWorld(e,t,n){pc(this,e,t,n)}moveWorld(e,t,n){cc(this,e,t,!1,n)}scaleOfWorld(e,t,n,r,i){lc(this,e,t,n,r,i)}rotateOfWorld(e,t){uc(this,e,t)}skewOfWorld(e,t,n,r,i){dc(this,e,t,n,r,i)}flip(e,t){fc(this,hc(this,e),!1,t)}scaleResize(e,t=e,n){this.scaleX*=e,this.scaleY*=t}__scaleResize(e,t){}resizeWidth(e){}resizeHeight(e){}hit(e,t){return!0}__hitWorld(e,t){return!0}__hit(e,t){return!0}__hitFill(e){return!0}__hitStroke(e,t){return!0}__hitPixel(e){return!0}__drawHitPath(e){}__updateHitCanvas(){}__render(e,t){}__drawFast(e,t){}__draw(e,t,n){}__clip(e,t){}__renderShape(e,t){}__drawShape(e,t){}__updateWorldOpacity(){}__updateChange(){}__drawPath(e){}__drawRenderPath(e){}__updatePath(){}__updateRenderPath(e){}getMotionPathData(){return kt.need(`path`)}getMotionPoint(e){return kt.need(`path`)}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(e,t){}__updateSortChildren(){}add(e,t){}remove(e,t){this.parent&&this.parent.remove(this,t)}dropTo(e,t,n){vc(this,e,t,n)}on(e,t,n){}off(e,t,n){}on_(e,t,n,r){}off_(e){}once(e,t,n,r){}emit(e,t,n){}emitEvent(e,t){}hasEvent(e,t){return!1}static changeAttr(e,t,n){n?this.addAttr(e,t,n):eo(this.prototype,e,t)}static addAttr(e,t,n,r){n||=V,n(t,r)(this.prototype,e)}__emitLifeEvent(e){this.hasEvent(e)&&this.emitEvent(new q(e,this,this.parent))}destroy(){this.destroyed||=(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(q.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),!0)}};yc=P([so(Os),so(Fs),so(Us),so(Es),so(Ws)],yc);var{setListWithFn:bc}=A,{sort:xc}=jo,{localBoxBounds:Sc,localStrokeBounds:Cc,localRenderBounds:wc,maskLocalBoxBounds:Tc,maskLocalStrokeBounds:Ec,maskLocalRenderBounds:Dc}=Do,Oc=new N(`Branch`),kc=class extends yc{__updateStrokeSpread(){let{children:e}=this;for(let t=0,n=e.length;t<n;t++)if(e[t].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){let e,{children:t}=this;for(let n=0,r=t.length;n<r;n++)if(e=t[n].__layout,e.renderSpread||e.localOuterBounds)return 1;return 0}__updateBoxBounds(e,t){bc(t||this.__layout.boxBounds,this.children,this.__hasMask?Tc:Sc)}__updateStrokeBounds(e){bc(e||this.__layout.strokeBounds,this.children,this.__hasMask?Ec:Cc)}__updateRenderBounds(e){bc(e||this.__layout.renderBounds,this.children,this.__hasMask?Dc:wc)}__updateSortChildren(){let e,{children:t}=this;if(t.length>1){for(let n=0,r=t.length;n<r;n++)t[n].__tempNumber=n,t[n].__.zIndex&&(e=!0);t.sort(xc),this.__layout.affectChildrenSort=e}}add(e,t){if(e===this||e.destroyed)return Oc.warn(`add self or destroyed`);let r=n(t);if(!e.__){if(l(e))return e.forEach(e=>{this.add(e,t),r||t++});if(!(e=Mt.get(e.tag,e)))return}e.parent&&e.parent.remove(e),e.parent=this,r?this.children.push(e):this.children.splice(t,0,e),e.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);let i=e.__layout;i.boxChanged||i.boxChange(),i.matrixChanged||i.matrixChange(),e.__bubbleMap&&e.__emitLifeEvent(q.ADD),this.leafer&&(e.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(q.ADD,e)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...e){this.add(e)}remove(e,t){e?e.__?e.animationOut?e.__runAnimation(`out`,()=>this.__remove(e,t)):this.__remove(e,t):this.find(e).forEach(e=>this.remove(e,t)):n(e)&&super.remove(null,t)}removeAll(e){let{children:t}=this;t.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,t.forEach(t=>{this.__realRemoveChild(t),e&&t.destroy()}))}clear(){this.removeAll(!0)}__remove(e,t){let n=this.children.indexOf(e);n>-1&&(this.children.splice(n,1),e.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(e),t&&e.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(e){e.__emitLifeEvent(q.REMOVE),e.parent=null,this.leafer&&(e.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(q.REMOVE,e),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(e,t){let n=new q(e,t,this);this.hasEvent(e)&&!this.isLeafer&&this.emitEvent(n),this.leafer.emitEvent(n)}};kc=P([so(qs)],kc);var Ac=class e{get length(){return this.list.length}constructor(e){this.reset(),e&&(l(e)?this.addList(e):this.add(e))}has(e){return e&&!n(this.keys[e.innerId])}indexAt(e){return this.list[e]}indexOf(e){let t=this.keys[e.innerId];return n(t)?-1:t}add(e){let{list:t,keys:r}=this;n(r[e.innerId])&&(t.push(e),r[e.innerId]=t.length-1)}addAt(e,t=0){let{keys:r}=this;if(n(r[e.innerId])){let{list:n}=this;for(let e=t,i=n.length;e<i;e++)r[n[e].innerId]++;t===0?n.unshift(e):(t>n.length&&(t=n.length),n.splice(t,0,e)),r[e.innerId]=t}}addList(e){for(let t=0;t<e.length;t++)this.add(e[t])}remove(e){let{list:t}=this,r;for(let i=0,a=t.length;i<a;i++)n(r)?t[i].innerId===e.innerId&&(r=i,delete this.keys[e.innerId]):this.keys[t[i].innerId]=i-1;n(r)||t.splice(r,1)}sort(e){let{list:t}=this;e?t.sort((e,t)=>t.__level-e.__level):t.sort((e,t)=>e.__level-t.__level)}forEach(e){this.list.forEach(e)}clone(){let t=new e;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};let{list:e,keys:t}=this;for(let n=0,r=e.length;n<r;n++)t[e[n].innerId]=n}reset(){this.list=[],this.keys={}}destroy(){this.reset()}},jc=class{get length(){return this._length}constructor(e){this._length=0,this.reset(),e&&(l(e)?this.addList(e):this.add(e))}has(e){return!n(this.keys[e.innerId])}without(e){return n(this.keys[e.innerId])}sort(e){let{levels:t}=this;e?t.sort((e,t)=>t-e):t.sort((e,t)=>e-t)}addList(e){e.forEach(e=>{this.add(e)})}add(e){let{keys:t,levelMap:n}=this;t[e.innerId]||(t[e.innerId]=1,n[e.__level]?n[e.__level].push(e):(n[e.__level]=[e],this.levels.push(e.__level)),this._length++)}forEach(e){let t;this.levels.forEach(n=>{t=this.levelMap[n];for(let n=0,r=t.length;n<r;n++)e(t[n])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}},Mc=`2.1.3`;function Y(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o}function Nc(e){return z(e,e=>Oa({set(t){this.__setAttr(e,t),t&&(this.__.__useEffect=!0);let n=this.__layout;n.renderChanged||n.renderChange(),n.surfaceChange()}}))}function Pc(e){return z(e,e=>Oa({set(t){this.__setAttr(e,t),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function Fc(){return(e,t)=>{let n=`_`+t;Ta(e,t,{set(e){this.isLeafer&&(this[n]=e)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[n]||this:this.leafer&&this.leafer.zoomLayer}})}}function Ic(e){return(t,n)=>{Ta(t,n,Da(n,e))}}var Lc={},Rc={hasTransparent:function(e){if(!e||e.length===7||e.length===4)return!1;if(e===`transparent`)return!0;let t=e[0];if(t===`#`)switch(e.length){case 5:return e[4]!==`f`&&e[4]!==`F`;case 9:return e[7]!==`f`&&e[7]!==`F`||e[8]!==`f`&&e[8]!==`F`}else if((t===`r`||t===`h`)&&e[3]===`a`){let t=e.lastIndexOf(`,`);if(t>-1)return parseFloat(e.slice(t+1))<1}return!1}},zc=_t,Bc={},X={},Vc={},Hc={},Uc={},Wc={apply(){kt.need(`filter`)}},Gc={},Kc={setStyleName:()=>kt.need(`state`),set:()=>kt.need(`state`)},qc={list:{},register(e,t){qc.list[e]=t},get:e=>qc.list[e]},{parse:Jc,objectToCanvasData:Yc}=yr,{stintSet:Xc}=p,{hasTransparent:Zc}=Rc,Qc={originPaint:{}},$c=N.get(`UIData`),el=class extends h{get scale(){let{scaleX:e,scaleY:t}=this;return e===t?e:{x:e,y:t}}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){let e=this,t=e.__hasStrokeSides||e.strokeWidth;return e.__hasMultiStrokeStyle?Math.max(e.__hasMultiStrokeStyle,t):t}get __hasMultiPaint(){let e=this;return e.fill&&this.__useStroke||e.__isFills&&e.fill.length>1||e.__isStrokes&&e.stroke.length>1||e.__useEffect}get __clipAfterFill(){let e=this;return e.cornerRadius||e.innerShadow||e.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return this._width==null}get __autoHeight(){return this._height==null}get __autoSide(){return this._width==null||this._height==null}get __autoSize(){return this._width==null&&this._height==null}setVisible(e){this._visible=e;let{leafer:t}=this.__leaf;t&&(t.watcher.hasVisible=!0)}setWidth(e){e<0?(this._width=-e,this.__leaf.scaleX*=-1,$c.warn(`width < 0, instead -scaleX `,this)):this._width=e}setHeight(e){e<0?(this._height=-e,this.__leaf.scaleY*=-1,$c.warn(`height < 0, instead -scaleY`,this)):this._height=e}setFill(e){this.__naturalWidth&&this.__removeNaturalSize(),i(e)||!e?(Xc(this,`__isTransparentFill`,Zc(e)),this.__isFills&&this.__removePaint(`fill`,!0),this._fill=e):u(e)&&this.__setPaint(`fill`,e)}setStroke(e){i(e)||!e?(Xc(this,`__isTransparentStroke`,Zc(e)),this.__isStrokes&&this.__removePaint(`stroke`,!0),this._stroke=e):u(e)&&this.__setPaint(`stroke`,e)}setPath(e){let t=i(e);t||e&&u(e[0])?(this.__setInput(`path`,e),this._path=t?Jc(e,this.__useArrow):Yc(e)):(this.__input&&this.__removeInput(`path`),this._path=e)}setShadow(e){tl(this,`shadow`,e)}setInnerShadow(e){tl(this,`innerShadow`,e)}setFilter(e){tl(this,`filter`,e)}__computePaint(){let{fill:e,stroke:t}=this.__input;e&&X.compute(`fill`,this.__leaf),t&&X.compute(`stroke`,this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(e){let{strokeWidth:t,strokeScaleFixed:r}=this;if(e&&(e.strokeWidth&&(t=e.strokeWidth),n(e.strokeScaleFixed)||(r=e.strokeScaleFixed)),r){let{scaleX:e}=this.__leaf.getRenderScaleData(!0,r,!1);if(e!==1)return t*e}return t}__checkComplex(){let e=this;Xc(e,`__complex`,e.__isFills||e.__isStrokes||e.cornerRadius||e.__useEffect)}__setPaint(e,t){this.__setInput(e,t);let n=this.__leaf.__layout;n.boxChanged||n.boxChange(),l(t)&&!t.length?this.__removePaint(e):e===`fill`?(this.__isFills=!0,this._fill||=Qc):(this.__isStrokes=!0,this._stroke||=Qc)}__removePaint(e,t){t&&this.__removeInput(e),Vc.recycleImage(e,this),e===`fill`?(Xc(this,`__isAlphaPixelFill`,void 0),this._fill=this.__isFills=void 0):(Xc(this,`__isAlphaPixelStroke`,void 0),Xc(this,`__hasMultiStrokeStyle`,void 0),this._stroke=this.__isStrokes=void 0)}};function tl(e,t,n){e.__setInput(t,n),l(n)?(n.some(e=>!1===e.visible)&&(n=n.filter(e=>!1!==e.visible)),n.length||(n=void 0)):n=n&&!1!==n.visible?[n]:void 0,e[`_`+t]=n}var nl=class extends el{},rl=class extends nl{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){let e=this;return e.overflow!==`show`&&e.__leaf.children.length&&(e.__leaf.isOverflow||super.__clipAfterFill)}},il=class extends nl{__getInputData(e,t){let n=super.__getInputData(e,t);return qt.forEach(e=>delete n[e]),n}},al=class extends rl{},ol=class extends el{get __usePathBox(){return this.points||this.__pathInputed}},sl=class extends el{get __boxStroke(){return!this.__pathInputed}},cl=class extends el{get __boxStroke(){return!this.__pathInputed}},ll=class extends el{get __usePathBox(){return this.points||this.__pathInputed}},ul=class extends el{get __boxStroke(){return!this.__pathInputed}},dl=class extends el{get __pathInputed(){return 2}},fl=class extends nl{},pl={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900},ml=class extends el{get __useNaturalRatio(){return!1}setFontWeight(e){i(e)?(this.__setInput(`fontWeight`,e),e=pl[e]||400):this.__input&&this.__removeInput(`fontWeight`),this._fontWeight=e}setBoxStyle(e){let t=this.__leaf,n=t.__box;if(e){let{boxStyle:r}=this;if(n)for(let e in r)n[e]=void 0;else n=t.__box=Mt.get(`Rect`,0);let i=t.__layout,a=n.__layout;r||(n.parent=t,n.__world=t.__world,a.boxBounds=i.boxBounds),n.set(e),a.strokeChanged&&i.strokeChange()}else n&&(t.__box=n.parent=null,n.destroy());this._boxStyle=e}__getInputData(e,t){let n=super.__getInputData(e,t);return n.textEditing&&delete n.textEditing,n}},hl=class extends sl{get __urlType(){return`image`}setUrl(e){this.__setImageFill(e),this._url=e}__setImageFill(e){this.fill=e?{type:this.__urlType,mode:`stretch`,url:e}:void 0}__getData(){let e=super.__getData();return e.url&&delete e.fill,e}__getInputData(e,t){let n=super.__getInputData(e,t);return n.url&&delete n.fill,n}},gl=class extends sl{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(e,t){let n=super.__getInputData(e,t);return n.url=this.__leaf.canvas.toDataURL(`image/png`),n}},{max:_l,add:vl}=C,yl={__updateStrokeSpread(){let e=0,t=0,n=this.__,{strokeAlign:r,__maxStrokeWidth:i}=n,a=this.__box;if((n.stroke||n.hitStroke===`all`)&&i&&r!==`inside`&&(t=e=r===`center`?i/2:i,!n.__boxStroke||n.__useArrow)){let t=n.__isLinePath?0:(n.strokeJoin===`miter`?10:1)*e,r=n.strokeCap===`none`?0:i;e+=Math.max(t,r)}return n.__useArrow&&(e+=5*i),a&&(e=_l(e,a.__layout.strokeSpread=a.__updateStrokeSpread()),t=Math.max(t,a.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=t,e},__updateRenderSpread(){let e=0,{shadow:t,innerShadow:n,blur:r,backgroundBlur:i,filter:a,renderSpread:o}=this.__,{strokeSpread:s}=this.__layout,c=this.__box;t&&(e=Uc.getShadowRenderSpread(this,t)),r&&(e=_l(e,r)),a&&(e=vl(e,Wc.getSpread(a))),o&&(e=vl(e,o)),s&&(e=vl(e,s));let l=e;return n&&(l=_l(l,Uc.getInnerShadowSpread(this,n))),i&&(l=_l(l,i)),this.__layout.renderShapeSpread=l,c?_l(c.__updateRenderSpread(),e):e}},{stintSet:bl}=p,xl={__updateChange(){let e=this.__;if(e.__useStroke){let t=e.__useStroke=!(!e.stroke||!e.strokeWidth);bl(this.__world,`half`,t&&e.strokeAlign===`center`&&e.strokeWidth%2),bl(e,`__fillAfterStroke`,t&&e.strokeAlign===`outside`&&e.fill&&!e.__isTransparentFill)}if(e.__useEffect){let{shadow:t,fill:n,stroke:r}=e,i=e.innerShadow||e.blur||e.backgroundBlur||e.filter;bl(e,`__isFastShadow`,t&&!i&&t.length<2&&!t[0].spread&&!Uc.isTransformShadow(t[0])&&n&&!e.__isTransparentFill&&!(l(n)&&n.length>1)&&(this.useFastShadow||!r||r&&e.strokeAlign===`inside`)),e.__useEffect=!(!t&&!i)}e.__checkSingle(),e.__checkComplex()},__drawFast(e,t){Sl(this,e,t)},__draw(e,t,n){let r=this.__;if(r.__complex){r.__needComputePaint&&r.__computePaint();let{fill:i,stroke:a,__drawAfterFill:o,__fillAfterStroke:s,__isFastShadow:c}=r;if(this.__drawRenderPath(e),r.__useEffect&&!c){let c=X.shape(this,e,t);this.__nowWorld=this.__getNowWorld(t);let{shadow:l,innerShadow:u,filter:d}=r;l&&Uc.shadow(this,e,c),s&&(r.__isStrokes?X.strokes(a,this,e,t):X.stroke(a,this,e,t)),i&&(r.__isFills?X.fills(i,this,e,t):X.fill(i,this,e,t)),o&&this.__drawAfterFill(e,t),u&&Uc.innerShadow(this,e,c),a&&!s&&(r.__isStrokes?X.strokes(a,this,e,t):X.stroke(a,this,e,t)),d&&Wc.apply(d,this,this.__nowWorld,e,n,c),c.worldCanvas&&c.worldCanvas.recycle(),c.canvas.recycle()}else{if(s&&(r.__isStrokes?X.strokes(a,this,e,t):X.stroke(a,this,e,t)),c){let t=r.shadow[0],{scaleX:n,scaleY:i}=this.getRenderScaleData(!0,t.scaleFixed);e.save(),e.setWorldShadow(t.x*n,t.y*i,t.blur*n,Rc.string(t.color))}i&&(r.__isFills?X.fills(i,this,e,t):X.fill(i,this,e,t)),c&&e.restore(),o&&this.__drawAfterFill(e,t),a&&!s&&(r.__isStrokes?X.strokes(a,this,e,t):X.stroke(a,this,e,t))}}else r.__pathForRender?Sl(this,e,t):this.__drawFast(e,t)},__drawShape(e,t){this.__drawRenderPath(e);let n=this.__,{fill:r,stroke:i}=n;r&&!t.ignoreFill&&(n.__isAlphaPixelFill?X.fills(r,this,e,t):X.fill(`#000000`,this,e,t)),n.__isCanvas&&this.__drawAfterFill(e,t),i&&!t.ignoreStroke&&(n.__isAlphaPixelStroke?X.strokes(i,this,e,t):X.stroke(`#000000`,this,e,t))},__drawAfterFill(e,t){this.__.__clipAfterFill?(e.save(),e.clipUI(this),this.__drawContent(e,t),e.restore()):this.__drawContent(e,t)}};function Sl(e,t,n){let{fill:r,stroke:i,__drawAfterFill:a,__fillAfterStroke:o}=e.__;e.__drawRenderPath(t),o&&X.stroke(i,e,t,n),r&&X.fill(r,e,t,n),a&&e.__drawAfterFill(t,n),i&&!o&&X.stroke(i,e,t,n)}var Cl={__drawFast(e,t){let{x:n,y:r,width:i,height:a}=this.__layout.boxBounds,{fill:o,stroke:s,__drawAfterFill:c}=this.__;if(o&&(e.fillStyle=o,e.fillRect(n,r,i,a)),c&&this.__drawAfterFill(e,t),s){let{strokeAlign:o,__strokeWidth:c}=this.__;if(!c)return;e.setStroke(s,c,this.__);let l=c/2;switch(o){case`center`:e.strokeRect(0,0,i,a);break;case`inside`:i-=c,a-=c,i<0||a<0?(e.save(),this.__clip(e,t),e.strokeRect(n+l,r+l,i,a),e.restore()):e.strokeRect(n+l,r+l,i,a);break;case`outside`:e.strokeRect(n-l,r-l,i+c,a+c)}}}},wl,Z=wl=class extends yc{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set strokeWidthFixed(e){this.strokeScaleFixed=e}get strokeWidthFixed(){return this.strokeScaleFixed}set scale(e){T.assignScale(this,e)}get scale(){return this.__.scale}get isAutoWidth(){let e=this.__;return e.__autoWidth||e.autoWidth}get isAutoHeight(){let e=this.__;return e.__autoHeight||e.autoHeight}get pen(){let{path:e}=this.__;return sa.set(this.path=e||[]),e||this.__drawPathByBox(sa),sa}reset(e){}set(e,t){e&&Object.assign(this,e)}get(e){return i(e)?this.__.__getInput(e):this.__.__getInputData(e)}createProxyData(){}clearProxyData(){}find(e,t){return kt.need(`find`)}findTag(e){return this.find({tag:e})}findOne(e,t){return kt.need(`find`)}findId(e){return this.findOne({id:e})}getPath(e,t){this.__layout.update();let n=t?this.__.__pathForRender:this.__.path;return n||(sa.set(n=[]),this.__drawPathByBox(sa,!t)),e?yr.toCanvasData(n,!0):n}getPathString(e,t,n){return yr.stringify(this.getPath(e,t),n)}asPath(e,t){this.path=this.getPath(e,t)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){let e=this.__;!e.lazy||this.__inLazyBounds||Gc.running?e.__computePaint():e.__needComputePaint=!0}}__updateRenderPath(e){let t=this.__;t.path?(t.__pathForRender=t.cornerRadius||t.path.radius?aa.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&Bc.addArrows(this,e)):t.__pathForRender&&=void 0}__drawRenderPath(e){let t=this.__;e.beginPath(),t.__useArrow&&Bc.updateArrow(this),this.__drawPathByData(e,t.__pathForRender)}__drawPath(e){e.beginPath(),this.__drawPathByData(e,this.__.path,!0)}__drawPathByData(e,t,n){t?bi.drawPathByData(e,t):this.__drawPathByBox(e,n)}__drawPathByBox(e,t){let{x:n,y:r,width:i,height:a}=this.__layout.boxBounds;if(this.__.cornerRadius&&!t){let{cornerRadius:t}=this.__;e.roundRect(n,r,i,a,o(t)?[t]:t)}else e.rect(n,r,i,a);e.closePath()}drawImagePlaceholder(e,t,n){X.fill(this.__.placeholderColor,this,t,n)}animate(e,t,n,r){return this.set(e),kt.need(`animate`)}killAnimate(e,t){}export(e,t){return kt.need(`export`)}syncExport(e,t){return kt.need(`export`)}clone(e){let t=p.clone(this.toJSON());return e&&Object.assign(t,e),wl.one(t)}static one(e,t,n,r,i){return Mt.get(e.tag||this.prototype.__tag,e,t,n,r,i)}static registerUI(){W()(this)}static registerData(e){U(e)(this.prototype)}static setEditConfig(e){}static setEditOuter(e){}static setEditInner(e){}destroy(){this.__.__willDestroy=!0,this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};Y([U(el)],Z.prototype,`__`,void 0),Y([Fc()],Z.prototype,`zoomLayer`,void 0),Y([B(``)],Z.prototype,`id`,void 0),Y([B(``)],Z.prototype,`name`,void 0),Y([B(``)],Z.prototype,`className`,void 0),Y([Ha(`pass-through`)],Z.prototype,`blendMode`,void 0),Y([Wa(1)],Z.prototype,`opacity`,void 0),Y([Ga(!0)],Z.prototype,`visible`,void 0),Y([Ha(!1)],Z.prototype,`locked`,void 0),Y([Ua(!1)],Z.prototype,`dim`,void 0),Y([Ua(!1)],Z.prototype,`dimskip`,void 0),Y([Ja(0)],Z.prototype,`zIndex`,void 0),Y([Ya(!1)],Z.prototype,`mask`,void 0),Y([Xa(!1)],Z.prototype,`eraser`,void 0),Y([Aa(0,!0)],Z.prototype,`x`,void 0),Y([Aa(0,!0)],Z.prototype,`y`,void 0),Y([V(100,!0)],Z.prototype,`width`,void 0),Y([V(100,!0)],Z.prototype,`height`,void 0),Y([Na(1,!0)],Z.prototype,`scaleX`,void 0),Y([Na(1,!0)],Z.prototype,`scaleY`,void 0),Y([Pa(0,!0)],Z.prototype,`rotation`,void 0),Y([Pa(0,!0)],Z.prototype,`skewX`,void 0),Y([Pa(0,!0)],Z.prototype,`skewY`,void 0),Y([Aa(0,!0)],Z.prototype,`offsetX`,void 0),Y([Aa(0,!0)],Z.prototype,`offsetY`,void 0),Y([ja(0,!0)],Z.prototype,`scrollX`,void 0),Y([ja(0,!0)],Z.prototype,`scrollY`,void 0),Y([Ma()],Z.prototype,`origin`,void 0),Y([Ma()],Z.prototype,`around`,void 0),Y([B(!1)],Z.prototype,`lazy`,void 0),Y([Fa(1)],Z.prototype,`pixelRatio`,void 0),Y([Va(0)],Z.prototype,`renderSpread`,void 0),Y([La()],Z.prototype,`path`,void 0),Y([H()],Z.prototype,`windingRule`,void 0),Y([H(!0)],Z.prototype,`closed`,void 0),Y([V(0)],Z.prototype,`padding`,void 0),Y([V(!1)],Z.prototype,`lockRatio`,void 0),Y([V()],Z.prototype,`widthRange`,void 0),Y([V()],Z.prototype,`heightRange`,void 0),Y([B(!1)],Z.prototype,`draggable`,void 0),Y([B()],Z.prototype,`dragBounds`,void 0),Y([B(`auto`)],Z.prototype,`dragBoundsType`,void 0),Y([B(!1)],Z.prototype,`editable`,void 0),Y([Za(!0)],Z.prototype,`hittable`,void 0),Y([Za(`path`)],Z.prototype,`hitFill`,void 0),Y([Ba(`path`)],Z.prototype,`hitStroke`,void 0),Y([Za(!1)],Z.prototype,`hitBox`,void 0),Y([Za(!0)],Z.prototype,`hitChildren`,void 0),Y([Za(!0)],Z.prototype,`hitSelf`,void 0),Y([Za()],Z.prototype,`hitRadius`,void 0),Y([Qa(``)],Z.prototype,`cursor`,void 0),Y([Ha()],Z.prototype,`fill`,void 0),Y([Ba(void 0,!0)],Z.prototype,`stroke`,void 0),Y([Ba(`inside`)],Z.prototype,`strokeAlign`,void 0),Y([Ba(1,!0)],Z.prototype,`strokeWidth`,void 0),Y([Ba(!1)],Z.prototype,`strokeScaleFixed`,void 0),Y([Ba(`none`)],Z.prototype,`strokeCap`,void 0),Y([Ba(`miter`)],Z.prototype,`strokeJoin`,void 0),Y([Ba()],Z.prototype,`dashPattern`,void 0),Y([Ba(0)],Z.prototype,`dashOffset`,void 0),Y([Ba(10)],Z.prototype,`miterLimit`,void 0),Y([H(0)],Z.prototype,`cornerRadius`,void 0),Y([H()],Z.prototype,`cornerSmoothing`,void 0),Y([Nc()],Z.prototype,`shadow`,void 0),Y([Nc()],Z.prototype,`innerShadow`,void 0),Y([Nc()],Z.prototype,`blur`,void 0),Y([Nc()],Z.prototype,`backgroundBlur`,void 0),Y([Nc()],Z.prototype,`grayscale`,void 0),Y([Nc()],Z.prototype,`filter`,void 0),Y([Ha()],Z.prototype,`placeholderColor`,void 0),Y([B(100)],Z.prototype,`placeholderDelay`,void 0),Y([B({})],Z.prototype,`data`,void 0),Y([io(yc.prototype.reset)],Z.prototype,`reset`,null),Z=wl=Y([so(yl),so(xl),ao()],Z);var Tl=class extends Z{get __tag(){return`Group`}get isBranch(){return!0}reset(e){this.__setBranch(),super.reset(e)}__setBranch(){this.children||=[]}set(e,t){if(e)if(e.children){let{children:n}=e;delete e.children,this.children?this.clear():this.__setBranch(),super.set(e,t),n.forEach(e=>this.add(e)),e.children=n}else super.set(e,t)}toJSON(e){let t=super.toJSON(e);if(!this.childlessJSON){let n=t.children=[];this.children.forEach(t=>t.skipJSON||n.push(t.toJSON(e)))}return t}pick(e,t){}addAt(e,t){this.add(e,t)}addAfter(e,t){this.add(e,this.children.indexOf(t)+1)}addBefore(e,t){this.add(e,this.children.indexOf(t))}add(e,t){}addMany(...e){}remove(e,t){}removeAll(e){}clear(){}},El;Y([U(nl)],Tl.prototype,`__`,void 0),Y([V(0)],Tl.prototype,`width`,void 0),Y([V(0)],Tl.prototype,`height`,void 0),Tl=Y([so(kc),W()],Tl);var Dl=N.get(`Leafer`),Ol=El=class extends Tl{get __tag(){return`Leafer`}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&ga.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)||pe()}constructor(e,t){super(t),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=e,e&&(e.view||e.width)&&this.init(e),El.list.add(this)}init(e,t){if(this.canvas)return;let n,{config:r}=this;this.__setLeafer(this),t&&(this.parentApp=t,this.__bindApp(t),n=t.running),e&&(this.parent=t,this.initType(e.type),this.parent=void 0,p.assign(r,e));let i=this.canvas=At.canvas(r);this.__controllers.push(this.renderer=At.renderer(this,i,r),this.watcher=At.watcher(this,r),this.layouter=At.layouter(this,r)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),t||(this.selector=At.selector(this),this.interaction=At.interaction(this,i,this.selector,r),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=At.hitCanvasManager()),this.canvasManager=new Lt,n=r.start),this.hittable=r.hittable,this.fill=r.fill,this.canvasManager.add(i),this.__listenEvents(),n&&(this.__startTimer=setTimeout(this.start.bind(this))),Lo.run(this.__initWait),this.onInit()}onInit(){}initType(e){}set(e,t){this.waitInit(()=>{super.set(e,t)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(J.RESTART):this.emitLeafer(J.START),this.__controllers.forEach(e=>e.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(e=>e.stop()),this.running=!1,this.emitLeafer(J.STOP))}unlockLayout(e=!0){this.layouter.start(),e&&this.updateLayout()}lockLayout(e=!0){e&&this.updateLayout(),this.layouter.stop()}resize(e){let t=p.copyAttrs({},e,qt);Object.keys(t).forEach(e=>this[e]=t[e])}forceRender(e,t){let{renderer:n}=this;n&&(n.addBlock(e?new mt(e):this.canvas.bounds),this.viewReady&&(t?n.render():n.update()))}requestRender(e=!1){this.renderer&&this.renderer.update(e)}updateCursor(e){let t=this.interaction;t&&(e?t.setCursor(e):t.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(e){let{canvas:t}=this;if(!t||t.isSameSize(e))return;let n=p.copyAttrs({},this.canvas,qt);t.resize(e),this.updateLazyBounds(),this.__onResize(new as(e,n))}__onResize(e){this.emitEvent(e),p.copyAttrs(this.__,e,qt),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(e){this.selector=e.selector,this.interaction=e.interaction,this.canvasManager=e.canvasManager,this.hitCanvasManager=e.hitCanvasManager}__setLeafer(e){this.leafer=e,this.__level=1}__checkAutoLayout(){let{config:e,parentApp:t}=this;t||(e.width&&e.height||(this.autoLayout=new gt(e)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(e,t){return this.canvas&&(qt.includes(e)?this.__changeCanvasSize(e,t):e===`fill`?this.__changeFill(t):e===`hittable`?this.parent||(this.canvas.hittable=t):e===`zIndex`?(this.canvas.zIndex=t,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):e===`mode`&&this.emit(J.UPDATE_MODE,{mode:t})),super.__setAttr(e,t)}__getAttr(e){return this.canvas&&qt.includes(e)?this.canvas[e]:super.__getAttr(e)}__changeCanvasSize(e,t){let{config:n,canvas:r}=this,i=p.copyAttrs({},r,qt);i[e]=n[e]=t,n.width&&n.height?r.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(i)}__changeFill(e){this.config.fill=e,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=e:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(J.BEFORE_READY),this.emitLeafer(J.READY),this.emitLeafer(J.AFTER_READY),Lo.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(J.VIEW_READY),Lo.run(this.__viewReadyWait))}__onLayoutEnd(){let{grow:e,width:t,height:n}=this.config;if(e){let{width:r,height:i,pixelRatio:a}=this,o=e===`box`?this.worldBoxBounds:this.__world;t||(r=Math.max(1,o.x+o.width)),n||(i=Math.max(1,o.y+o.height)),this.__doResize({width:r,height:i,pixelRatio:a})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){Lo.run(this.__nextRenderWait);let{imageReady:e}=this;e&&!this.viewCompleted&&this.__checkViewCompleted(),e||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(e=!0){this.nextRender(()=>{this.imageReady&&(e&&this.emitLeafer(J.VIEW_COMPLETED),Lo.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(e,t){t&&(e=e.bind(t)),this.__initWait||=[],this.canvas?e():this.__initWait.push(e)}waitReady(e,t){t&&(e=e.bind(t)),this.ready?e():this.__readyWait.push(e)}waitViewReady(e,t){t&&(e=e.bind(t)),this.viewReady?e():this.__viewReadyWait.push(e)}waitViewCompleted(e,t){t&&(e=e.bind(t)),this.__viewCompletedWait.push(e),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(e,t,n){t&&(e=e.bind(t));let r=this.__nextRenderWait;if(n){for(let t=0;t<r.length;t++)if(r[t]===e){r.splice(t,1);break}}else r.push(e);this.requestRender()}zoom(e,t,n,r){return kt.need(`view`)}getValidMove(e,t,n){return{x:e,y:t}}getValidScale(e){return e}getWorldPointByClient(e,t){return this.interaction&&this.interaction.getLocal(e,t)}getPagePointByClient(e,t){return this.getPagePoint(this.getWorldPointByClient(e,t))}getClientPointByWorld(e){let{x:t,y:n}=this.clientBounds;return{x:t+e.x,y:n+e.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(e){}emitLeafer(e){this.emitEvent(new J(e,this))}__listenEvents(){let e=Et.start(`FirstCreate `+this.innerName);this.once([[J.START,()=>Et.end(e)],[ss.START,this.updateLazyBounds,this],[cs.START,this.__onCreated,this],[cs.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[os.DATA,this.__onWatchData,this],[ss.END,this.__onLayoutEnd,this],[cs.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(e){let t=()=>{if(!this.destroyed){El.list.remove(this);try{this.stop(),this.emitLeafer(J.END),this.__removeListenEvents(),this.__controllers.forEach(e=>!(this.parent&&e===this.interaction)&&e.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(()=>{va.clearRecycled()},100)}catch(e){Dl.error(e)}}};e?t():setTimeout(t)}};Ol.list=new Ac,Y([U(il)],Ol.prototype,`__`,void 0),Y([V()],Ol.prototype,`pixelRatio`,void 0),Y([B(`normal`)],Ol.prototype,`mode`,void 0),Ol=El=Y([W()],Ol);var kl=class extends Z{get __tag(){return`Rect`}};Y([U(sl)],kl.prototype,`__`,void 0),kl=Y([so(Cl),ao(),W()],kl);var{add:Al,includes:jl,scroll:Ml}=A,Nl=kl.prototype,Pl=Tl.prototype,Q=class extends Tl{get __tag(){return`Box`}get isBranchLeaf(){return!0}get __useSelfBox(){return this.pathInputed}constructor(e){super(e),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(e){if(this.children.length&&!this.__useSelfBox){let e=this.__;if(e.__autoSide){e.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();let{boxBounds:t}=this.__layout;e.__autoSize||(e.__autoWidth?(t.width+=t.x,t.x=0,t.height=e.height,t.y=0):(t.height+=t.y,t.y=0,t.width=e.width,t.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let e,t;if(this.children.length){let n=this.__,r=this.__layout,{renderBounds:i,boxBounds:a}=r,{overflow:o}=n,s=r.childrenRenderBounds||=pe();super.__updateRenderBounds(s),(t=o&&o.includes(`scroll`))&&(Al(s,a),Ml(s,n)),this.__updateRectRenderBounds(),e=!jl(a,s),e&&o===`show`&&Al(i,s)}else this.__updateRectRenderBounds();p.stintSet(this,`isOverflow`,e),this.__checkScroll(t)}__updateRectRenderBounds(){}__checkScroll(e){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(e,t){}__renderGroup(e,t){}__render(e,t){this.__.__drawAfterFill?this.__renderRect(e,t):(this.__renderRect(e,t),this.children.length&&this.__renderGroup(e,t)),this.hasScroller&&this.scroller.__render(e,t)}__drawContent(e,t){this.__renderGroup(e,t),(this.__.__useStroke||this.__.__useEffect)&&(e.setWorld(this.__nowWorld),this.__drawRenderPath(e))}};Y([U(rl)],Q.prototype,`__`,void 0),Y([V(100)],Q.prototype,`width`,void 0),Y([V(100)],Q.prototype,`height`,void 0),Y([B(!1)],Q.prototype,`resizeChildren`,void 0),Y([Va(`show`)],Q.prototype,`overflow`,void 0),Y([io(Nl.__updateStrokeSpread)],Q.prototype,`__updateStrokeSpread`,null),Y([io(Nl.__updateRenderSpread)],Q.prototype,`__updateRectRenderSpread`,null),Y([io(Nl.__updateBoxBounds)],Q.prototype,`__updateRectBoxBounds`,null),Y([io(Nl.__updateStrokeBounds)],Q.prototype,`__updateStrokeBounds`,null),Y([io(Nl.__updateRenderBounds)],Q.prototype,`__updateRectRenderBounds`,null),Y([io(Nl.__updateChange)],Q.prototype,`__updateRectChange`,null),Y([io(Nl.__render)],Q.prototype,`__renderRect`,null),Y([io(Pl.__render)],Q.prototype,`__renderGroup`,null),Q=Y([ao(),W()],Q);var Fl=class extends Q{get __tag(){return`Frame`}get isFrame(){return!0}};Y([U(al)],Fl.prototype,`__`,void 0),Y([Ha(`#FFFFFF`)],Fl.prototype,`fill`,void 0),Y([Va(`hide`)],Fl.prototype,`overflow`,void 0),Fl=Y([W()],Fl);var{moveTo:Il,closePath:Ll,ellipse:Rl}=Hr,zl=class extends Z{get __tag(){return`Ellipse`}__updatePath(){let e=this.__,{width:t,height:n,innerRadius:r,startAngle:i,endAngle:a}=e,o=t/2,s=n/2,c=e.path=[],l;r?i||a?(r<1?Rl(c,o,s,o*r,s*r,0,i,a,!1):l=!0,Rl(c,o,s,o,s,0,a,i,!0)):(r<1&&(Rl(c,o,s,o*r,s*r),Il(c,t,s)),Rl(c,o,s,o,s,0,360,0,!0)):i||a?(Il(c,o,s),Rl(c,o,s,o,s,0,i,a,!1)):Rl(c,o,s,o,s),l||Ll(c),(M.ellipseToCurve||e.__useArrow||e.cornerRadius)&&(e.path=this.getPath(!0))}};Y([U(cl)],zl.prototype,`__`,void 0),Y([H(0)],zl.prototype,`innerRadius`,void 0),Y([H(0)],zl.prototype,`startAngle`,void 0),Y([H(0)],zl.prototype,`endAngle`,void 0),zl=Y([W()],zl);var{sin:Bl,cos:Vl,PI:Hl}=Math,{moveTo:Ul,lineTo:Wl,closePath:Gl,drawPoints:Kl}=Hr,ql=class extends Z{get __tag(){return`Polygon`}__updatePath(){let e=this.__,t=e.path=[];if(e.points)Kl(t,e.points,e.curve,e.closed);else{let{width:n,height:r,sides:i,startAngle:a}=e,o=n/2,s=r/2,c,l=0;a?(l=a*E,Ul(t,o+o*Bl(l),s-s*Vl(l))):Ul(t,o,0);for(let e=1;e<i;e++)c=2*e*Hl/i+l,Wl(t,o+o*Bl(c),s-s*Vl(c));Gl(t)}}};Y([U(ll)],ql.prototype,`__`,void 0),Y([H(3)],ql.prototype,`sides`,void 0),Y([H(0)],ql.prototype,`startAngle`,void 0),Y([H()],ql.prototype,`points`,void 0),Y([H(0)],ql.prototype,`curve`,void 0),ql=Y([ao(),W()],ql);var{sin:Jl,cos:Yl,PI:Xl}=Math,{moveTo:Zl,lineTo:Ql,closePath:$l}=Hr,eu=class extends Z{get __tag(){return`Star`}__updatePath(){let{width:e,height:t,corners:n,innerRadius:r,startAngle:i}=this.__,a=e/2,o=t/2,s=this.__.path=[],c,l=0;i?(l=i*E,Zl(s,a+a*Jl(l),o-o*Yl(l))):Zl(s,a,0);for(let e=1;e<2*n;e++)c=e*Xl/n+l,Ql(s,a+(e%2==0?a:a*r)*Jl(c),o-(e%2==0?o:o*r)*Yl(c));$l(s)}};Y([U(ul)],eu.prototype,`__`,void 0),Y([H(5)],eu.prototype,`corners`,void 0),Y([H(.382)],eu.prototype,`innerRadius`,void 0),Y([H(0)],eu.prototype,`startAngle`,void 0),eu=Y([W()],eu);var{moveTo:tu,lineTo:nu,drawPoints:ru}=Hr,{rotate:iu,getAngle:au,getDistance:ou,defaultPoint:su}=k,cu=class extends Z{get __tag(){return`Line`}get toPoint(){let{width:e,rotation:t}=this.__,n=fe();return e&&(n.x=e),t&&iu(n,t),n}set toPoint(e){this.width=ou(su,e),this.rotation=au(su,e),this.height&&=0}__updatePath(){let e=this.__,t=e.path=[];e.points?ru(t,e.points,e.curve,e.closed):(tu(t,0,0),nu(t,this.width,0))}};Y([U(ol)],cu.prototype,`__`,void 0),Y([Ra(`center`)],cu.prototype,`strokeAlign`,void 0),Y([V(0)],cu.prototype,`height`,void 0),Y([H()],cu.prototype,`points`,void 0),Y([H(0)],cu.prototype,`curve`,void 0),Y([H(!1)],cu.prototype,`closed`,void 0),cu=Y([W()],cu);var lu=class extends kl{get __tag(){return`Image`}get ready(){let{image:e}=this;return e&&e.ready}get image(){let{fill:e}=this.__;return l(e)&&e[0].image}};Y([U(hl)],lu.prototype,`__`,void 0),Y([V(``)],lu.prototype,`url`,void 0),lu=Y([W()],lu);var uu=lu,du=class extends kl{get __tag(){return`Canvas`}get context(){return this.canvas.context}get ready(){return!this.url}constructor(e){super(e),this.canvas=At.canvas(this.__),e&&e.url&&this.drawImage(e.url)}drawImage(e){new Sa({url:e}).load(e=>{this.context.drawImage(e.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new Qo(Qo.LOADED,{image:e}))})}draw(e,t,n,r){let i=new ze(e.worldTransform).invert(),a=new ze;t&&a.translate(t.x,t.y),n&&(o(n)?a.scale(n):a.scale(n.x,n.y)),r&&a.rotate(r),i.multiplyParent(a),e.__render(this.canvas,{matrix:i.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(e,t){let{width:n,height:r}=this.__,{view:i}=this.canvas;e.drawImage(i,0,0,i.width,i.height,0,0,n,r)}__updateSize(){let{canvas:e}=this;if(e){let{smooth:t,safeResize:n}=this.__;e.resize(this.__,n),e.smooth!==t&&(e.smooth=t)}}destroy(){this.canvas&&=(this.canvas.destroy(),null),super.destroy()}};Y([U(gl)],du.prototype,`__`,void 0),Y([Pc(100)],du.prototype,`width`,void 0),Y([Pc(100)],du.prototype,`height`,void 0),Y([Pc(1)],du.prototype,`pixelRatio`,void 0),Y([Pc(!0)],du.prototype,`smooth`,void 0),Y([B(!1)],du.prototype,`safeResize`,void 0),Y([Pc()],du.prototype,`contextSettings`,void 0),du=Y([W()],du);var{copyAndSpread:fu,includes:pu,setList:mu}=A,{stintSet:hu}=p,$=class extends Z{get __tag(){return`Text`}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){let e=this.__,{lineHeight:t,letterSpacing:n,fontFamily:r,fontSize:i,fontWeight:a,italic:o,textCase:s,textOverflow:c,padding:l,width:u,height:d}=e;e.__lineHeight=zc.number(t,i),e.__letterSpacing=zc.number(n,i),e.__baseLine=e.__lineHeight-(e.__lineHeight-.7*i)/2,e.__font=`${o?`italic `:``}${s===`small-caps`?`small-caps `:``}${a===`normal`?``:a+` `}${i||12}px ${r||`caption`}`,hu(e,`__padding`,l&&T.fourNumber(l)),hu(e,`__clipText`,c!==`show`&&!e.__autoSize),hu(e,`__isCharMode`,u||d||e.__letterSpacing||s!==`none`),e.__textDrawData=Lc.getDrawData((e.__isPlacehold=e.placeholder&&e.text===``)?e.placeholder:e.text,this.__)}__updateBoxBounds(){let e=this.__,t=this.__layout,{fontSize:n,italic:r,padding:i,__autoWidth:a,__autoHeight:o}=e;this.__updateTextDrawData();let{bounds:s}=e.__textDrawData,c=t.boxBounds;if(t.contentBounds=s,e.__lineHeight<n&&(t.renderChanged=!0),a||o){if(c.x=a?s.x:0,c.y=o?s.y:0,c.width=a?s.width:e.width,c.height=o?s.height:e.height,i){let[t,n,r,i]=e.__padding;a&&(c.x-=i,c.width+=n+i),o&&(c.y-=t,c.height+=r+t)}this.__updateNaturalSize()}else super.__updateBoxBounds();r&&(c.width+=.16*n),p.stintSet(this,`isOverflow`,!pu(c,s)),this.isOverflow?(mu(e.__textBoxBounds={},[c,s]),t.renderChanged=!0):e.__textBoxBounds=c}__updateRenderSpread(){let e=super.__updateRenderSpread();e||=+!!this.isOverflow;let{__lineHeight:t,fontSize:n}=this.__;return t<n&&(e=C.max(e,(n-t)/2)),e}__updateRenderBounds(){let{renderBounds:e,renderSpread:t}=this.__layout;fu(e,this.__.__textBoxBounds,t),this.__box&&(this.__box.__layout.renderBounds=e)}__updateChange(){super.__updateChange();let e=this.__box;e&&(e.__onUpdateSize(),e.__updateChange())}__drawRenderPath(e){e.font=this.__.__font}__draw(e,t,n){let r=this.__box;r&&(r.__nowWorld=this.__nowWorld,r.__draw(e,t,n)),this.textEditing&&!t.exporting||super.__draw(e,t,n)}__drawShape(e,t){t.shape&&this.__box&&this.__box.__drawShape(e,t),super.__drawShape(e,t)}destroy(){this.boxStyle&&=null,super.destroy()}};Y([U(ml)],$.prototype,`__`,void 0),Y([V(0)],$.prototype,`width`,void 0),Y([V(0)],$.prototype,`height`,void 0),Y([Ha()],$.prototype,`boxStyle`,void 0),Y([B(!1)],$.prototype,`resizeFontSize`,void 0),Y([Ha(`#000000`)],$.prototype,`fill`,void 0),Y([Ra(`outside`)],$.prototype,`strokeAlign`,void 0),Y([Za(`all`)],$.prototype,`hitFill`,void 0),Y([V(``)],$.prototype,`text`,void 0),Y([V(``)],$.prototype,`placeholder`,void 0),Y([V(`caption`)],$.prototype,`fontFamily`,void 0),Y([V(12)],$.prototype,`fontSize`,void 0),Y([V(`normal`)],$.prototype,`fontWeight`,void 0),Y([V(!1)],$.prototype,`italic`,void 0),Y([V(`none`)],$.prototype,`textCase`,void 0),Y([V(`none`)],$.prototype,`textDecoration`,void 0),Y([V(0)],$.prototype,`letterSpacing`,void 0),Y([V({type:`percent`,value:1.5})],$.prototype,`lineHeight`,void 0),Y([V(0)],$.prototype,`paraIndent`,void 0),Y([V(0)],$.prototype,`paraSpacing`,void 0),Y([V(`x`)],$.prototype,`writingMode`,void 0),Y([V(`left`)],$.prototype,`textAlign`,void 0),Y([V(`top`)],$.prototype,`verticalAlign`,void 0),Y([V(!0)],$.prototype,`autoSizeAlign`,void 0),Y([V(`normal`)],$.prototype,`textWrap`,void 0),Y([V(`show`)],$.prototype,`textOverflow`,void 0),Y([Ha(!1)],$.prototype,`textEditing`,void 0),$=Y([W()],$);var gu=class extends Z{get __tag(){return`Path`}};Y([U(dl)],gu.prototype,`__`,void 0),Y([Ra(`center`)],gu.prototype,`strokeAlign`,void 0),gu=Y([W()],gu);var _u=class extends Tl{get __tag(){return`Pen`}setStyle(e){let t=this.pathElement=new gu(e);return this.pathStyle=e,this.__path=t.path||=[],this.add(t),this}beginPath(){return this}moveTo(e,t){return this}lineTo(e,t){return this}bezierCurveTo(e,t,n,r,i,a){return this}quadraticCurveTo(e,t,n,r){return this}closePath(){return this}rect(e,t,n,r){return this}roundRect(e,t,n,r,i){return this}ellipse(e,t,n,r,i,a,o,s){return this}arc(e,t,n,r,i,a){return this}arcTo(e,t,n,r,i){return this}drawEllipse(e,t,n,r,i,a,o,s){return this}drawArc(e,t,n,r,i,a){return this}drawPoints(e,t,n){return this}clearPath(){return this}paint(){let{pathElement:e}=this;e.__layout.boxChanged||e.forceUpdate(`path`)}};Y([U(fl)],_u.prototype,`__`,void 0),Y([(e,t)=>{Ta(e,t,{get(){return this.__path}})}],_u.prototype,`path`,void 0),_u=Y([so(ai,[`set`,`path`,`paint`]),W()],_u);export{V as $,ua as $n,Qi as $t,ul as A,c as An,Qa as Ar,Yt as At,du as B,Ye as Bn,_t as Bt,cl as C,h as Cn,Fn as Cr,co as Ct,Cl as D,g as Dn,Ve as Dr,Va as Dt,Rc as E,ze as En,Aa as Er,Fs as Et,eu as F,oa as Fn,H as Ft,uu as G,ja as Gn,an as Gt,rl as H,kt as Hn,Ba as Ht,nl as I,eo as In,Hr as It,Ol as J,o as Jn,ai as Jt,ll as K,Pn as Kn,aa as Kt,Nc as L,Xo as Ln,za as Lt,$ as M,Ca as Mn,ue as Mt,dl as N,i as Nn,Ja as Nt,yl as O,B as On,me as Or,Lo as Ot,lu as P,bi as Pn,jc as Pt,W as Q,Re as Qn,Zt as Qt,_u as R,Ac as Rn,D as Rt,el as S,ss as Sn,Ma as Sr,vt as St,Fl as T,ka as Tn,Lt as Tr,M as Tt,ml as U,wa as Un,Mc as Ut,xl as V,l as Vn,Ha as Vt,fl as W,Tn as Wn,Ra as Wt,Kc as X,yc as Xn,Zo as Xt,Z as Y,Et as Yn,sa as Yt,ma as Z,Oa as Zn,E as Zt,sl as _,u as _n,Os as _r,ht as _t,Lc as a,Xa as an,n as ar,Us as at,Uc as b,Ta as bn,Do as br,Jt as bt,Wc as c,p as cn,va as cr,qt as ct,Hc as d,Sa as dn,ga as dr,rn as dt,pe as en,io as er,Ke as et,ol as f,k as fn,f as fr,U as ft,zc as g,Ea as gn,C as gr,$o as gt,ql as h,d as hn,bo as hr,la as ht,Q as i,Ws as in,yr as ir,de as it,cu as j,ps as jn,Jo as jr,Ga as jt,gu as k,Be as kn,nn as kr,T as kt,Bc as l,z as ln,e as lr,Ua as lt,qc as m,Pa as mn,Da as mr,A as mt,Fc as n,qo as nn,r as nr,Ia as nt,zl as o,pa as on,cs as or,$t as ot,Gc as p,Es as pn,Mt as pr,q as pt,Tl as q,a as qn,$a as qt,Ic as r,fe as rn,J as rr,jo as rt,Vc as s,so as sn,N as sr,Ya as st,al as t,Za as tn,gt as tr,kc as tt,il as u,Le as un,os as ur,qs as ut,Pc as v,hs as vn,Fa as vr,Qo as vt,hl as w,Ft as wn,Ue as wr,as as wt,X as x,t as xn,We as xr,Wa as xt,kl as y,At as yn,Na as yr,mt as yt,gl as z,La as zn,ao as zt};