New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@idraw/board

Package Overview
Dependencies
Maintainers
0
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@idraw/board - npm Package Compare versions

Comparing version 0.4.0-beta.33 to 0.4.0-beta.34

12

dist/esm/index.js

@@ -12,3 +12,3 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {

};
var _Board_instances, _Board_opts, _Board_middlewareMap, _Board_middlewares, _Board_activeMiddlewareObjs, _Board_watcher, _Board_renderer, _Board_sharer, _Board_viewer, _Board_calculator, _Board_eventHub, _Board_hasDestroyed, _Board_init, _Board_handlePointStart, _Board_handlePointEnd, _Board_handlePointMove, _Board_handleHover, _Board_handleDoubleClick, _Board_handleWheel, _Board_handleWheelScale, _Board_handleScrollX, _Board_handleScrollY, _Board_handleResize, _Board_handleClear, _Board_handleBeforeDrawFrame, _Board_handleAfterDrawFrame, _Board_resetActiveMiddlewareObjs;
var _Board_instances, _Board_opts, _Board_middlewareMap, _Board_middlewares, _Board_activeMiddlewareObjs, _Board_watcher, _Board_renderer, _Board_sharer, _Board_viewer, _Board_calculator, _Board_eventHub, _Board_hasDestroyed, _Board_init, _Board_handlePointStart, _Board_handlePointEnd, _Board_handlePointMove, _Board_handleHover, _Board_handleDoubleClick, _Board_handleContextMenu, _Board_handleWheel, _Board_handleWheelScale, _Board_handleScrollX, _Board_handleScrollY, _Board_handleResize, _Board_handleClear, _Board_handleBeforeDrawFrame, _Board_handleAfterDrawFrame, _Board_resetActiveMiddlewareObjs;
import { Renderer } from '@idraw/renderer';

@@ -213,2 +213,3 @@ import { calcElementsContextSize, EventEmitter } from '@idraw/util';

__classPrivateFieldGet(this, _Board_watcher, "f").on('doubleClick', __classPrivateFieldGet(this, _Board_instances, "m", _Board_handleDoubleClick).bind(this));
__classPrivateFieldGet(this, _Board_watcher, "f").on('contextMenu', __classPrivateFieldGet(this, _Board_instances, "m", _Board_handleContextMenu).bind(this));
__classPrivateFieldGet(this, _Board_renderer, "f").on('load', () => {

@@ -262,2 +263,11 @@ __classPrivateFieldGet(this, _Board_eventHub, "f").trigger('loadResource');

}
}, _Board_handleContextMenu = function _Board_handleContextMenu(e) {
var _a;
for (let i = 0; i < __classPrivateFieldGet(this, _Board_activeMiddlewareObjs, "f").length; i++) {
const obj = __classPrivateFieldGet(this, _Board_activeMiddlewareObjs, "f")[i];
const result = (_a = obj === null || obj === void 0 ? void 0 : obj.contextMenu) === null || _a === void 0 ? void 0 : _a.call(obj, e);
if (result === false) {
return;
}
}
}, _Board_handleWheel = function _Board_handleWheel(e) {

@@ -264,0 +274,0 @@ var _a;

@@ -44,2 +44,5 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {

_BoardWatcher_onContextMenu.set(this, (e) => {
if (e.button !== 2) {
return;
}
if (!__classPrivateFieldGet(this, _BoardWatcher_instances, "m", _BoardWatcher_isInTarget).call(this, e)) {

@@ -53,2 +56,3 @@ return;

}
this.trigger('contextMenu', { point });
});

@@ -112,2 +116,5 @@ _BoardWatcher_onClick.set(this, (e) => {

_BoardWatcher_onPointStart.set(this, (e) => {
if (e.button !== 0) {
return;
}
if (!__classPrivateFieldGet(this, _BoardWatcher_instances, "m", _BoardWatcher_isInTarget).call(this, e)) {

@@ -114,0 +121,0 @@ return;

2

dist/index.global.min.js

@@ -1,1 +0,1 @@

var iDrawBoard=function(t){"use strict";var e,i,n,o,a,s,r,l,h,c,f,d,u,v,w,g,p,y,m,b,x,S,I,M,k,z,P,O,E,C,W,A,R,T,L,V,j,D,$,B,X,Y,H,F,U,N,G,Q,q,K,J,Z,_,tt,et,it,nt,ot,at,st,rt,lt,ht,ct,ft,dt,ut,vt,wt,gt,pt,yt=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},mt=(t,e,i)=>(yt(t,e,"read from private field"),i?i.call(t):e.get(t)),bt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},xt=(t,e,i,n)=>(yt(t,e,"write to private field"),n?n.call(t,i):e.set(t,i),i),St=(t,e,i)=>(yt(t,e,"access private method"),i);function It(t){return"string"==typeof t&&(/^\#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t)||/^[a-z]{1,}$/i.test(t))}function Mt(t,e){if(1===e)return t;let i=1;const n=/^\#[0-9a-f]{6,6}$/i;let o=t;if(n.test(t)?i=parseInt(t.substring(5,7).replace(/^\#/,"0x")):/^\#[0-9a-f]{8,8}$/i.test(t)&&(i=parseInt(t.substring(7,9).replace(/^\#/,"0x")),o=t.substring(0,7)),i*=e,n.test(o)&&i>0&&i<1){const t=Math.max(0,Math.min(255,Math.ceil(256*i)));o=`${o.toUpperCase()}${t.toString(16).toUpperCase()}`}return o}function kt(){function t(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return`${t()}${t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`}function zt(t){let e=0;for(let i=0;i<t.length;i++)e+=t.charCodeAt(i)*t.charCodeAt(i)*i*i;return e.toString(16).substring(0,4)}function Pt(t){const e=t.length,i=Math.floor(e/2),n=t.substring(0,4).padEnd(4,"0"),o=t.substring(0,4).padEnd(4,"0");return`@assets/${zt(e.toString(16).padEnd(4,n))}${zt(t.substring(i-4,i).padEnd(4,n)).padEnd(4,"f")}-${zt(t.substring(i-8,i-4).padEnd(4,n)).padEnd(4,"f")}-${zt(t.substring(i-12,i-8).padEnd(4,n)).padEnd(4,"f")}-${zt(t.substring(i-16,i-12).padEnd(4,o)).padEnd(4,"f")}-${zt(t.substring(i,i+4).padEnd(4,o)).padEnd(4,"f")}${zt(t.substring(i+4,i+8).padEnd(4,o)).padEnd(4,"f")}${zt(o.padEnd(4,n).padEnd(4,o))}`}function Ot(t){return function t(e){const i=function(t){return Object.prototype.toString.call(t).replace(/[\]|\[]{1,1}/gi,"").split(" ")[1]}(e);if(["Null","Number","String","Boolean","Undefined"].indexOf(i)>=0)return e;if("Array"===i){const i=[];return e.forEach((e=>{i.push(t(e))})),i}if("Object"===i){const i={};Object.keys(e).forEach((n=>{i[n]=t(e[n])}));return Object.getOwnPropertySymbols(e).forEach((n=>{i[n]=t(e[n])})),i}}(t)}function Et(t){return(Object.prototype.toString.call(t)||"").replace(/(\[object|\])/gi,"").trim()}const Ct={type(t,e){const i=Et(t);return!0===e?i.toLocaleLowerCase():i},array:t=>"Array"===Et(t),json:t=>"Object"===Et(t),function:t=>"Function"===Et(t),asyncFunction:t=>"AsyncFunction"===Et(t),boolean:t=>"Boolean"===Et(t),string:t=>"String"===Et(t),number:t=>"Number"===Et(t),undefined:t=>"Undefined"===Et(t),null:t=>"Null"===Et(t),promise:t=>"Promise"===Et(t)};var Wt=function(t,e,i,n){return new(i||(i=Promise))((function(o,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function r(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,r)}l((n=n.apply(t,e||[])).next())}))};const{Image:At}=window;function Rt(t){return new Promise(((e,i)=>{const n=new At;n.crossOrigin="anonymous",n.onload=function(){e(n)},n.onabort=i,n.onerror=i,n.src=t}))}function Tt(t){return Wt(this,void 0,void 0,(function*(){const e=yield function(t){return new Promise(((e,i)=>{const n=new Blob([t],{type:"image/svg+xml;charset=utf-8"}),o=new FileReader;o.readAsDataURL(n),o.onload=function(t){var i;const n=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.result;e(n)},o.onerror=function(t){i(t)}}))}(t);return yield Rt(e)}))}function Lt(t,e){return Wt(this,void 0,void 0,(function*(){t=t.replace(/\&/gi,"&amp;");const i=yield function(t,e){const{width:i,height:n}=e;return new Promise(((e,o)=>{const a=new Blob([`\n <svg \n xmlns="http://www.w3.org/2000/svg" \n width="${i||""}" \n height = "${n||""}">\n <foreignObject width="100%" height="100%">\n <div xmlns = "http://www.w3.org/1999/xhtml">\n ${t}\n </div>\n </foreignObject>\n </svg>\n `],{type:"image/svg+xml;charset=utf-8"}),s=new FileReader;s.readAsDataURL(a),s.onload=function(t){var i;const n=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.result;e(n)},s.onerror=function(t){o(t)}}))}(t,e);return yield Rt(i)}))}function Vt(t){return"number"==typeof t&&(t>0||t<=0)}function jt(t){return"number"==typeof t&&t>=0}function Dt(t){return"string"==typeof t&&/^(http:\/\/|https:\/\/|\.\/|\/)/.test(`${t}`)}function $t(t){return"string"==typeof t&&/^(data:image\/)/.test(`${t}`)}const Bt={x:function(t){return Vt(t)},y:function(t){return Vt(t)},w:jt,h:function(t){return"number"==typeof t&&t>=0},angle:function(t){return"number"==typeof t&&t>=-360&&t<=360},number:Vt,numberStr:function(t){return/^(-?\d+(?:\.\d+)?)$/.test(`${t}`)},borderWidth:function(t){return jt(t)},borderRadius:function(t){return Vt(t)&&t>=0},color:function(t){return It(t)},imageSrc:function(t){return $t(t)||Dt(t)},imageURL:Dt,imageBase64:$t,svg:function(t){return"string"==typeof t&&/^(<svg[\s]{1,}|<svg>)/i.test(`${t}`.trim())&&/<\/[\s]{0,}svg>$/i.test(`${t}`.trim())},html:function(t){let e=!1;if("string"==typeof t){let i=document.createElement("div");i.innerHTML=t,i.children.length>0&&(e=!0),i=null}return e},text:function(t){return"string"==typeof t},fontSize:function(t){return Vt(t)&&t>0},lineHeight:function(t){return Vt(t)&&t>0},textAlign:function(t){return["center","left","right"].includes(t)},fontFamily:function(t){return"string"==typeof t&&t.length>0},fontWeight:function(t){return["bold"].includes(t)},strokeWidth:function(t){return Vt(t)&&t>0}};var Xt,Yt=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};class Ht{constructor(){Xt.set(this,void 0),function(t,e,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(t,i):o?o.value=i:e.set(t,i)}(this,Xt,new Map,"f")}on(t,e){if(Yt(this,Xt,"f").has(t)){const i=Yt(this,Xt,"f").get(t)||[];null==i||i.push(e),Yt(this,Xt,"f").set(t,i)}else Yt(this,Xt,"f").set(t,[e])}off(t,e){if(Yt(this,Xt,"f").has(t)){const i=Yt(this,Xt,"f").get(t);if(Array.isArray(i))for(let t=0;t<(null==i?void 0:i.length);t++)if(i[t]===e){i.splice(t,1);break}Yt(this,Xt,"f").set(t,i||[])}}trigger(t,e){const i=Yt(this,Xt,"f").get(t);return!!Array.isArray(i)&&(i.forEach((t=>{t(e)})),!0)}has(t){if(Yt(this,Xt,"f").has(t)){const e=Yt(this,Xt,"f").get(t);if(Array.isArray(e)&&e.length>0)return!0}return!1}destroy(){this.clear()}clear(){Yt(this,Xt,"f").clear()}}function Ft(t,e){return{x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}}Xt=new WeakMap;var Ut,Nt,Gt,Qt,qt=function(t,e,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,i):o?o.value=i:e.set(t,i),i},Kt=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};class Jt{constructor(t){Ut.add(this),Nt.set(this,void 0),Gt.set(this,void 0),qt(this,Gt,Ot(t.defaultStorage),"f"),qt(this,Nt,Kt(this,Ut,"m",Qt).call(this),"f")}set(t,e){Kt(this,Nt,"f")[t]=e}get(t){return Kt(this,Nt,"f")[t]}getSnapshot(t){return!0===(null==t?void 0:t.deepClone)?Ot(Kt(this,Nt,"f")):Object.assign({},Kt(this,Nt,"f"))}clear(){qt(this,Nt,Kt(this,Ut,"m",Qt).call(this),"f")}destroy(){qt(this,Nt,null,"f")}}function Zt(t){return t/180*Math.PI}function _t(t,e,i){const n=te(e);!function(t,e,i,n){const o=Zt(e||0);i&&(o>0||o<0)&&(t.translate(i.x,i.y),t.rotate(o),t.translate(-i.x,-i.y)),n(t),i&&(o>0||o<0)&&(t.translate(i.x,i.y),t.rotate(-o),t.translate(-i.x,-i.y))}(t,e.angle||0,n,(()=>{i(t)}))}function te(t){return{x:t.x+t.w/2,y:t.y+t.h/2}}function ee(t){const e=Math.min(t[0].x,t[1].x,t[2].x,t[3].x),i=Math.min(t[0].y,t[1].y,t[2].y,t[3].y);return te({x:e,y:i,w:Math.max(t[0].x,t[1].x,t[2].x,t[3].x)-e,h:Math.max(t[0].y,t[1].y,t[2].y,t[3].y)-i})}function ie(t,e,i){const n=function(t,e){const i=e.x-t.x,n=e.y-t.y;if(0===i){if(n<0)return 0;if(n>0)return Math.PI}else if(0===n){if(i<0)return 3*Math.PI/2;if(i>0)return Math.PI/2}return i>0&&n<0?Math.atan(Math.abs(i)/Math.abs(n)):i>0&&n>0?Math.PI-Math.atan(Math.abs(i)/Math.abs(n)):i<0&&n>0?Math.PI+Math.atan(Math.abs(i)/Math.abs(n)):i<0&&n<0?2*Math.PI-Math.atan(Math.abs(i)/Math.abs(n)):0}(t,e);let o=n+i;o>2*Math.PI?o-=2*Math.PI:o<0-2*Math.PI&&(o+=2*Math.PI),o<0&&(o+=2*Math.PI);const a=function(t,e){const i=(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y);return 0===i?i:Math.sqrt(i)}(t,e);let s=0,r=0;return 0===o?(s=0,r=0-a):o>0&&o<Math.PI/2?(s=Math.sin(o)*a,r=0-Math.cos(o)*a):o===Math.PI/2?(s=a,r=0):o>Math.PI/2&&o<Math.PI?(s=Math.sin(Math.PI-o)*a,r=Math.cos(Math.PI-o)*a):o===Math.PI?(s=0,r=a):o>Math.PI&&o<1.5*Math.PI?(s=0-Math.sin(o-Math.PI)*a,r=Math.cos(o-Math.PI)*a):o===1.5*Math.PI?(s=0-a,r=0):o>1.5*Math.PI&&o<2*Math.PI?(s=0-Math.sin(2*Math.PI-o)*a,r=0-Math.cos(2*Math.PI-o)*a):o===2*Math.PI&&(s=0,r=0-a),s+=t.x,r+=t.y,{x:s,y:r}}function ne(t,e,i){const{x:n,y:o,w:a,h:s}=t;let r={x:n,y:o},l={x:n+a,y:o},h={x:n+a,y:o+s},c={x:n,y:o+s};if(i&&(i>0||i<0)){const t=Zt(function(t){if(!(t>0||t<0)||0===t)return 0;let e=t%360;e<0&&(e+=360);return e}(i));r=ie(e,r,t),l=ie(e,l,t),h=ie(e,h,t),c=ie(e,c,t)}return[r,l,h,c]}function oe(t){const{angle:e=0}=t;return ne(t,te(t),e)}function ae(t,e,i){return[ie(t,{x:e[0].x,y:e[0].y},i),ie(t,{x:e[1].x,y:e[1].y},i),ie(t,{x:e[2].x,y:e[2].y},i),ie(t,{x:e[3].x,y:e[3].y},i)]}function se(t,e){var i;const n=[];let o=t;if(e.length>1)for(let t=0;t<e.length-1;t++){const a=o[e[t]];if("group"!==(null==a?void 0:a.type)||!Array.isArray(null===(i=null==a?void 0:a.detail)||void 0===i?void 0:i.children))return null;n.push(a),o=a.detail.children}return n}function re(t){const{x:e,y:i,h:n,w:o}=t;return[{x:e,y:i},{x:e+o,y:i},{x:e+o,y:i+n},{x:e,y:i+n}]}function le(t){const{x:e,y:i,w:n,h:o,angle:a=0}=t;return 0===a?re(t):ne(t,te({x:e,y:i,w:n,h:o,angle:a}),a)}function he(t,e){const{groupQueue:i}=e;if(!(i.length>0))return[le(t)];const n=function(t){const e=[];let i=0,n=0;const o=[],a=[...t];for(let t=0;t<a.length;t++){const{x:s,y:r,w:l,h:h,angle:c=0}=a[t];let f;if(i+=s,n+=r,0===t){const t={x:i,y:n,w:l,h:h,angle:c};f=le({x:s,y:r,w:l,h:h,angle:c}),o.push({center:te(t),angle:c,radian:Zt(c)})}else{f=re({x:i,y:n,w:l,h:h,angle:c});for(let t=0;t<o.length;t++){const{center:e,radian:i}=o[t];f=ae(e,f,i)}const t=ee(f);(c>0||c<0)&&(f=ae(t,f,Zt(c))),o.push({center:t,angle:c,radian:Zt(c)})}e.push(f)}return e}([...i,t]);return n}function ce(t,e){const{viewScaleInfo:i}=e,{x:n,y:o,w:a,h:s,angle:r}=t,{scale:l,offsetTop:h,offsetLeft:c}=i;return{x:n*l+c,y:o*l+h,w:a*l,h:s*l,angle:r}}function fe(t,e){const{viewScaleInfo:i}=e,{x:n,y:o}=t,{scale:a,offsetTop:s,offsetLeft:r}=i;return{x:n*a+r,y:o*a+s}}function de(t,e){const{context2d:i,element:n,viewScaleInfo:o}=e,{angle:a=0}=n,{x:s,y:r,w:l,h:h}=ce(n,{viewScaleInfo:o}),c=oe({x:s,y:r,w:l,h:h,angle:a});if(c.length>=2){i.beginPath(),i.moveTo(c[0].x,c[0].y);for(let t=1;t<c.length;t++)i.lineTo(c[t].x,c[t].y);i.closePath()}return!!i.isPointInPath(t.x,t.y)}function ue(t,e){const{groupQueue:i}=e,n=function(t,e){return he(t,e).pop()||null}(t,{groupQueue:i}),o=Ft(n[0],n[1]),a=Ft(n[1],n[2]),s=Ft(n[2],n[3]),r=Ft(n[3],n[0]),l=n[0],h=n[1],c=n[2],f=n[3],d=Math.max(l.x,h.x,c.x,f.x),u=Math.max(l.y,h.y,c.y,f.y);return{center:{x:(d+Math.min(l.x,h.x,c.x,f.x))/2,y:(u+Math.min(l.y,h.y,c.y,f.y))/2},topLeft:l,topRight:h,bottomLeft:f,bottomRight:c,top:o,right:a,left:r,bottom:s}}function ve(t){const e=Math.max(t.topLeft.x,t.topRight.x,t.bottomRight.x,t.bottomLeft.x),i=Math.max(t.topLeft.y,t.topRight.y,t.bottomRight.y,t.bottomLeft.y),n=Math.min(t.topLeft.x,t.topRight.x,t.bottomRight.x,t.bottomLeft.x),o=Math.min(t.topLeft.y,t.topRight.y,t.bottomRight.y,t.bottomLeft.y),a={x:t.center.x,y:t.center.y},s={x:n,y:o},r={x:e,y:o},l={x:e,y:i},h={x:n,y:i},c=Ft(s,r),f=Ft(h,l),d=Ft(s,h);return{center:a,topLeft:s,topRight:r,bottomLeft:h,bottomRight:l,top:c,right:Ft(r,l),left:d,bottom:f}}function we(t,e){const i=function(t){const{viewScaleInfo:e,viewSizeInfo:i}=t,{scale:n,offsetTop:o,offsetLeft:a}=e,{width:s,height:r}=i,l=0-a/n,h=0-o/n,c=s/n,f=r/n,d=te({x:l,y:h,w:c,h:f}),u={x:l,y:h},v={x:l+c,y:h},w={x:l,y:h+f},g={x:l+c,y:h+f},p={x:l,y:d.y},y={x:d.x,y:h},m={x:l+c,y:d.y},b={x:d.x,y:h+f};return{center:d,topLeft:u,topRight:v,bottomLeft:w,bottomRight:g,left:p,top:y,right:m,bottom:b}}(e);let n=0,o=0;return Object.keys(t).forEach((e=>{const a=t[e];a.isVisibleInView=function(t,e){const i=Math.min(t.topLeft.x,t.topRight.x,t.bottomLeft.x,t.bottomRight.x),n=Math.max(t.topLeft.x,t.topRight.x,t.bottomLeft.x,t.bottomRight.x),o=Math.min(t.topLeft.y,t.topRight.y,t.bottomLeft.y,t.bottomRight.y),a=Math.max(t.topLeft.y,t.topRight.y,t.bottomLeft.y,t.bottomRight.y),s=Math.min(e.topLeft.x,e.topRight.x,e.bottomLeft.x,e.bottomRight.x),r=Math.max(e.topLeft.x,e.topRight.x,e.bottomLeft.x,e.bottomRight.x),l=Math.min(e.topLeft.y,e.topRight.y,e.bottomLeft.y,e.bottomRight.y),h=Math.max(e.topLeft.y,e.topRight.y,e.bottomLeft.y,e.bottomRight.y);return i<=r&&n>=s&&o<=h&&a>=l||r<=a&&r>=a&&r<=a&&r>=a}(a.rangeRectInfo,i),a.isVisibleInView?n++:o++})),{viewVisibleInfoMap:t,visibleCount:n,invisibleCount:o}}function ge(t){let e="";return t.forEach((t=>{e+=t.type+t.params.join(" ")})),e}Nt=new WeakMap,Gt=new WeakMap,Ut=new WeakSet,Qt=function(){return Ot(Kt(this,Gt,"f"))};const pe={boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,fontFamily:"sans-serif",fontWeight:400,minInlineSize:"auto",wordBreak:"break-all",overflow:"hidden"};function ye(t,e){const{viewScaleInfo:i}=e,{scale:n}=i;let{borderRadius:o,borderDash:a}=t.detail;const s=Array.isArray(a)&&a.length>0,{boxSizing:r=pe.boxSizing,borderWidth:l}=t.detail;Array.isArray(l)&&(o=0);let{x:h,y:c,w:f,h:d}=t,u=[0,0,0,0];if("number"==typeof o){const t=o*n;u=[t,t,t,t]}else Array.isArray(o)&&4===(null==o?void 0:o.length)&&(u=[o[0]*n,o[1]*n,o[2]*n,o[3]*n]);let v=0;return"number"==typeof l&&(v=(l||0)*n),"border-box"!==r||s?"content-box"===r?(h=t.x-v/2,c=t.y-v/2,f=t.w+v,d=t.h+v):(h=t.x,c=t.y,f=t.w,d=t.h):(h=t.x+v/2,c=t.y+v/2,f=t.w-v,d=t.h-v),f=Math.max(f,1),d=Math.max(d,1),u=u.map((t=>Math.min(t,f/2,d/2))),{x:h,y:c,w:f,h:d,radiusList:u}}const me=["-apple-system",'"system-ui"',' "Segoe UI"'," Roboto",'"Helvetica Neue"',"Arial",'"Noto Sans"'," sans-serif"];function be(t,e,i){if("string"==typeof e)return e;const{viewElementSize:n,viewScaleInfo:o,opacity:a=1}=i,{x:s,y:r}=n,{scale:l}=o;if("linear-gradient"===(null==e?void 0:e.type)){const{start:i,end:n,stops:o}=e,h={x:s+i.x*l,y:r+i.y*l},c={x:s+n.x*l,y:r+n.y*l},f=t.createLinearGradient(h.x,h.y,c.x,c.y);return o.forEach((t=>{f.addColorStop(t.offset,Mt(t.color,a))})),f}if("radial-gradient"===(null==e?void 0:e.type)){const{inner:i,outer:n,stops:o}=e,h={x:s+i.x*l,y:r+i.y*l,radius:i.radius*l},c={x:s+n.x*l,y:r+n.y*l,radius:n.radius*l},f=t.createRadialGradient(h.x,h.y,h.radius,c.x,c.y,c.radius);return o.forEach((t=>{f.addColorStop(t.offset,Mt(t.color,a))})),f}return"#000000"}const xe={boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,fontFamily:"sans-serif",fontWeight:400,minInlineSize:"auto",wordBreak:"break-all",overflow:"hidden"};function Se(t){var e,i,n,o;let a=1;return void 0!==(null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.opacity)&&(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.opacity)>=0&&(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.opacity)<=1&&(a=null===(o=null==t?void 0:t.detail)||void 0===o?void 0:o.opacity),a}function Ie(t,e,i){const{pattern:n,renderContent:o,originElem:a,calcElemSize:s,viewScaleInfo:r,viewSizeInfo:l}=i||{},{parentOpacity:h}=i,c=Se(a)*h,{clipPath:f,clipPathStrokeColor:d,clipPathStrokeWidth:u}=a.detail,v=()=>{t.globalAlpha=c,Me(t,e,{pattern:n,viewScaleInfo:r,viewSizeInfo:l}),null==o||o(),ke(t,e,{viewScaleInfo:r,viewSizeInfo:l}),t.globalAlpha=h};f?(function(t,e,i){const{renderContent:n,originElem:o,calcElemSize:a,viewSizeInfo:s}=i,r=s.devicePixelRatio,{clipPath:l}=(null==o?void 0:o.detail)||{};if(l&&a&&l.commands){const{x:i,y:o,w:s,h:h}=a,{originW:c,originH:f,originX:d,originY:u}=l,v=s/c,w=h/f,g=i-d*v,p=o-u*w;t.save(),t.translate(g,p),t.scale(r*v,r*w);const y=ge(l.commands||[]),m=new Path2D(y);t.clip(m),t.translate(0-g,0-p),t.setTransform(1,0,0,1,0,0),_t(t,Object.assign({},e),(()=>{null==n||n()})),t.restore()}else null==n||n()}(t,e,{originElem:a,calcElemSize:s,viewScaleInfo:r,viewSizeInfo:l,renderContent:()=>{v()}}),"number"==typeof u&&u>0&&d&&function(t,e,i){const{renderContent:n,originElem:o,calcElemSize:a,viewSizeInfo:s,parentOpacity:r}=i,l=s.devicePixelRatio,{clipPath:h,clipPathStrokeColor:c,clipPathStrokeWidth:f}=(null==o?void 0:o.detail)||{};if(h&&a&&h.commands&&"number"==typeof f&&f>0&&c){const{x:i,y:o,w:s,h:d}=a,{originW:u,originH:v,originX:w,originY:g}=h,p=s/u,y=d/v,m=i-w*p,b=o-g*y;t.save(),t.globalAlpha=r,t.translate(m,b),t.scale(l*p,l*y);const x=ge(h.commands||[]),S=new Path2D(x);t.strokeStyle=c,t.lineWidth=f,t.stroke(S),t.translate(0-m,0-b),t.setTransform(1,0,0,1,0,0),_t(t,Object.assign({},e),(()=>{null==n||n()})),t.restore()}else null==n||n()}(t,e,{originElem:a,calcElemSize:s,viewScaleInfo:r,viewSizeInfo:l,parentOpacity:h})):v()}function Me(t,e,i){var n,o;const{pattern:a,viewScaleInfo:s,viewSizeInfo:r}=i,l=[];if(e.detail.background||a){const{x:i,y:h,w:c,h:f,radiusList:d}=ye(e,{viewScaleInfo:s,viewSizeInfo:r});if(t.beginPath(),t.moveTo(i+d[0],h),t.arcTo(i+c,h,i+c,h+f,d[1]),t.arcTo(i+c,h+f,i,h+f,d[2]),t.arcTo(i,h+f,i,h,d[3]),t.arcTo(i,h,i+c,h,d[0]),t.closePath(),"string"==typeof a)t.fillStyle=a;else if(["CanvasPattern"].includes(Ct.type(a)))t.fillStyle=a;else if("string"==typeof e.detail.background)t.fillStyle=e.detail.background;else if("linear-gradient"===(null===(n=e.detail.background)||void 0===n?void 0:n.type)){const n=be(t,e.detail.background,{viewElementSize:{x:i,y:h,w:c,h:f},viewScaleInfo:s,opacity:t.globalAlpha});t.fillStyle=n}else if("radial-gradient"===(null===(o=e.detail.background)||void 0===o?void 0:o.type)){const n=be(t,e.detail.background,{viewElementSize:{x:i,y:h,w:c,h:f},viewScaleInfo:s,opacity:t.globalAlpha});if(t.fillStyle=n,l&&l.length>0)for(let e=0;e<(null==l?void 0:l.length);e++){const n=l[e];"translate"===n.method?t.translate(n.args[0]+i,n.args[1]+h):"rotate"===n.method?t.rotate(...n.args):"scale"===n.method&&t.scale(...n.args)}}t.fill(),l&&l.length>0&&t.setTransform(1,0,0,1,0,0)}}function ke(t,e,i){if(0===e.detail.borderWidth)return;if(!It(e.detail.borderColor))return;const{viewScaleInfo:n}=i,{scale:o}=n;let a=xe.borderColor;!0===It(e.detail.borderColor)&&(a=e.detail.borderColor);const{borderWidth:s,borderRadius:r,borderDash:l,boxSizing:h=xe.boxSizing}=e.detail;let c=0;"number"==typeof s&&(c=s||1),c*=o;let f=[0,0,0,0];if("number"==typeof r){const t=r*o;f=[t,t,t,t]}else Array.isArray(r)&&4===(null==r?void 0:r.length)&&(f=[r[0]*o,r[1]*o,r[2]*o,r[3]*o]);t.strokeStyle=a;let d=[];Array.isArray(l)&&l.length>0&&(d=l.map((t=>Math.ceil(t*o))));let u=0,v=0,w=0,g=0;if(Array.isArray(s)&&(u=(s[0]||0)*o,v=(s[1]||0)*o,w=(s[2]||0)*o,g=(s[3]||0)*o),g||v||u||w){t.lineCap="butt";let{x:i,y:n,w:o,h:a}=e;"border-box"===h?(i+=g/2,n+=u/2,o=o-g/2-v/2,a=a-u/2-w/2):"content-box"===h?(i-=g/2,n-=u/2,o=o+g/2+v/2,a=a+u/2+w/2):(i=e.x,n=e.y,o=e.w,a=e.h),u&&(t.beginPath(),t.lineWidth=u,t.moveTo(i-g/2,n),t.lineTo(i+o+v/2,n),t.closePath(),t.stroke()),v&&(t.beginPath(),t.lineWidth=v,t.moveTo(i+o,n-u/2),t.lineTo(i+o,n+a+w/2),t.closePath(),t.stroke()),w&&(t.beginPath(),t.lineWidth=w,t.moveTo(i-g/2,n+a),t.lineTo(i+o+v/2,n+a),t.closePath(),t.stroke()),g&&(t.beginPath(),t.lineWidth=g,t.moveTo(i,n-u/2),t.lineTo(i,n+a+w/2),t.closePath(),t.stroke())}else{let{x:i,y:n,w:o,h:a}=e;"border-box"===h?(i=e.x+c/2,n=e.y+c/2,o=e.w-c,a=e.h-c):"content-box"===h?(i=e.x-c/2,n=e.y-c/2,o=e.w+c,a=e.h+c):(i=e.x,n=e.y,o=e.w,a=e.h),d.length>0?t.lineCap="butt":t.lineCap="square",o=Math.max(o,1),a=Math.max(a,1),f=f.map((t=>Math.min(t,o/2,a/2))),t.setLineDash(d),t.lineWidth=c,t.beginPath(),t.moveTo(i+f[0],n),t.arcTo(i+o,n,i+o,n+a,f[1]),t.arcTo(i+o,n+a,i,n+a,f[2]),t.arcTo(i,n+a,i,n,f[3]),t.arcTo(i,n,i+o,n,f[0]),t.closePath(),t.stroke()}t.setLineDash([])}function ze(t,e,i){const{detail:n}=e,{viewScaleInfo:o,renderContent:a}=i,{shadowColor:s,shadowOffsetX:r,shadowOffsetY:l,shadowBlur:h}=n;Bt.number(h)?(t.save(),t.shadowColor=s||xe.shadowColor,t.shadowOffsetX=(r||0)*o.scale,t.shadowOffsetY=(l||0)*o.scale,t.shadowBlur=(h||0)*o.scale,a(),t.restore()):(t.save(),t.shadowColor="transparent",t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,a(),t.restore())}const Pe={boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,fontFamily:"sans-serif",fontWeight:400,minInlineSize:"auto",wordBreak:"break-all",overflow:"hidden"};var Oe=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i};const Ee=.4;function Ce(t,e,i){var n,o,a;if(!0===(null===(n=null==e?void 0:e.operations)||void 0===n?void 0:n.invisible))return;const{w:s,h:r}=e,{scale:l}=i.viewScaleInfo;if(l<1&&(s*l<Ee||r*l<Ee)||0===i.parentOpacity)return;const{overrideElementMap:h}=i;if(!(null===(a=null===(o=null==h?void 0:h[e.uuid])||void 0===o?void 0:o.operations)||void 0===a?void 0:a.invisible))try{switch(e.type){case"rect":!function(t,e,i){const{viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a}=i,{x:s,y:r,w:l,h:h,angle:c}=ce(e,{viewScaleInfo:n})||e,f=Object.assign(Object.assign({},e),{x:s,y:r,w:l,h:h,angle:c});_t(t,{x:s,y:r,w:l,h:h,angle:c},(()=>{ze(t,f,{viewScaleInfo:n,viewSizeInfo:o,renderContent:()=>{Ie(t,f,{originElem:e,calcElemSize:{x:s,y:r,w:l,h:h,angle:c},viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a,renderContent:()=>{}})}})}))}(t,e,i);break;case"circle":!function(t,e,i){const{detail:n,angle:o}=e,{viewScaleInfo:a,viewSizeInfo:s,parentOpacity:r}=i,{background:l="#000000",borderColor:h="#000000",boxSizing:c,borderWidth:f=0,borderDash:d}=n;let u=0;"number"==typeof f&&f>0?u=f:Array.isArray(f)&&"number"==typeof f[0]&&f[0]>0&&(u=f[0]),u*=a.scale;const{x:v,y:w,w:g,h:p}=ce({x:e.x,y:e.y,w:e.w,h:e.h},{viewScaleInfo:a})||e,y=Object.assign(Object.assign({},e),{x:v,y:w,w:g,h:p,angle:o});_t(t,{x:v,y:w,w:g,h:p,angle:o},(()=>{ze(t,y,{viewScaleInfo:a,viewSizeInfo:s,renderContent:()=>{let e=g/2,i=p/2;const n=v+e,o=w+i,s=e,f=i;if(u>0&&("content-box"===c||("center-line"===c?(e-=u/2,i-=u/2):(e-=u,i-=u))),e>=0&&i>=0){const c=Se(y)*r;t.globalAlpha=c,t.beginPath();const m=be(t,l,{viewElementSize:{x:v,y:w,w:g,h:p},viewScaleInfo:a,opacity:t.globalAlpha});if(t.fillStyle=m,t.circle(n,o,s,f,0,0,2*Math.PI),t.closePath(),t.fill(),t.globalAlpha=r,"number"==typeof u&&u>0){const s=u/2+e,r=u/2+i;if(t.beginPath(),d){const e=d.map((t=>t*a.scale));t.setLineDash(e)}t.strokeStyle=h,t.lineWidth=u,t.circle(n,o,s,r,0,0,2*Math.PI),t.closePath(),t.stroke(),t.setLineDash([])}}}})}))}(t,e,i);break;case"text":!function(t,e,i){const{viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a}=i,{x:s,y:r,w:l,h:h,angle:c}=ce(e,{viewScaleInfo:n})||e,f=Object.assign(Object.assign({},e),{x:s,y:r,w:l,h:h,angle:c});_t(t,{x:s,y:r,w:l,h:h,angle:c},(()=>{ze(t,f,{viewScaleInfo:n,viewSizeInfo:o,renderContent:()=>{Ie(t,f,{originElem:e,calcElemSize:{x:s,y:r,w:l,h:h,angle:c},viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a})}});{const o=Object.assign(Object.assign({},Pe),e.detail),a=o.fontSize||Pe.fontSize,c=a*n.scale;if(c<2)return;const f=(o.lineHeight||a)*n.scale;t.fillStyle=e.detail.color||Pe.color,t.textBaseline="top",t.$setFont({fontWeight:o.fontWeight,fontSize:c,fontFamily:(i=o.fontFamily,[i,...me].join(", "))});let d=o.text.replace(/\r\n/gi,"\n");"lowercase"===o.textTransform?d=d.toLowerCase():"uppercase"===o.textTransform&&(d=d.toUpperCase());const u=f,v=d.split("\n"),w=[];let g=0;v.forEach(((e,i)=>{if("maxContent"===o.minInlineSize)w.push({text:e,width:t.$undoPixelRatio(t.measureText(e).width)});else{let r="",c="",f=e.split(c);if("normal"===o.wordBreak){const t=" ",i=e.split(t);f=[],i.forEach(((e,n)=>{f.push(e),n<i.length-1&&f.push(t)}))}if(1===f.length&&"visible"===o.overflow)w.push({text:f[0],width:t.$undoPixelRatio(t.measureText(f[0]).width)});else if(f.length>0){for(let e=0;e<f.length&&(a=t.$doPixelRatio(l),s=t.measureText(r+f[e]).width,n.scale<.5&&a<s&&(a-s)/a>-.15||a>=s?r+=f[e]||"":(w.push({text:r,width:t.$undoPixelRatio(t.measureText(r).width)}),r=f[e]||"",g++),!((g+1)*u>h&&"hidden"===o.overflow));e++)if(f.length-1===e&&(g+1)*u<=h){w.push({text:r,width:t.$undoPixelRatio(t.measureText(r).width)}),i<v.length-1&&g++;break}}else w.push({text:"",width:0})}var a,s}));let p=0,y=0;u>c&&(y=(u-c)/2),w.length*u<h&&("top"===e.detail.verticalAlign?p=0:"bottom"===e.detail.verticalAlign?p+=h-w.length*u:p+=(h-w.length*u)/2);{const e=r+p;void 0!==o.textShadowColor&&It(o.textShadowColor)&&(t.shadowColor=o.textShadowColor),void 0!==o.textShadowOffsetX&&Bt.number(o.textShadowOffsetX)&&(t.shadowOffsetX=o.textShadowOffsetX),void 0!==o.textShadowOffsetY&&Bt.number(o.textShadowOffsetY)&&(t.shadowOffsetY=o.textShadowOffsetY),void 0!==o.textShadowBlur&&Bt.number(o.textShadowBlur)&&(t.shadowBlur=o.textShadowBlur),w.forEach(((i,n)=>{let a=s;"center"===o.textAlign?a=s+(l-i.width)/2:"right"===o.textAlign&&(a=s+(l-i.width)),t.fillText(i.text,a,e+u*n+y)}))}}var i}))}(t,e,i);break;case"image":!function(t,e,i){const n=i.loader.getContent(e),{viewScaleInfo:o,viewSizeInfo:a,parentOpacity:s}=i,{x:r,y:l,w:h,h:c,angle:f}=ce(e,{viewScaleInfo:o})||e,d=Object.assign(Object.assign({},e),{x:r,y:l,w:h,h:c,angle:f});_t(t,{x:r,y:l,w:h,h:c,angle:f},(()=>{ze(t,d,{viewScaleInfo:o,viewSizeInfo:a,renderContent:()=>{Ie(t,d,{originElem:e,calcElemSize:{x:r,y:l,w:h,h:c,angle:f},viewScaleInfo:o,viewSizeInfo:a,parentOpacity:s,renderContent:()=>{if(n||i.loader.isDestroyed()||i.loader.load(e,i.elementAssets||{}),"image"===e.type&&n){t.globalAlpha=Se(e)*s;const{x:i,y:r,w:l,h:h,radiusList:c}=ye(d,{viewScaleInfo:o,viewSizeInfo:a}),{detail:f}=e,{scaleMode:u,originW:v=0,originH:w=0}=f,g=t.$undoPixelRatio(v),p=t.$undoPixelRatio(w);if(t.save(),t.fillStyle="transparent",t.beginPath(),t.moveTo(i+c[0],r),t.arcTo(i+l,r,i+l,r+h,c[1]),t.arcTo(i+l,r+h,i,r+h,c[2]),t.arcTo(i,r+h,i,r,c[3]),t.arcTo(i,r,i+l,r,c[0]),t.closePath(),t.fill(),t.clip(),u&&w&&v){let o=0,a=0,s=g,c=p;const f=i,d=r,v=l,w=h;if(g>e.w||p>e.h)if("fill"===u){const t=Math.max(e.w/g,e.h/p),i=p*t;o=(g*t-e.w)/2/t,a=(i-e.h)/2/t,s=e.w/t,c=e.h/t}else if("tile"===u)o=0,a=0,s=e.w,c=e.h;else if("fit"===u){const t=Math.min(e.w/g,e.h/p);o=(g-e.w/t)/2,a=(p-e.h/t)/2,s=e.w/t,c=e.h/t}t.drawImage(n,o,a,s,c,f,d,v,w)}else t.drawImage(n,i,r,l,h);t.globalAlpha=s,t.restore()}}})}})}))}(t,e,i);break;case"svg":!function(t,e,i){const n=i.loader.getContent(e),{viewScaleInfo:o,viewSizeInfo:a,parentOpacity:s}=i,{x:r,y:l,w:h,h:c,angle:f}=ce(e,{viewScaleInfo:o,viewSizeInfo:a})||e;_t(t,{x:r,y:l,w:h,h:c,angle:f},(()=>{n||i.loader.isDestroyed()||i.loader.load(e,i.elementAssets||{}),"svg"===e.type&&n&&(t.globalAlpha=Se(e)*s,t.drawImage(n,r,l,h,c),t.globalAlpha=s)}))}(t,e,i);break;case"html":!function(t,e,i){const n=i.loader.getContent(e),{viewScaleInfo:o,viewSizeInfo:a,parentOpacity:s}=i,{x:r,y:l,w:h,h:c,angle:f}=ce(e,{viewScaleInfo:o,viewSizeInfo:a})||e;_t(t,{x:r,y:l,w:h,h:c,angle:f},(()=>{n||i.loader.isDestroyed()||i.loader.load(e,i.elementAssets||{}),"html"===e.type&&n&&(t.globalAlpha=Se(e)*s,t.drawImage(n,r,l,h,c),t.globalAlpha=s)}))}(t,e,i);break;case"path":!function(t,e,i){var n,o;const{detail:a}=e,{originX:s,originY:r,originW:l,originH:h,fillRule:c}=a,{viewScaleInfo:f,viewSizeInfo:d,parentOpacity:u}=i,{x:v,y:w,w:g,h:p,angle:y}=ce(e,{viewScaleInfo:f})||e,m=g/l,b=p/h,x=v-s*m,S=w-r*b,I=e.detail,M=Oe(I,["clipPath","clipPathStrokeColor","clipPathStrokeWidth"]),k=f.scale*d.devicePixelRatio,z=Object.assign(Object.assign({},e),{x:v,y:w,w:g,h:p,angle:y});let P=Object.assign({},z);P.detail=M;let O=Object.assign({},e);O.detail=M,a.fill&&"string"!==a.fill&&(null===(o=null===(n=a.fill)||void 0===n?void 0:n.type)||void 0===o?void 0:o.includes("gradient"))&&(P=Object.assign(Object.assign({},z),{detail:Object.assign(Object.assign({},z.detail),{background:a.fill,clipPath:{commands:a.commands,originX:s,originY:r,originW:l,originH:h}})}),O.detail=Object.assign({},P.detail)),_t(t,{x:v,y:w,w:g,h:p,angle:y},(()=>{Ie(t,P,{originElem:O,calcElemSize:{x:v,y:w,w:g,h:p,angle:y},viewScaleInfo:f,viewSizeInfo:d,parentOpacity:u,renderContent:()=>{ze(t,z,{viewScaleInfo:f,viewSizeInfo:d,renderContent:()=>{t.save(),t.translate(x,S),t.scale(k*m/f.scale,k*b/f.scale);const e=ge(a.commands||[]),i=new Path2D(e);a.fill&&("string"==typeof a.fill?t.fillStyle=a.fill:t.fillStyle="transparent"),a.fill&&t.fill(i,c),a.stroke&&0!==a.strokeWidth&&(t.strokeStyle=a.stroke,t.lineWidth=(a.strokeWidth||1)/d.devicePixelRatio,t.lineCap=a.strokeLineCap||"square",t.stroke(i)),t.translate(-x,-S),t.restore()}})}})}))}(t,e,i);break;case"group":{const n=Object.assign(Object.assign({},i.elementAssets||{}),e.detail.assets||{});!function(t,e,i){const{viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a}=i,{x:s,y:r,w:l,h:h,angle:c}=ce({x:e.x,y:e.y,w:e.w,h:e.h,angle:e.angle},{viewScaleInfo:n})||e,f=Object.assign(Object.assign({},e),{x:s,y:r,w:l,h:h,angle:c});_t(t,{x:s,y:r,w:l,h:h,angle:c},(()=>{t.globalAlpha=Se(e)*a,ze(t,f,{viewScaleInfo:n,viewSizeInfo:o,renderContent:()=>{Ie(t,f,{originElem:e,calcElemSize:{x:s,y:r,w:l,h:h,angle:c},viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a,renderContent:()=>{const{x:s,y:r,w:l,h:h,radiusList:c}=ye(f,{viewScaleInfo:n,viewSizeInfo:o});if("hidden"===e.detail.overflow&&(t.save(),t.fillStyle="transparent",t.beginPath(),t.moveTo(s+c[0],r),t.arcTo(s+l,r,s+l,r+h,c[1]),t.arcTo(s+l,r+h,s,r+h,c[2]),t.arcTo(s,r+h,s,r,c[3]),t.arcTo(s,r,s+l,r,c[0]),t.closePath(),t.fill(),t.clip()),Array.isArray(e.detail.children)){const{parentElementSize:n}=i,o={x:n.x+e.x,y:n.y+e.y,w:e.w||n.w,h:e.h||n.h,angle:e.angle},{calculator:s}=i;for(let n=0;n<e.detail.children.length;n++){let r=e.detail.children[n];if(r=Object.assign(Object.assign({},r),{x:o.x+r.x,y:o.y+r.y}),!0===i.forceDrawAll||(null==s?void 0:s.needRender(r)))try{Ce(t,r,Object.assign(Object.assign({},i),{parentOpacity:a*Se(e)}))}catch(t){console.error(t)}}}"hidden"===e.detail.overflow&&t.restore()}})}}),t.globalAlpha=a}))}(t,e,Object.assign(Object.assign({},i),{elementAssets:n}));break}}}catch(t){console.error(t)}}const We={boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,fontFamily:"sans-serif",fontWeight:400,minInlineSize:"auto",wordBreak:"break-all",overflow:"hidden"};function Ae(t,e,i){var n;const{elements:o=[]}=e,{parentOpacity:a}=i;for(let e=0;e<o.length;e++){const s=o[e],r=Object.assign(Object.assign({},s),{detail:Object.assign(Object.assign({},We),null==s?void 0:s.detail)});if(!0===i.forceDrawAll||(null===(n=i.calculator)||void 0===n?void 0:n.needRender(r)))try{Ce(t,r,Object.assign(Object.assign({},i),{parentOpacity:a}))}catch(t){console.error(t)}}}var Re,Te,Le,Ve,je,De,$e,Be,Xe,Ye,He,Fe,Ue=function(t,e,i,n){return new(i||(i=Promise))((function(o,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function r(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,r)}l((n=n.apply(t,e||[])).next())}))},Ne=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},Ge=function(t,e,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,i):o?o.value=i:e.set(t,i),i};const Qe=["image","svg","html"],qe=t=>{var e,i,n;let o=null;return"image"===t.type?o=(null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.src)||null:"svg"===t.type?o=(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.svg)||null:"html"===t.type&&(o=(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.html)||null),"string"==typeof o&&o?/^@assets\/[0-9a-z]{8,8}\-[0-9a-z]{4,4}\-[0-9a-z]{4,4}\-[0-9a-z]{4,4}\-[0-9a-z]{12,12}$/.test(`${o}`)?o:Pt(o):Pt(`${kt()}-${t.uuid}-${kt()}-${kt()}`)};class Ke extends Ht{constructor(){super(),Re.add(this),Te.set(this,{}),Le.set(this,{}),Ve.set(this,{}),je.set(this,!1),Ne(this,Re,"m",De).call(this,"image",((t,e)=>Ue(this,void 0,void 0,(function*(){var i;const n=(null===(i=e[t.detail.src])||void 0===i?void 0:i.value)||t.detail.src,o=yield Rt(n);return{uuid:t.uuid,lastModified:Date.now(),content:o}})))),Ne(this,Re,"m",De).call(this,"html",((t,e)=>Ue(this,void 0,void 0,(function*(){var i;const n=(null===(i=e[t.detail.html])||void 0===i?void 0:i.value)||t.detail.html,o=yield Lt(n,{width:t.detail.originW||t.w,height:t.detail.originH||t.h});return{uuid:t.uuid,lastModified:Date.now(),content:o}})))),Ne(this,Re,"m",De).call(this,"svg",((t,e)=>Ue(this,void 0,void 0,(function*(){var i;const n=(null===(i=e[t.detail.svg])||void 0===i?void 0:i.value)||t.detail.svg,o=yield Tt(n);return{uuid:t.uuid,lastModified:Date.now(),content:o}}))))}isDestroyed(){return Ne(this,je,"f")}destroy(){Ge(this,je,!0,"f"),this.clear(),Ge(this,Te,null,"f"),Ge(this,Le,null,"f"),Ge(this,Ve,null,"f")}load(t,e){!0!==Ne(this,je,"f")&&(Ne(this,Re,"m",Fe).call(this,t)||Qe.includes(t.type)&&Ne(this,Re,"m",He).call(this,t,e))}getContent(t){var e,i;const n=qe(t);return(null===(i=null===(e=Ne(this,Ve,"f"))||void 0===e?void 0:e[n])||void 0===i?void 0:i.content)||null}getLoadItemMap(){return Ne(this,Ve,"f")}setLoadItemMap(t){Ge(this,Ve,t,"f")}}Te=new WeakMap,Le=new WeakMap,Ve=new WeakMap,je=new WeakMap,Re=new WeakSet,De=function(t,e){Ne(this,Te,"f")[t]=e},$e=function(t){var e,i,n;let o=null;return"image"===t.type?o=(null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.src)||null:"svg"===t.type?o=(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.svg)||null:"html"===t.type&&(o=(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.html)||null),o},Be=function(t){return{element:t,status:"null",content:null,error:null,startTime:-1,endTime:-1,source:Ne(this,Re,"m",$e).call(this,t)}},Xe=function(t){const e=qe(t.element),i=Ne(this,Ve,"f")[e];Ne(this,je,"f")||(i?i.startTime<t.startTime&&(Ne(this,Ve,"f")[e]=t,this.trigger("load",Object.assign(Object.assign({},t),{countTime:t.endTime-t.startTime}))):(Ne(this,Ve,"f")[e]=t,this.trigger("load",Object.assign(Object.assign({},t),{countTime:t.endTime-t.startTime}))))},Ye=function(t){var e;const i=qe(t.element),n=null===(e=Ne(this,Ve,"f"))||void 0===e?void 0:e[i];Ne(this,je,"f")||(n?n.startTime<t.startTime&&(Ne(this,Ve,"f")[i]=t,this.trigger("error",Object.assign(Object.assign({},t),{countTime:t.endTime-t.startTime}))):(Ne(this,Ve,"f")[i]=t,this.trigger("error",Object.assign(Object.assign({},t),{countTime:t.endTime-t.startTime}))))},He=function(t,e){const i=Ne(this,Re,"m",Be).call(this,t),n=qe(t);if(Ne(this,Le,"f")[n])return;Ne(this,Le,"f")[n]=i;const o=Ne(this,Te,"f")[t.type];"function"!=typeof o||Ne(this,je,"f")||(i.startTime=Date.now(),o(t,e).then((t=>{Ne(this,je,"f")||(i.content=t.content,i.endTime=Date.now(),i.status="load",Ne(this,Re,"m",Xe).call(this,i))})).catch((e=>{console.warn(`Load element source "${i.source}" fail`,e,t),i.endTime=Date.now(),i.status="error",i.error=e,Ne(this,Re,"m",Ye).call(this,i)})))},Fe=function(t){var e;const i=qe(t),n=null===(e=Ne(this,Le,"f"))||void 0===e?void 0:e[i];return!(!n||"error"!==n.status||!n.source||n.source!==Ne(this,Re,"m",$e).call(this,t))};var Je,Ze,_e,ti,ei,ii=function(t,e,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,i):o?o.value=i:e.set(t,i),i},ni=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};class oi extends Ht{constructor(t){super(),Je.add(this),Ze.set(this,void 0),_e.set(this,new Ke),ti.set(this,!1),ii(this,Ze,t,"f"),ni(this,Je,"m",ei).call(this)}isDestroyed(){return ni(this,ti,"f")}destroy(){this.clear(),ii(this,Ze,null,"f"),ni(this,_e,"f").destroy(),ii(this,_e,null,"f"),ii(this,ti,!0,"f")}updateOptions(t){ii(this,Ze,t,"f")}drawData(t,e){const i=ni(this,_e,"f"),{calculator:n,sharer:o}=ni(this,Ze,"f"),a=ni(this,Ze,"f").viewContext;a.clearRect(0,0,a.canvas.width,a.canvas.height);const s={x:0,y:0,w:e.viewSizeInfo.width,h:e.viewSizeInfo.height},r=Object.assign({loader:i,calculator:n,parentElementSize:s,elementAssets:t.assets,parentOpacity:1,overrideElementMap:null==o?void 0:o.getActiveOverrideElemenentMap()},e);!function(t,e,i){if("string"==typeof(null==e?void 0:e.background)){const{viewSizeInfo:n}=i,{width:o,height:a}=n;t.globalAlpha=1,t.fillStyle=e.background,t.fillRect(0,0,o,a)}}(a,t.global,r),t.layout?function(t,e,i,n){const{viewScaleInfo:o,viewSizeInfo:a,parentOpacity:s}=i,r=Object.assign({uuid:"layout",type:"group"},e),{x:l,y:h,w:c,h:f}=ce(r,{viewScaleInfo:o})||r,d=Object.assign(Object.assign({},r),{x:l,y:h,w:c,h:f,angle:0});if(t.globalAlpha=1,ze(t,d,{viewScaleInfo:o,viewSizeInfo:a,renderContent:()=>{Me(t,d,{viewScaleInfo:o,viewSizeInfo:a})}}),"hidden"===e.detail.overflow){const{viewScaleInfo:n,viewSizeInfo:o}=i,a=Object.assign({uuid:"layout",type:"group"},e),s=ce(a,{viewScaleInfo:n})||a,r=Object.assign(Object.assign({},a),s),{x:l,y:h,w:c,h:f,radiusList:d}=ye(r,{viewScaleInfo:n,viewSizeInfo:o});t.save(),t.fillStyle="transparent",t.beginPath(),t.moveTo(l+d[0],h),t.arcTo(l+c,h,l+c,h+f,d[1]),t.arcTo(l+c,h+f,l,h+f,d[2]),t.arcTo(l,h+f,l,h,d[3]),t.arcTo(l,h,l+c,h,d[0]),t.closePath(),t.fill(),t.clip()}n(t),"hidden"===e.detail.overflow&&t.restore(),ke(t,d,{viewScaleInfo:o,viewSizeInfo:a}),t.globalAlpha=s}(a,t.layout,r,(()=>{Ae(a,t,r)})):Ae(a,t,r)}scale(t){const{sharer:e}=ni(this,Ze,"f");if(!e)return;const{data:i,offsetTop:n,offsetBottom:o,offsetLeft:a,offsetRight:s,width:r,height:l,contextHeight:h,contextWidth:c,devicePixelRatio:f}=e.getActiveStoreSnapshot();i&&this.drawData(i,{viewScaleInfo:{scale:t,offsetTop:n,offsetBottom:o,offsetLeft:a,offsetRight:s},viewSizeInfo:{width:r,height:l,contextHeight:h,contextWidth:c,devicePixelRatio:f}})}setLoadItemMap(t){ni(this,_e,"f").setLoadItemMap(t)}getLoadItemMap(){return ni(this,_e,"f").getLoadItemMap()}getLoader(){return ni(this,_e,"f")}}Ze=new WeakMap,_e=new WeakMap,ti=new WeakMap,Je=new WeakSet,ei=function(){const t=ni(this,_e,"f");t.on("load",(t=>{this.trigger("load",t)})),t.on("error",(t=>{console.error(t)}))};class ai{constructor(t){bt(this,e,void 0),bt(this,i,void 0),xt(this,e,t),xt(this,i,new Jt({defaultStorage:{viewVisibleInfoMap:{},visibleCount:0,invisibleCount:0}}))}toGridNum(t,e){return!0===(null==e?void 0:e.ignore)?t:Math.round(t)}destroy(){xt(this,e,null)}needRender(t){const e=mt(this,i).get("viewVisibleInfoMap")[t.uuid];return!e||e.isVisibleInView}isPointInElement(t,i,n,o){return de(t,{context2d:mt(this,e).viewContext,element:i,viewScaleInfo:n,viewSizeInfo:o})}getPointElement(t,i){return function(t,e){var i,n,o;const{context2d:a,data:s,viewScaleInfo:r,viewSizeInfo:l,groupQueue:h}=e,c={index:-1,element:null,groupQueueIndex:-1};if(h&&Array.isArray(h)&&(null==h?void 0:h.length)>0)for(let e=h.length-1;e>=0;e--){let o=0,s=0,f=0;for(let t=0;t<=e;t++)o+=h[t].x,s+=h[t].y,f+=h[t].angle||0;const d=h[e];if(d&&"group"===d.type&&Array.isArray(null===(i=d.detail)||void 0===i?void 0:i.children))for(let i=0;i<d.detail.children.length;i++){const u=d.detail.children[i];if(!0!==(null===(n=null==u?void 0:u.operations)||void 0===n?void 0:n.invisible)){if(!u)break;if(de(t,{context2d:a,element:{x:o+u.x,y:s+u.y,w:u.w,h:u.h,angle:f+(u.angle||0)},viewScaleInfo:r,viewSizeInfo:l})){c.element=u,(e<h.length-1||"group"!==u.type)&&(c.groupQueueIndex=e);break}}}if(c.element)break}if(c.element)return c;for(let e=s.elements.length-1;e>=0;e--){const i=s.elements[e];if(!0!==(null===(o=null==i?void 0:i.operations)||void 0===o?void 0:o.invisible)&&de(t,{context2d:a,element:i,viewScaleInfo:r,viewSizeInfo:l})){c.index=e,c.element=i;break}}return c}(t,{...i,context2d:mt(this,e).viewContext})}resetViewVisibleInfoMap(t,e){if(t){const{viewVisibleInfoMap:n,invisibleCount:o,visibleCount:a}=function(t,e){const i={},n=[],o=e=>{const a={isVisibleInView:!0,isGroup:"group"===e.type,position:[...n]};let s=null;s=ue(e,{groupQueue:se(t,n)||[]}),i[e.uuid]=Object.assign(Object.assign({},a),{originRectInfo:s,rangeRectInfo:Bt.angle(e.angle)?ve(s):s}),"group"===e.type&&e.detail.children.forEach(((t,e)=>{n.push(e),o(t),n.pop()}))};return t.forEach(((t,e)=>{n.push(e),o(t),n.pop()})),we(i,e)}(t.elements,e);mt(this,i).set("viewVisibleInfoMap",n),mt(this,i).set("invisibleCount",o),mt(this,i).set("visibleCount",a)}}updateVisiableStatus(t){const{viewVisibleInfoMap:e,invisibleCount:n,visibleCount:o}=we(mt(this,i).get("viewVisibleInfoMap"),t);mt(this,i).set("viewVisibleInfoMap",e),mt(this,i).set("invisibleCount",n),mt(this,i).set("visibleCount",o)}calcViewRectInfoFromOrigin(t,e){const n=mt(this,i).get("viewVisibleInfoMap")[t];if(!(null==n?void 0:n.originRectInfo))return null;const{checkVisible:o,viewScaleInfo:a,viewSizeInfo:s}=e,{center:r,left:l,right:h,bottom:c,top:f,topLeft:d,topRight:u,bottomLeft:v,bottomRight:w}=n.originRectInfo;if(!0===o&&!1===n.isVisibleInView)return null;const g={viewScaleInfo:a,viewSizeInfo:s};return{center:fe(r,g),left:fe(l,g),right:fe(h,g),bottom:fe(c,g),top:fe(f,g),topLeft:fe(d,g),topRight:fe(u,g),bottomLeft:fe(v,g),bottomRight:fe(w,g)}}calcViewRectInfoFromRange(t,e){const n=mt(this,i).get("viewVisibleInfoMap")[t];if(!(null==n?void 0:n.originRectInfo))return null;const{checkVisible:o,viewScaleInfo:a,viewSizeInfo:s}=e,{center:r,left:l,right:h,bottom:c,top:f,topLeft:d,topRight:u,bottomLeft:v,bottomRight:w}=n.rangeRectInfo;if(!0===o&&!1===n.isVisibleInView)return null;const g={viewScaleInfo:a,viewSizeInfo:s};return{center:fe(r,g),left:fe(l,g),right:fe(h,g),bottom:fe(c,g),top:fe(f,g),topLeft:fe(d,g),topRight:fe(u,g),bottomLeft:fe(v,g),bottomRight:fe(w,g)}}modifyViewVisibleInfoMap(t,e){const{modifyOptions:n,viewScaleInfo:o,viewSizeInfo:a}=e,{type:s,content:r}=n,l=t.elements,h=mt(this,i).get("viewVisibleInfoMap");if("deleteElement"===s){const{element:t}=r,e=[],n=t=>{e.push(t.uuid),"group"===t.type&&Array.isArray(t.detail.children)&&t.detail.children.forEach((t=>{n(t)}))};n(t),e.forEach((t=>{delete h[t]})),mt(this,i).set("viewVisibleInfoMap",h)}else if("addElement"===s||"updateElement"===s){const{position:e}=r,n=function(t,e){let i=null,n=e;for(let e=0;e<t.length;e++){const o=n[t[e]];if(e<t.length-1&&"group"===o.type)n=o.detail.children;else{if(e!==t.length-1)break;i=o}}return i}(e,t.elements),c=se(l,e);if(n)if("updateElement"===s&&"group"===n.type)this.resetViewVisibleInfoMap(t,{viewScaleInfo:o,viewSizeInfo:a});else{const t=ue(n,{groupQueue:c||[]}),r={originRectInfo:t,rangeRectInfo:Bt.angle(n.angle)?ve(t):t,isVisibleInView:!0,isGroup:"group"===(null==n?void 0:n.type),position:[...e]};h[n.uuid]=r,mt(this,i).set("viewVisibleInfoMap",h),"updateElement"===s&&this.updateVisiableStatus({viewScaleInfo:o,viewSizeInfo:a})}}else"moveElement"===s&&this.resetViewVisibleInfoMap(t,{viewScaleInfo:o,viewSizeInfo:a})}}function si(t){return t>0||t<0||0===t}e=new WeakMap,i=new WeakMap;class ri extends Ht{constructor(t){super(),bt(this,s),bt(this,g),bt(this,y),bt(this,b),bt(this,n,void 0),bt(this,o,void 0),bt(this,a,!1),bt(this,l,(t=>{if(!St(this,g,p).call(this,t))return;const e=St(this,y,m).call(this,t);if(!St(this,b,x).call(this,e))return;t.preventDefault(),t.stopPropagation();const i=t.deltaX>0||t.deltaX<0?t.deltaX:0,n=t.deltaY>0||t.deltaY<0?t.deltaY:0;!0===t.ctrlKey&&this.has("wheelScale")?this.trigger("wheelScale",{deltaX:i,deltaY:n,point:e}):this.has("wheel")&&this.trigger("wheel",{deltaX:i,deltaY:n,point:e})})),bt(this,h,(t=>{if(!St(this,g,p).call(this,t))return;t.preventDefault();const e=St(this,y,m).call(this,t);St(this,b,x).call(this,e)})),bt(this,c,(t=>{if(!St(this,g,p).call(this,t))return;t.preventDefault();const e=St(this,y,m).call(this,t);if(!St(this,b,x).call(this,e))return;const i=Date.now(),n=mt(this,o).get("prevClickPoint");n&&i-n.t<=500&&Math.abs(n.x-e.x)<=5&&Math.abs(n.y-e.y)<=5?this.trigger("doubleClick",{point:e}):mt(this,o).set("prevClickPoint",e)})),bt(this,f,(t=>{if(mt(this,o).set("hasPointDown",!1),!St(this,g,p).call(this,t))return;t.preventDefault();const e=St(this,y,m).call(this,t);this.trigger("pointLeave",{point:e})})),bt(this,d,(t=>{if(mt(this,o).set("hasPointDown",!1),!St(this,g,p).call(this,t))return;t.preventDefault();const e=St(this,y,m).call(this,t);this.trigger("pointEnd",{point:e})})),bt(this,u,(t=>{if(!St(this,g,p).call(this,t))return;t.preventDefault(),t.stopPropagation();const e=St(this,y,m).call(this,t);St(this,b,x).call(this,e)?!0===mt(this,o).get("hasPointDown")&&this.trigger("pointMove",{point:e}):mt(this,o).get("hasPointDown")&&(this.trigger("pointLeave",{point:e}),mt(this,o).set("hasPointDown",!1))})),bt(this,v,(t=>{if(!St(this,g,p).call(this,t))return;t.preventDefault();const e=St(this,y,m).call(this,t);St(this,b,x).call(this,e)&&(mt(this,o).set("hasPointDown",!0),this.trigger("pointStart",{point:e}))})),bt(this,w,(t=>{if(!St(this,g,p).call(this,t))return;t.preventDefault();const e=St(this,y,m).call(this,t);St(this,b,x).call(this,e)&&this.trigger("hover",{point:e})}));const e=new Jt({defaultStorage:{hasPointDown:!1,prevClickPoint:null}});xt(this,o,e),xt(this,n,t),St(this,s,r).call(this)}onEvents(){if(mt(this,a))return;const t=window;t.addEventListener("mousemove",mt(this,w)),t.addEventListener("mousedown",mt(this,v)),t.addEventListener("mousemove",mt(this,u)),t.addEventListener("mouseup",mt(this,d)),t.addEventListener("mouseleave",mt(this,f)),t.addEventListener("wheel",mt(this,l),{passive:!1}),t.addEventListener("click",mt(this,c)),t.addEventListener("contextmenu",mt(this,h))}offEvents(){const t=window;t.removeEventListener("mousemove",mt(this,w)),t.removeEventListener("mousedown",mt(this,v)),t.removeEventListener("mousemove",mt(this,u)),t.removeEventListener("mouseup",mt(this,d)),t.removeEventListener("mouseleave",mt(this,f)),t.removeEventListener("wheel",mt(this,l)),t.removeEventListener("click",mt(this,c)),t.removeEventListener("contextmenu",mt(this,h))}destroy(){this.offEvents(),mt(this,o).destroy(),xt(this,a,!0)}}n=new WeakMap,o=new WeakMap,a=new WeakMap,s=new WeakSet,r=function(){this.onEvents()},l=new WeakMap,h=new WeakMap,c=new WeakMap,f=new WeakMap,d=new WeakMap,u=new WeakMap,v=new WeakMap,w=new WeakMap,g=new WeakSet,p=function(t){return t.target===mt(this,n).boardContent.boardContext.canvas},y=new WeakSet,m=function(t){const e=mt(this,n).boardContent.boardContext.canvas.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top,t:Date.now()}},b=new WeakSet,x=function(t){const e=mt(this,n).sharer.getActiveViewSizeInfo(),{width:i,height:o}=e;return!!(si(t.x)&&si(t.y)&&t.x<=i&&t.y<=o)};const li={width:0,height:0,devicePixelRatio:1,contextWidth:0,contextHeight:0,data:null,scale:1,offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0,overrideElementMap:null};class hi{constructor(){bt(this,S,void 0),bt(this,I,void 0);const t=new Jt({defaultStorage:li}),e=new Jt({defaultStorage:{}});xt(this,S,t),xt(this,I,e)}getActiveStorage(t){return mt(this,S).get(t)}setActiveStorage(t,e){return mt(this,S).set(t,e)}getActiveStoreSnapshot(t){return mt(this,S).getSnapshot(t)}getSharedStorage(t){return mt(this,I).get(t)}setSharedStorage(t,e){return mt(this,I).set(t,e)}getSharedStoreSnapshot(t){return mt(this,I).getSnapshot(t)}getActiveViewScaleInfo(){return{scale:mt(this,S).get("scale"),offsetTop:mt(this,S).get("offsetTop"),offsetBottom:mt(this,S).get("offsetBottom"),offsetLeft:mt(this,S).get("offsetLeft"),offsetRight:mt(this,S).get("offsetRight")}}setActiveViewScaleInfo(t){const{scale:e,offsetTop:i,offsetBottom:n,offsetLeft:o,offsetRight:a}=t;mt(this,S).set("scale",e),mt(this,S).set("offsetTop",i),mt(this,S).set("offsetBottom",n),mt(this,S).set("offsetLeft",o),mt(this,S).set("offsetRight",a)}setActiveViewSizeInfo(t){mt(this,S).set("width",t.width),mt(this,S).set("height",t.height),mt(this,S).set("devicePixelRatio",t.devicePixelRatio),mt(this,S).set("contextWidth",t.contextWidth),mt(this,S).set("contextHeight",t.contextHeight)}getActiveViewSizeInfo(){return{width:mt(this,S).get("width"),height:mt(this,S).get("height"),devicePixelRatio:mt(this,S).get("devicePixelRatio"),contextWidth:mt(this,S).get("contextWidth"),contextHeight:mt(this,S).get("contextHeight")}}getActiveOverrideElemenentMap(){return mt(this,S).get("overrideElementMap")}setActiveOverrideElemenentMap(t){mt(this,S).set("overrideElementMap",t)}}S=new WeakMap,I=new WeakMap;const{requestAnimationFrame:ci}=window;class fi extends Ht{constructor(t){super(),bt(this,P),bt(this,E),bt(this,M,void 0),bt(this,k,[]),bt(this,z,"FREE"),xt(this,M,t),St(this,P,O).call(this)}resetViewVisibleInfoMap(t,e){t&&mt(this,M).calculator.resetViewVisibleInfoMap(t,e)}drawFrame(){const{sharer:t}=mt(this,M),e=t.getActiveStoreSnapshot(),i=t.getSharedStoreSnapshot();mt(this,k).push({activeStore:e,sharedStore:i}),St(this,E,C).call(this)}scale(t){const{scale:e,point:i,ignoreUpdateVisibleStatus:n}=t,{sharer:o}=mt(this,M),{moveX:a,moveY:s}=function(t){const{scale:e,point:i,viewScaleInfo:n}=t,{offsetLeft:o,offsetTop:a}=n,s=e/n.scale,r=i.x,l=i.y;return{moveX:r-r*s+(o*s-o),moveY:l-l*s+(a*s-a)}}({scale:e,point:i,viewScaleInfo:o.getActiveViewScaleInfo(),viewSizeInfo:o.getActiveViewSizeInfo()});return o.setActiveStorage("scale",e),n||mt(this,M).calculator.updateVisiableStatus({viewScaleInfo:o.getActiveViewScaleInfo(),viewSizeInfo:o.getActiveViewSizeInfo()}),{moveX:a,moveY:s}}scroll(t){const{sharer:e}=mt(this,M),i=e.getActiveViewScaleInfo(),{moveX:n,moveY:o,ignoreUpdateVisibleStatus:a}=t,s=function(t){const{moveX:e=0,moveY:i=0,viewScaleInfo:n,viewSizeInfo:o}=t,{scale:a}=n,{width:s,height:r,contextWidth:l,contextHeight:h}=o;let c=n.offsetLeft,f=n.offsetRight,d=n.offsetTop,u=n.offsetBottom;return c+=e,d+=i,f=s-(l*a+c),u=r-(h*a+d),{scale:a,offsetTop:d,offsetLeft:c,offsetRight:f,offsetBottom:u}}({moveX:n,moveY:o,viewScaleInfo:i,viewSizeInfo:e.getActiveViewSizeInfo()});return e.setActiveViewScaleInfo(s),a||mt(this,M).calculator.updateVisiableStatus({viewScaleInfo:e.getActiveViewScaleInfo(),viewSizeInfo:e.getActiveViewSizeInfo()}),s}updateViewScaleInfo(t){const{sharer:e}=mt(this,M),i=function(t,e){const{scale:i,offsetX:n,offsetY:o}=t,{viewSizeInfo:a}=e,{width:s,height:r,contextWidth:l,contextHeight:h}=a,c=0-n*i,f=0-o*i;return{scale:i,offsetLeft:c,offsetTop:f,offsetRight:s-(l*i+c/i),offsetBottom:r-(h*i+f/i)}}(t,{viewSizeInfo:e.getActiveViewSizeInfo()});return e.setActiveViewScaleInfo(i),mt(this,M).calculator.updateVisiableStatus({viewScaleInfo:e.getActiveViewScaleInfo(),viewSizeInfo:e.getActiveViewSizeInfo()}),i}resize(t={},e){const{sharer:i}=mt(this,M),n={...i.getActiveViewSizeInfo(),...t},{width:o,height:a,devicePixelRatio:s}=n,{underlayContext:r,boardContext:l,overlayContext:h,viewContext:c}=mt(this,M).boardContent;return l.canvas.width=o*s,l.canvas.height=a*s,l.canvas.style.width=`${o}px`,l.canvas.style.height=`${a}px`,r.canvas.width=o*s,r.canvas.height=a*s,h.canvas.width=o*s,h.canvas.height=a*s,c.canvas.width=o*s,c.canvas.height=a*s,i.setActiveViewSizeInfo(n),(null==e?void 0:e.ignoreUpdateVisibleStatus)||mt(this,M).calculator.updateVisiableStatus({viewScaleInfo:i.getActiveViewScaleInfo(),viewSizeInfo:i.getActiveViewSizeInfo()}),n}}M=new WeakMap,k=new WeakMap,z=new WeakMap,P=new WeakSet,O=function(){const{renderer:t}=mt(this,M);t.on("load",(()=>{this.drawFrame()}))},E=new WeakSet,C=function(){if("DRAWING"===mt(this,z)||0===mt(this,k).length)return;xt(this,z,"DRAWING");const t=mt(this,k).shift(),{renderer:e,boardContent:i,beforeDrawFrame:n,afterDrawFrame:o}=mt(this,M);if(t){const{scale:a,offsetTop:s,offsetBottom:r,offsetLeft:l,offsetRight:h,width:c,height:f,contextHeight:d,contextWidth:u,devicePixelRatio:v}=t.activeStore,w={scale:a,offsetTop:s,offsetBottom:r,offsetLeft:l,offsetRight:h},g={width:c,height:f,contextHeight:d,contextWidth:u,devicePixelRatio:v};(null==t?void 0:t.activeStore.data)&&e.drawData(t.activeStore.data,{viewScaleInfo:w,viewSizeInfo:g}),n({snapshot:t}),i.drawView(),o({snapshot:t})}0!==mt(this,k).length?xt(this,z,"DRAWING")&&ci((()=>{St(this,E,C).call(this)})):xt(this,z,"COMPLETE")};return W=new WeakMap,A=new WeakMap,R=new WeakMap,T=new WeakMap,L=new WeakMap,V=new WeakMap,j=new WeakMap,D=new WeakMap,$=new WeakMap,B=new WeakMap,X=new WeakMap,Y=new WeakSet,H=function(){mt(this,L).on("pointStart",St(this,F,U).bind(this)),mt(this,L).on("pointEnd",St(this,N,G).bind(this)),mt(this,L).on("pointMove",St(this,Q,q).bind(this)),mt(this,L).on("hover",St(this,K,J).bind(this)),mt(this,L).on("wheel",St(this,tt,et).bind(this)),mt(this,L).on("wheelScale",St(this,it,nt).bind(this)),mt(this,L).on("scrollX",St(this,ot,at).bind(this)),mt(this,L).on("scrollY",St(this,st,rt).bind(this)),mt(this,L).on("resize",St(this,lt,ht).bind(this)),mt(this,L).on("doubleClick",St(this,Z,_).bind(this)),mt(this,V).on("load",(()=>{mt(this,B).trigger("loadResource")}))},F=new WeakSet,U=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.pointStart)?void 0:e.call(n,t)))return}},N=new WeakSet,G=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.pointEnd)?void 0:e.call(n,t)))return}},Q=new WeakSet,q=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.pointMove)?void 0:e.call(n,t)))return}},K=new WeakSet,J=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.hover)?void 0:e.call(n,t)))return}},Z=new WeakSet,_=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.doubleClick)?void 0:e.call(n,t)))return}},tt=new WeakSet,et=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.wheel)?void 0:e.call(n,t)))return}},it=new WeakSet,nt=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.wheelScale)?void 0:e.call(n,t)))return}},ot=new WeakSet,at=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.scrollX)?void 0:e.call(n,t)))return}},st=new WeakSet,rt=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.scrollY)?void 0:e.call(n,t)))return}},lt=new WeakSet,ht=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.resize)?void 0:e.call(n,t)))return}},ct=new WeakSet,ft=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.clear)?void 0:e.call(n,t)))return}},dt=new WeakSet,ut=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.beforeDrawFrame)?void 0:e.call(n,t)))return}},vt=new WeakSet,wt=function(t){var e;for(let i=0;i<mt(this,T).length;i++){const n=mt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.afterDrawFrame)?void 0:e.call(n,t)))return}},gt=new WeakSet,pt=function(){const t=[],e=mt(this,A);mt(this,R).forEach((i=>{const n=e.get(i);"enable"===(null==n?void 0:n.status)&&(null==n?void 0:n.middlewareObject)&&t.push(n.middlewareObject)})),xt(this,T,t)},t.Board=class{constructor(t){bt(this,Y),bt(this,F),bt(this,N),bt(this,Q),bt(this,K),bt(this,Z),bt(this,tt),bt(this,it),bt(this,ot),bt(this,st),bt(this,lt),bt(this,ct),bt(this,dt),bt(this,vt),bt(this,gt),bt(this,W,void 0),bt(this,A,new WeakMap),bt(this,R,[]),bt(this,T,[]),bt(this,L,void 0),bt(this,V,void 0),bt(this,j,void 0),bt(this,D,void 0),bt(this,$,void 0),bt(this,B,new Ht),bt(this,X,!1);const{boardContent:e}=t,i=new hi,n=new ai({viewContext:e.viewContext}),o=new ri({boardContent:e,sharer:i}),a=new oi({viewContext:e.viewContext,sharer:i,calculator:n});xt(this,W,t),xt(this,j,i),xt(this,L,o),xt(this,V,a),xt(this,$,n),xt(this,D,new fi({boardContent:t.boardContent,sharer:i,renderer:a,calculator:mt(this,$),beforeDrawFrame:t=>{St(this,dt,ut).call(this,t)},afterDrawFrame:t=>{St(this,vt,wt).call(this,t)}})),St(this,Y,H).call(this),St(this,gt,pt).call(this)}isDestroyed(){return mt(this,X)}destroy(){mt(this,L).destroy(),mt(this,V).destroy(),mt(this,$).destroy(),mt(this,B).destroy(),xt(this,X,!0)}getSharer(){return mt(this,j)}getViewer(){return mt(this,D)}getRenderer(){return mt(this,V)}setData(t,e){const{modifiedOptions:i}=e||{},n=mt(this,j);mt(this,j).setActiveStorage("data",t);const o=n.getActiveViewSizeInfo(),a=n.getActiveViewScaleInfo(),s=function(t,e){const i={x:0,y:0,w:0,h:0};t.forEach((t=>{const e={x:t.x,y:t.y,w:t.w,h:t.h,angle:t.angle};if(e.angle&&(e.angle>0||e.angle<0)){const t=oe(e);if(4===t.length){const i=[t[0].x,t[1].x,t[2].x,t[3].x],n=[t[0].y,t[1].y,t[2].y,t[3].y];e.x=Math.min(...i),e.y=Math.min(...n),e.w=Math.abs(Math.max(...i)-Math.min(...i)),e.h=Math.abs(Math.max(...n)-Math.min(...n))}}const n=Math.min(e.x,i.x),o=Math.min(e.y,i.y),a=Math.max(e.x+e.w,i.x+i.w),s=Math.max(e.y+e.h,i.y+i.h);i.x=n,i.y=o,i.w=Math.abs(a-n),i.h=Math.abs(s-o)})),(null==e?void 0:e.extend)&&(i.x=Math.min(i.x,0),i.y=Math.min(i.y,0));const n={contextWidth:i.w,contextHeight:i.h};return(null==e?void 0:e.viewWidth)&&(null==e?void 0:e.viewHeight)&&(null==e?void 0:e.viewWidth)>0&&(null==e?void 0:e.viewHeight)>0&&(e.viewWidth>i.x+i.w&&(n.contextWidth=e.viewWidth-i.x),e.viewHeight>i.y+i.h&&(n.contextHeight=e.viewHeight-i.y)),n}(t.elements,{viewWidth:o.width,viewHeight:o.height,extend:!0});mt(this,D).resetViewVisibleInfoMap(t,{viewSizeInfo:o,viewScaleInfo:a}),mt(this,D).drawFrame();const r={...o,...s};return mt(this,j).setActiveViewSizeInfo(r),{viewSizeInfo:r}}getData(){const{data:t}=mt(this,j).getActiveStoreSnapshot();return t}use(t,e){var i,n,o;if(mt(this,A).has(t)){const e=mt(this,A).get(t);if(e)return null==(n=(i=e.middlewareObject).use)||n.call(i),e.status="enable",mt(this,A).set(t,e),void St(this,gt,pt).call(this)}const{boardContent:a,container:s}=mt(this,W),r=t({boardContent:a,sharer:mt(this,j),viewer:mt(this,D),calculator:mt(this,$),eventHub:mt(this,B),container:s},e);null==(o=r.use)||o.call(r),mt(this,R).push(t),mt(this,T).push(r),mt(this,A).set(t,{status:"enable",middlewareObject:r,config:e}),St(this,gt,pt).call(this)}disuse(t){var e,i;const n=mt(this,A).get(t);n&&(null==(i=(e=n.middlewareObject).disuse)||i.call(e),n.status="disable",mt(this,A).set(t,n),St(this,gt,pt).call(this))}scale(t){const e=mt(this,D),{ignoreUpdateVisibleStatus:i}=t,{moveX:n,moveY:o}=e.scale({...t,ignoreUpdateVisibleStatus:!0});e.scroll({moveX:n,moveY:o,ignoreUpdateVisibleStatus:i})}scroll(t){return mt(this,D).scroll(t)}updateViewScaleInfo(t){return mt(this,D).updateViewScaleInfo(t)}resize(t,e){const i=mt(this,D).resize(t,e),{width:n,height:o,devicePixelRatio:a}=t,{boardContent:s}=mt(this,W);s.viewContext.$resize({width:n,height:o,devicePixelRatio:a}),s.overlayContext.$resize({width:n,height:o,devicePixelRatio:a}),s.boardContext.$resize({width:n,height:o,devicePixelRatio:a}),s.underlayContext.$resize({width:n,height:o,devicePixelRatio:a}),mt(this,D).drawFrame(),mt(this,L).trigger("resize",i),mt(this,j).setActiveViewSizeInfo(t)}clear(){const{boardContent:t}=mt(this,W),{underlayContext:e,overlayContext:i,viewContext:n,boardContext:o}=t;e.clearRect(0,0,e.canvas.width,e.canvas.height),i.clearRect(0,0,i.canvas.width,i.canvas.height),n.clearRect(0,0,n.canvas.width,n.canvas.height),o.clearRect(0,0,o.canvas.width,o.canvas.height),St(this,ct,ft).call(this)}getEventHub(){return mt(this,B)}onWatcherEvents(){mt(this,L).onEvents()}offWatcherEvents(){mt(this,L).offEvents()}},t.Calculator=ai,t.Sharer=hi,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
var iDrawBoard=function(t){"use strict";var e,i,n,o,a,s,r,l,h,c,f,d,u,v,w,g,p,y,m,b,x,S,I,M,k,z,P,O,E,C,W,A,R,T,L,V,j,D,$,B,X,Y,H,F,U,N,G,Q,q,K,J,Z,_,tt,et,it,nt,ot,at,st,rt,lt,ht,ct,ft,dt,ut,vt,wt,gt,pt,yt,mt,bt=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},xt=(t,e,i)=>(bt(t,e,"read from private field"),i?i.call(t):e.get(t)),St=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},It=(t,e,i,n)=>(bt(t,e,"write to private field"),n?n.call(t,i):e.set(t,i),i),Mt=(t,e,i)=>(bt(t,e,"access private method"),i);function kt(t){return"string"==typeof t&&(/^\#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t)||/^[a-z]{1,}$/i.test(t))}function zt(t,e){if(1===e)return t;let i=1;const n=/^\#[0-9a-f]{6,6}$/i;let o=t;if(n.test(t)?i=parseInt(t.substring(5,7).replace(/^\#/,"0x")):/^\#[0-9a-f]{8,8}$/i.test(t)&&(i=parseInt(t.substring(7,9).replace(/^\#/,"0x")),o=t.substring(0,7)),i*=e,n.test(o)&&i>0&&i<1){const t=Math.max(0,Math.min(255,Math.ceil(256*i)));o=`${o.toUpperCase()}${t.toString(16).toUpperCase()}`}return o}function Pt(){function t(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return`${t()}${t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`}function Ot(t){let e=0;for(let i=0;i<t.length;i++)e+=t.charCodeAt(i)*t.charCodeAt(i)*i*i;return e.toString(16).substring(0,4)}function Et(t){const e=t.length,i=Math.floor(e/2),n=t.substring(0,4).padEnd(4,"0"),o=t.substring(0,4).padEnd(4,"0");return`@assets/${Ot(e.toString(16).padEnd(4,n))}${Ot(t.substring(i-4,i).padEnd(4,n)).padEnd(4,"f")}-${Ot(t.substring(i-8,i-4).padEnd(4,n)).padEnd(4,"f")}-${Ot(t.substring(i-12,i-8).padEnd(4,n)).padEnd(4,"f")}-${Ot(t.substring(i-16,i-12).padEnd(4,o)).padEnd(4,"f")}-${Ot(t.substring(i,i+4).padEnd(4,o)).padEnd(4,"f")}${Ot(t.substring(i+4,i+8).padEnd(4,o)).padEnd(4,"f")}${Ot(o.padEnd(4,n).padEnd(4,o))}`}function Ct(t){return function t(e){const i=function(t){return Object.prototype.toString.call(t).replace(/[\]|\[]{1,1}/gi,"").split(" ")[1]}(e);if(["Null","Number","String","Boolean","Undefined"].indexOf(i)>=0)return e;if("Array"===i){const i=[];return e.forEach((e=>{i.push(t(e))})),i}if("Object"===i){const i={};Object.keys(e).forEach((n=>{i[n]=t(e[n])}));return Object.getOwnPropertySymbols(e).forEach((n=>{i[n]=t(e[n])})),i}}(t)}function Wt(t){return(Object.prototype.toString.call(t)||"").replace(/(\[object|\])/gi,"").trim()}const At={type(t,e){const i=Wt(t);return!0===e?i.toLocaleLowerCase():i},array:t=>"Array"===Wt(t),json:t=>"Object"===Wt(t),function:t=>"Function"===Wt(t),asyncFunction:t=>"AsyncFunction"===Wt(t),boolean:t=>"Boolean"===Wt(t),string:t=>"String"===Wt(t),number:t=>"Number"===Wt(t),undefined:t=>"Undefined"===Wt(t),null:t=>"Null"===Wt(t),promise:t=>"Promise"===Wt(t)};var Rt=function(t,e,i,n){return new(i||(i=Promise))((function(o,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function r(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,r)}l((n=n.apply(t,e||[])).next())}))};const{Image:Tt}=window;function Lt(t){return new Promise(((e,i)=>{const n=new Tt;n.crossOrigin="anonymous",n.onload=function(){e(n)},n.onabort=i,n.onerror=i,n.src=t}))}function Vt(t){return Rt(this,void 0,void 0,(function*(){const e=yield function(t){return new Promise(((e,i)=>{const n=new Blob([t],{type:"image/svg+xml;charset=utf-8"}),o=new FileReader;o.readAsDataURL(n),o.onload=function(t){var i;const n=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.result;e(n)},o.onerror=function(t){i(t)}}))}(t);return yield Lt(e)}))}function jt(t,e){return Rt(this,void 0,void 0,(function*(){t=t.replace(/\&/gi,"&amp;");const i=yield function(t,e){const{width:i,height:n}=e;return new Promise(((e,o)=>{const a=new Blob([`\n <svg \n xmlns="http://www.w3.org/2000/svg" \n width="${i||""}" \n height = "${n||""}">\n <foreignObject width="100%" height="100%">\n <div xmlns = "http://www.w3.org/1999/xhtml">\n ${t}\n </div>\n </foreignObject>\n </svg>\n `],{type:"image/svg+xml;charset=utf-8"}),s=new FileReader;s.readAsDataURL(a),s.onload=function(t){var i;const n=null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.result;e(n)},s.onerror=function(t){o(t)}}))}(t,e);return yield Lt(i)}))}function Dt(t){return"number"==typeof t&&(t>0||t<=0)}function $t(t){return"number"==typeof t&&t>=0}function Bt(t){return"string"==typeof t&&/^(http:\/\/|https:\/\/|\.\/|\/)/.test(`${t}`)}function Xt(t){return"string"==typeof t&&/^(data:image\/)/.test(`${t}`)}const Yt={x:function(t){return Dt(t)},y:function(t){return Dt(t)},w:$t,h:function(t){return"number"==typeof t&&t>=0},angle:function(t){return"number"==typeof t&&t>=-360&&t<=360},number:Dt,numberStr:function(t){return/^(-?\d+(?:\.\d+)?)$/.test(`${t}`)},borderWidth:function(t){return $t(t)},borderRadius:function(t){return Dt(t)&&t>=0},color:function(t){return kt(t)},imageSrc:function(t){return Xt(t)||Bt(t)},imageURL:Bt,imageBase64:Xt,svg:function(t){return"string"==typeof t&&/^(<svg[\s]{1,}|<svg>)/i.test(`${t}`.trim())&&/<\/[\s]{0,}svg>$/i.test(`${t}`.trim())},html:function(t){let e=!1;if("string"==typeof t){let i=document.createElement("div");i.innerHTML=t,i.children.length>0&&(e=!0),i=null}return e},text:function(t){return"string"==typeof t},fontSize:function(t){return Dt(t)&&t>0},lineHeight:function(t){return Dt(t)&&t>0},textAlign:function(t){return["center","left","right"].includes(t)},fontFamily:function(t){return"string"==typeof t&&t.length>0},fontWeight:function(t){return["bold"].includes(t)},strokeWidth:function(t){return Dt(t)&&t>0}};var Ht,Ft=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};class Ut{constructor(){Ht.set(this,void 0),function(t,e,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(t,i):o?o.value=i:e.set(t,i)}(this,Ht,new Map,"f")}on(t,e){if(Ft(this,Ht,"f").has(t)){const i=Ft(this,Ht,"f").get(t)||[];null==i||i.push(e),Ft(this,Ht,"f").set(t,i)}else Ft(this,Ht,"f").set(t,[e])}off(t,e){if(Ft(this,Ht,"f").has(t)){const i=Ft(this,Ht,"f").get(t);if(Array.isArray(i))for(let t=0;t<(null==i?void 0:i.length);t++)if(i[t]===e){i.splice(t,1);break}Ft(this,Ht,"f").set(t,i||[])}}trigger(t,e){const i=Ft(this,Ht,"f").get(t);return!!Array.isArray(i)&&(i.forEach((t=>{t(e)})),!0)}has(t){if(Ft(this,Ht,"f").has(t)){const e=Ft(this,Ht,"f").get(t);if(Array.isArray(e)&&e.length>0)return!0}return!1}destroy(){this.clear()}clear(){Ft(this,Ht,"f").clear()}}function Nt(t,e){return{x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}}Ht=new WeakMap;var Gt,Qt,qt,Kt,Jt=function(t,e,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,i):o?o.value=i:e.set(t,i),i},Zt=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};class _t{constructor(t){Gt.add(this),Qt.set(this,void 0),qt.set(this,void 0),Jt(this,qt,Ct(t.defaultStorage),"f"),Jt(this,Qt,Zt(this,Gt,"m",Kt).call(this),"f")}set(t,e){Zt(this,Qt,"f")[t]=e}get(t){return Zt(this,Qt,"f")[t]}getSnapshot(t){return!0===(null==t?void 0:t.deepClone)?Ct(Zt(this,Qt,"f")):Object.assign({},Zt(this,Qt,"f"))}clear(){Jt(this,Qt,Zt(this,Gt,"m",Kt).call(this),"f")}destroy(){Jt(this,Qt,null,"f")}}function te(t){return t/180*Math.PI}function ee(t,e,i){const n=ie(e);!function(t,e,i,n){const o=te(e||0);i&&(o>0||o<0)&&(t.translate(i.x,i.y),t.rotate(o),t.translate(-i.x,-i.y)),n(t),i&&(o>0||o<0)&&(t.translate(i.x,i.y),t.rotate(-o),t.translate(-i.x,-i.y))}(t,e.angle||0,n,(()=>{i(t)}))}function ie(t){return{x:t.x+t.w/2,y:t.y+t.h/2}}function ne(t){const e=Math.min(t[0].x,t[1].x,t[2].x,t[3].x),i=Math.min(t[0].y,t[1].y,t[2].y,t[3].y);return ie({x:e,y:i,w:Math.max(t[0].x,t[1].x,t[2].x,t[3].x)-e,h:Math.max(t[0].y,t[1].y,t[2].y,t[3].y)-i})}function oe(t,e,i){const n=function(t,e){const i=e.x-t.x,n=e.y-t.y;if(0===i){if(n<0)return 0;if(n>0)return Math.PI}else if(0===n){if(i<0)return 3*Math.PI/2;if(i>0)return Math.PI/2}return i>0&&n<0?Math.atan(Math.abs(i)/Math.abs(n)):i>0&&n>0?Math.PI-Math.atan(Math.abs(i)/Math.abs(n)):i<0&&n>0?Math.PI+Math.atan(Math.abs(i)/Math.abs(n)):i<0&&n<0?2*Math.PI-Math.atan(Math.abs(i)/Math.abs(n)):0}(t,e);let o=n+i;o>2*Math.PI?o-=2*Math.PI:o<0-2*Math.PI&&(o+=2*Math.PI),o<0&&(o+=2*Math.PI);const a=function(t,e){const i=(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y);return 0===i?i:Math.sqrt(i)}(t,e);let s=0,r=0;return 0===o?(s=0,r=0-a):o>0&&o<Math.PI/2?(s=Math.sin(o)*a,r=0-Math.cos(o)*a):o===Math.PI/2?(s=a,r=0):o>Math.PI/2&&o<Math.PI?(s=Math.sin(Math.PI-o)*a,r=Math.cos(Math.PI-o)*a):o===Math.PI?(s=0,r=a):o>Math.PI&&o<1.5*Math.PI?(s=0-Math.sin(o-Math.PI)*a,r=Math.cos(o-Math.PI)*a):o===1.5*Math.PI?(s=0-a,r=0):o>1.5*Math.PI&&o<2*Math.PI?(s=0-Math.sin(2*Math.PI-o)*a,r=0-Math.cos(2*Math.PI-o)*a):o===2*Math.PI&&(s=0,r=0-a),s+=t.x,r+=t.y,{x:s,y:r}}function ae(t,e,i){const{x:n,y:o,w:a,h:s}=t;let r={x:n,y:o},l={x:n+a,y:o},h={x:n+a,y:o+s},c={x:n,y:o+s};if(i&&(i>0||i<0)){const t=te(function(t){if(!(t>0||t<0)||0===t)return 0;let e=t%360;e<0&&(e+=360);return e}(i));r=oe(e,r,t),l=oe(e,l,t),h=oe(e,h,t),c=oe(e,c,t)}return[r,l,h,c]}function se(t){const{angle:e=0}=t;return ae(t,ie(t),e)}function re(t,e,i){return[oe(t,{x:e[0].x,y:e[0].y},i),oe(t,{x:e[1].x,y:e[1].y},i),oe(t,{x:e[2].x,y:e[2].y},i),oe(t,{x:e[3].x,y:e[3].y},i)]}function le(t,e){var i;const n=[];let o=t;if(e.length>1)for(let t=0;t<e.length-1;t++){const a=o[e[t]];if("group"!==(null==a?void 0:a.type)||!Array.isArray(null===(i=null==a?void 0:a.detail)||void 0===i?void 0:i.children))return null;n.push(a),o=a.detail.children}return n}function he(t){const{x:e,y:i,h:n,w:o}=t;return[{x:e,y:i},{x:e+o,y:i},{x:e+o,y:i+n},{x:e,y:i+n}]}function ce(t){const{x:e,y:i,w:n,h:o,angle:a=0}=t;return 0===a?he(t):ae(t,ie({x:e,y:i,w:n,h:o,angle:a}),a)}function fe(t,e){const{groupQueue:i}=e;if(!(i.length>0))return[ce(t)];const n=function(t){const e=[];let i=0,n=0;const o=[],a=[...t];for(let t=0;t<a.length;t++){const{x:s,y:r,w:l,h:h,angle:c=0}=a[t];let f;if(i+=s,n+=r,0===t){const t={x:i,y:n,w:l,h:h,angle:c};f=ce({x:s,y:r,w:l,h:h,angle:c}),o.push({center:ie(t),angle:c,radian:te(c)})}else{f=he({x:i,y:n,w:l,h:h,angle:c});for(let t=0;t<o.length;t++){const{center:e,radian:i}=o[t];f=re(e,f,i)}const t=ne(f);(c>0||c<0)&&(f=re(t,f,te(c))),o.push({center:t,angle:c,radian:te(c)})}e.push(f)}return e}([...i,t]);return n}function de(t,e){const{viewScaleInfo:i}=e,{x:n,y:o,w:a,h:s,angle:r}=t,{scale:l,offsetTop:h,offsetLeft:c}=i;return{x:n*l+c,y:o*l+h,w:a*l,h:s*l,angle:r}}function ue(t,e){const{viewScaleInfo:i}=e,{x:n,y:o}=t,{scale:a,offsetTop:s,offsetLeft:r}=i;return{x:n*a+r,y:o*a+s}}function ve(t,e){const{context2d:i,element:n,viewScaleInfo:o}=e,{angle:a=0}=n,{x:s,y:r,w:l,h:h}=de(n,{viewScaleInfo:o}),c=se({x:s,y:r,w:l,h:h,angle:a});if(c.length>=2){i.beginPath(),i.moveTo(c[0].x,c[0].y);for(let t=1;t<c.length;t++)i.lineTo(c[t].x,c[t].y);i.closePath()}return!!i.isPointInPath(t.x,t.y)}function we(t,e){const{groupQueue:i}=e,n=function(t,e){return fe(t,e).pop()||null}(t,{groupQueue:i}),o=Nt(n[0],n[1]),a=Nt(n[1],n[2]),s=Nt(n[2],n[3]),r=Nt(n[3],n[0]),l=n[0],h=n[1],c=n[2],f=n[3],d=Math.max(l.x,h.x,c.x,f.x),u=Math.max(l.y,h.y,c.y,f.y);return{center:{x:(d+Math.min(l.x,h.x,c.x,f.x))/2,y:(u+Math.min(l.y,h.y,c.y,f.y))/2},topLeft:l,topRight:h,bottomLeft:f,bottomRight:c,top:o,right:a,left:r,bottom:s}}function ge(t){const e=Math.max(t.topLeft.x,t.topRight.x,t.bottomRight.x,t.bottomLeft.x),i=Math.max(t.topLeft.y,t.topRight.y,t.bottomRight.y,t.bottomLeft.y),n=Math.min(t.topLeft.x,t.topRight.x,t.bottomRight.x,t.bottomLeft.x),o=Math.min(t.topLeft.y,t.topRight.y,t.bottomRight.y,t.bottomLeft.y),a={x:t.center.x,y:t.center.y},s={x:n,y:o},r={x:e,y:o},l={x:e,y:i},h={x:n,y:i},c=Nt(s,r),f=Nt(h,l),d=Nt(s,h);return{center:a,topLeft:s,topRight:r,bottomLeft:h,bottomRight:l,top:c,right:Nt(r,l),left:d,bottom:f}}function pe(t,e){const i=function(t){const{viewScaleInfo:e,viewSizeInfo:i}=t,{scale:n,offsetTop:o,offsetLeft:a}=e,{width:s,height:r}=i,l=0-a/n,h=0-o/n,c=s/n,f=r/n,d=ie({x:l,y:h,w:c,h:f}),u={x:l,y:h},v={x:l+c,y:h},w={x:l,y:h+f},g={x:l+c,y:h+f},p={x:l,y:d.y},y={x:d.x,y:h},m={x:l+c,y:d.y},b={x:d.x,y:h+f};return{center:d,topLeft:u,topRight:v,bottomLeft:w,bottomRight:g,left:p,top:y,right:m,bottom:b}}(e);let n=0,o=0;return Object.keys(t).forEach((e=>{const a=t[e];a.isVisibleInView=function(t,e){const i=Math.min(t.topLeft.x,t.topRight.x,t.bottomLeft.x,t.bottomRight.x),n=Math.max(t.topLeft.x,t.topRight.x,t.bottomLeft.x,t.bottomRight.x),o=Math.min(t.topLeft.y,t.topRight.y,t.bottomLeft.y,t.bottomRight.y),a=Math.max(t.topLeft.y,t.topRight.y,t.bottomLeft.y,t.bottomRight.y),s=Math.min(e.topLeft.x,e.topRight.x,e.bottomLeft.x,e.bottomRight.x),r=Math.max(e.topLeft.x,e.topRight.x,e.bottomLeft.x,e.bottomRight.x),l=Math.min(e.topLeft.y,e.topRight.y,e.bottomLeft.y,e.bottomRight.y),h=Math.max(e.topLeft.y,e.topRight.y,e.bottomLeft.y,e.bottomRight.y);return i<=r&&n>=s&&o<=h&&a>=l||r<=a&&r>=a&&r<=a&&r>=a}(a.rangeRectInfo,i),a.isVisibleInView?n++:o++})),{viewVisibleInfoMap:t,visibleCount:n,invisibleCount:o}}function ye(t){let e="";return t.forEach((t=>{e+=t.type+t.params.join(" ")})),e}Qt=new WeakMap,qt=new WeakMap,Gt=new WeakSet,Kt=function(){return Ct(Zt(this,qt,"f"))};const me={boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,fontFamily:"sans-serif",fontWeight:400,minInlineSize:"auto",wordBreak:"break-all",overflow:"hidden"};function be(t,e){const{viewScaleInfo:i}=e,{scale:n}=i;let{borderRadius:o,borderDash:a}=t.detail;const s=Array.isArray(a)&&a.length>0,{boxSizing:r=me.boxSizing,borderWidth:l}=t.detail;Array.isArray(l)&&(o=0);let{x:h,y:c,w:f,h:d}=t,u=[0,0,0,0];if("number"==typeof o){const t=o*n;u=[t,t,t,t]}else Array.isArray(o)&&4===(null==o?void 0:o.length)&&(u=[o[0]*n,o[1]*n,o[2]*n,o[3]*n]);let v=0;return"number"==typeof l&&(v=(l||0)*n),"border-box"!==r||s?"content-box"===r?(h=t.x-v/2,c=t.y-v/2,f=t.w+v,d=t.h+v):(h=t.x,c=t.y,f=t.w,d=t.h):(h=t.x+v/2,c=t.y+v/2,f=t.w-v,d=t.h-v),f=Math.max(f,1),d=Math.max(d,1),u=u.map((t=>Math.min(t,f/2,d/2))),{x:h,y:c,w:f,h:d,radiusList:u}}const xe=["-apple-system",'"system-ui"',' "Segoe UI"'," Roboto",'"Helvetica Neue"',"Arial",'"Noto Sans"'," sans-serif"];function Se(t,e,i){if("string"==typeof e)return e;const{viewElementSize:n,viewScaleInfo:o,opacity:a=1}=i,{x:s,y:r}=n,{scale:l}=o;if("linear-gradient"===(null==e?void 0:e.type)){const{start:i,end:n,stops:o}=e,h={x:s+i.x*l,y:r+i.y*l},c={x:s+n.x*l,y:r+n.y*l},f=t.createLinearGradient(h.x,h.y,c.x,c.y);return o.forEach((t=>{f.addColorStop(t.offset,zt(t.color,a))})),f}if("radial-gradient"===(null==e?void 0:e.type)){const{inner:i,outer:n,stops:o}=e,h={x:s+i.x*l,y:r+i.y*l,radius:i.radius*l},c={x:s+n.x*l,y:r+n.y*l,radius:n.radius*l},f=t.createRadialGradient(h.x,h.y,h.radius,c.x,c.y,c.radius);return o.forEach((t=>{f.addColorStop(t.offset,zt(t.color,a))})),f}return"#000000"}const Ie={boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,fontFamily:"sans-serif",fontWeight:400,minInlineSize:"auto",wordBreak:"break-all",overflow:"hidden"};function Me(t){var e,i,n,o;let a=1;return void 0!==(null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.opacity)&&(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.opacity)>=0&&(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.opacity)<=1&&(a=null===(o=null==t?void 0:t.detail)||void 0===o?void 0:o.opacity),a}function ke(t,e,i){const{pattern:n,renderContent:o,originElem:a,calcElemSize:s,viewScaleInfo:r,viewSizeInfo:l}=i||{},{parentOpacity:h}=i,c=Me(a)*h,{clipPath:f,clipPathStrokeColor:d,clipPathStrokeWidth:u}=a.detail,v=()=>{t.globalAlpha=c,ze(t,e,{pattern:n,viewScaleInfo:r,viewSizeInfo:l}),null==o||o(),Pe(t,e,{viewScaleInfo:r,viewSizeInfo:l}),t.globalAlpha=h};f?(function(t,e,i){const{renderContent:n,originElem:o,calcElemSize:a,viewSizeInfo:s}=i,r=s.devicePixelRatio,{clipPath:l}=(null==o?void 0:o.detail)||{};if(l&&a&&l.commands){const{x:i,y:o,w:s,h:h}=a,{originW:c,originH:f,originX:d,originY:u}=l,v=s/c,w=h/f,g=i-d*v,p=o-u*w;t.save(),t.translate(g,p),t.scale(r*v,r*w);const y=ye(l.commands||[]),m=new Path2D(y);t.clip(m),t.translate(0-g,0-p),t.setTransform(1,0,0,1,0,0),ee(t,Object.assign({},e),(()=>{null==n||n()})),t.restore()}else null==n||n()}(t,e,{originElem:a,calcElemSize:s,viewScaleInfo:r,viewSizeInfo:l,renderContent:()=>{v()}}),"number"==typeof u&&u>0&&d&&function(t,e,i){const{renderContent:n,originElem:o,calcElemSize:a,viewSizeInfo:s,parentOpacity:r}=i,l=s.devicePixelRatio,{clipPath:h,clipPathStrokeColor:c,clipPathStrokeWidth:f}=(null==o?void 0:o.detail)||{};if(h&&a&&h.commands&&"number"==typeof f&&f>0&&c){const{x:i,y:o,w:s,h:d}=a,{originW:u,originH:v,originX:w,originY:g}=h,p=s/u,y=d/v,m=i-w*p,b=o-g*y;t.save(),t.globalAlpha=r,t.translate(m,b),t.scale(l*p,l*y);const x=ye(h.commands||[]),S=new Path2D(x);t.strokeStyle=c,t.lineWidth=f,t.stroke(S),t.translate(0-m,0-b),t.setTransform(1,0,0,1,0,0),ee(t,Object.assign({},e),(()=>{null==n||n()})),t.restore()}else null==n||n()}(t,e,{originElem:a,calcElemSize:s,viewScaleInfo:r,viewSizeInfo:l,parentOpacity:h})):v()}function ze(t,e,i){var n,o;const{pattern:a,viewScaleInfo:s,viewSizeInfo:r}=i,l=[];if(e.detail.background||a){const{x:i,y:h,w:c,h:f,radiusList:d}=be(e,{viewScaleInfo:s,viewSizeInfo:r});if(t.beginPath(),t.moveTo(i+d[0],h),t.arcTo(i+c,h,i+c,h+f,d[1]),t.arcTo(i+c,h+f,i,h+f,d[2]),t.arcTo(i,h+f,i,h,d[3]),t.arcTo(i,h,i+c,h,d[0]),t.closePath(),"string"==typeof a)t.fillStyle=a;else if(["CanvasPattern"].includes(At.type(a)))t.fillStyle=a;else if("string"==typeof e.detail.background)t.fillStyle=e.detail.background;else if("linear-gradient"===(null===(n=e.detail.background)||void 0===n?void 0:n.type)){const n=Se(t,e.detail.background,{viewElementSize:{x:i,y:h,w:c,h:f},viewScaleInfo:s,opacity:t.globalAlpha});t.fillStyle=n}else if("radial-gradient"===(null===(o=e.detail.background)||void 0===o?void 0:o.type)){const n=Se(t,e.detail.background,{viewElementSize:{x:i,y:h,w:c,h:f},viewScaleInfo:s,opacity:t.globalAlpha});if(t.fillStyle=n,l&&l.length>0)for(let e=0;e<(null==l?void 0:l.length);e++){const n=l[e];"translate"===n.method?t.translate(n.args[0]+i,n.args[1]+h):"rotate"===n.method?t.rotate(...n.args):"scale"===n.method&&t.scale(...n.args)}}t.fill(),l&&l.length>0&&t.setTransform(1,0,0,1,0,0)}}function Pe(t,e,i){if(0===e.detail.borderWidth)return;if(!kt(e.detail.borderColor))return;const{viewScaleInfo:n}=i,{scale:o}=n;let a=Ie.borderColor;!0===kt(e.detail.borderColor)&&(a=e.detail.borderColor);const{borderWidth:s,borderRadius:r,borderDash:l,boxSizing:h=Ie.boxSizing}=e.detail;let c=0;"number"==typeof s&&(c=s||1),c*=o;let f=[0,0,0,0];if("number"==typeof r){const t=r*o;f=[t,t,t,t]}else Array.isArray(r)&&4===(null==r?void 0:r.length)&&(f=[r[0]*o,r[1]*o,r[2]*o,r[3]*o]);t.strokeStyle=a;let d=[];Array.isArray(l)&&l.length>0&&(d=l.map((t=>Math.ceil(t*o))));let u=0,v=0,w=0,g=0;if(Array.isArray(s)&&(u=(s[0]||0)*o,v=(s[1]||0)*o,w=(s[2]||0)*o,g=(s[3]||0)*o),g||v||u||w){t.lineCap="butt";let{x:i,y:n,w:o,h:a}=e;"border-box"===h?(i+=g/2,n+=u/2,o=o-g/2-v/2,a=a-u/2-w/2):"content-box"===h?(i-=g/2,n-=u/2,o=o+g/2+v/2,a=a+u/2+w/2):(i=e.x,n=e.y,o=e.w,a=e.h),u&&(t.beginPath(),t.lineWidth=u,t.moveTo(i-g/2,n),t.lineTo(i+o+v/2,n),t.closePath(),t.stroke()),v&&(t.beginPath(),t.lineWidth=v,t.moveTo(i+o,n-u/2),t.lineTo(i+o,n+a+w/2),t.closePath(),t.stroke()),w&&(t.beginPath(),t.lineWidth=w,t.moveTo(i-g/2,n+a),t.lineTo(i+o+v/2,n+a),t.closePath(),t.stroke()),g&&(t.beginPath(),t.lineWidth=g,t.moveTo(i,n-u/2),t.lineTo(i,n+a+w/2),t.closePath(),t.stroke())}else{let{x:i,y:n,w:o,h:a}=e;"border-box"===h?(i=e.x+c/2,n=e.y+c/2,o=e.w-c,a=e.h-c):"content-box"===h?(i=e.x-c/2,n=e.y-c/2,o=e.w+c,a=e.h+c):(i=e.x,n=e.y,o=e.w,a=e.h),d.length>0?t.lineCap="butt":t.lineCap="square",o=Math.max(o,1),a=Math.max(a,1),f=f.map((t=>Math.min(t,o/2,a/2))),t.setLineDash(d),t.lineWidth=c,t.beginPath(),t.moveTo(i+f[0],n),t.arcTo(i+o,n,i+o,n+a,f[1]),t.arcTo(i+o,n+a,i,n+a,f[2]),t.arcTo(i,n+a,i,n,f[3]),t.arcTo(i,n,i+o,n,f[0]),t.closePath(),t.stroke()}t.setLineDash([])}function Oe(t,e,i){const{detail:n}=e,{viewScaleInfo:o,renderContent:a}=i,{shadowColor:s,shadowOffsetX:r,shadowOffsetY:l,shadowBlur:h}=n;Yt.number(h)?(t.save(),t.shadowColor=s||Ie.shadowColor,t.shadowOffsetX=(r||0)*o.scale,t.shadowOffsetY=(l||0)*o.scale,t.shadowBlur=(h||0)*o.scale,a(),t.restore()):(t.save(),t.shadowColor="transparent",t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,a(),t.restore())}const Ee={boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,fontFamily:"sans-serif",fontWeight:400,minInlineSize:"auto",wordBreak:"break-all",overflow:"hidden"};var Ce=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i};const We=.4;function Ae(t,e,i){var n,o,a;if(!0===(null===(n=null==e?void 0:e.operations)||void 0===n?void 0:n.invisible))return;const{w:s,h:r}=e,{scale:l}=i.viewScaleInfo;if(l<1&&(s*l<We||r*l<We)||0===i.parentOpacity)return;const{overrideElementMap:h}=i;if(!(null===(a=null===(o=null==h?void 0:h[e.uuid])||void 0===o?void 0:o.operations)||void 0===a?void 0:a.invisible))try{switch(e.type){case"rect":!function(t,e,i){const{viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a}=i,{x:s,y:r,w:l,h:h,angle:c}=de(e,{viewScaleInfo:n})||e,f=Object.assign(Object.assign({},e),{x:s,y:r,w:l,h:h,angle:c});ee(t,{x:s,y:r,w:l,h:h,angle:c},(()=>{Oe(t,f,{viewScaleInfo:n,viewSizeInfo:o,renderContent:()=>{ke(t,f,{originElem:e,calcElemSize:{x:s,y:r,w:l,h:h,angle:c},viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a,renderContent:()=>{}})}})}))}(t,e,i);break;case"circle":!function(t,e,i){const{detail:n,angle:o}=e,{viewScaleInfo:a,viewSizeInfo:s,parentOpacity:r}=i,{background:l="#000000",borderColor:h="#000000",boxSizing:c,borderWidth:f=0,borderDash:d}=n;let u=0;"number"==typeof f&&f>0?u=f:Array.isArray(f)&&"number"==typeof f[0]&&f[0]>0&&(u=f[0]),u*=a.scale;const{x:v,y:w,w:g,h:p}=de({x:e.x,y:e.y,w:e.w,h:e.h},{viewScaleInfo:a})||e,y=Object.assign(Object.assign({},e),{x:v,y:w,w:g,h:p,angle:o});ee(t,{x:v,y:w,w:g,h:p,angle:o},(()=>{Oe(t,y,{viewScaleInfo:a,viewSizeInfo:s,renderContent:()=>{let e=g/2,i=p/2;const n=v+e,o=w+i,s=e,f=i;if(u>0&&("content-box"===c||("center-line"===c?(e-=u/2,i-=u/2):(e-=u,i-=u))),e>=0&&i>=0){const c=Me(y)*r;t.globalAlpha=c,t.beginPath();const m=Se(t,l,{viewElementSize:{x:v,y:w,w:g,h:p},viewScaleInfo:a,opacity:t.globalAlpha});if(t.fillStyle=m,t.circle(n,o,s,f,0,0,2*Math.PI),t.closePath(),t.fill(),t.globalAlpha=r,"number"==typeof u&&u>0){const s=u/2+e,r=u/2+i;if(t.beginPath(),d){const e=d.map((t=>t*a.scale));t.setLineDash(e)}t.strokeStyle=h,t.lineWidth=u,t.circle(n,o,s,r,0,0,2*Math.PI),t.closePath(),t.stroke(),t.setLineDash([])}}}})}))}(t,e,i);break;case"text":!function(t,e,i){const{viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a}=i,{x:s,y:r,w:l,h:h,angle:c}=de(e,{viewScaleInfo:n})||e,f=Object.assign(Object.assign({},e),{x:s,y:r,w:l,h:h,angle:c});ee(t,{x:s,y:r,w:l,h:h,angle:c},(()=>{Oe(t,f,{viewScaleInfo:n,viewSizeInfo:o,renderContent:()=>{ke(t,f,{originElem:e,calcElemSize:{x:s,y:r,w:l,h:h,angle:c},viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a})}});{const o=Object.assign(Object.assign({},Ee),e.detail),a=o.fontSize||Ee.fontSize,c=a*n.scale;if(c<2)return;const f=(o.lineHeight||a)*n.scale;t.fillStyle=e.detail.color||Ee.color,t.textBaseline="top",t.$setFont({fontWeight:o.fontWeight,fontSize:c,fontFamily:(i=o.fontFamily,[i,...xe].join(", "))});let d=o.text.replace(/\r\n/gi,"\n");"lowercase"===o.textTransform?d=d.toLowerCase():"uppercase"===o.textTransform&&(d=d.toUpperCase());const u=f,v=d.split("\n"),w=[];let g=0;v.forEach(((e,i)=>{if("maxContent"===o.minInlineSize)w.push({text:e,width:t.$undoPixelRatio(t.measureText(e).width)});else{let r="",c="",f=e.split(c);if("normal"===o.wordBreak){const t=" ",i=e.split(t);f=[],i.forEach(((e,n)=>{f.push(e),n<i.length-1&&f.push(t)}))}if(1===f.length&&"visible"===o.overflow)w.push({text:f[0],width:t.$undoPixelRatio(t.measureText(f[0]).width)});else if(f.length>0){for(let e=0;e<f.length&&(a=t.$doPixelRatio(l),s=t.measureText(r+f[e]).width,n.scale<.5&&a<s&&(a-s)/a>-.15||a>=s?r+=f[e]||"":(w.push({text:r,width:t.$undoPixelRatio(t.measureText(r).width)}),r=f[e]||"",g++),!((g+1)*u>h&&"hidden"===o.overflow));e++)if(f.length-1===e&&(g+1)*u<=h){w.push({text:r,width:t.$undoPixelRatio(t.measureText(r).width)}),i<v.length-1&&g++;break}}else w.push({text:"",width:0})}var a,s}));let p=0,y=0;u>c&&(y=(u-c)/2),w.length*u<h&&("top"===e.detail.verticalAlign?p=0:"bottom"===e.detail.verticalAlign?p+=h-w.length*u:p+=(h-w.length*u)/2);{const e=r+p;void 0!==o.textShadowColor&&kt(o.textShadowColor)&&(t.shadowColor=o.textShadowColor),void 0!==o.textShadowOffsetX&&Yt.number(o.textShadowOffsetX)&&(t.shadowOffsetX=o.textShadowOffsetX),void 0!==o.textShadowOffsetY&&Yt.number(o.textShadowOffsetY)&&(t.shadowOffsetY=o.textShadowOffsetY),void 0!==o.textShadowBlur&&Yt.number(o.textShadowBlur)&&(t.shadowBlur=o.textShadowBlur),w.forEach(((i,n)=>{let a=s;"center"===o.textAlign?a=s+(l-i.width)/2:"right"===o.textAlign&&(a=s+(l-i.width)),t.fillText(i.text,a,e+u*n+y)}))}}var i}))}(t,e,i);break;case"image":!function(t,e,i){const n=i.loader.getContent(e),{viewScaleInfo:o,viewSizeInfo:a,parentOpacity:s}=i,{x:r,y:l,w:h,h:c,angle:f}=de(e,{viewScaleInfo:o})||e,d=Object.assign(Object.assign({},e),{x:r,y:l,w:h,h:c,angle:f});ee(t,{x:r,y:l,w:h,h:c,angle:f},(()=>{Oe(t,d,{viewScaleInfo:o,viewSizeInfo:a,renderContent:()=>{ke(t,d,{originElem:e,calcElemSize:{x:r,y:l,w:h,h:c,angle:f},viewScaleInfo:o,viewSizeInfo:a,parentOpacity:s,renderContent:()=>{if(n||i.loader.isDestroyed()||i.loader.load(e,i.elementAssets||{}),"image"===e.type&&n){t.globalAlpha=Me(e)*s;const{x:i,y:r,w:l,h:h,radiusList:c}=be(d,{viewScaleInfo:o,viewSizeInfo:a}),{detail:f}=e,{scaleMode:u,originW:v=0,originH:w=0}=f,g=t.$undoPixelRatio(v),p=t.$undoPixelRatio(w);if(t.save(),t.fillStyle="transparent",t.beginPath(),t.moveTo(i+c[0],r),t.arcTo(i+l,r,i+l,r+h,c[1]),t.arcTo(i+l,r+h,i,r+h,c[2]),t.arcTo(i,r+h,i,r,c[3]),t.arcTo(i,r,i+l,r,c[0]),t.closePath(),t.fill(),t.clip(),u&&w&&v){let o=0,a=0,s=g,c=p;const f=i,d=r,v=l,w=h;if(g>e.w||p>e.h)if("fill"===u){const t=Math.max(e.w/g,e.h/p),i=p*t;o=(g*t-e.w)/2/t,a=(i-e.h)/2/t,s=e.w/t,c=e.h/t}else if("tile"===u)o=0,a=0,s=e.w,c=e.h;else if("fit"===u){const t=Math.min(e.w/g,e.h/p);o=(g-e.w/t)/2,a=(p-e.h/t)/2,s=e.w/t,c=e.h/t}t.drawImage(n,o,a,s,c,f,d,v,w)}else t.drawImage(n,i,r,l,h);t.globalAlpha=s,t.restore()}}})}})}))}(t,e,i);break;case"svg":!function(t,e,i){const n=i.loader.getContent(e),{viewScaleInfo:o,viewSizeInfo:a,parentOpacity:s}=i,{x:r,y:l,w:h,h:c,angle:f}=de(e,{viewScaleInfo:o,viewSizeInfo:a})||e;ee(t,{x:r,y:l,w:h,h:c,angle:f},(()=>{n||i.loader.isDestroyed()||i.loader.load(e,i.elementAssets||{}),"svg"===e.type&&n&&(t.globalAlpha=Me(e)*s,t.drawImage(n,r,l,h,c),t.globalAlpha=s)}))}(t,e,i);break;case"html":!function(t,e,i){const n=i.loader.getContent(e),{viewScaleInfo:o,viewSizeInfo:a,parentOpacity:s}=i,{x:r,y:l,w:h,h:c,angle:f}=de(e,{viewScaleInfo:o,viewSizeInfo:a})||e;ee(t,{x:r,y:l,w:h,h:c,angle:f},(()=>{n||i.loader.isDestroyed()||i.loader.load(e,i.elementAssets||{}),"html"===e.type&&n&&(t.globalAlpha=Me(e)*s,t.drawImage(n,r,l,h,c),t.globalAlpha=s)}))}(t,e,i);break;case"path":!function(t,e,i){var n,o;const{detail:a}=e,{originX:s,originY:r,originW:l,originH:h,fillRule:c}=a,{viewScaleInfo:f,viewSizeInfo:d,parentOpacity:u}=i,{x:v,y:w,w:g,h:p,angle:y}=de(e,{viewScaleInfo:f})||e,m=g/l,b=p/h,x=v-s*m,S=w-r*b,I=e.detail,M=Ce(I,["clipPath","clipPathStrokeColor","clipPathStrokeWidth"]),k=f.scale*d.devicePixelRatio,z=Object.assign(Object.assign({},e),{x:v,y:w,w:g,h:p,angle:y});let P=Object.assign({},z);P.detail=M;let O=Object.assign({},e);O.detail=M,a.fill&&"string"!==a.fill&&(null===(o=null===(n=a.fill)||void 0===n?void 0:n.type)||void 0===o?void 0:o.includes("gradient"))&&(P=Object.assign(Object.assign({},z),{detail:Object.assign(Object.assign({},z.detail),{background:a.fill,clipPath:{commands:a.commands,originX:s,originY:r,originW:l,originH:h}})}),O.detail=Object.assign({},P.detail)),ee(t,{x:v,y:w,w:g,h:p,angle:y},(()=>{ke(t,P,{originElem:O,calcElemSize:{x:v,y:w,w:g,h:p,angle:y},viewScaleInfo:f,viewSizeInfo:d,parentOpacity:u,renderContent:()=>{Oe(t,z,{viewScaleInfo:f,viewSizeInfo:d,renderContent:()=>{t.save(),t.translate(x,S),t.scale(k*m/f.scale,k*b/f.scale);const e=ye(a.commands||[]),i=new Path2D(e);a.fill&&("string"==typeof a.fill?t.fillStyle=a.fill:t.fillStyle="transparent"),a.fill&&t.fill(i,c),a.stroke&&0!==a.strokeWidth&&(t.strokeStyle=a.stroke,t.lineWidth=(a.strokeWidth||1)/d.devicePixelRatio,t.lineCap=a.strokeLineCap||"square",t.stroke(i)),t.translate(-x,-S),t.restore()}})}})}))}(t,e,i);break;case"group":{const n=Object.assign(Object.assign({},i.elementAssets||{}),e.detail.assets||{});!function(t,e,i){const{viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a}=i,{x:s,y:r,w:l,h:h,angle:c}=de({x:e.x,y:e.y,w:e.w,h:e.h,angle:e.angle},{viewScaleInfo:n})||e,f=Object.assign(Object.assign({},e),{x:s,y:r,w:l,h:h,angle:c});ee(t,{x:s,y:r,w:l,h:h,angle:c},(()=>{t.globalAlpha=Me(e)*a,Oe(t,f,{viewScaleInfo:n,viewSizeInfo:o,renderContent:()=>{ke(t,f,{originElem:e,calcElemSize:{x:s,y:r,w:l,h:h,angle:c},viewScaleInfo:n,viewSizeInfo:o,parentOpacity:a,renderContent:()=>{const{x:s,y:r,w:l,h:h,radiusList:c}=be(f,{viewScaleInfo:n,viewSizeInfo:o});if("hidden"===e.detail.overflow&&(t.save(),t.fillStyle="transparent",t.beginPath(),t.moveTo(s+c[0],r),t.arcTo(s+l,r,s+l,r+h,c[1]),t.arcTo(s+l,r+h,s,r+h,c[2]),t.arcTo(s,r+h,s,r,c[3]),t.arcTo(s,r,s+l,r,c[0]),t.closePath(),t.fill(),t.clip()),Array.isArray(e.detail.children)){const{parentElementSize:n}=i,o={x:n.x+e.x,y:n.y+e.y,w:e.w||n.w,h:e.h||n.h,angle:e.angle},{calculator:s}=i;for(let n=0;n<e.detail.children.length;n++){let r=e.detail.children[n];if(r=Object.assign(Object.assign({},r),{x:o.x+r.x,y:o.y+r.y}),!0===i.forceDrawAll||(null==s?void 0:s.needRender(r)))try{Ae(t,r,Object.assign(Object.assign({},i),{parentOpacity:a*Me(e)}))}catch(t){console.error(t)}}}"hidden"===e.detail.overflow&&t.restore()}})}}),t.globalAlpha=a}))}(t,e,Object.assign(Object.assign({},i),{elementAssets:n}));break}}}catch(t){console.error(t)}}const Re={boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,fontFamily:"sans-serif",fontWeight:400,minInlineSize:"auto",wordBreak:"break-all",overflow:"hidden"};function Te(t,e,i){var n;const{elements:o=[]}=e,{parentOpacity:a}=i;for(let e=0;e<o.length;e++){const s=o[e],r=Object.assign(Object.assign({},s),{detail:Object.assign(Object.assign({},Re),null==s?void 0:s.detail)});if(!0===i.forceDrawAll||(null===(n=i.calculator)||void 0===n?void 0:n.needRender(r)))try{Ae(t,r,Object.assign(Object.assign({},i),{parentOpacity:a}))}catch(t){console.error(t)}}}var Le,Ve,je,De,$e,Be,Xe,Ye,He,Fe,Ue,Ne,Ge=function(t,e,i,n){return new(i||(i=Promise))((function(o,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function r(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,r)}l((n=n.apply(t,e||[])).next())}))},Qe=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)},qe=function(t,e,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,i):o?o.value=i:e.set(t,i),i};const Ke=["image","svg","html"],Je=t=>{var e,i,n;let o=null;return"image"===t.type?o=(null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.src)||null:"svg"===t.type?o=(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.svg)||null:"html"===t.type&&(o=(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.html)||null),"string"==typeof o&&o?/^@assets\/[0-9a-z]{8,8}\-[0-9a-z]{4,4}\-[0-9a-z]{4,4}\-[0-9a-z]{4,4}\-[0-9a-z]{12,12}$/.test(`${o}`)?o:Et(o):Et(`${Pt()}-${t.uuid}-${Pt()}-${Pt()}`)};class Ze extends Ut{constructor(){super(),Le.add(this),Ve.set(this,{}),je.set(this,{}),De.set(this,{}),$e.set(this,!1),Qe(this,Le,"m",Be).call(this,"image",((t,e)=>Ge(this,void 0,void 0,(function*(){var i;const n=(null===(i=e[t.detail.src])||void 0===i?void 0:i.value)||t.detail.src,o=yield Lt(n);return{uuid:t.uuid,lastModified:Date.now(),content:o}})))),Qe(this,Le,"m",Be).call(this,"html",((t,e)=>Ge(this,void 0,void 0,(function*(){var i;const n=(null===(i=e[t.detail.html])||void 0===i?void 0:i.value)||t.detail.html,o=yield jt(n,{width:t.detail.originW||t.w,height:t.detail.originH||t.h});return{uuid:t.uuid,lastModified:Date.now(),content:o}})))),Qe(this,Le,"m",Be).call(this,"svg",((t,e)=>Ge(this,void 0,void 0,(function*(){var i;const n=(null===(i=e[t.detail.svg])||void 0===i?void 0:i.value)||t.detail.svg,o=yield Vt(n);return{uuid:t.uuid,lastModified:Date.now(),content:o}}))))}isDestroyed(){return Qe(this,$e,"f")}destroy(){qe(this,$e,!0,"f"),this.clear(),qe(this,Ve,null,"f"),qe(this,je,null,"f"),qe(this,De,null,"f")}load(t,e){!0!==Qe(this,$e,"f")&&(Qe(this,Le,"m",Ne).call(this,t)||Ke.includes(t.type)&&Qe(this,Le,"m",Ue).call(this,t,e))}getContent(t){var e,i;const n=Je(t);return(null===(i=null===(e=Qe(this,De,"f"))||void 0===e?void 0:e[n])||void 0===i?void 0:i.content)||null}getLoadItemMap(){return Qe(this,De,"f")}setLoadItemMap(t){qe(this,De,t,"f")}}Ve=new WeakMap,je=new WeakMap,De=new WeakMap,$e=new WeakMap,Le=new WeakSet,Be=function(t,e){Qe(this,Ve,"f")[t]=e},Xe=function(t){var e,i,n;let o=null;return"image"===t.type?o=(null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.src)||null:"svg"===t.type?o=(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.svg)||null:"html"===t.type&&(o=(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.html)||null),o},Ye=function(t){return{element:t,status:"null",content:null,error:null,startTime:-1,endTime:-1,source:Qe(this,Le,"m",Xe).call(this,t)}},He=function(t){const e=Je(t.element),i=Qe(this,De,"f")[e];Qe(this,$e,"f")||(i?i.startTime<t.startTime&&(Qe(this,De,"f")[e]=t,this.trigger("load",Object.assign(Object.assign({},t),{countTime:t.endTime-t.startTime}))):(Qe(this,De,"f")[e]=t,this.trigger("load",Object.assign(Object.assign({},t),{countTime:t.endTime-t.startTime}))))},Fe=function(t){var e;const i=Je(t.element),n=null===(e=Qe(this,De,"f"))||void 0===e?void 0:e[i];Qe(this,$e,"f")||(n?n.startTime<t.startTime&&(Qe(this,De,"f")[i]=t,this.trigger("error",Object.assign(Object.assign({},t),{countTime:t.endTime-t.startTime}))):(Qe(this,De,"f")[i]=t,this.trigger("error",Object.assign(Object.assign({},t),{countTime:t.endTime-t.startTime}))))},Ue=function(t,e){const i=Qe(this,Le,"m",Ye).call(this,t),n=Je(t);if(Qe(this,je,"f")[n])return;Qe(this,je,"f")[n]=i;const o=Qe(this,Ve,"f")[t.type];"function"!=typeof o||Qe(this,$e,"f")||(i.startTime=Date.now(),o(t,e).then((t=>{Qe(this,$e,"f")||(i.content=t.content,i.endTime=Date.now(),i.status="load",Qe(this,Le,"m",He).call(this,i))})).catch((e=>{console.warn(`Load element source "${i.source}" fail`,e,t),i.endTime=Date.now(),i.status="error",i.error=e,Qe(this,Le,"m",Fe).call(this,i)})))},Ne=function(t){var e;const i=Je(t),n=null===(e=Qe(this,je,"f"))||void 0===e?void 0:e[i];return!(!n||"error"!==n.status||!n.source||n.source!==Qe(this,Le,"m",Xe).call(this,t))};var _e,ti,ei,ii,ni,oi=function(t,e,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,i):o?o.value=i:e.set(t,i),i},ai=function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)};class si extends Ut{constructor(t){super(),_e.add(this),ti.set(this,void 0),ei.set(this,new Ze),ii.set(this,!1),oi(this,ti,t,"f"),ai(this,_e,"m",ni).call(this)}isDestroyed(){return ai(this,ii,"f")}destroy(){this.clear(),oi(this,ti,null,"f"),ai(this,ei,"f").destroy(),oi(this,ei,null,"f"),oi(this,ii,!0,"f")}updateOptions(t){oi(this,ti,t,"f")}drawData(t,e){const i=ai(this,ei,"f"),{calculator:n,sharer:o}=ai(this,ti,"f"),a=ai(this,ti,"f").viewContext;a.clearRect(0,0,a.canvas.width,a.canvas.height);const s={x:0,y:0,w:e.viewSizeInfo.width,h:e.viewSizeInfo.height},r=Object.assign({loader:i,calculator:n,parentElementSize:s,elementAssets:t.assets,parentOpacity:1,overrideElementMap:null==o?void 0:o.getActiveOverrideElemenentMap()},e);!function(t,e,i){if("string"==typeof(null==e?void 0:e.background)){const{viewSizeInfo:n}=i,{width:o,height:a}=n;t.globalAlpha=1,t.fillStyle=e.background,t.fillRect(0,0,o,a)}}(a,t.global,r),t.layout?function(t,e,i,n){const{viewScaleInfo:o,viewSizeInfo:a,parentOpacity:s}=i,r=Object.assign({uuid:"layout",type:"group"},e),{x:l,y:h,w:c,h:f}=de(r,{viewScaleInfo:o})||r,d=Object.assign(Object.assign({},r),{x:l,y:h,w:c,h:f,angle:0});if(t.globalAlpha=1,Oe(t,d,{viewScaleInfo:o,viewSizeInfo:a,renderContent:()=>{ze(t,d,{viewScaleInfo:o,viewSizeInfo:a})}}),"hidden"===e.detail.overflow){const{viewScaleInfo:n,viewSizeInfo:o}=i,a=Object.assign({uuid:"layout",type:"group"},e),s=de(a,{viewScaleInfo:n})||a,r=Object.assign(Object.assign({},a),s),{x:l,y:h,w:c,h:f,radiusList:d}=be(r,{viewScaleInfo:n,viewSizeInfo:o});t.save(),t.fillStyle="transparent",t.beginPath(),t.moveTo(l+d[0],h),t.arcTo(l+c,h,l+c,h+f,d[1]),t.arcTo(l+c,h+f,l,h+f,d[2]),t.arcTo(l,h+f,l,h,d[3]),t.arcTo(l,h,l+c,h,d[0]),t.closePath(),t.fill(),t.clip()}n(t),"hidden"===e.detail.overflow&&t.restore(),Pe(t,d,{viewScaleInfo:o,viewSizeInfo:a}),t.globalAlpha=s}(a,t.layout,r,(()=>{Te(a,t,r)})):Te(a,t,r)}scale(t){const{sharer:e}=ai(this,ti,"f");if(!e)return;const{data:i,offsetTop:n,offsetBottom:o,offsetLeft:a,offsetRight:s,width:r,height:l,contextHeight:h,contextWidth:c,devicePixelRatio:f}=e.getActiveStoreSnapshot();i&&this.drawData(i,{viewScaleInfo:{scale:t,offsetTop:n,offsetBottom:o,offsetLeft:a,offsetRight:s},viewSizeInfo:{width:r,height:l,contextHeight:h,contextWidth:c,devicePixelRatio:f}})}setLoadItemMap(t){ai(this,ei,"f").setLoadItemMap(t)}getLoadItemMap(){return ai(this,ei,"f").getLoadItemMap()}getLoader(){return ai(this,ei,"f")}}ti=new WeakMap,ei=new WeakMap,ii=new WeakMap,_e=new WeakSet,ni=function(){const t=ai(this,ei,"f");t.on("load",(t=>{this.trigger("load",t)})),t.on("error",(t=>{console.error(t)}))};class ri{constructor(t){St(this,e,void 0),St(this,i,void 0),It(this,e,t),It(this,i,new _t({defaultStorage:{viewVisibleInfoMap:{},visibleCount:0,invisibleCount:0}}))}toGridNum(t,e){return!0===(null==e?void 0:e.ignore)?t:Math.round(t)}destroy(){It(this,e,null)}needRender(t){const e=xt(this,i).get("viewVisibleInfoMap")[t.uuid];return!e||e.isVisibleInView}isPointInElement(t,i,n,o){return ve(t,{context2d:xt(this,e).viewContext,element:i,viewScaleInfo:n,viewSizeInfo:o})}getPointElement(t,i){return function(t,e){var i,n,o;const{context2d:a,data:s,viewScaleInfo:r,viewSizeInfo:l,groupQueue:h}=e,c={index:-1,element:null,groupQueueIndex:-1};if(h&&Array.isArray(h)&&(null==h?void 0:h.length)>0)for(let e=h.length-1;e>=0;e--){let o=0,s=0,f=0;for(let t=0;t<=e;t++)o+=h[t].x,s+=h[t].y,f+=h[t].angle||0;const d=h[e];if(d&&"group"===d.type&&Array.isArray(null===(i=d.detail)||void 0===i?void 0:i.children))for(let i=0;i<d.detail.children.length;i++){const u=d.detail.children[i];if(!0!==(null===(n=null==u?void 0:u.operations)||void 0===n?void 0:n.invisible)){if(!u)break;if(ve(t,{context2d:a,element:{x:o+u.x,y:s+u.y,w:u.w,h:u.h,angle:f+(u.angle||0)},viewScaleInfo:r,viewSizeInfo:l})){c.element=u,(e<h.length-1||"group"!==u.type)&&(c.groupQueueIndex=e);break}}}if(c.element)break}if(c.element)return c;for(let e=s.elements.length-1;e>=0;e--){const i=s.elements[e];if(!0!==(null===(o=null==i?void 0:i.operations)||void 0===o?void 0:o.invisible)&&ve(t,{context2d:a,element:i,viewScaleInfo:r,viewSizeInfo:l})){c.index=e,c.element=i;break}}return c}(t,{...i,context2d:xt(this,e).viewContext})}resetViewVisibleInfoMap(t,e){if(t){const{viewVisibleInfoMap:n,invisibleCount:o,visibleCount:a}=function(t,e){const i={},n=[],o=e=>{const a={isVisibleInView:!0,isGroup:"group"===e.type,position:[...n]};let s=null;s=we(e,{groupQueue:le(t,n)||[]}),i[e.uuid]=Object.assign(Object.assign({},a),{originRectInfo:s,rangeRectInfo:Yt.angle(e.angle)?ge(s):s}),"group"===e.type&&e.detail.children.forEach(((t,e)=>{n.push(e),o(t),n.pop()}))};return t.forEach(((t,e)=>{n.push(e),o(t),n.pop()})),pe(i,e)}(t.elements,e);xt(this,i).set("viewVisibleInfoMap",n),xt(this,i).set("invisibleCount",o),xt(this,i).set("visibleCount",a)}}updateVisiableStatus(t){const{viewVisibleInfoMap:e,invisibleCount:n,visibleCount:o}=pe(xt(this,i).get("viewVisibleInfoMap"),t);xt(this,i).set("viewVisibleInfoMap",e),xt(this,i).set("invisibleCount",n),xt(this,i).set("visibleCount",o)}calcViewRectInfoFromOrigin(t,e){const n=xt(this,i).get("viewVisibleInfoMap")[t];if(!(null==n?void 0:n.originRectInfo))return null;const{checkVisible:o,viewScaleInfo:a,viewSizeInfo:s}=e,{center:r,left:l,right:h,bottom:c,top:f,topLeft:d,topRight:u,bottomLeft:v,bottomRight:w}=n.originRectInfo;if(!0===o&&!1===n.isVisibleInView)return null;const g={viewScaleInfo:a,viewSizeInfo:s};return{center:ue(r,g),left:ue(l,g),right:ue(h,g),bottom:ue(c,g),top:ue(f,g),topLeft:ue(d,g),topRight:ue(u,g),bottomLeft:ue(v,g),bottomRight:ue(w,g)}}calcViewRectInfoFromRange(t,e){const n=xt(this,i).get("viewVisibleInfoMap")[t];if(!(null==n?void 0:n.originRectInfo))return null;const{checkVisible:o,viewScaleInfo:a,viewSizeInfo:s}=e,{center:r,left:l,right:h,bottom:c,top:f,topLeft:d,topRight:u,bottomLeft:v,bottomRight:w}=n.rangeRectInfo;if(!0===o&&!1===n.isVisibleInView)return null;const g={viewScaleInfo:a,viewSizeInfo:s};return{center:ue(r,g),left:ue(l,g),right:ue(h,g),bottom:ue(c,g),top:ue(f,g),topLeft:ue(d,g),topRight:ue(u,g),bottomLeft:ue(v,g),bottomRight:ue(w,g)}}modifyViewVisibleInfoMap(t,e){const{modifyOptions:n,viewScaleInfo:o,viewSizeInfo:a}=e,{type:s,content:r}=n,l=t.elements,h=xt(this,i).get("viewVisibleInfoMap");if("deleteElement"===s){const{element:t}=r,e=[],n=t=>{e.push(t.uuid),"group"===t.type&&Array.isArray(t.detail.children)&&t.detail.children.forEach((t=>{n(t)}))};n(t),e.forEach((t=>{delete h[t]})),xt(this,i).set("viewVisibleInfoMap",h)}else if("addElement"===s||"updateElement"===s){const{position:e}=r,n=function(t,e){let i=null,n=e;for(let e=0;e<t.length;e++){const o=n[t[e]];if(e<t.length-1&&"group"===o.type)n=o.detail.children;else{if(e!==t.length-1)break;i=o}}return i}(e,t.elements),c=le(l,e);if(n)if("updateElement"===s&&"group"===n.type)this.resetViewVisibleInfoMap(t,{viewScaleInfo:o,viewSizeInfo:a});else{const t=we(n,{groupQueue:c||[]}),r={originRectInfo:t,rangeRectInfo:Yt.angle(n.angle)?ge(t):t,isVisibleInView:!0,isGroup:"group"===(null==n?void 0:n.type),position:[...e]};h[n.uuid]=r,xt(this,i).set("viewVisibleInfoMap",h),"updateElement"===s&&this.updateVisiableStatus({viewScaleInfo:o,viewSizeInfo:a})}}else"moveElement"===s&&this.resetViewVisibleInfoMap(t,{viewScaleInfo:o,viewSizeInfo:a})}}function li(t){return t>0||t<0||0===t}e=new WeakMap,i=new WeakMap;class hi extends Ut{constructor(t){super(),St(this,s),St(this,g),St(this,y),St(this,b),St(this,n,void 0),St(this,o,void 0),St(this,a,!1),St(this,l,(t=>{if(!Mt(this,g,p).call(this,t))return;const e=Mt(this,y,m).call(this,t);if(!Mt(this,b,x).call(this,e))return;t.preventDefault(),t.stopPropagation();const i=t.deltaX>0||t.deltaX<0?t.deltaX:0,n=t.deltaY>0||t.deltaY<0?t.deltaY:0;!0===t.ctrlKey&&this.has("wheelScale")?this.trigger("wheelScale",{deltaX:i,deltaY:n,point:e}):this.has("wheel")&&this.trigger("wheel",{deltaX:i,deltaY:n,point:e})})),St(this,h,(t=>{if(2!==t.button)return;if(!Mt(this,g,p).call(this,t))return;t.preventDefault();const e=Mt(this,y,m).call(this,t);Mt(this,b,x).call(this,e)&&this.trigger("contextMenu",{point:e})})),St(this,c,(t=>{if(!Mt(this,g,p).call(this,t))return;t.preventDefault();const e=Mt(this,y,m).call(this,t);if(!Mt(this,b,x).call(this,e))return;const i=Date.now(),n=xt(this,o).get("prevClickPoint");n&&i-n.t<=500&&Math.abs(n.x-e.x)<=5&&Math.abs(n.y-e.y)<=5?this.trigger("doubleClick",{point:e}):xt(this,o).set("prevClickPoint",e)})),St(this,f,(t=>{if(xt(this,o).set("hasPointDown",!1),!Mt(this,g,p).call(this,t))return;t.preventDefault();const e=Mt(this,y,m).call(this,t);this.trigger("pointLeave",{point:e})})),St(this,d,(t=>{if(xt(this,o).set("hasPointDown",!1),!Mt(this,g,p).call(this,t))return;t.preventDefault();const e=Mt(this,y,m).call(this,t);this.trigger("pointEnd",{point:e})})),St(this,u,(t=>{if(!Mt(this,g,p).call(this,t))return;t.preventDefault(),t.stopPropagation();const e=Mt(this,y,m).call(this,t);Mt(this,b,x).call(this,e)?!0===xt(this,o).get("hasPointDown")&&this.trigger("pointMove",{point:e}):xt(this,o).get("hasPointDown")&&(this.trigger("pointLeave",{point:e}),xt(this,o).set("hasPointDown",!1))})),St(this,v,(t=>{if(0!==t.button)return;if(!Mt(this,g,p).call(this,t))return;t.preventDefault();const e=Mt(this,y,m).call(this,t);Mt(this,b,x).call(this,e)&&(xt(this,o).set("hasPointDown",!0),this.trigger("pointStart",{point:e}))})),St(this,w,(t=>{if(!Mt(this,g,p).call(this,t))return;t.preventDefault();const e=Mt(this,y,m).call(this,t);Mt(this,b,x).call(this,e)&&this.trigger("hover",{point:e})}));const e=new _t({defaultStorage:{hasPointDown:!1,prevClickPoint:null}});It(this,o,e),It(this,n,t),Mt(this,s,r).call(this)}onEvents(){if(xt(this,a))return;const t=window;t.addEventListener("mousemove",xt(this,w)),t.addEventListener("mousedown",xt(this,v)),t.addEventListener("mousemove",xt(this,u)),t.addEventListener("mouseup",xt(this,d)),t.addEventListener("mouseleave",xt(this,f)),t.addEventListener("wheel",xt(this,l),{passive:!1}),t.addEventListener("click",xt(this,c)),t.addEventListener("contextmenu",xt(this,h))}offEvents(){const t=window;t.removeEventListener("mousemove",xt(this,w)),t.removeEventListener("mousedown",xt(this,v)),t.removeEventListener("mousemove",xt(this,u)),t.removeEventListener("mouseup",xt(this,d)),t.removeEventListener("mouseleave",xt(this,f)),t.removeEventListener("wheel",xt(this,l)),t.removeEventListener("click",xt(this,c)),t.removeEventListener("contextmenu",xt(this,h))}destroy(){this.offEvents(),xt(this,o).destroy(),It(this,a,!0)}}n=new WeakMap,o=new WeakMap,a=new WeakMap,s=new WeakSet,r=function(){this.onEvents()},l=new WeakMap,h=new WeakMap,c=new WeakMap,f=new WeakMap,d=new WeakMap,u=new WeakMap,v=new WeakMap,w=new WeakMap,g=new WeakSet,p=function(t){return t.target===xt(this,n).boardContent.boardContext.canvas},y=new WeakSet,m=function(t){const e=xt(this,n).boardContent.boardContext.canvas.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top,t:Date.now()}},b=new WeakSet,x=function(t){const e=xt(this,n).sharer.getActiveViewSizeInfo(),{width:i,height:o}=e;return!!(li(t.x)&&li(t.y)&&t.x<=i&&t.y<=o)};const ci={width:0,height:0,devicePixelRatio:1,contextWidth:0,contextHeight:0,data:null,scale:1,offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0,overrideElementMap:null};class fi{constructor(){St(this,S,void 0),St(this,I,void 0);const t=new _t({defaultStorage:ci}),e=new _t({defaultStorage:{}});It(this,S,t),It(this,I,e)}getActiveStorage(t){return xt(this,S).get(t)}setActiveStorage(t,e){return xt(this,S).set(t,e)}getActiveStoreSnapshot(t){return xt(this,S).getSnapshot(t)}getSharedStorage(t){return xt(this,I).get(t)}setSharedStorage(t,e){return xt(this,I).set(t,e)}getSharedStoreSnapshot(t){return xt(this,I).getSnapshot(t)}getActiveViewScaleInfo(){return{scale:xt(this,S).get("scale"),offsetTop:xt(this,S).get("offsetTop"),offsetBottom:xt(this,S).get("offsetBottom"),offsetLeft:xt(this,S).get("offsetLeft"),offsetRight:xt(this,S).get("offsetRight")}}setActiveViewScaleInfo(t){const{scale:e,offsetTop:i,offsetBottom:n,offsetLeft:o,offsetRight:a}=t;xt(this,S).set("scale",e),xt(this,S).set("offsetTop",i),xt(this,S).set("offsetBottom",n),xt(this,S).set("offsetLeft",o),xt(this,S).set("offsetRight",a)}setActiveViewSizeInfo(t){xt(this,S).set("width",t.width),xt(this,S).set("height",t.height),xt(this,S).set("devicePixelRatio",t.devicePixelRatio),xt(this,S).set("contextWidth",t.contextWidth),xt(this,S).set("contextHeight",t.contextHeight)}getActiveViewSizeInfo(){return{width:xt(this,S).get("width"),height:xt(this,S).get("height"),devicePixelRatio:xt(this,S).get("devicePixelRatio"),contextWidth:xt(this,S).get("contextWidth"),contextHeight:xt(this,S).get("contextHeight")}}getActiveOverrideElemenentMap(){return xt(this,S).get("overrideElementMap")}setActiveOverrideElemenentMap(t){xt(this,S).set("overrideElementMap",t)}}S=new WeakMap,I=new WeakMap;const{requestAnimationFrame:di}=window;class ui extends Ut{constructor(t){super(),St(this,P),St(this,E),St(this,M,void 0),St(this,k,[]),St(this,z,"FREE"),It(this,M,t),Mt(this,P,O).call(this)}resetViewVisibleInfoMap(t,e){t&&xt(this,M).calculator.resetViewVisibleInfoMap(t,e)}drawFrame(){const{sharer:t}=xt(this,M),e=t.getActiveStoreSnapshot(),i=t.getSharedStoreSnapshot();xt(this,k).push({activeStore:e,sharedStore:i}),Mt(this,E,C).call(this)}scale(t){const{scale:e,point:i,ignoreUpdateVisibleStatus:n}=t,{sharer:o}=xt(this,M),{moveX:a,moveY:s}=function(t){const{scale:e,point:i,viewScaleInfo:n}=t,{offsetLeft:o,offsetTop:a}=n,s=e/n.scale,r=i.x,l=i.y;return{moveX:r-r*s+(o*s-o),moveY:l-l*s+(a*s-a)}}({scale:e,point:i,viewScaleInfo:o.getActiveViewScaleInfo(),viewSizeInfo:o.getActiveViewSizeInfo()});return o.setActiveStorage("scale",e),n||xt(this,M).calculator.updateVisiableStatus({viewScaleInfo:o.getActiveViewScaleInfo(),viewSizeInfo:o.getActiveViewSizeInfo()}),{moveX:a,moveY:s}}scroll(t){const{sharer:e}=xt(this,M),i=e.getActiveViewScaleInfo(),{moveX:n,moveY:o,ignoreUpdateVisibleStatus:a}=t,s=function(t){const{moveX:e=0,moveY:i=0,viewScaleInfo:n,viewSizeInfo:o}=t,{scale:a}=n,{width:s,height:r,contextWidth:l,contextHeight:h}=o;let c=n.offsetLeft,f=n.offsetRight,d=n.offsetTop,u=n.offsetBottom;return c+=e,d+=i,f=s-(l*a+c),u=r-(h*a+d),{scale:a,offsetTop:d,offsetLeft:c,offsetRight:f,offsetBottom:u}}({moveX:n,moveY:o,viewScaleInfo:i,viewSizeInfo:e.getActiveViewSizeInfo()});return e.setActiveViewScaleInfo(s),a||xt(this,M).calculator.updateVisiableStatus({viewScaleInfo:e.getActiveViewScaleInfo(),viewSizeInfo:e.getActiveViewSizeInfo()}),s}updateViewScaleInfo(t){const{sharer:e}=xt(this,M),i=function(t,e){const{scale:i,offsetX:n,offsetY:o}=t,{viewSizeInfo:a}=e,{width:s,height:r,contextWidth:l,contextHeight:h}=a,c=0-n*i,f=0-o*i;return{scale:i,offsetLeft:c,offsetTop:f,offsetRight:s-(l*i+c/i),offsetBottom:r-(h*i+f/i)}}(t,{viewSizeInfo:e.getActiveViewSizeInfo()});return e.setActiveViewScaleInfo(i),xt(this,M).calculator.updateVisiableStatus({viewScaleInfo:e.getActiveViewScaleInfo(),viewSizeInfo:e.getActiveViewSizeInfo()}),i}resize(t={},e){const{sharer:i}=xt(this,M),n={...i.getActiveViewSizeInfo(),...t},{width:o,height:a,devicePixelRatio:s}=n,{underlayContext:r,boardContext:l,overlayContext:h,viewContext:c}=xt(this,M).boardContent;return l.canvas.width=o*s,l.canvas.height=a*s,l.canvas.style.width=`${o}px`,l.canvas.style.height=`${a}px`,r.canvas.width=o*s,r.canvas.height=a*s,h.canvas.width=o*s,h.canvas.height=a*s,c.canvas.width=o*s,c.canvas.height=a*s,i.setActiveViewSizeInfo(n),(null==e?void 0:e.ignoreUpdateVisibleStatus)||xt(this,M).calculator.updateVisiableStatus({viewScaleInfo:i.getActiveViewScaleInfo(),viewSizeInfo:i.getActiveViewSizeInfo()}),n}}M=new WeakMap,k=new WeakMap,z=new WeakMap,P=new WeakSet,O=function(){const{renderer:t}=xt(this,M);t.on("load",(()=>{this.drawFrame()}))},E=new WeakSet,C=function(){if("DRAWING"===xt(this,z)||0===xt(this,k).length)return;It(this,z,"DRAWING");const t=xt(this,k).shift(),{renderer:e,boardContent:i,beforeDrawFrame:n,afterDrawFrame:o}=xt(this,M);if(t){const{scale:a,offsetTop:s,offsetBottom:r,offsetLeft:l,offsetRight:h,width:c,height:f,contextHeight:d,contextWidth:u,devicePixelRatio:v}=t.activeStore,w={scale:a,offsetTop:s,offsetBottom:r,offsetLeft:l,offsetRight:h},g={width:c,height:f,contextHeight:d,contextWidth:u,devicePixelRatio:v};(null==t?void 0:t.activeStore.data)&&e.drawData(t.activeStore.data,{viewScaleInfo:w,viewSizeInfo:g}),n({snapshot:t}),i.drawView(),o({snapshot:t})}0!==xt(this,k).length?It(this,z,"DRAWING")&&di((()=>{Mt(this,E,C).call(this)})):It(this,z,"COMPLETE")};return W=new WeakMap,A=new WeakMap,R=new WeakMap,T=new WeakMap,L=new WeakMap,V=new WeakMap,j=new WeakMap,D=new WeakMap,$=new WeakMap,B=new WeakMap,X=new WeakMap,Y=new WeakSet,H=function(){xt(this,L).on("pointStart",Mt(this,F,U).bind(this)),xt(this,L).on("pointEnd",Mt(this,N,G).bind(this)),xt(this,L).on("pointMove",Mt(this,Q,q).bind(this)),xt(this,L).on("hover",Mt(this,K,J).bind(this)),xt(this,L).on("wheel",Mt(this,it,nt).bind(this)),xt(this,L).on("wheelScale",Mt(this,ot,at).bind(this)),xt(this,L).on("scrollX",Mt(this,st,rt).bind(this)),xt(this,L).on("scrollY",Mt(this,lt,ht).bind(this)),xt(this,L).on("resize",Mt(this,ct,ft).bind(this)),xt(this,L).on("doubleClick",Mt(this,Z,_).bind(this)),xt(this,L).on("contextMenu",Mt(this,tt,et).bind(this)),xt(this,V).on("load",(()=>{xt(this,B).trigger("loadResource")}))},F=new WeakSet,U=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.pointStart)?void 0:e.call(n,t)))return}},N=new WeakSet,G=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.pointEnd)?void 0:e.call(n,t)))return}},Q=new WeakSet,q=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.pointMove)?void 0:e.call(n,t)))return}},K=new WeakSet,J=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.hover)?void 0:e.call(n,t)))return}},Z=new WeakSet,_=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.doubleClick)?void 0:e.call(n,t)))return}},tt=new WeakSet,et=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.contextMenu)?void 0:e.call(n,t)))return}},it=new WeakSet,nt=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.wheel)?void 0:e.call(n,t)))return}},ot=new WeakSet,at=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.wheelScale)?void 0:e.call(n,t)))return}},st=new WeakSet,rt=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.scrollX)?void 0:e.call(n,t)))return}},lt=new WeakSet,ht=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.scrollY)?void 0:e.call(n,t)))return}},ct=new WeakSet,ft=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.resize)?void 0:e.call(n,t)))return}},dt=new WeakSet,ut=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.clear)?void 0:e.call(n,t)))return}},vt=new WeakSet,wt=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.beforeDrawFrame)?void 0:e.call(n,t)))return}},gt=new WeakSet,pt=function(t){var e;for(let i=0;i<xt(this,T).length;i++){const n=xt(this,T)[i];if(!1===(null==(e=null==n?void 0:n.afterDrawFrame)?void 0:e.call(n,t)))return}},yt=new WeakSet,mt=function(){const t=[],e=xt(this,A);xt(this,R).forEach((i=>{const n=e.get(i);"enable"===(null==n?void 0:n.status)&&(null==n?void 0:n.middlewareObject)&&t.push(n.middlewareObject)})),It(this,T,t)},t.Board=class{constructor(t){St(this,Y),St(this,F),St(this,N),St(this,Q),St(this,K),St(this,Z),St(this,tt),St(this,it),St(this,ot),St(this,st),St(this,lt),St(this,ct),St(this,dt),St(this,vt),St(this,gt),St(this,yt),St(this,W,void 0),St(this,A,new WeakMap),St(this,R,[]),St(this,T,[]),St(this,L,void 0),St(this,V,void 0),St(this,j,void 0),St(this,D,void 0),St(this,$,void 0),St(this,B,new Ut),St(this,X,!1);const{boardContent:e}=t,i=new fi,n=new ri({viewContext:e.viewContext}),o=new hi({boardContent:e,sharer:i}),a=new si({viewContext:e.viewContext,sharer:i,calculator:n});It(this,W,t),It(this,j,i),It(this,L,o),It(this,V,a),It(this,$,n),It(this,D,new ui({boardContent:t.boardContent,sharer:i,renderer:a,calculator:xt(this,$),beforeDrawFrame:t=>{Mt(this,vt,wt).call(this,t)},afterDrawFrame:t=>{Mt(this,gt,pt).call(this,t)}})),Mt(this,Y,H).call(this),Mt(this,yt,mt).call(this)}isDestroyed(){return xt(this,X)}destroy(){xt(this,L).destroy(),xt(this,V).destroy(),xt(this,$).destroy(),xt(this,B).destroy(),It(this,X,!0)}getSharer(){return xt(this,j)}getViewer(){return xt(this,D)}getRenderer(){return xt(this,V)}setData(t,e){const{modifiedOptions:i}=e||{},n=xt(this,j);xt(this,j).setActiveStorage("data",t);const o=n.getActiveViewSizeInfo(),a=n.getActiveViewScaleInfo(),s=function(t,e){const i={x:0,y:0,w:0,h:0};t.forEach((t=>{const e={x:t.x,y:t.y,w:t.w,h:t.h,angle:t.angle};if(e.angle&&(e.angle>0||e.angle<0)){const t=se(e);if(4===t.length){const i=[t[0].x,t[1].x,t[2].x,t[3].x],n=[t[0].y,t[1].y,t[2].y,t[3].y];e.x=Math.min(...i),e.y=Math.min(...n),e.w=Math.abs(Math.max(...i)-Math.min(...i)),e.h=Math.abs(Math.max(...n)-Math.min(...n))}}const n=Math.min(e.x,i.x),o=Math.min(e.y,i.y),a=Math.max(e.x+e.w,i.x+i.w),s=Math.max(e.y+e.h,i.y+i.h);i.x=n,i.y=o,i.w=Math.abs(a-n),i.h=Math.abs(s-o)})),(null==e?void 0:e.extend)&&(i.x=Math.min(i.x,0),i.y=Math.min(i.y,0));const n={contextWidth:i.w,contextHeight:i.h};return(null==e?void 0:e.viewWidth)&&(null==e?void 0:e.viewHeight)&&(null==e?void 0:e.viewWidth)>0&&(null==e?void 0:e.viewHeight)>0&&(e.viewWidth>i.x+i.w&&(n.contextWidth=e.viewWidth-i.x),e.viewHeight>i.y+i.h&&(n.contextHeight=e.viewHeight-i.y)),n}(t.elements,{viewWidth:o.width,viewHeight:o.height,extend:!0});xt(this,D).resetViewVisibleInfoMap(t,{viewSizeInfo:o,viewScaleInfo:a}),xt(this,D).drawFrame();const r={...o,...s};return xt(this,j).setActiveViewSizeInfo(r),{viewSizeInfo:r}}getData(){const{data:t}=xt(this,j).getActiveStoreSnapshot();return t}use(t,e){var i,n,o;if(xt(this,A).has(t)){const e=xt(this,A).get(t);if(e)return null==(n=(i=e.middlewareObject).use)||n.call(i),e.status="enable",xt(this,A).set(t,e),void Mt(this,yt,mt).call(this)}const{boardContent:a,container:s}=xt(this,W),r=t({boardContent:a,sharer:xt(this,j),viewer:xt(this,D),calculator:xt(this,$),eventHub:xt(this,B),container:s},e);null==(o=r.use)||o.call(r),xt(this,R).push(t),xt(this,T).push(r),xt(this,A).set(t,{status:"enable",middlewareObject:r,config:e}),Mt(this,yt,mt).call(this)}disuse(t){var e,i;const n=xt(this,A).get(t);n&&(null==(i=(e=n.middlewareObject).disuse)||i.call(e),n.status="disable",xt(this,A).set(t,n),Mt(this,yt,mt).call(this))}scale(t){const e=xt(this,D),{ignoreUpdateVisibleStatus:i}=t,{moveX:n,moveY:o}=e.scale({...t,ignoreUpdateVisibleStatus:!0});e.scroll({moveX:n,moveY:o,ignoreUpdateVisibleStatus:i})}scroll(t){return xt(this,D).scroll(t)}updateViewScaleInfo(t){return xt(this,D).updateViewScaleInfo(t)}resize(t,e){const i=xt(this,D).resize(t,e),{width:n,height:o,devicePixelRatio:a}=t,{boardContent:s}=xt(this,W);s.viewContext.$resize({width:n,height:o,devicePixelRatio:a}),s.overlayContext.$resize({width:n,height:o,devicePixelRatio:a}),s.boardContext.$resize({width:n,height:o,devicePixelRatio:a}),s.underlayContext.$resize({width:n,height:o,devicePixelRatio:a}),xt(this,D).drawFrame(),xt(this,L).trigger("resize",i),xt(this,j).setActiveViewSizeInfo(t)}clear(){const{boardContent:t}=xt(this,W),{underlayContext:e,overlayContext:i,viewContext:n,boardContext:o}=t;e.clearRect(0,0,e.canvas.width,e.canvas.height),i.clearRect(0,0,i.canvas.width,i.canvas.height),n.clearRect(0,0,n.canvas.width,n.canvas.height),o.clearRect(0,0,o.canvas.width,o.canvas.height),Mt(this,dt,ut).call(this)}getEventHub(){return xt(this,B)}onWatcherEvents(){xt(this,L).onEvents()}offWatcherEvents(){xt(this,L).offEvents()}},t.Calculator=ri,t.Sharer=fi,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
{
"name": "@idraw/board",
"version": "0.4.0-beta.33",
"version": "0.4.0-beta.34",
"description": "",

@@ -24,8 +24,8 @@ "main": "dist/esm/index.js",

"devDependencies": {
"@idraw/types": "^0.4.0-beta.33"
"@idraw/types": "^0.4.0-beta.34"
},
"dependencies": {},
"peerDependencies": {
"@idraw/util": "^0.4.0-beta.33",
"@idraw/renderer": "^0.4.0-beta.33"
"@idraw/util": "^0.4.0-beta.34",
"@idraw/renderer": "^0.4.0-beta.34"
},

@@ -32,0 +32,0 @@ "publishConfig": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc