UNPKG

@leafer-draw/worker

Version:
3 lines (2 loc) 35.2 kB
"use strict";var t=require("@leafer/core"),e=require("@leafer-ui/draw");class n extends t.LeaferCanvasBase{get allowBackgroundColor(){return!0}init(){this.__createView(),this.__createContext(),this.resize(this.config)}__createView(){this.view=t.Platform.origin.createCanvas(1,1)}updateViewSize(){const{width:t,height:e,pixelRatio:n}=this;this.view.width=Math.ceil(t*n),this.view.height=Math.ceil(e*n),this.clientBounds=this.bounds}}t.canvasPatch(OffscreenCanvasRenderingContext2D.prototype),t.canvasPatch(Path2D.prototype);const{mineType:a}=t.FileHelper;function i(e,n){t.Platform.origin={createCanvas:(t,e)=>new OffscreenCanvas(t,e),canvasToDataURL:(t,e,n)=>new Promise(((i,o)=>{t.convertToBlob({type:a(e),quality:n}).then((t=>{var e=new FileReader;e.onload=t=>i(t.target.result),e.onerror=t=>o(t),e.readAsDataURL(t)})).catch((t=>{o(t)}))})),canvasToBolb:(t,e,n)=>t.convertToBlob({type:a(e),quality:n}),canvasSaveAs:(t,e,n)=>new Promise((t=>t())),download(t,e){},loadImage:e=>new Promise(((n,a)=>{let i=new XMLHttpRequest;i.open("GET",t.Platform.image.getRealURL(e),!0),i.responseType="blob",i.onload=()=>{createImageBitmap(i.response).then((t=>{n(t)})).catch((t=>{a(t)}))},i.onerror=t=>a(t),i.send()}))},t.Platform.canvas=t.Creator.canvas(),t.Platform.conicGradientSupport=!!t.Platform.canvas.context.createConicGradient}Object.assign(t.Creator,{canvas:(t,e)=>new n(t,e),image:e=>new t.LeaferImage(e)}),t.Platform.name="web",t.Platform.isWorker=!0,t.Platform.backgrounder=!0,t.Platform.requestRender=function(t){requestAnimationFrame(t)},t.defineKey(t.Platform,"devicePixelRatio",{get:()=>1});const{userAgent:o}=navigator;o.indexOf("Firefox")>-1?(t.Platform.conicGradientRotate90=!0,t.Platform.intWheelDeltaY=!0):o.indexOf("Safari")>-1&&-1===o.indexOf("Chrome")&&(t.Platform.fullImageShadow=!0),o.indexOf("Windows")>-1?(t.Platform.os="Windows",t.Platform.intWheelDeltaY=!0):o.indexOf("Mac")>-1?t.Platform.os="Mac":o.indexOf("Linux")>-1&&(t.Platform.os="Linux");class r{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove){const e=new t.LeafList;return this.__updatedList.list.forEach((t=>{t.leafer&&e.add(t)})),e}return this.__updatedList}constructor(e,n){this.totalTimes=0,this.config={},this.__updatedList=new t.LeafList,this.target=e,n&&(this.config=t.DataHelper.default(n,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(t.RenderEvent.REQUEST)}__onAttrChange(t){this.__updatedList.add(t.target),this.update()}__onChildEvent(e){e.type===t.ChildEvent.ADD?(this.hasAdd=!0,this.__pushChild(e.child)):(this.hasRemove=!0,this.__updatedList.add(e.parent)),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,n=e.length;t<n;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new t.WatchEvent(t.WatchEvent.DATA,{updatedList:this.updatedList})),this.__updatedList=new t.LeafList,this.totalTimes++,this.changed=!1,this.hasVisible=!1,this.hasRemove=!1,this.hasAdd=!1}__listenEvents(){const{target:e}=this;this.__eventIds=[e.on_(t.PropertyEvent.CHANGE,this.__onAttrChange,this),e.on_([t.ChildEvent.ADD,t.ChildEvent.REMOVE],this.__onChildEvent,this),e.on_(t.WatchEvent.REQUEST,this.__onRquestData,this)]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=null,this.__updatedList=null)}}const{updateAllMatrix:s,updateBounds:d,updateChange:l}=t.LeafHelper,{pushAllChildBranch:c,pushAllParent:h}=t.BranchHelper;const{worldBounds:u}=t.LeafBoundsHelper;class f{constructor(e){this.updatedBounds=new t.Bounds,this.beforeBounds=new t.Bounds,this.afterBounds=new t.Bounds,e instanceof Array&&(e=new t.LeafList(e)),this.updatedList=e}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,u)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,u),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:p,updateAllChange:g}=t.LeafHelper,_=t.Debug.get("Layouter");class w{constructor(e,n){this.totalTimes=0,this.config={},this.__levelList=new t.LeafLevelList,this.target=e,n&&(this.config=t.DataHelper.default(n,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(!this.running)return;const{target:e}=this;this.times=0;try{e.emit(t.LayoutEvent.START),this.layoutOnce(),e.emitEvent(new t.LayoutEvent(t.LayoutEvent.END,this.layoutedBlocks,this.times))}catch(t){_.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?_.warn("layouting"):this.times>3?_.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(t.WatchEvent.REQUEST),this.totalTimes>1?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var e;if(!(null===(e=this.__updatedList)||void 0===e?void 0:e.length))return;const n=t.Run.start("PartLayout"),{target:a,__updatedList:i}=this,{BEFORE:o,LAYOUT:r,AFTER:u}=t.LayoutEvent,f=this.getBlocks(i);f.forEach((t=>t.setBefore())),a.emitEvent(new t.LayoutEvent(o,f,this.times)),this.extraBlock=null,i.sort(),function(t,e){let n;t.list.forEach((t=>{n=t.__layout,e.without(t)&&!n.proxyZoom&&(n.matrixChanged?(s(t,!0),e.add(t),t.isBranch&&c(t,e),h(t,e)):n.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),h(t,e)))}))}(i,this.__levelList),function(t){let e,n,a;t.sort(!0),t.levels.forEach((i=>{e=t.levelMap[i];for(let t=0,i=e.length;t<i;t++){if(n=e[t],n.isBranch&&n.__tempNumber){a=n.children;for(let t=0,e=a.length;t<e;t++)a[t].isBranch||d(a[t])}d(n)}}))}(this.__levelList),function(t){t.list.forEach(l)}(i),this.extraBlock&&f.push(this.extraBlock),f.forEach((t=>t.setAfter())),a.emitEvent(new t.LayoutEvent(r,f,this.times)),a.emitEvent(new t.LayoutEvent(u,f,this.times)),this.addBlocks(f),this.__levelList.reset(),this.__updatedList=null,t.Run.end(n)}fullLayout(){const e=t.Run.start("FullLayout"),{target:n}=this,{BEFORE:a,LAYOUT:i,AFTER:o}=t.LayoutEvent,r=this.getBlocks(new t.LeafList(n));n.emitEvent(new t.LayoutEvent(a,r,this.times)),w.fullLayout(n),r.forEach((t=>{t.setAfter()})),n.emitEvent(new t.LayoutEvent(i,r,this.times)),n.emitEvent(new t.LayoutEvent(o,r,this.times)),this.addBlocks(r),t.Run.end(e)}static fullLayout(e){p(e,!0),e.isBranch?t.BranchHelper.updateBounds(e):t.LeafHelper.updateBounds(e),g(e)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:n}=this.extraBlock||(this.extraBlock=new f([]));e.length?n.add(t.__world):n.set(t.__world),e.add(t)}}createBlock(t){return new f(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){const{target:e}=this;this.__eventIds=[e.on_(t.LayoutEvent.REQUEST,this.layout,this),e.on_(t.LayoutEvent.AGAIN,this.layoutAgain,this),e.on_(t.WatchEvent.DATA,this.__onReceiveWatchData,this)]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const y=t.Debug.get("Renderer");class m{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(e,n,a){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,maxFPS:60},this.target=e,this.canvas=n,a&&(this.config=t.DataHelper.default(a,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.__requestRender()}requestLayout(){this.target.emit(t.LayoutEvent.REQUEST)}checkRender(){if(this.running){const{target:e}=this;e.isApp&&(e.emit(t.RenderEvent.CHILD_START,e),e.children.forEach((t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()})),e.emit(t.RenderEvent.CHILD_END,e)),this.changed&&this.canvas.view&&this.render(),this.target.emit(t.RenderEvent.NEXT)}}render(e){if(!this.running||!this.canvas.view)return this.update();const{target:n}=this;this.times=0,this.totalBounds=new t.Bounds,y.log(n.innerName,"---\x3e");try{this.emitRender(t.RenderEvent.START),this.renderOnce(e),this.emitRender(t.RenderEvent.END,this.totalBounds),t.ImageManager.clearRecycled()}catch(t){this.rendering=!1,y.error(t)}y.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(e){if(this.rendering)return y.warn("rendering");if(this.times>3)return y.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new t.Bounds,this.renderOptions={},e)this.emitRender(t.RenderEvent.BEFORE),e();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(t.RenderEvent.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(t.RenderEvent.RENDER,this.renderBounds,this.renderOptions),this.emitRender(t.RenderEvent.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach((e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)})))}clipRender(e){const n=t.Run.start("PartRender"),{canvas:a}=this,i=e.getIntersect(a.bounds),o=new t.Bounds(i);a.save(),i.spread(m.clipSpread).ceil(),a.clearWorld(i,!0),a.clipWorld(i,!0),this.__render(i,o),a.restore(),t.Run.end(n)}fullRender(){const e=t.Run.start("FullRender"),{canvas:n}=this;n.save(),n.clear(),this.__render(n.bounds),n.restore(),t.Run.end(e)}__render(e,n){const{canvas:a}=this,i=e.includes(this.target.__world),o=i?{includes:i}:{bounds:e,includes:i};this.needFill&&a.fillWorld(e,this.config.fill),t.Debug.showRepaint&&t.Debug.drawRepaint(a,e),this.target.__render(a,o),this.renderBounds=n=n||e,this.renderOptions=o,this.totalBounds.isEmpty()?this.totalBounds=n:this.totalBounds.add(n),a.updateRender(n)}addBlock(t){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:e}=this;if(e){const n=new t.Bounds;n.setList(e),e.length=0,e.push(n)}}__requestRender(){const e=this.target;if(this.requestTime||!e)return;if(e.parentApp)return e.parentApp.requestRender(!1);const n=this.requestTime=Date.now();t.Platform.requestRender((()=>{this.FPS=Math.min(60,Math.ceil(1e3/(Date.now()-n))),this.requestTime=0,this.checkRender()}))}__onResize(e){if(!this.canvas.unreal){if(e.bigger||!e.samePixelRatio){const{width:n,height:a}=e.old;if(!new t.Bounds(0,0,n,a).includes(this.target.__world)||this.needFill||!e.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new t.Bounds(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map((t=>{let e;t.updatedList&&t.updatedList.list.some((t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||y.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e))),this.addBlock(e?this.canvas.bounds:t.updatedBounds)}))}emitRender(e,n,a){this.target.emitEvent(new t.RenderEvent(e,this.times,n,a))}__listenEvents(){const{target:e}=this;this.__eventIds=[e.on_(t.RenderEvent.REQUEST,this.update,this),e.on_(t.LayoutEvent.END,this.__onLayoutEnd,this),e.on_(t.RenderEvent.AGAIN,this.renderAgain,this),e.on_(t.ResizeEvent.RESIZE,this.__onResize,this)]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.canvas=this.config=null)}}function v(t,e){const n=t.__,{rows:a,decorationY:i}=n.__textDrawData;let o;n.__isPlacehold&&n.placeholderColor&&(e.fillStyle=n.placeholderColor);for(let t=0,n=a.length;t<n;t++)o=a[t],o.text?e.fillText(o.text,o.x,o.y):o.data&&o.data.forEach((t=>{e.fillText(t.char,t.x,o.y)}));if(i){const{decorationColor:t,decorationHeight:o}=n.__textDrawData;t&&(e.fillStyle=t),a.forEach((t=>i.forEach((n=>e.fillRect(t.x,t.y+n,t.width,o)))))}}function x(t,e){t.__.__font?v(t,e):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function b(t,e,n){const{strokeAlign:a}=e.__,i="string"!=typeof t;switch(a){case"center":n.setStroke(i?void 0:t,e.__.strokeWidth,e.__),i?R(t,!0,e,n):B(e,n);break;case"inside":E("inside",t,i,e,n);break;case"outside":E("outside",t,i,e,n)}}function E(t,e,n,a,i){const{__strokeWidth:o,__font:r}=a.__,s=i.getSameCanvas(!0,!0);s.setStroke(n?void 0:e,2*o,a.__),s.font=r,n?R(e,!0,a,s):B(a,s),s.blendMode="outside"===t?"destination-out":"destination-in",v(a,s),s.blendMode="normal",a.__worldFlipped?i.copyWorldByReset(s,a.__nowWorld):i.copyWorldToInner(s,a.__nowWorld,a.__layout.renderBounds),s.recycle(a.__nowWorld)}function B(t,e){let n,a=t.__.__textDrawData;const{rows:i,decorationY:o}=a;for(let t=0,a=i.length;t<a;t++)n=i[t],n.text?e.strokeText(n.text,n.x,n.y):n.data&&n.data.forEach((t=>{e.strokeText(t.char,t.x,n.y)}));if(o){const{decorationHeight:t}=a;i.forEach((n=>o.forEach((a=>e.strokeRect(n.x,n.y+a,n.width,t)))))}}function R(t,n,a,i){let o;for(let r=0,s=t.length;r<s;r++)o=t[r],o.image&&e.PaintImage.checkImage(a,i,o,!1)||o.style&&(i.strokeStyle=o.style,o.blendMode?(i.saveBlendMode(o.blendMode),n?B(a,i):i.stroke(),i.restoreBlendMode()):n?B(a,i):i.stroke())}function L(t,e){t.__.dashPattern&&(e.beginPath(),t.__drawPathByData(e,t.__.__pathForArrow),e.dashPattern=null,e.stroke())}m.clipSpread=10,Object.assign(t.Creator,{watcher:(t,e)=>new r(t,e),layouter:(t,e)=>new w(t,e),renderer:(t,e,n)=>new m(t,e,n),selector:(t,e)=>{},interaction:(t,e,n,a)=>{}}),t.Platform.layout=w.fullLayout;const{getSpread:k,getOuterOf:S,getByMove:P,getIntersectData:C}=t.BoundsHelper;let A;function W(t,n,a){if("object"!=typeof n||!1===n.visible||0===n.opacity)return;const{boxBounds:i}=a.__layout;switch(n.type){case"solid":let{type:o,blendMode:r,color:s,opacity:d}=n;return{type:o,blendMode:r,style:e.ColorConvert.string(s,d)};case"image":return e.PaintImage.image(a,t,n,i,!A||!A[n.url]);case"linear":return e.PaintGradient.linearGradient(n,i);case"radial":return e.PaintGradient.radialGradient(n,i);case"angular":return e.PaintGradient.conicGradient(n,i);default:return void 0!==n.r?{type:"solid",style:e.ColorConvert.string(n)}:void 0}}const O={compute:function(t,n){const a=n.__,i=[];let o,r=a.__input[t];r instanceof Array||(r=[r]),A=e.PaintImage.recycleImage(t,a);for(let e,a=0,o=r.length;a<o;a++)e=W(t,r[a],n),e&&i.push(e);a["_"+t]=i.length?i:void 0,i.length&&i[0].image&&(o=i[0].image.hasOpacityPixel),"fill"===t?a.__pixelFill=o:a.__pixelStroke=o},fill:function(t,e,n){n.fillStyle=t,x(e,n)},fills:function(t,n,a){let i;for(let o=0,r=t.length;o<r;o++){if(i=t[o],i.image){if(e.PaintImage.checkImage(n,a,i,!n.__.__font))continue;if(!i.style){!o&&i.image.isPlacehold&&n.drawImagePlaceholder(a,i.image);continue}}a.fillStyle=i.style,i.transform?(a.save(),a.transform(i.transform),i.blendMode&&(a.blendMode=i.blendMode),x(n,a),a.restore()):i.blendMode?(a.saveBlendMode(i.blendMode),x(n,a),a.restoreBlendMode()):x(n,a)}},fillPathOrText:x,fillText:v,stroke:function(t,e,n){const a=e.__,{__strokeWidth:i,strokeAlign:o,__font:r}=a;if(i)if(r)b(t,e,n);else switch(o){case"center":n.setStroke(t,i,a),n.stroke(),a.__useArrow&&L(e,n);break;case"inside":n.save(),n.setStroke(t,2*i,a),a.windingRule?n.clip(a.windingRule):n.clip(),n.stroke(),n.restore();break;case"outside":const o=n.getSameCanvas(!0,!0);o.setStroke(t,2*i,a),e.__drawRenderPath(o),o.stroke(),a.windingRule?o.clip(a.windingRule):o.clip(),o.clearWorld(e.__layout.renderBounds),e.__worldFlipped?n.copyWorldByReset(o,e.__nowWorld):n.copyWorldToInner(o,e.__nowWorld,e.__layout.renderBounds),o.recycle(e.__nowWorld)}},strokes:function(t,e,n){const a=e.__,{__strokeWidth:i,strokeAlign:o,__font:r}=a;if(i)if(r)b(t,e,n);else switch(o){case"center":n.setStroke(void 0,i,a),R(t,!1,e,n),a.__useArrow&&L(e,n);break;case"inside":n.save(),n.setStroke(void 0,2*i,a),a.windingRule?n.clip(a.windingRule):n.clip(),R(t,!1,e,n),n.restore();break;case"outside":const{renderBounds:o}=e.__layout,r=n.getSameCanvas(!0,!0);e.__drawRenderPath(r),r.setStroke(void 0,2*i,a),R(t,!1,e,r),a.windingRule?r.clip(a.windingRule):r.clip(),r.clearWorld(o),e.__worldFlipped?n.copyWorldByReset(r,e.__nowWorld):n.copyWorldToInner(r,e.__nowWorld,o),r.recycle(e.__nowWorld)}},strokeText:b,drawTextStroke:B,shape:function(t,e,n){const a=e.getSameCanvas(),i=t.__nowWorld;let o,r,s,d,{scaleX:l,scaleY:c}=i;if(l<0&&(l=-l),c<0&&(c=-c),e.bounds.includes(i))d=a,o=s=i;else{const{renderShapeSpread:a}=t.__layout,h=C(a?k(e.bounds,l===c?a*l:[a*c,a*l]):e.bounds,i);r=e.bounds.getFitMatrix(h);let{a:u,d:f}=r;if(r.a<1&&(d=e.getSameCanvas(),t.__renderShape(d,n),l*=u,c*=f),s=S(i,r),o=P(s,-r.e,-r.f),n.matrix){const{matrix:t}=n;r.multiply(t),u*=t.scaleX,f*=t.scaleY}n=Object.assign(Object.assign({},n),{matrix:r.withScale(u,f)})}return t.__renderShape(a,n),{canvas:a,matrix:r,bounds:o,worldCanvas:d,shapeBounds:s,scaleX:l,scaleY:c}}};let M={};const{get:T,rotateOfOuter:I,translate:D,scaleOfOuter:H,scale:F,rotate:G}=t.MatrixHelper;function j(t,e,n,a,i,o,r){const s=T();D(s,e.x+n,e.y+a),F(s,i,o),r&&I(s,{x:e.x+e.width/2,y:e.y+e.height/2},r),t.transform=s}function z(t,e,n,a,i,o,r){const s=T();D(s,e.x+n,e.y+a),i&&F(s,i,o),r&&G(s,r),t.transform=s}function Y(t,e,n,a,i,o,r,s,d,l){const c=T();if(d)if("center"===l)I(c,{x:n/2,y:a/2},d);else switch(G(c,d),d){case 90:D(c,a,0);break;case 180:D(c,n,a);break;case 270:D(c,0,n)}M.x=e.x+i,M.y=e.y+o,D(c,M.x,M.y),r&&H(c,M,r,s),t.transform=c}const{get:q,translate:U}=t.MatrixHelper,N=new t.Bounds,X={},V={};function Q(t,e,n,a){const{blendMode:i,changeful:o,sync:r}=n;i&&(t.blendMode=i),o&&(t.changeful=o),r&&(t.sync=r),t.data=Z(n,a,e)}function Z(e,n,a){let{width:i,height:o}=a;e.padding&&(n=N.set(n).shrink(e.padding)),"strench"===e.mode&&(e.mode="stretch");const{opacity:r,mode:s,align:d,offset:l,scale:c,size:h,rotation:u,repeat:f,filters:p}=e,g=n.width===i&&n.height===o,_={mode:s},w="center"!==d&&(u||0)%180==90,y=w?o:i,m=w?i:o;let v,x,b=0,E=0;if(s&&"cover"!==s&&"fit"!==s)(c||h)&&(t.MathHelper.getScaleData(c,h,a,V),v=V.scaleX,x=V.scaleY);else if(!g||u){const t=n.width/y,e=n.height/m;v=x="fit"===s?Math.min(t,e):Math.max(t,e),b+=(n.width-i*v)/2,E+=(n.height-o*x)/2}if(d){const e={x:b,y:E,width:y,height:m};v&&(e.width*=v,e.height*=x),t.AlignHelper.toPoint(d,e,n,X,!0),b+=X.x,E+=X.y}switch(l&&(b+=l.x,E+=l.y),s){case"stretch":g||(i=n.width,o=n.height);break;case"normal":case"clip":(b||E||v||u)&&z(_,n,b,E,v,x,u);break;case"repeat":(!g||v||u)&&Y(_,n,i,o,b,E,v,x,u,d),f||(_.repeat="repeat");break;default:v&&j(_,n,b,E,v,x,u)}return _.transform||(n.x||n.y)&&(_.transform=q(),U(_.transform,n.x,n.y)),v&&"stretch"!==s&&(_.scaleX=v,_.scaleY=x),_.width=i,_.height=o,r&&(_.opacity=r),p&&(_.filters=p),f&&(_.repeat="string"==typeof f?"x"===f?"repeat-x":"repeat-y":"repeat"),_}let K,$=new t.Bounds;const{isSame:J}=t.BoundsHelper;function tt(t,e,n,a,i,o){if("fill"===e&&!t.__.__naturalWidth){const e=t.__;if(e.__naturalWidth=a.width/e.pixelRatio,e.__naturalHeight=a.height/e.pixelRatio,e.__autoSide)return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",e.width),t.setProxyAttr("height",e.height)),!1}return i.data||Q(i,a,n,o),!0}function et(e,n){it(e,t.ImageEvent.LOAD,n)}function nt(e,n){it(e,t.ImageEvent.LOADED,n)}function at(e,n,a){n.error=a,e.forceUpdate("surface"),it(e,t.ImageEvent.ERROR,n)}function it(e,n,a){e.hasEvent(n)&&e.emitEvent(new t.ImageEvent(n,a))}function ot(t,e){const{leafer:n}=t;n&&n.viewReady&&(n.renderer.ignore=e)}const{get:rt,scale:st,copy:dt}=t.MatrixHelper,{ceil:lt,abs:ct}=Math;function ht(e,n,a){let{scaleX:i,scaleY:o}=t.ImageManager.patternLocked?e.__world:e.__nowWorld;const r=i+"-"+o+"-"+a;if(n.patternId===r||e.destroyed)return!1;{i=ct(i),o=ct(o);const{image:e,data:s}=n;let d,l,{width:c,height:h,scaleX:u,scaleY:f,transform:p,repeat:g}=s;u&&(l=rt(),dt(l,p),st(l,1/u,1/f),i*=u,o*=f),i*=a,o*=a,c*=i,h*=o;const _=c*h;if(!g&&_>t.Platform.image.maxCacheSize)return!1;let w=t.Platform.image.maxPatternSize;if(!e.isSVG){const t=e.width*e.height;w>t&&(w=t)}_>w&&(d=Math.sqrt(_/w)),d&&(i/=d,o/=d,c/=d,h/=d),u&&(i/=u,o/=f),(p||1!==i||1!==o)&&(l||(l=rt(),p&&dt(l,p)),st(l,1/i,1/o));const y=e.getCanvas(lt(c)||1,lt(h)||1,s.opacity,s.filters),m=e.getPattern(y,g||t.Platform.origin.noRepeat||"no-repeat",l,n);return n.style=m,n.patternId=r,!0}}function ut(t,e,n,a){return new(n||(n=Promise))((function(i,o){function r(t){try{d(a.next(t))}catch(t){o(t)}}function s(t){try{d(a.throw(t))}catch(t){o(t)}}function d(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}d((a=a.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const{abs:ft}=Math;const pt={image:function(e,n,a,i,o){let r,s;const d=t.ImageManager.get(a);return K&&a===K.paint&&J(i,K.boxBounds)?r=K.leafPaint:(r={type:a.type,image:d},K=d.use>1?{leafPaint:r,paint:a,boxBounds:$.set(i)}:null),(o||d.loading)&&(s={image:d,attrName:n,attrValue:a}),d.ready?(tt(e,n,a,d,r,i),o&&(et(e,s),nt(e,s))):d.error?o&&at(e,s,d.error):(o&&(ot(e,!0),et(e,s)),r.loadId=d.load((()=>{ot(e,!1),e.destroyed||(tt(e,n,a,d,r,i)&&(d.hasOpacityPixel&&(e.__layout.hitCanvasChanged=!0),e.forceUpdate("surface")),nt(e,s)),r.loadId=null}),(t=>{ot(e,!1),at(e,s,t),r.loadId=null})),e.placeholderColor&&setTimeout((()=>{d.ready||d.isPlacehold||(d.isPlacehold=!0,e.forceUpdate("surface"))}),100)),r},checkImage:function(n,a,i,o){const{scaleX:r,scaleY:s}=t.ImageManager.patternLocked?n.__world:n.__nowWorld,{pixelRatio:d}=a,{data:l}=i;if(!l||i.patternId===r+"-"+s+"-"+d&&!e.Export.running)return!1;if(o)if(l.repeat)o=!1;else if(!(i.changeful||t.ResizeEvent.isResizing(n)||e.Export.running)){let{width:e,height:n}=l;e*=ft(r)*d,n*=ft(s)*d,l.scaleX&&(e*=l.scaleX,n*=l.scaleY),o=e*n>t.Platform.image.maxCacheSize}return o?(function(t,e,n,a){e.save(),t.windingRule?e.clip(t.windingRule):e.clip(),n.blendMode&&(e.blendMode=n.blendMode);a.opacity&&(e.opacity*=a.opacity);a.transform&&e.transform(a.transform);e.drawImage(n.image.getFull(a.filters),0,0,a.width,a.height),e.restore()}(n,a,i,l),!0):(!i.style||i.sync||e.Export.running?ht(n,i,d):i.patternTask||(i.patternTask=t.ImageManager.patternTasker.add((()=>ut(this,void 0,void 0,(function*(){i.patternTask=null,a.bounds.hit(n.__nowWorld)&&ht(n,i,d),n.forceUpdate("surface")}))),300)),!1)},createPattern:ht,recycleImage:function(e,n){const a=n["_"+e];if(a instanceof Array){let i,o,r,s,d;for(let l=0,c=a.length;l<c;l++)i=a[l],o=i.image,d=o&&o.url,d&&(r||(r={}),r[d]=!0,t.ImageManager.recycle(o),o.loading&&(s||(s=n.__input&&n.__input[e]||[],s instanceof Array||(s=[s])),o.unload(a[l].loadId,!s.some((t=>t.url===d)))));return r}return null},createData:Q,getPatternData:Z,fillOrFitMode:j,clipMode:z,repeatMode:Y},{toPoint:gt}=t.AroundHelper,_t={},wt={};function yt(t,n,a){if(n){let i;for(let o=0,r=n.length;o<r;o++)i=n[o],"string"==typeof i?t.addColorStop(o/(r-1),e.ColorConvert.string(i,a)):t.addColorStop(i.offset,e.ColorConvert.string(i.color,a))}}const{getAngle:mt,getDistance:vt}=t.PointHelper,{get:xt,rotateOfOuter:bt,scaleOfOuter:Et}=t.MatrixHelper,{toPoint:Bt}=t.AroundHelper,Rt={},Lt={};function kt(t,e,n,a,i){let o;const{width:r,height:s}=t;if(r!==s||a){const t=mt(e,n);o=xt(),i?(Et(o,e,r/s*(a||1),1),bt(o,e,t+90)):(Et(o,e,1,r/s*(a||1)),bt(o,e,t))}return o}const{getDistance:St}=t.PointHelper,{toPoint:Pt}=t.AroundHelper,Ct={},At={};const Wt={linearGradient:function(e,n){let{from:a,to:i,type:o,blendMode:r,opacity:s}=e;gt(a||"top",n,_t),gt(i||"bottom",n,wt);const d=t.Platform.canvas.createLinearGradient(_t.x,_t.y,wt.x,wt.y);yt(d,e.stops,s);const l={type:o,style:d};return r&&(l.blendMode=r),l},radialGradient:function(e,n){let{from:a,to:i,type:o,opacity:r,blendMode:s,stretch:d}=e;Bt(a||"center",n,Rt),Bt(i||"bottom",n,Lt);const l=t.Platform.canvas.createRadialGradient(Rt.x,Rt.y,0,Rt.x,Rt.y,vt(Rt,Lt));yt(l,e.stops,r);const c={type:o,style:l},h=kt(n,Rt,Lt,d,!0);return h&&(c.transform=h),s&&(c.blendMode=s),c},conicGradient:function(e,n){let{from:a,to:i,type:o,opacity:r,blendMode:s,stretch:d}=e;Pt(a||"center",n,Ct),Pt(i||"bottom",n,At);const l=t.Platform.conicGradientSupport?t.Platform.canvas.createConicGradient(0,Ct.x,Ct.y):t.Platform.canvas.createRadialGradient(Ct.x,Ct.y,0,Ct.x,Ct.y,St(Ct,At));yt(l,e.stops,r);const c={type:o,style:l},h=kt(n,Ct,At,d||1,t.Platform.conicGradientRotate90);return h&&(c.transform=h),s&&(c.blendMode=s),c},getTransform:kt},{copy:Ot,toOffsetOutBounds:Mt}=t.BoundsHelper,Tt={},It={};function Dt(e,n,a,i){const{bounds:o,shapeBounds:r}=i;if(t.Platform.fullImageShadow){if(Ot(Tt,e.bounds),Tt.x+=n.x-r.x,Tt.y+=n.y-r.y,a){const{matrix:t}=i;Tt.x-=(o.x+(t?t.e:0)+o.width/2)*(a-1),Tt.y-=(o.y+(t?t.f:0)+o.height/2)*(a-1),Tt.width*=a,Tt.height*=a}e.copyWorld(i.canvas,e.bounds,Tt)}else a&&(Ot(Tt,n),Tt.x-=n.width/2*(a-1),Tt.y-=n.height/2*(a-1),Tt.width*=a,Tt.height*=a),e.copyWorld(i.canvas,r,a?Tt:n)}const{toOffsetOutBounds:Ht}=t.BoundsHelper,Ft={};const Gt={shadow:function(t,n,a){let i,o;const{__nowWorld:r,__layout:s}=t,{shadow:d}=t.__,{worldCanvas:l,bounds:c,shapeBounds:h,scaleX:u,scaleY:f}=a,p=n.getSameCanvas(),g=d.length-1;Mt(c,It),d.forEach(((d,_)=>{p.setWorldShadow(It.offsetX+d.x*u,It.offsetY+d.y*f,d.blur*u,e.ColorConvert.string(d.color)),o=d.spread?1+2*d.spread/(s.boxBounds.width+2*(s.strokeBoxSpread||0)):0,Dt(p,It,o,a),i=c,d.box&&(p.restore(),p.save(),l&&(p.copyWorld(p,c,r,"copy"),i=r),l?p.copyWorld(l,r,r,"destination-out"):p.copyWorld(a.canvas,h,c,"destination-out")),t.__worldFlipped?n.copyWorldByReset(p,i,r,d.blendMode):n.copyWorldToInner(p,i,s.renderBounds,d.blendMode),g&&_<g&&p.clearWorld(i,!0)})),p.recycle(i)},innerShadow:function(t,n,a){let i,o;const{__nowWorld:r,__layout:s}=t,{innerShadow:d}=t.__,{worldCanvas:l,bounds:c,shapeBounds:h,scaleX:u,scaleY:f}=a,p=n.getSameCanvas(),g=d.length-1;Ht(c,Ft),d.forEach(((d,_)=>{p.save(),p.setWorldShadow(Ft.offsetX+d.x*u,Ft.offsetY+d.y*f,d.blur*u),o=d.spread?1-2*d.spread/(s.boxBounds.width+2*(s.strokeBoxSpread||0)):0,Dt(p,Ft,o,a),p.restore(),l?(p.copyWorld(p,c,r,"copy"),p.copyWorld(l,r,r,"source-out"),i=r):(p.copyWorld(a.canvas,h,c,"source-out"),i=c),p.fillWorld(i,e.ColorConvert.string(d.color),"source-in"),t.__worldFlipped?n.copyWorldByReset(p,i,r,d.blendMode):n.copyWorldToInner(p,i,s.renderBounds,d.blendMode),g&&_<g&&p.clearWorld(i,!0)})),p.recycle(i)},blur:function(t,e,n){const{blur:a}=t.__;n.setWorldBlur(a*t.__nowWorld.a),n.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),n.filter="none"},backgroundBlur:function(t,e,n){}},{excludeRenderBounds:jt}=t.LeafBoundsHelper;function zt(t,e,n,a,i,o){switch(e){case"grayscale":i.useGrayscaleAlpha(t.__nowWorld);case"alpha":!function(t,e,n,a){const i=t.__nowWorld;n.resetTransform(),n.opacity=1,n.useMask(a,i),a.recycle(i),qt(t,e,n,1)}(t,n,a,i);break;case"opacity-path":qt(t,n,a,o);break;case"path":n.restore()}}function Yt(t){return t.getSameCanvas(!1,!0)}function qt(t,e,n,a){const i=t.__nowWorld;e.resetTransform(),e.opacity=a,e.copyWorld(n,i),n.recycle(i)}e.Group.prototype.__renderMask=function(t,e){let n,a,i,o,r,s;const{children:d}=this;for(let l=0,c=d.length;l<c;l++)n=d[l],s=n.__.mask,s&&(r&&(zt(this,r,t,i,a,o),a=i=null),"path"===s||"clipping-path"===s?(n.opacity<1?(r="opacity-path",o=n.opacity,i||(i=Yt(t))):(r="path",t.save()),n.__clip(i||t,e)):(r="grayscale"===s?"grayscale":"alpha",a||(a=Yt(t)),i||(i=Yt(t)),n.__render(a,e)),"clipping"!==s&&"clipping-path"!==s)||jt(n,e)||n.__render(i||t,e);zt(this,r,t,i,a,o)};const Ut=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",Nt=Ut+"_#~&*+\\=|≮≯≈≠=…",Xt=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map((([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`)).join("|"));function Vt(t){const e={};return t.split("").forEach((t=>e[t]=!0)),e}const Qt=Vt("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),Zt=Vt("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),Kt=Vt(Ut),$t=Vt(Nt),Jt=Vt("- —/~|┆·");var te;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(te||(te={}));const{Letter:ee,Single:ne,Before:ae,After:ie,Symbol:oe,Break:re}=te;function se(t){return Qt[t]?ee:Jt[t]?re:Zt[t]?ae:Kt[t]?ie:$t[t]?oe:Xt.test(t)?ne:ee}const de={trimRight(t){const{words:e}=t;let n,a=0,i=e.length;for(let o=i-1;o>-1&&(n=e[o].data[0]," "===n.char);o--)a++,t.width-=n.width;a&&e.splice(i-a,a)}};function le(t,e,n){switch(e){case"title":return n?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:ce}=de,{Letter:he,Single:ue,Before:fe,After:pe,Symbol:ge,Break:_e}=te;let we,ye,me,ve,xe,be,Ee,Be,Re,Le,ke,Se,Pe,Ce,Ae,We,Oe,Me=[];function Te(t,e){Re&&!Be&&(Be=Re),we.data.push({char:t,width:e}),me+=e}function Ie(){ve+=me,we.width=me,ye.words.push(we),we={data:[]},me=0}function De(){Ce&&(Ae.paraNumber++,ye.paraStart=!0,Ce=!1),Re&&(ye.startCharSize=Be,ye.endCharSize=Re,Be=0),ye.width=ve,We.width?ce(ye):Oe&&He(),Me.push(ye),ye={words:[]},ve=0}function He(){ve>(Ae.maxWidth||0)&&(Ae.maxWidth=ve)}const{top:Fe,right:Ge,bottom:je,left:ze}=t.Direction4;function Ye(t,e,n){const{bounds:a,rows:i}=t;a[e]+=n;for(let t=0;t<i.length;t++)i[t][e]+=n}const qe={getDrawData:function(n,a){"string"!=typeof n&&(n=String(n));let i=0,o=0,r=a.__getInput("width")||0,s=a.__getInput("height")||0;const{textDecoration:d,__font:l,__padding:c}=a;c&&(r?(i=c[ze],r-=c[Ge]+c[ze]):a.autoSizeAlign||(i=c[ze]),s?(o=c[Fe],s-=c[Fe]+c[je]):a.autoSizeAlign||(o=c[Fe]));const h={bounds:{x:i,y:o,width:r,height:s},rows:[],paraNumber:0,font:t.Platform.canvas.font=l};return function(e,n,a){Ae=e,Me=e.rows,We=e.bounds,Oe=!We.width&&!a.autoSizeAlign;const{__letterSpacing:i,paraIndent:o,textCase:r}=a,{canvas:s}=t.Platform,{width:d,height:l}=We;if(d||l||i||"none"!==r){const t="none"!==a.textWrap,e="break"===a.textWrap;Ce=!0,ke=null,Be=Ee=Re=me=ve=0,we={data:[]},ye={words:[]};for(let a=0,l=n.length;a<l;a++)be=n[a],"\n"===be?(me&&Ie(),ye.paraEnd=!0,De(),Ce=!0):(Le=se(be),Le===he&&"none"!==r&&(be=le(be,r,!me)),Ee=s.measureText(be).width,i&&(i<0&&(Re=Ee),Ee+=i),Se=Le===ue&&(ke===ue||ke===he)||ke===ue&&Le!==pe,Pe=!(Le!==fe&&Le!==ue||ke!==ge&&ke!==pe),xe=Ce&&o?d-o:d,t&&d&&ve+me+Ee>xe&&(e?(me&&Ie(),ve&&De()):(Pe||(Pe=Le===he&&ke==pe),Se||Pe||Le===_e||Le===fe||Le===ue||me+Ee>xe?(me&&Ie(),ve&&De()):ve&&De()))," "===be&&!0!==Ce&&ve+me===0||(Le===_e?(" "===be&&me&&Ie(),Te(be,Ee),Ie()):Se||Pe?(me&&Ie(),Te(be,Ee)):Te(be,Ee)),ke=Le);me&&Ie(),ve&&De(),Me.length>0&&(Me[Me.length-1].paraEnd=!0)}else n.split("\n").forEach((t=>{Ae.paraNumber++,ve=s.measureText(t).width,Me.push({x:o||0,text:t,width:ve,paraStart:!0}),Oe&&He()}))}(h,n,a),c&&function(t,e,n,a,i){if(!a&&n.autoSizeAlign)switch(n.textAlign){case"left":Ye(e,"x",t[ze]);break;case"right":Ye(e,"x",-t[Ge])}if(!i&&n.autoSizeAlign)switch(n.verticalAlign){case"top":Ye(e,"y",t[Fe]);break;case"bottom":Ye(e,"y",-t[je])}}(c,h,a,r,s),function(t,e){const{rows:n,bounds:a}=t,i=n.length,{__lineHeight:o,__baseLine:r,__letterSpacing:s,__clipText:d,textAlign:l,verticalAlign:c,paraSpacing:h,autoSizeAlign:u}=e;let{x:f,y:p,width:g,height:_}=a,w=o*i+(h?h*(t.paraNumber-1):0),y=r;if(d&&w>_)w=Math.max(_,o),i>1&&(t.overflow=i);else if(_||u)switch(c){case"middle":p+=(_-w)/2;break;case"bottom":p+=_-w}y+=p;let m,v,x,b=g||u?g:t.maxWidth;for(let r=0,c=i;r<c;r++){if(m=n[r],m.x=f,m.width<g||m.width>g&&!d)switch(l){case"center":m.x+=(b-m.width)/2;break;case"right":m.x+=b-m.width}m.paraStart&&h&&r>0&&(y+=h),m.y=y,y+=o,t.overflow>r&&y>w&&(m.isOverflow=!0,t.overflow=r+1),v=m.x,x=m.width,s<0&&(m.width<0?(x=-m.width+e.fontSize+s,v-=x,x+=e.fontSize):x-=s),v<a.x&&(a.x=v),x>a.width&&(a.width=x),d&&g&&g<x&&(m.isOverflow=!0,t.overflow||(t.overflow=n.length))}a.y=p,a.height=w}(h,a),function(t,e,n){const{rows:a}=t,{textAlign:i,paraIndent:o,letterSpacing:r}=e;let s,d,l,c,h,u;a.forEach((t=>{t.words&&(l=o&&t.paraStart?o:0,u=t.words.length,d=n&&("justify"===i||"both"===i)&&u>1?(n-t.width-l)/(u-1):0,c=r||t.isOverflow?0:d>.01?1:2,t.isOverflow&&!r&&(t.textMode=!0),2===c?(t.x+=l,function(t){t.text="",t.words.forEach((e=>{e.data.forEach((e=>{t.text+=e.char}))}))}(t)):(t.x+=l,s=t.x,t.data=[],t.words.forEach(((e,n)=>{1===c?(h={char:"",x:s},s=function(t,e,n){return t.forEach((t=>{n.char+=t.char,e+=t.width})),e}(e.data,s,h),(t.isOverflow||" "!==h.char)&&t.data.push(h)):s=function(t,e,n,a){return t.forEach((t=>{(a||" "!==t.char)&&(t.x=e,n.push(t)),e+=t.width})),e}(e.data,s,t.data,t.isOverflow),!d||t.paraEnd&&"both"!==i||n===u-1||(s+=d,t.width+=d)}))),t.words=null)}))}(h,a,r),h.overflow&&function(e,n,a,i){if(!i)return;const{rows:o,overflow:r}=e;let{textOverflow:s}=n;if(o.splice(r),s&&"show"!==s){let e,d;"hide"===s?s="":"ellipsis"===s&&(s="...");const l=s?t.Platform.canvas.measureText(s).width:0,c=a+i-l;("none"===n.textWrap?o:[o[r-1]]).forEach((t=>{if(t.isOverflow&&t.data){let n=t.data.length-1;for(let a=n;a>-1&&(e=t.data[a],d=e.x+e.width,!(a===n&&d<c));a--){if(d<c&&" "!==e.char||!a){t.data.splice(a+1),t.width-=e.width;break}t.width-=e.width}t.width+=l,t.data.push({char:s,x:d}),t.textMode&&function(t){t.text="",t.data.forEach((e=>{t.text+=e.char})),t.data=null}(t)}}))}}(h,a,i,r),"none"!==d&&function(t,n){let a;const{fontSize:i,textDecoration:o}=n;switch(t.decorationHeight=i/11,"object"==typeof o?(a=o.type,o.color&&(t.decorationColor=e.ColorConvert.string(o.color))):a=o,a){case"under":t.decorationY=[.15*i];break;case"delete":t.decorationY=[.35*-i];break;case"under-delete":t.decorationY=[.15*i,.35*-i]}}(h,a),h}};const Ue={string:function(t,n){const a="number"==typeof n&&1!==n;if("string"==typeof t){if(!a||!e.ColorConvert.object)return t;t=e.ColorConvert.object(t)}let i=void 0===t.a?1:t.a;a&&(i*=n);const o=t.r+","+t.g+","+t.b;return 1===i?"rgb("+o+")":"rgba("+o+","+i+")"}};Object.assign(e.TextConvert,qe),Object.assign(e.ColorConvert,Ue),Object.assign(e.Paint,O),Object.assign(e.PaintImage,pt),Object.assign(e.PaintGradient,Wt),Object.assign(e.Effect,Gt),i(),Object.defineProperty(exports,"LeaferImage",{enumerable:!0,get:function(){return t.LeaferImage}}),exports.Layouter=w,exports.LeaferCanvas=n,exports.Renderer=m,exports.Watcher=r,exports.useCanvas=i,Object.keys(t).forEach((function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})})),Object.keys(e).forEach((function(t){"default"===t||Object.prototype.hasOwnProperty.call(exports,t)||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})})); //# sourceMappingURL=worker.min.cjs.map