@netless/appliance-plugin 1.1.40 → 1.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/{bridge-b23MKtwT.mjs → bridge-BNKS_R2l.mjs} +1 -1
- package/dist/{bridge-DLEmhE7Y.js → bridge-BxkfdTkq.js} +1 -1
- package/dist/bridge.js +1 -1
- package/dist/bridge.mjs +1 -1
- package/dist/component/backgroundImageLoadCoordinator.d.ts +61 -0
- package/dist/component/svg/base.d.ts +2 -0
- package/dist/component/svg/svgElemt.d.ts +3 -1
- package/dist/component/svg/types.d.ts +2 -0
- package/dist/core/currentSceneGuard.d.ts +6 -0
- package/dist/core/initReadyBarrier.d.ts +8 -0
- package/dist/core/mainEngine.d.ts +4 -2
- package/dist/core/mainThread/base.d.ts +3 -3
- package/dist/core/mainThread/snapshotThread.d.ts +3 -3
- package/dist/core/mainThread/subLocalThread.d.ts +1 -1
- package/dist/core/mainThread/subServiceThread.d.ts +1 -1
- package/dist/fullWorker.js +18 -18
- package/dist/{index-WifS74pI.mjs → index-Bellzj9L.mjs} +234 -210
- package/dist/{index-CDDMgpaL.js → index-BoGQFZPO.js} +1 -1
- package/dist/index-BpI4eSla.js +1 -0
- package/dist/{index-BSR23bx5.mjs → index-BwKNcV3h.mjs} +1 -1
- package/dist/{index-CDbcv4B7.js → index-C4uTXXaR.js} +1 -1
- package/dist/{index-rhSRO8Tb.mjs → index-COQOIflN.mjs} +11433 -11139
- package/dist/index-DjDB-MYx.js +570 -0
- package/dist/{index-C3XOupI-.mjs → index-Doaj3rDL.mjs} +1 -1
- package/dist/index-DrGUJkFH.js +570 -0
- package/dist/index-SwxjyKCD.js +1 -0
- package/dist/{index-GpA_9BZu.mjs → index-WMF2MmW5.mjs} +11464 -11165
- package/dist/{index-pyv2KvXa.mjs → index-z4Oul31S.mjs} +221 -201
- package/dist/plugin/backgroundImageQuery.d.ts +4 -0
- package/dist/plugin/baseApplianceManager.d.ts +4 -0
- package/dist/plugin/types.d.ts +26 -1
- package/dist/subWorker.js +17 -17
- package/package.json +8 -4
- package/dist/index-DKaa5HSe.js +0 -1
- package/dist/index-DoIyQYzA.js +0 -570
- package/dist/index-DwW4gzgA.js +0 -1
- package/dist/index-RKd-OVPO.js +0 -570
package/dist/fullWorker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _Object$freeze,_DPt;var _excluded=["duration"],_excluded2=["toolsType"],_excluded3=["callback"],_excluded4=["render"],_excluded5=["render"];function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _regeneratorValues(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function next(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e};}};}throw new TypeError(_typeof(e)+" is not iterable");}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n5=0,F=function F(){};return{s:F,n:function n(){return _n5>=r.length?{done:!0}:{done:!1,value:r[_n5++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t.return||t.return();}finally{if(u)throw o;}}};}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a;}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0));}if(o||r>1)return a;throw y=!0,n;}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0);}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e;}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break;}catch(t){i=e,c=1,u=t;}finally{f=1;}}return{value:t,done:y};};}(r,o,i),!0),u;}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this;}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e;}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this;}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]";}),(_regenerator=function _regenerator(){return{w:i,m:f};})();}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{});}catch(e){i=0;}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e);});}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2));},_regeneratorDefine2(e,r,n,t);}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _objectDestructuringEmpty(t){if(null==t)throw new TypeError("Cannot destructure "+t);}function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r]);}return n;},_extends.apply(null,arguments);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},return:function _return(r){var n=this.s.return;return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));},throw:function _throw(r){var n=this.s.return;return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));}},new AsyncFromSyncIterator(r);}var Jb=Object.defineProperty;var _b=function _b(r,t,e){return t in r?Jb(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;};var wt=function wt(r,t,e){return _b(r,_typeof(t)!="symbol"?t+"":t,e);};var uo=1e-6,Wa=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array;function Le(r){Wa=r;}function tM(){var r=new Wa(6);return Wa!=Float32Array&&(r[1]=0,r[2]=0,r[4]=0,r[5]=0),r[0]=1,r[3]=1,r;}function eM(r){var t=new Wa(6);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t;}function rM(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r;}function nM(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r;}function Ms(r,t,e,n,i,s){var o=new Wa(6);return o[0]=r,o[1]=t,o[2]=e,o[3]=n,o[4]=i,o[5]=s,o;}function iM(r,t,e,n,i,s,o){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=s,r[5]=o,r;}function tu(r,t){var e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=e*s-n*i;return u?(u=1/u,r[0]=s*u,r[1]=-n*u,r[2]=-i*u,r[3]=e*u,r[4]=(i*a-s*o)*u,r[5]=(n*o-e*a)*u,r):null;}function sM(r){return r[0]*r[3]-r[1]*r[2];}function Kn(r,t,e){var n=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],d=e[0],v=e[1],p=e[2],w=e[3],A=e[4],M=e[5];return r[0]=n*d+s*v,r[1]=i*d+o*v,r[2]=n*p+s*w,r[3]=i*p+o*w,r[4]=n*A+s*M+a,r[5]=i*A+o*M+u,r;}function b1(r,t,e){var n=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],d=Math.sin(e),v=Math.cos(e);return r[0]=n*v+s*d,r[1]=i*v+o*d,r[2]=n*-d+s*v,r[3]=i*-d+o*v,r[4]=a,r[5]=u,r;}function oM(r,t,e){var n=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],d=e[0],v=e[1];return r[0]=n*d,r[1]=i*d,r[2]=s*v,r[3]=o*v,r[4]=a,r[5]=u,r;}function Ed(r,t,e){var n=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],d=e[0],v=e[1];return r[0]=n,r[1]=i,r[2]=s,r[3]=o,r[4]=n*d+s*v+a,r[5]=i*d+o*v+u,r;}function aM(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=-e,r[3]=n,r[4]=0,r[5]=0,r;}function lM(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r[4]=0,r[5]=0,r;}function cM(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=t[0],r[5]=t[1],r;}function uM(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")";}function fM(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]+r[3]*r[3]+r[4]*r[4]+r[5]*r[5]+1);}function hM(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r;}function M1(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r;}function dM(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r;}function pM(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r;}function vM(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5];}function gM(r,t){var e=r[0],n=r[1],i=r[2],s=r[3],o=r[4],a=r[5],u=t[0],d=t[1],v=t[2],p=t[3],w=t[4],A=t[5];return Math.abs(e-u)<=uo*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(n-d)<=uo*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-v)<=uo*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(s-p)<=uo*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-w)<=uo*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-A)<=uo*Math.max(1,Math.abs(a),Math.abs(A));}var mM=Kn,yM=M1;var E1=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,add:hM,clone:eM,copy:rM,create:tM,determinant:sM,equals:gM,exactEquals:vM,frob:fM,fromRotation:aM,fromScaling:lM,fromTranslation:cM,fromValues:Ms,identity:nM,invert:tu,mul:mM,multiply:Kn,multiplyScalar:dM,multiplyScalarAndAdd:pM,rotate:b1,scale:oM,set:iM,str:uM,sub:yM,subtract:M1,translate:Ed},Symbol.toStringTag,{value:"Module"}));var Qe=(typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?globalThis:(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:(typeof global==="undefined"?"undefined":_typeof(global))<"u"?global:(typeof self==="undefined"?"undefined":_typeof(self))<"u"?self:{};function zn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;}var L1={exports:{}};(function(r,t){(function(n,i){r.exports=i();})(Qe,function(){return/******/function(e){var n={};function i(s){if(n[s])return n[s].exports;var o=n[s]={/******/i:s,/******/l:!1,/******/exports:{}/******/};return e[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports;}return i.m=e,i.c=n,i.d=function(s,o,a){i.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:a});},i.r=function(s){(typeof Symbol==="undefined"?"undefined":_typeof(Symbol))<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0});},i.t=function(s,o){if(o&1&&(s=i(s)),o&8||o&4&&_typeof(s)=="object"&&s&&s.__esModule)return s;var a=/* @__PURE__ */Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:s}),o&2&&typeof s!="string")for(var u in s)i.d(a,u,function(d){return s[d];}.bind(null,u));return a;},i.n=function(s){var o=s&&s.__esModule?(/******/function(){return s.default;}):(/******/function(){return s;});return i.d(o,"a",o),o;},i.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o);},i.p="/js/",i(i.s=0);}([/* 0 *//***/function(e,n,i){i.r(n);var s=i(12);i.d(n,"Renderer",function(){return s.default;});var o=i(56);i.d(n,"Figure2D",function(){return o.default;});var a=i(73);i.d(n,"Mesh2D",function(){return a.default;});var u=i(45);i.d(n,"MeshCloud",function(){return u.default;});var d=i(39);i.d(n,"parseFont",function(){return d.default;});var v=i(47);i.d(n,"parseColor",function(){return v.default;});var p=i(37);i.d(n,"ENV",function(){return p.default;}),i(1).glMatrix.setMatrixArrayType(Array);},/* 1 *//***/function(e,n,i){i.r(n);var s=i(2);i.d(n,"glMatrix",function(){return s;});var o=i(3);i.d(n,"mat2",function(){return o;});var a=i(4);i.d(n,"mat2d",function(){return a;});var u=i(5);i.d(n,"mat3",function(){return u;});var d=i(6);i.d(n,"mat4",function(){return d;});var v=i(7);i.d(n,"quat",function(){return v;});var p=i(10);i.d(n,"quat2",function(){return p;});var w=i(11);i.d(n,"vec2",function(){return w;});var A=i(8);i.d(n,"vec3",function(){return A;});var M=i(9);i.d(n,"vec4",function(){return M;});},/* 2 *//***/function(e,n,i){i.r(n),i.d(n,"EPSILON",function(){return s;}),i.d(n,"ARRAY_TYPE",function(){return o;}),i.d(n,"RANDOM",function(){return a;}),i.d(n,"setMatrixArrayType",function(){return u;}),i.d(n,"toRadian",function(){return v;}),i.d(n,"equals",function(){return p;});var s=1e-6,o=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,a=Math.random;function u(w){o=w;}var d=Math.PI/180;function v(w){return w*d;}function p(w,A){return Math.abs(w-A)<=s*Math.max(1,Math.abs(w),Math.abs(A));}Math.hypot||(Math.hypot=function(){for(var w=0,A=arguments.length;A--;)w+=arguments[A]*arguments[A];return Math.sqrt(w);});},/* 3 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"copy",function(){return u;}),i.d(n,"identity",function(){return d;}),i.d(n,"fromValues",function(){return v;}),i.d(n,"set",function(){return p;}),i.d(n,"transpose",function(){return w;}),i.d(n,"invert",function(){return A;}),i.d(n,"adjoint",function(){return M;}),i.d(n,"determinant",function(){return E;}),i.d(n,"multiply",function(){return L;}),i.d(n,"rotate",function(){return G;}),i.d(n,"scale",function(){return z;}),i.d(n,"fromRotation",function(){return et;}),i.d(n,"fromScaling",function(){return x;}),i.d(n,"str",function(){return y;}),i.d(n,"frob",function(){return S;}),i.d(n,"LDU",function(){return C;}),i.d(n,"add",function(){return P;}),i.d(n,"subtract",function(){return X;}),i.d(n,"exactEquals",function(){return $;}),i.d(n,"equals",function(){return K;}),i.d(n,"multiplyScalar",function(){return j;}),i.d(n,"multiplyScalarAndAdd",function(){return nt;}),i.d(n,"mul",function(){return ct;}),i.d(n,"sub",function(){return F;});var s=i(2);function o(){var R=new s.ARRAY_TYPE(4);return s.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0),R[0]=1,R[3]=1,R;}function a(R){var Y=new s.ARRAY_TYPE(4);return Y[0]=R[0],Y[1]=R[1],Y[2]=R[2],Y[3]=R[3],Y;}function u(R,Y){return R[0]=Y[0],R[1]=Y[1],R[2]=Y[2],R[3]=Y[3],R;}function d(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R;}function v(R,Y,q,lt){var ut=new s.ARRAY_TYPE(4);return ut[0]=R,ut[1]=Y,ut[2]=q,ut[3]=lt,ut;}function p(R,Y,q,lt,ut){return R[0]=Y,R[1]=q,R[2]=lt,R[3]=ut,R;}function w(R,Y){if(R===Y){var q=Y[1];R[1]=Y[2],R[2]=q;}else R[0]=Y[0],R[1]=Y[2],R[2]=Y[1],R[3]=Y[3];return R;}function A(R,Y){var q=Y[0],lt=Y[1],ut=Y[2],Tt=Y[3],O=q*Tt-ut*lt;return O?(O=1/O,R[0]=Tt*O,R[1]=-lt*O,R[2]=-ut*O,R[3]=q*O,R):null;}function M(R,Y){var q=Y[0];return R[0]=Y[3],R[1]=-Y[1],R[2]=-Y[2],R[3]=q,R;}function E(R){return R[0]*R[3]-R[2]*R[1];}function L(R,Y,q){var lt=Y[0],ut=Y[1],Tt=Y[2],O=Y[3],U=q[0],_=q[1],H=q[2],at=q[3];return R[0]=lt*U+Tt*_,R[1]=ut*U+O*_,R[2]=lt*H+Tt*at,R[3]=ut*H+O*at,R;}function G(R,Y,q){var lt=Y[0],ut=Y[1],Tt=Y[2],O=Y[3],U=Math.sin(q),_=Math.cos(q);return R[0]=lt*_+Tt*U,R[1]=ut*_+O*U,R[2]=lt*-U+Tt*_,R[3]=ut*-U+O*_,R;}function z(R,Y,q){var lt=Y[0],ut=Y[1],Tt=Y[2],O=Y[3],U=q[0],_=q[1];return R[0]=lt*U,R[1]=ut*U,R[2]=Tt*_,R[3]=O*_,R;}function et(R,Y){var q=Math.sin(Y),lt=Math.cos(Y);return R[0]=lt,R[1]=q,R[2]=-q,R[3]=lt,R;}function x(R,Y){return R[0]=Y[0],R[1]=0,R[2]=0,R[3]=Y[1],R;}function y(R){return"mat2("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+")";}function S(R){return Math.hypot(R[0],R[1],R[2],R[3]);}function C(R,Y,q,lt){return R[2]=lt[2]/lt[0],q[0]=lt[0],q[1]=lt[1],q[3]=lt[3]-R[2]*q[1],[R,Y,q];}function P(R,Y,q){return R[0]=Y[0]+q[0],R[1]=Y[1]+q[1],R[2]=Y[2]+q[2],R[3]=Y[3]+q[3],R;}function X(R,Y,q){return R[0]=Y[0]-q[0],R[1]=Y[1]-q[1],R[2]=Y[2]-q[2],R[3]=Y[3]-q[3],R;}function $(R,Y){return R[0]===Y[0]&&R[1]===Y[1]&&R[2]===Y[2]&&R[3]===Y[3];}function K(R,Y){var q=R[0],lt=R[1],ut=R[2],Tt=R[3],O=Y[0],U=Y[1],_=Y[2],H=Y[3];return Math.abs(q-O)<=s.EPSILON*Math.max(1,Math.abs(q),Math.abs(O))&&Math.abs(lt-U)<=s.EPSILON*Math.max(1,Math.abs(lt),Math.abs(U))&&Math.abs(ut-_)<=s.EPSILON*Math.max(1,Math.abs(ut),Math.abs(_))&&Math.abs(Tt-H)<=s.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(H));}function j(R,Y,q){return R[0]=Y[0]*q,R[1]=Y[1]*q,R[2]=Y[2]*q,R[3]=Y[3]*q,R;}function nt(R,Y,q,lt){return R[0]=Y[0]+q[0]*lt,R[1]=Y[1]+q[1]*lt,R[2]=Y[2]+q[2]*lt,R[3]=Y[3]+q[3]*lt,R;}var ct=L,F=X;},/* 4 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"copy",function(){return u;}),i.d(n,"identity",function(){return d;}),i.d(n,"fromValues",function(){return v;}),i.d(n,"set",function(){return p;}),i.d(n,"invert",function(){return w;}),i.d(n,"determinant",function(){return A;}),i.d(n,"multiply",function(){return M;}),i.d(n,"rotate",function(){return E;}),i.d(n,"scale",function(){return L;}),i.d(n,"translate",function(){return G;}),i.d(n,"fromRotation",function(){return z;}),i.d(n,"fromScaling",function(){return et;}),i.d(n,"fromTranslation",function(){return x;}),i.d(n,"str",function(){return y;}),i.d(n,"frob",function(){return S;}),i.d(n,"add",function(){return C;}),i.d(n,"subtract",function(){return P;}),i.d(n,"multiplyScalar",function(){return X;}),i.d(n,"multiplyScalarAndAdd",function(){return $;}),i.d(n,"exactEquals",function(){return K;}),i.d(n,"equals",function(){return j;}),i.d(n,"mul",function(){return nt;}),i.d(n,"sub",function(){return ct;});var s=i(2);function o(){var F=new s.ARRAY_TYPE(6);return s.ARRAY_TYPE!=Float32Array&&(F[1]=0,F[2]=0,F[4]=0,F[5]=0),F[0]=1,F[3]=1,F;}function a(F){var R=new s.ARRAY_TYPE(6);return R[0]=F[0],R[1]=F[1],R[2]=F[2],R[3]=F[3],R[4]=F[4],R[5]=F[5],R;}function u(F,R){return F[0]=R[0],F[1]=R[1],F[2]=R[2],F[3]=R[3],F[4]=R[4],F[5]=R[5],F;}function d(F){return F[0]=1,F[1]=0,F[2]=0,F[3]=1,F[4]=0,F[5]=0,F;}function v(F,R,Y,q,lt,ut){var Tt=new s.ARRAY_TYPE(6);return Tt[0]=F,Tt[1]=R,Tt[2]=Y,Tt[3]=q,Tt[4]=lt,Tt[5]=ut,Tt;}function p(F,R,Y,q,lt,ut,Tt){return F[0]=R,F[1]=Y,F[2]=q,F[3]=lt,F[4]=ut,F[5]=Tt,F;}function w(F,R){var Y=R[0],q=R[1],lt=R[2],ut=R[3],Tt=R[4],O=R[5],U=Y*ut-q*lt;return U?(U=1/U,F[0]=ut*U,F[1]=-q*U,F[2]=-lt*U,F[3]=Y*U,F[4]=(lt*O-ut*Tt)*U,F[5]=(q*Tt-Y*O)*U,F):null;}function A(F){return F[0]*F[3]-F[1]*F[2];}function M(F,R,Y){var q=R[0],lt=R[1],ut=R[2],Tt=R[3],O=R[4],U=R[5],_=Y[0],H=Y[1],at=Y[2],ht=Y[3],yt=Y[4],Et=Y[5];return F[0]=q*_+ut*H,F[1]=lt*_+Tt*H,F[2]=q*at+ut*ht,F[3]=lt*at+Tt*ht,F[4]=q*yt+ut*Et+O,F[5]=lt*yt+Tt*Et+U,F;}function E(F,R,Y){var q=R[0],lt=R[1],ut=R[2],Tt=R[3],O=R[4],U=R[5],_=Math.sin(Y),H=Math.cos(Y);return F[0]=q*H+ut*_,F[1]=lt*H+Tt*_,F[2]=q*-_+ut*H,F[3]=lt*-_+Tt*H,F[4]=O,F[5]=U,F;}function L(F,R,Y){var q=R[0],lt=R[1],ut=R[2],Tt=R[3],O=R[4],U=R[5],_=Y[0],H=Y[1];return F[0]=q*_,F[1]=lt*_,F[2]=ut*H,F[3]=Tt*H,F[4]=O,F[5]=U,F;}function G(F,R,Y){var q=R[0],lt=R[1],ut=R[2],Tt=R[3],O=R[4],U=R[5],_=Y[0],H=Y[1];return F[0]=q,F[1]=lt,F[2]=ut,F[3]=Tt,F[4]=q*_+ut*H+O,F[5]=lt*_+Tt*H+U,F;}function z(F,R){var Y=Math.sin(R),q=Math.cos(R);return F[0]=q,F[1]=Y,F[2]=-Y,F[3]=q,F[4]=0,F[5]=0,F;}function et(F,R){return F[0]=R[0],F[1]=0,F[2]=0,F[3]=R[1],F[4]=0,F[5]=0,F;}function x(F,R){return F[0]=1,F[1]=0,F[2]=0,F[3]=1,F[4]=R[0],F[5]=R[1],F;}function y(F){return"mat2d("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+", "+F[4]+", "+F[5]+")";}function S(F){return Math.hypot(F[0],F[1],F[2],F[3],F[4],F[5],1);}function C(F,R,Y){return F[0]=R[0]+Y[0],F[1]=R[1]+Y[1],F[2]=R[2]+Y[2],F[3]=R[3]+Y[3],F[4]=R[4]+Y[4],F[5]=R[5]+Y[5],F;}function P(F,R,Y){return F[0]=R[0]-Y[0],F[1]=R[1]-Y[1],F[2]=R[2]-Y[2],F[3]=R[3]-Y[3],F[4]=R[4]-Y[4],F[5]=R[5]-Y[5],F;}function X(F,R,Y){return F[0]=R[0]*Y,F[1]=R[1]*Y,F[2]=R[2]*Y,F[3]=R[3]*Y,F[4]=R[4]*Y,F[5]=R[5]*Y,F;}function $(F,R,Y,q){return F[0]=R[0]+Y[0]*q,F[1]=R[1]+Y[1]*q,F[2]=R[2]+Y[2]*q,F[3]=R[3]+Y[3]*q,F[4]=R[4]+Y[4]*q,F[5]=R[5]+Y[5]*q,F;}function K(F,R){return F[0]===R[0]&&F[1]===R[1]&&F[2]===R[2]&&F[3]===R[3]&&F[4]===R[4]&&F[5]===R[5];}function j(F,R){var Y=F[0],q=F[1],lt=F[2],ut=F[3],Tt=F[4],O=F[5],U=R[0],_=R[1],H=R[2],at=R[3],ht=R[4],yt=R[5];return Math.abs(Y-U)<=s.EPSILON*Math.max(1,Math.abs(Y),Math.abs(U))&&Math.abs(q-_)<=s.EPSILON*Math.max(1,Math.abs(q),Math.abs(_))&&Math.abs(lt-H)<=s.EPSILON*Math.max(1,Math.abs(lt),Math.abs(H))&&Math.abs(ut-at)<=s.EPSILON*Math.max(1,Math.abs(ut),Math.abs(at))&&Math.abs(Tt-ht)<=s.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(ht))&&Math.abs(O-yt)<=s.EPSILON*Math.max(1,Math.abs(O),Math.abs(yt));}var nt=M,ct=P;},/* 5 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"fromMat4",function(){return a;}),i.d(n,"clone",function(){return u;}),i.d(n,"copy",function(){return d;}),i.d(n,"fromValues",function(){return v;}),i.d(n,"set",function(){return p;}),i.d(n,"identity",function(){return w;}),i.d(n,"transpose",function(){return A;}),i.d(n,"invert",function(){return M;}),i.d(n,"adjoint",function(){return E;}),i.d(n,"determinant",function(){return L;}),i.d(n,"multiply",function(){return G;}),i.d(n,"translate",function(){return z;}),i.d(n,"rotate",function(){return et;}),i.d(n,"scale",function(){return x;}),i.d(n,"fromTranslation",function(){return y;}),i.d(n,"fromRotation",function(){return S;}),i.d(n,"fromScaling",function(){return C;}),i.d(n,"fromMat2d",function(){return P;}),i.d(n,"fromQuat",function(){return X;}),i.d(n,"normalFromMat4",function(){return $;}),i.d(n,"projection",function(){return K;}),i.d(n,"str",function(){return j;}),i.d(n,"frob",function(){return nt;}),i.d(n,"add",function(){return ct;}),i.d(n,"subtract",function(){return F;}),i.d(n,"multiplyScalar",function(){return R;}),i.d(n,"multiplyScalarAndAdd",function(){return Y;}),i.d(n,"exactEquals",function(){return q;}),i.d(n,"equals",function(){return lt;}),i.d(n,"mul",function(){return ut;}),i.d(n,"sub",function(){return Tt;});var s=i(2);function o(){var O=new s.ARRAY_TYPE(9);return s.ARRAY_TYPE!=Float32Array&&(O[1]=0,O[2]=0,O[3]=0,O[5]=0,O[6]=0,O[7]=0),O[0]=1,O[4]=1,O[8]=1,O;}function a(O,U){return O[0]=U[0],O[1]=U[1],O[2]=U[2],O[3]=U[4],O[4]=U[5],O[5]=U[6],O[6]=U[8],O[7]=U[9],O[8]=U[10],O;}function u(O){var U=new s.ARRAY_TYPE(9);return U[0]=O[0],U[1]=O[1],U[2]=O[2],U[3]=O[3],U[4]=O[4],U[5]=O[5],U[6]=O[6],U[7]=O[7],U[8]=O[8],U;}function d(O,U){return O[0]=U[0],O[1]=U[1],O[2]=U[2],O[3]=U[3],O[4]=U[4],O[5]=U[5],O[6]=U[6],O[7]=U[7],O[8]=U[8],O;}function v(O,U,_,H,at,ht,yt,Et,Dt){var D=new s.ARRAY_TYPE(9);return D[0]=O,D[1]=U,D[2]=_,D[3]=H,D[4]=at,D[5]=ht,D[6]=yt,D[7]=Et,D[8]=Dt,D;}function p(O,U,_,H,at,ht,yt,Et,Dt,D){return O[0]=U,O[1]=_,O[2]=H,O[3]=at,O[4]=ht,O[5]=yt,O[6]=Et,O[7]=Dt,O[8]=D,O;}function w(O){return O[0]=1,O[1]=0,O[2]=0,O[3]=0,O[4]=1,O[5]=0,O[6]=0,O[7]=0,O[8]=1,O;}function A(O,U){if(O===U){var _=U[1],H=U[2],at=U[5];O[1]=U[3],O[2]=U[6],O[3]=_,O[5]=U[7],O[6]=H,O[7]=at;}else O[0]=U[0],O[1]=U[3],O[2]=U[6],O[3]=U[1],O[4]=U[4],O[5]=U[7],O[6]=U[2],O[7]=U[5],O[8]=U[8];return O;}function M(O,U){var _=U[0],H=U[1],at=U[2],ht=U[3],yt=U[4],Et=U[5],Dt=U[6],D=U[7],N=U[8],J=N*yt-Et*D,Q=-N*ht+Et*Dt,V=D*ht-yt*Dt,tt=_*J+H*Q+at*V;return tt?(tt=1/tt,O[0]=J*tt,O[1]=(-N*H+at*D)*tt,O[2]=(Et*H-at*yt)*tt,O[3]=Q*tt,O[4]=(N*_-at*Dt)*tt,O[5]=(-Et*_+at*ht)*tt,O[6]=V*tt,O[7]=(-D*_+H*Dt)*tt,O[8]=(yt*_-H*ht)*tt,O):null;}function E(O,U){var _=U[0],H=U[1],at=U[2],ht=U[3],yt=U[4],Et=U[5],Dt=U[6],D=U[7],N=U[8];return O[0]=yt*N-Et*D,O[1]=at*D-H*N,O[2]=H*Et-at*yt,O[3]=Et*Dt-ht*N,O[4]=_*N-at*Dt,O[5]=at*ht-_*Et,O[6]=ht*D-yt*Dt,O[7]=H*Dt-_*D,O[8]=_*yt-H*ht,O;}function L(O){var U=O[0],_=O[1],H=O[2],at=O[3],ht=O[4],yt=O[5],Et=O[6],Dt=O[7],D=O[8];return U*(D*ht-yt*Dt)+_*(-D*at+yt*Et)+H*(Dt*at-ht*Et);}function G(O,U,_){var H=U[0],at=U[1],ht=U[2],yt=U[3],Et=U[4],Dt=U[5],D=U[6],N=U[7],J=U[8],Q=_[0],V=_[1],tt=_[2],g=_[3],I=_[4],B=_[5],Z=_[6],st=_[7],ft=_[8];return O[0]=Q*H+V*yt+tt*D,O[1]=Q*at+V*Et+tt*N,O[2]=Q*ht+V*Dt+tt*J,O[3]=g*H+I*yt+B*D,O[4]=g*at+I*Et+B*N,O[5]=g*ht+I*Dt+B*J,O[6]=Z*H+st*yt+ft*D,O[7]=Z*at+st*Et+ft*N,O[8]=Z*ht+st*Dt+ft*J,O;}function z(O,U,_){var H=U[0],at=U[1],ht=U[2],yt=U[3],Et=U[4],Dt=U[5],D=U[6],N=U[7],J=U[8],Q=_[0],V=_[1];return O[0]=H,O[1]=at,O[2]=ht,O[3]=yt,O[4]=Et,O[5]=Dt,O[6]=Q*H+V*yt+D,O[7]=Q*at+V*Et+N,O[8]=Q*ht+V*Dt+J,O;}function et(O,U,_){var H=U[0],at=U[1],ht=U[2],yt=U[3],Et=U[4],Dt=U[5],D=U[6],N=U[7],J=U[8],Q=Math.sin(_),V=Math.cos(_);return O[0]=V*H+Q*yt,O[1]=V*at+Q*Et,O[2]=V*ht+Q*Dt,O[3]=V*yt-Q*H,O[4]=V*Et-Q*at,O[5]=V*Dt-Q*ht,O[6]=D,O[7]=N,O[8]=J,O;}function x(O,U,_){var H=_[0],at=_[1];return O[0]=H*U[0],O[1]=H*U[1],O[2]=H*U[2],O[3]=at*U[3],O[4]=at*U[4],O[5]=at*U[5],O[6]=U[6],O[7]=U[7],O[8]=U[8],O;}function y(O,U){return O[0]=1,O[1]=0,O[2]=0,O[3]=0,O[4]=1,O[5]=0,O[6]=U[0],O[7]=U[1],O[8]=1,O;}function S(O,U){var _=Math.sin(U),H=Math.cos(U);return O[0]=H,O[1]=_,O[2]=0,O[3]=-_,O[4]=H,O[5]=0,O[6]=0,O[7]=0,O[8]=1,O;}function C(O,U){return O[0]=U[0],O[1]=0,O[2]=0,O[3]=0,O[4]=U[1],O[5]=0,O[6]=0,O[7]=0,O[8]=1,O;}function P(O,U){return O[0]=U[0],O[1]=U[1],O[2]=0,O[3]=U[2],O[4]=U[3],O[5]=0,O[6]=U[4],O[7]=U[5],O[8]=1,O;}function X(O,U){var _=U[0],H=U[1],at=U[2],ht=U[3],yt=_+_,Et=H+H,Dt=at+at,D=_*yt,N=H*yt,J=H*Et,Q=at*yt,V=at*Et,tt=at*Dt,g=ht*yt,I=ht*Et,B=ht*Dt;return O[0]=1-J-tt,O[3]=N-B,O[6]=Q+I,O[1]=N+B,O[4]=1-D-tt,O[7]=V-g,O[2]=Q-I,O[5]=V+g,O[8]=1-D-J,O;}function $(O,U){var _=U[0],H=U[1],at=U[2],ht=U[3],yt=U[4],Et=U[5],Dt=U[6],D=U[7],N=U[8],J=U[9],Q=U[10],V=U[11],tt=U[12],g=U[13],I=U[14],B=U[15],Z=_*Et-H*yt,st=_*Dt-at*yt,ft=_*D-ht*yt,dt=H*Dt-at*Et,ot=H*D-ht*Et,gt=at*D-ht*Dt,St=N*g-J*tt,Pt=N*I-Q*tt,Lt=N*B-V*tt,Rt=J*I-Q*g,Nt=J*B-V*g,$t=Q*B-V*I,Ut=Z*$t-st*Nt+ft*Rt+dt*Lt-ot*Pt+gt*St;return Ut?(Ut=1/Ut,O[0]=(Et*$t-Dt*Nt+D*Rt)*Ut,O[1]=(Dt*Lt-yt*$t-D*Pt)*Ut,O[2]=(yt*Nt-Et*Lt+D*St)*Ut,O[3]=(at*Nt-H*$t-ht*Rt)*Ut,O[4]=(_*$t-at*Lt+ht*Pt)*Ut,O[5]=(H*Lt-_*Nt-ht*St)*Ut,O[6]=(g*gt-I*ot+B*dt)*Ut,O[7]=(I*ft-tt*gt-B*st)*Ut,O[8]=(tt*ot-g*ft+B*Z)*Ut,O):null;}function K(O,U,_){return O[0]=2/U,O[1]=0,O[2]=0,O[3]=0,O[4]=-2/_,O[5]=0,O[6]=-1,O[7]=1,O[8]=1,O;}function j(O){return"mat3("+O[0]+", "+O[1]+", "+O[2]+", "+O[3]+", "+O[4]+", "+O[5]+", "+O[6]+", "+O[7]+", "+O[8]+")";}function nt(O){return Math.hypot(O[0],O[1],O[2],O[3],O[4],O[5],O[6],O[7],O[8]);}function ct(O,U,_){return O[0]=U[0]+_[0],O[1]=U[1]+_[1],O[2]=U[2]+_[2],O[3]=U[3]+_[3],O[4]=U[4]+_[4],O[5]=U[5]+_[5],O[6]=U[6]+_[6],O[7]=U[7]+_[7],O[8]=U[8]+_[8],O;}function F(O,U,_){return O[0]=U[0]-_[0],O[1]=U[1]-_[1],O[2]=U[2]-_[2],O[3]=U[3]-_[3],O[4]=U[4]-_[4],O[5]=U[5]-_[5],O[6]=U[6]-_[6],O[7]=U[7]-_[7],O[8]=U[8]-_[8],O;}function R(O,U,_){return O[0]=U[0]*_,O[1]=U[1]*_,O[2]=U[2]*_,O[3]=U[3]*_,O[4]=U[4]*_,O[5]=U[5]*_,O[6]=U[6]*_,O[7]=U[7]*_,O[8]=U[8]*_,O;}function Y(O,U,_,H){return O[0]=U[0]+_[0]*H,O[1]=U[1]+_[1]*H,O[2]=U[2]+_[2]*H,O[3]=U[3]+_[3]*H,O[4]=U[4]+_[4]*H,O[5]=U[5]+_[5]*H,O[6]=U[6]+_[6]*H,O[7]=U[7]+_[7]*H,O[8]=U[8]+_[8]*H,O;}function q(O,U){return O[0]===U[0]&&O[1]===U[1]&&O[2]===U[2]&&O[3]===U[3]&&O[4]===U[4]&&O[5]===U[5]&&O[6]===U[6]&&O[7]===U[7]&&O[8]===U[8];}function lt(O,U){var _=O[0],H=O[1],at=O[2],ht=O[3],yt=O[4],Et=O[5],Dt=O[6],D=O[7],N=O[8],J=U[0],Q=U[1],V=U[2],tt=U[3],g=U[4],I=U[5],B=U[6],Z=U[7],st=U[8];return Math.abs(_-J)<=s.EPSILON*Math.max(1,Math.abs(_),Math.abs(J))&&Math.abs(H-Q)<=s.EPSILON*Math.max(1,Math.abs(H),Math.abs(Q))&&Math.abs(at-V)<=s.EPSILON*Math.max(1,Math.abs(at),Math.abs(V))&&Math.abs(ht-tt)<=s.EPSILON*Math.max(1,Math.abs(ht),Math.abs(tt))&&Math.abs(yt-g)<=s.EPSILON*Math.max(1,Math.abs(yt),Math.abs(g))&&Math.abs(Et-I)<=s.EPSILON*Math.max(1,Math.abs(Et),Math.abs(I))&&Math.abs(Dt-B)<=s.EPSILON*Math.max(1,Math.abs(Dt),Math.abs(B))&&Math.abs(D-Z)<=s.EPSILON*Math.max(1,Math.abs(D),Math.abs(Z))&&Math.abs(N-st)<=s.EPSILON*Math.max(1,Math.abs(N),Math.abs(st));}var ut=G,Tt=F;},/* 6 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"copy",function(){return u;}),i.d(n,"fromValues",function(){return d;}),i.d(n,"set",function(){return v;}),i.d(n,"identity",function(){return p;}),i.d(n,"transpose",function(){return w;}),i.d(n,"invert",function(){return A;}),i.d(n,"adjoint",function(){return M;}),i.d(n,"determinant",function(){return E;}),i.d(n,"multiply",function(){return L;}),i.d(n,"translate",function(){return G;}),i.d(n,"scale",function(){return z;}),i.d(n,"rotate",function(){return et;}),i.d(n,"rotateX",function(){return x;}),i.d(n,"rotateY",function(){return y;}),i.d(n,"rotateZ",function(){return S;}),i.d(n,"fromTranslation",function(){return C;}),i.d(n,"fromScaling",function(){return P;}),i.d(n,"fromRotation",function(){return X;}),i.d(n,"fromXRotation",function(){return $;}),i.d(n,"fromYRotation",function(){return K;}),i.d(n,"fromZRotation",function(){return j;}),i.d(n,"fromRotationTranslation",function(){return nt;}),i.d(n,"fromQuat2",function(){return ct;}),i.d(n,"getTranslation",function(){return F;}),i.d(n,"getScaling",function(){return R;}),i.d(n,"getRotation",function(){return Y;}),i.d(n,"fromRotationTranslationScale",function(){return q;}),i.d(n,"fromRotationTranslationScaleOrigin",function(){return lt;}),i.d(n,"fromQuat",function(){return ut;}),i.d(n,"frustum",function(){return Tt;}),i.d(n,"perspective",function(){return O;}),i.d(n,"perspectiveFromFieldOfView",function(){return U;}),i.d(n,"ortho",function(){return _;}),i.d(n,"lookAt",function(){return H;}),i.d(n,"targetTo",function(){return at;}),i.d(n,"str",function(){return ht;}),i.d(n,"frob",function(){return yt;}),i.d(n,"add",function(){return Et;}),i.d(n,"subtract",function(){return Dt;}),i.d(n,"multiplyScalar",function(){return D;}),i.d(n,"multiplyScalarAndAdd",function(){return N;}),i.d(n,"exactEquals",function(){return J;}),i.d(n,"equals",function(){return Q;}),i.d(n,"mul",function(){return V;}),i.d(n,"sub",function(){return tt;});var s=i(2);function o(){var g=new s.ARRAY_TYPE(16);return s.ARRAY_TYPE!=Float32Array&&(g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[11]=0,g[12]=0,g[13]=0,g[14]=0),g[0]=1,g[5]=1,g[10]=1,g[15]=1,g;}function a(g){var I=new s.ARRAY_TYPE(16);return I[0]=g[0],I[1]=g[1],I[2]=g[2],I[3]=g[3],I[4]=g[4],I[5]=g[5],I[6]=g[6],I[7]=g[7],I[8]=g[8],I[9]=g[9],I[10]=g[10],I[11]=g[11],I[12]=g[12],I[13]=g[13],I[14]=g[14],I[15]=g[15],I;}function u(g,I){return g[0]=I[0],g[1]=I[1],g[2]=I[2],g[3]=I[3],g[4]=I[4],g[5]=I[5],g[6]=I[6],g[7]=I[7],g[8]=I[8],g[9]=I[9],g[10]=I[10],g[11]=I[11],g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15],g;}function d(g,I,B,Z,st,ft,dt,ot,gt,St,Pt,Lt,Rt,Nt,$t,Ut){var Ft=new s.ARRAY_TYPE(16);return Ft[0]=g,Ft[1]=I,Ft[2]=B,Ft[3]=Z,Ft[4]=st,Ft[5]=ft,Ft[6]=dt,Ft[7]=ot,Ft[8]=gt,Ft[9]=St,Ft[10]=Pt,Ft[11]=Lt,Ft[12]=Rt,Ft[13]=Nt,Ft[14]=$t,Ft[15]=Ut,Ft;}function v(g,I,B,Z,st,ft,dt,ot,gt,St,Pt,Lt,Rt,Nt,$t,Ut,Ft){return g[0]=I,g[1]=B,g[2]=Z,g[3]=st,g[4]=ft,g[5]=dt,g[6]=ot,g[7]=gt,g[8]=St,g[9]=Pt,g[10]=Lt,g[11]=Rt,g[12]=Nt,g[13]=$t,g[14]=Ut,g[15]=Ft,g;}function p(g){return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function w(g,I){if(g===I){var B=I[1],Z=I[2],st=I[3],ft=I[6],dt=I[7],ot=I[11];g[1]=I[4],g[2]=I[8],g[3]=I[12],g[4]=B,g[6]=I[9],g[7]=I[13],g[8]=Z,g[9]=ft,g[11]=I[14],g[12]=st,g[13]=dt,g[14]=ot;}else g[0]=I[0],g[1]=I[4],g[2]=I[8],g[3]=I[12],g[4]=I[1],g[5]=I[5],g[6]=I[9],g[7]=I[13],g[8]=I[2],g[9]=I[6],g[10]=I[10],g[11]=I[14],g[12]=I[3],g[13]=I[7],g[14]=I[11],g[15]=I[15];return g;}function A(g,I){var B=I[0],Z=I[1],st=I[2],ft=I[3],dt=I[4],ot=I[5],gt=I[6],St=I[7],Pt=I[8],Lt=I[9],Rt=I[10],Nt=I[11],$t=I[12],Ut=I[13],Ft=I[14],Qt=I[15],ee=B*ot-Z*dt,re=B*gt-st*dt,se=B*St-ft*dt,oe=Z*gt-st*ot,le=Z*St-ft*ot,Oe=st*St-ft*gt,De=Pt*Ut-Lt*$t,Ne=Pt*Ft-Rt*$t,Be=Pt*Qt-Nt*$t,Ye=Lt*Ft-Rt*Ut,Ge=Lt*Qt-Nt*Ut,je=Rt*Qt-Nt*Ft,ye=ee*je-re*Ge+se*Ye+oe*Be-le*Ne+Oe*De;return ye?(ye=1/ye,g[0]=(ot*je-gt*Ge+St*Ye)*ye,g[1]=(st*Ge-Z*je-ft*Ye)*ye,g[2]=(Ut*Oe-Ft*le+Qt*oe)*ye,g[3]=(Rt*le-Lt*Oe-Nt*oe)*ye,g[4]=(gt*Be-dt*je-St*Ne)*ye,g[5]=(B*je-st*Be+ft*Ne)*ye,g[6]=(Ft*se-$t*Oe-Qt*re)*ye,g[7]=(Pt*Oe-Rt*se+Nt*re)*ye,g[8]=(dt*Ge-ot*Be+St*De)*ye,g[9]=(Z*Be-B*Ge-ft*De)*ye,g[10]=($t*le-Ut*se+Qt*ee)*ye,g[11]=(Lt*se-Pt*le-Nt*ee)*ye,g[12]=(ot*Ne-dt*Ye-gt*De)*ye,g[13]=(B*Ye-Z*Ne+st*De)*ye,g[14]=(Ut*re-$t*oe-Ft*ee)*ye,g[15]=(Pt*oe-Lt*re+Rt*ee)*ye,g):null;}function M(g,I){var B=I[0],Z=I[1],st=I[2],ft=I[3],dt=I[4],ot=I[5],gt=I[6],St=I[7],Pt=I[8],Lt=I[9],Rt=I[10],Nt=I[11],$t=I[12],Ut=I[13],Ft=I[14],Qt=I[15];return g[0]=ot*(Rt*Qt-Nt*Ft)-Lt*(gt*Qt-St*Ft)+Ut*(gt*Nt-St*Rt),g[1]=-(Z*(Rt*Qt-Nt*Ft)-Lt*(st*Qt-ft*Ft)+Ut*(st*Nt-ft*Rt)),g[2]=Z*(gt*Qt-St*Ft)-ot*(st*Qt-ft*Ft)+Ut*(st*St-ft*gt),g[3]=-(Z*(gt*Nt-St*Rt)-ot*(st*Nt-ft*Rt)+Lt*(st*St-ft*gt)),g[4]=-(dt*(Rt*Qt-Nt*Ft)-Pt*(gt*Qt-St*Ft)+$t*(gt*Nt-St*Rt)),g[5]=B*(Rt*Qt-Nt*Ft)-Pt*(st*Qt-ft*Ft)+$t*(st*Nt-ft*Rt),g[6]=-(B*(gt*Qt-St*Ft)-dt*(st*Qt-ft*Ft)+$t*(st*St-ft*gt)),g[7]=B*(gt*Nt-St*Rt)-dt*(st*Nt-ft*Rt)+Pt*(st*St-ft*gt),g[8]=dt*(Lt*Qt-Nt*Ut)-Pt*(ot*Qt-St*Ut)+$t*(ot*Nt-St*Lt),g[9]=-(B*(Lt*Qt-Nt*Ut)-Pt*(Z*Qt-ft*Ut)+$t*(Z*Nt-ft*Lt)),g[10]=B*(ot*Qt-St*Ut)-dt*(Z*Qt-ft*Ut)+$t*(Z*St-ft*ot),g[11]=-(B*(ot*Nt-St*Lt)-dt*(Z*Nt-ft*Lt)+Pt*(Z*St-ft*ot)),g[12]=-(dt*(Lt*Ft-Rt*Ut)-Pt*(ot*Ft-gt*Ut)+$t*(ot*Rt-gt*Lt)),g[13]=B*(Lt*Ft-Rt*Ut)-Pt*(Z*Ft-st*Ut)+$t*(Z*Rt-st*Lt),g[14]=-(B*(ot*Ft-gt*Ut)-dt*(Z*Ft-st*Ut)+$t*(Z*gt-st*ot)),g[15]=B*(ot*Rt-gt*Lt)-dt*(Z*Rt-st*Lt)+Pt*(Z*gt-st*ot),g;}function E(g){var I=g[0],B=g[1],Z=g[2],st=g[3],ft=g[4],dt=g[5],ot=g[6],gt=g[7],St=g[8],Pt=g[9],Lt=g[10],Rt=g[11],Nt=g[12],$t=g[13],Ut=g[14],Ft=g[15],Qt=I*dt-B*ft,ee=I*ot-Z*ft,re=I*gt-st*ft,se=B*ot-Z*dt,oe=B*gt-st*dt,le=Z*gt-st*ot,Oe=St*$t-Pt*Nt,De=St*Ut-Lt*Nt,Ne=St*Ft-Rt*Nt,Be=Pt*Ut-Lt*$t,Ye=Pt*Ft-Rt*$t,Ge=Lt*Ft-Rt*Ut;return Qt*Ge-ee*Ye+re*Be+se*Ne-oe*De+le*Oe;}function L(g,I,B){var Z=I[0],st=I[1],ft=I[2],dt=I[3],ot=I[4],gt=I[5],St=I[6],Pt=I[7],Lt=I[8],Rt=I[9],Nt=I[10],$t=I[11],Ut=I[12],Ft=I[13],Qt=I[14],ee=I[15],re=B[0],se=B[1],oe=B[2],le=B[3];return g[0]=re*Z+se*ot+oe*Lt+le*Ut,g[1]=re*st+se*gt+oe*Rt+le*Ft,g[2]=re*ft+se*St+oe*Nt+le*Qt,g[3]=re*dt+se*Pt+oe*$t+le*ee,re=B[4],se=B[5],oe=B[6],le=B[7],g[4]=re*Z+se*ot+oe*Lt+le*Ut,g[5]=re*st+se*gt+oe*Rt+le*Ft,g[6]=re*ft+se*St+oe*Nt+le*Qt,g[7]=re*dt+se*Pt+oe*$t+le*ee,re=B[8],se=B[9],oe=B[10],le=B[11],g[8]=re*Z+se*ot+oe*Lt+le*Ut,g[9]=re*st+se*gt+oe*Rt+le*Ft,g[10]=re*ft+se*St+oe*Nt+le*Qt,g[11]=re*dt+se*Pt+oe*$t+le*ee,re=B[12],se=B[13],oe=B[14],le=B[15],g[12]=re*Z+se*ot+oe*Lt+le*Ut,g[13]=re*st+se*gt+oe*Rt+le*Ft,g[14]=re*ft+se*St+oe*Nt+le*Qt,g[15]=re*dt+se*Pt+oe*$t+le*ee,g;}function G(g,I,B){var Z=B[0],st=B[1],ft=B[2],dt,ot,gt,St,Pt,Lt,Rt,Nt,$t,Ut,Ft,Qt;return I===g?(g[12]=I[0]*Z+I[4]*st+I[8]*ft+I[12],g[13]=I[1]*Z+I[5]*st+I[9]*ft+I[13],g[14]=I[2]*Z+I[6]*st+I[10]*ft+I[14],g[15]=I[3]*Z+I[7]*st+I[11]*ft+I[15]):(dt=I[0],ot=I[1],gt=I[2],St=I[3],Pt=I[4],Lt=I[5],Rt=I[6],Nt=I[7],$t=I[8],Ut=I[9],Ft=I[10],Qt=I[11],g[0]=dt,g[1]=ot,g[2]=gt,g[3]=St,g[4]=Pt,g[5]=Lt,g[6]=Rt,g[7]=Nt,g[8]=$t,g[9]=Ut,g[10]=Ft,g[11]=Qt,g[12]=dt*Z+Pt*st+$t*ft+I[12],g[13]=ot*Z+Lt*st+Ut*ft+I[13],g[14]=gt*Z+Rt*st+Ft*ft+I[14],g[15]=St*Z+Nt*st+Qt*ft+I[15]),g;}function z(g,I,B){var Z=B[0],st=B[1],ft=B[2];return g[0]=I[0]*Z,g[1]=I[1]*Z,g[2]=I[2]*Z,g[3]=I[3]*Z,g[4]=I[4]*st,g[5]=I[5]*st,g[6]=I[6]*st,g[7]=I[7]*st,g[8]=I[8]*ft,g[9]=I[9]*ft,g[10]=I[10]*ft,g[11]=I[11]*ft,g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15],g;}function et(g,I,B,Z){var st=Z[0],ft=Z[1],dt=Z[2],ot=Math.hypot(st,ft,dt),gt,St,Pt,Lt,Rt,Nt,$t,Ut,Ft,Qt,ee,re,se,oe,le,Oe,De,Ne,Be,Ye,Ge,je,ye,lr;return ot<s.EPSILON?null:(ot=1/ot,st*=ot,ft*=ot,dt*=ot,gt=Math.sin(B),St=Math.cos(B),Pt=1-St,Lt=I[0],Rt=I[1],Nt=I[2],$t=I[3],Ut=I[4],Ft=I[5],Qt=I[6],ee=I[7],re=I[8],se=I[9],oe=I[10],le=I[11],Oe=st*st*Pt+St,De=ft*st*Pt+dt*gt,Ne=dt*st*Pt-ft*gt,Be=st*ft*Pt-dt*gt,Ye=ft*ft*Pt+St,Ge=dt*ft*Pt+st*gt,je=st*dt*Pt+ft*gt,ye=ft*dt*Pt-st*gt,lr=dt*dt*Pt+St,g[0]=Lt*Oe+Ut*De+re*Ne,g[1]=Rt*Oe+Ft*De+se*Ne,g[2]=Nt*Oe+Qt*De+oe*Ne,g[3]=$t*Oe+ee*De+le*Ne,g[4]=Lt*Be+Ut*Ye+re*Ge,g[5]=Rt*Be+Ft*Ye+se*Ge,g[6]=Nt*Be+Qt*Ye+oe*Ge,g[7]=$t*Be+ee*Ye+le*Ge,g[8]=Lt*je+Ut*ye+re*lr,g[9]=Rt*je+Ft*ye+se*lr,g[10]=Nt*je+Qt*ye+oe*lr,g[11]=$t*je+ee*ye+le*lr,I!==g&&(g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15]),g);}function x(g,I,B){var Z=Math.sin(B),st=Math.cos(B),ft=I[4],dt=I[5],ot=I[6],gt=I[7],St=I[8],Pt=I[9],Lt=I[10],Rt=I[11];return I!==g&&(g[0]=I[0],g[1]=I[1],g[2]=I[2],g[3]=I[3],g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15]),g[4]=ft*st+St*Z,g[5]=dt*st+Pt*Z,g[6]=ot*st+Lt*Z,g[7]=gt*st+Rt*Z,g[8]=St*st-ft*Z,g[9]=Pt*st-dt*Z,g[10]=Lt*st-ot*Z,g[11]=Rt*st-gt*Z,g;}function y(g,I,B){var Z=Math.sin(B),st=Math.cos(B),ft=I[0],dt=I[1],ot=I[2],gt=I[3],St=I[8],Pt=I[9],Lt=I[10],Rt=I[11];return I!==g&&(g[4]=I[4],g[5]=I[5],g[6]=I[6],g[7]=I[7],g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15]),g[0]=ft*st-St*Z,g[1]=dt*st-Pt*Z,g[2]=ot*st-Lt*Z,g[3]=gt*st-Rt*Z,g[8]=ft*Z+St*st,g[9]=dt*Z+Pt*st,g[10]=ot*Z+Lt*st,g[11]=gt*Z+Rt*st,g;}function S(g,I,B){var Z=Math.sin(B),st=Math.cos(B),ft=I[0],dt=I[1],ot=I[2],gt=I[3],St=I[4],Pt=I[5],Lt=I[6],Rt=I[7];return I!==g&&(g[8]=I[8],g[9]=I[9],g[10]=I[10],g[11]=I[11],g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15]),g[0]=ft*st+St*Z,g[1]=dt*st+Pt*Z,g[2]=ot*st+Lt*Z,g[3]=gt*st+Rt*Z,g[4]=St*st-ft*Z,g[5]=Pt*st-dt*Z,g[6]=Lt*st-ot*Z,g[7]=Rt*st-gt*Z,g;}function C(g,I){return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=I[0],g[13]=I[1],g[14]=I[2],g[15]=1,g;}function P(g,I){return g[0]=I[0],g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=I[1],g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=I[2],g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function X(g,I,B){var Z=B[0],st=B[1],ft=B[2],dt=Math.hypot(Z,st,ft),ot,gt,St;return dt<s.EPSILON?null:(dt=1/dt,Z*=dt,st*=dt,ft*=dt,ot=Math.sin(I),gt=Math.cos(I),St=1-gt,g[0]=Z*Z*St+gt,g[1]=st*Z*St+ft*ot,g[2]=ft*Z*St-st*ot,g[3]=0,g[4]=Z*st*St-ft*ot,g[5]=st*st*St+gt,g[6]=ft*st*St+Z*ot,g[7]=0,g[8]=Z*ft*St+st*ot,g[9]=st*ft*St-Z*ot,g[10]=ft*ft*St+gt,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g);}function $(g,I){var B=Math.sin(I),Z=Math.cos(I);return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=Z,g[6]=B,g[7]=0,g[8]=0,g[9]=-B,g[10]=Z,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function K(g,I){var B=Math.sin(I),Z=Math.cos(I);return g[0]=Z,g[1]=0,g[2]=-B,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=B,g[9]=0,g[10]=Z,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function j(g,I){var B=Math.sin(I),Z=Math.cos(I);return g[0]=Z,g[1]=B,g[2]=0,g[3]=0,g[4]=-B,g[5]=Z,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function nt(g,I,B){var Z=I[0],st=I[1],ft=I[2],dt=I[3],ot=Z+Z,gt=st+st,St=ft+ft,Pt=Z*ot,Lt=Z*gt,Rt=Z*St,Nt=st*gt,$t=st*St,Ut=ft*St,Ft=dt*ot,Qt=dt*gt,ee=dt*St;return g[0]=1-(Nt+Ut),g[1]=Lt+ee,g[2]=Rt-Qt,g[3]=0,g[4]=Lt-ee,g[5]=1-(Pt+Ut),g[6]=$t+Ft,g[7]=0,g[8]=Rt+Qt,g[9]=$t-Ft,g[10]=1-(Pt+Nt),g[11]=0,g[12]=B[0],g[13]=B[1],g[14]=B[2],g[15]=1,g;}function ct(g,I){var B=new s.ARRAY_TYPE(3),Z=-I[0],st=-I[1],ft=-I[2],dt=I[3],ot=I[4],gt=I[5],St=I[6],Pt=I[7],Lt=Z*Z+st*st+ft*ft+dt*dt;return Lt>0?(B[0]=(ot*dt+Pt*Z+gt*ft-St*st)*2/Lt,B[1]=(gt*dt+Pt*st+St*Z-ot*ft)*2/Lt,B[2]=(St*dt+Pt*ft+ot*st-gt*Z)*2/Lt):(B[0]=(ot*dt+Pt*Z+gt*ft-St*st)*2,B[1]=(gt*dt+Pt*st+St*Z-ot*ft)*2,B[2]=(St*dt+Pt*ft+ot*st-gt*Z)*2),nt(g,I,B),g;}function F(g,I){return g[0]=I[12],g[1]=I[13],g[2]=I[14],g;}function R(g,I){var B=I[0],Z=I[1],st=I[2],ft=I[4],dt=I[5],ot=I[6],gt=I[8],St=I[9],Pt=I[10];return g[0]=Math.hypot(B,Z,st),g[1]=Math.hypot(ft,dt,ot),g[2]=Math.hypot(gt,St,Pt),g;}function Y(g,I){var B=new s.ARRAY_TYPE(3);R(B,I);var Z=1/B[0],st=1/B[1],ft=1/B[2],dt=I[0]*Z,ot=I[1]*st,gt=I[2]*ft,St=I[4]*Z,Pt=I[5]*st,Lt=I[6]*ft,Rt=I[8]*Z,Nt=I[9]*st,$t=I[10]*ft,Ut=dt+Pt+$t,Ft=0;return Ut>0?(Ft=Math.sqrt(Ut+1)*2,g[3]=0.25*Ft,g[0]=(Lt-Nt)/Ft,g[1]=(Rt-gt)/Ft,g[2]=(ot-St)/Ft):dt>Pt&&dt>$t?(Ft=Math.sqrt(1+dt-Pt-$t)*2,g[3]=(Lt-Nt)/Ft,g[0]=0.25*Ft,g[1]=(ot+St)/Ft,g[2]=(Rt+gt)/Ft):Pt>$t?(Ft=Math.sqrt(1+Pt-dt-$t)*2,g[3]=(Rt-gt)/Ft,g[0]=(ot+St)/Ft,g[1]=0.25*Ft,g[2]=(Lt+Nt)/Ft):(Ft=Math.sqrt(1+$t-dt-Pt)*2,g[3]=(ot-St)/Ft,g[0]=(Rt+gt)/Ft,g[1]=(Lt+Nt)/Ft,g[2]=0.25*Ft),g;}function q(g,I,B,Z){var st=I[0],ft=I[1],dt=I[2],ot=I[3],gt=st+st,St=ft+ft,Pt=dt+dt,Lt=st*gt,Rt=st*St,Nt=st*Pt,$t=ft*St,Ut=ft*Pt,Ft=dt*Pt,Qt=ot*gt,ee=ot*St,re=ot*Pt,se=Z[0],oe=Z[1],le=Z[2];return g[0]=(1-($t+Ft))*se,g[1]=(Rt+re)*se,g[2]=(Nt-ee)*se,g[3]=0,g[4]=(Rt-re)*oe,g[5]=(1-(Lt+Ft))*oe,g[6]=(Ut+Qt)*oe,g[7]=0,g[8]=(Nt+ee)*le,g[9]=(Ut-Qt)*le,g[10]=(1-(Lt+$t))*le,g[11]=0,g[12]=B[0],g[13]=B[1],g[14]=B[2],g[15]=1,g;}function lt(g,I,B,Z,st){var ft=I[0],dt=I[1],ot=I[2],gt=I[3],St=ft+ft,Pt=dt+dt,Lt=ot+ot,Rt=ft*St,Nt=ft*Pt,$t=ft*Lt,Ut=dt*Pt,Ft=dt*Lt,Qt=ot*Lt,ee=gt*St,re=gt*Pt,se=gt*Lt,oe=Z[0],le=Z[1],Oe=Z[2],De=st[0],Ne=st[1],Be=st[2],Ye=(1-(Ut+Qt))*oe,Ge=(Nt+se)*oe,je=($t-re)*oe,ye=(Nt-se)*le,lr=(1-(Rt+Qt))*le,tn=(Ft+ee)*le,en=($t+re)*Oe,Yn=(Ft-ee)*Oe,jn=(1-(Rt+Ut))*Oe;return g[0]=Ye,g[1]=Ge,g[2]=je,g[3]=0,g[4]=ye,g[5]=lr,g[6]=tn,g[7]=0,g[8]=en,g[9]=Yn,g[10]=jn,g[11]=0,g[12]=B[0]+De-(Ye*De+ye*Ne+en*Be),g[13]=B[1]+Ne-(Ge*De+lr*Ne+Yn*Be),g[14]=B[2]+Be-(je*De+tn*Ne+jn*Be),g[15]=1,g;}function ut(g,I){var B=I[0],Z=I[1],st=I[2],ft=I[3],dt=B+B,ot=Z+Z,gt=st+st,St=B*dt,Pt=Z*dt,Lt=Z*ot,Rt=st*dt,Nt=st*ot,$t=st*gt,Ut=ft*dt,Ft=ft*ot,Qt=ft*gt;return g[0]=1-Lt-$t,g[1]=Pt+Qt,g[2]=Rt-Ft,g[3]=0,g[4]=Pt-Qt,g[5]=1-St-$t,g[6]=Nt+Ut,g[7]=0,g[8]=Rt+Ft,g[9]=Nt-Ut,g[10]=1-St-Lt,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function Tt(g,I,B,Z,st,ft,dt){var ot=1/(B-I),gt=1/(st-Z),St=1/(ft-dt);return g[0]=ft*2*ot,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=ft*2*gt,g[6]=0,g[7]=0,g[8]=(B+I)*ot,g[9]=(st+Z)*gt,g[10]=(dt+ft)*St,g[11]=-1,g[12]=0,g[13]=0,g[14]=dt*ft*2*St,g[15]=0,g;}function O(g,I,B,Z,st){var ft=1/Math.tan(I/2),dt;return g[0]=ft/B,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=ft,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[11]=-1,g[12]=0,g[13]=0,g[15]=0,st!=null&&st!==1/0?(dt=1/(Z-st),g[10]=(st+Z)*dt,g[14]=2*st*Z*dt):(g[10]=-1,g[14]=-2*Z),g;}function U(g,I,B,Z){var st=Math.tan(I.upDegrees*Math.PI/180),ft=Math.tan(I.downDegrees*Math.PI/180),dt=Math.tan(I.leftDegrees*Math.PI/180),ot=Math.tan(I.rightDegrees*Math.PI/180),gt=2/(dt+ot),St=2/(st+ft);return g[0]=gt,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=St,g[6]=0,g[7]=0,g[8]=-((dt-ot)*gt*0.5),g[9]=(st-ft)*St*0.5,g[10]=Z/(B-Z),g[11]=-1,g[12]=0,g[13]=0,g[14]=Z*B/(B-Z),g[15]=0,g;}function _(g,I,B,Z,st,ft,dt){var ot=1/(I-B),gt=1/(Z-st),St=1/(ft-dt);return g[0]=-2*ot,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=-2*gt,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=2*St,g[11]=0,g[12]=(I+B)*ot,g[13]=(st+Z)*gt,g[14]=(dt+ft)*St,g[15]=1,g;}function H(g,I,B,Z){var st,ft,dt,ot,gt,St,Pt,Lt,Rt,Nt,$t=I[0],Ut=I[1],Ft=I[2],Qt=Z[0],ee=Z[1],re=Z[2],se=B[0],oe=B[1],le=B[2];return Math.abs($t-se)<s.EPSILON&&Math.abs(Ut-oe)<s.EPSILON&&Math.abs(Ft-le)<s.EPSILON?p(g):(Pt=$t-se,Lt=Ut-oe,Rt=Ft-le,Nt=1/Math.hypot(Pt,Lt,Rt),Pt*=Nt,Lt*=Nt,Rt*=Nt,st=ee*Rt-re*Lt,ft=re*Pt-Qt*Rt,dt=Qt*Lt-ee*Pt,Nt=Math.hypot(st,ft,dt),Nt?(Nt=1/Nt,st*=Nt,ft*=Nt,dt*=Nt):(st=0,ft=0,dt=0),ot=Lt*dt-Rt*ft,gt=Rt*st-Pt*dt,St=Pt*ft-Lt*st,Nt=Math.hypot(ot,gt,St),Nt?(Nt=1/Nt,ot*=Nt,gt*=Nt,St*=Nt):(ot=0,gt=0,St=0),g[0]=st,g[1]=ot,g[2]=Pt,g[3]=0,g[4]=ft,g[5]=gt,g[6]=Lt,g[7]=0,g[8]=dt,g[9]=St,g[10]=Rt,g[11]=0,g[12]=-(st*$t+ft*Ut+dt*Ft),g[13]=-(ot*$t+gt*Ut+St*Ft),g[14]=-(Pt*$t+Lt*Ut+Rt*Ft),g[15]=1,g);}function at(g,I,B,Z){var st=I[0],ft=I[1],dt=I[2],ot=Z[0],gt=Z[1],St=Z[2],Pt=st-B[0],Lt=ft-B[1],Rt=dt-B[2],Nt=Pt*Pt+Lt*Lt+Rt*Rt;Nt>0&&(Nt=1/Math.sqrt(Nt),Pt*=Nt,Lt*=Nt,Rt*=Nt);var $t=gt*Rt-St*Lt,Ut=St*Pt-ot*Rt,Ft=ot*Lt-gt*Pt;return Nt=$t*$t+Ut*Ut+Ft*Ft,Nt>0&&(Nt=1/Math.sqrt(Nt),$t*=Nt,Ut*=Nt,Ft*=Nt),g[0]=$t,g[1]=Ut,g[2]=Ft,g[3]=0,g[4]=Lt*Ft-Rt*Ut,g[5]=Rt*$t-Pt*Ft,g[6]=Pt*Ut-Lt*$t,g[7]=0,g[8]=Pt,g[9]=Lt,g[10]=Rt,g[11]=0,g[12]=st,g[13]=ft,g[14]=dt,g[15]=1,g;}function ht(g){return"mat4("+g[0]+", "+g[1]+", "+g[2]+", "+g[3]+", "+g[4]+", "+g[5]+", "+g[6]+", "+g[7]+", "+g[8]+", "+g[9]+", "+g[10]+", "+g[11]+", "+g[12]+", "+g[13]+", "+g[14]+", "+g[15]+")";}function yt(g){return Math.hypot(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]);}function Et(g,I,B){return g[0]=I[0]+B[0],g[1]=I[1]+B[1],g[2]=I[2]+B[2],g[3]=I[3]+B[3],g[4]=I[4]+B[4],g[5]=I[5]+B[5],g[6]=I[6]+B[6],g[7]=I[7]+B[7],g[8]=I[8]+B[8],g[9]=I[9]+B[9],g[10]=I[10]+B[10],g[11]=I[11]+B[11],g[12]=I[12]+B[12],g[13]=I[13]+B[13],g[14]=I[14]+B[14],g[15]=I[15]+B[15],g;}function Dt(g,I,B){return g[0]=I[0]-B[0],g[1]=I[1]-B[1],g[2]=I[2]-B[2],g[3]=I[3]-B[3],g[4]=I[4]-B[4],g[5]=I[5]-B[5],g[6]=I[6]-B[6],g[7]=I[7]-B[7],g[8]=I[8]-B[8],g[9]=I[9]-B[9],g[10]=I[10]-B[10],g[11]=I[11]-B[11],g[12]=I[12]-B[12],g[13]=I[13]-B[13],g[14]=I[14]-B[14],g[15]=I[15]-B[15],g;}function D(g,I,B){return g[0]=I[0]*B,g[1]=I[1]*B,g[2]=I[2]*B,g[3]=I[3]*B,g[4]=I[4]*B,g[5]=I[5]*B,g[6]=I[6]*B,g[7]=I[7]*B,g[8]=I[8]*B,g[9]=I[9]*B,g[10]=I[10]*B,g[11]=I[11]*B,g[12]=I[12]*B,g[13]=I[13]*B,g[14]=I[14]*B,g[15]=I[15]*B,g;}function N(g,I,B,Z){return g[0]=I[0]+B[0]*Z,g[1]=I[1]+B[1]*Z,g[2]=I[2]+B[2]*Z,g[3]=I[3]+B[3]*Z,g[4]=I[4]+B[4]*Z,g[5]=I[5]+B[5]*Z,g[6]=I[6]+B[6]*Z,g[7]=I[7]+B[7]*Z,g[8]=I[8]+B[8]*Z,g[9]=I[9]+B[9]*Z,g[10]=I[10]+B[10]*Z,g[11]=I[11]+B[11]*Z,g[12]=I[12]+B[12]*Z,g[13]=I[13]+B[13]*Z,g[14]=I[14]+B[14]*Z,g[15]=I[15]+B[15]*Z,g;}function J(g,I){return g[0]===I[0]&&g[1]===I[1]&&g[2]===I[2]&&g[3]===I[3]&&g[4]===I[4]&&g[5]===I[5]&&g[6]===I[6]&&g[7]===I[7]&&g[8]===I[8]&&g[9]===I[9]&&g[10]===I[10]&&g[11]===I[11]&&g[12]===I[12]&&g[13]===I[13]&&g[14]===I[14]&&g[15]===I[15];}function Q(g,I){var B=g[0],Z=g[1],st=g[2],ft=g[3],dt=g[4],ot=g[5],gt=g[6],St=g[7],Pt=g[8],Lt=g[9],Rt=g[10],Nt=g[11],$t=g[12],Ut=g[13],Ft=g[14],Qt=g[15],ee=I[0],re=I[1],se=I[2],oe=I[3],le=I[4],Oe=I[5],De=I[6],Ne=I[7],Be=I[8],Ye=I[9],Ge=I[10],je=I[11],ye=I[12],lr=I[13],tn=I[14],en=I[15];return Math.abs(B-ee)<=s.EPSILON*Math.max(1,Math.abs(B),Math.abs(ee))&&Math.abs(Z-re)<=s.EPSILON*Math.max(1,Math.abs(Z),Math.abs(re))&&Math.abs(st-se)<=s.EPSILON*Math.max(1,Math.abs(st),Math.abs(se))&&Math.abs(ft-oe)<=s.EPSILON*Math.max(1,Math.abs(ft),Math.abs(oe))&&Math.abs(dt-le)<=s.EPSILON*Math.max(1,Math.abs(dt),Math.abs(le))&&Math.abs(ot-Oe)<=s.EPSILON*Math.max(1,Math.abs(ot),Math.abs(Oe))&&Math.abs(gt-De)<=s.EPSILON*Math.max(1,Math.abs(gt),Math.abs(De))&&Math.abs(St-Ne)<=s.EPSILON*Math.max(1,Math.abs(St),Math.abs(Ne))&&Math.abs(Pt-Be)<=s.EPSILON*Math.max(1,Math.abs(Pt),Math.abs(Be))&&Math.abs(Lt-Ye)<=s.EPSILON*Math.max(1,Math.abs(Lt),Math.abs(Ye))&&Math.abs(Rt-Ge)<=s.EPSILON*Math.max(1,Math.abs(Rt),Math.abs(Ge))&&Math.abs(Nt-je)<=s.EPSILON*Math.max(1,Math.abs(Nt),Math.abs(je))&&Math.abs($t-ye)<=s.EPSILON*Math.max(1,Math.abs($t),Math.abs(ye))&&Math.abs(Ut-lr)<=s.EPSILON*Math.max(1,Math.abs(Ut),Math.abs(lr))&&Math.abs(Ft-tn)<=s.EPSILON*Math.max(1,Math.abs(Ft),Math.abs(tn))&&Math.abs(Qt-en)<=s.EPSILON*Math.max(1,Math.abs(Qt),Math.abs(en));}var V=L,tt=Dt;},/* 7 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return d;}),i.d(n,"identity",function(){return v;}),i.d(n,"setAxisAngle",function(){return p;}),i.d(n,"getAxisAngle",function(){return w;}),i.d(n,"getAngle",function(){return A;}),i.d(n,"multiply",function(){return M;}),i.d(n,"rotateX",function(){return E;}),i.d(n,"rotateY",function(){return L;}),i.d(n,"rotateZ",function(){return G;}),i.d(n,"calculateW",function(){return z;}),i.d(n,"exp",function(){return et;}),i.d(n,"ln",function(){return x;}),i.d(n,"pow",function(){return y;}),i.d(n,"slerp",function(){return S;}),i.d(n,"random",function(){return C;}),i.d(n,"invert",function(){return P;}),i.d(n,"conjugate",function(){return X;}),i.d(n,"fromMat3",function(){return $;}),i.d(n,"fromEuler",function(){return K;}),i.d(n,"str",function(){return j;}),i.d(n,"clone",function(){return nt;}),i.d(n,"fromValues",function(){return ct;}),i.d(n,"copy",function(){return F;}),i.d(n,"set",function(){return R;}),i.d(n,"add",function(){return Y;}),i.d(n,"mul",function(){return q;}),i.d(n,"scale",function(){return lt;}),i.d(n,"dot",function(){return ut;}),i.d(n,"lerp",function(){return Tt;}),i.d(n,"length",function(){return O;}),i.d(n,"len",function(){return U;}),i.d(n,"squaredLength",function(){return _;}),i.d(n,"sqrLen",function(){return H;}),i.d(n,"normalize",function(){return at;}),i.d(n,"exactEquals",function(){return ht;}),i.d(n,"equals",function(){return yt;}),i.d(n,"rotationTo",function(){return Et;}),i.d(n,"sqlerp",function(){return Dt;}),i.d(n,"setAxes",function(){return D;});var s=i(2),o=i(5),a=i(8),u=i(9);function d(){var N=new s.ARRAY_TYPE(4);return s.ARRAY_TYPE!=Float32Array&&(N[0]=0,N[1]=0,N[2]=0),N[3]=1,N;}function v(N){return N[0]=0,N[1]=0,N[2]=0,N[3]=1,N;}function p(N,J,Q){Q=Q*0.5;var V=Math.sin(Q);return N[0]=V*J[0],N[1]=V*J[1],N[2]=V*J[2],N[3]=Math.cos(Q),N;}function w(N,J){var Q=Math.acos(J[3])*2,V=Math.sin(Q/2);return V>s.EPSILON?(N[0]=J[0]/V,N[1]=J[1]/V,N[2]=J[2]/V):(N[0]=1,N[1]=0,N[2]=0),Q;}function A(N,J){var Q=ut(N,J);return Math.acos(2*Q*Q-1);}function M(N,J,Q){var V=J[0],tt=J[1],g=J[2],I=J[3],B=Q[0],Z=Q[1],st=Q[2],ft=Q[3];return N[0]=V*ft+I*B+tt*st-g*Z,N[1]=tt*ft+I*Z+g*B-V*st,N[2]=g*ft+I*st+V*Z-tt*B,N[3]=I*ft-V*B-tt*Z-g*st,N;}function E(N,J,Q){Q*=0.5;var V=J[0],tt=J[1],g=J[2],I=J[3],B=Math.sin(Q),Z=Math.cos(Q);return N[0]=V*Z+I*B,N[1]=tt*Z+g*B,N[2]=g*Z-tt*B,N[3]=I*Z-V*B,N;}function L(N,J,Q){Q*=0.5;var V=J[0],tt=J[1],g=J[2],I=J[3],B=Math.sin(Q),Z=Math.cos(Q);return N[0]=V*Z-g*B,N[1]=tt*Z+I*B,N[2]=g*Z+V*B,N[3]=I*Z-tt*B,N;}function G(N,J,Q){Q*=0.5;var V=J[0],tt=J[1],g=J[2],I=J[3],B=Math.sin(Q),Z=Math.cos(Q);return N[0]=V*Z+tt*B,N[1]=tt*Z-V*B,N[2]=g*Z+I*B,N[3]=I*Z-g*B,N;}function z(N,J){var Q=J[0],V=J[1],tt=J[2];return N[0]=Q,N[1]=V,N[2]=tt,N[3]=Math.sqrt(Math.abs(1-Q*Q-V*V-tt*tt)),N;}function et(N,J){var Q=J[0],V=J[1],tt=J[2],g=J[3],I=Math.sqrt(Q*Q+V*V+tt*tt),B=Math.exp(g),Z=I>0?B*Math.sin(I)/I:0;return N[0]=Q*Z,N[1]=V*Z,N[2]=tt*Z,N[3]=B*Math.cos(I),N;}function x(N,J){var Q=J[0],V=J[1],tt=J[2],g=J[3],I=Math.sqrt(Q*Q+V*V+tt*tt),B=I>0?Math.atan2(I,g)/I:0;return N[0]=Q*B,N[1]=V*B,N[2]=tt*B,N[3]=0.5*Math.log(Q*Q+V*V+tt*tt+g*g),N;}function y(N,J,Q){return x(N,J),lt(N,N,Q),et(N,N),N;}function S(N,J,Q,V){var tt=J[0],g=J[1],I=J[2],B=J[3],Z=Q[0],st=Q[1],ft=Q[2],dt=Q[3],ot,gt,St,Pt,Lt;return gt=tt*Z+g*st+I*ft+B*dt,gt<0&&(gt=-gt,Z=-Z,st=-st,ft=-ft,dt=-dt),1-gt>s.EPSILON?(ot=Math.acos(gt),St=Math.sin(ot),Pt=Math.sin((1-V)*ot)/St,Lt=Math.sin(V*ot)/St):(Pt=1-V,Lt=V),N[0]=Pt*tt+Lt*Z,N[1]=Pt*g+Lt*st,N[2]=Pt*I+Lt*ft,N[3]=Pt*B+Lt*dt,N;}function C(N){var J=s.RANDOM(),Q=s.RANDOM(),V=s.RANDOM(),tt=Math.sqrt(1-J),g=Math.sqrt(J);return N[0]=tt*Math.sin(2*Math.PI*Q),N[1]=tt*Math.cos(2*Math.PI*Q),N[2]=g*Math.sin(2*Math.PI*V),N[3]=g*Math.cos(2*Math.PI*V),N;}function P(N,J){var Q=J[0],V=J[1],tt=J[2],g=J[3],I=Q*Q+V*V+tt*tt+g*g,B=I?1/I:0;return N[0]=-Q*B,N[1]=-V*B,N[2]=-tt*B,N[3]=g*B,N;}function X(N,J){return N[0]=-J[0],N[1]=-J[1],N[2]=-J[2],N[3]=J[3],N;}function $(N,J){var Q=J[0]+J[4]+J[8],V;if(Q>0)V=Math.sqrt(Q+1),N[3]=0.5*V,V=0.5/V,N[0]=(J[5]-J[7])*V,N[1]=(J[6]-J[2])*V,N[2]=(J[1]-J[3])*V;else{var tt=0;J[4]>J[0]&&(tt=1),J[8]>J[tt*3+tt]&&(tt=2);var g=(tt+1)%3,I=(tt+2)%3;V=Math.sqrt(J[tt*3+tt]-J[g*3+g]-J[I*3+I]+1),N[tt]=0.5*V,V=0.5/V,N[3]=(J[g*3+I]-J[I*3+g])*V,N[g]=(J[g*3+tt]+J[tt*3+g])*V,N[I]=(J[I*3+tt]+J[tt*3+I])*V;}return N;}function K(N,J,Q,V){var tt=0.5*Math.PI/180;J*=tt,Q*=tt,V*=tt;var g=Math.sin(J),I=Math.cos(J),B=Math.sin(Q),Z=Math.cos(Q),st=Math.sin(V),ft=Math.cos(V);return N[0]=g*Z*ft-I*B*st,N[1]=I*B*ft+g*Z*st,N[2]=I*Z*st-g*B*ft,N[3]=I*Z*ft+g*B*st,N;}function j(N){return"quat("+N[0]+", "+N[1]+", "+N[2]+", "+N[3]+")";}var nt=u.clone,ct=u.fromValues,F=u.copy,R=u.set,Y=u.add,q=M,lt=u.scale,ut=u.dot,Tt=u.lerp,O=u.length,U=O,_=u.squaredLength,H=_,at=u.normalize,ht=u.exactEquals,yt=u.equals,Et=function(){var N=a.create(),J=a.fromValues(1,0,0),Q=a.fromValues(0,1,0);return function(V,tt,g){var I=a.dot(tt,g);return I<-0.999999?(a.cross(N,J,tt),a.len(N)<1e-6&&a.cross(N,Q,tt),a.normalize(N,N),p(V,N,Math.PI),V):I>0.999999?(V[0]=0,V[1]=0,V[2]=0,V[3]=1,V):(a.cross(N,tt,g),V[0]=N[0],V[1]=N[1],V[2]=N[2],V[3]=1+I,at(V,V));};}(),Dt=function(){var N=d(),J=d();return function(Q,V,tt,g,I,B){return S(N,V,I,B),S(J,tt,g,B),S(Q,N,J,2*B*(1-B)),Q;};}(),D=function(){var N=o.create();return function(J,Q,V,tt){return N[0]=V[0],N[3]=V[1],N[6]=V[2],N[1]=tt[0],N[4]=tt[1],N[7]=tt[2],N[2]=-Q[0],N[5]=-Q[1],N[8]=-Q[2],at(J,$(J,N));};}();},/* 8 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"length",function(){return u;}),i.d(n,"fromValues",function(){return d;}),i.d(n,"copy",function(){return v;}),i.d(n,"set",function(){return p;}),i.d(n,"add",function(){return w;}),i.d(n,"subtract",function(){return A;}),i.d(n,"multiply",function(){return M;}),i.d(n,"divide",function(){return E;}),i.d(n,"ceil",function(){return L;}),i.d(n,"floor",function(){return G;}),i.d(n,"min",function(){return z;}),i.d(n,"max",function(){return et;}),i.d(n,"round",function(){return x;}),i.d(n,"scale",function(){return y;}),i.d(n,"scaleAndAdd",function(){return S;}),i.d(n,"distance",function(){return C;}),i.d(n,"squaredDistance",function(){return P;}),i.d(n,"squaredLength",function(){return X;}),i.d(n,"negate",function(){return $;}),i.d(n,"inverse",function(){return K;}),i.d(n,"normalize",function(){return j;}),i.d(n,"dot",function(){return nt;}),i.d(n,"cross",function(){return ct;}),i.d(n,"lerp",function(){return F;}),i.d(n,"hermite",function(){return R;}),i.d(n,"bezier",function(){return Y;}),i.d(n,"random",function(){return q;}),i.d(n,"transformMat4",function(){return lt;}),i.d(n,"transformMat3",function(){return ut;}),i.d(n,"transformQuat",function(){return Tt;}),i.d(n,"rotateX",function(){return O;}),i.d(n,"rotateY",function(){return U;}),i.d(n,"rotateZ",function(){return _;}),i.d(n,"angle",function(){return H;}),i.d(n,"zero",function(){return at;}),i.d(n,"str",function(){return ht;}),i.d(n,"exactEquals",function(){return yt;}),i.d(n,"equals",function(){return Et;}),i.d(n,"sub",function(){return Dt;}),i.d(n,"mul",function(){return D;}),i.d(n,"div",function(){return N;}),i.d(n,"dist",function(){return J;}),i.d(n,"sqrDist",function(){return Q;}),i.d(n,"len",function(){return V;}),i.d(n,"sqrLen",function(){return tt;}),i.d(n,"forEach",function(){return g;});var s=i(2);function o(){var I=new s.ARRAY_TYPE(3);return s.ARRAY_TYPE!=Float32Array&&(I[0]=0,I[1]=0,I[2]=0),I;}function a(I){var B=new s.ARRAY_TYPE(3);return B[0]=I[0],B[1]=I[1],B[2]=I[2],B;}function u(I){var B=I[0],Z=I[1],st=I[2];return Math.hypot(B,Z,st);}function d(I,B,Z){var st=new s.ARRAY_TYPE(3);return st[0]=I,st[1]=B,st[2]=Z,st;}function v(I,B){return I[0]=B[0],I[1]=B[1],I[2]=B[2],I;}function p(I,B,Z,st){return I[0]=B,I[1]=Z,I[2]=st,I;}function w(I,B,Z){return I[0]=B[0]+Z[0],I[1]=B[1]+Z[1],I[2]=B[2]+Z[2],I;}function A(I,B,Z){return I[0]=B[0]-Z[0],I[1]=B[1]-Z[1],I[2]=B[2]-Z[2],I;}function M(I,B,Z){return I[0]=B[0]*Z[0],I[1]=B[1]*Z[1],I[2]=B[2]*Z[2],I;}function E(I,B,Z){return I[0]=B[0]/Z[0],I[1]=B[1]/Z[1],I[2]=B[2]/Z[2],I;}function L(I,B){return I[0]=Math.ceil(B[0]),I[1]=Math.ceil(B[1]),I[2]=Math.ceil(B[2]),I;}function G(I,B){return I[0]=Math.floor(B[0]),I[1]=Math.floor(B[1]),I[2]=Math.floor(B[2]),I;}function z(I,B,Z){return I[0]=Math.min(B[0],Z[0]),I[1]=Math.min(B[1],Z[1]),I[2]=Math.min(B[2],Z[2]),I;}function et(I,B,Z){return I[0]=Math.max(B[0],Z[0]),I[1]=Math.max(B[1],Z[1]),I[2]=Math.max(B[2],Z[2]),I;}function x(I,B){return I[0]=Math.round(B[0]),I[1]=Math.round(B[1]),I[2]=Math.round(B[2]),I;}function y(I,B,Z){return I[0]=B[0]*Z,I[1]=B[1]*Z,I[2]=B[2]*Z,I;}function S(I,B,Z,st){return I[0]=B[0]+Z[0]*st,I[1]=B[1]+Z[1]*st,I[2]=B[2]+Z[2]*st,I;}function C(I,B){var Z=B[0]-I[0],st=B[1]-I[1],ft=B[2]-I[2];return Math.hypot(Z,st,ft);}function P(I,B){var Z=B[0]-I[0],st=B[1]-I[1],ft=B[2]-I[2];return Z*Z+st*st+ft*ft;}function X(I){var B=I[0],Z=I[1],st=I[2];return B*B+Z*Z+st*st;}function $(I,B){return I[0]=-B[0],I[1]=-B[1],I[2]=-B[2],I;}function K(I,B){return I[0]=1/B[0],I[1]=1/B[1],I[2]=1/B[2],I;}function j(I,B){var Z=B[0],st=B[1],ft=B[2],dt=Z*Z+st*st+ft*ft;return dt>0&&(dt=1/Math.sqrt(dt)),I[0]=B[0]*dt,I[1]=B[1]*dt,I[2]=B[2]*dt,I;}function nt(I,B){return I[0]*B[0]+I[1]*B[1]+I[2]*B[2];}function ct(I,B,Z){var st=B[0],ft=B[1],dt=B[2],ot=Z[0],gt=Z[1],St=Z[2];return I[0]=ft*St-dt*gt,I[1]=dt*ot-st*St,I[2]=st*gt-ft*ot,I;}function F(I,B,Z,st){var ft=B[0],dt=B[1],ot=B[2];return I[0]=ft+st*(Z[0]-ft),I[1]=dt+st*(Z[1]-dt),I[2]=ot+st*(Z[2]-ot),I;}function R(I,B,Z,st,ft,dt){var ot=dt*dt,gt=ot*(2*dt-3)+1,St=ot*(dt-2)+dt,Pt=ot*(dt-1),Lt=ot*(3-2*dt);return I[0]=B[0]*gt+Z[0]*St+st[0]*Pt+ft[0]*Lt,I[1]=B[1]*gt+Z[1]*St+st[1]*Pt+ft[1]*Lt,I[2]=B[2]*gt+Z[2]*St+st[2]*Pt+ft[2]*Lt,I;}function Y(I,B,Z,st,ft,dt){var ot=1-dt,gt=ot*ot,St=dt*dt,Pt=gt*ot,Lt=3*dt*gt,Rt=3*St*ot,Nt=St*dt;return I[0]=B[0]*Pt+Z[0]*Lt+st[0]*Rt+ft[0]*Nt,I[1]=B[1]*Pt+Z[1]*Lt+st[1]*Rt+ft[1]*Nt,I[2]=B[2]*Pt+Z[2]*Lt+st[2]*Rt+ft[2]*Nt,I;}function q(I,B){B=B||1;var Z=s.RANDOM()*2*Math.PI,st=s.RANDOM()*2-1,ft=Math.sqrt(1-st*st)*B;return I[0]=Math.cos(Z)*ft,I[1]=Math.sin(Z)*ft,I[2]=st*B,I;}function lt(I,B,Z){var st=B[0],ft=B[1],dt=B[2],ot=Z[3]*st+Z[7]*ft+Z[11]*dt+Z[15];return ot=ot||1,I[0]=(Z[0]*st+Z[4]*ft+Z[8]*dt+Z[12])/ot,I[1]=(Z[1]*st+Z[5]*ft+Z[9]*dt+Z[13])/ot,I[2]=(Z[2]*st+Z[6]*ft+Z[10]*dt+Z[14])/ot,I;}function ut(I,B,Z){var st=B[0],ft=B[1],dt=B[2];return I[0]=st*Z[0]+ft*Z[3]+dt*Z[6],I[1]=st*Z[1]+ft*Z[4]+dt*Z[7],I[2]=st*Z[2]+ft*Z[5]+dt*Z[8],I;}function Tt(I,B,Z){var st=Z[0],ft=Z[1],dt=Z[2],ot=Z[3],gt=B[0],St=B[1],Pt=B[2],Lt=ft*Pt-dt*St,Rt=dt*gt-st*Pt,Nt=st*St-ft*gt,$t=ft*Nt-dt*Rt,Ut=dt*Lt-st*Nt,Ft=st*Rt-ft*Lt,Qt=ot*2;return Lt*=Qt,Rt*=Qt,Nt*=Qt,$t*=2,Ut*=2,Ft*=2,I[0]=gt+Lt+$t,I[1]=St+Rt+Ut,I[2]=Pt+Nt+Ft,I;}function O(I,B,Z,st){var ft=[],dt=[];return ft[0]=B[0]-Z[0],ft[1]=B[1]-Z[1],ft[2]=B[2]-Z[2],dt[0]=ft[0],dt[1]=ft[1]*Math.cos(st)-ft[2]*Math.sin(st),dt[2]=ft[1]*Math.sin(st)+ft[2]*Math.cos(st),I[0]=dt[0]+Z[0],I[1]=dt[1]+Z[1],I[2]=dt[2]+Z[2],I;}function U(I,B,Z,st){var ft=[],dt=[];return ft[0]=B[0]-Z[0],ft[1]=B[1]-Z[1],ft[2]=B[2]-Z[2],dt[0]=ft[2]*Math.sin(st)+ft[0]*Math.cos(st),dt[1]=ft[1],dt[2]=ft[2]*Math.cos(st)-ft[0]*Math.sin(st),I[0]=dt[0]+Z[0],I[1]=dt[1]+Z[1],I[2]=dt[2]+Z[2],I;}function _(I,B,Z,st){var ft=[],dt=[];return ft[0]=B[0]-Z[0],ft[1]=B[1]-Z[1],ft[2]=B[2]-Z[2],dt[0]=ft[0]*Math.cos(st)-ft[1]*Math.sin(st),dt[1]=ft[0]*Math.sin(st)+ft[1]*Math.cos(st),dt[2]=ft[2],I[0]=dt[0]+Z[0],I[1]=dt[1]+Z[1],I[2]=dt[2]+Z[2],I;}function H(I,B){var Z=I[0],st=I[1],ft=I[2],dt=B[0],ot=B[1],gt=B[2],St=Math.sqrt(Z*Z+st*st+ft*ft),Pt=Math.sqrt(dt*dt+ot*ot+gt*gt),Lt=St*Pt,Rt=Lt&&nt(I,B)/Lt;return Math.acos(Math.min(Math.max(Rt,-1),1));}function at(I){return I[0]=0,I[1]=0,I[2]=0,I;}function ht(I){return"vec3("+I[0]+", "+I[1]+", "+I[2]+")";}function yt(I,B){return I[0]===B[0]&&I[1]===B[1]&&I[2]===B[2];}function Et(I,B){var Z=I[0],st=I[1],ft=I[2],dt=B[0],ot=B[1],gt=B[2];return Math.abs(Z-dt)<=s.EPSILON*Math.max(1,Math.abs(Z),Math.abs(dt))&&Math.abs(st-ot)<=s.EPSILON*Math.max(1,Math.abs(st),Math.abs(ot))&&Math.abs(ft-gt)<=s.EPSILON*Math.max(1,Math.abs(ft),Math.abs(gt));}var Dt=A,D=M,N=E,J=C,Q=P,V=u,tt=X,g=function(){var I=o();return function(B,Z,st,ft,dt,ot){var gt,St;for(Z||(Z=3),st||(st=0),ft?St=Math.min(ft*Z+st,B.length):St=B.length,gt=st;gt<St;gt+=Z)I[0]=B[gt],I[1]=B[gt+1],I[2]=B[gt+2],dt(I,I,ot),B[gt]=I[0],B[gt+1]=I[1],B[gt+2]=I[2];return B;};}();},/* 9 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"fromValues",function(){return u;}),i.d(n,"copy",function(){return d;}),i.d(n,"set",function(){return v;}),i.d(n,"add",function(){return p;}),i.d(n,"subtract",function(){return w;}),i.d(n,"multiply",function(){return A;}),i.d(n,"divide",function(){return M;}),i.d(n,"ceil",function(){return E;}),i.d(n,"floor",function(){return L;}),i.d(n,"min",function(){return G;}),i.d(n,"max",function(){return z;}),i.d(n,"round",function(){return et;}),i.d(n,"scale",function(){return x;}),i.d(n,"scaleAndAdd",function(){return y;}),i.d(n,"distance",function(){return S;}),i.d(n,"squaredDistance",function(){return C;}),i.d(n,"length",function(){return P;}),i.d(n,"squaredLength",function(){return X;}),i.d(n,"negate",function(){return $;}),i.d(n,"inverse",function(){return K;}),i.d(n,"normalize",function(){return j;}),i.d(n,"dot",function(){return nt;}),i.d(n,"cross",function(){return ct;}),i.d(n,"lerp",function(){return F;}),i.d(n,"random",function(){return R;}),i.d(n,"transformMat4",function(){return Y;}),i.d(n,"transformQuat",function(){return q;}),i.d(n,"zero",function(){return lt;}),i.d(n,"str",function(){return ut;}),i.d(n,"exactEquals",function(){return Tt;}),i.d(n,"equals",function(){return O;}),i.d(n,"sub",function(){return U;}),i.d(n,"mul",function(){return _;}),i.d(n,"div",function(){return H;}),i.d(n,"dist",function(){return at;}),i.d(n,"sqrDist",function(){return ht;}),i.d(n,"len",function(){return yt;}),i.d(n,"sqrLen",function(){return Et;}),i.d(n,"forEach",function(){return Dt;});var s=i(2);function o(){var D=new s.ARRAY_TYPE(4);return s.ARRAY_TYPE!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0,D[3]=0),D;}function a(D){var N=new s.ARRAY_TYPE(4);return N[0]=D[0],N[1]=D[1],N[2]=D[2],N[3]=D[3],N;}function u(D,N,J,Q){var V=new s.ARRAY_TYPE(4);return V[0]=D,V[1]=N,V[2]=J,V[3]=Q,V;}function d(D,N){return D[0]=N[0],D[1]=N[1],D[2]=N[2],D[3]=N[3],D;}function v(D,N,J,Q,V){return D[0]=N,D[1]=J,D[2]=Q,D[3]=V,D;}function p(D,N,J){return D[0]=N[0]+J[0],D[1]=N[1]+J[1],D[2]=N[2]+J[2],D[3]=N[3]+J[3],D;}function w(D,N,J){return D[0]=N[0]-J[0],D[1]=N[1]-J[1],D[2]=N[2]-J[2],D[3]=N[3]-J[3],D;}function A(D,N,J){return D[0]=N[0]*J[0],D[1]=N[1]*J[1],D[2]=N[2]*J[2],D[3]=N[3]*J[3],D;}function M(D,N,J){return D[0]=N[0]/J[0],D[1]=N[1]/J[1],D[2]=N[2]/J[2],D[3]=N[3]/J[3],D;}function E(D,N){return D[0]=Math.ceil(N[0]),D[1]=Math.ceil(N[1]),D[2]=Math.ceil(N[2]),D[3]=Math.ceil(N[3]),D;}function L(D,N){return D[0]=Math.floor(N[0]),D[1]=Math.floor(N[1]),D[2]=Math.floor(N[2]),D[3]=Math.floor(N[3]),D;}function G(D,N,J){return D[0]=Math.min(N[0],J[0]),D[1]=Math.min(N[1],J[1]),D[2]=Math.min(N[2],J[2]),D[3]=Math.min(N[3],J[3]),D;}function z(D,N,J){return D[0]=Math.max(N[0],J[0]),D[1]=Math.max(N[1],J[1]),D[2]=Math.max(N[2],J[2]),D[3]=Math.max(N[3],J[3]),D;}function et(D,N){return D[0]=Math.round(N[0]),D[1]=Math.round(N[1]),D[2]=Math.round(N[2]),D[3]=Math.round(N[3]),D;}function x(D,N,J){return D[0]=N[0]*J,D[1]=N[1]*J,D[2]=N[2]*J,D[3]=N[3]*J,D;}function y(D,N,J,Q){return D[0]=N[0]+J[0]*Q,D[1]=N[1]+J[1]*Q,D[2]=N[2]+J[2]*Q,D[3]=N[3]+J[3]*Q,D;}function S(D,N){var J=N[0]-D[0],Q=N[1]-D[1],V=N[2]-D[2],tt=N[3]-D[3];return Math.hypot(J,Q,V,tt);}function C(D,N){var J=N[0]-D[0],Q=N[1]-D[1],V=N[2]-D[2],tt=N[3]-D[3];return J*J+Q*Q+V*V+tt*tt;}function P(D){var N=D[0],J=D[1],Q=D[2],V=D[3];return Math.hypot(N,J,Q,V);}function X(D){var N=D[0],J=D[1],Q=D[2],V=D[3];return N*N+J*J+Q*Q+V*V;}function $(D,N){return D[0]=-N[0],D[1]=-N[1],D[2]=-N[2],D[3]=-N[3],D;}function K(D,N){return D[0]=1/N[0],D[1]=1/N[1],D[2]=1/N[2],D[3]=1/N[3],D;}function j(D,N){var J=N[0],Q=N[1],V=N[2],tt=N[3],g=J*J+Q*Q+V*V+tt*tt;return g>0&&(g=1/Math.sqrt(g)),D[0]=J*g,D[1]=Q*g,D[2]=V*g,D[3]=tt*g,D;}function nt(D,N){return D[0]*N[0]+D[1]*N[1]+D[2]*N[2]+D[3]*N[3];}function ct(D,N,J,Q){var V=J[0]*Q[1]-J[1]*Q[0],tt=J[0]*Q[2]-J[2]*Q[0],g=J[0]*Q[3]-J[3]*Q[0],I=J[1]*Q[2]-J[2]*Q[1],B=J[1]*Q[3]-J[3]*Q[1],Z=J[2]*Q[3]-J[3]*Q[2],st=N[0],ft=N[1],dt=N[2],ot=N[3];return D[0]=ft*Z-dt*B+ot*I,D[1]=-(st*Z)+dt*g-ot*tt,D[2]=st*B-ft*g+ot*V,D[3]=-(st*I)+ft*tt-dt*V,D;}function F(D,N,J,Q){var V=N[0],tt=N[1],g=N[2],I=N[3];return D[0]=V+Q*(J[0]-V),D[1]=tt+Q*(J[1]-tt),D[2]=g+Q*(J[2]-g),D[3]=I+Q*(J[3]-I),D;}function R(D,N){N=N||1;var J,Q,V,tt,g,I;do J=s.RANDOM()*2-1,Q=s.RANDOM()*2-1,g=J*J+Q*Q;while(g>=1);do V=s.RANDOM()*2-1,tt=s.RANDOM()*2-1,I=V*V+tt*tt;while(I>=1);var B=Math.sqrt((1-g)/I);return D[0]=N*J,D[1]=N*Q,D[2]=N*V*B,D[3]=N*tt*B,D;}function Y(D,N,J){var Q=N[0],V=N[1],tt=N[2],g=N[3];return D[0]=J[0]*Q+J[4]*V+J[8]*tt+J[12]*g,D[1]=J[1]*Q+J[5]*V+J[9]*tt+J[13]*g,D[2]=J[2]*Q+J[6]*V+J[10]*tt+J[14]*g,D[3]=J[3]*Q+J[7]*V+J[11]*tt+J[15]*g,D;}function q(D,N,J){var Q=N[0],V=N[1],tt=N[2],g=J[0],I=J[1],B=J[2],Z=J[3],st=Z*Q+I*tt-B*V,ft=Z*V+B*Q-g*tt,dt=Z*tt+g*V-I*Q,ot=-g*Q-I*V-B*tt;return D[0]=st*Z+ot*-g+ft*-B-dt*-I,D[1]=ft*Z+ot*-I+dt*-g-st*-B,D[2]=dt*Z+ot*-B+st*-I-ft*-g,D[3]=N[3],D;}function lt(D){return D[0]=0,D[1]=0,D[2]=0,D[3]=0,D;}function ut(D){return"vec4("+D[0]+", "+D[1]+", "+D[2]+", "+D[3]+")";}function Tt(D,N){return D[0]===N[0]&&D[1]===N[1]&&D[2]===N[2]&&D[3]===N[3];}function O(D,N){var J=D[0],Q=D[1],V=D[2],tt=D[3],g=N[0],I=N[1],B=N[2],Z=N[3];return Math.abs(J-g)<=s.EPSILON*Math.max(1,Math.abs(J),Math.abs(g))&&Math.abs(Q-I)<=s.EPSILON*Math.max(1,Math.abs(Q),Math.abs(I))&&Math.abs(V-B)<=s.EPSILON*Math.max(1,Math.abs(V),Math.abs(B))&&Math.abs(tt-Z)<=s.EPSILON*Math.max(1,Math.abs(tt),Math.abs(Z));}var U=w,_=A,H=M,at=S,ht=C,yt=P,Et=X,Dt=function(){var D=o();return function(N,J,Q,V,tt,g){var I,B;for(J||(J=4),Q||(Q=0),V?B=Math.min(V*J+Q,N.length):B=N.length,I=Q;I<B;I+=J)D[0]=N[I],D[1]=N[I+1],D[2]=N[I+2],D[3]=N[I+3],tt(D,D,g),N[I]=D[0],N[I+1]=D[1],N[I+2]=D[2],N[I+3]=D[3];return N;};}();},/* 10 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return u;}),i.d(n,"clone",function(){return d;}),i.d(n,"fromValues",function(){return v;}),i.d(n,"fromRotationTranslationValues",function(){return p;}),i.d(n,"fromRotationTranslation",function(){return w;}),i.d(n,"fromTranslation",function(){return A;}),i.d(n,"fromRotation",function(){return M;}),i.d(n,"fromMat4",function(){return E;}),i.d(n,"copy",function(){return L;}),i.d(n,"identity",function(){return G;}),i.d(n,"set",function(){return z;}),i.d(n,"getReal",function(){return et;}),i.d(n,"getDual",function(){return x;}),i.d(n,"setReal",function(){return y;}),i.d(n,"setDual",function(){return S;}),i.d(n,"getTranslation",function(){return C;}),i.d(n,"translate",function(){return P;}),i.d(n,"rotateX",function(){return X;}),i.d(n,"rotateY",function(){return $;}),i.d(n,"rotateZ",function(){return K;}),i.d(n,"rotateByQuatAppend",function(){return j;}),i.d(n,"rotateByQuatPrepend",function(){return nt;}),i.d(n,"rotateAroundAxis",function(){return ct;}),i.d(n,"add",function(){return F;}),i.d(n,"multiply",function(){return R;}),i.d(n,"mul",function(){return Y;}),i.d(n,"scale",function(){return q;}),i.d(n,"dot",function(){return lt;}),i.d(n,"lerp",function(){return ut;}),i.d(n,"invert",function(){return Tt;}),i.d(n,"conjugate",function(){return O;}),i.d(n,"length",function(){return U;}),i.d(n,"len",function(){return _;}),i.d(n,"squaredLength",function(){return H;}),i.d(n,"sqrLen",function(){return at;}),i.d(n,"normalize",function(){return ht;}),i.d(n,"str",function(){return yt;}),i.d(n,"exactEquals",function(){return Et;}),i.d(n,"equals",function(){return Dt;});var s=i(2),o=i(7),a=i(6);function u(){var D=new s.ARRAY_TYPE(8);return s.ARRAY_TYPE!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0,D[4]=0,D[5]=0,D[6]=0,D[7]=0),D[3]=1,D;}function d(D){var N=new s.ARRAY_TYPE(8);return N[0]=D[0],N[1]=D[1],N[2]=D[2],N[3]=D[3],N[4]=D[4],N[5]=D[5],N[6]=D[6],N[7]=D[7],N;}function v(D,N,J,Q,V,tt,g,I){var B=new s.ARRAY_TYPE(8);return B[0]=D,B[1]=N,B[2]=J,B[3]=Q,B[4]=V,B[5]=tt,B[6]=g,B[7]=I,B;}function p(D,N,J,Q,V,tt,g){var I=new s.ARRAY_TYPE(8);I[0]=D,I[1]=N,I[2]=J,I[3]=Q;var B=V*0.5,Z=tt*0.5,st=g*0.5;return I[4]=B*Q+Z*J-st*N,I[5]=Z*Q+st*D-B*J,I[6]=st*Q+B*N-Z*D,I[7]=-B*D-Z*N-st*J,I;}function w(D,N,J){var Q=J[0]*0.5,V=J[1]*0.5,tt=J[2]*0.5,g=N[0],I=N[1],B=N[2],Z=N[3];return D[0]=g,D[1]=I,D[2]=B,D[3]=Z,D[4]=Q*Z+V*B-tt*I,D[5]=V*Z+tt*g-Q*B,D[6]=tt*Z+Q*I-V*g,D[7]=-Q*g-V*I-tt*B,D;}function A(D,N){return D[0]=0,D[1]=0,D[2]=0,D[3]=1,D[4]=N[0]*0.5,D[5]=N[1]*0.5,D[6]=N[2]*0.5,D[7]=0,D;}function M(D,N){return D[0]=N[0],D[1]=N[1],D[2]=N[2],D[3]=N[3],D[4]=0,D[5]=0,D[6]=0,D[7]=0,D;}function E(D,N){var J=o.create();a.getRotation(J,N);var Q=new s.ARRAY_TYPE(3);return a.getTranslation(Q,N),w(D,J,Q),D;}function L(D,N){return D[0]=N[0],D[1]=N[1],D[2]=N[2],D[3]=N[3],D[4]=N[4],D[5]=N[5],D[6]=N[6],D[7]=N[7],D;}function G(D){return D[0]=0,D[1]=0,D[2]=0,D[3]=1,D[4]=0,D[5]=0,D[6]=0,D[7]=0,D;}function z(D,N,J,Q,V,tt,g,I,B){return D[0]=N,D[1]=J,D[2]=Q,D[3]=V,D[4]=tt,D[5]=g,D[6]=I,D[7]=B,D;}var et=o.copy;function x(D,N){return D[0]=N[4],D[1]=N[5],D[2]=N[6],D[3]=N[7],D;}var y=o.copy;function S(D,N){return D[4]=N[0],D[5]=N[1],D[6]=N[2],D[7]=N[3],D;}function C(D,N){var J=N[4],Q=N[5],V=N[6],tt=N[7],g=-N[0],I=-N[1],B=-N[2],Z=N[3];return D[0]=(J*Z+tt*g+Q*B-V*I)*2,D[1]=(Q*Z+tt*I+V*g-J*B)*2,D[2]=(V*Z+tt*B+J*I-Q*g)*2,D;}function P(D,N,J){var Q=N[0],V=N[1],tt=N[2],g=N[3],I=J[0]*0.5,B=J[1]*0.5,Z=J[2]*0.5,st=N[4],ft=N[5],dt=N[6],ot=N[7];return D[0]=Q,D[1]=V,D[2]=tt,D[3]=g,D[4]=g*I+V*Z-tt*B+st,D[5]=g*B+tt*I-Q*Z+ft,D[6]=g*Z+Q*B-V*I+dt,D[7]=-Q*I-V*B-tt*Z+ot,D;}function X(D,N,J){var Q=-N[0],V=-N[1],tt=-N[2],g=N[3],I=N[4],B=N[5],Z=N[6],st=N[7],ft=I*g+st*Q+B*tt-Z*V,dt=B*g+st*V+Z*Q-I*tt,ot=Z*g+st*tt+I*V-B*Q,gt=st*g-I*Q-B*V-Z*tt;return o.rotateX(D,N,J),Q=D[0],V=D[1],tt=D[2],g=D[3],D[4]=ft*g+gt*Q+dt*tt-ot*V,D[5]=dt*g+gt*V+ot*Q-ft*tt,D[6]=ot*g+gt*tt+ft*V-dt*Q,D[7]=gt*g-ft*Q-dt*V-ot*tt,D;}function $(D,N,J){var Q=-N[0],V=-N[1],tt=-N[2],g=N[3],I=N[4],B=N[5],Z=N[6],st=N[7],ft=I*g+st*Q+B*tt-Z*V,dt=B*g+st*V+Z*Q-I*tt,ot=Z*g+st*tt+I*V-B*Q,gt=st*g-I*Q-B*V-Z*tt;return o.rotateY(D,N,J),Q=D[0],V=D[1],tt=D[2],g=D[3],D[4]=ft*g+gt*Q+dt*tt-ot*V,D[5]=dt*g+gt*V+ot*Q-ft*tt,D[6]=ot*g+gt*tt+ft*V-dt*Q,D[7]=gt*g-ft*Q-dt*V-ot*tt,D;}function K(D,N,J){var Q=-N[0],V=-N[1],tt=-N[2],g=N[3],I=N[4],B=N[5],Z=N[6],st=N[7],ft=I*g+st*Q+B*tt-Z*V,dt=B*g+st*V+Z*Q-I*tt,ot=Z*g+st*tt+I*V-B*Q,gt=st*g-I*Q-B*V-Z*tt;return o.rotateZ(D,N,J),Q=D[0],V=D[1],tt=D[2],g=D[3],D[4]=ft*g+gt*Q+dt*tt-ot*V,D[5]=dt*g+gt*V+ot*Q-ft*tt,D[6]=ot*g+gt*tt+ft*V-dt*Q,D[7]=gt*g-ft*Q-dt*V-ot*tt,D;}function j(D,N,J){var Q=J[0],V=J[1],tt=J[2],g=J[3],I=N[0],B=N[1],Z=N[2],st=N[3];return D[0]=I*g+st*Q+B*tt-Z*V,D[1]=B*g+st*V+Z*Q-I*tt,D[2]=Z*g+st*tt+I*V-B*Q,D[3]=st*g-I*Q-B*V-Z*tt,I=N[4],B=N[5],Z=N[6],st=N[7],D[4]=I*g+st*Q+B*tt-Z*V,D[5]=B*g+st*V+Z*Q-I*tt,D[6]=Z*g+st*tt+I*V-B*Q,D[7]=st*g-I*Q-B*V-Z*tt,D;}function nt(D,N,J){var Q=N[0],V=N[1],tt=N[2],g=N[3],I=J[0],B=J[1],Z=J[2],st=J[3];return D[0]=Q*st+g*I+V*Z-tt*B,D[1]=V*st+g*B+tt*I-Q*Z,D[2]=tt*st+g*Z+Q*B-V*I,D[3]=g*st-Q*I-V*B-tt*Z,I=J[4],B=J[5],Z=J[6],st=J[7],D[4]=Q*st+g*I+V*Z-tt*B,D[5]=V*st+g*B+tt*I-Q*Z,D[6]=tt*st+g*Z+Q*B-V*I,D[7]=g*st-Q*I-V*B-tt*Z,D;}function ct(D,N,J,Q){if(Math.abs(Q)<s.EPSILON)return L(D,N);var V=Math.hypot(J[0],J[1],J[2]);Q=Q*0.5;var tt=Math.sin(Q),g=tt*J[0]/V,I=tt*J[1]/V,B=tt*J[2]/V,Z=Math.cos(Q),st=N[0],ft=N[1],dt=N[2],ot=N[3];D[0]=st*Z+ot*g+ft*B-dt*I,D[1]=ft*Z+ot*I+dt*g-st*B,D[2]=dt*Z+ot*B+st*I-ft*g,D[3]=ot*Z-st*g-ft*I-dt*B;var gt=N[4],St=N[5],Pt=N[6],Lt=N[7];return D[4]=gt*Z+Lt*g+St*B-Pt*I,D[5]=St*Z+Lt*I+Pt*g-gt*B,D[6]=Pt*Z+Lt*B+gt*I-St*g,D[7]=Lt*Z-gt*g-St*I-Pt*B,D;}function F(D,N,J){return D[0]=N[0]+J[0],D[1]=N[1]+J[1],D[2]=N[2]+J[2],D[3]=N[3]+J[3],D[4]=N[4]+J[4],D[5]=N[5]+J[5],D[6]=N[6]+J[6],D[7]=N[7]+J[7],D;}function R(D,N,J){var Q=N[0],V=N[1],tt=N[2],g=N[3],I=J[4],B=J[5],Z=J[6],st=J[7],ft=N[4],dt=N[5],ot=N[6],gt=N[7],St=J[0],Pt=J[1],Lt=J[2],Rt=J[3];return D[0]=Q*Rt+g*St+V*Lt-tt*Pt,D[1]=V*Rt+g*Pt+tt*St-Q*Lt,D[2]=tt*Rt+g*Lt+Q*Pt-V*St,D[3]=g*Rt-Q*St-V*Pt-tt*Lt,D[4]=Q*st+g*I+V*Z-tt*B+ft*Rt+gt*St+dt*Lt-ot*Pt,D[5]=V*st+g*B+tt*I-Q*Z+dt*Rt+gt*Pt+ot*St-ft*Lt,D[6]=tt*st+g*Z+Q*B-V*I+ot*Rt+gt*Lt+ft*Pt-dt*St,D[7]=g*st-Q*I-V*B-tt*Z+gt*Rt-ft*St-dt*Pt-ot*Lt,D;}var Y=R;function q(D,N,J){return D[0]=N[0]*J,D[1]=N[1]*J,D[2]=N[2]*J,D[3]=N[3]*J,D[4]=N[4]*J,D[5]=N[5]*J,D[6]=N[6]*J,D[7]=N[7]*J,D;}var lt=o.dot;function ut(D,N,J,Q){var V=1-Q;return lt(N,J)<0&&(Q=-Q),D[0]=N[0]*V+J[0]*Q,D[1]=N[1]*V+J[1]*Q,D[2]=N[2]*V+J[2]*Q,D[3]=N[3]*V+J[3]*Q,D[4]=N[4]*V+J[4]*Q,D[5]=N[5]*V+J[5]*Q,D[6]=N[6]*V+J[6]*Q,D[7]=N[7]*V+J[7]*Q,D;}function Tt(D,N){var J=H(N);return D[0]=-N[0]/J,D[1]=-N[1]/J,D[2]=-N[2]/J,D[3]=N[3]/J,D[4]=-N[4]/J,D[5]=-N[5]/J,D[6]=-N[6]/J,D[7]=N[7]/J,D;}function O(D,N){return D[0]=-N[0],D[1]=-N[1],D[2]=-N[2],D[3]=N[3],D[4]=-N[4],D[5]=-N[5],D[6]=-N[6],D[7]=N[7],D;}var U=o.length,_=U,H=o.squaredLength,at=H;function ht(D,N){var J=H(N);if(J>0){J=Math.sqrt(J);var Q=N[0]/J,V=N[1]/J,tt=N[2]/J,g=N[3]/J,I=N[4],B=N[5],Z=N[6],st=N[7],ft=Q*I+V*B+tt*Z+g*st;D[0]=Q,D[1]=V,D[2]=tt,D[3]=g,D[4]=(I-Q*ft)/J,D[5]=(B-V*ft)/J,D[6]=(Z-tt*ft)/J,D[7]=(st-g*ft)/J;}return D;}function yt(D){return"quat2("+D[0]+", "+D[1]+", "+D[2]+", "+D[3]+", "+D[4]+", "+D[5]+", "+D[6]+", "+D[7]+")";}function Et(D,N){return D[0]===N[0]&&D[1]===N[1]&&D[2]===N[2]&&D[3]===N[3]&&D[4]===N[4]&&D[5]===N[5]&&D[6]===N[6]&&D[7]===N[7];}function Dt(D,N){var J=D[0],Q=D[1],V=D[2],tt=D[3],g=D[4],I=D[5],B=D[6],Z=D[7],st=N[0],ft=N[1],dt=N[2],ot=N[3],gt=N[4],St=N[5],Pt=N[6],Lt=N[7];return Math.abs(J-st)<=s.EPSILON*Math.max(1,Math.abs(J),Math.abs(st))&&Math.abs(Q-ft)<=s.EPSILON*Math.max(1,Math.abs(Q),Math.abs(ft))&&Math.abs(V-dt)<=s.EPSILON*Math.max(1,Math.abs(V),Math.abs(dt))&&Math.abs(tt-ot)<=s.EPSILON*Math.max(1,Math.abs(tt),Math.abs(ot))&&Math.abs(g-gt)<=s.EPSILON*Math.max(1,Math.abs(g),Math.abs(gt))&&Math.abs(I-St)<=s.EPSILON*Math.max(1,Math.abs(I),Math.abs(St))&&Math.abs(B-Pt)<=s.EPSILON*Math.max(1,Math.abs(B),Math.abs(Pt))&&Math.abs(Z-Lt)<=s.EPSILON*Math.max(1,Math.abs(Z),Math.abs(Lt));}},/* 11 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"fromValues",function(){return u;}),i.d(n,"copy",function(){return d;}),i.d(n,"set",function(){return v;}),i.d(n,"add",function(){return p;}),i.d(n,"subtract",function(){return w;}),i.d(n,"multiply",function(){return A;}),i.d(n,"divide",function(){return M;}),i.d(n,"ceil",function(){return E;}),i.d(n,"floor",function(){return L;}),i.d(n,"min",function(){return G;}),i.d(n,"max",function(){return z;}),i.d(n,"round",function(){return et;}),i.d(n,"scale",function(){return x;}),i.d(n,"scaleAndAdd",function(){return y;}),i.d(n,"distance",function(){return S;}),i.d(n,"squaredDistance",function(){return C;}),i.d(n,"length",function(){return P;}),i.d(n,"squaredLength",function(){return X;}),i.d(n,"negate",function(){return $;}),i.d(n,"inverse",function(){return K;}),i.d(n,"normalize",function(){return j;}),i.d(n,"dot",function(){return nt;}),i.d(n,"cross",function(){return ct;}),i.d(n,"lerp",function(){return F;}),i.d(n,"random",function(){return R;}),i.d(n,"transformMat2",function(){return Y;}),i.d(n,"transformMat2d",function(){return q;}),i.d(n,"transformMat3",function(){return lt;}),i.d(n,"transformMat4",function(){return ut;}),i.d(n,"rotate",function(){return Tt;}),i.d(n,"angle",function(){return O;}),i.d(n,"zero",function(){return U;}),i.d(n,"str",function(){return _;}),i.d(n,"exactEquals",function(){return H;}),i.d(n,"equals",function(){return at;}),i.d(n,"len",function(){return ht;}),i.d(n,"sub",function(){return yt;}),i.d(n,"mul",function(){return Et;}),i.d(n,"div",function(){return Dt;}),i.d(n,"dist",function(){return D;}),i.d(n,"sqrDist",function(){return N;}),i.d(n,"sqrLen",function(){return J;}),i.d(n,"forEach",function(){return Q;});var s=i(2);function o(){var V=new s.ARRAY_TYPE(2);return s.ARRAY_TYPE!=Float32Array&&(V[0]=0,V[1]=0),V;}function a(V){var tt=new s.ARRAY_TYPE(2);return tt[0]=V[0],tt[1]=V[1],tt;}function u(V,tt){var g=new s.ARRAY_TYPE(2);return g[0]=V,g[1]=tt,g;}function d(V,tt){return V[0]=tt[0],V[1]=tt[1],V;}function v(V,tt,g){return V[0]=tt,V[1]=g,V;}function p(V,tt,g){return V[0]=tt[0]+g[0],V[1]=tt[1]+g[1],V;}function w(V,tt,g){return V[0]=tt[0]-g[0],V[1]=tt[1]-g[1],V;}function A(V,tt,g){return V[0]=tt[0]*g[0],V[1]=tt[1]*g[1],V;}function M(V,tt,g){return V[0]=tt[0]/g[0],V[1]=tt[1]/g[1],V;}function E(V,tt){return V[0]=Math.ceil(tt[0]),V[1]=Math.ceil(tt[1]),V;}function L(V,tt){return V[0]=Math.floor(tt[0]),V[1]=Math.floor(tt[1]),V;}function G(V,tt,g){return V[0]=Math.min(tt[0],g[0]),V[1]=Math.min(tt[1],g[1]),V;}function z(V,tt,g){return V[0]=Math.max(tt[0],g[0]),V[1]=Math.max(tt[1],g[1]),V;}function et(V,tt){return V[0]=Math.round(tt[0]),V[1]=Math.round(tt[1]),V;}function x(V,tt,g){return V[0]=tt[0]*g,V[1]=tt[1]*g,V;}function y(V,tt,g,I){return V[0]=tt[0]+g[0]*I,V[1]=tt[1]+g[1]*I,V;}function S(V,tt){var g=tt[0]-V[0],I=tt[1]-V[1];return Math.hypot(g,I);}function C(V,tt){var g=tt[0]-V[0],I=tt[1]-V[1];return g*g+I*I;}function P(V){var tt=V[0],g=V[1];return Math.hypot(tt,g);}function X(V){var tt=V[0],g=V[1];return tt*tt+g*g;}function $(V,tt){return V[0]=-tt[0],V[1]=-tt[1],V;}function K(V,tt){return V[0]=1/tt[0],V[1]=1/tt[1],V;}function j(V,tt){var g=tt[0],I=tt[1],B=g*g+I*I;return B>0&&(B=1/Math.sqrt(B)),V[0]=tt[0]*B,V[1]=tt[1]*B,V;}function nt(V,tt){return V[0]*tt[0]+V[1]*tt[1];}function ct(V,tt,g){var I=tt[0]*g[1]-tt[1]*g[0];return V[0]=V[1]=0,V[2]=I,V;}function F(V,tt,g,I){var B=tt[0],Z=tt[1];return V[0]=B+I*(g[0]-B),V[1]=Z+I*(g[1]-Z),V;}function R(V,tt){tt=tt||1;var g=s.RANDOM()*2*Math.PI;return V[0]=Math.cos(g)*tt,V[1]=Math.sin(g)*tt,V;}function Y(V,tt,g){var I=tt[0],B=tt[1];return V[0]=g[0]*I+g[2]*B,V[1]=g[1]*I+g[3]*B,V;}function q(V,tt,g){var I=tt[0],B=tt[1];return V[0]=g[0]*I+g[2]*B+g[4],V[1]=g[1]*I+g[3]*B+g[5],V;}function lt(V,tt,g){var I=tt[0],B=tt[1];return V[0]=g[0]*I+g[3]*B+g[6],V[1]=g[1]*I+g[4]*B+g[7],V;}function ut(V,tt,g){var I=tt[0],B=tt[1];return V[0]=g[0]*I+g[4]*B+g[12],V[1]=g[1]*I+g[5]*B+g[13],V;}function Tt(V,tt,g,I){var B=tt[0]-g[0],Z=tt[1]-g[1],st=Math.sin(I),ft=Math.cos(I);return V[0]=B*ft-Z*st+g[0],V[1]=B*st+Z*ft+g[1],V;}function O(V,tt){var g=V[0],I=V[1],B=tt[0],Z=tt[1],st=Math.sqrt(g*g+I*I)*Math.sqrt(B*B+Z*Z),ft=st&&(g*B+I*Z)/st;return Math.acos(Math.min(Math.max(ft,-1),1));}function U(V){return V[0]=0,V[1]=0,V;}function _(V){return"vec2("+V[0]+", "+V[1]+")";}function H(V,tt){return V[0]===tt[0]&&V[1]===tt[1];}function at(V,tt){var g=V[0],I=V[1],B=tt[0],Z=tt[1];return Math.abs(g-B)<=s.EPSILON*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(I-Z)<=s.EPSILON*Math.max(1,Math.abs(I),Math.abs(Z));}var ht=P,yt=w,Et=A,Dt=M,D=S,N=C,J=X,Q=function(){var V=o();return function(tt,g,I,B,Z,st){var ft,dt;for(g||(g=2),I||(I=0),B?dt=Math.min(B*g+I,tt.length):dt=tt.length,ft=I;ft<dt;ft+=g)V[0]=tt[ft],V[1]=tt[ft+1],Z(V,V,st),tt[ft]=V[0],tt[ft+1]=V[1];return tt;};}();},/* 12 *//***/function(e,n,i){i.r(n),i.d(n,"default",function(){return O;});var s=i(13),o=/* @__PURE__ */i.n(s),a=i(19),u=/* @__PURE__ */i.n(a),d=i(23),v=/* @__PURE__ */i.n(d),p=i(24),w=/* @__PURE__ */i.n(p),A=i(25),M=i(1),E=i(36),L=i(43),G=i(41),z=i(56),et=i(73),x=i(45),y=i(78),S=i(37),C=i(82);i(1).glMatrix.setMatrixArrayType(Array);function P(U,_){var H;if((typeof Symbol==="undefined"?"undefined":_typeof(Symbol))>"u"||U[Symbol.iterator]==null){if(Array.isArray(U)||(H=X(U))||_){H&&(U=H);var at=0,ht=function ht(){};return{s:ht,n:function n(){return at>=U.length?{done:!0}:{done:!1,value:U[at++]};},e:function e(N){throw N;},f:ht};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var yt=!0,Et=!1,Dt;return{s:function s(){H=U[Symbol.iterator]();},n:function n(){var N=H.next();return yt=N.done,N;},e:function e(N){Et=!0,Dt=N;},f:function f(){try{!yt&&H.return!=null&&H.return();}finally{if(Et)throw Dt;}}};}function X(U,_){if(U){if(typeof U=="string")return $(U,_);var H=Object.prototype.toString.call(U).slice(8,-1);if(H==="Object"&&U.constructor&&(H=U.constructor.name),H==="Map"||H==="Set")return Array.from(U);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return $(U,_);}}function $(U,_){(_==null||_>U.length)&&(_=U.length);for(var H=0,at=new Array(_);H<_;H++)at[H]=U[H];return at;}var K={autoUpdate:!1,// premultipliedAlpha: true,
|
|
1
|
+
var _Object$freeze,_NPt;var _excluded=["duration"],_excluded2=["toolsType"],_excluded3=["callback"],_excluded4=["render"],_excluded5=["render"];function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _regeneratorValues(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function next(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e};}};}throw new TypeError(_typeof(e)+" is not iterable");}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n5=0,F=function F(){};return{s:F,n:function n(){return _n5>=r.length?{done:!0}:{done:!1,value:r[_n5++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t.return||t.return();}finally{if(u)throw o;}}};}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a;}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0));}if(o||r>1)return a;throw y=!0,n;}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0);}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e;}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break;}catch(t){i=e,c=1,u=t;}finally{f=1;}}return{value:t,done:y};};}(r,o,i),!0),u;}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this;}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e;}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this;}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]";}),(_regenerator=function _regenerator(){return{w:i,m:f};})();}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{});}catch(e){i=0;}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e);});}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2));},_regeneratorDefine2(e,r,n,t);}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _objectDestructuringEmpty(t){if(null==t)throw new TypeError("Cannot destructure "+t);}function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r]);}return n;},_extends.apply(null,arguments);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},return:function _return(r){var n=this.s.return;return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));},throw:function _throw(r){var n=this.s.return;return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));}},new AsyncFromSyncIterator(r);}var Jb=Object.defineProperty;var _b=function _b(r,t,e){return t in r?Jb(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;};var wt=function wt(r,t,e){return _b(r,_typeof(t)!="symbol"?t+"":t,e);};var uo=1e-6,Wa=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array;function Le(r){Wa=r;}function tM(){var r=new Wa(6);return Wa!=Float32Array&&(r[1]=0,r[2]=0,r[4]=0,r[5]=0),r[0]=1,r[3]=1,r;}function eM(r){var t=new Wa(6);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t;}function rM(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r;}function nM(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r;}function Ms(r,t,e,n,i,s){var o=new Wa(6);return o[0]=r,o[1]=t,o[2]=e,o[3]=n,o[4]=i,o[5]=s,o;}function iM(r,t,e,n,i,s,o){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=s,r[5]=o,r;}function tu(r,t){var e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],u=e*s-n*i;return u?(u=1/u,r[0]=s*u,r[1]=-n*u,r[2]=-i*u,r[3]=e*u,r[4]=(i*a-s*o)*u,r[5]=(n*o-e*a)*u,r):null;}function sM(r){return r[0]*r[3]-r[1]*r[2];}function Kn(r,t,e){var n=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],d=e[0],v=e[1],p=e[2],w=e[3],A=e[4],M=e[5];return r[0]=n*d+s*v,r[1]=i*d+o*v,r[2]=n*p+s*w,r[3]=i*p+o*w,r[4]=n*A+s*M+a,r[5]=i*A+o*M+u,r;}function b1(r,t,e){var n=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],d=Math.sin(e),v=Math.cos(e);return r[0]=n*v+s*d,r[1]=i*v+o*d,r[2]=n*-d+s*v,r[3]=i*-d+o*v,r[4]=a,r[5]=u,r;}function oM(r,t,e){var n=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],d=e[0],v=e[1];return r[0]=n*d,r[1]=i*d,r[2]=s*v,r[3]=o*v,r[4]=a,r[5]=u,r;}function Ed(r,t,e){var n=t[0],i=t[1],s=t[2],o=t[3],a=t[4],u=t[5],d=e[0],v=e[1];return r[0]=n,r[1]=i,r[2]=s,r[3]=o,r[4]=n*d+s*v+a,r[5]=i*d+o*v+u,r;}function aM(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=-e,r[3]=n,r[4]=0,r[5]=0,r;}function lM(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r[4]=0,r[5]=0,r;}function cM(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=t[0],r[5]=t[1],r;}function uM(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")";}function fM(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]+r[3]*r[3]+r[4]*r[4]+r[5]*r[5]+1);}function hM(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r;}function M1(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r;}function dM(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r;}function pM(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r;}function vM(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5];}function gM(r,t){var e=r[0],n=r[1],i=r[2],s=r[3],o=r[4],a=r[5],u=t[0],d=t[1],v=t[2],p=t[3],w=t[4],A=t[5];return Math.abs(e-u)<=uo*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(n-d)<=uo*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-v)<=uo*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(s-p)<=uo*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-w)<=uo*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-A)<=uo*Math.max(1,Math.abs(a),Math.abs(A));}var mM=Kn,yM=M1;var E1=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,add:hM,clone:eM,copy:rM,create:tM,determinant:sM,equals:gM,exactEquals:vM,frob:fM,fromRotation:aM,fromScaling:lM,fromTranslation:cM,fromValues:Ms,identity:nM,invert:tu,mul:mM,multiply:Kn,multiplyScalar:dM,multiplyScalarAndAdd:pM,rotate:b1,scale:oM,set:iM,str:uM,sub:yM,subtract:M1,translate:Ed},Symbol.toStringTag,{value:"Module"}));var Qe=(typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?globalThis:(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:(typeof global==="undefined"?"undefined":_typeof(global))<"u"?global:(typeof self==="undefined"?"undefined":_typeof(self))<"u"?self:{};function zn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;}var L1={exports:{}};(function(r,t){(function(n,i){r.exports=i();})(Qe,function(){return/******/function(e){var n={};function i(s){if(n[s])return n[s].exports;var o=n[s]={/******/i:s,/******/l:!1,/******/exports:{}/******/};return e[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports;}return i.m=e,i.c=n,i.d=function(s,o,a){i.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:a});},i.r=function(s){(typeof Symbol==="undefined"?"undefined":_typeof(Symbol))<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0});},i.t=function(s,o){if(o&1&&(s=i(s)),o&8||o&4&&_typeof(s)=="object"&&s&&s.__esModule)return s;var a=/* @__PURE__ */Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:s}),o&2&&typeof s!="string")for(var u in s)i.d(a,u,function(d){return s[d];}.bind(null,u));return a;},i.n=function(s){var o=s&&s.__esModule?(/******/function(){return s.default;}):(/******/function(){return s;});return i.d(o,"a",o),o;},i.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o);},i.p="/js/",i(i.s=0);}([/* 0 *//***/function(e,n,i){i.r(n);var s=i(12);i.d(n,"Renderer",function(){return s.default;});var o=i(56);i.d(n,"Figure2D",function(){return o.default;});var a=i(73);i.d(n,"Mesh2D",function(){return a.default;});var u=i(45);i.d(n,"MeshCloud",function(){return u.default;});var d=i(39);i.d(n,"parseFont",function(){return d.default;});var v=i(47);i.d(n,"parseColor",function(){return v.default;});var p=i(37);i.d(n,"ENV",function(){return p.default;}),i(1).glMatrix.setMatrixArrayType(Array);},/* 1 *//***/function(e,n,i){i.r(n);var s=i(2);i.d(n,"glMatrix",function(){return s;});var o=i(3);i.d(n,"mat2",function(){return o;});var a=i(4);i.d(n,"mat2d",function(){return a;});var u=i(5);i.d(n,"mat3",function(){return u;});var d=i(6);i.d(n,"mat4",function(){return d;});var v=i(7);i.d(n,"quat",function(){return v;});var p=i(10);i.d(n,"quat2",function(){return p;});var w=i(11);i.d(n,"vec2",function(){return w;});var A=i(8);i.d(n,"vec3",function(){return A;});var M=i(9);i.d(n,"vec4",function(){return M;});},/* 2 *//***/function(e,n,i){i.r(n),i.d(n,"EPSILON",function(){return s;}),i.d(n,"ARRAY_TYPE",function(){return o;}),i.d(n,"RANDOM",function(){return a;}),i.d(n,"setMatrixArrayType",function(){return u;}),i.d(n,"toRadian",function(){return v;}),i.d(n,"equals",function(){return p;});var s=1e-6,o=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,a=Math.random;function u(w){o=w;}var d=Math.PI/180;function v(w){return w*d;}function p(w,A){return Math.abs(w-A)<=s*Math.max(1,Math.abs(w),Math.abs(A));}Math.hypot||(Math.hypot=function(){for(var w=0,A=arguments.length;A--;)w+=arguments[A]*arguments[A];return Math.sqrt(w);});},/* 3 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"copy",function(){return u;}),i.d(n,"identity",function(){return d;}),i.d(n,"fromValues",function(){return v;}),i.d(n,"set",function(){return p;}),i.d(n,"transpose",function(){return w;}),i.d(n,"invert",function(){return A;}),i.d(n,"adjoint",function(){return M;}),i.d(n,"determinant",function(){return E;}),i.d(n,"multiply",function(){return L;}),i.d(n,"rotate",function(){return G;}),i.d(n,"scale",function(){return z;}),i.d(n,"fromRotation",function(){return et;}),i.d(n,"fromScaling",function(){return x;}),i.d(n,"str",function(){return y;}),i.d(n,"frob",function(){return S;}),i.d(n,"LDU",function(){return C;}),i.d(n,"add",function(){return P;}),i.d(n,"subtract",function(){return X;}),i.d(n,"exactEquals",function(){return $;}),i.d(n,"equals",function(){return K;}),i.d(n,"multiplyScalar",function(){return j;}),i.d(n,"multiplyScalarAndAdd",function(){return nt;}),i.d(n,"mul",function(){return ct;}),i.d(n,"sub",function(){return F;});var s=i(2);function o(){var R=new s.ARRAY_TYPE(4);return s.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0),R[0]=1,R[3]=1,R;}function a(R){var Y=new s.ARRAY_TYPE(4);return Y[0]=R[0],Y[1]=R[1],Y[2]=R[2],Y[3]=R[3],Y;}function u(R,Y){return R[0]=Y[0],R[1]=Y[1],R[2]=Y[2],R[3]=Y[3],R;}function d(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R;}function v(R,Y,q,lt){var ut=new s.ARRAY_TYPE(4);return ut[0]=R,ut[1]=Y,ut[2]=q,ut[3]=lt,ut;}function p(R,Y,q,lt,ut){return R[0]=Y,R[1]=q,R[2]=lt,R[3]=ut,R;}function w(R,Y){if(R===Y){var q=Y[1];R[1]=Y[2],R[2]=q;}else R[0]=Y[0],R[1]=Y[2],R[2]=Y[1],R[3]=Y[3];return R;}function A(R,Y){var q=Y[0],lt=Y[1],ut=Y[2],Tt=Y[3],O=q*Tt-ut*lt;return O?(O=1/O,R[0]=Tt*O,R[1]=-lt*O,R[2]=-ut*O,R[3]=q*O,R):null;}function M(R,Y){var q=Y[0];return R[0]=Y[3],R[1]=-Y[1],R[2]=-Y[2],R[3]=q,R;}function E(R){return R[0]*R[3]-R[2]*R[1];}function L(R,Y,q){var lt=Y[0],ut=Y[1],Tt=Y[2],O=Y[3],U=q[0],_=q[1],H=q[2],at=q[3];return R[0]=lt*U+Tt*_,R[1]=ut*U+O*_,R[2]=lt*H+Tt*at,R[3]=ut*H+O*at,R;}function G(R,Y,q){var lt=Y[0],ut=Y[1],Tt=Y[2],O=Y[3],U=Math.sin(q),_=Math.cos(q);return R[0]=lt*_+Tt*U,R[1]=ut*_+O*U,R[2]=lt*-U+Tt*_,R[3]=ut*-U+O*_,R;}function z(R,Y,q){var lt=Y[0],ut=Y[1],Tt=Y[2],O=Y[3],U=q[0],_=q[1];return R[0]=lt*U,R[1]=ut*U,R[2]=Tt*_,R[3]=O*_,R;}function et(R,Y){var q=Math.sin(Y),lt=Math.cos(Y);return R[0]=lt,R[1]=q,R[2]=-q,R[3]=lt,R;}function x(R,Y){return R[0]=Y[0],R[1]=0,R[2]=0,R[3]=Y[1],R;}function y(R){return"mat2("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+")";}function S(R){return Math.hypot(R[0],R[1],R[2],R[3]);}function C(R,Y,q,lt){return R[2]=lt[2]/lt[0],q[0]=lt[0],q[1]=lt[1],q[3]=lt[3]-R[2]*q[1],[R,Y,q];}function P(R,Y,q){return R[0]=Y[0]+q[0],R[1]=Y[1]+q[1],R[2]=Y[2]+q[2],R[3]=Y[3]+q[3],R;}function X(R,Y,q){return R[0]=Y[0]-q[0],R[1]=Y[1]-q[1],R[2]=Y[2]-q[2],R[3]=Y[3]-q[3],R;}function $(R,Y){return R[0]===Y[0]&&R[1]===Y[1]&&R[2]===Y[2]&&R[3]===Y[3];}function K(R,Y){var q=R[0],lt=R[1],ut=R[2],Tt=R[3],O=Y[0],U=Y[1],_=Y[2],H=Y[3];return Math.abs(q-O)<=s.EPSILON*Math.max(1,Math.abs(q),Math.abs(O))&&Math.abs(lt-U)<=s.EPSILON*Math.max(1,Math.abs(lt),Math.abs(U))&&Math.abs(ut-_)<=s.EPSILON*Math.max(1,Math.abs(ut),Math.abs(_))&&Math.abs(Tt-H)<=s.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(H));}function j(R,Y,q){return R[0]=Y[0]*q,R[1]=Y[1]*q,R[2]=Y[2]*q,R[3]=Y[3]*q,R;}function nt(R,Y,q,lt){return R[0]=Y[0]+q[0]*lt,R[1]=Y[1]+q[1]*lt,R[2]=Y[2]+q[2]*lt,R[3]=Y[3]+q[3]*lt,R;}var ct=L,F=X;},/* 4 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"copy",function(){return u;}),i.d(n,"identity",function(){return d;}),i.d(n,"fromValues",function(){return v;}),i.d(n,"set",function(){return p;}),i.d(n,"invert",function(){return w;}),i.d(n,"determinant",function(){return A;}),i.d(n,"multiply",function(){return M;}),i.d(n,"rotate",function(){return E;}),i.d(n,"scale",function(){return L;}),i.d(n,"translate",function(){return G;}),i.d(n,"fromRotation",function(){return z;}),i.d(n,"fromScaling",function(){return et;}),i.d(n,"fromTranslation",function(){return x;}),i.d(n,"str",function(){return y;}),i.d(n,"frob",function(){return S;}),i.d(n,"add",function(){return C;}),i.d(n,"subtract",function(){return P;}),i.d(n,"multiplyScalar",function(){return X;}),i.d(n,"multiplyScalarAndAdd",function(){return $;}),i.d(n,"exactEquals",function(){return K;}),i.d(n,"equals",function(){return j;}),i.d(n,"mul",function(){return nt;}),i.d(n,"sub",function(){return ct;});var s=i(2);function o(){var F=new s.ARRAY_TYPE(6);return s.ARRAY_TYPE!=Float32Array&&(F[1]=0,F[2]=0,F[4]=0,F[5]=0),F[0]=1,F[3]=1,F;}function a(F){var R=new s.ARRAY_TYPE(6);return R[0]=F[0],R[1]=F[1],R[2]=F[2],R[3]=F[3],R[4]=F[4],R[5]=F[5],R;}function u(F,R){return F[0]=R[0],F[1]=R[1],F[2]=R[2],F[3]=R[3],F[4]=R[4],F[5]=R[5],F;}function d(F){return F[0]=1,F[1]=0,F[2]=0,F[3]=1,F[4]=0,F[5]=0,F;}function v(F,R,Y,q,lt,ut){var Tt=new s.ARRAY_TYPE(6);return Tt[0]=F,Tt[1]=R,Tt[2]=Y,Tt[3]=q,Tt[4]=lt,Tt[5]=ut,Tt;}function p(F,R,Y,q,lt,ut,Tt){return F[0]=R,F[1]=Y,F[2]=q,F[3]=lt,F[4]=ut,F[5]=Tt,F;}function w(F,R){var Y=R[0],q=R[1],lt=R[2],ut=R[3],Tt=R[4],O=R[5],U=Y*ut-q*lt;return U?(U=1/U,F[0]=ut*U,F[1]=-q*U,F[2]=-lt*U,F[3]=Y*U,F[4]=(lt*O-ut*Tt)*U,F[5]=(q*Tt-Y*O)*U,F):null;}function A(F){return F[0]*F[3]-F[1]*F[2];}function M(F,R,Y){var q=R[0],lt=R[1],ut=R[2],Tt=R[3],O=R[4],U=R[5],_=Y[0],H=Y[1],at=Y[2],ht=Y[3],yt=Y[4],Et=Y[5];return F[0]=q*_+ut*H,F[1]=lt*_+Tt*H,F[2]=q*at+ut*ht,F[3]=lt*at+Tt*ht,F[4]=q*yt+ut*Et+O,F[5]=lt*yt+Tt*Et+U,F;}function E(F,R,Y){var q=R[0],lt=R[1],ut=R[2],Tt=R[3],O=R[4],U=R[5],_=Math.sin(Y),H=Math.cos(Y);return F[0]=q*H+ut*_,F[1]=lt*H+Tt*_,F[2]=q*-_+ut*H,F[3]=lt*-_+Tt*H,F[4]=O,F[5]=U,F;}function L(F,R,Y){var q=R[0],lt=R[1],ut=R[2],Tt=R[3],O=R[4],U=R[5],_=Y[0],H=Y[1];return F[0]=q*_,F[1]=lt*_,F[2]=ut*H,F[3]=Tt*H,F[4]=O,F[5]=U,F;}function G(F,R,Y){var q=R[0],lt=R[1],ut=R[2],Tt=R[3],O=R[4],U=R[5],_=Y[0],H=Y[1];return F[0]=q,F[1]=lt,F[2]=ut,F[3]=Tt,F[4]=q*_+ut*H+O,F[5]=lt*_+Tt*H+U,F;}function z(F,R){var Y=Math.sin(R),q=Math.cos(R);return F[0]=q,F[1]=Y,F[2]=-Y,F[3]=q,F[4]=0,F[5]=0,F;}function et(F,R){return F[0]=R[0],F[1]=0,F[2]=0,F[3]=R[1],F[4]=0,F[5]=0,F;}function x(F,R){return F[0]=1,F[1]=0,F[2]=0,F[3]=1,F[4]=R[0],F[5]=R[1],F;}function y(F){return"mat2d("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+", "+F[4]+", "+F[5]+")";}function S(F){return Math.hypot(F[0],F[1],F[2],F[3],F[4],F[5],1);}function C(F,R,Y){return F[0]=R[0]+Y[0],F[1]=R[1]+Y[1],F[2]=R[2]+Y[2],F[3]=R[3]+Y[3],F[4]=R[4]+Y[4],F[5]=R[5]+Y[5],F;}function P(F,R,Y){return F[0]=R[0]-Y[0],F[1]=R[1]-Y[1],F[2]=R[2]-Y[2],F[3]=R[3]-Y[3],F[4]=R[4]-Y[4],F[5]=R[5]-Y[5],F;}function X(F,R,Y){return F[0]=R[0]*Y,F[1]=R[1]*Y,F[2]=R[2]*Y,F[3]=R[3]*Y,F[4]=R[4]*Y,F[5]=R[5]*Y,F;}function $(F,R,Y,q){return F[0]=R[0]+Y[0]*q,F[1]=R[1]+Y[1]*q,F[2]=R[2]+Y[2]*q,F[3]=R[3]+Y[3]*q,F[4]=R[4]+Y[4]*q,F[5]=R[5]+Y[5]*q,F;}function K(F,R){return F[0]===R[0]&&F[1]===R[1]&&F[2]===R[2]&&F[3]===R[3]&&F[4]===R[4]&&F[5]===R[5];}function j(F,R){var Y=F[0],q=F[1],lt=F[2],ut=F[3],Tt=F[4],O=F[5],U=R[0],_=R[1],H=R[2],at=R[3],ht=R[4],yt=R[5];return Math.abs(Y-U)<=s.EPSILON*Math.max(1,Math.abs(Y),Math.abs(U))&&Math.abs(q-_)<=s.EPSILON*Math.max(1,Math.abs(q),Math.abs(_))&&Math.abs(lt-H)<=s.EPSILON*Math.max(1,Math.abs(lt),Math.abs(H))&&Math.abs(ut-at)<=s.EPSILON*Math.max(1,Math.abs(ut),Math.abs(at))&&Math.abs(Tt-ht)<=s.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(ht))&&Math.abs(O-yt)<=s.EPSILON*Math.max(1,Math.abs(O),Math.abs(yt));}var nt=M,ct=P;},/* 5 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"fromMat4",function(){return a;}),i.d(n,"clone",function(){return u;}),i.d(n,"copy",function(){return d;}),i.d(n,"fromValues",function(){return v;}),i.d(n,"set",function(){return p;}),i.d(n,"identity",function(){return w;}),i.d(n,"transpose",function(){return A;}),i.d(n,"invert",function(){return M;}),i.d(n,"adjoint",function(){return E;}),i.d(n,"determinant",function(){return L;}),i.d(n,"multiply",function(){return G;}),i.d(n,"translate",function(){return z;}),i.d(n,"rotate",function(){return et;}),i.d(n,"scale",function(){return x;}),i.d(n,"fromTranslation",function(){return y;}),i.d(n,"fromRotation",function(){return S;}),i.d(n,"fromScaling",function(){return C;}),i.d(n,"fromMat2d",function(){return P;}),i.d(n,"fromQuat",function(){return X;}),i.d(n,"normalFromMat4",function(){return $;}),i.d(n,"projection",function(){return K;}),i.d(n,"str",function(){return j;}),i.d(n,"frob",function(){return nt;}),i.d(n,"add",function(){return ct;}),i.d(n,"subtract",function(){return F;}),i.d(n,"multiplyScalar",function(){return R;}),i.d(n,"multiplyScalarAndAdd",function(){return Y;}),i.d(n,"exactEquals",function(){return q;}),i.d(n,"equals",function(){return lt;}),i.d(n,"mul",function(){return ut;}),i.d(n,"sub",function(){return Tt;});var s=i(2);function o(){var O=new s.ARRAY_TYPE(9);return s.ARRAY_TYPE!=Float32Array&&(O[1]=0,O[2]=0,O[3]=0,O[5]=0,O[6]=0,O[7]=0),O[0]=1,O[4]=1,O[8]=1,O;}function a(O,U){return O[0]=U[0],O[1]=U[1],O[2]=U[2],O[3]=U[4],O[4]=U[5],O[5]=U[6],O[6]=U[8],O[7]=U[9],O[8]=U[10],O;}function u(O){var U=new s.ARRAY_TYPE(9);return U[0]=O[0],U[1]=O[1],U[2]=O[2],U[3]=O[3],U[4]=O[4],U[5]=O[5],U[6]=O[6],U[7]=O[7],U[8]=O[8],U;}function d(O,U){return O[0]=U[0],O[1]=U[1],O[2]=U[2],O[3]=U[3],O[4]=U[4],O[5]=U[5],O[6]=U[6],O[7]=U[7],O[8]=U[8],O;}function v(O,U,_,H,at,ht,yt,Et,Dt){var D=new s.ARRAY_TYPE(9);return D[0]=O,D[1]=U,D[2]=_,D[3]=H,D[4]=at,D[5]=ht,D[6]=yt,D[7]=Et,D[8]=Dt,D;}function p(O,U,_,H,at,ht,yt,Et,Dt,D){return O[0]=U,O[1]=_,O[2]=H,O[3]=at,O[4]=ht,O[5]=yt,O[6]=Et,O[7]=Dt,O[8]=D,O;}function w(O){return O[0]=1,O[1]=0,O[2]=0,O[3]=0,O[4]=1,O[5]=0,O[6]=0,O[7]=0,O[8]=1,O;}function A(O,U){if(O===U){var _=U[1],H=U[2],at=U[5];O[1]=U[3],O[2]=U[6],O[3]=_,O[5]=U[7],O[6]=H,O[7]=at;}else O[0]=U[0],O[1]=U[3],O[2]=U[6],O[3]=U[1],O[4]=U[4],O[5]=U[7],O[6]=U[2],O[7]=U[5],O[8]=U[8];return O;}function M(O,U){var _=U[0],H=U[1],at=U[2],ht=U[3],yt=U[4],Et=U[5],Dt=U[6],D=U[7],N=U[8],J=N*yt-Et*D,Q=-N*ht+Et*Dt,V=D*ht-yt*Dt,tt=_*J+H*Q+at*V;return tt?(tt=1/tt,O[0]=J*tt,O[1]=(-N*H+at*D)*tt,O[2]=(Et*H-at*yt)*tt,O[3]=Q*tt,O[4]=(N*_-at*Dt)*tt,O[5]=(-Et*_+at*ht)*tt,O[6]=V*tt,O[7]=(-D*_+H*Dt)*tt,O[8]=(yt*_-H*ht)*tt,O):null;}function E(O,U){var _=U[0],H=U[1],at=U[2],ht=U[3],yt=U[4],Et=U[5],Dt=U[6],D=U[7],N=U[8];return O[0]=yt*N-Et*D,O[1]=at*D-H*N,O[2]=H*Et-at*yt,O[3]=Et*Dt-ht*N,O[4]=_*N-at*Dt,O[5]=at*ht-_*Et,O[6]=ht*D-yt*Dt,O[7]=H*Dt-_*D,O[8]=_*yt-H*ht,O;}function L(O){var U=O[0],_=O[1],H=O[2],at=O[3],ht=O[4],yt=O[5],Et=O[6],Dt=O[7],D=O[8];return U*(D*ht-yt*Dt)+_*(-D*at+yt*Et)+H*(Dt*at-ht*Et);}function G(O,U,_){var H=U[0],at=U[1],ht=U[2],yt=U[3],Et=U[4],Dt=U[5],D=U[6],N=U[7],J=U[8],Q=_[0],V=_[1],tt=_[2],g=_[3],I=_[4],B=_[5],Z=_[6],st=_[7],ft=_[8];return O[0]=Q*H+V*yt+tt*D,O[1]=Q*at+V*Et+tt*N,O[2]=Q*ht+V*Dt+tt*J,O[3]=g*H+I*yt+B*D,O[4]=g*at+I*Et+B*N,O[5]=g*ht+I*Dt+B*J,O[6]=Z*H+st*yt+ft*D,O[7]=Z*at+st*Et+ft*N,O[8]=Z*ht+st*Dt+ft*J,O;}function z(O,U,_){var H=U[0],at=U[1],ht=U[2],yt=U[3],Et=U[4],Dt=U[5],D=U[6],N=U[7],J=U[8],Q=_[0],V=_[1];return O[0]=H,O[1]=at,O[2]=ht,O[3]=yt,O[4]=Et,O[5]=Dt,O[6]=Q*H+V*yt+D,O[7]=Q*at+V*Et+N,O[8]=Q*ht+V*Dt+J,O;}function et(O,U,_){var H=U[0],at=U[1],ht=U[2],yt=U[3],Et=U[4],Dt=U[5],D=U[6],N=U[7],J=U[8],Q=Math.sin(_),V=Math.cos(_);return O[0]=V*H+Q*yt,O[1]=V*at+Q*Et,O[2]=V*ht+Q*Dt,O[3]=V*yt-Q*H,O[4]=V*Et-Q*at,O[5]=V*Dt-Q*ht,O[6]=D,O[7]=N,O[8]=J,O;}function x(O,U,_){var H=_[0],at=_[1];return O[0]=H*U[0],O[1]=H*U[1],O[2]=H*U[2],O[3]=at*U[3],O[4]=at*U[4],O[5]=at*U[5],O[6]=U[6],O[7]=U[7],O[8]=U[8],O;}function y(O,U){return O[0]=1,O[1]=0,O[2]=0,O[3]=0,O[4]=1,O[5]=0,O[6]=U[0],O[7]=U[1],O[8]=1,O;}function S(O,U){var _=Math.sin(U),H=Math.cos(U);return O[0]=H,O[1]=_,O[2]=0,O[3]=-_,O[4]=H,O[5]=0,O[6]=0,O[7]=0,O[8]=1,O;}function C(O,U){return O[0]=U[0],O[1]=0,O[2]=0,O[3]=0,O[4]=U[1],O[5]=0,O[6]=0,O[7]=0,O[8]=1,O;}function P(O,U){return O[0]=U[0],O[1]=U[1],O[2]=0,O[3]=U[2],O[4]=U[3],O[5]=0,O[6]=U[4],O[7]=U[5],O[8]=1,O;}function X(O,U){var _=U[0],H=U[1],at=U[2],ht=U[3],yt=_+_,Et=H+H,Dt=at+at,D=_*yt,N=H*yt,J=H*Et,Q=at*yt,V=at*Et,tt=at*Dt,g=ht*yt,I=ht*Et,B=ht*Dt;return O[0]=1-J-tt,O[3]=N-B,O[6]=Q+I,O[1]=N+B,O[4]=1-D-tt,O[7]=V-g,O[2]=Q-I,O[5]=V+g,O[8]=1-D-J,O;}function $(O,U){var _=U[0],H=U[1],at=U[2],ht=U[3],yt=U[4],Et=U[5],Dt=U[6],D=U[7],N=U[8],J=U[9],Q=U[10],V=U[11],tt=U[12],g=U[13],I=U[14],B=U[15],Z=_*Et-H*yt,st=_*Dt-at*yt,ft=_*D-ht*yt,dt=H*Dt-at*Et,ot=H*D-ht*Et,gt=at*D-ht*Dt,St=N*g-J*tt,Pt=N*I-Q*tt,Lt=N*B-V*tt,Rt=J*I-Q*g,Nt=J*B-V*g,$t=Q*B-V*I,Ut=Z*$t-st*Nt+ft*Rt+dt*Lt-ot*Pt+gt*St;return Ut?(Ut=1/Ut,O[0]=(Et*$t-Dt*Nt+D*Rt)*Ut,O[1]=(Dt*Lt-yt*$t-D*Pt)*Ut,O[2]=(yt*Nt-Et*Lt+D*St)*Ut,O[3]=(at*Nt-H*$t-ht*Rt)*Ut,O[4]=(_*$t-at*Lt+ht*Pt)*Ut,O[5]=(H*Lt-_*Nt-ht*St)*Ut,O[6]=(g*gt-I*ot+B*dt)*Ut,O[7]=(I*ft-tt*gt-B*st)*Ut,O[8]=(tt*ot-g*ft+B*Z)*Ut,O):null;}function K(O,U,_){return O[0]=2/U,O[1]=0,O[2]=0,O[3]=0,O[4]=-2/_,O[5]=0,O[6]=-1,O[7]=1,O[8]=1,O;}function j(O){return"mat3("+O[0]+", "+O[1]+", "+O[2]+", "+O[3]+", "+O[4]+", "+O[5]+", "+O[6]+", "+O[7]+", "+O[8]+")";}function nt(O){return Math.hypot(O[0],O[1],O[2],O[3],O[4],O[5],O[6],O[7],O[8]);}function ct(O,U,_){return O[0]=U[0]+_[0],O[1]=U[1]+_[1],O[2]=U[2]+_[2],O[3]=U[3]+_[3],O[4]=U[4]+_[4],O[5]=U[5]+_[5],O[6]=U[6]+_[6],O[7]=U[7]+_[7],O[8]=U[8]+_[8],O;}function F(O,U,_){return O[0]=U[0]-_[0],O[1]=U[1]-_[1],O[2]=U[2]-_[2],O[3]=U[3]-_[3],O[4]=U[4]-_[4],O[5]=U[5]-_[5],O[6]=U[6]-_[6],O[7]=U[7]-_[7],O[8]=U[8]-_[8],O;}function R(O,U,_){return O[0]=U[0]*_,O[1]=U[1]*_,O[2]=U[2]*_,O[3]=U[3]*_,O[4]=U[4]*_,O[5]=U[5]*_,O[6]=U[6]*_,O[7]=U[7]*_,O[8]=U[8]*_,O;}function Y(O,U,_,H){return O[0]=U[0]+_[0]*H,O[1]=U[1]+_[1]*H,O[2]=U[2]+_[2]*H,O[3]=U[3]+_[3]*H,O[4]=U[4]+_[4]*H,O[5]=U[5]+_[5]*H,O[6]=U[6]+_[6]*H,O[7]=U[7]+_[7]*H,O[8]=U[8]+_[8]*H,O;}function q(O,U){return O[0]===U[0]&&O[1]===U[1]&&O[2]===U[2]&&O[3]===U[3]&&O[4]===U[4]&&O[5]===U[5]&&O[6]===U[6]&&O[7]===U[7]&&O[8]===U[8];}function lt(O,U){var _=O[0],H=O[1],at=O[2],ht=O[3],yt=O[4],Et=O[5],Dt=O[6],D=O[7],N=O[8],J=U[0],Q=U[1],V=U[2],tt=U[3],g=U[4],I=U[5],B=U[6],Z=U[7],st=U[8];return Math.abs(_-J)<=s.EPSILON*Math.max(1,Math.abs(_),Math.abs(J))&&Math.abs(H-Q)<=s.EPSILON*Math.max(1,Math.abs(H),Math.abs(Q))&&Math.abs(at-V)<=s.EPSILON*Math.max(1,Math.abs(at),Math.abs(V))&&Math.abs(ht-tt)<=s.EPSILON*Math.max(1,Math.abs(ht),Math.abs(tt))&&Math.abs(yt-g)<=s.EPSILON*Math.max(1,Math.abs(yt),Math.abs(g))&&Math.abs(Et-I)<=s.EPSILON*Math.max(1,Math.abs(Et),Math.abs(I))&&Math.abs(Dt-B)<=s.EPSILON*Math.max(1,Math.abs(Dt),Math.abs(B))&&Math.abs(D-Z)<=s.EPSILON*Math.max(1,Math.abs(D),Math.abs(Z))&&Math.abs(N-st)<=s.EPSILON*Math.max(1,Math.abs(N),Math.abs(st));}var ut=G,Tt=F;},/* 6 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"copy",function(){return u;}),i.d(n,"fromValues",function(){return d;}),i.d(n,"set",function(){return v;}),i.d(n,"identity",function(){return p;}),i.d(n,"transpose",function(){return w;}),i.d(n,"invert",function(){return A;}),i.d(n,"adjoint",function(){return M;}),i.d(n,"determinant",function(){return E;}),i.d(n,"multiply",function(){return L;}),i.d(n,"translate",function(){return G;}),i.d(n,"scale",function(){return z;}),i.d(n,"rotate",function(){return et;}),i.d(n,"rotateX",function(){return x;}),i.d(n,"rotateY",function(){return y;}),i.d(n,"rotateZ",function(){return S;}),i.d(n,"fromTranslation",function(){return C;}),i.d(n,"fromScaling",function(){return P;}),i.d(n,"fromRotation",function(){return X;}),i.d(n,"fromXRotation",function(){return $;}),i.d(n,"fromYRotation",function(){return K;}),i.d(n,"fromZRotation",function(){return j;}),i.d(n,"fromRotationTranslation",function(){return nt;}),i.d(n,"fromQuat2",function(){return ct;}),i.d(n,"getTranslation",function(){return F;}),i.d(n,"getScaling",function(){return R;}),i.d(n,"getRotation",function(){return Y;}),i.d(n,"fromRotationTranslationScale",function(){return q;}),i.d(n,"fromRotationTranslationScaleOrigin",function(){return lt;}),i.d(n,"fromQuat",function(){return ut;}),i.d(n,"frustum",function(){return Tt;}),i.d(n,"perspective",function(){return O;}),i.d(n,"perspectiveFromFieldOfView",function(){return U;}),i.d(n,"ortho",function(){return _;}),i.d(n,"lookAt",function(){return H;}),i.d(n,"targetTo",function(){return at;}),i.d(n,"str",function(){return ht;}),i.d(n,"frob",function(){return yt;}),i.d(n,"add",function(){return Et;}),i.d(n,"subtract",function(){return Dt;}),i.d(n,"multiplyScalar",function(){return D;}),i.d(n,"multiplyScalarAndAdd",function(){return N;}),i.d(n,"exactEquals",function(){return J;}),i.d(n,"equals",function(){return Q;}),i.d(n,"mul",function(){return V;}),i.d(n,"sub",function(){return tt;});var s=i(2);function o(){var g=new s.ARRAY_TYPE(16);return s.ARRAY_TYPE!=Float32Array&&(g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[11]=0,g[12]=0,g[13]=0,g[14]=0),g[0]=1,g[5]=1,g[10]=1,g[15]=1,g;}function a(g){var I=new s.ARRAY_TYPE(16);return I[0]=g[0],I[1]=g[1],I[2]=g[2],I[3]=g[3],I[4]=g[4],I[5]=g[5],I[6]=g[6],I[7]=g[7],I[8]=g[8],I[9]=g[9],I[10]=g[10],I[11]=g[11],I[12]=g[12],I[13]=g[13],I[14]=g[14],I[15]=g[15],I;}function u(g,I){return g[0]=I[0],g[1]=I[1],g[2]=I[2],g[3]=I[3],g[4]=I[4],g[5]=I[5],g[6]=I[6],g[7]=I[7],g[8]=I[8],g[9]=I[9],g[10]=I[10],g[11]=I[11],g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15],g;}function d(g,I,B,Z,st,ft,dt,ot,gt,St,Pt,Lt,Rt,Nt,$t,Ut){var Ft=new s.ARRAY_TYPE(16);return Ft[0]=g,Ft[1]=I,Ft[2]=B,Ft[3]=Z,Ft[4]=st,Ft[5]=ft,Ft[6]=dt,Ft[7]=ot,Ft[8]=gt,Ft[9]=St,Ft[10]=Pt,Ft[11]=Lt,Ft[12]=Rt,Ft[13]=Nt,Ft[14]=$t,Ft[15]=Ut,Ft;}function v(g,I,B,Z,st,ft,dt,ot,gt,St,Pt,Lt,Rt,Nt,$t,Ut,Ft){return g[0]=I,g[1]=B,g[2]=Z,g[3]=st,g[4]=ft,g[5]=dt,g[6]=ot,g[7]=gt,g[8]=St,g[9]=Pt,g[10]=Lt,g[11]=Rt,g[12]=Nt,g[13]=$t,g[14]=Ut,g[15]=Ft,g;}function p(g){return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function w(g,I){if(g===I){var B=I[1],Z=I[2],st=I[3],ft=I[6],dt=I[7],ot=I[11];g[1]=I[4],g[2]=I[8],g[3]=I[12],g[4]=B,g[6]=I[9],g[7]=I[13],g[8]=Z,g[9]=ft,g[11]=I[14],g[12]=st,g[13]=dt,g[14]=ot;}else g[0]=I[0],g[1]=I[4],g[2]=I[8],g[3]=I[12],g[4]=I[1],g[5]=I[5],g[6]=I[9],g[7]=I[13],g[8]=I[2],g[9]=I[6],g[10]=I[10],g[11]=I[14],g[12]=I[3],g[13]=I[7],g[14]=I[11],g[15]=I[15];return g;}function A(g,I){var B=I[0],Z=I[1],st=I[2],ft=I[3],dt=I[4],ot=I[5],gt=I[6],St=I[7],Pt=I[8],Lt=I[9],Rt=I[10],Nt=I[11],$t=I[12],Ut=I[13],Ft=I[14],Qt=I[15],ee=B*ot-Z*dt,re=B*gt-st*dt,se=B*St-ft*dt,oe=Z*gt-st*ot,le=Z*St-ft*ot,Oe=st*St-ft*gt,De=Pt*Ut-Lt*$t,Ne=Pt*Ft-Rt*$t,Be=Pt*Qt-Nt*$t,Ye=Lt*Ft-Rt*Ut,Ge=Lt*Qt-Nt*Ut,je=Rt*Qt-Nt*Ft,ye=ee*je-re*Ge+se*Ye+oe*Be-le*Ne+Oe*De;return ye?(ye=1/ye,g[0]=(ot*je-gt*Ge+St*Ye)*ye,g[1]=(st*Ge-Z*je-ft*Ye)*ye,g[2]=(Ut*Oe-Ft*le+Qt*oe)*ye,g[3]=(Rt*le-Lt*Oe-Nt*oe)*ye,g[4]=(gt*Be-dt*je-St*Ne)*ye,g[5]=(B*je-st*Be+ft*Ne)*ye,g[6]=(Ft*se-$t*Oe-Qt*re)*ye,g[7]=(Pt*Oe-Rt*se+Nt*re)*ye,g[8]=(dt*Ge-ot*Be+St*De)*ye,g[9]=(Z*Be-B*Ge-ft*De)*ye,g[10]=($t*le-Ut*se+Qt*ee)*ye,g[11]=(Lt*se-Pt*le-Nt*ee)*ye,g[12]=(ot*Ne-dt*Ye-gt*De)*ye,g[13]=(B*Ye-Z*Ne+st*De)*ye,g[14]=(Ut*re-$t*oe-Ft*ee)*ye,g[15]=(Pt*oe-Lt*re+Rt*ee)*ye,g):null;}function M(g,I){var B=I[0],Z=I[1],st=I[2],ft=I[3],dt=I[4],ot=I[5],gt=I[6],St=I[7],Pt=I[8],Lt=I[9],Rt=I[10],Nt=I[11],$t=I[12],Ut=I[13],Ft=I[14],Qt=I[15];return g[0]=ot*(Rt*Qt-Nt*Ft)-Lt*(gt*Qt-St*Ft)+Ut*(gt*Nt-St*Rt),g[1]=-(Z*(Rt*Qt-Nt*Ft)-Lt*(st*Qt-ft*Ft)+Ut*(st*Nt-ft*Rt)),g[2]=Z*(gt*Qt-St*Ft)-ot*(st*Qt-ft*Ft)+Ut*(st*St-ft*gt),g[3]=-(Z*(gt*Nt-St*Rt)-ot*(st*Nt-ft*Rt)+Lt*(st*St-ft*gt)),g[4]=-(dt*(Rt*Qt-Nt*Ft)-Pt*(gt*Qt-St*Ft)+$t*(gt*Nt-St*Rt)),g[5]=B*(Rt*Qt-Nt*Ft)-Pt*(st*Qt-ft*Ft)+$t*(st*Nt-ft*Rt),g[6]=-(B*(gt*Qt-St*Ft)-dt*(st*Qt-ft*Ft)+$t*(st*St-ft*gt)),g[7]=B*(gt*Nt-St*Rt)-dt*(st*Nt-ft*Rt)+Pt*(st*St-ft*gt),g[8]=dt*(Lt*Qt-Nt*Ut)-Pt*(ot*Qt-St*Ut)+$t*(ot*Nt-St*Lt),g[9]=-(B*(Lt*Qt-Nt*Ut)-Pt*(Z*Qt-ft*Ut)+$t*(Z*Nt-ft*Lt)),g[10]=B*(ot*Qt-St*Ut)-dt*(Z*Qt-ft*Ut)+$t*(Z*St-ft*ot),g[11]=-(B*(ot*Nt-St*Lt)-dt*(Z*Nt-ft*Lt)+Pt*(Z*St-ft*ot)),g[12]=-(dt*(Lt*Ft-Rt*Ut)-Pt*(ot*Ft-gt*Ut)+$t*(ot*Rt-gt*Lt)),g[13]=B*(Lt*Ft-Rt*Ut)-Pt*(Z*Ft-st*Ut)+$t*(Z*Rt-st*Lt),g[14]=-(B*(ot*Ft-gt*Ut)-dt*(Z*Ft-st*Ut)+$t*(Z*gt-st*ot)),g[15]=B*(ot*Rt-gt*Lt)-dt*(Z*Rt-st*Lt)+Pt*(Z*gt-st*ot),g;}function E(g){var I=g[0],B=g[1],Z=g[2],st=g[3],ft=g[4],dt=g[5],ot=g[6],gt=g[7],St=g[8],Pt=g[9],Lt=g[10],Rt=g[11],Nt=g[12],$t=g[13],Ut=g[14],Ft=g[15],Qt=I*dt-B*ft,ee=I*ot-Z*ft,re=I*gt-st*ft,se=B*ot-Z*dt,oe=B*gt-st*dt,le=Z*gt-st*ot,Oe=St*$t-Pt*Nt,De=St*Ut-Lt*Nt,Ne=St*Ft-Rt*Nt,Be=Pt*Ut-Lt*$t,Ye=Pt*Ft-Rt*$t,Ge=Lt*Ft-Rt*Ut;return Qt*Ge-ee*Ye+re*Be+se*Ne-oe*De+le*Oe;}function L(g,I,B){var Z=I[0],st=I[1],ft=I[2],dt=I[3],ot=I[4],gt=I[5],St=I[6],Pt=I[7],Lt=I[8],Rt=I[9],Nt=I[10],$t=I[11],Ut=I[12],Ft=I[13],Qt=I[14],ee=I[15],re=B[0],se=B[1],oe=B[2],le=B[3];return g[0]=re*Z+se*ot+oe*Lt+le*Ut,g[1]=re*st+se*gt+oe*Rt+le*Ft,g[2]=re*ft+se*St+oe*Nt+le*Qt,g[3]=re*dt+se*Pt+oe*$t+le*ee,re=B[4],se=B[5],oe=B[6],le=B[7],g[4]=re*Z+se*ot+oe*Lt+le*Ut,g[5]=re*st+se*gt+oe*Rt+le*Ft,g[6]=re*ft+se*St+oe*Nt+le*Qt,g[7]=re*dt+se*Pt+oe*$t+le*ee,re=B[8],se=B[9],oe=B[10],le=B[11],g[8]=re*Z+se*ot+oe*Lt+le*Ut,g[9]=re*st+se*gt+oe*Rt+le*Ft,g[10]=re*ft+se*St+oe*Nt+le*Qt,g[11]=re*dt+se*Pt+oe*$t+le*ee,re=B[12],se=B[13],oe=B[14],le=B[15],g[12]=re*Z+se*ot+oe*Lt+le*Ut,g[13]=re*st+se*gt+oe*Rt+le*Ft,g[14]=re*ft+se*St+oe*Nt+le*Qt,g[15]=re*dt+se*Pt+oe*$t+le*ee,g;}function G(g,I,B){var Z=B[0],st=B[1],ft=B[2],dt,ot,gt,St,Pt,Lt,Rt,Nt,$t,Ut,Ft,Qt;return I===g?(g[12]=I[0]*Z+I[4]*st+I[8]*ft+I[12],g[13]=I[1]*Z+I[5]*st+I[9]*ft+I[13],g[14]=I[2]*Z+I[6]*st+I[10]*ft+I[14],g[15]=I[3]*Z+I[7]*st+I[11]*ft+I[15]):(dt=I[0],ot=I[1],gt=I[2],St=I[3],Pt=I[4],Lt=I[5],Rt=I[6],Nt=I[7],$t=I[8],Ut=I[9],Ft=I[10],Qt=I[11],g[0]=dt,g[1]=ot,g[2]=gt,g[3]=St,g[4]=Pt,g[5]=Lt,g[6]=Rt,g[7]=Nt,g[8]=$t,g[9]=Ut,g[10]=Ft,g[11]=Qt,g[12]=dt*Z+Pt*st+$t*ft+I[12],g[13]=ot*Z+Lt*st+Ut*ft+I[13],g[14]=gt*Z+Rt*st+Ft*ft+I[14],g[15]=St*Z+Nt*st+Qt*ft+I[15]),g;}function z(g,I,B){var Z=B[0],st=B[1],ft=B[2];return g[0]=I[0]*Z,g[1]=I[1]*Z,g[2]=I[2]*Z,g[3]=I[3]*Z,g[4]=I[4]*st,g[5]=I[5]*st,g[6]=I[6]*st,g[7]=I[7]*st,g[8]=I[8]*ft,g[9]=I[9]*ft,g[10]=I[10]*ft,g[11]=I[11]*ft,g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15],g;}function et(g,I,B,Z){var st=Z[0],ft=Z[1],dt=Z[2],ot=Math.hypot(st,ft,dt),gt,St,Pt,Lt,Rt,Nt,$t,Ut,Ft,Qt,ee,re,se,oe,le,Oe,De,Ne,Be,Ye,Ge,je,ye,lr;return ot<s.EPSILON?null:(ot=1/ot,st*=ot,ft*=ot,dt*=ot,gt=Math.sin(B),St=Math.cos(B),Pt=1-St,Lt=I[0],Rt=I[1],Nt=I[2],$t=I[3],Ut=I[4],Ft=I[5],Qt=I[6],ee=I[7],re=I[8],se=I[9],oe=I[10],le=I[11],Oe=st*st*Pt+St,De=ft*st*Pt+dt*gt,Ne=dt*st*Pt-ft*gt,Be=st*ft*Pt-dt*gt,Ye=ft*ft*Pt+St,Ge=dt*ft*Pt+st*gt,je=st*dt*Pt+ft*gt,ye=ft*dt*Pt-st*gt,lr=dt*dt*Pt+St,g[0]=Lt*Oe+Ut*De+re*Ne,g[1]=Rt*Oe+Ft*De+se*Ne,g[2]=Nt*Oe+Qt*De+oe*Ne,g[3]=$t*Oe+ee*De+le*Ne,g[4]=Lt*Be+Ut*Ye+re*Ge,g[5]=Rt*Be+Ft*Ye+se*Ge,g[6]=Nt*Be+Qt*Ye+oe*Ge,g[7]=$t*Be+ee*Ye+le*Ge,g[8]=Lt*je+Ut*ye+re*lr,g[9]=Rt*je+Ft*ye+se*lr,g[10]=Nt*je+Qt*ye+oe*lr,g[11]=$t*je+ee*ye+le*lr,I!==g&&(g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15]),g);}function x(g,I,B){var Z=Math.sin(B),st=Math.cos(B),ft=I[4],dt=I[5],ot=I[6],gt=I[7],St=I[8],Pt=I[9],Lt=I[10],Rt=I[11];return I!==g&&(g[0]=I[0],g[1]=I[1],g[2]=I[2],g[3]=I[3],g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15]),g[4]=ft*st+St*Z,g[5]=dt*st+Pt*Z,g[6]=ot*st+Lt*Z,g[7]=gt*st+Rt*Z,g[8]=St*st-ft*Z,g[9]=Pt*st-dt*Z,g[10]=Lt*st-ot*Z,g[11]=Rt*st-gt*Z,g;}function y(g,I,B){var Z=Math.sin(B),st=Math.cos(B),ft=I[0],dt=I[1],ot=I[2],gt=I[3],St=I[8],Pt=I[9],Lt=I[10],Rt=I[11];return I!==g&&(g[4]=I[4],g[5]=I[5],g[6]=I[6],g[7]=I[7],g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15]),g[0]=ft*st-St*Z,g[1]=dt*st-Pt*Z,g[2]=ot*st-Lt*Z,g[3]=gt*st-Rt*Z,g[8]=ft*Z+St*st,g[9]=dt*Z+Pt*st,g[10]=ot*Z+Lt*st,g[11]=gt*Z+Rt*st,g;}function S(g,I,B){var Z=Math.sin(B),st=Math.cos(B),ft=I[0],dt=I[1],ot=I[2],gt=I[3],St=I[4],Pt=I[5],Lt=I[6],Rt=I[7];return I!==g&&(g[8]=I[8],g[9]=I[9],g[10]=I[10],g[11]=I[11],g[12]=I[12],g[13]=I[13],g[14]=I[14],g[15]=I[15]),g[0]=ft*st+St*Z,g[1]=dt*st+Pt*Z,g[2]=ot*st+Lt*Z,g[3]=gt*st+Rt*Z,g[4]=St*st-ft*Z,g[5]=Pt*st-dt*Z,g[6]=Lt*st-ot*Z,g[7]=Rt*st-gt*Z,g;}function C(g,I){return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=I[0],g[13]=I[1],g[14]=I[2],g[15]=1,g;}function P(g,I){return g[0]=I[0],g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=I[1],g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=I[2],g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function X(g,I,B){var Z=B[0],st=B[1],ft=B[2],dt=Math.hypot(Z,st,ft),ot,gt,St;return dt<s.EPSILON?null:(dt=1/dt,Z*=dt,st*=dt,ft*=dt,ot=Math.sin(I),gt=Math.cos(I),St=1-gt,g[0]=Z*Z*St+gt,g[1]=st*Z*St+ft*ot,g[2]=ft*Z*St-st*ot,g[3]=0,g[4]=Z*st*St-ft*ot,g[5]=st*st*St+gt,g[6]=ft*st*St+Z*ot,g[7]=0,g[8]=Z*ft*St+st*ot,g[9]=st*ft*St-Z*ot,g[10]=ft*ft*St+gt,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g);}function $(g,I){var B=Math.sin(I),Z=Math.cos(I);return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=Z,g[6]=B,g[7]=0,g[8]=0,g[9]=-B,g[10]=Z,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function K(g,I){var B=Math.sin(I),Z=Math.cos(I);return g[0]=Z,g[1]=0,g[2]=-B,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=B,g[9]=0,g[10]=Z,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function j(g,I){var B=Math.sin(I),Z=Math.cos(I);return g[0]=Z,g[1]=B,g[2]=0,g[3]=0,g[4]=-B,g[5]=Z,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function nt(g,I,B){var Z=I[0],st=I[1],ft=I[2],dt=I[3],ot=Z+Z,gt=st+st,St=ft+ft,Pt=Z*ot,Lt=Z*gt,Rt=Z*St,Nt=st*gt,$t=st*St,Ut=ft*St,Ft=dt*ot,Qt=dt*gt,ee=dt*St;return g[0]=1-(Nt+Ut),g[1]=Lt+ee,g[2]=Rt-Qt,g[3]=0,g[4]=Lt-ee,g[5]=1-(Pt+Ut),g[6]=$t+Ft,g[7]=0,g[8]=Rt+Qt,g[9]=$t-Ft,g[10]=1-(Pt+Nt),g[11]=0,g[12]=B[0],g[13]=B[1],g[14]=B[2],g[15]=1,g;}function ct(g,I){var B=new s.ARRAY_TYPE(3),Z=-I[0],st=-I[1],ft=-I[2],dt=I[3],ot=I[4],gt=I[5],St=I[6],Pt=I[7],Lt=Z*Z+st*st+ft*ft+dt*dt;return Lt>0?(B[0]=(ot*dt+Pt*Z+gt*ft-St*st)*2/Lt,B[1]=(gt*dt+Pt*st+St*Z-ot*ft)*2/Lt,B[2]=(St*dt+Pt*ft+ot*st-gt*Z)*2/Lt):(B[0]=(ot*dt+Pt*Z+gt*ft-St*st)*2,B[1]=(gt*dt+Pt*st+St*Z-ot*ft)*2,B[2]=(St*dt+Pt*ft+ot*st-gt*Z)*2),nt(g,I,B),g;}function F(g,I){return g[0]=I[12],g[1]=I[13],g[2]=I[14],g;}function R(g,I){var B=I[0],Z=I[1],st=I[2],ft=I[4],dt=I[5],ot=I[6],gt=I[8],St=I[9],Pt=I[10];return g[0]=Math.hypot(B,Z,st),g[1]=Math.hypot(ft,dt,ot),g[2]=Math.hypot(gt,St,Pt),g;}function Y(g,I){var B=new s.ARRAY_TYPE(3);R(B,I);var Z=1/B[0],st=1/B[1],ft=1/B[2],dt=I[0]*Z,ot=I[1]*st,gt=I[2]*ft,St=I[4]*Z,Pt=I[5]*st,Lt=I[6]*ft,Rt=I[8]*Z,Nt=I[9]*st,$t=I[10]*ft,Ut=dt+Pt+$t,Ft=0;return Ut>0?(Ft=Math.sqrt(Ut+1)*2,g[3]=0.25*Ft,g[0]=(Lt-Nt)/Ft,g[1]=(Rt-gt)/Ft,g[2]=(ot-St)/Ft):dt>Pt&&dt>$t?(Ft=Math.sqrt(1+dt-Pt-$t)*2,g[3]=(Lt-Nt)/Ft,g[0]=0.25*Ft,g[1]=(ot+St)/Ft,g[2]=(Rt+gt)/Ft):Pt>$t?(Ft=Math.sqrt(1+Pt-dt-$t)*2,g[3]=(Rt-gt)/Ft,g[0]=(ot+St)/Ft,g[1]=0.25*Ft,g[2]=(Lt+Nt)/Ft):(Ft=Math.sqrt(1+$t-dt-Pt)*2,g[3]=(ot-St)/Ft,g[0]=(Rt+gt)/Ft,g[1]=(Lt+Nt)/Ft,g[2]=0.25*Ft),g;}function q(g,I,B,Z){var st=I[0],ft=I[1],dt=I[2],ot=I[3],gt=st+st,St=ft+ft,Pt=dt+dt,Lt=st*gt,Rt=st*St,Nt=st*Pt,$t=ft*St,Ut=ft*Pt,Ft=dt*Pt,Qt=ot*gt,ee=ot*St,re=ot*Pt,se=Z[0],oe=Z[1],le=Z[2];return g[0]=(1-($t+Ft))*se,g[1]=(Rt+re)*se,g[2]=(Nt-ee)*se,g[3]=0,g[4]=(Rt-re)*oe,g[5]=(1-(Lt+Ft))*oe,g[6]=(Ut+Qt)*oe,g[7]=0,g[8]=(Nt+ee)*le,g[9]=(Ut-Qt)*le,g[10]=(1-(Lt+$t))*le,g[11]=0,g[12]=B[0],g[13]=B[1],g[14]=B[2],g[15]=1,g;}function lt(g,I,B,Z,st){var ft=I[0],dt=I[1],ot=I[2],gt=I[3],St=ft+ft,Pt=dt+dt,Lt=ot+ot,Rt=ft*St,Nt=ft*Pt,$t=ft*Lt,Ut=dt*Pt,Ft=dt*Lt,Qt=ot*Lt,ee=gt*St,re=gt*Pt,se=gt*Lt,oe=Z[0],le=Z[1],Oe=Z[2],De=st[0],Ne=st[1],Be=st[2],Ye=(1-(Ut+Qt))*oe,Ge=(Nt+se)*oe,je=($t-re)*oe,ye=(Nt-se)*le,lr=(1-(Rt+Qt))*le,tn=(Ft+ee)*le,en=($t+re)*Oe,Yn=(Ft-ee)*Oe,jn=(1-(Rt+Ut))*Oe;return g[0]=Ye,g[1]=Ge,g[2]=je,g[3]=0,g[4]=ye,g[5]=lr,g[6]=tn,g[7]=0,g[8]=en,g[9]=Yn,g[10]=jn,g[11]=0,g[12]=B[0]+De-(Ye*De+ye*Ne+en*Be),g[13]=B[1]+Ne-(Ge*De+lr*Ne+Yn*Be),g[14]=B[2]+Be-(je*De+tn*Ne+jn*Be),g[15]=1,g;}function ut(g,I){var B=I[0],Z=I[1],st=I[2],ft=I[3],dt=B+B,ot=Z+Z,gt=st+st,St=B*dt,Pt=Z*dt,Lt=Z*ot,Rt=st*dt,Nt=st*ot,$t=st*gt,Ut=ft*dt,Ft=ft*ot,Qt=ft*gt;return g[0]=1-Lt-$t,g[1]=Pt+Qt,g[2]=Rt-Ft,g[3]=0,g[4]=Pt-Qt,g[5]=1-St-$t,g[6]=Nt+Ut,g[7]=0,g[8]=Rt+Ft,g[9]=Nt-Ut,g[10]=1-St-Lt,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g;}function Tt(g,I,B,Z,st,ft,dt){var ot=1/(B-I),gt=1/(st-Z),St=1/(ft-dt);return g[0]=ft*2*ot,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=ft*2*gt,g[6]=0,g[7]=0,g[8]=(B+I)*ot,g[9]=(st+Z)*gt,g[10]=(dt+ft)*St,g[11]=-1,g[12]=0,g[13]=0,g[14]=dt*ft*2*St,g[15]=0,g;}function O(g,I,B,Z,st){var ft=1/Math.tan(I/2),dt;return g[0]=ft/B,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=ft,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[11]=-1,g[12]=0,g[13]=0,g[15]=0,st!=null&&st!==1/0?(dt=1/(Z-st),g[10]=(st+Z)*dt,g[14]=2*st*Z*dt):(g[10]=-1,g[14]=-2*Z),g;}function U(g,I,B,Z){var st=Math.tan(I.upDegrees*Math.PI/180),ft=Math.tan(I.downDegrees*Math.PI/180),dt=Math.tan(I.leftDegrees*Math.PI/180),ot=Math.tan(I.rightDegrees*Math.PI/180),gt=2/(dt+ot),St=2/(st+ft);return g[0]=gt,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=St,g[6]=0,g[7]=0,g[8]=-((dt-ot)*gt*0.5),g[9]=(st-ft)*St*0.5,g[10]=Z/(B-Z),g[11]=-1,g[12]=0,g[13]=0,g[14]=Z*B/(B-Z),g[15]=0,g;}function _(g,I,B,Z,st,ft,dt){var ot=1/(I-B),gt=1/(Z-st),St=1/(ft-dt);return g[0]=-2*ot,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=-2*gt,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=2*St,g[11]=0,g[12]=(I+B)*ot,g[13]=(st+Z)*gt,g[14]=(dt+ft)*St,g[15]=1,g;}function H(g,I,B,Z){var st,ft,dt,ot,gt,St,Pt,Lt,Rt,Nt,$t=I[0],Ut=I[1],Ft=I[2],Qt=Z[0],ee=Z[1],re=Z[2],se=B[0],oe=B[1],le=B[2];return Math.abs($t-se)<s.EPSILON&&Math.abs(Ut-oe)<s.EPSILON&&Math.abs(Ft-le)<s.EPSILON?p(g):(Pt=$t-se,Lt=Ut-oe,Rt=Ft-le,Nt=1/Math.hypot(Pt,Lt,Rt),Pt*=Nt,Lt*=Nt,Rt*=Nt,st=ee*Rt-re*Lt,ft=re*Pt-Qt*Rt,dt=Qt*Lt-ee*Pt,Nt=Math.hypot(st,ft,dt),Nt?(Nt=1/Nt,st*=Nt,ft*=Nt,dt*=Nt):(st=0,ft=0,dt=0),ot=Lt*dt-Rt*ft,gt=Rt*st-Pt*dt,St=Pt*ft-Lt*st,Nt=Math.hypot(ot,gt,St),Nt?(Nt=1/Nt,ot*=Nt,gt*=Nt,St*=Nt):(ot=0,gt=0,St=0),g[0]=st,g[1]=ot,g[2]=Pt,g[3]=0,g[4]=ft,g[5]=gt,g[6]=Lt,g[7]=0,g[8]=dt,g[9]=St,g[10]=Rt,g[11]=0,g[12]=-(st*$t+ft*Ut+dt*Ft),g[13]=-(ot*$t+gt*Ut+St*Ft),g[14]=-(Pt*$t+Lt*Ut+Rt*Ft),g[15]=1,g);}function at(g,I,B,Z){var st=I[0],ft=I[1],dt=I[2],ot=Z[0],gt=Z[1],St=Z[2],Pt=st-B[0],Lt=ft-B[1],Rt=dt-B[2],Nt=Pt*Pt+Lt*Lt+Rt*Rt;Nt>0&&(Nt=1/Math.sqrt(Nt),Pt*=Nt,Lt*=Nt,Rt*=Nt);var $t=gt*Rt-St*Lt,Ut=St*Pt-ot*Rt,Ft=ot*Lt-gt*Pt;return Nt=$t*$t+Ut*Ut+Ft*Ft,Nt>0&&(Nt=1/Math.sqrt(Nt),$t*=Nt,Ut*=Nt,Ft*=Nt),g[0]=$t,g[1]=Ut,g[2]=Ft,g[3]=0,g[4]=Lt*Ft-Rt*Ut,g[5]=Rt*$t-Pt*Ft,g[6]=Pt*Ut-Lt*$t,g[7]=0,g[8]=Pt,g[9]=Lt,g[10]=Rt,g[11]=0,g[12]=st,g[13]=ft,g[14]=dt,g[15]=1,g;}function ht(g){return"mat4("+g[0]+", "+g[1]+", "+g[2]+", "+g[3]+", "+g[4]+", "+g[5]+", "+g[6]+", "+g[7]+", "+g[8]+", "+g[9]+", "+g[10]+", "+g[11]+", "+g[12]+", "+g[13]+", "+g[14]+", "+g[15]+")";}function yt(g){return Math.hypot(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]);}function Et(g,I,B){return g[0]=I[0]+B[0],g[1]=I[1]+B[1],g[2]=I[2]+B[2],g[3]=I[3]+B[3],g[4]=I[4]+B[4],g[5]=I[5]+B[5],g[6]=I[6]+B[6],g[7]=I[7]+B[7],g[8]=I[8]+B[8],g[9]=I[9]+B[9],g[10]=I[10]+B[10],g[11]=I[11]+B[11],g[12]=I[12]+B[12],g[13]=I[13]+B[13],g[14]=I[14]+B[14],g[15]=I[15]+B[15],g;}function Dt(g,I,B){return g[0]=I[0]-B[0],g[1]=I[1]-B[1],g[2]=I[2]-B[2],g[3]=I[3]-B[3],g[4]=I[4]-B[4],g[5]=I[5]-B[5],g[6]=I[6]-B[6],g[7]=I[7]-B[7],g[8]=I[8]-B[8],g[9]=I[9]-B[9],g[10]=I[10]-B[10],g[11]=I[11]-B[11],g[12]=I[12]-B[12],g[13]=I[13]-B[13],g[14]=I[14]-B[14],g[15]=I[15]-B[15],g;}function D(g,I,B){return g[0]=I[0]*B,g[1]=I[1]*B,g[2]=I[2]*B,g[3]=I[3]*B,g[4]=I[4]*B,g[5]=I[5]*B,g[6]=I[6]*B,g[7]=I[7]*B,g[8]=I[8]*B,g[9]=I[9]*B,g[10]=I[10]*B,g[11]=I[11]*B,g[12]=I[12]*B,g[13]=I[13]*B,g[14]=I[14]*B,g[15]=I[15]*B,g;}function N(g,I,B,Z){return g[0]=I[0]+B[0]*Z,g[1]=I[1]+B[1]*Z,g[2]=I[2]+B[2]*Z,g[3]=I[3]+B[3]*Z,g[4]=I[4]+B[4]*Z,g[5]=I[5]+B[5]*Z,g[6]=I[6]+B[6]*Z,g[7]=I[7]+B[7]*Z,g[8]=I[8]+B[8]*Z,g[9]=I[9]+B[9]*Z,g[10]=I[10]+B[10]*Z,g[11]=I[11]+B[11]*Z,g[12]=I[12]+B[12]*Z,g[13]=I[13]+B[13]*Z,g[14]=I[14]+B[14]*Z,g[15]=I[15]+B[15]*Z,g;}function J(g,I){return g[0]===I[0]&&g[1]===I[1]&&g[2]===I[2]&&g[3]===I[3]&&g[4]===I[4]&&g[5]===I[5]&&g[6]===I[6]&&g[7]===I[7]&&g[8]===I[8]&&g[9]===I[9]&&g[10]===I[10]&&g[11]===I[11]&&g[12]===I[12]&&g[13]===I[13]&&g[14]===I[14]&&g[15]===I[15];}function Q(g,I){var B=g[0],Z=g[1],st=g[2],ft=g[3],dt=g[4],ot=g[5],gt=g[6],St=g[7],Pt=g[8],Lt=g[9],Rt=g[10],Nt=g[11],$t=g[12],Ut=g[13],Ft=g[14],Qt=g[15],ee=I[0],re=I[1],se=I[2],oe=I[3],le=I[4],Oe=I[5],De=I[6],Ne=I[7],Be=I[8],Ye=I[9],Ge=I[10],je=I[11],ye=I[12],lr=I[13],tn=I[14],en=I[15];return Math.abs(B-ee)<=s.EPSILON*Math.max(1,Math.abs(B),Math.abs(ee))&&Math.abs(Z-re)<=s.EPSILON*Math.max(1,Math.abs(Z),Math.abs(re))&&Math.abs(st-se)<=s.EPSILON*Math.max(1,Math.abs(st),Math.abs(se))&&Math.abs(ft-oe)<=s.EPSILON*Math.max(1,Math.abs(ft),Math.abs(oe))&&Math.abs(dt-le)<=s.EPSILON*Math.max(1,Math.abs(dt),Math.abs(le))&&Math.abs(ot-Oe)<=s.EPSILON*Math.max(1,Math.abs(ot),Math.abs(Oe))&&Math.abs(gt-De)<=s.EPSILON*Math.max(1,Math.abs(gt),Math.abs(De))&&Math.abs(St-Ne)<=s.EPSILON*Math.max(1,Math.abs(St),Math.abs(Ne))&&Math.abs(Pt-Be)<=s.EPSILON*Math.max(1,Math.abs(Pt),Math.abs(Be))&&Math.abs(Lt-Ye)<=s.EPSILON*Math.max(1,Math.abs(Lt),Math.abs(Ye))&&Math.abs(Rt-Ge)<=s.EPSILON*Math.max(1,Math.abs(Rt),Math.abs(Ge))&&Math.abs(Nt-je)<=s.EPSILON*Math.max(1,Math.abs(Nt),Math.abs(je))&&Math.abs($t-ye)<=s.EPSILON*Math.max(1,Math.abs($t),Math.abs(ye))&&Math.abs(Ut-lr)<=s.EPSILON*Math.max(1,Math.abs(Ut),Math.abs(lr))&&Math.abs(Ft-tn)<=s.EPSILON*Math.max(1,Math.abs(Ft),Math.abs(tn))&&Math.abs(Qt-en)<=s.EPSILON*Math.max(1,Math.abs(Qt),Math.abs(en));}var V=L,tt=Dt;},/* 7 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return d;}),i.d(n,"identity",function(){return v;}),i.d(n,"setAxisAngle",function(){return p;}),i.d(n,"getAxisAngle",function(){return w;}),i.d(n,"getAngle",function(){return A;}),i.d(n,"multiply",function(){return M;}),i.d(n,"rotateX",function(){return E;}),i.d(n,"rotateY",function(){return L;}),i.d(n,"rotateZ",function(){return G;}),i.d(n,"calculateW",function(){return z;}),i.d(n,"exp",function(){return et;}),i.d(n,"ln",function(){return x;}),i.d(n,"pow",function(){return y;}),i.d(n,"slerp",function(){return S;}),i.d(n,"random",function(){return C;}),i.d(n,"invert",function(){return P;}),i.d(n,"conjugate",function(){return X;}),i.d(n,"fromMat3",function(){return $;}),i.d(n,"fromEuler",function(){return K;}),i.d(n,"str",function(){return j;}),i.d(n,"clone",function(){return nt;}),i.d(n,"fromValues",function(){return ct;}),i.d(n,"copy",function(){return F;}),i.d(n,"set",function(){return R;}),i.d(n,"add",function(){return Y;}),i.d(n,"mul",function(){return q;}),i.d(n,"scale",function(){return lt;}),i.d(n,"dot",function(){return ut;}),i.d(n,"lerp",function(){return Tt;}),i.d(n,"length",function(){return O;}),i.d(n,"len",function(){return U;}),i.d(n,"squaredLength",function(){return _;}),i.d(n,"sqrLen",function(){return H;}),i.d(n,"normalize",function(){return at;}),i.d(n,"exactEquals",function(){return ht;}),i.d(n,"equals",function(){return yt;}),i.d(n,"rotationTo",function(){return Et;}),i.d(n,"sqlerp",function(){return Dt;}),i.d(n,"setAxes",function(){return D;});var s=i(2),o=i(5),a=i(8),u=i(9);function d(){var N=new s.ARRAY_TYPE(4);return s.ARRAY_TYPE!=Float32Array&&(N[0]=0,N[1]=0,N[2]=0),N[3]=1,N;}function v(N){return N[0]=0,N[1]=0,N[2]=0,N[3]=1,N;}function p(N,J,Q){Q=Q*0.5;var V=Math.sin(Q);return N[0]=V*J[0],N[1]=V*J[1],N[2]=V*J[2],N[3]=Math.cos(Q),N;}function w(N,J){var Q=Math.acos(J[3])*2,V=Math.sin(Q/2);return V>s.EPSILON?(N[0]=J[0]/V,N[1]=J[1]/V,N[2]=J[2]/V):(N[0]=1,N[1]=0,N[2]=0),Q;}function A(N,J){var Q=ut(N,J);return Math.acos(2*Q*Q-1);}function M(N,J,Q){var V=J[0],tt=J[1],g=J[2],I=J[3],B=Q[0],Z=Q[1],st=Q[2],ft=Q[3];return N[0]=V*ft+I*B+tt*st-g*Z,N[1]=tt*ft+I*Z+g*B-V*st,N[2]=g*ft+I*st+V*Z-tt*B,N[3]=I*ft-V*B-tt*Z-g*st,N;}function E(N,J,Q){Q*=0.5;var V=J[0],tt=J[1],g=J[2],I=J[3],B=Math.sin(Q),Z=Math.cos(Q);return N[0]=V*Z+I*B,N[1]=tt*Z+g*B,N[2]=g*Z-tt*B,N[3]=I*Z-V*B,N;}function L(N,J,Q){Q*=0.5;var V=J[0],tt=J[1],g=J[2],I=J[3],B=Math.sin(Q),Z=Math.cos(Q);return N[0]=V*Z-g*B,N[1]=tt*Z+I*B,N[2]=g*Z+V*B,N[3]=I*Z-tt*B,N;}function G(N,J,Q){Q*=0.5;var V=J[0],tt=J[1],g=J[2],I=J[3],B=Math.sin(Q),Z=Math.cos(Q);return N[0]=V*Z+tt*B,N[1]=tt*Z-V*B,N[2]=g*Z+I*B,N[3]=I*Z-g*B,N;}function z(N,J){var Q=J[0],V=J[1],tt=J[2];return N[0]=Q,N[1]=V,N[2]=tt,N[3]=Math.sqrt(Math.abs(1-Q*Q-V*V-tt*tt)),N;}function et(N,J){var Q=J[0],V=J[1],tt=J[2],g=J[3],I=Math.sqrt(Q*Q+V*V+tt*tt),B=Math.exp(g),Z=I>0?B*Math.sin(I)/I:0;return N[0]=Q*Z,N[1]=V*Z,N[2]=tt*Z,N[3]=B*Math.cos(I),N;}function x(N,J){var Q=J[0],V=J[1],tt=J[2],g=J[3],I=Math.sqrt(Q*Q+V*V+tt*tt),B=I>0?Math.atan2(I,g)/I:0;return N[0]=Q*B,N[1]=V*B,N[2]=tt*B,N[3]=0.5*Math.log(Q*Q+V*V+tt*tt+g*g),N;}function y(N,J,Q){return x(N,J),lt(N,N,Q),et(N,N),N;}function S(N,J,Q,V){var tt=J[0],g=J[1],I=J[2],B=J[3],Z=Q[0],st=Q[1],ft=Q[2],dt=Q[3],ot,gt,St,Pt,Lt;return gt=tt*Z+g*st+I*ft+B*dt,gt<0&&(gt=-gt,Z=-Z,st=-st,ft=-ft,dt=-dt),1-gt>s.EPSILON?(ot=Math.acos(gt),St=Math.sin(ot),Pt=Math.sin((1-V)*ot)/St,Lt=Math.sin(V*ot)/St):(Pt=1-V,Lt=V),N[0]=Pt*tt+Lt*Z,N[1]=Pt*g+Lt*st,N[2]=Pt*I+Lt*ft,N[3]=Pt*B+Lt*dt,N;}function C(N){var J=s.RANDOM(),Q=s.RANDOM(),V=s.RANDOM(),tt=Math.sqrt(1-J),g=Math.sqrt(J);return N[0]=tt*Math.sin(2*Math.PI*Q),N[1]=tt*Math.cos(2*Math.PI*Q),N[2]=g*Math.sin(2*Math.PI*V),N[3]=g*Math.cos(2*Math.PI*V),N;}function P(N,J){var Q=J[0],V=J[1],tt=J[2],g=J[3],I=Q*Q+V*V+tt*tt+g*g,B=I?1/I:0;return N[0]=-Q*B,N[1]=-V*B,N[2]=-tt*B,N[3]=g*B,N;}function X(N,J){return N[0]=-J[0],N[1]=-J[1],N[2]=-J[2],N[3]=J[3],N;}function $(N,J){var Q=J[0]+J[4]+J[8],V;if(Q>0)V=Math.sqrt(Q+1),N[3]=0.5*V,V=0.5/V,N[0]=(J[5]-J[7])*V,N[1]=(J[6]-J[2])*V,N[2]=(J[1]-J[3])*V;else{var tt=0;J[4]>J[0]&&(tt=1),J[8]>J[tt*3+tt]&&(tt=2);var g=(tt+1)%3,I=(tt+2)%3;V=Math.sqrt(J[tt*3+tt]-J[g*3+g]-J[I*3+I]+1),N[tt]=0.5*V,V=0.5/V,N[3]=(J[g*3+I]-J[I*3+g])*V,N[g]=(J[g*3+tt]+J[tt*3+g])*V,N[I]=(J[I*3+tt]+J[tt*3+I])*V;}return N;}function K(N,J,Q,V){var tt=0.5*Math.PI/180;J*=tt,Q*=tt,V*=tt;var g=Math.sin(J),I=Math.cos(J),B=Math.sin(Q),Z=Math.cos(Q),st=Math.sin(V),ft=Math.cos(V);return N[0]=g*Z*ft-I*B*st,N[1]=I*B*ft+g*Z*st,N[2]=I*Z*st-g*B*ft,N[3]=I*Z*ft+g*B*st,N;}function j(N){return"quat("+N[0]+", "+N[1]+", "+N[2]+", "+N[3]+")";}var nt=u.clone,ct=u.fromValues,F=u.copy,R=u.set,Y=u.add,q=M,lt=u.scale,ut=u.dot,Tt=u.lerp,O=u.length,U=O,_=u.squaredLength,H=_,at=u.normalize,ht=u.exactEquals,yt=u.equals,Et=function(){var N=a.create(),J=a.fromValues(1,0,0),Q=a.fromValues(0,1,0);return function(V,tt,g){var I=a.dot(tt,g);return I<-0.999999?(a.cross(N,J,tt),a.len(N)<1e-6&&a.cross(N,Q,tt),a.normalize(N,N),p(V,N,Math.PI),V):I>0.999999?(V[0]=0,V[1]=0,V[2]=0,V[3]=1,V):(a.cross(N,tt,g),V[0]=N[0],V[1]=N[1],V[2]=N[2],V[3]=1+I,at(V,V));};}(),Dt=function(){var N=d(),J=d();return function(Q,V,tt,g,I,B){return S(N,V,I,B),S(J,tt,g,B),S(Q,N,J,2*B*(1-B)),Q;};}(),D=function(){var N=o.create();return function(J,Q,V,tt){return N[0]=V[0],N[3]=V[1],N[6]=V[2],N[1]=tt[0],N[4]=tt[1],N[7]=tt[2],N[2]=-Q[0],N[5]=-Q[1],N[8]=-Q[2],at(J,$(J,N));};}();},/* 8 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"length",function(){return u;}),i.d(n,"fromValues",function(){return d;}),i.d(n,"copy",function(){return v;}),i.d(n,"set",function(){return p;}),i.d(n,"add",function(){return w;}),i.d(n,"subtract",function(){return A;}),i.d(n,"multiply",function(){return M;}),i.d(n,"divide",function(){return E;}),i.d(n,"ceil",function(){return L;}),i.d(n,"floor",function(){return G;}),i.d(n,"min",function(){return z;}),i.d(n,"max",function(){return et;}),i.d(n,"round",function(){return x;}),i.d(n,"scale",function(){return y;}),i.d(n,"scaleAndAdd",function(){return S;}),i.d(n,"distance",function(){return C;}),i.d(n,"squaredDistance",function(){return P;}),i.d(n,"squaredLength",function(){return X;}),i.d(n,"negate",function(){return $;}),i.d(n,"inverse",function(){return K;}),i.d(n,"normalize",function(){return j;}),i.d(n,"dot",function(){return nt;}),i.d(n,"cross",function(){return ct;}),i.d(n,"lerp",function(){return F;}),i.d(n,"hermite",function(){return R;}),i.d(n,"bezier",function(){return Y;}),i.d(n,"random",function(){return q;}),i.d(n,"transformMat4",function(){return lt;}),i.d(n,"transformMat3",function(){return ut;}),i.d(n,"transformQuat",function(){return Tt;}),i.d(n,"rotateX",function(){return O;}),i.d(n,"rotateY",function(){return U;}),i.d(n,"rotateZ",function(){return _;}),i.d(n,"angle",function(){return H;}),i.d(n,"zero",function(){return at;}),i.d(n,"str",function(){return ht;}),i.d(n,"exactEquals",function(){return yt;}),i.d(n,"equals",function(){return Et;}),i.d(n,"sub",function(){return Dt;}),i.d(n,"mul",function(){return D;}),i.d(n,"div",function(){return N;}),i.d(n,"dist",function(){return J;}),i.d(n,"sqrDist",function(){return Q;}),i.d(n,"len",function(){return V;}),i.d(n,"sqrLen",function(){return tt;}),i.d(n,"forEach",function(){return g;});var s=i(2);function o(){var I=new s.ARRAY_TYPE(3);return s.ARRAY_TYPE!=Float32Array&&(I[0]=0,I[1]=0,I[2]=0),I;}function a(I){var B=new s.ARRAY_TYPE(3);return B[0]=I[0],B[1]=I[1],B[2]=I[2],B;}function u(I){var B=I[0],Z=I[1],st=I[2];return Math.hypot(B,Z,st);}function d(I,B,Z){var st=new s.ARRAY_TYPE(3);return st[0]=I,st[1]=B,st[2]=Z,st;}function v(I,B){return I[0]=B[0],I[1]=B[1],I[2]=B[2],I;}function p(I,B,Z,st){return I[0]=B,I[1]=Z,I[2]=st,I;}function w(I,B,Z){return I[0]=B[0]+Z[0],I[1]=B[1]+Z[1],I[2]=B[2]+Z[2],I;}function A(I,B,Z){return I[0]=B[0]-Z[0],I[1]=B[1]-Z[1],I[2]=B[2]-Z[2],I;}function M(I,B,Z){return I[0]=B[0]*Z[0],I[1]=B[1]*Z[1],I[2]=B[2]*Z[2],I;}function E(I,B,Z){return I[0]=B[0]/Z[0],I[1]=B[1]/Z[1],I[2]=B[2]/Z[2],I;}function L(I,B){return I[0]=Math.ceil(B[0]),I[1]=Math.ceil(B[1]),I[2]=Math.ceil(B[2]),I;}function G(I,B){return I[0]=Math.floor(B[0]),I[1]=Math.floor(B[1]),I[2]=Math.floor(B[2]),I;}function z(I,B,Z){return I[0]=Math.min(B[0],Z[0]),I[1]=Math.min(B[1],Z[1]),I[2]=Math.min(B[2],Z[2]),I;}function et(I,B,Z){return I[0]=Math.max(B[0],Z[0]),I[1]=Math.max(B[1],Z[1]),I[2]=Math.max(B[2],Z[2]),I;}function x(I,B){return I[0]=Math.round(B[0]),I[1]=Math.round(B[1]),I[2]=Math.round(B[2]),I;}function y(I,B,Z){return I[0]=B[0]*Z,I[1]=B[1]*Z,I[2]=B[2]*Z,I;}function S(I,B,Z,st){return I[0]=B[0]+Z[0]*st,I[1]=B[1]+Z[1]*st,I[2]=B[2]+Z[2]*st,I;}function C(I,B){var Z=B[0]-I[0],st=B[1]-I[1],ft=B[2]-I[2];return Math.hypot(Z,st,ft);}function P(I,B){var Z=B[0]-I[0],st=B[1]-I[1],ft=B[2]-I[2];return Z*Z+st*st+ft*ft;}function X(I){var B=I[0],Z=I[1],st=I[2];return B*B+Z*Z+st*st;}function $(I,B){return I[0]=-B[0],I[1]=-B[1],I[2]=-B[2],I;}function K(I,B){return I[0]=1/B[0],I[1]=1/B[1],I[2]=1/B[2],I;}function j(I,B){var Z=B[0],st=B[1],ft=B[2],dt=Z*Z+st*st+ft*ft;return dt>0&&(dt=1/Math.sqrt(dt)),I[0]=B[0]*dt,I[1]=B[1]*dt,I[2]=B[2]*dt,I;}function nt(I,B){return I[0]*B[0]+I[1]*B[1]+I[2]*B[2];}function ct(I,B,Z){var st=B[0],ft=B[1],dt=B[2],ot=Z[0],gt=Z[1],St=Z[2];return I[0]=ft*St-dt*gt,I[1]=dt*ot-st*St,I[2]=st*gt-ft*ot,I;}function F(I,B,Z,st){var ft=B[0],dt=B[1],ot=B[2];return I[0]=ft+st*(Z[0]-ft),I[1]=dt+st*(Z[1]-dt),I[2]=ot+st*(Z[2]-ot),I;}function R(I,B,Z,st,ft,dt){var ot=dt*dt,gt=ot*(2*dt-3)+1,St=ot*(dt-2)+dt,Pt=ot*(dt-1),Lt=ot*(3-2*dt);return I[0]=B[0]*gt+Z[0]*St+st[0]*Pt+ft[0]*Lt,I[1]=B[1]*gt+Z[1]*St+st[1]*Pt+ft[1]*Lt,I[2]=B[2]*gt+Z[2]*St+st[2]*Pt+ft[2]*Lt,I;}function Y(I,B,Z,st,ft,dt){var ot=1-dt,gt=ot*ot,St=dt*dt,Pt=gt*ot,Lt=3*dt*gt,Rt=3*St*ot,Nt=St*dt;return I[0]=B[0]*Pt+Z[0]*Lt+st[0]*Rt+ft[0]*Nt,I[1]=B[1]*Pt+Z[1]*Lt+st[1]*Rt+ft[1]*Nt,I[2]=B[2]*Pt+Z[2]*Lt+st[2]*Rt+ft[2]*Nt,I;}function q(I,B){B=B||1;var Z=s.RANDOM()*2*Math.PI,st=s.RANDOM()*2-1,ft=Math.sqrt(1-st*st)*B;return I[0]=Math.cos(Z)*ft,I[1]=Math.sin(Z)*ft,I[2]=st*B,I;}function lt(I,B,Z){var st=B[0],ft=B[1],dt=B[2],ot=Z[3]*st+Z[7]*ft+Z[11]*dt+Z[15];return ot=ot||1,I[0]=(Z[0]*st+Z[4]*ft+Z[8]*dt+Z[12])/ot,I[1]=(Z[1]*st+Z[5]*ft+Z[9]*dt+Z[13])/ot,I[2]=(Z[2]*st+Z[6]*ft+Z[10]*dt+Z[14])/ot,I;}function ut(I,B,Z){var st=B[0],ft=B[1],dt=B[2];return I[0]=st*Z[0]+ft*Z[3]+dt*Z[6],I[1]=st*Z[1]+ft*Z[4]+dt*Z[7],I[2]=st*Z[2]+ft*Z[5]+dt*Z[8],I;}function Tt(I,B,Z){var st=Z[0],ft=Z[1],dt=Z[2],ot=Z[3],gt=B[0],St=B[1],Pt=B[2],Lt=ft*Pt-dt*St,Rt=dt*gt-st*Pt,Nt=st*St-ft*gt,$t=ft*Nt-dt*Rt,Ut=dt*Lt-st*Nt,Ft=st*Rt-ft*Lt,Qt=ot*2;return Lt*=Qt,Rt*=Qt,Nt*=Qt,$t*=2,Ut*=2,Ft*=2,I[0]=gt+Lt+$t,I[1]=St+Rt+Ut,I[2]=Pt+Nt+Ft,I;}function O(I,B,Z,st){var ft=[],dt=[];return ft[0]=B[0]-Z[0],ft[1]=B[1]-Z[1],ft[2]=B[2]-Z[2],dt[0]=ft[0],dt[1]=ft[1]*Math.cos(st)-ft[2]*Math.sin(st),dt[2]=ft[1]*Math.sin(st)+ft[2]*Math.cos(st),I[0]=dt[0]+Z[0],I[1]=dt[1]+Z[1],I[2]=dt[2]+Z[2],I;}function U(I,B,Z,st){var ft=[],dt=[];return ft[0]=B[0]-Z[0],ft[1]=B[1]-Z[1],ft[2]=B[2]-Z[2],dt[0]=ft[2]*Math.sin(st)+ft[0]*Math.cos(st),dt[1]=ft[1],dt[2]=ft[2]*Math.cos(st)-ft[0]*Math.sin(st),I[0]=dt[0]+Z[0],I[1]=dt[1]+Z[1],I[2]=dt[2]+Z[2],I;}function _(I,B,Z,st){var ft=[],dt=[];return ft[0]=B[0]-Z[0],ft[1]=B[1]-Z[1],ft[2]=B[2]-Z[2],dt[0]=ft[0]*Math.cos(st)-ft[1]*Math.sin(st),dt[1]=ft[0]*Math.sin(st)+ft[1]*Math.cos(st),dt[2]=ft[2],I[0]=dt[0]+Z[0],I[1]=dt[1]+Z[1],I[2]=dt[2]+Z[2],I;}function H(I,B){var Z=I[0],st=I[1],ft=I[2],dt=B[0],ot=B[1],gt=B[2],St=Math.sqrt(Z*Z+st*st+ft*ft),Pt=Math.sqrt(dt*dt+ot*ot+gt*gt),Lt=St*Pt,Rt=Lt&&nt(I,B)/Lt;return Math.acos(Math.min(Math.max(Rt,-1),1));}function at(I){return I[0]=0,I[1]=0,I[2]=0,I;}function ht(I){return"vec3("+I[0]+", "+I[1]+", "+I[2]+")";}function yt(I,B){return I[0]===B[0]&&I[1]===B[1]&&I[2]===B[2];}function Et(I,B){var Z=I[0],st=I[1],ft=I[2],dt=B[0],ot=B[1],gt=B[2];return Math.abs(Z-dt)<=s.EPSILON*Math.max(1,Math.abs(Z),Math.abs(dt))&&Math.abs(st-ot)<=s.EPSILON*Math.max(1,Math.abs(st),Math.abs(ot))&&Math.abs(ft-gt)<=s.EPSILON*Math.max(1,Math.abs(ft),Math.abs(gt));}var Dt=A,D=M,N=E,J=C,Q=P,V=u,tt=X,g=function(){var I=o();return function(B,Z,st,ft,dt,ot){var gt,St;for(Z||(Z=3),st||(st=0),ft?St=Math.min(ft*Z+st,B.length):St=B.length,gt=st;gt<St;gt+=Z)I[0]=B[gt],I[1]=B[gt+1],I[2]=B[gt+2],dt(I,I,ot),B[gt]=I[0],B[gt+1]=I[1],B[gt+2]=I[2];return B;};}();},/* 9 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"fromValues",function(){return u;}),i.d(n,"copy",function(){return d;}),i.d(n,"set",function(){return v;}),i.d(n,"add",function(){return p;}),i.d(n,"subtract",function(){return w;}),i.d(n,"multiply",function(){return A;}),i.d(n,"divide",function(){return M;}),i.d(n,"ceil",function(){return E;}),i.d(n,"floor",function(){return L;}),i.d(n,"min",function(){return G;}),i.d(n,"max",function(){return z;}),i.d(n,"round",function(){return et;}),i.d(n,"scale",function(){return x;}),i.d(n,"scaleAndAdd",function(){return y;}),i.d(n,"distance",function(){return S;}),i.d(n,"squaredDistance",function(){return C;}),i.d(n,"length",function(){return P;}),i.d(n,"squaredLength",function(){return X;}),i.d(n,"negate",function(){return $;}),i.d(n,"inverse",function(){return K;}),i.d(n,"normalize",function(){return j;}),i.d(n,"dot",function(){return nt;}),i.d(n,"cross",function(){return ct;}),i.d(n,"lerp",function(){return F;}),i.d(n,"random",function(){return R;}),i.d(n,"transformMat4",function(){return Y;}),i.d(n,"transformQuat",function(){return q;}),i.d(n,"zero",function(){return lt;}),i.d(n,"str",function(){return ut;}),i.d(n,"exactEquals",function(){return Tt;}),i.d(n,"equals",function(){return O;}),i.d(n,"sub",function(){return U;}),i.d(n,"mul",function(){return _;}),i.d(n,"div",function(){return H;}),i.d(n,"dist",function(){return at;}),i.d(n,"sqrDist",function(){return ht;}),i.d(n,"len",function(){return yt;}),i.d(n,"sqrLen",function(){return Et;}),i.d(n,"forEach",function(){return Dt;});var s=i(2);function o(){var D=new s.ARRAY_TYPE(4);return s.ARRAY_TYPE!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0,D[3]=0),D;}function a(D){var N=new s.ARRAY_TYPE(4);return N[0]=D[0],N[1]=D[1],N[2]=D[2],N[3]=D[3],N;}function u(D,N,J,Q){var V=new s.ARRAY_TYPE(4);return V[0]=D,V[1]=N,V[2]=J,V[3]=Q,V;}function d(D,N){return D[0]=N[0],D[1]=N[1],D[2]=N[2],D[3]=N[3],D;}function v(D,N,J,Q,V){return D[0]=N,D[1]=J,D[2]=Q,D[3]=V,D;}function p(D,N,J){return D[0]=N[0]+J[0],D[1]=N[1]+J[1],D[2]=N[2]+J[2],D[3]=N[3]+J[3],D;}function w(D,N,J){return D[0]=N[0]-J[0],D[1]=N[1]-J[1],D[2]=N[2]-J[2],D[3]=N[3]-J[3],D;}function A(D,N,J){return D[0]=N[0]*J[0],D[1]=N[1]*J[1],D[2]=N[2]*J[2],D[3]=N[3]*J[3],D;}function M(D,N,J){return D[0]=N[0]/J[0],D[1]=N[1]/J[1],D[2]=N[2]/J[2],D[3]=N[3]/J[3],D;}function E(D,N){return D[0]=Math.ceil(N[0]),D[1]=Math.ceil(N[1]),D[2]=Math.ceil(N[2]),D[3]=Math.ceil(N[3]),D;}function L(D,N){return D[0]=Math.floor(N[0]),D[1]=Math.floor(N[1]),D[2]=Math.floor(N[2]),D[3]=Math.floor(N[3]),D;}function G(D,N,J){return D[0]=Math.min(N[0],J[0]),D[1]=Math.min(N[1],J[1]),D[2]=Math.min(N[2],J[2]),D[3]=Math.min(N[3],J[3]),D;}function z(D,N,J){return D[0]=Math.max(N[0],J[0]),D[1]=Math.max(N[1],J[1]),D[2]=Math.max(N[2],J[2]),D[3]=Math.max(N[3],J[3]),D;}function et(D,N){return D[0]=Math.round(N[0]),D[1]=Math.round(N[1]),D[2]=Math.round(N[2]),D[3]=Math.round(N[3]),D;}function x(D,N,J){return D[0]=N[0]*J,D[1]=N[1]*J,D[2]=N[2]*J,D[3]=N[3]*J,D;}function y(D,N,J,Q){return D[0]=N[0]+J[0]*Q,D[1]=N[1]+J[1]*Q,D[2]=N[2]+J[2]*Q,D[3]=N[3]+J[3]*Q,D;}function S(D,N){var J=N[0]-D[0],Q=N[1]-D[1],V=N[2]-D[2],tt=N[3]-D[3];return Math.hypot(J,Q,V,tt);}function C(D,N){var J=N[0]-D[0],Q=N[1]-D[1],V=N[2]-D[2],tt=N[3]-D[3];return J*J+Q*Q+V*V+tt*tt;}function P(D){var N=D[0],J=D[1],Q=D[2],V=D[3];return Math.hypot(N,J,Q,V);}function X(D){var N=D[0],J=D[1],Q=D[2],V=D[3];return N*N+J*J+Q*Q+V*V;}function $(D,N){return D[0]=-N[0],D[1]=-N[1],D[2]=-N[2],D[3]=-N[3],D;}function K(D,N){return D[0]=1/N[0],D[1]=1/N[1],D[2]=1/N[2],D[3]=1/N[3],D;}function j(D,N){var J=N[0],Q=N[1],V=N[2],tt=N[3],g=J*J+Q*Q+V*V+tt*tt;return g>0&&(g=1/Math.sqrt(g)),D[0]=J*g,D[1]=Q*g,D[2]=V*g,D[3]=tt*g,D;}function nt(D,N){return D[0]*N[0]+D[1]*N[1]+D[2]*N[2]+D[3]*N[3];}function ct(D,N,J,Q){var V=J[0]*Q[1]-J[1]*Q[0],tt=J[0]*Q[2]-J[2]*Q[0],g=J[0]*Q[3]-J[3]*Q[0],I=J[1]*Q[2]-J[2]*Q[1],B=J[1]*Q[3]-J[3]*Q[1],Z=J[2]*Q[3]-J[3]*Q[2],st=N[0],ft=N[1],dt=N[2],ot=N[3];return D[0]=ft*Z-dt*B+ot*I,D[1]=-(st*Z)+dt*g-ot*tt,D[2]=st*B-ft*g+ot*V,D[3]=-(st*I)+ft*tt-dt*V,D;}function F(D,N,J,Q){var V=N[0],tt=N[1],g=N[2],I=N[3];return D[0]=V+Q*(J[0]-V),D[1]=tt+Q*(J[1]-tt),D[2]=g+Q*(J[2]-g),D[3]=I+Q*(J[3]-I),D;}function R(D,N){N=N||1;var J,Q,V,tt,g,I;do J=s.RANDOM()*2-1,Q=s.RANDOM()*2-1,g=J*J+Q*Q;while(g>=1);do V=s.RANDOM()*2-1,tt=s.RANDOM()*2-1,I=V*V+tt*tt;while(I>=1);var B=Math.sqrt((1-g)/I);return D[0]=N*J,D[1]=N*Q,D[2]=N*V*B,D[3]=N*tt*B,D;}function Y(D,N,J){var Q=N[0],V=N[1],tt=N[2],g=N[3];return D[0]=J[0]*Q+J[4]*V+J[8]*tt+J[12]*g,D[1]=J[1]*Q+J[5]*V+J[9]*tt+J[13]*g,D[2]=J[2]*Q+J[6]*V+J[10]*tt+J[14]*g,D[3]=J[3]*Q+J[7]*V+J[11]*tt+J[15]*g,D;}function q(D,N,J){var Q=N[0],V=N[1],tt=N[2],g=J[0],I=J[1],B=J[2],Z=J[3],st=Z*Q+I*tt-B*V,ft=Z*V+B*Q-g*tt,dt=Z*tt+g*V-I*Q,ot=-g*Q-I*V-B*tt;return D[0]=st*Z+ot*-g+ft*-B-dt*-I,D[1]=ft*Z+ot*-I+dt*-g-st*-B,D[2]=dt*Z+ot*-B+st*-I-ft*-g,D[3]=N[3],D;}function lt(D){return D[0]=0,D[1]=0,D[2]=0,D[3]=0,D;}function ut(D){return"vec4("+D[0]+", "+D[1]+", "+D[2]+", "+D[3]+")";}function Tt(D,N){return D[0]===N[0]&&D[1]===N[1]&&D[2]===N[2]&&D[3]===N[3];}function O(D,N){var J=D[0],Q=D[1],V=D[2],tt=D[3],g=N[0],I=N[1],B=N[2],Z=N[3];return Math.abs(J-g)<=s.EPSILON*Math.max(1,Math.abs(J),Math.abs(g))&&Math.abs(Q-I)<=s.EPSILON*Math.max(1,Math.abs(Q),Math.abs(I))&&Math.abs(V-B)<=s.EPSILON*Math.max(1,Math.abs(V),Math.abs(B))&&Math.abs(tt-Z)<=s.EPSILON*Math.max(1,Math.abs(tt),Math.abs(Z));}var U=w,_=A,H=M,at=S,ht=C,yt=P,Et=X,Dt=function(){var D=o();return function(N,J,Q,V,tt,g){var I,B;for(J||(J=4),Q||(Q=0),V?B=Math.min(V*J+Q,N.length):B=N.length,I=Q;I<B;I+=J)D[0]=N[I],D[1]=N[I+1],D[2]=N[I+2],D[3]=N[I+3],tt(D,D,g),N[I]=D[0],N[I+1]=D[1],N[I+2]=D[2],N[I+3]=D[3];return N;};}();},/* 10 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return u;}),i.d(n,"clone",function(){return d;}),i.d(n,"fromValues",function(){return v;}),i.d(n,"fromRotationTranslationValues",function(){return p;}),i.d(n,"fromRotationTranslation",function(){return w;}),i.d(n,"fromTranslation",function(){return A;}),i.d(n,"fromRotation",function(){return M;}),i.d(n,"fromMat4",function(){return E;}),i.d(n,"copy",function(){return L;}),i.d(n,"identity",function(){return G;}),i.d(n,"set",function(){return z;}),i.d(n,"getReal",function(){return et;}),i.d(n,"getDual",function(){return x;}),i.d(n,"setReal",function(){return y;}),i.d(n,"setDual",function(){return S;}),i.d(n,"getTranslation",function(){return C;}),i.d(n,"translate",function(){return P;}),i.d(n,"rotateX",function(){return X;}),i.d(n,"rotateY",function(){return $;}),i.d(n,"rotateZ",function(){return K;}),i.d(n,"rotateByQuatAppend",function(){return j;}),i.d(n,"rotateByQuatPrepend",function(){return nt;}),i.d(n,"rotateAroundAxis",function(){return ct;}),i.d(n,"add",function(){return F;}),i.d(n,"multiply",function(){return R;}),i.d(n,"mul",function(){return Y;}),i.d(n,"scale",function(){return q;}),i.d(n,"dot",function(){return lt;}),i.d(n,"lerp",function(){return ut;}),i.d(n,"invert",function(){return Tt;}),i.d(n,"conjugate",function(){return O;}),i.d(n,"length",function(){return U;}),i.d(n,"len",function(){return _;}),i.d(n,"squaredLength",function(){return H;}),i.d(n,"sqrLen",function(){return at;}),i.d(n,"normalize",function(){return ht;}),i.d(n,"str",function(){return yt;}),i.d(n,"exactEquals",function(){return Et;}),i.d(n,"equals",function(){return Dt;});var s=i(2),o=i(7),a=i(6);function u(){var D=new s.ARRAY_TYPE(8);return s.ARRAY_TYPE!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0,D[4]=0,D[5]=0,D[6]=0,D[7]=0),D[3]=1,D;}function d(D){var N=new s.ARRAY_TYPE(8);return N[0]=D[0],N[1]=D[1],N[2]=D[2],N[3]=D[3],N[4]=D[4],N[5]=D[5],N[6]=D[6],N[7]=D[7],N;}function v(D,N,J,Q,V,tt,g,I){var B=new s.ARRAY_TYPE(8);return B[0]=D,B[1]=N,B[2]=J,B[3]=Q,B[4]=V,B[5]=tt,B[6]=g,B[7]=I,B;}function p(D,N,J,Q,V,tt,g){var I=new s.ARRAY_TYPE(8);I[0]=D,I[1]=N,I[2]=J,I[3]=Q;var B=V*0.5,Z=tt*0.5,st=g*0.5;return I[4]=B*Q+Z*J-st*N,I[5]=Z*Q+st*D-B*J,I[6]=st*Q+B*N-Z*D,I[7]=-B*D-Z*N-st*J,I;}function w(D,N,J){var Q=J[0]*0.5,V=J[1]*0.5,tt=J[2]*0.5,g=N[0],I=N[1],B=N[2],Z=N[3];return D[0]=g,D[1]=I,D[2]=B,D[3]=Z,D[4]=Q*Z+V*B-tt*I,D[5]=V*Z+tt*g-Q*B,D[6]=tt*Z+Q*I-V*g,D[7]=-Q*g-V*I-tt*B,D;}function A(D,N){return D[0]=0,D[1]=0,D[2]=0,D[3]=1,D[4]=N[0]*0.5,D[5]=N[1]*0.5,D[6]=N[2]*0.5,D[7]=0,D;}function M(D,N){return D[0]=N[0],D[1]=N[1],D[2]=N[2],D[3]=N[3],D[4]=0,D[5]=0,D[6]=0,D[7]=0,D;}function E(D,N){var J=o.create();a.getRotation(J,N);var Q=new s.ARRAY_TYPE(3);return a.getTranslation(Q,N),w(D,J,Q),D;}function L(D,N){return D[0]=N[0],D[1]=N[1],D[2]=N[2],D[3]=N[3],D[4]=N[4],D[5]=N[5],D[6]=N[6],D[7]=N[7],D;}function G(D){return D[0]=0,D[1]=0,D[2]=0,D[3]=1,D[4]=0,D[5]=0,D[6]=0,D[7]=0,D;}function z(D,N,J,Q,V,tt,g,I,B){return D[0]=N,D[1]=J,D[2]=Q,D[3]=V,D[4]=tt,D[5]=g,D[6]=I,D[7]=B,D;}var et=o.copy;function x(D,N){return D[0]=N[4],D[1]=N[5],D[2]=N[6],D[3]=N[7],D;}var y=o.copy;function S(D,N){return D[4]=N[0],D[5]=N[1],D[6]=N[2],D[7]=N[3],D;}function C(D,N){var J=N[4],Q=N[5],V=N[6],tt=N[7],g=-N[0],I=-N[1],B=-N[2],Z=N[3];return D[0]=(J*Z+tt*g+Q*B-V*I)*2,D[1]=(Q*Z+tt*I+V*g-J*B)*2,D[2]=(V*Z+tt*B+J*I-Q*g)*2,D;}function P(D,N,J){var Q=N[0],V=N[1],tt=N[2],g=N[3],I=J[0]*0.5,B=J[1]*0.5,Z=J[2]*0.5,st=N[4],ft=N[5],dt=N[6],ot=N[7];return D[0]=Q,D[1]=V,D[2]=tt,D[3]=g,D[4]=g*I+V*Z-tt*B+st,D[5]=g*B+tt*I-Q*Z+ft,D[6]=g*Z+Q*B-V*I+dt,D[7]=-Q*I-V*B-tt*Z+ot,D;}function X(D,N,J){var Q=-N[0],V=-N[1],tt=-N[2],g=N[3],I=N[4],B=N[5],Z=N[6],st=N[7],ft=I*g+st*Q+B*tt-Z*V,dt=B*g+st*V+Z*Q-I*tt,ot=Z*g+st*tt+I*V-B*Q,gt=st*g-I*Q-B*V-Z*tt;return o.rotateX(D,N,J),Q=D[0],V=D[1],tt=D[2],g=D[3],D[4]=ft*g+gt*Q+dt*tt-ot*V,D[5]=dt*g+gt*V+ot*Q-ft*tt,D[6]=ot*g+gt*tt+ft*V-dt*Q,D[7]=gt*g-ft*Q-dt*V-ot*tt,D;}function $(D,N,J){var Q=-N[0],V=-N[1],tt=-N[2],g=N[3],I=N[4],B=N[5],Z=N[6],st=N[7],ft=I*g+st*Q+B*tt-Z*V,dt=B*g+st*V+Z*Q-I*tt,ot=Z*g+st*tt+I*V-B*Q,gt=st*g-I*Q-B*V-Z*tt;return o.rotateY(D,N,J),Q=D[0],V=D[1],tt=D[2],g=D[3],D[4]=ft*g+gt*Q+dt*tt-ot*V,D[5]=dt*g+gt*V+ot*Q-ft*tt,D[6]=ot*g+gt*tt+ft*V-dt*Q,D[7]=gt*g-ft*Q-dt*V-ot*tt,D;}function K(D,N,J){var Q=-N[0],V=-N[1],tt=-N[2],g=N[3],I=N[4],B=N[5],Z=N[6],st=N[7],ft=I*g+st*Q+B*tt-Z*V,dt=B*g+st*V+Z*Q-I*tt,ot=Z*g+st*tt+I*V-B*Q,gt=st*g-I*Q-B*V-Z*tt;return o.rotateZ(D,N,J),Q=D[0],V=D[1],tt=D[2],g=D[3],D[4]=ft*g+gt*Q+dt*tt-ot*V,D[5]=dt*g+gt*V+ot*Q-ft*tt,D[6]=ot*g+gt*tt+ft*V-dt*Q,D[7]=gt*g-ft*Q-dt*V-ot*tt,D;}function j(D,N,J){var Q=J[0],V=J[1],tt=J[2],g=J[3],I=N[0],B=N[1],Z=N[2],st=N[3];return D[0]=I*g+st*Q+B*tt-Z*V,D[1]=B*g+st*V+Z*Q-I*tt,D[2]=Z*g+st*tt+I*V-B*Q,D[3]=st*g-I*Q-B*V-Z*tt,I=N[4],B=N[5],Z=N[6],st=N[7],D[4]=I*g+st*Q+B*tt-Z*V,D[5]=B*g+st*V+Z*Q-I*tt,D[6]=Z*g+st*tt+I*V-B*Q,D[7]=st*g-I*Q-B*V-Z*tt,D;}function nt(D,N,J){var Q=N[0],V=N[1],tt=N[2],g=N[3],I=J[0],B=J[1],Z=J[2],st=J[3];return D[0]=Q*st+g*I+V*Z-tt*B,D[1]=V*st+g*B+tt*I-Q*Z,D[2]=tt*st+g*Z+Q*B-V*I,D[3]=g*st-Q*I-V*B-tt*Z,I=J[4],B=J[5],Z=J[6],st=J[7],D[4]=Q*st+g*I+V*Z-tt*B,D[5]=V*st+g*B+tt*I-Q*Z,D[6]=tt*st+g*Z+Q*B-V*I,D[7]=g*st-Q*I-V*B-tt*Z,D;}function ct(D,N,J,Q){if(Math.abs(Q)<s.EPSILON)return L(D,N);var V=Math.hypot(J[0],J[1],J[2]);Q=Q*0.5;var tt=Math.sin(Q),g=tt*J[0]/V,I=tt*J[1]/V,B=tt*J[2]/V,Z=Math.cos(Q),st=N[0],ft=N[1],dt=N[2],ot=N[3];D[0]=st*Z+ot*g+ft*B-dt*I,D[1]=ft*Z+ot*I+dt*g-st*B,D[2]=dt*Z+ot*B+st*I-ft*g,D[3]=ot*Z-st*g-ft*I-dt*B;var gt=N[4],St=N[5],Pt=N[6],Lt=N[7];return D[4]=gt*Z+Lt*g+St*B-Pt*I,D[5]=St*Z+Lt*I+Pt*g-gt*B,D[6]=Pt*Z+Lt*B+gt*I-St*g,D[7]=Lt*Z-gt*g-St*I-Pt*B,D;}function F(D,N,J){return D[0]=N[0]+J[0],D[1]=N[1]+J[1],D[2]=N[2]+J[2],D[3]=N[3]+J[3],D[4]=N[4]+J[4],D[5]=N[5]+J[5],D[6]=N[6]+J[6],D[7]=N[7]+J[7],D;}function R(D,N,J){var Q=N[0],V=N[1],tt=N[2],g=N[3],I=J[4],B=J[5],Z=J[6],st=J[7],ft=N[4],dt=N[5],ot=N[6],gt=N[7],St=J[0],Pt=J[1],Lt=J[2],Rt=J[3];return D[0]=Q*Rt+g*St+V*Lt-tt*Pt,D[1]=V*Rt+g*Pt+tt*St-Q*Lt,D[2]=tt*Rt+g*Lt+Q*Pt-V*St,D[3]=g*Rt-Q*St-V*Pt-tt*Lt,D[4]=Q*st+g*I+V*Z-tt*B+ft*Rt+gt*St+dt*Lt-ot*Pt,D[5]=V*st+g*B+tt*I-Q*Z+dt*Rt+gt*Pt+ot*St-ft*Lt,D[6]=tt*st+g*Z+Q*B-V*I+ot*Rt+gt*Lt+ft*Pt-dt*St,D[7]=g*st-Q*I-V*B-tt*Z+gt*Rt-ft*St-dt*Pt-ot*Lt,D;}var Y=R;function q(D,N,J){return D[0]=N[0]*J,D[1]=N[1]*J,D[2]=N[2]*J,D[3]=N[3]*J,D[4]=N[4]*J,D[5]=N[5]*J,D[6]=N[6]*J,D[7]=N[7]*J,D;}var lt=o.dot;function ut(D,N,J,Q){var V=1-Q;return lt(N,J)<0&&(Q=-Q),D[0]=N[0]*V+J[0]*Q,D[1]=N[1]*V+J[1]*Q,D[2]=N[2]*V+J[2]*Q,D[3]=N[3]*V+J[3]*Q,D[4]=N[4]*V+J[4]*Q,D[5]=N[5]*V+J[5]*Q,D[6]=N[6]*V+J[6]*Q,D[7]=N[7]*V+J[7]*Q,D;}function Tt(D,N){var J=H(N);return D[0]=-N[0]/J,D[1]=-N[1]/J,D[2]=-N[2]/J,D[3]=N[3]/J,D[4]=-N[4]/J,D[5]=-N[5]/J,D[6]=-N[6]/J,D[7]=N[7]/J,D;}function O(D,N){return D[0]=-N[0],D[1]=-N[1],D[2]=-N[2],D[3]=N[3],D[4]=-N[4],D[5]=-N[5],D[6]=-N[6],D[7]=N[7],D;}var U=o.length,_=U,H=o.squaredLength,at=H;function ht(D,N){var J=H(N);if(J>0){J=Math.sqrt(J);var Q=N[0]/J,V=N[1]/J,tt=N[2]/J,g=N[3]/J,I=N[4],B=N[5],Z=N[6],st=N[7],ft=Q*I+V*B+tt*Z+g*st;D[0]=Q,D[1]=V,D[2]=tt,D[3]=g,D[4]=(I-Q*ft)/J,D[5]=(B-V*ft)/J,D[6]=(Z-tt*ft)/J,D[7]=(st-g*ft)/J;}return D;}function yt(D){return"quat2("+D[0]+", "+D[1]+", "+D[2]+", "+D[3]+", "+D[4]+", "+D[5]+", "+D[6]+", "+D[7]+")";}function Et(D,N){return D[0]===N[0]&&D[1]===N[1]&&D[2]===N[2]&&D[3]===N[3]&&D[4]===N[4]&&D[5]===N[5]&&D[6]===N[6]&&D[7]===N[7];}function Dt(D,N){var J=D[0],Q=D[1],V=D[2],tt=D[3],g=D[4],I=D[5],B=D[6],Z=D[7],st=N[0],ft=N[1],dt=N[2],ot=N[3],gt=N[4],St=N[5],Pt=N[6],Lt=N[7];return Math.abs(J-st)<=s.EPSILON*Math.max(1,Math.abs(J),Math.abs(st))&&Math.abs(Q-ft)<=s.EPSILON*Math.max(1,Math.abs(Q),Math.abs(ft))&&Math.abs(V-dt)<=s.EPSILON*Math.max(1,Math.abs(V),Math.abs(dt))&&Math.abs(tt-ot)<=s.EPSILON*Math.max(1,Math.abs(tt),Math.abs(ot))&&Math.abs(g-gt)<=s.EPSILON*Math.max(1,Math.abs(g),Math.abs(gt))&&Math.abs(I-St)<=s.EPSILON*Math.max(1,Math.abs(I),Math.abs(St))&&Math.abs(B-Pt)<=s.EPSILON*Math.max(1,Math.abs(B),Math.abs(Pt))&&Math.abs(Z-Lt)<=s.EPSILON*Math.max(1,Math.abs(Z),Math.abs(Lt));}},/* 11 *//***/function(e,n,i){i.r(n),i.d(n,"create",function(){return o;}),i.d(n,"clone",function(){return a;}),i.d(n,"fromValues",function(){return u;}),i.d(n,"copy",function(){return d;}),i.d(n,"set",function(){return v;}),i.d(n,"add",function(){return p;}),i.d(n,"subtract",function(){return w;}),i.d(n,"multiply",function(){return A;}),i.d(n,"divide",function(){return M;}),i.d(n,"ceil",function(){return E;}),i.d(n,"floor",function(){return L;}),i.d(n,"min",function(){return G;}),i.d(n,"max",function(){return z;}),i.d(n,"round",function(){return et;}),i.d(n,"scale",function(){return x;}),i.d(n,"scaleAndAdd",function(){return y;}),i.d(n,"distance",function(){return S;}),i.d(n,"squaredDistance",function(){return C;}),i.d(n,"length",function(){return P;}),i.d(n,"squaredLength",function(){return X;}),i.d(n,"negate",function(){return $;}),i.d(n,"inverse",function(){return K;}),i.d(n,"normalize",function(){return j;}),i.d(n,"dot",function(){return nt;}),i.d(n,"cross",function(){return ct;}),i.d(n,"lerp",function(){return F;}),i.d(n,"random",function(){return R;}),i.d(n,"transformMat2",function(){return Y;}),i.d(n,"transformMat2d",function(){return q;}),i.d(n,"transformMat3",function(){return lt;}),i.d(n,"transformMat4",function(){return ut;}),i.d(n,"rotate",function(){return Tt;}),i.d(n,"angle",function(){return O;}),i.d(n,"zero",function(){return U;}),i.d(n,"str",function(){return _;}),i.d(n,"exactEquals",function(){return H;}),i.d(n,"equals",function(){return at;}),i.d(n,"len",function(){return ht;}),i.d(n,"sub",function(){return yt;}),i.d(n,"mul",function(){return Et;}),i.d(n,"div",function(){return Dt;}),i.d(n,"dist",function(){return D;}),i.d(n,"sqrDist",function(){return N;}),i.d(n,"sqrLen",function(){return J;}),i.d(n,"forEach",function(){return Q;});var s=i(2);function o(){var V=new s.ARRAY_TYPE(2);return s.ARRAY_TYPE!=Float32Array&&(V[0]=0,V[1]=0),V;}function a(V){var tt=new s.ARRAY_TYPE(2);return tt[0]=V[0],tt[1]=V[1],tt;}function u(V,tt){var g=new s.ARRAY_TYPE(2);return g[0]=V,g[1]=tt,g;}function d(V,tt){return V[0]=tt[0],V[1]=tt[1],V;}function v(V,tt,g){return V[0]=tt,V[1]=g,V;}function p(V,tt,g){return V[0]=tt[0]+g[0],V[1]=tt[1]+g[1],V;}function w(V,tt,g){return V[0]=tt[0]-g[0],V[1]=tt[1]-g[1],V;}function A(V,tt,g){return V[0]=tt[0]*g[0],V[1]=tt[1]*g[1],V;}function M(V,tt,g){return V[0]=tt[0]/g[0],V[1]=tt[1]/g[1],V;}function E(V,tt){return V[0]=Math.ceil(tt[0]),V[1]=Math.ceil(tt[1]),V;}function L(V,tt){return V[0]=Math.floor(tt[0]),V[1]=Math.floor(tt[1]),V;}function G(V,tt,g){return V[0]=Math.min(tt[0],g[0]),V[1]=Math.min(tt[1],g[1]),V;}function z(V,tt,g){return V[0]=Math.max(tt[0],g[0]),V[1]=Math.max(tt[1],g[1]),V;}function et(V,tt){return V[0]=Math.round(tt[0]),V[1]=Math.round(tt[1]),V;}function x(V,tt,g){return V[0]=tt[0]*g,V[1]=tt[1]*g,V;}function y(V,tt,g,I){return V[0]=tt[0]+g[0]*I,V[1]=tt[1]+g[1]*I,V;}function S(V,tt){var g=tt[0]-V[0],I=tt[1]-V[1];return Math.hypot(g,I);}function C(V,tt){var g=tt[0]-V[0],I=tt[1]-V[1];return g*g+I*I;}function P(V){var tt=V[0],g=V[1];return Math.hypot(tt,g);}function X(V){var tt=V[0],g=V[1];return tt*tt+g*g;}function $(V,tt){return V[0]=-tt[0],V[1]=-tt[1],V;}function K(V,tt){return V[0]=1/tt[0],V[1]=1/tt[1],V;}function j(V,tt){var g=tt[0],I=tt[1],B=g*g+I*I;return B>0&&(B=1/Math.sqrt(B)),V[0]=tt[0]*B,V[1]=tt[1]*B,V;}function nt(V,tt){return V[0]*tt[0]+V[1]*tt[1];}function ct(V,tt,g){var I=tt[0]*g[1]-tt[1]*g[0];return V[0]=V[1]=0,V[2]=I,V;}function F(V,tt,g,I){var B=tt[0],Z=tt[1];return V[0]=B+I*(g[0]-B),V[1]=Z+I*(g[1]-Z),V;}function R(V,tt){tt=tt||1;var g=s.RANDOM()*2*Math.PI;return V[0]=Math.cos(g)*tt,V[1]=Math.sin(g)*tt,V;}function Y(V,tt,g){var I=tt[0],B=tt[1];return V[0]=g[0]*I+g[2]*B,V[1]=g[1]*I+g[3]*B,V;}function q(V,tt,g){var I=tt[0],B=tt[1];return V[0]=g[0]*I+g[2]*B+g[4],V[1]=g[1]*I+g[3]*B+g[5],V;}function lt(V,tt,g){var I=tt[0],B=tt[1];return V[0]=g[0]*I+g[3]*B+g[6],V[1]=g[1]*I+g[4]*B+g[7],V;}function ut(V,tt,g){var I=tt[0],B=tt[1];return V[0]=g[0]*I+g[4]*B+g[12],V[1]=g[1]*I+g[5]*B+g[13],V;}function Tt(V,tt,g,I){var B=tt[0]-g[0],Z=tt[1]-g[1],st=Math.sin(I),ft=Math.cos(I);return V[0]=B*ft-Z*st+g[0],V[1]=B*st+Z*ft+g[1],V;}function O(V,tt){var g=V[0],I=V[1],B=tt[0],Z=tt[1],st=Math.sqrt(g*g+I*I)*Math.sqrt(B*B+Z*Z),ft=st&&(g*B+I*Z)/st;return Math.acos(Math.min(Math.max(ft,-1),1));}function U(V){return V[0]=0,V[1]=0,V;}function _(V){return"vec2("+V[0]+", "+V[1]+")";}function H(V,tt){return V[0]===tt[0]&&V[1]===tt[1];}function at(V,tt){var g=V[0],I=V[1],B=tt[0],Z=tt[1];return Math.abs(g-B)<=s.EPSILON*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(I-Z)<=s.EPSILON*Math.max(1,Math.abs(I),Math.abs(Z));}var ht=P,yt=w,Et=A,Dt=M,D=S,N=C,J=X,Q=function(){var V=o();return function(tt,g,I,B,Z,st){var ft,dt;for(g||(g=2),I||(I=0),B?dt=Math.min(B*g+I,tt.length):dt=tt.length,ft=I;ft<dt;ft+=g)V[0]=tt[ft],V[1]=tt[ft+1],Z(V,V,st),tt[ft]=V[0],tt[ft+1]=V[1];return tt;};}();},/* 12 *//***/function(e,n,i){i.r(n),i.d(n,"default",function(){return O;});var s=i(13),o=/* @__PURE__ */i.n(s),a=i(19),u=/* @__PURE__ */i.n(a),d=i(23),v=/* @__PURE__ */i.n(d),p=i(24),w=/* @__PURE__ */i.n(p),A=i(25),M=i(1),E=i(36),L=i(43),G=i(41),z=i(56),et=i(73),x=i(45),y=i(78),S=i(37),C=i(82);i(1).glMatrix.setMatrixArrayType(Array);function P(U,_){var H;if((typeof Symbol==="undefined"?"undefined":_typeof(Symbol))>"u"||U[Symbol.iterator]==null){if(Array.isArray(U)||(H=X(U))||_){H&&(U=H);var at=0,ht=function ht(){};return{s:ht,n:function n(){return at>=U.length?{done:!0}:{done:!1,value:U[at++]};},e:function e(N){throw N;},f:ht};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var yt=!0,Et=!1,Dt;return{s:function s(){H=U[Symbol.iterator]();},n:function n(){var N=H.next();return yt=N.done,N;},e:function e(N){Et=!0,Dt=N;},f:function f(){try{!yt&&H.return!=null&&H.return();}finally{if(Et)throw Dt;}}};}function X(U,_){if(U){if(typeof U=="string")return $(U,_);var H=Object.prototype.toString.call(U).slice(8,-1);if(H==="Object"&&U.constructor&&(H=U.constructor.name),H==="Map"||H==="Set")return Array.from(U);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return $(U,_);}}function $(U,_){(_==null||_>U.length)&&(_=U.length);for(var H=0,at=new Array(_);H<_;H++)at[H]=U[H];return at;}var K={autoUpdate:!1,// premultipliedAlpha: true,
|
|
2
2
|
preserveDrawingBuffer:!1,// depth: false,
|
|
3
3
|
// antialias: false,
|
|
4
4
|
bufferSize:1500},j="attribute vec3 a_vertexPosition;\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\nvoid main() {\n gl_PointSize = 1.0;\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0); \n vTextureCoord = a_vertexTextureCoord; \n}\n",nt="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",ct=Symbol("glRenderer"),F=Symbol("canvasRenderer"),R=Symbol("options"),Y=Symbol("globalTransform"),q=Symbol("applyGlobalTransform"),lt=Symbol("canvas");function ut(U){var _=U.gl,H=U.fbo;H&&_.bindFramebuffer(_.FRAMEBUFFER,H),U._draw(),H&&_.bindFramebuffer(_.FRAMEBUFFER,null);}function Tt(U,_,H,at){var ht=U.createTexture(_.canvas),yt=[[[0,0],[H,0],[H,at],[0,at],[0,0]]];yt.closed=!0;var Et=new et.default({contours:yt});Et.setTexture(ht),U.setMeshData([Et.meshData]),ut(U),ht.delete(),_.clearRect(0,0,H,at),delete _._filter;}var O=/* @__PURE__ */function(){function U(_){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};v()(this,U);var at=H.contextType;if(at||(typeof WebGL2RenderingContext=="function"?at="webgl2":typeof WebGLRenderingContext=="function"?at="webgl":at="2d"),!_.getContext){var ht=_;_={getContext:function getContext(){return ht;},width:H.width,height:H.height},ht.canvas=_,at="2d";}if(this[lt]=_,at!=="webgl"&&at!=="webgl2"&&at!=="2d")throw new Error("Unknown context type ".concat(at));if(H.contextType=at,this[R]=Object.assign({},K,H),at==="webgl"||at==="webgl2"){at==="webgl2"&&(this[R].webgl2=!0);var yt=new A.default(_,this[R]);at==="webgl2"&&!yt.isWebGL2&&(H.contextType="webgl"),Object(C.createShaders)(yt),Object(C.applyShader)(yt),Object(C.createCloudShaders)(yt);var Et=yt.gl;Et.clearColor(0,0,0,0),Et.blendFuncSeparate(Et.SRC_ALPHA,Et.ONE_MINUS_SRC_ALPHA,Et.ONE,Et.ONE_MINUS_SRC_ALPHA),this[ct]=yt;}else this[F]=new E.default(_,this[R]);this[Y]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return w()(U,[{key:q,value:function value(){var H=this[ct]||this[F];if(this[ct]){var at=this.canvas,ht=at.width,yt=at.height;H.uniforms.viewMatrix=this.viewMatrix,H.uniforms.projectionMatrix=this.projectionMatrix,H.uniforms.u_resolution=[ht,yt];}}},{key:"updateResolution",value:function value(){var H=this.canvas,at=H.width,ht=H.height,yt=[// translation
|
|
@@ -397,16 +397,16 @@ _inherits(igt,_Qu3);return _createClass(igt,[{key:"d",get:function get(){return
|
|
|
397
397
|
d=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
398
398
|
i&&(d=="offset"||d=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
399
399
|
s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||// Skip index properties.
|
|
400
|
-
Kwt(d,u)))&&a.push(d);return a;}var rS=t2t,e2t=Object.prototype;function r2t(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||e2t;return r===e;}var a0=r2t;function n2t(r,t){return function(e){return r(t(e));};}var nS=n2t,i2t=nS,s2t=i2t(Object.keys,Object),o2t=s2t,a2t=a0,l2t=o2t,c2t=Object.prototype,u2t=c2t.hasOwnProperty;function f2t(r){if(!a2t(r))return l2t(r);var t=[];for(var e in Object(r))u2t.call(r,e)&&e!="constructor"&&t.push(e);return t;}var h2t=f2t,d2t=G2,p2t=tS;function v2t(r){return r!=null&&p2t(r.length)&&!d2t(r);}var l0=v2t,g2t=rS,m2t=h2t,y2t=l0;function w2t(r){return y2t(r)?g2t(r):m2t(r);}var c0=w2t,S2t=sf,I2t=c0;function T2t(r,t){return r&&S2t(t,I2t(t),r);}var x2t=T2t;function C2t(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t;}var P2t=C2t,A2t=ul,b2t=a0,M2t=P2t,E2t=Object.prototype,L2t=E2t.hasOwnProperty;function O2t(r){if(!A2t(r))return M2t(r);var t=b2t(r),e=[];for(var n in r)n=="constructor"&&(t||!L2t.call(r,n))||e.push(n);return e;}var D2t=O2t,R2t=rS,N2t=D2t,B2t=l0;function k2t(r){return B2t(r)?R2t(r,!0):N2t(r);}var u0=k2t,F2t=sf,W2t=u0;function U2t(r,t){return r&&F2t(t,W2t(t),r);}var z2t=U2t,hu={exports:{}};hu.exports;(function(r,t){var e=_n,n=t&&!t.nodeType&&t,i=n&&!0&&r&&!r.nodeType&&r,s=i&&i.exports===n,o=s?e.Buffer:void 0,a=o?o.allocUnsafe:void 0;function u(d,v){if(v)return d.slice();var p=d.length,w=a?a(p):new d.constructor(p);return d.copy(w),w;}r.exports=u;})(hu,hu.exports);var $2t=hu.exports;function Y2t(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t;}var j2t=Y2t;function X2t(r,t){for(var e=-1,n=r==null?0:r.length,i=0,s=[];++e<n;){var o=r[e];t(o,e,r)&&(s[i++]=o);}return s;}var iS=X2t;function G2t(){return[];}var sS=G2t,H2t=iS,V2t=sS,Z2t=Object.prototype,q2t=Z2t.propertyIsEnumerable,ky=Object.getOwnPropertySymbols,K2t=ky?function(r){return r==null?[]:(r=Object(r),H2t(ky(r),function(t){return q2t.call(r,t);}));}:V2t,f0=K2t,Q2t=sf,J2t=f0;function _2t(r,t){return Q2t(r,J2t(r),t);}var tSt=_2t;function eSt(r,t){for(var e=-1,n=t.length,i=r.length;++e<n;)r[i+e]=t[e];return r;}var h0=eSt,rSt=nS,nSt=rSt(Object.getPrototypeOf,Object),oS=nSt,iSt=h0,sSt=oS,oSt=f0,aSt=sS,lSt=Object.getOwnPropertySymbols,cSt=lSt?function(r){for(var t=[];r;)iSt(t,oSt(r)),r=sSt(r);return t;}:aSt,aS=cSt,uSt=sf,fSt=aS;function hSt(r,t){return uSt(r,fSt(r),t);}var dSt=hSt,pSt=h0,vSt=fl;function gSt(r,t,e){var n=t(r);return vSt(r)?n:pSt(n,e(r));}var lS=gSt,mSt=lS,ySt=f0,wSt=c0;function SSt(r){return mSt(r,wSt,ySt);}var cS=SSt,ISt=lS,TSt=aS,xSt=u0;function CSt(r){return ISt(r,xSt,TSt);}var PSt=CSt,ASt=js,bSt=_n,MSt=ASt(bSt,"DataView"),ESt=MSt,LSt=js,OSt=_n,DSt=LSt(OSt,"Promise"),RSt=DSt,NSt=js,BSt=_n,kSt=NSt(BSt,"Set"),uS=kSt,FSt=js,WSt=_n,USt=FSt(WSt,"WeakMap"),zSt=USt,np=ESt,ip=i0,sp=RSt,op=uS,ap=zSt,fS=Wo,jo=H2,Fy="[object Map]",$St="[object Object]",Wy="[object Promise]",Uy="[object Set]",zy="[object WeakMap]",$y="[object DataView]",YSt=jo(np),jSt=jo(ip),XSt=jo(sp),GSt=jo(op),HSt=jo(ap),Cs=fS;(np&&Cs(new np(new ArrayBuffer(1)))!=$y||ip&&Cs(new ip())!=Fy||sp&&Cs(sp.resolve())!=Wy||op&&Cs(new op())!=Uy||ap&&Cs(new ap())!=zy)&&(Cs=function Cs(r){var t=fS(r),e=t==$St?r.constructor:void 0,n=e?jo(e):"";if(n)switch(n){case YSt:return $y;case jSt:return Fy;case XSt:return Wy;case GSt:return Uy;case HSt:return zy;}return t;});var af=Cs,VSt=Object.prototype,ZSt=VSt.hasOwnProperty;function qSt(r){var t=r.length,e=new r.constructor(t);return t&&typeof r[0]=="string"&&ZSt.call(r,"index")&&(e.index=r.index,e.input=r.input),e;}var KSt=qSt,QSt=_n,JSt=QSt.Uint8Array,hS=JSt,Yy=hS;function _St(r){var t=new r.constructor(r.byteLength);return new Yy(t).set(new Yy(r)),t;}var d0=_St,tIt=d0;function eIt(r,t){var e=t?tIt(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.byteLength);}var rIt=eIt,nIt=/\w*$/;function iIt(r){var t=new r.constructor(r.source,nIt.exec(r));return t.lastIndex=r.lastIndex,t;}var sIt=iIt,jy=cl,Xy=jy?jy.prototype:void 0,Gy=Xy?Xy.valueOf:void 0;function oIt(r){return Gy?Object(Gy.call(r)):{};}var aIt=oIt,lIt=d0;function cIt(r,t){var e=t?lIt(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length);}var uIt=cIt,fIt=d0,hIt=rIt,dIt=sIt,pIt=aIt,vIt=uIt,gIt="[object Boolean]",mIt="[object Date]",yIt="[object Map]",wIt="[object Number]",SIt="[object RegExp]",IIt="[object Set]",TIt="[object String]",xIt="[object Symbol]",CIt="[object ArrayBuffer]",PIt="[object DataView]",AIt="[object Float32Array]",bIt="[object Float64Array]",MIt="[object Int8Array]",EIt="[object Int16Array]",LIt="[object Int32Array]",OIt="[object Uint8Array]",DIt="[object Uint8ClampedArray]",RIt="[object Uint16Array]",NIt="[object Uint32Array]";function BIt(r,t,e){var n=r.constructor;switch(t){case CIt:return fIt(r);case gIt:case mIt:return new n(+r);case PIt:return hIt(r,e);case AIt:case bIt:case MIt:case EIt:case LIt:case OIt:case DIt:case RIt:case NIt:return vIt(r,e);case yIt:return new n();case wIt:case TIt:return new n(r);case SIt:return dIt(r);case IIt:return new n();case xIt:return pIt(r);}}var kIt=BIt,FIt=ul,Hy=Object.create,WIt=/* @__PURE__ */function(){function r(){}return function(t){if(!FIt(t))return{};if(Hy)return Hy(t);r.prototype=t;var e=new r();return r.prototype=void 0,e;};}(),UIt=WIt,zIt=UIt,$It=oS,YIt=a0;function jIt(r){return typeof r.constructor=="function"&&!YIt(r)?zIt($It(r)):{};}var XIt=jIt,GIt=af,HIt=Pi,VIt="[object Map]";function ZIt(r){return HIt(r)&&GIt(r)==VIt;}var qIt=ZIt,KIt=qIt,QIt=of,Vy=o0,Zy=Vy&&Vy.isMap,JIt=Zy?QIt(Zy):KIt,_It=JIt,tTt=af,eTt=Pi,rTt="[object Set]";function nTt(r){return eTt(r)&&tTt(r)==rTt;}var iTt=nTt,sTt=iTt,oTt=of,qy=o0,Ky=qy&&qy.isSet,aTt=Ky?oTt(Ky):sTt,dS=aTt;var lTt=/* @__PURE__ */zn(dS);var cTt=Z2,uTt=B1t,fTt=Q2,hTt=x2t,dTt=z2t,pTt=$2t,vTt=j2t,gTt=tSt,mTt=dSt,yTt=cS,wTt=PSt,STt=af,ITt=KSt,TTt=kIt,xTt=XIt,CTt=fl,PTt=s0,ATt=_It,bTt=ul,MTt=dS,ETt=c0,LTt=u0,OTt=1,DTt=2,RTt=4,pS="[object Arguments]",NTt="[object Array]",BTt="[object Boolean]",kTt="[object Date]",FTt="[object Error]",vS="[object Function]",WTt="[object GeneratorFunction]",UTt="[object Map]",zTt="[object Number]",gS="[object Object]",$Tt="[object RegExp]",YTt="[object Set]",jTt="[object String]",XTt="[object Symbol]",GTt="[object WeakMap]",HTt="[object ArrayBuffer]",VTt="[object DataView]",ZTt="[object Float32Array]",qTt="[object Float64Array]",KTt="[object Int8Array]",QTt="[object Int16Array]",JTt="[object Int32Array]",_Tt="[object Uint8Array]",txt="[object Uint8ClampedArray]",ext="[object Uint16Array]",rxt="[object Uint32Array]",Ve={};Ve[pS]=Ve[NTt]=Ve[HTt]=Ve[VTt]=Ve[BTt]=Ve[kTt]=Ve[ZTt]=Ve[qTt]=Ve[KTt]=Ve[QTt]=Ve[JTt]=Ve[UTt]=Ve[zTt]=Ve[gS]=Ve[$Tt]=Ve[YTt]=Ve[jTt]=Ve[XTt]=Ve[_Tt]=Ve[txt]=Ve[ext]=Ve[rxt]=!0;Ve[FTt]=Ve[vS]=Ve[GTt]=!1;function Jc(r,t,e,n,i,s){var o,a=t&OTt,u=t&DTt,d=t&RTt;if(e&&(o=i?e(r,n,i,s):e(r)),o!==void 0)return o;if(!bTt(r))return r;var v=CTt(r);if(v){if(o=ITt(r),!a)return vTt(r,o);}else{var p=STt(r),w=p==vS||p==WTt;if(PTt(r))return pTt(r,a);if(p==gS||p==pS||w&&!i){if(o=u||w?{}:xTt(r),!a)return u?mTt(r,dTt(o,r)):gTt(r,hTt(o,r));}else{if(!Ve[p])return i?r:{};o=TTt(r,p,a);}}s||(s=new cTt());var A=s.get(r);if(A)return A;s.set(r,o),MTt(r)?r.forEach(function(L){o.add(Jc(L,t,e,L,r,s));}):ATt(r)&&r.forEach(function(L,G){o.set(G,Jc(L,t,e,G,r,s));});var M=d?u?wTt:yTt:u?LTt:ETt,E=v?void 0:M(r);return uTt(E||r,function(L,G){E&&(G=L,L=r[G]),fTt(o,G,Jc(L,t,e,G,r,s));}),o;}var nxt=Jc,ixt=nxt,sxt=1,oxt=4;function axt(r){return ixt(r,sxt|oxt);}var lxt=axt;var br=/* @__PURE__ */zn(lxt),cxt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg==",uxt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII=",fxt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg==",hxt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%202.5V19L8.5%2014.5L11.5%2021L14.5%2019.5L11.5%2013H18L4%202.5Z'%20fill='%23212324'%20stroke='white'%20stroke-width='1.5'%20stroke-linejoin='round'/%3e%3c/svg%3e",dxt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='26px'%20height='26px'%20viewBox='7%207%2026%2026'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3c!--%20Generator:%20Sketch%2060.1%20(88133)%20-%20https://sketch.com%20--%3e%3ctitle%3eshape-cursor%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3cpath%20d='M20,21.5%20C20.2454599,21.5%2020.4496084,21.6768752%2020.4919443,21.9101244%20L20.5,22%20L20.5,27%20C20.5,27.2761424%2020.2761424,27.5%2020,27.5%20C19.7545401,27.5%2019.5503916,27.3231248%2019.5080557,27.0898756%20L19.5,27%20L19.5,22%20C19.5,21.7238576%2019.7238576,21.5%2020,21.5%20Z%20M27,19.5%20C27.2761424,19.5%2027.5,19.7238576%2027.5,20%20C27.5,20.2454599%2027.3231248,20.4496084%2027.0898756,20.4919443%20L27,20.5%20L22,20.5%20C21.7238576,20.5%2021.5,20.2761424%2021.5,20%20C21.5,19.7545401%2021.6768752,19.5503916%2021.9101244,19.5080557%20L22,19.5%20L27,19.5%20Z%20M18,19.5%20C18.2761424,19.5%2018.5,19.7238576%2018.5,20%20C18.5,20.2454599%2018.3231248,20.4496084%2018.0898756,20.4919443%20L18,20.5%20L13,20.5%20C12.7238576,20.5%2012.5,20.2761424%2012.5,20%20C12.5,19.7545401%2012.6768752,19.5503916%2012.9101244,19.5080557%20L13,19.5%20L18,19.5%20Z%20M20,12.5%20C20.2454599,12.5%2020.4496084,12.6768752%2020.4919443,12.9101244%20L20.5,13%20L20.5,18%20C20.5,18.2761424%2020.2761424,18.5%2020,18.5%20C19.7545401,18.5%2019.5503916,18.3231248%2019.5080557,18.0898756%20L19.5,18%20L19.5,13%20C19.5,12.7238576%2019.7238576,12.5%2020,12.5%20Z'%20id='path-1'%3e%3c/path%3e%3cfilter%20x='-64.6%25'%20y='-59.5%25'%20width='229.3%25'%20height='246.1%25'%20filterUnits='objectBoundingBox'%20id='filter-2'%3e%3cfeMorphology%20radius='1'%20operator='dilate'%20in='SourceAlpha'%20result='shadowSpreadOuter1'%3e%3c/feMorphology%3e%3cfeOffset%20dx='0'%20dy='2'%20in='shadowSpreadOuter1'%20result='shadowOffsetOuter1'%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='3'%20in='shadowOffsetOuter1'%20result='shadowBlurOuter1'%3e%3c/feGaussianBlur%3e%3cfeComposite%20in='shadowBlurOuter1'%20in2='SourceAlpha'%20operator='out'%20result='shadowBlurOuter1'%3e%3c/feComposite%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.16%200'%20type='matrix'%20in='shadowBlurOuter1'%3e%3c/feColorMatrix%3e%3c/filter%3e%3c/defs%3e%3cg%20id='页面-4'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Whiteboard-Guidelines'%20transform='translate(-344.000000,%20-751.000000)'%3e%3cg%20id='shape-cursor'%20transform='translate(344.000000,%20751.000000)'%3e%3crect%20id='矩形备份-44'%20fill='%23FFFFFF'%20opacity='0.01'%20x='0'%20y='0'%20width='40'%20height='40'%20rx='2'%3e%3c/rect%3e%3cg%20id='形状结合'%20fill-rule='nonzero'%3e%3cuse%20fill='black'%20fill-opacity='1'%20filter='url(%23filter-2)'%20xlink:href='%23path-1'%3e%3c/use%3e%3cpath%20stroke='%23FFFFFF'%20stroke-width='1'%20d='M20,21%20C20.4854103,21%2020.898085,21.3479993%2020.9899479,21.8654877%20L21,22%20L21,27%20C21,27.5522847%2020.5522847,28%2020,28%20C19.5145897,28%2019.101915,27.6520007%2019.0100521,27.1345123%20L19,27%20L19,22%20C19,21.4477153%2019.4477153,21%2020,21%20Z%20M27,19%20C27.5522847,19%2028,19.4477153%2028,20%20C28,20.4854103%2027.6520007,20.898085%2027.1345123,20.9899479%20L27,21%20L22,21%20C21.4477153,21%2021,20.5522847%2021,20%20C21,19.5145897%2021.3479993,19.101915%2021.8654877,19.0100521%20L22,19%20L27,19%20Z%20M18,19%20C18.5522847,19%2019,19.4477153%2019,20%20C19,20.4854103%2018.6520007,20.898085%2018.1345123,20.9899479%20L18,21%20L13,21%20C12.4477153,21%2012,20.5522847%2012,20%20C12,19.5145897%2012.3479993,19.101915%2012.8654877,19.0100521%20L13,19%20L18,19%20Z%20M20,12%20C20.4854103,12%2020.898085,12.3479993%2020.9899479,12.8654877%20L21,13%20L21,18%20C21,18.5522847%2020.5522847,19%2020,19%20C19.5145897,19%2019.101915,18.6520007%2019.0100521,18.1345123%20L19,18%20L19,13%20C19,12.4477153%2019.4477153,12%2020,12%20Z'%20fill='%23212324'%20fill-rule='evenodd'%3e%3c/path%3e%3c/g%3e%3crect%20id='矩形'%20fill='%23FFFFFF'%20x='18.5'%20y='17'%20width='3'%20height='6'%3e%3c/rect%3e%3crect%20id='矩形'%20fill='%23FFFFFF'%20x='17'%20y='18.5'%20width='6'%20height='3'%3e%3c/rect%3e%3cpath%20d='M20,21.5%20C20.2454599,21.5%2020.4496084,21.6768752%2020.4919443,21.9101244%20L20.5,22%20L20.5,27%20C20.5,27.2761424%2020.2761424,27.5%2020,27.5%20C19.7545401,27.5%2019.5503916,27.3231248%2019.5080557,27.0898756%20L19.5,27%20L19.5,22%20C19.5,21.7238576%2019.7238576,21.5%2020,21.5%20Z%20M27,19.5%20C27.2761424,19.5%2027.5,19.7238576%2027.5,20%20C27.5,20.2454599%2027.3231248,20.4496084%2027.0898756,20.4919443%20L27,20.5%20L22,20.5%20C21.7238576,20.5%2021.5,20.2761424%2021.5,20%20C21.5,19.7545401%2021.6768752,19.5503916%2021.9101244,19.5080557%20L22,19.5%20L27,19.5%20Z%20M18,19.5%20C18.2761424,19.5%2018.5,19.7238576%2018.5,20%20C18.5,20.2454599%2018.3231248,20.4496084%2018.0898756,20.4919443%20L18,20.5%20L13,20.5%20C12.7238576,20.5%2012.5,20.2761424%2012.5,20%20C12.5,19.7545401%2012.6768752,19.5503916%2012.9101244,19.5080557%20L13,19.5%20L18,19.5%20Z%20M20,12.5%20C20.2454599,12.5%2020.4496084,12.6768752%2020.4919443,12.9101244%20L20.5,13%20L20.5,18%20C20.5,18.2761424%2020.2761424,18.5%2020,18.5%20C19.7545401,18.5%2019.5503916,18.3231248%2019.5080557,18.0898756%20L19.5,18%20L19.5,13%20C19.5,12.7238576%2019.7238576,12.5%2020,12.5%20Z'%20id='形状结合'%20fill='%23212324'%20fill-rule='nonzero'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",pxt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='26px'%20height='26px'%20viewBox='7%207%2026%2026'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3c!--%20Generator:%20Sketch%2060.1%20(88133)%20-%20https://sketch.com%20--%3e%3ctitle%3etext-cursor%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3cpath%20d='M16,26.5%20C15.7238576,26.5%2015.5,26.2761424%2015.5,26%20C15.5,25.7545401%2015.6768752,25.5503916%2015.9101244,25.5080557%20L16,25.5%20L19.5,25.5%20L19.5,14.5%20L16,14.5%20C15.7238576,14.5%2015.5,14.2761424%2015.5,14%20C15.5,13.7545401%2015.6768752,13.5503916%2015.9101244,13.5080557%20L16,13.5%20L24,13.5%20C24.2761424,13.5%2024.5,13.7238576%2024.5,14%20C24.5,14.2454599%2024.3231248,14.4496084%2024.0898756,14.4919443%20L24,14.5%20L20.5,14.5%20L20.5,25.5%20L24,25.5%20C24.2761424,25.5%2024.5,25.7238576%2024.5,26%20C24.5,26.2454599%2024.3231248,26.4496084%2024.0898756,26.4919443%20L24,26.5%20L16,26.5%20Z'%20id='path-1'%3e%3c/path%3e%3cfilter%20x='-284.0%25'%20y='-81.5%25'%20width='668.1%25'%20height='293.9%25'%20filterUnits='objectBoundingBox'%20id='filter-2'%3e%3cfeMorphology%20radius='1'%20operator='dilate'%20in='SourceAlpha'%20result='shadowSpreadOuter1'%3e%3c/feMorphology%3e%3cfeOffset%20dx='0'%20dy='2'%20in='shadowSpreadOuter1'%20result='shadowOffsetOuter1'%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='3'%20in='shadowOffsetOuter1'%20result='shadowBlurOuter1'%3e%3c/feGaussianBlur%3e%3cfeComposite%20in='shadowBlurOuter1'%20in2='SourceAlpha'%20operator='out'%20result='shadowBlurOuter1'%3e%3c/feComposite%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.16%200'%20type='matrix'%20in='shadowBlurOuter1'%3e%3c/feColorMatrix%3e%3c/filter%3e%3c/defs%3e%3cg%20id='页面-4'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Whiteboard-Guidelines'%20transform='translate(-388.000000,%20-672.000000)'%3e%3cg%20id='text-cursor'%20transform='translate(392.000000,%20672.000000)'%3e%3crect%20id='矩形备份-40'%20fill='%23FFFFFF'%20opacity='0.01'%20x='0'%20y='0'%20width='40'%20height='40'%20rx='2'%3e%3c/rect%3e%3cg%20id='形状结合'%20fill-rule='nonzero'%3e%3cuse%20fill='black'%20fill-opacity='1'%20filter='url(%23filter-2)'%20xlink:href='%23path-1'%3e%3c/use%3e%3cpath%20stroke='%23FFFFFF'%20stroke-width='1'%20d='M19,25%20L19,15%20L16,15%20C15.4477153,15%2015,14.5522847%2015,14%20C15,13.5145897%2015.3479993,13.101915%2015.8654877,13.0100521%20L16,13%20L24,13%20C24.5522847,13%2025,13.4477153%2025,14%20C25,14.4854103%2024.6520007,14.898085%2024.1345123,14.9899479%20L24,15%20L21,15%20L21,25%20L24,25%20C24.5522847,25%2025,25.4477153%2025,26%20C25,26.4854103%2024.6520007,26.898085%2024.1345123,26.9899479%20L24,27%20L16,27%20C15.4477153,27%2015,26.5522847%2015,26%20C15,25.5145897%2015.3479993,25.101915%2015.8654877,25.0100521%20L16,25%20L19,25%20Z'%20fill='%23212324'%20fill-rule='evenodd'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Ca=/* @__PURE__ */new Map([["selector","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKeSURBVHgB3VTLi1JhFD86zlQ4ysxSXAy1GWYZzMxmYAhHagRB/QN8FLqPFq4FIQhXkS6kTQ4t2ilIKEWgSS0SmVpIm0BdaBJSaOP78XU+PXey6+saburAD+73uL/feX0H4H81GQdj7D7ilrCGFRonk3c6nXvhcJiFQiGWy+Xy/X7/WbPZ1K1KkBOsl0qlO36/n+3t7Q1hs9kYF+WC3W73MTpxc1lBmej7KuJaoVDInZ6eqsWXDw4OwGKxwPHx8Se1Wn1Wr9cjW1tbOTxi9D9bJCJHXEFslsvlR263+246nYZZptPpQK/Xg8lkSvZ6vbNGo5EgQRCLiSPhIqpoNHobo3keCARgkalUKjg5ORlGuL+/n8T6PVAqlefjYmKRdYQSsZ3P5z8aDAYVLGFarRbi8fhbhUKhx2VPEJGP3eEbfTrs4MUwr4EU49FYrVbweDy1SqXyipy95FaI7g8QXS6SyWReHx4e2ubVBc+HtTk6OjqvVqtvvF7vi0gkUiSByyyJ21BGwpswJ2Vmsxlw/0Kj0bxMJBJJl8vFPWkhGogLQoeyMhEJo2jGUzYRjcPh+Op0Oq2pVOoHkXE0SahF/w+E+3KYNEaX2pSyiSiKxeJTFPiGyyriO6FKEUgSESLp4ht4bzQaf4pFYrHYO/ysEXGNyJtjKRqM/zNNhFuf0B7vst3dXdjZ2Yn4fL4vRFwn8jaMGqYPU179LBEGf3bZcNNutwPOtScwKnCLPJ9KLMWEh7mNuIFdVsNXzbBNP+D6Ou1vwAqm8hqMWlmbzWYf4mz6HAwGzbjWwGgqrEklmucJT+UGCfG3wiPjueeNwGvB0zkAid7OMmF8CyOck/I6NJcR4KZYcM6J2vCbUGhvyQIA0gonzCEZkQud9Fcd9W/bL57cJu3lkjuNAAAAAElFTkSuQmCC"],["pencil","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJ2SURBVHgB7ZXPqxJRFMfvjI4F+cqkTcrjge9B+B+0LJQ27lq4ijZprly6DaF1COKPjYRrVy0CF/aof6Baa6ChOPkLFcdMm1+dM93RafzxZuptgnfgC3ecO+dzz497JOTKNsZMp9OAoihvZFku4xp/I5dsbL/fP221Wl/D4bCKwnWn0znDd+SSDE/N6ZBgMKjJBNuKzC4dHTgQ5PF4bququn7R7XZJPB4/kSTpHcBOiQlmJ6cMpCvAcdz5ZDJhF4tF1u12v4jFYkc8z683+f1+Uq1W38K+x/AogVQ7ETF4SnB+Ho1GTxKJxDFC2u32q1KpJPh8vvVGjHK5XM4xahv+tYgRcranJrNarfay2WwKoVBIRTUajW42m70P390EOYmFrOEGdhfECEMIwur1Og+p5VOp1CP47piCOB3EXBBJAIuLRcZi7zKsSaVSEbxe70N4FEEL0AyE6VuBZEJD2wmyAkHDmoxGIwGW36ljBP2gUEXf5/wXCDZBsVjky+XyUwpCyBL0k0ai7gNp3WUVUigUvgHoWSaTaRoi2YJojk1r52q1eh2JRJ5YgUB3Pc/n83WyXRPV/A1rWrtgSAZsQL6Q3ynTI1F2QdCMqXNQEGsDMqMgrMt6ChwCaXcGYdBFjA3InELkQxBCtkcEI4riHyPFCMnlcnEKMbYzQhRi0TCKa6A76XT6wWAweD8ejz8Oh8PPcEc+9Xq9D8lkMgLv74Hugo5ALmJzlumG4+IG6BZ1dJ06wtPqN14gmza2FYljD1SljrCTsAaYpjnZFP7CmpADEel/ai4qffLiqSUKFSlEP8xfgYwwlmzyr1KYHoUtgBU4Y9D/Y78AxCeE/aWoyrkAAAAASUVORK5CYII="],["eraser","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANKSURBVHgB1VTdS5NhFD/7iuXa8KNw7SK/IjBYo13soqvEITENtj9AwZiCOCTvQrNWF9rFFPGLrC1iF10Oiy68mBSUF2KB4YabhKKyTfFCc+3Lzb2ds72LsfbxCkZ04Mf7Puc5z/k95+M5AP+R8OAvCW9nZ6cyHo8/SSaTc4RQKKQ+S0JyxFtbW6va39//ZjKZmMbGRkar1TJOp5MhYtwXwBkQkgMROnyXIcmGw+FgYrHY00JkQm4cqYPCaDQ6ZrFY7i4sLPxhMDg4SJ8hTOOWRCJ5jf8npyUiEgE6eGy1Wk12u72gIZHJZDLr4eHhVnl5+YdsslL5pH1+JBIx22y2h9PT01BKpFIpLC4ufhKJRFpcxhEM6fmlSMLh8P35+XlOJCTBYBC2t7dr8fdctv+iRHjI4HK5LAMDA8BVFAoFyOVyH/6KIKsxCtVIgC188+Dg4CV2GJxGpqamYHR09AHklEWQY5d6K/gg67HD3huNRrlKpYLNzU3gIsPDw8Dn84fa29s/4zIK6Rol8xIhSUMikXB2dXXV4AHo6en5KhaLFcvLy0VJent7QaPRzKrV6le4DCEi2UTCnGgE1dXVj3Q6XY1er08drKiosK2urnbjnrFQQxBJU1PTC3y4kyxJGHEMWe2dTUSNIcLZVXl0dAStra3BiYmJOTqgVCqfu91uull3LhlFjbZv6urqiCTIElHaEsC2dq4QqXRlZeUePsrUDFtfX/eZzebbqL+GuIFks1js32OHRtHu7u5H3FMiahFViPNQYuZRO8oQVzY2NibJocFgYAKBgLuzs/M66hsQKuzELx0dHak9rKe3paXlFurrERdZEiGUGARkcAFxmSJAJ/aRkRGGnOKwdPn9/rG9vT0HXaC5uZnxer3+vr4+HdpeRVxClBWLJFuZqhF7gAjL0PGz8fFxvcfjSY0WevVUv5mZmQDWyog1/I52PyBdlxgUqUu+qMSQznVtW1ubBlP3dmlpicnA5/N5+vv770C6bhS9lEu6eHnWFP45NioJS5xxRLdNsrenKH5CusNOWH1BEeTRMTnI6MgZpYYeYhhOmS5eEX0mMhELPktGoBd/zCWSUkTAOs4QZqZ8JsokS8Kp8KWICtlwdv5P5BchBHaEIRURoQAAAABJRU5ErkJggg=="],["text","data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="],["shape","data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"]]),p0=/* @__PURE__ */new Map([["selector",{key:"selector",standardResolution:Ca.get("selector"),highResolution:fxt}],["shapeSynced",{key:"shape",standardResolution:dxt}],["textSynced",{key:"text",standardResolution:pxt}],["pencil",{key:"pencil",standardResolution:Ca.get("pencil"),highResolution:cxt}],["eraser",{key:"eraser",standardResolution:Ca.get("eraser"),highResolution:uxt}],["text",{key:"text",standardResolution:Ca.get("text")}],["shape",{key:"shape",standardResolution:Ca.get("shape")}],["clicker",{key:"clicker",standardResolution:hxt}]]),mS="1.1.40",vxt="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var r=window.__netlessUA||"";r+=" ".concat(vxt,"@").concat(mS),window.__netlessUA=r;}var zr={workerRenderModeBlacklist:{androidWebView:{89:La.OffscreenTransfer},harmonyArkWeb:{99:La.OffscreenTransfer},iosWebView:{12:La.ImageBitmap,16:La.OffscreenTransfer}},workerCanvasContextBlacklist:{androidWebView:{89:Qc.WebGL},harmonyArkWeb:{99:Qc.WebGL},iosWebView:{16:Qc.WebGL}},syncOpt:{interval:300},bufferSize:{full:4e3,sub:600},bezier:{combineUnitTime:300},pencilEraser:{maxImageWidth:1920,maxImageHeight:1920,maxCombineTime:500}},ss=function ss(r,t,e){return{images:p0.get(r),size:{width:26,height:26},offset:{x:0,y:0},local:{size:t,offset:e},synced:{}};},Qy=_objectSpread(_objectSpread({},ss("pencil",{width:26,height:26},{x:-2,y:4})),{},{synced:{offset:{x:0,y:9}}}),gxt=_objectSpread(_objectSpread({},ss("selector",{width:25,height:25},{x:-5,y:21})),{},{synced:{offset:{x:0,y:26}}}),mxt=_objectSpread(_objectSpread({},ss("eraser",{width:26,height:26},{x:-8,y:8})),{},{synced:{offset:{x:-5,y:13}}}),yxt=_objectSpread(_objectSpread({},ss("eraser",{width:26,height:26},{x:-8,y:8})),{},{synced:{offset:{x:-5,y:13}}}),wxt=ss("eraser",{width:26,height:26},{x:-8,y:8}),Sxt=_objectSpread(_objectSpread({},ss("text",{width:47,height:40},{x:-20,y:20})),{},{synced:{images:p0.get("textSynced"),offset:{x:-13,y:16}}}),Yi=_objectSpread(_objectSpread({},ss("shape",{width:40,height:40},{x:-20,y:20})),{},{synced:{images:p0.get("shapeSynced"),offset:{x:-9,y:16}}}),Ixt=_objectSpread(_objectSpread({},ss("clicker",{width:24,height:24},{x:-4,y:21})),{},{synced:{offset:{x:0,y:26}}});Object.freeze((_Object$freeze={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Object$freeze,_e.selector,gxt),_e.clicker,Ixt),_e.pencil,Qy),_e.rectangle,Yi),_e.ellipse,Yi),_e.shape,Yi),_e.eraser,mxt),_e.pencilEraser,yxt),_e.text,Sxt),_e.straight,Yi),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Object$freeze,_e.arrow,Yi),_e.laserPen,Qy),qi.star,Yi),qi.polygon,Yi),qi.speechBalloon,Yi),qi.bitMapEraser,wxt)));function Ii(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var e=r.length;if(e<2)return"";var n=r[0],i=r[1];if(e===2)return"M".concat(yo(n),"L").concat(yo(i));var s="";for(var o=2,a=e-1;o<a;o++)n=r[o],i=r[o+1],s+=wo(n,i);return t?"M".concat(wo(r[0],r[1]),"Q").concat(yo(r[1])).concat(wo(r[1],r[2]),"T").concat(s).concat(wo(r[e-1],r[0])).concat(wo(r[0],r[1]),"Z"):"M".concat(yo(r[0]),"Q").concat(yo(r[1])).concat(wo(r[1],r[2])).concat(r.length>3?"T":"").concat(s,"L").concat(yo(r[e-1]));}function Txt(r,t){var e=t>0?t:1,n=Math.floor(r.x*e),i=Math.floor(r.y*e),s=Math.ceil((r.x+r.w)*e),o=Math.ceil((r.y+r.h)*e);return{x:n,y:i,w:Math.max(1,s-n),h:Math.max(1,o-i)};}function xxt(r,t){var n=1/(t>0?t:1);return{x:r.x-n,y:r.y-n,w:r.w+n*2,h:r.h+n*2};}function Cxt(r,t,e){var n=Math.abs(e[0])||1,i=Math.abs(e[1])||1;return{size:[t.w/n,t.h/i],textureRect:[(r.x-t.x)/n,(r.y-t.y)/i,r.w/n,r.h/i]};}var yS={exports:{}};(function(r){var t=function(){var e=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",s={};function o(u,d){if(!s[u]){s[u]={};for(var v=0;v<u.length;v++)s[u][u.charAt(v)]=v;}return s[u][d];}var a={compressToBase64:function compressToBase64(u){if(u==null)return"";var d=a._compress(u,6,function(v){return n.charAt(v);});switch(d.length%4){default:case 0:return d;case 1:return d+"===";case 2:return d+"==";case 3:return d+"=";}},decompressFromBase64:function decompressFromBase64(u){return u==null?"":u==""?null:a._decompress(u.length,32,function(d){return o(n,u.charAt(d));});},compressToUTF16:function compressToUTF16(u){return u==null?"":a._compress(u,15,function(d){return e(d+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(u){return u==null?"":u==""?null:a._decompress(u.length,16384,function(d){return u.charCodeAt(d)-32;});},//compress into uint8array (UCS-2 big endian format)
|
|
400
|
+
Kwt(d,u)))&&a.push(d);return a;}var rS=t2t,e2t=Object.prototype;function r2t(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||e2t;return r===e;}var a0=r2t;function n2t(r,t){return function(e){return r(t(e));};}var nS=n2t,i2t=nS,s2t=i2t(Object.keys,Object),o2t=s2t,a2t=a0,l2t=o2t,c2t=Object.prototype,u2t=c2t.hasOwnProperty;function f2t(r){if(!a2t(r))return l2t(r);var t=[];for(var e in Object(r))u2t.call(r,e)&&e!="constructor"&&t.push(e);return t;}var h2t=f2t,d2t=G2,p2t=tS;function v2t(r){return r!=null&&p2t(r.length)&&!d2t(r);}var l0=v2t,g2t=rS,m2t=h2t,y2t=l0;function w2t(r){return y2t(r)?g2t(r):m2t(r);}var c0=w2t,S2t=sf,I2t=c0;function T2t(r,t){return r&&S2t(t,I2t(t),r);}var x2t=T2t;function C2t(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t;}var P2t=C2t,A2t=ul,b2t=a0,M2t=P2t,E2t=Object.prototype,L2t=E2t.hasOwnProperty;function O2t(r){if(!A2t(r))return M2t(r);var t=b2t(r),e=[];for(var n in r)n=="constructor"&&(t||!L2t.call(r,n))||e.push(n);return e;}var D2t=O2t,R2t=rS,N2t=D2t,B2t=l0;function k2t(r){return B2t(r)?R2t(r,!0):N2t(r);}var u0=k2t,F2t=sf,W2t=u0;function U2t(r,t){return r&&F2t(t,W2t(t),r);}var z2t=U2t,hu={exports:{}};hu.exports;(function(r,t){var e=_n,n=t&&!t.nodeType&&t,i=n&&!0&&r&&!r.nodeType&&r,s=i&&i.exports===n,o=s?e.Buffer:void 0,a=o?o.allocUnsafe:void 0;function u(d,v){if(v)return d.slice();var p=d.length,w=a?a(p):new d.constructor(p);return d.copy(w),w;}r.exports=u;})(hu,hu.exports);var $2t=hu.exports;function Y2t(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t;}var j2t=Y2t;function X2t(r,t){for(var e=-1,n=r==null?0:r.length,i=0,s=[];++e<n;){var o=r[e];t(o,e,r)&&(s[i++]=o);}return s;}var iS=X2t;function G2t(){return[];}var sS=G2t,H2t=iS,V2t=sS,Z2t=Object.prototype,q2t=Z2t.propertyIsEnumerable,ky=Object.getOwnPropertySymbols,K2t=ky?function(r){return r==null?[]:(r=Object(r),H2t(ky(r),function(t){return q2t.call(r,t);}));}:V2t,f0=K2t,Q2t=sf,J2t=f0;function _2t(r,t){return Q2t(r,J2t(r),t);}var tSt=_2t;function eSt(r,t){for(var e=-1,n=t.length,i=r.length;++e<n;)r[i+e]=t[e];return r;}var h0=eSt,rSt=nS,nSt=rSt(Object.getPrototypeOf,Object),oS=nSt,iSt=h0,sSt=oS,oSt=f0,aSt=sS,lSt=Object.getOwnPropertySymbols,cSt=lSt?function(r){for(var t=[];r;)iSt(t,oSt(r)),r=sSt(r);return t;}:aSt,aS=cSt,uSt=sf,fSt=aS;function hSt(r,t){return uSt(r,fSt(r),t);}var dSt=hSt,pSt=h0,vSt=fl;function gSt(r,t,e){var n=t(r);return vSt(r)?n:pSt(n,e(r));}var lS=gSt,mSt=lS,ySt=f0,wSt=c0;function SSt(r){return mSt(r,wSt,ySt);}var cS=SSt,ISt=lS,TSt=aS,xSt=u0;function CSt(r){return ISt(r,xSt,TSt);}var PSt=CSt,ASt=js,bSt=_n,MSt=ASt(bSt,"DataView"),ESt=MSt,LSt=js,OSt=_n,DSt=LSt(OSt,"Promise"),RSt=DSt,NSt=js,BSt=_n,kSt=NSt(BSt,"Set"),uS=kSt,FSt=js,WSt=_n,USt=FSt(WSt,"WeakMap"),zSt=USt,np=ESt,ip=i0,sp=RSt,op=uS,ap=zSt,fS=Wo,jo=H2,Fy="[object Map]",$St="[object Object]",Wy="[object Promise]",Uy="[object Set]",zy="[object WeakMap]",$y="[object DataView]",YSt=jo(np),jSt=jo(ip),XSt=jo(sp),GSt=jo(op),HSt=jo(ap),Cs=fS;(np&&Cs(new np(new ArrayBuffer(1)))!=$y||ip&&Cs(new ip())!=Fy||sp&&Cs(sp.resolve())!=Wy||op&&Cs(new op())!=Uy||ap&&Cs(new ap())!=zy)&&(Cs=function Cs(r){var t=fS(r),e=t==$St?r.constructor:void 0,n=e?jo(e):"";if(n)switch(n){case YSt:return $y;case jSt:return Fy;case XSt:return Wy;case GSt:return Uy;case HSt:return zy;}return t;});var af=Cs,VSt=Object.prototype,ZSt=VSt.hasOwnProperty;function qSt(r){var t=r.length,e=new r.constructor(t);return t&&typeof r[0]=="string"&&ZSt.call(r,"index")&&(e.index=r.index,e.input=r.input),e;}var KSt=qSt,QSt=_n,JSt=QSt.Uint8Array,hS=JSt,Yy=hS;function _St(r){var t=new r.constructor(r.byteLength);return new Yy(t).set(new Yy(r)),t;}var d0=_St,tIt=d0;function eIt(r,t){var e=t?tIt(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.byteLength);}var rIt=eIt,nIt=/\w*$/;function iIt(r){var t=new r.constructor(r.source,nIt.exec(r));return t.lastIndex=r.lastIndex,t;}var sIt=iIt,jy=cl,Xy=jy?jy.prototype:void 0,Gy=Xy?Xy.valueOf:void 0;function oIt(r){return Gy?Object(Gy.call(r)):{};}var aIt=oIt,lIt=d0;function cIt(r,t){var e=t?lIt(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length);}var uIt=cIt,fIt=d0,hIt=rIt,dIt=sIt,pIt=aIt,vIt=uIt,gIt="[object Boolean]",mIt="[object Date]",yIt="[object Map]",wIt="[object Number]",SIt="[object RegExp]",IIt="[object Set]",TIt="[object String]",xIt="[object Symbol]",CIt="[object ArrayBuffer]",PIt="[object DataView]",AIt="[object Float32Array]",bIt="[object Float64Array]",MIt="[object Int8Array]",EIt="[object Int16Array]",LIt="[object Int32Array]",OIt="[object Uint8Array]",DIt="[object Uint8ClampedArray]",RIt="[object Uint16Array]",NIt="[object Uint32Array]";function BIt(r,t,e){var n=r.constructor;switch(t){case CIt:return fIt(r);case gIt:case mIt:return new n(+r);case PIt:return hIt(r,e);case AIt:case bIt:case MIt:case EIt:case LIt:case OIt:case DIt:case RIt:case NIt:return vIt(r,e);case yIt:return new n();case wIt:case TIt:return new n(r);case SIt:return dIt(r);case IIt:return new n();case xIt:return pIt(r);}}var kIt=BIt,FIt=ul,Hy=Object.create,WIt=/* @__PURE__ */function(){function r(){}return function(t){if(!FIt(t))return{};if(Hy)return Hy(t);r.prototype=t;var e=new r();return r.prototype=void 0,e;};}(),UIt=WIt,zIt=UIt,$It=oS,YIt=a0;function jIt(r){return typeof r.constructor=="function"&&!YIt(r)?zIt($It(r)):{};}var XIt=jIt,GIt=af,HIt=Pi,VIt="[object Map]";function ZIt(r){return HIt(r)&&GIt(r)==VIt;}var qIt=ZIt,KIt=qIt,QIt=of,Vy=o0,Zy=Vy&&Vy.isMap,JIt=Zy?QIt(Zy):KIt,_It=JIt,tTt=af,eTt=Pi,rTt="[object Set]";function nTt(r){return eTt(r)&&tTt(r)==rTt;}var iTt=nTt,sTt=iTt,oTt=of,qy=o0,Ky=qy&&qy.isSet,aTt=Ky?oTt(Ky):sTt,dS=aTt;var lTt=/* @__PURE__ */zn(dS);var cTt=Z2,uTt=B1t,fTt=Q2,hTt=x2t,dTt=z2t,pTt=$2t,vTt=j2t,gTt=tSt,mTt=dSt,yTt=cS,wTt=PSt,STt=af,ITt=KSt,TTt=kIt,xTt=XIt,CTt=fl,PTt=s0,ATt=_It,bTt=ul,MTt=dS,ETt=c0,LTt=u0,OTt=1,DTt=2,RTt=4,pS="[object Arguments]",NTt="[object Array]",BTt="[object Boolean]",kTt="[object Date]",FTt="[object Error]",vS="[object Function]",WTt="[object GeneratorFunction]",UTt="[object Map]",zTt="[object Number]",gS="[object Object]",$Tt="[object RegExp]",YTt="[object Set]",jTt="[object String]",XTt="[object Symbol]",GTt="[object WeakMap]",HTt="[object ArrayBuffer]",VTt="[object DataView]",ZTt="[object Float32Array]",qTt="[object Float64Array]",KTt="[object Int8Array]",QTt="[object Int16Array]",JTt="[object Int32Array]",_Tt="[object Uint8Array]",txt="[object Uint8ClampedArray]",ext="[object Uint16Array]",rxt="[object Uint32Array]",Ve={};Ve[pS]=Ve[NTt]=Ve[HTt]=Ve[VTt]=Ve[BTt]=Ve[kTt]=Ve[ZTt]=Ve[qTt]=Ve[KTt]=Ve[QTt]=Ve[JTt]=Ve[UTt]=Ve[zTt]=Ve[gS]=Ve[$Tt]=Ve[YTt]=Ve[jTt]=Ve[XTt]=Ve[_Tt]=Ve[txt]=Ve[ext]=Ve[rxt]=!0;Ve[FTt]=Ve[vS]=Ve[GTt]=!1;function Jc(r,t,e,n,i,s){var o,a=t&OTt,u=t&DTt,d=t&RTt;if(e&&(o=i?e(r,n,i,s):e(r)),o!==void 0)return o;if(!bTt(r))return r;var v=CTt(r);if(v){if(o=ITt(r),!a)return vTt(r,o);}else{var p=STt(r),w=p==vS||p==WTt;if(PTt(r))return pTt(r,a);if(p==gS||p==pS||w&&!i){if(o=u||w?{}:xTt(r),!a)return u?mTt(r,dTt(o,r)):gTt(r,hTt(o,r));}else{if(!Ve[p])return i?r:{};o=TTt(r,p,a);}}s||(s=new cTt());var A=s.get(r);if(A)return A;s.set(r,o),MTt(r)?r.forEach(function(L){o.add(Jc(L,t,e,L,r,s));}):ATt(r)&&r.forEach(function(L,G){o.set(G,Jc(L,t,e,G,r,s));});var M=d?u?wTt:yTt:u?LTt:ETt,E=v?void 0:M(r);return uTt(E||r,function(L,G){E&&(G=L,L=r[G]),fTt(o,G,Jc(L,t,e,G,r,s));}),o;}var nxt=Jc,ixt=nxt,sxt=1,oxt=4;function axt(r){return ixt(r,sxt|oxt);}var lxt=axt;var br=/* @__PURE__ */zn(lxt),cxt={maxRetries:3,timeoutMs:15e3,retryIntervalMs:1e3};function uxt(r){var t=_objectSpread(_objectSpread({},cxt),r);if(t.maxRetries!==Number.POSITIVE_INFINITY&&t.maxRetries!==-1&&(!Number.isInteger(t.maxRetries)||t.maxRetries<0||t.maxRetries>10))throw new RangeError("backgroundImageLoadOptions.maxRetries must be -1, Infinity, or an integer from 0 to 10");if(!Number.isFinite(t.timeoutMs)||t.timeoutMs<1e3||t.timeoutMs>12e4)throw new RangeError("backgroundImageLoadOptions.timeoutMs must be from 1000 to 120000");if(!Number.isFinite(t.retryIntervalMs)||t.retryIntervalMs<0||t.retryIntervalMs>3e4)throw new RangeError("backgroundImageLoadOptions.retryIntervalMs must be from 0 to 30000");return t;}var fxt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg==",hxt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII=",dxt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg==",pxt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%202.5V19L8.5%2014.5L11.5%2021L14.5%2019.5L11.5%2013H18L4%202.5Z'%20fill='%23212324'%20stroke='white'%20stroke-width='1.5'%20stroke-linejoin='round'/%3e%3c/svg%3e",vxt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='26px'%20height='26px'%20viewBox='7%207%2026%2026'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3c!--%20Generator:%20Sketch%2060.1%20(88133)%20-%20https://sketch.com%20--%3e%3ctitle%3eshape-cursor%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3cpath%20d='M20,21.5%20C20.2454599,21.5%2020.4496084,21.6768752%2020.4919443,21.9101244%20L20.5,22%20L20.5,27%20C20.5,27.2761424%2020.2761424,27.5%2020,27.5%20C19.7545401,27.5%2019.5503916,27.3231248%2019.5080557,27.0898756%20L19.5,27%20L19.5,22%20C19.5,21.7238576%2019.7238576,21.5%2020,21.5%20Z%20M27,19.5%20C27.2761424,19.5%2027.5,19.7238576%2027.5,20%20C27.5,20.2454599%2027.3231248,20.4496084%2027.0898756,20.4919443%20L27,20.5%20L22,20.5%20C21.7238576,20.5%2021.5,20.2761424%2021.5,20%20C21.5,19.7545401%2021.6768752,19.5503916%2021.9101244,19.5080557%20L22,19.5%20L27,19.5%20Z%20M18,19.5%20C18.2761424,19.5%2018.5,19.7238576%2018.5,20%20C18.5,20.2454599%2018.3231248,20.4496084%2018.0898756,20.4919443%20L18,20.5%20L13,20.5%20C12.7238576,20.5%2012.5,20.2761424%2012.5,20%20C12.5,19.7545401%2012.6768752,19.5503916%2012.9101244,19.5080557%20L13,19.5%20L18,19.5%20Z%20M20,12.5%20C20.2454599,12.5%2020.4496084,12.6768752%2020.4919443,12.9101244%20L20.5,13%20L20.5,18%20C20.5,18.2761424%2020.2761424,18.5%2020,18.5%20C19.7545401,18.5%2019.5503916,18.3231248%2019.5080557,18.0898756%20L19.5,18%20L19.5,13%20C19.5,12.7238576%2019.7238576,12.5%2020,12.5%20Z'%20id='path-1'%3e%3c/path%3e%3cfilter%20x='-64.6%25'%20y='-59.5%25'%20width='229.3%25'%20height='246.1%25'%20filterUnits='objectBoundingBox'%20id='filter-2'%3e%3cfeMorphology%20radius='1'%20operator='dilate'%20in='SourceAlpha'%20result='shadowSpreadOuter1'%3e%3c/feMorphology%3e%3cfeOffset%20dx='0'%20dy='2'%20in='shadowSpreadOuter1'%20result='shadowOffsetOuter1'%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='3'%20in='shadowOffsetOuter1'%20result='shadowBlurOuter1'%3e%3c/feGaussianBlur%3e%3cfeComposite%20in='shadowBlurOuter1'%20in2='SourceAlpha'%20operator='out'%20result='shadowBlurOuter1'%3e%3c/feComposite%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.16%200'%20type='matrix'%20in='shadowBlurOuter1'%3e%3c/feColorMatrix%3e%3c/filter%3e%3c/defs%3e%3cg%20id='页面-4'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Whiteboard-Guidelines'%20transform='translate(-344.000000,%20-751.000000)'%3e%3cg%20id='shape-cursor'%20transform='translate(344.000000,%20751.000000)'%3e%3crect%20id='矩形备份-44'%20fill='%23FFFFFF'%20opacity='0.01'%20x='0'%20y='0'%20width='40'%20height='40'%20rx='2'%3e%3c/rect%3e%3cg%20id='形状结合'%20fill-rule='nonzero'%3e%3cuse%20fill='black'%20fill-opacity='1'%20filter='url(%23filter-2)'%20xlink:href='%23path-1'%3e%3c/use%3e%3cpath%20stroke='%23FFFFFF'%20stroke-width='1'%20d='M20,21%20C20.4854103,21%2020.898085,21.3479993%2020.9899479,21.8654877%20L21,22%20L21,27%20C21,27.5522847%2020.5522847,28%2020,28%20C19.5145897,28%2019.101915,27.6520007%2019.0100521,27.1345123%20L19,27%20L19,22%20C19,21.4477153%2019.4477153,21%2020,21%20Z%20M27,19%20C27.5522847,19%2028,19.4477153%2028,20%20C28,20.4854103%2027.6520007,20.898085%2027.1345123,20.9899479%20L27,21%20L22,21%20C21.4477153,21%2021,20.5522847%2021,20%20C21,19.5145897%2021.3479993,19.101915%2021.8654877,19.0100521%20L22,19%20L27,19%20Z%20M18,19%20C18.5522847,19%2019,19.4477153%2019,20%20C19,20.4854103%2018.6520007,20.898085%2018.1345123,20.9899479%20L18,21%20L13,21%20C12.4477153,21%2012,20.5522847%2012,20%20C12,19.5145897%2012.3479993,19.101915%2012.8654877,19.0100521%20L13,19%20L18,19%20Z%20M20,12%20C20.4854103,12%2020.898085,12.3479993%2020.9899479,12.8654877%20L21,13%20L21,18%20C21,18.5522847%2020.5522847,19%2020,19%20C19.5145897,19%2019.101915,18.6520007%2019.0100521,18.1345123%20L19,18%20L19,13%20C19,12.4477153%2019.4477153,12%2020,12%20Z'%20fill='%23212324'%20fill-rule='evenodd'%3e%3c/path%3e%3c/g%3e%3crect%20id='矩形'%20fill='%23FFFFFF'%20x='18.5'%20y='17'%20width='3'%20height='6'%3e%3c/rect%3e%3crect%20id='矩形'%20fill='%23FFFFFF'%20x='17'%20y='18.5'%20width='6'%20height='3'%3e%3c/rect%3e%3cpath%20d='M20,21.5%20C20.2454599,21.5%2020.4496084,21.6768752%2020.4919443,21.9101244%20L20.5,22%20L20.5,27%20C20.5,27.2761424%2020.2761424,27.5%2020,27.5%20C19.7545401,27.5%2019.5503916,27.3231248%2019.5080557,27.0898756%20L19.5,27%20L19.5,22%20C19.5,21.7238576%2019.7238576,21.5%2020,21.5%20Z%20M27,19.5%20C27.2761424,19.5%2027.5,19.7238576%2027.5,20%20C27.5,20.2454599%2027.3231248,20.4496084%2027.0898756,20.4919443%20L27,20.5%20L22,20.5%20C21.7238576,20.5%2021.5,20.2761424%2021.5,20%20C21.5,19.7545401%2021.6768752,19.5503916%2021.9101244,19.5080557%20L22,19.5%20L27,19.5%20Z%20M18,19.5%20C18.2761424,19.5%2018.5,19.7238576%2018.5,20%20C18.5,20.2454599%2018.3231248,20.4496084%2018.0898756,20.4919443%20L18,20.5%20L13,20.5%20C12.7238576,20.5%2012.5,20.2761424%2012.5,20%20C12.5,19.7545401%2012.6768752,19.5503916%2012.9101244,19.5080557%20L13,19.5%20L18,19.5%20Z%20M20,12.5%20C20.2454599,12.5%2020.4496084,12.6768752%2020.4919443,12.9101244%20L20.5,13%20L20.5,18%20C20.5,18.2761424%2020.2761424,18.5%2020,18.5%20C19.7545401,18.5%2019.5503916,18.3231248%2019.5080557,18.0898756%20L19.5,18%20L19.5,13%20C19.5,12.7238576%2019.7238576,12.5%2020,12.5%20Z'%20id='形状结合'%20fill='%23212324'%20fill-rule='nonzero'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",gxt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='26px'%20height='26px'%20viewBox='7%207%2026%2026'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3c!--%20Generator:%20Sketch%2060.1%20(88133)%20-%20https://sketch.com%20--%3e%3ctitle%3etext-cursor%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3cpath%20d='M16,26.5%20C15.7238576,26.5%2015.5,26.2761424%2015.5,26%20C15.5,25.7545401%2015.6768752,25.5503916%2015.9101244,25.5080557%20L16,25.5%20L19.5,25.5%20L19.5,14.5%20L16,14.5%20C15.7238576,14.5%2015.5,14.2761424%2015.5,14%20C15.5,13.7545401%2015.6768752,13.5503916%2015.9101244,13.5080557%20L16,13.5%20L24,13.5%20C24.2761424,13.5%2024.5,13.7238576%2024.5,14%20C24.5,14.2454599%2024.3231248,14.4496084%2024.0898756,14.4919443%20L24,14.5%20L20.5,14.5%20L20.5,25.5%20L24,25.5%20C24.2761424,25.5%2024.5,25.7238576%2024.5,26%20C24.5,26.2454599%2024.3231248,26.4496084%2024.0898756,26.4919443%20L24,26.5%20L16,26.5%20Z'%20id='path-1'%3e%3c/path%3e%3cfilter%20x='-284.0%25'%20y='-81.5%25'%20width='668.1%25'%20height='293.9%25'%20filterUnits='objectBoundingBox'%20id='filter-2'%3e%3cfeMorphology%20radius='1'%20operator='dilate'%20in='SourceAlpha'%20result='shadowSpreadOuter1'%3e%3c/feMorphology%3e%3cfeOffset%20dx='0'%20dy='2'%20in='shadowSpreadOuter1'%20result='shadowOffsetOuter1'%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='3'%20in='shadowOffsetOuter1'%20result='shadowBlurOuter1'%3e%3c/feGaussianBlur%3e%3cfeComposite%20in='shadowBlurOuter1'%20in2='SourceAlpha'%20operator='out'%20result='shadowBlurOuter1'%3e%3c/feComposite%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.16%200'%20type='matrix'%20in='shadowBlurOuter1'%3e%3c/feColorMatrix%3e%3c/filter%3e%3c/defs%3e%3cg%20id='页面-4'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Whiteboard-Guidelines'%20transform='translate(-388.000000,%20-672.000000)'%3e%3cg%20id='text-cursor'%20transform='translate(392.000000,%20672.000000)'%3e%3crect%20id='矩形备份-40'%20fill='%23FFFFFF'%20opacity='0.01'%20x='0'%20y='0'%20width='40'%20height='40'%20rx='2'%3e%3c/rect%3e%3cg%20id='形状结合'%20fill-rule='nonzero'%3e%3cuse%20fill='black'%20fill-opacity='1'%20filter='url(%23filter-2)'%20xlink:href='%23path-1'%3e%3c/use%3e%3cpath%20stroke='%23FFFFFF'%20stroke-width='1'%20d='M19,25%20L19,15%20L16,15%20C15.4477153,15%2015,14.5522847%2015,14%20C15,13.5145897%2015.3479993,13.101915%2015.8654877,13.0100521%20L16,13%20L24,13%20C24.5522847,13%2025,13.4477153%2025,14%20C25,14.4854103%2024.6520007,14.898085%2024.1345123,14.9899479%20L24,15%20L21,15%20L21,25%20L24,25%20C24.5522847,25%2025,25.4477153%2025,26%20C25,26.4854103%2024.6520007,26.898085%2024.1345123,26.9899479%20L24,27%20L16,27%20C15.4477153,27%2015,26.5522847%2015,26%20C15,25.5145897%2015.3479993,25.101915%2015.8654877,25.0100521%20L16,25%20L19,25%20Z'%20fill='%23212324'%20fill-rule='evenodd'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Ca=/* @__PURE__ */new Map([["selector","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKeSURBVHgB3VTLi1JhFD86zlQ4ysxSXAy1GWYZzMxmYAhHagRB/QN8FLqPFq4FIQhXkS6kTQ4t2ilIKEWgSS0SmVpIm0BdaBJSaOP78XU+PXey6+saburAD+73uL/feX0H4H81GQdj7D7ilrCGFRonk3c6nXvhcJiFQiGWy+Xy/X7/WbPZ1K1KkBOsl0qlO36/n+3t7Q1hs9kYF+WC3W73MTpxc1lBmej7KuJaoVDInZ6eqsWXDw4OwGKxwPHx8Se1Wn1Wr9cjW1tbOTxi9D9bJCJHXEFslsvlR263+246nYZZptPpQK/Xg8lkSvZ6vbNGo5EgQRCLiSPhIqpoNHobo3keCARgkalUKjg5ORlGuL+/n8T6PVAqlefjYmKRdYQSsZ3P5z8aDAYVLGFarRbi8fhbhUKhx2VPEJGP3eEbfTrs4MUwr4EU49FYrVbweDy1SqXyipy95FaI7g8QXS6SyWReHx4e2ubVBc+HtTk6OjqvVqtvvF7vi0gkUiSByyyJ21BGwpswJ2Vmsxlw/0Kj0bxMJBJJl8vFPWkhGogLQoeyMhEJo2jGUzYRjcPh+Op0Oq2pVOoHkXE0SahF/w+E+3KYNEaX2pSyiSiKxeJTFPiGyyriO6FKEUgSESLp4ht4bzQaf4pFYrHYO/ysEXGNyJtjKRqM/zNNhFuf0B7vst3dXdjZ2Yn4fL4vRFwn8jaMGqYPU179LBEGf3bZcNNutwPOtScwKnCLPJ9KLMWEh7mNuIFdVsNXzbBNP+D6Ou1vwAqm8hqMWlmbzWYf4mz6HAwGzbjWwGgqrEklmucJT+UGCfG3wiPjueeNwGvB0zkAid7OMmF8CyOck/I6NJcR4KZYcM6J2vCbUGhvyQIA0gonzCEZkQud9Fcd9W/bL57cJu3lkjuNAAAAAElFTkSuQmCC"],["pencil","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJ2SURBVHgB7ZXPqxJRFMfvjI4F+cqkTcrjge9B+B+0LJQ27lq4ijZprly6DaF1COKPjYRrVy0CF/aof6Baa6ChOPkLFcdMm1+dM93RafzxZuptgnfgC3ecO+dzz497JOTKNsZMp9OAoihvZFku4xp/I5dsbL/fP221Wl/D4bCKwnWn0znDd+SSDE/N6ZBgMKjJBNuKzC4dHTgQ5PF4bququn7R7XZJPB4/kSTpHcBOiQlmJ6cMpCvAcdz5ZDJhF4tF1u12v4jFYkc8z683+f1+Uq1W38K+x/AogVQ7ETF4SnB+Ho1GTxKJxDFC2u32q1KpJPh8vvVGjHK5XM4xahv+tYgRcranJrNarfay2WwKoVBIRTUajW42m70P390EOYmFrOEGdhfECEMIwur1Og+p5VOp1CP47piCOB3EXBBJAIuLRcZi7zKsSaVSEbxe70N4FEEL0AyE6VuBZEJD2wmyAkHDmoxGIwGW36ljBP2gUEXf5/wXCDZBsVjky+XyUwpCyBL0k0ai7gNp3WUVUigUvgHoWSaTaRoi2YJojk1r52q1eh2JRJ5YgUB3Pc/n83WyXRPV/A1rWrtgSAZsQL6Q3ynTI1F2QdCMqXNQEGsDMqMgrMt6ChwCaXcGYdBFjA3InELkQxBCtkcEI4riHyPFCMnlcnEKMbYzQhRi0TCKa6A76XT6wWAweD8ejz8Oh8PPcEc+9Xq9D8lkMgLv74Hugo5ALmJzlumG4+IG6BZ1dJ06wtPqN14gmza2FYljD1SljrCTsAaYpjnZFP7CmpADEel/ai4qffLiqSUKFSlEP8xfgYwwlmzyr1KYHoUtgBU4Y9D/Y78AxCeE/aWoyrkAAAAASUVORK5CYII="],["eraser","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANKSURBVHgB1VTdS5NhFD/7iuXa8KNw7SK/IjBYo13soqvEITENtj9AwZiCOCTvQrNWF9rFFPGLrC1iF10Oiy68mBSUF2KB4YabhKKyTfFCc+3Lzb2ds72LsfbxCkZ04Mf7Puc5z/k95+M5AP+R8OAvCW9nZ6cyHo8/SSaTc4RQKKQ+S0JyxFtbW6va39//ZjKZmMbGRkar1TJOp5MhYtwXwBkQkgMROnyXIcmGw+FgYrHY00JkQm4cqYPCaDQ6ZrFY7i4sLPxhMDg4SJ8hTOOWRCJ5jf8npyUiEgE6eGy1Wk12u72gIZHJZDLr4eHhVnl5+YdsslL5pH1+JBIx22y2h9PT01BKpFIpLC4ufhKJRFpcxhEM6fmlSMLh8P35+XlOJCTBYBC2t7dr8fdctv+iRHjI4HK5LAMDA8BVFAoFyOVyH/6KIKsxCtVIgC188+Dg4CV2GJxGpqamYHR09AHklEWQY5d6K/gg67HD3huNRrlKpYLNzU3gIsPDw8Dn84fa29s/4zIK6Rol8xIhSUMikXB2dXXV4AHo6en5KhaLFcvLy0VJent7QaPRzKrV6le4DCEi2UTCnGgE1dXVj3Q6XY1er08drKiosK2urnbjnrFQQxBJU1PTC3y4kyxJGHEMWe2dTUSNIcLZVXl0dAStra3BiYmJOTqgVCqfu91uull3LhlFjbZv6urqiCTIElHaEsC2dq4QqXRlZeUePsrUDFtfX/eZzebbqL+GuIFks1js32OHRtHu7u5H3FMiahFViPNQYuZRO8oQVzY2NibJocFgYAKBgLuzs/M66hsQKuzELx0dHak9rKe3paXlFurrERdZEiGUGARkcAFxmSJAJ/aRkRGGnOKwdPn9/rG9vT0HXaC5uZnxer3+vr4+HdpeRVxClBWLJFuZqhF7gAjL0PGz8fFxvcfjSY0WevVUv5mZmQDWyog1/I52PyBdlxgUqUu+qMSQznVtW1ubBlP3dmlpicnA5/N5+vv770C6bhS9lEu6eHnWFP45NioJS5xxRLdNsrenKH5CusNOWH1BEeTRMTnI6MgZpYYeYhhOmS5eEX0mMhELPktGoBd/zCWSUkTAOs4QZqZ8JsokS8Kp8KWICtlwdv5P5BchBHaEIRURoQAAAABJRU5ErkJggg=="],["text","data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="],["shape","data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"]]),p0=/* @__PURE__ */new Map([["selector",{key:"selector",standardResolution:Ca.get("selector"),highResolution:dxt}],["shapeSynced",{key:"shape",standardResolution:vxt}],["textSynced",{key:"text",standardResolution:gxt}],["pencil",{key:"pencil",standardResolution:Ca.get("pencil"),highResolution:fxt}],["eraser",{key:"eraser",standardResolution:Ca.get("eraser"),highResolution:hxt}],["text",{key:"text",standardResolution:Ca.get("text")}],["shape",{key:"shape",standardResolution:Ca.get("shape")}],["clicker",{key:"clicker",standardResolution:pxt}]]),mS="1.1.41",mxt="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var r=window.__netlessUA||"";r+=" ".concat(mxt,"@").concat(mS),window.__netlessUA=r;}var zr={workerRenderModeBlacklist:{androidWebView:{89:La.OffscreenTransfer},harmonyArkWeb:{99:La.OffscreenTransfer},iosWebView:{12:La.ImageBitmap,16:La.OffscreenTransfer}},workerCanvasContextBlacklist:{androidWebView:{89:Qc.WebGL},harmonyArkWeb:{99:Qc.WebGL},iosWebView:{16:Qc.WebGL}},syncOpt:{interval:300},bufferSize:{full:4e3,sub:600},bezier:{combineUnitTime:300},pencilEraser:{maxImageWidth:1920,maxImageHeight:1920,maxCombineTime:500},backgroundImageLoadOptions:uxt()},ss=function ss(r,t,e){return{images:p0.get(r),size:{width:26,height:26},offset:{x:0,y:0},local:{size:t,offset:e},synced:{}};},Qy=_objectSpread(_objectSpread({},ss("pencil",{width:26,height:26},{x:-2,y:4})),{},{synced:{offset:{x:0,y:9}}}),yxt=_objectSpread(_objectSpread({},ss("selector",{width:25,height:25},{x:-5,y:21})),{},{synced:{offset:{x:0,y:26}}}),wxt=_objectSpread(_objectSpread({},ss("eraser",{width:26,height:26},{x:-8,y:8})),{},{synced:{offset:{x:-5,y:13}}}),Sxt=_objectSpread(_objectSpread({},ss("eraser",{width:26,height:26},{x:-8,y:8})),{},{synced:{offset:{x:-5,y:13}}}),Ixt=ss("eraser",{width:26,height:26},{x:-8,y:8}),Txt=_objectSpread(_objectSpread({},ss("text",{width:47,height:40},{x:-20,y:20})),{},{synced:{images:p0.get("textSynced"),offset:{x:-13,y:16}}}),Yi=_objectSpread(_objectSpread({},ss("shape",{width:40,height:40},{x:-20,y:20})),{},{synced:{images:p0.get("shapeSynced"),offset:{x:-9,y:16}}}),xxt=_objectSpread(_objectSpread({},ss("clicker",{width:24,height:24},{x:-4,y:21})),{},{synced:{offset:{x:0,y:26}}});Object.freeze((_Object$freeze={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Object$freeze,_e.selector,yxt),_e.clicker,xxt),_e.pencil,Qy),_e.rectangle,Yi),_e.ellipse,Yi),_e.shape,Yi),_e.eraser,wxt),_e.pencilEraser,Sxt),_e.text,Txt),_e.straight,Yi),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Object$freeze,_e.arrow,Yi),_e.laserPen,Qy),qi.star,Yi),qi.polygon,Yi),qi.speechBalloon,Yi),qi.bitMapEraser,Ixt)));function Ii(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var e=r.length;if(e<2)return"";var n=r[0],i=r[1];if(e===2)return"M".concat(yo(n),"L").concat(yo(i));var s="";for(var o=2,a=e-1;o<a;o++)n=r[o],i=r[o+1],s+=wo(n,i);return t?"M".concat(wo(r[0],r[1]),"Q").concat(yo(r[1])).concat(wo(r[1],r[2]),"T").concat(s).concat(wo(r[e-1],r[0])).concat(wo(r[0],r[1]),"Z"):"M".concat(yo(r[0]),"Q").concat(yo(r[1])).concat(wo(r[1],r[2])).concat(r.length>3?"T":"").concat(s,"L").concat(yo(r[e-1]));}function Cxt(r,t){var e=t>0?t:1,n=Math.floor(r.x*e),i=Math.floor(r.y*e),s=Math.ceil((r.x+r.w)*e),o=Math.ceil((r.y+r.h)*e);return{x:n,y:i,w:Math.max(1,s-n),h:Math.max(1,o-i)};}function Pxt(r,t){var n=1/(t>0?t:1);return{x:r.x-n,y:r.y-n,w:r.w+n*2,h:r.h+n*2};}function Axt(r,t,e){var n=Math.abs(e[0])||1,i=Math.abs(e[1])||1;return{size:[t.w/n,t.h/i],textureRect:[(r.x-t.x)/n,(r.y-t.y)/i,r.w/n,r.h/i]};}var yS={exports:{}};(function(r){var t=function(){var e=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",s={};function o(u,d){if(!s[u]){s[u]={};for(var v=0;v<u.length;v++)s[u][u.charAt(v)]=v;}return s[u][d];}var a={compressToBase64:function compressToBase64(u){if(u==null)return"";var d=a._compress(u,6,function(v){return n.charAt(v);});switch(d.length%4){default:case 0:return d;case 1:return d+"===";case 2:return d+"==";case 3:return d+"=";}},decompressFromBase64:function decompressFromBase64(u){return u==null?"":u==""?null:a._decompress(u.length,32,function(d){return o(n,u.charAt(d));});},compressToUTF16:function compressToUTF16(u){return u==null?"":a._compress(u,15,function(d){return e(d+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(u){return u==null?"":u==""?null:a._decompress(u.length,16384,function(d){return u.charCodeAt(d)-32;});},//compress into uint8array (UCS-2 big endian format)
|
|
401
401
|
compressToUint8Array:function compressToUint8Array(u){for(var d=a.compress(u),v=new Uint8Array(d.length*2),p=0,w=d.length;p<w;p++){var A=d.charCodeAt(p);v[p*2]=A>>>8,v[p*2+1]=A%256;}return v;},//decompress from uint8array (UCS-2 big endian format)
|
|
402
402
|
decompressFromUint8Array:function decompressFromUint8Array(u){if(u==null)return a.decompress(u);for(var d=new Array(u.length/2),v=0,p=d.length;v<p;v++)d[v]=u[v*2]*256+u[v*2+1];var w=[];return d.forEach(function(A){w.push(e(A));}),a.decompress(w.join(""));},//compress into a string that is already URI encoded
|
|
403
403
|
compressToEncodedURIComponent:function compressToEncodedURIComponent(u){return u==null?"":a._compress(u,6,function(d){return i.charAt(d);});},//decompress from an output of compressToEncodedURIComponent
|
|
404
|
-
decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(u){return u==null?"":u==""?null:(u=u.replace(/ /g,"+"),a._decompress(u.length,32,function(d){return o(i,u.charAt(d));}));},compress:function compress(u){return a._compress(u,16,function(d){return e(d);});},_compress:function _compress(u,d,v){if(u==null)return"";var p,w,A={},M={},E="",L="",G="",z=2,et=3,x=2,y=[],S=0,C=0,P;for(P=0;P<u.length;P+=1)if(E=u.charAt(P),Object.prototype.hasOwnProperty.call(A,E)||(A[E]=et++,M[E]=!0),L=G+E,Object.prototype.hasOwnProperty.call(A,L))G=L;else{if(Object.prototype.hasOwnProperty.call(M,G)){if(G.charCodeAt(0)<256){for(p=0;p<x;p++)S=S<<1,C==d-1?(C=0,y.push(v(S)),S=0):C++;for(w=G.charCodeAt(0),p=0;p<8;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;}else{for(w=1,p=0;p<x;p++)S=S<<1|w,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=0;for(w=G.charCodeAt(0),p=0;p<16;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;}z--,z==0&&(z=Math.pow(2,x),x++),delete M[G];}else for(w=A[G],p=0;p<x;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;z--,z==0&&(z=Math.pow(2,x),x++),A[L]=et++,G=String(E);}if(G!==""){if(Object.prototype.hasOwnProperty.call(M,G)){if(G.charCodeAt(0)<256){for(p=0;p<x;p++)S=S<<1,C==d-1?(C=0,y.push(v(S)),S=0):C++;for(w=G.charCodeAt(0),p=0;p<8;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;}else{for(w=1,p=0;p<x;p++)S=S<<1|w,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=0;for(w=G.charCodeAt(0),p=0;p<16;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;}z--,z==0&&(z=Math.pow(2,x),x++),delete M[G];}else for(w=A[G],p=0;p<x;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;z--,z==0&&(z=Math.pow(2,x),x++);}for(w=2,p=0;p<x;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;for(;;)if(S=S<<1,C==d-1){y.push(v(S));break;}else C++;return y.join("");},decompress:function decompress(u){return u==null?"":u==""?null:a._decompress(u.length,32768,function(d){return u.charCodeAt(d);});},_decompress:function _decompress(u,d,v){var p=[],w=4,A=4,M=3,E="",L=[],G,z,et,x,y,S,C,P={val:v(0),position:d,index:1};for(G=0;G<3;G+=1)p[G]=G;for(et=0,y=Math.pow(2,2),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;switch(et){case 0:for(et=0,y=Math.pow(2,8),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;C=e(et);break;case 1:for(et=0,y=Math.pow(2,16),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;C=e(et);break;case 2:return"";}for(p[3]=C,z=C,L.push(C);;){if(P.index>u)return"";for(et=0,y=Math.pow(2,M),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;switch(C=et){case 0:for(et=0,y=Math.pow(2,8),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;p[A++]=e(et),C=A-1,w--;break;case 1:for(et=0,y=Math.pow(2,16),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;p[A++]=e(et),C=A-1,w--;break;case 2:return L.join("");}if(w==0&&(w=Math.pow(2,M),M++),p[C])E=p[C];else if(C===A)E=z+z.charAt(0);else return null;L.push(E),p[A++]=z+E.charAt(0),w--,z=E,w==0&&(w=Math.pow(2,M),M++);}}};return a;}();r!=null?r.exports=t:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return t;});})(yS);var wS=yS.exports;function Os(r){return JSON.parse(wS.decompress(r));}function Br(r){return wS.compress(JSON.stringify(r));}var Jy=/* @__PURE__ */new WeakMap(),Vr=/*#__PURE__*/function(){function Vr(t){_classCallCheck(this,Vr);wt(this,"maxImageWidth",zr.pencilEraser.maxImageWidth);wt(this,"maxImageHeight",zr.pencilEraser.maxImageHeight);wt(this,"syncUnitTime",zr.syncOpt.interval);wt(this,"vNodes");wt(this,"drawLayer");wt(this,"fullLayer");wt(this,"workId");wt(this,"confirmEraserDeletion",!1);wt(this,"isDelete",!1);var e=t.vNodes,n=t.fullLayer,i=t.drawLayer,s=t.workId,o=t.toolsOpt;this.vNodes=e,this.fullLayer=n,this.drawLayer=i,this.workId=s,this.syncUnitTime=o.syncUnitTime||this.syncUnitTime;}return _createClass(Vr,[{key:"baseConsumeResult",get:function get(){return{workId:this.workId,toolsType:this.toolsType,opt:this.workOptions};}},{key:"filterSamePoints",value:function filterSamePoints(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;return t.reduce(function(n,i){var s=n[n.length-1];return(i&&!s||i&&s&&!i.isNear(s,e))&&n.push(i),n;},[]);}/** 设置工作id */},{key:"setWorkId",value:function setWorkId(t){this.workId=t;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}},{key:"setEraserDeleteConfirmation",value:function setEraserDeleteConfirmation(t){this.confirmEraserDeletion=t;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(t){var s,o,a;var e=wy(this.workOptions,t);this.workOptions=e,this.syncUnitTime=t.syncUnitTime||this.syncUnitTime;var n=(s=this.workId)==null?void 0:s.toString(),i=n&&((o=this.vNodes)==null?void 0:o.get(n))||void 0;n&&i&&(i.opt=Sy(e),(a=this.vNodes)==null||a.setInfo(n,i));}},{key:"getRenderableEraserLines",value:function getRenderableEraserLines(t){return[].concat(_toConsumableArray(t.eraserlines||[]),_toConsumableArray(t.doingLines||[]));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(t){var i,s;var e;var n=(i=this.workId)==null?void 0:i.toString();if(n&&t){var o=this.fullLayer.getElementsByName(n)||this.drawLayer&&this.drawLayer.getElementsByName(n)||[];if(o.length!==1)return;var a=o[0],u=t.pos,d=t.zIndex,v=t.scale,p=t.angle,w=t.translate,A={};Ze(d)&&(A.zIndex=d),u&&(A.pos=[u[0],u[1]]),v&&(A.scale=v),p&&(A.rotate=p),w&&(A.translate=w),a.attr(A);var M=a==null?void 0:a.getBoundingClientRect();return M&&(e=Jt(e,{x:Math.floor(M.x-Vr.SafeBorderPadding),y:Math.floor(M.y-Vr.SafeBorderPadding),w:Math.floor(M.width+Vr.SafeBorderPadding*2),h:Math.floor(M.height+Vr.SafeBorderPadding*2)})),(s=this.vNodes)==null||s.setInfo(n,{rect:e,centerPos:u}),e;}}},{key:"drawEraserlines",value:function drawEraserlines(t,e){var n=t.group,_t$eraserlines=t.eraserlines,i=_t$eraserlines===void 0?[]:_t$eraserlines,s=t.eraserFaces,o=t.pos,a=t.layer,u=a.parent;if(e)try{var v=(a.renderer.glRenderer||a.renderer.canvasRenderer).options.displayRatio,p=n.getBoundingClientRect(),w=p.width*v*a.worldScaling[0],A=p.height*v*a.worldScaling[1];var M=1;if((w>this.maxImageWidth||A>this.maxImageHeight)&&(M=Math.min(this.maxImageWidth/w,this.maxImageHeight/A)),u.renderer.glRenderer&&!this.confirmEraserDeletion&&this.drawEraserMask({group:n,eraserlines:i,eraserFaces:s,pos:o,layer:a,targetScale:M}))return;var E=a.getAttribute("scale");E=[E[0]*M,E[1]*M];var L=a.parent.parent,G=a.getAttribute("translate"),z=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),L,{offscreen:u.offscreen,width:u.width,height:u.height,contextType:"2d",autoRender:!1,bufferSize:500},E,G),et=n.cloneNode(!0);if(!i.length&&!s)return;s&&this.addEraserFaces(et,s,o,!1),this.addEraserlines(et,i,o,!1),z.appendChild(et);var x=z.parent;x.render();var y=z.renderer.canvasRenderer,S=y.context;if(!S)return;var C=y.options.displayRatio,P=et.getBoundingClientRect(),X={x:P.x,y:P.y,w:P.width,h:P.height},$={x:0,y:0,w:L.width,h:L.height};if(qa(X,$)===Ji.outside){qr(et,x),L.removeChild(x),this.isDelete=!0;return;}var j=xxt(X,C),nt=br(j);nt.x=Math.floor(Math.max(j.x,0)),nt.y=Math.floor(Math.max(j.y,0)),nt.w=Math.min(j.x+j.w,L.width)-nt.x,nt.h=Math.min(j.y+j.h,L.height)-nt.y;var ct=this.getGroupRect(nt,C),F=ct.x,R=ct.y,Y=ct.w,q=ct.h;var lt=S.getImageData(F,R,Y,q);if(this.confirmEraserDeletion&&this.isTransparentRectByCanvas(lt)){qr(et,x),L.removeChild(x),this.isDelete=!0,lt=null;return;}if(this.confirmEraserDeletion&&u.renderer.glRenderer&&this.drawEraserMask({group:n,eraserlines:i,eraserFaces:s,pos:o,layer:a,targetScale:M})){qr(et,x),L.removeChild(x),lt=null;return;}qr(n,u);var ut=this.createSpriteNode({imageData:lt,safariRect:nt,originRect:j,worldScaling:z.worldScaling});ut&&n.append(ut),qr(et,x),L.removeChild(x),u.deleteTexture(lt),lt=null;}catch(d){console.error("[BaseShapeTool] drawEraserlines error:",d);return;}}},{key:"drawEraserMask",value:function drawEraserMask(t){var S,C;var e=t.group,n=t.eraserlines,i=t.eraserFaces,s=t.pos,o=t.layer,a=t.targetScale;if(!n.length&&!i||e.getAttribute("clipPath"))return!1;var u=Number(e.getAttribute("width")),d=Number(e.getAttribute("height"));if(!(u>0)||!(d>0))return!1;var v=o.parent.renderer;if(!v.glRenderer)return!1;var p=v.options.displayRatio||1,w=Math.max(1,Math.ceil(u*p*o.worldScaling[0]*a)),A=Math.max(1,Math.ceil(d*p*o.worldScaling[1]*a)),M=[-u/2,-d/2,u,d];var E=Jy.get(o);E||(E=/* @__PURE__ */new Map(),Jy.set(o,E)),this.pruneEraserMaskCaches(o,E,v);var L=E.get(this.workId),G=!L||L.pixelWidth!==w||L.pixelHeight!==A||L.facesKey!==(i==null?void 0:i.d);if(L&&!G&&(G=this.isEraserMaskPrefixChanged(L,n)),G){if(L==null||L.handle.destroy(v),L=this.createEraserMaskCache(w,A,M),!L)return!1;E.set(this.workId,L);}if(!L)return!1;var z=w/u,et=A/d;L.context.setTransform(z,0,0,et,w/2,A/2),G&&i&&(this.appendEraserMaskFaces(L.context,i,s),L.facesKey=i.d);var x=G,y;var _iterator23=_createForOfIteratorHelper(n),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var P=_step23.value;var X=L.commands.get(P.workId),$=G?0:(X==null?void 0:X.count)||0;for(var K=$;K<P.op.length;K++)x=!0,y=Jt(y,this.appendEraserMaskStroke(L.context,P.op[K],P.thickness,s));L.commands.set(P.workId,{count:P.op.length,thickness:P.thickness,first:(S=P.op[0])==null?void 0:S.slice(0,2),last:(C=P.op[P.op.length-1])==null?void 0:C.slice(-2)});}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return x&&L.handle.update({rect:M,dirtyRect:G||!y?void 0:[y.x,y.y,y.w,y.h]}),e.setMask(L.handle,{rect:M}),!0;}},{key:"pruneEraserMaskCaches",value:function pruneEraserMaskCaches(t,e,n){var _iterator24=_createForOfIteratorHelper(e),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _step24$value=_slicedToArray(_step24.value,2),i=_step24$value[0],s=_step24$value[1];i!==this.workId&&t.getElementsByName(i).length===0&&(s.handle.destroy(n),e.delete(i));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}}},{key:"createEraserMaskCache",value:function createEraserMaskCache(t,e,n){var o,a;var i;typeof OffscreenCanvas=="function"?i=new OffscreenCanvas(t,e):(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(i=document.createElement("canvas"),i.width=t,i.height=e);var s=i==null?void 0:i.getContext("2d");if(!(!i||!s))return s.save(),s.setTransform(1,0,0,1,0,0),s.fillStyle="#fff",s.fillRect(0,0,t,e),s.restore(),{canvas:i,context:s,handle:new fgt(i,{rect:n,singleChannelTexture:((o=this.fullLayer.parent.renderer.options.bitmapEraserMaskOptions)==null?void 0:o.singleChannelTexture)!==!1,textureSubImage2D:((a=this.fullLayer.parent.renderer.options.bitmapEraserMaskOptions)==null?void 0:a.textureSubImage2D)!==!1}),rect:n,pixelWidth:t,pixelHeight:e,commands:/* @__PURE__ */new Map()};}},{key:"appendEraserMaskStroke",value:function appendEraserMaskStroke(t,e,n,i){if(e.length<2)return;t.save(),t.fillStyle="#000",t.strokeStyle="#000",t.lineCap="round",t.lineJoin="round",t.lineWidth=n;var s=e[0]-i[0],o=e[1]-i[1];if(e.length===2)t.beginPath(),t.arc(s,o,n/2,0,Math.PI*2),t.fill();else{t.beginPath(),t.moveTo(s,o);for(var M=2;M<e.length;M+=2)t.lineTo(e[M]-i[0],e[M+1]-i[1]);t.stroke();}t.restore();var a=[],u=[];for(var _M2=0;_M2<e.length;_M2+=2)a.push(e[_M2]-i[0]),u.push(e[_M2+1]-i[1]);var d=n/2+1,v=Math.min.apply(Math,a),p=Math.min.apply(Math,u),w=Math.max.apply(Math,a),A=Math.max.apply(Math,u);return{x:v-d,y:p-d,w:w-v+d*2,h:A-p+d*2};}},{key:"appendEraserMaskFaces",value:function appendEraserMaskFaces(t,e,n){t.save(),t.fillStyle="#000",t.beginPath();var _iterator25=_createForOfIteratorHelper(lu(e)),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var i=_step25.value;var _iterator26=_createForOfIteratorHelper(i.rings),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var s=_step26.value;s.forEach(function(_ref52,u){var _ref53=_slicedToArray(_ref52,2),o=_ref53[0],a=_ref53[1];var d=o-n[0],v=a-n[1];u===0?t.moveTo(d,v):t.lineTo(d,v);}),t.closePath();}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}t.fill("evenodd"),t.restore();}},{key:"isEraserMaskPrefixChanged",value:function isEraserMaskPrefixChanged(t,e){var n,i;if(t.commands.size>e.length)return!0;var _iterator27=_createForOfIteratorHelper(e),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var s=_step27.value;var o=t.commands.get(s.workId);if(o&&(s.op.length<o.count||s.thickness!==o.thickness||!this.isSamePoint(o.first,(n=s.op[0])==null?void 0:n.slice(0,2))||!this.isSamePoint(o.last,(i=s.op[o.count-1])==null?void 0:i.slice(-2))))return!0;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return!1;}},{key:"isSamePoint",value:function isSamePoint(t,e){return!t||!e?t===e:t[0]===e[0]&&t[1]===e[1];}},{key:"createVmRenderNode",value:function createVmRenderNode(t,e,n,i,s){var o=n.width,a=n.height,u="bitMap-".concat(t),d=e.layer(u,n),v=new ar({anchor:[0.5,0.5],pos:[o*0.5,a*0.5],size:[o,a],name:"viewport",id:t});return v.setAttribute("scale",i),v.setAttribute("translate",s),d.append(v),v;}},{key:"getGroupRect",value:function getGroupRect(t,e){return Txt(t,e);}},{key:"addEraserlines",value:function addEraserlines(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var _iterator28=_createForOfIteratorHelper(e),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var s=_step28.value;var o=s.thickness,a=s.op;var _iterator29=_createForOfIteratorHelper(a),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var u=_step29.value;var d=u.map(function(M,E){return E%2?M-n[1]:M-n[0];}),v=this.computEraserPoints(d,o),p=Ii(v,!0),w={pos:[0,0],d:p,fillColor:"rgba(0,0,0,1)"},A=new Qr(w);A.addEventListener("beforerender",function(_ref54){var M=_ref54.detail;var E=M.context;i?E.blendFuncSeparate(E.ZERO,E.ZERO,E.ZERO,E.ZERO):E.globalCompositeOperation="destination-out";}),A.addEventListener("afterrender",function(_ref55){var M=_ref55.detail;var E=M.context;i?E.blendFuncSeparate(E.SRC_ALPHA,E.ONE_MINUS_SRC_ALPHA,E.ONE,E.ONE_MINUS_SRC_ALPHA):E.globalCompositeOperation="source-over";}),t.append(A);}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}}},{key:"addEraserFaces",value:function addEraserFaces(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var s=lu(e).flatMap(function(a){return a.rings.map(function(u){return Ii(u.map(function(_ref56){var _ref57=_slicedToArray(_ref56,2),d=_ref57[0],v=_ref57[1];return new _t(d-n[0],v-n[1]);}),!0);});}).join(" ");if(!s)return;var o=new Qr({pos:[0,0],d:s,fillColor:"rgba(0,0,0,1)",fillRule:"evenodd"});o.addEventListener("beforerender",function(_ref58){var a=_ref58.detail;var u=a.context;i?u.blendFuncSeparate(u.ZERO,u.ZERO,u.ZERO,u.ZERO):u.globalCompositeOperation="destination-out";}),o.addEventListener("afterrender",function(_ref59){var a=_ref59.detail;var u=a.context;i?u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA):u.globalCompositeOperation="source-over";}),t.append(o);}},{key:"isTransparentRectByCanvas",value:function isTransparentRectByCanvas(t){var e=!0;for(var n=0;n<t.data.length;n+=4)if(t.data[n+3]!==0){e=!1;break;}return e;}},{key:"createSpriteNode",value:function createSpriteNode(t){var e=t.imageData,n=t.worldScaling,i=t.safariRect,s=t.originRect;var o;if(typeof OffscreenCanvas=="function"){o=new OffscreenCanvas(e.width,e.height);var w=o.getContext("2d");w&&w.putImageData(e,0,0);}else if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){o=document.createElement("canvas"),o.width=e.width,o.height=e.height;var _w2=o.getContext("2d");_w2&&_w2.putImageData(e,0,0);}if(!o)return console.warn("Failed to create imageEraserBitmap Sprite"),null;var _Cxt=Cxt(i,s,n),a=_Cxt.size,u=_Cxt.textureRect,d={name:"eraserTexture",anchor:[0.5,0.5],pos:[0,0],size:a,texture:o,textureRect:u},v=new Ju(d);var p=!0;return v.addEventListener("beforerender",function(_ref60){var w=_ref60.detail;var A=w.context;typeof A.imageSmoothingEnabled=="boolean"&&(p=A.imageSmoothingEnabled,A.imageSmoothingEnabled=!1);}),v.addEventListener("afterrender",function(_ref61){var w=_ref61.detail;var A=w.context;typeof A.imageSmoothingEnabled=="boolean"&&(A.imageSmoothingEnabled=p);}),v;}},{key:"computEraserPoints",value:function computEraserPoints(t,e){var n=Math.ceil(e/2);return t.length===2?this.computDot(t,n):this.computLine(t,n);}},{key:"computDot",value:function computDot(t,e){var n=new _t(t[0],t[1]);return _t.GetDotStroke(n,e,8);}},{key:"computLine",value:function computLine(t,e){var n=[],i=[];var s,o;for(var a=0;a<t.length;a+=2){var u=new _t(t[a],t[a+1]);var d=void 0;if(a==t.length-2){var v=new _t(t[a-2],t[a-1]);d=Ct.Sub(u,v).uni(),s=u;}else{a===0&&(o=u);var _v2=new _t(t[a+2],t[a+3]);d=Ct.Sub(_v2,u).uni();}if(d){var _v3=Ct.Per(d).mul(e);n.push(_t.Sub(u,_v3)),i.push(_t.Add(u,_v3));}}if(s&&o){var _a5=_t.GetSemicircleStroke(s,n[n.length-1],-1,8),_u3=_t.GetSemicircleStroke(o,i[0],-1,8);return n.concat(_a5,i.reverse(),_u3);}return[];}},{key:"replace",value:function replace(t,e,n){var _this39=this;var s;if(!e){n&&t.append(n);return;}var i=t.getElementsByName(e);if(i.length){var _iterator30=_createForOfIteratorHelper(i),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var o=_step30.value;n?HPt(n,o,t):(o.remove(),_Ur(o,t.parent));}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}}else n&&t.append(n);this.fullLayer!==this.drawLayer&&(this.fullLayer===t?(s=this.drawLayer)==null||s.getElementsByName(e).forEach(function(a){var u;a.remove(),_Ur(a,(u=_this39.drawLayer)==null?void 0:u.parent);}):this.fullLayer.getElementsByName(e).forEach(function(a){a.remove(),_Ur(a,_this39.fullLayer.parent);}));}},{key:"removeDrawCountNodes",value:function removeDrawCountNodes(t,e){var n=[];t.getElementsByName(this.workId).forEach(function(i){i.id&&e&&Number(i.id)<e&&n.push(i);});for(var _i3=0,_n3=n;_i3<_n3.length;_i3++){var i=_n3[_i3];i.remove(),_Ur(i,t.parent);}}}],[{key:"normalizeStorageData",value:function(){var _normalizeStorageData=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(t){return _regenerator().w(function(_context1){while(1)switch(_context1.n){case 0:return _context1.a(2,this.normalizeStorageDataSync(t));}},_callee1,this);}));function normalizeStorageData(_x15){return _normalizeStorageData.apply(this,arguments);}return normalizeStorageData;}()},{key:"normalizeStorageDataSync",value:function normalizeStorageDataSync(t){var e=br(t),n=JSON.stringify(t);if(e.opt){var i=Sy(e.opt);e.opt=wy(void 0,i);}return e.updateNodeOpt=_objectSpread(_objectSpread({},e.updateNodeOpt),{},{useAnimation:!1}),{status:JSON.stringify(e)===n?"already-stable":"stable",value:e};}},{key:"normalizeDrawableStorageData",value:function(){var _normalizeDrawableStorageData=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(t){return _regenerator().w(function(_context10){while(1)switch(_context10.n){case 0:return _context10.a(2,this.normalizeDrawableStorageDataSync(t));}},_callee10,this);}));function normalizeDrawableStorageData(_x16){return _normalizeDrawableStorageData.apply(this,arguments);}return normalizeDrawableStorageData;}()},{key:"normalizeDrawableStorageDataSync",value:function normalizeDrawableStorageDataSync(t){var e=Vr.normalizeStorageDataSync(t);if(e.status==="unrecoverable")return e;var n=e.value;return n.type===xt.DrawWork&&!n.ops&&Array.isArray(n.op)&&n.op.length?(n.type=xt.FullWork,n.ops=Br(n.op),{status:"stable",value:n}):e;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var y;var e=t.node,n=t.opt,i=t.vNodes,s=t.willSerializeData,o=t.targetNode,a=n.zIndex,u=n.translate,d=n.angle,v=n.originPoint,p=n.scenePoint,w=n.scale,A=n.pointMap,M=n.thickness;var E;var L=o&&br(o)||i.get(e.name);if(!L)return;var G=n.eraserGeometryDelta,z=Vi(L.opt)?cu(L.op,L.centerPos):void 0;if(G&&(!z||!U2(G,L.op,L.centerPos)))return;G&&F2(i,e.name,G.matrix);var et;Ze(a)&&(e.setAttribute("zIndex",a),L.opt.zIndex=a);var x=e.parent;if(x){if(v&&w&&o){var _L$opt$eraserFaces;if(et=[w[0],0,0,w[1],p[0]*(1-w[0])+((u==null?void 0:u[0])||0),p[1]*(1-w[1])+((u==null?void 0:u[1])||0)],uf(L.op,p,w,u),Fa(L.centerPos,p,w,u),L.opt.translate=void 0,L.opt.scale=void 0,L.opt.eraserlines)for(var S=0;S<L.opt.eraserlines.length;S++){var _L$opt$eraserlines$S=L.opt.eraserlines[S],C=_L$opt$eraserlines$S.op,P=_L$opt$eraserlines$S.thickness;L.opt.eraserlines[S].thickness=Math.round(P*Math.max(w[0],w[1]));for(var X=0;X<C.length;X++)Fa(C[X],p,w,u);}Vi(L.opt)&&(L.opt.eraserFaces=Id((_L$opt$eraserFaces=L.opt.eraserFaces)!==null&&_L$opt$eraserFaces!==void 0?_L$opt$eraserFaces:null,function(S){return Fa(S,p,w,u);}),delete L.opt.eraserlines);}else if(u){if(e.setAttribute("translate",u),L.opt.translate=u,o){var _S3=[u[0]*x.worldScaling[0],u[1]*x.worldScaling[1]];E=Za(L.rect,_S3),L.rect=E;}else{var _S4=Vr.getRectFromLayer(x,e.name);L.rect=_S4||L.rect;}}else if(Ze(d))if(e.setAttribute("rotate",d),L.opt.rotate=d,o)E=T0(L.rect,d),L.rect=E;else{var _S5=Vr.getRectFromLayer(x,e.name);L.rect=_S5||L.rect;}if(A){var _S6=A.get(e.name);if(_S6)for(var _C3=0,_P3=0;_C3<L.op.length;_C3+=3,_P3++)L.op[_C3]=_S6[_P3][0],L.op[_C3+1]=_S6[_P3][1];}if(M&&(y=L==null?void 0:L.opt)!=null&&y.thickness&&(L.opt.thickness=M),s&&!(v&&w&&o)){if(u){var _L$opt$eraserFaces2;et=[1,0,0,1,u[0],u[1]];var _S7=L.op.map(function(C,P){var X=P%3;return X===0?C+u[0]:X===1?C+u[1]:C;});if(L.op=_S7,L.centerPos=[L.centerPos[0]+u[0],L.centerPos[1]+u[1]],L!=null&&L.opt&&(L.opt.translate=void 0),L.opt.eraserlines)for(var _C4=0;_C4<L.opt.eraserlines.length;_C4++){var _P4=L.opt.eraserlines[_C4].op;for(var _X2=0;_X2<_P4.length;_X2++){var $=_P4[_X2].map(function(K,j){return j%2?K+u[1]:K+u[0];});L.opt.eraserlines[_C4].op[_X2]=$;}}Vi(L.opt)&&(L.opt.eraserFaces=Id((_L$opt$eraserFaces2=L.opt.eraserFaces)!==null&&_L$opt$eraserFaces2!==void 0?_L$opt$eraserFaces2:null,function(C){for(var _P5=0;_P5<C.length;_P5+=2)C[_P5]+=u[0],C[_P5+1]+=u[1];}),delete L.opt.eraserlines);}else if(Ze(d)){var _L$opt$eraserFaces3;var _S8=Math.PI*d/180,_C5=Math.cos(_S8),_P6=Math.sin(_S8),_L$centerPos=_slicedToArray(L.centerPos,2),_X3=_L$centerPos[0],_$2=_L$centerPos[1];et=[_C5,_P6,-_P6,_C5,_X3-_C5*_X3+_P6*_$2,_$2-_P6*_X3-_C5*_$2];var K=L.op;if(UPt(K,L.centerPos,d),L.op=K,L!=null&&L.opt&&(L.opt.rotate=void 0),L.opt.eraserlines)for(var j=0;j<L.opt.eraserlines.length;j++){var nt=L.opt.eraserlines[j].op;for(var ct=0;ct<nt.length;ct++)y1(nt[ct],L.centerPos,d);}Vi(L.opt)&&(L.opt.eraserFaces=Id((_L$opt$eraserFaces3=L.opt.eraserFaces)!==null&&_L$opt$eraserFaces3!==void 0?_L$opt$eraserFaces3:null,function(j){return y1(j,L.centerPos,d);}),delete L.opt.eraserlines);}}if(z&&et&&Vi(L.opt)){var _S9=cu(L.op,L.centerPos);if(G&&G.toDigest!==_S9)return;G||mgt(L.opt,{matrix:et,fromDigest:z,toDigest:_S9});}L&&i.setInfo(e.name,L);}}},{key:"getCenterPos",value:function getCenterPos(t,e){var n=e.worldPosition,i=e.worldScaling;return[(t.x+t.w/2-n[0])/i[0],(t.y+t.h/2-n[1])/i[1]];}},{key:"getRectFromLayer",value:function getRectFromLayer(t,e){var n=t.getElementsByName(e)[0];if(n){var i=n.getBoundingClientRect();return{x:Math.floor(i.x-Vr.SafeBorderPadding),y:Math.floor(i.y-Vr.SafeBorderPadding),w:Math.floor(i.width+Vr.SafeBorderPadding*2),h:Math.floor(i.height+Vr.SafeBorderPadding*2)};}}},{key:"isWillRefresh",value:function isWillRefresh(t){var e=t.toolsType,n=t.opt,i=t.node,s=t.updateOpt,o=t.willSerializeData;return!!(o&&(s.angle||s.translate)||s.thickness&&n.thickness&&n.thickness!==s.thickness||s.strokeType&&n.strokeType&&n.strokeType!==s.strokeType||s.originPoint&&s.scenePoint&&s.scale||s.pointMap&&s.pointMap.has(i.name)||e===It.Text&&(s.fontSize||s.translate||s.textInfos&&s.textInfos.get(i.name))||e===It.BackgroundSVG&&(s.translate||s.scale)||e===It.Image&&(s.angle||s.translate||s.scale||s.strokeColor&&n.type===_u.Iconify)||e===s.toolsType&&s.willRefresh||n.eraserlines&&n.eraserlines.length&&(s.strokeColor||s.fillColor));}}]);}();wt(Vr,"SafeBorderPadding",10);var jt=Vr;var v0=Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50}),Object.freeze({width:48,height:74})]);function SS(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;return Math.abs(r[0]-t[0])<e&&Math.abs(r[1]-t[1])<e;}function Pxt(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(r.length===0)return[];var e=[[r[0][0],r[0][1]]];for(var n=1;n<r.length;n++)SS([r[n][0],r[n][1]],e[e.length-1],t)||e.push([r[n][0],r[n][1]]);return e;}function Axt(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(r.length<=2)return r;var e=r[0],n=r[r.length-1];return SS(e,n,t)?r.slice(0,-1):r;}function bxt(r){var t=r.reduce(function(n,i){return n+i[0];},0)/r.length,e=r.reduce(function(n,i){return n+i[1];},0)/r.length;return[t,e];}function _y(r,t){return Math.atan2(t[1]-r[1],t[0]-r[0]);}function Mxt(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(r.length<=2)return r;var e=[];var _iterator31=_createForOfIteratorHelper(r),_step31;try{var _loop3=function _loop3(){var i=_step31.value;e.some(function(o){return Math.abs(o[0]-i[0])<t&&Math.abs(o[1]-i[1])<t;})||e.push([i[0],i[1]]);};for(_iterator31.s();!(_step31=_iterator31.n()).done;){_loop3();}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}var n=bxt(e);return e.sort(function(i,s){var o=_y(n,i),a=_y(n,s);return o-a;});}function Ext(r,t){var e=t[0].x<t[t.length-1].x;return r.map(function(i){var o=i.map(function(a){var u=-1,d=1/0,v=0;for(var p=0;p<t.length;p++){var w=t[p],A=Math.sqrt(Math.pow(w.x-a[0],2)+Math.pow(w.y-a[1],2));A<d&&(d=A,u=p,v=w.z);}return{point:a,index:u,bestZ:v};}).sort(function(a,u){return a.index-u.index;}).map(function(a){return[].concat(_toConsumableArray(a.point),[a.bestZ]);});return e&&o[0][0]>o[o.length-1][0]||!e&&o[0][0]<o[o.length-1][0]?o.reverse():o;}).sort(function(i,s){var o=i[0][0],a=s[0][0];return e?o-a:a-o;});}function Lxt(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;var i=r.map(function(p){return[p.x,p.y];}),s=function s(p,w){return p.map(function(_ref62){var _ref63=_slicedToArray(_ref62,2),A=_ref63[0],M=_ref63[1];return{X:Math.round(A*w),Y:Math.round(M*w)};});},o=new vr.ClipperOffset();o.AddPath(s(i,1e3),vr.JoinType.jtRound,vr.EndType.etOpenButt);var a=[];o.Execute(a,1);var u=new vr.Clipper();u.AddPaths(a,vr.PolyType.ptSubject,!0),t.forEach(function(p){u.AddPath(s(p,1e3),vr.PolyType.ptClip,!0);});var d=new vr.Paths();u.Execute(vr.ClipType.ctDifference,d,vr.PolyFillType.pftNonZero,vr.PolyFillType.pftNonZero);var v=d.map(function(p){return Axt(Mxt(Pxt(p.map(function(w){return[w.X/1e3,w.Y/1e3];}),e),e),e);}).filter(function(p){return p.length>=2;});return Ext(v,r);}var IS=/*#__PURE__*/function(_jt){function IS(e){var _this40;_classCallCheck(this,IS);_this40=_callSuper(this,IS,[e]);wt(_this40,"canRotate",!0);wt(_this40,"scaleType",be.all);wt(_this40,"toolsType",It.Pencil);wt(_this40,"syncTimestamp");wt(_this40,"syncIndex",0);wt(_this40,"tmpPoints",[]);wt(_this40,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */wt(_this40,"uniThickness");wt(_this40,"workOptions");wt(_this40,"centerPos",[0,0]);_this40.workOptions=e.toolsOpt,_this40.uniThickness=_this40.MAX_REPEAR/_this40.workOptions.thickness/10,_this40.syncTimestamp=0;return _this40;}_inherits(IS,_jt);return _createClass(IS,[{key:"setPointVector",value:function setPointVector(e,n){if(!n)return!1;var i=e.x-n.x,s=e.y-n.y;if(i===0&&s===0)return!1;var o=Ct.Sub(e,n).uni();return!Number.isFinite(o.x)||!Number.isFinite(o.y)?!1:(e.setv(o),!0);}/** 批量合并消费本地数据,返回绘制结果 */},{key:"combineConsume",value:function combineConsume(){var a;var e=(a=this.workId)==null?void 0:a.toString();if(this.tmpPoints.length<2)return{type:xt.None};var n=this.transformDataAll(!0),i={name:e};var s;var o=this.drawLayer||this.fullLayer;return n.length&&(s=this.draw({attrs:i,tasks:n,replaceId:e,layer:o})),{rect:s,type:xt.DrawWork,dataType:Kt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(e){_superPropGet(IS,"setWorkOptions",this,3)([e]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(e){var _this41=this;var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.drawCount,u=e.removeDrawCount,d=e.isSimpleWorker,v=n.workId,p=n.syncUnitTime;p&&(this.syncUnitTime=p);var _this$transformData=this.transformData(n,!1),w=_this$transformData.tasks,A=_this$transformData.effects,M=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,M,Math.max(0,this.tmpPoints.length-2));var E={name:v,id:Ze(a)&&a.toString()||void 0};var L,G=!1;var z=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),w.length&&(w[0].taskId-this.syncTimestamp>this.syncUnitTime&&(G=!0,this.syncTimestamp=w[0].taskId,this.syncIndex=this.tmpPoints.length),s||o||d)){var y=i?this.fullLayer:this.drawLayer||this.fullLayer;L=this.draw({attrs:E,tasks:w,effects:A,layer:y,removeDrawCount:u});}if(d){var _y3=[];this.tmpPoints.slice(z).forEach(function(C){_y3.push(C.x,C.y,_this41.computRadius(C.z,_this41.workOptions.thickness));});var S=!this.workOptions.previewLocalOnly&&G;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Kt.Local,op:S?_y3:void 0,index:S?z*3:void 0,rect:L,updateNodeOpt:{useAnimation:!0}});}if(s)return M>10&&this.tmpPoints.splice(0,M-10),{rect:L,type:xt.DrawWork,dataType:Kt.Local};var et=[];this.tmpPoints.slice(z).forEach(function(y){et.push(y.x,y.y,_this41.computRadius(y.z,_this41.workOptions.thickness));});var x=!this.workOptions.previewLocalOnly&&G;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Kt.Local,rect:L,op:x?et:void 0,index:x?z*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(e){var v;var n=this.workId;if(e.data){var _e$data=e.data,p=_e$data.op,w=_e$data.workState;p!=null&&p.length&&w===te.Done&&this.workOptions.strokeType===Re.Stroke&&this.updateTempPointsWithPressureWhenDone(p);}var i=this.fullLayer;if(this.tmpPoints.length<2)return this.replace(i,n),{type:xt.RemoveNode,removeIds:[n]};var s=this.transformDataAll(!0),o={name:n};var a;s.length&&(a=this.draw({attrs:o,tasks:s,replaceId:n,layer:i}));var u=[];this.tmpPoints.map(function(p){u.push(p.x,p.y,p.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var d=Br(u);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:u,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&jt.getCenterPos(a,i)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:a,type:xt.FullWork,dataType:Kt.Local,ops:d,updateNodeOpt:{pos:this.centerPos,useAnimation:!0}});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(e){var p,w;var n=e.op,i=e.isFullWork,s=e.replaceId,_e$workState=e.workState,o=_e$workState===void 0?te.Done:_e$workState;this.tmpPoints.length=0;for(var A=0;A<n.length;A+=3){var M=new _t(n[A],n[A+1],n[A+2]);if(this.tmpPoints.length>0){var E=this.tmpPoints[this.tmpPoints.length-1];if(!this.setPointVector(M,E))continue;}this.tmpPoints.push(M);}if(this.tmpPoints.length<2)return;var a=this.transformDataAll(!0),u=(p=this.workId)==null?void 0:p.toString(),d={name:u};var v;if(u&&a.length){var _A2=i?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({attrs:d,tasks:a,replaceId:s,layer:_A2,isDrawEraserlines:o===te.Done}),(w=this.vNodes)==null||w.setInfo(u,{rect:v,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:v&&jt.getCenterPos(v,_A2)});}return v;}},{key:"computPencilPoints",value:function computPencilPoints(e){var _this42=this;var n=[],i=e.op,s=e.eraserPolylines,o=e.eraserThickness;this.tmpPoints.length=0;for(var u=0;u<i.length;u+=3){var d=new _t(i[u],i[u+1],i[u+2]);if(this.tmpPoints.length>0){var v=this.tmpPoints[this.tmpPoints.length-1];if(!this.setPointVector(d,v))continue;}this.tmpPoints.push(d);}if(this.tmpPoints.length<2)return;var a=this.transformDataAll(!0);if(a.length){var _loop4=function _loop4(){var _a$_u=a[_u4],d=_a$_u.pos,v=_a$_u.points,p=v.map(function(M){return M.point.addXY(d[0],d[1]);}),w=[];var _iterator32=_createForOfIteratorHelper(s),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var M=_step32.value;var E=[];for(var G=0;G<M.length;G+=2){var z=new _t(M[G],M[G+1]);if(E.length>0){var et=E[E.length-1].point;if(!_this42.setPointVector(z,et))continue;}E.push({point:z,radius:o});}var _this42$computStroke=_this42.computStroke(E,!1),L=_this42$computStroke.ps;w.push(L.map(function(G){return G.XY;}));}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}Lxt(p,w,0.01).forEach(function(M){n.push(M.map(function(E){return[E[0],E[1],E[2]];}).flat(1));});};for(var _u4=0;_u4<a.length;_u4++){_loop4();}}return n;}},{key:"transformDataAll",value:function transformDataAll(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.getTaskPoints(this.tmpPoints,e&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(e){var _this43=this;var n=e.attrs,i=e.tasks,s=e.replaceId,o=e.effects,a=e.layer,u=e.removeDrawCount,_e$isDrawEraserlines=e.isDrawEraserlines,d=_e$isDrawEraserlines===void 0?!0:_e$isDrawEraserlines,_this$workOptions=this.workOptions,v=_this$workOptions.strokeColor,p=_this$workOptions.strokeType,w=_this$workOptions.thickness,A=_this$workOptions.zIndex,M=_this$workOptions.scale,E=_this$workOptions.rotate,L=_this$workOptions.translate,G=_this$workOptions.eraserlines,z=_this$workOptions.eraserFaces,et=_this$workOptions.doingLines,x=_this$workOptions.lineCap,y=_this$workOptions.lineDash;o!=null&&o.size&&(o.forEach(function(K){var j;(j=a.getElementById(K+""))==null||j.remove();}),o.clear()),u&&this.removeDrawCountNodes(a,u);var S;var C=[],P=a.worldPosition,X=a.worldScaling;for(var K=0;K<i.length;K++){var _i$K=i[K],j=_i$K.pos,nt=_i$K.points,_this$computDrawPoint=this.computDrawPoints(nt),ct=_this$computDrawPoint.ps,F=_this$computDrawPoint.rect;var R=void 0;var Y=nt.length===1;p===Re.Stroke||Y?R=Ii(ct,!0):R=Ii(ct,!1);var q={pos:j,d:R,fillColor:p===Re.Stroke||Y?v:void 0,lineDash:Y?void 0:p===Re.Dotted?[y&&y[0]||1,(y&&y[1]||2)*w]:p===Re.LongDotted?[(y&&y[0]||1)*w,(y&&y[1]||2)*w]:void 0,strokeColor:v,lineCap:Y?void 0:x,lineWidth:p===Re.Stroke||Y?0:w};S=Jt(S,{x:Math.floor((F.x+j[0])*X[0]+P[0]-jt.SafeBorderPadding),y:Math.floor((F.y+j[1])*X[1]+P[1]-jt.SafeBorderPadding),w:Math.floor(F.w*X[0]+2*jt.SafeBorderPadding),h:Math.floor(F.h*X[1]+2*jt.SafeBorderPadding)}),C.push(q);}M&&(n.scale=M),E&&(n.rotate=E),L&&(n.translate=L);var $=new ar();if(S){this.centerPos=jt.getCenterPos(S,a);var _K2=p===Re.Stroke&&!G&&!z&&!et;$.attr(_objectSpread(_objectSpread({},n),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:_K2?v:void 0,pos:this.centerPos,size:[(S.w-2*jt.SafeBorderPadding)/X[0],(S.h-2*jt.SafeBorderPadding)/X[1]],zIndex:A}));var _j2=C.map(function(nt){return nt.pos=[nt.pos[0]-_this43.centerPos[0],nt.pos[1]-_this43.centerPos[1]],new Qr(nt);});$.append.apply($,_toConsumableArray(_j2)),_K2&&$.seal(),(G||z||et)&&(this.scaleType=be.proportional,this.drawEraserlines({group:$,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:z,pos:this.centerPos,layer:a},d)),this.replace(a,s,$);}if(M||E||L){var _K3=$==null?void 0:$.getBoundingClientRect();_K3&&(S={x:Math.floor(_K3.x-jt.SafeBorderPadding),y:Math.floor(_K3.y-jt.SafeBorderPadding),w:Math.floor(_K3.width+jt.SafeBorderPadding*2),h:Math.floor(_K3.height+jt.SafeBorderPadding*2)});}return this.isDelete&&$.setAttribute("opacity",0),S;}},{key:"computDrawPoints",value:function computDrawPoints(e){return this.workOptions.strokeType===Re.Stroke||e.length===1?this.computStroke(e):this.computNomal(e);}},{key:"computNomal",value:function computNomal(e){var n=this.workOptions.thickness;var i=e.map(function(s){return n=Math.max(n,s.radius),s.point;});return{ps:i,rect:$e(i,n)};}},{key:"computStroke",value:function computStroke(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return e.length===1?this.computDotStroke(e[0]):this.computLineStroke(e,n);}},{key:"computLineStroke",value:function computLineStroke(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var i=[],s=[];for(var u=0;u<e.length;u++){var _e$u=e[u],d=_e$u.point,v=_e$u.radius;var p=d.v;u===0&&e.length>1&&(p=e[u+1].point.v);var w=Ct.Per(p).mul(v);i.push(_t.Sub(d,w)),s.push(_t.Add(d,w));}var o=e[e.length-1];if(n){var _u5=_t.GetSemicircleStroke(o.point,i[i.length-1],-1,8),_d3=_t.GetSemicircleStroke(e[0].point,s[0],-1,8),_v4=i.concat(_u5,s.reverse(),_d3);return{ps:_v4,rect:$e(_v4)};}var a=i.concat(s.reverse());return{ps:a,rect:$e(a)};}},{key:"computDotStroke",value:function computDotStroke(e){var n=e.point,i=e.radius,s={x:n.x-i,y:n.y-i,w:i*2,h:i*2};return{ps:_t.GetDotStroke(n,i,8),rect:s};}},{key:"transformData",value:function transformData(e,n){var i=e.op,s=e.workState;var o=this.tmpPoints.length-1,a=[];if(i!=null&&i.length&&s){var _this$workOptions2=this.workOptions,u=_this$workOptions2.strokeType,d=_this$workOptions2.thickness,v=/* @__PURE__ */new Set(),p=Math.max(0,this.tmpPoints.length-1);u===Re.Stroke?this.updateTempPointsWithPressure(i,d,v):this.updateTempPoints(i,d,v),o=p;var w=n?this.tmpPoints:this.tmpPoints.slice(o);return a=this.getTaskPoints(w,d),{tasks:a,effects:v,consumeIndex:o};}return{tasks:a,consumeIndex:o};}/** 压力渐变公式 */},{key:"computRadius",value:function computRadius(e,n){return e*0.03*n+n*0.5;}},{key:"getMinZ",value:function getMinZ(e,n){return((n||Math.max(1,Math.floor(e*0.3)))-e*0.5)*100/e/3;}},{key:"getTaskPoints",value:function getTaskPoints(e,n){var p;var i=[];if(e.length===0)return[];var s=0,o=e[0].x,a=e[0].y,u=[o,a],d=[],v=e[0].t;for(;s<e.length;){var w=e[s],A=w.x-o,M=w.y-a,E=w.z,L=n?this.computRadius(E,n):E;if(d.push({point:new _t(A,M,E,e[s].v),radius:L}),s>0&&s<e.length-1){var G=e[s].getAngleByPoints(e[s-1],e[s+1]);if(G<60||G>300){var z=(p=d.pop())==null?void 0:p.point.clone();z&&i.push({taskId:v,pos:u,points:[].concat(_toConsumableArray(d),[{point:z,radius:L}])}),o=e[s].x,a=e[s].y,u=[o,a];var et=w.x-o,x=w.y-a;d=[{point:new _t(et,x,E),radius:L}],v=Date.now();}}s++;}return i.push({taskId:v,pos:u,points:d}),i;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(e,n,i){var s=Date.now(),o=this.tmpPoints.length;var a=o;for(var d=0;d<e.length;d+=2){a=Math.min(a,o);var v=this.tmpPoints.length,p=new _t(e[d],e[d+1]);if(v===0){this.tmpPoints.push(p);continue;}var w=v-1,A=this.tmpPoints[w];if(p.x===A.x&&p.y===A.y){A.z<this.MAX_REPEAR&&A.setz(Math.min(A.z+1,this.MAX_REPEAR));continue;}var M=Ct.Sub(p,A).uni();if(p.isNear(A,n)){var G=A.z;if(A.z<this.MAX_REPEAR&&(G=Math.min(A.z+1,this.MAX_REPEAR),v>1)){var x=v-1;for(;x>0;){var y=this.tmpPoints[x].distance(this.tmpPoints[x-1]),S=Math.max(this.tmpPoints[x].z-this.uniThickness*y,0);if(this.tmpPoints[x-1].z>=S)break;this.tmpPoints[x-1].setz(S),a=Math.min(a,x-1),x--;}}if(a=Math.min(a,w),A.t){p.setz(G),p.setv(M),this.tmpPoints.push(p);continue;}var z=this.tmpPoints[w-1],et=z?Ct.Sub(p,z).uni():A.v;A.set(p.x,p.y,G,et);continue;}p.setv(M);var E=p.distance(A),L=Math.max(A.z-this.uniThickness*E,0);v>1&&Ct.Equals(M,A.v,0.01)&&(L>0||A.z<=0)&&(A.t||this.tmpPoints.pop(),a=Math.min(w,a)),p.setz(L),this.tmpPoints.push(p);}if(a===1/0)return this.tmpPoints.length;var u=o;if(a===o){u=Math.max(u-1,0);var _d4=this.tmpPoints[u].t;_d4&&(i==null||i.add(_d4));}else{var _d5=o-1;for(u=a;_d5>=0;){var _v5=this.tmpPoints[_d5].t;if(_v5&&(i==null||i.add(_v5),_d5<=a)){u=_d5,_d5=-1;break;}_d5--;}}return this.tmpPoints[this.tmpPoints.length-1].setT(s),u;}},{key:"updateTempPoints",value:function updateTempPoints(e,n,i){var d;var s=Date.now(),o=this.tmpPoints.length;var a=o;for(var v=0;v<e.length;v+=2){var p=this.tmpPoints.length,w=new _t(e[v],e[v+1]);if(p===0){this.tmpPoints.push(w);continue;}var A=p-1,M=this.tmpPoints[A];if(w.x===M.x&&w.y===M.y)continue;var E=Ct.Sub(w,M).uni();if(w.isNear(M,n/2)){if(M.t){w.setz(M.z),w.setv(E),this.tmpPoints.push(w),a=Math.min(A,a);continue;}var L=this.tmpPoints[A-1],G=L?Ct.Sub(w,L).uni():M.v;M.set(w.x,w.y,M.z,G),a=Math.min(A,a);continue;}Ct.Equals(E,M.v,0.01)&&(M.t||this.tmpPoints.pop(),a=Math.min(A,a)),w.setv(E),this.tmpPoints.push(w);}var u=o;if(a===o){u=Math.max(u-1,0);var _v6=this.tmpPoints[u].t;_v6&&(i==null||i.add(_v6));}else{var _v7=Math.min(o-1,a);for(u=a;_v7>=0;){var _p2=(d=this.tmpPoints[_v7])==null?void 0:d.t;if(_p2&&(i==null||i.add(_p2),_v7<=a)){u=_v7,_v7=-1;break;}_v7--;}}return this.tmpPoints[this.tmpPoints.length-1].setT(s),u;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(e){var n=this.workOptions.thickness,i=e.length,s=this.getMinZ(n);for(var o=0;o<i;o+=2){var a=this.tmpPoints.length,u=new _t(e[o],e[o+1]);if(a===0){this.tmpPoints.push(u);continue;}var d=a-1,v=this.tmpPoints[d];if(u.x===v.x&&u.y===v.y){v.z<this.MAX_REPEAR&&v.setz(Math.min(v.z+1,this.MAX_REPEAR));continue;}var p=Ct.Sub(u,v).uni(),w=u.distance(v);if(a>1&&v.z===s)break;if(u.isNear(v,n/2)){var M=v.z;if(i<3&&v.z<this.MAX_REPEAR&&(M=Math.min(v.z+1,this.MAX_REPEAR),a>1)){var G=a-1;for(;G>0;){var z=this.tmpPoints[G].distance(this.tmpPoints[G-1]),et=Math.max(this.tmpPoints[G].z-this.uniThickness*z,-n/4);if(this.tmpPoints[G-1].z>=et)break;this.tmpPoints[G-1].setz(et),G--;}}if(v.t){u.setz(M),u.setv(p),this.tmpPoints.push(u);continue;}var E=this.tmpPoints[d-1],L=E?Ct.Sub(u,E).uni():v.v;v.set(u.x,u.y,M,L);continue;}u.setv(p);var A=Math.max(v.z-this.uniThickness*w,s);a>1&&Ct.Equals(p,v.v,0.01)&&v.z<=0&&(v.t||this.tmpPoints.pop()),u.setz(A),this.tmpPoints.push(u);}}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var p,w;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.strokeType,u=i.lineCap,d=i.lineDash,v=s.get(n.name);return o&&(n.tagName==="GROUP"?GPt(n)?n.setAttribute("bgcolor",o):n.children.forEach(function(A){A.setAttribute("strokeColor",o),A.getAttribute("fillColor")&&A.setAttribute("fillColor",o);}):(n.setAttribute("strokeColor",o),n.setAttribute("fillColor",o)),(p=v==null?void 0:v.opt)!=null&&p.strokeColor&&(v.opt.strokeColor=o)),a&&v!=null&&v.opt&&(w=v.opt)!=null&&w.strokeType&&(v.opt.strokeType=a),u&&v!=null&&v.opt&&(v.opt.lineCap=u),d&&v!=null&&v.opt&&(v.opt.lineDash=d),v&&s.setInfo(n.name,v),jt.updateNodeOpt(e);}}]);}(jt);var TS=/*#__PURE__*/function(_jt2){function TS(e){var _this44;_classCallCheck(this,TS);_this44=_callSuper(this,TS,[e]);wt(_this44,"toolsType",It.LaserPen);wt(_this44,"canRotate",!1);wt(_this44,"scaleType",be.none);wt(_this44,"syncTimestamp");wt(_this44,"syncIndex",0);wt(_this44,"tmpPoints",[]);wt(_this44,"workOptions");wt(_this44,"consumeIndex",0);_this44.workOptions=e.toolsOpt,_this44.syncTimestamp=0;return _this44;}_inherits(TS,_jt2);return _createClass(TS,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(e){_superPropGet(TS,"setWorkOptions",this,3)([e]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(e){var n=e.data,i=e.isSubWorker,s=n.workId,o=n.op,a=n.syncUnitTime;if((o==null?void 0:o.length)===0)return{type:xt.None};if(a&&(this.syncUnitTime=a),this.updateTempPoints(o||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:xt.None};var _this$workOptions3=this.workOptions,u=_this$workOptions3.strokeColor,d=_this$workOptions3.thickness,v=_this$workOptions3.strokeType,p=_this$workOptions3.lineDash,w=_this$workOptions3.lineCap,A=$e(this.tmpPoints,d);var M=!1;var E=this.syncIndex,L=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var G={name:s==null?void 0:s.toString(),opacity:1,lineDash:v===Re.Dotted?[p&&p[0]||1,(p&&p[1]||2)*d]:v===Re.LongDotted?[(p&&p[0]||1)*d,(p&&p[1]||2)*d]:void 0,strokeColor:u,lineCap:w,lineWidth:d,anchor:[0.5,0.5]},z=this.getTaskPoints(L);if(z.length){var x=Date.now();x-this.syncTimestamp>this.syncUnitTime&&(M=!0,this.syncTimestamp=x,this.syncIndex=this.tmpPoints.length),i&&this.draw({attrs:G,tasks:z,isDot:!1,layer:this.drawLayer||this.fullLayer});}var et=[];return this.tmpPoints.slice(E).forEach(function(x){et.push(x.x,x.y);}),_objectSpread({rect:{x:A.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:A.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:A.w*this.fullLayer.worldScaling[0],h:A.h*this.fullLayer.worldScaling[1]},type:xt.DrawWork,dataType:Kt.Local,op:M?et:void 0,index:M?E*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var e=(o=this.workId)==null?void 0:o.toString();var n;if(this.tmpPoints.length-1>this.consumeIndex){var a=this.tmpPoints.slice(this.consumeIndex);var u=a.length===1,_this$workOptions4=this.workOptions,d=_this$workOptions4.strokeColor,v=_this$workOptions4.thickness,p=_this$workOptions4.strokeType;if(u){var M=this.computDotStroke({point:a[0],radius:v/2});a=M.ps,n=M.rect;}else n=$e(this.tmpPoints,v);var w={name:e==null?void 0:e.toString(),fillColor:u?d:void 0,opacity:1,lineDash:p===Re.Dotted&&!u?[1,v*2]:p===Re.LongDotted&&!u?[v,v*2]:void 0,strokeColor:d,lineCap:u?void 0:"round",lineWidth:u?0:v,anchor:[0.5,0.5]},A=this.getTaskPoints(a);A.length&&this.draw({attrs:w,tasks:A,isDot:u,layer:this.drawLayer||this.fullLayer});}var i=[];this.tmpPoints.forEach(function(a){i.push(a.x,a.y);});var s=Br(i);return _objectSpread({rect:n&&{x:n.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:n.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:n.w*this.fullLayer.worldScaling[0],h:n.h*this.fullLayer.worldScaling[1]},type:xt.FullWork,dataType:Kt.Local,ops:s,index:this.syncIndex*2},this.baseConsumeResult);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(e){var E;var n=e.op,i=e.replaceId,s=e.isFullWork,_this$workOptions5=this.workOptions,o=_this$workOptions5.strokeColor,a=_this$workOptions5.thickness,u=_this$workOptions5.strokeType;if(!n.length){var L=$e(this.tmpPoints,a);return{x:L.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:L.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:L.w*this.fullLayer.worldScaling[0],h:L.h*this.fullLayer.worldScaling[1]};}var d=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(n||[]);var v,p=this.tmpPoints.slice(d);var w=p.length===1;if(w){var _L3=this.computDotStroke({point:p[0],radius:a/2});p=_L3.ps,v=_L3.rect;}else v=$e(this.tmpPoints,a);var A={name:(E=this.workId)==null?void 0:E.toString(),fillColor:w?o:void 0,opacity:1,lineDash:u===Re.Dotted&&!w?[1,a*2]:u===Re.LongDotted&&!w?[a,a*2]:void 0,strokeColor:o,lineCap:w?void 0:"round",lineWidth:w?0:a,anchor:[0.5,0.5]},M=this.getTaskPoints(p);if(M.length){var _L4=s?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:A,tasks:M,isDot:w,replaceId:i,layer:_L4});}return{x:v.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:v.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:v.w*this.fullLayer.worldScaling[0],h:v.h*this.fullLayer.worldScaling[1]};}},{key:"computDotStroke",value:function computDotStroke(e){var n=e.point,i=e.radius,s={x:n.x-i,y:n.y-i,w:i*2,h:i*2};return{ps:_t.GetDotStroke(n,i,8),rect:s};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=this.tmpPoints.length;for(var i=0;i<e.length;i+=2){if(n){var s=this.tmpPoints.slice(-1)[0];s&&s.x===e[i]&&s.y===e[i+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new _t(e[i],e[i+1]));}}},{key:"draw",value:function(){var _draw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(e){var n,i,s,o,a,_iterator33,_step33,_loop5,_t12;return _regenerator().w(function(_context12){while(1)switch(_context12.p=_context12.n){case 0:n=e.attrs,i=e.tasks,s=e.isDot,o=e.layer,a=this.workOptions.duration;_iterator33=_createForOfIteratorHelper(i);_context12.p=1;_loop5=/*#__PURE__*/_regenerator().m(function _loop5(){var u,d,v,p,w;return _regenerator().w(function(_context11){while(1)switch(_context11.n){case 0:u=_step33.value;d=new Qr(),v=u.pos,p=u.points;s?w=Ii(p,!0):w=Ii(p,!1),d.attr(_objectSpread(_objectSpread({},n),{},{pos:v,d:w})),o.appendChild(d),d.transition(a).attr({scale:s?[0.1,0.1]:[1,1],lineWidth:s?0:1}).then(function(){d.remove();});case 1:return _context11.a(2);}},_loop5);});_iterator33.s();case 2:if((_step33=_iterator33.n()).done){_context12.n=4;break;}return _context12.d(_regeneratorValues(_loop5()),3);case 3:_context12.n=2;break;case 4:_context12.n=6;break;case 5:_context12.p=5;_t12=_context12.v;_iterator33.e(_t12);case 6:_context12.p=6;_iterator33.f();return _context12.f(6);case 7:return _context12.a(2);}},_callee11,this,[[1,5,6,7]]);}));function draw(_x17){return _draw.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(e){var d;var n=[];if(e.length===0)return[];var i=0,s=e[0].x,o=e[0].y,a=[s,o],u=[];for(;i<e.length;){var v=e[i],p=v.x-s,w=v.y-o;if(u.push(new _t(p,w)),i>0&&i<e.length-1){var A=e[i].getAngleByPoints(e[i-1],e[i+1]);if(A<60||A>300){var M=(d=u.pop())==null?void 0:d.clone();M&&n.push({pos:a,points:[].concat(_toConsumableArray(u),[M])}),s=e[i].x,o=e[i].y,a=[s,o];var E=v.x-s,L=v.y-o;u=[new _t(E,L)];}}i++;}return n.push({pos:a,points:u}),n;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(e){var n;var i=[];return this.fullLayer.getElementsByName(e).forEach(function(s){if(s.name===e){var o=s.getBoundingClientRect();n=Jt(n,{x:o.x,y:o.y,w:o.width,h:o.height}),i.push(s);}}),i.length&&i.forEach(function(s){return s.remove();}),n;}}]);}(jt);var Oxt=du;du.polyline=du;du.polygon=Dxt;function du(r,t,e){var n=r.length,i=Co(r[0],t),s=[],o,a,u,d,v;for(e||(e=[]),o=1;o<n;o++){for(a=r[o-1],u=r[o],d=v=Co(u,t);;)if(i|d){if(i&d)break;i?(a=lp(a,u,i,t),i=Co(a,t)):(u=lp(a,u,d,t),d=Co(u,t));}else{s.push(a),d!==v?(s.push(u),o<n-1&&(e.push(s),s=[])):o===n-1&&s.push(u);break;}i=v;}return s.length&&e.push(s),e;}function Dxt(r,t){var e,n,i,s,o,a,u;for(n=1;n<=8;n*=2){for(e=[],i=r[r.length-1],s=!(Co(i,t)&n),o=0;o<r.length;o++)a=r[o],u=!(Co(a,t)&n),u!==s&&e.push(lp(i,a,n,t)),u&&e.push(a),i=a,s=u;if(r=e,!r.length)break;}return e;}function lp(r,t,e,n){return e&8?[r[0]+(t[0]-r[0])*(n[3]-r[1])/(t[1]-r[1]),n[3]]:// top
|
|
404
|
+
decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(u){return u==null?"":u==""?null:(u=u.replace(/ /g,"+"),a._decompress(u.length,32,function(d){return o(i,u.charAt(d));}));},compress:function compress(u){return a._compress(u,16,function(d){return e(d);});},_compress:function _compress(u,d,v){if(u==null)return"";var p,w,A={},M={},E="",L="",G="",z=2,et=3,x=2,y=[],S=0,C=0,P;for(P=0;P<u.length;P+=1)if(E=u.charAt(P),Object.prototype.hasOwnProperty.call(A,E)||(A[E]=et++,M[E]=!0),L=G+E,Object.prototype.hasOwnProperty.call(A,L))G=L;else{if(Object.prototype.hasOwnProperty.call(M,G)){if(G.charCodeAt(0)<256){for(p=0;p<x;p++)S=S<<1,C==d-1?(C=0,y.push(v(S)),S=0):C++;for(w=G.charCodeAt(0),p=0;p<8;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;}else{for(w=1,p=0;p<x;p++)S=S<<1|w,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=0;for(w=G.charCodeAt(0),p=0;p<16;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;}z--,z==0&&(z=Math.pow(2,x),x++),delete M[G];}else for(w=A[G],p=0;p<x;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;z--,z==0&&(z=Math.pow(2,x),x++),A[L]=et++,G=String(E);}if(G!==""){if(Object.prototype.hasOwnProperty.call(M,G)){if(G.charCodeAt(0)<256){for(p=0;p<x;p++)S=S<<1,C==d-1?(C=0,y.push(v(S)),S=0):C++;for(w=G.charCodeAt(0),p=0;p<8;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;}else{for(w=1,p=0;p<x;p++)S=S<<1|w,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=0;for(w=G.charCodeAt(0),p=0;p<16;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;}z--,z==0&&(z=Math.pow(2,x),x++),delete M[G];}else for(w=A[G],p=0;p<x;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;z--,z==0&&(z=Math.pow(2,x),x++);}for(w=2,p=0;p<x;p++)S=S<<1|w&1,C==d-1?(C=0,y.push(v(S)),S=0):C++,w=w>>1;for(;;)if(S=S<<1,C==d-1){y.push(v(S));break;}else C++;return y.join("");},decompress:function decompress(u){return u==null?"":u==""?null:a._decompress(u.length,32768,function(d){return u.charCodeAt(d);});},_decompress:function _decompress(u,d,v){var p=[],w=4,A=4,M=3,E="",L=[],G,z,et,x,y,S,C,P={val:v(0),position:d,index:1};for(G=0;G<3;G+=1)p[G]=G;for(et=0,y=Math.pow(2,2),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;switch(et){case 0:for(et=0,y=Math.pow(2,8),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;C=e(et);break;case 1:for(et=0,y=Math.pow(2,16),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;C=e(et);break;case 2:return"";}for(p[3]=C,z=C,L.push(C);;){if(P.index>u)return"";for(et=0,y=Math.pow(2,M),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;switch(C=et){case 0:for(et=0,y=Math.pow(2,8),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;p[A++]=e(et),C=A-1,w--;break;case 1:for(et=0,y=Math.pow(2,16),S=1;S!=y;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=d,P.val=v(P.index++)),et|=(x>0?1:0)*S,S<<=1;p[A++]=e(et),C=A-1,w--;break;case 2:return L.join("");}if(w==0&&(w=Math.pow(2,M),M++),p[C])E=p[C];else if(C===A)E=z+z.charAt(0);else return null;L.push(E),p[A++]=z+E.charAt(0),w--,z=E,w==0&&(w=Math.pow(2,M),M++);}}};return a;}();r!=null?r.exports=t:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return t;});})(yS);var wS=yS.exports;function Os(r){return JSON.parse(wS.decompress(r));}function Br(r){return wS.compress(JSON.stringify(r));}var Jy=/* @__PURE__ */new WeakMap(),Vr=/*#__PURE__*/function(){function Vr(t){_classCallCheck(this,Vr);wt(this,"maxImageWidth",zr.pencilEraser.maxImageWidth);wt(this,"maxImageHeight",zr.pencilEraser.maxImageHeight);wt(this,"syncUnitTime",zr.syncOpt.interval);wt(this,"vNodes");wt(this,"drawLayer");wt(this,"fullLayer");wt(this,"workId");wt(this,"confirmEraserDeletion",!1);wt(this,"isDelete",!1);var e=t.vNodes,n=t.fullLayer,i=t.drawLayer,s=t.workId,o=t.toolsOpt;this.vNodes=e,this.fullLayer=n,this.drawLayer=i,this.workId=s,this.syncUnitTime=o.syncUnitTime||this.syncUnitTime;}return _createClass(Vr,[{key:"baseConsumeResult",get:function get(){return{workId:this.workId,toolsType:this.toolsType,opt:this.workOptions};}},{key:"filterSamePoints",value:function filterSamePoints(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;return t.reduce(function(n,i){var s=n[n.length-1];return(i&&!s||i&&s&&!i.isNear(s,e))&&n.push(i),n;},[]);}/** 设置工作id */},{key:"setWorkId",value:function setWorkId(t){this.workId=t;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}},{key:"setEraserDeleteConfirmation",value:function setEraserDeleteConfirmation(t){this.confirmEraserDeletion=t;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(t){var s,o,a;var e=wy(this.workOptions,t);this.workOptions=e,this.syncUnitTime=t.syncUnitTime||this.syncUnitTime;var n=(s=this.workId)==null?void 0:s.toString(),i=n&&((o=this.vNodes)==null?void 0:o.get(n))||void 0;n&&i&&(i.opt=Sy(e),(a=this.vNodes)==null||a.setInfo(n,i));}},{key:"getRenderableEraserLines",value:function getRenderableEraserLines(t){return[].concat(_toConsumableArray(t.eraserlines||[]),_toConsumableArray(t.doingLines||[]));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(t){var i,s;var e;var n=(i=this.workId)==null?void 0:i.toString();if(n&&t){var o=this.fullLayer.getElementsByName(n)||this.drawLayer&&this.drawLayer.getElementsByName(n)||[];if(o.length!==1)return;var a=o[0],u=t.pos,d=t.zIndex,v=t.scale,p=t.angle,w=t.translate,A={};Ze(d)&&(A.zIndex=d),u&&(A.pos=[u[0],u[1]]),v&&(A.scale=v),p&&(A.rotate=p),w&&(A.translate=w),a.attr(A);var M=a==null?void 0:a.getBoundingClientRect();return M&&(e=Jt(e,{x:Math.floor(M.x-Vr.SafeBorderPadding),y:Math.floor(M.y-Vr.SafeBorderPadding),w:Math.floor(M.width+Vr.SafeBorderPadding*2),h:Math.floor(M.height+Vr.SafeBorderPadding*2)})),(s=this.vNodes)==null||s.setInfo(n,{rect:e,centerPos:u}),e;}}},{key:"drawEraserlines",value:function drawEraserlines(t,e){var n=t.group,_t$eraserlines=t.eraserlines,i=_t$eraserlines===void 0?[]:_t$eraserlines,s=t.eraserFaces,o=t.pos,a=t.layer,u=a.parent;if(e)try{var v=(a.renderer.glRenderer||a.renderer.canvasRenderer).options.displayRatio,p=n.getBoundingClientRect(),w=p.width*v*a.worldScaling[0],A=p.height*v*a.worldScaling[1];var M=1;if((w>this.maxImageWidth||A>this.maxImageHeight)&&(M=Math.min(this.maxImageWidth/w,this.maxImageHeight/A)),u.renderer.glRenderer&&!this.confirmEraserDeletion&&this.drawEraserMask({group:n,eraserlines:i,eraserFaces:s,pos:o,layer:a,targetScale:M}))return;var E=a.getAttribute("scale");E=[E[0]*M,E[1]*M];var L=a.parent.parent,G=a.getAttribute("translate"),z=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),L,{offscreen:u.offscreen,width:u.width,height:u.height,contextType:"2d",autoRender:!1,bufferSize:500},E,G),et=n.cloneNode(!0);if(!i.length&&!s)return;s&&this.addEraserFaces(et,s,o,!1),this.addEraserlines(et,i,o,!1),z.appendChild(et);var x=z.parent;x.render();var y=z.renderer.canvasRenderer,S=y.context;if(!S)return;var C=y.options.displayRatio,P=et.getBoundingClientRect(),X={x:P.x,y:P.y,w:P.width,h:P.height},$={x:0,y:0,w:L.width,h:L.height};if(qa(X,$)===Ji.outside){qr(et,x),L.removeChild(x),this.isDelete=!0;return;}var j=Pxt(X,C),nt=br(j);nt.x=Math.floor(Math.max(j.x,0)),nt.y=Math.floor(Math.max(j.y,0)),nt.w=Math.min(j.x+j.w,L.width)-nt.x,nt.h=Math.min(j.y+j.h,L.height)-nt.y;var ct=this.getGroupRect(nt,C),F=ct.x,R=ct.y,Y=ct.w,q=ct.h;var lt=S.getImageData(F,R,Y,q);if(this.confirmEraserDeletion&&this.isTransparentRectByCanvas(lt)){qr(et,x),L.removeChild(x),this.isDelete=!0,lt=null;return;}if(this.confirmEraserDeletion&&u.renderer.glRenderer&&this.drawEraserMask({group:n,eraserlines:i,eraserFaces:s,pos:o,layer:a,targetScale:M})){qr(et,x),L.removeChild(x),lt=null;return;}qr(n,u);var ut=this.createSpriteNode({imageData:lt,safariRect:nt,originRect:j,worldScaling:z.worldScaling});ut&&n.append(ut),qr(et,x),L.removeChild(x),u.deleteTexture(lt),lt=null;}catch(d){console.error("[BaseShapeTool] drawEraserlines error:",d);return;}}},{key:"drawEraserMask",value:function drawEraserMask(t){var S,C;var e=t.group,n=t.eraserlines,i=t.eraserFaces,s=t.pos,o=t.layer,a=t.targetScale;if(!n.length&&!i||e.getAttribute("clipPath"))return!1;var u=Number(e.getAttribute("width")),d=Number(e.getAttribute("height"));if(!(u>0)||!(d>0))return!1;var v=o.parent.renderer;if(!v.glRenderer)return!1;var p=v.options.displayRatio||1,w=Math.max(1,Math.ceil(u*p*o.worldScaling[0]*a)),A=Math.max(1,Math.ceil(d*p*o.worldScaling[1]*a)),M=[-u/2,-d/2,u,d];var E=Jy.get(o);E||(E=/* @__PURE__ */new Map(),Jy.set(o,E)),this.pruneEraserMaskCaches(o,E,v);var L=E.get(this.workId),G=!L||L.pixelWidth!==w||L.pixelHeight!==A||L.facesKey!==(i==null?void 0:i.d);if(L&&!G&&(G=this.isEraserMaskPrefixChanged(L,n)),G){if(L==null||L.handle.destroy(v),L=this.createEraserMaskCache(w,A,M),!L)return!1;E.set(this.workId,L);}if(!L)return!1;var z=w/u,et=A/d;L.context.setTransform(z,0,0,et,w/2,A/2),G&&i&&(this.appendEraserMaskFaces(L.context,i,s),L.facesKey=i.d);var x=G,y;var _iterator23=_createForOfIteratorHelper(n),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var P=_step23.value;var X=L.commands.get(P.workId),$=G?0:(X==null?void 0:X.count)||0;for(var K=$;K<P.op.length;K++)x=!0,y=Jt(y,this.appendEraserMaskStroke(L.context,P.op[K],P.thickness,s));L.commands.set(P.workId,{count:P.op.length,thickness:P.thickness,first:(S=P.op[0])==null?void 0:S.slice(0,2),last:(C=P.op[P.op.length-1])==null?void 0:C.slice(-2)});}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return x&&L.handle.update({rect:M,dirtyRect:G||!y?void 0:[y.x,y.y,y.w,y.h]}),e.setMask(L.handle,{rect:M}),!0;}},{key:"pruneEraserMaskCaches",value:function pruneEraserMaskCaches(t,e,n){var _iterator24=_createForOfIteratorHelper(e),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _step24$value=_slicedToArray(_step24.value,2),i=_step24$value[0],s=_step24$value[1];i!==this.workId&&t.getElementsByName(i).length===0&&(s.handle.destroy(n),e.delete(i));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}}},{key:"createEraserMaskCache",value:function createEraserMaskCache(t,e,n){var o,a;var i;typeof OffscreenCanvas=="function"?i=new OffscreenCanvas(t,e):(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(i=document.createElement("canvas"),i.width=t,i.height=e);var s=i==null?void 0:i.getContext("2d");if(!(!i||!s))return s.save(),s.setTransform(1,0,0,1,0,0),s.fillStyle="#fff",s.fillRect(0,0,t,e),s.restore(),{canvas:i,context:s,handle:new fgt(i,{rect:n,singleChannelTexture:((o=this.fullLayer.parent.renderer.options.bitmapEraserMaskOptions)==null?void 0:o.singleChannelTexture)!==!1,textureSubImage2D:((a=this.fullLayer.parent.renderer.options.bitmapEraserMaskOptions)==null?void 0:a.textureSubImage2D)!==!1}),rect:n,pixelWidth:t,pixelHeight:e,commands:/* @__PURE__ */new Map()};}},{key:"appendEraserMaskStroke",value:function appendEraserMaskStroke(t,e,n,i){if(e.length<2)return;t.save(),t.fillStyle="#000",t.strokeStyle="#000",t.lineCap="round",t.lineJoin="round",t.lineWidth=n;var s=e[0]-i[0],o=e[1]-i[1];if(e.length===2)t.beginPath(),t.arc(s,o,n/2,0,Math.PI*2),t.fill();else{t.beginPath(),t.moveTo(s,o);for(var M=2;M<e.length;M+=2)t.lineTo(e[M]-i[0],e[M+1]-i[1]);t.stroke();}t.restore();var a=[],u=[];for(var _M2=0;_M2<e.length;_M2+=2)a.push(e[_M2]-i[0]),u.push(e[_M2+1]-i[1]);var d=n/2+1,v=Math.min.apply(Math,a),p=Math.min.apply(Math,u),w=Math.max.apply(Math,a),A=Math.max.apply(Math,u);return{x:v-d,y:p-d,w:w-v+d*2,h:A-p+d*2};}},{key:"appendEraserMaskFaces",value:function appendEraserMaskFaces(t,e,n){t.save(),t.fillStyle="#000",t.beginPath();var _iterator25=_createForOfIteratorHelper(lu(e)),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var i=_step25.value;var _iterator26=_createForOfIteratorHelper(i.rings),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var s=_step26.value;s.forEach(function(_ref52,u){var _ref53=_slicedToArray(_ref52,2),o=_ref53[0],a=_ref53[1];var d=o-n[0],v=a-n[1];u===0?t.moveTo(d,v):t.lineTo(d,v);}),t.closePath();}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}t.fill("evenodd"),t.restore();}},{key:"isEraserMaskPrefixChanged",value:function isEraserMaskPrefixChanged(t,e){var n,i;if(t.commands.size>e.length)return!0;var _iterator27=_createForOfIteratorHelper(e),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var s=_step27.value;var o=t.commands.get(s.workId);if(o&&(s.op.length<o.count||s.thickness!==o.thickness||!this.isSamePoint(o.first,(n=s.op[0])==null?void 0:n.slice(0,2))||!this.isSamePoint(o.last,(i=s.op[o.count-1])==null?void 0:i.slice(-2))))return!0;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return!1;}},{key:"isSamePoint",value:function isSamePoint(t,e){return!t||!e?t===e:t[0]===e[0]&&t[1]===e[1];}},{key:"createVmRenderNode",value:function createVmRenderNode(t,e,n,i,s){var o=n.width,a=n.height,u="bitMap-".concat(t),d=e.layer(u,n),v=new ar({anchor:[0.5,0.5],pos:[o*0.5,a*0.5],size:[o,a],name:"viewport",id:t});return v.setAttribute("scale",i),v.setAttribute("translate",s),d.append(v),v;}},{key:"getGroupRect",value:function getGroupRect(t,e){return Cxt(t,e);}},{key:"addEraserlines",value:function addEraserlines(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var _iterator28=_createForOfIteratorHelper(e),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var s=_step28.value;var o=s.thickness,a=s.op;var _iterator29=_createForOfIteratorHelper(a),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var u=_step29.value;var d=u.map(function(M,E){return E%2?M-n[1]:M-n[0];}),v=this.computEraserPoints(d,o),p=Ii(v,!0),w={pos:[0,0],d:p,fillColor:"rgba(0,0,0,1)"},A=new Qr(w);A.addEventListener("beforerender",function(_ref54){var M=_ref54.detail;var E=M.context;i?E.blendFuncSeparate(E.ZERO,E.ZERO,E.ZERO,E.ZERO):E.globalCompositeOperation="destination-out";}),A.addEventListener("afterrender",function(_ref55){var M=_ref55.detail;var E=M.context;i?E.blendFuncSeparate(E.SRC_ALPHA,E.ONE_MINUS_SRC_ALPHA,E.ONE,E.ONE_MINUS_SRC_ALPHA):E.globalCompositeOperation="source-over";}),t.append(A);}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}}},{key:"addEraserFaces",value:function addEraserFaces(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var s=lu(e).flatMap(function(a){return a.rings.map(function(u){return Ii(u.map(function(_ref56){var _ref57=_slicedToArray(_ref56,2),d=_ref57[0],v=_ref57[1];return new _t(d-n[0],v-n[1]);}),!0);});}).join(" ");if(!s)return;var o=new Qr({pos:[0,0],d:s,fillColor:"rgba(0,0,0,1)",fillRule:"evenodd"});o.addEventListener("beforerender",function(_ref58){var a=_ref58.detail;var u=a.context;i?u.blendFuncSeparate(u.ZERO,u.ZERO,u.ZERO,u.ZERO):u.globalCompositeOperation="destination-out";}),o.addEventListener("afterrender",function(_ref59){var a=_ref59.detail;var u=a.context;i?u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA):u.globalCompositeOperation="source-over";}),t.append(o);}},{key:"isTransparentRectByCanvas",value:function isTransparentRectByCanvas(t){var e=!0;for(var n=0;n<t.data.length;n+=4)if(t.data[n+3]!==0){e=!1;break;}return e;}},{key:"createSpriteNode",value:function createSpriteNode(t){var e=t.imageData,n=t.worldScaling,i=t.safariRect,s=t.originRect;var o;if(typeof OffscreenCanvas=="function"){o=new OffscreenCanvas(e.width,e.height);var w=o.getContext("2d");w&&w.putImageData(e,0,0);}else if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){o=document.createElement("canvas"),o.width=e.width,o.height=e.height;var _w2=o.getContext("2d");_w2&&_w2.putImageData(e,0,0);}if(!o)return console.warn("Failed to create imageEraserBitmap Sprite"),null;var _Axt=Axt(i,s,n),a=_Axt.size,u=_Axt.textureRect,d={name:"eraserTexture",anchor:[0.5,0.5],pos:[0,0],size:a,texture:o,textureRect:u},v=new Ju(d);var p=!0;return v.addEventListener("beforerender",function(_ref60){var w=_ref60.detail;var A=w.context;typeof A.imageSmoothingEnabled=="boolean"&&(p=A.imageSmoothingEnabled,A.imageSmoothingEnabled=!1);}),v.addEventListener("afterrender",function(_ref61){var w=_ref61.detail;var A=w.context;typeof A.imageSmoothingEnabled=="boolean"&&(A.imageSmoothingEnabled=p);}),v;}},{key:"computEraserPoints",value:function computEraserPoints(t,e){var n=Math.ceil(e/2);return t.length===2?this.computDot(t,n):this.computLine(t,n);}},{key:"computDot",value:function computDot(t,e){var n=new _t(t[0],t[1]);return _t.GetDotStroke(n,e,8);}},{key:"computLine",value:function computLine(t,e){var n=[],i=[];var s,o;for(var a=0;a<t.length;a+=2){var u=new _t(t[a],t[a+1]);var d=void 0;if(a==t.length-2){var v=new _t(t[a-2],t[a-1]);d=Ct.Sub(u,v).uni(),s=u;}else{a===0&&(o=u);var _v2=new _t(t[a+2],t[a+3]);d=Ct.Sub(_v2,u).uni();}if(d){var _v3=Ct.Per(d).mul(e);n.push(_t.Sub(u,_v3)),i.push(_t.Add(u,_v3));}}if(s&&o){var _a5=_t.GetSemicircleStroke(s,n[n.length-1],-1,8),_u3=_t.GetSemicircleStroke(o,i[0],-1,8);return n.concat(_a5,i.reverse(),_u3);}return[];}},{key:"replace",value:function replace(t,e,n){var _this39=this;var s;if(!e){n&&t.append(n);return;}var i=t.getElementsByName(e);if(i.length){var _iterator30=_createForOfIteratorHelper(i),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var o=_step30.value;n?ZPt(n,o,t):(o.remove(),_Ur(o,t.parent));}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}}else n&&t.append(n);this.fullLayer!==this.drawLayer&&(this.fullLayer===t?(s=this.drawLayer)==null||s.getElementsByName(e).forEach(function(a){var u;a.remove(),_Ur(a,(u=_this39.drawLayer)==null?void 0:u.parent);}):this.fullLayer.getElementsByName(e).forEach(function(a){a.remove(),_Ur(a,_this39.fullLayer.parent);}));}},{key:"removeDrawCountNodes",value:function removeDrawCountNodes(t,e){var n=[];t.getElementsByName(this.workId).forEach(function(i){i.id&&e&&Number(i.id)<e&&n.push(i);});for(var _i3=0,_n3=n;_i3<_n3.length;_i3++){var i=_n3[_i3];i.remove(),_Ur(i,t.parent);}}}],[{key:"normalizeStorageData",value:function(){var _normalizeStorageData=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(t){return _regenerator().w(function(_context1){while(1)switch(_context1.n){case 0:return _context1.a(2,this.normalizeStorageDataSync(t));}},_callee1,this);}));function normalizeStorageData(_x15){return _normalizeStorageData.apply(this,arguments);}return normalizeStorageData;}()},{key:"normalizeStorageDataSync",value:function normalizeStorageDataSync(t){var e=br(t),n=JSON.stringify(t);if(e.opt){var i=Sy(e.opt);e.opt=wy(void 0,i);}return e.updateNodeOpt=_objectSpread(_objectSpread({},e.updateNodeOpt),{},{useAnimation:!1}),{status:JSON.stringify(e)===n?"already-stable":"stable",value:e};}},{key:"normalizeDrawableStorageData",value:function(){var _normalizeDrawableStorageData=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(t){return _regenerator().w(function(_context10){while(1)switch(_context10.n){case 0:return _context10.a(2,this.normalizeDrawableStorageDataSync(t));}},_callee10,this);}));function normalizeDrawableStorageData(_x16){return _normalizeDrawableStorageData.apply(this,arguments);}return normalizeDrawableStorageData;}()},{key:"normalizeDrawableStorageDataSync",value:function normalizeDrawableStorageDataSync(t){var e=Vr.normalizeStorageDataSync(t);if(e.status==="unrecoverable")return e;var n=e.value;return n.type===xt.DrawWork&&!n.ops&&Array.isArray(n.op)&&n.op.length?(n.type=xt.FullWork,n.ops=Br(n.op),{status:"stable",value:n}):e;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var y;var e=t.node,n=t.opt,i=t.vNodes,s=t.willSerializeData,o=t.targetNode,a=n.zIndex,u=n.translate,d=n.angle,v=n.originPoint,p=n.scenePoint,w=n.scale,A=n.pointMap,M=n.thickness;var E;var L=o&&br(o)||i.get(e.name);if(!L)return;var G=n.eraserGeometryDelta,z=Vi(L.opt)?cu(L.op,L.centerPos):void 0;if(G&&(!z||!U2(G,L.op,L.centerPos)))return;G&&F2(i,e.name,G.matrix);var et;Ze(a)&&(e.setAttribute("zIndex",a),L.opt.zIndex=a);var x=e.parent;if(x){if(v&&w&&o){var _L$opt$eraserFaces;if(et=[w[0],0,0,w[1],p[0]*(1-w[0])+((u==null?void 0:u[0])||0),p[1]*(1-w[1])+((u==null?void 0:u[1])||0)],uf(L.op,p,w,u),Fa(L.centerPos,p,w,u),L.opt.translate=void 0,L.opt.scale=void 0,L.opt.eraserlines)for(var S=0;S<L.opt.eraserlines.length;S++){var _L$opt$eraserlines$S=L.opt.eraserlines[S],C=_L$opt$eraserlines$S.op,P=_L$opt$eraserlines$S.thickness;L.opt.eraserlines[S].thickness=Math.round(P*Math.max(w[0],w[1]));for(var X=0;X<C.length;X++)Fa(C[X],p,w,u);}Vi(L.opt)&&(L.opt.eraserFaces=Id((_L$opt$eraserFaces=L.opt.eraserFaces)!==null&&_L$opt$eraserFaces!==void 0?_L$opt$eraserFaces:null,function(S){return Fa(S,p,w,u);}),delete L.opt.eraserlines);}else if(u){if(e.setAttribute("translate",u),L.opt.translate=u,o){var _S3=[u[0]*x.worldScaling[0],u[1]*x.worldScaling[1]];E=Za(L.rect,_S3),L.rect=E;}else{var _S4=Vr.getRectFromLayer(x,e.name);L.rect=_S4||L.rect;}}else if(Ze(d))if(e.setAttribute("rotate",d),L.opt.rotate=d,o)E=T0(L.rect,d),L.rect=E;else{var _S5=Vr.getRectFromLayer(x,e.name);L.rect=_S5||L.rect;}if(A){var _S6=A.get(e.name);if(_S6)for(var _C3=0,_P3=0;_C3<L.op.length;_C3+=3,_P3++)L.op[_C3]=_S6[_P3][0],L.op[_C3+1]=_S6[_P3][1];}if(M&&(y=L==null?void 0:L.opt)!=null&&y.thickness&&(L.opt.thickness=M),s&&!(v&&w&&o)){if(u){var _L$opt$eraserFaces2;et=[1,0,0,1,u[0],u[1]];var _S7=L.op.map(function(C,P){var X=P%3;return X===0?C+u[0]:X===1?C+u[1]:C;});if(L.op=_S7,L.centerPos=[L.centerPos[0]+u[0],L.centerPos[1]+u[1]],L!=null&&L.opt&&(L.opt.translate=void 0),L.opt.eraserlines)for(var _C4=0;_C4<L.opt.eraserlines.length;_C4++){var _P4=L.opt.eraserlines[_C4].op;for(var _X2=0;_X2<_P4.length;_X2++){var $=_P4[_X2].map(function(K,j){return j%2?K+u[1]:K+u[0];});L.opt.eraserlines[_C4].op[_X2]=$;}}Vi(L.opt)&&(L.opt.eraserFaces=Id((_L$opt$eraserFaces2=L.opt.eraserFaces)!==null&&_L$opt$eraserFaces2!==void 0?_L$opt$eraserFaces2:null,function(C){for(var _P5=0;_P5<C.length;_P5+=2)C[_P5]+=u[0],C[_P5+1]+=u[1];}),delete L.opt.eraserlines);}else if(Ze(d)){var _L$opt$eraserFaces3;var _S8=Math.PI*d/180,_C5=Math.cos(_S8),_P6=Math.sin(_S8),_L$centerPos=_slicedToArray(L.centerPos,2),_X3=_L$centerPos[0],_$2=_L$centerPos[1];et=[_C5,_P6,-_P6,_C5,_X3-_C5*_X3+_P6*_$2,_$2-_P6*_X3-_C5*_$2];var K=L.op;if($Pt(K,L.centerPos,d),L.op=K,L!=null&&L.opt&&(L.opt.rotate=void 0),L.opt.eraserlines)for(var j=0;j<L.opt.eraserlines.length;j++){var nt=L.opt.eraserlines[j].op;for(var ct=0;ct<nt.length;ct++)y1(nt[ct],L.centerPos,d);}Vi(L.opt)&&(L.opt.eraserFaces=Id((_L$opt$eraserFaces3=L.opt.eraserFaces)!==null&&_L$opt$eraserFaces3!==void 0?_L$opt$eraserFaces3:null,function(j){return y1(j,L.centerPos,d);}),delete L.opt.eraserlines);}}if(z&&et&&Vi(L.opt)){var _S9=cu(L.op,L.centerPos);if(G&&G.toDigest!==_S9)return;G||mgt(L.opt,{matrix:et,fromDigest:z,toDigest:_S9});}L&&i.setInfo(e.name,L);}}},{key:"getCenterPos",value:function getCenterPos(t,e){var n=e.worldPosition,i=e.worldScaling;return[(t.x+t.w/2-n[0])/i[0],(t.y+t.h/2-n[1])/i[1]];}},{key:"getRectFromLayer",value:function getRectFromLayer(t,e){var n=t.getElementsByName(e)[0];if(n){var i=n.getBoundingClientRect();return{x:Math.floor(i.x-Vr.SafeBorderPadding),y:Math.floor(i.y-Vr.SafeBorderPadding),w:Math.floor(i.width+Vr.SafeBorderPadding*2),h:Math.floor(i.height+Vr.SafeBorderPadding*2)};}}},{key:"isWillRefresh",value:function isWillRefresh(t){var e=t.toolsType,n=t.opt,i=t.node,s=t.updateOpt,o=t.willSerializeData;return!!(o&&(s.angle||s.translate)||s.thickness&&n.thickness&&n.thickness!==s.thickness||s.strokeType&&n.strokeType&&n.strokeType!==s.strokeType||s.originPoint&&s.scenePoint&&s.scale||s.pointMap&&s.pointMap.has(i.name)||e===It.Text&&(s.fontSize||s.translate||s.textInfos&&s.textInfos.get(i.name))||e===It.BackgroundSVG&&(s.translate||s.scale)||e===It.Image&&(s.angle||s.translate||s.scale||s.strokeColor&&n.type===_u.Iconify)||e===s.toolsType&&s.willRefresh||n.eraserlines&&n.eraserlines.length&&(s.strokeColor||s.fillColor));}}]);}();wt(Vr,"SafeBorderPadding",10);var jt=Vr;var v0=Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50}),Object.freeze({width:48,height:74})]);function SS(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;return Math.abs(r[0]-t[0])<e&&Math.abs(r[1]-t[1])<e;}function bxt(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(r.length===0)return[];var e=[[r[0][0],r[0][1]]];for(var n=1;n<r.length;n++)SS([r[n][0],r[n][1]],e[e.length-1],t)||e.push([r[n][0],r[n][1]]);return e;}function Mxt(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(r.length<=2)return r;var e=r[0],n=r[r.length-1];return SS(e,n,t)?r.slice(0,-1):r;}function Ext(r){var t=r.reduce(function(n,i){return n+i[0];},0)/r.length,e=r.reduce(function(n,i){return n+i[1];},0)/r.length;return[t,e];}function _y(r,t){return Math.atan2(t[1]-r[1],t[0]-r[0]);}function Lxt(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(r.length<=2)return r;var e=[];var _iterator31=_createForOfIteratorHelper(r),_step31;try{var _loop3=function _loop3(){var i=_step31.value;e.some(function(o){return Math.abs(o[0]-i[0])<t&&Math.abs(o[1]-i[1])<t;})||e.push([i[0],i[1]]);};for(_iterator31.s();!(_step31=_iterator31.n()).done;){_loop3();}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}var n=Ext(e);return e.sort(function(i,s){var o=_y(n,i),a=_y(n,s);return o-a;});}function Oxt(r,t){var e=t[0].x<t[t.length-1].x;return r.map(function(i){var o=i.map(function(a){var u=-1,d=1/0,v=0;for(var p=0;p<t.length;p++){var w=t[p],A=Math.sqrt(Math.pow(w.x-a[0],2)+Math.pow(w.y-a[1],2));A<d&&(d=A,u=p,v=w.z);}return{point:a,index:u,bestZ:v};}).sort(function(a,u){return a.index-u.index;}).map(function(a){return[].concat(_toConsumableArray(a.point),[a.bestZ]);});return e&&o[0][0]>o[o.length-1][0]||!e&&o[0][0]<o[o.length-1][0]?o.reverse():o;}).sort(function(i,s){var o=i[0][0],a=s[0][0];return e?o-a:a-o;});}function Dxt(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;var i=r.map(function(p){return[p.x,p.y];}),s=function s(p,w){return p.map(function(_ref62){var _ref63=_slicedToArray(_ref62,2),A=_ref63[0],M=_ref63[1];return{X:Math.round(A*w),Y:Math.round(M*w)};});},o=new vr.ClipperOffset();o.AddPath(s(i,1e3),vr.JoinType.jtRound,vr.EndType.etOpenButt);var a=[];o.Execute(a,1);var u=new vr.Clipper();u.AddPaths(a,vr.PolyType.ptSubject,!0),t.forEach(function(p){u.AddPath(s(p,1e3),vr.PolyType.ptClip,!0);});var d=new vr.Paths();u.Execute(vr.ClipType.ctDifference,d,vr.PolyFillType.pftNonZero,vr.PolyFillType.pftNonZero);var v=d.map(function(p){return Mxt(Lxt(bxt(p.map(function(w){return[w.X/1e3,w.Y/1e3];}),e),e),e);}).filter(function(p){return p.length>=2;});return Oxt(v,r);}var IS=/*#__PURE__*/function(_jt){function IS(e){var _this40;_classCallCheck(this,IS);_this40=_callSuper(this,IS,[e]);wt(_this40,"canRotate",!0);wt(_this40,"scaleType",be.all);wt(_this40,"toolsType",It.Pencil);wt(_this40,"syncTimestamp");wt(_this40,"syncIndex",0);wt(_this40,"tmpPoints",[]);wt(_this40,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */wt(_this40,"uniThickness");wt(_this40,"workOptions");wt(_this40,"centerPos",[0,0]);_this40.workOptions=e.toolsOpt,_this40.uniThickness=_this40.MAX_REPEAR/_this40.workOptions.thickness/10,_this40.syncTimestamp=0;return _this40;}_inherits(IS,_jt);return _createClass(IS,[{key:"setPointVector",value:function setPointVector(e,n){if(!n)return!1;var i=e.x-n.x,s=e.y-n.y;if(i===0&&s===0)return!1;var o=Ct.Sub(e,n).uni();return!Number.isFinite(o.x)||!Number.isFinite(o.y)?!1:(e.setv(o),!0);}/** 批量合并消费本地数据,返回绘制结果 */},{key:"combineConsume",value:function combineConsume(){var a;var e=(a=this.workId)==null?void 0:a.toString();if(this.tmpPoints.length<2)return{type:xt.None};var n=this.transformDataAll(!0),i={name:e};var s;var o=this.drawLayer||this.fullLayer;return n.length&&(s=this.draw({attrs:i,tasks:n,replaceId:e,layer:o})),{rect:s,type:xt.DrawWork,dataType:Kt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(e){_superPropGet(IS,"setWorkOptions",this,3)([e]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(e){var _this41=this;var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.drawCount,u=e.removeDrawCount,d=e.isSimpleWorker,v=n.workId,p=n.syncUnitTime;p&&(this.syncUnitTime=p);var _this$transformData=this.transformData(n,!1),w=_this$transformData.tasks,A=_this$transformData.effects,M=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,M,Math.max(0,this.tmpPoints.length-2));var E={name:v,id:Ze(a)&&a.toString()||void 0};var L,G=!1;var z=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),w.length&&(w[0].taskId-this.syncTimestamp>this.syncUnitTime&&(G=!0,this.syncTimestamp=w[0].taskId,this.syncIndex=this.tmpPoints.length),s||o||d)){var y=i?this.fullLayer:this.drawLayer||this.fullLayer;L=this.draw({attrs:E,tasks:w,effects:A,layer:y,removeDrawCount:u});}if(d){var _y3=[];this.tmpPoints.slice(z).forEach(function(C){_y3.push(C.x,C.y,_this41.computRadius(C.z,_this41.workOptions.thickness));});var S=!this.workOptions.previewLocalOnly&&G;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Kt.Local,op:S?_y3:void 0,index:S?z*3:void 0,rect:L,updateNodeOpt:{useAnimation:!0}});}if(s)return M>10&&this.tmpPoints.splice(0,M-10),{rect:L,type:xt.DrawWork,dataType:Kt.Local};var et=[];this.tmpPoints.slice(z).forEach(function(y){et.push(y.x,y.y,_this41.computRadius(y.z,_this41.workOptions.thickness));});var x=!this.workOptions.previewLocalOnly&&G;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Kt.Local,rect:L,op:x?et:void 0,index:x?z*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(e){var v;var n=this.workId;if(e.data){var _e$data=e.data,p=_e$data.op,w=_e$data.workState;p!=null&&p.length&&w===te.Done&&this.workOptions.strokeType===Re.Stroke&&this.updateTempPointsWithPressureWhenDone(p);}var i=this.fullLayer;if(this.tmpPoints.length<2)return this.replace(i,n),{type:xt.RemoveNode,removeIds:[n]};var s=this.transformDataAll(!0),o={name:n};var a;s.length&&(a=this.draw({attrs:o,tasks:s,replaceId:n,layer:i}));var u=[];this.tmpPoints.map(function(p){u.push(p.x,p.y,p.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var d=Br(u);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:u,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&jt.getCenterPos(a,i)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:a,type:xt.FullWork,dataType:Kt.Local,ops:d,updateNodeOpt:{pos:this.centerPos,useAnimation:!0}});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(e){var p,w;var n=e.op,i=e.isFullWork,s=e.replaceId,_e$workState=e.workState,o=_e$workState===void 0?te.Done:_e$workState;this.tmpPoints.length=0;for(var A=0;A<n.length;A+=3){var M=new _t(n[A],n[A+1],n[A+2]);if(this.tmpPoints.length>0){var E=this.tmpPoints[this.tmpPoints.length-1];if(!this.setPointVector(M,E))continue;}this.tmpPoints.push(M);}if(this.tmpPoints.length<2)return;var a=this.transformDataAll(!0),u=(p=this.workId)==null?void 0:p.toString(),d={name:u};var v;if(u&&a.length){var _A2=i?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({attrs:d,tasks:a,replaceId:s,layer:_A2,isDrawEraserlines:o===te.Done}),(w=this.vNodes)==null||w.setInfo(u,{rect:v,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:v&&jt.getCenterPos(v,_A2)});}return v;}},{key:"computPencilPoints",value:function computPencilPoints(e){var _this42=this;var n=[],i=e.op,s=e.eraserPolylines,o=e.eraserThickness;this.tmpPoints.length=0;for(var u=0;u<i.length;u+=3){var d=new _t(i[u],i[u+1],i[u+2]);if(this.tmpPoints.length>0){var v=this.tmpPoints[this.tmpPoints.length-1];if(!this.setPointVector(d,v))continue;}this.tmpPoints.push(d);}if(this.tmpPoints.length<2)return;var a=this.transformDataAll(!0);if(a.length){var _loop4=function _loop4(){var _a$_u=a[_u4],d=_a$_u.pos,v=_a$_u.points,p=v.map(function(M){return M.point.addXY(d[0],d[1]);}),w=[];var _iterator32=_createForOfIteratorHelper(s),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var M=_step32.value;var E=[];for(var G=0;G<M.length;G+=2){var z=new _t(M[G],M[G+1]);if(E.length>0){var et=E[E.length-1].point;if(!_this42.setPointVector(z,et))continue;}E.push({point:z,radius:o});}var _this42$computStroke=_this42.computStroke(E,!1),L=_this42$computStroke.ps;w.push(L.map(function(G){return G.XY;}));}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}Dxt(p,w,0.01).forEach(function(M){n.push(M.map(function(E){return[E[0],E[1],E[2]];}).flat(1));});};for(var _u4=0;_u4<a.length;_u4++){_loop4();}}return n;}},{key:"transformDataAll",value:function transformDataAll(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.getTaskPoints(this.tmpPoints,e&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(e){var _this43=this;var n=e.attrs,i=e.tasks,s=e.replaceId,o=e.effects,a=e.layer,u=e.removeDrawCount,_e$isDrawEraserlines=e.isDrawEraserlines,d=_e$isDrawEraserlines===void 0?!0:_e$isDrawEraserlines,_this$workOptions=this.workOptions,v=_this$workOptions.strokeColor,p=_this$workOptions.strokeType,w=_this$workOptions.thickness,A=_this$workOptions.zIndex,M=_this$workOptions.scale,E=_this$workOptions.rotate,L=_this$workOptions.translate,G=_this$workOptions.eraserlines,z=_this$workOptions.eraserFaces,et=_this$workOptions.doingLines,x=_this$workOptions.lineCap,y=_this$workOptions.lineDash;o!=null&&o.size&&(o.forEach(function(K){var j;(j=a.getElementById(K+""))==null||j.remove();}),o.clear()),u&&this.removeDrawCountNodes(a,u);var S;var C=[],P=a.worldPosition,X=a.worldScaling;for(var K=0;K<i.length;K++){var _i$K=i[K],j=_i$K.pos,nt=_i$K.points,_this$computDrawPoint=this.computDrawPoints(nt),ct=_this$computDrawPoint.ps,F=_this$computDrawPoint.rect;var R=void 0;var Y=nt.length===1;p===Re.Stroke||Y?R=Ii(ct,!0):R=Ii(ct,!1);var q={pos:j,d:R,fillColor:p===Re.Stroke||Y?v:void 0,lineDash:Y?void 0:p===Re.Dotted?[y&&y[0]||1,(y&&y[1]||2)*w]:p===Re.LongDotted?[(y&&y[0]||1)*w,(y&&y[1]||2)*w]:void 0,strokeColor:v,lineCap:Y?void 0:x,lineWidth:p===Re.Stroke||Y?0:w};S=Jt(S,{x:Math.floor((F.x+j[0])*X[0]+P[0]-jt.SafeBorderPadding),y:Math.floor((F.y+j[1])*X[1]+P[1]-jt.SafeBorderPadding),w:Math.floor(F.w*X[0]+2*jt.SafeBorderPadding),h:Math.floor(F.h*X[1]+2*jt.SafeBorderPadding)}),C.push(q);}M&&(n.scale=M),E&&(n.rotate=E),L&&(n.translate=L);var $=new ar();if(S){this.centerPos=jt.getCenterPos(S,a);var _K2=p===Re.Stroke&&!G&&!z&&!et;$.attr(_objectSpread(_objectSpread({},n),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:_K2?v:void 0,pos:this.centerPos,size:[(S.w-2*jt.SafeBorderPadding)/X[0],(S.h-2*jt.SafeBorderPadding)/X[1]],zIndex:A}));var _j2=C.map(function(nt){return nt.pos=[nt.pos[0]-_this43.centerPos[0],nt.pos[1]-_this43.centerPos[1]],new Qr(nt);});$.append.apply($,_toConsumableArray(_j2)),_K2&&$.seal(),(G||z||et)&&(this.scaleType=be.proportional,this.drawEraserlines({group:$,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:z,pos:this.centerPos,layer:a},d)),this.replace(a,s,$);}if(M||E||L){var _K3=$==null?void 0:$.getBoundingClientRect();_K3&&(S={x:Math.floor(_K3.x-jt.SafeBorderPadding),y:Math.floor(_K3.y-jt.SafeBorderPadding),w:Math.floor(_K3.width+jt.SafeBorderPadding*2),h:Math.floor(_K3.height+jt.SafeBorderPadding*2)});}return this.isDelete&&$.setAttribute("opacity",0),S;}},{key:"computDrawPoints",value:function computDrawPoints(e){return this.workOptions.strokeType===Re.Stroke||e.length===1?this.computStroke(e):this.computNomal(e);}},{key:"computNomal",value:function computNomal(e){var n=this.workOptions.thickness;var i=e.map(function(s){return n=Math.max(n,s.radius),s.point;});return{ps:i,rect:$e(i,n)};}},{key:"computStroke",value:function computStroke(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return e.length===1?this.computDotStroke(e[0]):this.computLineStroke(e,n);}},{key:"computLineStroke",value:function computLineStroke(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var i=[],s=[];for(var u=0;u<e.length;u++){var _e$u=e[u],d=_e$u.point,v=_e$u.radius;var p=d.v;u===0&&e.length>1&&(p=e[u+1].point.v);var w=Ct.Per(p).mul(v);i.push(_t.Sub(d,w)),s.push(_t.Add(d,w));}var o=e[e.length-1];if(n){var _u5=_t.GetSemicircleStroke(o.point,i[i.length-1],-1,8),_d3=_t.GetSemicircleStroke(e[0].point,s[0],-1,8),_v4=i.concat(_u5,s.reverse(),_d3);return{ps:_v4,rect:$e(_v4)};}var a=i.concat(s.reverse());return{ps:a,rect:$e(a)};}},{key:"computDotStroke",value:function computDotStroke(e){var n=e.point,i=e.radius,s={x:n.x-i,y:n.y-i,w:i*2,h:i*2};return{ps:_t.GetDotStroke(n,i,8),rect:s};}},{key:"transformData",value:function transformData(e,n){var i=e.op,s=e.workState;var o=this.tmpPoints.length-1,a=[];if(i!=null&&i.length&&s){var _this$workOptions2=this.workOptions,u=_this$workOptions2.strokeType,d=_this$workOptions2.thickness,v=/* @__PURE__ */new Set(),p=Math.max(0,this.tmpPoints.length-1);u===Re.Stroke?this.updateTempPointsWithPressure(i,d,v):this.updateTempPoints(i,d,v),o=p;var w=n?this.tmpPoints:this.tmpPoints.slice(o);return a=this.getTaskPoints(w,d),{tasks:a,effects:v,consumeIndex:o};}return{tasks:a,consumeIndex:o};}/** 压力渐变公式 */},{key:"computRadius",value:function computRadius(e,n){return e*0.03*n+n*0.5;}},{key:"getMinZ",value:function getMinZ(e,n){return((n||Math.max(1,Math.floor(e*0.3)))-e*0.5)*100/e/3;}},{key:"getTaskPoints",value:function getTaskPoints(e,n){var p;var i=[];if(e.length===0)return[];var s=0,o=e[0].x,a=e[0].y,u=[o,a],d=[],v=e[0].t;for(;s<e.length;){var w=e[s],A=w.x-o,M=w.y-a,E=w.z,L=n?this.computRadius(E,n):E;if(d.push({point:new _t(A,M,E,e[s].v),radius:L}),s>0&&s<e.length-1){var G=e[s].getAngleByPoints(e[s-1],e[s+1]);if(G<60||G>300){var z=(p=d.pop())==null?void 0:p.point.clone();z&&i.push({taskId:v,pos:u,points:[].concat(_toConsumableArray(d),[{point:z,radius:L}])}),o=e[s].x,a=e[s].y,u=[o,a];var et=w.x-o,x=w.y-a;d=[{point:new _t(et,x,E),radius:L}],v=Date.now();}}s++;}return i.push({taskId:v,pos:u,points:d}),i;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(e,n,i){var s=Date.now(),o=this.tmpPoints.length;var a=o;for(var d=0;d<e.length;d+=2){a=Math.min(a,o);var v=this.tmpPoints.length,p=new _t(e[d],e[d+1]);if(v===0){this.tmpPoints.push(p);continue;}var w=v-1,A=this.tmpPoints[w];if(p.x===A.x&&p.y===A.y){A.z<this.MAX_REPEAR&&A.setz(Math.min(A.z+1,this.MAX_REPEAR));continue;}var M=Ct.Sub(p,A).uni();if(p.isNear(A,n)){var G=A.z;if(A.z<this.MAX_REPEAR&&(G=Math.min(A.z+1,this.MAX_REPEAR),v>1)){var x=v-1;for(;x>0;){var y=this.tmpPoints[x].distance(this.tmpPoints[x-1]),S=Math.max(this.tmpPoints[x].z-this.uniThickness*y,0);if(this.tmpPoints[x-1].z>=S)break;this.tmpPoints[x-1].setz(S),a=Math.min(a,x-1),x--;}}if(a=Math.min(a,w),A.t){p.setz(G),p.setv(M),this.tmpPoints.push(p);continue;}var z=this.tmpPoints[w-1],et=z?Ct.Sub(p,z).uni():A.v;A.set(p.x,p.y,G,et);continue;}p.setv(M);var E=p.distance(A),L=Math.max(A.z-this.uniThickness*E,0);v>1&&Ct.Equals(M,A.v,0.01)&&(L>0||A.z<=0)&&(A.t||this.tmpPoints.pop(),a=Math.min(w,a)),p.setz(L),this.tmpPoints.push(p);}if(a===1/0)return this.tmpPoints.length;var u=o;if(a===o){u=Math.max(u-1,0);var _d4=this.tmpPoints[u].t;_d4&&(i==null||i.add(_d4));}else{var _d5=o-1;for(u=a;_d5>=0;){var _v5=this.tmpPoints[_d5].t;if(_v5&&(i==null||i.add(_v5),_d5<=a)){u=_d5,_d5=-1;break;}_d5--;}}return this.tmpPoints[this.tmpPoints.length-1].setT(s),u;}},{key:"updateTempPoints",value:function updateTempPoints(e,n,i){var d;var s=Date.now(),o=this.tmpPoints.length;var a=o;for(var v=0;v<e.length;v+=2){var p=this.tmpPoints.length,w=new _t(e[v],e[v+1]);if(p===0){this.tmpPoints.push(w);continue;}var A=p-1,M=this.tmpPoints[A];if(w.x===M.x&&w.y===M.y)continue;var E=Ct.Sub(w,M).uni();if(w.isNear(M,n/2)){if(M.t){w.setz(M.z),w.setv(E),this.tmpPoints.push(w),a=Math.min(A,a);continue;}var L=this.tmpPoints[A-1],G=L?Ct.Sub(w,L).uni():M.v;M.set(w.x,w.y,M.z,G),a=Math.min(A,a);continue;}Ct.Equals(E,M.v,0.01)&&(M.t||this.tmpPoints.pop(),a=Math.min(A,a)),w.setv(E),this.tmpPoints.push(w);}var u=o;if(a===o){u=Math.max(u-1,0);var _v6=this.tmpPoints[u].t;_v6&&(i==null||i.add(_v6));}else{var _v7=Math.min(o-1,a);for(u=a;_v7>=0;){var _p2=(d=this.tmpPoints[_v7])==null?void 0:d.t;if(_p2&&(i==null||i.add(_p2),_v7<=a)){u=_v7,_v7=-1;break;}_v7--;}}return this.tmpPoints[this.tmpPoints.length-1].setT(s),u;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(e){var n=this.workOptions.thickness,i=e.length,s=this.getMinZ(n);for(var o=0;o<i;o+=2){var a=this.tmpPoints.length,u=new _t(e[o],e[o+1]);if(a===0){this.tmpPoints.push(u);continue;}var d=a-1,v=this.tmpPoints[d];if(u.x===v.x&&u.y===v.y){v.z<this.MAX_REPEAR&&v.setz(Math.min(v.z+1,this.MAX_REPEAR));continue;}var p=Ct.Sub(u,v).uni(),w=u.distance(v);if(a>1&&v.z===s)break;if(u.isNear(v,n/2)){var M=v.z;if(i<3&&v.z<this.MAX_REPEAR&&(M=Math.min(v.z+1,this.MAX_REPEAR),a>1)){var G=a-1;for(;G>0;){var z=this.tmpPoints[G].distance(this.tmpPoints[G-1]),et=Math.max(this.tmpPoints[G].z-this.uniThickness*z,-n/4);if(this.tmpPoints[G-1].z>=et)break;this.tmpPoints[G-1].setz(et),G--;}}if(v.t){u.setz(M),u.setv(p),this.tmpPoints.push(u);continue;}var E=this.tmpPoints[d-1],L=E?Ct.Sub(u,E).uni():v.v;v.set(u.x,u.y,M,L);continue;}u.setv(p);var A=Math.max(v.z-this.uniThickness*w,s);a>1&&Ct.Equals(p,v.v,0.01)&&v.z<=0&&(v.t||this.tmpPoints.pop()),u.setz(A),this.tmpPoints.push(u);}}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var p,w;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.strokeType,u=i.lineCap,d=i.lineDash,v=s.get(n.name);return o&&(n.tagName==="GROUP"?VPt(n)?n.setAttribute("bgcolor",o):n.children.forEach(function(A){A.setAttribute("strokeColor",o),A.getAttribute("fillColor")&&A.setAttribute("fillColor",o);}):(n.setAttribute("strokeColor",o),n.setAttribute("fillColor",o)),(p=v==null?void 0:v.opt)!=null&&p.strokeColor&&(v.opt.strokeColor=o)),a&&v!=null&&v.opt&&(w=v.opt)!=null&&w.strokeType&&(v.opt.strokeType=a),u&&v!=null&&v.opt&&(v.opt.lineCap=u),d&&v!=null&&v.opt&&(v.opt.lineDash=d),v&&s.setInfo(n.name,v),jt.updateNodeOpt(e);}}]);}(jt);var TS=/*#__PURE__*/function(_jt2){function TS(e){var _this44;_classCallCheck(this,TS);_this44=_callSuper(this,TS,[e]);wt(_this44,"toolsType",It.LaserPen);wt(_this44,"canRotate",!1);wt(_this44,"scaleType",be.none);wt(_this44,"syncTimestamp");wt(_this44,"syncIndex",0);wt(_this44,"tmpPoints",[]);wt(_this44,"workOptions");wt(_this44,"consumeIndex",0);_this44.workOptions=e.toolsOpt,_this44.syncTimestamp=0;return _this44;}_inherits(TS,_jt2);return _createClass(TS,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(e){_superPropGet(TS,"setWorkOptions",this,3)([e]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(e){var n=e.data,i=e.isSubWorker,s=n.workId,o=n.op,a=n.syncUnitTime;if((o==null?void 0:o.length)===0)return{type:xt.None};if(a&&(this.syncUnitTime=a),this.updateTempPoints(o||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:xt.None};var _this$workOptions3=this.workOptions,u=_this$workOptions3.strokeColor,d=_this$workOptions3.thickness,v=_this$workOptions3.strokeType,p=_this$workOptions3.lineDash,w=_this$workOptions3.lineCap,A=$e(this.tmpPoints,d);var M=!1;var E=this.syncIndex,L=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var G={name:s==null?void 0:s.toString(),opacity:1,lineDash:v===Re.Dotted?[p&&p[0]||1,(p&&p[1]||2)*d]:v===Re.LongDotted?[(p&&p[0]||1)*d,(p&&p[1]||2)*d]:void 0,strokeColor:u,lineCap:w,lineWidth:d,anchor:[0.5,0.5]},z=this.getTaskPoints(L);if(z.length){var x=Date.now();x-this.syncTimestamp>this.syncUnitTime&&(M=!0,this.syncTimestamp=x,this.syncIndex=this.tmpPoints.length),i&&this.draw({attrs:G,tasks:z,isDot:!1,layer:this.drawLayer||this.fullLayer});}var et=[];return this.tmpPoints.slice(E).forEach(function(x){et.push(x.x,x.y);}),_objectSpread({rect:{x:A.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:A.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:A.w*this.fullLayer.worldScaling[0],h:A.h*this.fullLayer.worldScaling[1]},type:xt.DrawWork,dataType:Kt.Local,op:M?et:void 0,index:M?E*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var e=(o=this.workId)==null?void 0:o.toString();var n;if(this.tmpPoints.length-1>this.consumeIndex){var a=this.tmpPoints.slice(this.consumeIndex);var u=a.length===1,_this$workOptions4=this.workOptions,d=_this$workOptions4.strokeColor,v=_this$workOptions4.thickness,p=_this$workOptions4.strokeType;if(u){var M=this.computDotStroke({point:a[0],radius:v/2});a=M.ps,n=M.rect;}else n=$e(this.tmpPoints,v);var w={name:e==null?void 0:e.toString(),fillColor:u?d:void 0,opacity:1,lineDash:p===Re.Dotted&&!u?[1,v*2]:p===Re.LongDotted&&!u?[v,v*2]:void 0,strokeColor:d,lineCap:u?void 0:"round",lineWidth:u?0:v,anchor:[0.5,0.5]},A=this.getTaskPoints(a);A.length&&this.draw({attrs:w,tasks:A,isDot:u,layer:this.drawLayer||this.fullLayer});}var i=[];this.tmpPoints.forEach(function(a){i.push(a.x,a.y);});var s=Br(i);return _objectSpread({rect:n&&{x:n.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:n.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:n.w*this.fullLayer.worldScaling[0],h:n.h*this.fullLayer.worldScaling[1]},type:xt.FullWork,dataType:Kt.Local,ops:s,index:this.syncIndex*2},this.baseConsumeResult);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(e){var E;var n=e.op,i=e.replaceId,s=e.isFullWork,_this$workOptions5=this.workOptions,o=_this$workOptions5.strokeColor,a=_this$workOptions5.thickness,u=_this$workOptions5.strokeType;if(!n.length){var L=$e(this.tmpPoints,a);return{x:L.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:L.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:L.w*this.fullLayer.worldScaling[0],h:L.h*this.fullLayer.worldScaling[1]};}var d=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(n||[]);var v,p=this.tmpPoints.slice(d);var w=p.length===1;if(w){var _L3=this.computDotStroke({point:p[0],radius:a/2});p=_L3.ps,v=_L3.rect;}else v=$e(this.tmpPoints,a);var A={name:(E=this.workId)==null?void 0:E.toString(),fillColor:w?o:void 0,opacity:1,lineDash:u===Re.Dotted&&!w?[1,a*2]:u===Re.LongDotted&&!w?[a,a*2]:void 0,strokeColor:o,lineCap:w?void 0:"round",lineWidth:w?0:a,anchor:[0.5,0.5]},M=this.getTaskPoints(p);if(M.length){var _L4=s?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:A,tasks:M,isDot:w,replaceId:i,layer:_L4});}return{x:v.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:v.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:v.w*this.fullLayer.worldScaling[0],h:v.h*this.fullLayer.worldScaling[1]};}},{key:"computDotStroke",value:function computDotStroke(e){var n=e.point,i=e.radius,s={x:n.x-i,y:n.y-i,w:i*2,h:i*2};return{ps:_t.GetDotStroke(n,i,8),rect:s};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=this.tmpPoints.length;for(var i=0;i<e.length;i+=2){if(n){var s=this.tmpPoints.slice(-1)[0];s&&s.x===e[i]&&s.y===e[i+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new _t(e[i],e[i+1]));}}},{key:"draw",value:function(){var _draw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(e){var n,i,s,o,a,_iterator33,_step33,_loop5,_t12;return _regenerator().w(function(_context12){while(1)switch(_context12.p=_context12.n){case 0:n=e.attrs,i=e.tasks,s=e.isDot,o=e.layer,a=this.workOptions.duration;_iterator33=_createForOfIteratorHelper(i);_context12.p=1;_loop5=/*#__PURE__*/_regenerator().m(function _loop5(){var u,d,v,p,w;return _regenerator().w(function(_context11){while(1)switch(_context11.n){case 0:u=_step33.value;d=new Qr(),v=u.pos,p=u.points;s?w=Ii(p,!0):w=Ii(p,!1),d.attr(_objectSpread(_objectSpread({},n),{},{pos:v,d:w})),o.appendChild(d),d.transition(a).attr({scale:s?[0.1,0.1]:[1,1],lineWidth:s?0:1}).then(function(){d.remove();});case 1:return _context11.a(2);}},_loop5);});_iterator33.s();case 2:if((_step33=_iterator33.n()).done){_context12.n=4;break;}return _context12.d(_regeneratorValues(_loop5()),3);case 3:_context12.n=2;break;case 4:_context12.n=6;break;case 5:_context12.p=5;_t12=_context12.v;_iterator33.e(_t12);case 6:_context12.p=6;_iterator33.f();return _context12.f(6);case 7:return _context12.a(2);}},_callee11,this,[[1,5,6,7]]);}));function draw(_x17){return _draw.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(e){var d;var n=[];if(e.length===0)return[];var i=0,s=e[0].x,o=e[0].y,a=[s,o],u=[];for(;i<e.length;){var v=e[i],p=v.x-s,w=v.y-o;if(u.push(new _t(p,w)),i>0&&i<e.length-1){var A=e[i].getAngleByPoints(e[i-1],e[i+1]);if(A<60||A>300){var M=(d=u.pop())==null?void 0:d.clone();M&&n.push({pos:a,points:[].concat(_toConsumableArray(u),[M])}),s=e[i].x,o=e[i].y,a=[s,o];var E=v.x-s,L=v.y-o;u=[new _t(E,L)];}}i++;}return n.push({pos:a,points:u}),n;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(e){var n;var i=[];return this.fullLayer.getElementsByName(e).forEach(function(s){if(s.name===e){var o=s.getBoundingClientRect();n=Jt(n,{x:o.x,y:o.y,w:o.width,h:o.height}),i.push(s);}}),i.length&&i.forEach(function(s){return s.remove();}),n;}}]);}(jt);var Rxt=du;du.polyline=du;du.polygon=Nxt;function du(r,t,e){var n=r.length,i=Co(r[0],t),s=[],o,a,u,d,v;for(e||(e=[]),o=1;o<n;o++){for(a=r[o-1],u=r[o],d=v=Co(u,t);;)if(i|d){if(i&d)break;i?(a=lp(a,u,i,t),i=Co(a,t)):(u=lp(a,u,d,t),d=Co(u,t));}else{s.push(a),d!==v?(s.push(u),o<n-1&&(e.push(s),s=[])):o===n-1&&s.push(u);break;}i=v;}return s.length&&e.push(s),e;}function Nxt(r,t){var e,n,i,s,o,a,u;for(n=1;n<=8;n*=2){for(e=[],i=r[r.length-1],s=!(Co(i,t)&n),o=0;o<r.length;o++)a=r[o],u=!(Co(a,t)&n),u!==s&&e.push(lp(i,a,n,t)),u&&e.push(a),i=a,s=u;if(r=e,!r.length)break;}return e;}function lp(r,t,e,n){return e&8?[r[0]+(t[0]-r[0])*(n[3]-r[1])/(t[1]-r[1]),n[3]]:// top
|
|
405
405
|
e&4?[r[0]+(t[0]-r[0])*(n[1]-r[1])/(t[1]-r[1]),n[1]]:// bottom
|
|
406
406
|
e&2?[n[2],r[1]+(t[1]-r[1])*(n[2]-r[0])/(t[0]-r[0])]:// right
|
|
407
407
|
e&1?[n[0],r[1]+(t[1]-r[1])*(n[0]-r[0])/(t[0]-r[0])]:// left
|
|
408
|
-
null;}function Co(r,t){var e=0;return r[0]<t[0]?e|=1:r[0]>t[2]&&(e|=2),r[1]<t[1]?e|=4:r[1]>t[3]&&(e|=8),e;}var g0=/* @__PURE__ */zn(
|
|
409
|
-
wt(Ao,"eraserSizes",v0);var pu=Ao;var Rxt="__lodash_hash_undefined__";function Nxt(r){return this.__data__.set(r,Rxt),this;}var Bxt=Nxt;function kxt(r){return this.__data__.has(r);}var Fxt=kxt,Wxt=V2,Uxt=Bxt,zxt=Fxt;function vu(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new Wxt();++t<e;)this.add(r[t]);}vu.prototype.add=vu.prototype.push=Uxt;vu.prototype.has=zxt;var m0=vu;function $xt(r,t){for(var e=-1,n=r==null?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1;}var Yxt=$xt;function jxt(r,t){return r.has(t);}var y0=jxt,Xxt=m0,Gxt=Yxt,Hxt=y0,Vxt=1,Zxt=2;function qxt(r,t,e,n,i,s){var o=e&Vxt,a=r.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var d=s.get(r),v=s.get(t);if(d&&v)return d==t&&v==r;var p=-1,w=!0,A=e&Zxt?new Xxt():void 0;for(s.set(r,t),s.set(t,r);++p<a;){var M=r[p],E=t[p];if(n)var L=o?n(E,M,p,t,r,s):n(M,E,p,r,t,s);if(L!==void 0){if(L)continue;w=!1;break;}if(A){if(!Gxt(t,function(G,z){if(!Hxt(A,z)&&(M===G||i(M,G,e,n,s)))return A.push(z);})){w=!1;break;}}else if(!(M===E||i(M,E,e,n,s))){w=!1;break;}}return s.delete(r),s.delete(t),w;}var xS=qxt;function Kxt(r){var t=-1,e=Array(r.size);return r.forEach(function(n,i){e[++t]=[i,n];}),e;}var Qxt=Kxt;function Jxt(r){var t=-1,e=Array(r.size);return r.forEach(function(n){e[++t]=n;}),e;}var w0=Jxt,t1=cl,e1=hS,_xt=n0,tCt=xS,eCt=Qxt,rCt=w0,nCt=1,iCt=2,sCt="[object Boolean]",oCt="[object Date]",aCt="[object Error]",lCt="[object Map]",cCt="[object Number]",uCt="[object RegExp]",fCt="[object Set]",hCt="[object String]",dCt="[object Symbol]",pCt="[object ArrayBuffer]",vCt="[object DataView]",r1=t1?t1.prototype:void 0,xd=r1?r1.valueOf:void 0;function gCt(r,t,e,n,i,s,o){switch(e){case vCt:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case pCt:return!(r.byteLength!=t.byteLength||!s(new e1(r),new e1(t)));case sCt:case oCt:case cCt:return _xt(+r,+t);case aCt:return r.name==t.name&&r.message==t.message;case uCt:case hCt:return r==t+"";case lCt:var a=eCt;case fCt:var u=n&nCt;if(a||(a=rCt),r.size!=t.size&&!u)return!1;var d=o.get(r);if(d)return d==t;n|=iCt,o.set(r,t);var v=tCt(a(r),a(t),n,i,s,o);return o.delete(r),v;case dCt:if(xd)return xd.call(r)==xd.call(t);}return!1;}var mCt=gCt,n1=cS,yCt=1,wCt=Object.prototype,SCt=wCt.hasOwnProperty;function ICt(r,t,e,n,i,s){var o=e&yCt,a=n1(r),u=a.length,d=n1(t),v=d.length;if(u!=v&&!o)return!1;for(var p=u;p--;){var w=a[p];if(!(o?w in t:SCt.call(t,w)))return!1;}var A=s.get(r),M=s.get(t);if(A&&M)return A==t&&M==r;var E=!0;s.set(r,t),s.set(t,r);for(var L=o;++p<u;){w=a[p];var G=r[w],z=t[w];if(n)var et=o?n(z,G,w,t,r,s):n(G,z,w,r,t,s);if(!(et===void 0?G===z||i(G,z,e,n,s):et)){E=!1;break;}L||(L=w=="constructor");}if(E&&!L){var x=r.constructor,y=t.constructor;x!=y&&"constructor"in r&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof y=="function"&&y instanceof y)&&(E=!1);}return s.delete(r),s.delete(t),E;}var TCt=ICt,Cd=Z2,xCt=xS,CCt=mCt,PCt=TCt,i1=af,s1=fl,o1=s0,ACt=eS,bCt=1,a1="[object Arguments]",l1="[object Array]",Fc="[object Object]",MCt=Object.prototype,c1=MCt.hasOwnProperty;function ECt(r,t,e,n,i,s){var o=s1(r),a=s1(t),u=o?l1:i1(r),d=a?l1:i1(t);u=u==a1?Fc:u,d=d==a1?Fc:d;var v=u==Fc,p=d==Fc,w=u==d;if(w&&o1(r)){if(!o1(t))return!1;o=!0,v=!1;}if(w&&!v)return s||(s=new Cd()),o||ACt(r)?xCt(r,t,e,n,i,s):CCt(r,t,u,e,n,i,s);if(!(e&bCt)){var A=v&&c1.call(r,"__wrapped__"),M=p&&c1.call(t,"__wrapped__");if(A||M){var E=A?r.value():r,L=M?t.value():t;return s||(s=new Cd()),i(E,L,e,n,s);}}return w?(s||(s=new Cd()),PCt(r,t,e,n,i,s)):!1;}var LCt=ECt,OCt=LCt,u1=Pi;function CS(r,t,e,n,i){return r===t?!0:r==null||t==null||!u1(r)&&!u1(t)?r!==r&&t!==t:OCt(r,t,e,n,CS,i);}var DCt=CS,RCt=DCt;function NCt(r,t){return RCt(r,t);}var BCt=NCt;var qn=/* @__PURE__ */zn(BCt);function f1(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;return"rgba(".concat(r,",").concat(t,",").concat(e,",").concat(n,")");}function kCt(r){var t=r.split(","),e=parseInt(t[0].split("(")[1]),n=parseInt(t[1]),i=parseInt(t[2]),s=Number(t[3].split(")")[0]);return[e,n,i,s];}var Cu=/*#__PURE__*/function(_jt4){function Cu(e){var _this47;_classCallCheck(this,Cu);_this47=_callSuper(this,Cu,[e]);wt(_this47,"toolsType",It.Selector);wt(_this47,"tmpPoints",[]);wt(_this47,"subTmpPoints",[]);wt(_this47,"workOptions");wt(_this47,"vNodes");wt(_this47,"selectIds");wt(_this47,"selectorColor");wt(_this47,"strokeColor");wt(_this47,"fillColor");wt(_this47,"oldSelectRect");wt(_this47,"oldSubSelectRect");wt(_this47,"canRotate",!1);wt(_this47,"canTextEdit",!1);wt(_this47,"canLock",!1);wt(_this47,"scaleType",be.all);wt(_this47,"toolsTypes");wt(_this47,"shapeOpt");wt(_this47,"textOpt");wt(_this47,"isLocked");wt(_this47,"thickness");wt(_this47,"strokeType");wt(_this47,"useStroke");_this47.workOptions=e.toolsOpt,_this47.vNodes=e.vNodes;return _this47;}_inherits(Cu,_jt4);return _createClass(Cu,[{key:"computSelector",value:function computSelector(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var n=$e(this.tmpPoints);if(n.w===0||n.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(n,e),i=_this$vNodes$getRectI.rectRange,s=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(s.keys()),intersectRect:i,subNodeMap:s};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=this.tmpPoints.length,i=e.length;if(i>1){var s=new _t(e[i-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[i-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);n===2?this.tmpPoints.splice(1,1,s):this.tmpPoints.push(s);}}},{key:"drawSelector",value:function drawSelector(e){var _this48=this;var n=e.drawRect,i=e.subNodeMap,s=e.selectorId,o=e.layer,a=e.isService,u=new ar({pos:[n.x,n.y],anchor:[0,0],size:[n.w,n.h],id:s,name:s,zIndex:9999}),d=[];if(a){var v=new ja({normalize:!0,pos:[n.w/2,n.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:n.w,height:n.h,name:Cu.selectorBorderId});d.push(v);}i.forEach(function(v,p){var w=[v.rect.x+v.rect.w/2-n.x,v.rect.y+v.rect.h/2-n.y],A=new ja({normalize:!0,pos:w,lineWidth:1,strokeColor:i.size>1?_this48.selectorColor||_this48.workOptions.strokeColor:void 0,width:v.rect.w,height:v.rect.h,id:"selector-".concat(p),name:"selector-".concat(p)});d.push(A);}),d&&u.append.apply(u,d),(o==null?void 0:o.parent).appendChild(u);}},{key:"draw",value:function draw(e,n,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var u,d;var o=i.intersectRect,a=i.subNodeMap;(d=(u=n.parent)==null?void 0:u.getElementById(e))==null||d.remove(),o&&this.drawSelector({drawRect:o,subNodeMap:a,selectorId:e,layer:n,isService:s});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(e){this.scaleType=be.all,this.canRotate=!1,this.textOpt=void 0,this.strokeColor=void 0,this.fillColor=void 0,this.canTextEdit=!1,this.canLock=!1,this.isLocked=!1,this.toolsTypes=void 0,this.shapeOpt=void 0,this.thickness=void 0,this.strokeType=void 0,this.useStroke=!1;var n=/* @__PURE__ */new Set();var i,s=!0;var _iterator38=_createForOfIteratorHelper(e.values()),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var o=_step38.value;var a=o.opt,u=o.canRotate,d=o.scaleType,v=o.toolsType;this.selectorColor=this.workOptions.strokeColor,a.strokeColor&&(this.strokeColor=a.strokeColor),a.fillColor&&(this.fillColor=a.fillColor),a.textOpt&&(this.textOpt=a.textOpt),a.thickness&&(this.thickness=a.thickness),v!==It.Pencil&&(s=!1),a.strokeType&&(this.strokeType=a.strokeType),v===It.SpeechBalloon&&(n.add(v),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=a.placement),v===It.Polygon&&(n.add(v),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=a.vertices),v===It.Star&&(n.add(v),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=a.vertices,this.shapeOpt.innerRatio=a.innerRatio,this.shapeOpt.innerVerticeStep=a.innerVerticeStep),v===It.Text&&(this.textOpt=a),e.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=u,this.scaleType=d),(v===It.Image||v===It.BackgroundSVG)&&(i=o),(d===be.proportional&&this.scaleType!==be.none||d===be.none)&&(this.scaleType=d);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}s&&(this.useStroke=!0),n.size&&(this.toolsTypes=_toConsumableArray(n)),i&&(e.size===1?(this.canLock=!0,i.opt.locked&&(this.isLocked=!0,this.scaleType=be.none,this.canRotate=!1,this.textOpt=void 0,this.fillColor=void 0,this.selectorColor="rgb(177,177,177)",this.strokeColor=void 0,this.canTextEdit=!1,this.thickness=void 0,this.strokeType=void 0,this.useStroke=void 0)):e.size>1&&!i.opt.locked&&(this.canLock=!1,this.canRotate=!1));}},{key:"getChildrenPoints",value:function getChildrenPoints(){var e,n;if(this.scaleType===be.both&&((e=this.selectIds)==null?void 0:e.length)===1){var i=this.selectIds[0],s=(n=this.vNodes.get(i))==null?void 0:n.op;if(s){var o=[];for(var a=0;a<s.length;a+=3)o.push([s[a],s[a+1]]);return o;}}}},{key:"consume",value:function consume(e){if(e.isSubWorker)return this.subWorkerConsume(e);var n=_objectSpread({type:xt.Select,dataType:Kt.Local},this.baseConsumeResult);if(e.isSimpleWorker){var v=this.subWorkerConsume(e);n.subRect=v.rect;}var _e$data3=e.data,i=_e$data3.op,s=_e$data3.workState;var o=this.oldSelectRect;if(s===te.Start&&(o=this.unSelectedAllIds()),!(i!=null&&i.length)||!this.vNodes.curNodeMap.size)return e.isSimpleWorker?n:{type:xt.None};this.updateTempPoints(i);var a=this.computSelector();if(this.selectIds&&qn(this.selectIds,a.selectIds))return e.isSimpleWorker?n:{type:xt.None};this.selectIds=a.selectIds;var u=a.intersectRect;this.getSelecteorInfo(a.subNodeMap),this.draw(Fe,this.fullLayer,a),this.oldSelectRect=u;var d=this.getChildrenPoints();return n=_objectSpread(_objectSpread({},n),{},{rect:Jt(u,o),selectIds:a.selectIds,selectRect:u,selectorColor:this.selectorColor,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:d,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType}),n;}},{key:"consumeAll",value:function consumeAll(){var n,i;var e=this.oldSelectRect;if(!((n=this.selectIds)!=null&&n.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,Fe,!1),(i=this.selectIds)!=null&&i.length&&(e=this.selectedByIds(this.selectIds)),e){var s=this.getChildrenPoints();return _objectSpread({type:xt.Select,dataType:Kt.Local,rect:this.oldSelectRect,selectIds:this.selectIds,selectorColor:this.selectorColor,selectRect:this.oldSelectRect,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:s,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}return _objectSpread({type:xt.Select,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPointsForSubWorker",value:function updateTempPointsForSubWorker(e){var n=e.slice(-2),i=new _t(n[0],n[1]);if(this.subTmpPoints[0].isNear(i,1))return!1;if(this.subTmpPoints.length===2){if(i.isNear(this.subTmpPoints[1],1))return!1;this.subTmpPoints[1]=i;}else this.subTmpPoints.push(i);return!0;}},{key:"computDrawPoints",value:function computDrawPoints(e){var n=this.workOptions.thickness,i=[];var _iterator39=_createForOfIteratorHelper(e),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var a=_step39.value;i.push(_construct(Ct,_toConsumableArray(a)));}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}var s=$e(i,n),o=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:o,points:i.map(function(a){return a.XY;}).flat(1)};}},{key:"drawForSubWorker",value:function drawForSubWorker(e){var n=e.workId,i=e.layer,s=e.ps,_this$workOptions6=this.workOptions,o=_this$workOptions6.strokeColor,a=_this$workOptions6.scale,u=_this$workOptions6.rotate,d=_this$workOptions6.translate,v=i.worldPosition,p=i.worldScaling,_this$computDrawPoint2=this.computDrawPoints(s),w=_this$computDrawPoint2.points,A=_this$computDrawPoint2.rect,M=_this$computDrawPoint2.pos,E=1/i.worldScaling[0],L=o&&kCt(o)||[0,0,0,0],G={close:!0,normalize:!0,points:w,lineWidth:E,fillColor:f1(L[0],L[1],L[2],0.1),strokeColor:f1(L[0],L[1],L[2],1),lineJoin:"round",lineCap:"round"};var z={x:Math.floor(A.x*p[0]+v[0]-jt.SafeBorderPadding),y:Math.floor(A.y*p[1]+v[1]-jt.SafeBorderPadding),w:Math.floor(A.w*p[0]+2*jt.SafeBorderPadding),h:Math.floor(A.h*p[0]+2*jt.SafeBorderPadding)};var et=new ar({name:n,id:n,pos:M,anchor:[0.5,0.5],size:[A.w,A.h],scale:a,rotate:u,translate:d}),x=new Un(_objectSpread(_objectSpread({},G),{},{pos:[0,0]}));if(et.appendChild(x),this.replace(i,n,et),a||u||d){var y=et.getBoundingClientRect();z={x:Math.floor(y.x-jt.SafeBorderPadding),y:Math.floor(y.y-jt.SafeBorderPadding),w:Math.floor(y.width+2*jt.SafeBorderPadding),h:Math.floor(y.height+2*jt.SafeBorderPadding)};}return z;}},{key:"transformData",value:function transformData(e){var n=$e(e);return[[n.x,n.y,0],[n.x+n.w,n.y,0],[n.x+n.w,n.y+n.h,0],[n.x,n.y+n.h,0]];}},{key:"subWorkerConsume",value:function subWorkerConsume(e){var n=e.data,i=e.isFullWork,s=n.op,o=n.syncUnitTime;o&&(this.syncUnitTime=o);var a=s==null?void 0:s.length;if(!a||a<2)return{type:xt.None,rect:void 0};var u;if(this.subTmpPoints.length===0?(this.subTmpPoints=[new _t(s[0],s[1])],u=!1):u=this.updateTempPointsForSubWorker(s),!u)return{type:xt.None,rect:void 0};var d=this.transformData(this.subTmpPoints),v=i?this.fullLayer:this.drawLayer||this.fullLayer,p=this.drawForSubWorker({ps:d,workId:this.workId,layer:v}),w=Jt(p,this.oldSubSelectRect);return this.oldSubSelectRect=p,_objectSpread({rect:w,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"subWorkerConsumeAll",value:function subWorkerConsumeAll(e){var n=e.isFullWork,i=n?this.fullLayer:this.drawLayer||this.fullLayer;return this.replace(i,this.workId),_objectSpread({rect:this.oldSelectRect,type:xt.FullWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"clearSubTmpPoints",value:function clearSubTmpPoints(){this.subTmpPoints.length=0;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.clearSubTmpPoints();}},{key:"clearSubSelectData",value:function clearSubSelectData(){this.oldSubSelectRect=void 0;}},{key:"clearSelectData",value:function clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0,this.clearSubSelectData();}},{key:"selectSingleTool",value:function selectSingleTool(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Fe;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(e.length===2){var s=e[0],o=e[1];var a;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:s,y:o,w:0,h:0},!1),u=_this$vNodes$getRectI2.nodeRange,d=_toConsumableArray(u.values()).sort(function(v,p){return(p.opt.zIndex||0)-(v.opt.zIndex||0);});var _iterator40=_createForOfIteratorHelper(d),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var _v8=_step40.value;var _p3=this.fullLayer.getElementsByName(_v8.name);if(ZS(_p3).find(function(A){return A.isPointCollision(s,o);})){a=_v8;break;}}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}if(a){var v=a.name;if(!qn(this.oldSelectRect,a.rect)){var p=/* @__PURE__ */new Map([[v,a]]);this.getSelecteorInfo(p),this.draw(n,this.fullLayer,{intersectRect:a.rect,subNodeMap:p,selectIds:this.selectIds||[]},i);}this.selectIds=[v],this.oldSelectRect=a.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var e;var _iterator41=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var _step41$value=_slicedToArray(_step41.value,2),n=_step41$value[0],i=_step41$value[1];i.isSelected&&(e=Jt(e,i.rect),this.vNodes.unSelected(n));}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}return e;}},{key:"unSelectedByIds",value:function unSelectedByIds(e){var n;var _iterator42=_createForOfIteratorHelper(e),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var i=_step42.value;var s=this.vNodes.get(i);s&&s.isSelected&&(n=Jt(n,s.rect),this.vNodes.unSelected(i));}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}return n;}},{key:"selectedByIds",value:function selectedByIds(e){var n;var _iterator43=_createForOfIteratorHelper(e),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var i=_step43.value;var s=this.vNodes.get(i);s&&(n=Jt(n,s.rect),this.vNodes.selected(i));}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}return n;}},{key:"getSelectorRect",value:function getSelectorRect(e,n){var a;var i;var s=(a=e.parent)==null?void 0:a.getElementById(n),o=s==null?void 0:s.getBoundingClientRect();return o&&(i=Jt(i,{x:Math.floor(o.x),y:Math.floor(o.y),w:Math.floor(o.width+1),h:Math.floor(o.height+1)})),i;}},{key:"isCanFillColor",value:function isCanFillColor(e){return e===It.Ellipse||e===It.Triangle||e===It.Rectangle||e===It.Polygon||e===It.Star||e===It.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12(e){var n,i,s,o,a,u,d,v,p,w,A,M,E,L,G,z,_iterator44,_step44,y,S,C,P,X,$,K,j,nt,ct,F,R,et,_y4,_S0,_C6,x,_t13,_t14,_t15;return _regenerator().w(function(_context13){while(1)switch(_context13.p=_context13.n){case 0:n=e.updateSelectorOpt,i=e.selectIds,s=e.vNodes,o=e.willSerializeData,a=e.worker,u=e.offset,d=this.fullLayer;if(d){_context13.n=1;break;}return _context13.a(2);case 1:p=/* @__PURE__ */new Map(),w=n.originPoint,A=n.workState,M=n.angle,E=n.translate,L=n.dir,G=n.scale;u&&(E?n.translate=[E[0]+u[0],E[1]+u[1]]:n.translate=u);if(!(w||E||Ze(M))){_context13.n=3;break;}if(!(A===te.Start&&i)){_context13.n=2;break;}return _context13.a(2,(s.setTargetAssignKeys(i),{type:xt.Select,dataType:Kt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 2:if(!(z=s.getLastTarget(),!z)){_context13.n=3;break;}return _context13.a(2);case 3:if(!i){_context13.n=18;break;}_iterator44=_createForOfIteratorHelper(i);_context13.p=4;_iterator44.s();case 5:if((_step44=_iterator44.n()).done){_context13.n=15;break;}y=_step44.value;S=s.get(y);if(!S){_context13.n=14;break;}C=S.toolsType,P=S.opt,X=(d==null?void 0:d.getElementsByName(y))[0];if(!X){_context13.n=14;break;}$=_objectSpread({},n);K=void 0;j=jt.isWillRefresh({toolsType:C,opt:P,updateOpt:$,vNodes:s,node:X,willSerializeData:o});if(!C){_context13.n=14;break;}K=z==null?void 0:z.get(y);nt=VS(C);nt==null||nt.updateNodeOpt({node:X,opt:$,vNodes:s,willSerializeData:o,targetNode:K});ct=s.get(y)||S;if(!(ct&&a&&j)){_context13.n=13;break;}F=a.createWorkShapeNode({workId:y,toolsType:C,toolsOpt:ct.opt});F==null||F.setWorkId(y);R=void 0;if(!(C===It.BackgroundSVG)){_context13.n=6;break;}R=F.consumeService({isFullWork:!0,replaceId:y});_context13.n=12;break;case 6:if(!(C===It.Image)){_context13.n=8;break;}_context13.n=7;return F.consumeServiceAsync({isFullWork:!0,replaceId:y,worker:a});case 7:R=_context13.v;_context13.n=12;break;case 8:if(!(C===It.Text)){_context13.n=10;break;}_context13.n=9;return F.consumeServiceAsync({isFullWork:!0,replaceId:y,isDrawLabel:!0});case 9:R=_context13.v;_context13.n=12;break;case 10:_context13.p=10;R=F==null?void 0:F.consumeService({op:ct.op,isFullWork:!0,replaceId:y,workState:A});_context13.n=12;break;case 11:_context13.p=11;_t13=_context13.v;console.error("consumeService error",_t13);return _context13.a(3,14);case 12:R&&(ct.rect=R);case 13:ct&&(p.set(y,ct),v=Jt(v,ct.rect));case 14:_context13.n=5;break;case 15:_context13.n=17;break;case 16:_context13.p=16;_t14=_context13.v;_iterator44.e(_t14);case 17:_context13.p=17;_iterator44.f();return _context13.f(17);case 18:z&&A===te.Done&&(s.deleteLastTarget(),z=void 0);et=v;if(!(w&&E&&G&&L&&et&&!u)){_context13.n=25;break;}_y4=[[et.x,et.y],[et.x+et.w,et.y],[et.x+et.w,et.y+et.h],[et.x,et.y+et.h]];_t15=L;_context13.n=_t15==="top"?19:_t15==="topLeft"?19:_t15==="left"?19:_t15==="topRight"?20:_t15==="right"?21:_t15==="bottomRight"?21:_t15==="bottom"?21:_t15==="bottomLeft"?22:23;break;case 19:E[0]>0&&E[1]>0?_S0=_y4[0]:E[0]>0?_S0=_y4[3]:E[1]>0?_S0=_y4[1]:_S0=_y4[2];return _context13.a(3,23);case 20:E[0]<0&&E[1]>0?_S0=_y4[1]:E[0]<0?_S0=_y4[2]:E[1]>0?_S0=_y4[0]:_S0=_y4[3];return _context13.a(3,23);case 21:E[0]<0&&E[1]<0?_S0=_y4[2]:E[0]<0?_S0=_y4[1]:E[1]<0?_S0=_y4[3]:_S0=_y4[0];return _context13.a(3,23);case 22:E[0]>0&&E[1]<0?_S0=_y4[3]:E[0]>0?_S0=_y4[0]:E[1]<0?_S0=_y4[2]:_S0=_y4[1];return _context13.a(3,23);case 23:_C6=_S0&&[w[0]-_S0[0],w[1]-_S0[1]]||[0,0];if(qn(_C6,[0,0])){_context13.n=25;break;}_context13.n=24;return this.updateSelector(_objectSpread(_objectSpread({},e),{},{updateSelectorOpt:{workState:A},offset:_C6}));case 24:return _context13.a(2,_context13.v);case 25:this.getSelecteorInfo(p),this.draw(Fe,d,{selectIds:i||[],subNodeMap:p,intersectRect:et});x=Jt(this.oldSelectRect,et);return _context13.a(2,(this.oldSelectRect=et,{type:xt.Select,dataType:Kt.Local,selectRect:et,renderRect:v,rect:Jt(x,et),selectIds:i}));}},_callee12,this,[[10,11],[4,16,17,18]]);}));function updateSelector(_x18){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var e=this.unSelectedAllIds();return{type:xt.Select,dataType:Kt.Local,rect:e,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(e){return e.replace(Oo,"-");}},{key:"selectServiceNode",value:function selectServiceNode(e,n,i){var _this49=this;var s=n.selectIds,o=this.getRightServiceId(e),a=this.getSelectorRect(this.fullLayer,o);var u;var d=/* @__PURE__ */new Map();return s==null||s.forEach(function(v){var p=_this49.vNodes.get(v);p&&(u=Jt(u,p.rect),d.set(v,p));}),this.getSelecteorInfo(d),this.draw(o,this.fullLayer,{intersectRect:u,selectIds:s||[],subNodeMap:d},i),Jt(u,a);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this50=this;var i;var e;var n=/* @__PURE__ */new Map();return(i=this.selectIds)==null||i.forEach(function(s){var o=_this50.vNodes.get(s);o&&(e=Jt(e,o.rect),n.set(s,o));},this),this.getSelecteorInfo(n),this.draw(Fe,this.fullLayer,{intersectRect:e,subNodeMap:n,selectIds:this.selectIds||[]}),this.oldSelectRect=e,e;}},{key:"updateSelectIds",value:function updateSelectIds(e){var o;var n;var i=(o=this.selectIds)==null?void 0:o.filter(function(a){return!e.includes(a);});if(i!=null&&i.length&&(n=this.unSelectedByIds(i)),e.length){var a=this.selectedByIds(e);n=Jt(n,a);}this.selectIds=e;var s=this.reRenderSelector();return{bgRect:n,selectRect:s};}},{key:"cursorHover",value:function cursorHover(e){var o,a;var n=this.oldSelectRect;this.selectIds=[];var i=(o=this.workId)==null?void 0:o.toString(),s=[e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(s,i,!0),this.oldSelectRect&&!qn(n,this.oldSelectRect))return{type:xt.CursorHover,dataType:Kt.Local,rect:Jt(n,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((a=this.selectIds)!=null&&a.length||(this.oldSelectRect=void 0),n&&!this.oldSelectRect)return this.cursorBlur(),{type:xt.CursorHover,dataType:Kt.Local,rect:n,selectorColor:this.selectorColor,willSyncService:!1};}},{key:"cursorBlur",value:function cursorBlur(){var n,i;this.selectIds=[];var e=(n=this.workId)==null?void 0:n.toString();((i=this.fullLayer)==null?void 0:i.parent).children.forEach(function(s){s.name===e&&s.remove();});}}]);}(jt);wt(Cu,"selectorBorderId","selector-border");var Xa=Cu;var PS=/*#__PURE__*/function(_jt5){function PS(e){var _this51;_classCallCheck(this,PS);_this51=_callSuper(this,PS,[e]);wt(_this51,"canRotate",!1);wt(_this51,"scaleType",be.both);wt(_this51,"toolsType",It.Arrow);wt(_this51,"tmpPoints",[]);wt(_this51,"workOptions");wt(_this51,"oldRect");wt(_this51,"arrowTipWidth");wt(_this51,"syncTimestamp");_this51.workOptions=e.toolsOpt,_this51.arrowTipWidth=_this51.workOptions.thickness*4,_this51.syncTimestamp=0,_this51.syncUnitTime=50;return _this51;}_inherits(PS,_jt5);return _createClass(PS,[{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=this.workId,v=n.op,p=n.syncUnitTime;p&&(this.syncUnitTime=p);var w=v==null?void 0:v.length;if(!w||w<2)return{type:xt.None};var A;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],A=!1):A=this.updateTempPoints(v),!A)return{type:xt.None};var M;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({workId:d,layer:L});}if(u){var _L5=Jt(M,this.oldRect);this.oldRect=M;var G=_objectSpread({rect:_L5,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=this.tmpPoints.map(function(et){return[].concat(_toConsumableArray(et.XY),[0]);}).flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L6=Date.now();return _L6-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L6,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(G){return[].concat(_toConsumableArray(G.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:xt.None};}var E=Jt(M,this.oldRect);return this.oldRect=M,_objectSpread(_objectSpread({rect:E},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Kt.Local});}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i},this.baseConsumeResult),{},{type:xt.FullWork,dataType:Kt.Local,ops:o,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,s=e.isDrawEraserlines,_this$workOptions7=this.workOptions,o=_this$workOptions7.strokeColor,a=_this$workOptions7.thickness,u=_this$workOptions7.zIndex,d=_this$workOptions7.scale,v=_this$workOptions7.rotate,p=_this$workOptions7.translate,w=_this$workOptions7.strokeType,A=_this$workOptions7.eraserlines,M=_this$workOptions7.eraserFaces,E=_this$workOptions7.doingLines,L=_this$workOptions7.lineDash,G=_this$workOptions7.lineCap,z=i.worldPosition,et=i.worldScaling,_this$computDrawPoint3=this.computDrawPoints(a),x=_this$computDrawPoint3.points,y=_this$computDrawPoint3.pos,S=_this$computDrawPoint3.rect,C=_this$computDrawPoint3.isTriangle,P=_this$computDrawPoint3.trianglePoints,X=_this$computDrawPoint3.trianglePos,$=[S.x+S.w/2,S.y+S.h/2],K={pos:$,name:n,id:n,zIndex:u,anchor:[0.5,0.5],size:[S.w,S.h]};d&&(K.scale=d),v&&(K.rotate=v),p&&(K.translate=p);var j=new ar(K),nt={points:P,pos:[X[0]-$[0],X[1]-$[1]],fillColor:o,strokeColor:o,lineWidth:0,normalize:!1},ct=new Un(nt);if(j.append(ct),!C&&x&&y){var R={points:x,pos:[y[0]-$[0],y[1]-$[1]],fillColor:o,strokeColor:o,lineDash:w===Re.Dotted?[L&&L[0]||1,(L&&L[1]||2)*a]:w===Re.LongDotted?[(L&&L[0]||1)*a,(L&&L[1]||2)*a]:void 0,lineCap:w===Re.Normal?void 0:G,lineWidth:a,normalize:!1},Y=new Un(R);j.append(Y);}(A||M||E)&&(this.scaleType=be.proportional,this.drawEraserlines({group:j,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:M,pos:$,layer:i},s)),this.replace(i,n,j);var F={x:Math.floor(S.x*et[0]+z[0]-jt.SafeBorderPadding),y:Math.floor(S.y*et[1]+z[1]-jt.SafeBorderPadding),w:Math.floor(S.w*et[0]+2*jt.SafeBorderPadding),h:Math.floor(S.h*et[1]+2*jt.SafeBorderPadding)};if(d||v||p){var _R2=j.getBoundingClientRect();F={x:Math.floor(_R2.x-jt.SafeBorderPadding),y:Math.floor(_R2.y-jt.SafeBorderPadding),w:Math.floor(_R2.width+jt.SafeBorderPadding*2),h:Math.floor(_R2.height+jt.SafeBorderPadding*2)};}return this.isDelete&&j.setAttribute("opacity",0),F;}},{key:"computDrawPoints",value:function computDrawPoints(e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(e):this.computTrianglePoints();}},{key:"computFullArrowPoints",value:function computFullArrowPoints(e){var _this52=this;var n=Ct.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),i=Ct.Per(n).mul(e/2),s=_t.Sub(this.tmpPoints[0],i),o=_t.Add(this.tmpPoints[0],i),a=Ct.Mul(n,this.arrowTipWidth),u=Ct.Sub(this.tmpPoints[1],a),d=_t.Sub(u,i),v=_t.Add(u,i),p=Ct.Per(n).mul(e*1.5),w=_t.Sub(u,p),A=_t.Add(u,p),M=[this.tmpPoints[0],u],E=[w,this.tmpPoints[1],A],L=[s,o].concat(E,[d,v]);return{trianglePoints:E.map(function(G){return _t.Sub(G,_this52.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:M.map(function(G){return _t.Sub(G,_this52.tmpPoints[0]).XY;}).flat(1),rect:$e(L),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this53=this;var e=Ct.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=this.tmpPoints[1].distance(this.tmpPoints[0]),i=Ct.Per(e).mul(Math.floor(n*3/8)),s=_t.Sub(this.tmpPoints[0],i),o=_t.Add(this.tmpPoints[0],i),a=[s,this.tmpPoints[1],o];return{trianglePoints:a.map(function(u){return _t.Sub(u,_this53.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:$e(a),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState2=e.workState,s=_e$workState2===void 0?te.Done:_e$workState2,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var d,v;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.strokeType,u=s.get(n.name);return o&&(n.tagName==="GROUP"?n.children.forEach(function(p){p.setAttribute("strokeColor",o),p.getAttribute("fillColor")&&p.setAttribute("fillColor",o);}):(n.setAttribute("strokeColor",o),n.setAttribute("fillColor",o)),(d=u==null?void 0:u.opt)!=null&&d.strokeColor&&(u.opt.strokeColor=o)),a&&u!=null&&u.opt&&(v=u.opt)!=null&&v.strokeType&&(u.opt.strokeType=a),u&&s.setInfo(n.name,u),jt.updateNodeOpt(e);}}]);}(jt);var AS=/*#__PURE__*/function(_jt6){function AS(e){var _this54;_classCallCheck(this,AS);_this54=_callSuper(this,AS,[e]);wt(_this54,"canRotate",!1);wt(_this54,"scaleType",be.all);wt(_this54,"toolsType",It.Ellipse);wt(_this54,"tmpPoints",[]);wt(_this54,"workOptions");wt(_this54,"oldRect");wt(_this54,"syncTimestamp");_this54.workOptions=e.toolsOpt,_this54.syncTimestamp=0,_this54.syncUnitTime=50;return _this54;}_inherits(AS,_jt6);return _createClass(AS,[{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=this.workId,v=n.op,p=n.syncUnitTime;p&&(this.syncUnitTime=p);var w=v==null?void 0:v.length;if(!w||w<2)return{type:xt.None};var A;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],A=!1):A=this.updateTempPoints(v),!A)return{type:xt.None};var M;if(s||o||u){var E=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({workId:d,layer:E,isDrawing:!0});var L=E.parent.parent,G={x:0,y:0,w:Math.floor(L.width),h:Math.floor(L.height)},z=_objectSpread({type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(qa(M,G)!==Ji.outside){var x=Jt(M,this.oldRect);if(this.oldRect=M,z.rect=x,!u)return z;}if(u){var _x19=Date.now();return _x19-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_x19,z.op=this.tmpPoints.map(function(y){return[].concat(_toConsumableArray(y.XY),[0]);}).flat(1),z.index=0,z.isSync=!0),z;}return{type:xt.None};}if(!s&&!o&&!u&&a){var _E2=Date.now();return _E2-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_E2,_objectSpread(_objectSpread({type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(L){return[].concat(_toConsumableArray(L.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:xt.None};}return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n,isDrawing:!1});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:i&&jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:xt.FullWork,dataType:Kt.Local},this.baseConsumeResult),{},{ops:o,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,s=e.isDrawing,o=e.isDrawEraserlines,_this$workOptions8=this.workOptions,a=_this$workOptions8.strokeColor,u=_this$workOptions8.fillColor,d=_this$workOptions8.thickness,v=_this$workOptions8.zIndex,p=_this$workOptions8.scale,w=_this$workOptions8.rotate,A=_this$workOptions8.translate,M=_this$workOptions8.strokeType,E=_this$workOptions8.eraserlines,L=_this$workOptions8.eraserFaces,G=_this$workOptions8.doingLines,z=_this$workOptions8.lineDash,et=_this$workOptions8.lineCap,x=i.worldScaling,_this$computDrawPoint4=this.computDrawPoints(d),y=_this$computDrawPoint4.radius,S=_this$computDrawPoint4.rect,C=_this$computDrawPoint4.pos,P={closeType:"normal",radius:y,lineWidth:d,fillColor:u!=="transparent"&&u||void 0,strokeColor:a,normalize:!0,lineCap:et,lineDash:M===Re.Dotted?[z&&z[0]||1,(z&&z[1]||2)*d]:M===Re.LongDotted?[(z&&z[0]||1)*d,(z&&z[1]||2)*d]:void 0},X={name:n,id:n,zIndex:v,pos:C,anchor:[0.5,0.5],size:[S.w,S.h]};p&&(X.scale=p),w&&(X.rotate=w),A&&(X.translate=A);var $=new ar(X);if(s){var nt=new Qr({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/x[0],1/x[1]]});$.append(nt);}var K=new _p(_objectSpread(_objectSpread({},P),{},{pos:[0,0]}));$.append(K),(E||L||G)&&(this.scaleType=be.proportional,this.drawEraserlines({group:$,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:L,pos:C,layer:i},o)),this.replace(i,n,$);var j=$.getBoundingClientRect();return this.isDelete&&$.setAttribute("opacity",0),{x:Math.floor(j.x-jt.SafeBorderPadding),y:Math.floor(j.y-jt.SafeBorderPadding),w:Math.floor(j.width+jt.SafeBorderPadding*2),h:Math.floor(j.height+jt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(e){var n=$e(this.tmpPoints),i=$e(this.tmpPoints,e),s=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)];return{rect:i,pos:s,radius:[Math.floor(n.w/2),Math.floor(n.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState3=e.workState,s=_e$workState3===void 0?te.Done:_e$workState3,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var p,w,A;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.fillColor,u=i.strokeType,d=s.get(n.name);var v=n;return n.tagName==="GROUP"&&(v=n.children[0]),o&&(v.setAttribute("strokeColor",o),(p=d==null?void 0:d.opt)!=null&&p.strokeColor&&(d.opt.strokeColor=o)),a&&(a==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",a),(w=d==null?void 0:d.opt)!=null&&w.fillColor&&(d.opt.fillColor=a)),u&&d!=null&&d.opt&&(A=d.opt)!=null&&A.strokeType&&(d.opt.strokeType=u),d&&s.setInfo(n.name,d),jt.updateNodeOpt(e);}}]);}(jt);var bS=/*#__PURE__*/function(_jt7){function bS(e){var _this55;_classCallCheck(this,bS);_this55=_callSuper(this,bS,[e]);wt(_this55,"canRotate",!0);wt(_this55,"scaleType",be.all);wt(_this55,"toolsType",It.Rectangle);wt(_this55,"tmpPoints",[]);wt(_this55,"workOptions");wt(_this55,"oldRect");wt(_this55,"syncTimestamp");_this55.workOptions=e.toolsOpt,_this55.syncTimestamp=0,_this55.syncUnitTime=50;return _this55;}_inherits(bS,_jt7);return _createClass(bS,[{key:"transformData",value:function transformData(){var e=$e(this.tmpPoints);return[[e.x,e.y,0],[e.x+e.w,e.y,0],[e.x+e.w,e.y+e.h,0],[e.x,e.y+e.h,0]];}},{key:"computDrawPoints",value:function computDrawPoints(e){var n=this.workOptions.thickness,i=[];var _iterator45=_createForOfIteratorHelper(e),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var a=_step45.value;i.push(_construct(Ct,_toConsumableArray(a)));}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}var s=$e(i,n),o=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:o,points:i.map(function(a){return a.XY;}).flat(1)};}},{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=this.workId,v=n.op,p=v==null?void 0:v.length;if(!p||p<2)return{type:xt.None};var w;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],w=!1):w=this.updateTempPoints(v),!w)return{type:xt.None};var A=this.transformData();var M;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({ps:A,workId:d,layer:L,isDrawing:!0});}if(u){var _L7=Jt(M,this.oldRect);this.oldRect=M;var G=_objectSpread({rect:_L7,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=A.flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L8=Date.now();return _L8-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L8,_objectSpread({type:xt.DrawWork,dataType:Kt.Local,op:A.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var E=Jt(M,this.oldRect);return this.oldRect=M,_objectSpread({rect:E,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var u;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.transformData(),i=this.fullLayer,s=this.draw({ps:n,workId:e,layer:i,isDrawing:!1});this.oldRect=s;var o=n.flat(1),a=Br(o);return(u=this.vNodes)==null||u.setInfo(e,{rect:s,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&jt.getCenterPos(s,i)}),_objectSpread(_objectSpread({rect:s,type:xt.FullWork,dataType:Kt.Local,ops:a,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,s=e.isDrawing,o=e.ps,a=e.replaceId,_e$isDrawEraserlines2=e.isDrawEraserlines,u=_e$isDrawEraserlines2===void 0?!0:_e$isDrawEraserlines2,_this$workOptions9=this.workOptions,d=_this$workOptions9.strokeColor,v=_this$workOptions9.fillColor,p=_this$workOptions9.thickness,w=_this$workOptions9.zIndex,A=_this$workOptions9.scale,M=_this$workOptions9.rotate,E=_this$workOptions9.translate,L=_this$workOptions9.strokeType,G=_this$workOptions9.eraserlines,z=_this$workOptions9.eraserFaces,et=_this$workOptions9.doingLines,x=_this$workOptions9.lineCap,y=_this$workOptions9.lineDash,S=i.worldPosition,C=i.worldScaling,_this$computDrawPoint5=this.computDrawPoints(o),P=_this$computDrawPoint5.points,X=_this$computDrawPoint5.rect,$=_this$computDrawPoint5.pos,K={close:!0,normalize:!0,points:P,lineWidth:p,fillColor:v!=="transparent"&&v||void 0,strokeColor:d,lineCap:x,lineDash:L===Re.Dotted?[y&&y[0]||1,(y&&y[1]||2)*p]:L===Re.LongDotted?[(y&&y[0]||1)*p,(y&&y[1]||2)*p]:void 0};var j={x:Math.floor(X.x*C[0]+S[0]-jt.SafeBorderPadding),y:Math.floor(X.y*C[1]+S[1]-jt.SafeBorderPadding),w:Math.floor(X.w*C[0]+2*jt.SafeBorderPadding),h:Math.floor(X.h*C[0]+2*jt.SafeBorderPadding)};var nt=new ar({name:n,id:n,zIndex:w,pos:$,anchor:[0.5,0.5],size:[X.w,X.h],scale:A,rotate:M,translate:E}),ct=new Un(_objectSpread(_objectSpread({},K),{},{pos:[0,0]}));if(nt.appendChild(ct),s){var F=new Qr({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:d,lineWidth:1,scale:[1/C[0],1/C[1]]});nt.appendChild(F);}if((G||z||et)&&(this.scaleType=be.proportional,this.drawEraserlines({group:nt,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:z,pos:$,layer:i},u)),this.replace(i,a||n,nt),A||M||E){var _F2=nt.getBoundingClientRect();j={x:Math.floor(_F2.x-jt.SafeBorderPadding),y:Math.floor(_F2.y-jt.SafeBorderPadding),w:Math.floor(_F2.width+2*jt.SafeBorderPadding),h:Math.floor(_F2.height+2*jt.SafeBorderPadding)};}return this.isDelete&&nt.setAttribute("opacity",0),j;}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var p,w;var n=e.op,i=e.isFullWork,s=e.replaceId,_e$workState4=e.workState,o=_e$workState4===void 0?te.Done:_e$workState4,a=(p=this.workId)==null?void 0:p.toString();if(!a)return;var u=[];for(var A=0;A<n.length;A+=3)u.push([n[A],n[A+1],n[A+2]]);var d=i?this.fullLayer:this.drawLayer||this.fullLayer,v=this.draw({ps:u,workId:a,layer:d,isDrawing:!1,replaceId:s,isDrawEraserlines:o===te.Done});return this.oldRect=v,(w=this.vNodes)==null||w.setInfo(a,{rect:v,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:v&&jt.getCenterPos(v,d)}),v;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var p,w,A;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.fillColor,u=i.strokeType,d=s.get(n.name);var v=n;return n.tagName==="GROUP"&&(v=n.children[0]),o&&(v.setAttribute("strokeColor",o),(p=d==null?void 0:d.opt)!=null&&p.strokeColor&&(d.opt.strokeColor=o)),a&&(a==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",a),(w=d==null?void 0:d.opt)!=null&&w.fillColor&&(d.opt.fillColor=a)),u&&d!=null&&d.opt&&(A=d.opt)!=null&&A.strokeType&&(d.opt.strokeType=u),d&&s.setInfo(n.name,d),jt.updateNodeOpt(e);}}]);}(jt);var MS=/*#__PURE__*/function(_jt8){function MS(e){var _this56;_classCallCheck(this,MS);_this56=_callSuper(this,MS,[e]);wt(_this56,"canRotate",!1);wt(_this56,"scaleType",be.all);wt(_this56,"toolsType",It.Star);wt(_this56,"tmpPoints",[]);wt(_this56,"workOptions");wt(_this56,"oldRect");wt(_this56,"syncTimestamp");_this56.workOptions=e.toolsOpt,_this56.syncTimestamp=0,_this56.syncUnitTime=50;return _this56;}_inherits(MS,_jt8);return _createClass(MS,[{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=this.workId,v=n.op,p=n.syncUnitTime,w=v==null?void 0:v.length;if(!w||w<2)return{type:xt.None};p&&(this.syncUnitTime=p);var A;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],A=!1):A=this.updateTempPoints(v),!A)return{type:xt.None};var M;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({workId:d,layer:L,isDrawing:!0});}if(u){var _L9=Jt(M,this.oldRect);this.oldRect=M;var G=_objectSpread({rect:_L9,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=this.tmpPoints.map(function(et){return[].concat(_toConsumableArray(et.XY),[0]);}).flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L0=Date.now();return _L0-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L0,_objectSpread({type:xt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(G){return[].concat(_toConsumableArray(G.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var E=Jt(M,this.oldRect);return this.oldRect=M,_objectSpread({rect:E,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n,isDrawing:!1});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:xt.FullWork,dataType:Kt.Local,ops:o,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,s=e.isDrawing,_e$isDrawEraserlines3=e.isDrawEraserlines,o=_e$isDrawEraserlines3===void 0?!0:_e$isDrawEraserlines3,_this$workOptions0=this.workOptions,a=_this$workOptions0.strokeColor,u=_this$workOptions0.fillColor,d=_this$workOptions0.thickness,v=_this$workOptions0.zIndex,p=_this$workOptions0.vertices,w=_this$workOptions0.innerVerticeStep,A=_this$workOptions0.innerRatio,M=_this$workOptions0.scale,E=_this$workOptions0.rotate,L=_this$workOptions0.translate,G=_this$workOptions0.strokeType,z=_this$workOptions0.eraserlines,et=_this$workOptions0.eraserFaces,x=_this$workOptions0.doingLines,y=_this$workOptions0.lineDash,S=_this$workOptions0.lineCap,C=i.worldScaling,_this$computDrawPoint6=this.computDrawPoints(d,p,w,A),P=_this$computDrawPoint6.rect,X=_this$computDrawPoint6.pos,$=_this$computDrawPoint6.points,K={close:!0,points:$,lineWidth:d,fillColor:u!=="transparent"&&u||void 0,strokeColor:a,normalize:!0,lineCap:S,lineDash:G===Re.Dotted?[y&&y[0]||1,(y&&y[1]||2)*d]:G===Re.LongDotted?[(y&&y[0]||1)*d,(y&&y[1]||2)*d]:void 0},j={name:n,id:n,zIndex:v,pos:X,anchor:[0.5,0.5],size:[P.w,P.h]};M&&(j.scale=M),E&&(j.rotate=E),L&&(j.translate=L);var nt=new ar(j);if(s){var R=new Qr({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/C[0],1/C[1]]});nt.append(R);}var ct=new Un(_objectSpread(_objectSpread({},K),{},{pos:[0,0]}));nt.append(ct),(z||et||x)&&(this.scaleType=be.proportional,this.drawEraserlines({group:nt,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:et,pos:X,layer:i},o)),this.replace(i,n,nt);var F=nt.getBoundingClientRect();return this.isDelete&&nt.setAttribute("opacity",0),{x:Math.floor(F.x-jt.SafeBorderPadding),y:Math.floor(F.y-jt.SafeBorderPadding),w:Math.floor(F.width+jt.SafeBorderPadding*2),h:Math.floor(F.height+jt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(e,n,i,s){var o=$e(this.tmpPoints),a=[Math.floor(o.x+o.w/2),Math.floor(o.y+o.h/2)],u=KS(o.w,o.h),d=Math.floor(Math.min(o.w,o.h)/2),v=s*d,p=[],w=2*Math.PI/n;for(var M=0;M<n;M++){var E=M*w-0.5*Math.PI;var L=void 0,G=void 0;M%i===1?(L=v*u[0]*Math.cos(E),G=v*u[1]*Math.sin(E)):(L=d*u[0]*Math.cos(E),G=d*u[1]*Math.sin(E),p.push(L,G)),p.push(L,G);}return{rect:$e(this.tmpPoints,e),pos:a,points:p};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o)||_t.Sub(s,i).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState5=e.workState,s=_e$workState5===void 0?te.Done:_e$workState5,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:u&&jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var L;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.fillColor,u=i.toolsType,d=i.vertices,v=i.innerVerticeStep,p=i.innerRatio,w=i.strokeType,A=s.get(n.name),M=A==null?void 0:A.opt;var E=n;return n.tagName==="GROUP"&&(E=n.children[0]),o&&(E.setAttribute("strokeColor",o),M!=null&&M.strokeColor&&(M.strokeColor=o)),a&&(a==="transparent"?E.setAttribute("fillColor","rgba(0,0,0,0)"):E.setAttribute("fillColor",a),M!=null&&M.fillColor&&(M.fillColor=a)),u===It.Star&&(d&&(M.vertices=d),v&&(M.innerVerticeStep=v),p&&(M.innerRatio=p)),w&&A!=null&&A.opt&&(L=A.opt)!=null&&L.strokeType&&(A.opt.strokeType=w),A&&s.setInfo(n.name,_objectSpread(_objectSpread({},A),{},{opt:M})),jt.updateNodeOpt(e);}}]);}(jt);var ES=/*#__PURE__*/function(_jt9){function ES(e){var _this57;_classCallCheck(this,ES);_this57=_callSuper(this,ES,[e]);wt(_this57,"canRotate",!1);wt(_this57,"scaleType",be.all);wt(_this57,"toolsType",It.Polygon);wt(_this57,"tmpPoints",[]);wt(_this57,"workOptions");wt(_this57,"oldRect");wt(_this57,"syncTimestamp");_this57.workOptions=e.toolsOpt,_this57.syncTimestamp=0,_this57.syncUnitTime=50;return _this57;}_inherits(ES,_jt9);return _createClass(ES,[{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=n.op,v=n.syncUnitTime;v&&(this.syncUnitTime=v);var p=this.workId,w=d==null?void 0:d.length;if(!w||w<2)return{type:xt.None};var A;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(d[0],d[1])],A=!1):A=this.updateTempPoints(d),!A)return{type:xt.None};var M;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({workId:p,layer:L,isDrawing:!0});}if(u){var _L1=Jt(M,this.oldRect);this.oldRect=M;var G=_objectSpread({type:xt.DrawWork,rect:_L1,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=this.tmpPoints.map(function(et){return[].concat(_toConsumableArray(et.XY),[0]);}).flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L10=Date.now();return _L10-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L10,_objectSpread({type:xt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(G){return[].concat(_toConsumableArray(G.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var E=Jt(M,this.oldRect);return this.oldRect=M,_objectSpread({rect:E,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n,isDrawing:!1});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:xt.FullWork,dataType:Kt.Local,ops:o,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,s=e.isDrawing,_e$isDrawEraserlines4=e.isDrawEraserlines,o=_e$isDrawEraserlines4===void 0?!0:_e$isDrawEraserlines4,_this$workOptions1=this.workOptions,a=_this$workOptions1.strokeColor,u=_this$workOptions1.fillColor,d=_this$workOptions1.thickness,v=_this$workOptions1.zIndex,p=_this$workOptions1.vertices,w=_this$workOptions1.scale,A=_this$workOptions1.rotate,M=_this$workOptions1.translate,E=_this$workOptions1.strokeType,L=_this$workOptions1.eraserlines,G=_this$workOptions1.eraserFaces,z=_this$workOptions1.doingLines,et=_this$workOptions1.lineCap,x=_this$workOptions1.lineDash,y=i.worldScaling,_this$computDrawPoint7=this.computDrawPoints(d,p),S=_this$computDrawPoint7.rect,C=_this$computDrawPoint7.pos,P=_this$computDrawPoint7.points,X={close:!0,points:P,lineWidth:d,fillColor:u!=="transparent"&&u||void 0,strokeColor:a,normalize:!0,lineCap:et,lineDash:E===Re.Dotted?[x&&x[0]||1,(x&&x[1]||2)*d]:E===Re.LongDotted?[(x&&x[0]||1)*d,(x&&x[1]||2)*d]:void 0},$={name:n,id:n,zIndex:v,pos:C,anchor:[0.5,0.5],size:[S.w,S.h]};w&&($.scale=w),A&&($.rotate=A),M&&($.translate=M);var K=new ar($);if(s){var ct=new Qr({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/y[0],1/y[1]]});K.append(ct);}var j=new Un(_objectSpread(_objectSpread({},X),{},{pos:[0,0]}));K.append(j),(L||G||z)&&(this.scaleType=be.proportional,this.drawEraserlines({group:K,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:G,pos:C,layer:i},o)),this.replace(i,n,K);var nt=K.getBoundingClientRect();return this.isDelete&&K.setAttribute("opacity",0),{x:Math.floor(nt.x-jt.SafeBorderPadding),y:Math.floor(nt.y-jt.SafeBorderPadding),w:Math.floor(nt.width+jt.SafeBorderPadding*2),h:Math.floor(nt.height+jt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(e,n){var i=$e(this.tmpPoints),s=[Math.floor(i.x+i.w/2),Math.floor(i.y+i.h/2)],o=KS(i.w,i.h),a=Math.floor(Math.min(i.w,i.h)/2),u=[],d=2*Math.PI/n;for(var p=0;p<n;p++){var w=p*d-0.5*Math.PI,A=a*o[0]*Math.cos(w),M=a*o[1]*Math.sin(w);u.push(A,M);}return{rect:$e(this.tmpPoints,e),pos:s,points:u};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o)||_t.Sub(s,i).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState6=e.workState,s=_e$workState6===void 0?te.Done:_e$workState6,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:u&&jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var M;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.fillColor,u=i.toolsType,d=i.vertices,v=i.strokeType,p=s.get(n.name),w=p==null?void 0:p.opt;var A=n;return n.tagName==="GROUP"&&(A=n.children[0]),o&&(A.setAttribute("strokeColor",o),w!=null&&w.strokeColor&&(w.strokeColor=o)),a&&(a==="transparent"?A.setAttribute("fillColor","rgba(0,0,0,0)"):A.setAttribute("fillColor",a),w!=null&&w.fillColor&&(w.fillColor=a)),u===It.Polygon&&d&&(w.vertices=d),v&&p!=null&&p.opt&&(M=p.opt)!=null&&M.strokeType&&(p.opt.strokeType=v),p&&s.setInfo(n.name,_objectSpread(_objectSpread({},p),{},{opt:w})),jt.updateNodeOpt(e);}}]);}(jt);var Nn=/*#__PURE__*/function(){function Nn(){_classCallCheck(this,Nn);}return _createClass(Nn,null,[{key:"bezier",value:function bezier(t,e){var n=[];for(var i=0;i<e.length;i+=4){var s=e[i],o=e[i+1],a=e[i+2],u=e[i+3];s&&o&&a&&u?n.push.apply(n,_toConsumableArray(Nn.getBezierPoints(t,s,o,a,u))):s&&o&&a?n.push.apply(n,_toConsumableArray(Nn.getBezierPoints(t,s,o,a))):s&&o?n.push.apply(n,_toConsumableArray(Nn.getBezierPoints(t,s,o))):s&&n.push(s);}return n;}/**
|
|
408
|
+
null;}function Co(r,t){var e=0;return r[0]<t[0]?e|=1:r[0]>t[2]&&(e|=2),r[1]<t[1]?e|=4:r[1]>t[3]&&(e|=8),e;}var g0=/* @__PURE__ */zn(Rxt),Ao=/*#__PURE__*/function(_jt3){function Ao(e,n){var _this45;_classCallCheck(this,Ao);_this45=_callSuper(this,Ao,[e]);wt(_this45,"canRotate",!1);wt(_this45,"scaleType",be.none);wt(_this45,"toolsType",It.Eraser);wt(_this45,"serviceWork");wt(_this45,"tmpPoints",[]);wt(_this45,"workOptions");wt(_this45,"worldPosition");wt(_this45,"worldScaling");wt(_this45,"eraserRect");wt(_this45,"eraserPolyline");_this45.serviceWork=n,_this45.workOptions=e.toolsOpt,_this45.worldPosition=_this45.fullLayer.worldPosition,_this45.worldScaling=_this45.fullLayer.worldScaling;return _this45;}_inherits(Ao,_jt3);return _createClass(Ao,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(e){_superPropGet(Ao,"setWorkOptions",this,3)([e]);}},{key:"createEraserRect",value:function createEraserRect(e){var n=e[0]*this.worldScaling[0]+this.worldPosition[0],i=e[1]*this.worldScaling[1]+this.worldPosition[1],_Ao$eraserSizes$this$=Ao.eraserSizes[this.workOptions.thickness],s=_Ao$eraserSizes$this$.width,o=_Ao$eraserSizes$this$.height;this.eraserRect={x:n-s*0.5,y:i-o*0.5,w:s,h:o},this.eraserPolyline=[this.eraserRect.x,this.eraserRect.y,this.eraserRect.x+this.eraserRect.w,this.eraserRect.y+this.eraserRect.h];}},{key:"computRectCenterPoints",value:function computRectCenterPoints(){var e=this.tmpPoints.slice(-2);if(this.tmpPoints.length===4){var n=new Ct(this.tmpPoints[0],this.tmpPoints[1]),i=new Ct(this.tmpPoints[2],this.tmpPoints[3]),s=Ct.Sub(i,n).uni(),o=Ct.Dist(n,i),_Ao$eraserSizes$this$2=Ao.eraserSizes[this.workOptions.thickness],a=_Ao$eraserSizes$this$2.width,u=_Ao$eraserSizes$this$2.height,d=Math.min(a,u),v=Math.round(o/d);if(v>1){var p=[];for(var w=0;w<v;w++){var A=Ct.Mul(s,w*d);p.push(this.tmpPoints[0]+A.x,this.tmpPoints[1]+A.y);}return p.concat(e);}}return e;}},{key:"isNear",value:function isNear(e,n){var i=new Ct(e[0],e[1]),s=new Ct(n[0],n[1]),_Ao$eraserSizes$this$3=Ao.eraserSizes[this.workOptions.thickness],o=_Ao$eraserSizes$this$3.width,a=_Ao$eraserSizes$this$3.height;return Ct.Dist(i,s)<Math.hypot(o,a)*0.5;}},{key:"remove",value:function remove(e){var _this46=this;var n=e.curNodeMap,i=e.removeIds;var s;var _iterator34=_createForOfIteratorHelper(n.values()),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var o=_step34.value;if(o.rect&&this.eraserRect&&this.eraserPolyline&&Su(this.eraserRect,o.rect)){var a=o.op,u=[],d=[];for(var p=0;p<a.length;p+=3){var w=new Ct(a[p]*this.worldScaling[0]+this.worldPosition[0],a[p+1]*this.worldScaling[1]+this.worldPosition[1],a[p+2]);d.push(w),u.push(new _t(w.x,w.y));}var v=u.length&&$e(u)||o.rect;Su(v,this.eraserRect)&&(d.length>1?g0.polyline(d.map(function(w){return w.XY;}),this.eraserPolyline).length&&i.add(o.name):i.add(o.name),s=Jt(s,o.rect||v));}}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}return i.forEach(function(o){var u;var a=_this46.fullLayer.getElementsByName(o);a[0]&&(a[0].remove(),_Ur(a[0],_this46.fullLayer.parent),(u=_this46.vNodes)==null||u.delete(o));}),s&&(s.x-=jt.SafeBorderPadding,s.y-=jt.SafeBorderPadding,s.w+=jt.SafeBorderPadding*2,s.h+=jt.SafeBorderPadding*2),s;}},{key:"consume",value:function consume(e){var _e$data2=e.data,n=_e$data2.op,i=_e$data2.disableEraseImage,s=_e$data2.disableEraseText;if(!n||n.length===0)return _objectSpread({type:xt.None},this.baseConsumeResult);var o=this.tmpPoints.length;if(o>1&&this.isNear([n[0],n[1]],[this.tmpPoints[o-2],this.tmpPoints[o-1]]))return _objectSpread({type:xt.None},this.baseConsumeResult);o<3?this.tmpPoints.push(n[0],n[1]):this.tmpPoints.splice(2,2,n[0],n[1]);var a=this.computRectCenterPoints();var u;var d=/* @__PURE__ */new Set();if(!this.vNodes)return _objectSpread({type:xt.None},this.baseConsumeResult);var v=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap,{disableEraseImage:i,disableEraseText:s}));for(var p=0;p<a.length-1;p+=2){this.createEraserRect(a.slice(p,p+2));var w=this.remove({curNodeMap:v,removeIds:d});u=Jt(u,w);}return u&&d.size?{type:xt.RemoveNode,rect:u,removeIds:_toConsumableArray(d)}:_objectSpread({type:xt.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(e){return this.consume(e);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getCanEraserNodeMap",value:function getCanEraserNodeMap(e){var n;if(this.serviceWork){var i=new Map(e),s=this.serviceWork.selectorWorkShapes,o=this.serviceWork.workShapes;var _iterator35=_createForOfIteratorHelper(s.values()),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var a=_step35.value;if((n=a.selectIds)!=null&&n.length){var _iterator37=_createForOfIteratorHelper(a.selectIds),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var u=_step37.value;i.delete(u);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}}}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}var _iterator36=_createForOfIteratorHelper(o.keys()),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _a6=_step36.value;i.delete(_a6);}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}return i;}return e;}}]);}(jt);// 来源于white-sdk
|
|
409
|
+
wt(Ao,"eraserSizes",v0);var pu=Ao;var Bxt="__lodash_hash_undefined__";function kxt(r){return this.__data__.set(r,Bxt),this;}var Fxt=kxt;function Wxt(r){return this.__data__.has(r);}var Uxt=Wxt,zxt=V2,$xt=Fxt,Yxt=Uxt;function vu(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new zxt();++t<e;)this.add(r[t]);}vu.prototype.add=vu.prototype.push=$xt;vu.prototype.has=Yxt;var m0=vu;function jxt(r,t){for(var e=-1,n=r==null?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1;}var Xxt=jxt;function Gxt(r,t){return r.has(t);}var y0=Gxt,Hxt=m0,Vxt=Xxt,Zxt=y0,qxt=1,Kxt=2;function Qxt(r,t,e,n,i,s){var o=e&qxt,a=r.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var d=s.get(r),v=s.get(t);if(d&&v)return d==t&&v==r;var p=-1,w=!0,A=e&Kxt?new Hxt():void 0;for(s.set(r,t),s.set(t,r);++p<a;){var M=r[p],E=t[p];if(n)var L=o?n(E,M,p,t,r,s):n(M,E,p,r,t,s);if(L!==void 0){if(L)continue;w=!1;break;}if(A){if(!Vxt(t,function(G,z){if(!Zxt(A,z)&&(M===G||i(M,G,e,n,s)))return A.push(z);})){w=!1;break;}}else if(!(M===E||i(M,E,e,n,s))){w=!1;break;}}return s.delete(r),s.delete(t),w;}var xS=Qxt;function Jxt(r){var t=-1,e=Array(r.size);return r.forEach(function(n,i){e[++t]=[i,n];}),e;}var _xt=Jxt;function tCt(r){var t=-1,e=Array(r.size);return r.forEach(function(n){e[++t]=n;}),e;}var w0=tCt,t1=cl,e1=hS,eCt=n0,rCt=xS,nCt=_xt,iCt=w0,sCt=1,oCt=2,aCt="[object Boolean]",lCt="[object Date]",cCt="[object Error]",uCt="[object Map]",fCt="[object Number]",hCt="[object RegExp]",dCt="[object Set]",pCt="[object String]",vCt="[object Symbol]",gCt="[object ArrayBuffer]",mCt="[object DataView]",r1=t1?t1.prototype:void 0,xd=r1?r1.valueOf:void 0;function yCt(r,t,e,n,i,s,o){switch(e){case mCt:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case gCt:return!(r.byteLength!=t.byteLength||!s(new e1(r),new e1(t)));case aCt:case lCt:case fCt:return eCt(+r,+t);case cCt:return r.name==t.name&&r.message==t.message;case hCt:case pCt:return r==t+"";case uCt:var a=nCt;case dCt:var u=n&sCt;if(a||(a=iCt),r.size!=t.size&&!u)return!1;var d=o.get(r);if(d)return d==t;n|=oCt,o.set(r,t);var v=rCt(a(r),a(t),n,i,s,o);return o.delete(r),v;case vCt:if(xd)return xd.call(r)==xd.call(t);}return!1;}var wCt=yCt,n1=cS,SCt=1,ICt=Object.prototype,TCt=ICt.hasOwnProperty;function xCt(r,t,e,n,i,s){var o=e&SCt,a=n1(r),u=a.length,d=n1(t),v=d.length;if(u!=v&&!o)return!1;for(var p=u;p--;){var w=a[p];if(!(o?w in t:TCt.call(t,w)))return!1;}var A=s.get(r),M=s.get(t);if(A&&M)return A==t&&M==r;var E=!0;s.set(r,t),s.set(t,r);for(var L=o;++p<u;){w=a[p];var G=r[w],z=t[w];if(n)var et=o?n(z,G,w,t,r,s):n(G,z,w,r,t,s);if(!(et===void 0?G===z||i(G,z,e,n,s):et)){E=!1;break;}L||(L=w=="constructor");}if(E&&!L){var x=r.constructor,y=t.constructor;x!=y&&"constructor"in r&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof y=="function"&&y instanceof y)&&(E=!1);}return s.delete(r),s.delete(t),E;}var CCt=xCt,Cd=Z2,PCt=xS,ACt=wCt,bCt=CCt,i1=af,s1=fl,o1=s0,MCt=eS,ECt=1,a1="[object Arguments]",l1="[object Array]",Fc="[object Object]",LCt=Object.prototype,c1=LCt.hasOwnProperty;function OCt(r,t,e,n,i,s){var o=s1(r),a=s1(t),u=o?l1:i1(r),d=a?l1:i1(t);u=u==a1?Fc:u,d=d==a1?Fc:d;var v=u==Fc,p=d==Fc,w=u==d;if(w&&o1(r)){if(!o1(t))return!1;o=!0,v=!1;}if(w&&!v)return s||(s=new Cd()),o||MCt(r)?PCt(r,t,e,n,i,s):ACt(r,t,u,e,n,i,s);if(!(e&ECt)){var A=v&&c1.call(r,"__wrapped__"),M=p&&c1.call(t,"__wrapped__");if(A||M){var E=A?r.value():r,L=M?t.value():t;return s||(s=new Cd()),i(E,L,e,n,s);}}return w?(s||(s=new Cd()),bCt(r,t,e,n,i,s)):!1;}var DCt=OCt,RCt=DCt,u1=Pi;function CS(r,t,e,n,i){return r===t?!0:r==null||t==null||!u1(r)&&!u1(t)?r!==r&&t!==t:RCt(r,t,e,n,CS,i);}var NCt=CS,BCt=NCt;function kCt(r,t){return BCt(r,t);}var FCt=kCt;var qn=/* @__PURE__ */zn(FCt);function f1(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;return"rgba(".concat(r,",").concat(t,",").concat(e,",").concat(n,")");}function WCt(r){var t=r.split(","),e=parseInt(t[0].split("(")[1]),n=parseInt(t[1]),i=parseInt(t[2]),s=Number(t[3].split(")")[0]);return[e,n,i,s];}var Cu=/*#__PURE__*/function(_jt4){function Cu(e){var _this47;_classCallCheck(this,Cu);_this47=_callSuper(this,Cu,[e]);wt(_this47,"toolsType",It.Selector);wt(_this47,"tmpPoints",[]);wt(_this47,"subTmpPoints",[]);wt(_this47,"workOptions");wt(_this47,"vNodes");wt(_this47,"selectIds");wt(_this47,"selectorColor");wt(_this47,"strokeColor");wt(_this47,"fillColor");wt(_this47,"oldSelectRect");wt(_this47,"oldSubSelectRect");wt(_this47,"canRotate",!1);wt(_this47,"canTextEdit",!1);wt(_this47,"canLock",!1);wt(_this47,"scaleType",be.all);wt(_this47,"toolsTypes");wt(_this47,"shapeOpt");wt(_this47,"textOpt");wt(_this47,"isLocked");wt(_this47,"thickness");wt(_this47,"strokeType");wt(_this47,"useStroke");_this47.workOptions=e.toolsOpt,_this47.vNodes=e.vNodes;return _this47;}_inherits(Cu,_jt4);return _createClass(Cu,[{key:"computSelector",value:function computSelector(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var n=$e(this.tmpPoints);if(n.w===0||n.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(n,e),i=_this$vNodes$getRectI.rectRange,s=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(s.keys()),intersectRect:i,subNodeMap:s};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=this.tmpPoints.length,i=e.length;if(i>1){var s=new _t(e[i-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[i-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);n===2?this.tmpPoints.splice(1,1,s):this.tmpPoints.push(s);}}},{key:"drawSelector",value:function drawSelector(e){var _this48=this;var n=e.drawRect,i=e.subNodeMap,s=e.selectorId,o=e.layer,a=e.isService,u=new ar({pos:[n.x,n.y],anchor:[0,0],size:[n.w,n.h],id:s,name:s,zIndex:9999}),d=[];if(a){var v=new ja({normalize:!0,pos:[n.w/2,n.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:n.w,height:n.h,name:Cu.selectorBorderId});d.push(v);}i.forEach(function(v,p){var w=[v.rect.x+v.rect.w/2-n.x,v.rect.y+v.rect.h/2-n.y],A=new ja({normalize:!0,pos:w,lineWidth:1,strokeColor:i.size>1?_this48.selectorColor||_this48.workOptions.strokeColor:void 0,width:v.rect.w,height:v.rect.h,id:"selector-".concat(p),name:"selector-".concat(p)});d.push(A);}),d&&u.append.apply(u,d),(o==null?void 0:o.parent).appendChild(u);}},{key:"draw",value:function draw(e,n,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var u,d;var o=i.intersectRect,a=i.subNodeMap;(d=(u=n.parent)==null?void 0:u.getElementById(e))==null||d.remove(),o&&this.drawSelector({drawRect:o,subNodeMap:a,selectorId:e,layer:n,isService:s});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(e){this.scaleType=be.all,this.canRotate=!1,this.textOpt=void 0,this.strokeColor=void 0,this.fillColor=void 0,this.canTextEdit=!1,this.canLock=!1,this.isLocked=!1,this.toolsTypes=void 0,this.shapeOpt=void 0,this.thickness=void 0,this.strokeType=void 0,this.useStroke=!1;var n=/* @__PURE__ */new Set();var i,s=!0;var _iterator38=_createForOfIteratorHelper(e.values()),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var o=_step38.value;var a=o.opt,u=o.canRotate,d=o.scaleType,v=o.toolsType;this.selectorColor=this.workOptions.strokeColor,a.strokeColor&&(this.strokeColor=a.strokeColor),a.fillColor&&(this.fillColor=a.fillColor),a.textOpt&&(this.textOpt=a.textOpt),a.thickness&&(this.thickness=a.thickness),v!==It.Pencil&&(s=!1),a.strokeType&&(this.strokeType=a.strokeType),v===It.SpeechBalloon&&(n.add(v),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=a.placement),v===It.Polygon&&(n.add(v),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=a.vertices),v===It.Star&&(n.add(v),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=a.vertices,this.shapeOpt.innerRatio=a.innerRatio,this.shapeOpt.innerVerticeStep=a.innerVerticeStep),v===It.Text&&(this.textOpt=a),e.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=u,this.scaleType=d),(v===It.Image||v===It.BackgroundSVG)&&(i=o),(d===be.proportional&&this.scaleType!==be.none||d===be.none)&&(this.scaleType=d);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}s&&(this.useStroke=!0),n.size&&(this.toolsTypes=_toConsumableArray(n)),i&&(e.size===1?(this.canLock=!0,i.opt.locked&&(this.isLocked=!0,this.scaleType=be.none,this.canRotate=!1,this.textOpt=void 0,this.fillColor=void 0,this.selectorColor="rgb(177,177,177)",this.strokeColor=void 0,this.canTextEdit=!1,this.thickness=void 0,this.strokeType=void 0,this.useStroke=void 0)):e.size>1&&!i.opt.locked&&(this.canLock=!1,this.canRotate=!1));}},{key:"getChildrenPoints",value:function getChildrenPoints(){var e,n;if(this.scaleType===be.both&&((e=this.selectIds)==null?void 0:e.length)===1){var i=this.selectIds[0],s=(n=this.vNodes.get(i))==null?void 0:n.op;if(s){var o=[];for(var a=0;a<s.length;a+=3)o.push([s[a],s[a+1]]);return o;}}}},{key:"consume",value:function consume(e){if(e.isSubWorker)return this.subWorkerConsume(e);var n=_objectSpread({type:xt.Select,dataType:Kt.Local},this.baseConsumeResult);if(e.isSimpleWorker){var v=this.subWorkerConsume(e);n.subRect=v.rect;}var _e$data3=e.data,i=_e$data3.op,s=_e$data3.workState;var o=this.oldSelectRect;if(s===te.Start&&(o=this.unSelectedAllIds()),!(i!=null&&i.length)||!this.vNodes.curNodeMap.size)return e.isSimpleWorker?n:{type:xt.None};this.updateTempPoints(i);var a=this.computSelector();if(this.selectIds&&qn(this.selectIds,a.selectIds))return e.isSimpleWorker?n:{type:xt.None};this.selectIds=a.selectIds;var u=a.intersectRect;this.getSelecteorInfo(a.subNodeMap),this.draw(Fe,this.fullLayer,a),this.oldSelectRect=u;var d=this.getChildrenPoints();return n=_objectSpread(_objectSpread({},n),{},{rect:Jt(u,o),selectIds:a.selectIds,selectRect:u,selectorColor:this.selectorColor,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:d,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType}),n;}},{key:"consumeAll",value:function consumeAll(){var n,i;var e=this.oldSelectRect;if(!((n=this.selectIds)!=null&&n.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,Fe,!1),(i=this.selectIds)!=null&&i.length&&(e=this.selectedByIds(this.selectIds)),e){var s=this.getChildrenPoints();return _objectSpread({type:xt.Select,dataType:Kt.Local,rect:this.oldSelectRect,selectIds:this.selectIds,selectorColor:this.selectorColor,selectRect:this.oldSelectRect,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:s,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}return _objectSpread({type:xt.Select,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPointsForSubWorker",value:function updateTempPointsForSubWorker(e){var n=e.slice(-2),i=new _t(n[0],n[1]);if(this.subTmpPoints[0].isNear(i,1))return!1;if(this.subTmpPoints.length===2){if(i.isNear(this.subTmpPoints[1],1))return!1;this.subTmpPoints[1]=i;}else this.subTmpPoints.push(i);return!0;}},{key:"computDrawPoints",value:function computDrawPoints(e){var n=this.workOptions.thickness,i=[];var _iterator39=_createForOfIteratorHelper(e),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var a=_step39.value;i.push(_construct(Ct,_toConsumableArray(a)));}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}var s=$e(i,n),o=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:o,points:i.map(function(a){return a.XY;}).flat(1)};}},{key:"drawForSubWorker",value:function drawForSubWorker(e){var n=e.workId,i=e.layer,s=e.ps,_this$workOptions6=this.workOptions,o=_this$workOptions6.strokeColor,a=_this$workOptions6.scale,u=_this$workOptions6.rotate,d=_this$workOptions6.translate,v=i.worldPosition,p=i.worldScaling,_this$computDrawPoint2=this.computDrawPoints(s),w=_this$computDrawPoint2.points,A=_this$computDrawPoint2.rect,M=_this$computDrawPoint2.pos,E=1/i.worldScaling[0],L=o&&WCt(o)||[0,0,0,0],G={close:!0,normalize:!0,points:w,lineWidth:E,fillColor:f1(L[0],L[1],L[2],0.1),strokeColor:f1(L[0],L[1],L[2],1),lineJoin:"round",lineCap:"round"};var z={x:Math.floor(A.x*p[0]+v[0]-jt.SafeBorderPadding),y:Math.floor(A.y*p[1]+v[1]-jt.SafeBorderPadding),w:Math.floor(A.w*p[0]+2*jt.SafeBorderPadding),h:Math.floor(A.h*p[0]+2*jt.SafeBorderPadding)};var et=new ar({name:n,id:n,pos:M,anchor:[0.5,0.5],size:[A.w,A.h],scale:a,rotate:u,translate:d}),x=new Un(_objectSpread(_objectSpread({},G),{},{pos:[0,0]}));if(et.appendChild(x),this.replace(i,n,et),a||u||d){var y=et.getBoundingClientRect();z={x:Math.floor(y.x-jt.SafeBorderPadding),y:Math.floor(y.y-jt.SafeBorderPadding),w:Math.floor(y.width+2*jt.SafeBorderPadding),h:Math.floor(y.height+2*jt.SafeBorderPadding)};}return z;}},{key:"transformData",value:function transformData(e){var n=$e(e);return[[n.x,n.y,0],[n.x+n.w,n.y,0],[n.x+n.w,n.y+n.h,0],[n.x,n.y+n.h,0]];}},{key:"subWorkerConsume",value:function subWorkerConsume(e){var n=e.data,i=e.isFullWork,s=n.op,o=n.syncUnitTime;o&&(this.syncUnitTime=o);var a=s==null?void 0:s.length;if(!a||a<2)return{type:xt.None,rect:void 0};var u;if(this.subTmpPoints.length===0?(this.subTmpPoints=[new _t(s[0],s[1])],u=!1):u=this.updateTempPointsForSubWorker(s),!u)return{type:xt.None,rect:void 0};var d=this.transformData(this.subTmpPoints),v=i?this.fullLayer:this.drawLayer||this.fullLayer,p=this.drawForSubWorker({ps:d,workId:this.workId,layer:v}),w=Jt(p,this.oldSubSelectRect);return this.oldSubSelectRect=p,_objectSpread({rect:w,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"subWorkerConsumeAll",value:function subWorkerConsumeAll(e){var n=e.isFullWork,i=n?this.fullLayer:this.drawLayer||this.fullLayer;return this.replace(i,this.workId),_objectSpread({rect:this.oldSelectRect,type:xt.FullWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"clearSubTmpPoints",value:function clearSubTmpPoints(){this.subTmpPoints.length=0;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.clearSubTmpPoints();}},{key:"clearSubSelectData",value:function clearSubSelectData(){this.oldSubSelectRect=void 0;}},{key:"clearSelectData",value:function clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0,this.clearSubSelectData();}},{key:"selectSingleTool",value:function selectSingleTool(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Fe;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(e.length===2){var s=e[0],o=e[1];var a;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:s,y:o,w:0,h:0},!1),u=_this$vNodes$getRectI2.nodeRange,d=_toConsumableArray(u.values()).sort(function(v,p){return(p.opt.zIndex||0)-(v.opt.zIndex||0);});var _iterator40=_createForOfIteratorHelper(d),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var _v8=_step40.value;var _p3=this.fullLayer.getElementsByName(_v8.name);if(ZS(_p3).find(function(A){return A.isPointCollision(s,o);})){a=_v8;break;}}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}if(a){var v=a.name;if(!qn(this.oldSelectRect,a.rect)){var p=/* @__PURE__ */new Map([[v,a]]);this.getSelecteorInfo(p),this.draw(n,this.fullLayer,{intersectRect:a.rect,subNodeMap:p,selectIds:this.selectIds||[]},i);}this.selectIds=[v],this.oldSelectRect=a.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var e;var _iterator41=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var _step41$value=_slicedToArray(_step41.value,2),n=_step41$value[0],i=_step41$value[1];i.isSelected&&(e=Jt(e,i.rect),this.vNodes.unSelected(n));}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}return e;}},{key:"unSelectedByIds",value:function unSelectedByIds(e){var n;var _iterator42=_createForOfIteratorHelper(e),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var i=_step42.value;var s=this.vNodes.get(i);s&&s.isSelected&&(n=Jt(n,s.rect),this.vNodes.unSelected(i));}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}return n;}},{key:"selectedByIds",value:function selectedByIds(e){var n;var _iterator43=_createForOfIteratorHelper(e),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var i=_step43.value;var s=this.vNodes.get(i);s&&(n=Jt(n,s.rect),this.vNodes.selected(i));}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}return n;}},{key:"getSelectorRect",value:function getSelectorRect(e,n){var a;var i;var s=(a=e.parent)==null?void 0:a.getElementById(n),o=s==null?void 0:s.getBoundingClientRect();return o&&(i=Jt(i,{x:Math.floor(o.x),y:Math.floor(o.y),w:Math.floor(o.width+1),h:Math.floor(o.height+1)})),i;}},{key:"isCanFillColor",value:function isCanFillColor(e){return e===It.Ellipse||e===It.Triangle||e===It.Rectangle||e===It.Polygon||e===It.Star||e===It.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12(e){var n,i,s,o,a,u,d,v,p,w,A,M,E,L,G,z,_iterator44,_step44,y,S,C,P,X,$,K,j,nt,ct,F,R,et,_y4,_S0,_C6,x,_t13,_t14,_t15;return _regenerator().w(function(_context13){while(1)switch(_context13.p=_context13.n){case 0:n=e.updateSelectorOpt,i=e.selectIds,s=e.vNodes,o=e.willSerializeData,a=e.worker,u=e.offset,d=this.fullLayer;if(d){_context13.n=1;break;}return _context13.a(2);case 1:p=/* @__PURE__ */new Map(),w=n.originPoint,A=n.workState,M=n.angle,E=n.translate,L=n.dir,G=n.scale;u&&(E?n.translate=[E[0]+u[0],E[1]+u[1]]:n.translate=u);if(!(w||E||Ze(M))){_context13.n=3;break;}if(!(A===te.Start&&i)){_context13.n=2;break;}return _context13.a(2,(s.setTargetAssignKeys(i),{type:xt.Select,dataType:Kt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 2:if(!(z=s.getLastTarget(),!z)){_context13.n=3;break;}return _context13.a(2);case 3:if(!i){_context13.n=18;break;}_iterator44=_createForOfIteratorHelper(i);_context13.p=4;_iterator44.s();case 5:if((_step44=_iterator44.n()).done){_context13.n=15;break;}y=_step44.value;S=s.get(y);if(!S){_context13.n=14;break;}C=S.toolsType,P=S.opt,X=(d==null?void 0:d.getElementsByName(y))[0];if(!X){_context13.n=14;break;}$=_objectSpread({},n);K=void 0;j=jt.isWillRefresh({toolsType:C,opt:P,updateOpt:$,vNodes:s,node:X,willSerializeData:o});if(!C){_context13.n=14;break;}K=z==null?void 0:z.get(y);nt=VS(C);nt==null||nt.updateNodeOpt({node:X,opt:$,vNodes:s,willSerializeData:o,targetNode:K});ct=s.get(y)||S;if(!(ct&&a&&j)){_context13.n=13;break;}F=a.createWorkShapeNode({workId:y,toolsType:C,toolsOpt:ct.opt});F==null||F.setWorkId(y);R=void 0;if(!(C===It.BackgroundSVG)){_context13.n=6;break;}R=F.consumeService({isFullWork:!0,replaceId:y});_context13.n=12;break;case 6:if(!(C===It.Image)){_context13.n=8;break;}_context13.n=7;return F.consumeServiceAsync({isFullWork:!0,replaceId:y,worker:a});case 7:R=_context13.v;_context13.n=12;break;case 8:if(!(C===It.Text)){_context13.n=10;break;}_context13.n=9;return F.consumeServiceAsync({isFullWork:!0,replaceId:y,isDrawLabel:!0});case 9:R=_context13.v;_context13.n=12;break;case 10:_context13.p=10;R=F==null?void 0:F.consumeService({op:ct.op,isFullWork:!0,replaceId:y,workState:A});_context13.n=12;break;case 11:_context13.p=11;_t13=_context13.v;console.error("consumeService error",_t13);return _context13.a(3,14);case 12:R&&(ct.rect=R);case 13:ct&&(p.set(y,ct),v=Jt(v,ct.rect));case 14:_context13.n=5;break;case 15:_context13.n=17;break;case 16:_context13.p=16;_t14=_context13.v;_iterator44.e(_t14);case 17:_context13.p=17;_iterator44.f();return _context13.f(17);case 18:z&&A===te.Done&&(s.deleteLastTarget(),z=void 0);et=v;if(!(w&&E&&G&&L&&et&&!u)){_context13.n=25;break;}_y4=[[et.x,et.y],[et.x+et.w,et.y],[et.x+et.w,et.y+et.h],[et.x,et.y+et.h]];_t15=L;_context13.n=_t15==="top"?19:_t15==="topLeft"?19:_t15==="left"?19:_t15==="topRight"?20:_t15==="right"?21:_t15==="bottomRight"?21:_t15==="bottom"?21:_t15==="bottomLeft"?22:23;break;case 19:E[0]>0&&E[1]>0?_S0=_y4[0]:E[0]>0?_S0=_y4[3]:E[1]>0?_S0=_y4[1]:_S0=_y4[2];return _context13.a(3,23);case 20:E[0]<0&&E[1]>0?_S0=_y4[1]:E[0]<0?_S0=_y4[2]:E[1]>0?_S0=_y4[0]:_S0=_y4[3];return _context13.a(3,23);case 21:E[0]<0&&E[1]<0?_S0=_y4[2]:E[0]<0?_S0=_y4[1]:E[1]<0?_S0=_y4[3]:_S0=_y4[0];return _context13.a(3,23);case 22:E[0]>0&&E[1]<0?_S0=_y4[3]:E[0]>0?_S0=_y4[0]:E[1]<0?_S0=_y4[2]:_S0=_y4[1];return _context13.a(3,23);case 23:_C6=_S0&&[w[0]-_S0[0],w[1]-_S0[1]]||[0,0];if(qn(_C6,[0,0])){_context13.n=25;break;}_context13.n=24;return this.updateSelector(_objectSpread(_objectSpread({},e),{},{updateSelectorOpt:{workState:A},offset:_C6}));case 24:return _context13.a(2,_context13.v);case 25:this.getSelecteorInfo(p),this.draw(Fe,d,{selectIds:i||[],subNodeMap:p,intersectRect:et});x=Jt(this.oldSelectRect,et);return _context13.a(2,(this.oldSelectRect=et,{type:xt.Select,dataType:Kt.Local,selectRect:et,renderRect:v,rect:Jt(x,et),selectIds:i}));}},_callee12,this,[[10,11],[4,16,17,18]]);}));function updateSelector(_x18){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var e=this.unSelectedAllIds();return{type:xt.Select,dataType:Kt.Local,rect:e,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(e){return e.replace(Oo,"-");}},{key:"selectServiceNode",value:function selectServiceNode(e,n,i){var _this49=this;var s=n.selectIds,o=this.getRightServiceId(e),a=this.getSelectorRect(this.fullLayer,o);var u;var d=/* @__PURE__ */new Map();return s==null||s.forEach(function(v){var p=_this49.vNodes.get(v);p&&(u=Jt(u,p.rect),d.set(v,p));}),this.getSelecteorInfo(d),this.draw(o,this.fullLayer,{intersectRect:u,selectIds:s||[],subNodeMap:d},i),Jt(u,a);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this50=this;var i;var e;var n=/* @__PURE__ */new Map();return(i=this.selectIds)==null||i.forEach(function(s){var o=_this50.vNodes.get(s);o&&(e=Jt(e,o.rect),n.set(s,o));},this),this.getSelecteorInfo(n),this.draw(Fe,this.fullLayer,{intersectRect:e,subNodeMap:n,selectIds:this.selectIds||[]}),this.oldSelectRect=e,e;}},{key:"updateSelectIds",value:function updateSelectIds(e){var o;var n;var i=(o=this.selectIds)==null?void 0:o.filter(function(a){return!e.includes(a);});if(i!=null&&i.length&&(n=this.unSelectedByIds(i)),e.length){var a=this.selectedByIds(e);n=Jt(n,a);}this.selectIds=e;var s=this.reRenderSelector();return{bgRect:n,selectRect:s};}},{key:"cursorHover",value:function cursorHover(e){var o,a;var n=this.oldSelectRect;this.selectIds=[];var i=(o=this.workId)==null?void 0:o.toString(),s=[e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],e[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(s,i,!0),this.oldSelectRect&&!qn(n,this.oldSelectRect))return{type:xt.CursorHover,dataType:Kt.Local,rect:Jt(n,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((a=this.selectIds)!=null&&a.length||(this.oldSelectRect=void 0),n&&!this.oldSelectRect)return this.cursorBlur(),{type:xt.CursorHover,dataType:Kt.Local,rect:n,selectorColor:this.selectorColor,willSyncService:!1};}},{key:"cursorBlur",value:function cursorBlur(){var n,i;this.selectIds=[];var e=(n=this.workId)==null?void 0:n.toString();((i=this.fullLayer)==null?void 0:i.parent).children.forEach(function(s){s.name===e&&s.remove();});}}]);}(jt);wt(Cu,"selectorBorderId","selector-border");var Xa=Cu;var PS=/*#__PURE__*/function(_jt5){function PS(e){var _this51;_classCallCheck(this,PS);_this51=_callSuper(this,PS,[e]);wt(_this51,"canRotate",!1);wt(_this51,"scaleType",be.both);wt(_this51,"toolsType",It.Arrow);wt(_this51,"tmpPoints",[]);wt(_this51,"workOptions");wt(_this51,"oldRect");wt(_this51,"arrowTipWidth");wt(_this51,"syncTimestamp");_this51.workOptions=e.toolsOpt,_this51.arrowTipWidth=_this51.workOptions.thickness*4,_this51.syncTimestamp=0,_this51.syncUnitTime=50;return _this51;}_inherits(PS,_jt5);return _createClass(PS,[{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=this.workId,v=n.op,p=n.syncUnitTime;p&&(this.syncUnitTime=p);var w=v==null?void 0:v.length;if(!w||w<2)return{type:xt.None};var A;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],A=!1):A=this.updateTempPoints(v),!A)return{type:xt.None};var M;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({workId:d,layer:L});}if(u){var _L5=Jt(M,this.oldRect);this.oldRect=M;var G=_objectSpread({rect:_L5,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=this.tmpPoints.map(function(et){return[].concat(_toConsumableArray(et.XY),[0]);}).flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L6=Date.now();return _L6-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L6,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(G){return[].concat(_toConsumableArray(G.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:xt.None};}var E=Jt(M,this.oldRect);return this.oldRect=M,_objectSpread(_objectSpread({rect:E},this.baseConsumeResult),{},{type:xt.DrawWork,dataType:Kt.Local});}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i},this.baseConsumeResult),{},{type:xt.FullWork,dataType:Kt.Local,ops:o,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,s=e.isDrawEraserlines,_this$workOptions7=this.workOptions,o=_this$workOptions7.strokeColor,a=_this$workOptions7.thickness,u=_this$workOptions7.zIndex,d=_this$workOptions7.scale,v=_this$workOptions7.rotate,p=_this$workOptions7.translate,w=_this$workOptions7.strokeType,A=_this$workOptions7.eraserlines,M=_this$workOptions7.eraserFaces,E=_this$workOptions7.doingLines,L=_this$workOptions7.lineDash,G=_this$workOptions7.lineCap,z=i.worldPosition,et=i.worldScaling,_this$computDrawPoint3=this.computDrawPoints(a),x=_this$computDrawPoint3.points,y=_this$computDrawPoint3.pos,S=_this$computDrawPoint3.rect,C=_this$computDrawPoint3.isTriangle,P=_this$computDrawPoint3.trianglePoints,X=_this$computDrawPoint3.trianglePos,$=[S.x+S.w/2,S.y+S.h/2],K={pos:$,name:n,id:n,zIndex:u,anchor:[0.5,0.5],size:[S.w,S.h]};d&&(K.scale=d),v&&(K.rotate=v),p&&(K.translate=p);var j=new ar(K),nt={points:P,pos:[X[0]-$[0],X[1]-$[1]],fillColor:o,strokeColor:o,lineWidth:0,normalize:!1},ct=new Un(nt);if(j.append(ct),!C&&x&&y){var R={points:x,pos:[y[0]-$[0],y[1]-$[1]],fillColor:o,strokeColor:o,lineDash:w===Re.Dotted?[L&&L[0]||1,(L&&L[1]||2)*a]:w===Re.LongDotted?[(L&&L[0]||1)*a,(L&&L[1]||2)*a]:void 0,lineCap:w===Re.Normal?void 0:G,lineWidth:a,normalize:!1},Y=new Un(R);j.append(Y);}(A||M||E)&&(this.scaleType=be.proportional,this.drawEraserlines({group:j,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:M,pos:$,layer:i},s)),this.replace(i,n,j);var F={x:Math.floor(S.x*et[0]+z[0]-jt.SafeBorderPadding),y:Math.floor(S.y*et[1]+z[1]-jt.SafeBorderPadding),w:Math.floor(S.w*et[0]+2*jt.SafeBorderPadding),h:Math.floor(S.h*et[1]+2*jt.SafeBorderPadding)};if(d||v||p){var _R2=j.getBoundingClientRect();F={x:Math.floor(_R2.x-jt.SafeBorderPadding),y:Math.floor(_R2.y-jt.SafeBorderPadding),w:Math.floor(_R2.width+jt.SafeBorderPadding*2),h:Math.floor(_R2.height+jt.SafeBorderPadding*2)};}return this.isDelete&&j.setAttribute("opacity",0),F;}},{key:"computDrawPoints",value:function computDrawPoints(e){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(e):this.computTrianglePoints();}},{key:"computFullArrowPoints",value:function computFullArrowPoints(e){var _this52=this;var n=Ct.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),i=Ct.Per(n).mul(e/2),s=_t.Sub(this.tmpPoints[0],i),o=_t.Add(this.tmpPoints[0],i),a=Ct.Mul(n,this.arrowTipWidth),u=Ct.Sub(this.tmpPoints[1],a),d=_t.Sub(u,i),v=_t.Add(u,i),p=Ct.Per(n).mul(e*1.5),w=_t.Sub(u,p),A=_t.Add(u,p),M=[this.tmpPoints[0],u],E=[w,this.tmpPoints[1],A],L=[s,o].concat(E,[d,v]);return{trianglePoints:E.map(function(G){return _t.Sub(G,_this52.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:M.map(function(G){return _t.Sub(G,_this52.tmpPoints[0]).XY;}).flat(1),rect:$e(L),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this53=this;var e=Ct.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=this.tmpPoints[1].distance(this.tmpPoints[0]),i=Ct.Per(e).mul(Math.floor(n*3/8)),s=_t.Sub(this.tmpPoints[0],i),o=_t.Add(this.tmpPoints[0],i),a=[s,this.tmpPoints[1],o];return{trianglePoints:a.map(function(u){return _t.Sub(u,_this53.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:$e(a),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState2=e.workState,s=_e$workState2===void 0?te.Done:_e$workState2,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var d,v;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.strokeType,u=s.get(n.name);return o&&(n.tagName==="GROUP"?n.children.forEach(function(p){p.setAttribute("strokeColor",o),p.getAttribute("fillColor")&&p.setAttribute("fillColor",o);}):(n.setAttribute("strokeColor",o),n.setAttribute("fillColor",o)),(d=u==null?void 0:u.opt)!=null&&d.strokeColor&&(u.opt.strokeColor=o)),a&&u!=null&&u.opt&&(v=u.opt)!=null&&v.strokeType&&(u.opt.strokeType=a),u&&s.setInfo(n.name,u),jt.updateNodeOpt(e);}}]);}(jt);var AS=/*#__PURE__*/function(_jt6){function AS(e){var _this54;_classCallCheck(this,AS);_this54=_callSuper(this,AS,[e]);wt(_this54,"canRotate",!1);wt(_this54,"scaleType",be.all);wt(_this54,"toolsType",It.Ellipse);wt(_this54,"tmpPoints",[]);wt(_this54,"workOptions");wt(_this54,"oldRect");wt(_this54,"syncTimestamp");_this54.workOptions=e.toolsOpt,_this54.syncTimestamp=0,_this54.syncUnitTime=50;return _this54;}_inherits(AS,_jt6);return _createClass(AS,[{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=this.workId,v=n.op,p=n.syncUnitTime;p&&(this.syncUnitTime=p);var w=v==null?void 0:v.length;if(!w||w<2)return{type:xt.None};var A;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],A=!1):A=this.updateTempPoints(v),!A)return{type:xt.None};var M;if(s||o||u){var E=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({workId:d,layer:E,isDrawing:!0});var L=E.parent.parent,G={x:0,y:0,w:Math.floor(L.width),h:Math.floor(L.height)},z=_objectSpread({type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(qa(M,G)!==Ji.outside){var x=Jt(M,this.oldRect);if(this.oldRect=M,z.rect=x,!u)return z;}if(u){var _x19=Date.now();return _x19-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_x19,z.op=this.tmpPoints.map(function(y){return[].concat(_toConsumableArray(y.XY),[0]);}).flat(1),z.index=0,z.isSync=!0),z;}return{type:xt.None};}if(!s&&!o&&!u&&a){var _E2=Date.now();return _E2-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_E2,_objectSpread(_objectSpread({type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(L){return[].concat(_toConsumableArray(L.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:xt.None};}return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n,isDrawing:!1});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:i&&jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:xt.FullWork,dataType:Kt.Local},this.baseConsumeResult),{},{ops:o,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,s=e.isDrawing,o=e.isDrawEraserlines,_this$workOptions8=this.workOptions,a=_this$workOptions8.strokeColor,u=_this$workOptions8.fillColor,d=_this$workOptions8.thickness,v=_this$workOptions8.zIndex,p=_this$workOptions8.scale,w=_this$workOptions8.rotate,A=_this$workOptions8.translate,M=_this$workOptions8.strokeType,E=_this$workOptions8.eraserlines,L=_this$workOptions8.eraserFaces,G=_this$workOptions8.doingLines,z=_this$workOptions8.lineDash,et=_this$workOptions8.lineCap,x=i.worldScaling,_this$computDrawPoint4=this.computDrawPoints(d),y=_this$computDrawPoint4.radius,S=_this$computDrawPoint4.rect,C=_this$computDrawPoint4.pos,P={closeType:"normal",radius:y,lineWidth:d,fillColor:u!=="transparent"&&u||void 0,strokeColor:a,normalize:!0,lineCap:et,lineDash:M===Re.Dotted?[z&&z[0]||1,(z&&z[1]||2)*d]:M===Re.LongDotted?[(z&&z[0]||1)*d,(z&&z[1]||2)*d]:void 0},X={name:n,id:n,zIndex:v,pos:C,anchor:[0.5,0.5],size:[S.w,S.h]};p&&(X.scale=p),w&&(X.rotate=w),A&&(X.translate=A);var $=new ar(X);if(s){var nt=new Qr({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/x[0],1/x[1]]});$.append(nt);}var K=new _p(_objectSpread(_objectSpread({},P),{},{pos:[0,0]}));$.append(K),(E||L||G)&&(this.scaleType=be.proportional,this.drawEraserlines({group:$,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:L,pos:C,layer:i},o)),this.replace(i,n,$);var j=$.getBoundingClientRect();return this.isDelete&&$.setAttribute("opacity",0),{x:Math.floor(j.x-jt.SafeBorderPadding),y:Math.floor(j.y-jt.SafeBorderPadding),w:Math.floor(j.width+jt.SafeBorderPadding*2),h:Math.floor(j.height+jt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(e){var n=$e(this.tmpPoints),i=$e(this.tmpPoints,e),s=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)];return{rect:i,pos:s,radius:[Math.floor(n.w/2),Math.floor(n.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState3=e.workState,s=_e$workState3===void 0?te.Done:_e$workState3,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var p,w,A;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.fillColor,u=i.strokeType,d=s.get(n.name);var v=n;return n.tagName==="GROUP"&&(v=n.children[0]),o&&(v.setAttribute("strokeColor",o),(p=d==null?void 0:d.opt)!=null&&p.strokeColor&&(d.opt.strokeColor=o)),a&&(a==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",a),(w=d==null?void 0:d.opt)!=null&&w.fillColor&&(d.opt.fillColor=a)),u&&d!=null&&d.opt&&(A=d.opt)!=null&&A.strokeType&&(d.opt.strokeType=u),d&&s.setInfo(n.name,d),jt.updateNodeOpt(e);}}]);}(jt);var bS=/*#__PURE__*/function(_jt7){function bS(e){var _this55;_classCallCheck(this,bS);_this55=_callSuper(this,bS,[e]);wt(_this55,"canRotate",!0);wt(_this55,"scaleType",be.all);wt(_this55,"toolsType",It.Rectangle);wt(_this55,"tmpPoints",[]);wt(_this55,"workOptions");wt(_this55,"oldRect");wt(_this55,"syncTimestamp");_this55.workOptions=e.toolsOpt,_this55.syncTimestamp=0,_this55.syncUnitTime=50;return _this55;}_inherits(bS,_jt7);return _createClass(bS,[{key:"transformData",value:function transformData(){var e=$e(this.tmpPoints);return[[e.x,e.y,0],[e.x+e.w,e.y,0],[e.x+e.w,e.y+e.h,0],[e.x,e.y+e.h,0]];}},{key:"computDrawPoints",value:function computDrawPoints(e){var n=this.workOptions.thickness,i=[];var _iterator45=_createForOfIteratorHelper(e),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var a=_step45.value;i.push(_construct(Ct,_toConsumableArray(a)));}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}var s=$e(i,n),o=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:o,points:i.map(function(a){return a.XY;}).flat(1)};}},{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=this.workId,v=n.op,p=v==null?void 0:v.length;if(!p||p<2)return{type:xt.None};var w;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],w=!1):w=this.updateTempPoints(v),!w)return{type:xt.None};var A=this.transformData();var M;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({ps:A,workId:d,layer:L,isDrawing:!0});}if(u){var _L7=Jt(M,this.oldRect);this.oldRect=M;var G=_objectSpread({rect:_L7,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=A.flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L8=Date.now();return _L8-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L8,_objectSpread({type:xt.DrawWork,dataType:Kt.Local,op:A.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var E=Jt(M,this.oldRect);return this.oldRect=M,_objectSpread({rect:E,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var u;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.transformData(),i=this.fullLayer,s=this.draw({ps:n,workId:e,layer:i,isDrawing:!1});this.oldRect=s;var o=n.flat(1),a=Br(o);return(u=this.vNodes)==null||u.setInfo(e,{rect:s,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&jt.getCenterPos(s,i)}),_objectSpread(_objectSpread({rect:s,type:xt.FullWork,dataType:Kt.Local,ops:a,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,s=e.isDrawing,o=e.ps,a=e.replaceId,_e$isDrawEraserlines2=e.isDrawEraserlines,u=_e$isDrawEraserlines2===void 0?!0:_e$isDrawEraserlines2,_this$workOptions9=this.workOptions,d=_this$workOptions9.strokeColor,v=_this$workOptions9.fillColor,p=_this$workOptions9.thickness,w=_this$workOptions9.zIndex,A=_this$workOptions9.scale,M=_this$workOptions9.rotate,E=_this$workOptions9.translate,L=_this$workOptions9.strokeType,G=_this$workOptions9.eraserlines,z=_this$workOptions9.eraserFaces,et=_this$workOptions9.doingLines,x=_this$workOptions9.lineCap,y=_this$workOptions9.lineDash,S=i.worldPosition,C=i.worldScaling,_this$computDrawPoint5=this.computDrawPoints(o),P=_this$computDrawPoint5.points,X=_this$computDrawPoint5.rect,$=_this$computDrawPoint5.pos,K={close:!0,normalize:!0,points:P,lineWidth:p,fillColor:v!=="transparent"&&v||void 0,strokeColor:d,lineCap:x,lineDash:L===Re.Dotted?[y&&y[0]||1,(y&&y[1]||2)*p]:L===Re.LongDotted?[(y&&y[0]||1)*p,(y&&y[1]||2)*p]:void 0};var j={x:Math.floor(X.x*C[0]+S[0]-jt.SafeBorderPadding),y:Math.floor(X.y*C[1]+S[1]-jt.SafeBorderPadding),w:Math.floor(X.w*C[0]+2*jt.SafeBorderPadding),h:Math.floor(X.h*C[0]+2*jt.SafeBorderPadding)};var nt=new ar({name:n,id:n,zIndex:w,pos:$,anchor:[0.5,0.5],size:[X.w,X.h],scale:A,rotate:M,translate:E}),ct=new Un(_objectSpread(_objectSpread({},K),{},{pos:[0,0]}));if(nt.appendChild(ct),s){var F=new Qr({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:d,lineWidth:1,scale:[1/C[0],1/C[1]]});nt.appendChild(F);}if((G||z||et)&&(this.scaleType=be.proportional,this.drawEraserlines({group:nt,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:z,pos:$,layer:i},u)),this.replace(i,a||n,nt),A||M||E){var _F2=nt.getBoundingClientRect();j={x:Math.floor(_F2.x-jt.SafeBorderPadding),y:Math.floor(_F2.y-jt.SafeBorderPadding),w:Math.floor(_F2.width+2*jt.SafeBorderPadding),h:Math.floor(_F2.height+2*jt.SafeBorderPadding)};}return this.isDelete&&nt.setAttribute("opacity",0),j;}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var p,w;var n=e.op,i=e.isFullWork,s=e.replaceId,_e$workState4=e.workState,o=_e$workState4===void 0?te.Done:_e$workState4,a=(p=this.workId)==null?void 0:p.toString();if(!a)return;var u=[];for(var A=0;A<n.length;A+=3)u.push([n[A],n[A+1],n[A+2]]);var d=i?this.fullLayer:this.drawLayer||this.fullLayer,v=this.draw({ps:u,workId:a,layer:d,isDrawing:!1,replaceId:s,isDrawEraserlines:o===te.Done});return this.oldRect=v,(w=this.vNodes)==null||w.setInfo(a,{rect:v,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:v&&jt.getCenterPos(v,d)}),v;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var p,w,A;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.fillColor,u=i.strokeType,d=s.get(n.name);var v=n;return n.tagName==="GROUP"&&(v=n.children[0]),o&&(v.setAttribute("strokeColor",o),(p=d==null?void 0:d.opt)!=null&&p.strokeColor&&(d.opt.strokeColor=o)),a&&(a==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",a),(w=d==null?void 0:d.opt)!=null&&w.fillColor&&(d.opt.fillColor=a)),u&&d!=null&&d.opt&&(A=d.opt)!=null&&A.strokeType&&(d.opt.strokeType=u),d&&s.setInfo(n.name,d),jt.updateNodeOpt(e);}}]);}(jt);var MS=/*#__PURE__*/function(_jt8){function MS(e){var _this56;_classCallCheck(this,MS);_this56=_callSuper(this,MS,[e]);wt(_this56,"canRotate",!1);wt(_this56,"scaleType",be.all);wt(_this56,"toolsType",It.Star);wt(_this56,"tmpPoints",[]);wt(_this56,"workOptions");wt(_this56,"oldRect");wt(_this56,"syncTimestamp");_this56.workOptions=e.toolsOpt,_this56.syncTimestamp=0,_this56.syncUnitTime=50;return _this56;}_inherits(MS,_jt8);return _createClass(MS,[{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=this.workId,v=n.op,p=n.syncUnitTime,w=v==null?void 0:v.length;if(!w||w<2)return{type:xt.None};p&&(this.syncUnitTime=p);var A;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],A=!1):A=this.updateTempPoints(v),!A)return{type:xt.None};var M;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({workId:d,layer:L,isDrawing:!0});}if(u){var _L9=Jt(M,this.oldRect);this.oldRect=M;var G=_objectSpread({rect:_L9,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=this.tmpPoints.map(function(et){return[].concat(_toConsumableArray(et.XY),[0]);}).flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L0=Date.now();return _L0-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L0,_objectSpread({type:xt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(G){return[].concat(_toConsumableArray(G.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var E=Jt(M,this.oldRect);return this.oldRect=M,_objectSpread({rect:E,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n,isDrawing:!1});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:xt.FullWork,dataType:Kt.Local,ops:o,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,s=e.isDrawing,_e$isDrawEraserlines3=e.isDrawEraserlines,o=_e$isDrawEraserlines3===void 0?!0:_e$isDrawEraserlines3,_this$workOptions0=this.workOptions,a=_this$workOptions0.strokeColor,u=_this$workOptions0.fillColor,d=_this$workOptions0.thickness,v=_this$workOptions0.zIndex,p=_this$workOptions0.vertices,w=_this$workOptions0.innerVerticeStep,A=_this$workOptions0.innerRatio,M=_this$workOptions0.scale,E=_this$workOptions0.rotate,L=_this$workOptions0.translate,G=_this$workOptions0.strokeType,z=_this$workOptions0.eraserlines,et=_this$workOptions0.eraserFaces,x=_this$workOptions0.doingLines,y=_this$workOptions0.lineDash,S=_this$workOptions0.lineCap,C=i.worldScaling,_this$computDrawPoint6=this.computDrawPoints(d,p,w,A),P=_this$computDrawPoint6.rect,X=_this$computDrawPoint6.pos,$=_this$computDrawPoint6.points,K={close:!0,points:$,lineWidth:d,fillColor:u!=="transparent"&&u||void 0,strokeColor:a,normalize:!0,lineCap:S,lineDash:G===Re.Dotted?[y&&y[0]||1,(y&&y[1]||2)*d]:G===Re.LongDotted?[(y&&y[0]||1)*d,(y&&y[1]||2)*d]:void 0},j={name:n,id:n,zIndex:v,pos:X,anchor:[0.5,0.5],size:[P.w,P.h]};M&&(j.scale=M),E&&(j.rotate=E),L&&(j.translate=L);var nt=new ar(j);if(s){var R=new Qr({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/C[0],1/C[1]]});nt.append(R);}var ct=new Un(_objectSpread(_objectSpread({},K),{},{pos:[0,0]}));nt.append(ct),(z||et||x)&&(this.scaleType=be.proportional,this.drawEraserlines({group:nt,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:et,pos:X,layer:i},o)),this.replace(i,n,nt);var F=nt.getBoundingClientRect();return this.isDelete&&nt.setAttribute("opacity",0),{x:Math.floor(F.x-jt.SafeBorderPadding),y:Math.floor(F.y-jt.SafeBorderPadding),w:Math.floor(F.width+jt.SafeBorderPadding*2),h:Math.floor(F.height+jt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(e,n,i,s){var o=$e(this.tmpPoints),a=[Math.floor(o.x+o.w/2),Math.floor(o.y+o.h/2)],u=KS(o.w,o.h),d=Math.floor(Math.min(o.w,o.h)/2),v=s*d,p=[],w=2*Math.PI/n;for(var M=0;M<n;M++){var E=M*w-0.5*Math.PI;var L=void 0,G=void 0;M%i===1?(L=v*u[0]*Math.cos(E),G=v*u[1]*Math.sin(E)):(L=d*u[0]*Math.cos(E),G=d*u[1]*Math.sin(E),p.push(L,G)),p.push(L,G);}return{rect:$e(this.tmpPoints,e),pos:a,points:p};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o)||_t.Sub(s,i).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState5=e.workState,s=_e$workState5===void 0?te.Done:_e$workState5,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:u&&jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var L;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.fillColor,u=i.toolsType,d=i.vertices,v=i.innerVerticeStep,p=i.innerRatio,w=i.strokeType,A=s.get(n.name),M=A==null?void 0:A.opt;var E=n;return n.tagName==="GROUP"&&(E=n.children[0]),o&&(E.setAttribute("strokeColor",o),M!=null&&M.strokeColor&&(M.strokeColor=o)),a&&(a==="transparent"?E.setAttribute("fillColor","rgba(0,0,0,0)"):E.setAttribute("fillColor",a),M!=null&&M.fillColor&&(M.fillColor=a)),u===It.Star&&(d&&(M.vertices=d),v&&(M.innerVerticeStep=v),p&&(M.innerRatio=p)),w&&A!=null&&A.opt&&(L=A.opt)!=null&&L.strokeType&&(A.opt.strokeType=w),A&&s.setInfo(n.name,_objectSpread(_objectSpread({},A),{},{opt:M})),jt.updateNodeOpt(e);}}]);}(jt);var ES=/*#__PURE__*/function(_jt9){function ES(e){var _this57;_classCallCheck(this,ES);_this57=_callSuper(this,ES,[e]);wt(_this57,"canRotate",!1);wt(_this57,"scaleType",be.all);wt(_this57,"toolsType",It.Polygon);wt(_this57,"tmpPoints",[]);wt(_this57,"workOptions");wt(_this57,"oldRect");wt(_this57,"syncTimestamp");_this57.workOptions=e.toolsOpt,_this57.syncTimestamp=0,_this57.syncUnitTime=50;return _this57;}_inherits(ES,_jt9);return _createClass(ES,[{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=n.op,v=n.syncUnitTime;v&&(this.syncUnitTime=v);var p=this.workId,w=d==null?void 0:d.length;if(!w||w<2)return{type:xt.None};var A;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(d[0],d[1])],A=!1):A=this.updateTempPoints(d),!A)return{type:xt.None};var M;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({workId:p,layer:L,isDrawing:!0});}if(u){var _L1=Jt(M,this.oldRect);this.oldRect=M;var G=_objectSpread({type:xt.DrawWork,rect:_L1,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=this.tmpPoints.map(function(et){return[].concat(_toConsumableArray(et.XY),[0]);}).flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L10=Date.now();return _L10-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L10,_objectSpread({type:xt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(G){return[].concat(_toConsumableArray(G.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var E=Jt(M,this.oldRect);return this.oldRect=M,_objectSpread({rect:E,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n,isDrawing:!1});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:xt.FullWork,dataType:Kt.Local,ops:o,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,s=e.isDrawing,_e$isDrawEraserlines4=e.isDrawEraserlines,o=_e$isDrawEraserlines4===void 0?!0:_e$isDrawEraserlines4,_this$workOptions1=this.workOptions,a=_this$workOptions1.strokeColor,u=_this$workOptions1.fillColor,d=_this$workOptions1.thickness,v=_this$workOptions1.zIndex,p=_this$workOptions1.vertices,w=_this$workOptions1.scale,A=_this$workOptions1.rotate,M=_this$workOptions1.translate,E=_this$workOptions1.strokeType,L=_this$workOptions1.eraserlines,G=_this$workOptions1.eraserFaces,z=_this$workOptions1.doingLines,et=_this$workOptions1.lineCap,x=_this$workOptions1.lineDash,y=i.worldScaling,_this$computDrawPoint7=this.computDrawPoints(d,p),S=_this$computDrawPoint7.rect,C=_this$computDrawPoint7.pos,P=_this$computDrawPoint7.points,X={close:!0,points:P,lineWidth:d,fillColor:u!=="transparent"&&u||void 0,strokeColor:a,normalize:!0,lineCap:et,lineDash:E===Re.Dotted?[x&&x[0]||1,(x&&x[1]||2)*d]:E===Re.LongDotted?[(x&&x[0]||1)*d,(x&&x[1]||2)*d]:void 0},$={name:n,id:n,zIndex:v,pos:C,anchor:[0.5,0.5],size:[S.w,S.h]};w&&($.scale=w),A&&($.rotate=A),M&&($.translate=M);var K=new ar($);if(s){var ct=new Qr({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/y[0],1/y[1]]});K.append(ct);}var j=new Un(_objectSpread(_objectSpread({},X),{},{pos:[0,0]}));K.append(j),(L||G||z)&&(this.scaleType=be.proportional,this.drawEraserlines({group:K,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:G,pos:C,layer:i},o)),this.replace(i,n,K);var nt=K.getBoundingClientRect();return this.isDelete&&K.setAttribute("opacity",0),{x:Math.floor(nt.x-jt.SafeBorderPadding),y:Math.floor(nt.y-jt.SafeBorderPadding),w:Math.floor(nt.width+jt.SafeBorderPadding*2),h:Math.floor(nt.height+jt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(e,n){var i=$e(this.tmpPoints),s=[Math.floor(i.x+i.w/2),Math.floor(i.y+i.h/2)],o=KS(i.w,i.h),a=Math.floor(Math.min(i.w,i.h)/2),u=[],d=2*Math.PI/n;for(var p=0;p<n;p++){var w=p*d-0.5*Math.PI,A=a*o[0]*Math.cos(w),M=a*o[1]*Math.sin(w);u.push(A,M);}return{rect:$e(this.tmpPoints,e),pos:s,points:u};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o)||_t.Sub(s,i).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState6=e.workState,s=_e$workState6===void 0?te.Done:_e$workState6,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:u&&jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var M;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.fillColor,u=i.toolsType,d=i.vertices,v=i.strokeType,p=s.get(n.name),w=p==null?void 0:p.opt;var A=n;return n.tagName==="GROUP"&&(A=n.children[0]),o&&(A.setAttribute("strokeColor",o),w!=null&&w.strokeColor&&(w.strokeColor=o)),a&&(a==="transparent"?A.setAttribute("fillColor","rgba(0,0,0,0)"):A.setAttribute("fillColor",a),w!=null&&w.fillColor&&(w.fillColor=a)),u===It.Polygon&&d&&(w.vertices=d),v&&p!=null&&p.opt&&(M=p.opt)!=null&&M.strokeType&&(p.opt.strokeType=v),p&&s.setInfo(n.name,_objectSpread(_objectSpread({},p),{},{opt:w})),jt.updateNodeOpt(e);}}]);}(jt);var Nn=/*#__PURE__*/function(){function Nn(){_classCallCheck(this,Nn);}return _createClass(Nn,null,[{key:"bezier",value:function bezier(t,e){var n=[];for(var i=0;i<e.length;i+=4){var s=e[i],o=e[i+1],a=e[i+2],u=e[i+3];s&&o&&a&&u?n.push.apply(n,_toConsumableArray(Nn.getBezierPoints(t,s,o,a,u))):s&&o&&a?n.push.apply(n,_toConsumableArray(Nn.getBezierPoints(t,s,o,a))):s&&o?n.push.apply(n,_toConsumableArray(Nn.getBezierPoints(t,s,o))):s&&n.push(s);}return n;}/**
|
|
410
410
|
* @desc 获取点,这里可以设置点的个数
|
|
411
411
|
* @param {number} num 点个数
|
|
412
412
|
* @param {Vec2d} p1 点坐标
|
|
@@ -434,7 +434,7 @@ wt(Ao,"eraserSizes",v0);var pu=Ao;var Rxt="__lodash_hash_undefined__";function N
|
|
|
434
434
|
* @param {Array} p2 终点坐标
|
|
435
435
|
* @param {Array} cp1 控制点1
|
|
436
436
|
* @param {Array} cp2 控制点2
|
|
437
|
-
*/},{key:"threeBezier",value:function threeBezier(t,e,n,i,s){var o=e.x*(1-t)*(1-t)*(1-t)+3*n.x*t*(1-t)*(1-t)+3*i.x*t*t*(1-t)+s.x*t*t*t,a=e.y*(1-t)*(1-t)*(1-t)+3*n.y*t*(1-t)*(1-t)+3*i.y*t*t*(1-t)+s.y*t*t*t;return new Ct(o,a);}}]);}();var LS=/*#__PURE__*/function(_jt0){function LS(e){var _this58;_classCallCheck(this,LS);_this58=_callSuper(this,LS,[e]);wt(_this58,"canRotate",!1);wt(_this58,"scaleType",be.all);wt(_this58,"toolsType",It.SpeechBalloon);wt(_this58,"ratio",0.8);wt(_this58,"tmpPoints",[]);wt(_this58,"workOptions");wt(_this58,"oldRect");wt(_this58,"syncTimestamp");_this58.workOptions=e.toolsOpt,_this58.syncTimestamp=0,_this58.syncUnitTime=50;return _this58;}_inherits(LS,_jt0);return _createClass(LS,[{key:"consume",value:function consume(e){var E;var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=(E=n==null?void 0:n.workId)==null?void 0:E.toString();if(!d)return{type:xt.None};var v=n.op,p=v==null?void 0:v.length;if(!p||p<2)return{type:xt.None};var w;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],w=!1):w=this.updateTempPoints(v),!w)return{type:xt.None};var A;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;A=this.draw({workId:d,layer:L,isDrawing:!0});}if(u){var _L11=Jt(A,this.oldRect);this.oldRect=A;var G=_objectSpread({rect:_L11,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=this.tmpPoints.map(function(et){return[].concat(_toConsumableArray(et.XY),[0]);}).flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L12=Date.now();return _L12-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L12,_objectSpread({type:xt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(G){return[].concat(_toConsumableArray(G.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var M=Jt(A,this.oldRect);return this.oldRect=A,_objectSpread({rect:M,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n,isDrawing:!1});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:xt.FullWork,dataType:Kt.Local,ops:o,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,_e$isDrawEraserlines5=e.isDrawEraserlines,s=_e$isDrawEraserlines5===void 0?!0:_e$isDrawEraserlines5,_this$workOptions10=this.workOptions,o=_this$workOptions10.strokeColor,a=_this$workOptions10.fillColor,u=_this$workOptions10.thickness,d=_this$workOptions10.zIndex,v=_this$workOptions10.placement,p=_this$workOptions10.scale,w=_this$workOptions10.rotate,A=_this$workOptions10.translate,M=_this$workOptions10.strokeType,E=_this$workOptions10.eraserlines,L=_this$workOptions10.eraserFaces,G=_this$workOptions10.doingLines,z=_this$workOptions10.lineDash,et=_this$workOptions10.lineCap,_this$computDrawPoint8=this.computDrawPoints(u,v),x=_this$computDrawPoint8.rect,y=_this$computDrawPoint8.pos,S=_this$computDrawPoint8.points,C={points:S.map(function(j){return j.XY;}),lineWidth:u,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,className:"".concat(y[0],",").concat(y[1]),close:!0,lineCap:et,lineDash:M===Re.Dotted?[z&&z[0]||1,(z&&z[1]||2)*u]:M===Re.LongDotted?[(z&&z[0]||1)*u,(z&&z[1]||2)*u]:void 0},P={name:n,id:n,zIndex:d,pos:y,anchor:[0.5,0.5],size:[x.w,x.h]};p&&(P.scale=p),w&&(P.rotate=w),A&&(P.translate=A);var X=new ar(P),$=new Un(_objectSpread(_objectSpread({},C),{},{pos:[0,0]}));X.append($),(E||L||G)&&(this.scaleType=be.proportional,this.drawEraserlines({group:X,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:L,pos:y,layer:i},s)),this.replace(i,n,X);var K=X.getBoundingClientRect();return this.isDelete&&X.setAttribute("opacity",0),{x:Math.floor(K.x-jt.SafeBorderPadding),y:Math.floor(K.y-jt.SafeBorderPadding),w:Math.floor(K.width+jt.SafeBorderPadding*2),h:Math.floor(K.height+jt.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(e){var n=$e(this.tmpPoints);switch(e){case"bottom":case"bottomLeft":case"bottomRight":{var i=n.y+n.h*this.ratio;return[new Ct(n.x,n.y,0),new Ct(n.x+n.w,n.y,0),new Ct(n.x+n.w,i,0),new Ct(n.x,i,0)];}case"top":case"topLeft":case"topRight":{var _i4=n.y+n.h*(1-this.ratio);return[new Ct(n.x,_i4,0),new Ct(n.x+n.w,_i4,0),new Ct(n.x+n.w,n.y+n.h,0),new Ct(n.x,n.y+n.h,0)];}case"left":case"leftBottom":case"leftTop":{var _i5=n.x+n.w*(1-this.ratio);return[new Ct(_i5,n.y,0),new Ct(n.x+n.w,n.y,0),new Ct(n.x+n.w,n.y+n.h,0),new Ct(_i5,n.y+n.h,0)];}case"right":case"rightBottom":case"rightTop":{var _i6=n.x+n.w*this.ratio;return[new Ct(n.x,n.y,0),new Ct(_i6,n.y,0),new Ct(_i6,n.y+n.h,0),new Ct(n.x,n.y+n.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(e,n){var i=$e(this.tmpPoints),s=this.transformControlPoints(n),o=Math.floor(i.w*0.1),a=Math.floor(i.h*0.1),u=[],d=Ct.Add(s[0],new Ct(0,a,0)),v=Ct.Add(s[0],new Ct(o,0,0)),p=Nn.getBezierPoints(10,d,s[0],v),w=Ct.Sub(s[1],new Ct(o,0,0)),A=Ct.Add(s[1],new Ct(0,a,0)),M=Nn.getBezierPoints(10,w,s[1],A),E=Ct.Sub(s[2],new Ct(0,a,0)),L=Ct.Sub(s[2],new Ct(o,0,0)),G=Nn.getBezierPoints(10,E,s[2],L),z=Ct.Add(s[3],new Ct(o,0,0)),et=Ct.Sub(s[3],new Ct(0,a,0)),x=Nn.getBezierPoints(10,z,s[3],et),y=o*(1-this.ratio)*10,S=a*(1-this.ratio)*10;switch(n){case"bottom":{var X=Ct.Sub(s[2],new Ct(o*5-y/2,0,0)),$=Ct.Sub(s[2],new Ct(o*5,-S,0)),K=Ct.Sub(s[2],new Ct(o*5+y/2,0,0));u.push.apply(u,[$,K].concat(_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),[X]));break;}case"bottomRight":{var _X4=Ct.Sub(s[2],new Ct(o*1.1,0,0)),_$3=Ct.Sub(s[2],new Ct(o*1.1+y/2,-S,0)),_K4=Ct.Sub(s[2],new Ct(o*1.1+y,0,0));u.push.apply(u,[_$3,_K4].concat(_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),[_X4]));break;}case"bottomLeft":{var _X5=Ct.Add(s[3],new Ct(o*1.1+y,0,0)),_$4=Ct.Add(s[3],new Ct(o*1.1+y/2,S,0)),_K5=Ct.Add(s[3],new Ct(o*1.1,0,0));u.push.apply(u,[_$4,_K5].concat(_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),[_X5]));break;}case"top":{var _X6=Ct.Sub(s[1],new Ct(o*5-y/2,0,0)),_$5=Ct.Sub(s[1],new Ct(o*5,S,0)),_K6=Ct.Sub(s[1],new Ct(o*5+y/2,0,0));u.push.apply(u,[_$5,_X6].concat(_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),[_K6]));break;}case"topRight":{var _X7=Ct.Sub(s[1],new Ct(o*1.1,0,0)),_$6=Ct.Sub(s[1],new Ct(o*1.1+y/2,S,0)),_K7=Ct.Sub(s[1],new Ct(o*1.1+y,0,0));u.push.apply(u,[_$6,_X7].concat(_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),[_K7]));break;}case"topLeft":{var _X8=Ct.Add(s[0],new Ct(o*1.1+y,0,0)),_$7=Ct.Add(s[0],new Ct(o*1.1+y/2,-S,0)),_K8=Ct.Add(s[0],new Ct(o*1.1,0,0));u.push.apply(u,[_$7,_X8].concat(_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),[_K8]));break;}case"left":{var _X9=Ct.Add(s[0],new Ct(0,a*5-S/2,0)),_$8=Ct.Add(s[0],new Ct(-y,a*5,0)),_K9=Ct.Add(s[0],new Ct(0,a*5+S/2,0));u.push.apply(u,[_$8,_X9].concat(_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),[_K9]));break;}case"leftTop":{var _X0=Ct.Add(s[0],new Ct(0,a*1.1,0)),_$9=Ct.Add(s[0],new Ct(-y,a*1.1+S/2,0)),_K0=Ct.Add(s[0],new Ct(0,a*1.1+S,0));u.push.apply(u,[_$9,_X0].concat(_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),[_K0]));break;}case"leftBottom":{var _X1=Ct.Sub(s[3],new Ct(0,a*1.1+S,0)),_$0=Ct.Sub(s[3],new Ct(y,a*1.1+S/2,0)),_K1=Ct.Sub(s[3],new Ct(0,a*1.1,0));u.push.apply(u,[_$0,_X1].concat(_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),[_K1]));break;}case"right":{var _X10=Ct.Add(s[1],new Ct(0,a*5-S/2,0)),_$1=Ct.Add(s[1],new Ct(y,a*5,0)),_K10=Ct.Add(s[1],new Ct(0,a*5+S/2,0));u.push.apply(u,[_$1,_K10].concat(_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),[_X10]));break;}case"rightTop":{var _X11=Ct.Add(s[1],new Ct(0,a*1.1,0)),_$10=Ct.Add(s[1],new Ct(y,a*1.1+S/2,0)),_K11=Ct.Add(s[1],new Ct(0,a*1.1+S,0));u.push.apply(u,[_$10,_K11].concat(_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),[_X11]));break;}case"rightBottom":{var _X12=Ct.Sub(s[2],new Ct(0,a*1.1+S,0)),_$11=Ct.Sub(s[2],new Ct(-y,a*1.1+S/2,0)),_K12=Ct.Sub(s[2],new Ct(0,a*1.1,0));u.push.apply(u,[_$11,_K12].concat(_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),[_X12]));break;}}var C=$e(this.tmpPoints,e),P=[Math.floor(C.x+C.w/2),Math.floor(C.y+C.h/2)];return{rect:C,pos:P,points:u};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o)||_t.Sub(s,i).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState7=e.workState,s=_e$workState7===void 0?te.Done:_e$workState7,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:u&&jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var M;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.fillColor,u=i.toolsType,d=i.placement,v=i.strokeType,p=s.get(n.name),w=p==null?void 0:p.opt;var A=n;return n.tagName==="GROUP"&&(A=n.children[0]),o&&(A.setAttribute("strokeColor",o),w!=null&&w.strokeColor&&(w.strokeColor=o)),a&&(a==="transparent"?A.setAttribute("fillColor","rgba(0,0,0,0)"):A.setAttribute("fillColor",a),w!=null&&w.fillColor&&(w.fillColor=a)),u===It.SpeechBalloon&&d&&(w.placement=d),v&&p!=null&&p.opt&&(M=p.opt)!=null&&M.strokeType&&(p.opt.strokeType=v),p&&s.setInfo(n.name,_objectSpread(_objectSpread({},p),{},{opt:w})),jt.updateNodeOpt(e);}}]);}(jt);var FCt=Wo,WCt=Pi,UCt="[object Boolean]";function zCt(r){return r===!0||r===!1||WCt(r)&&FCt(r)==UCt;}var $Ct=zCt;var bs=/* @__PURE__ */zn($Ct);var Ga=/*#__PURE__*/function(_jt1){function Ga(e){var _this59;_classCallCheck(this,Ga);_this59=_callSuper(this,Ga,[e]);wt(_this59,"canRotate",!0);wt(_this59,"scaleType",be.all);wt(_this59,"toolsType",It.Image);wt(_this59,"tmpPoints",[]);wt(_this59,"workOptions");wt(_this59,"oldRect");_this59.workOptions=e.toolsOpt,_this59.scaleType=Ga.getScaleType(_this59.workOptions);return _this59;}_inherits(Ga,_jt1);return _createClass(Ga,[{key:"consume",value:function consume(){return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:xt.None};}},{key:"draw",value:function draw(e){var n=e.layer,i=e.workId,s=e.replaceId,o=e.imageBitmap,_this$workOptions11=this.workOptions,a=_this$workOptions11.centerX,u=_this$workOptions11.centerY,d=_this$workOptions11.width,v=_this$workOptions11.height,p=_this$workOptions11.rotate,w=_this$workOptions11.zIndex,A=_this$workOptions11.eraserlines,M=_this$workOptions11.eraserFaces,E=_this$workOptions11.doingLines,L=new ar({anchor:[0.5,0.5],pos:[a,u],name:i,size:[d,v],zIndex:w,rotate:p}),G={anchor:[0.5,0.5],pos:[0,0],size:[d,v],texture:o};o||(G.bgcolor="rgba(0,0,0,0.3)");var z=new Ju(G);L.append(z),(A||M||E)&&this.drawEraserlines({group:L,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:M,pos:[a,u],layer:n}),this.replace(n,s||i,L);var et=L.getBoundingClientRect();if(et)return{x:Math.floor(et.x-jt.SafeBorderPadding),y:Math.floor(et.y-jt.SafeBorderPadding),w:Math.floor(et.width+jt.SafeBorderPadding*2),h:Math.floor(et.height+jt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13(e){var v,p,w,A,n,i,s,_this$workOptions12,o,a,u,d,M,E;return _regenerator().w(function(_context14){while(1)switch(_context14.n){case 0:n=e.isFullWork,i=e.replaceId,s=e.worker,_this$workOptions12=this.workOptions,o=_this$workOptions12.src,a=_this$workOptions12.uuid,u=((v=this.workId)==null?void 0:v.toString())||a,d=n?this.fullLayer:this.drawLayer||this.fullLayer;if(!o){_context14.n=2;break;}_context14.n=1;return s.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:u,isSubWorker:s instanceof Zbt});case 1:M=_context14.v;if(!M){_context14.n=2;break;}E=this.draw({workId:u,layer:d,replaceId:i,imageBitmap:M});return _context14.a(2,(this.oldRect=u&&((w=(p=this.vNodes)==null?void 0:p.get(u))==null?void 0:w.rect)||void 0,(A=this.vNodes)==null||A.setInfo(u,{rect:E,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:E&&jt.getCenterPos(E,d)}),E));case 2:return _context14.a(2);}},_callee13,this);}));function consumeServiceAsync(_x20){return _consumeServiceAsync.apply(this,arguments);}return consumeServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return jt.normalizeStorageData(e);}},{key:"getScaleType",value:function getScaleType(e){var n=e.uniformScale,i=e.rotate;return n!==!1||i&&Math.abs(i)%90>0?be.proportional:be.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var n=e.node,i=e.opt,s=e.vNodes,o=e.targetNode,a=i.translate,u=i.originPoint,d=i.scenePoint,v=i.scale,p=i.angle,w=i.isLocked,A=i.zIndex,M=i.strokeColor,E=o&&br(o)||s.get(n.name);if(!E)return;var L=n.parent;if(L){if(M&&(E.opt.strokeColor=M),Ze(A)&&(n.setAttribute("zIndex",A),E.opt.zIndex=A),bs(w)&&(E.opt.locked=w),u&&d&&v&&a){var _E$opt=E.opt,G=_E$opt.centerX,z=_E$opt.centerY,et=_E$opt.width,x=_E$opt.height,y=_E$opt.uniformScale,S=y!==!1?[v[0],v[0]]:v,C=[G,z],P=[G,z];uf(P,d,S,a);var X=[P[0]-C[0],P[1]-C[1]];if(E.centerPos=[E.centerPos[0]+X[0],E.centerPos[1]+X[1]],E.opt.width=Math.round(et*S[0]),E.opt.height=Math.round(x*S[1]),E.opt.centerX=P[0],E.opt.centerY=P[1],E.opt.eraserlines){var _iterator46=_createForOfIteratorHelper(E.opt.eraserlines),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var $=_step46.value;var K=$.op,j=$.thickness;$.thickness=Math.round(j*Math.max(v[0],v[1]));for(var nt=0;nt<K.length;nt++)Fa(K[nt],d,v,a);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}}}else if(a){if(E.opt.centerX=E.opt.centerX+a[0],E.opt.centerY=E.opt.centerY+a[1],E.centerPos=[E.centerPos[0]+a[0],E.centerPos[1]+a[1]],E.opt.eraserlines){var _iterator47=_createForOfIteratorHelper(E.opt.eraserlines),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var _G2=_step47.value;var _z2=_G2.op;for(var _et2=0;_et2<_z2.length;_et2++){var _x21=_z2[_et2].map(function(y,S){return S%2?y+a[1]:y+a[0];});_G2.op[_et2]=_x21;}}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}}}else if(Ze(p))if(E.opt.rotate=p,E.scaleType=Ga.getScaleType(E.opt),o){var _G3=T0(E.rect,p);E.rect=_G3;}else{var _G4=jt.getRectFromLayer(L,n.name);E.rect=_G4||E.rect;}return E&&s.setInfo(n.name,E),E==null?void 0:E.rect;}}}]);}(jt);var OS=/*#__PURE__*/function(_jt10){function OS(e){var _this60;_classCallCheck(this,OS);_this60=_callSuper(this,OS,[e]);wt(_this60,"canRotate",!1);wt(_this60,"scaleType",be.both);wt(_this60,"toolsType",It.Straight);wt(_this60,"tmpPoints",[]);wt(_this60,"workOptions");wt(_this60,"oldRect");wt(_this60,"straightTipWidth");wt(_this60,"syncTimestamp");_this60.workOptions=e.toolsOpt,_this60.straightTipWidth=_this60.workOptions.thickness/2,_this60.syncTimestamp=0,_this60.syncUnitTime=50;return _this60;}_inherits(OS,_jt10);return _createClass(OS,[{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=this.workId,v=n.op,p=n.syncUnitTime,w=v==null?void 0:v.length;if(!w||w<2)return{type:xt.None};p&&(this.syncUnitTime=p);var A;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],A=!1):A=this.updateTempPoints(v),!A)return{type:xt.None};var M;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({workId:d,layer:L});}if(u){var _L13=Jt(M,this.oldRect);this.oldRect=M;var G=_objectSpread({rect:_L13,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=this.tmpPoints.map(function(et){return[].concat(_toConsumableArray(et.XY),[0]);}).flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L14=Date.now();return _L14-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L14,_objectSpread({type:xt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(G){return[].concat(_toConsumableArray(G.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var E=Jt(M,this.oldRect);return this.oldRect=M,_objectSpread({rect:E,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:xt.FullWork,dataType:Kt.Local,ops:o,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,_e$isDrawEraserlines6=e.isDrawEraserlines,s=_e$isDrawEraserlines6===void 0?!0:_e$isDrawEraserlines6,_this$workOptions13=this.workOptions,o=_this$workOptions13.strokeColor,a=_this$workOptions13.thickness,u=_this$workOptions13.zIndex,d=_this$workOptions13.scale,v=_this$workOptions13.rotate,p=_this$workOptions13.translate,w=_this$workOptions13.strokeType,A=_this$workOptions13.eraserlines,M=_this$workOptions13.eraserFaces,E=_this$workOptions13.doingLines,L=_this$workOptions13.lineCap,G=_this$workOptions13.lineDash,z=i.worldPosition,et=i.worldScaling,_this$computDrawPoint9=this.computDrawPoints(a,w),x=_this$computDrawPoint9.d,y=_this$computDrawPoint9.rect,S=_this$computDrawPoint9.isDot,C=[y.x+y.w/2,y.y+y.h/2],P=new ar({pos:C,anchor:[0.5,0.5],size:[y.w,y.h],name:n,id:n,normalize:!0,zIndex:u}),X={pos:[0,0],normalize:!0,d:x,fillColor:o,strokeColor:o,lineDash:S?void 0:w===Re.Dotted?[G&&G[0]||1,(G&&G[1]||2)*a]:w===Re.LongDotted?[(G&&G[0]||1)*a,(G&&G[1]||2)*a]:void 0,lineCap:S?void 0:L,lineWidth:w===Re.Normal||S?0:a};d&&(X.scale=d),v&&(X.rotate=v),p&&(X.translate=p);var $=new Qr(X);P.append($),(A||M||E)&&(this.scaleType=be.proportional,this.drawEraserlines({group:P,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:M,pos:C,layer:i},s)),this.replace(i,n,P);var K={x:Math.floor(y.x*et[0]+z[0]-jt.SafeBorderPadding),y:Math.floor(y.y*et[1]+z[1]-jt.SafeBorderPadding),w:Math.floor(y.w*et[0]+2*jt.SafeBorderPadding),h:Math.floor(y.h*et[1]+2*jt.SafeBorderPadding)};if(v||d||p){var j=$.getBoundingClientRect();K={x:Math.floor(j.x-jt.SafeBorderPadding),y:Math.floor(j.y-jt.SafeBorderPadding),w:Math.floor(j.width+jt.SafeBorderPadding*2),h:Math.floor(j.height+jt.SafeBorderPadding*2)};}return this.isDelete&&P.setAttribute("opacity",0),K;}},{key:"computDrawPoints",value:function computDrawPoints(e,n){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(e,n):this.computDotPoints(e);}},{key:"computFullPoints",value:function computFullPoints(e,n){var i=Ct.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),s=Ct.Per(i).mul(e/2),o=_t.Sub(this.tmpPoints[0],s),a=_t.Add(this.tmpPoints[0],s),u=_t.Sub(this.tmpPoints[1],s),d=_t.Add(this.tmpPoints[1],s),v=_t.GetSemicircleStroke(this.tmpPoints[1],u,-1,8),p=_t.GetSemicircleStroke(this.tmpPoints[0],a,-1,8),w=[o,u].concat(_toConsumableArray(v),[d,a],_toConsumableArray(p));var A;return n!==Re.Normal?A=Ii(this.tmpPoints,!1):A=Ii(w,!0),{d:A,rect:$e(w),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(e){var n=_t.GetDotStroke(this.tmpPoints[0],e/2,8);return{d:Ii(n,!0),rect:$e(n),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState8=e.workState,s=_e$workState8===void 0?te.Done:_e$workState8,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:u&&jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var d,v;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.strokeType,u=s.get(n.name);return o&&(n.tagName==="GROUP"?n.children.forEach(function(p){p.setAttribute("strokeColor",o),p.getAttribute("fillColor")&&p.setAttribute("fillColor",o);}):(n.setAttribute("strokeColor",o),n.setAttribute("fillColor",o)),(d=u==null?void 0:u.opt)!=null&&d.strokeColor&&(u.opt.strokeColor=o)),a&&u!=null&&u.opt&&(v=u.opt)!=null&&v.strokeType&&(u.opt.strokeType=a),u&&s.setInfo(n.name,u),jt.updateNodeOpt(e);}}]);}(jt);var Po="cursorhover",h1=20,Ds="mainView";var d1={exports:{}},tr={},cp={exports:{}},Xs={};function DS(){var r={};return r["align-content"]=!1,r["align-items"]=!1,r["align-self"]=!1,r["alignment-adjust"]=!1,r["alignment-baseline"]=!1,r.all=!1,r["anchor-point"]=!1,r.animation=!1,r["animation-delay"]=!1,r["animation-direction"]=!1,r["animation-duration"]=!1,r["animation-fill-mode"]=!1,r["animation-iteration-count"]=!1,r["animation-name"]=!1,r["animation-play-state"]=!1,r["animation-timing-function"]=!1,r.azimuth=!1,r["backface-visibility"]=!1,r.background=!0,r["background-attachment"]=!0,r["background-clip"]=!0,r["background-color"]=!0,r["background-image"]=!0,r["background-origin"]=!0,r["background-position"]=!0,r["background-repeat"]=!0,r["background-size"]=!0,r["baseline-shift"]=!1,r.binding=!1,r.bleed=!1,r["bookmark-label"]=!1,r["bookmark-level"]=!1,r["bookmark-state"]=!1,r.border=!0,r["border-bottom"]=!0,r["border-bottom-color"]=!0,r["border-bottom-left-radius"]=!0,r["border-bottom-right-radius"]=!0,r["border-bottom-style"]=!0,r["border-bottom-width"]=!0,r["border-collapse"]=!0,r["border-color"]=!0,r["border-image"]=!0,r["border-image-outset"]=!0,r["border-image-repeat"]=!0,r["border-image-slice"]=!0,r["border-image-source"]=!0,r["border-image-width"]=!0,r["border-left"]=!0,r["border-left-color"]=!0,r["border-left-style"]=!0,r["border-left-width"]=!0,r["border-radius"]=!0,r["border-right"]=!0,r["border-right-color"]=!0,r["border-right-style"]=!0,r["border-right-width"]=!0,r["border-spacing"]=!0,r["border-style"]=!0,r["border-top"]=!0,r["border-top-color"]=!0,r["border-top-left-radius"]=!0,r["border-top-right-radius"]=!0,r["border-top-style"]=!0,r["border-top-width"]=!0,r["border-width"]=!0,r.bottom=!1,r["box-decoration-break"]=!0,r["box-shadow"]=!0,r["box-sizing"]=!0,r["box-snap"]=!0,r["box-suppress"]=!0,r["break-after"]=!0,r["break-before"]=!0,r["break-inside"]=!0,r["caption-side"]=!1,r.chains=!1,r.clear=!0,r.clip=!1,r["clip-path"]=!1,r["clip-rule"]=!1,r.color=!0,r["color-interpolation-filters"]=!0,r["column-count"]=!1,r["column-fill"]=!1,r["column-gap"]=!1,r["column-rule"]=!1,r["column-rule-color"]=!1,r["column-rule-style"]=!1,r["column-rule-width"]=!1,r["column-span"]=!1,r["column-width"]=!1,r.columns=!1,r.contain=!1,r.content=!1,r["counter-increment"]=!1,r["counter-reset"]=!1,r["counter-set"]=!1,r.crop=!1,r.cue=!1,r["cue-after"]=!1,r["cue-before"]=!1,r.cursor=!1,r.direction=!1,r.display=!0,r["display-inside"]=!0,r["display-list"]=!0,r["display-outside"]=!0,r["dominant-baseline"]=!1,r.elevation=!1,r["empty-cells"]=!1,r.filter=!1,r.flex=!1,r["flex-basis"]=!1,r["flex-direction"]=!1,r["flex-flow"]=!1,r["flex-grow"]=!1,r["flex-shrink"]=!1,r["flex-wrap"]=!1,r.float=!1,r["float-offset"]=!1,r["flood-color"]=!1,r["flood-opacity"]=!1,r["flow-from"]=!1,r["flow-into"]=!1,r.font=!0,r["font-family"]=!0,r["font-feature-settings"]=!0,r["font-kerning"]=!0,r["font-language-override"]=!0,r["font-size"]=!0,r["font-size-adjust"]=!0,r["font-stretch"]=!0,r["font-style"]=!0,r["font-synthesis"]=!0,r["font-variant"]=!0,r["font-variant-alternates"]=!0,r["font-variant-caps"]=!0,r["font-variant-east-asian"]=!0,r["font-variant-ligatures"]=!0,r["font-variant-numeric"]=!0,r["font-variant-position"]=!0,r["font-weight"]=!0,r.grid=!1,r["grid-area"]=!1,r["grid-auto-columns"]=!1,r["grid-auto-flow"]=!1,r["grid-auto-rows"]=!1,r["grid-column"]=!1,r["grid-column-end"]=!1,r["grid-column-start"]=!1,r["grid-row"]=!1,r["grid-row-end"]=!1,r["grid-row-start"]=!1,r["grid-template"]=!1,r["grid-template-areas"]=!1,r["grid-template-columns"]=!1,r["grid-template-rows"]=!1,r["hanging-punctuation"]=!1,r.height=!0,r.hyphens=!1,r.icon=!1,r["image-orientation"]=!1,r["image-resolution"]=!1,r["ime-mode"]=!1,r["initial-letters"]=!1,r["inline-box-align"]=!1,r["justify-content"]=!1,r["justify-items"]=!1,r["justify-self"]=!1,r.left=!1,r["letter-spacing"]=!0,r["lighting-color"]=!0,r["line-box-contain"]=!1,r["line-break"]=!1,r["line-grid"]=!1,r["line-height"]=!1,r["line-snap"]=!1,r["line-stacking"]=!1,r["line-stacking-ruby"]=!1,r["line-stacking-shift"]=!1,r["line-stacking-strategy"]=!1,r["list-style"]=!0,r["list-style-image"]=!0,r["list-style-position"]=!0,r["list-style-type"]=!0,r.margin=!0,r["margin-bottom"]=!0,r["margin-left"]=!0,r["margin-right"]=!0,r["margin-top"]=!0,r["marker-offset"]=!1,r["marker-side"]=!1,r.marks=!1,r.mask=!1,r["mask-box"]=!1,r["mask-box-outset"]=!1,r["mask-box-repeat"]=!1,r["mask-box-slice"]=!1,r["mask-box-source"]=!1,r["mask-box-width"]=!1,r["mask-clip"]=!1,r["mask-image"]=!1,r["mask-origin"]=!1,r["mask-position"]=!1,r["mask-repeat"]=!1,r["mask-size"]=!1,r["mask-source-type"]=!1,r["mask-type"]=!1,r["max-height"]=!0,r["max-lines"]=!1,r["max-width"]=!0,r["min-height"]=!0,r["min-width"]=!0,r["move-to"]=!1,r["nav-down"]=!1,r["nav-index"]=!1,r["nav-left"]=!1,r["nav-right"]=!1,r["nav-up"]=!1,r["object-fit"]=!1,r["object-position"]=!1,r.opacity=!1,r.order=!1,r.orphans=!1,r.outline=!1,r["outline-color"]=!1,r["outline-offset"]=!1,r["outline-style"]=!1,r["outline-width"]=!1,r.overflow=!1,r["overflow-wrap"]=!1,r["overflow-x"]=!1,r["overflow-y"]=!1,r.padding=!0,r["padding-bottom"]=!0,r["padding-left"]=!0,r["padding-right"]=!0,r["padding-top"]=!0,r.page=!1,r["page-break-after"]=!1,r["page-break-before"]=!1,r["page-break-inside"]=!1,r["page-policy"]=!1,r.pause=!1,r["pause-after"]=!1,r["pause-before"]=!1,r.perspective=!1,r["perspective-origin"]=!1,r.pitch=!1,r["pitch-range"]=!1,r["play-during"]=!1,r.position=!1,r["presentation-level"]=!1,r.quotes=!1,r["region-fragment"]=!1,r.resize=!1,r.rest=!1,r["rest-after"]=!1,r["rest-before"]=!1,r.richness=!1,r.right=!1,r.rotation=!1,r["rotation-point"]=!1,r["ruby-align"]=!1,r["ruby-merge"]=!1,r["ruby-position"]=!1,r["shape-image-threshold"]=!1,r["shape-outside"]=!1,r["shape-margin"]=!1,r.size=!1,r.speak=!1,r["speak-as"]=!1,r["speak-header"]=!1,r["speak-numeral"]=!1,r["speak-punctuation"]=!1,r["speech-rate"]=!1,r.stress=!1,r["string-set"]=!1,r["tab-size"]=!1,r["table-layout"]=!1,r["text-align"]=!0,r["text-align-last"]=!0,r["text-combine-upright"]=!0,r["text-decoration"]=!0,r["text-decoration-color"]=!0,r["text-decoration-line"]=!0,r["text-decoration-skip"]=!0,r["text-decoration-style"]=!0,r["text-emphasis"]=!0,r["text-emphasis-color"]=!0,r["text-emphasis-position"]=!0,r["text-emphasis-style"]=!0,r["text-height"]=!0,r["text-indent"]=!0,r["text-justify"]=!0,r["text-orientation"]=!0,r["text-overflow"]=!0,r["text-shadow"]=!0,r["text-space-collapse"]=!0,r["text-transform"]=!0,r["text-underline-position"]=!0,r["text-wrap"]=!0,r.top=!1,r.transform=!1,r["transform-origin"]=!1,r["transform-style"]=!1,r.transition=!1,r["transition-delay"]=!1,r["transition-duration"]=!1,r["transition-property"]=!1,r["transition-timing-function"]=!1,r["unicode-bidi"]=!1,r["vertical-align"]=!1,r.visibility=!1,r["voice-balance"]=!1,r["voice-duration"]=!1,r["voice-family"]=!1,r["voice-pitch"]=!1,r["voice-range"]=!1,r["voice-rate"]=!1,r["voice-stress"]=!1,r["voice-volume"]=!1,r.volume=!1,r["white-space"]=!1,r.widows=!1,r.width=!0,r["will-change"]=!1,r["word-break"]=!0,r["word-spacing"]=!0,r["word-wrap"]=!0,r["wrap-flow"]=!1,r["wrap-through"]=!1,r["writing-mode"]=!1,r["z-index"]=!1,r;}function YCt(r,t,e){}function jCt(r,t,e){}var XCt=/javascript\s*\:/img;function GCt(r,t){return XCt.test(t)?"":t;}Xs.whiteList=DS();Xs.getDefaultWhiteList=DS;Xs.onAttr=YCt;Xs.onIgnoreAttr=jCt;Xs.safeAttrValue=GCt;var HCt={indexOf:function indexOf(r,t){var e,n;if(Array.prototype.indexOf)return r.indexOf(t);for(e=0,n=r.length;e<n;e++)if(r[e]===t)return e;return-1;},forEach:function forEach(r,t,e){var n,i;if(Array.prototype.forEach)return r.forEach(t,e);for(n=0,i=r.length;n<i;n++)t.call(e,r[n],n,r);},trim:function trim(r){return String.prototype.trim?r.trim():r.replace(/(^\s*)|(\s*$)/g,"");},trimRight:function trimRight(r){return String.prototype.trimRight?r.trimRight():r.replace(/(\s*$)/g,"");}},Pa=HCt;function VCt(r,t){r=Pa.trimRight(r),r[r.length-1]!==";"&&(r+=";");var e=r.length,n=!1,i=0,s=0,o="";function a(){if(!n){var v=Pa.trim(r.slice(i,s)),p=v.indexOf(":");if(p!==-1){var w=Pa.trim(v.slice(0,p)),A=Pa.trim(v.slice(p+1));if(w){var M=t(i,o.length,w,A,v);M&&(o+=M+"; ");}}}i=s+1;}for(;s<e;s++){var u=r[s];if(u==="/"&&r[s+1]==="*"){var d=r.indexOf("*/",s+2);if(d===-1)break;s=d+1,i=s+1,n=!1;}else u==="("?n=!0:u===")"?n=!1:u===";"?n||a():u==="\n"&&a();}return Pa.trim(o);}var ZCt=VCt,Wc=Xs,qCt=ZCt;function p1(r){return r==null;}function KCt(r){var t={};for(var e in r)t[e]=r[e];return t;}function RS(r){r=KCt(r||{}),r.whiteList=r.whiteList||Wc.whiteList,r.onAttr=r.onAttr||Wc.onAttr,r.onIgnoreAttr=r.onIgnoreAttr||Wc.onIgnoreAttr,r.safeAttrValue=r.safeAttrValue||Wc.safeAttrValue,this.options=r;}RS.prototype.process=function(r){if(r=r||"",r=r.toString(),!r)return"";var t=this,e=t.options,n=e.whiteList,i=e.onAttr,s=e.onIgnoreAttr,o=e.safeAttrValue,a=qCt(r,function(u,d,v,p,w){var A=n[v],M=!1;if(A===!0?M=A:typeof A=="function"?M=A(p):A instanceof RegExp&&(M=A.test(p)),M!==!0&&(M=!1),p=o(v,p),!!p){var E={position:d,sourcePosition:u,source:w,isWhite:M};if(M){var L=i(v,p,E);return p1(L)?v+":"+p:L;}else{var L=s(v,p,E);if(!p1(L))return L;}}});return a;};var QCt=RS;(function(r,t){var e=Xs,n=QCt;function i(o,a){var u=new n(a);return u.process(o);}t=r.exports=i,t.FilterCSS=n;for(var s in e)t[s]=e[s];(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(window.filterCSS=r.exports);})(cp,cp.exports);var S0=cp.exports,I0={indexOf:function indexOf(r,t){var e,n;if(Array.prototype.indexOf)return r.indexOf(t);for(e=0,n=r.length;e<n;e++)if(r[e]===t)return e;return-1;},forEach:function forEach(r,t,e){var n,i;if(Array.prototype.forEach)return r.forEach(t,e);for(n=0,i=r.length;n<i;n++)t.call(e,r[n],n,r);},trim:function trim(r){return String.prototype.trim?r.trim():r.replace(/(^\s*)|(\s*$)/g,"");},spaceIndex:function spaceIndex(r){var t=/\s|\n|\t/,e=t.exec(r);return e?e.index:-1;}},JCt=S0.FilterCSS,_Ct=S0.getDefaultWhiteList,gu=I0;function NS(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]};}var BS=new JCt();function tPt(r,t,e){}function ePt(r,t,e){}function rPt(r,t,e){}function nPt(r,t,e){}function kS(r){return r.replace(sPt,"<").replace(oPt,">");}function iPt(r,t,e,n){if(e=YS(e),t==="href"||t==="src"){if(e=gu.trim(e),e==="#")return"#";if(!(e.substr(0,7)==="http://"||e.substr(0,8)==="https://"||e.substr(0,7)==="mailto:"||e.substr(0,4)==="tel:"||e.substr(0,11)==="data:image/"||e.substr(0,6)==="ftp://"||e.substr(0,2)==="./"||e.substr(0,3)==="../"||e[0]==="#"||e[0]==="/"))return"";}else if(t==="background"){if(Uc.lastIndex=0,Uc.test(e))return"";}else if(t==="style"){if(v1.lastIndex=0,v1.test(e)||(g1.lastIndex=0,g1.test(e)&&(Uc.lastIndex=0,Uc.test(e))))return"";n!==!1&&(n=n||BS,e=n.process(e));}return e=jS(e),e;}var sPt=/</g,oPt=/>/g,aPt=/"/g,lPt=/"/g,cPt=/&#([a-zA-Z0-9]*);?/gim,uPt=/:?/gim,fPt=/&newline;?/gim,Uc=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,v1=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,g1=/u\s*r\s*l\s*\(.*/gi;function FS(r){return r.replace(aPt,""");}function WS(r){return r.replace(lPt,'"');}function US(r){return r.replace(cPt,function(e,n){return n[0]==="x"||n[0]==="X"?String.fromCharCode(parseInt(n.substr(1),16)):String.fromCharCode(parseInt(n,10));});}function zS(r){return r.replace(uPt,":").replace(fPt," ");}function $S(r){for(var t="",e=0,n=r.length;e<n;e++)t+=r.charCodeAt(e)<32?" ":r.charAt(e);return gu.trim(t);}function YS(r){return r=WS(r),r=US(r),r=zS(r),r=$S(r),r;}function jS(r){return r=FS(r),r=kS(r),r;}function hPt(){return"";}function dPt(r,t){typeof t!="function"&&(t=function t(){});var e=!Array.isArray(r);function n(o){return e?!0:gu.indexOf(r,o)!==-1;}var i=[],s=!1;return{onIgnoreTag:function onIgnoreTag(o,a,u){if(n(o)){if(u.isClosing){var d="[/removed]",v=u.position+d.length;return i.push([s!==!1?s:u.position,v]),s=!1,d;}else return s||(s=u.position),"[removed]";}else return t(o,a,u);},remove:function remove(o){var a="",u=0;return gu.forEach(i,function(d){a+=o.slice(u,d[0]),u=d[1];}),a+=o.slice(u),a;}};}function pPt(r){for(var t="",e=0;e<r.length;){var n=r.indexOf("<!--",e);if(n===-1){t+=r.slice(e);break;}t+=r.slice(e,n);var i=r.indexOf("-->",n);if(i===-1)break;e=i+3;}return t;}function vPt(r){var t=r.split("");return t=t.filter(function(e){var n=e.charCodeAt(0);return n===127?!1:n<=31?n===10||n===13:!0;}),t.join("");}tr.whiteList=NS();tr.getDefaultWhiteList=NS;tr.onTag=tPt;tr.onIgnoreTag=ePt;tr.onTagAttr=rPt;tr.onIgnoreTagAttr=nPt;tr.safeAttrValue=iPt;tr.escapeHtml=kS;tr.escapeQuote=FS;tr.unescapeQuote=WS;tr.escapeHtmlEntities=US;tr.escapeDangerHtml5Entities=zS;tr.clearNonPrintableCharacter=$S;tr.friendlyAttrValue=YS;tr.escapeAttrValue=jS;tr.onIgnoreTagStripAll=hPt;tr.StripTagBody=dPt;tr.stripCommentTag=pPt;tr.stripBlankChar=vPt;tr.attributeWrapSign='"';tr.cssFilter=BS;tr.getDefaultCSSWhiteList=_Ct;var lf={},Gi=I0;function gPt(r){var t=Gi.spaceIndex(r),e;return t===-1?e=r.slice(1,-1):e=r.slice(1,t+1),e=Gi.trim(e).toLowerCase(),e.slice(0,1)==="/"&&(e=e.slice(1)),e.slice(-1)==="/"&&(e=e.slice(0,-1)),e;}function mPt(r){return r.slice(0,2)==="</";}function yPt(r,t,e){var n="",i=0,s=!1,o=!1,a=0,u=r.length,d="",v="";t:for(a=0;a<u;a++){var p=r.charAt(a);if(s===!1){if(p==="<"){s=a;continue;}}else if(o===!1){if(p==="<"){n+=e(r.slice(i,a)),s=a,i=a;continue;}if(p===">"||a===u-1){n+=e(r.slice(i,s)),v=r.slice(s,a+1),d=gPt(v),n+=t(s,n.length,d,v,mPt(v)),i=a+1,s=!1;continue;}if(p==='"'||p==="'")for(var w=1,A=r.charAt(a-w);A.trim()===""||A==="=";){if(A==="="){o=p;continue t;}A=r.charAt(a-++w);}}else if(p===o){o=!1;continue;}}return i<u&&(n+=e(r.substr(i))),n;}var wPt=/[^a-zA-Z0-9\\_:.-]/gim;function SPt(r,t){var e=0,n=0,i=[],s=!1,o=r.length;function a(w,A){if(w=Gi.trim(w),w=w.replace(wPt,"").toLowerCase(),!(w.length<1)){var M=t(w,A||"");M&&i.push(M);}}for(var u=0;u<o;u++){var d=r.charAt(u),v,p;if(s===!1&&d==="="){s=r.slice(e,u),e=u+1,n=r.charAt(e)==='"'||r.charAt(e)==="'"?e:TPt(r,u+1);continue;}if(s!==!1&&u===n){if(p=r.indexOf(d,u+1),p===-1)break;v=Gi.trim(r.slice(n+1,p)),a(s,v),s=!1,u=p,e=u+1;continue;}if(/\s|\n|\t/.test(d))if(r=r.replace(/\s|\n|\t/g," "),s===!1){if(p=IPt(r,u),p===-1){v=Gi.trim(r.slice(e,u)),a(v),s=!1,e=u+1;continue;}else{u=p-1;continue;}}else if(p=xPt(r,u-1),p===-1){v=Gi.trim(r.slice(e,u)),v=m1(v),a(s,v),s=!1,e=u+1;continue;}else continue;}return e<r.length&&(s===!1?a(r.slice(e)):a(s,m1(Gi.trim(r.slice(e))))),Gi.trim(i.join(" "));}function IPt(r,t){for(;t<r.length;t++){var e=r[t];if(e!==" ")return e==="="?t:-1;}}function TPt(r,t){for(;t<r.length;t++){var e=r[t];if(e!==" ")return e==="'"||e==='"'?t:-1;}}function xPt(r,t){for(;t>0;t--){var e=r[t];if(e!==" ")return e==="="?t:-1;}}function CPt(r){return r[0]==='"'&&r[r.length-1]==='"'||r[0]==="'"&&r[r.length-1]==="'";}function m1(r){return CPt(r)?r.substr(1,r.length-2):r;}lf.parseTag=yPt;lf.parseAttr=SPt;var PPt=S0.FilterCSS,xn=tr,XS=lf,APt=XS.parseTag,bPt=XS.parseAttr,_c=I0;function zc(r){return r==null;}function MPt(r){var t=_c.spaceIndex(r);if(t===-1)return{html:"",closing:r[r.length-2]==="/"};r=_c.trim(r.slice(t+1,-1));var e=r[r.length-1]==="/";return e&&(r=_c.trim(r.slice(0,-1))),{html:r,closing:e};}function EPt(r){var t={};for(var e in r)t[e]=r[e];return t;}function LPt(r){var t={};for(var e in r)Array.isArray(r[e])?t[e.toLowerCase()]=r[e].map(function(n){return n.toLowerCase();}):t[e.toLowerCase()]=r[e];return t;}function GS(r){r=EPt(r||{}),r.stripIgnoreTag&&(r.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),r.onIgnoreTag=xn.onIgnoreTagStripAll),r.whiteList||r.allowList?r.whiteList=LPt(r.whiteList||r.allowList):r.whiteList=xn.whiteList,this.attributeWrapSign=r.singleQuotedAttributeValue===!0?"'":xn.attributeWrapSign,r.onTag=r.onTag||xn.onTag,r.onTagAttr=r.onTagAttr||xn.onTagAttr,r.onIgnoreTag=r.onIgnoreTag||xn.onIgnoreTag,r.onIgnoreTagAttr=r.onIgnoreTagAttr||xn.onIgnoreTagAttr,r.safeAttrValue=r.safeAttrValue||xn.safeAttrValue,r.escapeHtml=r.escapeHtml||xn.escapeHtml,this.options=r,r.css===!1?this.cssFilter=!1:(r.css=r.css||{},this.cssFilter=new PPt(r.css));}GS.prototype.process=function(r){if(r=r||"",r=r.toString(),!r)return"";var t=this,e=t.options,n=e.whiteList,i=e.onTag,s=e.onIgnoreTag,o=e.onTagAttr,a=e.onIgnoreTagAttr,u=e.safeAttrValue,d=e.escapeHtml,v=t.attributeWrapSign,p=t.cssFilter;e.stripBlankChar&&(r=xn.stripBlankChar(r)),e.allowCommentTag||(r=xn.stripCommentTag(r));var w=!1;e.stripIgnoreTagBody&&(w=xn.StripTagBody(e.stripIgnoreTagBody,s),s=w.onIgnoreTag);var A=APt(r,function(M,E,L,G,z){var et={sourcePosition:M,position:E,isClosing:z,isWhite:Object.prototype.hasOwnProperty.call(n,L)},x=i(L,G,et);if(!zc(x))return x;if(et.isWhite){if(et.isClosing)return"</"+L+">";var y=MPt(G),S=n[L],C=bPt(y.html,function(P,X){var $=_c.indexOf(S,P)!==-1,K=o(L,P,X,$);return zc(K)?$?(X=u(L,P,X,p),X?P+"="+v+X+v:P):(K=a(L,P,X,$),zc(K)?void 0:K):K;});return G="<"+L,C&&(G+=" "+C),y.closing&&(G+=" /"),G+=">",G;}else return x=s(L,G,et),zc(x)?d(G):x;},d);return w&&(A=w.remove(A)),A;};var OPt=GS;(function(r,t){var e=tr,n=lf,i=OPt;function s(a,u){var d=new i(u);return d.process(a);}t=r.exports=s,t.filterXSS=s,t.FilterXSS=i,function(){for(var a in e)t[a]=e[a];for(var u in n)t[u]=n[u];}(),(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(window.filterXSS=r.exports);function o(){return(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&(typeof DedicatedWorkerGlobalScope==="undefined"?"undefined":_typeof(DedicatedWorkerGlobalScope))<"u"&&self instanceof DedicatedWorkerGlobalScope;}o()&&(self.filterXSS=r.exports);})(d1,d1.exports);var mu={exports:{}};/**
|
|
437
|
+
*/},{key:"threeBezier",value:function threeBezier(t,e,n,i,s){var o=e.x*(1-t)*(1-t)*(1-t)+3*n.x*t*(1-t)*(1-t)+3*i.x*t*t*(1-t)+s.x*t*t*t,a=e.y*(1-t)*(1-t)*(1-t)+3*n.y*t*(1-t)*(1-t)+3*i.y*t*t*(1-t)+s.y*t*t*t;return new Ct(o,a);}}]);}();var LS=/*#__PURE__*/function(_jt0){function LS(e){var _this58;_classCallCheck(this,LS);_this58=_callSuper(this,LS,[e]);wt(_this58,"canRotate",!1);wt(_this58,"scaleType",be.all);wt(_this58,"toolsType",It.SpeechBalloon);wt(_this58,"ratio",0.8);wt(_this58,"tmpPoints",[]);wt(_this58,"workOptions");wt(_this58,"oldRect");wt(_this58,"syncTimestamp");_this58.workOptions=e.toolsOpt,_this58.syncTimestamp=0,_this58.syncUnitTime=50;return _this58;}_inherits(LS,_jt0);return _createClass(LS,[{key:"consume",value:function consume(e){var E;var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=(E=n==null?void 0:n.workId)==null?void 0:E.toString();if(!d)return{type:xt.None};var v=n.op,p=v==null?void 0:v.length;if(!p||p<2)return{type:xt.None};var w;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],w=!1):w=this.updateTempPoints(v),!w)return{type:xt.None};var A;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;A=this.draw({workId:d,layer:L,isDrawing:!0});}if(u){var _L11=Jt(A,this.oldRect);this.oldRect=A;var G=_objectSpread({rect:_L11,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=this.tmpPoints.map(function(et){return[].concat(_toConsumableArray(et.XY),[0]);}).flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L12=Date.now();return _L12-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L12,_objectSpread({type:xt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(G){return[].concat(_toConsumableArray(G.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var M=Jt(A,this.oldRect);return this.oldRect=A,_objectSpread({rect:M,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n,isDrawing:!1});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:xt.FullWork,dataType:Kt.Local,ops:o,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,_e$isDrawEraserlines5=e.isDrawEraserlines,s=_e$isDrawEraserlines5===void 0?!0:_e$isDrawEraserlines5,_this$workOptions10=this.workOptions,o=_this$workOptions10.strokeColor,a=_this$workOptions10.fillColor,u=_this$workOptions10.thickness,d=_this$workOptions10.zIndex,v=_this$workOptions10.placement,p=_this$workOptions10.scale,w=_this$workOptions10.rotate,A=_this$workOptions10.translate,M=_this$workOptions10.strokeType,E=_this$workOptions10.eraserlines,L=_this$workOptions10.eraserFaces,G=_this$workOptions10.doingLines,z=_this$workOptions10.lineDash,et=_this$workOptions10.lineCap,_this$computDrawPoint8=this.computDrawPoints(u,v),x=_this$computDrawPoint8.rect,y=_this$computDrawPoint8.pos,S=_this$computDrawPoint8.points,C={points:S.map(function(j){return j.XY;}),lineWidth:u,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,className:"".concat(y[0],",").concat(y[1]),close:!0,lineCap:et,lineDash:M===Re.Dotted?[z&&z[0]||1,(z&&z[1]||2)*u]:M===Re.LongDotted?[(z&&z[0]||1)*u,(z&&z[1]||2)*u]:void 0},P={name:n,id:n,zIndex:d,pos:y,anchor:[0.5,0.5],size:[x.w,x.h]};p&&(P.scale=p),w&&(P.rotate=w),A&&(P.translate=A);var X=new ar(P),$=new Un(_objectSpread(_objectSpread({},C),{},{pos:[0,0]}));X.append($),(E||L||G)&&(this.scaleType=be.proportional,this.drawEraserlines({group:X,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:L,pos:y,layer:i},s)),this.replace(i,n,X);var K=X.getBoundingClientRect();return this.isDelete&&X.setAttribute("opacity",0),{x:Math.floor(K.x-jt.SafeBorderPadding),y:Math.floor(K.y-jt.SafeBorderPadding),w:Math.floor(K.width+jt.SafeBorderPadding*2),h:Math.floor(K.height+jt.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(e){var n=$e(this.tmpPoints);switch(e){case"bottom":case"bottomLeft":case"bottomRight":{var i=n.y+n.h*this.ratio;return[new Ct(n.x,n.y,0),new Ct(n.x+n.w,n.y,0),new Ct(n.x+n.w,i,0),new Ct(n.x,i,0)];}case"top":case"topLeft":case"topRight":{var _i4=n.y+n.h*(1-this.ratio);return[new Ct(n.x,_i4,0),new Ct(n.x+n.w,_i4,0),new Ct(n.x+n.w,n.y+n.h,0),new Ct(n.x,n.y+n.h,0)];}case"left":case"leftBottom":case"leftTop":{var _i5=n.x+n.w*(1-this.ratio);return[new Ct(_i5,n.y,0),new Ct(n.x+n.w,n.y,0),new Ct(n.x+n.w,n.y+n.h,0),new Ct(_i5,n.y+n.h,0)];}case"right":case"rightBottom":case"rightTop":{var _i6=n.x+n.w*this.ratio;return[new Ct(n.x,n.y,0),new Ct(_i6,n.y,0),new Ct(_i6,n.y+n.h,0),new Ct(n.x,n.y+n.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(e,n){var i=$e(this.tmpPoints),s=this.transformControlPoints(n),o=Math.floor(i.w*0.1),a=Math.floor(i.h*0.1),u=[],d=Ct.Add(s[0],new Ct(0,a,0)),v=Ct.Add(s[0],new Ct(o,0,0)),p=Nn.getBezierPoints(10,d,s[0],v),w=Ct.Sub(s[1],new Ct(o,0,0)),A=Ct.Add(s[1],new Ct(0,a,0)),M=Nn.getBezierPoints(10,w,s[1],A),E=Ct.Sub(s[2],new Ct(0,a,0)),L=Ct.Sub(s[2],new Ct(o,0,0)),G=Nn.getBezierPoints(10,E,s[2],L),z=Ct.Add(s[3],new Ct(o,0,0)),et=Ct.Sub(s[3],new Ct(0,a,0)),x=Nn.getBezierPoints(10,z,s[3],et),y=o*(1-this.ratio)*10,S=a*(1-this.ratio)*10;switch(n){case"bottom":{var X=Ct.Sub(s[2],new Ct(o*5-y/2,0,0)),$=Ct.Sub(s[2],new Ct(o*5,-S,0)),K=Ct.Sub(s[2],new Ct(o*5+y/2,0,0));u.push.apply(u,[$,K].concat(_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),[X]));break;}case"bottomRight":{var _X4=Ct.Sub(s[2],new Ct(o*1.1,0,0)),_$3=Ct.Sub(s[2],new Ct(o*1.1+y/2,-S,0)),_K4=Ct.Sub(s[2],new Ct(o*1.1+y,0,0));u.push.apply(u,[_$3,_K4].concat(_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),[_X4]));break;}case"bottomLeft":{var _X5=Ct.Add(s[3],new Ct(o*1.1+y,0,0)),_$4=Ct.Add(s[3],new Ct(o*1.1+y/2,S,0)),_K5=Ct.Add(s[3],new Ct(o*1.1,0,0));u.push.apply(u,[_$4,_K5].concat(_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),[_X5]));break;}case"top":{var _X6=Ct.Sub(s[1],new Ct(o*5-y/2,0,0)),_$5=Ct.Sub(s[1],new Ct(o*5,S,0)),_K6=Ct.Sub(s[1],new Ct(o*5+y/2,0,0));u.push.apply(u,[_$5,_X6].concat(_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),[_K6]));break;}case"topRight":{var _X7=Ct.Sub(s[1],new Ct(o*1.1,0,0)),_$6=Ct.Sub(s[1],new Ct(o*1.1+y/2,S,0)),_K7=Ct.Sub(s[1],new Ct(o*1.1+y,0,0));u.push.apply(u,[_$6,_X7].concat(_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),[_K7]));break;}case"topLeft":{var _X8=Ct.Add(s[0],new Ct(o*1.1+y,0,0)),_$7=Ct.Add(s[0],new Ct(o*1.1+y/2,-S,0)),_K8=Ct.Add(s[0],new Ct(o*1.1,0,0));u.push.apply(u,[_$7,_X8].concat(_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),[_K8]));break;}case"left":{var _X9=Ct.Add(s[0],new Ct(0,a*5-S/2,0)),_$8=Ct.Add(s[0],new Ct(-y,a*5,0)),_K9=Ct.Add(s[0],new Ct(0,a*5+S/2,0));u.push.apply(u,[_$8,_X9].concat(_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),[_K9]));break;}case"leftTop":{var _X0=Ct.Add(s[0],new Ct(0,a*1.1,0)),_$9=Ct.Add(s[0],new Ct(-y,a*1.1+S/2,0)),_K0=Ct.Add(s[0],new Ct(0,a*1.1+S,0));u.push.apply(u,[_$9,_X0].concat(_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),[_K0]));break;}case"leftBottom":{var _X1=Ct.Sub(s[3],new Ct(0,a*1.1+S,0)),_$0=Ct.Sub(s[3],new Ct(y,a*1.1+S/2,0)),_K1=Ct.Sub(s[3],new Ct(0,a*1.1,0));u.push.apply(u,[_$0,_X1].concat(_toConsumableArray(p),_toConsumableArray(M),_toConsumableArray(G),_toConsumableArray(x),[_K1]));break;}case"right":{var _X10=Ct.Add(s[1],new Ct(0,a*5-S/2,0)),_$1=Ct.Add(s[1],new Ct(y,a*5,0)),_K10=Ct.Add(s[1],new Ct(0,a*5+S/2,0));u.push.apply(u,[_$1,_K10].concat(_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),[_X10]));break;}case"rightTop":{var _X11=Ct.Add(s[1],new Ct(0,a*1.1,0)),_$10=Ct.Add(s[1],new Ct(y,a*1.1+S/2,0)),_K11=Ct.Add(s[1],new Ct(0,a*1.1+S,0));u.push.apply(u,[_$10,_K11].concat(_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),[_X11]));break;}case"rightBottom":{var _X12=Ct.Sub(s[2],new Ct(0,a*1.1+S,0)),_$11=Ct.Sub(s[2],new Ct(-y,a*1.1+S/2,0)),_K12=Ct.Sub(s[2],new Ct(0,a*1.1,0));u.push.apply(u,[_$11,_K12].concat(_toConsumableArray(G),_toConsumableArray(x),_toConsumableArray(p),_toConsumableArray(M),[_X12]));break;}}var C=$e(this.tmpPoints,e),P=[Math.floor(C.x+C.w/2),Math.floor(C.y+C.h/2)];return{rect:C,pos:P,points:u};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o)||_t.Sub(s,i).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState7=e.workState,s=_e$workState7===void 0?te.Done:_e$workState7,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:u&&jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var M;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.fillColor,u=i.toolsType,d=i.placement,v=i.strokeType,p=s.get(n.name),w=p==null?void 0:p.opt;var A=n;return n.tagName==="GROUP"&&(A=n.children[0]),o&&(A.setAttribute("strokeColor",o),w!=null&&w.strokeColor&&(w.strokeColor=o)),a&&(a==="transparent"?A.setAttribute("fillColor","rgba(0,0,0,0)"):A.setAttribute("fillColor",a),w!=null&&w.fillColor&&(w.fillColor=a)),u===It.SpeechBalloon&&d&&(w.placement=d),v&&p!=null&&p.opt&&(M=p.opt)!=null&&M.strokeType&&(p.opt.strokeType=v),p&&s.setInfo(n.name,_objectSpread(_objectSpread({},p),{},{opt:w})),jt.updateNodeOpt(e);}}]);}(jt);var UCt=Wo,zCt=Pi,$Ct="[object Boolean]";function YCt(r){return r===!0||r===!1||zCt(r)&&UCt(r)==$Ct;}var jCt=YCt;var bs=/* @__PURE__ */zn(jCt);var Ga=/*#__PURE__*/function(_jt1){function Ga(e){var _this59;_classCallCheck(this,Ga);_this59=_callSuper(this,Ga,[e]);wt(_this59,"canRotate",!0);wt(_this59,"scaleType",be.all);wt(_this59,"toolsType",It.Image);wt(_this59,"tmpPoints",[]);wt(_this59,"workOptions");wt(_this59,"oldRect");_this59.workOptions=e.toolsOpt,_this59.scaleType=Ga.getScaleType(_this59.workOptions);return _this59;}_inherits(Ga,_jt1);return _createClass(Ga,[{key:"consume",value:function consume(){return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:xt.None};}},{key:"draw",value:function draw(e){var n=e.layer,i=e.workId,s=e.replaceId,o=e.imageBitmap,_this$workOptions11=this.workOptions,a=_this$workOptions11.centerX,u=_this$workOptions11.centerY,d=_this$workOptions11.width,v=_this$workOptions11.height,p=_this$workOptions11.rotate,w=_this$workOptions11.zIndex,A=_this$workOptions11.eraserlines,M=_this$workOptions11.eraserFaces,E=_this$workOptions11.doingLines,L=new ar({anchor:[0.5,0.5],pos:[a,u],name:i,size:[d,v],zIndex:w,rotate:p}),G={anchor:[0.5,0.5],pos:[0,0],size:[d,v],texture:o};o||(G.bgcolor="rgba(0,0,0,0.3)");var z=new Ju(G);L.append(z),(A||M||E)&&this.drawEraserlines({group:L,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:M,pos:[a,u],layer:n}),this.replace(n,s||i,L);var et=L.getBoundingClientRect();if(et)return{x:Math.floor(et.x-jt.SafeBorderPadding),y:Math.floor(et.y-jt.SafeBorderPadding),w:Math.floor(et.width+jt.SafeBorderPadding*2),h:Math.floor(et.height+jt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13(e){var v,p,w,A,n,i,s,_this$workOptions12,o,a,u,d,M,E;return _regenerator().w(function(_context14){while(1)switch(_context14.n){case 0:n=e.isFullWork,i=e.replaceId,s=e.worker,_this$workOptions12=this.workOptions,o=_this$workOptions12.src,a=_this$workOptions12.uuid,u=((v=this.workId)==null?void 0:v.toString())||a,d=n?this.fullLayer:this.drawLayer||this.fullLayer;if(!o){_context14.n=2;break;}_context14.n=1;return s.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:u,isSubWorker:s instanceof Kbt});case 1:M=_context14.v;if(!M){_context14.n=2;break;}E=this.draw({workId:u,layer:d,replaceId:i,imageBitmap:M});return _context14.a(2,(this.oldRect=u&&((w=(p=this.vNodes)==null?void 0:p.get(u))==null?void 0:w.rect)||void 0,(A=this.vNodes)==null||A.setInfo(u,{rect:E,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:E&&jt.getCenterPos(E,d)}),E));case 2:return _context14.a(2);}},_callee13,this);}));function consumeServiceAsync(_x20){return _consumeServiceAsync.apply(this,arguments);}return consumeServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return jt.normalizeStorageData(e);}},{key:"getScaleType",value:function getScaleType(e){var n=e.uniformScale,i=e.rotate;return n!==!1||i&&Math.abs(i)%90>0?be.proportional:be.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var n=e.node,i=e.opt,s=e.vNodes,o=e.targetNode,a=i.translate,u=i.originPoint,d=i.scenePoint,v=i.scale,p=i.angle,w=i.isLocked,A=i.zIndex,M=i.strokeColor,E=o&&br(o)||s.get(n.name);if(!E)return;var L=n.parent;if(L){if(M&&(E.opt.strokeColor=M),Ze(A)&&(n.setAttribute("zIndex",A),E.opt.zIndex=A),bs(w)&&(E.opt.locked=w),u&&d&&v&&a){var _E$opt=E.opt,G=_E$opt.centerX,z=_E$opt.centerY,et=_E$opt.width,x=_E$opt.height,y=_E$opt.uniformScale,S=y!==!1?[v[0],v[0]]:v,C=[G,z],P=[G,z];uf(P,d,S,a);var X=[P[0]-C[0],P[1]-C[1]];if(E.centerPos=[E.centerPos[0]+X[0],E.centerPos[1]+X[1]],E.opt.width=Math.round(et*S[0]),E.opt.height=Math.round(x*S[1]),E.opt.centerX=P[0],E.opt.centerY=P[1],E.opt.eraserlines){var _iterator46=_createForOfIteratorHelper(E.opt.eraserlines),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var $=_step46.value;var K=$.op,j=$.thickness;$.thickness=Math.round(j*Math.max(v[0],v[1]));for(var nt=0;nt<K.length;nt++)Fa(K[nt],d,v,a);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}}}else if(a){if(E.opt.centerX=E.opt.centerX+a[0],E.opt.centerY=E.opt.centerY+a[1],E.centerPos=[E.centerPos[0]+a[0],E.centerPos[1]+a[1]],E.opt.eraserlines){var _iterator47=_createForOfIteratorHelper(E.opt.eraserlines),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var _G2=_step47.value;var _z2=_G2.op;for(var _et2=0;_et2<_z2.length;_et2++){var _x21=_z2[_et2].map(function(y,S){return S%2?y+a[1]:y+a[0];});_G2.op[_et2]=_x21;}}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}}}else if(Ze(p))if(E.opt.rotate=p,E.scaleType=Ga.getScaleType(E.opt),o){var _G3=T0(E.rect,p);E.rect=_G3;}else{var _G4=jt.getRectFromLayer(L,n.name);E.rect=_G4||E.rect;}return E&&s.setInfo(n.name,E),E==null?void 0:E.rect;}}}]);}(jt);var OS=/*#__PURE__*/function(_jt10){function OS(e){var _this60;_classCallCheck(this,OS);_this60=_callSuper(this,OS,[e]);wt(_this60,"canRotate",!1);wt(_this60,"scaleType",be.both);wt(_this60,"toolsType",It.Straight);wt(_this60,"tmpPoints",[]);wt(_this60,"workOptions");wt(_this60,"oldRect");wt(_this60,"straightTipWidth");wt(_this60,"syncTimestamp");_this60.workOptions=e.toolsOpt,_this60.straightTipWidth=_this60.workOptions.thickness/2,_this60.syncTimestamp=0,_this60.syncUnitTime=50;return _this60;}_inherits(OS,_jt10);return _createClass(OS,[{key:"consume",value:function consume(e){var n=e.data,i=e.isFullWork,s=e.isSubWorker,o=e.isMainThread,a=e.smoothSync,u=e.isSimpleWorker,d=this.workId,v=n.op,p=n.syncUnitTime,w=v==null?void 0:v.length;if(!w||w<2)return{type:xt.None};p&&(this.syncUnitTime=p);var A;if(this.tmpPoints.length===0?(this.tmpPoints=[new _t(v[0],v[1])],A=!1):A=this.updateTempPoints(v),!A)return{type:xt.None};var M;if(s||o||u){var L=i?this.fullLayer:this.drawLayer||this.fullLayer;M=this.draw({workId:d,layer:L});}if(u){var _L13=Jt(M,this.oldRect);this.oldRect=M;var G=_objectSpread({rect:_L13,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(a){var z=Date.now();z-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=z,G.op=this.tmpPoints.map(function(et){return[].concat(_toConsumableArray(et.XY),[0]);}).flat(1),G.index=0,G.isSync=!0);}return G;}if(!s&&a){var _L14=Date.now();return _L14-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_L14,_objectSpread({type:xt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(G){return[].concat(_toConsumableArray(G.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:xt.None};}var E=Jt(M,this.oldRect);return this.oldRect=M,_objectSpread({rect:E,type:xt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var e=this.workId;if(this.tmpPoints.length<2)return{type:xt.RemoveNode,removeIds:[e]};var n=this.fullLayer,i=this.draw({workId:e,layer:n});this.oldRect=i;var s=this.tmpPoints.map(function(u){return[].concat(_toConsumableArray(u.XY),[0]);}).flat(1),o=Br(s);return(a=this.vNodes)==null||a.setInfo(e,{rect:i,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&jt.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:xt.FullWork,dataType:Kt.Local,ops:o,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(e){var n=e.workId,i=e.layer,_e$isDrawEraserlines6=e.isDrawEraserlines,s=_e$isDrawEraserlines6===void 0?!0:_e$isDrawEraserlines6,_this$workOptions13=this.workOptions,o=_this$workOptions13.strokeColor,a=_this$workOptions13.thickness,u=_this$workOptions13.zIndex,d=_this$workOptions13.scale,v=_this$workOptions13.rotate,p=_this$workOptions13.translate,w=_this$workOptions13.strokeType,A=_this$workOptions13.eraserlines,M=_this$workOptions13.eraserFaces,E=_this$workOptions13.doingLines,L=_this$workOptions13.lineCap,G=_this$workOptions13.lineDash,z=i.worldPosition,et=i.worldScaling,_this$computDrawPoint9=this.computDrawPoints(a,w),x=_this$computDrawPoint9.d,y=_this$computDrawPoint9.rect,S=_this$computDrawPoint9.isDot,C=[y.x+y.w/2,y.y+y.h/2],P=new ar({pos:C,anchor:[0.5,0.5],size:[y.w,y.h],name:n,id:n,normalize:!0,zIndex:u}),X={pos:[0,0],normalize:!0,d:x,fillColor:o,strokeColor:o,lineDash:S?void 0:w===Re.Dotted?[G&&G[0]||1,(G&&G[1]||2)*a]:w===Re.LongDotted?[(G&&G[0]||1)*a,(G&&G[1]||2)*a]:void 0,lineCap:S?void 0:L,lineWidth:w===Re.Normal||S?0:a};d&&(X.scale=d),v&&(X.rotate=v),p&&(X.translate=p);var $=new Qr(X);P.append($),(A||M||E)&&(this.scaleType=be.proportional,this.drawEraserlines({group:P,eraserlines:this.getRenderableEraserLines(this.workOptions),eraserFaces:M,pos:C,layer:i},s)),this.replace(i,n,P);var K={x:Math.floor(y.x*et[0]+z[0]-jt.SafeBorderPadding),y:Math.floor(y.y*et[1]+z[1]-jt.SafeBorderPadding),w:Math.floor(y.w*et[0]+2*jt.SafeBorderPadding),h:Math.floor(y.h*et[1]+2*jt.SafeBorderPadding)};if(v||d||p){var j=$.getBoundingClientRect();K={x:Math.floor(j.x-jt.SafeBorderPadding),y:Math.floor(j.y-jt.SafeBorderPadding),w:Math.floor(j.width+jt.SafeBorderPadding*2),h:Math.floor(j.height+jt.SafeBorderPadding*2)};}return this.isDelete&&P.setAttribute("opacity",0),K;}},{key:"computDrawPoints",value:function computDrawPoints(e,n){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(e,n):this.computDotPoints(e);}},{key:"computFullPoints",value:function computFullPoints(e,n){var i=Ct.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),s=Ct.Per(i).mul(e/2),o=_t.Sub(this.tmpPoints[0],s),a=_t.Add(this.tmpPoints[0],s),u=_t.Sub(this.tmpPoints[1],s),d=_t.Add(this.tmpPoints[1],s),v=_t.GetSemicircleStroke(this.tmpPoints[1],u,-1,8),p=_t.GetSemicircleStroke(this.tmpPoints[0],a,-1,8),w=[o,u].concat(_toConsumableArray(v),[d,a],_toConsumableArray(p));var A;return n!==Re.Normal?A=Ii(this.tmpPoints,!1):A=Ii(w,!0),{d:A,rect:$e(w),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(e){var n=_t.GetDotStroke(this.tmpPoints[0],e/2,8);return{d:Ii(n,!0),rect:$e(n),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(e){var n=e.slice(-2),i=new _t(n[0],n[1]),s=this.tmpPoints[0],o=this.workOptions.thickness;if(s.isNear(i,o))return!1;if(this.tmpPoints.length===2){if(i.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=i;}else this.tmpPoints.push(i);return!0;}},{key:"consumeService",value:function consumeService(e){var d,v;var n=e.op,i=e.isFullWork,_e$workState8=e.workState,s=_e$workState8===void 0?te.Done:_e$workState8,o=(d=this.workId)==null?void 0:d.toString();if(!o)return;this.tmpPoints.length=0;for(var p=0;p<n.length;p+=3)this.tmpPoints.push(new _t(n[p],n[p+1],n[p+2]));var a=i?this.fullLayer:this.drawLayer||this.fullLayer,u=this.draw({workId:o,layer:a,isDrawEraserlines:s===te.Done});return this.oldRect=u,(v=this.vNodes)==null||v.setInfo(o,{rect:u,op:n,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:u&&jt.getCenterPos(u,a)}),u;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return this.normalizeDrawableStorageData(e);}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var d,v;var n=e.node,i=e.opt,s=e.vNodes,o=i.strokeColor,a=i.strokeType,u=s.get(n.name);return o&&(n.tagName==="GROUP"?n.children.forEach(function(p){p.setAttribute("strokeColor",o),p.getAttribute("fillColor")&&p.setAttribute("fillColor",o);}):(n.setAttribute("strokeColor",o),n.setAttribute("fillColor",o)),(d=u==null?void 0:u.opt)!=null&&d.strokeColor&&(u.opt.strokeColor=o)),a&&u!=null&&u.opt&&(v=u.opt)!=null&&v.strokeType&&(u.opt.strokeType=a),u&&s.setInfo(n.name,u),jt.updateNodeOpt(e);}}]);}(jt);var Po="cursorhover",h1=20,Ds="mainView";var d1={exports:{}},tr={},cp={exports:{}},Xs={};function DS(){var r={};return r["align-content"]=!1,r["align-items"]=!1,r["align-self"]=!1,r["alignment-adjust"]=!1,r["alignment-baseline"]=!1,r.all=!1,r["anchor-point"]=!1,r.animation=!1,r["animation-delay"]=!1,r["animation-direction"]=!1,r["animation-duration"]=!1,r["animation-fill-mode"]=!1,r["animation-iteration-count"]=!1,r["animation-name"]=!1,r["animation-play-state"]=!1,r["animation-timing-function"]=!1,r.azimuth=!1,r["backface-visibility"]=!1,r.background=!0,r["background-attachment"]=!0,r["background-clip"]=!0,r["background-color"]=!0,r["background-image"]=!0,r["background-origin"]=!0,r["background-position"]=!0,r["background-repeat"]=!0,r["background-size"]=!0,r["baseline-shift"]=!1,r.binding=!1,r.bleed=!1,r["bookmark-label"]=!1,r["bookmark-level"]=!1,r["bookmark-state"]=!1,r.border=!0,r["border-bottom"]=!0,r["border-bottom-color"]=!0,r["border-bottom-left-radius"]=!0,r["border-bottom-right-radius"]=!0,r["border-bottom-style"]=!0,r["border-bottom-width"]=!0,r["border-collapse"]=!0,r["border-color"]=!0,r["border-image"]=!0,r["border-image-outset"]=!0,r["border-image-repeat"]=!0,r["border-image-slice"]=!0,r["border-image-source"]=!0,r["border-image-width"]=!0,r["border-left"]=!0,r["border-left-color"]=!0,r["border-left-style"]=!0,r["border-left-width"]=!0,r["border-radius"]=!0,r["border-right"]=!0,r["border-right-color"]=!0,r["border-right-style"]=!0,r["border-right-width"]=!0,r["border-spacing"]=!0,r["border-style"]=!0,r["border-top"]=!0,r["border-top-color"]=!0,r["border-top-left-radius"]=!0,r["border-top-right-radius"]=!0,r["border-top-style"]=!0,r["border-top-width"]=!0,r["border-width"]=!0,r.bottom=!1,r["box-decoration-break"]=!0,r["box-shadow"]=!0,r["box-sizing"]=!0,r["box-snap"]=!0,r["box-suppress"]=!0,r["break-after"]=!0,r["break-before"]=!0,r["break-inside"]=!0,r["caption-side"]=!1,r.chains=!1,r.clear=!0,r.clip=!1,r["clip-path"]=!1,r["clip-rule"]=!1,r.color=!0,r["color-interpolation-filters"]=!0,r["column-count"]=!1,r["column-fill"]=!1,r["column-gap"]=!1,r["column-rule"]=!1,r["column-rule-color"]=!1,r["column-rule-style"]=!1,r["column-rule-width"]=!1,r["column-span"]=!1,r["column-width"]=!1,r.columns=!1,r.contain=!1,r.content=!1,r["counter-increment"]=!1,r["counter-reset"]=!1,r["counter-set"]=!1,r.crop=!1,r.cue=!1,r["cue-after"]=!1,r["cue-before"]=!1,r.cursor=!1,r.direction=!1,r.display=!0,r["display-inside"]=!0,r["display-list"]=!0,r["display-outside"]=!0,r["dominant-baseline"]=!1,r.elevation=!1,r["empty-cells"]=!1,r.filter=!1,r.flex=!1,r["flex-basis"]=!1,r["flex-direction"]=!1,r["flex-flow"]=!1,r["flex-grow"]=!1,r["flex-shrink"]=!1,r["flex-wrap"]=!1,r.float=!1,r["float-offset"]=!1,r["flood-color"]=!1,r["flood-opacity"]=!1,r["flow-from"]=!1,r["flow-into"]=!1,r.font=!0,r["font-family"]=!0,r["font-feature-settings"]=!0,r["font-kerning"]=!0,r["font-language-override"]=!0,r["font-size"]=!0,r["font-size-adjust"]=!0,r["font-stretch"]=!0,r["font-style"]=!0,r["font-synthesis"]=!0,r["font-variant"]=!0,r["font-variant-alternates"]=!0,r["font-variant-caps"]=!0,r["font-variant-east-asian"]=!0,r["font-variant-ligatures"]=!0,r["font-variant-numeric"]=!0,r["font-variant-position"]=!0,r["font-weight"]=!0,r.grid=!1,r["grid-area"]=!1,r["grid-auto-columns"]=!1,r["grid-auto-flow"]=!1,r["grid-auto-rows"]=!1,r["grid-column"]=!1,r["grid-column-end"]=!1,r["grid-column-start"]=!1,r["grid-row"]=!1,r["grid-row-end"]=!1,r["grid-row-start"]=!1,r["grid-template"]=!1,r["grid-template-areas"]=!1,r["grid-template-columns"]=!1,r["grid-template-rows"]=!1,r["hanging-punctuation"]=!1,r.height=!0,r.hyphens=!1,r.icon=!1,r["image-orientation"]=!1,r["image-resolution"]=!1,r["ime-mode"]=!1,r["initial-letters"]=!1,r["inline-box-align"]=!1,r["justify-content"]=!1,r["justify-items"]=!1,r["justify-self"]=!1,r.left=!1,r["letter-spacing"]=!0,r["lighting-color"]=!0,r["line-box-contain"]=!1,r["line-break"]=!1,r["line-grid"]=!1,r["line-height"]=!1,r["line-snap"]=!1,r["line-stacking"]=!1,r["line-stacking-ruby"]=!1,r["line-stacking-shift"]=!1,r["line-stacking-strategy"]=!1,r["list-style"]=!0,r["list-style-image"]=!0,r["list-style-position"]=!0,r["list-style-type"]=!0,r.margin=!0,r["margin-bottom"]=!0,r["margin-left"]=!0,r["margin-right"]=!0,r["margin-top"]=!0,r["marker-offset"]=!1,r["marker-side"]=!1,r.marks=!1,r.mask=!1,r["mask-box"]=!1,r["mask-box-outset"]=!1,r["mask-box-repeat"]=!1,r["mask-box-slice"]=!1,r["mask-box-source"]=!1,r["mask-box-width"]=!1,r["mask-clip"]=!1,r["mask-image"]=!1,r["mask-origin"]=!1,r["mask-position"]=!1,r["mask-repeat"]=!1,r["mask-size"]=!1,r["mask-source-type"]=!1,r["mask-type"]=!1,r["max-height"]=!0,r["max-lines"]=!1,r["max-width"]=!0,r["min-height"]=!0,r["min-width"]=!0,r["move-to"]=!1,r["nav-down"]=!1,r["nav-index"]=!1,r["nav-left"]=!1,r["nav-right"]=!1,r["nav-up"]=!1,r["object-fit"]=!1,r["object-position"]=!1,r.opacity=!1,r.order=!1,r.orphans=!1,r.outline=!1,r["outline-color"]=!1,r["outline-offset"]=!1,r["outline-style"]=!1,r["outline-width"]=!1,r.overflow=!1,r["overflow-wrap"]=!1,r["overflow-x"]=!1,r["overflow-y"]=!1,r.padding=!0,r["padding-bottom"]=!0,r["padding-left"]=!0,r["padding-right"]=!0,r["padding-top"]=!0,r.page=!1,r["page-break-after"]=!1,r["page-break-before"]=!1,r["page-break-inside"]=!1,r["page-policy"]=!1,r.pause=!1,r["pause-after"]=!1,r["pause-before"]=!1,r.perspective=!1,r["perspective-origin"]=!1,r.pitch=!1,r["pitch-range"]=!1,r["play-during"]=!1,r.position=!1,r["presentation-level"]=!1,r.quotes=!1,r["region-fragment"]=!1,r.resize=!1,r.rest=!1,r["rest-after"]=!1,r["rest-before"]=!1,r.richness=!1,r.right=!1,r.rotation=!1,r["rotation-point"]=!1,r["ruby-align"]=!1,r["ruby-merge"]=!1,r["ruby-position"]=!1,r["shape-image-threshold"]=!1,r["shape-outside"]=!1,r["shape-margin"]=!1,r.size=!1,r.speak=!1,r["speak-as"]=!1,r["speak-header"]=!1,r["speak-numeral"]=!1,r["speak-punctuation"]=!1,r["speech-rate"]=!1,r.stress=!1,r["string-set"]=!1,r["tab-size"]=!1,r["table-layout"]=!1,r["text-align"]=!0,r["text-align-last"]=!0,r["text-combine-upright"]=!0,r["text-decoration"]=!0,r["text-decoration-color"]=!0,r["text-decoration-line"]=!0,r["text-decoration-skip"]=!0,r["text-decoration-style"]=!0,r["text-emphasis"]=!0,r["text-emphasis-color"]=!0,r["text-emphasis-position"]=!0,r["text-emphasis-style"]=!0,r["text-height"]=!0,r["text-indent"]=!0,r["text-justify"]=!0,r["text-orientation"]=!0,r["text-overflow"]=!0,r["text-shadow"]=!0,r["text-space-collapse"]=!0,r["text-transform"]=!0,r["text-underline-position"]=!0,r["text-wrap"]=!0,r.top=!1,r.transform=!1,r["transform-origin"]=!1,r["transform-style"]=!1,r.transition=!1,r["transition-delay"]=!1,r["transition-duration"]=!1,r["transition-property"]=!1,r["transition-timing-function"]=!1,r["unicode-bidi"]=!1,r["vertical-align"]=!1,r.visibility=!1,r["voice-balance"]=!1,r["voice-duration"]=!1,r["voice-family"]=!1,r["voice-pitch"]=!1,r["voice-range"]=!1,r["voice-rate"]=!1,r["voice-stress"]=!1,r["voice-volume"]=!1,r.volume=!1,r["white-space"]=!1,r.widows=!1,r.width=!0,r["will-change"]=!1,r["word-break"]=!0,r["word-spacing"]=!0,r["word-wrap"]=!0,r["wrap-flow"]=!1,r["wrap-through"]=!1,r["writing-mode"]=!1,r["z-index"]=!1,r;}function XCt(r,t,e){}function GCt(r,t,e){}var HCt=/javascript\s*\:/img;function VCt(r,t){return HCt.test(t)?"":t;}Xs.whiteList=DS();Xs.getDefaultWhiteList=DS;Xs.onAttr=XCt;Xs.onIgnoreAttr=GCt;Xs.safeAttrValue=VCt;var ZCt={indexOf:function indexOf(r,t){var e,n;if(Array.prototype.indexOf)return r.indexOf(t);for(e=0,n=r.length;e<n;e++)if(r[e]===t)return e;return-1;},forEach:function forEach(r,t,e){var n,i;if(Array.prototype.forEach)return r.forEach(t,e);for(n=0,i=r.length;n<i;n++)t.call(e,r[n],n,r);},trim:function trim(r){return String.prototype.trim?r.trim():r.replace(/(^\s*)|(\s*$)/g,"");},trimRight:function trimRight(r){return String.prototype.trimRight?r.trimRight():r.replace(/(\s*$)/g,"");}},Pa=ZCt;function qCt(r,t){r=Pa.trimRight(r),r[r.length-1]!==";"&&(r+=";");var e=r.length,n=!1,i=0,s=0,o="";function a(){if(!n){var v=Pa.trim(r.slice(i,s)),p=v.indexOf(":");if(p!==-1){var w=Pa.trim(v.slice(0,p)),A=Pa.trim(v.slice(p+1));if(w){var M=t(i,o.length,w,A,v);M&&(o+=M+"; ");}}}i=s+1;}for(;s<e;s++){var u=r[s];if(u==="/"&&r[s+1]==="*"){var d=r.indexOf("*/",s+2);if(d===-1)break;s=d+1,i=s+1,n=!1;}else u==="("?n=!0:u===")"?n=!1:u===";"?n||a():u==="\n"&&a();}return Pa.trim(o);}var KCt=qCt,Wc=Xs,QCt=KCt;function p1(r){return r==null;}function JCt(r){var t={};for(var e in r)t[e]=r[e];return t;}function RS(r){r=JCt(r||{}),r.whiteList=r.whiteList||Wc.whiteList,r.onAttr=r.onAttr||Wc.onAttr,r.onIgnoreAttr=r.onIgnoreAttr||Wc.onIgnoreAttr,r.safeAttrValue=r.safeAttrValue||Wc.safeAttrValue,this.options=r;}RS.prototype.process=function(r){if(r=r||"",r=r.toString(),!r)return"";var t=this,e=t.options,n=e.whiteList,i=e.onAttr,s=e.onIgnoreAttr,o=e.safeAttrValue,a=QCt(r,function(u,d,v,p,w){var A=n[v],M=!1;if(A===!0?M=A:typeof A=="function"?M=A(p):A instanceof RegExp&&(M=A.test(p)),M!==!0&&(M=!1),p=o(v,p),!!p){var E={position:d,sourcePosition:u,source:w,isWhite:M};if(M){var L=i(v,p,E);return p1(L)?v+":"+p:L;}else{var L=s(v,p,E);if(!p1(L))return L;}}});return a;};var _Ct=RS;(function(r,t){var e=Xs,n=_Ct;function i(o,a){var u=new n(a);return u.process(o);}t=r.exports=i,t.FilterCSS=n;for(var s in e)t[s]=e[s];(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(window.filterCSS=r.exports);})(cp,cp.exports);var S0=cp.exports,I0={indexOf:function indexOf(r,t){var e,n;if(Array.prototype.indexOf)return r.indexOf(t);for(e=0,n=r.length;e<n;e++)if(r[e]===t)return e;return-1;},forEach:function forEach(r,t,e){var n,i;if(Array.prototype.forEach)return r.forEach(t,e);for(n=0,i=r.length;n<i;n++)t.call(e,r[n],n,r);},trim:function trim(r){return String.prototype.trim?r.trim():r.replace(/(^\s*)|(\s*$)/g,"");},spaceIndex:function spaceIndex(r){var t=/\s|\n|\t/,e=t.exec(r);return e?e.index:-1;}},tPt=S0.FilterCSS,ePt=S0.getDefaultWhiteList,gu=I0;function NS(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]};}var BS=new tPt();function rPt(r,t,e){}function nPt(r,t,e){}function iPt(r,t,e){}function sPt(r,t,e){}function kS(r){return r.replace(aPt,"<").replace(lPt,">");}function oPt(r,t,e,n){if(e=YS(e),t==="href"||t==="src"){if(e=gu.trim(e),e==="#")return"#";if(!(e.substr(0,7)==="http://"||e.substr(0,8)==="https://"||e.substr(0,7)==="mailto:"||e.substr(0,4)==="tel:"||e.substr(0,11)==="data:image/"||e.substr(0,6)==="ftp://"||e.substr(0,2)==="./"||e.substr(0,3)==="../"||e[0]==="#"||e[0]==="/"))return"";}else if(t==="background"){if(Uc.lastIndex=0,Uc.test(e))return"";}else if(t==="style"){if(v1.lastIndex=0,v1.test(e)||(g1.lastIndex=0,g1.test(e)&&(Uc.lastIndex=0,Uc.test(e))))return"";n!==!1&&(n=n||BS,e=n.process(e));}return e=jS(e),e;}var aPt=/</g,lPt=/>/g,cPt=/"/g,uPt=/"/g,fPt=/&#([a-zA-Z0-9]*);?/gim,hPt=/:?/gim,dPt=/&newline;?/gim,Uc=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,v1=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,g1=/u\s*r\s*l\s*\(.*/gi;function FS(r){return r.replace(cPt,""");}function WS(r){return r.replace(uPt,'"');}function US(r){return r.replace(fPt,function(e,n){return n[0]==="x"||n[0]==="X"?String.fromCharCode(parseInt(n.substr(1),16)):String.fromCharCode(parseInt(n,10));});}function zS(r){return r.replace(hPt,":").replace(dPt," ");}function $S(r){for(var t="",e=0,n=r.length;e<n;e++)t+=r.charCodeAt(e)<32?" ":r.charAt(e);return gu.trim(t);}function YS(r){return r=WS(r),r=US(r),r=zS(r),r=$S(r),r;}function jS(r){return r=FS(r),r=kS(r),r;}function pPt(){return"";}function vPt(r,t){typeof t!="function"&&(t=function t(){});var e=!Array.isArray(r);function n(o){return e?!0:gu.indexOf(r,o)!==-1;}var i=[],s=!1;return{onIgnoreTag:function onIgnoreTag(o,a,u){if(n(o)){if(u.isClosing){var d="[/removed]",v=u.position+d.length;return i.push([s!==!1?s:u.position,v]),s=!1,d;}else return s||(s=u.position),"[removed]";}else return t(o,a,u);},remove:function remove(o){var a="",u=0;return gu.forEach(i,function(d){a+=o.slice(u,d[0]),u=d[1];}),a+=o.slice(u),a;}};}function gPt(r){for(var t="",e=0;e<r.length;){var n=r.indexOf("<!--",e);if(n===-1){t+=r.slice(e);break;}t+=r.slice(e,n);var i=r.indexOf("-->",n);if(i===-1)break;e=i+3;}return t;}function mPt(r){var t=r.split("");return t=t.filter(function(e){var n=e.charCodeAt(0);return n===127?!1:n<=31?n===10||n===13:!0;}),t.join("");}tr.whiteList=NS();tr.getDefaultWhiteList=NS;tr.onTag=rPt;tr.onIgnoreTag=nPt;tr.onTagAttr=iPt;tr.onIgnoreTagAttr=sPt;tr.safeAttrValue=oPt;tr.escapeHtml=kS;tr.escapeQuote=FS;tr.unescapeQuote=WS;tr.escapeHtmlEntities=US;tr.escapeDangerHtml5Entities=zS;tr.clearNonPrintableCharacter=$S;tr.friendlyAttrValue=YS;tr.escapeAttrValue=jS;tr.onIgnoreTagStripAll=pPt;tr.StripTagBody=vPt;tr.stripCommentTag=gPt;tr.stripBlankChar=mPt;tr.attributeWrapSign='"';tr.cssFilter=BS;tr.getDefaultCSSWhiteList=ePt;var lf={},Gi=I0;function yPt(r){var t=Gi.spaceIndex(r),e;return t===-1?e=r.slice(1,-1):e=r.slice(1,t+1),e=Gi.trim(e).toLowerCase(),e.slice(0,1)==="/"&&(e=e.slice(1)),e.slice(-1)==="/"&&(e=e.slice(0,-1)),e;}function wPt(r){return r.slice(0,2)==="</";}function SPt(r,t,e){var n="",i=0,s=!1,o=!1,a=0,u=r.length,d="",v="";t:for(a=0;a<u;a++){var p=r.charAt(a);if(s===!1){if(p==="<"){s=a;continue;}}else if(o===!1){if(p==="<"){n+=e(r.slice(i,a)),s=a,i=a;continue;}if(p===">"||a===u-1){n+=e(r.slice(i,s)),v=r.slice(s,a+1),d=yPt(v),n+=t(s,n.length,d,v,wPt(v)),i=a+1,s=!1;continue;}if(p==='"'||p==="'")for(var w=1,A=r.charAt(a-w);A.trim()===""||A==="=";){if(A==="="){o=p;continue t;}A=r.charAt(a-++w);}}else if(p===o){o=!1;continue;}}return i<u&&(n+=e(r.substr(i))),n;}var IPt=/[^a-zA-Z0-9\\_:.-]/gim;function TPt(r,t){var e=0,n=0,i=[],s=!1,o=r.length;function a(w,A){if(w=Gi.trim(w),w=w.replace(IPt,"").toLowerCase(),!(w.length<1)){var M=t(w,A||"");M&&i.push(M);}}for(var u=0;u<o;u++){var d=r.charAt(u),v,p;if(s===!1&&d==="="){s=r.slice(e,u),e=u+1,n=r.charAt(e)==='"'||r.charAt(e)==="'"?e:CPt(r,u+1);continue;}if(s!==!1&&u===n){if(p=r.indexOf(d,u+1),p===-1)break;v=Gi.trim(r.slice(n+1,p)),a(s,v),s=!1,u=p,e=u+1;continue;}if(/\s|\n|\t/.test(d))if(r=r.replace(/\s|\n|\t/g," "),s===!1){if(p=xPt(r,u),p===-1){v=Gi.trim(r.slice(e,u)),a(v),s=!1,e=u+1;continue;}else{u=p-1;continue;}}else if(p=PPt(r,u-1),p===-1){v=Gi.trim(r.slice(e,u)),v=m1(v),a(s,v),s=!1,e=u+1;continue;}else continue;}return e<r.length&&(s===!1?a(r.slice(e)):a(s,m1(Gi.trim(r.slice(e))))),Gi.trim(i.join(" "));}function xPt(r,t){for(;t<r.length;t++){var e=r[t];if(e!==" ")return e==="="?t:-1;}}function CPt(r,t){for(;t<r.length;t++){var e=r[t];if(e!==" ")return e==="'"||e==='"'?t:-1;}}function PPt(r,t){for(;t>0;t--){var e=r[t];if(e!==" ")return e==="="?t:-1;}}function APt(r){return r[0]==='"'&&r[r.length-1]==='"'||r[0]==="'"&&r[r.length-1]==="'";}function m1(r){return APt(r)?r.substr(1,r.length-2):r;}lf.parseTag=SPt;lf.parseAttr=TPt;var bPt=S0.FilterCSS,xn=tr,XS=lf,MPt=XS.parseTag,EPt=XS.parseAttr,_c=I0;function zc(r){return r==null;}function LPt(r){var t=_c.spaceIndex(r);if(t===-1)return{html:"",closing:r[r.length-2]==="/"};r=_c.trim(r.slice(t+1,-1));var e=r[r.length-1]==="/";return e&&(r=_c.trim(r.slice(0,-1))),{html:r,closing:e};}function OPt(r){var t={};for(var e in r)t[e]=r[e];return t;}function DPt(r){var t={};for(var e in r)Array.isArray(r[e])?t[e.toLowerCase()]=r[e].map(function(n){return n.toLowerCase();}):t[e.toLowerCase()]=r[e];return t;}function GS(r){r=OPt(r||{}),r.stripIgnoreTag&&(r.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),r.onIgnoreTag=xn.onIgnoreTagStripAll),r.whiteList||r.allowList?r.whiteList=DPt(r.whiteList||r.allowList):r.whiteList=xn.whiteList,this.attributeWrapSign=r.singleQuotedAttributeValue===!0?"'":xn.attributeWrapSign,r.onTag=r.onTag||xn.onTag,r.onTagAttr=r.onTagAttr||xn.onTagAttr,r.onIgnoreTag=r.onIgnoreTag||xn.onIgnoreTag,r.onIgnoreTagAttr=r.onIgnoreTagAttr||xn.onIgnoreTagAttr,r.safeAttrValue=r.safeAttrValue||xn.safeAttrValue,r.escapeHtml=r.escapeHtml||xn.escapeHtml,this.options=r,r.css===!1?this.cssFilter=!1:(r.css=r.css||{},this.cssFilter=new bPt(r.css));}GS.prototype.process=function(r){if(r=r||"",r=r.toString(),!r)return"";var t=this,e=t.options,n=e.whiteList,i=e.onTag,s=e.onIgnoreTag,o=e.onTagAttr,a=e.onIgnoreTagAttr,u=e.safeAttrValue,d=e.escapeHtml,v=t.attributeWrapSign,p=t.cssFilter;e.stripBlankChar&&(r=xn.stripBlankChar(r)),e.allowCommentTag||(r=xn.stripCommentTag(r));var w=!1;e.stripIgnoreTagBody&&(w=xn.StripTagBody(e.stripIgnoreTagBody,s),s=w.onIgnoreTag);var A=MPt(r,function(M,E,L,G,z){var et={sourcePosition:M,position:E,isClosing:z,isWhite:Object.prototype.hasOwnProperty.call(n,L)},x=i(L,G,et);if(!zc(x))return x;if(et.isWhite){if(et.isClosing)return"</"+L+">";var y=LPt(G),S=n[L],C=EPt(y.html,function(P,X){var $=_c.indexOf(S,P)!==-1,K=o(L,P,X,$);return zc(K)?$?(X=u(L,P,X,p),X?P+"="+v+X+v:P):(K=a(L,P,X,$),zc(K)?void 0:K):K;});return G="<"+L,C&&(G+=" "+C),y.closing&&(G+=" /"),G+=">",G;}else return x=s(L,G,et),zc(x)?d(G):x;},d);return w&&(A=w.remove(A)),A;};var RPt=GS;(function(r,t){var e=tr,n=lf,i=RPt;function s(a,u){var d=new i(u);return d.process(a);}t=r.exports=s,t.filterXSS=s,t.FilterXSS=i,function(){for(var a in e)t[a]=e[a];for(var u in n)t[u]=n[u];}(),(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(window.filterXSS=r.exports);function o(){return(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&(typeof DedicatedWorkerGlobalScope==="undefined"?"undefined":_typeof(DedicatedWorkerGlobalScope))<"u"&&self instanceof DedicatedWorkerGlobalScope;}o()&&(self.filterXSS=r.exports);})(d1,d1.exports);var mu={exports:{}};/**
|
|
438
438
|
* @license
|
|
439
439
|
* Lodash <https://lodash.com/>
|
|
440
440
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -477,16 +477,16 @@ wt(Ao,"eraserSizes",v0);var pu=Ao;var Rxt="__lodash_hash_undefined__";function N
|
|
|
477
477
|
Ht=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
478
478
|
it&&(Ht=="offset"||Ht=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
479
479
|
mt&&(Ht=="buffer"||Ht=="byteLength"||Ht=="byteOffset")||// Skip index properties.
|
|
480
|
-
ii(Ht,kt)))&&Ot.push(Ht);return Ot;}function Q0(l){var f=l.length;return f?l[Kf(0,f-1)]:e;}function FT(l,f){return Zl(jr(l),hs(f,0,l.length));}function WT(l){return Zl(jr(l));}function zf(l,f,T){(T!==e&&!On(l[f],T)||T===e&&!(f in l))&&Xn(l,f,T);}function na(l,f,T){var W=l[f];(!(Ue.call(l,f)&&On(W,T))||T===e&&!(f in l))&&Xn(l,f,T);}function Bl(l,f){for(var T=l.length;T--;)if(On(l[T][0],f))return T;return-1;}function UT(l,f,T,W){return Ri(l,function(it,mt,At){f(W,it,T(it),At);}),W;}function J0(l,f){return l&&Hn(f,gr(f),l);}function zT(l,f){return l&&Hn(f,Gr(f),l);}function Xn(l,f,T){f=="__proto__"&&El?El(l,f,{configurable:!0,enumerable:!0,value:T,writable:!0}):l[f]=T;}function $f(l,f){for(var T=-1,W=f.length,it=zt(W),mt=l==null;++T<W;)it[T]=mt?e:Th(l,f[T]);return it;}function hs(l,f,T){return l===l&&(T!==e&&(l=l<=T?l:T),f!==e&&(l=l>=f?l:f)),l;}function wn(l,f,T,W,it,mt){var At,Ot=f&w,kt=f&A,Ht=f&M;if(T&&(At=it?T(l,W,it,mt):T(l)),At!==e)return At;if(!er(l))return l;var Vt=ge(l);if(Vt){if(At=Mx(l),!Ot)return jr(l,At);}else{var qt=Lr(l),ie=qt==J||qt==Q;if(Fi(l))return Tv(l,Ot);if(qt==I||qt==at||ie&&!it){if(At=kt||ie?{}:$v(l),!Ot)return kt?mx(l,zT(At,l)):gx(l,J0(At,l));}else{if(!He[qt])return it?l:{};At=Ex(l,qt,Ot);}}mt||(mt=new En());var ce=mt.get(l);if(ce)return ce;mt.set(l,At),gg(l)?l.forEach(function(fe){At.add(wn(fe,f,T,fe,l,mt));}):pg(l)&&l.forEach(function(fe,Ae){At.set(Ae,wn(fe,f,T,Ae,l,mt));});var de=Ht?kt?ah:oh:kt?Gr:gr,xe=Vt?e:de(l);return nn(xe||l,function(fe,Ae){xe&&(Ae=fe,fe=l[Ae]),na(At,Ae,wn(fe,f,T,Ae,l,mt));}),At;}function $T(l){var f=gr(l);return function(T){return _0(T,l,f);};}function _0(l,f,T){var W=T.length;if(l==null)return!W;for(l=Xe(l);W--;){var it=T[W],mt=f[it],At=l[it];if(At===e&&!(it in l)||!mt(At))return!1;}return!0;}function tv(l,f,T){if(typeof l!="function")throw new mn(o);return ua(function(){l.apply(e,T);},f);}function ia(l,f,T,W){var it=-1,mt=yl,At=!0,Ot=l.length,kt=[],Ht=f.length;if(!Ot)return kt;T&&(f=Je(f,sn(T))),W?(mt=bf,At=!1):f.length>=i&&(mt=Qo,At=!1,f=new fs(f));t:for(;++it<Ot;){var Vt=l[it],qt=T==null?Vt:T(Vt);if(Vt=W||Vt!==0?Vt:0,At&&qt===qt){for(var ie=Ht;ie--;)if(f[ie]===qt)continue t;kt.push(Vt);}else mt(f,qt,W)||kt.push(Vt);}return kt;}var Ri=bv(Gn),ev=bv(jf,!0);function YT(l,f){var T=!0;return Ri(l,function(W,it,mt){return T=!!f(W,it,mt),T;}),T;}function kl(l,f,T){for(var W=-1,it=l.length;++W<it;){var mt=l[W],At=f(mt);if(At!=null&&(Ot===e?At===At&&!an(At):T(At,Ot)))var Ot=At,kt=mt;}return kt;}function jT(l,f,T,W){var it=l.length;for(T=Ie(T),T<0&&(T=-T>it?0:it+T),W=W===e||W>it?it:Ie(W),W<0&&(W+=it),W=T>W?0:yg(W);T<W;)l[T++]=f;return l;}function rv(l,f){var T=[];return Ri(l,function(W,it,mt){f(W,it,mt)&&T.push(W);}),T;}function Tr(l,f,T,W,it){var mt=-1,At=l.length;for(T||(T=Ox),it||(it=[]);++mt<At;){var Ot=l[mt];f>0&&T(Ot)?f>1?Tr(Ot,f-1,T,W,it):Li(it,Ot):W||(it[it.length]=Ot);}return it;}var Yf=Mv(),nv=Mv(!0);function Gn(l,f){return l&&Yf(l,f,gr);}function jf(l,f){return l&&nv(l,f,gr);}function Fl(l,f){return Ei(f,function(T){return si(l[T]);});}function ds(l,f){f=Bi(f,l);for(var T=0,W=f.length;l!=null&&T<W;)l=l[Ln(f[T++])];return T&&T==W?l:e;}function iv(l,f,T){var W=f(l);return ge(l)?W:Li(W,T(l));}function kr(l){return l==null?l===e?gt:g:cs&&cs in Xe(l)?Px(l):Wx(l);}function Xf(l,f){return l>f;}function XT(l,f){return l!=null&&Ue.call(l,f);}function GT(l,f){return l!=null&&f in Xe(l);}function HT(l,f,T){return l>=Er(f,T)&&l<hr(f,T);}function Gf(l,f,T){for(var W=T?bf:yl,it=l[0].length,mt=l.length,At=mt,Ot=zt(mt),kt=1/0,Ht=[];At--;){var Vt=l[At];At&&f&&(Vt=Je(Vt,sn(f))),kt=Er(Vt.length,kt),Ot[At]=!T&&(f||it>=120&&Vt.length>=120)?new fs(At&&Vt):e;}Vt=l[0];var qt=-1,ie=Ot[0];t:for(;++qt<it&&Ht.length<kt;){var ce=Vt[qt],de=f?f(ce):ce;if(ce=T||ce!==0?ce:0,!(ie?Qo(ie,de):W(Ht,de,T))){for(At=mt;--At;){var xe=Ot[At];if(!(xe?Qo(xe,de):W(l[At],de,T)))continue t;}ie&&ie.push(de),Ht.push(ce);}}return Ht;}function VT(l,f,T,W){return Gn(l,function(it,mt,At){f(W,T(it),mt,At);}),W;}function sa(l,f,T){f=Bi(f,l),l=Gv(l,f);var W=l==null?l:l[Ln(In(f))];return W==null?e:rn(W,l,T);}function sv(l){return rr(l)&&kr(l)==at;}function ZT(l){return rr(l)&&kr(l)==Lt;}function qT(l){return rr(l)&&kr(l)==Dt;}function oa(l,f,T,W,it){return l===f?!0:l==null||f==null||!rr(l)&&!rr(f)?l!==l&&f!==f:KT(l,f,T,W,oa,it);}function KT(l,f,T,W,it,mt){var At=ge(l),Ot=ge(f),kt=At?ht:Lr(l),Ht=Ot?ht:Lr(f);kt=kt==at?I:kt,Ht=Ht==at?I:Ht;var Vt=kt==I,qt=Ht==I,ie=kt==Ht;if(ie&&Fi(l)){if(!Fi(f))return!1;At=!0,Vt=!1;}if(ie&&!Vt)return mt||(mt=new En()),At||lo(l)?Wv(l,f,T,W,it,mt):xx(l,f,kt,T,W,it,mt);if(!(T&E)){var ce=Vt&&Ue.call(l,"__wrapped__"),de=qt&&Ue.call(f,"__wrapped__");if(ce||de){var xe=ce?l.value():l,fe=de?f.value():f;return mt||(mt=new En()),it(xe,fe,T,W,mt);}}return ie?(mt||(mt=new En()),Cx(l,f,T,W,it,mt)):!1;}function QT(l){return rr(l)&&Lr(l)==V;}function Hf(l,f,T,W){var it=T.length,mt=it,At=!W;if(l==null)return!mt;for(l=Xe(l);it--;){var Ot=T[it];if(At&&Ot[2]?Ot[1]!==l[Ot[0]]:!(Ot[0]in l))return!1;}for(;++it<mt;){Ot=T[it];var kt=Ot[0],Ht=l[kt],Vt=Ot[1];if(At&&Ot[2]){if(Ht===e&&!(kt in l))return!1;}else{var qt=new En();if(W)var ie=W(Ht,Vt,kt,l,f,qt);if(!(ie===e?oa(Vt,Ht,E|L,W,qt):ie))return!1;}}return!0;}function ov(l){if(!er(l)||Rx(l))return!1;var f=si(l)?QI:ff;return f.test(vs(l));}function JT(l){return rr(l)&&kr(l)==st;}function _T(l){return rr(l)&&Lr(l)==ft;}function tx(l){return rr(l)&&tc(l.length)&&!!qe[kr(l)];}function av(l){return typeof l=="function"?l:l==null?Hr:_typeof(l)=="object"?ge(l)?uv(l[0],l[1]):cv(l):Lg(l);}function Vf(l){if(!ca(l))return nT(l);var f=[];for(var T in Xe(l))Ue.call(l,T)&&T!="constructor"&&f.push(T);return f;}function ex(l){if(!er(l))return Fx(l);var f=ca(l),T=[];for(var W in l)W=="constructor"&&(f||!Ue.call(l,W))||T.push(W);return T;}function Zf(l,f){return l<f;}function lv(l,f){var T=-1,W=Xr(l)?zt(l.length):[];return Ri(l,function(it,mt,At){W[++T]=f(it,mt,At);}),W;}function cv(l){var f=ch(l);return f.length==1&&f[0][2]?jv(f[0][0],f[0][1]):function(T){return T===l||Hf(T,l,f);};}function uv(l,f){return fh(l)&&Yv(f)?jv(Ln(l),f):function(T){var W=Th(T,l);return W===e&&W===f?xh(T,l):oa(f,W,E|L);};}function Wl(l,f,T,W,it){l!==f&&Yf(f,function(mt,At){if(it||(it=new En()),er(mt))rx(l,f,At,T,Wl,W,it);else{var Ot=W?W(dh(l,At),mt,At+"",l,f,it):e;Ot===e&&(Ot=mt),zf(l,At,Ot);}},Gr);}function rx(l,f,T,W,it,mt,At){var Ot=dh(l,T),kt=dh(f,T),Ht=At.get(kt);if(Ht){zf(l,T,Ht);return;}var Vt=mt?mt(Ot,kt,T+"",l,f,At):e,qt=Vt===e;if(qt){var ie=ge(kt),ce=!ie&&Fi(kt),de=!ie&&!ce&&lo(kt);Vt=kt,ie||ce||de?ge(Ot)?Vt=Ot:nr(Ot)?Vt=jr(Ot):ce?(qt=!1,Vt=Tv(kt,!0)):de?(qt=!1,Vt=xv(kt,!0)):Vt=[]:fa(kt)||gs(kt)?(Vt=Ot,gs(Ot)?Vt=wg(Ot):(!er(Ot)||si(Ot))&&(Vt=$v(kt))):qt=!1;}qt&&(At.set(kt,Vt),it(Vt,kt,W,mt,At),At.delete(kt)),zf(l,T,Vt);}function fv(l,f){var T=l.length;if(T)return f+=f<0?T:0,ii(f,T)?l[f]:e;}function hv(l,f,T){f.length?f=Je(f,function(mt){return ge(mt)?function(At){return ds(At,mt.length===1?mt[0]:mt);}:mt;}):f=[Hr];var W=-1;f=Je(f,sn(he()));var it=lv(l,function(mt,At,Ot){var kt=Je(f,function(Ht){return Ht(mt);});return{criteria:kt,index:++W,value:mt};});return EI(it,function(mt,At){return vx(mt,At,T);});}function nx(l,f){return dv(l,f,function(T,W){return xh(l,W);});}function dv(l,f,T){for(var W=-1,it=f.length,mt={};++W<it;){var At=f[W],Ot=ds(l,At);T(Ot,At)&&aa(mt,Bi(At,l),Ot);}return mt;}function ix(l){return function(f){return ds(f,l);};}function qf(l,f,T,W){var it=W?MI:Qs,mt=-1,At=f.length,Ot=l;for(l===f&&(f=jr(f)),T&&(Ot=Je(l,sn(T)));++mt<At;)for(var kt=0,Ht=f[mt],Vt=T?T(Ht):Ht;(kt=it(Ot,Vt,kt,W))>-1;)Ot!==l&&Ml.call(Ot,kt,1),Ml.call(l,kt,1);return l;}function pv(l,f){for(var T=l?f.length:0,W=T-1;T--;){var it=f[T];if(T==W||it!==mt){var mt=it;ii(it)?Ml.call(l,it,1):_f(l,it);}}return l;}function Kf(l,f){return l+Ol(Z0()*(f-l+1));}function sx(l,f,T,W){for(var it=-1,mt=hr(Ll((f-l)/(T||1)),0),At=zt(mt);mt--;)At[W?mt:++it]=l,l+=T;return At;}function Qf(l,f){var T="";if(!l||f<1||f>lt)return T;do f%2&&(T+=l),f=Ol(f/2),f&&(l+=l);while(f);return T;}function Ce(l,f){return ph(Xv(l,f,Hr),l+"");}function ox(l){return Q0(co(l));}function ax(l,f){var T=co(l);return Zl(T,hs(f,0,T.length));}function aa(l,f,T,W){if(!er(l))return l;f=Bi(f,l);for(var it=-1,mt=f.length,At=mt-1,Ot=l;Ot!=null&&++it<mt;){var kt=Ln(f[it]),Ht=T;if(kt==="__proto__"||kt==="constructor"||kt==="prototype")return l;if(it!=At){var Vt=Ot[kt];Ht=W?W(Vt,kt,Ot):e,Ht===e&&(Ht=er(Vt)?Vt:ii(f[it+1])?[]:{});}na(Ot,kt,Ht),Ot=Ot[kt];}return l;}var vv=Dl?function(l,f){return Dl.set(l,f),l;}:Hr,lx=El?function(l,f){return El(l,"toString",{configurable:!0,enumerable:!1,value:Ph(f),writable:!0});}:Hr;function cx(l){return Zl(co(l));}function Sn(l,f,T){var W=-1,it=l.length;f<0&&(f=-f>it?0:it+f),T=T>it?it:T,T<0&&(T+=it),it=f>T?0:T-f>>>0,f>>>=0;for(var mt=zt(it);++W<it;)mt[W]=l[W+f];return mt;}function ux(l,f){var T;return Ri(l,function(W,it,mt){return T=f(W,it,mt),!T;}),!!T;}function Ul(l,f,T){var W=0,it=l==null?W:l.length;if(typeof f=="number"&&f===f&&it<=_){for(;W<it;){var mt=W+it>>>1,At=l[mt];At!==null&&!an(At)&&(T?At<=f:At<f)?W=mt+1:it=mt;}return it;}return Jf(l,f,Hr,T);}function Jf(l,f,T,W){var it=0,mt=l==null?0:l.length;if(mt===0)return 0;f=T(f);for(var At=f!==f,Ot=f===null,kt=an(f),Ht=f===e;it<mt;){var Vt=Ol((it+mt)/2),qt=T(l[Vt]),ie=qt!==e,ce=qt===null,de=qt===qt,xe=an(qt);if(At)var fe=W||de;else Ht?fe=de&&(W||ie):Ot?fe=de&&ie&&(W||!ce):kt?fe=de&&ie&&!ce&&(W||!xe):ce||xe?fe=!1:fe=W?qt<=f:qt<f;fe?it=Vt+1:mt=Vt;}return Er(mt,U);}function gv(l,f){for(var T=-1,W=l.length,it=0,mt=[];++T<W;){var At=l[T],Ot=f?f(At):At;if(!T||!On(Ot,kt)){var kt=Ot;mt[it++]=At===0?0:At;}}return mt;}function mv(l){return typeof l=="number"?l:an(l)?Tt:+l;}function on(l){if(typeof l=="string")return l;if(ge(l))return Je(l,on)+"";if(an(l))return q0?q0.call(l):"";var f=l+"";return f=="0"&&1/l==-q?"-0":f;}function Ni(l,f,T){var W=-1,it=yl,mt=l.length,At=!0,Ot=[],kt=Ot;if(T)At=!1,it=bf;else if(mt>=i){var Ht=f?null:Ix(l);if(Ht)return Sl(Ht);At=!1,it=Qo,kt=new fs();}else kt=f?[]:Ot;t:for(;++W<mt;){var Vt=l[W],qt=f?f(Vt):Vt;if(Vt=T||Vt!==0?Vt:0,At&&qt===qt){for(var ie=kt.length;ie--;)if(kt[ie]===qt)continue t;f&&kt.push(qt),Ot.push(Vt);}else it(kt,qt,T)||(kt!==Ot&&kt.push(qt),Ot.push(Vt));}return Ot;}function _f(l,f){f=Bi(f,l);var T=-1,W=f.length;if(!W)return!0;for(;++T<W;){var it=Ln(f[T]);if(it==="__proto__"&&!Ue.call(l,"__proto__")||(it==="constructor"||it==="prototype")&&T<W-1)return!1;}var mt=Gv(l,f);return mt==null||delete mt[Ln(In(f))];}function yv(l,f,T,W){return aa(l,f,T(ds(l,f)),W);}function zl(l,f,T,W){for(var it=l.length,mt=W?it:-1;(W?mt--:++mt<it)&&f(l[mt],mt,l););return T?Sn(l,W?0:mt,W?mt+1:it):Sn(l,W?mt+1:0,W?it:mt);}function wv(l,f){var T=l;return T instanceof Me&&(T=T.value()),Mf(f,function(W,it){return it.func.apply(it.thisArg,Li([W],it.args));},T);}function th(l,f,T){var W=l.length;if(W<2)return W?Ni(l[0]):[];for(var it=-1,mt=zt(W);++it<W;)for(var At=l[it],Ot=-1;++Ot<W;)Ot!=it&&(mt[it]=ia(mt[it]||At,l[Ot],f,T));return Ni(Tr(mt,1),f,T);}function Sv(l,f,T){for(var W=-1,it=l.length,mt=f.length,At={};++W<it;){var Ot=W<mt?f[W]:e;T(At,l[W],Ot);}return At;}function eh(l){return nr(l)?l:[];}function rh(l){return typeof l=="function"?l:Hr;}function Bi(l,f){return ge(l)?l:fh(l,f)?[l]:qv(ze(l));}var fx=Ce;function ki(l,f,T){var W=l.length;return T=T===e?W:T,!f&&T>=W?l:Sn(l,f,T);}var Iv=JI||function(l){return Ir.clearTimeout(l);};function Tv(l,f){if(f)return l.slice();var T=l.length,W=j0?j0(T):new l.constructor(T);return l.copy(W),W;}function nh(l){var f=new l.constructor(l.byteLength);return new Al(f).set(new Al(l)),f;}function hx(l,f){var T=f?nh(l.buffer):l.buffer;return new l.constructor(T,l.byteOffset,l.byteLength);}function dx(l){var f=new l.constructor(l.source,An.exec(l));return f.lastIndex=l.lastIndex,f;}function px(l){return ra?Xe(ra.call(l)):{};}function xv(l,f){var T=f?nh(l.buffer):l.buffer;return new l.constructor(T,l.byteOffset,l.length);}function Cv(l,f){if(l!==f){var T=l!==e,W=l===null,it=l===l,mt=an(l),At=f!==e,Ot=f===null,kt=f===f,Ht=an(f);if(!Ot&&!Ht&&!mt&&l>f||mt&&At&&kt&&!Ot&&!Ht||W&&At&&kt||!T&&kt||!it)return 1;if(!W&&!mt&&!Ht&&l<f||Ht&&T&&it&&!W&&!mt||Ot&&T&&it||!At&&it||!kt)return-1;}return 0;}function vx(l,f,T){for(var W=-1,it=l.criteria,mt=f.criteria,At=it.length,Ot=T.length;++W<At;){var kt=Cv(it[W],mt[W]);if(kt){if(W>=Ot)return kt;var Ht=T[W];return kt*(Ht=="desc"?-1:1);}}return l.index-f.index;}function Pv(l,f,T,W){for(var it=-1,mt=l.length,At=T.length,Ot=-1,kt=f.length,Ht=hr(mt-At,0),Vt=zt(kt+Ht),qt=!W;++Ot<kt;)Vt[Ot]=f[Ot];for(;++it<At;)(qt||it<mt)&&(Vt[T[it]]=l[it]);for(;Ht--;)Vt[Ot++]=l[it++];return Vt;}function Av(l,f,T,W){for(var it=-1,mt=l.length,At=-1,Ot=T.length,kt=-1,Ht=f.length,Vt=hr(mt-Ot,0),qt=zt(Vt+Ht),ie=!W;++it<Vt;)qt[it]=l[it];for(var ce=it;++kt<Ht;)qt[ce+kt]=f[kt];for(;++At<Ot;)(ie||it<mt)&&(qt[ce+T[At]]=l[it++]);return qt;}function jr(l,f){var T=-1,W=l.length;for(f||(f=zt(W));++T<W;)f[T]=l[T];return f;}function Hn(l,f,T,W){var it=!T;T||(T={});for(var mt=-1,At=f.length;++mt<At;){var Ot=f[mt],kt=W?W(T[Ot],l[Ot],Ot,T,l):e;kt===e&&(kt=l[Ot]),it?Xn(T,Ot,kt):na(T,Ot,kt);}return T;}function gx(l,f){return Hn(l,uh(l),f);}function mx(l,f){return Hn(l,Uv(l),f);}function $l(l,f){return function(T,W){var it=ge(T)?TI:UT,mt=f?f():{};return it(T,l,he(W,2),mt);};}function so(l){return Ce(function(f,T){var W=-1,it=T.length,mt=it>1?T[it-1]:e,At=it>2?T[2]:e;for(mt=l.length>3&&typeof mt=="function"?(it--,mt):e,At&&Fr(T[0],T[1],At)&&(mt=it<3?e:mt,it=1),f=Xe(f);++W<it;){var Ot=T[W];Ot&&l(f,Ot,W,mt);}return f;});}function bv(l,f){return function(T,W){if(T==null)return T;if(!Xr(T))return l(T,W);for(var it=T.length,mt=f?it:-1,At=Xe(T);(f?mt--:++mt<it)&&W(At[mt],mt,At)!==!1;);return T;};}function Mv(l){return function(f,T,W){for(var it=-1,mt=Xe(f),At=W(f),Ot=At.length;Ot--;){var kt=At[l?Ot:++it];if(T(mt[kt],kt,mt)===!1)break;}return f;};}function yx(l,f,T){var W=f&G,it=la(l);function mt(){var At=this&&this!==Ir&&this instanceof mt?it:l;return At.apply(W?T:this,arguments);}return mt;}function Ev(l){return function(f){f=ze(f);var T=Js(f)?Mn(f):e,W=T?T[0]:f.charAt(0),it=T?ki(T,1).join(""):f.slice(1);return W[l]()+it;};}function oo(l){return function(f){return Mf(Mg(bg(f).replace(lI,"")),l,"");};}function la(l){return function(){var f=arguments;switch(f.length){case 0:return new l();case 1:return new l(f[0]);case 2:return new l(f[0],f[1]);case 3:return new l(f[0],f[1],f[2]);case 4:return new l(f[0],f[1],f[2],f[3]);case 5:return new l(f[0],f[1],f[2],f[3],f[4]);case 6:return new l(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new l(f[0],f[1],f[2],f[3],f[4],f[5],f[6]);}var T=io(l.prototype),W=l.apply(T,f);return er(W)?W:T;};}function wx(l,f,T){var W=la(l);function it(){for(var mt=arguments.length,At=zt(mt),Ot=mt,kt=ao(it);Ot--;)At[Ot]=arguments[Ot];var Ht=mt<3&&At[0]!==kt&&At[mt-1]!==kt?[]:Oi(At,kt);if(mt-=Ht.length,mt<T)return Nv(l,f,Yl,it.placeholder,e,At,Ht,e,e,T-mt);var Vt=this&&this!==Ir&&this instanceof it?W:l;return rn(Vt,this,At);}return it;}function Lv(l){return function(f,T,W){var it=Xe(f);if(!Xr(f)){var mt=he(T,3);f=gr(f),T=function T(Ot){return mt(it[Ot],Ot,it);};}var At=l(f,T,W);return At>-1?it[mt?f[At]:At]:e;};}function Ov(l){return ni(function(f){var T=f.length,W=T,it=yn.prototype.thru;for(l&&f.reverse();W--;){var mt=f[W];if(typeof mt!="function")throw new mn(o);if(it&&!At&&Hl(mt)=="wrapper")var At=new yn([],!0);}for(W=At?W:T;++W<T;){mt=f[W];var Ot=Hl(mt),kt=Ot=="wrapper"?lh(mt):e;kt&&hh(kt[0])&&kt[1]==(P|x|S|X)&&!kt[4].length&&kt[9]==1?At=At[Hl(kt[0])].apply(At,kt[3]):At=mt.length==1&&hh(mt)?At[Ot]():At.thru(mt);}return function(){var Ht=arguments,Vt=Ht[0];if(At&&Ht.length==1&&ge(Vt))return At.plant(Vt).value();for(var qt=0,ie=T?f[qt].apply(this,Ht):Vt;++qt<T;)ie=f[qt].call(this,ie);return ie;};});}function Yl(l,f,T,W,it,mt,At,Ot,kt,Ht){var Vt=f&P,qt=f&G,ie=f&z,ce=f&(x|y),de=f&$,xe=ie?e:la(l);function fe(){for(var Ae=arguments.length,Ee=zt(Ae),ln=Ae;ln--;)Ee[ln]=arguments[ln];if(ce)var Wr=ao(fe),cn=OI(Ee,Wr);if(W&&(Ee=Pv(Ee,W,it,ce)),mt&&(Ee=Av(Ee,mt,At,ce)),Ae-=cn,ce&&Ae<Ht){var ir=Oi(Ee,Wr);return Nv(l,f,Yl,fe.placeholder,T,Ee,ir,Ot,kt,Ht-Ae);}var Dn=qt?T:this,ai=ie?Dn[l]:l;return Ae=Ee.length,Ot?Ee=Ux(Ee,Ot):de&&Ae>1&&Ee.reverse(),Vt&&kt<Ae&&(Ee.length=kt),this&&this!==Ir&&this instanceof fe&&(ai=xe||la(ai)),ai.apply(Dn,Ee);}return fe;}function Dv(l,f){return function(T,W){return VT(T,l,f(W),{});};}function jl(l,f){return function(T,W){var it;if(T===e&&W===e)return f;if(T!==e&&(it=T),W!==e){if(it===e)return W;typeof T=="string"||typeof W=="string"?(T=on(T),W=on(W)):(T=mv(T),W=mv(W)),it=l(T,W);}return it;};}function ih(l){return ni(function(f){return f=Je(f,sn(he())),Ce(function(T){var W=this;return l(f,function(it){return rn(it,W,T);});});});}function Xl(l,f){f=f===e?" ":on(f);var T=f.length;if(T<2)return T?Qf(f,l):f;var W=Qf(f,Ll(l/_s(f)));return Js(f)?ki(Mn(W),0,l).join(""):W.slice(0,l);}function Sx(l,f,T,W){var it=f&G,mt=la(l);function At(){for(var Ot=-1,kt=arguments.length,Ht=-1,Vt=W.length,qt=zt(Vt+kt),ie=this&&this!==Ir&&this instanceof At?mt:l;++Ht<Vt;)qt[Ht]=W[Ht];for(;kt--;)qt[Ht++]=arguments[++Ot];return rn(ie,it?T:this,qt);}return At;}function Rv(l){return function(f,T,W){return W&&typeof W!="number"&&Fr(f,T,W)&&(T=W=e),f=oi(f),T===e?(T=f,f=0):T=oi(T),W=W===e?f<T?1:-1:oi(W),sx(f,T,W,l);};}function Gl(l){return function(f,T){return typeof f=="string"&&typeof T=="string"||(f=Tn(f),T=Tn(T)),l(f,T);};}function Nv(l,f,T,W,it,mt,At,Ot,kt,Ht){var Vt=f&x,qt=Vt?At:e,ie=Vt?e:At,ce=Vt?mt:e,de=Vt?e:mt;f|=Vt?S:C,f&=~(Vt?C:S),f&et||(f&=-4);var xe=[l,f,it,ce,qt,de,ie,Ot,kt,Ht],fe=T.apply(e,xe);return hh(l)&&Hv(fe,xe),fe.placeholder=W,Vv(fe,l,f);}function sh(l){var f=fr[l];return function(T,W){if(T=Tn(T),W=W==null?0:Er(Ie(W),292),W&&V0(T)){var it=(ze(T)+"e").split("e"),mt=f(it[0]+"e"+(+it[1]+W));return it=(ze(mt)+"e").split("e"),+(it[0]+"e"+(+it[1]-W));}return f(T);};}var Ix=ro&&1/Sl(new ro([,-0]))[1]==q?function(l){return new ro(l);}:Mh;function Bv(l){return function(f){var T=Lr(f);return T==V?Bf(f):T==ft?WI(f):LI(f,l(f));};}function ri(l,f,T,W,it,mt,At,Ot){var kt=f&z;if(!kt&&typeof l!="function")throw new mn(o);var Ht=W?W.length:0;if(Ht||(f&=-97,W=it=e),At=At===e?At:hr(Ie(At),0),Ot=Ot===e?Ot:Ie(Ot),Ht-=it?it.length:0,f&C){var Vt=W,qt=it;W=it=e;}var ie=kt?e:lh(l),ce=[l,f,T,W,it,Vt,qt,mt,At,Ot];if(ie&&kx(ce,ie),l=ce[0],f=ce[1],T=ce[2],W=ce[3],it=ce[4],Ot=ce[9]=ce[9]===e?kt?0:l.length:hr(ce[9]-Ht,0),!Ot&&f&(x|y)&&(f&=-25),!f||f==G)var de=yx(l,f,T);else f==x||f==y?de=wx(l,f,Ot):(f==S||f==(G|S))&&!it.length?de=Sx(l,f,T,W):de=Yl.apply(e,ce);var xe=ie?vv:Hv;return Vv(xe(de,ce),l,f);}function kv(l,f,T,W){return l===e||On(l,eo[T])&&!Ue.call(W,T)?f:l;}function Fv(l,f,T,W,it,mt){return er(l)&&er(f)&&(mt.set(f,l),Wl(l,f,e,Fv,mt),mt.delete(f)),l;}function Tx(l){return fa(l)?e:l;}function Wv(l,f,T,W,it,mt){var At=T&E,Ot=l.length,kt=f.length;if(Ot!=kt&&!(At&&kt>Ot))return!1;var Ht=mt.get(l),Vt=mt.get(f);if(Ht&&Vt)return Ht==f&&Vt==l;var qt=-1,ie=!0,ce=T&L?new fs():e;for(mt.set(l,f),mt.set(f,l);++qt<Ot;){var de=l[qt],xe=f[qt];if(W)var fe=At?W(xe,de,qt,f,l,mt):W(de,xe,qt,l,f,mt);if(fe!==e){if(fe)continue;ie=!1;break;}if(ce){if(!Ef(f,function(Ae,Ee){if(!Qo(ce,Ee)&&(de===Ae||it(de,Ae,T,W,mt)))return ce.push(Ee);})){ie=!1;break;}}else if(!(de===xe||it(de,xe,T,W,mt))){ie=!1;break;}}return mt.delete(l),mt.delete(f),ie;}function xx(l,f,T,W,it,mt,At){switch(T){case Rt:if(l.byteLength!=f.byteLength||l.byteOffset!=f.byteOffset)return!1;l=l.buffer,f=f.buffer;case Lt:return!(l.byteLength!=f.byteLength||!mt(new Al(l),new Al(f)));case Et:case Dt:case tt:return On(+l,+f);case N:return l.name==f.name&&l.message==f.message;case st:case dt:return l==f+"";case V:var Ot=Bf;case ft:var kt=W&E;if(Ot||(Ot=Sl),l.size!=f.size&&!kt)return!1;var Ht=At.get(l);if(Ht)return Ht==f;W|=L,At.set(l,f);var Vt=Wv(Ot(l),Ot(f),W,it,mt,At);return At.delete(l),Vt;case ot:if(ra)return ra.call(l)==ra.call(f);}return!1;}function Cx(l,f,T,W,it,mt){var At=T&E,Ot=oh(l),kt=Ot.length,Ht=oh(f),Vt=Ht.length;if(kt!=Vt&&!At)return!1;for(var qt=kt;qt--;){var ie=Ot[qt];if(!(At?ie in f:Ue.call(f,ie)))return!1;}var ce=mt.get(l),de=mt.get(f);if(ce&&de)return ce==f&&de==l;var xe=!0;mt.set(l,f),mt.set(f,l);for(var fe=At;++qt<kt;){ie=Ot[qt];var Ae=l[ie],Ee=f[ie];if(W)var ln=At?W(Ee,Ae,ie,f,l,mt):W(Ae,Ee,ie,l,f,mt);if(!(ln===e?Ae===Ee||it(Ae,Ee,T,W,mt):ln)){xe=!1;break;}fe||(fe=ie=="constructor");}if(xe&&!fe){var Wr=l.constructor,cn=f.constructor;Wr!=cn&&"constructor"in l&&"constructor"in f&&!(typeof Wr=="function"&&Wr instanceof Wr&&typeof cn=="function"&&cn instanceof cn)&&(xe=!1);}return mt.delete(l),mt.delete(f),xe;}function ni(l){return ph(Xv(l,e,_v),l+"");}function oh(l){return iv(l,gr,uh);}function ah(l){return iv(l,Gr,Uv);}var lh=Dl?function(l){return Dl.get(l);}:Mh;function Hl(l){for(var f=l.name+"",T=no[f],W=Ue.call(no,f)?T.length:0;W--;){var it=T[W],mt=it.func;if(mt==null||mt==l)return it.name;}return f;}function ao(l){var f=Ue.call(vt,"placeholder")?vt:l;return f.placeholder;}function he(){var l=vt.iteratee||Ah;return l=l===Ah?av:l,arguments.length?l(arguments[0],arguments[1]):l;}function Vl(l,f){var T=l.__data__;return Dx(f)?T[typeof f=="string"?"string":"hash"]:T.map;}function ch(l){for(var f=gr(l),T=f.length;T--;){var W=f[T],it=l[W];f[T]=[W,it,Yv(it)];}return f;}function ps(l,f){var T=BI(l,f);return ov(T)?T:e;}function Px(l){var f=Ue.call(l,cs),T=l[cs];try{l[cs]=e;var W=!0;}catch(_unused22){}var it=Cl.call(l);return W&&(f?l[cs]=T:delete l[cs]),it;}var uh=Ff?function(l){return l==null?[]:(l=Xe(l),Ei(Ff(l),function(f){return G0.call(l,f);}));}:Eh,Uv=Ff?function(l){for(var f=[];l;)Li(f,uh(l)),l=bl(l);return f;}:Eh,Lr=kr;(Wf&&Lr(new Wf(new ArrayBuffer(1)))!=Rt||_o&&Lr(new _o())!=V||Uf&&Lr(Uf.resolve())!=B||ro&&Lr(new ro())!=ft||ta&&Lr(new ta())!=St)&&(Lr=function Lr(l){var f=kr(l),T=f==I?l.constructor:e,W=T?vs(T):"";if(W)switch(W){case aT:return Rt;case lT:return V;case cT:return B;case uT:return ft;case fT:return St;}return f;});function Ax(l,f,T){for(var W=-1,it=T.length;++W<it;){var mt=T[W],At=mt.size;switch(mt.type){case"drop":l+=At;break;case"dropRight":f-=At;break;case"take":f=Er(f,l+At);break;case"takeRight":l=hr(l,f-At);break;}}return{start:l,end:f};}function bx(l){var f=l.match(Gs);return f?f[1].split(Hs):[];}function zv(l,f,T){f=Bi(f,l);for(var W=-1,it=f.length,mt=!1;++W<it;){var At=Ln(f[W]);if(!(mt=l!=null&&T(l,At)))break;l=l[At];}return mt||++W!=it?mt:(it=l==null?0:l.length,!!it&&tc(it)&&ii(At,it)&&(ge(l)||gs(l)));}function Mx(l){var f=l.length,T=new l.constructor(f);return f&&typeof l[0]=="string"&&Ue.call(l,"index")&&(T.index=l.index,T.input=l.input),T;}function $v(l){return typeof l.constructor=="function"&&!ca(l)?io(bl(l)):{};}function Ex(l,f,T){var W=l.constructor;switch(f){case Lt:return nh(l);case Et:case Dt:return new W(+l);case Rt:return hx(l,T);case Nt:case $t:case Ut:case Ft:case Qt:case ee:case re:case se:case oe:return xv(l,T);case V:return new W();case tt:case dt:return new W(l);case st:return dx(l);case ft:return new W();case ot:return px(l);}}function Lx(l,f){var T=f.length;if(!T)return l;var W=T-1;return f[W]=(T>1?"& ":"")+f[W],f=f.join(T>2?", ":" "),l.replace(Ho,"{\n/* [wrapped with "+f+"] */\n");}function Ox(l){return ge(l)||gs(l)||!!(H0&&l&&l[H0]);}function ii(l,f){var T=_typeof(l);return f=f!==null&&f!==void 0?f:lt,!!f&&(T=="number"||T!="symbol"&&df.test(l))&&l>-1&&l%1==0&&l<f;}function Fr(l,f,T){if(!er(T))return!1;var W=_typeof(f);return(W=="number"?Xr(T)&&ii(f,T.length):W=="string"&&f in T)?On(T[f],l):!1;}function fh(l,f){if(ge(l))return!1;var T=_typeof(l);return T=="number"||T=="symbol"||T=="boolean"||l==null||an(l)?!0:en.test(l)||!tn.test(l)||f!=null&&l in Xe(f);}function Dx(l){var f=_typeof(l);return f=="string"||f=="number"||f=="symbol"||f=="boolean"?l!=="__proto__":l===null;}function hh(l){var f=Hl(l),T=vt[f];if(typeof T!="function"||!(f in Me.prototype))return!1;if(l===T)return!0;var W=lh(T);return!!W&&l===W[0];}function Rx(l){return!!Y0&&Y0 in l;}var Nx=Tl?si:Lh;function ca(l){var f=l&&l.constructor,T=typeof f=="function"&&f.prototype||eo;return l===T;}function Yv(l){return l===l&&!er(l);}function jv(l,f){return function(T){return T==null?!1:T[l]===f&&(f!==e||l in Xe(T));};}function Bx(l){var f=Jl(l,function(W){return T.size===v&&T.clear(),W;}),T=f.cache;return f;}function kx(l,f){var T=l[1],W=f[1],it=T|W,mt=it<(G|z|P),At=W==P&&T==x||W==P&&T==X&&l[7].length<=f[8]||W==(P|X)&&f[7].length<=f[8]&&T==x;if(!(mt||At))return l;W&G&&(l[2]=f[2],it|=T&G?0:et);var Ot=f[3];if(Ot){var kt=l[3];l[3]=kt?Pv(kt,Ot,f[4]):Ot,l[4]=kt?Oi(l[3],p):f[4];}return Ot=f[5],Ot&&(kt=l[5],l[5]=kt?Av(kt,Ot,f[6]):Ot,l[6]=kt?Oi(l[5],p):f[6]),Ot=f[7],Ot&&(l[7]=Ot),W&P&&(l[8]=l[8]==null?f[8]:Er(l[8],f[8])),l[9]==null&&(l[9]=f[9]),l[0]=f[0],l[1]=it,l;}function Fx(l){var f=[];if(l!=null)for(var T in Xe(l))f.push(T);return f;}function Wx(l){return Cl.call(l);}function Xv(l,f,T){return f=hr(f===e?l.length-1:f,0),function(){for(var W=arguments,it=-1,mt=hr(W.length-f,0),At=zt(mt);++it<mt;)At[it]=W[f+it];it=-1;for(var Ot=zt(f+1);++it<f;)Ot[it]=W[it];return Ot[f]=T(At),rn(l,this,Ot);};}function Gv(l,f){return f.length<2?l:ds(l,Sn(f,0,-1));}function Ux(l,f){for(var T=l.length,W=Er(f.length,T),it=jr(l);W--;){var mt=f[W];l[W]=ii(mt,T)?it[mt]:e;}return l;}function dh(l,f){if(!(f==="constructor"&&typeof l[f]=="function")&&f!="__proto__")return l[f];}var Hv=Zv(vv),ua=tT||function(l,f){return Ir.setTimeout(l,f);},ph=Zv(lx);function Vv(l,f,T){var W=f+"";return ph(l,Lx(W,zx(bx(W),T)));}function Zv(l){var f=0,T=0;return function(){var W=iT(),it=ct-(W-T);if(T=W,it>0){if(++f>=nt)return arguments[0];}else f=0;return l.apply(e,arguments);};}function Zl(l,f){var T=-1,W=l.length,it=W-1;for(f=f===e?W:f;++T<f;){var mt=Kf(T,it),At=l[mt];l[mt]=l[T],l[T]=At;}return l.length=f,l;}var qv=Bx(function(l){var f=[];return l.charCodeAt(0)===46&&f.push(""),l.replace(Yn,function(T,W,it,mt){f.push(it?mt.replace(Vo,"$1"):W||T);}),f;});function Ln(l){if(typeof l=="string"||an(l))return l;var f=l+"";return f=="0"&&1/l==-q?"-0":f;}function vs(l){if(l!=null){try{return xl.call(l);}catch(_unused23){}try{return l+"";}catch(_unused24){}}return"";}function zx(l,f){return nn(H,function(T){var W="_."+T[0];f&T[1]&&!yl(l,W)&&l.push(W);}),l.sort();}function Kv(l){if(l instanceof Me)return l.clone();var f=new yn(l.__wrapped__,l.__chain__);return f.__actions__=jr(l.__actions__),f.__index__=l.__index__,f.__values__=l.__values__,f;}function $x(l,f,T){(T?Fr(l,f,T):f===e)?f=1:f=hr(Ie(f),0);var W=l==null?0:l.length;if(!W||f<1)return[];for(var it=0,mt=0,At=zt(Ll(W/f));it<W;)At[mt++]=Sn(l,it,it+=f);return At;}function Yx(l){for(var f=-1,T=l==null?0:l.length,W=0,it=[];++f<T;){var mt=l[f];mt&&(it[W++]=mt);}return it;}function jx(){var l=arguments.length;if(!l)return[];for(var f=zt(l-1),T=arguments[0],W=l;W--;)f[W-1]=arguments[W];return Li(ge(T)?jr(T):[T],Tr(f,1));}var Xx=Ce(function(l,f){return nr(l)?ia(l,Tr(f,1,nr,!0)):[];}),Gx=Ce(function(l,f){var T=In(f);return nr(T)&&(T=e),nr(l)?ia(l,Tr(f,1,nr,!0),he(T,2)):[];}),Hx=Ce(function(l,f){var T=In(f);return nr(T)&&(T=e),nr(l)?ia(l,Tr(f,1,nr,!0),e,T):[];});function Vx(l,f,T){var W=l==null?0:l.length;return W?(f=T||f===e?1:Ie(f),Sn(l,f<0?0:f,W)):[];}function Zx(l,f,T){var W=l==null?0:l.length;return W?(f=T||f===e?1:Ie(f),f=W-f,Sn(l,0,f<0?0:f)):[];}function qx(l,f){return l&&l.length?zl(l,he(f,3),!0,!0):[];}function Kx(l,f){return l&&l.length?zl(l,he(f,3),!0):[];}function Qx(l,f,T,W){var it=l==null?0:l.length;return it?(T&&typeof T!="number"&&Fr(l,f,T)&&(T=0,W=it),jT(l,f,T,W)):[];}function Qv(l,f,T){var W=l==null?0:l.length;if(!W)return-1;var it=T==null?0:Ie(T);return it<0&&(it=hr(W+it,0)),wl(l,he(f,3),it);}function Jv(l,f,T){var W=l==null?0:l.length;if(!W)return-1;var it=W-1;return T!==e&&(it=Ie(T),it=T<0?hr(W+it,0):Er(it,W-1)),wl(l,he(f,3),it,!0);}function _v(l){var f=l==null?0:l.length;return f?Tr(l,1):[];}function Jx(l){var f=l==null?0:l.length;return f?Tr(l,q):[];}function _x(l,f){var T=l==null?0:l.length;return T?(f=f===e?1:Ie(f),Tr(l,f)):[];}function tC(l){for(var f=-1,T=l==null?0:l.length,W={};++f<T;){var it=l[f];Xn(W,it[0],it[1]);}return W;}function tg(l){return l&&l.length?l[0]:e;}function eC(l,f,T){var W=l==null?0:l.length;if(!W)return-1;var it=T==null?0:Ie(T);return it<0&&(it=hr(W+it,0)),Qs(l,f,it);}function rC(l){var f=l==null?0:l.length;return f?Sn(l,0,-1):[];}var nC=Ce(function(l){var f=Je(l,eh);return f.length&&f[0]===l[0]?Gf(f):[];}),iC=Ce(function(l){var f=In(l),T=Je(l,eh);return f===In(T)?f=e:T.pop(),T.length&&T[0]===l[0]?Gf(T,he(f,2)):[];}),sC=Ce(function(l){var f=In(l),T=Je(l,eh);return f=typeof f=="function"?f:e,f&&T.pop(),T.length&&T[0]===l[0]?Gf(T,e,f):[];});function oC(l,f){return l==null?"":rT.call(l,f);}function In(l){var f=l==null?0:l.length;return f?l[f-1]:e;}function aC(l,f,T){var W=l==null?0:l.length;if(!W)return-1;var it=W;return T!==e&&(it=Ie(T),it=it<0?hr(W+it,0):Er(it,W-1)),f===f?zI(l,f,it):wl(l,N0,it,!0);}function lC(l,f){return l&&l.length?fv(l,Ie(f)):e;}var cC=Ce(eg);function eg(l,f){return l&&l.length&&f&&f.length?qf(l,f):l;}function uC(l,f,T){return l&&l.length&&f&&f.length?qf(l,f,he(T,2)):l;}function fC(l,f,T){return l&&l.length&&f&&f.length?qf(l,f,e,T):l;}var hC=ni(function(l,f){var T=l==null?0:l.length,W=$f(l,f);return pv(l,Je(f,function(it){return ii(it,T)?+it:it;}).sort(Cv)),W;});function dC(l,f){var T=[];if(!(l&&l.length))return T;var W=-1,it=[],mt=l.length;for(f=he(f,3);++W<mt;){var At=l[W];f(At,W,l)&&(T.push(At),it.push(W));}return pv(l,it),T;}function vh(l){return l==null?l:oT.call(l);}function pC(l,f,T){var W=l==null?0:l.length;return W?(T&&typeof T!="number"&&Fr(l,f,T)?(f=0,T=W):(f=f==null?0:Ie(f),T=T===e?W:Ie(T)),Sn(l,f,T)):[];}function vC(l,f){return Ul(l,f);}function gC(l,f,T){return Jf(l,f,he(T,2));}function mC(l,f){var T=l==null?0:l.length;if(T){var W=Ul(l,f);if(W<T&&On(l[W],f))return W;}return-1;}function yC(l,f){return Ul(l,f,!0);}function wC(l,f,T){return Jf(l,f,he(T,2),!0);}function SC(l,f){var T=l==null?0:l.length;if(T){var W=Ul(l,f,!0)-1;if(On(l[W],f))return W;}return-1;}function IC(l){return l&&l.length?gv(l):[];}function TC(l,f){return l&&l.length?gv(l,he(f,2)):[];}function xC(l){var f=l==null?0:l.length;return f?Sn(l,1,f):[];}function CC(l,f,T){return l&&l.length?(f=T||f===e?1:Ie(f),Sn(l,0,f<0?0:f)):[];}function PC(l,f,T){var W=l==null?0:l.length;return W?(f=T||f===e?1:Ie(f),f=W-f,Sn(l,f<0?0:f,W)):[];}function AC(l,f){return l&&l.length?zl(l,he(f,3),!1,!0):[];}function bC(l,f){return l&&l.length?zl(l,he(f,3)):[];}var MC=Ce(function(l){return Ni(Tr(l,1,nr,!0));}),EC=Ce(function(l){var f=In(l);return nr(f)&&(f=e),Ni(Tr(l,1,nr,!0),he(f,2));}),LC=Ce(function(l){var f=In(l);return f=typeof f=="function"?f:e,Ni(Tr(l,1,nr,!0),e,f);});function OC(l){return l&&l.length?Ni(l):[];}function DC(l,f){return l&&l.length?Ni(l,he(f,2)):[];}function RC(l,f){return f=typeof f=="function"?f:e,l&&l.length?Ni(l,e,f):[];}function gh(l){if(!(l&&l.length))return[];var f=0;return l=Ei(l,function(T){if(nr(T))return f=hr(T.length,f),!0;}),Rf(f,function(T){return Je(l,Lf(T));});}function rg(l,f){if(!(l&&l.length))return[];var T=gh(l);return f==null?T:Je(T,function(W){return rn(f,e,W);});}var NC=Ce(function(l,f){return nr(l)?ia(l,f):[];}),BC=Ce(function(l){return th(Ei(l,nr));}),kC=Ce(function(l){var f=In(l);return nr(f)&&(f=e),th(Ei(l,nr),he(f,2));}),FC=Ce(function(l){var f=In(l);return f=typeof f=="function"?f:e,th(Ei(l,nr),e,f);}),WC=Ce(gh);function UC(l,f){return Sv(l||[],f||[],na);}function zC(l,f){return Sv(l||[],f||[],aa);}var $C=Ce(function(l){var f=l.length,T=f>1?l[f-1]:e;return T=typeof T=="function"?(l.pop(),T):e,rg(l,T);});function ng(l){var f=vt(l);return f.__chain__=!0,f;}function YC(l,f){return f(l),l;}function ql(l,f){return f(l);}var jC=ni(function(l){var f=l.length,T=f?l[0]:0,W=this.__wrapped__,it=function it(mt){return $f(mt,l);};return f>1||this.__actions__.length||!(W instanceof Me)||!ii(T)?this.thru(it):(W=W.slice(T,+T+(f?1:0)),W.__actions__.push({func:ql,args:[it],thisArg:e}),new yn(W,this.__chain__).thru(function(mt){return f&&!mt.length&&mt.push(e),mt;}));});function XC(){return ng(this);}function GC(){return new yn(this.value(),this.__chain__);}function HC(){this.__values__===e&&(this.__values__=mg(this.value()));var l=this.__index__>=this.__values__.length,f=l?e:this.__values__[this.__index__++];return{done:l,value:f};}function VC(){return this;}function ZC(l){for(var f,T=this;T instanceof Nl;){var W=Kv(T);W.__index__=0,W.__values__=e,f?it.__wrapped__=W:f=W;var it=W;T=T.__wrapped__;}return it.__wrapped__=l,f;}function qC(){var l=this.__wrapped__;if(l instanceof Me){var f=l;return this.__actions__.length&&(f=new Me(this)),f=f.reverse(),f.__actions__.push({func:ql,args:[vh],thisArg:e}),new yn(f,this.__chain__);}return this.thru(vh);}function KC(){return wv(this.__wrapped__,this.__actions__);}var QC=$l(function(l,f,T){Ue.call(l,T)?++l[T]:Xn(l,T,1);});function JC(l,f,T){var W=ge(l)?D0:YT;return T&&Fr(l,f,T)&&(f=e),W(l,he(f,3));}function _C(l,f){var T=ge(l)?Ei:rv;return T(l,he(f,3));}var tP=Lv(Qv),eP=Lv(Jv);function rP(l,f){return Tr(Kl(l,f),1);}function nP(l,f){return Tr(Kl(l,f),q);}function iP(l,f,T){return T=T===e?1:Ie(T),Tr(Kl(l,f),T);}function ig(l,f){var T=ge(l)?nn:Ri;return T(l,he(f,3));}function sg(l,f){var T=ge(l)?xI:ev;return T(l,he(f,3));}var sP=$l(function(l,f,T){Ue.call(l,T)?l[T].push(f):Xn(l,T,[f]);});function oP(l,f,T,W){l=Xr(l)?l:co(l),T=T&&!W?Ie(T):0;var it=l.length;return T<0&&(T=hr(it+T,0)),ec(l)?T<=it&&l.indexOf(f,T)>-1:!!it&&Qs(l,f,T)>-1;}var aP=Ce(function(l,f,T){var W=-1,it=typeof f=="function",mt=Xr(l)?zt(l.length):[];return Ri(l,function(At){mt[++W]=it?rn(f,At,T):sa(At,f,T);}),mt;}),lP=$l(function(l,f,T){Xn(l,T,f);});function Kl(l,f){var T=ge(l)?Je:lv;return T(l,he(f,3));}function cP(l,f,T,W){return l==null?[]:(ge(f)||(f=f==null?[]:[f]),T=W?e:T,ge(T)||(T=T==null?[]:[T]),hv(l,f,T));}var uP=$l(function(l,f,T){l[T?0:1].push(f);},function(){return[[],[]];});function fP(l,f,T){var W=ge(l)?Mf:k0,it=arguments.length<3;return W(l,he(f,4),T,it,Ri);}function hP(l,f,T){var W=ge(l)?CI:k0,it=arguments.length<3;return W(l,he(f,4),T,it,ev);}function dP(l,f){var T=ge(l)?Ei:rv;return T(l,_l(he(f,3)));}function pP(l){var f=ge(l)?Q0:ox;return f(l);}function vP(l,f,T){(T?Fr(l,f,T):f===e)?f=1:f=Ie(f);var W=ge(l)?FT:ax;return W(l,f);}function gP(l){var f=ge(l)?WT:cx;return f(l);}function mP(l){if(l==null)return 0;if(Xr(l))return ec(l)?_s(l):l.length;var f=Lr(l);return f==V||f==ft?l.size:Vf(l).length;}function yP(l,f,T){var W=ge(l)?Ef:ux;return T&&Fr(l,f,T)&&(f=e),W(l,he(f,3));}var wP=Ce(function(l,f){if(l==null)return[];var T=f.length;return T>1&&Fr(l,f[0],f[1])?f=[]:T>2&&Fr(f[0],f[1],f[2])&&(f=[f[0]]),hv(l,Tr(f,1),[]);}),Ql=_I||function(){return Ir.Date.now();};function SP(l,f){if(typeof f!="function")throw new mn(o);return l=Ie(l),function(){if(--l<1)return f.apply(this,arguments);};}function og(l,f,T){return f=T?e:f,f=l&&f==null?l.length:f,ri(l,P,e,e,e,e,f);}function ag(l,f){var T;if(typeof f!="function")throw new mn(o);return l=Ie(l),function(){return--l>0&&(T=f.apply(this,arguments)),l<=1&&(f=e),T;};}var mh=Ce(function(l,f,T){var W=G;if(T.length){var it=Oi(T,ao(mh));W|=S;}return ri(l,W,f,T,it);}),lg=Ce(function(l,f,T){var W=G|z;if(T.length){var it=Oi(T,ao(lg));W|=S;}return ri(f,W,l,T,it);});function cg(l,f,T){f=T?e:f;var W=ri(l,x,e,e,e,e,e,f);return W.placeholder=cg.placeholder,W;}function ug(l,f,T){f=T?e:f;var W=ri(l,y,e,e,e,e,e,f);return W.placeholder=ug.placeholder,W;}function fg(l,f,T){var W,it,mt,At,Ot,kt,Ht=0,Vt=!1,qt=!1,ie=!0;if(typeof l!="function")throw new mn(o);f=Tn(f)||0,er(T)&&(Vt=!!T.leading,qt="maxWait"in T,mt=qt?hr(Tn(T.maxWait)||0,f):mt,ie="trailing"in T?!!T.trailing:ie);function ce(ir){var Dn=W,ai=it;return W=it=e,Ht=ir,At=l.apply(ai,Dn),At;}function de(ir){return Ht=ir,Ot=ua(Ae,f),Vt?ce(ir):At;}function xe(ir){var Dn=ir-kt,ai=ir-Ht,Og=f-Dn;return qt?Er(Og,mt-ai):Og;}function fe(ir){var Dn=ir-kt,ai=ir-Ht;return kt===e||Dn>=f||Dn<0||qt&&ai>=mt;}function Ae(){var ir=Ql();if(fe(ir))return Ee(ir);Ot=ua(Ae,xe(ir));}function Ee(ir){return Ot=e,ie&&W?ce(ir):(W=it=e,At);}function ln(){Ot!==e&&Iv(Ot),Ht=0,W=kt=it=Ot=e;}function Wr(){return Ot===e?At:Ee(Ql());}function cn(){var ir=Ql(),Dn=fe(ir);if(W=arguments,it=this,kt=ir,Dn){if(Ot===e)return de(kt);if(qt)return Iv(Ot),Ot=ua(Ae,f),ce(kt);}return Ot===e&&(Ot=ua(Ae,f)),At;}return cn.cancel=ln,cn.flush=Wr,cn;}var IP=Ce(function(l,f){return tv(l,1,f);}),TP=Ce(function(l,f,T){return tv(l,Tn(f)||0,T);});function xP(l){return ri(l,$);}function Jl(l,f){if(typeof l!="function"||f!=null&&typeof f!="function")throw new mn(o);var _T2=function T(){var W=arguments,it=f?f.apply(this,W):W[0],mt=_T2.cache;if(mt.has(it))return mt.get(it);var At=l.apply(this,W);return _T2.cache=mt.set(it,At)||mt,At;};return _T2.cache=new(Jl.Cache||ei)(),_T2;}Jl.Cache=ei;function _l(l){if(typeof l!="function")throw new mn(o);return function(){var f=arguments;switch(f.length){case 0:return!l.call(this);case 1:return!l.call(this,f[0]);case 2:return!l.call(this,f[0],f[1]);case 3:return!l.call(this,f[0],f[1],f[2]);}return!l.apply(this,f);};}function CP(l){return ag(2,l);}var PP=fx(function(l,f){f=f.length==1&&ge(f[0])?Je(f[0],sn(he())):Je(Tr(f,1),sn(he()));var T=f.length;return Ce(function(W){for(var it=-1,mt=Er(W.length,T);++it<mt;)W[it]=f[it].call(this,W[it]);return rn(l,this,W);});}),yh=Ce(function(l,f){var T=Oi(f,ao(yh));return ri(l,S,e,f,T);}),hg=Ce(function(l,f){var T=Oi(f,ao(hg));return ri(l,C,e,f,T);}),AP=ni(function(l,f){return ri(l,X,e,e,e,f);});function bP(l,f){if(typeof l!="function")throw new mn(o);return f=f===e?f:Ie(f),Ce(l,f);}function MP(l,f){if(typeof l!="function")throw new mn(o);return f=f==null?0:hr(Ie(f),0),Ce(function(T){var W=T[f],it=ki(T,0,f);return W&&Li(it,W),rn(l,this,it);});}function EP(l,f,T){var W=!0,it=!0;if(typeof l!="function")throw new mn(o);return er(T)&&(W="leading"in T?!!T.leading:W,it="trailing"in T?!!T.trailing:it),fg(l,f,{leading:W,maxWait:f,trailing:it});}function LP(l){return og(l,1);}function OP(l,f){return yh(rh(f),l);}function DP(){if(!arguments.length)return[];var l=arguments[0];return ge(l)?l:[l];}function RP(l){return wn(l,M);}function NP(l,f){return f=typeof f=="function"?f:e,wn(l,M,f);}function BP(l){return wn(l,w|M);}function kP(l,f){return f=typeof f=="function"?f:e,wn(l,w|M,f);}function FP(l,f){return f==null||_0(l,f,gr(f));}function On(l,f){return l===f||l!==l&&f!==f;}var WP=Gl(Xf),UP=Gl(function(l,f){return l>=f;}),gs=sv(/* @__PURE__ */function(){return arguments;}())?sv:function(l){return rr(l)&&Ue.call(l,"callee")&&!G0.call(l,"callee");},ge=zt.isArray,zP=A0?sn(A0):ZT;function Xr(l){return l!=null&&tc(l.length)&&!si(l);}function nr(l){return rr(l)&&Xr(l);}function $P(l){return l===!0||l===!1||rr(l)&&kr(l)==Et;}var Fi=eT||Lh,YP=b0?sn(b0):qT;function jP(l){return rr(l)&&l.nodeType===1&&!fa(l);}function XP(l){if(l==null)return!0;if(Xr(l)&&(ge(l)||typeof l=="string"||typeof l.splice=="function"||Fi(l)||lo(l)||gs(l)))return!l.length;var f=Lr(l);if(f==V||f==ft)return!l.size;if(ca(l))return!Vf(l).length;for(var T in l)if(Ue.call(l,T))return!1;return!0;}function GP(l,f){return oa(l,f);}function HP(l,f,T){T=typeof T=="function"?T:e;var W=T?T(l,f):e;return W===e?oa(l,f,e,T):!!W;}function wh(l){if(!rr(l))return!1;var f=kr(l);return f==N||f==D||typeof l.message=="string"&&typeof l.name=="string"&&!fa(l);}function VP(l){return typeof l=="number"&&V0(l);}function si(l){if(!er(l))return!1;var f=kr(l);return f==J||f==Q||f==yt||f==Z;}function dg(l){return typeof l=="number"&&l==Ie(l);}function tc(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=lt;}function er(l){var f=_typeof(l);return l!=null&&(f=="object"||f=="function");}function rr(l){return l!=null&&_typeof(l)=="object";}var pg=M0?sn(M0):QT;function ZP(l,f){return l===f||Hf(l,f,ch(f));}function qP(l,f,T){return T=typeof T=="function"?T:e,Hf(l,f,ch(f),T);}function KP(l){return vg(l)&&l!=+l;}function QP(l){if(Nx(l))throw new pe(s);return ov(l);}function JP(l){return l===null;}function _P(l){return l==null;}function vg(l){return typeof l=="number"||rr(l)&&kr(l)==tt;}function fa(l){if(!rr(l)||kr(l)!=I)return!1;var f=bl(l);if(f===null)return!0;var T=Ue.call(f,"constructor")&&f.constructor;return typeof T=="function"&&T instanceof T&&xl.call(T)==qI;}var Sh=E0?sn(E0):JT;function tA(l){return dg(l)&&l>=-lt&&l<=lt;}var gg=L0?sn(L0):_T;function ec(l){return typeof l=="string"||!ge(l)&&rr(l)&&kr(l)==dt;}function an(l){return _typeof(l)=="symbol"||rr(l)&&kr(l)==ot;}var lo=O0?sn(O0):tx;function eA(l){return l===e;}function rA(l){return rr(l)&&Lr(l)==St;}function nA(l){return rr(l)&&kr(l)==Pt;}var iA=Gl(Zf),sA=Gl(function(l,f){return l<=f;});function mg(l){if(!l)return[];if(Xr(l))return ec(l)?Mn(l):jr(l);if(Jo&&l[Jo])return FI(l[Jo]());var f=Lr(l),T=f==V?Bf:f==ft?Sl:co;return T(l);}function oi(l){if(!l)return l===0?l:0;if(l=Tn(l),l===q||l===-q){var f=l<0?-1:1;return f*ut;}return l===l?l:0;}function Ie(l){var f=oi(l),T=f%1;return f===f?T?f-T:f:0;}function yg(l){return l?hs(Ie(l),0,O):0;}function Tn(l){if(typeof l=="number")return l;if(an(l))return Tt;if(er(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=er(f)?f+"":f;}if(typeof l!="string")return l===0?l:+l;l=F0(l);var T=Zs.test(l);return T||hf.test(l)?SI(l.slice(2),T?2:8):as.test(l)?Tt:+l;}function wg(l){return Hn(l,Gr(l));}function oA(l){return l?hs(Ie(l),-lt,lt):l===0?l:0;}function ze(l){return l==null?"":on(l);}var aA=so(function(l,f){if(ca(f)||Xr(f)){Hn(f,gr(f),l);return;}for(var T in f)Ue.call(f,T)&&na(l,T,f[T]);}),Sg=so(function(l,f){Hn(f,Gr(f),l);}),Ig=so(function(l,f,T,W){Hn(f,Gr(f),l,W);}),Ih=so(function(l,f,T,W){Hn(f,gr(f),l,W);}),lA=ni($f);function cA(l,f){var T=io(l);return f==null?T:J0(T,f);}var uA=Ce(function(l,f){l=Xe(l);var T=-1,W=f.length,it=W>2?f[2]:e;for(it&&Fr(f[0],f[1],it)&&(W=1);++T<W;)for(var mt=f[T],At=Gr(mt),Ot=-1,kt=At.length;++Ot<kt;){var Ht=At[Ot],Vt=l[Ht];(Vt===e||On(Vt,eo[Ht])&&!Ue.call(l,Ht))&&(l[Ht]=mt[Ht]);}return l;}),fA=Ce(function(l){return l.push(e,Fv),rn(Tg,e,l);});function hA(l,f){return R0(l,he(f,3),Gn);}function dA(l,f){return R0(l,he(f,3),jf);}function pA(l,f){return l==null?l:Yf(l,he(f,3),Gr);}function vA(l,f){return l==null?l:nv(l,he(f,3),Gr);}function gA(l,f){return l&&Gn(l,he(f,3));}function mA(l,f){return l&&jf(l,he(f,3));}function yA(l){return l==null?[]:Fl(l,gr(l));}function wA(l){return l==null?[]:Fl(l,Gr(l));}function Th(l,f,T){var W=l==null?e:ds(l,f);return W===e?T:W;}function SA(l,f){return l!=null&&zv(l,f,XT);}function xh(l,f){return l!=null&&zv(l,f,GT);}var IA=Dv(function(l,f,T){f!=null&&typeof f.toString!="function"&&(f=Cl.call(f)),l[f]=T;},Ph(Hr)),TA=Dv(function(l,f,T){f!=null&&typeof f.toString!="function"&&(f=Cl.call(f)),Ue.call(l,f)?l[f].push(T):l[f]=[T];},he),xA=Ce(sa);function gr(l){return Xr(l)?K0(l):Vf(l);}function Gr(l){return Xr(l)?K0(l,!0):ex(l);}function CA(l,f){var T={};return f=he(f,3),Gn(l,function(W,it,mt){Xn(T,f(W,it,mt),W);}),T;}function PA(l,f){var T={};return f=he(f,3),Gn(l,function(W,it,mt){Xn(T,it,f(W,it,mt));}),T;}var AA=so(function(l,f,T){Wl(l,f,T);}),Tg=so(function(l,f,T,W){Wl(l,f,T,W);}),bA=ni(function(l,f){var T={};if(l==null)return T;var W=!1;f=Je(f,function(mt){return mt=Bi(mt,l),W||(W=mt.length>1),mt;}),Hn(l,ah(l),T),W&&(T=wn(T,w|A|M,Tx));for(var it=f.length;it--;)_f(T,f[it]);return T;});function MA(l,f){return xg(l,_l(he(f)));}var EA=ni(function(l,f){return l==null?{}:nx(l,f);});function xg(l,f){if(l==null)return{};var T=Je(ah(l),function(W){return[W];});return f=he(f),dv(l,T,function(W,it){return f(W,it[0]);});}function LA(l,f,T){f=Bi(f,l);var W=-1,it=f.length;for(it||(it=1,l=e);++W<it;){var mt=l==null?e:l[Ln(f[W])];mt===e&&(W=it,mt=T),l=si(mt)?mt.call(l):mt;}return l;}function OA(l,f,T){return l==null?l:aa(l,f,T);}function DA(l,f,T,W){return W=typeof W=="function"?W:e,l==null?l:aa(l,f,T,W);}var Cg=Bv(gr),Pg=Bv(Gr);function RA(l,f,T){var W=ge(l),it=W||Fi(l)||lo(l);if(f=he(f,4),T==null){var mt=l&&l.constructor;it?T=W?new mt():[]:er(l)?T=si(mt)?io(bl(l)):{}:T={};}return(it?nn:Gn)(l,function(At,Ot,kt){return f(T,At,Ot,kt);}),T;}function NA(l,f){return l==null?!0:_f(l,f);}function BA(l,f,T){return l==null?l:yv(l,f,rh(T));}function kA(l,f,T,W){return W=typeof W=="function"?W:e,l==null?l:yv(l,f,rh(T),W);}function co(l){return l==null?[]:Nf(l,gr(l));}function FA(l){return l==null?[]:Nf(l,Gr(l));}function WA(l,f,T){return T===e&&(T=f,f=e),T!==e&&(T=Tn(T),T=T===T?T:0),f!==e&&(f=Tn(f),f=f===f?f:0),hs(Tn(l),f,T);}function UA(l,f,T){return f=oi(f),T===e?(T=f,f=0):T=oi(T),l=Tn(l),HT(l,f,T);}function zA(l,f,T){if(T&&typeof T!="boolean"&&Fr(l,f,T)&&(f=T=e),T===e&&(typeof f=="boolean"?(T=f,f=e):typeof l=="boolean"&&(T=l,l=e)),l===e&&f===e?(l=0,f=1):(l=oi(l),f===e?(f=l,l=0):f=oi(f)),l>f){var W=l;l=f,f=W;}if(T||l%1||f%1){var it=Z0();return Er(l+it*(f-l+wI("1e-"+((it+"").length-1))),f);}return Kf(l,f);}var $A=oo(function(l,f,T){return f=f.toLowerCase(),l+(T?Ag(f):f);});function Ag(l){return Ch(ze(l).toLowerCase());}function bg(l){return l=ze(l),l&&l.replace(pf,DI).replace(cI,"");}function YA(l,f,T){l=ze(l),f=on(f);var W=l.length;T=T===e?W:hs(Ie(T),0,W);var it=T;return T-=f.length,T>=0&&l.slice(T,it)==f;}function jA(l){return l=ze(l),l&&Ge.test(l)?l.replace(Be,RI):l;}function XA(l){return l=ze(l),l&&Xo.test(l)?l.replace(jn,"\\$&"):l;}var GA=oo(function(l,f,T){return l+(T?"-":"")+f.toLowerCase();}),HA=oo(function(l,f,T){return l+(T?" ":"")+f.toLowerCase();}),VA=Ev("toLowerCase");function ZA(l,f,T){l=ze(l),f=Ie(f);var W=f?_s(l):0;if(!f||W>=f)return l;var it=(f-W)/2;return Xl(Ol(it),T)+l+Xl(Ll(it),T);}function qA(l,f,T){l=ze(l),f=Ie(f);var W=f?_s(l):0;return f&&W<f?l+Xl(f-W,T):l;}function KA(l,f,T){l=ze(l),f=Ie(f);var W=f?_s(l):0;return f&&W<f?Xl(f-W,T)+l:l;}function QA(l,f,T){return T||f==null?f=0:f&&(f=+f),sT(ze(l).replace(Ai,""),f||0);}function JA(l,f,T){return(T?Fr(l,f,T):f===e)?f=1:f=Ie(f),Qf(ze(l),f);}function _A(){var l=arguments,f=ze(l[0]);return l.length<3?f:f.replace(l[1],l[2]);}var tb=oo(function(l,f,T){return l+(T?"_":"")+f.toLowerCase();});function eb(l,f,T){return T&&typeof T!="number"&&Fr(l,f,T)&&(f=T=e),T=T===e?O:T>>>0,T?(l=ze(l),l&&(typeof f=="string"||f!=null&&!Sh(f))&&(f=on(f),!f&&Js(l))?ki(Mn(l),0,T):l.split(f,T)):[];}var rb=oo(function(l,f,T){return l+(T?" ":"")+Ch(f);});function nb(l,f,T){return l=ze(l),T=T==null?0:hs(Ie(T),0,l.length),f=on(f),l.slice(T,T+f.length)==f;}function ib(l,f,T){var W=vt.templateSettings;T&&Fr(l,f,T)&&(f=e),l=ze(l),f=Ih({},f,W,kv);var it=Ih({},f.imports,W.imports,kv),mt=gr(it),At=Nf(it,mt);nn(mt,function(fe){if(os.test(fe))throw new pe(u);});var Ot,kt,Ht=0,Vt=f.interpolate||bn,qt="__p += '",ie=kf((f.escape||bn).source+"|"+Vt.source+"|"+(Vt===lr?Zo:bn).source+"|"+(f.evaluate||bn).source+"|$","g"),ce="//# sourceURL="+(Ue.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++pI+"]")+"\n";l.replace(ie,function(fe,Ae,Ee,ln,Wr,cn){return Ee||(Ee=ln),qt+=l.slice(Ht,cn).replace(vf,NI),Ae&&(Ot=!0,qt+="' +\n__e("+Ae+") +\n'"),Wr&&(kt=!0,qt+="';\n"+Wr+";\n__p += '"),Ee&&(qt+="' +\n((__t = ("+Ee+")) == null ? '' : __t) +\n'"),Ht=cn+fe.length,fe;}),qt+="';\n";var de=Ue.call(f,"variable")&&f.variable;if(!de)qt="with (obj) {\n"+qt+"\n}\n";else if(os.test(de))throw new pe(a);qt=(kt?qt.replace(le,""):qt).replace(Oe,"$1").replace(De,"$1;"),qt="function("+(de||"obj")+") {\n"+(de?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(Ot?", __e = _.escape":"")+(kt?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+qt+"return __p\n}";var xe=Eg(function(){return ke(mt,ce+"return "+qt).apply(e,At);});if(xe.source=qt,wh(xe))throw xe;return xe;}function sb(l){return ze(l).toLowerCase();}function ob(l){return ze(l).toUpperCase();}function ab(l,f,T){if(l=ze(l),l&&(T||f===e))return F0(l);if(!l||!(f=on(f)))return l;var W=Mn(l),it=Mn(f),mt=W0(W,it),At=U0(W,it)+1;return ki(W,mt,At).join("");}function lb(l,f,T){if(l=ze(l),l&&(T||f===e))return l.slice(0,$0(l)+1);if(!l||!(f=on(f)))return l;var W=Mn(l),it=U0(W,Mn(f))+1;return ki(W,0,it).join("");}function cb(l,f,T){if(l=ze(l),l&&(T||f===e))return l.replace(Ai,"");if(!l||!(f=on(f)))return l;var W=Mn(l),it=W0(W,Mn(f));return ki(W,it).join("");}function ub(l,f){var T=K,W=j;if(er(f)){var it="separator"in f?f.separator:it;T="length"in f?Ie(f.length):T,W="omission"in f?on(f.omission):W;}l=ze(l);var mt=l.length;if(Js(l)){var At=Mn(l);mt=At.length;}if(T>=mt)return l;var Ot=T-_s(W);if(Ot<1)return W;var kt=At?ki(At,0,Ot).join(""):l.slice(0,Ot);if(it===e)return kt+W;if(At&&(Ot+=kt.length-Ot),Sh(it)){if(l.slice(Ot).search(it)){var Ht,Vt=kt;for(it.global||(it=kf(it.source,ze(An.exec(it))+"g")),it.lastIndex=0;Ht=it.exec(Vt);)var qt=Ht.index;kt=kt.slice(0,qt===e?Ot:qt);}}else if(l.indexOf(on(it),Ot)!=Ot){var ie=kt.lastIndexOf(it);ie>-1&&(kt=kt.slice(0,ie));}return kt+W;}function fb(l){return l=ze(l),l&&Ye.test(l)?l.replace(Ne,$I):l;}var hb=oo(function(l,f,T){return l+(T?" ":"")+f.toUpperCase();}),Ch=Ev("toUpperCase");function Mg(l,f,T){return l=ze(l),f=T?e:f,f===e?kI(l)?XI(l):bI(l):l.match(f)||[];}var Eg=Ce(function(l,f){try{return rn(l,e,f);}catch(T){return wh(T)?T:new pe(T);}}),db=ni(function(l,f){return nn(f,function(T){T=Ln(T),Xn(l,T,mh(l[T],l));}),l;});function pb(l){var f=l==null?0:l.length,T=he();return l=f?Je(l,function(W){if(typeof W[1]!="function")throw new mn(o);return[T(W[0]),W[1]];}):[],Ce(function(W){for(var it=-1;++it<f;){var mt=l[it];if(rn(mt[0],this,W))return rn(mt[1],this,W);}});}function vb(l){return $T(wn(l,w));}function Ph(l){return function(){return l;};}function gb(l,f){return l==null||l!==l?f:l;}var mb=Ov(),yb=Ov(!0);function Hr(l){return l;}function Ah(l){return av(typeof l=="function"?l:wn(l,w));}function wb(l){return cv(wn(l,w));}function Sb(l,f){return uv(l,wn(f,w));}var Ib=Ce(function(l,f){return function(T){return sa(T,l,f);};}),Tb=Ce(function(l,f){return function(T){return sa(l,T,f);};});function bh(l,f,T){var W=gr(f),it=Fl(f,W);T==null&&!(er(f)&&(it.length||!W.length))&&(T=f,f=l,l=this,it=Fl(f,gr(f)));var mt=!(er(T)&&"chain"in T)||!!T.chain,At=si(l);return nn(it,function(Ot){var kt=f[Ot];l[Ot]=kt,At&&(l.prototype[Ot]=function(){var Ht=this.__chain__;if(mt||Ht){var Vt=l(this.__wrapped__),qt=Vt.__actions__=jr(this.__actions__);return qt.push({func:kt,args:arguments,thisArg:l}),Vt.__chain__=Ht,Vt;}return kt.apply(l,Li([this.value()],arguments));});}),l;}function xb(){return Ir._===this&&(Ir._=KI),this;}function Mh(){}function Cb(l){return l=Ie(l),Ce(function(f){return fv(f,l);});}var Pb=ih(Je),Ab=ih(D0),bb=ih(Ef);function Lg(l){return fh(l)?Lf(Ln(l)):ix(l);}function Mb(l){return function(f){return l==null?e:ds(l,f);};}var Eb=Rv(),Lb=Rv(!0);function Eh(){return[];}function Lh(){return!1;}function Ob(){return{};}function Db(){return"";}function Rb(){return!0;}function Nb(l,f){if(l=Ie(l),l<1||l>lt)return[];var T=O,W=Er(l,O);f=he(f),l-=O;for(var it=Rf(W,f);++T<l;)f(T);return it;}function Bb(l){return ge(l)?Je(l,Ln):an(l)?[l]:jr(qv(ze(l)));}function kb(l){var f=++ZI;return ze(l)+f;}var Fb=jl(function(l,f){return l+f;},0),Wb=sh("ceil"),Ub=jl(function(l,f){return l/f;},1),zb=sh("floor");function $b(l){return l&&l.length?kl(l,Hr,Xf):e;}function Yb(l,f){return l&&l.length?kl(l,he(f,2),Xf):e;}function jb(l){return B0(l,Hr);}function Xb(l,f){return B0(l,he(f,2));}function Gb(l){return l&&l.length?kl(l,Hr,Zf):e;}function Hb(l,f){return l&&l.length?kl(l,he(f,2),Zf):e;}var Vb=jl(function(l,f){return l*f;},1),Zb=sh("round"),qb=jl(function(l,f){return l-f;},0);function Kb(l){return l&&l.length?Df(l,Hr):0;}function Qb(l,f){return l&&l.length?Df(l,he(f,2)):0;}return vt.after=SP,vt.ary=og,vt.assign=aA,vt.assignIn=Sg,vt.assignInWith=Ig,vt.assignWith=Ih,vt.at=lA,vt.before=ag,vt.bind=mh,vt.bindAll=db,vt.bindKey=lg,vt.castArray=DP,vt.chain=ng,vt.chunk=$x,vt.compact=Yx,vt.concat=jx,vt.cond=pb,vt.conforms=vb,vt.constant=Ph,vt.countBy=QC,vt.create=cA,vt.curry=cg,vt.curryRight=ug,vt.debounce=fg,vt.defaults=uA,vt.defaultsDeep=fA,vt.defer=IP,vt.delay=TP,vt.difference=Xx,vt.differenceBy=Gx,vt.differenceWith=Hx,vt.drop=Vx,vt.dropRight=Zx,vt.dropRightWhile=qx,vt.dropWhile=Kx,vt.fill=Qx,vt.filter=_C,vt.flatMap=rP,vt.flatMapDeep=nP,vt.flatMapDepth=iP,vt.flatten=_v,vt.flattenDeep=Jx,vt.flattenDepth=_x,vt.flip=xP,vt.flow=mb,vt.flowRight=yb,vt.fromPairs=tC,vt.functions=yA,vt.functionsIn=wA,vt.groupBy=sP,vt.initial=rC,vt.intersection=nC,vt.intersectionBy=iC,vt.intersectionWith=sC,vt.invert=IA,vt.invertBy=TA,vt.invokeMap=aP,vt.iteratee=Ah,vt.keyBy=lP,vt.keys=gr,vt.keysIn=Gr,vt.map=Kl,vt.mapKeys=CA,vt.mapValues=PA,vt.matches=wb,vt.matchesProperty=Sb,vt.memoize=Jl,vt.merge=AA,vt.mergeWith=Tg,vt.method=Ib,vt.methodOf=Tb,vt.mixin=bh,vt.negate=_l,vt.nthArg=Cb,vt.omit=bA,vt.omitBy=MA,vt.once=CP,vt.orderBy=cP,vt.over=Pb,vt.overArgs=PP,vt.overEvery=Ab,vt.overSome=bb,vt.partial=yh,vt.partialRight=hg,vt.partition=uP,vt.pick=EA,vt.pickBy=xg,vt.property=Lg,vt.propertyOf=Mb,vt.pull=cC,vt.pullAll=eg,vt.pullAllBy=uC,vt.pullAllWith=fC,vt.pullAt=hC,vt.range=Eb,vt.rangeRight=Lb,vt.rearg=AP,vt.reject=dP,vt.remove=dC,vt.rest=bP,vt.reverse=vh,vt.sampleSize=vP,vt.set=OA,vt.setWith=DA,vt.shuffle=gP,vt.slice=pC,vt.sortBy=wP,vt.sortedUniq=IC,vt.sortedUniqBy=TC,vt.split=eb,vt.spread=MP,vt.tail=xC,vt.take=CC,vt.takeRight=PC,vt.takeRightWhile=AC,vt.takeWhile=bC,vt.tap=YC,vt.throttle=EP,vt.thru=ql,vt.toArray=mg,vt.toPairs=Cg,vt.toPairsIn=Pg,vt.toPath=Bb,vt.toPlainObject=wg,vt.transform=RA,vt.unary=LP,vt.union=MC,vt.unionBy=EC,vt.unionWith=LC,vt.uniq=OC,vt.uniqBy=DC,vt.uniqWith=RC,vt.unset=NA,vt.unzip=gh,vt.unzipWith=rg,vt.update=BA,vt.updateWith=kA,vt.values=co,vt.valuesIn=FA,vt.without=NC,vt.words=Mg,vt.wrap=OP,vt.xor=BC,vt.xorBy=kC,vt.xorWith=FC,vt.zip=WC,vt.zipObject=UC,vt.zipObjectDeep=zC,vt.zipWith=$C,vt.entries=Cg,vt.entriesIn=Pg,vt.extend=Sg,vt.extendWith=Ig,bh(vt,vt),vt.add=Fb,vt.attempt=Eg,vt.camelCase=$A,vt.capitalize=Ag,vt.ceil=Wb,vt.clamp=WA,vt.clone=RP,vt.cloneDeep=BP,vt.cloneDeepWith=kP,vt.cloneWith=NP,vt.conformsTo=FP,vt.deburr=bg,vt.defaultTo=gb,vt.divide=Ub,vt.endsWith=YA,vt.eq=On,vt.escape=jA,vt.escapeRegExp=XA,vt.every=JC,vt.find=tP,vt.findIndex=Qv,vt.findKey=hA,vt.findLast=eP,vt.findLastIndex=Jv,vt.findLastKey=dA,vt.floor=zb,vt.forEach=ig,vt.forEachRight=sg,vt.forIn=pA,vt.forInRight=vA,vt.forOwn=gA,vt.forOwnRight=mA,vt.get=Th,vt.gt=WP,vt.gte=UP,vt.has=SA,vt.hasIn=xh,vt.head=tg,vt.identity=Hr,vt.includes=oP,vt.indexOf=eC,vt.inRange=UA,vt.invoke=xA,vt.isArguments=gs,vt.isArray=ge,vt.isArrayBuffer=zP,vt.isArrayLike=Xr,vt.isArrayLikeObject=nr,vt.isBoolean=$P,vt.isBuffer=Fi,vt.isDate=YP,vt.isElement=jP,vt.isEmpty=XP,vt.isEqual=GP,vt.isEqualWith=HP,vt.isError=wh,vt.isFinite=VP,vt.isFunction=si,vt.isInteger=dg,vt.isLength=tc,vt.isMap=pg,vt.isMatch=ZP,vt.isMatchWith=qP,vt.isNaN=KP,vt.isNative=QP,vt.isNil=_P,vt.isNull=JP,vt.isNumber=vg,vt.isObject=er,vt.isObjectLike=rr,vt.isPlainObject=fa,vt.isRegExp=Sh,vt.isSafeInteger=tA,vt.isSet=gg,vt.isString=ec,vt.isSymbol=an,vt.isTypedArray=lo,vt.isUndefined=eA,vt.isWeakMap=rA,vt.isWeakSet=nA,vt.join=oC,vt.kebabCase=GA,vt.last=In,vt.lastIndexOf=aC,vt.lowerCase=HA,vt.lowerFirst=VA,vt.lt=iA,vt.lte=sA,vt.max=$b,vt.maxBy=Yb,vt.mean=jb,vt.meanBy=Xb,vt.min=Gb,vt.minBy=Hb,vt.stubArray=Eh,vt.stubFalse=Lh,vt.stubObject=Ob,vt.stubString=Db,vt.stubTrue=Rb,vt.multiply=Vb,vt.nth=lC,vt.noConflict=xb,vt.noop=Mh,vt.now=Ql,vt.pad=ZA,vt.padEnd=qA,vt.padStart=KA,vt.parseInt=QA,vt.random=zA,vt.reduce=fP,vt.reduceRight=hP,vt.repeat=JA,vt.replace=_A,vt.result=LA,vt.round=Zb,vt.runInContext=Bt,vt.sample=pP,vt.size=mP,vt.snakeCase=tb,vt.some=yP,vt.sortedIndex=vC,vt.sortedIndexBy=gC,vt.sortedIndexOf=mC,vt.sortedLastIndex=yC,vt.sortedLastIndexBy=wC,vt.sortedLastIndexOf=SC,vt.startCase=rb,vt.startsWith=nb,vt.subtract=qb,vt.sum=Kb,vt.sumBy=Qb,vt.template=ib,vt.times=Nb,vt.toFinite=oi,vt.toInteger=Ie,vt.toLength=yg,vt.toLower=sb,vt.toNumber=Tn,vt.toSafeInteger=oA,vt.toString=ze,vt.toUpper=ob,vt.trim=ab,vt.trimEnd=lb,vt.trimStart=cb,vt.truncate=ub,vt.unescape=fb,vt.uniqueId=kb,vt.upperCase=hb,vt.upperFirst=Ch,vt.each=ig,vt.eachRight=sg,vt.first=tg,bh(vt,function(){var l={};return Gn(vt,function(f,T){Ue.call(vt.prototype,T)||(l[T]=f);}),l;}(),{chain:!1}),vt.VERSION=n,nn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){vt[l].placeholder=vt;}),nn(["drop","take"],function(l,f){Me.prototype[l]=function(T){T=T===e?1:hr(Ie(T),0);var W=this.__filtered__&&!f?new Me(this):this.clone();return W.__filtered__?W.__takeCount__=Er(T,W.__takeCount__):W.__views__.push({size:Er(T,O),type:l+(W.__dir__<0?"Right":"")}),W;},Me.prototype[l+"Right"]=function(T){return this.reverse()[l](T).reverse();};}),nn(["filter","map","takeWhile"],function(l,f){var T=f+1,W=T==F||T==Y;Me.prototype[l]=function(it){var mt=this.clone();return mt.__iteratees__.push({iteratee:he(it,3),type:T}),mt.__filtered__=mt.__filtered__||W,mt;};}),nn(["head","last"],function(l,f){var T="take"+(f?"Right":"");Me.prototype[l]=function(){return this[T](1).value()[0];};}),nn(["initial","tail"],function(l,f){var T="drop"+(f?"":"Right");Me.prototype[l]=function(){return this.__filtered__?new Me(this):this[T](1);};}),Me.prototype.compact=function(){return this.filter(Hr);},Me.prototype.find=function(l){return this.filter(l).head();},Me.prototype.findLast=function(l){return this.reverse().find(l);},Me.prototype.invokeMap=Ce(function(l,f){return typeof l=="function"?new Me(this):this.map(function(T){return sa(T,l,f);});}),Me.prototype.reject=function(l){return this.filter(_l(he(l)));},Me.prototype.slice=function(l,f){l=Ie(l);var T=this;return T.__filtered__&&(l>0||f<0)?new Me(T):(l<0?T=T.takeRight(-l):l&&(T=T.drop(l)),f!==e&&(f=Ie(f),T=f<0?T.dropRight(-f):T.take(f-l)),T);},Me.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse();},Me.prototype.toArray=function(){return this.take(O);},Gn(Me.prototype,function(l,f){var T=/^(?:filter|find|map|reject)|While$/.test(f),W=/^(?:head|last)$/.test(f),it=vt[W?"take"+(f=="last"?"Right":""):f],mt=W||/^find/.test(f);it&&(vt.prototype[f]=function(){var At=this.__wrapped__,Ot=W?[1]:arguments,kt=At instanceof Me,Ht=Ot[0],Vt=kt||ge(At),qt=function qt(Ae){var Ee=it.apply(vt,Li([Ae],Ot));return W&&ie?Ee[0]:Ee;};Vt&&T&&typeof Ht=="function"&&Ht.length!=1&&(kt=Vt=!1);var ie=this.__chain__,ce=!!this.__actions__.length,de=mt&&!ie,xe=kt&&!ce;if(!mt&&Vt){At=xe?At:new Me(this);var fe=l.apply(At,Ot);return fe.__actions__.push({func:ql,args:[qt],thisArg:e}),new yn(fe,ie);}return de&&xe?l.apply(this,Ot):(fe=this.thru(qt),de?W?fe.value()[0]:fe.value():fe);});}),nn(["pop","push","shift","sort","splice","unshift"],function(l){var f=Il[l],T=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",W=/^(?:pop|shift)$/.test(l);vt.prototype[l]=function(){var it=arguments;if(W&&!this.__chain__){var mt=this.value();return f.apply(ge(mt)?mt:[],it);}return this[T](function(At){return f.apply(ge(At)?At:[],it);});};}),Gn(Me.prototype,function(l,f){var T=vt[f];if(T){var W=T.name+"";Ue.call(no,W)||(no[W]=[]),no[W].push({name:f,func:T});}}),no[Yl(e,z).name]=[{name:"wrapper",func:e}],Me.prototype.clone=hT,Me.prototype.reverse=dT,Me.prototype.value=pT,vt.prototype.at=jC,vt.prototype.chain=XC,vt.prototype.commit=GC,vt.prototype.next=HC,vt.prototype.plant=ZC,vt.prototype.reverse=qC,vt.prototype.toJSON=vt.prototype.valueOf=vt.prototype.value=KC,vt.prototype.first=vt.prototype.head,Jo&&(vt.prototype[Jo]=VC),vt;},to=GI();ls?((ls.exports=to)._=to,Pf._=to):Ir._=to;}).call(Qe);})(mu,mu.exports);mu.exports;var DPt=(_DPt={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_DPt,It.Selector,_e.selector),It.Clicker,_e.clicker),It.Text,_e.text),It.Pencil,_e.pencil),It.LaserPen,_e.laserPen),It.Arrow,_e.arrow),It.Straight,_e.straight),It.Rectangle,_e.rectangle),It.Ellipse,_e.ellipse),It.Star,qi.star),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_DPt,It.Polygon,qi.polygon),It.SpeechBalloon,qi.speechBalloon),It.Eraser,_e.eraser),It.PencilEraser,_e.pencilEraser),It.BitMapEraser,qi.bitMapEraser));function RPt(r){return r===void 0?void 0:DPt[r];}function kn(r){return RPt(r);}var $c=5,Hi=/*#__PURE__*/function(_jt11){function Hi(e){var _this61;_classCallCheck(this,Hi);_this61=_callSuper(this,Hi,[e]);wt(_this61,"canRotate",!1);wt(_this61,"scaleType",be.proportional);wt(_this61,"toolsType",It.Text);wt(_this61,"tmpPoints",[]);wt(_this61,"workOptions");wt(_this61,"oldRect");_this61.workOptions=e.toolsOpt;return _this61;}_inherits(Hi,_jt11);return _createClass(Hi,[{key:"consume",value:function consume(){return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:xt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(e){var n,i,s,o,_this$workOptions14,a,u,d,v,p,w,A,M,E,L,G,z,et;return _regenerator().w(function(_context15){while(1)switch(_context15.n){case 0:n=e.workId,i=e.layer,s=e.isDrawLabel,o=e.boxRect,_this$workOptions14=this.workOptions,a=_this$workOptions14.boxSize,u=_this$workOptions14.boxPoint,d=_this$workOptions14.zIndex,v=i.worldPosition,p=i.worldScaling;if(!(!u||!a)){_context15.n=1;break;}return _context15.a(2);case 1:w={name:n,id:n,pos:[u[0]-$c,u[1]-$c],anchor:[0,0],size:a,zIndex:d},A=new ar(w),M={x:u[0]-$c,y:u[1]-$c,w:a[0],h:a[1]},E={x:Math.floor(M.x*p[0]+v[0]),y:Math.floor(M.y*p[1]+v[1]),w:Math.floor(M.w*p[0])+2,h:Math.floor(M.h*p[1])+2};this.replace(i,n,A);if(!(o&&(L=qa(E,o)),(s||o&&L!==Ji.outside)&&i&&this.workOptions.text)){_context15.n=3;break;}_context15.n=2;return Hi.createLabels(this.workOptions,i,E);case 2:G=_context15.v;z=G.labels;et=G.maxWidth;A.append.apply(A,_toConsumableArray(z)),E.w=Math.ceil(Math.max(et*i.worldScaling[0],E.w));case 3:return _context15.a(2,E);}},_callee14,this);}));function draw(_x22){return _draw2.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(e){var v,p,w,A,n,i,s,o,a,u,d;return _regenerator().w(function(_context16){while(1)switch(_context16.n){case 0:n=(v=this.workId)==null?void 0:v.toString();if(n){_context16.n=1;break;}return _context16.a(2);case 1:i=e.isFullWork,s=e.replaceId,o=e.isDrawLabel,a=e.boxRect;this.oldRect=s&&((w=(p=this.vNodes)==null?void 0:p.get(s))==null?void 0:w.rect)||void 0;u=i?this.fullLayer:this.drawLayer||this.fullLayer;_context16.n=2;return this.draw({workId:n,layer:u,isDrawLabel:_typeof(o)>"u"&&this.workOptions.workState===te.Done||o,boxRect:a});case 2:d=_context16.v;return _context16.a(2,((A=this.vNodes)==null||A.setInfo(n,{rect:d,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:d&&jt.getCenterPos(d,u)}),d));}},_callee15,this);}));function consumeServiceAsync(_x23){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(e,n,i){var E,L,s,o,a,u,d,v,p,w,A,M;return _regenerator().w(function(_context17){while(1)switch(_context17.n){case 0:if(this.workId){_context17.n=1;break;}return _context17.a(2);case 1:s=this.workId.toString(),o=e.fontColor,a=e.fontBgColor,u=e.bold,d=e.italic,v=e.lineThrough,p=e.underline,w=e.zIndex,A=(E=this.vNodes)==null?void 0:E.get(s);if(A){_context17.n=2;break;}return _context17.a(2);case 2:o&&(A.opt.fontColor=o),a&&(A.opt.fontBgColor=a),u&&(A.opt.bold=u),d&&(A.opt.italic=d),bs(v)&&(A.opt.lineThrough=v),bs(p)&&(A.opt.underline=p),Ze(w)&&(A.opt.zIndex=w),this.oldRect=A.rect;_context17.n=3;return this.draw({workId:s,layer:this.fullLayer,isDrawLabel:_typeof(n)>"u"&&this.workOptions.workState===te.Done||n,boxRect:i});case 3:M=_context17.v;return _context17.a(2,((L=this.vNodes)==null||L.setInfo(s,{rect:M,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:M&&jt.getCenterPos(M,this.fullLayer)}),M));}},_callee16,this);}));function updataOptServiceAsync(_x24,_x25,_x26){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function(){var _normalizeStorageData2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17(e){return _regenerator().w(function(_context18){while(1)switch(_context18.n){case 0:return _context18.a(2,this.normalizeStorageDataSync(e));}},_callee17,this);}));function normalizeStorageData(_x27){return _normalizeStorageData2.apply(this,arguments);}return normalizeStorageData;}()},{key:"normalizeStorageDataSync",value:function normalizeStorageDataSync(e){var n=jt.normalizeStorageDataSync(e);if(n.status==="unrecoverable")return n;var i=n.value,s=i.opt;return s&&s.workState!==te.Done?(i.type=xt.FullWork,i.opt=_objectSpread(_objectSpread({},s),{},{workState:te.Done}),{status:"stable",value:i}):n;}},{key:"getSafetySnippetRatio",value:function getSafetySnippetRatio(e){var n=(e==null?void 0:e.parent).displayRatio||1,i=Math.ceil(e.worldScaling[0]*10)/10;var s=i;return i<=2?s=i*n*2:i>2&&i<=3?s=i*n*1.6:i>3&&i<=4?s=i*n*1.2:i>4&&(s=i*n),Math.floor(s*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(e){return Math.floor(Hi.textImageSnippetSize*3/4/e)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18(e,n,i){var K,s,o,a,_ref64,u,d,v,p,w,A,M,E,L,G,z,et,x,y,S,C,P,X,$,j,nt,ct,F,R,Y,q,lt,ut,Tt,O,_,H,at,ht,yt,Et,Dt,D,N,U,_at2,_ht2,_yt2,_at3,_ht3,_10,_H2;return _regenerator().w(function(_context19){while(1)switch(_context19.n){case 0:s=[],o=i.x,a=i.y,_ref64=(K=n.parent)==null?void 0:K.parent,u=_ref64.width,d=_ref64.height,v=Os(e.text),p=v.length,w=e.fontSize,A=e.lineHeight,M=e.bold,E=e.textAlign,L=e.italic,G=e.fontFamily,z=e.verticalAlign,et=e.fontColor,x=e.fontBgColor,y=e.underline,S=e.lineThrough,C=Hi.getSafetySnippetRatio(n)||1,P=Math.floor(w*C),X=Hi.getSafetySnippetFontLength(P);$=0;j=0;case 1:if(!(j<p)){_context19.n=7;break;}nt=v[j],ct=A||P*1.5;if(!nt){_context19.n=6;break;}F=VPt(nt),R=[0,0],Y=[0,w*1.2];z==="middle"&&(R[1]=Math.floor(j*w*1.2+6+w*(1.1-1)));q=[0,Math.floor(-w*0.15)];R[0]=6;lt=Math.sin(Math.PI/180*20);ut=0;Tt=[];O=0;case 2:if(!(O<F)){_context19.n=5;break;}E==="left"&&(q[0]=ut),O===0&&L==="italic"&&(q[0]=q[0]-lt/2*w);_=nt.slice(O,O+X);H={anchor:[0,0],pos:q,text:_,fontFamily:G,fontSize:P,lineHeight:ct,strokeColor:et,fontWeight:M,fillColor:et,textAlign:E,fontStyle:L,scale:[1/C,1/C]};at=new t0(H);_context19.n=3;return at.textImageReady;case 3:ht=_context19.v;yt=!0;if(ht){Et=ht.rect&&ht.rect[2],Dt=ht.rect&&ht.rect[3];if(Et&&Dt){D=Et/C,N=Dt/C;ut=D+ut,L==="italic"&&(M==="bold"?ut=ut-lt*w*1.2:ut=ut-lt*w),((q[0]+R[0]+D)*n.worldScaling[0]+o<=0||(q[0]+R[0])*n.worldScaling[0]+o>=u||(q[1]+R[1]+N)*n.worldScaling[1]+a<=0||(q[1]+R[1])*n.worldScaling[1]+a>=d)&&(at.disconnect(),yt=!1),yt&&Tt.push(at);}}O+=X;case 4:_context19.n=2;break;case 5:Y[0]=ut,L==="italic"&&(Y[0]=Y[0]+lt*w),$=Math.max($,Y[0]);U=!0;if(((R[0]+Y[0])*n.worldScaling[0]+o<=0||R[0]*n.worldScaling[0]+o>=u||(R[1]+Y[1])*n.worldScaling[0]+a<=0||R[1]*n.worldScaling[1]+a>=d)&&(U=!1),U){if(y){_at2=Math.floor(w/10),_ht2={normalize:!1,pos:[0,w*1.1+_at2/2],lineWidth:_at2,points:[0,0,Math.ceil(Y[0]),0],strokeColor:et,className:"underline"},_yt2=new Un(_ht2);Tt.push(_yt2);}if(S){_at3={normalize:!1,pos:[0,w*1.2/2],lineWidth:Math.floor(w/10),points:[0,0,Math.ceil(Y[0]),0],strokeColor:et,className:"lineThrough"},_ht3=new Un(_at3);Tt.push(_ht3);}_10={pos:R,anchor:[0,0],size:Y,bgcolor:x},_H2=new ar(_10);_H2.append.apply(_H2,Tt),s.push(_H2);}case 6:j++;_context19.n=1;break;case 7:return _context19.a(2,{labels:s,maxWidth:$});}},_callee18);}));function createLabels(_x28,_x29,_x30){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(e){var n=e.node,i=e.opt,s=e.vNodes,o=e.targetNode,a=i.fontBgColor,u=i.fontColor,d=i.translate,v=i.originPoint,p=i.scenePoint,w=i.scale,A=i.bold,M=i.italic,E=i.lineThrough,L=i.underline,G=i.fontSize,z=i.textInfos,et=i.zIndex,x=o&&br(o)||s.get(n.name);if(!x||!n.parent)return;var S=x.opt;if(Ze(et)&&(n.setAttribute("zIndex",et),x.opt.zIndex=et),u&&S.fontColor&&(S.fontColor=u,n.children.forEach(function(C){C.tagName==="GROUP"&&C.children.forEach(function(P){P.tagName==="LABEL"?(P.setAttribute("fillColor",u),P.setAttribute("strokeColor",u)):P.tagName==="POLYLINE"&&P.setAttribute("strokeColor",u);});})),a&&S.fontBgColor&&(S.fontBgColor=a,n.children.forEach(function(C){C.tagName==="GROUP"&&C.setAttribute("bgcolor",a);})),A&&(S.bold=A),M&&(S.italic=M),bs(E)&&(S.lineThrough=E),bs(L)&&(S.underline=L),G&&(S.fontSize=G),v&&p&&w&&o&&S.boxPoint){var C=z==null?void 0:z.get(n.name);if(C){var K=C.fontSize,j=C.boxSize;S.boxSize=j||S.boxSize,S.fontSize=K||S.fontSize;}var P=[S.boxPoint[0],S.boxPoint[1]];uf(S.boxPoint,p,w,d);var X=[x.op[0],x.op[1]],$=[X[0]-P[0],X[1]-P[1]];if(x.centerPos=[x.centerPos[0]+$[0],x.centerPos[1]+$[1]],x.opt.eraserlines){var _iterator48=_createForOfIteratorHelper(x.opt.eraserlines),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var _K13=_step48.value;var _j3=_K13.op,nt=_K13.thickness;_K13.thickness=Math.round(nt*Math.max(w[0],w[1]));for(var ct=0;ct<_j3.length;ct++)Fa(_j3[ct],p,w,d);}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}}}else if(d&&S.boxPoint&&(S.boxPoint=[Math.round(S.boxPoint[0]+d[0]),Math.round(S.boxPoint[1]+d[1])],x.centerPos=[x.centerPos[0]+d[0],x.centerPos[1]+d[1]],x.opt.eraserlines)){var _iterator49=_createForOfIteratorHelper(x.opt.eraserlines),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _C7=_step49.value;var _P7=_C7.op;for(var _X13=0;_X13<_P7.length;_X13++){var _$12=_P7[_X13].map(function(K,j){return j%2?K+d[1]:K+d[0];});_C7.op[_X13]=_$12;}}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}}return x&&s.setInfo(n.name,x),x==null?void 0:x.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(e,n){var i=e.getElementsByName(n)[0];if(i){var s=i.getBoundingClientRect();var o={x:Math.floor(s.x),y:Math.floor(s.y),w:Math.floor(s.width+2),h:Math.floor(s.height+2)};return i.children.forEach(function(a){if(a.tagName==="GROUP"){var u=i.getBoundingClientRect();o=Jt(o,{x:Math.floor(u.x),y:Math.floor(u.y),w:Math.floor(u.width+2),h:Math.floor(u.height+2)});}}),o;}}}]);}(jt);// 4k
|
|
481
|
-
wt(Hi,"textImageSnippetSize",1024*4),wt(Hi,"SafeBorderPadding",30);var Ha=Hi;var
|
|
482
|
-
wt(bo,"eraserSizes",v0);var yu=bo;It.Image,It.BackgroundSVG;It.Polygon,It.Star,It.Star,It.Star,It.SpeechBalloon;It.Pencil,It.LaserPen,It.Arrow,It.Straight;It.Rectangle,It.Ellipse,It.Triangle,It.Rhombus,It.Polygon,It.Star,It.SpeechBalloon;var
|
|
480
|
+
ii(Ht,kt)))&&Ot.push(Ht);return Ot;}function Q0(l){var f=l.length;return f?l[Kf(0,f-1)]:e;}function FT(l,f){return Zl(jr(l),hs(f,0,l.length));}function WT(l){return Zl(jr(l));}function zf(l,f,T){(T!==e&&!On(l[f],T)||T===e&&!(f in l))&&Xn(l,f,T);}function na(l,f,T){var W=l[f];(!(Ue.call(l,f)&&On(W,T))||T===e&&!(f in l))&&Xn(l,f,T);}function Bl(l,f){for(var T=l.length;T--;)if(On(l[T][0],f))return T;return-1;}function UT(l,f,T,W){return Ri(l,function(it,mt,At){f(W,it,T(it),At);}),W;}function J0(l,f){return l&&Hn(f,gr(f),l);}function zT(l,f){return l&&Hn(f,Gr(f),l);}function Xn(l,f,T){f=="__proto__"&&El?El(l,f,{configurable:!0,enumerable:!0,value:T,writable:!0}):l[f]=T;}function $f(l,f){for(var T=-1,W=f.length,it=zt(W),mt=l==null;++T<W;)it[T]=mt?e:Th(l,f[T]);return it;}function hs(l,f,T){return l===l&&(T!==e&&(l=l<=T?l:T),f!==e&&(l=l>=f?l:f)),l;}function wn(l,f,T,W,it,mt){var At,Ot=f&w,kt=f&A,Ht=f&M;if(T&&(At=it?T(l,W,it,mt):T(l)),At!==e)return At;if(!er(l))return l;var Vt=ge(l);if(Vt){if(At=Mx(l),!Ot)return jr(l,At);}else{var qt=Lr(l),ie=qt==J||qt==Q;if(Fi(l))return Tv(l,Ot);if(qt==I||qt==at||ie&&!it){if(At=kt||ie?{}:$v(l),!Ot)return kt?mx(l,zT(At,l)):gx(l,J0(At,l));}else{if(!He[qt])return it?l:{};At=Ex(l,qt,Ot);}}mt||(mt=new En());var ce=mt.get(l);if(ce)return ce;mt.set(l,At),gg(l)?l.forEach(function(fe){At.add(wn(fe,f,T,fe,l,mt));}):pg(l)&&l.forEach(function(fe,Ae){At.set(Ae,wn(fe,f,T,Ae,l,mt));});var de=Ht?kt?ah:oh:kt?Gr:gr,xe=Vt?e:de(l);return nn(xe||l,function(fe,Ae){xe&&(Ae=fe,fe=l[Ae]),na(At,Ae,wn(fe,f,T,Ae,l,mt));}),At;}function $T(l){var f=gr(l);return function(T){return _0(T,l,f);};}function _0(l,f,T){var W=T.length;if(l==null)return!W;for(l=Xe(l);W--;){var it=T[W],mt=f[it],At=l[it];if(At===e&&!(it in l)||!mt(At))return!1;}return!0;}function tv(l,f,T){if(typeof l!="function")throw new mn(o);return ua(function(){l.apply(e,T);},f);}function ia(l,f,T,W){var it=-1,mt=yl,At=!0,Ot=l.length,kt=[],Ht=f.length;if(!Ot)return kt;T&&(f=Je(f,sn(T))),W?(mt=bf,At=!1):f.length>=i&&(mt=Qo,At=!1,f=new fs(f));t:for(;++it<Ot;){var Vt=l[it],qt=T==null?Vt:T(Vt);if(Vt=W||Vt!==0?Vt:0,At&&qt===qt){for(var ie=Ht;ie--;)if(f[ie]===qt)continue t;kt.push(Vt);}else mt(f,qt,W)||kt.push(Vt);}return kt;}var Ri=bv(Gn),ev=bv(jf,!0);function YT(l,f){var T=!0;return Ri(l,function(W,it,mt){return T=!!f(W,it,mt),T;}),T;}function kl(l,f,T){for(var W=-1,it=l.length;++W<it;){var mt=l[W],At=f(mt);if(At!=null&&(Ot===e?At===At&&!an(At):T(At,Ot)))var Ot=At,kt=mt;}return kt;}function jT(l,f,T,W){var it=l.length;for(T=Ie(T),T<0&&(T=-T>it?0:it+T),W=W===e||W>it?it:Ie(W),W<0&&(W+=it),W=T>W?0:yg(W);T<W;)l[T++]=f;return l;}function rv(l,f){var T=[];return Ri(l,function(W,it,mt){f(W,it,mt)&&T.push(W);}),T;}function Tr(l,f,T,W,it){var mt=-1,At=l.length;for(T||(T=Ox),it||(it=[]);++mt<At;){var Ot=l[mt];f>0&&T(Ot)?f>1?Tr(Ot,f-1,T,W,it):Li(it,Ot):W||(it[it.length]=Ot);}return it;}var Yf=Mv(),nv=Mv(!0);function Gn(l,f){return l&&Yf(l,f,gr);}function jf(l,f){return l&&nv(l,f,gr);}function Fl(l,f){return Ei(f,function(T){return si(l[T]);});}function ds(l,f){f=Bi(f,l);for(var T=0,W=f.length;l!=null&&T<W;)l=l[Ln(f[T++])];return T&&T==W?l:e;}function iv(l,f,T){var W=f(l);return ge(l)?W:Li(W,T(l));}function kr(l){return l==null?l===e?gt:g:cs&&cs in Xe(l)?Px(l):Wx(l);}function Xf(l,f){return l>f;}function XT(l,f){return l!=null&&Ue.call(l,f);}function GT(l,f){return l!=null&&f in Xe(l);}function HT(l,f,T){return l>=Er(f,T)&&l<hr(f,T);}function Gf(l,f,T){for(var W=T?bf:yl,it=l[0].length,mt=l.length,At=mt,Ot=zt(mt),kt=1/0,Ht=[];At--;){var Vt=l[At];At&&f&&(Vt=Je(Vt,sn(f))),kt=Er(Vt.length,kt),Ot[At]=!T&&(f||it>=120&&Vt.length>=120)?new fs(At&&Vt):e;}Vt=l[0];var qt=-1,ie=Ot[0];t:for(;++qt<it&&Ht.length<kt;){var ce=Vt[qt],de=f?f(ce):ce;if(ce=T||ce!==0?ce:0,!(ie?Qo(ie,de):W(Ht,de,T))){for(At=mt;--At;){var xe=Ot[At];if(!(xe?Qo(xe,de):W(l[At],de,T)))continue t;}ie&&ie.push(de),Ht.push(ce);}}return Ht;}function VT(l,f,T,W){return Gn(l,function(it,mt,At){f(W,T(it),mt,At);}),W;}function sa(l,f,T){f=Bi(f,l),l=Gv(l,f);var W=l==null?l:l[Ln(In(f))];return W==null?e:rn(W,l,T);}function sv(l){return rr(l)&&kr(l)==at;}function ZT(l){return rr(l)&&kr(l)==Lt;}function qT(l){return rr(l)&&kr(l)==Dt;}function oa(l,f,T,W,it){return l===f?!0:l==null||f==null||!rr(l)&&!rr(f)?l!==l&&f!==f:KT(l,f,T,W,oa,it);}function KT(l,f,T,W,it,mt){var At=ge(l),Ot=ge(f),kt=At?ht:Lr(l),Ht=Ot?ht:Lr(f);kt=kt==at?I:kt,Ht=Ht==at?I:Ht;var Vt=kt==I,qt=Ht==I,ie=kt==Ht;if(ie&&Fi(l)){if(!Fi(f))return!1;At=!0,Vt=!1;}if(ie&&!Vt)return mt||(mt=new En()),At||lo(l)?Wv(l,f,T,W,it,mt):xx(l,f,kt,T,W,it,mt);if(!(T&E)){var ce=Vt&&Ue.call(l,"__wrapped__"),de=qt&&Ue.call(f,"__wrapped__");if(ce||de){var xe=ce?l.value():l,fe=de?f.value():f;return mt||(mt=new En()),it(xe,fe,T,W,mt);}}return ie?(mt||(mt=new En()),Cx(l,f,T,W,it,mt)):!1;}function QT(l){return rr(l)&&Lr(l)==V;}function Hf(l,f,T,W){var it=T.length,mt=it,At=!W;if(l==null)return!mt;for(l=Xe(l);it--;){var Ot=T[it];if(At&&Ot[2]?Ot[1]!==l[Ot[0]]:!(Ot[0]in l))return!1;}for(;++it<mt;){Ot=T[it];var kt=Ot[0],Ht=l[kt],Vt=Ot[1];if(At&&Ot[2]){if(Ht===e&&!(kt in l))return!1;}else{var qt=new En();if(W)var ie=W(Ht,Vt,kt,l,f,qt);if(!(ie===e?oa(Vt,Ht,E|L,W,qt):ie))return!1;}}return!0;}function ov(l){if(!er(l)||Rx(l))return!1;var f=si(l)?QI:ff;return f.test(vs(l));}function JT(l){return rr(l)&&kr(l)==st;}function _T(l){return rr(l)&&Lr(l)==ft;}function tx(l){return rr(l)&&tc(l.length)&&!!qe[kr(l)];}function av(l){return typeof l=="function"?l:l==null?Hr:_typeof(l)=="object"?ge(l)?uv(l[0],l[1]):cv(l):Lg(l);}function Vf(l){if(!ca(l))return nT(l);var f=[];for(var T in Xe(l))Ue.call(l,T)&&T!="constructor"&&f.push(T);return f;}function ex(l){if(!er(l))return Fx(l);var f=ca(l),T=[];for(var W in l)W=="constructor"&&(f||!Ue.call(l,W))||T.push(W);return T;}function Zf(l,f){return l<f;}function lv(l,f){var T=-1,W=Xr(l)?zt(l.length):[];return Ri(l,function(it,mt,At){W[++T]=f(it,mt,At);}),W;}function cv(l){var f=ch(l);return f.length==1&&f[0][2]?jv(f[0][0],f[0][1]):function(T){return T===l||Hf(T,l,f);};}function uv(l,f){return fh(l)&&Yv(f)?jv(Ln(l),f):function(T){var W=Th(T,l);return W===e&&W===f?xh(T,l):oa(f,W,E|L);};}function Wl(l,f,T,W,it){l!==f&&Yf(f,function(mt,At){if(it||(it=new En()),er(mt))rx(l,f,At,T,Wl,W,it);else{var Ot=W?W(dh(l,At),mt,At+"",l,f,it):e;Ot===e&&(Ot=mt),zf(l,At,Ot);}},Gr);}function rx(l,f,T,W,it,mt,At){var Ot=dh(l,T),kt=dh(f,T),Ht=At.get(kt);if(Ht){zf(l,T,Ht);return;}var Vt=mt?mt(Ot,kt,T+"",l,f,At):e,qt=Vt===e;if(qt){var ie=ge(kt),ce=!ie&&Fi(kt),de=!ie&&!ce&&lo(kt);Vt=kt,ie||ce||de?ge(Ot)?Vt=Ot:nr(Ot)?Vt=jr(Ot):ce?(qt=!1,Vt=Tv(kt,!0)):de?(qt=!1,Vt=xv(kt,!0)):Vt=[]:fa(kt)||gs(kt)?(Vt=Ot,gs(Ot)?Vt=wg(Ot):(!er(Ot)||si(Ot))&&(Vt=$v(kt))):qt=!1;}qt&&(At.set(kt,Vt),it(Vt,kt,W,mt,At),At.delete(kt)),zf(l,T,Vt);}function fv(l,f){var T=l.length;if(T)return f+=f<0?T:0,ii(f,T)?l[f]:e;}function hv(l,f,T){f.length?f=Je(f,function(mt){return ge(mt)?function(At){return ds(At,mt.length===1?mt[0]:mt);}:mt;}):f=[Hr];var W=-1;f=Je(f,sn(he()));var it=lv(l,function(mt,At,Ot){var kt=Je(f,function(Ht){return Ht(mt);});return{criteria:kt,index:++W,value:mt};});return EI(it,function(mt,At){return vx(mt,At,T);});}function nx(l,f){return dv(l,f,function(T,W){return xh(l,W);});}function dv(l,f,T){for(var W=-1,it=f.length,mt={};++W<it;){var At=f[W],Ot=ds(l,At);T(Ot,At)&&aa(mt,Bi(At,l),Ot);}return mt;}function ix(l){return function(f){return ds(f,l);};}function qf(l,f,T,W){var it=W?MI:Qs,mt=-1,At=f.length,Ot=l;for(l===f&&(f=jr(f)),T&&(Ot=Je(l,sn(T)));++mt<At;)for(var kt=0,Ht=f[mt],Vt=T?T(Ht):Ht;(kt=it(Ot,Vt,kt,W))>-1;)Ot!==l&&Ml.call(Ot,kt,1),Ml.call(l,kt,1);return l;}function pv(l,f){for(var T=l?f.length:0,W=T-1;T--;){var it=f[T];if(T==W||it!==mt){var mt=it;ii(it)?Ml.call(l,it,1):_f(l,it);}}return l;}function Kf(l,f){return l+Ol(Z0()*(f-l+1));}function sx(l,f,T,W){for(var it=-1,mt=hr(Ll((f-l)/(T||1)),0),At=zt(mt);mt--;)At[W?mt:++it]=l,l+=T;return At;}function Qf(l,f){var T="";if(!l||f<1||f>lt)return T;do f%2&&(T+=l),f=Ol(f/2),f&&(l+=l);while(f);return T;}function Ce(l,f){return ph(Xv(l,f,Hr),l+"");}function ox(l){return Q0(co(l));}function ax(l,f){var T=co(l);return Zl(T,hs(f,0,T.length));}function aa(l,f,T,W){if(!er(l))return l;f=Bi(f,l);for(var it=-1,mt=f.length,At=mt-1,Ot=l;Ot!=null&&++it<mt;){var kt=Ln(f[it]),Ht=T;if(kt==="__proto__"||kt==="constructor"||kt==="prototype")return l;if(it!=At){var Vt=Ot[kt];Ht=W?W(Vt,kt,Ot):e,Ht===e&&(Ht=er(Vt)?Vt:ii(f[it+1])?[]:{});}na(Ot,kt,Ht),Ot=Ot[kt];}return l;}var vv=Dl?function(l,f){return Dl.set(l,f),l;}:Hr,lx=El?function(l,f){return El(l,"toString",{configurable:!0,enumerable:!1,value:Ph(f),writable:!0});}:Hr;function cx(l){return Zl(co(l));}function Sn(l,f,T){var W=-1,it=l.length;f<0&&(f=-f>it?0:it+f),T=T>it?it:T,T<0&&(T+=it),it=f>T?0:T-f>>>0,f>>>=0;for(var mt=zt(it);++W<it;)mt[W]=l[W+f];return mt;}function ux(l,f){var T;return Ri(l,function(W,it,mt){return T=f(W,it,mt),!T;}),!!T;}function Ul(l,f,T){var W=0,it=l==null?W:l.length;if(typeof f=="number"&&f===f&&it<=_){for(;W<it;){var mt=W+it>>>1,At=l[mt];At!==null&&!an(At)&&(T?At<=f:At<f)?W=mt+1:it=mt;}return it;}return Jf(l,f,Hr,T);}function Jf(l,f,T,W){var it=0,mt=l==null?0:l.length;if(mt===0)return 0;f=T(f);for(var At=f!==f,Ot=f===null,kt=an(f),Ht=f===e;it<mt;){var Vt=Ol((it+mt)/2),qt=T(l[Vt]),ie=qt!==e,ce=qt===null,de=qt===qt,xe=an(qt);if(At)var fe=W||de;else Ht?fe=de&&(W||ie):Ot?fe=de&&ie&&(W||!ce):kt?fe=de&&ie&&!ce&&(W||!xe):ce||xe?fe=!1:fe=W?qt<=f:qt<f;fe?it=Vt+1:mt=Vt;}return Er(mt,U);}function gv(l,f){for(var T=-1,W=l.length,it=0,mt=[];++T<W;){var At=l[T],Ot=f?f(At):At;if(!T||!On(Ot,kt)){var kt=Ot;mt[it++]=At===0?0:At;}}return mt;}function mv(l){return typeof l=="number"?l:an(l)?Tt:+l;}function on(l){if(typeof l=="string")return l;if(ge(l))return Je(l,on)+"";if(an(l))return q0?q0.call(l):"";var f=l+"";return f=="0"&&1/l==-q?"-0":f;}function Ni(l,f,T){var W=-1,it=yl,mt=l.length,At=!0,Ot=[],kt=Ot;if(T)At=!1,it=bf;else if(mt>=i){var Ht=f?null:Ix(l);if(Ht)return Sl(Ht);At=!1,it=Qo,kt=new fs();}else kt=f?[]:Ot;t:for(;++W<mt;){var Vt=l[W],qt=f?f(Vt):Vt;if(Vt=T||Vt!==0?Vt:0,At&&qt===qt){for(var ie=kt.length;ie--;)if(kt[ie]===qt)continue t;f&&kt.push(qt),Ot.push(Vt);}else it(kt,qt,T)||(kt!==Ot&&kt.push(qt),Ot.push(Vt));}return Ot;}function _f(l,f){f=Bi(f,l);var T=-1,W=f.length;if(!W)return!0;for(;++T<W;){var it=Ln(f[T]);if(it==="__proto__"&&!Ue.call(l,"__proto__")||(it==="constructor"||it==="prototype")&&T<W-1)return!1;}var mt=Gv(l,f);return mt==null||delete mt[Ln(In(f))];}function yv(l,f,T,W){return aa(l,f,T(ds(l,f)),W);}function zl(l,f,T,W){for(var it=l.length,mt=W?it:-1;(W?mt--:++mt<it)&&f(l[mt],mt,l););return T?Sn(l,W?0:mt,W?mt+1:it):Sn(l,W?mt+1:0,W?it:mt);}function wv(l,f){var T=l;return T instanceof Me&&(T=T.value()),Mf(f,function(W,it){return it.func.apply(it.thisArg,Li([W],it.args));},T);}function th(l,f,T){var W=l.length;if(W<2)return W?Ni(l[0]):[];for(var it=-1,mt=zt(W);++it<W;)for(var At=l[it],Ot=-1;++Ot<W;)Ot!=it&&(mt[it]=ia(mt[it]||At,l[Ot],f,T));return Ni(Tr(mt,1),f,T);}function Sv(l,f,T){for(var W=-1,it=l.length,mt=f.length,At={};++W<it;){var Ot=W<mt?f[W]:e;T(At,l[W],Ot);}return At;}function eh(l){return nr(l)?l:[];}function rh(l){return typeof l=="function"?l:Hr;}function Bi(l,f){return ge(l)?l:fh(l,f)?[l]:qv(ze(l));}var fx=Ce;function ki(l,f,T){var W=l.length;return T=T===e?W:T,!f&&T>=W?l:Sn(l,f,T);}var Iv=JI||function(l){return Ir.clearTimeout(l);};function Tv(l,f){if(f)return l.slice();var T=l.length,W=j0?j0(T):new l.constructor(T);return l.copy(W),W;}function nh(l){var f=new l.constructor(l.byteLength);return new Al(f).set(new Al(l)),f;}function hx(l,f){var T=f?nh(l.buffer):l.buffer;return new l.constructor(T,l.byteOffset,l.byteLength);}function dx(l){var f=new l.constructor(l.source,An.exec(l));return f.lastIndex=l.lastIndex,f;}function px(l){return ra?Xe(ra.call(l)):{};}function xv(l,f){var T=f?nh(l.buffer):l.buffer;return new l.constructor(T,l.byteOffset,l.length);}function Cv(l,f){if(l!==f){var T=l!==e,W=l===null,it=l===l,mt=an(l),At=f!==e,Ot=f===null,kt=f===f,Ht=an(f);if(!Ot&&!Ht&&!mt&&l>f||mt&&At&&kt&&!Ot&&!Ht||W&&At&&kt||!T&&kt||!it)return 1;if(!W&&!mt&&!Ht&&l<f||Ht&&T&&it&&!W&&!mt||Ot&&T&&it||!At&&it||!kt)return-1;}return 0;}function vx(l,f,T){for(var W=-1,it=l.criteria,mt=f.criteria,At=it.length,Ot=T.length;++W<At;){var kt=Cv(it[W],mt[W]);if(kt){if(W>=Ot)return kt;var Ht=T[W];return kt*(Ht=="desc"?-1:1);}}return l.index-f.index;}function Pv(l,f,T,W){for(var it=-1,mt=l.length,At=T.length,Ot=-1,kt=f.length,Ht=hr(mt-At,0),Vt=zt(kt+Ht),qt=!W;++Ot<kt;)Vt[Ot]=f[Ot];for(;++it<At;)(qt||it<mt)&&(Vt[T[it]]=l[it]);for(;Ht--;)Vt[Ot++]=l[it++];return Vt;}function Av(l,f,T,W){for(var it=-1,mt=l.length,At=-1,Ot=T.length,kt=-1,Ht=f.length,Vt=hr(mt-Ot,0),qt=zt(Vt+Ht),ie=!W;++it<Vt;)qt[it]=l[it];for(var ce=it;++kt<Ht;)qt[ce+kt]=f[kt];for(;++At<Ot;)(ie||it<mt)&&(qt[ce+T[At]]=l[it++]);return qt;}function jr(l,f){var T=-1,W=l.length;for(f||(f=zt(W));++T<W;)f[T]=l[T];return f;}function Hn(l,f,T,W){var it=!T;T||(T={});for(var mt=-1,At=f.length;++mt<At;){var Ot=f[mt],kt=W?W(T[Ot],l[Ot],Ot,T,l):e;kt===e&&(kt=l[Ot]),it?Xn(T,Ot,kt):na(T,Ot,kt);}return T;}function gx(l,f){return Hn(l,uh(l),f);}function mx(l,f){return Hn(l,Uv(l),f);}function $l(l,f){return function(T,W){var it=ge(T)?TI:UT,mt=f?f():{};return it(T,l,he(W,2),mt);};}function so(l){return Ce(function(f,T){var W=-1,it=T.length,mt=it>1?T[it-1]:e,At=it>2?T[2]:e;for(mt=l.length>3&&typeof mt=="function"?(it--,mt):e,At&&Fr(T[0],T[1],At)&&(mt=it<3?e:mt,it=1),f=Xe(f);++W<it;){var Ot=T[W];Ot&&l(f,Ot,W,mt);}return f;});}function bv(l,f){return function(T,W){if(T==null)return T;if(!Xr(T))return l(T,W);for(var it=T.length,mt=f?it:-1,At=Xe(T);(f?mt--:++mt<it)&&W(At[mt],mt,At)!==!1;);return T;};}function Mv(l){return function(f,T,W){for(var it=-1,mt=Xe(f),At=W(f),Ot=At.length;Ot--;){var kt=At[l?Ot:++it];if(T(mt[kt],kt,mt)===!1)break;}return f;};}function yx(l,f,T){var W=f&G,it=la(l);function mt(){var At=this&&this!==Ir&&this instanceof mt?it:l;return At.apply(W?T:this,arguments);}return mt;}function Ev(l){return function(f){f=ze(f);var T=Js(f)?Mn(f):e,W=T?T[0]:f.charAt(0),it=T?ki(T,1).join(""):f.slice(1);return W[l]()+it;};}function oo(l){return function(f){return Mf(Mg(bg(f).replace(lI,"")),l,"");};}function la(l){return function(){var f=arguments;switch(f.length){case 0:return new l();case 1:return new l(f[0]);case 2:return new l(f[0],f[1]);case 3:return new l(f[0],f[1],f[2]);case 4:return new l(f[0],f[1],f[2],f[3]);case 5:return new l(f[0],f[1],f[2],f[3],f[4]);case 6:return new l(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new l(f[0],f[1],f[2],f[3],f[4],f[5],f[6]);}var T=io(l.prototype),W=l.apply(T,f);return er(W)?W:T;};}function wx(l,f,T){var W=la(l);function it(){for(var mt=arguments.length,At=zt(mt),Ot=mt,kt=ao(it);Ot--;)At[Ot]=arguments[Ot];var Ht=mt<3&&At[0]!==kt&&At[mt-1]!==kt?[]:Oi(At,kt);if(mt-=Ht.length,mt<T)return Nv(l,f,Yl,it.placeholder,e,At,Ht,e,e,T-mt);var Vt=this&&this!==Ir&&this instanceof it?W:l;return rn(Vt,this,At);}return it;}function Lv(l){return function(f,T,W){var it=Xe(f);if(!Xr(f)){var mt=he(T,3);f=gr(f),T=function T(Ot){return mt(it[Ot],Ot,it);};}var At=l(f,T,W);return At>-1?it[mt?f[At]:At]:e;};}function Ov(l){return ni(function(f){var T=f.length,W=T,it=yn.prototype.thru;for(l&&f.reverse();W--;){var mt=f[W];if(typeof mt!="function")throw new mn(o);if(it&&!At&&Hl(mt)=="wrapper")var At=new yn([],!0);}for(W=At?W:T;++W<T;){mt=f[W];var Ot=Hl(mt),kt=Ot=="wrapper"?lh(mt):e;kt&&hh(kt[0])&&kt[1]==(P|x|S|X)&&!kt[4].length&&kt[9]==1?At=At[Hl(kt[0])].apply(At,kt[3]):At=mt.length==1&&hh(mt)?At[Ot]():At.thru(mt);}return function(){var Ht=arguments,Vt=Ht[0];if(At&&Ht.length==1&&ge(Vt))return At.plant(Vt).value();for(var qt=0,ie=T?f[qt].apply(this,Ht):Vt;++qt<T;)ie=f[qt].call(this,ie);return ie;};});}function Yl(l,f,T,W,it,mt,At,Ot,kt,Ht){var Vt=f&P,qt=f&G,ie=f&z,ce=f&(x|y),de=f&$,xe=ie?e:la(l);function fe(){for(var Ae=arguments.length,Ee=zt(Ae),ln=Ae;ln--;)Ee[ln]=arguments[ln];if(ce)var Wr=ao(fe),cn=OI(Ee,Wr);if(W&&(Ee=Pv(Ee,W,it,ce)),mt&&(Ee=Av(Ee,mt,At,ce)),Ae-=cn,ce&&Ae<Ht){var ir=Oi(Ee,Wr);return Nv(l,f,Yl,fe.placeholder,T,Ee,ir,Ot,kt,Ht-Ae);}var Dn=qt?T:this,ai=ie?Dn[l]:l;return Ae=Ee.length,Ot?Ee=Ux(Ee,Ot):de&&Ae>1&&Ee.reverse(),Vt&&kt<Ae&&(Ee.length=kt),this&&this!==Ir&&this instanceof fe&&(ai=xe||la(ai)),ai.apply(Dn,Ee);}return fe;}function Dv(l,f){return function(T,W){return VT(T,l,f(W),{});};}function jl(l,f){return function(T,W){var it;if(T===e&&W===e)return f;if(T!==e&&(it=T),W!==e){if(it===e)return W;typeof T=="string"||typeof W=="string"?(T=on(T),W=on(W)):(T=mv(T),W=mv(W)),it=l(T,W);}return it;};}function ih(l){return ni(function(f){return f=Je(f,sn(he())),Ce(function(T){var W=this;return l(f,function(it){return rn(it,W,T);});});});}function Xl(l,f){f=f===e?" ":on(f);var T=f.length;if(T<2)return T?Qf(f,l):f;var W=Qf(f,Ll(l/_s(f)));return Js(f)?ki(Mn(W),0,l).join(""):W.slice(0,l);}function Sx(l,f,T,W){var it=f&G,mt=la(l);function At(){for(var Ot=-1,kt=arguments.length,Ht=-1,Vt=W.length,qt=zt(Vt+kt),ie=this&&this!==Ir&&this instanceof At?mt:l;++Ht<Vt;)qt[Ht]=W[Ht];for(;kt--;)qt[Ht++]=arguments[++Ot];return rn(ie,it?T:this,qt);}return At;}function Rv(l){return function(f,T,W){return W&&typeof W!="number"&&Fr(f,T,W)&&(T=W=e),f=oi(f),T===e?(T=f,f=0):T=oi(T),W=W===e?f<T?1:-1:oi(W),sx(f,T,W,l);};}function Gl(l){return function(f,T){return typeof f=="string"&&typeof T=="string"||(f=Tn(f),T=Tn(T)),l(f,T);};}function Nv(l,f,T,W,it,mt,At,Ot,kt,Ht){var Vt=f&x,qt=Vt?At:e,ie=Vt?e:At,ce=Vt?mt:e,de=Vt?e:mt;f|=Vt?S:C,f&=~(Vt?C:S),f&et||(f&=-4);var xe=[l,f,it,ce,qt,de,ie,Ot,kt,Ht],fe=T.apply(e,xe);return hh(l)&&Hv(fe,xe),fe.placeholder=W,Vv(fe,l,f);}function sh(l){var f=fr[l];return function(T,W){if(T=Tn(T),W=W==null?0:Er(Ie(W),292),W&&V0(T)){var it=(ze(T)+"e").split("e"),mt=f(it[0]+"e"+(+it[1]+W));return it=(ze(mt)+"e").split("e"),+(it[0]+"e"+(+it[1]-W));}return f(T);};}var Ix=ro&&1/Sl(new ro([,-0]))[1]==q?function(l){return new ro(l);}:Mh;function Bv(l){return function(f){var T=Lr(f);return T==V?Bf(f):T==ft?WI(f):LI(f,l(f));};}function ri(l,f,T,W,it,mt,At,Ot){var kt=f&z;if(!kt&&typeof l!="function")throw new mn(o);var Ht=W?W.length:0;if(Ht||(f&=-97,W=it=e),At=At===e?At:hr(Ie(At),0),Ot=Ot===e?Ot:Ie(Ot),Ht-=it?it.length:0,f&C){var Vt=W,qt=it;W=it=e;}var ie=kt?e:lh(l),ce=[l,f,T,W,it,Vt,qt,mt,At,Ot];if(ie&&kx(ce,ie),l=ce[0],f=ce[1],T=ce[2],W=ce[3],it=ce[4],Ot=ce[9]=ce[9]===e?kt?0:l.length:hr(ce[9]-Ht,0),!Ot&&f&(x|y)&&(f&=-25),!f||f==G)var de=yx(l,f,T);else f==x||f==y?de=wx(l,f,Ot):(f==S||f==(G|S))&&!it.length?de=Sx(l,f,T,W):de=Yl.apply(e,ce);var xe=ie?vv:Hv;return Vv(xe(de,ce),l,f);}function kv(l,f,T,W){return l===e||On(l,eo[T])&&!Ue.call(W,T)?f:l;}function Fv(l,f,T,W,it,mt){return er(l)&&er(f)&&(mt.set(f,l),Wl(l,f,e,Fv,mt),mt.delete(f)),l;}function Tx(l){return fa(l)?e:l;}function Wv(l,f,T,W,it,mt){var At=T&E,Ot=l.length,kt=f.length;if(Ot!=kt&&!(At&&kt>Ot))return!1;var Ht=mt.get(l),Vt=mt.get(f);if(Ht&&Vt)return Ht==f&&Vt==l;var qt=-1,ie=!0,ce=T&L?new fs():e;for(mt.set(l,f),mt.set(f,l);++qt<Ot;){var de=l[qt],xe=f[qt];if(W)var fe=At?W(xe,de,qt,f,l,mt):W(de,xe,qt,l,f,mt);if(fe!==e){if(fe)continue;ie=!1;break;}if(ce){if(!Ef(f,function(Ae,Ee){if(!Qo(ce,Ee)&&(de===Ae||it(de,Ae,T,W,mt)))return ce.push(Ee);})){ie=!1;break;}}else if(!(de===xe||it(de,xe,T,W,mt))){ie=!1;break;}}return mt.delete(l),mt.delete(f),ie;}function xx(l,f,T,W,it,mt,At){switch(T){case Rt:if(l.byteLength!=f.byteLength||l.byteOffset!=f.byteOffset)return!1;l=l.buffer,f=f.buffer;case Lt:return!(l.byteLength!=f.byteLength||!mt(new Al(l),new Al(f)));case Et:case Dt:case tt:return On(+l,+f);case N:return l.name==f.name&&l.message==f.message;case st:case dt:return l==f+"";case V:var Ot=Bf;case ft:var kt=W&E;if(Ot||(Ot=Sl),l.size!=f.size&&!kt)return!1;var Ht=At.get(l);if(Ht)return Ht==f;W|=L,At.set(l,f);var Vt=Wv(Ot(l),Ot(f),W,it,mt,At);return At.delete(l),Vt;case ot:if(ra)return ra.call(l)==ra.call(f);}return!1;}function Cx(l,f,T,W,it,mt){var At=T&E,Ot=oh(l),kt=Ot.length,Ht=oh(f),Vt=Ht.length;if(kt!=Vt&&!At)return!1;for(var qt=kt;qt--;){var ie=Ot[qt];if(!(At?ie in f:Ue.call(f,ie)))return!1;}var ce=mt.get(l),de=mt.get(f);if(ce&&de)return ce==f&&de==l;var xe=!0;mt.set(l,f),mt.set(f,l);for(var fe=At;++qt<kt;){ie=Ot[qt];var Ae=l[ie],Ee=f[ie];if(W)var ln=At?W(Ee,Ae,ie,f,l,mt):W(Ae,Ee,ie,l,f,mt);if(!(ln===e?Ae===Ee||it(Ae,Ee,T,W,mt):ln)){xe=!1;break;}fe||(fe=ie=="constructor");}if(xe&&!fe){var Wr=l.constructor,cn=f.constructor;Wr!=cn&&"constructor"in l&&"constructor"in f&&!(typeof Wr=="function"&&Wr instanceof Wr&&typeof cn=="function"&&cn instanceof cn)&&(xe=!1);}return mt.delete(l),mt.delete(f),xe;}function ni(l){return ph(Xv(l,e,_v),l+"");}function oh(l){return iv(l,gr,uh);}function ah(l){return iv(l,Gr,Uv);}var lh=Dl?function(l){return Dl.get(l);}:Mh;function Hl(l){for(var f=l.name+"",T=no[f],W=Ue.call(no,f)?T.length:0;W--;){var it=T[W],mt=it.func;if(mt==null||mt==l)return it.name;}return f;}function ao(l){var f=Ue.call(vt,"placeholder")?vt:l;return f.placeholder;}function he(){var l=vt.iteratee||Ah;return l=l===Ah?av:l,arguments.length?l(arguments[0],arguments[1]):l;}function Vl(l,f){var T=l.__data__;return Dx(f)?T[typeof f=="string"?"string":"hash"]:T.map;}function ch(l){for(var f=gr(l),T=f.length;T--;){var W=f[T],it=l[W];f[T]=[W,it,Yv(it)];}return f;}function ps(l,f){var T=BI(l,f);return ov(T)?T:e;}function Px(l){var f=Ue.call(l,cs),T=l[cs];try{l[cs]=e;var W=!0;}catch(_unused22){}var it=Cl.call(l);return W&&(f?l[cs]=T:delete l[cs]),it;}var uh=Ff?function(l){return l==null?[]:(l=Xe(l),Ei(Ff(l),function(f){return G0.call(l,f);}));}:Eh,Uv=Ff?function(l){for(var f=[];l;)Li(f,uh(l)),l=bl(l);return f;}:Eh,Lr=kr;(Wf&&Lr(new Wf(new ArrayBuffer(1)))!=Rt||_o&&Lr(new _o())!=V||Uf&&Lr(Uf.resolve())!=B||ro&&Lr(new ro())!=ft||ta&&Lr(new ta())!=St)&&(Lr=function Lr(l){var f=kr(l),T=f==I?l.constructor:e,W=T?vs(T):"";if(W)switch(W){case aT:return Rt;case lT:return V;case cT:return B;case uT:return ft;case fT:return St;}return f;});function Ax(l,f,T){for(var W=-1,it=T.length;++W<it;){var mt=T[W],At=mt.size;switch(mt.type){case"drop":l+=At;break;case"dropRight":f-=At;break;case"take":f=Er(f,l+At);break;case"takeRight":l=hr(l,f-At);break;}}return{start:l,end:f};}function bx(l){var f=l.match(Gs);return f?f[1].split(Hs):[];}function zv(l,f,T){f=Bi(f,l);for(var W=-1,it=f.length,mt=!1;++W<it;){var At=Ln(f[W]);if(!(mt=l!=null&&T(l,At)))break;l=l[At];}return mt||++W!=it?mt:(it=l==null?0:l.length,!!it&&tc(it)&&ii(At,it)&&(ge(l)||gs(l)));}function Mx(l){var f=l.length,T=new l.constructor(f);return f&&typeof l[0]=="string"&&Ue.call(l,"index")&&(T.index=l.index,T.input=l.input),T;}function $v(l){return typeof l.constructor=="function"&&!ca(l)?io(bl(l)):{};}function Ex(l,f,T){var W=l.constructor;switch(f){case Lt:return nh(l);case Et:case Dt:return new W(+l);case Rt:return hx(l,T);case Nt:case $t:case Ut:case Ft:case Qt:case ee:case re:case se:case oe:return xv(l,T);case V:return new W();case tt:case dt:return new W(l);case st:return dx(l);case ft:return new W();case ot:return px(l);}}function Lx(l,f){var T=f.length;if(!T)return l;var W=T-1;return f[W]=(T>1?"& ":"")+f[W],f=f.join(T>2?", ":" "),l.replace(Ho,"{\n/* [wrapped with "+f+"] */\n");}function Ox(l){return ge(l)||gs(l)||!!(H0&&l&&l[H0]);}function ii(l,f){var T=_typeof(l);return f=f!==null&&f!==void 0?f:lt,!!f&&(T=="number"||T!="symbol"&&df.test(l))&&l>-1&&l%1==0&&l<f;}function Fr(l,f,T){if(!er(T))return!1;var W=_typeof(f);return(W=="number"?Xr(T)&&ii(f,T.length):W=="string"&&f in T)?On(T[f],l):!1;}function fh(l,f){if(ge(l))return!1;var T=_typeof(l);return T=="number"||T=="symbol"||T=="boolean"||l==null||an(l)?!0:en.test(l)||!tn.test(l)||f!=null&&l in Xe(f);}function Dx(l){var f=_typeof(l);return f=="string"||f=="number"||f=="symbol"||f=="boolean"?l!=="__proto__":l===null;}function hh(l){var f=Hl(l),T=vt[f];if(typeof T!="function"||!(f in Me.prototype))return!1;if(l===T)return!0;var W=lh(T);return!!W&&l===W[0];}function Rx(l){return!!Y0&&Y0 in l;}var Nx=Tl?si:Lh;function ca(l){var f=l&&l.constructor,T=typeof f=="function"&&f.prototype||eo;return l===T;}function Yv(l){return l===l&&!er(l);}function jv(l,f){return function(T){return T==null?!1:T[l]===f&&(f!==e||l in Xe(T));};}function Bx(l){var f=Jl(l,function(W){return T.size===v&&T.clear(),W;}),T=f.cache;return f;}function kx(l,f){var T=l[1],W=f[1],it=T|W,mt=it<(G|z|P),At=W==P&&T==x||W==P&&T==X&&l[7].length<=f[8]||W==(P|X)&&f[7].length<=f[8]&&T==x;if(!(mt||At))return l;W&G&&(l[2]=f[2],it|=T&G?0:et);var Ot=f[3];if(Ot){var kt=l[3];l[3]=kt?Pv(kt,Ot,f[4]):Ot,l[4]=kt?Oi(l[3],p):f[4];}return Ot=f[5],Ot&&(kt=l[5],l[5]=kt?Av(kt,Ot,f[6]):Ot,l[6]=kt?Oi(l[5],p):f[6]),Ot=f[7],Ot&&(l[7]=Ot),W&P&&(l[8]=l[8]==null?f[8]:Er(l[8],f[8])),l[9]==null&&(l[9]=f[9]),l[0]=f[0],l[1]=it,l;}function Fx(l){var f=[];if(l!=null)for(var T in Xe(l))f.push(T);return f;}function Wx(l){return Cl.call(l);}function Xv(l,f,T){return f=hr(f===e?l.length-1:f,0),function(){for(var W=arguments,it=-1,mt=hr(W.length-f,0),At=zt(mt);++it<mt;)At[it]=W[f+it];it=-1;for(var Ot=zt(f+1);++it<f;)Ot[it]=W[it];return Ot[f]=T(At),rn(l,this,Ot);};}function Gv(l,f){return f.length<2?l:ds(l,Sn(f,0,-1));}function Ux(l,f){for(var T=l.length,W=Er(f.length,T),it=jr(l);W--;){var mt=f[W];l[W]=ii(mt,T)?it[mt]:e;}return l;}function dh(l,f){if(!(f==="constructor"&&typeof l[f]=="function")&&f!="__proto__")return l[f];}var Hv=Zv(vv),ua=tT||function(l,f){return Ir.setTimeout(l,f);},ph=Zv(lx);function Vv(l,f,T){var W=f+"";return ph(l,Lx(W,zx(bx(W),T)));}function Zv(l){var f=0,T=0;return function(){var W=iT(),it=ct-(W-T);if(T=W,it>0){if(++f>=nt)return arguments[0];}else f=0;return l.apply(e,arguments);};}function Zl(l,f){var T=-1,W=l.length,it=W-1;for(f=f===e?W:f;++T<f;){var mt=Kf(T,it),At=l[mt];l[mt]=l[T],l[T]=At;}return l.length=f,l;}var qv=Bx(function(l){var f=[];return l.charCodeAt(0)===46&&f.push(""),l.replace(Yn,function(T,W,it,mt){f.push(it?mt.replace(Vo,"$1"):W||T);}),f;});function Ln(l){if(typeof l=="string"||an(l))return l;var f=l+"";return f=="0"&&1/l==-q?"-0":f;}function vs(l){if(l!=null){try{return xl.call(l);}catch(_unused23){}try{return l+"";}catch(_unused24){}}return"";}function zx(l,f){return nn(H,function(T){var W="_."+T[0];f&T[1]&&!yl(l,W)&&l.push(W);}),l.sort();}function Kv(l){if(l instanceof Me)return l.clone();var f=new yn(l.__wrapped__,l.__chain__);return f.__actions__=jr(l.__actions__),f.__index__=l.__index__,f.__values__=l.__values__,f;}function $x(l,f,T){(T?Fr(l,f,T):f===e)?f=1:f=hr(Ie(f),0);var W=l==null?0:l.length;if(!W||f<1)return[];for(var it=0,mt=0,At=zt(Ll(W/f));it<W;)At[mt++]=Sn(l,it,it+=f);return At;}function Yx(l){for(var f=-1,T=l==null?0:l.length,W=0,it=[];++f<T;){var mt=l[f];mt&&(it[W++]=mt);}return it;}function jx(){var l=arguments.length;if(!l)return[];for(var f=zt(l-1),T=arguments[0],W=l;W--;)f[W-1]=arguments[W];return Li(ge(T)?jr(T):[T],Tr(f,1));}var Xx=Ce(function(l,f){return nr(l)?ia(l,Tr(f,1,nr,!0)):[];}),Gx=Ce(function(l,f){var T=In(f);return nr(T)&&(T=e),nr(l)?ia(l,Tr(f,1,nr,!0),he(T,2)):[];}),Hx=Ce(function(l,f){var T=In(f);return nr(T)&&(T=e),nr(l)?ia(l,Tr(f,1,nr,!0),e,T):[];});function Vx(l,f,T){var W=l==null?0:l.length;return W?(f=T||f===e?1:Ie(f),Sn(l,f<0?0:f,W)):[];}function Zx(l,f,T){var W=l==null?0:l.length;return W?(f=T||f===e?1:Ie(f),f=W-f,Sn(l,0,f<0?0:f)):[];}function qx(l,f){return l&&l.length?zl(l,he(f,3),!0,!0):[];}function Kx(l,f){return l&&l.length?zl(l,he(f,3),!0):[];}function Qx(l,f,T,W){var it=l==null?0:l.length;return it?(T&&typeof T!="number"&&Fr(l,f,T)&&(T=0,W=it),jT(l,f,T,W)):[];}function Qv(l,f,T){var W=l==null?0:l.length;if(!W)return-1;var it=T==null?0:Ie(T);return it<0&&(it=hr(W+it,0)),wl(l,he(f,3),it);}function Jv(l,f,T){var W=l==null?0:l.length;if(!W)return-1;var it=W-1;return T!==e&&(it=Ie(T),it=T<0?hr(W+it,0):Er(it,W-1)),wl(l,he(f,3),it,!0);}function _v(l){var f=l==null?0:l.length;return f?Tr(l,1):[];}function Jx(l){var f=l==null?0:l.length;return f?Tr(l,q):[];}function _x(l,f){var T=l==null?0:l.length;return T?(f=f===e?1:Ie(f),Tr(l,f)):[];}function tC(l){for(var f=-1,T=l==null?0:l.length,W={};++f<T;){var it=l[f];Xn(W,it[0],it[1]);}return W;}function tg(l){return l&&l.length?l[0]:e;}function eC(l,f,T){var W=l==null?0:l.length;if(!W)return-1;var it=T==null?0:Ie(T);return it<0&&(it=hr(W+it,0)),Qs(l,f,it);}function rC(l){var f=l==null?0:l.length;return f?Sn(l,0,-1):[];}var nC=Ce(function(l){var f=Je(l,eh);return f.length&&f[0]===l[0]?Gf(f):[];}),iC=Ce(function(l){var f=In(l),T=Je(l,eh);return f===In(T)?f=e:T.pop(),T.length&&T[0]===l[0]?Gf(T,he(f,2)):[];}),sC=Ce(function(l){var f=In(l),T=Je(l,eh);return f=typeof f=="function"?f:e,f&&T.pop(),T.length&&T[0]===l[0]?Gf(T,e,f):[];});function oC(l,f){return l==null?"":rT.call(l,f);}function In(l){var f=l==null?0:l.length;return f?l[f-1]:e;}function aC(l,f,T){var W=l==null?0:l.length;if(!W)return-1;var it=W;return T!==e&&(it=Ie(T),it=it<0?hr(W+it,0):Er(it,W-1)),f===f?zI(l,f,it):wl(l,N0,it,!0);}function lC(l,f){return l&&l.length?fv(l,Ie(f)):e;}var cC=Ce(eg);function eg(l,f){return l&&l.length&&f&&f.length?qf(l,f):l;}function uC(l,f,T){return l&&l.length&&f&&f.length?qf(l,f,he(T,2)):l;}function fC(l,f,T){return l&&l.length&&f&&f.length?qf(l,f,e,T):l;}var hC=ni(function(l,f){var T=l==null?0:l.length,W=$f(l,f);return pv(l,Je(f,function(it){return ii(it,T)?+it:it;}).sort(Cv)),W;});function dC(l,f){var T=[];if(!(l&&l.length))return T;var W=-1,it=[],mt=l.length;for(f=he(f,3);++W<mt;){var At=l[W];f(At,W,l)&&(T.push(At),it.push(W));}return pv(l,it),T;}function vh(l){return l==null?l:oT.call(l);}function pC(l,f,T){var W=l==null?0:l.length;return W?(T&&typeof T!="number"&&Fr(l,f,T)?(f=0,T=W):(f=f==null?0:Ie(f),T=T===e?W:Ie(T)),Sn(l,f,T)):[];}function vC(l,f){return Ul(l,f);}function gC(l,f,T){return Jf(l,f,he(T,2));}function mC(l,f){var T=l==null?0:l.length;if(T){var W=Ul(l,f);if(W<T&&On(l[W],f))return W;}return-1;}function yC(l,f){return Ul(l,f,!0);}function wC(l,f,T){return Jf(l,f,he(T,2),!0);}function SC(l,f){var T=l==null?0:l.length;if(T){var W=Ul(l,f,!0)-1;if(On(l[W],f))return W;}return-1;}function IC(l){return l&&l.length?gv(l):[];}function TC(l,f){return l&&l.length?gv(l,he(f,2)):[];}function xC(l){var f=l==null?0:l.length;return f?Sn(l,1,f):[];}function CC(l,f,T){return l&&l.length?(f=T||f===e?1:Ie(f),Sn(l,0,f<0?0:f)):[];}function PC(l,f,T){var W=l==null?0:l.length;return W?(f=T||f===e?1:Ie(f),f=W-f,Sn(l,f<0?0:f,W)):[];}function AC(l,f){return l&&l.length?zl(l,he(f,3),!1,!0):[];}function bC(l,f){return l&&l.length?zl(l,he(f,3)):[];}var MC=Ce(function(l){return Ni(Tr(l,1,nr,!0));}),EC=Ce(function(l){var f=In(l);return nr(f)&&(f=e),Ni(Tr(l,1,nr,!0),he(f,2));}),LC=Ce(function(l){var f=In(l);return f=typeof f=="function"?f:e,Ni(Tr(l,1,nr,!0),e,f);});function OC(l){return l&&l.length?Ni(l):[];}function DC(l,f){return l&&l.length?Ni(l,he(f,2)):[];}function RC(l,f){return f=typeof f=="function"?f:e,l&&l.length?Ni(l,e,f):[];}function gh(l){if(!(l&&l.length))return[];var f=0;return l=Ei(l,function(T){if(nr(T))return f=hr(T.length,f),!0;}),Rf(f,function(T){return Je(l,Lf(T));});}function rg(l,f){if(!(l&&l.length))return[];var T=gh(l);return f==null?T:Je(T,function(W){return rn(f,e,W);});}var NC=Ce(function(l,f){return nr(l)?ia(l,f):[];}),BC=Ce(function(l){return th(Ei(l,nr));}),kC=Ce(function(l){var f=In(l);return nr(f)&&(f=e),th(Ei(l,nr),he(f,2));}),FC=Ce(function(l){var f=In(l);return f=typeof f=="function"?f:e,th(Ei(l,nr),e,f);}),WC=Ce(gh);function UC(l,f){return Sv(l||[],f||[],na);}function zC(l,f){return Sv(l||[],f||[],aa);}var $C=Ce(function(l){var f=l.length,T=f>1?l[f-1]:e;return T=typeof T=="function"?(l.pop(),T):e,rg(l,T);});function ng(l){var f=vt(l);return f.__chain__=!0,f;}function YC(l,f){return f(l),l;}function ql(l,f){return f(l);}var jC=ni(function(l){var f=l.length,T=f?l[0]:0,W=this.__wrapped__,it=function it(mt){return $f(mt,l);};return f>1||this.__actions__.length||!(W instanceof Me)||!ii(T)?this.thru(it):(W=W.slice(T,+T+(f?1:0)),W.__actions__.push({func:ql,args:[it],thisArg:e}),new yn(W,this.__chain__).thru(function(mt){return f&&!mt.length&&mt.push(e),mt;}));});function XC(){return ng(this);}function GC(){return new yn(this.value(),this.__chain__);}function HC(){this.__values__===e&&(this.__values__=mg(this.value()));var l=this.__index__>=this.__values__.length,f=l?e:this.__values__[this.__index__++];return{done:l,value:f};}function VC(){return this;}function ZC(l){for(var f,T=this;T instanceof Nl;){var W=Kv(T);W.__index__=0,W.__values__=e,f?it.__wrapped__=W:f=W;var it=W;T=T.__wrapped__;}return it.__wrapped__=l,f;}function qC(){var l=this.__wrapped__;if(l instanceof Me){var f=l;return this.__actions__.length&&(f=new Me(this)),f=f.reverse(),f.__actions__.push({func:ql,args:[vh],thisArg:e}),new yn(f,this.__chain__);}return this.thru(vh);}function KC(){return wv(this.__wrapped__,this.__actions__);}var QC=$l(function(l,f,T){Ue.call(l,T)?++l[T]:Xn(l,T,1);});function JC(l,f,T){var W=ge(l)?D0:YT;return T&&Fr(l,f,T)&&(f=e),W(l,he(f,3));}function _C(l,f){var T=ge(l)?Ei:rv;return T(l,he(f,3));}var tP=Lv(Qv),eP=Lv(Jv);function rP(l,f){return Tr(Kl(l,f),1);}function nP(l,f){return Tr(Kl(l,f),q);}function iP(l,f,T){return T=T===e?1:Ie(T),Tr(Kl(l,f),T);}function ig(l,f){var T=ge(l)?nn:Ri;return T(l,he(f,3));}function sg(l,f){var T=ge(l)?xI:ev;return T(l,he(f,3));}var sP=$l(function(l,f,T){Ue.call(l,T)?l[T].push(f):Xn(l,T,[f]);});function oP(l,f,T,W){l=Xr(l)?l:co(l),T=T&&!W?Ie(T):0;var it=l.length;return T<0&&(T=hr(it+T,0)),ec(l)?T<=it&&l.indexOf(f,T)>-1:!!it&&Qs(l,f,T)>-1;}var aP=Ce(function(l,f,T){var W=-1,it=typeof f=="function",mt=Xr(l)?zt(l.length):[];return Ri(l,function(At){mt[++W]=it?rn(f,At,T):sa(At,f,T);}),mt;}),lP=$l(function(l,f,T){Xn(l,T,f);});function Kl(l,f){var T=ge(l)?Je:lv;return T(l,he(f,3));}function cP(l,f,T,W){return l==null?[]:(ge(f)||(f=f==null?[]:[f]),T=W?e:T,ge(T)||(T=T==null?[]:[T]),hv(l,f,T));}var uP=$l(function(l,f,T){l[T?0:1].push(f);},function(){return[[],[]];});function fP(l,f,T){var W=ge(l)?Mf:k0,it=arguments.length<3;return W(l,he(f,4),T,it,Ri);}function hP(l,f,T){var W=ge(l)?CI:k0,it=arguments.length<3;return W(l,he(f,4),T,it,ev);}function dP(l,f){var T=ge(l)?Ei:rv;return T(l,_l(he(f,3)));}function pP(l){var f=ge(l)?Q0:ox;return f(l);}function vP(l,f,T){(T?Fr(l,f,T):f===e)?f=1:f=Ie(f);var W=ge(l)?FT:ax;return W(l,f);}function gP(l){var f=ge(l)?WT:cx;return f(l);}function mP(l){if(l==null)return 0;if(Xr(l))return ec(l)?_s(l):l.length;var f=Lr(l);return f==V||f==ft?l.size:Vf(l).length;}function yP(l,f,T){var W=ge(l)?Ef:ux;return T&&Fr(l,f,T)&&(f=e),W(l,he(f,3));}var wP=Ce(function(l,f){if(l==null)return[];var T=f.length;return T>1&&Fr(l,f[0],f[1])?f=[]:T>2&&Fr(f[0],f[1],f[2])&&(f=[f[0]]),hv(l,Tr(f,1),[]);}),Ql=_I||function(){return Ir.Date.now();};function SP(l,f){if(typeof f!="function")throw new mn(o);return l=Ie(l),function(){if(--l<1)return f.apply(this,arguments);};}function og(l,f,T){return f=T?e:f,f=l&&f==null?l.length:f,ri(l,P,e,e,e,e,f);}function ag(l,f){var T;if(typeof f!="function")throw new mn(o);return l=Ie(l),function(){return--l>0&&(T=f.apply(this,arguments)),l<=1&&(f=e),T;};}var mh=Ce(function(l,f,T){var W=G;if(T.length){var it=Oi(T,ao(mh));W|=S;}return ri(l,W,f,T,it);}),lg=Ce(function(l,f,T){var W=G|z;if(T.length){var it=Oi(T,ao(lg));W|=S;}return ri(f,W,l,T,it);});function cg(l,f,T){f=T?e:f;var W=ri(l,x,e,e,e,e,e,f);return W.placeholder=cg.placeholder,W;}function ug(l,f,T){f=T?e:f;var W=ri(l,y,e,e,e,e,e,f);return W.placeholder=ug.placeholder,W;}function fg(l,f,T){var W,it,mt,At,Ot,kt,Ht=0,Vt=!1,qt=!1,ie=!0;if(typeof l!="function")throw new mn(o);f=Tn(f)||0,er(T)&&(Vt=!!T.leading,qt="maxWait"in T,mt=qt?hr(Tn(T.maxWait)||0,f):mt,ie="trailing"in T?!!T.trailing:ie);function ce(ir){var Dn=W,ai=it;return W=it=e,Ht=ir,At=l.apply(ai,Dn),At;}function de(ir){return Ht=ir,Ot=ua(Ae,f),Vt?ce(ir):At;}function xe(ir){var Dn=ir-kt,ai=ir-Ht,Og=f-Dn;return qt?Er(Og,mt-ai):Og;}function fe(ir){var Dn=ir-kt,ai=ir-Ht;return kt===e||Dn>=f||Dn<0||qt&&ai>=mt;}function Ae(){var ir=Ql();if(fe(ir))return Ee(ir);Ot=ua(Ae,xe(ir));}function Ee(ir){return Ot=e,ie&&W?ce(ir):(W=it=e,At);}function ln(){Ot!==e&&Iv(Ot),Ht=0,W=kt=it=Ot=e;}function Wr(){return Ot===e?At:Ee(Ql());}function cn(){var ir=Ql(),Dn=fe(ir);if(W=arguments,it=this,kt=ir,Dn){if(Ot===e)return de(kt);if(qt)return Iv(Ot),Ot=ua(Ae,f),ce(kt);}return Ot===e&&(Ot=ua(Ae,f)),At;}return cn.cancel=ln,cn.flush=Wr,cn;}var IP=Ce(function(l,f){return tv(l,1,f);}),TP=Ce(function(l,f,T){return tv(l,Tn(f)||0,T);});function xP(l){return ri(l,$);}function Jl(l,f){if(typeof l!="function"||f!=null&&typeof f!="function")throw new mn(o);var _T2=function T(){var W=arguments,it=f?f.apply(this,W):W[0],mt=_T2.cache;if(mt.has(it))return mt.get(it);var At=l.apply(this,W);return _T2.cache=mt.set(it,At)||mt,At;};return _T2.cache=new(Jl.Cache||ei)(),_T2;}Jl.Cache=ei;function _l(l){if(typeof l!="function")throw new mn(o);return function(){var f=arguments;switch(f.length){case 0:return!l.call(this);case 1:return!l.call(this,f[0]);case 2:return!l.call(this,f[0],f[1]);case 3:return!l.call(this,f[0],f[1],f[2]);}return!l.apply(this,f);};}function CP(l){return ag(2,l);}var PP=fx(function(l,f){f=f.length==1&&ge(f[0])?Je(f[0],sn(he())):Je(Tr(f,1),sn(he()));var T=f.length;return Ce(function(W){for(var it=-1,mt=Er(W.length,T);++it<mt;)W[it]=f[it].call(this,W[it]);return rn(l,this,W);});}),yh=Ce(function(l,f){var T=Oi(f,ao(yh));return ri(l,S,e,f,T);}),hg=Ce(function(l,f){var T=Oi(f,ao(hg));return ri(l,C,e,f,T);}),AP=ni(function(l,f){return ri(l,X,e,e,e,f);});function bP(l,f){if(typeof l!="function")throw new mn(o);return f=f===e?f:Ie(f),Ce(l,f);}function MP(l,f){if(typeof l!="function")throw new mn(o);return f=f==null?0:hr(Ie(f),0),Ce(function(T){var W=T[f],it=ki(T,0,f);return W&&Li(it,W),rn(l,this,it);});}function EP(l,f,T){var W=!0,it=!0;if(typeof l!="function")throw new mn(o);return er(T)&&(W="leading"in T?!!T.leading:W,it="trailing"in T?!!T.trailing:it),fg(l,f,{leading:W,maxWait:f,trailing:it});}function LP(l){return og(l,1);}function OP(l,f){return yh(rh(f),l);}function DP(){if(!arguments.length)return[];var l=arguments[0];return ge(l)?l:[l];}function RP(l){return wn(l,M);}function NP(l,f){return f=typeof f=="function"?f:e,wn(l,M,f);}function BP(l){return wn(l,w|M);}function kP(l,f){return f=typeof f=="function"?f:e,wn(l,w|M,f);}function FP(l,f){return f==null||_0(l,f,gr(f));}function On(l,f){return l===f||l!==l&&f!==f;}var WP=Gl(Xf),UP=Gl(function(l,f){return l>=f;}),gs=sv(/* @__PURE__ */function(){return arguments;}())?sv:function(l){return rr(l)&&Ue.call(l,"callee")&&!G0.call(l,"callee");},ge=zt.isArray,zP=A0?sn(A0):ZT;function Xr(l){return l!=null&&tc(l.length)&&!si(l);}function nr(l){return rr(l)&&Xr(l);}function $P(l){return l===!0||l===!1||rr(l)&&kr(l)==Et;}var Fi=eT||Lh,YP=b0?sn(b0):qT;function jP(l){return rr(l)&&l.nodeType===1&&!fa(l);}function XP(l){if(l==null)return!0;if(Xr(l)&&(ge(l)||typeof l=="string"||typeof l.splice=="function"||Fi(l)||lo(l)||gs(l)))return!l.length;var f=Lr(l);if(f==V||f==ft)return!l.size;if(ca(l))return!Vf(l).length;for(var T in l)if(Ue.call(l,T))return!1;return!0;}function GP(l,f){return oa(l,f);}function HP(l,f,T){T=typeof T=="function"?T:e;var W=T?T(l,f):e;return W===e?oa(l,f,e,T):!!W;}function wh(l){if(!rr(l))return!1;var f=kr(l);return f==N||f==D||typeof l.message=="string"&&typeof l.name=="string"&&!fa(l);}function VP(l){return typeof l=="number"&&V0(l);}function si(l){if(!er(l))return!1;var f=kr(l);return f==J||f==Q||f==yt||f==Z;}function dg(l){return typeof l=="number"&&l==Ie(l);}function tc(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=lt;}function er(l){var f=_typeof(l);return l!=null&&(f=="object"||f=="function");}function rr(l){return l!=null&&_typeof(l)=="object";}var pg=M0?sn(M0):QT;function ZP(l,f){return l===f||Hf(l,f,ch(f));}function qP(l,f,T){return T=typeof T=="function"?T:e,Hf(l,f,ch(f),T);}function KP(l){return vg(l)&&l!=+l;}function QP(l){if(Nx(l))throw new pe(s);return ov(l);}function JP(l){return l===null;}function _P(l){return l==null;}function vg(l){return typeof l=="number"||rr(l)&&kr(l)==tt;}function fa(l){if(!rr(l)||kr(l)!=I)return!1;var f=bl(l);if(f===null)return!0;var T=Ue.call(f,"constructor")&&f.constructor;return typeof T=="function"&&T instanceof T&&xl.call(T)==qI;}var Sh=E0?sn(E0):JT;function tA(l){return dg(l)&&l>=-lt&&l<=lt;}var gg=L0?sn(L0):_T;function ec(l){return typeof l=="string"||!ge(l)&&rr(l)&&kr(l)==dt;}function an(l){return _typeof(l)=="symbol"||rr(l)&&kr(l)==ot;}var lo=O0?sn(O0):tx;function eA(l){return l===e;}function rA(l){return rr(l)&&Lr(l)==St;}function nA(l){return rr(l)&&kr(l)==Pt;}var iA=Gl(Zf),sA=Gl(function(l,f){return l<=f;});function mg(l){if(!l)return[];if(Xr(l))return ec(l)?Mn(l):jr(l);if(Jo&&l[Jo])return FI(l[Jo]());var f=Lr(l),T=f==V?Bf:f==ft?Sl:co;return T(l);}function oi(l){if(!l)return l===0?l:0;if(l=Tn(l),l===q||l===-q){var f=l<0?-1:1;return f*ut;}return l===l?l:0;}function Ie(l){var f=oi(l),T=f%1;return f===f?T?f-T:f:0;}function yg(l){return l?hs(Ie(l),0,O):0;}function Tn(l){if(typeof l=="number")return l;if(an(l))return Tt;if(er(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=er(f)?f+"":f;}if(typeof l!="string")return l===0?l:+l;l=F0(l);var T=Zs.test(l);return T||hf.test(l)?SI(l.slice(2),T?2:8):as.test(l)?Tt:+l;}function wg(l){return Hn(l,Gr(l));}function oA(l){return l?hs(Ie(l),-lt,lt):l===0?l:0;}function ze(l){return l==null?"":on(l);}var aA=so(function(l,f){if(ca(f)||Xr(f)){Hn(f,gr(f),l);return;}for(var T in f)Ue.call(f,T)&&na(l,T,f[T]);}),Sg=so(function(l,f){Hn(f,Gr(f),l);}),Ig=so(function(l,f,T,W){Hn(f,Gr(f),l,W);}),Ih=so(function(l,f,T,W){Hn(f,gr(f),l,W);}),lA=ni($f);function cA(l,f){var T=io(l);return f==null?T:J0(T,f);}var uA=Ce(function(l,f){l=Xe(l);var T=-1,W=f.length,it=W>2?f[2]:e;for(it&&Fr(f[0],f[1],it)&&(W=1);++T<W;)for(var mt=f[T],At=Gr(mt),Ot=-1,kt=At.length;++Ot<kt;){var Ht=At[Ot],Vt=l[Ht];(Vt===e||On(Vt,eo[Ht])&&!Ue.call(l,Ht))&&(l[Ht]=mt[Ht]);}return l;}),fA=Ce(function(l){return l.push(e,Fv),rn(Tg,e,l);});function hA(l,f){return R0(l,he(f,3),Gn);}function dA(l,f){return R0(l,he(f,3),jf);}function pA(l,f){return l==null?l:Yf(l,he(f,3),Gr);}function vA(l,f){return l==null?l:nv(l,he(f,3),Gr);}function gA(l,f){return l&&Gn(l,he(f,3));}function mA(l,f){return l&&jf(l,he(f,3));}function yA(l){return l==null?[]:Fl(l,gr(l));}function wA(l){return l==null?[]:Fl(l,Gr(l));}function Th(l,f,T){var W=l==null?e:ds(l,f);return W===e?T:W;}function SA(l,f){return l!=null&&zv(l,f,XT);}function xh(l,f){return l!=null&&zv(l,f,GT);}var IA=Dv(function(l,f,T){f!=null&&typeof f.toString!="function"&&(f=Cl.call(f)),l[f]=T;},Ph(Hr)),TA=Dv(function(l,f,T){f!=null&&typeof f.toString!="function"&&(f=Cl.call(f)),Ue.call(l,f)?l[f].push(T):l[f]=[T];},he),xA=Ce(sa);function gr(l){return Xr(l)?K0(l):Vf(l);}function Gr(l){return Xr(l)?K0(l,!0):ex(l);}function CA(l,f){var T={};return f=he(f,3),Gn(l,function(W,it,mt){Xn(T,f(W,it,mt),W);}),T;}function PA(l,f){var T={};return f=he(f,3),Gn(l,function(W,it,mt){Xn(T,it,f(W,it,mt));}),T;}var AA=so(function(l,f,T){Wl(l,f,T);}),Tg=so(function(l,f,T,W){Wl(l,f,T,W);}),bA=ni(function(l,f){var T={};if(l==null)return T;var W=!1;f=Je(f,function(mt){return mt=Bi(mt,l),W||(W=mt.length>1),mt;}),Hn(l,ah(l),T),W&&(T=wn(T,w|A|M,Tx));for(var it=f.length;it--;)_f(T,f[it]);return T;});function MA(l,f){return xg(l,_l(he(f)));}var EA=ni(function(l,f){return l==null?{}:nx(l,f);});function xg(l,f){if(l==null)return{};var T=Je(ah(l),function(W){return[W];});return f=he(f),dv(l,T,function(W,it){return f(W,it[0]);});}function LA(l,f,T){f=Bi(f,l);var W=-1,it=f.length;for(it||(it=1,l=e);++W<it;){var mt=l==null?e:l[Ln(f[W])];mt===e&&(W=it,mt=T),l=si(mt)?mt.call(l):mt;}return l;}function OA(l,f,T){return l==null?l:aa(l,f,T);}function DA(l,f,T,W){return W=typeof W=="function"?W:e,l==null?l:aa(l,f,T,W);}var Cg=Bv(gr),Pg=Bv(Gr);function RA(l,f,T){var W=ge(l),it=W||Fi(l)||lo(l);if(f=he(f,4),T==null){var mt=l&&l.constructor;it?T=W?new mt():[]:er(l)?T=si(mt)?io(bl(l)):{}:T={};}return(it?nn:Gn)(l,function(At,Ot,kt){return f(T,At,Ot,kt);}),T;}function NA(l,f){return l==null?!0:_f(l,f);}function BA(l,f,T){return l==null?l:yv(l,f,rh(T));}function kA(l,f,T,W){return W=typeof W=="function"?W:e,l==null?l:yv(l,f,rh(T),W);}function co(l){return l==null?[]:Nf(l,gr(l));}function FA(l){return l==null?[]:Nf(l,Gr(l));}function WA(l,f,T){return T===e&&(T=f,f=e),T!==e&&(T=Tn(T),T=T===T?T:0),f!==e&&(f=Tn(f),f=f===f?f:0),hs(Tn(l),f,T);}function UA(l,f,T){return f=oi(f),T===e?(T=f,f=0):T=oi(T),l=Tn(l),HT(l,f,T);}function zA(l,f,T){if(T&&typeof T!="boolean"&&Fr(l,f,T)&&(f=T=e),T===e&&(typeof f=="boolean"?(T=f,f=e):typeof l=="boolean"&&(T=l,l=e)),l===e&&f===e?(l=0,f=1):(l=oi(l),f===e?(f=l,l=0):f=oi(f)),l>f){var W=l;l=f,f=W;}if(T||l%1||f%1){var it=Z0();return Er(l+it*(f-l+wI("1e-"+((it+"").length-1))),f);}return Kf(l,f);}var $A=oo(function(l,f,T){return f=f.toLowerCase(),l+(T?Ag(f):f);});function Ag(l){return Ch(ze(l).toLowerCase());}function bg(l){return l=ze(l),l&&l.replace(pf,DI).replace(cI,"");}function YA(l,f,T){l=ze(l),f=on(f);var W=l.length;T=T===e?W:hs(Ie(T),0,W);var it=T;return T-=f.length,T>=0&&l.slice(T,it)==f;}function jA(l){return l=ze(l),l&&Ge.test(l)?l.replace(Be,RI):l;}function XA(l){return l=ze(l),l&&Xo.test(l)?l.replace(jn,"\\$&"):l;}var GA=oo(function(l,f,T){return l+(T?"-":"")+f.toLowerCase();}),HA=oo(function(l,f,T){return l+(T?" ":"")+f.toLowerCase();}),VA=Ev("toLowerCase");function ZA(l,f,T){l=ze(l),f=Ie(f);var W=f?_s(l):0;if(!f||W>=f)return l;var it=(f-W)/2;return Xl(Ol(it),T)+l+Xl(Ll(it),T);}function qA(l,f,T){l=ze(l),f=Ie(f);var W=f?_s(l):0;return f&&W<f?l+Xl(f-W,T):l;}function KA(l,f,T){l=ze(l),f=Ie(f);var W=f?_s(l):0;return f&&W<f?Xl(f-W,T)+l:l;}function QA(l,f,T){return T||f==null?f=0:f&&(f=+f),sT(ze(l).replace(Ai,""),f||0);}function JA(l,f,T){return(T?Fr(l,f,T):f===e)?f=1:f=Ie(f),Qf(ze(l),f);}function _A(){var l=arguments,f=ze(l[0]);return l.length<3?f:f.replace(l[1],l[2]);}var tb=oo(function(l,f,T){return l+(T?"_":"")+f.toLowerCase();});function eb(l,f,T){return T&&typeof T!="number"&&Fr(l,f,T)&&(f=T=e),T=T===e?O:T>>>0,T?(l=ze(l),l&&(typeof f=="string"||f!=null&&!Sh(f))&&(f=on(f),!f&&Js(l))?ki(Mn(l),0,T):l.split(f,T)):[];}var rb=oo(function(l,f,T){return l+(T?" ":"")+Ch(f);});function nb(l,f,T){return l=ze(l),T=T==null?0:hs(Ie(T),0,l.length),f=on(f),l.slice(T,T+f.length)==f;}function ib(l,f,T){var W=vt.templateSettings;T&&Fr(l,f,T)&&(f=e),l=ze(l),f=Ih({},f,W,kv);var it=Ih({},f.imports,W.imports,kv),mt=gr(it),At=Nf(it,mt);nn(mt,function(fe){if(os.test(fe))throw new pe(u);});var Ot,kt,Ht=0,Vt=f.interpolate||bn,qt="__p += '",ie=kf((f.escape||bn).source+"|"+Vt.source+"|"+(Vt===lr?Zo:bn).source+"|"+(f.evaluate||bn).source+"|$","g"),ce="//# sourceURL="+(Ue.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++pI+"]")+"\n";l.replace(ie,function(fe,Ae,Ee,ln,Wr,cn){return Ee||(Ee=ln),qt+=l.slice(Ht,cn).replace(vf,NI),Ae&&(Ot=!0,qt+="' +\n__e("+Ae+") +\n'"),Wr&&(kt=!0,qt+="';\n"+Wr+";\n__p += '"),Ee&&(qt+="' +\n((__t = ("+Ee+")) == null ? '' : __t) +\n'"),Ht=cn+fe.length,fe;}),qt+="';\n";var de=Ue.call(f,"variable")&&f.variable;if(!de)qt="with (obj) {\n"+qt+"\n}\n";else if(os.test(de))throw new pe(a);qt=(kt?qt.replace(le,""):qt).replace(Oe,"$1").replace(De,"$1;"),qt="function("+(de||"obj")+") {\n"+(de?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(Ot?", __e = _.escape":"")+(kt?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+qt+"return __p\n}";var xe=Eg(function(){return ke(mt,ce+"return "+qt).apply(e,At);});if(xe.source=qt,wh(xe))throw xe;return xe;}function sb(l){return ze(l).toLowerCase();}function ob(l){return ze(l).toUpperCase();}function ab(l,f,T){if(l=ze(l),l&&(T||f===e))return F0(l);if(!l||!(f=on(f)))return l;var W=Mn(l),it=Mn(f),mt=W0(W,it),At=U0(W,it)+1;return ki(W,mt,At).join("");}function lb(l,f,T){if(l=ze(l),l&&(T||f===e))return l.slice(0,$0(l)+1);if(!l||!(f=on(f)))return l;var W=Mn(l),it=U0(W,Mn(f))+1;return ki(W,0,it).join("");}function cb(l,f,T){if(l=ze(l),l&&(T||f===e))return l.replace(Ai,"");if(!l||!(f=on(f)))return l;var W=Mn(l),it=W0(W,Mn(f));return ki(W,it).join("");}function ub(l,f){var T=K,W=j;if(er(f)){var it="separator"in f?f.separator:it;T="length"in f?Ie(f.length):T,W="omission"in f?on(f.omission):W;}l=ze(l);var mt=l.length;if(Js(l)){var At=Mn(l);mt=At.length;}if(T>=mt)return l;var Ot=T-_s(W);if(Ot<1)return W;var kt=At?ki(At,0,Ot).join(""):l.slice(0,Ot);if(it===e)return kt+W;if(At&&(Ot+=kt.length-Ot),Sh(it)){if(l.slice(Ot).search(it)){var Ht,Vt=kt;for(it.global||(it=kf(it.source,ze(An.exec(it))+"g")),it.lastIndex=0;Ht=it.exec(Vt);)var qt=Ht.index;kt=kt.slice(0,qt===e?Ot:qt);}}else if(l.indexOf(on(it),Ot)!=Ot){var ie=kt.lastIndexOf(it);ie>-1&&(kt=kt.slice(0,ie));}return kt+W;}function fb(l){return l=ze(l),l&&Ye.test(l)?l.replace(Ne,$I):l;}var hb=oo(function(l,f,T){return l+(T?" ":"")+f.toUpperCase();}),Ch=Ev("toUpperCase");function Mg(l,f,T){return l=ze(l),f=T?e:f,f===e?kI(l)?XI(l):bI(l):l.match(f)||[];}var Eg=Ce(function(l,f){try{return rn(l,e,f);}catch(T){return wh(T)?T:new pe(T);}}),db=ni(function(l,f){return nn(f,function(T){T=Ln(T),Xn(l,T,mh(l[T],l));}),l;});function pb(l){var f=l==null?0:l.length,T=he();return l=f?Je(l,function(W){if(typeof W[1]!="function")throw new mn(o);return[T(W[0]),W[1]];}):[],Ce(function(W){for(var it=-1;++it<f;){var mt=l[it];if(rn(mt[0],this,W))return rn(mt[1],this,W);}});}function vb(l){return $T(wn(l,w));}function Ph(l){return function(){return l;};}function gb(l,f){return l==null||l!==l?f:l;}var mb=Ov(),yb=Ov(!0);function Hr(l){return l;}function Ah(l){return av(typeof l=="function"?l:wn(l,w));}function wb(l){return cv(wn(l,w));}function Sb(l,f){return uv(l,wn(f,w));}var Ib=Ce(function(l,f){return function(T){return sa(T,l,f);};}),Tb=Ce(function(l,f){return function(T){return sa(l,T,f);};});function bh(l,f,T){var W=gr(f),it=Fl(f,W);T==null&&!(er(f)&&(it.length||!W.length))&&(T=f,f=l,l=this,it=Fl(f,gr(f)));var mt=!(er(T)&&"chain"in T)||!!T.chain,At=si(l);return nn(it,function(Ot){var kt=f[Ot];l[Ot]=kt,At&&(l.prototype[Ot]=function(){var Ht=this.__chain__;if(mt||Ht){var Vt=l(this.__wrapped__),qt=Vt.__actions__=jr(this.__actions__);return qt.push({func:kt,args:arguments,thisArg:l}),Vt.__chain__=Ht,Vt;}return kt.apply(l,Li([this.value()],arguments));});}),l;}function xb(){return Ir._===this&&(Ir._=KI),this;}function Mh(){}function Cb(l){return l=Ie(l),Ce(function(f){return fv(f,l);});}var Pb=ih(Je),Ab=ih(D0),bb=ih(Ef);function Lg(l){return fh(l)?Lf(Ln(l)):ix(l);}function Mb(l){return function(f){return l==null?e:ds(l,f);};}var Eb=Rv(),Lb=Rv(!0);function Eh(){return[];}function Lh(){return!1;}function Ob(){return{};}function Db(){return"";}function Rb(){return!0;}function Nb(l,f){if(l=Ie(l),l<1||l>lt)return[];var T=O,W=Er(l,O);f=he(f),l-=O;for(var it=Rf(W,f);++T<l;)f(T);return it;}function Bb(l){return ge(l)?Je(l,Ln):an(l)?[l]:jr(qv(ze(l)));}function kb(l){var f=++ZI;return ze(l)+f;}var Fb=jl(function(l,f){return l+f;},0),Wb=sh("ceil"),Ub=jl(function(l,f){return l/f;},1),zb=sh("floor");function $b(l){return l&&l.length?kl(l,Hr,Xf):e;}function Yb(l,f){return l&&l.length?kl(l,he(f,2),Xf):e;}function jb(l){return B0(l,Hr);}function Xb(l,f){return B0(l,he(f,2));}function Gb(l){return l&&l.length?kl(l,Hr,Zf):e;}function Hb(l,f){return l&&l.length?kl(l,he(f,2),Zf):e;}var Vb=jl(function(l,f){return l*f;},1),Zb=sh("round"),qb=jl(function(l,f){return l-f;},0);function Kb(l){return l&&l.length?Df(l,Hr):0;}function Qb(l,f){return l&&l.length?Df(l,he(f,2)):0;}return vt.after=SP,vt.ary=og,vt.assign=aA,vt.assignIn=Sg,vt.assignInWith=Ig,vt.assignWith=Ih,vt.at=lA,vt.before=ag,vt.bind=mh,vt.bindAll=db,vt.bindKey=lg,vt.castArray=DP,vt.chain=ng,vt.chunk=$x,vt.compact=Yx,vt.concat=jx,vt.cond=pb,vt.conforms=vb,vt.constant=Ph,vt.countBy=QC,vt.create=cA,vt.curry=cg,vt.curryRight=ug,vt.debounce=fg,vt.defaults=uA,vt.defaultsDeep=fA,vt.defer=IP,vt.delay=TP,vt.difference=Xx,vt.differenceBy=Gx,vt.differenceWith=Hx,vt.drop=Vx,vt.dropRight=Zx,vt.dropRightWhile=qx,vt.dropWhile=Kx,vt.fill=Qx,vt.filter=_C,vt.flatMap=rP,vt.flatMapDeep=nP,vt.flatMapDepth=iP,vt.flatten=_v,vt.flattenDeep=Jx,vt.flattenDepth=_x,vt.flip=xP,vt.flow=mb,vt.flowRight=yb,vt.fromPairs=tC,vt.functions=yA,vt.functionsIn=wA,vt.groupBy=sP,vt.initial=rC,vt.intersection=nC,vt.intersectionBy=iC,vt.intersectionWith=sC,vt.invert=IA,vt.invertBy=TA,vt.invokeMap=aP,vt.iteratee=Ah,vt.keyBy=lP,vt.keys=gr,vt.keysIn=Gr,vt.map=Kl,vt.mapKeys=CA,vt.mapValues=PA,vt.matches=wb,vt.matchesProperty=Sb,vt.memoize=Jl,vt.merge=AA,vt.mergeWith=Tg,vt.method=Ib,vt.methodOf=Tb,vt.mixin=bh,vt.negate=_l,vt.nthArg=Cb,vt.omit=bA,vt.omitBy=MA,vt.once=CP,vt.orderBy=cP,vt.over=Pb,vt.overArgs=PP,vt.overEvery=Ab,vt.overSome=bb,vt.partial=yh,vt.partialRight=hg,vt.partition=uP,vt.pick=EA,vt.pickBy=xg,vt.property=Lg,vt.propertyOf=Mb,vt.pull=cC,vt.pullAll=eg,vt.pullAllBy=uC,vt.pullAllWith=fC,vt.pullAt=hC,vt.range=Eb,vt.rangeRight=Lb,vt.rearg=AP,vt.reject=dP,vt.remove=dC,vt.rest=bP,vt.reverse=vh,vt.sampleSize=vP,vt.set=OA,vt.setWith=DA,vt.shuffle=gP,vt.slice=pC,vt.sortBy=wP,vt.sortedUniq=IC,vt.sortedUniqBy=TC,vt.split=eb,vt.spread=MP,vt.tail=xC,vt.take=CC,vt.takeRight=PC,vt.takeRightWhile=AC,vt.takeWhile=bC,vt.tap=YC,vt.throttle=EP,vt.thru=ql,vt.toArray=mg,vt.toPairs=Cg,vt.toPairsIn=Pg,vt.toPath=Bb,vt.toPlainObject=wg,vt.transform=RA,vt.unary=LP,vt.union=MC,vt.unionBy=EC,vt.unionWith=LC,vt.uniq=OC,vt.uniqBy=DC,vt.uniqWith=RC,vt.unset=NA,vt.unzip=gh,vt.unzipWith=rg,vt.update=BA,vt.updateWith=kA,vt.values=co,vt.valuesIn=FA,vt.without=NC,vt.words=Mg,vt.wrap=OP,vt.xor=BC,vt.xorBy=kC,vt.xorWith=FC,vt.zip=WC,vt.zipObject=UC,vt.zipObjectDeep=zC,vt.zipWith=$C,vt.entries=Cg,vt.entriesIn=Pg,vt.extend=Sg,vt.extendWith=Ig,bh(vt,vt),vt.add=Fb,vt.attempt=Eg,vt.camelCase=$A,vt.capitalize=Ag,vt.ceil=Wb,vt.clamp=WA,vt.clone=RP,vt.cloneDeep=BP,vt.cloneDeepWith=kP,vt.cloneWith=NP,vt.conformsTo=FP,vt.deburr=bg,vt.defaultTo=gb,vt.divide=Ub,vt.endsWith=YA,vt.eq=On,vt.escape=jA,vt.escapeRegExp=XA,vt.every=JC,vt.find=tP,vt.findIndex=Qv,vt.findKey=hA,vt.findLast=eP,vt.findLastIndex=Jv,vt.findLastKey=dA,vt.floor=zb,vt.forEach=ig,vt.forEachRight=sg,vt.forIn=pA,vt.forInRight=vA,vt.forOwn=gA,vt.forOwnRight=mA,vt.get=Th,vt.gt=WP,vt.gte=UP,vt.has=SA,vt.hasIn=xh,vt.head=tg,vt.identity=Hr,vt.includes=oP,vt.indexOf=eC,vt.inRange=UA,vt.invoke=xA,vt.isArguments=gs,vt.isArray=ge,vt.isArrayBuffer=zP,vt.isArrayLike=Xr,vt.isArrayLikeObject=nr,vt.isBoolean=$P,vt.isBuffer=Fi,vt.isDate=YP,vt.isElement=jP,vt.isEmpty=XP,vt.isEqual=GP,vt.isEqualWith=HP,vt.isError=wh,vt.isFinite=VP,vt.isFunction=si,vt.isInteger=dg,vt.isLength=tc,vt.isMap=pg,vt.isMatch=ZP,vt.isMatchWith=qP,vt.isNaN=KP,vt.isNative=QP,vt.isNil=_P,vt.isNull=JP,vt.isNumber=vg,vt.isObject=er,vt.isObjectLike=rr,vt.isPlainObject=fa,vt.isRegExp=Sh,vt.isSafeInteger=tA,vt.isSet=gg,vt.isString=ec,vt.isSymbol=an,vt.isTypedArray=lo,vt.isUndefined=eA,vt.isWeakMap=rA,vt.isWeakSet=nA,vt.join=oC,vt.kebabCase=GA,vt.last=In,vt.lastIndexOf=aC,vt.lowerCase=HA,vt.lowerFirst=VA,vt.lt=iA,vt.lte=sA,vt.max=$b,vt.maxBy=Yb,vt.mean=jb,vt.meanBy=Xb,vt.min=Gb,vt.minBy=Hb,vt.stubArray=Eh,vt.stubFalse=Lh,vt.stubObject=Ob,vt.stubString=Db,vt.stubTrue=Rb,vt.multiply=Vb,vt.nth=lC,vt.noConflict=xb,vt.noop=Mh,vt.now=Ql,vt.pad=ZA,vt.padEnd=qA,vt.padStart=KA,vt.parseInt=QA,vt.random=zA,vt.reduce=fP,vt.reduceRight=hP,vt.repeat=JA,vt.replace=_A,vt.result=LA,vt.round=Zb,vt.runInContext=Bt,vt.sample=pP,vt.size=mP,vt.snakeCase=tb,vt.some=yP,vt.sortedIndex=vC,vt.sortedIndexBy=gC,vt.sortedIndexOf=mC,vt.sortedLastIndex=yC,vt.sortedLastIndexBy=wC,vt.sortedLastIndexOf=SC,vt.startCase=rb,vt.startsWith=nb,vt.subtract=qb,vt.sum=Kb,vt.sumBy=Qb,vt.template=ib,vt.times=Nb,vt.toFinite=oi,vt.toInteger=Ie,vt.toLength=yg,vt.toLower=sb,vt.toNumber=Tn,vt.toSafeInteger=oA,vt.toString=ze,vt.toUpper=ob,vt.trim=ab,vt.trimEnd=lb,vt.trimStart=cb,vt.truncate=ub,vt.unescape=fb,vt.uniqueId=kb,vt.upperCase=hb,vt.upperFirst=Ch,vt.each=ig,vt.eachRight=sg,vt.first=tg,bh(vt,function(){var l={};return Gn(vt,function(f,T){Ue.call(vt.prototype,T)||(l[T]=f);}),l;}(),{chain:!1}),vt.VERSION=n,nn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){vt[l].placeholder=vt;}),nn(["drop","take"],function(l,f){Me.prototype[l]=function(T){T=T===e?1:hr(Ie(T),0);var W=this.__filtered__&&!f?new Me(this):this.clone();return W.__filtered__?W.__takeCount__=Er(T,W.__takeCount__):W.__views__.push({size:Er(T,O),type:l+(W.__dir__<0?"Right":"")}),W;},Me.prototype[l+"Right"]=function(T){return this.reverse()[l](T).reverse();};}),nn(["filter","map","takeWhile"],function(l,f){var T=f+1,W=T==F||T==Y;Me.prototype[l]=function(it){var mt=this.clone();return mt.__iteratees__.push({iteratee:he(it,3),type:T}),mt.__filtered__=mt.__filtered__||W,mt;};}),nn(["head","last"],function(l,f){var T="take"+(f?"Right":"");Me.prototype[l]=function(){return this[T](1).value()[0];};}),nn(["initial","tail"],function(l,f){var T="drop"+(f?"":"Right");Me.prototype[l]=function(){return this.__filtered__?new Me(this):this[T](1);};}),Me.prototype.compact=function(){return this.filter(Hr);},Me.prototype.find=function(l){return this.filter(l).head();},Me.prototype.findLast=function(l){return this.reverse().find(l);},Me.prototype.invokeMap=Ce(function(l,f){return typeof l=="function"?new Me(this):this.map(function(T){return sa(T,l,f);});}),Me.prototype.reject=function(l){return this.filter(_l(he(l)));},Me.prototype.slice=function(l,f){l=Ie(l);var T=this;return T.__filtered__&&(l>0||f<0)?new Me(T):(l<0?T=T.takeRight(-l):l&&(T=T.drop(l)),f!==e&&(f=Ie(f),T=f<0?T.dropRight(-f):T.take(f-l)),T);},Me.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse();},Me.prototype.toArray=function(){return this.take(O);},Gn(Me.prototype,function(l,f){var T=/^(?:filter|find|map|reject)|While$/.test(f),W=/^(?:head|last)$/.test(f),it=vt[W?"take"+(f=="last"?"Right":""):f],mt=W||/^find/.test(f);it&&(vt.prototype[f]=function(){var At=this.__wrapped__,Ot=W?[1]:arguments,kt=At instanceof Me,Ht=Ot[0],Vt=kt||ge(At),qt=function qt(Ae){var Ee=it.apply(vt,Li([Ae],Ot));return W&&ie?Ee[0]:Ee;};Vt&&T&&typeof Ht=="function"&&Ht.length!=1&&(kt=Vt=!1);var ie=this.__chain__,ce=!!this.__actions__.length,de=mt&&!ie,xe=kt&&!ce;if(!mt&&Vt){At=xe?At:new Me(this);var fe=l.apply(At,Ot);return fe.__actions__.push({func:ql,args:[qt],thisArg:e}),new yn(fe,ie);}return de&&xe?l.apply(this,Ot):(fe=this.thru(qt),de?W?fe.value()[0]:fe.value():fe);});}),nn(["pop","push","shift","sort","splice","unshift"],function(l){var f=Il[l],T=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",W=/^(?:pop|shift)$/.test(l);vt.prototype[l]=function(){var it=arguments;if(W&&!this.__chain__){var mt=this.value();return f.apply(ge(mt)?mt:[],it);}return this[T](function(At){return f.apply(ge(At)?At:[],it);});};}),Gn(Me.prototype,function(l,f){var T=vt[f];if(T){var W=T.name+"";Ue.call(no,W)||(no[W]=[]),no[W].push({name:f,func:T});}}),no[Yl(e,z).name]=[{name:"wrapper",func:e}],Me.prototype.clone=hT,Me.prototype.reverse=dT,Me.prototype.value=pT,vt.prototype.at=jC,vt.prototype.chain=XC,vt.prototype.commit=GC,vt.prototype.next=HC,vt.prototype.plant=ZC,vt.prototype.reverse=qC,vt.prototype.toJSON=vt.prototype.valueOf=vt.prototype.value=KC,vt.prototype.first=vt.prototype.head,Jo&&(vt.prototype[Jo]=VC),vt;},to=GI();ls?((ls.exports=to)._=to,Pf._=to):Ir._=to;}).call(Qe);})(mu,mu.exports);mu.exports;var NPt=(_NPt={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_NPt,It.Selector,_e.selector),It.Clicker,_e.clicker),It.Text,_e.text),It.Pencil,_e.pencil),It.LaserPen,_e.laserPen),It.Arrow,_e.arrow),It.Straight,_e.straight),It.Rectangle,_e.rectangle),It.Ellipse,_e.ellipse),It.Star,qi.star),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_NPt,It.Polygon,qi.polygon),It.SpeechBalloon,qi.speechBalloon),It.Eraser,_e.eraser),It.PencilEraser,_e.pencilEraser),It.BitMapEraser,qi.bitMapEraser));function BPt(r){return r===void 0?void 0:NPt[r];}function kn(r){return BPt(r);}var $c=5,Hi=/*#__PURE__*/function(_jt11){function Hi(e){var _this61;_classCallCheck(this,Hi);_this61=_callSuper(this,Hi,[e]);wt(_this61,"canRotate",!1);wt(_this61,"scaleType",be.proportional);wt(_this61,"toolsType",It.Text);wt(_this61,"tmpPoints",[]);wt(_this61,"workOptions");wt(_this61,"oldRect");_this61.workOptions=e.toolsOpt;return _this61;}_inherits(Hi,_jt11);return _createClass(Hi,[{key:"consume",value:function consume(){return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:xt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(e){var n,i,s,o,_this$workOptions14,a,u,d,v,p,w,A,M,E,L,G,z,et;return _regenerator().w(function(_context15){while(1)switch(_context15.n){case 0:n=e.workId,i=e.layer,s=e.isDrawLabel,o=e.boxRect,_this$workOptions14=this.workOptions,a=_this$workOptions14.boxSize,u=_this$workOptions14.boxPoint,d=_this$workOptions14.zIndex,v=i.worldPosition,p=i.worldScaling;if(!(!u||!a)){_context15.n=1;break;}return _context15.a(2);case 1:w={name:n,id:n,pos:[u[0]-$c,u[1]-$c],anchor:[0,0],size:a,zIndex:d},A=new ar(w),M={x:u[0]-$c,y:u[1]-$c,w:a[0],h:a[1]},E={x:Math.floor(M.x*p[0]+v[0]),y:Math.floor(M.y*p[1]+v[1]),w:Math.floor(M.w*p[0])+2,h:Math.floor(M.h*p[1])+2};this.replace(i,n,A);if(!(o&&(L=qa(E,o)),(s||o&&L!==Ji.outside)&&i&&this.workOptions.text)){_context15.n=3;break;}_context15.n=2;return Hi.createLabels(this.workOptions,i,E);case 2:G=_context15.v;z=G.labels;et=G.maxWidth;A.append.apply(A,_toConsumableArray(z)),E.w=Math.ceil(Math.max(et*i.worldScaling[0],E.w));case 3:return _context15.a(2,E);}},_callee14,this);}));function draw(_x22){return _draw2.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(e){var v,p,w,A,n,i,s,o,a,u,d;return _regenerator().w(function(_context16){while(1)switch(_context16.n){case 0:n=(v=this.workId)==null?void 0:v.toString();if(n){_context16.n=1;break;}return _context16.a(2);case 1:i=e.isFullWork,s=e.replaceId,o=e.isDrawLabel,a=e.boxRect;this.oldRect=s&&((w=(p=this.vNodes)==null?void 0:p.get(s))==null?void 0:w.rect)||void 0;u=i?this.fullLayer:this.drawLayer||this.fullLayer;_context16.n=2;return this.draw({workId:n,layer:u,isDrawLabel:_typeof(o)>"u"&&this.workOptions.workState===te.Done||o,boxRect:a});case 2:d=_context16.v;return _context16.a(2,((A=this.vNodes)==null||A.setInfo(n,{rect:d,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:d&&jt.getCenterPos(d,u)}),d));}},_callee15,this);}));function consumeServiceAsync(_x23){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(e,n,i){var E,L,s,o,a,u,d,v,p,w,A,M;return _regenerator().w(function(_context17){while(1)switch(_context17.n){case 0:if(this.workId){_context17.n=1;break;}return _context17.a(2);case 1:s=this.workId.toString(),o=e.fontColor,a=e.fontBgColor,u=e.bold,d=e.italic,v=e.lineThrough,p=e.underline,w=e.zIndex,A=(E=this.vNodes)==null?void 0:E.get(s);if(A){_context17.n=2;break;}return _context17.a(2);case 2:o&&(A.opt.fontColor=o),a&&(A.opt.fontBgColor=a),u&&(A.opt.bold=u),d&&(A.opt.italic=d),bs(v)&&(A.opt.lineThrough=v),bs(p)&&(A.opt.underline=p),Ze(w)&&(A.opt.zIndex=w),this.oldRect=A.rect;_context17.n=3;return this.draw({workId:s,layer:this.fullLayer,isDrawLabel:_typeof(n)>"u"&&this.workOptions.workState===te.Done||n,boxRect:i});case 3:M=_context17.v;return _context17.a(2,((L=this.vNodes)==null||L.setInfo(s,{rect:M,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:M&&jt.getCenterPos(M,this.fullLayer)}),M));}},_callee16,this);}));function updataOptServiceAsync(_x24,_x25,_x26){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function(){var _normalizeStorageData2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17(e){return _regenerator().w(function(_context18){while(1)switch(_context18.n){case 0:return _context18.a(2,this.normalizeStorageDataSync(e));}},_callee17,this);}));function normalizeStorageData(_x27){return _normalizeStorageData2.apply(this,arguments);}return normalizeStorageData;}()},{key:"normalizeStorageDataSync",value:function normalizeStorageDataSync(e){var n=jt.normalizeStorageDataSync(e);if(n.status==="unrecoverable")return n;var i=n.value,s=i.opt;return s&&s.workState!==te.Done?(i.type=xt.FullWork,i.opt=_objectSpread(_objectSpread({},s),{},{workState:te.Done}),{status:"stable",value:i}):n;}},{key:"getSafetySnippetRatio",value:function getSafetySnippetRatio(e){var n=(e==null?void 0:e.parent).displayRatio||1,i=Math.ceil(e.worldScaling[0]*10)/10;var s=i;return i<=2?s=i*n*2:i>2&&i<=3?s=i*n*1.6:i>3&&i<=4?s=i*n*1.2:i>4&&(s=i*n),Math.floor(s*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(e){return Math.floor(Hi.textImageSnippetSize*3/4/e)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18(e,n,i){var K,s,o,a,_ref64,u,d,v,p,w,A,M,E,L,G,z,et,x,y,S,C,P,X,$,j,nt,ct,F,R,Y,q,lt,ut,Tt,O,_,H,at,ht,yt,Et,Dt,D,N,U,_at2,_ht2,_yt2,_at3,_ht3,_10,_H2;return _regenerator().w(function(_context19){while(1)switch(_context19.n){case 0:s=[],o=i.x,a=i.y,_ref64=(K=n.parent)==null?void 0:K.parent,u=_ref64.width,d=_ref64.height,v=Os(e.text),p=v.length,w=e.fontSize,A=e.lineHeight,M=e.bold,E=e.textAlign,L=e.italic,G=e.fontFamily,z=e.verticalAlign,et=e.fontColor,x=e.fontBgColor,y=e.underline,S=e.lineThrough,C=Hi.getSafetySnippetRatio(n)||1,P=Math.floor(w*C),X=Hi.getSafetySnippetFontLength(P);$=0;j=0;case 1:if(!(j<p)){_context19.n=7;break;}nt=v[j],ct=A||P*1.5;if(!nt){_context19.n=6;break;}F=qPt(nt),R=[0,0],Y=[0,w*1.2];z==="middle"&&(R[1]=Math.floor(j*w*1.2+6+w*(1.1-1)));q=[0,Math.floor(-w*0.15)];R[0]=6;lt=Math.sin(Math.PI/180*20);ut=0;Tt=[];O=0;case 2:if(!(O<F)){_context19.n=5;break;}E==="left"&&(q[0]=ut),O===0&&L==="italic"&&(q[0]=q[0]-lt/2*w);_=nt.slice(O,O+X);H={anchor:[0,0],pos:q,text:_,fontFamily:G,fontSize:P,lineHeight:ct,strokeColor:et,fontWeight:M,fillColor:et,textAlign:E,fontStyle:L,scale:[1/C,1/C]};at=new t0(H);_context19.n=3;return at.textImageReady;case 3:ht=_context19.v;yt=!0;if(ht){Et=ht.rect&&ht.rect[2],Dt=ht.rect&&ht.rect[3];if(Et&&Dt){D=Et/C,N=Dt/C;ut=D+ut,L==="italic"&&(M==="bold"?ut=ut-lt*w*1.2:ut=ut-lt*w),((q[0]+R[0]+D)*n.worldScaling[0]+o<=0||(q[0]+R[0])*n.worldScaling[0]+o>=u||(q[1]+R[1]+N)*n.worldScaling[1]+a<=0||(q[1]+R[1])*n.worldScaling[1]+a>=d)&&(at.disconnect(),yt=!1),yt&&Tt.push(at);}}O+=X;case 4:_context19.n=2;break;case 5:Y[0]=ut,L==="italic"&&(Y[0]=Y[0]+lt*w),$=Math.max($,Y[0]);U=!0;if(((R[0]+Y[0])*n.worldScaling[0]+o<=0||R[0]*n.worldScaling[0]+o>=u||(R[1]+Y[1])*n.worldScaling[0]+a<=0||R[1]*n.worldScaling[1]+a>=d)&&(U=!1),U){if(y){_at2=Math.floor(w/10),_ht2={normalize:!1,pos:[0,w*1.1+_at2/2],lineWidth:_at2,points:[0,0,Math.ceil(Y[0]),0],strokeColor:et,className:"underline"},_yt2=new Un(_ht2);Tt.push(_yt2);}if(S){_at3={normalize:!1,pos:[0,w*1.2/2],lineWidth:Math.floor(w/10),points:[0,0,Math.ceil(Y[0]),0],strokeColor:et,className:"lineThrough"},_ht3=new Un(_at3);Tt.push(_ht3);}_10={pos:R,anchor:[0,0],size:Y,bgcolor:x},_H2=new ar(_10);_H2.append.apply(_H2,Tt),s.push(_H2);}case 6:j++;_context19.n=1;break;case 7:return _context19.a(2,{labels:s,maxWidth:$});}},_callee18);}));function createLabels(_x28,_x29,_x30){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(e){var n=e.node,i=e.opt,s=e.vNodes,o=e.targetNode,a=i.fontBgColor,u=i.fontColor,d=i.translate,v=i.originPoint,p=i.scenePoint,w=i.scale,A=i.bold,M=i.italic,E=i.lineThrough,L=i.underline,G=i.fontSize,z=i.textInfos,et=i.zIndex,x=o&&br(o)||s.get(n.name);if(!x||!n.parent)return;var S=x.opt;if(Ze(et)&&(n.setAttribute("zIndex",et),x.opt.zIndex=et),u&&S.fontColor&&(S.fontColor=u,n.children.forEach(function(C){C.tagName==="GROUP"&&C.children.forEach(function(P){P.tagName==="LABEL"?(P.setAttribute("fillColor",u),P.setAttribute("strokeColor",u)):P.tagName==="POLYLINE"&&P.setAttribute("strokeColor",u);});})),a&&S.fontBgColor&&(S.fontBgColor=a,n.children.forEach(function(C){C.tagName==="GROUP"&&C.setAttribute("bgcolor",a);})),A&&(S.bold=A),M&&(S.italic=M),bs(E)&&(S.lineThrough=E),bs(L)&&(S.underline=L),G&&(S.fontSize=G),v&&p&&w&&o&&S.boxPoint){var C=z==null?void 0:z.get(n.name);if(C){var K=C.fontSize,j=C.boxSize;S.boxSize=j||S.boxSize,S.fontSize=K||S.fontSize;}var P=[S.boxPoint[0],S.boxPoint[1]];uf(S.boxPoint,p,w,d);var X=[x.op[0],x.op[1]],$=[X[0]-P[0],X[1]-P[1]];if(x.centerPos=[x.centerPos[0]+$[0],x.centerPos[1]+$[1]],x.opt.eraserlines){var _iterator48=_createForOfIteratorHelper(x.opt.eraserlines),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var _K13=_step48.value;var _j3=_K13.op,nt=_K13.thickness;_K13.thickness=Math.round(nt*Math.max(w[0],w[1]));for(var ct=0;ct<_j3.length;ct++)Fa(_j3[ct],p,w,d);}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}}}else if(d&&S.boxPoint&&(S.boxPoint=[Math.round(S.boxPoint[0]+d[0]),Math.round(S.boxPoint[1]+d[1])],x.centerPos=[x.centerPos[0]+d[0],x.centerPos[1]+d[1]],x.opt.eraserlines)){var _iterator49=_createForOfIteratorHelper(x.opt.eraserlines),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _C7=_step49.value;var _P7=_C7.op;for(var _X13=0;_X13<_P7.length;_X13++){var _$12=_P7[_X13].map(function(K,j){return j%2?K+d[1]:K+d[0];});_C7.op[_X13]=_$12;}}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}}return x&&s.setInfo(n.name,x),x==null?void 0:x.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(e,n){var i=e.getElementsByName(n)[0];if(i){var s=i.getBoundingClientRect();var o={x:Math.floor(s.x),y:Math.floor(s.y),w:Math.floor(s.width+2),h:Math.floor(s.height+2)};return i.children.forEach(function(a){if(a.tagName==="GROUP"){var u=i.getBoundingClientRect();o=Jt(o,{x:Math.floor(u.x),y:Math.floor(u.y),w:Math.floor(u.width+2),h:Math.floor(u.height+2)});}}),o;}}}]);}(jt);// 4k
|
|
481
|
+
wt(Hi,"textImageSnippetSize",1024*4),wt(Hi,"SafeBorderPadding",30);var Ha=Hi;var kPt=0.01;function HS(r,t){var _e$protectedIndex,_e$timestamp;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=r.length-1;var i=(_e$protectedIndex=e.protectedIndex)!==null&&_e$protectedIndex!==void 0?_e$protectedIndex:-1,s=(_e$timestamp=e.timestamp)!==null&&_e$timestamp!==void 0?_e$timestamp:Date.now();for(var o=0;o<t.length;o+=2){var a=new _t(t[o],t[o+1]),u=r[r.length-1];if(!u){a.setT(s),r.push(a);continue;}if(a.x===u.x&&a.y===u.y){u.setT(s);continue;}var d=r.length-1;if(r.length>1&&d>i){var p=r[d-1],w=Ct.Sub(u,p).uni(),A=Ct.Sub(a,u).uni();Number.isFinite(w.x)&&Number.isFinite(w.y)&&Number.isFinite(A.x)&&Number.isFinite(A.y)&&Ct.Equals(w,A,kPt)&&(r.pop(),n--);}var v=r[r.length-1];a.setv(Ct.Sub(a,v).uni()),a.setT(s),r.push(a);}return Math.max(n,0);}var bo=/*#__PURE__*/function(_jt12){function bo(e){var _this62;_classCallCheck(this,bo);_this62=_callSuper(this,bo,[e]);wt(_this62,"canRotate",!1);wt(_this62,"scaleType",be.none);wt(_this62,"toolsType",It.PencilEraser);wt(_this62,"tmpPoints",[]);wt(_this62,"workOptions");wt(_this62,"worldPosition");wt(_this62,"worldScaling");wt(_this62,"eraserRect");wt(_this62,"eraserPolyline");_this62.workOptions=e.toolsOpt,_this62.worldPosition=_this62.fullLayer.worldPosition,_this62.worldScaling=_this62.fullLayer.worldScaling;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(bo,_jt12);return _createClass(bo,[{key:"combineConsume",value:function combineConsume(e){var n=e.workerEngine;if(this.tmpPoints.length===0)return{type:xt.None};var i=this.workOptions.thickness,_bo$eraserSizes$i=bo.eraserSizes[i],s=_bo$eraserSizes$i.width,o=_bo$eraserSizes$i.height,a=Math.round(Math.max(s,o)/this.worldScaling[0]),_this$getChangeNodes=this.getChangeNodes(a,n),u=_this$getChangeNodes.rect,d=_this$getChangeNodes.willNewNodes,v=_this$getChangeNodes.willDeleteNodes;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,rect:u,willNewNodes:d,willDeleteNodes:v});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(e,n){return HS(this.tmpPoints,e);}},{key:"getChangeNodes",value:function getChangeNodes(e,n){var i=/* @__PURE__ */new Map(),s=/* @__PURE__ */new Set();var o;if(!this.vNodes)return{willDeleteNodes:s,willNewNodes:i,rect:o};var a=this.worldPosition;var u=$e(this.tmpPoints,e);u=Za(u,a),u=qS(u,this.worldScaling,a);var _this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(u),d=_this$vNodes$getRectI3.nodeRange;if(!d.size)return{willDeleteNodes:s,willNewNodes:i,rect:o};var v=this.computEraserPointLines(this.tmpPoints,90);var _iterator50=_createForOfIteratorHelper(d.entries()),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var _step50$value=_slicedToArray(_step50.value,2),p=_step50$value[0],w=_step50$value[1];if(w.toolsType!==It.Pencil)continue;var A=Za(w.rect,[-a[0],-a[1]]);A={x:A.x/this.worldScaling[0],y:A.y/this.worldScaling[1],w:A.w/this.worldScaling[0],h:A.h/this.worldScaling[1]};var M=[A.x,A.y,A.x+A.w,A.y+A.h],E=[],L=[];var _iterator51=_createForOfIteratorHelper(v),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var _G6=_step51.value;g0.polyline(_G6,M,E);}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}if(E.length&&w.opt){var _iterator52=_createForOfIteratorHelper(E),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var G=_step52.value;var z=[];for(var et=0;et<G.length;et++)et!==0&&qn(G[et],G[et-1])||z.push.apply(z,_toConsumableArray(G[et]));L.push(z);}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}}if(L.length&&n){var _G5=n.createWorkShapeNode({workId:p,toolsType:It.Pencil,toolsOpt:w.opt});_G5.setWorkId(p);var _z3=_G5==null?void 0:_G5.computPencilPoints({op:w.op,eraserPolylines:L,eraserThickness:e});if(o=Jt(o,w.rect),s.add(p),n.removeNode(p),_z3.length)for(var _et3=0;_et3<_z3.length;_et3++){var x="".concat(p,"_").concat(Date.now(),"_").concat(_et3),y=x,C=n.setFullWork({workId:y,opt:w.opt,toolsType:It.Pencil}).consumeService({op:_z3[_et3],isFullWork:!0,replaceId:y});n.clearWorkShapeNodeCache(y),o=Jt(o,C),i.set(x,_objectSpread(_objectSpread({},w),{},{toolsType:It.Pencil,rect:C!==null&&C!==void 0?C:w.rect,name:x,op:_z3[_et3]}));}}}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}return{willNewNodes:i,willDeleteNodes:s,rect:o};}},{key:"consume",value:function consume(e){var n=e.data,i=n.op;if(!i||i.length===0)return _objectSpread({type:xt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_bo$eraserSizes$s=bo.eraserSizes[s],o=_bo$eraserSizes$s.width,a=_bo$eraserSizes$s.height,u=Math.max(o,a)/this.worldScaling[0];return this.updateTempPoints(i,u),_objectSpread({type:xt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var i=[];var s=0;var o=360-n;for(var a=1;a<e.length;a++){var u=e[a-1],d=e[a];if(a===1&&s===0&&(i[s]=[u.XY]),i[s].push(d.XY),a<e.length-1){var v=d.getAngleByPoints(u,e[a+1]);(v<n||v>o)&&(s++,i[s]=[d.XY]);}}return e.length===1&&i.length===0&&i.push([e[0].XY,e[0].XY]),i;}},{key:"consumeAll",value:function consumeAll(e){var n=e.workerEngine;if(this.replace(this.fullLayer,this.workId),!this.tmpPoints.length)return _objectSpread({type:xt.None},this.baseConsumeResult);var i=this.workOptions.thickness,_bo$eraserSizes$i2=bo.eraserSizes[i],s=_bo$eraserSizes$i2.width,o=_bo$eraserSizes$i2.height,a=Math.max(s,o)/this.worldScaling[0],_this$getChangeNodes2=this.getChangeNodes(a,n),u=_this$getChangeNodes2.willDeleteNodes,d=_this$getChangeNodes2.willNewNodes,v=_this$getChangeNodes2.rect;if(u.size===0&&d.size===0)return _objectSpread(_objectSpread({type:xt.FullWork},this.baseConsumeResult),{},{rect:v});var p=[];this.tmpPoints.map(function(A){p.push(A.x,A.y,a/2);});var w=Br(p);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.FullWork,dataType:Kt.Local,rect:v,ops:w,willNewNodes:d,willDeleteNodes:u});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(jt);// 来源于white-sdk
|
|
482
|
+
wt(bo,"eraserSizes",v0);var yu=bo;It.Image,It.BackgroundSVG;It.Polygon,It.Star,It.Star,It.Star,It.SpeechBalloon;It.Pencil,It.LaserPen,It.Arrow,It.Straight;It.Rectangle,It.Ellipse,It.Triangle,It.Rhombus,It.Polygon,It.Star,It.SpeechBalloon;var FPt=/* @__PURE__ */new Set([It.Pencil,It.Arrow,It.Straight,It.Rectangle,It.Ellipse,It.Star,It.Triangle,It.Rhombus,It.Polygon,It.SpeechBalloon]);function WPt(r){return r!==void 0&&FPt.has(r);}It.Pencil;It.LaserPen,It.Arrow,It.Straight,It.Rectangle,It.Ellipse,It.Star,It.Polygon,It.SpeechBalloon;function UPt(r,t,e){var n=r-(e?1:2);if(!(n<1||n<=t))return{start:Math.max(t,0),end:n,committedIndex:n};}var Mo=/*#__PURE__*/function(_jt13){function Mo(e){var _this63;_classCallCheck(this,Mo);_this63=_callSuper(this,Mo,[e]);wt(_this63,"canRotate",!1);wt(_this63,"scaleType",be.none);wt(_this63,"toolsType",It.BitMapEraser);wt(_this63,"tmpPoints",[]);wt(_this63,"workOptions");wt(_this63,"worldPosition");wt(_this63,"worldScaling");wt(_this63,"eraserRect");wt(_this63,"eraserPolyline");wt(_this63,"oldRect");wt(_this63,"committedPointIndex",-1);wt(_this63,"changedNodes",/* @__PURE__ */new Map());wt(_this63,"doingLines",/* @__PURE__ */new Map());wt(_this63,"doingTransformDisposers",/* @__PURE__ */new Map());wt(_this63,"deletedNodes",/* @__PURE__ */new Set());wt(_this63,"changedRect");_this63.workOptions=e.toolsOpt,_this63.worldPosition=_this63.fullLayer.worldPosition,_this63.worldScaling=_this63.fullLayer.worldScaling;return _this63;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Mo,_jt13);return _createClass(Mo,[{key:"combineConsume",value:function combineConsume(e){var n=e.workerEngine,i=this.getDeltaPoints(!0);if(!i)return{type:xt.None};var s=this.workOptions.thickness,_Mo$eraserSizes$s=Mo.eraserSizes[s],o=_Mo$eraserSizes$s.width,a=_Mo$eraserSizes$s.height,u=Math.round(Math.max(o,a)/this.worldScaling[0]),_this$getChangeNodes3=this.getChangeNodes(i.points,u,n),d=_this$getChangeNodes3.willDeleteNodes,v=_this$getChangeNodes3.rect;return this.committedPointIndex=i.committedIndex,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.DrawWork,rect:v,willDeleteNodes:d});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(e,n){return HS(this.tmpPoints,e,{protectedIndex:this.committedPointIndex});}},{key:"getChangeNodes",value:function getChangeNodes(e,n,i){var _this64=this;var s=/* @__PURE__ */new Map(),o=/* @__PURE__ */new Set();var a;if(!this.vNodes)return{willDeleteNodes:o,willUpdateNodes:s,rect:a};var u=this.worldPosition;var d=$e(e,n);d=Za(d,u),d=qS(d,this.worldScaling,u);var _this$vNodes$getRectI4=this.vNodes.getRectIntersectRange(d),v=_this$vNodes$getRectI4.nodeRange;if(!v.size)return{willDeleteNodes:o,willUpdateNodes:s,rect:a};var p=this.computEraserPointLines(e,120);var _iterator53=_createForOfIteratorHelper(v.entries()),_step53;try{var _loop6=function _loop6(){var _et$op;var _step53$value=_slicedToArray(_step53.value,2),w=_step53$value[0],A=_step53$value[1];if(!WPt(A.toolsType))return 0;// continue
|
|
483
483
|
var M=Za(A.rect,[-u[0],-u[1]]);M={x:M.x/_this64.worldScaling[0],y:M.y/_this64.worldScaling[1],w:M.w/_this64.worldScaling[0],h:M.h/_this64.worldScaling[1]};var E=[M.x,M.y,M.x+M.w,M.y+M.h],L=[],G=[];var _iterator54=_createForOfIteratorHelper(p),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var _x32=_step54.value;g0.polyline(_x32,E,L);}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}if(L.length&&A.opt){var _iterator55=_createForOfIteratorHelper(L),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var x=_step55.value;var y=[];for(var S=0;S<x.length&&!(isNaN(x[S][0])||isNaN(x[S][1]));S++){var C=x[S].map(function(P){return Math.round(P*100)/100;});if(S!==0){var P=x[S-1].map(function(X){return Math.round(X*100)/100;});if(qn(C,P))continue;}y.push.apply(y,_toConsumableArray(C));}y.length!==0&&G.push(y);}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}}if(!G.length)return 0;// continue
|
|
484
|
-
var z=_this64.doingLines.get(w);z||(z=[],_this64.doingLines.set(w,z),_this64.vNodes&&_this64.doingTransformDisposers.set(w,ygt(_this64.vNodes,w,function(x){var y=_this64.doingLines.get(w);y&&Sgt(y,x);},function(){_this64.doingLines.delete(w),_this64.changedNodes.delete(w);})));var et=z.find(function(x){return x.workId===_this64.workId;});if(et?(_et$op=et.op).push.apply(_et$op,G):z.push({workId:_this64.workId,op:G,thickness:n}),i){var _x31=A.toolsType,_y5=i.createWorkShapeNode({workId:w,toolsType:_x31,toolsOpt:_objectSpread(_objectSpread({},A.opt),{},{doingLines:z})});_y5==null||_y5.setWorkId(w);var _S1=_y5==null?void 0:_y5.consumeService({op:A.op,isFullWork:!0,replaceId:w});a=Jt(a,_S1);}s.set(w,A),_this64.changedNodes.set(w,A);},_ret;for(_iterator53.s();!(_step53=_iterator53.n()).done;){_ret=_loop6();if(_ret===0)continue;}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}return this.changedRect=Jt(this.changedRect,a),{willUpdateNodes:s,willDeleteNodes:o,rect:a};}},{key:"consume",value:function consume(e){var n=e.data,i=n.op;if(!i||i.length===0)return _objectSpread({type:xt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_Mo$eraserSizes$s2=Mo.eraserSizes[s],o=_Mo$eraserSizes$s2.width,a=_Mo$eraserSizes$s2.height,u=Math.round(Math.max(o,a)/this.worldScaling[0]);return this.updateTempPoints(i,u),_objectSpread({type:xt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var i=[];var s=0;var o=360-n;for(var a=1;a<e.length;a++){var u=e[a-1],d=e[a];if(a===1&&s===0&&(i[s]=[u.XY]),i[s].push(d.XY),a<e.length-1){var v=d.getAngleByPoints(u,e[a+1]);(v<n||v>o)&&(s++,i[s]=[d.XY]);}}return e.length===1&&i.length===0&&i.push([e[0].XY,e[0].XY]),i;}},{key:"consumeAll",value:function consumeAll(e){var n=e.workerEngine;if(this.replace(this.fullLayer,this.workId),!this.tmpPoints.length)return _objectSpread({type:xt.None},this.baseConsumeResult);var i=this.workOptions.thickness,_Mo$eraserSizes$i=Mo.eraserSizes[i],s=_Mo$eraserSizes$i.width,o=_Mo$eraserSizes$i.height,a=Math.round(Math.max(s,o)/this.worldScaling[0]),u=this.getDeltaPoints(!0);u&&(this.getChangeNodes(u.points,a,n),this.committedPointIndex=u.committedIndex),this.commitDoingFaces(),this.workOptions.removeOnDone!==!1&&this.confirmChangedNodeDeletions(n);var d=new Set(this.deletedNodes),v=new Map(this.changedNodes),p=this.changedRect;if(d.size===0&&v.size===0)return _objectSpread(_objectSpread({type:xt.FullWork},this.baseConsumeResult),{},{rect:p});var w=[];this.tmpPoints.map(function(M){w.push(M.x,M.y,a/2);});var A=Br(w);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.FullWork,dataType:Kt.Local,rect:p,ops:A,willUpdateNodes:v,willDeleteNodes:d});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.committedPointIndex=-1,this.changedNodes.clear(),this.doingLines.clear();var _iterator56=_createForOfIteratorHelper(this.doingTransformDisposers.values()),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var e=_step56.value;e();}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}this.doingTransformDisposers.clear(),this.deletedNodes.clear(),this.changedRect=void 0;}},{key:"commitDoingFaces",value:function commitDoingFaces(){var e,n;var _iterator57=_createForOfIteratorHelper(this.doingLines),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _step57$value=_slicedToArray(_step57.value,2),i=_step57$value[0],s=_step57$value[1];var o=((e=this.vNodes)==null?void 0:e.get(i))||this.changedNodes.get(i);if(!(o!=null&&o.opt)||!s.length)continue;var a=Tgt(o.opt,s),u=_objectSpread(_objectSpread({},o.opt),a);delete u.eraserlines,o.opt=u,this.changedNodes.set(i,o),(n=this.vNodes)==null||n.setInfo(i,{opt:u});}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}}},{key:"confirmChangedNodeDeletions",value:function confirmChangedNodeDeletions(e){if(e)for(var _i7=0,_arr=_toConsumableArray(this.changedNodes);_i7<_arr.length;_i7++){var _arr$_i=_slicedToArray(_arr[_i7],2),n=_arr$_i[0],i=_arr$_i[1];var s=e.createWorkShapeNode({workId:n,toolsType:i.toolsType,toolsOpt:i.opt});s==null||s.setWorkId(n),s==null||s.setEraserDeleteConfirmation(!0);var o=s==null?void 0:s.consumeService({op:i.op,isFullWork:!0,replaceId:n});this.changedRect=Jt(this.changedRect,o),s!=null&&s.isDelete&&(e.removeNode(n),this.deletedNodes.add(n),this.changedNodes.delete(n));}}},{key:"getDeltaPoints",value:function getDeltaPoints(e){var n=
|
|
485
|
-
wt(Mo,"eraserSizes",v0);var wu=Mo;var Va=/*#__PURE__*/function(_jt14){function Va(e){var _this65;_classCallCheck(this,Va);_this65=_callSuper(this,Va,[e]);wt(_this65,"canRotate",!1);wt(_this65,"scaleType",be.all);wt(_this65,"toolsType",It.BackgroundSVG);wt(_this65,"tmpPoints",[]);wt(_this65,"workOptions");wt(_this65,"oldRect");_this65.workOptions=e.toolsOpt,_this65.scaleType=Va.getScaleType(_this65.workOptions);return _this65;}_inherits(Va,_jt14);return _createClass(Va,[{key:"consume",value:function consume(){return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:xt.None};}},{key:"draw",value:function draw(e){var n=e.layer,i=e.workId,s=e.replaceId,_this$workOptions15=this.workOptions,o=_this$workOptions15.centerX,a=_this$workOptions15.centerY,u=_this$workOptions15.width,d=_this$workOptions15.height,v=_this$workOptions15.rotate,p=_this$workOptions15.zIndex,w=(p||0)-100,A=new ar({anchor:[0.5,0.5],pos:[o,a],name:i,size:[u,d],zIndex:w,rotate:v}),M=new ja({normalize:!0,pos:[0,0],width:u,height:d});A.appendChild(M),this.replace(n,s||i,A);var E=A.getBoundingClientRect();if(E)return{x:Math.floor(E.x-jt.SafeBorderPadding),y:Math.floor(E.y-jt.SafeBorderPadding),w:Math.floor(E.width+jt.SafeBorderPadding*2),h:Math.floor(E.height+jt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(e){var o;var n=e.replaceId,i=this.workId,s=this.draw({workId:i,layer:this.fullLayer,replaceId:n});return(o=this.vNodes)==null||o.setInfo(i,{rect:s,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&jt.getCenterPos(s,this.fullLayer)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return jt.normalizeStorageData(e);}},{key:"getScaleType",value:function getScaleType(e){var n=e.uniformScale,i=e.rotate;return n!==!1||i&&Math.abs(i)%90>0?be.proportional:be.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var n=e.node,i=e.opt,s=e.vNodes,o=e.targetNode,a=i.translate,u=i.originPoint,d=i.scenePoint,v=i.scale,p=i.angle,w=i.isLocked,A=i.zIndexForBackgroundSVG,M=o&&br(o)||s.get(n.name);if(!M)return;var E=n.parent;if(E){if(Ze(A)){var L=(A||0)-100;n.setAttribute("zIndex",L),M.opt.zIndex=A;}if(bs(w)&&(M.opt.locked=w),u&&d&&v&&a){var _M$opt=M.opt,_L15=_M$opt.centerX,G=_M$opt.centerY,z=_M$opt.width,et=_M$opt.height,x=_M$opt.uniformScale,y=x!==!1?[v[0],v[0]]:v,S=[_L15,G],C=[_L15,G];uf(C,d,y,a);var P=[C[0]-S[0],C[1]-S[1]];M.centerPos=[M.centerPos[0]+P[0],M.centerPos[1]+P[1]],M.opt.width=Math.round(z*y[0]),M.opt.height=Math.round(et*y[1]),M.opt.centerX=C[0],M.opt.centerY=C[1];}else if(a)M.opt.centerX=M.opt.centerX+a[0],M.opt.centerY=M.opt.centerY+a[1],M.centerPos=[M.centerPos[0]+a[0],M.centerPos[1]+a[1]];else if(Ze(p))if(M.opt.rotate=p,M.scaleType=Va.getScaleType(M.opt),o){var _L16=T0(M.rect,p);M.rect=_L16;}else{var _L17=jt.getRectFromLayer(E,n.name);M.rect=_L17||M.rect;}return M&&s.setInfo(n.name,M),M==null?void 0:M.rect;}}}]);}(jt);function VS(r){switch(r){case It.Arrow:return PS;case It.Pencil:return IS;case It.Straight:return OS;case It.Ellipse:return AS;case It.Polygon:case It.Triangle:return ES;case It.Star:case It.Rhombus:return MS;case It.Rectangle:return bS;case It.SpeechBalloon:return LS;case It.Text:return Ha;case It.LaserPen:return TS;case It.Eraser:return pu;case It.PencilEraser:return yu;case It.BitMapEraser:return wu;case It.Selector:return Xa;case It.Image:return Ga;case It.BackgroundSVG:return Va;}}function cf(r,t){var e=r.toolsType,n=_objectWithoutProperties(r,_excluded2);switch(e){case It.Arrow:return new PS(n);case It.Pencil:return new IS(n);case It.Straight:return new OS(n);case It.Ellipse:return new AS(n);case It.Polygon:case It.Triangle:return new ES(n);case It.Star:case It.Rhombus:return new MS(n);case It.Rectangle:return new bS(n);case It.SpeechBalloon:return new LS(n);case It.Text:return new Ha(n);case It.LaserPen:return new TS(n);case It.Eraser:return new pu(n,t);case It.BitMapEraser:return new wu(n);case It.PencilEraser:return new yu(n);case It.Selector:return n.vNodes?new Xa(_objectSpread(_objectSpread({},n),{},{vNodes:n.vNodes,drawLayer:n.fullLayer})):void 0;case It.Image:return new Ga(n);case It.BackgroundSVG:return new Va(_objectSpread(_objectSpread({},n),{},{toolsOpt:n.toolsOpt}));default:return;}}function ZS(r){var t=[],e=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL","SPRITESVG"];var _iterator58=_createForOfIteratorHelper(r),_step58;try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){var n=_step58.value;if(n.tagName==="GROUP"&&n.children.length){var i=ZS(n.children);t.push.apply(t,_toConsumableArray(i));}n.tagName&&e.includes(n.tagName)&&t.push(n);}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}return t;}function Jt(r,t){if(r&&t){var e=Math.min(r.x,t.x),n=Math.min(r.y,t.y),i=Math.max(r.x+r.w,t.x+t.w),s=Math.max(r.y+r.h,t.y+t.h),o=i-e,a=s-n;return{x:e,y:n,w:o,h:a};}return t||r;}function $e(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e={x:0,y:0,w:0,h:0};var n=1/0,i=1/0,s=-1/0,o=-1/0;return r.forEach(function(a){var _a$XY=_slicedToArray(a.XY,2),u=_a$XY[0],d=_a$XY[1];n=Math.min(n,u-t),i=Math.min(i,d-t),s=Math.max(s,u+t),o=Math.max(o,d+t);}),e.x=n,e.y=i,e.w=s-n,e.h=o-i,e;}function Su(r,t){return!(r.x+r.w<t.x||r.x>t.x+t.w||r.y+r.h<t.y||r.y>t.y+t.h);}function me(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(r.x-t),y:Math.floor(r.y-t),w:Math.ceil(r.w+t*2),h:Math.ceil(r.h+t*2)};}function Za(r,t){return{x:r.x+t[0],y:r.y+t[1],w:r.w,h:r.h};}function WPt(r,t){var e=new Ct(r.x,r.y),n=new Ct(r.x+r.w,r.y),i=new Ct(r.x+r.w,r.y+r.h),s=new Ct(r.x,r.y+r.h),o=new Ct(r.x+r.w/2,r.y+r.h/2),a=Math.PI*t/180,u=Ct.RotWith(e,o,a),d=Ct.RotWith(n,o,a),v=Ct.RotWith(i,o,a),p=Ct.RotWith(s,o,a);return[u,d,v,p];}function T0(r,t){var e=WPt(r,t);return $e(e);}function qS(r,t,e){var n=new Ct(r.x,r.y),i=new Ct(r.x+r.w,r.y),s=new Ct(r.x+r.w,r.y+r.h),o=new Ct(r.x,r.y+r.h),a=new Ct(e[0],e[1]),u=new Ct(t[0],t[1]),d=Ct.ScaleWOrigin(n,u,a),v=Ct.ScaleWOrigin(i,u,a),p=Ct.ScaleWOrigin(s,u,a),w=Ct.ScaleWOrigin(o,u,a);return $e([d,v,p,w]);}function UPt(r,t,e){var n=new Ct(t[0],t[1]);for(var i=0;i<r.length;i+=3){var s=new Ct(r[i],r[i+1]),o=Math.PI*e/180,a=Ct.RotWith(s,n,o);r[i]=a.x,r[i+1]=a.y;}}function y1(r,t,e){var n=new Ct(t[0],t[1]);for(var i=0;i<r.length;i+=2){var s=new Ct(r[i],r[i+1]),o=Math.PI*e/180,a=Ct.RotWith(s,n,o);r[i]=a.x,r[i+1]=a.y;}}function uf(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var i=new Ct(t[0],t[1]);for(var s=0;s<r.length;s+=3){var o=new Ct(r[s],r[s+1]),a=new Ct(e[0],e[1]),u=Ct.ScaleWOrigin(o,a,i);r[s]=u.x+n[0],r[s+1]=u.y+n[1];}}function Fa(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var i=new Ct(t[0],t[1]);for(var s=0;s<r.length;s+=2){var o=new Ct(r[s],r[s+1]),a=new Ct(e[0],e[1]),u=Ct.ScaleWOrigin(o,a,i);r[s]=u.x+n[0],r[s+1]=u.y+n[1];}}function zPt(r,t){return r[0]>=t.x&&r[0]<=t.x+t.w&&r[1]>=t.y&&r[1]<=t.y+t.h;}function KS(r,t){var e=r<=t?1:r/t,n=t<=r?1:t/r;return[e,n];}function $Pt(r){var _iterator59=_createForOfIteratorHelper(r),_step59;try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){var t=_step59.value;if(isNaN(t)||t===1/0||t===-1/0)return!1;}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}return!0;}function YPt(r){return r!==Math.floor(r);}function jPt(r){var t=r.toString();return t.indexOf(".")!==-1?t.split(".")[1].length:0;}function XPt(r,t){for(;t!==0;){var _ref65=[t,r%t];r=_ref65[0];t=_ref65[1];}return r;}var GPt=function GPt(r){if(r.tagName==="GROUP"){var t=Object.getOwnPropertySymbols(r).find(function(e){return e.toString()==="Symbol(sealed)";});if(t&&r[t])return!0;}return!1;},_Ur=function Ur(r,t){if(r.mesh&&r.mesh.texture&&r.name==="eraserTexture"){var e=r.mesh.texture.image;t.deleteTexture(e);}else if(r.tagName==="GROUP"&&r&&r.children){var _iterator60=_createForOfIteratorHelper(r.children),_step60;try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){var _e8=_step60.value;_Ur(_e8,t);}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}}},qr=function qr(r,t){_Ur(r,t),r.removeAllChildren();},HPt=function HPt(r,t,e){var n=e.parent;if(t){var i=t.children;if(i){var _iterator61=_createForOfIteratorHelper(i),_step61;try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){var s=_step61.value;if(_Ur(s,n),s.tagName==="GROUP"){var _iterator62=_createForOfIteratorHelper(s.children),_step62;try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){var o=_step62.value;_Ur(o,n);}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}}}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}}}t.parent.replaceChild(r,t);},QS=function QS(r,t,e){if(r.w+r.x<=0||r.h+r.y<=0||r.w<=0||r.h<=0)return;var n=t.width,i=t.height,s={x:Math.floor(Math.max(0,r.x)),y:Math.floor(Math.max(0,r.y)),w:Math.floor(Math.min(n,r.w)),h:Math.floor(Math.min(i,r.h))};if(s.x+s.w>n&&(s.w=Math.floor(n-s.x)),s.y+s.h>i&&(s.h=Math.floor(i-s.y)),YPt(e)){var o=jPt(e),a=Math.pow(10,o),u=XPt(a,e*a),d=s.x%u,v=s.x-d;v>=0?(s.x=v,s.w=s.w+d):(s.x=0,s.w=s.w+d-v);var p=s.y%u,w=s.y-p;w>=0?(s.y=w,s.h=s.h+p):(s.y=0,s.h=s.h+p-w);}return s;};function yo(r){return"".concat(Iu(r.x),",").concat(Iu(r.y)," ");}function wo(r,t){return"".concat(Iu((r.x+t.x)/2),",").concat(Iu((r.y+t.y)/2)," ");}function Iu(r){return+r.toFixed(4);}var qa=function qa(r,t){return r.x+r.w<t.x||r.x>t.x+t.w||r.y+r.h<t.y||r.y>t.y+t.h?Ji.outside:r.x>=t.x&&r.y>=t.y&&r.x+r.w<=t.x+t.w&&r.y+r.h<=t.y+t.h?Ji.inside:Ji.intersect;};function VPt(r){var t=0;for(var e=0;e<r.length;e++){var n=r.charCodeAt(e);n>=1&&n<=126||65376<=n&&n<=65439?t++:t+=2;}return t;}var w1=/*#__PURE__*/function(){function w1(t){_classCallCheck(this,w1);wt(this,"_map");wt(this,"_observers",/* @__PURE__ */new Set());this._map=new Map(t);}return _createClass(w1,[{key:"notifyObservers",value:function notifyObservers(t,e,n){var _iterator63=_createForOfIteratorHelper(this._observers),_step63;try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){var i=_step63.value;i(t,e,n);}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}}},{key:"observe",value:function observe(t){this._observers.add(t);}},{key:"unobserve",value:function unobserve(t){this._observers.delete(t);}},{key:"get",value:function get(t){return this._map.get(t);}},{key:"set",value:function set(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var i=this._map.has(t)?"update":"add";return this._map.set(t,e),n&&this.notifyObservers(i,t,e),this;}},{key:"has",value:function has(t){return this._map.has(t);}},{key:"delete",value:function _delete(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var n=this._map.get(t),i=this._map.delete(t);return e&&n&&this.notifyObservers("delete",t,n),i;}},{key:"clear",value:function clear(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=this._map.keys();if(this._map.clear(),t){var _iterator64=_createForOfIteratorHelper(e),_step64;try{for(_iterator64.s();!(_step64=_iterator64.n()).done;){var n=_step64.value;this.notifyObservers("clear",n,void 0);}}catch(err){_iterator64.e(err);}finally{_iterator64.f();}}}},{key:"size",get:function get(){return this._map.size;}},{key:"keys",value:function keys(){return this._map.keys();}},{key:"values",value:function values(){return this._map.values();}},{key:"entries",value:function entries(){return this._map.entries();}},{key:"forEach",value:function forEach(t,e){this._map.forEach(t,e);}}]);}();function JS(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:r.length-1;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:ZPt;for(;n>e;){if(n-e>600){var u=n-e+1,d=t-e+1,v=Math.log(u),p=0.5*Math.exp(2*v/3),w=0.5*Math.sqrt(v*p*(u-p)/u)*(d-u/2<0?-1:1),A=Math.max(e,Math.floor(t-d*p/u+w)),M=Math.min(n,Math.floor(t+(u-d)*p/u+w));JS(r,t,A,M,i);}var s=r[t];var o=e,a=n;for(Aa(r,e,t),i(r[n],s)>0&&Aa(r,e,n);o<a;){for(Aa(r,o,a),o++,a--;i(r[o],s)<0;)o++;for(;i(r[a],s)>0;)a--;}i(r[e],s)===0?Aa(r,e,a):(a++,Aa(r,a,n)),a<=t&&(e=a+1),t<=a&&(n=a-1);}}function Aa(r,t,e){var n=r[t];r[t]=r[e],r[e]=n;}function ZPt(r,t){return r<t?-1:r>t?1:0;}var qPt=/*#__PURE__*/function(){function qPt(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:9;_classCallCheck(this,qPt);this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*0.4)),this.clear();}return _createClass(qPt,[{key:"all",value:function all(){return this._all(this.data,[]);}},{key:"search",value:function search(t){var e=this.data;var n=[];if(!jc(t,e))return n;var i=this.toBBox,s=[];for(;e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],u=e.leaf?i(a):a;jc(t,u)&&(e.leaf?n.push(a):Ad(t,u)?this._all(a,n):s.push(a));}e=s.pop();}return n;}},{key:"collides",value:function collides(t){var e=this.data;if(!jc(t,e))return!1;var n=[];for(;e;){for(var i=0;i<e.children.length;i++){var s=e.children[i],o=e.leaf?this.toBBox(s):s;if(jc(t,o)){if(e.leaf||Ad(t,o))return!0;n.push(s);}}e=n.pop();}return!1;}},{key:"load",value:function load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var n=0;n<t.length;n++)this.insert(t[n]);return this;}var e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){var _n4=this.data;this.data=e,e=_n4;}this._insert(e,this.data.height-e.height-1,!0);}return this;}},{key:"insert",value:function insert(t){return t&&this._insert(t,this.data.height-1),this;}},{key:"clear",value:function clear(){return this.data=Io([]),this;}},{key:"remove",value:function remove(t,e){if(!t)return this;var n=this.data;var i=this.toBBox(t),s=[],o=[];var a,u,d;for(;n||s.length;){if(n||(n=s.pop(),u=s[s.length-1],a=o.pop(),d=!0),n.leaf){var v=KPt(t,n.children,e);if(v!==-1)return n.children.splice(v,1),s.push(n),this._condense(s),this;}!d&&!n.leaf&&Ad(n,i)?(s.push(n),o.push(a),a=0,u=n,n=n.children[0]):u?(a++,n=u.children[a],d=!1):n=null;}return this;}},{key:"toBBox",value:function toBBox(t){return t;}},{key:"compareMinX",value:function compareMinX(t,e){return t.minX-e.minX;}},{key:"compareMinY",value:function compareMinY(t,e){return t.minY-e.minY;}},{key:"toJSON",value:function toJSON(){return this.data;}},{key:"fromJSON",value:function fromJSON(t){return this.data=t,this;}},{key:"_all",value:function _all(t,e){var n=[];for(;t;)t.leaf?e.push.apply(e,_toConsumableArray(t.children)):n.push.apply(n,_toConsumableArray(t.children)),t=n.pop();return e;}},{key:"_build",value:function _build(t,e,n,i){var s=n-e+1;var o=this._maxEntries,a;if(s<=o)return a=Io(t.slice(e,n+1)),So(a,this.toBBox),a;i||(i=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,i-1))),a=Io([]),a.leaf=!1,a.height=i;var u=Math.ceil(s/o),d=u*Math.ceil(Math.sqrt(o));S1(t,e,n,d,this.compareMinX);for(var v=e;v<=n;v+=d){var p=Math.min(v+d-1,n);S1(t,v,p,u,this.compareMinY);for(var w=v;w<=p;w+=u){var A=Math.min(w+u-1,p);a.children.push(this._build(t,w,A,i-1));}}return So(a,this.toBBox),a;}},{key:"_chooseSubtree",value:function _chooseSubtree(t,e,n,i){for(;i.push(e),!(e.leaf||i.length-1===n);){var s=1/0,o=1/0,a=void 0;for(var u=0;u<e.children.length;u++){var d=e.children[u],v=Pd(d),p=_Pt(t,d)-v;p<o?(o=p,s=v<s?v:s,a=d):p===o&&v<s&&(s=v,a=d);}e=a||e.children[0];}return e;}},{key:"_insert",value:function _insert(t,e,n){var i=n?t:this.toBBox(t),s=[],o=this._chooseSubtree(i,this.data,e,s);for(o.children.push(t),Da(o,i);e>=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(i,s,e);}// split overflowed node into two
|
|
486
|
-
},{key:"_split",value:function _split(t,e){var n=t[e],i=n.children.length,s=this._minEntries;this._chooseSplitAxis(n,s,i);var o=this._chooseSplitIndex(n,s,i),a=Io(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,So(n,this.toBBox),So(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a);}},{key:"_splitRoot",value:function _splitRoot(t,e){this.data=Io([t,e]),this.data.height=t.height+1,this.data.leaf=!1,So(this.data,this.toBBox);}},{key:"_chooseSplitIndex",value:function _chooseSplitIndex(t,e,n){var i,s=1/0,o=1/0;for(var a=e;a<=n-e;a++){var u=Oa(t,0,a,this.toBBox),d=Oa(t,a,n,this.toBBox),v=
|
|
487
|
-
},{key:"_chooseSplitAxis",value:function _chooseSplitAxis(t,e,n){var i=t.leaf?this.compareMinX:
|
|
488
|
-
},{key:"_allDistMargin",value:function _allDistMargin(t,e,n,i){t.children.sort(i);var s=this.toBBox,o=Oa(t,0,e,s),a=Oa(t,n-e,n,s);var u=Yc(o)+Yc(a);for(var d=e;d<n-e;d++){var v=t.children[d];Da(o,t.leaf?s(v):v),u+=Yc(o);}for(var _d6=n-e-1;_d6>=e;_d6--){var _v9=t.children[_d6];Da(a,t.leaf?s(_v9):_v9),u+=Yc(a);}return u;}},{key:"_adjustParentBBoxes",value:function _adjustParentBBoxes(t,e,n){for(var i=n;i>=0;i--)Da(e[i],t);}},{key:"_condense",value:function _condense(t){for(var e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():So(t[e],this.toBBox);}}]);}();function KPt(r,t,e){if(!e)return t.indexOf(r);for(var n=0;n<t.length;n++)if(e(r,t[n]))return n;return-1;}function So(r,t){Oa(r,0,r.children.length,t,r);}function Oa(r,t,e,n,i){i||(i=Io(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var s=t;s<e;s++){var o=r.children[s];Da(i,r.leaf?n(o):o);}return i;}function Da(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r;}function QPt(r,t){return r.minX-t.minX;}function JPt(r,t){return r.minY-t.minY;}function Pd(r){return(r.maxX-r.minX)*(r.maxY-r.minY);}function Yc(r){return r.maxX-r.minX+(r.maxY-r.minY);}function _Pt(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY));}function tAt(r,t){var e=Math.max(r.minX,t.minX),n=Math.max(r.minY,t.minY),i=Math.min(r.maxX,t.maxX),s=Math.min(r.maxY,t.maxY);return Math.max(0,i-e)*Math.max(0,s-n);}function Ad(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY;}function jc(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY;}function Io(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};}function S1(r,t,e,n,i){var s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=n)continue;var o=t+Math.ceil((e-t)/n/2)*n;JS(r,o,t,e,i),s.push(t,o,o,e);}}var eAt=/*#__PURE__*/function(){function eAt(t,e){_classCallCheck(this,eAt);wt(this,"viewId");wt(this,"scene");wt(this,"fullLayer");wt(this,"curNodeMap");wt(this,"targetNodeMap",[]);wt(this,"highLevelIds");wt(this,"canClearUids");wt(this,"localUid");wt(this,"spatialIndex",new qPt());wt(this,"spatialEntries",/* @__PURE__ */new Map());wt(this,"verifySpatialIndex",!1);this.viewId=t,this.scene=e,this.curNodeMap=new w1();}return _createClass(eAt,[{key:"init",value:function init(t){this.fullLayer=t;}},{key:"get",value:function get(t){return this.curNodeMap.get(t);}},{key:"setLocalUid",value:function setLocalUid(t){this.localUid=t;}},{key:"getLocalUid",value:function getLocalUid(){return this.localUid;}},{key:"setSpatialIndexVerification",value:function setSpatialIndexVerification(t){this.verifySpatialIndex=t;}},{key:"setCanClearUids",value:function setCanClearUids(t){this.canClearUids=t;}},{key:"getCanClearUids",value:function getCanClearUids(){return this.canClearUids;}},{key:"getCanEraserNodes",value:function getCanEraserNodes(t,e){var n=/* @__PURE__ */new Map();var _iterator65=_createForOfIteratorHelper(t.entries()),_step65;try{for(_iterator65.s();!(_step65=_iterator65.n()).done;){var _step65$value=_slicedToArray(_step65.value,2),i=_step65$value[0],s=_step65$value[1];s.toolsType!==It.BackgroundSVG&&(s.toolsType===It.Image&&s.opt.type===_u.Image&&(s.opt.locked||e&&e.disableEraseImage)||s.toolsType===It.Text&&(s.opt.workState===te.Doing||s.opt.workState===te.Start||e&&e.disableEraseText)||this.isCanClearWorkId(i)&&n.set(i,s));}}catch(err){_iterator65.e(err);}finally{_iterator65.f();}return n;}},{key:"getNodesByType",value:function getNodesByType(t){var e=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(n,i){n.toolsType===t&&e.set(i,n);}),e;}},{key:"gethasEraserNodes",value:function gethasEraserNodes(){var t=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(e,n){var i;((i=e.opt.eraserlines)!=null&&i.length||e.opt.eraserFaces)&&t.set(n,e);}),t;}},{key:"hasRenderNodes",value:function hasRenderNodes(){return!0;}},{key:"has",value:function has(t){return this.curNodeMap.has(t);}},{key:"setInfo",value:function setInfo(t,e){var n=this.curNodeMap.get(t)||{name:t,rect:e.rect};e.rect&&(n.rect=br(e.rect)),e.op&&$Pt(e.op)&&(n.op=br(e.op)),e.canRotate&&(n.canRotate=e.canRotate),e.scaleType&&(n.scaleType=e.scaleType),e.opt&&(n.opt=br(e.opt)),e.toolsType&&(n.toolsType=e.toolsType),e.centerPos&&(n.centerPos=br(e.centerPos)),bs(e.isSelected)&&(n.isSelected=e.isSelected),n.rect?(this.curNodeMap.set(t,n),this.updateSpatialEntry(t,n.rect)):this.delete(t);}},{key:"selected",value:function selected(t){this.setInfo(t,{isSelected:!0});}},{key:"unSelected",value:function unSelected(t){this.setInfo(t,{isSelected:!1});}},{key:"delete",value:function _delete(t){this.curNodeMap.delete(t);var e=this.spatialEntries.get(t);e&&(this.spatialIndex.remove(e),this.spatialEntries.delete(t));}},{key:"clear",value:function clear(){this.curNodeMap.clear(),this.spatialIndex.clear(),this.spatialEntries.clear(),this.targetNodeMap.length=0;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var i=this.spatialIndex.search(this.toSpatialBox(t)).map(function(u){return u.key;});var s=i;if(this.verifySpatialIndex){var u=this.getLinearIntersectKeys(t),d=new Set(i);(u.length!==i.length||u.some(function(v){return!d.has(v);}))&&(console.warn("[VNodeManager] spatial index mismatch in ".concat(this.viewId,"; using linear result")),s=u);}var o;var a=/* @__PURE__ */new Map();var _iterator66=_createForOfIteratorHelper(s),_step66;try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){var _u6=_step66.value;var _d7=this.curNodeMap.get(_u6);!_d7||!Su(t,_d7.rect)||e&&_d7.toolsType===It.Image&&_d7.opt.locked||n&&_d7.toolsType===It.Text&&(_d7.opt.workState===te.Doing||_d7.opt.workState===te.Start)||(o=Jt(o,_d7.rect),a.set(_u6,_d7));}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}return{rectRange:o,nodeRange:a};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(t,e){var n=VS(e.toolsType);return this.fullLayer&&(n==null?void 0:n.getRectFromLayer(this.fullLayer,t));}},{key:"updateNodeRect",value:function updateNodeRect(t){var e=this.curNodeMap.get(t);if(e){var n=this.getNodeRectFormShape(t,e);if(!n){this.delete(t);return;}e.rect=n,this.curNodeMap.set(t,e),this.updateSpatialEntry(t,n);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(t){this.highLevelIds=t;var _iterator67=_createForOfIteratorHelper(this.highLevelIds.keys()),_step67;try{for(_iterator67.s();!(_step67=_iterator67.n()).done;){var e=_step67.value;this.updateNodeRect(e);}}catch(err){_iterator67.e(err);}finally{_iterator67.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var t;var _iterator68=_createForOfIteratorHelper(this.curNodeMap.keys()),_step68;try{for(_iterator68.s();!(_step68=_iterator68.n()).done;){var e=_step68.value;(t=this.highLevelIds)!=null&&t.has(e)||this.updateNodeRect(e);}}catch(err){_iterator68.e(err);}finally{_iterator68.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"updateSpatialEntry",value:function updateSpatialEntry(t,e){var n=this.spatialEntries.get(t);n&&this.spatialIndex.remove(n);var i=_objectSpread({key:t},this.toSpatialBox(e));this.spatialEntries.set(t,i),this.spatialIndex.insert(i);}},{key:"toSpatialBox",value:function toSpatialBox(t){return{minX:t.x,minY:t.y,maxX:t.x+t.w,maxY:t.y+t.h};}},{key:"getLinearIntersectKeys",value:function getLinearIntersectKeys(t){var e=[];var _iterator69=_createForOfIteratorHelper(this.curNodeMap.entries()),_step69;try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){var _step69$value=_slicedToArray(_step69.value,2),n=_step69$value[0],i=_step69$value[1];Su(t,i.rect)&&e.push(n);}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}return e;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(t){var e=new w1();var _iterator70=_createForOfIteratorHelper(t),_step70;try{for(_iterator70.s();!(_step70=_iterator70.n()).done;){var n=_step70.value;var i=this.curNodeMap.get(n);i&&e.set(n,br(i));}}catch(err){_iterator70.e(err);}finally{_iterator70.f();}return this.targetNodeMap.push(br(e)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){var t=this.curNodeMap.keys();return this.setTargetAssignKeys(Array.from(t));}},{key:"getLastTarget",value:function getLastTarget(){return this.targetNodeMap[this.targetNodeMap.length-1];}},{key:"deleteLastTarget",value:function deleteLastTarget(){this.targetNodeMap.length&&(this.targetNodeMap.length=this.targetNodeMap.length-1);}},{key:"getTarget",value:function getTarget(t){return this.targetNodeMap[t];}},{key:"deleteTarget",value:function deleteTarget(t){this.targetNodeMap.length=t;}},{key:"clearTarget",value:function clearTarget(){this.targetNodeMap.length=0;}},{key:"isLocalWorkId",value:function isLocalWorkId(t){return t.split(Oo).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(t){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if(lTt(this.canClearUids)){var e=t.split(Oo);if(e.length===1)return this.canClearUids.has("localSelf")||this.localUid&&this.canClearUids.has(this.localUid);if(e.length===2)return this.canClearUids.has(e[0]);}return!1;}}]);}();var rAt=function rAt(r,t,e,n){var i=new URL(r);return i.searchParams.set("width",t.toString()),i.searchParams.set("height",e.toString()),n&&i.searchParams.set("color",n),i.toString();};var nAt=/*#__PURE__*/function(){function nAt(){_classCallCheck(this,nAt);wt(this,"timer");}return _createClass(nAt,[{key:"pending",get:function get(){return this.timer!==void 0;}},{key:"schedule",value:function schedule(t,e){var _this66=this;this.timer===void 0&&(this.timer=setTimeout(function(){_this66.timer=void 0,t();},Math.max(0,e)));}},{key:"cancel",value:function cancel(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0);}}]);}();var iAt=30,sAt=1e3/iAt;function oAt(r){return Math.min(Math.max(0,r),sAt);}var bd=function bd(){return(typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&typeof performance.now=="function"?performance.now():Date.now();};var aAt=/*#__PURE__*/function(){function aAt(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1e3/30;_classCallCheck(this,aAt);wt(this,"timer");wt(this,"pending");wt(this,"resolvePending");wt(this,"activeWorkId");wt(this,"generation",0);wt(this,"lastReleaseTime",0);this.interval=t;}return _createClass(aAt,[{key:"wait",value:function wait(t){var _this67=this;if(this.activeWorkId!==t&&(this.finish(),this.activeWorkId=t),this.pending)return this.pending;var e=this.generation,n=Math.max(0,this.lastReleaseTime+this.interval-bd());return n===0?(this.lastReleaseTime=bd(),Promise.resolve(!0)):(this.pending=new Promise(function(i){_this67.resolvePending=i,_this67.timer=setTimeout(function(){if(_this67.timer=void 0,_this67.pending=void 0,_this67.resolvePending=void 0,e!==_this67.generation||_this67.activeWorkId!==t){i(!1);return;}_this67.lastReleaseTime=bd(),i(!0);},n);}),this.pending);}},{key:"finish",value:function finish(t){if(t!==void 0&&this.activeWorkId!==t)return;this.generation++,this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0,this.pending=void 0;var e=this.resolvePending;this.resolvePending=void 0,this.activeWorkId=void 0,this.lastReleaseTime=0,e==null||e(!1);}},{key:"cancel",value:function cancel(){this.finish();}}]);}();var _S=/*#__PURE__*/function(){function _S(t,e,n){_classCallCheck(this,_S);wt(this,"viewId");wt(this,"type");wt(this,"scene");wt(this,"fullLayer");wt(this,"vNodes");wt(this,"dpr");wt(this,"contextType");wt(this,"opt");wt(this,"cameraOpt");wt(this,"isSafari",!1);wt(this,"combinePostMsg",/* @__PURE__ */new Set());wt(this,"workerTaskId");wt(this,"protectedTask");// protected hasPriorityDraw: boolean = true;
|
|
489
|
-
wt(this,"delayPostDoneResolve");wt(this,"cacheImages",/* @__PURE__ */new Map());wt(this,"imageResolveMap",/* @__PURE__ */new Map());wt(this,"taskUpdateCameraId");wt(this,"taskUpdateCameraResolve");wt(this,"debounceUpdateCameraId");var i,s;if(this.viewId=t,this.type=n,this.opt=e,this.dpr=e.dpr,this.contextType=this.getSupportContextType(n,(i=e==null?void 0:e.offscreenCanvasOpt)==null?void 0:i.contextType),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");try{this.scene=this.createScene(e),this.createRenderLayer(this.scene,e);}catch(o){if(this.contextType!=="2d")this.contextType="2d",(s=this.scene)==null||s.disconnect(),this.scene=this.createScene(e),this.createRenderLayer(this.scene,e);else throw o;}this.vNodes=new eAt(t,this.scene);}return _createClass(_S,[{key:"createRenderLayer",value:function createRenderLayer(t,e){var n=zr.bufferSize.full,i=zr.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",t,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:this.viewId===Ds?n:i*2}));}},{key:"updateDpr",value:function(){var _updateDpr=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(t){return _regenerator().w(function(_context20){while(1)switch(_context20.n){case 0:this.dpr=t,this.scene.displayRatio=t;case 1:return _context20.a(2);}},_callee19,this);}));function updateDpr(_x33){return _updateDpr.apply(this,arguments);}return updateDpr;}()},{key:"getCachedImages",value:function getCachedImages(t){var e;return(e=this.cacheImages.get(t))==null?void 0:e.imageBitmap;}},{key:"getCachedImagesByWorkId",value:function getCachedImagesByWorkId(t){var _iterator71=_createForOfIteratorHelper(this.cacheImages.entries()),_step71;try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){var _step71$value=_slicedToArray(_step71.value,2),e=_step71$value[0],n=_step71$value[1];if(e===t&&n.imageBitmap)return n.imageBitmap;}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}}},{key:"deleteCachedImagesByWorkId",value:function deleteCachedImagesByWorkId(t,e){var _iterator72=_createForOfIteratorHelper(this.cacheImages.entries()),_step72;try{for(_iterator72.s();!(_step72=_iterator72.n()).done;){var _step72$value=_slicedToArray(_step72.value,2),n=_step72$value[0],i=_step72$value[1];e&&n===e||i.workId===t&&(i.imageBitmap.close(),this.cacheImages.delete(n));}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}}},{key:"clearCacheImages",value:function clearCacheImages(){this.cacheImages.forEach(function(t){return t.imageBitmap.close();}),this.cacheImages.clear();}},{key:"clearImageResolveMap",value:function clearImageResolveMap(){this.imageResolveMap.forEach(function(_ref66){var t=_ref66.timer;t&&clearTimeout(t);}),this.imageResolveMap.clear();}},{key:"setIsSafari",value:function setIsSafari(t){this.isSafari=t;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(t){var e,n,i,s,o,a,u,d,_d8,v,p,w,_t16,_t17;return _regenerator().w(function(_context21){while(1)switch(_context21.n){case 0:e=t.msgType,n=t.toolsType,i=t.opt,s=t.imageSrc,o=t.imageBitmap,a=t.workId,u=t.dpr;_t16=e;_context21.n=_t16===xt.UpdateDpr?1:_t16===xt.UpdateCamera?3:_t16===xt.Destroy?5:_t16===xt.Clear?6:_t16===xt.UpdateTools?8:_t16===xt.GetImageBitMap?9:10;break;case 1:_t17=Ze(u);if(!_t17){_context21.n=2;break;}_context21.n=2;return this.updateDpr(u);case 2:return _context21.a(3,10);case 3:_context21.n=4;return this.updateCamera(t);case 4:return _context21.a(3,10);case 5:this.destroy();return _context21.a(3,10);case 6:_context21.n=7;return this.clearAll();case 7:return _context21.a(3,10);case 8:if(n&&i){d={toolsType:n,toolsOpt:i,combineUnitTime:t.combineUnitTime,maxCombineEraserTime:t.maxCombineEraserTime};this.localWork.setToolsOpt(d);}return _context21.a(3,10);case 9:if(s&&o&&a){_d8=a.toString();this.cacheImages.set(s,{imageBitmap:o,workId:_d8});v=this.imageResolveMap.get(s);if(v){p=v.resolve,w=v.timer;w&&clearTimeout(w),p&&p(s);}this.deleteCachedImagesByWorkId(_d8,s);}return _context21.a(3,10);case 10:return _context21.a(2);}},_callee20,this);}));function on(_x34){return _on.apply(this,arguments);}return on;}()},{key:"getIconSize",value:function getIconSize(t,e,n){var i=t*n,s=e*n;return i<=50||s<=50?[50,50]:i<=100||s<=100?[100,100]:i<=200||s<=200?[200,200]:i<=400||s<=400?[400,400]:i<=800||s<=800?[800,800]:[1600,1600];}},{key:"loadImageBitMap",value:function(){var _loadImageBitMap=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(t){var _this68=this;var e,n,i,s,o,a,u,d,v,p,w,_this$getIconSize,_this$getIconSize2,L,G,_L18,_L19,E;return _regenerator().w(function(_context22){while(1)switch(_context22.n){case 0:e=t.toolsType,n=t.opt,i=t.workId,s=t.isSubWorker;if(!(e===It.Image&&n&&i)){_context22.n=5;break;}o=i.toString(),a=n.src,u=n.type,d=n.width,v=n.height,p=n.strokeColor;if(!(!a||!u||!d||!v)){_context22.n=1;break;}return _context22.a(2);case 1:w=a;if(u===_u.Iconify){_this$getIconSize=this.getIconSize(d,v,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),L=_this$getIconSize2[0],G=_this$getIconSize2[1];w=rAt(a,L,G,p);}if(!this.cacheImages.has(w)){_context22.n=2;break;}_L18=this.getCachedImages(w);if(!_L18){_context22.n=2;break;}return _context22.a(2,_L18);case 2:if(!this.imageResolveMap.has(w)){_context22.n=3;break;}_L19=this.getCachedImagesByWorkId(o);if(!_L19){_context22.n=3;break;}return _context22.a(2,_L19);case 3:_context22.n=4;return new Promise(function(L){var G=_this68.imageResolveMap.get(w)||{resolve:void 0,timer:void 0};G.timer&&clearTimeout(G.timer),G.resolve=L,G.timer=setTimeout(function(){var z=_this68.imageResolveMap.get(w);z!=null&&z.resolve&&z.resolve(w);},5e3),_this68.imageResolveMap.set(w,G),_this68._post({sp:[{imageSrc:w,workId:o,viewId:_this68.viewId,isgl:!!_this68.fullLayer.parent.gl,isSubWorker:s,type:xt.GetImageBitMap}]});});case 4:E=_context22.v;return _context22.a(2,(this.imageResolveMap.delete(E),this.getCachedImages(w)));case 5:return _context22.a(2);}},_callee21,this);}));function loadImageBitMap(_x35){return _loadImageBitMap.apply(this,arguments);}return loadImageBitMap;}()},{key:"createLocalWork",value:function createLocalWork(t){var e=t.workId,n=t.opt,i=t.toolsType;e&&n&&(!this.localWork.getToolsOpt()&&i&&this.setToolsOpt({toolsType:i,toolsOpt:n}),this.setWorkOpt({workId:e,toolsOpt:n}));}},{key:"updateScene",value:function updateScene(t,e,n){t.attr(_objectSpread({},e));var i=e.width,s=e.height;t.container.width=i,t.container.height=s,t.width=i,t.height=s,this.updateLayer({width:i,height:s},n);}},{key:"updateLayer",value:function updateLayer(t,e){var n=t.width,i=t.height,s=e||this.fullLayer;s&&(s.parent.setAttribute("width",n),s.parent.setAttribute("height",i),s.setAttribute("size",[n,i]),s.setAttribute("pos",[n*0.5,i*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(t,e){var n=new OffscreenCanvas(100,100);var i=["2d"];t===Tu.Full&&this.viewId===Ds&&(i=["webgl2","webgl","2d"],e&&i.unshift(e));for(var _i9=0,_i8=i;_i9<_i8.length;_i9++){var s=_i8[_i9];try{if(n.getContext(s))return s;}catch(o){throw o;}}}},{key:"createScene",value:function createScene(t){var e=t.offscreenCanvasOpt,n=e.width,i=e.height,s=new OffscreenCanvas(n,i);e.contextType&&delete e.contextType;var o=new Jp(_objectSpread(_objectSpread({container:s,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},e),{},{contextType:this.contextType,id:this.viewId}));return o.setAttribute("id",this.viewId),o;}},{key:"createLayer",value:function createLayer(t,e,n,i){var s="offscreen-".concat(t),o=n.width,a=n.height;i&&(n.offscreen=!0,n.canvas=i);var u=e.layer(s,n),d=new ar({anchor:[0.5,0.5],pos:[o*0.5,a*0.5],size:[o,a],name:"viewport",id:t});return u.append(d),d;}},{key:"clearAll",value:function(){var _clearAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22(){var t,e;return _regenerator().w(function(_context23){while(1)switch(_context23.n){case 0:this.fullLayer&&(this.fullLayer.parent.children.forEach(function(n){n.name!=="viewport"&&n.remove();}),qr(this.fullLayer,this.fullLayer.parent)),this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0,(t=this.taskUpdateCameraResolve)==null||t.call(this,!1),this.taskUpdateCameraResolve=void 0),this.debounceUpdateCameraId&&(clearTimeout(this.debounceUpdateCameraId),this.debounceUpdateCameraId=void 0),this.clearCacheImages(),this.clearImageResolveMap(),this.localWork.destroy(),(e=this.serviceWork)==null||e.destroy();case 1:return _context23.a(2);}},_callee22,this);}));function clearAll(){return _clearAll.apply(this,arguments);}return clearAll;}()},{key:"setToolsOpt",value:function setToolsOpt(t){this.localWork.setToolsOpt(t);}},{key:"setWorkOpt",value:function setWorkOpt(t){var e=t.workId,n=t.toolsOpt;e&&n&&this.localWork.setWorkOptions(e.toString(),n);}},{key:"destroy",value:function destroy(){var t;this.vNodes.clear(),this.fullLayer.remove(),_Ur(this.fullLayer,this.fullLayer.parent),this.clearCacheImages(),this.clearImageResolveMap(),this.scene.remove(),this.localWork.destroy(),(t=this.serviceWork)==null||t.destroy();}},{key:"post",value:function(){var _post=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(t){return _regenerator().w(function(_context24){while(1)switch(_context24.n){case 0:this.combinePostMsg.add(t);_context24.n=1;return this.runBatchPostData();case 1:return _context24.a(2);}},_callee23,this);}));function post(_x36){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24(){var _this69=this;var _t18,_t19;return _regenerator().w(function(_context25){while(1)switch(_context25.n){case 0:this.workerTaskId||(this.workerTaskId=setTimeout(function(){_this69.workerTaskId=void 0,_this69.combinePost();},16));_t18=this.type===Tu.Full&&!this.delayPostDoneResolve;if(!_t18){_context25.n=2;break;}_context25.n=1;return new Promise(function(e){_this69.delayPostDoneResolve=e;});case 1:_t18=_context25.v;case 2:_t19=_t18;if(!_t19){_context25.n=3;break;}this.delayPostDoneResolve=void 0;case 3:return _context25.a(2);}},_callee24,this);}));function runBatchPostData(){return _runBatchPostData.apply(this,arguments);}return runBatchPostData;}()},{key:"combinePostData",value:function combinePostData(){var u,d;this.workerTaskId=void 0;var t=[],e=[];var n,i,s,o;var a=/* @__PURE__ */new Set();var _iterator73=_createForOfIteratorHelper(this.combinePostMsg.values()),_step73;try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){var v=_step73.value;if((u=v.render)!=null&&u.length){var _iterator74=_createForOfIteratorHelper(v.render),_step74;try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){var p=_step74.value;var w=!1;if(p.workId&&a.add(p.workId),p.isClearAll&&(p.rect=this.getSceneRect(),p.isClear=!0,delete p.isClearAll),p.drawCanvas){var A=this.getLayer(p.drawCanvas);if(!A||!(A.parent instanceof Zi))continue;if(A.parent.render(),p.isDrawAll){var M=this.getSceneRect();p.rect=M,delete p.isDrawAll;}}var _iterator75=_createForOfIteratorHelper(t),_step75;try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){var _A3=_step75.value;if(p.viewId===_A3.viewId){p.isClear&&_A3.clearCanvas&&_A3.isClear&&_A3.clearCanvas===p.clearCanvas&&(_A3.rect=Jt(_A3.rect,p.rect),w=!0),_A3.drawCanvas&&_A3.drawCanvas===p.drawCanvas&&(_A3.rect=Jt(_A3.rect,p.rect),w=!0);continue;}}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}w||(p.isClear&&!p.drawCanvas?t.unshift(p):t.push(p));}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}}if((d=v.sp)!=null&&d.length){var _iterator76=_createForOfIteratorHelper(v.sp),_step76;try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){var _p4=_step76.value;var _w3=!1;var _iterator77=_createForOfIteratorHelper(e),_step77;try{for(_iterator77.s();!(_step77=_iterator77.n()).done;){var _A4=_step77.value;if(qn(_p4,_A4)){_w3=!0;break;}}}catch(err){_iterator77.e(err);}finally{_iterator77.f();}_w3||e.push(_p4);}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}}Ze(v.fullWorkerDrawCount)&&(n=v.fullWorkerDrawCount),Ze(v.subWorkerDrawCount)&&(i=v.subWorkerDrawCount),Ze(v.consumeCount)&&(s=v.consumeCount,o=v.consumeWorkId);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}return this.combinePostMsg.clear(),{render:t,sp:e,fullWorkerDrawCount:n,subWorkerDrawCount:i,consumeCount:s,consumeWorkId:o,workIds:a,viewId:this.viewId};}},{key:"getSceneRect",value:function getSceneRect(){var _this$scene=this.scene,t=_this$scene.width,e=_this$scene.height;return{x:0,y:0,w:Math.floor(t),h:Math.floor(e)};}}]);}();var x0=/*#__PURE__*/function(){function x0(t){_classCallCheck(this,x0);wt(this,"viewId");wt(this,"vNodes");wt(this,"thread");wt(this,"fullLayer");wt(this,"drawLayer");wt(this,"_post");wt(this,"tmpOpt");wt(this,"workShapes",/* @__PURE__ */new Map());wt(this,"drawCount",0);wt(this,"consumeCount",0);wt(this,"syncUnitTime",zr.syncOpt.interval);wt(this,"combineUnitTime",zr.bezier.combineUnitTime);wt(this,"maxCombineEraserTime",zr.pencilEraser.maxCombineTime);wt(this,"eraserBatchScheduler",new nAt());wt(this,"drawAckBackpressure",new aAt());this.thread=t.thread,this.viewId=t.viewId,this.vNodes=t.vNodes,this.fullLayer=t.fullLayer,this.drawLayer=t.drawLayer,this._post=this.thread.post.bind(t.thread);}return _createClass(x0,[{key:"eraserBatchDelay",get:function get(){return oAt(this.maxCombineEraserTime);}},{key:"setmaxCombineEraserTime",value:function setmaxCombineEraserTime(t){this.maxCombineEraserTime=t;}},{key:"setCombineUnitTime",value:function setCombineUnitTime(t){this.combineUnitTime=t;}},{key:"setSyncUnitTime",value:function setSyncUnitTime(t){this.syncUnitTime=t;}},{key:"destroy",value:function destroy(){this.eraserBatchScheduler.cancel(),this.drawAckBackpressure.cancel(),this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{key:"getWorkShape",value:function getWorkShape(t){return this.workShapes.get(t);}},{key:"createWorkShape",value:function createWorkShape(t,e){if(t&&this.tmpOpt){var n={toolsType:this.tmpOpt.toolsType,toolsOpt:e||this.tmpOpt.toolsOpt},i=this.createWorkShapeNode(_objectSpread(_objectSpread({},n),{},{workId:t}));i&&this.workShapes.set(t,i);}}},{key:"setWorkOptions",value:function setWorkOptions(t,e){var n=this.getWorkShape(t);n||this.createWorkShape(t,e),n==null||n.setWorkOptions(e);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(t){var e;return cf(_objectSpread(_objectSpread({},t),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(e=this.thread)==null?void 0:e.serviceWork);}},{key:"setToolsOpt",value:function setToolsOpt(t){var e,n,i;((e=this.tmpOpt)==null?void 0:e.toolsType)!==t.toolsType&&(n=this.tmpOpt)!=null&&n.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=t,(i=t.toolsOpt)!=null&&i.syncUnitTime&&(this.syncUnitTime=t.toolsOpt.syncUnitTime),t.combineUnitTime&&(this.combineUnitTime=t.combineUnitTime),t.maxCombineEraserTime&&(this.maxCombineEraserTime=t.maxCombineEraserTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(t){var e;(e=this.getWorkShape(t))==null||e.clearTmpPoints(),this.workShapes.delete(t);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.eraserBatchScheduler.cancel(),this.drawAckBackpressure.cancel(),this.workShapes.forEach(function(t){return t.clearTmpPoints();}),this.workShapes.clear();}},{key:"setFullWork",value:function setFullWork(t){var e=t.workId,n=t.opt,i=t.toolsType;if(e&&n&&i){var s=e.toString();var o;return e&&this.workShapes.has(s)?(o=this.workShapes.get(s),(o==null?void 0:o.toolsType)!==i?(o==null||o.clearTmpPoints(),this.workShapes.delete(s),o=void 0):o==null||o.setWorkOptions(n)):o=this.createWorkShapeNode({toolsOpt:n,toolsType:i,workId:s}),o||(o=this.createWorkShapeNode({toolsOpt:n,toolsType:i,workId:s})),o?(this.workShapes.set(s,o),o):void 0;}}}]);}();function lAt(r){return r;}var tI=lAt;function cAt(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2]);}return r.apply(t,e);}var uAt=cAt,fAt=uAt,I1=Math.max;function hAt(r,t,e){return t=I1(t===void 0?r.length-1:t,0),function(){for(var n=arguments,i=-1,s=I1(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=e(o),fAt(r,this,a);};}var dAt=hAt;function pAt(r){return function(){return r;};}var vAt=pAt,gAt=vAt,T1=q2,mAt=tI,yAt=T1?function(r,t){return T1(r,"toString",{configurable:!0,enumerable:!1,value:gAt(t),writable:!0});}:mAt,wAt=yAt,SAt=800,IAt=16,TAt=Date.now;function xAt(r){var t=0,e=0;return function(){var n=TAt(),i=IAt-(n-e);if(e=n,i>0){if(++t>=SAt)return arguments[0];}else t=0;return r.apply(void 0,arguments);};}var CAt=xAt,PAt=wAt,AAt=CAt,bAt=AAt(PAt),MAt=bAt,EAt=tI,LAt=dAt,OAt=MAt;function DAt(r,t){return OAt(LAt(r,t,EAt),r+"");}var RAt=DAt;function NAt(r,t,e,n){for(var i=r.length,s=e+(n?1:-1);n?s--:++s<i;)if(t(r[s],s,r))return s;return-1;}var BAt=NAt;function kAt(r){return r!==r;}var FAt=kAt;function WAt(r,t,e){for(var n=e-1,i=r.length;++n<i;)if(r[n]===t)return n;return-1;}var UAt=WAt,zAt=BAt,$At=FAt,YAt=UAt;function jAt(r,t,e){return t===t?YAt(r,t,e):zAt(r,$At,e);}var XAt=jAt,GAt=XAt;function HAt(r,t){var e=r==null?0:r.length;return!!e&&GAt(r,t,0)>-1;}var eI=HAt;function VAt(r,t,e){for(var n=-1,i=r==null?0:r.length;++n<i;)if(e(t,r[n]))return!0;return!1;}var rI=VAt;function ZAt(r,t){for(var e=-1,n=r==null?0:r.length,i=Array(n);++e<n;)i[e]=t(r[e],e,r);return i;}var qAt=ZAt,KAt=m0,QAt=eI,JAt=rI,_At=qAt,tbt=of,ebt=y0,rbt=200;function nbt(r,t,e,n){var i=-1,s=QAt,o=!0,a=r.length,u=[],d=t.length;if(!a)return u;e&&(t=_At(t,tbt(e))),n?(s=JAt,o=!1):t.length>=rbt&&(s=ebt,o=!1,t=new KAt(t));t:for(;++i<a;){var v=r[i],p=e==null?v:e(v);if(v=n||v!==0?v:0,o&&p===p){for(var w=d;w--;)if(t[w]===p)continue t;u.push(v);}else s(t,p,n)||u.push(v);}return u;}var ibt=nbt,x1=cl,sbt=_2,obt=fl,C1=x1?x1.isConcatSpreadable:void 0;function abt(r){return obt(r)||sbt(r)||!!(C1&&r&&r[C1]);}var lbt=abt,cbt=h0,ubt=lbt;function nI(r,t,e,n,i){var s=-1,o=r.length;for(e||(e=ubt),i||(i=[]);++s<o;){var a=r[s];t>0&&e(a)?t>1?nI(a,t-1,e,n,i):cbt(i,a):n||(i[i.length]=a);}return i;}var fbt=nI;function hbt(){}var dbt=hbt,Md=uS,pbt=dbt,vbt=w0,gbt=1/0,mbt=Md&&1/vbt(new Md([,-0]))[1]==gbt?function(r){return new Md(r);}:pbt,ybt=mbt,wbt=m0,Sbt=eI,Ibt=rI,Tbt=y0,xbt=ybt,Cbt=w0,Pbt=200;function Abt(r,t,e){var n=-1,i=Sbt,s=r.length,o=!0,a=[],u=a;if(e)o=!1,i=Ibt;else if(s>=Pbt){var d=t?null:xbt(r);if(d)return Cbt(d);o=!1,i=Tbt,u=new wbt();}else u=t?[]:a;t:for(;++n<s;){var v=r[n],p=t?t(v):v;if(v=e||v!==0?v:0,o&&p===p){for(var w=u.length;w--;)if(u[w]===p)continue t;t&&u.push(p),a.push(v);}else i(u,p,e)||(u!==a&&u.push(p),a.push(v));}return a;}var bbt=Abt,Mbt=ibt,Ebt=fbt,P1=bbt;function Lbt(r,t,e){var n=r.length;if(n<2)return n?P1(r[0]):[];for(var i=-1,s=Array(n);++i<n;)for(var o=r[i],a=-1;++a<n;)a!=i&&(s[i]=Mbt(s[i]||o,r[a],t,e));return P1(Ebt(s,1),t,e);}var Obt=Lbt,Dbt=l0,Rbt=Pi;function Nbt(r){return Rbt(r)&&Dbt(r);}var Bbt=Nbt,kbt=iS,Fbt=RAt,Wbt=Obt,Ubt=Bbt,zbt=Fbt(function(r){return Wbt(kbt(r,Ubt));}),$bt=zbt;var Ybt=/* @__PURE__ */zn($bt);var iI=/*#__PURE__*/function(_x37){function iI(e){var _this70;_classCallCheck(this,iI);_this70=_callSuper(this,iI,[e]);wt(_this70,"_type","full");wt(_this70,"combineTimerId");wt(_this70,"combineDrawResolve");wt(_this70,"combineDrawActiveId");wt(_this70,"drawWorkActiveId");wt(_this70,"effectSelectNodeData",/* @__PURE__ */new Set());return _this70;}_inherits(iI,_x37);return _createClass(iI,[{key:"loadImageBitMap",value:function(){var _loadImageBitMap2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25(e){return _regenerator().w(function(_context26){while(1)switch(_context26.n){case 0:_context26.n=1;return this.thread.loadImageBitMap(e);case 1:return _context26.a(2,_context26.v);}},_callee25,this);}));function loadImageBitMap(_x38){return _loadImageBitMap2.apply(this,arguments);}return loadImageBitMap;}()},{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26(e,n){var _this71=this;var i,s,o,a,u,d,v,p,A,w,_t20,_t21,_t22,_t23,_t24;return _regenerator().w(function(_context27){while(1)switch(_context27.n){case 0:i=e.op,s=e.workId,o=e.scenePath,a=e.postCount,u=e.smoothSync;if(!(i!=null&&i.length&&s)){_context27.n=15;break;}d=s.toString(),v=this.getWorkShape(d);if(v){_context27.n=1;break;}return _context27.a(2);case 1:p=v.toolsType;if(!(p===It.LaserPen)){_context27.n=2;break;}return _context27.a(2);case 2:if(!(this.combineDrawActiveId&&this.combineDrawActiveId!==d)){_context27.n=3;break;}A=this.combineDrawActiveId;this.eraserBatchScheduler.cancel();this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);_context27.n=3;return this.consumeDrawAll({workId:A,scenePath:o,viewId:this.viewId,msgType:xt.DrawWork,dataType:Kt.Local},n);case 3:_t20=this.drawWorkActiveId&&this.drawWorkActiveId!==d;if(!_t20){_context27.n=5;break;}_context27.n=4;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:o,viewId:this.viewId,msgType:xt.DrawWork,dataType:Kt.Local},n);case 4:this.drawWorkActiveId=void 0;case 5:!this.drawWorkActiveId&&d!==Fe&&(this.drawWorkActiveId=d);Ze(a)&&(this.consumeCount=a);w=v.consume({data:e,isFullWork:!0,smoothSync:u});_t21=p;_context27.n=_t21===It.Selector?6:_t21===It.PencilEraser?8:_t21===It.BitMapEraser?8:_t21===It.Eraser?9:_t21===It.Arrow?11:_t21===It.Straight?11:_t21===It.Ellipse?11:_t21===It.Rectangle?11:_t21===It.Star?11:_t21===It.Polygon?11:_t21===It.SpeechBalloon?11:_t21===It.Pencil?13:15;break;case 6:_t22=w.type===xt.Select;if(!_t22){_context27.n=7;break;}w.selectIds&&n.runReverseSelectWork(w.selectIds);_context27.n=7;return this.drawSelector(_objectSpread(_objectSpread({},w),{},{scenePath:o,isSelecting:!0}),e.workState||te.Doing);case 7:return _context27.a(3,15);case 8:this.drawCount++,this.combineDrawActiveId=d,this.eraserBatchScheduler.schedule(function(){_this71.drawEraserCombine(d,_this71.drawCount,e.needUndoTicker,e.collectUndoTicker);},this.eraserBatchDelay);return _context27.a(3,15);case 9:_context27.n=10;return this.drawEraser(w,void 0,e.needUndoTicker,e.collectUndoTicker);case 10:return _context27.a(3,15);case 11:_t23=w;if(!_t23){_context27.n=12;break;}this.drawCount++;_context27.n=12;return this.drawShape(w);case 12:return _context27.a(3,15);case 13:this.drawCount++;!this.combineTimerId&&this.combineUnitTime!==1/0&&new Promise(function(A){_this71.combineDrawActiveId=d,_this71.combineDrawResolve=A,_this71.combineTimerId=setTimeout(function(){_this71.combineTimerId=void 0,_this71.combineDrawResolve&&_this71.combineDrawResolve(!0);},_this71.combineUnitTime);}).then(function(A){A&&_this71.drawPencilCombine(d,_this71.drawCount),_this71.combineDrawResolve=void 0;});_t24=w;if(!_t24){_context27.n=14;break;}_context27.n=14;return this.drawPencil(w);case 14:return _context27.a(3,15);case 15:return _context27.a(2);}},_callee26,this);}));function consumeDraw(_x39,_x40){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27(e,n){var a,u,d,i,s,o,v,p,w,A,M,E,_t25;return _regenerator().w(function(_context28){while(1)switch(_context28.n){case 0:this.eraserBatchScheduler.cancel(),this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);i=e.workId,s=e.scenePath,o=e.isLockSentEventCursor;if(!i){_context28.n=12;break;}v=i.toString();this.combineDrawActiveId===v&&(this.combineDrawActiveId=void 0),this.drawWorkActiveId===v&&(this.drawWorkActiveId=void 0);p=this.workShapes.get(v);if(p){_context28.n=1;break;}return _context28.a(2);case 1:w=p.toolsType;if(!(w===It.LaserPen)){_context28.n=2;break;}return _context28.a(2);case 2:A=this.workShapes.get(Po),M=(a=A==null?void 0:A.selectIds)==null?void 0:a[0],E=p.consumeAll({data:e,workerEngine:this});_t25=w;_context28.n=_t25===It.Selector?3:_t25===It.PencilEraser?5:_t25===It.BitMapEraser?5:_t25===It.Eraser?7:_t25===It.Arrow?8:_t25===It.Straight?8:_t25===It.Ellipse?8:_t25===It.Rectangle?8:_t25===It.Star?8:_t25===It.Polygon?8:_t25===It.SpeechBalloon?8:_t25===It.Pencil?10:12;break;case 3:E.selectIds&&M&&(u=E.selectIds)!=null&&u.includes(M)&&A.cursorBlur();E.selectIds&&n.runReverseSelectWork(E.selectIds);_context28.n=4;return this.drawSelector(_objectSpread(_objectSpread({},E),{},{scenePath:s,isSelecting:!1}),te.Done,o);case 4:(d=p.selectIds)!=null&&d.length?p.clearTmpPoints():this.clearWorkShapeNodeCache(v);return _context28.a(3,12);case 5:_context28.n=6;return this.drawEraserFull(p,_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker);case 6:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context28.a(3,12);case 7:this.drawEraser(_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker,e.collectUndoTicker),p.clearTmpPoints();return _context28.a(3,12);case 8:_context28.n=9;return this.drawPencilFull(_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker,w);case 9:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context28.a(3,12);case 10:_context28.n=11;return this.drawPencilFull(_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker);case 11:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context28.a(3,12);case 12:return _context28.a(2);}},_callee27,this);}));function consumeDrawAll(_x41,_x42){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28(e,n){var _iterator78,_step78,i,_t26;return _regenerator().w(function(_context29){while(1)switch(_context29.p=_context29.n){case 0:_iterator78=_createForOfIteratorHelper(this.workShapes.keys());_context29.p=1;_iterator78.s();case 2:if((_step78=_iterator78.n()).done){_context29.n=4;break;}i=_step78.value;_context29.n=3;return this.consumeDrawAll({workId:i,scenePath:e,viewId:this.viewId,msgType:xt.DrawWork,dataType:Kt.Local},n);case 3:_context29.n=2;break;case 4:_context29.n=6;break;case 5:_context29.p=5;_t26=_context29.v;_iterator78.e(_t26);case 6:_context29.p=6;_iterator78.f();return _context29.f(6);case 7:return _context29.a(2);}},_callee28,this,[[1,5,6,7]]);}));function workShapesDone(_x43,_x44){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee29(e){var a,u,d,n,i,v,p,s,o,_v0,_p5,w,A,M,E;return _regenerator().w(function(_context30){while(1)switch(_context30.n){case 0:n=(a=e.workId)==null?void 0:a.toString(),i=(u=e.updateNodeOpt)==null?void 0:u.eraserGeometryDelta;if(!(n&&i)){_context30.n=1;break;}v=this.vNodes.get(n),p=e.ops&&Os(e.ops)||e.op||[];if(!(!v||!e.centerPos||!Cgt(this.vNodes,n,i,v,{op:p,centerPos:e.centerPos}))){_context30.n=1;break;}wgt(this.vNodes,n);return _context30.a(2);case 1:s=this.setFullWork(e),o=e.ops&&Os(e.ops)||e.op;if(!s){_context30.n=9;break;}if(n){_context30.n=2;break;}return _context30.a(2);case 2:_v0=(d=this.vNodes.get(n))==null?void 0:d.rect;if(!(s.toolsType===It.BackgroundSVG)){_context30.n=3;break;}_p5=s.consumeService({isFullWork:!0,replaceId:n});_context30.n=8;break;case 3:if(!(s.toolsType===It.Image)){_context30.n=5;break;}_context30.n=4;return s.consumeServiceAsync({isFullWork:!0,replaceId:n,worker:this});case 4:_p5=_context30.v;w=(e==null?void 0:e.updateNodeOpt)&&s.updataOptService(e.updateNodeOpt);_context30.n=8;break;case 5:if(!(s.toolsType===It.Text)){_context30.n=7;break;}_context30.n=6;return s.consumeServiceAsync({isFullWork:!0,replaceId:n,boxRect:this.thread.getSceneRect()});case 6:_p5=_context30.v;_context30.n=8;break;case 7:_p5=s.consumeService({op:o,isFullWork:!0,replaceId:n}),w=(e==null?void 0:e.updateNodeOpt)&&s.updataOptService(e.updateNodeOpt);case 8:_p5=Jt(_p5,w);A=[],M=[];if(!(e.workId&&this.workShapes.delete(e.workId.toString()),e.clearPreviewLocalWork&&A.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}),_p5&&e.willRefresh&&(_v0&&(A.push({rect:me(_v0),isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId}),_p5=Jt(_p5,_v0)),A.push({rect:me(_p5),drawCanvas:Yt.Bg,viewId:this.viewId})),e.willSyncService&&M.push({opt:e.opt,toolsType:e.toolsType,type:xt.FullWork,workId:e.workId,ops:e.ops,updateNodeOpt:e.updateNodeOpt,viewId:this.viewId,needUndoTicker:e.needUndoTicker,requestId:e.requestId,emitEventType:e.emitEventType,scenePath:e.scenePath}),e.isLockSentEventCursor&&M.push({type:xt.None,isLockSentEventCursor:!0,scenePath:e.scenePath}),e.needUndoTicker&&M.push({type:xt.None,needUndoTicker:e.needUndoTicker,emitEventType:e.emitEventType,requestId:e.requestId,scenePath:e.scenePath}),A.length||M.length)){_context30.n=9;break;}E={render:A,sp:M};_context30.n=9;return this._post(E);case 9:return _context30.a(2);}},_callee29,this);}));function consumeFull(_x45){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee30(e,n){var i,s,o,a,u,d,v,_iterator79,_step79,p,w,A,_t27,_t28,_t29;return _regenerator().w(function(_context31){while(1)switch(_context31.p=_context31.n){case 0:i=e.willSyncService,s=e.needUndoTicker,o=[],a=[],u=[],d=this.workShapes.get(Fe);if(d){_context31.n=1;break;}return _context31.a(2);case 1:v=d.selectIds&&_toConsumableArray(d.selectIds)||[];_iterator79=_createForOfIteratorHelper(v);_context31.p=2;_iterator79.s();case 3:if((_step79=_iterator79.n()).done){_context31.n=8;break;}p=_step79.value;w=this.vNodes.get(p);if(!w){_context31.n=6;break;}_t27=w.toolsType;_context31.n=_t27===It.Text?4:_t27===It.BackgroundSVG?5:6;break;case 4:o.push({type:xt.TextUpdate,toolsType:It.Text,workId:p,dataType:Kt.Local});return _context31.a(3,6);case 5:o.push({type:xt.BackgroundSVGDelete,toolsType:It.BackgroundSVG,workId:p,dataType:Kt.Local,viewId:this.viewId});return _context31.a(3,6);case 6:A=this._removeWork(p);A.length&&a.push.apply(a,_toConsumableArray(A)),n==null||n.deleteCachedImagesByWorkId(p),u.push(p);case 7:_context31.n=3;break;case 8:_context31.n=10;break;case 9:_context31.p=9;_t28=_context31.v;_iterator79.e(_t28);case 10:_context31.p=10;_iterator79.f();return _context31.f(10);case 11:u.length&&o.push({type:xt.RemoveNode,removeIds:u,needUndoTicker:s,emitEventType:e.emitEventType,requestId:e.requestId});o.push({type:xt.Select,selectIds:[],willSyncService:i});_context31.n=12;return this.blurSelector();case 12:s&&o.push({type:xt.None,needUndoTicker:s});_t29=a.length||o.length;if(!_t29){_context31.n=13;break;}_context31.n=13;return this._post({render:a,sp:o});case 13:return _context31.a(2);}},_callee30,this,[[2,9,10,11]]);}));function removeSelector(_x46,_x47){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31(e){var n,i,s,_t30;return _regenerator().w(function(_context32){while(1)switch(_context32.n){case 0:n=e.workId,i=n==null?void 0:n.toString();if(!i){_context32.n=1;break;}s=this._removeWork(i);_t30=s.length;if(!_t30){_context32.n=1;break;}_context32.n=1;return this._post({render:s});case 1:return _context32.a(2);}},_callee31,this);}));function removeWork(_x48){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(e){var _this72=this;var s,o,a;var n=this.vNodes.get(e);n&&(n.toolsType===It.BackgroundSVG&&this._post({sp:[{type:xt.BackgroundSVGDelete,toolsType:It.BackgroundSVG,workId:e,dataType:Kt.Local,viewId:this.viewId}]}),(s=this.fullLayer)==null||s.getElementsByName(e).forEach(function(u){u.remove(),_Ur(u,_this72.fullLayer.parent);}),this.vNodes.delete(e));var i=this.drawLayer&&jt.getRectFromLayer(this.drawLayer,e);if(i){var u=(o=this.drawLayer)==null?void 0:o.getElementsByName(e)[0];u&&(u.remove(),_Ur(u,(a=this.drawLayer)==null?void 0:a.parent));}return this.getWorkShape(e)&&this.clearWorkShapeNodeCache(e),{fullRect:n==null?void 0:n.rect,drawRect:i};}},{key:"_removeWork",value:function _removeWork(e){var _this$removeNode=this.removeNode(e),n=_this$removeNode.fullRect,i=_this$removeNode.drawRect,s=[];return n&&s.push({rect:me(n),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(n),drawCanvas:Yt.Bg,viewId:this.viewId}),i&&s.push({rect:me(i),clearCanvas:Yt.Float,isClear:!0,viewId:this.viewId},{rect:me(i),drawCanvas:Yt.Float,viewId:this.viewId}),s;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee32(e){var n,i,s,o,a,u,d,_iterator80,_step80,_v1,p,w,A,M,v,_t31,_t32;return _regenerator().w(function(_context33){while(1)switch(_context33.p=_context33.n){case 0:n=e.op,i=e.viewId,s=e.dataType;if(!(n!=null&&n.length)){_context33.n=11;break;}u=n[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],d=n[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator80=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context33.p=1;_iterator80.s();case 2:if((_step80=_iterator80.n()).done){_context33.n=4;break;}_v1=_step80.value;p=_v1.rect,w=_v1.name,A=_v1.toolsType,M=_v1.opt;if(!(A===It.Text&&M.workState===te.Done&&zPt([u,d],p))){_context33.n=3;break;}o=w,a=this.setFullWork({workId:w,toolsType:A,opt:M});return _context33.a(3,4);case 3:_context33.n=2;break;case 4:_context33.n=6;break;case 5:_context33.p=5;_t31=_context33.v;_iterator80.e(_t31);case 6:_context33.p=6;_iterator80.f();return _context33.f(6);case 7:if(!o){_context33.n=11;break;}_t32=a;if(!_t32){_context33.n=9;break;}_context33.n=8;return a.consumeServiceAsync({isFullWork:!0,replaceId:a.getWorkId(),boxRect:this.thread.getSceneRect()});case 8:v=_context33.v;case 9:_context33.n=10;return this.blurSelector({viewId:i,msgType:xt.Select,dataType:s,isSync:!0});case 10:_context33.n=11;return this._post({render:v&&[{rect:me(v),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(v),drawCanvas:Yt.Bg,viewId:this.viewId}],sp:[{type:xt.GetTextActive,toolsType:It.Text,workId:o}]});case 11:return _context33.a(2);}},_callee32,this,[[1,5,6,7]]);}));function checkTextActive(_x49){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee33(e){var n,i,s;return _regenerator().w(function(_context34){while(1)switch(_context34.n){case 0:n=this.workShapes.get(Fe),i=e.workId,s=e.msgType;if(!(n&&i&&n.selectIds&&n.selectIds.includes(i.toString()))){_context34.n=2;break;}s===xt.RemoveNode?n.selectIds=n.selectIds.filter(function(o){return o!==i.toString();}):this.effectSelectNodeData.add(e);_context34.n=1;return this.runEffectSelectWork(!0);case 1:return _context34.a(2);case 2:return _context34.a(2,e);}},_callee33,this);}));function colloctEffectSelectWork(_x50){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34(e){var _this73=this;var E,n,i,s,o,a,u,d,v,p,w,A,M,_t33;return _regenerator().w(function(_context35){while(1)switch(_context35.n){case 0:n=this.workShapes.get(Fe);if((E=n==null?void 0:n.selectIds)!=null&&E.length){_context35.n=1;break;}return _context35.a(2);case 1:i=e.callback;s=_objectWithoutProperties(e,_excluded3);o=s.updateSelectorOpt;a=s.willSerializeData;u=s.smoothSync;_context35.n=2;return n==null?void 0:n.updateSelector({updateSelectorOpt:o,selectIds:br(n.selectIds),vNodes:this.vNodes,willSerializeData:a,worker:this});case 2:d=_context35.v;v=/* @__PURE__ */new Map();d!=null&&d.selectIds&&(p=Ybt(n.selectIds,d.selectIds),d.selectIds.forEach(function(L){var G=_this73.vNodes.get(L);if(G){var z=G.toolsType,et=G.op,x=G.opt;v.set(L,{opt:x,toolsType:z,ops:(et==null?void 0:et.length)&&Br(et)||void 0});}}),n.selectIds=d.selectIds);w=[],A=[];d!=null&&d.rect&&w.push({rect:me(d.rect),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(d.rect),drawCanvas:Yt.Bg,viewId:this.viewId});M=i&&i({res:d,workShapeNode:n,param:s,postData:{render:w,sp:A},newServiceStore:v,smoothSync:u})||{render:w,sp:A};p&&M.sp.push({type:xt.RemoveNode,removeIds:p,viewId:this.viewId});_t33=M.render.length||M.sp.length;if(!_t33){_context35.n=3;break;}_context35.n=3;return this._post(M);case 3:return _context35.a(2);}},_callee34,this);}));function updateSelector(_x51){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35(e){var s,n,i,o;return _regenerator().w(function(_context36){while(1)switch(_context36.n){case 0:n=this.workShapes.get(Fe),i=n==null?void 0:n.blurSelector();if(!(this.clearWorkShapeNodeCache(Fe),((s=this.fullLayer)==null?void 0:s.parent).children.forEach(function(o){o.name===Fe&&o.remove();}),i)){_context36.n=1;break;}o=[];o.push(_objectSpread(_objectSpread({},i),{},{isSync:e==null?void 0:e.isSync,scenePath:e==null?void 0:e.scenePath}));_context36.n=1;return this._post({render:(i==null?void 0:i.rect)&&[{rect:me(i.rect),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(i.rect),drawCanvas:Yt.Bg,viewId:this.viewId}],sp:o});case 1:return _context36.a(2);}},_callee35,this);}));function blurSelector(_x52){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(Fe);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(Fe);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee36(){var e,o,n,i,s,a,_args37=arguments;return _regenerator().w(function(_context37){while(1)switch(_context37.n){case 0:e=_args37.length>0&&_args37[0]!==undefined?_args37[0]:!1;n=this.workShapes.get(Fe);if(n){_context37.n=1;break;}return _context37.a(2);case 1:if(!(n&&!((o=n.selectIds)!=null&&o.length))){_context37.n=3;break;}_context37.n=2;return this.blurSelector();case 2:return _context37.a(2);case 3:i=n.oldSelectRect,s=n.reRenderSelector();if(!s){_context37.n=4;break;}a=Jt(i,s)||s;_context37.n=4;return this._post({render:[{rect:me(a),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(a),drawCanvas:Yt.Bg,viewId:this.viewId}],sp:[{type:xt.Select,selectIds:n.selectIds,selectRect:s,willSyncService:e,viewId:this.viewId,points:n.getChildrenPoints(),textOpt:n.textOpt,selectorColor:n.selectorColor,strokeColor:n.strokeColor,fillColor:n.fillColor,canTextEdit:n.canTextEdit,canRotate:n.canRotate,scaleType:n.scaleType,opt:n.getWorkOptions()||void 0,canLock:n.canLock,isLocked:n.isLocked,toolsTypes:n.toolsTypes,shapeOpt:n.shapeOpt,thickness:n.thickness,useStroke:n.useStroke,strokeType:n.strokeType}]});case 4:return _context37.a(2);}},_callee36,this);}));function reRenderSelector(){return _reRenderSelector.apply(this,arguments);}return reRenderSelector;}()},{key:"updateFullSelectWork",value:function(){var _updateFullSelectWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee37(e){var s,o,a,u,d,v,p,n,i,_n$updateSelectIds,w,A,M;return _regenerator().w(function(_context38){while(1)switch(_context38.n){case 0:n=this.workShapes.get(Fe),i=e.selectIds;if(i!=null&&i.length){_context38.n=2;break;}_context38.n=1;return this.blurSelector(e);case 1:return _context38.a(2);case 2:if(n){_context38.n=4;break;}!this.setFullWork(e)&&e.workId&&((s=this.tmpOpt)==null?void 0:s.toolsType)===It.Selector&&this.createWorkShape(e.workId.toString());_context38.n=3;return this.updateFullSelectWork(e);case 3:return _context38.a(2);case 4:if(!(n&&i!=null&&i.length)){_context38.n=5;break;}_n$updateSelectIds=n.updateSelectIds(i),w=_n$updateSelectIds.bgRect,A=_n$updateSelectIds.selectRect,M={render:[],sp:[]};w&&((o=M.render)==null||o.push({rect:me(w),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(w),drawCanvas:Yt.Bg,viewId:this.viewId}));(p=M.sp)==null||p.push({selectorColor:((a=e.opt)==null?void 0:a.strokeColor)||n.selectorColor,strokeColor:((u=e.opt)==null?void 0:u.strokeColor)||n.strokeColor,fillColor:((d=e.opt)==null?void 0:d.fillColor)||n.fillColor,textOpt:((v=e.opt)==null?void 0:v.textOpt)||n.textOpt,canTextEdit:n.canTextEdit,canRotate:n.canRotate,scaleType:n.scaleType,type:xt.Select,viewId:this.viewId,dataType:Kt.Local,selectIds:e.selectIds,selectRect:A,points:n.getChildrenPoints(),willSyncService:(e==null?void 0:e.willSyncService)||!1,opt:(e==null?void 0:e.willSyncService)&&n.getWorkOptions()||void 0,canLock:n.canLock,isLocked:n.isLocked,toolsTypes:n.toolsTypes,shapeOpt:n.shapeOpt,thickness:n.thickness,useStroke:n.useStroke,strokeType:n.strokeType});_context38.n=5;return this._post(M);case 5:return _context38.a(2);}},_callee37,this);}));function updateFullSelectWork(_x53){return _updateFullSelectWork.apply(this,arguments);}return updateFullSelectWork;}()},{key:"destroy",value:function destroy(){this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1)),_superPropGet(iI,"destroy",this,3)([]),this.effectSelectNodeData.clear();}},{key:"drawEraserCombine",value:function(){var _drawEraserCombine=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee38(e,n,i,s){var a,u,d,v,p,w,o,A,M,E,L,G,_iterator81,_step81,_step81$value,_G7,z;return _regenerator().w(function(_context39){while(1)switch(_context39.n){case 0:o=(a=this.workShapes.get(e))==null?void 0:a.combineConsume({workerEngine:this});if(!o){_context39.n=1;break;}A=o.willDeleteNodes,M=o.willNewNodes,E=_toConsumableArray(A?Array.from(A):[]),L={render:[],fullWorkerDrawCount:n,sp:[]};if(o!=null&&o.rect){G=me(o.rect);(u=L.render)==null||u.push({rect:G,isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:G,drawCanvas:Yt.Bg,viewId:this.viewId});}if(s&&E.length&&((d=this.getWorkShape(e))==null?void 0:d.toolsType)===It.BitMapEraser&&((v=L.sp)==null||v.push({type:xt.None,collectUndoTicker:s,undoScopeIds:E,undoScopePhase:"collect"})),A!=null&&A.size&&((p=L.sp)==null||p.push({type:xt.RemoveNode,removeIds:_toConsumableArray(A),viewId:this.thread.viewId,needUndoTicker:i,collectUndoTicker:s})),M!=null&&M.size){_iterator81=_createForOfIteratorHelper(M);try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){_step81$value=_slicedToArray(_step81.value,2),_G7=_step81$value[0],z=_step81$value[1];(w=L.sp)==null||w.push({type:xt.FullWork,dataType:Kt.Local,toolsType:It.Pencil,ops:Br(z.op),opt:z.opt,workId:_G7,updateNodeOpt:{useAnimation:!1},needUndoTicker:i,collectUndoTicker:s});}}catch(err){_iterator81.e(err);}finally{_iterator81.f();}}_context39.n=1;return this._post(L);case 1:return _context39.a(2);}},_callee38,this);}));function drawEraserCombine(_x54,_x55,_x56,_x57){return _drawEraserCombine.apply(this,arguments);}return drawEraserCombine;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee39(e,n){var s,o,a,i,u,d;return _regenerator().w(function(_context40){while(1)switch(_context40.n){case 0:i=(s=this.workShapes.get(e))==null?void 0:s.combineConsume();if(!i){_context40.n=1;break;}u={render:[],fullWorkerDrawCount:n};if(i!=null&&i.rect){d=me(i.rect);(o=u.render)==null||o.push({rect:d,isClear:!0,clearCanvas:Yt.Float,viewId:this.viewId}),(a=u.render)==null||a.push({rect:d,drawCanvas:Yt.Float,viewId:this.viewId});}_context40.n=1;return this._post(u);case 1:return _context40.a(2);}},_callee39,this);}));function drawPencilCombine(_x58,_x59){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee40(e,n,i){var o,a,u,s;return _regenerator().w(function(_context41){while(1)switch(_context41.n){case 0:s={render:[],sp:[e]};(o=s.sp)==null||o.push({type:xt.SelectorTransform,emitEventType:ve.SelectMethod,workState:n,scenePath:e.scenePath});i&&((a=s.sp)==null||a.push({type:xt.None,isLockSentEventCursor:i}));e.rect&&((u=s.render)==null||u.push({rect:me(e.rect),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(e.rect),drawCanvas:Yt.Bg,viewId:this.viewId}));_context41.n=1;return this._post(s);case 1:return _context41.a(2);}},_callee40,this);}));function drawSelector(_x60,_x61,_x62){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee41(e,n,i,s){var v,p,w,A,M,E,L,o,a,u,d;return _regenerator().w(function(_context42){while(1)switch(_context42.n){case 0:o=s===It.Pencil,a=o&&e.type===xt.RemoveNode,u=((v=e.workId)==null?void 0:v.toString())||((w=(p=e.removeIds)==null?void 0:p[0])==null?void 0:w.toString()),d={fullWorkerDrawCount:1/0,render:[],sp:a?[]:[_objectSpread(_objectSpread({},e),{},{needUndoTicker:i,undoScopeIds:o&&u?[u]:e.undoScopeIds,undoScopePhase:o?"finalize":e.undoScopePhase})]};n&&((A=d.sp)==null||A.push({type:xt.None,isLockSentEventCursor:n}));a?(M=d.render)==null||M.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}):e!=null&&e.rect&&((E=d.render)==null||E.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId},{rect:e.rect,isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:e.rect,drawCanvas:Yt.Bg,viewId:this.viewId}));i&&((L=d.sp)==null||L.push({type:xt.None,needUndoTicker:i,undoScopeIds:a?[]:void 0,undoScopePhase:a?"finalize":void 0}));_context42.n=1;return this._post(d);case 1:return _context42.a(2);}},_callee41,this);}));function drawPencilFull(_x63,_x64,_x65,_x66){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"drawEraserFull",value:function(){var _drawEraserFull=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee42(e,n,i,s){var o,a,u,d,v,p,w,_iterator82,_step82,_step82$value,M,E,_iterator83,_step83,_step83$value,_M3,_E3,A;return _regenerator().w(function(_context43){while(1)switch(_context43.n){case 0:o=n.rect,a=n.willUpdateNodes,u=n.willDeleteNodes,d=n.willNewNodes,v=e.getWorkId(),p=[].concat(_toConsumableArray(a?Array.from(a.keys()).map(function(M){return String(M);}):[]),_toConsumableArray(u?Array.from(u):[]),_toConsumableArray(d?Array.from(d.keys()).map(function(M){return String(M);}):[])),w=[];if(s&&w.push({type:xt.None,needUndoTicker:s,undoScopeIds:p,undoScopePhase:"finalize"}),w.push({type:xt.RemoveNode,removeIds:[v],eraseTxnId:v,viewId:this.viewId,needUndoTicker:s}),i&&w.push({type:xt.None,isLockSentEventCursor:i}),a!=null&&a.size||u!=null&&u.size||d!=null&&d.size){if(a!=null&&a.size){_iterator82=_createForOfIteratorHelper(a);try{for(_iterator82.s();!(_step82=_iterator82.n()).done;){_step82$value=_slicedToArray(_step82.value,2),M=_step82$value[0],E=_step82$value[1];w.push({type:xt.UpdateNode,dataType:Kt.Local,opt:E.opt,workId:M,updateNodeOpt:{useAnimation:!1},eraseTxnId:v,needUndoTicker:s});}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}}if(u!=null&&u.size&&w.push({type:xt.RemoveNode,removeIds:_toConsumableArray(u),eraseTxnId:v,viewId:this.thread.viewId,needUndoTicker:s}),d!=null&&d.size){_iterator83=_createForOfIteratorHelper(d);try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){_step83$value=_slicedToArray(_step83.value,2),_M3=_step83$value[0],_E3=_step83$value[1];w.push({type:xt.FullWork,dataType:Kt.Local,toolsType:_E3.toolsType,ops:Br(_E3.op),opt:_E3.opt,workId:_M3,updateNodeOpt:{useAnimation:!1},needUndoTicker:s});}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}}}A=[{isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}];o&&A.push({rect:o,isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:o,drawCanvas:Yt.Bg,viewId:this.viewId});_context43.n=1;return this._post({sp:w,render:A,fullWorkerDrawCount:1/0});case 1:return _context43.a(2);}},_callee42,this);}));function drawEraserFull(_x67,_x68,_x69,_x70){return _drawEraserFull.apply(this,arguments);}return drawEraserFull;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee43(e,n,i,s){var o,a,u;return _regenerator().w(function(_context44){while(1)switch(_context44.n){case 0:o=[],a=[],u=e.removeIds||[];s&&u.length&&o.push({type:xt.None,collectUndoTicker:s,undoScopeIds:u,undoScopePhase:"collect"});n&&o.push({type:xt.None,isLockSentEventCursor:n});e.removeIds&&o.push(_objectSpread(_objectSpread({},e),{},{needUndoTicker:i,collectUndoTicker:s}));e.rect&&a.push({rect:e.rect,isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:e.rect,drawCanvas:Yt.Bg,viewId:this.viewId});i&&o.push({type:xt.None,needUndoTicker:i,undoScopePhase:"finalize"});_context44.n=1;return this._post({sp:o,render:a,consumeCount:this.consumeCount});case 1:return _context44.a(2);}},_callee43,this);}));function drawEraser(_x71,_x72,_x73,_x74){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawShape",value:function(){var _drawShape=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee44(e){return _regenerator().w(function(_context45){while(1)switch(_context45.n){case 0:_context45.n=1;return this._post({fullWorkerDrawCount:this.drawCount,sp:(e==null?void 0:e.op)&&[e]});case 1:return _context45.a(2);}},_callee44,this);}));function drawShape(_x75){return _drawShape.apply(this,arguments);}return drawShape;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee45(e){return _regenerator().w(function(_context46){while(1)switch(_context46.n){case 0:_context46.n=1;return this._post({sp:(e==null?void 0:e.op)&&[e]});case 1:return _context46.a(2);}},_callee45,this);}));function drawPencil(_x76){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee46(e){var n,_iterator84,_step84,i,s,o,a,_t34;return _regenerator().w(function(_context47){while(1)switch(_context47.p=_context47.n){case 0:_iterator84=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context47.p=1;_iterator84.s();case 2:if((_step84=_iterator84.n()).done){_context47.n=11;break;}i=_step84.value;s=this.setFullWork(i);if(!s){_context47.n=9;break;}o=(n=s.getWorkId())==null?void 0:n.toString();if(!(s.toolsType===It.BackgroundSVG)){_context47.n=3;break;}s.consumeService({isFullWork:!0,replaceId:o});_context47.n=8;break;case 3:if(!(s.toolsType===It.Image)){_context47.n=5;break;}_context47.n=4;return s.consumeServiceAsync({isFullWork:!0,replaceId:o,worker:this});case 4:_context47.n=8;break;case 5:if(!(s.toolsType===It.Text)){_context47.n=7;break;}_context47.n=6;return s.consumeServiceAsync({isFullWork:!0,replaceId:o,boxRect:this.thread.getSceneRect()});case 6:_context47.n=8;break;case 7:a=i.ops&&Os(i.ops);s.consumeService({op:a,isFullWork:!0,replaceId:o}),i!=null&&i.updateNodeOpt&&s.updataOptService(i.updateNodeOpt);case 8:i.workId&&this.workShapes.delete(i.workId.toString());case 9:this.effectSelectNodeData.delete(i);case 10:_context47.n=2;break;case 11:_context47.n=13;break;case 12:_context47.p=12;_t34=_context47.v;_iterator84.e(_t34);case 13:_context47.p=13;_iterator84.f();return _context47.f(13);case 14:_context47.n=15;return this.reRenderSelector(e);case 15:return _context47.a(2);}},_callee46,this,[[1,12,13,14]]);}));function runEffectSelectWork(_x77){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee47(e){var a,n,i,s,o,u,d,_t35;return _regenerator().w(function(_context48){while(1)switch(_context48.n){case 0:n=e.opt,i=e.toolsType,s=e.point,o=this.setFullWork({workId:Po,toolsType:i,opt:n});if(!(o&&s)){_context48.n=1;break;}u=o.cursorHover(s),d={render:[]};_t35=u&&u.type===xt.CursorHover&&u.rect;if(!_t35){_context48.n=1;break;}(a=d.render)==null||a.push({rect:me(u.rect),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(u.rect),drawCanvas:Yt.Bg,viewId:this.viewId});_context48.n=1;return this._post(d);case 1:return _context48.a(2);}},_callee47,this);}));function cursorHover(_x78){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee48(){var i,e,n,_t36,_t37;return _regenerator().w(function(_context49){while(1)switch(_context49.n){case 0:e=this.getWorkShape(Po);_t36=e&&(i=e.selectIds)!=null&&i.length;if(!_t36){_context49.n=1;break;}n=e.oldSelectRect;e.cursorBlur();this.clearWorkShapeNodeCache(Po);_t37=n;if(!_t37){_context49.n=1;break;}_context49.n=1;return this._post({render:[{rect:me(n),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(n),drawCanvas:Yt.Bg,viewId:this.viewId}]});case 1:this.fullLayer.parent.children.forEach(function(s){s.name==="Cursor_Hover_Id"&&s.remove();});case 2:return _context49.a(2);}},_callee48,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(x0);var sI=/*#__PURE__*/function(){function sI(t){_classCallCheck(this,sI);wt(this,"viewId");wt(this,"vNodes");wt(this,"fullLayer");wt(this,"drawLayer");wt(this,"workShapes",/* @__PURE__ */new Map());wt(this,"selectorWorkShapes",/* @__PURE__ */new Map());wt(this,"thread");wt(this,"animationId");wt(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());wt(this,"runEffectId");wt(this,"noAnimationRect");wt(this,"syncUnitTime",zr.syncOpt.interval);wt(this,"post");this.viewId=t.viewId,this.vNodes=t.vNodes,this.fullLayer=t.fullLayer,this.drawLayer=t.drawLayer,this.thread=t.thread,this.post=t.thread.post.bind(t.thread);}return _createClass(sI,[{key:"destroy",value:function destroy(){this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear();}},{key:"consumeDraw",value:function(){var _consumeDraw2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee49(t){return _regenerator().w(function(_context50){while(1)switch(_context50.n){case 0:this.activeWorkShape(t),this.runAnimation();case 1:return _context50.a(2);}},_callee49,this);}));function consumeDraw(_x79){return _consumeDraw2.apply(this,arguments);}return consumeDraw;}()},{key:"consumeFull",value:function consumeFull(t){if(this.activeWorkShape(t),t.refreshTextRender){this.animationId&&(clearTimeout(this.animationId),this.animationId=void 0),this.animationDraw();return;}this.runAnimation();}},{key:"runSelectWork",value:function runSelectWork(t){this.activeSelectorShape(t);var e=t.workId,n=e==null?void 0:e.toString();n&&this.willRunEffectSelectorIds.add(n),this.runEffect();}},{key:"setNodeKey",value:function setNodeKey(t,e,n,i){return e.toolsType=n,e.node=cf({workId:t,toolsType:n,toolsOpt:i,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),e;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(t){var _this74=this;t.forEach(function(e){_this74.selectorWorkShapes.forEach(function(n,i){var s;if((s=n.selectIds)!=null&&s.length){var o=n.selectIds.indexOf(e);o>-1&&(n.selectIds.splice(o,1),_this74.willRunEffectSelectorIds.add(i));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee50(t){var e,n,i;return _regenerator().w(function(_context51){while(1)switch(_context51.n){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context51.n=3;break;}i=this.workShapes.get(n);if(!i){_context51.n=2;break;}this.workShapes.delete(n);_context51.n=1;return this.removeNode(n,t,i==null?void 0:i.totalRect,!1);case 1:return _context51.a(2);case 2:_context51.n=3;return this.removeNode(n,t);case 3:return _context51.a(2);}},_callee50,this);}));function removeWork(_x80){return _removeWork3.apply(this,arguments);}return removeWork;}()},{key:"removeSelectWork",value:function removeSelectWork(t){var e=t.workId,n=e==null?void 0:e.toString();n&&(this.activeSelectorShape(t),this.willRunEffectSelectorIds.add(n)),this.runEffect();}},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee51(t,e,n){var _this75=this;var i,v,s,o,a,u,d,_args52=arguments,_t38;return _regenerator().w(function(_context52){while(1)switch(_context52.n){case 0:i=_args52.length>3&&_args52[3]!==undefined?_args52[3]:!0;t.indexOf(Fe)>-1&&this.removeSelectWork(e);s=n;o=(v=this.vNodes.get(t))==null?void 0:v.rect;o&&(s=Jt(o,s));a=this.fullLayer&&jt.getRectFromLayer(this.fullLayer,t);s=Jt(s,a);u=this.drawLayer&&jt.getRectFromLayer(this.drawLayer,t);s=Jt(s,u),this.fullLayer.getElementsByName(t).forEach(function(p){p.remove(),_Ur(p,_this75.fullLayer.parent);}),this.drawLayer.getElementsByName(t).forEach(function(p){p.remove(),_Ur(p,_this75.drawLayer.parent);});d=this.vNodes.get(t);d&&d.toolsType===It.BackgroundSVG&&this.post({sp:[{type:xt.BackgroundSVGDelete,toolsType:It.BackgroundSVG,workId:t,dataType:Kt.Service,viewId:this.viewId}]});this.vNodes.delete(t);_t38=s;if(!_t38){_context52.n=1;break;}_context52.n=1;return this.post({render:[{rect:me(s),isClear:!0,clearCanvas:i?Yt.Bg:Yt.ServiceFloat,workerType:i?void 0:Kt.Service,viewId:this.viewId},{rect:me(s),drawCanvas:i?Yt.Bg:Yt.ServiceFloat,workerType:i?void 0:Kt.Service,viewId:this.viewId}]});case 1:return _context52.a(2);}},_callee51,this);}));function removeNode(_x81,_x82,_x83){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(t){var L,G,z,et;var e=t.workId,n=t.opt,i=t.toolsType,s=t.type,o=t.updateNodeOpt,a=t.ops,u=t.op,d=t.useAnimation,v=t.isEnableCursor,p=t.requestId,w=t.refreshTextRender;if(!e)return;var A=e.toString(),M=(L=this.vNodes.get(A))==null?void 0:L.rect;if(!((G=this.workShapes)!=null&&G.has(A))){var x={toolsType:i,animationWorkData:u||[],animationIndex:0,type:s,updateNodeOpt:o,ops:a,useAnimation:_typeof(d)<"u"?d:_typeof(o==null?void 0:o.useAnimation)<"u"?o==null?void 0:o.useAnimation:!0,oldRect:M,isDiff:!1,isEnableCursor:v};i&&n&&(x=this.setNodeKey(A,x,i,n)),(z=this.workShapes)==null||z.set(A,x);}var E=(et=this.workShapes)==null?void 0:et.get(A);E.isEnableCursor=v,E.requestId=p,E.refreshTextRender=!!w,s&&(E.type=s),a&&(E.animationWorkData=Os(a),E.ops=a),o&&(E.updateNodeOpt=o),u&&(E.isDiff=this.hasDiffData(E.animationWorkData||[],u,E.toolsType),E.toolsType,It.Pencil,E.animationWorkData=u),E.node&&E.node.getWorkId()!==A&&E.node.setWorkId(A),M&&(E.oldRect=M),i&&n?(n.syncUnitTime&&(this.syncUnitTime=n.syncUnitTime),E.toolsType!==i&&i&&n&&this.setNodeKey(A,E,i,n),E.node&&E.node.setWorkOptions(n)):i&&(E.toolsType=i);}},{key:"hasDiffData",value:function hasDiffData(t,e,n){var i=t.length;if(e.length<i)return!0;switch(n){case It.Pencil:{for(var s=0;s<i;s+=3)if(e[s]!==t[s]||e[s+1]!==t[s+1])return!0;break;}case It.LaserPen:{for(var _s0=0;_s0<i;_s0+=2)if(e[_s0]!==t[_s0]||e[_s0+1]!==t[_s0+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee52(){var _this76=this;var i,s,o,a,u,d,v,p,w,A,M,E,L,G,z,et,x,y,S,C,P,X,$,K,j,nt,ct,F,R,Y,q,lt,ut,Tt,O,U,_,H,at,ht,yt,Et,Dt,D,N,t,e,n,_iterator85,_step85,_loop7,_t40,_t41;return _regenerator().w(function(_context54){while(1)switch(_context54.p=_context54.n){case 0:this.animationId=void 0;t=!1;e={render:[]},n=/* @__PURE__ */new Map();_iterator85=_createForOfIteratorHelper(this.workShapes.entries());_context54.p=1;_loop7=/*#__PURE__*/_regenerator().m(function _loop7(){var _step85$value,J,Q,V,tt,_V2,_tt2,_V3,_tt3,_V4,_tt4,g,I,_V5,_tt5,_g2,_I2,B,Z,st,_Z2,_V6,_tt6,_g3,_I3,_t39;return _regenerator().w(function(_context53){while(1)switch(_context53.n){case 0:_step85$value=_slicedToArray(_step85.value,2),J=_step85$value[0],Q=_step85$value[1];_t39=Q.toolsType;_context53.n=_t39===It.BackgroundSVG?1:_t39===It.Image?2:_t39===It.Text?4:_t39===It.Arrow?7:_t39===It.Straight?7:_t39===It.Rectangle?7:_t39===It.Ellipse?7:_t39===It.Star?7:_t39===It.Polygon?7:_t39===It.SpeechBalloon?7:_t39===It.Pencil?8:13;break;case 1:V=Q.oldRect;V&&((i=e.render)==null||i.push({rect:V,isClear:!0,clearCanvas:Yt.Bg,viewId:_this76.viewId}),(s=e.render)==null||s.push({rect:V,drawCanvas:Yt.Bg,viewId:_this76.viewId}));tt=(o=Q.node)==null?void 0:o.consumeService({isFullWork:!0,replaceId:J});_this76.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this76.willRunEffectSelectorIds.add(I),_this76.noAnimationRect=Jt(_this76.noAnimationRect,V),_this76.noAnimationRect=Jt(_this76.noAnimationRect,tt),_this76.runEffect());}),_this76.workShapes.delete(J),(a=e.render)==null||a.push({rect:tt,drawCanvas:Yt.Bg,viewId:_this76.viewId});return _context53.a(3,13);case 2:_V2=Q.oldRect;_V2&&((u=e.render)==null||u.push({rect:_V2,isClear:!0,clearCanvas:Yt.Bg,viewId:_this76.viewId}),(d=e.render)==null||d.push({rect:_V2,drawCanvas:Yt.Bg,viewId:_this76.viewId}));_context53.n=3;return(v=Q.node)==null?void 0:v.consumeServiceAsync({isFullWork:!0,worker:_this76.thread});case 3:_tt2=_context53.v;_this76.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this76.willRunEffectSelectorIds.add(I),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_V2),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_tt2),_this76.runEffect());}),_this76.workShapes.delete(J),(p=e.render)==null||p.push({rect:_tt2,drawCanvas:Yt.Bg,viewId:_this76.viewId});return _context53.a(3,13);case 4:if(!Q.node){_context53.n=6;break;}_V3=Q.oldRect;_V3&&((w=e.render)==null||w.push({rect:_V3,isClear:!0,clearCanvas:Yt.Bg,viewId:_this76.viewId}),(A=e.render)==null||A.push({rect:_V3,drawCanvas:Yt.Bg,viewId:_this76.viewId}));_context53.n=5;return Q.node.consumeServiceAsync({isFullWork:!0,replaceId:J,boxRect:_this76.thread.getSceneRect()});case 5:_tt3=_context53.v;_this76.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this76.willRunEffectSelectorIds.add(I),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_V3),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_tt3),_this76.runEffect());}),Q.refreshTextRender&&Q.requestId&&(e.sp=e.sp||[],e.sp.push({type:xt.RefreshTextRender,requestId:Q.requestId,workId:J,viewId:_this76.viewId})),(M=Q.node)==null||M.clearTmpPoints(),_this76.workShapes.delete(J),(E=e.render)==null||E.push({rect:_tt3,drawCanvas:Yt.Bg,viewId:_this76.viewId});case 6:return _context53.a(3,13);case 7:_V4=!!Q.ops;if((L=Q.animationWorkData)!=null&&L.length){_tt4=Q.oldRect,g=Q.node.oldRect;_tt4&&((G=e.render)==null||G.push({rect:_tt4,isClear:!0,clearCanvas:Yt.Bg,viewId:_this76.viewId}),(z=e.render)==null||z.push({rect:_tt4,drawCanvas:Yt.Bg,viewId:_this76.viewId})),g&&((et=e.render)==null||et.push({rect:g,isClear:!0,clearCanvas:Yt.ServiceFloat,viewId:_this76.viewId}));I=(x=Q.node)==null?void 0:x.consumeService({op:Q.animationWorkData,isFullWork:_V4});Q.isEnableCursor?n.set(J,{cursorTool:kn(Q.toolsType),workState:_tt4?Q.ops?te.Done:te.Doing:te.Start,op:Q.animationWorkData.slice(-3,-1)}):_V4&&!Q.useAnimation&&(y=Q.updateNodeOpt)!=null&&y.useAnimation&&n.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:Q.animationWorkData.slice(-3,-1),uid:(S=Q.updateNodeOpt)==null?void 0:S.uid}),_V4?(_this76.selectorWorkShapes.forEach(function(B,Z){var st;(st=B.selectIds)!=null&&st.includes(J)&&(_this76.willRunEffectSelectorIds.add(Z),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_tt4),_this76.noAnimationRect=Jt(_this76.noAnimationRect,g),_this76.noAnimationRect=Jt(_this76.noAnimationRect,I),_this76.runEffect());}),(C=Q.node)==null||C.clearTmpPoints(),_this76.workShapes.delete(J),(P=e.render)==null||P.push({rect:I,drawCanvas:Yt.Bg,viewId:_this76.viewId})):(X=e.render)==null||X.push({rect:I,drawCanvas:Yt.ServiceFloat,workerType:_V4?void 0:Kt.Service,viewId:_this76.viewId}),Q.animationWorkData.length=0;}return _context53.a(3,13);case 8:if(!Q.useAnimation){_context53.n=11;break;}if(!Q.useAnimation){_context53.n=10;break;}if(!Q.isDel){_context53.n=9;break;}(O=Q.node)==null||O.clearTmpPoints(),_this76.workShapes.delete(J);return _context53.a(3,13);case 9:_V5=3,_tt5=_this76.computNextAnimationIndex(Q,_V5),_g2=Q.isDiff?0:Math.max(0,(Q.animationIndex||0)-_V5),_I2=(Q.animationWorkData||[]).slice(0,_tt5),B=(_=(U=Q.node)==null?void 0:U.getWorkId())==null?void 0:_.toString();if((Q.animationIndex||0)<_tt5||Q.isDiff){Z=(H=Q.node)==null?void 0:H.consumeService({op:_I2,isFullWork:!1,replaceId:B});if((at=e.render)==null||at.push({isClear:!0,rect:Z,clearCanvas:Yt.ServiceFloat,viewId:_this76.viewId}),(ht=e.render)==null||ht.push({rect:Z,drawCanvas:Yt.ServiceFloat,viewId:_this76.viewId}),Q.animationIndex=_tt5,Q.isDiff&&(Q.isDiff=!1),_I2.length&&Q.isEnableCursor){st=_I2.slice(-3,-1);n.set(J,{cursorTool:kn(Q.toolsType),workState:_g2===0?te.Start:_tt5===((yt=Q.animationWorkData)==null?void 0:yt.length)?te.Done:te.Doing,op:st});}}else if(Q.ops){_Z2=(Et=Q.node)==null?void 0:Et.consumeService({op:Q.animationWorkData||[],isFullWork:!0,replaceId:B});Q.isDel=!0,(Dt=e.render)==null||Dt.push({isClear:!0,rect:_Z2,clearCanvas:Yt.ServiceFloat,viewId:_this76.viewId},{rect:_Z2,drawCanvas:Yt.ServiceFloat,viewId:_this76.viewId},{isClear:!0,rect:_Z2,clearCanvas:Yt.Bg,viewId:_this76.viewId},{rect:_Z2,drawCanvas:Yt.Bg,viewId:_this76.viewId}),Q.isEnableCursor&&n.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:_I2.slice(-3,-1)});}t=!0;return _context53.a(3,13);case 10:_context53.n=12;break;case 11:_V6=!!Q.ops;_tt6=($=Q.node)==null?void 0:$.consumeService({op:Q.animationWorkData||[],isFullWork:_V6,replaceId:J});_g3=(K=Q.node)==null?void 0:K.updataOptService(Q.updateNodeOpt);if(_V6){if(_tt6=Jt(_tt6,_g3),(j=e.render)==null||j.push({isClear:!0,rect:Jt(Q.oldRect,_tt6),clearCanvas:Yt.Bg,viewId:_this76.viewId}),(nt=e.render)==null||nt.push({rect:Jt(Q.oldRect,_tt6),drawCanvas:Yt.Bg,viewId:_this76.viewId}),(ct=Q.updateNodeOpt)!=null&&ct.useAnimation&&((F=e.render)==null||F.push({isClear:!0,rect:Jt(Q.oldRect,_tt6),clearCanvas:Yt.ServiceFloat,viewId:_this76.viewId}),(R=e.render)==null||R.push({rect:Jt(Q.oldRect,_tt6),drawCanvas:Yt.ServiceFloat,viewId:_this76.viewId}),!Q.isEnableCursor&&(Y=Q.animationWorkData)!=null&&Y.length)){_I3=Q.animationWorkData.slice(-3,-1);n.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:_I3,uid:(q=Q.updateNodeOpt)==null?void 0:q.uid});}_this76.selectorWorkShapes.forEach(function(I,B){var Z;(Z=I.selectIds)!=null&&Z.includes(J)&&(_this76.willRunEffectSelectorIds.add(B),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_tt6),_this76.runEffect());}),(lt=Q.node)==null||lt.clearTmpPoints(),_this76.workShapes.delete(J);}else _tt6=Jt(_tt6,_g3),(ut=e.render)==null||ut.push({isClear:!0,rect:Jt(Q.oldRect,_tt6),clearCanvas:Yt.ServiceFloat,viewId:_this76.viewId}),(Tt=e.render)==null||Tt.push({rect:Jt(Q.oldRect,_tt6),drawCanvas:Yt.ServiceFloat,viewId:_this76.viewId});case 12:return _context53.a(3,13);case 13:return _context53.a(2);}},_loop7);});_iterator85.s();case 2:if((_step85=_iterator85.n()).done){_context54.n=4;break;}return _context54.d(_regeneratorValues(_loop7()),3);case 3:_context54.n=2;break;case 4:_context54.n=6;break;case 5:_context54.p=5;_t40=_context54.v;_iterator85.e(_t40);case 6:_context54.p=6;_iterator85.f();return _context54.f(6);case 7:t&&this.runAnimation();n.size&&(e.sp=e.sp||[],n.forEach(function(J,Q){var V;(V=e.sp)==null||V.push({type:xt.Cursor,uid:J.uid||Q.split(Oo)[0],op:J.op,workState:J.workState,cursorTool:J.cursorTool,viewId:_this76.viewId});}));_t41=(D=e.render)!=null&&D.length||(N=e.sp)!=null&&N.length;if(!_t41){_context54.n=8;break;}_context54.n=8;return this.post(e);case 8:return _context54.a(2);}},_callee52,this,[[1,5,6,7]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this77=this;this.animationId||(this.animationId=setTimeout(function(){_this77.animationId=void 0,_this77.animationDraw();},16));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(t,e){var n=Math.floor((t.animationWorkData||[]).slice(t.animationIndex).length*48/e/this.syncUnitTime)*e;return Math.min((t.animationIndex||0)+(n||e),(t.animationWorkData||[]).length);}},{key:"runEffect",value:function runEffect(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0));}},{key:"effectRunSelector",value:function(){var _effectRunSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee53(){var _this78=this;var t,_t42;return _regenerator().w(function(_context55){while(1)switch(_context55.n){case 0:this.runEffectId=void 0;t=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(e){var s,o;var n=_this78.selectorWorkShapes.get(e),i=n&&n.selectIds&&((s=n.node)==null?void 0:s.selectServiceNode(e,n,!0));t=Jt(t,i),(o=n==null?void 0:n.selectIds)!=null&&o.length||_this78.selectorWorkShapes.delete(e);});_t42=t;if(!_t42){_context55.n=1;break;}_context55.n=1;return this.post({render:[{rect:me(t),isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:me(t),drawCanvas:Yt.Bg,viewId:this.viewId}]});case 1:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 2:return _context55.a(2);}},_callee53,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(t){var v,p,w;var e=t.workId,n=t.opt,i=t.toolsType,s=t.type,o=t.selectIds,a=t.imageBitmap;if(!e)return;var u=e.toString();if(!((v=this.selectorWorkShapes)!=null&&v.has(u))){var A={toolsType:i,selectIds:o,type:s,opt:n,imageBitmap:a};i&&n&&(A=this.setNodeKey(u,A,i,n)),(p=this.selectorWorkShapes)==null||p.set(u,A);}var d=(w=this.selectorWorkShapes)==null?void 0:w.get(u);s&&(d.type=s),d.node&&d.node.getWorkId()!==u&&d.node.setWorkId(u),a&&(d.imageBitmap=a),d.selectIds=o||[];}}]);}();var jbt=/*#__PURE__*/function(_x84){function jbt(e){var _this79;_classCallCheck(this,jbt);_this79=_callSuper(this,jbt,[e]);wt(_this79,"drawWorkActiveId");return _this79;}_inherits(jbt,_x84);return _createClass(jbt,[{key:"runSelectWork",value:function runSelectWork(e){var i;var n=this.setFullWork(e);n&&(i=e.selectIds)!=null&&i.length&&e.workId&&n.selectServiceNode(e.workId.toString(),{selectIds:e.selectIds},!1);}},{key:"workShapesDone",value:function workShapesDone(){var _iterator86=_createForOfIteratorHelper(this.workShapes.keys()),_step86;try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){var e=_step86.value;this.clearWorkShapeNodeCache(e);}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}qr(this.fullLayer,this.fullLayer.parent);}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee54(e){var n,i,s,o,a,u,d,_t43,_t44,_t45,_t46,_t47,_t48,_t49,_t50,_t51;return _regenerator().w(function(_context56){while(1)switch(_context56.n){case 0:n=e.workId,i=e.fullWorkerDrawCount,s=e.postCount,o=n==null?void 0:n.toString(),a=o&&this.workShapes.get(o);if(a){_context56.n=4;break;}_t43=o&&Ze(s);if(!_t43){_context56.n=2;break;}_context56.n=1;return this.drawAckBackpressure.wait(o);case 1:_t43=_context56.v;case 2:_t44=_t43;if(!_t44){_context56.n=3;break;}_context56.n=3;return this._post({consumeCount:s,consumeWorkId:o});case 3:return _context56.a(2);case 4:_t45=this.drawWorkActiveId&&this.drawWorkActiveId!==o;if(!_t45){_context56.n=6;break;}_context56.n=5;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:xt.DrawWork,dataType:Kt.Local});case 5:this.drawWorkActiveId=void 0;case 6:!this.drawWorkActiveId&&o!==Fe&&(this.drawWorkActiveId=o);u=a.toolsType;Ze(s)&&(this.consumeCount=s);d=a.consume({data:e,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0,removeDrawCount:i});_t46=u;_context56.n=_t46===It.Selector?7:_t46===It.Ellipse?9:_t46===It.Arrow?9:_t46===It.Straight?9:_t46===It.Rectangle?9:_t46===It.Star?9:_t46===It.Polygon?9:_t46===It.SpeechBalloon?9:_t46===It.Pencil?11:_t46===It.BitMapEraser?13:_t46===It.PencilEraser?13:16;break;case 7:_t47=d;if(!_t47){_context56.n=8;break;}this.drawCount++;_context56.n=8;return this.drawSelector(d);case 8:return _context56.a(3,16);case 9:_t48=d;if(!_t48){_context56.n=10;break;}this.drawCount++;_context56.n=10;return this.drawShape(d);case 10:return _context56.a(3,16);case 11:_t49=d;if(!_t49){_context56.n=12;break;}this.drawCount++;_context56.n=12;return this.drawPencil(d,n==null?void 0:n.toString());case 12:return _context56.a(3,16);case 13:_t50=d;if(!_t50){_context56.n=15;break;}this.drawCount++;_context56.n=14;return this.drawAckBackpressure.wait(o);case 14:_t51=_context56.v;if(!_t51){_context56.n=15;break;}_context56.n=15;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,consumeWorkId:o});case 15:return _context56.a(3,16);case 16:return _context56.a(2);}},_callee54,this);}));function consumeDraw(_x85){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee55(e){var n,i,s,_t52;return _regenerator().w(function(_context57){while(1)switch(_context57.n){case 0:n=e.workId;if(!n){_context57.n=4;break;}i=n.toString();this.drawAckBackpressure.finish(i),this.drawWorkActiveId===i&&(this.drawWorkActiveId=void 0);s=this.workShapes.get(i);if(s){_context57.n=1;break;}return _context57.a(2);case 1:_t52=s.toolsType;_context57.n=_t52===It.Selector?2:_t52===It.Arrow?3:_t52===It.Straight?3:_t52===It.Ellipse?3:_t52===It.Pencil?3:_t52===It.Rectangle?3:_t52===It.Star?3:_t52===It.Polygon?3:_t52===It.SpeechBalloon?3:_t52===It.BitMapEraser?3:_t52===It.PencilEraser?3:4;break;case 2:this.drawCount=0,qr(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(i),this._post({render:[{isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}]});return _context57.a(3,4);case 3:this.drawCount=0,qr(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(i);return _context57.a(3,4);case 4:return _context57.a(2);}},_callee55,this);}));function consumeDrawAll(_x86){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee56(e){var n,i,s,o;return _regenerator().w(function(_context58){while(1)switch(_context58.n){case 0:n=e.workId,i=n==null?void 0:n.toString();if(!i){_context58.n=1;break;}s=this.removeNode(i);if(!s){_context58.n=1;break;}o=[];o.push({rect:me(s),clearCanvas:Yt.Float,isClear:!0,viewId:this.viewId},{rect:me(s),drawCanvas:Yt.Float,viewId:this.viewId});_context58.n=1;return this._post({render:o});case 1:return _context58.a(2);}},_callee56,this);}));function removeWork(_x87){return _removeWork4.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(e){var _this80=this;var n=this.workShapes.has(e);var i;return n&&(this.fullLayer.getElementsByName(e).forEach(function(s){var o=s.getBoundingClientRect();i=Jt(i,{x:o.x-jt.SafeBorderPadding,y:o.y-jt.SafeBorderPadding,w:o.width+jt.SafeBorderPadding*2,h:o.height+jt.SafeBorderPadding*2}),s.remove(),_Ur(s,_this80.fullLayer.parent);}),i&&this.clearWorkShapeNodeCache(e)),i;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee57(e,n){var _t53,_t54;return _regenerator().w(function(_context59){while(1)switch(_context59.n){case 0:_t53=!n;if(_t53){_context59.n=2;break;}_context59.n=1;return this.drawAckBackpressure.wait(n);case 1:_t53=!_context59.v;case 2:_t54=_t53;if(_t54){_context59.n=3;break;}_context59.n=3;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,consumeWorkId:n,render:[{rect:e==null?void 0:e.rect,workId:n,drawCanvas:Yt.Float,viewId:this.viewId}],sp:(e==null?void 0:e.op)&&[e]});case 3:return _context59.a(2);}},_callee57,this);}));function drawPencil(_x88,_x89){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee58(e){return _regenerator().w(function(_context60){while(1)switch(_context60.n){case 0:_context60.n=1;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(e==null?void 0:e.rect)&&me(e.rect),isClear:!0,clearCanvas:Yt.Float,viewId:this.viewId},{rect:(e==null?void 0:e.rect)&&me(e.rect),drawCanvas:Yt.Float,viewId:this.viewId}]});case 1:return _context60.a(2);}},_callee58,this);}));function drawShape(_x90){return _drawShape2.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee59(e){return _regenerator().w(function(_context61){while(1)switch(_context61.n){case 0:_context61.n=1;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(e==null?void 0:e.rect)&&me(e.rect),isClear:!0,clearCanvas:Yt.Float,viewId:this.viewId},{rect:(e==null?void 0:e.rect)&&me(e.rect),drawCanvas:Yt.Float,viewId:this.viewId}]});case 1:return _context61.a(2);}},_callee59,this);}));function drawSelector(_x91){return _drawSelector2.apply(this,arguments);}return drawSelector;}()}]);}(x0);var Xbt=/*#__PURE__*/function(){function Xbt(t){_classCallCheck(this,Xbt);wt(this,"viewId");wt(this,"vNodes");wt(this,"topLayer");wt(this,"thread");wt(this,"post");wt(this,"serviceWorkShapes",/* @__PURE__ */new Map());wt(this,"localWorkShapes",/* @__PURE__ */new Map());wt(this,"tmpOpt");wt(this,"syncUnitTime",zr.syncOpt.interval);wt(this,"animationId");this.viewId=t.viewId,this.vNodes=t.vNodes,this.topLayer=t.topLayer,this.thread=t.thread,this.post=t.thread.post.bind(t.thread);}return _createClass(Xbt,[{key:"canUseTopLayer",value:function canUseTopLayer(t){return t===It.LaserPen;}},{key:"getWorkShape",value:function getWorkShape(t){return this.localWorkShapes.get(t);}},{key:"createWorkShape",value:function createWorkShape(t,e){if(t&&this.tmpOpt){var n={toolsType:this.tmpOpt.toolsType,toolsOpt:e||this.tmpOpt.toolsOpt},i=this.createWorkShapeNode(_objectSpread(_objectSpread({},n),{},{workId:t}));return i&&this.localWorkShapes.set(t,{node:i,toolsType:i.toolsType,workState:te.Start}),i;}}},{key:"setWorkOptions",value:function setWorkOptions(t,e){var i;var n=(i=this.localWorkShapes.get(t))==null?void 0:i.node;n||this.createWorkShape(t,e),n==null||n.setWorkOptions(e);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(t){var e=t.toolsType;if(e===It.LaserPen)return cf(_objectSpread(_objectSpread({},t),{},{vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer}));}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.localWorkShapes.forEach(function(t){var e;return(e=t.node)==null?void 0:e.clearTmpPoints();}),this.localWorkShapes.clear();}},{key:"setToolsOpt",value:function setToolsOpt(t){var e;this.tmpOpt=t,(e=t.toolsOpt)!=null&&e.syncUnitTime&&(this.syncUnitTime=t.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"consumeDraw",value:function consumeDraw(t){var e=t.workId,n=t.dataType;if(n===Kt.Service)this.activeServiceWorkShape(t);else{var i=e==null?void 0:e.toString(),s=i&&this.localWorkShapes.get(i);if(!s)return;var o=s.node.consume({data:t,isFullWork:!1,isSubWorker:!0});o.rect&&(s.totalRect=Jt(o.rect,s.totalRect),s.result=o,s.workState=te.Doing,i&&this.localWorkShapes.set(i,s));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(t){var e=t.workId,n=t.dataType;if(n===Kt.Service)this.activeServiceWorkShape(t);else{var i=e==null?void 0:e.toString(),s=i&&this.localWorkShapes.get(i);if(!s)return;var o=s.node.consumeAll({data:t});s.totalRect=Jt(o.rect,s.totalRect),s.result=o,s.workState=te.Done,i&&this.localWorkShapes.set(i,s);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(t,e,n,i){return e.toolsType=n,e.node=this.createWorkShapeNode({workId:t,toolsType:n,toolsOpt:i}),e;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(t){var w,A;var e=t.workId,n=t.opt,i=t.toolsType,s=t.type,o=t.updateNodeOpt,a=t.ops,u=t.op;if(!e)return;var d=e.toString(),v=(w=this.vNodes.get(d))==null?void 0:w.rect;if(!((A=this.serviceWorkShapes)!=null&&A.has(d))){var M={toolsType:i,animationWorkData:u||[],animationIndex:0,type:s,updateNodeOpt:o,ops:a,oldRect:v};i&&n&&(M=this.setNodeKey(d,M,i,n)),this.serviceWorkShapes.set(d,M);}var p=this.serviceWorkShapes.get(d);s&&(p.type=s),a&&(p.animationWorkData=Os(a),p.ops=a),o&&(p.updateNodeOpt=o),u&&(p.animationWorkData=u),p.node&&p.node.getWorkId()!==d&&p.node.setWorkId(d),v&&(p.oldRect=v),i&&n?(p.toolsType!==i&&i&&n&&this.setNodeKey(d,p,i,n),p.node&&p.node.setWorkOptions(n)):i&&(p.toolsType=i);}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(t,e){var n=Math.floor((t.animationWorkData||[]).slice(t.animationIndex).length*32/e/this.syncUnitTime)*e;return Math.min((t.animationIndex||0)+(n||e),(t.animationWorkData||[]).length);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee60(){var _this81=this;var o,a,u,d,t,e,n,i,s,_iterator87,_step87,_step87$value,v,p,A,M,E,L,_iterator88,_step88,_step88$value,_v10,_p6,w,_A5,_M4,_E4,_L20,_t55,_t56,_t57,_t58;return _regenerator().w(function(_context62){while(1)switch(_context62.p=_context62.n){case 0:this.animationId=void 0;t=!1;e=/* @__PURE__ */new Map(),n=[],i=[],s=[];_iterator87=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context62.p=1;_iterator87.s();case 2:if((_step87=_iterator87.n()).done){_context62.n=6;break;}_step87$value=_slicedToArray(_step87.value,2),v=_step87$value[0],p=_step87$value[1];_t55=p.toolsType;_context62.n=_t55===It.LaserPen?3:5;break;case 3:A=this.computNextAnimationIndex(p,8),M=Math.max(0,p.animationIndex||0),E=(p.animationWorkData||[]).slice(M,A);if((p.animationIndex||0)<A){L=(o=p.node)==null?void 0:o.consumeService({op:E,isFullWork:!1});p.totalRect=Jt(p.totalRect,L),p.animationIndex=A,E.length&&e.set(v,{cursorTool:kn(p.toolsType),workState:M===0?te.Start:A===((a=p.animationWorkData)==null?void 0:a.length)?te.Done:te.Doing,op:E.slice(-2)});}if(!(i.push({isClear:!0,rect:p.totalRect,clearCanvas:Yt.TopFloat,viewId:this.viewId}),n.push({rect:p.totalRect,drawCanvas:Yt.TopFloat,viewId:this.viewId}),p.isDel)){_context62.n=4;break;}(u=p.node)==null||u.clearTmpPoints(),this.serviceWorkShapes.delete(v);return _context62.a(3,5);case 4:p.ops&&p.animationIndex===((d=p.animationWorkData)==null?void 0:d.length)&&!p.isDel&&(this.topLayer.getElementsByName(v.toString())[0]||(p.isDel=!0,this.serviceWorkShapes.set(v,p))),t=!0;return _context62.a(3,5);case 5:_context62.n=2;break;case 6:_context62.n=8;break;case 7:_context62.p=7;_t56=_context62.v;_iterator87.e(_t56);case 8:_context62.p=8;_iterator87.f();return _context62.f(8);case 9:_iterator88=_createForOfIteratorHelper(this.localWorkShapes.entries());_context62.p=10;_iterator88.s();case 11:if((_step88=_iterator88.n()).done){_context62.n=15;break;}_step88$value=_slicedToArray(_step88.value,2),_v10=_step88$value[0],_p6=_step88$value[1];w=_p6.result,_A5=_p6.toolsType,_M4=_p6.totalRect,_E4=_p6.isDel,_L20=_p6.workState;_t57=_A5;_context62.n=_t57===It.LaserPen?12:14;break;case 12:if(!(_M4&&(i.push({isClear:!0,rect:_M4,clearCanvas:Yt.TopFloat,viewId:this.viewId}),n.push({rect:_M4,drawCanvas:Yt.TopFloat,viewId:this.viewId})),_E4)){_context62.n=13;break;}_p6.node.clearTmpPoints(),this.localWorkShapes.delete(_v10),s.push({removeIds:[_v10.toString()],viewId:this.viewId,type:xt.RemoveNode});return _context62.a(3,14);case 13:w&&((w.op||w.ops)&&s.push(w),_p6.result=void 0),!this.topLayer.getElementsByName(_v10.toString())[0]&&_L20===te.Done&&(_p6.isDel=!0,this.localWorkShapes.set(_v10,_p6)),t=!0;return _context62.a(3,14);case 14:_context62.n=11;break;case 15:_context62.n=17;break;case 16:_context62.p=16;_t58=_context62.v;_iterator88.e(_t58);case 17:_context62.p=17;_iterator88.f();return _context62.f(17);case 18:t&&this.runAnimation(),e.size&&e.forEach(function(v,p){s.push({type:xt.Cursor,uid:p.split(Oo)[0],op:v.op,workState:v.workState,cursorTool:v.cursorTool,viewId:_this81.viewId});}),(n.length||i.length||s.length)&&this.post({render:[].concat(i,n),sp:s});case 19:return _context62.a(2);}},_callee60,this,[[10,16,17,18],[1,7,8,9]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this82=this;this.animationId||(this.animationId=setTimeout(function(){_this82.animationId=void 0,_this82.animationDraw();},16));}}]);}();var Gbt=/*#__PURE__*/function(_iI){function Gbt(e){var _this83;_classCallCheck(this,Gbt);_this83=_callSuper(this,Gbt,[e]);wt(_this83,"_type","simple");return _this83;}_inherits(Gbt,_iI);return _createClass(Gbt,[{key:"createWorkShapeNode",value:function createWorkShapeNode(e){var i;var n=e.toolsType;return n===It.Selector?this.vNodes?new Xa(_objectSpread(_objectSpread({},e),{},{fullLayer:this.fullLayer,vNodes:this.vNodes,drawLayer:this.drawLayer})):void 0:cf(_objectSpread(_objectSpread({},e),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(i=this.thread)==null?void 0:i.serviceWork);}},{key:"drawPencil",value:function(){var _drawPencil3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee61(e,n){var _t59,_t60;return _regenerator().w(function(_context63){while(1)switch(_context63.n){case 0:_t59=!n;if(_t59){_context63.n=2;break;}_context63.n=1;return this.drawAckBackpressure.wait(n);case 1:_t59=!_context63.v;case 2:_t60=_t59;if(_t60){_context63.n=3;break;}_context63.n=3;return this._post({consumeCount:this.consumeCount,consumeWorkId:n,render:[{rect:e==null?void 0:e.rect,workId:n,drawCanvas:Yt.Float,viewId:this.viewId}],sp:(e==null?void 0:e.op)&&[e]});case 3:return _context63.a(2);}},_callee61,this);}));function drawPencil(_x92,_x93){return _drawPencil3.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee62(e){return _regenerator().w(function(_context64){while(1)switch(_context64.n){case 0:_context64.n=1;return this._post({consumeCount:this.consumeCount,sp:(e==null?void 0:e.op)&&[e],render:[{rect:(e==null?void 0:e.rect)&&me(e.rect),isClear:!0,clearCanvas:Yt.Float,viewId:this.viewId},{rect:(e==null?void 0:e.rect)&&me(e.rect),drawCanvas:Yt.Float,viewId:this.viewId}]});case 1:return _context64.a(2);}},_callee62,this);}));function drawShape(_x94){return _drawShape3.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee63(e,n,i){var s,a,u,d,v,o,_args65=arguments;return _regenerator().w(function(_context65){while(1)switch(_context65.n){case 0:s=_args65.length>3&&_args65[3]!==undefined?_args65[3]:[];o={render:s,sp:[e],consumeCount:this.consumeCount};(a=o.sp)==null||a.push({type:xt.SelectorTransform,emitEventType:ve.SelectMethod,workState:n});i&&((u=o.sp)==null||u.push({type:xt.None,isLockSentEventCursor:i}));e.subRect&&((d=o.render)==null||d.push({rect:me(e.subRect),isClear:!0,clearCanvas:Yt.Float,viewId:this.viewId},{rect:me(e.subRect),drawCanvas:Yt.Float,viewId:this.viewId}));e.rect&&((v=o.render)==null||v.push({rect:me(e.rect),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(e.rect),drawCanvas:Yt.Bg,viewId:this.viewId}));_context65.n=1;return this._post(o);case 1:return _context65.a(2);}},_callee63,this);}));function drawSelector(_x95,_x96,_x97){return _drawSelector3.apply(this,arguments);}return drawSelector;}()},{key:"drawEraserCombine",value:function(){var _drawEraserCombine2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee64(e){var i,s,o,a,n,u,d,v,p,_iterator89,_step89,_step89$value,_p7,w;return _regenerator().w(function(_context66){while(1)switch(_context66.n){case 0:n=(i=this.workShapes.get(e))==null?void 0:i.combineConsume({workerEngine:this});if(!n){_context66.n=1;break;}u=n.willDeleteNodes,d=n.willNewNodes,v={render:[],sp:[]};if(n!=null&&n.rect){p=me(n.rect);(s=v.render)==null||s.push({rect:p,isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:p,drawCanvas:Yt.Bg,viewId:this.viewId});}if(u!=null&&u.size&&((o=v.sp)==null||o.push({type:xt.RemoveNode,removeIds:_toConsumableArray(u),viewId:this.thread.viewId})),d!=null&&d.size){_iterator89=_createForOfIteratorHelper(d);try{for(_iterator89.s();!(_step89=_iterator89.n()).done;){_step89$value=_slicedToArray(_step89.value,2),_p7=_step89$value[0],w=_step89$value[1];(a=v.sp)==null||a.push({type:xt.FullWork,dataType:Kt.Local,toolsType:It.Pencil,ops:Br(w.op),opt:w.opt,workId:_p7,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator89.e(err);}finally{_iterator89.f();}}_context66.n=1;return this._post(v);case 1:return _context66.a(2);}},_callee64,this);}));function drawEraserCombine(_x98){return _drawEraserCombine2.apply(this,arguments);}return drawEraserCombine;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee65(e,n){var _this84=this;var i,s,o,a,u,d,v,p,w,_t61,_t62,_t63,_t64;return _regenerator().w(function(_context67){while(1)switch(_context67.n){case 0:i=e.op,s=e.workId,o=e.scenePath,a=e.postCount,u=e.smoothSync;if(!(i!=null&&i.length&&s)){_context67.n=16;break;}d=s.toString(),v=this.getWorkShape(d);if(v){_context67.n=1;break;}return _context67.a(2);case 1:p=v.toolsType;if(!(p===It.LaserPen)){_context67.n=2;break;}return _context67.a(2);case 2:_t61=this.drawWorkActiveId&&this.drawWorkActiveId!==d;if(!_t61){_context67.n=4;break;}_context67.n=3;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:o,viewId:this.viewId,msgType:xt.DrawWork,dataType:Kt.Local},n);case 3:this.drawWorkActiveId=void 0;case 4:!this.drawWorkActiveId&&d!==Fe&&(this.drawWorkActiveId=d);Ze(a)&&(this.consumeCount=a);w=v.consume({data:e,isSimpleWorker:!0,smoothSync:u});_t62=p;_context67.n=_t62===It.Selector?5:_t62===It.PencilEraser?7:_t62===It.BitMapEraser?7:_t62===It.Eraser?10:_t62===It.Arrow?12:_t62===It.Straight?12:_t62===It.Ellipse?12:_t62===It.Rectangle?12:_t62===It.Star?12:_t62===It.Polygon?12:_t62===It.SpeechBalloon?12:_t62===It.Pencil?14:16;break;case 5:this.drawCount++;w.type===xt.Select&&w.selectIds&&n.runReverseSelectWork(w.selectIds);_context67.n=6;return this.drawSelector(_objectSpread(_objectSpread({},w),{},{isSelecting:!0}),e.workState||te.Doing);case 6:return _context67.a(3,16);case 7:this.drawCount++;this.combineDrawActiveId=d;this.eraserBatchScheduler.schedule(function(){_this84.drawEraserCombine(d);},this.eraserBatchDelay);_context67.n=8;return this.drawAckBackpressure.wait(d);case 8:_t63=_context67.v;if(!_t63){_context67.n=9;break;}_context67.n=9;return this._post({consumeCount:this.consumeCount,consumeWorkId:d});case 9:return _context67.a(3,16);case 10:_context67.n=11;return this.drawEraser(w);case 11:return _context67.a(3,16);case 12:_t64=w;if(!_t64){_context67.n=13;break;}this.drawCount++;_context67.n=13;return this.drawShape(w);case 13:return _context67.a(3,16);case 14:this.drawCount++;_context67.n=15;return this.drawPencil(w,d);case 15:return _context67.a(3,16);case 16:return _context67.a(2);}},_callee65,this);}));function consumeDraw(_x99,_x100){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee66(e,n){var a,u,d,i,s,o,v,p,w,A,M,E,L,_t65;return _regenerator().w(function(_context68){while(1)switch(_context68.n){case 0:this.eraserBatchScheduler.cancel(),this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);i=e.workId,s=e.scenePath,o=e.isLockSentEventCursor;if(!i){_context68.n=10;break;}v=i.toString();this.drawAckBackpressure.finish(v),this.combineDrawActiveId===v&&(this.combineDrawActiveId=void 0),this.drawWorkActiveId===v&&(this.drawWorkActiveId=void 0);p=this.workShapes.get(v);if(p){_context68.n=1;break;}return _context68.a(2);case 1:w=p.toolsType;if(!(w===It.LaserPen)){_context68.n=2;break;}return _context68.a(2);case 2:A=this.workShapes.get(Po),M=(a=A==null?void 0:A.selectIds)==null?void 0:a[0],E=p.consumeAll({data:e,workerEngine:this});_t65=w;_context68.n=_t65===It.Selector?3:_t65===It.PencilEraser?5:_t65===It.BitMapEraser?5:_t65===It.Eraser?7:_t65===It.Arrow?8:_t65===It.Straight?8:_t65===It.Ellipse?8:_t65===It.Rectangle?8:_t65===It.Star?8:_t65===It.Polygon?8:_t65===It.SpeechBalloon?8:_t65===It.Pencil?8:10;break;case 3:L=[];this.drawLayer&&(this.drawCount=0,qr(this.drawLayer,this.drawLayer.parent),this.getWorkShape(v).clearSubTmpPoints(),L.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}));E.selectIds&&M&&(u=E.selectIds)!=null&&u.includes(M)&&A.cursorBlur();E.selectIds&&n.runReverseSelectWork(E.selectIds);_context68.n=4;return this.drawSelector(_objectSpread(_objectSpread({},E),{},{scenePath:s,isSelecting:!1}),te.Done,o,L);case 4:(d=p.selectIds)!=null&&d.length?p.clearTmpPoints():this.clearWorkShapeNodeCache(v);return _context68.a(3,10);case 5:_context68.n=6;return this.drawEraserFull(p,_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker);case 6:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context68.a(3,10);case 7:this.drawEraser(_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker),p.clearTmpPoints();return _context68.a(3,10);case 8:_context68.n=9;return this.drawPencilFull(_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker,w);case 9:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context68.a(3,10);case 10:return _context68.a(2);}},_callee66,this);}));function consumeDrawAll(_x101,_x102){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()}]);}(iI);var Hbt=/*#__PURE__*/function(_sI){function Hbt(e){var _this85;_classCallCheck(this,Hbt);_this85=_callSuper(this,Hbt,[e]);wt(_this85,"_type","simple");return _this85;}_inherits(Hbt,_sI);return _createClass(Hbt,[{key:"animationDraw",value:function(){var _animationDraw3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee67(){var _this86=this;var s,o,a,u,d,v,p,w,A,M,E,L,G,z,et,x,y,S,C,P,X,$,K,j,nt,ct,F,R,Y,q,lt,ut,Tt,O,U,_,H,at,ht,yt,Et,Dt,D,N,e,n,i,_iterator90,_step90,_loop8,_t67,_t68;return _regenerator().w(function(_context70){while(1)switch(_context70.p=_context70.n){case 0:this.animationId=void 0;e=!1;n={render:[]},i=/* @__PURE__ */new Map();_iterator90=_createForOfIteratorHelper(this.workShapes.entries());_context70.p=1;_loop8=/*#__PURE__*/_regenerator().m(function _loop8(){var _step90$value,J,Q,V,tt,_V7,_tt7,_V8,_tt8,_V9,_tt9,g,I,_V0,_tt0,_g4,_I4,B,Z,st,_Z3,_V1,_tt1,_g5,_I5,_t66;return _regenerator().w(function(_context69){while(1)switch(_context69.n){case 0:_step90$value=_slicedToArray(_step90.value,2),J=_step90$value[0],Q=_step90$value[1];_t66=Q.toolsType;_context69.n=_t66===It.BackgroundSVG?1:_t66===It.Image?2:_t66===It.Text?4:_t66===It.Arrow?7:_t66===It.Straight?7:_t66===It.Rectangle?7:_t66===It.Ellipse?7:_t66===It.Star?7:_t66===It.Polygon?7:_t66===It.SpeechBalloon?7:_t66===It.Pencil?8:13;break;case 1:V=Q.oldRect;V&&((s=n.render)==null||s.push({rect:V,isClear:!0,clearCanvas:Yt.Bg,viewId:_this86.viewId}),(o=n.render)==null||o.push({rect:V,drawCanvas:Yt.Bg,viewId:_this86.viewId}));tt=Q.node.consumeService({isFullWork:!0,replaceId:J});_this86.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this86.willRunEffectSelectorIds.add(I),_this86.noAnimationRect=Jt(_this86.noAnimationRect,V),_this86.noAnimationRect=Jt(_this86.noAnimationRect,tt),_this86.runEffect());}),_this86.workShapes.delete(J),(a=n.render)==null||a.push({rect:tt,drawCanvas:Yt.Bg,viewId:_this86.viewId});return _context69.a(3,13);case 2:_V7=Q.oldRect;_V7&&((u=n.render)==null||u.push({rect:_V7,isClear:!0,clearCanvas:Yt.Bg,viewId:_this86.viewId}),(d=n.render)==null||d.push({rect:_V7,drawCanvas:Yt.Bg,viewId:_this86.viewId}));_context69.n=3;return(v=Q.node)==null?void 0:v.consumeServiceAsync({isFullWork:!0,worker:_this86.thread});case 3:_tt7=_context69.v;_this86.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this86.willRunEffectSelectorIds.add(I),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_V7),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_tt7),_this86.runEffect());}),_this86.workShapes.delete(J),(p=n.render)==null||p.push({rect:_tt7,drawCanvas:Yt.Bg,viewId:_this86.viewId});return _context69.a(3,13);case 4:if(!Q.node){_context69.n=6;break;}_V8=Q.oldRect;_V8&&((w=n.render)==null||w.push({rect:_V8,isClear:!0,clearCanvas:Yt.Bg,viewId:_this86.viewId}),(A=n.render)==null||A.push({rect:_V8,drawCanvas:Yt.Bg,viewId:_this86.viewId}));_context69.n=5;return Q.node.consumeServiceAsync({isFullWork:!0,replaceId:J,boxRect:_this86.thread.getSceneRect()});case 5:_tt8=_context69.v;_this86.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this86.willRunEffectSelectorIds.add(I),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_V8),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_tt8),_this86.runEffect());}),Q.refreshTextRender&&Q.requestId&&(n.sp=n.sp||[],n.sp.push({type:xt.RefreshTextRender,requestId:Q.requestId,workId:J,viewId:_this86.viewId})),(M=Q.node)==null||M.clearTmpPoints(),_this86.workShapes.delete(J),(E=n.render)==null||E.push({rect:_tt8,drawCanvas:Yt.Bg,viewId:_this86.viewId});case 6:return _context69.a(3,13);case 7:_V9=!!Q.ops;if((L=Q.animationWorkData)!=null&&L.length){_tt9=Q.oldRect,g=Q.node.oldRect;_tt9&&((G=n.render)==null||G.push({rect:_tt9,isClear:!0,clearCanvas:Yt.Bg,viewId:_this86.viewId}),(z=n.render)==null||z.push({rect:_tt9,drawCanvas:Yt.Bg,viewId:_this86.viewId})),g&&((et=n.render)==null||et.push({rect:g,isClear:!0,clearCanvas:Yt.ServiceFloat,viewId:_this86.viewId}));I=(x=Q.node)==null?void 0:x.consumeService({op:Q.animationWorkData,isFullWork:_V9});Q.isEnableCursor?i.set(J,{cursorTool:kn(Q.toolsType),workState:_tt9?Q.ops?te.Done:te.Doing:te.Start,op:Q.animationWorkData.slice(-3,-1)}):_V9&&!Q.useAnimation&&(y=Q.updateNodeOpt)!=null&&y.useAnimation&&i.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:Q.animationWorkData.slice(-3,-1),uid:(S=Q.updateNodeOpt)==null?void 0:S.uid}),_V9?(_this86.selectorWorkShapes.forEach(function(B,Z){var st;(st=B.selectIds)!=null&&st.includes(J)&&(_this86.willRunEffectSelectorIds.add(Z),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_tt9),_this86.noAnimationRect=Jt(_this86.noAnimationRect,g),_this86.noAnimationRect=Jt(_this86.noAnimationRect,I),_this86.runEffect());}),(C=Q.node)==null||C.clearTmpPoints(),_this86.workShapes.delete(J),(P=n.render)==null||P.push({rect:I,drawCanvas:Yt.Bg,viewId:_this86.viewId})):(X=n.render)==null||X.push({rect:I,drawCanvas:Yt.ServiceFloat,workerType:_V9?void 0:Kt.Service,viewId:_this86.viewId}),Q.animationWorkData.length=0;}return _context69.a(3,13);case 8:if(!Q.useAnimation){_context69.n=11;break;}if(!Q.useAnimation){_context69.n=10;break;}if(!Q.isDel){_context69.n=9;break;}(O=Q.node)==null||O.clearTmpPoints(),_this86.workShapes.delete(J);return _context69.a(3,13);case 9:_V0=3,_tt0=_this86.computNextAnimationIndex(Q,_V0),_g4=Q.isDiff?0:Math.max(0,(Q.animationIndex||0)-_V0),_I4=(Q.animationWorkData||[]).slice(0,_tt0),B=(_=(U=Q.node)==null?void 0:U.getWorkId())==null?void 0:_.toString();if((Q.animationIndex||0)<_tt0||Q.isDiff){Z=(H=Q.node)==null?void 0:H.consumeService({op:_I4,isFullWork:!1,replaceId:B});if((at=n.render)==null||at.push({isClear:!0,rect:Z,clearCanvas:Yt.ServiceFloat,viewId:_this86.viewId}),(ht=n.render)==null||ht.push({rect:Z,drawCanvas:Yt.ServiceFloat,viewId:_this86.viewId}),Q.animationIndex=_tt0,Q.isDiff&&(Q.isDiff=!1),_I4.length&&Q.isEnableCursor){st=_I4.slice(-3,-1);i.set(J,{cursorTool:kn(Q.toolsType),workState:_g4===0?te.Start:_tt0===((yt=Q.animationWorkData)==null?void 0:yt.length)?te.Done:te.Doing,op:st});}}else if(Q.ops){_Z3=(Et=Q.node)==null?void 0:Et.consumeService({op:Q.animationWorkData||[],isFullWork:!0,replaceId:B});Q.isDel=!0,(Dt=n.render)==null||Dt.push({isClear:!0,rect:_Z3,clearCanvas:Yt.ServiceFloat,viewId:_this86.viewId},{rect:_Z3,drawCanvas:Yt.ServiceFloat,viewId:_this86.viewId},{isClear:!0,rect:_Z3,clearCanvas:Yt.Bg,viewId:_this86.viewId},{rect:_Z3,drawCanvas:Yt.Bg,viewId:_this86.viewId}),Q.isEnableCursor&&i.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:_I4.slice(-3,-1)});}e=!0;return _context69.a(3,13);case 10:_context69.n=12;break;case 11:_V1=!!Q.ops;_tt1=($=Q.node)==null?void 0:$.consumeService({op:Q.animationWorkData||[],isFullWork:_V1,replaceId:J});_g5=(K=Q.node)==null?void 0:K.updataOptService(Q.updateNodeOpt);if(_V1){if(_tt1=Jt(_tt1,_g5),(j=n.render)==null||j.push({isClear:!0,rect:Jt(Q.oldRect,_tt1),clearCanvas:Yt.Bg,viewId:_this86.viewId}),(nt=n.render)==null||nt.push({rect:Jt(Q.oldRect,_tt1),drawCanvas:Yt.Bg,viewId:_this86.viewId}),(ct=Q.updateNodeOpt)!=null&&ct.useAnimation&&((F=n.render)==null||F.push({isClear:!0,rect:Jt(Q.oldRect,_tt1),clearCanvas:Yt.ServiceFloat,viewId:_this86.viewId}),(R=n.render)==null||R.push({rect:Jt(Q.oldRect,_tt1),drawCanvas:Yt.ServiceFloat,viewId:_this86.viewId}),!Q.isEnableCursor&&(Y=Q.animationWorkData)!=null&&Y.length)){_I5=Q.animationWorkData.slice(-3,-1);i.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:_I5,uid:(q=Q.updateNodeOpt)==null?void 0:q.uid});}_this86.selectorWorkShapes.forEach(function(I,B){var Z;(Z=I.selectIds)!=null&&Z.includes(J)&&(_this86.willRunEffectSelectorIds.add(B),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_tt1),_this86.runEffect());}),(lt=Q.node)==null||lt.clearTmpPoints(),_this86.workShapes.delete(J);}else _tt1=Jt(_tt1,_g5),(ut=n.render)==null||ut.push({isClear:!0,rect:Jt(Q.oldRect,_tt1),clearCanvas:Yt.ServiceFloat,viewId:_this86.viewId}),(Tt=n.render)==null||Tt.push({rect:Jt(Q.oldRect,_tt1),drawCanvas:Yt.ServiceFloat,viewId:_this86.viewId});case 12:return _context69.a(3,13);case 13:return _context69.a(2);}},_loop8);});_iterator90.s();case 2:if((_step90=_iterator90.n()).done){_context70.n=4;break;}return _context70.d(_regeneratorValues(_loop8()),3);case 3:_context70.n=2;break;case 4:_context70.n=6;break;case 5:_context70.p=5;_t67=_context70.v;_iterator90.e(_t67);case 6:_context70.p=6;_iterator90.f();return _context70.f(6);case 7:e&&this.runAnimation();i.size&&(n.sp=n.sp||[],i.forEach(function(J,Q){var V;(V=n.sp)==null||V.push({type:xt.Cursor,uid:J.uid||Q.split(Oo)[0],op:J.op,workState:J.workState,cursorTool:J.cursorTool,viewId:_this86.viewId});}));_t68=(D=n.render)!=null&&D.length||(N=n.sp)!=null&&N.length;if(!_t68){_context70.n=8;break;}_context70.n=8;return this.post(n);case 8:return _context70.a(2);}},_callee67,this,[[1,5,6,7]]);}));function animationDraw(){return _animationDraw3.apply(this,arguments);}return animationDraw;}()}]);}(sI);var oI=/*#__PURE__*/function(_x103){function oI(e){var _this87;_classCallCheck(this,oI);_this87=_callSuper(this,oI,[e]);wt(_this87,"opt");wt(_this87,"scene");wt(_this87,"cameraOpt");wt(_this87,"vNodes");_this87.opt=e,_this87.vNodes=void 0;return _this87;}_inherits(oI,_x103);return _createClass(oI,[{key:"createSnapshotFullLayer",value:function createSnapshotFullLayer(e,n){this.scene=this.opt.createScene(e),this.fullLayer=this.opt.createLayer("snapshotFullLayer",this.scene,n);}},{key:"destroySnapshotFullLayer",value:function destroySnapshotFullLayer(){var e,n,i;qr(this.fullLayer,this.fullLayer.parent),(e=this.fullLayer)==null||e.disconnect(),(n=this.fullLayer)==null||n.remove(),(i=this.scene)==null||i.remove(),this.scene=void 0;}},{key:"updateScene",value:function updateScene(e){if(!this.scene)throw new Error("SnapshotWork scene is not initialized");this.scene.attr(_objectSpread({},e));var n=e.width,i=e.height;this.scene.width=n,this.scene.height=i,this.updateLayer({width:n,height:i});}},{key:"updateLayer",value:function updateLayer(e){if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");var n=e.width,i=e.height;this.fullLayer.parent.setAttribute("width",n),this.fullLayer.parent.setAttribute("height",i),this.fullLayer.setAttribute("size",[n,i]),this.fullLayer.setAttribute("pos",[n*0.5,i*0.5]);}},{key:"setCameraOpt",value:function setCameraOpt(e){this.cameraOpt=e;var n=e.scale,i=e.centerX,s=e.centerY,o=e.width,a=e.height;if(!this.scene)throw new Error("SnapshotWork scene is not initialized");if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");(o!==this.scene.width||a!==this.scene.height)&&this.updateScene({width:o,height:a}),this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-s]);}},{key:"getOffscreen",value:function getOffscreen(){var n;return((n=this.fullLayer)==null?void 0:n.parent).canvas;}},{key:"getRectImageBitmap",value:function getRectImageBitmap(e,n){var i=e.rect,s=this.thread.dpr,o=Math.floor(i.x*s),a=Math.floor(i.y*s),u=Math.floor(i.w*s),d=Math.floor(i.h*s);return createImageBitmap(this.getOffscreen(),o,a,u,d,n);}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee68(e){var n,i,s,o,a,_i0,_Object$entries,_Object$entries$_i,d,v,p,w,u,_v11,_t69,_t70;return _regenerator().w(function(_context71){while(1)switch(_context71.p=_context71.n){case 0:n=e.scenePath,i=e.scenes,s=e.cameraOpt,o=e.w,a=e.h;if(!(n&&i&&s&&this.fullLayer)){_context71.n=9;break;}this.setCameraOpt(s);_i0=0,_Object$entries=Object.entries(i);case 1:if(!(_i0<_Object$entries.length)){_context71.n=5;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i0],2),d=_Object$entries$_i[0],v=_Object$entries$_i[1];if(!(v!=null&&v.type)){_context71.n=4;break;}_t69=v==null?void 0:v.type;_context71.n=_t69===xt.UpdateNode?2:_t69===xt.FullWork?2:4;break;case 2:p=v.opt,w=_objectSpread(_objectSpread({},v),{},{opt:p,workId:d,msgType:xt.FullWork,dataType:Kt.Service,viewId:this.viewId});_context71.n=3;return this.runFullWork(w);case 3:return _context71.a(3,4);case 4:_i0++;_context71.n=1;break;case 5:o&&a&&(u={resizeWidth:o,resizeHeight:a});_context71.p=6;_context71.n=7;return this.getSnapshotRender({scenePath:n,options:u});case 7:_context71.n=9;break;case 8:_context71.p=8;_t70=_context71.v;_v11=_t70&&_t70 instanceof Error?_t70.message:_t70==null?void 0:_t70.toString();console.error("[SnapshotWork] getSnapshotRender error",_v11),this.thread._post({sp:[{type:xt.ReportError,reportString:"[SnapshotWork] getSnapshotRender error: ".concat(_v11)}]});case 9:return _context71.a(2);}},_callee68,this,[[6,8]]);}));function getSnapshot(_x104){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee69(e){var s,n,i,o,a,u;return _regenerator().w(function(_context72){while(1)switch(_context72.n){case 0:n=this.setFullWork(e),i=e.ops&&Os(e.ops);if(!n){_context72.n=7;break;}u=(s=n.getWorkId())==null?void 0:s.toString();if(!(n.toolsType===It.BackgroundSVG)){_context72.n=1;break;}o=n.consumeService({isFullWork:!0,replaceId:u});_context72.n=6;break;case 1:if(!(n.toolsType===It.Image)){_context72.n=3;break;}_context72.n=2;return n.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 2:o=_context72.v;_context72.n=6;break;case 3:if(!(n.toolsType===It.Text)){_context72.n=5;break;}_context72.n=4;return n.consumeServiceAsync({isFullWork:!0,replaceId:u,isDrawLabel:!0});case 4:o=_context72.v;_context72.n=6;break;case 5:o=n.consumeService({op:i,isFullWork:!0,replaceId:u}),a=(e==null?void 0:e.updateNodeOpt)&&n.updataOptService(e.updateNodeOpt);case 6:e.workId&&this.workShapes.delete(e.workId.toString());return _context72.a(2,Jt(o,a));case 7:return _context72.a(2);}},_callee69,this);}));function runFullWork(_x105){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{key:"getSceneRect",value:function getSceneRect(){if(!this.scene)throw new Error("SnapshotWork scene is not initialized");var _this$scene2=this.scene,e=_this$scene2.width,n=_this$scene2.height;return{x:0,y:0,w:Math.floor(e),h:Math.floor(n)};}},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee70(e){var o,n,i,s;return _regenerator().w(function(_context73){while(1)switch(_context73.n){case 0:n=e.scenePath,i=e.options;((o=this.fullLayer)==null?void 0:o.parent).render();_context73.n=1;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:Yt.None},i);case 1:s=_context73.v;s&&(this.thread._post({sp:[{type:xt.Snapshot,scenePath:n,imageBitmap:s,viewId:this.viewId,index:0}]},[s]),s.close());case 2:return _context73.a(2);}},_callee70,this);}));function getSnapshotRender(_x106){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee71(e){var n,i,s,o,_i1,_Object$entries2,_Object$entries2$_i,a,u,d,_t71;return _regenerator().w(function(_context74){while(1)switch(_context74.n){case 0:n=e.scenePath,i=e.scenes,s=e.cameraOpt;if(!(n&&i&&s&&this.fullLayer)){_context74.n=6;break;}this.setCameraOpt(s);_i1=0,_Object$entries2=Object.entries(i);case 1:if(!(_i1<_Object$entries2.length)){_context74.n=5;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i1],2),a=_Object$entries2$_i[0],u=_Object$entries2$_i[1];if(!(u!=null&&u.type)){_context74.n=4;break;}_t71=u==null?void 0:u.type;_context74.n=_t71===xt.UpdateNode?2:_t71===xt.FullWork?2:4;break;case 2:_context74.n=3;return this.runFullWork(_objectSpread(_objectSpread({},u),{},{workId:a,msgType:xt.FullWork,dataType:Kt.Service,viewId:this.viewId}));case 3:d=_context74.v;o=Jt(o,d);return _context74.a(3,4);case 4:_i1++;_context74.n=1;break;case 5:o&&this.thread._post({sp:[{type:xt.BoundingBox,scenePath:n,rect:o,viewId:this.viewId}]});case 6:return _context74.a(2);}},_callee71,this);}));function getBoundingRect(_x107){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(x0);var Tu=/* @__PURE__ */function(r){return r.Full="full",r.Sub="sub",r;}(Tu||{});var Vbt=/*#__PURE__*/function(){function Vbt(t,e,n){var _this88=this;_classCallCheck(this,Vbt);wt(this,"_self");wt(this,"version",mS);wt(this,"type");wt(this,"createEngine");// protected hasPriorityDraw: boolean = true;
|
|
490
|
-
wt(this,"workThreadMap",/* @__PURE__ */new Map());wt(this,"cameraRenderQueueByView",/* @__PURE__ */new Map());wt(this,"viewGenerationById",/* @__PURE__ */new Map());wt(this,"post",function(t,e){e?_this88._self.postMessage(t,e):_this88._self.postMessage(t);});this._self=t,this.type=e,this.createEngine=n,this.register();}return _createClass(
|
|
491
|
-
},{key:"isFontAvailable",value:function(){var _isFontAvailable=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee75(t){var e,n,i,_iterator92,_step92,_s1,s,_t77,_t78,_t79,_t80;return _regenerator().w(function(_context79){while(1)switch(_context79.p=_context79.n){case 0:_context79.p=0;e=this._self.fonts;if(e){_context79.n=1;break;}return _context79.a(2,!1);case 1:n=!1,i=null;_iterator92=_createForOfIteratorHelper(e);_context79.p=2;_iterator92.s();case 3:if((_step92=_iterator92.n()).done){_context79.n=5;break;}_s1=_step92.value;if(!(_s1.family===t)){_context79.n=4;break;}n=!0,i=_s1;return _context79.a(3,5);case 4:_context79.n=3;break;case 5:_context79.n=7;break;case 6:_context79.p=6;_t77=_context79.v;_iterator92.e(_t77);case 7:_context79.p=7;_iterator92.f();return _context79.f(7);case 8:if(!(!n||!i)){_context79.n=9;break;}return _context79.a(2,!1);case 9:if(!(i.status==="loaded")){_context79.n=10;break;}return _context79.a(2,!0);case 10:_context79.p=10;_context79.n=11;return i.loaded;case 11:return _context79.a(2,!0);case 12:_context79.p=12;_t78=_context79.v;if(!(e&&typeof e.load=="function")){_context79.n=16;break;}_context79.p=13;_context79.n=14;return e.load(this.getFontFaceCssValue(t));case 14:s=_context79.v;return _context79.a(2,s&&s.length>0);case 15:_context79.p=15;_t79=_context79.v;return _context79.a(2,!1);case 16:return _context79.a(2,!0);case 17:_context79.n=19;break;case 18:_context79.p=18;_t80=_context79.v;return _context79.a(2,!1);case 19:return _context79.a(2);}},_callee75,this,[[13,15],[10,12],[2,6,7,8],[0,18]]);}));function isFontAvailable(_x111){return _isFontAvailable.apply(this,arguments);}return isFontAvailable;}()},{key:"areFontFacesAvailable",value:function(){var _areFontFacesAvailable=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee76(){var t,_iterator93,_step93,e,_args80=arguments,_t81;return _regenerator().w(function(_context80){while(1)switch(_context80.p=_context80.n){case 0:t=_args80.length>0&&_args80[0]!==undefined?_args80[0]:[];_iterator93=_createForOfIteratorHelper(t);_context80.p=1;_iterator93.s();case 2:if((_step93=_iterator93.n()).done){_context80.n=5;break;}e=_step93.value;_context80.n=3;return this.isFontAvailable(e.fontFamily);case 3:if(_context80.v){_context80.n=4;break;}return _context80.a(2,!1);case 4:_context80.n=2;break;case 5:_context80.n=7;break;case 6:_context80.p=6;_t81=_context80.v;_iterator93.e(_t81);case 7:_context80.p=7;_iterator93.f();return _context80.f(7);case 8:return _context80.a(2,!0);}},_callee76,this,[[1,6,7,8]]);}));function areFontFacesAvailable(){return _areFontFacesAvailable.apply(this,arguments);}return areFontFacesAvailable;}()},{key:"register",value:function register(){var _this91=this;onmessage=/*#__PURE__*/function(){var _ref68=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee81(t){var e,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_loop0,_ret2,_iterator,_step,_t87;return _regenerator().w(function(_context87){while(1)switch(_context87.p=_context87.n){case 0:e=t.data;if(!e){_context87.n=13;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context87.p=1;_loop0=/*#__PURE__*/_regenerator().m(function _loop0(){var n,i,s,o,a,u,d,v,p,M,_M5,E,_M6,_E5,L,_M7,_iterator94,_step94,_loop1,_M8,w,A,_t85,_t86;return _regenerator().w(function(_context86){while(1)switch(_context86.p=_context86.n){case 0:n=_step.value;i=n.msgType,s=n.viewId,o=n.tasksqueue,a=n.mainTasksqueueCount,u=n.cameraTaskId,d=n.fontBuffers,v=n.fontFaces,p=n.requestId;if(!(i===xt.CheckFontFace)){_context86.n=2;break;}_context86.n=1;return _this91.areFontFacesAvailable(v);case 1:M=_context86.v;_this91.post({sp:[{type:xt.CheckFontFace,requestId:p,fontFaceCheckResult:M}]});return _context86.a(2,0);case 2:if(!(i===xt.ProbeRenderCapabilities)){_context86.n=3;break;}_M5=n.requestedContextType,E=function E(L){var G,z;try{if(typeof OffscreenCanvas!="function")return!1;var et=new OffscreenCanvas(1,1).getContext(L);return et?((z=(G=et.getExtension)==null?void 0:G.call(et,"WEBGL_lose_context"))==null||z.loseContext(),!0):!1;}catch(_unused29){return!1;}};_this91._self.postMessage({type:xt.ProbeRenderCapabilities,workerCapabilities:{offscreenCanvas:typeof OffscreenCanvas=="function",offscreen2d:E("2d"),webgl2:E("webgl2"),webgl:E("webgl"),contextSupported:_M5?E(_M5):!1},requestId:p});return _context86.a(2,0);case 3:if(!d){_context86.n=4;break;}_this91.setFontFaces(d,p);return _context86.a(2,0);case 4:if(!(i===xt.Console)){_context86.n=5;break;}console.log(_this91);return _context86.a(2,0);case 5:if(!(i===xt.Init)){_context86.n=7;break;}_context86.n=6;return _this91.init(n);case 6:_this91.type==="full"&&_this91.post({sp:[{type:xt.Init,viewId:s,viewGeneration:n.viewGeneration}]});return _context86.a(2,0);case 7:if(!(i===xt.UpdateTools||xt.CreateWork,i===xt.TasksQueue&&o!=null&&o.size)){_context86.n=9;break;}_M6=o.get(s),_E5=_this91.workThreadMap.get(s),L=_this91.viewGenerationById.get(s);_t85=_M6&&_E5;if(!_t85){_context86.n=8;break;}_context86.n=8;return _this91.enqueueViewTask(s,/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee77(){var _t82;return _regenerator().w(function(_context81){while(1)switch(_context81.n){case 0:_t82=_this91.viewGenerationById.get(s)!==L||_this91.workThreadMap.get(s)!==_E5;if(_t82){_context81.n=1;break;}_context81.n=1;return _E5.on(_M6);case 1:return _context81.a(2);}},_callee77);})));case 8:_this91.type==="full"&&Ze(a)&&Ze(u)&&_this91.post({workerTasksqueueCount:a,cameraTaskId:u,viewId:s});return _context86.a(2,0);case 9:if(!(s===dgt)){_context86.n=17;break;}_M7=_toConsumableArray(_this91.workThreadMap.entries());_iterator94=_createForOfIteratorHelper(_M7);_context86.p=10;_loop1=/*#__PURE__*/_regenerator().m(function _loop1(){var _step94$value,E,L,G;return _regenerator().w(function(_context83){while(1)switch(_context83.n){case 0:_step94$value=_slicedToArray(_step94.value,2),E=_step94$value[0],L=_step94$value[1];G=_this91.enqueueViewTask(E,/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee78(){var _t83;return _regenerator().w(function(_context82){while(1)switch(_context82.n){case 0:if(!(i===xt.Destroy)){_context82.n=1;break;}_this91.workThreadMap.get(E)===L&&(L.destroy(),_this91.workThreadMap.delete(E),_this91.viewGenerationById.set(E,(_this91.viewGenerationById.get(E)||0)+1));return _context82.a(2);case 1:_t83=_this91.workThreadMap.get(E)===L;if(!_t83){_context82.n=2;break;}_context82.n=2;return L.on(n);case 2:return _context82.a(2);}},_callee78);})));_context83.n=1;return G;case 1:_this91.cameraRenderQueueByView.get(E)===G&&_this91.cameraRenderQueueByView.delete(E);case 2:return _context83.a(2);}},_loop1);});_iterator94.s();case 11:if((_step94=_iterator94.n()).done){_context86.n=13;break;}return _context86.d(_regeneratorValues(_loop1()),12);case 12:_context86.n=11;break;case 13:_context86.n=15;break;case 14:_context86.p=14;_t86=_context86.v;_iterator94.e(_t86);case 15:_context86.p=15;_iterator94.f();return _context86.f(15);case 16:return _context86.a(2,0);case 17:if(!(i===xt.Destroy)){_context86.n=19;break;}_M8=_this91.enqueueViewTask(s,/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee79(){var _n$viewGeneration;var E;return _regenerator().w(function(_context84){while(1)switch(_context84.n){case 0:E=_this91.workThreadMap.get(s);E==null||E.destroy(),_this91.workThreadMap.delete(s),_this91.viewGenerationById.set(s,(_n$viewGeneration=n.viewGeneration)!==null&&_n$viewGeneration!==void 0?_n$viewGeneration:(_this91.viewGenerationById.get(s)||0)+1);case 1:return _context84.a(2);}},_callee79);})));_context86.n=18;return _M8;case 18:_this91.cameraRenderQueueByView.get(s)===_M8&&_this91.cameraRenderQueueByView.delete(s);return _context86.a(2,0);case 19:w=_this91.workThreadMap.get(s);if(w){_context86.n=20;break;}return _context86.a(2,0);case 20:A=_this91.viewGenerationById.get(s);_context86.n=21;return _this91.enqueueViewTask(s,/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee80(){var _t84;return _regenerator().w(function(_context85){while(1)switch(_context85.n){case 0:_t84=_this91.viewGenerationById.get(s)!==A||_this91.workThreadMap.get(s)!==w;if(_t84){_context85.n=1;break;}_context85.n=1;return w.on(n);case 1:return _context85.a(2);}},_callee80);})));case 21:return _context86.a(2);}},_loop0,null,[[10,14,15,16]]);});_iterator=_asyncIterator(e.values());case 2:_context87.n=3;return _iterator.next();case 3:if(!(_iteratorAbruptCompletion=!(_step=_context87.v).done)){_context87.n=6;break;}return _context87.d(_regeneratorValues(_loop0()),4);case 4:_ret2=_context87.v;if(!(_ret2===0)){_context87.n=5;break;}return _context87.a(3,5);case 5:_iteratorAbruptCompletion=false;_context87.n=2;break;case 6:_context87.n=8;break;case 7:_context87.p=7;_t87=_context87.v;_didIteratorError=true;_iteratorError=_t87;case 8:_context87.p=8;_context87.p=9;if(!(_iteratorAbruptCompletion&&_iterator.return!=null)){_context87.n=10;break;}_context87.n=10;return _iterator.return();case 10:_context87.p=10;if(!_didIteratorError){_context87.n=11;break;}throw _iteratorError;case 11:return _context87.f(10);case 12:return _context87.f(8);case 13:return _context87.a(2);}},_callee81,null,[[9,,10,12],[1,7,8,13]]);}));return function onmessage(_x112){return _ref68.apply(this,arguments);};}();}}]);}();var Zbt=/*#__PURE__*/function(_S10){function Zbt(e,n,i){var _this92;_classCallCheck(this,Zbt);_this92=_callSuper(this,Zbt,[e,n,"sub"/* Sub */]);wt(_this92,"type","sub");wt(_this92,"_post");wt(_this92,"topLayer");wt(_this92,"serviceWork");wt(_this92,"localWork");wt(_this92,"topLayerWork");wt(_this92,"snapshotWork");_this92._post=i;var s=zr.bufferSize.sub;_this92.topLayer=n.isUseSimple?void 0:_this92.createLayer("topLayer",_this92.scene,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:s,contextType:"2d"}));var o={thread:_this92,viewId:_this92.viewId,vNodes:_this92.vNodes,fullLayer:_this92.fullLayer,topLayer:_this92.topLayer,isUseSimple:n.isUseSimple};_this92.localWork=new jbt(o),n.isUseSimple||(_this92.topLayerWork=new Xbt(o)),_this92.snapshotWork=new oI(_objectSpread(_objectSpread({},o),{},{createScene:_this92.createScene.bind(_this92),createLayer:_this92.createLayer.bind(_this92)})),_this92.vNodes.init(_this92.fullLayer);return _this92;}_inherits(Zbt,_S10);return _createClass(Zbt,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee82(){var _this93=this;var o,a,_this$combinePostData,e,n,i,u,_iterator95,_step95,d,v,s,_t88;return _regenerator().w(function(_context88){while(1)switch(_context88.p=_context88.n){case 0:_this$combinePostData=this.combinePostData(),e=_this$combinePostData.render,n=_objectWithoutProperties(_this$combinePostData,_excluded4);if(!(e!=null&&e.length)){_context88.n=11;break;}u=[];_iterator95=_createForOfIteratorHelper(e);_context88.p=1;_iterator95.s();case 2:if((_step95=_iterator95.n()).done){_context88.n=7;break;}d=_step95.value;if(!d.rect){_context88.n=6;break;}if(!(d.rect=QS(br(d.rect),this.scene,this.dpr),!d.rect)){_context88.n=3;break;}return _context88.a(3,6);case 3:if(!(d.drawCanvas&&d.rect&&d.rect.w>0&&d.rect.h>0)){_context88.n=5;break;}_context88.n=4;return this.getRectImageBitmap(d);case 4:v=_context88.v;d.imageBitmap=v,i||(i=[]),i.push(v);case 5:u.push(d);case 6:_context88.n=2;break;case 7:_context88.n=9;break;case 8:_context88.p=8;_t88=_context88.v;_iterator95.e(_t88);case 9:_context88.p=9;_iterator95.f();return _context88.f(9);case 10:n.render=u;case 11:s=(o=n.sp)==null?void 0:o.filter(function(u){return u.type!==xt.None||u.isLockSentEventCursor||u.needUndoTicker||u.collectUndoTicker;});s!=null&&s.length?n.sp=s.map(function(u){return _objectSpread(_objectSpread({},u),{},{viewId:_this93.viewId});}):delete n.sp,n.consumeCount===void 0&&delete n.consumeCount,n.subWorkerDrawCount===void 0&&delete n.subWorkerDrawCount,(s!=null&&s.length||n.consumeCount||n.subWorkerDrawCount||(a=n==null?void 0:n.render)!=null&&a.length)&&this._post(n,i),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 12:return _context88.a(2);}},_callee82,this,[[1,8,9,10]]);}));function combinePost(){return _combinePost.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee83(e){var d,v,n,i,s,o,a,u,p,_t89,_t90;return _regenerator().w(function(_context89){while(1)switch(_context89.n){case 0:n=e.msgType,i=e.toolsType,s=e.opt,o=e.dataType,a=e.workState,u=e.isLockSentEventCursor;_t89=n;_context89.n=_t89===xt.UpdateTools?1:_t89===xt.CreateWork?3:_t89===xt.DrawWork?4:_t89===xt.RemoveNode?8:_t89===xt.FullWork?10:_t89===xt.Snapshot?14:_t89===xt.BoundingBox?16:18;break;case 1:if(!(i&&(d=this.topLayerWork)!=null&&d.canUseTopLayer(i)&&s)){_context89.n=2;break;}p={toolsType:i,toolsOpt:s};this.topLayerWork.setToolsOpt(p);return _context89.a(2);case 2:return _context89.a(3,18);case 3:this.createLocalWork(e);return _context89.a(2);case 4:if(!(a===te.Done&&o===Kt.Local)){_context89.n=6;break;}_context89.n=5;return this.consumeDrawAll(o,e);case 5:i===It.LaserPen&&u&&this.post({sp:[{type:xt.None,isLockSentEventCursor:u}]});_context89.n=7;break;case 6:this.consumeDraw(o,e);case 7:return _context89.a(2);case 8:_context89.n=9;return this.removeNode(e);case 9:return _context89.a(2);case 10:if(!(i&&(v=this.topLayerWork)!=null&&v.canUseTopLayer(i))){_context89.n=12;break;}_context89.n=11;return this.consumeDrawAll(o,e);case 11:_context89.n=13;break;case 12:_t90=o===Kt.Local&&e.clearPreviewLocalWork&&e.workId;if(!_t90){_context89.n=13;break;}_context89.n=13;return this.localWork.consumeDrawAll(_objectSpread(_objectSpread({},e),{},{msgType:xt.DrawWork,workState:te.Done}));case 13:return _context89.a(2);case 14:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ds?6e3:3e3,contextType:"2d"}));_context89.n=15;return this.snapshotWork.getSnapshot(e);case 15:this.snapshotWork.destroySnapshotFullLayer();return _context89.a(2);case 16:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ds?6e3:3e3,contextType:"2d"}));_context89.n=17;return this.snapshotWork.getBoundingRect(e);case 17:this.snapshotWork.destroySnapshotFullLayer();return _context89.a(2);case 18:_context89.n=19;return _superPropGet(Zbt,"on",this,3)([e]);case 19:return _context89.a(2);}},_callee83,this);}));function on(_x113){return _on2.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(e){var o;var n=e.workId,i=e.toolsType,s=e.opt;if(i&&(o=this.topLayerWork)!=null&&o.canUseTopLayer(i)&&n&&s){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:i,toolsOpt:s}),this.topLayerWork.setWorkOptions(n.toString(),s);return;}i&&_superPropGet(Zbt,"createLocalWork",this,3)([e]);}},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee84(e){var n,_t91;return _regenerator().w(function(_context90){while(1)switch(_context90.n){case 0:n=e.dataType;_t91=n===Kt.Local;if(!_t91){_context90.n=1;break;}_context90.n=1;return this.localWork.removeWork(e);case 1:return _context90.a(2);}},_callee84,this);}));function removeNode(_x114){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"getLayer",value:function getLayer(e){switch(e){case Yt.TopFloat:return this.topLayer||this.fullLayer;default:return this.fullLayer;}}},{key:"getOffscreen",value:function getOffscreen(e){var i;return((i=this.getLayer(e))==null?void 0:i.parent).canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee85(e,n){var o,i,s,_t92;return _regenerator().w(function(_context91){while(1)switch(_context91.n){case 0:i=n.workId,s=n.toolsType;if(!i){_context91.n=3;break;}if(!(s&&(o=this.topLayerWork)!=null&&o.canUseTopLayer(s))){_context91.n=1;break;}e===Kt.Local&&(this.topLayerWork.getWorkShape(i.toString())||this.createLocalWork(n)),this.topLayerWork.consumeDraw(n);return _context91.a(2);case 1:_t92=s;if(!_t92){_context91.n=2;break;}this.localWork.getWorkShape(i.toString())||this.createLocalWork(n);_context91.n=2;return this.localWork.consumeDraw(n);case 2:return _context91.a(2);case 3:return _context91.a(2);}},_callee85,this);}));function consumeDraw(_x115,_x116){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee86(e,n){var a,i,s,o,u;return _regenerator().w(function(_context92){while(1)switch(_context92.n){case 0:i=n.workId,s=n.toolsType,o=n.dataType;if(!i){_context92.n=2;break;}u=i.toString();if(!(s&&(a=this.topLayerWork)!=null&&a.canUseTopLayer(s))){_context92.n=1;break;}o===Kt.Local&&(this.topLayerWork.getWorkShape(u)||this.createLocalWork(n)),this.topLayerWork.consumeDrawAll(n);return _context92.a(2);case 1:s&&(this.localWork.getWorkShape(u)||_superPropGet(Zbt,"createLocalWork",this,3)([n]),this.localWork.consumeDrawAll(n));return _context92.a(2);case 2:return _context92.a(2);}},_callee86,this);}));function consumeDrawAll(_x117,_x118){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee87(){return _regenerator().w(function(_context93){while(1)switch(_context93.n){case 0:this.vNodes.clear();_superPropGet(Zbt,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(e){e.name!=="viewport"&&e.remove();}),qr(this.topLayer,this.topLayer.parent));_context93.n=1;return this.post({render:[{isClearAll:!0,clearCanvas:Yt.TopFloat,viewId:this.viewId}],sp:[{type:xt.Clear}]});case 1:return _context93.a(2);}},_callee87,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"getRectImageBitmap",value:function(){var _getRectImageBitmap=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee88(e,n){var v,i,s,p,o,a,u,d,_p8,_t93;return _regenerator().w(function(_context94){while(1)switch(_context94.p=_context94.n){case 0:i=e.rect,s=e.drawCanvas;if(!(((v=this.opt.bitmapEraserMaskOptions)==null?void 0:v.imageBitmapDirtyRect)===!1)){_context94.n=1;break;}p=this.getOffscreen(s);return _context94.a(2,(i.x=0,i.y=0,i.w=p.width/this.dpr,i.h=p.height/this.dpr,createImageBitmap(p,0,0,p.width,p.height,n)));case 1:o=Math.floor(i.x*this.dpr),a=Math.floor(i.y*this.dpr),u=Math.floor(i.w*this.dpr||1),d=Math.floor(i.h*this.dpr||1);_context94.p=2;_context94.n=3;return createImageBitmap(this.getOffscreen(s),o,a,u,d,n);case 3:return _context94.a(2,_context94.v);case 4:_context94.p=4;_t93=_context94.v;this.opt.bitmapEraserMaskOptions&&(this.opt.bitmapEraserMaskOptions.imageBitmapDirtyRect=!1);_p8=this.getOffscreen(s);return _context94.a(2,(i.x=0,i.y=0,i.w=_p8.width/this.dpr,i.h=_p8.height/this.dpr,createImageBitmap(_p8,0,0,_p8.width,_p8.height,n)));}},_callee88,this,[[2,4]]);}));function getRectImageBitmap(_x119,_x120){return _getRectImageBitmap.apply(this,arguments);}return getRectImageBitmap;}()},{key:"updateLayer",value:function updateLayer(e){var n=e.width,i=e.height;_superPropGet(Zbt,"updateLayer",this,3)([e]),this.topLayer&&(this.topLayer.parent.setAttribute("width",n),this.topLayer.parent.setAttribute("height",i),this.topLayer.setAttribute("size",[n,i]),this.topLayer.setAttribute("pos",[n*0.5,i*0.5]));}},{key:"updateDpr",value:function(){var _updateDpr2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee89(e){var n,i,s,_t94;return _regenerator().w(function(_context95){while(1)switch(_context95.n){case 0:_superPropGet(Zbt,"updateDpr",this,3)([e]);n=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,i=!!this.localWork.getWorkShapes().size,s=[];i&&s.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId});n&&s.push({isClearAll:!0,clearCanvas:Yt.TopFloat,viewId:this.viewId});_t94=s.length;if(!_t94){_context95.n=1;break;}_context95.n=1;return this.post({render:s});case 1:return _context95.a(2);}},_callee89,this);}));function updateDpr(_x121){return _updateDpr2.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee90(e){var _this94=this;var s,n,i,o,a,_iterator96,_step96,_loop10,_t95,_t96;return _regenerator().w(function(_context97){while(1)switch(_context97.p=_context97.n){case 0:n=[],i=e.cameraOpt;if(!(i&&!qn(this.cameraOpt,i))){_context97.n=8;break;}o=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,a=!!this.localWork.getWorkShapes().size;if(!(a&&this.localWork.workShapesDone(),this.setCameraOpt(i),a&&n.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}),o&&this.topLayerWork)){_context97.n=7;break;}n.push({isClearAll:!0,clearCanvas:Yt.TopFloat,viewId:this.viewId});_iterator96=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries()||[]);_context97.p=1;_loop10=/*#__PURE__*/_regenerator().m(function _loop10(){var _step96$value,u,d,v;return _regenerator().w(function(_context96){while(1)switch(_context96.n){case 0:_step96$value=_slicedToArray(_step96.value,2),u=_step96$value[0],d=_step96$value[1];if(d.totalRect){(s=_this94.topLayer)==null||s.getElementsByName(u.toString()).forEach(function(p){var w=p.getBoundingClientRect(),A=me({x:w.x,y:w.y,w:w.width,h:w.height});v=Jt(v,A);}),d.totalRect=v,_this94.topLayerWork.localWorkShapes.set(u,d);}case 1:return _context96.a(2);}},_loop10);});_iterator96.s();case 2:if((_step96=_iterator96.n()).done){_context97.n=4;break;}return _context97.d(_regeneratorValues(_loop10()),3);case 3:_context97.n=2;break;case 4:_context97.n=6;break;case 5:_context97.p=5;_t95=_context97.v;_iterator96.e(_t95);case 6:_context97.p=6;_iterator96.f();return _context97.f(6);case 7:_t96=n.length;if(!_t96){_context97.n=8;break;}_context97.n=8;return this.post({render:n});case 8:return _context97.a(2);}},_callee90,this,[[1,5,6,7]]);}));function updateCamera(_x122){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(e,n){var d,v;this.cameraOpt=e;var i=e.scale,s=e.centerX,o=e.centerY,a=e.width,u=e.height;(a!==this.scene.width||u!==this.scene.height)&&this.updateScene(this.scene,{width:a,height:u}),n?(n.setAttribute("scale",[i,i]),n.setAttribute("translate",[-s,-o])):(this.fullLayer.setAttribute("scale",[i,i]),this.fullLayer.setAttribute("translate",[-s,-o]),(d=this.topLayer)==null||d.setAttribute("scale",[i,i]),(v=this.topLayer)==null||v.setAttribute("translate",[-s,-o]));}}]);}(_S);var aI=/*#__PURE__*/function(_S11){function aI(e,n,i){var _this95;_classCallCheck(this,aI);_this95=_callSuper(this,aI,[e,n,"full"/* Full */]);wt(_this95,"serviceDrawLayer");wt(_this95,"localDrawLayer");wt(_this95,"snapshotFullLayer");wt(_this95,"methodBuilder");wt(_this95,"localWork");wt(_this95,"serviceWork");wt(_this95,"_post");wt(_this95,"debounceUpdateCache",/* @__PURE__ */new Set());_this95._post=i;var s=zr.bufferSize.sub;_this95.serviceDrawLayer=_this95.createLayer("serviceDrawLayer",_this95.scene,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:s,contextType:"2d"})),_this95.localDrawLayer=_this95.createLayer("localDrawLayer",_this95.scene,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:s,contextType:"2d"}));var o={thread:_this95,viewId:_this95.viewId,vNodes:_this95.vNodes,fullLayer:_this95.fullLayer};_this95.localWork=new iI(_objectSpread(_objectSpread({},o),{},{drawLayer:_this95.localDrawLayer})),n.combineUnitTime&&_this95.localWork.setCombineUnitTime(n.combineUnitTime),n.maxCombineEraserTime&&_this95.localWork.setmaxCombineEraserTime(n.maxCombineEraserTime),n.syncUnitTime&&_this95.localWork.setSyncUnitTime(n.syncUnitTime),_this95.serviceWork=new sI(_objectSpread(_objectSpread({},o),{},{drawLayer:_this95.serviceDrawLayer})),_this95.methodBuilder=new Y2([ve.CopyNode,ve.SetColorNode,ve.DeleteNode,ve.RotateNode,ve.ScaleNode,ve.TranslateNode,ve.ZIndexNode,ve.SetFontStyle,ve.SetPoint,ve.SetLock,ve.SetShapeOpt]).registerForWorker(_this95),_this95.vNodes.init(_this95.fullLayer);return _this95;}_inherits(aI,_S11);return _createClass(aI,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee91(){var _this96=this;var o,a,_this$combinePostData2,e,n,i,u,_iterator97,_step97,d,v,s,_t97;return _regenerator().w(function(_context98){while(1)switch(_context98.p=_context98.n){case 0:_this$combinePostData2=this.combinePostData(),e=_this$combinePostData2.render,n=_objectWithoutProperties(_this$combinePostData2,_excluded5);if(!(e!=null&&e.length)){_context98.n=11;break;}u=[];_iterator97=_createForOfIteratorHelper(e);_context98.p=1;_iterator97.s();case 2:if((_step97=_iterator97.n()).done){_context98.n=7;break;}d=_step97.value;if(!d.rect){_context98.n=6;break;}if(!(d.rect=QS(br(d.rect),this.scene,this.dpr),!d.rect)){_context98.n=3;break;}return _context98.a(3,6);case 3:if(!(d.drawCanvas&&d.rect&&d.rect.w>0&&d.rect.h>0)){_context98.n=5;break;}_context98.n=4;return this.getRectImageBitmap(d);case 4:v=_context98.v;d.imageBitmap=v,i||(i=[]),i.push(v);case 5:u.push(d);case 6:_context98.n=2;break;case 7:_context98.n=9;break;case 8:_context98.p=8;_t97=_context98.v;_iterator97.e(_t97);case 9:_context98.p=9;_iterator97.f();return _context98.f(9);case 10:n.render=u;case 11:s=(o=n.sp)==null?void 0:o.filter(function(u){return u.type!==xt.None||u.isLockSentEventCursor||u.needUndoTicker||u.collectUndoTicker;});s!=null&&s.length?n.sp=s.map(function(u){return _objectSpread(_objectSpread({},u),{},{viewId:_this96.viewId});}):delete n.sp,n.fullWorkerDrawCount===void 0&&delete n.fullWorkerDrawCount,n.consumeCount===void 0&&delete n.consumeCount,(n!=null&&n.fullWorkerDrawCount||n.consumeCount||s!=null&&s.length||(a=n.render)!=null&&a.length)&&this._post(n,i),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 12:return _context98.a(2);}},_callee91,this,[[1,8,9,10]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee92(e){var _this97=this;var n,i,s,o,a,u,d,v,_d9,_t98,_t99;return _regenerator().w(function(_context99){while(1)switch(_context99.n){case 0:if(!this.methodBuilder.consumeForWorker(e)){_context99.n=1;break;}return _context99.a(2);case 1:n=e.msgType,i=e.dataType,s=e.workId,o=e.toolsType,a=e.workState,u=e.workIds;_t98=n;_context99.n=_t98===xt.AuthClear?2:_t98===xt.CreateWork?3:_t98===xt.DrawWork?4:_t98===xt.Select?8:_t98===xt.UpdateNode?12:_t98===xt.FullWork?12:_t98===xt.RemoveNode?13:_t98===xt.GetTextActive?15:_t98===xt.CursorHover?17:_t98===xt.CursorBlur?19:_t98===xt.GetVNodeInfo?21:22;break;case 2:d=e.clearUids,v=e.localUid;this.vNodes.setCanClearUids(d),this.vNodes.setLocalUid(v);return _context99.a(3,22);case 3:o!==It.LaserPen&&this.createLocalWork(e);return _context99.a(3,22);case 4:_t99=o!==It.LaserPen;if(!_t99){_context99.n=7;break;}if(!(a===te.Done&&i===Kt.Local)){_context99.n=6;break;}_context99.n=5;return this.consumeDrawAll(i,e);case 5:_context99.n=7;break;case 6:this.consumeDraw(i,e);case 7:return _context99.a(3,22);case 8:if(!(s===Fe)){_context99.n=10;break;}_context99.n=9;return this.localWork.updateFullSelectWork(e);case 9:_context99.n=11;break;case 10:this.serviceWork.runSelectWork(e);case 11:return _context99.a(2);case 12:this.consumeFull(i,e);return _context99.a(2);case 13:_context99.n=14;return this.removeNode(e);case 14:return _context99.a(2);case 15:_context99.n=16;return this.checkTextActive(e);case 16:return _context99.a(2);case 17:_context99.n=18;return this.cursorHover(e);case 18:return _context99.a(2);case 19:_context99.n=20;return this.cursorBlur();case 20:return _context99.a(2);case 21:if(s&&u){_d9=u.map(function(v){return _this97.vNodes.get(v);});this.post({sp:[{type:xt.GetVNodeInfo,dataType:Kt.Worker,workId:s,vInfo:_d9}]});}return _context99.a(3,22);case 22:_context99.n=23;return _superPropGet(aI,"on",this,3)([e]);case 23:return _context99.a(2);}},_callee92,this);}));function on(_x123){return _on3.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee93(e){var _this98=this;var n,i,s,o,a,_iterator98,_step98,_loop11,_t100;return _regenerator().w(function(_context101){while(1)switch(_context101.p=_context101.n){case 0:n=e.dataType,i=e.workId,s=e.removeIds,o=[],a=s||[];if(!(i&&a.push(i.toString()),a.length)){_context101.n=8;break;}_iterator98=_createForOfIteratorHelper(a);_context101.p=1;_loop11=/*#__PURE__*/_regenerator().m(function _loop11(){var u;return _regenerator().w(function(_context100){while(1)switch(_context100.n){case 0:u=_step98.value;u===Fe?o.push(_this98.localWork.removeSelector(e,_this98)):n===Kt.Local?o.push(_this98.localWork.removeWork(e).then(function(){_this98.localWork.colloctEffectSelectWork(e),_this98.deleteCachedImagesByWorkId(u);})):n===Kt.Service&&o.push(_this98.serviceWork.removeWork(e).then(function(){_this98.localWork.colloctEffectSelectWork(e),_this98.deleteCachedImagesByWorkId(u);}));case 1:return _context100.a(2);}},_loop11);});_iterator98.s();case 2:if((_step98=_iterator98.n()).done){_context101.n=4;break;}return _context101.d(_regeneratorValues(_loop11()),3);case 3:_context101.n=2;break;case 4:_context101.n=6;break;case 5:_context101.p=5;_t100=_context101.v;_iterator98.e(_t100);case 6:_context101.p=6;_iterator98.f();return _context101.f(6);case 7:_context101.n=8;return Promise.all(o);case 8:return _context101.a(2);}},_callee93,null,[[1,5,6,7]]);}));function removeNode(_x124){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee94(e){var n,_t101;return _regenerator().w(function(_context102){while(1)switch(_context102.n){case 0:n=e.dataType;_t101=n===Kt.Local;if(!_t101){_context102.n=1;break;}_context102.n=1;return this.localWork.checkTextActive(e);case 1:return _context102.a(2);}},_callee94,this);}));function checkTextActive(_x125){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee95(){return _regenerator().w(function(_context103){while(1)switch(_context103.n){case 0:this.vNodes.clear();_superPropGet(aI,"clearAll",this,3)([]);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(e){e.name!=="viewport"&&e.remove();}),qr(this.localDrawLayer,this.localDrawLayer.parent));this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(e){e.name!=="viewport"&&e.remove();}),qr(this.serviceDrawLayer,this.serviceDrawLayer.parent));_context103.n=1;return this.post({render:[{isClearAll:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:Yt.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}],sp:[{type:xt.Clear}]});case 1:return _context103.a(2);}},_callee95,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(e){var n=e.width,i=e.height;_superPropGet(aI,"updateLayer",this,3)([e]),this.localDrawLayer&&(this.localDrawLayer.parent.setAttribute("width",n),this.localDrawLayer.parent.setAttribute("height",i),this.localDrawLayer.setAttribute("size",[n,i]),this.localDrawLayer.setAttribute("pos",[n*0.5,i*0.5])),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.setAttribute("width",n),this.serviceDrawLayer.parent.setAttribute("height",i),this.serviceDrawLayer.setAttribute("size",[n,i]),this.serviceDrawLayer.setAttribute("pos",[n*0.5,i*0.5]));}},{key:"setCameraOpt",value:function setCameraOpt(e){this.cameraOpt=e;var n=e.scale,i=e.centerX,s=e.centerY,o=e.width,a=e.height;(o!==this.scene.width||a!==this.scene.height)&&this.updateScene(this.scene,{width:o,height:a}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-s])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[n,n]),this.localDrawLayer.setAttribute("translate",[-i,-s])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[n,n]),this.serviceDrawLayer.setAttribute("translate",[-i,-s]));}},{key:"getLayer",value:function getLayer(e){switch(e){case Yt.Bg:return this.fullLayer;case Yt.ServiceFloat:return this.serviceDrawLayer;case Yt.Float:return this.localDrawLayer;}}},{key:"getOffscreen",value:function getOffscreen(e){return this.getLayer(e).parent.canvas;}},{key:"consumeFull",value:function(){var _consumeFull2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee96(e,n){var i,_t102;return _regenerator().w(function(_context104){while(1)switch(_context104.n){case 0:_context104.n=1;return this.localWork.colloctEffectSelectWork(n);case 1:i=_context104.v;_t102=i&&e===Kt.Local;if(!_t102){_context104.n=2;break;}_context104.n=2;return this.localWork.consumeFull(i);case 2:i&&e===Kt.Service&&this.serviceWork.consumeFull(i);case 3:return _context104.a(2);}},_callee96,this);}));function consumeFull(_x126,_x127){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw6=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee97(e,n){var i,_t103;return _regenerator().w(function(_context105){while(1)switch(_context105.n){case 0:i=n.workId;_t103=e===Kt.Local&&i;if(!_t103){_context105.n=1;break;}this.localWork.getWorkShape(i.toString())||this.createLocalWork(n);_context105.n=1;return this.localWork.consumeDraw(n,this.serviceWork);case 1:e===Kt.Service&&this.serviceWork.consumeDraw(n);case 2:return _context105.a(2);}},_callee97,this);}));function consumeDraw(_x128,_x129){return _consumeDraw6.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll5=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee98(e,n){var i,_t104;return _regenerator().w(function(_context106){while(1)switch(_context106.n){case 0:i=n.workId;_t104=e===Kt.Local&&i;if(!_t104){_context106.n=1;break;}this.localWork.getWorkShape(i.toString())||this.createLocalWork(n);_context106.n=1;return this.localWork.consumeDrawAll(n,this.serviceWork);case 1:return _context106.a(2);}},_callee98,this);}));function consumeDrawAll(_x130,_x131){return _consumeDrawAll5.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateDpr",value:function(){var _updateDpr3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee99(e){return _regenerator().w(function(_context107){while(1)switch(_context107.n){case 0:_superPropGet(aI,"updateDpr",this,3)([e]);_context107.n=1;return this.post({render:[{isClearAll:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Yt.Bg,viewId:this.viewId}]});case 1:return _context107.a(2);}},_callee99,this);}));function updateDpr(_x132){return _updateDpr3.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee101(e){var _this99=this;var d,v,p,w,n,i,s,o,a,u,A,M,et,_iterator99,_step99,_step99$value,x,y,E,_iterator100,_step100,_step100$value,_et8,_x138,_y8,_iterator101,_step101,_step101$value,_et9,_x139,_y9,L,G,_et4,_iterator102,_step102,_x134,z,_iterator103,_step103,_et5,_x135,_iterator104,_step104,_y6,_iterator105,_step105,_step105$value,_et7,_x137,_y7,S,C,P,X,$,K,j,nt,ct,_iterator106,_step106,_step106$value,_et6,_x136,_t105,_t106,_t107;return _regenerator().w(function(_context109){while(1)switch(_context109.p=_context109.n){case 0:n=[],i=e.cameraOpt,s=e.scenePath,o=e.cameraTaskId;a=!1;u=this.cameraOpt;if(!(i&&!qn(u,i))){_context109.n=13;break;}A=!u||u.scale!==i.scale||u.centerX!==i.centerX||u.centerY!==i.centerY||u.width!==i.width||u.height!==i.height;this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0,(d=this.taskUpdateCameraResolve)==null||d.call(this,!1),this.taskUpdateCameraResolve=void 0);M=!!this.serviceDrawLayer.children.length;if(!s){_context109.n=12;break;}et=[];_iterator99=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context109.p=1;_iterator99.s();case 2:if((_step99=_iterator99.n()).done){_context109.n=6;break;}_step99$value=_slicedToArray(_step99.value,2),x=_step99$value[0],y=_step99$value[1];_t105=y.toolsType;_context109.n=_t105===It.Text?3:_t105===It.PencilEraser?3:_t105===It.Eraser?3:_t105===It.Selector?3:_t105===It.LaserPen?3:4;break;case 3:return _context109.a(3,5);case 4:x!==Po&&x!==Fe&&et.push("".concat(x,":").concat(y.toolsType));return _context109.a(3,5);case 5:_context109.n=2;break;case 6:_context109.n=8;break;case 7:_context109.p=7;_t106=_context109.v;_iterator99.e(_t106);case 8:_context109.p=8;_iterator99.f();return _context109.f(8);case 9:if(!et.length){_context109.n=12;break;}_context109.n=10;return new Promise(function(y){_this99.taskUpdateCameraResolve=y,_this99.taskUpdateCameraId=setTimeout(function(){_this99.taskUpdateCameraId=void 0,_this99.taskUpdateCameraResolve=void 0,y(!0);},h1);});case 10:_t107=_context109.v;if(!_t107){_context109.n=11;break;}_context109.n=11;return this.updateCamera(e);case 11:return _context109.a(2);case 12:E=/* @__PURE__ */new Map();_iterator100=_createForOfIteratorHelper(this.vNodes.getNodesByType(It.Text).entries());try{for(_iterator100.s();!(_step100=_iterator100.n()).done;){_step100$value=_slicedToArray(_step100.value,2),_et8=_step100$value[0],_x138=_step100$value[1];_y8=_x138.rect;E.set(_et8,{rect:br(_y8),scale:(v=this.cameraOpt)==null?void 0:v.scale});}}catch(err){_iterator100.e(err);}finally{_iterator100.f();}_iterator101=_createForOfIteratorHelper(this.vNodes.gethasEraserNodes().entries());try{for(_iterator101.s();!(_step101=_iterator101.n()).done;){_step101$value=_slicedToArray(_step101.value,2),_et9=_step101$value[0],_x139=_step101$value[1];_y9=_x139.rect;E.set(_et9,{rect:br(_y9),scale:(p=this.cameraOpt)==null?void 0:p.scale});}}catch(err){_iterator101.e(err);}finally{_iterator101.f();}L=new Set(E.keys());G=!1;if(this.localWork.hasSelector()){_et4=(w=this.localWork.getSelector())==null?void 0:w.selectIds;if(_et4){G=!0;_iterator102=_createForOfIteratorHelper(_et4);try{for(_iterator102.s();!(_step102=_iterator102.n()).done;){_x134=_step102.value;L.add(_x134);}}catch(err){_iterator102.e(err);}finally{_iterator102.f();}}}z=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator103=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator103.s();!(_step103=_iterator103.n()).done;){_et5=_step103.value;_x135=_et5.selectIds;if(_x135){z=!0;_iterator104=_createForOfIteratorHelper(_x135);try{for(_iterator104.s();!(_step104=_iterator104.n()).done;){_y6=_step104.value;L.add(_y6);}}catch(err){_iterator104.e(err);}finally{_iterator104.f();}}}}catch(err){_iterator103.e(err);}finally{_iterator103.f();}}if(this.setCameraOpt(i),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(L),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator105=_createForOfIteratorHelper(E.entries());try{for(_iterator105.s();!(_step105=_iterator105.n()).done;){_step105$value=_slicedToArray(_step105.value,2),_et7=_step105$value[0],_x137=_step105$value[1].rect;_y7=this.vNodes.get(_et7);if(_y7){S=_x137,C=_y7.rect,P=this.getSceneRect(),X=qa(S,P),$=qa(C,P),K=_y7.toolsType,j=_y7.opt;nt=!1;(X!==$||S.w!==C.w||S.h!==C.h||$===Ji.intersect)&&(nt=!0),K===It.Text&&// (opt as TextOptions).workState === EventWorkState.Done &&
|
|
492
|
-
nt&&this.debounceUpdateCache.add(_et7);ct=A;(j.eraserlines&&j.eraserlines.length||j.eraserFaces)&&ct&&!this.debounceUpdateCache.has(_et7)&&this.debounceUpdateCache.add(_et7);}}}catch(err){_iterator105.e(err);}finally{_iterator105.f();}if(G&&this.localWork.reRenderSelector(),z){_iterator106=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator106.s();!(_step106=_iterator106.n()).done;){_step106$value=_slicedToArray(_step106.value,2),_et6=_step106$value[0],_x136=_step106$value[1];this.serviceWork.runSelectWork({workId:_et6,selectIds:_x136.selectIds,msgType:xt.Select,dataType:Kt.Service,viewId:this.viewId});}}catch(err){_iterator106.e(err);}finally{_iterator106.f();}}a=!0,this.debounceUpdateCameraId=setTimeout(function(){var x;_this99.debounceUpdateCameraId=void 0;var et=[];var _iterator107=_createForOfIteratorHelper(_this99.debounceUpdateCache.values()),_step107;try{var _loop12=function _loop12(){var y=_step107.value;var S=_this99.vNodes.get(y);if(S){var C=S.toolsType,P=S.opt,X=S.op,$=_this99.localWork.setFullWork({toolsType:C,opt:P,workId:y});$&&(C===It.Text?(x=_this99.fullLayer)!=null&&x.getElementsByName(y)[0]&&$ instanceof Ha&&et.push($.consumeServiceAsync({isFullWork:!0,replaceId:y,boxRect:_this99.getSceneRect()})):(P.eraserlines&&P.eraserlines.length||P.eraserFaces)&&et.push(new Promise(function(K){var j=$.consumeService({op:X,isFullWork:!0,replaceId:y,workState:te.Done});_this99.localWork.clearWorkShapeNodeCache(y),K(j);})));}_this99.debounceUpdateCache.delete(y);};for(_iterator107.s();!(_step107=_iterator107.n()).done;){_loop12();}}catch(err){_iterator107.e(err);}finally{_iterator107.f();}et.length?Promise.all(et).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee100(){var y;return _regenerator().w(function(_context108){while(1)switch(_context108.n){case 0:y=[];y.push({isClearAll:!0,clearCanvas:Yt.Bg,viewId:_this99.viewId},{isDrawAll:!0,drawCanvas:Yt.Bg,viewId:_this99.viewId});y.length&&_this99.post({render:y});_this99.vNodes.updateLowLevelNodesRect();_this99.vNodes.clearHighLevelIds();_context108.n=1;return _this99.fullLayer.parent.prepareRender;case 1:Ze(o)&&_this99.post({viewId:_this99.viewId,cameraSettledTaskId:o});case 2:return _context108.a(2);}},_callee100);}))):(_this99.vNodes.updateLowLevelNodesRect(),_this99.vNodes.clearHighLevelIds(),Ze(o)&&_this99.post({viewId:_this99.viewId,cameraSettledTaskId:o}));},h1*5);}M&&n.push({isClearAll:!0,clearCanvas:Yt.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&n.push({isClearAll:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Yt.Bg,viewId:this.viewId}),n.length&&this.post({render:n}),!a&&Ze(o)&&this.post({viewId:this.viewId,cameraSettledTaskId:o});case 13:return _context109.a(2);}},_callee101,this,[[1,7,8,9]]);}));function updateCamera(_x133){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function(){var _getRectImageBitmap2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee102(e){var d,n,i,v,s,o,a,u,_v12,_t108;return _regenerator().w(function(_context110){while(1)switch(_context110.p=_context110.n){case 0:n=e.rect,i=e.drawCanvas;if(!(((d=this.opt.bitmapEraserMaskOptions)==null?void 0:d.imageBitmapDirtyRect)===!1)){_context110.n=1;break;}v=this.getOffscreen(i);return _context110.a(2,(n.x=0,n.y=0,n.w=v.width/this.dpr,n.h=v.height/this.dpr,createImageBitmap(v,0,0,v.width,v.height,{resizeQuality:"low"})));case 1:s=Math.floor(n.x*this.dpr),o=Math.floor(n.y*this.dpr),a=Math.floor(n.w*this.dpr||1),u=Math.floor(n.h*this.dpr||1);_context110.p=2;_context110.n=3;return createImageBitmap(this.getOffscreen(i),s,o,a,u,{resizeQuality:"low"});case 3:return _context110.a(2,_context110.v);case 4:_context110.p=4;_t108=_context110.v;this.opt.bitmapEraserMaskOptions&&(this.opt.bitmapEraserMaskOptions.imageBitmapDirtyRect=!1);_v12=this.getOffscreen(i);return _context110.a(2,(n.x=0,n.y=0,n.w=_v12.width/this.dpr,n.h=_v12.height/this.dpr,createImageBitmap(_v12,0,0,_v12.width,_v12.height,{resizeQuality:"low"})));}},_callee102,this,[[2,4]]);}));function getRectImageBitmap(_x140){return _getRectImageBitmap2.apply(this,arguments);}return getRectImageBitmap;}()},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee103(e){return _regenerator().w(function(_context111){while(1)switch(_context111.n){case 0:_context111.n=1;return this.localWork.cursorHover(e);case 1:return _context111.a(2);}},_callee103,this);}));function cursorHover(_x141){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee104(){return _regenerator().w(function(_context112){while(1)switch(_context112.n){case 0:_context112.n=1;return this.localWork.cursorBlur();case 1:return _context112.a(2);}},_callee104,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(aI,"destroy",this,3)([]);}}]);}(_S);var qbt=/*#__PURE__*/function(_aI){function qbt(e,n,i){var _this100;_classCallCheck(this,qbt);var o,a,u,d;_this100=_callSuper(this,qbt,[e,n,i]);wt(_this100,"snapshotWork");wt(_this100,"localDrawScene");wt(_this100,"serviceDrawScene");wt(_this100,"offscreenCanvas");wt(_this100,"localWork");wt(_this100,"serviceWork");if(_this100._post=i,n.offscreenCanvas){_this100.offscreenCanvas=n.offscreenCanvas,_this100.localDrawScene=_this100.createScene(n,(o=_this100.offscreenCanvas)==null?void 0:o.localCanvas),_this100.serviceDrawScene=_this100.createScene(n,(a=_this100.offscreenCanvas)==null?void 0:a.serviceCanvas);var v=zr.bufferSize.sub;_this100.serviceDrawLayer=_this100.createLayer("serviceDrawLayer",_this100.serviceDrawScene||_this100.scene,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:v,contextType:"2d"}),(u=_this100.offscreenCanvas)==null?void 0:u.serviceCanvas),_this100.localDrawLayer=_this100.createLayer("localDrawLayer",_this100.localDrawScene||_this100.scene,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:v,contextType:"2d"}),(d=_this100.offscreenCanvas)==null?void 0:d.localCanvas);}var s={thread:_this100,viewId:_this100.viewId,vNodes:_this100.vNodes,fullLayer:_this100.fullLayer};_this100.localWork=new Gbt(_objectSpread(_objectSpread({},s),{},{drawLayer:_this100.localDrawLayer})),n.combineUnitTime&&_this100.localWork.setCombineUnitTime(n.combineUnitTime),n.maxCombineEraserTime&&_this100.localWork.setmaxCombineEraserTime(n.maxCombineEraserTime),n.syncUnitTime&&_this100.localWork.setSyncUnitTime(n.syncUnitTime),_this100.serviceWork=new Hbt(_objectSpread(_objectSpread({},s),{},{drawLayer:_this100.serviceDrawLayer})),_this100.snapshotWork=new oI(_objectSpread(_objectSpread({},s),{},{createScene:_this100.createScene.bind(_this100),createLayer:_this100.createLayer.bind(_this100)})),_this100.methodBuilder=new Y2([ve.CopyNode,ve.SetColorNode,ve.DeleteNode,ve.RotateNode,ve.ScaleNode,ve.TranslateNode,ve.ZIndexNode,ve.SetFontStyle,ve.SetPoint,ve.SetLock,ve.SetShapeOpt]).registerForWorker(_this100);return _this100;}_inherits(qbt,_aI);return _createClass(qbt,[{key:"createRenderLayer",value:function createRenderLayer(e,n,i){var a;var s=zr.bufferSize.full,o=zr.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",e,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:this.viewId===Ds?s:o*2}),i||((a=n.offscreenCanvas)==null?void 0:a.bgCanvas));}},{key:"createScene",value:function createScene(e,n){var i=e.offscreenCanvas,s=e.offscreenCanvasOpt,o=s.width,a=s.height,u=n||(i==null?void 0:i.bgCanvas)||new OffscreenCanvas(o,a);s.contextType&&delete s.contextType;var d=new Jp(_objectSpread(_objectSpread({container:u,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},s),{},{contextType:this.contextType,id:this.viewId}));return d.setAttribute("id",this.viewId),d;}},{key:"combinePostData",value:function combinePostData(){var o,a;this.workerTaskId=void 0;var e=[],n=[];var i;var s=/* @__PURE__ */new Set();var _iterator108=_createForOfIteratorHelper(this.combinePostMsg.values()),_step108;try{for(_iterator108.s();!(_step108=_iterator108.n()).done;){var u=_step108.value;if((o=u.render)!=null&&o.length)try{if(this.offscreenCanvas){var _iterator109=_createForOfIteratorHelper(u.render),_step109;try{for(_iterator109.s();!(_step109=_iterator109.n()).done;){var d=_step109.value;d.workId&&s.add(d.workId);var v=d.drawCanvas||d.clearCanvas;if(v){var p=this.getLayer(v);if(!p||!(p.parent instanceof Zi))continue;p.parent.render();}}}catch(err){_iterator109.e(err);}finally{_iterator109.f();}}else{var _iterator110=_createForOfIteratorHelper(u.render),_step110;try{for(_iterator110.s();!(_step110=_iterator110.n()).done;){var _d0=_step110.value;var _v13=!1;if(_d0.workId&&s.add(_d0.workId),_d0.isClearAll&&(_d0.rect=this.getSceneRect(),_d0.isClear=!0,delete _d0.isClearAll),_d0.drawCanvas){var _p9=this.getLayer(_d0.drawCanvas);if(!_p9||!(_p9.parent instanceof Zi))continue;if(_p9.parent.render(),_d0.isDrawAll){var w=this.getSceneRect();_d0.rect=w,delete _d0.isDrawAll;}}var _iterator111=_createForOfIteratorHelper(e),_step111;try{for(_iterator111.s();!(_step111=_iterator111.n()).done;){var _p0=_step111.value;if(_d0.viewId===_p0.viewId){_d0.isClear&&_p0.clearCanvas&&_p0.isClear&&_p0.clearCanvas===_d0.clearCanvas&&(_p0.rect=Jt(_p0.rect,_d0.rect),_v13=!0),_p0.drawCanvas&&_p0.drawCanvas===_d0.drawCanvas&&(_p0.rect=Jt(_p0.rect,_d0.rect),_v13=!0);continue;}}}catch(err){_iterator111.e(err);}finally{_iterator111.f();}_v13||(_d0.isClear&&!_d0.drawCanvas?e.unshift(_d0):e.push(_d0));}}catch(err){_iterator110.e(err);}finally{_iterator110.f();}}}catch(d){var _v14=d&&d instanceof Error?d.message:d==null?void 0:d.toString();console.error("[WorkThreadEngineForSimpleWorker] combinePostData error",_v14),n.push({type:xt.ReportError,reportString:"[WorkThreadEngineForSimpleWorker] combinePostData error: ".concat(_v14)});}if((a=u.sp)!=null&&a.length){var _iterator112=_createForOfIteratorHelper(u.sp),_step112;try{for(_iterator112.s();!(_step112=_iterator112.n()).done;){var _d1=_step112.value;var _v15=!1;var _iterator113=_createForOfIteratorHelper(n),_step113;try{for(_iterator113.s();!(_step113=_iterator113.n()).done;){var _p1=_step113.value;if(qn(_d1,_p1)){_v15=!0;break;}}}catch(err){_iterator113.e(err);}finally{_iterator113.f();}_v15||n.push(_d1);}}catch(err){_iterator112.e(err);}finally{_iterator112.f();}}Ze(u.consumeCount)&&(i=u.consumeCount);}}catch(err){_iterator108.e(err);}finally{_iterator108.f();}return this.combinePostMsg.clear(),{render:e,sp:n,consumeCount:i,workIds:s,viewId:this.viewId};}},{key:"on",value:function(){var _on4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee105(e){var n,_t109;return _regenerator().w(function(_context113){while(1)switch(_context113.n){case 0:if(!this.methodBuilder.consumeForWorker(e)){_context113.n=1;break;}return _context113.a(2);case 1:n=e.msgType;_t109=n;_context113.n=_t109===xt.Snapshot?2:_t109===xt.BoundingBox?4:6;break;case 2:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ds?6e3:3e3,contextType:"2d"}));_context113.n=3;return this.snapshotWork.getSnapshot(e);case 3:this.snapshotWork.destroySnapshotFullLayer();return _context113.a(2);case 4:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ds?6e3:3e3,contextType:"2d"}));_context113.n=5;return this.snapshotWork.getBoundingRect(e);case 5:this.snapshotWork.destroySnapshotFullLayer();return _context113.a(2);case 6:_context113.n=7;return _superPropGet(qbt,"on",this,3)([e]);case 7:return _context113.a(2);}},_callee105,this);}));function on(_x142){return _on4.apply(this,arguments);}return on;}()},{key:"setCameraOpt",value:function setCameraOpt(e){if(this.localDrawScene&&this.serviceDrawScene){var n=e.width,i=e.height;(n!==this.localDrawScene.width||i!==this.localDrawScene.height)&&this.updateScene(this.localDrawScene,{width:n,height:i},this.localDrawLayer),(n!==this.serviceDrawScene.width||i!==this.serviceDrawScene.height)&&this.updateScene(this.serviceDrawScene,{width:n,height:i},this.serviceDrawLayer);}_superPropGet(qbt,"setCameraOpt",this,3)([e]);}},{key:"updateDpr",value:function(){var _updateDpr4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee106(e){return _regenerator().w(function(_context114){while(1)switch(_context114.n){case 0:this.localDrawScene&&this.serviceDrawScene&&(this.localDrawScene.displayRatio=e,this.serviceDrawScene.displayRatio=e),_superPropGet(qbt,"updateDpr",this,3)([e]);case 1:return _context114.a(2);}},_callee106,this);}));function updateDpr(_x143){return _updateDpr4.apply(this,arguments);}return updateDpr;}()}]);}(aI);var A1=self;A1.full=new Vbt(A1,Tu.Full,function(r,t){var e=r.viewId,n=r.dpr,i=r.offscreenCanvasOpt,s=r.layerOpt,o=r.combineUnitTime,a=r.syncUnitTime,u=r.maxCombineEraserTime,d=r.offscreenCanvas,v=r.isUseSimple,p=r.bitmapEraserMaskOptions;if(!e||!n||!i||!s)return;var w={dpr:n,offscreenCanvasOpt:i,layerOpt:s,combineUnitTime:o,syncUnitTime:a,maxCombineEraserTime:u,bitmapEraserMaskOptions:p};return v?new qbt(e,_objectSpread(_objectSpread({},w),{},{offscreenCanvas:d}),t):new aI(e,w,t);});
|
|
484
|
+
var z=_this64.doingLines.get(w);z||(z=[],_this64.doingLines.set(w,z),_this64.vNodes&&_this64.doingTransformDisposers.set(w,ygt(_this64.vNodes,w,function(x){var y=_this64.doingLines.get(w);y&&Sgt(y,x);},function(){_this64.doingLines.delete(w),_this64.changedNodes.delete(w);})));var et=z.find(function(x){return x.workId===_this64.workId;});if(et?(_et$op=et.op).push.apply(_et$op,G):z.push({workId:_this64.workId,op:G,thickness:n}),i){var _x31=A.toolsType,_y5=i.createWorkShapeNode({workId:w,toolsType:_x31,toolsOpt:_objectSpread(_objectSpread({},A.opt),{},{doingLines:z})});_y5==null||_y5.setWorkId(w);var _S1=_y5==null?void 0:_y5.consumeService({op:A.op,isFullWork:!0,replaceId:w});a=Jt(a,_S1);}s.set(w,A),_this64.changedNodes.set(w,A);},_ret;for(_iterator53.s();!(_step53=_iterator53.n()).done;){_ret=_loop6();if(_ret===0)continue;}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}return this.changedRect=Jt(this.changedRect,a),{willUpdateNodes:s,willDeleteNodes:o,rect:a};}},{key:"consume",value:function consume(e){var n=e.data,i=n.op;if(!i||i.length===0)return _objectSpread({type:xt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_Mo$eraserSizes$s2=Mo.eraserSizes[s],o=_Mo$eraserSizes$s2.width,a=_Mo$eraserSizes$s2.height,u=Math.round(Math.max(o,a)/this.worldScaling[0]);return this.updateTempPoints(i,u),_objectSpread({type:xt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var i=[];var s=0;var o=360-n;for(var a=1;a<e.length;a++){var u=e[a-1],d=e[a];if(a===1&&s===0&&(i[s]=[u.XY]),i[s].push(d.XY),a<e.length-1){var v=d.getAngleByPoints(u,e[a+1]);(v<n||v>o)&&(s++,i[s]=[d.XY]);}}return e.length===1&&i.length===0&&i.push([e[0].XY,e[0].XY]),i;}},{key:"consumeAll",value:function consumeAll(e){var n=e.workerEngine;if(this.replace(this.fullLayer,this.workId),!this.tmpPoints.length)return _objectSpread({type:xt.None},this.baseConsumeResult);var i=this.workOptions.thickness,_Mo$eraserSizes$i=Mo.eraserSizes[i],s=_Mo$eraserSizes$i.width,o=_Mo$eraserSizes$i.height,a=Math.round(Math.max(s,o)/this.worldScaling[0]),u=this.getDeltaPoints(!0);u&&(this.getChangeNodes(u.points,a,n),this.committedPointIndex=u.committedIndex),this.commitDoingFaces(),this.workOptions.removeOnDone!==!1&&this.confirmChangedNodeDeletions(n);var d=new Set(this.deletedNodes),v=new Map(this.changedNodes),p=this.changedRect;if(d.size===0&&v.size===0)return _objectSpread(_objectSpread({type:xt.FullWork},this.baseConsumeResult),{},{rect:p});var w=[];this.tmpPoints.map(function(M){w.push(M.x,M.y,a/2);});var A=Br(w);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:xt.FullWork,dataType:Kt.Local,rect:p,ops:A,willUpdateNodes:v,willDeleteNodes:d});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.committedPointIndex=-1,this.changedNodes.clear(),this.doingLines.clear();var _iterator56=_createForOfIteratorHelper(this.doingTransformDisposers.values()),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var e=_step56.value;e();}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}this.doingTransformDisposers.clear(),this.deletedNodes.clear(),this.changedRect=void 0;}},{key:"commitDoingFaces",value:function commitDoingFaces(){var e,n;var _iterator57=_createForOfIteratorHelper(this.doingLines),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _step57$value=_slicedToArray(_step57.value,2),i=_step57$value[0],s=_step57$value[1];var o=((e=this.vNodes)==null?void 0:e.get(i))||this.changedNodes.get(i);if(!(o!=null&&o.opt)||!s.length)continue;var a=Tgt(o.opt,s),u=_objectSpread(_objectSpread({},o.opt),a);delete u.eraserlines,o.opt=u,this.changedNodes.set(i,o),(n=this.vNodes)==null||n.setInfo(i,{opt:u});}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}}},{key:"confirmChangedNodeDeletions",value:function confirmChangedNodeDeletions(e){if(e)for(var _i7=0,_arr=_toConsumableArray(this.changedNodes);_i7<_arr.length;_i7++){var _arr$_i=_slicedToArray(_arr[_i7],2),n=_arr$_i[0],i=_arr$_i[1];var s=e.createWorkShapeNode({workId:n,toolsType:i.toolsType,toolsOpt:i.opt});s==null||s.setWorkId(n),s==null||s.setEraserDeleteConfirmation(!0);var o=s==null?void 0:s.consumeService({op:i.op,isFullWork:!0,replaceId:n});this.changedRect=Jt(this.changedRect,o),s!=null&&s.isDelete&&(e.removeNode(n),this.deletedNodes.add(n),this.changedNodes.delete(n));}}},{key:"getDeltaPoints",value:function getDeltaPoints(e){var n=UPt(this.tmpPoints.length,this.committedPointIndex,e);if(n)return{points:this.tmpPoints.slice(n.start,n.end+1),committedIndex:n.committedIndex};}}]);}(jt);// 来源于white-sdk
|
|
485
|
+
wt(Mo,"eraserSizes",v0);var wu=Mo;var Va=/*#__PURE__*/function(_jt14){function Va(e){var _this65;_classCallCheck(this,Va);_this65=_callSuper(this,Va,[e]);wt(_this65,"canRotate",!1);wt(_this65,"scaleType",be.all);wt(_this65,"toolsType",It.BackgroundSVG);wt(_this65,"tmpPoints",[]);wt(_this65,"workOptions");wt(_this65,"oldRect");_this65.workOptions=e.toolsOpt,_this65.scaleType=Va.getScaleType(_this65.workOptions);return _this65;}_inherits(Va,_jt14);return _createClass(Va,[{key:"consume",value:function consume(){return{type:xt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:xt.None};}},{key:"draw",value:function draw(e){var n=e.layer,i=e.workId,s=e.replaceId,_this$workOptions15=this.workOptions,o=_this$workOptions15.centerX,a=_this$workOptions15.centerY,u=_this$workOptions15.width,d=_this$workOptions15.height,v=_this$workOptions15.rotate,p=_this$workOptions15.zIndex,w=(p||0)-100,A=new ar({anchor:[0.5,0.5],pos:[o,a],name:i,size:[u,d],zIndex:w,rotate:v}),M=new ja({normalize:!0,pos:[0,0],width:u,height:d});A.appendChild(M),this.replace(n,s||i,A);var E=A.getBoundingClientRect();if(E)return{x:Math.floor(E.x-jt.SafeBorderPadding),y:Math.floor(E.y-jt.SafeBorderPadding),w:Math.floor(E.width+jt.SafeBorderPadding*2),h:Math.floor(E.height+jt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(e){var o;var n=e.replaceId,i=this.workId,s=this.draw({workId:i,layer:this.fullLayer,replaceId:n});return(o=this.vNodes)==null||o.setInfo(i,{rect:s,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&jt.getCenterPos(s,this.fullLayer)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"normalizeStorageData",value:function normalizeStorageData(e){return jt.normalizeStorageData(e);}},{key:"getScaleType",value:function getScaleType(e){var n=e.uniformScale,i=e.rotate;return n!==!1||i&&Math.abs(i)%90>0?be.proportional:be.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(e){var n=e.node,i=e.opt,s=e.vNodes,o=e.targetNode,a=i.translate,u=i.originPoint,d=i.scenePoint,v=i.scale,p=i.angle,w=i.isLocked,A=i.zIndexForBackgroundSVG,M=o&&br(o)||s.get(n.name);if(!M)return;var E=n.parent;if(E){if(Ze(A)){var L=(A||0)-100;n.setAttribute("zIndex",L),M.opt.zIndex=A;}if(bs(w)&&(M.opt.locked=w),u&&d&&v&&a){var _M$opt=M.opt,_L15=_M$opt.centerX,G=_M$opt.centerY,z=_M$opt.width,et=_M$opt.height,x=_M$opt.uniformScale,y=x!==!1?[v[0],v[0]]:v,S=[_L15,G],C=[_L15,G];uf(C,d,y,a);var P=[C[0]-S[0],C[1]-S[1]];M.centerPos=[M.centerPos[0]+P[0],M.centerPos[1]+P[1]],M.opt.width=Math.round(z*y[0]),M.opt.height=Math.round(et*y[1]),M.opt.centerX=C[0],M.opt.centerY=C[1];}else if(a)M.opt.centerX=M.opt.centerX+a[0],M.opt.centerY=M.opt.centerY+a[1],M.centerPos=[M.centerPos[0]+a[0],M.centerPos[1]+a[1]];else if(Ze(p))if(M.opt.rotate=p,M.scaleType=Va.getScaleType(M.opt),o){var _L16=T0(M.rect,p);M.rect=_L16;}else{var _L17=jt.getRectFromLayer(E,n.name);M.rect=_L17||M.rect;}return M&&s.setInfo(n.name,M),M==null?void 0:M.rect;}}}]);}(jt);function VS(r){switch(r){case It.Arrow:return PS;case It.Pencil:return IS;case It.Straight:return OS;case It.Ellipse:return AS;case It.Polygon:case It.Triangle:return ES;case It.Star:case It.Rhombus:return MS;case It.Rectangle:return bS;case It.SpeechBalloon:return LS;case It.Text:return Ha;case It.LaserPen:return TS;case It.Eraser:return pu;case It.PencilEraser:return yu;case It.BitMapEraser:return wu;case It.Selector:return Xa;case It.Image:return Ga;case It.BackgroundSVG:return Va;}}function cf(r,t){var e=r.toolsType,n=_objectWithoutProperties(r,_excluded2);switch(e){case It.Arrow:return new PS(n);case It.Pencil:return new IS(n);case It.Straight:return new OS(n);case It.Ellipse:return new AS(n);case It.Polygon:case It.Triangle:return new ES(n);case It.Star:case It.Rhombus:return new MS(n);case It.Rectangle:return new bS(n);case It.SpeechBalloon:return new LS(n);case It.Text:return new Ha(n);case It.LaserPen:return new TS(n);case It.Eraser:return new pu(n,t);case It.BitMapEraser:return new wu(n);case It.PencilEraser:return new yu(n);case It.Selector:return n.vNodes?new Xa(_objectSpread(_objectSpread({},n),{},{vNodes:n.vNodes,drawLayer:n.fullLayer})):void 0;case It.Image:return new Ga(n);case It.BackgroundSVG:return new Va(_objectSpread(_objectSpread({},n),{},{toolsOpt:n.toolsOpt}));default:return;}}function ZS(r){var t=[],e=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL","SPRITESVG"];var _iterator58=_createForOfIteratorHelper(r),_step58;try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){var n=_step58.value;if(n.tagName==="GROUP"&&n.children.length){var i=ZS(n.children);t.push.apply(t,_toConsumableArray(i));}n.tagName&&e.includes(n.tagName)&&t.push(n);}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}return t;}function Jt(r,t){if(r&&t){var e=Math.min(r.x,t.x),n=Math.min(r.y,t.y),i=Math.max(r.x+r.w,t.x+t.w),s=Math.max(r.y+r.h,t.y+t.h),o=i-e,a=s-n;return{x:e,y:n,w:o,h:a};}return t||r;}function $e(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e={x:0,y:0,w:0,h:0};var n=1/0,i=1/0,s=-1/0,o=-1/0;return r.forEach(function(a){var _a$XY=_slicedToArray(a.XY,2),u=_a$XY[0],d=_a$XY[1];n=Math.min(n,u-t),i=Math.min(i,d-t),s=Math.max(s,u+t),o=Math.max(o,d+t);}),e.x=n,e.y=i,e.w=s-n,e.h=o-i,e;}function Su(r,t){return!(r.x+r.w<t.x||r.x>t.x+t.w||r.y+r.h<t.y||r.y>t.y+t.h);}function me(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(r.x-t),y:Math.floor(r.y-t),w:Math.ceil(r.w+t*2),h:Math.ceil(r.h+t*2)};}function Za(r,t){return{x:r.x+t[0],y:r.y+t[1],w:r.w,h:r.h};}function zPt(r,t){var e=new Ct(r.x,r.y),n=new Ct(r.x+r.w,r.y),i=new Ct(r.x+r.w,r.y+r.h),s=new Ct(r.x,r.y+r.h),o=new Ct(r.x+r.w/2,r.y+r.h/2),a=Math.PI*t/180,u=Ct.RotWith(e,o,a),d=Ct.RotWith(n,o,a),v=Ct.RotWith(i,o,a),p=Ct.RotWith(s,o,a);return[u,d,v,p];}function T0(r,t){var e=zPt(r,t);return $e(e);}function qS(r,t,e){var n=new Ct(r.x,r.y),i=new Ct(r.x+r.w,r.y),s=new Ct(r.x+r.w,r.y+r.h),o=new Ct(r.x,r.y+r.h),a=new Ct(e[0],e[1]),u=new Ct(t[0],t[1]),d=Ct.ScaleWOrigin(n,u,a),v=Ct.ScaleWOrigin(i,u,a),p=Ct.ScaleWOrigin(s,u,a),w=Ct.ScaleWOrigin(o,u,a);return $e([d,v,p,w]);}function $Pt(r,t,e){var n=new Ct(t[0],t[1]);for(var i=0;i<r.length;i+=3){var s=new Ct(r[i],r[i+1]),o=Math.PI*e/180,a=Ct.RotWith(s,n,o);r[i]=a.x,r[i+1]=a.y;}}function y1(r,t,e){var n=new Ct(t[0],t[1]);for(var i=0;i<r.length;i+=2){var s=new Ct(r[i],r[i+1]),o=Math.PI*e/180,a=Ct.RotWith(s,n,o);r[i]=a.x,r[i+1]=a.y;}}function uf(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var i=new Ct(t[0],t[1]);for(var s=0;s<r.length;s+=3){var o=new Ct(r[s],r[s+1]),a=new Ct(e[0],e[1]),u=Ct.ScaleWOrigin(o,a,i);r[s]=u.x+n[0],r[s+1]=u.y+n[1];}}function Fa(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var i=new Ct(t[0],t[1]);for(var s=0;s<r.length;s+=2){var o=new Ct(r[s],r[s+1]),a=new Ct(e[0],e[1]),u=Ct.ScaleWOrigin(o,a,i);r[s]=u.x+n[0],r[s+1]=u.y+n[1];}}function YPt(r,t){return r[0]>=t.x&&r[0]<=t.x+t.w&&r[1]>=t.y&&r[1]<=t.y+t.h;}function KS(r,t){var e=r<=t?1:r/t,n=t<=r?1:t/r;return[e,n];}function jPt(r){var _iterator59=_createForOfIteratorHelper(r),_step59;try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){var t=_step59.value;if(isNaN(t)||t===1/0||t===-1/0)return!1;}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}return!0;}function XPt(r){return r!==Math.floor(r);}function GPt(r){var t=r.toString();return t.indexOf(".")!==-1?t.split(".")[1].length:0;}function HPt(r,t){for(;t!==0;){var _ref65=[t,r%t];r=_ref65[0];t=_ref65[1];}return r;}var VPt=function VPt(r){if(r.tagName==="GROUP"){var t=Object.getOwnPropertySymbols(r).find(function(e){return e.toString()==="Symbol(sealed)";});if(t&&r[t])return!0;}return!1;},_Ur=function Ur(r,t){if(r.mesh&&r.mesh.texture&&r.name==="eraserTexture"){var e=r.mesh.texture.image;t.deleteTexture(e);}else if(r.tagName==="GROUP"&&r&&r.children){var _iterator60=_createForOfIteratorHelper(r.children),_step60;try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){var _e8=_step60.value;_Ur(_e8,t);}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}}},qr=function qr(r,t){_Ur(r,t),r.removeAllChildren();},ZPt=function ZPt(r,t,e){var n=e.parent;if(t){var i=t.children;if(i){var _iterator61=_createForOfIteratorHelper(i),_step61;try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){var s=_step61.value;if(_Ur(s,n),s.tagName==="GROUP"){var _iterator62=_createForOfIteratorHelper(s.children),_step62;try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){var o=_step62.value;_Ur(o,n);}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}}}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}}}t.parent.replaceChild(r,t);},QS=function QS(r,t,e){if(r.w+r.x<=0||r.h+r.y<=0||r.w<=0||r.h<=0)return;var n=t.width,i=t.height,s={x:Math.floor(Math.max(0,r.x)),y:Math.floor(Math.max(0,r.y)),w:Math.floor(Math.min(n,r.w)),h:Math.floor(Math.min(i,r.h))};if(s.x+s.w>n&&(s.w=Math.floor(n-s.x)),s.y+s.h>i&&(s.h=Math.floor(i-s.y)),XPt(e)){var o=GPt(e),a=Math.pow(10,o),u=HPt(a,e*a),d=s.x%u,v=s.x-d;v>=0?(s.x=v,s.w=s.w+d):(s.x=0,s.w=s.w+d-v);var p=s.y%u,w=s.y-p;w>=0?(s.y=w,s.h=s.h+p):(s.y=0,s.h=s.h+p-w);}return s;};function yo(r){return"".concat(Iu(r.x),",").concat(Iu(r.y)," ");}function wo(r,t){return"".concat(Iu((r.x+t.x)/2),",").concat(Iu((r.y+t.y)/2)," ");}function Iu(r){return+r.toFixed(4);}var qa=function qa(r,t){return r.x+r.w<t.x||r.x>t.x+t.w||r.y+r.h<t.y||r.y>t.y+t.h?Ji.outside:r.x>=t.x&&r.y>=t.y&&r.x+r.w<=t.x+t.w&&r.y+r.h<=t.y+t.h?Ji.inside:Ji.intersect;};function qPt(r){var t=0;for(var e=0;e<r.length;e++){var n=r.charCodeAt(e);n>=1&&n<=126||65376<=n&&n<=65439?t++:t+=2;}return t;}var w1=/*#__PURE__*/function(){function w1(t){_classCallCheck(this,w1);wt(this,"_map");wt(this,"_observers",/* @__PURE__ */new Set());this._map=new Map(t);}return _createClass(w1,[{key:"notifyObservers",value:function notifyObservers(t,e,n){var _iterator63=_createForOfIteratorHelper(this._observers),_step63;try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){var i=_step63.value;i(t,e,n);}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}}},{key:"observe",value:function observe(t){this._observers.add(t);}},{key:"unobserve",value:function unobserve(t){this._observers.delete(t);}},{key:"get",value:function get(t){return this._map.get(t);}},{key:"set",value:function set(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var i=this._map.has(t)?"update":"add";return this._map.set(t,e),n&&this.notifyObservers(i,t,e),this;}},{key:"has",value:function has(t){return this._map.has(t);}},{key:"delete",value:function _delete(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var n=this._map.get(t),i=this._map.delete(t);return e&&n&&this.notifyObservers("delete",t,n),i;}},{key:"clear",value:function clear(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=this._map.keys();if(this._map.clear(),t){var _iterator64=_createForOfIteratorHelper(e),_step64;try{for(_iterator64.s();!(_step64=_iterator64.n()).done;){var n=_step64.value;this.notifyObservers("clear",n,void 0);}}catch(err){_iterator64.e(err);}finally{_iterator64.f();}}}},{key:"size",get:function get(){return this._map.size;}},{key:"keys",value:function keys(){return this._map.keys();}},{key:"values",value:function values(){return this._map.values();}},{key:"entries",value:function entries(){return this._map.entries();}},{key:"forEach",value:function forEach(t,e){this._map.forEach(t,e);}}]);}();function JS(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:r.length-1;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:KPt;for(;n>e;){if(n-e>600){var u=n-e+1,d=t-e+1,v=Math.log(u),p=0.5*Math.exp(2*v/3),w=0.5*Math.sqrt(v*p*(u-p)/u)*(d-u/2<0?-1:1),A=Math.max(e,Math.floor(t-d*p/u+w)),M=Math.min(n,Math.floor(t+(u-d)*p/u+w));JS(r,t,A,M,i);}var s=r[t];var o=e,a=n;for(Aa(r,e,t),i(r[n],s)>0&&Aa(r,e,n);o<a;){for(Aa(r,o,a),o++,a--;i(r[o],s)<0;)o++;for(;i(r[a],s)>0;)a--;}i(r[e],s)===0?Aa(r,e,a):(a++,Aa(r,a,n)),a<=t&&(e=a+1),t<=a&&(n=a-1);}}function Aa(r,t,e){var n=r[t];r[t]=r[e],r[e]=n;}function KPt(r,t){return r<t?-1:r>t?1:0;}var QPt=/*#__PURE__*/function(){function QPt(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:9;_classCallCheck(this,QPt);this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*0.4)),this.clear();}return _createClass(QPt,[{key:"all",value:function all(){return this._all(this.data,[]);}},{key:"search",value:function search(t){var e=this.data;var n=[];if(!jc(t,e))return n;var i=this.toBBox,s=[];for(;e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],u=e.leaf?i(a):a;jc(t,u)&&(e.leaf?n.push(a):Ad(t,u)?this._all(a,n):s.push(a));}e=s.pop();}return n;}},{key:"collides",value:function collides(t){var e=this.data;if(!jc(t,e))return!1;var n=[];for(;e;){for(var i=0;i<e.children.length;i++){var s=e.children[i],o=e.leaf?this.toBBox(s):s;if(jc(t,o)){if(e.leaf||Ad(t,o))return!0;n.push(s);}}e=n.pop();}return!1;}},{key:"load",value:function load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var n=0;n<t.length;n++)this.insert(t[n]);return this;}var e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){var _n4=this.data;this.data=e,e=_n4;}this._insert(e,this.data.height-e.height-1,!0);}return this;}},{key:"insert",value:function insert(t){return t&&this._insert(t,this.data.height-1),this;}},{key:"clear",value:function clear(){return this.data=Io([]),this;}},{key:"remove",value:function remove(t,e){if(!t)return this;var n=this.data;var i=this.toBBox(t),s=[],o=[];var a,u,d;for(;n||s.length;){if(n||(n=s.pop(),u=s[s.length-1],a=o.pop(),d=!0),n.leaf){var v=JPt(t,n.children,e);if(v!==-1)return n.children.splice(v,1),s.push(n),this._condense(s),this;}!d&&!n.leaf&&Ad(n,i)?(s.push(n),o.push(a),a=0,u=n,n=n.children[0]):u?(a++,n=u.children[a],d=!1):n=null;}return this;}},{key:"toBBox",value:function toBBox(t){return t;}},{key:"compareMinX",value:function compareMinX(t,e){return t.minX-e.minX;}},{key:"compareMinY",value:function compareMinY(t,e){return t.minY-e.minY;}},{key:"toJSON",value:function toJSON(){return this.data;}},{key:"fromJSON",value:function fromJSON(t){return this.data=t,this;}},{key:"_all",value:function _all(t,e){var n=[];for(;t;)t.leaf?e.push.apply(e,_toConsumableArray(t.children)):n.push.apply(n,_toConsumableArray(t.children)),t=n.pop();return e;}},{key:"_build",value:function _build(t,e,n,i){var s=n-e+1;var o=this._maxEntries,a;if(s<=o)return a=Io(t.slice(e,n+1)),So(a,this.toBBox),a;i||(i=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,i-1))),a=Io([]),a.leaf=!1,a.height=i;var u=Math.ceil(s/o),d=u*Math.ceil(Math.sqrt(o));S1(t,e,n,d,this.compareMinX);for(var v=e;v<=n;v+=d){var p=Math.min(v+d-1,n);S1(t,v,p,u,this.compareMinY);for(var w=v;w<=p;w+=u){var A=Math.min(w+u-1,p);a.children.push(this._build(t,w,A,i-1));}}return So(a,this.toBBox),a;}},{key:"_chooseSubtree",value:function _chooseSubtree(t,e,n,i){for(;i.push(e),!(e.leaf||i.length-1===n);){var s=1/0,o=1/0,a=void 0;for(var u=0;u<e.children.length;u++){var d=e.children[u],v=Pd(d),p=eAt(t,d)-v;p<o?(o=p,s=v<s?v:s,a=d):p===o&&v<s&&(s=v,a=d);}e=a||e.children[0];}return e;}},{key:"_insert",value:function _insert(t,e,n){var i=n?t:this.toBBox(t),s=[],o=this._chooseSubtree(i,this.data,e,s);for(o.children.push(t),Da(o,i);e>=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(i,s,e);}// split overflowed node into two
|
|
486
|
+
},{key:"_split",value:function _split(t,e){var n=t[e],i=n.children.length,s=this._minEntries;this._chooseSplitAxis(n,s,i);var o=this._chooseSplitIndex(n,s,i),a=Io(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,So(n,this.toBBox),So(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a);}},{key:"_splitRoot",value:function _splitRoot(t,e){this.data=Io([t,e]),this.data.height=t.height+1,this.data.leaf=!1,So(this.data,this.toBBox);}},{key:"_chooseSplitIndex",value:function _chooseSplitIndex(t,e,n){var i,s=1/0,o=1/0;for(var a=e;a<=n-e;a++){var u=Oa(t,0,a,this.toBBox),d=Oa(t,a,n,this.toBBox),v=rAt(u,d),p=Pd(u)+Pd(d);v<s?(s=v,i=a,o=p<o?p:o):v===s&&p<o&&(o=p,i=a);}return i||n-e;}// sorts node children by the best axis for split
|
|
487
|
+
},{key:"_chooseSplitAxis",value:function _chooseSplitAxis(t,e,n){var i=t.leaf?this.compareMinX:_Pt,s=t.leaf?this.compareMinY:tAt,o=this._allDistMargin(t,e,n,i),a=this._allDistMargin(t,e,n,s);o<a&&t.children.sort(i);}// total margin of all possible split distributions where each node is at least m full
|
|
488
|
+
},{key:"_allDistMargin",value:function _allDistMargin(t,e,n,i){t.children.sort(i);var s=this.toBBox,o=Oa(t,0,e,s),a=Oa(t,n-e,n,s);var u=Yc(o)+Yc(a);for(var d=e;d<n-e;d++){var v=t.children[d];Da(o,t.leaf?s(v):v),u+=Yc(o);}for(var _d6=n-e-1;_d6>=e;_d6--){var _v9=t.children[_d6];Da(a,t.leaf?s(_v9):_v9),u+=Yc(a);}return u;}},{key:"_adjustParentBBoxes",value:function _adjustParentBBoxes(t,e,n){for(var i=n;i>=0;i--)Da(e[i],t);}},{key:"_condense",value:function _condense(t){for(var e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():So(t[e],this.toBBox);}}]);}();function JPt(r,t,e){if(!e)return t.indexOf(r);for(var n=0;n<t.length;n++)if(e(r,t[n]))return n;return-1;}function So(r,t){Oa(r,0,r.children.length,t,r);}function Oa(r,t,e,n,i){i||(i=Io(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var s=t;s<e;s++){var o=r.children[s];Da(i,r.leaf?n(o):o);}return i;}function Da(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r;}function _Pt(r,t){return r.minX-t.minX;}function tAt(r,t){return r.minY-t.minY;}function Pd(r){return(r.maxX-r.minX)*(r.maxY-r.minY);}function Yc(r){return r.maxX-r.minX+(r.maxY-r.minY);}function eAt(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY));}function rAt(r,t){var e=Math.max(r.minX,t.minX),n=Math.max(r.minY,t.minY),i=Math.min(r.maxX,t.maxX),s=Math.min(r.maxY,t.maxY);return Math.max(0,i-e)*Math.max(0,s-n);}function Ad(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY;}function jc(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY;}function Io(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};}function S1(r,t,e,n,i){var s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=n)continue;var o=t+Math.ceil((e-t)/n/2)*n;JS(r,o,t,e,i),s.push(t,o,o,e);}}var nAt=/*#__PURE__*/function(){function nAt(t,e){_classCallCheck(this,nAt);wt(this,"viewId");wt(this,"scene");wt(this,"fullLayer");wt(this,"curNodeMap");wt(this,"targetNodeMap",[]);wt(this,"highLevelIds");wt(this,"canClearUids");wt(this,"localUid");wt(this,"spatialIndex",new QPt());wt(this,"spatialEntries",/* @__PURE__ */new Map());wt(this,"verifySpatialIndex",!1);this.viewId=t,this.scene=e,this.curNodeMap=new w1();}return _createClass(nAt,[{key:"init",value:function init(t){this.fullLayer=t;}},{key:"get",value:function get(t){return this.curNodeMap.get(t);}},{key:"setLocalUid",value:function setLocalUid(t){this.localUid=t;}},{key:"getLocalUid",value:function getLocalUid(){return this.localUid;}},{key:"setSpatialIndexVerification",value:function setSpatialIndexVerification(t){this.verifySpatialIndex=t;}},{key:"setCanClearUids",value:function setCanClearUids(t){this.canClearUids=t;}},{key:"getCanClearUids",value:function getCanClearUids(){return this.canClearUids;}},{key:"getCanEraserNodes",value:function getCanEraserNodes(t,e){var n=/* @__PURE__ */new Map();var _iterator65=_createForOfIteratorHelper(t.entries()),_step65;try{for(_iterator65.s();!(_step65=_iterator65.n()).done;){var _step65$value=_slicedToArray(_step65.value,2),i=_step65$value[0],s=_step65$value[1];s.toolsType!==It.BackgroundSVG&&(s.toolsType===It.Image&&s.opt.type===_u.Image&&(s.opt.locked||e&&e.disableEraseImage)||s.toolsType===It.Text&&(s.opt.workState===te.Doing||s.opt.workState===te.Start||e&&e.disableEraseText)||this.isCanClearWorkId(i)&&n.set(i,s));}}catch(err){_iterator65.e(err);}finally{_iterator65.f();}return n;}},{key:"getNodesByType",value:function getNodesByType(t){var e=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(n,i){n.toolsType===t&&e.set(i,n);}),e;}},{key:"gethasEraserNodes",value:function gethasEraserNodes(){var t=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(e,n){var i;((i=e.opt.eraserlines)!=null&&i.length||e.opt.eraserFaces)&&t.set(n,e);}),t;}},{key:"hasRenderNodes",value:function hasRenderNodes(){return!0;}},{key:"has",value:function has(t){return this.curNodeMap.has(t);}},{key:"setInfo",value:function setInfo(t,e){var n=this.curNodeMap.get(t)||{name:t,rect:e.rect};e.rect&&(n.rect=br(e.rect)),e.op&&jPt(e.op)&&(n.op=br(e.op)),e.canRotate&&(n.canRotate=e.canRotate),e.scaleType&&(n.scaleType=e.scaleType),e.opt&&(n.opt=br(e.opt)),e.toolsType&&(n.toolsType=e.toolsType),e.centerPos&&(n.centerPos=br(e.centerPos)),bs(e.isSelected)&&(n.isSelected=e.isSelected),n.rect?(this.curNodeMap.set(t,n),this.updateSpatialEntry(t,n.rect)):this.delete(t);}},{key:"selected",value:function selected(t){this.setInfo(t,{isSelected:!0});}},{key:"unSelected",value:function unSelected(t){this.setInfo(t,{isSelected:!1});}},{key:"delete",value:function _delete(t){this.curNodeMap.delete(t);var e=this.spatialEntries.get(t);e&&(this.spatialIndex.remove(e),this.spatialEntries.delete(t));}},{key:"clear",value:function clear(){this.curNodeMap.clear(),this.spatialIndex.clear(),this.spatialEntries.clear(),this.targetNodeMap.length=0;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var i=this.spatialIndex.search(this.toSpatialBox(t)).map(function(u){return u.key;});var s=i;if(this.verifySpatialIndex){var u=this.getLinearIntersectKeys(t),d=new Set(i);(u.length!==i.length||u.some(function(v){return!d.has(v);}))&&(console.warn("[VNodeManager] spatial index mismatch in ".concat(this.viewId,"; using linear result")),s=u);}var o;var a=/* @__PURE__ */new Map();var _iterator66=_createForOfIteratorHelper(s),_step66;try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){var _u6=_step66.value;var _d7=this.curNodeMap.get(_u6);!_d7||!Su(t,_d7.rect)||e&&_d7.toolsType===It.Image&&_d7.opt.locked||n&&_d7.toolsType===It.Text&&(_d7.opt.workState===te.Doing||_d7.opt.workState===te.Start)||(o=Jt(o,_d7.rect),a.set(_u6,_d7));}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}return{rectRange:o,nodeRange:a};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(t,e){var n=VS(e.toolsType);return this.fullLayer&&(n==null?void 0:n.getRectFromLayer(this.fullLayer,t));}},{key:"updateNodeRect",value:function updateNodeRect(t){var e=this.curNodeMap.get(t);if(e){var n=this.getNodeRectFormShape(t,e);if(!n){this.delete(t);return;}e.rect=n,this.curNodeMap.set(t,e),this.updateSpatialEntry(t,n);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(t){this.highLevelIds=t;var _iterator67=_createForOfIteratorHelper(this.highLevelIds.keys()),_step67;try{for(_iterator67.s();!(_step67=_iterator67.n()).done;){var e=_step67.value;this.updateNodeRect(e);}}catch(err){_iterator67.e(err);}finally{_iterator67.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var t;var _iterator68=_createForOfIteratorHelper(this.curNodeMap.keys()),_step68;try{for(_iterator68.s();!(_step68=_iterator68.n()).done;){var e=_step68.value;(t=this.highLevelIds)!=null&&t.has(e)||this.updateNodeRect(e);}}catch(err){_iterator68.e(err);}finally{_iterator68.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"updateSpatialEntry",value:function updateSpatialEntry(t,e){var n=this.spatialEntries.get(t);n&&this.spatialIndex.remove(n);var i=_objectSpread({key:t},this.toSpatialBox(e));this.spatialEntries.set(t,i),this.spatialIndex.insert(i);}},{key:"toSpatialBox",value:function toSpatialBox(t){return{minX:t.x,minY:t.y,maxX:t.x+t.w,maxY:t.y+t.h};}},{key:"getLinearIntersectKeys",value:function getLinearIntersectKeys(t){var e=[];var _iterator69=_createForOfIteratorHelper(this.curNodeMap.entries()),_step69;try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){var _step69$value=_slicedToArray(_step69.value,2),n=_step69$value[0],i=_step69$value[1];Su(t,i.rect)&&e.push(n);}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}return e;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(t){var e=new w1();var _iterator70=_createForOfIteratorHelper(t),_step70;try{for(_iterator70.s();!(_step70=_iterator70.n()).done;){var n=_step70.value;var i=this.curNodeMap.get(n);i&&e.set(n,br(i));}}catch(err){_iterator70.e(err);}finally{_iterator70.f();}return this.targetNodeMap.push(br(e)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){var t=this.curNodeMap.keys();return this.setTargetAssignKeys(Array.from(t));}},{key:"getLastTarget",value:function getLastTarget(){return this.targetNodeMap[this.targetNodeMap.length-1];}},{key:"deleteLastTarget",value:function deleteLastTarget(){this.targetNodeMap.length&&(this.targetNodeMap.length=this.targetNodeMap.length-1);}},{key:"getTarget",value:function getTarget(t){return this.targetNodeMap[t];}},{key:"deleteTarget",value:function deleteTarget(t){this.targetNodeMap.length=t;}},{key:"clearTarget",value:function clearTarget(){this.targetNodeMap.length=0;}},{key:"isLocalWorkId",value:function isLocalWorkId(t){return t.split(Oo).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(t){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if(lTt(this.canClearUids)){var e=t.split(Oo);if(e.length===1)return this.canClearUids.has("localSelf")||this.localUid&&this.canClearUids.has(this.localUid);if(e.length===2)return this.canClearUids.has(e[0]);}return!1;}}]);}();var iAt=function iAt(r,t,e,n){var i=new URL(r);return i.searchParams.set("width",t.toString()),i.searchParams.set("height",e.toString()),n&&i.searchParams.set("color",n),i.toString();};var sAt=/*#__PURE__*/function(){function sAt(){_classCallCheck(this,sAt);wt(this,"timer");}return _createClass(sAt,[{key:"pending",get:function get(){return this.timer!==void 0;}},{key:"schedule",value:function schedule(t,e){var _this66=this;this.timer===void 0&&(this.timer=setTimeout(function(){_this66.timer=void 0,t();},Math.max(0,e)));}},{key:"cancel",value:function cancel(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0);}}]);}();var oAt=30,aAt=1e3/oAt;function lAt(r){return Math.min(Math.max(0,r),aAt);}var bd=function bd(){return(typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&typeof performance.now=="function"?performance.now():Date.now();};var cAt=/*#__PURE__*/function(){function cAt(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1e3/30;_classCallCheck(this,cAt);wt(this,"timer");wt(this,"pending");wt(this,"resolvePending");wt(this,"activeWorkId");wt(this,"generation",0);wt(this,"lastReleaseTime",0);this.interval=t;}return _createClass(cAt,[{key:"wait",value:function wait(t){var _this67=this;if(this.activeWorkId!==t&&(this.finish(),this.activeWorkId=t),this.pending)return this.pending;var e=this.generation,n=Math.max(0,this.lastReleaseTime+this.interval-bd());return n===0?(this.lastReleaseTime=bd(),Promise.resolve(!0)):(this.pending=new Promise(function(i){_this67.resolvePending=i,_this67.timer=setTimeout(function(){if(_this67.timer=void 0,_this67.pending=void 0,_this67.resolvePending=void 0,e!==_this67.generation||_this67.activeWorkId!==t){i(!1);return;}_this67.lastReleaseTime=bd(),i(!0);},n);}),this.pending);}},{key:"finish",value:function finish(t){if(t!==void 0&&this.activeWorkId!==t)return;this.generation++,this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0,this.pending=void 0;var e=this.resolvePending;this.resolvePending=void 0,this.activeWorkId=void 0,this.lastReleaseTime=0,e==null||e(!1);}},{key:"cancel",value:function cancel(){this.finish();}}]);}();var _S=/*#__PURE__*/function(){function _S(t,e,n){_classCallCheck(this,_S);wt(this,"viewId");wt(this,"type");wt(this,"scene");wt(this,"fullLayer");wt(this,"vNodes");wt(this,"dpr");wt(this,"contextType");wt(this,"opt");wt(this,"cameraOpt");wt(this,"isSafari",!1);wt(this,"combinePostMsg",/* @__PURE__ */new Set());wt(this,"workerTaskId");wt(this,"protectedTask");// protected hasPriorityDraw: boolean = true;
|
|
489
|
+
wt(this,"delayPostDoneResolve");wt(this,"cacheImages",/* @__PURE__ */new Map());wt(this,"imageResolveMap",/* @__PURE__ */new Map());wt(this,"taskUpdateCameraId");wt(this,"taskUpdateCameraResolve");wt(this,"debounceUpdateCameraId");var i,s;if(this.viewId=t,this.type=n,this.opt=e,this.dpr=e.dpr,this.contextType=this.getSupportContextType(n,(i=e==null?void 0:e.offscreenCanvasOpt)==null?void 0:i.contextType),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");try{this.scene=this.createScene(e),this.createRenderLayer(this.scene,e);}catch(o){if(this.contextType!=="2d")this.contextType="2d",(s=this.scene)==null||s.disconnect(),this.scene=this.createScene(e),this.createRenderLayer(this.scene,e);else throw o;}this.vNodes=new nAt(t,this.scene);}return _createClass(_S,[{key:"createRenderLayer",value:function createRenderLayer(t,e){var n=zr.bufferSize.full,i=zr.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",t,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:this.viewId===Ds?n:i*2}));}},{key:"updateDpr",value:function(){var _updateDpr=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(t){return _regenerator().w(function(_context20){while(1)switch(_context20.n){case 0:this.dpr=t,this.scene.displayRatio=t;case 1:return _context20.a(2);}},_callee19,this);}));function updateDpr(_x33){return _updateDpr.apply(this,arguments);}return updateDpr;}()},{key:"getCachedImages",value:function getCachedImages(t){var e;return(e=this.cacheImages.get(t))==null?void 0:e.imageBitmap;}},{key:"getCachedImagesByWorkId",value:function getCachedImagesByWorkId(t){var _iterator71=_createForOfIteratorHelper(this.cacheImages.entries()),_step71;try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){var _step71$value=_slicedToArray(_step71.value,2),e=_step71$value[0],n=_step71$value[1];if(e===t&&n.imageBitmap)return n.imageBitmap;}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}}},{key:"deleteCachedImagesByWorkId",value:function deleteCachedImagesByWorkId(t,e){var _iterator72=_createForOfIteratorHelper(this.cacheImages.entries()),_step72;try{for(_iterator72.s();!(_step72=_iterator72.n()).done;){var _step72$value=_slicedToArray(_step72.value,2),n=_step72$value[0],i=_step72$value[1];e&&n===e||i.workId===t&&(i.imageBitmap.close(),this.cacheImages.delete(n));}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}}},{key:"clearCacheImages",value:function clearCacheImages(){this.cacheImages.forEach(function(t){return t.imageBitmap.close();}),this.cacheImages.clear();}},{key:"clearImageResolveMap",value:function clearImageResolveMap(){this.imageResolveMap.forEach(function(_ref66){var t=_ref66.timer;t&&clearTimeout(t);}),this.imageResolveMap.clear();}},{key:"setIsSafari",value:function setIsSafari(t){this.isSafari=t;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(t){var e,n,i,s,o,a,u,d,_d8,v,p,w,_t16,_t17;return _regenerator().w(function(_context21){while(1)switch(_context21.n){case 0:e=t.msgType,n=t.toolsType,i=t.opt,s=t.imageSrc,o=t.imageBitmap,a=t.workId,u=t.dpr;_t16=e;_context21.n=_t16===xt.UpdateDpr?1:_t16===xt.UpdateCamera?3:_t16===xt.Destroy?5:_t16===xt.Clear?6:_t16===xt.UpdateTools?8:_t16===xt.GetImageBitMap?9:10;break;case 1:_t17=Ze(u);if(!_t17){_context21.n=2;break;}_context21.n=2;return this.updateDpr(u);case 2:return _context21.a(3,10);case 3:_context21.n=4;return this.updateCamera(t);case 4:return _context21.a(3,10);case 5:this.destroy();return _context21.a(3,10);case 6:_context21.n=7;return this.clearAll();case 7:return _context21.a(3,10);case 8:if(n&&i){d={toolsType:n,toolsOpt:i,combineUnitTime:t.combineUnitTime,maxCombineEraserTime:t.maxCombineEraserTime};this.localWork.setToolsOpt(d);}return _context21.a(3,10);case 9:if(s&&o&&a){_d8=a.toString();this.cacheImages.set(s,{imageBitmap:o,workId:_d8});v=this.imageResolveMap.get(s);if(v){p=v.resolve,w=v.timer;w&&clearTimeout(w),p&&p(s);}this.deleteCachedImagesByWorkId(_d8,s);}return _context21.a(3,10);case 10:return _context21.a(2);}},_callee20,this);}));function on(_x34){return _on.apply(this,arguments);}return on;}()},{key:"getIconSize",value:function getIconSize(t,e,n){var i=t*n,s=e*n;return i<=50||s<=50?[50,50]:i<=100||s<=100?[100,100]:i<=200||s<=200?[200,200]:i<=400||s<=400?[400,400]:i<=800||s<=800?[800,800]:[1600,1600];}},{key:"loadImageBitMap",value:function(){var _loadImageBitMap=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(t){var _this68=this;var e,n,i,s,o,a,u,d,v,p,w,_this$getIconSize,_this$getIconSize2,L,G,_L18,_L19,E;return _regenerator().w(function(_context22){while(1)switch(_context22.n){case 0:e=t.toolsType,n=t.opt,i=t.workId,s=t.isSubWorker;if(!(e===It.Image&&n&&i)){_context22.n=5;break;}o=i.toString(),a=n.src,u=n.type,d=n.width,v=n.height,p=n.strokeColor;if(!(!a||!u||!d||!v)){_context22.n=1;break;}return _context22.a(2);case 1:w=a;if(u===_u.Iconify){_this$getIconSize=this.getIconSize(d,v,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),L=_this$getIconSize2[0],G=_this$getIconSize2[1];w=iAt(a,L,G,p);}if(!this.cacheImages.has(w)){_context22.n=2;break;}_L18=this.getCachedImages(w);if(!_L18){_context22.n=2;break;}return _context22.a(2,_L18);case 2:if(!this.imageResolveMap.has(w)){_context22.n=3;break;}_L19=this.getCachedImagesByWorkId(o);if(!_L19){_context22.n=3;break;}return _context22.a(2,_L19);case 3:_context22.n=4;return new Promise(function(L){var G=_this68.imageResolveMap.get(w)||{resolve:void 0,timer:void 0};G.timer&&clearTimeout(G.timer),G.resolve=L,G.timer=setTimeout(function(){var z=_this68.imageResolveMap.get(w);z!=null&&z.resolve&&z.resolve(w);},5e3),_this68.imageResolveMap.set(w,G),_this68._post({sp:[{imageSrc:w,workId:o,viewId:_this68.viewId,isgl:!!_this68.fullLayer.parent.gl,isSubWorker:s,type:xt.GetImageBitMap}]});});case 4:E=_context22.v;return _context22.a(2,(this.imageResolveMap.delete(E),this.getCachedImages(w)));case 5:return _context22.a(2);}},_callee21,this);}));function loadImageBitMap(_x35){return _loadImageBitMap.apply(this,arguments);}return loadImageBitMap;}()},{key:"createLocalWork",value:function createLocalWork(t){var e=t.workId,n=t.opt,i=t.toolsType;e&&n&&(!this.localWork.getToolsOpt()&&i&&this.setToolsOpt({toolsType:i,toolsOpt:n}),this.setWorkOpt({workId:e,toolsOpt:n}));}},{key:"updateScene",value:function updateScene(t,e,n){t.attr(_objectSpread({},e));var i=e.width,s=e.height;t.container.width=i,t.container.height=s,t.width=i,t.height=s,this.updateLayer({width:i,height:s},n);}},{key:"updateLayer",value:function updateLayer(t,e){var n=t.width,i=t.height,s=e||this.fullLayer;s&&(s.parent.setAttribute("width",n),s.parent.setAttribute("height",i),s.setAttribute("size",[n,i]),s.setAttribute("pos",[n*0.5,i*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(t,e){var n=new OffscreenCanvas(100,100);var i=["2d"];t===Tu.Full&&this.viewId===Ds&&(i=["webgl2","webgl","2d"],e&&i.unshift(e));for(var _i9=0,_i8=i;_i9<_i8.length;_i9++){var s=_i8[_i9];try{if(n.getContext(s))return s;}catch(o){throw o;}}}},{key:"createScene",value:function createScene(t){var e=t.offscreenCanvasOpt,n=e.width,i=e.height,s=new OffscreenCanvas(n,i);e.contextType&&delete e.contextType;var o=new Jp(_objectSpread(_objectSpread({container:s,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},e),{},{contextType:this.contextType,id:this.viewId}));return o.setAttribute("id",this.viewId),o;}},{key:"createLayer",value:function createLayer(t,e,n,i){var s="offscreen-".concat(t),o=n.width,a=n.height;i&&(n.offscreen=!0,n.canvas=i);var u=e.layer(s,n),d=new ar({anchor:[0.5,0.5],pos:[o*0.5,a*0.5],size:[o,a],name:"viewport",id:t});return u.append(d),d;}},{key:"clearAll",value:function(){var _clearAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22(){var t,e;return _regenerator().w(function(_context23){while(1)switch(_context23.n){case 0:this.fullLayer&&(this.fullLayer.parent.children.forEach(function(n){n.name!=="viewport"&&n.remove();}),qr(this.fullLayer,this.fullLayer.parent)),this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0,(t=this.taskUpdateCameraResolve)==null||t.call(this,!1),this.taskUpdateCameraResolve=void 0),this.debounceUpdateCameraId&&(clearTimeout(this.debounceUpdateCameraId),this.debounceUpdateCameraId=void 0),this.clearCacheImages(),this.clearImageResolveMap(),this.localWork.destroy(),(e=this.serviceWork)==null||e.destroy();case 1:return _context23.a(2);}},_callee22,this);}));function clearAll(){return _clearAll.apply(this,arguments);}return clearAll;}()},{key:"setToolsOpt",value:function setToolsOpt(t){this.localWork.setToolsOpt(t);}},{key:"setWorkOpt",value:function setWorkOpt(t){var e=t.workId,n=t.toolsOpt;e&&n&&this.localWork.setWorkOptions(e.toString(),n);}},{key:"destroy",value:function destroy(){var t;this.vNodes.clear(),this.fullLayer.remove(),_Ur(this.fullLayer,this.fullLayer.parent),this.clearCacheImages(),this.clearImageResolveMap(),this.scene.remove(),this.localWork.destroy(),(t=this.serviceWork)==null||t.destroy();}},{key:"post",value:function(){var _post=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(t){return _regenerator().w(function(_context24){while(1)switch(_context24.n){case 0:this.combinePostMsg.add(t);_context24.n=1;return this.runBatchPostData();case 1:return _context24.a(2);}},_callee23,this);}));function post(_x36){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24(){var _this69=this;var _t18,_t19;return _regenerator().w(function(_context25){while(1)switch(_context25.n){case 0:this.workerTaskId||(this.workerTaskId=setTimeout(function(){_this69.workerTaskId=void 0,_this69.combinePost();},16));_t18=this.type===Tu.Full&&!this.delayPostDoneResolve;if(!_t18){_context25.n=2;break;}_context25.n=1;return new Promise(function(e){_this69.delayPostDoneResolve=e;});case 1:_t18=_context25.v;case 2:_t19=_t18;if(!_t19){_context25.n=3;break;}this.delayPostDoneResolve=void 0;case 3:return _context25.a(2);}},_callee24,this);}));function runBatchPostData(){return _runBatchPostData.apply(this,arguments);}return runBatchPostData;}()},{key:"combinePostData",value:function combinePostData(){var u,d;this.workerTaskId=void 0;var t=[],e=[];var n,i,s,o;var a=/* @__PURE__ */new Set();var _iterator73=_createForOfIteratorHelper(this.combinePostMsg.values()),_step73;try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){var v=_step73.value;if((u=v.render)!=null&&u.length){var _iterator74=_createForOfIteratorHelper(v.render),_step74;try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){var p=_step74.value;var w=!1;if(p.workId&&a.add(p.workId),p.isClearAll&&(p.rect=this.getSceneRect(),p.isClear=!0,delete p.isClearAll),p.drawCanvas){var A=this.getLayer(p.drawCanvas);if(!A||!(A.parent instanceof Zi))continue;if(A.parent.render(),p.isDrawAll){var M=this.getSceneRect();p.rect=M,delete p.isDrawAll;}}var _iterator75=_createForOfIteratorHelper(t),_step75;try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){var _A3=_step75.value;if(p.viewId===_A3.viewId){p.isClear&&_A3.clearCanvas&&_A3.isClear&&_A3.clearCanvas===p.clearCanvas&&(_A3.rect=Jt(_A3.rect,p.rect),w=!0),_A3.drawCanvas&&_A3.drawCanvas===p.drawCanvas&&(_A3.rect=Jt(_A3.rect,p.rect),w=!0);continue;}}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}w||(p.isClear&&!p.drawCanvas?t.unshift(p):t.push(p));}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}}if((d=v.sp)!=null&&d.length){var _iterator76=_createForOfIteratorHelper(v.sp),_step76;try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){var _p4=_step76.value;var _w3=!1;var _iterator77=_createForOfIteratorHelper(e),_step77;try{for(_iterator77.s();!(_step77=_iterator77.n()).done;){var _A4=_step77.value;if(qn(_p4,_A4)){_w3=!0;break;}}}catch(err){_iterator77.e(err);}finally{_iterator77.f();}_w3||e.push(_p4);}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}}Ze(v.fullWorkerDrawCount)&&(n=v.fullWorkerDrawCount),Ze(v.subWorkerDrawCount)&&(i=v.subWorkerDrawCount),Ze(v.consumeCount)&&(s=v.consumeCount,o=v.consumeWorkId);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}return this.combinePostMsg.clear(),{render:t,sp:e,fullWorkerDrawCount:n,subWorkerDrawCount:i,consumeCount:s,consumeWorkId:o,workIds:a,viewId:this.viewId};}},{key:"getSceneRect",value:function getSceneRect(){var _this$scene=this.scene,t=_this$scene.width,e=_this$scene.height;return{x:0,y:0,w:Math.floor(t),h:Math.floor(e)};}}]);}();var x0=/*#__PURE__*/function(){function x0(t){_classCallCheck(this,x0);wt(this,"viewId");wt(this,"vNodes");wt(this,"thread");wt(this,"fullLayer");wt(this,"drawLayer");wt(this,"_post");wt(this,"tmpOpt");wt(this,"workShapes",/* @__PURE__ */new Map());wt(this,"drawCount",0);wt(this,"consumeCount",0);wt(this,"syncUnitTime",zr.syncOpt.interval);wt(this,"combineUnitTime",zr.bezier.combineUnitTime);wt(this,"maxCombineEraserTime",zr.pencilEraser.maxCombineTime);wt(this,"eraserBatchScheduler",new sAt());wt(this,"drawAckBackpressure",new cAt());this.thread=t.thread,this.viewId=t.viewId,this.vNodes=t.vNodes,this.fullLayer=t.fullLayer,this.drawLayer=t.drawLayer,this._post=this.thread.post.bind(t.thread);}return _createClass(x0,[{key:"eraserBatchDelay",get:function get(){return lAt(this.maxCombineEraserTime);}},{key:"setmaxCombineEraserTime",value:function setmaxCombineEraserTime(t){this.maxCombineEraserTime=t;}},{key:"setCombineUnitTime",value:function setCombineUnitTime(t){this.combineUnitTime=t;}},{key:"setSyncUnitTime",value:function setSyncUnitTime(t){this.syncUnitTime=t;}},{key:"destroy",value:function destroy(){this.eraserBatchScheduler.cancel(),this.drawAckBackpressure.cancel(),this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{key:"getWorkShape",value:function getWorkShape(t){return this.workShapes.get(t);}},{key:"createWorkShape",value:function createWorkShape(t,e){if(t&&this.tmpOpt){var n={toolsType:this.tmpOpt.toolsType,toolsOpt:e||this.tmpOpt.toolsOpt},i=this.createWorkShapeNode(_objectSpread(_objectSpread({},n),{},{workId:t}));i&&this.workShapes.set(t,i);}}},{key:"setWorkOptions",value:function setWorkOptions(t,e){var n=this.getWorkShape(t);n||this.createWorkShape(t,e),n==null||n.setWorkOptions(e);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(t){var e;return cf(_objectSpread(_objectSpread({},t),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(e=this.thread)==null?void 0:e.serviceWork);}},{key:"setToolsOpt",value:function setToolsOpt(t){var e,n,i;((e=this.tmpOpt)==null?void 0:e.toolsType)!==t.toolsType&&(n=this.tmpOpt)!=null&&n.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=t,(i=t.toolsOpt)!=null&&i.syncUnitTime&&(this.syncUnitTime=t.toolsOpt.syncUnitTime),t.combineUnitTime&&(this.combineUnitTime=t.combineUnitTime),t.maxCombineEraserTime&&(this.maxCombineEraserTime=t.maxCombineEraserTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(t){var e;(e=this.getWorkShape(t))==null||e.clearTmpPoints(),this.workShapes.delete(t);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.eraserBatchScheduler.cancel(),this.drawAckBackpressure.cancel(),this.workShapes.forEach(function(t){return t.clearTmpPoints();}),this.workShapes.clear();}},{key:"setFullWork",value:function setFullWork(t){var e=t.workId,n=t.opt,i=t.toolsType;if(e&&n&&i){var s=e.toString();var o;return e&&this.workShapes.has(s)?(o=this.workShapes.get(s),(o==null?void 0:o.toolsType)!==i?(o==null||o.clearTmpPoints(),this.workShapes.delete(s),o=void 0):o==null||o.setWorkOptions(n)):o=this.createWorkShapeNode({toolsOpt:n,toolsType:i,workId:s}),o||(o=this.createWorkShapeNode({toolsOpt:n,toolsType:i,workId:s})),o?(this.workShapes.set(s,o),o):void 0;}}}]);}();function uAt(r){return r;}var tI=uAt;function fAt(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2]);}return r.apply(t,e);}var hAt=fAt,dAt=hAt,I1=Math.max;function pAt(r,t,e){return t=I1(t===void 0?r.length-1:t,0),function(){for(var n=arguments,i=-1,s=I1(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=e(o),dAt(r,this,a);};}var vAt=pAt;function gAt(r){return function(){return r;};}var mAt=gAt,yAt=mAt,T1=q2,wAt=tI,SAt=T1?function(r,t){return T1(r,"toString",{configurable:!0,enumerable:!1,value:yAt(t),writable:!0});}:wAt,IAt=SAt,TAt=800,xAt=16,CAt=Date.now;function PAt(r){var t=0,e=0;return function(){var n=CAt(),i=xAt-(n-e);if(e=n,i>0){if(++t>=TAt)return arguments[0];}else t=0;return r.apply(void 0,arguments);};}var AAt=PAt,bAt=IAt,MAt=AAt,EAt=MAt(bAt),LAt=EAt,OAt=tI,DAt=vAt,RAt=LAt;function NAt(r,t){return RAt(DAt(r,t,OAt),r+"");}var BAt=NAt;function kAt(r,t,e,n){for(var i=r.length,s=e+(n?1:-1);n?s--:++s<i;)if(t(r[s],s,r))return s;return-1;}var FAt=kAt;function WAt(r){return r!==r;}var UAt=WAt;function zAt(r,t,e){for(var n=e-1,i=r.length;++n<i;)if(r[n]===t)return n;return-1;}var $At=zAt,YAt=FAt,jAt=UAt,XAt=$At;function GAt(r,t,e){return t===t?XAt(r,t,e):YAt(r,jAt,e);}var HAt=GAt,VAt=HAt;function ZAt(r,t){var e=r==null?0:r.length;return!!e&&VAt(r,t,0)>-1;}var eI=ZAt;function qAt(r,t,e){for(var n=-1,i=r==null?0:r.length;++n<i;)if(e(t,r[n]))return!0;return!1;}var rI=qAt;function KAt(r,t){for(var e=-1,n=r==null?0:r.length,i=Array(n);++e<n;)i[e]=t(r[e],e,r);return i;}var QAt=KAt,JAt=m0,_At=eI,tbt=rI,ebt=QAt,rbt=of,nbt=y0,ibt=200;function sbt(r,t,e,n){var i=-1,s=_At,o=!0,a=r.length,u=[],d=t.length;if(!a)return u;e&&(t=ebt(t,rbt(e))),n?(s=tbt,o=!1):t.length>=ibt&&(s=nbt,o=!1,t=new JAt(t));t:for(;++i<a;){var v=r[i],p=e==null?v:e(v);if(v=n||v!==0?v:0,o&&p===p){for(var w=d;w--;)if(t[w]===p)continue t;u.push(v);}else s(t,p,n)||u.push(v);}return u;}var obt=sbt,x1=cl,abt=_2,lbt=fl,C1=x1?x1.isConcatSpreadable:void 0;function cbt(r){return lbt(r)||abt(r)||!!(C1&&r&&r[C1]);}var ubt=cbt,fbt=h0,hbt=ubt;function nI(r,t,e,n,i){var s=-1,o=r.length;for(e||(e=hbt),i||(i=[]);++s<o;){var a=r[s];t>0&&e(a)?t>1?nI(a,t-1,e,n,i):fbt(i,a):n||(i[i.length]=a);}return i;}var dbt=nI;function pbt(){}var vbt=pbt,Md=uS,gbt=vbt,mbt=w0,ybt=1/0,wbt=Md&&1/mbt(new Md([,-0]))[1]==ybt?function(r){return new Md(r);}:gbt,Sbt=wbt,Ibt=m0,Tbt=eI,xbt=rI,Cbt=y0,Pbt=Sbt,Abt=w0,bbt=200;function Mbt(r,t,e){var n=-1,i=Tbt,s=r.length,o=!0,a=[],u=a;if(e)o=!1,i=xbt;else if(s>=bbt){var d=t?null:Pbt(r);if(d)return Abt(d);o=!1,i=Cbt,u=new Ibt();}else u=t?[]:a;t:for(;++n<s;){var v=r[n],p=t?t(v):v;if(v=e||v!==0?v:0,o&&p===p){for(var w=u.length;w--;)if(u[w]===p)continue t;t&&u.push(p),a.push(v);}else i(u,p,e)||(u!==a&&u.push(p),a.push(v));}return a;}var Ebt=Mbt,Lbt=obt,Obt=dbt,P1=Ebt;function Dbt(r,t,e){var n=r.length;if(n<2)return n?P1(r[0]):[];for(var i=-1,s=Array(n);++i<n;)for(var o=r[i],a=-1;++a<n;)a!=i&&(s[i]=Lbt(s[i]||o,r[a],t,e));return P1(Obt(s,1),t,e);}var Rbt=Dbt,Nbt=l0,Bbt=Pi;function kbt(r){return Bbt(r)&&Nbt(r);}var Fbt=kbt,Wbt=iS,Ubt=BAt,zbt=Rbt,$bt=Fbt,Ybt=Ubt(function(r){return zbt(Wbt(r,$bt));}),jbt=Ybt;var Xbt=/* @__PURE__ */zn(jbt);var iI=/*#__PURE__*/function(_x37){function iI(e){var _this70;_classCallCheck(this,iI);_this70=_callSuper(this,iI,[e]);wt(_this70,"_type","full");wt(_this70,"combineTimerId");wt(_this70,"combineDrawResolve");wt(_this70,"combineDrawActiveId");wt(_this70,"drawWorkActiveId");wt(_this70,"effectSelectNodeData",/* @__PURE__ */new Set());return _this70;}_inherits(iI,_x37);return _createClass(iI,[{key:"loadImageBitMap",value:function(){var _loadImageBitMap2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25(e){return _regenerator().w(function(_context26){while(1)switch(_context26.n){case 0:_context26.n=1;return this.thread.loadImageBitMap(e);case 1:return _context26.a(2,_context26.v);}},_callee25,this);}));function loadImageBitMap(_x38){return _loadImageBitMap2.apply(this,arguments);}return loadImageBitMap;}()},{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26(e,n){var _this71=this;var i,s,o,a,u,d,v,p,A,w,_t20,_t21,_t22,_t23,_t24;return _regenerator().w(function(_context27){while(1)switch(_context27.n){case 0:i=e.op,s=e.workId,o=e.scenePath,a=e.postCount,u=e.smoothSync;if(!(i!=null&&i.length&&s)){_context27.n=15;break;}d=s.toString(),v=this.getWorkShape(d);if(v){_context27.n=1;break;}return _context27.a(2);case 1:p=v.toolsType;if(!(p===It.LaserPen)){_context27.n=2;break;}return _context27.a(2);case 2:if(!(this.combineDrawActiveId&&this.combineDrawActiveId!==d)){_context27.n=3;break;}A=this.combineDrawActiveId;this.eraserBatchScheduler.cancel();this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);_context27.n=3;return this.consumeDrawAll({workId:A,scenePath:o,viewId:this.viewId,msgType:xt.DrawWork,dataType:Kt.Local},n);case 3:_t20=this.drawWorkActiveId&&this.drawWorkActiveId!==d;if(!_t20){_context27.n=5;break;}_context27.n=4;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:o,viewId:this.viewId,msgType:xt.DrawWork,dataType:Kt.Local},n);case 4:this.drawWorkActiveId=void 0;case 5:!this.drawWorkActiveId&&d!==Fe&&(this.drawWorkActiveId=d);Ze(a)&&(this.consumeCount=a);w=v.consume({data:e,isFullWork:!0,smoothSync:u});_t21=p;_context27.n=_t21===It.Selector?6:_t21===It.PencilEraser?8:_t21===It.BitMapEraser?8:_t21===It.Eraser?9:_t21===It.Arrow?11:_t21===It.Straight?11:_t21===It.Ellipse?11:_t21===It.Rectangle?11:_t21===It.Star?11:_t21===It.Polygon?11:_t21===It.SpeechBalloon?11:_t21===It.Pencil?13:15;break;case 6:_t22=w.type===xt.Select;if(!_t22){_context27.n=7;break;}w.selectIds&&n.runReverseSelectWork(w.selectIds);_context27.n=7;return this.drawSelector(_objectSpread(_objectSpread({},w),{},{scenePath:o,isSelecting:!0}),e.workState||te.Doing);case 7:return _context27.a(3,15);case 8:this.drawCount++,this.combineDrawActiveId=d,this.eraserBatchScheduler.schedule(function(){_this71.drawEraserCombine(d,_this71.drawCount,e.needUndoTicker,e.collectUndoTicker);},this.eraserBatchDelay);return _context27.a(3,15);case 9:_context27.n=10;return this.drawEraser(w,void 0,e.needUndoTicker,e.collectUndoTicker);case 10:return _context27.a(3,15);case 11:_t23=w;if(!_t23){_context27.n=12;break;}this.drawCount++;_context27.n=12;return this.drawShape(w);case 12:return _context27.a(3,15);case 13:this.drawCount++;!this.combineTimerId&&this.combineUnitTime!==1/0&&new Promise(function(A){_this71.combineDrawActiveId=d,_this71.combineDrawResolve=A,_this71.combineTimerId=setTimeout(function(){_this71.combineTimerId=void 0,_this71.combineDrawResolve&&_this71.combineDrawResolve(!0);},_this71.combineUnitTime);}).then(function(A){A&&_this71.drawPencilCombine(d,_this71.drawCount),_this71.combineDrawResolve=void 0;});_t24=w;if(!_t24){_context27.n=14;break;}_context27.n=14;return this.drawPencil(w);case 14:return _context27.a(3,15);case 15:return _context27.a(2);}},_callee26,this);}));function consumeDraw(_x39,_x40){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27(e,n){var a,u,d,i,s,o,v,p,w,A,M,E,_t25;return _regenerator().w(function(_context28){while(1)switch(_context28.n){case 0:this.eraserBatchScheduler.cancel(),this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);i=e.workId,s=e.scenePath,o=e.isLockSentEventCursor;if(!i){_context28.n=12;break;}v=i.toString();this.combineDrawActiveId===v&&(this.combineDrawActiveId=void 0),this.drawWorkActiveId===v&&(this.drawWorkActiveId=void 0);p=this.workShapes.get(v);if(p){_context28.n=1;break;}return _context28.a(2);case 1:w=p.toolsType;if(!(w===It.LaserPen)){_context28.n=2;break;}return _context28.a(2);case 2:A=this.workShapes.get(Po),M=(a=A==null?void 0:A.selectIds)==null?void 0:a[0],E=p.consumeAll({data:e,workerEngine:this});_t25=w;_context28.n=_t25===It.Selector?3:_t25===It.PencilEraser?5:_t25===It.BitMapEraser?5:_t25===It.Eraser?7:_t25===It.Arrow?8:_t25===It.Straight?8:_t25===It.Ellipse?8:_t25===It.Rectangle?8:_t25===It.Star?8:_t25===It.Polygon?8:_t25===It.SpeechBalloon?8:_t25===It.Pencil?10:12;break;case 3:E.selectIds&&M&&(u=E.selectIds)!=null&&u.includes(M)&&A.cursorBlur();E.selectIds&&n.runReverseSelectWork(E.selectIds);_context28.n=4;return this.drawSelector(_objectSpread(_objectSpread({},E),{},{scenePath:s,isSelecting:!1}),te.Done,o);case 4:(d=p.selectIds)!=null&&d.length?p.clearTmpPoints():this.clearWorkShapeNodeCache(v);return _context28.a(3,12);case 5:_context28.n=6;return this.drawEraserFull(p,_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker);case 6:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context28.a(3,12);case 7:this.drawEraser(_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker,e.collectUndoTicker),p.clearTmpPoints();return _context28.a(3,12);case 8:_context28.n=9;return this.drawPencilFull(_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker,w);case 9:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context28.a(3,12);case 10:_context28.n=11;return this.drawPencilFull(_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker);case 11:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context28.a(3,12);case 12:return _context28.a(2);}},_callee27,this);}));function consumeDrawAll(_x41,_x42){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28(e,n){var _iterator78,_step78,i,_t26;return _regenerator().w(function(_context29){while(1)switch(_context29.p=_context29.n){case 0:_iterator78=_createForOfIteratorHelper(this.workShapes.keys());_context29.p=1;_iterator78.s();case 2:if((_step78=_iterator78.n()).done){_context29.n=4;break;}i=_step78.value;_context29.n=3;return this.consumeDrawAll({workId:i,scenePath:e,viewId:this.viewId,msgType:xt.DrawWork,dataType:Kt.Local},n);case 3:_context29.n=2;break;case 4:_context29.n=6;break;case 5:_context29.p=5;_t26=_context29.v;_iterator78.e(_t26);case 6:_context29.p=6;_iterator78.f();return _context29.f(6);case 7:return _context29.a(2);}},_callee28,this,[[1,5,6,7]]);}));function workShapesDone(_x43,_x44){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee29(e){var a,u,d,n,i,v,p,s,o,_v0,_p5,w,A,M,E;return _regenerator().w(function(_context30){while(1)switch(_context30.n){case 0:n=(a=e.workId)==null?void 0:a.toString(),i=(u=e.updateNodeOpt)==null?void 0:u.eraserGeometryDelta;if(!(n&&i)){_context30.n=1;break;}v=this.vNodes.get(n),p=e.ops&&Os(e.ops)||e.op||[];if(!(!v||!e.centerPos||!Cgt(this.vNodes,n,i,v,{op:p,centerPos:e.centerPos}))){_context30.n=1;break;}wgt(this.vNodes,n);return _context30.a(2);case 1:s=this.setFullWork(e),o=e.ops&&Os(e.ops)||e.op;if(!s){_context30.n=9;break;}if(n){_context30.n=2;break;}return _context30.a(2);case 2:_v0=(d=this.vNodes.get(n))==null?void 0:d.rect;if(!(s.toolsType===It.BackgroundSVG)){_context30.n=3;break;}_p5=s.consumeService({isFullWork:!0,replaceId:n});_context30.n=8;break;case 3:if(!(s.toolsType===It.Image)){_context30.n=5;break;}_context30.n=4;return s.consumeServiceAsync({isFullWork:!0,replaceId:n,worker:this});case 4:_p5=_context30.v;w=(e==null?void 0:e.updateNodeOpt)&&s.updataOptService(e.updateNodeOpt);_context30.n=8;break;case 5:if(!(s.toolsType===It.Text)){_context30.n=7;break;}_context30.n=6;return s.consumeServiceAsync({isFullWork:!0,replaceId:n,boxRect:this.thread.getSceneRect()});case 6:_p5=_context30.v;_context30.n=8;break;case 7:_p5=s.consumeService({op:o,isFullWork:!0,replaceId:n}),w=(e==null?void 0:e.updateNodeOpt)&&s.updataOptService(e.updateNodeOpt);case 8:_p5=Jt(_p5,w);A=[],M=[];if(!(e.workId&&this.workShapes.delete(e.workId.toString()),e.clearPreviewLocalWork&&A.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}),_p5&&e.willRefresh&&(_v0&&(A.push({rect:me(_v0),isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId}),_p5=Jt(_p5,_v0)),A.push({rect:me(_p5),drawCanvas:Yt.Bg,viewId:this.viewId})),e.willSyncService&&M.push({opt:e.opt,toolsType:e.toolsType,type:xt.FullWork,workId:e.workId,ops:e.ops,updateNodeOpt:e.updateNodeOpt,viewId:this.viewId,needUndoTicker:e.needUndoTicker,requestId:e.requestId,emitEventType:e.emitEventType,scenePath:e.scenePath}),e.isLockSentEventCursor&&M.push({type:xt.None,isLockSentEventCursor:!0,scenePath:e.scenePath}),e.needUndoTicker&&M.push({type:xt.None,needUndoTicker:e.needUndoTicker,emitEventType:e.emitEventType,requestId:e.requestId,scenePath:e.scenePath}),A.length||M.length)){_context30.n=9;break;}E={render:A,sp:M};_context30.n=9;return this._post(E);case 9:return _context30.a(2);}},_callee29,this);}));function consumeFull(_x45){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee30(e,n){var i,s,o,a,u,d,v,_iterator79,_step79,p,w,A,_t27,_t28,_t29;return _regenerator().w(function(_context31){while(1)switch(_context31.p=_context31.n){case 0:i=e.willSyncService,s=e.needUndoTicker,o=[],a=[],u=[],d=this.workShapes.get(Fe);if(d){_context31.n=1;break;}return _context31.a(2);case 1:v=d.selectIds&&_toConsumableArray(d.selectIds)||[];_iterator79=_createForOfIteratorHelper(v);_context31.p=2;_iterator79.s();case 3:if((_step79=_iterator79.n()).done){_context31.n=8;break;}p=_step79.value;w=this.vNodes.get(p);if(!w){_context31.n=6;break;}_t27=w.toolsType;_context31.n=_t27===It.Text?4:_t27===It.BackgroundSVG?5:6;break;case 4:o.push({type:xt.TextUpdate,toolsType:It.Text,workId:p,dataType:Kt.Local});return _context31.a(3,6);case 5:o.push({type:xt.BackgroundSVGDelete,toolsType:It.BackgroundSVG,workId:p,dataType:Kt.Local,viewId:this.viewId});return _context31.a(3,6);case 6:A=this._removeWork(p);A.length&&a.push.apply(a,_toConsumableArray(A)),n==null||n.deleteCachedImagesByWorkId(p),u.push(p);case 7:_context31.n=3;break;case 8:_context31.n=10;break;case 9:_context31.p=9;_t28=_context31.v;_iterator79.e(_t28);case 10:_context31.p=10;_iterator79.f();return _context31.f(10);case 11:u.length&&o.push({type:xt.RemoveNode,removeIds:u,needUndoTicker:s,emitEventType:e.emitEventType,requestId:e.requestId});o.push({type:xt.Select,selectIds:[],willSyncService:i});_context31.n=12;return this.blurSelector();case 12:s&&o.push({type:xt.None,needUndoTicker:s});_t29=a.length||o.length;if(!_t29){_context31.n=13;break;}_context31.n=13;return this._post({render:a,sp:o});case 13:return _context31.a(2);}},_callee30,this,[[2,9,10,11]]);}));function removeSelector(_x46,_x47){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31(e){var n,i,s,_t30;return _regenerator().w(function(_context32){while(1)switch(_context32.n){case 0:n=e.workId,i=n==null?void 0:n.toString();if(!i){_context32.n=1;break;}s=this._removeWork(i);_t30=s.length;if(!_t30){_context32.n=1;break;}_context32.n=1;return this._post({render:s});case 1:return _context32.a(2);}},_callee31,this);}));function removeWork(_x48){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(e){var _this72=this;var s,o,a;var n=this.vNodes.get(e);n&&(n.toolsType===It.BackgroundSVG&&this._post({sp:[{type:xt.BackgroundSVGDelete,toolsType:It.BackgroundSVG,workId:e,dataType:Kt.Local,viewId:this.viewId}]}),(s=this.fullLayer)==null||s.getElementsByName(e).forEach(function(u){u.remove(),_Ur(u,_this72.fullLayer.parent);}),this.vNodes.delete(e));var i=this.drawLayer&&jt.getRectFromLayer(this.drawLayer,e);if(i){var u=(o=this.drawLayer)==null?void 0:o.getElementsByName(e)[0];u&&(u.remove(),_Ur(u,(a=this.drawLayer)==null?void 0:a.parent));}return this.getWorkShape(e)&&this.clearWorkShapeNodeCache(e),{fullRect:n==null?void 0:n.rect,drawRect:i};}},{key:"_removeWork",value:function _removeWork(e){var _this$removeNode=this.removeNode(e),n=_this$removeNode.fullRect,i=_this$removeNode.drawRect,s=[];return n&&s.push({rect:me(n),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(n),drawCanvas:Yt.Bg,viewId:this.viewId}),i&&s.push({rect:me(i),clearCanvas:Yt.Float,isClear:!0,viewId:this.viewId},{rect:me(i),drawCanvas:Yt.Float,viewId:this.viewId}),s;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee32(e){var n,i,s,o,a,u,d,_iterator80,_step80,_v1,p,w,A,M,v,_t31,_t32;return _regenerator().w(function(_context33){while(1)switch(_context33.p=_context33.n){case 0:n=e.op,i=e.viewId,s=e.dataType;if(!(n!=null&&n.length)){_context33.n=11;break;}u=n[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],d=n[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator80=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context33.p=1;_iterator80.s();case 2:if((_step80=_iterator80.n()).done){_context33.n=4;break;}_v1=_step80.value;p=_v1.rect,w=_v1.name,A=_v1.toolsType,M=_v1.opt;if(!(A===It.Text&&M.workState===te.Done&&YPt([u,d],p))){_context33.n=3;break;}o=w,a=this.setFullWork({workId:w,toolsType:A,opt:M});return _context33.a(3,4);case 3:_context33.n=2;break;case 4:_context33.n=6;break;case 5:_context33.p=5;_t31=_context33.v;_iterator80.e(_t31);case 6:_context33.p=6;_iterator80.f();return _context33.f(6);case 7:if(!o){_context33.n=11;break;}_t32=a;if(!_t32){_context33.n=9;break;}_context33.n=8;return a.consumeServiceAsync({isFullWork:!0,replaceId:a.getWorkId(),boxRect:this.thread.getSceneRect()});case 8:v=_context33.v;case 9:_context33.n=10;return this.blurSelector({viewId:i,msgType:xt.Select,dataType:s,isSync:!0});case 10:_context33.n=11;return this._post({render:v&&[{rect:me(v),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(v),drawCanvas:Yt.Bg,viewId:this.viewId}],sp:[{type:xt.GetTextActive,toolsType:It.Text,workId:o}]});case 11:return _context33.a(2);}},_callee32,this,[[1,5,6,7]]);}));function checkTextActive(_x49){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee33(e){var n,i,s;return _regenerator().w(function(_context34){while(1)switch(_context34.n){case 0:n=this.workShapes.get(Fe),i=e.workId,s=e.msgType;if(!(n&&i&&n.selectIds&&n.selectIds.includes(i.toString()))){_context34.n=2;break;}s===xt.RemoveNode?n.selectIds=n.selectIds.filter(function(o){return o!==i.toString();}):this.effectSelectNodeData.add(e);_context34.n=1;return this.runEffectSelectWork(!0);case 1:return _context34.a(2);case 2:return _context34.a(2,e);}},_callee33,this);}));function colloctEffectSelectWork(_x50){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34(e){var _this73=this;var E,n,i,s,o,a,u,d,v,p,w,A,M,_t33;return _regenerator().w(function(_context35){while(1)switch(_context35.n){case 0:n=this.workShapes.get(Fe);if((E=n==null?void 0:n.selectIds)!=null&&E.length){_context35.n=1;break;}return _context35.a(2);case 1:i=e.callback;s=_objectWithoutProperties(e,_excluded3);o=s.updateSelectorOpt;a=s.willSerializeData;u=s.smoothSync;_context35.n=2;return n==null?void 0:n.updateSelector({updateSelectorOpt:o,selectIds:br(n.selectIds),vNodes:this.vNodes,willSerializeData:a,worker:this});case 2:d=_context35.v;v=/* @__PURE__ */new Map();d!=null&&d.selectIds&&(p=Xbt(n.selectIds,d.selectIds),d.selectIds.forEach(function(L){var G=_this73.vNodes.get(L);if(G){var z=G.toolsType,et=G.op,x=G.opt;v.set(L,{opt:x,toolsType:z,ops:(et==null?void 0:et.length)&&Br(et)||void 0});}}),n.selectIds=d.selectIds);w=[],A=[];d!=null&&d.rect&&w.push({rect:me(d.rect),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(d.rect),drawCanvas:Yt.Bg,viewId:this.viewId});M=i&&i({res:d,workShapeNode:n,param:s,postData:{render:w,sp:A},newServiceStore:v,smoothSync:u})||{render:w,sp:A};p&&M.sp.push({type:xt.RemoveNode,removeIds:p,viewId:this.viewId});_t33=M.render.length||M.sp.length;if(!_t33){_context35.n=3;break;}_context35.n=3;return this._post(M);case 3:return _context35.a(2);}},_callee34,this);}));function updateSelector(_x51){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35(e){var s,n,i,o;return _regenerator().w(function(_context36){while(1)switch(_context36.n){case 0:n=this.workShapes.get(Fe),i=n==null?void 0:n.blurSelector();if(!(this.clearWorkShapeNodeCache(Fe),((s=this.fullLayer)==null?void 0:s.parent).children.forEach(function(o){o.name===Fe&&o.remove();}),i)){_context36.n=1;break;}o=[];o.push(_objectSpread(_objectSpread({},i),{},{isSync:e==null?void 0:e.isSync,scenePath:e==null?void 0:e.scenePath}));_context36.n=1;return this._post({render:(i==null?void 0:i.rect)&&[{rect:me(i.rect),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(i.rect),drawCanvas:Yt.Bg,viewId:this.viewId}],sp:o});case 1:return _context36.a(2);}},_callee35,this);}));function blurSelector(_x52){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(Fe);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(Fe);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee36(){var e,o,n,i,s,a,_args37=arguments;return _regenerator().w(function(_context37){while(1)switch(_context37.n){case 0:e=_args37.length>0&&_args37[0]!==undefined?_args37[0]:!1;n=this.workShapes.get(Fe);if(n){_context37.n=1;break;}return _context37.a(2);case 1:if(!(n&&!((o=n.selectIds)!=null&&o.length))){_context37.n=3;break;}_context37.n=2;return this.blurSelector();case 2:return _context37.a(2);case 3:i=n.oldSelectRect,s=n.reRenderSelector();if(!s){_context37.n=4;break;}a=Jt(i,s)||s;_context37.n=4;return this._post({render:[{rect:me(a),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(a),drawCanvas:Yt.Bg,viewId:this.viewId}],sp:[{type:xt.Select,selectIds:n.selectIds,selectRect:s,willSyncService:e,viewId:this.viewId,points:n.getChildrenPoints(),textOpt:n.textOpt,selectorColor:n.selectorColor,strokeColor:n.strokeColor,fillColor:n.fillColor,canTextEdit:n.canTextEdit,canRotate:n.canRotate,scaleType:n.scaleType,opt:n.getWorkOptions()||void 0,canLock:n.canLock,isLocked:n.isLocked,toolsTypes:n.toolsTypes,shapeOpt:n.shapeOpt,thickness:n.thickness,useStroke:n.useStroke,strokeType:n.strokeType}]});case 4:return _context37.a(2);}},_callee36,this);}));function reRenderSelector(){return _reRenderSelector.apply(this,arguments);}return reRenderSelector;}()},{key:"updateFullSelectWork",value:function(){var _updateFullSelectWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee37(e){var s,o,a,u,d,v,p,n,i,_n$updateSelectIds,w,A,M;return _regenerator().w(function(_context38){while(1)switch(_context38.n){case 0:n=this.workShapes.get(Fe),i=e.selectIds;if(i!=null&&i.length){_context38.n=2;break;}_context38.n=1;return this.blurSelector(e);case 1:return _context38.a(2);case 2:if(n){_context38.n=4;break;}!this.setFullWork(e)&&e.workId&&((s=this.tmpOpt)==null?void 0:s.toolsType)===It.Selector&&this.createWorkShape(e.workId.toString());_context38.n=3;return this.updateFullSelectWork(e);case 3:return _context38.a(2);case 4:if(!(n&&i!=null&&i.length)){_context38.n=5;break;}_n$updateSelectIds=n.updateSelectIds(i),w=_n$updateSelectIds.bgRect,A=_n$updateSelectIds.selectRect,M={render:[],sp:[]};w&&((o=M.render)==null||o.push({rect:me(w),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(w),drawCanvas:Yt.Bg,viewId:this.viewId}));(p=M.sp)==null||p.push({selectorColor:((a=e.opt)==null?void 0:a.strokeColor)||n.selectorColor,strokeColor:((u=e.opt)==null?void 0:u.strokeColor)||n.strokeColor,fillColor:((d=e.opt)==null?void 0:d.fillColor)||n.fillColor,textOpt:((v=e.opt)==null?void 0:v.textOpt)||n.textOpt,canTextEdit:n.canTextEdit,canRotate:n.canRotate,scaleType:n.scaleType,type:xt.Select,viewId:this.viewId,dataType:Kt.Local,selectIds:e.selectIds,selectRect:A,points:n.getChildrenPoints(),willSyncService:(e==null?void 0:e.willSyncService)||!1,opt:(e==null?void 0:e.willSyncService)&&n.getWorkOptions()||void 0,canLock:n.canLock,isLocked:n.isLocked,toolsTypes:n.toolsTypes,shapeOpt:n.shapeOpt,thickness:n.thickness,useStroke:n.useStroke,strokeType:n.strokeType});_context38.n=5;return this._post(M);case 5:return _context38.a(2);}},_callee37,this);}));function updateFullSelectWork(_x53){return _updateFullSelectWork.apply(this,arguments);}return updateFullSelectWork;}()},{key:"destroy",value:function destroy(){this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1)),_superPropGet(iI,"destroy",this,3)([]),this.effectSelectNodeData.clear();}},{key:"drawEraserCombine",value:function(){var _drawEraserCombine=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee38(e,n,i,s){var a,u,d,v,p,w,o,A,M,E,L,G,_iterator81,_step81,_step81$value,_G7,z;return _regenerator().w(function(_context39){while(1)switch(_context39.n){case 0:o=(a=this.workShapes.get(e))==null?void 0:a.combineConsume({workerEngine:this});if(!o){_context39.n=1;break;}A=o.willDeleteNodes,M=o.willNewNodes,E=_toConsumableArray(A?Array.from(A):[]),L={render:[],fullWorkerDrawCount:n,sp:[]};if(o!=null&&o.rect){G=me(o.rect);(u=L.render)==null||u.push({rect:G,isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:G,drawCanvas:Yt.Bg,viewId:this.viewId});}if(s&&E.length&&((d=this.getWorkShape(e))==null?void 0:d.toolsType)===It.BitMapEraser&&((v=L.sp)==null||v.push({type:xt.None,collectUndoTicker:s,undoScopeIds:E,undoScopePhase:"collect"})),A!=null&&A.size&&((p=L.sp)==null||p.push({type:xt.RemoveNode,removeIds:_toConsumableArray(A),viewId:this.thread.viewId,needUndoTicker:i,collectUndoTicker:s})),M!=null&&M.size){_iterator81=_createForOfIteratorHelper(M);try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){_step81$value=_slicedToArray(_step81.value,2),_G7=_step81$value[0],z=_step81$value[1];(w=L.sp)==null||w.push({type:xt.FullWork,dataType:Kt.Local,toolsType:It.Pencil,ops:Br(z.op),opt:z.opt,workId:_G7,updateNodeOpt:{useAnimation:!1},needUndoTicker:i,collectUndoTicker:s});}}catch(err){_iterator81.e(err);}finally{_iterator81.f();}}_context39.n=1;return this._post(L);case 1:return _context39.a(2);}},_callee38,this);}));function drawEraserCombine(_x54,_x55,_x56,_x57){return _drawEraserCombine.apply(this,arguments);}return drawEraserCombine;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee39(e,n){var s,o,a,i,u,d;return _regenerator().w(function(_context40){while(1)switch(_context40.n){case 0:i=(s=this.workShapes.get(e))==null?void 0:s.combineConsume();if(!i){_context40.n=1;break;}u={render:[],fullWorkerDrawCount:n};if(i!=null&&i.rect){d=me(i.rect);(o=u.render)==null||o.push({rect:d,isClear:!0,clearCanvas:Yt.Float,viewId:this.viewId}),(a=u.render)==null||a.push({rect:d,drawCanvas:Yt.Float,viewId:this.viewId});}_context40.n=1;return this._post(u);case 1:return _context40.a(2);}},_callee39,this);}));function drawPencilCombine(_x58,_x59){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee40(e,n,i){var o,a,u,s;return _regenerator().w(function(_context41){while(1)switch(_context41.n){case 0:s={render:[],sp:[e]};(o=s.sp)==null||o.push({type:xt.SelectorTransform,emitEventType:ve.SelectMethod,workState:n,scenePath:e.scenePath});i&&((a=s.sp)==null||a.push({type:xt.None,isLockSentEventCursor:i}));e.rect&&((u=s.render)==null||u.push({rect:me(e.rect),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(e.rect),drawCanvas:Yt.Bg,viewId:this.viewId}));_context41.n=1;return this._post(s);case 1:return _context41.a(2);}},_callee40,this);}));function drawSelector(_x60,_x61,_x62){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee41(e,n,i,s){var v,p,w,A,M,E,L,o,a,u,d;return _regenerator().w(function(_context42){while(1)switch(_context42.n){case 0:o=s===It.Pencil,a=o&&e.type===xt.RemoveNode,u=((v=e.workId)==null?void 0:v.toString())||((w=(p=e.removeIds)==null?void 0:p[0])==null?void 0:w.toString()),d={fullWorkerDrawCount:1/0,render:[],sp:a?[]:[_objectSpread(_objectSpread({},e),{},{needUndoTicker:i,undoScopeIds:o&&u?[u]:e.undoScopeIds,undoScopePhase:o?"finalize":e.undoScopePhase})]};n&&((A=d.sp)==null||A.push({type:xt.None,isLockSentEventCursor:n}));a?(M=d.render)==null||M.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}):e!=null&&e.rect&&((E=d.render)==null||E.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId},{rect:e.rect,isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:e.rect,drawCanvas:Yt.Bg,viewId:this.viewId}));i&&((L=d.sp)==null||L.push({type:xt.None,needUndoTicker:i,undoScopeIds:a?[]:void 0,undoScopePhase:a?"finalize":void 0}));_context42.n=1;return this._post(d);case 1:return _context42.a(2);}},_callee41,this);}));function drawPencilFull(_x63,_x64,_x65,_x66){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"drawEraserFull",value:function(){var _drawEraserFull=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee42(e,n,i,s){var o,a,u,d,v,p,w,_iterator82,_step82,_step82$value,M,E,_iterator83,_step83,_step83$value,_M3,_E3,A;return _regenerator().w(function(_context43){while(1)switch(_context43.n){case 0:o=n.rect,a=n.willUpdateNodes,u=n.willDeleteNodes,d=n.willNewNodes,v=e.getWorkId(),p=[].concat(_toConsumableArray(a?Array.from(a.keys()).map(function(M){return String(M);}):[]),_toConsumableArray(u?Array.from(u):[]),_toConsumableArray(d?Array.from(d.keys()).map(function(M){return String(M);}):[])),w=[];if(s&&w.push({type:xt.None,needUndoTicker:s,undoScopeIds:p,undoScopePhase:"finalize"}),w.push({type:xt.RemoveNode,removeIds:[v],eraseTxnId:v,viewId:this.viewId,needUndoTicker:s}),i&&w.push({type:xt.None,isLockSentEventCursor:i}),a!=null&&a.size||u!=null&&u.size||d!=null&&d.size){if(a!=null&&a.size){_iterator82=_createForOfIteratorHelper(a);try{for(_iterator82.s();!(_step82=_iterator82.n()).done;){_step82$value=_slicedToArray(_step82.value,2),M=_step82$value[0],E=_step82$value[1];w.push({type:xt.UpdateNode,dataType:Kt.Local,opt:E.opt,workId:M,updateNodeOpt:{useAnimation:!1},eraseTxnId:v,needUndoTicker:s});}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}}if(u!=null&&u.size&&w.push({type:xt.RemoveNode,removeIds:_toConsumableArray(u),eraseTxnId:v,viewId:this.thread.viewId,needUndoTicker:s}),d!=null&&d.size){_iterator83=_createForOfIteratorHelper(d);try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){_step83$value=_slicedToArray(_step83.value,2),_M3=_step83$value[0],_E3=_step83$value[1];w.push({type:xt.FullWork,dataType:Kt.Local,toolsType:_E3.toolsType,ops:Br(_E3.op),opt:_E3.opt,workId:_M3,updateNodeOpt:{useAnimation:!1},needUndoTicker:s});}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}}}A=[{isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}];o&&A.push({rect:o,isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:o,drawCanvas:Yt.Bg,viewId:this.viewId});_context43.n=1;return this._post({sp:w,render:A,fullWorkerDrawCount:1/0});case 1:return _context43.a(2);}},_callee42,this);}));function drawEraserFull(_x67,_x68,_x69,_x70){return _drawEraserFull.apply(this,arguments);}return drawEraserFull;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee43(e,n,i,s){var o,a,u;return _regenerator().w(function(_context44){while(1)switch(_context44.n){case 0:o=[],a=[],u=e.removeIds||[];s&&u.length&&o.push({type:xt.None,collectUndoTicker:s,undoScopeIds:u,undoScopePhase:"collect"});n&&o.push({type:xt.None,isLockSentEventCursor:n});e.removeIds&&o.push(_objectSpread(_objectSpread({},e),{},{needUndoTicker:i,collectUndoTicker:s}));e.rect&&a.push({rect:e.rect,isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:e.rect,drawCanvas:Yt.Bg,viewId:this.viewId});i&&o.push({type:xt.None,needUndoTicker:i,undoScopePhase:"finalize"});_context44.n=1;return this._post({sp:o,render:a,consumeCount:this.consumeCount});case 1:return _context44.a(2);}},_callee43,this);}));function drawEraser(_x71,_x72,_x73,_x74){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawShape",value:function(){var _drawShape=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee44(e){return _regenerator().w(function(_context45){while(1)switch(_context45.n){case 0:_context45.n=1;return this._post({fullWorkerDrawCount:this.drawCount,sp:(e==null?void 0:e.op)&&[e]});case 1:return _context45.a(2);}},_callee44,this);}));function drawShape(_x75){return _drawShape.apply(this,arguments);}return drawShape;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee45(e){return _regenerator().w(function(_context46){while(1)switch(_context46.n){case 0:_context46.n=1;return this._post({sp:(e==null?void 0:e.op)&&[e]});case 1:return _context46.a(2);}},_callee45,this);}));function drawPencil(_x76){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee46(e){var n,_iterator84,_step84,i,s,o,a,_t34;return _regenerator().w(function(_context47){while(1)switch(_context47.p=_context47.n){case 0:_iterator84=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context47.p=1;_iterator84.s();case 2:if((_step84=_iterator84.n()).done){_context47.n=11;break;}i=_step84.value;s=this.setFullWork(i);if(!s){_context47.n=9;break;}o=(n=s.getWorkId())==null?void 0:n.toString();if(!(s.toolsType===It.BackgroundSVG)){_context47.n=3;break;}s.consumeService({isFullWork:!0,replaceId:o});_context47.n=8;break;case 3:if(!(s.toolsType===It.Image)){_context47.n=5;break;}_context47.n=4;return s.consumeServiceAsync({isFullWork:!0,replaceId:o,worker:this});case 4:_context47.n=8;break;case 5:if(!(s.toolsType===It.Text)){_context47.n=7;break;}_context47.n=6;return s.consumeServiceAsync({isFullWork:!0,replaceId:o,boxRect:this.thread.getSceneRect()});case 6:_context47.n=8;break;case 7:a=i.ops&&Os(i.ops);s.consumeService({op:a,isFullWork:!0,replaceId:o}),i!=null&&i.updateNodeOpt&&s.updataOptService(i.updateNodeOpt);case 8:i.workId&&this.workShapes.delete(i.workId.toString());case 9:this.effectSelectNodeData.delete(i);case 10:_context47.n=2;break;case 11:_context47.n=13;break;case 12:_context47.p=12;_t34=_context47.v;_iterator84.e(_t34);case 13:_context47.p=13;_iterator84.f();return _context47.f(13);case 14:_context47.n=15;return this.reRenderSelector(e);case 15:return _context47.a(2);}},_callee46,this,[[1,12,13,14]]);}));function runEffectSelectWork(_x77){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee47(e){var a,n,i,s,o,u,d,_t35;return _regenerator().w(function(_context48){while(1)switch(_context48.n){case 0:n=e.opt,i=e.toolsType,s=e.point,o=this.setFullWork({workId:Po,toolsType:i,opt:n});if(!(o&&s)){_context48.n=1;break;}u=o.cursorHover(s),d={render:[]};_t35=u&&u.type===xt.CursorHover&&u.rect;if(!_t35){_context48.n=1;break;}(a=d.render)==null||a.push({rect:me(u.rect),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(u.rect),drawCanvas:Yt.Bg,viewId:this.viewId});_context48.n=1;return this._post(d);case 1:return _context48.a(2);}},_callee47,this);}));function cursorHover(_x78){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee48(){var i,e,n,_t36,_t37;return _regenerator().w(function(_context49){while(1)switch(_context49.n){case 0:e=this.getWorkShape(Po);_t36=e&&(i=e.selectIds)!=null&&i.length;if(!_t36){_context49.n=1;break;}n=e.oldSelectRect;e.cursorBlur();this.clearWorkShapeNodeCache(Po);_t37=n;if(!_t37){_context49.n=1;break;}_context49.n=1;return this._post({render:[{rect:me(n),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(n),drawCanvas:Yt.Bg,viewId:this.viewId}]});case 1:this.fullLayer.parent.children.forEach(function(s){s.name==="Cursor_Hover_Id"&&s.remove();});case 2:return _context49.a(2);}},_callee48,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(x0);var sI=/*#__PURE__*/function(){function sI(t){_classCallCheck(this,sI);wt(this,"viewId");wt(this,"vNodes");wt(this,"fullLayer");wt(this,"drawLayer");wt(this,"workShapes",/* @__PURE__ */new Map());wt(this,"selectorWorkShapes",/* @__PURE__ */new Map());wt(this,"thread");wt(this,"animationId");wt(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());wt(this,"runEffectId");wt(this,"noAnimationRect");wt(this,"syncUnitTime",zr.syncOpt.interval);wt(this,"post");this.viewId=t.viewId,this.vNodes=t.vNodes,this.fullLayer=t.fullLayer,this.drawLayer=t.drawLayer,this.thread=t.thread,this.post=t.thread.post.bind(t.thread);}return _createClass(sI,[{key:"destroy",value:function destroy(){this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear();}},{key:"consumeDraw",value:function(){var _consumeDraw2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee49(t){return _regenerator().w(function(_context50){while(1)switch(_context50.n){case 0:this.activeWorkShape(t),this.runAnimation();case 1:return _context50.a(2);}},_callee49,this);}));function consumeDraw(_x79){return _consumeDraw2.apply(this,arguments);}return consumeDraw;}()},{key:"consumeFull",value:function consumeFull(t){if(this.activeWorkShape(t),t.refreshTextRender){this.animationId&&(clearTimeout(this.animationId),this.animationId=void 0),this.animationDraw();return;}this.runAnimation();}},{key:"runSelectWork",value:function runSelectWork(t){this.activeSelectorShape(t);var e=t.workId,n=e==null?void 0:e.toString();n&&this.willRunEffectSelectorIds.add(n),this.runEffect();}},{key:"setNodeKey",value:function setNodeKey(t,e,n,i){return e.toolsType=n,e.node=cf({workId:t,toolsType:n,toolsOpt:i,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),e;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(t){var _this74=this;t.forEach(function(e){_this74.selectorWorkShapes.forEach(function(n,i){var s;if((s=n.selectIds)!=null&&s.length){var o=n.selectIds.indexOf(e);o>-1&&(n.selectIds.splice(o,1),_this74.willRunEffectSelectorIds.add(i));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee50(t){var e,n,i;return _regenerator().w(function(_context51){while(1)switch(_context51.n){case 0:e=t.workId,n=e==null?void 0:e.toString();if(!n){_context51.n=3;break;}i=this.workShapes.get(n);if(!i){_context51.n=2;break;}this.workShapes.delete(n);_context51.n=1;return this.removeNode(n,t,i==null?void 0:i.totalRect,!1);case 1:return _context51.a(2);case 2:_context51.n=3;return this.removeNode(n,t);case 3:return _context51.a(2);}},_callee50,this);}));function removeWork(_x80){return _removeWork3.apply(this,arguments);}return removeWork;}()},{key:"removeSelectWork",value:function removeSelectWork(t){var e=t.workId,n=e==null?void 0:e.toString();n&&(this.activeSelectorShape(t),this.willRunEffectSelectorIds.add(n)),this.runEffect();}},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee51(t,e,n){var _this75=this;var i,v,s,o,a,u,d,_args52=arguments,_t38;return _regenerator().w(function(_context52){while(1)switch(_context52.n){case 0:i=_args52.length>3&&_args52[3]!==undefined?_args52[3]:!0;t.indexOf(Fe)>-1&&this.removeSelectWork(e);s=n;o=(v=this.vNodes.get(t))==null?void 0:v.rect;o&&(s=Jt(o,s));a=this.fullLayer&&jt.getRectFromLayer(this.fullLayer,t);s=Jt(s,a);u=this.drawLayer&&jt.getRectFromLayer(this.drawLayer,t);s=Jt(s,u),this.fullLayer.getElementsByName(t).forEach(function(p){p.remove(),_Ur(p,_this75.fullLayer.parent);}),this.drawLayer.getElementsByName(t).forEach(function(p){p.remove(),_Ur(p,_this75.drawLayer.parent);});d=this.vNodes.get(t);d&&d.toolsType===It.BackgroundSVG&&this.post({sp:[{type:xt.BackgroundSVGDelete,toolsType:It.BackgroundSVG,workId:t,dataType:Kt.Service,viewId:this.viewId}]});this.vNodes.delete(t);_t38=s;if(!_t38){_context52.n=1;break;}_context52.n=1;return this.post({render:[{rect:me(s),isClear:!0,clearCanvas:i?Yt.Bg:Yt.ServiceFloat,workerType:i?void 0:Kt.Service,viewId:this.viewId},{rect:me(s),drawCanvas:i?Yt.Bg:Yt.ServiceFloat,workerType:i?void 0:Kt.Service,viewId:this.viewId}]});case 1:return _context52.a(2);}},_callee51,this);}));function removeNode(_x81,_x82,_x83){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(t){var L,G,z,et;var e=t.workId,n=t.opt,i=t.toolsType,s=t.type,o=t.updateNodeOpt,a=t.ops,u=t.op,d=t.useAnimation,v=t.isEnableCursor,p=t.requestId,w=t.refreshTextRender;if(!e)return;var A=e.toString(),M=(L=this.vNodes.get(A))==null?void 0:L.rect;if(!((G=this.workShapes)!=null&&G.has(A))){var x={toolsType:i,animationWorkData:u||[],animationIndex:0,type:s,updateNodeOpt:o,ops:a,useAnimation:_typeof(d)<"u"?d:_typeof(o==null?void 0:o.useAnimation)<"u"?o==null?void 0:o.useAnimation:!0,oldRect:M,isDiff:!1,isEnableCursor:v};i&&n&&(x=this.setNodeKey(A,x,i,n)),(z=this.workShapes)==null||z.set(A,x);}var E=(et=this.workShapes)==null?void 0:et.get(A);E.isEnableCursor=v,E.requestId=p,E.refreshTextRender=!!w,s&&(E.type=s),a&&(E.animationWorkData=Os(a),E.ops=a),o&&(E.updateNodeOpt=o),u&&(E.isDiff=this.hasDiffData(E.animationWorkData||[],u,E.toolsType),E.toolsType,It.Pencil,E.animationWorkData=u),E.node&&E.node.getWorkId()!==A&&E.node.setWorkId(A),M&&(E.oldRect=M),i&&n?(n.syncUnitTime&&(this.syncUnitTime=n.syncUnitTime),E.toolsType!==i&&i&&n&&this.setNodeKey(A,E,i,n),E.node&&E.node.setWorkOptions(n)):i&&(E.toolsType=i);}},{key:"hasDiffData",value:function hasDiffData(t,e,n){var i=t.length;if(e.length<i)return!0;switch(n){case It.Pencil:{for(var s=0;s<i;s+=3)if(e[s]!==t[s]||e[s+1]!==t[s+1])return!0;break;}case It.LaserPen:{for(var _s0=0;_s0<i;_s0+=2)if(e[_s0]!==t[_s0]||e[_s0+1]!==t[_s0+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee52(){var _this76=this;var i,s,o,a,u,d,v,p,w,A,M,E,L,G,z,et,x,y,S,C,P,X,$,K,j,nt,ct,F,R,Y,q,lt,ut,Tt,O,U,_,H,at,ht,yt,Et,Dt,D,N,t,e,n,_iterator85,_step85,_loop7,_t40,_t41;return _regenerator().w(function(_context54){while(1)switch(_context54.p=_context54.n){case 0:this.animationId=void 0;t=!1;e={render:[]},n=/* @__PURE__ */new Map();_iterator85=_createForOfIteratorHelper(this.workShapes.entries());_context54.p=1;_loop7=/*#__PURE__*/_regenerator().m(function _loop7(){var _step85$value,J,Q,V,tt,_V2,_tt2,_V3,_tt3,_V4,_tt4,g,I,_V5,_tt5,_g2,_I2,B,Z,st,_Z2,_V6,_tt6,_g3,_I3,_t39;return _regenerator().w(function(_context53){while(1)switch(_context53.n){case 0:_step85$value=_slicedToArray(_step85.value,2),J=_step85$value[0],Q=_step85$value[1];_t39=Q.toolsType;_context53.n=_t39===It.BackgroundSVG?1:_t39===It.Image?2:_t39===It.Text?4:_t39===It.Arrow?7:_t39===It.Straight?7:_t39===It.Rectangle?7:_t39===It.Ellipse?7:_t39===It.Star?7:_t39===It.Polygon?7:_t39===It.SpeechBalloon?7:_t39===It.Pencil?8:13;break;case 1:V=Q.oldRect;V&&((i=e.render)==null||i.push({rect:V,isClear:!0,clearCanvas:Yt.Bg,viewId:_this76.viewId}),(s=e.render)==null||s.push({rect:V,drawCanvas:Yt.Bg,viewId:_this76.viewId}));tt=(o=Q.node)==null?void 0:o.consumeService({isFullWork:!0,replaceId:J});_this76.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this76.willRunEffectSelectorIds.add(I),_this76.noAnimationRect=Jt(_this76.noAnimationRect,V),_this76.noAnimationRect=Jt(_this76.noAnimationRect,tt),_this76.runEffect());}),_this76.workShapes.delete(J),(a=e.render)==null||a.push({rect:tt,drawCanvas:Yt.Bg,viewId:_this76.viewId});return _context53.a(3,13);case 2:_V2=Q.oldRect;_V2&&((u=e.render)==null||u.push({rect:_V2,isClear:!0,clearCanvas:Yt.Bg,viewId:_this76.viewId}),(d=e.render)==null||d.push({rect:_V2,drawCanvas:Yt.Bg,viewId:_this76.viewId}));_context53.n=3;return(v=Q.node)==null?void 0:v.consumeServiceAsync({isFullWork:!0,worker:_this76.thread});case 3:_tt2=_context53.v;_this76.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this76.willRunEffectSelectorIds.add(I),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_V2),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_tt2),_this76.runEffect());}),_this76.workShapes.delete(J),(p=e.render)==null||p.push({rect:_tt2,drawCanvas:Yt.Bg,viewId:_this76.viewId});return _context53.a(3,13);case 4:if(!Q.node){_context53.n=6;break;}_V3=Q.oldRect;_V3&&((w=e.render)==null||w.push({rect:_V3,isClear:!0,clearCanvas:Yt.Bg,viewId:_this76.viewId}),(A=e.render)==null||A.push({rect:_V3,drawCanvas:Yt.Bg,viewId:_this76.viewId}));_context53.n=5;return Q.node.consumeServiceAsync({isFullWork:!0,replaceId:J,boxRect:_this76.thread.getSceneRect()});case 5:_tt3=_context53.v;_this76.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this76.willRunEffectSelectorIds.add(I),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_V3),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_tt3),_this76.runEffect());}),Q.refreshTextRender&&Q.requestId&&(e.sp=e.sp||[],e.sp.push({type:xt.RefreshTextRender,requestId:Q.requestId,workId:J,viewId:_this76.viewId})),(M=Q.node)==null||M.clearTmpPoints(),_this76.workShapes.delete(J),(E=e.render)==null||E.push({rect:_tt3,drawCanvas:Yt.Bg,viewId:_this76.viewId});case 6:return _context53.a(3,13);case 7:_V4=!!Q.ops;if((L=Q.animationWorkData)!=null&&L.length){_tt4=Q.oldRect,g=Q.node.oldRect;_tt4&&((G=e.render)==null||G.push({rect:_tt4,isClear:!0,clearCanvas:Yt.Bg,viewId:_this76.viewId}),(z=e.render)==null||z.push({rect:_tt4,drawCanvas:Yt.Bg,viewId:_this76.viewId})),g&&((et=e.render)==null||et.push({rect:g,isClear:!0,clearCanvas:Yt.ServiceFloat,viewId:_this76.viewId}));I=(x=Q.node)==null?void 0:x.consumeService({op:Q.animationWorkData,isFullWork:_V4});Q.isEnableCursor?n.set(J,{cursorTool:kn(Q.toolsType),workState:_tt4?Q.ops?te.Done:te.Doing:te.Start,op:Q.animationWorkData.slice(-3,-1)}):_V4&&!Q.useAnimation&&(y=Q.updateNodeOpt)!=null&&y.useAnimation&&n.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:Q.animationWorkData.slice(-3,-1),uid:(S=Q.updateNodeOpt)==null?void 0:S.uid}),_V4?(_this76.selectorWorkShapes.forEach(function(B,Z){var st;(st=B.selectIds)!=null&&st.includes(J)&&(_this76.willRunEffectSelectorIds.add(Z),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_tt4),_this76.noAnimationRect=Jt(_this76.noAnimationRect,g),_this76.noAnimationRect=Jt(_this76.noAnimationRect,I),_this76.runEffect());}),(C=Q.node)==null||C.clearTmpPoints(),_this76.workShapes.delete(J),(P=e.render)==null||P.push({rect:I,drawCanvas:Yt.Bg,viewId:_this76.viewId})):(X=e.render)==null||X.push({rect:I,drawCanvas:Yt.ServiceFloat,workerType:_V4?void 0:Kt.Service,viewId:_this76.viewId}),Q.animationWorkData.length=0;}return _context53.a(3,13);case 8:if(!Q.useAnimation){_context53.n=11;break;}if(!Q.useAnimation){_context53.n=10;break;}if(!Q.isDel){_context53.n=9;break;}(O=Q.node)==null||O.clearTmpPoints(),_this76.workShapes.delete(J);return _context53.a(3,13);case 9:_V5=3,_tt5=_this76.computNextAnimationIndex(Q,_V5),_g2=Q.isDiff?0:Math.max(0,(Q.animationIndex||0)-_V5),_I2=(Q.animationWorkData||[]).slice(0,_tt5),B=(_=(U=Q.node)==null?void 0:U.getWorkId())==null?void 0:_.toString();if((Q.animationIndex||0)<_tt5||Q.isDiff){Z=(H=Q.node)==null?void 0:H.consumeService({op:_I2,isFullWork:!1,replaceId:B});if((at=e.render)==null||at.push({isClear:!0,rect:Z,clearCanvas:Yt.ServiceFloat,viewId:_this76.viewId}),(ht=e.render)==null||ht.push({rect:Z,drawCanvas:Yt.ServiceFloat,viewId:_this76.viewId}),Q.animationIndex=_tt5,Q.isDiff&&(Q.isDiff=!1),_I2.length&&Q.isEnableCursor){st=_I2.slice(-3,-1);n.set(J,{cursorTool:kn(Q.toolsType),workState:_g2===0?te.Start:_tt5===((yt=Q.animationWorkData)==null?void 0:yt.length)?te.Done:te.Doing,op:st});}}else if(Q.ops){_Z2=(Et=Q.node)==null?void 0:Et.consumeService({op:Q.animationWorkData||[],isFullWork:!0,replaceId:B});Q.isDel=!0,(Dt=e.render)==null||Dt.push({isClear:!0,rect:_Z2,clearCanvas:Yt.ServiceFloat,viewId:_this76.viewId},{rect:_Z2,drawCanvas:Yt.ServiceFloat,viewId:_this76.viewId},{isClear:!0,rect:_Z2,clearCanvas:Yt.Bg,viewId:_this76.viewId},{rect:_Z2,drawCanvas:Yt.Bg,viewId:_this76.viewId}),Q.isEnableCursor&&n.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:_I2.slice(-3,-1)});}t=!0;return _context53.a(3,13);case 10:_context53.n=12;break;case 11:_V6=!!Q.ops;_tt6=($=Q.node)==null?void 0:$.consumeService({op:Q.animationWorkData||[],isFullWork:_V6,replaceId:J});_g3=(K=Q.node)==null?void 0:K.updataOptService(Q.updateNodeOpt);if(_V6){if(_tt6=Jt(_tt6,_g3),(j=e.render)==null||j.push({isClear:!0,rect:Jt(Q.oldRect,_tt6),clearCanvas:Yt.Bg,viewId:_this76.viewId}),(nt=e.render)==null||nt.push({rect:Jt(Q.oldRect,_tt6),drawCanvas:Yt.Bg,viewId:_this76.viewId}),(ct=Q.updateNodeOpt)!=null&&ct.useAnimation&&((F=e.render)==null||F.push({isClear:!0,rect:Jt(Q.oldRect,_tt6),clearCanvas:Yt.ServiceFloat,viewId:_this76.viewId}),(R=e.render)==null||R.push({rect:Jt(Q.oldRect,_tt6),drawCanvas:Yt.ServiceFloat,viewId:_this76.viewId}),!Q.isEnableCursor&&(Y=Q.animationWorkData)!=null&&Y.length)){_I3=Q.animationWorkData.slice(-3,-1);n.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:_I3,uid:(q=Q.updateNodeOpt)==null?void 0:q.uid});}_this76.selectorWorkShapes.forEach(function(I,B){var Z;(Z=I.selectIds)!=null&&Z.includes(J)&&(_this76.willRunEffectSelectorIds.add(B),_this76.noAnimationRect=Jt(_this76.noAnimationRect,_tt6),_this76.runEffect());}),(lt=Q.node)==null||lt.clearTmpPoints(),_this76.workShapes.delete(J);}else _tt6=Jt(_tt6,_g3),(ut=e.render)==null||ut.push({isClear:!0,rect:Jt(Q.oldRect,_tt6),clearCanvas:Yt.ServiceFloat,viewId:_this76.viewId}),(Tt=e.render)==null||Tt.push({rect:Jt(Q.oldRect,_tt6),drawCanvas:Yt.ServiceFloat,viewId:_this76.viewId});case 12:return _context53.a(3,13);case 13:return _context53.a(2);}},_loop7);});_iterator85.s();case 2:if((_step85=_iterator85.n()).done){_context54.n=4;break;}return _context54.d(_regeneratorValues(_loop7()),3);case 3:_context54.n=2;break;case 4:_context54.n=6;break;case 5:_context54.p=5;_t40=_context54.v;_iterator85.e(_t40);case 6:_context54.p=6;_iterator85.f();return _context54.f(6);case 7:t&&this.runAnimation();n.size&&(e.sp=e.sp||[],n.forEach(function(J,Q){var V;(V=e.sp)==null||V.push({type:xt.Cursor,uid:J.uid||Q.split(Oo)[0],op:J.op,workState:J.workState,cursorTool:J.cursorTool,viewId:_this76.viewId});}));_t41=(D=e.render)!=null&&D.length||(N=e.sp)!=null&&N.length;if(!_t41){_context54.n=8;break;}_context54.n=8;return this.post(e);case 8:return _context54.a(2);}},_callee52,this,[[1,5,6,7]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this77=this;this.animationId||(this.animationId=setTimeout(function(){_this77.animationId=void 0,_this77.animationDraw();},16));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(t,e){var n=Math.floor((t.animationWorkData||[]).slice(t.animationIndex).length*48/e/this.syncUnitTime)*e;return Math.min((t.animationIndex||0)+(n||e),(t.animationWorkData||[]).length);}},{key:"runEffect",value:function runEffect(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0));}},{key:"effectRunSelector",value:function(){var _effectRunSelector=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee53(){var _this78=this;var t,_t42;return _regenerator().w(function(_context55){while(1)switch(_context55.n){case 0:this.runEffectId=void 0;t=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(e){var s,o;var n=_this78.selectorWorkShapes.get(e),i=n&&n.selectIds&&((s=n.node)==null?void 0:s.selectServiceNode(e,n,!0));t=Jt(t,i),(o=n==null?void 0:n.selectIds)!=null&&o.length||_this78.selectorWorkShapes.delete(e);});_t42=t;if(!_t42){_context55.n=1;break;}_context55.n=1;return this.post({render:[{rect:me(t),isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:me(t),drawCanvas:Yt.Bg,viewId:this.viewId}]});case 1:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 2:return _context55.a(2);}},_callee53,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(t){var v,p,w;var e=t.workId,n=t.opt,i=t.toolsType,s=t.type,o=t.selectIds,a=t.imageBitmap;if(!e)return;var u=e.toString();if(!((v=this.selectorWorkShapes)!=null&&v.has(u))){var A={toolsType:i,selectIds:o,type:s,opt:n,imageBitmap:a};i&&n&&(A=this.setNodeKey(u,A,i,n)),(p=this.selectorWorkShapes)==null||p.set(u,A);}var d=(w=this.selectorWorkShapes)==null?void 0:w.get(u);s&&(d.type=s),d.node&&d.node.getWorkId()!==u&&d.node.setWorkId(u),a&&(d.imageBitmap=a),d.selectIds=o||[];}}]);}();var Gbt=/*#__PURE__*/function(_x84){function Gbt(e){var _this79;_classCallCheck(this,Gbt);_this79=_callSuper(this,Gbt,[e]);wt(_this79,"drawWorkActiveId");return _this79;}_inherits(Gbt,_x84);return _createClass(Gbt,[{key:"runSelectWork",value:function runSelectWork(e){var i;var n=this.setFullWork(e);n&&(i=e.selectIds)!=null&&i.length&&e.workId&&n.selectServiceNode(e.workId.toString(),{selectIds:e.selectIds},!1);}},{key:"workShapesDone",value:function workShapesDone(){var _iterator86=_createForOfIteratorHelper(this.workShapes.keys()),_step86;try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){var e=_step86.value;this.clearWorkShapeNodeCache(e);}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}qr(this.fullLayer,this.fullLayer.parent);}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee54(e){var n,i,s,o,a,u,d,_t43,_t44,_t45,_t46,_t47,_t48,_t49,_t50,_t51;return _regenerator().w(function(_context56){while(1)switch(_context56.n){case 0:n=e.workId,i=e.fullWorkerDrawCount,s=e.postCount,o=n==null?void 0:n.toString(),a=o&&this.workShapes.get(o);if(a){_context56.n=4;break;}_t43=o&&Ze(s);if(!_t43){_context56.n=2;break;}_context56.n=1;return this.drawAckBackpressure.wait(o);case 1:_t43=_context56.v;case 2:_t44=_t43;if(!_t44){_context56.n=3;break;}_context56.n=3;return this._post({consumeCount:s,consumeWorkId:o});case 3:return _context56.a(2);case 4:_t45=this.drawWorkActiveId&&this.drawWorkActiveId!==o;if(!_t45){_context56.n=6;break;}_context56.n=5;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:xt.DrawWork,dataType:Kt.Local});case 5:this.drawWorkActiveId=void 0;case 6:!this.drawWorkActiveId&&o!==Fe&&(this.drawWorkActiveId=o);u=a.toolsType;Ze(s)&&(this.consumeCount=s);d=a.consume({data:e,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0,removeDrawCount:i});_t46=u;_context56.n=_t46===It.Selector?7:_t46===It.Ellipse?9:_t46===It.Arrow?9:_t46===It.Straight?9:_t46===It.Rectangle?9:_t46===It.Star?9:_t46===It.Polygon?9:_t46===It.SpeechBalloon?9:_t46===It.Pencil?11:_t46===It.BitMapEraser?13:_t46===It.PencilEraser?13:16;break;case 7:_t47=d;if(!_t47){_context56.n=8;break;}this.drawCount++;_context56.n=8;return this.drawSelector(d);case 8:return _context56.a(3,16);case 9:_t48=d;if(!_t48){_context56.n=10;break;}this.drawCount++;_context56.n=10;return this.drawShape(d);case 10:return _context56.a(3,16);case 11:_t49=d;if(!_t49){_context56.n=12;break;}this.drawCount++;_context56.n=12;return this.drawPencil(d,n==null?void 0:n.toString());case 12:return _context56.a(3,16);case 13:_t50=d;if(!_t50){_context56.n=15;break;}this.drawCount++;_context56.n=14;return this.drawAckBackpressure.wait(o);case 14:_t51=_context56.v;if(!_t51){_context56.n=15;break;}_context56.n=15;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,consumeWorkId:o});case 15:return _context56.a(3,16);case 16:return _context56.a(2);}},_callee54,this);}));function consumeDraw(_x85){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee55(e){var n,i,s,_t52;return _regenerator().w(function(_context57){while(1)switch(_context57.n){case 0:n=e.workId;if(!n){_context57.n=4;break;}i=n.toString();this.drawAckBackpressure.finish(i),this.drawWorkActiveId===i&&(this.drawWorkActiveId=void 0);s=this.workShapes.get(i);if(s){_context57.n=1;break;}return _context57.a(2);case 1:_t52=s.toolsType;_context57.n=_t52===It.Selector?2:_t52===It.Arrow?3:_t52===It.Straight?3:_t52===It.Ellipse?3:_t52===It.Pencil?3:_t52===It.Rectangle?3:_t52===It.Star?3:_t52===It.Polygon?3:_t52===It.SpeechBalloon?3:_t52===It.BitMapEraser?3:_t52===It.PencilEraser?3:4;break;case 2:this.drawCount=0,qr(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(i),this._post({render:[{isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}]});return _context57.a(3,4);case 3:this.drawCount=0,qr(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(i);return _context57.a(3,4);case 4:return _context57.a(2);}},_callee55,this);}));function consumeDrawAll(_x86){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee56(e){var n,i,s,o;return _regenerator().w(function(_context58){while(1)switch(_context58.n){case 0:n=e.workId,i=n==null?void 0:n.toString();if(!i){_context58.n=1;break;}s=this.removeNode(i);if(!s){_context58.n=1;break;}o=[];o.push({rect:me(s),clearCanvas:Yt.Float,isClear:!0,viewId:this.viewId},{rect:me(s),drawCanvas:Yt.Float,viewId:this.viewId});_context58.n=1;return this._post({render:o});case 1:return _context58.a(2);}},_callee56,this);}));function removeWork(_x87){return _removeWork4.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(e){var _this80=this;var n=this.workShapes.has(e);var i;return n&&(this.fullLayer.getElementsByName(e).forEach(function(s){var o=s.getBoundingClientRect();i=Jt(i,{x:o.x-jt.SafeBorderPadding,y:o.y-jt.SafeBorderPadding,w:o.width+jt.SafeBorderPadding*2,h:o.height+jt.SafeBorderPadding*2}),s.remove(),_Ur(s,_this80.fullLayer.parent);}),i&&this.clearWorkShapeNodeCache(e)),i;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee57(e,n){var _t53,_t54;return _regenerator().w(function(_context59){while(1)switch(_context59.n){case 0:_t53=!n;if(_t53){_context59.n=2;break;}_context59.n=1;return this.drawAckBackpressure.wait(n);case 1:_t53=!_context59.v;case 2:_t54=_t53;if(_t54){_context59.n=3;break;}_context59.n=3;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,consumeWorkId:n,render:[{rect:e==null?void 0:e.rect,workId:n,drawCanvas:Yt.Float,viewId:this.viewId}],sp:(e==null?void 0:e.op)&&[e]});case 3:return _context59.a(2);}},_callee57,this);}));function drawPencil(_x88,_x89){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee58(e){return _regenerator().w(function(_context60){while(1)switch(_context60.n){case 0:_context60.n=1;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(e==null?void 0:e.rect)&&me(e.rect),isClear:!0,clearCanvas:Yt.Float,viewId:this.viewId},{rect:(e==null?void 0:e.rect)&&me(e.rect),drawCanvas:Yt.Float,viewId:this.viewId}]});case 1:return _context60.a(2);}},_callee58,this);}));function drawShape(_x90){return _drawShape2.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee59(e){return _regenerator().w(function(_context61){while(1)switch(_context61.n){case 0:_context61.n=1;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(e==null?void 0:e.rect)&&me(e.rect),isClear:!0,clearCanvas:Yt.Float,viewId:this.viewId},{rect:(e==null?void 0:e.rect)&&me(e.rect),drawCanvas:Yt.Float,viewId:this.viewId}]});case 1:return _context61.a(2);}},_callee59,this);}));function drawSelector(_x91){return _drawSelector2.apply(this,arguments);}return drawSelector;}()}]);}(x0);var Hbt=/*#__PURE__*/function(){function Hbt(t){_classCallCheck(this,Hbt);wt(this,"viewId");wt(this,"vNodes");wt(this,"topLayer");wt(this,"thread");wt(this,"post");wt(this,"serviceWorkShapes",/* @__PURE__ */new Map());wt(this,"localWorkShapes",/* @__PURE__ */new Map());wt(this,"tmpOpt");wt(this,"syncUnitTime",zr.syncOpt.interval);wt(this,"animationId");this.viewId=t.viewId,this.vNodes=t.vNodes,this.topLayer=t.topLayer,this.thread=t.thread,this.post=t.thread.post.bind(t.thread);}return _createClass(Hbt,[{key:"canUseTopLayer",value:function canUseTopLayer(t){return t===It.LaserPen;}},{key:"getWorkShape",value:function getWorkShape(t){return this.localWorkShapes.get(t);}},{key:"createWorkShape",value:function createWorkShape(t,e){if(t&&this.tmpOpt){var n={toolsType:this.tmpOpt.toolsType,toolsOpt:e||this.tmpOpt.toolsOpt},i=this.createWorkShapeNode(_objectSpread(_objectSpread({},n),{},{workId:t}));return i&&this.localWorkShapes.set(t,{node:i,toolsType:i.toolsType,workState:te.Start}),i;}}},{key:"setWorkOptions",value:function setWorkOptions(t,e){var i;var n=(i=this.localWorkShapes.get(t))==null?void 0:i.node;n||this.createWorkShape(t,e),n==null||n.setWorkOptions(e);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(t){var e=t.toolsType;if(e===It.LaserPen)return cf(_objectSpread(_objectSpread({},t),{},{vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer}));}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.localWorkShapes.forEach(function(t){var e;return(e=t.node)==null?void 0:e.clearTmpPoints();}),this.localWorkShapes.clear();}},{key:"setToolsOpt",value:function setToolsOpt(t){var e;this.tmpOpt=t,(e=t.toolsOpt)!=null&&e.syncUnitTime&&(this.syncUnitTime=t.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"consumeDraw",value:function consumeDraw(t){var e=t.workId,n=t.dataType;if(n===Kt.Service)this.activeServiceWorkShape(t);else{var i=e==null?void 0:e.toString(),s=i&&this.localWorkShapes.get(i);if(!s)return;var o=s.node.consume({data:t,isFullWork:!1,isSubWorker:!0});o.rect&&(s.totalRect=Jt(o.rect,s.totalRect),s.result=o,s.workState=te.Doing,i&&this.localWorkShapes.set(i,s));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(t){var e=t.workId,n=t.dataType;if(n===Kt.Service)this.activeServiceWorkShape(t);else{var i=e==null?void 0:e.toString(),s=i&&this.localWorkShapes.get(i);if(!s)return;var o=s.node.consumeAll({data:t});s.totalRect=Jt(o.rect,s.totalRect),s.result=o,s.workState=te.Done,i&&this.localWorkShapes.set(i,s);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(t,e,n,i){return e.toolsType=n,e.node=this.createWorkShapeNode({workId:t,toolsType:n,toolsOpt:i}),e;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(t){var w,A;var e=t.workId,n=t.opt,i=t.toolsType,s=t.type,o=t.updateNodeOpt,a=t.ops,u=t.op;if(!e)return;var d=e.toString(),v=(w=this.vNodes.get(d))==null?void 0:w.rect;if(!((A=this.serviceWorkShapes)!=null&&A.has(d))){var M={toolsType:i,animationWorkData:u||[],animationIndex:0,type:s,updateNodeOpt:o,ops:a,oldRect:v};i&&n&&(M=this.setNodeKey(d,M,i,n)),this.serviceWorkShapes.set(d,M);}var p=this.serviceWorkShapes.get(d);s&&(p.type=s),a&&(p.animationWorkData=Os(a),p.ops=a),o&&(p.updateNodeOpt=o),u&&(p.animationWorkData=u),p.node&&p.node.getWorkId()!==d&&p.node.setWorkId(d),v&&(p.oldRect=v),i&&n?(p.toolsType!==i&&i&&n&&this.setNodeKey(d,p,i,n),p.node&&p.node.setWorkOptions(n)):i&&(p.toolsType=i);}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(t,e){var n=Math.floor((t.animationWorkData||[]).slice(t.animationIndex).length*32/e/this.syncUnitTime)*e;return Math.min((t.animationIndex||0)+(n||e),(t.animationWorkData||[]).length);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee60(){var _this81=this;var o,a,u,d,t,e,n,i,s,_iterator87,_step87,_step87$value,v,p,A,M,E,L,_iterator88,_step88,_step88$value,_v10,_p6,w,_A5,_M4,_E4,_L20,_t55,_t56,_t57,_t58;return _regenerator().w(function(_context62){while(1)switch(_context62.p=_context62.n){case 0:this.animationId=void 0;t=!1;e=/* @__PURE__ */new Map(),n=[],i=[],s=[];_iterator87=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context62.p=1;_iterator87.s();case 2:if((_step87=_iterator87.n()).done){_context62.n=6;break;}_step87$value=_slicedToArray(_step87.value,2),v=_step87$value[0],p=_step87$value[1];_t55=p.toolsType;_context62.n=_t55===It.LaserPen?3:5;break;case 3:A=this.computNextAnimationIndex(p,8),M=Math.max(0,p.animationIndex||0),E=(p.animationWorkData||[]).slice(M,A);if((p.animationIndex||0)<A){L=(o=p.node)==null?void 0:o.consumeService({op:E,isFullWork:!1});p.totalRect=Jt(p.totalRect,L),p.animationIndex=A,E.length&&e.set(v,{cursorTool:kn(p.toolsType),workState:M===0?te.Start:A===((a=p.animationWorkData)==null?void 0:a.length)?te.Done:te.Doing,op:E.slice(-2)});}if(!(i.push({isClear:!0,rect:p.totalRect,clearCanvas:Yt.TopFloat,viewId:this.viewId}),n.push({rect:p.totalRect,drawCanvas:Yt.TopFloat,viewId:this.viewId}),p.isDel)){_context62.n=4;break;}(u=p.node)==null||u.clearTmpPoints(),this.serviceWorkShapes.delete(v);return _context62.a(3,5);case 4:p.ops&&p.animationIndex===((d=p.animationWorkData)==null?void 0:d.length)&&!p.isDel&&(this.topLayer.getElementsByName(v.toString())[0]||(p.isDel=!0,this.serviceWorkShapes.set(v,p))),t=!0;return _context62.a(3,5);case 5:_context62.n=2;break;case 6:_context62.n=8;break;case 7:_context62.p=7;_t56=_context62.v;_iterator87.e(_t56);case 8:_context62.p=8;_iterator87.f();return _context62.f(8);case 9:_iterator88=_createForOfIteratorHelper(this.localWorkShapes.entries());_context62.p=10;_iterator88.s();case 11:if((_step88=_iterator88.n()).done){_context62.n=15;break;}_step88$value=_slicedToArray(_step88.value,2),_v10=_step88$value[0],_p6=_step88$value[1];w=_p6.result,_A5=_p6.toolsType,_M4=_p6.totalRect,_E4=_p6.isDel,_L20=_p6.workState;_t57=_A5;_context62.n=_t57===It.LaserPen?12:14;break;case 12:if(!(_M4&&(i.push({isClear:!0,rect:_M4,clearCanvas:Yt.TopFloat,viewId:this.viewId}),n.push({rect:_M4,drawCanvas:Yt.TopFloat,viewId:this.viewId})),_E4)){_context62.n=13;break;}_p6.node.clearTmpPoints(),this.localWorkShapes.delete(_v10),s.push({removeIds:[_v10.toString()],viewId:this.viewId,type:xt.RemoveNode});return _context62.a(3,14);case 13:w&&((w.op||w.ops)&&s.push(w),_p6.result=void 0),!this.topLayer.getElementsByName(_v10.toString())[0]&&_L20===te.Done&&(_p6.isDel=!0,this.localWorkShapes.set(_v10,_p6)),t=!0;return _context62.a(3,14);case 14:_context62.n=11;break;case 15:_context62.n=17;break;case 16:_context62.p=16;_t58=_context62.v;_iterator88.e(_t58);case 17:_context62.p=17;_iterator88.f();return _context62.f(17);case 18:t&&this.runAnimation(),e.size&&e.forEach(function(v,p){s.push({type:xt.Cursor,uid:p.split(Oo)[0],op:v.op,workState:v.workState,cursorTool:v.cursorTool,viewId:_this81.viewId});}),(n.length||i.length||s.length)&&this.post({render:[].concat(i,n),sp:s});case 19:return _context62.a(2);}},_callee60,this,[[10,16,17,18],[1,7,8,9]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this82=this;this.animationId||(this.animationId=setTimeout(function(){_this82.animationId=void 0,_this82.animationDraw();},16));}}]);}();var Vbt=/*#__PURE__*/function(_iI){function Vbt(e){var _this83;_classCallCheck(this,Vbt);_this83=_callSuper(this,Vbt,[e]);wt(_this83,"_type","simple");return _this83;}_inherits(Vbt,_iI);return _createClass(Vbt,[{key:"createWorkShapeNode",value:function createWorkShapeNode(e){var i;var n=e.toolsType;return n===It.Selector?this.vNodes?new Xa(_objectSpread(_objectSpread({},e),{},{fullLayer:this.fullLayer,vNodes:this.vNodes,drawLayer:this.drawLayer})):void 0:cf(_objectSpread(_objectSpread({},e),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(i=this.thread)==null?void 0:i.serviceWork);}},{key:"drawPencil",value:function(){var _drawPencil3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee61(e,n){var _t59,_t60;return _regenerator().w(function(_context63){while(1)switch(_context63.n){case 0:_t59=!n;if(_t59){_context63.n=2;break;}_context63.n=1;return this.drawAckBackpressure.wait(n);case 1:_t59=!_context63.v;case 2:_t60=_t59;if(_t60){_context63.n=3;break;}_context63.n=3;return this._post({consumeCount:this.consumeCount,consumeWorkId:n,render:[{rect:e==null?void 0:e.rect,workId:n,drawCanvas:Yt.Float,viewId:this.viewId}],sp:(e==null?void 0:e.op)&&[e]});case 3:return _context63.a(2);}},_callee61,this);}));function drawPencil(_x92,_x93){return _drawPencil3.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee62(e){return _regenerator().w(function(_context64){while(1)switch(_context64.n){case 0:_context64.n=1;return this._post({consumeCount:this.consumeCount,sp:(e==null?void 0:e.op)&&[e],render:[{rect:(e==null?void 0:e.rect)&&me(e.rect),isClear:!0,clearCanvas:Yt.Float,viewId:this.viewId},{rect:(e==null?void 0:e.rect)&&me(e.rect),drawCanvas:Yt.Float,viewId:this.viewId}]});case 1:return _context64.a(2);}},_callee62,this);}));function drawShape(_x94){return _drawShape3.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee63(e,n,i){var s,a,u,d,v,o,_args65=arguments;return _regenerator().w(function(_context65){while(1)switch(_context65.n){case 0:s=_args65.length>3&&_args65[3]!==undefined?_args65[3]:[];o={render:s,sp:[e],consumeCount:this.consumeCount};(a=o.sp)==null||a.push({type:xt.SelectorTransform,emitEventType:ve.SelectMethod,workState:n});i&&((u=o.sp)==null||u.push({type:xt.None,isLockSentEventCursor:i}));e.subRect&&((d=o.render)==null||d.push({rect:me(e.subRect),isClear:!0,clearCanvas:Yt.Float,viewId:this.viewId},{rect:me(e.subRect),drawCanvas:Yt.Float,viewId:this.viewId}));e.rect&&((v=o.render)==null||v.push({rect:me(e.rect),clearCanvas:Yt.Bg,isClear:!0,viewId:this.viewId},{rect:me(e.rect),drawCanvas:Yt.Bg,viewId:this.viewId}));_context65.n=1;return this._post(o);case 1:return _context65.a(2);}},_callee63,this);}));function drawSelector(_x95,_x96,_x97){return _drawSelector3.apply(this,arguments);}return drawSelector;}()},{key:"drawEraserCombine",value:function(){var _drawEraserCombine2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee64(e){var i,s,o,a,n,u,d,v,p,_iterator89,_step89,_step89$value,_p7,w;return _regenerator().w(function(_context66){while(1)switch(_context66.n){case 0:n=(i=this.workShapes.get(e))==null?void 0:i.combineConsume({workerEngine:this});if(!n){_context66.n=1;break;}u=n.willDeleteNodes,d=n.willNewNodes,v={render:[],sp:[]};if(n!=null&&n.rect){p=me(n.rect);(s=v.render)==null||s.push({rect:p,isClear:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{rect:p,drawCanvas:Yt.Bg,viewId:this.viewId});}if(u!=null&&u.size&&((o=v.sp)==null||o.push({type:xt.RemoveNode,removeIds:_toConsumableArray(u),viewId:this.thread.viewId})),d!=null&&d.size){_iterator89=_createForOfIteratorHelper(d);try{for(_iterator89.s();!(_step89=_iterator89.n()).done;){_step89$value=_slicedToArray(_step89.value,2),_p7=_step89$value[0],w=_step89$value[1];(a=v.sp)==null||a.push({type:xt.FullWork,dataType:Kt.Local,toolsType:It.Pencil,ops:Br(w.op),opt:w.opt,workId:_p7,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator89.e(err);}finally{_iterator89.f();}}_context66.n=1;return this._post(v);case 1:return _context66.a(2);}},_callee64,this);}));function drawEraserCombine(_x98){return _drawEraserCombine2.apply(this,arguments);}return drawEraserCombine;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee65(e,n){var _this84=this;var i,s,o,a,u,d,v,p,w,_t61,_t62,_t63,_t64;return _regenerator().w(function(_context67){while(1)switch(_context67.n){case 0:i=e.op,s=e.workId,o=e.scenePath,a=e.postCount,u=e.smoothSync;if(!(i!=null&&i.length&&s)){_context67.n=16;break;}d=s.toString(),v=this.getWorkShape(d);if(v){_context67.n=1;break;}return _context67.a(2);case 1:p=v.toolsType;if(!(p===It.LaserPen)){_context67.n=2;break;}return _context67.a(2);case 2:_t61=this.drawWorkActiveId&&this.drawWorkActiveId!==d;if(!_t61){_context67.n=4;break;}_context67.n=3;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:o,viewId:this.viewId,msgType:xt.DrawWork,dataType:Kt.Local},n);case 3:this.drawWorkActiveId=void 0;case 4:!this.drawWorkActiveId&&d!==Fe&&(this.drawWorkActiveId=d);Ze(a)&&(this.consumeCount=a);w=v.consume({data:e,isSimpleWorker:!0,smoothSync:u});_t62=p;_context67.n=_t62===It.Selector?5:_t62===It.PencilEraser?7:_t62===It.BitMapEraser?7:_t62===It.Eraser?10:_t62===It.Arrow?12:_t62===It.Straight?12:_t62===It.Ellipse?12:_t62===It.Rectangle?12:_t62===It.Star?12:_t62===It.Polygon?12:_t62===It.SpeechBalloon?12:_t62===It.Pencil?14:16;break;case 5:this.drawCount++;w.type===xt.Select&&w.selectIds&&n.runReverseSelectWork(w.selectIds);_context67.n=6;return this.drawSelector(_objectSpread(_objectSpread({},w),{},{isSelecting:!0}),e.workState||te.Doing);case 6:return _context67.a(3,16);case 7:this.drawCount++;this.combineDrawActiveId=d;this.eraserBatchScheduler.schedule(function(){_this84.drawEraserCombine(d);},this.eraserBatchDelay);_context67.n=8;return this.drawAckBackpressure.wait(d);case 8:_t63=_context67.v;if(!_t63){_context67.n=9;break;}_context67.n=9;return this._post({consumeCount:this.consumeCount,consumeWorkId:d});case 9:return _context67.a(3,16);case 10:_context67.n=11;return this.drawEraser(w);case 11:return _context67.a(3,16);case 12:_t64=w;if(!_t64){_context67.n=13;break;}this.drawCount++;_context67.n=13;return this.drawShape(w);case 13:return _context67.a(3,16);case 14:this.drawCount++;_context67.n=15;return this.drawPencil(w,d);case 15:return _context67.a(3,16);case 16:return _context67.a(2);}},_callee65,this);}));function consumeDraw(_x99,_x100){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee66(e,n){var a,u,d,i,s,o,v,p,w,A,M,E,L,_t65;return _regenerator().w(function(_context68){while(1)switch(_context68.n){case 0:this.eraserBatchScheduler.cancel(),this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);i=e.workId,s=e.scenePath,o=e.isLockSentEventCursor;if(!i){_context68.n=10;break;}v=i.toString();this.drawAckBackpressure.finish(v),this.combineDrawActiveId===v&&(this.combineDrawActiveId=void 0),this.drawWorkActiveId===v&&(this.drawWorkActiveId=void 0);p=this.workShapes.get(v);if(p){_context68.n=1;break;}return _context68.a(2);case 1:w=p.toolsType;if(!(w===It.LaserPen)){_context68.n=2;break;}return _context68.a(2);case 2:A=this.workShapes.get(Po),M=(a=A==null?void 0:A.selectIds)==null?void 0:a[0],E=p.consumeAll({data:e,workerEngine:this});_t65=w;_context68.n=_t65===It.Selector?3:_t65===It.PencilEraser?5:_t65===It.BitMapEraser?5:_t65===It.Eraser?7:_t65===It.Arrow?8:_t65===It.Straight?8:_t65===It.Ellipse?8:_t65===It.Rectangle?8:_t65===It.Star?8:_t65===It.Polygon?8:_t65===It.SpeechBalloon?8:_t65===It.Pencil?8:10;break;case 3:L=[];this.drawLayer&&(this.drawCount=0,qr(this.drawLayer,this.drawLayer.parent),this.getWorkShape(v).clearSubTmpPoints(),L.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}));E.selectIds&&M&&(u=E.selectIds)!=null&&u.includes(M)&&A.cursorBlur();E.selectIds&&n.runReverseSelectWork(E.selectIds);_context68.n=4;return this.drawSelector(_objectSpread(_objectSpread({},E),{},{scenePath:s,isSelecting:!1}),te.Done,o,L);case 4:(d=p.selectIds)!=null&&d.length?p.clearTmpPoints():this.clearWorkShapeNodeCache(v);return _context68.a(3,10);case 5:_context68.n=6;return this.drawEraserFull(p,_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker);case 6:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context68.a(3,10);case 7:this.drawEraser(_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker),p.clearTmpPoints();return _context68.a(3,10);case 8:_context68.n=9;return this.drawPencilFull(_objectSpread(_objectSpread({},E),{},{scenePath:s}),o,e.needUndoTicker,w);case 9:this.drawCount=0;this.clearWorkShapeNodeCache(v);return _context68.a(3,10);case 10:return _context68.a(2);}},_callee66,this);}));function consumeDrawAll(_x101,_x102){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()}]);}(iI);var Zbt=/*#__PURE__*/function(_sI){function Zbt(e){var _this85;_classCallCheck(this,Zbt);_this85=_callSuper(this,Zbt,[e]);wt(_this85,"_type","simple");return _this85;}_inherits(Zbt,_sI);return _createClass(Zbt,[{key:"animationDraw",value:function(){var _animationDraw3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee67(){var _this86=this;var s,o,a,u,d,v,p,w,A,M,E,L,G,z,et,x,y,S,C,P,X,$,K,j,nt,ct,F,R,Y,q,lt,ut,Tt,O,U,_,H,at,ht,yt,Et,Dt,D,N,e,n,i,_iterator90,_step90,_loop8,_t67,_t68;return _regenerator().w(function(_context70){while(1)switch(_context70.p=_context70.n){case 0:this.animationId=void 0;e=!1;n={render:[]},i=/* @__PURE__ */new Map();_iterator90=_createForOfIteratorHelper(this.workShapes.entries());_context70.p=1;_loop8=/*#__PURE__*/_regenerator().m(function _loop8(){var _step90$value,J,Q,V,tt,_V7,_tt7,_V8,_tt8,_V9,_tt9,g,I,_V0,_tt0,_g4,_I4,B,Z,st,_Z3,_V1,_tt1,_g5,_I5,_t66;return _regenerator().w(function(_context69){while(1)switch(_context69.n){case 0:_step90$value=_slicedToArray(_step90.value,2),J=_step90$value[0],Q=_step90$value[1];_t66=Q.toolsType;_context69.n=_t66===It.BackgroundSVG?1:_t66===It.Image?2:_t66===It.Text?4:_t66===It.Arrow?7:_t66===It.Straight?7:_t66===It.Rectangle?7:_t66===It.Ellipse?7:_t66===It.Star?7:_t66===It.Polygon?7:_t66===It.SpeechBalloon?7:_t66===It.Pencil?8:13;break;case 1:V=Q.oldRect;V&&((s=n.render)==null||s.push({rect:V,isClear:!0,clearCanvas:Yt.Bg,viewId:_this86.viewId}),(o=n.render)==null||o.push({rect:V,drawCanvas:Yt.Bg,viewId:_this86.viewId}));tt=Q.node.consumeService({isFullWork:!0,replaceId:J});_this86.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this86.willRunEffectSelectorIds.add(I),_this86.noAnimationRect=Jt(_this86.noAnimationRect,V),_this86.noAnimationRect=Jt(_this86.noAnimationRect,tt),_this86.runEffect());}),_this86.workShapes.delete(J),(a=n.render)==null||a.push({rect:tt,drawCanvas:Yt.Bg,viewId:_this86.viewId});return _context69.a(3,13);case 2:_V7=Q.oldRect;_V7&&((u=n.render)==null||u.push({rect:_V7,isClear:!0,clearCanvas:Yt.Bg,viewId:_this86.viewId}),(d=n.render)==null||d.push({rect:_V7,drawCanvas:Yt.Bg,viewId:_this86.viewId}));_context69.n=3;return(v=Q.node)==null?void 0:v.consumeServiceAsync({isFullWork:!0,worker:_this86.thread});case 3:_tt7=_context69.v;_this86.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this86.willRunEffectSelectorIds.add(I),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_V7),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_tt7),_this86.runEffect());}),_this86.workShapes.delete(J),(p=n.render)==null||p.push({rect:_tt7,drawCanvas:Yt.Bg,viewId:_this86.viewId});return _context69.a(3,13);case 4:if(!Q.node){_context69.n=6;break;}_V8=Q.oldRect;_V8&&((w=n.render)==null||w.push({rect:_V8,isClear:!0,clearCanvas:Yt.Bg,viewId:_this86.viewId}),(A=n.render)==null||A.push({rect:_V8,drawCanvas:Yt.Bg,viewId:_this86.viewId}));_context69.n=5;return Q.node.consumeServiceAsync({isFullWork:!0,replaceId:J,boxRect:_this86.thread.getSceneRect()});case 5:_tt8=_context69.v;_this86.selectorWorkShapes.forEach(function(g,I){var B;(B=g.selectIds)!=null&&B.includes(J)&&(_this86.willRunEffectSelectorIds.add(I),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_V8),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_tt8),_this86.runEffect());}),Q.refreshTextRender&&Q.requestId&&(n.sp=n.sp||[],n.sp.push({type:xt.RefreshTextRender,requestId:Q.requestId,workId:J,viewId:_this86.viewId})),(M=Q.node)==null||M.clearTmpPoints(),_this86.workShapes.delete(J),(E=n.render)==null||E.push({rect:_tt8,drawCanvas:Yt.Bg,viewId:_this86.viewId});case 6:return _context69.a(3,13);case 7:_V9=!!Q.ops;if((L=Q.animationWorkData)!=null&&L.length){_tt9=Q.oldRect,g=Q.node.oldRect;_tt9&&((G=n.render)==null||G.push({rect:_tt9,isClear:!0,clearCanvas:Yt.Bg,viewId:_this86.viewId}),(z=n.render)==null||z.push({rect:_tt9,drawCanvas:Yt.Bg,viewId:_this86.viewId})),g&&((et=n.render)==null||et.push({rect:g,isClear:!0,clearCanvas:Yt.ServiceFloat,viewId:_this86.viewId}));I=(x=Q.node)==null?void 0:x.consumeService({op:Q.animationWorkData,isFullWork:_V9});Q.isEnableCursor?i.set(J,{cursorTool:kn(Q.toolsType),workState:_tt9?Q.ops?te.Done:te.Doing:te.Start,op:Q.animationWorkData.slice(-3,-1)}):_V9&&!Q.useAnimation&&(y=Q.updateNodeOpt)!=null&&y.useAnimation&&i.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:Q.animationWorkData.slice(-3,-1),uid:(S=Q.updateNodeOpt)==null?void 0:S.uid}),_V9?(_this86.selectorWorkShapes.forEach(function(B,Z){var st;(st=B.selectIds)!=null&&st.includes(J)&&(_this86.willRunEffectSelectorIds.add(Z),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_tt9),_this86.noAnimationRect=Jt(_this86.noAnimationRect,g),_this86.noAnimationRect=Jt(_this86.noAnimationRect,I),_this86.runEffect());}),(C=Q.node)==null||C.clearTmpPoints(),_this86.workShapes.delete(J),(P=n.render)==null||P.push({rect:I,drawCanvas:Yt.Bg,viewId:_this86.viewId})):(X=n.render)==null||X.push({rect:I,drawCanvas:Yt.ServiceFloat,workerType:_V9?void 0:Kt.Service,viewId:_this86.viewId}),Q.animationWorkData.length=0;}return _context69.a(3,13);case 8:if(!Q.useAnimation){_context69.n=11;break;}if(!Q.useAnimation){_context69.n=10;break;}if(!Q.isDel){_context69.n=9;break;}(O=Q.node)==null||O.clearTmpPoints(),_this86.workShapes.delete(J);return _context69.a(3,13);case 9:_V0=3,_tt0=_this86.computNextAnimationIndex(Q,_V0),_g4=Q.isDiff?0:Math.max(0,(Q.animationIndex||0)-_V0),_I4=(Q.animationWorkData||[]).slice(0,_tt0),B=(_=(U=Q.node)==null?void 0:U.getWorkId())==null?void 0:_.toString();if((Q.animationIndex||0)<_tt0||Q.isDiff){Z=(H=Q.node)==null?void 0:H.consumeService({op:_I4,isFullWork:!1,replaceId:B});if((at=n.render)==null||at.push({isClear:!0,rect:Z,clearCanvas:Yt.ServiceFloat,viewId:_this86.viewId}),(ht=n.render)==null||ht.push({rect:Z,drawCanvas:Yt.ServiceFloat,viewId:_this86.viewId}),Q.animationIndex=_tt0,Q.isDiff&&(Q.isDiff=!1),_I4.length&&Q.isEnableCursor){st=_I4.slice(-3,-1);i.set(J,{cursorTool:kn(Q.toolsType),workState:_g4===0?te.Start:_tt0===((yt=Q.animationWorkData)==null?void 0:yt.length)?te.Done:te.Doing,op:st});}}else if(Q.ops){_Z3=(Et=Q.node)==null?void 0:Et.consumeService({op:Q.animationWorkData||[],isFullWork:!0,replaceId:B});Q.isDel=!0,(Dt=n.render)==null||Dt.push({isClear:!0,rect:_Z3,clearCanvas:Yt.ServiceFloat,viewId:_this86.viewId},{rect:_Z3,drawCanvas:Yt.ServiceFloat,viewId:_this86.viewId},{isClear:!0,rect:_Z3,clearCanvas:Yt.Bg,viewId:_this86.viewId},{rect:_Z3,drawCanvas:Yt.Bg,viewId:_this86.viewId}),Q.isEnableCursor&&i.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:_I4.slice(-3,-1)});}e=!0;return _context69.a(3,13);case 10:_context69.n=12;break;case 11:_V1=!!Q.ops;_tt1=($=Q.node)==null?void 0:$.consumeService({op:Q.animationWorkData||[],isFullWork:_V1,replaceId:J});_g5=(K=Q.node)==null?void 0:K.updataOptService(Q.updateNodeOpt);if(_V1){if(_tt1=Jt(_tt1,_g5),(j=n.render)==null||j.push({isClear:!0,rect:Jt(Q.oldRect,_tt1),clearCanvas:Yt.Bg,viewId:_this86.viewId}),(nt=n.render)==null||nt.push({rect:Jt(Q.oldRect,_tt1),drawCanvas:Yt.Bg,viewId:_this86.viewId}),(ct=Q.updateNodeOpt)!=null&&ct.useAnimation&&((F=n.render)==null||F.push({isClear:!0,rect:Jt(Q.oldRect,_tt1),clearCanvas:Yt.ServiceFloat,viewId:_this86.viewId}),(R=n.render)==null||R.push({rect:Jt(Q.oldRect,_tt1),drawCanvas:Yt.ServiceFloat,viewId:_this86.viewId}),!Q.isEnableCursor&&(Y=Q.animationWorkData)!=null&&Y.length)){_I5=Q.animationWorkData.slice(-3,-1);i.set(J,{cursorTool:kn(Q.toolsType),workState:te.Done,op:_I5,uid:(q=Q.updateNodeOpt)==null?void 0:q.uid});}_this86.selectorWorkShapes.forEach(function(I,B){var Z;(Z=I.selectIds)!=null&&Z.includes(J)&&(_this86.willRunEffectSelectorIds.add(B),_this86.noAnimationRect=Jt(_this86.noAnimationRect,_tt1),_this86.runEffect());}),(lt=Q.node)==null||lt.clearTmpPoints(),_this86.workShapes.delete(J);}else _tt1=Jt(_tt1,_g5),(ut=n.render)==null||ut.push({isClear:!0,rect:Jt(Q.oldRect,_tt1),clearCanvas:Yt.ServiceFloat,viewId:_this86.viewId}),(Tt=n.render)==null||Tt.push({rect:Jt(Q.oldRect,_tt1),drawCanvas:Yt.ServiceFloat,viewId:_this86.viewId});case 12:return _context69.a(3,13);case 13:return _context69.a(2);}},_loop8);});_iterator90.s();case 2:if((_step90=_iterator90.n()).done){_context70.n=4;break;}return _context70.d(_regeneratorValues(_loop8()),3);case 3:_context70.n=2;break;case 4:_context70.n=6;break;case 5:_context70.p=5;_t67=_context70.v;_iterator90.e(_t67);case 6:_context70.p=6;_iterator90.f();return _context70.f(6);case 7:e&&this.runAnimation();i.size&&(n.sp=n.sp||[],i.forEach(function(J,Q){var V;(V=n.sp)==null||V.push({type:xt.Cursor,uid:J.uid||Q.split(Oo)[0],op:J.op,workState:J.workState,cursorTool:J.cursorTool,viewId:_this86.viewId});}));_t68=(D=n.render)!=null&&D.length||(N=n.sp)!=null&&N.length;if(!_t68){_context70.n=8;break;}_context70.n=8;return this.post(n);case 8:return _context70.a(2);}},_callee67,this,[[1,5,6,7]]);}));function animationDraw(){return _animationDraw3.apply(this,arguments);}return animationDraw;}()}]);}(sI);var oI=/*#__PURE__*/function(_x103){function oI(e){var _this87;_classCallCheck(this,oI);_this87=_callSuper(this,oI,[e]);wt(_this87,"opt");wt(_this87,"scene");wt(_this87,"cameraOpt");wt(_this87,"vNodes");_this87.opt=e,_this87.vNodes=void 0;return _this87;}_inherits(oI,_x103);return _createClass(oI,[{key:"createSnapshotFullLayer",value:function createSnapshotFullLayer(e,n){this.scene=this.opt.createScene(e),this.fullLayer=this.opt.createLayer("snapshotFullLayer",this.scene,n);}},{key:"destroySnapshotFullLayer",value:function destroySnapshotFullLayer(){var e,n,i;qr(this.fullLayer,this.fullLayer.parent),(e=this.fullLayer)==null||e.disconnect(),(n=this.fullLayer)==null||n.remove(),(i=this.scene)==null||i.remove(),this.scene=void 0;}},{key:"updateScene",value:function updateScene(e){if(!this.scene)throw new Error("SnapshotWork scene is not initialized");this.scene.attr(_objectSpread({},e));var n=e.width,i=e.height;this.scene.width=n,this.scene.height=i,this.updateLayer({width:n,height:i});}},{key:"updateLayer",value:function updateLayer(e){if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");var n=e.width,i=e.height;this.fullLayer.parent.setAttribute("width",n),this.fullLayer.parent.setAttribute("height",i),this.fullLayer.setAttribute("size",[n,i]),this.fullLayer.setAttribute("pos",[n*0.5,i*0.5]);}},{key:"setCameraOpt",value:function setCameraOpt(e){this.cameraOpt=e;var n=e.scale,i=e.centerX,s=e.centerY,o=e.width,a=e.height;if(!this.scene)throw new Error("SnapshotWork scene is not initialized");if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");(o!==this.scene.width||a!==this.scene.height)&&this.updateScene({width:o,height:a}),this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-s]);}},{key:"getOffscreen",value:function getOffscreen(){var n;return((n=this.fullLayer)==null?void 0:n.parent).canvas;}},{key:"getRectImageBitmap",value:function getRectImageBitmap(e,n){var i=e.rect,s=this.thread.dpr,o=Math.floor(i.x*s),a=Math.floor(i.y*s),u=Math.floor(i.w*s),d=Math.floor(i.h*s);return createImageBitmap(this.getOffscreen(),o,a,u,d,n);}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee68(e){var n,i,s,o,a,_i0,_Object$entries,_Object$entries$_i,d,v,p,w,u,_v11,_t69,_t70;return _regenerator().w(function(_context71){while(1)switch(_context71.p=_context71.n){case 0:n=e.scenePath,i=e.scenes,s=e.cameraOpt,o=e.w,a=e.h;if(!(n&&i&&s&&this.fullLayer)){_context71.n=9;break;}this.setCameraOpt(s);_i0=0,_Object$entries=Object.entries(i);case 1:if(!(_i0<_Object$entries.length)){_context71.n=5;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i0],2),d=_Object$entries$_i[0],v=_Object$entries$_i[1];if(!(v!=null&&v.type)){_context71.n=4;break;}_t69=v==null?void 0:v.type;_context71.n=_t69===xt.UpdateNode?2:_t69===xt.FullWork?2:4;break;case 2:p=v.opt,w=_objectSpread(_objectSpread({},v),{},{opt:p,workId:d,msgType:xt.FullWork,dataType:Kt.Service,viewId:this.viewId});_context71.n=3;return this.runFullWork(w);case 3:return _context71.a(3,4);case 4:_i0++;_context71.n=1;break;case 5:o&&a&&(u={resizeWidth:o,resizeHeight:a});_context71.p=6;_context71.n=7;return this.getSnapshotRender({scenePath:n,options:u});case 7:_context71.n=9;break;case 8:_context71.p=8;_t70=_context71.v;_v11=_t70&&_t70 instanceof Error?_t70.message:_t70==null?void 0:_t70.toString();console.error("[SnapshotWork] getSnapshotRender error",_v11),this.thread._post({sp:[{type:xt.ReportError,reportString:"[SnapshotWork] getSnapshotRender error: ".concat(_v11)}]});case 9:return _context71.a(2);}},_callee68,this,[[6,8]]);}));function getSnapshot(_x104){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee69(e){var s,n,i,o,a,u;return _regenerator().w(function(_context72){while(1)switch(_context72.n){case 0:n=this.setFullWork(e),i=e.ops&&Os(e.ops);if(!n){_context72.n=7;break;}u=(s=n.getWorkId())==null?void 0:s.toString();if(!(n.toolsType===It.BackgroundSVG)){_context72.n=1;break;}o=n.consumeService({isFullWork:!0,replaceId:u});_context72.n=6;break;case 1:if(!(n.toolsType===It.Image)){_context72.n=3;break;}_context72.n=2;return n.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 2:o=_context72.v;_context72.n=6;break;case 3:if(!(n.toolsType===It.Text)){_context72.n=5;break;}_context72.n=4;return n.consumeServiceAsync({isFullWork:!0,replaceId:u,isDrawLabel:!0});case 4:o=_context72.v;_context72.n=6;break;case 5:o=n.consumeService({op:i,isFullWork:!0,replaceId:u}),a=(e==null?void 0:e.updateNodeOpt)&&n.updataOptService(e.updateNodeOpt);case 6:e.workId&&this.workShapes.delete(e.workId.toString());return _context72.a(2,Jt(o,a));case 7:return _context72.a(2);}},_callee69,this);}));function runFullWork(_x105){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{key:"getSceneRect",value:function getSceneRect(){if(!this.scene)throw new Error("SnapshotWork scene is not initialized");var _this$scene2=this.scene,e=_this$scene2.width,n=_this$scene2.height;return{x:0,y:0,w:Math.floor(e),h:Math.floor(n)};}},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee70(e){var o,n,i,s;return _regenerator().w(function(_context73){while(1)switch(_context73.n){case 0:n=e.scenePath,i=e.options;((o=this.fullLayer)==null?void 0:o.parent).render();_context73.n=1;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:Yt.None},i);case 1:s=_context73.v;s&&(this.thread._post({sp:[{type:xt.Snapshot,scenePath:n,imageBitmap:s,viewId:this.viewId,index:0}]},[s]),s.close());case 2:return _context73.a(2);}},_callee70,this);}));function getSnapshotRender(_x106){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee71(e){var n,i,s,o,_i1,_Object$entries2,_Object$entries2$_i,a,u,d,_t71;return _regenerator().w(function(_context74){while(1)switch(_context74.n){case 0:n=e.scenePath,i=e.scenes,s=e.cameraOpt;if(!(n&&i&&s&&this.fullLayer)){_context74.n=6;break;}this.setCameraOpt(s);_i1=0,_Object$entries2=Object.entries(i);case 1:if(!(_i1<_Object$entries2.length)){_context74.n=5;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i1],2),a=_Object$entries2$_i[0],u=_Object$entries2$_i[1];if(!(u!=null&&u.type)){_context74.n=4;break;}_t71=u==null?void 0:u.type;_context74.n=_t71===xt.UpdateNode?2:_t71===xt.FullWork?2:4;break;case 2:_context74.n=3;return this.runFullWork(_objectSpread(_objectSpread({},u),{},{workId:a,msgType:xt.FullWork,dataType:Kt.Service,viewId:this.viewId}));case 3:d=_context74.v;o=Jt(o,d);return _context74.a(3,4);case 4:_i1++;_context74.n=1;break;case 5:o&&this.thread._post({sp:[{type:xt.BoundingBox,scenePath:n,rect:o,viewId:this.viewId}]});case 6:return _context74.a(2);}},_callee71,this);}));function getBoundingRect(_x107){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(x0);var Tu=/* @__PURE__ */function(r){return r.Full="full",r.Sub="sub",r;}(Tu||{});var qbt=/*#__PURE__*/function(){function qbt(t,e,n){var _this88=this;_classCallCheck(this,qbt);wt(this,"_self");wt(this,"version",mS);wt(this,"type");wt(this,"createEngine");// protected hasPriorityDraw: boolean = true;
|
|
490
|
+
wt(this,"workThreadMap",/* @__PURE__ */new Map());wt(this,"cameraRenderQueueByView",/* @__PURE__ */new Map());wt(this,"viewGenerationById",/* @__PURE__ */new Map());wt(this,"post",function(t,e){e?_this88._self.postMessage(t,e):_this88._self.postMessage(t);});this._self=t,this.type=e,this.createEngine=n,this.register();}return _createClass(qbt,[{key:"enqueueViewTask",value:function enqueueViewTask(t,e){var i=(this.cameraRenderQueueByView.get(t)||Promise.resolve()).catch(function(){}).then(e);return this.cameraRenderQueueByView.set(t,i),i;}},{key:"init",value:function(){var _init=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee73(t){var _this89=this;var e,n,i,s,o,_t72;return _regenerator().w(function(_context76){while(1)switch(_context76.n){case 0:e=t.viewId,n=t.dpr,i=t.offscreenCanvasOpt,s=t.layerOpt,o=t.isSafari;_t72=!n||!i||!s;if(_t72){_context76.n=1;break;}_context76.n=1;return this.enqueueViewTask(e,/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee72(){var _t$viewGeneration;var a,u,d;return _regenerator().w(function(_context75){while(1)switch(_context75.n){case 0:a=(_t$viewGeneration=t.viewGeneration)!==null&&_t$viewGeneration!==void 0?_t$viewGeneration:(_this89.viewGenerationById.get(e)||0)+1;_this89.viewGenerationById.set(e,a);u=_this89.createEngine(t,_this89.post);u&&o&&u.setIsSafari(o),u&&t.cameraOpt&&u.setCameraOpt(t.cameraOpt);d=_this89.workThreadMap.get(e);d==null||d.destroy(),u&&_this89.workThreadMap.set(e,u);case 1:return _context75.a(2);}},_callee72);})));case 1:return _context76.a(2);}},_callee73,this);}));function init(_x108){return _init.apply(this,arguments);}return init;}()},{key:"getFontFaceCssValue",value:function getFontFaceCssValue(t){return"12px \"".concat(t.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),"\"");}},{key:"setFontFaces",value:function(){var _setFontFaces=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee74(t,e){var _this90=this;var n,i,_iterator91,_step91,_loop9,_t76;return _regenerator().w(function(_context78){while(1)switch(_context78.p=_context78.n){case 0:n=[],i=[];_iterator91=_createForOfIteratorHelper(t);_context78.p=1;_loop9=/*#__PURE__*/_regenerator().m(function _loop9(){var s,o,a,u,v,d,p,w,A,M,_t73,_t74,_t75;return _regenerator().w(function(_context77){while(1)switch(_context77.p=_context77.n){case 0:s=_step91.value;o=s.fontFamily,a=s.buffer;_context77.p=1;if(!(!a||a.byteLength===0)){_context77.n=2;break;}throw new Error("Invalid font data for ".concat(o,": empty buffer"));case 2:try{u=new FontFace(o,a);}catch(_unused25){v=new Uint8Array(a);u=new FontFace(o,v);}d=_this90._self.fonts;if(d){_context77.n=3;break;}throw new Error("Worker FontFaceSet is unavailable");case 3:_context77.n=4;return u.load();case 4:d.add(u);_context77.p=5;_context77.n=6;return u.loaded;case 6:n.push(o);_context77.n=19;break;case 7:_context77.p=7;_t73=_context77.v;p=_this90._self.fonts;if(!(p&&typeof p.load=="function")){_context77.n=16;break;}_context77.p=8;w=p.load(_this90.getFontFaceCssValue(o));A=new Promise(function(E,L){return setTimeout(function(){return L(new Error("Font load timeout for ".concat(o)));},5e3);});_context77.n=9;return Promise.race([w,A]);case 9:M=_context77.v;if(!(M&&M.length>0)){_context77.n=10;break;}n.push(o);_context77.n=11;break;case 10:throw new Error("Font ".concat(o," load returned empty result"));case 11:_context77.n=15;break;case 12:_context77.p=12;_t74=_context77.v;_context77.n=13;return _this90.isFontAvailable(o);case 13:if(!_context77.v){_context77.n=14;break;}n.push(o);_context77.n=15;break;case 14:throw _t74;case 15:_context77.n=19;break;case 16:_context77.n=17;return _this90.isFontAvailable(o);case 17:if(!_context77.v){_context77.n=18;break;}n.push(o);_context77.n=19;break;case 18:throw _t73;case 19:_context77.n=21;break;case 20:_context77.p=20;_t75=_context77.v;console.error("Font ".concat(o," load error: ").concat(_t75)),i.push(o);case 21:return _context77.a(2);}},_loop9,null,[[8,12],[5,7],[1,20]]);});_iterator91.s();case 2:if((_step91=_iterator91.n()).done){_context78.n=4;break;}return _context78.d(_regeneratorValues(_loop9()),3);case 3:_context78.n=2;break;case 4:_context78.n=6;break;case 5:_context78.p=5;_t76=_context78.v;_iterator91.e(_t76);case 6:_context78.p=6;_iterator91.f();return _context78.f(6);case 7:this.post({sp:[{type:xt.SetFontFace,requestId:e,setFontFaceResult:i.length===0,failedFonts:i.length>0?i:void 0}]});case 8:return _context78.a(2);}},_callee74,this,[[1,5,6,7]]);}));function setFontFaces(_x109,_x110){return _setFontFaces.apply(this,arguments);}return setFontFaces;}()// 检查字体是否可用
|
|
491
|
+
},{key:"isFontAvailable",value:function(){var _isFontAvailable=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee75(t){var e,n,i,_iterator92,_step92,_s1,s,_t77,_t78,_t79,_t80;return _regenerator().w(function(_context79){while(1)switch(_context79.p=_context79.n){case 0:_context79.p=0;e=this._self.fonts;if(e){_context79.n=1;break;}return _context79.a(2,!1);case 1:n=!1,i=null;_iterator92=_createForOfIteratorHelper(e);_context79.p=2;_iterator92.s();case 3:if((_step92=_iterator92.n()).done){_context79.n=5;break;}_s1=_step92.value;if(!(_s1.family===t)){_context79.n=4;break;}n=!0,i=_s1;return _context79.a(3,5);case 4:_context79.n=3;break;case 5:_context79.n=7;break;case 6:_context79.p=6;_t77=_context79.v;_iterator92.e(_t77);case 7:_context79.p=7;_iterator92.f();return _context79.f(7);case 8:if(!(!n||!i)){_context79.n=9;break;}return _context79.a(2,!1);case 9:if(!(i.status==="loaded")){_context79.n=10;break;}return _context79.a(2,!0);case 10:_context79.p=10;_context79.n=11;return i.loaded;case 11:return _context79.a(2,!0);case 12:_context79.p=12;_t78=_context79.v;if(!(e&&typeof e.load=="function")){_context79.n=16;break;}_context79.p=13;_context79.n=14;return e.load(this.getFontFaceCssValue(t));case 14:s=_context79.v;return _context79.a(2,s&&s.length>0);case 15:_context79.p=15;_t79=_context79.v;return _context79.a(2,!1);case 16:return _context79.a(2,!0);case 17:_context79.n=19;break;case 18:_context79.p=18;_t80=_context79.v;return _context79.a(2,!1);case 19:return _context79.a(2);}},_callee75,this,[[13,15],[10,12],[2,6,7,8],[0,18]]);}));function isFontAvailable(_x111){return _isFontAvailable.apply(this,arguments);}return isFontAvailable;}()},{key:"areFontFacesAvailable",value:function(){var _areFontFacesAvailable=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee76(){var t,_iterator93,_step93,e,_args80=arguments,_t81;return _regenerator().w(function(_context80){while(1)switch(_context80.p=_context80.n){case 0:t=_args80.length>0&&_args80[0]!==undefined?_args80[0]:[];_iterator93=_createForOfIteratorHelper(t);_context80.p=1;_iterator93.s();case 2:if((_step93=_iterator93.n()).done){_context80.n=5;break;}e=_step93.value;_context80.n=3;return this.isFontAvailable(e.fontFamily);case 3:if(_context80.v){_context80.n=4;break;}return _context80.a(2,!1);case 4:_context80.n=2;break;case 5:_context80.n=7;break;case 6:_context80.p=6;_t81=_context80.v;_iterator93.e(_t81);case 7:_context80.p=7;_iterator93.f();return _context80.f(7);case 8:return _context80.a(2,!0);}},_callee76,this,[[1,6,7,8]]);}));function areFontFacesAvailable(){return _areFontFacesAvailable.apply(this,arguments);}return areFontFacesAvailable;}()},{key:"register",value:function register(){var _this91=this;onmessage=/*#__PURE__*/function(){var _ref68=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee81(t){var e,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_loop0,_ret2,_iterator,_step,_t87;return _regenerator().w(function(_context87){while(1)switch(_context87.p=_context87.n){case 0:e=t.data;if(!e){_context87.n=13;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context87.p=1;_loop0=/*#__PURE__*/_regenerator().m(function _loop0(){var n,i,s,o,a,u,d,v,p,M,_M5,E,_M6,_E5,L,_M7,_iterator94,_step94,_loop1,_M8,w,A,_t85,_t86;return _regenerator().w(function(_context86){while(1)switch(_context86.p=_context86.n){case 0:n=_step.value;i=n.msgType,s=n.viewId,o=n.tasksqueue,a=n.mainTasksqueueCount,u=n.cameraTaskId,d=n.fontBuffers,v=n.fontFaces,p=n.requestId;if(!(i===xt.CheckFontFace)){_context86.n=2;break;}_context86.n=1;return _this91.areFontFacesAvailable(v);case 1:M=_context86.v;_this91.post({sp:[{type:xt.CheckFontFace,requestId:p,fontFaceCheckResult:M}]});return _context86.a(2,0);case 2:if(!(i===xt.ProbeRenderCapabilities)){_context86.n=3;break;}_M5=n.requestedContextType,E=function E(L){var G,z;try{if(typeof OffscreenCanvas!="function")return!1;var et=new OffscreenCanvas(1,1).getContext(L);return et?((z=(G=et.getExtension)==null?void 0:G.call(et,"WEBGL_lose_context"))==null||z.loseContext(),!0):!1;}catch(_unused29){return!1;}};_this91._self.postMessage({type:xt.ProbeRenderCapabilities,workerCapabilities:{offscreenCanvas:typeof OffscreenCanvas=="function",offscreen2d:E("2d"),webgl2:E("webgl2"),webgl:E("webgl"),contextSupported:_M5?E(_M5):!1},requestId:p});return _context86.a(2,0);case 3:if(!d){_context86.n=4;break;}_this91.setFontFaces(d,p);return _context86.a(2,0);case 4:if(!(i===xt.Console)){_context86.n=5;break;}console.log(_this91);return _context86.a(2,0);case 5:if(!(i===xt.Init)){_context86.n=7;break;}_context86.n=6;return _this91.init(n);case 6:_this91.type==="full"&&_this91.post({sp:[{type:xt.Init,viewId:s,viewGeneration:n.viewGeneration}]});return _context86.a(2,0);case 7:if(!(i===xt.UpdateTools||xt.CreateWork,i===xt.TasksQueue&&o!=null&&o.size)){_context86.n=9;break;}_M6=o.get(s),_E5=_this91.workThreadMap.get(s),L=_this91.viewGenerationById.get(s);_t85=_M6&&_E5;if(!_t85){_context86.n=8;break;}_context86.n=8;return _this91.enqueueViewTask(s,/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee77(){var _t82;return _regenerator().w(function(_context81){while(1)switch(_context81.n){case 0:_t82=_this91.viewGenerationById.get(s)!==L||_this91.workThreadMap.get(s)!==_E5;if(_t82){_context81.n=1;break;}_context81.n=1;return _E5.on(_M6);case 1:return _context81.a(2);}},_callee77);})));case 8:_this91.type==="full"&&Ze(a)&&Ze(u)&&_this91.post({workerTasksqueueCount:a,cameraTaskId:u,viewId:s});return _context86.a(2,0);case 9:if(!(s===dgt)){_context86.n=17;break;}_M7=_toConsumableArray(_this91.workThreadMap.entries());_iterator94=_createForOfIteratorHelper(_M7);_context86.p=10;_loop1=/*#__PURE__*/_regenerator().m(function _loop1(){var _step94$value,E,L,G;return _regenerator().w(function(_context83){while(1)switch(_context83.n){case 0:_step94$value=_slicedToArray(_step94.value,2),E=_step94$value[0],L=_step94$value[1];G=_this91.enqueueViewTask(E,/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee78(){var _t83;return _regenerator().w(function(_context82){while(1)switch(_context82.n){case 0:if(!(i===xt.Destroy)){_context82.n=1;break;}_this91.workThreadMap.get(E)===L&&(L.destroy(),_this91.workThreadMap.delete(E),_this91.viewGenerationById.set(E,(_this91.viewGenerationById.get(E)||0)+1));return _context82.a(2);case 1:_t83=_this91.workThreadMap.get(E)===L;if(!_t83){_context82.n=2;break;}_context82.n=2;return L.on(n);case 2:return _context82.a(2);}},_callee78);})));_context83.n=1;return G;case 1:_this91.cameraRenderQueueByView.get(E)===G&&_this91.cameraRenderQueueByView.delete(E);case 2:return _context83.a(2);}},_loop1);});_iterator94.s();case 11:if((_step94=_iterator94.n()).done){_context86.n=13;break;}return _context86.d(_regeneratorValues(_loop1()),12);case 12:_context86.n=11;break;case 13:_context86.n=15;break;case 14:_context86.p=14;_t86=_context86.v;_iterator94.e(_t86);case 15:_context86.p=15;_iterator94.f();return _context86.f(15);case 16:return _context86.a(2,0);case 17:if(!(i===xt.Destroy)){_context86.n=19;break;}_M8=_this91.enqueueViewTask(s,/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee79(){var _n$viewGeneration;var E;return _regenerator().w(function(_context84){while(1)switch(_context84.n){case 0:E=_this91.workThreadMap.get(s);E==null||E.destroy(),_this91.workThreadMap.delete(s),_this91.viewGenerationById.set(s,(_n$viewGeneration=n.viewGeneration)!==null&&_n$viewGeneration!==void 0?_n$viewGeneration:(_this91.viewGenerationById.get(s)||0)+1);case 1:return _context84.a(2);}},_callee79);})));_context86.n=18;return _M8;case 18:_this91.cameraRenderQueueByView.get(s)===_M8&&_this91.cameraRenderQueueByView.delete(s);return _context86.a(2,0);case 19:w=_this91.workThreadMap.get(s);if(w){_context86.n=20;break;}return _context86.a(2,0);case 20:A=_this91.viewGenerationById.get(s);_context86.n=21;return _this91.enqueueViewTask(s,/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee80(){var _t84;return _regenerator().w(function(_context85){while(1)switch(_context85.n){case 0:_t84=_this91.viewGenerationById.get(s)!==A||_this91.workThreadMap.get(s)!==w;if(_t84){_context85.n=1;break;}_context85.n=1;return w.on(n);case 1:return _context85.a(2);}},_callee80);})));case 21:return _context86.a(2);}},_loop0,null,[[10,14,15,16]]);});_iterator=_asyncIterator(e.values());case 2:_context87.n=3;return _iterator.next();case 3:if(!(_iteratorAbruptCompletion=!(_step=_context87.v).done)){_context87.n=6;break;}return _context87.d(_regeneratorValues(_loop0()),4);case 4:_ret2=_context87.v;if(!(_ret2===0)){_context87.n=5;break;}return _context87.a(3,5);case 5:_iteratorAbruptCompletion=false;_context87.n=2;break;case 6:_context87.n=8;break;case 7:_context87.p=7;_t87=_context87.v;_didIteratorError=true;_iteratorError=_t87;case 8:_context87.p=8;_context87.p=9;if(!(_iteratorAbruptCompletion&&_iterator.return!=null)){_context87.n=10;break;}_context87.n=10;return _iterator.return();case 10:_context87.p=10;if(!_didIteratorError){_context87.n=11;break;}throw _iteratorError;case 11:return _context87.f(10);case 12:return _context87.f(8);case 13:return _context87.a(2);}},_callee81,null,[[9,,10,12],[1,7,8,13]]);}));return function onmessage(_x112){return _ref68.apply(this,arguments);};}();}}]);}();var Kbt=/*#__PURE__*/function(_S10){function Kbt(e,n,i){var _this92;_classCallCheck(this,Kbt);_this92=_callSuper(this,Kbt,[e,n,"sub"/* Sub */]);wt(_this92,"type","sub");wt(_this92,"_post");wt(_this92,"topLayer");wt(_this92,"serviceWork");wt(_this92,"localWork");wt(_this92,"topLayerWork");wt(_this92,"snapshotWork");_this92._post=i;var s=zr.bufferSize.sub;_this92.topLayer=n.isUseSimple?void 0:_this92.createLayer("topLayer",_this92.scene,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:s,contextType:"2d"}));var o={thread:_this92,viewId:_this92.viewId,vNodes:_this92.vNodes,fullLayer:_this92.fullLayer,topLayer:_this92.topLayer,isUseSimple:n.isUseSimple};_this92.localWork=new Gbt(o),n.isUseSimple||(_this92.topLayerWork=new Hbt(o)),_this92.snapshotWork=new oI(_objectSpread(_objectSpread({},o),{},{createScene:_this92.createScene.bind(_this92),createLayer:_this92.createLayer.bind(_this92)})),_this92.vNodes.init(_this92.fullLayer);return _this92;}_inherits(Kbt,_S10);return _createClass(Kbt,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee82(){var _this93=this;var o,a,_this$combinePostData,e,n,i,u,_iterator95,_step95,d,v,s,_t88;return _regenerator().w(function(_context88){while(1)switch(_context88.p=_context88.n){case 0:_this$combinePostData=this.combinePostData(),e=_this$combinePostData.render,n=_objectWithoutProperties(_this$combinePostData,_excluded4);if(!(e!=null&&e.length)){_context88.n=11;break;}u=[];_iterator95=_createForOfIteratorHelper(e);_context88.p=1;_iterator95.s();case 2:if((_step95=_iterator95.n()).done){_context88.n=7;break;}d=_step95.value;if(!d.rect){_context88.n=6;break;}if(!(d.rect=QS(br(d.rect),this.scene,this.dpr),!d.rect)){_context88.n=3;break;}return _context88.a(3,6);case 3:if(!(d.drawCanvas&&d.rect&&d.rect.w>0&&d.rect.h>0)){_context88.n=5;break;}_context88.n=4;return this.getRectImageBitmap(d);case 4:v=_context88.v;d.imageBitmap=v,i||(i=[]),i.push(v);case 5:u.push(d);case 6:_context88.n=2;break;case 7:_context88.n=9;break;case 8:_context88.p=8;_t88=_context88.v;_iterator95.e(_t88);case 9:_context88.p=9;_iterator95.f();return _context88.f(9);case 10:n.render=u;case 11:s=(o=n.sp)==null?void 0:o.filter(function(u){return u.type!==xt.None||u.isLockSentEventCursor||u.needUndoTicker||u.collectUndoTicker;});s!=null&&s.length?n.sp=s.map(function(u){return _objectSpread(_objectSpread({},u),{},{viewId:_this93.viewId});}):delete n.sp,n.consumeCount===void 0&&delete n.consumeCount,n.subWorkerDrawCount===void 0&&delete n.subWorkerDrawCount,(s!=null&&s.length||n.consumeCount||n.subWorkerDrawCount||(a=n==null?void 0:n.render)!=null&&a.length)&&this._post(n,i),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 12:return _context88.a(2);}},_callee82,this,[[1,8,9,10]]);}));function combinePost(){return _combinePost.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee83(e){var d,v,n,i,s,o,a,u,p,_t89,_t90;return _regenerator().w(function(_context89){while(1)switch(_context89.n){case 0:n=e.msgType,i=e.toolsType,s=e.opt,o=e.dataType,a=e.workState,u=e.isLockSentEventCursor;_t89=n;_context89.n=_t89===xt.UpdateTools?1:_t89===xt.CreateWork?3:_t89===xt.DrawWork?4:_t89===xt.RemoveNode?8:_t89===xt.FullWork?10:_t89===xt.Snapshot?14:_t89===xt.BoundingBox?16:18;break;case 1:if(!(i&&(d=this.topLayerWork)!=null&&d.canUseTopLayer(i)&&s)){_context89.n=2;break;}p={toolsType:i,toolsOpt:s};this.topLayerWork.setToolsOpt(p);return _context89.a(2);case 2:return _context89.a(3,18);case 3:this.createLocalWork(e);return _context89.a(2);case 4:if(!(a===te.Done&&o===Kt.Local)){_context89.n=6;break;}_context89.n=5;return this.consumeDrawAll(o,e);case 5:i===It.LaserPen&&u&&this.post({sp:[{type:xt.None,isLockSentEventCursor:u}]});_context89.n=7;break;case 6:this.consumeDraw(o,e);case 7:return _context89.a(2);case 8:_context89.n=9;return this.removeNode(e);case 9:return _context89.a(2);case 10:if(!(i&&(v=this.topLayerWork)!=null&&v.canUseTopLayer(i))){_context89.n=12;break;}_context89.n=11;return this.consumeDrawAll(o,e);case 11:_context89.n=13;break;case 12:_t90=o===Kt.Local&&e.clearPreviewLocalWork&&e.workId;if(!_t90){_context89.n=13;break;}_context89.n=13;return this.localWork.consumeDrawAll(_objectSpread(_objectSpread({},e),{},{msgType:xt.DrawWork,workState:te.Done}));case 13:return _context89.a(2);case 14:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ds?6e3:3e3,contextType:"2d"}));_context89.n=15;return this.snapshotWork.getSnapshot(e);case 15:this.snapshotWork.destroySnapshotFullLayer();return _context89.a(2);case 16:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ds?6e3:3e3,contextType:"2d"}));_context89.n=17;return this.snapshotWork.getBoundingRect(e);case 17:this.snapshotWork.destroySnapshotFullLayer();return _context89.a(2);case 18:_context89.n=19;return _superPropGet(Kbt,"on",this,3)([e]);case 19:return _context89.a(2);}},_callee83,this);}));function on(_x113){return _on2.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(e){var o;var n=e.workId,i=e.toolsType,s=e.opt;if(i&&(o=this.topLayerWork)!=null&&o.canUseTopLayer(i)&&n&&s){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:i,toolsOpt:s}),this.topLayerWork.setWorkOptions(n.toString(),s);return;}i&&_superPropGet(Kbt,"createLocalWork",this,3)([e]);}},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee84(e){var n,_t91;return _regenerator().w(function(_context90){while(1)switch(_context90.n){case 0:n=e.dataType;_t91=n===Kt.Local;if(!_t91){_context90.n=1;break;}_context90.n=1;return this.localWork.removeWork(e);case 1:return _context90.a(2);}},_callee84,this);}));function removeNode(_x114){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"getLayer",value:function getLayer(e){switch(e){case Yt.TopFloat:return this.topLayer||this.fullLayer;default:return this.fullLayer;}}},{key:"getOffscreen",value:function getOffscreen(e){var i;return((i=this.getLayer(e))==null?void 0:i.parent).canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee85(e,n){var o,i,s,_t92;return _regenerator().w(function(_context91){while(1)switch(_context91.n){case 0:i=n.workId,s=n.toolsType;if(!i){_context91.n=3;break;}if(!(s&&(o=this.topLayerWork)!=null&&o.canUseTopLayer(s))){_context91.n=1;break;}e===Kt.Local&&(this.topLayerWork.getWorkShape(i.toString())||this.createLocalWork(n)),this.topLayerWork.consumeDraw(n);return _context91.a(2);case 1:_t92=s;if(!_t92){_context91.n=2;break;}this.localWork.getWorkShape(i.toString())||this.createLocalWork(n);_context91.n=2;return this.localWork.consumeDraw(n);case 2:return _context91.a(2);case 3:return _context91.a(2);}},_callee85,this);}));function consumeDraw(_x115,_x116){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee86(e,n){var a,i,s,o,u;return _regenerator().w(function(_context92){while(1)switch(_context92.n){case 0:i=n.workId,s=n.toolsType,o=n.dataType;if(!i){_context92.n=2;break;}u=i.toString();if(!(s&&(a=this.topLayerWork)!=null&&a.canUseTopLayer(s))){_context92.n=1;break;}o===Kt.Local&&(this.topLayerWork.getWorkShape(u)||this.createLocalWork(n)),this.topLayerWork.consumeDrawAll(n);return _context92.a(2);case 1:s&&(this.localWork.getWorkShape(u)||_superPropGet(Kbt,"createLocalWork",this,3)([n]),this.localWork.consumeDrawAll(n));return _context92.a(2);case 2:return _context92.a(2);}},_callee86,this);}));function consumeDrawAll(_x117,_x118){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee87(){return _regenerator().w(function(_context93){while(1)switch(_context93.n){case 0:this.vNodes.clear();_superPropGet(Kbt,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(e){e.name!=="viewport"&&e.remove();}),qr(this.topLayer,this.topLayer.parent));_context93.n=1;return this.post({render:[{isClearAll:!0,clearCanvas:Yt.TopFloat,viewId:this.viewId}],sp:[{type:xt.Clear}]});case 1:return _context93.a(2);}},_callee87,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"getRectImageBitmap",value:function(){var _getRectImageBitmap=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee88(e,n){var v,i,s,p,o,a,u,d,_p8,_t93;return _regenerator().w(function(_context94){while(1)switch(_context94.p=_context94.n){case 0:i=e.rect,s=e.drawCanvas;if(!(((v=this.opt.bitmapEraserMaskOptions)==null?void 0:v.imageBitmapDirtyRect)===!1)){_context94.n=1;break;}p=this.getOffscreen(s);return _context94.a(2,(i.x=0,i.y=0,i.w=p.width/this.dpr,i.h=p.height/this.dpr,createImageBitmap(p,0,0,p.width,p.height,n)));case 1:o=Math.floor(i.x*this.dpr),a=Math.floor(i.y*this.dpr),u=Math.floor(i.w*this.dpr||1),d=Math.floor(i.h*this.dpr||1);_context94.p=2;_context94.n=3;return createImageBitmap(this.getOffscreen(s),o,a,u,d,n);case 3:return _context94.a(2,_context94.v);case 4:_context94.p=4;_t93=_context94.v;this.opt.bitmapEraserMaskOptions&&(this.opt.bitmapEraserMaskOptions.imageBitmapDirtyRect=!1);_p8=this.getOffscreen(s);return _context94.a(2,(i.x=0,i.y=0,i.w=_p8.width/this.dpr,i.h=_p8.height/this.dpr,createImageBitmap(_p8,0,0,_p8.width,_p8.height,n)));}},_callee88,this,[[2,4]]);}));function getRectImageBitmap(_x119,_x120){return _getRectImageBitmap.apply(this,arguments);}return getRectImageBitmap;}()},{key:"updateLayer",value:function updateLayer(e){var n=e.width,i=e.height;_superPropGet(Kbt,"updateLayer",this,3)([e]),this.topLayer&&(this.topLayer.parent.setAttribute("width",n),this.topLayer.parent.setAttribute("height",i),this.topLayer.setAttribute("size",[n,i]),this.topLayer.setAttribute("pos",[n*0.5,i*0.5]));}},{key:"updateDpr",value:function(){var _updateDpr2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee89(e){var n,i,s,_t94;return _regenerator().w(function(_context95){while(1)switch(_context95.n){case 0:_superPropGet(Kbt,"updateDpr",this,3)([e]);n=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,i=!!this.localWork.getWorkShapes().size,s=[];i&&s.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId});n&&s.push({isClearAll:!0,clearCanvas:Yt.TopFloat,viewId:this.viewId});_t94=s.length;if(!_t94){_context95.n=1;break;}_context95.n=1;return this.post({render:s});case 1:return _context95.a(2);}},_callee89,this);}));function updateDpr(_x121){return _updateDpr2.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee90(e){var _this94=this;var s,n,i,o,a,_iterator96,_step96,_loop10,_t95,_t96;return _regenerator().w(function(_context97){while(1)switch(_context97.p=_context97.n){case 0:n=[],i=e.cameraOpt;if(!(i&&!qn(this.cameraOpt,i))){_context97.n=8;break;}o=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,a=!!this.localWork.getWorkShapes().size;if(!(a&&this.localWork.workShapesDone(),this.setCameraOpt(i),a&&n.push({isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}),o&&this.topLayerWork)){_context97.n=7;break;}n.push({isClearAll:!0,clearCanvas:Yt.TopFloat,viewId:this.viewId});_iterator96=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries()||[]);_context97.p=1;_loop10=/*#__PURE__*/_regenerator().m(function _loop10(){var _step96$value,u,d,v;return _regenerator().w(function(_context96){while(1)switch(_context96.n){case 0:_step96$value=_slicedToArray(_step96.value,2),u=_step96$value[0],d=_step96$value[1];if(d.totalRect){(s=_this94.topLayer)==null||s.getElementsByName(u.toString()).forEach(function(p){var w=p.getBoundingClientRect(),A=me({x:w.x,y:w.y,w:w.width,h:w.height});v=Jt(v,A);}),d.totalRect=v,_this94.topLayerWork.localWorkShapes.set(u,d);}case 1:return _context96.a(2);}},_loop10);});_iterator96.s();case 2:if((_step96=_iterator96.n()).done){_context97.n=4;break;}return _context97.d(_regeneratorValues(_loop10()),3);case 3:_context97.n=2;break;case 4:_context97.n=6;break;case 5:_context97.p=5;_t95=_context97.v;_iterator96.e(_t95);case 6:_context97.p=6;_iterator96.f();return _context97.f(6);case 7:_t96=n.length;if(!_t96){_context97.n=8;break;}_context97.n=8;return this.post({render:n});case 8:return _context97.a(2);}},_callee90,this,[[1,5,6,7]]);}));function updateCamera(_x122){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(e,n){var d,v;this.cameraOpt=e;var i=e.scale,s=e.centerX,o=e.centerY,a=e.width,u=e.height;(a!==this.scene.width||u!==this.scene.height)&&this.updateScene(this.scene,{width:a,height:u}),n?(n.setAttribute("scale",[i,i]),n.setAttribute("translate",[-s,-o])):(this.fullLayer.setAttribute("scale",[i,i]),this.fullLayer.setAttribute("translate",[-s,-o]),(d=this.topLayer)==null||d.setAttribute("scale",[i,i]),(v=this.topLayer)==null||v.setAttribute("translate",[-s,-o]));}}]);}(_S);var aI=/*#__PURE__*/function(_S11){function aI(e,n,i){var _this95;_classCallCheck(this,aI);_this95=_callSuper(this,aI,[e,n,"full"/* Full */]);wt(_this95,"serviceDrawLayer");wt(_this95,"localDrawLayer");wt(_this95,"snapshotFullLayer");wt(_this95,"methodBuilder");wt(_this95,"localWork");wt(_this95,"serviceWork");wt(_this95,"_post");wt(_this95,"debounceUpdateCache",/* @__PURE__ */new Set());_this95._post=i;var s=zr.bufferSize.sub;_this95.serviceDrawLayer=_this95.createLayer("serviceDrawLayer",_this95.scene,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:s,contextType:"2d"})),_this95.localDrawLayer=_this95.createLayer("localDrawLayer",_this95.scene,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:s,contextType:"2d"}));var o={thread:_this95,viewId:_this95.viewId,vNodes:_this95.vNodes,fullLayer:_this95.fullLayer};_this95.localWork=new iI(_objectSpread(_objectSpread({},o),{},{drawLayer:_this95.localDrawLayer})),n.combineUnitTime&&_this95.localWork.setCombineUnitTime(n.combineUnitTime),n.maxCombineEraserTime&&_this95.localWork.setmaxCombineEraserTime(n.maxCombineEraserTime),n.syncUnitTime&&_this95.localWork.setSyncUnitTime(n.syncUnitTime),_this95.serviceWork=new sI(_objectSpread(_objectSpread({},o),{},{drawLayer:_this95.serviceDrawLayer})),_this95.methodBuilder=new Y2([ve.CopyNode,ve.SetColorNode,ve.DeleteNode,ve.RotateNode,ve.ScaleNode,ve.TranslateNode,ve.ZIndexNode,ve.SetFontStyle,ve.SetPoint,ve.SetLock,ve.SetShapeOpt]).registerForWorker(_this95),_this95.vNodes.init(_this95.fullLayer);return _this95;}_inherits(aI,_S11);return _createClass(aI,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee91(){var _this96=this;var o,a,_this$combinePostData2,e,n,i,u,_iterator97,_step97,d,v,s,_t97;return _regenerator().w(function(_context98){while(1)switch(_context98.p=_context98.n){case 0:_this$combinePostData2=this.combinePostData(),e=_this$combinePostData2.render,n=_objectWithoutProperties(_this$combinePostData2,_excluded5);if(!(e!=null&&e.length)){_context98.n=11;break;}u=[];_iterator97=_createForOfIteratorHelper(e);_context98.p=1;_iterator97.s();case 2:if((_step97=_iterator97.n()).done){_context98.n=7;break;}d=_step97.value;if(!d.rect){_context98.n=6;break;}if(!(d.rect=QS(br(d.rect),this.scene,this.dpr),!d.rect)){_context98.n=3;break;}return _context98.a(3,6);case 3:if(!(d.drawCanvas&&d.rect&&d.rect.w>0&&d.rect.h>0)){_context98.n=5;break;}_context98.n=4;return this.getRectImageBitmap(d);case 4:v=_context98.v;d.imageBitmap=v,i||(i=[]),i.push(v);case 5:u.push(d);case 6:_context98.n=2;break;case 7:_context98.n=9;break;case 8:_context98.p=8;_t97=_context98.v;_iterator97.e(_t97);case 9:_context98.p=9;_iterator97.f();return _context98.f(9);case 10:n.render=u;case 11:s=(o=n.sp)==null?void 0:o.filter(function(u){return u.type!==xt.None||u.isLockSentEventCursor||u.needUndoTicker||u.collectUndoTicker;});s!=null&&s.length?n.sp=s.map(function(u){return _objectSpread(_objectSpread({},u),{},{viewId:_this96.viewId});}):delete n.sp,n.fullWorkerDrawCount===void 0&&delete n.fullWorkerDrawCount,n.consumeCount===void 0&&delete n.consumeCount,(n!=null&&n.fullWorkerDrawCount||n.consumeCount||s!=null&&s.length||(a=n.render)!=null&&a.length)&&this._post(n,i),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 12:return _context98.a(2);}},_callee91,this,[[1,8,9,10]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee92(e){var _this97=this;var n,i,s,o,a,u,d,v,_d9,_t98,_t99;return _regenerator().w(function(_context99){while(1)switch(_context99.n){case 0:if(!this.methodBuilder.consumeForWorker(e)){_context99.n=1;break;}return _context99.a(2);case 1:n=e.msgType,i=e.dataType,s=e.workId,o=e.toolsType,a=e.workState,u=e.workIds;_t98=n;_context99.n=_t98===xt.AuthClear?2:_t98===xt.CreateWork?3:_t98===xt.DrawWork?4:_t98===xt.Select?8:_t98===xt.UpdateNode?12:_t98===xt.FullWork?12:_t98===xt.RemoveNode?13:_t98===xt.GetTextActive?15:_t98===xt.CursorHover?17:_t98===xt.CursorBlur?19:_t98===xt.GetVNodeInfo?21:22;break;case 2:d=e.clearUids,v=e.localUid;this.vNodes.setCanClearUids(d),this.vNodes.setLocalUid(v);return _context99.a(3,22);case 3:o!==It.LaserPen&&this.createLocalWork(e);return _context99.a(3,22);case 4:_t99=o!==It.LaserPen;if(!_t99){_context99.n=7;break;}if(!(a===te.Done&&i===Kt.Local)){_context99.n=6;break;}_context99.n=5;return this.consumeDrawAll(i,e);case 5:_context99.n=7;break;case 6:this.consumeDraw(i,e);case 7:return _context99.a(3,22);case 8:if(!(s===Fe)){_context99.n=10;break;}_context99.n=9;return this.localWork.updateFullSelectWork(e);case 9:_context99.n=11;break;case 10:this.serviceWork.runSelectWork(e);case 11:return _context99.a(2);case 12:this.consumeFull(i,e);return _context99.a(2);case 13:_context99.n=14;return this.removeNode(e);case 14:return _context99.a(2);case 15:_context99.n=16;return this.checkTextActive(e);case 16:return _context99.a(2);case 17:_context99.n=18;return this.cursorHover(e);case 18:return _context99.a(2);case 19:_context99.n=20;return this.cursorBlur();case 20:return _context99.a(2);case 21:if(s&&u){_d9=u.map(function(v){return _this97.vNodes.get(v);});this.post({sp:[{type:xt.GetVNodeInfo,dataType:Kt.Worker,workId:s,vInfo:_d9}]});}return _context99.a(3,22);case 22:_context99.n=23;return _superPropGet(aI,"on",this,3)([e]);case 23:return _context99.a(2);}},_callee92,this);}));function on(_x123){return _on3.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee93(e){var _this98=this;var n,i,s,o,a,_iterator98,_step98,_loop11,_t100;return _regenerator().w(function(_context101){while(1)switch(_context101.p=_context101.n){case 0:n=e.dataType,i=e.workId,s=e.removeIds,o=[],a=s||[];if(!(i&&a.push(i.toString()),a.length)){_context101.n=8;break;}_iterator98=_createForOfIteratorHelper(a);_context101.p=1;_loop11=/*#__PURE__*/_regenerator().m(function _loop11(){var u;return _regenerator().w(function(_context100){while(1)switch(_context100.n){case 0:u=_step98.value;u===Fe?o.push(_this98.localWork.removeSelector(e,_this98)):n===Kt.Local?o.push(_this98.localWork.removeWork(e).then(function(){_this98.localWork.colloctEffectSelectWork(e),_this98.deleteCachedImagesByWorkId(u);})):n===Kt.Service&&o.push(_this98.serviceWork.removeWork(e).then(function(){_this98.localWork.colloctEffectSelectWork(e),_this98.deleteCachedImagesByWorkId(u);}));case 1:return _context100.a(2);}},_loop11);});_iterator98.s();case 2:if((_step98=_iterator98.n()).done){_context101.n=4;break;}return _context101.d(_regeneratorValues(_loop11()),3);case 3:_context101.n=2;break;case 4:_context101.n=6;break;case 5:_context101.p=5;_t100=_context101.v;_iterator98.e(_t100);case 6:_context101.p=6;_iterator98.f();return _context101.f(6);case 7:_context101.n=8;return Promise.all(o);case 8:return _context101.a(2);}},_callee93,null,[[1,5,6,7]]);}));function removeNode(_x124){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee94(e){var n,_t101;return _regenerator().w(function(_context102){while(1)switch(_context102.n){case 0:n=e.dataType;_t101=n===Kt.Local;if(!_t101){_context102.n=1;break;}_context102.n=1;return this.localWork.checkTextActive(e);case 1:return _context102.a(2);}},_callee94,this);}));function checkTextActive(_x125){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee95(){return _regenerator().w(function(_context103){while(1)switch(_context103.n){case 0:this.vNodes.clear();_superPropGet(aI,"clearAll",this,3)([]);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(e){e.name!=="viewport"&&e.remove();}),qr(this.localDrawLayer,this.localDrawLayer.parent));this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(e){e.name!=="viewport"&&e.remove();}),qr(this.serviceDrawLayer,this.serviceDrawLayer.parent));_context103.n=1;return this.post({render:[{isClearAll:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:Yt.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:Yt.Float,viewId:this.viewId}],sp:[{type:xt.Clear}]});case 1:return _context103.a(2);}},_callee95,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(e){var n=e.width,i=e.height;_superPropGet(aI,"updateLayer",this,3)([e]),this.localDrawLayer&&(this.localDrawLayer.parent.setAttribute("width",n),this.localDrawLayer.parent.setAttribute("height",i),this.localDrawLayer.setAttribute("size",[n,i]),this.localDrawLayer.setAttribute("pos",[n*0.5,i*0.5])),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.setAttribute("width",n),this.serviceDrawLayer.parent.setAttribute("height",i),this.serviceDrawLayer.setAttribute("size",[n,i]),this.serviceDrawLayer.setAttribute("pos",[n*0.5,i*0.5]));}},{key:"setCameraOpt",value:function setCameraOpt(e){this.cameraOpt=e;var n=e.scale,i=e.centerX,s=e.centerY,o=e.width,a=e.height;(o!==this.scene.width||a!==this.scene.height)&&this.updateScene(this.scene,{width:o,height:a}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-s])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[n,n]),this.localDrawLayer.setAttribute("translate",[-i,-s])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[n,n]),this.serviceDrawLayer.setAttribute("translate",[-i,-s]));}},{key:"getLayer",value:function getLayer(e){switch(e){case Yt.Bg:return this.fullLayer;case Yt.ServiceFloat:return this.serviceDrawLayer;case Yt.Float:return this.localDrawLayer;}}},{key:"getOffscreen",value:function getOffscreen(e){return this.getLayer(e).parent.canvas;}},{key:"consumeFull",value:function(){var _consumeFull2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee96(e,n){var i,_t102;return _regenerator().w(function(_context104){while(1)switch(_context104.n){case 0:_context104.n=1;return this.localWork.colloctEffectSelectWork(n);case 1:i=_context104.v;_t102=i&&e===Kt.Local;if(!_t102){_context104.n=2;break;}_context104.n=2;return this.localWork.consumeFull(i);case 2:i&&e===Kt.Service&&this.serviceWork.consumeFull(i);case 3:return _context104.a(2);}},_callee96,this);}));function consumeFull(_x126,_x127){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw6=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee97(e,n){var i,_t103;return _regenerator().w(function(_context105){while(1)switch(_context105.n){case 0:i=n.workId;_t103=e===Kt.Local&&i;if(!_t103){_context105.n=1;break;}this.localWork.getWorkShape(i.toString())||this.createLocalWork(n);_context105.n=1;return this.localWork.consumeDraw(n,this.serviceWork);case 1:e===Kt.Service&&this.serviceWork.consumeDraw(n);case 2:return _context105.a(2);}},_callee97,this);}));function consumeDraw(_x128,_x129){return _consumeDraw6.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll5=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee98(e,n){var i,_t104;return _regenerator().w(function(_context106){while(1)switch(_context106.n){case 0:i=n.workId;_t104=e===Kt.Local&&i;if(!_t104){_context106.n=1;break;}this.localWork.getWorkShape(i.toString())||this.createLocalWork(n);_context106.n=1;return this.localWork.consumeDrawAll(n,this.serviceWork);case 1:return _context106.a(2);}},_callee98,this);}));function consumeDrawAll(_x130,_x131){return _consumeDrawAll5.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateDpr",value:function(){var _updateDpr3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee99(e){return _regenerator().w(function(_context107){while(1)switch(_context107.n){case 0:_superPropGet(aI,"updateDpr",this,3)([e]);_context107.n=1;return this.post({render:[{isClearAll:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Yt.Bg,viewId:this.viewId}]});case 1:return _context107.a(2);}},_callee99,this);}));function updateDpr(_x132){return _updateDpr3.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee101(e){var _this99=this;var d,v,p,w,n,i,s,o,a,u,A,M,et,_iterator99,_step99,_step99$value,x,y,E,_iterator100,_step100,_step100$value,_et8,_x138,_y8,_iterator101,_step101,_step101$value,_et9,_x139,_y9,L,G,_et4,_iterator102,_step102,_x134,z,_iterator103,_step103,_et5,_x135,_iterator104,_step104,_y6,_iterator105,_step105,_step105$value,_et7,_x137,_y7,S,C,P,X,$,K,j,nt,ct,_iterator106,_step106,_step106$value,_et6,_x136,_t105,_t106,_t107;return _regenerator().w(function(_context109){while(1)switch(_context109.p=_context109.n){case 0:n=[],i=e.cameraOpt,s=e.scenePath,o=e.cameraTaskId;a=!1;u=this.cameraOpt;if(!(i&&!qn(u,i))){_context109.n=13;break;}A=!u||u.scale!==i.scale||u.centerX!==i.centerX||u.centerY!==i.centerY||u.width!==i.width||u.height!==i.height;this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0,(d=this.taskUpdateCameraResolve)==null||d.call(this,!1),this.taskUpdateCameraResolve=void 0);M=!!this.serviceDrawLayer.children.length;if(!s){_context109.n=12;break;}et=[];_iterator99=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context109.p=1;_iterator99.s();case 2:if((_step99=_iterator99.n()).done){_context109.n=6;break;}_step99$value=_slicedToArray(_step99.value,2),x=_step99$value[0],y=_step99$value[1];_t105=y.toolsType;_context109.n=_t105===It.Text?3:_t105===It.PencilEraser?3:_t105===It.Eraser?3:_t105===It.Selector?3:_t105===It.LaserPen?3:4;break;case 3:return _context109.a(3,5);case 4:x!==Po&&x!==Fe&&et.push("".concat(x,":").concat(y.toolsType));return _context109.a(3,5);case 5:_context109.n=2;break;case 6:_context109.n=8;break;case 7:_context109.p=7;_t106=_context109.v;_iterator99.e(_t106);case 8:_context109.p=8;_iterator99.f();return _context109.f(8);case 9:if(!et.length){_context109.n=12;break;}_context109.n=10;return new Promise(function(y){_this99.taskUpdateCameraResolve=y,_this99.taskUpdateCameraId=setTimeout(function(){_this99.taskUpdateCameraId=void 0,_this99.taskUpdateCameraResolve=void 0,y(!0);},h1);});case 10:_t107=_context109.v;if(!_t107){_context109.n=11;break;}_context109.n=11;return this.updateCamera(e);case 11:return _context109.a(2);case 12:E=/* @__PURE__ */new Map();_iterator100=_createForOfIteratorHelper(this.vNodes.getNodesByType(It.Text).entries());try{for(_iterator100.s();!(_step100=_iterator100.n()).done;){_step100$value=_slicedToArray(_step100.value,2),_et8=_step100$value[0],_x138=_step100$value[1];_y8=_x138.rect;E.set(_et8,{rect:br(_y8),scale:(v=this.cameraOpt)==null?void 0:v.scale});}}catch(err){_iterator100.e(err);}finally{_iterator100.f();}_iterator101=_createForOfIteratorHelper(this.vNodes.gethasEraserNodes().entries());try{for(_iterator101.s();!(_step101=_iterator101.n()).done;){_step101$value=_slicedToArray(_step101.value,2),_et9=_step101$value[0],_x139=_step101$value[1];_y9=_x139.rect;E.set(_et9,{rect:br(_y9),scale:(p=this.cameraOpt)==null?void 0:p.scale});}}catch(err){_iterator101.e(err);}finally{_iterator101.f();}L=new Set(E.keys());G=!1;if(this.localWork.hasSelector()){_et4=(w=this.localWork.getSelector())==null?void 0:w.selectIds;if(_et4){G=!0;_iterator102=_createForOfIteratorHelper(_et4);try{for(_iterator102.s();!(_step102=_iterator102.n()).done;){_x134=_step102.value;L.add(_x134);}}catch(err){_iterator102.e(err);}finally{_iterator102.f();}}}z=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator103=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator103.s();!(_step103=_iterator103.n()).done;){_et5=_step103.value;_x135=_et5.selectIds;if(_x135){z=!0;_iterator104=_createForOfIteratorHelper(_x135);try{for(_iterator104.s();!(_step104=_iterator104.n()).done;){_y6=_step104.value;L.add(_y6);}}catch(err){_iterator104.e(err);}finally{_iterator104.f();}}}}catch(err){_iterator103.e(err);}finally{_iterator103.f();}}if(this.setCameraOpt(i),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(L),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator105=_createForOfIteratorHelper(E.entries());try{for(_iterator105.s();!(_step105=_iterator105.n()).done;){_step105$value=_slicedToArray(_step105.value,2),_et7=_step105$value[0],_x137=_step105$value[1].rect;_y7=this.vNodes.get(_et7);if(_y7){S=_x137,C=_y7.rect,P=this.getSceneRect(),X=qa(S,P),$=qa(C,P),K=_y7.toolsType,j=_y7.opt;nt=!1;(X!==$||S.w!==C.w||S.h!==C.h||$===Ji.intersect)&&(nt=!0),K===It.Text&&// (opt as TextOptions).workState === EventWorkState.Done &&
|
|
492
|
+
nt&&this.debounceUpdateCache.add(_et7);ct=A;(j.eraserlines&&j.eraserlines.length||j.eraserFaces)&&ct&&!this.debounceUpdateCache.has(_et7)&&this.debounceUpdateCache.add(_et7);}}}catch(err){_iterator105.e(err);}finally{_iterator105.f();}if(G&&this.localWork.reRenderSelector(),z){_iterator106=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator106.s();!(_step106=_iterator106.n()).done;){_step106$value=_slicedToArray(_step106.value,2),_et6=_step106$value[0],_x136=_step106$value[1];this.serviceWork.runSelectWork({workId:_et6,selectIds:_x136.selectIds,msgType:xt.Select,dataType:Kt.Service,viewId:this.viewId});}}catch(err){_iterator106.e(err);}finally{_iterator106.f();}}a=!0,this.debounceUpdateCameraId=setTimeout(function(){var x;_this99.debounceUpdateCameraId=void 0;var et=[];var _iterator107=_createForOfIteratorHelper(_this99.debounceUpdateCache.values()),_step107;try{var _loop12=function _loop12(){var y=_step107.value;var S=_this99.vNodes.get(y);if(S){var C=S.toolsType,P=S.opt,X=S.op,$=_this99.localWork.setFullWork({toolsType:C,opt:P,workId:y});$&&(C===It.Text?(x=_this99.fullLayer)!=null&&x.getElementsByName(y)[0]&&$ instanceof Ha&&et.push($.consumeServiceAsync({isFullWork:!0,replaceId:y,boxRect:_this99.getSceneRect()})):(P.eraserlines&&P.eraserlines.length||P.eraserFaces)&&et.push(new Promise(function(K){var j=$.consumeService({op:X,isFullWork:!0,replaceId:y,workState:te.Done});_this99.localWork.clearWorkShapeNodeCache(y),K(j);})));}_this99.debounceUpdateCache.delete(y);};for(_iterator107.s();!(_step107=_iterator107.n()).done;){_loop12();}}catch(err){_iterator107.e(err);}finally{_iterator107.f();}et.length?Promise.all(et).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee100(){var y;return _regenerator().w(function(_context108){while(1)switch(_context108.n){case 0:y=[];y.push({isClearAll:!0,clearCanvas:Yt.Bg,viewId:_this99.viewId},{isDrawAll:!0,drawCanvas:Yt.Bg,viewId:_this99.viewId});y.length&&_this99.post({render:y});_this99.vNodes.updateLowLevelNodesRect();_this99.vNodes.clearHighLevelIds();_context108.n=1;return _this99.fullLayer.parent.prepareRender;case 1:Ze(o)&&_this99.post({viewId:_this99.viewId,cameraSettledTaskId:o});case 2:return _context108.a(2);}},_callee100);}))):(_this99.vNodes.updateLowLevelNodesRect(),_this99.vNodes.clearHighLevelIds(),Ze(o)&&_this99.post({viewId:_this99.viewId,cameraSettledTaskId:o}));},h1*5);}M&&n.push({isClearAll:!0,clearCanvas:Yt.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&n.push({isClearAll:!0,clearCanvas:Yt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Yt.Bg,viewId:this.viewId}),n.length&&this.post({render:n}),!a&&Ze(o)&&this.post({viewId:this.viewId,cameraSettledTaskId:o});case 13:return _context109.a(2);}},_callee101,this,[[1,7,8,9]]);}));function updateCamera(_x133){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function(){var _getRectImageBitmap2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee102(e){var d,n,i,v,s,o,a,u,_v12,_t108;return _regenerator().w(function(_context110){while(1)switch(_context110.p=_context110.n){case 0:n=e.rect,i=e.drawCanvas;if(!(((d=this.opt.bitmapEraserMaskOptions)==null?void 0:d.imageBitmapDirtyRect)===!1)){_context110.n=1;break;}v=this.getOffscreen(i);return _context110.a(2,(n.x=0,n.y=0,n.w=v.width/this.dpr,n.h=v.height/this.dpr,createImageBitmap(v,0,0,v.width,v.height,{resizeQuality:"low"})));case 1:s=Math.floor(n.x*this.dpr),o=Math.floor(n.y*this.dpr),a=Math.floor(n.w*this.dpr||1),u=Math.floor(n.h*this.dpr||1);_context110.p=2;_context110.n=3;return createImageBitmap(this.getOffscreen(i),s,o,a,u,{resizeQuality:"low"});case 3:return _context110.a(2,_context110.v);case 4:_context110.p=4;_t108=_context110.v;this.opt.bitmapEraserMaskOptions&&(this.opt.bitmapEraserMaskOptions.imageBitmapDirtyRect=!1);_v12=this.getOffscreen(i);return _context110.a(2,(n.x=0,n.y=0,n.w=_v12.width/this.dpr,n.h=_v12.height/this.dpr,createImageBitmap(_v12,0,0,_v12.width,_v12.height,{resizeQuality:"low"})));}},_callee102,this,[[2,4]]);}));function getRectImageBitmap(_x140){return _getRectImageBitmap2.apply(this,arguments);}return getRectImageBitmap;}()},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee103(e){return _regenerator().w(function(_context111){while(1)switch(_context111.n){case 0:_context111.n=1;return this.localWork.cursorHover(e);case 1:return _context111.a(2);}},_callee103,this);}));function cursorHover(_x141){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee104(){return _regenerator().w(function(_context112){while(1)switch(_context112.n){case 0:_context112.n=1;return this.localWork.cursorBlur();case 1:return _context112.a(2);}},_callee104,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(aI,"destroy",this,3)([]);}}]);}(_S);var Qbt=/*#__PURE__*/function(_aI){function Qbt(e,n,i){var _this100;_classCallCheck(this,Qbt);var o,a,u,d;_this100=_callSuper(this,Qbt,[e,n,i]);wt(_this100,"snapshotWork");wt(_this100,"localDrawScene");wt(_this100,"serviceDrawScene");wt(_this100,"offscreenCanvas");wt(_this100,"localWork");wt(_this100,"serviceWork");if(_this100._post=i,n.offscreenCanvas){_this100.offscreenCanvas=n.offscreenCanvas,_this100.localDrawScene=_this100.createScene(n,(o=_this100.offscreenCanvas)==null?void 0:o.localCanvas),_this100.serviceDrawScene=_this100.createScene(n,(a=_this100.offscreenCanvas)==null?void 0:a.serviceCanvas);var v=zr.bufferSize.sub;_this100.serviceDrawLayer=_this100.createLayer("serviceDrawLayer",_this100.serviceDrawScene||_this100.scene,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:v,contextType:"2d"}),(u=_this100.offscreenCanvas)==null?void 0:u.serviceCanvas),_this100.localDrawLayer=_this100.createLayer("localDrawLayer",_this100.localDrawScene||_this100.scene,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:v,contextType:"2d"}),(d=_this100.offscreenCanvas)==null?void 0:d.localCanvas);}var s={thread:_this100,viewId:_this100.viewId,vNodes:_this100.vNodes,fullLayer:_this100.fullLayer};_this100.localWork=new Vbt(_objectSpread(_objectSpread({},s),{},{drawLayer:_this100.localDrawLayer})),n.combineUnitTime&&_this100.localWork.setCombineUnitTime(n.combineUnitTime),n.maxCombineEraserTime&&_this100.localWork.setmaxCombineEraserTime(n.maxCombineEraserTime),n.syncUnitTime&&_this100.localWork.setSyncUnitTime(n.syncUnitTime),_this100.serviceWork=new Zbt(_objectSpread(_objectSpread({},s),{},{drawLayer:_this100.serviceDrawLayer})),_this100.snapshotWork=new oI(_objectSpread(_objectSpread({},s),{},{createScene:_this100.createScene.bind(_this100),createLayer:_this100.createLayer.bind(_this100)})),_this100.methodBuilder=new Y2([ve.CopyNode,ve.SetColorNode,ve.DeleteNode,ve.RotateNode,ve.ScaleNode,ve.TranslateNode,ve.ZIndexNode,ve.SetFontStyle,ve.SetPoint,ve.SetLock,ve.SetShapeOpt]).registerForWorker(_this100);return _this100;}_inherits(Qbt,_aI);return _createClass(Qbt,[{key:"createRenderLayer",value:function createRenderLayer(e,n,i){var a;var s=zr.bufferSize.full,o=zr.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",e,_objectSpread(_objectSpread({},n.layerOpt),{},{bufferSize:this.viewId===Ds?s:o*2}),i||((a=n.offscreenCanvas)==null?void 0:a.bgCanvas));}},{key:"createScene",value:function createScene(e,n){var i=e.offscreenCanvas,s=e.offscreenCanvasOpt,o=s.width,a=s.height,u=n||(i==null?void 0:i.bgCanvas)||new OffscreenCanvas(o,a);s.contextType&&delete s.contextType;var d=new Jp(_objectSpread(_objectSpread({container:u,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},s),{},{contextType:this.contextType,id:this.viewId}));return d.setAttribute("id",this.viewId),d;}},{key:"combinePostData",value:function combinePostData(){var o,a;this.workerTaskId=void 0;var e=[],n=[];var i;var s=/* @__PURE__ */new Set();var _iterator108=_createForOfIteratorHelper(this.combinePostMsg.values()),_step108;try{for(_iterator108.s();!(_step108=_iterator108.n()).done;){var u=_step108.value;if((o=u.render)!=null&&o.length)try{if(this.offscreenCanvas){var _iterator109=_createForOfIteratorHelper(u.render),_step109;try{for(_iterator109.s();!(_step109=_iterator109.n()).done;){var d=_step109.value;d.workId&&s.add(d.workId);var v=d.drawCanvas||d.clearCanvas;if(v){var p=this.getLayer(v);if(!p||!(p.parent instanceof Zi))continue;p.parent.render();}}}catch(err){_iterator109.e(err);}finally{_iterator109.f();}}else{var _iterator110=_createForOfIteratorHelper(u.render),_step110;try{for(_iterator110.s();!(_step110=_iterator110.n()).done;){var _d0=_step110.value;var _v13=!1;if(_d0.workId&&s.add(_d0.workId),_d0.isClearAll&&(_d0.rect=this.getSceneRect(),_d0.isClear=!0,delete _d0.isClearAll),_d0.drawCanvas){var _p9=this.getLayer(_d0.drawCanvas);if(!_p9||!(_p9.parent instanceof Zi))continue;if(_p9.parent.render(),_d0.isDrawAll){var w=this.getSceneRect();_d0.rect=w,delete _d0.isDrawAll;}}var _iterator111=_createForOfIteratorHelper(e),_step111;try{for(_iterator111.s();!(_step111=_iterator111.n()).done;){var _p0=_step111.value;if(_d0.viewId===_p0.viewId){_d0.isClear&&_p0.clearCanvas&&_p0.isClear&&_p0.clearCanvas===_d0.clearCanvas&&(_p0.rect=Jt(_p0.rect,_d0.rect),_v13=!0),_p0.drawCanvas&&_p0.drawCanvas===_d0.drawCanvas&&(_p0.rect=Jt(_p0.rect,_d0.rect),_v13=!0);continue;}}}catch(err){_iterator111.e(err);}finally{_iterator111.f();}_v13||(_d0.isClear&&!_d0.drawCanvas?e.unshift(_d0):e.push(_d0));}}catch(err){_iterator110.e(err);}finally{_iterator110.f();}}}catch(d){var _v14=d&&d instanceof Error?d.message:d==null?void 0:d.toString();console.error("[WorkThreadEngineForSimpleWorker] combinePostData error",_v14),n.push({type:xt.ReportError,reportString:"[WorkThreadEngineForSimpleWorker] combinePostData error: ".concat(_v14)});}if((a=u.sp)!=null&&a.length){var _iterator112=_createForOfIteratorHelper(u.sp),_step112;try{for(_iterator112.s();!(_step112=_iterator112.n()).done;){var _d1=_step112.value;var _v15=!1;var _iterator113=_createForOfIteratorHelper(n),_step113;try{for(_iterator113.s();!(_step113=_iterator113.n()).done;){var _p1=_step113.value;if(qn(_d1,_p1)){_v15=!0;break;}}}catch(err){_iterator113.e(err);}finally{_iterator113.f();}_v15||n.push(_d1);}}catch(err){_iterator112.e(err);}finally{_iterator112.f();}}Ze(u.consumeCount)&&(i=u.consumeCount);}}catch(err){_iterator108.e(err);}finally{_iterator108.f();}return this.combinePostMsg.clear(),{render:e,sp:n,consumeCount:i,workIds:s,viewId:this.viewId};}},{key:"on",value:function(){var _on4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee105(e){var n,_t109;return _regenerator().w(function(_context113){while(1)switch(_context113.n){case 0:if(!this.methodBuilder.consumeForWorker(e)){_context113.n=1;break;}return _context113.a(2);case 1:n=e.msgType;_t109=n;_context113.n=_t109===xt.Snapshot?2:_t109===xt.BoundingBox?4:6;break;case 2:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ds?6e3:3e3,contextType:"2d"}));_context113.n=3;return this.snapshotWork.getSnapshot(e);case 3:this.snapshotWork.destroySnapshotFullLayer();return _context113.a(2);case 4:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===Ds?6e3:3e3,contextType:"2d"}));_context113.n=5;return this.snapshotWork.getBoundingRect(e);case 5:this.snapshotWork.destroySnapshotFullLayer();return _context113.a(2);case 6:_context113.n=7;return _superPropGet(Qbt,"on",this,3)([e]);case 7:return _context113.a(2);}},_callee105,this);}));function on(_x142){return _on4.apply(this,arguments);}return on;}()},{key:"setCameraOpt",value:function setCameraOpt(e){if(this.localDrawScene&&this.serviceDrawScene){var n=e.width,i=e.height;(n!==this.localDrawScene.width||i!==this.localDrawScene.height)&&this.updateScene(this.localDrawScene,{width:n,height:i},this.localDrawLayer),(n!==this.serviceDrawScene.width||i!==this.serviceDrawScene.height)&&this.updateScene(this.serviceDrawScene,{width:n,height:i},this.serviceDrawLayer);}_superPropGet(Qbt,"setCameraOpt",this,3)([e]);}},{key:"updateDpr",value:function(){var _updateDpr4=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee106(e){return _regenerator().w(function(_context114){while(1)switch(_context114.n){case 0:this.localDrawScene&&this.serviceDrawScene&&(this.localDrawScene.displayRatio=e,this.serviceDrawScene.displayRatio=e),_superPropGet(Qbt,"updateDpr",this,3)([e]);case 1:return _context114.a(2);}},_callee106,this);}));function updateDpr(_x143){return _updateDpr4.apply(this,arguments);}return updateDpr;}()}]);}(aI);var A1=self;A1.full=new qbt(A1,Tu.Full,function(r,t){var e=r.viewId,n=r.dpr,i=r.offscreenCanvasOpt,s=r.layerOpt,o=r.combineUnitTime,a=r.syncUnitTime,u=r.maxCombineEraserTime,d=r.offscreenCanvas,v=r.isUseSimple,p=r.bitmapEraserMaskOptions;if(!e||!n||!i||!s)return;var w={dpr:n,offscreenCanvasOpt:i,layerOpt:s,combineUnitTime:o,syncUnitTime:a,maxCombineEraserTime:u,bitmapEraserMaskOptions:p};return v?new Qbt(e,_objectSpread(_objectSpread({},w),{},{offscreenCanvas:d}),t):new aI(e,w,t);});
|